From: Andrea Bianco Date: Thu, 16 Jan 2020 13:38:07 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.3 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=85133991254dd648d43ce77d28cc7c5b0c98c4b6;p=motion2.git Built motion from commit (unavailable).|2.4.3 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f803013..48d7603 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-15T17:14:21.752Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.4.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-16T13:29:32.198Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a58dabd..92b8c83 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.4.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-15T17:14:21.752Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.4.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-01-16T13:29:32.198Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/public/app/main/apps/staff/i18n/ar.json b/public/app/main/apps/staff/i18n/ar.json index 44405b2..294f69d 100644 --- a/public/app/main/apps/staff/i18n/ar.json +++ b/public/app/main/apps/staff/i18n/ar.json @@ -63,8 +63,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "تتم إدارة أذونات Dashboards المخصصة في وحدة الأدوات", "APIKEY": "يرجى استخدام زر \"API key manager\" على شريط الأدوات لإدارة هذا المفتاح", "ENABLEAUTOMATICSCREENRECORDING": "تتوفر الوظيفة للقناة الصوتية فقط", - "BLOCKED": "قم بإيقاف التشغيل لفتح حساب محظور", - "DISABLED": "تعطيل / تمكين الحساب" + "BLOCKED": "قفل / فتح الوصول", + "DISABLED": "حدد لإلغاء تنشيط / إلغاء تحديد لإعادة تنشيط" }, "ADD_AGENT": "إضافة ممثل خدمة", "ADD_USER": "إضافة المستخدم", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "تمكين تسجيل الشاشة التلقائي", "ENABLESCREENRECORDINGBYAGENT": "تمكين تسجيل الشاشة بواسطة وكيل", "ENABLEVIDEOECORDING": "تمكين تسجيل الفيديو", - "BLOCKED": "مسدود", - "DISABLED": "معاق" + "BLOCKED": "مقفل", + "DISABLED": "المعطلة" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/da.json b/public/app/main/apps/staff/i18n/da.json index 988b0c0..bf53f8b 100644 --- a/public/app/main/apps/staff/i18n/da.json +++ b/public/app/main/apps/staff/i18n/da.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Tilpassede Dashboards tilladelser administreres i modulet Værktøjer", "APIKEY": "Brug knappen 'API-nøglemanager' på værktøjslinjen til at administrere denne nøgle", "ENABLEAUTOMATICSCREENRECORDING": "Funktionaliteten er kun tilgængelig for stemmekanal", - "BLOCKED": "Sluk for at låse en blokeret konto op", - "DISABLED": "Deaktiver / aktiver kontoen" + "BLOCKED": "Lås / lås op adgang", + "DISABLED": "vælg for at deaktivere / fjerne markering for at genaktivere" }, "NEW_PASSWORD": "Ny adgangskode", "CONFIRM_PASSWORD": "Bekræft adgangskode", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Aktivér automatisk skærmoptagelse", "ENABLESCREENRECORDINGBYAGENT": "Aktivér skærmoptagelse af agent", "ENABLEVIDEOECORDING": "Aktivér videooptagelse", - "BLOCKED": "blokeret", - "DISABLED": "handicappet" + "BLOCKED": "Låst", + "DISABLED": "Deaktiveret" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/de.json b/public/app/main/apps/staff/i18n/de.json index 631771b..a5ffc0a 100644 --- a/public/app/main/apps/staff/i18n/de.json +++ b/public/app/main/apps/staff/i18n/de.json @@ -111,8 +111,8 @@ "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": "Die Funktionalität ist nur für Sprachkanäle verfügbar", - "BLOCKED": "Ausschalten, um ein gesperrtes Konto zu entsperren", - "DISABLED": "Deaktivieren / Aktivieren Sie das Konto" + "BLOCKED": "Zugriff sperren / entsperren", + "DISABLED": "Zum Deaktivieren auswählen / Zum Reaktivieren deaktivieren" }, "NEW_PASSWORD": "Neues Kennwort", "CONFIRM_PASSWORD": "Passwort bestätigen", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Aktivieren Sie die automatische Bildschirmaufnahme", "ENABLESCREENRECORDINGBYAGENT": "Aktivieren Sie die Bildschirmaufzeichnung nach Agent", "ENABLEVIDEOECORDING": "Videoaufnahme aktivieren", - "BLOCKED": "verstopft", + "BLOCKED": "Gesperrt", "DISABLED": "Deaktiviert" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/en.json b/public/app/main/apps/staff/i18n/en.json index 7fe8cce..5d50ff4 100644 --- a/public/app/main/apps/staff/i18n/en.json +++ b/public/app/main/apps/staff/i18n/en.json @@ -108,11 +108,11 @@ "INTERNAL": "Internal", "TRANSPORT": "Transport", "ALLOWCODECS": "Allowed Codecs", - "DISABLED": "Disabled", - "BLOCKED": "Blocked", + "DISABLED": "Deactivated", + "BLOCKED": "Locked", "HELP": { - "DISABLED": "Disable/Enable the account", - "BLOCKED": "Switch off to unlock a blocked account", + "DISABLED": "select to deactivate / unselect to reactivate", + "BLOCKED": "Lock / Unlock access", "APIKEY": "Please use 'API key manager' button on toolbar to manage this key", "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", diff --git a/public/app/main/apps/staff/i18n/es.json b/public/app/main/apps/staff/i18n/es.json index b3d553a..d60f67d 100644 --- a/public/app/main/apps/staff/i18n/es.json +++ b/public/app/main/apps/staff/i18n/es.json @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Habilitar grabación automática de pantalla", "ENABLESCREENRECORDINGBYAGENT": "Habilitar grabación de pantalla por agente", "ENABLEVIDEOECORDING": "Habilitar grabación de video", - "BLOCKED": "Obstruido", - "DISABLED": "Discapacitado" + "BLOCKED": "Bloqueado", + "DISABLED": "Deshabilitado" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/fa.json b/public/app/main/apps/staff/i18n/fa.json index a4db600..87ef079 100644 --- a/public/app/main/apps/staff/i18n/fa.json +++ b/public/app/main/apps/staff/i18n/fa.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "مجوزهای داشبوردهای سفارشی در ماژول Tools مدیریت می شوند", "APIKEY": "لطفاً برای مدیریت این کلید از دکمه \"مدیر کلید API\" در نوار ابزار استفاده کنید", "ENABLEAUTOMATICSCREENRECORDING": "این عملکرد فقط برای کانال صوتی در دسترس است", - "BLOCKED": "خاموش شود تا حساب مسدود شده را باز کنید", - "DISABLED": "غیرفعال کردن / فعال کردن حساب" + "BLOCKED": "دسترسی را قفل / باز کنید", + "DISABLED": "غیرفعال کردن / انتخاب مجدد برای فعال کردن مجدد را انتخاب کنید" }, "NEW_PASSWORD": "اسم رمز جدید", "CONFIRM_PASSWORD": "تأیید رمز ورود", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "ضبط خودکار صفحه نمایش را فعال کنید", "ENABLESCREENRECORDINGBYAGENT": "ضبط صفحه توسط نماینده را فعال کنید", "ENABLEVIDEOECORDING": "ضبط ویدیو را فعال کنید", - "BLOCKED": "مسدود", - "DISABLED": "معلول" + "BLOCKED": "قفل شده", + "DISABLED": "غیرفعال شده است" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/fi.json b/public/app/main/apps/staff/i18n/fi.json index 3ab2719..fd05d2a 100644 --- a/public/app/main/apps/staff/i18n/fi.json +++ b/public/app/main/apps/staff/i18n/fi.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Mukautettujen hallintapaneelien käyttöoikeuksia hallitaan Työkalut-moduulissa", "APIKEY": "Käytä työkalurivin API-avainten hallinta -painiketta tämän avaimen hallintaan", "ENABLEAUTOMATICSCREENRECORDING": "Toiminto on saatavana vain äänikanaville", - "BLOCKED": "Sammuta tili, kun haluat lukita tilin", - "DISABLED": "Poista tili käytöstä / ota se käyttöön" + "BLOCKED": "Lukitse / avaa pääsy", + "DISABLED": "valitse, jos haluat poistaa käytöstä tai poistaa valinnan uudelleen aktivoidaksesi" }, "NEW_PASSWORD": "Uusi salasana", "CONFIRM_PASSWORD": "Vahvista salasana", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Ota automaattinen näytön tallennus käyttöön", "ENABLESCREENRECORDINGBYAGENT": "Ota näytön tallennus käyttöön agentin toimesta", "ENABLEVIDEOECORDING": "Ota videotallennus käyttöön", - "BLOCKED": "Tukossa", - "DISABLED": "Liikuntarajoitteinen" + "BLOCKED": "kiinni", + "DISABLED": "deaktivoitu" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/fr.json b/public/app/main/apps/staff/i18n/fr.json index 5cc18b5..ad4edd4 100644 --- a/public/app/main/apps/staff/i18n/fr.json +++ b/public/app/main/apps/staff/i18n/fr.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Les autorisations de tableaux de bord personnalisés sont gérées dans le module Outils", "APIKEY": "Veuillez utiliser le bouton 'Gestionnaire de clés d'API' sur la barre d'outils pour gérer cette clé.", "ENABLEAUTOMATICSCREENRECORDING": "La fonctionnalité est disponible uniquement pour le canal vocal", - "BLOCKED": "Désactiver pour déverrouiller un compte bloqué", - "DISABLED": "Désactiver / activer le compte" + "BLOCKED": "Verrouiller / Déverrouiller l'accès", + "DISABLED": "sélectionner pour désactiver / désélectionner pour réactiver" }, "NEW_PASSWORD": "Nouveau mot de passe", "CONFIRM_PASSWORD": "Confirmer le mot de passe", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Activer l'enregistrement d'écran automatique", "ENABLESCREENRECORDINGBYAGENT": "Activer l'enregistrement d'écran par l'agent", "ENABLEVIDEOECORDING": "Activer l'enregistrement vidéo", - "BLOCKED": "Bloqué", - "DISABLED": "désactivé" + "BLOCKED": "Fermé à clé", + "DISABLED": "Désactivée" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/he.json b/public/app/main/apps/staff/i18n/he.json index 83e2d8a..25f20fb 100644 --- a/public/app/main/apps/staff/i18n/he.json +++ b/public/app/main/apps/staff/i18n/he.json @@ -124,8 +124,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "הרשאות לוח המחוונים המותאמות אישית מנוהלות במודול הכלים", "APIKEY": "אנא השתמש בכפתור 'מנהל מקש API' בסרגל הכלים כדי לנהל מפתח זה", "ENABLEAUTOMATICSCREENRECORDING": "הפונקציונליות זמינה רק לערוץ קולי", - "BLOCKED": "כבה לביטול נעילת חשבון חסום", - "DISABLED": "השבת / הפעל את החשבון" + "BLOCKED": "נעילה / ביטול נעילת גישה", + "DISABLED": "בחר לבטל / לבטל את הבחירה להפעלה מחדש" }, "NEW_PASSWORD": "סיסמה חדשה", "CONFIRM_PASSWORD": "אשר סיסמה", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "אפשר הקלטת מסך אוטומטית", "ENABLESCREENRECORDINGBYAGENT": "אפשר הקלטת מסך על ידי סוכן", "ENABLEVIDEOECORDING": "אפשר הקלטת וידאו", - "BLOCKED": "חסום", - "DISABLED": "נכים" + "BLOCKED": "נעול", + "DISABLED": "מבוטל" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/hi.json b/public/app/main/apps/staff/i18n/hi.json index d8eb14f..21805e2 100644 --- a/public/app/main/apps/staff/i18n/hi.json +++ b/public/app/main/apps/staff/i18n/hi.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "कस्टम डैशबोर्ड अनुमतियाँ टूल मॉड्यूल में प्रबंधित की जाती हैं", "APIKEY": "कृपया इस कुंजी को प्रबंधित करने के लिए टूलबार पर 'एपीआई कुंजी प्रबंधक' बटन का उपयोग करें", "ENABLEAUTOMATICSCREENRECORDING": "कार्यक्षमता केवल वॉयस चैनल के लिए उपलब्ध है", - "BLOCKED": "अवरुद्ध खाते को अनलॉक करने के लिए स्विच ऑफ करें", - "DISABLED": "खाता अक्षम / सक्षम करें" + "BLOCKED": "लॉक / अनलॉक का उपयोग", + "DISABLED": "पुनः सक्रिय करने के लिए निष्क्रिय / अचयनित करने का चयन करें" }, "NEW_PASSWORD": "नया पासवर्ड", "CONFIRM_PASSWORD": "पासवर्ड की पुष्टि करें:", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "स्वचालित स्क्रीन रिकॉर्डिंग सक्षम करें", "ENABLESCREENRECORDINGBYAGENT": "एजेंट द्वारा स्क्रीन रिकॉर्डिंग सक्षम करें", "ENABLEVIDEOECORDING": "वीडियो रिकॉर्डिंग सक्षम करें", - "BLOCKED": "अवरोधित", - "DISABLED": "विकलांग" + "BLOCKED": "बंद", + "DISABLED": "निष्क्रिय" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/id.json b/public/app/main/apps/staff/i18n/id.json index 3b51536..ce60415 100644 --- a/public/app/main/apps/staff/i18n/id.json +++ b/public/app/main/apps/staff/i18n/id.json @@ -63,8 +63,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Izin Dasbor Kustom dikelola dalam modul Alat", "APIKEY": "Silakan gunakan tombol 'Manajer kunci API' pada bilah alat untuk mengelola kunci ini", "ENABLEAUTOMATICSCREENRECORDING": "Fungsionalitas hanya tersedia untuk saluran suara", - "BLOCKED": "Nonaktifkan untuk membuka kunci akun yang diblokir", - "DISABLED": "Nonaktifkan / Aktifkan akun" + "BLOCKED": "Kunci / Buka kunci akses", + "DISABLED": "pilih untuk menonaktifkan / membatalkan pilihan untuk mengaktifkan kembali" }, "ACCOUNT": "Rekening", "ACCOUNTNAME": "Nama akun", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Aktifkan Perekaman Layar Otomatis", "ENABLESCREENRECORDINGBYAGENT": "Aktifkan Perekaman Layar oleh Agen", "ENABLEVIDEOECORDING": "Aktifkan Perekaman Video", - "BLOCKED": "Dicekal", - "DISABLED": "Dengan disabilitas" + "BLOCKED": "Terkunci", + "DISABLED": "Dinonaktifkan" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/it.json b/public/app/main/apps/staff/i18n/it.json index 27b0861..fef8c0f 100644 --- a/public/app/main/apps/staff/i18n/it.json +++ b/public/app/main/apps/staff/i18n/it.json @@ -102,8 +102,6 @@ "INTERNAL": "Interno", "TRANSPORT": "Protocollo", "ALLOWCODECS": "Codecs Abilitati", - "DISABLED": "Disabilitato", - "BLOCKED": "Bloccato", "HELP": { "LAST_PASSWORD_RESET_AT": "Ultimo cambio password. Se la Suite Sicurezza nelle Impostazioni Generali è stata abilitata, la password scadrà dopo 90 giorni", "DTLSCERTFILE": "Link al certificato valido TLS(.crt file). Valore di default: '/etc/pki/tls/certs/motion.crt'.", @@ -128,8 +126,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "I permessi delle Custom Dashboards sono gestiti nel modulo Tools", "APIKEY": "Utilizzare il pulsante \"Gestione API Key\" sulla barra degli strumenti per gestire questa chiave", "ENABLEAUTOMATICSCREENRECORDING": " La funzionalità è attiva solo per il canale voce", - "BLOCKED": "Spegni per sbloccare un account bloccato", - "DISABLED": "Disabilita / Abilita l'account" + "BLOCKED": "Blocca / sblocca l'accesso", + "DISABLED": "selezionare per disattivare / deselezionare per riattivare" }, "NEW_PASSWORD": "Nuova Password", "CONFIRM_PASSWORD": "Conferma Password", @@ -341,6 +339,8 @@ "GENERATE": "(Ri)Generare", "MANAGE_API_KEY": "Gestore API Key", "REMOVE": "Rimuovere", - "ENABLEVIDEOECORDING": "Abilita registrazione video" + "ENABLEVIDEOECORDING": "Abilita registrazione video", + "BLOCKED": "Bloccato", + "DISABLED": "Disattivato" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/ja.json b/public/app/main/apps/staff/i18n/ja.json index 32ce33c..86576d1 100644 --- a/public/app/main/apps/staff/i18n/ja.json +++ b/public/app/main/apps/staff/i18n/ja.json @@ -63,8 +63,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "カスタムダッシュボードの権限は、ツールモジュールで管理されます", "APIKEY": "このキーを管理するには、ツールバーの「APIキーマネージャー」ボタンを使用してください", "ENABLEAUTOMATICSCREENRECORDING": "この機能は音声チャンネルでのみ利用可能です", - "BLOCKED": "ブロックされたアカウントのロックを解除するには、スイッチをオフにしてください", - "DISABLED": "アカウントを無効/有効にする" + "BLOCKED": "アクセスのロック/ロック解除", + "DISABLED": "非アクティブ化を選択/再アクティブ化を選択解除" }, "ACCOUNT": "アカウント", "ACCOUNTNAME": "アカウント名", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "自動画面記録を有効にする", "ENABLESCREENRECORDINGBYAGENT": "エージェントによる画面記録を有効にする", "ENABLEVIDEOECORDING": "ビデオ録画を有効にする", - "BLOCKED": "ブロックされました", - "DISABLED": "無効" + "BLOCKED": "ロック済み", + "DISABLED": "無効化" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/ko.json b/public/app/main/apps/staff/i18n/ko.json index 7f7c51e..0e75ee2 100644 --- a/public/app/main/apps/staff/i18n/ko.json +++ b/public/app/main/apps/staff/i18n/ko.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "사용자 정의 대시 보드 권한은 도구 모듈에서 관리됩니다.", "APIKEY": "이 키를 관리하려면 툴바의 'API 키 관리자'버튼을 사용하십시오", "ENABLEAUTOMATICSCREENRECORDING": "이 기능은 음성 채널에만 사용할 수 있습니다", - "BLOCKED": "차단 된 계정을 잠금 해제하려면 끄십시오", - "DISABLED": "계정 비활성화 / 활성화" + "BLOCKED": "액세스 잠금 / 잠금 해제", + "DISABLED": "비활성화하려면 선택 / 비활성화하려면 선택 취소" }, "NEW_PASSWORD": "신규 비밀번호", "CONFIRM_PASSWORD": "비밀번호 확인", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "자동 화면 녹화 사용", "ENABLESCREENRECORDINGBYAGENT": "에이전트 별 화면 녹화 활성화", "ENABLEVIDEOECORDING": "비디오 녹화 활성화", - "BLOCKED": "막힌", + "BLOCKED": "잠김", "DISABLED": "비활성화" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/lv.json b/public/app/main/apps/staff/i18n/lv.json index 632b9bb..b6b16e5 100644 --- a/public/app/main/apps/staff/i18n/lv.json +++ b/public/app/main/apps/staff/i18n/lv.json @@ -63,8 +63,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Pielāgotu informācijas paneļu atļaujas tiek pārvaldītas modulī Rīki", "APIKEY": "Lai pārvaldītu šo atslēgu, izmantojiet rīkjoslas pogu “API atslēgu pārvaldnieks”", "ENABLEAUTOMATICSCREENRECORDING": "Funkcija ir pieejama tikai balss kanālam", - "BLOCKED": "Izslēdziet, lai atbloķētu bloķētu kontu", - "DISABLED": "Atspējot / iespējot kontu" + "BLOCKED": "Bloķēt / atbloķēt piekļuvi", + "DISABLED": "atlasiet, lai deaktivizētu / noņemtu atlasi, lai atkārtoti aktivizētu" }, "NO_PASSWORD_CHANGE": "Nav paroles maiņas", "SECURITY_SUITE": "Drošības komplekts", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Iespējot automātisko ekrāna ierakstīšanu", "ENABLESCREENRECORDINGBYAGENT": "Iespējot ekrāna ierakstīšanu ar aģenta palīdzību", "ENABLEVIDEOECORDING": "Iespējot video ierakstīšanu", - "BLOCKED": "Bloķēts", - "DISABLED": "Invalīds" + "BLOCKED": "Slēgts", + "DISABLED": "Deaktivizēts" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/nl.json b/public/app/main/apps/staff/i18n/nl.json index 55baeb0..0c744f6 100644 --- a/public/app/main/apps/staff/i18n/nl.json +++ b/public/app/main/apps/staff/i18n/nl.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Aangepaste Dashboards-machtigingen worden beheerd in de module Tools", "APIKEY": "Gebruik de knop 'API-sleutelbeheer' op de werkbalk om deze sleutel te beheren", "ENABLEAUTOMATICSCREENRECORDING": "De functionaliteit is alleen beschikbaar voor spraakkanaal", - "BLOCKED": "Schakel uit om een geblokkeerde account te ontgrendelen", - "DISABLED": "Schakel het account uit / in" + "BLOCKED": "Toegang vergrendelen / ontgrendelen", + "DISABLED": "selecteer om te deactiveren / deselecteer om te reactiveren" }, "NEW_PASSWORD": "Nieuw wachtwoord", "CONFIRM_PASSWORD": "Wachtwoord bevestigen", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Schakel Automatische schermopname in", "ENABLESCREENRECORDINGBYAGENT": "Schermopname per agent inschakelen", "ENABLEVIDEOECORDING": "Schakel video-opname in", - "BLOCKED": "geblokkeerd", - "DISABLED": "Gehandicapt" + "BLOCKED": "Op slot", + "DISABLED": "Gedeactiveerd" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/no.json b/public/app/main/apps/staff/i18n/no.json index 74ad686..5e245b2 100644 --- a/public/app/main/apps/staff/i18n/no.json +++ b/public/app/main/apps/staff/i18n/no.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Tilpassede Dashboards-tillatelser administreres i Verktøy-modulen", "APIKEY": "Bruk knappen API-nøkkelbehandling på verktøylinjen for å administrere denne nøkkelen", "ENABLEAUTOMATICSCREENRECORDING": "Funksjonaliteten er bare tilgjengelig for talekanal", - "BLOCKED": "Slå av for å låse opp en blokkert konto", - "DISABLED": "Deaktiver / aktiver kontoen" + "BLOCKED": "Lås / lås opp tilgangen", + "DISABLED": "Velg for å deaktivere / fjerne merket for å aktivere på nytt" }, "NEW_PASSWORD": "Nytt passord", "CONFIRM_PASSWORD": "Bekreft passord", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Aktiver automatisk skjermopptak", "ENABLESCREENRECORDINGBYAGENT": "Aktiver skjermopptak av agent", "ENABLEVIDEOECORDING": "Aktiver videoopptak", - "BLOCKED": "blokkert", - "DISABLED": "Funksjonshemmet" + "BLOCKED": "Låst", + "DISABLED": "Deaktivert" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/pl.json b/public/app/main/apps/staff/i18n/pl.json index 72cb038..77cfa22 100644 --- a/public/app/main/apps/staff/i18n/pl.json +++ b/public/app/main/apps/staff/i18n/pl.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Niestandardowymi uprawnieniami do paneli kontrolnych zarządza się w module Narzędzia", "APIKEY": "Użyj przycisku „Menedżer kluczy API” na pasku narzędzi, aby zarządzać tym kluczem", "ENABLEAUTOMATICSCREENRECORDING": "Ta funkcja jest dostępna tylko dla kanału głosowego", - "BLOCKED": "Wyłącz, aby odblokować zablokowane konto", - "DISABLED": "Wyłącz / Włącz konto" + "BLOCKED": "Zablokuj / odblokuj dostęp", + "DISABLED": "wybierz, aby dezaktywować / odznaczyć, aby reaktywować" }, "NEW_PASSWORD": "Nowe hasło", "CONFIRM_PASSWORD": "Potwierdź hasło", @@ -333,6 +333,6 @@ "ENABLESCREENRECORDINGBYAGENT": "Włącz nagrywanie ekranu przez agenta", "ENABLEVIDEOECORDING": "Włącz nagrywanie wideo", "BLOCKED": "Zablokowany", - "DISABLED": "Niepełnosprawny" + "DISABLED": "Dezaktywowano" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/pt-BR.json b/public/app/main/apps/staff/i18n/pt-BR.json index 1aa1986..9f94e85 100644 --- a/public/app/main/apps/staff/i18n/pt-BR.json +++ b/public/app/main/apps/staff/i18n/pt-BR.json @@ -124,8 +124,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "As permissões de painéis personalizados são gerenciadas no módulo Ferramentas", "APIKEY": "Use o botão 'API key manager' na barra de ferramentas para gerenciar essa chave", "ENABLEAUTOMATICSCREENRECORDING": "A funcionalidade está disponível apenas para canal de voz", - "BLOCKED": "Desative para desbloquear uma conta bloqueada", - "DISABLED": "Desativar / Ativar a conta" + "BLOCKED": "Bloquear / desbloquear acesso", + "DISABLED": "selecione para desativar / desmarcar para reativar" }, "NEW_PASSWORD": "Nova Senha", "CONFIRM_PASSWORD": "Confirmar a Senha", diff --git a/public/app/main/apps/staff/i18n/pt-PT.json b/public/app/main/apps/staff/i18n/pt-PT.json index c9f0b88..477bb12 100644 --- a/public/app/main/apps/staff/i18n/pt-PT.json +++ b/public/app/main/apps/staff/i18n/pt-PT.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "As permissões de painéis personalizados são gerenciadas no módulo Ferramentas", "APIKEY": "Use o botão 'API key manager' na barra de ferramentas para gerenciar essa chave", "ENABLEAUTOMATICSCREENRECORDING": "A funcionalidade está disponível apenas para canal de voz", - "BLOCKED": "Desative para desbloquear uma conta bloqueada", - "DISABLED": "Desativar / Ativar a conta" + "BLOCKED": "Bloquear / desbloquear acesso", + "DISABLED": "selecione para desativar / desmarcar para reativar" }, "NEW_PASSWORD": "Nova Senha", "CONFIRM_PASSWORD": "Confirmar Senha", diff --git a/public/app/main/apps/staff/i18n/ru.json b/public/app/main/apps/staff/i18n/ru.json index 2563dd8..474c14c 100644 --- a/public/app/main/apps/staff/i18n/ru.json +++ b/public/app/main/apps/staff/i18n/ru.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Пользовательские разрешения Dashboards управляются в модуле Инструменты", "APIKEY": "Пожалуйста, используйте кнопку «API key manager» на панели инструментов для управления этим ключом", "ENABLEAUTOMATICSCREENRECORDING": "Функциональность доступна только для голосового канала", - "BLOCKED": "Выключите, чтобы разблокировать заблокированный аккаунт", - "DISABLED": "Отключить / Включить учетную запись" + "BLOCKED": "Блокировка / разблокировка доступа", + "DISABLED": "выберите, чтобы деактивировать / отменить выбор, чтобы активировать" }, "NEW_PASSWORD": "Новый пароль", "CONFIRM_PASSWORD": "Подтвердите пароль", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Включить автоматическую запись экрана", "ENABLESCREENRECORDINGBYAGENT": "Включить запись экрана агентом", "ENABLEVIDEOECORDING": "Включить запись видео", - "BLOCKED": "блокированный", - "DISABLED": "Отключено" + "BLOCKED": "запертый", + "DISABLED": "ММГ" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/sv.json b/public/app/main/apps/staff/i18n/sv.json index 58095a3..85fd04c 100644 --- a/public/app/main/apps/staff/i18n/sv.json +++ b/public/app/main/apps/staff/i18n/sv.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Anpassade Dashboards-behörigheter hanteras i Verktygsmodulen", "APIKEY": "Använd knappen \"API-nyckelhanterare\" i verktygsfältet för att hantera den här nyckeln", "ENABLEAUTOMATICSCREENRECORDING": "Funktionaliteten är endast tillgänglig för röstkanal", - "BLOCKED": "Stäng av för att låsa upp ett blockerat konto", - "DISABLED": "Inaktivera / aktivera kontot" + "BLOCKED": "Lås / lås upp åtkomst", + "DISABLED": "välj för att inaktivera / avmarkera för att återaktivera" }, "NEW_PASSWORD": "Nytt lösenord", "CONFIRM_PASSWORD": "Bekräfta lösenord", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Aktivera automatisk skärminspelning", "ENABLESCREENRECORDINGBYAGENT": "Aktivera skärminspelning av agent", "ENABLEVIDEOECORDING": "Aktivera videoinspelning", - "BLOCKED": "Blockerad", + "BLOCKED": "låst", "DISABLED": "Inaktiverad" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/tr.json b/public/app/main/apps/staff/i18n/tr.json index fbc50ef..43d0435 100644 --- a/public/app/main/apps/staff/i18n/tr.json +++ b/public/app/main/apps/staff/i18n/tr.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "Özel Pano izinleri Araçlar modülünde yönetilir", "APIKEY": "Lütfen bu anahtarı yönetmek için araç çubuğundaki 'API anahtar yöneticisi' düğmesini kullanın", "ENABLEAUTOMATICSCREENRECORDING": "İşlevsellik yalnızca ses kanalı için kullanılabilir.", - "BLOCKED": "Engellenen bir hesabın kilidini açmak için kapatın", - "DISABLED": "Hesabı devre dışı bırak / etkinleştir" + "BLOCKED": "Erişimi kilitleme / kilidi açma", + "DISABLED": "devre dışı bırakmak için seçin / yeniden etkinleştirmek için seçimi kaldırın" }, "NEW_PASSWORD": "Yeni Parola", "CONFIRM_PASSWORD": "Parolayı Onayla", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "Otomatik Ekran Kaydını Etkinleştir", "ENABLESCREENRECORDINGBYAGENT": "Aracıya Göre Ekran Kaydını Etkinleştir", "ENABLEVIDEOECORDING": "Video Kaydını Etkinleştir", - "BLOCKED": "tıkalı", - "DISABLED": "engelli" + "BLOCKED": "Kilitli", + "DISABLED": "Devre dışı" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/zh-CN.json b/public/app/main/apps/staff/i18n/zh-CN.json index dac734e..3f36833 100644 --- a/public/app/main/apps/staff/i18n/zh-CN.json +++ b/public/app/main/apps/staff/i18n/zh-CN.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "自定义仪表板权限在“工具”模块中进行管理", "APIKEY": "请使用工具栏上的“API密钥管理器”按钮来管理此密钥", "ENABLEAUTOMATICSCREENRECORDING": "该功能仅适用于语音通道", - "BLOCKED": "关闭以解锁被阻止的帐户", - "DISABLED": "禁用/启用帐户" + "BLOCKED": "锁定/解锁访问", + "DISABLED": "选择禁用/取消选择重新激活" }, "NEW_PASSWORD": "新的密码。", "CONFIRM_PASSWORD": "确认密码", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "启用自动屏幕记录", "ENABLESCREENRECORDINGBYAGENT": "按代理启用屏幕记录", "ENABLEVIDEOECORDING": "启用视频录制", - "BLOCKED": "受阻", - "DISABLED": "残障人士" + "BLOCKED": "已锁定", + "DISABLED": "已停用" } } \ No newline at end of file diff --git a/public/app/main/apps/staff/i18n/zh-TW.json b/public/app/main/apps/staff/i18n/zh-TW.json index d1b217b..e92699c 100644 --- a/public/app/main/apps/staff/i18n/zh-TW.json +++ b/public/app/main/apps/staff/i18n/zh-TW.json @@ -111,8 +111,8 @@ "CUSTOM_DASHBOARDS_PERMISSIONS": "自定義儀表板權限在“工具”模塊中進行管理", "APIKEY": "請使用工具欄上的“API密鑰管理器”按鈕來管理此密鑰", "ENABLEAUTOMATICSCREENRECORDING": "該功能僅適用於語音通道", - "BLOCKED": "關閉以解鎖被阻止的帳戶", - "DISABLED": "禁用/啟用帳戶" + "BLOCKED": "鎖定/解鎖訪問", + "DISABLED": "選擇禁用/取消選擇重新激活" }, "NEW_PASSWORD": "新密碼", "CONFIRM_PASSWORD": "確認密碼", @@ -332,7 +332,7 @@ "ENABLEAUTOMATICSCREENRECORDING": "啟用自動屏幕記錄", "ENABLESCREENRECORDINGBYAGENT": "按代理啟用屏幕記錄", "ENABLEVIDEOECORDING": "啟用視頻錄製", - "BLOCKED": "受阻", - "DISABLED": "殘障人士" + "BLOCKED": "已鎖定", + "DISABLED": "已停用" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/fi.json b/public/app/toolbar/i18n/fi.json index 2403dd6..a79b273 100644 --- a/public/app/toolbar/i18n/fi.json +++ b/public/app/toolbar/i18n/fi.json @@ -23,7 +23,7 @@ "PORTUGUESE": "Portugalin", "NORWEGIAN": "Norja", "HINDI": "Hindin", - "TURKISH": "Turkin", + "TURKISH": "Turkki", "PERSIAN": "Persialais", "LOGIN_TIME": "Kirjaudu aika", "PAUSE_TIME": "Tauon pituus", diff --git a/public/app/toolbar/i18n/pt-PT.json b/public/app/toolbar/i18n/pt-PT.json index 237625b..ee91e44 100644 --- a/public/app/toolbar/i18n/pt-PT.json +++ b/public/app/toolbar/i18n/pt-PT.json @@ -23,7 +23,7 @@ "PORTUGUESE": "Português", "NORWEGIAN": "Norueguês", "HINDI": "O Hindi", - "TURKISH": "Banho turco", + "TURKISH": "Turco", "PERSIAN": "Persa", "LOGIN_TIME": "O tempo de início de sessão", "PAUSE_TIME": "Tempo de pausa", diff --git a/public/app/toolbar/i18n/ru.json b/public/app/toolbar/i18n/ru.json index 17873d0..486ba3a 100644 --- a/public/app/toolbar/i18n/ru.json +++ b/public/app/toolbar/i18n/ru.json @@ -23,7 +23,7 @@ "PORTUGUESE": "Португальский", "NORWEGIAN": "Норвежский", "HINDI": "Хинди", - "TURKISH": "Турецкий", + "TURKISH": "турецкий язык", "PERSIAN": "Персидский", "LOGIN_TIME": "Время входа", "PAUSE_TIME": "Время паузы", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index c6b8601..a31ead3 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 _0x34e8=['STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action'];(function(_0x49dcdc,_0x14e64f){var _0x3077c0=function(_0x2a91a1){while(--_0x2a91a1){_0x49dcdc['push'](_0x49dcdc['shift']());}};_0x3077c0(++_0x14e64f);}(_0x34e8,0x12c));var _0x834e=function(_0x366b5f,_0x15360b){_0x366b5f=_0x366b5f-0x0;var _0x57937a=_0x34e8[_0x366b5f];return _0x57937a;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'get':function(_0x35e6fb){return this['getDataValue'](_0x834e('0x3'));}},'action':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),'browser',_0x834e('0xa'),'script']],'msg':_0x834e('0xb')}},'comment':_0x834e('0xb')},'data1':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xc')},'data2':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xd')},'data3':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xe')},'data4':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data5':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data6':{'type':Sequelize[_0x834e('0x4')]},'data7':{'type':Sequelize[_0x834e('0xf')]}}; \ No newline at end of file +var _0x34e8=['STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action'];(function(_0x50170a,_0x5c9a80){var _0x3065bd=function(_0x57bec0){while(--_0x57bec0){_0x50170a['push'](_0x50170a['shift']());}};_0x3065bd(++_0x5c9a80);}(_0x34e8,0x12c));var _0x834e=function(_0x5c042c,_0x5c0553){_0x5c042c=_0x5c042c-0x0;var _0x2797ef=_0x34e8[_0x5c042c];return _0x2797ef;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'get':function(_0x35e6fb){return this['getDataValue'](_0x834e('0x3'));}},'action':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),'browser',_0x834e('0xa'),'script']],'msg':_0x834e('0xb')}},'comment':_0x834e('0xb')},'data1':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xc')},'data2':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xd')},'data3':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xe')},'data4':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data5':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data6':{'type':Sequelize[_0x834e('0x4')]},'data7':{'type':Sequelize[_0x834e('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index fbee80d..8aa7002 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 _0x374d=['sendStatus','end','json','count','status','Content-Range','apply','reject','update','then','error','name','Action','params','body','catch','destroy','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x42a3fb,_0x4ff7fa){var _0x431c93=function(_0x1de269){while(--_0x1de269){_0x42a3fb['push'](_0x42a3fb['shift']());}};_0x431c93(++_0x4ff7fa);}(_0x374d,0x15a));var _0xd374=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x374d[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xd374('0x0'));var emlformat=require(_0xd374('0x1'));var rimraf=require(_0xd374('0x2'));var zipdir=require(_0xd374('0x3'));var jsonpatch=require(_0xd374('0x4'));var rp=require('request-promise');var moment=require(_0xd374('0x5'));var BPromise=require(_0xd374('0x6'));var Mustache=require(_0xd374('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd374('0x8'));var csv=require(_0xd374('0x9'));var ejs=require(_0xd374('0xa'));var fs=require('fs');var _=require(_0xd374('0xb'));var squel=require('squel');var crypto=require(_0xd374('0xc'));var jsforce=require(_0xd374('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd374('0x9'));var querystring=require(_0xd374('0xe'));var Papa=require(_0xd374('0xf'));var Redis=require(_0xd374('0x10'));var authService=require(_0xd374('0x11'));var qs=require(_0xd374('0x12'));var hardwareService=require(_0xd374('0x13'));var logger=require(_0xd374('0x14'))(_0xd374('0x15'));var utils=require(_0xd374('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5365,_0x309901){_0x309901=_0x309901||0xcc;return function(_0x4a0d63){if(_0x4a0d63){return _0x1e5365[_0xd374('0x17')](_0x309901);}return _0x1e5365['status'](_0x309901)[_0xd374('0x18')]();};}function respondWithResult(_0x180957,_0xd702d8){_0xd702d8=_0xd702d8||0xc8;return function(_0x3e7232){if(_0x3e7232){return _0x180957['status'](_0xd702d8)[_0xd374('0x19')](_0x3e7232);}};}function respondWithFilteredResult(_0x56203a,_0x4594ef){return function(_0x211df1){if(_0x211df1){var _0x125452=_0x211df1[_0xd374('0x1a')],_0x1c3c87=_0x4594ef['offset'],_0xa937c=_0x4594ef['offset']+_0x4594ef['limit'],_0x1ebd60;if(_0xa937c>=_0x125452){_0xa937c=_0x125452;_0x1ebd60=0xc8;}else{_0x1ebd60=0xce;}_0x56203a[_0xd374('0x1b')](_0x1ebd60);return _0x56203a['set'](_0xd374('0x1c'),_0x1c3c87+'-'+_0xa937c+'/'+_0x125452)[_0xd374('0x19')](_0x211df1);}return null;};}function patchUpdates(_0x253406){return function(_0x223a3d){try{jsonpatch[_0xd374('0x1d')](_0x223a3d,_0x253406,!![]);}catch(_0x1cfff5){return BPromise[_0xd374('0x1e')](_0x1cfff5);}return _0x223a3d['save']();};}function saveUpdates(_0x3312ed,_0x2a9845){return function(_0x2a2e49){if(_0x2a2e49){return _0x2a2e49[_0xd374('0x1f')](_0x3312ed)[_0xd374('0x20')](function(_0x2ed379){return _0x2ed379;});}return null;};}function removeEntity(_0x44b840,_0x31df3b){return function(_0x588cc4){if(_0x588cc4){return _0x588cc4['destroy']()['then'](function(){_0x44b840['status'](0xcc)[_0xd374('0x18')]();});}};}function handleEntityNotFound(_0x2078e3,_0x3c61bb){return function(_0x59deed){if(!_0x59deed){_0x2078e3[_0xd374('0x17')](0x194);}return _0x59deed;};}function handleError(_0x40cf0a,_0x584522){_0x584522=_0x584522||0x1f4;return function(_0x3dab48){logger[_0xd374('0x21')](_0x3dab48['stack']);if(_0x3dab48[_0xd374('0x22')]){delete _0x3dab48[_0xd374('0x22')];}_0x40cf0a['status'](_0x584522)['send'](_0x3dab48);};}exports[_0xd374('0x1f')]=function(_0xc8d43f,_0x412444){if(_0xc8d43f['body']['id']){delete _0xc8d43f['body']['id'];}return db[_0xd374('0x23')]['find']({'where':{'id':_0xc8d43f[_0xd374('0x24')]['id']}})[_0xd374('0x20')](handleEntityNotFound(_0x412444,null))[_0xd374('0x20')](saveUpdates(_0xc8d43f[_0xd374('0x25')],null))[_0xd374('0x20')](respondWithResult(_0x412444,null))[_0xd374('0x26')](handleError(_0x412444,null));};exports[_0xd374('0x27')]=function(_0x308cf3,_0x2b161e){return db[_0xd374('0x23')][_0xd374('0x28')]({'where':{'id':_0x308cf3[_0xd374('0x24')]['id']}})['then'](handleEntityNotFound(_0x2b161e,null))[_0xd374('0x20')](removeEntity(_0x2b161e,null))[_0xd374('0x26')](handleError(_0x2b161e,null));}; \ No newline at end of file +var _0xa7e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','body','Action','params','destroy','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring'];(function(_0x1aaba1,_0x14292a){var _0x1fbdd4=function(_0x8bee71){while(--_0x8bee71){_0x1aaba1['push'](_0x1aaba1['shift']());}};_0x1fbdd4(++_0x14292a);}(_0xa7e0,0x105));var _0x0a7e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa7e0[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x0a7e('0x0'));var emlformat=require(_0x0a7e('0x1'));var rimraf=require(_0x0a7e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a7e('0x3'));var rp=require('request-promise');var moment=require(_0x0a7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0a7e('0x5'));var util=require(_0x0a7e('0x6'));var path=require(_0x0a7e('0x7'));var sox=require(_0x0a7e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a7e('0x9'));var fs=require('fs');var _=require(_0x0a7e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0a7e('0xb'));var deskjs=require(_0x0a7e('0xc'));var toCsv=require(_0x0a7e('0xd'));var querystring=require(_0x0a7e('0xe'));var Papa=require(_0x0a7e('0xf'));var Redis=require(_0x0a7e('0x10'));var authService=require(_0x0a7e('0x11'));var qs=require(_0x0a7e('0x12'));var hardwareService=require(_0x0a7e('0x13'));var logger=require(_0x0a7e('0x14'))(_0x0a7e('0x15'));var utils=require(_0x0a7e('0x16'));var config=require(_0x0a7e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9fca2e,_0x4eec30){_0x4eec30=_0x4eec30||0xcc;return function(_0x5b43d7){if(_0x5b43d7){return _0x9fca2e['sendStatus'](_0x4eec30);}return _0x9fca2e[_0x0a7e('0x18')](_0x4eec30)[_0x0a7e('0x19')]();};}function respondWithResult(_0x521f52,_0x355ed4){_0x355ed4=_0x355ed4||0xc8;return function(_0x2855bb){if(_0x2855bb){return _0x521f52[_0x0a7e('0x18')](_0x355ed4)[_0x0a7e('0x1a')](_0x2855bb);}};}function respondWithFilteredResult(_0x540fe1,_0x173627){return function(_0x5aa00b){if(_0x5aa00b){var _0x3519d3=_0x5aa00b[_0x0a7e('0x1b')],_0x25a29a=_0x173627['offset'],_0x3ed65c=_0x173627[_0x0a7e('0x1c')]+_0x173627[_0x0a7e('0x1d')],_0x2ada48;if(_0x3ed65c>=_0x3519d3){_0x3ed65c=_0x3519d3;_0x2ada48=0xc8;}else{_0x2ada48=0xce;}_0x540fe1['status'](_0x2ada48);return _0x540fe1[_0x0a7e('0x1e')](_0x0a7e('0x1f'),_0x25a29a+'-'+_0x3ed65c+'/'+_0x3519d3)[_0x0a7e('0x1a')](_0x5aa00b);}return null;};}function patchUpdates(_0x4ad604){return function(_0x6f871f){try{jsonpatch[_0x0a7e('0x20')](_0x6f871f,_0x4ad604,!![]);}catch(_0x29112c){return BPromise[_0x0a7e('0x21')](_0x29112c);}return _0x6f871f[_0x0a7e('0x22')]();};}function saveUpdates(_0x5a44bd,_0x41f583){return function(_0x20ce6d){if(_0x20ce6d){return _0x20ce6d[_0x0a7e('0x23')](_0x5a44bd)[_0x0a7e('0x24')](function(_0x14d50f){return _0x14d50f;});}return null;};}function removeEntity(_0x88174f,_0x2d3239){return function(_0x3d55a3){if(_0x3d55a3){return _0x3d55a3['destroy']()['then'](function(){_0x88174f[_0x0a7e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554b15,_0x143935){return function(_0x5e2a44){if(!_0x5e2a44){_0x554b15[_0x0a7e('0x25')](0x194);}return _0x5e2a44;};}function handleError(_0x1bb81f,_0x58de9f){_0x58de9f=_0x58de9f||0x1f4;return function(_0x53d8f2){logger['error'](_0x53d8f2[_0x0a7e('0x26')]);if(_0x53d8f2[_0x0a7e('0x27')]){delete _0x53d8f2[_0x0a7e('0x27')];}_0x1bb81f[_0x0a7e('0x18')](_0x58de9f)[_0x0a7e('0x28')](_0x53d8f2);};}exports[_0x0a7e('0x23')]=function(_0x2920a9,_0x359a5b){if(_0x2920a9[_0x0a7e('0x29')]['id']){delete _0x2920a9[_0x0a7e('0x29')]['id'];}return db[_0x0a7e('0x2a')]['find']({'where':{'id':_0x2920a9[_0x0a7e('0x2b')]['id']}})[_0x0a7e('0x24')](handleEntityNotFound(_0x359a5b,null))[_0x0a7e('0x24')](saveUpdates(_0x2920a9[_0x0a7e('0x29')],null))[_0x0a7e('0x24')](respondWithResult(_0x359a5b,null))['catch'](handleError(_0x359a5b,null));};exports[_0x0a7e('0x2c')]=function(_0x4265ae,_0x36de79){return db['Action']['find']({'where':{'id':_0x4265ae[_0x0a7e('0x2b')]['id']}})[_0x0a7e('0x24')](handleEntityNotFound(_0x36de79,null))[_0x0a7e('0x24')](removeEntity(_0x36de79,null))[_0x0a7e('0x2d')](handleError(_0x36de79,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6e5014f..d467b62 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 _0x6138=['rimraf','../../config/environment','exports','define','Action','lodash','util','../../config/logger','moment','request-promise'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6138,0x113));var _0x8613=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6138[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x8613('0x0'));var util=require(_0x8613('0x1'));var logger=require(_0x8613('0x2'))('api');var moment=require(_0x8613('0x3'));var BPromise=require('bluebird');var rp=require(_0x8613('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8613('0x5'));var config=require(_0x8613('0x6'));var attributes=require('./action.attributes');module[_0x8613('0x7')]=function(_0x11b9a3,_0x35b9b4){return _0x11b9a3[_0x8613('0x8')](_0x8613('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b10=['api','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b10,0x195));var _0x09b1=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9b10[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x09b1('0x0'));var util=require('util');var logger=require(_0x09b1('0x1'))(_0x09b1('0x2'));var moment=require('moment');var BPromise=require(_0x09b1('0x3'));var rp=require(_0x09b1('0x4'));var fs=require('fs');var path=require(_0x09b1('0x5'));var rimraf=require('rimraf');var config=require(_0x09b1('0x6'));var attributes=require(_0x09b1('0x7'));module[_0x09b1('0x8')]=function(_0x2b510d,_0x20f06e){return _0x2b510d[_0x09b1('0x9')]('Action',attributes,{'tableName':_0x09b1('0xa'),'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 3eeaef8..3b8c2b9 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 _0x8c25=['then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request'];(function(_0x12c6d4,_0x58c6fd){var _0x495b0f=function(_0xf574e){while(--_0xf574e){_0x12c6d4['push'](_0x12c6d4['shift']());}};_0x495b0f(++_0x58c6fd);}(_0x8c25,0x15e));var _0x58c2=function(_0x48636a,_0x3f2842){_0x48636a=_0x48636a-0x0;var _0x4c995c=_0x8c25[_0x48636a];return _0x4c995c;};'use strict';var _=require(_0x58c2('0x0'));var util=require(_0x58c2('0x1'));var moment=require(_0x58c2('0x2'));var BPromise=require(_0x58c2('0x3'));var rs=require(_0x58c2('0x4'));var fs=require('fs');var Redis=require(_0x58c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x58c2('0x7'));var client=jayson['client'][_0x58c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4be512,_0x5f3536,_0x331863){return new BPromise(function(_0xddbb7e,_0x52cfa7){return client[_0x58c2('0x9')](_0x4be512,_0x331863)[_0x58c2('0xa')](function(_0xf9aef5){logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));logger[_0x58c2('0xe')](_0x58c2('0xf'),_0x5f3536,'request\x20sent',JSON[_0x58c2('0x10')](_0xf9aef5));if(_0xf9aef5[_0x58c2('0x11')]){if(_0xf9aef5[_0x58c2('0x11')]['code']===0x1f4){logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0x52cfa7(_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);}logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0xddbb7e(_0xf9aef5['error']['message']);}else{logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));_0xddbb7e(_0xf9aef5[_0x58c2('0x13')][_0x58c2('0x12')]);}})['catch'](function(_0x3a6312){logger[_0x58c2('0x11')]('Action,\x20%s,\x20%s',_0x5f3536,_0x3a6312);_0x52cfa7(_0x3a6312);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Action,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x397965,_0x3e0a6e){var _0x2afde3=function(_0x3f7f62){while(--_0x3f7f62){_0x397965['push'](_0x397965['shift']());}};_0x2afde3(++_0x3e0a6e);}(_0x3e74,0x175));var _0x43e7=function(_0xe0655e,_0x312ab3){_0xe0655e=_0xe0655e-0x0;var _0x5ac85d=_0x3e74[_0xe0655e];return _0x5ac85d;};'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']('Action,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Action,\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')]('Action,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 6fb52c2..ae88dc0 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 _0x8f59=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x111fdf,_0x40c27a){var _0x1008c8=function(_0x6419ad){while(--_0x6419ad){_0x111fdf['push'](_0x111fdf['shift']());}};_0x1008c8(++_0x40c27a);}(_0x8f59,0x11d));var _0x98f5=function(_0x4fe5b5,_0x41efab){_0x4fe5b5=_0x4fe5b5-0x0;var _0x221fbe=_0x8f59[_0x4fe5b5];return _0x221fbe;};'use strict';var multer=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var path=require(_0x98f5('0x2'));var timeout=require(_0x98f5('0x3'));var express=require(_0x98f5('0x4'));var router=express[_0x98f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x98f5('0x6'));var config=require(_0x98f5('0x7'));var controller=require(_0x98f5('0x8'));router[_0x98f5('0x9')]('/:id',auth[_0x98f5('0xa')](),controller[_0x98f5('0xb')]);router[_0x98f5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x98f5('0xd')]);module[_0x98f5('0xe')]=router; \ No newline at end of file +var _0x57c3=['util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x57c3,0xc2));var _0x357c=function(_0x1f4aa7,_0x1a06f2){_0x1f4aa7=_0x1f4aa7-0x0;var _0x54ad0c=_0x57c3[_0x1f4aa7];return _0x54ad0c;};'use strict';var multer=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var path=require(_0x357c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x357c('0x3'));var interaction=require(_0x357c('0x4'));var config=require(_0x357c('0x5'));var controller=require(_0x357c('0x6'));router['put'](_0x357c('0x7'),auth['isAuthenticated'](),controller[_0x357c('0x8')]);router[_0x357c('0x9')](_0x357c('0x7'),auth[_0x357c('0xa')](),controller[_0x357c('0xb')]);module[_0x357c('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index adea181..db734db 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 _0xeea3=['STRING','TEXT'];(function(_0x25b339,_0x1c9e2f){var _0x20d2d3=function(_0x27a209){while(--_0x27a209){_0x25b339['push'](_0x25b339['shift']());}};_0x20d2d3(++_0x1c9e2f);}(_0xeea3,0x196));var _0x3eea=function(_0x255a78,_0x34d332){_0x255a78=_0x255a78-0x0;var _0x58a35e=_0xeea3[_0x255a78];return _0x58a35e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3eea('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x3eea('0x0')]},'conditions':{'type':Sequelize[_0x3eea('0x1')]},'joins':{'type':Sequelize[_0x3eea('0x1')]}}; \ No newline at end of file +var _0x39cb=['STRING','TEXT','sequelize'];(function(_0x496ed2,_0x54aecd){var _0x2471f2=function(_0x3f8de3){while(--_0x3f8de3){_0x496ed2['push'](_0x496ed2['shift']());}};_0x2471f2(++_0x54aecd);}(_0x39cb,0x185));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xb39c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb39c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb39c('0x1')]},'parent':{'type':Sequelize[_0xb39c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb39c('0x2')]},'joins':{'type':Sequelize[_0xb39c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e2a85e2..d94e77c 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 _0x1a77=['condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','parse','joins','foreignTable','foreignKey','parentKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','groupBy','DESC','%s.%s\x20=\x20%s.%s','clone','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','AnalyticCustomReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group'];(function(_0x592216,_0x35cdae){var _0x11a07d=function(_0x369dd6){while(--_0x369dd6){_0x592216['push'](_0x592216['shift']());}};_0x11a07d(++_0x35cdae);}(_0x1a77,0xe0));var _0x71a7=function(_0x3e0f41,_0x47e4b6){_0x3e0f41=_0x3e0f41-0x0;var _0x2b2286=_0x1a77[_0x3e0f41];return _0x2b2286;};'use strict';var pdf=require(_0x71a7('0x0'));var emlformat=require(_0x71a7('0x1'));var rimraf=require(_0x71a7('0x2'));var zipdir=require(_0x71a7('0x3'));var jsonpatch=require(_0x71a7('0x4'));var rp=require(_0x71a7('0x5'));var moment=require(_0x71a7('0x6'));var BPromise=require(_0x71a7('0x7'));var Mustache=require(_0x71a7('0x8'));var util=require(_0x71a7('0x9'));var path=require(_0x71a7('0xa'));var sox=require(_0x71a7('0xb'));var csv=require(_0x71a7('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71a7('0xd'));var squel=require(_0x71a7('0xe'));var crypto=require(_0x71a7('0xf'));var jsforce=require(_0x71a7('0x10'));var deskjs=require(_0x71a7('0x11'));var toCsv=require(_0x71a7('0xc'));var querystring=require(_0x71a7('0x12'));var Papa=require('papaparse');var Redis=require(_0x71a7('0x13'));var authService=require(_0x71a7('0x14'));var qs=require(_0x71a7('0x15'));var hardwareService=require(_0x71a7('0x16'));var logger=require(_0x71a7('0x17'))('api');var utils=require(_0x71a7('0x18'));var config=require('../../config/environment');var db=require(_0x71a7('0x19'))['db'];function respondWithStatusCode(_0x10ff04,_0x257dc8){_0x257dc8=_0x257dc8||0xcc;return function(_0x9c0066){if(_0x9c0066){return _0x10ff04[_0x71a7('0x1a')](_0x257dc8);}return _0x10ff04[_0x71a7('0x1b')](_0x257dc8)[_0x71a7('0x1c')]();};}function respondWithResult(_0x122f11,_0xea0859){_0xea0859=_0xea0859||0xc8;return function(_0x5140a8){if(_0x5140a8){return _0x122f11[_0x71a7('0x1b')](_0xea0859)['json'](_0x5140a8);}};}function respondWithFilteredResult(_0x20022e,_0x4ae5c1){return function(_0x5f5df0){if(_0x5f5df0){var _0x17e829=_0x5f5df0[_0x71a7('0x1d')],_0x5d2ce0=_0x4ae5c1[_0x71a7('0x1e')],_0x592d9b=_0x4ae5c1[_0x71a7('0x1e')]+_0x4ae5c1[_0x71a7('0x1f')],_0x8ddb00;if(_0x592d9b>=_0x17e829){_0x592d9b=_0x17e829;_0x8ddb00=0xc8;}else{_0x8ddb00=0xce;}_0x20022e[_0x71a7('0x1b')](_0x8ddb00);return _0x20022e[_0x71a7('0x20')](_0x71a7('0x21'),_0x5d2ce0+'-'+_0x592d9b+'/'+_0x17e829)[_0x71a7('0x22')](_0x5f5df0);}return null;};}function patchUpdates(_0x39b064){return function(_0x3ed864){try{jsonpatch[_0x71a7('0x23')](_0x3ed864,_0x39b064,!![]);}catch(_0x1bc625){return BPromise['reject'](_0x1bc625);}return _0x3ed864['save']();};}function saveUpdates(_0x3c7867,_0x58ad46){return function(_0x361bd2){if(_0x361bd2){return _0x361bd2['update'](_0x3c7867)[_0x71a7('0x24')](function(_0x3e40b9){return _0x3e40b9;});}return null;};}function removeEntity(_0x258b1f,_0x549eb8){return function(_0x2436d2){if(_0x2436d2){return _0x2436d2[_0x71a7('0x25')]()[_0x71a7('0x24')](function(){var _0x292634=_0x2436d2[_0x71a7('0x26')]({'plain':!![]});var _0x484e7a=_0x71a7('0x27');return db[_0x71a7('0x28')][_0x71a7('0x25')]({'where':{'type':_0x484e7a,'resourceId':_0x292634['id']}})[_0x71a7('0x24')](function(){return _0x2436d2;});})[_0x71a7('0x24')](function(){_0x258b1f[_0x71a7('0x1b')](0xcc)[_0x71a7('0x1c')]();});}};}function handleEntityNotFound(_0x5a8582,_0x4b098e){return function(_0x1c73c2){if(!_0x1c73c2){_0x5a8582[_0x71a7('0x1a')](0x194);}return _0x1c73c2;};}function handleError(_0x4094aa,_0x4a4a6e){_0x4a4a6e=_0x4a4a6e||0x1f4;return function(_0x525428){logger[_0x71a7('0x29')](_0x525428[_0x71a7('0x2a')]);if(_0x525428[_0x71a7('0x2b')]){delete _0x525428[_0x71a7('0x2b')];}_0x4094aa['status'](_0x4a4a6e)[_0x71a7('0x2c')](_0x525428);};}exports[_0x71a7('0x2d')]=function(_0x1c7e70,_0x539adc){var _0x4fa745={},_0x1cd295={},_0x5253dd={'count':0x0,'rows':[]};var _0x546c24=db['AnalyticCustomReport']['rawAttributes'];_0x1cd295[_0x71a7('0x2e')]=_['keys'](_0x546c24);_0x1cd295['query']=_[_0x71a7('0x2f')](_0x1c7e70[_0x71a7('0x30')]);_0x1cd295[_0x71a7('0x31')]=_['intersection'](_0x1cd295[_0x71a7('0x2e')],_0x1cd295[_0x71a7('0x30')]);_0x4fa745[_0x71a7('0x32')]=_[_0x71a7('0x33')](_0x1cd295[_0x71a7('0x2e')],qs[_0x71a7('0x34')](_0x1c7e70['query']['fields']));_0x4fa745[_0x71a7('0x32')]=_0x4fa745['attributes'][_0x71a7('0x35')]?_0x4fa745[_0x71a7('0x32')]:_0x1cd295['model'];if(!_0x1c7e70['query'][_0x71a7('0x36')](_0x71a7('0x37'))){_0x4fa745['limit']=qs[_0x71a7('0x1f')](_0x1c7e70[_0x71a7('0x30')]['limit']);_0x4fa745[_0x71a7('0x1e')]=qs[_0x71a7('0x1e')](_0x1c7e70[_0x71a7('0x30')][_0x71a7('0x1e')]);}_0x4fa745[_0x71a7('0x38')]=qs[_0x71a7('0x39')](_0x1c7e70[_0x71a7('0x30')][_0x71a7('0x39')]);_0x4fa745[_0x71a7('0x3a')]=qs[_0x71a7('0x31')](_[_0x71a7('0x3b')](_0x1c7e70['query'],_0x1cd295[_0x71a7('0x31')]));if(_0x1c7e70[_0x71a7('0x30')][_0x71a7('0x3c')]){_0x4fa745[_0x71a7('0x3a')]=_[_0x71a7('0x3d')](_0x4fa745['where'],{'$or':_[_0x71a7('0x3e')](_0x546c24,function(_0x542c86){if(_0x542c86[_0x71a7('0x3f')][_0x71a7('0x40')]!==_0x71a7('0x41')){var _0x3f3b16={};_0x3f3b16[_0x542c86[_0x71a7('0x42')]]={'$like':'%'+_0x1c7e70[_0x71a7('0x30')][_0x71a7('0x3c')]+'%'};return _0x3f3b16;}})});}_0x4fa745=_[_0x71a7('0x3d')]({},_0x4fa745,_0x1c7e70[_0x71a7('0x43')]);var _0x26f8c1={'where':_0x4fa745[_0x71a7('0x3a')]};return db[_0x71a7('0x44')][_0x71a7('0x1d')](_0x26f8c1)['then'](function(_0x33de04){_0x5253dd[_0x71a7('0x1d')]=_0x33de04;if(_0x1c7e70[_0x71a7('0x30')]['includeAll']){_0x4fa745[_0x71a7('0x45')]=[{'all':!![]}];}return db[_0x71a7('0x44')][_0x71a7('0x46')](_0x4fa745);})[_0x71a7('0x24')](function(_0x45aace){_0x5253dd[_0x71a7('0x47')]=_0x45aace;return _0x5253dd;})[_0x71a7('0x24')](respondWithFilteredResult(_0x539adc,_0x4fa745))[_0x71a7('0x48')](handleError(_0x539adc,null));};exports[_0x71a7('0x49')]=function(_0x2d3313,_0x553b86){var _0x42c10f={'raw':![],'where':{'id':_0x2d3313[_0x71a7('0x4a')]['id']}},_0x255892={};_0x255892[_0x71a7('0x2e')]=_[_0x71a7('0x2f')](db[_0x71a7('0x44')][_0x71a7('0x4b')]);_0x255892[_0x71a7('0x30')]=_['keys'](_0x2d3313[_0x71a7('0x30')]);_0x255892[_0x71a7('0x31')]=_[_0x71a7('0x33')](_0x255892[_0x71a7('0x2e')],_0x255892['query']);_0x42c10f[_0x71a7('0x32')]=_[_0x71a7('0x33')](_0x255892[_0x71a7('0x2e')],qs['fields'](_0x2d3313[_0x71a7('0x30')]['fields']));_0x42c10f[_0x71a7('0x32')]=_0x42c10f['attributes']['length']?_0x42c10f[_0x71a7('0x32')]:_0x255892[_0x71a7('0x2e')];if(_0x2d3313[_0x71a7('0x30')][_0x71a7('0x4c')]){_0x42c10f[_0x71a7('0x45')]=[{'all':!![]}];}_0x42c10f=_[_0x71a7('0x3d')]({},_0x42c10f,_0x2d3313['options']);return db[_0x71a7('0x44')]['find'](_0x42c10f)[_0x71a7('0x24')](handleEntityNotFound(_0x553b86,null))['then'](respondWithResult(_0x553b86,null))[_0x71a7('0x48')](handleError(_0x553b86,null));};exports[_0x71a7('0x4d')]=function(_0x26adeb,_0x4c86a1){return db['AnalyticCustomReport'][_0x71a7('0x4d')](_0x26adeb[_0x71a7('0x4e')],{})[_0x71a7('0x24')](function(_0x13a278){var _0x2630df=_0x26adeb['user'][_0x71a7('0x26')]({'plain':!![]});if(!_0x2630df)throw new Error(_0x71a7('0x4f'));if(_0x2630df[_0x71a7('0x50')]===_0x71a7('0x51')){var _0xd29c05=_0x13a278[_0x71a7('0x26')]({'plain':!![]});var _0x1fad71=_0x71a7('0x52');return db[_0x71a7('0x53')]['find']({'where':{'name':_0x1fad71,'userProfileId':_0x2630df['userProfileId']},'raw':!![]})[_0x71a7('0x24')](function(_0xd140ac){if(_0xd140ac&&_0xd140ac[_0x71a7('0x54')]===0x0){return db['UserProfileResource'][_0x71a7('0x4d')]({'name':_0xd29c05[_0x71a7('0x2b')],'resourceId':_0xd29c05['id'],'type':_0x71a7('0x27'),'sectionId':_0xd140ac['id']},{})['then'](function(){return _0x13a278;});}else{return _0x13a278;}})[_0x71a7('0x48')](function(_0x1d0a45){logger[_0x71a7('0x29')](_0x71a7('0x55'),_0x1d0a45);throw _0x1d0a45;});}return _0x13a278;})[_0x71a7('0x24')](respondWithResult(_0x4c86a1,0xc9))[_0x71a7('0x48')](handleError(_0x4c86a1,null));};exports[_0x71a7('0x56')]=function(_0x1405c0,_0x2f9c17){if(_0x1405c0[_0x71a7('0x4e')]['id']){delete _0x1405c0[_0x71a7('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x71a7('0x57')]({'where':{'id':_0x1405c0[_0x71a7('0x4a')]['id']}})[_0x71a7('0x24')](handleEntityNotFound(_0x2f9c17,null))[_0x71a7('0x24')](saveUpdates(_0x1405c0[_0x71a7('0x4e')],null))[_0x71a7('0x24')](respondWithResult(_0x2f9c17,null))[_0x71a7('0x48')](handleError(_0x2f9c17,null));};exports['destroy']=function(_0x4ff433,_0x46f60a){return db[_0x71a7('0x44')][_0x71a7('0x57')]({'where':{'id':_0x4ff433['params']['id']}})[_0x71a7('0x24')](handleEntityNotFound(_0x46f60a,null))[_0x71a7('0x24')](removeEntity(_0x46f60a,null))[_0x71a7('0x48')](handleError(_0x46f60a,null));};exports[_0x71a7('0x58')]=function(_0x53b78d,_0x327791){var _0x16019a=0xa;var _0x523e2d=[_0x71a7('0x59'),'left_join',_0x71a7('0x5a'),_0x71a7('0x5b')];var _0x5a74a0={'SUM':_0x71a7('0x5c'),'COUNT':_0x71a7('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x71a7('0x5e'),'MIN':_0x71a7('0x5f'),'AVG':_0x71a7('0x60'),'GROUP_CONCAT':_0x71a7('0x61'),'GROUP_CONCAT ASC':_0x71a7('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xbabac6={'SEC_TO_TIME':_0x71a7('0x63'),'DATE':_0x71a7('0x64'),'HOUR':_0x71a7('0x65'),'ROUND':_0x71a7('0x66'),'UNIX_TIMESTAMP':_0x71a7('0x67')};var _0x32c546=function(_0x24d60c){return!_[_0x71a7('0x68')]([_0x71a7('0x69'),_0x71a7('0x6a'),_0x71a7('0x6b'),_0x71a7('0x6c')],_0x24d60c);};var _0x9266e5=function(_0x3c1f8d){if(!_0x3c1f8d||!_0x3c1f8d[_0x71a7('0x6d')][_0x71a7('0x35')]){return'';}for(var _0x595830='(',_0x3d04aa=0x0;_0x3d04aa<_0x3c1f8d[_0x71a7('0x6d')][_0x71a7('0x35')];_0x3d04aa+=0x1){_0x3d04aa>0x0&&(_0x595830+='\x20'+_0x3c1f8d[_0x71a7('0x6e')]+'\x20');_0x595830+=_0x3c1f8d[_0x71a7('0x6d')][_0x3d04aa][_0x71a7('0x6f')]?_0x9266e5(_0x3c1f8d['rules'][_0x3d04aa][_0x71a7('0x6f')]):_0x3c1f8d['rules'][_0x3d04aa][_0x71a7('0x42')]+'\x20'+_0x3c1f8d[_0x71a7('0x6d')][_0x3d04aa][_0x71a7('0x70')]+(_0x32c546(_0x3c1f8d[_0x71a7('0x6d')][_0x3d04aa]['condition'])?'\x20'+_0x3c1f8d[_0x71a7('0x6d')][_0x3d04aa][_0x71a7('0x71')]:'');}return _0x595830+')';};var _0x5b352a={'where':{'id':_0x53b78d[_0x71a7('0x4a')]['id']}},_0x4443fe,_0x27b423,_0x5a6232,_0xf3c37,_0x2611f6;_0x5b352a=_['merge']({},_0x5b352a,_0x53b78d['options']);return db['AnalyticCustomReport'][_0x71a7('0x57')](_0x5b352a)[_0x71a7('0x24')](function(_0x29d833){if(_0x29d833){_0x4443fe=_0x29d833;return _0x29d833['getFields']();}return null;})[_0x71a7('0x24')](function(_0xef079d){if(_0xef079d){if(!_0xef079d[_0x71a7('0x35')]){throw new db[(_0x71a7('0x72'))][(_0x71a7('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27b423=_0xef079d;return db[_0x71a7('0x74')][_0x71a7('0x46')]({'raw':!![]});}return null;})['then'](function(_0x558b7b){if(_0x558b7b){_0x5a6232=_['keyBy'](_0x558b7b,'id');var _0x21bac7;var _0x225c85=squel[_0x71a7('0x75')]();_0x225c85[_0x71a7('0x76')](_0x4443fe[_0x71a7('0x77')]);for(var _0x52744a=0x0;_0x52744a<_0x27b423[_0x71a7('0x35')];_0x52744a+=0x1){_0x21bac7=_0x27b423[_0x52744a][_0x71a7('0x78')]?_0x5a6232[_0x27b423[_0x52744a][_0x71a7('0x78')]][_0x71a7('0x79')]:_0x27b423[_0x52744a][_0x71a7('0x42')];_0x21bac7=_0x27b423[_0x52744a][_0x71a7('0x7a')]?_[_0x71a7('0x7b')](_0x5a74a0[_0x27b423[_0x52744a][_0x71a7('0x7a')]],'%s',_0x21bac7):_0x21bac7;_0x21bac7=_0x27b423[_0x52744a]['format']?_[_0x71a7('0x7b')](_0xbabac6[_0x27b423[_0x52744a][_0x71a7('0x7c')]],'%s',_0x21bac7):_0x21bac7;if(_0x27b423[_0x52744a]['groupBy']){_0x225c85[_0x71a7('0x6f')](_0x21bac7);}_0x27b423[_0x52744a]['orderBy']&&_0x225c85[_0x71a7('0x38')](_0x21bac7,_0x27b423[_0x52744a][_0x71a7('0x7d')]==='DESC'?![]:!![]);_0x225c85[_0x71a7('0x42')](_0x21bac7,_0x27b423[_0x52744a][_0x71a7('0x7e')]||_0x21bac7);}if(_0x4443fe['joins']){_0x4443fe['joins']=JSON[_0x71a7('0x7f')](_0x4443fe['joins']);for(var _0x42dbec=0x0;_0x42dbec<_0x4443fe['joins'][_0x71a7('0x35')];_0x42dbec+=0x1){if(_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x3f')]&&_[_0x71a7('0x68')](_0x523e2d,_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x3f')])&&_0x4443fe[_0x71a7('0x80')][_0x42dbec]['parentKey']&&_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x81')]&&_0x4443fe['joins'][_0x42dbec][_0x71a7('0x82')]){_0x225c85[_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x3f')]](_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x81')],null,util[_0x71a7('0x7c')]('%s.%s\x20=\x20%s.%s',_0x4443fe[_0x71a7('0x77')],_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x83')],_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x81')],_0x4443fe[_0x71a7('0x80')][_0x42dbec][_0x71a7('0x82')]));}}}if(_0x4443fe[_0x71a7('0x84')]){_0x4443fe[_0x71a7('0x84')]=JSON[_0x71a7('0x7f')](_0x4443fe['conditions']);_0x225c85['where'](_0x9266e5(_0x4443fe['conditions'][_0x71a7('0x6f')]));}_0x2611f6=_0x225c85['clone']();_0x225c85[_0x71a7('0x1f')](_0x16019a);_0x225c85[_0x71a7('0x1e')](0x0);logger[_0x71a7('0x85')](_0x71a7('0x86'),_0x225c85[_0x71a7('0x87')]());return db[_0x71a7('0x88')][_0x71a7('0x30')](_0x225c85[_0x71a7('0x87')](),{'type':db[_0x71a7('0x88')][_0x71a7('0x89')][_0x71a7('0x8a')]});}})[_0x71a7('0x24')](respondWithResult(_0x327791,null))[_0x71a7('0x48')](handleError(_0x327791,null));};function runReport(_0x15fc79,_0x12dae9,_0x5cc775){var _0x4ca37b=_0x12dae9[_0x71a7('0x2b')];var _0x45ff50=0xa;var _0x66e4c1=[_0x71a7('0x59'),_0x71a7('0x8b'),'right_join',_0x71a7('0x5b')];var _0x8c33bc={'SUM':'SUM(%s)','COUNT':_0x71a7('0x5d'),'COUNT DISTINCT':_0x71a7('0x8c'),'MAX':_0x71a7('0x5e'),'MIN':_0x71a7('0x5f'),'AVG':_0x71a7('0x60'),'GROUP_CONCAT':_0x71a7('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x71a7('0x8d')};var _0x2a3c1f={'SEC_TO_TIME':_0x71a7('0x63'),'DATE':_0x71a7('0x64'),'HOUR':_0x71a7('0x65'),'ROUND':_0x71a7('0x66'),'UNIX_TIMESTAMP':_0x71a7('0x67')};var _0x3c10e2=function(_0x275e60){return!_[_0x71a7('0x68')]([_0x71a7('0x69'),_0x71a7('0x6a'),_0x71a7('0x6b'),_0x71a7('0x6c')],_0x275e60);};var _0x2cac48=function(_0x3ee565){if(!_0x3ee565||!_0x3ee565[_0x71a7('0x6d')]['length']){return'';}for(var _0x1a0385='(',_0x1cf33b=0x0;_0x1cf33b<_0x3ee565['rules']['length'];_0x1cf33b+=0x1){_0x1cf33b>0x0&&(_0x1a0385+='\x20'+_0x3ee565[_0x71a7('0x6e')]+'\x20');_0x1a0385+=_0x3ee565['rules'][_0x1cf33b][_0x71a7('0x6f')]?_0x2cac48(_0x3ee565[_0x71a7('0x6d')][_0x1cf33b]['group']):_0x3ee565['rules'][_0x1cf33b][_0x71a7('0x42')]+'\x20'+_0x3ee565[_0x71a7('0x6d')][_0x1cf33b][_0x71a7('0x70')]+(_0x3c10e2(_0x3ee565[_0x71a7('0x6d')][_0x1cf33b]['condition'])?'\x20'+_0x3ee565[_0x71a7('0x6d')][_0x1cf33b]['value']:'');}return _0x1a0385+')';};var _0x22a25f={'where':{'id':_0x15fc79['id']}},_0x4f935d,_0x2232ff,_0x355c1f,_0x1fe407,_0x49a74b;_0x22a25f=_[_0x71a7('0x3d')]({},_0x22a25f,_0x5cc775);return db[_0x71a7('0x44')][_0x71a7('0x57')](_0x22a25f)['then'](function(_0xd497ab){if(_0xd497ab){_0x4f935d=_0xd497ab;return _0xd497ab[_0x71a7('0x8e')]();}return null;})[_0x71a7('0x24')](function(_0x1ea1c4){if(_0x1ea1c4){if(!_0x1ea1c4[_0x71a7('0x35')]){throw new db['Sequelize'][(_0x71a7('0x73'))](_0x71a7('0x8f'),0x193);}_0x2232ff=_0x1ea1c4;return db[_0x71a7('0x74')][_0x71a7('0x46')]({'raw':!![]});}return null;})[_0x71a7('0x24')](function(_0x2f212a){if(_0x2f212a){_0x355c1f=_[_0x71a7('0x90')](_0x2f212a,'id');var _0x422b7b;var _0x21d900=squel[_0x71a7('0x75')]();_0x21d900[_0x71a7('0x76')](_0x4f935d[_0x71a7('0x77')]);for(var _0x2f1563=0x0;_0x2f1563<_0x2232ff[_0x71a7('0x35')];_0x2f1563+=0x1){_0x422b7b=_0x2232ff[_0x2f1563][_0x71a7('0x78')]?_0x355c1f[_0x2232ff[_0x2f1563]['MetricId']][_0x71a7('0x79')]:_0x2232ff[_0x2f1563][_0x71a7('0x42')];_0x422b7b=_0x2232ff[_0x2f1563][_0x71a7('0x7a')]?_['replace'](_0x8c33bc[_0x2232ff[_0x2f1563]['function']],'%s',_0x422b7b):_0x422b7b;_0x422b7b=_0x2232ff[_0x2f1563][_0x71a7('0x7c')]?_[_0x71a7('0x7b')](_0x2a3c1f[_0x2232ff[_0x2f1563]['format']],'%s',_0x422b7b):_0x422b7b;if(_0x2232ff[_0x2f1563][_0x71a7('0x91')]){_0x21d900['group'](_0x422b7b);}_0x2232ff[_0x2f1563][_0x71a7('0x7d')]&&_0x21d900[_0x71a7('0x38')](_0x422b7b,_0x2232ff[_0x2f1563]['orderBy']===_0x71a7('0x92')?![]:!![]);_0x21d900['field'](_0x422b7b,_0x2232ff[_0x2f1563][_0x71a7('0x7e')]||_0x422b7b);}if(_0x4f935d[_0x71a7('0x80')]){_0x4f935d[_0x71a7('0x80')]=JSON[_0x71a7('0x7f')](_0x4f935d[_0x71a7('0x80')]);for(var _0x5ca3bb=0x0;_0x5ca3bb<_0x4f935d[_0x71a7('0x80')]['length'];_0x5ca3bb+=0x1){if(_0x4f935d[_0x71a7('0x80')][_0x5ca3bb][_0x71a7('0x3f')]&&_['includes'](_0x66e4c1,_0x4f935d['joins'][_0x5ca3bb][_0x71a7('0x3f')])&&_0x4f935d['joins'][_0x5ca3bb][_0x71a7('0x83')]&&_0x4f935d['joins'][_0x5ca3bb]['foreignTable']&&_0x4f935d[_0x71a7('0x80')][_0x5ca3bb][_0x71a7('0x82')]){_0x21d900[_0x4f935d[_0x71a7('0x80')][_0x5ca3bb]['type']](_0x4f935d[_0x71a7('0x80')][_0x5ca3bb][_0x71a7('0x81')],null,util[_0x71a7('0x7c')](_0x71a7('0x93'),_0x4f935d[_0x71a7('0x77')],_0x4f935d['joins'][_0x5ca3bb][_0x71a7('0x83')],_0x4f935d[_0x71a7('0x80')][_0x5ca3bb]['foreignTable'],_0x4f935d[_0x71a7('0x80')][_0x5ca3bb]['foreignKey']));}}}if(_0x4f935d[_0x71a7('0x84')]){_0x4f935d[_0x71a7('0x84')]=JSON[_0x71a7('0x7f')](_0x4f935d[_0x71a7('0x84')]);_0x21d900[_0x71a7('0x3a')](_0x2cac48(_0x4f935d[_0x71a7('0x84')][_0x71a7('0x6f')]));}_0x49a74b=_0x21d900[_0x71a7('0x94')]();_0x21d900['limit'](_0x45ff50);_0x21d900[_0x71a7('0x1e')](0x0);logger[_0x71a7('0x85')]('Limited\x20Query:',_0x21d900[_0x71a7('0x87')]());return db['sequelize'][_0x71a7('0x30')](_0x21d900['toString'](),{'type':db[_0x71a7('0x88')][_0x71a7('0x89')]['SELECT']});}})[_0x71a7('0x24')](function(_0x420609){if(!_0x420609[_0x71a7('0x35')]){throw new db[(_0x71a7('0x72'))][(_0x71a7('0x73'))](_0x71a7('0x95'),0xcc);}if(_0x12dae9[_0x71a7('0x96')]===_0x71a7('0x97')){return null;}var _0x520277=_['merge'](_0x12dae9,{'name':_0x12dae9[_0x71a7('0x98')]||_0x12dae9[_0x71a7('0x2b')]||_0x4f935d[_0x71a7('0x2b')],'basename':_0x4ca37b,'savename':util['format'](_0x71a7('0x99'),_0x12dae9[_0x71a7('0x2b')]||_0x4f935d[_0x71a7('0x2b')],require(_0x71a7('0x9a'))[_0x71a7('0x9b')](0x4),_0x12dae9[_0x71a7('0x96')]||_0x71a7('0x9c')),'reportId':_0x4f935d['id'],'reportType':'custom'});return db[_0x71a7('0x9d')]['create'](_0x520277,{'raw':!![]});})['then'](function(_0x2deaba){if(_0x4f935d[_0x71a7('0x77')]===_0x71a7('0x9e')){_0x49a74b['where'](_0x4f935d[_0x71a7('0x77')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x12dae9['startDate'],_0x12dae9[_0x71a7('0x9f')]);}else{_0x49a74b[_0x71a7('0x3a')](_0x4f935d[_0x71a7('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12dae9['startDate'],_0x12dae9[_0x71a7('0x9f')]);}if(_0x2deaba){logger[_0x71a7('0xa0')](_0x71a7('0xa1'),_0x49a74b['toString']());require(_0x71a7('0xa2'))[_0x71a7('0xa3')](path[_0x71a7('0x59')](__dirname,'../../components/export/',_0x2deaba[_0x71a7('0x96')]),[_0x2deaba['id'],_0x49a74b[_0x71a7('0x87')](),path[_0x71a7('0x59')](__dirname,_0x71a7('0xa4'),_0x2deaba[_0x71a7('0xa5')]),_0x4ca37b]);return _0x2deaba;}else{var _0x202a69=squel[_0x71a7('0x75')]();_0x202a69[_0x71a7('0x76')]('('+_0x49a74b[_0x71a7('0x87')]()+')',_0x71a7('0xa6'));_0x202a69[_0x71a7('0x42')](_0x71a7('0xa7'),'count');_0x49a74b[_0x71a7('0x1f')](_0x12dae9[_0x71a7('0x1f')]||_0x45ff50);_0x49a74b[_0x71a7('0x1e')](_0x12dae9[_0x71a7('0x1e')]||0x0);return db[_0x71a7('0x88')][_0x71a7('0x30')](_0x202a69[_0x71a7('0x87')](),{'type':db['sequelize'][_0x71a7('0x89')][_0x71a7('0x8a')]})[_0x71a7('0x24')](function(_0x20f89c){if(!_0x20f89c[_0x71a7('0x35')]){_0x1fe407=0x0;}else{_0x1fe407=_0x20f89c[0x0][_0x71a7('0x1d')]||0x0;}return db['sequelize'][_0x71a7('0x30')](_0x49a74b['toString'](),{'type':db[_0x71a7('0x88')][_0x71a7('0x89')]['SELECT']});})[_0x71a7('0x24')](function(_0x2a038c){return{'rows':_0x2a038c||[],'count':_0x1fe407};});}});}exports['run']=function(_0x518538,_0xcaecc1){return runReport(_0x518538[_0x71a7('0x4a')],_0x518538[_0x71a7('0x30')],_0x518538[_0x71a7('0x43')])[_0x71a7('0x24')](respondWithResult(_0xcaecc1,null))[_0x71a7('0x48')](handleError(_0xcaecc1,null));};exports['runReport']=runReport;exports[_0x71a7('0x30')]=function(_0x1a42e8,_0x47e075){var _0x35d855=0xa;var _0x4898e7=[_0x71a7('0x59'),_0x71a7('0x8b'),_0x71a7('0x5a'),_0x71a7('0x5b')];var _0x1ac170={'SUM':_0x71a7('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x71a7('0x8c'),'MAX':_0x71a7('0x5e'),'MIN':_0x71a7('0x5f'),'AVG':_0x71a7('0x60'),'GROUP_CONCAT':_0x71a7('0x61'),'GROUP_CONCAT ASC':_0x71a7('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x104079={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x71a7('0x64'),'HOUR':_0x71a7('0x65'),'ROUND':_0x71a7('0x66'),'UNIX_TIMESTAMP':_0x71a7('0x67')};var _0x1c5c5f=function(_0x132618){return!_[_0x71a7('0x68')]([_0x71a7('0x69'),_0x71a7('0x6a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x132618);};var _0x2fdb91=function(_0x2348c4){if(!_0x2348c4||!_0x2348c4[_0x71a7('0x6d')][_0x71a7('0x35')]){return'';}for(var _0x1885e9='(',_0x1f624c=0x0;_0x1f624c<_0x2348c4['rules']['length'];_0x1f624c+=0x1){_0x1f624c>0x0&&(_0x1885e9+='\x20'+_0x2348c4[_0x71a7('0x6e')]+'\x20');_0x1885e9+=_0x2348c4[_0x71a7('0x6d')][_0x1f624c][_0x71a7('0x6f')]?_0x2fdb91(_0x2348c4['rules'][_0x1f624c][_0x71a7('0x6f')]):_0x2348c4['rules'][_0x1f624c][_0x71a7('0x42')]+'\x20'+_0x2348c4['rules'][_0x1f624c][_0x71a7('0x70')]+(_0x1c5c5f(_0x2348c4[_0x71a7('0x6d')][_0x1f624c][_0x71a7('0x70')])?'\x20'+_0x2348c4['rules'][_0x1f624c][_0x71a7('0x71')]:'');}return _0x1885e9+')';};var _0x2dad23={'where':{'id':_0x1a42e8[_0x71a7('0x4a')]['id']}},_0x27223b,_0x4a42f5,_0x5dcda5,_0xfe1c5f,_0x1ccc43;_0x2dad23=_['merge']({},_0x2dad23,_0x1a42e8[_0x71a7('0x43')]);return db[_0x71a7('0x44')][_0x71a7('0x57')](_0x2dad23)['then'](function(_0x10869c){if(_0x10869c){_0x27223b=_0x10869c;return _0x10869c[_0x71a7('0x8e')]();}return null;})[_0x71a7('0x24')](function(_0x22b857){if(_0x22b857){if(!_0x22b857[_0x71a7('0x35')]){throw new db[(_0x71a7('0x72'))][(_0x71a7('0x73'))](_0x71a7('0x8f'),0x193);}_0x4a42f5=_0x22b857;return db['AnalyticMetric'][_0x71a7('0x46')]({'raw':!![]});}return null;})[_0x71a7('0x24')](function(_0x50c076){if(_0x50c076){_0x5dcda5=_['keyBy'](_0x50c076,'id');var _0x399294;var _0x5c1885=squel[_0x71a7('0x75')]();_0x5c1885['from'](_0x27223b[_0x71a7('0x77')]);for(var _0x123b3a=0x0;_0x123b3a<_0x4a42f5[_0x71a7('0x35')];_0x123b3a+=0x1){_0x399294=_0x4a42f5[_0x123b3a]['MetricId']?_0x5dcda5[_0x4a42f5[_0x123b3a][_0x71a7('0x78')]][_0x71a7('0x79')]:_0x4a42f5[_0x123b3a][_0x71a7('0x42')];_0x399294=_0x4a42f5[_0x123b3a][_0x71a7('0x7a')]?_[_0x71a7('0x7b')](_0x1ac170[_0x4a42f5[_0x123b3a]['function']],'%s',_0x399294):_0x399294;_0x399294=_0x4a42f5[_0x123b3a][_0x71a7('0x7c')]?_[_0x71a7('0x7b')](_0x104079[_0x4a42f5[_0x123b3a][_0x71a7('0x7c')]],'%s',_0x399294):_0x399294;if(_0x4a42f5[_0x123b3a][_0x71a7('0x91')]){_0x5c1885['group'](_0x399294);}_0x4a42f5[_0x123b3a]['orderBy']&&_0x5c1885[_0x71a7('0x38')](_0x399294,_0x4a42f5[_0x123b3a][_0x71a7('0x7d')]===_0x71a7('0x92')?![]:!![]);_0x5c1885[_0x71a7('0x42')](_0x399294,_0x4a42f5[_0x123b3a][_0x71a7('0x7e')]||_0x399294);}if(_0x27223b[_0x71a7('0x80')]){_0x27223b[_0x71a7('0x80')]=JSON['parse'](_0x27223b['joins']);for(var _0x27e325=0x0;_0x27e325<_0x27223b[_0x71a7('0x80')][_0x71a7('0x35')];_0x27e325+=0x1){if(_0x27223b[_0x71a7('0x80')][_0x27e325]['type']&&_[_0x71a7('0x68')](_0x4898e7,_0x27223b[_0x71a7('0x80')][_0x27e325][_0x71a7('0x3f')])&&_0x27223b['joins'][_0x27e325][_0x71a7('0x83')]&&_0x27223b['joins'][_0x27e325][_0x71a7('0x81')]&&_0x27223b[_0x71a7('0x80')][_0x27e325]['foreignKey']){_0x5c1885[_0x27223b[_0x71a7('0x80')][_0x27e325][_0x71a7('0x3f')]](_0x27223b[_0x71a7('0x80')][_0x27e325][_0x71a7('0x81')],null,util['format'](_0x71a7('0x93'),_0x27223b[_0x71a7('0x77')],_0x27223b[_0x71a7('0x80')][_0x27e325][_0x71a7('0x83')],_0x27223b['joins'][_0x27e325][_0x71a7('0x81')],_0x27223b[_0x71a7('0x80')][_0x27e325][_0x71a7('0x82')]));}}}if(_0x27223b['conditions']){_0x27223b[_0x71a7('0x84')]=JSON['parse'](_0x27223b[_0x71a7('0x84')]);_0x5c1885[_0x71a7('0x3a')](_0x2fdb91(_0x27223b['conditions'][_0x71a7('0x6f')]));}_0x1ccc43=_0x5c1885['clone']();_0x5c1885[_0x71a7('0x1f')](_0x35d855);_0x5c1885['offset'](0x0);logger[_0x71a7('0x85')](_0x71a7('0x86'),_0x5c1885[_0x71a7('0x87')]());return db[_0x71a7('0x88')]['query'](_0x5c1885['toString'](),{'type':db[_0x71a7('0x88')]['QueryTypes'][_0x71a7('0x8a')]});}})['then'](function(){return{'sql':_0x1ccc43[_0x71a7('0x87')]()};})['then'](respondWithResult(_0x47e075,null))[_0x71a7('0x48')](handleError(_0x47e075,null));}; \ No newline at end of file +var _0x9d6e=['UserProfileResource','error','stack','name','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','AnalyticCustomReport','count','includeAll','include','findAll','rows','catch','show','rawAttributes','create','role','UserProfileSection','find','userProfileId','autoAssociation','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','metric','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignKey','table','foreignTable','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','from','MetricId','DESC','%s.%s\x20=\x20%s.%s','No\x20available\x20data','output','web','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','CustomReports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x9d6e,0x1bb));var _0xe9d6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9d6e[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9d6('0x0'));var rimraf=require(_0xe9d6('0x1'));var zipdir=require(_0xe9d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9d6('0x3'));var moment=require(_0xe9d6('0x4'));var BPromise=require(_0xe9d6('0x5'));var Mustache=require(_0xe9d6('0x6'));var util=require(_0xe9d6('0x7'));var path=require(_0xe9d6('0x8'));var sox=require(_0xe9d6('0x9'));var csv=require(_0xe9d6('0xa'));var ejs=require(_0xe9d6('0xb'));var fs=require('fs');var _=require(_0xe9d6('0xc'));var squel=require(_0xe9d6('0xd'));var crypto=require(_0xe9d6('0xe'));var jsforce=require(_0xe9d6('0xf'));var deskjs=require(_0xe9d6('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe9d6('0x11'));var Redis=require(_0xe9d6('0x12'));var authService=require(_0xe9d6('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe9d6('0x14'));var logger=require('../../config/logger')(_0xe9d6('0x15'));var utils=require(_0xe9d6('0x16'));var config=require(_0xe9d6('0x17'));var db=require(_0xe9d6('0x18'))['db'];function respondWithStatusCode(_0x91ddfd,_0x369d5d){_0x369d5d=_0x369d5d||0xcc;return function(_0xbd3f79){if(_0xbd3f79){return _0x91ddfd[_0xe9d6('0x19')](_0x369d5d);}return _0x91ddfd[_0xe9d6('0x1a')](_0x369d5d)[_0xe9d6('0x1b')]();};}function respondWithResult(_0x4a75f6,_0x5aa42f){_0x5aa42f=_0x5aa42f||0xc8;return function(_0x3e5722){if(_0x3e5722){return _0x4a75f6[_0xe9d6('0x1a')](_0x5aa42f)[_0xe9d6('0x1c')](_0x3e5722);}};}function respondWithFilteredResult(_0xd0a379,_0x28cc37){return function(_0x2c2465){if(_0x2c2465){var _0x39818b=_0x2c2465['count'],_0x5a53a1=_0x28cc37[_0xe9d6('0x1d')],_0x1acba3=_0x28cc37['offset']+_0x28cc37[_0xe9d6('0x1e')],_0x3f3908;if(_0x1acba3>=_0x39818b){_0x1acba3=_0x39818b;_0x3f3908=0xc8;}else{_0x3f3908=0xce;}_0xd0a379[_0xe9d6('0x1a')](_0x3f3908);return _0xd0a379[_0xe9d6('0x1f')](_0xe9d6('0x20'),_0x5a53a1+'-'+_0x1acba3+'/'+_0x39818b)['json'](_0x2c2465);}return null;};}function patchUpdates(_0x5c6f0){return function(_0x398f82){try{jsonpatch[_0xe9d6('0x21')](_0x398f82,_0x5c6f0,!![]);}catch(_0xca2a3){return BPromise[_0xe9d6('0x22')](_0xca2a3);}return _0x398f82['save']();};}function saveUpdates(_0x201c36,_0x3197fb){return function(_0x1a2683){if(_0x1a2683){return _0x1a2683[_0xe9d6('0x23')](_0x201c36)['then'](function(_0x9a3dbf){return _0x9a3dbf;});}return null;};}function removeEntity(_0x2eac6f,_0x4fe635){return function(_0x125a94){if(_0x125a94){return _0x125a94[_0xe9d6('0x24')]()[_0xe9d6('0x25')](function(){var _0xfa64e0=_0x125a94[_0xe9d6('0x26')]({'plain':!![]});var _0x42ad76=_0xe9d6('0x27');return db[_0xe9d6('0x28')][_0xe9d6('0x24')]({'where':{'type':_0x42ad76,'resourceId':_0xfa64e0['id']}})[_0xe9d6('0x25')](function(){return _0x125a94;});})['then'](function(){_0x2eac6f['status'](0xcc)[_0xe9d6('0x1b')]();});}};}function handleEntityNotFound(_0x52fe43,_0x4d4081){return function(_0x495344){if(!_0x495344){_0x52fe43[_0xe9d6('0x19')](0x194);}return _0x495344;};}function handleError(_0x121158,_0xd03cd4){_0xd03cd4=_0xd03cd4||0x1f4;return function(_0x217145){logger[_0xe9d6('0x29')](_0x217145[_0xe9d6('0x2a')]);if(_0x217145[_0xe9d6('0x2b')]){delete _0x217145['name'];}_0x121158[_0xe9d6('0x1a')](_0xd03cd4)['send'](_0x217145);};}exports['index']=function(_0x4af320,_0x29ed1f){var _0x37c75c={},_0x1319c4={},_0x2ed798={'count':0x0,'rows':[]};var _0x5f4112=db['AnalyticCustomReport']['rawAttributes'];_0x1319c4[_0xe9d6('0x2c')]=_[_0xe9d6('0x2d')](_0x5f4112);_0x1319c4[_0xe9d6('0x2e')]=_[_0xe9d6('0x2d')](_0x4af320[_0xe9d6('0x2e')]);_0x1319c4[_0xe9d6('0x2f')]=_[_0xe9d6('0x30')](_0x1319c4[_0xe9d6('0x2c')],_0x1319c4[_0xe9d6('0x2e')]);_0x37c75c['attributes']=_['intersection'](_0x1319c4['model'],qs[_0xe9d6('0x31')](_0x4af320[_0xe9d6('0x2e')]['fields']));_0x37c75c['attributes']=_0x37c75c[_0xe9d6('0x32')][_0xe9d6('0x33')]?_0x37c75c[_0xe9d6('0x32')]:_0x1319c4[_0xe9d6('0x2c')];if(!_0x4af320[_0xe9d6('0x2e')]['hasOwnProperty']('nolimit')){_0x37c75c[_0xe9d6('0x1e')]=qs['limit'](_0x4af320[_0xe9d6('0x2e')][_0xe9d6('0x1e')]);_0x37c75c[_0xe9d6('0x1d')]=qs[_0xe9d6('0x1d')](_0x4af320[_0xe9d6('0x2e')][_0xe9d6('0x1d')]);}_0x37c75c[_0xe9d6('0x34')]=qs['sort'](_0x4af320['query'][_0xe9d6('0x35')]);_0x37c75c[_0xe9d6('0x36')]=qs['filters'](_[_0xe9d6('0x37')](_0x4af320['query'],_0x1319c4[_0xe9d6('0x2f')]));if(_0x4af320[_0xe9d6('0x2e')][_0xe9d6('0x38')]){_0x37c75c[_0xe9d6('0x36')]=_[_0xe9d6('0x39')](_0x37c75c[_0xe9d6('0x36')],{'$or':_[_0xe9d6('0x3a')](_0x5f4112,function(_0x5ea875){if(_0x5ea875[_0xe9d6('0x3b')][_0xe9d6('0x3c')]!==_0xe9d6('0x3d')){var _0x596a82={};_0x596a82[_0x5ea875[_0xe9d6('0x3e')]]={'$like':'%'+_0x4af320['query'][_0xe9d6('0x38')]+'%'};return _0x596a82;}})});}_0x37c75c=_[_0xe9d6('0x39')]({},_0x37c75c,_0x4af320[_0xe9d6('0x3f')]);var _0x2c64d6={'where':_0x37c75c[_0xe9d6('0x36')]};return db[_0xe9d6('0x40')][_0xe9d6('0x41')](_0x2c64d6)['then'](function(_0x29591d){_0x2ed798['count']=_0x29591d;if(_0x4af320[_0xe9d6('0x2e')][_0xe9d6('0x42')]){_0x37c75c[_0xe9d6('0x43')]=[{'all':!![]}];}return db[_0xe9d6('0x40')][_0xe9d6('0x44')](_0x37c75c);})[_0xe9d6('0x25')](function(_0x5a99b7){_0x2ed798[_0xe9d6('0x45')]=_0x5a99b7;return _0x2ed798;})['then'](respondWithFilteredResult(_0x29ed1f,_0x37c75c))[_0xe9d6('0x46')](handleError(_0x29ed1f,null));};exports[_0xe9d6('0x47')]=function(_0x2d682d,_0x16e479){var _0x2fc901={'raw':![],'where':{'id':_0x2d682d['params']['id']}},_0xafecfe={};_0xafecfe[_0xe9d6('0x2c')]=_[_0xe9d6('0x2d')](db[_0xe9d6('0x40')][_0xe9d6('0x48')]);_0xafecfe[_0xe9d6('0x2e')]=_[_0xe9d6('0x2d')](_0x2d682d[_0xe9d6('0x2e')]);_0xafecfe['filters']=_[_0xe9d6('0x30')](_0xafecfe[_0xe9d6('0x2c')],_0xafecfe[_0xe9d6('0x2e')]);_0x2fc901[_0xe9d6('0x32')]=_[_0xe9d6('0x30')](_0xafecfe['model'],qs[_0xe9d6('0x31')](_0x2d682d[_0xe9d6('0x2e')][_0xe9d6('0x31')]));_0x2fc901[_0xe9d6('0x32')]=_0x2fc901[_0xe9d6('0x32')][_0xe9d6('0x33')]?_0x2fc901[_0xe9d6('0x32')]:_0xafecfe[_0xe9d6('0x2c')];if(_0x2d682d[_0xe9d6('0x2e')][_0xe9d6('0x42')]){_0x2fc901[_0xe9d6('0x43')]=[{'all':!![]}];}_0x2fc901=_[_0xe9d6('0x39')]({},_0x2fc901,_0x2d682d[_0xe9d6('0x3f')]);return db[_0xe9d6('0x40')]['find'](_0x2fc901)[_0xe9d6('0x25')](handleEntityNotFound(_0x16e479,null))[_0xe9d6('0x25')](respondWithResult(_0x16e479,null))['catch'](handleError(_0x16e479,null));};exports['create']=function(_0x678e72,_0x28dd6c){return db['AnalyticCustomReport'][_0xe9d6('0x49')](_0x678e72['body'],{})[_0xe9d6('0x25')](function(_0x58e86e){var _0x1d5c55=_0x678e72['user'][_0xe9d6('0x26')]({'plain':!![]});if(!_0x1d5c55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d5c55[_0xe9d6('0x4a')]==='user'){var _0x2a03b8=_0x58e86e[_0xe9d6('0x26')]({'plain':!![]});var _0x47398f='Reports';return db[_0xe9d6('0x4b')][_0xe9d6('0x4c')]({'where':{'name':_0x47398f,'userProfileId':_0x1d5c55[_0xe9d6('0x4d')]},'raw':!![]})[_0xe9d6('0x25')](function(_0x362801){if(_0x362801&&_0x362801[_0xe9d6('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a03b8[_0xe9d6('0x2b')],'resourceId':_0x2a03b8['id'],'type':_0xe9d6('0x27'),'sectionId':_0x362801['id']},{})['then'](function(){return _0x58e86e;});}else{return _0x58e86e;}})[_0xe9d6('0x46')](function(_0x3ef4a8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ef4a8);throw _0x3ef4a8;});}return _0x58e86e;})[_0xe9d6('0x25')](respondWithResult(_0x28dd6c,0xc9))[_0xe9d6('0x46')](handleError(_0x28dd6c,null));};exports[_0xe9d6('0x23')]=function(_0x1f42b2,_0x4bb529){if(_0x1f42b2[_0xe9d6('0x4f')]['id']){delete _0x1f42b2['body']['id'];}return db[_0xe9d6('0x40')]['find']({'where':{'id':_0x1f42b2[_0xe9d6('0x50')]['id']}})[_0xe9d6('0x25')](handleEntityNotFound(_0x4bb529,null))[_0xe9d6('0x25')](saveUpdates(_0x1f42b2[_0xe9d6('0x4f')],null))[_0xe9d6('0x25')](respondWithResult(_0x4bb529,null))[_0xe9d6('0x46')](handleError(_0x4bb529,null));};exports[_0xe9d6('0x24')]=function(_0x771e25,_0x125b49){return db['AnalyticCustomReport'][_0xe9d6('0x4c')]({'where':{'id':_0x771e25[_0xe9d6('0x50')]['id']}})['then'](handleEntityNotFound(_0x125b49,null))[_0xe9d6('0x25')](removeEntity(_0x125b49,null))[_0xe9d6('0x46')](handleError(_0x125b49,null));};exports[_0xe9d6('0x51')]=function(_0x12bc10,_0x3bdafb){var _0x4ca1df=0xa;var _0x16f77f=[_0xe9d6('0x52'),_0xe9d6('0x53'),_0xe9d6('0x54'),_0xe9d6('0x55')];var _0x5d71e1={'SUM':_0xe9d6('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe9d6('0x57'),'AVG':_0xe9d6('0x58'),'GROUP_CONCAT':_0xe9d6('0x59'),'GROUP_CONCAT ASC':_0xe9d6('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e89cb={'SEC_TO_TIME':_0xe9d6('0x5b'),'DATE':_0xe9d6('0x5c'),'HOUR':_0xe9d6('0x5d'),'ROUND':_0xe9d6('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1312e6=function(_0x20a761){return!_[_0xe9d6('0x5f')]([_0xe9d6('0x60'),_0xe9d6('0x61'),_0xe9d6('0x62'),_0xe9d6('0x63')],_0x20a761);};var _0x42484a=function(_0x1bccbd){if(!_0x1bccbd||!_0x1bccbd[_0xe9d6('0x64')]['length']){return'';}for(var _0x5f4596='(',_0x1fc1fc=0x0;_0x1fc1fc<_0x1bccbd[_0xe9d6('0x64')][_0xe9d6('0x33')];_0x1fc1fc+=0x1){_0x1fc1fc>0x0&&(_0x5f4596+='\x20'+_0x1bccbd[_0xe9d6('0x65')]+'\x20');_0x5f4596+=_0x1bccbd[_0xe9d6('0x64')][_0x1fc1fc][_0xe9d6('0x66')]?_0x42484a(_0x1bccbd[_0xe9d6('0x64')][_0x1fc1fc]['group']):_0x1bccbd[_0xe9d6('0x64')][_0x1fc1fc][_0xe9d6('0x3e')]+'\x20'+_0x1bccbd[_0xe9d6('0x64')][_0x1fc1fc][_0xe9d6('0x67')]+(_0x1312e6(_0x1bccbd['rules'][_0x1fc1fc][_0xe9d6('0x67')])?'\x20'+_0x1bccbd[_0xe9d6('0x64')][_0x1fc1fc][_0xe9d6('0x68')]:'');}return _0x5f4596+')';};var _0x34893e={'where':{'id':_0x12bc10[_0xe9d6('0x50')]['id']}},_0x145c7d,_0x32dd3c,_0x36f144,_0x435aa0,_0x13710a;_0x34893e=_[_0xe9d6('0x39')]({},_0x34893e,_0x12bc10['options']);return db[_0xe9d6('0x40')]['find'](_0x34893e)['then'](function(_0x3339da){if(_0x3339da){_0x145c7d=_0x3339da;return _0x3339da[_0xe9d6('0x69')]();}return null;})[_0xe9d6('0x25')](function(_0x3bf477){if(_0x3bf477){if(!_0x3bf477[_0xe9d6('0x33')]){throw new db[(_0xe9d6('0x6a'))][(_0xe9d6('0x6b'))](_0xe9d6('0x6c'),0x193);}_0x32dd3c=_0x3bf477;return db[_0xe9d6('0x6d')][_0xe9d6('0x44')]({'raw':!![]});}return null;})['then'](function(_0x371bc3){if(_0x371bc3){_0x36f144=_[_0xe9d6('0x6e')](_0x371bc3,'id');var _0x135e16;var _0x5a8dce=squel[_0xe9d6('0x6f')]();_0x5a8dce['from'](_0x145c7d['table']);for(var _0x2c9003=0x0;_0x2c9003<_0x32dd3c[_0xe9d6('0x33')];_0x2c9003+=0x1){_0x135e16=_0x32dd3c[_0x2c9003]['MetricId']?_0x36f144[_0x32dd3c[_0x2c9003]['MetricId']][_0xe9d6('0x70')]:_0x32dd3c[_0x2c9003][_0xe9d6('0x3e')];_0x135e16=_0x32dd3c[_0x2c9003][_0xe9d6('0x71')]?_[_0xe9d6('0x72')](_0x5d71e1[_0x32dd3c[_0x2c9003][_0xe9d6('0x71')]],'%s',_0x135e16):_0x135e16;_0x135e16=_0x32dd3c[_0x2c9003]['format']?_[_0xe9d6('0x72')](_0x5e89cb[_0x32dd3c[_0x2c9003][_0xe9d6('0x73')]],'%s',_0x135e16):_0x135e16;if(_0x32dd3c[_0x2c9003][_0xe9d6('0x74')]){_0x5a8dce[_0xe9d6('0x66')](_0x135e16);}_0x32dd3c[_0x2c9003][_0xe9d6('0x75')]&&_0x5a8dce[_0xe9d6('0x34')](_0x135e16,_0x32dd3c[_0x2c9003][_0xe9d6('0x75')]==='DESC'?![]:!![]);_0x5a8dce[_0xe9d6('0x3e')](_0x135e16,_0x32dd3c[_0x2c9003]['alias']||_0x135e16);}if(_0x145c7d[_0xe9d6('0x76')]){_0x145c7d[_0xe9d6('0x76')]=JSON[_0xe9d6('0x77')](_0x145c7d['joins']);for(var _0x214ac1=0x0;_0x214ac1<_0x145c7d[_0xe9d6('0x76')][_0xe9d6('0x33')];_0x214ac1+=0x1){if(_0x145c7d['joins'][_0x214ac1]['type']&&_[_0xe9d6('0x5f')](_0x16f77f,_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x3b')])&&_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x78')]&&_0x145c7d[_0xe9d6('0x76')][_0x214ac1]['foreignTable']&&_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x79')]){_0x5a8dce[_0x145c7d[_0xe9d6('0x76')][_0x214ac1]['type']](_0x145c7d[_0xe9d6('0x76')][_0x214ac1]['foreignTable'],null,util[_0xe9d6('0x73')]('%s.%s\x20=\x20%s.%s',_0x145c7d[_0xe9d6('0x7a')],_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x78')],_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x7b')],_0x145c7d[_0xe9d6('0x76')][_0x214ac1][_0xe9d6('0x79')]));}}}if(_0x145c7d[_0xe9d6('0x7c')]){_0x145c7d[_0xe9d6('0x7c')]=JSON[_0xe9d6('0x77')](_0x145c7d[_0xe9d6('0x7c')]);_0x5a8dce[_0xe9d6('0x36')](_0x42484a(_0x145c7d['conditions'][_0xe9d6('0x66')]));}_0x13710a=_0x5a8dce[_0xe9d6('0x7d')]();_0x5a8dce[_0xe9d6('0x1e')](_0x4ca1df);_0x5a8dce[_0xe9d6('0x1d')](0x0);logger[_0xe9d6('0x7e')](_0xe9d6('0x7f'),_0x5a8dce['toString']());return db[_0xe9d6('0x80')][_0xe9d6('0x2e')](_0x5a8dce[_0xe9d6('0x81')](),{'type':db[_0xe9d6('0x80')][_0xe9d6('0x82')][_0xe9d6('0x83')]});}})[_0xe9d6('0x25')](respondWithResult(_0x3bdafb,null))[_0xe9d6('0x46')](handleError(_0x3bdafb,null));};function runReport(_0x2727ce,_0x122cae,_0x173efa){var _0x5b3481=_0x122cae[_0xe9d6('0x2b')];var _0x10cf33=0xa;var _0xf2ae2c=[_0xe9d6('0x52'),_0xe9d6('0x53'),_0xe9d6('0x54'),'cross_join'];var _0xb903d2={'SUM':_0xe9d6('0x56'),'COUNT':_0xe9d6('0x84'),'COUNT DISTINCT':_0xe9d6('0x85'),'MAX':'MAX(%s)','MIN':_0xe9d6('0x57'),'AVG':_0xe9d6('0x58'),'GROUP_CONCAT':_0xe9d6('0x59'),'GROUP_CONCAT ASC':_0xe9d6('0x5a'),'GROUP_CONCAT DESC':_0xe9d6('0x86')};var _0x15f6c9={'SEC_TO_TIME':_0xe9d6('0x5b'),'DATE':'DATE(%s)','HOUR':_0xe9d6('0x5d'),'ROUND':_0xe9d6('0x5e'),'UNIX_TIMESTAMP':_0xe9d6('0x87')};var _0x45f35b=function(_0xc3e578){return!_['includes']([_0xe9d6('0x60'),_0xe9d6('0x61'),_0xe9d6('0x62'),_0xe9d6('0x63')],_0xc3e578);};var _0x5aadcc=function(_0x2df750){if(!_0x2df750||!_0x2df750[_0xe9d6('0x64')][_0xe9d6('0x33')]){return'';}for(var _0x50d74d='(',_0x404d0b=0x0;_0x404d0b<_0x2df750[_0xe9d6('0x64')]['length'];_0x404d0b+=0x1){_0x404d0b>0x0&&(_0x50d74d+='\x20'+_0x2df750[_0xe9d6('0x65')]+'\x20');_0x50d74d+=_0x2df750['rules'][_0x404d0b][_0xe9d6('0x66')]?_0x5aadcc(_0x2df750[_0xe9d6('0x64')][_0x404d0b][_0xe9d6('0x66')]):_0x2df750[_0xe9d6('0x64')][_0x404d0b]['field']+'\x20'+_0x2df750['rules'][_0x404d0b][_0xe9d6('0x67')]+(_0x45f35b(_0x2df750[_0xe9d6('0x64')][_0x404d0b]['condition'])?'\x20'+_0x2df750[_0xe9d6('0x64')][_0x404d0b]['value']:'');}return _0x50d74d+')';};var _0x57cfe3={'where':{'id':_0x2727ce['id']}},_0x28b2f5,_0x2c8816,_0x23532b,_0x1f8c2d,_0x40844a;_0x57cfe3=_[_0xe9d6('0x39')]({},_0x57cfe3,_0x173efa);return db['AnalyticCustomReport'][_0xe9d6('0x4c')](_0x57cfe3)[_0xe9d6('0x25')](function(_0x1a676d){if(_0x1a676d){_0x28b2f5=_0x1a676d;return _0x1a676d[_0xe9d6('0x69')]();}return null;})[_0xe9d6('0x25')](function(_0x564780){if(_0x564780){if(!_0x564780[_0xe9d6('0x33')]){throw new db[(_0xe9d6('0x6a'))]['ValidationErrorItem'](_0xe9d6('0x6c'),0x193);}_0x2c8816=_0x564780;return db[_0xe9d6('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xe9d6('0x25')](function(_0x3d0f3f){if(_0x3d0f3f){_0x23532b=_[_0xe9d6('0x6e')](_0x3d0f3f,'id');var _0x4b62de;var _0x429df6=squel[_0xe9d6('0x6f')]();_0x429df6[_0xe9d6('0x88')](_0x28b2f5['table']);for(var _0x4944b9=0x0;_0x4944b9<_0x2c8816[_0xe9d6('0x33')];_0x4944b9+=0x1){_0x4b62de=_0x2c8816[_0x4944b9][_0xe9d6('0x89')]?_0x23532b[_0x2c8816[_0x4944b9]['MetricId']]['metric']:_0x2c8816[_0x4944b9][_0xe9d6('0x3e')];_0x4b62de=_0x2c8816[_0x4944b9]['function']?_[_0xe9d6('0x72')](_0xb903d2[_0x2c8816[_0x4944b9]['function']],'%s',_0x4b62de):_0x4b62de;_0x4b62de=_0x2c8816[_0x4944b9]['format']?_[_0xe9d6('0x72')](_0x15f6c9[_0x2c8816[_0x4944b9][_0xe9d6('0x73')]],'%s',_0x4b62de):_0x4b62de;if(_0x2c8816[_0x4944b9]['groupBy']){_0x429df6[_0xe9d6('0x66')](_0x4b62de);}_0x2c8816[_0x4944b9][_0xe9d6('0x75')]&&_0x429df6[_0xe9d6('0x34')](_0x4b62de,_0x2c8816[_0x4944b9][_0xe9d6('0x75')]===_0xe9d6('0x8a')?![]:!![]);_0x429df6['field'](_0x4b62de,_0x2c8816[_0x4944b9]['alias']||_0x4b62de);}if(_0x28b2f5[_0xe9d6('0x76')]){_0x28b2f5['joins']=JSON[_0xe9d6('0x77')](_0x28b2f5[_0xe9d6('0x76')]);for(var _0x551cf4=0x0;_0x551cf4<_0x28b2f5['joins']['length'];_0x551cf4+=0x1){if(_0x28b2f5[_0xe9d6('0x76')][_0x551cf4][_0xe9d6('0x3b')]&&_[_0xe9d6('0x5f')](_0xf2ae2c,_0x28b2f5[_0xe9d6('0x76')][_0x551cf4][_0xe9d6('0x3b')])&&_0x28b2f5['joins'][_0x551cf4][_0xe9d6('0x78')]&&_0x28b2f5[_0xe9d6('0x76')][_0x551cf4]['foreignTable']&&_0x28b2f5[_0xe9d6('0x76')][_0x551cf4][_0xe9d6('0x79')]){_0x429df6[_0x28b2f5[_0xe9d6('0x76')][_0x551cf4]['type']](_0x28b2f5[_0xe9d6('0x76')][_0x551cf4][_0xe9d6('0x7b')],null,util[_0xe9d6('0x73')](_0xe9d6('0x8b'),_0x28b2f5['table'],_0x28b2f5['joins'][_0x551cf4]['parentKey'],_0x28b2f5[_0xe9d6('0x76')][_0x551cf4]['foreignTable'],_0x28b2f5['joins'][_0x551cf4][_0xe9d6('0x79')]));}}}if(_0x28b2f5[_0xe9d6('0x7c')]){_0x28b2f5[_0xe9d6('0x7c')]=JSON[_0xe9d6('0x77')](_0x28b2f5[_0xe9d6('0x7c')]);_0x429df6[_0xe9d6('0x36')](_0x5aadcc(_0x28b2f5['conditions'][_0xe9d6('0x66')]));}_0x40844a=_0x429df6[_0xe9d6('0x7d')]();_0x429df6[_0xe9d6('0x1e')](_0x10cf33);_0x429df6['offset'](0x0);logger['debug']('Limited\x20Query:',_0x429df6[_0xe9d6('0x81')]());return db[_0xe9d6('0x80')][_0xe9d6('0x2e')](_0x429df6[_0xe9d6('0x81')](),{'type':db['sequelize'][_0xe9d6('0x82')][_0xe9d6('0x83')]});}})[_0xe9d6('0x25')](function(_0x2e4ae7){if(!_0x2e4ae7[_0xe9d6('0x33')]){throw new db[(_0xe9d6('0x6a'))][(_0xe9d6('0x6b'))](_0xe9d6('0x8c'),0xcc);}if(_0x122cae[_0xe9d6('0x8d')]===_0xe9d6('0x8e')){return null;}var _0x5cf60d=_[_0xe9d6('0x39')](_0x122cae,{'name':_0x122cae['fullPath']||_0x122cae[_0xe9d6('0x2b')]||_0x28b2f5[_0xe9d6('0x2b')],'basename':_0x5b3481,'savename':util[_0xe9d6('0x73')](_0xe9d6('0x8f'),_0x122cae[_0xe9d6('0x2b')]||_0x28b2f5[_0xe9d6('0x2b')],require('randomstring')[_0xe9d6('0x90')](0x4),_0x122cae[_0xe9d6('0x8d')]||_0xe9d6('0x91')),'reportId':_0x28b2f5['id'],'reportType':'custom'});return db[_0xe9d6('0x92')]['create'](_0x5cf60d,{'raw':!![]});})[_0xe9d6('0x25')](function(_0x42babc){if(_0x28b2f5['table']===_0xe9d6('0x93')){_0x40844a[_0xe9d6('0x36')](_0x28b2f5['table']+_0xe9d6('0x94'),_0x122cae[_0xe9d6('0x95')],_0x122cae[_0xe9d6('0x96')]);}else{_0x40844a[_0xe9d6('0x36')](_0x28b2f5[_0xe9d6('0x7a')]+_0xe9d6('0x97'),_0x122cae[_0xe9d6('0x95')],_0x122cae[_0xe9d6('0x96')]);}if(_0x42babc){logger[_0xe9d6('0x98')]('Run\x20Query:',_0x40844a[_0xe9d6('0x81')]());require(_0xe9d6('0x99'))[_0xe9d6('0x9a')](path[_0xe9d6('0x52')](__dirname,_0xe9d6('0x9b'),_0x42babc[_0xe9d6('0x8d')]),[_0x42babc['id'],_0x40844a[_0xe9d6('0x81')](),path[_0xe9d6('0x52')](__dirname,_0xe9d6('0x9c'),_0x42babc['savename']),_0x5b3481]);return _0x42babc;}else{var _0x571f0f=squel[_0xe9d6('0x6f')]();_0x571f0f[_0xe9d6('0x88')]('('+_0x40844a[_0xe9d6('0x81')]()+')',_0xe9d6('0x9d'));_0x571f0f[_0xe9d6('0x3e')](_0xe9d6('0x9e'),_0xe9d6('0x41'));_0x40844a[_0xe9d6('0x1e')](_0x122cae[_0xe9d6('0x1e')]||_0x10cf33);_0x40844a[_0xe9d6('0x1d')](_0x122cae[_0xe9d6('0x1d')]||0x0);return db[_0xe9d6('0x80')][_0xe9d6('0x2e')](_0x571f0f['toString'](),{'type':db[_0xe9d6('0x80')][_0xe9d6('0x82')][_0xe9d6('0x83')]})[_0xe9d6('0x25')](function(_0x534955){if(!_0x534955[_0xe9d6('0x33')]){_0x1f8c2d=0x0;}else{_0x1f8c2d=_0x534955[0x0][_0xe9d6('0x41')]||0x0;}return db[_0xe9d6('0x80')][_0xe9d6('0x2e')](_0x40844a[_0xe9d6('0x81')](),{'type':db[_0xe9d6('0x80')]['QueryTypes']['SELECT']});})['then'](function(_0x1b813b){return{'rows':_0x1b813b||[],'count':_0x1f8c2d};});}});}exports[_0xe9d6('0x9f')]=function(_0x36cc00,_0x2824a4){return runReport(_0x36cc00[_0xe9d6('0x50')],_0x36cc00[_0xe9d6('0x2e')],_0x36cc00[_0xe9d6('0x3f')])[_0xe9d6('0x25')](respondWithResult(_0x2824a4,null))[_0xe9d6('0x46')](handleError(_0x2824a4,null));};exports[_0xe9d6('0xa0')]=runReport;exports['query']=function(_0x37b263,_0x250f81){var _0x3b77a7=0xa;var _0x12f482=[_0xe9d6('0x52'),'left_join',_0xe9d6('0x54'),_0xe9d6('0x55')];var _0x18e287={'SUM':'SUM(%s)','COUNT':_0xe9d6('0x84'),'COUNT DISTINCT':_0xe9d6('0x85'),'MAX':'MAX(%s)','MIN':_0xe9d6('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe9d6('0x59'),'GROUP_CONCAT ASC':_0xe9d6('0x5a'),'GROUP_CONCAT DESC':_0xe9d6('0x86')};var _0x2dcddb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe9d6('0x5c'),'HOUR':_0xe9d6('0x5d'),'ROUND':_0xe9d6('0x5e'),'UNIX_TIMESTAMP':_0xe9d6('0x87')};var _0xbc46d=function(_0x4c3d55){return!_['includes']([_0xe9d6('0x60'),_0xe9d6('0x61'),_0xe9d6('0x62'),_0xe9d6('0x63')],_0x4c3d55);};var _0x27b40=function(_0x56b40c){if(!_0x56b40c||!_0x56b40c['rules'][_0xe9d6('0x33')]){return'';}for(var _0x495867='(',_0xc4ba92=0x0;_0xc4ba92<_0x56b40c[_0xe9d6('0x64')][_0xe9d6('0x33')];_0xc4ba92+=0x1){_0xc4ba92>0x0&&(_0x495867+='\x20'+_0x56b40c[_0xe9d6('0x65')]+'\x20');_0x495867+=_0x56b40c[_0xe9d6('0x64')][_0xc4ba92][_0xe9d6('0x66')]?_0x27b40(_0x56b40c[_0xe9d6('0x64')][_0xc4ba92][_0xe9d6('0x66')]):_0x56b40c['rules'][_0xc4ba92]['field']+'\x20'+_0x56b40c['rules'][_0xc4ba92][_0xe9d6('0x67')]+(_0xbc46d(_0x56b40c[_0xe9d6('0x64')][_0xc4ba92][_0xe9d6('0x67')])?'\x20'+_0x56b40c[_0xe9d6('0x64')][_0xc4ba92][_0xe9d6('0x68')]:'');}return _0x495867+')';};var _0x48a4c2={'where':{'id':_0x37b263['params']['id']}},_0x18adce,_0x24ef77,_0x4bfa91,_0x38a4e0,_0xe097ab;_0x48a4c2=_[_0xe9d6('0x39')]({},_0x48a4c2,_0x37b263[_0xe9d6('0x3f')]);return db[_0xe9d6('0x40')][_0xe9d6('0x4c')](_0x48a4c2)[_0xe9d6('0x25')](function(_0x56d0fd){if(_0x56d0fd){_0x18adce=_0x56d0fd;return _0x56d0fd[_0xe9d6('0x69')]();}return null;})[_0xe9d6('0x25')](function(_0x197241){if(_0x197241){if(!_0x197241[_0xe9d6('0x33')]){throw new db[(_0xe9d6('0x6a'))][(_0xe9d6('0x6b'))](_0xe9d6('0x6c'),0x193);}_0x24ef77=_0x197241;return db[_0xe9d6('0x6d')][_0xe9d6('0x44')]({'raw':!![]});}return null;})[_0xe9d6('0x25')](function(_0x333fe8){if(_0x333fe8){_0x4bfa91=_[_0xe9d6('0x6e')](_0x333fe8,'id');var _0x42c907;var _0x780c69=squel[_0xe9d6('0x6f')]();_0x780c69[_0xe9d6('0x88')](_0x18adce[_0xe9d6('0x7a')]);for(var _0x8fcc42=0x0;_0x8fcc42<_0x24ef77[_0xe9d6('0x33')];_0x8fcc42+=0x1){_0x42c907=_0x24ef77[_0x8fcc42][_0xe9d6('0x89')]?_0x4bfa91[_0x24ef77[_0x8fcc42][_0xe9d6('0x89')]][_0xe9d6('0x70')]:_0x24ef77[_0x8fcc42][_0xe9d6('0x3e')];_0x42c907=_0x24ef77[_0x8fcc42][_0xe9d6('0x71')]?_[_0xe9d6('0x72')](_0x18e287[_0x24ef77[_0x8fcc42][_0xe9d6('0x71')]],'%s',_0x42c907):_0x42c907;_0x42c907=_0x24ef77[_0x8fcc42][_0xe9d6('0x73')]?_[_0xe9d6('0x72')](_0x2dcddb[_0x24ef77[_0x8fcc42][_0xe9d6('0x73')]],'%s',_0x42c907):_0x42c907;if(_0x24ef77[_0x8fcc42]['groupBy']){_0x780c69['group'](_0x42c907);}_0x24ef77[_0x8fcc42]['orderBy']&&_0x780c69[_0xe9d6('0x34')](_0x42c907,_0x24ef77[_0x8fcc42][_0xe9d6('0x75')]==='DESC'?![]:!![]);_0x780c69['field'](_0x42c907,_0x24ef77[_0x8fcc42]['alias']||_0x42c907);}if(_0x18adce[_0xe9d6('0x76')]){_0x18adce['joins']=JSON[_0xe9d6('0x77')](_0x18adce[_0xe9d6('0x76')]);for(var _0x2136e3=0x0;_0x2136e3<_0x18adce['joins'][_0xe9d6('0x33')];_0x2136e3+=0x1){if(_0x18adce['joins'][_0x2136e3][_0xe9d6('0x3b')]&&_[_0xe9d6('0x5f')](_0x12f482,_0x18adce['joins'][_0x2136e3]['type'])&&_0x18adce[_0xe9d6('0x76')][_0x2136e3][_0xe9d6('0x78')]&&_0x18adce[_0xe9d6('0x76')][_0x2136e3][_0xe9d6('0x7b')]&&_0x18adce[_0xe9d6('0x76')][_0x2136e3]['foreignKey']){_0x780c69[_0x18adce[_0xe9d6('0x76')][_0x2136e3]['type']](_0x18adce[_0xe9d6('0x76')][_0x2136e3][_0xe9d6('0x7b')],null,util[_0xe9d6('0x73')](_0xe9d6('0x8b'),_0x18adce[_0xe9d6('0x7a')],_0x18adce[_0xe9d6('0x76')][_0x2136e3]['parentKey'],_0x18adce['joins'][_0x2136e3][_0xe9d6('0x7b')],_0x18adce[_0xe9d6('0x76')][_0x2136e3][_0xe9d6('0x79')]));}}}if(_0x18adce[_0xe9d6('0x7c')]){_0x18adce[_0xe9d6('0x7c')]=JSON[_0xe9d6('0x77')](_0x18adce[_0xe9d6('0x7c')]);_0x780c69[_0xe9d6('0x36')](_0x27b40(_0x18adce['conditions']['group']));}_0xe097ab=_0x780c69[_0xe9d6('0x7d')]();_0x780c69[_0xe9d6('0x1e')](_0x3b77a7);_0x780c69[_0xe9d6('0x1d')](0x0);logger[_0xe9d6('0x7e')](_0xe9d6('0x7f'),_0x780c69['toString']());return db[_0xe9d6('0x80')]['query'](_0x780c69[_0xe9d6('0x81')](),{'type':db[_0xe9d6('0x80')][_0xe9d6('0x82')]['SELECT']});}})['then'](function(){return{'sql':_0xe097ab[_0xe9d6('0x81')]()};})[_0xe9d6('0x25')](respondWithResult(_0x250f81,null))[_0xe9d6('0x46')](handleError(_0x250f81,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b8b7666..f92294b 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 _0xacb7=['moment','path','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api'];(function(_0x44104e,_0x2d2d96){var _0x51e6a8=function(_0x11d488){while(--_0x11d488){_0x44104e['push'](_0x44104e['shift']());}};_0x51e6a8(++_0x2d2d96);}(_0xacb7,0xce));var _0x7acb=function(_0x402c27,_0x1ef5a8){_0x402c27=_0x402c27-0x0;var _0x3959a9=_0xacb7[_0x402c27];return _0x3959a9;};'use strict';var _=require(_0x7acb('0x0'));var util=require(_0x7acb('0x1'));var logger=require(_0x7acb('0x2'))(_0x7acb('0x3'));var moment=require(_0x7acb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7acb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7acb('0x6'));module[_0x7acb('0x7')]=function(_0x54780e,_0x34d5c4){return _0x54780e['define'](_0x7acb('0x8'),attributes,{'tableName':_0x7acb('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6790=['./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6790,0x1cf));var _0x0679=function(_0x1dc9c3,_0x1d6be9){_0x1dc9c3=_0x1dc9c3-0x0;var _0x25d21a=_0x6790[_0x1dc9c3];return _0x25d21a;};'use strict';var _=require(_0x0679('0x0'));var util=require(_0x0679('0x1'));var logger=require(_0x0679('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0679('0x3'));var rp=require(_0x0679('0x4'));var fs=require('fs');var path=require(_0x0679('0x5'));var rimraf=require(_0x0679('0x6'));var config=require('../../config/environment');var attributes=require(_0x0679('0x7'));module['exports']=function(_0x10116,_0x4fe21e){return _0x10116[_0x0679('0x8')](_0x0679('0x9'),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 b88a89c..db583bc 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 _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0x4deac0,_0x220f4e){var _0x94d711=function(_0x59827e){while(--_0x59827e){_0x4deac0['push'](_0x4deac0['shift']());}};_0x94d711(++_0x220f4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x45ffad,_0x1c09f0){var _0x7c936e=function(_0xae7e55){while(--_0xae7e55){_0x45ffad['push'](_0x45ffad['shift']());}};_0x7c936e(++_0x1c09f0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a94475c..7328413 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 _0xfb11=['preview','/:id/run','run','/:id/query','query','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./analyticCustomReport.controller','get','index','isAuthenticated','show','/:id/preview'];(function(_0x30b6f6,_0x3beb68){var _0x31a30e=function(_0x1f291a){while(--_0x1f291a){_0x30b6f6['push'](_0x30b6f6['shift']());}};_0x31a30e(++_0x3beb68);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xfb11[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1fb1('0x4'));var config=require('../../config/environment');var controller=require(_0x1fb1('0x5'));router[_0x1fb1('0x6')]('/',auth['isAuthenticated'](),controller[_0x1fb1('0x7')]);router[_0x1fb1('0x6')]('/:id',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x9')]);router[_0x1fb1('0x6')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xb')]);router[_0x1fb1('0x6')](_0x1fb1('0xc'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xd')]);router['get'](_0x1fb1('0xe'),auth['isAuthenticated'](),controller[_0x1fb1('0xf')]);router['post']('/',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x10')]);router[_0x1fb1('0x11')](_0x1fb1('0x12'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x13')]);router['delete'](_0x1fb1('0x12'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x14')]);module[_0x1fb1('0x15')]=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','delete','destroy','exports'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x0b0e,0x187));var _0xe0b0=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0x0b0e[_0x408de5];return _0x2015a1;};'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 auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['run']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth[_0xe0b0('0x9')](),controller['create']);router[_0xe0b0('0x12')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x13')]);router[_0xe0b0('0x14')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);module[_0xe0b0('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 9251954..fe07139 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 _0x8d36=['exports','STRING','TEXT','sequelize'];(function(_0x14c07f,_0x583b95){var _0x2ac811=function(_0x44ce48){while(--_0x44ce48){_0x14c07f['push'](_0x14c07f['shift']());}};_0x2ac811(++_0x583b95);}(_0x8d36,0x11f));var _0x68d3=function(_0x2d23e5,_0x32495a){_0x2d23e5=_0x2d23e5-0x0;var _0x38823a=_0x8d36[_0x2d23e5];return _0x38823a;};'use strict';var Sequelize=require(_0x68d3('0x0'));module[_0x68d3('0x1')]={'name':{'type':Sequelize[_0x68d3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68d3('0x2')]},'parent':{'type':Sequelize[_0x68d3('0x2')]},'table':{'type':Sequelize[_0x68d3('0x2')]},'conditions':{'type':Sequelize[_0x68d3('0x3')]},'joins':{'type':Sequelize[_0x68d3('0x3')]}}; \ No newline at end of file +var _0x37f8=['TEXT','sequelize','exports','STRING'];(function(_0x6e444a,_0x4b5d53){var _0x1ac675=function(_0x43750f){while(--_0x43750f){_0x6e444a['push'](_0x6e444a['shift']());}};_0x1ac675(++_0x4b5d53);}(_0x37f8,0x141));var _0x837f=function(_0x3de7c9,_0x348369){_0x3de7c9=_0x3de7c9-0x0;var _0x6959e5=_0x37f8[_0x3de7c9];return _0x6959e5;};'use strict';var Sequelize=require(_0x837f('0x0'));module[_0x837f('0x1')]={'name':{'type':Sequelize[_0x837f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x837f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x837f('0x2')]},'conditions':{'type':Sequelize[_0x837f('0x3')]},'joins':{'type':Sequelize[_0x837f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 01c4aa3..8a0218b 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 _0x326b=['bluebird','mustache','util','to-csv','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','then','get','DefaultReports','UserProfileResource','destroy','end','error','send','index','AnalyticDefaultReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','field','options','count','includeAll','include','findAll','rows','catch','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','Sequelize','select','metric','clone','No\x20available\x20data','output','web','fullPath','name','randomstring','csv','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','run','runReport','ValidationErrorItem','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x326b,0x1d8));var _0xb326=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0x326b[_0x80f51a];return _0x327148;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb326('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb326('0x1'));var jsonpatch=require(_0xb326('0x2'));var rp=require(_0xb326('0x3'));var moment=require(_0xb326('0x4'));var BPromise=require(_0xb326('0x5'));var Mustache=require(_0xb326('0x6'));var util=require(_0xb326('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb326('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb326('0x9'));var squel=require(_0xb326('0xa'));var crypto=require('crypto');var jsforce=require(_0xb326('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb326('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb326('0xc'));var authService=require(_0xb326('0xd'));var qs=require(_0xb326('0xe'));var hardwareService=require(_0xb326('0xf'));var logger=require(_0xb326('0x10'))('api');var utils=require(_0xb326('0x11'));var config=require(_0xb326('0x12'));var db=require(_0xb326('0x13'))['db'];function respondWithStatusCode(_0x2b183b,_0x5bd867){_0x5bd867=_0x5bd867||0xcc;return function(_0x4f61ed){if(_0x4f61ed){return _0x2b183b[_0xb326('0x14')](_0x5bd867);}return _0x2b183b['status'](_0x5bd867)['end']();};}function respondWithResult(_0x52ef6c,_0x278920){_0x278920=_0x278920||0xc8;return function(_0x452d2e){if(_0x452d2e){return _0x52ef6c[_0xb326('0x15')](_0x278920)[_0xb326('0x16')](_0x452d2e);}};}function respondWithFilteredResult(_0x151b9a,_0x1d0038){return function(_0x3b914a){if(_0x3b914a){var _0x5c8796=_0x3b914a['count'],_0x47408e=_0x1d0038[_0xb326('0x17')],_0x386429=_0x1d0038[_0xb326('0x17')]+_0x1d0038[_0xb326('0x18')],_0x4408fb;if(_0x386429>=_0x5c8796){_0x386429=_0x5c8796;_0x4408fb=0xc8;}else{_0x4408fb=0xce;}_0x151b9a[_0xb326('0x15')](_0x4408fb);return _0x151b9a[_0xb326('0x19')](_0xb326('0x1a'),_0x47408e+'-'+_0x386429+'/'+_0x5c8796)[_0xb326('0x16')](_0x3b914a);}return null;};}function patchUpdates(_0x384c79){return function(_0x3ffb93){try{jsonpatch[_0xb326('0x1b')](_0x3ffb93,_0x384c79,!![]);}catch(_0x150d0d){return BPromise['reject'](_0x150d0d);}return _0x3ffb93[_0xb326('0x1c')]();};}function saveUpdates(_0x3e0b51,_0x148648){return function(_0x2fe31e){if(_0x2fe31e){return _0x2fe31e['update'](_0x3e0b51)[_0xb326('0x1d')](function(_0x3c49a7){return _0x3c49a7;});}return null;};}function removeEntity(_0x235c18,_0x2974c0){return function(_0x9c25da){if(_0x9c25da){return _0x9c25da['destroy']()[_0xb326('0x1d')](function(){var _0x428d17=_0x9c25da[_0xb326('0x1e')]({'plain':!![]});var _0x5d1797=_0xb326('0x1f');return db[_0xb326('0x20')][_0xb326('0x21')]({'where':{'type':_0x5d1797,'resourceId':_0x428d17['id']}})['then'](function(){return _0x9c25da;});})[_0xb326('0x1d')](function(){_0x235c18[_0xb326('0x15')](0xcc)[_0xb326('0x22')]();});}};}function handleEntityNotFound(_0x2e8b11,_0x9b1d4){return function(_0x43f30a){if(!_0x43f30a){_0x2e8b11[_0xb326('0x14')](0x194);}return _0x43f30a;};}function handleError(_0x973e85,_0x5949fb){_0x5949fb=_0x5949fb||0x1f4;return function(_0x72a5c9){logger[_0xb326('0x23')](_0x72a5c9['stack']);if(_0x72a5c9['name']){delete _0x72a5c9['name'];}_0x973e85[_0xb326('0x15')](_0x5949fb)[_0xb326('0x24')](_0x72a5c9);};}exports[_0xb326('0x25')]=function(_0x4c8264,_0x2dc6a5){var _0x23d81f={},_0x286307={},_0x4d44a9={'count':0x0,'rows':[]};var _0xa6a5d9=db[_0xb326('0x26')][_0xb326('0x27')];_0x286307['model']=_[_0xb326('0x28')](_0xa6a5d9);_0x286307[_0xb326('0x29')]=_['keys'](_0x4c8264[_0xb326('0x29')]);_0x286307[_0xb326('0x2a')]=_[_0xb326('0x2b')](_0x286307['model'],_0x286307['query']);_0x23d81f[_0xb326('0x2c')]=_[_0xb326('0x2b')](_0x286307[_0xb326('0x2d')],qs[_0xb326('0x2e')](_0x4c8264[_0xb326('0x29')][_0xb326('0x2e')]));_0x23d81f[_0xb326('0x2c')]=_0x23d81f[_0xb326('0x2c')]['length']?_0x23d81f['attributes']:_0x286307[_0xb326('0x2d')];if(!_0x4c8264[_0xb326('0x29')][_0xb326('0x2f')](_0xb326('0x30'))){_0x23d81f[_0xb326('0x18')]=qs[_0xb326('0x18')](_0x4c8264['query'][_0xb326('0x18')]);_0x23d81f[_0xb326('0x17')]=qs[_0xb326('0x17')](_0x4c8264[_0xb326('0x29')][_0xb326('0x17')]);}_0x23d81f[_0xb326('0x31')]=qs['sort'](_0x4c8264[_0xb326('0x29')][_0xb326('0x32')]);_0x23d81f['where']=qs[_0xb326('0x2a')](_[_0xb326('0x33')](_0x4c8264[_0xb326('0x29')],_0x286307['filters']));if(_0x4c8264[_0xb326('0x29')][_0xb326('0x34')]){_0x23d81f[_0xb326('0x35')]=_[_0xb326('0x36')](_0x23d81f[_0xb326('0x35')],{'$or':_[_0xb326('0x37')](_0xa6a5d9,function(_0x330286){if(_0x330286['type'][_0xb326('0x38')]!=='VIRTUAL'){var _0x26a89d={};_0x26a89d[_0x330286[_0xb326('0x39')]]={'$like':'%'+_0x4c8264[_0xb326('0x29')]['filter']+'%'};return _0x26a89d;}})});}_0x23d81f=_[_0xb326('0x36')]({},_0x23d81f,_0x4c8264[_0xb326('0x3a')]);var _0x4efeb7={'where':_0x23d81f[_0xb326('0x35')]};return db[_0xb326('0x26')][_0xb326('0x3b')](_0x4efeb7)['then'](function(_0x4df23e){_0x4d44a9['count']=_0x4df23e;if(_0x4c8264[_0xb326('0x29')][_0xb326('0x3c')]){_0x23d81f[_0xb326('0x3d')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xb326('0x3e')](_0x23d81f);})[_0xb326('0x1d')](function(_0x59e0a2){_0x4d44a9[_0xb326('0x3f')]=_0x59e0a2;return _0x4d44a9;})[_0xb326('0x1d')](respondWithFilteredResult(_0x2dc6a5,_0x23d81f))[_0xb326('0x40')](handleError(_0x2dc6a5,null));};exports['show']=function(_0x34feae,_0x2befc7){var _0x57e860={'raw':!![],'where':{'id':_0x34feae[_0xb326('0x41')]['id']}},_0x5268b9={};_0x5268b9[_0xb326('0x2d')]=_['keys'](db[_0xb326('0x26')][_0xb326('0x27')]);_0x5268b9[_0xb326('0x29')]=_[_0xb326('0x28')](_0x34feae['query']);_0x5268b9['filters']=_['intersection'](_0x5268b9[_0xb326('0x2d')],_0x5268b9[_0xb326('0x29')]);_0x57e860[_0xb326('0x2c')]=_[_0xb326('0x2b')](_0x5268b9[_0xb326('0x2d')],qs[_0xb326('0x2e')](_0x34feae[_0xb326('0x29')][_0xb326('0x2e')]));_0x57e860[_0xb326('0x2c')]=_0x57e860[_0xb326('0x2c')][_0xb326('0x42')]?_0x57e860[_0xb326('0x2c')]:_0x5268b9[_0xb326('0x2d')];if(_0x34feae['query'][_0xb326('0x3c')]){_0x57e860[_0xb326('0x3d')]=[{'all':!![]}];}_0x57e860=_[_0xb326('0x36')]({},_0x57e860,_0x34feae[_0xb326('0x3a')]);return db['AnalyticDefaultReport']['find'](_0x57e860)['then'](handleEntityNotFound(_0x2befc7,null))[_0xb326('0x1d')](respondWithResult(_0x2befc7,null))['catch'](handleError(_0x2befc7,null));};exports['create']=function(_0x4e7626,_0x262d44){return db['AnalyticDefaultReport'][_0xb326('0x43')](_0x4e7626['body'],{})[_0xb326('0x1d')](function(_0x53a6fd){var _0x3ac21d=_0x4e7626[_0xb326('0x44')][_0xb326('0x1e')]({'plain':!![]});if(!_0x3ac21d)throw new Error(_0xb326('0x45'));if(_0x3ac21d[_0xb326('0x46')]===_0xb326('0x44')){var _0x141e01=_0x53a6fd['get']({'plain':!![]});var _0x3f0af9=_0xb326('0x47');return db[_0xb326('0x48')][_0xb326('0x49')]({'where':{'name':_0x3f0af9,'userProfileId':_0x3ac21d[_0xb326('0x4a')]},'raw':!![]})[_0xb326('0x1d')](function(_0x5c6f4b){if(_0x5c6f4b&&_0x5c6f4b[_0xb326('0x4b')]===0x0){return db['UserProfileResource'][_0xb326('0x43')]({'name':_0x141e01['name'],'resourceId':_0x141e01['id'],'type':_0xb326('0x1f'),'sectionId':_0x5c6f4b['id']},{})[_0xb326('0x1d')](function(){return _0x53a6fd;});}else{return _0x53a6fd;}})[_0xb326('0x40')](function(_0x5ec8b0){logger[_0xb326('0x23')](_0xb326('0x4c'),_0x5ec8b0);throw _0x5ec8b0;});}return _0x53a6fd;})[_0xb326('0x1d')](respondWithResult(_0x262d44,0xc9))[_0xb326('0x40')](handleError(_0x262d44,null));};exports[_0xb326('0x4d')]=function(_0x3e658c,_0xb685dd){if(_0x3e658c[_0xb326('0x4e')]['id']){delete _0x3e658c[_0xb326('0x4e')]['id'];}return db[_0xb326('0x26')][_0xb326('0x49')]({'where':{'id':_0x3e658c[_0xb326('0x41')]['id']}})[_0xb326('0x1d')](handleEntityNotFound(_0xb685dd,null))[_0xb326('0x1d')](saveUpdates(_0x3e658c[_0xb326('0x4e')],null))['then'](respondWithResult(_0xb685dd,null))[_0xb326('0x40')](handleError(_0xb685dd,null));};exports[_0xb326('0x21')]=function(_0x3f6f17,_0x3c8a1c){return db['AnalyticDefaultReport'][_0xb326('0x49')]({'where':{'id':_0x3f6f17['params']['id']}})['then'](handleEntityNotFound(_0x3c8a1c,null))['then'](removeEntity(_0x3c8a1c,null))[_0xb326('0x40')](handleError(_0x3c8a1c,null));};exports[_0xb326('0x4f')]=function(_0x47e8fe,_0x916b3){var _0x473a7d=0xa;var _0x1426cb=[_0xb326('0x50'),_0xb326('0x51'),_0xb326('0x52'),_0xb326('0x53')];var _0x25a996={'SUM':_0xb326('0x54'),'COUNT':_0xb326('0x55'),'COUNT DISTINCT':_0xb326('0x56'),'MAX':_0xb326('0x57'),'MIN':_0xb326('0x58'),'AVG':_0xb326('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb326('0x5a')};var _0x224b27={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb326('0x5b'),'ROUND':_0xb326('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3d44b8=function(_0x19b943){return!_[_0xb326('0x5d')]([_0xb326('0x5e'),_0xb326('0x5f'),_0xb326('0x60'),_0xb326('0x61')],_0x19b943);};var _0x63415a=function(_0x4b29fb){if(!_0x4b29fb||!_0x4b29fb['rules'][_0xb326('0x42')]){return'';}for(var _0xf1b80a='(',_0x274bf8=0x0;_0x274bf8<_0x4b29fb[_0xb326('0x62')][_0xb326('0x42')];_0x274bf8+=0x1){_0x274bf8>0x0&&(_0xf1b80a+='\x20'+_0x4b29fb[_0xb326('0x63')]+'\x20');_0xf1b80a+=_0x4b29fb[_0xb326('0x62')][_0x274bf8]['group']?_0x63415a(_0x4b29fb[_0xb326('0x62')][_0x274bf8][_0xb326('0x64')]):_0x4b29fb[_0xb326('0x62')][_0x274bf8]['field']+'\x20'+_0x4b29fb[_0xb326('0x62')][_0x274bf8][_0xb326('0x65')]+(_0x3d44b8(_0x4b29fb['rules'][_0x274bf8][_0xb326('0x65')])?'\x20'+_0x4b29fb[_0xb326('0x62')][_0x274bf8][_0xb326('0x66')]:'');}return _0xf1b80a+')';};var _0x5ab342={'where':{'id':_0x47e8fe[_0xb326('0x41')]['id']}},_0x36666f,_0x1e2148,_0x53d55c,_0x312c3d,_0x2f6083;_0x5ab342=_[_0xb326('0x36')]({},_0x5ab342,_0x47e8fe[_0xb326('0x3a')]);return db[_0xb326('0x26')][_0xb326('0x49')](_0x5ab342)[_0xb326('0x1d')](function(_0x2e4953){if(_0x2e4953){_0x36666f=_0x2e4953;return _0x2e4953[_0xb326('0x67')]();}return null;})[_0xb326('0x1d')](function(_0x48c7ee){if(_0x48c7ee){if(!_0x48c7ee['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xb326('0x68'),0x193);}_0x1e2148=_0x48c7ee;return db[_0xb326('0x69')][_0xb326('0x3e')]({'raw':!![]});}return null;})[_0xb326('0x1d')](function(_0x5a8b8b){if(_0x5a8b8b){_0x53d55c=_[_0xb326('0x6a')](_0x5a8b8b,'id');var _0x301fd4;var _0x54cd21=squel['select']();_0x54cd21[_0xb326('0x6b')](_0x36666f[_0xb326('0x6c')]);for(var _0x315dab=0x0;_0x315dab<_0x1e2148[_0xb326('0x42')];_0x315dab+=0x1){_0x301fd4=_0x1e2148[_0x315dab][_0xb326('0x6d')]?_0x53d55c[_0x1e2148[_0x315dab][_0xb326('0x6d')]]['metric']:_0x1e2148[_0x315dab]['field'];_0x301fd4=_0x1e2148[_0x315dab][_0xb326('0x6e')]?_[_0xb326('0x6f')](_0x25a996[_0x1e2148[_0x315dab]['function']],'%s',_0x301fd4):_0x301fd4;_0x301fd4=_0x1e2148[_0x315dab][_0xb326('0x70')]?_['replace'](_0x224b27[_0x1e2148[_0x315dab][_0xb326('0x70')]],'%s',_0x301fd4):_0x301fd4;if(_0x1e2148[_0x315dab][_0xb326('0x71')]){_0x54cd21[_0xb326('0x64')](_0x301fd4);}_0x1e2148[_0x315dab][_0xb326('0x72')]&&_0x54cd21['order'](_0x301fd4,_0x1e2148[_0x315dab][_0xb326('0x72')]===_0xb326('0x73')?![]:!![]);_0x54cd21[_0xb326('0x39')](_0x301fd4,_0x1e2148[_0x315dab][_0xb326('0x74')]||_0x301fd4);}if(_0x36666f[_0xb326('0x75')]){_0x36666f[_0xb326('0x75')]=JSON[_0xb326('0x76')](_0x36666f[_0xb326('0x75')]);for(var _0x562eea=0x0;_0x562eea<_0x36666f['joins'][_0xb326('0x42')];_0x562eea+=0x1){if(_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x77')]&&_['includes'](_0x1426cb,_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x77')])&&_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x78')]&&_0x36666f['joins'][_0x562eea]['foreignTable']&&_0x36666f['joins'][_0x562eea][_0xb326('0x79')]){_0x54cd21[_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x77')]](_0x36666f['joins'][_0x562eea][_0xb326('0x7a')],null,util[_0xb326('0x70')](_0xb326('0x7b'),_0x36666f['table'],_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x78')],_0x36666f[_0xb326('0x75')][_0x562eea]['foreignTable'],_0x36666f[_0xb326('0x75')][_0x562eea][_0xb326('0x79')]));}}}if(_0x36666f['conditions']){_0x36666f[_0xb326('0x7c')]=JSON[_0xb326('0x76')](_0x36666f[_0xb326('0x7c')]);_0x54cd21['where'](_0x63415a(_0x36666f[_0xb326('0x7c')][_0xb326('0x64')]));}_0x2f6083=_0x54cd21['clone']();_0x54cd21[_0xb326('0x18')](_0x473a7d);_0x54cd21[_0xb326('0x17')](0x0);logger[_0xb326('0x7d')](_0xb326('0x7e'),_0x54cd21['toString']());return db['sequelize'][_0xb326('0x29')](_0x54cd21[_0xb326('0x7f')](),{'type':db[_0xb326('0x80')][_0xb326('0x81')][_0xb326('0x82')]});}})[_0xb326('0x1d')](respondWithResult(_0x916b3,null))[_0xb326('0x40')](handleError(_0x916b3,null));};function runReport(_0x45cd41,_0xa9076a,_0x2da451){var _0x298a15=_0xa9076a['name'];var _0x3a361a=0xa;var _0x5d745d=[_0xb326('0x50'),_0xb326('0x51'),_0xb326('0x52'),_0xb326('0x53')];var _0x506f24={'SUM':_0xb326('0x54'),'COUNT':_0xb326('0x55'),'COUNT DISTINCT':_0xb326('0x56'),'MAX':_0xb326('0x57'),'MIN':_0xb326('0x58'),'AVG':_0xb326('0x59'),'GROUP_CONCAT':_0xb326('0x83'),'GROUP_CONCAT ASC':_0xb326('0x84'),'GROUP_CONCAT DESC':_0xb326('0x5a')};var _0x442fca={'SEC_TO_TIME':_0xb326('0x85'),'DATE':_0xb326('0x86'),'HOUR':_0xb326('0x5b'),'ROUND':_0xb326('0x5c'),'UNIX_TIMESTAMP':_0xb326('0x87')};var _0x55ea1d=function(_0x54219e){return!_['includes']([_0xb326('0x5e'),_0xb326('0x5f'),'IS\x20EMPTY',_0xb326('0x61')],_0x54219e);};var _0x235530=function(_0x54eb56){if(!_0x54eb56||!_0x54eb56['rules'][_0xb326('0x42')]){return'';}for(var _0x590a02='(',_0x53854c=0x0;_0x53854c<_0x54eb56[_0xb326('0x62')][_0xb326('0x42')];_0x53854c+=0x1){_0x53854c>0x0&&(_0x590a02+='\x20'+_0x54eb56[_0xb326('0x63')]+'\x20');_0x590a02+=_0x54eb56[_0xb326('0x62')][_0x53854c]['group']?_0x235530(_0x54eb56[_0xb326('0x62')][_0x53854c][_0xb326('0x64')]):_0x54eb56[_0xb326('0x62')][_0x53854c][_0xb326('0x39')]+'\x20'+_0x54eb56[_0xb326('0x62')][_0x53854c][_0xb326('0x65')]+(_0x55ea1d(_0x54eb56[_0xb326('0x62')][_0x53854c][_0xb326('0x65')])?'\x20'+_0x54eb56[_0xb326('0x62')][_0x53854c][_0xb326('0x66')]:'');}return _0x590a02+')';};var _0x430e9a={'where':{'id':_0x45cd41['id']}},_0x5b3f24,_0x4cac36,_0x57d542,_0xd0f62a,_0x484f9f;_0x430e9a=_['merge']({},_0x430e9a,_0x2da451);return db[_0xb326('0x26')][_0xb326('0x49')](_0x430e9a)[_0xb326('0x1d')](function(_0x4b4561){if(_0x4b4561){_0x5b3f24=_0x4b4561;return _0x4b4561[_0xb326('0x67')]();}return null;})[_0xb326('0x1d')](function(_0x66ae7b){if(_0x66ae7b){if(!_0x66ae7b[_0xb326('0x42')]){throw new db[(_0xb326('0x88'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cac36=_0x66ae7b;return db[_0xb326('0x69')][_0xb326('0x3e')]({'raw':!![]});}return null;})[_0xb326('0x1d')](function(_0x181b26){if(_0x181b26){_0x57d542=_[_0xb326('0x6a')](_0x181b26,'id');var _0x3335ee;var _0x51e817=squel[_0xb326('0x89')]();_0x51e817[_0xb326('0x6b')](_0x5b3f24[_0xb326('0x6c')]);for(var _0x545149=0x0;_0x545149<_0x4cac36[_0xb326('0x42')];_0x545149+=0x1){_0x3335ee=_0x4cac36[_0x545149][_0xb326('0x6d')]?_0x57d542[_0x4cac36[_0x545149][_0xb326('0x6d')]][_0xb326('0x8a')]:_0x4cac36[_0x545149][_0xb326('0x39')];_0x3335ee=_0x4cac36[_0x545149][_0xb326('0x6e')]?_['replace'](_0x506f24[_0x4cac36[_0x545149][_0xb326('0x6e')]],'%s',_0x3335ee):_0x3335ee;_0x3335ee=_0x4cac36[_0x545149][_0xb326('0x70')]?_[_0xb326('0x6f')](_0x442fca[_0x4cac36[_0x545149][_0xb326('0x70')]],'%s',_0x3335ee):_0x3335ee;if(_0x4cac36[_0x545149]['groupBy']){_0x51e817[_0xb326('0x64')](_0x3335ee);}_0x4cac36[_0x545149][_0xb326('0x72')]&&_0x51e817[_0xb326('0x31')](_0x3335ee,_0x4cac36[_0x545149][_0xb326('0x72')]===_0xb326('0x73')?![]:!![]);_0x51e817[_0xb326('0x39')](_0x3335ee,_0x4cac36[_0x545149]['alias']||_0x3335ee);}if(_0x5b3f24[_0xb326('0x75')]){_0x5b3f24[_0xb326('0x75')]=JSON['parse'](_0x5b3f24['joins']);for(var _0x1bc5fa=0x0;_0x1bc5fa<_0x5b3f24[_0xb326('0x75')][_0xb326('0x42')];_0x1bc5fa+=0x1){if(_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x77')]&&_[_0xb326('0x5d')](_0x5d745d,_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x77')])&&_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x78')]&&_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x7a')]&&_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x79')]){_0x51e817[_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x77')]](_0x5b3f24[_0xb326('0x75')][_0x1bc5fa]['foreignTable'],null,util[_0xb326('0x70')](_0xb326('0x7b'),_0x5b3f24[_0xb326('0x6c')],_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x78')],_0x5b3f24[_0xb326('0x75')][_0x1bc5fa][_0xb326('0x7a')],_0x5b3f24[_0xb326('0x75')][_0x1bc5fa]['foreignKey']));}}}if(_0x5b3f24[_0xb326('0x7c')]){_0x5b3f24[_0xb326('0x7c')]=JSON['parse'](_0x5b3f24['conditions']);_0x51e817[_0xb326('0x35')](_0x235530(_0x5b3f24[_0xb326('0x7c')][_0xb326('0x64')]));}_0x484f9f=_0x51e817[_0xb326('0x8b')]();_0x51e817[_0xb326('0x18')](_0x3a361a);_0x51e817[_0xb326('0x17')](0x0);logger['debug']('Limited\x20Query:',_0x51e817[_0xb326('0x7f')]());return db[_0xb326('0x80')][_0xb326('0x29')](_0x51e817['toString'](),{'type':db[_0xb326('0x80')][_0xb326('0x81')][_0xb326('0x82')]});}})[_0xb326('0x1d')](function(_0x5c3581){if(!_0x5c3581[_0xb326('0x42')]){throw new db[(_0xb326('0x88'))]['ValidationErrorItem'](_0xb326('0x8c'),0xcc);}if(_0xa9076a[_0xb326('0x8d')]===_0xb326('0x8e')){return null;}var _0x46906c=_[_0xb326('0x36')](_0xa9076a,{'name':_0xa9076a[_0xb326('0x8f')]||_0xa9076a['name']||_0x5b3f24[_0xb326('0x90')],'basename':_0x298a15,'savename':util[_0xb326('0x70')]('%s-%s.%s',_0xa9076a[_0xb326('0x90')]||_0x5b3f24[_0xb326('0x90')],require(_0xb326('0x91'))['generate'](0x4),_0xa9076a[_0xb326('0x8d')]||_0xb326('0x92')),'reportId':_0x5b3f24['id'],'reportType':'default'});return db[_0xb326('0x93')]['create'](_0x46906c,{'raw':!![]});})[_0xb326('0x1d')](function(_0x444512){if(_0x5b3f24[_0xb326('0x6c')]==='cdr'){_0x484f9f[_0xb326('0x35')](_0x5b3f24['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xa9076a[_0xb326('0x94')],_0xa9076a[_0xb326('0x95')]);}else{_0x484f9f[_0xb326('0x35')](_0x5b3f24[_0xb326('0x6c')]+_0xb326('0x96'),_0xa9076a['startDate'],_0xa9076a[_0xb326('0x95')]);}if(_0x444512){logger[_0xb326('0x97')]('Run\x20Query:',_0x484f9f[_0xb326('0x7f')]());require(_0xb326('0x98'))['fork'](path[_0xb326('0x50')](__dirname,_0xb326('0x99'),_0x444512[_0xb326('0x8d')]),[_0x444512['id'],_0x484f9f['toString'](),path['join'](__dirname,_0xb326('0x9a'),_0x444512[_0xb326('0x9b')]),_0x298a15]);return _0x444512;}else{var _0x360910=squel[_0xb326('0x89')]();_0x360910[_0xb326('0x6b')]('('+_0x484f9f[_0xb326('0x7f')]()+')','countTable');_0x360910[_0xb326('0x39')]('COUNT(*)',_0xb326('0x3b'));_0x484f9f['limit'](_0xa9076a['limit']||_0x3a361a);_0x484f9f[_0xb326('0x17')](_0xa9076a[_0xb326('0x17')]||0x0);return db[_0xb326('0x80')]['query'](_0x360910['toString'](),{'type':db['sequelize']['QueryTypes'][_0xb326('0x82')]})[_0xb326('0x1d')](function(_0xdc88d5){if(!_0xdc88d5[_0xb326('0x42')]){_0xd0f62a=0x0;}else{_0xd0f62a=_0xdc88d5[0x0][_0xb326('0x3b')]||0x0;}return db[_0xb326('0x80')][_0xb326('0x29')](_0x484f9f[_0xb326('0x7f')](),{'type':db[_0xb326('0x80')]['QueryTypes']['SELECT']});})[_0xb326('0x1d')](function(_0x58da19){return{'rows':_0x58da19||[],'count':_0xd0f62a};});}});}exports[_0xb326('0x9c')]=function(_0x26bd51,_0x40eb12){return runReport(_0x26bd51[_0xb326('0x41')],_0x26bd51[_0xb326('0x29')],_0x26bd51['options'])['then'](respondWithResult(_0x40eb12,null))[_0xb326('0x40')](handleError(_0x40eb12,null));};exports[_0xb326('0x9d')]=runReport;exports[_0xb326('0x29')]=function(_0x55be52,_0x3686e2){var _0x5d33b2=0xa;var _0x245859=[_0xb326('0x50'),_0xb326('0x51'),'right_join',_0xb326('0x53')];var _0x2f49aa={'SUM':_0xb326('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb326('0x56'),'MAX':'MAX(%s)','MIN':_0xb326('0x58'),'AVG':_0xb326('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb326('0x84'),'GROUP_CONCAT DESC':_0xb326('0x5a')};var _0x279621={'SEC_TO_TIME':_0xb326('0x85'),'DATE':_0xb326('0x86'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb326('0x87')};var _0x36bcb9=function(_0x2fa14b){return!_['includes']([_0xb326('0x5e'),'IS\x20NOT\x20NULL',_0xb326('0x60'),_0xb326('0x61')],_0x2fa14b);};var _0xf7fe46=function(_0x49e2fc){if(!_0x49e2fc||!_0x49e2fc[_0xb326('0x62')][_0xb326('0x42')]){return'';}for(var _0x2460a3='(',_0x31ae41=0x0;_0x31ae41<_0x49e2fc[_0xb326('0x62')][_0xb326('0x42')];_0x31ae41+=0x1){_0x31ae41>0x0&&(_0x2460a3+='\x20'+_0x49e2fc[_0xb326('0x63')]+'\x20');_0x2460a3+=_0x49e2fc[_0xb326('0x62')][_0x31ae41][_0xb326('0x64')]?_0xf7fe46(_0x49e2fc[_0xb326('0x62')][_0x31ae41][_0xb326('0x64')]):_0x49e2fc[_0xb326('0x62')][_0x31ae41][_0xb326('0x39')]+'\x20'+_0x49e2fc[_0xb326('0x62')][_0x31ae41][_0xb326('0x65')]+(_0x36bcb9(_0x49e2fc[_0xb326('0x62')][_0x31ae41][_0xb326('0x65')])?'\x20'+_0x49e2fc['rules'][_0x31ae41]['value']:'');}return _0x2460a3+')';};var _0x251b41={'where':{'id':_0x55be52[_0xb326('0x41')]['id']}},_0x296131,_0x2200b8,_0x55e648,_0x2a31ab,_0x2c4b9b;_0x251b41=_[_0xb326('0x36')]({},_0x251b41,_0x55be52[_0xb326('0x3a')]);return db['AnalyticDefaultReport'][_0xb326('0x49')](_0x251b41)['then'](function(_0x24d114){if(_0x24d114){_0x296131=_0x24d114;return _0x24d114[_0xb326('0x67')]();}return null;})[_0xb326('0x1d')](function(_0x2c13ee){if(_0x2c13ee){if(!_0x2c13ee[_0xb326('0x42')]){throw new db[(_0xb326('0x88'))][(_0xb326('0x9e'))](_0xb326('0x68'),0x193);}_0x2200b8=_0x2c13ee;return db['AnalyticMetric'][_0xb326('0x3e')]({'raw':!![]});}return null;})[_0xb326('0x1d')](function(_0xc58bd9){if(_0xc58bd9){_0x55e648=_['keyBy'](_0xc58bd9,'id');var _0x3b2101;var _0xc03bf=squel[_0xb326('0x89')]();_0xc03bf[_0xb326('0x6b')](_0x296131[_0xb326('0x6c')]);for(var _0x2358d3=0x0;_0x2358d3<_0x2200b8[_0xb326('0x42')];_0x2358d3+=0x1){_0x3b2101=_0x2200b8[_0x2358d3][_0xb326('0x6d')]?_0x55e648[_0x2200b8[_0x2358d3]['MetricId']]['metric']:_0x2200b8[_0x2358d3][_0xb326('0x39')];_0x3b2101=_0x2200b8[_0x2358d3][_0xb326('0x6e')]?_[_0xb326('0x6f')](_0x2f49aa[_0x2200b8[_0x2358d3][_0xb326('0x6e')]],'%s',_0x3b2101):_0x3b2101;_0x3b2101=_0x2200b8[_0x2358d3]['format']?_[_0xb326('0x6f')](_0x279621[_0x2200b8[_0x2358d3][_0xb326('0x70')]],'%s',_0x3b2101):_0x3b2101;if(_0x2200b8[_0x2358d3][_0xb326('0x71')]){_0xc03bf[_0xb326('0x64')](_0x3b2101);}_0x2200b8[_0x2358d3][_0xb326('0x72')]&&_0xc03bf[_0xb326('0x31')](_0x3b2101,_0x2200b8[_0x2358d3][_0xb326('0x72')]==='DESC'?![]:!![]);_0xc03bf[_0xb326('0x39')](_0x3b2101,_0x2200b8[_0x2358d3][_0xb326('0x74')]||_0x3b2101);}if(_0x296131[_0xb326('0x75')]){_0x296131['joins']=JSON[_0xb326('0x76')](_0x296131['joins']);for(var _0x4d43ea=0x0;_0x4d43ea<_0x296131[_0xb326('0x75')][_0xb326('0x42')];_0x4d43ea+=0x1){if(_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x77')]&&_[_0xb326('0x5d')](_0x245859,_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x77')])&&_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x78')]&&_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x7a')]&&_0x296131[_0xb326('0x75')][_0x4d43ea]['foreignKey']){_0xc03bf[_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x77')]](_0x296131[_0xb326('0x75')][_0x4d43ea]['foreignTable'],null,util[_0xb326('0x70')](_0xb326('0x7b'),_0x296131['table'],_0x296131[_0xb326('0x75')][_0x4d43ea]['parentKey'],_0x296131[_0xb326('0x75')][_0x4d43ea][_0xb326('0x7a')],_0x296131[_0xb326('0x75')][_0x4d43ea]['foreignKey']));}}}if(_0x296131[_0xb326('0x7c')]){_0x296131[_0xb326('0x7c')]=JSON['parse'](_0x296131[_0xb326('0x7c')]);_0xc03bf[_0xb326('0x35')](_0xf7fe46(_0x296131[_0xb326('0x7c')][_0xb326('0x64')]));}_0x2c4b9b=_0xc03bf[_0xb326('0x8b')]();_0xc03bf[_0xb326('0x18')](_0x5d33b2);_0xc03bf['offset'](0x0);logger[_0xb326('0x7d')](_0xb326('0x7e'),_0xc03bf['toString']());return db['sequelize'][_0xb326('0x29')](_0xc03bf[_0xb326('0x7f')](),{'type':db['sequelize'][_0xb326('0x81')][_0xb326('0x82')]});}})[_0xb326('0x1d')](function(){return{'sql':_0x2c4b9b[_0xb326('0x7f')]()};})[_0xb326('0x1d')](respondWithResult(_0x3686e2,null))[_0xb326('0x40')](handleError(_0x3686e2,null));}; \ No newline at end of file +var _0x3e45=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','name','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','orderBy','DESC','alias','joins','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','operator','value','metric','order','parse','No\x20available\x20data','output','fullPath','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','cross_join','groupBy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','get','DefaultReports','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','field','options','includeAll','include','findAll','show','params'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x3e45,0x194));var _0x53e4=function(_0x17c5f5,_0x22857e){_0x17c5f5=_0x17c5f5-0x0;var _0x3859b1=_0x3e45[_0x17c5f5];return _0x3859b1;};'use strict';var pdf=require(_0x53e4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53e4('0x1'));var zipdir=require(_0x53e4('0x2'));var jsonpatch=require(_0x53e4('0x3'));var rp=require(_0x53e4('0x4'));var moment=require(_0x53e4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x53e4('0x6'));var util=require(_0x53e4('0x7'));var path=require(_0x53e4('0x8'));var sox=require(_0x53e4('0x9'));var csv=require(_0x53e4('0xa'));var ejs=require(_0x53e4('0xb'));var fs=require('fs');var _=require(_0x53e4('0xc'));var squel=require(_0x53e4('0xd'));var crypto=require(_0x53e4('0xe'));var jsforce=require(_0x53e4('0xf'));var deskjs=require(_0x53e4('0x10'));var toCsv=require(_0x53e4('0xa'));var querystring=require(_0x53e4('0x11'));var Papa=require('papaparse');var Redis=require(_0x53e4('0x12'));var authService=require(_0x53e4('0x13'));var qs=require(_0x53e4('0x14'));var hardwareService=require(_0x53e4('0x15'));var logger=require(_0x53e4('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x53e4('0x17'));var db=require(_0x53e4('0x18'))['db'];function respondWithStatusCode(_0x5ca685,_0x3b5505){_0x3b5505=_0x3b5505||0xcc;return function(_0x1b92e0){if(_0x1b92e0){return _0x5ca685['sendStatus'](_0x3b5505);}return _0x5ca685[_0x53e4('0x19')](_0x3b5505)[_0x53e4('0x1a')]();};}function respondWithResult(_0x8d3efa,_0x1694b0){_0x1694b0=_0x1694b0||0xc8;return function(_0x3ff44b){if(_0x3ff44b){return _0x8d3efa[_0x53e4('0x19')](_0x1694b0)[_0x53e4('0x1b')](_0x3ff44b);}};}function respondWithFilteredResult(_0x4f853d,_0x1620c8){return function(_0xc4ee24){if(_0xc4ee24){var _0x451653=_0xc4ee24[_0x53e4('0x1c')],_0x5373ba=_0x1620c8[_0x53e4('0x1d')],_0x38cc5a=_0x1620c8[_0x53e4('0x1d')]+_0x1620c8['limit'],_0x288666;if(_0x38cc5a>=_0x451653){_0x38cc5a=_0x451653;_0x288666=0xc8;}else{_0x288666=0xce;}_0x4f853d[_0x53e4('0x19')](_0x288666);return _0x4f853d[_0x53e4('0x1e')](_0x53e4('0x1f'),_0x5373ba+'-'+_0x38cc5a+'/'+_0x451653)[_0x53e4('0x1b')](_0xc4ee24);}return null;};}function patchUpdates(_0x4147a8){return function(_0x5d7152){try{jsonpatch[_0x53e4('0x20')](_0x5d7152,_0x4147a8,!![]);}catch(_0x13ed28){return BPromise['reject'](_0x13ed28);}return _0x5d7152[_0x53e4('0x21')]();};}function saveUpdates(_0x3c1c72,_0x3cad06){return function(_0x4544a8){if(_0x4544a8){return _0x4544a8[_0x53e4('0x22')](_0x3c1c72)[_0x53e4('0x23')](function(_0x455421){return _0x455421;});}return null;};}function removeEntity(_0x1efb7d,_0x4d6a98){return function(_0x38f958){if(_0x38f958){return _0x38f958[_0x53e4('0x24')]()[_0x53e4('0x23')](function(){var _0x38ff28=_0x38f958[_0x53e4('0x25')]({'plain':!![]});var _0x5303e2=_0x53e4('0x26');return db['UserProfileResource'][_0x53e4('0x24')]({'where':{'type':_0x5303e2,'resourceId':_0x38ff28['id']}})['then'](function(){return _0x38f958;});})[_0x53e4('0x23')](function(){_0x1efb7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c1be,_0x9fb284){return function(_0x4a8e26){if(!_0x4a8e26){_0x33c1be['sendStatus'](0x194);}return _0x4a8e26;};}function handleError(_0x364c2b,_0x400c70){_0x400c70=_0x400c70||0x1f4;return function(_0x3f08d8){logger['error'](_0x3f08d8['stack']);if(_0x3f08d8['name']){delete _0x3f08d8['name'];}_0x364c2b['status'](_0x400c70)['send'](_0x3f08d8);};}exports[_0x53e4('0x27')]=function(_0x4e2051,_0x40f1c6){var _0x27b8d4={},_0x3aab0b={},_0x116c08={'count':0x0,'rows':[]};var _0x3b7d1d=db[_0x53e4('0x28')][_0x53e4('0x29')];_0x3aab0b[_0x53e4('0x2a')]=_[_0x53e4('0x2b')](_0x3b7d1d);_0x3aab0b[_0x53e4('0x2c')]=_[_0x53e4('0x2b')](_0x4e2051[_0x53e4('0x2c')]);_0x3aab0b[_0x53e4('0x2d')]=_[_0x53e4('0x2e')](_0x3aab0b['model'],_0x3aab0b[_0x53e4('0x2c')]);_0x27b8d4[_0x53e4('0x2f')]=_[_0x53e4('0x2e')](_0x3aab0b[_0x53e4('0x2a')],qs[_0x53e4('0x30')](_0x4e2051['query']['fields']));_0x27b8d4[_0x53e4('0x2f')]=_0x27b8d4['attributes'][_0x53e4('0x31')]?_0x27b8d4[_0x53e4('0x2f')]:_0x3aab0b['model'];if(!_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x32')](_0x53e4('0x33'))){_0x27b8d4[_0x53e4('0x34')]=qs['limit'](_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x34')]);_0x27b8d4[_0x53e4('0x1d')]=qs[_0x53e4('0x1d')](_0x4e2051['query'][_0x53e4('0x1d')]);}_0x27b8d4['order']=qs[_0x53e4('0x35')](_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x35')]);_0x27b8d4[_0x53e4('0x36')]=qs[_0x53e4('0x2d')](_[_0x53e4('0x37')](_0x4e2051[_0x53e4('0x2c')],_0x3aab0b[_0x53e4('0x2d')]));if(_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x38')]){_0x27b8d4[_0x53e4('0x36')]=_[_0x53e4('0x39')](_0x27b8d4['where'],{'$or':_[_0x53e4('0x3a')](_0x3b7d1d,function(_0x98b81c){if(_0x98b81c['type'][_0x53e4('0x3b')]!=='VIRTUAL'){var _0x20dbb7={};_0x20dbb7[_0x98b81c[_0x53e4('0x3c')]]={'$like':'%'+_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x38')]+'%'};return _0x20dbb7;}})});}_0x27b8d4=_['merge']({},_0x27b8d4,_0x4e2051[_0x53e4('0x3d')]);var _0x1651b1={'where':_0x27b8d4[_0x53e4('0x36')]};return db[_0x53e4('0x28')][_0x53e4('0x1c')](_0x1651b1)[_0x53e4('0x23')](function(_0x1ce6c6){_0x116c08[_0x53e4('0x1c')]=_0x1ce6c6;if(_0x4e2051[_0x53e4('0x2c')][_0x53e4('0x3e')]){_0x27b8d4[_0x53e4('0x3f')]=[{'all':!![]}];}return db[_0x53e4('0x28')][_0x53e4('0x40')](_0x27b8d4);})[_0x53e4('0x23')](function(_0x5ec8e3){_0x116c08['rows']=_0x5ec8e3;return _0x116c08;})[_0x53e4('0x23')](respondWithFilteredResult(_0x40f1c6,_0x27b8d4))['catch'](handleError(_0x40f1c6,null));};exports[_0x53e4('0x41')]=function(_0x175d60,_0x2efae0){var _0x23a881={'raw':!![],'where':{'id':_0x175d60[_0x53e4('0x42')]['id']}},_0xefa907={};_0xefa907[_0x53e4('0x2a')]=_['keys'](db[_0x53e4('0x28')][_0x53e4('0x29')]);_0xefa907[_0x53e4('0x2c')]=_[_0x53e4('0x2b')](_0x175d60[_0x53e4('0x2c')]);_0xefa907[_0x53e4('0x2d')]=_[_0x53e4('0x2e')](_0xefa907[_0x53e4('0x2a')],_0xefa907[_0x53e4('0x2c')]);_0x23a881[_0x53e4('0x2f')]=_['intersection'](_0xefa907[_0x53e4('0x2a')],qs[_0x53e4('0x30')](_0x175d60[_0x53e4('0x2c')]['fields']));_0x23a881[_0x53e4('0x2f')]=_0x23a881[_0x53e4('0x2f')][_0x53e4('0x31')]?_0x23a881[_0x53e4('0x2f')]:_0xefa907['model'];if(_0x175d60[_0x53e4('0x2c')][_0x53e4('0x3e')]){_0x23a881[_0x53e4('0x3f')]=[{'all':!![]}];}_0x23a881=_[_0x53e4('0x39')]({},_0x23a881,_0x175d60[_0x53e4('0x3d')]);return db[_0x53e4('0x28')]['find'](_0x23a881)[_0x53e4('0x23')](handleEntityNotFound(_0x2efae0,null))['then'](respondWithResult(_0x2efae0,null))[_0x53e4('0x43')](handleError(_0x2efae0,null));};exports[_0x53e4('0x44')]=function(_0x5e5c04,_0x33a00c){return db[_0x53e4('0x28')][_0x53e4('0x44')](_0x5e5c04[_0x53e4('0x45')],{})[_0x53e4('0x23')](function(_0x323365){var _0x51f82a=_0x5e5c04[_0x53e4('0x46')][_0x53e4('0x25')]({'plain':!![]});if(!_0x51f82a)throw new Error(_0x53e4('0x47'));if(_0x51f82a['role']===_0x53e4('0x46')){var _0x2ecb8d=_0x323365['get']({'plain':!![]});var _0x542eb7='Reports';return db[_0x53e4('0x48')][_0x53e4('0x49')]({'where':{'name':_0x542eb7,'userProfileId':_0x51f82a['userProfileId']},'raw':!![]})['then'](function(_0x1336d7){if(_0x1336d7&&_0x1336d7[_0x53e4('0x4a')]===0x0){return db[_0x53e4('0x4b')][_0x53e4('0x44')]({'name':_0x2ecb8d[_0x53e4('0x4c')],'resourceId':_0x2ecb8d['id'],'type':_0x53e4('0x26'),'sectionId':_0x1336d7['id']},{})[_0x53e4('0x23')](function(){return _0x323365;});}else{return _0x323365;}})[_0x53e4('0x43')](function(_0x3853ac){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3853ac);throw _0x3853ac;});}return _0x323365;})[_0x53e4('0x23')](respondWithResult(_0x33a00c,0xc9))[_0x53e4('0x43')](handleError(_0x33a00c,null));};exports['update']=function(_0x3b8699,_0x377ae5){if(_0x3b8699[_0x53e4('0x45')]['id']){delete _0x3b8699[_0x53e4('0x45')]['id'];}return db[_0x53e4('0x28')][_0x53e4('0x49')]({'where':{'id':_0x3b8699[_0x53e4('0x42')]['id']}})['then'](handleEntityNotFound(_0x377ae5,null))[_0x53e4('0x23')](saveUpdates(_0x3b8699['body'],null))[_0x53e4('0x23')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x53e4('0x24')]=function(_0x442a53,_0x3a73d5){return db[_0x53e4('0x28')][_0x53e4('0x49')]({'where':{'id':_0x442a53[_0x53e4('0x42')]['id']}})[_0x53e4('0x23')](handleEntityNotFound(_0x3a73d5,null))[_0x53e4('0x23')](removeEntity(_0x3a73d5,null))[_0x53e4('0x43')](handleError(_0x3a73d5,null));};exports['preview']=function(_0x2a609e,_0x4f8ca8){var _0x556563=0xa;var _0x3cd7a1=[_0x53e4('0x4d'),_0x53e4('0x4e'),_0x53e4('0x4f'),'cross_join'];var _0x403a86={'SUM':_0x53e4('0x50'),'COUNT':_0x53e4('0x51'),'COUNT DISTINCT':_0x53e4('0x52'),'MAX':_0x53e4('0x53'),'MIN':_0x53e4('0x54'),'AVG':_0x53e4('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x53e4('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x474448={'SEC_TO_TIME':_0x53e4('0x57'),'DATE':_0x53e4('0x58'),'HOUR':_0x53e4('0x59'),'ROUND':_0x53e4('0x5a'),'UNIX_TIMESTAMP':_0x53e4('0x5b')};var _0x5f5ab1=function(_0x251986){return!_[_0x53e4('0x5c')](['IS\x20NULL',_0x53e4('0x5d'),_0x53e4('0x5e'),_0x53e4('0x5f')],_0x251986);};var _0x45198e=function(_0x297bb2){if(!_0x297bb2||!_0x297bb2[_0x53e4('0x60')][_0x53e4('0x31')]){return'';}for(var _0x4397f6='(',_0x4d06fd=0x0;_0x4d06fd<_0x297bb2[_0x53e4('0x60')][_0x53e4('0x31')];_0x4d06fd+=0x1){_0x4d06fd>0x0&&(_0x4397f6+='\x20'+_0x297bb2['operator']+'\x20');_0x4397f6+=_0x297bb2[_0x53e4('0x60')][_0x4d06fd]['group']?_0x45198e(_0x297bb2['rules'][_0x4d06fd][_0x53e4('0x61')]):_0x297bb2[_0x53e4('0x60')][_0x4d06fd][_0x53e4('0x3c')]+'\x20'+_0x297bb2[_0x53e4('0x60')][_0x4d06fd][_0x53e4('0x62')]+(_0x5f5ab1(_0x297bb2[_0x53e4('0x60')][_0x4d06fd]['condition'])?'\x20'+_0x297bb2['rules'][_0x4d06fd]['value']:'');}return _0x4397f6+')';};var _0x42d4f1={'where':{'id':_0x2a609e[_0x53e4('0x42')]['id']}},_0x477420,_0x5302db,_0x353ca7,_0x4a719c,_0x524802;_0x42d4f1=_[_0x53e4('0x39')]({},_0x42d4f1,_0x2a609e['options']);return db[_0x53e4('0x28')][_0x53e4('0x49')](_0x42d4f1)[_0x53e4('0x23')](function(_0x48fc2a){if(_0x48fc2a){_0x477420=_0x48fc2a;return _0x48fc2a[_0x53e4('0x63')]();}return null;})[_0x53e4('0x23')](function(_0x4e9468){if(_0x4e9468){if(!_0x4e9468[_0x53e4('0x31')]){throw new db[(_0x53e4('0x64'))][(_0x53e4('0x65'))](_0x53e4('0x66'),0x193);}_0x5302db=_0x4e9468;return db[_0x53e4('0x67')]['findAll']({'raw':!![]});}return null;})[_0x53e4('0x23')](function(_0xc1f04f){if(_0xc1f04f){_0x353ca7=_[_0x53e4('0x68')](_0xc1f04f,'id');var _0x5939cb;var _0x5e52cf=squel[_0x53e4('0x69')]();_0x5e52cf[_0x53e4('0x6a')](_0x477420[_0x53e4('0x6b')]);for(var _0x4880d1=0x0;_0x4880d1<_0x5302db[_0x53e4('0x31')];_0x4880d1+=0x1){_0x5939cb=_0x5302db[_0x4880d1][_0x53e4('0x6c')]?_0x353ca7[_0x5302db[_0x4880d1][_0x53e4('0x6c')]]['metric']:_0x5302db[_0x4880d1][_0x53e4('0x3c')];_0x5939cb=_0x5302db[_0x4880d1][_0x53e4('0x6d')]?_['replace'](_0x403a86[_0x5302db[_0x4880d1][_0x53e4('0x6d')]],'%s',_0x5939cb):_0x5939cb;_0x5939cb=_0x5302db[_0x4880d1][_0x53e4('0x6e')]?_[_0x53e4('0x6f')](_0x474448[_0x5302db[_0x4880d1][_0x53e4('0x6e')]],'%s',_0x5939cb):_0x5939cb;if(_0x5302db[_0x4880d1]['groupBy']){_0x5e52cf[_0x53e4('0x61')](_0x5939cb);}_0x5302db[_0x4880d1][_0x53e4('0x70')]&&_0x5e52cf['order'](_0x5939cb,_0x5302db[_0x4880d1][_0x53e4('0x70')]===_0x53e4('0x71')?![]:!![]);_0x5e52cf['field'](_0x5939cb,_0x5302db[_0x4880d1][_0x53e4('0x72')]||_0x5939cb);}if(_0x477420[_0x53e4('0x73')]){_0x477420[_0x53e4('0x73')]=JSON['parse'](_0x477420[_0x53e4('0x73')]);for(var _0x333955=0x0;_0x333955<_0x477420[_0x53e4('0x73')][_0x53e4('0x31')];_0x333955+=0x1){if(_0x477420[_0x53e4('0x73')][_0x333955][_0x53e4('0x74')]&&_[_0x53e4('0x5c')](_0x3cd7a1,_0x477420['joins'][_0x333955][_0x53e4('0x74')])&&_0x477420['joins'][_0x333955][_0x53e4('0x75')]&&_0x477420['joins'][_0x333955][_0x53e4('0x76')]&&_0x477420['joins'][_0x333955][_0x53e4('0x77')]){_0x5e52cf[_0x477420[_0x53e4('0x73')][_0x333955][_0x53e4('0x74')]](_0x477420[_0x53e4('0x73')][_0x333955][_0x53e4('0x76')],null,util[_0x53e4('0x6e')](_0x53e4('0x78'),_0x477420['table'],_0x477420[_0x53e4('0x73')][_0x333955]['parentKey'],_0x477420['joins'][_0x333955][_0x53e4('0x76')],_0x477420[_0x53e4('0x73')][_0x333955][_0x53e4('0x77')]));}}}if(_0x477420[_0x53e4('0x79')]){_0x477420['conditions']=JSON['parse'](_0x477420[_0x53e4('0x79')]);_0x5e52cf[_0x53e4('0x36')](_0x45198e(_0x477420[_0x53e4('0x79')]['group']));}_0x524802=_0x5e52cf[_0x53e4('0x7a')]();_0x5e52cf[_0x53e4('0x34')](_0x556563);_0x5e52cf[_0x53e4('0x1d')](0x0);logger[_0x53e4('0x7b')](_0x53e4('0x7c'),_0x5e52cf[_0x53e4('0x7d')]());return db[_0x53e4('0x7e')][_0x53e4('0x2c')](_0x5e52cf[_0x53e4('0x7d')](),{'type':db[_0x53e4('0x7e')][_0x53e4('0x7f')][_0x53e4('0x80')]});}})[_0x53e4('0x23')](respondWithResult(_0x4f8ca8,null))[_0x53e4('0x43')](handleError(_0x4f8ca8,null));};function runReport(_0x11c7b5,_0x127843,_0x57655e){var _0x5e650c=_0x127843[_0x53e4('0x4c')];var _0x408922=0xa;var _0x48aeae=[_0x53e4('0x4d'),_0x53e4('0x4e'),_0x53e4('0x4f'),'cross_join'];var _0x5f5aab={'SUM':_0x53e4('0x50'),'COUNT':_0x53e4('0x51'),'COUNT DISTINCT':_0x53e4('0x52'),'MAX':_0x53e4('0x53'),'MIN':_0x53e4('0x54'),'AVG':_0x53e4('0x55'),'GROUP_CONCAT':_0x53e4('0x81'),'GROUP_CONCAT ASC':_0x53e4('0x56'),'GROUP_CONCAT DESC':_0x53e4('0x82')};var _0x48a31b={'SEC_TO_TIME':_0x53e4('0x57'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x53e4('0x5a'),'UNIX_TIMESTAMP':_0x53e4('0x5b')};var _0x4a9d36=function(_0x1a0157){return!_['includes']([_0x53e4('0x83'),_0x53e4('0x5d'),_0x53e4('0x5e'),_0x53e4('0x5f')],_0x1a0157);};var _0x49ec7b=function(_0x3ad3a6){if(!_0x3ad3a6||!_0x3ad3a6[_0x53e4('0x60')]['length']){return'';}for(var _0x1ce6f5='(',_0x3c0680=0x0;_0x3c0680<_0x3ad3a6[_0x53e4('0x60')]['length'];_0x3c0680+=0x1){_0x3c0680>0x0&&(_0x1ce6f5+='\x20'+_0x3ad3a6[_0x53e4('0x84')]+'\x20');_0x1ce6f5+=_0x3ad3a6['rules'][_0x3c0680]['group']?_0x49ec7b(_0x3ad3a6[_0x53e4('0x60')][_0x3c0680][_0x53e4('0x61')]):_0x3ad3a6[_0x53e4('0x60')][_0x3c0680][_0x53e4('0x3c')]+'\x20'+_0x3ad3a6[_0x53e4('0x60')][_0x3c0680][_0x53e4('0x62')]+(_0x4a9d36(_0x3ad3a6[_0x53e4('0x60')][_0x3c0680]['condition'])?'\x20'+_0x3ad3a6['rules'][_0x3c0680][_0x53e4('0x85')]:'');}return _0x1ce6f5+')';};var _0x1bb6de={'where':{'id':_0x11c7b5['id']}},_0x2629ae,_0x50c12a,_0x31c2b4,_0x55afd6,_0x36b671;_0x1bb6de=_[_0x53e4('0x39')]({},_0x1bb6de,_0x57655e);return db[_0x53e4('0x28')][_0x53e4('0x49')](_0x1bb6de)[_0x53e4('0x23')](function(_0x1bbf2a){if(_0x1bbf2a){_0x2629ae=_0x1bbf2a;return _0x1bbf2a[_0x53e4('0x63')]();}return null;})['then'](function(_0x39afc9){if(_0x39afc9){if(!_0x39afc9[_0x53e4('0x31')]){throw new db[(_0x53e4('0x64'))][(_0x53e4('0x65'))](_0x53e4('0x66'),0x193);}_0x50c12a=_0x39afc9;return db['AnalyticMetric'][_0x53e4('0x40')]({'raw':!![]});}return null;})[_0x53e4('0x23')](function(_0x1a5628){if(_0x1a5628){_0x31c2b4=_['keyBy'](_0x1a5628,'id');var _0x3b22b2;var _0x5be751=squel[_0x53e4('0x69')]();_0x5be751[_0x53e4('0x6a')](_0x2629ae[_0x53e4('0x6b')]);for(var _0x40ae9c=0x0;_0x40ae9c<_0x50c12a[_0x53e4('0x31')];_0x40ae9c+=0x1){_0x3b22b2=_0x50c12a[_0x40ae9c][_0x53e4('0x6c')]?_0x31c2b4[_0x50c12a[_0x40ae9c]['MetricId']][_0x53e4('0x86')]:_0x50c12a[_0x40ae9c][_0x53e4('0x3c')];_0x3b22b2=_0x50c12a[_0x40ae9c][_0x53e4('0x6d')]?_[_0x53e4('0x6f')](_0x5f5aab[_0x50c12a[_0x40ae9c]['function']],'%s',_0x3b22b2):_0x3b22b2;_0x3b22b2=_0x50c12a[_0x40ae9c][_0x53e4('0x6e')]?_[_0x53e4('0x6f')](_0x48a31b[_0x50c12a[_0x40ae9c]['format']],'%s',_0x3b22b2):_0x3b22b2;if(_0x50c12a[_0x40ae9c]['groupBy']){_0x5be751[_0x53e4('0x61')](_0x3b22b2);}_0x50c12a[_0x40ae9c][_0x53e4('0x70')]&&_0x5be751[_0x53e4('0x87')](_0x3b22b2,_0x50c12a[_0x40ae9c][_0x53e4('0x70')]===_0x53e4('0x71')?![]:!![]);_0x5be751[_0x53e4('0x3c')](_0x3b22b2,_0x50c12a[_0x40ae9c]['alias']||_0x3b22b2);}if(_0x2629ae['joins']){_0x2629ae['joins']=JSON[_0x53e4('0x88')](_0x2629ae['joins']);for(var _0x7ee44d=0x0;_0x7ee44d<_0x2629ae[_0x53e4('0x73')][_0x53e4('0x31')];_0x7ee44d+=0x1){if(_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x74')]&&_[_0x53e4('0x5c')](_0x48aeae,_0x2629ae['joins'][_0x7ee44d][_0x53e4('0x74')])&&_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x75')]&&_0x2629ae['joins'][_0x7ee44d][_0x53e4('0x76')]&&_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x77')]){_0x5be751[_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x74')]](_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x76')],null,util[_0x53e4('0x6e')](_0x53e4('0x78'),_0x2629ae['table'],_0x2629ae[_0x53e4('0x73')][_0x7ee44d][_0x53e4('0x75')],_0x2629ae[_0x53e4('0x73')][_0x7ee44d]['foreignTable'],_0x2629ae[_0x53e4('0x73')][_0x7ee44d]['foreignKey']));}}}if(_0x2629ae[_0x53e4('0x79')]){_0x2629ae[_0x53e4('0x79')]=JSON[_0x53e4('0x88')](_0x2629ae[_0x53e4('0x79')]);_0x5be751[_0x53e4('0x36')](_0x49ec7b(_0x2629ae[_0x53e4('0x79')][_0x53e4('0x61')]));}_0x36b671=_0x5be751[_0x53e4('0x7a')]();_0x5be751[_0x53e4('0x34')](_0x408922);_0x5be751[_0x53e4('0x1d')](0x0);logger[_0x53e4('0x7b')](_0x53e4('0x7c'),_0x5be751[_0x53e4('0x7d')]());return db['sequelize'][_0x53e4('0x2c')](_0x5be751['toString'](),{'type':db[_0x53e4('0x7e')][_0x53e4('0x7f')][_0x53e4('0x80')]});}})[_0x53e4('0x23')](function(_0x1ba450){if(!_0x1ba450[_0x53e4('0x31')]){throw new db[(_0x53e4('0x64'))][(_0x53e4('0x65'))](_0x53e4('0x89'),0xcc);}if(_0x127843[_0x53e4('0x8a')]==='web'){return null;}var _0x3eb402=_[_0x53e4('0x39')](_0x127843,{'name':_0x127843[_0x53e4('0x8b')]||_0x127843['name']||_0x2629ae[_0x53e4('0x4c')],'basename':_0x5e650c,'savename':util[_0x53e4('0x6e')]('%s-%s.%s',_0x127843[_0x53e4('0x4c')]||_0x2629ae[_0x53e4('0x4c')],require('randomstring')[_0x53e4('0x8c')](0x4),_0x127843['output']||_0x53e4('0x8d')),'reportId':_0x2629ae['id'],'reportType':_0x53e4('0x8e')});return db[_0x53e4('0x8f')]['create'](_0x3eb402,{'raw':!![]});})[_0x53e4('0x23')](function(_0x1ae9ff){if(_0x2629ae[_0x53e4('0x6b')]===_0x53e4('0x90')){_0x36b671['where'](_0x2629ae[_0x53e4('0x6b')]+_0x53e4('0x91'),_0x127843['startDate'],_0x127843['endDate']);}else{_0x36b671[_0x53e4('0x36')](_0x2629ae[_0x53e4('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x127843['startDate'],_0x127843[_0x53e4('0x92')]);}if(_0x1ae9ff){logger['info'](_0x53e4('0x93'),_0x36b671['toString']());require('child_process')[_0x53e4('0x94')](path['join'](__dirname,_0x53e4('0x95'),_0x1ae9ff[_0x53e4('0x8a')]),[_0x1ae9ff['id'],_0x36b671[_0x53e4('0x7d')](),path[_0x53e4('0x4d')](__dirname,_0x53e4('0x96'),_0x1ae9ff[_0x53e4('0x97')]),_0x5e650c]);return _0x1ae9ff;}else{var _0x4da3e2=squel[_0x53e4('0x69')]();_0x4da3e2[_0x53e4('0x6a')]('('+_0x36b671[_0x53e4('0x7d')]()+')',_0x53e4('0x98'));_0x4da3e2[_0x53e4('0x3c')]('COUNT(*)',_0x53e4('0x1c'));_0x36b671[_0x53e4('0x34')](_0x127843[_0x53e4('0x34')]||_0x408922);_0x36b671['offset'](_0x127843[_0x53e4('0x1d')]||0x0);return db['sequelize']['query'](_0x4da3e2['toString'](),{'type':db[_0x53e4('0x7e')][_0x53e4('0x7f')]['SELECT']})[_0x53e4('0x23')](function(_0xfe152b){if(!_0xfe152b[_0x53e4('0x31')]){_0x55afd6=0x0;}else{_0x55afd6=_0xfe152b[0x0][_0x53e4('0x1c')]||0x0;}return db[_0x53e4('0x7e')]['query'](_0x36b671['toString'](),{'type':db['sequelize'][_0x53e4('0x7f')][_0x53e4('0x80')]});})[_0x53e4('0x23')](function(_0x1fae29){return{'rows':_0x1fae29||[],'count':_0x55afd6};});}});}exports[_0x53e4('0x99')]=function(_0x2868a9,_0xcbb700){return runReport(_0x2868a9[_0x53e4('0x42')],_0x2868a9[_0x53e4('0x2c')],_0x2868a9[_0x53e4('0x3d')])[_0x53e4('0x23')](respondWithResult(_0xcbb700,null))[_0x53e4('0x43')](handleError(_0xcbb700,null));};exports[_0x53e4('0x9a')]=runReport;exports[_0x53e4('0x2c')]=function(_0x2a0c1e,_0x4be38b){var _0x4eb71d=0xa;var _0x4437bf=['join',_0x53e4('0x4e'),'right_join',_0x53e4('0x9b')];var _0x320fe4={'SUM':_0x53e4('0x50'),'COUNT':_0x53e4('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x53e4('0x54'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x53e4('0x82')};var _0xb7842e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x53e4('0x58'),'HOUR':_0x53e4('0x59'),'ROUND':_0x53e4('0x5a'),'UNIX_TIMESTAMP':_0x53e4('0x5b')};var _0x36ced9=function(_0x18019d){return!_[_0x53e4('0x5c')](['IS\x20NULL',_0x53e4('0x5d'),'IS\x20EMPTY',_0x53e4('0x5f')],_0x18019d);};var _0x41e648=function(_0x364d12){if(!_0x364d12||!_0x364d12[_0x53e4('0x60')]['length']){return'';}for(var _0x597857='(',_0x5cd2e9=0x0;_0x5cd2e9<_0x364d12[_0x53e4('0x60')]['length'];_0x5cd2e9+=0x1){_0x5cd2e9>0x0&&(_0x597857+='\x20'+_0x364d12[_0x53e4('0x84')]+'\x20');_0x597857+=_0x364d12['rules'][_0x5cd2e9][_0x53e4('0x61')]?_0x41e648(_0x364d12[_0x53e4('0x60')][_0x5cd2e9][_0x53e4('0x61')]):_0x364d12[_0x53e4('0x60')][_0x5cd2e9][_0x53e4('0x3c')]+'\x20'+_0x364d12[_0x53e4('0x60')][_0x5cd2e9]['condition']+(_0x36ced9(_0x364d12['rules'][_0x5cd2e9][_0x53e4('0x62')])?'\x20'+_0x364d12[_0x53e4('0x60')][_0x5cd2e9][_0x53e4('0x85')]:'');}return _0x597857+')';};var _0x2d9240={'where':{'id':_0x2a0c1e[_0x53e4('0x42')]['id']}},_0x40a38a,_0x4deafb,_0x548914,_0x4e8860,_0x28c83f;_0x2d9240=_[_0x53e4('0x39')]({},_0x2d9240,_0x2a0c1e[_0x53e4('0x3d')]);return db[_0x53e4('0x28')]['find'](_0x2d9240)[_0x53e4('0x23')](function(_0x3b11d9){if(_0x3b11d9){_0x40a38a=_0x3b11d9;return _0x3b11d9['getFields']();}return null;})['then'](function(_0x1fb6c1){if(_0x1fb6c1){if(!_0x1fb6c1['length']){throw new db[(_0x53e4('0x64'))][(_0x53e4('0x65'))](_0x53e4('0x66'),0x193);}_0x4deafb=_0x1fb6c1;return db[_0x53e4('0x67')][_0x53e4('0x40')]({'raw':!![]});}return null;})['then'](function(_0xef4664){if(_0xef4664){_0x548914=_[_0x53e4('0x68')](_0xef4664,'id');var _0x48248f;var _0x32cab3=squel[_0x53e4('0x69')]();_0x32cab3[_0x53e4('0x6a')](_0x40a38a[_0x53e4('0x6b')]);for(var _0x347102=0x0;_0x347102<_0x4deafb['length'];_0x347102+=0x1){_0x48248f=_0x4deafb[_0x347102][_0x53e4('0x6c')]?_0x548914[_0x4deafb[_0x347102][_0x53e4('0x6c')]]['metric']:_0x4deafb[_0x347102][_0x53e4('0x3c')];_0x48248f=_0x4deafb[_0x347102]['function']?_[_0x53e4('0x6f')](_0x320fe4[_0x4deafb[_0x347102][_0x53e4('0x6d')]],'%s',_0x48248f):_0x48248f;_0x48248f=_0x4deafb[_0x347102]['format']?_[_0x53e4('0x6f')](_0xb7842e[_0x4deafb[_0x347102][_0x53e4('0x6e')]],'%s',_0x48248f):_0x48248f;if(_0x4deafb[_0x347102][_0x53e4('0x9c')]){_0x32cab3[_0x53e4('0x61')](_0x48248f);}_0x4deafb[_0x347102]['orderBy']&&_0x32cab3[_0x53e4('0x87')](_0x48248f,_0x4deafb[_0x347102][_0x53e4('0x70')]===_0x53e4('0x71')?![]:!![]);_0x32cab3[_0x53e4('0x3c')](_0x48248f,_0x4deafb[_0x347102][_0x53e4('0x72')]||_0x48248f);}if(_0x40a38a[_0x53e4('0x73')]){_0x40a38a['joins']=JSON[_0x53e4('0x88')](_0x40a38a[_0x53e4('0x73')]);for(var _0x3bc36a=0x0;_0x3bc36a<_0x40a38a['joins'][_0x53e4('0x31')];_0x3bc36a+=0x1){if(_0x40a38a[_0x53e4('0x73')][_0x3bc36a]['type']&&_[_0x53e4('0x5c')](_0x4437bf,_0x40a38a[_0x53e4('0x73')][_0x3bc36a][_0x53e4('0x74')])&&_0x40a38a[_0x53e4('0x73')][_0x3bc36a][_0x53e4('0x75')]&&_0x40a38a['joins'][_0x3bc36a][_0x53e4('0x76')]&&_0x40a38a[_0x53e4('0x73')][_0x3bc36a][_0x53e4('0x77')]){_0x32cab3[_0x40a38a[_0x53e4('0x73')][_0x3bc36a]['type']](_0x40a38a[_0x53e4('0x73')][_0x3bc36a]['foreignTable'],null,util[_0x53e4('0x6e')](_0x53e4('0x78'),_0x40a38a[_0x53e4('0x6b')],_0x40a38a[_0x53e4('0x73')][_0x3bc36a]['parentKey'],_0x40a38a[_0x53e4('0x73')][_0x3bc36a]['foreignTable'],_0x40a38a[_0x53e4('0x73')][_0x3bc36a][_0x53e4('0x77')]));}}}if(_0x40a38a[_0x53e4('0x79')]){_0x40a38a[_0x53e4('0x79')]=JSON['parse'](_0x40a38a[_0x53e4('0x79')]);_0x32cab3[_0x53e4('0x36')](_0x41e648(_0x40a38a['conditions'][_0x53e4('0x61')]));}_0x28c83f=_0x32cab3['clone']();_0x32cab3[_0x53e4('0x34')](_0x4eb71d);_0x32cab3[_0x53e4('0x1d')](0x0);logger[_0x53e4('0x7b')](_0x53e4('0x7c'),_0x32cab3[_0x53e4('0x7d')]());return db[_0x53e4('0x7e')][_0x53e4('0x2c')](_0x32cab3[_0x53e4('0x7d')](),{'type':db[_0x53e4('0x7e')]['QueryTypes'][_0x53e4('0x80')]});}})[_0x53e4('0x23')](function(){return{'sql':_0x28c83f[_0x53e4('0x7d')]()};})[_0x53e4('0x23')](respondWithResult(_0x4be38b,null))[_0x53e4('0x43')](handleError(_0x4be38b,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 36520bc..f332c4d 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 _0xde62=['analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xde62,0x143));var _0x2de6=function(_0x5847c1,_0x32d28b){_0x5847c1=_0x5847c1-0x0;var _0x5d77e5=_0xde62[_0x5847c1];return _0x5d77e5;};'use strict';var _=require(_0x2de6('0x0'));var util=require(_0x2de6('0x1'));var logger=require('../../config/logger')(_0x2de6('0x2'));var moment=require(_0x2de6('0x3'));var BPromise=require(_0x2de6('0x4'));var rp=require(_0x2de6('0x5'));var fs=require('fs');var path=require(_0x2de6('0x6'));var rimraf=require(_0x2de6('0x7'));var config=require(_0x2de6('0x8'));var attributes=require(_0x2de6('0x9'));module[_0x2de6('0xa')]=function(_0x469d52,_0x224918){return _0x469d52[_0x2de6('0xb')](_0x2de6('0xc'),attributes,{'tableName':_0x2de6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9693=['exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x9693,0x1c4));var _0x3969=function(_0x16e056,_0x26d6df){_0x16e056=_0x16e056-0x0;var _0x3ba2a5=_0x9693[_0x16e056];return _0x3ba2a5;};'use strict';var _=require(_0x3969('0x0'));var util=require('util');var logger=require(_0x3969('0x1'))(_0x3969('0x2'));var moment=require(_0x3969('0x3'));var BPromise=require(_0x3969('0x4'));var rp=require(_0x3969('0x5'));var fs=require('fs');var path=require(_0x3969('0x6'));var rimraf=require(_0x3969('0x7'));var config=require(_0x3969('0x8'));var attributes=require(_0x3969('0x9'));module[_0x3969('0xa')]=function(_0x2d5d1b,_0x4e5f72){return _0x2d5d1b['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 164f9b6..63fbf84 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3488e0,_0x32ad11){var _0x3e1168=function(_0x22df9e){while(--_0x22df9e){_0x3488e0['push'](_0x3488e0['shift']());}};_0x3e1168(++_0x32ad11);}(_0xaa88,0x137));var _0x8aa8=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xaa88[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\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(_0x3e7bee,_0x19db48){var _0x5ba5ee=function(_0x1b9e2f){while(--_0x1b9e2f){_0x3e7bee['push'](_0x3e7bee['shift']());}};_0x5ba5ee(++_0x19db48);}(_0xe706,0xa3));var _0x6e70=function(_0x50da6f,_0xfeb8d1){_0x50da6f=_0x50da6f-0x0;var _0xaff1c5=_0xe706[_0x50da6f];return _0xaff1c5;};'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']('AnalyticDefaultReport,\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']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f130995..4d9c826 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 _0x5edf=['get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller'];(function(_0x1cf496,_0x44d84c){var _0x1eb347=function(_0x38a78c){while(--_0x38a78c){_0x1cf496['push'](_0x1cf496['shift']());}};_0x1eb347(++_0x44d84c);}(_0x5edf,0x187));var _0xf5ed=function(_0x35f67b,_0x540ca5){_0x35f67b=_0x35f67b-0x0;var _0x2efa5d=_0x5edf[_0x35f67b];return _0x2efa5d;};'use strict';var multer=require(_0xf5ed('0x0'));var util=require(_0xf5ed('0x1'));var path=require(_0xf5ed('0x2'));var timeout=require(_0xf5ed('0x3'));var express=require(_0xf5ed('0x4'));var router=express[_0xf5ed('0x5')]();var auth=require(_0xf5ed('0x6'));var interaction=require(_0xf5ed('0x7'));var config=require('../../config/environment');var controller=require(_0xf5ed('0x8'));router[_0xf5ed('0x9')]('/',auth[_0xf5ed('0xa')](),controller[_0xf5ed('0xb')]);router[_0xf5ed('0x9')](_0xf5ed('0xc'),auth[_0xf5ed('0xa')](),controller[_0xf5ed('0xd')]);router[_0xf5ed('0x9')]('/:id/preview',auth[_0xf5ed('0xa')](),controller[_0xf5ed('0xe')]);router[_0xf5ed('0x9')](_0xf5ed('0xf'),auth[_0xf5ed('0xa')](),controller[_0xf5ed('0x10')]);router[_0xf5ed('0x9')](_0xf5ed('0x11'),auth[_0xf5ed('0xa')](),controller[_0xf5ed('0x12')]);router[_0xf5ed('0x13')]('/',auth['isAuthenticated'](),controller[_0xf5ed('0x14')]);router[_0xf5ed('0x15')]('/:id',auth[_0xf5ed('0xa')](),controller[_0xf5ed('0x16')]);router['delete'](_0xf5ed('0xc'),auth[_0xf5ed('0xa')](),controller[_0xf5ed('0x17')]);module[_0xf5ed('0x18')]=router; \ No newline at end of file +var _0x8204=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','/:id/query','query','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x55b508,_0x4dfb12){var _0x49b98a=function(_0x118fc6){while(--_0x118fc6){_0x55b508['push'](_0x55b508['shift']());}};_0x49b98a(++_0x4dfb12);}(_0x8204,0xb2));var _0x4820=function(_0xef0b7c,_0x5c891d){_0xef0b7c=_0xef0b7c-0x0;var _0x1b5176=_0x8204[_0xef0b7c];return _0x1b5176;};'use strict';var multer=require(_0x4820('0x0'));var util=require(_0x4820('0x1'));var path=require(_0x4820('0x2'));var timeout=require(_0x4820('0x3'));var express=require(_0x4820('0x4'));var router=express[_0x4820('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4820('0x6'));var config=require(_0x4820('0x7'));var controller=require(_0x4820('0x8'));router['get']('/',auth[_0x4820('0x9')](),controller[_0x4820('0xa')]);router[_0x4820('0xb')](_0x4820('0xc'),auth['isAuthenticated'](),controller[_0x4820('0xd')]);router['get']('/:id/preview',auth[_0x4820('0x9')](),controller['preview']);router['get'](_0x4820('0xe'),auth[_0x4820('0x9')](),controller[_0x4820('0xf')]);router[_0x4820('0xb')](_0x4820('0x10'),auth[_0x4820('0x9')](),controller[_0x4820('0x11')]);router[_0x4820('0x12')]('/',auth[_0x4820('0x9')](),controller[_0x4820('0x13')]);router[_0x4820('0x14')]('/:id',auth[_0x4820('0x9')](),controller[_0x4820('0x15')]);router['delete']('/:id',auth[_0x4820('0x9')](),controller['destroy']);module[_0x4820('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8277351..0da44fc 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 _0xc6c4=['csv','DATE','manual','scheduled','INTEGER','exports','STRING','ENUM','pdf','xlsx'];(function(_0x3f375f,_0xb8b113){var _0x5e0a67=function(_0x3e19b7){while(--_0x3e19b7){_0x3f375f['push'](_0x3f375f['shift']());}};_0x5e0a67(++_0xb8b113);}(_0xc6c4,0x14f));var _0x4c6c=function(_0x4b33fe,_0x34bf3e){_0x4b33fe=_0x4b33fe-0x0;var _0x4dc7ea=_0xc6c4[_0x4b33fe];return _0x4dc7ea;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x4c6c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4c6c('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x4c6c('0x2')]('csv',_0x4c6c('0x3'),_0x4c6c('0x4')),'allowNull':![],'defaultValue':_0x4c6c('0x5')},'savename':{'type':Sequelize[_0x4c6c('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4c6c('0x6')]},'endDate':{'type':Sequelize[_0x4c6c('0x6')]},'status':{'type':Sequelize[_0x4c6c('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4c6c('0x2')](_0x4c6c('0x7'),_0x4c6c('0x8')),'allowNull':![],'defaultValue':_0x4c6c('0x7')},'reportId':{'type':Sequelize[_0x4c6c('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x96a1=['DATE','manual','INTEGER','UNSIGNED','moment','STRING','ENUM','pdf','csv'];(function(_0x15ecd6,_0x940689){var _0x172e21=function(_0x28993b){while(--_0x28993b){_0x15ecd6['push'](_0x15ecd6['shift']());}};_0x172e21(++_0x940689);}(_0x96a1,0x11b));var _0x196a=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0x96a1[_0x19e08e];return _0x14c229;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x196a('0x0'));module['exports']={'name':{'type':Sequelize[_0x196a('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x196a('0x2')]('csv',_0x196a('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x196a('0x4')},'savename':{'type':Sequelize[_0x196a('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x196a('0x5')]},'endDate':{'type':Sequelize[_0x196a('0x5')]},'status':{'type':Sequelize[_0x196a('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x196a('0x2')](_0x196a('0x6'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x196a('0x7')](0xb)[_0x196a('0x8')]},'reportType':{'type':Sequelize[_0x196a('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index aad93e8..97d1714 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 _0x7d13=['rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','update','params','basename','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','download','join','root','format','toLowerCase','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','get','ExtractedReports','UserProfileResource','destroy','end','error','name','index','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','VIRTUAL','field','filter','includeAll','include'];(function(_0x25be62,_0x54822a){var _0x571ac0=function(_0x55cb3e){while(--_0x55cb3e){_0x25be62['push'](_0x25be62['shift']());}};_0x571ac0(++_0x54822a);}(_0x7d13,0x6c));var _0x37d1=function(_0x555132,_0x1b2e95){_0x555132=_0x555132-0x0;var _0x2c9499=_0x7d13[_0x555132];return _0x2c9499;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x37d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x37d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37d1('0x2'));var moment=require(_0x37d1('0x3'));var BPromise=require(_0x37d1('0x4'));var Mustache=require(_0x37d1('0x5'));var util=require(_0x37d1('0x6'));var path=require('path');var sox=require(_0x37d1('0x7'));var csv=require(_0x37d1('0x8'));var ejs=require(_0x37d1('0x9'));var fs=require('fs');var _=require(_0x37d1('0xa'));var squel=require('squel');var crypto=require(_0x37d1('0xb'));var jsforce=require(_0x37d1('0xc'));var deskjs=require(_0x37d1('0xd'));var toCsv=require(_0x37d1('0x8'));var querystring=require(_0x37d1('0xe'));var Papa=require(_0x37d1('0xf'));var Redis=require(_0x37d1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x37d1('0x11'));var logger=require(_0x37d1('0x12'))('api');var utils=require(_0x37d1('0x13'));var config=require(_0x37d1('0x14'));var db=require(_0x37d1('0x15'))['db'];function respondWithStatusCode(_0x1cfab7,_0x1ec9d3){_0x1ec9d3=_0x1ec9d3||0xcc;return function(_0x110122){if(_0x110122){return _0x1cfab7[_0x37d1('0x16')](_0x1ec9d3);}return _0x1cfab7[_0x37d1('0x17')](_0x1ec9d3)['end']();};}function respondWithResult(_0x3afdfc,_0x279505){_0x279505=_0x279505||0xc8;return function(_0x4be8fb){if(_0x4be8fb){return _0x3afdfc[_0x37d1('0x17')](_0x279505)[_0x37d1('0x18')](_0x4be8fb);}};}function respondWithFilteredResult(_0x56465e,_0x40907d){return function(_0x43e615){if(_0x43e615){var _0x4a371b=_0x43e615[_0x37d1('0x19')],_0x52c41c=_0x40907d['offset'],_0x42bdd5=_0x40907d[_0x37d1('0x1a')]+_0x40907d[_0x37d1('0x1b')],_0x198ebe;if(_0x42bdd5>=_0x4a371b){_0x42bdd5=_0x4a371b;_0x198ebe=0xc8;}else{_0x198ebe=0xce;}_0x56465e[_0x37d1('0x17')](_0x198ebe);return _0x56465e['set'](_0x37d1('0x1c'),_0x52c41c+'-'+_0x42bdd5+'/'+_0x4a371b)[_0x37d1('0x18')](_0x43e615);}return null;};}function patchUpdates(_0x50fed2){return function(_0xeb691a){try{jsonpatch[_0x37d1('0x1d')](_0xeb691a,_0x50fed2,!![]);}catch(_0x2e1094){return BPromise[_0x37d1('0x1e')](_0x2e1094);}return _0xeb691a[_0x37d1('0x1f')]();};}function saveUpdates(_0x1d522e,_0x1c0845){return function(_0x546826){if(_0x546826){return _0x546826['update'](_0x1d522e)[_0x37d1('0x20')](function(_0x3b8dd1){return _0x3b8dd1;});}return null;};}function removeEntity(_0x44c8b0,_0x13fd66){return function(_0x4ea3c5){if(_0x4ea3c5){return _0x4ea3c5['destroy']()[_0x37d1('0x20')](function(){var _0x19c4a9=_0x4ea3c5[_0x37d1('0x21')]({'plain':!![]});var _0x18c36b=_0x37d1('0x22');return db[_0x37d1('0x23')][_0x37d1('0x24')]({'where':{'type':_0x18c36b,'resourceId':_0x19c4a9['id']}})[_0x37d1('0x20')](function(){return _0x4ea3c5;});})[_0x37d1('0x20')](function(){_0x44c8b0[_0x37d1('0x17')](0xcc)[_0x37d1('0x25')]();});}};}function handleEntityNotFound(_0x4ec3d3,_0xa51780){return function(_0x3ca34c){if(!_0x3ca34c){_0x4ec3d3[_0x37d1('0x16')](0x194);}return _0x3ca34c;};}function handleError(_0x28bf0e,_0x16466f){_0x16466f=_0x16466f||0x1f4;return function(_0x54da9c){logger[_0x37d1('0x26')](_0x54da9c['stack']);if(_0x54da9c[_0x37d1('0x27')]){delete _0x54da9c[_0x37d1('0x27')];}_0x28bf0e[_0x37d1('0x17')](_0x16466f)['send'](_0x54da9c);};}exports[_0x37d1('0x28')]=function(_0x5a4e98,_0x34c128){var _0x4478ae={},_0x13d21f={},_0x5f5830={'count':0x0,'rows':[]};var _0xcf3373=db[_0x37d1('0x29')][_0x37d1('0x2a')];_0x13d21f[_0x37d1('0x2b')]=_[_0x37d1('0x2c')](_0xcf3373);_0x13d21f[_0x37d1('0x2d')]=_[_0x37d1('0x2c')](_0x5a4e98['query']);_0x13d21f[_0x37d1('0x2e')]=_[_0x37d1('0x2f')](_0x13d21f[_0x37d1('0x2b')],_0x13d21f[_0x37d1('0x2d')]);_0x4478ae[_0x37d1('0x30')]=_['intersection'](_0x13d21f[_0x37d1('0x2b')],qs[_0x37d1('0x31')](_0x5a4e98[_0x37d1('0x2d')][_0x37d1('0x31')]));_0x4478ae[_0x37d1('0x30')]=_0x4478ae['attributes'][_0x37d1('0x32')]?_0x4478ae[_0x37d1('0x30')]:_0x13d21f[_0x37d1('0x2b')];if(!_0x5a4e98[_0x37d1('0x2d')][_0x37d1('0x33')](_0x37d1('0x34'))){_0x4478ae[_0x37d1('0x1b')]=qs['limit'](_0x5a4e98['query'][_0x37d1('0x1b')]);_0x4478ae[_0x37d1('0x1a')]=qs[_0x37d1('0x1a')](_0x5a4e98[_0x37d1('0x2d')][_0x37d1('0x1a')]);}_0x4478ae[_0x37d1('0x35')]=qs['sort'](_0x5a4e98['query'][_0x37d1('0x36')]);_0x4478ae[_0x37d1('0x37')]=qs[_0x37d1('0x2e')](_['pick'](_0x5a4e98[_0x37d1('0x2d')],_0x13d21f[_0x37d1('0x2e')]));if(_0x5a4e98[_0x37d1('0x2d')]['filter']){_0x4478ae[_0x37d1('0x37')]=_[_0x37d1('0x38')](_0x4478ae[_0x37d1('0x37')],{'$or':_[_0x37d1('0x39')](_0xcf3373,function(_0x3e988b){if(_0x3e988b[_0x37d1('0x3a')]['key']!==_0x37d1('0x3b')){var _0x46bc3e={};_0x46bc3e[_0x3e988b[_0x37d1('0x3c')]]={'$like':'%'+_0x5a4e98['query'][_0x37d1('0x3d')]+'%'};return _0x46bc3e;}})});}_0x4478ae=_[_0x37d1('0x38')]({},_0x4478ae,_0x5a4e98['options']);var _0x273c5c={'where':_0x4478ae['where']};return db[_0x37d1('0x29')]['count'](_0x273c5c)['then'](function(_0x32397c){_0x5f5830[_0x37d1('0x19')]=_0x32397c;if(_0x5a4e98[_0x37d1('0x2d')][_0x37d1('0x3e')]){_0x4478ae[_0x37d1('0x3f')]=[{'all':!![]}];}return db[_0x37d1('0x29')]['findAll'](_0x4478ae);})['then'](function(_0x2a9b29){_0x5f5830[_0x37d1('0x40')]=_0x2a9b29;return _0x5f5830;})[_0x37d1('0x20')](respondWithFilteredResult(_0x34c128,_0x4478ae))[_0x37d1('0x41')](handleError(_0x34c128,null));};exports['show']=function(_0x43182c,_0x27e888){var _0x4cf17b={'raw':!![],'where':{'id':_0x43182c['params']['id']}},_0x5cb495={};_0x5cb495[_0x37d1('0x2b')]=_[_0x37d1('0x2c')](db[_0x37d1('0x29')][_0x37d1('0x2a')]);_0x5cb495[_0x37d1('0x2d')]=_[_0x37d1('0x2c')](_0x43182c['query']);_0x5cb495[_0x37d1('0x2e')]=_[_0x37d1('0x2f')](_0x5cb495[_0x37d1('0x2b')],_0x5cb495[_0x37d1('0x2d')]);_0x4cf17b[_0x37d1('0x30')]=_[_0x37d1('0x2f')](_0x5cb495[_0x37d1('0x2b')],qs[_0x37d1('0x31')](_0x43182c['query'][_0x37d1('0x31')]));_0x4cf17b[_0x37d1('0x30')]=_0x4cf17b[_0x37d1('0x30')][_0x37d1('0x32')]?_0x4cf17b['attributes']:_0x5cb495[_0x37d1('0x2b')];if(_0x43182c['query']['includeAll']){_0x4cf17b[_0x37d1('0x3f')]=[{'all':!![]}];}_0x4cf17b=_[_0x37d1('0x38')]({},_0x4cf17b,_0x43182c['options']);return db['AnalyticExtractedReport'][_0x37d1('0x42')](_0x4cf17b)[_0x37d1('0x20')](handleEntityNotFound(_0x27e888,null))['then'](respondWithResult(_0x27e888,null))[_0x37d1('0x41')](handleError(_0x27e888,null));};exports[_0x37d1('0x43')]=function(_0x305c52,_0x1b4ff0){return db[_0x37d1('0x29')][_0x37d1('0x43')](_0x305c52[_0x37d1('0x44')],{})[_0x37d1('0x20')](function(_0x3feaa5){var _0x401c4c=_0x305c52[_0x37d1('0x45')][_0x37d1('0x21')]({'plain':!![]});if(!_0x401c4c)throw new Error(_0x37d1('0x46'));if(_0x401c4c['role']==='user'){var _0xba0901=_0x3feaa5[_0x37d1('0x21')]({'plain':!![]});var _0x13033a=_0x37d1('0x22');return db[_0x37d1('0x47')]['find']({'where':{'name':_0x13033a,'userProfileId':_0x401c4c['userProfileId']},'raw':!![]})[_0x37d1('0x20')](function(_0x234db9){if(_0x234db9&&_0x234db9['autoAssociation']===0x0){return db[_0x37d1('0x23')][_0x37d1('0x43')]({'name':_0xba0901[_0x37d1('0x27')],'resourceId':_0xba0901['id'],'type':_0x234db9[_0x37d1('0x27')],'sectionId':_0x234db9['id']},{})[_0x37d1('0x20')](function(){return _0x3feaa5;});}else{return _0x3feaa5;}})['catch'](function(_0x2eacf0){logger[_0x37d1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2eacf0);throw _0x2eacf0;});}return _0x3feaa5;})['then'](respondWithResult(_0x1b4ff0,0xc9))['catch'](handleError(_0x1b4ff0,null));};exports[_0x37d1('0x48')]=function(_0x358e50,_0x1ac918){if(_0x358e50['body']['id']){delete _0x358e50[_0x37d1('0x44')]['id'];}return db[_0x37d1('0x29')]['find']({'where':{'id':_0x358e50['params']['id']}})['then'](handleEntityNotFound(_0x1ac918,null))[_0x37d1('0x20')](saveUpdates(_0x358e50[_0x37d1('0x44')],null))[_0x37d1('0x20')](respondWithResult(_0x1ac918,null))[_0x37d1('0x41')](handleError(_0x1ac918,null));};exports[_0x37d1('0x24')]=function(_0x51f006,_0x41ec84){return db[_0x37d1('0x29')][_0x37d1('0x42')]({'where':{'id':_0x51f006[_0x37d1('0x49')]['id']}})['then'](handleEntityNotFound(_0x41ec84,null))[_0x37d1('0x20')](removeEntity(_0x41ec84,null))[_0x37d1('0x41')](handleError(_0x41ec84,null));};exports['download']=function(_0x166178,_0xf180e1,_0x3917fd){return db[_0x37d1('0x29')][_0x37d1('0x42')]({'where':{'id':_0x166178[_0x37d1('0x49')]['id']},'attributes':[_0x37d1('0x27'),_0x37d1('0x4a'),_0x37d1('0x4b'),_0x37d1('0x4c')],'raw':!![]})[_0x37d1('0x20')](handleEntityNotFound(_0xf180e1,null))[_0x37d1('0x20')](function(_0x4dc209){if(_0x4dc209){if(!fs[_0x37d1('0x4d')](path['join'](config['root'],_0x37d1('0x4e'),_0x4dc209[_0x37d1('0x4b')]))){throw new db[(_0x37d1('0x4f'))][(_0x37d1('0x50'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x166178[_0x37d1('0x2d')]['exists']){return _0xf180e1[_0x37d1('0x16')](0xc8);}return _0xf180e1[_0x37d1('0x51')](path[_0x37d1('0x52')](config[_0x37d1('0x53')],_0x37d1('0x4e'),_0x4dc209[_0x37d1('0x4b')]),util[_0x37d1('0x54')]('%s.%s',_0x4dc209[_0x37d1('0x4a')]||_0x4dc209[_0x37d1('0x27')],_0x4dc209['output'][_0x37d1('0x55')]()));}})[_0x37d1('0x41')](handleError(_0xf180e1,null));}; \ No newline at end of file +var _0x8c11=['index','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','type','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','send'];(function(_0x1e0ca5,_0x57fd4f){var _0x410923=function(_0x5bd94d){while(--_0x5bd94d){_0x1e0ca5['push'](_0x1e0ca5['shift']());}};_0x410923(++_0x57fd4f);}(_0x8c11,0xf5));var _0x18c1=function(_0x3d300b,_0x12d3c1){_0x3d300b=_0x3d300b-0x0;var _0x1a1b8d=_0x8c11[_0x3d300b];return _0x1a1b8d;};'use strict';var pdf=require(_0x18c1('0x0'));var emlformat=require(_0x18c1('0x1'));var rimraf=require(_0x18c1('0x2'));var zipdir=require(_0x18c1('0x3'));var jsonpatch=require(_0x18c1('0x4'));var rp=require(_0x18c1('0x5'));var moment=require(_0x18c1('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x18c1('0x7'));var util=require(_0x18c1('0x8'));var path=require(_0x18c1('0x9'));var sox=require(_0x18c1('0xa'));var csv=require(_0x18c1('0xb'));var ejs=require(_0x18c1('0xc'));var fs=require('fs');var _=require(_0x18c1('0xd'));var squel=require(_0x18c1('0xe'));var crypto=require('crypto');var jsforce=require(_0x18c1('0xf'));var deskjs=require(_0x18c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x18c1('0x11'));var Papa=require(_0x18c1('0x12'));var Redis=require(_0x18c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x18c1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18c1('0x15'));var utils=require(_0x18c1('0x16'));var config=require(_0x18c1('0x17'));var db=require(_0x18c1('0x18'))['db'];function respondWithStatusCode(_0x3a0c7c,_0x4a7a5c){_0x4a7a5c=_0x4a7a5c||0xcc;return function(_0x4bd290){if(_0x4bd290){return _0x3a0c7c[_0x18c1('0x19')](_0x4a7a5c);}return _0x3a0c7c[_0x18c1('0x1a')](_0x4a7a5c)['end']();};}function respondWithResult(_0x4a5c4a,_0x285d83){_0x285d83=_0x285d83||0xc8;return function(_0x33d377){if(_0x33d377){return _0x4a5c4a[_0x18c1('0x1a')](_0x285d83)['json'](_0x33d377);}};}function respondWithFilteredResult(_0x5df1e9,_0x4c9196){return function(_0x7e1efb){if(_0x7e1efb){var _0x118952=_0x7e1efb[_0x18c1('0x1b')],_0xf5817c=_0x4c9196[_0x18c1('0x1c')],_0x142974=_0x4c9196[_0x18c1('0x1c')]+_0x4c9196['limit'],_0x50c969;if(_0x142974>=_0x118952){_0x142974=_0x118952;_0x50c969=0xc8;}else{_0x50c969=0xce;}_0x5df1e9[_0x18c1('0x1a')](_0x50c969);return _0x5df1e9[_0x18c1('0x1d')](_0x18c1('0x1e'),_0xf5817c+'-'+_0x142974+'/'+_0x118952)[_0x18c1('0x1f')](_0x7e1efb);}return null;};}function patchUpdates(_0x230148){return function(_0x55a678){try{jsonpatch[_0x18c1('0x20')](_0x55a678,_0x230148,!![]);}catch(_0x4a58a1){return BPromise[_0x18c1('0x21')](_0x4a58a1);}return _0x55a678['save']();};}function saveUpdates(_0x5a821a,_0x168ac2){return function(_0xf52301){if(_0xf52301){return _0xf52301[_0x18c1('0x22')](_0x5a821a)[_0x18c1('0x23')](function(_0xabcbfd){return _0xabcbfd;});}return null;};}function removeEntity(_0x4fcf32,_0x1c356b){return function(_0x4141c6){if(_0x4141c6){return _0x4141c6['destroy']()['then'](function(){var _0x18fba7=_0x4141c6[_0x18c1('0x24')]({'plain':!![]});var _0x53a784=_0x18c1('0x25');return db[_0x18c1('0x26')][_0x18c1('0x27')]({'where':{'type':_0x53a784,'resourceId':_0x18fba7['id']}})[_0x18c1('0x23')](function(){return _0x4141c6;});})['then'](function(){_0x4fcf32[_0x18c1('0x1a')](0xcc)[_0x18c1('0x28')]();});}};}function handleEntityNotFound(_0x2001e4,_0x40e1e1){return function(_0x1498e9){if(!_0x1498e9){_0x2001e4[_0x18c1('0x19')](0x194);}return _0x1498e9;};}function handleError(_0x10668b,_0x13e431){_0x13e431=_0x13e431||0x1f4;return function(_0x5496fe){logger[_0x18c1('0x29')](_0x5496fe['stack']);if(_0x5496fe['name']){delete _0x5496fe['name'];}_0x10668b['status'](_0x13e431)[_0x18c1('0x2a')](_0x5496fe);};}exports[_0x18c1('0x2b')]=function(_0x2e2988,_0x1d3ffc){var _0x304ab5={},_0x2bd479={},_0x4ac768={'count':0x0,'rows':[]};var _0x3ab8df=db[_0x18c1('0x2c')][_0x18c1('0x2d')];_0x2bd479[_0x18c1('0x2e')]=_[_0x18c1('0x2f')](_0x3ab8df);_0x2bd479[_0x18c1('0x30')]=_[_0x18c1('0x2f')](_0x2e2988['query']);_0x2bd479[_0x18c1('0x31')]=_[_0x18c1('0x32')](_0x2bd479[_0x18c1('0x2e')],_0x2bd479[_0x18c1('0x30')]);_0x304ab5[_0x18c1('0x33')]=_[_0x18c1('0x32')](_0x2bd479[_0x18c1('0x2e')],qs[_0x18c1('0x34')](_0x2e2988['query'][_0x18c1('0x34')]));_0x304ab5[_0x18c1('0x33')]=_0x304ab5[_0x18c1('0x33')][_0x18c1('0x35')]?_0x304ab5[_0x18c1('0x33')]:_0x2bd479[_0x18c1('0x2e')];if(!_0x2e2988[_0x18c1('0x30')][_0x18c1('0x36')](_0x18c1('0x37'))){_0x304ab5[_0x18c1('0x38')]=qs[_0x18c1('0x38')](_0x2e2988[_0x18c1('0x30')]['limit']);_0x304ab5[_0x18c1('0x1c')]=qs[_0x18c1('0x1c')](_0x2e2988[_0x18c1('0x30')]['offset']);}_0x304ab5[_0x18c1('0x39')]=qs[_0x18c1('0x3a')](_0x2e2988[_0x18c1('0x30')][_0x18c1('0x3a')]);_0x304ab5['where']=qs[_0x18c1('0x31')](_[_0x18c1('0x3b')](_0x2e2988[_0x18c1('0x30')],_0x2bd479[_0x18c1('0x31')]));if(_0x2e2988[_0x18c1('0x30')]['filter']){_0x304ab5[_0x18c1('0x3c')]=_['merge'](_0x304ab5[_0x18c1('0x3c')],{'$or':_['map'](_0x3ab8df,function(_0x37e1fd){if(_0x37e1fd[_0x18c1('0x3d')]['key']!==_0x18c1('0x3e')){var _0x3253a4={};_0x3253a4[_0x37e1fd['field']]={'$like':'%'+_0x2e2988['query'][_0x18c1('0x3f')]+'%'};return _0x3253a4;}})});}_0x304ab5=_['merge']({},_0x304ab5,_0x2e2988['options']);var _0x15e234={'where':_0x304ab5[_0x18c1('0x3c')]};return db[_0x18c1('0x2c')][_0x18c1('0x1b')](_0x15e234)[_0x18c1('0x23')](function(_0x52f7ac){_0x4ac768['count']=_0x52f7ac;if(_0x2e2988[_0x18c1('0x30')][_0x18c1('0x40')]){_0x304ab5['include']=[{'all':!![]}];}return db[_0x18c1('0x2c')][_0x18c1('0x41')](_0x304ab5);})[_0x18c1('0x23')](function(_0x16ac5b){_0x4ac768[_0x18c1('0x42')]=_0x16ac5b;return _0x4ac768;})[_0x18c1('0x23')](respondWithFilteredResult(_0x1d3ffc,_0x304ab5))['catch'](handleError(_0x1d3ffc,null));};exports[_0x18c1('0x43')]=function(_0x5b4e7b,_0x36fad2){var _0x51efb3={'raw':!![],'where':{'id':_0x5b4e7b[_0x18c1('0x44')]['id']}},_0xb71d7={};_0xb71d7['model']=_[_0x18c1('0x2f')](db[_0x18c1('0x2c')][_0x18c1('0x2d')]);_0xb71d7[_0x18c1('0x30')]=_[_0x18c1('0x2f')](_0x5b4e7b[_0x18c1('0x30')]);_0xb71d7['filters']=_[_0x18c1('0x32')](_0xb71d7['model'],_0xb71d7['query']);_0x51efb3[_0x18c1('0x33')]=_[_0x18c1('0x32')](_0xb71d7[_0x18c1('0x2e')],qs['fields'](_0x5b4e7b[_0x18c1('0x30')][_0x18c1('0x34')]));_0x51efb3[_0x18c1('0x33')]=_0x51efb3[_0x18c1('0x33')][_0x18c1('0x35')]?_0x51efb3[_0x18c1('0x33')]:_0xb71d7[_0x18c1('0x2e')];if(_0x5b4e7b[_0x18c1('0x30')][_0x18c1('0x40')]){_0x51efb3[_0x18c1('0x45')]=[{'all':!![]}];}_0x51efb3=_[_0x18c1('0x46')]({},_0x51efb3,_0x5b4e7b['options']);return db[_0x18c1('0x2c')][_0x18c1('0x47')](_0x51efb3)[_0x18c1('0x23')](handleEntityNotFound(_0x36fad2,null))['then'](respondWithResult(_0x36fad2,null))[_0x18c1('0x48')](handleError(_0x36fad2,null));};exports['create']=function(_0x52f1c4,_0x2d1675){return db[_0x18c1('0x2c')][_0x18c1('0x49')](_0x52f1c4[_0x18c1('0x4a')],{})[_0x18c1('0x23')](function(_0x352298){var _0x4df7f3=_0x52f1c4['user']['get']({'plain':!![]});if(!_0x4df7f3)throw new Error(_0x18c1('0x4b'));if(_0x4df7f3[_0x18c1('0x4c')]===_0x18c1('0x4d')){var _0xedd796=_0x352298[_0x18c1('0x24')]({'plain':!![]});var _0xa0973c=_0x18c1('0x25');return db[_0x18c1('0x4e')][_0x18c1('0x47')]({'where':{'name':_0xa0973c,'userProfileId':_0x4df7f3[_0x18c1('0x4f')]},'raw':!![]})['then'](function(_0x5c1d6d){if(_0x5c1d6d&&_0x5c1d6d[_0x18c1('0x50')]===0x0){return db[_0x18c1('0x26')]['create']({'name':_0xedd796[_0x18c1('0x51')],'resourceId':_0xedd796['id'],'type':_0x5c1d6d[_0x18c1('0x51')],'sectionId':_0x5c1d6d['id']},{})[_0x18c1('0x23')](function(){return _0x352298;});}else{return _0x352298;}})[_0x18c1('0x48')](function(_0x102081){logger[_0x18c1('0x29')](_0x18c1('0x52'),_0x102081);throw _0x102081;});}return _0x352298;})[_0x18c1('0x23')](respondWithResult(_0x2d1675,0xc9))[_0x18c1('0x48')](handleError(_0x2d1675,null));};exports[_0x18c1('0x22')]=function(_0x535511,_0x141c5b){if(_0x535511['body']['id']){delete _0x535511[_0x18c1('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x18c1('0x47')]({'where':{'id':_0x535511[_0x18c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x141c5b,null))[_0x18c1('0x23')](saveUpdates(_0x535511[_0x18c1('0x4a')],null))[_0x18c1('0x23')](respondWithResult(_0x141c5b,null))[_0x18c1('0x48')](handleError(_0x141c5b,null));};exports[_0x18c1('0x27')]=function(_0x3a7acb,_0x38397b){return db[_0x18c1('0x2c')][_0x18c1('0x47')]({'where':{'id':_0x3a7acb[_0x18c1('0x44')]['id']}})[_0x18c1('0x23')](handleEntityNotFound(_0x38397b,null))['then'](removeEntity(_0x38397b,null))[_0x18c1('0x48')](handleError(_0x38397b,null));};exports[_0x18c1('0x53')]=function(_0x7d622d,_0x3628d7,_0x51c5c8){return db[_0x18c1('0x2c')][_0x18c1('0x47')]({'where':{'id':_0x7d622d[_0x18c1('0x44')]['id']},'attributes':[_0x18c1('0x51'),_0x18c1('0x54'),_0x18c1('0x55'),_0x18c1('0x56')],'raw':!![]})[_0x18c1('0x23')](handleEntityNotFound(_0x3628d7,null))[_0x18c1('0x23')](function(_0x45f36a){if(_0x45f36a){if(!fs[_0x18c1('0x57')](path[_0x18c1('0x58')](config[_0x18c1('0x59')],_0x18c1('0x5a'),_0x45f36a[_0x18c1('0x55')]))){throw new db['Sequelize'][(_0x18c1('0x5b'))](_0x18c1('0x5c'));}if(_0x7d622d[_0x18c1('0x30')]['exists']){return _0x3628d7[_0x18c1('0x19')](0xc8);}return _0x3628d7[_0x18c1('0x53')](path['join'](config['root'],_0x18c1('0x5a'),_0x45f36a[_0x18c1('0x55')]),util[_0x18c1('0x5d')](_0x18c1('0x5e'),_0x45f36a[_0x18c1('0x54')]||_0x45f36a[_0x18c1('0x51')],_0x45f36a['output'][_0x18c1('0x5f')]()));}})['catch'](handleError(_0x3628d7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0d4a7df..8b32ea8 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 _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','util'];(function(_0xd0ef4e,_0x40024b){var _0x561ce3=function(_0x501156){while(--_0x501156){_0xd0ef4e['push'](_0xd0ef4e['shift']());}};_0x561ce3(++_0x40024b);}(_0x6f47,0xc7));var _0x76f4=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x6f47[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd67b=['bluebird','path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','api','moment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd67b,0x133));var _0xbd67=function(_0x264a70,_0x57194a){_0x264a70=_0x264a70-0x0;var _0x3c8638=_0xd67b[_0x264a70];return _0x3c8638;};'use strict';var _=require('lodash');var util=require(_0xbd67('0x0'));var logger=require('../../config/logger')(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var BPromise=require(_0xbd67('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd67('0x4'));var rimraf=require('rimraf');var config=require(_0xbd67('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0xbd67('0x6')]=function(_0xa5c384,_0x2ad142){return _0xa5c384[_0xbd67('0x7')](_0xbd67('0x8'),attributes,{'tableName':_0xbd67('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index c4b7bad..4d7811e 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 _0xbe05=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x21cdf5,_0x3cfd4c){var _0x30150d=function(_0x1526c6){while(--_0x1526c6){_0x21cdf5['push'](_0x21cdf5['shift']());}};_0x30150d(++_0x3cfd4c);}(_0xbe05,0x130));var _0x5be0=function(_0x365f16,_0x4e1de3){_0x365f16=_0x365f16-0x0;var _0x441b5d=_0xbe05[_0x365f16];return _0x441b5d;};'use strict';var _=require(_0x5be0('0x0'));var util=require('util');var moment=require(_0x5be0('0x1'));var BPromise=require(_0x5be0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5be0('0x3'));var db=require(_0x5be0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5be0('0x5'))('rpc');var config=require(_0x5be0('0x6'));var jayson=require(_0x5be0('0x7'));var client=jayson['client'][_0x5be0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9f3403,_0x35e895,_0x423ea4){return new BPromise(function(_0x55f315,_0x3fca06){return client[_0x5be0('0x9')](_0x9f3403,_0x423ea4)['then'](function(_0x1f2c0f){logger[_0x5be0('0xa')](_0x5be0('0xb'),_0x35e895,_0x5be0('0xc'));logger[_0x5be0('0xd')](_0x5be0('0xe'),_0x35e895,'request\x20sent',JSON['stringify'](_0x1f2c0f));if(_0x1f2c0f[_0x5be0('0xf')]){if(_0x1f2c0f[_0x5be0('0xf')][_0x5be0('0x10')]===0x1f4){logger[_0x5be0('0xf')](_0x5be0('0xb'),_0x35e895,_0x1f2c0f[_0x5be0('0xf')][_0x5be0('0x11')]);return _0x3fca06(_0x1f2c0f[_0x5be0('0xf')]['message']);}logger['error'](_0x5be0('0xb'),_0x35e895,_0x1f2c0f[_0x5be0('0xf')][_0x5be0('0x11')]);return _0x55f315(_0x1f2c0f[_0x5be0('0xf')][_0x5be0('0x11')]);}else{logger[_0x5be0('0xa')](_0x5be0('0xb'),_0x35e895,_0x5be0('0xc'));_0x55f315(_0x1f2c0f[_0x5be0('0x12')]['message']);}})['catch'](function(_0x482755){logger[_0x5be0('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35e895,_0x482755);_0x3fca06(_0x482755);});});} \ No newline at end of file +var _0x9dbb=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x9dbb,0xee));var _0xb9db=function(_0x4b0a13,_0x9f30e0){_0x4b0a13=_0x4b0a13-0x0;var _0x4d11bf=_0x9dbb[_0x4b0a13];return _0x4d11bf;};'use strict';var _=require(_0xb9db('0x0'));var util=require(_0xb9db('0x1'));var moment=require(_0xb9db('0x2'));var BPromise=require(_0xb9db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9db('0x4'));var db=require(_0xb9db('0x5'))['db'];var utils=require(_0xb9db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb9db('0x7'));var jayson=require(_0xb9db('0x8'));var client=jayson[_0xb9db('0x9')][_0xb9db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf68e4d,_0x4dbc02,_0x12ee77){return new BPromise(function(_0x5243a2,_0x11bb46){return client[_0xb9db('0xb')](_0xf68e4d,_0x12ee77)[_0xb9db('0xc')](function(_0x3e55eb){logger[_0xb9db('0xd')](_0xb9db('0xe'),_0x4dbc02,_0xb9db('0xf'));logger[_0xb9db('0x10')](_0xb9db('0x11'),_0x4dbc02,_0xb9db('0xf'),JSON[_0xb9db('0x12')](_0x3e55eb));if(_0x3e55eb['error']){if(_0x3e55eb[_0xb9db('0x13')][_0xb9db('0x14')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4dbc02,_0x3e55eb[_0xb9db('0x13')][_0xb9db('0x15')]);return _0x11bb46(_0x3e55eb[_0xb9db('0x13')][_0xb9db('0x15')]);}logger[_0xb9db('0x13')](_0xb9db('0xe'),_0x4dbc02,_0x3e55eb[_0xb9db('0x13')][_0xb9db('0x15')]);return _0x5243a2(_0x3e55eb[_0xb9db('0x13')]['message']);}else{logger[_0xb9db('0xd')](_0xb9db('0xe'),_0x4dbc02,_0xb9db('0xf'));_0x5243a2(_0x3e55eb[_0xb9db('0x16')][_0xb9db('0x15')]);}})['catch'](function(_0x47ae38){logger[_0xb9db('0x13')](_0xb9db('0xe'),_0x4dbc02,_0x47ae38);_0x11bb46(_0x47ae38);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1599bda..c0463b6 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 _0xb859=['download','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','/:id/download','isAuthenticated'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xb859,0xae));var _0x9b85=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xb859[_0xb5fc3e];return _0x2efc3c;};'use strict';var multer=require(_0x9b85('0x0'));var util=require(_0x9b85('0x1'));var path=require(_0x9b85('0x2'));var timeout=require(_0x9b85('0x3'));var express=require(_0x9b85('0x4'));var router=express[_0x9b85('0x5')]();var auth=require(_0x9b85('0x6'));var interaction=require(_0x9b85('0x7'));var config=require(_0x9b85('0x8'));var controller=require(_0x9b85('0x9'));router[_0x9b85('0xa')]('/',auth['isAuthenticated'](),controller[_0x9b85('0xb')]);router[_0x9b85('0xa')](_0x9b85('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9b85('0xa')](_0x9b85('0xd'),auth[_0x9b85('0xe')](),controller[_0x9b85('0xf')]);router[_0x9b85('0x10')]('/',auth[_0x9b85('0xe')](),controller[_0x9b85('0x11')]);router[_0x9b85('0x12')](_0x9b85('0xc'),auth[_0x9b85('0xe')](),controller[_0x9b85('0x13')]);router[_0x9b85('0x14')](_0x9b85('0xc'),auth[_0x9b85('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4015=['show','/:id/download','download','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x4831de,_0x3e0de0){var _0x1e0b8d=function(_0x1b98d3){while(--_0x1b98d3){_0x4831de['push'](_0x4831de['shift']());}};_0x1e0b8d(++_0x3e0de0);}(_0x4015,0x1d6));var _0x5401=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x4015[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x5401('0x0'));var util=require('util');var path=require(_0x5401('0x1'));var timeout=require(_0x5401('0x2'));var express=require(_0x5401('0x3'));var router=express[_0x5401('0x4')]();var auth=require(_0x5401('0x5'));var interaction=require(_0x5401('0x6'));var config=require(_0x5401('0x7'));var controller=require(_0x5401('0x8'));router[_0x5401('0x9')]('/',auth[_0x5401('0xa')](),controller[_0x5401('0xb')]);router['get'](_0x5401('0xc'),auth[_0x5401('0xa')](),controller[_0x5401('0xd')]);router[_0x5401('0x9')](_0x5401('0xe'),auth[_0x5401('0xa')](),controller[_0x5401('0xf')]);router[_0x5401('0x10')]('/',auth[_0x5401('0xa')](),controller['create']);router['put']('/:id',auth[_0x5401('0xa')](),controller[_0x5401('0x11')]);router[_0x5401('0x12')](_0x5401('0xc'),auth[_0x5401('0xa')](),controller[_0x5401('0x13')]);module[_0x5401('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 08692ee..a2d299b 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 _0xab0c=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x48494b,_0xa6ff68){var _0x2087e0=function(_0x518e6c){while(--_0x518e6c){_0x48494b['push'](_0x48494b['shift']());}};_0x2087e0(++_0xa6ff68);}(_0xab0c,0x12b));var _0xcab0=function(_0xa0686a,_0x2801fd){_0xa0686a=_0xa0686a-0x0;var _0x1d6c48=_0xab0c[_0xa0686a];return _0x1d6c48;};'use strict';var Sequelize=require(_0xcab0('0x0'));module['exports']={'field':{'type':Sequelize[_0xcab0('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xcab0('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xcab0('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xcab0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe2c3=['TEXT','STRING','BOOLEAN','exports'];(function(_0x2d6fed,_0x44c46b){var _0x59efbb=function(_0x596540){while(--_0x596540){_0x2d6fed['push'](_0x2d6fed['shift']());}};_0x59efbb(++_0x44c46b);}(_0xe2c3,0x1ab));var _0x3e2c=function(_0x33385c,_0x13ac69){_0x33385c=_0x33385c-0x0;var _0x14e17e=_0xe2c3[_0x33385c];return _0x14e17e;};'use strict';var Sequelize=require('sequelize');module[_0x3e2c('0x0')]={'field':{'type':Sequelize[_0x3e2c('0x1')]},'alias':{'type':Sequelize[_0x3e2c('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3e2c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3e2c('0x2')]},'custom':{'type':Sequelize[_0x3e2c('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 fae675f..19ce522 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 _0xb245=['findAll','rows','catch','show','params','options','create','body','bulkCreate','find','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','map','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','squel','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','reject','update','then','destroy','end','error','stack','name','index','AnalyticFieldReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xb245,0xf8));var _0x5b24=function(_0x2d690d,_0x4e5f6a){_0x2d690d=_0x2d690d-0x0;var _0x587f62=_0xb245[_0x2d690d];return _0x587f62;};'use strict';var pdf=require(_0x5b24('0x0'));var emlformat=require(_0x5b24('0x1'));var rimraf=require(_0x5b24('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b24('0x3'));var rp=require(_0x5b24('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b24('0x5'));var util=require(_0x5b24('0x6'));var path=require(_0x5b24('0x7'));var sox=require('sox');var csv=require(_0x5b24('0x8'));var ejs=require(_0x5b24('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b24('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b24('0xb'));var toCsv=require(_0x5b24('0x8'));var querystring=require('querystring');var Papa=require(_0x5b24('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5b24('0xd'));var hardwareService=require(_0x5b24('0xe'));var logger=require(_0x5b24('0xf'))(_0x5b24('0x10'));var utils=require(_0x5b24('0x11'));var config=require(_0x5b24('0x12'));var db=require(_0x5b24('0x13'))['db'];function respondWithStatusCode(_0x176a4d,_0x55d468){_0x55d468=_0x55d468||0xcc;return function(_0x337154){if(_0x337154){return _0x176a4d[_0x5b24('0x14')](_0x55d468);}return _0x176a4d[_0x5b24('0x15')](_0x55d468)['end']();};}function respondWithResult(_0x28b02b,_0x2ee72b){_0x2ee72b=_0x2ee72b||0xc8;return function(_0x158d8f){if(_0x158d8f){return _0x28b02b[_0x5b24('0x15')](_0x2ee72b)[_0x5b24('0x16')](_0x158d8f);}};}function respondWithFilteredResult(_0x274fd0,_0xfdb986){return function(_0x123329){if(_0x123329){var _0x191602=_0x123329[_0x5b24('0x17')],_0x4eff69=_0xfdb986['offset'],_0xe98dec=_0xfdb986['offset']+_0xfdb986[_0x5b24('0x18')],_0x27a535;if(_0xe98dec>=_0x191602){_0xe98dec=_0x191602;_0x27a535=0xc8;}else{_0x27a535=0xce;}_0x274fd0[_0x5b24('0x15')](_0x27a535);return _0x274fd0[_0x5b24('0x19')]('Content-Range',_0x4eff69+'-'+_0xe98dec+'/'+_0x191602)[_0x5b24('0x16')](_0x123329);}return null;};}function patchUpdates(_0x38131c){return function(_0x481f50){try{jsonpatch['apply'](_0x481f50,_0x38131c,!![]);}catch(_0x4523ee){return BPromise[_0x5b24('0x1a')](_0x4523ee);}return _0x481f50['save']();};}function saveUpdates(_0x39edd8,_0x4f50e9){return function(_0x312b50){if(_0x312b50){return _0x312b50[_0x5b24('0x1b')](_0x39edd8)[_0x5b24('0x1c')](function(_0x332aa0){return _0x332aa0;});}return null;};}function removeEntity(_0x2f2d0b,_0x14804f){return function(_0x5b6ab1){if(_0x5b6ab1){return _0x5b6ab1[_0x5b24('0x1d')]()[_0x5b24('0x1c')](function(){_0x2f2d0b[_0x5b24('0x15')](0xcc)[_0x5b24('0x1e')]();});}};}function handleEntityNotFound(_0x572cfc,_0x4ba7b7){return function(_0x293240){if(!_0x293240){_0x572cfc[_0x5b24('0x14')](0x194);}return _0x293240;};}function handleError(_0x458e72,_0x343e92){_0x343e92=_0x343e92||0x1f4;return function(_0x2f9d7c){logger[_0x5b24('0x1f')](_0x2f9d7c[_0x5b24('0x20')]);if(_0x2f9d7c[_0x5b24('0x21')]){delete _0x2f9d7c[_0x5b24('0x21')];}_0x458e72[_0x5b24('0x15')](_0x343e92)['send'](_0x2f9d7c);};}exports[_0x5b24('0x22')]=function(_0xfb4bae,_0x4cccd7){var _0x1a269d={},_0x522b8a={},_0x5b6314={'count':0x0,'rows':[]};var _0x5bf7e7=db[_0x5b24('0x23')][_0x5b24('0x24')];_0x522b8a['model']=_['keys'](_0x5bf7e7);_0x522b8a[_0x5b24('0x25')]=_[_0x5b24('0x26')](_0xfb4bae[_0x5b24('0x25')]);_0x522b8a[_0x5b24('0x27')]=_[_0x5b24('0x28')](_0x522b8a[_0x5b24('0x29')],_0x522b8a[_0x5b24('0x25')]);_0x1a269d[_0x5b24('0x2a')]=_[_0x5b24('0x28')](_0x522b8a[_0x5b24('0x29')],qs[_0x5b24('0x2b')](_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x2b')]));_0x1a269d[_0x5b24('0x2a')]=_0x1a269d[_0x5b24('0x2a')][_0x5b24('0x2c')]?_0x1a269d[_0x5b24('0x2a')]:_0x522b8a[_0x5b24('0x29')];if(!_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x2d')](_0x5b24('0x2e'))){_0x1a269d['limit']=qs[_0x5b24('0x18')](_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x18')]);_0x1a269d[_0x5b24('0x2f')]=qs['offset'](_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x2f')]);}_0x1a269d[_0x5b24('0x30')]=qs[_0x5b24('0x31')](_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x31')]);_0x1a269d[_0x5b24('0x32')]=qs['filters'](_[_0x5b24('0x33')](_0xfb4bae[_0x5b24('0x25')],_0x522b8a[_0x5b24('0x27')]));if(_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x34')]){_0x1a269d['where']=_[_0x5b24('0x35')](_0x1a269d[_0x5b24('0x32')],{'$or':_['map'](_0x5bf7e7,function(_0x962dc6){if(_0x962dc6[_0x5b24('0x36')][_0x5b24('0x37')]!==_0x5b24('0x38')){var _0x2695b4={};_0x2695b4[_0x962dc6[_0x5b24('0x39')]]={'$like':'%'+_0xfb4bae['query'][_0x5b24('0x34')]+'%'};return _0x2695b4;}})});}_0x1a269d=_[_0x5b24('0x35')]({},_0x1a269d,_0xfb4bae['options']);var _0x46475d={'where':_0x1a269d['where']};return db[_0x5b24('0x23')][_0x5b24('0x17')](_0x46475d)['then'](function(_0xf4bba6){_0x5b6314[_0x5b24('0x17')]=_0xf4bba6;if(_0xfb4bae[_0x5b24('0x25')][_0x5b24('0x3a')]){_0x1a269d[_0x5b24('0x3b')]=[{'all':!![]}];}return db[_0x5b24('0x23')][_0x5b24('0x3c')](_0x1a269d);})[_0x5b24('0x1c')](function(_0x37faaa){_0x5b6314[_0x5b24('0x3d')]=_0x37faaa;return _0x5b6314;})['then'](respondWithFilteredResult(_0x4cccd7,_0x1a269d))[_0x5b24('0x3e')](handleError(_0x4cccd7,null));};exports[_0x5b24('0x3f')]=function(_0x31d18a,_0x5bc26e){var _0x1c44b4={'raw':![],'where':{'id':_0x31d18a[_0x5b24('0x40')]['id']}},_0x4594d2={};_0x4594d2[_0x5b24('0x29')]=_[_0x5b24('0x26')](db[_0x5b24('0x23')][_0x5b24('0x24')]);_0x4594d2[_0x5b24('0x25')]=_[_0x5b24('0x26')](_0x31d18a[_0x5b24('0x25')]);_0x4594d2[_0x5b24('0x27')]=_[_0x5b24('0x28')](_0x4594d2['model'],_0x4594d2['query']);_0x1c44b4[_0x5b24('0x2a')]=_[_0x5b24('0x28')](_0x4594d2[_0x5b24('0x29')],qs[_0x5b24('0x2b')](_0x31d18a[_0x5b24('0x25')][_0x5b24('0x2b')]));_0x1c44b4[_0x5b24('0x2a')]=_0x1c44b4[_0x5b24('0x2a')][_0x5b24('0x2c')]?_0x1c44b4[_0x5b24('0x2a')]:_0x4594d2[_0x5b24('0x29')];if(_0x31d18a[_0x5b24('0x25')]['includeAll']){_0x1c44b4[_0x5b24('0x3b')]=[{'all':!![]}];}_0x1c44b4=_[_0x5b24('0x35')]({},_0x1c44b4,_0x31d18a[_0x5b24('0x41')]);return db[_0x5b24('0x23')]['find'](_0x1c44b4)[_0x5b24('0x1c')](handleEntityNotFound(_0x5bc26e,null))[_0x5b24('0x1c')](respondWithResult(_0x5bc26e,null))['catch'](handleError(_0x5bc26e,null));};exports[_0x5b24('0x42')]=function(_0x49898e,_0x26e4c6){return db[_0x5b24('0x23')][_0x5b24('0x42')](_0x49898e[_0x5b24('0x43')],{})[_0x5b24('0x1c')](respondWithResult(_0x26e4c6,0xc9))['catch'](handleError(_0x26e4c6,null));};exports[_0x5b24('0x44')]=function(_0x122f35,_0x21d1d3){return db[_0x5b24('0x23')][_0x5b24('0x44')](_0x122f35[_0x5b24('0x43')],{'raw':![],'individualHooks':!![]})[_0x5b24('0x1c')](respondWithResult(_0x21d1d3,0xc9))[_0x5b24('0x3e')](handleError(_0x21d1d3,null));};exports['update']=function(_0x46935d,_0x208b61){if(_0x46935d[_0x5b24('0x43')]['id']){delete _0x46935d[_0x5b24('0x43')]['id'];}return db[_0x5b24('0x23')][_0x5b24('0x45')]({'where':{'id':_0x46935d[_0x5b24('0x40')]['id']}})[_0x5b24('0x1c')](handleEntityNotFound(_0x208b61,null))[_0x5b24('0x1c')](saveUpdates(_0x46935d[_0x5b24('0x43')],null))[_0x5b24('0x1c')](respondWithResult(_0x208b61,null))['catch'](handleError(_0x208b61,null));};exports['destroy']=function(_0x79097b,_0x45dd85){return db['AnalyticFieldReport'][_0x5b24('0x45')]({'where':{'id':_0x79097b['params']['id']}})['then'](handleEntityNotFound(_0x45dd85,null))[_0x5b24('0x1c')](removeEntity(_0x45dd85,null))[_0x5b24('0x3e')](handleError(_0x45dd85,null));};exports['bulkDestroy']=function(_0x26cdef,_0x548fbe){return db[_0x5b24('0x23')]['destroy']({'where':{'id':_0x26cdef['query'][_0x5b24('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x5b24('0x1c')](respondWithResult(_0x548fbe,0xcc))[_0x5b24('0x3e')](handleError(_0x548fbe,null));};exports[_0x5b24('0x47')]=function(_0x668d2,_0x18e1bf,_0x487b26){return db[_0x5b24('0x48')][_0x5b24('0x49')]({'where':{'id':_0x668d2[_0x5b24('0x40')]['id']}})[_0x5b24('0x1c')](handleEntityNotFound(_0x18e1bf,null))[_0x5b24('0x1c')](function(_0x1667f0){if(_0x1667f0){return db[_0x5b24('0x4a')][_0x5b24('0x4b')](function(_0x54e453){return db[_0x5b24('0x23')][_0x5b24('0x1d')]({'where':{'CustomReportId':_0x668d2['params']['id']},'transaction':_0x54e453})['then'](function(_0x5e4e5a){var _0x14f70b=_[_0x5b24('0x4c')](_0x668d2[_0x5b24('0x43')],function(_0x353999){delete _0x353999['id'];_0x353999['CustomReportId']=_0x668d2[_0x5b24('0x40')]['id'];return _0x353999;});return db[_0x5b24('0x23')][_0x5b24('0x44')](_0x14f70b,{'transaction':_0x54e453});});})[_0x5b24('0x1c')](function(){return db['AnalyticFieldReport'][_0x5b24('0x3c')]({'where':{'CustomReportId':_0x668d2['params']['id']}});});}})[_0x5b24('0x1c')](respondWithResult(_0x18e1bf,null))[_0x5b24('0x3e')](handleError(_0x18e1bf,null));}; \ No newline at end of file +var _0xec90=['includeAll','catch','create','bulkCreate','update','body','find','bulkDestroy','ids','findOne','sequelize','transaction','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','json','count','offset','limit','status','set','apply','reject','save','then','destroy','sendStatus','name','index','AnalyticFieldReport','rawAttributes','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','params'];(function(_0x4eebb8,_0x1c1f95){var _0x4485ed=function(_0x261b50){while(--_0x261b50){_0x4eebb8['push'](_0x4eebb8['shift']());}};_0x4485ed(++_0x1c1f95);}(_0xec90,0x19c));var _0x0ec9=function(_0x3f36f2,_0x380621){_0x3f36f2=_0x3f36f2-0x0;var _0x15821b=_0xec90[_0x3f36f2];return _0x15821b;};'use strict';var pdf=require(_0x0ec9('0x0'));var emlformat=require(_0x0ec9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0ec9('0x2'));var jsonpatch=require(_0x0ec9('0x3'));var rp=require(_0x0ec9('0x4'));var moment=require(_0x0ec9('0x5'));var BPromise=require(_0x0ec9('0x6'));var Mustache=require(_0x0ec9('0x7'));var util=require(_0x0ec9('0x8'));var path=require(_0x0ec9('0x9'));var sox=require(_0x0ec9('0xa'));var csv=require(_0x0ec9('0xb'));var ejs=require(_0x0ec9('0xc'));var fs=require('fs');var _=require(_0x0ec9('0xd'));var squel=require('squel');var crypto=require(_0x0ec9('0xe'));var jsforce=require(_0x0ec9('0xf'));var deskjs=require(_0x0ec9('0x10'));var toCsv=require(_0x0ec9('0xb'));var querystring=require(_0x0ec9('0x11'));var Papa=require(_0x0ec9('0x12'));var Redis=require(_0x0ec9('0x13'));var authService=require(_0x0ec9('0x14'));var qs=require(_0x0ec9('0x15'));var hardwareService=require(_0x0ec9('0x16'));var logger=require(_0x0ec9('0x17'))('api');var utils=require(_0x0ec9('0x18'));var config=require(_0x0ec9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f09e5,_0x435129){_0x435129=_0x435129||0xcc;return function(_0x3c2b58){if(_0x3c2b58){return _0x3f09e5['sendStatus'](_0x435129);}return _0x3f09e5['status'](_0x435129)[_0x0ec9('0x1a')]();};}function respondWithResult(_0x1bacb,_0x127776){_0x127776=_0x127776||0xc8;return function(_0x26ac44){if(_0x26ac44){return _0x1bacb['status'](_0x127776)[_0x0ec9('0x1b')](_0x26ac44);}};}function respondWithFilteredResult(_0x5288b7,_0x95ea17){return function(_0x557d84){if(_0x557d84){var _0x2ffa68=_0x557d84[_0x0ec9('0x1c')],_0x239680=_0x95ea17[_0x0ec9('0x1d')],_0x2ec1d8=_0x95ea17[_0x0ec9('0x1d')]+_0x95ea17[_0x0ec9('0x1e')],_0x5ae01c;if(_0x2ec1d8>=_0x2ffa68){_0x2ec1d8=_0x2ffa68;_0x5ae01c=0xc8;}else{_0x5ae01c=0xce;}_0x5288b7[_0x0ec9('0x1f')](_0x5ae01c);return _0x5288b7[_0x0ec9('0x20')]('Content-Range',_0x239680+'-'+_0x2ec1d8+'/'+_0x2ffa68)[_0x0ec9('0x1b')](_0x557d84);}return null;};}function patchUpdates(_0x7f0a39){return function(_0x11e60f){try{jsonpatch[_0x0ec9('0x21')](_0x11e60f,_0x7f0a39,!![]);}catch(_0x560142){return BPromise[_0x0ec9('0x22')](_0x560142);}return _0x11e60f[_0x0ec9('0x23')]();};}function saveUpdates(_0x34ca0d,_0xfad2bc){return function(_0x2a711f){if(_0x2a711f){return _0x2a711f['update'](_0x34ca0d)[_0x0ec9('0x24')](function(_0x401a09){return _0x401a09;});}return null;};}function removeEntity(_0x1ad7e3,_0x58bcbf){return function(_0x439355){if(_0x439355){return _0x439355[_0x0ec9('0x25')]()['then'](function(){_0x1ad7e3['status'](0xcc)[_0x0ec9('0x1a')]();});}};}function handleEntityNotFound(_0x5962bd,_0x3eeb25){return function(_0x35f0d5){if(!_0x35f0d5){_0x5962bd[_0x0ec9('0x26')](0x194);}return _0x35f0d5;};}function handleError(_0x50c8d1,_0x9e71ef){_0x9e71ef=_0x9e71ef||0x1f4;return function(_0x2bbaae){logger['error'](_0x2bbaae['stack']);if(_0x2bbaae[_0x0ec9('0x27')]){delete _0x2bbaae['name'];}_0x50c8d1['status'](_0x9e71ef)['send'](_0x2bbaae);};}exports[_0x0ec9('0x28')]=function(_0xbc4169,_0x403b00){var _0x291b7b={},_0x3cf150={},_0x27aaf4={'count':0x0,'rows':[]};var _0x4c1d17=db[_0x0ec9('0x29')][_0x0ec9('0x2a')];_0x3cf150['model']=_['keys'](_0x4c1d17);_0x3cf150[_0x0ec9('0x2b')]=_[_0x0ec9('0x2c')](_0xbc4169[_0x0ec9('0x2b')]);_0x3cf150[_0x0ec9('0x2d')]=_['intersection'](_0x3cf150['model'],_0x3cf150[_0x0ec9('0x2b')]);_0x291b7b[_0x0ec9('0x2e')]=_[_0x0ec9('0x2f')](_0x3cf150[_0x0ec9('0x30')],qs[_0x0ec9('0x31')](_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x31')]));_0x291b7b['attributes']=_0x291b7b[_0x0ec9('0x2e')]['length']?_0x291b7b['attributes']:_0x3cf150[_0x0ec9('0x30')];if(!_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x32')](_0x0ec9('0x33'))){_0x291b7b[_0x0ec9('0x1e')]=qs['limit'](_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x1e')]);_0x291b7b[_0x0ec9('0x1d')]=qs['offset'](_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x1d')]);}_0x291b7b[_0x0ec9('0x34')]=qs[_0x0ec9('0x35')](_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x35')]);_0x291b7b['where']=qs[_0x0ec9('0x2d')](_[_0x0ec9('0x36')](_0xbc4169['query'],_0x3cf150[_0x0ec9('0x2d')]));if(_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x37')]){_0x291b7b[_0x0ec9('0x38')]=_[_0x0ec9('0x39')](_0x291b7b['where'],{'$or':_[_0x0ec9('0x3a')](_0x4c1d17,function(_0x1ef48c){if(_0x1ef48c[_0x0ec9('0x3b')][_0x0ec9('0x3c')]!==_0x0ec9('0x3d')){var _0x5a403a={};_0x5a403a[_0x1ef48c[_0x0ec9('0x3e')]]={'$like':'%'+_0xbc4169[_0x0ec9('0x2b')][_0x0ec9('0x37')]+'%'};return _0x5a403a;}})});}_0x291b7b=_['merge']({},_0x291b7b,_0xbc4169[_0x0ec9('0x3f')]);var _0x591278={'where':_0x291b7b[_0x0ec9('0x38')]};return db[_0x0ec9('0x29')][_0x0ec9('0x1c')](_0x591278)[_0x0ec9('0x24')](function(_0x349b59){_0x27aaf4[_0x0ec9('0x1c')]=_0x349b59;if(_0xbc4169['query']['includeAll']){_0x291b7b[_0x0ec9('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0ec9('0x41')](_0x291b7b);})[_0x0ec9('0x24')](function(_0x424923){_0x27aaf4['rows']=_0x424923;return _0x27aaf4;})['then'](respondWithFilteredResult(_0x403b00,_0x291b7b))['catch'](handleError(_0x403b00,null));};exports[_0x0ec9('0x42')]=function(_0x3d3a46,_0xe87ff0){var _0x1469da={'raw':![],'where':{'id':_0x3d3a46[_0x0ec9('0x43')]['id']}},_0x2ea0fb={};_0x2ea0fb[_0x0ec9('0x30')]=_[_0x0ec9('0x2c')](db[_0x0ec9('0x29')]['rawAttributes']);_0x2ea0fb['query']=_[_0x0ec9('0x2c')](_0x3d3a46[_0x0ec9('0x2b')]);_0x2ea0fb[_0x0ec9('0x2d')]=_['intersection'](_0x2ea0fb[_0x0ec9('0x30')],_0x2ea0fb['query']);_0x1469da[_0x0ec9('0x2e')]=_[_0x0ec9('0x2f')](_0x2ea0fb[_0x0ec9('0x30')],qs[_0x0ec9('0x31')](_0x3d3a46['query'][_0x0ec9('0x31')]));_0x1469da[_0x0ec9('0x2e')]=_0x1469da[_0x0ec9('0x2e')]['length']?_0x1469da[_0x0ec9('0x2e')]:_0x2ea0fb['model'];if(_0x3d3a46['query'][_0x0ec9('0x44')]){_0x1469da[_0x0ec9('0x40')]=[{'all':!![]}];}_0x1469da=_[_0x0ec9('0x39')]({},_0x1469da,_0x3d3a46['options']);return db[_0x0ec9('0x29')]['find'](_0x1469da)[_0x0ec9('0x24')](handleEntityNotFound(_0xe87ff0,null))['then'](respondWithResult(_0xe87ff0,null))[_0x0ec9('0x45')](handleError(_0xe87ff0,null));};exports[_0x0ec9('0x46')]=function(_0x576549,_0x37f4e7){return db[_0x0ec9('0x29')][_0x0ec9('0x46')](_0x576549['body'],{})[_0x0ec9('0x24')](respondWithResult(_0x37f4e7,0xc9))[_0x0ec9('0x45')](handleError(_0x37f4e7,null));};exports[_0x0ec9('0x47')]=function(_0x19c5d1,_0x324b56){return db[_0x0ec9('0x29')][_0x0ec9('0x47')](_0x19c5d1['body'],{'raw':![],'individualHooks':!![]})[_0x0ec9('0x24')](respondWithResult(_0x324b56,0xc9))['catch'](handleError(_0x324b56,null));};exports[_0x0ec9('0x48')]=function(_0x354945,_0x3270c0){if(_0x354945[_0x0ec9('0x49')]['id']){delete _0x354945[_0x0ec9('0x49')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x354945[_0x0ec9('0x43')]['id']}})[_0x0ec9('0x24')](handleEntityNotFound(_0x3270c0,null))[_0x0ec9('0x24')](saveUpdates(_0x354945[_0x0ec9('0x49')],null))[_0x0ec9('0x24')](respondWithResult(_0x3270c0,null))[_0x0ec9('0x45')](handleError(_0x3270c0,null));};exports[_0x0ec9('0x25')]=function(_0x53ba30,_0x55b593){return db[_0x0ec9('0x29')][_0x0ec9('0x4a')]({'where':{'id':_0x53ba30[_0x0ec9('0x43')]['id']}})[_0x0ec9('0x24')](handleEntityNotFound(_0x55b593,null))[_0x0ec9('0x24')](removeEntity(_0x55b593,null))['catch'](handleError(_0x55b593,null));};exports[_0x0ec9('0x4b')]=function(_0x23d97d,_0x5d6c93){return db[_0x0ec9('0x29')][_0x0ec9('0x25')]({'where':{'id':_0x23d97d['query'][_0x0ec9('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x0ec9('0x24')](respondWithResult(_0x5d6c93,0xcc))[_0x0ec9('0x45')](handleError(_0x5d6c93,null));};exports['addFields']=function(_0x3adc5b,_0x36d2a1,_0x3497f6){return db['AnalyticCustomReport'][_0x0ec9('0x4d')]({'where':{'id':_0x3adc5b[_0x0ec9('0x43')]['id']}})[_0x0ec9('0x24')](handleEntityNotFound(_0x36d2a1,null))[_0x0ec9('0x24')](function(_0x24838b){if(_0x24838b){return db[_0x0ec9('0x4e')][_0x0ec9('0x4f')](function(_0x29a2d5){return db[_0x0ec9('0x29')][_0x0ec9('0x25')]({'where':{'CustomReportId':_0x3adc5b[_0x0ec9('0x43')]['id']},'transaction':_0x29a2d5})[_0x0ec9('0x24')](function(_0x4235f9){var _0x544654=_[_0x0ec9('0x3a')](_0x3adc5b[_0x0ec9('0x49')],function(_0x51b559){delete _0x51b559['id'];_0x51b559['CustomReportId']=_0x3adc5b[_0x0ec9('0x43')]['id'];return _0x51b559;});return db['AnalyticFieldReport'][_0x0ec9('0x47')](_0x544654,{'transaction':_0x29a2d5});});})[_0x0ec9('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x3adc5b[_0x0ec9('0x43')]['id']}});});}})[_0x0ec9('0x24')](respondWithResult(_0x36d2a1,null))[_0x0ec9('0x45')](handleError(_0x36d2a1,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c3970e1..98a9f66 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 _0x4ea7=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x12a110,_0x2f5f52){var _0x1110c5=function(_0x18680c){while(--_0x18680c){_0x12a110['push'](_0x12a110['shift']());}};_0x1110c5(++_0x2f5f52);}(_0x4ea7,0xed));var _0x74ea=function(_0x5b0df1,_0x2e1e83){_0x5b0df1=_0x5b0df1-0x0;var _0x270e9b=_0x4ea7[_0x5b0df1];return _0x270e9b;};'use strict';var _=require(_0x74ea('0x0'));var util=require(_0x74ea('0x1'));var logger=require('../../config/logger')(_0x74ea('0x2'));var moment=require(_0x74ea('0x3'));var BPromise=require(_0x74ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74ea('0x5'));var rimraf=require(_0x74ea('0x6'));var config=require(_0x74ea('0x7'));var attributes=require(_0x74ea('0x8'));module[_0x74ea('0x9')]=function(_0x1629e5,_0x3feb81){return _0x1629e5[_0x74ea('0xa')](_0x74ea('0xb'),attributes,{'tableName':_0x74ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2cc=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xa2cc,0x1c8));var _0xca2c=function(_0x29bb90,_0x306973){_0x29bb90=_0x29bb90-0x0;var _0x5acd71=_0xa2cc[_0x29bb90];return _0x5acd71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca2c('0x0'))(_0xca2c('0x1'));var moment=require(_0xca2c('0x2'));var BPromise=require('bluebird');var rp=require(_0xca2c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca2c('0x4'));var config=require(_0xca2c('0x5'));var attributes=require(_0xca2c('0x6'));module[_0xca2c('0x7')]=function(_0x2fc276,_0x2a3938){return _0x2fc276[_0xca2c('0x8')](_0xca2c('0x9'),attributes,{'tableName':_0xca2c('0xa'),'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 7f7adfb..a3ea717 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 _0xf072=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0xf072,0x1cf));var _0x2f07=function(_0x6187b,_0x8574e0){_0x6187b=_0x6187b-0x0;var _0x4383c5=_0xf072[_0x6187b];return _0x4383c5;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235418,_0xf73d1a,_0x33b99c){return new BPromise(function(_0x379b2e,_0x4746c2){return client[_0x2f07('0xb')](_0x235418,_0x33b99c)[_0x2f07('0xc')](function(_0x2e372c){logger[_0x2f07('0xd')](_0x2f07('0xe'),_0xf73d1a,_0x2f07('0xf'));logger['debug'](_0x2f07('0x10'),_0xf73d1a,_0x2f07('0xf'),JSON[_0x2f07('0x11')](_0x2e372c));if(_0x2e372c[_0x2f07('0x12')]){if(_0x2e372c['error']['code']===0x1f4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x2e372c['error'][_0x2f07('0x13')]);return _0x4746c2(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}logger['error'](_0x2f07('0xe'),_0xf73d1a,_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);return _0x379b2e(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}else{logger[_0x2f07('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0xf73d1a,_0x2f07('0xf'));_0x379b2e(_0x2e372c['result'][_0x2f07('0x13')]);}})[_0x2f07('0x14')](function(_0x1dace4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x1dace4);_0x4746c2(_0x1dace4);});});} \ No newline at end of file +var _0xf072=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xf072,0x1cf));var _0x2f07=function(_0x19d575,_0x40ab33){_0x19d575=_0x19d575-0x0;var _0x4d1eff=_0xf072[_0x19d575];return _0x4d1eff;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235418,_0xf73d1a,_0x33b99c){return new BPromise(function(_0x379b2e,_0x4746c2){return client[_0x2f07('0xb')](_0x235418,_0x33b99c)[_0x2f07('0xc')](function(_0x2e372c){logger[_0x2f07('0xd')](_0x2f07('0xe'),_0xf73d1a,_0x2f07('0xf'));logger['debug'](_0x2f07('0x10'),_0xf73d1a,_0x2f07('0xf'),JSON[_0x2f07('0x11')](_0x2e372c));if(_0x2e372c[_0x2f07('0x12')]){if(_0x2e372c['error']['code']===0x1f4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x2e372c['error'][_0x2f07('0x13')]);return _0x4746c2(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}logger['error'](_0x2f07('0xe'),_0xf73d1a,_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);return _0x379b2e(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}else{logger[_0x2f07('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0xf73d1a,_0x2f07('0xf'));_0x379b2e(_0x2e372c['result'][_0x2f07('0x13')]);}})[_0x2f07('0x14')](function(_0x1dace4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x1dace4);_0x4746c2(_0x1dace4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 8dfa9d0..9bf762e 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 _0x579c=['./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x481dcf,_0x2126b5){var _0x4bc199=function(_0x404367){while(--_0x404367){_0x481dcf['push'](_0x481dcf['shift']());}};_0x4bc199(++_0x2126b5);}(_0x579c,0xda));var _0xc579=function(_0x1791a7,_0x528406){_0x1791a7=_0x1791a7-0x0;var _0x224858=_0x579c[_0x1791a7];return _0x224858;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var auth=require(_0xc579('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc579('0x6'));var controller=require(_0xc579('0x7'));router[_0xc579('0x8')]('/',auth[_0xc579('0x9')](),controller[_0xc579('0xa')]);router[_0xc579('0x8')](_0xc579('0xb'),auth['isAuthenticated'](),controller[_0xc579('0xc')]);router[_0xc579('0xd')]('/',auth[_0xc579('0x9')](),controller[_0xc579('0xe')]);router[_0xc579('0xd')](_0xc579('0xf'),auth[_0xc579('0x9')](),controller[_0xc579('0x10')]);router['post'](_0xc579('0x11'),auth[_0xc579('0x9')](),controller[_0xc579('0x12')]);router[_0xc579('0x13')](_0xc579('0xb'),auth[_0xc579('0x9')](),controller[_0xc579('0x14')]);router[_0xc579('0x15')](_0xc579('0x16'),auth[_0xc579('0x9')](),controller[_0xc579('0x17')]);router['delete'](_0xc579('0xb'),auth['isAuthenticated'](),controller[_0xc579('0x18')]);module['exports']=router; \ No newline at end of file +var _0x593e=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','/create_many','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout'];(function(_0x3b7583,_0x575760){var _0x3e6663=function(_0x49d7a1){while(--_0x49d7a1){_0x3b7583['push'](_0x3b7583['shift']());}};_0x3e6663(++_0x575760);}(_0x593e,0xcb));var _0xe593=function(_0x570a75,_0x133d1a){_0x570a75=_0x570a75-0x0;var _0x56d06c=_0x593e[_0x570a75];return _0x56d06c;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var auth=require(_0xe593('0x6'));var interaction=require(_0xe593('0x7'));var config=require('../../config/environment');var controller=require(_0xe593('0x8'));router[_0xe593('0x9')]('/',auth[_0xe593('0xa')](),controller[_0xe593('0xb')]);router[_0xe593('0x9')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0xd')]);router[_0xe593('0xe')]('/',auth[_0xe593('0xa')](),controller['create']);router[_0xe593('0xe')](_0xe593('0xf'),auth[_0xe593('0xa')](),controller['bulkCreate']);router['post'](_0xe593('0x10'),auth[_0xe593('0xa')](),controller[_0xe593('0x11')]);router['put'](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0x12')]);router[_0xe593('0x13')](_0xe593('0x14'),auth[_0xe593('0xa')](),controller[_0xe593('0x15')]);router[_0xe593('0x13')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller['destroy']);module[_0xe593('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index b913a62..973b846 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 _0x4eb7=['sequelize','exports','STRING'];(function(_0x2f91a6,_0x4e44ff){var _0x324cb5=function(_0x452102){while(--_0x452102){_0x2f91a6['push'](_0x2f91a6['shift']());}};_0x324cb5(++_0x4e44ff);}(_0x4eb7,0x8d));var _0x74eb=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x4eb7[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x74eb('0x0'));module[_0x74eb('0x1')]={'name':{'type':Sequelize[_0x74eb('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x74eb('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x74eb('0x2')]}}; \ No newline at end of file +var _0x21c9=['TEXT','STRING','name'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x21c9,0xf4));var _0x921c=function(_0x4b8481,_0x2430ca){_0x4b8481=_0x4b8481-0x0;var _0x59ef55=_0x21c9[_0x4b8481];return _0x59ef55;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x921c('0x0')],'allowNull':![],'unique':_0x921c('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x921c('0x2')]},'description':{'type':Sequelize[_0x921c('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b52f3ba..bbd0c21 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 _0x42dd=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','save','update','then','destroy','Metrics','UserProfileResource','error','stack','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','params','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x42dd,0x142));var _0xd42d=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x42dd[_0x4a3898];return _0x25ceb0;};'use strict';var pdf=require(_0xd42d('0x0'));var emlformat=require(_0xd42d('0x1'));var rimraf=require(_0xd42d('0x2'));var zipdir=require(_0xd42d('0x3'));var jsonpatch=require(_0xd42d('0x4'));var rp=require(_0xd42d('0x5'));var moment=require(_0xd42d('0x6'));var BPromise=require(_0xd42d('0x7'));var Mustache=require(_0xd42d('0x8'));var util=require(_0xd42d('0x9'));var path=require(_0xd42d('0xa'));var sox=require(_0xd42d('0xb'));var csv=require(_0xd42d('0xc'));var ejs=require(_0xd42d('0xd'));var fs=require('fs');var _=require(_0xd42d('0xe'));var squel=require('squel');var crypto=require(_0xd42d('0xf'));var jsforce=require(_0xd42d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd42d('0xc'));var querystring=require(_0xd42d('0x11'));var Papa=require(_0xd42d('0x12'));var Redis=require(_0xd42d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd42d('0x14'));var hardwareService=require(_0xd42d('0x15'));var logger=require(_0xd42d('0x16'))(_0xd42d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd42d('0x18'))['db'];function respondWithStatusCode(_0x272c89,_0x1658b1){_0x1658b1=_0x1658b1||0xcc;return function(_0x3c6b81){if(_0x3c6b81){return _0x272c89[_0xd42d('0x19')](_0x1658b1);}return _0x272c89['status'](_0x1658b1)[_0xd42d('0x1a')]();};}function respondWithResult(_0x11dbbf,_0x4c6c43){_0x4c6c43=_0x4c6c43||0xc8;return function(_0x11cbc4){if(_0x11cbc4){return _0x11dbbf[_0xd42d('0x1b')](_0x4c6c43)[_0xd42d('0x1c')](_0x11cbc4);}};}function respondWithFilteredResult(_0x56b9c5,_0x49936f){return function(_0x11d341){if(_0x11d341){var _0x59f53c=_0x11d341[_0xd42d('0x1d')],_0x2d9d27=_0x49936f[_0xd42d('0x1e')],_0x2425e9=_0x49936f[_0xd42d('0x1e')]+_0x49936f['limit'],_0x48dfd6;if(_0x2425e9>=_0x59f53c){_0x2425e9=_0x59f53c;_0x48dfd6=0xc8;}else{_0x48dfd6=0xce;}_0x56b9c5['status'](_0x48dfd6);return _0x56b9c5['set'](_0xd42d('0x1f'),_0x2d9d27+'-'+_0x2425e9+'/'+_0x59f53c)[_0xd42d('0x1c')](_0x11d341);}return null;};}function patchUpdates(_0x1fa1be){return function(_0x5d36f5){try{jsonpatch[_0xd42d('0x20')](_0x5d36f5,_0x1fa1be,!![]);}catch(_0x5146be){return BPromise['reject'](_0x5146be);}return _0x5d36f5[_0xd42d('0x21')]();};}function saveUpdates(_0xca44d5,_0x54f150){return function(_0x1fd319){if(_0x1fd319){return _0x1fd319[_0xd42d('0x22')](_0xca44d5)[_0xd42d('0x23')](function(_0x4cebef){return _0x4cebef;});}return null;};}function removeEntity(_0x48517f,_0x215ec3){return function(_0x365f49){if(_0x365f49){return _0x365f49[_0xd42d('0x24')]()[_0xd42d('0x23')](function(){var _0x3aabb6=_0x365f49['get']({'plain':!![]});var _0x2155b2=_0xd42d('0x25');return db[_0xd42d('0x26')]['destroy']({'where':{'type':_0x2155b2,'resourceId':_0x3aabb6['id']}})[_0xd42d('0x23')](function(){return _0x365f49;});})[_0xd42d('0x23')](function(){_0x48517f['status'](0xcc)[_0xd42d('0x1a')]();});}};}function handleEntityNotFound(_0x37b30,_0x16465b){return function(_0x71d990){if(!_0x71d990){_0x37b30['sendStatus'](0x194);}return _0x71d990;};}function handleError(_0xc04796,_0x1f1bba){_0x1f1bba=_0x1f1bba||0x1f4;return function(_0x3fb707){logger[_0xd42d('0x27')](_0x3fb707[_0xd42d('0x28')]);if(_0x3fb707['name']){delete _0x3fb707[_0xd42d('0x29')];}_0xc04796[_0xd42d('0x1b')](_0x1f1bba)[_0xd42d('0x2a')](_0x3fb707);};}exports[_0xd42d('0x2b')]=function(_0x35769b,_0x1fc4e0){var _0x40cb15={},_0x4b65b5={},_0x3242c0={'count':0x0,'rows':[]};var _0x4aca44=db[_0xd42d('0x2c')][_0xd42d('0x2d')];_0x4b65b5[_0xd42d('0x2e')]=_[_0xd42d('0x2f')](_0x4aca44);_0x4b65b5[_0xd42d('0x30')]=_[_0xd42d('0x2f')](_0x35769b[_0xd42d('0x30')]);_0x4b65b5[_0xd42d('0x31')]=_[_0xd42d('0x32')](_0x4b65b5[_0xd42d('0x2e')],_0x4b65b5['query']);_0x40cb15['attributes']=_[_0xd42d('0x32')](_0x4b65b5[_0xd42d('0x2e')],qs[_0xd42d('0x33')](_0x35769b[_0xd42d('0x30')][_0xd42d('0x33')]));_0x40cb15[_0xd42d('0x34')]=_0x40cb15[_0xd42d('0x34')]['length']?_0x40cb15['attributes']:_0x4b65b5['model'];if(!_0x35769b[_0xd42d('0x30')][_0xd42d('0x35')](_0xd42d('0x36'))){_0x40cb15[_0xd42d('0x37')]=qs[_0xd42d('0x37')](_0x35769b['query'][_0xd42d('0x37')]);_0x40cb15[_0xd42d('0x1e')]=qs[_0xd42d('0x1e')](_0x35769b[_0xd42d('0x30')][_0xd42d('0x1e')]);}_0x40cb15[_0xd42d('0x38')]=qs[_0xd42d('0x39')](_0x35769b[_0xd42d('0x30')][_0xd42d('0x39')]);_0x40cb15[_0xd42d('0x3a')]=qs[_0xd42d('0x31')](_[_0xd42d('0x3b')](_0x35769b['query'],_0x4b65b5[_0xd42d('0x31')]));if(_0x35769b[_0xd42d('0x30')][_0xd42d('0x3c')]){_0x40cb15[_0xd42d('0x3a')]=_[_0xd42d('0x3d')](_0x40cb15[_0xd42d('0x3a')],{'$or':_[_0xd42d('0x3e')](_0x4aca44,function(_0x16b041){if(_0x16b041[_0xd42d('0x3f')]['key']!==_0xd42d('0x40')){var _0x44d5f5={};_0x44d5f5[_0x16b041[_0xd42d('0x41')]]={'$like':'%'+_0x35769b[_0xd42d('0x30')]['filter']+'%'};return _0x44d5f5;}})});}_0x40cb15=_['merge']({},_0x40cb15,_0x35769b[_0xd42d('0x42')]);var _0x21452f={'where':_0x40cb15[_0xd42d('0x3a')]};return db[_0xd42d('0x2c')][_0xd42d('0x1d')](_0x21452f)['then'](function(_0xf89456){_0x3242c0['count']=_0xf89456;if(_0x35769b[_0xd42d('0x30')][_0xd42d('0x43')]){_0x40cb15['include']=[{'all':!![]}];}return db[_0xd42d('0x2c')][_0xd42d('0x44')](_0x40cb15);})[_0xd42d('0x23')](function(_0xb5ce4c){_0x3242c0[_0xd42d('0x45')]=_0xb5ce4c;return _0x3242c0;})[_0xd42d('0x23')](respondWithFilteredResult(_0x1fc4e0,_0x40cb15))['catch'](handleError(_0x1fc4e0,null));};exports['show']=function(_0x2f0438,_0x4c0948){var _0x235c2e={'raw':!![],'where':{'id':_0x2f0438[_0xd42d('0x46')]['id']}},_0x69f53={};_0x69f53[_0xd42d('0x2e')]=_[_0xd42d('0x2f')](db['AnalyticMetric'][_0xd42d('0x2d')]);_0x69f53[_0xd42d('0x30')]=_[_0xd42d('0x2f')](_0x2f0438[_0xd42d('0x30')]);_0x69f53[_0xd42d('0x31')]=_[_0xd42d('0x32')](_0x69f53[_0xd42d('0x2e')],_0x69f53[_0xd42d('0x30')]);_0x235c2e['attributes']=_[_0xd42d('0x32')](_0x69f53[_0xd42d('0x2e')],qs['fields'](_0x2f0438[_0xd42d('0x30')]['fields']));_0x235c2e[_0xd42d('0x34')]=_0x235c2e[_0xd42d('0x34')][_0xd42d('0x47')]?_0x235c2e['attributes']:_0x69f53['model'];if(_0x2f0438['query']['includeAll']){_0x235c2e[_0xd42d('0x48')]=[{'all':!![]}];}_0x235c2e=_[_0xd42d('0x3d')]({},_0x235c2e,_0x2f0438[_0xd42d('0x42')]);return db[_0xd42d('0x2c')][_0xd42d('0x49')](_0x235c2e)[_0xd42d('0x23')](handleEntityNotFound(_0x4c0948,null))[_0xd42d('0x23')](respondWithResult(_0x4c0948,null))[_0xd42d('0x4a')](handleError(_0x4c0948,null));};exports[_0xd42d('0x4b')]=function(_0x5d5a52,_0xe4d0e6){return db[_0xd42d('0x2c')][_0xd42d('0x4b')](_0x5d5a52[_0xd42d('0x4c')],{})[_0xd42d('0x23')](function(_0xb2c40c){var _0x9b8d3f=_0x5d5a52[_0xd42d('0x4d')][_0xd42d('0x4e')]({'plain':!![]});if(!_0x9b8d3f)throw new Error(_0xd42d('0x4f'));if(_0x9b8d3f[_0xd42d('0x50')]===_0xd42d('0x4d')){var _0x355278=_0xb2c40c[_0xd42d('0x4e')]({'plain':!![]});var _0x4670ec='Metrics';return db[_0xd42d('0x51')]['find']({'where':{'name':_0x4670ec,'userProfileId':_0x9b8d3f['userProfileId']},'raw':!![]})[_0xd42d('0x23')](function(_0x4640fe){if(_0x4640fe&&_0x4640fe[_0xd42d('0x52')]===0x0){return db[_0xd42d('0x26')][_0xd42d('0x4b')]({'name':_0x355278[_0xd42d('0x29')],'resourceId':_0x355278['id'],'type':_0x4640fe[_0xd42d('0x29')],'sectionId':_0x4640fe['id']},{})['then'](function(){return _0xb2c40c;});}else{return _0xb2c40c;}})['catch'](function(_0xda2dac){logger[_0xd42d('0x27')](_0xd42d('0x53'),_0xda2dac);throw _0xda2dac;});}return _0xb2c40c;})['then'](respondWithResult(_0xe4d0e6,0xc9))[_0xd42d('0x4a')](handleError(_0xe4d0e6,null));};exports[_0xd42d('0x22')]=function(_0x71517,_0x246671){if(_0x71517[_0xd42d('0x4c')]['id']){delete _0x71517[_0xd42d('0x4c')]['id'];}return db[_0xd42d('0x2c')][_0xd42d('0x49')]({'where':{'id':_0x71517[_0xd42d('0x46')]['id']}})[_0xd42d('0x23')](handleEntityNotFound(_0x246671,null))[_0xd42d('0x23')](saveUpdates(_0x71517[_0xd42d('0x4c')],null))[_0xd42d('0x23')](respondWithResult(_0x246671,null))[_0xd42d('0x4a')](handleError(_0x246671,null));};exports[_0xd42d('0x24')]=function(_0x2bdef5,_0xc48568){return db['AnalyticMetric'][_0xd42d('0x49')]({'where':{'id':_0x2bdef5['params']['id']}})[_0xd42d('0x23')](handleEntityNotFound(_0xc48568,null))[_0xd42d('0x23')](removeEntity(_0xc48568,null))[_0xd42d('0x4a')](handleError(_0xc48568,null));}; \ No newline at end of file +var _0x0912=['limit','set','apply','reject','then','destroy','Metrics','UserProfileResource','error','name','send','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','key','VIRTUAL','field','options','AnalyticMetric','includeAll','include','findAll','rows','catch','params','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0912,0xd0));var _0x2091=function(_0x466f12,_0x47a988){_0x466f12=_0x466f12-0x0;var _0xda0b37=_0x0912[_0x466f12];return _0xda0b37;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2091('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2091('0x1'));var jsonpatch=require(_0x2091('0x2'));var rp=require(_0x2091('0x3'));var moment=require(_0x2091('0x4'));var BPromise=require(_0x2091('0x5'));var Mustache=require('mustache');var util=require(_0x2091('0x6'));var path=require('path');var sox=require(_0x2091('0x7'));var csv=require('to-csv');var ejs=require(_0x2091('0x8'));var fs=require('fs');var _=require(_0x2091('0x9'));var squel=require(_0x2091('0xa'));var crypto=require(_0x2091('0xb'));var jsforce=require(_0x2091('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2091('0xd'));var querystring=require(_0x2091('0xe'));var Papa=require(_0x2091('0xf'));var Redis=require(_0x2091('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2091('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2091('0x12'))(_0x2091('0x13'));var utils=require(_0x2091('0x14'));var config=require(_0x2091('0x15'));var db=require(_0x2091('0x16'))['db'];function respondWithStatusCode(_0x183df4,_0x5e6451){_0x5e6451=_0x5e6451||0xcc;return function(_0x5eda08){if(_0x5eda08){return _0x183df4[_0x2091('0x17')](_0x5e6451);}return _0x183df4['status'](_0x5e6451)[_0x2091('0x18')]();};}function respondWithResult(_0x3be653,_0x5dd519){_0x5dd519=_0x5dd519||0xc8;return function(_0x3712d7){if(_0x3712d7){return _0x3be653[_0x2091('0x19')](_0x5dd519)[_0x2091('0x1a')](_0x3712d7);}};}function respondWithFilteredResult(_0x32f398,_0x201ebf){return function(_0x507e63){if(_0x507e63){var _0x1792a0=_0x507e63[_0x2091('0x1b')],_0x14d247=_0x201ebf['offset'],_0x58e440=_0x201ebf[_0x2091('0x1c')]+_0x201ebf[_0x2091('0x1d')],_0x51be86;if(_0x58e440>=_0x1792a0){_0x58e440=_0x1792a0;_0x51be86=0xc8;}else{_0x51be86=0xce;}_0x32f398['status'](_0x51be86);return _0x32f398[_0x2091('0x1e')]('Content-Range',_0x14d247+'-'+_0x58e440+'/'+_0x1792a0)['json'](_0x507e63);}return null;};}function patchUpdates(_0x50e0e5){return function(_0x2b264b){try{jsonpatch[_0x2091('0x1f')](_0x2b264b,_0x50e0e5,!![]);}catch(_0x242c30){return BPromise[_0x2091('0x20')](_0x242c30);}return _0x2b264b['save']();};}function saveUpdates(_0x5405e6,_0xf7924d){return function(_0x2d9405){if(_0x2d9405){return _0x2d9405['update'](_0x5405e6)[_0x2091('0x21')](function(_0x449a27){return _0x449a27;});}return null;};}function removeEntity(_0x32f062,_0x14c4d1){return function(_0x157343){if(_0x157343){return _0x157343[_0x2091('0x22')]()[_0x2091('0x21')](function(){var _0x4f5b0b=_0x157343['get']({'plain':!![]});var _0x1730af=_0x2091('0x23');return db[_0x2091('0x24')][_0x2091('0x22')]({'where':{'type':_0x1730af,'resourceId':_0x4f5b0b['id']}})[_0x2091('0x21')](function(){return _0x157343;});})['then'](function(){_0x32f062['status'](0xcc)[_0x2091('0x18')]();});}};}function handleEntityNotFound(_0x49bcd5,_0x317bfe){return function(_0x40409d){if(!_0x40409d){_0x49bcd5['sendStatus'](0x194);}return _0x40409d;};}function handleError(_0xdecf9f,_0x24e034){_0x24e034=_0x24e034||0x1f4;return function(_0x345ad5){logger[_0x2091('0x25')](_0x345ad5['stack']);if(_0x345ad5[_0x2091('0x26')]){delete _0x345ad5[_0x2091('0x26')];}_0xdecf9f[_0x2091('0x19')](_0x24e034)[_0x2091('0x27')](_0x345ad5);};}exports['index']=function(_0x32ea22,_0x25d80){var _0x4ae098={},_0x2db2aa={},_0x213eb3={'count':0x0,'rows':[]};var _0x2b83c9=db['AnalyticMetric'][_0x2091('0x28')];_0x2db2aa[_0x2091('0x29')]=_[_0x2091('0x2a')](_0x2b83c9);_0x2db2aa[_0x2091('0x2b')]=_['keys'](_0x32ea22['query']);_0x2db2aa['filters']=_['intersection'](_0x2db2aa['model'],_0x2db2aa['query']);_0x4ae098['attributes']=_[_0x2091('0x2c')](_0x2db2aa[_0x2091('0x29')],qs['fields'](_0x32ea22[_0x2091('0x2b')]['fields']));_0x4ae098[_0x2091('0x2d')]=_0x4ae098['attributes'][_0x2091('0x2e')]?_0x4ae098[_0x2091('0x2d')]:_0x2db2aa[_0x2091('0x29')];if(!_0x32ea22[_0x2091('0x2b')][_0x2091('0x2f')]('nolimit')){_0x4ae098[_0x2091('0x1d')]=qs[_0x2091('0x1d')](_0x32ea22[_0x2091('0x2b')][_0x2091('0x1d')]);_0x4ae098[_0x2091('0x1c')]=qs[_0x2091('0x1c')](_0x32ea22[_0x2091('0x2b')][_0x2091('0x1c')]);}_0x4ae098[_0x2091('0x30')]=qs['sort'](_0x32ea22['query'][_0x2091('0x31')]);_0x4ae098['where']=qs[_0x2091('0x32')](_[_0x2091('0x33')](_0x32ea22[_0x2091('0x2b')],_0x2db2aa[_0x2091('0x32')]));if(_0x32ea22[_0x2091('0x2b')][_0x2091('0x34')]){_0x4ae098[_0x2091('0x35')]=_[_0x2091('0x36')](_0x4ae098[_0x2091('0x35')],{'$or':_['map'](_0x2b83c9,function(_0x5aa835){if(_0x5aa835[_0x2091('0x37')][_0x2091('0x38')]!==_0x2091('0x39')){var _0x5648c6={};_0x5648c6[_0x5aa835[_0x2091('0x3a')]]={'$like':'%'+_0x32ea22[_0x2091('0x2b')][_0x2091('0x34')]+'%'};return _0x5648c6;}})});}_0x4ae098=_['merge']({},_0x4ae098,_0x32ea22[_0x2091('0x3b')]);var _0x17cc45={'where':_0x4ae098[_0x2091('0x35')]};return db[_0x2091('0x3c')][_0x2091('0x1b')](_0x17cc45)['then'](function(_0x298d49){_0x213eb3['count']=_0x298d49;if(_0x32ea22['query'][_0x2091('0x3d')]){_0x4ae098[_0x2091('0x3e')]=[{'all':!![]}];}return db[_0x2091('0x3c')][_0x2091('0x3f')](_0x4ae098);})[_0x2091('0x21')](function(_0x200e95){_0x213eb3[_0x2091('0x40')]=_0x200e95;return _0x213eb3;})[_0x2091('0x21')](respondWithFilteredResult(_0x25d80,_0x4ae098))[_0x2091('0x41')](handleError(_0x25d80,null));};exports['show']=function(_0x474578,_0x3c7e1d){var _0x3a18d4={'raw':!![],'where':{'id':_0x474578[_0x2091('0x42')]['id']}},_0x200217={};_0x200217[_0x2091('0x29')]=_[_0x2091('0x2a')](db[_0x2091('0x3c')][_0x2091('0x28')]);_0x200217[_0x2091('0x2b')]=_[_0x2091('0x2a')](_0x474578['query']);_0x200217['filters']=_[_0x2091('0x2c')](_0x200217[_0x2091('0x29')],_0x200217[_0x2091('0x2b')]);_0x3a18d4[_0x2091('0x2d')]=_[_0x2091('0x2c')](_0x200217[_0x2091('0x29')],qs['fields'](_0x474578[_0x2091('0x2b')][_0x2091('0x43')]));_0x3a18d4['attributes']=_0x3a18d4[_0x2091('0x2d')][_0x2091('0x2e')]?_0x3a18d4['attributes']:_0x200217[_0x2091('0x29')];if(_0x474578[_0x2091('0x2b')]['includeAll']){_0x3a18d4[_0x2091('0x3e')]=[{'all':!![]}];}_0x3a18d4=_['merge']({},_0x3a18d4,_0x474578[_0x2091('0x3b')]);return db[_0x2091('0x3c')]['find'](_0x3a18d4)[_0x2091('0x21')](handleEntityNotFound(_0x3c7e1d,null))['then'](respondWithResult(_0x3c7e1d,null))[_0x2091('0x41')](handleError(_0x3c7e1d,null));};exports[_0x2091('0x44')]=function(_0x3c0dfb,_0x5c7f06){return db[_0x2091('0x3c')][_0x2091('0x44')](_0x3c0dfb['body'],{})['then'](function(_0x1a6b88){var _0x5b61ff=_0x3c0dfb[_0x2091('0x45')]['get']({'plain':!![]});if(!_0x5b61ff)throw new Error(_0x2091('0x46'));if(_0x5b61ff[_0x2091('0x47')]==='user'){var _0x3506e6=_0x1a6b88[_0x2091('0x48')]({'plain':!![]});var _0x1fda17=_0x2091('0x23');return db[_0x2091('0x49')][_0x2091('0x4a')]({'where':{'name':_0x1fda17,'userProfileId':_0x5b61ff[_0x2091('0x4b')]},'raw':!![]})[_0x2091('0x21')](function(_0x105c6c){if(_0x105c6c&&_0x105c6c[_0x2091('0x4c')]===0x0){return db[_0x2091('0x24')][_0x2091('0x44')]({'name':_0x3506e6[_0x2091('0x26')],'resourceId':_0x3506e6['id'],'type':_0x105c6c['name'],'sectionId':_0x105c6c['id']},{})['then'](function(){return _0x1a6b88;});}else{return _0x1a6b88;}})[_0x2091('0x41')](function(_0x994ffb){logger[_0x2091('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x994ffb);throw _0x994ffb;});}return _0x1a6b88;})[_0x2091('0x21')](respondWithResult(_0x5c7f06,0xc9))[_0x2091('0x41')](handleError(_0x5c7f06,null));};exports[_0x2091('0x4d')]=function(_0x4c9fc8,_0x127f63){if(_0x4c9fc8[_0x2091('0x4e')]['id']){delete _0x4c9fc8[_0x2091('0x4e')]['id'];}return db[_0x2091('0x3c')][_0x2091('0x4a')]({'where':{'id':_0x4c9fc8[_0x2091('0x42')]['id']}})[_0x2091('0x21')](handleEntityNotFound(_0x127f63,null))['then'](saveUpdates(_0x4c9fc8[_0x2091('0x4e')],null))[_0x2091('0x21')](respondWithResult(_0x127f63,null))[_0x2091('0x41')](handleError(_0x127f63,null));};exports['destroy']=function(_0x5e6f87,_0x46ba13){return db['AnalyticMetric'][_0x2091('0x4a')]({'where':{'id':_0x5e6f87[_0x2091('0x42')]['id']}})[_0x2091('0x21')](handleEntityNotFound(_0x46ba13,null))[_0x2091('0x21')](removeEntity(_0x46ba13,null))['catch'](handleError(_0x46ba13,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index cd7fc0a..4f591d2 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 _0x7f9e=['analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7f9e,0x90));var _0xe7f9=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x7f9e[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xe7f9('0x0'));var util=require(_0xe7f9('0x1'));var logger=require(_0xe7f9('0x2'))(_0xe7f9('0x3'));var moment=require('moment');var BPromise=require(_0xe7f9('0x4'));var rp=require(_0xe7f9('0x5'));var fs=require('fs');var path=require(_0xe7f9('0x6'));var rimraf=require(_0xe7f9('0x7'));var config=require(_0xe7f9('0x8'));var attributes=require(_0xe7f9('0x9'));module[_0xe7f9('0xa')]=function(_0xe8ff46,_0x4aa7db){return _0xe8ff46[_0xe7f9('0xb')]('AnalyticMetric',attributes,{'tableName':_0xe7f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eac=['moment','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9eac,0x14d));var _0xc9ea=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x9eac[_0x4a209a];return _0x4b3c20;};'use strict';var _=require('lodash');var util=require(_0xc9ea('0x0'));var logger=require(_0xc9ea('0x1'))(_0xc9ea('0x2'));var moment=require(_0xc9ea('0x3'));var BPromise=require(_0xc9ea('0x4'));var rp=require(_0xc9ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9ea('0x6'));var attributes=require(_0xc9ea('0x7'));module[_0xc9ea('0x8')]=function(_0x5da1ca,_0x30f713){return _0x5da1ca[_0xc9ea('0x9')](_0xc9ea('0xa'),attributes,{'tableName':_0xc9ea('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 1f5a3b7..7588a22 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 _0x3036=['moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x12f35c,_0x23fe06){var _0xe7442a=function(_0xd14aa9){while(--_0xd14aa9){_0x12f35c['push'](_0x12f35c['shift']());}};_0xe7442a(++_0x23fe06);}(_0x3036,0x1a9));var _0x6303=function(_0x2edd7e,_0x129fb7){_0x2edd7e=_0x2edd7e-0x0;var _0x2fe318=_0x3036[_0x2edd7e];return _0x2fe318;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6303('0x0'));var BPromise=require(_0x6303('0x1'));var rs=require(_0x6303('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6303('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6303('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x6303('0x5')][_0x6303('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x25a0ce,_0x48c936,_0x8a0038){return new BPromise(function(_0x420da8,_0x2e2be8){return client[_0x6303('0x7')](_0x25a0ce,_0x8a0038)[_0x6303('0x8')](function(_0x2684ac){logger[_0x6303('0x9')](_0x6303('0xa'),_0x48c936,_0x6303('0xb'));logger['debug'](_0x6303('0xc'),_0x48c936,_0x6303('0xb'),JSON[_0x6303('0xd')](_0x2684ac));if(_0x2684ac[_0x6303('0xe')]){if(_0x2684ac[_0x6303('0xe')]['code']===0x1f4){logger[_0x6303('0xe')](_0x6303('0xa'),_0x48c936,_0x2684ac[_0x6303('0xe')][_0x6303('0xf')]);return _0x2e2be8(_0x2684ac[_0x6303('0xe')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x48c936,_0x2684ac[_0x6303('0xe')][_0x6303('0xf')]);return _0x420da8(_0x2684ac[_0x6303('0xe')][_0x6303('0xf')]);}else{logger[_0x6303('0x9')](_0x6303('0xa'),_0x48c936,_0x6303('0xb'));_0x420da8(_0x2684ac[_0x6303('0x10')][_0x6303('0xf')]);}})['catch'](function(_0x50a19c){logger[_0x6303('0xe')](_0x6303('0xa'),_0x48c936,_0x50a19c);_0x2e2be8(_0x50a19c);});});} \ No newline at end of file +var _0x7ae7=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result'];(function(_0x4970dc,_0x7fc763){var _0x2e36a4=function(_0x550047){while(--_0x550047){_0x4970dc['push'](_0x4970dc['shift']());}};_0x2e36a4(++_0x7fc763);}(_0x7ae7,0xd9));var _0x77ae=function(_0x4dbe5c,_0x36ed26){_0x4dbe5c=_0x4dbe5c-0x0;var _0x57bd05=_0x7ae7[_0x4dbe5c];return _0x57bd05;};'use strict';var _=require(_0x77ae('0x0'));var util=require(_0x77ae('0x1'));var moment=require('moment');var BPromise=require(_0x77ae('0x2'));var rs=require(_0x77ae('0x3'));var fs=require('fs');var Redis=require(_0x77ae('0x4'));var db=require(_0x77ae('0x5'))['db'];var utils=require(_0x77ae('0x6'));var logger=require(_0x77ae('0x7'))(_0x77ae('0x8'));var config=require(_0x77ae('0x9'));var jayson=require(_0x77ae('0xa'));var client=jayson[_0x77ae('0xb')][_0x77ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fcff8,_0x2c33a5,_0x56197f){return new BPromise(function(_0x131f0b,_0x43f894){return client[_0x77ae('0xd')](_0x1fcff8,_0x56197f)[_0x77ae('0xe')](function(_0x27f9df){logger[_0x77ae('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x2c33a5,_0x77ae('0x10'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2c33a5,_0x77ae('0x10'),JSON[_0x77ae('0x11')](_0x27f9df));if(_0x27f9df[_0x77ae('0x12')]){if(_0x27f9df['error'][_0x77ae('0x13')]===0x1f4){logger[_0x77ae('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x2c33a5,_0x27f9df[_0x77ae('0x12')][_0x77ae('0x14')]);return _0x43f894(_0x27f9df[_0x77ae('0x12')]['message']);}logger['error'](_0x77ae('0x15'),_0x2c33a5,_0x27f9df[_0x77ae('0x12')][_0x77ae('0x14')]);return _0x131f0b(_0x27f9df[_0x77ae('0x12')][_0x77ae('0x14')]);}else{logger[_0x77ae('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x2c33a5,'request\x20sent');_0x131f0b(_0x27f9df[_0x77ae('0x16')][_0x77ae('0x14')]);}})[_0x77ae('0x17')](function(_0x5af6b1){logger[_0x77ae('0x12')](_0x77ae('0x15'),_0x2c33a5,_0x5af6b1);_0x43f894(_0x5af6b1);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 89b9250..aec2d07 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 _0x5d0a=['../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x3224a0,_0x1c4109){var _0x169736=function(_0x266cb4){while(--_0x266cb4){_0x3224a0['push'](_0x3224a0['shift']());}};_0x169736(++_0x1c4109);}(_0x5d0a,0x175));var _0xa5d0=function(_0x46647c,_0x463b73){_0x46647c=_0x46647c-0x0;var _0x2a6ffa=_0x5d0a[_0x46647c];return _0x2a6ffa;};'use strict';var multer=require(_0xa5d0('0x0'));var util=require('util');var path=require(_0xa5d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xa5d0('0x2'));var router=express[_0xa5d0('0x3')]();var auth=require(_0xa5d0('0x4'));var interaction=require(_0xa5d0('0x5'));var config=require('../../config/environment');var controller=require(_0xa5d0('0x6'));router[_0xa5d0('0x7')]('/',auth[_0xa5d0('0x8')](),controller[_0xa5d0('0x9')]);router[_0xa5d0('0x7')](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xb')]);router[_0xa5d0('0xc')]('/',auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xd')]);router['put'](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xe')]);router[_0xa5d0('0xf')](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0x10')]);module[_0xa5d0('0x11')]=router; \ No newline at end of file +var _0x8cda=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','update','exports','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var auth=require(_0xa8cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8cd('0x6'));var controller=require(_0xa8cd('0x7'));router[_0xa8cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8cd('0x9')]);router[_0xa8cd('0x8')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xc')]);router[_0xa8cd('0xd')]('/',auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa8cd('0xf')]);router['delete'](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller['destroy']);module[_0xa8cd('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5a37b89..831f441 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 _0x464e=['exports','TEXT','sequelize'];(function(_0x570c16,_0x1f0794){var _0x218289=function(_0x15063d){while(--_0x15063d){_0x570c16['push'](_0x570c16['shift']());}};_0x218289(++_0x1f0794);}(_0x464e,0x77));var _0xe464=function(_0x401fb4,_0x5f1d19){_0x401fb4=_0x401fb4-0x0;var _0x54165c=_0x464e[_0x401fb4];return _0x54165c;};'use strict';var Sequelize=require(_0xe464('0x0'));module[_0xe464('0x1')]={'tree':{'type':Sequelize[_0xe464('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe5fe=['exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe5fe,0x148));var _0xee5f=function(_0x29e669,_0x275d8e){_0x29e669=_0x29e669-0x0;var _0x4b7ba7=_0xe5fe[_0x29e669];return _0x4b7ba7;};'use strict';var Sequelize=require('sequelize');module[_0xee5f('0x0')]={'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 a80b930..e0a6cc2 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 _0x5933=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','AnalyticTreeReport','rawAttributes','keys','query','filters','intersection','fields','attributes','model','nolimit','limit','offset','sort','where','pick','filter','merge','map','type','key','includeAll','catch','show','params','length','include','options','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x13044d,_0x2220e9){var _0x511c9a=function(_0x2384ad){while(--_0x2384ad){_0x13044d['push'](_0x13044d['shift']());}};_0x511c9a(++_0x2220e9);}(_0x5933,0x113));var _0x3593=function(_0x967518,_0x3330a5){_0x967518=_0x967518-0x0;var _0x481f36=_0x5933[_0x967518];return _0x481f36;};'use strict';var pdf=require(_0x3593('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3593('0x1'));var zipdir=require(_0x3593('0x2'));var jsonpatch=require(_0x3593('0x3'));var rp=require(_0x3593('0x4'));var moment=require(_0x3593('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3593('0x6'));var path=require(_0x3593('0x7'));var sox=require(_0x3593('0x8'));var csv=require(_0x3593('0x9'));var ejs=require(_0x3593('0xa'));var fs=require('fs');var _=require(_0x3593('0xb'));var squel=require(_0x3593('0xc'));var crypto=require(_0x3593('0xd'));var jsforce=require(_0x3593('0xe'));var deskjs=require(_0x3593('0xf'));var toCsv=require(_0x3593('0x9'));var querystring=require('querystring');var Papa=require(_0x3593('0x10'));var Redis=require('ioredis');var authService=require(_0x3593('0x11'));var qs=require(_0x3593('0x12'));var hardwareService=require(_0x3593('0x13'));var logger=require(_0x3593('0x14'))(_0x3593('0x15'));var utils=require(_0x3593('0x16'));var config=require(_0x3593('0x17'));var db=require(_0x3593('0x18'))['db'];function respondWithStatusCode(_0x303ff1,_0x25e598){_0x25e598=_0x25e598||0xcc;return function(_0x4f620f){if(_0x4f620f){return _0x303ff1['sendStatus'](_0x25e598);}return _0x303ff1[_0x3593('0x19')](_0x25e598)[_0x3593('0x1a')]();};}function respondWithResult(_0x17f3ad,_0x2a9d8c){_0x2a9d8c=_0x2a9d8c||0xc8;return function(_0x41bcbf){if(_0x41bcbf){return _0x17f3ad[_0x3593('0x19')](_0x2a9d8c)[_0x3593('0x1b')](_0x41bcbf);}};}function respondWithFilteredResult(_0xff96a5,_0x2fd94){return function(_0x560023){if(_0x560023){var _0x4ee3f9=_0x560023[_0x3593('0x1c')],_0x21b305=_0x2fd94['offset'],_0x500512=_0x2fd94['offset']+_0x2fd94['limit'],_0x10ea7f;if(_0x500512>=_0x4ee3f9){_0x500512=_0x4ee3f9;_0x10ea7f=0xc8;}else{_0x10ea7f=0xce;}_0xff96a5[_0x3593('0x19')](_0x10ea7f);return _0xff96a5[_0x3593('0x1d')](_0x3593('0x1e'),_0x21b305+'-'+_0x500512+'/'+_0x4ee3f9)[_0x3593('0x1b')](_0x560023);}return null;};}function patchUpdates(_0x3b3141){return function(_0x2e3d8f){try{jsonpatch[_0x3593('0x1f')](_0x2e3d8f,_0x3b3141,!![]);}catch(_0x3277dd){return BPromise[_0x3593('0x20')](_0x3277dd);}return _0x2e3d8f[_0x3593('0x21')]();};}function saveUpdates(_0x2d1b49,_0x10431e){return function(_0x4b5ddd){if(_0x4b5ddd){return _0x4b5ddd[_0x3593('0x22')](_0x2d1b49)[_0x3593('0x23')](function(_0x5b0b05){return _0x5b0b05;});}return null;};}function removeEntity(_0x33a68d,_0x234a35){return function(_0x18e04e){if(_0x18e04e){return _0x18e04e[_0x3593('0x24')]()[_0x3593('0x23')](function(){_0x33a68d[_0x3593('0x19')](0xcc)[_0x3593('0x1a')]();});}};}function handleEntityNotFound(_0x462226,_0x166615){return function(_0x4a980d){if(!_0x4a980d){_0x462226[_0x3593('0x25')](0x194);}return _0x4a980d;};}function handleError(_0x255a99,_0x2d0a44){_0x2d0a44=_0x2d0a44||0x1f4;return function(_0x17d7c4){logger[_0x3593('0x26')](_0x17d7c4['stack']);if(_0x17d7c4[_0x3593('0x27')]){delete _0x17d7c4[_0x3593('0x27')];}_0x255a99[_0x3593('0x19')](_0x2d0a44)[_0x3593('0x28')](_0x17d7c4);};}exports[_0x3593('0x29')]=function(_0x53e82b,_0x327228){var _0x28c44b={},_0x14dada={},_0x188218={'count':0x0,'rows':[]};var _0x1848a7=db[_0x3593('0x2a')][_0x3593('0x2b')];_0x14dada['model']=_[_0x3593('0x2c')](_0x1848a7);_0x14dada['query']=_[_0x3593('0x2c')](_0x53e82b[_0x3593('0x2d')]);_0x14dada[_0x3593('0x2e')]=_[_0x3593('0x2f')](_0x14dada['model'],_0x14dada[_0x3593('0x2d')]);_0x28c44b['attributes']=_[_0x3593('0x2f')](_0x14dada['model'],qs[_0x3593('0x30')](_0x53e82b['query']['fields']));_0x28c44b[_0x3593('0x31')]=_0x28c44b[_0x3593('0x31')]['length']?_0x28c44b[_0x3593('0x31')]:_0x14dada[_0x3593('0x32')];if(!_0x53e82b['query']['hasOwnProperty'](_0x3593('0x33'))){_0x28c44b[_0x3593('0x34')]=qs[_0x3593('0x34')](_0x53e82b[_0x3593('0x2d')][_0x3593('0x34')]);_0x28c44b['offset']=qs['offset'](_0x53e82b['query'][_0x3593('0x35')]);}_0x28c44b['order']=qs[_0x3593('0x36')](_0x53e82b['query'][_0x3593('0x36')]);_0x28c44b[_0x3593('0x37')]=qs['filters'](_[_0x3593('0x38')](_0x53e82b[_0x3593('0x2d')],_0x14dada[_0x3593('0x2e')]));if(_0x53e82b['query'][_0x3593('0x39')]){_0x28c44b[_0x3593('0x37')]=_[_0x3593('0x3a')](_0x28c44b[_0x3593('0x37')],{'$or':_[_0x3593('0x3b')](_0x1848a7,function(_0x581352){if(_0x581352[_0x3593('0x3c')][_0x3593('0x3d')]!=='VIRTUAL'){var _0x2f64fe={};_0x2f64fe[_0x581352['field']]={'$like':'%'+_0x53e82b[_0x3593('0x2d')][_0x3593('0x39')]+'%'};return _0x2f64fe;}})});}_0x28c44b=_[_0x3593('0x3a')]({},_0x28c44b,_0x53e82b['options']);var _0x28efcb={'where':_0x28c44b['where']};return db[_0x3593('0x2a')][_0x3593('0x1c')](_0x28efcb)[_0x3593('0x23')](function(_0x4af8dd){_0x188218[_0x3593('0x1c')]=_0x4af8dd;if(_0x53e82b['query'][_0x3593('0x3e')]){_0x28c44b['include']=[{'all':!![]}];}return db[_0x3593('0x2a')]['findAll'](_0x28c44b);})[_0x3593('0x23')](function(_0x29fec8){_0x188218['rows']=_0x29fec8;return _0x188218;})[_0x3593('0x23')](respondWithFilteredResult(_0x327228,_0x28c44b))[_0x3593('0x3f')](handleError(_0x327228,null));};exports[_0x3593('0x40')]=function(_0x46d169,_0x513fde){var _0x3b36ae={'raw':!![],'where':{'id':_0x46d169[_0x3593('0x41')]['id']}},_0x2a250b={};_0x2a250b[_0x3593('0x32')]=_[_0x3593('0x2c')](db['AnalyticTreeReport'][_0x3593('0x2b')]);_0x2a250b[_0x3593('0x2d')]=_[_0x3593('0x2c')](_0x46d169[_0x3593('0x2d')]);_0x2a250b[_0x3593('0x2e')]=_[_0x3593('0x2f')](_0x2a250b['model'],_0x2a250b[_0x3593('0x2d')]);_0x3b36ae[_0x3593('0x31')]=_[_0x3593('0x2f')](_0x2a250b[_0x3593('0x32')],qs[_0x3593('0x30')](_0x46d169['query'][_0x3593('0x30')]));_0x3b36ae[_0x3593('0x31')]=_0x3b36ae[_0x3593('0x31')][_0x3593('0x42')]?_0x3b36ae[_0x3593('0x31')]:_0x2a250b[_0x3593('0x32')];if(_0x46d169['query'][_0x3593('0x3e')]){_0x3b36ae[_0x3593('0x43')]=[{'all':!![]}];}_0x3b36ae=_[_0x3593('0x3a')]({},_0x3b36ae,_0x46d169[_0x3593('0x44')]);return db['AnalyticTreeReport']['find'](_0x3b36ae)[_0x3593('0x23')](handleEntityNotFound(_0x513fde,null))[_0x3593('0x23')](respondWithResult(_0x513fde,null))[_0x3593('0x3f')](handleError(_0x513fde,null));};exports[_0x3593('0x45')]=function(_0x5151f2,_0x51d5be){return db['AnalyticTreeReport'][_0x3593('0x45')](_0x5151f2[_0x3593('0x46')],{})['then'](respondWithResult(_0x51d5be,0xc9))[_0x3593('0x3f')](handleError(_0x51d5be,null));};exports[_0x3593('0x22')]=function(_0x4b2de3,_0x270197){if(_0x4b2de3['body']['id']){delete _0x4b2de3['body']['id'];}return db[_0x3593('0x2a')][_0x3593('0x47')]({'where':{'id':_0x4b2de3['params']['id']}})['then'](handleEntityNotFound(_0x270197,null))['then'](saveUpdates(_0x4b2de3[_0x3593('0x46')],null))[_0x3593('0x23')](respondWithResult(_0x270197,null))[_0x3593('0x3f')](handleError(_0x270197,null));};exports[_0x3593('0x24')]=function(_0x5841ce,_0x456915){return db[_0x3593('0x2a')]['find']({'where':{'id':_0x5841ce[_0x3593('0x41')]['id']}})[_0x3593('0x23')](handleEntityNotFound(_0x456915,null))[_0x3593('0x23')](removeEntity(_0x456915,null))[_0x3593('0x3f')](handleError(_0x456915,null));}; \ No newline at end of file +var _0xb41e=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','error','stack','name','AnalyticTreeReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','includeAll','rows','catch','show','params','include','create','body','update','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x4f065e,_0x1f9b73){var _0x46c40d=function(_0x266498){while(--_0x266498){_0x4f065e['push'](_0x4f065e['shift']());}};_0x46c40d(++_0x1f9b73);}(_0xb41e,0x79));var _0xeb41=function(_0x1b7a59,_0x4fb0a4){_0x1b7a59=_0x1b7a59-0x0;var _0x38af48=_0xb41e[_0x1b7a59];return _0x38af48;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb41('0x1'));var jsonpatch=require(_0xeb41('0x2'));var rp=require(_0xeb41('0x3'));var moment=require(_0xeb41('0x4'));var BPromise=require(_0xeb41('0x5'));var Mustache=require('mustache');var util=require(_0xeb41('0x6'));var path=require(_0xeb41('0x7'));var sox=require(_0xeb41('0x8'));var csv=require(_0xeb41('0x9'));var ejs=require(_0xeb41('0xa'));var fs=require('fs');var _=require(_0xeb41('0xb'));var squel=require(_0xeb41('0xc'));var crypto=require(_0xeb41('0xd'));var jsforce=require(_0xeb41('0xe'));var deskjs=require(_0xeb41('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb41('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeb41('0x11'));var hardwareService=require(_0xeb41('0x12'));var logger=require(_0xeb41('0x13'))('api');var utils=require(_0xeb41('0x14'));var config=require(_0xeb41('0x15'));var db=require(_0xeb41('0x16'))['db'];function respondWithStatusCode(_0x27e8f6,_0x2670a1){_0x2670a1=_0x2670a1||0xcc;return function(_0x230ab7){if(_0x230ab7){return _0x27e8f6[_0xeb41('0x17')](_0x2670a1);}return _0x27e8f6['status'](_0x2670a1)[_0xeb41('0x18')]();};}function respondWithResult(_0x15f30e,_0x52434c){_0x52434c=_0x52434c||0xc8;return function(_0x4b6e68){if(_0x4b6e68){return _0x15f30e[_0xeb41('0x19')](_0x52434c)[_0xeb41('0x1a')](_0x4b6e68);}};}function respondWithFilteredResult(_0x25bcaa,_0x1a4571){return function(_0x6ed02b){if(_0x6ed02b){var _0x77150f=_0x6ed02b[_0xeb41('0x1b')],_0x4d481d=_0x1a4571[_0xeb41('0x1c')],_0x1719ec=_0x1a4571[_0xeb41('0x1c')]+_0x1a4571[_0xeb41('0x1d')],_0x36991b;if(_0x1719ec>=_0x77150f){_0x1719ec=_0x77150f;_0x36991b=0xc8;}else{_0x36991b=0xce;}_0x25bcaa[_0xeb41('0x19')](_0x36991b);return _0x25bcaa[_0xeb41('0x1e')](_0xeb41('0x1f'),_0x4d481d+'-'+_0x1719ec+'/'+_0x77150f)[_0xeb41('0x1a')](_0x6ed02b);}return null;};}function patchUpdates(_0x1c8e52){return function(_0xa37529){try{jsonpatch[_0xeb41('0x20')](_0xa37529,_0x1c8e52,!![]);}catch(_0x136f34){return BPromise['reject'](_0x136f34);}return _0xa37529[_0xeb41('0x21')]();};}function saveUpdates(_0x48b89b,_0xe480d0){return function(_0x2f5be8){if(_0x2f5be8){return _0x2f5be8['update'](_0x48b89b)[_0xeb41('0x22')](function(_0x17e697){return _0x17e697;});}return null;};}function removeEntity(_0x2c0f37,_0x2db0e1){return function(_0x4c8e5e){if(_0x4c8e5e){return _0x4c8e5e['destroy']()[_0xeb41('0x22')](function(){_0x2c0f37[_0xeb41('0x19')](0xcc)[_0xeb41('0x18')]();});}};}function handleEntityNotFound(_0x25ec4d,_0x1a748f){return function(_0x20b09e){if(!_0x20b09e){_0x25ec4d[_0xeb41('0x17')](0x194);}return _0x20b09e;};}function handleError(_0x2ea542,_0x21b3f9){_0x21b3f9=_0x21b3f9||0x1f4;return function(_0x4651c2){logger[_0xeb41('0x23')](_0x4651c2[_0xeb41('0x24')]);if(_0x4651c2[_0xeb41('0x25')]){delete _0x4651c2[_0xeb41('0x25')];}_0x2ea542[_0xeb41('0x19')](_0x21b3f9)['send'](_0x4651c2);};}exports['index']=function(_0xc9e86b,_0x66a895){var _0x5b1a5b={},_0x112c7f={},_0x4796f5={'count':0x0,'rows':[]};var _0x2b8d15=db[_0xeb41('0x26')][_0xeb41('0x27')];_0x112c7f[_0xeb41('0x28')]=_['keys'](_0x2b8d15);_0x112c7f[_0xeb41('0x29')]=_[_0xeb41('0x2a')](_0xc9e86b['query']);_0x112c7f[_0xeb41('0x2b')]=_[_0xeb41('0x2c')](_0x112c7f['model'],_0x112c7f[_0xeb41('0x29')]);_0x5b1a5b[_0xeb41('0x2d')]=_[_0xeb41('0x2c')](_0x112c7f['model'],qs[_0xeb41('0x2e')](_0xc9e86b[_0xeb41('0x29')][_0xeb41('0x2e')]));_0x5b1a5b[_0xeb41('0x2d')]=_0x5b1a5b['attributes'][_0xeb41('0x2f')]?_0x5b1a5b[_0xeb41('0x2d')]:_0x112c7f[_0xeb41('0x28')];if(!_0xc9e86b[_0xeb41('0x29')]['hasOwnProperty'](_0xeb41('0x30'))){_0x5b1a5b[_0xeb41('0x1d')]=qs[_0xeb41('0x1d')](_0xc9e86b['query'][_0xeb41('0x1d')]);_0x5b1a5b[_0xeb41('0x1c')]=qs['offset'](_0xc9e86b[_0xeb41('0x29')][_0xeb41('0x1c')]);}_0x5b1a5b[_0xeb41('0x31')]=qs['sort'](_0xc9e86b[_0xeb41('0x29')][_0xeb41('0x32')]);_0x5b1a5b[_0xeb41('0x33')]=qs[_0xeb41('0x2b')](_[_0xeb41('0x34')](_0xc9e86b[_0xeb41('0x29')],_0x112c7f[_0xeb41('0x2b')]));if(_0xc9e86b[_0xeb41('0x29')][_0xeb41('0x35')]){_0x5b1a5b[_0xeb41('0x33')]=_[_0xeb41('0x36')](_0x5b1a5b[_0xeb41('0x33')],{'$or':_[_0xeb41('0x37')](_0x2b8d15,function(_0x5d0407){if(_0x5d0407['type'][_0xeb41('0x38')]!==_0xeb41('0x39')){var _0x4c9263={};_0x4c9263[_0x5d0407['field']]={'$like':'%'+_0xc9e86b['query']['filter']+'%'};return _0x4c9263;}})});}_0x5b1a5b=_[_0xeb41('0x36')]({},_0x5b1a5b,_0xc9e86b['options']);var _0x2bb933={'where':_0x5b1a5b[_0xeb41('0x33')]};return db[_0xeb41('0x26')][_0xeb41('0x1b')](_0x2bb933)['then'](function(_0x26ce4b){_0x4796f5[_0xeb41('0x1b')]=_0x26ce4b;if(_0xc9e86b[_0xeb41('0x29')][_0xeb41('0x3a')]){_0x5b1a5b['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x5b1a5b);})[_0xeb41('0x22')](function(_0x4a757b){_0x4796f5[_0xeb41('0x3b')]=_0x4a757b;return _0x4796f5;})[_0xeb41('0x22')](respondWithFilteredResult(_0x66a895,_0x5b1a5b))[_0xeb41('0x3c')](handleError(_0x66a895,null));};exports[_0xeb41('0x3d')]=function(_0x155853,_0x3f49f0){var _0xb9f70a={'raw':!![],'where':{'id':_0x155853[_0xeb41('0x3e')]['id']}},_0x53928b={};_0x53928b['model']=_[_0xeb41('0x2a')](db['AnalyticTreeReport'][_0xeb41('0x27')]);_0x53928b[_0xeb41('0x29')]=_['keys'](_0x155853[_0xeb41('0x29')]);_0x53928b[_0xeb41('0x2b')]=_[_0xeb41('0x2c')](_0x53928b[_0xeb41('0x28')],_0x53928b[_0xeb41('0x29')]);_0xb9f70a['attributes']=_[_0xeb41('0x2c')](_0x53928b['model'],qs[_0xeb41('0x2e')](_0x155853[_0xeb41('0x29')][_0xeb41('0x2e')]));_0xb9f70a[_0xeb41('0x2d')]=_0xb9f70a['attributes'][_0xeb41('0x2f')]?_0xb9f70a[_0xeb41('0x2d')]:_0x53928b[_0xeb41('0x28')];if(_0x155853[_0xeb41('0x29')]['includeAll']){_0xb9f70a[_0xeb41('0x3f')]=[{'all':!![]}];}_0xb9f70a=_[_0xeb41('0x36')]({},_0xb9f70a,_0x155853['options']);return db[_0xeb41('0x26')]['find'](_0xb9f70a)['then'](handleEntityNotFound(_0x3f49f0,null))[_0xeb41('0x22')](respondWithResult(_0x3f49f0,null))[_0xeb41('0x3c')](handleError(_0x3f49f0,null));};exports[_0xeb41('0x40')]=function(_0x2d07ef,_0x2b92bf){return db[_0xeb41('0x26')][_0xeb41('0x40')](_0x2d07ef[_0xeb41('0x41')],{})['then'](respondWithResult(_0x2b92bf,0xc9))['catch'](handleError(_0x2b92bf,null));};exports[_0xeb41('0x42')]=function(_0x4cd68f,_0x760c4e){if(_0x4cd68f[_0xeb41('0x41')]['id']){delete _0x4cd68f['body']['id'];}return db[_0xeb41('0x26')]['find']({'where':{'id':_0x4cd68f[_0xeb41('0x3e')]['id']}})[_0xeb41('0x22')](handleEntityNotFound(_0x760c4e,null))[_0xeb41('0x22')](saveUpdates(_0x4cd68f[_0xeb41('0x41')],null))['then'](respondWithResult(_0x760c4e,null))['catch'](handleError(_0x760c4e,null));};exports[_0xeb41('0x43')]=function(_0x30318c,_0x4f4b1b){return db[_0xeb41('0x26')][_0xeb41('0x44')]({'where':{'id':_0x30318c[_0xeb41('0x3e')]['id']}})[_0xeb41('0x22')](handleEntityNotFound(_0x4f4b1b,null))[_0xeb41('0x22')](removeEntity(_0x4f4b1b,null))[_0xeb41('0x3c')](handleError(_0x4f4b1b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 8d76cd4..87a3ccb 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 _0xce68=['moment','bluebird','request-promise','path','rimraf','exports','define','lodash','util','../../config/logger'];(function(_0x1e1f6e,_0x5d48a4){var _0x5eebc4=function(_0x184444){while(--_0x184444){_0x1e1f6e['push'](_0x1e1f6e['shift']());}};_0x5eebc4(++_0x5d48a4);}(_0xce68,0x179));var _0x8ce6=function(_0x4c104e,_0x2d8398){_0x4c104e=_0x4c104e-0x0;var _0x31531f=_0xce68[_0x4c104e];return _0x31531f;};'use strict';var _=require(_0x8ce6('0x0'));var util=require(_0x8ce6('0x1'));var logger=require(_0x8ce6('0x2'))('api');var moment=require(_0x8ce6('0x3'));var BPromise=require(_0x8ce6('0x4'));var rp=require(_0x8ce6('0x5'));var fs=require('fs');var path=require(_0x8ce6('0x6'));var rimraf=require(_0x8ce6('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x8ce6('0x8')]=function(_0x5d459d,_0x4b1e83){return _0x5d459d[_0x8ce6('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0808=['moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x84efb9,_0x1e4dde){var _0x46ff86=function(_0x999836){while(--_0x999836){_0x84efb9['push'](_0x84efb9['shift']());}};_0x46ff86(++_0x1e4dde);}(_0x0808,0xce));var _0x8080=function(_0x41d9cc,_0x16be91){_0x41d9cc=_0x41d9cc-0x0;var _0x4214bc=_0x0808[_0x41d9cc];return _0x4214bc;};'use strict';var _=require(_0x8080('0x0'));var util=require(_0x8080('0x1'));var logger=require(_0x8080('0x2'))(_0x8080('0x3'));var moment=require(_0x8080('0x4'));var BPromise=require(_0x8080('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8080('0x6'));var rimraf=require(_0x8080('0x7'));var config=require(_0x8080('0x8'));var attributes=require(_0x8080('0x9'));module[_0x8080('0xa')]=function(_0x5769cc,_0x4b31a6){return _0x5769cc[_0x8080('0xb')](_0x8080('0xc'),attributes,{'tableName':_0x8080('0xd'),'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 28148c2..026ae46 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 _0x7c98=['http','request','info','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x7c98,0x98));var _0x87c9=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x7c98[_0x107f10];return _0x811cab;};'use strict';var _=require(_0x87c9('0x0'));var util=require(_0x87c9('0x1'));var moment=require(_0x87c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x87c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x87c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x87c9('0x6'));var client=jayson[_0x87c9('0x7')][_0x87c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d5f1a,_0x54a150,_0x1e66ed){return new BPromise(function(_0x1c0103,_0x4ad01a){return client[_0x87c9('0x9')](_0x2d5f1a,_0x1e66ed)['then'](function(_0x54a2ca){logger[_0x87c9('0xa')]('AnalyticTreeReport,\x20%s,\x20%s',_0x54a150,_0x87c9('0xb'));logger['debug'](_0x87c9('0xc'),_0x54a150,_0x87c9('0xb'),JSON[_0x87c9('0xd')](_0x54a2ca));if(_0x54a2ca['error']){if(_0x54a2ca[_0x87c9('0xe')][_0x87c9('0xf')]===0x1f4){logger[_0x87c9('0xe')](_0x87c9('0x10'),_0x54a150,_0x54a2ca['error'][_0x87c9('0x11')]);return _0x4ad01a(_0x54a2ca['error'][_0x87c9('0x11')]);}logger[_0x87c9('0xe')](_0x87c9('0x10'),_0x54a150,_0x54a2ca[_0x87c9('0xe')][_0x87c9('0x11')]);return _0x1c0103(_0x54a2ca['error'][_0x87c9('0x11')]);}else{logger[_0x87c9('0xa')](_0x87c9('0x10'),_0x54a150,_0x87c9('0xb'));_0x1c0103(_0x54a2ca[_0x87c9('0x12')]['message']);}})[_0x87c9('0x13')](function(_0x2073ab){logger[_0x87c9('0xe')](_0x87c9('0x10'),_0x54a150,_0x2073ab);_0x4ad01a(_0x2073ab);});});} \ No newline at end of file +var _0xb09e=['../../config/logger','../../config/environment','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb09e,0xde));var _0xeb09=function(_0x224ae5,_0x34c9da){_0x224ae5=_0x224ae5-0x0;var _0x1814a0=_0xb09e[_0x224ae5];return _0x1814a0;};'use strict';var _=require(_0xeb09('0x0'));var util=require(_0xeb09('0x1'));var moment=require(_0xeb09('0x2'));var BPromise=require(_0xeb09('0x3'));var rs=require(_0xeb09('0x4'));var fs=require('fs');var Redis=require(_0xeb09('0x5'));var db=require(_0xeb09('0x6'))['db'];var utils=require(_0xeb09('0x7'));var logger=require(_0xeb09('0x8'))('rpc');var config=require(_0xeb09('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb09('0xa')][_0xeb09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3b68,_0x1480fa,_0x2ae241){return new BPromise(function(_0x59f01f,_0x1438cb){return client[_0xeb09('0xc')](_0x5e3b68,_0x2ae241)[_0xeb09('0xd')](function(_0x3292dc){logger['info'](_0xeb09('0xe'),_0x1480fa,_0xeb09('0xf'));logger[_0xeb09('0x10')](_0xeb09('0x11'),_0x1480fa,_0xeb09('0xf'),JSON[_0xeb09('0x12')](_0x3292dc));if(_0x3292dc[_0xeb09('0x13')]){if(_0x3292dc[_0xeb09('0x13')][_0xeb09('0x14')]===0x1f4){logger['error'](_0xeb09('0xe'),_0x1480fa,_0x3292dc['error']['message']);return _0x1438cb(_0x3292dc[_0xeb09('0x13')][_0xeb09('0x15')]);}logger[_0xeb09('0x13')](_0xeb09('0xe'),_0x1480fa,_0x3292dc[_0xeb09('0x13')]['message']);return _0x59f01f(_0x3292dc['error'][_0xeb09('0x15')]);}else{logger['info'](_0xeb09('0xe'),_0x1480fa,'request\x20sent');_0x59f01f(_0x3292dc[_0xeb09('0x16')][_0xeb09('0x15')]);}})['catch'](function(_0x3af2e5){logger[_0xeb09('0x13')](_0xeb09('0xe'),_0x1480fa,_0x3af2e5);_0x1438cb(_0x3af2e5);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7924863..f598810 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 _0x0909=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x374785,_0x4f71b8){var _0x572c40=function(_0x1cf7b0){while(--_0x1cf7b0){_0x374785['push'](_0x374785['shift']());}};_0x572c40(++_0x4f71b8);}(_0x0909,0x139));var _0x9090=function(_0x3b9398,_0x5c54c7){_0x3b9398=_0x3b9398-0x0;var _0x44932a=_0x0909[_0x3b9398];return _0x44932a;};'use strict';var multer=require(_0x9090('0x0'));var util=require(_0x9090('0x1'));var path=require(_0x9090('0x2'));var timeout=require(_0x9090('0x3'));var express=require(_0x9090('0x4'));var router=express[_0x9090('0x5')]();var auth=require(_0x9090('0x6'));var interaction=require(_0x9090('0x7'));var config=require(_0x9090('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x9090('0x9')]('/',auth[_0x9090('0xa')](),controller[_0x9090('0xb')]);router[_0x9090('0x9')](_0x9090('0xc'),auth[_0x9090('0xa')](),controller[_0x9090('0xd')]);router[_0x9090('0xe')]('/',auth[_0x9090('0xa')](),controller[_0x9090('0xf')]);router['put'](_0x9090('0xc'),auth[_0x9090('0xa')](),controller[_0x9090('0x10')]);router[_0x9090('0x11')](_0x9090('0xc'),auth[_0x9090('0xa')](),controller[_0x9090('0x12')]);module[_0x9090('0x13')]=router; \ No newline at end of file +var _0xb4e1=['get','index','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54e9b8,_0x466af1){var _0x2478bc=function(_0x28dfed){while(--_0x28dfed){_0x54e9b8['push'](_0x54e9b8['shift']());}};_0x2478bc(++_0x466af1);}(_0xb4e1,0xd1));var _0x1b4e=function(_0x349a53,_0x595767){_0x349a53=_0x349a53-0x0;var _0x4440bd=_0xb4e1[_0x349a53];return _0x4440bd;};'use strict';var multer=require('multer');var util=require(_0x1b4e('0x0'));var path=require(_0x1b4e('0x1'));var timeout=require(_0x1b4e('0x2'));var express=require(_0x1b4e('0x3'));var router=express['Router']();var auth=require(_0x1b4e('0x4'));var interaction=require(_0x1b4e('0x5'));var config=require(_0x1b4e('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x1b4e('0x7')]('/',auth['isAuthenticated'](),controller[_0x1b4e('0x8')]);router[_0x1b4e('0x7')]('/:id',auth[_0x1b4e('0x9')](),controller[_0x1b4e('0xa')]);router[_0x1b4e('0xb')]('/',auth[_0x1b4e('0x9')](),controller['create']);router[_0x1b4e('0xc')](_0x1b4e('0xd'),auth[_0x1b4e('0x9')](),controller[_0x1b4e('0xe')]);router[_0x1b4e('0xf')](_0x1b4e('0xd'),auth[_0x1b4e('0x9')](),controller[_0x1b4e('0x10')]);module[_0x1b4e('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5b520e9..f691abd 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 _0xb325=['exports','STRING'];(function(_0xee1228,_0x2df586){var _0x210f17=function(_0x5b4d31){while(--_0x5b4d31){_0xee1228['push'](_0xee1228['shift']());}};_0x210f17(++_0x2df586);}(_0xb325,0x19c));var _0x5b32=function(_0x565367,_0x34a99d){_0x565367=_0x565367-0x0;var _0x19bf43=_0xb325[_0x565367];return _0x19bf43;};'use strict';var Sequelize=require('sequelize');module[_0x5b32('0x0')]={'name':{'type':Sequelize[_0x5b32('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5b32('0x1')]}}; \ No newline at end of file +var _0x6099=['sequelize','STRING'];(function(_0x1a04c3,_0x44b93c){var _0x149841=function(_0x271856){while(--_0x271856){_0x1a04c3['push'](_0x1a04c3['shift']());}};_0x149841(++_0x44b93c);}(_0x6099,0x1b4));var _0x9609=function(_0x3c54af,_0x76fb8){_0x3c54af=_0x3c54af-0x0;var _0x39c6d6=_0x6099[_0x3c54af];return _0x39c6d6;};'use strict';var Sequelize=require(_0x9609('0x0'));module['exports']={'name':{'type':Sequelize[_0x9609('0x1')]},'basename':{'type':Sequelize[_0x9609('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 e920e1b..2fa46d8 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 _0x6743=['type','VIRTUAL','field','options','count','includeAll','findAll','catch','params','include','find','body','create','file','basename','filename','findOne','download','join','root','server/files/attachments/','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where'];(function(_0xb35d42,_0x136b8a){var _0x14daff=function(_0x3e4f38){while(--_0x3e4f38){_0xb35d42['push'](_0xb35d42['shift']());}};_0x14daff(++_0x136b8a);}(_0x6743,0x155));var _0x3674=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x6743[_0x2059df];return _0xdd848b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3674('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3674('0x1'));var moment=require(_0x3674('0x2'));var BPromise=require(_0x3674('0x3'));var Mustache=require(_0x3674('0x4'));var util=require(_0x3674('0x5'));var path=require(_0x3674('0x6'));var sox=require(_0x3674('0x7'));var csv=require(_0x3674('0x8'));var ejs=require(_0x3674('0x9'));var fs=require('fs');var _=require(_0x3674('0xa'));var squel=require(_0x3674('0xb'));var crypto=require('crypto');var jsforce=require(_0x3674('0xc'));var deskjs=require(_0x3674('0xd'));var toCsv=require(_0x3674('0x8'));var querystring=require(_0x3674('0xe'));var Papa=require('papaparse');var Redis=require(_0x3674('0xf'));var authService=require(_0x3674('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3674('0x11'))(_0x3674('0x12'));var utils=require(_0x3674('0x13'));var config=require(_0x3674('0x14'));var db=require(_0x3674('0x15'))['db'];function respondWithStatusCode(_0x5b8eae,_0x2f253b){_0x2f253b=_0x2f253b||0xcc;return function(_0x13f94c){if(_0x13f94c){return _0x5b8eae[_0x3674('0x16')](_0x2f253b);}return _0x5b8eae[_0x3674('0x17')](_0x2f253b)['end']();};}function respondWithResult(_0x40e281,_0x4e42f0){_0x4e42f0=_0x4e42f0||0xc8;return function(_0x46581d){if(_0x46581d){return _0x40e281[_0x3674('0x17')](_0x4e42f0)[_0x3674('0x18')](_0x46581d);}};}function respondWithFilteredResult(_0x470eb0,_0x33c636){return function(_0x5de61f){if(_0x5de61f){var _0x21204f=_0x5de61f['count'],_0xc3dc31=_0x33c636[_0x3674('0x19')],_0x34dc6f=_0x33c636['offset']+_0x33c636[_0x3674('0x1a')],_0x3f6d52;if(_0x34dc6f>=_0x21204f){_0x34dc6f=_0x21204f;_0x3f6d52=0xc8;}else{_0x3f6d52=0xce;}_0x470eb0[_0x3674('0x17')](_0x3f6d52);return _0x470eb0[_0x3674('0x1b')](_0x3674('0x1c'),_0xc3dc31+'-'+_0x34dc6f+'/'+_0x21204f)['json'](_0x5de61f);}return null;};}function patchUpdates(_0x12e66b){return function(_0xed030f){try{jsonpatch[_0x3674('0x1d')](_0xed030f,_0x12e66b,!![]);}catch(_0x467b1f){return BPromise[_0x3674('0x1e')](_0x467b1f);}return _0xed030f[_0x3674('0x1f')]();};}function saveUpdates(_0x1a8f7d,_0x54ec3b){return function(_0xf440d4){if(_0xf440d4){return _0xf440d4[_0x3674('0x20')](_0x1a8f7d)[_0x3674('0x21')](function(_0x3a3849){return _0x3a3849;});}return null;};}function removeEntity(_0x21521a,_0x458dce){return function(_0x50a21d){if(_0x50a21d){return _0x50a21d[_0x3674('0x22')]()[_0x3674('0x21')](function(){_0x21521a[_0x3674('0x17')](0xcc)[_0x3674('0x23')]();});}};}function handleEntityNotFound(_0x15f5e3,_0x59956f){return function(_0x5ccf35){if(!_0x5ccf35){_0x15f5e3[_0x3674('0x16')](0x194);}return _0x5ccf35;};}function handleError(_0xd4b55a,_0x460deb){_0x460deb=_0x460deb||0x1f4;return function(_0x3bdab2){logger[_0x3674('0x24')](_0x3bdab2[_0x3674('0x25')]);if(_0x3bdab2['name']){delete _0x3bdab2[_0x3674('0x26')];}_0xd4b55a[_0x3674('0x17')](_0x460deb)[_0x3674('0x27')](_0x3bdab2);};}exports[_0x3674('0x28')]=function(_0x449d25,_0xae6eec){var _0x45659d={},_0x696cd0={},_0x23a6f8={'count':0x0,'rows':[]};var _0x31d205=db[_0x3674('0x29')][_0x3674('0x2a')];_0x696cd0[_0x3674('0x2b')]=_[_0x3674('0x2c')](_0x31d205);_0x696cd0[_0x3674('0x2d')]=_['keys'](_0x449d25['query']);_0x696cd0[_0x3674('0x2e')]=_[_0x3674('0x2f')](_0x696cd0[_0x3674('0x2b')],_0x696cd0[_0x3674('0x2d')]);_0x45659d[_0x3674('0x30')]=_[_0x3674('0x2f')](_0x696cd0[_0x3674('0x2b')],qs[_0x3674('0x31')](_0x449d25['query'][_0x3674('0x31')]));_0x45659d['attributes']=_0x45659d[_0x3674('0x30')][_0x3674('0x32')]?_0x45659d[_0x3674('0x30')]:_0x696cd0[_0x3674('0x2b')];if(!_0x449d25[_0x3674('0x2d')][_0x3674('0x33')](_0x3674('0x34'))){_0x45659d['limit']=qs[_0x3674('0x1a')](_0x449d25[_0x3674('0x2d')][_0x3674('0x1a')]);_0x45659d[_0x3674('0x19')]=qs[_0x3674('0x19')](_0x449d25[_0x3674('0x2d')][_0x3674('0x19')]);}_0x45659d[_0x3674('0x35')]=qs['sort'](_0x449d25['query'][_0x3674('0x36')]);_0x45659d['where']=qs[_0x3674('0x2e')](_[_0x3674('0x37')](_0x449d25[_0x3674('0x2d')],_0x696cd0[_0x3674('0x2e')]));if(_0x449d25[_0x3674('0x2d')][_0x3674('0x38')]){_0x45659d['where']=_[_0x3674('0x39')](_0x45659d[_0x3674('0x3a')],{'$or':_['map'](_0x31d205,function(_0x551dcc){if(_0x551dcc[_0x3674('0x3b')]['key']!==_0x3674('0x3c')){var _0x231fd1={};_0x231fd1[_0x551dcc[_0x3674('0x3d')]]={'$like':'%'+_0x449d25[_0x3674('0x2d')][_0x3674('0x38')]+'%'};return _0x231fd1;}})});}_0x45659d=_[_0x3674('0x39')]({},_0x45659d,_0x449d25[_0x3674('0x3e')]);var _0x42d122={'where':_0x45659d[_0x3674('0x3a')]};return db[_0x3674('0x29')]['count'](_0x42d122)['then'](function(_0x4c8d7c){_0x23a6f8[_0x3674('0x3f')]=_0x4c8d7c;if(_0x449d25[_0x3674('0x2d')][_0x3674('0x40')]){_0x45659d['include']=[{'all':!![]}];}return db[_0x3674('0x29')][_0x3674('0x41')](_0x45659d);})[_0x3674('0x21')](function(_0x38af4d){_0x23a6f8['rows']=_0x38af4d;return _0x23a6f8;})[_0x3674('0x21')](respondWithFilteredResult(_0xae6eec,_0x45659d))[_0x3674('0x42')](handleError(_0xae6eec,null));};exports['show']=function(_0x5a5712,_0x4cc28e){var _0x442dee={'raw':!![],'where':{'id':_0x5a5712[_0x3674('0x43')]['id']}},_0x433ca8={};_0x433ca8[_0x3674('0x2b')]=_[_0x3674('0x2c')](db[_0x3674('0x29')][_0x3674('0x2a')]);_0x433ca8['query']=_[_0x3674('0x2c')](_0x5a5712[_0x3674('0x2d')]);_0x433ca8[_0x3674('0x2e')]=_[_0x3674('0x2f')](_0x433ca8[_0x3674('0x2b')],_0x433ca8['query']);_0x442dee['attributes']=_['intersection'](_0x433ca8[_0x3674('0x2b')],qs[_0x3674('0x31')](_0x5a5712[_0x3674('0x2d')][_0x3674('0x31')]));_0x442dee[_0x3674('0x30')]=_0x442dee[_0x3674('0x30')][_0x3674('0x32')]?_0x442dee[_0x3674('0x30')]:_0x433ca8[_0x3674('0x2b')];if(_0x5a5712[_0x3674('0x2d')][_0x3674('0x40')]){_0x442dee[_0x3674('0x44')]=[{'all':!![]}];}_0x442dee=_[_0x3674('0x39')]({},_0x442dee,_0x5a5712[_0x3674('0x3e')]);return db[_0x3674('0x29')][_0x3674('0x45')](_0x442dee)['then'](handleEntityNotFound(_0x4cc28e,null))[_0x3674('0x21')](respondWithResult(_0x4cc28e,null))['catch'](handleError(_0x4cc28e,null));};exports[_0x3674('0x20')]=function(_0x453f76,_0x44da56){if(_0x453f76['body']['id']){delete _0x453f76[_0x3674('0x46')]['id'];}return db['Attachment'][_0x3674('0x45')]({'where':{'id':_0x453f76['params']['id']}})[_0x3674('0x21')](handleEntityNotFound(_0x44da56,null))[_0x3674('0x21')](saveUpdates(_0x453f76[_0x3674('0x46')],null))['then'](respondWithResult(_0x44da56,null))[_0x3674('0x42')](handleError(_0x44da56,null));};exports[_0x3674('0x22')]=function(_0x5743fc,_0x518323){return db[_0x3674('0x29')][_0x3674('0x45')]({'where':{'id':_0x5743fc[_0x3674('0x43')]['id']}})[_0x3674('0x21')](handleEntityNotFound(_0x518323,null))[_0x3674('0x21')](removeEntity(_0x518323,null))[_0x3674('0x42')](handleError(_0x518323,null));};exports[_0x3674('0x47')]=function(_0x5639b0,_0x103a5f,_0x545cdf){_0x5639b0[_0x3674('0x46')]['name']=_0x5639b0[_0x3674('0x48')]['originalname'];_0x5639b0[_0x3674('0x46')][_0x3674('0x49')]=_0x5639b0[_0x3674('0x48')][_0x3674('0x4a')];_0x5639b0[_0x3674('0x46')]['type']=_0x5639b0[_0x3674('0x48')]['mimetype'];return db[_0x3674('0x29')][_0x3674('0x47')](_0x5639b0['body'])['then'](respondWithResult(_0x103a5f,0xc9))[_0x3674('0x42')](handleError(_0x103a5f,null));};exports['download']=function(_0x23dd3a,_0xd2b7d7,_0x9f0685){return db['Attachment'][_0x3674('0x4b')]({'where':{'id':_0x23dd3a[_0x3674('0x43')]['id']},'raw':!![]})[_0x3674('0x21')](handleEntityNotFound(_0xd2b7d7,null))[_0x3674('0x21')](function(_0x1ce6db){if(_0x1ce6db){return _0xd2b7d7[_0x3674('0x4c')](path[_0x3674('0x4d')](config[_0x3674('0x4e')],_0x3674('0x4f'),_0x1ce6db['basename']));}})[_0x3674('0x42')](handleError(_0xd2b7d7,null));}; \ No newline at end of file +var _0x25ab=['filter','map','type','key','field','options','includeAll','include','findAll','rows','params','merge','find','catch','body','destroy','create','originalname','basename','file','filename','findOne','download','server/files/attachments/','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','apply','reject','save','update','then','sendStatus','name','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x25ab,0x148));var _0xb25a=function(_0x602d07,_0x4d8901){_0x602d07=_0x602d07-0x0;var _0x46d892=_0x25ab[_0x602d07];return _0x46d892;};'use strict';var pdf=require(_0xb25a('0x0'));var emlformat=require(_0xb25a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb25a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb25a('0x3'));var moment=require(_0xb25a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb25a('0x5'));var util=require(_0xb25a('0x6'));var path=require('path');var sox=require(_0xb25a('0x7'));var csv=require(_0xb25a('0x8'));var ejs=require(_0xb25a('0x9'));var fs=require('fs');var _=require(_0xb25a('0xa'));var squel=require('squel');var crypto=require(_0xb25a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb25a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb25a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb25a('0xe'));var authService=require(_0xb25a('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb25a('0x10'));var logger=require(_0xb25a('0x11'))(_0xb25a('0x12'));var utils=require(_0xb25a('0x13'));var config=require('../../config/environment');var db=require(_0xb25a('0x14'))['db'];function respondWithStatusCode(_0x5169ad,_0x376769){_0x376769=_0x376769||0xcc;return function(_0x3fd5bf){if(_0x3fd5bf){return _0x5169ad['sendStatus'](_0x376769);}return _0x5169ad[_0xb25a('0x15')](_0x376769)[_0xb25a('0x16')]();};}function respondWithResult(_0x1cad8c,_0x16c622){_0x16c622=_0x16c622||0xc8;return function(_0x412256){if(_0x412256){return _0x1cad8c[_0xb25a('0x15')](_0x16c622)[_0xb25a('0x17')](_0x412256);}};}function respondWithFilteredResult(_0x529f16,_0x7fad5e){return function(_0x2bd7d9){if(_0x2bd7d9){var _0x38dcc1=_0x2bd7d9[_0xb25a('0x18')],_0x322a38=_0x7fad5e[_0xb25a('0x19')],_0xdc14c7=_0x7fad5e[_0xb25a('0x19')]+_0x7fad5e['limit'],_0x3f1b8f;if(_0xdc14c7>=_0x38dcc1){_0xdc14c7=_0x38dcc1;_0x3f1b8f=0xc8;}else{_0x3f1b8f=0xce;}_0x529f16[_0xb25a('0x15')](_0x3f1b8f);return _0x529f16['set']('Content-Range',_0x322a38+'-'+_0xdc14c7+'/'+_0x38dcc1)[_0xb25a('0x17')](_0x2bd7d9);}return null;};}function patchUpdates(_0x544e4c){return function(_0x430935){try{jsonpatch[_0xb25a('0x1a')](_0x430935,_0x544e4c,!![]);}catch(_0xb10bb4){return BPromise[_0xb25a('0x1b')](_0xb10bb4);}return _0x430935[_0xb25a('0x1c')]();};}function saveUpdates(_0x3d8d68,_0x343f4b){return function(_0x5cccd0){if(_0x5cccd0){return _0x5cccd0[_0xb25a('0x1d')](_0x3d8d68)[_0xb25a('0x1e')](function(_0x4562d0){return _0x4562d0;});}return null;};}function removeEntity(_0xf30731,_0x22c69f){return function(_0x562a43){if(_0x562a43){return _0x562a43['destroy']()[_0xb25a('0x1e')](function(){_0xf30731[_0xb25a('0x15')](0xcc)[_0xb25a('0x16')]();});}};}function handleEntityNotFound(_0x18ea0c,_0x40cb2d){return function(_0x34ff4c){if(!_0x34ff4c){_0x18ea0c[_0xb25a('0x1f')](0x194);}return _0x34ff4c;};}function handleError(_0x54cb23,_0x2087f6){_0x2087f6=_0x2087f6||0x1f4;return function(_0xb69cdb){logger['error'](_0xb69cdb['stack']);if(_0xb69cdb[_0xb25a('0x20')]){delete _0xb69cdb[_0xb25a('0x20')];}_0x54cb23[_0xb25a('0x15')](_0x2087f6)[_0xb25a('0x21')](_0xb69cdb);};}exports[_0xb25a('0x22')]=function(_0x550030,_0x32a0b3){var _0x5039fd={},_0x2f85f9={},_0x12aefb={'count':0x0,'rows':[]};var _0x3749b2=db[_0xb25a('0x23')][_0xb25a('0x24')];_0x2f85f9[_0xb25a('0x25')]=_[_0xb25a('0x26')](_0x3749b2);_0x2f85f9[_0xb25a('0x27')]=_[_0xb25a('0x26')](_0x550030[_0xb25a('0x27')]);_0x2f85f9[_0xb25a('0x28')]=_[_0xb25a('0x29')](_0x2f85f9[_0xb25a('0x25')],_0x2f85f9['query']);_0x5039fd['attributes']=_['intersection'](_0x2f85f9[_0xb25a('0x25')],qs['fields'](_0x550030[_0xb25a('0x27')][_0xb25a('0x2a')]));_0x5039fd[_0xb25a('0x2b')]=_0x5039fd[_0xb25a('0x2b')][_0xb25a('0x2c')]?_0x5039fd[_0xb25a('0x2b')]:_0x2f85f9[_0xb25a('0x25')];if(!_0x550030[_0xb25a('0x27')][_0xb25a('0x2d')](_0xb25a('0x2e'))){_0x5039fd['limit']=qs[_0xb25a('0x2f')](_0x550030[_0xb25a('0x27')]['limit']);_0x5039fd[_0xb25a('0x19')]=qs['offset'](_0x550030[_0xb25a('0x27')][_0xb25a('0x19')]);}_0x5039fd[_0xb25a('0x30')]=qs[_0xb25a('0x31')](_0x550030[_0xb25a('0x27')][_0xb25a('0x31')]);_0x5039fd[_0xb25a('0x32')]=qs['filters'](_[_0xb25a('0x33')](_0x550030['query'],_0x2f85f9['filters']));if(_0x550030[_0xb25a('0x27')][_0xb25a('0x34')]){_0x5039fd['where']=_['merge'](_0x5039fd[_0xb25a('0x32')],{'$or':_[_0xb25a('0x35')](_0x3749b2,function(_0x54e85d){if(_0x54e85d[_0xb25a('0x36')][_0xb25a('0x37')]!=='VIRTUAL'){var _0x1b75cb={};_0x1b75cb[_0x54e85d[_0xb25a('0x38')]]={'$like':'%'+_0x550030['query'][_0xb25a('0x34')]+'%'};return _0x1b75cb;}})});}_0x5039fd=_['merge']({},_0x5039fd,_0x550030[_0xb25a('0x39')]);var _0x34f84b={'where':_0x5039fd['where']};return db['Attachment'][_0xb25a('0x18')](_0x34f84b)[_0xb25a('0x1e')](function(_0x2609c7){_0x12aefb[_0xb25a('0x18')]=_0x2609c7;if(_0x550030[_0xb25a('0x27')][_0xb25a('0x3a')]){_0x5039fd[_0xb25a('0x3b')]=[{'all':!![]}];}return db[_0xb25a('0x23')][_0xb25a('0x3c')](_0x5039fd);})['then'](function(_0x3fba1e){_0x12aefb[_0xb25a('0x3d')]=_0x3fba1e;return _0x12aefb;})['then'](respondWithFilteredResult(_0x32a0b3,_0x5039fd))['catch'](handleError(_0x32a0b3,null));};exports['show']=function(_0x34d0d3,_0x5f6e0f){var _0x590883={'raw':!![],'where':{'id':_0x34d0d3[_0xb25a('0x3e')]['id']}},_0x43e914={};_0x43e914['model']=_[_0xb25a('0x26')](db[_0xb25a('0x23')][_0xb25a('0x24')]);_0x43e914[_0xb25a('0x27')]=_['keys'](_0x34d0d3[_0xb25a('0x27')]);_0x43e914[_0xb25a('0x28')]=_['intersection'](_0x43e914[_0xb25a('0x25')],_0x43e914['query']);_0x590883['attributes']=_[_0xb25a('0x29')](_0x43e914['model'],qs[_0xb25a('0x2a')](_0x34d0d3[_0xb25a('0x27')][_0xb25a('0x2a')]));_0x590883[_0xb25a('0x2b')]=_0x590883[_0xb25a('0x2b')][_0xb25a('0x2c')]?_0x590883['attributes']:_0x43e914['model'];if(_0x34d0d3[_0xb25a('0x27')][_0xb25a('0x3a')]){_0x590883['include']=[{'all':!![]}];}_0x590883=_[_0xb25a('0x3f')]({},_0x590883,_0x34d0d3['options']);return db[_0xb25a('0x23')][_0xb25a('0x40')](_0x590883)[_0xb25a('0x1e')](handleEntityNotFound(_0x5f6e0f,null))[_0xb25a('0x1e')](respondWithResult(_0x5f6e0f,null))[_0xb25a('0x41')](handleError(_0x5f6e0f,null));};exports[_0xb25a('0x1d')]=function(_0x3f31b5,_0x332c2e){if(_0x3f31b5[_0xb25a('0x42')]['id']){delete _0x3f31b5['body']['id'];}return db[_0xb25a('0x23')][_0xb25a('0x40')]({'where':{'id':_0x3f31b5[_0xb25a('0x3e')]['id']}})[_0xb25a('0x1e')](handleEntityNotFound(_0x332c2e,null))['then'](saveUpdates(_0x3f31b5['body'],null))['then'](respondWithResult(_0x332c2e,null))[_0xb25a('0x41')](handleError(_0x332c2e,null));};exports[_0xb25a('0x43')]=function(_0x5d22ef,_0x48cb9e){return db[_0xb25a('0x23')][_0xb25a('0x40')]({'where':{'id':_0x5d22ef[_0xb25a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x48cb9e,null))['then'](removeEntity(_0x48cb9e,null))['catch'](handleError(_0x48cb9e,null));};exports[_0xb25a('0x44')]=function(_0x183cac,_0x4ab001,_0x18adcf){_0x183cac['body'][_0xb25a('0x20')]=_0x183cac['file'][_0xb25a('0x45')];_0x183cac[_0xb25a('0x42')][_0xb25a('0x46')]=_0x183cac[_0xb25a('0x47')][_0xb25a('0x48')];_0x183cac['body']['type']=_0x183cac['file']['mimetype'];return db['Attachment'][_0xb25a('0x44')](_0x183cac['body'])['then'](respondWithResult(_0x4ab001,0xc9))[_0xb25a('0x41')](handleError(_0x4ab001,null));};exports['download']=function(_0x3d1d44,_0x4c4ab0,_0x18ff66){return db['Attachment'][_0xb25a('0x49')]({'where':{'id':_0x3d1d44[_0xb25a('0x3e')]['id']},'raw':!![]})[_0xb25a('0x1e')](handleEntityNotFound(_0x4c4ab0,null))[_0xb25a('0x1e')](function(_0x464bd2){if(_0x464bd2){return _0x4c4ab0[_0xb25a('0x4a')](path['join'](config['root'],_0xb25a('0x4b'),_0x464bd2[_0xb25a('0x46')]));}})[_0xb25a('0x41')](handleError(_0x4c4ab0,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9333c42..06a7f56 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 _0x847d=['util','../../config/logger','api','bluebird','path','rimraf','./attachment.attributes','exports','Attachment','attachments'];(function(_0x3a55d0,_0x4bc35c){var _0xb8c328=function(_0x7b348f){while(--_0x7b348f){_0x3a55d0['push'](_0x3a55d0['shift']());}};_0xb8c328(++_0x4bc35c);}(_0x847d,0x14a));var _0xd847=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x847d[_0x124f88];return _0xed0e3b;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var logger=require(_0xd847('0x1'))(_0xd847('0x2'));var moment=require('moment');var BPromise=require(_0xd847('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd847('0x4'));var rimraf=require(_0xd847('0x5'));var config=require('../../config/environment');var attributes=require(_0xd847('0x6'));module[_0xd847('0x7')]=function(_0x375a88,_0x13d8d4){return _0x375a88['define'](_0xd847('0x8'),attributes,{'tableName':_0xd847('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fef=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','api','bluebird','request-promise'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x4fef,0x10f));var _0xf4fe=function(_0x375079,_0x50b054){_0x375079=_0x375079-0x0;var _0x3b6793=_0x4fef[_0x375079];return _0x3b6793;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var logger=require('../../config/logger')(_0xf4fe('0x2'));var moment=require('moment');var BPromise=require(_0xf4fe('0x3'));var rp=require(_0xf4fe('0x4'));var fs=require('fs');var path=require(_0xf4fe('0x5'));var rimraf=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var attributes=require(_0xf4fe('0x8'));module[_0xf4fe('0x9')]=function(_0x27c6c9,_0x522427){return _0x27c6c9[_0xf4fe('0xa')](_0xf4fe('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index aa648ec..728e74d 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 _0xebd3=['info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','lodash','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3b1c9a,_0x50c419){var _0x5ee955=function(_0x3e1eae){while(--_0x3e1eae){_0x3b1c9a['push'](_0x3b1c9a['shift']());}};_0x5ee955(++_0x50c419);}(_0xebd3,0x194));var _0x3ebd=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xebd3[_0x3d27ba];return _0xf01885;};'use strict';var _=require(_0x3ebd('0x0'));var util=require('util');var moment=require(_0x3ebd('0x1'));var BPromise=require('bluebird');var rs=require(_0x3ebd('0x2'));var fs=require('fs');var Redis=require(_0x3ebd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ebd('0x4'));var config=require(_0x3ebd('0x5'));var jayson=require(_0x3ebd('0x6'));var client=jayson[_0x3ebd('0x7')][_0x3ebd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaf0f66,_0x3c1c3f,_0x163009){return new BPromise(function(_0x3981ab,_0x11034e){return client['request'](_0xaf0f66,_0x163009)[_0x3ebd('0x9')](function(_0x527525){logger[_0x3ebd('0xa')](_0x3ebd('0xb'),_0x3c1c3f,_0x3ebd('0xc'));logger['debug'](_0x3ebd('0xd'),_0x3c1c3f,'request\x20sent',JSON[_0x3ebd('0xe')](_0x527525));if(_0x527525['error']){if(_0x527525[_0x3ebd('0xf')][_0x3ebd('0x10')]===0x1f4){logger[_0x3ebd('0xf')](_0x3ebd('0xb'),_0x3c1c3f,_0x527525[_0x3ebd('0xf')]['message']);return _0x11034e(_0x527525[_0x3ebd('0xf')][_0x3ebd('0x11')]);}logger['error'](_0x3ebd('0xb'),_0x3c1c3f,_0x527525[_0x3ebd('0xf')][_0x3ebd('0x11')]);return _0x3981ab(_0x527525['error']['message']);}else{logger[_0x3ebd('0xa')]('Attachment,\x20%s,\x20%s',_0x3c1c3f,_0x3ebd('0xc'));_0x3981ab(_0x527525[_0x3ebd('0x12')][_0x3ebd('0x11')]);}})[_0x3ebd('0x13')](function(_0x3f6278){logger[_0x3ebd('0xf')](_0x3ebd('0xb'),_0x3c1c3f,_0x3f6278);_0x11034e(_0x3f6278);});});}exports[_0x3ebd('0x14')]=function(_0x115dd3){var _0x59b1b3=this;return new Promise(function(_0x4bdb2e,_0x57b40e){return db[_0x3ebd('0x15')]['create'](_0x115dd3[_0x3ebd('0x16')],{'raw':_0x115dd3['options']?_0x115dd3['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xce49bf){logger[_0x3ebd('0xa')]('CreateAttachment',_0x115dd3);logger['debug'](_0x3ebd('0x14'),_0x115dd3,JSON[_0x3ebd('0xe')](_0xce49bf));_0x4bdb2e(_0xce49bf);})[_0x3ebd('0x13')](function(_0x53f61f){logger[_0x3ebd('0xf')](_0x3ebd('0x14'),_0x53f61f[_0x3ebd('0x11')],_0x115dd3);_0x57b40e(_0x59b1b3[_0x3ebd('0xf')](0x1f4,_0x53f61f['message']));});});}; \ No newline at end of file +var _0xb78e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','body','options','lodash','util'];(function(_0x3b1186,_0x1940a4){var _0x4e874d=function(_0x301f43){while(--_0x301f43){_0x3b1186['push'](_0x3b1186['shift']());}};_0x4e874d(++_0x1940a4);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5455f6,_0x5ea188){_0x5455f6=_0x5455f6-0x0;var _0x88d088=_0xb78e[_0x5455f6];return _0x88d088;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('Attachment,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});}exports[_0xeb78('0x17')]=function(_0x92e410){var _0x576802=this;return new Promise(function(_0x45176e,_0xb97756){return db[_0xeb78('0x18')]['create'](_0x92e410[_0xeb78('0x19')],{'raw':_0x92e410[_0xeb78('0x1a')]?_0x92e410['options']['raw']===undefined?!![]:![]:!![]})[_0xeb78('0xc')](function(_0x106c5d){logger[_0xeb78('0xd')](_0xeb78('0x17'),_0x92e410);logger[_0xeb78('0x10')](_0xeb78('0x17'),_0x92e410,JSON[_0xeb78('0x12')](_0x106c5d));_0x45176e(_0x106c5d);})[_0xeb78('0x16')](function(_0x18f08d){logger['error']('CreateAttachment',_0x18f08d['message'],_0x92e410);_0xb97756(_0x576802['error'](0x1f4,_0x18f08d[_0xeb78('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d32e5f8..8b564dc 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 _0x8a55=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','single','file','update','delete','destroy','exports','multer'];(function(_0x58e652,_0x229f5f){var _0x954284=function(_0x462188){while(--_0x462188){_0x58e652['push'](_0x58e652['shift']());}};_0x954284(++_0x229f5f);}(_0x8a55,0x185));var _0x58a5=function(_0x25758a,_0x41191f){_0x25758a=_0x25758a-0x0;var _0x5dcb12=_0x8a55[_0x25758a];return _0x5dcb12;};'use strict';var multer=require(_0x58a5('0x0'));var util=require(_0x58a5('0x1'));var path=require(_0x58a5('0x2'));var timeout=require(_0x58a5('0x3'));var express=require(_0x58a5('0x4'));var router=express[_0x58a5('0x5')]();var auth=require(_0x58a5('0x6'));var interaction=require(_0x58a5('0x7'));var config=require('../../config/environment');var controller=require(_0x58a5('0x8'));router[_0x58a5('0x9')]('/',auth[_0x58a5('0xa')](),controller[_0x58a5('0xb')]);router[_0x58a5('0x9')](_0x58a5('0xc'),auth[_0x58a5('0xa')](),controller[_0x58a5('0xd')]);router[_0x58a5('0x9')]('/:id/download',auth[_0x58a5('0xa')](),controller[_0x58a5('0xe')]);var upload=multer({'storage':multer[_0x58a5('0xf')]({'destination':function(_0x2eec28,_0x3b13fe,_0x22e655){_0x22e655(null,path[_0x58a5('0x10')](config[_0x58a5('0x11')],_0x58a5('0x12')));},'filename':function(_0x2f6bd9,_0x2b1785,_0x328ae0){_0x328ae0(null,util[_0x58a5('0x13')](_0x58a5('0x14'),Date['now'](),_0x2b1785[_0x58a5('0x15')][_0x58a5('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x58a5('0x17')]('/',upload[_0x58a5('0x18')](_0x58a5('0x19')),controller['create']);router['put'](_0x58a5('0xc'),auth[_0x58a5('0xa')](),controller[_0x58a5('0x1a')]);router[_0x58a5('0x1b')](_0x58a5('0xc'),auth['isAuthenticated'](),controller[_0x58a5('0x1c')]);module[_0x58a5('0x1d')]=router; \ No newline at end of file +var _0xf874=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','post','single','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x2295bb,_0x3cefe9){var _0x259dbe=function(_0x1c91cc){while(--_0x1c91cc){_0x2295bb['push'](_0x2295bb['shift']());}};_0x259dbe(++_0x3cefe9);}(_0xf874,0x177));var _0x4f87=function(_0xaf09e5,_0x755250){_0xaf09e5=_0xaf09e5-0x0;var _0x6911ea=_0xf874[_0xaf09e5];return _0x6911ea;};'use strict';var multer=require(_0x4f87('0x0'));var util=require('util');var path=require(_0x4f87('0x1'));var timeout=require(_0x4f87('0x2'));var express=require(_0x4f87('0x3'));var router=express[_0x4f87('0x4')]();var auth=require(_0x4f87('0x5'));var interaction=require(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var controller=require('./attachment.controller');router[_0x4f87('0x8')]('/',auth[_0x4f87('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4f87('0x8')]('/:id/download',auth[_0x4f87('0x9')](),controller[_0x4f87('0xa')]);var upload=multer({'storage':multer[_0x4f87('0xb')]({'destination':function(_0xf43741,_0x4dfb28,_0x25dea7){_0x25dea7(null,path[_0x4f87('0xc')](config[_0x4f87('0xd')],_0x4f87('0xe')));},'filename':function(_0x1faa4e,_0x442128,_0x41a053){_0x41a053(null,util[_0x4f87('0xf')](_0x4f87('0x10'),Date[_0x4f87('0x11')](),_0x442128[_0x4f87('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4f87('0x13')]('/',upload[_0x4f87('0x14')]('file'),controller['create']);router[_0x4f87('0x15')]('/:id',auth[_0x4f87('0x9')](),controller[_0x4f87('0x16')]);router[_0x4f87('0x17')](_0x4f87('0x18'),auth[_0x4f87('0x9')](),controller[_0x4f87('0x19')]);module[_0x4f87('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a45c8c3..2c982fa 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 _0xfd7b=['passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','email','use','callbackURL','allowedLoginAttempts','blockDuration','then','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','getLicense','catch','passport'];(function(_0x1be03a,_0x3bd43f){var _0x162495=function(_0x1bc785){while(--_0x1bc785){_0x1be03a['push'](_0x1be03a['shift']());}};_0x162495(++_0x3bd43f);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xfd7b[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var passport=require(_0xbfd7('0x0'));var GoogleStrategy=require(_0xbfd7('0x1'))[_0xbfd7('0x2')];var moment=require(_0xbfd7('0x3'));var db=require(_0xbfd7('0x4'))['db'];var config=require(_0xbfd7('0x5'));var signToken=require(_0xbfd7('0x6'))[_0xbfd7('0x7')];var utils=require(_0xbfd7('0x8'));exports[_0xbfd7('0x9')]=passport[_0xbfd7('0xa')](_0xbfd7('0xb'),{'failureRedirect':_0xbfd7('0xc'),'scope':['profile',_0xbfd7('0xd')],'session':![]});exports['callback']=passport[_0xbfd7('0xa')]('google',{'failureRedirect':_0xbfd7('0xc'),'session':![]});passport[_0xbfd7('0xe')](new GoogleStrategy({'clientID':config[_0xbfd7('0xb')]?config[_0xbfd7('0xb')]['clientID']:'id','clientSecret':config[_0xbfd7('0xb')]?config[_0xbfd7('0xb')]['clientSecret']:'secret','callbackURL':config[_0xbfd7('0xb')]?config[_0xbfd7('0xb')][_0xbfd7('0xf')]:''},function(_0x116de2,_0x3784a5,_0x559eca,_0x46feae){var _0x534d66,_0x28566c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xbfd7('0x10'),_0xbfd7('0x11')],'raw':!![]})[_0xbfd7('0x12')](function(_0x371592){_0x534d66=_0x371592;return db['User']['find']({'where':{'email':_['map'](_0x559eca[_0xbfd7('0x13')],_0xbfd7('0x14')),'role':{'$or':[_0xbfd7('0x15'),_0xbfd7('0x16'),_0xbfd7('0x17')]}}});})[_0xbfd7('0x12')](function(_0x137d50){_0x28566c=_0x137d50;if(_0x28566c){if(_0x28566c[_0xbfd7('0x18')]){return _0x46feae(_0xbfd7('0x19'));}else if(_0x534d66['blockDuration']>0x0){if(_0x28566c['blocked']){if(moment(_0x28566c[_0xbfd7('0x1a')])[_0xbfd7('0x1b')](_0x534d66['blockDuration'],'minutes')>moment()){return _0x46feae(_0xbfd7('0x19'));}else{return utils['clearBlockUser'](_0x28566c,0x0,![],null)['then'](function(){return utils[_0xbfd7('0x1c')](_0x28566c);})['then'](function(){return _0x46feae(null,_0x28566c);});}}else{return utils[_0xbfd7('0x1c')](_0x28566c)[_0xbfd7('0x12')](function(){return _0x46feae(null,_0x28566c);});}}else{return utils[_0xbfd7('0x1c')](_0x28566c)[_0xbfd7('0x12')](function(){return _0x46feae(null,_0x28566c);});}}return _0x46feae('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xbfd7('0x1d')](function(_0x32a489){_0x46feae(_0x32a489);});})); \ No newline at end of file +var _0xbfe8=['Strategy','moment','../../components/auth/service','signToken','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','passport'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x1840c3,_0x2c1a5b){_0x1840c3=_0x1840c3-0x0;var _0x5d126f=_0xbfe8[_0x1840c3];return _0x5d126f;};'use strict';var _=require('lodash');var passport=require(_0x8bfe('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x8bfe('0x1')];var moment=require(_0x8bfe('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x8bfe('0x3'))[_0x8bfe('0x4')];var utils=require('../../config/utils');exports[_0x8bfe('0x5')]=passport[_0x8bfe('0x6')](_0x8bfe('0x7'),{'failureRedirect':'/login','scope':[_0x8bfe('0x8'),_0x8bfe('0x9')],'session':![]});exports[_0x8bfe('0xa')]=passport[_0x8bfe('0x6')](_0x8bfe('0x7'),{'failureRedirect':_0x8bfe('0xb'),'session':![]});passport[_0x8bfe('0xc')](new GoogleStrategy({'clientID':config[_0x8bfe('0x7')]?config[_0x8bfe('0x7')][_0x8bfe('0xd')]:'id','clientSecret':config[_0x8bfe('0x7')]?config[_0x8bfe('0x7')][_0x8bfe('0xe')]:_0x8bfe('0xf'),'callbackURL':config[_0x8bfe('0x7')]?config['google'][_0x8bfe('0x10')]:''},function(_0x47ec9b,_0x2b4d7d,_0x2f479d,_0x22a131){var _0x5ba48c,_0x54d78d;return db[_0x8bfe('0x11')][_0x8bfe('0x12')]({'where':{'id':0x1},'attributes':[_0x8bfe('0x13'),_0x8bfe('0x14')],'raw':!![]})[_0x8bfe('0x15')](function(_0x4965b3){_0x5ba48c=_0x4965b3;return db[_0x8bfe('0x16')][_0x8bfe('0x17')]({'where':{'email':_['map'](_0x2f479d[_0x8bfe('0x18')],_0x8bfe('0x19')),'role':{'$or':[_0x8bfe('0x1a'),'user','agent']}}});})[_0x8bfe('0x15')](function(_0x5019ba){_0x54d78d=_0x5019ba;if(_0x54d78d){if(_0x54d78d['disabled']){return _0x22a131(_0x8bfe('0x1b'));}else if(_0x5ba48c[_0x8bfe('0x14')]>0x0){if(_0x54d78d[_0x8bfe('0x1c')]){if(moment(_0x54d78d[_0x8bfe('0x1d')])[_0x8bfe('0x1e')](_0x5ba48c[_0x8bfe('0x14')],_0x8bfe('0x1f'))>moment()){return _0x22a131('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x8bfe('0x20')](_0x54d78d,0x0,![],null)['then'](function(){return utils[_0x8bfe('0x21')](_0x54d78d);})[_0x8bfe('0x15')](function(){return _0x22a131(null,_0x54d78d);});}}else{return utils[_0x8bfe('0x21')](_0x54d78d)['then'](function(){return _0x22a131(null,_0x54d78d);});}}else{return utils['getLicense'](_0x54d78d)[_0x8bfe('0x15')](function(){return _0x22a131(null,_0x54d78d);});}}return _0x22a131('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0xef5e81){_0x22a131(_0xef5e81);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6fc87ca..ef71fef 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 _0x1523=['setTokenCookie','exports','passport','Router','./authGoogle.controller','get','login','callback','isMiddleware'];(function(_0x573a27,_0x26d295){var _0x49f7c0=function(_0x1a88ff){while(--_0x1a88ff){_0x573a27['push'](_0x573a27['shift']());}};_0x49f7c0(++_0x26d295);}(_0x1523,0x17c));var _0x3152=function(_0x4b1bb0,_0x7dc32b){_0x4b1bb0=_0x4b1bb0-0x0;var _0x549407=_0x1523[_0x4b1bb0];return _0x549407;};'use strict';var express=require('express');var passport=require(_0x3152('0x0'));var router=express[_0x3152('0x1')]();var controller=require(_0x3152('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x3152('0x3')]('/',controller[_0x3152('0x4')]);router[_0x3152('0x3')]('/callback',controller[_0x3152('0x5')],authService[_0x3152('0x6')],userController['login'],authService[_0x3152('0x7')]);module[_0x3152('0x8')]=router; \ No newline at end of file +var _0x0ca7=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','login'];(function(_0x5a9ba9,_0x316a7f){var _0x12e5df=function(_0x209974){while(--_0x209974){_0x5a9ba9['push'](_0x5a9ba9['shift']());}};_0x12e5df(++_0x316a7f);}(_0x0ca7,0x19f));var _0x70ca=function(_0x1162f9,_0x35f87c){_0x1162f9=_0x1162f9-0x0;var _0x75257c=_0x0ca7[_0x1162f9];return _0x75257c;};'use strict';var express=require(_0x70ca('0x0'));var passport=require(_0x70ca('0x1'));var router=express['Router']();var controller=require(_0x70ca('0x2'));var userController=require(_0x70ca('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x70ca('0x4')]);router['get'](_0x70ca('0x5'),controller[_0x70ca('0x6')],authService[_0x70ca('0x7')],userController[_0x70ca('0x4')],authService[_0x70ca('0x8')]);module[_0x70ca('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 50c055b..dd4440e 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 _0xae61=['request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','send','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','signToken','client','http','findOne','blockDuration','then','name','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','email'];(function(_0xabb8c0,_0x2bb6f2){var _0x244e48=function(_0x4a4439){while(--_0x4a4439){_0xabb8c0['push'](_0xabb8c0['shift']());}};_0x244e48(++_0x2bb6f2);}(_0xae61,0x12f));var _0x1ae6=function(_0x1b76d3,_0x4146b4){_0x1b76d3=_0x1b76d3-0x0;var _0x7cf2a8=_0xae61[_0x1b76d3];return _0x7cf2a8;};'use strict';var util=require(_0x1ae6('0x0'));var passport=require(_0x1ae6('0x1'));var LocalStrategy=require(_0x1ae6('0x2'))[_0x1ae6('0x3')];var jayson=require(_0x1ae6('0x4'));var _=require(_0x1ae6('0x5'));var rs=require(_0x1ae6('0x6'));var moment=require(_0x1ae6('0x7'));var db=require(_0x1ae6('0x8'))['db'];var signToken=require(_0x1ae6('0x9'))[_0x1ae6('0xa')];var utils=require('../../config/utils');var client=jayson[_0x1ae6('0xb')][_0x1ae6('0xc')]({'port':0x232b});function localAuthenticate(_0x400edb,_0x3bd29e,_0x22dac0,_0x21684a){var _0x1a6f6f,_0x23299d;return db['Setting'][_0x1ae6('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1ae6('0xe')],'raw':!![]})[_0x1ae6('0xf')](function(_0x21aea9){_0x1a6f6f=_0x21aea9;return _0x400edb[_0x1ae6('0xd')]({'attributes':['id',_0x1ae6('0x10'),'password',_0x1ae6('0x11'),_0x1ae6('0x12'),_0x1ae6('0x13'),_0x1ae6('0x14'),'blockedAt',_0x1ae6('0x15')],'where':{'name':_0x3bd29e,'role':{'$or':[_0x1ae6('0x16'),_0x1ae6('0x17'),_0x1ae6('0x18')]}}});})[_0x1ae6('0xf')](function(_0x2992dd){if(!_0x2992dd||_0x2992dd&&_0x2992dd[_0x1ae6('0x10')]!==_0x3bd29e){throw new Error(_0x1ae6('0x19'));}else{_0x23299d=_0x2992dd;return _0x23299d;}})[_0x1ae6('0xf')](function(){_0x23299d['authenticate'](_0x22dac0,function(_0x40d718,_0xa6e0b2){var _0x2aabe0=_0x23299d[_0x1ae6('0x15')]+0x1;if(_0x40d718){return _0x21684a(_0x40d718);}else if(!_0xa6e0b2){if(_0x23299d[_0x1ae6('0x13')]){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}else if(_0x1a6f6f[_0x1ae6('0x1a')]>0x0){if(_0x23299d['blocked']){if(_0x1a6f6f[_0x1ae6('0xe')]>0x0){if(moment(_0x23299d[_0x1ae6('0x1b')])['add'](_0x1a6f6f['blockDuration'],_0x1ae6('0x1c'))>moment()){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}else{return utils[_0x1ae6('0x1d')](_0x23299d,_0x2aabe0,![],null)[_0x1ae6('0xf')](function(){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});});}}else{return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}}else{if(_0x2aabe0>=_0x1a6f6f[_0x1ae6('0x1a')]){return utils[_0x1ae6('0x1d')](_0x23299d,0x0,!![],moment())['then'](function(){return _0x21684a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x23299d,_0x2aabe0,![],null)['then'](function(){return _0x21684a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}}else{if(_0x23299d[_0x1ae6('0x13')]){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}else if(_0x1a6f6f['allowedLoginAttempts']>0x0){if(_0x23299d[_0x1ae6('0x14')]){if(_0x1a6f6f[_0x1ae6('0xe')]>0x0){if(moment(_0x23299d['blockedAt'])[_0x1ae6('0x1e')](_0x1a6f6f[_0x1ae6('0xe')],_0x1ae6('0x1c'))>moment()){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}else{return utils[_0x1ae6('0x1d')](_0x23299d,0x0,![],null)[_0x1ae6('0xf')](function(){return utils['getLicense'](_0x23299d);})[_0x1ae6('0xf')](function(){return _0x21684a(null,_0x23299d);});}}else{return _0x21684a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x1ae6('0x1d')](_0x23299d,0x0,![],null)['then'](function(){return utils[_0x1ae6('0x1f')](_0x23299d);})['then'](function(){return _0x21684a(null,_0x23299d);})['catch'](function(_0x594964){return _0x21684a(null,![],_0x594964);});}}else{if(_0x23299d['blocked']){return _0x21684a(null,![],{'message':_0x1ae6('0x19')});}else{return utils[_0x1ae6('0x1f')](_0x23299d)['then'](function(){return _0x21684a(null,_0x23299d);});}}}});})[_0x1ae6('0x20')](function(_0x496aaf){return _0x21684a(null,![],_0x496aaf);});}function sendServiceMail(_0x50b861){return db['MailAccount'][_0x1ae6('0x21')]({'where':{'service':!![]},'attributes':['id',_0x1ae6('0x10'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x1ae6('0x22')}]})[_0x1ae6('0xf')](function(_0x55a2b4){if(!_0x55a2b4){throw new Error(_0x1ae6('0x23'));}var _0x361f30={'tls':{'rejectUnauthorized':![]}};if(_0x55a2b4[_0x1ae6('0x22')][_0x1ae6('0x24')]){_0x361f30[_0x1ae6('0x24')]=_0x55a2b4[_0x1ae6('0x22')][_0x1ae6('0x24')];}else{_0x361f30[_0x1ae6('0x25')]=_0x55a2b4[_0x1ae6('0x22')]['host'];_0x361f30[_0x1ae6('0x26')]=_0x55a2b4[_0x1ae6('0x22')]['port'];_0x361f30['secure']=_0x55a2b4[_0x1ae6('0x22')][_0x1ae6('0x27')];}if(_0x55a2b4['Smtp'][_0x1ae6('0x28')]){_0x361f30[_0x1ae6('0x29')]={'user':_0x55a2b4['Smtp']['user'],'pass':_0x55a2b4[_0x1ae6('0x22')][_0x1ae6('0x2a')]};}var _0x1811a3={'account':_0x361f30,'message':_[_0x1ae6('0x2b')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x55a2b4[_0x1ae6('0x10')],_0x55a2b4[_0x1ae6('0x2c')]||_0x55a2b4[_0x1ae6('0x22')][_0x1ae6('0x17')])},_0x50b861)};return client[_0x1ae6('0x2d')](_0x1ae6('0x2e'),_0x1811a3);})[_0x1ae6('0xf')](function(_0x59b04a){if(_0x59b04a[_0x1ae6('0x2f')]){throw new Error(util[_0x1ae6('0x30')](_0x1ae6('0x31'),_0x59b04a[_0x1ae6('0x2f')][_0x1ae6('0x32')]||JSON[_0x1ae6('0x33')](_0x59b04a['error'])));}return!![];});}function handleError(_0x397266,_0x4ecb4a,_0x207c9b){return _0x397266[_0x1ae6('0x34')](_0x4ecb4a||0x1f4)['send']({'message':_0x207c9b?_0x207c9b['message']||_0x207c9b:''});}function checkPasswordPattern(_0x320742,_0x2426bc,_0x248b67){if(_0x248b67){var _0x3e8574=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e8574[_0x1ae6('0x35')](_0x2426bc)){return _0x320742;}else{throw new Error(_0x1ae6('0x36'));}}else{return _0x320742;}}exports[_0x1ae6('0x37')]=function(_0x20572d,_0x4bb317,_0xba9164){passport['authenticate'](_0x1ae6('0x38'),function(_0x246b84,_0x73582e,_0x340770){var _0x4a2219=_0x246b84||_0x340770;if(_0x4a2219){return handleError(_0x4bb317,0x191,_0x4a2219);}if(!_0x73582e){return handleError(_0x4bb317,0x194,{'message':_0x1ae6('0x39')});}else{var _0x3eb3e0=signToken(_0x73582e['id'],_0x73582e[_0x1ae6('0x12')]);_0x4bb317[_0x1ae6('0x3a')]({'id':_0x73582e['id'],'token':_0x3eb3e0,'statusCall':'','isAlreadyLogged':_0x73582e[_0x1ae6('0x3b')]});}})(_0x20572d,_0x4bb317,_0xba9164);};exports[_0x1ae6('0x3c')]=function(_0x41f13e,_0x3f1fee,_0xff0a53){if(!_0x41f13e[_0x1ae6('0x3d')][_0x1ae6('0x2c')]){return handleError(_0x3f1fee,0x1f4,{'message':_0x1ae6('0x3e')});}var _0x482427=rs[_0x1ae6('0x3f')]();_0x41f13e[_0x1ae6('0x3d')][_0x1ae6('0x2c')]=_0x41f13e[_0x1ae6('0x3d')][_0x1ae6('0x2c')][_0x1ae6('0x40')]()['toLowerCase']();var _0x349fd4;return db[_0x1ae6('0x41')][_0x1ae6('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1ae6('0xe')],'raw':!![]})[_0x1ae6('0xf')](function(_0x4f668c){_0x349fd4=_0x4f668c;return db[_0x1ae6('0x42')][_0x1ae6('0x21')]({'where':{'email':_0x41f13e[_0x1ae6('0x3d')][_0x1ae6('0x2c')]}});})[_0x1ae6('0xf')](function(_0x247d8c){if(!_0x247d8c){throw new Error(_0x1ae6('0x43'));}if(_0x247d8c[_0x1ae6('0x13')]){throw new Error(_0x1ae6('0x44'));}if(_0x247d8c[_0x1ae6('0x14')]){if(moment(_0x247d8c[_0x1ae6('0x1b')])[_0x1ae6('0x1e')](_0x349fd4[_0x1ae6('0xe')],_0x1ae6('0x1c'))>moment()){throw new Error(_0x1ae6('0x45'));}else{_0x247d8c[_0x1ae6('0x14')]=![];_0x247d8c[_0x1ae6('0x1b')]=null;}}_0x247d8c[_0x1ae6('0x46')]=_0x482427;_0x247d8c['resetPasswordExpires']=Date[_0x1ae6('0x47')]()+0x36ee80;return _0x247d8c[_0x1ae6('0x48')]();})[_0x1ae6('0xf')](function(){return sendServiceMail({'to':_0x41f13e[_0x1ae6('0x3d')][_0x1ae6('0x2c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x1ae6('0x49')+_0x1ae6('0x4a')+_0x1ae6('0x4b')+_0x41f13e[_0x1ae6('0x4c')][_0x1ae6('0x25')]+'/reset/'+_0x482427+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x1ae6('0xf')](function(){_0x3f1fee['status'](0xc8)[_0x1ae6('0x4d')]({'message':_0x1ae6('0x4e')});})['catch'](function(_0x5e530a){return handleError(_0x3f1fee,0x1f4,_0x5e530a);});};exports[_0x1ae6('0x4f')]=function(_0xda44ef,_0x3f35e4,_0x123561){var _0x51e8b4;return db[_0x1ae6('0x42')]['find']({'where':{'resetPasswordToken':_0xda44ef['params'][_0x1ae6('0x50')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x1ae6('0xf')](function(_0x58b71a){_0x51e8b4=_0x58b71a;if(!_0x51e8b4){throw new Error(_0x1ae6('0x51'));}return db['Setting']['findOne']({'attributes':['id',_0x1ae6('0x52')]});})[_0x1ae6('0xf')](function(_0x5106a6){return checkPasswordPattern(_0x5106a6,_0xda44ef[_0x1ae6('0x3d')][_0x1ae6('0x53')],_0x5106a6[_0x1ae6('0x52')]);})['then'](function(){_0x51e8b4[_0x1ae6('0x53')]=_0xda44ef[_0x1ae6('0x3d')][_0x1ae6('0x53')];_0x51e8b4['resetPasswordToken']=null;_0x51e8b4[_0x1ae6('0x54')]=null;return _0x51e8b4[_0x1ae6('0x48')]();})[_0x1ae6('0xf')](function(){_0x3f35e4[_0x1ae6('0x34')](0xc8)['send']({'message':_0x1ae6('0x55')});})['catch'](function(_0x42dc78){return handleError(_0x3f35e4,0x1f4,_0x42dc78);});};passport[_0x1ae6('0x56')](new LocalStrategy({'usernameField':_0x1ae6('0x10'),'passwordField':_0x1ae6('0x53')},function(_0x4c2708,_0x196ab4,_0x3752c4){return localAuthenticate(db['User'],_0x4c2708,_0x196ab4,_0x3752c4);})); \ No newline at end of file +var _0xd55c=['headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','securePassword','Password\x20reset!','util','passport','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://'];(function(_0x1739c3,_0x3b6e96){var _0x12f6fb=function(_0x12b958){while(--_0x12b958){_0x1739c3['push'](_0x1739c3['shift']());}};_0x12f6fb(++_0x3b6e96);}(_0xd55c,0x198));var _0xcd55=function(_0x39fcb4,_0x42cb78){_0x39fcb4=_0x39fcb4-0x0;var _0x19a073=_0xd55c[_0x39fcb4];return _0x19a073;};'use strict';var util=require(_0xcd55('0x0'));var passport=require(_0xcd55('0x1'));var LocalStrategy=require('passport-local')[_0xcd55('0x2')];var jayson=require(_0xcd55('0x3'));var _=require(_0xcd55('0x4'));var rs=require(_0xcd55('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var signToken=require(_0xcd55('0x6'))['signToken'];var utils=require('../../config/utils');var client=jayson[_0xcd55('0x7')][_0xcd55('0x8')]({'port':0x232b});function localAuthenticate(_0x1b15e7,_0x3528a5,_0x276732,_0x4faaff){var _0x4e9ea7,_0x174a89;return db[_0xcd55('0x9')][_0xcd55('0xa')]({'where':{'id':0x1},'attributes':[_0xcd55('0xb'),_0xcd55('0xc')],'raw':!![]})[_0xcd55('0xd')](function(_0x4fb740){_0x4e9ea7=_0x4fb740;return _0x1b15e7[_0xcd55('0xa')]({'attributes':['id',_0xcd55('0xe'),_0xcd55('0xf'),_0xcd55('0x10'),_0xcd55('0x11'),'disabled',_0xcd55('0x12'),_0xcd55('0x13'),'loginAttempts'],'where':{'name':_0x3528a5,'role':{'$or':['admin',_0xcd55('0x14'),_0xcd55('0x15')]}}});})['then'](function(_0x1a8472){if(!_0x1a8472||_0x1a8472&&_0x1a8472[_0xcd55('0xe')]!==_0x3528a5){throw new Error(_0xcd55('0x16'));}else{_0x174a89=_0x1a8472;return _0x174a89;}})['then'](function(){_0x174a89[_0xcd55('0x17')](_0x276732,function(_0x17374e,_0x11fc56){var _0x468228=_0x174a89[_0xcd55('0x18')]+0x1;if(_0x17374e){return _0x4faaff(_0x17374e);}else if(!_0x11fc56){if(_0x174a89[_0xcd55('0x19')]){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}else if(_0x4e9ea7[_0xcd55('0xb')]>0x0){if(_0x174a89[_0xcd55('0x12')]){if(_0x4e9ea7[_0xcd55('0xc')]>0x0){if(moment(_0x174a89[_0xcd55('0x13')])['add'](_0x4e9ea7[_0xcd55('0xc')],_0xcd55('0x1a'))>moment()){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}else{return utils[_0xcd55('0x1b')](_0x174a89,_0x468228,![],null)['then'](function(){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});});}}else{return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}}else{if(_0x468228>=_0x4e9ea7[_0xcd55('0xb')]){return utils[_0xcd55('0x1b')](_0x174a89,0x0,!![],moment())['then'](function(){return _0x4faaff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x174a89,_0x468228,![],null)[_0xcd55('0xd')](function(){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});});}}}else{return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}}else{if(_0x174a89[_0xcd55('0x19')]){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}else if(_0x4e9ea7[_0xcd55('0xb')]>0x0){if(_0x174a89['blocked']){if(_0x4e9ea7[_0xcd55('0xc')]>0x0){if(moment(_0x174a89[_0xcd55('0x13')])[_0xcd55('0x1c')](_0x4e9ea7[_0xcd55('0xc')],'minutes')>moment()){return _0x4faaff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcd55('0x1b')](_0x174a89,0x0,![],null)[_0xcd55('0xd')](function(){return utils[_0xcd55('0x1d')](_0x174a89);})['then'](function(){return _0x4faaff(null,_0x174a89);});}}else{return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}}else{return utils[_0xcd55('0x1b')](_0x174a89,0x0,![],null)['then'](function(){return utils[_0xcd55('0x1d')](_0x174a89);})[_0xcd55('0xd')](function(){return _0x4faaff(null,_0x174a89);})[_0xcd55('0x1e')](function(_0x5c8d3e){return _0x4faaff(null,![],_0x5c8d3e);});}}else{if(_0x174a89['blocked']){return _0x4faaff(null,![],{'message':_0xcd55('0x16')});}else{return utils[_0xcd55('0x1d')](_0x174a89)[_0xcd55('0xd')](function(){return _0x4faaff(null,_0x174a89);});}}}});})['catch'](function(_0x6a8c67){return _0x4faaff(null,![],_0x6a8c67);});}function sendServiceMail(_0x48a7e9){return db[_0xcd55('0x1f')][_0xcd55('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xcd55('0x21')],'include':[{'model':db[_0xcd55('0x22')],'as':_0xcd55('0x23')}]})[_0xcd55('0xd')](function(_0x1f3521){if(!_0x1f3521){throw new Error(_0xcd55('0x24'));}var _0x1a3cc9={'tls':{'rejectUnauthorized':![]}};if(_0x1f3521[_0xcd55('0x23')]['service']){_0x1a3cc9[_0xcd55('0x25')]=_0x1f3521[_0xcd55('0x23')][_0xcd55('0x25')];}else{_0x1a3cc9[_0xcd55('0x26')]=_0x1f3521['Smtp'][_0xcd55('0x26')];_0x1a3cc9[_0xcd55('0x27')]=_0x1f3521[_0xcd55('0x23')][_0xcd55('0x27')];_0x1a3cc9[_0xcd55('0x28')]=_0x1f3521['Smtp']['secure'];}if(_0x1f3521[_0xcd55('0x23')]['authentication']){_0x1a3cc9[_0xcd55('0x29')]={'user':_0x1f3521[_0xcd55('0x23')][_0xcd55('0x14')],'pass':_0x1f3521[_0xcd55('0x23')]['pass']};}var _0x39c764={'account':_0x1a3cc9,'message':_[_0xcd55('0x2a')]({'from':util[_0xcd55('0x2b')](_0xcd55('0x2c'),_0x1f3521['name'],_0x1f3521[_0xcd55('0x21')]||_0x1f3521[_0xcd55('0x23')][_0xcd55('0x14')])},_0x48a7e9)};return client[_0xcd55('0x2d')](_0xcd55('0x2e'),_0x39c764);})[_0xcd55('0xd')](function(_0x1ee941){if(_0x1ee941['error']){throw new Error(util[_0xcd55('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1ee941[_0xcd55('0x2f')][_0xcd55('0x30')]||JSON[_0xcd55('0x31')](_0x1ee941[_0xcd55('0x2f')])));}return!![];});}function handleError(_0x54f276,_0x2a5379,_0x41d882){return _0x54f276[_0xcd55('0x32')](_0x2a5379||0x1f4)[_0xcd55('0x33')]({'message':_0x41d882?_0x41d882[_0xcd55('0x30')]||_0x41d882:''});}function checkPasswordPattern(_0xa68fdc,_0x1cccae,_0x3f478d){if(_0x3f478d){var _0x5e80be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e80be['test'](_0x1cccae)){return _0xa68fdc;}else{throw new Error(_0xcd55('0x34'));}}else{return _0xa68fdc;}}exports[_0xcd55('0x35')]=function(_0x2c40c3,_0x497085,_0x126148){passport['authenticate'](_0xcd55('0x36'),function(_0x7bdbbe,_0xbc332,_0x59b432){var _0x21ef8c=_0x7bdbbe||_0x59b432;if(_0x21ef8c){return handleError(_0x497085,0x191,_0x21ef8c);}if(!_0xbc332){return handleError(_0x497085,0x194,{'message':_0xcd55('0x37')});}else{var _0x1fee06=signToken(_0xbc332['id'],_0xbc332[_0xcd55('0x11')]);_0x497085[_0xcd55('0x38')]({'id':_0xbc332['id'],'token':_0x1fee06,'statusCall':'','isAlreadyLogged':_0xbc332[_0xcd55('0x39')]});}})(_0x2c40c3,_0x497085,_0x126148);};exports['forgot']=function(_0x20bce7,_0x47c7bf,_0x597f68){if(!_0x20bce7[_0xcd55('0x3a')][_0xcd55('0x21')]){return handleError(_0x47c7bf,0x1f4,{'message':_0xcd55('0x3b')});}var _0x415961=rs[_0xcd55('0x3c')]();_0x20bce7[_0xcd55('0x3a')][_0xcd55('0x21')]=_0x20bce7[_0xcd55('0x3a')][_0xcd55('0x21')][_0xcd55('0x3d')]()['toLowerCase']();var _0x1b83cd;return db[_0xcd55('0x9')][_0xcd55('0xa')]({'where':{'id':0x1},'attributes':[_0xcd55('0xb'),_0xcd55('0xc')],'raw':!![]})[_0xcd55('0xd')](function(_0x20d70b){_0x1b83cd=_0x20d70b;return db['User']['find']({'where':{'email':_0x20bce7[_0xcd55('0x3a')][_0xcd55('0x21')]}});})[_0xcd55('0xd')](function(_0x18d798){if(!_0x18d798){throw new Error(_0xcd55('0x3e'));}if(_0x18d798[_0xcd55('0x19')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x18d798[_0xcd55('0x12')]){if(moment(_0x18d798[_0xcd55('0x13')])[_0xcd55('0x1c')](_0x1b83cd[_0xcd55('0xc')],_0xcd55('0x1a'))>moment()){throw new Error(_0xcd55('0x3f'));}else{_0x18d798[_0xcd55('0x12')]=![];_0x18d798['blockedAt']=null;}}_0x18d798[_0xcd55('0x40')]=_0x415961;_0x18d798[_0xcd55('0x41')]=Date[_0xcd55('0x42')]()+0x36ee80;return _0x18d798[_0xcd55('0x43')]();})[_0xcd55('0xd')](function(){return sendServiceMail({'to':_0x20bce7[_0xcd55('0x3a')]['email'],'subject':_0xcd55('0x44'),'text':_0xcd55('0x45')+_0xcd55('0x46')+_0xcd55('0x47')+_0x20bce7[_0xcd55('0x48')][_0xcd55('0x26')]+_0xcd55('0x49')+_0x415961+'\x0a\x0a'+_0xcd55('0x4a')});})['then'](function(){_0x47c7bf['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xcd55('0x1e')](function(_0x4acf33){return handleError(_0x47c7bf,0x1f4,_0x4acf33);});};exports['reset']=function(_0x4aaa06,_0x1d7497,_0x555cfb){var _0xdec769;return db[_0xcd55('0x4b')][_0xcd55('0x20')]({'where':{'resetPasswordToken':_0x4aaa06[_0xcd55('0x4c')][_0xcd55('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xcd55('0xd')](function(_0x3d56b0){_0xdec769=_0x3d56b0;if(!_0xdec769){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xcd55('0x9')]['findOne']({'attributes':['id',_0xcd55('0x4e')]});})['then'](function(_0x298de8){return checkPasswordPattern(_0x298de8,_0x4aaa06[_0xcd55('0x3a')]['password'],_0x298de8[_0xcd55('0x4e')]);})[_0xcd55('0xd')](function(){_0xdec769[_0xcd55('0xf')]=_0x4aaa06[_0xcd55('0x3a')][_0xcd55('0xf')];_0xdec769[_0xcd55('0x40')]=null;_0xdec769['resetPasswordExpires']=null;return _0xdec769[_0xcd55('0x43')]();})[_0xcd55('0xd')](function(){_0x1d7497[_0xcd55('0x32')](0xc8)[_0xcd55('0x33')]({'message':_0xcd55('0x4f')});})['catch'](function(_0x3ed4f9){return handleError(_0x1d7497,0x1f4,_0x3ed4f9);});};passport['use'](new LocalStrategy({'usernameField':_0xcd55('0xe'),'passwordField':_0xcd55('0xf')},function(_0x25c168,_0x5286d9,_0x16bf6f){return localAuthenticate(db[_0xcd55('0x4b')],_0x25c168,_0x5286d9,_0x16bf6f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6e9bd0a..4a1d526 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 _0x14cd=['reset','express','Router','./authLocal.controller','post','login','/forgot','/reset/:token'];(function(_0x2765ef,_0x45e7d3){var _0x2aae1a=function(_0x32a331){while(--_0x32a331){_0x2765ef['push'](_0x2765ef['shift']());}};_0x2aae1a(++_0x45e7d3);}(_0x14cd,0x89));var _0xd14c=function(_0x45e13b,_0x4b17c8){_0x45e13b=_0x45e13b-0x0;var _0x358ba1=_0x14cd[_0x45e13b];return _0x358ba1;};'use strict';var express=require(_0xd14c('0x0'));var router=express[_0xd14c('0x1')]();var controller=require(_0xd14c('0x2'));router[_0xd14c('0x3')]('/',controller[_0xd14c('0x4')]);router[_0xd14c('0x3')](_0xd14c('0x5'),controller['forgot']);router[_0xd14c('0x3')](_0xd14c('0x6'),controller[_0xd14c('0x7')]);module['exports']=router; \ No newline at end of file +var _0x61b9=['post','login','/reset/:token','reset','exports','express'];(function(_0x2dbe8d,_0x2cfc75){var _0x34ba51=function(_0x391f93){while(--_0x391f93){_0x2dbe8d['push'](_0x2dbe8d['shift']());}};_0x34ba51(++_0x2cfc75);}(_0x61b9,0x1e5));var _0x961b=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0x61b9[_0x4c06a3];return _0x7ff53c;};'use strict';var express=require(_0x961b('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x961b('0x1')]('/',controller[_0x961b('0x2')]);router['post']('/forgot',controller['forgot']);router['post'](_0x961b('0x3'),controller[_0x961b('0x4')]);module[_0x961b('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 3da1263..20fbfa4 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 _0x88f8=['STRING','INTEGER','exports'];(function(_0x292d66,_0x32c823){var _0x4fd314=function(_0x454727){while(--_0x454727){_0x292d66['push'](_0x292d66['shift']());}};_0x4fd314(++_0x32c823);}(_0x88f8,0xd4));var _0x888f=function(_0x258702,_0x3b72fe){_0x258702=_0x258702-0x0;var _0x1f080e=_0x88f8[_0x258702];return _0x1f080e;};'use strict';var Sequelize=require('sequelize');module[_0x888f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x888f('0x1')]},'description':{'type':Sequelize[_0x888f('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x888f('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xfb71=['sequelize','exports','STRING'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x4c9fc6,_0x5b3cfc){_0x4c9fc6=_0x4c9fc6-0x0;var _0x270c86=_0xfb71[_0x4c9fc6];return _0x270c86;};'use strict';var Sequelize=require(_0x1fb7('0x0'));module[_0x1fb7('0x1')]={'name':{'type':Sequelize[_0x1fb7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1fb7('0x2')]},'description':{'type':Sequelize[_0x1fb7('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 665b258..20f43ef 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 _0xdd2a=['filters','intersection','model','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','Automation','keys','query'];(function(_0x56bb63,_0x3e165b){var _0x56a7ec=function(_0x5a1103){while(--_0x5a1103){_0x56bb63['push'](_0x56bb63['shift']());}};_0x56a7ec(++_0x3e165b);}(_0xdd2a,0x7a));var _0xadd2=function(_0x23666d,_0x2c79a6){_0x23666d=_0x23666d-0x0;var _0x115e21=_0xdd2a[_0x23666d];return _0x115e21;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xadd2('0x0'));var zipdir=require(_0xadd2('0x1'));var jsonpatch=require(_0xadd2('0x2'));var rp=require(_0xadd2('0x3'));var moment=require(_0xadd2('0x4'));var BPromise=require(_0xadd2('0x5'));var Mustache=require('mustache');var util=require(_0xadd2('0x6'));var path=require(_0xadd2('0x7'));var sox=require('sox');var csv=require(_0xadd2('0x8'));var ejs=require(_0xadd2('0x9'));var fs=require('fs');var _=require(_0xadd2('0xa'));var squel=require(_0xadd2('0xb'));var crypto=require('crypto');var jsforce=require(_0xadd2('0xc'));var deskjs=require(_0xadd2('0xd'));var toCsv=require(_0xadd2('0x8'));var querystring=require(_0xadd2('0xe'));var Papa=require(_0xadd2('0xf'));var Redis=require(_0xadd2('0x10'));var authService=require(_0xadd2('0x11'));var qs=require(_0xadd2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadd2('0x13'))(_0xadd2('0x14'));var utils=require(_0xadd2('0x15'));var config=require('../../config/environment');var db=require(_0xadd2('0x16'))['db'];function respondWithStatusCode(_0x2e5460,_0xfde5c2){_0xfde5c2=_0xfde5c2||0xcc;return function(_0x5d304a){if(_0x5d304a){return _0x2e5460[_0xadd2('0x17')](_0xfde5c2);}return _0x2e5460[_0xadd2('0x18')](_0xfde5c2)[_0xadd2('0x19')]();};}function respondWithResult(_0x2e9052,_0x40cbd3){_0x40cbd3=_0x40cbd3||0xc8;return function(_0x4ad08a){if(_0x4ad08a){return _0x2e9052[_0xadd2('0x18')](_0x40cbd3)['json'](_0x4ad08a);}};}function respondWithFilteredResult(_0x15facd,_0x2a6154){return function(_0x3d4452){if(_0x3d4452){var _0x2e25f7=_0x3d4452['count'],_0x522d68=_0x2a6154[_0xadd2('0x1a')],_0x4c78de=_0x2a6154[_0xadd2('0x1a')]+_0x2a6154[_0xadd2('0x1b')],_0x2aae5e;if(_0x4c78de>=_0x2e25f7){_0x4c78de=_0x2e25f7;_0x2aae5e=0xc8;}else{_0x2aae5e=0xce;}_0x15facd[_0xadd2('0x18')](_0x2aae5e);return _0x15facd[_0xadd2('0x1c')](_0xadd2('0x1d'),_0x522d68+'-'+_0x4c78de+'/'+_0x2e25f7)['json'](_0x3d4452);}return null;};}function patchUpdates(_0x4696df){return function(_0x1a973d){try{jsonpatch[_0xadd2('0x1e')](_0x1a973d,_0x4696df,!![]);}catch(_0x3f771a){return BPromise['reject'](_0x3f771a);}return _0x1a973d[_0xadd2('0x1f')]();};}function saveUpdates(_0x450ccb,_0x3930fe){return function(_0x33ec52){if(_0x33ec52){return _0x33ec52[_0xadd2('0x20')](_0x450ccb)[_0xadd2('0x21')](function(_0x26b340){return _0x26b340;});}return null;};}function removeEntity(_0x48de37,_0x4293f2){return function(_0xf3598f){if(_0xf3598f){return _0xf3598f[_0xadd2('0x22')]()[_0xadd2('0x21')](function(){_0x48de37[_0xadd2('0x18')](0xcc)[_0xadd2('0x19')]();});}};}function handleEntityNotFound(_0x267def,_0x481a25){return function(_0x524430){if(!_0x524430){_0x267def['sendStatus'](0x194);}return _0x524430;};}function handleError(_0x28fa16,_0x3f28c6){_0x3f28c6=_0x3f28c6||0x1f4;return function(_0xf0f205){logger[_0xadd2('0x23')](_0xf0f205['stack']);if(_0xf0f205[_0xadd2('0x24')]){delete _0xf0f205[_0xadd2('0x24')];}_0x28fa16[_0xadd2('0x18')](_0x3f28c6)['send'](_0xf0f205);};}exports['index']=function(_0x3d5e0e,_0x471f7a){var _0xe294f4={},_0x422c7c={},_0x3053ba={'count':0x0,'rows':[]};var _0x551dc3=db[_0xadd2('0x25')]['rawAttributes'];_0x422c7c['model']=_[_0xadd2('0x26')](_0x551dc3);_0x422c7c[_0xadd2('0x27')]=_[_0xadd2('0x26')](_0x3d5e0e[_0xadd2('0x27')]);_0x422c7c[_0xadd2('0x28')]=_[_0xadd2('0x29')](_0x422c7c[_0xadd2('0x2a')],_0x422c7c['query']);_0xe294f4['attributes']=_[_0xadd2('0x29')](_0x422c7c[_0xadd2('0x2a')],qs['fields'](_0x3d5e0e['query']['fields']));_0xe294f4['attributes']=_0xe294f4['attributes'][_0xadd2('0x2b')]?_0xe294f4[_0xadd2('0x2c')]:_0x422c7c[_0xadd2('0x2a')];if(!_0x3d5e0e[_0xadd2('0x27')][_0xadd2('0x2d')](_0xadd2('0x2e'))){_0xe294f4['limit']=qs['limit'](_0x3d5e0e[_0xadd2('0x27')]['limit']);_0xe294f4['offset']=qs['offset'](_0x3d5e0e[_0xadd2('0x27')][_0xadd2('0x1a')]);}_0xe294f4[_0xadd2('0x2f')]=qs[_0xadd2('0x30')](_0x3d5e0e[_0xadd2('0x27')][_0xadd2('0x30')]);_0xe294f4['where']=qs[_0xadd2('0x28')](_[_0xadd2('0x31')](_0x3d5e0e[_0xadd2('0x27')],_0x422c7c['filters']));if(_0x3d5e0e['query'][_0xadd2('0x32')]){_0xe294f4[_0xadd2('0x33')]=_[_0xadd2('0x34')](_0xe294f4[_0xadd2('0x33')],{'$or':_[_0xadd2('0x35')](_0x551dc3,function(_0x498818){if(_0x498818[_0xadd2('0x36')][_0xadd2('0x37')]!==_0xadd2('0x38')){var _0x119609={};_0x119609[_0x498818[_0xadd2('0x39')]]={'$like':'%'+_0x3d5e0e[_0xadd2('0x27')][_0xadd2('0x32')]+'%'};return _0x119609;}})});}_0xe294f4=_[_0xadd2('0x34')]({},_0xe294f4,_0x3d5e0e[_0xadd2('0x3a')]);var _0x4a1656={'where':_0xe294f4['where']};return db[_0xadd2('0x25')][_0xadd2('0x3b')](_0x4a1656)[_0xadd2('0x21')](function(_0x33ba51){_0x3053ba[_0xadd2('0x3b')]=_0x33ba51;if(_0x3d5e0e[_0xadd2('0x27')][_0xadd2('0x3c')]){_0xe294f4[_0xadd2('0x3d')]=[{'all':!![]}];}return db['Automation'][_0xadd2('0x3e')](_0xe294f4);})[_0xadd2('0x21')](function(_0x4c09d1){_0x3053ba[_0xadd2('0x3f')]=_0x4c09d1;return _0x3053ba;})[_0xadd2('0x21')](respondWithFilteredResult(_0x471f7a,_0xe294f4))[_0xadd2('0x40')](handleError(_0x471f7a,null));};exports[_0xadd2('0x41')]=function(_0x3f2423,_0x19c936){var _0x5a8aab={'raw':![],'where':{'id':_0x3f2423['params']['id']}},_0x801a37={};_0x801a37[_0xadd2('0x2a')]=_['keys'](db['Automation']['rawAttributes']);_0x801a37[_0xadd2('0x27')]=_[_0xadd2('0x26')](_0x3f2423['query']);_0x801a37[_0xadd2('0x28')]=_[_0xadd2('0x29')](_0x801a37[_0xadd2('0x2a')],_0x801a37[_0xadd2('0x27')]);_0x5a8aab[_0xadd2('0x2c')]=_[_0xadd2('0x29')](_0x801a37['model'],qs['fields'](_0x3f2423['query'][_0xadd2('0x42')]));_0x5a8aab['attributes']=_0x5a8aab[_0xadd2('0x2c')]['length']?_0x5a8aab[_0xadd2('0x2c')]:_0x801a37[_0xadd2('0x2a')];if(_0x3f2423[_0xadd2('0x27')][_0xadd2('0x3c')]){_0x5a8aab[_0xadd2('0x3d')]=[{'all':!![]}];}_0x5a8aab=_['merge']({},_0x5a8aab,_0x3f2423[_0xadd2('0x3a')]);return db[_0xadd2('0x25')][_0xadd2('0x43')](_0x5a8aab)[_0xadd2('0x21')](handleEntityNotFound(_0x19c936,null))['then'](respondWithResult(_0x19c936,null))[_0xadd2('0x40')](handleError(_0x19c936,null));};exports[_0xadd2('0x44')]=function(_0x2bfae6,_0x11ffb7){return db['Automation'][_0xadd2('0x44')](_0x2bfae6[_0xadd2('0x45')],{})[_0xadd2('0x21')](respondWithResult(_0x11ffb7,0xc9))['catch'](handleError(_0x11ffb7,null));};exports[_0xadd2('0x20')]=function(_0x563488,_0x177be5){if(_0x563488[_0xadd2('0x45')]['id']){delete _0x563488['body']['id'];}return db['Automation'][_0xadd2('0x43')]({'where':{'id':_0x563488[_0xadd2('0x46')]['id']}})[_0xadd2('0x21')](handleEntityNotFound(_0x177be5,null))[_0xadd2('0x21')](saveUpdates(_0x563488[_0xadd2('0x45')],null))[_0xadd2('0x21')](respondWithResult(_0x177be5,null))[_0xadd2('0x40')](handleError(_0x177be5,null));};exports[_0xadd2('0x22')]=function(_0x400498,_0x2b11d5){return db[_0xadd2('0x25')][_0xadd2('0x43')]({'where':{'id':_0x400498[_0xadd2('0x46')]['id']}})[_0xadd2('0x21')](handleEntityNotFound(_0x2b11d5,null))[_0xadd2('0x21')](removeEntity(_0x2b11d5,null))[_0xadd2('0x40')](handleError(_0x2b11d5,null));};exports[_0xadd2('0x47')]=function(_0x27dc2b,_0x45c7de,_0x4f833){return db[_0xadd2('0x48')][_0xadd2('0x43')]({'where':{'id':_0x27dc2b[_0xadd2('0x46')]['id']}})[_0xadd2('0x21')](handleEntityNotFound(_0x45c7de,null))[_0xadd2('0x21')](function(_0x289556){if(_0x289556){return _0x289556['addConditions'](_0x27dc2b[_0xadd2('0x45')][_0xadd2('0x49')],_[_0xadd2('0x4a')](_0x27dc2b[_0xadd2('0x45')],[_0xadd2('0x49'),'id'])||{});}})[_0xadd2('0x21')](respondWithResult(_0x45c7de,null))[_0xadd2('0x40')](handleError(_0x45c7de,null));};exports[_0xadd2('0x4b')]=function(_0x465cfa,_0x24ee91,_0x53558d){var _0x5ebebb={};var _0x25f212={};var _0x2ae5af;var _0x3aa583;return db[_0xadd2('0x25')][_0xadd2('0x4c')]({'where':{'id':_0x465cfa[_0xadd2('0x46')]['id']}})['then'](handleEntityNotFound(_0x24ee91,null))[_0xadd2('0x21')](function(_0x366267){if(_0x366267){_0x2ae5af=_0x366267;_0x25f212['model']=_[_0xadd2('0x26')](db[_0xadd2('0x48')][_0xadd2('0x4d')]);_0x25f212['query']=_[_0xadd2('0x26')](_0x465cfa[_0xadd2('0x27')]);_0x25f212['filters']=_[_0xadd2('0x29')](_0x25f212[_0xadd2('0x2a')],_0x25f212['query']);_0x5ebebb[_0xadd2('0x2c')]=_['intersection'](_0x25f212[_0xadd2('0x2a')],qs[_0xadd2('0x42')](_0x465cfa[_0xadd2('0x27')]['fields']));_0x5ebebb[_0xadd2('0x2c')]=_0x5ebebb['attributes']['length']?_0x5ebebb[_0xadd2('0x2c')]:_0x25f212[_0xadd2('0x2a')];_0x5ebebb[_0xadd2('0x2f')]=qs['sort'](_0x465cfa['query'][_0xadd2('0x30')]);_0x5ebebb['where']=qs[_0xadd2('0x28')](_[_0xadd2('0x31')](_0x465cfa[_0xadd2('0x27')],_0x25f212['filters']));if(_0x465cfa['query']['filter']){_0x5ebebb['where']=_[_0xadd2('0x34')](_0x5ebebb['where'],{'$or':_[_0xadd2('0x35')](_0x5ebebb['attributes'],function(_0x178fa6){var _0x1738c8={};_0x1738c8[_0x178fa6]={'$like':'%'+_0x465cfa[_0xadd2('0x27')][_0xadd2('0x32')]+'%'};return _0x1738c8;})});}_0x5ebebb=_[_0xadd2('0x34')]({},_0x5ebebb,_0x465cfa[_0xadd2('0x3a')]);return _0x2ae5af[_0xadd2('0x4b')](_0x5ebebb);}})[_0xadd2('0x21')](function(_0x55d4ca){if(_0x55d4ca){_0x3aa583=_0x55d4ca[_0xadd2('0x2b')];if(!_0x465cfa['query'][_0xadd2('0x2d')]('nolimit')){_0x5ebebb[_0xadd2('0x1b')]=qs[_0xadd2('0x1b')](_0x465cfa['query'][_0xadd2('0x1b')]);_0x5ebebb[_0xadd2('0x1a')]=qs[_0xadd2('0x1a')](_0x465cfa[_0xadd2('0x27')][_0xadd2('0x1a')]);}return _0x2ae5af['getConditions'](_0x5ebebb);}})[_0xadd2('0x21')](function(_0x4fa8f6){if(_0x4fa8f6){return _0x4fa8f6?{'count':_0x3aa583,'rows':_0x4fa8f6}:null;}})[_0xadd2('0x21')](respondWithResult(_0x24ee91,null))['catch'](handleError(_0x24ee91,null));};exports[_0xadd2('0x4e')]=function(_0x6cc858,_0x380ee3,_0x501c03){return db[_0xadd2('0x4f')][_0xadd2('0x43')]({'where':{'id':_0x6cc858[_0xadd2('0x46')]['id']}})[_0xadd2('0x21')](handleEntityNotFound(_0x380ee3,null))[_0xadd2('0x21')](function(_0x107aee){if(_0x107aee){return _0x107aee[_0xadd2('0x4e')](_0x6cc858[_0xadd2('0x45')][_0xadd2('0x49')],_[_0xadd2('0x4a')](_0x6cc858[_0xadd2('0x45')],[_0xadd2('0x49'),'id'])||{});}})[_0xadd2('0x21')](respondWithResult(_0x380ee3,null))[_0xadd2('0x40')](handleError(_0x380ee3,null));};exports[_0xadd2('0x50')]=function(_0x5f32b1,_0x3e1b60,_0x37af6c){var _0x42dec3={};var _0xc5c8f6={};var _0x54d377;var _0x1e2d36;return db[_0xadd2('0x25')][_0xadd2('0x4c')]({'where':{'id':_0x5f32b1[_0xadd2('0x46')]['id']}})[_0xadd2('0x21')](handleEntityNotFound(_0x3e1b60,null))[_0xadd2('0x21')](function(_0x3606cc){if(_0x3606cc){_0x54d377=_0x3606cc;_0xc5c8f6[_0xadd2('0x2a')]=_[_0xadd2('0x26')](db[_0xadd2('0x4f')]['rawAttributes']);_0xc5c8f6[_0xadd2('0x27')]=_['keys'](_0x5f32b1[_0xadd2('0x27')]);_0xc5c8f6[_0xadd2('0x28')]=_[_0xadd2('0x29')](_0xc5c8f6['model'],_0xc5c8f6[_0xadd2('0x27')]);_0x42dec3[_0xadd2('0x2c')]=_[_0xadd2('0x29')](_0xc5c8f6[_0xadd2('0x2a')],qs['fields'](_0x5f32b1[_0xadd2('0x27')]['fields']));_0x42dec3[_0xadd2('0x2c')]=_0x42dec3[_0xadd2('0x2c')][_0xadd2('0x2b')]?_0x42dec3[_0xadd2('0x2c')]:_0xc5c8f6[_0xadd2('0x2a')];_0x42dec3['order']=qs['sort'](_0x5f32b1['query'][_0xadd2('0x30')]);_0x42dec3['where']=qs[_0xadd2('0x28')](_['pick'](_0x5f32b1[_0xadd2('0x27')],_0xc5c8f6['filters']));if(_0x5f32b1[_0xadd2('0x27')][_0xadd2('0x32')]){_0x42dec3[_0xadd2('0x33')]=_[_0xadd2('0x34')](_0x42dec3[_0xadd2('0x33')],{'$or':_[_0xadd2('0x35')](_0x42dec3['attributes'],function(_0x14a633){var _0x2e1b62={};_0x2e1b62[_0x14a633]={'$like':'%'+_0x5f32b1['query'][_0xadd2('0x32')]+'%'};return _0x2e1b62;})});}_0x42dec3=_['merge']({},_0x42dec3,_0x5f32b1[_0xadd2('0x3a')]);return _0x54d377[_0xadd2('0x50')](_0x42dec3);}})['then'](function(_0x5ce89e){if(_0x5ce89e){_0x1e2d36=_0x5ce89e['length'];if(!_0x5f32b1[_0xadd2('0x27')][_0xadd2('0x2d')](_0xadd2('0x2e'))){_0x42dec3[_0xadd2('0x1b')]=qs[_0xadd2('0x1b')](_0x5f32b1['query'][_0xadd2('0x1b')]);_0x42dec3[_0xadd2('0x1a')]=qs[_0xadd2('0x1a')](_0x5f32b1[_0xadd2('0x27')][_0xadd2('0x1a')]);}return _0x54d377[_0xadd2('0x50')](_0x42dec3);}})[_0xadd2('0x21')](function(_0x28da86){if(_0x28da86){return _0x28da86?{'count':_0x1e2d36,'rows':_0x28da86}:null;}})['then'](respondWithResult(_0x3e1b60,null))[_0xadd2('0x40')](handleError(_0x3e1b60,null));}; \ No newline at end of file +var _0x3f81=['../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','update','then','destroy','error','name','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Condition','addConditions','ids','omit','getConditions','findOne','map','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x5b1e31,_0x27336f){var _0x51288b=function(_0x35623f){while(--_0x35623f){_0x5b1e31['push'](_0x5b1e31['shift']());}};_0x51288b(++_0x27336f);}(_0x3f81,0xdc));var _0x13f8=function(_0x38f1b3,_0x58192f){_0x38f1b3=_0x38f1b3-0x0;var _0x131b07=_0x3f81[_0x38f1b3];return _0x131b07;};'use strict';var pdf=require(_0x13f8('0x0'));var emlformat=require(_0x13f8('0x1'));var rimraf=require(_0x13f8('0x2'));var zipdir=require(_0x13f8('0x3'));var jsonpatch=require(_0x13f8('0x4'));var rp=require('request-promise');var moment=require(_0x13f8('0x5'));var BPromise=require(_0x13f8('0x6'));var Mustache=require('mustache');var util=require(_0x13f8('0x7'));var path=require('path');var sox=require(_0x13f8('0x8'));var csv=require(_0x13f8('0x9'));var ejs=require(_0x13f8('0xa'));var fs=require('fs');var _=require(_0x13f8('0xb'));var squel=require(_0x13f8('0xc'));var crypto=require(_0x13f8('0xd'));var jsforce=require(_0x13f8('0xe'));var deskjs=require(_0x13f8('0xf'));var toCsv=require(_0x13f8('0x9'));var querystring=require(_0x13f8('0x10'));var Papa=require(_0x13f8('0x11'));var Redis=require(_0x13f8('0x12'));var authService=require(_0x13f8('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13f8('0x14'))(_0x13f8('0x15'));var utils=require(_0x13f8('0x16'));var config=require(_0x13f8('0x17'));var db=require(_0x13f8('0x18'))['db'];function respondWithStatusCode(_0x4915a3,_0x367262){_0x367262=_0x367262||0xcc;return function(_0x103c4d){if(_0x103c4d){return _0x4915a3[_0x13f8('0x19')](_0x367262);}return _0x4915a3['status'](_0x367262)[_0x13f8('0x1a')]();};}function respondWithResult(_0x2d369a,_0x2b709b){_0x2b709b=_0x2b709b||0xc8;return function(_0x5e6415){if(_0x5e6415){return _0x2d369a['status'](_0x2b709b)['json'](_0x5e6415);}};}function respondWithFilteredResult(_0x3204ac,_0x318b9e){return function(_0x27d4b4){if(_0x27d4b4){var _0xc2dbbd=_0x27d4b4[_0x13f8('0x1b')],_0x314939=_0x318b9e[_0x13f8('0x1c')],_0x4d53ea=_0x318b9e[_0x13f8('0x1c')]+_0x318b9e[_0x13f8('0x1d')],_0x14d181;if(_0x4d53ea>=_0xc2dbbd){_0x4d53ea=_0xc2dbbd;_0x14d181=0xc8;}else{_0x14d181=0xce;}_0x3204ac[_0x13f8('0x1e')](_0x14d181);return _0x3204ac[_0x13f8('0x1f')](_0x13f8('0x20'),_0x314939+'-'+_0x4d53ea+'/'+_0xc2dbbd)[_0x13f8('0x21')](_0x27d4b4);}return null;};}function patchUpdates(_0x465d43){return function(_0x546934){try{jsonpatch['apply'](_0x546934,_0x465d43,!![]);}catch(_0x2c5420){return BPromise['reject'](_0x2c5420);}return _0x546934['save']();};}function saveUpdates(_0x5e641a,_0x3c1059){return function(_0xde1dab){if(_0xde1dab){return _0xde1dab[_0x13f8('0x22')](_0x5e641a)[_0x13f8('0x23')](function(_0x50796d){return _0x50796d;});}return null;};}function removeEntity(_0x1bc290,_0x33d746){return function(_0x365b7b){if(_0x365b7b){return _0x365b7b[_0x13f8('0x24')]()['then'](function(){_0x1bc290[_0x13f8('0x1e')](0xcc)[_0x13f8('0x1a')]();});}};}function handleEntityNotFound(_0x38cc41,_0x1c531c){return function(_0x1e82d3){if(!_0x1e82d3){_0x38cc41[_0x13f8('0x19')](0x194);}return _0x1e82d3;};}function handleError(_0xa62edc,_0x4c40a8){_0x4c40a8=_0x4c40a8||0x1f4;return function(_0x165015){logger[_0x13f8('0x25')](_0x165015['stack']);if(_0x165015['name']){delete _0x165015[_0x13f8('0x26')];}_0xa62edc[_0x13f8('0x1e')](_0x4c40a8)['send'](_0x165015);};}exports[_0x13f8('0x27')]=function(_0x1d1ad2,_0x4c61d2){var _0x12687a={},_0x3dcfc0={},_0x265fa2={'count':0x0,'rows':[]};var _0x17f298=db[_0x13f8('0x28')][_0x13f8('0x29')];_0x3dcfc0[_0x13f8('0x2a')]=_[_0x13f8('0x2b')](_0x17f298);_0x3dcfc0[_0x13f8('0x2c')]=_[_0x13f8('0x2b')](_0x1d1ad2[_0x13f8('0x2c')]);_0x3dcfc0[_0x13f8('0x2d')]=_[_0x13f8('0x2e')](_0x3dcfc0['model'],_0x3dcfc0[_0x13f8('0x2c')]);_0x12687a[_0x13f8('0x2f')]=_[_0x13f8('0x2e')](_0x3dcfc0[_0x13f8('0x2a')],qs['fields'](_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x30')]));_0x12687a[_0x13f8('0x2f')]=_0x12687a[_0x13f8('0x2f')][_0x13f8('0x31')]?_0x12687a[_0x13f8('0x2f')]:_0x3dcfc0[_0x13f8('0x2a')];if(!_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x32')](_0x13f8('0x33'))){_0x12687a['limit']=qs[_0x13f8('0x1d')](_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x1d')]);_0x12687a[_0x13f8('0x1c')]=qs['offset'](_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x1c')]);}_0x12687a[_0x13f8('0x34')]=qs[_0x13f8('0x35')](_0x1d1ad2['query'][_0x13f8('0x35')]);_0x12687a[_0x13f8('0x36')]=qs['filters'](_[_0x13f8('0x37')](_0x1d1ad2['query'],_0x3dcfc0['filters']));if(_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x38')]){_0x12687a[_0x13f8('0x36')]=_[_0x13f8('0x39')](_0x12687a[_0x13f8('0x36')],{'$or':_['map'](_0x17f298,function(_0x5336e5){if(_0x5336e5[_0x13f8('0x3a')][_0x13f8('0x3b')]!=='VIRTUAL'){var _0x5cb07a={};_0x5cb07a[_0x5336e5['field']]={'$like':'%'+_0x1d1ad2[_0x13f8('0x2c')][_0x13f8('0x38')]+'%'};return _0x5cb07a;}})});}_0x12687a=_[_0x13f8('0x39')]({},_0x12687a,_0x1d1ad2[_0x13f8('0x3c')]);var _0x123bfc={'where':_0x12687a[_0x13f8('0x36')]};return db['Automation'][_0x13f8('0x1b')](_0x123bfc)[_0x13f8('0x23')](function(_0x1bb166){_0x265fa2['count']=_0x1bb166;if(_0x1d1ad2['query'][_0x13f8('0x3d')]){_0x12687a[_0x13f8('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x13f8('0x3f')](_0x12687a);})[_0x13f8('0x23')](function(_0x285d4a){_0x265fa2[_0x13f8('0x40')]=_0x285d4a;return _0x265fa2;})[_0x13f8('0x23')](respondWithFilteredResult(_0x4c61d2,_0x12687a))[_0x13f8('0x41')](handleError(_0x4c61d2,null));};exports[_0x13f8('0x42')]=function(_0x5581df,_0x463855){var _0x12151c={'raw':![],'where':{'id':_0x5581df[_0x13f8('0x43')]['id']}},_0x2b9912={};_0x2b9912[_0x13f8('0x2a')]=_[_0x13f8('0x2b')](db[_0x13f8('0x28')][_0x13f8('0x29')]);_0x2b9912[_0x13f8('0x2c')]=_[_0x13f8('0x2b')](_0x5581df['query']);_0x2b9912['filters']=_[_0x13f8('0x2e')](_0x2b9912[_0x13f8('0x2a')],_0x2b9912[_0x13f8('0x2c')]);_0x12151c[_0x13f8('0x2f')]=_[_0x13f8('0x2e')](_0x2b9912[_0x13f8('0x2a')],qs['fields'](_0x5581df[_0x13f8('0x2c')][_0x13f8('0x30')]));_0x12151c[_0x13f8('0x2f')]=_0x12151c[_0x13f8('0x2f')][_0x13f8('0x31')]?_0x12151c['attributes']:_0x2b9912['model'];if(_0x5581df['query']['includeAll']){_0x12151c[_0x13f8('0x3e')]=[{'all':!![]}];}_0x12151c=_[_0x13f8('0x39')]({},_0x12151c,_0x5581df[_0x13f8('0x3c')]);return db[_0x13f8('0x28')][_0x13f8('0x44')](_0x12151c)[_0x13f8('0x23')](handleEntityNotFound(_0x463855,null))[_0x13f8('0x23')](respondWithResult(_0x463855,null))['catch'](handleError(_0x463855,null));};exports[_0x13f8('0x45')]=function(_0x10170d,_0x295631){return db[_0x13f8('0x28')][_0x13f8('0x45')](_0x10170d[_0x13f8('0x46')],{})[_0x13f8('0x23')](respondWithResult(_0x295631,0xc9))[_0x13f8('0x41')](handleError(_0x295631,null));};exports[_0x13f8('0x22')]=function(_0x16a5ed,_0xc5a8eb){if(_0x16a5ed[_0x13f8('0x46')]['id']){delete _0x16a5ed[_0x13f8('0x46')]['id'];}return db['Automation'][_0x13f8('0x44')]({'where':{'id':_0x16a5ed[_0x13f8('0x43')]['id']}})[_0x13f8('0x23')](handleEntityNotFound(_0xc5a8eb,null))['then'](saveUpdates(_0x16a5ed[_0x13f8('0x46')],null))['then'](respondWithResult(_0xc5a8eb,null))[_0x13f8('0x41')](handleError(_0xc5a8eb,null));};exports['destroy']=function(_0x1b717a,_0x1b313a){return db[_0x13f8('0x28')][_0x13f8('0x44')]({'where':{'id':_0x1b717a[_0x13f8('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b313a,null))[_0x13f8('0x23')](removeEntity(_0x1b313a,null))[_0x13f8('0x41')](handleError(_0x1b313a,null));};exports['addConditions']=function(_0x343d63,_0x5aa6f9,_0x49f7cb){return db[_0x13f8('0x47')][_0x13f8('0x44')]({'where':{'id':_0x343d63['params']['id']}})[_0x13f8('0x23')](handleEntityNotFound(_0x5aa6f9,null))[_0x13f8('0x23')](function(_0x384437){if(_0x384437){return _0x384437[_0x13f8('0x48')](_0x343d63[_0x13f8('0x46')][_0x13f8('0x49')],_[_0x13f8('0x4a')](_0x343d63[_0x13f8('0x46')],['ids','id'])||{});}})[_0x13f8('0x23')](respondWithResult(_0x5aa6f9,null))[_0x13f8('0x41')](handleError(_0x5aa6f9,null));};exports[_0x13f8('0x4b')]=function(_0xf0665a,_0x26dd31,_0x551b12){var _0x5e8543={};var _0x35a33b={};var _0x25b4ec;var _0x4abf5f;return db[_0x13f8('0x28')][_0x13f8('0x4c')]({'where':{'id':_0xf0665a['params']['id']}})[_0x13f8('0x23')](handleEntityNotFound(_0x26dd31,null))['then'](function(_0x5a2361){if(_0x5a2361){_0x25b4ec=_0x5a2361;_0x35a33b['model']=_[_0x13f8('0x2b')](db['Condition'][_0x13f8('0x29')]);_0x35a33b['query']=_[_0x13f8('0x2b')](_0xf0665a[_0x13f8('0x2c')]);_0x35a33b[_0x13f8('0x2d')]=_['intersection'](_0x35a33b[_0x13f8('0x2a')],_0x35a33b[_0x13f8('0x2c')]);_0x5e8543[_0x13f8('0x2f')]=_['intersection'](_0x35a33b[_0x13f8('0x2a')],qs[_0x13f8('0x30')](_0xf0665a['query'][_0x13f8('0x30')]));_0x5e8543[_0x13f8('0x2f')]=_0x5e8543[_0x13f8('0x2f')][_0x13f8('0x31')]?_0x5e8543['attributes']:_0x35a33b['model'];_0x5e8543[_0x13f8('0x34')]=qs[_0x13f8('0x35')](_0xf0665a[_0x13f8('0x2c')][_0x13f8('0x35')]);_0x5e8543[_0x13f8('0x36')]=qs[_0x13f8('0x2d')](_[_0x13f8('0x37')](_0xf0665a['query'],_0x35a33b[_0x13f8('0x2d')]));if(_0xf0665a['query'][_0x13f8('0x38')]){_0x5e8543[_0x13f8('0x36')]=_[_0x13f8('0x39')](_0x5e8543['where'],{'$or':_[_0x13f8('0x4d')](_0x5e8543[_0x13f8('0x2f')],function(_0x546050){var _0x2e0007={};_0x2e0007[_0x546050]={'$like':'%'+_0xf0665a['query'][_0x13f8('0x38')]+'%'};return _0x2e0007;})});}_0x5e8543=_[_0x13f8('0x39')]({},_0x5e8543,_0xf0665a[_0x13f8('0x3c')]);return _0x25b4ec[_0x13f8('0x4b')](_0x5e8543);}})[_0x13f8('0x23')](function(_0x4f40e5){if(_0x4f40e5){_0x4abf5f=_0x4f40e5[_0x13f8('0x31')];if(!_0xf0665a[_0x13f8('0x2c')][_0x13f8('0x32')](_0x13f8('0x33'))){_0x5e8543['limit']=qs[_0x13f8('0x1d')](_0xf0665a[_0x13f8('0x2c')][_0x13f8('0x1d')]);_0x5e8543[_0x13f8('0x1c')]=qs[_0x13f8('0x1c')](_0xf0665a[_0x13f8('0x2c')]['offset']);}return _0x25b4ec[_0x13f8('0x4b')](_0x5e8543);}})[_0x13f8('0x23')](function(_0x26baff){if(_0x26baff){return _0x26baff?{'count':_0x4abf5f,'rows':_0x26baff}:null;}})[_0x13f8('0x23')](respondWithResult(_0x26dd31,null))[_0x13f8('0x41')](handleError(_0x26dd31,null));};exports[_0x13f8('0x4e')]=function(_0x159873,_0x28ac15,_0x56bc62){return db[_0x13f8('0x4f')]['find']({'where':{'id':_0x159873[_0x13f8('0x43')]['id']}})[_0x13f8('0x23')](handleEntityNotFound(_0x28ac15,null))[_0x13f8('0x23')](function(_0x6fd608){if(_0x6fd608){return _0x6fd608[_0x13f8('0x4e')](_0x159873[_0x13f8('0x46')][_0x13f8('0x49')],_['omit'](_0x159873['body'],[_0x13f8('0x49'),'id'])||{});}})[_0x13f8('0x23')](respondWithResult(_0x28ac15,null))[_0x13f8('0x41')](handleError(_0x28ac15,null));};exports[_0x13f8('0x50')]=function(_0x14d4ee,_0x108dae,_0x582537){var _0x3a3e55={};var _0x54db73={};var _0x263746;var _0x443e36;return db[_0x13f8('0x28')][_0x13f8('0x4c')]({'where':{'id':_0x14d4ee[_0x13f8('0x43')]['id']}})[_0x13f8('0x23')](handleEntityNotFound(_0x108dae,null))[_0x13f8('0x23')](function(_0x2c361d){if(_0x2c361d){_0x263746=_0x2c361d;_0x54db73[_0x13f8('0x2a')]=_[_0x13f8('0x2b')](db[_0x13f8('0x4f')][_0x13f8('0x29')]);_0x54db73[_0x13f8('0x2c')]=_[_0x13f8('0x2b')](_0x14d4ee[_0x13f8('0x2c')]);_0x54db73[_0x13f8('0x2d')]=_['intersection'](_0x54db73[_0x13f8('0x2a')],_0x54db73[_0x13f8('0x2c')]);_0x3a3e55['attributes']=_[_0x13f8('0x2e')](_0x54db73['model'],qs['fields'](_0x14d4ee['query'][_0x13f8('0x30')]));_0x3a3e55['attributes']=_0x3a3e55[_0x13f8('0x2f')][_0x13f8('0x31')]?_0x3a3e55[_0x13f8('0x2f')]:_0x54db73[_0x13f8('0x2a')];_0x3a3e55[_0x13f8('0x34')]=qs[_0x13f8('0x35')](_0x14d4ee['query']['sort']);_0x3a3e55[_0x13f8('0x36')]=qs['filters'](_[_0x13f8('0x37')](_0x14d4ee[_0x13f8('0x2c')],_0x54db73['filters']));if(_0x14d4ee[_0x13f8('0x2c')][_0x13f8('0x38')]){_0x3a3e55[_0x13f8('0x36')]=_[_0x13f8('0x39')](_0x3a3e55[_0x13f8('0x36')],{'$or':_['map'](_0x3a3e55[_0x13f8('0x2f')],function(_0x38e4f1){var _0x4822ba={};_0x4822ba[_0x38e4f1]={'$like':'%'+_0x14d4ee[_0x13f8('0x2c')][_0x13f8('0x38')]+'%'};return _0x4822ba;})});}_0x3a3e55=_[_0x13f8('0x39')]({},_0x3a3e55,_0x14d4ee['options']);return _0x263746[_0x13f8('0x50')](_0x3a3e55);}})[_0x13f8('0x23')](function(_0x3430fe){if(_0x3430fe){_0x443e36=_0x3430fe[_0x13f8('0x31')];if(!_0x14d4ee['query'][_0x13f8('0x32')](_0x13f8('0x33'))){_0x3a3e55['limit']=qs[_0x13f8('0x1d')](_0x14d4ee['query'][_0x13f8('0x1d')]);_0x3a3e55['offset']=qs[_0x13f8('0x1c')](_0x14d4ee[_0x13f8('0x2c')][_0x13f8('0x1c')]);}return _0x263746['getActions'](_0x3a3e55);}})[_0x13f8('0x23')](function(_0x18c9c7){if(_0x18c9c7){return _0x18c9c7?{'count':_0x443e36,'rows':_0x18c9c7}:null;}})[_0x13f8('0x23')](respondWithResult(_0x108dae,null))[_0x13f8('0x41')](handleError(_0x108dae,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 7e2cdc0..3486d9d 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 _0xbf0a=['tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','Automation'];(function(_0x5e8bbf,_0x27f32a){var _0x5f4441=function(_0xea19dd){while(--_0xea19dd){_0x5e8bbf['push'](_0x5e8bbf['shift']());}};_0x5f4441(++_0x27f32a);}(_0xbf0a,0xfd));var _0xabf0=function(_0x15c56d,_0x5cfdbc){_0x15c56d=_0x15c56d-0x0;var _0x21b156=_0xbf0a[_0x15c56d];return _0x21b156;};'use strict';var _=require(_0xabf0('0x0'));var util=require('util');var logger=require(_0xabf0('0x1'))(_0xabf0('0x2'));var moment=require(_0xabf0('0x3'));var BPromise=require(_0xabf0('0x4'));var rp=require(_0xabf0('0x5'));var fs=require('fs');var path=require(_0xabf0('0x6'));var rimraf=require('rimraf');var config=require(_0xabf0('0x7'));var attributes=require(_0xabf0('0x8'));module[_0xabf0('0x9')]=function(_0x37697d,_0x37e4f5){return _0x37697d['define'](_0xabf0('0xa'),attributes,{'tableName':_0xabf0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x721a=['bluebird','path','rimraf','exports','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x4c56d1,_0x47eafa){var _0x36215b=function(_0x1cf54b){while(--_0x1cf54b){_0x4c56d1['push'](_0x4c56d1['shift']());}};_0x36215b(++_0x47eafa);}(_0x721a,0xc3));var _0xa721=function(_0x567e61,_0x3c4249){_0x567e61=_0x567e61-0x0;var _0xe62f9f=_0x721a[_0x567e61];return _0xe62f9f;};'use strict';var _=require(_0xa721('0x0'));var util=require(_0xa721('0x1'));var logger=require(_0xa721('0x2'))(_0xa721('0x3'));var moment=require(_0xa721('0x4'));var BPromise=require(_0xa721('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa721('0x6'));var rimraf=require(_0xa721('0x7'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xa721('0x8')]=function(_0x4655b6,_0x145305){return _0x4655b6['define']('Automation',attributes,{'tableName':_0xa721('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 6485c4d..6ec406c 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 _0x3079=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x149dce,_0x4bcecb){var _0x28d9a1=function(_0x5a42d1){while(--_0x5a42d1){_0x149dce['push'](_0x149dce['shift']());}};_0x28d9a1(++_0x4bcecb);}(_0x3079,0x110));var _0x9307=function(_0xbc7d69,_0x2566a0){_0xbc7d69=_0xbc7d69-0x0;var _0x38e946=_0x3079[_0xbc7d69];return _0x38e946;};'use strict';var _=require('lodash');var util=require(_0x9307('0x0'));var moment=require(_0x9307('0x1'));var BPromise=require(_0x9307('0x2'));var rs=require(_0x9307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9307('0x4'))['db'];var utils=require(_0x9307('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9307('0x6'));var jayson=require(_0x9307('0x7'));var client=jayson[_0x9307('0x8')][_0x9307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x215470,_0x4e6f60,_0x4dc532){return new BPromise(function(_0x3120da,_0x4ca523){return client[_0x9307('0xa')](_0x215470,_0x4dc532)[_0x9307('0xb')](function(_0x5e2560){logger[_0x9307('0xc')](_0x9307('0xd'),_0x4e6f60,_0x9307('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x4e6f60,_0x9307('0xe'),JSON[_0x9307('0xf')](_0x5e2560));if(_0x5e2560[_0x9307('0x10')]){if(_0x5e2560[_0x9307('0x10')][_0x9307('0x11')]===0x1f4){logger[_0x9307('0x10')]('Automation,\x20%s,\x20%s',_0x4e6f60,_0x5e2560[_0x9307('0x10')][_0x9307('0x12')]);return _0x4ca523(_0x5e2560['error']['message']);}logger[_0x9307('0x10')](_0x9307('0xd'),_0x4e6f60,_0x5e2560['error'][_0x9307('0x12')]);return _0x3120da(_0x5e2560[_0x9307('0x10')]['message']);}else{logger[_0x9307('0xc')](_0x9307('0xd'),_0x4e6f60,'request\x20sent');_0x3120da(_0x5e2560[_0x9307('0x13')][_0x9307('0x12')]);}})[_0x9307('0x14')](function(_0x5b6ac6){logger[_0x9307('0x10')](_0x9307('0xd'),_0x4e6f60,_0x5b6ac6);_0x4ca523(_0x5b6ac6);});});} \ No newline at end of file +var _0xda42=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x37affd,_0x53e54d){var _0x5c385a=function(_0x246e90){while(--_0x246e90){_0x37affd['push'](_0x37affd['shift']());}};_0x5c385a(++_0x53e54d);}(_0xda42,0x1bd));var _0x2da4=function(_0x3380fe,_0x56c32e){_0x3380fe=_0x3380fe-0x0;var _0x4d8a19=_0xda42[_0x3380fe];return _0x4d8a19;};'use strict';var _=require(_0x2da4('0x0'));var util=require(_0x2da4('0x1'));var moment=require(_0x2da4('0x2'));var BPromise=require(_0x2da4('0x3'));var rs=require(_0x2da4('0x4'));var fs=require('fs');var Redis=require(_0x2da4('0x5'));var db=require(_0x2da4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2da4('0x7'))('rpc');var config=require(_0x2da4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x295468,_0x3e8602,_0x374354){return new BPromise(function(_0xcf4fc7,_0x30a981){return client[_0x2da4('0x9')](_0x295468,_0x374354)[_0x2da4('0xa')](function(_0x5db1f4){logger['info'](_0x2da4('0xb'),_0x3e8602,_0x2da4('0xc'));logger[_0x2da4('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x3e8602,_0x2da4('0xc'),JSON[_0x2da4('0xe')](_0x5db1f4));if(_0x5db1f4[_0x2da4('0xf')]){if(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x10')]===0x1f4){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4['error'][_0x2da4('0x11')]);return _0x30a981(_0x5db1f4[_0x2da4('0xf')]['message']);}logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4[_0x2da4('0xf')]['message']);return _0xcf4fc7(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x11')]);}else{logger[_0x2da4('0x12')](_0x2da4('0xb'),_0x3e8602,'request\x20sent');_0xcf4fc7(_0x5db1f4['result'][_0x2da4('0x11')]);}})[_0x2da4('0x13')](function(_0x5e5338){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5e5338);_0x30a981(_0x5e5338);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2ece059..114018a 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 _0x3376=['create','post','addConditions','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x4552ac,_0x2e526a){var _0x2207c=function(_0x33ad73){while(--_0x33ad73){_0x4552ac['push'](_0x4552ac['shift']());}};_0x2207c(++_0x2e526a);}(_0x3376,0x19f));var _0x6337=function(_0x520e98,_0x27e5f5){_0x520e98=_0x520e98-0x0;var _0x242690=_0x3376[_0x520e98];return _0x242690;};'use strict';var multer=require(_0x6337('0x0'));var util=require('util');var path=require(_0x6337('0x1'));var timeout=require(_0x6337('0x2'));var express=require(_0x6337('0x3'));var router=express[_0x6337('0x4')]();var auth=require(_0x6337('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6337('0x6'));var controller=require(_0x6337('0x7'));router[_0x6337('0x8')]('/',auth[_0x6337('0x9')](),controller[_0x6337('0xa')]);router[_0x6337('0x8')](_0x6337('0xb'),auth['isAuthenticated'](),controller[_0x6337('0xc')]);router[_0x6337('0x8')](_0x6337('0xd'),auth[_0x6337('0x9')](),controller[_0x6337('0xe')]);router[_0x6337('0x8')](_0x6337('0xf'),auth['isAuthenticated'](),controller[_0x6337('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6337('0x11')]);router[_0x6337('0x12')](_0x6337('0xd'),auth['isAuthenticated'](),controller[_0x6337('0x13')]);router['post'](_0x6337('0xf'),auth[_0x6337('0x9')](),controller['addActions']);router[_0x6337('0x14')](_0x6337('0xb'),auth[_0x6337('0x9')](),controller[_0x6337('0x15')]);router['delete'](_0x6337('0xb'),auth['isAuthenticated'](),controller[_0x6337('0x16')]);module[_0x6337('0x17')]=router; \ No newline at end of file +var _0x66df=['/:id','isAuthenticated','/:id/conditions','/:id/actions','post','create','addActions','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller'];(function(_0x502542,_0x5e0e60){var _0x1102f9=function(_0x161b05){while(--_0x161b05){_0x502542['push'](_0x502542['shift']());}};_0x1102f9(++_0x5e0e60);}(_0x66df,0x115));var _0xf66d=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x66df[_0x2212d1];return _0x15eec5;};'use strict';var multer=require(_0xf66d('0x0'));var util=require(_0xf66d('0x1'));var path=require('path');var timeout=require(_0xf66d('0x2'));var express=require(_0xf66d('0x3'));var router=express[_0xf66d('0x4')]();var auth=require(_0xf66d('0x5'));var interaction=require(_0xf66d('0x6'));var config=require('../../config/environment');var controller=require(_0xf66d('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf66d('0x8'),auth[_0xf66d('0x9')](),controller['show']);router['get'](_0xf66d('0xa'),auth['isAuthenticated'](),controller['getConditions']);router['get'](_0xf66d('0xb'),auth[_0xf66d('0x9')](),controller['getActions']);router[_0xf66d('0xc')]('/',auth['isAuthenticated'](),controller[_0xf66d('0xd')]);router['post'](_0xf66d('0xa'),auth[_0xf66d('0x9')](),controller['addConditions']);router['post'](_0xf66d('0xb'),auth[_0xf66d('0x9')](),controller[_0xf66d('0xe')]);router['put'](_0xf66d('0x8'),auth[_0xf66d('0x9')](),controller[_0xf66d('0xf')]);router[_0xf66d('0x10')](_0xf66d('0x8'),auth['isAuthenticated'](),controller[_0xf66d('0x11')]);module[_0xf66d('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6d27949..1b2bc4e 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 _0xb0ea=['ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb0ea,0x80));var _0xab0e=function(_0x5087b7,_0x117485){_0x5087b7=_0x5087b7-0x0;var _0x3b4c2b=_0xb0ea[_0x5087b7];return _0x3b4c2b;};'use strict';var Sequelize=require(_0xab0e('0x0'));module[_0xab0e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xab0e('0x2')),'allowNull':![],'defaultValue':_0xab0e('0x2')},'description':{'type':Sequelize[_0xab0e('0x3')]},'active':{'type':Sequelize[_0xab0e('0x4')],'defaultValue':0x0,'comment':_0xab0e('0x5')},'limitCalls':{'type':Sequelize[_0xab0e('0x6')](0x4)[_0xab0e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab0e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab0e('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab0e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xab0e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xab0e('0x9')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab0e('0xa')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xab0e('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab0e('0x3')],'defaultValue':_0xab0e('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xab0e('0xc')]('always',_0xab0e('0xd'),'onlyIfOpen'),'defaultValue':_0xab0e('0xe')},'dialAMDActive':{'type':Sequelize[_0xab0e('0x4')],'defaultValue':0x0,'comment':_0xab0e('0xf')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xab0e('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab0e('0x10')},'dialAMDGreeting':{'type':Sequelize[_0xab0e('0x6')](0x9)[_0xab0e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab0e('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab0e('0x6')](0x9)[_0xab0e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xab0e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab0e('0x12')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xab0e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xab0e('0x6')](0x9)[_0xab0e('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xab0e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xab0e('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xab0e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab0e('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xab0e('0x6')](0x9)[_0xab0e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab0e('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0xab0e('0xc')](_0xab0e('0x16'),_0xab0e('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xab0e('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab0e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab0e('0x18')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xab0e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab0e('0x19')}}; \ No newline at end of file +var _0x95f7=['STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','exports','ENUM','ivr'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x95f7,0xac));var _0x795f=function(_0x15d8f9,_0x2a8e08){_0x15d8f9=_0x15d8f9-0x0;var _0x14aa0c=_0x95f7[_0x15d8f9];return _0x14aa0c;};'use strict';var Sequelize=require('sequelize');module[_0x795f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x795f('0x1')](_0x795f('0x2')),'allowNull':![],'defaultValue':_0x795f('0x2')},'description':{'type':Sequelize[_0x795f('0x3')]},'active':{'type':Sequelize[_0x795f('0x4')],'defaultValue':0x0,'comment':_0x795f('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x795f('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x795f('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x795f('0x7')](0x3)[_0x795f('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x795f('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x795f('0x7')](0x3)[_0x795f('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x795f('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x795f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x795f('0x7')](0x3)[_0x795f('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x795f('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x795f('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x795f('0x7')](0x3)[_0x795f('0x6')],'defaultValue':0x3,'comment':_0x795f('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x795f('0x7')](0x5)[_0x795f('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x795f('0x7')](0x3)[_0x795f('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x795f('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x795f('0xc'),_0x795f('0xd'),_0x795f('0xe')),'defaultValue':_0x795f('0xc')},'dialAMDActive':{'type':Sequelize[_0x795f('0x4')],'defaultValue':0x0,'comment':_0x795f('0xf')},'dialAMDInitialSilence':{'type':Sequelize[_0x795f('0x7')](0x9)[_0x795f('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x795f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x795f('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x795f('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x795f('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x795f('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x795f('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0x795f('0x7')](0x9)[_0x795f('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x795f('0x7')](0x9)[_0x795f('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x795f('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x795f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x795f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x795f('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x795f('0x7')](0x9)[_0x795f('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x795f('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x795f('0x1')]('DESC',_0x795f('0x16')),'defaultValue':_0x795f('0x17')},'dialPrefix':{'type':Sequelize[_0x795f('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x795f('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x795f('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x795f('0x18')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index fe41e59..f2c33f7 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 _0x8a42=['error','stack','name','send','index','Campaign','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','destroy','CmHopper','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','into','push','all','addBlackLists','removeBlackLists','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','get','UserProfileResource'];(function(_0x4975e5,_0x398413){var _0xab8cc5=function(_0x299873){while(--_0x299873){_0x4975e5['push'](_0x4975e5['shift']());}};_0xab8cc5(++_0x398413);}(_0x8a42,0x14d));var _0x28a4=function(_0x602d6b,_0x4c7983){_0x602d6b=_0x602d6b-0x0;var _0x2e508d=_0x8a42[_0x602d6b];return _0x2e508d;};'use strict';var pdf=require(_0x28a4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x28a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28a4('0x2'));var rp=require(_0x28a4('0x3'));var moment=require('moment');var BPromise=require(_0x28a4('0x4'));var Mustache=require(_0x28a4('0x5'));var util=require(_0x28a4('0x6'));var path=require('path');var sox=require(_0x28a4('0x7'));var csv=require(_0x28a4('0x8'));var ejs=require(_0x28a4('0x9'));var fs=require('fs');var _=require(_0x28a4('0xa'));var squel=require(_0x28a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x28a4('0xc'));var deskjs=require(_0x28a4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x28a4('0xe'));var Papa=require('papaparse');var Redis=require(_0x28a4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x28a4('0x10'))(_0x28a4('0x11'));var utils=require('../../config/utils');var config=require(_0x28a4('0x12'));var db=require(_0x28a4('0x13'))['db'];function respondWithStatusCode(_0x2b4964,_0x268adc){_0x268adc=_0x268adc||0xcc;return function(_0x2999d1){if(_0x2999d1){return _0x2b4964[_0x28a4('0x14')](_0x268adc);}return _0x2b4964[_0x28a4('0x15')](_0x268adc)[_0x28a4('0x16')]();};}function respondWithResult(_0x800284,_0x5aec5b){_0x5aec5b=_0x5aec5b||0xc8;return function(_0x5ed079){if(_0x5ed079){return _0x800284[_0x28a4('0x15')](_0x5aec5b)[_0x28a4('0x17')](_0x5ed079);}};}function respondWithFilteredResult(_0x57f95e,_0x8691b9){return function(_0x4068ce){if(_0x4068ce){var _0x9e6585=_0x4068ce['count'],_0x5de51f=_0x8691b9[_0x28a4('0x18')],_0x739934=_0x8691b9[_0x28a4('0x18')]+_0x8691b9[_0x28a4('0x19')],_0x421172;if(_0x739934>=_0x9e6585){_0x739934=_0x9e6585;_0x421172=0xc8;}else{_0x421172=0xce;}_0x57f95e[_0x28a4('0x15')](_0x421172);return _0x57f95e[_0x28a4('0x1a')]('Content-Range',_0x5de51f+'-'+_0x739934+'/'+_0x9e6585)[_0x28a4('0x17')](_0x4068ce);}return null;};}function patchUpdates(_0x126584){return function(_0x1fa230){try{jsonpatch[_0x28a4('0x1b')](_0x1fa230,_0x126584,!![]);}catch(_0x59cf17){return BPromise['reject'](_0x59cf17);}return _0x1fa230[_0x28a4('0x1c')]();};}function saveUpdates(_0x697dc4,_0x1e3013){return function(_0x3f0706){if(_0x3f0706){return _0x3f0706[_0x28a4('0x1d')](_0x697dc4)[_0x28a4('0x1e')](function(_0x511240){return _0x511240;});}return null;};}function removeEntity(_0x1739f3,_0x468790){return function(_0x28e894){if(_0x28e894){return _0x28e894['destroy']()['then'](function(){var _0x2dd9c1=_0x28e894[_0x28a4('0x1f')]({'plain':!![]});var _0x5a1a52='IvrCampaigns';return db[_0x28a4('0x20')]['destroy']({'where':{'type':_0x5a1a52,'resourceId':_0x2dd9c1['id']}})[_0x28a4('0x1e')](function(){return _0x28e894;});})[_0x28a4('0x1e')](function(){_0x1739f3[_0x28a4('0x15')](0xcc)[_0x28a4('0x16')]();});}};}function handleEntityNotFound(_0x461103,_0x189574){return function(_0x9b509a){if(!_0x9b509a){_0x461103['sendStatus'](0x194);}return _0x9b509a;};}function handleError(_0x10769f,_0x397680){_0x397680=_0x397680||0x1f4;return function(_0x40550e){logger[_0x28a4('0x21')](_0x40550e[_0x28a4('0x22')]);if(_0x40550e['name']){delete _0x40550e[_0x28a4('0x23')];}_0x10769f[_0x28a4('0x15')](_0x397680)[_0x28a4('0x24')](_0x40550e);};}exports[_0x28a4('0x25')]=function(_0xc77828,_0x4b556f){var _0x2c70e4={},_0x57a61f={},_0x11a3fd={'count':0x0,'rows':[]};var _0xfd899c=db[_0x28a4('0x26')]['rawAttributes'];_0x57a61f[_0x28a4('0x27')]=_['keys'](_0xfd899c);_0x57a61f[_0x28a4('0x28')]=_['keys'](_0xc77828[_0x28a4('0x28')]);_0x57a61f[_0x28a4('0x29')]=_['intersection'](_0x57a61f['model'],_0x57a61f[_0x28a4('0x28')]);_0x2c70e4[_0x28a4('0x2a')]=_[_0x28a4('0x2b')](_0x57a61f[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0xc77828[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x2c70e4[_0x28a4('0x2a')]=_0x2c70e4[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0x2c70e4[_0x28a4('0x2a')]:_0x57a61f[_0x28a4('0x27')];if(!_0xc77828['query'][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x2c70e4['limit']=qs[_0x28a4('0x19')](_0xc77828[_0x28a4('0x28')][_0x28a4('0x19')]);_0x2c70e4[_0x28a4('0x18')]=qs[_0x28a4('0x18')](_0xc77828[_0x28a4('0x28')][_0x28a4('0x18')]);}_0x2c70e4[_0x28a4('0x30')]=qs[_0x28a4('0x31')](_0xc77828['query'][_0x28a4('0x31')]);_0x2c70e4[_0x28a4('0x32')]=qs[_0x28a4('0x29')](_['pick'](_0xc77828['query'],_0x57a61f[_0x28a4('0x29')]));if(_0xc77828[_0x28a4('0x28')][_0x28a4('0x33')]){_0x2c70e4[_0x28a4('0x32')]=_['merge'](_0x2c70e4['where'],{'$or':_[_0x28a4('0x34')](_0xfd899c,function(_0x58e09a){if(_0x58e09a['type'][_0x28a4('0x35')]!==_0x28a4('0x36')){var _0x37700a={};_0x37700a[_0x58e09a[_0x28a4('0x37')]]={'$like':'%'+_0xc77828[_0x28a4('0x28')][_0x28a4('0x33')]+'%'};return _0x37700a;}})});}_0x2c70e4=_[_0x28a4('0x38')]({},_0x2c70e4,_0xc77828[_0x28a4('0x39')]);var _0x412b86={'where':_0x2c70e4[_0x28a4('0x32')]};return db[_0x28a4('0x26')][_0x28a4('0x3a')](_0x412b86)[_0x28a4('0x1e')](function(_0x80398a){_0x11a3fd[_0x28a4('0x3a')]=_0x80398a;if(_0xc77828[_0x28a4('0x28')][_0x28a4('0x3b')]){_0x2c70e4[_0x28a4('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0x28a4('0x3d')](_0x2c70e4);})[_0x28a4('0x1e')](function(_0xd3ec82){_0x11a3fd[_0x28a4('0x3e')]=_0xd3ec82;return _0x11a3fd;})[_0x28a4('0x1e')](respondWithFilteredResult(_0x4b556f,_0x2c70e4))['catch'](handleError(_0x4b556f,null));};exports['show']=function(_0x35d4de,_0x2d01cc){var _0xf6caab={'raw':![],'where':{'id':_0x35d4de[_0x28a4('0x3f')]['id']}},_0x54dec9={};_0x54dec9['model']=_['keys'](db[_0x28a4('0x26')]['rawAttributes']);_0x54dec9[_0x28a4('0x28')]=_[_0x28a4('0x40')](_0x35d4de['query']);_0x54dec9[_0x28a4('0x29')]=_['intersection'](_0x54dec9[_0x28a4('0x27')],_0x54dec9[_0x28a4('0x28')]);_0xf6caab[_0x28a4('0x2a')]=_['intersection'](_0x54dec9[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x35d4de[_0x28a4('0x28')][_0x28a4('0x2c')]));_0xf6caab[_0x28a4('0x2a')]=_0xf6caab[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0xf6caab[_0x28a4('0x2a')]:_0x54dec9['model'];if(_0x35d4de[_0x28a4('0x28')][_0x28a4('0x3b')]){_0xf6caab[_0x28a4('0x3c')]=[{'all':!![]}];}_0xf6caab=_[_0x28a4('0x38')]({},_0xf6caab,_0x35d4de[_0x28a4('0x39')]);return db[_0x28a4('0x26')][_0x28a4('0x41')](_0xf6caab)[_0x28a4('0x1e')](handleEntityNotFound(_0x2d01cc,null))[_0x28a4('0x1e')](respondWithResult(_0x2d01cc,null))[_0x28a4('0x42')](handleError(_0x2d01cc,null));};exports['create']=function(_0x5d4f8a,_0x19cad3){return db[_0x28a4('0x26')][_0x28a4('0x43')](_0x5d4f8a[_0x28a4('0x44')],{})[_0x28a4('0x1e')](function(_0x1639d4){var _0x47fca1=_0x5d4f8a[_0x28a4('0x45')]['get']({'plain':!![]});if(!_0x47fca1)throw new Error(_0x28a4('0x46'));if(_0x47fca1[_0x28a4('0x47')]===_0x28a4('0x45')){var _0x299d75=_0x1639d4[_0x28a4('0x1f')]({'plain':!![]});var _0xfb389d=_0x28a4('0x48');return db['UserProfileSection'][_0x28a4('0x41')]({'where':{'name':_0xfb389d,'userProfileId':_0x47fca1[_0x28a4('0x49')]},'raw':!![]})[_0x28a4('0x1e')](function(_0xebc576){if(_0xebc576&&_0xebc576[_0x28a4('0x4a')]===0x0){return db['UserProfileResource'][_0x28a4('0x43')]({'name':_0x299d75[_0x28a4('0x23')],'resourceId':_0x299d75['id'],'type':_0xebc576['name'],'sectionId':_0xebc576['id']},{})[_0x28a4('0x1e')](function(){return _0x1639d4;});}else{return _0x1639d4;}})[_0x28a4('0x42')](function(_0x370ef9){logger[_0x28a4('0x21')](_0x28a4('0x4b'),_0x370ef9);throw _0x370ef9;});}return _0x1639d4;})['then'](respondWithResult(_0x19cad3,0xc9))['catch'](handleError(_0x19cad3,null));};exports['clone']=function(_0x17ee27,_0x992ffd){var _0x30f3a6={'raw':![],'where':{'id':_0x17ee27[_0x28a4('0x3f')]['id']}},_0x3c5d2f={};_0x3c5d2f['model']=_[_0x28a4('0x40')](db[_0x28a4('0x26')][_0x28a4('0x4c')]);_0x30f3a6[_0x28a4('0x2a')]=_[_0x28a4('0x2b')](_0x3c5d2f[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x17ee27[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x30f3a6[_0x28a4('0x2a')]=_0x30f3a6['attributes'][_0x28a4('0x2d')]?_0x30f3a6[_0x28a4('0x2a')]:_0x3c5d2f[_0x28a4('0x27')];if(_0x17ee27[_0x28a4('0x28')][_0x28a4('0x3b')]){_0x30f3a6[_0x28a4('0x3c')]=[{'all':!![]}];}_0x30f3a6=_[_0x28a4('0x38')]({},_0x30f3a6,_0x17ee27['options']);return db['Campaign'][_0x28a4('0x41')](_0x30f3a6)[_0x28a4('0x1e')](handleEntityNotFound(_0x992ffd,null))['then'](function(_0x5b3cb4){if(_0x5b3cb4){var _0x337f28=_0x5b3cb4[_0x28a4('0x1f')]({'plain':!![]});_0x337f28=qs[_0x28a4('0x4d')](_0x337f28,['id',_0x28a4('0x4e'),_0x28a4('0x4f')]);_0x17ee27[_0x28a4('0x44')]=_[_0x28a4('0x4d')](_0x17ee27[_0x28a4('0x44')],['id','createdAt',_0x28a4('0x4f')]);return db['Campaign']['create'](_[_0x28a4('0x38')](_0x337f28,_0x17ee27[_0x28a4('0x44')]),{'include':_0x17ee27[_0x28a4('0x28')][_0x28a4('0x3b')]?[{'all':!![]}]:undefined})[_0x28a4('0x1e')](function(_0x185ef5){var _0xbfae92=_0x17ee27[_0x28a4('0x45')][_0x28a4('0x1f')]({'plain':!![]});if(!_0xbfae92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbfae92['role']===_0x28a4('0x45')){var _0x5ed169=_0x185ef5[_0x28a4('0x1f')]({'plain':!![]});var _0x36b02f='IvrCampaigns';return db[_0x28a4('0x50')][_0x28a4('0x41')]({'where':{'name':_0x36b02f,'userProfileId':_0xbfae92['userProfileId']},'raw':!![]})['then'](function(_0x1e6e59){if(_0x1e6e59&&_0x1e6e59[_0x28a4('0x4a')]===0x0){return db[_0x28a4('0x20')]['create']({'name':_0x5ed169[_0x28a4('0x23')],'resourceId':_0x5ed169['id'],'type':_0x1e6e59[_0x28a4('0x23')],'sectionId':_0x1e6e59['id']},{})['then'](function(){return _0x185ef5;});}else{return _0x185ef5;}})[_0x28a4('0x42')](function(_0x214809){logger[_0x28a4('0x21')](_0x28a4('0x4b'),_0x214809);throw _0x214809;});}return _0x185ef5;});}})[_0x28a4('0x1e')](respondWithResult(_0x992ffd,0xc9))[_0x28a4('0x42')](handleError(_0x992ffd,null));};exports[_0x28a4('0x1d')]=function(_0xd921c8,_0x511c51){if(_0xd921c8[_0x28a4('0x44')]['id']){delete _0xd921c8[_0x28a4('0x44')]['id'];}return db[_0x28a4('0x26')][_0x28a4('0x41')]({'where':{'id':_0xd921c8['params']['id']}})['then'](handleEntityNotFound(_0x511c51,null))[_0x28a4('0x1e')](saveUpdates(_0xd921c8[_0x28a4('0x44')],null))[_0x28a4('0x1e')](respondWithResult(_0x511c51,null))[_0x28a4('0x42')](handleError(_0x511c51,null));};exports[_0x28a4('0x51')]=function(_0x15034d,_0x3ca6e4){return db[_0x28a4('0x26')]['find']({'where':{'id':_0x15034d[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x3ca6e4,null))[_0x28a4('0x1e')](removeEntity(_0x3ca6e4,null))[_0x28a4('0x42')](handleError(_0x3ca6e4,null));};exports['getHoppers']=function(_0x351acb,_0x1afd75,_0x3c5e21){var _0x2eb9b3={'raw':!![],'where':{}};var _0x1feadf={};var _0x381941={'count':0x0,'rows':[]};return db[_0x28a4('0x26')]['findOne']({'where':{'id':_0x351acb[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x1afd75,null))[_0x28a4('0x1e')](function(_0x350db9){if(_0x350db9){_0x1feadf[_0x28a4('0x27')]=_[_0x28a4('0x40')](db[_0x28a4('0x52')][_0x28a4('0x4c')]);_0x1feadf[_0x28a4('0x28')]=_[_0x28a4('0x40')](_0x351acb['query']);_0x1feadf[_0x28a4('0x29')]=_[_0x28a4('0x2b')](_0x1feadf[_0x28a4('0x27')],_0x1feadf[_0x28a4('0x28')]);_0x2eb9b3[_0x28a4('0x2a')]=_['intersection'](_0x1feadf['model'],qs[_0x28a4('0x2c')](_0x351acb[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x2eb9b3[_0x28a4('0x2a')]=_0x2eb9b3['attributes'][_0x28a4('0x2d')]?_0x2eb9b3[_0x28a4('0x2a')]:_0x1feadf[_0x28a4('0x27')];if(!_0x351acb['query'][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x2eb9b3['limit']=qs[_0x28a4('0x19')](_0x351acb[_0x28a4('0x28')][_0x28a4('0x19')]);_0x2eb9b3['offset']=qs['offset'](_0x351acb[_0x28a4('0x28')]['offset']);}_0x2eb9b3['order']=qs['sort'](_0x351acb[_0x28a4('0x28')][_0x28a4('0x31')]);_0x2eb9b3[_0x28a4('0x32')]=qs[_0x28a4('0x29')](_[_0x28a4('0x53')](_0x351acb[_0x28a4('0x28')],_0x1feadf[_0x28a4('0x29')]));_0x2eb9b3[_0x28a4('0x32')][_0x28a4('0x54')]=_0x350db9['id'];if(_0x351acb[_0x28a4('0x28')][_0x28a4('0x33')]){_0x2eb9b3['where']=_['merge'](_0x2eb9b3[_0x28a4('0x32')],{'$or':_[_0x28a4('0x34')](_0x2eb9b3['attributes'],function(_0x57bf61){var _0xdceae5={};_0xdceae5[_0x57bf61]={'$like':'%'+_0x351acb[_0x28a4('0x28')]['filter']+'%'};return _0xdceae5;})});}_0x2eb9b3=_[_0x28a4('0x38')]({},_0x2eb9b3,_0x351acb[_0x28a4('0x39')]);return db['CmHopper'][_0x28a4('0x3a')]({'where':_0x2eb9b3[_0x28a4('0x32')]})['then'](function(_0x270689){_0x381941[_0x28a4('0x3a')]=_0x270689;if(_0x351acb[_0x28a4('0x28')]['includeAll']){_0x2eb9b3[_0x28a4('0x3c')]=[{'all':!![]}];}return db[_0x28a4('0x52')][_0x28a4('0x3d')](_0x2eb9b3);})[_0x28a4('0x1e')](function(_0x1cc87c){_0x381941[_0x28a4('0x3e')]=_0x1cc87c;return _0x381941;});}})[_0x28a4('0x1e')](respondWithFilteredResult(_0x1afd75,_0x2eb9b3))[_0x28a4('0x42')](handleError(_0x1afd75,null));};exports[_0x28a4('0x55')]=function(_0x34db10,_0x3c3494,_0x5dfd59){var _0x395c09={'raw':!![],'where':{}};var _0x199087={};var _0x1f5968={'count':0x0,'rows':[]};return db[_0x28a4('0x26')][_0x28a4('0x56')]({'where':{'id':_0x34db10['params']['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x3c3494,null))[_0x28a4('0x1e')](function(_0x43dc92){if(_0x43dc92){_0x199087[_0x28a4('0x27')]=_[_0x28a4('0x40')](db[_0x28a4('0x57')]['rawAttributes']);_0x199087[_0x28a4('0x28')]=_[_0x28a4('0x40')](_0x34db10[_0x28a4('0x28')]);_0x199087['filters']=_[_0x28a4('0x2b')](_0x199087['model'],_0x199087[_0x28a4('0x28')]);_0x395c09[_0x28a4('0x2a')]=_[_0x28a4('0x2b')](_0x199087[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x34db10[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x395c09[_0x28a4('0x2a')]=_0x395c09['attributes'][_0x28a4('0x2d')]?_0x395c09[_0x28a4('0x2a')]:_0x199087[_0x28a4('0x27')];if(!_0x34db10[_0x28a4('0x28')][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x395c09[_0x28a4('0x19')]=qs[_0x28a4('0x19')](_0x34db10[_0x28a4('0x28')]['limit']);_0x395c09[_0x28a4('0x18')]=qs[_0x28a4('0x18')](_0x34db10[_0x28a4('0x28')][_0x28a4('0x18')]);}_0x395c09[_0x28a4('0x30')]=qs['sort'](_0x34db10['query'][_0x28a4('0x31')]);_0x395c09[_0x28a4('0x32')]=qs[_0x28a4('0x29')](_[_0x28a4('0x53')](_0x34db10[_0x28a4('0x28')],_0x199087[_0x28a4('0x29')]));_0x395c09[_0x28a4('0x32')][_0x28a4('0x54')]=_0x43dc92['id'];if(_0x34db10['query'][_0x28a4('0x33')]){_0x395c09[_0x28a4('0x32')]=_['merge'](_0x395c09[_0x28a4('0x32')],{'$or':_[_0x28a4('0x34')](_0x395c09['attributes'],function(_0x42974f){var _0x6b5354={};_0x6b5354[_0x42974f]={'$like':'%'+_0x34db10['query'][_0x28a4('0x33')]+'%'};return _0x6b5354;})});}_0x395c09=_[_0x28a4('0x38')]({},_0x395c09,_0x34db10[_0x28a4('0x39')]);return db[_0x28a4('0x57')][_0x28a4('0x3a')]({'where':_0x395c09['where']})[_0x28a4('0x1e')](function(_0x29a0b5){_0x1f5968['count']=_0x29a0b5;if(_0x34db10[_0x28a4('0x28')]['includeAll']){_0x395c09[_0x28a4('0x3c')]=[{'all':!![]}];}return db[_0x28a4('0x57')][_0x28a4('0x3d')](_0x395c09);})[_0x28a4('0x1e')](function(_0x4f23f3){_0x1f5968[_0x28a4('0x3e')]=_0x4f23f3;return _0x1f5968;});}})[_0x28a4('0x1e')](respondWithFilteredResult(_0x3c3494,_0x395c09))[_0x28a4('0x42')](handleError(_0x3c3494,null));};exports[_0x28a4('0x58')]=function(_0x2ba824,_0x1157c4,_0x168d48){var _0x273747={'raw':!![],'where':{}};var _0x32a243={};var _0x26fe28={'count':0x0,'rows':[]};return db[_0x28a4('0x26')][_0x28a4('0x56')]({'where':{'id':_0x2ba824[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x1157c4,null))['then'](function(_0x340aa8){if(_0x340aa8){_0x32a243[_0x28a4('0x27')]=_[_0x28a4('0x40')](db[_0x28a4('0x59')][_0x28a4('0x4c')]);_0x32a243['query']=_[_0x28a4('0x40')](_0x2ba824[_0x28a4('0x28')]);_0x32a243[_0x28a4('0x29')]=_['intersection'](_0x32a243[_0x28a4('0x27')],_0x32a243[_0x28a4('0x28')]);_0x273747[_0x28a4('0x2a')]=_[_0x28a4('0x2b')](_0x32a243[_0x28a4('0x27')],qs['fields'](_0x2ba824[_0x28a4('0x28')]['fields']));_0x273747[_0x28a4('0x2a')]=_0x273747[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0x273747[_0x28a4('0x2a')]:_0x32a243[_0x28a4('0x27')];if(!_0x2ba824['query'][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x273747['limit']=qs['limit'](_0x2ba824[_0x28a4('0x28')][_0x28a4('0x19')]);_0x273747['offset']=qs[_0x28a4('0x18')](_0x2ba824[_0x28a4('0x28')][_0x28a4('0x18')]);}_0x273747[_0x28a4('0x30')]=qs[_0x28a4('0x31')](_0x2ba824[_0x28a4('0x28')][_0x28a4('0x31')]);_0x273747[_0x28a4('0x32')]=qs[_0x28a4('0x29')](_[_0x28a4('0x53')](_0x2ba824[_0x28a4('0x28')],_0x32a243['filters']));_0x273747['where']['CampaignId']=_0x340aa8['id'];if(_0x2ba824[_0x28a4('0x28')][_0x28a4('0x33')]){_0x273747[_0x28a4('0x32')]=_['merge'](_0x273747[_0x28a4('0x32')],{'$or':_['map'](_0x273747[_0x28a4('0x2a')],function(_0x3d90cf){var _0x553857={};_0x553857[_0x3d90cf]={'$like':'%'+_0x2ba824[_0x28a4('0x28')][_0x28a4('0x33')]+'%'};return _0x553857;})});}_0x273747=_[_0x28a4('0x38')]({},_0x273747,_0x2ba824[_0x28a4('0x39')]);return db[_0x28a4('0x59')][_0x28a4('0x3a')]({'where':_0x273747[_0x28a4('0x32')]})[_0x28a4('0x1e')](function(_0x438d8e){_0x26fe28[_0x28a4('0x3a')]=_0x438d8e;if(_0x2ba824[_0x28a4('0x28')][_0x28a4('0x3b')]){_0x273747[_0x28a4('0x3c')]=[{'all':!![]}];}return db[_0x28a4('0x59')][_0x28a4('0x3d')](_0x273747);})[_0x28a4('0x1e')](function(_0x2bbe00){_0x26fe28[_0x28a4('0x3e')]=_0x2bbe00;return _0x26fe28;});}})[_0x28a4('0x1e')](respondWithFilteredResult(_0x1157c4,_0x273747))[_0x28a4('0x42')](handleError(_0x1157c4,null));};exports['getHopperBlacks']=function(_0x4ea828,_0x2293f6,_0x2ae9ed){var _0x4dc4bb={'raw':!![],'where':{}};var _0x3873fe={};var _0x213a56={'count':0x0,'rows':[]};return db[_0x28a4('0x26')][_0x28a4('0x56')]({'where':{'id':_0x4ea828[_0x28a4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2293f6,null))[_0x28a4('0x1e')](function(_0x39178e){if(_0x39178e){_0x3873fe[_0x28a4('0x27')]=_[_0x28a4('0x40')](db[_0x28a4('0x5a')]['rawAttributes']);_0x3873fe[_0x28a4('0x28')]=_[_0x28a4('0x40')](_0x4ea828[_0x28a4('0x28')]);_0x3873fe[_0x28a4('0x29')]=_[_0x28a4('0x2b')](_0x3873fe[_0x28a4('0x27')],_0x3873fe[_0x28a4('0x28')]);_0x4dc4bb['attributes']=_[_0x28a4('0x2b')](_0x3873fe[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x4ea828[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x4dc4bb[_0x28a4('0x2a')]=_0x4dc4bb[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0x4dc4bb[_0x28a4('0x2a')]:_0x3873fe[_0x28a4('0x27')];if(!_0x4ea828[_0x28a4('0x28')][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x4dc4bb['limit']=qs[_0x28a4('0x19')](_0x4ea828['query']['limit']);_0x4dc4bb[_0x28a4('0x18')]=qs[_0x28a4('0x18')](_0x4ea828[_0x28a4('0x28')][_0x28a4('0x18')]);}_0x4dc4bb[_0x28a4('0x30')]=qs[_0x28a4('0x31')](_0x4ea828[_0x28a4('0x28')]['sort']);_0x4dc4bb[_0x28a4('0x32')]=qs['filters'](_['pick'](_0x4ea828[_0x28a4('0x28')],_0x3873fe[_0x28a4('0x29')]));_0x4dc4bb['where'][_0x28a4('0x54')]=_0x39178e['id'];if(_0x4ea828['query'][_0x28a4('0x33')]){_0x4dc4bb[_0x28a4('0x32')]=_[_0x28a4('0x38')](_0x4dc4bb[_0x28a4('0x32')],{'$or':_[_0x28a4('0x34')](_0x4dc4bb['attributes'],function(_0x12bfdf){var _0x1acfc5={};_0x1acfc5[_0x12bfdf]={'$like':'%'+_0x4ea828[_0x28a4('0x28')][_0x28a4('0x33')]+'%'};return _0x1acfc5;})});}_0x4dc4bb=_[_0x28a4('0x38')]({},_0x4dc4bb,_0x4ea828[_0x28a4('0x39')]);return db['CmHopperBlack'][_0x28a4('0x3a')]({'where':_0x4dc4bb[_0x28a4('0x32')]})[_0x28a4('0x1e')](function(_0x3b1c90){_0x213a56['count']=_0x3b1c90;if(_0x4ea828[_0x28a4('0x28')]['includeAll']){_0x4dc4bb[_0x28a4('0x3c')]=[{'all':!![]}];}return db[_0x28a4('0x5a')][_0x28a4('0x3d')](_0x4dc4bb);})[_0x28a4('0x1e')](function(_0x287552){_0x213a56[_0x28a4('0x3e')]=_0x287552;return _0x213a56;});}})[_0x28a4('0x1e')](respondWithFilteredResult(_0x2293f6,_0x4dc4bb))[_0x28a4('0x42')](handleError(_0x2293f6,null));};exports[_0x28a4('0x5b')]=function(_0x13f56,_0x3df01d,_0x5045bd){var _0x3a28cd={};var _0x116fe5={};var _0x374432;var _0x2f6fb1;return db[_0x28a4('0x26')][_0x28a4('0x56')]({'where':{'id':_0x13f56[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x3df01d,null))['then'](function(_0x52587a){if(_0x52587a){_0x374432=_0x52587a;_0x116fe5[_0x28a4('0x27')]=_[_0x28a4('0x40')](db[_0x28a4('0x5c')][_0x28a4('0x4c')]);_0x116fe5['query']=_[_0x28a4('0x40')](_0x13f56['query']);_0x116fe5[_0x28a4('0x29')]=_[_0x28a4('0x2b')](_0x116fe5[_0x28a4('0x27')],_0x116fe5[_0x28a4('0x28')]);_0x3a28cd[_0x28a4('0x2a')]=_['intersection'](_0x116fe5[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x13f56[_0x28a4('0x28')][_0x28a4('0x2c')]));_0x3a28cd[_0x28a4('0x2a')]=_0x3a28cd[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0x3a28cd[_0x28a4('0x2a')]:_0x116fe5[_0x28a4('0x27')];_0x3a28cd[_0x28a4('0x30')]=qs['sort'](_0x13f56[_0x28a4('0x28')][_0x28a4('0x31')]);_0x3a28cd['where']=qs['filters'](_[_0x28a4('0x53')](_0x13f56['query'],_0x116fe5['filters']));if(_0x13f56['query'][_0x28a4('0x33')]){_0x3a28cd[_0x28a4('0x32')]=_[_0x28a4('0x38')](_0x3a28cd['where'],{'$or':_[_0x28a4('0x34')](_0x3a28cd[_0x28a4('0x2a')],function(_0x2a9773){var _0xcf1dcc={};_0xcf1dcc[_0x2a9773]={'$like':'%'+_0x13f56['query']['filter']+'%'};return _0xcf1dcc;})});}_0x3a28cd=_[_0x28a4('0x38')]({},_0x3a28cd,_0x13f56['options']);return _0x374432[_0x28a4('0x5b')](_0x3a28cd);}})[_0x28a4('0x1e')](function(_0x270c50){if(_0x270c50){_0x2f6fb1=_0x270c50[_0x28a4('0x2d')];if(!_0x13f56[_0x28a4('0x28')][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x3a28cd['limit']=qs[_0x28a4('0x19')](_0x13f56['query'][_0x28a4('0x19')]);_0x3a28cd['offset']=qs[_0x28a4('0x18')](_0x13f56[_0x28a4('0x28')][_0x28a4('0x18')]);}return _0x374432['getLists'](_0x3a28cd);}})[_0x28a4('0x1e')](function(_0x140f67){if(_0x140f67){return _0x140f67?{'count':_0x2f6fb1,'rows':_0x140f67}:null;}})[_0x28a4('0x1e')](respondWithResult(_0x3df01d,null))['catch'](handleError(_0x3df01d,null));};exports[_0x28a4('0x5d')]=function(_0x2cdfeb,_0x122e5d,_0x14800d){var _0x591eb8,_0x3df109;return db['Campaign']['find']({'where':{'id':_0x2cdfeb[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x122e5d,null))[_0x28a4('0x1e')](function(_0x3a0ed2){if(_0x3a0ed2){_0x3df109=_0x3a0ed2;return _0x3a0ed2[_0x28a4('0x5d')](_0x2cdfeb[_0x28a4('0x44')][_0x28a4('0x5e')],_[_0x28a4('0x4d')](_0x2cdfeb['body'],[_0x28a4('0x5e'),'id'])||{});}return null;})[_0x28a4('0x5f')](function(_0x539493){var _0x515620;_0x591eb8=_0x539493||[];var _0x5a9fab=[];if(_0x539493){for(var _0x15efd1=0x0;_0x15efd1<_0x539493[_0x28a4('0x2d')];_0x15efd1+=0x1){var _0x3ba68f=_0x539493[_0x15efd1][_0x28a4('0x1f')]({'plain':!![]});_0x3df109[_0x28a4('0x60')]=_0x2cdfeb[_0x28a4('0x44')][_0x28a4('0x60')]?_0x2cdfeb['body'][_0x28a4('0x60')]:_0x3df109[_0x28a4('0x60')];switch(_0x3df109['dialCheckDuplicateType']){case _0x28a4('0x61'):_0x515620=squel['insert']()['into'](_0x28a4('0x62'))[_0x28a4('0x63')]([_0x28a4('0x64'),_0x28a4('0x65'),_0x28a4('0x66'),_0x28a4('0x67'),_0x28a4('0x54'),'createdAt','updatedAt'],squel['select']()['field'](_0x28a4('0x64'),_0x28a4('0x64'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x65'))[_0x28a4('0x37')]('id','ContactId')[_0x28a4('0x37')](_0x3ba68f[_0x28a4('0x69')][_0x28a4('0x6a')](),'ListId')[_0x28a4('0x37')](_0x2cdfeb[_0x28a4('0x3f')]['id'][_0x28a4('0x6a')](),_0x28a4('0x54'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x4e'))['field'](_0x28a4('0x68'),_0x28a4('0x4f'))[_0x28a4('0x6b')](_0x28a4('0x6c'))[_0x28a4('0x32')](_0x28a4('0x6d'))[_0x28a4('0x32')](_0x28a4('0x6e'),_0x3ba68f[_0x28a4('0x69')][_0x28a4('0x6a')]())[_0x28a4('0x32')](_0x28a4('0x6f'))[_0x28a4('0x32')](_0x28a4('0x70'),squel[_0x28a4('0x71')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0x28a4('0x72'))[_0x28a4('0x32')]('CampaignId\x20=\x20?',_0x2cdfeb[_0x28a4('0x3f')]['id']['toString']()))[_0x28a4('0x32')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x28a4('0x37')](_0x28a4('0x73'))[_0x28a4('0x6b')](_0x28a4('0x62'))['where'](_0x28a4('0x74'),_0x2cdfeb['params']['id']['toString']())))[_0x28a4('0x6a')]();break;case'onlyIfOpen':_0x515620=squel['insert']()[_0x28a4('0x75')](_0x28a4('0x62'))['fromQuery'](['phone','scheduledAt',_0x28a4('0x66'),_0x28a4('0x67'),_0x28a4('0x54'),_0x28a4('0x4e'),_0x28a4('0x4f')],squel[_0x28a4('0x71')]()[_0x28a4('0x37')]('phone',_0x28a4('0x64'))[_0x28a4('0x37')]('NOW()',_0x28a4('0x65'))[_0x28a4('0x37')]('id',_0x28a4('0x66'))['field'](_0x3ba68f[_0x28a4('0x69')]['toString'](),_0x28a4('0x67'))[_0x28a4('0x37')](_0x2cdfeb[_0x28a4('0x3f')]['id'][_0x28a4('0x6a')](),_0x28a4('0x54'))['field']('NOW()',_0x28a4('0x4e'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x4f'))[_0x28a4('0x6b')](_0x28a4('0x6c'))[_0x28a4('0x32')]('deletedAt\x20IS\x20NULL')[_0x28a4('0x32')](_0x28a4('0x6e'),_0x3ba68f[_0x28a4('0x69')][_0x28a4('0x6a')]())['where'](_0x28a4('0x6f'))[_0x28a4('0x32')](_0x28a4('0x70'),squel[_0x28a4('0x71')]()[_0x28a4('0x37')](_0x28a4('0x73'))[_0x28a4('0x6b')]('cm_hopper')[_0x28a4('0x32')](_0x28a4('0x74'),_0x2cdfeb[_0x28a4('0x3f')]['id']['toString']())))[_0x28a4('0x6a')]();break;default:_0x515620=squel['insert']()[_0x28a4('0x75')](_0x28a4('0x62'))[_0x28a4('0x63')]([_0x28a4('0x64'),_0x28a4('0x65'),_0x28a4('0x66'),_0x28a4('0x67'),_0x28a4('0x54'),_0x28a4('0x4e'),_0x28a4('0x4f')],squel[_0x28a4('0x71')]()[_0x28a4('0x37')](_0x28a4('0x64'),_0x28a4('0x64'))[_0x28a4('0x37')]('NOW()',_0x28a4('0x65'))[_0x28a4('0x37')]('id',_0x28a4('0x66'))[_0x28a4('0x37')](_0x3ba68f[_0x28a4('0x69')][_0x28a4('0x6a')](),_0x28a4('0x67'))['field'](_0x2cdfeb[_0x28a4('0x3f')]['id'][_0x28a4('0x6a')](),_0x28a4('0x54'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x4e'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x4f'))['from']('cm_contacts')[_0x28a4('0x32')](_0x28a4('0x6d'))[_0x28a4('0x32')](_0x28a4('0x6e'),_0x3ba68f['CmListId'][_0x28a4('0x6a')]())[_0x28a4('0x32')](_0x28a4('0x6f')))[_0x28a4('0x6a')]();}_0x5a9fab[_0x28a4('0x76')](db['sequelize']['query'](_0x515620));}return BPromise[_0x28a4('0x77')](_0x5a9fab);}})['then'](function(){return _0x591eb8;})[_0x28a4('0x1e')](respondWithResult(_0x122e5d,null))[_0x28a4('0x42')](handleError(_0x122e5d,null));};exports['removeLists']=function(_0x460449,_0x533011,_0x381ecd){return db[_0x28a4('0x26')][_0x28a4('0x41')]({'where':{'id':_0x460449[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x533011,null))[_0x28a4('0x1e')](function(_0x1c2c57){if(_0x1c2c57){return _0x1c2c57['removeLists'](_0x460449[_0x28a4('0x28')][_0x28a4('0x5e')]);}})[_0x28a4('0x1e')](function(_0x22c9fb){if(_0x22c9fb){return db[_0x28a4('0x52')][_0x28a4('0x51')]({'where':{'ListId':_0x460449[_0x28a4('0x28')][_0x28a4('0x5e')],'CampaignId':_0x460449[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](function(){return _0x22c9fb;});}})[_0x28a4('0x1e')](respondWithStatusCode(_0x533011,null))[_0x28a4('0x42')](handleError(_0x533011,null));};exports['getBlackLists']=function(_0x11abb2,_0x20395a,_0x51b899){var _0x47d73a={'raw':!![],'where':{}};var _0x131ab8={};var _0x1bd28a={'count':0x0,'rows':[]};return db[_0x28a4('0x26')][_0x28a4('0x56')]({'where':{'id':_0x11abb2[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x20395a,null))[_0x28a4('0x1e')](function(_0x37b06c){if(_0x37b06c){_0x131ab8[_0x28a4('0x27')]=_[_0x28a4('0x40')](db['CmList'][_0x28a4('0x4c')]);_0x131ab8[_0x28a4('0x28')]=_[_0x28a4('0x40')](_0x11abb2[_0x28a4('0x28')]);_0x131ab8['filters']=_[_0x28a4('0x2b')](_0x131ab8[_0x28a4('0x27')],_0x131ab8[_0x28a4('0x28')]);_0x47d73a[_0x28a4('0x2a')]=_[_0x28a4('0x2b')](_0x131ab8[_0x28a4('0x27')],qs[_0x28a4('0x2c')](_0x11abb2['query'][_0x28a4('0x2c')]));_0x47d73a[_0x28a4('0x2a')]=_0x47d73a[_0x28a4('0x2a')][_0x28a4('0x2d')]?_0x47d73a[_0x28a4('0x2a')]:_0x131ab8['model'];if(!_0x11abb2[_0x28a4('0x28')][_0x28a4('0x2e')](_0x28a4('0x2f'))){_0x47d73a[_0x28a4('0x19')]=qs[_0x28a4('0x19')](_0x11abb2[_0x28a4('0x28')][_0x28a4('0x19')]);_0x47d73a['offset']=qs[_0x28a4('0x18')](_0x11abb2['query'][_0x28a4('0x18')]);}_0x47d73a[_0x28a4('0x30')]=qs[_0x28a4('0x31')](_0x11abb2[_0x28a4('0x28')][_0x28a4('0x31')]);_0x47d73a[_0x28a4('0x32')]=qs[_0x28a4('0x29')](_[_0x28a4('0x53')](_0x11abb2['query'],_0x131ab8[_0x28a4('0x29')]));_0x47d73a['where']['CampaignId']=_0x37b06c['id'];if(_0x11abb2[_0x28a4('0x28')][_0x28a4('0x33')]){_0x47d73a[_0x28a4('0x32')]=_[_0x28a4('0x38')](_0x47d73a[_0x28a4('0x32')],{'$or':_['map'](_0x47d73a['attributes'],function(_0x2b0b2e){var _0xa4ef0={};_0xa4ef0[_0x2b0b2e]={'$like':'%'+_0x11abb2[_0x28a4('0x28')][_0x28a4('0x33')]+'%'};return _0xa4ef0;})});}_0x47d73a=_[_0x28a4('0x38')]({},_0x47d73a,_0x11abb2['options']);return db[_0x28a4('0x5c')][_0x28a4('0x3a')]({'where':_0x47d73a[_0x28a4('0x32')]})[_0x28a4('0x1e')](function(_0x3fa540){_0x1bd28a[_0x28a4('0x3a')]=_0x3fa540;if(_0x11abb2[_0x28a4('0x28')]['includeAll']){_0x47d73a[_0x28a4('0x3c')]=[{'all':!![]}];}return db['CmList'][_0x28a4('0x3d')](_0x47d73a);})[_0x28a4('0x1e')](function(_0x9ddb6c){_0x1bd28a[_0x28a4('0x3e')]=_0x9ddb6c;return _0x1bd28a;});}})[_0x28a4('0x1e')](respondWithFilteredResult(_0x20395a,_0x47d73a))[_0x28a4('0x42')](handleError(_0x20395a,null));};exports[_0x28a4('0x78')]=function(_0x169130,_0x4b16a1,_0x56c016){var _0x2dc4fd,_0x2cc109;return db[_0x28a4('0x26')]['find']({'where':{'id':_0x169130['params']['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x4b16a1,null))[_0x28a4('0x1e')](function(_0x4706ea){if(_0x4706ea){_0x2cc109=_0x4706ea;return _0x4706ea['addBlackLists'](_0x169130['body']['ids'],_[_0x28a4('0x4d')](_0x169130[_0x28a4('0x44')],['ids','id'])||{});}return null;})[_0x28a4('0x5f')](function(_0x3d49e2){var _0x2615fb;_0x2dc4fd=_0x3d49e2||[];var _0x1ae170=[];if(_0x3d49e2){for(var _0x2c382a=0x0;_0x2c382a<_0x3d49e2[_0x28a4('0x2d')];_0x2c382a+=0x1){var _0x5b8710=_0x3d49e2[_0x2c382a]['get']({'plain':!![]});_0x2615fb=squel['insert']()['into']('cm_hopper_black')[_0x28a4('0x63')](['phone','ContactId','ListId',_0x28a4('0x54'),_0x28a4('0x4e'),'updatedAt'],squel[_0x28a4('0x71')]()[_0x28a4('0x37')]('phone',_0x28a4('0x64'))['field']('id',_0x28a4('0x66'))[_0x28a4('0x37')](_0x5b8710[_0x28a4('0x69')][_0x28a4('0x6a')](),'ListId')[_0x28a4('0x37')](_0x169130[_0x28a4('0x3f')]['id'][_0x28a4('0x6a')](),_0x28a4('0x54'))[_0x28a4('0x37')](_0x28a4('0x68'),_0x28a4('0x4e'))[_0x28a4('0x37')](_0x28a4('0x68'),'updatedAt')[_0x28a4('0x6b')](_0x28a4('0x6c'))[_0x28a4('0x32')](_0x28a4('0x6d'))[_0x28a4('0x32')](_0x28a4('0x6e'),_0x5b8710[_0x28a4('0x69')][_0x28a4('0x6a')]())[_0x28a4('0x32')](_0x28a4('0x6f')))[_0x28a4('0x6a')]();_0x1ae170['push'](db['sequelize'][_0x28a4('0x28')](_0x2615fb));}return BPromise['all'](_0x1ae170);}})[_0x28a4('0x1e')](function(){return _0x2dc4fd;})['then'](respondWithResult(_0x4b16a1,null))[_0x28a4('0x42')](handleError(_0x4b16a1,null));};exports['removeBlackLists']=function(_0x3581d7,_0x31897f,_0x5aca25){return db['Campaign'][_0x28a4('0x41')]({'where':{'id':_0x3581d7[_0x28a4('0x3f')]['id']}})[_0x28a4('0x1e')](handleEntityNotFound(_0x31897f,null))[_0x28a4('0x1e')](function(_0x2efff1){if(_0x2efff1){return _0x2efff1[_0x28a4('0x79')](_0x3581d7[_0x28a4('0x28')][_0x28a4('0x5e')]);}})[_0x28a4('0x1e')](function(_0x4bdb47){if(_0x4bdb47){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3581d7['query'][_0x28a4('0x5e')],'CampaignId':_0x3581d7['params']['id']}})[_0x28a4('0x1e')](function(){return _0x4bdb47;});}})['then'](respondWithStatusCode(_0x31897f,null))[_0x28a4('0x42')](handleError(_0x31897f,null));}; \ No newline at end of file +var _0x7449=['CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','into','cm_contacts','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','index','Campaign','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','clone','rawAttributes','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','CampaignId','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks'];(function(_0x297814,_0x36b00e){var _0x29801d=function(_0x17aa83){while(--_0x17aa83){_0x297814['push'](_0x297814['shift']());}};_0x29801d(++_0x36b00e);}(_0x7449,0x13d));var _0x9744=function(_0x395707,_0x21103f){_0x395707=_0x395707-0x0;var _0x17afbc=_0x7449[_0x395707];return _0x17afbc;};'use strict';var pdf=require(_0x9744('0x0'));var emlformat=require(_0x9744('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9744('0x2'));var jsonpatch=require(_0x9744('0x3'));var rp=require(_0x9744('0x4'));var moment=require('moment');var BPromise=require(_0x9744('0x5'));var Mustache=require(_0x9744('0x6'));var util=require(_0x9744('0x7'));var path=require(_0x9744('0x8'));var sox=require(_0x9744('0x9'));var csv=require('to-csv');var ejs=require(_0x9744('0xa'));var fs=require('fs');var _=require(_0x9744('0xb'));var squel=require(_0x9744('0xc'));var crypto=require(_0x9744('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9744('0xe'));var toCsv=require(_0x9744('0xf'));var querystring=require(_0x9744('0x10'));var Papa=require(_0x9744('0x11'));var Redis=require(_0x9744('0x12'));var authService=require(_0x9744('0x13'));var qs=require(_0x9744('0x14'));var hardwareService=require(_0x9744('0x15'));var logger=require(_0x9744('0x16'))(_0x9744('0x17'));var utils=require(_0x9744('0x18'));var config=require(_0x9744('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40e94a,_0x1ef995){_0x1ef995=_0x1ef995||0xcc;return function(_0x241465){if(_0x241465){return _0x40e94a['sendStatus'](_0x1ef995);}return _0x40e94a[_0x9744('0x1a')](_0x1ef995)[_0x9744('0x1b')]();};}function respondWithResult(_0x4b771a,_0x2fcd1d){_0x2fcd1d=_0x2fcd1d||0xc8;return function(_0x9b642e){if(_0x9b642e){return _0x4b771a[_0x9744('0x1a')](_0x2fcd1d)[_0x9744('0x1c')](_0x9b642e);}};}function respondWithFilteredResult(_0x270d64,_0x3553ee){return function(_0x430280){if(_0x430280){var _0x542ece=_0x430280[_0x9744('0x1d')],_0x166c45=_0x3553ee['offset'],_0x3367e6=_0x3553ee[_0x9744('0x1e')]+_0x3553ee[_0x9744('0x1f')],_0x381c03;if(_0x3367e6>=_0x542ece){_0x3367e6=_0x542ece;_0x381c03=0xc8;}else{_0x381c03=0xce;}_0x270d64[_0x9744('0x1a')](_0x381c03);return _0x270d64[_0x9744('0x20')](_0x9744('0x21'),_0x166c45+'-'+_0x3367e6+'/'+_0x542ece)[_0x9744('0x1c')](_0x430280);}return null;};}function patchUpdates(_0xf3ea16){return function(_0x512459){try{jsonpatch[_0x9744('0x22')](_0x512459,_0xf3ea16,!![]);}catch(_0x36601e){return BPromise[_0x9744('0x23')](_0x36601e);}return _0x512459[_0x9744('0x24')]();};}function saveUpdates(_0x4e3ed5,_0x1b3f3c){return function(_0x108021){if(_0x108021){return _0x108021[_0x9744('0x25')](_0x4e3ed5)[_0x9744('0x26')](function(_0x5ec5f9){return _0x5ec5f9;});}return null;};}function removeEntity(_0x5f951a,_0x1833ea){return function(_0x279dcd){if(_0x279dcd){return _0x279dcd[_0x9744('0x27')]()[_0x9744('0x26')](function(){var _0x96fd22=_0x279dcd['get']({'plain':!![]});var _0x2024bb=_0x9744('0x28');return db[_0x9744('0x29')][_0x9744('0x27')]({'where':{'type':_0x2024bb,'resourceId':_0x96fd22['id']}})[_0x9744('0x26')](function(){return _0x279dcd;});})['then'](function(){_0x5f951a[_0x9744('0x1a')](0xcc)[_0x9744('0x1b')]();});}};}function handleEntityNotFound(_0x450c30,_0x441657){return function(_0x4c6391){if(!_0x4c6391){_0x450c30['sendStatus'](0x194);}return _0x4c6391;};}function handleError(_0x35a993,_0x521236){_0x521236=_0x521236||0x1f4;return function(_0x8cb06d){logger[_0x9744('0x2a')](_0x8cb06d[_0x9744('0x2b')]);if(_0x8cb06d[_0x9744('0x2c')]){delete _0x8cb06d[_0x9744('0x2c')];}_0x35a993[_0x9744('0x1a')](_0x521236)['send'](_0x8cb06d);};}exports[_0x9744('0x2d')]=function(_0x2cfbaf,_0xd53cda){var _0x4b0b12={},_0x3b5486={},_0x2141f3={'count':0x0,'rows':[]};var _0x2677ab=db[_0x9744('0x2e')]['rawAttributes'];_0x3b5486[_0x9744('0x2f')]=_[_0x9744('0x30')](_0x2677ab);_0x3b5486[_0x9744('0x31')]=_[_0x9744('0x30')](_0x2cfbaf['query']);_0x3b5486[_0x9744('0x32')]=_[_0x9744('0x33')](_0x3b5486[_0x9744('0x2f')],_0x3b5486['query']);_0x4b0b12[_0x9744('0x34')]=_[_0x9744('0x33')](_0x3b5486[_0x9744('0x2f')],qs['fields'](_0x2cfbaf[_0x9744('0x31')][_0x9744('0x35')]));_0x4b0b12[_0x9744('0x34')]=_0x4b0b12['attributes']['length']?_0x4b0b12[_0x9744('0x34')]:_0x3b5486['model'];if(!_0x2cfbaf[_0x9744('0x31')][_0x9744('0x36')](_0x9744('0x37'))){_0x4b0b12[_0x9744('0x1f')]=qs[_0x9744('0x1f')](_0x2cfbaf[_0x9744('0x31')][_0x9744('0x1f')]);_0x4b0b12[_0x9744('0x1e')]=qs['offset'](_0x2cfbaf[_0x9744('0x31')][_0x9744('0x1e')]);}_0x4b0b12['order']=qs['sort'](_0x2cfbaf[_0x9744('0x31')][_0x9744('0x38')]);_0x4b0b12[_0x9744('0x39')]=qs['filters'](_[_0x9744('0x3a')](_0x2cfbaf[_0x9744('0x31')],_0x3b5486[_0x9744('0x32')]));if(_0x2cfbaf['query'][_0x9744('0x3b')]){_0x4b0b12[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x4b0b12[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0x2677ab,function(_0x436035){if(_0x436035[_0x9744('0x3e')][_0x9744('0x3f')]!==_0x9744('0x40')){var _0x59f333={};_0x59f333[_0x436035[_0x9744('0x41')]]={'$like':'%'+_0x2cfbaf['query'][_0x9744('0x3b')]+'%'};return _0x59f333;}})});}_0x4b0b12=_[_0x9744('0x3c')]({},_0x4b0b12,_0x2cfbaf[_0x9744('0x42')]);var _0x3a8b8d={'where':_0x4b0b12[_0x9744('0x39')]};return db[_0x9744('0x2e')][_0x9744('0x1d')](_0x3a8b8d)['then'](function(_0x4b63c5){_0x2141f3[_0x9744('0x1d')]=_0x4b63c5;if(_0x2cfbaf['query'][_0x9744('0x43')]){_0x4b0b12[_0x9744('0x44')]=[{'all':!![]}];}return db[_0x9744('0x2e')][_0x9744('0x45')](_0x4b0b12);})[_0x9744('0x26')](function(_0x15c602){_0x2141f3['rows']=_0x15c602;return _0x2141f3;})[_0x9744('0x26')](respondWithFilteredResult(_0xd53cda,_0x4b0b12))[_0x9744('0x46')](handleError(_0xd53cda,null));};exports[_0x9744('0x47')]=function(_0x3e7599,_0x460075){var _0x15ff9f={'raw':![],'where':{'id':_0x3e7599[_0x9744('0x48')]['id']}},_0x4388b9={};_0x4388b9[_0x9744('0x2f')]=_[_0x9744('0x30')](db[_0x9744('0x2e')]['rawAttributes']);_0x4388b9[_0x9744('0x31')]=_['keys'](_0x3e7599[_0x9744('0x31')]);_0x4388b9[_0x9744('0x32')]=_['intersection'](_0x4388b9[_0x9744('0x2f')],_0x4388b9[_0x9744('0x31')]);_0x15ff9f['attributes']=_['intersection'](_0x4388b9[_0x9744('0x2f')],qs[_0x9744('0x35')](_0x3e7599['query'][_0x9744('0x35')]));_0x15ff9f['attributes']=_0x15ff9f[_0x9744('0x34')][_0x9744('0x49')]?_0x15ff9f[_0x9744('0x34')]:_0x4388b9[_0x9744('0x2f')];if(_0x3e7599[_0x9744('0x31')][_0x9744('0x43')]){_0x15ff9f['include']=[{'all':!![]}];}_0x15ff9f=_[_0x9744('0x3c')]({},_0x15ff9f,_0x3e7599['options']);return db['Campaign'][_0x9744('0x4a')](_0x15ff9f)[_0x9744('0x26')](handleEntityNotFound(_0x460075,null))[_0x9744('0x26')](respondWithResult(_0x460075,null))[_0x9744('0x46')](handleError(_0x460075,null));};exports['create']=function(_0x37ae61,_0x3b9dd7){return db[_0x9744('0x2e')][_0x9744('0x4b')](_0x37ae61[_0x9744('0x4c')],{})['then'](function(_0x1431a4){var _0x21e781=_0x37ae61[_0x9744('0x4d')][_0x9744('0x4e')]({'plain':!![]});if(!_0x21e781)throw new Error(_0x9744('0x4f'));if(_0x21e781['role']===_0x9744('0x4d')){var _0x57257a=_0x1431a4[_0x9744('0x4e')]({'plain':!![]});var _0x4ef6c8='IvrCampaigns';return db['UserProfileSection'][_0x9744('0x4a')]({'where':{'name':_0x4ef6c8,'userProfileId':_0x21e781['userProfileId']},'raw':!![]})[_0x9744('0x26')](function(_0x2dcc18){if(_0x2dcc18&&_0x2dcc18[_0x9744('0x50')]===0x0){return db['UserProfileResource'][_0x9744('0x4b')]({'name':_0x57257a[_0x9744('0x2c')],'resourceId':_0x57257a['id'],'type':_0x2dcc18[_0x9744('0x2c')],'sectionId':_0x2dcc18['id']},{})[_0x9744('0x26')](function(){return _0x1431a4;});}else{return _0x1431a4;}})[_0x9744('0x46')](function(_0x72b54b){logger[_0x9744('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x72b54b);throw _0x72b54b;});}return _0x1431a4;})[_0x9744('0x26')](respondWithResult(_0x3b9dd7,0xc9))[_0x9744('0x46')](handleError(_0x3b9dd7,null));};exports[_0x9744('0x51')]=function(_0x3407b0,_0x26949e){var _0x51b8fc={'raw':![],'where':{'id':_0x3407b0[_0x9744('0x48')]['id']}},_0x41ca91={};_0x41ca91[_0x9744('0x2f')]=_[_0x9744('0x30')](db[_0x9744('0x2e')][_0x9744('0x52')]);_0x51b8fc[_0x9744('0x34')]=_[_0x9744('0x33')](_0x41ca91[_0x9744('0x2f')],qs[_0x9744('0x35')](_0x3407b0[_0x9744('0x31')][_0x9744('0x35')]));_0x51b8fc[_0x9744('0x34')]=_0x51b8fc[_0x9744('0x34')][_0x9744('0x49')]?_0x51b8fc[_0x9744('0x34')]:_0x41ca91[_0x9744('0x2f')];if(_0x3407b0[_0x9744('0x31')][_0x9744('0x43')]){_0x51b8fc[_0x9744('0x44')]=[{'all':!![]}];}_0x51b8fc=_[_0x9744('0x3c')]({},_0x51b8fc,_0x3407b0['options']);return db['Campaign'][_0x9744('0x4a')](_0x51b8fc)[_0x9744('0x26')](handleEntityNotFound(_0x26949e,null))['then'](function(_0x26e5ab){if(_0x26e5ab){var _0x2bd224=_0x26e5ab[_0x9744('0x4e')]({'plain':!![]});_0x2bd224=qs[_0x9744('0x53')](_0x2bd224,['id',_0x9744('0x54'),_0x9744('0x55')]);_0x3407b0['body']=_['omit'](_0x3407b0[_0x9744('0x4c')],['id',_0x9744('0x54'),'updatedAt']);return db[_0x9744('0x2e')][_0x9744('0x4b')](_['merge'](_0x2bd224,_0x3407b0[_0x9744('0x4c')]),{'include':_0x3407b0[_0x9744('0x31')][_0x9744('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x50d6b7){var _0x1f4ce9=_0x3407b0[_0x9744('0x4d')][_0x9744('0x4e')]({'plain':!![]});if(!_0x1f4ce9)throw new Error(_0x9744('0x4f'));if(_0x1f4ce9[_0x9744('0x56')]===_0x9744('0x4d')){var _0x14437d=_0x50d6b7['get']({'plain':!![]});var _0x2729b5=_0x9744('0x28');return db[_0x9744('0x57')]['find']({'where':{'name':_0x2729b5,'userProfileId':_0x1f4ce9[_0x9744('0x58')]},'raw':!![]})[_0x9744('0x26')](function(_0x3775ac){if(_0x3775ac&&_0x3775ac[_0x9744('0x50')]===0x0){return db[_0x9744('0x29')]['create']({'name':_0x14437d[_0x9744('0x2c')],'resourceId':_0x14437d['id'],'type':_0x3775ac[_0x9744('0x2c')],'sectionId':_0x3775ac['id']},{})['then'](function(){return _0x50d6b7;});}else{return _0x50d6b7;}})[_0x9744('0x46')](function(_0x3b544b){logger[_0x9744('0x2a')](_0x9744('0x59'),_0x3b544b);throw _0x3b544b;});}return _0x50d6b7;});}})['then'](respondWithResult(_0x26949e,0xc9))[_0x9744('0x46')](handleError(_0x26949e,null));};exports[_0x9744('0x25')]=function(_0x310731,_0x39c39a){if(_0x310731['body']['id']){delete _0x310731[_0x9744('0x4c')]['id'];}return db['Campaign']['find']({'where':{'id':_0x310731[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x39c39a,null))['then'](saveUpdates(_0x310731[_0x9744('0x4c')],null))[_0x9744('0x26')](respondWithResult(_0x39c39a,null))['catch'](handleError(_0x39c39a,null));};exports['destroy']=function(_0x3c0f89,_0x505c13){return db['Campaign'][_0x9744('0x4a')]({'where':{'id':_0x3c0f89['params']['id']}})['then'](handleEntityNotFound(_0x505c13,null))[_0x9744('0x26')](removeEntity(_0x505c13,null))['catch'](handleError(_0x505c13,null));};exports['getHoppers']=function(_0x1bf331,_0x3171fc,_0x296c6f){var _0x55a64e={'raw':!![],'where':{}};var _0x43f36c={};var _0x31fd8a={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1bf331[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x3171fc,null))[_0x9744('0x26')](function(_0x3cd1b8){if(_0x3cd1b8){_0x43f36c[_0x9744('0x2f')]=_[_0x9744('0x30')](db[_0x9744('0x5a')][_0x9744('0x52')]);_0x43f36c['query']=_[_0x9744('0x30')](_0x1bf331[_0x9744('0x31')]);_0x43f36c[_0x9744('0x32')]=_[_0x9744('0x33')](_0x43f36c['model'],_0x43f36c['query']);_0x55a64e['attributes']=_[_0x9744('0x33')](_0x43f36c[_0x9744('0x2f')],qs[_0x9744('0x35')](_0x1bf331[_0x9744('0x31')][_0x9744('0x35')]));_0x55a64e[_0x9744('0x34')]=_0x55a64e['attributes'][_0x9744('0x49')]?_0x55a64e[_0x9744('0x34')]:_0x43f36c[_0x9744('0x2f')];if(!_0x1bf331['query'][_0x9744('0x36')](_0x9744('0x37'))){_0x55a64e['limit']=qs[_0x9744('0x1f')](_0x1bf331[_0x9744('0x31')][_0x9744('0x1f')]);_0x55a64e[_0x9744('0x1e')]=qs['offset'](_0x1bf331[_0x9744('0x31')][_0x9744('0x1e')]);}_0x55a64e['order']=qs[_0x9744('0x38')](_0x1bf331[_0x9744('0x31')][_0x9744('0x38')]);_0x55a64e['where']=qs[_0x9744('0x32')](_[_0x9744('0x3a')](_0x1bf331[_0x9744('0x31')],_0x43f36c[_0x9744('0x32')]));_0x55a64e[_0x9744('0x39')][_0x9744('0x5b')]=_0x3cd1b8['id'];if(_0x1bf331['query'][_0x9744('0x3b')]){_0x55a64e[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x55a64e[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0x55a64e[_0x9744('0x34')],function(_0x4c2190){var _0x288203={};_0x288203[_0x4c2190]={'$like':'%'+_0x1bf331[_0x9744('0x31')]['filter']+'%'};return _0x288203;})});}_0x55a64e=_[_0x9744('0x3c')]({},_0x55a64e,_0x1bf331['options']);return db[_0x9744('0x5a')]['count']({'where':_0x55a64e[_0x9744('0x39')]})[_0x9744('0x26')](function(_0x57e9dd){_0x31fd8a[_0x9744('0x1d')]=_0x57e9dd;if(_0x1bf331[_0x9744('0x31')][_0x9744('0x43')]){_0x55a64e[_0x9744('0x44')]=[{'all':!![]}];}return db[_0x9744('0x5a')]['findAll'](_0x55a64e);})['then'](function(_0x416f03){_0x31fd8a[_0x9744('0x5c')]=_0x416f03;return _0x31fd8a;});}})[_0x9744('0x26')](respondWithFilteredResult(_0x3171fc,_0x55a64e))[_0x9744('0x46')](handleError(_0x3171fc,null));};exports[_0x9744('0x5d')]=function(_0x4e4e66,_0x3f1df4,_0x5644f2){var _0xd75891={'raw':!![],'where':{}};var _0x42a9c4={};var _0x57cc8e={'count':0x0,'rows':[]};return db[_0x9744('0x2e')][_0x9744('0x5e')]({'where':{'id':_0x4e4e66[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x3f1df4,null))[_0x9744('0x26')](function(_0x356227){if(_0x356227){_0x42a9c4[_0x9744('0x2f')]=_[_0x9744('0x30')](db['CmHopperHistory']['rawAttributes']);_0x42a9c4[_0x9744('0x31')]=_[_0x9744('0x30')](_0x4e4e66[_0x9744('0x31')]);_0x42a9c4[_0x9744('0x32')]=_['intersection'](_0x42a9c4[_0x9744('0x2f')],_0x42a9c4[_0x9744('0x31')]);_0xd75891['attributes']=_[_0x9744('0x33')](_0x42a9c4['model'],qs[_0x9744('0x35')](_0x4e4e66['query'][_0x9744('0x35')]));_0xd75891[_0x9744('0x34')]=_0xd75891[_0x9744('0x34')][_0x9744('0x49')]?_0xd75891['attributes']:_0x42a9c4[_0x9744('0x2f')];if(!_0x4e4e66['query'][_0x9744('0x36')](_0x9744('0x37'))){_0xd75891[_0x9744('0x1f')]=qs[_0x9744('0x1f')](_0x4e4e66[_0x9744('0x31')][_0x9744('0x1f')]);_0xd75891['offset']=qs['offset'](_0x4e4e66['query'][_0x9744('0x1e')]);}_0xd75891['order']=qs[_0x9744('0x38')](_0x4e4e66['query']['sort']);_0xd75891[_0x9744('0x39')]=qs[_0x9744('0x32')](_[_0x9744('0x3a')](_0x4e4e66[_0x9744('0x31')],_0x42a9c4[_0x9744('0x32')]));_0xd75891[_0x9744('0x39')][_0x9744('0x5b')]=_0x356227['id'];if(_0x4e4e66['query']['filter']){_0xd75891['where']=_['merge'](_0xd75891[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0xd75891[_0x9744('0x34')],function(_0x299b3e){var _0x2ffdf1={};_0x2ffdf1[_0x299b3e]={'$like':'%'+_0x4e4e66[_0x9744('0x31')]['filter']+'%'};return _0x2ffdf1;})});}_0xd75891=_[_0x9744('0x3c')]({},_0xd75891,_0x4e4e66[_0x9744('0x42')]);return db[_0x9744('0x5f')][_0x9744('0x1d')]({'where':_0xd75891['where']})[_0x9744('0x26')](function(_0x5f1ca9){_0x57cc8e['count']=_0x5f1ca9;if(_0x4e4e66[_0x9744('0x31')][_0x9744('0x43')]){_0xd75891['include']=[{'all':!![]}];}return db[_0x9744('0x5f')][_0x9744('0x45')](_0xd75891);})[_0x9744('0x26')](function(_0x4d066b){_0x57cc8e['rows']=_0x4d066b;return _0x57cc8e;});}})[_0x9744('0x26')](respondWithFilteredResult(_0x3f1df4,_0xd75891))[_0x9744('0x46')](handleError(_0x3f1df4,null));};exports[_0x9744('0x60')]=function(_0x1658ca,_0x3acf80,_0x412784){var _0x57a5e2={'raw':!![],'where':{}};var _0x44e93b={};var _0x3e362b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1658ca[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x3acf80,null))[_0x9744('0x26')](function(_0x777496){if(_0x777496){_0x44e93b['model']=_[_0x9744('0x30')](db[_0x9744('0x61')][_0x9744('0x52')]);_0x44e93b[_0x9744('0x31')]=_[_0x9744('0x30')](_0x1658ca[_0x9744('0x31')]);_0x44e93b[_0x9744('0x32')]=_['intersection'](_0x44e93b[_0x9744('0x2f')],_0x44e93b[_0x9744('0x31')]);_0x57a5e2[_0x9744('0x34')]=_[_0x9744('0x33')](_0x44e93b['model'],qs[_0x9744('0x35')](_0x1658ca[_0x9744('0x31')][_0x9744('0x35')]));_0x57a5e2[_0x9744('0x34')]=_0x57a5e2[_0x9744('0x34')]['length']?_0x57a5e2[_0x9744('0x34')]:_0x44e93b[_0x9744('0x2f')];if(!_0x1658ca[_0x9744('0x31')][_0x9744('0x36')]('nolimit')){_0x57a5e2[_0x9744('0x1f')]=qs[_0x9744('0x1f')](_0x1658ca[_0x9744('0x31')][_0x9744('0x1f')]);_0x57a5e2['offset']=qs[_0x9744('0x1e')](_0x1658ca[_0x9744('0x31')]['offset']);}_0x57a5e2[_0x9744('0x62')]=qs['sort'](_0x1658ca['query']['sort']);_0x57a5e2[_0x9744('0x39')]=qs['filters'](_[_0x9744('0x3a')](_0x1658ca[_0x9744('0x31')],_0x44e93b[_0x9744('0x32')]));_0x57a5e2[_0x9744('0x39')][_0x9744('0x5b')]=_0x777496['id'];if(_0x1658ca[_0x9744('0x31')][_0x9744('0x3b')]){_0x57a5e2[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x57a5e2[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0x57a5e2['attributes'],function(_0x2eab0b){var _0x195c69={};_0x195c69[_0x2eab0b]={'$like':'%'+_0x1658ca[_0x9744('0x31')][_0x9744('0x3b')]+'%'};return _0x195c69;})});}_0x57a5e2=_[_0x9744('0x3c')]({},_0x57a5e2,_0x1658ca['options']);return db[_0x9744('0x61')][_0x9744('0x1d')]({'where':_0x57a5e2[_0x9744('0x39')]})['then'](function(_0x1c9e6e){_0x3e362b[_0x9744('0x1d')]=_0x1c9e6e;if(_0x1658ca[_0x9744('0x31')][_0x9744('0x43')]){_0x57a5e2['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x9744('0x45')](_0x57a5e2);})[_0x9744('0x26')](function(_0x1deee1){_0x3e362b[_0x9744('0x5c')]=_0x1deee1;return _0x3e362b;});}})[_0x9744('0x26')](respondWithFilteredResult(_0x3acf80,_0x57a5e2))[_0x9744('0x46')](handleError(_0x3acf80,null));};exports[_0x9744('0x63')]=function(_0x2abe5e,_0x14f211,_0x42aef1){var _0x5a7c46={'raw':!![],'where':{}};var _0x2a4f13={};var _0x44f10a={'count':0x0,'rows':[]};return db[_0x9744('0x2e')][_0x9744('0x5e')]({'where':{'id':_0x2abe5e[_0x9744('0x48')]['id']}})['then'](handleEntityNotFound(_0x14f211,null))[_0x9744('0x26')](function(_0x1fa498){if(_0x1fa498){_0x2a4f13['model']=_[_0x9744('0x30')](db[_0x9744('0x64')][_0x9744('0x52')]);_0x2a4f13['query']=_[_0x9744('0x30')](_0x2abe5e['query']);_0x2a4f13[_0x9744('0x32')]=_[_0x9744('0x33')](_0x2a4f13[_0x9744('0x2f')],_0x2a4f13['query']);_0x5a7c46['attributes']=_[_0x9744('0x33')](_0x2a4f13[_0x9744('0x2f')],qs[_0x9744('0x35')](_0x2abe5e[_0x9744('0x31')][_0x9744('0x35')]));_0x5a7c46['attributes']=_0x5a7c46['attributes']['length']?_0x5a7c46['attributes']:_0x2a4f13[_0x9744('0x2f')];if(!_0x2abe5e[_0x9744('0x31')][_0x9744('0x36')]('nolimit')){_0x5a7c46['limit']=qs[_0x9744('0x1f')](_0x2abe5e[_0x9744('0x31')][_0x9744('0x1f')]);_0x5a7c46[_0x9744('0x1e')]=qs[_0x9744('0x1e')](_0x2abe5e[_0x9744('0x31')]['offset']);}_0x5a7c46[_0x9744('0x62')]=qs['sort'](_0x2abe5e['query'][_0x9744('0x38')]);_0x5a7c46[_0x9744('0x39')]=qs['filters'](_[_0x9744('0x3a')](_0x2abe5e[_0x9744('0x31')],_0x2a4f13['filters']));_0x5a7c46[_0x9744('0x39')][_0x9744('0x5b')]=_0x1fa498['id'];if(_0x2abe5e[_0x9744('0x31')][_0x9744('0x3b')]){_0x5a7c46[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x5a7c46[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0x5a7c46[_0x9744('0x34')],function(_0x4710b2){var _0x31883e={};_0x31883e[_0x4710b2]={'$like':'%'+_0x2abe5e[_0x9744('0x31')]['filter']+'%'};return _0x31883e;})});}_0x5a7c46=_['merge']({},_0x5a7c46,_0x2abe5e['options']);return db[_0x9744('0x64')][_0x9744('0x1d')]({'where':_0x5a7c46[_0x9744('0x39')]})[_0x9744('0x26')](function(_0x190c73){_0x44f10a[_0x9744('0x1d')]=_0x190c73;if(_0x2abe5e[_0x9744('0x31')][_0x9744('0x43')]){_0x5a7c46[_0x9744('0x44')]=[{'all':!![]}];}return db[_0x9744('0x64')][_0x9744('0x45')](_0x5a7c46);})[_0x9744('0x26')](function(_0x209159){_0x44f10a[_0x9744('0x5c')]=_0x209159;return _0x44f10a;});}})[_0x9744('0x26')](respondWithFilteredResult(_0x14f211,_0x5a7c46))[_0x9744('0x46')](handleError(_0x14f211,null));};exports[_0x9744('0x65')]=function(_0xb2b3d9,_0x2b92e9,_0x2f339e){var _0x38aa3e={};var _0x471289={};var _0x48702d;var _0x434a18;return db['Campaign']['findOne']({'where':{'id':_0xb2b3d9[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x2b92e9,null))[_0x9744('0x26')](function(_0x14c1e5){if(_0x14c1e5){_0x48702d=_0x14c1e5;_0x471289[_0x9744('0x2f')]=_[_0x9744('0x30')](db[_0x9744('0x66')][_0x9744('0x52')]);_0x471289[_0x9744('0x31')]=_[_0x9744('0x30')](_0xb2b3d9[_0x9744('0x31')]);_0x471289[_0x9744('0x32')]=_[_0x9744('0x33')](_0x471289[_0x9744('0x2f')],_0x471289[_0x9744('0x31')]);_0x38aa3e[_0x9744('0x34')]=_[_0x9744('0x33')](_0x471289['model'],qs['fields'](_0xb2b3d9[_0x9744('0x31')][_0x9744('0x35')]));_0x38aa3e[_0x9744('0x34')]=_0x38aa3e[_0x9744('0x34')][_0x9744('0x49')]?_0x38aa3e[_0x9744('0x34')]:_0x471289[_0x9744('0x2f')];_0x38aa3e[_0x9744('0x62')]=qs['sort'](_0xb2b3d9[_0x9744('0x31')][_0x9744('0x38')]);_0x38aa3e[_0x9744('0x39')]=qs['filters'](_['pick'](_0xb2b3d9[_0x9744('0x31')],_0x471289['filters']));if(_0xb2b3d9['query']['filter']){_0x38aa3e[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x38aa3e[_0x9744('0x39')],{'$or':_[_0x9744('0x3d')](_0x38aa3e['attributes'],function(_0x429385){var _0x516341={};_0x516341[_0x429385]={'$like':'%'+_0xb2b3d9[_0x9744('0x31')][_0x9744('0x3b')]+'%'};return _0x516341;})});}_0x38aa3e=_[_0x9744('0x3c')]({},_0x38aa3e,_0xb2b3d9['options']);return _0x48702d[_0x9744('0x65')](_0x38aa3e);}})[_0x9744('0x26')](function(_0xd483e7){if(_0xd483e7){_0x434a18=_0xd483e7[_0x9744('0x49')];if(!_0xb2b3d9[_0x9744('0x31')]['hasOwnProperty']('nolimit')){_0x38aa3e[_0x9744('0x1f')]=qs['limit'](_0xb2b3d9['query'][_0x9744('0x1f')]);_0x38aa3e[_0x9744('0x1e')]=qs[_0x9744('0x1e')](_0xb2b3d9[_0x9744('0x31')]['offset']);}return _0x48702d['getLists'](_0x38aa3e);}})[_0x9744('0x26')](function(_0x14564a){if(_0x14564a){return _0x14564a?{'count':_0x434a18,'rows':_0x14564a}:null;}})['then'](respondWithResult(_0x2b92e9,null))['catch'](handleError(_0x2b92e9,null));};exports[_0x9744('0x67')]=function(_0x5407e9,_0x5a42f3,_0x210f0e){var _0x286809,_0x26220e;return db[_0x9744('0x2e')]['find']({'where':{'id':_0x5407e9['params']['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x5a42f3,null))[_0x9744('0x26')](function(_0x47e56d){if(_0x47e56d){_0x26220e=_0x47e56d;return _0x47e56d[_0x9744('0x67')](_0x5407e9[_0x9744('0x4c')]['ids'],_[_0x9744('0x53')](_0x5407e9[_0x9744('0x4c')],[_0x9744('0x68'),'id'])||{});}return null;})[_0x9744('0x69')](function(_0x51bf7e){var _0x21a87f;_0x286809=_0x51bf7e||[];var _0x20b7c8=[];if(_0x51bf7e){for(var _0x1c8dbf=0x0;_0x1c8dbf<_0x51bf7e['length'];_0x1c8dbf+=0x1){var _0x5a33ce=_0x51bf7e[_0x1c8dbf][_0x9744('0x4e')]({'plain':!![]});_0x26220e['dialCheckDuplicateType']=_0x5407e9[_0x9744('0x4c')][_0x9744('0x6a')]?_0x5407e9[_0x9744('0x4c')][_0x9744('0x6a')]:_0x26220e[_0x9744('0x6a')];switch(_0x26220e['dialCheckDuplicateType']){case _0x9744('0x6b'):_0x21a87f=squel[_0x9744('0x6c')]()['into'](_0x9744('0x6d'))[_0x9744('0x6e')]([_0x9744('0x6f'),'scheduledAt',_0x9744('0x70'),_0x9744('0x71'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x9744('0x41')](_0x9744('0x6f'),'phone')[_0x9744('0x41')](_0x9744('0x72'),_0x9744('0x73'))[_0x9744('0x41')]('id',_0x9744('0x70'))[_0x9744('0x41')](_0x5a33ce[_0x9744('0x74')][_0x9744('0x75')](),_0x9744('0x71'))[_0x9744('0x41')](_0x5407e9[_0x9744('0x48')]['id'][_0x9744('0x75')](),'CampaignId')['field'](_0x9744('0x72'),'createdAt')[_0x9744('0x41')](_0x9744('0x72'),_0x9744('0x55'))[_0x9744('0x76')]('cm_contacts')[_0x9744('0x39')](_0x9744('0x77'))[_0x9744('0x39')](_0x9744('0x78'),_0x5a33ce[_0x9744('0x74')][_0x9744('0x75')]())[_0x9744('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x9744('0x39')](_0x9744('0x79'),squel[_0x9744('0x7a')]()['field'](_0x9744('0x7b'))[_0x9744('0x76')](_0x9744('0x7c'))[_0x9744('0x39')]('CampaignId\x20=\x20?',_0x5407e9['params']['id'][_0x9744('0x75')]()))[_0x9744('0x39')](_0x9744('0x79'),squel[_0x9744('0x7a')]()[_0x9744('0x41')](_0x9744('0x7d'))[_0x9744('0x76')](_0x9744('0x6d'))['where'](_0x9744('0x7e'),_0x5407e9['params']['id'][_0x9744('0x75')]())))[_0x9744('0x75')]();break;case _0x9744('0x7f'):_0x21a87f=squel[_0x9744('0x6c')]()[_0x9744('0x80')](_0x9744('0x6d'))[_0x9744('0x6e')]([_0x9744('0x6f'),_0x9744('0x73'),_0x9744('0x70'),_0x9744('0x71'),_0x9744('0x5b'),_0x9744('0x54'),_0x9744('0x55')],squel['select']()['field'](_0x9744('0x6f'),_0x9744('0x6f'))[_0x9744('0x41')](_0x9744('0x72'),_0x9744('0x73'))[_0x9744('0x41')]('id',_0x9744('0x70'))['field'](_0x5a33ce[_0x9744('0x74')][_0x9744('0x75')](),_0x9744('0x71'))['field'](_0x5407e9['params']['id'][_0x9744('0x75')](),_0x9744('0x5b'))['field'](_0x9744('0x72'),_0x9744('0x54'))[_0x9744('0x41')](_0x9744('0x72'),_0x9744('0x55'))['from'](_0x9744('0x81'))[_0x9744('0x39')]('deletedAt\x20IS\x20NULL')[_0x9744('0x39')](_0x9744('0x78'),_0x5a33ce['CmListId'][_0x9744('0x75')]())[_0x9744('0x39')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9744('0x7a')]()[_0x9744('0x41')]('COALESCE(phone,\x27\x27)')[_0x9744('0x76')](_0x9744('0x6d'))[_0x9744('0x39')](_0x9744('0x7e'),_0x5407e9[_0x9744('0x48')]['id']['toString']())))[_0x9744('0x75')]();break;default:_0x21a87f=squel[_0x9744('0x6c')]()['into']('cm_hopper')[_0x9744('0x6e')]([_0x9744('0x6f'),_0x9744('0x73'),_0x9744('0x70'),_0x9744('0x71'),_0x9744('0x5b'),_0x9744('0x54'),_0x9744('0x55')],squel[_0x9744('0x7a')]()[_0x9744('0x41')](_0x9744('0x6f'),_0x9744('0x6f'))[_0x9744('0x41')]('NOW()',_0x9744('0x73'))[_0x9744('0x41')]('id',_0x9744('0x70'))[_0x9744('0x41')](_0x5a33ce[_0x9744('0x74')][_0x9744('0x75')](),_0x9744('0x71'))[_0x9744('0x41')](_0x5407e9[_0x9744('0x48')]['id'][_0x9744('0x75')](),_0x9744('0x5b'))['field']('NOW()',_0x9744('0x54'))[_0x9744('0x41')](_0x9744('0x72'),'updatedAt')[_0x9744('0x76')](_0x9744('0x81'))[_0x9744('0x39')](_0x9744('0x77'))[_0x9744('0x39')]('ListId\x20=\x20?',_0x5a33ce[_0x9744('0x74')][_0x9744('0x75')]())['where'](_0x9744('0x82')))['toString']();}_0x20b7c8[_0x9744('0x83')](db[_0x9744('0x84')][_0x9744('0x31')](_0x21a87f));}return BPromise[_0x9744('0x85')](_0x20b7c8);}})[_0x9744('0x26')](function(){return _0x286809;})[_0x9744('0x26')](respondWithResult(_0x5a42f3,null))['catch'](handleError(_0x5a42f3,null));};exports[_0x9744('0x86')]=function(_0x1141ae,_0x5eccee,_0x332732){return db[_0x9744('0x2e')][_0x9744('0x4a')]({'where':{'id':_0x1141ae['params']['id']}})['then'](handleEntityNotFound(_0x5eccee,null))[_0x9744('0x26')](function(_0x403571){if(_0x403571){return _0x403571[_0x9744('0x86')](_0x1141ae[_0x9744('0x31')]['ids']);}})[_0x9744('0x26')](function(_0x1cb9b8){if(_0x1cb9b8){return db[_0x9744('0x5a')][_0x9744('0x27')]({'where':{'ListId':_0x1141ae[_0x9744('0x31')][_0x9744('0x68')],'CampaignId':_0x1141ae[_0x9744('0x48')]['id']}})[_0x9744('0x26')](function(){return _0x1cb9b8;});}})[_0x9744('0x26')](respondWithStatusCode(_0x5eccee,null))[_0x9744('0x46')](handleError(_0x5eccee,null));};exports[_0x9744('0x87')]=function(_0x482dd6,_0x153b82,_0x4a75bc){var _0x409fa8={'raw':!![],'where':{}};var _0x4df677={};var _0x3e62c9={'count':0x0,'rows':[]};return db[_0x9744('0x2e')][_0x9744('0x5e')]({'where':{'id':_0x482dd6[_0x9744('0x48')]['id']}})['then'](handleEntityNotFound(_0x153b82,null))[_0x9744('0x26')](function(_0x63f764){if(_0x63f764){_0x4df677[_0x9744('0x2f')]=_[_0x9744('0x30')](db['CmList']['rawAttributes']);_0x4df677[_0x9744('0x31')]=_[_0x9744('0x30')](_0x482dd6['query']);_0x4df677[_0x9744('0x32')]=_['intersection'](_0x4df677[_0x9744('0x2f')],_0x4df677['query']);_0x409fa8[_0x9744('0x34')]=_[_0x9744('0x33')](_0x4df677[_0x9744('0x2f')],qs[_0x9744('0x35')](_0x482dd6[_0x9744('0x31')]['fields']));_0x409fa8[_0x9744('0x34')]=_0x409fa8[_0x9744('0x34')]['length']?_0x409fa8[_0x9744('0x34')]:_0x4df677['model'];if(!_0x482dd6[_0x9744('0x31')]['hasOwnProperty'](_0x9744('0x37'))){_0x409fa8[_0x9744('0x1f')]=qs[_0x9744('0x1f')](_0x482dd6[_0x9744('0x31')]['limit']);_0x409fa8[_0x9744('0x1e')]=qs['offset'](_0x482dd6[_0x9744('0x31')]['offset']);}_0x409fa8[_0x9744('0x62')]=qs[_0x9744('0x38')](_0x482dd6[_0x9744('0x31')]['sort']);_0x409fa8[_0x9744('0x39')]=qs['filters'](_[_0x9744('0x3a')](_0x482dd6['query'],_0x4df677[_0x9744('0x32')]));_0x409fa8[_0x9744('0x39')][_0x9744('0x5b')]=_0x63f764['id'];if(_0x482dd6['query'][_0x9744('0x3b')]){_0x409fa8[_0x9744('0x39')]=_[_0x9744('0x3c')](_0x409fa8['where'],{'$or':_[_0x9744('0x3d')](_0x409fa8[_0x9744('0x34')],function(_0x163992){var _0x31673e={};_0x31673e[_0x163992]={'$like':'%'+_0x482dd6['query']['filter']+'%'};return _0x31673e;})});}_0x409fa8=_[_0x9744('0x3c')]({},_0x409fa8,_0x482dd6[_0x9744('0x42')]);return db[_0x9744('0x66')][_0x9744('0x1d')]({'where':_0x409fa8[_0x9744('0x39')]})['then'](function(_0x4631dd){_0x3e62c9[_0x9744('0x1d')]=_0x4631dd;if(_0x482dd6[_0x9744('0x31')][_0x9744('0x43')]){_0x409fa8['include']=[{'all':!![]}];}return db[_0x9744('0x66')]['findAll'](_0x409fa8);})[_0x9744('0x26')](function(_0x1052aa){_0x3e62c9[_0x9744('0x5c')]=_0x1052aa;return _0x3e62c9;});}})[_0x9744('0x26')](respondWithFilteredResult(_0x153b82,_0x409fa8))[_0x9744('0x46')](handleError(_0x153b82,null));};exports[_0x9744('0x88')]=function(_0x2b0e02,_0x4ce38b,_0x369cd2){var _0x41b18a,_0x1d2436;return db['Campaign'][_0x9744('0x4a')]({'where':{'id':_0x2b0e02[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x4ce38b,null))[_0x9744('0x26')](function(_0x30034e){if(_0x30034e){_0x1d2436=_0x30034e;return _0x30034e[_0x9744('0x88')](_0x2b0e02[_0x9744('0x4c')][_0x9744('0x68')],_['omit'](_0x2b0e02[_0x9744('0x4c')],[_0x9744('0x68'),'id'])||{});}return null;})[_0x9744('0x69')](function(_0x19a410){var _0x1c1f27;_0x41b18a=_0x19a410||[];var _0xf960d5=[];if(_0x19a410){for(var _0x1ae25e=0x0;_0x1ae25e<_0x19a410['length'];_0x1ae25e+=0x1){var _0x618d49=_0x19a410[_0x1ae25e][_0x9744('0x4e')]({'plain':!![]});_0x1c1f27=squel[_0x9744('0x6c')]()[_0x9744('0x80')](_0x9744('0x89'))[_0x9744('0x6e')]([_0x9744('0x6f'),_0x9744('0x70'),'ListId',_0x9744('0x5b'),_0x9744('0x54'),'updatedAt'],squel[_0x9744('0x7a')]()[_0x9744('0x41')](_0x9744('0x6f'),_0x9744('0x6f'))[_0x9744('0x41')]('id',_0x9744('0x70'))[_0x9744('0x41')](_0x618d49[_0x9744('0x74')][_0x9744('0x75')](),_0x9744('0x71'))[_0x9744('0x41')](_0x2b0e02['params']['id'][_0x9744('0x75')](),_0x9744('0x5b'))[_0x9744('0x41')](_0x9744('0x72'),'createdAt')[_0x9744('0x41')](_0x9744('0x72'),_0x9744('0x55'))[_0x9744('0x76')](_0x9744('0x81'))[_0x9744('0x39')](_0x9744('0x77'))[_0x9744('0x39')](_0x9744('0x78'),_0x618d49[_0x9744('0x74')][_0x9744('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x9744('0x75')]();_0xf960d5[_0x9744('0x83')](db[_0x9744('0x84')]['query'](_0x1c1f27));}return BPromise[_0x9744('0x85')](_0xf960d5);}})['then'](function(){return _0x41b18a;})[_0x9744('0x26')](respondWithResult(_0x4ce38b,null))[_0x9744('0x46')](handleError(_0x4ce38b,null));};exports['removeBlackLists']=function(_0x2a4400,_0x1c7e8d,_0x1702d7){return db[_0x9744('0x2e')]['find']({'where':{'id':_0x2a4400[_0x9744('0x48')]['id']}})[_0x9744('0x26')](handleEntityNotFound(_0x1c7e8d,null))['then'](function(_0x4761a3){if(_0x4761a3){return _0x4761a3[_0x9744('0x8a')](_0x2a4400['query']['ids']);}})[_0x9744('0x26')](function(_0x32c58f){if(_0x32c58f){return db[_0x9744('0x64')][_0x9744('0x27')]({'where':{'ListId':_0x2a4400[_0x9744('0x31')][_0x9744('0x68')],'CampaignId':_0x2a4400[_0x9744('0x48')]['id']}})[_0x9744('0x26')](function(){return _0x32c58f;});}})[_0x9744('0x26')](respondWithStatusCode(_0x1c7e8d,null))[_0x9744('0x46')](handleError(_0x1c7e8d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 0c390a7..facc31d 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 _0x2b15=['../../config/environment','exports','campaigns','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5734e5,_0x3bacfe){var _0x20a886=function(_0x6a5246){while(--_0x6a5246){_0x5734e5['push'](_0x5734e5['shift']());}};_0x20a886(++_0x3bacfe);}(_0x2b15,0xe7));var _0x52b1=function(_0x1f6d0f,_0x3882f6){_0x1f6d0f=_0x1f6d0f-0x0;var _0x13ed30=_0x2b15[_0x1f6d0f];return _0x13ed30;};'use strict';var _=require(_0x52b1('0x0'));var util=require(_0x52b1('0x1'));var logger=require(_0x52b1('0x2'))(_0x52b1('0x3'));var moment=require(_0x52b1('0x4'));var BPromise=require(_0x52b1('0x5'));var rp=require(_0x52b1('0x6'));var fs=require('fs');var path=require(_0x52b1('0x7'));var rimraf=require(_0x52b1('0x8'));var config=require(_0x52b1('0x9'));var attributes=require('./campaign.attributes');module[_0x52b1('0xa')]=function(_0x4597a6,_0x220a04){return _0x4597a6['define']('Campaign',attributes,{'tableName':_0x52b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x559c=['request-promise','path','../../config/environment','./campaign.attributes','exports','define','util','moment','bluebird'];(function(_0x57862e,_0x2c787f){var _0x1f44ba=function(_0x25aa7e){while(--_0x25aa7e){_0x57862e['push'](_0x57862e['shift']());}};_0x1f44ba(++_0x2c787f);}(_0x559c,0x1a4));var _0xc559=function(_0x1f76a4,_0x433129){_0x1f76a4=_0x1f76a4-0x0;var _0x1f515a=_0x559c[_0x1f76a4];return _0x1f515a;};'use strict';var _=require('lodash');var util=require(_0xc559('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc559('0x1'));var BPromise=require(_0xc559('0x2'));var rp=require(_0xc559('0x3'));var fs=require('fs');var path=require(_0xc559('0x4'));var rimraf=require('rimraf');var config=require(_0xc559('0x5'));var attributes=require(_0xc559('0x6'));module[_0xc559('0x7')]=function(_0x2ca474,_0x3e3444){return _0x2ca474[_0xc559('0x8')]('Campaign',attributes,{'tableName':'campaigns','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 3a84f76..b92420b 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 _0x9ba4=['rpc','../../config/environment','jayson/promise','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d6145,_0x4ff721){var _0x25d2f7=function(_0x7c81f5){while(--_0x7c81f5){_0x5d6145['push'](_0x5d6145['shift']());}};_0x25d2f7(++_0x4ff721);}(_0x9ba4,0xd8));var _0x49ba=function(_0x2dbb17,_0x446d04){_0x2dbb17=_0x2dbb17-0x0;var _0x2a96c0=_0x9ba4[_0x2dbb17];return _0x2a96c0;};'use strict';var _=require('lodash');var util=require(_0x49ba('0x0'));var moment=require(_0x49ba('0x1'));var BPromise=require(_0x49ba('0x2'));var rs=require(_0x49ba('0x3'));var fs=require('fs');var Redis=require(_0x49ba('0x4'));var db=require(_0x49ba('0x5'))['db'];var utils=require(_0x49ba('0x6'));var logger=require(_0x49ba('0x7'))(_0x49ba('0x8'));var config=require(_0x49ba('0x9'));var jayson=require(_0x49ba('0xa'));var client=jayson[_0x49ba('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b152f,_0x36e340,_0x564816){return new BPromise(function(_0x4da389,_0x269c87){return client[_0x49ba('0xc')](_0x3b152f,_0x564816)['then'](function(_0x98a0bd){logger[_0x49ba('0xd')](_0x49ba('0xe'),_0x36e340,_0x49ba('0xf'));logger[_0x49ba('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x36e340,_0x49ba('0xf'),JSON[_0x49ba('0x11')](_0x98a0bd));if(_0x98a0bd['error']){if(_0x98a0bd[_0x49ba('0x12')]['code']===0x1f4){logger[_0x49ba('0x12')](_0x49ba('0xe'),_0x36e340,_0x98a0bd[_0x49ba('0x12')]['message']);return _0x269c87(_0x98a0bd['error']['message']);}logger['error']('Campaign,\x20%s,\x20%s',_0x36e340,_0x98a0bd['error'][_0x49ba('0x13')]);return _0x4da389(_0x98a0bd[_0x49ba('0x12')][_0x49ba('0x13')]);}else{logger[_0x49ba('0xd')](_0x49ba('0xe'),_0x36e340,_0x49ba('0xf'));_0x4da389(_0x98a0bd[_0x49ba('0x14')]['message']);}})['catch'](function(_0x22f097){logger[_0x49ba('0x12')]('Campaign,\x20%s,\x20%s',_0x36e340,_0x22f097);_0x269c87(_0x22f097);});});}exports[_0x49ba('0x15')]=function(_0x2ccf23){var _0x44ca6b=this;return new Promise(function(_0x535ab4,_0x3a8c82){return db['Campaign'][_0x49ba('0x16')]({'raw':_0x2ccf23['options']?_0x2ccf23[_0x49ba('0x17')][_0x49ba('0x18')]===undefined?!![]:![]:!![],'where':_0x2ccf23[_0x49ba('0x17')]?_0x2ccf23['options'][_0x49ba('0x19')]||null:null,'attributes':_0x2ccf23[_0x49ba('0x17')]?_0x2ccf23[_0x49ba('0x17')][_0x49ba('0x1a')]||null:null,'limit':_0x2ccf23['options']?_0x2ccf23['options'][_0x49ba('0x1b')]||null:null,'include':_0x2ccf23[_0x49ba('0x17')]?_0x2ccf23[_0x49ba('0x17')][_0x49ba('0x1c')]?_[_0x49ba('0x1d')](_0x2ccf23[_0x49ba('0x17')][_0x49ba('0x1c')],function(_0x3c4a05){return{'model':db[_0x3c4a05['model']],'as':_0x3c4a05['as'],'attributes':_0x3c4a05[_0x49ba('0x1a')],'include':_0x3c4a05['include']?_[_0x49ba('0x1d')](_0x3c4a05[_0x49ba('0x1c')],function(_0x131862){return{'model':db[_0x131862['model']],'as':_0x131862['as'],'attributes':_0x131862[_0x49ba('0x1a')],'include':_0x131862[_0x49ba('0x1c')]?_[_0x49ba('0x1d')](_0x131862[_0x49ba('0x1c')],function(_0x5b2c0e){return{'model':db[_0x5b2c0e['model']],'as':_0x5b2c0e['as'],'attributes':_0x5b2c0e[_0x49ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x49ba('0x1e')](function(_0x12147a){logger[_0x49ba('0xd')](_0x49ba('0x15'),_0x2ccf23);logger[_0x49ba('0x10')](_0x49ba('0x15'),_0x2ccf23,JSON['stringify'](_0x12147a));_0x535ab4(_0x12147a);})[_0x49ba('0x1f')](function(_0x15eb36){logger[_0x49ba('0x12')](_0x49ba('0x15'),_0x15eb36[_0x49ba('0x13')],_0x2ccf23);_0x3a8c82(_0x44ca6b[_0x49ba('0x12')](0x1f4,_0x15eb36[_0x49ba('0x13')]));});});}; \ No newline at end of file +var _0xc695=['GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','catch'];(function(_0x541b31,_0xff60d4){var _0x5343fc=function(_0x53e0c9){while(--_0x53e0c9){_0x541b31['push'](_0x541b31['shift']());}};_0x5343fc(++_0xff60d4);}(_0xc695,0x183));var _0x5c69=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xc695[_0x143a91];return _0x1906f5;};'use strict';var _=require(_0x5c69('0x0'));var util=require(_0x5c69('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c69('0x2'));var logger=require(_0x5c69('0x3'))('rpc');var config=require(_0x5c69('0x4'));var jayson=require(_0x5c69('0x5'));var client=jayson[_0x5c69('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c0b2,_0xa66ab2,_0x1910f9){return new BPromise(function(_0x118f6e,_0x303474){return client[_0x5c69('0x7')](_0x44c0b2,_0x1910f9)[_0x5c69('0x8')](function(_0x43b9ed){logger[_0x5c69('0x9')]('Campaign,\x20%s,\x20%s',_0xa66ab2,_0x5c69('0xa'));logger[_0x5c69('0xb')]('Campaign,\x20%s,\x20%s,\x20%s',_0xa66ab2,_0x5c69('0xa'),JSON[_0x5c69('0xc')](_0x43b9ed));if(_0x43b9ed[_0x5c69('0xd')]){if(_0x43b9ed['error'][_0x5c69('0xe')]===0x1f4){logger[_0x5c69('0xd')]('Campaign,\x20%s,\x20%s',_0xa66ab2,_0x43b9ed[_0x5c69('0xd')]['message']);return _0x303474(_0x43b9ed[_0x5c69('0xd')][_0x5c69('0xf')]);}logger[_0x5c69('0xd')]('Campaign,\x20%s,\x20%s',_0xa66ab2,_0x43b9ed[_0x5c69('0xd')][_0x5c69('0xf')]);return _0x118f6e(_0x43b9ed[_0x5c69('0xd')][_0x5c69('0xf')]);}else{logger[_0x5c69('0x9')](_0x5c69('0x10'),_0xa66ab2,_0x5c69('0xa'));_0x118f6e(_0x43b9ed[_0x5c69('0x11')][_0x5c69('0xf')]);}})[_0x5c69('0x12')](function(_0x4145d8){logger[_0x5c69('0xd')](_0x5c69('0x10'),_0xa66ab2,_0x4145d8);_0x303474(_0x4145d8);});});}exports[_0x5c69('0x13')]=function(_0x3cd9fb){var _0x5725c4=this;return new Promise(function(_0x35f4c4,_0x28500f){return db['Campaign'][_0x5c69('0x14')]({'raw':_0x3cd9fb[_0x5c69('0x15')]?_0x3cd9fb[_0x5c69('0x15')][_0x5c69('0x16')]===undefined?!![]:![]:!![],'where':_0x3cd9fb['options']?_0x3cd9fb[_0x5c69('0x15')][_0x5c69('0x17')]||null:null,'attributes':_0x3cd9fb['options']?_0x3cd9fb['options'][_0x5c69('0x18')]||null:null,'limit':_0x3cd9fb[_0x5c69('0x15')]?_0x3cd9fb['options'][_0x5c69('0x19')]||null:null,'include':_0x3cd9fb[_0x5c69('0x15')]?_0x3cd9fb[_0x5c69('0x15')]['include']?_['map'](_0x3cd9fb[_0x5c69('0x15')]['include'],function(_0xe2cdf6){return{'model':db[_0xe2cdf6['model']],'as':_0xe2cdf6['as'],'attributes':_0xe2cdf6[_0x5c69('0x18')],'include':_0xe2cdf6[_0x5c69('0x1a')]?_[_0x5c69('0x1b')](_0xe2cdf6[_0x5c69('0x1a')],function(_0x1a43ac){return{'model':db[_0x1a43ac['model']],'as':_0x1a43ac['as'],'attributes':_0x1a43ac['attributes'],'include':_0x1a43ac[_0x5c69('0x1a')]?_[_0x5c69('0x1b')](_0x1a43ac[_0x5c69('0x1a')],function(_0x40a2ef){return{'model':db[_0x40a2ef[_0x5c69('0x1c')]],'as':_0x40a2ef['as'],'attributes':_0x40a2ef[_0x5c69('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13c994){logger['info'](_0x5c69('0x13'),_0x3cd9fb);logger['debug'](_0x5c69('0x13'),_0x3cd9fb,JSON[_0x5c69('0xc')](_0x13c994));_0x35f4c4(_0x13c994);})['catch'](function(_0x15f8dd){logger[_0x5c69('0xd')](_0x5c69('0x13'),_0x15f8dd[_0x5c69('0xf')],_0x3cd9fb);_0x28500f(_0x5725c4[_0x5c69('0xd')](0x1f4,_0x15f8dd['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d74e137..cd95222 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 _0x4d94=['./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40acf9,_0x4674f5){var _0x4eea7e=function(_0xe11f09){while(--_0xe11f09){_0x40acf9['push'](_0x40acf9['shift']());}};_0x4eea7e(++_0x4674f5);}(_0x4d94,0x7e));var _0x44d9=function(_0x3ab065,_0x327461){_0x3ab065=_0x3ab065-0x0;var _0x3cbf8d=_0x4d94[_0x3ab065];return _0x3cbf8d;};'use strict';var multer=require('multer');var util=require(_0x44d9('0x0'));var path=require(_0x44d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x44d9('0x2'));var router=express['Router']();var auth=require(_0x44d9('0x3'));var interaction=require(_0x44d9('0x4'));var config=require(_0x44d9('0x5'));var controller=require(_0x44d9('0x6'));router['get']('/',auth[_0x44d9('0x7')](),controller[_0x44d9('0x8')]);router['get'](_0x44d9('0x9'),auth[_0x44d9('0x7')](),controller[_0x44d9('0xa')]);router[_0x44d9('0xb')](_0x44d9('0xc'),auth[_0x44d9('0x7')](),controller[_0x44d9('0xd')]);router[_0x44d9('0xb')](_0x44d9('0xe'),auth['isAuthenticated'](),controller[_0x44d9('0xf')]);router[_0x44d9('0xb')](_0x44d9('0x10'),auth[_0x44d9('0x7')](),controller['getHopperFinals']);router['get'](_0x44d9('0x11'),auth[_0x44d9('0x7')](),controller['getHopperBlacks']);router[_0x44d9('0xb')]('/:id/lists',auth[_0x44d9('0x7')](),controller[_0x44d9('0x12')]);router['get']('/:id/blacklists',auth[_0x44d9('0x7')](),controller[_0x44d9('0x13')]);router[_0x44d9('0x14')]('/',auth[_0x44d9('0x7')](),controller[_0x44d9('0x15')]);router['post'](_0x44d9('0x16'),auth[_0x44d9('0x7')](),controller[_0x44d9('0x17')]);router['post'](_0x44d9('0x18'),auth[_0x44d9('0x7')](),controller['addLists']);router[_0x44d9('0x14')](_0x44d9('0x19'),auth[_0x44d9('0x7')](),controller[_0x44d9('0x1a')]);router[_0x44d9('0x1b')](_0x44d9('0x9'),auth[_0x44d9('0x7')](),controller[_0x44d9('0x1c')]);router[_0x44d9('0x1d')]('/:id',auth[_0x44d9('0x7')](),controller[_0x44d9('0x1e')]);router[_0x44d9('0x1d')](_0x44d9('0x18'),auth['isAuthenticated'](),controller[_0x44d9('0x1f')]);router[_0x44d9('0x1d')](_0x44d9('0x19'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x44d9('0x20')]=router; \ No newline at end of file +var _0xc278=['getBlackLists','post','create','/:id/clone','addLists','addBlackLists','delete','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists'];(function(_0x3a27ec,_0x269721){var _0x54a475=function(_0xaefb95){while(--_0xaefb95){_0x3a27ec['push'](_0x3a27ec['shift']());}};_0x54a475(++_0x269721);}(_0xc278,0x6d));var _0x8c27=function(_0x500317,_0x151c7b){_0x500317=_0x500317-0x0;var _0x35c9c1=_0xc278[_0x500317];return _0x35c9c1;};'use strict';var multer=require(_0x8c27('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c27('0x1'));var express=require(_0x8c27('0x2'));var router=express[_0x8c27('0x3')]();var auth=require(_0x8c27('0x4'));var interaction=require(_0x8c27('0x5'));var config=require(_0x8c27('0x6'));var controller=require(_0x8c27('0x7'));router['get']('/',auth[_0x8c27('0x8')](),controller[_0x8c27('0x9')]);router[_0x8c27('0xa')](_0x8c27('0xb'),auth[_0x8c27('0x8')](),controller[_0x8c27('0xc')]);router[_0x8c27('0xa')](_0x8c27('0xd'),auth['isAuthenticated'](),controller[_0x8c27('0xe')]);router[_0x8c27('0xa')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x8c27('0xf')]);router['get'](_0x8c27('0x10'),auth['isAuthenticated'](),controller[_0x8c27('0x11')]);router['get'](_0x8c27('0x12'),auth[_0x8c27('0x8')](),controller[_0x8c27('0x13')]);router[_0x8c27('0xa')](_0x8c27('0x14'),auth[_0x8c27('0x8')](),controller[_0x8c27('0x15')]);router['get'](_0x8c27('0x16'),auth['isAuthenticated'](),controller[_0x8c27('0x17')]);router[_0x8c27('0x18')]('/',auth['isAuthenticated'](),controller[_0x8c27('0x19')]);router['post'](_0x8c27('0x1a'),auth[_0x8c27('0x8')](),controller['clone']);router[_0x8c27('0x18')](_0x8c27('0x14'),auth[_0x8c27('0x8')](),controller[_0x8c27('0x1b')]);router[_0x8c27('0x18')](_0x8c27('0x16'),auth[_0x8c27('0x8')](),controller[_0x8c27('0x1c')]);router['put'](_0x8c27('0xb'),auth[_0x8c27('0x8')](),controller['update']);router[_0x8c27('0x1d')](_0x8c27('0xb'),auth[_0x8c27('0x8')](),controller['destroy']);router[_0x8c27('0x1d')](_0x8c27('0x14'),auth[_0x8c27('0x8')](),controller[_0x8c27('0x1e')]);router[_0x8c27('0x1d')]('/:id/blacklists',auth[_0x8c27('0x8')](),controller[_0x8c27('0x1f')]);module[_0x8c27('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 49b315b..dc8956c 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 _0x4cc4=['STRING','TEXT','key','sequelize','exports'];(function(_0xe6705,_0x3fdc9a){var _0x5dd008=function(_0x4d1049){while(--_0x4d1049){_0xe6705['push'](_0xe6705['shift']());}};_0x5dd008(++_0x3fdc9a);}(_0x4cc4,0x152));var _0x44cc=function(_0x578c72,_0x3f3abf){_0x578c72=_0x578c72-0x0;var _0x46affe=_0x4cc4[_0x578c72];return _0x46affe;};'use strict';var Sequelize=require(_0x44cc('0x0'));module[_0x44cc('0x1')]={'key':{'type':Sequelize[_0x44cc('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x44cc('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x44cc('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x44cc('0x4'));}}}; \ No newline at end of file +var _0xd31f=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x3c231f,_0x16c067){var _0x5e84c0=function(_0x5e2a4f){while(--_0x5e2a4f){_0x3c231f['push'](_0x3c231f['shift']());}};_0x5e84c0(++_0x16c067);}(_0xd31f,0x192));var _0xfd31=function(_0x427fad,_0x3b6ef4){_0x427fad=_0x427fad-0x0;var _0x382214=_0xd31f[_0x427fad];return _0x382214;};'use strict';var Sequelize=require(_0xfd31('0x0'));module[_0xfd31('0x1')]={'key':{'type':Sequelize[_0xfd31('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xfd31('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xfd31('0x2')]},'name':{'type':Sequelize[_0xfd31('0x4')],'get':function(){return this[_0xfd31('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index fea6939..cc0e381 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 _0xd5b1=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','CannedAnswer','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','rows','show','params','rawAttributes','include','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','sox','to-csv','ejs','lodash','squel'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xd5b1,0xf3));var _0x1d5b=function(_0x338b15,_0x3202d8){_0x338b15=_0x338b15-0x0;var _0x466e43=_0xd5b1[_0x338b15];return _0x466e43;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d5b('0x0'));var rimraf=require(_0x1d5b('0x1'));var zipdir=require(_0x1d5b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d5b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1d5b('0x4'));var csv=require(_0x1d5b('0x5'));var ejs=require(_0x1d5b('0x6'));var fs=require('fs');var _=require(_0x1d5b('0x7'));var squel=require(_0x1d5b('0x8'));var crypto=require(_0x1d5b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d5b('0xa'));var Papa=require(_0x1d5b('0xb'));var Redis=require(_0x1d5b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x1d5b('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d5b('0xe'))(_0x1d5b('0xf'));var utils=require(_0x1d5b('0x10'));var config=require(_0x1d5b('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x93abf8,_0x1ef789){_0x1ef789=_0x1ef789||0xcc;return function(_0x8d02f1){if(_0x8d02f1){return _0x93abf8[_0x1d5b('0x12')](_0x1ef789);}return _0x93abf8['status'](_0x1ef789)[_0x1d5b('0x13')]();};}function respondWithResult(_0xdaf313,_0x117440){_0x117440=_0x117440||0xc8;return function(_0x50cf29){if(_0x50cf29){return _0xdaf313[_0x1d5b('0x14')](_0x117440)[_0x1d5b('0x15')](_0x50cf29);}};}function respondWithFilteredResult(_0xb952b9,_0x518ff3){return function(_0x4cb39f){if(_0x4cb39f){var _0x3f9a33=_0x4cb39f[_0x1d5b('0x16')],_0x365b96=_0x518ff3[_0x1d5b('0x17')],_0x4003f0=_0x518ff3['offset']+_0x518ff3['limit'],_0x4cdcdb;if(_0x4003f0>=_0x3f9a33){_0x4003f0=_0x3f9a33;_0x4cdcdb=0xc8;}else{_0x4cdcdb=0xce;}_0xb952b9['status'](_0x4cdcdb);return _0xb952b9[_0x1d5b('0x18')](_0x1d5b('0x19'),_0x365b96+'-'+_0x4003f0+'/'+_0x3f9a33)[_0x1d5b('0x15')](_0x4cb39f);}return null;};}function patchUpdates(_0x7401fc){return function(_0x58fed9){try{jsonpatch[_0x1d5b('0x1a')](_0x58fed9,_0x7401fc,!![]);}catch(_0x4a9014){return BPromise[_0x1d5b('0x1b')](_0x4a9014);}return _0x58fed9[_0x1d5b('0x1c')]();};}function saveUpdates(_0x2ce02f,_0x40942f){return function(_0x402983){if(_0x402983){return _0x402983[_0x1d5b('0x1d')](_0x2ce02f)[_0x1d5b('0x1e')](function(_0x6ee9f4){return _0x6ee9f4;});}return null;};}function removeEntity(_0x52ddd5,_0x58413b){return function(_0x182dda){if(_0x182dda){return _0x182dda['destroy']()[_0x1d5b('0x1e')](function(){var _0x2e877f=_0x182dda['get']({'plain':!![]});var _0x4ba8f3='CannedAnswers';return db[_0x1d5b('0x1f')][_0x1d5b('0x20')]({'where':{'type':_0x4ba8f3,'resourceId':_0x2e877f['id']}})[_0x1d5b('0x1e')](function(){return _0x182dda;});})[_0x1d5b('0x1e')](function(){_0x52ddd5[_0x1d5b('0x14')](0xcc)[_0x1d5b('0x13')]();});}};}function handleEntityNotFound(_0xc45638,_0x68a906){return function(_0x322102){if(!_0x322102){_0xc45638[_0x1d5b('0x12')](0x194);}return _0x322102;};}function handleError(_0x1b45a1,_0x5a9540){_0x5a9540=_0x5a9540||0x1f4;return function(_0x5172e1){logger[_0x1d5b('0x21')](_0x5172e1[_0x1d5b('0x22')]);if(_0x5172e1[_0x1d5b('0x23')]){delete _0x5172e1['name'];}_0x1b45a1[_0x1d5b('0x14')](_0x5a9540)[_0x1d5b('0x24')](_0x5172e1);};}exports[_0x1d5b('0x25')]=function(_0x17dd45,_0x1e1249){var _0x2ccbb8={},_0x558648={},_0x49102f={'count':0x0,'rows':[]};var _0x8350bd=db[_0x1d5b('0x26')]['rawAttributes'];_0x558648[_0x1d5b('0x27')]=_[_0x1d5b('0x28')](_0x8350bd);_0x558648[_0x1d5b('0x29')]=_[_0x1d5b('0x28')](_0x17dd45[_0x1d5b('0x29')]);_0x558648[_0x1d5b('0x2a')]=_[_0x1d5b('0x2b')](_0x558648[_0x1d5b('0x27')],_0x558648['query']);_0x2ccbb8[_0x1d5b('0x2c')]=_[_0x1d5b('0x2b')](_0x558648[_0x1d5b('0x27')],qs['fields'](_0x17dd45['query'][_0x1d5b('0x2d')]));_0x2ccbb8[_0x1d5b('0x2c')]=_0x2ccbb8[_0x1d5b('0x2c')][_0x1d5b('0x2e')]?_0x2ccbb8[_0x1d5b('0x2c')]:_0x558648[_0x1d5b('0x27')];if(!_0x17dd45['query'][_0x1d5b('0x2f')](_0x1d5b('0x30'))){_0x2ccbb8['limit']=qs[_0x1d5b('0x31')](_0x17dd45[_0x1d5b('0x29')][_0x1d5b('0x31')]);_0x2ccbb8['offset']=qs[_0x1d5b('0x17')](_0x17dd45[_0x1d5b('0x29')][_0x1d5b('0x17')]);}_0x2ccbb8['order']=qs[_0x1d5b('0x32')](_0x17dd45['query'][_0x1d5b('0x32')]);_0x2ccbb8[_0x1d5b('0x33')]=qs[_0x1d5b('0x2a')](_[_0x1d5b('0x34')](_0x17dd45[_0x1d5b('0x29')],_0x558648[_0x1d5b('0x2a')]));if(_0x17dd45[_0x1d5b('0x29')][_0x1d5b('0x35')]){_0x2ccbb8['where']=_[_0x1d5b('0x36')](_0x2ccbb8[_0x1d5b('0x33')],{'$or':_[_0x1d5b('0x37')](_0x8350bd,function(_0x54c138){if(_0x54c138['type'][_0x1d5b('0x38')]!==_0x1d5b('0x39')){var _0x348452={};_0x348452[_0x54c138[_0x1d5b('0x3a')]]={'$like':'%'+_0x17dd45['query']['filter']+'%'};return _0x348452;}})});}_0x2ccbb8=_['merge']({},_0x2ccbb8,_0x17dd45['options']);var _0x2f8ba8={'where':_0x2ccbb8[_0x1d5b('0x33')]};return db[_0x1d5b('0x26')][_0x1d5b('0x16')](_0x2f8ba8)[_0x1d5b('0x1e')](function(_0x43e6a9){_0x49102f['count']=_0x43e6a9;if(_0x17dd45[_0x1d5b('0x29')][_0x1d5b('0x3b')]){_0x2ccbb8['include']=[{'all':!![]}];}return db[_0x1d5b('0x26')]['findAll'](_0x2ccbb8);})[_0x1d5b('0x1e')](function(_0x58f975){_0x49102f[_0x1d5b('0x3c')]=_0x58f975;return _0x49102f;})['then'](respondWithFilteredResult(_0x1e1249,_0x2ccbb8))['catch'](handleError(_0x1e1249,null));};exports[_0x1d5b('0x3d')]=function(_0x3a0130,_0x3e8e89){var _0x2a85b8={'raw':!![],'where':{'id':_0x3a0130[_0x1d5b('0x3e')]['id']}},_0xcccb78={};_0xcccb78[_0x1d5b('0x27')]=_[_0x1d5b('0x28')](db[_0x1d5b('0x26')][_0x1d5b('0x3f')]);_0xcccb78[_0x1d5b('0x29')]=_['keys'](_0x3a0130[_0x1d5b('0x29')]);_0xcccb78[_0x1d5b('0x2a')]=_['intersection'](_0xcccb78['model'],_0xcccb78[_0x1d5b('0x29')]);_0x2a85b8[_0x1d5b('0x2c')]=_[_0x1d5b('0x2b')](_0xcccb78[_0x1d5b('0x27')],qs['fields'](_0x3a0130[_0x1d5b('0x29')][_0x1d5b('0x2d')]));_0x2a85b8[_0x1d5b('0x2c')]=_0x2a85b8['attributes'][_0x1d5b('0x2e')]?_0x2a85b8[_0x1d5b('0x2c')]:_0xcccb78[_0x1d5b('0x27')];if(_0x3a0130[_0x1d5b('0x29')][_0x1d5b('0x3b')]){_0x2a85b8[_0x1d5b('0x40')]=[{'all':!![]}];}_0x2a85b8=_[_0x1d5b('0x36')]({},_0x2a85b8,_0x3a0130['options']);return db[_0x1d5b('0x26')][_0x1d5b('0x41')](_0x2a85b8)[_0x1d5b('0x1e')](handleEntityNotFound(_0x3e8e89,null))['then'](respondWithResult(_0x3e8e89,null))['catch'](handleError(_0x3e8e89,null));};exports[_0x1d5b('0x1d')]=function(_0x3a5ee1,_0x1934fd){if(_0x3a5ee1[_0x1d5b('0x42')]['id']){delete _0x3a5ee1[_0x1d5b('0x42')]['id'];}return db[_0x1d5b('0x26')]['find']({'where':{'id':_0x3a5ee1[_0x1d5b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1934fd,null))[_0x1d5b('0x1e')](saveUpdates(_0x3a5ee1[_0x1d5b('0x42')],null))[_0x1d5b('0x1e')](respondWithResult(_0x1934fd,null))[_0x1d5b('0x43')](handleError(_0x1934fd,null));};exports['destroy']=function(_0x26952b,_0xe2d1d1){return db[_0x1d5b('0x26')]['find']({'where':{'id':_0x26952b[_0x1d5b('0x3e')]['id']}})[_0x1d5b('0x1e')](handleEntityNotFound(_0xe2d1d1,null))['then'](removeEntity(_0xe2d1d1,null))['catch'](handleError(_0xe2d1d1,null));};exports['create']=function(_0x19fdfb,_0x2a81c3){var _0x1bfe71={'key':_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x38')]};if(_0x19fdfb['body'][_0x1d5b('0x44')]){_0x1bfe71[_0x1d5b('0x44')]=_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x44')];}else if(_0x19fdfb[_0x1d5b('0x42')]['SmsAccountId']){_0x1bfe71['SmsAccountId']=_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x45')];}else if(_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x46')]){_0x1bfe71[_0x1d5b('0x46')]=_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x46')];}else if(_0x19fdfb[_0x1d5b('0x42')][_0x1d5b('0x47')]){_0x1bfe71[_0x1d5b('0x47')]=_0x19fdfb['body'][_0x1d5b('0x47')];}return db[_0x1d5b('0x26')]['find']({'where':_0x1bfe71})[_0x1d5b('0x1e')](function(_0x313ffc){if(_0x313ffc){throw new db[(_0x1d5b('0x48'))][(_0x1d5b('0x49'))](_0x1d5b('0x4a'));}return db[_0x1d5b('0x26')][_0x1d5b('0x4b')](_0x19fdfb[_0x1d5b('0x42')]);})[_0x1d5b('0x1e')](function(_0x3e8e22){var _0x12db6b=_0x19fdfb[_0x1d5b('0x4c')]['get']({'plain':!![]});if(!_0x12db6b)throw new Error(_0x1d5b('0x4d'));if(_0x12db6b[_0x1d5b('0x4e')]===_0x1d5b('0x4c')){var _0x402bac=_0x3e8e22[_0x1d5b('0x4f')]({'plain':!![]});return db[_0x1d5b('0x50')][_0x1d5b('0x41')]({'where':{'name':_0x1d5b('0x51'),'userProfileId':_0x12db6b['userProfileId']},'raw':!![]})[_0x1d5b('0x1e')](function(_0x17256b){if(_0x17256b&&_0x17256b[_0x1d5b('0x52')]===0x0){return db[_0x1d5b('0x1f')][_0x1d5b('0x4b')]({'name':_0x402bac[_0x1d5b('0x23')],'resourceId':_0x402bac['id'],'type':_0x17256b['name'],'sectionId':_0x17256b['id']},{})[_0x1d5b('0x1e')](function(){return _0x3e8e22;});}else{return _0x3e8e22;}})[_0x1d5b('0x43')](function(_0x4b8327){logger[_0x1d5b('0x21')](_0x1d5b('0x53'),_0x4b8327);throw _0x4b8327;});}return _0x3e8e22;})[_0x1d5b('0x1e')](respondWithResult(_0x2a81c3,0xc9))['catch'](handleError(_0x2a81c3,null));}; \ No newline at end of file +var _0xa84f=['count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','CannedAnswer','include','findAll','rows','catch','show','params','length','includeAll','find','body','create','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','status','end'];(function(_0x3f1577,_0x240b1d){var _0x7806be=function(_0x42600e){while(--_0x42600e){_0x3f1577['push'](_0x3f1577['shift']());}};_0x7806be(++_0x240b1d);}(_0xa84f,0x96));var _0xfa84=function(_0x33a573,_0x5e88b2){_0x33a573=_0x33a573-0x0;var _0xa8c4c0=_0xa84f[_0x33a573];return _0xa8c4c0;};'use strict';var pdf=require(_0xfa84('0x0'));var emlformat=require(_0xfa84('0x1'));var rimraf=require(_0xfa84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa84('0x3'));var rp=require(_0xfa84('0x4'));var moment=require('moment');var BPromise=require(_0xfa84('0x5'));var Mustache=require(_0xfa84('0x6'));var util=require(_0xfa84('0x7'));var path=require('path');var sox=require(_0xfa84('0x8'));var csv=require('to-csv');var ejs=require(_0xfa84('0x9'));var fs=require('fs');var _=require(_0xfa84('0xa'));var squel=require('squel');var crypto=require(_0xfa84('0xb'));var jsforce=require(_0xfa84('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa84('0xd'));var querystring=require(_0xfa84('0xe'));var Papa=require(_0xfa84('0xf'));var Redis=require(_0xfa84('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfa84('0x11'));var hardwareService=require(_0xfa84('0x12'));var logger=require(_0xfa84('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a4cc,_0x350fb9){_0x350fb9=_0x350fb9||0xcc;return function(_0x42f06d){if(_0x42f06d){return _0x21a4cc['sendStatus'](_0x350fb9);}return _0x21a4cc[_0xfa84('0x14')](_0x350fb9)[_0xfa84('0x15')]();};}function respondWithResult(_0x26f040,_0xc2b191){_0xc2b191=_0xc2b191||0xc8;return function(_0x8316d4){if(_0x8316d4){return _0x26f040['status'](_0xc2b191)['json'](_0x8316d4);}};}function respondWithFilteredResult(_0x1096e0,_0x5e4c0e){return function(_0x3916fa){if(_0x3916fa){var _0x246c72=_0x3916fa[_0xfa84('0x16')],_0x4279a8=_0x5e4c0e[_0xfa84('0x17')],_0x4ada54=_0x5e4c0e['offset']+_0x5e4c0e[_0xfa84('0x18')],_0x68210;if(_0x4ada54>=_0x246c72){_0x4ada54=_0x246c72;_0x68210=0xc8;}else{_0x68210=0xce;}_0x1096e0['status'](_0x68210);return _0x1096e0[_0xfa84('0x19')](_0xfa84('0x1a'),_0x4279a8+'-'+_0x4ada54+'/'+_0x246c72)[_0xfa84('0x1b')](_0x3916fa);}return null;};}function patchUpdates(_0x285bf9){return function(_0x32522f){try{jsonpatch[_0xfa84('0x1c')](_0x32522f,_0x285bf9,!![]);}catch(_0x176376){return BPromise[_0xfa84('0x1d')](_0x176376);}return _0x32522f[_0xfa84('0x1e')]();};}function saveUpdates(_0x5c3dc2,_0x504546){return function(_0x69dee4){if(_0x69dee4){return _0x69dee4[_0xfa84('0x1f')](_0x5c3dc2)[_0xfa84('0x20')](function(_0x56e413){return _0x56e413;});}return null;};}function removeEntity(_0x18ecfb,_0x22aa41){return function(_0x50c64c){if(_0x50c64c){return _0x50c64c[_0xfa84('0x21')]()['then'](function(){var _0x39e64d=_0x50c64c['get']({'plain':!![]});var _0x18e66c=_0xfa84('0x22');return db[_0xfa84('0x23')]['destroy']({'where':{'type':_0x18e66c,'resourceId':_0x39e64d['id']}})[_0xfa84('0x20')](function(){return _0x50c64c;});})[_0xfa84('0x20')](function(){_0x18ecfb[_0xfa84('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11dc13,_0x5d4473){return function(_0x54c048){if(!_0x54c048){_0x11dc13[_0xfa84('0x24')](0x194);}return _0x54c048;};}function handleError(_0x398ab4,_0x4df95f){_0x4df95f=_0x4df95f||0x1f4;return function(_0xc1a2f5){logger[_0xfa84('0x25')](_0xc1a2f5[_0xfa84('0x26')]);if(_0xc1a2f5[_0xfa84('0x27')]){delete _0xc1a2f5[_0xfa84('0x27')];}_0x398ab4['status'](_0x4df95f)[_0xfa84('0x28')](_0xc1a2f5);};}exports[_0xfa84('0x29')]=function(_0x437e37,_0x51caee){var _0x45fa9d={},_0x32924e={},_0xfac343={'count':0x0,'rows':[]};var _0x174396=db['CannedAnswer'][_0xfa84('0x2a')];_0x32924e[_0xfa84('0x2b')]=_['keys'](_0x174396);_0x32924e['query']=_[_0xfa84('0x2c')](_0x437e37[_0xfa84('0x2d')]);_0x32924e[_0xfa84('0x2e')]=_[_0xfa84('0x2f')](_0x32924e['model'],_0x32924e['query']);_0x45fa9d['attributes']=_[_0xfa84('0x2f')](_0x32924e[_0xfa84('0x2b')],qs[_0xfa84('0x30')](_0x437e37['query'][_0xfa84('0x30')]));_0x45fa9d[_0xfa84('0x31')]=_0x45fa9d[_0xfa84('0x31')]['length']?_0x45fa9d[_0xfa84('0x31')]:_0x32924e[_0xfa84('0x2b')];if(!_0x437e37['query']['hasOwnProperty'](_0xfa84('0x32'))){_0x45fa9d[_0xfa84('0x18')]=qs['limit'](_0x437e37[_0xfa84('0x2d')][_0xfa84('0x18')]);_0x45fa9d[_0xfa84('0x17')]=qs[_0xfa84('0x17')](_0x437e37['query'][_0xfa84('0x17')]);}_0x45fa9d[_0xfa84('0x33')]=qs[_0xfa84('0x34')](_0x437e37[_0xfa84('0x2d')][_0xfa84('0x34')]);_0x45fa9d[_0xfa84('0x35')]=qs[_0xfa84('0x2e')](_['pick'](_0x437e37[_0xfa84('0x2d')],_0x32924e[_0xfa84('0x2e')]));if(_0x437e37['query'][_0xfa84('0x36')]){_0x45fa9d['where']=_[_0xfa84('0x37')](_0x45fa9d[_0xfa84('0x35')],{'$or':_[_0xfa84('0x38')](_0x174396,function(_0x591b9a){if(_0x591b9a['type'][_0xfa84('0x39')]!==_0xfa84('0x3a')){var _0x423372={};_0x423372[_0x591b9a[_0xfa84('0x3b')]]={'$like':'%'+_0x437e37[_0xfa84('0x2d')]['filter']+'%'};return _0x423372;}})});}_0x45fa9d=_[_0xfa84('0x37')]({},_0x45fa9d,_0x437e37[_0xfa84('0x3c')]);var _0x1eab4d={'where':_0x45fa9d['where']};return db[_0xfa84('0x3d')]['count'](_0x1eab4d)[_0xfa84('0x20')](function(_0x10467f){_0xfac343[_0xfa84('0x16')]=_0x10467f;if(_0x437e37[_0xfa84('0x2d')]['includeAll']){_0x45fa9d[_0xfa84('0x3e')]=[{'all':!![]}];}return db[_0xfa84('0x3d')][_0xfa84('0x3f')](_0x45fa9d);})['then'](function(_0x406c90){_0xfac343[_0xfa84('0x40')]=_0x406c90;return _0xfac343;})[_0xfa84('0x20')](respondWithFilteredResult(_0x51caee,_0x45fa9d))[_0xfa84('0x41')](handleError(_0x51caee,null));};exports[_0xfa84('0x42')]=function(_0x208734,_0x37c010){var _0x3211e5={'raw':!![],'where':{'id':_0x208734[_0xfa84('0x43')]['id']}},_0x3a7f2c={};_0x3a7f2c[_0xfa84('0x2b')]=_[_0xfa84('0x2c')](db[_0xfa84('0x3d')]['rawAttributes']);_0x3a7f2c[_0xfa84('0x2d')]=_['keys'](_0x208734[_0xfa84('0x2d')]);_0x3a7f2c['filters']=_[_0xfa84('0x2f')](_0x3a7f2c[_0xfa84('0x2b')],_0x3a7f2c[_0xfa84('0x2d')]);_0x3211e5[_0xfa84('0x31')]=_[_0xfa84('0x2f')](_0x3a7f2c[_0xfa84('0x2b')],qs[_0xfa84('0x30')](_0x208734[_0xfa84('0x2d')][_0xfa84('0x30')]));_0x3211e5['attributes']=_0x3211e5[_0xfa84('0x31')][_0xfa84('0x44')]?_0x3211e5[_0xfa84('0x31')]:_0x3a7f2c[_0xfa84('0x2b')];if(_0x208734[_0xfa84('0x2d')][_0xfa84('0x45')]){_0x3211e5[_0xfa84('0x3e')]=[{'all':!![]}];}_0x3211e5=_['merge']({},_0x3211e5,_0x208734[_0xfa84('0x3c')]);return db[_0xfa84('0x3d')][_0xfa84('0x46')](_0x3211e5)[_0xfa84('0x20')](handleEntityNotFound(_0x37c010,null))[_0xfa84('0x20')](respondWithResult(_0x37c010,null))[_0xfa84('0x41')](handleError(_0x37c010,null));};exports[_0xfa84('0x1f')]=function(_0xfb1e26,_0x46ad9f){if(_0xfb1e26[_0xfa84('0x47')]['id']){delete _0xfb1e26[_0xfa84('0x47')]['id'];}return db[_0xfa84('0x3d')]['find']({'where':{'id':_0xfb1e26[_0xfa84('0x43')]['id']}})[_0xfa84('0x20')](handleEntityNotFound(_0x46ad9f,null))[_0xfa84('0x20')](saveUpdates(_0xfb1e26[_0xfa84('0x47')],null))[_0xfa84('0x20')](respondWithResult(_0x46ad9f,null))[_0xfa84('0x41')](handleError(_0x46ad9f,null));};exports[_0xfa84('0x21')]=function(_0x519346,_0xcf5310){return db['CannedAnswer']['find']({'where':{'id':_0x519346[_0xfa84('0x43')]['id']}})['then'](handleEntityNotFound(_0xcf5310,null))[_0xfa84('0x20')](removeEntity(_0xcf5310,null))['catch'](handleError(_0xcf5310,null));};exports[_0xfa84('0x48')]=function(_0x588538,_0x2598b9){var _0x3ea884={'key':_0x588538[_0xfa84('0x47')][_0xfa84('0x39')]};if(_0x588538[_0xfa84('0x47')]['MailAccountId']){_0x3ea884[_0xfa84('0x49')]=_0x588538[_0xfa84('0x47')][_0xfa84('0x49')];}else if(_0x588538[_0xfa84('0x47')]['SmsAccountId']){_0x3ea884[_0xfa84('0x4a')]=_0x588538['body'][_0xfa84('0x4a')];}else if(_0x588538[_0xfa84('0x47')]['OpenchannelAccountId']){_0x3ea884['OpenchannelAccountId']=_0x588538[_0xfa84('0x47')]['OpenchannelAccountId'];}else if(_0x588538[_0xfa84('0x47')][_0xfa84('0x4b')]){_0x3ea884[_0xfa84('0x4b')]=_0x588538[_0xfa84('0x47')][_0xfa84('0x4b')];}return db['CannedAnswer'][_0xfa84('0x46')]({'where':_0x3ea884})[_0xfa84('0x20')](function(_0x516c6c){if(_0x516c6c){throw new db[(_0xfa84('0x4c'))][(_0xfa84('0x4d'))](_0xfa84('0x4e'));}return db['CannedAnswer'][_0xfa84('0x48')](_0x588538['body']);})['then'](function(_0x20ab91){var _0x76fc29=_0x588538[_0xfa84('0x4f')][_0xfa84('0x50')]({'plain':!![]});if(!_0x76fc29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x76fc29[_0xfa84('0x51')]===_0xfa84('0x4f')){var _0x50dca7=_0x20ab91['get']({'plain':!![]});return db[_0xfa84('0x52')][_0xfa84('0x46')]({'where':{'name':_0xfa84('0x22'),'userProfileId':_0x76fc29[_0xfa84('0x53')]},'raw':!![]})['then'](function(_0xfd86ea){if(_0xfd86ea&&_0xfd86ea[_0xfa84('0x54')]===0x0){return db[_0xfa84('0x23')][_0xfa84('0x48')]({'name':_0x50dca7[_0xfa84('0x27')],'resourceId':_0x50dca7['id'],'type':_0xfd86ea[_0xfa84('0x27')],'sectionId':_0xfd86ea['id']},{})[_0xfa84('0x20')](function(){return _0x20ab91;});}else{return _0x20ab91;}})[_0xfa84('0x41')](function(_0x2bcea8){logger['error'](_0xfa84('0x55'),_0x2bcea8);throw _0x2bcea8;});}return _0x20ab91;})['then'](respondWithResult(_0x2598b9,0xc9))['catch'](handleError(_0x2598b9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e54ca32..0842201 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 _0x6bbe=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1ef127,_0x16e545){var _0xdeda18=function(_0x46c7fa){while(--_0x46c7fa){_0x1ef127['push'](_0x1ef127['shift']());}};_0xdeda18(++_0x16e545);}(_0x6bbe,0xa2));var _0xe6bb=function(_0x258da2,_0x4f9d31){_0x258da2=_0x258da2-0x0;var _0x1f5ae7=_0x6bbe[_0x258da2];return _0x1f5ae7;};'use strict';var _=require(_0xe6bb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe6bb('0x1'));var moment=require(_0xe6bb('0x2'));var BPromise=require(_0xe6bb('0x3'));var rp=require(_0xe6bb('0x4'));var fs=require('fs');var path=require(_0xe6bb('0x5'));var rimraf=require(_0xe6bb('0x6'));var config=require(_0xe6bb('0x7'));var attributes=require(_0xe6bb('0x8'));module[_0xe6bb('0x9')]=function(_0x35a73e,_0x397aee){return _0x35a73e[_0xe6bb('0xa')](_0xe6bb('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6bb('0xc'),'collate':_0xe6bb('0xd')});}; \ No newline at end of file +var _0x3b05=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger'];(function(_0x28369c,_0x46b207){var _0x16c4f2=function(_0x21accc){while(--_0x21accc){_0x28369c['push'](_0x28369c['shift']());}};_0x16c4f2(++_0x46b207);}(_0x3b05,0x6d));var _0x53b0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3b05[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x53b0('0x0'));var util=require(_0x53b0('0x1'));var logger=require(_0x53b0('0x2'))(_0x53b0('0x3'));var moment=require(_0x53b0('0x4'));var BPromise=require(_0x53b0('0x5'));var rp=require(_0x53b0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53b0('0x7'));var config=require(_0x53b0('0x8'));var attributes=require(_0x53b0('0x9'));module[_0x53b0('0xa')]=function(_0x4c3d29,_0x6217e){return _0x4c3d29['define'](_0x53b0('0xb'),attributes,{'tableName':_0x53b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53b0('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index e8e7c0e..61f3f1a 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 _0x1471=['../../config/logger','../../config/environment','jayson/promise','request','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x1471,0x13a));var _0x1147=function(_0x1df241,_0xa6ce48){_0x1df241=_0x1df241-0x0;var _0x23f596=_0x1471[_0x1df241];return _0x23f596;};'use strict';var _=require(_0x1147('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1147('0x1'));var rs=require(_0x1147('0x2'));var fs=require('fs');var Redis=require(_0x1147('0x3'));var db=require(_0x1147('0x4'))['db'];var utils=require(_0x1147('0x5'));var logger=require(_0x1147('0x6'))('rpc');var config=require(_0x1147('0x7'));var jayson=require(_0x1147('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25ab23,_0x34334f,_0x3a6c7d){return new BPromise(function(_0x18b763,_0x328d33){return client[_0x1147('0x9')](_0x25ab23,_0x3a6c7d)['then'](function(_0x5a0672){logger['info'](_0x1147('0xa'),_0x34334f,_0x1147('0xb'));logger[_0x1147('0xc')](_0x1147('0xd'),_0x34334f,_0x1147('0xb'),JSON[_0x1147('0xe')](_0x5a0672));if(_0x5a0672[_0x1147('0xf')]){if(_0x5a0672['error']['code']===0x1f4){logger[_0x1147('0xf')](_0x1147('0xa'),_0x34334f,_0x5a0672[_0x1147('0xf')][_0x1147('0x10')]);return _0x328d33(_0x5a0672[_0x1147('0xf')][_0x1147('0x10')]);}logger[_0x1147('0xf')](_0x1147('0xa'),_0x34334f,_0x5a0672[_0x1147('0xf')][_0x1147('0x10')]);return _0x18b763(_0x5a0672[_0x1147('0xf')][_0x1147('0x10')]);}else{logger[_0x1147('0x11')](_0x1147('0xa'),_0x34334f,'request\x20sent');_0x18b763(_0x5a0672[_0x1147('0x12')][_0x1147('0x10')]);}})[_0x1147('0x13')](function(_0x1f030e){logger[_0x1147('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x34334f,_0x1f030e);_0x328d33(_0x1f030e);});});} \ No newline at end of file +var _0x4f90=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x4f90,0xd0));var _0x04f9=function(_0x1de4b8,_0x529b41){_0x1de4b8=_0x1de4b8-0x0;var _0x557699=_0x4f90[_0x1de4b8];return _0x557699;};'use strict';var _=require('lodash');var util=require(_0x04f9('0x0'));var moment=require(_0x04f9('0x1'));var BPromise=require(_0x04f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04f9('0x3'));var db=require(_0x04f9('0x4'))['db'];var utils=require(_0x04f9('0x5'));var logger=require(_0x04f9('0x6'))(_0x04f9('0x7'));var config=require(_0x04f9('0x8'));var jayson=require(_0x04f9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43adb7,_0x38caa3,_0x2d211a){return new BPromise(function(_0x187bc7,_0x2dfccb){return client[_0x04f9('0xa')](_0x43adb7,_0x2d211a)[_0x04f9('0xb')](function(_0x3ad491){logger[_0x04f9('0xc')](_0x04f9('0xd'),_0x38caa3,_0x04f9('0xe'));logger['debug'](_0x04f9('0xf'),_0x38caa3,_0x04f9('0xe'),JSON[_0x04f9('0x10')](_0x3ad491));if(_0x3ad491['error']){if(_0x3ad491[_0x04f9('0x11')][_0x04f9('0x12')]===0x1f4){logger['error'](_0x04f9('0xd'),_0x38caa3,_0x3ad491[_0x04f9('0x11')][_0x04f9('0x13')]);return _0x2dfccb(_0x3ad491[_0x04f9('0x11')][_0x04f9('0x13')]);}logger[_0x04f9('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x38caa3,_0x3ad491['error'][_0x04f9('0x13')]);return _0x187bc7(_0x3ad491[_0x04f9('0x11')][_0x04f9('0x13')]);}else{logger['info'](_0x04f9('0xd'),_0x38caa3,_0x04f9('0xe'));_0x187bc7(_0x3ad491['result'][_0x04f9('0x13')]);}})[_0x04f9('0x14')](function(_0x463873){logger[_0x04f9('0x11')](_0x04f9('0xd'),_0x38caa3,_0x463873);_0x2dfccb(_0x463873);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 61cf0d9..19c688a 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 _0x2d83=['post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2d83,0x1ec));var _0x32d8=function(_0xf14981,_0x353c28){_0xf14981=_0xf14981-0x0;var _0x5822e7=_0x2d83[_0xf14981];return _0x5822e7;};'use strict';var multer=require(_0x32d8('0x0'));var util=require('util');var path=require(_0x32d8('0x1'));var timeout=require(_0x32d8('0x2'));var express=require(_0x32d8('0x3'));var router=express[_0x32d8('0x4')]();var auth=require(_0x32d8('0x5'));var interaction=require(_0x32d8('0x6'));var config=require(_0x32d8('0x7'));var controller=require('./cannedAnswer.controller');router[_0x32d8('0x8')]('/',auth[_0x32d8('0x9')](),controller['index']);router[_0x32d8('0x8')](_0x32d8('0xa'),auth['isAuthenticated'](),controller[_0x32d8('0xb')]);router[_0x32d8('0xc')]('/',auth[_0x32d8('0x9')](),controller[_0x32d8('0xd')]);router[_0x32d8('0xe')](_0x32d8('0xa'),auth[_0x32d8('0x9')](),controller[_0x32d8('0xf')]);router[_0x32d8('0x10')](_0x32d8('0xa'),auth[_0x32d8('0x9')](),controller['destroy']);module[_0x32d8('0x11')]=router; \ No newline at end of file +var _0x2a53=['post','create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x2a53,0x1ec));var _0x32a5=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x2a53[_0x26bf51];return _0x503415;};'use strict';var multer=require(_0x32a5('0x0'));var util=require('util');var path=require(_0x32a5('0x1'));var timeout=require(_0x32a5('0x2'));var express=require(_0x32a5('0x3'));var router=express[_0x32a5('0x4')]();var auth=require(_0x32a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32a5('0x6'));var controller=require(_0x32a5('0x7'));router['get']('/',auth[_0x32a5('0x8')](),controller[_0x32a5('0x9')]);router[_0x32a5('0xa')]('/:id',auth[_0x32a5('0x8')](),controller[_0x32a5('0xb')]);router[_0x32a5('0xc')]('/',auth['isAuthenticated'](),controller[_0x32a5('0xd')]);router['put'](_0x32a5('0xe'),auth[_0x32a5('0x8')](),controller[_0x32a5('0xf')]);router[_0x32a5('0x10')](_0x32a5('0xe'),auth[_0x32a5('0x8')](),controller['destroy']);module[_0x32a5('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index e0f6ecd..5378fde 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 _0x7bfd=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x7bfd,0x8b));var _0xd7bf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7bfd[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd7bf('0x0'));module[_0xd7bf('0x1')]={'calldate':{'type':Sequelize[_0xd7bf('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd7bf('0x3')]},'dst':{'type':Sequelize[_0xd7bf('0x3')]},'dcontext':{'type':Sequelize[_0xd7bf('0x3')]},'channel':{'type':Sequelize[_0xd7bf('0x3')]},'dstchannel':{'type':Sequelize[_0xd7bf('0x3')]},'lastapp':{'type':Sequelize[_0xd7bf('0x3')]},'lastdata':{'type':Sequelize[_0xd7bf('0x3')]},'duration':{'type':Sequelize[_0xd7bf('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd7bf('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd7bf('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd7bf('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd7bf('0x3')]},'linkedid':{'type':Sequelize[_0xd7bf('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xd7bf('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd7bf('0x3')]}}; \ No newline at end of file +var _0x0185=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x44561c,_0x2f5b9f){var _0x162810=function(_0x2d9380){while(--_0x2d9380){_0x44561c['push'](_0x44561c['shift']());}};_0x162810(++_0x2f5b9f);}(_0x0185,0x198));var _0x5018=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x0185[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x5018('0x0'));module[_0x5018('0x1')]={'calldate':{'type':Sequelize[_0x5018('0x2')],'allowNull':![],'defaultValue':_0x5018('0x3')},'clid':{'type':Sequelize[_0x5018('0x4')]},'src':{'type':Sequelize[_0x5018('0x4')]},'dst':{'type':Sequelize[_0x5018('0x4')]},'dcontext':{'type':Sequelize[_0x5018('0x4')]},'channel':{'type':Sequelize[_0x5018('0x4')]},'dstchannel':{'type':Sequelize[_0x5018('0x4')]},'lastapp':{'type':Sequelize[_0x5018('0x4')]},'lastdata':{'type':Sequelize[_0x5018('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5018('0x4')]},'amaflags':{'type':Sequelize[_0x5018('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5018('0x4')]},'userfield':{'type':Sequelize[_0x5018('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5018('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5018('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3ad85db..271b356 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 _0xfbd7=['ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Cdr','then','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x435071,_0x38a694){var _0x50d869=function(_0x14e6fa){while(--_0x14e6fa){_0x435071['push'](_0x435071['shift']());}};_0x50d869(++_0x38a694);}(_0xfbd7,0xcb));var _0x7fbd=function(_0x16eb13,_0x3d592f){_0x16eb13=_0x16eb13-0x0;var _0x2b6230=_0xfbd7[_0x16eb13];return _0x2b6230;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7fbd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7fbd('0x1'));var moment=require(_0x7fbd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7fbd('0x3'));var util=require(_0x7fbd('0x4'));var path=require('path');var sox=require(_0x7fbd('0x5'));var csv=require(_0x7fbd('0x6'));var ejs=require(_0x7fbd('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7fbd('0x8'));var crypto=require('crypto');var jsforce=require(_0x7fbd('0x9'));var deskjs=require(_0x7fbd('0xa'));var toCsv=require(_0x7fbd('0x6'));var querystring=require(_0x7fbd('0xb'));var Papa=require(_0x7fbd('0xc'));var Redis=require(_0x7fbd('0xd'));var authService=require(_0x7fbd('0xe'));var qs=require(_0x7fbd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7fbd('0x10'));var utils=require(_0x7fbd('0x11'));var config=require(_0x7fbd('0x12'));var db=require(_0x7fbd('0x13'))['db'];function respondWithStatusCode(_0x26ce17,_0xb012b2){_0xb012b2=_0xb012b2||0xcc;return function(_0x3570ad){if(_0x3570ad){return _0x26ce17['sendStatus'](_0xb012b2);}return _0x26ce17[_0x7fbd('0x14')](_0xb012b2)['end']();};}function respondWithResult(_0x2eacd8,_0x4b9011){_0x4b9011=_0x4b9011||0xc8;return function(_0x5b4cff){if(_0x5b4cff){return _0x2eacd8[_0x7fbd('0x14')](_0x4b9011)[_0x7fbd('0x15')](_0x5b4cff);}};}function respondWithFilteredResult(_0x41e9d6,_0x48bea8){return function(_0x1679e0){if(_0x1679e0){var _0x389fe1=_0x1679e0[_0x7fbd('0x16')],_0x43480b=_0x48bea8[_0x7fbd('0x17')],_0x154c4d=_0x48bea8[_0x7fbd('0x17')]+_0x48bea8[_0x7fbd('0x18')],_0x327891;if(_0x154c4d>=_0x389fe1){_0x154c4d=_0x389fe1;_0x327891=0xc8;}else{_0x327891=0xce;}_0x41e9d6[_0x7fbd('0x14')](_0x327891);return _0x41e9d6[_0x7fbd('0x19')](_0x7fbd('0x1a'),_0x43480b+'-'+_0x154c4d+'/'+_0x389fe1)['json'](_0x1679e0);}return null;};}function patchUpdates(_0x210928){return function(_0x3188eb){try{jsonpatch[_0x7fbd('0x1b')](_0x3188eb,_0x210928,!![]);}catch(_0xe1a0af){return BPromise[_0x7fbd('0x1c')](_0xe1a0af);}return _0x3188eb['save']();};}function saveUpdates(_0x3c0e25,_0x14afd4){return function(_0x680d7){if(_0x680d7){return _0x680d7[_0x7fbd('0x1d')](_0x3c0e25)['then'](function(_0x297a24){return _0x297a24;});}return null;};}function removeEntity(_0x43861f,_0x651e16){return function(_0x3ba2b8){if(_0x3ba2b8){return _0x3ba2b8[_0x7fbd('0x1e')]()['then'](function(){_0x43861f[_0x7fbd('0x14')](0xcc)[_0x7fbd('0x1f')]();});}};}function handleEntityNotFound(_0x44a912,_0x247d02){return function(_0x480326){if(!_0x480326){_0x44a912[_0x7fbd('0x20')](0x194);}return _0x480326;};}function handleError(_0x5ba7e5,_0x5632af){_0x5632af=_0x5632af||0x1f4;return function(_0x3d31a0){logger[_0x7fbd('0x21')](_0x3d31a0[_0x7fbd('0x22')]);if(_0x3d31a0[_0x7fbd('0x23')]){delete _0x3d31a0[_0x7fbd('0x23')];}_0x5ba7e5[_0x7fbd('0x14')](_0x5632af)[_0x7fbd('0x24')](_0x3d31a0);};}exports[_0x7fbd('0x25')]=function(_0x4b4f10,_0x2e702f){var _0x4e21fe={},_0x187769={},_0x438527={'count':0x0,'rows':[]};var _0x588299=db['Cdr'][_0x7fbd('0x26')];_0x187769[_0x7fbd('0x27')]=_[_0x7fbd('0x28')](_0x588299);_0x187769[_0x7fbd('0x29')]=_['keys'](_0x4b4f10['query']);_0x187769[_0x7fbd('0x2a')]=_[_0x7fbd('0x2b')](_0x187769['model'],_0x187769[_0x7fbd('0x29')]);_0x4e21fe[_0x7fbd('0x2c')]=_[_0x7fbd('0x2b')](_0x187769[_0x7fbd('0x27')],qs[_0x7fbd('0x2d')](_0x4b4f10[_0x7fbd('0x29')]['fields']));_0x4e21fe[_0x7fbd('0x2c')]=_0x4e21fe[_0x7fbd('0x2c')][_0x7fbd('0x2e')]?_0x4e21fe[_0x7fbd('0x2c')]:_0x187769[_0x7fbd('0x27')];if(!_0x4b4f10[_0x7fbd('0x29')][_0x7fbd('0x2f')](_0x7fbd('0x30'))){_0x4e21fe['limit']=qs['limit'](_0x4b4f10[_0x7fbd('0x29')][_0x7fbd('0x18')]);_0x4e21fe[_0x7fbd('0x17')]=qs['offset'](_0x4b4f10['query'][_0x7fbd('0x17')]);}_0x4e21fe['order']=qs[_0x7fbd('0x31')](_0x4b4f10[_0x7fbd('0x29')][_0x7fbd('0x31')]);_0x4e21fe[_0x7fbd('0x32')]=qs[_0x7fbd('0x2a')](_['pick'](_0x4b4f10[_0x7fbd('0x29')],_0x187769[_0x7fbd('0x2a')]));if(_0x4b4f10[_0x7fbd('0x29')][_0x7fbd('0x33')]){_0x4e21fe[_0x7fbd('0x32')]=_[_0x7fbd('0x34')](_0x4e21fe['where'],{'$or':_[_0x7fbd('0x35')](_0x588299,function(_0x14b7ef){if(_0x14b7ef[_0x7fbd('0x36')][_0x7fbd('0x37')]!==_0x7fbd('0x38')){var _0x4a5839={};_0x4a5839[_0x14b7ef[_0x7fbd('0x39')]]={'$like':'%'+_0x4b4f10['query']['filter']+'%'};return _0x4a5839;}})});}_0x4e21fe=_[_0x7fbd('0x34')]({},_0x4e21fe,_0x4b4f10[_0x7fbd('0x3a')]);var _0x2dbbd5={'where':_0x4e21fe[_0x7fbd('0x32')]};return db[_0x7fbd('0x3b')][_0x7fbd('0x16')](_0x2dbbd5)[_0x7fbd('0x3c')](function(_0x3c0607){_0x438527['count']=_0x3c0607;if(_0x4b4f10[_0x7fbd('0x29')][_0x7fbd('0x3d')]){_0x4e21fe['include']=[{'all':!![]}];}return db[_0x7fbd('0x3b')][_0x7fbd('0x3e')](_0x4e21fe);})[_0x7fbd('0x3c')](function(_0x5f081a){_0x438527[_0x7fbd('0x3f')]=_0x5f081a;return _0x438527;})[_0x7fbd('0x3c')](respondWithFilteredResult(_0x2e702f,_0x4e21fe))['catch'](handleError(_0x2e702f,null));};exports[_0x7fbd('0x40')]=function(_0x4fb60c,_0x353bdb){var _0xf3050={'raw':!![],'where':{'id':_0x4fb60c[_0x7fbd('0x41')]['id']}},_0x5a192b={};_0x5a192b[_0x7fbd('0x27')]=_[_0x7fbd('0x28')](db[_0x7fbd('0x3b')]['rawAttributes']);_0x5a192b['query']=_['keys'](_0x4fb60c['query']);_0x5a192b[_0x7fbd('0x2a')]=_[_0x7fbd('0x2b')](_0x5a192b[_0x7fbd('0x27')],_0x5a192b['query']);_0xf3050[_0x7fbd('0x2c')]=_[_0x7fbd('0x2b')](_0x5a192b[_0x7fbd('0x27')],qs[_0x7fbd('0x2d')](_0x4fb60c[_0x7fbd('0x29')]['fields']));_0xf3050['attributes']=_0xf3050['attributes'][_0x7fbd('0x2e')]?_0xf3050[_0x7fbd('0x2c')]:_0x5a192b[_0x7fbd('0x27')];if(_0x4fb60c[_0x7fbd('0x29')][_0x7fbd('0x3d')]){_0xf3050[_0x7fbd('0x42')]=[{'all':!![]}];}_0xf3050=_[_0x7fbd('0x34')]({},_0xf3050,_0x4fb60c[_0x7fbd('0x3a')]);return db[_0x7fbd('0x3b')][_0x7fbd('0x43')](_0xf3050)[_0x7fbd('0x3c')](handleEntityNotFound(_0x353bdb,null))[_0x7fbd('0x3c')](respondWithResult(_0x353bdb,null))[_0x7fbd('0x44')](handleError(_0x353bdb,null));};exports[_0x7fbd('0x45')]=function(_0x479fbb,_0x1d15de){return db[_0x7fbd('0x3b')][_0x7fbd('0x45')](_0x479fbb[_0x7fbd('0x46')],{})[_0x7fbd('0x3c')](respondWithResult(_0x1d15de,0xc9))['catch'](handleError(_0x1d15de,null));};exports[_0x7fbd('0x1d')]=function(_0x15e991,_0x1d3cdb){if(_0x15e991['body']['id']){delete _0x15e991[_0x7fbd('0x46')]['id'];}return db[_0x7fbd('0x3b')][_0x7fbd('0x43')]({'where':{'id':_0x15e991[_0x7fbd('0x41')]['id']}})[_0x7fbd('0x3c')](handleEntityNotFound(_0x1d3cdb,null))['then'](saveUpdates(_0x15e991[_0x7fbd('0x46')],null))[_0x7fbd('0x3c')](respondWithResult(_0x1d3cdb,null))[_0x7fbd('0x44')](handleError(_0x1d3cdb,null));};exports[_0x7fbd('0x1e')]=function(_0x1a2487,_0x44336c){return db['Cdr']['find']({'where':{'id':_0x1a2487['params']['id']}})[_0x7fbd('0x3c')](handleEntityNotFound(_0x44336c,null))[_0x7fbd('0x3c')](removeEntity(_0x44336c,null))['catch'](handleError(_0x44336c,null));};exports[_0x7fbd('0x47')]=function(_0x1cf8c6,_0x31be86){return db[_0x7fbd('0x3b')][_0x7fbd('0x47')]()[_0x7fbd('0x3c')](respondWithResult(_0x31be86,null))[_0x7fbd('0x44')](handleError(_0x31be86,null));}; \ No newline at end of file +var _0xbdce=['../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','index','Cdr','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','update','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0xbe9336,_0x1f51b5){var _0x9292b7=function(_0x26bdf1){while(--_0x26bdf1){_0xbe9336['push'](_0xbe9336['shift']());}};_0x9292b7(++_0x1f51b5);}(_0xbdce,0x116));var _0xebdc=function(_0x840016,_0x3325c6){_0x840016=_0x840016-0x0;var _0x34ba16=_0xbdce[_0x840016];return _0x34ba16;};'use strict';var pdf=require(_0xebdc('0x0'));var emlformat=require(_0xebdc('0x1'));var rimraf=require(_0xebdc('0x2'));var zipdir=require(_0xebdc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xebdc('0x4'));var BPromise=require(_0xebdc('0x5'));var Mustache=require(_0xebdc('0x6'));var util=require(_0xebdc('0x7'));var path=require(_0xebdc('0x8'));var sox=require(_0xebdc('0x9'));var csv=require(_0xebdc('0xa'));var ejs=require(_0xebdc('0xb'));var fs=require('fs');var _=require(_0xebdc('0xc'));var squel=require(_0xebdc('0xd'));var crypto=require(_0xebdc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xebdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xebdc('0x10'));var Papa=require('papaparse');var Redis=require(_0xebdc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebdc('0x12'));var logger=require(_0xebdc('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xebdc('0x14'));var db=require(_0xebdc('0x15'))['db'];function respondWithStatusCode(_0x35fcee,_0x167332){_0x167332=_0x167332||0xcc;return function(_0x5d436f){if(_0x5d436f){return _0x35fcee[_0xebdc('0x16')](_0x167332);}return _0x35fcee[_0xebdc('0x17')](_0x167332)[_0xebdc('0x18')]();};}function respondWithResult(_0x396fe3,_0x185e88){_0x185e88=_0x185e88||0xc8;return function(_0x5a3e9d){if(_0x5a3e9d){return _0x396fe3[_0xebdc('0x17')](_0x185e88)[_0xebdc('0x19')](_0x5a3e9d);}};}function respondWithFilteredResult(_0x527dc4,_0x1ad136){return function(_0x461508){if(_0x461508){var _0x4cd035=_0x461508[_0xebdc('0x1a')],_0x3d5dfc=_0x1ad136[_0xebdc('0x1b')],_0x59f18d=_0x1ad136[_0xebdc('0x1b')]+_0x1ad136['limit'],_0x2a6f2a;if(_0x59f18d>=_0x4cd035){_0x59f18d=_0x4cd035;_0x2a6f2a=0xc8;}else{_0x2a6f2a=0xce;}_0x527dc4[_0xebdc('0x17')](_0x2a6f2a);return _0x527dc4[_0xebdc('0x1c')](_0xebdc('0x1d'),_0x3d5dfc+'-'+_0x59f18d+'/'+_0x4cd035)[_0xebdc('0x19')](_0x461508);}return null;};}function patchUpdates(_0x480241){return function(_0x151086){try{jsonpatch[_0xebdc('0x1e')](_0x151086,_0x480241,!![]);}catch(_0x248c53){return BPromise['reject'](_0x248c53);}return _0x151086[_0xebdc('0x1f')]();};}function saveUpdates(_0x5f458a,_0x1e5af6){return function(_0x44950d){if(_0x44950d){return _0x44950d['update'](_0x5f458a)[_0xebdc('0x20')](function(_0x1dece0){return _0x1dece0;});}return null;};}function removeEntity(_0x264672,_0x13a5a8){return function(_0x291216){if(_0x291216){return _0x291216[_0xebdc('0x21')]()[_0xebdc('0x20')](function(){_0x264672[_0xebdc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x395f8e,_0x412f38){return function(_0x3aedcb){if(!_0x3aedcb){_0x395f8e[_0xebdc('0x16')](0x194);}return _0x3aedcb;};}function handleError(_0x4d3dab,_0x2d3508){_0x2d3508=_0x2d3508||0x1f4;return function(_0x335e03){logger[_0xebdc('0x22')](_0x335e03[_0xebdc('0x23')]);if(_0x335e03[_0xebdc('0x24')]){delete _0x335e03['name'];}_0x4d3dab[_0xebdc('0x17')](_0x2d3508)['send'](_0x335e03);};}exports[_0xebdc('0x25')]=function(_0x4c9f1d,_0x29d51d){var _0x70ef01={},_0x5ae04c={},_0x1a4739={'count':0x0,'rows':[]};var _0x1241c4=db[_0xebdc('0x26')][_0xebdc('0x27')];_0x5ae04c[_0xebdc('0x28')]=_[_0xebdc('0x29')](_0x1241c4);_0x5ae04c[_0xebdc('0x2a')]=_[_0xebdc('0x29')](_0x4c9f1d['query']);_0x5ae04c[_0xebdc('0x2b')]=_[_0xebdc('0x2c')](_0x5ae04c[_0xebdc('0x28')],_0x5ae04c[_0xebdc('0x2a')]);_0x70ef01[_0xebdc('0x2d')]=_[_0xebdc('0x2c')](_0x5ae04c[_0xebdc('0x28')],qs[_0xebdc('0x2e')](_0x4c9f1d[_0xebdc('0x2a')]['fields']));_0x70ef01['attributes']=_0x70ef01[_0xebdc('0x2d')][_0xebdc('0x2f')]?_0x70ef01[_0xebdc('0x2d')]:_0x5ae04c['model'];if(!_0x4c9f1d[_0xebdc('0x2a')][_0xebdc('0x30')](_0xebdc('0x31'))){_0x70ef01['limit']=qs[_0xebdc('0x32')](_0x4c9f1d[_0xebdc('0x2a')][_0xebdc('0x32')]);_0x70ef01['offset']=qs[_0xebdc('0x1b')](_0x4c9f1d['query']['offset']);}_0x70ef01[_0xebdc('0x33')]=qs[_0xebdc('0x34')](_0x4c9f1d[_0xebdc('0x2a')][_0xebdc('0x34')]);_0x70ef01[_0xebdc('0x35')]=qs[_0xebdc('0x2b')](_[_0xebdc('0x36')](_0x4c9f1d[_0xebdc('0x2a')],_0x5ae04c['filters']));if(_0x4c9f1d[_0xebdc('0x2a')][_0xebdc('0x37')]){_0x70ef01[_0xebdc('0x35')]=_[_0xebdc('0x38')](_0x70ef01['where'],{'$or':_[_0xebdc('0x39')](_0x1241c4,function(_0x53509d){if(_0x53509d['type'][_0xebdc('0x3a')]!==_0xebdc('0x3b')){var _0x5a1ba3={};_0x5a1ba3[_0x53509d[_0xebdc('0x3c')]]={'$like':'%'+_0x4c9f1d[_0xebdc('0x2a')][_0xebdc('0x37')]+'%'};return _0x5a1ba3;}})});}_0x70ef01=_['merge']({},_0x70ef01,_0x4c9f1d[_0xebdc('0x3d')]);var _0x1a572b={'where':_0x70ef01['where']};return db[_0xebdc('0x26')][_0xebdc('0x1a')](_0x1a572b)[_0xebdc('0x20')](function(_0xef3574){_0x1a4739[_0xebdc('0x1a')]=_0xef3574;if(_0x4c9f1d[_0xebdc('0x2a')]['includeAll']){_0x70ef01[_0xebdc('0x3e')]=[{'all':!![]}];}return db[_0xebdc('0x26')][_0xebdc('0x3f')](_0x70ef01);})[_0xebdc('0x20')](function(_0x2da052){_0x1a4739[_0xebdc('0x40')]=_0x2da052;return _0x1a4739;})[_0xebdc('0x20')](respondWithFilteredResult(_0x29d51d,_0x70ef01))['catch'](handleError(_0x29d51d,null));};exports[_0xebdc('0x41')]=function(_0x191bc8,_0x406ffd){var _0x118b49={'raw':!![],'where':{'id':_0x191bc8[_0xebdc('0x42')]['id']}},_0x3c1efd={};_0x3c1efd[_0xebdc('0x28')]=_[_0xebdc('0x29')](db[_0xebdc('0x26')]['rawAttributes']);_0x3c1efd[_0xebdc('0x2a')]=_['keys'](_0x191bc8[_0xebdc('0x2a')]);_0x3c1efd[_0xebdc('0x2b')]=_['intersection'](_0x3c1efd['model'],_0x3c1efd[_0xebdc('0x2a')]);_0x118b49[_0xebdc('0x2d')]=_[_0xebdc('0x2c')](_0x3c1efd[_0xebdc('0x28')],qs['fields'](_0x191bc8[_0xebdc('0x2a')][_0xebdc('0x2e')]));_0x118b49[_0xebdc('0x2d')]=_0x118b49[_0xebdc('0x2d')][_0xebdc('0x2f')]?_0x118b49['attributes']:_0x3c1efd[_0xebdc('0x28')];if(_0x191bc8[_0xebdc('0x2a')][_0xebdc('0x43')]){_0x118b49['include']=[{'all':!![]}];}_0x118b49=_['merge']({},_0x118b49,_0x191bc8[_0xebdc('0x3d')]);return db[_0xebdc('0x26')][_0xebdc('0x44')](_0x118b49)[_0xebdc('0x20')](handleEntityNotFound(_0x406ffd,null))['then'](respondWithResult(_0x406ffd,null))['catch'](handleError(_0x406ffd,null));};exports[_0xebdc('0x45')]=function(_0x566801,_0x5ef195){return db[_0xebdc('0x26')][_0xebdc('0x45')](_0x566801[_0xebdc('0x46')],{})[_0xebdc('0x20')](respondWithResult(_0x5ef195,0xc9))[_0xebdc('0x47')](handleError(_0x5ef195,null));};exports[_0xebdc('0x48')]=function(_0x2a2e1c,_0x5951e1){if(_0x2a2e1c[_0xebdc('0x46')]['id']){delete _0x2a2e1c[_0xebdc('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2a2e1c['params']['id']}})[_0xebdc('0x20')](handleEntityNotFound(_0x5951e1,null))[_0xebdc('0x20')](saveUpdates(_0x2a2e1c[_0xebdc('0x46')],null))['then'](respondWithResult(_0x5951e1,null))[_0xebdc('0x47')](handleError(_0x5951e1,null));};exports['destroy']=function(_0x5a6edc,_0xda1646){return db[_0xebdc('0x26')][_0xebdc('0x44')]({'where':{'id':_0x5a6edc['params']['id']}})['then'](handleEntityNotFound(_0xda1646,null))[_0xebdc('0x20')](removeEntity(_0xda1646,null))[_0xebdc('0x47')](handleError(_0xda1646,null));};exports['describe']=function(_0xfef2fa,_0x279f2a){return db['Cdr'][_0xebdc('0x49')]()[_0xebdc('0x20')](respondWithResult(_0x279f2a,null))['catch'](handleError(_0x279f2a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 59263c4..7247ba8 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 _0x8d1d=['rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition','dst','src','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x60749d,_0x255910){var _0xbb0238=function(_0x2cd8f4){while(--_0x2cd8f4){_0x60749d['push'](_0x60749d['shift']());}};_0xbb0238(++_0x255910);}(_0x8d1d,0x82));var _0xd8d1=function(_0x490b55,_0x4b5173){_0x490b55=_0x490b55-0x0;var _0x749559=_0x8d1d[_0x490b55];return _0x749559;};'use strict';var _=require(_0xd8d1('0x0'));var util=require('util');var logger=require(_0xd8d1('0x1'))(_0xd8d1('0x2'));var moment=require(_0xd8d1('0x3'));var BPromise=require(_0xd8d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8d1('0x5'));var rimraf=require(_0xd8d1('0x6'));var config=require(_0xd8d1('0x7'));var attributes=require(_0xd8d1('0x8'));module[_0xd8d1('0x9')]=function(_0x141db8,_0x331ea9){return _0x141db8[_0xd8d1('0xa')](_0xd8d1('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xd8d1('0xc'),'fields':[_0xd8d1('0xc')]},{'name':_0xd8d1('0xd'),'fields':[_0xd8d1('0xd')]},{'name':'disposition','fields':[_0xd8d1('0xe')]},{'name':'dst','fields':[_0xd8d1('0xf')]},{'name':_0xd8d1('0x10'),'fields':['src']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file +var _0xa20d=['./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','uniqueid','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2e9509,_0x63ce26){var _0x5aea1d=function(_0x13f72d){while(--_0x13f72d){_0x2e9509['push'](_0x2e9509['shift']());}};_0x5aea1d(++_0x63ce26);}(_0xa20d,0x172));var _0xda20=function(_0x546a0a,_0x462af9){_0x546a0a=_0x546a0a-0x0;var _0x352311=_0xa20d[_0x546a0a];return _0x352311;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xda20('0x0'));var BPromise=require(_0xda20('0x1'));var rp=require(_0xda20('0x2'));var fs=require('fs');var path=require(_0xda20('0x3'));var rimraf=require('rimraf');var config=require(_0xda20('0x4'));var attributes=require(_0xda20('0x5'));module[_0xda20('0x6')]=function(_0x62ea02,_0x4407be){return _0x62ea02[_0xda20('0x7')](_0xda20('0x8'),attributes,{'tableName':_0xda20('0x9'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0xda20('0xa')]},{'name':_0xda20('0xb'),'fields':[_0xda20('0xb')]},{'name':_0xda20('0xc'),'fields':[_0xda20('0xc')]},{'name':_0xda20('0xd'),'fields':[_0xda20('0xd')]},{'name':'src','fields':['src']},{'name':'uniqueid','fields':[_0xda20('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index daebc2f..33f2f79 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 _0x3b2d=['code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4291a2,_0x2ee2e5){var _0x235817=function(_0x23b06d){while(--_0x23b06d){_0x4291a2['push'](_0x4291a2['shift']());}};_0x235817(++_0x2ee2e5);}(_0x3b2d,0xac));var _0xd3b2=function(_0x5976a1,_0x537bac){_0x5976a1=_0x5976a1-0x0;var _0x48f162=_0x3b2d[_0x5976a1];return _0x48f162;};'use strict';var _=require(_0xd3b2('0x0'));var util=require(_0xd3b2('0x1'));var moment=require(_0xd3b2('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3b2('0x3'));var fs=require('fs');var Redis=require(_0xd3b2('0x4'));var db=require(_0xd3b2('0x5'))['db'];var utils=require(_0xd3b2('0x6'));var logger=require(_0xd3b2('0x7'))(_0xd3b2('0x8'));var config=require('../../config/environment');var jayson=require(_0xd3b2('0x9'));var client=jayson[_0xd3b2('0xa')][_0xd3b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb7799d,_0x54f017,_0x907621){return new BPromise(function(_0x164f5b,_0x5a374c){return client[_0xd3b2('0xc')](_0xb7799d,_0x907621)[_0xd3b2('0xd')](function(_0xc83bd4){logger['info'](_0xd3b2('0xe'),_0x54f017,_0xd3b2('0xf'));logger[_0xd3b2('0x10')](_0xd3b2('0x11'),_0x54f017,_0xd3b2('0xf'),JSON[_0xd3b2('0x12')](_0xc83bd4));if(_0xc83bd4[_0xd3b2('0x13')]){if(_0xc83bd4['error'][_0xd3b2('0x14')]===0x1f4){logger[_0xd3b2('0x13')]('Cdr,\x20%s,\x20%s',_0x54f017,_0xc83bd4[_0xd3b2('0x13')][_0xd3b2('0x15')]);return _0x5a374c(_0xc83bd4[_0xd3b2('0x13')][_0xd3b2('0x15')]);}logger[_0xd3b2('0x13')]('Cdr,\x20%s,\x20%s',_0x54f017,_0xc83bd4[_0xd3b2('0x13')][_0xd3b2('0x15')]);return _0x164f5b(_0xc83bd4['error']['message']);}else{logger[_0xd3b2('0x16')]('Cdr,\x20%s,\x20%s',_0x54f017,'request\x20sent');_0x164f5b(_0xc83bd4['result'][_0xd3b2('0x15')]);}})[_0xd3b2('0x17')](function(_0x167f4c){logger[_0xd3b2('0x13')](_0xd3b2('0xe'),_0x54f017,_0x167f4c);_0x5a374c(_0x167f4c);});});} \ No newline at end of file +var _0xc90e=['http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bc38a,_0x5d8e2f){var _0xec7807=function(_0x2857a2){while(--_0x2857a2){_0x4bc38a['push'](_0x4bc38a['shift']());}};_0xec7807(++_0x5d8e2f);}(_0xc90e,0xe8));var _0xec90=function(_0x52ff5e,_0x306501){_0x52ff5e=_0x52ff5e-0x0;var _0x4087ce=_0xc90e[_0x52ff5e];return _0x4087ce;};'use strict';var _=require(_0xec90('0x0'));var util=require(_0xec90('0x1'));var moment=require('moment');var BPromise=require(_0xec90('0x2'));var rs=require(_0xec90('0x3'));var fs=require('fs');var Redis=require(_0xec90('0x4'));var db=require(_0xec90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec90('0x6'));var config=require(_0xec90('0x7'));var jayson=require(_0xec90('0x8'));var client=jayson[_0xec90('0x9')][_0xec90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x386499,_0x22fa4e,_0x42a5f8){return new BPromise(function(_0x283367,_0x461ef6){return client[_0xec90('0xb')](_0x386499,_0x42a5f8)[_0xec90('0xc')](function(_0x3d8eb2){logger[_0xec90('0xd')](_0xec90('0xe'),_0x22fa4e,_0xec90('0xf'));logger[_0xec90('0x10')](_0xec90('0x11'),_0x22fa4e,_0xec90('0xf'),JSON[_0xec90('0x12')](_0x3d8eb2));if(_0x3d8eb2[_0xec90('0x13')]){if(_0x3d8eb2[_0xec90('0x13')][_0xec90('0x14')]===0x1f4){logger[_0xec90('0x13')](_0xec90('0xe'),_0x22fa4e,_0x3d8eb2[_0xec90('0x13')][_0xec90('0x15')]);return _0x461ef6(_0x3d8eb2[_0xec90('0x13')][_0xec90('0x15')]);}logger[_0xec90('0x13')](_0xec90('0xe'),_0x22fa4e,_0x3d8eb2[_0xec90('0x13')]['message']);return _0x283367(_0x3d8eb2['error'][_0xec90('0x15')]);}else{logger['info'](_0xec90('0xe'),_0x22fa4e,_0xec90('0xf'));_0x283367(_0x3d8eb2['result']['message']);}})['catch'](function(_0x20cd3e){logger[_0xec90('0x13')](_0xec90('0xe'),_0x22fa4e,_0x20cd3e);_0x461ef6(_0x20cd3e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 48cb441..3619550 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 _0x5137=['show','put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','describe','/:id'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5137,0x1e5));var _0x7513=function(_0x2fcd0c,_0xe4db7d){_0x2fcd0c=_0x2fcd0c-0x0;var _0x18230c=_0x5137[_0x2fcd0c];return _0x18230c;};'use strict';var multer=require(_0x7513('0x0'));var util=require(_0x7513('0x1'));var path=require(_0x7513('0x2'));var timeout=require('connect-timeout');var express=require(_0x7513('0x3'));var router=express['Router']();var auth=require(_0x7513('0x4'));var interaction=require(_0x7513('0x5'));var config=require('../../config/environment');var controller=require(_0x7513('0x6'));router[_0x7513('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7513('0x7')]('/describe',auth[_0x7513('0x8')](),controller[_0x7513('0x9')]);router[_0x7513('0x7')](_0x7513('0xa'),auth['isAuthenticated'](),controller[_0x7513('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7513('0xc')](_0x7513('0xa'),auth[_0x7513('0x8')](),controller['update']);router[_0x7513('0xd')](_0x7513('0xa'),auth['isAuthenticated'](),controller[_0x7513('0xe')]);module[_0x7513('0xf')]=router; \ No newline at end of file +var _0xfb9e=['/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x2092cd,_0x8b7f1c){var _0x5ae30e=function(_0x52161f){while(--_0x52161f){_0x2092cd['push'](_0x2092cd['shift']());}};_0x5ae30e(++_0x8b7f1c);}(_0xfb9e,0x1d5));var _0xefb9=function(_0x1fddfd,_0x153a74){_0x1fddfd=_0x1fddfd-0x0;var _0x595b32=_0xfb9e[_0x1fddfd];return _0x595b32;};'use strict';var multer=require(_0xefb9('0x0'));var util=require(_0xefb9('0x1'));var path=require(_0xefb9('0x2'));var timeout=require(_0xefb9('0x3'));var express=require(_0xefb9('0x4'));var router=express['Router']();var auth=require(_0xefb9('0x5'));var interaction=require(_0xefb9('0x6'));var config=require(_0xefb9('0x7'));var controller=require('./cdr.controller');router['get']('/',auth[_0xefb9('0x8')](),controller[_0xefb9('0x9')]);router[_0xefb9('0xa')](_0xefb9('0xb'),auth['isAuthenticated'](),controller[_0xefb9('0xc')]);router['get'](_0xefb9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xefb9('0xe')]('/',auth[_0xefb9('0x8')](),controller[_0xefb9('0xf')]);router['put'](_0xefb9('0xd'),auth['isAuthenticated'](),controller[_0xefb9('0x10')]);router[_0xefb9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xefb9('0x12')]);module[_0xefb9('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e8ce467..9afc49e 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 _0x80e0=['*,*,*,*','INTEGER','STRING','noop'];(function(_0x136a04,_0x370ad0){var _0x2b6528=function(_0x4a3198){while(--_0x4a3198){_0x136a04['push'](_0x136a04['shift']());}};_0x2b6528(++_0x370ad0);}(_0x80e0,0x9d));var _0x080e=function(_0x448e3c,_0x1cb522){_0x448e3c=_0x448e3c-0x0;var _0x134c91=_0x80e0[_0x448e3c];return _0x134c91;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x080e('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x080e('0x1')],'allowNull':![],'defaultValue':_0x080e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x080e('0x1')]},'interval':{'type':Sequelize[_0x080e('0x1')],'defaultValue':_0x080e('0x3')}}; \ No newline at end of file +var _0x7c7f=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x7c7f,0x163));var _0xf7c7=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x7c7f[_0x4ab3fb];return _0x34fe1e;};'use strict';var Sequelize=require(_0xf7c7('0x0'));module[_0xf7c7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf7c7('0x2')},'appdata':{'type':Sequelize[_0xf7c7('0x3')]()},'description':{'type':Sequelize[_0xf7c7('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf7c7('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 6ea5978..e138120 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 _0x9081=['limit','set','Content-Range','apply','reject','then','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','catch','update','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2a6992,_0x2958af){var _0x1db8fb=function(_0x3a5164){while(--_0x3a5164){_0x2a6992['push'](_0x2a6992['shift']());}};_0x1db8fb(++_0x2958af);}(_0x9081,0xfc));var _0x1908=function(_0x58b1ca,_0x4475ee){_0x58b1ca=_0x58b1ca-0x0;var _0x38ae29=_0x9081[_0x58b1ca];return _0x38ae29;};'use strict';var pdf=require(_0x1908('0x0'));var emlformat=require(_0x1908('0x1'));var rimraf=require(_0x1908('0x2'));var zipdir=require(_0x1908('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1908('0x4'));var moment=require(_0x1908('0x5'));var BPromise=require(_0x1908('0x6'));var Mustache=require(_0x1908('0x7'));var util=require(_0x1908('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1908('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1908('0xa'));var squel=require('squel');var crypto=require(_0x1908('0xb'));var jsforce=require(_0x1908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1908('0x9'));var querystring=require(_0x1908('0xd'));var Papa=require(_0x1908('0xe'));var Redis=require(_0x1908('0xf'));var authService=require(_0x1908('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1908('0x11'));var logger=require(_0x1908('0x12'))(_0x1908('0x13'));var utils=require(_0x1908('0x14'));var config=require(_0x1908('0x15'));var db=require(_0x1908('0x16'))['db'];function respondWithStatusCode(_0x1914a9,_0x4472ac){_0x4472ac=_0x4472ac||0xcc;return function(_0x20f2c6){if(_0x20f2c6){return _0x1914a9[_0x1908('0x17')](_0x4472ac);}return _0x1914a9[_0x1908('0x18')](_0x4472ac)[_0x1908('0x19')]();};}function respondWithResult(_0x55f041,_0x213bde){_0x213bde=_0x213bde||0xc8;return function(_0x2d2d19){if(_0x2d2d19){return _0x55f041[_0x1908('0x18')](_0x213bde)[_0x1908('0x1a')](_0x2d2d19);}};}function respondWithFilteredResult(_0x3087c4,_0x2e8804){return function(_0x1003ee){if(_0x1003ee){var _0x1b33e9=_0x1003ee['count'],_0x455656=_0x2e8804[_0x1908('0x1b')],_0x4ace7c=_0x2e8804[_0x1908('0x1b')]+_0x2e8804[_0x1908('0x1c')],_0x2000cf;if(_0x4ace7c>=_0x1b33e9){_0x4ace7c=_0x1b33e9;_0x2000cf=0xc8;}else{_0x2000cf=0xce;}_0x3087c4['status'](_0x2000cf);return _0x3087c4[_0x1908('0x1d')](_0x1908('0x1e'),_0x455656+'-'+_0x4ace7c+'/'+_0x1b33e9)[_0x1908('0x1a')](_0x1003ee);}return null;};}function patchUpdates(_0x23cacb){return function(_0x4fda94){try{jsonpatch[_0x1908('0x1f')](_0x4fda94,_0x23cacb,!![]);}catch(_0x108fd0){return BPromise[_0x1908('0x20')](_0x108fd0);}return _0x4fda94['save']();};}function saveUpdates(_0x1d18cb,_0x42d8fe){return function(_0x3c9552){if(_0x3c9552){return _0x3c9552['update'](_0x1d18cb)[_0x1908('0x21')](function(_0x1864da){return _0x1864da;});}return null;};}function removeEntity(_0x565f6a,_0x1ca58f){return function(_0x3b6c09){if(_0x3b6c09){return _0x3b6c09['destroy']()[_0x1908('0x21')](function(){_0x565f6a[_0x1908('0x18')](0xcc)[_0x1908('0x19')]();});}};}function handleEntityNotFound(_0x27d664,_0x25e866){return function(_0x14d74c){if(!_0x14d74c){_0x27d664[_0x1908('0x17')](0x194);}return _0x14d74c;};}function handleError(_0x43ba04,_0x4dc745){_0x4dc745=_0x4dc745||0x1f4;return function(_0x38a1d2){logger['error'](_0x38a1d2[_0x1908('0x22')]);if(_0x38a1d2[_0x1908('0x23')]){delete _0x38a1d2[_0x1908('0x23')];}_0x43ba04['status'](_0x4dc745)['send'](_0x38a1d2);};}exports[_0x1908('0x24')]=function(_0x2b1b70,_0x1f667a){var _0x1e202f={'raw':!![],'where':{'id':_0x2b1b70[_0x1908('0x25')]['id']}},_0x1250cc={};_0x1250cc[_0x1908('0x26')]=_[_0x1908('0x27')](db[_0x1908('0x28')][_0x1908('0x29')]);_0x1250cc['query']=_[_0x1908('0x27')](_0x2b1b70[_0x1908('0x2a')]);_0x1250cc[_0x1908('0x2b')]=_[_0x1908('0x2c')](_0x1250cc[_0x1908('0x26')],_0x1250cc['query']);_0x1e202f['attributes']=_[_0x1908('0x2c')](_0x1250cc[_0x1908('0x26')],qs[_0x1908('0x2d')](_0x2b1b70[_0x1908('0x2a')][_0x1908('0x2d')]));_0x1e202f[_0x1908('0x2e')]=_0x1e202f['attributes'][_0x1908('0x2f')]?_0x1e202f[_0x1908('0x2e')]:_0x1250cc['model'];if(_0x2b1b70[_0x1908('0x2a')][_0x1908('0x30')]){_0x1e202f[_0x1908('0x31')]=[{'all':!![]}];}_0x1e202f=_['merge']({},_0x1e202f,_0x2b1b70[_0x1908('0x32')]);return db['ChatApplication'][_0x1908('0x33')](_0x1e202f)[_0x1908('0x21')](handleEntityNotFound(_0x1f667a,null))['then'](respondWithResult(_0x1f667a,null))[_0x1908('0x34')](handleError(_0x1f667a,null));};exports[_0x1908('0x35')]=function(_0x169e16,_0x2643e8){if(_0x169e16[_0x1908('0x36')]['id']){delete _0x169e16[_0x1908('0x36')]['id'];}return db[_0x1908('0x28')][_0x1908('0x33')]({'where':{'id':_0x169e16[_0x1908('0x25')]['id']}})['then'](handleEntityNotFound(_0x2643e8,null))[_0x1908('0x21')](saveUpdates(_0x169e16[_0x1908('0x36')],null))[_0x1908('0x21')](respondWithResult(_0x2643e8,null))[_0x1908('0x34')](handleError(_0x2643e8,null));};exports[_0x1908('0x37')]=function(_0x58a535,_0x5cb0d7){return db[_0x1908('0x28')]['find']({'where':{'id':_0x58a535['params']['id']}})[_0x1908('0x21')](handleEntityNotFound(_0x5cb0d7,null))[_0x1908('0x21')](removeEntity(_0x5cb0d7,null))[_0x1908('0x34')](handleError(_0x5cb0d7,null));}; \ No newline at end of file +var _0x9423=['model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','catch','body','find','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','show','params'];(function(_0x574797,_0x15f63b){var _0x1bed4f=function(_0x4c118d){while(--_0x4c118d){_0x574797['push'](_0x574797['shift']());}};_0x1bed4f(++_0x15f63b);}(_0x9423,0xfc));var _0x3942=function(_0x5519a2,_0x1a6513){_0x5519a2=_0x5519a2-0x0;var _0x5cc844=_0x9423[_0x5519a2];return _0x5cc844;};'use strict';var pdf=require(_0x3942('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3942('0x1'));var zipdir=require(_0x3942('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3942('0x3'));var moment=require(_0x3942('0x4'));var BPromise=require(_0x3942('0x5'));var Mustache=require(_0x3942('0x6'));var util=require(_0x3942('0x7'));var path=require(_0x3942('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3942('0x9'));var fs=require('fs');var _=require(_0x3942('0xa'));var squel=require(_0x3942('0xb'));var crypto=require(_0x3942('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3942('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3942('0xe'));var Papa=require(_0x3942('0xf'));var Redis=require(_0x3942('0x10'));var authService=require(_0x3942('0x11'));var qs=require(_0x3942('0x12'));var hardwareService=require(_0x3942('0x13'));var logger=require(_0x3942('0x14'))(_0x3942('0x15'));var utils=require(_0x3942('0x16'));var config=require(_0x3942('0x17'));var db=require(_0x3942('0x18'))['db'];function respondWithStatusCode(_0x1257fd,_0x35613a){_0x35613a=_0x35613a||0xcc;return function(_0x4dfbbf){if(_0x4dfbbf){return _0x1257fd[_0x3942('0x19')](_0x35613a);}return _0x1257fd[_0x3942('0x1a')](_0x35613a)[_0x3942('0x1b')]();};}function respondWithResult(_0x4f583a,_0x3de081){_0x3de081=_0x3de081||0xc8;return function(_0x28d1a4){if(_0x28d1a4){return _0x4f583a[_0x3942('0x1a')](_0x3de081)[_0x3942('0x1c')](_0x28d1a4);}};}function respondWithFilteredResult(_0x229bad,_0x17cd08){return function(_0xdabb94){if(_0xdabb94){var _0x3dc237=_0xdabb94[_0x3942('0x1d')],_0xc770b6=_0x17cd08[_0x3942('0x1e')],_0x22f8f2=_0x17cd08[_0x3942('0x1e')]+_0x17cd08[_0x3942('0x1f')],_0x470f98;if(_0x22f8f2>=_0x3dc237){_0x22f8f2=_0x3dc237;_0x470f98=0xc8;}else{_0x470f98=0xce;}_0x229bad[_0x3942('0x1a')](_0x470f98);return _0x229bad[_0x3942('0x20')](_0x3942('0x21'),_0xc770b6+'-'+_0x22f8f2+'/'+_0x3dc237)['json'](_0xdabb94);}return null;};}function patchUpdates(_0x54ac45){return function(_0x1570c9){try{jsonpatch['apply'](_0x1570c9,_0x54ac45,!![]);}catch(_0x499eac){return BPromise['reject'](_0x499eac);}return _0x1570c9[_0x3942('0x22')]();};}function saveUpdates(_0x3ba3b5,_0x2c3069){return function(_0x43accd){if(_0x43accd){return _0x43accd[_0x3942('0x23')](_0x3ba3b5)[_0x3942('0x24')](function(_0x6dea62){return _0x6dea62;});}return null;};}function removeEntity(_0x4625f3,_0x796c14){return function(_0x395b62){if(_0x395b62){return _0x395b62[_0x3942('0x25')]()[_0x3942('0x24')](function(){_0x4625f3[_0x3942('0x1a')](0xcc)[_0x3942('0x1b')]();});}};}function handleEntityNotFound(_0x3f5a49,_0x4fc02e){return function(_0x26e1a7){if(!_0x26e1a7){_0x3f5a49[_0x3942('0x19')](0x194);}return _0x26e1a7;};}function handleError(_0x5d1bfe,_0x23bed1){_0x23bed1=_0x23bed1||0x1f4;return function(_0x1e05ec){logger[_0x3942('0x26')](_0x1e05ec['stack']);if(_0x1e05ec[_0x3942('0x27')]){delete _0x1e05ec['name'];}_0x5d1bfe['status'](_0x23bed1)[_0x3942('0x28')](_0x1e05ec);};}exports[_0x3942('0x29')]=function(_0x45a682,_0x148802){var _0x455c22={'raw':!![],'where':{'id':_0x45a682[_0x3942('0x2a')]['id']}},_0x3f248d={};_0x3f248d[_0x3942('0x2b')]=_['keys'](db[_0x3942('0x2c')][_0x3942('0x2d')]);_0x3f248d[_0x3942('0x2e')]=_[_0x3942('0x2f')](_0x45a682['query']);_0x3f248d[_0x3942('0x30')]=_[_0x3942('0x31')](_0x3f248d[_0x3942('0x2b')],_0x3f248d[_0x3942('0x2e')]);_0x455c22[_0x3942('0x32')]=_[_0x3942('0x31')](_0x3f248d['model'],qs[_0x3942('0x33')](_0x45a682[_0x3942('0x2e')][_0x3942('0x33')]));_0x455c22['attributes']=_0x455c22[_0x3942('0x32')][_0x3942('0x34')]?_0x455c22[_0x3942('0x32')]:_0x3f248d[_0x3942('0x2b')];if(_0x45a682[_0x3942('0x2e')][_0x3942('0x35')]){_0x455c22[_0x3942('0x36')]=[{'all':!![]}];}_0x455c22=_[_0x3942('0x37')]({},_0x455c22,_0x45a682['options']);return db[_0x3942('0x2c')]['find'](_0x455c22)['then'](handleEntityNotFound(_0x148802,null))[_0x3942('0x24')](respondWithResult(_0x148802,null))[_0x3942('0x38')](handleError(_0x148802,null));};exports[_0x3942('0x23')]=function(_0x2e1a8f,_0x47ccaa){if(_0x2e1a8f['body']['id']){delete _0x2e1a8f[_0x3942('0x39')]['id'];}return db[_0x3942('0x2c')][_0x3942('0x3a')]({'where':{'id':_0x2e1a8f['params']['id']}})[_0x3942('0x24')](handleEntityNotFound(_0x47ccaa,null))[_0x3942('0x24')](saveUpdates(_0x2e1a8f[_0x3942('0x39')],null))['then'](respondWithResult(_0x47ccaa,null))[_0x3942('0x38')](handleError(_0x47ccaa,null));};exports['destroy']=function(_0x4b5043,_0xab828b){return db[_0x3942('0x2c')][_0x3942('0x3a')]({'where':{'id':_0x4b5043[_0x3942('0x2a')]['id']}})['then'](handleEntityNotFound(_0xab828b,null))[_0x3942('0x24')](removeEntity(_0xab828b,null))[_0x3942('0x38')](handleError(_0xab828b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 3d0f918..6a4dae5 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 _0x842a=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x307a58,_0x1a6ba6){var _0x2ac2c4=function(_0x52b782){while(--_0x52b782){_0x307a58['push'](_0x307a58['shift']());}};_0x2ac2c4(++_0x1a6ba6);}(_0x842a,0x10e));var _0xa842=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x842a[_0x65c0bb];return _0x320bd5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa842('0x0'))('api');var moment=require(_0xa842('0x1'));var BPromise=require(_0xa842('0x2'));var rp=require(_0xa842('0x3'));var fs=require('fs');var path=require(_0xa842('0x4'));var rimraf=require(_0xa842('0x5'));var config=require(_0xa842('0x6'));var attributes=require(_0xa842('0x7'));module[_0xa842('0x8')]=function(_0x4e7af6,_0x521a21){return _0x4e7af6[_0xa842('0x9')](_0xa842('0xa'),attributes,{'tableName':_0xa842('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa842('0xc'),'collate':_0xa842('0xd')});}; \ No newline at end of file +var _0x3fcc=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications'];(function(_0x227688,_0x3fb2a4){var _0x47ed99=function(_0x555e16){while(--_0x555e16){_0x227688['push'](_0x227688['shift']());}};_0x47ed99(++_0x3fb2a4);}(_0x3fcc,0xb6));var _0xc3fc=function(_0xef7bdb,_0x471612){_0xef7bdb=_0xef7bdb-0x0;var _0xed6ace=_0x3fcc[_0xef7bdb];return _0xed6ace;};'use strict';var _=require(_0xc3fc('0x0'));var util=require(_0xc3fc('0x1'));var logger=require(_0xc3fc('0x2'))(_0xc3fc('0x3'));var moment=require(_0xc3fc('0x4'));var BPromise=require(_0xc3fc('0x5'));var rp=require(_0xc3fc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3fc('0x7'));var config=require(_0xc3fc('0x8'));var attributes=require(_0xc3fc('0x9'));module[_0xc3fc('0xa')]=function(_0xaa983d,_0x20c5a7){return _0xaa983d['define'](_0xc3fc('0xb'),attributes,{'tableName':_0xc3fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc3fc('0xd'),'collate':_0xc3fc('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 9f27021..c254fa3 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 _0xcbd7=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x59f0ca,_0x237457){var _0x1dccb0=function(_0x3d4ac9){while(--_0x3d4ac9){_0x59f0ca['push'](_0x59f0ca['shift']());}};_0x1dccb0(++_0x237457);}(_0xcbd7,0xaa));var _0x7cbd=function(_0x54c2a8,_0x5cad99){_0x54c2a8=_0x54c2a8-0x0;var _0x28e460=_0xcbd7[_0x54c2a8];return _0x28e460;};'use strict';var _=require(_0x7cbd('0x0'));var util=require(_0x7cbd('0x1'));var moment=require('moment');var BPromise=require(_0x7cbd('0x2'));var rs=require(_0x7cbd('0x3'));var fs=require('fs');var Redis=require(_0x7cbd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cbd('0x5'));var logger=require('../../config/logger')(_0x7cbd('0x6'));var config=require(_0x7cbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7cbd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a56f,_0x84cc55,_0x2e8647){return new BPromise(function(_0x2dbf41,_0x7f8d6c){return client[_0x7cbd('0x9')](_0x16a56f,_0x2e8647)['then'](function(_0x30a8ec){logger[_0x7cbd('0xa')](_0x7cbd('0xb'),_0x84cc55,_0x7cbd('0xc'));logger[_0x7cbd('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x84cc55,_0x7cbd('0xc'),JSON[_0x7cbd('0xe')](_0x30a8ec));if(_0x30a8ec['error']){if(_0x30a8ec[_0x7cbd('0xf')]['code']===0x1f4){logger[_0x7cbd('0xf')](_0x7cbd('0xb'),_0x84cc55,_0x30a8ec['error'][_0x7cbd('0x10')]);return _0x7f8d6c(_0x30a8ec[_0x7cbd('0xf')][_0x7cbd('0x10')]);}logger[_0x7cbd('0xf')](_0x7cbd('0xb'),_0x84cc55,_0x30a8ec['error'][_0x7cbd('0x10')]);return _0x2dbf41(_0x30a8ec[_0x7cbd('0xf')]['message']);}else{logger[_0x7cbd('0xa')]('ChatApplication,\x20%s,\x20%s',_0x84cc55,_0x7cbd('0xc'));_0x2dbf41(_0x30a8ec['result'][_0x7cbd('0x10')]);}})[_0x7cbd('0x11')](function(_0x1113c4){logger['error'](_0x7cbd('0xb'),_0x84cc55,_0x1113c4);_0x7f8d6c(_0x1113c4);});});} \ No newline at end of file +var _0x8a6e=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x284826,_0x575d79){var _0x1d4e1e=function(_0x520bff){while(--_0x520bff){_0x284826['push'](_0x284826['shift']());}};_0x1d4e1e(++_0x575d79);}(_0x8a6e,0x170));var _0xe8a6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8a6e[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe8a6('0x0'));var BPromise=require(_0xe8a6('0x1'));var rs=require(_0xe8a6('0x2'));var fs=require('fs');var Redis=require(_0xe8a6('0x3'));var db=require(_0xe8a6('0x4'))['db'];var utils=require(_0xe8a6('0x5'));var logger=require(_0xe8a6('0x6'))('rpc');var config=require(_0xe8a6('0x7'));var jayson=require(_0xe8a6('0x8'));var client=jayson['client'][_0xe8a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16e869,_0x357be4,_0x1d853a){return new BPromise(function(_0x24eaae,_0x1e2ed9){return client[_0xe8a6('0xa')](_0x16e869,_0x1d853a)[_0xe8a6('0xb')](function(_0x52a923){logger['info'](_0xe8a6('0xc'),_0x357be4,_0xe8a6('0xd'));logger['debug'](_0xe8a6('0xe'),_0x357be4,_0xe8a6('0xd'),JSON[_0xe8a6('0xf')](_0x52a923));if(_0x52a923['error']){if(_0x52a923[_0xe8a6('0x10')]['code']===0x1f4){logger[_0xe8a6('0x10')](_0xe8a6('0xc'),_0x357be4,_0x52a923['error'][_0xe8a6('0x11')]);return _0x1e2ed9(_0x52a923[_0xe8a6('0x10')][_0xe8a6('0x11')]);}logger[_0xe8a6('0x10')]('ChatApplication,\x20%s,\x20%s',_0x357be4,_0x52a923[_0xe8a6('0x10')][_0xe8a6('0x11')]);return _0x24eaae(_0x52a923[_0xe8a6('0x10')][_0xe8a6('0x11')]);}else{logger[_0xe8a6('0x12')]('ChatApplication,\x20%s,\x20%s',_0x357be4,_0xe8a6('0xd'));_0x24eaae(_0x52a923[_0xe8a6('0x13')][_0xe8a6('0x11')]);}})[_0xe8a6('0x14')](function(_0x213899){logger[_0xe8a6('0x10')]('ChatApplication,\x20%s,\x20%s',_0x357be4,_0x213899);_0x1e2ed9(_0x213899);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c9dfd48..515aec2 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 _0x252d=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put'];(function(_0x294f21,_0x1db07e){var _0x26decc=function(_0x10abb6){while(--_0x10abb6){_0x294f21['push'](_0x294f21['shift']());}};_0x26decc(++_0x1db07e);}(_0x252d,0x89));var _0xd252=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x252d[_0xe84805];return _0x398efd;};'use strict';var multer=require(_0xd252('0x0'));var util=require(_0xd252('0x1'));var path=require(_0xd252('0x2'));var timeout=require(_0xd252('0x3'));var express=require(_0xd252('0x4'));var router=express[_0xd252('0x5')]();var auth=require(_0xd252('0x6'));var interaction=require(_0xd252('0x7'));var config=require(_0xd252('0x8'));var controller=require(_0xd252('0x9'));router['get'](_0xd252('0xa'),auth[_0xd252('0xb')](),controller['show']);router[_0xd252('0xc')](_0xd252('0xa'),auth['isAuthenticated'](),controller[_0xd252('0xd')]);router['delete'](_0xd252('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd252('0xe')]=router; \ No newline at end of file +var _0xf10c=['util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x5699fc,_0x1304d3){var _0x37bb3a=function(_0x350388){while(--_0x350388){_0x5699fc['push'](_0x5699fc['shift']());}};_0x37bb3a(++_0x1304d3);}(_0xf10c,0x90));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcf10('0x0'));var path=require('path');var timeout=require(_0xcf10('0x1'));var express=require(_0xcf10('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcf10('0x3'));var config=require(_0xcf10('0x4'));var controller=require(_0xcf10('0x5'));router[_0xcf10('0x6')](_0xcf10('0x7'),auth[_0xcf10('0x8')](),controller['show']);router['put'](_0xcf10('0x7'),auth[_0xcf10('0x8')](),controller['update']);router[_0xcf10('0x9')](_0xcf10('0x7'),auth[_0xcf10('0x8')](),controller[_0xcf10('0xa')]);module[_0xcf10('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index d150947..eb36783 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 _0xed89=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4fb12a,_0x19caab){var _0x2f49c8=function(_0x1216da){while(--_0x1216da){_0x4fb12a['push'](_0x4fb12a['shift']());}};_0x2f49c8(++_0x19caab);}(_0xed89,0x17b));var _0x9ed8=function(_0x430241,_0x46f153){_0x430241=_0x430241-0x0;var _0x5db5b3=_0xed89[_0x430241];return _0x5db5b3;};'use strict';var Sequelize=require(_0x9ed8('0x0'));module[_0x9ed8('0x1')]={'name':{'type':Sequelize[_0x9ed8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9ed8('0x2')]},'write':{'type':Sequelize[_0x9ed8('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc118=['BOOLEAN','sequelize','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xc118,0x1d2));var _0x8c11=function(_0x1b6b28,_0x551556){_0x1b6b28=_0x1b6b28-0x0;var _0x1939af=_0xc118[_0x1b6b28];return _0x1939af;};'use strict';var Sequelize=require(_0x8c11('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c11('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8c11('0x1')]},'write':{'type':Sequelize[_0x8c11('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 98709f9..74dc2ed 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 _0x383d=['show','params','includeAll','create','body','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','map','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','stack','name','send','ChatGroup','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','key','field','options','include','findAll','rows'];(function(_0x1aa9e7,_0x37f064){var _0x45039d=function(_0x5873d5){while(--_0x5873d5){_0x1aa9e7['push'](_0x1aa9e7['shift']());}};_0x45039d(++_0x37f064);}(_0x383d,0xe4));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd383('0x0'));var rimraf=require(_0xd383('0x1'));var zipdir=require(_0xd383('0x2'));var jsonpatch=require(_0xd383('0x3'));var rp=require(_0xd383('0x4'));var moment=require(_0xd383('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd383('0x7'));var fs=require('fs');var _=require(_0xd383('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd383('0x9'));var querystring=require(_0xd383('0xa'));var Papa=require(_0xd383('0xb'));var Redis=require(_0xd383('0xc'));var authService=require(_0xd383('0xd'));var qs=require(_0xd383('0xe'));var hardwareService=require(_0xd383('0xf'));var logger=require(_0xd383('0x10'))('api');var utils=require(_0xd383('0x11'));var config=require('../../config/environment');var db=require(_0xd383('0x12'))['db'];config['redis']=_[_0xd383('0x13')](config[_0xd383('0x14')],{'host':_0xd383('0x15'),'port':0x18eb});var socket=require(_0xd383('0x16'))(new Redis(config[_0xd383('0x14')]));require(_0xd383('0x17'))[_0xd383('0x18')](socket);var jayson=require(_0xd383('0x19'));var client=jayson['client'][_0xd383('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x575be0,_0x172e1d,_0x1a47bc){if(_0x1a47bc){var _0xbfbd10=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbfbd10[_0xd383('0x1b')](_0x172e1d)){return _0x575be0;}else{throw new Error(_0xd383('0x1c'));}}else{return _0x575be0;}}function respondWithRpcPromise(_0x4d8e86,_0x163533,_0x5376c0,_0x5656b4){return new BPromise(function(_0x1a19b8,_0x1b1b11){var _0x323402=_0x5656b4||client;return _0x323402[_0xd383('0x1d')](_0x4d8e86,_0x5376c0)[_0xd383('0x1e')](function(_0x227706){logger['info'](_0xd383('0x1f'),_0x163533,'request\x20sent');logger[_0xd383('0x20')](_0xd383('0x21'),_0x163533,_0xd383('0x22'),JSON[_0xd383('0x23')](_0x227706));if(_0x227706[_0xd383('0x24')]){if(_0x227706[_0xd383('0x24')][_0xd383('0x25')]===0x1f4){logger[_0xd383('0x24')](_0xd383('0x1f'),_0x163533,_0x227706[_0xd383('0x24')]['message']);return _0x1b1b11(_0x227706[_0xd383('0x24')][_0xd383('0x26')]);}logger[_0xd383('0x24')](_0xd383('0x1f'),_0x163533,_0x227706[_0xd383('0x24')][_0xd383('0x26')]);return _0x1a19b8(_0x227706[_0xd383('0x24')][_0xd383('0x26')]);}else{logger[_0xd383('0x27')](_0xd383('0x1f'),_0x163533,_0xd383('0x22'));_0x1a19b8(_0x227706[_0xd383('0x28')][_0xd383('0x26')]);}})[_0xd383('0x29')](function(_0x37a494){logger['error']('ChatGroup,\x20%s,\x20%s',_0x163533,_0x37a494);_0x1b1b11(_0x37a494);});});}function respondWithStatusCode(_0x142f4a,_0x1b20cc){_0x1b20cc=_0x1b20cc||0xcc;return function(_0x5f1571){if(_0x5f1571){return _0x142f4a[_0xd383('0x2a')](_0x1b20cc);}return _0x142f4a[_0xd383('0x2b')](_0x1b20cc)[_0xd383('0x2c')]();};}function respondWithResult(_0x47071d,_0xf1fdd9){_0xf1fdd9=_0xf1fdd9||0xc8;return function(_0x500028){if(_0x500028){return _0x47071d[_0xd383('0x2b')](_0xf1fdd9)[_0xd383('0x2d')](_0x500028);}};}function respondWithFilteredResult(_0x1e5a66,_0x344831){return function(_0x31c739){if(_0x31c739){var _0x3421bd=_0x31c739[_0xd383('0x2e')],_0x479163=_0x344831[_0xd383('0x2f')],_0x11c5ec=_0x344831[_0xd383('0x2f')]+_0x344831[_0xd383('0x30')],_0x208a8c;if(_0x11c5ec>=_0x3421bd){_0x11c5ec=_0x3421bd;_0x208a8c=0xc8;}else{_0x208a8c=0xce;}_0x1e5a66[_0xd383('0x2b')](_0x208a8c);return _0x1e5a66[_0xd383('0x31')]('Content-Range',_0x479163+'-'+_0x11c5ec+'/'+_0x3421bd)[_0xd383('0x2d')](_0x31c739);}return null;};}function patchUpdates(_0x3cd6a1){return function(_0x4de576){try{jsonpatch[_0xd383('0x32')](_0x4de576,_0x3cd6a1,!![]);}catch(_0x293c7f){return BPromise['reject'](_0x293c7f);}return _0x4de576[_0xd383('0x33')]();};}function saveUpdates(_0x4c22e4,_0x2acee1){return function(_0x458847){if(_0x458847){return _0x458847[_0xd383('0x34')](_0x4c22e4)[_0xd383('0x1e')](function(_0x1b9568){return _0x1b9568;});}return null;};}function removeEntity(_0x4051a7,_0x554343){return function(_0x402edb){if(_0x402edb){return _0x402edb[_0xd383('0x35')]()['then'](function(){_0x4051a7[_0xd383('0x2b')](0xcc)[_0xd383('0x2c')]();});}};}function handleEntityNotFound(_0x380c86,_0x25ab5f){return function(_0x5e0ff3){if(!_0x5e0ff3){_0x380c86['sendStatus'](0x194);}return _0x5e0ff3;};}function handleError(_0x96a232,_0x5a7812){_0x5a7812=_0x5a7812||0x1f4;return function(_0x41a100){logger[_0xd383('0x24')](_0x41a100[_0xd383('0x36')]);if(_0x41a100[_0xd383('0x37')]){delete _0x41a100[_0xd383('0x37')];}_0x96a232[_0xd383('0x2b')](_0x5a7812)[_0xd383('0x38')](_0x41a100);};}exports['index']=function(_0x416c50,_0x180c02){var _0x27d3c6={},_0x509fa3={},_0x2c513c={'count':0x0,'rows':[]};var _0x3a1c41=db[_0xd383('0x39')][_0xd383('0x3a')];_0x509fa3[_0xd383('0x3b')]=_[_0xd383('0x3c')](_0x3a1c41);_0x509fa3[_0xd383('0x3d')]=_['keys'](_0x416c50[_0xd383('0x3d')]);_0x509fa3['filters']=_[_0xd383('0x3e')](_0x509fa3[_0xd383('0x3b')],_0x509fa3[_0xd383('0x3d')]);_0x27d3c6[_0xd383('0x3f')]=_['intersection'](_0x509fa3[_0xd383('0x3b')],qs[_0xd383('0x40')](_0x416c50[_0xd383('0x3d')][_0xd383('0x40')]));_0x27d3c6[_0xd383('0x3f')]=_0x27d3c6[_0xd383('0x3f')][_0xd383('0x41')]?_0x27d3c6[_0xd383('0x3f')]:_0x509fa3[_0xd383('0x3b')];if(!_0x416c50['query'][_0xd383('0x42')]('nolimit')){_0x27d3c6['limit']=qs[_0xd383('0x30')](_0x416c50['query'][_0xd383('0x30')]);_0x27d3c6['offset']=qs[_0xd383('0x2f')](_0x416c50['query'][_0xd383('0x2f')]);}_0x27d3c6[_0xd383('0x43')]=qs[_0xd383('0x44')](_0x416c50[_0xd383('0x3d')][_0xd383('0x44')]);_0x27d3c6[_0xd383('0x45')]=qs['filters'](_[_0xd383('0x46')](_0x416c50[_0xd383('0x3d')],_0x509fa3[_0xd383('0x47')]));if(_0x416c50['query'][_0xd383('0x48')]){_0x27d3c6['where']=_[_0xd383('0x49')](_0x27d3c6[_0xd383('0x45')],{'$or':_['map'](_0x3a1c41,function(_0x3c6f29){if(_0x3c6f29[_0xd383('0x4a')][_0xd383('0x4b')]!=='VIRTUAL'){var _0x420aa8={};_0x420aa8[_0x3c6f29[_0xd383('0x4c')]]={'$like':'%'+_0x416c50['query'][_0xd383('0x48')]+'%'};return _0x420aa8;}})});}_0x27d3c6=_[_0xd383('0x49')]({},_0x27d3c6,_0x416c50[_0xd383('0x4d')]);var _0x2d4949={'where':_0x27d3c6[_0xd383('0x45')]};return db['ChatGroup']['count'](_0x2d4949)[_0xd383('0x1e')](function(_0x5503d4){_0x2c513c[_0xd383('0x2e')]=_0x5503d4;if(_0x416c50[_0xd383('0x3d')]['includeAll']){_0x27d3c6[_0xd383('0x4e')]=[{'all':!![]}];}return db[_0xd383('0x39')][_0xd383('0x4f')](_0x27d3c6);})[_0xd383('0x1e')](function(_0x56081b){_0x2c513c[_0xd383('0x50')]=_0x56081b;return _0x2c513c;})[_0xd383('0x1e')](respondWithFilteredResult(_0x180c02,_0x27d3c6))[_0xd383('0x29')](handleError(_0x180c02,null));};exports[_0xd383('0x51')]=function(_0xca9776,_0x4398d8){var _0x4d1292={'raw':!![],'where':{'id':_0xca9776[_0xd383('0x52')]['id']}},_0x282848={};_0x282848['model']=_[_0xd383('0x3c')](db[_0xd383('0x39')]['rawAttributes']);_0x282848[_0xd383('0x3d')]=_['keys'](_0xca9776[_0xd383('0x3d')]);_0x282848[_0xd383('0x47')]=_[_0xd383('0x3e')](_0x282848[_0xd383('0x3b')],_0x282848[_0xd383('0x3d')]);_0x4d1292['attributes']=_['intersection'](_0x282848['model'],qs[_0xd383('0x40')](_0xca9776['query']['fields']));_0x4d1292['attributes']=_0x4d1292['attributes'][_0xd383('0x41')]?_0x4d1292[_0xd383('0x3f')]:_0x282848['model'];if(_0xca9776[_0xd383('0x3d')][_0xd383('0x53')]){_0x4d1292[_0xd383('0x4e')]=[{'all':!![]}];}_0x4d1292=_[_0xd383('0x49')]({},_0x4d1292,_0xca9776[_0xd383('0x4d')]);return db['ChatGroup']['find'](_0x4d1292)[_0xd383('0x1e')](handleEntityNotFound(_0x4398d8,null))[_0xd383('0x1e')](respondWithResult(_0x4398d8,null))[_0xd383('0x29')](handleError(_0x4398d8,null));};exports[_0xd383('0x54')]=function(_0xe8eb11,_0x3ddeff){return db[_0xd383('0x39')][_0xd383('0x54')](_0xe8eb11['body'],{})['then'](respondWithResult(_0x3ddeff,0xc9))[_0xd383('0x29')](handleError(_0x3ddeff,null));};exports['update']=function(_0x4e9467,_0x2127d6){if(_0x4e9467[_0xd383('0x55')]['id']){delete _0x4e9467[_0xd383('0x55')]['id'];}return db[_0xd383('0x39')]['find']({'where':{'id':_0x4e9467[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0x2127d6,null))[_0xd383('0x1e')](saveUpdates(_0x4e9467[_0xd383('0x55')],null))[_0xd383('0x1e')](respondWithResult(_0x2127d6,null))['catch'](handleError(_0x2127d6,null));};exports[_0xd383('0x35')]=function(_0xe6683d,_0xa8ab00){return db['ChatGroup'][_0xd383('0x56')]({'where':{'id':_0xe6683d[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0xa8ab00,null))['then'](removeEntity(_0xa8ab00,null))[_0xd383('0x29')](handleError(_0xa8ab00,null));};exports[_0xd383('0x57')]=function(_0x18a8a2,_0x3c7834){return db['ChatGroup']['describe']()[_0xd383('0x1e')](respondWithResult(_0x3c7834,null))[_0xd383('0x29')](handleError(_0x3c7834,null));};exports[_0xd383('0x58')]=function(_0x384fee,_0x120070,_0x1db0b6){return db[_0xd383('0x59')][_0xd383('0x2e')]({'where':{'ChatGroupId':_0x384fee[_0xd383('0x52')]['id'],'ToId':_0x384fee[_0xd383('0x5a')]['id'],'read':![]}})[_0xd383('0x1e')](function(_0xd77eb1){return{'id':_['toInteger'](_0x384fee[_0xd383('0x52')]['id']),'count':_0xd77eb1};})['then'](respondWithResult(_0x120070,null))[_0xd383('0x29')](handleError(_0x120070,null));};exports[_0xd383('0x5b')]=function(_0x31c7a0,_0xfef609,_0x279200){return db[_0xd383('0x39')]['find']({'where':{'id':_0x31c7a0[_0xd383('0x52')]['id']}})['then'](handleEntityNotFound(_0xfef609,null))['then'](function(_0x459844){if(_0x459844){return _0x459844[_0xd383('0x5b')](_0x31c7a0['body'][_0xd383('0x5c')],_[_0xd383('0x5d')](_0x31c7a0['body'],['ids','id'])||{});}})[_0xd383('0x1e')](respondWithResult(_0xfef609,null))[_0xd383('0x29')](handleError(_0xfef609,null));};exports['getMembers']=function(_0x156a4a,_0x52eb44,_0x1f202b){var _0x358777={};var _0x7a5c61={};var _0x173b41;var _0x26d120;return db[_0xd383('0x39')][_0xd383('0x5e')]({'where':{'id':_0x156a4a[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0x52eb44,null))[_0xd383('0x1e')](function(_0x190825){if(_0x190825){_0x173b41=_0x190825;_0x7a5c61[_0xd383('0x3b')]=_[_0xd383('0x3c')](db['User'][_0xd383('0x3a')]);_0x7a5c61['query']=_['keys'](_0x156a4a[_0xd383('0x3d')]);_0x7a5c61[_0xd383('0x47')]=_['intersection'](_0x7a5c61[_0xd383('0x3b')],_0x7a5c61[_0xd383('0x3d')]);_0x358777[_0xd383('0x3f')]=_[_0xd383('0x3e')](_0x7a5c61['model'],qs[_0xd383('0x40')](_0x156a4a[_0xd383('0x3d')][_0xd383('0x40')]));_0x358777['attributes']=_0x358777[_0xd383('0x3f')][_0xd383('0x41')]?_0x358777[_0xd383('0x3f')]:_0x7a5c61[_0xd383('0x3b')];_0x358777['order']=qs[_0xd383('0x44')](_0x156a4a[_0xd383('0x3d')][_0xd383('0x44')]);_0x358777['where']=qs[_0xd383('0x47')](_[_0xd383('0x46')](_0x156a4a[_0xd383('0x3d')],_0x7a5c61[_0xd383('0x47')]));if(_0x156a4a[_0xd383('0x3d')]['filter']){_0x358777[_0xd383('0x45')]=_[_0xd383('0x49')](_0x358777[_0xd383('0x45')],{'$or':_[_0xd383('0x5f')](_0x358777[_0xd383('0x3f')],function(_0x42ccb1){var _0x59b65b={};_0x59b65b[_0x42ccb1]={'$like':'%'+_0x156a4a['query'][_0xd383('0x48')]+'%'};return _0x59b65b;})});}_0x358777=_['merge']({},_0x358777,_0x156a4a[_0xd383('0x4d')]);return _0x173b41['getMembers'](_0x358777);}})[_0xd383('0x1e')](function(_0x16592b){if(_0x16592b){_0x26d120=_0x16592b[_0xd383('0x41')];if(!_0x156a4a[_0xd383('0x3d')][_0xd383('0x42')](_0xd383('0x60'))){_0x358777['limit']=qs['limit'](_0x156a4a[_0xd383('0x3d')][_0xd383('0x30')]);_0x358777['offset']=qs[_0xd383('0x2f')](_0x156a4a[_0xd383('0x3d')]['offset']);}return _0x173b41[_0xd383('0x61')](_0x358777);}})[_0xd383('0x1e')](function(_0x48f65a){if(_0x48f65a){return _0x48f65a?{'count':_0x26d120,'rows':_0x48f65a}:null;}})[_0xd383('0x1e')](respondWithResult(_0x52eb44,null))[_0xd383('0x29')](handleError(_0x52eb44,null));};exports['removeMembers']=function(_0x1df503,_0xcab086,_0x27519c){return db[_0xd383('0x39')][_0xd383('0x56')]({'where':{'id':_0x1df503[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0xcab086,null))[_0xd383('0x1e')](function(_0x4aa95f){if(_0x4aa95f){return _0x4aa95f[_0xd383('0x62')](_0x1df503[_0xd383('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0xcab086,null))[_0xd383('0x29')](handleError(_0xcab086,null));};exports[_0xd383('0x63')]=function(_0x23c8d1,_0x244635,_0x58ead4){if(_0x23c8d1[_0xd383('0x55')]['id']){delete _0x23c8d1[_0xd383('0x55')]['id'];}return db[_0xd383('0x39')][_0xd383('0x56')]({'where':{'id':_0x23c8d1[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0x244635,null))[_0xd383('0x1e')](function(_0x4eb6b4){if(_0x4eb6b4){_0x23c8d1['body'][_0xd383('0x64')]=_0x4eb6b4['id'];return db['ChatInternalMessage']['create'](_0x23c8d1[_0xd383('0x55')]);}})[_0xd383('0x1e')](respondWithResult(_0x244635,null))[_0xd383('0x29')](handleError(_0x244635,null));};exports[_0xd383('0x65')]=function(_0x114227,_0x5df3ce,_0x1afae0){var _0x1cde55={};var _0x1be45c={};var _0x382d3e;var _0x2882c4;return db[_0xd383('0x39')]['findOne']({'where':{'id':_0x114227[_0xd383('0x52')]['id']}})[_0xd383('0x1e')](handleEntityNotFound(_0x5df3ce,null))[_0xd383('0x1e')](function(_0x1e2e8f){if(_0x1e2e8f){_0x382d3e=_0x1e2e8f;_0x1be45c[_0xd383('0x3b')]=_[_0xd383('0x3c')](db[_0xd383('0x59')]['rawAttributes']);_0x1be45c['query']=_[_0xd383('0x3c')](_0x114227[_0xd383('0x3d')]);_0x1be45c['filters']=_['intersection'](_0x1be45c['model'],_0x1be45c[_0xd383('0x3d')]);_0x1cde55['attributes']=_[_0xd383('0x3e')](_0x1be45c[_0xd383('0x3b')],qs['fields'](_0x114227[_0xd383('0x3d')][_0xd383('0x40')]));_0x1cde55['attributes']=_0x1cde55[_0xd383('0x3f')][_0xd383('0x41')]?_0x1cde55[_0xd383('0x3f')]:_0x1be45c['model'];_0x1cde55[_0xd383('0x43')]=qs[_0xd383('0x44')](_0x114227['query']['sort']);_0x1cde55[_0xd383('0x45')]=qs['filters'](_[_0xd383('0x46')](_0x114227[_0xd383('0x3d')],_0x1be45c[_0xd383('0x47')]));if(_0x114227[_0xd383('0x3d')]['filter']){_0x1cde55['where']=_[_0xd383('0x49')](_0x1cde55[_0xd383('0x45')],{'$or':_[_0xd383('0x5f')](_0x1cde55[_0xd383('0x3f')],function(_0x1c329b){var _0x35943f={};_0x35943f[_0x1c329b]={'$like':'%'+_0x114227[_0xd383('0x3d')]['filter']+'%'};return _0x35943f;})});}if(_0x114227[_0xd383('0x3d')][_0xd383('0x66')]){var _0x7ae517=_0x114227[_0xd383('0x3d')][_0xd383('0x66')]['split'](',');var _0x49f6c2={};_0x49f6c2[_0x7ae517[0x0]]={'$gte':moment(_0x7ae517[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cde55[_0xd383('0x45')]=_[_0xd383('0x49')](_0x1cde55[_0xd383('0x45')],_0x49f6c2);}_0x1cde55=_[_0xd383('0x49')]({},_0x1cde55,_0x114227[_0xd383('0x4d')]);return _0x382d3e['getMessages'](_0x1cde55);}})[_0xd383('0x1e')](function(_0x459705){if(_0x459705){_0x2882c4=_0x459705['length'];if(!_0x114227[_0xd383('0x3d')]['hasOwnProperty'](_0xd383('0x60'))){_0x1cde55[_0xd383('0x30')]=qs[_0xd383('0x30')](_0x114227[_0xd383('0x3d')][_0xd383('0x30')]);_0x1cde55[_0xd383('0x2f')]=qs['offset'](_0x114227['query'][_0xd383('0x2f')]);}return _0x382d3e[_0xd383('0x65')](_0x1cde55);}})[_0xd383('0x1e')](function(_0xc73b60){if(_0xc73b60){return _0xc73b60?{'count':_0x2882c4,'rows':_0xc73b60}:null;}})[_0xd383('0x1e')](respondWithResult(_0x5df3ce,null))[_0xd383('0x29')](handleError(_0x5df3ce,null));}; \ No newline at end of file +var _0xc4a9=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','create','body','update','find','describe','getUnread','user','addMembers','omit','ids','findOne','User','map','getMembers','nolimit','removeMembers','getMessages','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','count','offset','limit','set','json','apply','save','sendStatus','name','send','index','ChatGroup','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x33d63e,_0x3268e5){var _0x30ed75=function(_0x5a6ceb){while(--_0x5a6ceb){_0x33d63e['push'](_0x33d63e['shift']());}};_0x30ed75(++_0x3268e5);}(_0xc4a9,0x1c8));var _0x9c4a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xc4a9[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require(_0x9c4a('0x0'));var emlformat=require(_0x9c4a('0x1'));var rimraf=require(_0x9c4a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c4a('0x3'));var rp=require(_0x9c4a('0x4'));var moment=require(_0x9c4a('0x5'));var BPromise=require(_0x9c4a('0x6'));var Mustache=require(_0x9c4a('0x7'));var util=require(_0x9c4a('0x8'));var path=require(_0x9c4a('0x9'));var sox=require('sox');var csv=require(_0x9c4a('0xa'));var ejs=require(_0x9c4a('0xb'));var fs=require('fs');var _=require(_0x9c4a('0xc'));var squel=require(_0x9c4a('0xd'));var crypto=require(_0x9c4a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9c4a('0xf'));var toCsv=require(_0x9c4a('0xa'));var querystring=require(_0x9c4a('0x10'));var Papa=require(_0x9c4a('0x11'));var Redis=require(_0x9c4a('0x12'));var authService=require(_0x9c4a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c4a('0x14'))('api');var utils=require(_0x9c4a('0x15'));var config=require(_0x9c4a('0x16'));var db=require(_0x9c4a('0x17'))['db'];config[_0x9c4a('0x18')]=_[_0x9c4a('0x19')](config[_0x9c4a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c4a('0x1a'))(new Redis(config[_0x9c4a('0x18')]));require(_0x9c4a('0x1b'))[_0x9c4a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9c4a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xfc1169,_0x302e60,_0xd45ef7){if(_0xd45ef7){var _0x1165dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1165dd[_0x9c4a('0x1e')](_0x302e60)){return _0xfc1169;}else{throw new Error(_0x9c4a('0x1f'));}}else{return _0xfc1169;}}function respondWithRpcPromise(_0x344c12,_0x1f5b8c,_0x3828a8,_0x572aba){return new BPromise(function(_0x4d93e9,_0x216c94){var _0x412e87=_0x572aba||client;return _0x412e87[_0x9c4a('0x20')](_0x344c12,_0x3828a8)[_0x9c4a('0x21')](function(_0xd71c42){logger[_0x9c4a('0x22')](_0x9c4a('0x23'),_0x1f5b8c,_0x9c4a('0x24'));logger[_0x9c4a('0x25')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1f5b8c,'request\x20sent',JSON[_0x9c4a('0x26')](_0xd71c42));if(_0xd71c42[_0x9c4a('0x27')]){if(_0xd71c42[_0x9c4a('0x27')]['code']===0x1f4){logger[_0x9c4a('0x27')](_0x9c4a('0x23'),_0x1f5b8c,_0xd71c42[_0x9c4a('0x27')]['message']);return _0x216c94(_0xd71c42[_0x9c4a('0x27')][_0x9c4a('0x28')]);}logger[_0x9c4a('0x27')](_0x9c4a('0x23'),_0x1f5b8c,_0xd71c42['error']['message']);return _0x4d93e9(_0xd71c42['error'][_0x9c4a('0x28')]);}else{logger[_0x9c4a('0x22')](_0x9c4a('0x23'),_0x1f5b8c,'request\x20sent');_0x4d93e9(_0xd71c42[_0x9c4a('0x29')][_0x9c4a('0x28')]);}})[_0x9c4a('0x2a')](function(_0x1c4dc2){logger[_0x9c4a('0x27')]('ChatGroup,\x20%s,\x20%s',_0x1f5b8c,_0x1c4dc2);_0x216c94(_0x1c4dc2);});});}function respondWithStatusCode(_0x55a55c,_0x454d1d){_0x454d1d=_0x454d1d||0xcc;return function(_0x3ce58d){if(_0x3ce58d){return _0x55a55c['sendStatus'](_0x454d1d);}return _0x55a55c[_0x9c4a('0x2b')](_0x454d1d)[_0x9c4a('0x2c')]();};}function respondWithResult(_0x85d9bd,_0xa93ae8){_0xa93ae8=_0xa93ae8||0xc8;return function(_0x2d881f){if(_0x2d881f){return _0x85d9bd[_0x9c4a('0x2b')](_0xa93ae8)['json'](_0x2d881f);}};}function respondWithFilteredResult(_0x221427,_0x2218dc){return function(_0x5119d7){if(_0x5119d7){var _0x5ce324=_0x5119d7[_0x9c4a('0x2d')],_0x537690=_0x2218dc[_0x9c4a('0x2e')],_0x5a46fa=_0x2218dc['offset']+_0x2218dc[_0x9c4a('0x2f')],_0xb29094;if(_0x5a46fa>=_0x5ce324){_0x5a46fa=_0x5ce324;_0xb29094=0xc8;}else{_0xb29094=0xce;}_0x221427['status'](_0xb29094);return _0x221427[_0x9c4a('0x30')]('Content-Range',_0x537690+'-'+_0x5a46fa+'/'+_0x5ce324)[_0x9c4a('0x31')](_0x5119d7);}return null;};}function patchUpdates(_0x72cc1a){return function(_0x3d584b){try{jsonpatch[_0x9c4a('0x32')](_0x3d584b,_0x72cc1a,!![]);}catch(_0x3c5ac4){return BPromise['reject'](_0x3c5ac4);}return _0x3d584b[_0x9c4a('0x33')]();};}function saveUpdates(_0x168735,_0x14921c){return function(_0x17e991){if(_0x17e991){return _0x17e991['update'](_0x168735)[_0x9c4a('0x21')](function(_0x571b02){return _0x571b02;});}return null;};}function removeEntity(_0x5aa0ea,_0x4f8cfa){return function(_0x4fcebb){if(_0x4fcebb){return _0x4fcebb['destroy']()[_0x9c4a('0x21')](function(){_0x5aa0ea[_0x9c4a('0x2b')](0xcc)[_0x9c4a('0x2c')]();});}};}function handleEntityNotFound(_0x8ebc01,_0x373fa5){return function(_0x10a012){if(!_0x10a012){_0x8ebc01[_0x9c4a('0x34')](0x194);}return _0x10a012;};}function handleError(_0x7d1b86,_0x19ac28){_0x19ac28=_0x19ac28||0x1f4;return function(_0x5bfe76){logger['error'](_0x5bfe76['stack']);if(_0x5bfe76[_0x9c4a('0x35')]){delete _0x5bfe76[_0x9c4a('0x35')];}_0x7d1b86[_0x9c4a('0x2b')](_0x19ac28)[_0x9c4a('0x36')](_0x5bfe76);};}exports[_0x9c4a('0x37')]=function(_0x232dbf,_0x496a2c){var _0xea8651={},_0x421b03={},_0x361ace={'count':0x0,'rows':[]};var _0x5f3e55=db[_0x9c4a('0x38')][_0x9c4a('0x39')];_0x421b03[_0x9c4a('0x3a')]=_[_0x9c4a('0x3b')](_0x5f3e55);_0x421b03[_0x9c4a('0x3c')]=_[_0x9c4a('0x3b')](_0x232dbf[_0x9c4a('0x3c')]);_0x421b03[_0x9c4a('0x3d')]=_['intersection'](_0x421b03[_0x9c4a('0x3a')],_0x421b03['query']);_0xea8651[_0x9c4a('0x3e')]=_[_0x9c4a('0x3f')](_0x421b03[_0x9c4a('0x3a')],qs['fields'](_0x232dbf['query'][_0x9c4a('0x40')]));_0xea8651['attributes']=_0xea8651[_0x9c4a('0x3e')][_0x9c4a('0x41')]?_0xea8651[_0x9c4a('0x3e')]:_0x421b03[_0x9c4a('0x3a')];if(!_0x232dbf['query'][_0x9c4a('0x42')]('nolimit')){_0xea8651['limit']=qs[_0x9c4a('0x2f')](_0x232dbf[_0x9c4a('0x3c')]['limit']);_0xea8651[_0x9c4a('0x2e')]=qs[_0x9c4a('0x2e')](_0x232dbf['query']['offset']);}_0xea8651[_0x9c4a('0x43')]=qs[_0x9c4a('0x44')](_0x232dbf[_0x9c4a('0x3c')]['sort']);_0xea8651[_0x9c4a('0x45')]=qs['filters'](_[_0x9c4a('0x46')](_0x232dbf[_0x9c4a('0x3c')],_0x421b03['filters']));if(_0x232dbf[_0x9c4a('0x3c')][_0x9c4a('0x47')]){_0xea8651[_0x9c4a('0x45')]=_[_0x9c4a('0x48')](_0xea8651[_0x9c4a('0x45')],{'$or':_['map'](_0x5f3e55,function(_0x345e3f){if(_0x345e3f[_0x9c4a('0x49')][_0x9c4a('0x4a')]!==_0x9c4a('0x4b')){var _0x153e60={};_0x153e60[_0x345e3f[_0x9c4a('0x4c')]]={'$like':'%'+_0x232dbf[_0x9c4a('0x3c')]['filter']+'%'};return _0x153e60;}})});}_0xea8651=_[_0x9c4a('0x48')]({},_0xea8651,_0x232dbf[_0x9c4a('0x4d')]);var _0x2d4c62={'where':_0xea8651[_0x9c4a('0x45')]};return db[_0x9c4a('0x38')]['count'](_0x2d4c62)[_0x9c4a('0x21')](function(_0x4e78e2){_0x361ace[_0x9c4a('0x2d')]=_0x4e78e2;if(_0x232dbf['query'][_0x9c4a('0x4e')]){_0xea8651[_0x9c4a('0x4f')]=[{'all':!![]}];}return db[_0x9c4a('0x38')][_0x9c4a('0x50')](_0xea8651);})[_0x9c4a('0x21')](function(_0x355614){_0x361ace['rows']=_0x355614;return _0x361ace;})['then'](respondWithFilteredResult(_0x496a2c,_0xea8651))[_0x9c4a('0x2a')](handleError(_0x496a2c,null));};exports[_0x9c4a('0x51')]=function(_0x2ce55f,_0x4f3eb8){var _0x27d926={'raw':!![],'where':{'id':_0x2ce55f[_0x9c4a('0x52')]['id']}},_0xa4c096={};_0xa4c096[_0x9c4a('0x3a')]=_[_0x9c4a('0x3b')](db[_0x9c4a('0x38')][_0x9c4a('0x39')]);_0xa4c096[_0x9c4a('0x3c')]=_['keys'](_0x2ce55f['query']);_0xa4c096['filters']=_[_0x9c4a('0x3f')](_0xa4c096[_0x9c4a('0x3a')],_0xa4c096[_0x9c4a('0x3c')]);_0x27d926[_0x9c4a('0x3e')]=_[_0x9c4a('0x3f')](_0xa4c096['model'],qs['fields'](_0x2ce55f['query'][_0x9c4a('0x40')]));_0x27d926[_0x9c4a('0x3e')]=_0x27d926[_0x9c4a('0x3e')][_0x9c4a('0x41')]?_0x27d926[_0x9c4a('0x3e')]:_0xa4c096[_0x9c4a('0x3a')];if(_0x2ce55f[_0x9c4a('0x3c')]['includeAll']){_0x27d926['include']=[{'all':!![]}];}_0x27d926=_[_0x9c4a('0x48')]({},_0x27d926,_0x2ce55f[_0x9c4a('0x4d')]);return db[_0x9c4a('0x38')]['find'](_0x27d926)[_0x9c4a('0x21')](handleEntityNotFound(_0x4f3eb8,null))['then'](respondWithResult(_0x4f3eb8,null))['catch'](handleError(_0x4f3eb8,null));};exports[_0x9c4a('0x53')]=function(_0x26507d,_0x167432){return db['ChatGroup']['create'](_0x26507d[_0x9c4a('0x54')],{})[_0x9c4a('0x21')](respondWithResult(_0x167432,0xc9))[_0x9c4a('0x2a')](handleError(_0x167432,null));};exports[_0x9c4a('0x55')]=function(_0x4d7424,_0x259606){if(_0x4d7424['body']['id']){delete _0x4d7424[_0x9c4a('0x54')]['id'];}return db[_0x9c4a('0x38')][_0x9c4a('0x56')]({'where':{'id':_0x4d7424[_0x9c4a('0x52')]['id']}})[_0x9c4a('0x21')](handleEntityNotFound(_0x259606,null))[_0x9c4a('0x21')](saveUpdates(_0x4d7424[_0x9c4a('0x54')],null))['then'](respondWithResult(_0x259606,null))[_0x9c4a('0x2a')](handleError(_0x259606,null));};exports['destroy']=function(_0x4805cf,_0x5a6cf8){return db[_0x9c4a('0x38')][_0x9c4a('0x56')]({'where':{'id':_0x4805cf[_0x9c4a('0x52')]['id']}})[_0x9c4a('0x21')](handleEntityNotFound(_0x5a6cf8,null))[_0x9c4a('0x21')](removeEntity(_0x5a6cf8,null))[_0x9c4a('0x2a')](handleError(_0x5a6cf8,null));};exports[_0x9c4a('0x57')]=function(_0x397d28,_0x54d807){return db[_0x9c4a('0x38')][_0x9c4a('0x57')]()[_0x9c4a('0x21')](respondWithResult(_0x54d807,null))[_0x9c4a('0x2a')](handleError(_0x54d807,null));};exports[_0x9c4a('0x58')]=function(_0x35dac5,_0x535270,_0x1d3ac2){return db['ChatInternalMessage'][_0x9c4a('0x2d')]({'where':{'ChatGroupId':_0x35dac5[_0x9c4a('0x52')]['id'],'ToId':_0x35dac5[_0x9c4a('0x59')]['id'],'read':![]}})[_0x9c4a('0x21')](function(_0x5e4c6b){return{'id':_['toInteger'](_0x35dac5['params']['id']),'count':_0x5e4c6b};})['then'](respondWithResult(_0x535270,null))[_0x9c4a('0x2a')](handleError(_0x535270,null));};exports[_0x9c4a('0x5a')]=function(_0x1ad6e1,_0x155c6c,_0x2c64bb){return db[_0x9c4a('0x38')][_0x9c4a('0x56')]({'where':{'id':_0x1ad6e1[_0x9c4a('0x52')]['id']}})[_0x9c4a('0x21')](handleEntityNotFound(_0x155c6c,null))['then'](function(_0x59ca1e){if(_0x59ca1e){return _0x59ca1e[_0x9c4a('0x5a')](_0x1ad6e1['body']['ids'],_[_0x9c4a('0x5b')](_0x1ad6e1[_0x9c4a('0x54')],[_0x9c4a('0x5c'),'id'])||{});}})[_0x9c4a('0x21')](respondWithResult(_0x155c6c,null))['catch'](handleError(_0x155c6c,null));};exports['getMembers']=function(_0x3850e7,_0x47cbad,_0x5c2e91){var _0x2feb94={};var _0x862c09={};var _0x2c04dd;var _0x233e91;return db[_0x9c4a('0x38')][_0x9c4a('0x5d')]({'where':{'id':_0x3850e7[_0x9c4a('0x52')]['id']}})[_0x9c4a('0x21')](handleEntityNotFound(_0x47cbad,null))[_0x9c4a('0x21')](function(_0x221046){if(_0x221046){_0x2c04dd=_0x221046;_0x862c09[_0x9c4a('0x3a')]=_[_0x9c4a('0x3b')](db[_0x9c4a('0x5e')][_0x9c4a('0x39')]);_0x862c09[_0x9c4a('0x3c')]=_[_0x9c4a('0x3b')](_0x3850e7[_0x9c4a('0x3c')]);_0x862c09[_0x9c4a('0x3d')]=_['intersection'](_0x862c09[_0x9c4a('0x3a')],_0x862c09[_0x9c4a('0x3c')]);_0x2feb94['attributes']=_['intersection'](_0x862c09[_0x9c4a('0x3a')],qs[_0x9c4a('0x40')](_0x3850e7['query'][_0x9c4a('0x40')]));_0x2feb94[_0x9c4a('0x3e')]=_0x2feb94[_0x9c4a('0x3e')][_0x9c4a('0x41')]?_0x2feb94[_0x9c4a('0x3e')]:_0x862c09[_0x9c4a('0x3a')];_0x2feb94[_0x9c4a('0x43')]=qs[_0x9c4a('0x44')](_0x3850e7['query'][_0x9c4a('0x44')]);_0x2feb94[_0x9c4a('0x45')]=qs['filters'](_[_0x9c4a('0x46')](_0x3850e7['query'],_0x862c09['filters']));if(_0x3850e7[_0x9c4a('0x3c')][_0x9c4a('0x47')]){_0x2feb94[_0x9c4a('0x45')]=_[_0x9c4a('0x48')](_0x2feb94['where'],{'$or':_[_0x9c4a('0x5f')](_0x2feb94['attributes'],function(_0x18ca92){var _0x3f4647={};_0x3f4647[_0x18ca92]={'$like':'%'+_0x3850e7['query'][_0x9c4a('0x47')]+'%'};return _0x3f4647;})});}_0x2feb94=_['merge']({},_0x2feb94,_0x3850e7[_0x9c4a('0x4d')]);return _0x2c04dd[_0x9c4a('0x60')](_0x2feb94);}})['then'](function(_0x3fca7e){if(_0x3fca7e){_0x233e91=_0x3fca7e['length'];if(!_0x3850e7['query']['hasOwnProperty'](_0x9c4a('0x61'))){_0x2feb94['limit']=qs['limit'](_0x3850e7[_0x9c4a('0x3c')]['limit']);_0x2feb94[_0x9c4a('0x2e')]=qs['offset'](_0x3850e7[_0x9c4a('0x3c')][_0x9c4a('0x2e')]);}return _0x2c04dd['getMembers'](_0x2feb94);}})[_0x9c4a('0x21')](function(_0x102954){if(_0x102954){return _0x102954?{'count':_0x233e91,'rows':_0x102954}:null;}})[_0x9c4a('0x21')](respondWithResult(_0x47cbad,null))['catch'](handleError(_0x47cbad,null));};exports[_0x9c4a('0x62')]=function(_0x22eb94,_0x1c60a3,_0x3106be){return db[_0x9c4a('0x38')][_0x9c4a('0x56')]({'where':{'id':_0x22eb94['params']['id']}})[_0x9c4a('0x21')](handleEntityNotFound(_0x1c60a3,null))[_0x9c4a('0x21')](function(_0x810649){if(_0x810649){return _0x810649[_0x9c4a('0x62')](_0x22eb94[_0x9c4a('0x3c')][_0x9c4a('0x5c')]);}})[_0x9c4a('0x21')](respondWithStatusCode(_0x1c60a3,null))[_0x9c4a('0x2a')](handleError(_0x1c60a3,null));};exports['addMessage']=function(_0x4e05fc,_0x1c4e2a,_0xd3612){if(_0x4e05fc['body']['id']){delete _0x4e05fc['body']['id'];}return db['ChatGroup'][_0x9c4a('0x56')]({'where':{'id':_0x4e05fc['params']['id']}})['then'](handleEntityNotFound(_0x1c4e2a,null))[_0x9c4a('0x21')](function(_0x4e4d74){if(_0x4e4d74){_0x4e05fc[_0x9c4a('0x54')]['ChatGroupId']=_0x4e4d74['id'];return db['ChatInternalMessage'][_0x9c4a('0x53')](_0x4e05fc[_0x9c4a('0x54')]);}})[_0x9c4a('0x21')](respondWithResult(_0x1c4e2a,null))[_0x9c4a('0x2a')](handleError(_0x1c4e2a,null));};exports[_0x9c4a('0x63')]=function(_0x253d78,_0x19d3e4,_0x348e48){var _0x39001a={};var _0x47c1f5={};var _0x4956c5;var _0x587c5e;return db[_0x9c4a('0x38')][_0x9c4a('0x5d')]({'where':{'id':_0x253d78[_0x9c4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x19d3e4,null))[_0x9c4a('0x21')](function(_0x2b7fba){if(_0x2b7fba){_0x4956c5=_0x2b7fba;_0x47c1f5[_0x9c4a('0x3a')]=_[_0x9c4a('0x3b')](db[_0x9c4a('0x64')][_0x9c4a('0x39')]);_0x47c1f5[_0x9c4a('0x3c')]=_[_0x9c4a('0x3b')](_0x253d78[_0x9c4a('0x3c')]);_0x47c1f5[_0x9c4a('0x3d')]=_[_0x9c4a('0x3f')](_0x47c1f5[_0x9c4a('0x3a')],_0x47c1f5[_0x9c4a('0x3c')]);_0x39001a[_0x9c4a('0x3e')]=_[_0x9c4a('0x3f')](_0x47c1f5['model'],qs[_0x9c4a('0x40')](_0x253d78[_0x9c4a('0x3c')][_0x9c4a('0x40')]));_0x39001a[_0x9c4a('0x3e')]=_0x39001a[_0x9c4a('0x3e')][_0x9c4a('0x41')]?_0x39001a[_0x9c4a('0x3e')]:_0x47c1f5['model'];_0x39001a['order']=qs[_0x9c4a('0x44')](_0x253d78['query'][_0x9c4a('0x44')]);_0x39001a[_0x9c4a('0x45')]=qs[_0x9c4a('0x3d')](_[_0x9c4a('0x46')](_0x253d78[_0x9c4a('0x3c')],_0x47c1f5[_0x9c4a('0x3d')]));if(_0x253d78[_0x9c4a('0x3c')]['filter']){_0x39001a['where']=_[_0x9c4a('0x48')](_0x39001a[_0x9c4a('0x45')],{'$or':_[_0x9c4a('0x5f')](_0x39001a[_0x9c4a('0x3e')],function(_0x5d0f83){var _0x1bf6d5={};_0x1bf6d5[_0x5d0f83]={'$like':'%'+_0x253d78['query'][_0x9c4a('0x47')]+'%'};return _0x1bf6d5;})});}if(_0x253d78['query'][_0x9c4a('0x65')]){var _0x4d00c7=_0x253d78[_0x9c4a('0x3c')][_0x9c4a('0x65')]['split'](',');var _0x3a07ed={};_0x3a07ed[_0x4d00c7[0x0]]={'$gte':moment(_0x4d00c7[0x1])[_0x9c4a('0x66')](_0x9c4a('0x67'))};_0x39001a[_0x9c4a('0x45')]=_[_0x9c4a('0x48')](_0x39001a[_0x9c4a('0x45')],_0x3a07ed);}_0x39001a=_['merge']({},_0x39001a,_0x253d78['options']);return _0x4956c5[_0x9c4a('0x63')](_0x39001a);}})[_0x9c4a('0x21')](function(_0x4e0fb3){if(_0x4e0fb3){_0x587c5e=_0x4e0fb3[_0x9c4a('0x41')];if(!_0x253d78[_0x9c4a('0x3c')]['hasOwnProperty']('nolimit')){_0x39001a['limit']=qs[_0x9c4a('0x2f')](_0x253d78[_0x9c4a('0x3c')][_0x9c4a('0x2f')]);_0x39001a[_0x9c4a('0x2e')]=qs[_0x9c4a('0x2e')](_0x253d78[_0x9c4a('0x3c')][_0x9c4a('0x2e')]);}return _0x4956c5[_0x9c4a('0x63')](_0x39001a);}})[_0x9c4a('0x21')](function(_0x21297e){if(_0x21297e){return _0x21297e?{'count':_0x587c5e,'rows':_0x21297e}:null;}})[_0x9c4a('0x21')](respondWithResult(_0x19d3e4,null))['catch'](handleError(_0x19d3e4,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ef8a5c4..150a25d 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 _0x7c56=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c56,0x1c1));var _0x67c5=function(_0x516624,_0xa45106){_0x516624=_0x516624-0x0;var _0x47f2b4=_0x7c56[_0x516624];return _0x47f2b4;};'use strict';var EventEmitter=require(_0x67c5('0x0'));var ChatGroup=require(_0x67c5('0x1'))['db'][_0x67c5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x67c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x67c5('0x4'),'afterDestroy':_0x67c5('0x5')};function emitEvent(_0x1cd457){return function(_0x2680f8,_0x56ab99,_0x4e6bd3){ChatGroupEvents[_0x67c5('0x6')](_0x1cd457+':'+_0x2680f8['id'],_0x2680f8);ChatGroupEvents[_0x67c5('0x6')](_0x1cd457,_0x2680f8);_0x4e6bd3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x67c5('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x5a4f=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5a4f,0x12f));var _0xf5a4=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x5a4f[_0x1ccdf7];return _0x52a0ae;};'use strict';var EventEmitter=require(_0xf5a4('0x0'));var ChatGroup=require(_0xf5a4('0x1'))['db'][_0xf5a4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5a4('0x3')](0x0);var events={'afterCreate':_0xf5a4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3e6149){return function(_0x3a17b3,_0x1bd655,_0x1433a0){ChatGroupEvents[_0xf5a4('0x5')](_0x3e6149+':'+_0x3a17b3['id'],_0x3a17b3);ChatGroupEvents[_0xf5a4('0x5')](_0x3e6149,_0x3a17b3);_0x1433a0(null);};}for(var e in events){if(events[_0xf5a4('0x6')](e)){var event=events[e];ChatGroup[_0xf5a4('0x7')](e,emitEvent(event));}}module[_0xf5a4('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 8fafc5a..4aab80e 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 _0x9b08=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger'];(function(_0x14017d,_0x346fdf){var _0x37d4aa=function(_0x3112a8){while(--_0x3112a8){_0x14017d['push'](_0x14017d['shift']());}};_0x37d4aa(++_0x346fdf);}(_0x9b08,0x176));var _0x89b0=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x9b08[_0x172133];return _0x2460e5;};'use strict';var _=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var logger=require(_0x89b0('0x2'))(_0x89b0('0x3'));var moment=require('moment');var BPromise=require(_0x89b0('0x4'));var rp=require(_0x89b0('0x5'));var fs=require('fs');var path=require(_0x89b0('0x6'));var rimraf=require(_0x89b0('0x7'));var config=require(_0x89b0('0x8'));var attributes=require(_0x89b0('0x9'));module[_0x89b0('0xa')]=function(_0x42ad7e,_0x310696){return _0x42ad7e[_0x89b0('0xb')]('ChatGroup',attributes,{'tableName':_0x89b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6c5=['./chatGroup.attributes','exports','ChatGroup','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa6c5,0x17d));var _0x5a6c=function(_0x25806f,_0x16dbdd){_0x25806f=_0x25806f-0x0;var _0x163f12=_0xa6c5[_0x25806f];return _0x163f12;};'use strict';var _=require(_0x5a6c('0x0'));var util=require(_0x5a6c('0x1'));var logger=require(_0x5a6c('0x2'))(_0x5a6c('0x3'));var moment=require('moment');var BPromise=require(_0x5a6c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5a6c('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a6c('0x6'));module[_0x5a6c('0x7')]=function(_0x133bbf,_0x28285e){return _0x133bbf['define'](_0x5a6c('0x8'),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 e41b5cb..5196a6c 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 _0x524a=['jayson/promise','client','redis','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x2b5a53,_0xf9ae50){var _0x3dd5ad=function(_0x348731){while(--_0x348731){_0x2b5a53['push'](_0x2b5a53['shift']());}};_0x3dd5ad(++_0xf9ae50);}(_0x524a,0xf5));var _0xa524=function(_0x2970d1,_0x3a1f17){_0x2970d1=_0x2970d1-0x0;var _0x56783e=_0x524a[_0x2970d1];return _0x56783e;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var moment=require(_0xa524('0x2'));var BPromise=require(_0xa524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa524('0x4'));var db=require(_0xa524('0x5'))['db'];var utils=require(_0xa524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa524('0x7'));var jayson=require(_0xa524('0x8'));var client=jayson[_0xa524('0x9')]['http']({'port':0x232a});config[_0xa524('0xa')]=_['defaults'](config[_0xa524('0xa')],{'host':_0xa524('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa524('0xa')]));require(_0xa524('0xc'))[_0xa524('0xd')](socket);function respondWithRpcPromise(_0x13076e,_0x3b484b,_0x4c467d){return new BPromise(function(_0x547433,_0x2ebea2){return client['request'](_0x13076e,_0x4c467d)['then'](function(_0x2fc0f9){logger[_0xa524('0xe')](_0xa524('0xf'),_0x3b484b,'request\x20sent');logger['debug'](_0xa524('0x10'),_0x3b484b,'request\x20sent',JSON[_0xa524('0x11')](_0x2fc0f9));if(_0x2fc0f9['error']){if(_0x2fc0f9[_0xa524('0x12')]['code']===0x1f4){logger[_0xa524('0x12')](_0xa524('0xf'),_0x3b484b,_0x2fc0f9['error'][_0xa524('0x13')]);return _0x2ebea2(_0x2fc0f9[_0xa524('0x12')][_0xa524('0x13')]);}logger[_0xa524('0x12')](_0xa524('0xf'),_0x3b484b,_0x2fc0f9[_0xa524('0x12')][_0xa524('0x13')]);return _0x547433(_0x2fc0f9['error'][_0xa524('0x13')]);}else{logger[_0xa524('0xe')](_0xa524('0xf'),_0x3b484b,_0xa524('0x14'));_0x547433(_0x2fc0f9[_0xa524('0x15')][_0xa524('0x13')]);}})[_0xa524('0x16')](function(_0x43b228){logger['error'](_0xa524('0xf'),_0x3b484b,_0x43b228);_0x2ebea2(_0x43b228);});});} \ No newline at end of file +var _0x0e85=['util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x15cc77,_0x106790){var _0x575cb2=function(_0x37ca28){while(--_0x37ca28){_0x15cc77['push'](_0x15cc77['shift']());}};_0x575cb2(++_0x106790);}(_0x0e85,0x7c));var _0x50e8=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x0e85[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('ChatGroup,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ea2ce66..fa08bac 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 _0x636f=['length','chatGroup:','remove','update','removeListener','register'];(function(_0x37ba4d,_0xe9c438){var _0x533e57=function(_0x30efe0){while(--_0x30efe0){_0x37ba4d['push'](_0x37ba4d['shift']());}};_0x533e57(++_0xe9c438);}(_0x636f,0x188));var _0xf636=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x636f[_0x501510];return _0x1e6ee5;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xf636('0x0'),_0xf636('0x1')];function createListener(_0x17e637,_0x42cf1c){return function(_0x20d16a){_0x42cf1c['emit'](_0x17e637,_0x20d16a);};}function removeListener(_0x29ac70,_0x1479ae){return function(){ChatGroupEvents[_0xf636('0x2')](_0x29ac70,_0x1479ae);};}exports[_0xf636('0x3')]=function(_0x39c5f1){for(var _0x526990=0x0,_0xdae985=events[_0xf636('0x4')];_0x526990<_0xdae985;_0x526990++){var _0x2da859=events[_0x526990];var _0x3f6dfb=createListener(_0xf636('0x5')+_0x2da859,_0x39c5f1);ChatGroupEvents['on'](_0x2da859,_0x3f6dfb);}}; \ No newline at end of file +var _0xbf6e=['remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0xfb8f31,_0x2d3880){var _0x28b6e0=function(_0x4a3f1e){while(--_0x4a3f1e){_0xfb8f31['push'](_0xfb8f31['shift']());}};_0x28b6e0(++_0x2d3880);}(_0xbf6e,0x149));var _0xebf6=function(_0x2e78db,_0x5ab8a1){_0x2e78db=_0x2e78db-0x0;var _0x195fb4=_0xbf6e[_0x2e78db];return _0x195fb4;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xebf6('0x0'),_0xebf6('0x1')];function createListener(_0x14bf01,_0x440a55){return function(_0x473e65){_0x440a55[_0xebf6('0x2')](_0x14bf01,_0x473e65);};}function removeListener(_0x5c2323,_0x49de28){return function(){ChatGroupEvents[_0xebf6('0x3')](_0x5c2323,_0x49de28);};}exports[_0xebf6('0x4')]=function(_0x3b2bb6){for(var _0x1e15cf=0x0,_0x143344=events[_0xebf6('0x5')];_0x1e15cf<_0x143344;_0x1e15cf++){var _0x137e39=events[_0x1e15cf];var _0x548e9e=createListener(_0xebf6('0x6')+_0x137e39,_0x3b2bb6);ChatGroupEvents['on'](_0x137e39,_0x548e9e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 19536eb..52029c3 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 _0x75a3=['delete','destroy','removeMembers','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x75a3,0x1c6));var _0x375a=function(_0x40d675,_0xe3bf8c){_0x40d675=_0x40d675-0x0;var _0x249a99=_0x75a3[_0x40d675];return _0x249a99;};'use strict';var multer=require('multer');var util=require(_0x375a('0x0'));var path=require(_0x375a('0x1'));var timeout=require(_0x375a('0x2'));var express=require(_0x375a('0x3'));var router=express['Router']();var auth=require(_0x375a('0x4'));var interaction=require(_0x375a('0x5'));var config=require(_0x375a('0x6'));var controller=require(_0x375a('0x7'));router['get']('/',auth[_0x375a('0x8')](),controller[_0x375a('0x9')]);router[_0x375a('0xa')](_0x375a('0xb'),auth[_0x375a('0x8')](),controller[_0x375a('0xc')]);router[_0x375a('0xa')](_0x375a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x375a('0xa')](_0x375a('0xe'),auth[_0x375a('0x8')](),controller[_0x375a('0xf')]);router[_0x375a('0xa')](_0x375a('0x10'),auth[_0x375a('0x8')](),controller[_0x375a('0x11')]);router['get'](_0x375a('0x12'),auth[_0x375a('0x8')](),controller[_0x375a('0x13')]);router[_0x375a('0x14')]('/',auth[_0x375a('0x8')](),controller[_0x375a('0x15')]);router[_0x375a('0x14')](_0x375a('0x10'),auth[_0x375a('0x8')](),controller[_0x375a('0x16')]);router[_0x375a('0x14')](_0x375a('0x12'),auth[_0x375a('0x8')](),controller[_0x375a('0x17')]);router[_0x375a('0x18')](_0x375a('0xd'),auth['isAuthenticated'](),controller[_0x375a('0x19')]);router[_0x375a('0x1a')](_0x375a('0xd'),auth[_0x375a('0x8')](),controller[_0x375a('0x1b')]);router['delete'](_0x375a('0x10'),auth[_0x375a('0x8')](),controller[_0x375a('0x1c')]);module[_0x375a('0x1d')]=router; \ No newline at end of file +var _0xf675=['/:id/members','/:id/messages','getMessages','post','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/unread'];(function(_0x5159bf,_0x40053e){var _0xbf976b=function(_0x56ae92){while(--_0x56ae92){_0x5159bf['push'](_0x5159bf['shift']());}};_0xbf976b(++_0x40053e);}(_0xf675,0x128));var _0x5f67=function(_0x90e3d5,_0x3eea2b){_0x90e3d5=_0x90e3d5-0x0;var _0x5c2252=_0xf675[_0x90e3d5];return _0x5c2252;};'use strict';var multer=require('multer');var util=require(_0x5f67('0x0'));var path=require(_0x5f67('0x1'));var timeout=require(_0x5f67('0x2'));var express=require(_0x5f67('0x3'));var router=express[_0x5f67('0x4')]();var auth=require(_0x5f67('0x5'));var interaction=require(_0x5f67('0x6'));var config=require(_0x5f67('0x7'));var controller=require(_0x5f67('0x8'));router['get']('/',auth[_0x5f67('0x9')](),controller[_0x5f67('0xa')]);router['get'](_0x5f67('0xb'),auth[_0x5f67('0x9')](),controller[_0x5f67('0xc')]);router[_0x5f67('0xd')](_0x5f67('0xe'),auth[_0x5f67('0x9')](),controller['show']);router[_0x5f67('0xd')](_0x5f67('0xf'),auth[_0x5f67('0x9')](),controller['getUnread']);router['get'](_0x5f67('0x10'),auth[_0x5f67('0x9')](),controller['getMembers']);router['get'](_0x5f67('0x11'),auth[_0x5f67('0x9')](),controller[_0x5f67('0x12')]);router[_0x5f67('0x13')]('/',auth[_0x5f67('0x9')](),controller['create']);router['post']('/:id/members',auth[_0x5f67('0x9')](),controller['addMembers']);router[_0x5f67('0x13')](_0x5f67('0x11'),auth[_0x5f67('0x9')](),controller[_0x5f67('0x14')]);router[_0x5f67('0x15')]('/:id',auth[_0x5f67('0x9')](),controller[_0x5f67('0x16')]);router[_0x5f67('0x17')](_0x5f67('0xe'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x5f67('0x10'),auth[_0x5f67('0x9')](),controller[_0x5f67('0x18')]);module[_0x5f67('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index babc85d..fefa742 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 _0xe511=['star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','INTEGER'];(function(_0x516346,_0x3e799c){var _0x23fc9e=function(_0x180514){while(--_0x180514){_0x516346['push'](_0x516346['shift']());}};_0x23fc9e(++_0x3e799c);}(_0xe511,0x16f));var _0x1e51=function(_0x47c958,_0x3cfe09){_0x47c958=_0x47c958-0x0;var _0x573eab=_0xe511[_0x47c958];return _0x573eab;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1e51('0x6')]},'browserName':{'type':Sequelize[_0x1e51('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x1e51('0x6')]},'deviceModel':{'type':Sequelize[_0x1e51('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1e51('0x6')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1e51('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]}}; \ No newline at end of file +var _0xd8b0=['DATE','out','sequelize','exports','star','thumb','TEXT','STRING','long'];(function(_0x5d021f,_0x5c8765){var _0x5ae738=function(_0x5a654d){while(--_0x5a654d){_0x5d021f['push'](_0x5d021f['shift']());}};_0x5ae738(++_0x5c8765);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x2')},'ratingMessage':{'type':Sequelize[_0x0d8b('0x4')]},'pathTranscript':{'type':Sequelize[_0x0d8b('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x5')]},'note':{'type':Sequelize[_0x0d8b('0x5')]},'browserName':{'type':Sequelize[_0x0d8b('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0d8b('0x5')]},'osVersion':{'type':Sequelize[_0x0d8b('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x0d8b('0x5')]},'deviceType':{'type':Sequelize[_0x0d8b('0x5')]},'referer':{'type':Sequelize[_0x0d8b('0x5')]},'customerIp':{'type':Sequelize[_0x0d8b('0x5')]},'formData':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x6'))},'read1stAt':{'type':Sequelize[_0x0d8b('0x7')]},'lastMsgAt':{'type':Sequelize[_0x0d8b('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0d8b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ff300e1..a518e15 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 _0xb10b=['firstName','renderFile','views','downloadInteraction.html','transcript-','log','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','test','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','keys','createdAt','value','dateStart','startOf','day','utc','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','and','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20<\x20?','\x20IN\x20?','LIKE','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','push','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','Sequelize','QueryTypes','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','toString','count','keyBy','merge','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','map','groupBy','ChatInteractionId','all','rows','show','intersection','include','options','find','create','body','params','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','User','ChatWebsite','Messages','%s%d','agentAlias','System','Visitor','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','getMyMessages','findAll','setTags','omit','Tag','emit','chatInteractionTags:save','removeTags','download','unix','server','tmp','attachments','Contact','lastName','Account','Owner','get','10px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closed','closedAt','browserName','referer','customerIp','basename','existsSync','createReadStream','pipe','createWriteStream','out'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e6b83,_0x224b71){_0x3e6b83=_0x3e6b83-0x0;var _0x599977=_0xb10b[_0x3e6b83];return _0x599977;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');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('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x2f2ebf,_0x24a57b,_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e26f4[_0xbb10('0x20')](_0x24a57b)){return _0x2f2ebf;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2f2ebf;}}function respondWithRpcPromise(_0x2eca0f,_0x1145f1,_0x133ac2,_0x42db98){return new BPromise(function(_0x378da8,_0x1682a4){var _0x575cca=_0x42db98||client;return _0x575cca[_0xbb10('0x21')](_0x2eca0f,_0x133ac2)[_0xbb10('0x22')](function(_0xe1c665){logger['info'](_0xbb10('0x23'),_0x1145f1,_0xbb10('0x24'));logger[_0xbb10('0x25')](_0xbb10('0x26'),_0x1145f1,_0xbb10('0x24'),JSON[_0xbb10('0x27')](_0xe1c665));if(_0xe1c665['error']){if(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1145f1,_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1682a4(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x23'),_0x1145f1,_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x378da8(_0xe1c665[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x2b')](_0xbb10('0x23'),_0x1145f1,'request\x20sent');_0x378da8(_0xe1c665['result']['message']);}})[_0xbb10('0x2c')](function(_0x3c5ae7){logger[_0xbb10('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x1145f1,_0x3c5ae7);_0x1682a4(_0x3c5ae7);});});}function respondWithStatusCode(_0x2fdde9,_0x24d586){_0x24d586=_0x24d586||0xcc;return function(_0x6ed43b){if(_0x6ed43b){return _0x2fdde9[_0xbb10('0x2d')](_0x24d586);}return _0x2fdde9[_0xbb10('0x2e')](_0x24d586)[_0xbb10('0x2f')]();};}function respondWithResult(_0x2a0e8b,_0x4aabb9){_0x4aabb9=_0x4aabb9||0xc8;return function(_0x3796c7){if(_0x3796c7){return _0x2a0e8b[_0xbb10('0x2e')](_0x4aabb9)[_0xbb10('0x30')](_0x3796c7);}};}function respondWithFilteredResult(_0x2e0249,_0x1d30aa){return function(_0x2ff4c1){if(_0x2ff4c1){var _0x5d5c80=_0x2ff4c1['count'],_0x221624=_0x1d30aa[_0xbb10('0x31')],_0x4ee02e=_0x1d30aa[_0xbb10('0x31')]+_0x1d30aa[_0xbb10('0x32')],_0x448d5c;if(_0x4ee02e>=_0x5d5c80){_0x4ee02e=_0x5d5c80;_0x448d5c=0xc8;}else{_0x448d5c=0xce;}_0x2e0249['status'](_0x448d5c);return _0x2e0249['set'](_0xbb10('0x33'),_0x221624+'-'+_0x4ee02e+'/'+_0x5d5c80)[_0xbb10('0x30')](_0x2ff4c1);}return null;};}function patchUpdates(_0x4f590d){return function(_0x359ad4){try{jsonpatch[_0xbb10('0x34')](_0x359ad4,_0x4f590d,!![]);}catch(_0x2f653f){return BPromise[_0xbb10('0x35')](_0x2f653f);}return _0x359ad4[_0xbb10('0x36')]();};}function saveUpdates(_0x138bc6,_0xf85197){return function(_0x4975f5){if(_0x4975f5){return _0x4975f5[_0xbb10('0x37')](_0x138bc6)[_0xbb10('0x22')](function(_0x441d15){return _0x441d15;});}return null;};}function removeEntity(_0x8c1ce6,_0xfb2c5e){return function(_0x9de708){if(_0x9de708){return _0x9de708[_0xbb10('0x38')]()[_0xbb10('0x22')](function(){_0x8c1ce6[_0xbb10('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5352,_0x150107){return function(_0x1ddd9e){if(!_0x1ddd9e){_0x2b5352[_0xbb10('0x2d')](0x194);}return _0x1ddd9e;};}function handleError(_0x570f5a,_0x111762){_0x111762=_0x111762||0x1f4;return function(_0x5de37b){logger['error'](_0x5de37b[_0xbb10('0x39')]);if(_0x5de37b[_0xbb10('0x3a')]){delete _0x5de37b[_0xbb10('0x3a')];}_0x570f5a[_0xbb10('0x2e')](_0x111762)[_0xbb10('0x3b')](_0x5de37b);};}function getInteractionUsers(_0x29d11a,_0x547062){return new BPromise(function(_0x1e5bbd,_0x25d72f){try{if(_0x547062[_0x29d11a['id']]){_0x29d11a['Users']=_['map'](_0x547062[_0x29d11a['id']],function(_0x5cd55f){return{'id':_0x5cd55f['id']};});}}catch(_0x31bee3){_0x25d72f(_0x31bee3);}_0x1e5bbd(_0x29d11a);});}function getInteractionTags(_0x2b0b45,_0x2b658a){return new BPromise(function(_0x4d5a9b,_0x3c0cd7){try{if(_0x2b0b45[_0xbb10('0x3c')]){_0x2b0b45[_0xbb10('0x3d')]=[];_0x2b0b45['TagIds'][_0xbb10('0x3e')](',')[_0xbb10('0x3f')](function(_0x1dcd38){_0x2b0b45[_0xbb10('0x3d')]['push'](_0x2b658a[_0x1dcd38]);});}delete _0x2b0b45[_0xbb10('0x3c')];}catch(_0x110eb5){_0x3c0cd7(_0x110eb5);}_0x4d5a9b(_0x2b0b45);});}function updateChatInteraction(_0x5835fd,_0xe2040f,_0x2e3214){return new BPromise(function(_0x44d6ae,_0x3a9934){return getInteractionUsers(_0x5835fd,_0x2e3214)[_0xbb10('0x22')](function(_0x185a52){return getInteractionTags(_0x185a52,_0xe2040f);})['then'](function(_0x1e8f79){_0x44d6ae(_0x1e8f79);})[_0xbb10('0x2c')](function(_0x3e7b4c){_0x3a9934(_0x3e7b4c);});});}exports[_0xbb10('0x40')]=function(_0x4943d9,_0x3fff6c){var _0x331751={},_0x23dc18={},_0x403beb={'count':0x0,'rows':[]};var _0x5e2cfa=db[_0xbb10('0x41')][_0xbb10('0x42')];_0x23dc18['model']=_['keys'](_0x5e2cfa);_0x23dc18[_0xbb10('0x43')]=_['keys'](_0x4943d9[_0xbb10('0x43')]);_0x23dc18[_0xbb10('0x44')]=_['intersection'](_0x23dc18[_0xbb10('0x45')],_0x23dc18[_0xbb10('0x43')]);_0x331751[_0xbb10('0x46')]=_['intersection'](_0x23dc18[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x47')]));_0x331751[_0xbb10('0x46')]=_0x331751[_0xbb10('0x46')][_0xbb10('0x48')]?_0x331751[_0xbb10('0x46')]:_0x23dc18[_0xbb10('0x45')];if(!_0x4943d9[_0xbb10('0x43')][_0xbb10('0x49')](_0xbb10('0x4a'))){_0x331751['limit']=qs[_0xbb10('0x32')](_0x4943d9[_0xbb10('0x43')]['limit']);_0x331751[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x31')]);}_0x331751[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x4943d9[_0xbb10('0x43')]['sort']);_0x331751['where']=qs[_0xbb10('0x44')](_[_0xbb10('0x4d')](_0x4943d9[_0xbb10('0x43')],_0x23dc18['filters']));var _0x5f0c12=[];var _0x3cd6f3=squel[_0xbb10('0x4e')]()[_0xbb10('0x4f')]('id')[_0xbb10('0x4f')](_0xbb10('0x3a'))[_0xbb10('0x4f')](_0xbb10('0x50'))[_0xbb10('0x51')](_0xbb10('0x52'));var _0x3d7e7e=squel['select']()['field'](_0xbb10('0x53'))[_0xbb10('0x51')](_0xbb10('0x54'),'me')[_0xbb10('0x55')](_0xbb10('0x56'))[_0xbb10('0x55')](_0xbb10('0x57'))[_0xbb10('0x55')](_0xbb10('0x58'));var _0x1214f7=squel[_0xbb10('0x4e')]()[_0xbb10('0x4f')](_0xbb10('0x59'))[_0xbb10('0x4f')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'),'ui')['left_join'](_0xbb10('0x5c'),'u',_0xbb10('0x5d'));var _0x1ffe20=squel[_0xbb10('0x4e')]()[_0xbb10('0x51')](_0xbb10('0x5e'),'i')[_0xbb10('0x5f')](_0xbb10('0x60'),'c',_0xbb10('0x61'))[_0xbb10('0x5f')](_0xbb10('0x5c'),'o',_0xbb10('0x62'))[_0xbb10('0x5f')](_0xbb10('0x63'),'a',_0xbb10('0x64'))['left_join'](_0xbb10('0x54'),'me',_0xbb10('0x65'));var _0x1b83a9=squel[_0xbb10('0x66')]();if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x67')]){var _0xb25e71=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x67')]);_[_0xbb10('0x69')](_0xb25e71)[_0xbb10('0x3f')](function(_0x22de7f){var _0x175872=_0xb25e71[_0x22de7f];if(_0x22de7f===_0xbb10('0x6a')){var _0x205e01=moment(_0x175872[_0xbb10('0x6b')][_0xbb10('0x6c')])[_0xbb10('0x6d')](_0xbb10('0x6e'))['utc']()['format']();var _0x16272d=moment(_0x16272d)[_0xbb10('0x6f')]()[_0xbb10('0x70')](_0xbb10('0x6e'))['format']();_0x1b83a9['and'](_0xbb10('0x71'),_0x205e01,_0x16272d);}else{if(_[_0xbb10('0x72')](_0x175872[_0xbb10('0x73')])){_0x175872[_0xbb10('0x73')][_0xbb10('0x3f')](function(_0x3e9753){switch(_0x175872[_0xbb10('0x73')]['value']){case'IS':if(_0x22de7f!==_0xbb10('0x74')&&_0x22de7f!==_0xbb10('0x75')){if(_['isArray'](_0x175872['value'])&&_0x175872['value'][_0xbb10('0x48')]>0x1){_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20IN\x20?',_0x175872['value']);}else{_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872[_0xbb10('0x6b')][0x0]);}}break;case'=':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872['value']);break;case'LIKE':if(_0x22de7f===_0xbb10('0x79')){_0x1b83a9[_0xbb10('0x76')](_0xbb10('0x7a')+_0xbb10('0x7b'),'%'+_0x175872['value']+'%');_0x1b83a9['or'](_0xbb10('0x7c')+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');_0x1b83a9['or']('c.email'+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}else{_0x1b83a9[_0xbb10('0x76')](_0x175872['tableAlias']+'.'+_0x22de7f+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}break;case'>':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20>\x20?',_0x175872[_0xbb10('0x6b')]);break;case'<':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7d'),_0x175872['value']);break;}});}else{switch(_0x175872[_0xbb10('0x73')][_0xbb10('0x6b')]){case'IS':if(_0x22de7f!==_0xbb10('0x74')&&_0x22de7f!==_0xbb10('0x75')){if(_[_0xbb10('0x72')](_0x175872[_0xbb10('0x6b')])&&_0x175872[_0xbb10('0x6b')]['length']>0x1){_0x1b83a9['and'](_0x175872['tableAlias']+'.'+_0x22de7f+_0xbb10('0x7e'),_0x175872[_0xbb10('0x6b')]);}else{_0x1b83a9[_0xbb10('0x76')](_0x175872['tableAlias']+'.'+_0x22de7f+'\x20=\x20?',_0x175872[_0xbb10('0x6b')][0x0]);}}break;case'=':_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x78'),_0x175872[_0xbb10('0x6b')]);break;case _0xbb10('0x7f'):if(_0x22de7f==='ContactId'){_0x1b83a9[_0xbb10('0x76')](_0xbb10('0x7a')+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');_0x1b83a9['or'](_0xbb10('0x7c')+'\x20LIKE\x20?','%'+_0x175872['value']+'%');_0x1b83a9['or']('c.email'+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}else{_0x1b83a9[_0xbb10('0x76')](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7b'),'%'+_0x175872[_0xbb10('0x6b')]+'%');}break;case'>':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+'\x20>\x20?',_0x175872['value']);break;case'<':_0x1b83a9['and'](_0x175872[_0xbb10('0x77')]+'.'+_0x22de7f+_0xbb10('0x7d'),_0x175872[_0xbb10('0x6b')]);break;}}}});}else{var _0x108f99=_(Object['keys'](_0x4943d9[_0xbb10('0x43')]))['map'](function(_0x576179){return _0x5e2cfa[_0xbb10('0x49')](_0x576179)?_0x576179:undefined;})[_0xbb10('0x80')](function(_0x29529c){return!_[_0xbb10('0x81')](_0x29529c);})[_0xbb10('0x6b')]();if(!_['isEmpty'](_0x108f99)){_0x108f99[_0xbb10('0x3f')](function(_0x19fcec){if(_0x19fcec===_0xbb10('0x82')){_0x1ffe20[_0xbb10('0x55')](_0xbb10('0x83'),[][_0xbb10('0x84')](_0x4943d9[_0xbb10('0x43')][_0x19fcec]));}else if(_0x19fcec==='createdAt'){var _0x387b10=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0x19fcec])[_0xbb10('0x85')];var _0x37b20e=JSON[_0xbb10('0x68')](_0x4943d9[_0xbb10('0x43')][_0x19fcec])[_0xbb10('0x86')];_0x1ffe20['where'](_0xbb10('0x71'),_0x387b10,_0x37b20e);}else{if(_0x4943d9[_0xbb10('0x43')][_0x19fcec]===_0xbb10('0x87')){_0x1ffe20['where']('i.'+_0x19fcec+'\x20IS\x20NULL');}else{_0x1ffe20['where']('i.'+_0x19fcec+_0xbb10('0x78'),_0x4943d9['query'][_0x19fcec]);}}});}if(_0x4943d9['query'][_0xbb10('0x80')]){var _0x3ee56b=_0x4943d9[_0xbb10('0x43')][_0xbb10('0x80')][_0xbb10('0x88')]('\x5c','\x5c\x5c')[_0xbb10('0x88')]('\x27\x27',_0xbb10('0x89'));if(qs[_0xbb10('0x8a')](_0x3ee56b)){_0x1b83a9['or'](_0xbb10('0x8b'),_0x3ee56b+'%');}else{var _0x5206e1=[];_0x3ee56b[_0xbb10('0x3e')]('\x20')[_0xbb10('0x3f')](function(_0x46b6d2){_0x5206e1[_0xbb10('0x8c')]('+'+_0x46b6d2['toString']());});var _0x4c0795=_0x5206e1[_0xbb10('0x8d')]('\x20');_0x1b83a9['or'](_0xbb10('0x8e'),_0x4c0795)['or'](_0xbb10('0x8f'),_0x3ee56b+'%');}}}_0x1ffe20[_0xbb10('0x55')](_0x1b83a9);if(_0x331751['order']){_0x331751[_0xbb10('0x4b')][_0xbb10('0x3f')](function(_0x3f0d74){_0x1ffe20[_0xbb10('0x4b')]('i.'+_0x3f0d74[0x0],_0x3f0d74[0x1]===_0xbb10('0x90')?![]:!![]);});}_0x1ffe20['group']('i.id');var _0x372636={'type':db[_0xbb10('0x91')][_0xbb10('0x92')]['SELECT'],'raw':!![]};var _0x256b35=_0x1ffe20[_0xbb10('0x93')]()['field']('COUNT(*)')[_0xbb10('0x4f')](_0xbb10('0x94'),_0xbb10('0x75'));if(!_0x4943d9['query'][_0xbb10('0x67')]){if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x95')]){if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x95')]==0x1){_0x256b35[_0xbb10('0x96')](_0xbb10('0x97'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x97'));}else{_0x256b35['having'](_0xbb10('0x98'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x98'));}}if(_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')]){var _0x39f64b=_[_0xbb10('0x72')](_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')])?_0x4943d9[_0xbb10('0x43')][_0xbb10('0x99')]:new Array(_0x4943d9[_0xbb10('0x43')]['tag']);var _0x51f106=squel[_0xbb10('0x66')]();_0x39f64b[_0xbb10('0x3f')](function(_0x458615){_0x51f106['or'](_0xbb10('0x9a'),'%,'+_0x458615+',%');});_0x1ffe20[_0xbb10('0x96')](_0x51f106);_0x256b35['left_join'](_0xbb10('0x9b'),'it',_0xbb10('0x9c'));_0x256b35[_0xbb10('0x5f')](_0xbb10('0x52'),'t',_0xbb10('0x9d'));_0x256b35[_0xbb10('0x55')]('t.id\x20IN\x20?',_0x39f64b);}}else{var _0xb25e71=JSON[_0xbb10('0x68')](_0x4943d9['query'][_0xbb10('0x67')]);_['keys'](_0xb25e71)[_0xbb10('0x3f')](function(_0x28bd76){var _0x2b473c=_0xb25e71[_0x28bd76];if(_0x28bd76===_0xbb10('0x74')){var _0x3a4a6e=_0x2b473c['value'];var _0x10d91d=squel['expr']();_0x3a4a6e[_0xbb10('0x3f')](function(_0x37ec93){_0x10d91d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37ec93+',%');});_0x1ffe20['having'](_0x10d91d);_0x256b35[_0xbb10('0x5f')](_0xbb10('0x9e'),'it',_0xbb10('0x9f'));_0x256b35[_0xbb10('0x5f')](_0xbb10('0x52'),'t',_0xbb10('0x9d'));_0x256b35[_0xbb10('0x55')](_0xbb10('0xa0'),_0x3a4a6e);}else if(_0x28bd76===_0xbb10('0x75')){if(_0x2b473c[_0xbb10('0x6b')][_0xbb10('0x48')]===0x1){if(_0x2b473c['value'][0x0]===0x1){_0x256b35[_0xbb10('0x96')](_0xbb10('0x97'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x97'));}else{_0x256b35[_0xbb10('0x96')](_0xbb10('0x98'));_0x1ffe20[_0xbb10('0x96')](_0xbb10('0x98'));}}}});}db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x256b35[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x499b9d){_0x403beb[_0xbb10('0xa3')]=_0x499b9d['length'];if(_0x403beb[_0xbb10('0xa3')]===0x0)return[];return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x3cd6f3[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x5371d4){_0x5f0c12=_[_0xbb10('0xa4')](_0x5371d4,'id');_0x372636=_[_0xbb10('0xa5')](_0x372636,{'model':db[_0xbb10('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0x94'),_0xbb10('0x75'));_0x1ffe20['field']('a.key',_0xbb10('0xa6'));_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xa7'));_0x1ffe20['field'](_0xbb10('0x7a'),_0xbb10('0xa8'));_0x1ffe20['field'](_0xbb10('0x7c'),_0xbb10('0xa9'));_0x1ffe20['field'](_0xbb10('0xaa'),'Contact.email');_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xab'),'Contact.phone');_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xac'),'Contact.mobile');_0x1ffe20['field'](_0xbb10('0xad'),_0xbb10('0xae'));_0x1ffe20[_0xbb10('0x4f')](_0xbb10('0xaf'),_0xbb10('0x3c'));_0x1ffe20['left_join'](_0xbb10('0x9b'),'it',_0xbb10('0x9c'));_0x1ffe20[_0xbb10('0x5f')]('tools_tags','t',_0xbb10('0x9d'));_0x1ffe20[_0xbb10('0x32')](_0x331751[_0xbb10('0x32')]);_0x1ffe20[_0xbb10('0x31')](_0x331751[_0xbb10('0x31')]);return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x1ffe20[_0xbb10('0xa2')](),_0x372636);})[_0xbb10('0x22')](function(_0x5f1fcd){_0x1214f7['where'](_0xbb10('0xb0'),_[_0xbb10('0xb1')](_0x5f1fcd,'id'));return db[_0xbb10('0xa1')][_0xbb10('0x43')](_0x1214f7[_0xbb10('0xa2')](),_0x372636)[_0xbb10('0x22')](function(_0x1cccec){var _0x1674f7=_[_0xbb10('0xb2')](_0x1cccec,_0xbb10('0xb3'));var _0xcbaf69=[];_0x5f1fcd[_0xbb10('0x3f')](function(_0x2c6d2c){_0xcbaf69['push'](updateChatInteraction(_0x2c6d2c,_0x5f0c12,_0x1674f7));});return BPromise[_0xbb10('0xb4')](_0xcbaf69);});});})[_0xbb10('0x22')](function(_0x24076a){_0x403beb[_0xbb10('0xb5')]=_0x24076a;return _0x403beb;})[_0xbb10('0x22')](respondWithFilteredResult(_0x3fff6c,_0x331751))[_0xbb10('0x2c')](handleError(_0x3fff6c,null));};exports[_0xbb10('0xb6')]=function(_0x1421e2,_0x3c6c45){var _0x3c92f4={'raw':![],'where':{'id':_0x1421e2['params']['id']}},_0x2a1c53={};_0x2a1c53[_0xbb10('0x45')]=_['keys'](db[_0xbb10('0x41')][_0xbb10('0x42')]);_0x2a1c53[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x1421e2[_0xbb10('0x43')]);_0x2a1c53[_0xbb10('0x44')]=_['intersection'](_0x2a1c53[_0xbb10('0x45')],_0x2a1c53['query']);_0x3c92f4[_0xbb10('0x46')]=_[_0xbb10('0xb7')](_0x2a1c53[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x1421e2[_0xbb10('0x43')][_0xbb10('0x47')]));_0x3c92f4[_0xbb10('0x46')]=_0x3c92f4[_0xbb10('0x46')][_0xbb10('0x48')]?_0x3c92f4[_0xbb10('0x46')]:_0x2a1c53[_0xbb10('0x45')];if(_0x1421e2[_0xbb10('0x43')]['includeAll']){_0x3c92f4[_0xbb10('0xb8')]=[{'all':!![]}];}_0x3c92f4=_['merge']({},_0x3c92f4,_0x1421e2[_0xbb10('0xb9')]);return db[_0xbb10('0x41')][_0xbb10('0xba')](_0x3c92f4)[_0xbb10('0x22')](handleEntityNotFound(_0x3c6c45,null))[_0xbb10('0x22')](respondWithResult(_0x3c6c45,null))[_0xbb10('0x2c')](handleError(_0x3c6c45,null));};exports[_0xbb10('0xbb')]=function(_0x5e9888,_0x350657){return db['ChatInteraction']['create'](_0x5e9888[_0xbb10('0xbc')],{})[_0xbb10('0x22')](respondWithResult(_0x350657,0xc9))[_0xbb10('0x2c')](handleError(_0x350657,null));};exports[_0xbb10('0x37')]=function(_0x1fc4ec,_0x16b8c1){if(_0x1fc4ec['body']['id']){delete _0x1fc4ec[_0xbb10('0xbc')]['id'];}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x1fc4ec[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16b8c1,null))[_0xbb10('0x22')](saveUpdates(_0x1fc4ec['body'],null))[_0xbb10('0x22')](respondWithResult(_0x16b8c1,null))[_0xbb10('0x2c')](handleError(_0x16b8c1,null));};exports[_0xbb10('0x38')]=function(_0xa8b7c3,_0x31718f){return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0xa8b7c3['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x31718f,null))['then'](removeEntity(_0x31718f,null))[_0xbb10('0x2c')](handleError(_0x31718f,null));};exports['describe']=function(_0x4c8b68,_0x32183f){return db[_0xbb10('0x41')][_0xbb10('0xbe')]()[_0xbb10('0x22')](respondWithResult(_0x32183f,null))[_0xbb10('0x2c')](handleError(_0x32183f,null));};exports['customUpdate']=function(_0xa42b80,_0x565ddf){if(_0xa42b80['body']['id']){delete _0xa42b80['body']['id'];}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0xa42b80[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x565ddf,null))[_0xbb10('0x22')](saveUpdates(_0xa42b80['body'],null))[_0xbb10('0x22')](respondWithResult(_0x565ddf,null))[_0xbb10('0x2c')](handleError(_0x565ddf,null));};exports[_0xbb10('0xbf')]=function(_0x1bd1c1,_0x4b3b21,_0x37ff15){if(_0x1bd1c1[_0xbb10('0xbc')]['id']){delete _0x1bd1c1['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1bd1c1[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](function(_0x2ae3c6){if(!_0x2ae3c6){logger[_0xbb10('0x28')](_0xbb10('0xc0'),_0xbb10('0xbf'),0x194,_0xbb10('0xc1'));_0x4b3b21[_0xbb10('0x2d')](0x194);}else{if(_0x2ae3c6[_0xbb10('0xc2')]){throw new db[(_0xbb10('0x91'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x2ae3c6;})['then'](function(_0x3d4b89){if(_0x3d4b89){return _0x3d4b89[_0xbb10('0x37')]({'closed':_0x1bd1c1[_0xbb10('0xbc')]['closed'],'disposition':_0x1bd1c1[_0xbb10('0xbc')][_0xbb10('0xc3')]})[_0xbb10('0x22')](function(_0x290280){return _0x290280;});}})[_0xbb10('0x22')](function(_0x11279d){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1bd1c1[_0xbb10('0xbc')],client9004);})['then'](respondWithResult(_0x4b3b21,null))[_0xbb10('0x2c')](handleError(_0x4b3b21,null));};exports[_0xbb10('0xc4')]=function(_0x152ca9,_0x15dcde,_0x25ab18){_0x152ca9[_0xbb10('0xbc')][_0xbb10('0x3a')]=_0x152ca9[_0xbb10('0xc5')][_0xbb10('0xc6')];_0x152ca9[_0xbb10('0xbc')]['basename']=_0x152ca9[_0xbb10('0xc5')]['filename'];_0x152ca9[_0xbb10('0xbc')]['type']=_0x152ca9[_0xbb10('0xc5')][_0xbb10('0xc7')];return db[_0xbb10('0xc8')][_0xbb10('0xbb')](_0x152ca9['body'])[_0xbb10('0x22')](respondWithResult(_0x15dcde,0xc9))['catch'](handleError(_0x15dcde,null));};exports[_0xbb10('0xc9')]=function(_0x1b6b9f,_0xcdaf04,_0x5388dc){return db[_0xbb10('0x41')][_0xbb10('0xca')]({'where':{'id':_0x1b6b9f[_0xbb10('0xbd')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0xcdaf04,null))[_0xbb10('0x22')](function(_0x309ec1){if(_0x309ec1){if(_0x309ec1['closed']){return _0xcdaf04['status'](0x193)['json']({'status':0x193,'message':_0xbb10('0xcb')});}return db['Attachment'][_0xbb10('0xca')]({'where':{'id':_0x1b6b9f['query'][_0xbb10('0xcc')]},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0xcdaf04,null));}})[_0xbb10('0x22')](function(_0x5d5288){if(_0x5d5288){return _0xcdaf04['download'](path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0xce'),_0x5d5288['basename']));}})[_0xbb10('0x2c')](handleError(_0xcdaf04,null));};exports[_0xbb10('0xcf')]=function(_0x45cfe9,_0x4848b9){var _0x47d144=null;var _0x5a685d=null;var _0x2980b7=null;var _0x55aa03=null;if(_0x45cfe9[_0xbb10('0xbc')]['id']){delete _0x45cfe9[_0xbb10('0xbc')]['id'];}if(_0x45cfe9[_0xbb10('0xbc')][_0xbb10('0xd0')]){_0x55aa03=path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0xd1'),util[_0xbb10('0xd2')](_0xbb10('0xd3'),Date[_0xbb10('0xd4')]()));_0x45cfe9[_0xbb10('0xbc')]['pathTranscript']=_0x55aa03;}return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x45cfe9['params']['id']},'include':[{'model':db[_0xbb10('0xd5')],'as':'Messages','include':[{'model':db['User'],'as':_0xbb10('0xd6')}]}]})[_0xbb10('0x22')](handleEntityNotFound(_0x4848b9,null))[_0xbb10('0x22')](saveUpdates(_0x45cfe9[_0xbb10('0xbc')],null))[_0xbb10('0x22')](function(_0x4ca4ce){if(_0x4ca4ce){_0x47d144=_0x4ca4ce;return db[_0xbb10('0xd7')][_0xbb10('0xba')]({'where':{'id':_0x47d144['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x2850d3){if(_0x2850d3){_0x2980b7=_0x2850d3;return db['CmContact'][_0xbb10('0xba')]({'where':{'id':_0x47d144['ContactId']}});}})[_0xbb10('0x22')](function(_0x8e8049){if(_0x8e8049){_0x5a685d=_0x8e8049;if(_0x55aa03){var _0x175dc4=null;for(var _0xcda15c=0x1;_0xcda15c<_0x47d144[_0xbb10('0xd8')][_0xbb10('0x48')];++_0xcda15c){_0x175dc4=_0x47d144[_0xbb10('0xd8')][_0xcda15c];var _0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')](_0xbb10('0xd9'),_0x2980b7[_0xbb10('0xda')],_0x175dc4[_0xbb10('0xc2')]):_0xbb10('0xdb');var _0x518990=_0x45cfe9['body']['customer']||util[_0xbb10('0xd2')](_0xbb10('0xd9'),_0xbb10('0xdc'),_0x175dc4[_0xbb10('0x79')]);switch(_0x2980b7['agentIdentifier']){case _0xbb10('0xdd'):_0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')]('%s%d',_0x2980b7['agentAlias'],_0x175dc4[_0xbb10('0xc2')]):'System';break;case _0xbb10('0xde'):_0x56f902=_0x175dc4[_0xbb10('0xc2')]?_0x175dc4[_0xbb10('0xd6')][_0xbb10('0xdf')]||_0x175dc4[_0xbb10('0xd6')][_0xbb10('0xe0')]:_0xbb10('0xdb');break;case'agent_fullname':_0x56f902=_0x175dc4[_0xbb10('0xc2')]?_0x175dc4[_0xbb10('0xd6')]['fullname']:_0xbb10('0xdb');break;default:_0x56f902=_0x175dc4[_0xbb10('0xc2')]?util[_0xbb10('0xd2')]('%s%d',_0x2980b7['agentAlias'],_0x175dc4['UserId']):_0xbb10('0xdb');}var _0x123bab=util['format'](_0xbb10('0xe1'),moment(_0x175dc4[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xe2')),_0x175dc4[_0xbb10('0xe3')]==='in'?_0x518990:_0x56f902,_0x175dc4[_0xbb10('0xbc')]);if(!_0x175dc4[_0xbb10('0xe4')]){fs['appendFileSync'](_0x55aa03,_0x123bab);}}return db[_0xbb10('0xe5')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x572d73){if(_0x572d73&&_0x572d73['Smtp']&&_0x45cfe9[_0xbb10('0xbc')]){var _0x49f324={'tls':{'rejectUnauthorized':![]}};if(_0x572d73[_0xbb10('0xe6')][_0xbb10('0xe7')]){_0x49f324[_0xbb10('0xe7')]=_0x572d73['Smtp']['service'];}else{_0x49f324[_0xbb10('0xe8')]=_0x572d73['Smtp'][_0xbb10('0xe8')];_0x49f324[_0xbb10('0xe9')]=_0x572d73['Smtp']['port'];_0x49f324[_0xbb10('0xea')]=_0x572d73[_0xbb10('0xe6')][_0xbb10('0xea')];}if(_0x572d73['Smtp'][_0xbb10('0xeb')]){_0x49f324[_0xbb10('0xec')]={'user':_0x572d73[_0xbb10('0xe6')]['user'],'pass':_0x572d73[_0xbb10('0xe6')][_0xbb10('0xed')]};}return respondWithRpcPromise(_0xbb10('0xee'),_0xbb10('0xef'),{'account':_0x49f324,'message':{'from':util[_0xbb10('0xd2')](_0xbb10('0xf0'),_0x572d73[_0xbb10('0x3a')],_0x572d73[_0xbb10('0xf1')]||_0x572d73[_0xbb10('0xe6')][_0xbb10('0xf2')]),'to':_0x45cfe9[_0xbb10('0xbc')][_0xbb10('0xd0')],'subject':_0xbb10('0xf3'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x45cfe9[_0xbb10('0xbc')]['mailTranscript']),'attachments':[{'path':_0x55aa03}]}})[_0xbb10('0x22')](function(){return _0x47d144;})[_0xbb10('0x2c')](function(_0x37b7ae){console['error'](_0x37b7ae);});}else{return _0x47d144;}})[_0xbb10('0x22')](respondWithStatusCode(_0x4848b9,0xc8))[_0xbb10('0x2c')](handleError(_0x4848b9,null));};exports[_0xbb10('0xf4')]=function(_0xe5f8e2,_0x3e3c24,_0x49283d){return db[_0xbb10('0xd5')][_0xbb10('0xba')]({'where':{'id':_0xe5f8e2[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x3e3c24,null))[_0xbb10('0x22')](function(_0x3bd02a){if(_0x3bd02a){return _0x3bd02a['addMessage'](_0xe5f8e2[_0xbb10('0xbc')][_0xbb10('0xf5')],_['omit'](_0xe5f8e2[_0xbb10('0xbc')],[_0xbb10('0xf5'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x3e3c24,null))[_0xbb10('0x2c')](handleError(_0x3e3c24,null));};exports[_0xbb10('0xf6')]=function(_0x43df3c,_0x45593c,_0xb5c62c){var _0x1d45c5={'raw':![],'where':{}};var _0x33d1b7={};var _0x13514b={'count':0x0,'rows':[]};return db[_0xbb10('0x41')][_0xbb10('0xca')]({'where':{'id':_0x43df3c[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x45593c,null))['then'](function(_0x12e6cb){if(_0x12e6cb){_0x33d1b7[_0xbb10('0x45')]=_['keys'](db['ChatMessage'][_0xbb10('0x42')]);_0x33d1b7[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x43df3c[_0xbb10('0x43')]);_0x33d1b7[_0xbb10('0x44')]=_[_0xbb10('0xb7')](_0x33d1b7[_0xbb10('0x45')],_0x33d1b7[_0xbb10('0x43')]);_0x1d45c5[_0xbb10('0x46')]=_['intersection'](_0x33d1b7['model'],qs['fields'](_0x43df3c['query']['fields']));_0x1d45c5['attributes']=_0x1d45c5[_0xbb10('0x46')][_0xbb10('0x48')]?_0x1d45c5[_0xbb10('0x46')]:_0x33d1b7[_0xbb10('0x45')];if(!_0x43df3c['query'][_0xbb10('0x49')](_0xbb10('0x4a'))){_0x1d45c5[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x43df3c['query']['limit']);_0x1d45c5[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x43df3c['query']['offset']);}_0x1d45c5[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x43df3c[_0xbb10('0x43')][_0xbb10('0x4c')]);_0x1d45c5[_0xbb10('0x55')]=qs['filters'](_[_0xbb10('0x4d')](_0x43df3c['query'],_0x33d1b7['filters']));_0x1d45c5[_0xbb10('0x55')][_0xbb10('0xb3')]=_0x12e6cb['id'];if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0x80')]){_0x1d45c5[_0xbb10('0x55')]=_[_0xbb10('0xa5')](_0x1d45c5['where'],{'$or':_[_0xbb10('0xb1')](_0x1d45c5[_0xbb10('0x46')],function(_0x132fce){var _0x175196={};_0x175196[_0x132fce]={'$like':'%'+_0x43df3c[_0xbb10('0x43')][_0xbb10('0x80')]+'%'};return _0x175196;})});}if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0x85')]){var _0x233d5e=_0x43df3c[_0xbb10('0x43')][_0xbb10('0x85')][_0xbb10('0x3e')](',');var _0x1dbf7b={};_0x1dbf7b[_0x233d5e[0x0]]={'$gte':moment(_0x233d5e[0x1])[_0xbb10('0xd2')](_0xbb10('0xf7'))};_0x1d45c5[_0xbb10('0x55')]=_[_0xbb10('0xa5')](_0x1d45c5[_0xbb10('0x55')],_0x1dbf7b);}_0x1d45c5=_[_0xbb10('0xa5')]({},_0x1d45c5,_0x43df3c[_0xbb10('0xb9')]);return db[_0xbb10('0xd5')][_0xbb10('0xa3')]({'where':_0x1d45c5['where']})[_0xbb10('0x22')](function(_0x47883f){_0x13514b[_0xbb10('0xa3')]=_0x47883f;if(_0x43df3c[_0xbb10('0x43')][_0xbb10('0xf8')]){_0x1d45c5[_0xbb10('0xb8')]=[{'all':!![]}];}return db[_0xbb10('0xd5')]['findAll'](_0x1d45c5);})['then'](function(_0x572b4d){_0x13514b[_0xbb10('0xb5')]=_0x572b4d;return _0x13514b;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x45593c,_0x1d45c5))['catch'](handleError(_0x45593c,null));};exports[_0xbb10('0xf9')]=function(_0x1d655b,_0x1f090d,_0x4c7c62){var _0xae8e0a={'where':{}},_0x6463ed={},_0x289788={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xca')]({'where':{'id':_0x1d655b['params']['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x1f090d,null))['then'](function(_0x55b881){if(_0x55b881){_0x6463ed['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x6463ed[_0xbb10('0x43')]=_[_0xbb10('0x69')](_0x1d655b[_0xbb10('0x43')]);_0x6463ed[_0xbb10('0x44')]=_['intersection'](_0x6463ed[_0xbb10('0x45')],_0x6463ed[_0xbb10('0x43')]);_0xae8e0a[_0xbb10('0x46')]=_[_0xbb10('0xb7')](_0x6463ed[_0xbb10('0x45')],qs[_0xbb10('0x47')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x47')]));_0xae8e0a[_0xbb10('0x46')]=_0xae8e0a[_0xbb10('0x46')]['length']?_0xae8e0a[_0xbb10('0x46')]:_0x6463ed[_0xbb10('0x45')];if(!_0x1d655b[_0xbb10('0x43')]['hasOwnProperty'](_0xbb10('0x4a'))){_0xae8e0a[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x1d655b[_0xbb10('0x43')]['limit']);_0xae8e0a[_0xbb10('0x31')]=qs[_0xbb10('0x31')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x31')]);}_0xae8e0a[_0xbb10('0x4b')]=qs[_0xbb10('0x4c')](_0x1d655b[_0xbb10('0x43')][_0xbb10('0x4c')]);_0xae8e0a[_0xbb10('0x55')]=qs[_0xbb10('0x44')](_[_0xbb10('0x4d')](_0x1d655b['query'],_0x6463ed[_0xbb10('0x44')]));_0xae8e0a[_0xbb10('0x55')]['ChatInteractionId']=_0x55b881['id'];if(_0x1d655b['query'][_0xbb10('0x80')]){_0xae8e0a[_0xbb10('0x55')]=_['merge'](_0xae8e0a[_0xbb10('0x55')],{'$or':_[_0xbb10('0xb1')](_0xae8e0a['attributes'],function(_0x306f73){var _0x42441e={};_0x42441e[_0x306f73]={'$like':'%'+_0x1d655b[_0xbb10('0x43')][_0xbb10('0x80')]+'%'};return _0x42441e;})});}_0xae8e0a[_0xbb10('0x55')]['secret']=![];if(_0x1d655b['query']['id']){_0xae8e0a['where']['id']={'$gt':_0x1d655b[_0xbb10('0x43')]['id']};}_0xae8e0a=_['merge']({},_0xae8e0a,_0x1d655b[_0xbb10('0xb9')]);return db['ChatMessage']['count']({'where':_0xae8e0a[_0xbb10('0x55')]})[_0xbb10('0x22')](function(_0x2cb52d){_0x289788[_0xbb10('0xa3')]=_0x2cb52d;_0xae8e0a[_0xbb10('0xb8')]=[];if(_0x1d655b[_0xbb10('0x43')]['includeAgent']){_0xae8e0a['include']['push']({'model':db[_0xbb10('0xd6')],'as':_0xbb10('0xd6'),'attributes':['id',_0xbb10('0xe0'),_0xbb10('0xdf')]});}if(_0x1d655b[_0xbb10('0x43')][_0xbb10('0xf8')]){_0xae8e0a[_0xbb10('0xb8')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0xfa')](_0xae8e0a);})[_0xbb10('0x22')](function(_0x35586a){_0x289788[_0xbb10('0xb5')]=_0x35586a;return _0x289788;});}})['then'](respondWithFilteredResult(_0x1f090d,_0xae8e0a))[_0xbb10('0x2c')](handleError(_0x1f090d,null));};exports['addTags']=function(_0x4fc743,_0x25b5a7,_0x7dbd23){return db[_0xbb10('0x41')][_0xbb10('0xba')]({'where':{'id':_0x4fc743[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x25b5a7,null))['then'](function(_0x39fdd3){if(_0x39fdd3){return _0x39fdd3[_0xbb10('0xfb')](_0x4fc743[_0xbb10('0xbc')][_0xbb10('0xf5')],_[_0xbb10('0xfc')](_0x4fc743[_0xbb10('0xbc')],[_0xbb10('0xf5'),'id'])||{})['spread'](function(){return db[_0xbb10('0xfd')][_0xbb10('0xfa')]({'attributes':['id',_0xbb10('0x3a'),'color'],'where':{'id':_0x4fc743['body'][_0xbb10('0xf5')]}});})[_0xbb10('0x22')](function(_0x3b007e){socket[_0xbb10('0xfe')](_0xbb10('0xff'),{'id':Number(_0x4fc743[_0xbb10('0xbd')]['id']),'tags':_0x3b007e||[]});return{'id':Number(_0x4fc743[_0xbb10('0xbd')]['id']),'tags':_0x3b007e||[]};});}})['then'](respondWithResult(_0x25b5a7,null))[_0xbb10('0x2c')](handleError(_0x25b5a7,null));};exports[_0xbb10('0x100')]=function(_0x15bd9e,_0x55ba78,_0x5e195a){return db['ChatInteraction']['find']({'where':{'id':_0x15bd9e[_0xbb10('0xbd')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x55ba78,null))[_0xbb10('0x22')](function(_0x1b9a6b){if(_0x1b9a6b){return _0x1b9a6b['removeTags'](_0x15bd9e[_0xbb10('0x43')]['ids']);}})[_0xbb10('0x22')](respondWithStatusCode(_0x55ba78,null))[_0xbb10('0x2c')](handleError(_0x55ba78,null));};exports[_0xbb10('0x101')]=function(_0xc3c1e5,_0xa16287){var _0x163fdd=moment()[_0xbb10('0x102')]()[_0xbb10('0xa2')]();var _0x243dc2=path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0x103'),'files',_0xbb10('0x104'));var _0x1c000b=path[_0xbb10('0x8d')](config['root'],_0xbb10('0x103'),'files',_0xbb10('0x105'));var _0x446bcf=path[_0xbb10('0x8d')](_0x243dc2,_0x163fdd);var _0x252833=util[_0xbb10('0xd2')]('transcript-%d-%s.zip',_0xc3c1e5['params']['id'],_0x163fdd);var _0x842d94=path['join'](_0x243dc2,_0x252833);var _0x553bb8=![];return db[_0xbb10('0x41')]['find']({'where':{'id':_0xc3c1e5[_0xbb10('0xbd')]['id']},'include':[{'model':db[_0xbb10('0xd5')],'as':_0xbb10('0xd8'),'attributes':['id',_0xbb10('0xbc'),_0xbb10('0x6a'),_0xbb10('0xe3'),_0xbb10('0xe4')],'include':[{'model':db[_0xbb10('0xd6')],'as':'User','attributes':['id',_0xbb10('0xe0')],'raw':!![]},{'model':db['CmContact'],'as':_0xbb10('0x106'),'attributes':['id','firstName',_0xbb10('0x107')],'raw':!![]},{'model':db[_0xbb10('0xc8')],'as':'Attachment','raw':!![]}]},{'model':db[_0xbb10('0xd7')],'as':_0xbb10('0x108'),'attributes':['id',_0xbb10('0x3a')]},{'model':db['User'],'as':_0xbb10('0x109'),'attributes':['id',_0xbb10('0xe0')]}]})[_0xbb10('0x22')](handleEntityNotFound(_0xa16287,null))['then'](function(_0x100e82){if(_0x100e82){var _0x1129f5=_0x100e82[_0xbb10('0x10a')]({'plain':!![]});_0x553bb8=!![];var _0x4b781e={'format':'A4','border':_0xbb10('0x10b'),'header':{'height':'40px','contents':{'first':_0xbb10('0x10c')}},'footer':{'height':_0xbb10('0x10d'),'contents':{'default':util[_0xbb10('0xd2')](_0xbb10('0x10e'),util[_0xbb10('0xd2')](_0xbb10('0x10f'),_0xbb10('0x110'),_0x1129f5['id']),moment()[_0xbb10('0xd2')](_0xbb10('0x111'))[_0xbb10('0xa2')]())}}};fs['mkdirSync'](_0x446bcf);var _0x4b10ed={'channel':_0xbb10('0x110'),'account':_0x1129f5[_0xbb10('0x108')][_0xbb10('0x3a')],'agent':_0x1129f5['Owner']?_0x1129f5[_0xbb10('0x109')][_0xbb10('0xe0')]:_0xbb10('0x112'),'createdAt':moment(_0x1129f5[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xf7'))[_0xbb10('0xa2')](),'closedAt':_0x1129f5[_0xbb10('0x113')]?moment(_0x1129f5[_0xbb10('0x114')])['format'](_0xbb10('0xf7'))[_0xbb10('0xa2')]():'','disposition':_0x1129f5[_0xbb10('0xc3')],'chatInfo':{'browser':_0x1129f5[_0xbb10('0x115')],'os':_0x1129f5['osName'],'referer':_0x1129f5[_0xbb10('0x116')],'customerIp':_0x1129f5[_0xbb10('0x117')]},'messages':_(_0x1129f5[_0xbb10('0xd8')])['tail']()['filter']({'secret':![]})[_0xbb10('0xb1')](function(_0x4f4157){if(_0x4f4157[_0xbb10('0xc8')]){var _0x4874be=path[_0xbb10('0x8d')](_0x1c000b,_0x4f4157[_0xbb10('0xc8')][_0xbb10('0x118')]);if(fs[_0xbb10('0x119')](_0x4874be)){fs[_0xbb10('0x11a')](_0x4874be)[_0xbb10('0x11b')](fs[_0xbb10('0x11c')](path['join'](_0x446bcf,_0x4f4157[_0xbb10('0xc8')][_0xbb10('0x118')])));}}return{'date':moment(_0x4f4157[_0xbb10('0x6a')])[_0xbb10('0xd2')](_0xbb10('0xf7'))[_0xbb10('0xa2')](),'sender':_0x4f4157['direction']===_0xbb10('0x11d')?_0x4f4157[_0xbb10('0xd6')]?_0x4f4157[_0xbb10('0xd6')][_0xbb10('0xe0')]:_0xbb10('0xdb'):_0x4f4157[_0xbb10('0x106')][_0xbb10('0x11e')]+(_0x4f4157['Contact'][_0xbb10('0x107')]?'\x20'+_0x4f4157[_0xbb10('0x106')][_0xbb10('0x107')]:''),'body':_0x4f4157['Attachment']?_0x4f4157[_0xbb10('0xc8')]['basename']:_0x4f4157[_0xbb10('0xbc')],'direction':_0x4f4157[_0xbb10('0xe3')]===_0xbb10('0x11d')?'A':'C','secret':_0x4f4157['secret'],'attachment':_0x4f4157['Attachment']};})[_0xbb10('0x6b')]()};return ejs[_0xbb10('0x11f')](path[_0xbb10('0x8d')](config[_0xbb10('0xcd')],_0xbb10('0x103'),_0xbb10('0x120'),_0xbb10('0x121')),{'interaction':_0x4b10ed})[_0xbb10('0x22')](function(_0x2ba569){return new BPromise(function(_0x8700e6,_0x1e6509){pdf['create'](_0x2ba569,_0x4b781e)['toFile'](path[_0xbb10('0x8d')](_0x446bcf,_0xbb10('0x122')+_0x1129f5['id']+'-'+_0x163fdd+'.pdf'),function(_0x576df0,_0x2ae12a){if(_0x576df0)return _0x1e6509(_0x576df0);_0x8700e6(_0x2ae12a);});});});}})[_0xbb10('0x22')](function(){if(_0x553bb8){return new BPromise(function(_0x30bc43,_0x5ea832){zipdir(_0x446bcf,{'saveTo':_0x842d94},function(_0x565874,_0x35c8a7){if(_0x565874)return _0x5ea832(_0x565874);return _0x30bc43(_0x35c8a7);});})['then'](function(){return new BPromise(function(_0x4375ac,_0x97224a){rimraf(_0x446bcf,function(_0x544c9c){if(_0x544c9c)_0x97224a(_0x544c9c);return _0x4375ac();});});})['then'](function(){return _0xa16287[_0xbb10('0x101')](_0x842d94,_0x252833,function(_0x26ec8e){if(_0x26ec8e){console[_0xbb10('0x123')]('err',_0x26ec8e);}else{fs['unlinkSync'](_0x842d94);}});});}else{return _0xa16287[_0xbb10('0x2d')](0xc8);}})[_0xbb10('0x2c')](handleError(_0xa16287,null));}; \ No newline at end of file +var _0x7a54=['register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','Users','map','TagIds','split','push','index','ChatInteraction','keys','filters','intersection','model','attributes','query','length','hasOwnProperty','nolimit','sort','select','field','color','from','tools_tags','COUNT(*)','chat_messages','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','startOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','forEach','TagId','unreadMessages','isArray','value','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','c.firstName','filter','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','SELECT','clone','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','merge','COUNT(me.id)','a.key','Account.key','i.*','Contact.firstName','Contact.email','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','fields','include','find','create','body','describe','customUpdate','abandon','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','disposition','originalname','basename','file','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','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','includeAll','findAll','getMyMessages','pick','includeAgent','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','Messages','direction','CmContact','Contact','firstName','lastName','Account','Owner','10px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','closed','osName','customerIp','tail','existsSync','pipe','createWriteStream','out','renderFile','views','toFile','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x2020a9,_0x2563b3){_0x2020a9=_0x2020a9-0x0;var _0x571d08=_0x7a54[_0x2020a9];return _0x571d08;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);var jayson=require(_0x47a5('0x19'));var client=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232b});var client9004=jayson[_0x47a5('0x1a')][_0x47a5('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x4e99a8,_0x362359,_0x11faf5){if(_0x11faf5){var _0x3b001e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b001e[_0x47a5('0x1c')](_0x362359)){return _0x4e99a8;}else{throw new Error(_0x47a5('0x1d'));}}else{return _0x4e99a8;}}function respondWithRpcPromise(_0x574af6,_0x549de3,_0x138bc0,_0x4b966e){return new BPromise(function(_0x5247fd,_0x423a81){var _0xaf70a6=_0x4b966e||client;return _0xaf70a6[_0x47a5('0x1e')](_0x574af6,_0x138bc0)[_0x47a5('0x1f')](function(_0x477b1d){logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x549de3,_0x47a5('0x22'));logger[_0x47a5('0x23')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x549de3,_0x47a5('0x22'),JSON[_0x47a5('0x24')](_0x477b1d));if(_0x477b1d['error']){if(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x26')]===0x1f4){logger[_0x47a5('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x549de3,_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);return _0x423a81(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);}logger['error'](_0x47a5('0x21'),_0x549de3,_0x477b1d[_0x47a5('0x25')]['message']);return _0x5247fd(_0x477b1d[_0x47a5('0x25')][_0x47a5('0x27')]);}else{logger[_0x47a5('0x20')](_0x47a5('0x21'),_0x549de3,_0x47a5('0x22'));_0x5247fd(_0x477b1d['result']['message']);}})[_0x47a5('0x28')](function(_0x5686db){logger[_0x47a5('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x549de3,_0x5686db);_0x423a81(_0x5686db);});});}function respondWithStatusCode(_0x23cb77,_0x378208){_0x378208=_0x378208||0xcc;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x29')](_0x378208);}return _0x23cb77[_0x47a5('0x2a')](_0x378208)[_0x47a5('0x2b')]();};}function respondWithResult(_0x24b162,_0x136b14){_0x136b14=_0x136b14||0xc8;return function(_0x16631f){if(_0x16631f){return _0x24b162[_0x47a5('0x2a')](_0x136b14)[_0x47a5('0x2c')](_0x16631f);}};}function respondWithFilteredResult(_0x11a4fa,_0x3ad507){return function(_0x528582){if(_0x528582){var _0x243210=_0x528582[_0x47a5('0x2d')],_0x51833b=_0x3ad507['offset'],_0x2ef875=_0x3ad507[_0x47a5('0x2e')]+_0x3ad507[_0x47a5('0x2f')],_0x9ac908;if(_0x2ef875>=_0x243210){_0x2ef875=_0x243210;_0x9ac908=0xc8;}else{_0x9ac908=0xce;}_0x11a4fa[_0x47a5('0x2a')](_0x9ac908);return _0x11a4fa[_0x47a5('0x30')]('Content-Range',_0x51833b+'-'+_0x2ef875+'/'+_0x243210)['json'](_0x528582);}return null;};}function patchUpdates(_0x6f9a12){return function(_0xfb5ddb){try{jsonpatch['apply'](_0xfb5ddb,_0x6f9a12,!![]);}catch(_0x4e1006){return BPromise[_0x47a5('0x31')](_0x4e1006);}return _0xfb5ddb[_0x47a5('0x32')]();};}function saveUpdates(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x33')](_0x57bff6)[_0x47a5('0x1f')](function(_0x5c5162){return _0x5c5162;});}return null;};}function removeEntity(_0x4843c0,_0x274e34){return function(_0x5910bb){if(_0x5910bb){return _0x5910bb[_0x47a5('0x34')]()[_0x47a5('0x1f')](function(){_0x4843c0[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f7e9,_0x50c086){return function(_0x53c754){if(!_0x53c754){_0x18f7e9[_0x47a5('0x29')](0x194);}return _0x53c754;};}function handleError(_0x5a8a7c,_0x25cce0){_0x25cce0=_0x25cce0||0x1f4;return function(_0x5ef577){logger[_0x47a5('0x25')](_0x5ef577[_0x47a5('0x35')]);if(_0x5ef577[_0x47a5('0x36')]){delete _0x5ef577[_0x47a5('0x36')];}_0x5a8a7c[_0x47a5('0x2a')](_0x25cce0)[_0x47a5('0x37')](_0x5ef577);};}function getInteractionUsers(_0xee582c,_0x452be5){return new BPromise(function(_0x1a0d23,_0x4caed5){try{if(_0x452be5[_0xee582c['id']]){_0xee582c[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x452be5[_0xee582c['id']],function(_0x511c06){return{'id':_0x511c06['id']};});}}catch(_0x2c50d6){_0x4caed5(_0x2c50d6);}_0x1a0d23(_0xee582c);});}function getInteractionTags(_0x2bf53d,_0x1d4348){return new BPromise(function(_0x49c4b5,_0x101f70){try{if(_0x2bf53d[_0x47a5('0x3a')]){_0x2bf53d['Tags']=[];_0x2bf53d[_0x47a5('0x3a')][_0x47a5('0x3b')](',')['forEach'](function(_0x55c5eb){_0x2bf53d['Tags'][_0x47a5('0x3c')](_0x1d4348[_0x55c5eb]);});}delete _0x2bf53d['TagIds'];}catch(_0x9b5eaf){_0x101f70(_0x9b5eaf);}_0x49c4b5(_0x2bf53d);});}function updateChatInteraction(_0x1f9631,_0x301a85,_0x111f0d){return new BPromise(function(_0x1b2c80,_0xcb5243){return getInteractionUsers(_0x1f9631,_0x111f0d)[_0x47a5('0x1f')](function(_0x1f3d01){return getInteractionTags(_0x1f3d01,_0x301a85);})[_0x47a5('0x1f')](function(_0x36a24e){_0x1b2c80(_0x36a24e);})[_0x47a5('0x28')](function(_0x1658e8){_0xcb5243(_0x1658e8);});});}exports[_0x47a5('0x3d')]=function(_0x56dbbd,_0x1fbece){var _0x1c36fa={},_0x331474={},_0x23bd8d={'count':0x0,'rows':[]};var _0x586f4f=db[_0x47a5('0x3e')]['rawAttributes'];_0x331474['model']=_['keys'](_0x586f4f);_0x331474['query']=_[_0x47a5('0x3f')](_0x56dbbd['query']);_0x331474[_0x47a5('0x40')]=_[_0x47a5('0x41')](_0x331474[_0x47a5('0x42')],_0x331474['query']);_0x1c36fa[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x331474['model'],qs['fields'](_0x56dbbd[_0x47a5('0x44')]['fields']));_0x1c36fa[_0x47a5('0x43')]=_0x1c36fa[_0x47a5('0x43')][_0x47a5('0x45')]?_0x1c36fa[_0x47a5('0x43')]:_0x331474[_0x47a5('0x42')];if(!_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x46')](_0x47a5('0x47'))){_0x1c36fa[_0x47a5('0x2f')]=qs[_0x47a5('0x2f')](_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x1c36fa[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x2e')]);}_0x1c36fa['order']=qs[_0x47a5('0x48')](_0x56dbbd[_0x47a5('0x44')]['sort']);_0x1c36fa['where']=qs[_0x47a5('0x40')](_['pick'](_0x56dbbd[_0x47a5('0x44')],_0x331474[_0x47a5('0x40')]));var _0x54c35f=[];var _0x4f62d3=squel[_0x47a5('0x49')]()['field']('id')[_0x47a5('0x4a')](_0x47a5('0x36'))[_0x47a5('0x4a')](_0x47a5('0x4b'))[_0x47a5('0x4c')](_0x47a5('0x4d'));var _0x238ebb=squel['select']()['field'](_0x47a5('0x4e'))[_0x47a5('0x4c')](_0x47a5('0x4f'),'me')[_0x47a5('0x50')](_0x47a5('0x51'))[_0x47a5('0x50')](_0x47a5('0x52'))['where'](_0x47a5('0x53'));var _0x1c9a62=squel[_0x47a5('0x49')]()['field'](_0x47a5('0x54'))['field'](_0x47a5('0x55'))[_0x47a5('0x4c')](_0x47a5('0x56'),'ui')[_0x47a5('0x57')]('users','u',_0x47a5('0x58'));var _0x1e6de3=squel[_0x47a5('0x49')]()[_0x47a5('0x4c')](_0x47a5('0x59'),'i')[_0x47a5('0x57')](_0x47a5('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x47a5('0x57')](_0x47a5('0x5b'),'o',_0x47a5('0x5c'))[_0x47a5('0x57')](_0x47a5('0x5d'),'a',_0x47a5('0x5e'))['left_join'](_0x47a5('0x4f'),'me',_0x47a5('0x5f'));var _0x1aa581=squel['expr']();if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x60')]){var _0x5018e9=JSON['parse'](_0x56dbbd['query'][_0x47a5('0x60')]);_[_0x47a5('0x3f')](_0x5018e9)['forEach'](function(_0x4cf792){var _0x6d6b2b=_0x5018e9[_0x4cf792];if(_0x4cf792==='createdAt'){var _0x16bb8a=moment(_0x6d6b2b['value']['dateStart'])[_0x47a5('0x61')](_0x47a5('0x62'))['utc']()[_0x47a5('0x63')]();var _0x72fe=moment(_0x72fe)['utc']()['endOf'](_0x47a5('0x62'))[_0x47a5('0x63')]();_0x1aa581[_0x47a5('0x64')](_0x47a5('0x65'),_0x16bb8a,_0x72fe);}else{if(_['isArray'](_0x6d6b2b[_0x47a5('0x66')])){_0x6d6b2b[_0x47a5('0x66')][_0x47a5('0x67')](function(_0x5a33b8){switch(_0x6d6b2b[_0x47a5('0x66')]['value']){case'IS':if(_0x4cf792!==_0x47a5('0x68')&&_0x4cf792!==_0x47a5('0x69')){if(_[_0x47a5('0x6a')](_0x6d6b2b[_0x47a5('0x6b')])&&_0x6d6b2b[_0x47a5('0x6b')]['length']>0x1){_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+'\x20IN\x20?',_0x6d6b2b['value']);}else{_0x1aa581['and'](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b[_0x47a5('0x6b')][0x0]);}}break;case'=':_0x1aa581['and'](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b[_0x47a5('0x6b')]);break;case _0x47a5('0x6e'):if(_0x4cf792===_0x47a5('0x6f')){_0x1aa581[_0x47a5('0x64')]('c.firstName'+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x71')+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x72')+_0x47a5('0x70'),'%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x70'),'%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}break;case'>':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x73'),_0x6d6b2b[_0x47a5('0x6b')]);break;case'<':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x74'),_0x6d6b2b['value']);break;}});}else{switch(_0x6d6b2b[_0x47a5('0x66')][_0x47a5('0x6b')]){case'IS':if(_0x4cf792!==_0x47a5('0x68')&&_0x4cf792!==_0x47a5('0x69')){if(_[_0x47a5('0x6a')](_0x6d6b2b[_0x47a5('0x6b')])&&_0x6d6b2b[_0x47a5('0x6b')][_0x47a5('0x45')]>0x1){_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x75'),_0x6d6b2b[_0x47a5('0x6b')]);}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b['value'][0x0]);}}break;case'=':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x6d'),_0x6d6b2b['value']);break;case _0x47a5('0x6e'):if(_0x4cf792===_0x47a5('0x6f')){_0x1aa581[_0x47a5('0x64')](_0x47a5('0x76')+'\x20LIKE\x20?','%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');_0x1aa581['or']('c.lastName'+_0x47a5('0x70'),'%'+_0x6d6b2b['value']+'%');_0x1aa581['or'](_0x47a5('0x72')+'\x20LIKE\x20?','%'+_0x6d6b2b[_0x47a5('0x6b')]+'%');}else{_0x1aa581[_0x47a5('0x64')](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+'\x20LIKE\x20?','%'+_0x6d6b2b['value']+'%');}break;case'>':_0x1aa581['and'](_0x6d6b2b[_0x47a5('0x6c')]+'.'+_0x4cf792+_0x47a5('0x73'),_0x6d6b2b[_0x47a5('0x6b')]);break;case'<':_0x1aa581[_0x47a5('0x64')](_0x6d6b2b['tableAlias']+'.'+_0x4cf792+_0x47a5('0x74'),_0x6d6b2b[_0x47a5('0x6b')]);break;}}}});}else{var _0x390bc0=_(Object[_0x47a5('0x3f')](_0x56dbbd[_0x47a5('0x44')]))[_0x47a5('0x39')](function(_0x1155f6){return _0x586f4f[_0x47a5('0x46')](_0x1155f6)?_0x1155f6:undefined;})[_0x47a5('0x77')](function(_0xc69a68){return!_[_0x47a5('0x78')](_0xc69a68);})[_0x47a5('0x6b')]();if(!_['isEmpty'](_0x390bc0)){_0x390bc0[_0x47a5('0x67')](function(_0x4833be){if(_0x4833be===_0x47a5('0x79')){_0x1e6de3[_0x47a5('0x50')](_0x47a5('0x7a'),[][_0x47a5('0x7b')](_0x56dbbd[_0x47a5('0x44')][_0x4833be]));}else if(_0x4833be===_0x47a5('0x7c')){var _0x12025a=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')][_0x4833be])[_0x47a5('0x7e')];var _0x1cfb37=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')][_0x4833be])[_0x47a5('0x7f')];_0x1e6de3[_0x47a5('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12025a,_0x1cfb37);}else{if(_0x56dbbd['query'][_0x4833be]==='null'){_0x1e6de3['where']('i.'+_0x4833be+_0x47a5('0x80'));}else{_0x1e6de3[_0x47a5('0x50')]('i.'+_0x4833be+'\x20=\x20?',_0x56dbbd[_0x47a5('0x44')][_0x4833be]);}}});}if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x77')]){var _0x396102=_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x77')][_0x47a5('0x81')]('\x5c','\x5c\x5c')[_0x47a5('0x81')]('\x27\x27',_0x47a5('0x82'));if(qs[_0x47a5('0x83')](_0x396102)){_0x1aa581['or'](_0x47a5('0x84'),_0x396102+'%');}else{var _0x5e5f16=[];_0x396102[_0x47a5('0x3b')]('\x20')[_0x47a5('0x67')](function(_0x420671){_0x5e5f16['push']('+'+_0x420671[_0x47a5('0x85')]());});var _0x32f393=_0x5e5f16[_0x47a5('0x86')]('\x20');_0x1aa581['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x32f393)['or'](_0x47a5('0x87'),_0x396102+'%');}}}_0x1e6de3['where'](_0x1aa581);if(_0x1c36fa['order']){_0x1c36fa[_0x47a5('0x88')][_0x47a5('0x67')](function(_0x277486){_0x1e6de3[_0x47a5('0x88')]('i.'+_0x277486[0x0],_0x277486[0x1]===_0x47a5('0x89')?![]:!![]);});}_0x1e6de3[_0x47a5('0x8a')]('i.id');var _0x592322={'type':db[_0x47a5('0x8b')]['QueryTypes'][_0x47a5('0x8c')],'raw':!![]};var _0x3fffd1=_0x1e6de3[_0x47a5('0x8d')]()[_0x47a5('0x4a')]('COUNT(*)')[_0x47a5('0x4a')]('COUNT(me.id)','unreadMessages');if(!_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x60')]){if(_0x56dbbd['query'][_0x47a5('0x8e')]){if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x8e')]==0x1){_0x3fffd1['having'](_0x47a5('0x8f'));_0x1e6de3['having'](_0x47a5('0x8f'));}else{_0x3fffd1[_0x47a5('0x90')](_0x47a5('0x91'));_0x1e6de3['having'](_0x47a5('0x91'));}}if(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x92')]){var _0x4b3fef=_[_0x47a5('0x6a')](_0x56dbbd['query'][_0x47a5('0x92')])?_0x56dbbd['query'][_0x47a5('0x92')]:new Array(_0x56dbbd[_0x47a5('0x44')][_0x47a5('0x92')]);var _0x211fbf=squel['expr']();_0x4b3fef[_0x47a5('0x67')](function(_0x2ae130){_0x211fbf['or'](_0x47a5('0x93'),'%,'+_0x2ae130+',%');});_0x1e6de3[_0x47a5('0x90')](_0x211fbf);_0x3fffd1[_0x47a5('0x57')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x3fffd1[_0x47a5('0x57')]('tools_tags','t',_0x47a5('0x94'));_0x3fffd1[_0x47a5('0x50')](_0x47a5('0x95'),_0x4b3fef);}}else{var _0x5018e9=JSON[_0x47a5('0x7d')](_0x56dbbd[_0x47a5('0x44')]['advancedFilter']);_[_0x47a5('0x3f')](_0x5018e9)[_0x47a5('0x67')](function(_0x19acfa){var _0x113beb=_0x5018e9[_0x19acfa];if(_0x19acfa==='TagId'){var _0x4b5353=_0x113beb[_0x47a5('0x6b')];var _0x263046=squel['expr']();_0x4b5353[_0x47a5('0x67')](function(_0x23f055){_0x263046['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x23f055+',%');});_0x1e6de3[_0x47a5('0x90')](_0x263046);_0x3fffd1[_0x47a5('0x57')](_0x47a5('0x96'),'it','it.MailInteractionId\x20=\x20i.id');_0x3fffd1[_0x47a5('0x57')]('tools_tags','t',_0x47a5('0x94'));_0x3fffd1['where'](_0x47a5('0x95'),_0x4b5353);}else if(_0x19acfa===_0x47a5('0x69')){if(_0x113beb['value'][_0x47a5('0x45')]===0x1){if(_0x113beb['value'][0x0]===0x1){_0x3fffd1[_0x47a5('0x90')](_0x47a5('0x8f'));_0x1e6de3[_0x47a5('0x90')](_0x47a5('0x8f'));}else{_0x3fffd1['having'](_0x47a5('0x91'));_0x1e6de3['having']('`unreadMessages`\x20>\x200');}}}});}db[_0x47a5('0x97')][_0x47a5('0x44')](_0x3fffd1[_0x47a5('0x85')](),_0x592322)[_0x47a5('0x1f')](function(_0x380c8b){_0x23bd8d['count']=_0x380c8b[_0x47a5('0x45')];if(_0x23bd8d[_0x47a5('0x2d')]===0x0)return[];return db[_0x47a5('0x97')][_0x47a5('0x44')](_0x4f62d3['toString'](),_0x592322)[_0x47a5('0x1f')](function(_0x4af162){_0x54c35f=_[_0x47a5('0x98')](_0x4af162,'id');_0x592322=_[_0x47a5('0x99')](_0x592322,{'model':db[_0x47a5('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x9a'),_0x47a5('0x69'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x9b'),_0x47a5('0x9c'));_0x1e6de3['field'](_0x47a5('0x9d'));_0x1e6de3[_0x47a5('0x4a')]('c.firstName',_0x47a5('0x9e'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0x71'),'Contact.lastName');_0x1e6de3['field'](_0x47a5('0x72'),_0x47a5('0x9f'));_0x1e6de3['field']('c.phone',_0x47a5('0xa0'));_0x1e6de3[_0x47a5('0x4a')]('c.mobile',_0x47a5('0xa1'));_0x1e6de3[_0x47a5('0x4a')]('c.fax',_0x47a5('0xa2'));_0x1e6de3[_0x47a5('0x4a')](_0x47a5('0xa3'),_0x47a5('0x3a'));_0x1e6de3[_0x47a5('0x57')](_0x47a5('0xa4'),'it','it.ChatInteractionId\x20=\x20i.id');_0x1e6de3['left_join']('tools_tags','t',_0x47a5('0x94'));_0x1e6de3[_0x47a5('0x2f')](_0x1c36fa['limit']);_0x1e6de3[_0x47a5('0x2e')](_0x1c36fa[_0x47a5('0x2e')]);return db[_0x47a5('0x97')][_0x47a5('0x44')](_0x1e6de3[_0x47a5('0x85')](),_0x592322);})['then'](function(_0x3e7750){_0x1c9a62['where']('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x3e7750,'id'));return db[_0x47a5('0x97')]['query'](_0x1c9a62[_0x47a5('0x85')](),_0x592322)[_0x47a5('0x1f')](function(_0x5a316e){var _0x49f791=_[_0x47a5('0xa5')](_0x5a316e,_0x47a5('0xa6'));var _0x35bf37=[];_0x3e7750[_0x47a5('0x67')](function(_0x392ad7){_0x35bf37['push'](updateChatInteraction(_0x392ad7,_0x54c35f,_0x49f791));});return BPromise[_0x47a5('0xa7')](_0x35bf37);});});})[_0x47a5('0x1f')](function(_0x519f0a){_0x23bd8d[_0x47a5('0xa8')]=_0x519f0a;return _0x23bd8d;})[_0x47a5('0x1f')](respondWithFilteredResult(_0x1fbece,_0x1c36fa))[_0x47a5('0x28')](handleError(_0x1fbece,null));};exports[_0x47a5('0xa9')]=function(_0x3c117a,_0x186aad){var _0x5112d7={'raw':![],'where':{'id':_0x3c117a[_0x47a5('0xaa')]['id']}},_0x6a8174={};_0x6a8174['model']=_[_0x47a5('0x3f')](db[_0x47a5('0x3e')][_0x47a5('0xab')]);_0x6a8174[_0x47a5('0x44')]=_['keys'](_0x3c117a['query']);_0x6a8174['filters']=_['intersection'](_0x6a8174[_0x47a5('0x42')],_0x6a8174[_0x47a5('0x44')]);_0x5112d7[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x6a8174[_0x47a5('0x42')],qs[_0x47a5('0xac')](_0x3c117a[_0x47a5('0x44')][_0x47a5('0xac')]));_0x5112d7['attributes']=_0x5112d7[_0x47a5('0x43')][_0x47a5('0x45')]?_0x5112d7[_0x47a5('0x43')]:_0x6a8174[_0x47a5('0x42')];if(_0x3c117a['query']['includeAll']){_0x5112d7[_0x47a5('0xad')]=[{'all':!![]}];}_0x5112d7=_['merge']({},_0x5112d7,_0x3c117a['options']);return db[_0x47a5('0x3e')][_0x47a5('0xae')](_0x5112d7)['then'](handleEntityNotFound(_0x186aad,null))[_0x47a5('0x1f')](respondWithResult(_0x186aad,null))[_0x47a5('0x28')](handleError(_0x186aad,null));};exports[_0x47a5('0xaf')]=function(_0x48835f,_0x740bdf){return db[_0x47a5('0x3e')]['create'](_0x48835f[_0x47a5('0xb0')],{})[_0x47a5('0x1f')](respondWithResult(_0x740bdf,0xc9))[_0x47a5('0x28')](handleError(_0x740bdf,null));};exports[_0x47a5('0x33')]=function(_0x12a56a,_0x475114){if(_0x12a56a['body']['id']){delete _0x12a56a[_0x47a5('0xb0')]['id'];}return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0x12a56a[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x475114,null))[_0x47a5('0x1f')](saveUpdates(_0x12a56a['body'],null))[_0x47a5('0x1f')](respondWithResult(_0x475114,null))[_0x47a5('0x28')](handleError(_0x475114,null));};exports[_0x47a5('0x34')]=function(_0x27baad,_0x34b7c9){return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x27baad[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x34b7c9,null))[_0x47a5('0x1f')](removeEntity(_0x34b7c9,null))[_0x47a5('0x28')](handleError(_0x34b7c9,null));};exports[_0x47a5('0xb1')]=function(_0x52a2be,_0x4218fd){return db[_0x47a5('0x3e')]['describe']()[_0x47a5('0x1f')](respondWithResult(_0x4218fd,null))[_0x47a5('0x28')](handleError(_0x4218fd,null));};exports[_0x47a5('0xb2')]=function(_0x2ccf21,_0x2ff467){if(_0x2ccf21['body']['id']){delete _0x2ccf21[_0x47a5('0xb0')]['id'];}return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x2ccf21[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x2ff467,null))[_0x47a5('0x1f')](saveUpdates(_0x2ccf21[_0x47a5('0xb0')],null))['then'](respondWithResult(_0x2ff467,null))['catch'](handleError(_0x2ff467,null));};exports[_0x47a5('0xb3')]=function(_0x580ce8,_0xf105b8,_0x5544a2){if(_0x580ce8[_0x47a5('0xb0')]['id']){delete _0x580ce8[_0x47a5('0xb0')]['id'];}return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x580ce8['params']['id']}})[_0x47a5('0x1f')](function(_0x11f07b){if(!_0x11f07b){logger[_0x47a5('0x25')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x47a5('0xb4'));_0xf105b8[_0x47a5('0x29')](0x194);}else{if(_0x11f07b[_0x47a5('0xb5')]){throw new db[(_0x47a5('0x8b'))][(_0x47a5('0xb6'))](_0x47a5('0xb7'));}}return _0x11f07b;})[_0x47a5('0x1f')](function(_0xe662d7){if(_0xe662d7){return _0xe662d7['update']({'closed':_0x580ce8[_0x47a5('0xb0')]['closed'],'disposition':_0x580ce8[_0x47a5('0xb0')][_0x47a5('0xb8')]})['then'](function(_0x48d4cf){return _0x48d4cf;});}})[_0x47a5('0x1f')](function(_0x41d2da){return respondWithRpcPromise('AbandonInteraction',_0x47a5('0xb3'),_0x580ce8[_0x47a5('0xb0')],client9004);})[_0x47a5('0x1f')](respondWithResult(_0xf105b8,null))[_0x47a5('0x28')](handleError(_0xf105b8,null));};exports['attachmentUpload']=function(_0x142012,_0x490947,_0x56d81e){_0x142012['body'][_0x47a5('0x36')]=_0x142012['file'][_0x47a5('0xb9')];_0x142012[_0x47a5('0xb0')][_0x47a5('0xba')]=_0x142012[_0x47a5('0xbb')][_0x47a5('0xbc')];_0x142012[_0x47a5('0xb0')][_0x47a5('0xbd')]=_0x142012[_0x47a5('0xbb')][_0x47a5('0xbe')];return db[_0x47a5('0xbf')][_0x47a5('0xaf')](_0x142012[_0x47a5('0xb0')])[_0x47a5('0x1f')](respondWithResult(_0x490947,0xc9))[_0x47a5('0x28')](handleError(_0x490947,null));};exports[_0x47a5('0xc0')]=function(_0x5e17cb,_0xdd95c8,_0x40aee5){return db[_0x47a5('0x3e')][_0x47a5('0xc1')]({'where':{'id':_0x5e17cb['params']['id']},'raw':!![]})[_0x47a5('0x1f')](handleEntityNotFound(_0xdd95c8,null))['then'](function(_0x4476b5){if(_0x4476b5){if(_0x4476b5['closed']){return _0xdd95c8[_0x47a5('0x2a')](0x193)[_0x47a5('0x2c')]({'status':0x193,'message':_0x47a5('0xc2')});}return db['Attachment'][_0x47a5('0xc1')]({'where':{'id':_0x5e17cb[_0x47a5('0x44')][_0x47a5('0xc3')]},'raw':!![]})['then'](handleEntityNotFound(_0xdd95c8,null));}})['then'](function(_0x20f320){if(_0x20f320){return _0xdd95c8[_0x47a5('0xc4')](path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xc6'),_0x20f320['basename']));}})[_0x47a5('0x28')](handleError(_0xdd95c8,null));};exports['close']=function(_0xbcd492,_0xdeaf4e){var _0x46647f=null;var _0x2d6ae7=null;var _0x5b18a2=null;var _0x4dc67c=null;if(_0xbcd492[_0x47a5('0xb0')]['id']){delete _0xbcd492[_0x47a5('0xb0')]['id'];}if(_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')]){_0x4dc67c=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xc8'),util[_0x47a5('0x63')](_0x47a5('0xc9'),Date['now']()));_0xbcd492['body'][_0x47a5('0xca')]=_0x4dc67c;}return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0xbcd492[_0x47a5('0xaa')]['id']},'include':[{'model':db[_0x47a5('0xcb')],'as':'Messages','include':[{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0xcc')}]}]})['then'](handleEntityNotFound(_0xdeaf4e,null))[_0x47a5('0x1f')](saveUpdates(_0xbcd492['body'],null))[_0x47a5('0x1f')](function(_0x3900d8){if(_0x3900d8){_0x46647f=_0x3900d8;return db[_0x47a5('0xcd')]['find']({'where':{'id':_0x46647f['ChatWebsiteId']}});}})['then'](function(_0x4de478){if(_0x4de478){_0x5b18a2=_0x4de478;return db['CmContact'][_0x47a5('0xae')]({'where':{'id':_0x46647f['ContactId']}});}})[_0x47a5('0x1f')](function(_0x2287b0){if(_0x2287b0){_0x2d6ae7=_0x2287b0;if(_0x4dc67c){var _0x530e98=null;for(var _0x49da2a=0x1;_0x49da2a<_0x46647f['Messages'][_0x47a5('0x45')];++_0x49da2a){_0x530e98=_0x46647f['Messages'][_0x49da2a];var _0x4ec4a8=_0x530e98['UserId']?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2[_0x47a5('0xcf')],_0x530e98[_0x47a5('0xb5')]):'System';var _0xdda046=_0xbcd492['body'][_0x47a5('0xd0')]||util['format'](_0x47a5('0xce'),_0x47a5('0xd1'),_0x530e98[_0x47a5('0x6f')]);switch(_0x5b18a2['agentIdentifier']){case _0x47a5('0xd2'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2['agentAlias'],_0x530e98[_0x47a5('0xb5')]):_0x47a5('0xd3');break;case _0x47a5('0xd4'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?_0x530e98[_0x47a5('0xcc')][_0x47a5('0xd5')]||_0x530e98['User'][_0x47a5('0xd6')]:_0x47a5('0xd3');break;case _0x47a5('0xd7'):_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?_0x530e98[_0x47a5('0xcc')][_0x47a5('0xd6')]:_0x47a5('0xd3');break;default:_0x4ec4a8=_0x530e98[_0x47a5('0xb5')]?util[_0x47a5('0x63')](_0x47a5('0xce'),_0x5b18a2[_0x47a5('0xcf')],_0x530e98[_0x47a5('0xb5')]):_0x47a5('0xd3');}var _0x106b70=util[_0x47a5('0x63')](_0x47a5('0xd8'),moment(_0x530e98[_0x47a5('0x7c')])['format'](_0x47a5('0xd9')),_0x530e98['direction']==='in'?_0xdda046:_0x4ec4a8,_0x530e98['body']);if(!_0x530e98[_0x47a5('0xda')]){fs[_0x47a5('0xdb')](_0x4dc67c,_0x106b70);}}return db[_0x47a5('0xdc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x47a5('0xdd')],'as':_0x47a5('0xde'),'raw':!![]}]});}}})[_0x47a5('0x1f')](function(_0x3e8fce){if(_0x3e8fce&&_0x3e8fce[_0x47a5('0xde')]&&_0xbcd492[_0x47a5('0xb0')]){var _0x1b1f86={'tls':{'rejectUnauthorized':![]}};if(_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xdf')]){_0x1b1f86[_0x47a5('0xdf')]=_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xdf')];}else{_0x1b1f86[_0x47a5('0xe0')]=_0x3e8fce['Smtp']['host'];_0x1b1f86[_0x47a5('0xe1')]=_0x3e8fce['Smtp'][_0x47a5('0xe1')];_0x1b1f86[_0x47a5('0xe2')]=_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe2')];}if(_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe3')]){_0x1b1f86['auth']={'user':_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe4')],'pass':_0x3e8fce[_0x47a5('0xde')]['pass']};}return respondWithRpcPromise(_0x47a5('0xe5'),_0x47a5('0xe6'),{'account':_0x1b1f86,'message':{'from':util[_0x47a5('0x63')](_0x47a5('0xe7'),_0x3e8fce[_0x47a5('0x36')],_0x3e8fce[_0x47a5('0xe8')]||_0x3e8fce[_0x47a5('0xde')][_0x47a5('0xe4')]),'to':_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')],'subject':_0x47a5('0xe9'),'text':util[_0x47a5('0x63')](_0x47a5('0xea'),_0xbcd492[_0x47a5('0xb0')][_0x47a5('0xc7')]),'attachments':[{'path':_0x4dc67c}]}})[_0x47a5('0x1f')](function(){return _0x46647f;})[_0x47a5('0x28')](function(_0x150cff){console[_0x47a5('0x25')](_0x150cff);});}else{return _0x46647f;}})[_0x47a5('0x1f')](respondWithStatusCode(_0xdeaf4e,0xc8))[_0x47a5('0x28')](handleError(_0xdeaf4e,null));};exports[_0x47a5('0xeb')]=function(_0x49692d,_0x185104,_0x55972a){return db[_0x47a5('0xcb')][_0x47a5('0xae')]({'where':{'id':_0x49692d[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x185104,null))[_0x47a5('0x1f')](function(_0x9c376a){if(_0x9c376a){return _0x9c376a[_0x47a5('0xeb')](_0x49692d[_0x47a5('0xb0')]['ids'],_[_0x47a5('0xec')](_0x49692d[_0x47a5('0xb0')],[_0x47a5('0xed'),'id'])||{});}})['then'](respondWithResult(_0x185104,null))[_0x47a5('0x28')](handleError(_0x185104,null));};exports[_0x47a5('0xee')]=function(_0x3d4e23,_0x2687f9,_0x5c6e18){var _0x3c8204={'raw':![],'where':{}};var _0x4469d1={};var _0x1ea792={'count':0x0,'rows':[]};return db[_0x47a5('0x3e')]['findOne']({'where':{'id':_0x3d4e23[_0x47a5('0xaa')]['id']}})['then'](handleEntityNotFound(_0x2687f9,null))['then'](function(_0x37f07c){if(_0x37f07c){_0x4469d1[_0x47a5('0x42')]=_[_0x47a5('0x3f')](db[_0x47a5('0xcb')]['rawAttributes']);_0x4469d1[_0x47a5('0x44')]=_[_0x47a5('0x3f')](_0x3d4e23[_0x47a5('0x44')]);_0x4469d1[_0x47a5('0x40')]=_[_0x47a5('0x41')](_0x4469d1[_0x47a5('0x42')],_0x4469d1['query']);_0x3c8204[_0x47a5('0x43')]=_[_0x47a5('0x41')](_0x4469d1[_0x47a5('0x42')],qs[_0x47a5('0xac')](_0x3d4e23[_0x47a5('0x44')]['fields']));_0x3c8204[_0x47a5('0x43')]=_0x3c8204['attributes'][_0x47a5('0x45')]?_0x3c8204['attributes']:_0x4469d1[_0x47a5('0x42')];if(!_0x3d4e23['query']['hasOwnProperty'](_0x47a5('0x47'))){_0x3c8204[_0x47a5('0x2f')]=qs['limit'](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x3c8204['offset']=qs[_0x47a5('0x2e')](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x2e')]);}_0x3c8204['order']=qs[_0x47a5('0x48')](_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x48')]);_0x3c8204[_0x47a5('0x50')]=qs[_0x47a5('0x40')](_['pick'](_0x3d4e23['query'],_0x4469d1[_0x47a5('0x40')]));_0x3c8204['where'][_0x47a5('0xa6')]=_0x37f07c['id'];if(_0x3d4e23[_0x47a5('0x44')]['filter']){_0x3c8204['where']=_[_0x47a5('0x99')](_0x3c8204['where'],{'$or':_[_0x47a5('0x39')](_0x3c8204[_0x47a5('0x43')],function(_0x2b34c6){var _0x87f207={};_0x87f207[_0x2b34c6]={'$like':'%'+_0x3d4e23[_0x47a5('0x44')][_0x47a5('0x77')]+'%'};return _0x87f207;})});}if(_0x3d4e23[_0x47a5('0x44')]['$gte']){var _0x467db6=_0x3d4e23['query'][_0x47a5('0x7e')][_0x47a5('0x3b')](',');var _0x1840c5={};_0x1840c5[_0x467db6[0x0]]={'$gte':moment(_0x467db6[0x1])[_0x47a5('0x63')](_0x47a5('0xef'))};_0x3c8204[_0x47a5('0x50')]=_[_0x47a5('0x99')](_0x3c8204[_0x47a5('0x50')],_0x1840c5);}_0x3c8204=_[_0x47a5('0x99')]({},_0x3c8204,_0x3d4e23[_0x47a5('0xf0')]);return db[_0x47a5('0xcb')][_0x47a5('0x2d')]({'where':_0x3c8204['where']})[_0x47a5('0x1f')](function(_0x2a34d8){_0x1ea792[_0x47a5('0x2d')]=_0x2a34d8;if(_0x3d4e23['query'][_0x47a5('0xf1')]){_0x3c8204[_0x47a5('0xad')]=[{'all':!![]}];}return db[_0x47a5('0xcb')][_0x47a5('0xf2')](_0x3c8204);})[_0x47a5('0x1f')](function(_0x3a8e77){_0x1ea792['rows']=_0x3a8e77;return _0x1ea792;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x2687f9,_0x3c8204))[_0x47a5('0x28')](handleError(_0x2687f9,null));};exports[_0x47a5('0xf3')]=function(_0x3f7286,_0x30dcbf,_0x3c80d7){var _0x42a384={'where':{}},_0x188bdf={},_0x355c4b={'count':0x0,'rows':[]};return db[_0x47a5('0x3e')]['findOne']({'where':{'id':_0x3f7286['params']['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x30dcbf,null))[_0x47a5('0x1f')](function(_0x3f1d5a){if(_0x3f1d5a){_0x188bdf['model']=_[_0x47a5('0x3f')](db['ChatMessage']['rawAttributes']);_0x188bdf[_0x47a5('0x44')]=_[_0x47a5('0x3f')](_0x3f7286[_0x47a5('0x44')]);_0x188bdf[_0x47a5('0x40')]=_['intersection'](_0x188bdf[_0x47a5('0x42')],_0x188bdf[_0x47a5('0x44')]);_0x42a384['attributes']=_['intersection'](_0x188bdf['model'],qs[_0x47a5('0xac')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0xac')]));_0x42a384[_0x47a5('0x43')]=_0x42a384[_0x47a5('0x43')]['length']?_0x42a384['attributes']:_0x188bdf[_0x47a5('0x42')];if(!_0x3f7286[_0x47a5('0x44')][_0x47a5('0x46')](_0x47a5('0x47'))){_0x42a384['limit']=qs[_0x47a5('0x2f')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0x2f')]);_0x42a384[_0x47a5('0x2e')]=qs['offset'](_0x3f7286['query']['offset']);}_0x42a384[_0x47a5('0x88')]=qs[_0x47a5('0x48')](_0x3f7286[_0x47a5('0x44')][_0x47a5('0x48')]);_0x42a384[_0x47a5('0x50')]=qs[_0x47a5('0x40')](_[_0x47a5('0xf4')](_0x3f7286[_0x47a5('0x44')],_0x188bdf[_0x47a5('0x40')]));_0x42a384['where'][_0x47a5('0xa6')]=_0x3f1d5a['id'];if(_0x3f7286[_0x47a5('0x44')]['filter']){_0x42a384[_0x47a5('0x50')]=_[_0x47a5('0x99')](_0x42a384[_0x47a5('0x50')],{'$or':_[_0x47a5('0x39')](_0x42a384['attributes'],function(_0xbf131c){var _0xd3a9ae={};_0xd3a9ae[_0xbf131c]={'$like':'%'+_0x3f7286[_0x47a5('0x44')]['filter']+'%'};return _0xd3a9ae;})});}_0x42a384['where'][_0x47a5('0xda')]=![];if(_0x3f7286['query']['id']){_0x42a384[_0x47a5('0x50')]['id']={'$gt':_0x3f7286['query']['id']};}_0x42a384=_[_0x47a5('0x99')]({},_0x42a384,_0x3f7286[_0x47a5('0xf0')]);return db[_0x47a5('0xcb')][_0x47a5('0x2d')]({'where':_0x42a384[_0x47a5('0x50')]})['then'](function(_0x4c7102){_0x355c4b[_0x47a5('0x2d')]=_0x4c7102;_0x42a384[_0x47a5('0xad')]=[];if(_0x3f7286[_0x47a5('0x44')][_0x47a5('0xf5')]){_0x42a384['include']['push']({'model':db[_0x47a5('0xcc')],'as':'User','attributes':['id',_0x47a5('0xd6'),'alias']});}if(_0x3f7286[_0x47a5('0x44')]['includeAll']){_0x42a384[_0x47a5('0xad')]=[{'all':!![]}];}return db[_0x47a5('0xcb')][_0x47a5('0xf2')](_0x42a384);})[_0x47a5('0x1f')](function(_0x45c38b){_0x355c4b[_0x47a5('0xa8')]=_0x45c38b;return _0x355c4b;});}})[_0x47a5('0x1f')](respondWithFilteredResult(_0x30dcbf,_0x42a384))[_0x47a5('0x28')](handleError(_0x30dcbf,null));};exports['addTags']=function(_0x3b16f5,_0x4394f0,_0x54c565){return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x3b16f5['params']['id']}})['then'](handleEntityNotFound(_0x4394f0,null))[_0x47a5('0x1f')](function(_0x55c4ae){if(_0x55c4ae){return _0x55c4ae[_0x47a5('0xf6')](_0x3b16f5[_0x47a5('0xb0')][_0x47a5('0xed')],_['omit'](_0x3b16f5[_0x47a5('0xb0')],[_0x47a5('0xed'),'id'])||{})[_0x47a5('0xf7')](function(){return db[_0x47a5('0xf8')][_0x47a5('0xf2')]({'attributes':['id',_0x47a5('0x36'),_0x47a5('0x4b')],'where':{'id':_0x3b16f5['body'][_0x47a5('0xed')]}});})[_0x47a5('0x1f')](function(_0x29320b){socket[_0x47a5('0xf9')](_0x47a5('0xfa'),{'id':Number(_0x3b16f5[_0x47a5('0xaa')]['id']),'tags':_0x29320b||[]});return{'id':Number(_0x3b16f5[_0x47a5('0xaa')]['id']),'tags':_0x29320b||[]};});}})['then'](respondWithResult(_0x4394f0,null))['catch'](handleError(_0x4394f0,null));};exports[_0x47a5('0xfb')]=function(_0x3dbcc7,_0x2d0c51,_0x4bbc94){return db['ChatInteraction'][_0x47a5('0xae')]({'where':{'id':_0x3dbcc7[_0x47a5('0xaa')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x2d0c51,null))[_0x47a5('0x1f')](function(_0x452008){if(_0x452008){return _0x452008[_0x47a5('0xfb')](_0x3dbcc7[_0x47a5('0x44')]['ids']);}})[_0x47a5('0x1f')](respondWithStatusCode(_0x2d0c51,null))[_0x47a5('0x28')](handleError(_0x2d0c51,null));};exports[_0x47a5('0xc4')]=function(_0x540d7f,_0xc5f4a6){var _0x611b40=moment()[_0x47a5('0xfc')]()[_0x47a5('0x85')]();var _0x38aab1=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],_0x47a5('0xfd'),_0x47a5('0xfe'),_0x47a5('0xff'));var _0xd4f6ce=path[_0x47a5('0x86')](config[_0x47a5('0xc5')],'server',_0x47a5('0xfe'),'attachments');var _0x2e6477=path['join'](_0x38aab1,_0x611b40);var _0x1c5cf0=util[_0x47a5('0x63')](_0x47a5('0x100'),_0x540d7f['params']['id'],_0x611b40);var _0xd72a22=path['join'](_0x38aab1,_0x1c5cf0);var _0x23667e=![];return db[_0x47a5('0x3e')][_0x47a5('0xae')]({'where':{'id':_0x540d7f[_0x47a5('0xaa')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x47a5('0x101'),'attributes':['id','body','createdAt',_0x47a5('0x102'),_0x47a5('0xda')],'include':[{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0xcc'),'attributes':['id',_0x47a5('0xd6')],'raw':!![]},{'model':db[_0x47a5('0x103')],'as':_0x47a5('0x104'),'attributes':['id',_0x47a5('0x105'),_0x47a5('0x106')],'raw':!![]},{'model':db['Attachment'],'as':'Attachment','raw':!![]}]},{'model':db[_0x47a5('0xcd')],'as':_0x47a5('0x107'),'attributes':['id',_0x47a5('0x36')]},{'model':db[_0x47a5('0xcc')],'as':_0x47a5('0x108'),'attributes':['id','fullname']}]})[_0x47a5('0x1f')](handleEntityNotFound(_0xc5f4a6,null))[_0x47a5('0x1f')](function(_0x16bcec){if(_0x16bcec){var _0x50ff41=_0x16bcec['get']({'plain':!![]});_0x23667e=!![];var _0x3bb31f={'format':'A4','border':_0x47a5('0x109'),'header':{'height':'40px','contents':{'first':_0x47a5('0x10a')}},'footer':{'height':_0x47a5('0x10b'),'contents':{'default':util[_0x47a5('0x63')]('\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20',util[_0x47a5('0x63')](_0x47a5('0x10c'),_0x47a5('0x10d'),_0x50ff41['id']),moment()[_0x47a5('0x63')](_0x47a5('0x10e'))['toString']())}}};fs[_0x47a5('0x10f')](_0x2e6477);var _0x38accb={'channel':_0x47a5('0x10d'),'account':_0x50ff41[_0x47a5('0x107')]['name'],'agent':_0x50ff41['Owner']?_0x50ff41[_0x47a5('0x108')]['fullname']:_0x47a5('0x110'),'createdAt':moment(_0x50ff41[_0x47a5('0x7c')])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')](),'closedAt':_0x50ff41[_0x47a5('0x111')]?moment(_0x50ff41['closedAt'])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')]():'','disposition':_0x50ff41['disposition'],'chatInfo':{'browser':_0x50ff41['browserName'],'os':_0x50ff41[_0x47a5('0x112')],'referer':_0x50ff41['referer'],'customerIp':_0x50ff41[_0x47a5('0x113')]},'messages':_(_0x50ff41[_0x47a5('0x101')])[_0x47a5('0x114')]()[_0x47a5('0x77')]({'secret':![]})[_0x47a5('0x39')](function(_0x5ae128){if(_0x5ae128['Attachment']){var _0xdc60f8=path[_0x47a5('0x86')](_0xd4f6ce,_0x5ae128[_0x47a5('0xbf')][_0x47a5('0xba')]);if(fs[_0x47a5('0x115')](_0xdc60f8)){fs['createReadStream'](_0xdc60f8)[_0x47a5('0x116')](fs[_0x47a5('0x117')](path[_0x47a5('0x86')](_0x2e6477,_0x5ae128[_0x47a5('0xbf')][_0x47a5('0xba')])));}}return{'date':moment(_0x5ae128['createdAt'])[_0x47a5('0x63')](_0x47a5('0xef'))[_0x47a5('0x85')](),'sender':_0x5ae128[_0x47a5('0x102')]===_0x47a5('0x118')?_0x5ae128[_0x47a5('0xcc')]?_0x5ae128[_0x47a5('0xcc')][_0x47a5('0xd6')]:_0x47a5('0xd3'):_0x5ae128[_0x47a5('0x104')][_0x47a5('0x105')]+(_0x5ae128['Contact'][_0x47a5('0x106')]?'\x20'+_0x5ae128[_0x47a5('0x104')][_0x47a5('0x106')]:''),'body':_0x5ae128[_0x47a5('0xbf')]?_0x5ae128['Attachment']['basename']:_0x5ae128['body'],'direction':_0x5ae128[_0x47a5('0x102')]==='out'?'A':'C','secret':_0x5ae128[_0x47a5('0xda')],'attachment':_0x5ae128[_0x47a5('0xbf')]};})['value']()};return ejs[_0x47a5('0x119')](path[_0x47a5('0x86')](config[_0x47a5('0xc5')],'server',_0x47a5('0x11a'),'downloadInteraction.html'),{'interaction':_0x38accb})[_0x47a5('0x1f')](function(_0x18c0b6){return new BPromise(function(_0x460d52,_0x3c4c48){pdf[_0x47a5('0xaf')](_0x18c0b6,_0x3bb31f)[_0x47a5('0x11b')](path['join'](_0x2e6477,'transcript-'+_0x50ff41['id']+'-'+_0x611b40+'.pdf'),function(_0x2647c3,_0x2da818){if(_0x2647c3)return _0x3c4c48(_0x2647c3);_0x460d52(_0x2da818);});});});}})[_0x47a5('0x1f')](function(){if(_0x23667e){return new BPromise(function(_0x9d1a3b,_0x28bf10){zipdir(_0x2e6477,{'saveTo':_0xd72a22},function(_0x28b865,_0x338c9d){if(_0x28b865)return _0x28bf10(_0x28b865);return _0x9d1a3b(_0x338c9d);});})[_0x47a5('0x1f')](function(){return new BPromise(function(_0x232c36,_0x25954e){rimraf(_0x2e6477,function(_0x277061){if(_0x277061)_0x25954e(_0x277061);return _0x232c36();});});})[_0x47a5('0x1f')](function(){return _0xc5f4a6[_0x47a5('0xc4')](_0xd72a22,_0x1c5cf0,function(_0x22469b){if(_0x22469b){console[_0x47a5('0x11c')](_0x47a5('0x11d'),_0x22469b);}else{fs['unlinkSync'](_0xd72a22);}});});}else{return _0xc5f4a6[_0x47a5('0x29')](0xc8);}})[_0x47a5('0x28')](handleError(_0xc5f4a6,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index dd0287e..37386a1 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 _0x15d8=['ChatMessage','setMaxListeners','update','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','../../mysqldb','ChatInteraction'];(function(_0x36b5a3,_0x534652){var _0x20bd4c=function(_0x242c5b){while(--_0x242c5b){_0x36b5a3['push'](_0x36b5a3['shift']());}};_0x20bd4c(++_0x534652);}(_0x15d8,0x177));var _0x815d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15d8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x815d('0x0'))['db'][_0x815d('0x1')];var ChatMessage=require(_0x815d('0x0'))['db'][_0x815d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x815d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x815d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x370350){return function(_0x5a258f,_0x133bea,_0x218367){_0x5a258f['getUsers']({'attributes':['id'],'raw':!![]})[_0x815d('0x5')](function(_0x3f8101){_0x5a258f[_0x815d('0x6')]('Users',_0x3f8101[_0x815d('0x7')](function(_0x89791c){return{'id':_0x89791c['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5a258f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4eeb4b){_0x5a258f[_0x815d('0x6')](_0x815d('0x8'),_0x4eeb4b[_0x815d('0x9')]);ChatInteractionEvents['emit'](_0x370350+':'+_0x5a258f['id'],_0x5a258f);ChatInteractionEvents[_0x815d('0xa')](_0x370350,_0x5a258f);_0x218367(null);})[_0x815d('0xb')](_0x218367(null));};}for(var e in events){if(events[_0x815d('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x6f44=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','setDataValue','unreadMessages','length','emit','hook','exports','events'];(function(_0x7e2e2e,_0x4ce3b3){var _0x4e69c9=function(_0x5cfee6){while(--_0x5cfee6){_0x7e2e2e['push'](_0x7e2e2e['shift']());}};_0x4e69c9(++_0x4ce3b3);}(_0x6f44,0x10f));var _0x46f4=function(_0x4d04d3,_0x21aefb){_0x4d04d3=_0x4d04d3-0x0;var _0x862e92=_0x6f44[_0x4d04d3];return _0x862e92;};'use strict';var EventEmitter=require(_0x46f4('0x0'));var ChatInteraction=require(_0x46f4('0x1'))['db'][_0x46f4('0x2')];var ChatMessage=require(_0x46f4('0x1'))['db'][_0x46f4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x46f4('0x4')](0x0);var events={'afterCreate':_0x46f4('0x5'),'afterUpdate':_0x46f4('0x6'),'afterDestroy':_0x46f4('0x7')};function emitEvent(_0x39706c){return function(_0x2605bb,_0x296676,_0x235b02){_0x2605bb['getUsers']({'attributes':['id'],'raw':!![]})[_0x46f4('0x8')](function(_0x308407){_0x2605bb['setDataValue'](_0x46f4('0x9'),_0x308407[_0x46f4('0xa')](function(_0x46c29d){return{'id':_0x46c29d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2605bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46f4('0x8')](function(_0x4eafb9){_0x2605bb[_0x46f4('0xb')](_0x46f4('0xc'),_0x4eafb9[_0x46f4('0xd')]);ChatInteractionEvents[_0x46f4('0xe')](_0x39706c+':'+_0x2605bb['id'],_0x2605bb);ChatInteractionEvents[_0x46f4('0xe')](_0x39706c,_0x2605bb);_0x235b02(null);})['catch'](_0x235b02(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x46f4('0xf')](e,emitEvent(event));}}module[_0x46f4('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index fcb6a0a..8a7ba58 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 _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x8dbef6,_0x16e69a){var _0x493240=function(_0x215217){while(--_0x215217){_0x8dbef6['push'](_0x8dbef6['shift']());}};_0x493240(++_0x16e69a);}(_0x757a,0xde));var _0xa757=function(_0x1e7a92,_0x4343d){_0x1e7a92=_0x1e7a92-0x0;var _0x175246=_0x757a[_0x1e7a92];return _0x175246;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});}; \ No newline at end of file +var _0x4fc2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0xc4ceae,_0x566301){var _0x3b1a04=function(_0x30b070){while(--_0x30b070){_0xc4ceae['push'](_0xc4ceae['shift']());}};_0x3b1a04(++_0x566301);}(_0x4fc2,0x111));var _0x24fc=function(_0x53d147,_0x259f9e){_0x53d147=_0x53d147-0x0;var _0x3bc064=_0x4fc2[_0x53d147];return _0x3bc064;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x220f9a,_0x123eff,_0x3641ae){if(_0x220f9a[_0x24fc('0xb')]('closed')){_0x220f9a[_0x24fc('0xc')]=moment()[_0x24fc('0xd')](_0x24fc('0xe'));}_0x3641ae(null,_0x220f9a);}},'charset':_0x24fc('0xf'),'collate':_0x24fc('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f130dd0..f7d3a9a 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 _0xa7b0=['message','catch','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21ae69,_0x502734){var _0x113688=function(_0x4e56fa){while(--_0x4e56fa){_0x21ae69['push'](_0x21ae69['shift']());}};_0x113688(++_0x502734);}(_0xa7b0,0x8e));var _0x0a7b=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0xa7b0[_0x29d87d];return _0x1fd84b;};'use strict';var _=require(_0x0a7b('0x0'));var util=require(_0x0a7b('0x1'));var moment=require('moment');var BPromise=require(_0x0a7b('0x2'));var rs=require(_0x0a7b('0x3'));var fs=require('fs');var Redis=require(_0x0a7b('0x4'));var db=require(_0x0a7b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a7b('0x6'))(_0x0a7b('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a7b('0x8'));var client=jayson[_0x0a7b('0x9')]['http']({'port':0x232a});config[_0x0a7b('0xa')]=_[_0x0a7b('0xb')](config[_0x0a7b('0xa')],{'host':_0x0a7b('0xc'),'port':0x18eb});var socket=require(_0x0a7b('0xd'))(new Redis(config[_0x0a7b('0xa')]));require(_0x0a7b('0xe'))[_0x0a7b('0xf')](socket);function respondWithRpcPromise(_0x34fa05,_0x58b7da,_0x4d357b){return new BPromise(function(_0x4483df,_0x42c9e8){return client[_0x0a7b('0x10')](_0x34fa05,_0x4d357b)[_0x0a7b('0x11')](function(_0x40858a){logger[_0x0a7b('0x12')](_0x0a7b('0x13'),_0x58b7da,_0x0a7b('0x14'));logger[_0x0a7b('0x15')](_0x0a7b('0x16'),_0x58b7da,_0x0a7b('0x14'),JSON[_0x0a7b('0x17')](_0x40858a));if(_0x40858a[_0x0a7b('0x18')]){if(_0x40858a[_0x0a7b('0x18')][_0x0a7b('0x19')]===0x1f4){logger[_0x0a7b('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x58b7da,_0x40858a[_0x0a7b('0x18')][_0x0a7b('0x1a')]);return _0x42c9e8(_0x40858a[_0x0a7b('0x18')]['message']);}logger[_0x0a7b('0x18')](_0x0a7b('0x13'),_0x58b7da,_0x40858a[_0x0a7b('0x18')][_0x0a7b('0x1a')]);return _0x4483df(_0x40858a[_0x0a7b('0x18')][_0x0a7b('0x1a')]);}else{logger[_0x0a7b('0x12')](_0x0a7b('0x13'),_0x58b7da,_0x0a7b('0x14'));_0x4483df(_0x40858a['result'][_0x0a7b('0x1a')]);}})[_0x0a7b('0x1b')](function(_0x152e7f){logger[_0x0a7b('0x18')](_0x0a7b('0x13'),_0x58b7da,_0x152e7f);_0x42c9e8(_0x152e7f);});});}exports['UpdateChatInteraction']=function(_0x377c37){var _0x20ac3a=this;return new Promise(function(_0x3bff24,_0x2dac05){return db[_0x0a7b('0x1c')][_0x0a7b('0x1d')](_0x377c37[_0x0a7b('0x1e')],{'raw':_0x377c37['options']?_0x377c37['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377c37[_0x0a7b('0x1f')]?_0x377c37['options'][_0x0a7b('0x20')]||null:null,'attributes':_0x377c37['options']?_0x377c37['options'][_0x0a7b('0x21')]||null:null,'limit':_0x377c37[_0x0a7b('0x1f')]?_0x377c37[_0x0a7b('0x1f')][_0x0a7b('0x22')]||null:null})['then'](function(_0x121ed9){logger[_0x0a7b('0x12')](_0x0a7b('0x23'),_0x377c37);logger[_0x0a7b('0x15')](_0x0a7b('0x23'),_0x377c37,JSON[_0x0a7b('0x17')](_0x121ed9));_0x3bff24(_0x121ed9);})['catch'](function(_0x486b4c){logger[_0x0a7b('0x18')]('UpdateChatInteraction',_0x486b4c['message'],_0x377c37);_0x2dac05(_0x20ac3a[_0x0a7b('0x18')](0x1f4,_0x486b4c[_0x0a7b('0x1a')]));});});};exports[_0x0a7b('0x24')]=function(_0x31d76d){return new Promise(function(_0x2ff5f4,_0x2f695c){return db[_0x0a7b('0x1c')]['find']({'where':_0x31d76d[_0x0a7b('0x1f')]?_0x31d76d[_0x0a7b('0x1f')][_0x0a7b('0x20')]||null:null})['then'](function(_0x25ee11){if(_0x25ee11){return _0x25ee11[_0x0a7b('0x25')](_0x31d76d[_0x0a7b('0x1e')][_0x0a7b('0x26')],_[_0x0a7b('0x27')](_0x31d76d[_0x0a7b('0x1e')],[_0x0a7b('0x26'),'id'])||{});}})[_0x0a7b('0x28')](function(_0x48a5c7){logger[_0x0a7b('0x12')](_0x0a7b('0x29'),_0x31d76d);logger['debug'](_0x0a7b('0x29'),_0x31d76d,JSON[_0x0a7b('0x17')](_0x48a5c7));_0x2ff5f4(_0x48a5c7);})[_0x0a7b('0x1b')](function(_0xff0237){logger[_0x0a7b('0x18')](_0x0a7b('0x29'),_0xff0237[_0x0a7b('0x1a')],_0x31d76d);_0x2f695c(_this[_0x0a7b('0x18')](0x1f4,_0xff0237[_0x0a7b('0x1a')]));});});}; \ No newline at end of file +var _0x37e8=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','update','body','options','raw','where','debug','stringify','AddTagsToChatInteraction','ChatInteraction','find','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x37e8,0x10a));var _0x837e=function(_0x2100bb,_0x56d99b){_0x2100bb=_0x2100bb-0x0;var _0x409b31=_0x37e8[_0x2100bb];return _0x409b31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x837e('0x0'));var BPromise=require(_0x837e('0x1'));var rs=require(_0x837e('0x2'));var fs=require('fs');var Redis=require(_0x837e('0x3'));var db=require(_0x837e('0x4'))['db'];var utils=require(_0x837e('0x5'));var logger=require(_0x837e('0x6'))(_0x837e('0x7'));var config=require(_0x837e('0x8'));var jayson=require(_0x837e('0x9'));var client=jayson[_0x837e('0xa')][_0x837e('0xb')]({'port':0x232a});config[_0x837e('0xc')]=_['defaults'](config[_0x837e('0xc')],{'host':_0x837e('0xd'),'port':0x18eb});var socket=require(_0x837e('0xe'))(new Redis(config['redis']));require(_0x837e('0xf'))['register'](socket);function respondWithRpcPromise(_0xf1866c,_0x471de5,_0xf2aa43){return new BPromise(function(_0x181eea,_0x3e7ba1){return client[_0x837e('0x10')](_0xf1866c,_0xf2aa43)[_0x837e('0x11')](function(_0x20ff29){logger[_0x837e('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x471de5,_0x837e('0x13'));logger['debug'](_0x837e('0x14'),_0x471de5,_0x837e('0x13'),JSON['stringify'](_0x20ff29));if(_0x20ff29[_0x837e('0x15')]){if(_0x20ff29[_0x837e('0x15')]['code']===0x1f4){logger[_0x837e('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x471de5,_0x20ff29['error'][_0x837e('0x16')]);return _0x3e7ba1(_0x20ff29['error'][_0x837e('0x16')]);}logger[_0x837e('0x15')](_0x837e('0x17'),_0x471de5,_0x20ff29[_0x837e('0x15')][_0x837e('0x16')]);return _0x181eea(_0x20ff29[_0x837e('0x15')][_0x837e('0x16')]);}else{logger['info'](_0x837e('0x17'),_0x471de5,_0x837e('0x13'));_0x181eea(_0x20ff29['result'][_0x837e('0x16')]);}})[_0x837e('0x18')](function(_0x265890){logger[_0x837e('0x15')](_0x837e('0x17'),_0x471de5,_0x265890);_0x3e7ba1(_0x265890);});});}exports[_0x837e('0x19')]=function(_0x5e8550){var _0x548cf5=this;return new Promise(function(_0x26f5ed,_0x58f31f){return db['ChatInteraction'][_0x837e('0x1a')](_0x5e8550[_0x837e('0x1b')],{'raw':_0x5e8550[_0x837e('0x1c')]?_0x5e8550[_0x837e('0x1c')][_0x837e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e8550[_0x837e('0x1c')]?_0x5e8550[_0x837e('0x1c')][_0x837e('0x1e')]||null:null,'attributes':_0x5e8550['options']?_0x5e8550[_0x837e('0x1c')]['attributes']||null:null,'limit':_0x5e8550['options']?_0x5e8550[_0x837e('0x1c')]['limit']||null:null})[_0x837e('0x11')](function(_0x4b8bf0){logger['info'](_0x837e('0x19'),_0x5e8550);logger[_0x837e('0x1f')](_0x837e('0x19'),_0x5e8550,JSON[_0x837e('0x20')](_0x4b8bf0));_0x26f5ed(_0x4b8bf0);})[_0x837e('0x18')](function(_0x2dae39){logger[_0x837e('0x15')]('UpdateChatInteraction',_0x2dae39[_0x837e('0x16')],_0x5e8550);_0x58f31f(_0x548cf5[_0x837e('0x15')](0x1f4,_0x2dae39[_0x837e('0x16')]));});});};exports[_0x837e('0x21')]=function(_0xbb9228){return new Promise(function(_0x3fa957,_0x1155e9){return db[_0x837e('0x22')][_0x837e('0x23')]({'where':_0xbb9228[_0x837e('0x1c')]?_0xbb9228[_0x837e('0x1c')][_0x837e('0x1e')]||null:null})[_0x837e('0x11')](function(_0x1343a4){if(_0x1343a4){return _0x1343a4['addTags'](_0xbb9228[_0x837e('0x1b')]['ids'],_[_0x837e('0x24')](_0xbb9228[_0x837e('0x1b')],['ids','id'])||{});}})[_0x837e('0x25')](function(_0x446f64){logger[_0x837e('0x12')](_0x837e('0x26'),_0xbb9228);logger['debug']('AddTags',_0xbb9228,JSON[_0x837e('0x20')](_0x446f64));_0x3fa957(_0x446f64);})[_0x837e('0x18')](function(_0x97ba24){logger[_0x837e('0x15')]('AddTags',_0x97ba24[_0x837e('0x16')],_0xbb9228);_0x1155e9(_this[_0x837e('0x15')](0x1f4,_0x97ba24[_0x837e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index db52964..9605f51 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 _0x3488=['removeListener','register','./chatInteraction.events','save','remove','emit'];(function(_0x255654,_0x4b8356){var _0x57a56a=function(_0x16e631){while(--_0x16e631){_0x255654['push'](_0x255654['shift']());}};_0x57a56a(++_0x4b8356);}(_0x3488,0x19a));var _0x8348=function(_0x266210,_0x206e6e){_0x266210=_0x266210-0x0;var _0x30647c=_0x3488[_0x266210];return _0x30647c;};'use strict';var ChatInteractionEvents=require(_0x8348('0x0'));var events=[_0x8348('0x1'),_0x8348('0x2'),'update'];function createListener(_0x49f3c7,_0x261291){return function(_0x3c6863){_0x261291[_0x8348('0x3')](_0x49f3c7,_0x3c6863);};}function removeListener(_0x501d81,_0x8bf092){return function(){ChatInteractionEvents[_0x8348('0x4')](_0x501d81,_0x8bf092);};}exports[_0x8348('0x5')]=function(_0x1cceae){for(var _0x12dbd9=0x0,_0x2c0f30=events['length'];_0x12dbd9<_0x2c0f30;_0x12dbd9++){var _0x1de18d=events[_0x12dbd9];var _0x3370f7=createListener('chatInteraction:'+_0x1de18d,_0x1cceae);ChatInteractionEvents['on'](_0x1de18d,_0x3370f7);}}; \ No newline at end of file +var _0x3a55=['removeListener','register','chatInteraction:','./chatInteraction.events','save','update','emit'];(function(_0x1cb520,_0x2ecd28){var _0x2294e7=function(_0x4d876d){while(--_0x4d876d){_0x1cb520['push'](_0x1cb520['shift']());}};_0x2294e7(++_0x2ecd28);}(_0x3a55,0x1bc));var _0x53a5=function(_0x4bb6ca,_0x58ef90){_0x4bb6ca=_0x4bb6ca-0x0;var _0x542c67=_0x3a55[_0x4bb6ca];return _0x542c67;};'use strict';var ChatInteractionEvents=require(_0x53a5('0x0'));var events=[_0x53a5('0x1'),'remove',_0x53a5('0x2')];function createListener(_0x1d585b,_0x1d369b){return function(_0x27333b){_0x1d369b[_0x53a5('0x3')](_0x1d585b,_0x27333b);};}function removeListener(_0x305339,_0x506a97){return function(){ChatInteractionEvents[_0x53a5('0x4')](_0x305339,_0x506a97);};}exports[_0x53a5('0x5')]=function(_0x3dc0b8){for(var _0x11ce6d=0x0,_0x17b121=events['length'];_0x11ce6d<_0x17b121;_0x11ce6d++){var _0x40cce2=events[_0x11ce6d];var _0x218496=createListener(_0x53a5('0x6')+_0x40cce2,_0x3dc0b8);ChatInteractionEvents['on'](_0x40cce2,_0x218496);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index a7383a0..fdfa903 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 _0x34b7=['/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x34b7,0x196));var _0x734b=function(_0x4ed786,_0x74f270){_0x4ed786=_0x4ed786-0x0;var _0x2f0243=_0x34b7[_0x4ed786];return _0x2f0243;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var auth=require(_0x734b('0x4'));var interaction=require(_0x734b('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x734b('0x6')]('/',auth[_0x734b('0x7')](),controller[_0x734b('0x8')]);router[_0x734b('0x6')](_0x734b('0x9'),auth[_0x734b('0x7')](),controller['describe']);router[_0x734b('0x6')](_0x734b('0xa'),auth['isChatInteractionAuthorized'](),controller['show']);router['get'](_0x734b('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x734b('0xc')]);router[_0x734b('0x6')](_0x734b('0xd'),auth[_0x734b('0x7')](),controller[_0x734b('0xe')]);router[_0x734b('0x6')](_0x734b('0xf'),auth[_0x734b('0x10')](),controller[_0x734b('0x11')]);router[_0x734b('0x6')](_0x734b('0x12'),auth[_0x734b('0x7')](),controller[_0x734b('0x13')]);router[_0x734b('0x14')]('/',auth['isAuthenticated'](),controller[_0x734b('0x15')]);var upload=multer({'storage':multer[_0x734b('0x16')]({'destination':function(_0x47791c,_0xd1ab2a,_0x19f427){_0x19f427(null,path[_0x734b('0x17')](config[_0x734b('0x18')],_0x734b('0x19')));},'filename':function(_0xa6d111,_0x4b8c63,_0x42407a){_0x42407a(null,util['format'](_0x734b('0x1a'),Date[_0x734b('0x1b')](),_0x4b8c63[_0x734b('0x1c')][_0x734b('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x734b('0x1e')](_0x734b('0x1f')),controller[_0x734b('0x20')]);router[_0x734b('0x14')](_0x734b('0xd'),auth[_0x734b('0x10')](),controller[_0x734b('0x21')]);router[_0x734b('0x14')](_0x734b('0x22'),auth[_0x734b('0x7')](),interaction[_0x734b('0x23')](_0x734b('0x24'),_0x734b('0x25')),controller[_0x734b('0x26')]);router['put'](_0x734b('0xa'),auth[_0x734b('0x7')](),interaction['tracked'](_0x734b('0x24'),_0x734b('0x27')),controller[_0x734b('0x28')]);router[_0x734b('0x29')](_0x734b('0x2a'),controller[_0x734b('0x2b')]);router[_0x734b('0x29')](_0x734b('0x2c'),auth[_0x734b('0x10')](),controller[_0x734b('0x2d')]);router[_0x734b('0x29')](_0x734b('0x2e'),controller[_0x734b('0x2f')]);router['delete']('/:id',auth[_0x734b('0x7')](),interaction[_0x734b('0x23')]('chat',_0x734b('0x30')),controller[_0x734b('0x31')]);router[_0x734b('0x32')](_0x734b('0x22'),auth[_0x734b('0x7')](),controller[_0x734b('0x33')]);module[_0x734b('0x34')]=router; \ No newline at end of file +var _0x955f=['removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','format','%s-%s','now','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy'];(function(_0x5e443a,_0x2dbc48){var _0x48796=function(_0x2c583a){while(--_0x2c583a){_0x5e443a['push'](_0x5e443a['shift']());}};_0x48796(++_0x2dbc48);}(_0x955f,0x1eb));var _0xf955=function(_0x423183,_0x4bfd0d){_0x423183=_0x423183-0x0;var _0x2adc1d=_0x955f[_0x423183];return _0x2adc1d;};'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 auth=require(_0xf955('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf955('0x6'));router['get']('/',auth[_0xf955('0x7')](),controller[_0xf955('0x8')]);router[_0xf955('0x9')]('/describe',auth[_0xf955('0x7')](),controller[_0xf955('0xa')]);router['get'](_0xf955('0xb'),auth[_0xf955('0xc')](),controller[_0xf955('0xd')]);router[_0xf955('0x9')](_0xf955('0xe'),auth[_0xf955('0xc')](),controller[_0xf955('0xf')]);router['get'](_0xf955('0x10'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0x9')](_0xf955('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xf955('0x13')]);router['get'](_0xf955('0x14'),auth['isAuthenticated'](),controller[_0xf955('0x15')]);router[_0xf955('0x16')]('/',auth[_0xf955('0x7')](),controller[_0xf955('0x17')]);var upload=multer({'storage':multer[_0xf955('0x18')]({'destination':function(_0x341b8c,_0x1c3235,_0x2783f2){_0x2783f2(null,path[_0xf955('0x19')](config[_0xf955('0x1a')],'server/files/attachments/'));},'filename':function(_0xc29b35,_0x54e60b,_0x3139d5){_0x3139d5(null,util[_0xf955('0x1b')](_0xf955('0x1c'),Date[_0xf955('0x1d')](),_0x54e60b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf955('0x16')](_0xf955('0x1e'),upload[_0xf955('0x1f')]('file'),controller[_0xf955('0x20')]);router[_0xf955('0x16')](_0xf955('0x10'),auth[_0xf955('0xc')](),controller[_0xf955('0x21')]);router['post'](_0xf955('0x22'),auth[_0xf955('0x7')](),interaction[_0xf955('0x23')]('chat',_0xf955('0x24')),controller['addTags']);router[_0xf955('0x25')](_0xf955('0xb'),auth[_0xf955('0x7')](),interaction[_0xf955('0x23')](_0xf955('0x26'),'chatinteraction:update'),controller[_0xf955('0x27')]);router[_0xf955('0x25')](_0xf955('0x28'),controller[_0xf955('0x29')]);router[_0xf955('0x25')](_0xf955('0x2a'),auth[_0xf955('0xc')](),controller['abandon']);router[_0xf955('0x25')](_0xf955('0x2b'),controller[_0xf955('0x2c')]);router[_0xf955('0x2d')](_0xf955('0xb'),auth[_0xf955('0x7')](),interaction[_0xf955('0x23')]('chat',_0xf955('0x2e')),controller[_0xf955('0x2f')]);router[_0xf955('0x2d')](_0xf955('0x22'),auth[_0xf955('0x7')](),controller[_0xf955('0x30')]);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 75f2ee6..5a03f56 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 _0x3a6d=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x563a6f,_0x2fce42){var _0x174722=function(_0x2fa8b4){while(--_0x2fa8b4){_0x563a6f['push'](_0x563a6f['shift']());}};_0x174722(++_0x2fce42);}(_0x3a6d,0x143));var _0xd3a6=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3a6d[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd3a6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd3a6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd3a6('0x4')]}}; \ No newline at end of file +var _0x5fdc=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x425ec8,_0x293ff){var _0x1cbf90=function(_0x1a1974){while(--_0x1a1974){_0x425ec8['push'](_0x425ec8['shift']());}};_0x1cbf90(++_0x293ff);}(_0x5fdc,0x127));var _0xc5fd=function(_0x3b1b76,_0x4597d9){_0x3b1b76=_0x3b1b76-0x0;var _0x1a175d=_0x5fdc[_0x3b1b76];return _0x1a175d;};'use strict';var Sequelize=require(_0xc5fd('0x0'));module[_0xc5fd('0x1')]={'body':{'type':Sequelize[_0xc5fd('0x2')](_0xc5fd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc5fd('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc5fd('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0083d88..fb820c2 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 _0xb9c7=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','params','create','body','find','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','count','offset','apply','reject','then','destroy','end','stack','name','index'];(function(_0x3efd55,_0x185a43){var _0x302eef=function(_0x42adf7){while(--_0x42adf7){_0x3efd55['push'](_0x3efd55['shift']());}};_0x302eef(++_0x185a43);}(_0xb9c7,0x182));var _0x7b9c=function(_0x38f044,_0x4597b1){_0x38f044=_0x38f044-0x0;var _0x544f07=_0xb9c7[_0x38f044];return _0x544f07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7b9c('0x0'));var rimraf=require(_0x7b9c('0x1'));var zipdir=require(_0x7b9c('0x2'));var jsonpatch=require(_0x7b9c('0x3'));var rp=require(_0x7b9c('0x4'));var moment=require(_0x7b9c('0x5'));var BPromise=require(_0x7b9c('0x6'));var Mustache=require(_0x7b9c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7b9c('0x8'));var ejs=require(_0x7b9c('0x9'));var fs=require('fs');var _=require(_0x7b9c('0xa'));var squel=require(_0x7b9c('0xb'));var crypto=require(_0x7b9c('0xc'));var jsforce=require(_0x7b9c('0xd'));var deskjs=require(_0x7b9c('0xe'));var toCsv=require(_0x7b9c('0x8'));var querystring=require(_0x7b9c('0xf'));var Papa=require(_0x7b9c('0x10'));var Redis=require(_0x7b9c('0x11'));var authService=require(_0x7b9c('0x12'));var qs=require(_0x7b9c('0x13'));var hardwareService=require(_0x7b9c('0x14'));var logger=require('../../config/logger')(_0x7b9c('0x15'));var utils=require(_0x7b9c('0x16'));var config=require(_0x7b9c('0x17'));var db=require(_0x7b9c('0x18'))['db'];config[_0x7b9c('0x19')]=_[_0x7b9c('0x1a')](config[_0x7b9c('0x19')],{'host':_0x7b9c('0x1b'),'port':0x18eb});var socket=require(_0x7b9c('0x1c'))(new Redis(config[_0x7b9c('0x19')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x402a3f,_0x48143c){_0x48143c=_0x48143c||0xcc;return function(_0x569672){if(_0x569672){return _0x402a3f[_0x7b9c('0x1d')](_0x48143c);}return _0x402a3f['status'](_0x48143c)['end']();};}function respondWithResult(_0x1f41bd,_0x2550a2){_0x2550a2=_0x2550a2||0xc8;return function(_0x2d25cf){if(_0x2d25cf){return _0x1f41bd[_0x7b9c('0x1e')](_0x2550a2)[_0x7b9c('0x1f')](_0x2d25cf);}};}function respondWithFilteredResult(_0x945d90,_0x3baab2){return function(_0x225933){if(_0x225933){var _0x1276ca=_0x225933[_0x7b9c('0x20')],_0x2e7788=_0x3baab2[_0x7b9c('0x21')],_0x3e8aae=_0x3baab2[_0x7b9c('0x21')]+_0x3baab2['limit'],_0x22bdb3;if(_0x3e8aae>=_0x1276ca){_0x3e8aae=_0x1276ca;_0x22bdb3=0xc8;}else{_0x22bdb3=0xce;}_0x945d90[_0x7b9c('0x1e')](_0x22bdb3);return _0x945d90['set']('Content-Range',_0x2e7788+'-'+_0x3e8aae+'/'+_0x1276ca)[_0x7b9c('0x1f')](_0x225933);}return null;};}function patchUpdates(_0x5b164c){return function(_0x1d169e){try{jsonpatch[_0x7b9c('0x22')](_0x1d169e,_0x5b164c,!![]);}catch(_0x33e0db){return BPromise[_0x7b9c('0x23')](_0x33e0db);}return _0x1d169e['save']();};}function saveUpdates(_0x5b4560,_0x1372d1){return function(_0x34a8a7){if(_0x34a8a7){return _0x34a8a7['update'](_0x5b4560)[_0x7b9c('0x24')](function(_0x422cec){return _0x422cec;});}return null;};}function removeEntity(_0x193d10,_0x5b3fb1){return function(_0x32001d){if(_0x32001d){return _0x32001d[_0x7b9c('0x25')]()[_0x7b9c('0x24')](function(){_0x193d10[_0x7b9c('0x1e')](0xcc)[_0x7b9c('0x26')]();});}};}function handleEntityNotFound(_0x2f868a,_0xf1a91e){return function(_0x1ca28d){if(!_0x1ca28d){_0x2f868a[_0x7b9c('0x1d')](0x194);}return _0x1ca28d;};}function handleError(_0x3bd4b9,_0x277e55){_0x277e55=_0x277e55||0x1f4;return function(_0x335499){logger['error'](_0x335499[_0x7b9c('0x27')]);if(_0x335499['name']){delete _0x335499[_0x7b9c('0x28')];}_0x3bd4b9['status'](_0x277e55)['send'](_0x335499);};}exports[_0x7b9c('0x29')]=function(_0x1dda00,_0x12e30a){var _0x4e00dc={},_0x3bdca1={},_0x40fb8f={'count':0x0,'rows':[]};var _0x110fba=db['ChatInternalMessage'][_0x7b9c('0x2a')];_0x3bdca1[_0x7b9c('0x2b')]=_[_0x7b9c('0x2c')](_0x110fba);_0x3bdca1[_0x7b9c('0x2d')]=_[_0x7b9c('0x2c')](_0x1dda00[_0x7b9c('0x2d')]);_0x3bdca1[_0x7b9c('0x2e')]=_[_0x7b9c('0x2f')](_0x3bdca1['model'],_0x3bdca1[_0x7b9c('0x2d')]);_0x4e00dc[_0x7b9c('0x30')]=_[_0x7b9c('0x2f')](_0x3bdca1[_0x7b9c('0x2b')],qs['fields'](_0x1dda00['query'][_0x7b9c('0x31')]));_0x4e00dc[_0x7b9c('0x30')]=_0x4e00dc['attributes'][_0x7b9c('0x32')]?_0x4e00dc[_0x7b9c('0x30')]:_0x3bdca1[_0x7b9c('0x2b')];if(!_0x1dda00[_0x7b9c('0x2d')][_0x7b9c('0x33')](_0x7b9c('0x34'))){_0x4e00dc[_0x7b9c('0x35')]=qs['limit'](_0x1dda00[_0x7b9c('0x2d')][_0x7b9c('0x35')]);_0x4e00dc[_0x7b9c('0x21')]=qs[_0x7b9c('0x21')](_0x1dda00['query'][_0x7b9c('0x21')]);}_0x4e00dc[_0x7b9c('0x36')]=qs[_0x7b9c('0x37')](_0x1dda00[_0x7b9c('0x2d')][_0x7b9c('0x37')]);_0x4e00dc[_0x7b9c('0x38')]=qs[_0x7b9c('0x2e')](_[_0x7b9c('0x39')](_0x1dda00[_0x7b9c('0x2d')],_0x3bdca1['filters']));if(_0x1dda00[_0x7b9c('0x2d')][_0x7b9c('0x3a')]){_0x4e00dc[_0x7b9c('0x38')]=_[_0x7b9c('0x3b')](_0x4e00dc[_0x7b9c('0x38')],{'$or':_['map'](_0x110fba,function(_0x39a031){if(_0x39a031['type'][_0x7b9c('0x3c')]!==_0x7b9c('0x3d')){var _0x55fad2={};_0x55fad2[_0x39a031[_0x7b9c('0x3e')]]={'$like':'%'+_0x1dda00['query'][_0x7b9c('0x3a')]+'%'};return _0x55fad2;}})});}_0x4e00dc=_[_0x7b9c('0x3b')]({},_0x4e00dc,_0x1dda00[_0x7b9c('0x3f')]);var _0x38c90e={'where':_0x4e00dc[_0x7b9c('0x38')]};return db[_0x7b9c('0x40')][_0x7b9c('0x20')](_0x38c90e)[_0x7b9c('0x24')](function(_0x2bf8e7){_0x40fb8f['count']=_0x2bf8e7;if(_0x1dda00[_0x7b9c('0x2d')][_0x7b9c('0x41')]){_0x4e00dc[_0x7b9c('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7b9c('0x43')](_0x4e00dc);})['then'](function(_0x34c9d6){_0x40fb8f[_0x7b9c('0x44')]=_0x34c9d6;return _0x40fb8f;})[_0x7b9c('0x24')](respondWithFilteredResult(_0x12e30a,_0x4e00dc))[_0x7b9c('0x45')](handleError(_0x12e30a,null));};exports['show']=function(_0x1b5b84,_0x3ba4e6){var _0x53f76a={'raw':!![],'where':{'id':_0x1b5b84[_0x7b9c('0x46')]['id']}},_0x1c1379={};_0x1c1379['model']=_[_0x7b9c('0x2c')](db[_0x7b9c('0x40')][_0x7b9c('0x2a')]);_0x1c1379[_0x7b9c('0x2d')]=_[_0x7b9c('0x2c')](_0x1b5b84['query']);_0x1c1379[_0x7b9c('0x2e')]=_[_0x7b9c('0x2f')](_0x1c1379[_0x7b9c('0x2b')],_0x1c1379[_0x7b9c('0x2d')]);_0x53f76a[_0x7b9c('0x30')]=_[_0x7b9c('0x2f')](_0x1c1379[_0x7b9c('0x2b')],qs[_0x7b9c('0x31')](_0x1b5b84[_0x7b9c('0x2d')][_0x7b9c('0x31')]));_0x53f76a[_0x7b9c('0x30')]=_0x53f76a['attributes'][_0x7b9c('0x32')]?_0x53f76a['attributes']:_0x1c1379['model'];if(_0x1b5b84['query']['includeAll']){_0x53f76a[_0x7b9c('0x42')]=[{'all':!![]}];}_0x53f76a=_['merge']({},_0x53f76a,_0x1b5b84[_0x7b9c('0x3f')]);return db[_0x7b9c('0x40')]['find'](_0x53f76a)[_0x7b9c('0x24')](handleEntityNotFound(_0x3ba4e6,null))[_0x7b9c('0x24')](respondWithResult(_0x3ba4e6,null))[_0x7b9c('0x45')](handleError(_0x3ba4e6,null));};exports[_0x7b9c('0x47')]=function(_0x534e62,_0xd50804){return db['ChatInternalMessage'][_0x7b9c('0x47')](_0x534e62[_0x7b9c('0x48')],{})['then'](respondWithResult(_0xd50804,0xc9))[_0x7b9c('0x45')](handleError(_0xd50804,null));};exports['update']=function(_0x543c39,_0x14094b){if(_0x543c39[_0x7b9c('0x48')]['id']){delete _0x543c39[_0x7b9c('0x48')]['id'];}return db[_0x7b9c('0x40')][_0x7b9c('0x49')]({'where':{'id':_0x543c39[_0x7b9c('0x46')]['id']}})['then'](handleEntityNotFound(_0x14094b,null))['then'](saveUpdates(_0x543c39[_0x7b9c('0x48')],null))[_0x7b9c('0x24')](respondWithResult(_0x14094b,null))['catch'](handleError(_0x14094b,null));};exports[_0x7b9c('0x25')]=function(_0x3aacf1,_0xbc6f04){return db[_0x7b9c('0x40')]['find']({'where':{'id':_0x3aacf1['params']['id']}})[_0x7b9c('0x24')](handleEntityNotFound(_0xbc6f04,null))[_0x7b9c('0x24')](removeEntity(_0xbc6f04,null))[_0x7b9c('0x45')](handleError(_0xbc6f04,null));};exports['describe']=function(_0x220854,_0x3f6049){return db[_0x7b9c('0x40')]['describe']()[_0x7b9c('0x24')](respondWithResult(_0x3f6049,null))[_0x7b9c('0x45')](handleError(_0x3f6049,null));};function wrapUser(_0x15b14a){return function(_0x1a1038){var _0x2742b7=_0x15b14a[_0x7b9c('0x4a')]({'plain':!![]});_0x2742b7[_0x7b9c('0x4b')]=[];if(_0x1a1038){_0x2742b7[_0x7b9c('0x4c')]=_0x1a1038[_0x7b9c('0x4d')];_0x2742b7[_0x7b9c('0x4e')]=_0x1a1038;}else{_0x2742b7[_0x7b9c('0x4c')]=moment(0x0)[_0x7b9c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2742b7[_0x7b9c('0x4e')]={};}return _0x2742b7;};}exports[_0x7b9c('0x50')]=function(_0x5bdeb5,_0x2eb6eb,_0x1175e5){var _0x505b00=[];return db[_0x7b9c('0x51')]['findAll']({'where':{'role':[_0x7b9c('0x52'),_0x7b9c('0x53'),_0x7b9c('0x54')]},'attributes':['id','fullname',_0x7b9c('0x28'),'role',_0x7b9c('0x55'),_0x7b9c('0x56'),_0x7b9c('0x57'),'lastLoginAt',_0x7b9c('0x58'),_0x7b9c('0x59')],'order':qs[_0x7b9c('0x37')](_0x7b9c('0x5a')),'include':[{'model':db[_0x7b9c('0x5b')],'as':_0x7b9c('0x5c'),'attributes':['id',_0x7b9c('0x28'),_0x7b9c('0x5d')],'through':{'attributes':[]}}]})['then'](function(_0x39796e){if(_0x39796e){var _0x18e7a2=_0x5bdeb5[_0x7b9c('0x54')][_0x7b9c('0x4a')]({'plain':!![]});if(!_0x18e7a2)throw new Error(_0x7b9c('0x5e'));if(_0x18e7a2[_0x7b9c('0x5f')]===_0x7b9c('0x54')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x18e7a2[_0x7b9c('0x60')]},'raw':!![]})[_0x7b9c('0x24')](function(_0x4136e6){if(_0x4136e6){if(_0x4136e6[_0x7b9c('0x61')]===0x0){return db[_0x7b9c('0x62')]['findAll']({'where':{'sectionId':_0x4136e6['id']},'raw':!![]})[_0x7b9c('0x24')](function(_0x263d61){var _0x53d523=[];if(_[_0x7b9c('0x63')](_0x263d61)){_0x53d523=_[_0x7b9c('0x3a')](_0x39796e,function(_0x230fc8){if(_0x230fc8[_0x7b9c('0x5f')]!==_0x7b9c('0x52')){return _0x230fc8;}});return _0x53d523;}else{for(var _0xf82ef=0x0;_0xf82ef<_0x39796e[_0x7b9c('0x32')];_0xf82ef++){var _0x4aa63a=_0x39796e[_0xf82ef];if(_0x4aa63a['role']===_0x7b9c('0x52')){var _0x27c61f=_[_0x7b9c('0x49')](_0x263d61,function(_0x1d1dc9){return _0x1d1dc9[_0x7b9c('0x64')]===_0x4aa63a['id'];});if(_0x27c61f)_0x53d523[_0x7b9c('0x65')](_0x4aa63a);}else{_0x53d523[_0x7b9c('0x65')](_0x4aa63a);}}return _0x53d523;}});}else{return _0x39796e;}}else{var _0x1f9a90=_[_0x7b9c('0x3a')](_0x39796e,function(_0x41be44){if(_0x41be44[_0x7b9c('0x5f')]!=='agent'){return _0x41be44;}});return _0x1f9a90;}});}else{return _0x39796e;}}})[_0x7b9c('0x24')](function(_0x293976){var _0x498b12=[];if(_0x293976){_0x505b00=_0x293976;for(var _0x1a98c0=0x0;_0x1a98c0<_0x293976[_0x7b9c('0x32')];_0x1a98c0+=0x1){_0x505b00[_0x1a98c0][_0x7b9c('0x4b')]=[];_0x498b12['push'](db[_0x7b9c('0x40')][_0x7b9c('0x49')]({'where':{'FromId':[_0x5bdeb5[_0x7b9c('0x54')]['id'],_0x293976[_0x1a98c0]['id']],'ToId':[_0x5bdeb5['user']['id'],_0x293976[_0x1a98c0]['id']],'ChatGroupId':null},'attributes':['id',_0x7b9c('0x4d'),_0x7b9c('0x66'),_0x7b9c('0x67'),_0x7b9c('0x68'),_0x7b9c('0x48')],'order':qs[_0x7b9c('0x37')](_0x7b9c('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7b9c('0x24')](wrapUser(_0x293976[_0x1a98c0])));}return BPromise[_0x7b9c('0x6a')](_0x498b12);}return[];})[_0x7b9c('0x24')](function(_0x4150be){return{'rows':_0x4150be,'count':_0x4150be['length']};})['then'](respondWithResult(_0x2eb6eb,null))[_0x7b9c('0x45')](handleError(_0x2eb6eb,null));}; \ No newline at end of file +var _0x34e5=['model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','type','key','VIRTUAL','field','merge','count','includeAll','findAll','rows','catch','params','ChatInternalMessage','rawAttributes','length','include','create','body','find','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','name','userpic','internal','allowmessenger','-online','VoiceQueue','VoiceQueues','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','push','filter','FromId','ToId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','index'];(function(_0xce5934,_0x34cbbb){var _0x6cf803=function(_0xabcb6c){while(--_0xabcb6c){_0xce5934['push'](_0xce5934['shift']());}};_0x6cf803(++_0x34cbbb);}(_0x34e5,0x172));var _0x534e=function(_0x4fc78b,_0x5b355e){_0x4fc78b=_0x4fc78b-0x0;var _0x296562=_0x34e5[_0x4fc78b];return _0x296562;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x534e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x534e('0x1'));var jsonpatch=require(_0x534e('0x2'));var rp=require(_0x534e('0x3'));var moment=require(_0x534e('0x4'));var BPromise=require(_0x534e('0x5'));var Mustache=require('mustache');var util=require(_0x534e('0x6'));var path=require(_0x534e('0x7'));var sox=require(_0x534e('0x8'));var csv=require(_0x534e('0x9'));var ejs=require(_0x534e('0xa'));var fs=require('fs');var _=require(_0x534e('0xb'));var squel=require(_0x534e('0xc'));var crypto=require('crypto');var jsforce=require(_0x534e('0xd'));var deskjs=require(_0x534e('0xe'));var toCsv=require(_0x534e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x534e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x534e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x534e('0x11'))(_0x534e('0x12'));var utils=require(_0x534e('0x13'));var config=require('../../config/environment');var db=require(_0x534e('0x14'))['db'];config[_0x534e('0x15')]=_[_0x534e('0x16')](config[_0x534e('0x15')],{'host':_0x534e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x534e('0x15')]));require(_0x534e('0x18'))[_0x534e('0x19')](socket);function respondWithStatusCode(_0x3ff42d,_0x359565){_0x359565=_0x359565||0xcc;return function(_0x478027){if(_0x478027){return _0x3ff42d[_0x534e('0x1a')](_0x359565);}return _0x3ff42d[_0x534e('0x1b')](_0x359565)[_0x534e('0x1c')]();};}function respondWithResult(_0x5282cb,_0x4171d6){_0x4171d6=_0x4171d6||0xc8;return function(_0x3940c3){if(_0x3940c3){return _0x5282cb['status'](_0x4171d6)['json'](_0x3940c3);}};}function respondWithFilteredResult(_0x2de9d0,_0x28ff67){return function(_0x9297b6){if(_0x9297b6){var _0x16ad40=_0x9297b6['count'],_0x22bc92=_0x28ff67[_0x534e('0x1d')],_0x26938d=_0x28ff67[_0x534e('0x1d')]+_0x28ff67[_0x534e('0x1e')],_0x100751;if(_0x26938d>=_0x16ad40){_0x26938d=_0x16ad40;_0x100751=0xc8;}else{_0x100751=0xce;}_0x2de9d0[_0x534e('0x1b')](_0x100751);return _0x2de9d0[_0x534e('0x1f')]('Content-Range',_0x22bc92+'-'+_0x26938d+'/'+_0x16ad40)[_0x534e('0x20')](_0x9297b6);}return null;};}function patchUpdates(_0x1b87d1){return function(_0x5f9ae9){try{jsonpatch[_0x534e('0x21')](_0x5f9ae9,_0x1b87d1,!![]);}catch(_0x4724f9){return BPromise[_0x534e('0x22')](_0x4724f9);}return _0x5f9ae9[_0x534e('0x23')]();};}function saveUpdates(_0x85188b,_0x21f2e1){return function(_0x5e086a){if(_0x5e086a){return _0x5e086a[_0x534e('0x24')](_0x85188b)[_0x534e('0x25')](function(_0x39466c){return _0x39466c;});}return null;};}function removeEntity(_0x4a09ed,_0x324205){return function(_0x44bbc1){if(_0x44bbc1){return _0x44bbc1[_0x534e('0x26')]()[_0x534e('0x25')](function(){_0x4a09ed['status'](0xcc)[_0x534e('0x1c')]();});}};}function handleEntityNotFound(_0x588c08,_0xb83f1){return function(_0x106b7a){if(!_0x106b7a){_0x588c08[_0x534e('0x1a')](0x194);}return _0x106b7a;};}function handleError(_0x1720f4,_0x174577){_0x174577=_0x174577||0x1f4;return function(_0x57b216){logger[_0x534e('0x27')](_0x57b216[_0x534e('0x28')]);if(_0x57b216['name']){delete _0x57b216['name'];}_0x1720f4[_0x534e('0x1b')](_0x174577)['send'](_0x57b216);};}exports[_0x534e('0x29')]=function(_0x3c5c11,_0x281cda){var _0x122225={},_0x15be5c={},_0x42119b={'count':0x0,'rows':[]};var _0x5253b5=db['ChatInternalMessage']['rawAttributes'];_0x15be5c[_0x534e('0x2a')]=_[_0x534e('0x2b')](_0x5253b5);_0x15be5c[_0x534e('0x2c')]=_[_0x534e('0x2b')](_0x3c5c11[_0x534e('0x2c')]);_0x15be5c[_0x534e('0x2d')]=_[_0x534e('0x2e')](_0x15be5c[_0x534e('0x2a')],_0x15be5c[_0x534e('0x2c')]);_0x122225[_0x534e('0x2f')]=_[_0x534e('0x2e')](_0x15be5c[_0x534e('0x2a')],qs['fields'](_0x3c5c11[_0x534e('0x2c')][_0x534e('0x30')]));_0x122225['attributes']=_0x122225[_0x534e('0x2f')]['length']?_0x122225[_0x534e('0x2f')]:_0x15be5c[_0x534e('0x2a')];if(!_0x3c5c11[_0x534e('0x2c')][_0x534e('0x31')]('nolimit')){_0x122225[_0x534e('0x1e')]=qs[_0x534e('0x1e')](_0x3c5c11['query']['limit']);_0x122225[_0x534e('0x1d')]=qs[_0x534e('0x1d')](_0x3c5c11[_0x534e('0x2c')][_0x534e('0x1d')]);}_0x122225['order']=qs[_0x534e('0x32')](_0x3c5c11['query'][_0x534e('0x32')]);_0x122225['where']=qs[_0x534e('0x2d')](_[_0x534e('0x33')](_0x3c5c11['query'],_0x15be5c[_0x534e('0x2d')]));if(_0x3c5c11['query']['filter']){_0x122225['where']=_['merge'](_0x122225[_0x534e('0x34')],{'$or':_['map'](_0x5253b5,function(_0x49f188){if(_0x49f188[_0x534e('0x35')][_0x534e('0x36')]!==_0x534e('0x37')){var _0x5718fa={};_0x5718fa[_0x49f188[_0x534e('0x38')]]={'$like':'%'+_0x3c5c11[_0x534e('0x2c')]['filter']+'%'};return _0x5718fa;}})});}_0x122225=_[_0x534e('0x39')]({},_0x122225,_0x3c5c11['options']);var _0x6cc5e8={'where':_0x122225[_0x534e('0x34')]};return db['ChatInternalMessage'][_0x534e('0x3a')](_0x6cc5e8)['then'](function(_0x1c5260){_0x42119b[_0x534e('0x3a')]=_0x1c5260;if(_0x3c5c11[_0x534e('0x2c')][_0x534e('0x3b')]){_0x122225['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x534e('0x3c')](_0x122225);})['then'](function(_0x1670f8){_0x42119b[_0x534e('0x3d')]=_0x1670f8;return _0x42119b;})[_0x534e('0x25')](respondWithFilteredResult(_0x281cda,_0x122225))[_0x534e('0x3e')](handleError(_0x281cda,null));};exports['show']=function(_0x1dcfe5,_0x3597fe){var _0x376114={'raw':!![],'where':{'id':_0x1dcfe5[_0x534e('0x3f')]['id']}},_0x52d53f={};_0x52d53f['model']=_[_0x534e('0x2b')](db[_0x534e('0x40')][_0x534e('0x41')]);_0x52d53f['query']=_[_0x534e('0x2b')](_0x1dcfe5[_0x534e('0x2c')]);_0x52d53f[_0x534e('0x2d')]=_[_0x534e('0x2e')](_0x52d53f[_0x534e('0x2a')],_0x52d53f[_0x534e('0x2c')]);_0x376114[_0x534e('0x2f')]=_['intersection'](_0x52d53f[_0x534e('0x2a')],qs['fields'](_0x1dcfe5['query'][_0x534e('0x30')]));_0x376114[_0x534e('0x2f')]=_0x376114[_0x534e('0x2f')][_0x534e('0x42')]?_0x376114[_0x534e('0x2f')]:_0x52d53f[_0x534e('0x2a')];if(_0x1dcfe5['query'][_0x534e('0x3b')]){_0x376114[_0x534e('0x43')]=[{'all':!![]}];}_0x376114=_[_0x534e('0x39')]({},_0x376114,_0x1dcfe5['options']);return db[_0x534e('0x40')]['find'](_0x376114)[_0x534e('0x25')](handleEntityNotFound(_0x3597fe,null))[_0x534e('0x25')](respondWithResult(_0x3597fe,null))[_0x534e('0x3e')](handleError(_0x3597fe,null));};exports[_0x534e('0x44')]=function(_0x2c0ca5,_0x3442e4){return db['ChatInternalMessage'][_0x534e('0x44')](_0x2c0ca5['body'],{})['then'](respondWithResult(_0x3442e4,0xc9))[_0x534e('0x3e')](handleError(_0x3442e4,null));};exports[_0x534e('0x24')]=function(_0x1f5ea5,_0x1a0118){if(_0x1f5ea5[_0x534e('0x45')]['id']){delete _0x1f5ea5[_0x534e('0x45')]['id'];}return db[_0x534e('0x40')][_0x534e('0x46')]({'where':{'id':_0x1f5ea5[_0x534e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a0118,null))[_0x534e('0x25')](saveUpdates(_0x1f5ea5[_0x534e('0x45')],null))[_0x534e('0x25')](respondWithResult(_0x1a0118,null))[_0x534e('0x3e')](handleError(_0x1a0118,null));};exports['destroy']=function(_0x53bee4,_0x40b59a){return db[_0x534e('0x40')][_0x534e('0x46')]({'where':{'id':_0x53bee4[_0x534e('0x3f')]['id']}})[_0x534e('0x25')](handleEntityNotFound(_0x40b59a,null))[_0x534e('0x25')](removeEntity(_0x40b59a,null))[_0x534e('0x3e')](handleError(_0x40b59a,null));};exports[_0x534e('0x47')]=function(_0x106817,_0x1d9782){return db[_0x534e('0x40')]['describe']()[_0x534e('0x25')](respondWithResult(_0x1d9782,null))[_0x534e('0x3e')](handleError(_0x1d9782,null));};function wrapUser(_0x5a5507){return function(_0x328ef6){var _0x3a7e8b=_0x5a5507[_0x534e('0x48')]({'plain':!![]});_0x3a7e8b['messages']=[];if(_0x328ef6){_0x3a7e8b['lastMessageAt']=_0x328ef6[_0x534e('0x49')];_0x3a7e8b[_0x534e('0x4a')]=_0x328ef6;}else{_0x3a7e8b[_0x534e('0x4b')]=moment(0x0)[_0x534e('0x4c')](_0x534e('0x4d'));_0x3a7e8b[_0x534e('0x4a')]={};}return _0x3a7e8b;};}exports[_0x534e('0x4e')]=function(_0x45ad28,_0xc07a8f,_0x55b54f){var _0x4ccf38=[];return db[_0x534e('0x4f')]['findAll']({'where':{'role':[_0x534e('0x50'),_0x534e('0x51'),_0x534e('0x52')]},'attributes':['id',_0x534e('0x53'),_0x534e('0x54'),'role',_0x534e('0x55'),_0x534e('0x56'),'online','lastLoginAt',_0x534e('0x57'),'showWebBar'],'order':qs['sort'](_0x534e('0x58')),'include':[{'model':db[_0x534e('0x59')],'as':_0x534e('0x5a'),'attributes':['id','name',_0x534e('0x35')],'through':{'attributes':[]}}]})[_0x534e('0x25')](function(_0x591796){if(_0x591796){var _0x4bb270=_0x45ad28[_0x534e('0x52')][_0x534e('0x48')]({'plain':!![]});if(!_0x4bb270)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bb270['role']===_0x534e('0x52')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x4bb270[_0x534e('0x5b')]},'raw':!![]})[_0x534e('0x25')](function(_0x3ff648){if(_0x3ff648){if(_0x3ff648[_0x534e('0x5c')]===0x0){return db[_0x534e('0x5d')][_0x534e('0x3c')]({'where':{'sectionId':_0x3ff648['id']},'raw':!![]})[_0x534e('0x25')](function(_0x248079){var _0x238a4c=[];if(_[_0x534e('0x5e')](_0x248079)){_0x238a4c=_['filter'](_0x591796,function(_0xc1df27){if(_0xc1df27[_0x534e('0x5f')]!==_0x534e('0x50')){return _0xc1df27;}});return _0x238a4c;}else{for(var _0x3a2509=0x0;_0x3a2509<_0x591796[_0x534e('0x42')];_0x3a2509++){var _0x5c9004=_0x591796[_0x3a2509];if(_0x5c9004[_0x534e('0x5f')]==='agent'){var _0x5bc246=_[_0x534e('0x46')](_0x248079,function(_0x2dba36){return _0x2dba36[_0x534e('0x60')]===_0x5c9004['id'];});if(_0x5bc246)_0x238a4c['push'](_0x5c9004);}else{_0x238a4c[_0x534e('0x61')](_0x5c9004);}}return _0x238a4c;}});}else{return _0x591796;}}else{var _0x5b1301=_[_0x534e('0x62')](_0x591796,function(_0x18b83e){if(_0x18b83e[_0x534e('0x5f')]!==_0x534e('0x50')){return _0x18b83e;}});return _0x5b1301;}});}else{return _0x591796;}}})[_0x534e('0x25')](function(_0x44dac6){var _0x177c1e=[];if(_0x44dac6){_0x4ccf38=_0x44dac6;for(var _0x35a0c6=0x0;_0x35a0c6<_0x44dac6['length'];_0x35a0c6+=0x1){_0x4ccf38[_0x35a0c6]['messages']=[];_0x177c1e[_0x534e('0x61')](db[_0x534e('0x40')][_0x534e('0x46')]({'where':{'FromId':[_0x45ad28['user']['id'],_0x44dac6[_0x35a0c6]['id']],'ToId':[_0x45ad28[_0x534e('0x52')]['id'],_0x44dac6[_0x35a0c6]['id']],'ChatGroupId':null},'attributes':['id',_0x534e('0x49'),_0x534e('0x63'),_0x534e('0x64'),_0x534e('0x65'),'body'],'order':qs[_0x534e('0x32')](_0x534e('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x534e('0x25')](wrapUser(_0x44dac6[_0x35a0c6])));}return BPromise['all'](_0x177c1e);}return[];})['then'](function(_0x4e1012){return{'rows':_0x4e1012,'count':_0x4e1012[_0x534e('0x42')]};})['then'](respondWithResult(_0xc07a8f,null))[_0x534e('0x3e')](handleError(_0xc07a8f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d9258a3..84c7201 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 _0xa0bc=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x46306d,_0x5ddc3b){var _0x12e979=function(_0x154e55){while(--_0x154e55){_0x46306d['push'](_0x46306d['shift']());}};_0x12e979(++_0x5ddc3b);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xca0b('0x0'))['db'][_0xca0b('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca0b('0x2'),'afterUpdate':_0xca0b('0x3'),'afterDestroy':_0xca0b('0x4')};function emitEvent(_0x68ff4){return function(_0x2f7b56,_0x3a53b4,_0xf39a90){ChatInternalMessageEvents[_0xca0b('0x5')](_0x68ff4+':'+_0x2f7b56['id'],_0x2f7b56);ChatInternalMessageEvents[_0xca0b('0x5')](_0x68ff4,_0x2f7b56);_0xf39a90(null);};}for(var e in events){if(events[_0xca0b('0x6')](e)){var event=events[e];ChatInternalMessage[_0xca0b('0x7')](e,emitEvent(event));}}module[_0xca0b('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xcecc=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage'];(function(_0x442170,_0x288cbe){var _0x5528f3=function(_0x55565b){while(--_0x55565b){_0x442170['push'](_0x442170['shift']());}};_0x5528f3(++_0x288cbe);}(_0xcecc,0x186));var _0xccec=function(_0x43ff4b,_0x41f05a){_0x43ff4b=_0x43ff4b-0x0;var _0x33b3d3=_0xcecc[_0x43ff4b];return _0x33b3d3;};'use strict';var EventEmitter=require(_0xccec('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xccec('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xccec('0x2'),'afterDestroy':_0xccec('0x3')};function emitEvent(_0x338b16){return function(_0xa10c6f,_0x4b1996,_0x4b0fb9){ChatInternalMessageEvents[_0xccec('0x4')](_0x338b16+':'+_0xa10c6f['id'],_0xa10c6f);ChatInternalMessageEvents['emit'](_0x338b16,_0xa10c6f);_0x4b0fb9(null);};}for(var e in events){if(events[_0xccec('0x5')](e)){var event=events[e];ChatInternalMessage[_0xccec('0x6')](e,emitEvent(event));}}module[_0xccec('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 27c3ef4..20a8152 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 _0xa36b=['./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xa36b,0x1b1));var _0xba36=function(_0x460d4e,_0x2f39e1){_0x460d4e=_0x460d4e-0x0;var _0x59569b=_0xa36b[_0x460d4e];return _0x59569b;};'use strict';var _=require('lodash');var util=require(_0xba36('0x0'));var logger=require(_0xba36('0x1'))(_0xba36('0x2'));var moment=require('moment');var BPromise=require(_0xba36('0x3'));var rp=require(_0xba36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba36('0x5'));var config=require(_0xba36('0x6'));var attributes=require(_0xba36('0x7'));module['exports']=function(_0x38f29e,_0x5210f7){return _0x38f29e['define'](_0xba36('0x8'),attributes,{'tableName':_0xba36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xba36('0xa')});}; \ No newline at end of file +var _0xbdb1=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb1,0x6d));var _0x1bdb=function(_0x5bee28,_0x1dc7e2){_0x5bee28=_0x5bee28-0x0;var _0x395d1d=_0xbdb1[_0x5bee28];return _0x395d1d;};'use strict';var _=require(_0x1bdb('0x0'));var util=require(_0x1bdb('0x1'));var logger=require('../../config/logger')(_0x1bdb('0x2'));var moment=require(_0x1bdb('0x3'));var BPromise=require(_0x1bdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bdb('0x5'));var rimraf=require(_0x1bdb('0x6'));var config=require(_0x1bdb('0x7'));var attributes=require(_0x1bdb('0x8'));module[_0x1bdb('0x9')]=function(_0x52ba35,_0x47c158){return _0x52ba35[_0x1bdb('0xa')](_0x1bdb('0xb'),attributes,{'tableName':_0x1bdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1bdb('0xd'),'collate':_0x1bdb('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index de0a80d..4646afa 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 _0x2aa0=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2aa2ad,_0x3ac577){var _0x3e32ab=function(_0x48ceb8){while(--_0x48ceb8){_0x2aa2ad['push'](_0x2aa2ad['shift']());}};_0x3e32ab(++_0x3ac577);}(_0x2aa0,0x6c));var _0x02aa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2aa0[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x02aa('0x0'));var util=require(_0x02aa('0x1'));var moment=require('moment');var BPromise=require(_0x02aa('0x2'));var rs=require(_0x02aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x02aa('0x5'))(_0x02aa('0x6'));var config=require(_0x02aa('0x7'));var jayson=require(_0x02aa('0x8'));var client=jayson[_0x02aa('0x9')][_0x02aa('0xa')]({'port':0x232a});config[_0x02aa('0xb')]=_[_0x02aa('0xc')](config[_0x02aa('0xb')],{'host':_0x02aa('0xd'),'port':0x18eb});var socket=require(_0x02aa('0xe'))(new Redis(config['redis']));require(_0x02aa('0xf'))[_0x02aa('0x10')](socket);function respondWithRpcPromise(_0x5af1ec,_0x6b4d7f,_0x1590b1){return new BPromise(function(_0x410540,_0x4a9912){return client['request'](_0x5af1ec,_0x1590b1)[_0x02aa('0x11')](function(_0x16aeb3){logger[_0x02aa('0x12')](_0x02aa('0x13'),_0x6b4d7f,_0x02aa('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x6b4d7f,'request\x20sent',JSON[_0x02aa('0x15')](_0x16aeb3));if(_0x16aeb3[_0x02aa('0x16')]){if(_0x16aeb3[_0x02aa('0x16')][_0x02aa('0x17')]===0x1f4){logger[_0x02aa('0x16')](_0x02aa('0x13'),_0x6b4d7f,_0x16aeb3[_0x02aa('0x16')][_0x02aa('0x18')]);return _0x4a9912(_0x16aeb3[_0x02aa('0x16')][_0x02aa('0x18')]);}logger[_0x02aa('0x16')](_0x02aa('0x13'),_0x6b4d7f,_0x16aeb3[_0x02aa('0x16')][_0x02aa('0x18')]);return _0x410540(_0x16aeb3[_0x02aa('0x16')][_0x02aa('0x18')]);}else{logger[_0x02aa('0x12')](_0x02aa('0x13'),_0x6b4d7f,_0x02aa('0x14'));_0x410540(_0x16aeb3[_0x02aa('0x19')]['message']);}})[_0x02aa('0x1a')](function(_0x217e03){logger['error'](_0x02aa('0x13'),_0x6b4d7f,_0x217e03);_0x4a9912(_0x217e03);});});} \ No newline at end of file +var _0xb7fa=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x1002e7,_0x664234){var _0xa01e4c=function(_0x111e76){while(--_0x111e76){_0x1002e7['push'](_0x1002e7['shift']());}};_0xa01e4c(++_0x664234);}(_0xb7fa,0x9d));var _0xab7f=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xb7fa[_0x404cde];return _0x139882;};'use strict';var _=require(_0xab7f('0x0'));var util=require(_0xab7f('0x1'));var moment=require(_0xab7f('0x2'));var BPromise=require(_0xab7f('0x3'));var rs=require(_0xab7f('0x4'));var fs=require('fs');var Redis=require(_0xab7f('0x5'));var db=require(_0xab7f('0x6'))['db'];var utils=require(_0xab7f('0x7'));var logger=require(_0xab7f('0x8'))(_0xab7f('0x9'));var config=require(_0xab7f('0xa'));var jayson=require(_0xab7f('0xb'));var client=jayson[_0xab7f('0xc')][_0xab7f('0xd')]({'port':0x232a});config[_0xab7f('0xe')]=_['defaults'](config[_0xab7f('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7f('0xf'))(new Redis(config[_0xab7f('0xe')]));require(_0xab7f('0x10'))[_0xab7f('0x11')](socket);function respondWithRpcPromise(_0x2e2452,_0x3a8dee,_0x1b5548){return new BPromise(function(_0x3270e9,_0x216002){return client[_0xab7f('0x12')](_0x2e2452,_0x1b5548)[_0xab7f('0x13')](function(_0x492fcd){logger[_0xab7f('0x14')](_0xab7f('0x15'),_0x3a8dee,_0xab7f('0x16'));logger[_0xab7f('0x17')](_0xab7f('0x18'),_0x3a8dee,_0xab7f('0x16'),JSON[_0xab7f('0x19')](_0x492fcd));if(_0x492fcd[_0xab7f('0x1a')]){if(_0x492fcd[_0xab7f('0x1a')][_0xab7f('0x1b')]===0x1f4){logger[_0xab7f('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a8dee,_0x492fcd[_0xab7f('0x1a')][_0xab7f('0x1c')]);return _0x216002(_0x492fcd[_0xab7f('0x1a')][_0xab7f('0x1c')]);}logger[_0xab7f('0x1a')](_0xab7f('0x15'),_0x3a8dee,_0x492fcd[_0xab7f('0x1a')]['message']);return _0x3270e9(_0x492fcd[_0xab7f('0x1a')]['message']);}else{logger[_0xab7f('0x14')](_0xab7f('0x15'),_0x3a8dee,'request\x20sent');_0x3270e9(_0x492fcd['result']['message']);}})['catch'](function(_0x385c5c){logger[_0xab7f('0x1a')](_0xab7f('0x15'),_0x3a8dee,_0x385c5c);_0x216002(_0x385c5c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d9108c0..0d74484 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 _0xf4c0=['./chatInternalMessage.events','save','remove','update','emit','chatInternalMessage:'];(function(_0x538233,_0x622535){var _0x4c67e0=function(_0x24bdbd){while(--_0x24bdbd){_0x538233['push'](_0x538233['shift']());}};_0x4c67e0(++_0x622535);}(_0xf4c0,0x198));var _0x0f4c=function(_0x5c5d83,_0x391f13){_0x5c5d83=_0x5c5d83-0x0;var _0x3e94c5=_0xf4c0[_0x5c5d83];return _0x3e94c5;};'use strict';var ChatInternalMessageEvents=require(_0x0f4c('0x0'));var events=[_0x0f4c('0x1'),_0x0f4c('0x2'),_0x0f4c('0x3')];function createListener(_0x1f8da4,_0x4db235){return function(_0x1c3b42){_0x4db235[_0x0f4c('0x4')](_0x1f8da4,_0x1c3b42);};}function removeListener(_0x3171d3,_0x1a6ef1){return function(){ChatInternalMessageEvents['removeListener'](_0x3171d3,_0x1a6ef1);};}exports['register']=function(_0x57718d){for(var _0x1f35bb=0x0,_0x858d11=events['length'];_0x1f35bb<_0x858d11;_0x1f35bb++){var _0x502088=events[_0x1f35bb];var _0x4540a0=createListener(_0x0f4c('0x5')+_0x502088,_0x57718d);ChatInternalMessageEvents['on'](_0x502088,_0x4540a0);}}; \ No newline at end of file +var _0x6289=['register','length','save','remove','update','emit','removeListener'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x6289,0xd4));var _0x9628=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x6289[_0xdbe2de];return _0x2facd7;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9628('0x0'),_0x9628('0x1'),_0x9628('0x2')];function createListener(_0x57c23e,_0x395be7){return function(_0x4c0529){_0x395be7[_0x9628('0x3')](_0x57c23e,_0x4c0529);};}function removeListener(_0x1e2f57,_0x4f5ff8){return function(){ChatInternalMessageEvents[_0x9628('0x4')](_0x1e2f57,_0x4f5ff8);};}exports[_0x9628('0x5')]=function(_0x735d34){for(var _0x5b0294=0x0,_0x29f91d=events[_0x9628('0x6')];_0x5b0294<_0x29f91d;_0x5b0294++){var _0x21c301=events[_0x5b0294];var _0x31e179=createListener('chatInternalMessage:'+_0x21c301,_0x735d34);ChatInternalMessageEvents['on'](_0x21c301,_0x31e179);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 9be7911..bd2044e 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 _0x341c=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe60d38,_0x3fa82a){var _0x480b92=function(_0x2b1132){while(--_0x2b1132){_0xe60d38['push'](_0xe60d38['shift']());}};_0x480b92(++_0x3fa82a);}(_0x341c,0xcc));var _0xc341=function(_0x2697d9,_0x26806a){_0x2697d9=_0x2697d9-0x0;var _0x25e6ae=_0x341c[_0x2697d9];return _0x25e6ae;};'use strict';var multer=require(_0xc341('0x0'));var util=require('util');var path=require(_0xc341('0x1'));var timeout=require('connect-timeout');var express=require(_0xc341('0x2'));var router=express[_0xc341('0x3')]();var auth=require(_0xc341('0x4'));var interaction=require(_0xc341('0x5'));var config=require(_0xc341('0x6'));var controller=require(_0xc341('0x7'));router[_0xc341('0x8')]('/',auth[_0xc341('0x9')](),controller['index']);router[_0xc341('0x8')](_0xc341('0xa'),auth[_0xc341('0x9')](),controller[_0xc341('0xb')]);router[_0xc341('0x8')]('/users',auth[_0xc341('0x9')](),controller[_0xc341('0xc')]);router[_0xc341('0x8')](_0xc341('0xd'),auth[_0xc341('0x9')](),controller[_0xc341('0xe')]);router['post']('/',auth[_0xc341('0x9')](),controller[_0xc341('0xf')]);router[_0xc341('0x10')](_0xc341('0xd'),controller[_0xc341('0x11')]);router[_0xc341('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xc341('0x13')]);module[_0xc341('0x14')]=router; \ No newline at end of file +var _0xcef7=['/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','getUsers'];(function(_0x32ee4b,_0x3ffafb){var _0x550165=function(_0x46b5cd){while(--_0x46b5cd){_0x32ee4b['push'](_0x32ee4b['shift']());}};_0x550165(++_0x3ffafb);}(_0xcef7,0xe3));var _0x7cef=function(_0x3c8cf9,_0x8b7f0a){_0x3c8cf9=_0x3c8cf9-0x0;var _0x163bd2=_0xcef7[_0x3c8cf9];return _0x163bd2;};'use strict';var multer=require('multer');var util=require(_0x7cef('0x0'));var path=require(_0x7cef('0x1'));var timeout=require(_0x7cef('0x2'));var express=require(_0x7cef('0x3'));var router=express[_0x7cef('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7cef('0x5'));var config=require(_0x7cef('0x6'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x7cef('0x7')](),controller[_0x7cef('0x8')]);router['get'](_0x7cef('0x9'),auth['isAuthenticated'](),controller[_0x7cef('0xa')]);router[_0x7cef('0xb')]('/users',auth['isAuthenticated'](),controller[_0x7cef('0xc')]);router[_0x7cef('0xb')](_0x7cef('0xd'),auth[_0x7cef('0x7')](),controller[_0x7cef('0xe')]);router[_0x7cef('0xf')]('/',auth[_0x7cef('0x7')](),controller['create']);router[_0x7cef('0x10')]('/:id',controller[_0x7cef('0x11')]);router['delete'](_0x7cef('0xd'),auth['isAuthenticated'](),controller[_0x7cef('0x12')]);module[_0x7cef('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index da0015e..f306c91 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 _0xffb4=['ENUM','out','DATE','sequelize','exports','medium','BOOLEAN'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xffb4,0x1a0));var _0x4ffb=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xffb4[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x4ffb('0x0'));module[_0x4ffb('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4ffb('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x4ffb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4ffb('0x4')]('in',_0x4ffb('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x4ffb('0x6')]}}; \ No newline at end of file +var _0x9392=['ENUM','out','DATE','exports','TEXT','BOOLEAN'];(function(_0x1403b0,_0x52b0fe){var _0x25541c=function(_0x40374b){while(--_0x40374b){_0x1403b0['push'](_0x1403b0['shift']());}};_0x25541c(++_0x52b0fe);}(_0x9392,0x123));var _0x2939=function(_0x731feb,_0x2a6924){_0x731feb=_0x731feb-0x0;var _0x87949f=_0x9392[_0x731feb];return _0x87949f;};'use strict';var Sequelize=require('sequelize');module[_0x2939('0x0')]={'body':{'type':Sequelize[_0x2939('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2939('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2939('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2939('0x3')]('in',_0x2939('0x4')),'defaultValue':_0x2939('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2939('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3b8324a..1026e0e 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 _0x3bac=['mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ChatMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','format','role','interaction','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','merge','parse','formData','null','RejectMessage','rejectMessage','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x532944,_0x5bb2ec){var _0x28004c=function(_0x361bc7){while(--_0x361bc7){_0x532944['push'](_0x532944['shift']());}};_0x28004c(++_0x5bb2ec);}(_0x3bac,0x1da));var _0xc3ba=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x3bac[_0x28fbbf];return _0x543af6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc3ba('0x0'));var rimraf=require(_0xc3ba('0x1'));var zipdir=require(_0xc3ba('0x2'));var jsonpatch=require(_0xc3ba('0x3'));var rp=require('request-promise');var moment=require(_0xc3ba('0x4'));var BPromise=require(_0xc3ba('0x5'));var Mustache=require(_0xc3ba('0x6'));var util=require(_0xc3ba('0x7'));var path=require(_0xc3ba('0x8'));var sox=require('sox');var csv=require(_0xc3ba('0x9'));var ejs=require(_0xc3ba('0xa'));var fs=require('fs');var _=require(_0xc3ba('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc3ba('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc3ba('0x9'));var querystring=require('querystring');var Papa=require(_0xc3ba('0xd'));var Redis=require('ioredis');var authService=require(_0xc3ba('0xe'));var qs=require(_0xc3ba('0xf'));var hardwareService=require(_0xc3ba('0x10'));var logger=require(_0xc3ba('0x11'))(_0xc3ba('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc3ba('0x13'))['db'];config[_0xc3ba('0x14')]=_[_0xc3ba('0x15')](config[_0xc3ba('0x14')],{'host':_0xc3ba('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3ba('0x14')]));require(_0xc3ba('0x17'))[_0xc3ba('0x18')](socket);var jayson=require(_0xc3ba('0x19'));var client=jayson[_0xc3ba('0x1a')][_0xc3ba('0x1b')]({'port':0x232c});var client9002=jayson[_0xc3ba('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xd4ceb4,_0x14d29b,_0x24cfec){if(_0x24cfec){var _0x465eba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x465eba[_0xc3ba('0x1c')](_0x14d29b)){return _0xd4ceb4;}else{throw new Error(_0xc3ba('0x1d'));}}else{return _0xd4ceb4;}}function respondWithRpcPromise(_0x46f0ae,_0x529b1c,_0xf8a29a,_0x519e54){return new BPromise(function(_0x47b3cc,_0x39a197){var _0x5403d2=_0x519e54||client;return _0x5403d2[_0xc3ba('0x1e')](_0x46f0ae,_0xf8a29a)['then'](function(_0x27a01a){logger[_0xc3ba('0x1f')](_0xc3ba('0x20'),_0x529b1c,'request\x20sent');logger['debug'](_0xc3ba('0x21'),_0x529b1c,_0xc3ba('0x22'),JSON[_0xc3ba('0x23')](_0x27a01a));if(_0x27a01a['error']){if(_0x27a01a[_0xc3ba('0x24')]['code']===0x1f4){logger[_0xc3ba('0x24')](_0xc3ba('0x20'),_0x529b1c,_0x27a01a['error']['message']);return _0x39a197(_0x27a01a[_0xc3ba('0x24')][_0xc3ba('0x25')]);}logger[_0xc3ba('0x24')]('ChatMessage,\x20%s,\x20%s',_0x529b1c,_0x27a01a['error'][_0xc3ba('0x25')]);return _0x47b3cc(_0x27a01a[_0xc3ba('0x24')][_0xc3ba('0x25')]);}else{logger['info'](_0xc3ba('0x20'),_0x529b1c,_0xc3ba('0x22'));_0x47b3cc(_0x27a01a[_0xc3ba('0x26')]['message']);}})[_0xc3ba('0x27')](function(_0x28dcc1){logger[_0xc3ba('0x24')](_0xc3ba('0x20'),_0x529b1c,_0x28dcc1);_0x39a197(_0x28dcc1);});});}function respondWithStatusCode(_0x315e9f,_0xa327df){_0xa327df=_0xa327df||0xcc;return function(_0xb73b33){if(_0xb73b33){return _0x315e9f[_0xc3ba('0x28')](_0xa327df);}return _0x315e9f['status'](_0xa327df)[_0xc3ba('0x29')]();};}function respondWithResult(_0x428ea5,_0x4504f9){_0x4504f9=_0x4504f9||0xc8;return function(_0x27404d){if(_0x27404d){return _0x428ea5[_0xc3ba('0x2a')](_0x4504f9)[_0xc3ba('0x2b')](_0x27404d);}};}function respondWithFilteredResult(_0x9d6ee0,_0x168da2){return function(_0x5c6a78){if(_0x5c6a78){var _0x59bbc3=_0x5c6a78[_0xc3ba('0x2c')],_0x11ce1f=_0x168da2[_0xc3ba('0x2d')],_0x2ef30a=_0x168da2[_0xc3ba('0x2d')]+_0x168da2[_0xc3ba('0x2e')],_0x5ae3ef;if(_0x2ef30a>=_0x59bbc3){_0x2ef30a=_0x59bbc3;_0x5ae3ef=0xc8;}else{_0x5ae3ef=0xce;}_0x9d6ee0[_0xc3ba('0x2a')](_0x5ae3ef);return _0x9d6ee0[_0xc3ba('0x2f')](_0xc3ba('0x30'),_0x11ce1f+'-'+_0x2ef30a+'/'+_0x59bbc3)[_0xc3ba('0x2b')](_0x5c6a78);}return null;};}function patchUpdates(_0x14971d){return function(_0x887ac7){try{jsonpatch[_0xc3ba('0x31')](_0x887ac7,_0x14971d,!![]);}catch(_0x180db0){return BPromise[_0xc3ba('0x32')](_0x180db0);}return _0x887ac7[_0xc3ba('0x33')]();};}function saveUpdates(_0x2cd83f,_0x39313c){return function(_0x2ac669){if(_0x2ac669){return _0x2ac669[_0xc3ba('0x34')](_0x2cd83f)[_0xc3ba('0x35')](function(_0x25a1de){return _0x25a1de;});}return null;};}function removeEntity(_0x28fec3,_0x31985c){return function(_0x300c22){if(_0x300c22){return _0x300c22[_0xc3ba('0x36')]()[_0xc3ba('0x35')](function(){_0x28fec3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x65802d,_0x102f59){return function(_0x62da5b){if(!_0x62da5b){_0x65802d[_0xc3ba('0x28')](0x194);}return _0x62da5b;};}function handleError(_0x3844e4,_0x1a9318){_0x1a9318=_0x1a9318||0x1f4;return function(_0x2207f3){logger[_0xc3ba('0x24')](_0x2207f3[_0xc3ba('0x37')]);if(_0x2207f3['name']){delete _0x2207f3[_0xc3ba('0x38')];}_0x3844e4[_0xc3ba('0x2a')](_0x1a9318)[_0xc3ba('0x39')](_0x2207f3);};}exports['index']=function(_0x6e6378,_0x1eb8b8){var _0x408f64={},_0x30a797={},_0x345111={'count':0x0,'rows':[]};var _0xfa240d=db[_0xc3ba('0x3a')][_0xc3ba('0x3b')];_0x30a797[_0xc3ba('0x3c')]=_[_0xc3ba('0x3d')](_0xfa240d);_0x30a797[_0xc3ba('0x3e')]=_[_0xc3ba('0x3d')](_0x6e6378[_0xc3ba('0x3e')]);_0x30a797[_0xc3ba('0x3f')]=_['intersection'](_0x30a797[_0xc3ba('0x3c')],_0x30a797['query']);_0x408f64[_0xc3ba('0x40')]=_[_0xc3ba('0x41')](_0x30a797[_0xc3ba('0x3c')],qs[_0xc3ba('0x42')](_0x6e6378['query'][_0xc3ba('0x42')]));_0x408f64['attributes']=_0x408f64['attributes'][_0xc3ba('0x43')]?_0x408f64[_0xc3ba('0x40')]:_0x30a797['model'];if(!_0x6e6378[_0xc3ba('0x3e')][_0xc3ba('0x44')](_0xc3ba('0x45'))){_0x408f64[_0xc3ba('0x2e')]=qs[_0xc3ba('0x2e')](_0x6e6378[_0xc3ba('0x3e')][_0xc3ba('0x2e')]);_0x408f64[_0xc3ba('0x2d')]=qs[_0xc3ba('0x2d')](_0x6e6378['query'][_0xc3ba('0x2d')]);}_0x408f64[_0xc3ba('0x46')]=qs[_0xc3ba('0x47')](_0x6e6378[_0xc3ba('0x3e')][_0xc3ba('0x47')]);_0x408f64[_0xc3ba('0x48')]=qs[_0xc3ba('0x3f')](_['pick'](_0x6e6378[_0xc3ba('0x3e')],_0x30a797[_0xc3ba('0x3f')]));if(_0x6e6378[_0xc3ba('0x3e')][_0xc3ba('0x49')]){_0x408f64[_0xc3ba('0x48')]=_['merge'](_0x408f64[_0xc3ba('0x48')],{'$or':_[_0xc3ba('0x4a')](_0xfa240d,function(_0x593519){if(_0x593519['type'][_0xc3ba('0x4b')]!==_0xc3ba('0x4c')){var _0x41b08a={};_0x41b08a[_0x593519[_0xc3ba('0x4d')]]={'$like':'%'+_0x6e6378['query'][_0xc3ba('0x49')]+'%'};return _0x41b08a;}})});}_0x408f64=_['merge']({},_0x408f64,_0x6e6378[_0xc3ba('0x4e')]);var _0xf834e0={'where':_0x408f64['where']};return db[_0xc3ba('0x3a')][_0xc3ba('0x2c')](_0xf834e0)[_0xc3ba('0x35')](function(_0x35b9de){_0x345111['count']=_0x35b9de;if(_0x6e6378[_0xc3ba('0x3e')][_0xc3ba('0x4f')]){_0x408f64[_0xc3ba('0x50')]=[{'all':!![]}];}return db[_0xc3ba('0x3a')][_0xc3ba('0x51')](_0x408f64);})[_0xc3ba('0x35')](function(_0x3027dc){_0x345111[_0xc3ba('0x52')]=_0x3027dc;return _0x345111;})[_0xc3ba('0x35')](respondWithFilteredResult(_0x1eb8b8,_0x408f64))[_0xc3ba('0x27')](handleError(_0x1eb8b8,null));};exports['show']=function(_0x49f839,_0x5b8bbe){var _0x6d304f={'raw':!![],'where':{'id':_0x49f839['params']['id']}},_0x4d2ba0={};_0x4d2ba0['model']=_['keys'](db[_0xc3ba('0x3a')][_0xc3ba('0x3b')]);_0x4d2ba0[_0xc3ba('0x3e')]=_[_0xc3ba('0x3d')](_0x49f839['query']);_0x4d2ba0[_0xc3ba('0x3f')]=_['intersection'](_0x4d2ba0[_0xc3ba('0x3c')],_0x4d2ba0[_0xc3ba('0x3e')]);_0x6d304f[_0xc3ba('0x40')]=_[_0xc3ba('0x41')](_0x4d2ba0[_0xc3ba('0x3c')],qs['fields'](_0x49f839[_0xc3ba('0x3e')][_0xc3ba('0x42')]));_0x6d304f[_0xc3ba('0x40')]=_0x6d304f[_0xc3ba('0x40')][_0xc3ba('0x43')]?_0x6d304f['attributes']:_0x4d2ba0['model'];if(_0x49f839['query'][_0xc3ba('0x4f')]){_0x6d304f['include']=[{'all':!![]}];}_0x6d304f=_['merge']({},_0x6d304f,_0x49f839[_0xc3ba('0x4e')]);return db[_0xc3ba('0x3a')][_0xc3ba('0x53')](_0x6d304f)[_0xc3ba('0x35')](handleEntityNotFound(_0x5b8bbe,null))[_0xc3ba('0x35')](respondWithResult(_0x5b8bbe,null))[_0xc3ba('0x27')](handleError(_0x5b8bbe,null));};exports[_0xc3ba('0x54')]=function(_0x13a600,_0x594253){return db[_0xc3ba('0x3a')]['create'](_0x13a600[_0xc3ba('0x55')],{})[_0xc3ba('0x35')](respondWithResult(_0x594253,0xc9))[_0xc3ba('0x27')](handleError(_0x594253,null));};exports[_0xc3ba('0x34')]=function(_0x71020d,_0x1a555d){if(_0x71020d[_0xc3ba('0x55')]['id']){delete _0x71020d['body']['id'];}return db[_0xc3ba('0x3a')]['find']({'where':{'id':_0x71020d[_0xc3ba('0x56')]['id']}})[_0xc3ba('0x35')](handleEntityNotFound(_0x1a555d,null))['then'](saveUpdates(_0x71020d['body'],null))[_0xc3ba('0x35')](respondWithResult(_0x1a555d,null))[_0xc3ba('0x27')](handleError(_0x1a555d,null));};exports[_0xc3ba('0x36')]=function(_0x1f60dd,_0xf09b11){return db['ChatMessage'][_0xc3ba('0x53')]({'where':{'id':_0x1f60dd[_0xc3ba('0x56')]['id']}})[_0xc3ba('0x35')](handleEntityNotFound(_0xf09b11,null))[_0xc3ba('0x35')](removeEntity(_0xf09b11,null))[_0xc3ba('0x27')](handleError(_0xf09b11,null));};exports[_0xc3ba('0x57')]=function(_0x17a8aa,_0xa9d970){return db[_0xc3ba('0x3a')]['describe']()[_0xc3ba('0x35')](respondWithResult(_0xa9d970,null))[_0xc3ba('0x27')](handleError(_0xa9d970,null));};var interaction_log=require('../../config/logger')(_0xc3ba('0x58'));exports[_0xc3ba('0x59')]=function(_0x25710f,_0x3ef77b,_0xb2c75c){var _0x32cf17={'channel':_0xc3ba('0x5a')};if(_0x25710f[_0xc3ba('0x55')]['id']){delete _0x25710f['body']['id'];}_0x25710f['body'][_0xc3ba('0x5b')]=!![];_0x25710f[_0xc3ba('0x55')][_0xc3ba('0x5c')]=moment()['format'](_0xc3ba('0x5d'));_0x25710f[_0xc3ba('0x55')][_0xc3ba('0x5e')]=_0x25710f['body'][_0xc3ba('0x5e')]||_0x25710f[_0xc3ba('0x5f')]['id'];return db[_0xc3ba('0x3a')][_0xc3ba('0x53')]({'where':{'id':_0x25710f['params']['id'],'UserId':null},'include':[{'model':db[_0xc3ba('0x60')],'as':_0xc3ba('0x61')}]})[_0xc3ba('0x35')](handleEntityNotFound(_0x3ef77b,null))[_0xc3ba('0x35')](saveUpdates(_0x25710f['body'],null))['then'](function(_0x40049a){if(_0x40049a){_0x32cf17[_0xc3ba('0x25')]=_0x40049a[_0xc3ba('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xc3ba('0x53')]({'where':{'id':_0x40049a[_0xc3ba('0x63')]}});}return null;})[_0xc3ba('0x35')](handleEntityNotFound(_0x3ef77b,null))['then'](function(_0x95f238){if(_0x95f238){return _0x95f238[_0xc3ba('0x34')]({'UserId':_0x25710f[_0xc3ba('0x55')][_0xc3ba('0x5e')],'read1stAt':_[_0xc3ba('0x64')](_0x95f238[_0xc3ba('0x65')])?moment()[_0xc3ba('0x66')](_0xc3ba('0x5d')):undefined});}return null;})[_0xc3ba('0x35')](function(_0x1144db){if(_0x1144db){_0x32cf17['interaction']=_0x1144db['get']({'plain':!![]});interaction_log[_0xc3ba('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25710f['user']['id'],_0x25710f[_0xc3ba('0x5f')][_0xc3ba('0x38')],_0x25710f['user'][_0xc3ba('0x67')],_0x32cf17[_0xc3ba('0x68')]['id'],_0x25710f[_0xc3ba('0x55')]?JSON[_0xc3ba('0x23')](_0x25710f[_0xc3ba('0x55')]):'null');return respondWithRpcPromise(_0xc3ba('0x69'),_0xc3ba('0x6a'),_0x32cf17);}return null;})[_0xc3ba('0x35')](function(_0x45d422){if(_0x45d422){if(_0x25710f[_0xc3ba('0x55')][_0xc3ba('0x6b')]){_0x32cf17[_0xc3ba('0x25')][_0xc3ba('0x6c')]=util['format'](_0xc3ba('0x6d'),_0x25710f[_0xc3ba('0x5f')][_0xc3ba('0x38')]);_0x32cf17[_0xc3ba('0x25')][_0xc3ba('0x6e')]=_0x32cf17['channel'];_0x32cf17['message']['event']=_0xc3ba('0x59');return respondWithRpcPromise('EventManager',_0xc3ba('0x6f'),{'event':'acceptmessage','message':_[_0xc3ba('0x70')](_0x32cf17['message'],JSON[_0xc3ba('0x71')](_0x32cf17['interaction'][_0xc3ba('0x72')]))},client9002)[_0xc3ba('0x35')](function(){return _0x32cf17;});}return _0x32cf17;}return null;})['then'](respondWithResult(_0x3ef77b,null))[_0xc3ba('0x27')](handleError(_0x3ef77b,null));};var interaction_log=require('../../config/logger')(_0xc3ba('0x58'));exports['reject']=function(_0x310a82,_0x25325e,_0x39d624){var _0x1a0776={'agent':{},'channel':_0xc3ba('0x5a')};if(_0x310a82[_0xc3ba('0x55')]['id']){delete _0x310a82['body']['id'];}_0x310a82[_0xc3ba('0x55')]['UserId']=_0x310a82[_0xc3ba('0x55')][_0xc3ba('0x5e')]||_0x310a82[_0xc3ba('0x5f')]['id'];_0x1a0776['agent']['id']=_0x310a82['body']['UserId'];return db[_0xc3ba('0x3a')][_0xc3ba('0x53')]({'where':{'id':_0x310a82[_0xc3ba('0x56')]['id'],'UserId':null}})[_0xc3ba('0x35')](handleEntityNotFound(_0x25325e,null))['then'](function(_0x452576){if(_0x452576){_0x1a0776[_0xc3ba('0x25')]=_0x452576[_0xc3ba('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x452576['ChatInteractionId']}});}return null;})[_0xc3ba('0x35')](handleEntityNotFound(_0x25325e,null))[_0xc3ba('0x35')](function(_0xd8fb42){if(_0xd8fb42){_0x1a0776[_0xc3ba('0x68')]=_0xd8fb42[_0xc3ba('0x62')]({'plain':!![]});interaction_log[_0xc3ba('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x310a82[_0xc3ba('0x5f')]['id'],_0x310a82[_0xc3ba('0x5f')][_0xc3ba('0x38')],_0x310a82[_0xc3ba('0x5f')][_0xc3ba('0x67')],_0x1a0776[_0xc3ba('0x68')]['id'],_0x310a82[_0xc3ba('0x55')]?JSON[_0xc3ba('0x23')](_0x310a82[_0xc3ba('0x55')]):_0xc3ba('0x73'));return respondWithRpcPromise(_0xc3ba('0x74'),_0xc3ba('0x75'),_0x1a0776);}return null;})[_0xc3ba('0x35')](function(_0x538dd5){if(_0x538dd5){_0x538dd5[_0xc3ba('0x25')][_0xc3ba('0x6c')]=util[_0xc3ba('0x66')](_0xc3ba('0x6d'),_0x310a82[_0xc3ba('0x5f')][_0xc3ba('0x38')]);_0x538dd5[_0xc3ba('0x25')]['channel']=_0x1a0776[_0xc3ba('0x6e')];_0x538dd5[_0xc3ba('0x25')][_0xc3ba('0x76')]=_0xc3ba('0x32');respondWithRpcPromise(_0xc3ba('0x6f'),'EventManager',{'event':_0xc3ba('0x77'),'message':_0x538dd5[_0xc3ba('0x25')]},client9002);return _0x1a0776;}return null;})['then'](respondWithResult(_0x25325e,null))[_0xc3ba('0x27')](handleError(_0x25325e,null));}; \ No newline at end of file +var _0xcbec=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','destroy','stack','name','send','index','ChatMessage','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','EventManager','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then'];(function(_0x2bd1ac,_0x113d5f){var _0x216cf2=function(_0x5395fc){while(--_0x5395fc){_0x2bd1ac['push'](_0x2bd1ac['shift']());}};_0x216cf2(++_0x113d5f);}(_0xcbec,0x151));var _0xccbe=function(_0x76c797,_0x6e6570){_0x76c797=_0x76c797-0x0;var _0x39a216=_0xcbec[_0x76c797];return _0x39a216;};'use strict';var pdf=require(_0xccbe('0x0'));var emlformat=require(_0xccbe('0x1'));var rimraf=require(_0xccbe('0x2'));var zipdir=require(_0xccbe('0x3'));var jsonpatch=require(_0xccbe('0x4'));var rp=require(_0xccbe('0x5'));var moment=require(_0xccbe('0x6'));var BPromise=require(_0xccbe('0x7'));var Mustache=require('mustache');var util=require(_0xccbe('0x8'));var path=require('path');var sox=require(_0xccbe('0x9'));var csv=require(_0xccbe('0xa'));var ejs=require(_0xccbe('0xb'));var fs=require('fs');var _=require(_0xccbe('0xc'));var squel=require('squel');var crypto=require(_0xccbe('0xd'));var jsforce=require(_0xccbe('0xe'));var deskjs=require(_0xccbe('0xf'));var toCsv=require(_0xccbe('0xa'));var querystring=require(_0xccbe('0x10'));var Papa=require('papaparse');var Redis=require(_0xccbe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xccbe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccbe('0x13'))(_0xccbe('0x14'));var utils=require(_0xccbe('0x15'));var config=require(_0xccbe('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xccbe('0x17')](config[_0xccbe('0x18')],{'host':_0xccbe('0x19'),'port':0x18eb});var socket=require(_0xccbe('0x1a'))(new Redis(config['redis']));require(_0xccbe('0x1b'))['register'](socket);var jayson=require(_0xccbe('0x1c'));var client=jayson['client'][_0xccbe('0x1d')]({'port':0x232c});var client9002=jayson[_0xccbe('0x1e')][_0xccbe('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1d4963,_0x17713f,_0x5dcdf6){if(_0x5dcdf6){var _0x3b7733=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b7733[_0xccbe('0x1f')](_0x17713f)){return _0x1d4963;}else{throw new Error(_0xccbe('0x20'));}}else{return _0x1d4963;}}function respondWithRpcPromise(_0x56bf31,_0x54a59b,_0x2f9a3c,_0x29fb84){return new BPromise(function(_0x43f24d,_0x2cd8d1){var _0x549582=_0x29fb84||client;return _0x549582[_0xccbe('0x21')](_0x56bf31,_0x2f9a3c)[_0xccbe('0x22')](function(_0x21d143){logger[_0xccbe('0x23')](_0xccbe('0x24'),_0x54a59b,_0xccbe('0x25'));logger['debug'](_0xccbe('0x26'),_0x54a59b,_0xccbe('0x25'),JSON[_0xccbe('0x27')](_0x21d143));if(_0x21d143['error']){if(_0x21d143[_0xccbe('0x28')][_0xccbe('0x29')]===0x1f4){logger[_0xccbe('0x28')](_0xccbe('0x24'),_0x54a59b,_0x21d143['error'][_0xccbe('0x2a')]);return _0x2cd8d1(_0x21d143[_0xccbe('0x28')][_0xccbe('0x2a')]);}logger[_0xccbe('0x28')]('ChatMessage,\x20%s,\x20%s',_0x54a59b,_0x21d143['error']['message']);return _0x43f24d(_0x21d143[_0xccbe('0x28')][_0xccbe('0x2a')]);}else{logger[_0xccbe('0x23')](_0xccbe('0x24'),_0x54a59b,_0xccbe('0x25'));_0x43f24d(_0x21d143[_0xccbe('0x2b')][_0xccbe('0x2a')]);}})[_0xccbe('0x2c')](function(_0x98ff14){logger[_0xccbe('0x28')](_0xccbe('0x24'),_0x54a59b,_0x98ff14);_0x2cd8d1(_0x98ff14);});});}function respondWithStatusCode(_0x1c35d9,_0x56555a){_0x56555a=_0x56555a||0xcc;return function(_0x2d990c){if(_0x2d990c){return _0x1c35d9[_0xccbe('0x2d')](_0x56555a);}return _0x1c35d9[_0xccbe('0x2e')](_0x56555a)[_0xccbe('0x2f')]();};}function respondWithResult(_0x2c9f17,_0xa85a1e){_0xa85a1e=_0xa85a1e||0xc8;return function(_0x27e8d7){if(_0x27e8d7){return _0x2c9f17[_0xccbe('0x2e')](_0xa85a1e)[_0xccbe('0x30')](_0x27e8d7);}};}function respondWithFilteredResult(_0x502dba,_0x4387f4){return function(_0x431cd6){if(_0x431cd6){var _0x115da8=_0x431cd6[_0xccbe('0x31')],_0xd3362f=_0x4387f4[_0xccbe('0x32')],_0x20af1d=_0x4387f4[_0xccbe('0x32')]+_0x4387f4['limit'],_0x5a5a42;if(_0x20af1d>=_0x115da8){_0x20af1d=_0x115da8;_0x5a5a42=0xc8;}else{_0x5a5a42=0xce;}_0x502dba[_0xccbe('0x2e')](_0x5a5a42);return _0x502dba[_0xccbe('0x33')](_0xccbe('0x34'),_0xd3362f+'-'+_0x20af1d+'/'+_0x115da8)[_0xccbe('0x30')](_0x431cd6);}return null;};}function patchUpdates(_0x4c0ed8){return function(_0x17547e){try{jsonpatch['apply'](_0x17547e,_0x4c0ed8,!![]);}catch(_0x6d1985){return BPromise[_0xccbe('0x35')](_0x6d1985);}return _0x17547e['save']();};}function saveUpdates(_0x3ae00a,_0x626e1b){return function(_0x16e9ad){if(_0x16e9ad){return _0x16e9ad[_0xccbe('0x36')](_0x3ae00a)[_0xccbe('0x22')](function(_0x54115d){return _0x54115d;});}return null;};}function removeEntity(_0x225489,_0x5541f9){return function(_0x1075cb){if(_0x1075cb){return _0x1075cb[_0xccbe('0x37')]()[_0xccbe('0x22')](function(){_0x225489[_0xccbe('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea08a0,_0x3d2687){return function(_0x5d6692){if(!_0x5d6692){_0xea08a0[_0xccbe('0x2d')](0x194);}return _0x5d6692;};}function handleError(_0x222a32,_0x5c9b4a){_0x5c9b4a=_0x5c9b4a||0x1f4;return function(_0x575b9f){logger[_0xccbe('0x28')](_0x575b9f[_0xccbe('0x38')]);if(_0x575b9f['name']){delete _0x575b9f[_0xccbe('0x39')];}_0x222a32['status'](_0x5c9b4a)[_0xccbe('0x3a')](_0x575b9f);};}exports[_0xccbe('0x3b')]=function(_0x1b1b13,_0x46c984){var _0x193959={},_0x436b70={},_0x208e4e={'count':0x0,'rows':[]};var _0x1ab53d=db[_0xccbe('0x3c')]['rawAttributes'];_0x436b70[_0xccbe('0x3d')]=_[_0xccbe('0x3e')](_0x1ab53d);_0x436b70['query']=_[_0xccbe('0x3e')](_0x1b1b13['query']);_0x436b70[_0xccbe('0x3f')]=_[_0xccbe('0x40')](_0x436b70[_0xccbe('0x3d')],_0x436b70[_0xccbe('0x41')]);_0x193959[_0xccbe('0x42')]=_[_0xccbe('0x40')](_0x436b70[_0xccbe('0x3d')],qs['fields'](_0x1b1b13['query'][_0xccbe('0x43')]));_0x193959['attributes']=_0x193959[_0xccbe('0x42')][_0xccbe('0x44')]?_0x193959[_0xccbe('0x42')]:_0x436b70[_0xccbe('0x3d')];if(!_0x1b1b13['query'][_0xccbe('0x45')](_0xccbe('0x46'))){_0x193959[_0xccbe('0x47')]=qs['limit'](_0x1b1b13['query']['limit']);_0x193959[_0xccbe('0x32')]=qs[_0xccbe('0x32')](_0x1b1b13['query'][_0xccbe('0x32')]);}_0x193959[_0xccbe('0x48')]=qs[_0xccbe('0x49')](_0x1b1b13[_0xccbe('0x41')][_0xccbe('0x49')]);_0x193959[_0xccbe('0x4a')]=qs['filters'](_[_0xccbe('0x4b')](_0x1b1b13[_0xccbe('0x41')],_0x436b70[_0xccbe('0x3f')]));if(_0x1b1b13[_0xccbe('0x41')]['filter']){_0x193959[_0xccbe('0x4a')]=_[_0xccbe('0x4c')](_0x193959[_0xccbe('0x4a')],{'$or':_[_0xccbe('0x4d')](_0x1ab53d,function(_0x11ce23){if(_0x11ce23[_0xccbe('0x4e')][_0xccbe('0x4f')]!==_0xccbe('0x50')){var _0x525bee={};_0x525bee[_0x11ce23['field']]={'$like':'%'+_0x1b1b13[_0xccbe('0x41')][_0xccbe('0x51')]+'%'};return _0x525bee;}})});}_0x193959=_[_0xccbe('0x4c')]({},_0x193959,_0x1b1b13[_0xccbe('0x52')]);var _0x54a424={'where':_0x193959['where']};return db[_0xccbe('0x3c')][_0xccbe('0x31')](_0x54a424)[_0xccbe('0x22')](function(_0x27cbb8){_0x208e4e[_0xccbe('0x31')]=_0x27cbb8;if(_0x1b1b13[_0xccbe('0x41')][_0xccbe('0x53')]){_0x193959[_0xccbe('0x54')]=[{'all':!![]}];}return db[_0xccbe('0x3c')][_0xccbe('0x55')](_0x193959);})['then'](function(_0x1559fa){_0x208e4e[_0xccbe('0x56')]=_0x1559fa;return _0x208e4e;})['then'](respondWithFilteredResult(_0x46c984,_0x193959))[_0xccbe('0x2c')](handleError(_0x46c984,null));};exports[_0xccbe('0x57')]=function(_0xa3c5aa,_0x5be963){var _0x22bc91={'raw':!![],'where':{'id':_0xa3c5aa[_0xccbe('0x58')]['id']}},_0x26d9ef={};_0x26d9ef['model']=_[_0xccbe('0x3e')](db['ChatMessage'][_0xccbe('0x59')]);_0x26d9ef[_0xccbe('0x41')]=_[_0xccbe('0x3e')](_0xa3c5aa[_0xccbe('0x41')]);_0x26d9ef[_0xccbe('0x3f')]=_[_0xccbe('0x40')](_0x26d9ef['model'],_0x26d9ef[_0xccbe('0x41')]);_0x22bc91[_0xccbe('0x42')]=_['intersection'](_0x26d9ef[_0xccbe('0x3d')],qs[_0xccbe('0x43')](_0xa3c5aa['query'][_0xccbe('0x43')]));_0x22bc91['attributes']=_0x22bc91[_0xccbe('0x42')]['length']?_0x22bc91[_0xccbe('0x42')]:_0x26d9ef[_0xccbe('0x3d')];if(_0xa3c5aa['query'][_0xccbe('0x53')]){_0x22bc91['include']=[{'all':!![]}];}_0x22bc91=_[_0xccbe('0x4c')]({},_0x22bc91,_0xa3c5aa[_0xccbe('0x52')]);return db[_0xccbe('0x3c')][_0xccbe('0x5a')](_0x22bc91)['then'](handleEntityNotFound(_0x5be963,null))[_0xccbe('0x22')](respondWithResult(_0x5be963,null))[_0xccbe('0x2c')](handleError(_0x5be963,null));};exports[_0xccbe('0x5b')]=function(_0x5341af,_0xb9a60c){return db[_0xccbe('0x3c')]['create'](_0x5341af[_0xccbe('0x5c')],{})[_0xccbe('0x22')](respondWithResult(_0xb9a60c,0xc9))[_0xccbe('0x2c')](handleError(_0xb9a60c,null));};exports[_0xccbe('0x36')]=function(_0x4457d9,_0x4a75a9){if(_0x4457d9[_0xccbe('0x5c')]['id']){delete _0x4457d9[_0xccbe('0x5c')]['id'];}return db[_0xccbe('0x3c')][_0xccbe('0x5a')]({'where':{'id':_0x4457d9['params']['id']}})[_0xccbe('0x22')](handleEntityNotFound(_0x4a75a9,null))[_0xccbe('0x22')](saveUpdates(_0x4457d9['body'],null))[_0xccbe('0x22')](respondWithResult(_0x4a75a9,null))['catch'](handleError(_0x4a75a9,null));};exports[_0xccbe('0x37')]=function(_0x321a26,_0x42774c){return db[_0xccbe('0x3c')][_0xccbe('0x5a')]({'where':{'id':_0x321a26[_0xccbe('0x58')]['id']}})[_0xccbe('0x22')](handleEntityNotFound(_0x42774c,null))[_0xccbe('0x22')](removeEntity(_0x42774c,null))[_0xccbe('0x2c')](handleError(_0x42774c,null));};exports[_0xccbe('0x5d')]=function(_0x1f15d1,_0x52e196){return db[_0xccbe('0x3c')][_0xccbe('0x5d')]()['then'](respondWithResult(_0x52e196,null))['catch'](handleError(_0x52e196,null));};var interaction_log=require(_0xccbe('0x13'))(_0xccbe('0x5e'));exports[_0xccbe('0x5f')]=function(_0x1b6524,_0x30ded5,_0x18ec4d){var _0x42d050={'channel':_0xccbe('0x60')};if(_0x1b6524[_0xccbe('0x5c')]['id']){delete _0x1b6524['body']['id'];}_0x1b6524[_0xccbe('0x5c')][_0xccbe('0x61')]=!![];_0x1b6524[_0xccbe('0x5c')]['readAt']=moment()['format'](_0xccbe('0x62'));_0x1b6524[_0xccbe('0x5c')][_0xccbe('0x63')]=_0x1b6524['body']['UserId']||_0x1b6524[_0xccbe('0x64')]['id'];return db[_0xccbe('0x3c')][_0xccbe('0x5a')]({'where':{'id':_0x1b6524[_0xccbe('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xccbe('0x65')],'as':_0xccbe('0x66')}]})[_0xccbe('0x22')](handleEntityNotFound(_0x30ded5,null))[_0xccbe('0x22')](saveUpdates(_0x1b6524['body'],null))['then'](function(_0x4be91c){if(_0x4be91c){_0x42d050[_0xccbe('0x2a')]=_0x4be91c['get']({'plain':!![]});return db[_0xccbe('0x67')][_0xccbe('0x5a')]({'where':{'id':_0x4be91c[_0xccbe('0x68')]}});}return null;})[_0xccbe('0x22')](handleEntityNotFound(_0x30ded5,null))[_0xccbe('0x22')](function(_0x3fd3f2){if(_0x3fd3f2){return _0x3fd3f2['update']({'UserId':_0x1b6524[_0xccbe('0x5c')][_0xccbe('0x63')],'read1stAt':_['isNil'](_0x3fd3f2['read1stAt'])?moment()[_0xccbe('0x69')](_0xccbe('0x62')):undefined});}return null;})[_0xccbe('0x22')](function(_0x20d4c9){if(_0x20d4c9){_0x42d050[_0xccbe('0x6a')]=_0x20d4c9[_0xccbe('0x6b')]({'plain':!![]});interaction_log[_0xccbe('0x23')](_0xccbe('0x6c'),_0x1b6524[_0xccbe('0x64')]['id'],_0x1b6524[_0xccbe('0x64')][_0xccbe('0x39')],_0x1b6524[_0xccbe('0x64')][_0xccbe('0x6d')],_0x42d050['interaction']['id'],_0x1b6524[_0xccbe('0x5c')]?JSON[_0xccbe('0x27')](_0x1b6524['body']):_0xccbe('0x6e'));return respondWithRpcPromise(_0xccbe('0x6f'),_0xccbe('0x70'),_0x42d050);}return null;})[_0xccbe('0x22')](function(_0x53e9b6){if(_0x53e9b6){if(_0x1b6524[_0xccbe('0x5c')][_0xccbe('0x71')]){_0x42d050[_0xccbe('0x2a')]['interface']=util[_0xccbe('0x69')](_0xccbe('0x72'),_0x1b6524['user'][_0xccbe('0x39')]);_0x42d050[_0xccbe('0x2a')][_0xccbe('0x73')]=_0x42d050[_0xccbe('0x73')];_0x42d050[_0xccbe('0x2a')][_0xccbe('0x74')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0xccbe('0x4c')](_0x42d050[_0xccbe('0x2a')],JSON[_0xccbe('0x75')](_0x42d050[_0xccbe('0x6a')][_0xccbe('0x76')]))},client9002)[_0xccbe('0x22')](function(){return _0x42d050;});}return _0x42d050;}return null;})[_0xccbe('0x22')](respondWithResult(_0x30ded5,null))['catch'](handleError(_0x30ded5,null));};var interaction_log=require(_0xccbe('0x13'))(_0xccbe('0x5e'));exports['reject']=function(_0x2cec3a,_0x394cbc,_0x14b31a){var _0x57d953={'agent':{},'channel':_0xccbe('0x60')};if(_0x2cec3a[_0xccbe('0x5c')]['id']){delete _0x2cec3a[_0xccbe('0x5c')]['id'];}_0x2cec3a[_0xccbe('0x5c')][_0xccbe('0x63')]=_0x2cec3a[_0xccbe('0x5c')][_0xccbe('0x63')]||_0x2cec3a[_0xccbe('0x64')]['id'];_0x57d953[_0xccbe('0x77')]['id']=_0x2cec3a['body'][_0xccbe('0x63')];return db['ChatMessage'][_0xccbe('0x5a')]({'where':{'id':_0x2cec3a[_0xccbe('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x394cbc,null))[_0xccbe('0x22')](function(_0x1b4dc3){if(_0x1b4dc3){_0x57d953['message']=_0x1b4dc3[_0xccbe('0x6b')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x1b4dc3['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x394cbc,null))['then'](function(_0x3cb8fc){if(_0x3cb8fc){_0x57d953['interaction']=_0x3cb8fc[_0xccbe('0x6b')]({'plain':!![]});interaction_log['info'](_0xccbe('0x78'),_0x2cec3a[_0xccbe('0x64')]['id'],_0x2cec3a[_0xccbe('0x64')]['name'],_0x2cec3a[_0xccbe('0x64')]['role'],_0x57d953[_0xccbe('0x6a')]['id'],_0x2cec3a['body']?JSON['stringify'](_0x2cec3a['body']):_0xccbe('0x6e'));return respondWithRpcPromise('RejectMessage',_0xccbe('0x79'),_0x57d953);}return null;})[_0xccbe('0x22')](function(_0x388bce){if(_0x388bce){_0x388bce[_0xccbe('0x2a')]['interface']=util[_0xccbe('0x69')]('SIP/%s',_0x2cec3a[_0xccbe('0x64')]['name']);_0x388bce['message'][_0xccbe('0x73')]=_0x57d953[_0xccbe('0x73')];_0x388bce[_0xccbe('0x2a')][_0xccbe('0x74')]='reject';respondWithRpcPromise(_0xccbe('0x7a'),_0xccbe('0x7a'),{'event':_0xccbe('0x7b'),'message':_0x388bce[_0xccbe('0x2a')]},client9002);return _0x57d953;}return null;})[_0xccbe('0x22')](respondWithResult(_0x394cbc,null))['catch'](handleError(_0x394cbc,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8ae0fbb..e3ed751 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 _0x4959=['hasOwnProperty','hook','exports','ChatMessage','setMaxListeners','save','remove','emit'];(function(_0x4d19e0,_0x38f56f){var _0x22bc14=function(_0xc070df){while(--_0xc070df){_0x4d19e0['push'](_0x4d19e0['shift']());}};_0x22bc14(++_0x38f56f);}(_0x4959,0x9b));var _0x9495=function(_0x4761f5,_0x2bfb6e){_0x4761f5=_0x4761f5-0x0;var _0x14f637=_0x4959[_0x4761f5];return _0x14f637;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x9495('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9495('0x1')](0x0);var events={'afterCreate':_0x9495('0x2'),'afterUpdate':'update','afterDestroy':_0x9495('0x3')};function emitEvent(_0x3144b5){return function(_0xc4582d,_0x180fb5,_0x53009d){ChatMessageEvents[_0x9495('0x4')](_0x3144b5+':'+_0xc4582d['id'],_0xc4582d);ChatMessageEvents[_0x9495('0x4')](_0x3144b5,_0xc4582d);_0x53009d(null);};}for(var e in events){if(events[_0x9495('0x5')](e)){var event=events[e];ChatMessage[_0x9495('0x6')](e,emitEvent(event));}}module[_0x9495('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xe1aa=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x3dcbb5,_0xcfc072){var _0x12b83e=function(_0x47f812){while(--_0x47f812){_0x3dcbb5['push'](_0x3dcbb5['shift']());}};_0x12b83e(++_0xcfc072);}(_0xe1aa,0xfc));var _0xae1a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe1aa[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0xae1a('0x0'));var ChatMessage=require(_0xae1a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae1a('0x2'),'afterUpdate':_0xae1a('0x3'),'afterDestroy':_0xae1a('0x4')};function emitEvent(_0x29b837){return function(_0xc4d129,_0x5d1bdd,_0x11ab3b){ChatMessageEvents['emit'](_0x29b837+':'+_0xc4d129['id'],_0xc4d129);ChatMessageEvents[_0xae1a('0x5')](_0x29b837,_0xc4d129);_0x11ab3b(null);};}for(var e in events){if(events[_0xae1a('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 22af6da..393bd29 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 _0x3895=['get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models'];(function(_0x652cfa,_0x122079){var _0x1db690=function(_0x30910d){while(--_0x30910d){_0x652cfa['push'](_0x652cfa['shift']());}};_0x1db690(++_0x122079);}(_0x3895,0x1f3));var _0x5389=function(_0x36ffd5,_0x130ede){_0x36ffd5=_0x36ffd5-0x0;var _0x22bd77=_0x3895[_0x36ffd5];return _0x22bd77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5389('0x0'))(_0x5389('0x1'));var moment=require(_0x5389('0x2'));var BPromise=require('bluebird');var rp=require(_0x5389('0x3'));var fs=require('fs');var path=require(_0x5389('0x4'));var rimraf=require(_0x5389('0x5'));var config=require(_0x5389('0x6'));var attributes=require(_0x5389('0x7'));module[_0x5389('0x8')]=function(_0x2872db,_0x4f21bf){return _0x2872db['define'](_0x5389('0x9'),attributes,{'tableName':_0x5389('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5389('0xb')],'type':_0x5389('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40abf8,_0x4c12e9,_0x3251e){var _0x22b841=_0x2872db[_0x5389('0xd')];var _0x3ea65e=_0x40abf8[_0x5389('0xe')]({'plain':!![]});if(_0x3ea65e[_0x5389('0xf')]['toLowerCase']()==='in'||_0x3ea65e[_0x5389('0xf')][_0x5389('0x10')]()===_0x5389('0x11')&&!_0x3ea65e[_0x5389('0x12')]&&!_[_0x5389('0x13')](_0x3ea65e['UserId'])){_0x22b841[_0x5389('0x14')][_0x5389('0x15')]({'where':{'id':_0x3ea65e[_0x5389('0x16')]}})['then'](function(_0x3f2f9d){if(_0x3f2f9d){_0x3f2f9d[_0x5389('0x17')]({'lastMsgAt':_0x3ea65e[_0x5389('0x18')],'lastMsgDirection':_0x3ea65e[_0x5389('0xf')][_0x5389('0x10')]()});}})['catch'](function(_0x4e3e39){console[_0x5389('0x19')](_0x4e3e39);});}_0x3251e();}},'charset':'utf8mb4','collate':_0x5389('0x1a')});}; \ No newline at end of file +var _0x98b1=['chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','catch','error','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x155a8e,_0x1207b2){var _0x42c947=function(_0x1f2e94){while(--_0x1f2e94){_0x155a8e['push'](_0x155a8e['shift']());}};_0x42c947(++_0x1207b2);}(_0x98b1,0xc6));var _0x198b=function(_0x200c1e,_0x2c6397){_0x200c1e=_0x200c1e-0x0;var _0x4604d4=_0x98b1[_0x200c1e];return _0x4604d4;};'use strict';var _=require(_0x198b('0x0'));var util=require(_0x198b('0x1'));var logger=require(_0x198b('0x2'))(_0x198b('0x3'));var moment=require(_0x198b('0x4'));var BPromise=require('bluebird');var rp=require(_0x198b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x198b('0x6'));var attributes=require('./chatMessage.attributes');module[_0x198b('0x7')]=function(_0x52695b,_0x58217b){return _0x52695b[_0x198b('0x8')]('ChatMessage',attributes,{'tableName':_0x198b('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x198b('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35f44e,_0x46b4ab,_0x260656){var _0x43ec45=_0x52695b[_0x198b('0xb')];var _0x1f606a=_0x35f44e['get']({'plain':!![]});if(_0x1f606a[_0x198b('0xc')][_0x198b('0xd')]()==='in'||_0x1f606a['direction']['toLowerCase']()===_0x198b('0xe')&&!_0x1f606a[_0x198b('0xf')]&&!_[_0x198b('0x10')](_0x1f606a[_0x198b('0x11')])){_0x43ec45['ChatInteraction'][_0x198b('0x12')]({'where':{'id':_0x1f606a['ChatInteractionId']}})[_0x198b('0x13')](function(_0x4de965){if(_0x4de965){_0x4de965[_0x198b('0x14')]({'lastMsgAt':_0x1f606a['createdAt'],'lastMsgDirection':_0x1f606a[_0x198b('0xc')][_0x198b('0xd')]()});}})[_0x198b('0x15')](function(_0x1bede4){console[_0x198b('0x16')](_0x1bede4);});}_0x260656();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 7289c09..581dd19 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 _0x91ba=['code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x277ac8,_0x1ced1c){var _0x5d373a=function(_0x39b88b){while(--_0x39b88b){_0x277ac8['push'](_0x277ac8['shift']());}};_0x5d373a(++_0x1ced1c);}(_0x91ba,0x145));var _0xa91b=function(_0x4421db,_0x23cb15){_0x4421db=_0x4421db-0x0;var _0xecb851=_0x91ba[_0x4421db];return _0xecb851;};'use strict';var _=require(_0xa91b('0x0'));var util=require(_0xa91b('0x1'));var moment=require('moment');var BPromise=require(_0xa91b('0x2'));var rs=require(_0xa91b('0x3'));var fs=require('fs');var Redis=require(_0xa91b('0x4'));var db=require(_0xa91b('0x5'))['db'];var utils=require(_0xa91b('0x6'));var logger=require('../../config/logger')(_0xa91b('0x7'));var config=require(_0xa91b('0x8'));var jayson=require(_0xa91b('0x9'));var client=jayson[_0xa91b('0xa')][_0xa91b('0xb')]({'port':0x232a});config[_0xa91b('0xc')]=_[_0xa91b('0xd')](config[_0xa91b('0xc')],{'host':_0xa91b('0xe'),'port':0x18eb});var socket=require(_0xa91b('0xf'))(new Redis(config[_0xa91b('0xc')]));require(_0xa91b('0x10'))[_0xa91b('0x11')](socket);function respondWithRpcPromise(_0x53a1bf,_0x72dcbb,_0x4c68a6){return new BPromise(function(_0x456c79,_0x50ee39){return client[_0xa91b('0x12')](_0x53a1bf,_0x4c68a6)[_0xa91b('0x13')](function(_0x440ea0){logger[_0xa91b('0x14')](_0xa91b('0x15'),_0x72dcbb,_0xa91b('0x16'));logger[_0xa91b('0x17')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x72dcbb,_0xa91b('0x16'),JSON['stringify'](_0x440ea0));if(_0x440ea0['error']){if(_0x440ea0[_0xa91b('0x18')][_0xa91b('0x19')]===0x1f4){logger['error'](_0xa91b('0x15'),_0x72dcbb,_0x440ea0[_0xa91b('0x18')][_0xa91b('0x1a')]);return _0x50ee39(_0x440ea0[_0xa91b('0x18')]['message']);}logger[_0xa91b('0x18')]('ChatMessage,\x20%s,\x20%s',_0x72dcbb,_0x440ea0[_0xa91b('0x18')][_0xa91b('0x1a')]);return _0x456c79(_0x440ea0[_0xa91b('0x18')][_0xa91b('0x1a')]);}else{logger[_0xa91b('0x14')](_0xa91b('0x15'),_0x72dcbb,_0xa91b('0x16'));_0x456c79(_0x440ea0[_0xa91b('0x1b')][_0xa91b('0x1a')]);}})[_0xa91b('0x1c')](function(_0x447f46){logger['error']('ChatMessage,\x20%s,\x20%s',_0x72dcbb,_0x447f46);_0x50ee39(_0x447f46);});});}exports[_0xa91b('0x1d')]=function(_0x4824ef){var _0x3d645c=this;return new Promise(function(_0x573087,_0x14a077){return db[_0xa91b('0x1e')][_0xa91b('0x1f')](_0x4824ef['body'],{'raw':_0x4824ef[_0xa91b('0x20')]?_0x4824ef[_0xa91b('0x20')][_0xa91b('0x21')]===undefined?!![]:![]:!![]})[_0xa91b('0x13')](function(_0x1a4844){logger[_0xa91b('0x14')](_0xa91b('0x1d'),_0x4824ef);logger[_0xa91b('0x17')](_0xa91b('0x1d'),_0x4824ef,JSON[_0xa91b('0x22')](_0x1a4844));_0x573087(_0x1a4844);})[_0xa91b('0x1c')](function(_0x42235d){logger[_0xa91b('0x18')]('CreateChatMessage',_0x42235d[_0xa91b('0x1a')],_0x4824ef);_0x14a077(_0x3d645c[_0xa91b('0x18')](0x1f4,_0x42235d[_0xa91b('0x1a')]));});});}; \ No newline at end of file +var _0x4742=['randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','CreateChatMessage','create','options','lodash','moment'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x4742,0x142));var _0x2474=function(_0x41a118,_0x44c8b7){_0x41a118=_0x41a118-0x0;var _0x58bbaa=_0x4742[_0x41a118];return _0x58bbaa;};'use strict';var _=require(_0x2474('0x0'));var util=require('util');var moment=require(_0x2474('0x1'));var BPromise=require('bluebird');var rs=require(_0x2474('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2474('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2474('0x4'))(_0x2474('0x5'));var config=require('../../config/environment');var jayson=require(_0x2474('0x6'));var client=jayson[_0x2474('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2474('0x8'))(new Redis(config[_0x2474('0x9')]));require(_0x2474('0xa'))[_0x2474('0xb')](socket);function respondWithRpcPromise(_0x166d07,_0x3fcf3d,_0x487414){return new BPromise(function(_0x568082,_0x3d9786){return client[_0x2474('0xc')](_0x166d07,_0x487414)[_0x2474('0xd')](function(_0x1119c7){logger[_0x2474('0xe')](_0x2474('0xf'),_0x3fcf3d,_0x2474('0x10'));logger[_0x2474('0x11')](_0x2474('0x12'),_0x3fcf3d,_0x2474('0x10'),JSON[_0x2474('0x13')](_0x1119c7));if(_0x1119c7['error']){if(_0x1119c7['error']['code']===0x1f4){logger['error'](_0x2474('0xf'),_0x3fcf3d,_0x1119c7['error'][_0x2474('0x14')]);return _0x3d9786(_0x1119c7[_0x2474('0x15')][_0x2474('0x14')]);}logger[_0x2474('0x15')](_0x2474('0xf'),_0x3fcf3d,_0x1119c7['error'][_0x2474('0x14')]);return _0x568082(_0x1119c7[_0x2474('0x15')][_0x2474('0x14')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3fcf3d,_0x2474('0x10'));_0x568082(_0x1119c7[_0x2474('0x16')][_0x2474('0x14')]);}})[_0x2474('0x17')](function(_0x2ca9bb){logger[_0x2474('0x15')](_0x2474('0xf'),_0x3fcf3d,_0x2ca9bb);_0x3d9786(_0x2ca9bb);});});}exports[_0x2474('0x18')]=function(_0x223fea){var _0x1e6724=this;return new Promise(function(_0x3d9fc7,_0x33ee55){return db['ChatMessage'][_0x2474('0x19')](_0x223fea['body'],{'raw':_0x223fea['options']?_0x223fea[_0x2474('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2474('0xd')](function(_0x19312f){logger[_0x2474('0xe')](_0x2474('0x18'),_0x223fea);logger['debug'](_0x2474('0x18'),_0x223fea,JSON[_0x2474('0x13')](_0x19312f));_0x3d9fc7(_0x19312f);})[_0x2474('0x17')](function(_0x1b82e5){logger[_0x2474('0x15')](_0x2474('0x18'),_0x1b82e5[_0x2474('0x14')],_0x223fea);_0x33ee55(_0x1e6724[_0x2474('0x15')](0x1f4,_0x1b82e5[_0x2474('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 7d231ca..34ca418 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 _0x9c44=['emit','removeListener','length','chatMessage:','remove','update'];(function(_0x46e0f9,_0x33b941){var _0x2a4a21=function(_0x186111){while(--_0x186111){_0x46e0f9['push'](_0x46e0f9['shift']());}};_0x2a4a21(++_0x33b941);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatMessageEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatMessageEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x3e74,0x175));var _0x43e7=function(_0x405ce8,_0x5873fc){_0x405ce8=_0x405ce8-0x0;var _0x2e9ca5=_0x3e74[_0x405ce8];return _0x2e9ca5;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1f0279c..d6a7c9d 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 _0xba89=['post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xba89,0x89));var _0x9ba8=function(_0x5b6610,_0x2cc819){_0x5b6610=_0x5b6610-0x0;var _0x3aa2f8=_0xba89[_0x5b6610];return _0x3aa2f8;};'use strict';var multer=require(_0x9ba8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ba8('0x1'));var router=express[_0x9ba8('0x2')]();var auth=require(_0x9ba8('0x3'));var interaction=require(_0x9ba8('0x4'));var config=require(_0x9ba8('0x5'));var controller=require(_0x9ba8('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9ba8('0x7')]);router[_0x9ba8('0x8')](_0x9ba8('0x9'),auth[_0x9ba8('0xa')](),controller[_0x9ba8('0xb')]);router[_0x9ba8('0x8')](_0x9ba8('0xc'),auth[_0x9ba8('0xa')](),controller['show']);router[_0x9ba8('0xd')]('/',auth[_0x9ba8('0xa')](),interaction[_0x9ba8('0xe')](_0x9ba8('0xf'),'chatmessage:create'),controller[_0x9ba8('0x10')]);router[_0x9ba8('0x11')](_0x9ba8('0xc'),controller[_0x9ba8('0x12')]);router[_0x9ba8('0x11')](_0x9ba8('0x13'),auth['isAuthenticated'](),controller[_0x9ba8('0x14')]);router[_0x9ba8('0x11')](_0x9ba8('0x15'),auth[_0x9ba8('0xa')](),controller[_0x9ba8('0x16')]);router[_0x9ba8('0x17')]('/:id',auth[_0x9ba8('0xa')](),controller['destroy']);module[_0x9ba8('0x18')]=router; \ No newline at end of file +var _0x65d2=['index','/describe','describe','/:id','show','chat','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65d2,0xce));var _0x265d=function(_0x7307f8,_0x551d38){_0x7307f8=_0x7307f8-0x0;var _0x340654=_0x65d2[_0x7307f8];return _0x340654;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x265d('0x0'));var timeout=require(_0x265d('0x1'));var express=require(_0x265d('0x2'));var router=express[_0x265d('0x3')]();var auth=require(_0x265d('0x4'));var interaction=require(_0x265d('0x5'));var config=require(_0x265d('0x6'));var controller=require(_0x265d('0x7'));router[_0x265d('0x8')]('/',auth[_0x265d('0x9')](),controller[_0x265d('0xa')]);router['get'](_0x265d('0xb'),auth[_0x265d('0x9')](),controller[_0x265d('0xc')]);router[_0x265d('0x8')](_0x265d('0xd'),auth['isAuthenticated'](),controller[_0x265d('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x265d('0xf'),_0x265d('0x10')),controller[_0x265d('0x11')]);router['put'](_0x265d('0xd'),controller[_0x265d('0x12')]);router['put'](_0x265d('0x13'),auth[_0x265d('0x9')](),controller[_0x265d('0x14')]);router[_0x265d('0x15')](_0x265d('0x16'),auth[_0x265d('0x9')](),controller[_0x265d('0x17')]);router['delete'](_0x265d('0xd'),auth[_0x265d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index e94df05..13501a4 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 _0xcc62=['TEXT','sequelize'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xcc62,0x10b));var _0x2cc6=function(_0xff80,_0x35522f){_0xff80=_0xff80-0x0;var _0x485b2e=_0xcc62[_0xff80];return _0x485b2e;};'use strict';var Sequelize=require(_0x2cc6('0x0'));module['exports']={'body':{'type':Sequelize[_0x2cc6('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x6049=['exports','TEXT','sequelize'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0x6049,0x10a));var _0x9604=function(_0x3ffc1b,_0xc8535f){_0x3ffc1b=_0x3ffc1b-0x0;var _0x5a7287=_0x6049[_0x3ffc1b];return _0x5a7287;};'use strict';var Sequelize=require(_0x9604('0x0'));module[_0x9604('0x1')]={'body':{'type':Sequelize[_0x9604('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index eafc4a0..a17e03b 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 _0xefda=['create','body','destroy','describe','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','ChatOfflineMessage','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find'];(function(_0x5a1b05,_0x53582a){var _0x154fa7=function(_0x2dcbda){while(--_0x2dcbda){_0x5a1b05['push'](_0x5a1b05['shift']());}};_0x154fa7(++_0x53582a);}(_0xefda,0x96));var _0xaefd=function(_0x1e52b5,_0x33b9c0){_0x1e52b5=_0x1e52b5-0x0;var _0x2be842=_0xefda[_0x1e52b5];return _0x2be842;};'use strict';var pdf=require(_0xaefd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaefd('0x1'));var jsonpatch=require(_0xaefd('0x2'));var rp=require('request-promise');var moment=require(_0xaefd('0x3'));var BPromise=require(_0xaefd('0x4'));var Mustache=require(_0xaefd('0x5'));var util=require(_0xaefd('0x6'));var path=require(_0xaefd('0x7'));var sox=require(_0xaefd('0x8'));var csv=require('to-csv');var ejs=require(_0xaefd('0x9'));var fs=require('fs');var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0xe'));var querystring=require(_0xaefd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var db=require(_0xaefd('0x16'))['db'];function respondWithStatusCode(_0x3dfddf,_0x27be0f){_0x27be0f=_0x27be0f||0xcc;return function(_0x382983){if(_0x382983){return _0x3dfddf[_0xaefd('0x17')](_0x27be0f);}return _0x3dfddf['status'](_0x27be0f)[_0xaefd('0x18')]();};}function respondWithResult(_0x4ac467,_0xd88c7c){_0xd88c7c=_0xd88c7c||0xc8;return function(_0x1725af){if(_0x1725af){return _0x4ac467[_0xaefd('0x19')](_0xd88c7c)[_0xaefd('0x1a')](_0x1725af);}};}function respondWithFilteredResult(_0x4ec92a,_0x16e4f4){return function(_0x13492c){if(_0x13492c){var _0x41f345=_0x13492c[_0xaefd('0x1b')],_0x411701=_0x16e4f4[_0xaefd('0x1c')],_0x10ee28=_0x16e4f4['offset']+_0x16e4f4[_0xaefd('0x1d')],_0x32f75e;if(_0x10ee28>=_0x41f345){_0x10ee28=_0x41f345;_0x32f75e=0xc8;}else{_0x32f75e=0xce;}_0x4ec92a[_0xaefd('0x19')](_0x32f75e);return _0x4ec92a[_0xaefd('0x1e')](_0xaefd('0x1f'),_0x411701+'-'+_0x10ee28+'/'+_0x41f345)[_0xaefd('0x1a')](_0x13492c);}return null;};}function patchUpdates(_0x244956){return function(_0x516e84){try{jsonpatch[_0xaefd('0x20')](_0x516e84,_0x244956,!![]);}catch(_0x182f9a){return BPromise[_0xaefd('0x21')](_0x182f9a);}return _0x516e84[_0xaefd('0x22')]();};}function saveUpdates(_0x45ebf2,_0x1f302c){return function(_0x5282ed){if(_0x5282ed){return _0x5282ed[_0xaefd('0x23')](_0x45ebf2)[_0xaefd('0x24')](function(_0x2dcdd8){return _0x2dcdd8;});}return null;};}function removeEntity(_0x3d9823,_0x2d490b){return function(_0x577fb7){if(_0x577fb7){return _0x577fb7['destroy']()['then'](function(){_0x3d9823[_0xaefd('0x19')](0xcc)[_0xaefd('0x18')]();});}};}function handleEntityNotFound(_0x313a6f,_0x5a44ed){return function(_0x23060f){if(!_0x23060f){_0x313a6f['sendStatus'](0x194);}return _0x23060f;};}function handleError(_0x3deec8,_0x3caa99){_0x3caa99=_0x3caa99||0x1f4;return function(_0x1a05eb){logger['error'](_0x1a05eb[_0xaefd('0x25')]);if(_0x1a05eb[_0xaefd('0x26')]){delete _0x1a05eb[_0xaefd('0x26')];}_0x3deec8[_0xaefd('0x19')](_0x3caa99)[_0xaefd('0x27')](_0x1a05eb);};}exports['index']=function(_0x2fe27e,_0x58c008){var _0x810bf={},_0x16f10f={},_0x5470bd={'count':0x0,'rows':[]};var _0x2b3d3d=db[_0xaefd('0x28')]['rawAttributes'];_0x16f10f[_0xaefd('0x29')]=_[_0xaefd('0x2a')](_0x2b3d3d);_0x16f10f[_0xaefd('0x2b')]=_['keys'](_0x2fe27e[_0xaefd('0x2b')]);_0x16f10f['filters']=_[_0xaefd('0x2c')](_0x16f10f['model'],_0x16f10f['query']);_0x810bf[_0xaefd('0x2d')]=_[_0xaefd('0x2c')](_0x16f10f['model'],qs['fields'](_0x2fe27e['query'][_0xaefd('0x2e')]));_0x810bf[_0xaefd('0x2d')]=_0x810bf['attributes']['length']?_0x810bf[_0xaefd('0x2d')]:_0x16f10f[_0xaefd('0x29')];if(!_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x2f')]('nolimit')){_0x810bf[_0xaefd('0x1d')]=qs[_0xaefd('0x1d')](_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x1d')]);_0x810bf[_0xaefd('0x1c')]=qs[_0xaefd('0x1c')](_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x1c')]);}_0x810bf[_0xaefd('0x30')]=qs[_0xaefd('0x31')](_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x31')]);_0x810bf[_0xaefd('0x32')]=qs[_0xaefd('0x33')](_[_0xaefd('0x34')](_0x2fe27e[_0xaefd('0x2b')],_0x16f10f['filters']));if(_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x35')]){_0x810bf[_0xaefd('0x32')]=_['merge'](_0x810bf[_0xaefd('0x32')],{'$or':_['map'](_0x2b3d3d,function(_0x187e76){if(_0x187e76[_0xaefd('0x36')][_0xaefd('0x37')]!==_0xaefd('0x38')){var _0x2c0d72={};_0x2c0d72[_0x187e76[_0xaefd('0x39')]]={'$like':'%'+_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x35')]+'%'};return _0x2c0d72;}})});}_0x810bf=_[_0xaefd('0x3a')]({},_0x810bf,_0x2fe27e[_0xaefd('0x3b')]);var _0x27e3d0={'where':_0x810bf[_0xaefd('0x32')]};return db[_0xaefd('0x28')][_0xaefd('0x1b')](_0x27e3d0)['then'](function(_0x1cfd6d){_0x5470bd['count']=_0x1cfd6d;if(_0x2fe27e[_0xaefd('0x2b')][_0xaefd('0x3c')]){_0x810bf[_0xaefd('0x3d')]=[{'all':!![]}];}return db[_0xaefd('0x28')][_0xaefd('0x3e')](_0x810bf);})[_0xaefd('0x24')](function(_0xa98181){_0x5470bd[_0xaefd('0x3f')]=_0xa98181;return _0x5470bd;})[_0xaefd('0x24')](respondWithFilteredResult(_0x58c008,_0x810bf))[_0xaefd('0x40')](handleError(_0x58c008,null));};exports['show']=function(_0x696af5,_0x3296ac){var _0x4dfea1={'raw':!![],'where':{'id':_0x696af5[_0xaefd('0x41')]['id']}},_0x427f00={};_0x427f00[_0xaefd('0x29')]=_['keys'](db['ChatOfflineMessage'][_0xaefd('0x42')]);_0x427f00[_0xaefd('0x2b')]=_[_0xaefd('0x2a')](_0x696af5[_0xaefd('0x2b')]);_0x427f00[_0xaefd('0x33')]=_[_0xaefd('0x2c')](_0x427f00[_0xaefd('0x29')],_0x427f00[_0xaefd('0x2b')]);_0x4dfea1['attributes']=_[_0xaefd('0x2c')](_0x427f00[_0xaefd('0x29')],qs[_0xaefd('0x2e')](_0x696af5[_0xaefd('0x2b')][_0xaefd('0x2e')]));_0x4dfea1[_0xaefd('0x2d')]=_0x4dfea1[_0xaefd('0x2d')][_0xaefd('0x43')]?_0x4dfea1['attributes']:_0x427f00['model'];if(_0x696af5[_0xaefd('0x2b')][_0xaefd('0x3c')]){_0x4dfea1['include']=[{'all':!![]}];}_0x4dfea1=_['merge']({},_0x4dfea1,_0x696af5[_0xaefd('0x3b')]);return db[_0xaefd('0x28')][_0xaefd('0x44')](_0x4dfea1)[_0xaefd('0x24')](handleEntityNotFound(_0x3296ac,null))[_0xaefd('0x24')](respondWithResult(_0x3296ac,null))[_0xaefd('0x40')](handleError(_0x3296ac,null));};exports[_0xaefd('0x45')]=function(_0x1c42fc,_0x332ebb){return db['ChatOfflineMessage'][_0xaefd('0x45')](_0x1c42fc[_0xaefd('0x46')],{})[_0xaefd('0x24')](respondWithResult(_0x332ebb,0xc9))[_0xaefd('0x40')](handleError(_0x332ebb,null));};exports[_0xaefd('0x23')]=function(_0x2cb72f,_0xf54e83){if(_0x2cb72f['body']['id']){delete _0x2cb72f[_0xaefd('0x46')]['id'];}return db['ChatOfflineMessage'][_0xaefd('0x44')]({'where':{'id':_0x2cb72f[_0xaefd('0x41')]['id']}})[_0xaefd('0x24')](handleEntityNotFound(_0xf54e83,null))[_0xaefd('0x24')](saveUpdates(_0x2cb72f['body'],null))['then'](respondWithResult(_0xf54e83,null))[_0xaefd('0x40')](handleError(_0xf54e83,null));};exports[_0xaefd('0x47')]=function(_0x179b8b,_0x4eeb56){return db[_0xaefd('0x28')][_0xaefd('0x44')]({'where':{'id':_0x179b8b['params']['id']}})[_0xaefd('0x24')](handleEntityNotFound(_0x4eeb56,null))[_0xaefd('0x24')](removeEntity(_0x4eeb56,null))[_0xaefd('0x40')](handleError(_0x4eeb56,null));};exports[_0xaefd('0x48')]=function(_0x398aee,_0xcdb133){return db[_0xaefd('0x28')][_0xaefd('0x48')]()['then'](respondWithResult(_0xcdb133,null))['catch'](handleError(_0xcdb133,null));}; \ No newline at end of file +var _0xe9e8=['query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','ChatOfflineMessage','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','rawAttributes','model','keys'];(function(_0x44aac2,_0x336163){var _0x38a6bc=function(_0x423444){while(--_0x423444){_0x44aac2['push'](_0x44aac2['shift']());}};_0x38a6bc(++_0x336163);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x3c4b5c,_0x5b079f){_0x3c4b5c=_0x3c4b5c-0x0;var _0x253bce=_0xe9e8[_0x3c4b5c];return _0x253bce;};'use strict';var pdf=require(_0x8e9e('0x0'));var emlformat=require(_0x8e9e('0x1'));var rimraf=require(_0x8e9e('0x2'));var zipdir=require(_0x8e9e('0x3'));var jsonpatch=require(_0x8e9e('0x4'));var rp=require(_0x8e9e('0x5'));var moment=require(_0x8e9e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8e9e('0x7'));var util=require(_0x8e9e('0x8'));var path=require(_0x8e9e('0x9'));var sox=require('sox');var csv=require(_0x8e9e('0xa'));var ejs=require(_0x8e9e('0xb'));var fs=require('fs');var _=require(_0x8e9e('0xc'));var squel=require(_0x8e9e('0xd'));var crypto=require('crypto');var jsforce=require(_0x8e9e('0xe'));var deskjs=require(_0x8e9e('0xf'));var toCsv=require(_0x8e9e('0xa'));var querystring=require('querystring');var Papa=require(_0x8e9e('0x10'));var Redis=require(_0x8e9e('0x11'));var authService=require(_0x8e9e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8e9e('0x13'));var logger=require(_0x8e9e('0x14'))(_0x8e9e('0x15'));var utils=require(_0x8e9e('0x16'));var config=require(_0x8e9e('0x17'));var db=require(_0x8e9e('0x18'))['db'];function respondWithStatusCode(_0x2adef2,_0x50a7a8){_0x50a7a8=_0x50a7a8||0xcc;return function(_0xd95062){if(_0xd95062){return _0x2adef2['sendStatus'](_0x50a7a8);}return _0x2adef2[_0x8e9e('0x19')](_0x50a7a8)[_0x8e9e('0x1a')]();};}function respondWithResult(_0x1aad1a,_0x4355ca){_0x4355ca=_0x4355ca||0xc8;return function(_0x1683ba){if(_0x1683ba){return _0x1aad1a[_0x8e9e('0x19')](_0x4355ca)[_0x8e9e('0x1b')](_0x1683ba);}};}function respondWithFilteredResult(_0x4c1315,_0x54dbd4){return function(_0x23dc48){if(_0x23dc48){var _0x36ca0a=_0x23dc48[_0x8e9e('0x1c')],_0x5674ef=_0x54dbd4[_0x8e9e('0x1d')],_0x1a565e=_0x54dbd4[_0x8e9e('0x1d')]+_0x54dbd4['limit'],_0xb67ecc;if(_0x1a565e>=_0x36ca0a){_0x1a565e=_0x36ca0a;_0xb67ecc=0xc8;}else{_0xb67ecc=0xce;}_0x4c1315['status'](_0xb67ecc);return _0x4c1315[_0x8e9e('0x1e')](_0x8e9e('0x1f'),_0x5674ef+'-'+_0x1a565e+'/'+_0x36ca0a)[_0x8e9e('0x1b')](_0x23dc48);}return null;};}function patchUpdates(_0x28584b){return function(_0xa079b5){try{jsonpatch[_0x8e9e('0x20')](_0xa079b5,_0x28584b,!![]);}catch(_0x311697){return BPromise['reject'](_0x311697);}return _0xa079b5[_0x8e9e('0x21')]();};}function saveUpdates(_0x5ad498,_0x258ac5){return function(_0x19a890){if(_0x19a890){return _0x19a890['update'](_0x5ad498)[_0x8e9e('0x22')](function(_0x2f5397){return _0x2f5397;});}return null;};}function removeEntity(_0x30657f,_0x263d48){return function(_0x354560){if(_0x354560){return _0x354560[_0x8e9e('0x23')]()[_0x8e9e('0x22')](function(){_0x30657f[_0x8e9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0796,_0x41edb6){return function(_0x3ab249){if(!_0x3ab249){_0x4b0796[_0x8e9e('0x24')](0x194);}return _0x3ab249;};}function handleError(_0x5a1e59,_0x2d6190){_0x2d6190=_0x2d6190||0x1f4;return function(_0x5d2128){logger[_0x8e9e('0x25')](_0x5d2128[_0x8e9e('0x26')]);if(_0x5d2128[_0x8e9e('0x27')]){delete _0x5d2128['name'];}_0x5a1e59[_0x8e9e('0x19')](_0x2d6190)['send'](_0x5d2128);};}exports['index']=function(_0x4232c2,_0x5201e1){var _0x43b549={},_0x4e0a5e={},_0x2fb5e7={'count':0x0,'rows':[]};var _0x292b1e=db['ChatOfflineMessage'][_0x8e9e('0x28')];_0x4e0a5e[_0x8e9e('0x29')]=_[_0x8e9e('0x2a')](_0x292b1e);_0x4e0a5e[_0x8e9e('0x2b')]=_[_0x8e9e('0x2a')](_0x4232c2[_0x8e9e('0x2b')]);_0x4e0a5e[_0x8e9e('0x2c')]=_[_0x8e9e('0x2d')](_0x4e0a5e[_0x8e9e('0x29')],_0x4e0a5e['query']);_0x43b549[_0x8e9e('0x2e')]=_[_0x8e9e('0x2d')](_0x4e0a5e[_0x8e9e('0x29')],qs[_0x8e9e('0x2f')](_0x4232c2['query'][_0x8e9e('0x2f')]));_0x43b549[_0x8e9e('0x2e')]=_0x43b549[_0x8e9e('0x2e')][_0x8e9e('0x30')]?_0x43b549[_0x8e9e('0x2e')]:_0x4e0a5e[_0x8e9e('0x29')];if(!_0x4232c2[_0x8e9e('0x2b')][_0x8e9e('0x31')]('nolimit')){_0x43b549['limit']=qs[_0x8e9e('0x32')](_0x4232c2['query'][_0x8e9e('0x32')]);_0x43b549[_0x8e9e('0x1d')]=qs[_0x8e9e('0x1d')](_0x4232c2[_0x8e9e('0x2b')][_0x8e9e('0x1d')]);}_0x43b549[_0x8e9e('0x33')]=qs[_0x8e9e('0x34')](_0x4232c2[_0x8e9e('0x2b')][_0x8e9e('0x34')]);_0x43b549[_0x8e9e('0x35')]=qs[_0x8e9e('0x2c')](_[_0x8e9e('0x36')](_0x4232c2[_0x8e9e('0x2b')],_0x4e0a5e[_0x8e9e('0x2c')]));if(_0x4232c2[_0x8e9e('0x2b')]['filter']){_0x43b549['where']=_[_0x8e9e('0x37')](_0x43b549['where'],{'$or':_[_0x8e9e('0x38')](_0x292b1e,function(_0x30719a){if(_0x30719a[_0x8e9e('0x39')][_0x8e9e('0x3a')]!==_0x8e9e('0x3b')){var _0x11a378={};_0x11a378[_0x30719a['field']]={'$like':'%'+_0x4232c2[_0x8e9e('0x2b')][_0x8e9e('0x3c')]+'%'};return _0x11a378;}})});}_0x43b549=_['merge']({},_0x43b549,_0x4232c2[_0x8e9e('0x3d')]);var _0x1eed1a={'where':_0x43b549[_0x8e9e('0x35')]};return db[_0x8e9e('0x3e')][_0x8e9e('0x1c')](_0x1eed1a)[_0x8e9e('0x22')](function(_0x121951){_0x2fb5e7['count']=_0x121951;if(_0x4232c2[_0x8e9e('0x2b')][_0x8e9e('0x3f')]){_0x43b549[_0x8e9e('0x40')]=[{'all':!![]}];}return db[_0x8e9e('0x3e')][_0x8e9e('0x41')](_0x43b549);})['then'](function(_0x4f045b){_0x2fb5e7[_0x8e9e('0x42')]=_0x4f045b;return _0x2fb5e7;})[_0x8e9e('0x22')](respondWithFilteredResult(_0x5201e1,_0x43b549))[_0x8e9e('0x43')](handleError(_0x5201e1,null));};exports[_0x8e9e('0x44')]=function(_0x2c0a9d,_0x1ae957){var _0xf5162e={'raw':!![],'where':{'id':_0x2c0a9d[_0x8e9e('0x45')]['id']}},_0x5d01bd={};_0x5d01bd[_0x8e9e('0x29')]=_[_0x8e9e('0x2a')](db[_0x8e9e('0x3e')][_0x8e9e('0x28')]);_0x5d01bd['query']=_['keys'](_0x2c0a9d[_0x8e9e('0x2b')]);_0x5d01bd['filters']=_[_0x8e9e('0x2d')](_0x5d01bd[_0x8e9e('0x29')],_0x5d01bd[_0x8e9e('0x2b')]);_0xf5162e['attributes']=_[_0x8e9e('0x2d')](_0x5d01bd[_0x8e9e('0x29')],qs[_0x8e9e('0x2f')](_0x2c0a9d[_0x8e9e('0x2b')][_0x8e9e('0x2f')]));_0xf5162e[_0x8e9e('0x2e')]=_0xf5162e[_0x8e9e('0x2e')][_0x8e9e('0x30')]?_0xf5162e[_0x8e9e('0x2e')]:_0x5d01bd[_0x8e9e('0x29')];if(_0x2c0a9d[_0x8e9e('0x2b')]['includeAll']){_0xf5162e[_0x8e9e('0x40')]=[{'all':!![]}];}_0xf5162e=_[_0x8e9e('0x37')]({},_0xf5162e,_0x2c0a9d[_0x8e9e('0x3d')]);return db['ChatOfflineMessage']['find'](_0xf5162e)[_0x8e9e('0x22')](handleEntityNotFound(_0x1ae957,null))[_0x8e9e('0x22')](respondWithResult(_0x1ae957,null))[_0x8e9e('0x43')](handleError(_0x1ae957,null));};exports[_0x8e9e('0x46')]=function(_0x3f4acc,_0x134088){return db['ChatOfflineMessage']['create'](_0x3f4acc[_0x8e9e('0x47')],{})[_0x8e9e('0x22')](respondWithResult(_0x134088,0xc9))['catch'](handleError(_0x134088,null));};exports[_0x8e9e('0x48')]=function(_0x488948,_0x42bf55){if(_0x488948['body']['id']){delete _0x488948['body']['id'];}return db[_0x8e9e('0x3e')][_0x8e9e('0x49')]({'where':{'id':_0x488948[_0x8e9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x42bf55,null))['then'](saveUpdates(_0x488948[_0x8e9e('0x47')],null))[_0x8e9e('0x22')](respondWithResult(_0x42bf55,null))[_0x8e9e('0x43')](handleError(_0x42bf55,null));};exports[_0x8e9e('0x23')]=function(_0x1e40a9,_0x38453e){return db[_0x8e9e('0x3e')][_0x8e9e('0x49')]({'where':{'id':_0x1e40a9[_0x8e9e('0x45')]['id']}})[_0x8e9e('0x22')](handleEntityNotFound(_0x38453e,null))['then'](removeEntity(_0x38453e,null))[_0x8e9e('0x43')](handleError(_0x38453e,null));};exports[_0x8e9e('0x4a')]=function(_0x9dffac,_0x5ea0a6){return db[_0x8e9e('0x3e')]['describe']()['then'](respondWithResult(_0x5ea0a6,null))[_0x8e9e('0x43')](handleError(_0x5ea0a6,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index c0b6e1f..b5fbf97 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 _0xc549=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x34152b,_0x47e9de){var _0x26d2dd=function(_0x154dd6){while(--_0x154dd6){_0x34152b['push'](_0x34152b['shift']());}};_0x26d2dd(++_0x47e9de);}(_0xc549,0x122));var _0x9c54=function(_0x4c489c,_0x2341ec){_0x4c489c=_0x4c489c-0x0;var _0xd0493f=_0xc549[_0x4c489c];return _0xd0493f;};'use strict';var _=require(_0x9c54('0x0'));var util=require(_0x9c54('0x1'));var logger=require(_0x9c54('0x2'))('api');var moment=require(_0x9c54('0x3'));var BPromise=require(_0x9c54('0x4'));var rp=require(_0x9c54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c54('0x6'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x57e890,_0x288264){return _0x57e890[_0x9c54('0x7')](_0x9c54('0x8'),attributes,{'tableName':_0x9c54('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c54('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4d77=['lodash','util','api','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0xae9f75,_0x3e4734){var _0x4bb219=function(_0x52d6dc){while(--_0x52d6dc){_0xae9f75['push'](_0xae9f75['shift']());}};_0x4bb219(++_0x3e4734);}(_0x4d77,0xfc));var _0x74d7=function(_0x2ea673,_0xa90a02){_0x2ea673=_0x2ea673-0x0;var _0x100a2b=_0x4d77[_0x2ea673];return _0x100a2b;};'use strict';var _=require(_0x74d7('0x0'));var util=require(_0x74d7('0x1'));var logger=require('../../config/logger')(_0x74d7('0x2'));var moment=require('moment');var BPromise=require(_0x74d7('0x3'));var rp=require(_0x74d7('0x4'));var fs=require('fs');var path=require(_0x74d7('0x5'));var rimraf=require(_0x74d7('0x6'));var config=require('../../config/environment');var attributes=require(_0x74d7('0x7'));module[_0x74d7('0x8')]=function(_0x43eb80,_0x4fbbd7){return _0x43eb80['define'](_0x74d7('0x9'),attributes,{'tableName':_0x74d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74d7('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 18342cb..dbb3ca6 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 _0x1e5d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x5cd1e0,_0x384e3f){var _0x4003b2=function(_0x320984){while(--_0x320984){_0x5cd1e0['push'](_0x5cd1e0['shift']());}};_0x4003b2(++_0x384e3f);}(_0x1e5d,0x136));var _0xd1e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e5d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd1e5('0x0'));var util=require(_0xd1e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd1e5('0x2'));var fs=require('fs');var Redis=require(_0xd1e5('0x3'));var db=require(_0xd1e5('0x4'))['db'];var utils=require(_0xd1e5('0x5'));var logger=require(_0xd1e5('0x6'))(_0xd1e5('0x7'));var config=require(_0xd1e5('0x8'));var jayson=require(_0xd1e5('0x9'));var client=jayson[_0xd1e5('0xa')][_0xd1e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523409,_0x227da8,_0x3d0f66){return new BPromise(function(_0x4077ee,_0x43d7cc){return client[_0xd1e5('0xc')](_0x523409,_0x3d0f66)[_0xd1e5('0xd')](function(_0x1339e6){logger[_0xd1e5('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x227da8,_0xd1e5('0xf'));logger[_0xd1e5('0x10')](_0xd1e5('0x11'),_0x227da8,'request\x20sent',JSON[_0xd1e5('0x12')](_0x1339e6));if(_0x1339e6['error']){if(_0x1339e6[_0xd1e5('0x13')]['code']===0x1f4){logger[_0xd1e5('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x227da8,_0x1339e6[_0xd1e5('0x13')][_0xd1e5('0x14')]);return _0x43d7cc(_0x1339e6[_0xd1e5('0x13')][_0xd1e5('0x14')]);}logger[_0xd1e5('0x13')](_0xd1e5('0x15'),_0x227da8,_0x1339e6[_0xd1e5('0x13')]['message']);return _0x4077ee(_0x1339e6[_0xd1e5('0x13')][_0xd1e5('0x14')]);}else{logger[_0xd1e5('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x227da8,_0xd1e5('0xf'));_0x4077ee(_0x1339e6[_0xd1e5('0x16')][_0xd1e5('0x14')]);}})[_0xd1e5('0x17')](function(_0x3db0d1){logger[_0xd1e5('0x13')](_0xd1e5('0x15'),_0x227da8,_0x3db0d1);_0x43d7cc(_0x3db0d1);});});} \ No newline at end of file +var _0x491f=['jayson/promise','http','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x585651,_0x42b2){var _0x521317=function(_0x446e8a){while(--_0x446e8a){_0x585651['push'](_0x585651['shift']());}};_0x521317(++_0x42b2);}(_0x491f,0x17e));var _0xf491=function(_0x37f58b,_0x5c0876){_0x37f58b=_0x37f58b-0x0;var _0x4f3a64=_0x491f[_0x37f58b];return _0x4f3a64;};'use strict';var _=require(_0xf491('0x0'));var util=require(_0xf491('0x1'));var moment=require(_0xf491('0x2'));var BPromise=require('bluebird');var rs=require(_0xf491('0x3'));var fs=require('fs');var Redis=require(_0xf491('0x4'));var db=require(_0xf491('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf491('0x6'))(_0xf491('0x7'));var config=require(_0xf491('0x8'));var jayson=require(_0xf491('0x9'));var client=jayson['client'][_0xf491('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b4b0,_0x54523c,_0x1e5b0a){return new BPromise(function(_0x39b506,_0x21475b){return client[_0xf491('0xb')](_0x38b4b0,_0x1e5b0a)[_0xf491('0xc')](function(_0xa879b7){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x54523c,_0xf491('0xd'));logger[_0xf491('0xe')](_0xf491('0xf'),_0x54523c,_0xf491('0xd'),JSON['stringify'](_0xa879b7));if(_0xa879b7[_0xf491('0x10')]){if(_0xa879b7['error'][_0xf491('0x11')]===0x1f4){logger['error'](_0xf491('0x12'),_0x54523c,_0xa879b7[_0xf491('0x10')]['message']);return _0x21475b(_0xa879b7[_0xf491('0x10')][_0xf491('0x13')]);}logger[_0xf491('0x10')](_0xf491('0x12'),_0x54523c,_0xa879b7[_0xf491('0x10')][_0xf491('0x13')]);return _0x39b506(_0xa879b7[_0xf491('0x10')][_0xf491('0x13')]);}else{logger[_0xf491('0x14')](_0xf491('0x12'),_0x54523c,_0xf491('0xd'));_0x39b506(_0xa879b7[_0xf491('0x15')][_0xf491('0x13')]);}})[_0xf491('0x16')](function(_0x1a29ea){logger[_0xf491('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x54523c,_0x1a29ea);_0x21475b(_0x1a29ea);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0138237..6752dd8 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 _0xf3cd=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4a8e86,_0x57c091){var _0x353685=function(_0x1d9d5d){while(--_0x1d9d5d){_0x4a8e86['push'](_0x4a8e86['shift']());}};_0x353685(++_0x57c091);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1301aa,_0x4da5c4){_0x1301aa=_0x1301aa-0x0;var _0x5146a1=_0xf3cd[_0x1301aa];return _0x5146a1;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0xf')]('/',auth[_0xdf3c('0x9')](),controller['create']);router[_0xdf3c('0x10')](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x11')]);router[_0xdf3c('0x12')](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7119=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util'];(function(_0x3bc70c,_0x337494){var _0x3651a7=function(_0x132317){while(--_0x132317){_0x3bc70c['push'](_0x3bc70c['shift']());}};_0x3651a7(++_0x337494);}(_0x7119,0x1c7));var _0x9711=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0x7119[_0x311666];return _0x2bc692;};'use strict';var multer=require('multer');var util=require(_0x9711('0x0'));var path=require('path');var timeout=require(_0x9711('0x1'));var express=require('express');var router=express[_0x9711('0x2')]();var auth=require(_0x9711('0x3'));var interaction=require(_0x9711('0x4'));var config=require(_0x9711('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x9711('0x6')]('/',auth[_0x9711('0x7')](),controller[_0x9711('0x8')]);router[_0x9711('0x6')](_0x9711('0x9'),auth['isAuthenticated'](),controller[_0x9711('0xa')]);router[_0x9711('0x6')](_0x9711('0xb'),auth['isAuthenticated'](),controller[_0x9711('0xc')]);router['post']('/',auth[_0x9711('0x7')](),controller[_0x9711('0xd')]);router[_0x9711('0xe')]('/:id',auth[_0x9711('0x7')](),controller[_0x9711('0xf')]);router[_0x9711('0x10')](_0x9711('0xb'),auth[_0x9711('0x7')](),controller[_0x9711('0x11')]);module[_0x9711('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 015a416..0bf5413 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 _0x707b=['STRING','mouseOver','INTEGER','sequelize','exports'];(function(_0x532fd9,_0x1ffee7){var _0x292a5c=function(_0x49e044){while(--_0x49e044){_0x532fd9['push'](_0x532fd9['shift']());}};_0x292a5c(++_0x1ffee7);}(_0x707b,0xdf));var _0xb707=function(_0x21024f,_0x35e650){_0x21024f=_0x21024f-0x0;var _0x26e8f8=_0x707b[_0x21024f];return _0x26e8f8;};'use strict';var Sequelize=require(_0xb707('0x0'));module[_0xb707('0x1')]={'name':{'type':Sequelize[_0xb707('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb707('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xb707('0x2')]},'timeout':{'type':Sequelize[_0xb707('0x4')]}}; \ No newline at end of file +var _0x1abc=['timeout','mouseOver','STRING','INTEGER','sequelize','exports'];(function(_0x49e882,_0x483c80){var _0x23f715=function(_0x450991){while(--_0x450991){_0x49e882['push'](_0x49e882['shift']());}};_0x23f715(++_0x483c80);}(_0x1abc,0x1ae));var _0xc1ab=function(_0x445971,_0x432a07){_0x445971=_0x445971-0x0;var _0x3e5e23=_0x1abc[_0x445971];return _0x3e5e23;};'use strict';var Sequelize=require(_0xc1ab('0x0'));module[_0xc1ab('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xc1ab('0x2')),'defaultValue':_0xc1ab('0x3')},'selector':{'type':Sequelize[_0xc1ab('0x4')]},'timeout':{'type':Sequelize[_0xc1ab('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 186aa19..60e682a 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 _0xaaaa=['params','keys','ChatProactiveAction','rawAttributes','query','intersection','model','fields','length','includeAll','find','catch','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','show'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xaaaa,0xa8));var _0xaaaa=function(_0x35eedb,_0x226686){_0x35eedb=_0x35eedb-0x0;var _0x57f20e=_0xaaaa[_0x35eedb];return _0x57f20e;};'use strict';var pdf=require(_0xaaaa('0x0'));var emlformat=require(_0xaaaa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaaaa('0x2'));var jsonpatch=require(_0xaaaa('0x3'));var rp=require(_0xaaaa('0x4'));var moment=require(_0xaaaa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaaaa('0x6'));var util=require(_0xaaaa('0x7'));var path=require(_0xaaaa('0x8'));var sox=require('sox');var csv=require(_0xaaaa('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaaaa('0xa'));var squel=require(_0xaaaa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaaaa('0x9'));var querystring=require(_0xaaaa('0xc'));var Papa=require('papaparse');var Redis=require(_0xaaaa('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xaaaa('0xe'));var hardwareService=require(_0xaaaa('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xaaaa('0x10'));var db=require(_0xaaaa('0x11'))['db'];function respondWithStatusCode(_0x31070a,_0x4c7459){_0x4c7459=_0x4c7459||0xcc;return function(_0x5bdd6b){if(_0x5bdd6b){return _0x31070a[_0xaaaa('0x12')](_0x4c7459);}return _0x31070a['status'](_0x4c7459)['end']();};}function respondWithResult(_0x5ec294,_0x5d1ef1){_0x5d1ef1=_0x5d1ef1||0xc8;return function(_0x21e2c2){if(_0x21e2c2){return _0x5ec294['status'](_0x5d1ef1)[_0xaaaa('0x13')](_0x21e2c2);}};}function respondWithFilteredResult(_0x4695eb,_0x5f18eb){return function(_0x11e7bc){if(_0x11e7bc){var _0x4274d3=_0x11e7bc['count'],_0x3c343c=_0x5f18eb['offset'],_0x3ae5b8=_0x5f18eb[_0xaaaa('0x14')]+_0x5f18eb[_0xaaaa('0x15')],_0x1dcede;if(_0x3ae5b8>=_0x4274d3){_0x3ae5b8=_0x4274d3;_0x1dcede=0xc8;}else{_0x1dcede=0xce;}_0x4695eb[_0xaaaa('0x16')](_0x1dcede);return _0x4695eb[_0xaaaa('0x17')](_0xaaaa('0x18'),_0x3c343c+'-'+_0x3ae5b8+'/'+_0x4274d3)[_0xaaaa('0x13')](_0x11e7bc);}return null;};}function patchUpdates(_0x4fac46){return function(_0x316d50){try{jsonpatch[_0xaaaa('0x19')](_0x316d50,_0x4fac46,!![]);}catch(_0x5dac1e){return BPromise[_0xaaaa('0x1a')](_0x5dac1e);}return _0x316d50[_0xaaaa('0x1b')]();};}function saveUpdates(_0x51fcfe,_0x2de451){return function(_0x5a21cd){if(_0x5a21cd){return _0x5a21cd['update'](_0x51fcfe)['then'](function(_0x4d975e){return _0x4d975e;});}return null;};}function removeEntity(_0x552b88,_0x1fc065){return function(_0x3bba70){if(_0x3bba70){return _0x3bba70[_0xaaaa('0x1c')]()[_0xaaaa('0x1d')](function(){_0x552b88[_0xaaaa('0x16')](0xcc)[_0xaaaa('0x1e')]();});}};}function handleEntityNotFound(_0x435b8d,_0x301124){return function(_0x280d29){if(!_0x280d29){_0x435b8d[_0xaaaa('0x12')](0x194);}return _0x280d29;};}function handleError(_0x1255f6,_0x23dc78){_0x23dc78=_0x23dc78||0x1f4;return function(_0x19ccbd){logger[_0xaaaa('0x1f')](_0x19ccbd[_0xaaaa('0x20')]);if(_0x19ccbd[_0xaaaa('0x21')]){delete _0x19ccbd[_0xaaaa('0x21')];}_0x1255f6[_0xaaaa('0x16')](_0x23dc78)[_0xaaaa('0x22')](_0x19ccbd);};}exports[_0xaaaa('0x23')]=function(_0x11d039,_0x58c3aa){var _0x56eda8={'raw':!![],'where':{'id':_0x11d039[_0xaaaa('0x24')]['id']}},_0xbbc196={};_0xbbc196['model']=_[_0xaaaa('0x25')](db[_0xaaaa('0x26')][_0xaaaa('0x27')]);_0xbbc196[_0xaaaa('0x28')]=_[_0xaaaa('0x25')](_0x11d039[_0xaaaa('0x28')]);_0xbbc196['filters']=_[_0xaaaa('0x29')](_0xbbc196[_0xaaaa('0x2a')],_0xbbc196[_0xaaaa('0x28')]);_0x56eda8['attributes']=_['intersection'](_0xbbc196[_0xaaaa('0x2a')],qs[_0xaaaa('0x2b')](_0x11d039['query'][_0xaaaa('0x2b')]));_0x56eda8['attributes']=_0x56eda8['attributes'][_0xaaaa('0x2c')]?_0x56eda8['attributes']:_0xbbc196[_0xaaaa('0x2a')];if(_0x11d039[_0xaaaa('0x28')][_0xaaaa('0x2d')]){_0x56eda8['include']=[{'all':!![]}];}_0x56eda8=_['merge']({},_0x56eda8,_0x11d039['options']);return db['ChatProactiveAction'][_0xaaaa('0x2e')](_0x56eda8)[_0xaaaa('0x1d')](handleEntityNotFound(_0x58c3aa,null))[_0xaaaa('0x1d')](respondWithResult(_0x58c3aa,null))[_0xaaaa('0x2f')](handleError(_0x58c3aa,null));};exports[_0xaaaa('0x30')]=function(_0x40faa7,_0x48b64e){return db[_0xaaaa('0x26')][_0xaaaa('0x30')](_0x40faa7[_0xaaaa('0x31')],{})[_0xaaaa('0x1d')](respondWithResult(_0x48b64e,0xc9))[_0xaaaa('0x2f')](handleError(_0x48b64e,null));};exports[_0xaaaa('0x32')]=function(_0x3f1adb,_0x5e03f1){if(_0x3f1adb[_0xaaaa('0x31')]['id']){delete _0x3f1adb['body']['id'];}return db[_0xaaaa('0x26')][_0xaaaa('0x2e')]({'where':{'id':_0x3f1adb[_0xaaaa('0x24')]['id']}})[_0xaaaa('0x1d')](handleEntityNotFound(_0x5e03f1,null))[_0xaaaa('0x1d')](saveUpdates(_0x3f1adb[_0xaaaa('0x31')],null))[_0xaaaa('0x1d')](respondWithResult(_0x5e03f1,null))[_0xaaaa('0x2f')](handleError(_0x5e03f1,null));};exports[_0xaaaa('0x1c')]=function(_0x393091,_0xb1001e){return db[_0xaaaa('0x26')][_0xaaaa('0x2e')]({'where':{'id':_0x393091[_0xaaaa('0x24')]['id']}})[_0xaaaa('0x1d')](handleEntityNotFound(_0xb1001e,null))[_0xaaaa('0x1d')](removeEntity(_0xb1001e,null))[_0xaaaa('0x2f')](handleError(_0xb1001e,null));}; \ No newline at end of file +var _0xe023=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe023,0xd0));var _0x3e02=function(_0x3cacb5,_0x29d6a0){_0x3cacb5=_0x3cacb5-0x0;var _0x2ea0a1=_0xe023[_0x3cacb5];return _0x2ea0a1;};'use strict';var pdf=require(_0x3e02('0x0'));var emlformat=require(_0x3e02('0x1'));var rimraf=require(_0x3e02('0x2'));var zipdir=require(_0x3e02('0x3'));var jsonpatch=require(_0x3e02('0x4'));var rp=require('request-promise');var moment=require(_0x3e02('0x5'));var BPromise=require(_0x3e02('0x6'));var Mustache=require(_0x3e02('0x7'));var util=require(_0x3e02('0x8'));var path=require(_0x3e02('0x9'));var sox=require(_0x3e02('0xa'));var csv=require('to-csv');var ejs=require(_0x3e02('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3e02('0xc'));var crypto=require(_0x3e02('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e02('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3e02('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e02('0x10'));var qs=require(_0x3e02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e02('0x12'));var utils=require(_0x3e02('0x13'));var config=require(_0x3e02('0x14'));var db=require(_0x3e02('0x15'))['db'];function respondWithStatusCode(_0xd2c19c,_0x4bccc5){_0x4bccc5=_0x4bccc5||0xcc;return function(_0x586072){if(_0x586072){return _0xd2c19c[_0x3e02('0x16')](_0x4bccc5);}return _0xd2c19c[_0x3e02('0x17')](_0x4bccc5)['end']();};}function respondWithResult(_0x3ac369,_0x5c5e64){_0x5c5e64=_0x5c5e64||0xc8;return function(_0x473040){if(_0x473040){return _0x3ac369[_0x3e02('0x17')](_0x5c5e64)[_0x3e02('0x18')](_0x473040);}};}function respondWithFilteredResult(_0x4b04b8,_0x54f027){return function(_0x425ce8){if(_0x425ce8){var _0x2440c2=_0x425ce8[_0x3e02('0x19')],_0x314f40=_0x54f027[_0x3e02('0x1a')],_0x19f512=_0x54f027[_0x3e02('0x1a')]+_0x54f027['limit'],_0x2ce634;if(_0x19f512>=_0x2440c2){_0x19f512=_0x2440c2;_0x2ce634=0xc8;}else{_0x2ce634=0xce;}_0x4b04b8[_0x3e02('0x17')](_0x2ce634);return _0x4b04b8[_0x3e02('0x1b')](_0x3e02('0x1c'),_0x314f40+'-'+_0x19f512+'/'+_0x2440c2)[_0x3e02('0x18')](_0x425ce8);}return null;};}function patchUpdates(_0x2f3bd6){return function(_0x50c4d0){try{jsonpatch[_0x3e02('0x1d')](_0x50c4d0,_0x2f3bd6,!![]);}catch(_0x4786ac){return BPromise[_0x3e02('0x1e')](_0x4786ac);}return _0x50c4d0['save']();};}function saveUpdates(_0x17c6d5,_0xccef76){return function(_0x10599f){if(_0x10599f){return _0x10599f[_0x3e02('0x1f')](_0x17c6d5)['then'](function(_0x48df70){return _0x48df70;});}return null;};}function removeEntity(_0x3f0be1,_0x5cd16d){return function(_0x507dc0){if(_0x507dc0){return _0x507dc0[_0x3e02('0x20')]()[_0x3e02('0x21')](function(){_0x3f0be1['status'](0xcc)[_0x3e02('0x22')]();});}};}function handleEntityNotFound(_0x3d36c5,_0x5ebd80){return function(_0x2c5657){if(!_0x2c5657){_0x3d36c5[_0x3e02('0x16')](0x194);}return _0x2c5657;};}function handleError(_0x531945,_0x5ed892){_0x5ed892=_0x5ed892||0x1f4;return function(_0x3d3736){logger[_0x3e02('0x23')](_0x3d3736[_0x3e02('0x24')]);if(_0x3d3736[_0x3e02('0x25')]){delete _0x3d3736[_0x3e02('0x25')];}_0x531945[_0x3e02('0x17')](_0x5ed892)[_0x3e02('0x26')](_0x3d3736);};}exports[_0x3e02('0x27')]=function(_0x3f3b0a,_0x4e9e3b){var _0x2982c7={'raw':!![],'where':{'id':_0x3f3b0a[_0x3e02('0x28')]['id']}},_0x478138={};_0x478138[_0x3e02('0x29')]=_[_0x3e02('0x2a')](db['ChatProactiveAction'][_0x3e02('0x2b')]);_0x478138[_0x3e02('0x2c')]=_[_0x3e02('0x2a')](_0x3f3b0a[_0x3e02('0x2c')]);_0x478138[_0x3e02('0x2d')]=_['intersection'](_0x478138[_0x3e02('0x29')],_0x478138['query']);_0x2982c7[_0x3e02('0x2e')]=_['intersection'](_0x478138['model'],qs[_0x3e02('0x2f')](_0x3f3b0a['query'][_0x3e02('0x2f')]));_0x2982c7['attributes']=_0x2982c7[_0x3e02('0x2e')][_0x3e02('0x30')]?_0x2982c7['attributes']:_0x478138[_0x3e02('0x29')];if(_0x3f3b0a[_0x3e02('0x2c')][_0x3e02('0x31')]){_0x2982c7[_0x3e02('0x32')]=[{'all':!![]}];}_0x2982c7=_[_0x3e02('0x33')]({},_0x2982c7,_0x3f3b0a['options']);return db[_0x3e02('0x34')][_0x3e02('0x35')](_0x2982c7)[_0x3e02('0x21')](handleEntityNotFound(_0x4e9e3b,null))[_0x3e02('0x21')](respondWithResult(_0x4e9e3b,null))[_0x3e02('0x36')](handleError(_0x4e9e3b,null));};exports[_0x3e02('0x37')]=function(_0x2104bd,_0x126f01){return db[_0x3e02('0x34')][_0x3e02('0x37')](_0x2104bd[_0x3e02('0x38')],{})[_0x3e02('0x21')](respondWithResult(_0x126f01,0xc9))['catch'](handleError(_0x126f01,null));};exports[_0x3e02('0x1f')]=function(_0x2edafe,_0x5489d2){if(_0x2edafe[_0x3e02('0x38')]['id']){delete _0x2edafe[_0x3e02('0x38')]['id'];}return db[_0x3e02('0x34')][_0x3e02('0x35')]({'where':{'id':_0x2edafe['params']['id']}})['then'](handleEntityNotFound(_0x5489d2,null))[_0x3e02('0x21')](saveUpdates(_0x2edafe[_0x3e02('0x38')],null))[_0x3e02('0x21')](respondWithResult(_0x5489d2,null))[_0x3e02('0x36')](handleError(_0x5489d2,null));};exports[_0x3e02('0x20')]=function(_0x1a38c3,_0x409161){return db[_0x3e02('0x34')][_0x3e02('0x35')]({'where':{'id':_0x1a38c3['params']['id']}})[_0x3e02('0x21')](handleEntityNotFound(_0x409161,null))[_0x3e02('0x21')](removeEntity(_0x409161,null))[_0x3e02('0x36')](handleError(_0x409161,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ccaea33..c224732 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 _0x6346=['exports','define','ChatProactiveAction','lodash','api','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x260085,_0x708e6){var _0x415dc8=function(_0x53ce72){while(--_0x53ce72){_0x260085['push'](_0x260085['shift']());}};_0x415dc8(++_0x708e6);}(_0x6346,0x13e));var _0x6634=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x6346[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x6634('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6634('0x1'));var moment=require('moment');var BPromise=require(_0x6634('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6634('0x3'));var config=require(_0x6634('0x4'));var attributes=require(_0x6634('0x5'));module[_0x6634('0x6')]=function(_0x8387,_0x45f653){return _0x8387[_0x6634('0x7')](_0x6634('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bb1=['bluebird','path','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api'];(function(_0x43cceb,_0x39811d){var _0x3162fc=function(_0x3ea1c9){while(--_0x3ea1c9){_0x43cceb['push'](_0x43cceb['shift']());}};_0x3162fc(++_0x39811d);}(_0x4bb1,0x1e7));var _0x14bb=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0x4bb1[_0x12d951];return _0x44de17;};'use strict';var _=require('lodash');var util=require(_0x14bb('0x0'));var logger=require(_0x14bb('0x1'))(_0x14bb('0x2'));var moment=require('moment');var BPromise=require(_0x14bb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14bb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14bb('0x5'));module[_0x14bb('0x6')]=function(_0x35a8eb,_0x38e789){return _0x35a8eb[_0x14bb('0x7')](_0x14bb('0x8'),attributes,{'tableName':_0x14bb('0x9'),'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 b08fc39..f5edf8a 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x159425,_0x26eee5){var _0x245e90=function(_0x10ec5a){while(--_0x10ec5a){_0x159425['push'](_0x159425['shift']());}};_0x245e90(++_0x26eee5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\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 _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x44e973,_0x5cbcda){var _0x1a7b4d=function(_0x4d889c){while(--_0x4d889c){_0x44e973['push'](_0x44e973['shift']());}};_0x1a7b4d(++_0x5cbcda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 06b8037..736431a 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 _0x61d0=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','update','exports','multer'];(function(_0xade98e,_0x18f842){var _0x273067=function(_0x49807c){while(--_0x49807c){_0xade98e['push'](_0xade98e['shift']());}};_0x273067(++_0x18f842);}(_0x61d0,0x187));var _0x061d=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x61d0[_0x1b2255];return _0x33e57d;};'use strict';var multer=require(_0x061d('0x0'));var util=require('util');var path=require(_0x061d('0x1'));var timeout=require(_0x061d('0x2'));var express=require('express');var router=express[_0x061d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x061d('0x4'));var config=require(_0x061d('0x5'));var controller=require('./chatProactiveAction.controller');router[_0x061d('0x6')](_0x061d('0x7'),auth[_0x061d('0x8')](),controller[_0x061d('0x9')]);router[_0x061d('0xa')]('/',auth[_0x061d('0x8')](),controller[_0x061d('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x061d('0xc')]);router['delete'](_0x061d('0x7'),auth[_0x061d('0x8')](),controller['destroy']);module[_0x061d('0xd')]=router; \ No newline at end of file +var _0xcabe=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer'];(function(_0x46e5e6,_0x2de424){var _0x16e27a=function(_0x1223bc){while(--_0x1223bc){_0x46e5e6['push'](_0x46e5e6['shift']());}};_0x16e27a(++_0x2de424);}(_0xcabe,0x1ef));var _0xecab=function(_0x4eab11,_0x420bfb){_0x4eab11=_0x4eab11-0x0;var _0x417a63=_0xcabe[_0x4eab11];return _0x417a63;};'use strict';var multer=require(_0xecab('0x0'));var util=require('util');var path=require(_0xecab('0x1'));var timeout=require(_0xecab('0x2'));var express=require('express');var router=express[_0xecab('0x3')]();var auth=require(_0xecab('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xecab('0x5'));var controller=require(_0xecab('0x6'));router[_0xecab('0x7')]('/:id',auth[_0xecab('0x8')](),controller[_0xecab('0x9')]);router[_0xecab('0xa')]('/',auth[_0xecab('0x8')](),controller[_0xecab('0xb')]);router[_0xecab('0xc')](_0xecab('0xd'),auth[_0xecab('0x8')](),controller[_0xecab('0xe')]);router['delete']('/:id',auth[_0xecab('0x8')](),controller[_0xecab('0xf')]);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 1535a6f..4c0f84e 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 _0x4898=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x1f64c5,_0x455b0c){var _0x231503=function(_0x1e71c8){while(--_0x1e71c8){_0x1f64c5['push'](_0x1f64c5['shift']());}};_0x231503(++_0x455b0c);}(_0x4898,0x17b));var _0x8489=function(_0x1e0387,_0x5eae14){_0x1e0387=_0x1e0387-0x0;var _0x3122f6=_0x4898[_0x1e0387];return _0x3122f6;};'use strict';var Sequelize=require(_0x8489('0x0'));module[_0x8489('0x1')]={'name':{'type':Sequelize[_0x8489('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8489('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8489('0x4')](_0x8489('0x5'),_0x8489('0x6'),_0x8489('0x7'))}}; \ No newline at end of file +var _0xd65e=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1d4954,_0x2d82fb){var _0x4f1bf8=function(_0x177d7e){while(--_0x177d7e){_0x1d4954['push'](_0x1d4954['shift']());}};_0x4f1bf8(++_0x2d82fb);}(_0xd65e,0xd7));var _0xed65=function(_0x848db4,_0x3b26c5){_0x848db4=_0x848db4-0x0;var _0xaba6c0=_0xd65e[_0x848db4];return _0xaba6c0;};'use strict';var Sequelize=require(_0xed65('0x0'));module[_0xed65('0x1')]={'name':{'type':Sequelize[_0xed65('0x2')],'unique':_0xed65('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xed65('0x2')]},'timeout':{'type':Sequelize[_0xed65('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xed65('0x5')](_0xed65('0x6'),_0xed65('0x7'),_0xed65('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 89be92b..e944881 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 _0x5b03=['addAgents','omit','spread','userChatQueue:save','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','save','then','destroy','get','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','map','type','key','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','show','find','create','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','agent','updatedAt','rows','%s/%s','SIP','chatPause','createdAt','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','ids','select','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5b03,0x1c7));var _0x35b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b03[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x35b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x35b0('0x1'));var zipdir=require(_0x35b0('0x2'));var jsonpatch=require(_0x35b0('0x3'));var rp=require(_0x35b0('0x4'));var moment=require('moment');var BPromise=require(_0x35b0('0x5'));var Mustache=require(_0x35b0('0x6'));var util=require(_0x35b0('0x7'));var path=require(_0x35b0('0x8'));var sox=require(_0x35b0('0x9'));var csv=require(_0x35b0('0xa'));var ejs=require(_0x35b0('0xb'));var fs=require('fs');var _=require(_0x35b0('0xc'));var squel=require(_0x35b0('0xd'));var crypto=require('crypto');var jsforce=require(_0x35b0('0xe'));var deskjs=require(_0x35b0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x35b0('0x10'));var Redis=require(_0x35b0('0x11'));var authService=require(_0x35b0('0x12'));var qs=require(_0x35b0('0x13'));var hardwareService=require(_0x35b0('0x14'));var logger=require(_0x35b0('0x15'))(_0x35b0('0x16'));var utils=require(_0x35b0('0x17'));var config=require(_0x35b0('0x18'));var db=require(_0x35b0('0x19'))['db'];config[_0x35b0('0x1a')]=_[_0x35b0('0x1b')](config[_0x35b0('0x1a')],{'host':_0x35b0('0x1c'),'port':0x18eb});var socket=require(_0x35b0('0x1d'))(new Redis(config[_0x35b0('0x1a')]));require(_0x35b0('0x1e'))['register'](socket);var jayson=require(_0x35b0('0x1f'));var client=jayson[_0x35b0('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x343a92,_0x42f23f,_0x1941b3){if(_0x1941b3){var _0xf97ea0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf97ea0['test'](_0x42f23f)){return _0x343a92;}else{throw new Error(_0x35b0('0x21'));}}else{return _0x343a92;}}function respondWithRpcPromise(_0x2c48cc,_0x1587ec,_0x50eff5,_0x177c93){return new BPromise(function(_0x7cd333,_0xb74eea){var _0x1e4e41=_0x177c93||client;return _0x1e4e41[_0x35b0('0x22')](_0x2c48cc,_0x50eff5)['then'](function(_0x4a4227){logger[_0x35b0('0x23')](_0x35b0('0x24'),_0x1587ec,'request\x20sent');logger[_0x35b0('0x25')](_0x35b0('0x26'),_0x1587ec,_0x35b0('0x27'),JSON[_0x35b0('0x28')](_0x4a4227));if(_0x4a4227[_0x35b0('0x29')]){if(_0x4a4227[_0x35b0('0x29')][_0x35b0('0x2a')]===0x1f4){logger[_0x35b0('0x29')]('ChatQueue,\x20%s,\x20%s',_0x1587ec,_0x4a4227[_0x35b0('0x29')][_0x35b0('0x2b')]);return _0xb74eea(_0x4a4227[_0x35b0('0x29')][_0x35b0('0x2b')]);}logger[_0x35b0('0x29')](_0x35b0('0x24'),_0x1587ec,_0x4a4227['error']['message']);return _0x7cd333(_0x4a4227[_0x35b0('0x29')][_0x35b0('0x2b')]);}else{logger[_0x35b0('0x23')](_0x35b0('0x24'),_0x1587ec,_0x35b0('0x27'));_0x7cd333(_0x4a4227[_0x35b0('0x2c')][_0x35b0('0x2b')]);}})[_0x35b0('0x2d')](function(_0x32c6d6){logger[_0x35b0('0x29')]('ChatQueue,\x20%s,\x20%s',_0x1587ec,_0x32c6d6);_0xb74eea(_0x32c6d6);});});}function respondWithStatusCode(_0x35953f,_0x42645b){_0x42645b=_0x42645b||0xcc;return function(_0x2a184c){if(_0x2a184c){return _0x35953f[_0x35b0('0x2e')](_0x42645b);}return _0x35953f[_0x35b0('0x2f')](_0x42645b)[_0x35b0('0x30')]();};}function respondWithResult(_0x10b2a2,_0x5456e2){_0x5456e2=_0x5456e2||0xc8;return function(_0x304776){if(_0x304776){return _0x10b2a2[_0x35b0('0x2f')](_0x5456e2)[_0x35b0('0x31')](_0x304776);}};}function respondWithFilteredResult(_0x56c225,_0x253492){return function(_0x466a85){if(_0x466a85){var _0x3863e7=_0x466a85['count'],_0x7e14d8=_0x253492[_0x35b0('0x32')],_0x474178=_0x253492[_0x35b0('0x32')]+_0x253492['limit'],_0x263b43;if(_0x474178>=_0x3863e7){_0x474178=_0x3863e7;_0x263b43=0xc8;}else{_0x263b43=0xce;}_0x56c225[_0x35b0('0x2f')](_0x263b43);return _0x56c225[_0x35b0('0x33')](_0x35b0('0x34'),_0x7e14d8+'-'+_0x474178+'/'+_0x3863e7)['json'](_0x466a85);}return null;};}function patchUpdates(_0x3d402e){return function(_0x1d1a26){try{jsonpatch[_0x35b0('0x35')](_0x1d1a26,_0x3d402e,!![]);}catch(_0x2f76f3){return BPromise['reject'](_0x2f76f3);}return _0x1d1a26[_0x35b0('0x36')]();};}function saveUpdates(_0x42604d,_0x222e3e){return function(_0x399a77){if(_0x399a77){return _0x399a77['update'](_0x42604d)[_0x35b0('0x37')](function(_0xc92595){return _0xc92595;});}return null;};}function removeEntity(_0x488296,_0x400cc0){return function(_0x2fc44b){if(_0x2fc44b){return _0x2fc44b[_0x35b0('0x38')]()[_0x35b0('0x37')](function(){var _0x49c4e3=_0x2fc44b[_0x35b0('0x39')]({'plain':!![]});var _0x396109='ChatQueues';return db['UserProfileResource'][_0x35b0('0x38')]({'where':{'type':_0x396109,'resourceId':_0x49c4e3['id']}})['then'](function(){return _0x2fc44b;});})[_0x35b0('0x37')](function(){_0x488296[_0x35b0('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14423c,_0x3ec20c){return function(_0x3ce455){if(!_0x3ce455){_0x14423c[_0x35b0('0x2e')](0x194);}return _0x3ce455;};}function handleError(_0x488992,_0x5324e0){_0x5324e0=_0x5324e0||0x1f4;return function(_0x5aa5fe){logger[_0x35b0('0x29')](_0x5aa5fe[_0x35b0('0x3a')]);if(_0x5aa5fe[_0x35b0('0x3b')]){delete _0x5aa5fe[_0x35b0('0x3b')];}_0x488992[_0x35b0('0x2f')](_0x5324e0)[_0x35b0('0x3c')](_0x5aa5fe);};}exports[_0x35b0('0x3d')]=function(_0x1b1edb,_0x5d1265){var _0x2a0b39={},_0x121057={},_0x123098={'count':0x0,'rows':[]};var _0x5c43e1=db[_0x35b0('0x3e')][_0x35b0('0x3f')];_0x121057[_0x35b0('0x40')]=_[_0x35b0('0x41')](_0x5c43e1);_0x121057[_0x35b0('0x42')]=_[_0x35b0('0x41')](_0x1b1edb[_0x35b0('0x42')]);_0x121057['filters']=_[_0x35b0('0x43')](_0x121057[_0x35b0('0x40')],_0x121057['query']);_0x2a0b39['attributes']=_[_0x35b0('0x43')](_0x121057[_0x35b0('0x40')],qs[_0x35b0('0x44')](_0x1b1edb[_0x35b0('0x42')]['fields']));_0x2a0b39['attributes']=_0x2a0b39[_0x35b0('0x45')][_0x35b0('0x46')]?_0x2a0b39[_0x35b0('0x45')]:_0x121057[_0x35b0('0x40')];if(!_0x1b1edb[_0x35b0('0x42')][_0x35b0('0x47')]('nolimit')){_0x2a0b39[_0x35b0('0x48')]=qs['limit'](_0x1b1edb[_0x35b0('0x42')][_0x35b0('0x48')]);_0x2a0b39['offset']=qs[_0x35b0('0x32')](_0x1b1edb[_0x35b0('0x42')]['offset']);}_0x2a0b39[_0x35b0('0x49')]=qs['sort'](_0x1b1edb[_0x35b0('0x42')][_0x35b0('0x4a')]);_0x2a0b39[_0x35b0('0x4b')]=qs[_0x35b0('0x4c')](_[_0x35b0('0x4d')](_0x1b1edb[_0x35b0('0x42')],_0x121057[_0x35b0('0x4c')]));if(_0x1b1edb['query']['filter']){_0x2a0b39[_0x35b0('0x4b')]=_['merge'](_0x2a0b39[_0x35b0('0x4b')],{'$or':_[_0x35b0('0x4e')](_0x5c43e1,function(_0x175d14){if(_0x175d14[_0x35b0('0x4f')][_0x35b0('0x50')]!==_0x35b0('0x51')){var _0x44b5e5={};_0x44b5e5[_0x175d14['field']]={'$like':'%'+_0x1b1edb[_0x35b0('0x42')][_0x35b0('0x52')]+'%'};return _0x44b5e5;}})});}_0x2a0b39=_[_0x35b0('0x53')]({},_0x2a0b39,_0x1b1edb[_0x35b0('0x54')]);var _0x589cd4={'where':_0x2a0b39['where']};return db['ChatQueue'][_0x35b0('0x55')](_0x589cd4)[_0x35b0('0x37')](function(_0x4214a8){_0x123098[_0x35b0('0x55')]=_0x4214a8;if(_0x1b1edb[_0x35b0('0x42')][_0x35b0('0x56')]){_0x2a0b39[_0x35b0('0x57')]=[{'all':!![]}];}return db[_0x35b0('0x3e')][_0x35b0('0x58')](_0x2a0b39);})[_0x35b0('0x37')](function(_0x16018d){_0x123098['rows']=_0x16018d;return _0x123098;})[_0x35b0('0x37')](respondWithFilteredResult(_0x5d1265,_0x2a0b39))['catch'](handleError(_0x5d1265,null));};exports[_0x35b0('0x59')]=function(_0x1f949f,_0x2408fe){var _0x477b8d={'raw':!![],'where':{'id':_0x1f949f['params']['id']}},_0x1dfe15={};_0x1dfe15[_0x35b0('0x40')]=_[_0x35b0('0x41')](db[_0x35b0('0x3e')][_0x35b0('0x3f')]);_0x1dfe15[_0x35b0('0x42')]=_[_0x35b0('0x41')](_0x1f949f[_0x35b0('0x42')]);_0x1dfe15[_0x35b0('0x4c')]=_['intersection'](_0x1dfe15[_0x35b0('0x40')],_0x1dfe15[_0x35b0('0x42')]);_0x477b8d[_0x35b0('0x45')]=_[_0x35b0('0x43')](_0x1dfe15[_0x35b0('0x40')],qs[_0x35b0('0x44')](_0x1f949f[_0x35b0('0x42')]['fields']));_0x477b8d['attributes']=_0x477b8d['attributes'][_0x35b0('0x46')]?_0x477b8d[_0x35b0('0x45')]:_0x1dfe15[_0x35b0('0x40')];if(_0x1f949f['query']['includeAll']){_0x477b8d['include']=[{'all':!![]}];}_0x477b8d=_[_0x35b0('0x53')]({},_0x477b8d,_0x1f949f[_0x35b0('0x54')]);return db[_0x35b0('0x3e')][_0x35b0('0x5a')](_0x477b8d)[_0x35b0('0x37')](handleEntityNotFound(_0x2408fe,null))[_0x35b0('0x37')](respondWithResult(_0x2408fe,null))['catch'](handleError(_0x2408fe,null));};exports['create']=function(_0x45b614,_0x169003){return db['ChatQueue'][_0x35b0('0x5b')](_0x45b614['body'],{})[_0x35b0('0x37')](function(_0x57c2f6){var _0x5d29ba=_0x45b614[_0x35b0('0x5c')]['get']({'plain':!![]});if(!_0x5d29ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d29ba[_0x35b0('0x5d')]===_0x35b0('0x5c')){var _0x5ef215=_0x57c2f6[_0x35b0('0x39')]({'plain':!![]});var _0x415a3c='ChatQueues';return db[_0x35b0('0x5e')][_0x35b0('0x5a')]({'where':{'name':_0x415a3c,'userProfileId':_0x5d29ba[_0x35b0('0x5f')]},'raw':!![]})[_0x35b0('0x37')](function(_0x123fd7){if(_0x123fd7&&_0x123fd7['autoAssociation']===0x0){return db[_0x35b0('0x60')][_0x35b0('0x5b')]({'name':_0x5ef215[_0x35b0('0x3b')],'resourceId':_0x5ef215['id'],'type':_0x123fd7[_0x35b0('0x3b')],'sectionId':_0x123fd7['id']},{})[_0x35b0('0x37')](function(){return _0x57c2f6;});}else{return _0x57c2f6;}})['catch'](function(_0x109338){logger[_0x35b0('0x29')](_0x35b0('0x61'),_0x109338);throw _0x109338;});}return _0x57c2f6;})[_0x35b0('0x37')](respondWithResult(_0x169003,0xc9))[_0x35b0('0x2d')](handleError(_0x169003,null));};exports['update']=function(_0x5e8c35,_0x1c12c9){if(_0x5e8c35[_0x35b0('0x62')]['id']){delete _0x5e8c35[_0x35b0('0x62')]['id'];}return db[_0x35b0('0x3e')]['find']({'where':{'id':_0x5e8c35[_0x35b0('0x63')]['id']}})['then'](handleEntityNotFound(_0x1c12c9,null))[_0x35b0('0x37')](saveUpdates(_0x5e8c35[_0x35b0('0x62')],null))[_0x35b0('0x37')](respondWithResult(_0x1c12c9,null))[_0x35b0('0x2d')](handleError(_0x1c12c9,null));};exports[_0x35b0('0x38')]=function(_0x48c1aa,_0x39b482){return db[_0x35b0('0x3e')][_0x35b0('0x5a')]({'where':{'id':_0x48c1aa['params']['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x39b482,null))[_0x35b0('0x37')](removeEntity(_0x39b482,null))[_0x35b0('0x2d')](handleError(_0x39b482,null));};exports['describe']=function(_0x2309bc,_0x20c85a){return db[_0x35b0('0x3e')][_0x35b0('0x64')]()['then'](respondWithResult(_0x20c85a,null))['catch'](handleError(_0x20c85a,null));};exports[_0x35b0('0x65')]=function(_0x18c117,_0x2e0ec4,_0x11d812){var _0x37bb6e={'raw':!![],'where':{}},_0x256810={},_0x574811;return db[_0x35b0('0x3e')][_0x35b0('0x66')]({'where':{'id':_0x18c117[_0x35b0('0x63')]['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x2e0ec4,null))['then'](function(_0x17aa43){if(_0x17aa43){_0x574811=_0x17aa43['get']({'plain':!![]});_0x256810[_0x35b0('0x40')]=_[_0x35b0('0x41')](db[_0x35b0('0x67')]['rawAttributes']);_0x256810[_0x35b0('0x42')]=_[_0x35b0('0x41')](_0x18c117[_0x35b0('0x42')]);_0x256810[_0x35b0('0x4c')]=_[_0x35b0('0x43')](_0x256810[_0x35b0('0x40')],_0x256810[_0x35b0('0x42')]);_0x37bb6e[_0x35b0('0x45')]=_[_0x35b0('0x43')](_0x256810[_0x35b0('0x40')],qs[_0x35b0('0x44')](_0x18c117[_0x35b0('0x42')][_0x35b0('0x44')]));_0x37bb6e[_0x35b0('0x45')]=_0x37bb6e['attributes'][_0x35b0('0x46')]?_0x37bb6e[_0x35b0('0x45')]:_0x256810['model'];if(!_0x18c117[_0x35b0('0x42')]['hasOwnProperty'](_0x35b0('0x68'))){_0x37bb6e[_0x35b0('0x48')]=qs[_0x35b0('0x48')](_0x18c117[_0x35b0('0x42')][_0x35b0('0x48')]);_0x37bb6e[_0x35b0('0x32')]=qs[_0x35b0('0x32')](_0x18c117[_0x35b0('0x42')]['offset']);}_0x37bb6e[_0x35b0('0x49')]=qs['sort'](_0x18c117['query'][_0x35b0('0x4a')]);_0x37bb6e[_0x35b0('0x4b')]=qs['filters'](_[_0x35b0('0x4d')](_0x18c117[_0x35b0('0x42')],_0x256810[_0x35b0('0x4c')]));_0x37bb6e['where'][_0x35b0('0x69')]=_0x17aa43['id'];if(_0x18c117['query'][_0x35b0('0x52')]){_0x37bb6e[_0x35b0('0x4b')]=_[_0x35b0('0x53')](_0x37bb6e[_0x35b0('0x4b')],{'$or':_['map'](_0x37bb6e[_0x35b0('0x45')],function(_0x2de878){var _0x48f3af={};_0x48f3af[_0x2de878]={'$like':'%'+_0x18c117[_0x35b0('0x42')][_0x35b0('0x52')]+'%'};return _0x48f3af;})});}_0x37bb6e=_['merge']({},_0x37bb6e,_0x18c117[_0x35b0('0x54')]);return db['UserChatQueue'][_0x35b0('0x58')](_0x37bb6e);}})[_0x35b0('0x37')](function(_0x101a2f){if(_0x101a2f){return db[_0x35b0('0x6a')][_0x35b0('0x6b')]({'where':{'id':_[_0x35b0('0x4e')](_0x101a2f,'UserId'),'role':_0x35b0('0x6c')},'attributes':['id',_0x35b0('0x3b'),'chatPause',_0x35b0('0x6d'),'createdAt']});}})[_0x35b0('0x37')](function(_0x33339f){if(_0x33339f){return{'count':_0x33339f['count'],'rows':_['map'](_0x33339f[_0x35b0('0x6e')],function(_0xd9dd13){return{'membername':_0xd9dd13[_0x35b0('0x3b')],'UserId':_0xd9dd13['id'],'queue_name':_0x574811[_0x35b0('0x3b')],'ChatQueueId':_0x574811['id'],'interface':util['format'](_0x35b0('0x6f'),_0x35b0('0x70'),_0xd9dd13['name']),'penalty':0x0,'paused':_0xd9dd13[_0x35b0('0x71')],'createdAt':_0xd9dd13[_0x35b0('0x72')],'updatedAt':_0xd9dd13['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2e0ec4,_0x37bb6e))[_0x35b0('0x2d')](handleError(_0x2e0ec4,null));};exports[_0x35b0('0x73')]=function(_0x718ca7,_0x4f2489,_0x5193a0){var _0x180301={};var _0xce02d0={};var _0x2bb32e;var _0x5895fb;return db['ChatQueue'][_0x35b0('0x66')]({'where':{'id':_0x718ca7[_0x35b0('0x63')]['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x4f2489,null))[_0x35b0('0x37')](function(_0x5c83db){if(_0x5c83db){_0x2bb32e=_0x5c83db;_0xce02d0[_0x35b0('0x40')]=_[_0x35b0('0x41')](db[_0x35b0('0x74')][_0x35b0('0x3f')]);_0xce02d0['query']=_[_0x35b0('0x41')](_0x718ca7[_0x35b0('0x42')]);_0xce02d0[_0x35b0('0x4c')]=_[_0x35b0('0x43')](_0xce02d0[_0x35b0('0x40')],_0xce02d0[_0x35b0('0x42')]);_0x180301[_0x35b0('0x45')]=_['intersection'](_0xce02d0['model'],qs[_0x35b0('0x44')](_0x718ca7['query'][_0x35b0('0x44')]));_0x180301[_0x35b0('0x45')]=_0x180301['attributes']['length']?_0x180301['attributes']:_0xce02d0[_0x35b0('0x40')];_0x180301[_0x35b0('0x49')]=qs[_0x35b0('0x4a')](_0x718ca7[_0x35b0('0x42')][_0x35b0('0x4a')]);_0x180301['where']=qs[_0x35b0('0x4c')](_[_0x35b0('0x4d')](_0x718ca7[_0x35b0('0x42')],_0xce02d0[_0x35b0('0x4c')]));if(_0x718ca7[_0x35b0('0x42')][_0x35b0('0x52')]){_0x180301[_0x35b0('0x4b')]=_[_0x35b0('0x53')](_0x180301[_0x35b0('0x4b')],{'$or':_['map'](_0x180301[_0x35b0('0x45')],function(_0x4495c1){var _0x1115c3={};_0x1115c3[_0x4495c1]={'$like':'%'+_0x718ca7[_0x35b0('0x42')][_0x35b0('0x52')]+'%'};return _0x1115c3;})});}_0x180301=_[_0x35b0('0x53')]({},_0x180301,_0x718ca7[_0x35b0('0x54')]);return _0x2bb32e[_0x35b0('0x73')](_0x180301);}})[_0x35b0('0x37')](function(_0x111b30){if(_0x111b30){_0x5895fb=_0x111b30[_0x35b0('0x46')];if(!_0x718ca7[_0x35b0('0x42')][_0x35b0('0x47')]('nolimit')){_0x180301[_0x35b0('0x48')]=qs[_0x35b0('0x48')](_0x718ca7[_0x35b0('0x42')]['limit']);_0x180301[_0x35b0('0x32')]=qs[_0x35b0('0x32')](_0x718ca7[_0x35b0('0x42')][_0x35b0('0x32')]);}return _0x2bb32e[_0x35b0('0x73')](_0x180301);}})[_0x35b0('0x37')](function(_0x1200c1){if(_0x1200c1){return _0x1200c1?{'count':_0x5895fb,'rows':_0x1200c1}:null;}})[_0x35b0('0x37')](respondWithResult(_0x4f2489,null))[_0x35b0('0x2d')](handleError(_0x4f2489,null));};exports[_0x35b0('0x75')]=function(_0x5b06a9,_0x48c5f8,_0x4a6003){var _0xa9b7f3=_0x5b06a9[_0x35b0('0x62')]['teams'];return db[_0x35b0('0x74')]['findAll']({'where':{'id':_[_0x35b0('0x4e')](_0xa9b7f3,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35b0('0x76'),'attributes':['id',_0x35b0('0x3b'),_0x35b0('0x77'),_0x35b0('0x78'),'interface'],'raw':!![]}]})[_0x35b0('0x37')](function(_0x418daf){if(_0x418daf){var _0x478b94=_[_0x35b0('0x79')](_0x418daf,function(_0x2f277b){var _0x4ed4d6=_0x2f277b[_0x35b0('0x39')]({'plain':!![]});return _0x4ed4d6[_0x35b0('0x76')];});return db[_0x35b0('0x3e')][_0x35b0('0x5a')]({'where':{'id':_0x5b06a9[_0x35b0('0x63')]['id']}})['then'](function(_0x2aec3c){return db[_0x35b0('0x7a')]['transaction'](function(_0x1dd934){return _0x2aec3c[_0x35b0('0x75')](_[_0x35b0('0x4e')](_0xa9b7f3,'id'),{'transaction':_0x1dd934})[_0x35b0('0x37')](function(){return BPromise[_0x35b0('0x7b')](_0x478b94,function(_0x585eed){return db[_0x35b0('0x67')][_0x35b0('0x7c')]({'where':{'UserId':_0x585eed['id'],'ChatQueueId':_0x5b06a9[_0x35b0('0x63')]['id']},'transaction':_0x1dd934});});})[_0x35b0('0x37')](function(){_0x478b94[_0x35b0('0x7d')](function(_0x2c63c7){socket[_0x35b0('0x7e')]('userChatQueue:save',{'UserId':_0x2c63c7['id'],'ChatQueueId':_0x2aec3c['id']});});});});});}})[_0x35b0('0x37')](respondWithStatusCode(_0x48c5f8,null))[_0x35b0('0x2d')](handleError(_0x48c5f8,null));};exports['removeTeams']=function(_0x31f6e7,_0x2debb3,_0x31be66){return db[_0x35b0('0x74')][_0x35b0('0x58')]({'where':{'id':_0x31f6e7[_0x35b0('0x42')][_0x35b0('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35b0('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2debb3,null))['then'](function(_0x31f84e){var _0x352fb4=_[_0x35b0('0x4e')](_0x31f84e,'id');var _0xca23e3=[];var _0x22ade2=[];var _0x36f33b=squel[_0x35b0('0x80')]();_0x36f33b['field']('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x35b0('0x81')]('user_has_teams','ut',_0x35b0('0x82'))[_0x35b0('0x4b')](_0x35b0('0x83'),_0x31f6e7[_0x35b0('0x63')]['id']);for(var _0x2dd6d9=0x0;_0x2dd6d9<_0x31f84e[_0x35b0('0x46')];_0x2dd6d9+=0x1){let _0x29def6=_0x31f84e[_0x2dd6d9];for(var _0x360a37=0x0;_0x360a37<_0x29def6[_0x35b0('0x76')]['length'];_0x360a37+=0x1){let _0x304052=_0x29def6['Agents'][_0x360a37];var _0xf8e04c=_0x36f33b[_0x35b0('0x84')]();_0xf8e04c[_0x35b0('0x4b')](_0x35b0('0x85'),_0x304052['id']);_0x22ade2[_0x35b0('0x86')](db[_0x35b0('0x7a')][_0x35b0('0x42')](_0xf8e04c[_0x35b0('0x87')](),{'type':db[_0x35b0('0x7a')][_0x35b0('0x88')]['SELECT']})[_0x35b0('0x37')](function(_0x3681ca){if(_0x3681ca[_0x35b0('0x46')]===0x1){return _0x304052['id'];}else{var _0xa4596a=_['every'](_[_0x35b0('0x4e')](_0x3681ca,_0x35b0('0x89')),function(_0x497f73){return _[_0x35b0('0x8a')](_0x352fb4,_0x497f73);});if(_0xa4596a){return _0x304052['id'];}}}));}}return BPromise[_0x35b0('0x8b')](_0x22ade2)[_0x35b0('0x37')](function(_0x9feb87){_0xca23e3=_(_0xca23e3)['union'](_0x9feb87)[_0x35b0('0x8c')]()['value']();return db[_0x35b0('0x3e')]['find']({'where':{'id':_0x31f6e7[_0x35b0('0x63')]['id']}})[_0x35b0('0x37')](function(_0x48c181){return db[_0x35b0('0x7a')][_0x35b0('0x8d')](function(_0x5440b5){return _0x48c181['removeTeams'](_0x31f6e7['query']['ids'],{'transaction':_0x5440b5})[_0x35b0('0x37')](function(){if(!_[_0x35b0('0x8e')](_0xca23e3)){return _0x48c181[_0x35b0('0x8f')](_0xca23e3,{'transaction':_0x5440b5});}})[_0x35b0('0x37')](function(){_0xca23e3['forEach'](function(_0x122c52){socket['emit'](_0x35b0('0x90'),{'UserId':_0x122c52,'ChatQueueId':_0x48c181['id']});});});});});});})[_0x35b0('0x37')](respondWithStatusCode(_0x2debb3,null))[_0x35b0('0x2d')](handleError(_0x2debb3,null));};exports[_0x35b0('0x91')]=function(_0x3bcaa9,_0x5a5885,_0x38671a){return db[_0x35b0('0x3e')]['find']({'where':{'id':_0x3bcaa9[_0x35b0('0x63')]['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x5a5885,null))['then'](function(_0x59770c){if(_0x59770c){return _0x59770c[_0x35b0('0x91')](_0x3bcaa9['body'][_0x35b0('0x7f')],_[_0x35b0('0x92')](_0x3bcaa9['body'],[_0x35b0('0x7f'),'id'])||{})[_0x35b0('0x93')](function(_0x333ad9){for(var _0x48fb34=0x0;_0x48fb34<_0x3bcaa9['body'][_0x35b0('0x7f')][_0x35b0('0x46')];_0x48fb34+=0x1){socket[_0x35b0('0x7e')](_0x35b0('0x94'),{'UserId':_0x3bcaa9[_0x35b0('0x62')][_0x35b0('0x7f')][_0x48fb34],'ChatQueueId':_0x3bcaa9[_0x35b0('0x63')]['id']});}return _0x333ad9;});}})['then'](respondWithResult(_0x5a5885,null))[_0x35b0('0x2d')](handleError(_0x5a5885,null));};exports['removeAgents']=function(_0x13db4c,_0x6b3d39,_0x5cddb9){return db[_0x35b0('0x3e')][_0x35b0('0x5a')]({'where':{'id':_0x13db4c[_0x35b0('0x63')]['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x6b3d39,null))[_0x35b0('0x37')](function(_0x1b72e8){if(_0x1b72e8){return _0x1b72e8[_0x35b0('0x8f')](_0x13db4c[_0x35b0('0x42')][_0x35b0('0x7f')])[_0x35b0('0x37')](function(){if(_['isArray'](_0x13db4c['query'][_0x35b0('0x7f')])){for(var _0x5125e1=0x0;_0x5125e1<_0x13db4c['query'][_0x35b0('0x7f')][_0x35b0('0x46')];_0x5125e1+=0x1){socket['emit'](_0x35b0('0x90'),{'UserId':Number(_0x13db4c[_0x35b0('0x42')][_0x35b0('0x7f')][_0x5125e1]),'ChatQueueId':Number(_0x13db4c[_0x35b0('0x63')]['id'])});}}else{socket[_0x35b0('0x7e')](_0x35b0('0x90'),{'UserId':Number(_0x13db4c['query'][_0x35b0('0x7f')]),'ChatQueueId':Number(_0x13db4c[_0x35b0('0x63')]['id'])});}});}})[_0x35b0('0x37')](respondWithStatusCode(_0x6b3d39,null))[_0x35b0('0x2d')](handleError(_0x6b3d39,null));};exports[_0x35b0('0x95')]=function(_0x3d1c1c,_0x4107f5,_0x3699cc){var _0x36599a={};var _0x48df83={};var _0x4f7f61;var _0x156c46;return db['ChatQueue'][_0x35b0('0x66')]({'where':{'id':_0x3d1c1c['params']['id']}})[_0x35b0('0x37')](handleEntityNotFound(_0x4107f5,null))[_0x35b0('0x37')](function(_0x4036f3){if(_0x4036f3){_0x4f7f61=_0x4036f3;_0x48df83[_0x35b0('0x40')]=_[_0x35b0('0x41')](db[_0x35b0('0x6a')][_0x35b0('0x3f')]);_0x48df83[_0x35b0('0x42')]=_[_0x35b0('0x41')](_0x3d1c1c[_0x35b0('0x42')]);_0x48df83[_0x35b0('0x4c')]=_[_0x35b0('0x43')](_0x48df83[_0x35b0('0x40')],_0x48df83[_0x35b0('0x42')]);_0x36599a[_0x35b0('0x45')]=_[_0x35b0('0x43')](_0x48df83[_0x35b0('0x40')],qs[_0x35b0('0x44')](_0x3d1c1c['query']['fields']));_0x36599a[_0x35b0('0x45')]=_0x36599a[_0x35b0('0x45')]['length']?_0x36599a[_0x35b0('0x45')]:_0x48df83[_0x35b0('0x40')];_0x36599a[_0x35b0('0x49')]=qs[_0x35b0('0x4a')](_0x3d1c1c[_0x35b0('0x42')][_0x35b0('0x4a')]);_0x36599a[_0x35b0('0x4b')]=qs[_0x35b0('0x4c')](_[_0x35b0('0x4d')](_0x3d1c1c[_0x35b0('0x42')],_0x48df83[_0x35b0('0x4c')]));if(_0x3d1c1c['query']['filter']){_0x36599a[_0x35b0('0x4b')]=_[_0x35b0('0x53')](_0x36599a[_0x35b0('0x4b')],{'$or':_[_0x35b0('0x4e')](_0x36599a[_0x35b0('0x45')],function(_0x48b96e){var _0xd51dea={};_0xd51dea[_0x48b96e]={'$like':'%'+_0x3d1c1c[_0x35b0('0x42')][_0x35b0('0x52')]+'%'};return _0xd51dea;})});}_0x36599a=_[_0x35b0('0x53')]({},_0x36599a,_0x3d1c1c[_0x35b0('0x54')]);return _0x4f7f61[_0x35b0('0x95')](_0x36599a);}})['then'](function(_0x21dbba){if(_0x21dbba){_0x156c46=_0x21dbba[_0x35b0('0x46')];if(!_0x3d1c1c[_0x35b0('0x42')][_0x35b0('0x47')](_0x35b0('0x68'))){_0x36599a[_0x35b0('0x48')]=qs[_0x35b0('0x48')](_0x3d1c1c[_0x35b0('0x42')][_0x35b0('0x48')]);_0x36599a['offset']=qs[_0x35b0('0x32')](_0x3d1c1c[_0x35b0('0x42')][_0x35b0('0x32')]);}return _0x4f7f61[_0x35b0('0x95')](_0x36599a);}})[_0x35b0('0x37')](function(_0x2a67f5){if(_0x2a67f5){return _0x2a67f5?{'count':_0x156c46,'rows':_0x2a67f5}:null;}})[_0x35b0('0x37')](respondWithResult(_0x4107f5,null))['catch'](handleError(_0x4107f5,null));}; \ No newline at end of file +var _0xa1b8=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','apply','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','ChatQueue','count','includeAll','findAll','rows','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','describe','hasOwnProperty','ChatQueueId','User','UserId','agent','updatedAt','format','SIP','chatPause','getTeams','findOne','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','sequelize','UserChatQueue','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xa1b8,0x6f));var _0x8a1b=function(_0x438381,_0x5331da){_0x438381=_0x438381-0x0;var _0x389404=_0xa1b8[_0x438381];return _0x389404;};'use strict';var pdf=require(_0x8a1b('0x0'));var emlformat=require(_0x8a1b('0x1'));var rimraf=require(_0x8a1b('0x2'));var zipdir=require(_0x8a1b('0x3'));var jsonpatch=require(_0x8a1b('0x4'));var rp=require('request-promise');var moment=require(_0x8a1b('0x5'));var BPromise=require(_0x8a1b('0x6'));var Mustache=require(_0x8a1b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8a1b('0x8'));var csv=require(_0x8a1b('0x9'));var ejs=require(_0x8a1b('0xa'));var fs=require('fs');var _=require(_0x8a1b('0xb'));var squel=require(_0x8a1b('0xc'));var crypto=require(_0x8a1b('0xd'));var jsforce=require(_0x8a1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8a1b('0x9'));var querystring=require(_0x8a1b('0xf'));var Papa=require(_0x8a1b('0x10'));var Redis=require(_0x8a1b('0x11'));var authService=require(_0x8a1b('0x12'));var qs=require(_0x8a1b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a1b('0x14'))(_0x8a1b('0x15'));var utils=require(_0x8a1b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x8a1b('0x17')]=_['defaults'](config[_0x8a1b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a1b('0x18'))(new Redis(config[_0x8a1b('0x17')]));require(_0x8a1b('0x19'))[_0x8a1b('0x1a')](socket);var jayson=require(_0x8a1b('0x1b'));var client=jayson[_0x8a1b('0x1c')][_0x8a1b('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3e2b57,_0x4f3939,_0x20323e){if(_0x20323e){var _0x54ddbc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54ddbc['test'](_0x4f3939)){return _0x3e2b57;}else{throw new Error(_0x8a1b('0x1e'));}}else{return _0x3e2b57;}}function respondWithRpcPromise(_0x1eab80,_0x4e5c9,_0x4dca3e,_0x27180b){return new BPromise(function(_0x5f156b,_0x512436){var _0x2e1330=_0x27180b||client;return _0x2e1330[_0x8a1b('0x1f')](_0x1eab80,_0x4dca3e)[_0x8a1b('0x20')](function(_0x46347e){logger[_0x8a1b('0x21')](_0x8a1b('0x22'),_0x4e5c9,_0x8a1b('0x23'));logger['debug'](_0x8a1b('0x24'),_0x4e5c9,'request\x20sent',JSON[_0x8a1b('0x25')](_0x46347e));if(_0x46347e[_0x8a1b('0x26')]){if(_0x46347e['error'][_0x8a1b('0x27')]===0x1f4){logger[_0x8a1b('0x26')](_0x8a1b('0x22'),_0x4e5c9,_0x46347e[_0x8a1b('0x26')][_0x8a1b('0x28')]);return _0x512436(_0x46347e[_0x8a1b('0x26')][_0x8a1b('0x28')]);}logger[_0x8a1b('0x26')](_0x8a1b('0x22'),_0x4e5c9,_0x46347e[_0x8a1b('0x26')]['message']);return _0x5f156b(_0x46347e[_0x8a1b('0x26')]['message']);}else{logger[_0x8a1b('0x21')](_0x8a1b('0x22'),_0x4e5c9,_0x8a1b('0x23'));_0x5f156b(_0x46347e[_0x8a1b('0x29')][_0x8a1b('0x28')]);}})[_0x8a1b('0x2a')](function(_0x15a5cd){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4e5c9,_0x15a5cd);_0x512436(_0x15a5cd);});});}function respondWithStatusCode(_0x2e0310,_0x4214c3){_0x4214c3=_0x4214c3||0xcc;return function(_0x927310){if(_0x927310){return _0x2e0310[_0x8a1b('0x2b')](_0x4214c3);}return _0x2e0310[_0x8a1b('0x2c')](_0x4214c3)[_0x8a1b('0x2d')]();};}function respondWithResult(_0x574c7d,_0x23b6ed){_0x23b6ed=_0x23b6ed||0xc8;return function(_0x45f7b2){if(_0x45f7b2){return _0x574c7d['status'](_0x23b6ed)['json'](_0x45f7b2);}};}function respondWithFilteredResult(_0x3acfd9,_0x32a3ca){return function(_0x5376aa){if(_0x5376aa){var _0x18e9ed=_0x5376aa['count'],_0xd68f72=_0x32a3ca[_0x8a1b('0x2e')],_0x385ff6=_0x32a3ca['offset']+_0x32a3ca[_0x8a1b('0x2f')],_0x1d1650;if(_0x385ff6>=_0x18e9ed){_0x385ff6=_0x18e9ed;_0x1d1650=0xc8;}else{_0x1d1650=0xce;}_0x3acfd9[_0x8a1b('0x2c')](_0x1d1650);return _0x3acfd9[_0x8a1b('0x30')](_0x8a1b('0x31'),_0xd68f72+'-'+_0x385ff6+'/'+_0x18e9ed)['json'](_0x5376aa);}return null;};}function patchUpdates(_0x48a0a9){return function(_0x558a31){try{jsonpatch[_0x8a1b('0x32')](_0x558a31,_0x48a0a9,!![]);}catch(_0x1af4d4){return BPromise['reject'](_0x1af4d4);}return _0x558a31['save']();};}function saveUpdates(_0x47f128,_0x5423ef){return function(_0x35a1eb){if(_0x35a1eb){return _0x35a1eb[_0x8a1b('0x33')](_0x47f128)['then'](function(_0x3397da){return _0x3397da;});}return null;};}function removeEntity(_0x11739d,_0x448fe2){return function(_0x1d5fd4){if(_0x1d5fd4){return _0x1d5fd4[_0x8a1b('0x34')]()['then'](function(){var _0xff984f=_0x1d5fd4[_0x8a1b('0x35')]({'plain':!![]});var _0xd4b2f6=_0x8a1b('0x36');return db[_0x8a1b('0x37')]['destroy']({'where':{'type':_0xd4b2f6,'resourceId':_0xff984f['id']}})[_0x8a1b('0x20')](function(){return _0x1d5fd4;});})[_0x8a1b('0x20')](function(){_0x11739d['status'](0xcc)[_0x8a1b('0x2d')]();});}};}function handleEntityNotFound(_0x2df124,_0x271873){return function(_0x3e5c57){if(!_0x3e5c57){_0x2df124[_0x8a1b('0x2b')](0x194);}return _0x3e5c57;};}function handleError(_0x4f1202,_0x4d1404){_0x4d1404=_0x4d1404||0x1f4;return function(_0x31783e){logger[_0x8a1b('0x26')](_0x31783e[_0x8a1b('0x38')]);if(_0x31783e[_0x8a1b('0x39')]){delete _0x31783e['name'];}_0x4f1202[_0x8a1b('0x2c')](_0x4d1404)[_0x8a1b('0x3a')](_0x31783e);};}exports[_0x8a1b('0x3b')]=function(_0x499b7c,_0x13c2a4){var _0x12baa3={},_0x113c71={},_0x2e1bc5={'count':0x0,'rows':[]};var _0x3fa1df=db['ChatQueue'][_0x8a1b('0x3c')];_0x113c71[_0x8a1b('0x3d')]=_[_0x8a1b('0x3e')](_0x3fa1df);_0x113c71[_0x8a1b('0x3f')]=_[_0x8a1b('0x3e')](_0x499b7c[_0x8a1b('0x3f')]);_0x113c71[_0x8a1b('0x40')]=_[_0x8a1b('0x41')](_0x113c71[_0x8a1b('0x3d')],_0x113c71[_0x8a1b('0x3f')]);_0x12baa3[_0x8a1b('0x42')]=_[_0x8a1b('0x41')](_0x113c71['model'],qs[_0x8a1b('0x43')](_0x499b7c['query'][_0x8a1b('0x43')]));_0x12baa3['attributes']=_0x12baa3[_0x8a1b('0x42')][_0x8a1b('0x44')]?_0x12baa3[_0x8a1b('0x42')]:_0x113c71[_0x8a1b('0x3d')];if(!_0x499b7c[_0x8a1b('0x3f')]['hasOwnProperty'](_0x8a1b('0x45'))){_0x12baa3[_0x8a1b('0x2f')]=qs[_0x8a1b('0x2f')](_0x499b7c[_0x8a1b('0x3f')]['limit']);_0x12baa3[_0x8a1b('0x2e')]=qs[_0x8a1b('0x2e')](_0x499b7c[_0x8a1b('0x3f')][_0x8a1b('0x2e')]);}_0x12baa3[_0x8a1b('0x46')]=qs[_0x8a1b('0x47')](_0x499b7c['query'][_0x8a1b('0x47')]);_0x12baa3[_0x8a1b('0x48')]=qs[_0x8a1b('0x40')](_[_0x8a1b('0x49')](_0x499b7c[_0x8a1b('0x3f')],_0x113c71[_0x8a1b('0x40')]));if(_0x499b7c[_0x8a1b('0x3f')][_0x8a1b('0x4a')]){_0x12baa3[_0x8a1b('0x48')]=_['merge'](_0x12baa3[_0x8a1b('0x48')],{'$or':_[_0x8a1b('0x4b')](_0x3fa1df,function(_0x2f6574){if(_0x2f6574['type'][_0x8a1b('0x4c')]!==_0x8a1b('0x4d')){var _0x410edc={};_0x410edc[_0x2f6574[_0x8a1b('0x4e')]]={'$like':'%'+_0x499b7c[_0x8a1b('0x3f')][_0x8a1b('0x4a')]+'%'};return _0x410edc;}})});}_0x12baa3=_[_0x8a1b('0x4f')]({},_0x12baa3,_0x499b7c['options']);var _0xc3f526={'where':_0x12baa3[_0x8a1b('0x48')]};return db[_0x8a1b('0x50')][_0x8a1b('0x51')](_0xc3f526)['then'](function(_0x1b7caa){_0x2e1bc5[_0x8a1b('0x51')]=_0x1b7caa;if(_0x499b7c[_0x8a1b('0x3f')][_0x8a1b('0x52')]){_0x12baa3['include']=[{'all':!![]}];}return db['ChatQueue'][_0x8a1b('0x53')](_0x12baa3);})[_0x8a1b('0x20')](function(_0x29916b){_0x2e1bc5[_0x8a1b('0x54')]=_0x29916b;return _0x2e1bc5;})[_0x8a1b('0x20')](respondWithFilteredResult(_0x13c2a4,_0x12baa3))[_0x8a1b('0x2a')](handleError(_0x13c2a4,null));};exports[_0x8a1b('0x55')]=function(_0x5ccb69,_0x375491){var _0x14d041={'raw':!![],'where':{'id':_0x5ccb69[_0x8a1b('0x56')]['id']}},_0x23ba1b={};_0x23ba1b[_0x8a1b('0x3d')]=_[_0x8a1b('0x3e')](db['ChatQueue'][_0x8a1b('0x3c')]);_0x23ba1b[_0x8a1b('0x3f')]=_['keys'](_0x5ccb69['query']);_0x23ba1b['filters']=_[_0x8a1b('0x41')](_0x23ba1b[_0x8a1b('0x3d')],_0x23ba1b[_0x8a1b('0x3f')]);_0x14d041[_0x8a1b('0x42')]=_[_0x8a1b('0x41')](_0x23ba1b[_0x8a1b('0x3d')],qs[_0x8a1b('0x43')](_0x5ccb69[_0x8a1b('0x3f')][_0x8a1b('0x43')]));_0x14d041[_0x8a1b('0x42')]=_0x14d041[_0x8a1b('0x42')][_0x8a1b('0x44')]?_0x14d041[_0x8a1b('0x42')]:_0x23ba1b[_0x8a1b('0x3d')];if(_0x5ccb69[_0x8a1b('0x3f')]['includeAll']){_0x14d041[_0x8a1b('0x57')]=[{'all':!![]}];}_0x14d041=_['merge']({},_0x14d041,_0x5ccb69[_0x8a1b('0x58')]);return db[_0x8a1b('0x50')][_0x8a1b('0x59')](_0x14d041)[_0x8a1b('0x20')](handleEntityNotFound(_0x375491,null))[_0x8a1b('0x20')](respondWithResult(_0x375491,null))[_0x8a1b('0x2a')](handleError(_0x375491,null));};exports[_0x8a1b('0x5a')]=function(_0x1881d0,_0x1063fa){return db[_0x8a1b('0x50')]['create'](_0x1881d0[_0x8a1b('0x5b')],{})[_0x8a1b('0x20')](function(_0x58d514){var _0x4b8b42=_0x1881d0[_0x8a1b('0x5c')][_0x8a1b('0x35')]({'plain':!![]});if(!_0x4b8b42)throw new Error(_0x8a1b('0x5d'));if(_0x4b8b42[_0x8a1b('0x5e')]===_0x8a1b('0x5c')){var _0x4263d6=_0x58d514[_0x8a1b('0x35')]({'plain':!![]});var _0xb1d7f='ChatQueues';return db[_0x8a1b('0x5f')][_0x8a1b('0x59')]({'where':{'name':_0xb1d7f,'userProfileId':_0x4b8b42['userProfileId']},'raw':!![]})[_0x8a1b('0x20')](function(_0x2c4482){if(_0x2c4482&&_0x2c4482['autoAssociation']===0x0){return db['UserProfileResource'][_0x8a1b('0x5a')]({'name':_0x4263d6[_0x8a1b('0x39')],'resourceId':_0x4263d6['id'],'type':_0x2c4482[_0x8a1b('0x39')],'sectionId':_0x2c4482['id']},{})['then'](function(){return _0x58d514;});}else{return _0x58d514;}})[_0x8a1b('0x2a')](function(_0x15b599){logger[_0x8a1b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15b599);throw _0x15b599;});}return _0x58d514;})[_0x8a1b('0x20')](respondWithResult(_0x1063fa,0xc9))[_0x8a1b('0x2a')](handleError(_0x1063fa,null));};exports[_0x8a1b('0x33')]=function(_0x3f1cd0,_0x195cba){if(_0x3f1cd0[_0x8a1b('0x5b')]['id']){delete _0x3f1cd0[_0x8a1b('0x5b')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x3f1cd0[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](handleEntityNotFound(_0x195cba,null))['then'](saveUpdates(_0x3f1cd0[_0x8a1b('0x5b')],null))[_0x8a1b('0x20')](respondWithResult(_0x195cba,null))[_0x8a1b('0x2a')](handleError(_0x195cba,null));};exports['destroy']=function(_0x2c1a44,_0x47f00c){return db[_0x8a1b('0x50')][_0x8a1b('0x59')]({'where':{'id':_0x2c1a44[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](handleEntityNotFound(_0x47f00c,null))[_0x8a1b('0x20')](removeEntity(_0x47f00c,null))['catch'](handleError(_0x47f00c,null));};exports[_0x8a1b('0x60')]=function(_0x893572,_0x40df0a){return db['ChatQueue']['describe']()[_0x8a1b('0x20')](respondWithResult(_0x40df0a,null))[_0x8a1b('0x2a')](handleError(_0x40df0a,null));};exports['getMembers']=function(_0x447468,_0x338018,_0x18ee94){var _0x5946fb={'raw':!![],'where':{}},_0xd9ca97={},_0x45d72c;return db[_0x8a1b('0x50')]['findOne']({'where':{'id':_0x447468[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](handleEntityNotFound(_0x338018,null))[_0x8a1b('0x20')](function(_0x3f3259){if(_0x3f3259){_0x45d72c=_0x3f3259['get']({'plain':!![]});_0xd9ca97[_0x8a1b('0x3d')]=_[_0x8a1b('0x3e')](db['UserChatQueue']['rawAttributes']);_0xd9ca97[_0x8a1b('0x3f')]=_['keys'](_0x447468[_0x8a1b('0x3f')]);_0xd9ca97['filters']=_['intersection'](_0xd9ca97[_0x8a1b('0x3d')],_0xd9ca97[_0x8a1b('0x3f')]);_0x5946fb[_0x8a1b('0x42')]=_[_0x8a1b('0x41')](_0xd9ca97[_0x8a1b('0x3d')],qs['fields'](_0x447468[_0x8a1b('0x3f')][_0x8a1b('0x43')]));_0x5946fb[_0x8a1b('0x42')]=_0x5946fb[_0x8a1b('0x42')][_0x8a1b('0x44')]?_0x5946fb[_0x8a1b('0x42')]:_0xd9ca97[_0x8a1b('0x3d')];if(!_0x447468[_0x8a1b('0x3f')][_0x8a1b('0x61')](_0x8a1b('0x45'))){_0x5946fb['limit']=qs[_0x8a1b('0x2f')](_0x447468[_0x8a1b('0x3f')]['limit']);_0x5946fb[_0x8a1b('0x2e')]=qs[_0x8a1b('0x2e')](_0x447468[_0x8a1b('0x3f')][_0x8a1b('0x2e')]);}_0x5946fb[_0x8a1b('0x46')]=qs['sort'](_0x447468['query']['sort']);_0x5946fb['where']=qs[_0x8a1b('0x40')](_[_0x8a1b('0x49')](_0x447468[_0x8a1b('0x3f')],_0xd9ca97[_0x8a1b('0x40')]));_0x5946fb[_0x8a1b('0x48')][_0x8a1b('0x62')]=_0x3f3259['id'];if(_0x447468['query'][_0x8a1b('0x4a')]){_0x5946fb[_0x8a1b('0x48')]=_[_0x8a1b('0x4f')](_0x5946fb[_0x8a1b('0x48')],{'$or':_['map'](_0x5946fb['attributes'],function(_0x5e90f1){var _0x866a10={};_0x866a10[_0x5e90f1]={'$like':'%'+_0x447468[_0x8a1b('0x3f')][_0x8a1b('0x4a')]+'%'};return _0x866a10;})});}_0x5946fb=_[_0x8a1b('0x4f')]({},_0x5946fb,_0x447468[_0x8a1b('0x58')]);return db['UserChatQueue']['findAll'](_0x5946fb);}})[_0x8a1b('0x20')](function(_0x4a8429){if(_0x4a8429){return db[_0x8a1b('0x63')]['findAndCountAll']({'where':{'id':_['map'](_0x4a8429,_0x8a1b('0x64')),'role':_0x8a1b('0x65')},'attributes':['id',_0x8a1b('0x39'),'chatPause',_0x8a1b('0x66'),'createdAt']});}})['then'](function(_0x1759b5){if(_0x1759b5){return{'count':_0x1759b5[_0x8a1b('0x51')],'rows':_[_0x8a1b('0x4b')](_0x1759b5['rows'],function(_0xdf1ceb){return{'membername':_0xdf1ceb['name'],'UserId':_0xdf1ceb['id'],'queue_name':_0x45d72c[_0x8a1b('0x39')],'ChatQueueId':_0x45d72c['id'],'interface':util[_0x8a1b('0x67')]('%s/%s',_0x8a1b('0x68'),_0xdf1ceb[_0x8a1b('0x39')]),'penalty':0x0,'paused':_0xdf1ceb[_0x8a1b('0x69')],'createdAt':_0xdf1ceb['createdAt'],'updatedAt':_0xdf1ceb[_0x8a1b('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x338018,_0x5946fb))['catch'](handleError(_0x338018,null));};exports[_0x8a1b('0x6a')]=function(_0x2a2aa1,_0x2a99d8,_0xbaae7e){var _0x197f26={};var _0x3a806e={};var _0x5bca77;var _0x1e0e98;return db['ChatQueue'][_0x8a1b('0x6b')]({'where':{'id':_0x2a2aa1[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](handleEntityNotFound(_0x2a99d8,null))[_0x8a1b('0x20')](function(_0x195b62){if(_0x195b62){_0x5bca77=_0x195b62;_0x3a806e[_0x8a1b('0x3d')]=_[_0x8a1b('0x3e')](db['Team']['rawAttributes']);_0x3a806e[_0x8a1b('0x3f')]=_[_0x8a1b('0x3e')](_0x2a2aa1['query']);_0x3a806e[_0x8a1b('0x40')]=_[_0x8a1b('0x41')](_0x3a806e[_0x8a1b('0x3d')],_0x3a806e[_0x8a1b('0x3f')]);_0x197f26['attributes']=_[_0x8a1b('0x41')](_0x3a806e[_0x8a1b('0x3d')],qs[_0x8a1b('0x43')](_0x2a2aa1[_0x8a1b('0x3f')][_0x8a1b('0x43')]));_0x197f26[_0x8a1b('0x42')]=_0x197f26[_0x8a1b('0x42')]['length']?_0x197f26[_0x8a1b('0x42')]:_0x3a806e[_0x8a1b('0x3d')];_0x197f26[_0x8a1b('0x46')]=qs[_0x8a1b('0x47')](_0x2a2aa1[_0x8a1b('0x3f')][_0x8a1b('0x47')]);_0x197f26[_0x8a1b('0x48')]=qs[_0x8a1b('0x40')](_[_0x8a1b('0x49')](_0x2a2aa1['query'],_0x3a806e[_0x8a1b('0x40')]));if(_0x2a2aa1[_0x8a1b('0x3f')][_0x8a1b('0x4a')]){_0x197f26[_0x8a1b('0x48')]=_[_0x8a1b('0x4f')](_0x197f26[_0x8a1b('0x48')],{'$or':_['map'](_0x197f26['attributes'],function(_0x121c84){var _0x39c0f7={};_0x39c0f7[_0x121c84]={'$like':'%'+_0x2a2aa1['query'][_0x8a1b('0x4a')]+'%'};return _0x39c0f7;})});}_0x197f26=_[_0x8a1b('0x4f')]({},_0x197f26,_0x2a2aa1['options']);return _0x5bca77['getTeams'](_0x197f26);}})['then'](function(_0x4c66f8){if(_0x4c66f8){_0x1e0e98=_0x4c66f8[_0x8a1b('0x44')];if(!_0x2a2aa1[_0x8a1b('0x3f')]['hasOwnProperty']('nolimit')){_0x197f26['limit']=qs[_0x8a1b('0x2f')](_0x2a2aa1[_0x8a1b('0x3f')][_0x8a1b('0x2f')]);_0x197f26[_0x8a1b('0x2e')]=qs[_0x8a1b('0x2e')](_0x2a2aa1[_0x8a1b('0x3f')][_0x8a1b('0x2e')]);}return _0x5bca77['getTeams'](_0x197f26);}})[_0x8a1b('0x20')](function(_0xd34963){if(_0xd34963){return _0xd34963?{'count':_0x1e0e98,'rows':_0xd34963}:null;}})[_0x8a1b('0x20')](respondWithResult(_0x2a99d8,null))['catch'](handleError(_0x2a99d8,null));};exports[_0x8a1b('0x6c')]=function(_0x3ac5a7,_0x59fc89,_0x5bbbcb){var _0x2b14cd=_0x3ac5a7[_0x8a1b('0x5b')][_0x8a1b('0x6d')];return db[_0x8a1b('0x6e')][_0x8a1b('0x53')]({'where':{'id':_['map'](_0x2b14cd,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8a1b('0x6f'),'attributes':['id',_0x8a1b('0x39'),_0x8a1b('0x70'),_0x8a1b('0x71'),_0x8a1b('0x72')],'raw':!![]}]})[_0x8a1b('0x20')](function(_0x389eeb){if(_0x389eeb){var _0x5936b5=_[_0x8a1b('0x73')](_0x389eeb,function(_0x400eba){var _0x3d12ee=_0x400eba[_0x8a1b('0x35')]({'plain':!![]});return _0x3d12ee['Agents'];});return db[_0x8a1b('0x50')][_0x8a1b('0x59')]({'where':{'id':_0x3ac5a7[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](function(_0x4803e2){return db[_0x8a1b('0x74')]['transaction'](function(_0x26267d){return _0x4803e2[_0x8a1b('0x6c')](_[_0x8a1b('0x4b')](_0x2b14cd,'id'),{'transaction':_0x26267d})[_0x8a1b('0x20')](function(){return BPromise['each'](_0x5936b5,function(_0x4f7587){return db[_0x8a1b('0x75')][_0x8a1b('0x76')]({'where':{'UserId':_0x4f7587['id'],'ChatQueueId':_0x3ac5a7[_0x8a1b('0x56')]['id']},'transaction':_0x26267d});});})['then'](function(){_0x5936b5['forEach'](function(_0x387aad){socket[_0x8a1b('0x77')](_0x8a1b('0x78'),{'UserId':_0x387aad['id'],'ChatQueueId':_0x4803e2['id']});});});});});}})[_0x8a1b('0x20')](respondWithStatusCode(_0x59fc89,null))[_0x8a1b('0x2a')](handleError(_0x59fc89,null));};exports[_0x8a1b('0x79')]=function(_0x2dd8ae,_0xc439a1,_0x383ff4){return db[_0x8a1b('0x6e')][_0x8a1b('0x53')]({'where':{'id':_0x2dd8ae[_0x8a1b('0x3f')][_0x8a1b('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x8a1b('0x63')],'as':_0x8a1b('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x8a1b('0x20')](handleEntityNotFound(_0xc439a1,null))[_0x8a1b('0x20')](function(_0x2747d3){var _0x261a68=_[_0x8a1b('0x4b')](_0x2747d3,'id');var _0x456eb4=[];var _0x268c2e=[];var _0x3feb4f=squel[_0x8a1b('0x7b')]();_0x3feb4f[_0x8a1b('0x4e')]('tq.TeamId')[_0x8a1b('0x7c')](_0x8a1b('0x7d'),'tq')[_0x8a1b('0x7e')]('user_has_teams','ut',_0x8a1b('0x7f'))[_0x8a1b('0x48')]('ChatQueueId\x20=\x20?',_0x2dd8ae['params']['id']);for(var _0x309616=0x0;_0x309616<_0x2747d3[_0x8a1b('0x44')];_0x309616+=0x1){let _0x499a5d=_0x2747d3[_0x309616];for(var _0x444590=0x0;_0x444590<_0x499a5d[_0x8a1b('0x6f')][_0x8a1b('0x44')];_0x444590+=0x1){let _0x1f9d22=_0x499a5d[_0x8a1b('0x6f')][_0x444590];var _0x25aaa8=_0x3feb4f[_0x8a1b('0x80')]();_0x25aaa8[_0x8a1b('0x48')](_0x8a1b('0x81'),_0x1f9d22['id']);_0x268c2e[_0x8a1b('0x82')](db[_0x8a1b('0x74')][_0x8a1b('0x3f')](_0x25aaa8[_0x8a1b('0x83')](),{'type':db['sequelize'][_0x8a1b('0x84')][_0x8a1b('0x85')]})['then'](function(_0x2d32ef){if(_0x2d32ef['length']===0x1){return _0x1f9d22['id'];}else{var _0x1b242d=_[_0x8a1b('0x86')](_[_0x8a1b('0x4b')](_0x2d32ef,_0x8a1b('0x87')),function(_0x448f63){return _['includes'](_0x261a68,_0x448f63);});if(_0x1b242d){return _0x1f9d22['id'];}}}));}}return BPromise[_0x8a1b('0x88')](_0x268c2e)[_0x8a1b('0x20')](function(_0x125f5e){_0x456eb4=_(_0x456eb4)[_0x8a1b('0x89')](_0x125f5e)[_0x8a1b('0x8a')]()[_0x8a1b('0x8b')]();return db[_0x8a1b('0x50')][_0x8a1b('0x59')]({'where':{'id':_0x2dd8ae[_0x8a1b('0x56')]['id']}})['then'](function(_0x244750){return db[_0x8a1b('0x74')]['transaction'](function(_0x3f805d){return _0x244750[_0x8a1b('0x79')](_0x2dd8ae['query'][_0x8a1b('0x7a')],{'transaction':_0x3f805d})['then'](function(){if(!_['isEmpty'](_0x456eb4)){return _0x244750[_0x8a1b('0x8c')](_0x456eb4,{'transaction':_0x3f805d});}})[_0x8a1b('0x20')](function(){_0x456eb4[_0x8a1b('0x8d')](function(_0x31a0be){socket[_0x8a1b('0x77')](_0x8a1b('0x8e'),{'UserId':_0x31a0be,'ChatQueueId':_0x244750['id']});});});});});});})[_0x8a1b('0x20')](respondWithStatusCode(_0xc439a1,null))[_0x8a1b('0x2a')](handleError(_0xc439a1,null));};exports[_0x8a1b('0x8f')]=function(_0x14df51,_0x496e4b,_0x95aed8){return db[_0x8a1b('0x50')]['find']({'where':{'id':_0x14df51[_0x8a1b('0x56')]['id']}})[_0x8a1b('0x20')](handleEntityNotFound(_0x496e4b,null))[_0x8a1b('0x20')](function(_0xe578bf){if(_0xe578bf){return _0xe578bf[_0x8a1b('0x8f')](_0x14df51[_0x8a1b('0x5b')][_0x8a1b('0x7a')],_[_0x8a1b('0x90')](_0x14df51[_0x8a1b('0x5b')],[_0x8a1b('0x7a'),'id'])||{})[_0x8a1b('0x91')](function(_0x1fbc32){for(var _0x5adf88=0x0;_0x5adf88<_0x14df51[_0x8a1b('0x5b')][_0x8a1b('0x7a')]['length'];_0x5adf88+=0x1){socket[_0x8a1b('0x77')](_0x8a1b('0x78'),{'UserId':_0x14df51[_0x8a1b('0x5b')][_0x8a1b('0x7a')][_0x5adf88],'ChatQueueId':_0x14df51[_0x8a1b('0x56')]['id']});}return _0x1fbc32;});}})[_0x8a1b('0x20')](respondWithResult(_0x496e4b,null))['catch'](handleError(_0x496e4b,null));};exports['removeAgents']=function(_0x192a78,_0x318d50,_0x384541){return db[_0x8a1b('0x50')]['find']({'where':{'id':_0x192a78['params']['id']}})['then'](handleEntityNotFound(_0x318d50,null))[_0x8a1b('0x20')](function(_0x2c571e){if(_0x2c571e){return _0x2c571e[_0x8a1b('0x8c')](_0x192a78[_0x8a1b('0x3f')][_0x8a1b('0x7a')])['then'](function(){if(_['isArray'](_0x192a78[_0x8a1b('0x3f')][_0x8a1b('0x7a')])){for(var _0x504392=0x0;_0x504392<_0x192a78['query']['ids'][_0x8a1b('0x44')];_0x504392+=0x1){socket[_0x8a1b('0x77')](_0x8a1b('0x8e'),{'UserId':Number(_0x192a78[_0x8a1b('0x3f')][_0x8a1b('0x7a')][_0x504392]),'ChatQueueId':Number(_0x192a78[_0x8a1b('0x56')]['id'])});}}else{socket[_0x8a1b('0x77')](_0x8a1b('0x8e'),{'UserId':Number(_0x192a78[_0x8a1b('0x3f')][_0x8a1b('0x7a')]),'ChatQueueId':Number(_0x192a78[_0x8a1b('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x318d50,null))[_0x8a1b('0x2a')](handleError(_0x318d50,null));};exports[_0x8a1b('0x92')]=function(_0x32223b,_0x1dc80a,_0x27483e){var _0x48721e={};var _0x54a6e8={};var _0x5a8504;var _0x219758;return db[_0x8a1b('0x50')][_0x8a1b('0x6b')]({'where':{'id':_0x32223b['params']['id']}})['then'](handleEntityNotFound(_0x1dc80a,null))[_0x8a1b('0x20')](function(_0x1ae6dd){if(_0x1ae6dd){_0x5a8504=_0x1ae6dd;_0x54a6e8[_0x8a1b('0x3d')]=_[_0x8a1b('0x3e')](db[_0x8a1b('0x63')][_0x8a1b('0x3c')]);_0x54a6e8[_0x8a1b('0x3f')]=_[_0x8a1b('0x3e')](_0x32223b[_0x8a1b('0x3f')]);_0x54a6e8[_0x8a1b('0x40')]=_[_0x8a1b('0x41')](_0x54a6e8[_0x8a1b('0x3d')],_0x54a6e8[_0x8a1b('0x3f')]);_0x48721e[_0x8a1b('0x42')]=_[_0x8a1b('0x41')](_0x54a6e8['model'],qs[_0x8a1b('0x43')](_0x32223b['query'][_0x8a1b('0x43')]));_0x48721e[_0x8a1b('0x42')]=_0x48721e[_0x8a1b('0x42')][_0x8a1b('0x44')]?_0x48721e[_0x8a1b('0x42')]:_0x54a6e8[_0x8a1b('0x3d')];_0x48721e['order']=qs[_0x8a1b('0x47')](_0x32223b[_0x8a1b('0x3f')][_0x8a1b('0x47')]);_0x48721e[_0x8a1b('0x48')]=qs[_0x8a1b('0x40')](_[_0x8a1b('0x49')](_0x32223b[_0x8a1b('0x3f')],_0x54a6e8[_0x8a1b('0x40')]));if(_0x32223b[_0x8a1b('0x3f')][_0x8a1b('0x4a')]){_0x48721e[_0x8a1b('0x48')]=_['merge'](_0x48721e[_0x8a1b('0x48')],{'$or':_[_0x8a1b('0x4b')](_0x48721e[_0x8a1b('0x42')],function(_0x1dd6e7){var _0x3243ee={};_0x3243ee[_0x1dd6e7]={'$like':'%'+_0x32223b[_0x8a1b('0x3f')]['filter']+'%'};return _0x3243ee;})});}_0x48721e=_['merge']({},_0x48721e,_0x32223b['options']);return _0x5a8504[_0x8a1b('0x92')](_0x48721e);}})[_0x8a1b('0x20')](function(_0x37b0b9){if(_0x37b0b9){_0x219758=_0x37b0b9[_0x8a1b('0x44')];if(!_0x32223b[_0x8a1b('0x3f')]['hasOwnProperty'](_0x8a1b('0x45'))){_0x48721e[_0x8a1b('0x2f')]=qs['limit'](_0x32223b['query'][_0x8a1b('0x2f')]);_0x48721e[_0x8a1b('0x2e')]=qs[_0x8a1b('0x2e')](_0x32223b['query'][_0x8a1b('0x2e')]);}return _0x5a8504['getAgents'](_0x48721e);}})['then'](function(_0x50308a){if(_0x50308a){return _0x50308a?{'count':_0x219758,'rows':_0x50308a}:null;}})[_0x8a1b('0x20')](respondWithResult(_0x1dc80a,null))[_0x8a1b('0x2a')](handleError(_0x1dc80a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7aebca4..ce85e8e 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 _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2beb8c,_0x506e35){var _0x5bfac1=function(_0x18a047){while(--_0x18a047){_0x2beb8c['push'](_0x2beb8c['shift']());}};_0x5bfac1(++_0x506e35);}(_0x13f6,0x124));var _0x613f=function(_0x450958,_0x2c6887){_0x450958=_0x450958-0x0;var _0x1a974f=_0x13f6[_0x450958];return _0x1a974f;};'use strict';var EventEmitter=require(_0x613f('0x0'));var ChatQueue=require(_0x613f('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){ChatQueueEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);ChatQueueEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x91a7=['../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x91a7,0xe7));var _0x791a=function(_0x5f1733,_0x5775d2){_0x5f1733=_0x5f1733-0x0;var _0x84575=_0x91a7[_0x5f1733];return _0x84575;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){ChatQueueEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);ChatQueueEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index b4b347c..711bb0b 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 _0x9354=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x9354,0x96));var _0x4935=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x9354[_0x365e54];return _0x13317a;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde56=['ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x49d0ac,_0x4c9688){var _0x5b45bb=function(_0x30cafc){while(--_0x30cafc){_0x49d0ac['push'](_0x49d0ac['shift']());}};_0x5b45bb(++_0x4c9688);}(_0xde56,0x144));var _0x6de5=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0xde56[_0xe84805];return _0x398efd;};'use strict';var _=require(_0x6de5('0x0'));var util=require('util');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(_0x6de5('0x6'));var rimraf=require(_0x6de5('0x7'));var config=require(_0x6de5('0x8'));var attributes=require(_0x6de5('0x9'));module[_0x6de5('0xa')]=function(_0x4c65d1,_0x1d6194){return _0x4c65d1[_0x6de5('0xb')](_0x6de5('0xc'),attributes,{'tableName':_0x6de5('0xd'),'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 7c306ad..5c76543 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 _0x15d6=['error','code','message','result','catch','GetChatQueue','options','where','attributes','include','map','model','then','ShowChatQueue','ChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2460a2,_0x42ab98){var _0x325b59=function(_0x32b336){while(--_0x32b336){_0x2460a2['push'](_0x2460a2['shift']());}};_0x325b59(++_0x42ab98);}(_0x15d6,0xf4));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x615d('0x0'));var util=require(_0x615d('0x1'));var moment=require('moment');var BPromise=require(_0x615d('0x2'));var rs=require(_0x615d('0x3'));var fs=require('fs');var Redis=require(_0x615d('0x4'));var db=require(_0x615d('0x5'))['db'];var utils=require(_0x615d('0x6'));var logger=require(_0x615d('0x7'))(_0x615d('0x8'));var config=require(_0x615d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x615d('0xa')][_0x615d('0xb')]({'port':0x232a});config[_0x615d('0xc')]=_[_0x615d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x615d('0xc')]));require(_0x615d('0xe'))[_0x615d('0xf')](socket);function respondWithRpcPromise(_0x4ea442,_0x52434e,_0x137c20){return new BPromise(function(_0x3bb866,_0x2926ef){return client['request'](_0x4ea442,_0x137c20)['then'](function(_0x4bdcf2){logger[_0x615d('0x10')](_0x615d('0x11'),_0x52434e,_0x615d('0x12'));logger[_0x615d('0x13')](_0x615d('0x14'),_0x52434e,_0x615d('0x12'),JSON[_0x615d('0x15')](_0x4bdcf2));if(_0x4bdcf2[_0x615d('0x16')]){if(_0x4bdcf2[_0x615d('0x16')][_0x615d('0x17')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52434e,_0x4bdcf2[_0x615d('0x16')][_0x615d('0x18')]);return _0x2926ef(_0x4bdcf2[_0x615d('0x16')][_0x615d('0x18')]);}logger[_0x615d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x52434e,_0x4bdcf2[_0x615d('0x16')][_0x615d('0x18')]);return _0x3bb866(_0x4bdcf2[_0x615d('0x16')][_0x615d('0x18')]);}else{logger[_0x615d('0x10')](_0x615d('0x11'),_0x52434e,'request\x20sent');_0x3bb866(_0x4bdcf2[_0x615d('0x19')][_0x615d('0x18')]);}})[_0x615d('0x1a')](function(_0x138d91){logger[_0x615d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x52434e,_0x138d91);_0x2926ef(_0x138d91);});});}exports[_0x615d('0x1b')]=function(_0x5bb828){var _0x37da94=this;return new Promise(function(_0x19416c,_0x3649c3){return db['ChatQueue']['findAll']({'raw':_0x5bb828['options']?_0x5bb828[_0x615d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb828['options']?_0x5bb828['options'][_0x615d('0x1d')]||null:null,'attributes':_0x5bb828[_0x615d('0x1c')]?_0x5bb828['options'][_0x615d('0x1e')]||null:null,'limit':_0x5bb828[_0x615d('0x1c')]?_0x5bb828[_0x615d('0x1c')]['limit']||null:null,'include':_0x5bb828['options']?_0x5bb828[_0x615d('0x1c')][_0x615d('0x1f')]?_[_0x615d('0x20')](_0x5bb828[_0x615d('0x1c')][_0x615d('0x1f')],function(_0x1bf20c){return{'model':db[_0x1bf20c['model']],'as':_0x1bf20c['as'],'attributes':_0x1bf20c[_0x615d('0x1e')],'include':_0x1bf20c[_0x615d('0x1f')]?_['map'](_0x1bf20c[_0x615d('0x1f')],function(_0x26e5fb){return{'model':db[_0x26e5fb['model']],'as':_0x26e5fb['as'],'attributes':_0x26e5fb[_0x615d('0x1e')],'include':_0x26e5fb['include']?_[_0x615d('0x20')](_0x26e5fb[_0x615d('0x1f')],function(_0x46bf41){return{'model':db[_0x46bf41[_0x615d('0x21')]],'as':_0x46bf41['as'],'attributes':_0x46bf41[_0x615d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x615d('0x22')](function(_0x318607){logger[_0x615d('0x10')](_0x615d('0x1b'),_0x5bb828);logger[_0x615d('0x13')](_0x615d('0x1b'),_0x5bb828,JSON[_0x615d('0x15')](_0x318607));_0x19416c(_0x318607);})[_0x615d('0x1a')](function(_0x34ee40){logger[_0x615d('0x16')]('GetChatQueue',_0x34ee40[_0x615d('0x18')],_0x5bb828);_0x3649c3(_0x37da94[_0x615d('0x16')](0x1f4,_0x34ee40[_0x615d('0x18')]));});});};exports[_0x615d('0x23')]=function(_0x1565c7){var _0x274692=this;return new Promise(function(_0x2e8a2f,_0x57844c){return db[_0x615d('0x24')][_0x615d('0x25')]({'raw':_0x1565c7['options']?_0x1565c7[_0x615d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1565c7[_0x615d('0x1c')]?_0x1565c7['options'][_0x615d('0x1d')]||null:null,'attributes':_0x1565c7[_0x615d('0x1c')]?_0x1565c7[_0x615d('0x1c')][_0x615d('0x1e')]||null:null,'include':_0x1565c7[_0x615d('0x1c')]?_0x1565c7['options'][_0x615d('0x1f')]?_['map'](_0x1565c7[_0x615d('0x1c')][_0x615d('0x1f')],function(_0x478ed4){return{'model':db[_0x478ed4['model']],'as':_0x478ed4['as'],'attributes':_0x478ed4[_0x615d('0x1e')],'include':_0x478ed4['include']?_[_0x615d('0x20')](_0x478ed4['include'],function(_0x542516){return{'model':db[_0x542516['model']],'as':_0x542516['as'],'attributes':_0x542516[_0x615d('0x1e')],'include':_0x542516[_0x615d('0x1f')]?_[_0x615d('0x20')](_0x542516['include'],function(_0x2d14a3){return{'model':db[_0x2d14a3[_0x615d('0x21')]],'as':_0x2d14a3['as'],'attributes':_0x2d14a3[_0x615d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bb4dd){logger['info'](_0x615d('0x23'),_0x1565c7);logger[_0x615d('0x13')](_0x615d('0x23'),_0x1565c7,JSON[_0x615d('0x15')](_0x2bb4dd));_0x2e8a2f(_0x2bb4dd);})[_0x615d('0x1a')](function(_0x176dd8){logger[_0x615d('0x16')](_0x615d('0x23'),_0x176dd8[_0x615d('0x18')],_0x1565c7);_0x57844c(_0x274692[_0x615d('0x16')](0x1f4,_0x176dd8[_0x615d('0x18')]));});});}; \ No newline at end of file +var _0x7f33=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','limit','include','model','attributes','map','stringify','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4776cc,_0x3a715e){var _0x427bda=function(_0x36b1c7){while(--_0x36b1c7){_0x4776cc['push'](_0x4776cc['shift']());}};_0x427bda(++_0x3a715e);}(_0x7f33,0x16b));var _0x37f3=function(_0x5a02cb,_0xdcf2dd){_0x5a02cb=_0x5a02cb-0x0;var _0x1faf5c=_0x7f33[_0x5a02cb];return _0x1faf5c;};'use strict';var _=require(_0x37f3('0x0'));var util=require(_0x37f3('0x1'));var moment=require(_0x37f3('0x2'));var BPromise=require(_0x37f3('0x3'));var rs=require(_0x37f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37f3('0x6'))(_0x37f3('0x7'));var config=require(_0x37f3('0x8'));var jayson=require(_0x37f3('0x9'));var client=jayson[_0x37f3('0xa')][_0x37f3('0xb')]({'port':0x232a});config['redis']=_[_0x37f3('0xc')](config[_0x37f3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x37f3('0xe'))(new Redis(config[_0x37f3('0xd')]));require(_0x37f3('0xf'))[_0x37f3('0x10')](socket);function respondWithRpcPromise(_0x52e9c5,_0x1e274c,_0x437dd6){return new BPromise(function(_0x5a8dff,_0x433c5e){return client[_0x37f3('0x11')](_0x52e9c5,_0x437dd6)[_0x37f3('0x12')](function(_0x999944){logger[_0x37f3('0x13')](_0x37f3('0x14'),_0x1e274c,'request\x20sent');logger[_0x37f3('0x15')](_0x37f3('0x16'),_0x1e274c,_0x37f3('0x17'),JSON['stringify'](_0x999944));if(_0x999944[_0x37f3('0x18')]){if(_0x999944[_0x37f3('0x18')]['code']===0x1f4){logger[_0x37f3('0x18')](_0x37f3('0x14'),_0x1e274c,_0x999944[_0x37f3('0x18')][_0x37f3('0x19')]);return _0x433c5e(_0x999944['error'][_0x37f3('0x19')]);}logger[_0x37f3('0x18')]('ChatQueue,\x20%s,\x20%s',_0x1e274c,_0x999944[_0x37f3('0x18')][_0x37f3('0x19')]);return _0x5a8dff(_0x999944[_0x37f3('0x18')][_0x37f3('0x19')]);}else{logger['info'](_0x37f3('0x14'),_0x1e274c,'request\x20sent');_0x5a8dff(_0x999944[_0x37f3('0x1a')]['message']);}})[_0x37f3('0x1b')](function(_0x18b329){logger[_0x37f3('0x18')](_0x37f3('0x14'),_0x1e274c,_0x18b329);_0x433c5e(_0x18b329);});});}exports[_0x37f3('0x1c')]=function(_0x57c289){var _0x3dc9e4=this;return new Promise(function(_0x32b9f6,_0x59590f){return db[_0x37f3('0x1d')][_0x37f3('0x1e')]({'raw':_0x57c289['options']?_0x57c289[_0x37f3('0x1f')][_0x37f3('0x20')]===undefined?!![]:![]:!![],'where':_0x57c289[_0x37f3('0x1f')]?_0x57c289[_0x37f3('0x1f')]['where']||null:null,'attributes':_0x57c289[_0x37f3('0x1f')]?_0x57c289[_0x37f3('0x1f')]['attributes']||null:null,'limit':_0x57c289[_0x37f3('0x1f')]?_0x57c289[_0x37f3('0x1f')][_0x37f3('0x21')]||null:null,'include':_0x57c289[_0x37f3('0x1f')]?_0x57c289[_0x37f3('0x1f')][_0x37f3('0x22')]?_['map'](_0x57c289[_0x37f3('0x1f')][_0x37f3('0x22')],function(_0x3aca44){return{'model':db[_0x3aca44[_0x37f3('0x23')]],'as':_0x3aca44['as'],'attributes':_0x3aca44['attributes'],'include':_0x3aca44[_0x37f3('0x22')]?_['map'](_0x3aca44[_0x37f3('0x22')],function(_0x18b2ba){return{'model':db[_0x18b2ba[_0x37f3('0x23')]],'as':_0x18b2ba['as'],'attributes':_0x18b2ba[_0x37f3('0x24')],'include':_0x18b2ba['include']?_[_0x37f3('0x25')](_0x18b2ba[_0x37f3('0x22')],function(_0x5cab93){return{'model':db[_0x5cab93[_0x37f3('0x23')]],'as':_0x5cab93['as'],'attributes':_0x5cab93[_0x37f3('0x24')]};}):[]};}):[]};}):[]:[]})[_0x37f3('0x12')](function(_0x28f705){logger[_0x37f3('0x13')]('GetChatQueue',_0x57c289);logger[_0x37f3('0x15')]('GetChatQueue',_0x57c289,JSON[_0x37f3('0x26')](_0x28f705));_0x32b9f6(_0x28f705);})[_0x37f3('0x1b')](function(_0x395ae4){logger['error']('GetChatQueue',_0x395ae4[_0x37f3('0x19')],_0x57c289);_0x59590f(_0x3dc9e4[_0x37f3('0x18')](0x1f4,_0x395ae4[_0x37f3('0x19')]));});});};exports['ShowChatQueue']=function(_0x5cf9ba){var _0x567e58=this;return new Promise(function(_0x8ec68,_0x2c9343){return db[_0x37f3('0x1d')][_0x37f3('0x27')]({'raw':_0x5cf9ba[_0x37f3('0x1f')]?_0x5cf9ba[_0x37f3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5cf9ba[_0x37f3('0x1f')]?_0x5cf9ba[_0x37f3('0x1f')]['where']||null:null,'attributes':_0x5cf9ba[_0x37f3('0x1f')]?_0x5cf9ba[_0x37f3('0x1f')][_0x37f3('0x24')]||null:null,'include':_0x5cf9ba[_0x37f3('0x1f')]?_0x5cf9ba['options'][_0x37f3('0x22')]?_[_0x37f3('0x25')](_0x5cf9ba[_0x37f3('0x1f')]['include'],function(_0x486142){return{'model':db[_0x486142[_0x37f3('0x23')]],'as':_0x486142['as'],'attributes':_0x486142[_0x37f3('0x24')],'include':_0x486142[_0x37f3('0x22')]?_[_0x37f3('0x25')](_0x486142['include'],function(_0x4fd74c){return{'model':db[_0x4fd74c[_0x37f3('0x23')]],'as':_0x4fd74c['as'],'attributes':_0x4fd74c[_0x37f3('0x24')],'include':_0x4fd74c[_0x37f3('0x22')]?_['map'](_0x4fd74c[_0x37f3('0x22')],function(_0x345cc4){return{'model':db[_0x345cc4[_0x37f3('0x23')]],'as':_0x345cc4['as'],'attributes':_0x345cc4[_0x37f3('0x24')]};}):[]};}):[]};}):[]:[]})[_0x37f3('0x12')](function(_0x12e9b5){logger['info'](_0x37f3('0x28'),_0x5cf9ba);logger[_0x37f3('0x15')](_0x37f3('0x28'),_0x5cf9ba,JSON[_0x37f3('0x26')](_0x12e9b5));_0x8ec68(_0x12e9b5);})[_0x37f3('0x1b')](function(_0x3f5a06){logger[_0x37f3('0x18')](_0x37f3('0x28'),_0x3f5a06[_0x37f3('0x19')],_0x5cf9ba);_0x2c9343(_0x567e58[_0x37f3('0x18')](0x1f4,_0x3f5a06[_0x37f3('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 68d0dd5..3e8d7b9 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index aad775b..826ca05 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 _0x90fb=['Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express'];(function(_0x3f9631,_0x51ffcb){var _0x242d84=function(_0xfcd4f7){while(--_0xfcd4f7){_0x3f9631['push'](_0x3f9631['shift']());}};_0x242d84(++_0x51ffcb);}(_0x90fb,0x17c));var _0xb90f=function(_0x185133,_0x29a472){_0x185133=_0x185133-0x0;var _0x862f7f=_0x90fb[_0x185133];return _0x862f7f;};'use strict';var multer=require(_0xb90f('0x0'));var util=require(_0xb90f('0x1'));var path=require('path');var timeout=require(_0xb90f('0x2'));var express=require(_0xb90f('0x3'));var router=express[_0xb90f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb90f('0x5'));var config=require(_0xb90f('0x6'));var controller=require(_0xb90f('0x7'));router[_0xb90f('0x8')]('/',auth[_0xb90f('0x9')](),controller[_0xb90f('0xa')]);router[_0xb90f('0x8')]('/describe',auth[_0xb90f('0x9')](),controller[_0xb90f('0xb')]);router[_0xb90f('0x8')](_0xb90f('0xc'),auth[_0xb90f('0x9')](),controller['show']);router[_0xb90f('0x8')](_0xb90f('0xd'),auth[_0xb90f('0x9')](),controller[_0xb90f('0xe')]);router[_0xb90f('0x8')](_0xb90f('0xf'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xb90f('0x10'),auth[_0xb90f('0x9')](),controller['getAgents']);router[_0xb90f('0x11')]('/',auth[_0xb90f('0x9')](),controller['create']);router[_0xb90f('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb90f('0x12')]);router[_0xb90f('0x11')](_0xb90f('0x10'),auth[_0xb90f('0x9')](),controller['addAgents']);router['put'](_0xb90f('0xc'),auth[_0xb90f('0x9')](),controller['update']);router[_0xb90f('0x13')](_0xb90f('0xc'),auth[_0xb90f('0x9')](),controller[_0xb90f('0x14')]);router[_0xb90f('0x13')](_0xb90f('0xf'),auth[_0xb90f('0x9')](),controller[_0xb90f('0x15')]);router[_0xb90f('0x13')](_0xb90f('0x10'),auth[_0xb90f('0x9')](),controller[_0xb90f('0x16')]);module[_0xb90f('0x17')]=router; \ No newline at end of file +var _0x56b1=['get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x56b1,0x7f));var _0x156b=function(_0x5ab2a4,_0x1284fc){_0x5ab2a4=_0x5ab2a4-0x0;var _0x21b54e=_0x56b1[_0x5ab2a4];return _0x21b54e;};'use strict';var multer=require(_0x156b('0x0'));var util=require(_0x156b('0x1'));var path=require(_0x156b('0x2'));var timeout=require(_0x156b('0x3'));var express=require(_0x156b('0x4'));var router=express[_0x156b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x156b('0x6'));var config=require(_0x156b('0x7'));var controller=require('./chatQueue.controller');router[_0x156b('0x8')]('/',auth['isAuthenticated'](),controller[_0x156b('0x9')]);router[_0x156b('0x8')](_0x156b('0xa'),auth[_0x156b('0xb')](),controller[_0x156b('0xc')]);router[_0x156b('0x8')](_0x156b('0xd'),auth[_0x156b('0xb')](),controller[_0x156b('0xe')]);router[_0x156b('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x156b('0xf')]);router['get'](_0x156b('0x10'),auth[_0x156b('0xb')](),controller['getTeams']);router['get'](_0x156b('0x11'),auth[_0x156b('0xb')](),controller[_0x156b('0x12')]);router['post']('/',auth[_0x156b('0xb')](),controller[_0x156b('0x13')]);router[_0x156b('0x14')](_0x156b('0x10'),auth[_0x156b('0xb')](),controller[_0x156b('0x15')]);router[_0x156b('0x14')](_0x156b('0x11'),auth[_0x156b('0xb')](),controller['addAgents']);router['put'](_0x156b('0xd'),auth[_0x156b('0xb')](),controller[_0x156b('0x16')]);router['delete']('/:id',auth[_0x156b('0xb')](),controller['destroy']);router[_0x156b('0x17')](_0x156b('0x10'),auth[_0x156b('0xb')](),controller[_0x156b('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x156b('0x19')]);module[_0x156b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index af39560..ae50e65 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 _0xbc5a=['DATE','exports','STRING'];(function(_0x4ebd76,_0x2ff5e8){var _0x42c3ab=function(_0x2a619b){while(--_0x2a619b){_0x4ebd76['push'](_0x4ebd76['shift']());}};_0x42c3ab(++_0x2ff5e8);}(_0xbc5a,0x199));var _0xabc5=function(_0x145b54,_0x267c42){_0x145b54=_0x145b54-0x0;var _0x52007e=_0xbc5a[_0x145b54];return _0x52007e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xabc5('0x0')]={'uniqueid':{'type':Sequelize[_0xabc5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xabc5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xabc5('0x2')]},'acceptAt':{'type':Sequelize[_0xabc5('0x2')]},'exitAt':{'type':Sequelize[_0xabc5('0x2')]},'reason':{'type':Sequelize[_0xabc5('0x1')]}}; \ No newline at end of file +var _0x522a=['DATE','moment','sequelize','exports','STRING'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x522a,0xd3));var _0xa522=function(_0x1d8d9e,_0x20b77b){_0x1d8d9e=_0x1d8d9e-0x0;var _0x151b9d=_0x522a[_0x1d8d9e];return _0x151b9d;};'use strict';var moment=require(_0xa522('0x0'));var Sequelize=require(_0xa522('0x1'));module[_0xa522('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa522('0x3')]},'joinAt':{'type':Sequelize[_0xa522('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa522('0x4')]},'reason':{'type':Sequelize[_0xa522('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e2d9005..c64e42d 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 _0xbc71=['sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','html-pdf','rimraf','fast-json-patch','moment','util','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbc71,0x86));var _0x1bc7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbc71[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0x1bc7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1bc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bc7('0x2'));var rp=require('request-promise');var moment=require(_0x1bc7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1bc7('0x4'));var path=require(_0x1bc7('0x5'));var sox=require(_0x1bc7('0x6'));var csv=require('to-csv');var ejs=require(_0x1bc7('0x7'));var fs=require('fs');var _=require(_0x1bc7('0x8'));var squel=require(_0x1bc7('0x9'));var crypto=require(_0x1bc7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1bc7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1bc7('0xc'));var Papa=require('papaparse');var Redis=require(_0x1bc7('0xd'));var authService=require(_0x1bc7('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1bc7('0xf'));var logger=require(_0x1bc7('0x10'))(_0x1bc7('0x11'));var utils=require(_0x1bc7('0x12'));var config=require('../../config/environment');var db=require(_0x1bc7('0x13'))['db'];function respondWithStatusCode(_0x31429d,_0x578584){_0x578584=_0x578584||0xcc;return function(_0x25d68c){if(_0x25d68c){return _0x31429d[_0x1bc7('0x14')](_0x578584);}return _0x31429d[_0x1bc7('0x15')](_0x578584)[_0x1bc7('0x16')]();};}function respondWithResult(_0x2b563a,_0x50731c){_0x50731c=_0x50731c||0xc8;return function(_0x10bcb5){if(_0x10bcb5){return _0x2b563a['status'](_0x50731c)['json'](_0x10bcb5);}};}function respondWithFilteredResult(_0x5ce0ac,_0x2d94d3){return function(_0x2441d3){if(_0x2441d3){var _0x4802fa=_0x2441d3['count'],_0x1ee9d4=_0x2d94d3['offset'],_0x5d3e1f=_0x2d94d3[_0x1bc7('0x17')]+_0x2d94d3[_0x1bc7('0x18')],_0x2d5807;if(_0x5d3e1f>=_0x4802fa){_0x5d3e1f=_0x4802fa;_0x2d5807=0xc8;}else{_0x2d5807=0xce;}_0x5ce0ac[_0x1bc7('0x15')](_0x2d5807);return _0x5ce0ac[_0x1bc7('0x19')](_0x1bc7('0x1a'),_0x1ee9d4+'-'+_0x5d3e1f+'/'+_0x4802fa)[_0x1bc7('0x1b')](_0x2441d3);}return null;};}function patchUpdates(_0x2e309e){return function(_0x185975){try{jsonpatch[_0x1bc7('0x1c')](_0x185975,_0x2e309e,!![]);}catch(_0x514dba){return BPromise[_0x1bc7('0x1d')](_0x514dba);}return _0x185975[_0x1bc7('0x1e')]();};}function saveUpdates(_0x588733,_0x36e117){return function(_0x1cb44c){if(_0x1cb44c){return _0x1cb44c[_0x1bc7('0x1f')](_0x588733)[_0x1bc7('0x20')](function(_0x3c0640){return _0x3c0640;});}return null;};}function removeEntity(_0x3dd8f3,_0x3bb6e1){return function(_0x29871a){if(_0x29871a){return _0x29871a[_0x1bc7('0x21')]()[_0x1bc7('0x20')](function(){_0x3dd8f3[_0x1bc7('0x15')](0xcc)[_0x1bc7('0x16')]();});}};}function handleEntityNotFound(_0x41fb4c,_0x23e543){return function(_0x3ce3d8){if(!_0x3ce3d8){_0x41fb4c['sendStatus'](0x194);}return _0x3ce3d8;};}function handleError(_0x5c3a58,_0x8514bb){_0x8514bb=_0x8514bb||0x1f4;return function(_0x9230c1){logger[_0x1bc7('0x22')](_0x9230c1[_0x1bc7('0x23')]);if(_0x9230c1[_0x1bc7('0x24')]){delete _0x9230c1[_0x1bc7('0x24')];}_0x5c3a58[_0x1bc7('0x15')](_0x8514bb)[_0x1bc7('0x25')](_0x9230c1);};}exports['index']=function(_0x552a84,_0x42a760){var _0x28d768={},_0x32e382={},_0x584a2c={'count':0x0,'rows':[]};var _0x3027d4=db[_0x1bc7('0x26')][_0x1bc7('0x27')];_0x32e382['model']=_[_0x1bc7('0x28')](_0x3027d4);_0x32e382[_0x1bc7('0x29')]=_[_0x1bc7('0x28')](_0x552a84[_0x1bc7('0x29')]);_0x32e382[_0x1bc7('0x2a')]=_[_0x1bc7('0x2b')](_0x32e382['model'],_0x32e382[_0x1bc7('0x29')]);_0x28d768[_0x1bc7('0x2c')]=_[_0x1bc7('0x2b')](_0x32e382[_0x1bc7('0x2d')],qs['fields'](_0x552a84[_0x1bc7('0x29')][_0x1bc7('0x2e')]));_0x28d768[_0x1bc7('0x2c')]=_0x28d768[_0x1bc7('0x2c')][_0x1bc7('0x2f')]?_0x28d768[_0x1bc7('0x2c')]:_0x32e382[_0x1bc7('0x2d')];if(!_0x552a84['query'][_0x1bc7('0x30')](_0x1bc7('0x31'))){_0x28d768[_0x1bc7('0x18')]=qs[_0x1bc7('0x18')](_0x552a84[_0x1bc7('0x29')][_0x1bc7('0x18')]);_0x28d768[_0x1bc7('0x17')]=qs[_0x1bc7('0x17')](_0x552a84['query'][_0x1bc7('0x17')]);}_0x28d768[_0x1bc7('0x32')]=qs['sort'](_0x552a84[_0x1bc7('0x29')]['sort']);_0x28d768[_0x1bc7('0x33')]=qs[_0x1bc7('0x2a')](_['pick'](_0x552a84[_0x1bc7('0x29')],_0x32e382[_0x1bc7('0x2a')]));if(_0x552a84[_0x1bc7('0x29')][_0x1bc7('0x34')]){_0x28d768[_0x1bc7('0x33')]=_[_0x1bc7('0x35')](_0x28d768['where'],{'$or':_[_0x1bc7('0x36')](_0x3027d4,function(_0x46fd07){if(_0x46fd07[_0x1bc7('0x37')][_0x1bc7('0x38')]!=='VIRTUAL'){var _0x3e2662={};_0x3e2662[_0x46fd07[_0x1bc7('0x39')]]={'$like':'%'+_0x552a84[_0x1bc7('0x29')]['filter']+'%'};return _0x3e2662;}})});}_0x28d768=_[_0x1bc7('0x35')]({},_0x28d768,_0x552a84[_0x1bc7('0x3a')]);var _0xffc61d={'where':_0x28d768[_0x1bc7('0x33')]};return db[_0x1bc7('0x26')][_0x1bc7('0x3b')](_0xffc61d)[_0x1bc7('0x20')](function(_0x2aefe2){_0x584a2c['count']=_0x2aefe2;if(_0x552a84[_0x1bc7('0x29')][_0x1bc7('0x3c')]){_0x28d768[_0x1bc7('0x3d')]=[{'all':!![]}];}return db[_0x1bc7('0x26')][_0x1bc7('0x3e')](_0x28d768);})['then'](function(_0xa2b6f5){_0x584a2c[_0x1bc7('0x3f')]=_0xa2b6f5;return _0x584a2c;})['then'](respondWithFilteredResult(_0x42a760,_0x28d768))[_0x1bc7('0x40')](handleError(_0x42a760,null));};exports[_0x1bc7('0x41')]=function(_0x4088aa,_0x2af5a9){var _0x231302={'raw':!![],'where':{'id':_0x4088aa[_0x1bc7('0x42')]['id']}},_0x159b37={};_0x159b37[_0x1bc7('0x2d')]=_[_0x1bc7('0x28')](db[_0x1bc7('0x26')][_0x1bc7('0x27')]);_0x159b37[_0x1bc7('0x29')]=_['keys'](_0x4088aa['query']);_0x159b37['filters']=_[_0x1bc7('0x2b')](_0x159b37[_0x1bc7('0x2d')],_0x159b37[_0x1bc7('0x29')]);_0x231302[_0x1bc7('0x2c')]=_[_0x1bc7('0x2b')](_0x159b37[_0x1bc7('0x2d')],qs[_0x1bc7('0x2e')](_0x4088aa[_0x1bc7('0x29')][_0x1bc7('0x2e')]));_0x231302[_0x1bc7('0x2c')]=_0x231302[_0x1bc7('0x2c')][_0x1bc7('0x2f')]?_0x231302[_0x1bc7('0x2c')]:_0x159b37[_0x1bc7('0x2d')];if(_0x4088aa['query'][_0x1bc7('0x3c')]){_0x231302[_0x1bc7('0x3d')]=[{'all':!![]}];}_0x231302=_[_0x1bc7('0x35')]({},_0x231302,_0x4088aa[_0x1bc7('0x3a')]);return db[_0x1bc7('0x26')]['find'](_0x231302)['then'](handleEntityNotFound(_0x2af5a9,null))[_0x1bc7('0x20')](respondWithResult(_0x2af5a9,null))[_0x1bc7('0x40')](handleError(_0x2af5a9,null));};exports[_0x1bc7('0x43')]=function(_0x1434f9,_0x19e81d){return db[_0x1bc7('0x26')][_0x1bc7('0x43')](_0x1434f9[_0x1bc7('0x44')],{})[_0x1bc7('0x20')](respondWithResult(_0x19e81d,0xc9))[_0x1bc7('0x40')](handleError(_0x19e81d,null));};exports[_0x1bc7('0x1f')]=function(_0x36182e,_0x3306fb){if(_0x36182e[_0x1bc7('0x44')]['id']){delete _0x36182e['body']['id'];}return db[_0x1bc7('0x26')][_0x1bc7('0x45')]({'where':{'id':_0x36182e[_0x1bc7('0x42')]['id']}})[_0x1bc7('0x20')](handleEntityNotFound(_0x3306fb,null))['then'](saveUpdates(_0x36182e['body'],null))[_0x1bc7('0x20')](respondWithResult(_0x3306fb,null))[_0x1bc7('0x40')](handleError(_0x3306fb,null));};exports[_0x1bc7('0x21')]=function(_0x352be3,_0x34a144){return db[_0x1bc7('0x26')][_0x1bc7('0x45')]({'where':{'id':_0x352be3[_0x1bc7('0x42')]['id']}})[_0x1bc7('0x20')](handleEntityNotFound(_0x34a144,null))['then'](removeEntity(_0x34a144,null))['catch'](handleError(_0x34a144,null));};exports['describe']=function(_0x1f74dd,_0x132609){return db[_0x1bc7('0x26')]['describe']()[_0x1bc7('0x20')](respondWithResult(_0x132609,null))[_0x1bc7('0x40')](handleError(_0x132609,null));}; \ No newline at end of file +var _0xef0a=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','type','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x48963e,_0x2bac06){var _0x3e95b0=function(_0x49f87c){while(--_0x49f87c){_0x48963e['push'](_0x48963e['shift']());}};_0x3e95b0(++_0x2bac06);}(_0xef0a,0xdd));var _0xaef0=function(_0x44f9c0,_0x391085){_0x44f9c0=_0x44f9c0-0x0;var _0x241aa7=_0xef0a[_0x44f9c0];return _0x241aa7;};'use strict';var pdf=require(_0xaef0('0x0'));var emlformat=require(_0xaef0('0x1'));var rimraf=require(_0xaef0('0x2'));var zipdir=require(_0xaef0('0x3'));var jsonpatch=require(_0xaef0('0x4'));var rp=require(_0xaef0('0x5'));var moment=require(_0xaef0('0x6'));var BPromise=require(_0xaef0('0x7'));var Mustache=require(_0xaef0('0x8'));var util=require(_0xaef0('0x9'));var path=require(_0xaef0('0xa'));var sox=require('sox');var csv=require(_0xaef0('0xb'));var ejs=require(_0xaef0('0xc'));var fs=require('fs');var _=require(_0xaef0('0xd'));var squel=require(_0xaef0('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaef0('0xf'));var toCsv=require(_0xaef0('0xb'));var querystring=require(_0xaef0('0x10'));var Papa=require(_0xaef0('0x11'));var Redis=require(_0xaef0('0x12'));var authService=require(_0xaef0('0x13'));var qs=require(_0xaef0('0x14'));var hardwareService=require(_0xaef0('0x15'));var logger=require(_0xaef0('0x16'))('api');var utils=require(_0xaef0('0x17'));var config=require(_0xaef0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dc290,_0x5d0a29){_0x5d0a29=_0x5d0a29||0xcc;return function(_0x5dc8ba){if(_0x5dc8ba){return _0x2dc290[_0xaef0('0x19')](_0x5d0a29);}return _0x2dc290[_0xaef0('0x1a')](_0x5d0a29)[_0xaef0('0x1b')]();};}function respondWithResult(_0xdff66f,_0x20e24e){_0x20e24e=_0x20e24e||0xc8;return function(_0x682982){if(_0x682982){return _0xdff66f[_0xaef0('0x1a')](_0x20e24e)[_0xaef0('0x1c')](_0x682982);}};}function respondWithFilteredResult(_0x1e1836,_0x426e82){return function(_0x271c23){if(_0x271c23){var _0x92e88c=_0x271c23[_0xaef0('0x1d')],_0x44cd68=_0x426e82['offset'],_0x56fe98=_0x426e82[_0xaef0('0x1e')]+_0x426e82[_0xaef0('0x1f')],_0x2c2e18;if(_0x56fe98>=_0x92e88c){_0x56fe98=_0x92e88c;_0x2c2e18=0xc8;}else{_0x2c2e18=0xce;}_0x1e1836['status'](_0x2c2e18);return _0x1e1836[_0xaef0('0x20')](_0xaef0('0x21'),_0x44cd68+'-'+_0x56fe98+'/'+_0x92e88c)['json'](_0x271c23);}return null;};}function patchUpdates(_0x4ee6a9){return function(_0x1a9ebc){try{jsonpatch[_0xaef0('0x22')](_0x1a9ebc,_0x4ee6a9,!![]);}catch(_0x103fe9){return BPromise[_0xaef0('0x23')](_0x103fe9);}return _0x1a9ebc[_0xaef0('0x24')]();};}function saveUpdates(_0x56f370,_0x15a51e){return function(_0x450ea4){if(_0x450ea4){return _0x450ea4['update'](_0x56f370)[_0xaef0('0x25')](function(_0x5037e7){return _0x5037e7;});}return null;};}function removeEntity(_0x2ade9a,_0x52156b){return function(_0x15f151){if(_0x15f151){return _0x15f151[_0xaef0('0x26')]()['then'](function(){_0x2ade9a[_0xaef0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572574,_0x294f2e){return function(_0x4da865){if(!_0x4da865){_0x572574[_0xaef0('0x19')](0x194);}return _0x4da865;};}function handleError(_0x1c661f,_0x59ac43){_0x59ac43=_0x59ac43||0x1f4;return function(_0x12ab91){logger[_0xaef0('0x27')](_0x12ab91[_0xaef0('0x28')]);if(_0x12ab91['name']){delete _0x12ab91[_0xaef0('0x29')];}_0x1c661f['status'](_0x59ac43)[_0xaef0('0x2a')](_0x12ab91);};}exports[_0xaef0('0x2b')]=function(_0x1a4ddb,_0x1a8566){var _0x2d3c8b={},_0x3a1792={},_0x21de10={'count':0x0,'rows':[]};var _0x98bcc7=db[_0xaef0('0x2c')][_0xaef0('0x2d')];_0x3a1792['model']=_[_0xaef0('0x2e')](_0x98bcc7);_0x3a1792[_0xaef0('0x2f')]=_[_0xaef0('0x2e')](_0x1a4ddb['query']);_0x3a1792[_0xaef0('0x30')]=_[_0xaef0('0x31')](_0x3a1792['model'],_0x3a1792['query']);_0x2d3c8b['attributes']=_[_0xaef0('0x31')](_0x3a1792[_0xaef0('0x32')],qs[_0xaef0('0x33')](_0x1a4ddb[_0xaef0('0x2f')][_0xaef0('0x33')]));_0x2d3c8b[_0xaef0('0x34')]=_0x2d3c8b['attributes'][_0xaef0('0x35')]?_0x2d3c8b[_0xaef0('0x34')]:_0x3a1792[_0xaef0('0x32')];if(!_0x1a4ddb[_0xaef0('0x2f')][_0xaef0('0x36')]('nolimit')){_0x2d3c8b[_0xaef0('0x1f')]=qs[_0xaef0('0x1f')](_0x1a4ddb[_0xaef0('0x2f')][_0xaef0('0x1f')]);_0x2d3c8b['offset']=qs[_0xaef0('0x1e')](_0x1a4ddb[_0xaef0('0x2f')][_0xaef0('0x1e')]);}_0x2d3c8b['order']=qs[_0xaef0('0x37')](_0x1a4ddb['query'][_0xaef0('0x37')]);_0x2d3c8b['where']=qs[_0xaef0('0x30')](_[_0xaef0('0x38')](_0x1a4ddb['query'],_0x3a1792[_0xaef0('0x30')]));if(_0x1a4ddb['query'][_0xaef0('0x39')]){_0x2d3c8b[_0xaef0('0x3a')]=_[_0xaef0('0x3b')](_0x2d3c8b[_0xaef0('0x3a')],{'$or':_['map'](_0x98bcc7,function(_0x238975){if(_0x238975[_0xaef0('0x3c')][_0xaef0('0x3d')]!=='VIRTUAL'){var _0xd781da={};_0xd781da[_0x238975['field']]={'$like':'%'+_0x1a4ddb[_0xaef0('0x2f')]['filter']+'%'};return _0xd781da;}})});}_0x2d3c8b=_['merge']({},_0x2d3c8b,_0x1a4ddb[_0xaef0('0x3e')]);var _0x65193b={'where':_0x2d3c8b['where']};return db['ChatQueueReport']['count'](_0x65193b)['then'](function(_0x44147b){_0x21de10[_0xaef0('0x1d')]=_0x44147b;if(_0x1a4ddb[_0xaef0('0x2f')][_0xaef0('0x3f')]){_0x2d3c8b[_0xaef0('0x40')]=[{'all':!![]}];}return db[_0xaef0('0x2c')][_0xaef0('0x41')](_0x2d3c8b);})[_0xaef0('0x25')](function(_0x5820dc){_0x21de10[_0xaef0('0x42')]=_0x5820dc;return _0x21de10;})[_0xaef0('0x25')](respondWithFilteredResult(_0x1a8566,_0x2d3c8b))[_0xaef0('0x43')](handleError(_0x1a8566,null));};exports[_0xaef0('0x44')]=function(_0x16f9c3,_0xf9f7a8){var _0x21aa90={'raw':!![],'where':{'id':_0x16f9c3[_0xaef0('0x45')]['id']}},_0x81ec73={};_0x81ec73[_0xaef0('0x32')]=_['keys'](db[_0xaef0('0x2c')][_0xaef0('0x2d')]);_0x81ec73[_0xaef0('0x2f')]=_['keys'](_0x16f9c3['query']);_0x81ec73[_0xaef0('0x30')]=_['intersection'](_0x81ec73[_0xaef0('0x32')],_0x81ec73[_0xaef0('0x2f')]);_0x21aa90[_0xaef0('0x34')]=_[_0xaef0('0x31')](_0x81ec73[_0xaef0('0x32')],qs['fields'](_0x16f9c3[_0xaef0('0x2f')][_0xaef0('0x33')]));_0x21aa90[_0xaef0('0x34')]=_0x21aa90[_0xaef0('0x34')][_0xaef0('0x35')]?_0x21aa90[_0xaef0('0x34')]:_0x81ec73[_0xaef0('0x32')];if(_0x16f9c3[_0xaef0('0x2f')][_0xaef0('0x3f')]){_0x21aa90[_0xaef0('0x40')]=[{'all':!![]}];}_0x21aa90=_[_0xaef0('0x3b')]({},_0x21aa90,_0x16f9c3['options']);return db[_0xaef0('0x2c')][_0xaef0('0x46')](_0x21aa90)[_0xaef0('0x25')](handleEntityNotFound(_0xf9f7a8,null))[_0xaef0('0x25')](respondWithResult(_0xf9f7a8,null))[_0xaef0('0x43')](handleError(_0xf9f7a8,null));};exports[_0xaef0('0x47')]=function(_0x1d90f9,_0x43ced8){return db[_0xaef0('0x2c')]['create'](_0x1d90f9[_0xaef0('0x48')],{})[_0xaef0('0x25')](respondWithResult(_0x43ced8,0xc9))[_0xaef0('0x43')](handleError(_0x43ced8,null));};exports[_0xaef0('0x49')]=function(_0x1c6290,_0x1ef833){if(_0x1c6290[_0xaef0('0x48')]['id']){delete _0x1c6290[_0xaef0('0x48')]['id'];}return db[_0xaef0('0x2c')][_0xaef0('0x46')]({'where':{'id':_0x1c6290[_0xaef0('0x45')]['id']}})[_0xaef0('0x25')](handleEntityNotFound(_0x1ef833,null))['then'](saveUpdates(_0x1c6290['body'],null))[_0xaef0('0x25')](respondWithResult(_0x1ef833,null))[_0xaef0('0x43')](handleError(_0x1ef833,null));};exports['destroy']=function(_0x492453,_0x418007){return db[_0xaef0('0x2c')][_0xaef0('0x46')]({'where':{'id':_0x492453['params']['id']}})[_0xaef0('0x25')](handleEntityNotFound(_0x418007,null))[_0xaef0('0x25')](removeEntity(_0x418007,null))['catch'](handleError(_0x418007,null));};exports[_0xaef0('0x4a')]=function(_0x334679,_0x547958){return db[_0xaef0('0x2c')][_0xaef0('0x4a')]()[_0xaef0('0x25')](respondWithResult(_0x547958,null))[_0xaef0('0x43')](handleError(_0x547958,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 2cb1999..469172f 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 _0x898c=['exports','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','rimraf','../../config/environment','./chatQueueReport.attributes'];(function(_0x5cfeed,_0x57586e){var _0x16f48c=function(_0x24070a){while(--_0x24070a){_0x5cfeed['push'](_0x5cfeed['shift']());}};_0x16f48c(++_0x57586e);}(_0x898c,0x190));var _0xc898=function(_0x3cdba4,_0x38853d){_0x3cdba4=_0x3cdba4-0x0;var _0x5b35bc=_0x898c[_0x3cdba4];return _0x5b35bc;};'use strict';var _=require(_0xc898('0x0'));var util=require(_0xc898('0x1'));var logger=require(_0xc898('0x2'))(_0xc898('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc898('0x4'));var config=require(_0xc898('0x5'));var attributes=require(_0xc898('0x6'));module[_0xc898('0x7')]=function(_0x56781e,_0x444fde){return _0x56781e['define'](_0xc898('0x8'),attributes,{'tableName':_0xc898('0x9'),'paranoid':![],'indexes':[{'name':_0xc898('0xa'),'fields':[_0xc898('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd66=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport'];(function(_0x50eab9,_0x1a6d00){var _0x102a2f=function(_0x5af23c){while(--_0x5af23c){_0x50eab9['push'](_0x50eab9['shift']());}};_0x102a2f(++_0x1a6d00);}(_0xdd66,0x11f));var _0x6dd6=function(_0x3ba3b3,_0x211a17){_0x3ba3b3=_0x3ba3b3-0x0;var _0x248afb=_0xdd66[_0x3ba3b3];return _0x248afb;};'use strict';var _=require(_0x6dd6('0x0'));var util=require(_0x6dd6('0x1'));var logger=require(_0x6dd6('0x2'))(_0x6dd6('0x3'));var moment=require('moment');var BPromise=require(_0x6dd6('0x4'));var rp=require(_0x6dd6('0x5'));var fs=require('fs');var path=require(_0x6dd6('0x6'));var rimraf=require(_0x6dd6('0x7'));var config=require(_0x6dd6('0x8'));var attributes=require(_0x6dd6('0x9'));module['exports']=function(_0x52c364,_0x10b36c){return _0x52c364[_0x6dd6('0xa')](_0x6dd6('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x6dd6('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c3bd813..00f6bb5 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 _0x2960=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','raw','UpdateChatQueueReport','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2960,0x10c));var _0x0296=function(_0x5cb71a,_0x263bdf){_0x5cb71a=_0x5cb71a-0x0;var _0x3f380f=_0x2960[_0x5cb71a];return _0x3f380f;};'use strict';var _=require(_0x0296('0x0'));var util=require(_0x0296('0x1'));var moment=require(_0x0296('0x2'));var BPromise=require(_0x0296('0x3'));var rs=require(_0x0296('0x4'));var fs=require('fs');var Redis=require(_0x0296('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0296('0x6'));var logger=require(_0x0296('0x7'))(_0x0296('0x8'));var config=require(_0x0296('0x9'));var jayson=require(_0x0296('0xa'));var client=jayson[_0x0296('0xb')][_0x0296('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x473f90,_0x4f0b16,_0x5e636c){return new BPromise(function(_0x85d1c4,_0x4e1a52){return client[_0x0296('0xd')](_0x473f90,_0x5e636c)[_0x0296('0xe')](function(_0x1491bf){logger[_0x0296('0xf')](_0x0296('0x10'),_0x4f0b16,'request\x20sent');logger[_0x0296('0x11')](_0x0296('0x12'),_0x4f0b16,_0x0296('0x13'),JSON[_0x0296('0x14')](_0x1491bf));if(_0x1491bf['error']){if(_0x1491bf[_0x0296('0x15')][_0x0296('0x16')]===0x1f4){logger[_0x0296('0x15')](_0x0296('0x10'),_0x4f0b16,_0x1491bf[_0x0296('0x15')]['message']);return _0x4e1a52(_0x1491bf[_0x0296('0x15')]['message']);}logger[_0x0296('0x15')](_0x0296('0x10'),_0x4f0b16,_0x1491bf[_0x0296('0x15')][_0x0296('0x17')]);return _0x85d1c4(_0x1491bf[_0x0296('0x15')]['message']);}else{logger[_0x0296('0xf')](_0x0296('0x10'),_0x4f0b16,'request\x20sent');_0x85d1c4(_0x1491bf[_0x0296('0x18')]['message']);}})[_0x0296('0x19')](function(_0x25b6bd){logger[_0x0296('0x15')](_0x0296('0x10'),_0x4f0b16,_0x25b6bd);_0x4e1a52(_0x25b6bd);});});}exports[_0x0296('0x1a')]=function(_0x427aa8){var _0xbc72b2=this;return new Promise(function(_0x103e3b,_0x45d9b4){return db['ChatQueueReport'][_0x0296('0x1b')](_0x427aa8[_0x0296('0x1c')],{'raw':_0x427aa8['options']?_0x427aa8['options'][_0x0296('0x1d')]===undefined?!![]:![]:!![]})[_0x0296('0xe')](function(_0x5daa33){logger[_0x0296('0xf')](_0x0296('0x1a'),_0x427aa8);logger[_0x0296('0x11')](_0x0296('0x1a'),_0x427aa8,JSON[_0x0296('0x14')](_0x5daa33));_0x103e3b(_0x5daa33);})[_0x0296('0x19')](function(_0x27594c){logger['error'](_0x0296('0x1a'),_0x27594c[_0x0296('0x17')],_0x427aa8);_0x45d9b4(_0xbc72b2['error'](0x1f4,_0x27594c['message']));});});};exports[_0x0296('0x1e')]=function(_0x497882){var _0x4827b7=this;return new Promise(function(_0x395587,_0x552122){return db['ChatQueueReport']['update'](_0x497882[_0x0296('0x1c')],{'raw':_0x497882[_0x0296('0x1f')]?_0x497882[_0x0296('0x1f')][_0x0296('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x497882['options']?_0x497882[_0x0296('0x1f')][_0x0296('0x20')]||null:null,'attributes':_0x497882[_0x0296('0x1f')]?_0x497882[_0x0296('0x1f')][_0x0296('0x21')]||null:null,'limit':_0x497882[_0x0296('0x1f')]?_0x497882[_0x0296('0x1f')][_0x0296('0x22')]||null:null})[_0x0296('0xe')](function(_0x4723a9){logger[_0x0296('0xf')](_0x0296('0x1e'),_0x497882);logger['debug'](_0x0296('0x1e'),_0x497882,JSON[_0x0296('0x14')](_0x4723a9));_0x395587(_0x4723a9);})[_0x0296('0x19')](function(_0x5e3069){logger[_0x0296('0x15')](_0x0296('0x1e'),_0x5e3069[_0x0296('0x17')],_0x497882);_0x552122(_0x4827b7['error'](0x1f4,_0x5e3069[_0x0296('0x17')]));});});}; \ No newline at end of file +var _0x5cc4=['request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','debug','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5cc4,0x90));var _0x45cc=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x5cc4[_0x56756b];return _0xa3002;};'use strict';var _=require(_0x45cc('0x0'));var util=require('util');var moment=require(_0x45cc('0x1'));var BPromise=require(_0x45cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45cc('0x3'));var db=require(_0x45cc('0x4'))['db'];var utils=require(_0x45cc('0x5'));var logger=require('../../config/logger')(_0x45cc('0x6'));var config=require(_0x45cc('0x7'));var jayson=require(_0x45cc('0x8'));var client=jayson[_0x45cc('0x9')][_0x45cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e83a9,_0x47173d,_0x2c5c24){return new BPromise(function(_0x19d59a,_0xc34774){return client[_0x45cc('0xb')](_0x4e83a9,_0x2c5c24)['then'](function(_0x608efe){logger['info'](_0x45cc('0xc'),_0x47173d,_0x45cc('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x47173d,_0x45cc('0xd'),JSON[_0x45cc('0xe')](_0x608efe));if(_0x608efe['error']){if(_0x608efe['error']['code']===0x1f4){logger[_0x45cc('0xf')](_0x45cc('0xc'),_0x47173d,_0x608efe['error'][_0x45cc('0x10')]);return _0xc34774(_0x608efe[_0x45cc('0xf')]['message']);}logger[_0x45cc('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x47173d,_0x608efe['error']['message']);return _0x19d59a(_0x608efe[_0x45cc('0xf')]['message']);}else{logger[_0x45cc('0x11')](_0x45cc('0xc'),_0x47173d,_0x45cc('0xd'));_0x19d59a(_0x608efe[_0x45cc('0x12')][_0x45cc('0x10')]);}})[_0x45cc('0x13')](function(_0x32dfe2){logger[_0x45cc('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x47173d,_0x32dfe2);_0xc34774(_0x32dfe2);});});}exports[_0x45cc('0x14')]=function(_0x46f06a){var _0x587185=this;return new Promise(function(_0x206c89,_0x41db61){return db[_0x45cc('0x15')]['create'](_0x46f06a[_0x45cc('0x16')],{'raw':_0x46f06a[_0x45cc('0x17')]?_0x46f06a[_0x45cc('0x17')][_0x45cc('0x18')]===undefined?!![]:![]:!![]})[_0x45cc('0x19')](function(_0x20b421){logger[_0x45cc('0x11')]('CreateChatQueueReport',_0x46f06a);logger[_0x45cc('0x1a')](_0x45cc('0x14'),_0x46f06a,JSON['stringify'](_0x20b421));_0x206c89(_0x20b421);})[_0x45cc('0x13')](function(_0x8bfff7){logger['error'](_0x45cc('0x14'),_0x8bfff7['message'],_0x46f06a);_0x41db61(_0x587185[_0x45cc('0xf')](0x1f4,_0x8bfff7['message']));});});};exports[_0x45cc('0x1b')]=function(_0x3f14ef){var _0x570532=this;return new Promise(function(_0x4125aa,_0x266700){return db[_0x45cc('0x15')][_0x45cc('0x1c')](_0x3f14ef[_0x45cc('0x16')],{'raw':_0x3f14ef[_0x45cc('0x17')]?_0x3f14ef[_0x45cc('0x17')][_0x45cc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f14ef['options']?_0x3f14ef[_0x45cc('0x17')][_0x45cc('0x1d')]||null:null,'attributes':_0x3f14ef[_0x45cc('0x17')]?_0x3f14ef[_0x45cc('0x17')]['attributes']||null:null,'limit':_0x3f14ef[_0x45cc('0x17')]?_0x3f14ef[_0x45cc('0x17')][_0x45cc('0x1e')]||null:null})[_0x45cc('0x19')](function(_0x531359){logger[_0x45cc('0x11')]('UpdateChatQueueReport',_0x3f14ef);logger[_0x45cc('0x1a')](_0x45cc('0x1b'),_0x3f14ef,JSON['stringify'](_0x531359));_0x4125aa(_0x531359);})[_0x45cc('0x13')](function(_0x46d3cb){logger[_0x45cc('0xf')](_0x45cc('0x1b'),_0x46d3cb[_0x45cc('0x10')],_0x3f14ef);_0x266700(_0x570532[_0x45cc('0xf')](0x1f4,_0x46d3cb[_0x45cc('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fb4af18..08f45c1 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 _0x8a32=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x1213ce,_0x43eeb1){var _0x5aae14=function(_0x12807d){while(--_0x12807d){_0x1213ce['push'](_0x1213ce['shift']());}};_0x5aae14(++_0x43eeb1);}(_0x8a32,0x1ea));var _0x28a3=function(_0x2a1ae1,_0x1c0fc1){_0x2a1ae1=_0x2a1ae1-0x0;var _0x399e47=_0x8a32[_0x2a1ae1];return _0x399e47;};'use strict';var multer=require(_0x28a3('0x0'));var util=require(_0x28a3('0x1'));var path=require(_0x28a3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x28a3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x28a3('0x4'));var config=require(_0x28a3('0x5'));var controller=require(_0x28a3('0x6'));router[_0x28a3('0x7')]('/',auth['isAuthenticated'](),controller[_0x28a3('0x8')]);router[_0x28a3('0x7')](_0x28a3('0x9'),auth[_0x28a3('0xa')](),controller['describe']);router[_0x28a3('0x7')](_0x28a3('0xb'),auth[_0x28a3('0xa')](),controller['show']);router[_0x28a3('0xc')]('/',auth[_0x28a3('0xa')](),controller[_0x28a3('0xd')]);router[_0x28a3('0xe')]('/:id',auth[_0x28a3('0xa')](),controller[_0x28a3('0xf')]);router[_0x28a3('0x10')](_0x28a3('0xb'),auth[_0x28a3('0xa')](),controller[_0x28a3('0x11')]);module[_0x28a3('0x12')]=router; \ No newline at end of file +var _0x7056=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x2e717a,_0x524f2b){var _0x4f3d40=function(_0x2d2f5d){while(--_0x2d2f5d){_0x2e717a['push'](_0x2e717a['shift']());}};_0x4f3d40(++_0x524f2b);}(_0x7056,0xac));var _0x6705=function(_0x249d37,_0x4a1448){_0x249d37=_0x249d37-0x0;var _0x341eca=_0x7056[_0x249d37];return _0x341eca;};'use strict';var multer=require('multer');var util=require(_0x6705('0x0'));var path=require(_0x6705('0x1'));var timeout=require(_0x6705('0x2'));var express=require(_0x6705('0x3'));var router=express['Router']();var auth=require(_0x6705('0x4'));var interaction=require(_0x6705('0x5'));var config=require(_0x6705('0x6'));var controller=require('./chatQueueReport.controller');router[_0x6705('0x7')]('/',auth[_0x6705('0x8')](),controller[_0x6705('0x9')]);router[_0x6705('0x7')](_0x6705('0xa'),auth[_0x6705('0x8')](),controller[_0x6705('0xb')]);router[_0x6705('0x7')](_0x6705('0xc'),auth[_0x6705('0x8')](),controller[_0x6705('0xd')]);router['post']('/',auth[_0x6705('0x8')](),controller['create']);router[_0x6705('0xe')](_0x6705('0xc'),auth[_0x6705('0x8')](),controller['update']);router[_0x6705('0xf')]('/:id',auth[_0x6705('0x8')](),controller[_0x6705('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 8485015..9e01e84 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 _0xf572=['STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x39868c,_0x57d081){var _0x434857=function(_0x11ddd4){while(--_0x11ddd4){_0x39868c['push'](_0x39868c['shift']());}};_0x434857(++_0x57d081);}(_0xf572,0x69));var _0x2f57=function(_0x40bb7c,_0x1e3d47){_0x40bb7c=_0x40bb7c-0x0;var _0x470085=_0xf572[_0x40bb7c];return _0x470085;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x2f57('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x2f57('0x1')](_0x2f57('0x2'),_0x2f57('0x3'),_0x2f57('0x4')),'allowNull':![],'defaultValue':_0x2f57('0x4')},'transferredAt':{'type':Sequelize[_0x2f57('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x2f57('0x6')]}}; \ No newline at end of file +var _0x32d8=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x32d8,0x168));var _0x832d=function(_0x1ae7c8,_0x274e1d){_0x1ae7c8=_0x1ae7c8-0x0;var _0x66aab0=_0x32d8[_0x1ae7c8];return _0x66aab0;};'use strict';var moment=require(_0x832d('0x0'));var Sequelize=require(_0x832d('0x1'));module[_0x832d('0x2')]={'uniqueid':{'type':Sequelize[_0x832d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x832d('0x4')](_0x832d('0x5'),_0x832d('0x6'),_0x832d('0x7')),'allowNull':![],'defaultValue':_0x832d('0x7')},'transferredAt':{'type':Sequelize[_0x832d('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x832d('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 717b1a0..1dcc0d4 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 _0xeebc=['sendStatus','error','stack','name','send','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','apply','reject','save','update','then','destroy'];(function(_0x526b66,_0x28f755){var _0x11f386=function(_0x375cdf){while(--_0x375cdf){_0x526b66['push'](_0x526b66['shift']());}};_0x11f386(++_0x28f755);}(_0xeebc,0x6f));var _0xceeb=function(_0x1777ef,_0x565261){_0x1777ef=_0x1777ef-0x0;var _0x690237=_0xeebc[_0x1777ef];return _0x690237;};'use strict';var pdf=require(_0xceeb('0x0'));var emlformat=require(_0xceeb('0x1'));var rimraf=require(_0xceeb('0x2'));var zipdir=require(_0xceeb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceeb('0x4'));var moment=require(_0xceeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xceeb('0x6'));var util=require(_0xceeb('0x7'));var path=require('path');var sox=require(_0xceeb('0x8'));var csv=require(_0xceeb('0x9'));var ejs=require(_0xceeb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xceeb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xceeb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xceeb('0xd'));var Papa=require(_0xceeb('0xe'));var Redis=require(_0xceeb('0xf'));var authService=require(_0xceeb('0x10'));var qs=require(_0xceeb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xceeb('0x12'))(_0xceeb('0x13'));var utils=require(_0xceeb('0x14'));var config=require(_0xceeb('0x15'));var db=require(_0xceeb('0x16'))['db'];function respondWithStatusCode(_0xf0a2c,_0x214752){_0x214752=_0x214752||0xcc;return function(_0xc138f7){if(_0xc138f7){return _0xf0a2c['sendStatus'](_0x214752);}return _0xf0a2c['status'](_0x214752)[_0xceeb('0x17')]();};}function respondWithResult(_0x49fb66,_0x56a3e1){_0x56a3e1=_0x56a3e1||0xc8;return function(_0x849356){if(_0x849356){return _0x49fb66[_0xceeb('0x18')](_0x56a3e1)[_0xceeb('0x19')](_0x849356);}};}function respondWithFilteredResult(_0x5ea808,_0x344ae6){return function(_0x4bd1f0){if(_0x4bd1f0){var _0x41b8f4=_0x4bd1f0[_0xceeb('0x1a')],_0x3624ce=_0x344ae6[_0xceeb('0x1b')],_0x1a7fd1=_0x344ae6['offset']+_0x344ae6['limit'],_0x2fc780;if(_0x1a7fd1>=_0x41b8f4){_0x1a7fd1=_0x41b8f4;_0x2fc780=0xc8;}else{_0x2fc780=0xce;}_0x5ea808['status'](_0x2fc780);return _0x5ea808[_0xceeb('0x1c')]('Content-Range',_0x3624ce+'-'+_0x1a7fd1+'/'+_0x41b8f4)[_0xceeb('0x19')](_0x4bd1f0);}return null;};}function patchUpdates(_0x35c414){return function(_0x17b2a1){try{jsonpatch[_0xceeb('0x1d')](_0x17b2a1,_0x35c414,!![]);}catch(_0x34b656){return BPromise[_0xceeb('0x1e')](_0x34b656);}return _0x17b2a1[_0xceeb('0x1f')]();};}function saveUpdates(_0x2064ed,_0x3fe4ac){return function(_0x1cf1c5){if(_0x1cf1c5){return _0x1cf1c5[_0xceeb('0x20')](_0x2064ed)[_0xceeb('0x21')](function(_0x1e81ac){return _0x1e81ac;});}return null;};}function removeEntity(_0x540bca,_0x5de570){return function(_0x531475){if(_0x531475){return _0x531475[_0xceeb('0x22')]()[_0xceeb('0x21')](function(){_0x540bca['status'](0xcc)[_0xceeb('0x17')]();});}};}function handleEntityNotFound(_0x356929,_0x3902a4){return function(_0x3071ef){if(!_0x3071ef){_0x356929[_0xceeb('0x23')](0x194);}return _0x3071ef;};}function handleError(_0x2ec642,_0x4defa7){_0x4defa7=_0x4defa7||0x1f4;return function(_0x13dae9){logger[_0xceeb('0x24')](_0x13dae9[_0xceeb('0x25')]);if(_0x13dae9['name']){delete _0x13dae9[_0xceeb('0x26')];}_0x2ec642['status'](_0x4defa7)[_0xceeb('0x27')](_0x13dae9);};}exports['index']=function(_0x2e5d0c,_0x955b3b){var _0x3adc8a={},_0x6492b0={},_0x49a641={'count':0x0,'rows':[]};var _0x35ba25=db[_0xceeb('0x28')][_0xceeb('0x29')];_0x6492b0[_0xceeb('0x2a')]=_[_0xceeb('0x2b')](_0x35ba25);_0x6492b0[_0xceeb('0x2c')]=_[_0xceeb('0x2b')](_0x2e5d0c[_0xceeb('0x2c')]);_0x6492b0[_0xceeb('0x2d')]=_[_0xceeb('0x2e')](_0x6492b0[_0xceeb('0x2a')],_0x6492b0[_0xceeb('0x2c')]);_0x3adc8a[_0xceeb('0x2f')]=_[_0xceeb('0x2e')](_0x6492b0['model'],qs['fields'](_0x2e5d0c[_0xceeb('0x2c')]['fields']));_0x3adc8a[_0xceeb('0x2f')]=_0x3adc8a['attributes'][_0xceeb('0x30')]?_0x3adc8a['attributes']:_0x6492b0[_0xceeb('0x2a')];if(!_0x2e5d0c[_0xceeb('0x2c')][_0xceeb('0x31')]('nolimit')){_0x3adc8a[_0xceeb('0x32')]=qs[_0xceeb('0x32')](_0x2e5d0c[_0xceeb('0x2c')][_0xceeb('0x32')]);_0x3adc8a[_0xceeb('0x1b')]=qs['offset'](_0x2e5d0c[_0xceeb('0x2c')][_0xceeb('0x1b')]);}_0x3adc8a['order']=qs[_0xceeb('0x33')](_0x2e5d0c['query'][_0xceeb('0x33')]);_0x3adc8a[_0xceeb('0x34')]=qs[_0xceeb('0x2d')](_[_0xceeb('0x35')](_0x2e5d0c[_0xceeb('0x2c')],_0x6492b0[_0xceeb('0x2d')]));if(_0x2e5d0c[_0xceeb('0x2c')][_0xceeb('0x36')]){_0x3adc8a[_0xceeb('0x34')]=_['merge'](_0x3adc8a['where'],{'$or':_[_0xceeb('0x37')](_0x35ba25,function(_0x3837df){if(_0x3837df[_0xceeb('0x38')]['key']!==_0xceeb('0x39')){var _0x5f4510={};_0x5f4510[_0x3837df[_0xceeb('0x3a')]]={'$like':'%'+_0x2e5d0c[_0xceeb('0x2c')][_0xceeb('0x36')]+'%'};return _0x5f4510;}})});}_0x3adc8a=_[_0xceeb('0x3b')]({},_0x3adc8a,_0x2e5d0c[_0xceeb('0x3c')]);var _0x475a62={'where':_0x3adc8a[_0xceeb('0x34')]};return db[_0xceeb('0x28')][_0xceeb('0x1a')](_0x475a62)[_0xceeb('0x21')](function(_0x841763){_0x49a641[_0xceeb('0x1a')]=_0x841763;if(_0x2e5d0c[_0xceeb('0x2c')]['includeAll']){_0x3adc8a[_0xceeb('0x3d')]=[{'all':!![]}];}return db[_0xceeb('0x28')][_0xceeb('0x3e')](_0x3adc8a);})[_0xceeb('0x21')](function(_0x123fdc){_0x49a641[_0xceeb('0x3f')]=_0x123fdc;return _0x49a641;})[_0xceeb('0x21')](respondWithFilteredResult(_0x955b3b,_0x3adc8a))[_0xceeb('0x40')](handleError(_0x955b3b,null));};exports[_0xceeb('0x41')]=function(_0x51c65e,_0x3885b1){var _0x378ce1={'raw':!![],'where':{'id':_0x51c65e[_0xceeb('0x42')]['id']}},_0x5bb864={};_0x5bb864['model']=_[_0xceeb('0x2b')](db['ChatTransferReport'][_0xceeb('0x29')]);_0x5bb864[_0xceeb('0x2c')]=_['keys'](_0x51c65e['query']);_0x5bb864[_0xceeb('0x2d')]=_['intersection'](_0x5bb864[_0xceeb('0x2a')],_0x5bb864[_0xceeb('0x2c')]);_0x378ce1[_0xceeb('0x2f')]=_[_0xceeb('0x2e')](_0x5bb864[_0xceeb('0x2a')],qs[_0xceeb('0x43')](_0x51c65e[_0xceeb('0x2c')][_0xceeb('0x43')]));_0x378ce1[_0xceeb('0x2f')]=_0x378ce1[_0xceeb('0x2f')]['length']?_0x378ce1[_0xceeb('0x2f')]:_0x5bb864[_0xceeb('0x2a')];if(_0x51c65e[_0xceeb('0x2c')][_0xceeb('0x44')]){_0x378ce1[_0xceeb('0x3d')]=[{'all':!![]}];}_0x378ce1=_[_0xceeb('0x3b')]({},_0x378ce1,_0x51c65e[_0xceeb('0x3c')]);return db[_0xceeb('0x28')]['find'](_0x378ce1)[_0xceeb('0x21')](handleEntityNotFound(_0x3885b1,null))[_0xceeb('0x21')](respondWithResult(_0x3885b1,null))[_0xceeb('0x40')](handleError(_0x3885b1,null));};exports[_0xceeb('0x45')]=function(_0x4f4cf1,_0x4ab6cc){return db[_0xceeb('0x28')][_0xceeb('0x45')](_0x4f4cf1['body'],{})[_0xceeb('0x21')](respondWithResult(_0x4ab6cc,0xc9))[_0xceeb('0x40')](handleError(_0x4ab6cc,null));};exports[_0xceeb('0x20')]=function(_0x9a3752,_0x3a2fcd){if(_0x9a3752[_0xceeb('0x46')]['id']){delete _0x9a3752[_0xceeb('0x46')]['id'];}return db['ChatTransferReport'][_0xceeb('0x47')]({'where':{'id':_0x9a3752[_0xceeb('0x42')]['id']}})[_0xceeb('0x21')](handleEntityNotFound(_0x3a2fcd,null))[_0xceeb('0x21')](saveUpdates(_0x9a3752['body'],null))['then'](respondWithResult(_0x3a2fcd,null))[_0xceeb('0x40')](handleError(_0x3a2fcd,null));};exports['destroy']=function(_0x350064,_0x5f0713){return db[_0xceeb('0x28')][_0xceeb('0x47')]({'where':{'id':_0x350064[_0xceeb('0x42')]['id']}})[_0xceeb('0x21')](handleEntityNotFound(_0x5f0713,null))['then'](removeEntity(_0x5f0713,null))[_0xceeb('0x40')](handleError(_0x5f0713,null));};exports[_0xceeb('0x48')]=function(_0x4a1980,_0x1ee455){return db[_0xceeb('0x28')][_0xceeb('0x48')]()[_0xceeb('0x21')](respondWithResult(_0x1ee455,null))[_0xceeb('0x40')](handleError(_0x1ee455,null));}; \ No newline at end of file +var _0x3464=['count','include','rows','catch','show','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','type','key','VIRTUAL','field','ChatTransferReport'];(function(_0x10ab83,_0x42e8de){var _0x18a095=function(_0x2035fe){while(--_0x2035fe){_0x10ab83['push'](_0x10ab83['shift']());}};_0x18a095(++_0x42e8de);}(_0x3464,0x16e));var _0x4346=function(_0x4885dd,_0x2c3026){_0x4885dd=_0x4885dd-0x0;var _0x21d9c6=_0x3464[_0x4885dd];return _0x21d9c6;};'use strict';var pdf=require(_0x4346('0x0'));var emlformat=require(_0x4346('0x1'));var rimraf=require(_0x4346('0x2'));var zipdir=require(_0x4346('0x3'));var jsonpatch=require(_0x4346('0x4'));var rp=require(_0x4346('0x5'));var moment=require(_0x4346('0x6'));var BPromise=require(_0x4346('0x7'));var Mustache=require(_0x4346('0x8'));var util=require(_0x4346('0x9'));var path=require(_0x4346('0xa'));var sox=require('sox');var csv=require(_0x4346('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4346('0xc'));var squel=require(_0x4346('0xd'));var crypto=require(_0x4346('0xe'));var jsforce=require(_0x4346('0xf'));var deskjs=require(_0x4346('0x10'));var toCsv=require(_0x4346('0xb'));var querystring=require(_0x4346('0x11'));var Papa=require(_0x4346('0x12'));var Redis=require(_0x4346('0x13'));var authService=require(_0x4346('0x14'));var qs=require(_0x4346('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4346('0x16'))(_0x4346('0x17'));var utils=require('../../config/utils');var config=require(_0x4346('0x18'));var db=require(_0x4346('0x19'))['db'];function respondWithStatusCode(_0x1a5aed,_0x8f1efa){_0x8f1efa=_0x8f1efa||0xcc;return function(_0x5284bd){if(_0x5284bd){return _0x1a5aed['sendStatus'](_0x8f1efa);}return _0x1a5aed[_0x4346('0x1a')](_0x8f1efa)[_0x4346('0x1b')]();};}function respondWithResult(_0x11f1ca,_0x2e65f5){_0x2e65f5=_0x2e65f5||0xc8;return function(_0x279beb){if(_0x279beb){return _0x11f1ca[_0x4346('0x1a')](_0x2e65f5)[_0x4346('0x1c')](_0x279beb);}};}function respondWithFilteredResult(_0x3d6838,_0xeab39){return function(_0x252c1d){if(_0x252c1d){var _0x743fe=_0x252c1d['count'],_0x42225a=_0xeab39[_0x4346('0x1d')],_0x445b70=_0xeab39[_0x4346('0x1d')]+_0xeab39[_0x4346('0x1e')],_0x5ec9ff;if(_0x445b70>=_0x743fe){_0x445b70=_0x743fe;_0x5ec9ff=0xc8;}else{_0x5ec9ff=0xce;}_0x3d6838['status'](_0x5ec9ff);return _0x3d6838[_0x4346('0x1f')]('Content-Range',_0x42225a+'-'+_0x445b70+'/'+_0x743fe)[_0x4346('0x1c')](_0x252c1d);}return null;};}function patchUpdates(_0x54a61d){return function(_0x31abd0){try{jsonpatch['apply'](_0x31abd0,_0x54a61d,!![]);}catch(_0x58778c){return BPromise[_0x4346('0x20')](_0x58778c);}return _0x31abd0[_0x4346('0x21')]();};}function saveUpdates(_0x294b5e,_0x507e4d){return function(_0x5eaccb){if(_0x5eaccb){return _0x5eaccb[_0x4346('0x22')](_0x294b5e)[_0x4346('0x23')](function(_0x3ccfbb){return _0x3ccfbb;});}return null;};}function removeEntity(_0x17db19,_0x7869fc){return function(_0x6e44a1){if(_0x6e44a1){return _0x6e44a1[_0x4346('0x24')]()[_0x4346('0x23')](function(){_0x17db19[_0x4346('0x1a')](0xcc)[_0x4346('0x1b')]();});}};}function handleEntityNotFound(_0x2ff0f9,_0x74a500){return function(_0x182519){if(!_0x182519){_0x2ff0f9[_0x4346('0x25')](0x194);}return _0x182519;};}function handleError(_0x2b7851,_0x3da5c5){_0x3da5c5=_0x3da5c5||0x1f4;return function(_0x4331c2){logger[_0x4346('0x26')](_0x4331c2[_0x4346('0x27')]);if(_0x4331c2[_0x4346('0x28')]){delete _0x4331c2[_0x4346('0x28')];}_0x2b7851[_0x4346('0x1a')](_0x3da5c5)['send'](_0x4331c2);};}exports['index']=function(_0x14573e,_0x228c36){var _0x5db055={},_0x572e22={},_0x1d71df={'count':0x0,'rows':[]};var _0xa822e8=db['ChatTransferReport'][_0x4346('0x29')];_0x572e22[_0x4346('0x2a')]=_[_0x4346('0x2b')](_0xa822e8);_0x572e22[_0x4346('0x2c')]=_['keys'](_0x14573e['query']);_0x572e22[_0x4346('0x2d')]=_[_0x4346('0x2e')](_0x572e22[_0x4346('0x2a')],_0x572e22[_0x4346('0x2c')]);_0x5db055['attributes']=_[_0x4346('0x2e')](_0x572e22[_0x4346('0x2a')],qs[_0x4346('0x2f')](_0x14573e[_0x4346('0x2c')][_0x4346('0x2f')]));_0x5db055[_0x4346('0x30')]=_0x5db055['attributes'][_0x4346('0x31')]?_0x5db055[_0x4346('0x30')]:_0x572e22[_0x4346('0x2a')];if(!_0x14573e[_0x4346('0x2c')][_0x4346('0x32')]('nolimit')){_0x5db055[_0x4346('0x1e')]=qs[_0x4346('0x1e')](_0x14573e['query']['limit']);_0x5db055[_0x4346('0x1d')]=qs[_0x4346('0x1d')](_0x14573e[_0x4346('0x2c')][_0x4346('0x1d')]);}_0x5db055[_0x4346('0x33')]=qs['sort'](_0x14573e[_0x4346('0x2c')]['sort']);_0x5db055[_0x4346('0x34')]=qs[_0x4346('0x2d')](_['pick'](_0x14573e[_0x4346('0x2c')],_0x572e22[_0x4346('0x2d')]));if(_0x14573e[_0x4346('0x2c')][_0x4346('0x35')]){_0x5db055[_0x4346('0x34')]=_[_0x4346('0x36')](_0x5db055[_0x4346('0x34')],{'$or':_['map'](_0xa822e8,function(_0x43e0a0){if(_0x43e0a0[_0x4346('0x37')][_0x4346('0x38')]!==_0x4346('0x39')){var _0x1e90aa={};_0x1e90aa[_0x43e0a0[_0x4346('0x3a')]]={'$like':'%'+_0x14573e[_0x4346('0x2c')][_0x4346('0x35')]+'%'};return _0x1e90aa;}})});}_0x5db055=_[_0x4346('0x36')]({},_0x5db055,_0x14573e['options']);var _0x6e41e0={'where':_0x5db055[_0x4346('0x34')]};return db[_0x4346('0x3b')][_0x4346('0x3c')](_0x6e41e0)[_0x4346('0x23')](function(_0x374c37){_0x1d71df[_0x4346('0x3c')]=_0x374c37;if(_0x14573e['query']['includeAll']){_0x5db055[_0x4346('0x3d')]=[{'all':!![]}];}return db[_0x4346('0x3b')]['findAll'](_0x5db055);})[_0x4346('0x23')](function(_0x54ab78){_0x1d71df[_0x4346('0x3e')]=_0x54ab78;return _0x1d71df;})[_0x4346('0x23')](respondWithFilteredResult(_0x228c36,_0x5db055))[_0x4346('0x3f')](handleError(_0x228c36,null));};exports[_0x4346('0x40')]=function(_0x55ca34,_0x424269){var _0x2bd455={'raw':!![],'where':{'id':_0x55ca34[_0x4346('0x41')]['id']}},_0x1f1a08={};_0x1f1a08[_0x4346('0x2a')]=_[_0x4346('0x2b')](db['ChatTransferReport'][_0x4346('0x29')]);_0x1f1a08[_0x4346('0x2c')]=_[_0x4346('0x2b')](_0x55ca34[_0x4346('0x2c')]);_0x1f1a08[_0x4346('0x2d')]=_[_0x4346('0x2e')](_0x1f1a08['model'],_0x1f1a08[_0x4346('0x2c')]);_0x2bd455[_0x4346('0x30')]=_[_0x4346('0x2e')](_0x1f1a08[_0x4346('0x2a')],qs[_0x4346('0x2f')](_0x55ca34['query'][_0x4346('0x2f')]));_0x2bd455[_0x4346('0x30')]=_0x2bd455['attributes'][_0x4346('0x31')]?_0x2bd455[_0x4346('0x30')]:_0x1f1a08['model'];if(_0x55ca34[_0x4346('0x2c')]['includeAll']){_0x2bd455[_0x4346('0x3d')]=[{'all':!![]}];}_0x2bd455=_[_0x4346('0x36')]({},_0x2bd455,_0x55ca34[_0x4346('0x42')]);return db['ChatTransferReport'][_0x4346('0x43')](_0x2bd455)[_0x4346('0x23')](handleEntityNotFound(_0x424269,null))[_0x4346('0x23')](respondWithResult(_0x424269,null))[_0x4346('0x3f')](handleError(_0x424269,null));};exports[_0x4346('0x44')]=function(_0x3a9d7d,_0x3deedb){return db[_0x4346('0x3b')]['create'](_0x3a9d7d[_0x4346('0x45')],{})[_0x4346('0x23')](respondWithResult(_0x3deedb,0xc9))[_0x4346('0x3f')](handleError(_0x3deedb,null));};exports[_0x4346('0x22')]=function(_0x54b71a,_0x11abcb){if(_0x54b71a[_0x4346('0x45')]['id']){delete _0x54b71a[_0x4346('0x45')]['id'];}return db[_0x4346('0x3b')][_0x4346('0x43')]({'where':{'id':_0x54b71a[_0x4346('0x41')]['id']}})[_0x4346('0x23')](handleEntityNotFound(_0x11abcb,null))['then'](saveUpdates(_0x54b71a[_0x4346('0x45')],null))[_0x4346('0x23')](respondWithResult(_0x11abcb,null))[_0x4346('0x3f')](handleError(_0x11abcb,null));};exports[_0x4346('0x24')]=function(_0x4b1a39,_0x472a6d){return db[_0x4346('0x3b')][_0x4346('0x43')]({'where':{'id':_0x4b1a39[_0x4346('0x41')]['id']}})[_0x4346('0x23')](handleEntityNotFound(_0x472a6d,null))['then'](removeEntity(_0x472a6d,null))['catch'](handleError(_0x472a6d,null));};exports[_0x4346('0x46')]=function(_0x283493,_0xcd983f){return db[_0x4346('0x3b')][_0x4346('0x46')]()[_0x4346('0x23')](respondWithResult(_0xcd983f,null))[_0x4346('0x3f')](handleError(_0xcd983f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 229962e..c1aff47 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 _0x0e21=['define','ChatTransferReport','uniqueid','lodash','moment','bluebird','request-promise','./chatTransferReport.attributes','exports'];(function(_0x428426,_0x306a8a){var _0x2dc25b=function(_0x3c8aae){while(--_0x3c8aae){_0x428426['push'](_0x428426['shift']());}};_0x2dc25b(++_0x306a8a);}(_0x0e21,0x159));var _0x10e2=function(_0x4c6fec,_0xcd96f0){_0x4c6fec=_0x4c6fec-0x0;var _0x1ad284=_0x0e21[_0x4c6fec];return _0x1ad284;};'use strict';var _=require(_0x10e2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x10e2('0x1'));var BPromise=require(_0x10e2('0x2'));var rp=require(_0x10e2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x10e2('0x4'));module[_0x10e2('0x5')]=function(_0x147e05,_0x191636){return _0x147e05[_0x10e2('0x6')](_0x10e2('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x10e2('0x8'),'fields':[_0x10e2('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa98b=['define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x555552,_0x576279){var _0x5b280d=function(_0x2ef8ef){while(--_0x2ef8ef){_0x555552['push'](_0x555552['shift']());}};_0x5b280d(++_0x576279);}(_0xa98b,0x16f));var _0xba98=function(_0x4fbac0,_0x560e01){_0x4fbac0=_0x4fbac0-0x0;var _0x3d9d3f=_0xa98b[_0x4fbac0];return _0x3d9d3f;};'use strict';var _=require(_0xba98('0x0'));var util=require(_0xba98('0x1'));var logger=require(_0xba98('0x2'))(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var rp=require(_0xba98('0x6'));var fs=require('fs');var path=require(_0xba98('0x7'));var rimraf=require(_0xba98('0x8'));var config=require(_0xba98('0x9'));var attributes=require(_0xba98('0xa'));module['exports']=function(_0x41891f,_0x24205e){return _0x41891f[_0xba98('0xb')]('ChatTransferReport',attributes,{'tableName':_0xba98('0xc'),'paranoid':![],'indexes':[{'name':_0xba98('0xd'),'fields':[_0xba98('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 4557f35..4c172d7 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 _0x48ea=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4a2b88,_0x2b9e95){var _0x3deed8=function(_0x28caad){while(--_0x28caad){_0x4a2b88['push'](_0x4a2b88['shift']());}};_0x3deed8(++_0x2b9e95);}(_0x48ea,0x9c));var _0xa48e=function(_0x53c727,_0x23d986){_0x53c727=_0x53c727-0x0;var _0x584c22=_0x48ea[_0x53c727];return _0x584c22;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var moment=require(_0xa48e('0x1'));var BPromise=require(_0xa48e('0x2'));var rs=require(_0xa48e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa48e('0x4'));var logger=require('../../config/logger')(_0xa48e('0x5'));var config=require(_0xa48e('0x6'));var jayson=require(_0xa48e('0x7'));var client=jayson[_0xa48e('0x8')][_0xa48e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405033,_0x5213e5,_0x143004){return new BPromise(function(_0x3bdc25,_0x170ffc){return client[_0xa48e('0xa')](_0x405033,_0x143004)[_0xa48e('0xb')](function(_0x3ad947){logger[_0xa48e('0xc')](_0xa48e('0xd'),_0x5213e5,'request\x20sent');logger[_0xa48e('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5213e5,'request\x20sent',JSON['stringify'](_0x3ad947));if(_0x3ad947[_0xa48e('0xf')]){if(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x10')]===0x1f4){logger[_0xa48e('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5213e5,_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);return _0x170ffc(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);}logger[_0xa48e('0xf')](_0xa48e('0xd'),_0x5213e5,_0x3ad947[_0xa48e('0xf')]['message']);return _0x3bdc25(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);}else{logger[_0xa48e('0xc')](_0xa48e('0xd'),_0x5213e5,'request\x20sent');_0x3bdc25(_0x3ad947[_0xa48e('0x12')][_0xa48e('0x11')]);}})[_0xa48e('0x13')](function(_0x28c15c){logger[_0xa48e('0xf')](_0xa48e('0xd'),_0x5213e5,_0x28c15c);_0x170ffc(_0x28c15c);});});} \ No newline at end of file +var _0xe0dc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe0dc,0x77));var _0xce0d=function(_0x4f526c,_0x6c4dbe){_0x4f526c=_0x4f526c-0x0;var _0x38a51e=_0xe0dc[_0x4f526c];return _0x38a51e;};'use strict';var _=require('lodash');var util=require(_0xce0d('0x0'));var moment=require(_0xce0d('0x1'));var BPromise=require(_0xce0d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce0d('0x3'));var db=require(_0xce0d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce0d('0x5'))(_0xce0d('0x6'));var config=require(_0xce0d('0x7'));var jayson=require(_0xce0d('0x8'));var client=jayson[_0xce0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2af3f4,_0x3c9bd5,_0x2d8919){return new BPromise(function(_0x267b83,_0x374cd8){return client['request'](_0x2af3f4,_0x2d8919)[_0xce0d('0xa')](function(_0x13da9c){logger[_0xce0d('0xb')](_0xce0d('0xc'),_0x3c9bd5,_0xce0d('0xd'));logger[_0xce0d('0xe')](_0xce0d('0xf'),_0x3c9bd5,'request\x20sent',JSON['stringify'](_0x13da9c));if(_0x13da9c[_0xce0d('0x10')]){if(_0x13da9c[_0xce0d('0x10')][_0xce0d('0x11')]===0x1f4){logger['error'](_0xce0d('0xc'),_0x3c9bd5,_0x13da9c[_0xce0d('0x10')][_0xce0d('0x12')]);return _0x374cd8(_0x13da9c[_0xce0d('0x10')][_0xce0d('0x12')]);}logger[_0xce0d('0x10')](_0xce0d('0xc'),_0x3c9bd5,_0x13da9c[_0xce0d('0x10')][_0xce0d('0x12')]);return _0x267b83(_0x13da9c[_0xce0d('0x10')][_0xce0d('0x12')]);}else{logger[_0xce0d('0xb')](_0xce0d('0xc'),_0x3c9bd5,_0xce0d('0xd'));_0x267b83(_0x13da9c['result'][_0xce0d('0x12')]);}})[_0xce0d('0x13')](function(_0x1ac9aa){logger[_0xce0d('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3c9bd5,_0x1ac9aa);_0x374cd8(_0x1ac9aa);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index e73e615..ca59f8e 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 _0x7274=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x506002,_0x17ad62){var _0x5a020c=function(_0xf907bc){while(--_0xf907bc){_0x506002['push'](_0x506002['shift']());}};_0x5a020c(++_0x17ad62);}(_0x7274,0xd3));var _0x4727=function(_0x5cd3ca,_0x39a78f){_0x5cd3ca=_0x5cd3ca-0x0;var _0x553c11=_0x7274[_0x5cd3ca];return _0x553c11;};'use strict';var multer=require('multer');var util=require(_0x4727('0x0'));var path=require(_0x4727('0x1'));var timeout=require(_0x4727('0x2'));var express=require(_0x4727('0x3'));var router=express['Router']();var auth=require(_0x4727('0x4'));var interaction=require(_0x4727('0x5'));var config=require(_0x4727('0x6'));var controller=require(_0x4727('0x7'));router[_0x4727('0x8')]('/',auth[_0x4727('0x9')](),controller[_0x4727('0xa')]);router[_0x4727('0x8')]('/describe',auth[_0x4727('0x9')](),controller['describe']);router[_0x4727('0x8')](_0x4727('0xb'),auth[_0x4727('0x9')](),controller[_0x4727('0xc')]);router[_0x4727('0xd')]('/',auth[_0x4727('0x9')](),controller[_0x4727('0xe')]);router[_0x4727('0xf')](_0x4727('0xb'),auth[_0x4727('0x9')](),controller[_0x4727('0x10')]);router[_0x4727('0x11')](_0x4727('0xb'),auth[_0x4727('0x9')](),controller[_0x4727('0x12')]);module[_0x4727('0x13')]=router; \ No newline at end of file +var _0xfa91=['express','Router','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x595a4e,_0x28948a){var _0x271e39=function(_0x3efb27){while(--_0x3efb27){_0x595a4e['push'](_0x595a4e['shift']());}};_0x271e39(++_0x28948a);}(_0xfa91,0xc3));var _0x1fa9=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xfa91[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x1fa9('0x0'));var util=require('util');var path=require(_0x1fa9('0x1'));var timeout=require(_0x1fa9('0x2'));var express=require(_0x1fa9('0x3'));var router=express[_0x1fa9('0x4')]();var auth=require(_0x1fa9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1fa9('0x6'));router[_0x1fa9('0x7')]('/',auth[_0x1fa9('0x8')](),controller[_0x1fa9('0x9')]);router[_0x1fa9('0x7')](_0x1fa9('0xa'),auth[_0x1fa9('0x8')](),controller[_0x1fa9('0xb')]);router['get'](_0x1fa9('0xc'),auth[_0x1fa9('0x8')](),controller['show']);router[_0x1fa9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1fa9('0xe')](_0x1fa9('0xc'),auth[_0x1fa9('0x8')](),controller['update']);router[_0x1fa9('0xf')](_0x1fa9('0xc'),auth[_0x1fa9('0x8')](),controller[_0x1fa9('0x10')]);module[_0x1fa9('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 5b8681e..f31302b 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 _0x0e30=['stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input','name','text','email','getDataValue','onlineForm','parse','setDataValue'];(function(_0x53d757,_0x4be50e){var _0x15c1c4=function(_0x12ce44){while(--_0x12ce44){_0x53d757['push'](_0x53d757['shift']());}};_0x15c1c4(++_0x4be50e);}(_0x0e30,0x150));var _0x00e3=function(_0x931e28,_0x3dcfb4){_0x931e28=_0x931e28-0x0;var _0x4e6d25=_0x0e30[_0x931e28];return _0x4e6d25;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x00e3('0x0'));module[_0x00e3('0x1')]={'name':{'type':Sequelize[_0x00e3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x00e3('0x2')],'allowNull':![],'unique':_0x00e3('0x3')},'description':{'type':Sequelize[_0x00e3('0x2')]},'mapKey':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x4')},'customerAlias':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x00e3('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x00e3('0x2')],'allowNull':![],'defaultValue':_0x00e3('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x00e3('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x00e3('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x00e3('0x2')]},'animation':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x00e3('0x9')](_0x00e3('0xa'),_0x00e3('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0xc')},'start_chat_button':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0xe')},'header_offline':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0xf')},'download_transcript':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x00e3('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x00e3('0x11')]},'closingQuestion':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x14')},'noteTitle':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x15')},'placeholderMessage':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0x17')},'closingMessageButton':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0x18')},'conditionAgreement':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0x00e3('0x19'),_0x00e3('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x00e3('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x00e3('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x00e3('0x1b'),'variable':null,'config':{'placeholder':_0x00e3('0x1c'),'type':_0x00e3('0x1d'),'required':!![]},'props':{'title':_0x00e3('0x1c'),'helpText':''}},{'type':_0x00e3('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x00e3('0x1e'),'type':_0x00e3('0x1e')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x00e3('0x1f')](_0x00e3('0x20'))?JSON[_0x00e3('0x21')](this[_0x00e3('0x1f')]('onlineForm')):{};},'set':function(_0x153ee5){return this[_0x00e3('0x22')](_0x00e3('0x20'),JSON[_0x00e3('0x23')](_0x153ee5));}},'offlineForm':{'type':Sequelize[_0x00e3('0x11')],'defaultValue':function(){return JSON[_0x00e3('0x23')]({'items':[{'type':_0x00e3('0x1b'),'props':{'title':_0x00e3('0x1e'),'helpText':''},'config':{'required':!![],'placeholder':_0x00e3('0x1e'),'type':_0x00e3('0x1e')},'variable':null},{'type':_0x00e3('0x24'),'config':{'placeholder':_0x00e3('0x25')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x00e3('0x1f')](_0x00e3('0x26'))?JSON[_0x00e3('0x21')](this['getDataValue'](_0x00e3('0x26'))):{};},'set':function(_0x2c4513){return this['setDataValue'](_0x00e3('0x26'),JSON[_0x00e3('0x23')](_0x2c4513));}},'token':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':function(){return rs[_0x00e3('0x27')]();}},'autoclose':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x00e3('0x2')]},'forwardOffline':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x28')},'waitingMessage':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x29')},'offlineMessageSubject':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x00e3('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x00e3('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x00e3('0x2b');}},'notificationSound':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x00e3('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x00e3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x2d')},'verticalAlignment':{'type':Sequelize[_0x00e3('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x00e3('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x00e3('0x2')],'allowNull':![],'defaultValue':_0x00e3('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x00e3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x00e3('0x2')],'defaultValue':_0x00e3('0x30')},'systemAvatar':{'type':Sequelize[_0x00e3('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x00e3('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x00e3('0x8')],'defaultValue':![],'comment':_0x00e3('0x32'),'set':function(_0x20dba2){if(!_0x20dba2)this[_0x00e3('0x22')](_0x00e3('0x33'),null);this[_0x00e3('0x22')](_0x00e3('0x34'),_0x20dba2);}}}; \ No newline at end of file +var _0x0d40=['bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','stringify','input','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x3f0efb,_0x1c3712){var _0x4b3231=function(_0x520ea8){while(--_0x520ea8){_0x3f0efb['push'](_0x3f0efb['shift']());}};_0x4b3231(++_0x1c3712);}(_0x0d40,0xbb));var _0x00d4=function(_0x39ab14,_0x1c6d59){_0x39ab14=_0x39ab14-0x0;var _0x5a661e=_0x0d40[_0x39ab14];return _0x5a661e;};'use strict';var Sequelize=require(_0x00d4('0x0'));var rs=require(_0x00d4('0x1'));module[_0x00d4('0x2')]={'name':{'type':Sequelize[_0x00d4('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x00d4('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x6')},'customerAlias':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x00d4('0x3')],'allowNull':![],'defaultValue':_0x00d4('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x00d4('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x00d4('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x00d4('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x00d4('0x3')]},'animation':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0x00d4('0xa')},'header_online':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0xb')},'start_chat_button':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0xc')},'header_offline':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x00d4('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x00d4('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x11')},'noteTitle':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0xc')},'skipMessageButton':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x14')},'conditionAgreement':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x00d4('0x15')](_0x00d4('0x16'),_0x00d4('0x17')),'defaultValue':_0x00d4('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x00d4('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x00d4('0xe')],'defaultValue':function(){return JSON[_0x00d4('0x18')]({'items':[{'type':_0x00d4('0x19'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x00d4('0x19'),'props':{'title':_0x00d4('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x00d4('0x5'),'type':_0x00d4('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x00d4('0x1a')](_0x00d4('0x1b'))?JSON[_0x00d4('0x1c')](this[_0x00d4('0x1a')]('onlineForm')):{};},'set':function(_0x444a32){return this['setDataValue']('onlineForm',JSON[_0x00d4('0x18')](_0x444a32));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x00d4('0x19'),'props':{'title':_0x00d4('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x00d4('0x5'),'type':_0x00d4('0x5')},'variable':null},{'type':_0x00d4('0x1d'),'config':{'placeholder':_0x00d4('0x1e')},'props':{'title':'Comments','helpText':_0x00d4('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x00d4('0x1a')](_0x00d4('0x20'))?JSON['parse'](this[_0x00d4('0x1a')](_0x00d4('0x20'))):{};},'set':function(_0x54e4ee){return this['setDataValue']('offlineForm',JSON[_0x00d4('0x18')](_0x54e4ee));}},'token':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':function(){return rs[_0x00d4('0x21')]();}},'autoclose':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x00d4('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x22')},'offlineMessageBody':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x00d4('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x00d4('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x00d4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x00d4('0xe')],'defaultValue':function(){return _0x00d4('0x25');}},'notificationSound':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x26')},'verticalAlignment':{'type':Sequelize[_0x00d4('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x27')},'defaultTitle':{'type':Sequelize[_0x00d4('0x3')]},'customerAvatar':{'type':Sequelize[_0x00d4('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x00d4('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x00d4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x00d4('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x00d4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x00d4('0x3')],'defaultValue':_0x00d4('0x28')},'systemAvatar':{'type':Sequelize[_0x00d4('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x00d4('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x00d4('0x29'),'set':function(_0x4bdd4f){if(!_0x4bdd4f)this[_0x00d4('0x2a')](_0x00d4('0x2b'),null);this[_0x00d4('0x2a')](_0x00d4('0x2c'),_0x4bdd4f);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0cdad6a..720ae3a 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 _0xfc4c=['getAnswers','nolimit','rows','removeAnswers','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','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','CmList','List','Contacts','ChatApplication','account','applications','Applications','orderBy','priority','asc','contact','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','vendor','device','type','threadId','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','utf8','render','toPairs','offlineMessageBody','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','remote','headers','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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','limit','set','Content-Range','apply','reject','save','update','get','ChatWebsites','destroy','stack','name','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','filters','intersection','attributes','length','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter','count','include','findAll','show','params','Pause','includeAll','find','create','body','user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','fields','hasOwnProperty','ChatWebsiteId','options','removeDispositions','ids','CannedAnswer'];(function(_0x6aaf7a,_0x2ddf35){var _0x522e20=function(_0x5b6e19){while(--_0x5b6e19){_0x6aaf7a['push'](_0x6aaf7a['shift']());}};_0x522e20(++_0x2ddf35);}(_0xfc4c,0x1c0));var _0xcfc4=function(_0x15f02a,_0x13a522){_0x15f02a=_0x15f02a-0x0;var _0x14237c=_0xfc4c[_0x15f02a];return _0x14237c;};'use strict';var pdf=require(_0xcfc4('0x0'));var emlformat=require(_0xcfc4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcfc4('0x2'));var moment=require(_0xcfc4('0x3'));var BPromise=require(_0xcfc4('0x4'));var Mustache=require(_0xcfc4('0x5'));var util=require('util');var path=require(_0xcfc4('0x6'));var sox=require(_0xcfc4('0x7'));var csv=require('to-csv');var ejs=require(_0xcfc4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcfc4('0x9'));var crypto=require(_0xcfc4('0xa'));var jsforce=require(_0xcfc4('0xb'));var deskjs=require(_0xcfc4('0xc'));var toCsv=require(_0xcfc4('0xd'));var querystring=require(_0xcfc4('0xe'));var Papa=require(_0xcfc4('0xf'));var Redis=require(_0xcfc4('0x10'));var authService=require(_0xcfc4('0x11'));var qs=require(_0xcfc4('0x12'));var hardwareService=require(_0xcfc4('0x13'));var logger=require(_0xcfc4('0x14'))('api');var utils=require(_0xcfc4('0x15'));var config=require(_0xcfc4('0x16'));var db=require(_0xcfc4('0x17'))['db'];config[_0xcfc4('0x18')]=_[_0xcfc4('0x19')](config[_0xcfc4('0x18')],{'host':_0xcfc4('0x1a'),'port':0x18eb});var socket=require(_0xcfc4('0x1b'))(new Redis(config[_0xcfc4('0x18')]));require(_0xcfc4('0x1c'))[_0xcfc4('0x1d')](socket);var jayson=require(_0xcfc4('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xcfc4('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0xcfc4('0x1f')][_0xcfc4('0x20')]({'port':0x232b});function checkPasswordPattern(_0x27f5b4,_0x35e090,_0x2edd69){if(_0x2edd69){var _0xf55eb3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf55eb3[_0xcfc4('0x21')](_0x35e090)){return _0x27f5b4;}else{throw new Error(_0xcfc4('0x22'));}}else{return _0x27f5b4;}}function respondWithRpcPromise(_0x345202,_0x44c302,_0x34fa5f,_0x1c385e){return new BPromise(function(_0x3af31e,_0xc6dad0){var _0x38c8ac=_0x1c385e||client;return _0x38c8ac['request'](_0x345202,_0x34fa5f)[_0xcfc4('0x23')](function(_0x6aa88e){logger[_0xcfc4('0x24')](_0xcfc4('0x25'),_0x44c302,_0xcfc4('0x26'));logger[_0xcfc4('0x27')](_0xcfc4('0x28'),_0x44c302,_0xcfc4('0x26'),JSON[_0xcfc4('0x29')](_0x6aa88e));if(_0x6aa88e[_0xcfc4('0x2a')]){if(_0x6aa88e[_0xcfc4('0x2a')]['code']===0x1f4){logger[_0xcfc4('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x44c302,_0x6aa88e['error']['message']);return _0xc6dad0(_0x6aa88e['error'][_0xcfc4('0x2b')]);}logger[_0xcfc4('0x2a')](_0xcfc4('0x25'),_0x44c302,_0x6aa88e['error']['message']);return _0x3af31e(_0x6aa88e[_0xcfc4('0x2a')][_0xcfc4('0x2b')]);}else{logger[_0xcfc4('0x24')](_0xcfc4('0x25'),_0x44c302,'request\x20sent');_0x3af31e(_0x6aa88e[_0xcfc4('0x2c')][_0xcfc4('0x2b')]);}})[_0xcfc4('0x2d')](function(_0x21af1f){logger[_0xcfc4('0x2a')](_0xcfc4('0x25'),_0x44c302,_0x21af1f);_0xc6dad0(_0x21af1f);});});}function respondWithStatusCode(_0xf7022e,_0x3d59a5){_0x3d59a5=_0x3d59a5||0xcc;return function(_0x51b9e3){if(_0x51b9e3){return _0xf7022e[_0xcfc4('0x2e')](_0x3d59a5);}return _0xf7022e[_0xcfc4('0x2f')](_0x3d59a5)[_0xcfc4('0x30')]();};}function respondWithResult(_0x368ace,_0x2cb18e){_0x2cb18e=_0x2cb18e||0xc8;return function(_0x2f44b5){if(_0x2f44b5){return _0x368ace[_0xcfc4('0x2f')](_0x2cb18e)[_0xcfc4('0x31')](_0x2f44b5);}};}function respondWithFilteredResult(_0x33ab09,_0x123444){return function(_0x4bdbe7){if(_0x4bdbe7){var _0x22237b=_0x4bdbe7['count'],_0x551ab4=_0x123444['offset'],_0x105a77=_0x123444[_0xcfc4('0x32')]+_0x123444[_0xcfc4('0x33')],_0x1ee6b4;if(_0x105a77>=_0x22237b){_0x105a77=_0x22237b;_0x1ee6b4=0xc8;}else{_0x1ee6b4=0xce;}_0x33ab09[_0xcfc4('0x2f')](_0x1ee6b4);return _0x33ab09[_0xcfc4('0x34')](_0xcfc4('0x35'),_0x551ab4+'-'+_0x105a77+'/'+_0x22237b)[_0xcfc4('0x31')](_0x4bdbe7);}return null;};}function patchUpdates(_0x460ffb){return function(_0x33f8cc){try{jsonpatch[_0xcfc4('0x36')](_0x33f8cc,_0x460ffb,!![]);}catch(_0x569723){return BPromise[_0xcfc4('0x37')](_0x569723);}return _0x33f8cc[_0xcfc4('0x38')]();};}function saveUpdates(_0x54416a,_0x4c3c08){return function(_0x53490f){if(_0x53490f){return _0x53490f[_0xcfc4('0x39')](_0x54416a)[_0xcfc4('0x23')](function(_0x535b05){return _0x535b05;});}return null;};}function removeEntity(_0xa40a5c,_0x24138b){return function(_0x1946c2){if(_0x1946c2){return _0x1946c2['destroy']()[_0xcfc4('0x23')](function(){var _0x2af541=_0x1946c2[_0xcfc4('0x3a')]({'plain':!![]});var _0x483cc9=_0xcfc4('0x3b');return db['UserProfileResource'][_0xcfc4('0x3c')]({'where':{'type':_0x483cc9,'resourceId':_0x2af541['id']}})[_0xcfc4('0x23')](function(){return _0x1946c2;});})[_0xcfc4('0x23')](function(){_0xa40a5c[_0xcfc4('0x2f')](0xcc)[_0xcfc4('0x30')]();});}};}function handleEntityNotFound(_0x481686,_0x1e713a){return function(_0x56aa00){if(!_0x56aa00){_0x481686['sendStatus'](0x194);}return _0x56aa00;};}function handleError(_0x1598d8,_0x35ccdd){_0x35ccdd=_0x35ccdd||0x1f4;return function(_0x5b4988){logger[_0xcfc4('0x2a')](_0x5b4988[_0xcfc4('0x3d')]);if(_0x5b4988[_0xcfc4('0x3e')]){delete _0x5b4988[_0xcfc4('0x3e')];}_0x1598d8['status'](_0x35ccdd)['send'](_0x5b4988);};}exports[_0xcfc4('0x3f')]=function(_0x2f7b34,_0x83b1f0){var _0x356fed={'include':[{'model':db['Pause'],'as':_0xcfc4('0x40')}]},_0x58e002={},_0x2f4c22={'count':0x0,'rows':[]};var _0x1e23d0=db[_0xcfc4('0x41')][_0xcfc4('0x42')];_0x58e002[_0xcfc4('0x43')]=_[_0xcfc4('0x44')](_0x1e23d0);_0x58e002[_0xcfc4('0x45')]=_[_0xcfc4('0x44')](_0x2f7b34[_0xcfc4('0x45')]);_0x58e002[_0xcfc4('0x46')]=_[_0xcfc4('0x47')](_0x58e002[_0xcfc4('0x43')],_0x58e002[_0xcfc4('0x45')]);_0x356fed[_0xcfc4('0x48')]=_[_0xcfc4('0x47')](_0x58e002[_0xcfc4('0x43')],qs['fields'](_0x2f7b34[_0xcfc4('0x45')]['fields']));_0x356fed['attributes']=_0x356fed['attributes'][_0xcfc4('0x49')]?_0x356fed['attributes']:_0x58e002['model'];if(!_0x2f7b34[_0xcfc4('0x45')]['hasOwnProperty']('nolimit')){_0x356fed[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0x2f7b34[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x356fed['offset']=qs[_0xcfc4('0x32')](_0x2f7b34['query'][_0xcfc4('0x32')]);}_0x356fed[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0x2f7b34['query'][_0xcfc4('0x4b')]);_0x356fed[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0x2f7b34['query'],_0x58e002['filters']));if(_0x2f7b34[_0xcfc4('0x45')]['filter']){_0x356fed[_0xcfc4('0x4c')]=_[_0xcfc4('0x4e')](_0x356fed['where'],{'$or':_[_0xcfc4('0x4f')](_0x1e23d0,function(_0x32c032){if(_0x32c032['type'][_0xcfc4('0x50')]!==_0xcfc4('0x51')){var _0x43a1c8={};_0x43a1c8[_0x32c032[_0xcfc4('0x52')]]={'$like':'%'+_0x2f7b34[_0xcfc4('0x45')][_0xcfc4('0x53')]+'%'};return _0x43a1c8;}})});}_0x356fed=_[_0xcfc4('0x4e')]({},_0x356fed,_0x2f7b34['options']);var _0x5c90fa={'where':_0x356fed[_0xcfc4('0x4c')]};return db[_0xcfc4('0x41')][_0xcfc4('0x54')](_0x5c90fa)[_0xcfc4('0x23')](function(_0x4ef8c6){_0x2f4c22[_0xcfc4('0x54')]=_0x4ef8c6;if(_0x2f7b34[_0xcfc4('0x45')]['includeAll']){_0x356fed[_0xcfc4('0x55')]=[{'all':!![]}];}return db['ChatWebsite'][_0xcfc4('0x56')](_0x356fed);})[_0xcfc4('0x23')](function(_0x354461){_0x2f4c22['rows']=_0x354461;return _0x2f4c22;})['then'](respondWithFilteredResult(_0x83b1f0,_0x356fed))[_0xcfc4('0x2d')](handleError(_0x83b1f0,null));};exports[_0xcfc4('0x57')]=function(_0x12cd5b,_0x45a5b5){var _0x38811d={'raw':![],'where':{'id':_0x12cd5b[_0xcfc4('0x58')]['id']},'include':[{'model':db[_0xcfc4('0x59')],'as':_0xcfc4('0x40')}]},_0x589035={};_0x589035[_0xcfc4('0x43')]=_[_0xcfc4('0x44')](db['ChatWebsite'][_0xcfc4('0x42')]);_0x589035[_0xcfc4('0x45')]=_[_0xcfc4('0x44')](_0x12cd5b[_0xcfc4('0x45')]);_0x589035[_0xcfc4('0x46')]=_['intersection'](_0x589035[_0xcfc4('0x43')],_0x589035[_0xcfc4('0x45')]);_0x38811d[_0xcfc4('0x48')]=_[_0xcfc4('0x47')](_0x589035['model'],qs['fields'](_0x12cd5b[_0xcfc4('0x45')]['fields']));_0x38811d[_0xcfc4('0x48')]=_0x38811d[_0xcfc4('0x48')]['length']?_0x38811d[_0xcfc4('0x48')]:_0x589035[_0xcfc4('0x43')];if(_0x12cd5b[_0xcfc4('0x45')][_0xcfc4('0x5a')]){_0x38811d[_0xcfc4('0x55')]=[{'all':!![]}];}_0x38811d=_[_0xcfc4('0x4e')]({},_0x38811d,_0x12cd5b['options']);return db[_0xcfc4('0x41')][_0xcfc4('0x5b')](_0x38811d)[_0xcfc4('0x23')](handleEntityNotFound(_0x45a5b5,null))['then'](respondWithResult(_0x45a5b5,null))[_0xcfc4('0x2d')](handleError(_0x45a5b5,null));};exports[_0xcfc4('0x5c')]=function(_0x11c367,_0x550c1c){return db['ChatWebsite'][_0xcfc4('0x5c')](_0x11c367[_0xcfc4('0x5d')],{})[_0xcfc4('0x23')](function(_0x3d04c8){var _0x459d58=_0x11c367[_0xcfc4('0x5e')]['get']({'plain':!![]});if(!_0x459d58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x459d58['role']===_0xcfc4('0x5e')){var _0x321b7b=_0x3d04c8['get']({'plain':!![]});var _0x56c0d1=_0xcfc4('0x3b');return db['UserProfileSection'][_0xcfc4('0x5b')]({'where':{'name':_0x56c0d1,'userProfileId':_0x459d58['userProfileId']},'raw':!![]})[_0xcfc4('0x23')](function(_0x47a88a){if(_0x47a88a&&_0x47a88a[_0xcfc4('0x5f')]===0x0){return db[_0xcfc4('0x60')][_0xcfc4('0x5c')]({'name':_0x321b7b[_0xcfc4('0x3e')],'resourceId':_0x321b7b['id'],'type':_0x47a88a[_0xcfc4('0x3e')],'sectionId':_0x47a88a['id']},{})['then'](function(){return _0x3d04c8;});}else{return _0x3d04c8;}})[_0xcfc4('0x2d')](function(_0x61aa4){logger['error'](_0xcfc4('0x61'),_0x61aa4);throw _0x61aa4;});}return _0x3d04c8;})[_0xcfc4('0x23')](respondWithResult(_0x550c1c,0xc9))[_0xcfc4('0x2d')](handleError(_0x550c1c,null));};exports[_0xcfc4('0x39')]=function(_0x54fef2,_0x1bf5b9){if(_0x54fef2[_0xcfc4('0x5d')]['id']){delete _0x54fef2[_0xcfc4('0x5d')]['id'];}return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x54fef2[_0xcfc4('0x58')]['id']},'include':[{'model':db[_0xcfc4('0x59')],'as':_0xcfc4('0x40')}]})[_0xcfc4('0x23')](handleEntityNotFound(_0x1bf5b9,null))[_0xcfc4('0x23')](saveUpdates(_0x54fef2[_0xcfc4('0x5d')],null))[_0xcfc4('0x23')](respondWithResult(_0x1bf5b9,null))[_0xcfc4('0x2d')](handleError(_0x1bf5b9,null));};exports[_0xcfc4('0x3c')]=function(_0x1945ec,_0x4af7ef){return db[_0xcfc4('0x41')]['find']({'where':{'id':_0x1945ec[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x4af7ef,null))[_0xcfc4('0x23')](removeEntity(_0x4af7ef,null))['catch'](handleError(_0x4af7ef,null));};exports[_0xcfc4('0x62')]=function(_0x1d2cd9,_0x3fd4ea){return db[_0xcfc4('0x41')][_0xcfc4('0x62')]()[_0xcfc4('0x23')](respondWithResult(_0x3fd4ea,null))[_0xcfc4('0x2d')](handleError(_0x3fd4ea,null));};exports[_0xcfc4('0x63')]=function(_0xdced38,_0xbdace4,_0x1d52de){if(_0xdced38[_0xcfc4('0x5d')]['id']){delete _0xdced38[_0xcfc4('0x5d')]['id'];}return db[_0xcfc4('0x41')]['find']({'where':{'id':_0xdced38['params']['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0xbdace4,null))['then'](function(_0x3ba9fc){if(_0x3ba9fc){_0xdced38['body']['ChatWebsiteId']=_0x3ba9fc['id'];return db[_0xcfc4('0x64')][_0xcfc4('0x5c')](_0xdced38[_0xcfc4('0x5d')]);}})[_0xcfc4('0x23')](respondWithResult(_0xbdace4,null))['catch'](handleError(_0xbdace4,null));};exports[_0xcfc4('0x65')]=function(_0x550269,_0x3b4c5,_0xe57e10){var _0x56e022={'raw':![],'where':{}};var _0x165888={};var _0x4c99a0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcfc4('0x66')]({'where':{'id':_0x550269[_0xcfc4('0x58')]['id']}})['then'](handleEntityNotFound(_0x3b4c5,null))[_0xcfc4('0x23')](function(_0x8d84f3){if(_0x8d84f3){_0x165888[_0xcfc4('0x43')]=_[_0xcfc4('0x44')](db['Disposition']['rawAttributes']);_0x165888['query']=_['keys'](_0x550269[_0xcfc4('0x45')]);_0x165888[_0xcfc4('0x46')]=_[_0xcfc4('0x47')](_0x165888[_0xcfc4('0x43')],_0x165888[_0xcfc4('0x45')]);_0x56e022['attributes']=_[_0xcfc4('0x47')](_0x165888['model'],qs[_0xcfc4('0x67')](_0x550269['query'][_0xcfc4('0x67')]));_0x56e022[_0xcfc4('0x48')]=_0x56e022[_0xcfc4('0x48')][_0xcfc4('0x49')]?_0x56e022[_0xcfc4('0x48')]:_0x165888['model'];if(!_0x550269[_0xcfc4('0x45')][_0xcfc4('0x68')]('nolimit')){_0x56e022[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0x550269[_0xcfc4('0x45')]['limit']);_0x56e022['offset']=qs[_0xcfc4('0x32')](_0x550269[_0xcfc4('0x45')][_0xcfc4('0x32')]);}_0x56e022[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0x550269[_0xcfc4('0x45')][_0xcfc4('0x4b')]);_0x56e022[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0x550269[_0xcfc4('0x45')],_0x165888[_0xcfc4('0x46')]));_0x56e022[_0xcfc4('0x4c')][_0xcfc4('0x69')]=_0x8d84f3['id'];if(_0x550269[_0xcfc4('0x45')]['filter']){_0x56e022[_0xcfc4('0x4c')]=_[_0xcfc4('0x4e')](_0x56e022[_0xcfc4('0x4c')],{'$or':_[_0xcfc4('0x4f')](_0x56e022[_0xcfc4('0x48')],function(_0x3ea6a0){var _0x292e99={};_0x292e99[_0x3ea6a0]={'$like':'%'+_0x550269[_0xcfc4('0x45')]['filter']+'%'};return _0x292e99;})});}_0x56e022=_['merge']({},_0x56e022,_0x550269[_0xcfc4('0x6a')]);return db['Disposition'][_0xcfc4('0x54')]({'where':_0x56e022[_0xcfc4('0x4c')]})[_0xcfc4('0x23')](function(_0x4be644){_0x4c99a0[_0xcfc4('0x54')]=_0x4be644;if(_0x550269[_0xcfc4('0x45')][_0xcfc4('0x5a')]){_0x56e022['include']=[{'all':!![]}];}return db[_0xcfc4('0x64')][_0xcfc4('0x56')](_0x56e022);})[_0xcfc4('0x23')](function(_0x171ec1){_0x4c99a0['rows']=_0x171ec1;return _0x4c99a0;});}})['then'](respondWithFilteredResult(_0x3b4c5,_0x56e022))[_0xcfc4('0x2d')](handleError(_0x3b4c5,null));};exports['removeDispositions']=function(_0x4ab3ed,_0x2019d0,_0x489882){return db[_0xcfc4('0x41')]['find']({'where':{'id':_0x4ab3ed[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x2019d0,null))[_0xcfc4('0x23')](function(_0x44d4b9){if(_0x44d4b9){return _0x44d4b9[_0xcfc4('0x6b')](_0x4ab3ed[_0xcfc4('0x45')][_0xcfc4('0x6c')]);}})[_0xcfc4('0x23')](respondWithStatusCode(_0x2019d0,null))[_0xcfc4('0x2d')](handleError(_0x2019d0,null));};exports['addAnswer']=function(_0x2c4145,_0x39faf8,_0x197ff5){if(_0x2c4145[_0xcfc4('0x5d')]['id']){delete _0x2c4145[_0xcfc4('0x5d')]['id'];}return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x2c4145[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x39faf8,null))[_0xcfc4('0x23')](function(_0xbdbfe1){if(_0xbdbfe1){_0x2c4145['body'][_0xcfc4('0x69')]=_0xbdbfe1['id'];return db[_0xcfc4('0x6d')][_0xcfc4('0x5c')](_0x2c4145[_0xcfc4('0x5d')]);}})['then'](respondWithResult(_0x39faf8,null))[_0xcfc4('0x2d')](handleError(_0x39faf8,null));};exports[_0xcfc4('0x6e')]=function(_0x5d3d19,_0x2108df,_0x35c603){var _0x3c5f32={'raw':![],'where':{}};var _0x46d740={};var _0x370c95={'count':0x0,'rows':[]};return db[_0xcfc4('0x41')][_0xcfc4('0x66')]({'where':{'id':_0x5d3d19[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x2108df,null))[_0xcfc4('0x23')](function(_0x98094f){if(_0x98094f){_0x46d740['model']=_[_0xcfc4('0x44')](db[_0xcfc4('0x6d')][_0xcfc4('0x42')]);_0x46d740['query']=_[_0xcfc4('0x44')](_0x5d3d19['query']);_0x46d740[_0xcfc4('0x46')]=_[_0xcfc4('0x47')](_0x46d740['model'],_0x46d740['query']);_0x3c5f32['attributes']=_[_0xcfc4('0x47')](_0x46d740[_0xcfc4('0x43')],qs[_0xcfc4('0x67')](_0x5d3d19['query']['fields']));_0x3c5f32[_0xcfc4('0x48')]=_0x3c5f32[_0xcfc4('0x48')][_0xcfc4('0x49')]?_0x3c5f32[_0xcfc4('0x48')]:_0x46d740['model'];if(!_0x5d3d19[_0xcfc4('0x45')]['hasOwnProperty'](_0xcfc4('0x6f'))){_0x3c5f32['limit']=qs['limit'](_0x5d3d19[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x3c5f32[_0xcfc4('0x32')]=qs[_0xcfc4('0x32')](_0x5d3d19[_0xcfc4('0x45')][_0xcfc4('0x32')]);}_0x3c5f32[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0x5d3d19['query'][_0xcfc4('0x4b')]);_0x3c5f32[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_['pick'](_0x5d3d19[_0xcfc4('0x45')],_0x46d740[_0xcfc4('0x46')]));_0x3c5f32[_0xcfc4('0x4c')][_0xcfc4('0x69')]=_0x98094f['id'];if(_0x5d3d19[_0xcfc4('0x45')][_0xcfc4('0x53')]){_0x3c5f32[_0xcfc4('0x4c')]=_[_0xcfc4('0x4e')](_0x3c5f32[_0xcfc4('0x4c')],{'$or':_[_0xcfc4('0x4f')](_0x3c5f32[_0xcfc4('0x48')],function(_0x4e637b){var _0x1a0151={};_0x1a0151[_0x4e637b]={'$like':'%'+_0x5d3d19[_0xcfc4('0x45')][_0xcfc4('0x53')]+'%'};return _0x1a0151;})});}_0x3c5f32=_[_0xcfc4('0x4e')]({},_0x3c5f32,_0x5d3d19[_0xcfc4('0x6a')]);return db[_0xcfc4('0x6d')][_0xcfc4('0x54')]({'where':_0x3c5f32[_0xcfc4('0x4c')]})[_0xcfc4('0x23')](function(_0x692219){_0x370c95['count']=_0x692219;if(_0x5d3d19[_0xcfc4('0x45')][_0xcfc4('0x5a')]){_0x3c5f32['include']=[{'all':!![]}];}return db[_0xcfc4('0x6d')][_0xcfc4('0x56')](_0x3c5f32);})[_0xcfc4('0x23')](function(_0xb0fac1){_0x370c95[_0xcfc4('0x70')]=_0xb0fac1;return _0x370c95;});}})['then'](respondWithFilteredResult(_0x2108df,_0x3c5f32))[_0xcfc4('0x2d')](handleError(_0x2108df,null));};exports[_0xcfc4('0x71')]=function(_0x38100f,_0x1b1da8,_0x5d67f1){return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x38100f[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x1b1da8,null))['then'](function(_0x328df1){if(_0x328df1){return _0x328df1[_0xcfc4('0x71')](_0x38100f['query'][_0xcfc4('0x6c')]);}})['then'](respondWithStatusCode(_0x1b1da8,null))['catch'](handleError(_0x1b1da8,null));};exports['addLogo']=function(_0x3f527d,_0x4ebdb8,_0x584010){_0x3f527d[_0xcfc4('0x5d')]['sitepic']=_0x3f527d['file'][_0xcfc4('0x72')];return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x3f527d[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x4ebdb8,null))[_0xcfc4('0x23')](saveUpdates(_0x3f527d['body'],null))[_0xcfc4('0x23')](respondWithResult(_0x4ebdb8,null))[_0xcfc4('0x2d')](handleError(_0x4ebdb8,null));};exports[_0xcfc4('0x73')]=function(_0xa6fbf,_0x439453,_0x24db8c){_0xa6fbf['body'][_0xcfc4('0x74')]=_0xa6fbf[_0xcfc4('0x75')][_0xcfc4('0x72')];return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0xa6fbf[_0xcfc4('0x58')]['id']}})['then'](handleEntityNotFound(_0x439453,null))[_0xcfc4('0x23')](saveUpdates(_0xa6fbf[_0xcfc4('0x5d')],null))[_0xcfc4('0x23')](respondWithResult(_0x439453,null))[_0xcfc4('0x2d')](handleError(_0x439453,null));};exports[_0xcfc4('0x76')]=function(_0x4a7003,_0x57e9c4,_0x322348){_0x4a7003['body'][_0xcfc4('0x77')]=_0x4a7003[_0xcfc4('0x75')][_0xcfc4('0x72')];return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x4a7003[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x57e9c4,null))['then'](saveUpdates(_0x4a7003[_0xcfc4('0x5d')],null))[_0xcfc4('0x23')](respondWithResult(_0x57e9c4,null))[_0xcfc4('0x2d')](handleError(_0x57e9c4,null));};exports['addSystemAvatar']=function(_0x556623,_0xbe23d,_0x805edc){_0x556623['body']['systemAvatar']=_0x556623[_0xcfc4('0x75')][_0xcfc4('0x72')];return db['ChatWebsite']['find']({'where':{'id':_0x556623[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0xbe23d,null))[_0xcfc4('0x23')](saveUpdates(_0x556623[_0xcfc4('0x5d')],null))['then'](respondWithResult(_0xbe23d,null))['catch'](handleError(_0xbe23d,null));};exports[_0xcfc4('0x78')]=function(_0x579a12,_0x337d16,_0x5cfefb){var _0x5cc0c5=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x7b'));var _0x5d8647={'where':{'id':_0x579a12[_0xcfc4('0x58')]['id']},'attributes':['id',_0xcfc4('0x7c')],'raw':!![]};var _0x404c33=![];return require(_0xcfc4('0x7d'))['getLicense']()[_0xcfc4('0x23')](function(_0x6cbba0){if(_0x6cbba0){_0x404c33=_0x6cbba0[_0xcfc4('0x7e')];}})[_0xcfc4('0x23')](function(){return db[_0xcfc4('0x41')][_0xcfc4('0x5b')](_0x5d8647);})['then'](handleEntityNotFound(_0x337d16,null))[_0xcfc4('0x23')](function(_0x64fe18){if(_0x64fe18){if(!_['isNil'](_0x64fe18['sitepic'])){if(fs[_0xcfc4('0x7f')](path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x80'),_0x64fe18[_0xcfc4('0x7c')]))&&_0x404c33){_0x5cc0c5=path['join'](config[_0xcfc4('0x7a')],_0xcfc4('0x80'),_0x64fe18['sitepic']);}}return _0x337d16[_0xcfc4('0x81')](_0x5cc0c5);}})[_0xcfc4('0x2d')](handleError(_0x337d16,null));};exports['getAvatar']=function(_0x29d3fa,_0x5d424f,_0x3b94ae){var _0x5dc74c=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x82'));var _0x1d246b={'where':{'id':_0x29d3fa['params']['id']},'attributes':['id',_0xcfc4('0x74')],'raw':!![]};return db['ChatWebsite'][_0xcfc4('0x5b')](_0x1d246b)[_0xcfc4('0x23')](handleEntityNotFound(_0x5d424f,null))[_0xcfc4('0x23')](function(_0xb65e8a){if(_0xb65e8a){if(!_['isNil'](_0xb65e8a[_0xcfc4('0x74')])){if(fs[_0xcfc4('0x7f')](path[_0xcfc4('0x79')](config['root'],_0xcfc4('0x83'),_0xb65e8a[_0xcfc4('0x74')]))){_0x5dc74c=path['join'](config[_0xcfc4('0x7a')],_0xcfc4('0x83'),_0xb65e8a[_0xcfc4('0x74')]);}}return _0x5d424f[_0xcfc4('0x81')](_0x5dc74c);}})[_0xcfc4('0x2d')](handleError(_0x5d424f,null));};exports[_0xcfc4('0x84')]=function(_0x562eeb,_0x102c36,_0x29128e){var _0x411c25=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],'server/files/images/avatars/customer_avatar.png');var _0x2bb64d={'where':{'id':_0x562eeb[_0xcfc4('0x58')]['id']},'attributes':['id',_0xcfc4('0x77'),_0xcfc4('0x85')],'raw':!![]};return db[_0xcfc4('0x41')][_0xcfc4('0x5b')](_0x2bb64d)[_0xcfc4('0x23')](handleEntityNotFound(_0x102c36,null))[_0xcfc4('0x23')](function(_0x28ee11){if(_0x28ee11){if(!_[_0xcfc4('0x86')](_0x28ee11[_0xcfc4('0x77')])){if(fs['existsSync'](path['join'](config[_0xcfc4('0x7a')],_0xcfc4('0x83'),_0x28ee11[_0xcfc4('0x77')]))&&_0x28ee11[_0xcfc4('0x85')]){_0x411c25=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x83'),_0x28ee11[_0xcfc4('0x77')]);}}return _0x102c36[_0xcfc4('0x81')](_0x411c25);}})[_0xcfc4('0x2d')](handleError(_0x102c36,null));};exports[_0xcfc4('0x87')]=function(_0x5f3a80,_0x2e089b,_0x3cd41d){var _0xd40717=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x88'));var _0x95268c={'where':{'id':_0x5f3a80[_0xcfc4('0x58')]['id']},'attributes':['id',_0xcfc4('0x89')],'raw':!![]};return db[_0xcfc4('0x41')]['find'](_0x95268c)[_0xcfc4('0x23')](handleEntityNotFound(_0x2e089b,null))['then'](function(_0x47bd7a){if(_0x47bd7a){if(!_[_0xcfc4('0x86')](_0x47bd7a['systemAvatar'])){if(fs[_0xcfc4('0x7f')](path[_0xcfc4('0x79')](config['root'],'server/files/images/avatars/',_0x47bd7a[_0xcfc4('0x89')]))){_0xd40717=path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],_0xcfc4('0x83'),_0x47bd7a[_0xcfc4('0x89')]);}}return _0x2e089b['download'](_0xd40717);}})['catch'](handleError(_0x2e089b,null));};exports[_0xcfc4('0x8a')]=function(_0x3080f1,_0x40030e,_0xbf5573){var _0x1f6fb3=require(_0xcfc4('0x8b'));var _0x270cc2=new _0x1f6fb3();var _0x5e8305=_0x270cc2[_0xcfc4('0x8c')](_0x3080f1['headers'][_0xcfc4('0x8d')])[_0xcfc4('0x8e')]();var _0x5cc60a={'body':_0x3080f1[_0xcfc4('0x5d')],'channel':_0xcfc4('0x8f')};var _0x182855=[];var _0x4966b7=[];var _0x586aad={};var _0x219419=![];return db[_0xcfc4('0x90')]['describe']()[_0xcfc4('0x23')](function(_0x5bfe5a){if(!_0x5bfe5a){throw new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x93'));}_0x182855=_[_0xcfc4('0x94')](_['keys'](_0x5bfe5a),['createdAt','updatedAt']);_0x4966b7=_[_0xcfc4('0x94')](_[_0xcfc4('0x44')](_0x5bfe5a),[_0xcfc4('0x95'),_0xcfc4('0x96'),_0xcfc4('0x97'),_0xcfc4('0x98')]);if(_0x3080f1[_0xcfc4('0x5d')]['id']){delete _0x3080f1['body']['id'];}if(_[_0xcfc4('0x86')](_0x3080f1['body'][_0xcfc4('0x99')])){throw new db[(_0xcfc4('0x91'))]['ValidationError'](_0xcfc4('0x9a'));}if(_[_0xcfc4('0x86')](_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x5d')])||_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x5d')]===''){throw new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x9b'));}if(_['isNil'](_0x3080f1['body'][_0xcfc4('0x9c')])){throw new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x9d')+_0x4966b7);}if(!_[_0xcfc4('0x9e')](_0x4966b7,_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x9c')])){throw new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x9f')+_0x4966b7);}_0x586aad[_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x9c')]]=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x99')];})[_0xcfc4('0x23')](function(){return db['ChatWebsite'][_0xcfc4('0x5b')]({'where':{'id':_0x3080f1['params']['id']},'include':[{'model':db[_0xcfc4('0xa0')],'as':_0xcfc4('0xa1'),'include':[{'model':db[_0xcfc4('0x90')],'as':_0xcfc4('0xa2'),'where':_0x586aad,'limit':0x1,'order':[[_0xcfc4('0x96'),'DESC']]}]},{'model':db[_0xcfc4('0xa3')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x40030e,null))[_0xcfc4('0x23')](function(_0x581c9b){if(_0x581c9b&&_0x581c9b[_0xcfc4('0xa1')]){_0x5cc60a[_0xcfc4('0xa4')]=_0x581c9b;_0x5cc60a[_0xcfc4('0xa5')]=_0x581c9b[_0xcfc4('0xa6')];_0x5cc60a['list']=_0x581c9b['List'];_0x5cc60a[_0xcfc4('0xa5')]=_[_0xcfc4('0xa7')](_0x5cc60a[_0xcfc4('0xa5')],[_0xcfc4('0xa8')],[_0xcfc4('0xa9')]);if(_0x5cc60a['account'][_0xcfc4('0xa6')]){delete _0x5cc60a[_0xcfc4('0xa4')][_0xcfc4('0xa6')];}if(_0x5cc60a[_0xcfc4('0xa4')]['List']&&_0x5cc60a[_0xcfc4('0xa4')][_0xcfc4('0xa1')][_0xcfc4('0xa2')][_0xcfc4('0x49')]){return _0x5cc60a[_0xcfc4('0xa4')]['List'][_0xcfc4('0xa2')][0x0];}var _0x34b157=_[_0xcfc4('0x19')](_0x3080f1['body'],{'firstName':_0x3080f1['body'][_0xcfc4('0x99')],'ListId':_0x581c9b['ListId']});_0x34b157[_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x9c')]]=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x99')];return db[_0xcfc4('0x90')][_0xcfc4('0x5c')](_0x34b157,{'fields':_0x182855,'raw':!![]});}})['then'](handleEntityNotFound(_0x40030e,null))[_0xcfc4('0x23')](function(_0x4dcdff){_0x5cc60a[_0xcfc4('0xaa')]=_0x4dcdff;if(_0x4dcdff){var _0x4955af={'ContactId':_0x4dcdff['id'],'ChatWebsiteId':_0x3080f1[_0xcfc4('0x58')]['id'],'from':(_0x4dcdff['firstName']||'')+'\x20'+(_0x4dcdff[_0xcfc4('0xab')]||''),'customerIp':_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xac')],'referer':_0x3080f1['body'][_0xcfc4('0xad')],'browserName':_0x5e8305[_0xcfc4('0xae')][_0xcfc4('0x3e')]&&_0x5e8305['browser'][_0xcfc4('0xaf')]?util[_0xcfc4('0xb0')](_0xcfc4('0xb1'),_0x5e8305[_0xcfc4('0xae')][_0xcfc4('0x3e')],_0x5e8305[_0xcfc4('0xae')][_0xcfc4('0xaf')]):_0xcfc4('0xb2'),'browserVersion':_0x5e8305[_0xcfc4('0xae')][_0xcfc4('0xaf')]||_0xcfc4('0xb2'),'osName':util['format'](_0xcfc4('0xb1'),_0x5e8305['os'][_0xcfc4('0x3e')],_0x5e8305['os'][_0xcfc4('0xaf')]),'osVersion':_0x5e8305['os'][_0xcfc4('0xaf')],'deviceModel':_0x5e8305['device']['model']&&_0x5e8305['device'][_0xcfc4('0xb3')]?util[_0xcfc4('0xb0')]('%s\x20%s\x20%s',_0x5e8305['device']['model'],_0x5e8305[_0xcfc4('0xb4')]['vendor'],_0x5e8305[_0xcfc4('0xb4')][_0xcfc4('0xb5')]):null,'deviceVendor':_0x5e8305['device'][_0xcfc4('0xb3')],'deviceType':_0x5e8305[_0xcfc4('0xb4')][_0xcfc4('0xb5')],'formData':JSON[_0xcfc4('0x29')](_0x3080f1[_0xcfc4('0x5d')])};var _0x15091e={'ChatWebsiteId':_0x3080f1[_0xcfc4('0x58')]['id'],'closed':![]};if(_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb6')]){_0x15091e[_0xcfc4('0xb6')]=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb6')];return db[_0xcfc4('0xb7')][_0xcfc4('0x5b')]({'where':_0x15091e})['then'](function(_0x1c1ad6){if(_0x1c1ad6){return[_0x1c1ad6,![]];}_0x4955af['threadId']=_0x3080f1[_0xcfc4('0x5d')]['threadId'];_0x4955af[_0xcfc4('0xb8')]=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb8')];return db[_0xcfc4('0xb7')][_0xcfc4('0x5c')](_0x4955af)['then'](function(_0x46d87b){return[_0x46d87b,!![]];});});}_0x15091e['ContactId']=_0x4dcdff['id'];if(_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb9')]&&_0x3080f1[_0xcfc4('0x5d')]['interaction']['id']){_0x15091e['id']=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb9')]['id'];return db[_0xcfc4('0xb7')][_0xcfc4('0x5b')]({'where':_0x15091e})[_0xcfc4('0x23')](function(_0x32d81f){if(_0x32d81f){return[_0x32d81f,![]];}return db[_0xcfc4('0xb7')]['create'](_0x4955af)[_0xcfc4('0x23')](function(_0x3113b9){return[_0x3113b9,!![]];});});}return db[_0xcfc4('0xb7')]['create'](_0x4955af)['then'](function(_0x2d4234){return[_0x2d4234,!![]];});}})['spread'](function(_0x1a95ce,_0x195a76){if(_0x1a95ce){_0x219419=_0x195a76;if(!_0x195a76){var _0x38278d={'from':(_0x5cc60a[_0xcfc4('0xaa')][_0xcfc4('0xba')]||'')+'\x20'+(_0x5cc60a[_0xcfc4('0xaa')]['lastName']||'')};if(_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb6')]&&_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xbb')]&&_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xb6')]!=_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xbb')]){_0x38278d[_0xcfc4('0xb6')]=_0x3080f1['body'][_0xcfc4('0xbb')];}return _0x1a95ce[_0xcfc4('0x39')](_0x38278d);}else{return _0x1a95ce;}}})[_0xcfc4('0x23')](function(_0x1c785a){_0x5cc60a[_0xcfc4('0xb9')]=_0x1c785a[_0xcfc4('0x3a')]({'plain':!![]});_0x5cc60a[_0xcfc4('0xb9')][_0xcfc4('0xbc')]=_0x219419;if(_0x5cc60a[_0xcfc4('0xb9')][_0xcfc4('0xbc')]){if(_0x5cc60a[_0xcfc4('0xa4')][_0xcfc4('0xbd')]){_0x5cc60a[_0xcfc4('0xa5')][_0xcfc4('0xbe')]({'id':0x0,'priority':_0x5cc60a['applications']['length']+0x1,'app':_0xcfc4('0xbf'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xcfc4('0xc0')][_0xcfc4('0x5c')]({'body':_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0x5d')],'ChatWebsiteId':_0x3080f1[_0xcfc4('0x58')]['id'],'ChatInteractionId':_0x1c785a['id'],'direction':'in','ContactId':_0x5cc60a[_0xcfc4('0xaa')]['id'],'AttachmentId':_0x3080f1[_0xcfc4('0x5d')][_0xcfc4('0xc1')]});})[_0xcfc4('0x23')](function(_0x117936){_0x5cc60a[_0xcfc4('0x2b')]=_0x117936;if(_0x5cc60a[_0xcfc4('0xb9')][_0xcfc4('0xc2')]){return db[_0xcfc4('0xc3')][_0xcfc4('0x5b')]({'attributes':['id','name'],'where':{'id':_0x5cc60a[_0xcfc4('0xb9')][_0xcfc4('0xc2')]}})[_0xcfc4('0x23')](function(_0x23e532){if(_0x23e532){_0x5cc60a[_0xcfc4('0xa5')][_0xcfc4('0xc4')]({'id':0x0,'priority':0x0,'app':_0xcfc4('0xc5'),'appdata':_0x23e532[_0xcfc4('0x3e')]+','+(_0x5cc60a['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x5cc60a[_0xcfc4('0xc6')]=!![];}return respondWithRpcPromise(_0xcfc4('0xc7'),_0xcfc4('0xc8'),_0x5cc60a);});}return respondWithRpcPromise('Start','startRouting',_0x5cc60a);})[_0xcfc4('0x23')](function(_0x143591){respondWithRpcPromise(_0xcfc4('0xc9'),_0xcfc4('0xc9'),{'event':_0xcfc4('0x8a'),'message':_0x143591},client9002);return _0x143591;})[_0xcfc4('0x23')](respondWithResult(_0x40030e,null))[_0xcfc4('0x2d')](handleError(_0x40030e,null));};exports[_0xcfc4('0xca')]=function(_0x2de18e,_0xa1c7fe,_0x24efc3){var _0x4f81d7,_0x14f9c3,_0x557dff;var _0x188f9b=[];var _0x59877f=[];var _0x4ac02c={};return db[_0xcfc4('0x90')][_0xcfc4('0x62')]()[_0xcfc4('0x23')](function(_0x19ac4f){if(!_0x19ac4f){throw new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x93'));}_0x59877f=_[_0xcfc4('0x94')](_[_0xcfc4('0x44')](_0x19ac4f),[_0xcfc4('0x95'),'updatedAt']);_0x188f9b=_[_0xcfc4('0x94')](_[_0xcfc4('0x44')](_0x19ac4f),[_0xcfc4('0x95'),_0xcfc4('0x96'),_0xcfc4('0x97'),_0xcfc4('0x98')]);if(_0x2de18e[_0xcfc4('0x5d')]['id']){delete _0x2de18e[_0xcfc4('0x5d')]['id'];}if(_[_0xcfc4('0x86')](_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0x99')])){throw _0xa1c7fe[_0xcfc4('0x2f')](0x1f4)[_0xcfc4('0xcb')](new db['Sequelize'][(_0xcfc4('0x92'))](_0xcfc4('0x9a')));}if(_[_0xcfc4('0x86')](_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0x5d')])||_0x2de18e[_0xcfc4('0x5d')]['body']===''){throw _0xa1c7fe[_0xcfc4('0x2f')](0x1f4)[_0xcfc4('0xcb')](new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0x9b')));}if(_[_0xcfc4('0x86')](_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0xcc')])){throw _0xa1c7fe[_0xcfc4('0x2f')](0x1f4)['send'](new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))](_0xcfc4('0xcd')+_0x188f9b));}if(!_[_0xcfc4('0x9e')](_0x188f9b,_0x2de18e[_0xcfc4('0x5d')]['mapKeyOffline'])){throw _0xa1c7fe['status'](0x1f4)[_0xcfc4('0xcb')](new db[(_0xcfc4('0x91'))][(_0xcfc4('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x188f9b));}_0x4ac02c[_0x2de18e[_0xcfc4('0x5d')]['mapKeyOffline']]=_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0x99')];})[_0xcfc4('0x23')](function(){return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x2de18e[_0xcfc4('0x58')]['id']},'include':[{'model':db[_0xcfc4('0xa0')],'as':_0xcfc4('0xa1')}]});})[_0xcfc4('0x23')](handleEntityNotFound(_0xa1c7fe,null))['then'](function(_0x5858f4){if(_0x5858f4&&_0x5858f4[_0xcfc4('0xa1')]){_0x14f9c3=_0x5858f4;var _0x2782dc=_[_0xcfc4('0x19')](_0x2de18e[_0xcfc4('0x5d')],{'firstName':_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0x99')],'phone':_0x2de18e[_0xcfc4('0x5d')]['from'],'ListId':_0x5858f4[_0xcfc4('0x98')]});_0x2782dc[_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0xcc')]]=_0x2de18e[_0xcfc4('0x5d')][_0xcfc4('0x99')];return db[_0xcfc4('0x90')]['findOrCreate']({'where':_0x4ac02c,'defaults':_0x2782dc});}})['spread'](function(_0x56f2ec){if(_0x56f2ec){_0x557dff=_0x56f2ec;var _0x581dfe=fs[_0xcfc4('0xce')](path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],'server/files/templates/chatOfflineMessage.ejs'),_0xcfc4('0xcf'));var _0x4005b9=ejs[_0xcfc4('0xd0')](_0x581dfe,{'body':_[_0xcfc4('0xd1')](_0x2de18e[_0xcfc4('0x5d')]['body']),'bodyTitle':_0x14f9c3[_0xcfc4('0xd2')]});return db['ChatOfflineMessage'][_0xcfc4('0x5c')]({'body':_0x4005b9,'ContactId':_0x56f2ec['id'],'ChatWebsiteId':_0x14f9c3['id']});}})[_0xcfc4('0x23')](function(_0x3c4256){if(_0x3c4256){_0x4f81d7=_0x3c4256;return db['MailAccount'][_0xcfc4('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0xcfc4('0xd3')],'as':_0xcfc4('0xd4'),'raw':!![]}]});}})[_0xcfc4('0x23')](function(_0x2ca781){if(_0x2ca781&&_0x2ca781[_0xcfc4('0xd4')]&&_0x14f9c3[_0xcfc4('0xd5')]){var _0x54d0a7={'tls':{'rejectUnauthorized':![]}};if(_0x2ca781[_0xcfc4('0xd4')][_0xcfc4('0xd6')]){_0x54d0a7[_0xcfc4('0xd6')]=_0x2ca781[_0xcfc4('0xd4')]['service'];}else{_0x54d0a7[_0xcfc4('0xd7')]=_0x2ca781[_0xcfc4('0xd4')]['host'];_0x54d0a7[_0xcfc4('0xd8')]=_0x2ca781[_0xcfc4('0xd4')]['port'];_0x54d0a7['secure']=_0x2ca781[_0xcfc4('0xd4')][_0xcfc4('0xd9')];}if(_0x2ca781[_0xcfc4('0xd4')][_0xcfc4('0xda')]){_0x54d0a7['auth']={'user':_0x2ca781[_0xcfc4('0xd4')][_0xcfc4('0x5e')],'pass':_0x2ca781[_0xcfc4('0xd4')][_0xcfc4('0xdb')]};}return respondWithRpcPromise(_0xcfc4('0xdc'),'sendMail',{'account':_0x54d0a7,'message':{'from':util[_0xcfc4('0xb0')](_0xcfc4('0xdd'),_0x2ca781[_0xcfc4('0x3e')],_0x2ca781['email']||_0x2ca781['Smtp'][_0xcfc4('0x5e')]),'to':_0x14f9c3[_0xcfc4('0xd5')],'subject':_0x14f9c3[_0xcfc4('0xde')],'text':_0x4f81d7[_0xcfc4('0x5d')]}},client9003)[_0xcfc4('0x23')](function(){return _0x4f81d7;})[_0xcfc4('0x2d')](function(_0x862e7d){console['error'](_0x862e7d);});}})[_0xcfc4('0x23')](function(){if(_0x4f81d7){return _0x4f81d7;}})[_0xcfc4('0x23')](respondWithResult(_0xa1c7fe,null))[_0xcfc4('0x2d')](handleError(_0xa1c7fe,null));};exports[_0xcfc4('0xdf')]=function(_0x5d16c3,_0x48d9f0,_0x1f8f7f){return db[_0xcfc4('0xb7')][_0xcfc4('0x5b')]({'where':{'id':_0x5d16c3[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x48d9f0,null))[_0xcfc4('0x23')](function(_0x28166f){if(_0x28166f){return _0x28166f[_0xcfc4('0xdf')](_0x5d16c3[_0xcfc4('0x5d')][_0xcfc4('0x6c')],_[_0xcfc4('0xe0')](_0x5d16c3[_0xcfc4('0x5d')],['ids','id'])||{});}})[_0xcfc4('0x23')](respondWithResult(_0x48d9f0,null))[_0xcfc4('0x2d')](handleError(_0x48d9f0,null));};exports[_0xcfc4('0xe1')]=function(_0x5a1114,_0x44c3f1,_0x25f9ab){var _0x24b077={'raw':![],'where':{}};var _0x78b348={};var _0x497d36={'count':0x0,'rows':[]};return db[_0xcfc4('0x41')][_0xcfc4('0x66')]({'where':{'id':_0x5a1114[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x44c3f1,null))[_0xcfc4('0x23')](function(_0x33ff32){if(_0x33ff32){_0x78b348[_0xcfc4('0x43')]=_[_0xcfc4('0x44')](db[_0xcfc4('0xb7')][_0xcfc4('0x42')]);_0x78b348['query']=_[_0xcfc4('0x44')](_0x5a1114[_0xcfc4('0x45')]);_0x78b348[_0xcfc4('0x46')]=_[_0xcfc4('0x47')](_0x78b348[_0xcfc4('0x43')],_0x78b348[_0xcfc4('0x45')]);_0x24b077[_0xcfc4('0x48')]=_['intersection'](_0x78b348[_0xcfc4('0x43')],qs[_0xcfc4('0x67')](_0x5a1114['query']['fields']));_0x24b077[_0xcfc4('0x48')]=_0x24b077[_0xcfc4('0x48')][_0xcfc4('0x49')]?_0x24b077[_0xcfc4('0x48')]:_0x78b348[_0xcfc4('0x43')];if(!_0x5a1114['query'][_0xcfc4('0x68')]('nolimit')){_0x24b077[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x24b077[_0xcfc4('0x32')]=qs[_0xcfc4('0x32')](_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0x32')]);}_0x24b077[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0x5a1114['query'][_0xcfc4('0x4b')]);_0x24b077[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0x5a1114['query'],_0x78b348[_0xcfc4('0x46')]));_0x24b077[_0xcfc4('0x4c')][_0xcfc4('0x69')]=_0x33ff32['id'];if(_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0x53')]){_0x24b077[_0xcfc4('0x4c')]=_['merge'](_0x24b077[_0xcfc4('0x4c')],{'$or':_['map'](_0x24b077[_0xcfc4('0x48')],function(_0x1f7ecd){var _0x49c00e={};_0x49c00e[_0x1f7ecd]={'$like':'%'+_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0x53')]+'%'};return _0x49c00e;})});}_0x24b077=_['merge']({},_0x24b077,_0x5a1114[_0xcfc4('0x6a')]);return db['ChatInteraction'][_0xcfc4('0x54')]({'where':_0x24b077[_0xcfc4('0x4c')]})['then'](function(_0x1eb26e){_0x497d36[_0xcfc4('0x54')]=_0x1eb26e;if(_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0x5a')]){_0x24b077['include']=[{'model':db['CmContact'],'as':_0xcfc4('0xe2'),'required':![]},{'model':db['User'],'as':_0xcfc4('0xe3'),'attributes':['name',_0xcfc4('0xe4'),_0xcfc4('0xe5')],'required':![]},{'model':db[_0xcfc4('0xe6')],'as':'Tags','attributes':['id',_0xcfc4('0x3e'),_0xcfc4('0xe7')],'where':_0x5a1114['query'][_0xcfc4('0xe8')]?{'id':_0x5a1114['query'][_0xcfc4('0xe8')]}:undefined,'required':_0x5a1114[_0xcfc4('0x45')][_0xcfc4('0xe8')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x24b077);})[_0xcfc4('0x23')](function(_0x48d27b){_0x497d36[_0xcfc4('0x70')]=_0x48d27b;return _0x497d36;});}})['then'](respondWithFilteredResult(_0x44c3f1,_0x24b077))[_0xcfc4('0x2d')](handleError(_0x44c3f1,null));};function iftimePromise(_0xa934de,_0x384ba9){return respondWithRpcPromise(_0xcfc4('0xe9'),_0xcfc4('0xea'),{'command':_0x384ba9[_0xcfc4('0xeb')]?util[_0xcfc4('0xb0')](_0xcfc4('0xec'),_0xa934de[_0xcfc4('0xed')],_0x384ba9[_0xcfc4('0xeb')]):util[_0xcfc4('0xb0')]('iftime\x20%s',_0xa934de[_0xcfc4('0xed')])},client9002)[_0xcfc4('0x23')](function(_0x1dc898){var _0x5876a7=_0x1dc898&&_0x1dc898['indexOf'](_0xcfc4('0xee'))>=0x0?!![]:![];logger[_0xcfc4('0x24')](_0xcfc4('0xef'),_0x384ba9['id'],_0xa934de['id'],_0xa934de[_0xcfc4('0xed')],_0x5876a7?'ONLINE':_0xcfc4('0xf0'),_0x384ba9[_0xcfc4('0xeb')]?_0x384ba9[_0xcfc4('0xeb')]:_0xcfc4('0xf1'));return _0x5876a7;})['catch'](function(_0x500fc5){logger[_0xcfc4('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x384ba9['id'],_0xa934de['id'],_0xa934de[_0xcfc4('0xed')],util[_0xcfc4('0xf2')](_0x500fc5,{'showHidden':![],'depth':null}),_0x384ba9['timezone']?_0x384ba9[_0xcfc4('0xeb')]:_0xcfc4('0xf1'));return![];});}exports[_0xcfc4('0xea')]=function(_0x81098,_0x3c94a7,_0x497268){var _0x1c7372=0x0;var _0x449879=0x0;var _0x56141d=![];var _0x3e4b08;var _0x466789;return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x81098['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xcfc4('0xf3')],'as':_0xcfc4('0xf4'),'attributes':['id',_0xcfc4('0xed')],'raw':!![]}]}]})[_0xcfc4('0x23')](handleEntityNotFound(_0x3c94a7,null))[_0xcfc4('0x23')](function(_0x9da03c){if(_0x9da03c){_0x3e4b08=_0x9da03c;return _0x9da03c['getProactiveActions']({'raw':!![]});}})[_0xcfc4('0x23')](function(_0xe4038){if(_0x3e4b08){if(_0xe4038){_0x466789=_0xe4038;}}return require('../../config/license/util')[_0xcfc4('0xf5')]();})[_0xcfc4('0x23')](function(_0x193c4d){if(_0x193c4d){_0x449879=_0x193c4d[_0xcfc4('0xf6')];_0x56141d=_0x193c4d[_0xcfc4('0x7e')];}})[_0xcfc4('0x23')](function(){return db[_0xcfc4('0xb7')]['count']({'where':{'closed':![]}});})['then'](function(_0x41dffb){_0x1c7372=_0x41dffb;if(_0x449879&&_0x41dffb>_0x449879){return db[_0xcfc4('0xf7')][_0xcfc4('0x66')]({'where':{'id':0x1}})[_0xcfc4('0x23')](function(_0x69b673){if(_0x69b673){_0x69b673[_0xcfc4('0xf8')](_0xcfc4('0xf9'));}});}})[_0xcfc4('0x23')](function(){if(_0x3e4b08[_0xcfc4('0xf3')]&&_0x3e4b08['Interval']['Intervals']){var _0x6a3f64=[];for(var _0xe90d73=0x0;_0xe90d73<_0x3e4b08['Interval'][_0xcfc4('0xf4')][_0xcfc4('0x49')];_0xe90d73++){var _0x178701=_0x3e4b08['Interval'][_0xcfc4('0xf4')][_0xe90d73]['get']({'plain':!![]});_0x6a3f64['push'](iftimePromise(_0x178701,_0x3e4b08));}return BPromise[_0xcfc4('0xfa')](_0x6a3f64)[_0xcfc4('0x23')](function(_0x517a18){return _[_0xcfc4('0xfb')](_0x517a18);});}else{return!![];}})['then'](function(_0x40edcc){var _0x1d2604=fs[_0xcfc4('0xce')](path[_0xcfc4('0x79')](config[_0xcfc4('0x7a')],'server/files/chat/iframe.js'),_0xcfc4('0xcf'));var _0x20ab20={'remote':_0x3e4b08[_0xcfc4('0xfc')],'query':querystring[_0xcfc4('0x29')](_[_0xcfc4('0x4e')](_0x3e4b08[_0xcfc4('0x3a')]({'plain':!![]}),{'customerIp':_0x81098[_0xcfc4('0xfd')][_0xcfc4('0xfe')]||_0x81098[_0xcfc4('0xfd')][_0xcfc4('0xff')]||_0x81098['connection'][_0xcfc4('0x100')]||_0x81098['ip'],'referer':_0x81098[_0xcfc4('0xfd')][_0xcfc4('0xad')],'openedInteractions':_0x1c7372,'maxInteractions':_0x449879,'virtual':_0x56141d['virtual'],'online':_0x40edcc,'custom':_0x56141d}))[_0xcfc4('0x101')](/'/g,'\x5c\x27')};_0x3c94a7[_0xcfc4('0xcb')](ejs['render'](Mustache[_0xcfc4('0xd0')](_0x1d2604,_0x20ab20),{'proactiveActions':_0x466789,'alignment':_0x3e4b08[_0xcfc4('0x102')],'verticalAlignment':_0x3e4b08[_0xcfc4('0x103')]}));})[_0xcfc4('0x2d')](handleError(_0x3c94a7,null));};exports[_0xcfc4('0x104')]=function(_0x53fe27,_0x279420,_0xfdda37){return db[_0xcfc4('0x41')][_0xcfc4('0x66')]({'where':{'id':_0x53fe27[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x279420,null))['then'](function(_0x28edf7){if(_0x28edf7){return db[_0xcfc4('0x105')]['transaction'](function(_0x9a4600){return db[_0xcfc4('0xa3')]['destroy']({'where':{'ChatWebsiteId':_0x53fe27['params']['id']},'transaction':_0x9a4600})[_0xcfc4('0x23')](function(_0x49aabe){var _0x302f57=_[_0xcfc4('0x4f')](_0x53fe27[_0xcfc4('0x5d')],function(_0x15e141){_0x15e141[_0xcfc4('0x69')]=_0x53fe27[_0xcfc4('0x58')]['id'];return _0x15e141;});return db[_0xcfc4('0xa3')][_0xcfc4('0x106')](_0x302f57,{'transaction':_0x9a4600});});})[_0xcfc4('0x23')](function(){return db[_0xcfc4('0xa3')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x53fe27[_0xcfc4('0x58')]['id']},'order':_0xcfc4('0xa8')});});}})[_0xcfc4('0x23')](respondWithResult(_0x279420,null))['catch'](handleError(_0x279420,null));};exports[_0xcfc4('0x107')]=function(_0x4a33ee,_0x3accde,_0x27565a){var _0x51a29b={};var _0x3ac09a={};var _0x180d06;var _0x62b01f;return db['ChatWebsite']['findOne']({'where':{'id':_0x4a33ee['params']['id']}})['then'](handleEntityNotFound(_0x3accde,null))['then'](function(_0x203a52){if(_0x203a52){_0x180d06=_0x203a52;_0x3ac09a[_0xcfc4('0x43')]=_['keys'](db[_0xcfc4('0xa3')][_0xcfc4('0x42')]);_0x3ac09a['query']=_[_0xcfc4('0x44')](_0x4a33ee[_0xcfc4('0x45')]);_0x3ac09a[_0xcfc4('0x46')]=_['intersection'](_0x3ac09a[_0xcfc4('0x43')],_0x3ac09a['query']);_0x51a29b[_0xcfc4('0x48')]=_[_0xcfc4('0x47')](_0x3ac09a[_0xcfc4('0x43')],qs[_0xcfc4('0x67')](_0x4a33ee['query']['fields']));_0x51a29b[_0xcfc4('0x48')]=_0x51a29b[_0xcfc4('0x48')]['length']?_0x51a29b['attributes']:_0x3ac09a[_0xcfc4('0x43')];_0x51a29b[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0x4a33ee[_0xcfc4('0x45')][_0xcfc4('0x4b')]);_0x51a29b[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0x4a33ee[_0xcfc4('0x45')],_0x3ac09a[_0xcfc4('0x46')]));if(_0x4a33ee[_0xcfc4('0x45')][_0xcfc4('0x53')]){_0x51a29b[_0xcfc4('0x4c')]=_['merge'](_0x51a29b[_0xcfc4('0x4c')],{'$or':_['map'](_0x51a29b['attributes'],function(_0x4ce2aa){var _0x320f3d={};_0x320f3d[_0x4ce2aa]={'$like':'%'+_0x4a33ee[_0xcfc4('0x45')]['filter']+'%'};return _0x320f3d;})});}_0x51a29b=_[_0xcfc4('0x4e')]({},_0x51a29b,_0x4a33ee[_0xcfc4('0x6a')]);return _0x180d06[_0xcfc4('0x107')](_0x51a29b);}})[_0xcfc4('0x23')](function(_0x4616db){if(_0x4616db){_0x62b01f=_0x4616db['length'];if(!_0x4a33ee[_0xcfc4('0x45')][_0xcfc4('0x68')]('nolimit')){_0x51a29b[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0x4a33ee[_0xcfc4('0x45')]['limit']);_0x51a29b['offset']=qs[_0xcfc4('0x32')](_0x4a33ee['query'][_0xcfc4('0x32')]);}return _0x180d06[_0xcfc4('0x107')](_0x51a29b);}})[_0xcfc4('0x23')](function(_0x371dea){if(_0x371dea){return _0x371dea?{'count':_0x62b01f,'rows':_0x371dea}:null;}})['then'](respondWithResult(_0x3accde,null))[_0xcfc4('0x2d')](handleError(_0x3accde,null));};exports[_0xcfc4('0x108')]=function(_0x176251,_0x42355e,_0x4f5010){return db['chatProactiveAction'][_0xcfc4('0x5b')]({'where':{'id':_0x176251[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x42355e,null))[_0xcfc4('0x23')](function(_0x3af847){if(_0x3af847){return _0x3af847[_0xcfc4('0x108')](_0x176251[_0xcfc4('0x5d')][_0xcfc4('0x6c')],_['omit'](_0x176251[_0xcfc4('0x5d')],[_0xcfc4('0x6c'),'id'])||{});}})[_0xcfc4('0x23')](respondWithResult(_0x42355e,null))[_0xcfc4('0x2d')](handleError(_0x42355e,null));};exports[_0xcfc4('0x109')]=function(_0xfed693,_0x214f36,_0x3f398a){var _0x59b459={};var _0x410e05={};var _0x3ddd55;var _0x38ba21;return db['ChatWebsite'][_0xcfc4('0x66')]({'where':{'id':_0xfed693[_0xcfc4('0x58')]['id']}})['then'](handleEntityNotFound(_0x214f36,null))[_0xcfc4('0x23')](function(_0x65070a){if(_0x65070a){_0x3ddd55=_0x65070a;_0x410e05[_0xcfc4('0x43')]=_[_0xcfc4('0x44')](db[_0xcfc4('0x10a')]['rawAttributes']);_0x410e05[_0xcfc4('0x45')]=_[_0xcfc4('0x44')](_0xfed693[_0xcfc4('0x45')]);_0x410e05[_0xcfc4('0x46')]=_['intersection'](_0x410e05[_0xcfc4('0x43')],_0x410e05[_0xcfc4('0x45')]);_0x59b459[_0xcfc4('0x48')]=_[_0xcfc4('0x47')](_0x410e05['model'],qs[_0xcfc4('0x67')](_0xfed693[_0xcfc4('0x45')][_0xcfc4('0x67')]));_0x59b459[_0xcfc4('0x48')]=_0x59b459['attributes'][_0xcfc4('0x49')]?_0x59b459[_0xcfc4('0x48')]:_0x410e05['model'];_0x59b459['order']=qs[_0xcfc4('0x4b')](_0xfed693[_0xcfc4('0x45')][_0xcfc4('0x4b')]);_0x59b459[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0xfed693[_0xcfc4('0x45')],_0x410e05[_0xcfc4('0x46')]));if(_0xfed693[_0xcfc4('0x45')][_0xcfc4('0x53')]){_0x59b459['where']=_[_0xcfc4('0x4e')](_0x59b459[_0xcfc4('0x4c')],{'$or':_[_0xcfc4('0x4f')](_0x59b459[_0xcfc4('0x48')],function(_0x328362){var _0x3ba627={};_0x3ba627[_0x328362]={'$like':'%'+_0xfed693[_0xcfc4('0x45')]['filter']+'%'};return _0x3ba627;})});}_0x59b459=_['merge']({},_0x59b459,_0xfed693['options']);return _0x3ddd55['getProactiveActions'](_0x59b459);}})[_0xcfc4('0x23')](function(_0x5e0004){if(_0x5e0004){_0x38ba21=_0x5e0004[_0xcfc4('0x49')];if(!_0xfed693['query'][_0xcfc4('0x68')](_0xcfc4('0x6f'))){_0x59b459[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0xfed693[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x59b459[_0xcfc4('0x32')]=qs[_0xcfc4('0x32')](_0xfed693[_0xcfc4('0x45')][_0xcfc4('0x32')]);}return _0x3ddd55[_0xcfc4('0x109')](_0x59b459);}})[_0xcfc4('0x23')](function(_0x1c7624){if(_0x1c7624){return _0x1c7624?{'count':_0x38ba21,'rows':_0x1c7624}:null;}})[_0xcfc4('0x23')](respondWithResult(_0x214f36,null))['catch'](handleError(_0x214f36,null));};exports[_0xcfc4('0x10b')]=function(_0x3697a2,_0x5ccee1,_0x35132a){var _0x15497f=_0x3697a2[_0xcfc4('0x45')][_0xcfc4('0x10c')]==='false'?'offlineForm':'onlineForm';return db['ChatWebsite'][_0xcfc4('0x5b')]({'attributes':['id',_0x15497f],'where':{'id':_0x3697a2[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x5ccee1,null))[_0xcfc4('0x23')](function(_0x1f30f9){if(_0x1f30f9){var _0x1362a1=_0x1f30f9[_0x15497f];var _0x458763=_0x1362a1&&_0x1362a1[_0xcfc4('0x10d')]?_0x1362a1['items']:[];_0x5ccee1[_0xcfc4('0xcb')]({'fromKey':_[_0xcfc4('0x86')](_0x1362a1[_0xcfc4('0x10e')])?undefined:_0x1362a1[_0xcfc4('0x10e')],'count':_0x458763[_0xcfc4('0x49')],'rows':_0x458763});}})[_0xcfc4('0x2d')](handleError(_0x5ccee1,null));};exports[_0xcfc4('0x10f')]=function(_0x438a4e,_0x3f9a41,_0x1113ea){var _0x529ccb={'raw':!![],'where':{}};var _0x54348c={};var _0x6fb0={'count':0x0,'rows':[]};return db[_0xcfc4('0x41')][_0xcfc4('0x66')]({'where':{'id':_0x438a4e['params']['id']}})['then'](handleEntityNotFound(_0x3f9a41,null))[_0xcfc4('0x23')](function(_0x19a80b){if(_0x19a80b){_0x54348c[_0xcfc4('0x43')]=_['keys'](db[_0xcfc4('0x110')][_0xcfc4('0x42')]);_0x54348c['query']=_[_0xcfc4('0x44')](_0x438a4e[_0xcfc4('0x45')]);_0x54348c['filters']=_['intersection'](_0x54348c['model'],_0x54348c[_0xcfc4('0x45')]);_0x529ccb[_0xcfc4('0x48')]=_[_0xcfc4('0x47')](_0x54348c[_0xcfc4('0x43')],qs['fields'](_0x438a4e[_0xcfc4('0x45')][_0xcfc4('0x67')]));_0x529ccb[_0xcfc4('0x48')]=_0x529ccb[_0xcfc4('0x48')]['length']?_0x529ccb[_0xcfc4('0x48')]:_0x54348c[_0xcfc4('0x43')];if(!_0x438a4e[_0xcfc4('0x45')]['hasOwnProperty'](_0xcfc4('0x6f'))){_0x529ccb[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0x438a4e[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x529ccb['offset']=qs[_0xcfc4('0x32')](_0x438a4e[_0xcfc4('0x45')][_0xcfc4('0x32')]);}_0x529ccb['order']=qs[_0xcfc4('0x4b')](_0x438a4e[_0xcfc4('0x45')][_0xcfc4('0x4b')]);_0x529ccb[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0x438a4e['query'],_0x54348c[_0xcfc4('0x46')]));_0x529ccb[_0xcfc4('0x4c')][_0xcfc4('0x69')]=_0x19a80b['id'];if(_0x438a4e['query'][_0xcfc4('0x53')]){_0x529ccb[_0xcfc4('0x4c')]=_[_0xcfc4('0x4e')](_0x529ccb['where'],{'$or':_['map'](_0x529ccb[_0xcfc4('0x48')],function(_0x367df4){var _0x476492={};_0x476492[_0x367df4]={'$like':'%'+_0x438a4e['query'][_0xcfc4('0x53')]+'%'};return _0x476492;})});}_0x529ccb=_[_0xcfc4('0x4e')]({},_0x529ccb,_0x438a4e[_0xcfc4('0x6a')]);return db['ChatOfflineMessage'][_0xcfc4('0x54')]({'where':_0x529ccb[_0xcfc4('0x4c')]})[_0xcfc4('0x23')](function(_0x441401){_0x6fb0[_0xcfc4('0x54')]=_0x441401;if(_0x438a4e[_0xcfc4('0x45')][_0xcfc4('0x5a')]){_0x529ccb[_0xcfc4('0x55')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xcfc4('0x56')](_0x529ccb);})[_0xcfc4('0x23')](function(_0x5a96b7){_0x6fb0['rows']=_0x5a96b7;return _0x6fb0;});}})['then'](respondWithFilteredResult(_0x3f9a41,_0x529ccb))['catch'](handleError(_0x3f9a41,null));};exports[_0xcfc4('0x111')]=function(_0x38da18,_0x4f171c,_0x8ad078){return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x38da18['params']['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x4f171c,null))[_0xcfc4('0x23')](function(_0x190f3c){if(_0x190f3c){return _0x190f3c[_0xcfc4('0x111')](_0x38da18[_0xcfc4('0x5d')][_0xcfc4('0x6c')],_['omit'](_0x38da18[_0xcfc4('0x5d')],[_0xcfc4('0x6c'),'id'])||{})['spread'](function(_0xc9f0fa){for(var _0x3abb82=0x0;_0x3abb82<_0x38da18['body'][_0xcfc4('0x6c')][_0xcfc4('0x49')];_0x3abb82+=0x1){socket[_0xcfc4('0x112')]('userChatWebsite:save',{'UserId':_0x38da18['body']['ids'][_0x3abb82],'ChatWebsiteId':_0x38da18[_0xcfc4('0x58')]['id']});}return _0xc9f0fa;});}})[_0xcfc4('0x23')](respondWithResult(_0x4f171c,null))['catch'](handleError(_0x4f171c,null));};exports[_0xcfc4('0x113')]=function(_0x2cf4e5,_0x50bc15,_0x11283c){return db[_0xcfc4('0x41')][_0xcfc4('0x5b')]({'where':{'id':_0x2cf4e5[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x50bc15,null))[_0xcfc4('0x23')](function(_0x323e06){if(_0x323e06){return _0x323e06[_0xcfc4('0x113')](_0x2cf4e5[_0xcfc4('0x45')]['ids'])[_0xcfc4('0x23')](function(){if(_[_0xcfc4('0x114')](_0x2cf4e5[_0xcfc4('0x45')][_0xcfc4('0x6c')])){for(var _0x9ce737=0x0;_0x9ce737<_0x2cf4e5['query'][_0xcfc4('0x6c')][_0xcfc4('0x49')];_0x9ce737+=0x1){socket[_0xcfc4('0x112')]('userChatWebsite:remove',{'UserId':Number(_0x2cf4e5[_0xcfc4('0x45')][_0xcfc4('0x6c')][_0x9ce737]),'ChatWebsiteId':Number(_0x2cf4e5[_0xcfc4('0x58')]['id'])});}}else{socket['emit'](_0xcfc4('0x115'),{'UserId':Number(_0x2cf4e5[_0xcfc4('0x45')]['ids']),'ChatWebsiteId':Number(_0x2cf4e5['params']['id'])});}});}})[_0xcfc4('0x23')](respondWithStatusCode(_0x50bc15,null))['catch'](handleError(_0x50bc15,null));};exports[_0xcfc4('0x116')]=function(_0xb993c5,_0x324b06,_0x5c398c){var _0x41be9b={};var _0x5f551a={};var _0x27c40b;var _0xadc3a;return db[_0xcfc4('0x41')][_0xcfc4('0x66')]({'where':{'id':_0xb993c5[_0xcfc4('0x58')]['id']}})[_0xcfc4('0x23')](handleEntityNotFound(_0x324b06,null))[_0xcfc4('0x23')](function(_0x3ad108){if(_0x3ad108){_0x27c40b=_0x3ad108;_0x5f551a['model']=_['keys'](db[_0xcfc4('0xc3')][_0xcfc4('0x42')]);_0x5f551a['query']=_[_0xcfc4('0x44')](_0xb993c5[_0xcfc4('0x45')]);_0x5f551a['filters']=_[_0xcfc4('0x47')](_0x5f551a[_0xcfc4('0x43')],_0x5f551a[_0xcfc4('0x45')]);_0x41be9b[_0xcfc4('0x48')]=_['intersection'](_0x5f551a[_0xcfc4('0x43')],qs[_0xcfc4('0x67')](_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x67')]));_0x41be9b['attributes']=_0x41be9b['attributes']['length']?_0x41be9b['attributes']:_0x5f551a[_0xcfc4('0x43')];_0x41be9b[_0xcfc4('0x4a')]=qs[_0xcfc4('0x4b')](_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x4b')]);_0x41be9b[_0xcfc4('0x4c')]=qs[_0xcfc4('0x46')](_[_0xcfc4('0x4d')](_0xb993c5[_0xcfc4('0x45')],_0x5f551a[_0xcfc4('0x46')]));if(_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x53')]){_0x41be9b['where']=_[_0xcfc4('0x4e')](_0x41be9b[_0xcfc4('0x4c')],{'$or':_[_0xcfc4('0x4f')](_0x41be9b['attributes'],function(_0x165774){var _0x1055b4={};_0x1055b4[_0x165774]={'$like':'%'+_0xb993c5[_0xcfc4('0x45')]['filter']+'%'};return _0x1055b4;})});}_0x41be9b=_[_0xcfc4('0x4e')]({},_0x41be9b,_0xb993c5[_0xcfc4('0x6a')]);return _0x27c40b[_0xcfc4('0x116')](_0x41be9b);}})[_0xcfc4('0x23')](function(_0x1bb148){if(_0x1bb148){_0xadc3a=_0x1bb148['length'];if(!_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x68')](_0xcfc4('0x6f'))){_0x41be9b[_0xcfc4('0x33')]=qs[_0xcfc4('0x33')](_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x33')]);_0x41be9b[_0xcfc4('0x32')]=qs['offset'](_0xb993c5[_0xcfc4('0x45')][_0xcfc4('0x32')]);}return _0x27c40b[_0xcfc4('0x116')](_0x41be9b);}})[_0xcfc4('0x23')](function(_0x364fc4){if(_0x364fc4){return _0x364fc4?{'count':_0xadc3a,'rows':_0x364fc4}:null;}})[_0xcfc4('0x23')](respondWithResult(_0x324b06,null))[_0xcfc4('0x2d')](handleError(_0x324b06,null));}; \ No newline at end of file +var _0xf1d4=['User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','notify','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','offlineMessageSubject','addInteraction','Contact','Owner','fullname','internal','Tag','Tags','color','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','utf8','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','sequelize','getApplications','addProactiveActions','omit','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','html-pdf','zip-dir','moment','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','Content-Range','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','mandatoryDispositionPause','ChatWebsite','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','key','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','Pause','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','contact','lastName','customerIp','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','push','unmanaged','*,*,*,*'];(function(_0x18d50f,_0x124aff){var _0x8ce385=function(_0x321962){while(--_0x321962){_0x18d50f['push'](_0x18d50f['shift']());}};_0x8ce385(++_0x124aff);}(_0xf1d4,0x17a));var _0x4f1d=function(_0x440c10,_0xc77992){_0x440c10=_0x440c10-0x0;var _0x50cd82=_0xf1d4[_0x440c10];return _0x50cd82;};'use strict';var pdf=require(_0x4f1d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f1d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4f1d('0x3'));var path=require(_0x4f1d('0x4'));var sox=require('sox');var csv=require(_0x4f1d('0x5'));var ejs=require(_0x4f1d('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4f1d('0x7'));var crypto=require('crypto');var jsforce=require(_0x4f1d('0x8'));var deskjs=require(_0x4f1d('0x9'));var toCsv=require('to-csv');var querystring=require(_0x4f1d('0xa'));var Papa=require(_0x4f1d('0xb'));var Redis=require(_0x4f1d('0xc'));var authService=require(_0x4f1d('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4f1d('0xe'));var logger=require(_0x4f1d('0xf'))(_0x4f1d('0x10'));var utils=require(_0x4f1d('0x11'));var config=require(_0x4f1d('0x12'));var db=require(_0x4f1d('0x13'))['db'];config[_0x4f1d('0x14')]=_['defaults'](config[_0x4f1d('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f1d('0x15'))(new Redis(config[_0x4f1d('0x14')]));require(_0x4f1d('0x16'))[_0x4f1d('0x17')](socket);var jayson=require(_0x4f1d('0x18'));var client=jayson[_0x4f1d('0x19')][_0x4f1d('0x1a')]({'port':0x232c});var client9002=jayson[_0x4f1d('0x19')][_0x4f1d('0x1a')]({'port':0x232a});var client9003=jayson[_0x4f1d('0x19')][_0x4f1d('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x5ba753,_0x1f3e94,_0x19dd6f){if(_0x19dd6f){var _0x34ce0b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34ce0b[_0x4f1d('0x1b')](_0x1f3e94)){return _0x5ba753;}else{throw new Error(_0x4f1d('0x1c'));}}else{return _0x5ba753;}}function respondWithRpcPromise(_0x3abb87,_0x169b86,_0x5ad7be,_0x57fe76){return new BPromise(function(_0x54ea77,_0x49cda6){var _0x1db665=_0x57fe76||client;return _0x1db665[_0x4f1d('0x1d')](_0x3abb87,_0x5ad7be)['then'](function(_0x289a83){logger[_0x4f1d('0x1e')](_0x4f1d('0x1f'),_0x169b86,_0x4f1d('0x20'));logger[_0x4f1d('0x21')](_0x4f1d('0x22'),_0x169b86,_0x4f1d('0x20'),JSON[_0x4f1d('0x23')](_0x289a83));if(_0x289a83['error']){if(_0x289a83[_0x4f1d('0x24')][_0x4f1d('0x25')]===0x1f4){logger['error'](_0x4f1d('0x1f'),_0x169b86,_0x289a83['error'][_0x4f1d('0x26')]);return _0x49cda6(_0x289a83[_0x4f1d('0x24')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x169b86,_0x289a83[_0x4f1d('0x24')][_0x4f1d('0x26')]);return _0x54ea77(_0x289a83[_0x4f1d('0x24')]['message']);}else{logger[_0x4f1d('0x1e')](_0x4f1d('0x1f'),_0x169b86,_0x4f1d('0x20'));_0x54ea77(_0x289a83[_0x4f1d('0x27')][_0x4f1d('0x26')]);}})[_0x4f1d('0x28')](function(_0x47f639){logger['error'](_0x4f1d('0x1f'),_0x169b86,_0x47f639);_0x49cda6(_0x47f639);});});}function respondWithStatusCode(_0x81ed47,_0x4f38ad){_0x4f38ad=_0x4f38ad||0xcc;return function(_0x1c8416){if(_0x1c8416){return _0x81ed47[_0x4f1d('0x29')](_0x4f38ad);}return _0x81ed47[_0x4f1d('0x2a')](_0x4f38ad)['end']();};}function respondWithResult(_0x24dd17,_0x1ba825){_0x1ba825=_0x1ba825||0xc8;return function(_0xc0b061){if(_0xc0b061){return _0x24dd17['status'](_0x1ba825)[_0x4f1d('0x2b')](_0xc0b061);}};}function respondWithFilteredResult(_0x27fb93,_0x2ce13d){return function(_0x2ebcb4){if(_0x2ebcb4){var _0xd59230=_0x2ebcb4['count'],_0x199a57=_0x2ce13d[_0x4f1d('0x2c')],_0x47dea6=_0x2ce13d[_0x4f1d('0x2c')]+_0x2ce13d['limit'],_0x35205c;if(_0x47dea6>=_0xd59230){_0x47dea6=_0xd59230;_0x35205c=0xc8;}else{_0x35205c=0xce;}_0x27fb93[_0x4f1d('0x2a')](_0x35205c);return _0x27fb93['set'](_0x4f1d('0x2d'),_0x199a57+'-'+_0x47dea6+'/'+_0xd59230)['json'](_0x2ebcb4);}return null;};}function patchUpdates(_0x5c33b9){return function(_0x2151e3){try{jsonpatch['apply'](_0x2151e3,_0x5c33b9,!![]);}catch(_0x1c1b8c){return BPromise[_0x4f1d('0x2e')](_0x1c1b8c);}return _0x2151e3[_0x4f1d('0x2f')]();};}function saveUpdates(_0x74a31a,_0x51b396){return function(_0x1771ba){if(_0x1771ba){return _0x1771ba[_0x4f1d('0x30')](_0x74a31a)[_0x4f1d('0x31')](function(_0x182354){return _0x182354;});}return null;};}function removeEntity(_0x5a5bfd,_0x3cb70c){return function(_0xd4dd6d){if(_0xd4dd6d){return _0xd4dd6d[_0x4f1d('0x32')]()[_0x4f1d('0x31')](function(){var _0x56ea81=_0xd4dd6d[_0x4f1d('0x33')]({'plain':!![]});var _0x525f76=_0x4f1d('0x34');return db[_0x4f1d('0x35')][_0x4f1d('0x32')]({'where':{'type':_0x525f76,'resourceId':_0x56ea81['id']}})[_0x4f1d('0x31')](function(){return _0xd4dd6d;});})['then'](function(){_0x5a5bfd[_0x4f1d('0x2a')](0xcc)[_0x4f1d('0x36')]();});}};}function handleEntityNotFound(_0x225305,_0x15bb2f){return function(_0x55b102){if(!_0x55b102){_0x225305[_0x4f1d('0x29')](0x194);}return _0x55b102;};}function handleError(_0x56901d,_0x2aef76){_0x2aef76=_0x2aef76||0x1f4;return function(_0x54452b){logger['error'](_0x54452b[_0x4f1d('0x37')]);if(_0x54452b[_0x4f1d('0x38')]){delete _0x54452b['name'];}_0x56901d[_0x4f1d('0x2a')](_0x2aef76)[_0x4f1d('0x39')](_0x54452b);};}exports['index']=function(_0x972185,_0x3a24f5){var _0x2c817c={'include':[{'model':db['Pause'],'as':_0x4f1d('0x3a')}]},_0x223910={},_0x374a86={'count':0x0,'rows':[]};var _0x34296d=db[_0x4f1d('0x3b')]['rawAttributes'];_0x223910[_0x4f1d('0x3c')]=_['keys'](_0x34296d);_0x223910['query']=_['keys'](_0x972185[_0x4f1d('0x3d')]);_0x223910[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x223910[_0x4f1d('0x3c')],_0x223910[_0x4f1d('0x3d')]);_0x2c817c[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0x223910['model'],qs[_0x4f1d('0x41')](_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x2c817c[_0x4f1d('0x40')]=_0x2c817c[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0x2c817c[_0x4f1d('0x40')]:_0x223910[_0x4f1d('0x3c')];if(!_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0x2c817c[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x45')]);_0x2c817c['offset']=qs[_0x4f1d('0x2c')](_0x972185[_0x4f1d('0x3d')]['offset']);}_0x2c817c[_0x4f1d('0x46')]=qs[_0x4f1d('0x47')](_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x47')]);_0x2c817c[_0x4f1d('0x48')]=qs[_0x4f1d('0x3e')](_['pick'](_0x972185[_0x4f1d('0x3d')],_0x223910['filters']));if(_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x49')]){_0x2c817c[_0x4f1d('0x48')]=_[_0x4f1d('0x4a')](_0x2c817c[_0x4f1d('0x48')],{'$or':_['map'](_0x34296d,function(_0xdf22f7){if(_0xdf22f7['type'][_0x4f1d('0x4b')]!==_0x4f1d('0x4c')){var _0x5cfa9d={};_0x5cfa9d[_0xdf22f7['field']]={'$like':'%'+_0x972185[_0x4f1d('0x3d')]['filter']+'%'};return _0x5cfa9d;}})});}_0x2c817c=_[_0x4f1d('0x4a')]({},_0x2c817c,_0x972185[_0x4f1d('0x4d')]);var _0x4c5352={'where':_0x2c817c['where']};return db[_0x4f1d('0x3b')][_0x4f1d('0x4e')](_0x4c5352)[_0x4f1d('0x31')](function(_0x7c6336){_0x374a86[_0x4f1d('0x4e')]=_0x7c6336;if(_0x972185[_0x4f1d('0x3d')][_0x4f1d('0x4f')]){_0x2c817c[_0x4f1d('0x50')]=[{'all':!![]}];}return db[_0x4f1d('0x3b')][_0x4f1d('0x51')](_0x2c817c);})[_0x4f1d('0x31')](function(_0x2ba66a){_0x374a86[_0x4f1d('0x52')]=_0x2ba66a;return _0x374a86;})[_0x4f1d('0x31')](respondWithFilteredResult(_0x3a24f5,_0x2c817c))[_0x4f1d('0x28')](handleError(_0x3a24f5,null));};exports[_0x4f1d('0x53')]=function(_0x7ab054,_0x12eed8){var _0x385c6d={'raw':![],'where':{'id':_0x7ab054[_0x4f1d('0x54')]['id']},'include':[{'model':db[_0x4f1d('0x55')],'as':_0x4f1d('0x3a')}]},_0x55d216={};_0x55d216[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db['ChatWebsite']['rawAttributes']);_0x55d216[_0x4f1d('0x3d')]=_[_0x4f1d('0x56')](_0x7ab054[_0x4f1d('0x3d')]);_0x55d216[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x55d216['model'],_0x55d216[_0x4f1d('0x3d')]);_0x385c6d['attributes']=_[_0x4f1d('0x3f')](_0x55d216[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x7ab054[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x385c6d[_0x4f1d('0x40')]=_0x385c6d['attributes'][_0x4f1d('0x42')]?_0x385c6d[_0x4f1d('0x40')]:_0x55d216['model'];if(_0x7ab054[_0x4f1d('0x3d')][_0x4f1d('0x4f')]){_0x385c6d[_0x4f1d('0x50')]=[{'all':!![]}];}_0x385c6d=_[_0x4f1d('0x4a')]({},_0x385c6d,_0x7ab054['options']);return db['ChatWebsite'][_0x4f1d('0x57')](_0x385c6d)['then'](handleEntityNotFound(_0x12eed8,null))['then'](respondWithResult(_0x12eed8,null))['catch'](handleError(_0x12eed8,null));};exports[_0x4f1d('0x58')]=function(_0x475799,_0x410af1){return db['ChatWebsite']['create'](_0x475799['body'],{})[_0x4f1d('0x31')](function(_0x12077c){var _0x314e65=_0x475799[_0x4f1d('0x59')][_0x4f1d('0x33')]({'plain':!![]});if(!_0x314e65)throw new Error(_0x4f1d('0x5a'));if(_0x314e65[_0x4f1d('0x5b')]==='user'){var _0x1576f2=_0x12077c[_0x4f1d('0x33')]({'plain':!![]});var _0x50f5c7=_0x4f1d('0x34');return db[_0x4f1d('0x5c')][_0x4f1d('0x57')]({'where':{'name':_0x50f5c7,'userProfileId':_0x314e65[_0x4f1d('0x5d')]},'raw':!![]})[_0x4f1d('0x31')](function(_0x5cee57){if(_0x5cee57&&_0x5cee57[_0x4f1d('0x5e')]===0x0){return db[_0x4f1d('0x35')][_0x4f1d('0x58')]({'name':_0x1576f2[_0x4f1d('0x38')],'resourceId':_0x1576f2['id'],'type':_0x5cee57[_0x4f1d('0x38')],'sectionId':_0x5cee57['id']},{})['then'](function(){return _0x12077c;});}else{return _0x12077c;}})[_0x4f1d('0x28')](function(_0x56d067){logger['error'](_0x4f1d('0x5f'),_0x56d067);throw _0x56d067;});}return _0x12077c;})[_0x4f1d('0x31')](respondWithResult(_0x410af1,0xc9))[_0x4f1d('0x28')](handleError(_0x410af1,null));};exports[_0x4f1d('0x30')]=function(_0x449ff5,_0x33132a){if(_0x449ff5['body']['id']){delete _0x449ff5['body']['id'];}return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x449ff5['params']['id']},'include':[{'model':db['Pause'],'as':_0x4f1d('0x3a')}]})[_0x4f1d('0x31')](handleEntityNotFound(_0x33132a,null))['then'](saveUpdates(_0x449ff5[_0x4f1d('0x60')],null))[_0x4f1d('0x31')](respondWithResult(_0x33132a,null))['catch'](handleError(_0x33132a,null));};exports[_0x4f1d('0x32')]=function(_0x29258c,_0x2d1b92){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x29258c[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x2d1b92,null))[_0x4f1d('0x31')](removeEntity(_0x2d1b92,null))[_0x4f1d('0x28')](handleError(_0x2d1b92,null));};exports[_0x4f1d('0x61')]=function(_0x498ba8,_0x5c7ed4){return db[_0x4f1d('0x3b')][_0x4f1d('0x61')]()['then'](respondWithResult(_0x5c7ed4,null))['catch'](handleError(_0x5c7ed4,null));};exports['addDisposition']=function(_0x4fbe33,_0x5bbb91,_0x3b05c4){if(_0x4fbe33[_0x4f1d('0x60')]['id']){delete _0x4fbe33[_0x4f1d('0x60')]['id'];}return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x4fbe33[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x5bbb91,null))['then'](function(_0x287b35){if(_0x287b35){_0x4fbe33[_0x4f1d('0x60')][_0x4f1d('0x62')]=_0x287b35['id'];return db[_0x4f1d('0x63')]['create'](_0x4fbe33[_0x4f1d('0x60')]);}})[_0x4f1d('0x31')](respondWithResult(_0x5bbb91,null))[_0x4f1d('0x28')](handleError(_0x5bbb91,null));};exports[_0x4f1d('0x64')]=function(_0x4046e7,_0x4d87b9,_0x59a6bd){var _0x444fc9={'raw':![],'where':{}};var _0x314820={};var _0x1fbf81={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4f1d('0x65')]({'where':{'id':_0x4046e7[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x4d87b9,null))['then'](function(_0x27f8ed){if(_0x27f8ed){_0x314820[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db[_0x4f1d('0x63')]['rawAttributes']);_0x314820[_0x4f1d('0x3d')]=_[_0x4f1d('0x56')](_0x4046e7[_0x4f1d('0x3d')]);_0x314820[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x314820[_0x4f1d('0x3c')],_0x314820['query']);_0x444fc9[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0x314820[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x4046e7[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x444fc9[_0x4f1d('0x40')]=_0x444fc9[_0x4f1d('0x40')]['length']?_0x444fc9[_0x4f1d('0x40')]:_0x314820[_0x4f1d('0x3c')];if(!_0x4046e7[_0x4f1d('0x3d')][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0x444fc9[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x4046e7['query'][_0x4f1d('0x45')]);_0x444fc9[_0x4f1d('0x2c')]=qs['offset'](_0x4046e7['query']['offset']);}_0x444fc9[_0x4f1d('0x46')]=qs[_0x4f1d('0x47')](_0x4046e7[_0x4f1d('0x3d')][_0x4f1d('0x47')]);_0x444fc9[_0x4f1d('0x48')]=qs['filters'](_[_0x4f1d('0x66')](_0x4046e7[_0x4f1d('0x3d')],_0x314820[_0x4f1d('0x3e')]));_0x444fc9[_0x4f1d('0x48')]['ChatWebsiteId']=_0x27f8ed['id'];if(_0x4046e7['query']['filter']){_0x444fc9[_0x4f1d('0x48')]=_[_0x4f1d('0x4a')](_0x444fc9[_0x4f1d('0x48')],{'$or':_[_0x4f1d('0x67')](_0x444fc9[_0x4f1d('0x40')],function(_0x12cde6){var _0x1031fe={};_0x1031fe[_0x12cde6]={'$like':'%'+_0x4046e7[_0x4f1d('0x3d')]['filter']+'%'};return _0x1031fe;})});}_0x444fc9=_['merge']({},_0x444fc9,_0x4046e7['options']);return db[_0x4f1d('0x63')][_0x4f1d('0x4e')]({'where':_0x444fc9[_0x4f1d('0x48')]})[_0x4f1d('0x31')](function(_0x1de078){_0x1fbf81['count']=_0x1de078;if(_0x4046e7[_0x4f1d('0x3d')][_0x4f1d('0x4f')]){_0x444fc9[_0x4f1d('0x50')]=[{'all':!![]}];}return db[_0x4f1d('0x63')][_0x4f1d('0x51')](_0x444fc9);})['then'](function(_0x54c0cb){_0x1fbf81[_0x4f1d('0x52')]=_0x54c0cb;return _0x1fbf81;});}})[_0x4f1d('0x31')](respondWithFilteredResult(_0x4d87b9,_0x444fc9))[_0x4f1d('0x28')](handleError(_0x4d87b9,null));};exports[_0x4f1d('0x68')]=function(_0xb6815,_0x48b858,_0x25acbd){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0xb6815[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x48b858,null))[_0x4f1d('0x31')](function(_0x453658){if(_0x453658){return _0x453658[_0x4f1d('0x68')](_0xb6815[_0x4f1d('0x3d')][_0x4f1d('0x69')]);}})[_0x4f1d('0x31')](respondWithStatusCode(_0x48b858,null))[_0x4f1d('0x28')](handleError(_0x48b858,null));};exports[_0x4f1d('0x6a')]=function(_0x5e8aa9,_0x134a21,_0xeadeeb){if(_0x5e8aa9['body']['id']){delete _0x5e8aa9[_0x4f1d('0x60')]['id'];}return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x5e8aa9[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x134a21,null))[_0x4f1d('0x31')](function(_0x368eb2){if(_0x368eb2){_0x5e8aa9[_0x4f1d('0x60')]['ChatWebsiteId']=_0x368eb2['id'];return db[_0x4f1d('0x6b')][_0x4f1d('0x58')](_0x5e8aa9['body']);}})[_0x4f1d('0x31')](respondWithResult(_0x134a21,null))[_0x4f1d('0x28')](handleError(_0x134a21,null));};exports[_0x4f1d('0x6c')]=function(_0x1f22fe,_0x5332b9,_0x240665){var _0xed3f3a={'raw':![],'where':{}};var _0x43cebe={};var _0x51d6b7={'count':0x0,'rows':[]};return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x1f22fe[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x5332b9,null))[_0x4f1d('0x31')](function(_0xe1aee0){if(_0xe1aee0){_0x43cebe[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db['CannedAnswer'][_0x4f1d('0x6d')]);_0x43cebe[_0x4f1d('0x3d')]=_[_0x4f1d('0x56')](_0x1f22fe[_0x4f1d('0x3d')]);_0x43cebe[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x43cebe[_0x4f1d('0x3c')],_0x43cebe[_0x4f1d('0x3d')]);_0xed3f3a[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0x43cebe[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x1f22fe[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0xed3f3a[_0x4f1d('0x40')]=_0xed3f3a[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0xed3f3a['attributes']:_0x43cebe['model'];if(!_0x1f22fe['query'][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0xed3f3a[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x1f22fe[_0x4f1d('0x3d')][_0x4f1d('0x45')]);_0xed3f3a['offset']=qs['offset'](_0x1f22fe[_0x4f1d('0x3d')][_0x4f1d('0x2c')]);}_0xed3f3a['order']=qs['sort'](_0x1f22fe[_0x4f1d('0x3d')]['sort']);_0xed3f3a[_0x4f1d('0x48')]=qs[_0x4f1d('0x3e')](_[_0x4f1d('0x66')](_0x1f22fe[_0x4f1d('0x3d')],_0x43cebe[_0x4f1d('0x3e')]));_0xed3f3a[_0x4f1d('0x48')][_0x4f1d('0x62')]=_0xe1aee0['id'];if(_0x1f22fe[_0x4f1d('0x3d')][_0x4f1d('0x49')]){_0xed3f3a['where']=_[_0x4f1d('0x4a')](_0xed3f3a[_0x4f1d('0x48')],{'$or':_['map'](_0xed3f3a[_0x4f1d('0x40')],function(_0x2cc0be){var _0x420dc4={};_0x420dc4[_0x2cc0be]={'$like':'%'+_0x1f22fe[_0x4f1d('0x3d')][_0x4f1d('0x49')]+'%'};return _0x420dc4;})});}_0xed3f3a=_[_0x4f1d('0x4a')]({},_0xed3f3a,_0x1f22fe['options']);return db[_0x4f1d('0x6b')][_0x4f1d('0x4e')]({'where':_0xed3f3a['where']})[_0x4f1d('0x31')](function(_0x37e2da){_0x51d6b7[_0x4f1d('0x4e')]=_0x37e2da;if(_0x1f22fe[_0x4f1d('0x3d')]['includeAll']){_0xed3f3a['include']=[{'all':!![]}];}return db[_0x4f1d('0x6b')][_0x4f1d('0x51')](_0xed3f3a);})['then'](function(_0x547c17){_0x51d6b7['rows']=_0x547c17;return _0x51d6b7;});}})[_0x4f1d('0x31')](respondWithFilteredResult(_0x5332b9,_0xed3f3a))[_0x4f1d('0x28')](handleError(_0x5332b9,null));};exports[_0x4f1d('0x6e')]=function(_0x25bad1,_0x12482e,_0x304677){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x25bad1['params']['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x12482e,null))[_0x4f1d('0x31')](function(_0x2c2b10){if(_0x2c2b10){return _0x2c2b10[_0x4f1d('0x6e')](_0x25bad1[_0x4f1d('0x3d')]['ids']);}})[_0x4f1d('0x31')](respondWithStatusCode(_0x12482e,null))[_0x4f1d('0x28')](handleError(_0x12482e,null));};exports[_0x4f1d('0x6f')]=function(_0x312428,_0x4c0fdc,_0x19ecca){_0x312428[_0x4f1d('0x60')][_0x4f1d('0x70')]=_0x312428[_0x4f1d('0x71')][_0x4f1d('0x72')];return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x312428[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x4c0fdc,null))[_0x4f1d('0x31')](saveUpdates(_0x312428[_0x4f1d('0x60')],null))['then'](respondWithResult(_0x4c0fdc,null))[_0x4f1d('0x28')](handleError(_0x4c0fdc,null));};exports[_0x4f1d('0x73')]=function(_0x326db4,_0x195d77,_0x3536de){_0x326db4[_0x4f1d('0x60')][_0x4f1d('0x74')]=_0x326db4[_0x4f1d('0x71')]['filename'];return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x326db4[_0x4f1d('0x54')]['id']}})['then'](handleEntityNotFound(_0x195d77,null))['then'](saveUpdates(_0x326db4['body'],null))['then'](respondWithResult(_0x195d77,null))[_0x4f1d('0x28')](handleError(_0x195d77,null));};exports[_0x4f1d('0x75')]=function(_0x56341b,_0x306485,_0x281be3){_0x56341b[_0x4f1d('0x60')][_0x4f1d('0x76')]=_0x56341b[_0x4f1d('0x71')][_0x4f1d('0x72')];return db[_0x4f1d('0x3b')]['find']({'where':{'id':_0x56341b['params']['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x306485,null))[_0x4f1d('0x31')](saveUpdates(_0x56341b[_0x4f1d('0x60')],null))['then'](respondWithResult(_0x306485,null))[_0x4f1d('0x28')](handleError(_0x306485,null));};exports[_0x4f1d('0x77')]=function(_0x3881f1,_0x13ca9a,_0x1868f8){_0x3881f1[_0x4f1d('0x60')][_0x4f1d('0x78')]=_0x3881f1['file'][_0x4f1d('0x72')];return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x3881f1['params']['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x13ca9a,null))[_0x4f1d('0x31')](saveUpdates(_0x3881f1[_0x4f1d('0x60')],null))[_0x4f1d('0x31')](respondWithResult(_0x13ca9a,null))['catch'](handleError(_0x13ca9a,null));};exports[_0x4f1d('0x79')]=function(_0x897d06,_0xb023a2,_0x46a91c){var _0x164c1f=path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x7c'));var _0x5e3705={'where':{'id':_0x897d06[_0x4f1d('0x54')]['id']},'attributes':['id',_0x4f1d('0x70')],'raw':!![]};var _0x4bf2ef=![];return require(_0x4f1d('0x7d'))['getLicense']()[_0x4f1d('0x31')](function(_0x48eed9){if(_0x48eed9){_0x4bf2ef=_0x48eed9[_0x4f1d('0x7e')];}})[_0x4f1d('0x31')](function(){return db[_0x4f1d('0x3b')]['find'](_0x5e3705);})['then'](handleEntityNotFound(_0xb023a2,null))[_0x4f1d('0x31')](function(_0x1543df){if(_0x1543df){if(!_[_0x4f1d('0x7f')](_0x1543df['sitepic'])){if(fs[_0x4f1d('0x80')](path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x81'),_0x1543df[_0x4f1d('0x70')]))&&_0x4bf2ef){_0x164c1f=path['join'](config['root'],_0x4f1d('0x81'),_0x1543df[_0x4f1d('0x70')]);}}return _0xb023a2[_0x4f1d('0x82')](_0x164c1f);}})[_0x4f1d('0x28')](handleError(_0xb023a2,null));};exports[_0x4f1d('0x83')]=function(_0x3f1a32,_0x526ca6,_0x30b116){var _0x48a27f=path['join'](config['root'],_0x4f1d('0x84'));var _0x4253b6={'where':{'id':_0x3f1a32['params']['id']},'attributes':['id',_0x4f1d('0x74')],'raw':!![]};return db[_0x4f1d('0x3b')][_0x4f1d('0x57')](_0x4253b6)['then'](handleEntityNotFound(_0x526ca6,null))['then'](function(_0x37a531){if(_0x37a531){if(!_[_0x4f1d('0x7f')](_0x37a531[_0x4f1d('0x74')])){if(fs['existsSync'](path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],'server/files/images/avatars/',_0x37a531[_0x4f1d('0x74')]))){_0x48a27f=path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x85'),_0x37a531[_0x4f1d('0x74')]);}}return _0x526ca6[_0x4f1d('0x82')](_0x48a27f);}})[_0x4f1d('0x28')](handleError(_0x526ca6,null));};exports[_0x4f1d('0x86')]=function(_0x3d9864,_0x174789,_0x562d86){var _0x37358c=path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x87'));var _0x1e9f39={'where':{'id':_0x3d9864['params']['id']},'attributes':['id',_0x4f1d('0x76'),_0x4f1d('0x88')],'raw':!![]};return db[_0x4f1d('0x3b')][_0x4f1d('0x57')](_0x1e9f39)[_0x4f1d('0x31')](handleEntityNotFound(_0x174789,null))[_0x4f1d('0x31')](function(_0x514bb0){if(_0x514bb0){if(!_[_0x4f1d('0x7f')](_0x514bb0['customerAvatar'])){if(fs[_0x4f1d('0x80')](path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x85'),_0x514bb0[_0x4f1d('0x76')]))&&_0x514bb0[_0x4f1d('0x88')]){_0x37358c=path['join'](config[_0x4f1d('0x7b')],_0x4f1d('0x85'),_0x514bb0[_0x4f1d('0x76')]);}}return _0x174789[_0x4f1d('0x82')](_0x37358c);}})[_0x4f1d('0x28')](handleError(_0x174789,null));};exports[_0x4f1d('0x89')]=function(_0x15b93e,_0x273d31,_0x3ac65e){var _0x3c8069=path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x8a'));var _0x276307={'where':{'id':_0x15b93e[_0x4f1d('0x54')]['id']},'attributes':['id',_0x4f1d('0x78')],'raw':!![]};return db[_0x4f1d('0x3b')]['find'](_0x276307)[_0x4f1d('0x31')](handleEntityNotFound(_0x273d31,null))[_0x4f1d('0x31')](function(_0x2f3a9f){if(_0x2f3a9f){if(!_[_0x4f1d('0x7f')](_0x2f3a9f[_0x4f1d('0x78')])){if(fs[_0x4f1d('0x80')](path['join'](config[_0x4f1d('0x7b')],_0x4f1d('0x85'),_0x2f3a9f[_0x4f1d('0x78')]))){_0x3c8069=path['join'](config[_0x4f1d('0x7b')],_0x4f1d('0x85'),_0x2f3a9f[_0x4f1d('0x78')]);}}return _0x273d31[_0x4f1d('0x82')](_0x3c8069);}})[_0x4f1d('0x28')](handleError(_0x273d31,null));};exports['notify']=function(_0x2bde3f,_0x2a029a,_0x47d4a2){var _0x43f0f5=require(_0x4f1d('0x8b'));var _0x5eaf9d=new _0x43f0f5();var _0x48579f=_0x5eaf9d[_0x4f1d('0x8c')](_0x2bde3f[_0x4f1d('0x8d')][_0x4f1d('0x8e')])['getResult']();var _0x1d3560={'body':_0x2bde3f[_0x4f1d('0x60')],'channel':_0x4f1d('0x8f')};var _0x9a142a=[];var _0x4722f1=[];var _0x1a7601={};var _0x46b078=![];return db['CmContact'][_0x4f1d('0x61')]()[_0x4f1d('0x31')](function(_0x51e266){if(!_0x51e266){throw new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))](_0x4f1d('0x92'));}_0x9a142a=_[_0x4f1d('0x93')](_[_0x4f1d('0x56')](_0x51e266),[_0x4f1d('0x94'),'updatedAt']);_0x4722f1=_['difference'](_[_0x4f1d('0x56')](_0x51e266),[_0x4f1d('0x94'),_0x4f1d('0x95'),_0x4f1d('0x96'),_0x4f1d('0x97')]);if(_0x2bde3f[_0x4f1d('0x60')]['id']){delete _0x2bde3f[_0x4f1d('0x60')]['id'];}if(_[_0x4f1d('0x7f')](_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0x98')])){throw new db[(_0x4f1d('0x90'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2bde3f['body'][_0x4f1d('0x60')])||_0x2bde3f[_0x4f1d('0x60')]['body']===''){throw new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))](_0x4f1d('0x99'));}if(_[_0x4f1d('0x7f')](_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0x9a')])){throw new db['Sequelize'][(_0x4f1d('0x91'))](_0x4f1d('0x9b')+_0x4722f1);}if(!_[_0x4f1d('0x9c')](_0x4722f1,_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0x9a')])){throw new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))](_0x4f1d('0x9d')+_0x4722f1);}_0x1a7601[_0x2bde3f['body'][_0x4f1d('0x9a')]]=_0x2bde3f['body'][_0x4f1d('0x98')];})[_0x4f1d('0x31')](function(){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x2bde3f['params']['id']},'include':[{'model':db[_0x4f1d('0x9e')],'as':_0x4f1d('0x9f'),'include':[{'model':db[_0x4f1d('0xa0')],'as':_0x4f1d('0xa1'),'where':_0x1a7601,'limit':0x1,'order':[[_0x4f1d('0x95'),_0x4f1d('0xa2')]]}]},{'model':db[_0x4f1d('0xa3')],'as':_0x4f1d('0xa4')}]});})[_0x4f1d('0x31')](handleEntityNotFound(_0x2a029a,null))[_0x4f1d('0x31')](function(_0x755ec0){if(_0x755ec0&&_0x755ec0[_0x4f1d('0x9f')]){_0x1d3560[_0x4f1d('0xa5')]=_0x755ec0;_0x1d3560[_0x4f1d('0xa6')]=_0x755ec0[_0x4f1d('0xa4')];_0x1d3560[_0x4f1d('0xa7')]=_0x755ec0[_0x4f1d('0x9f')];_0x1d3560['applications']=_[_0x4f1d('0xa8')](_0x1d3560[_0x4f1d('0xa6')],[_0x4f1d('0xa9')],[_0x4f1d('0xaa')]);if(_0x1d3560[_0x4f1d('0xa5')][_0x4f1d('0xa4')]){delete _0x1d3560[_0x4f1d('0xa5')]['Applications'];}if(_0x1d3560[_0x4f1d('0xa5')][_0x4f1d('0x9f')]&&_0x1d3560[_0x4f1d('0xa5')][_0x4f1d('0x9f')]['Contacts'][_0x4f1d('0x42')]){return _0x1d3560[_0x4f1d('0xa5')][_0x4f1d('0x9f')][_0x4f1d('0xa1')][0x0];}var _0x145da8=_[_0x4f1d('0xab')](_0x2bde3f[_0x4f1d('0x60')],{'firstName':_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0x98')],'ListId':_0x755ec0[_0x4f1d('0x97')]});_0x145da8[_0x2bde3f[_0x4f1d('0x60')]['mapKey']]=_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0x98')];return db[_0x4f1d('0xa0')][_0x4f1d('0x58')](_0x145da8,{'fields':_0x9a142a,'raw':!![]});}})[_0x4f1d('0x31')](handleEntityNotFound(_0x2a029a,null))['then'](function(_0x445e63){_0x1d3560[_0x4f1d('0xac')]=_0x445e63;if(_0x445e63){var _0x1aab22={'ContactId':_0x445e63['id'],'ChatWebsiteId':_0x2bde3f[_0x4f1d('0x54')]['id'],'from':(_0x445e63['firstName']||'')+'\x20'+(_0x445e63[_0x4f1d('0xad')]||''),'customerIp':_0x2bde3f['body'][_0x4f1d('0xae')],'referer':_0x2bde3f[_0x4f1d('0x60')]['referer'],'browserName':_0x48579f['browser'][_0x4f1d('0x38')]&&_0x48579f[_0x4f1d('0xaf')][_0x4f1d('0xb0')]?util['format'](_0x4f1d('0xb1'),_0x48579f[_0x4f1d('0xaf')][_0x4f1d('0x38')],_0x48579f[_0x4f1d('0xaf')][_0x4f1d('0xb0')]):_0x4f1d('0xb2'),'browserVersion':_0x48579f[_0x4f1d('0xaf')][_0x4f1d('0xb0')]||_0x4f1d('0xb2'),'osName':util[_0x4f1d('0xb3')](_0x4f1d('0xb1'),_0x48579f['os'][_0x4f1d('0x38')],_0x48579f['os']['version']),'osVersion':_0x48579f['os'][_0x4f1d('0xb0')],'deviceModel':_0x48579f['device'][_0x4f1d('0x3c')]&&_0x48579f[_0x4f1d('0xb4')][_0x4f1d('0xb5')]?util['format'](_0x4f1d('0xb6'),_0x48579f['device'][_0x4f1d('0x3c')],_0x48579f[_0x4f1d('0xb4')][_0x4f1d('0xb5')],_0x48579f[_0x4f1d('0xb4')][_0x4f1d('0xb7')]):null,'deviceVendor':_0x48579f[_0x4f1d('0xb4')]['vendor'],'deviceType':_0x48579f[_0x4f1d('0xb4')][_0x4f1d('0xb7')],'formData':JSON[_0x4f1d('0x23')](_0x2bde3f['body'])};var _0x524058={'ChatWebsiteId':_0x2bde3f[_0x4f1d('0x54')]['id'],'closed':![]};if(_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xb8')]){_0x524058[_0x4f1d('0xb8')]=_0x2bde3f[_0x4f1d('0x60')]['threadId'];return db[_0x4f1d('0xb9')][_0x4f1d('0x57')]({'where':_0x524058})[_0x4f1d('0x31')](function(_0x523a0d){if(_0x523a0d){return[_0x523a0d,![]];}_0x1aab22[_0x4f1d('0xb8')]=_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xb8')];_0x1aab22['externalUrl']=_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xba')];return db['ChatInteraction'][_0x4f1d('0x58')](_0x1aab22)['then'](function(_0x2da86e){return[_0x2da86e,!![]];});});}_0x524058[_0x4f1d('0xbb')]=_0x445e63['id'];if(_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xbc')]&&_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xbc')]['id']){_0x524058['id']=_0x2bde3f['body'][_0x4f1d('0xbc')]['id'];return db[_0x4f1d('0xb9')][_0x4f1d('0x57')]({'where':_0x524058})[_0x4f1d('0x31')](function(_0x33a2e1){if(_0x33a2e1){return[_0x33a2e1,![]];}return db[_0x4f1d('0xb9')][_0x4f1d('0x58')](_0x1aab22)[_0x4f1d('0x31')](function(_0x5ad106){return[_0x5ad106,!![]];});});}return db[_0x4f1d('0xb9')]['create'](_0x1aab22)[_0x4f1d('0x31')](function(_0x33cb2a){return[_0x33cb2a,!![]];});}})[_0x4f1d('0xbd')](function(_0x1657cd,_0x37525f){if(_0x1657cd){_0x46b078=_0x37525f;if(!_0x37525f){var _0x1b312c={'from':(_0x1d3560[_0x4f1d('0xac')][_0x4f1d('0xbe')]||'')+'\x20'+(_0x1d3560[_0x4f1d('0xac')][_0x4f1d('0xad')]||'')};if(_0x2bde3f['body']['threadId']&&_0x2bde3f[_0x4f1d('0x60')]['messageId']&&_0x2bde3f['body']['threadId']!=_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xbf')]){_0x1b312c[_0x4f1d('0xb8')]=_0x2bde3f[_0x4f1d('0x60')][_0x4f1d('0xbf')];}return _0x1657cd['update'](_0x1b312c);}else{return _0x1657cd;}}})[_0x4f1d('0x31')](function(_0x199e87){_0x1d3560['interaction']=_0x199e87[_0x4f1d('0x33')]({'plain':!![]});_0x1d3560['interaction'][_0x4f1d('0xc0')]=_0x46b078;if(_0x1d3560[_0x4f1d('0xbc')][_0x4f1d('0xc0')]){if(_0x1d3560[_0x4f1d('0xa5')]['autoclose']){_0x1d3560[_0x4f1d('0xa6')][_0x4f1d('0xc1')]({'id':0x0,'priority':_0x1d3560[_0x4f1d('0xa6')]['length']+0x1,'app':'close','appdata':_0x4f1d('0xc2'),'interval':_0x4f1d('0xc3')});}}return db['ChatMessage'][_0x4f1d('0x58')]({'body':_0x2bde3f['body'][_0x4f1d('0x60')],'ChatWebsiteId':_0x2bde3f[_0x4f1d('0x54')]['id'],'ChatInteractionId':_0x199e87['id'],'direction':'in','ContactId':_0x1d3560[_0x4f1d('0xac')]['id'],'AttachmentId':_0x2bde3f[_0x4f1d('0x60')]['AttachmentId']});})[_0x4f1d('0x31')](function(_0x578bd1){_0x1d3560[_0x4f1d('0x26')]=_0x578bd1;if(_0x1d3560[_0x4f1d('0xbc')]['UserId']){return db[_0x4f1d('0xc4')][_0x4f1d('0x57')]({'attributes':['id',_0x4f1d('0x38')],'where':{'id':_0x1d3560[_0x4f1d('0xbc')][_0x4f1d('0xc5')]}})[_0x4f1d('0x31')](function(_0x3428a1){if(_0x3428a1){_0x1d3560[_0x4f1d('0xa6')][_0x4f1d('0xc6')]({'id':0x0,'priority':0x0,'app':_0x4f1d('0xc7'),'appdata':_0x3428a1[_0x4f1d('0x38')]+','+(_0x1d3560[_0x4f1d('0xa5')][_0x4f1d('0xc8')]||0xa),'interval':_0x4f1d('0xc3')});_0x1d3560[_0x4f1d('0xc9')]=!![];}return respondWithRpcPromise(_0x4f1d('0xca'),_0x4f1d('0xcb'),_0x1d3560);});}return respondWithRpcPromise('Start',_0x4f1d('0xcb'),_0x1d3560);})[_0x4f1d('0x31')](function(_0x359275){respondWithRpcPromise('EventManager','EventManager',{'event':_0x4f1d('0xcc'),'message':_0x359275},client9002);return _0x359275;})[_0x4f1d('0x31')](respondWithResult(_0x2a029a,null))[_0x4f1d('0x28')](handleError(_0x2a029a,null));};exports[_0x4f1d('0xcd')]=function(_0x2e8858,_0x57203e,_0x3f5e96){var _0x4bad0e,_0x4b9634,_0x44723b;var _0x4218e2=[];var _0x163c11=[];var _0x5aaac1={};return db['CmContact'][_0x4f1d('0x61')]()[_0x4f1d('0x31')](function(_0x4fc583){if(!_0x4fc583){throw new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))](_0x4f1d('0x92'));}_0x163c11=_[_0x4f1d('0x93')](_[_0x4f1d('0x56')](_0x4fc583),['createdAt',_0x4f1d('0x95')]);_0x4218e2=_['difference'](_['keys'](_0x4fc583),[_0x4f1d('0x94'),_0x4f1d('0x95'),_0x4f1d('0x96'),_0x4f1d('0x97')]);if(_0x2e8858['body']['id']){delete _0x2e8858[_0x4f1d('0x60')]['id'];}if(_[_0x4f1d('0x7f')](_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x98')])){throw _0x57203e['status'](0x1f4)[_0x4f1d('0x39')](new db[(_0x4f1d('0x90'))]['ValidationError'](_0x4f1d('0xce')));}if(_[_0x4f1d('0x7f')](_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x60')])||_0x2e8858['body'][_0x4f1d('0x60')]===''){throw _0x57203e[_0x4f1d('0x2a')](0x1f4)[_0x4f1d('0x39')](new db['Sequelize'][(_0x4f1d('0x91'))](_0x4f1d('0x99')));}if(_[_0x4f1d('0x7f')](_0x2e8858['body']['mapKeyOffline'])){throw _0x57203e[_0x4f1d('0x2a')](0x1f4)['send'](new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4218e2));}if(!_['includes'](_0x4218e2,_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0xcf')])){throw _0x57203e[_0x4f1d('0x2a')](0x1f4)['send'](new db[(_0x4f1d('0x90'))][(_0x4f1d('0x91'))](_0x4f1d('0xd0')+_0x4218e2));}_0x5aaac1[_0x2e8858['body']['mapKeyOffline']]=_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x98')];})[_0x4f1d('0x31')](function(){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x2e8858[_0x4f1d('0x54')]['id']},'include':[{'model':db[_0x4f1d('0x9e')],'as':_0x4f1d('0x9f')}]});})[_0x4f1d('0x31')](handleEntityNotFound(_0x57203e,null))[_0x4f1d('0x31')](function(_0x1c5f42){if(_0x1c5f42&&_0x1c5f42[_0x4f1d('0x9f')]){_0x4b9634=_0x1c5f42;var _0xdd8b4f=_[_0x4f1d('0xab')](_0x2e8858[_0x4f1d('0x60')],{'firstName':_0x2e8858['body'][_0x4f1d('0x98')],'phone':_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x98')],'ListId':_0x1c5f42[_0x4f1d('0x97')]});_0xdd8b4f[_0x2e8858['body'][_0x4f1d('0xcf')]]=_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x98')];return db['CmContact']['findOrCreate']({'where':_0x5aaac1,'defaults':_0xdd8b4f});}})['spread'](function(_0x2decb8){if(_0x2decb8){_0x44723b=_0x2decb8;var _0x8704dd=fs[_0x4f1d('0xd1')](path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0xd2')),'utf8');var _0x208b2d=ejs[_0x4f1d('0xd3')](_0x8704dd,{'body':_['toPairs'](_0x2e8858[_0x4f1d('0x60')][_0x4f1d('0x60')]),'bodyTitle':_0x4b9634[_0x4f1d('0xd4')]});return db['ChatOfflineMessage'][_0x4f1d('0x58')]({'body':_0x208b2d,'ContactId':_0x2decb8['id'],'ChatWebsiteId':_0x4b9634['id']});}})[_0x4f1d('0x31')](function(_0x434567){if(_0x434567){_0x4bad0e=_0x434567;return db[_0x4f1d('0xd5')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4f1d('0xd6')],'as':_0x4f1d('0xd7'),'raw':!![]}]});}})['then'](function(_0x530f3c){if(_0x530f3c&&_0x530f3c[_0x4f1d('0xd7')]&&_0x4b9634[_0x4f1d('0xd8')]){var _0x3d7a12={'tls':{'rejectUnauthorized':![]}};if(_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0xd9')]){_0x3d7a12[_0x4f1d('0xd9')]=_0x530f3c['Smtp'][_0x4f1d('0xd9')];}else{_0x3d7a12[_0x4f1d('0xda')]=_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0xda')];_0x3d7a12[_0x4f1d('0xdb')]=_0x530f3c['Smtp']['port'];_0x3d7a12[_0x4f1d('0xdc')]=_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0xdc')];}if(_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0xdd')]){_0x3d7a12[_0x4f1d('0xde')]={'user':_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0x59')],'pass':_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0xdf')]};}return respondWithRpcPromise(_0x4f1d('0xe0'),_0x4f1d('0xe1'),{'account':_0x3d7a12,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x530f3c[_0x4f1d('0x38')],_0x530f3c[_0x4f1d('0xe2')]||_0x530f3c[_0x4f1d('0xd7')][_0x4f1d('0x59')]),'to':_0x4b9634[_0x4f1d('0xd8')],'subject':_0x4b9634[_0x4f1d('0xe3')],'text':_0x4bad0e[_0x4f1d('0x60')]}},client9003)[_0x4f1d('0x31')](function(){return _0x4bad0e;})[_0x4f1d('0x28')](function(_0xc61c9a){console[_0x4f1d('0x24')](_0xc61c9a);});}})[_0x4f1d('0x31')](function(){if(_0x4bad0e){return _0x4bad0e;}})[_0x4f1d('0x31')](respondWithResult(_0x57203e,null))[_0x4f1d('0x28')](handleError(_0x57203e,null));};exports['addInteraction']=function(_0x33dd49,_0x546a50,_0x13381f){return db[_0x4f1d('0xb9')]['find']({'where':{'id':_0x33dd49[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x546a50,null))[_0x4f1d('0x31')](function(_0x4a336d){if(_0x4a336d){return _0x4a336d[_0x4f1d('0xe4')](_0x33dd49[_0x4f1d('0x60')][_0x4f1d('0x69')],_['omit'](_0x33dd49['body'],['ids','id'])||{});}})[_0x4f1d('0x31')](respondWithResult(_0x546a50,null))[_0x4f1d('0x28')](handleError(_0x546a50,null));};exports['getInteractions']=function(_0x59006c,_0x39a670,_0x4241fa){var _0x220864={'raw':![],'where':{}};var _0x4d38ad={};var _0x679566={'count':0x0,'rows':[]};return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x59006c[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x39a670,null))[_0x4f1d('0x31')](function(_0x54bc7d){if(_0x54bc7d){_0x4d38ad[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db[_0x4f1d('0xb9')]['rawAttributes']);_0x4d38ad['query']=_[_0x4f1d('0x56')](_0x59006c['query']);_0x4d38ad[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x4d38ad['model'],_0x4d38ad[_0x4f1d('0x3d')]);_0x220864[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0x4d38ad[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x59006c[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x220864[_0x4f1d('0x40')]=_0x220864[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0x220864['attributes']:_0x4d38ad['model'];if(!_0x59006c[_0x4f1d('0x3d')][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0x220864[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x59006c[_0x4f1d('0x3d')]['limit']);_0x220864[_0x4f1d('0x2c')]=qs[_0x4f1d('0x2c')](_0x59006c[_0x4f1d('0x3d')][_0x4f1d('0x2c')]);}_0x220864[_0x4f1d('0x46')]=qs[_0x4f1d('0x47')](_0x59006c[_0x4f1d('0x3d')][_0x4f1d('0x47')]);_0x220864['where']=qs[_0x4f1d('0x3e')](_[_0x4f1d('0x66')](_0x59006c[_0x4f1d('0x3d')],_0x4d38ad['filters']));_0x220864['where']['ChatWebsiteId']=_0x54bc7d['id'];if(_0x59006c[_0x4f1d('0x3d')][_0x4f1d('0x49')]){_0x220864[_0x4f1d('0x48')]=_[_0x4f1d('0x4a')](_0x220864[_0x4f1d('0x48')],{'$or':_[_0x4f1d('0x67')](_0x220864[_0x4f1d('0x40')],function(_0x12de00){var _0x2773bf={};_0x2773bf[_0x12de00]={'$like':'%'+_0x59006c['query'][_0x4f1d('0x49')]+'%'};return _0x2773bf;})});}_0x220864=_[_0x4f1d('0x4a')]({},_0x220864,_0x59006c[_0x4f1d('0x4d')]);return db[_0x4f1d('0xb9')][_0x4f1d('0x4e')]({'where':_0x220864[_0x4f1d('0x48')]})[_0x4f1d('0x31')](function(_0x2ca66f){_0x679566[_0x4f1d('0x4e')]=_0x2ca66f;if(_0x59006c['query'][_0x4f1d('0x4f')]){_0x220864[_0x4f1d('0x50')]=[{'model':db[_0x4f1d('0xa0')],'as':_0x4f1d('0xe5'),'required':![]},{'model':db[_0x4f1d('0xc4')],'as':_0x4f1d('0xe6'),'attributes':[_0x4f1d('0x38'),_0x4f1d('0xe7'),_0x4f1d('0xe8')],'required':![]},{'model':db[_0x4f1d('0xe9')],'as':_0x4f1d('0xea'),'attributes':['id',_0x4f1d('0x38'),_0x4f1d('0xeb')],'where':_0x59006c[_0x4f1d('0x3d')]['tag']?{'id':_0x59006c[_0x4f1d('0x3d')]['tag']}:undefined,'required':_0x59006c['query']['tag']?!![]:![]}];}return db['ChatInteraction'][_0x4f1d('0x51')](_0x220864);})[_0x4f1d('0x31')](function(_0x1674ea){_0x679566[_0x4f1d('0x52')]=_0x1674ea;return _0x679566;});}})[_0x4f1d('0x31')](respondWithFilteredResult(_0x39a670,_0x220864))[_0x4f1d('0x28')](handleError(_0x39a670,null));};function iftimePromise(_0x45a63d,_0x20d3d4){return respondWithRpcPromise(_0x4f1d('0xec'),_0x4f1d('0xed'),{'command':_0x20d3d4[_0x4f1d('0xee')]?util['format']('iftime\x20%s,%s',_0x45a63d['interval'],_0x20d3d4['timezone']):util['format'](_0x4f1d('0xef'),_0x45a63d[_0x4f1d('0xf0')])},client9002)[_0x4f1d('0x31')](function(_0x36bf06){var _0x4db269=_0x36bf06&&_0x36bf06[_0x4f1d('0xf1')](_0x4f1d('0xf2'))>=0x0?!![]:![];logger[_0x4f1d('0x1e')](_0x4f1d('0xf3'),_0x20d3d4['id'],_0x45a63d['id'],_0x45a63d[_0x4f1d('0xf0')],_0x4db269?_0x4f1d('0xf4'):_0x4f1d('0xf5'),_0x20d3d4[_0x4f1d('0xee')]?_0x20d3d4[_0x4f1d('0xee')]:_0x4f1d('0xf6'));return _0x4db269;})['catch'](function(_0x33a977){logger[_0x4f1d('0x24')](_0x4f1d('0xf3'),_0x20d3d4['id'],_0x45a63d['id'],_0x45a63d[_0x4f1d('0xf0')],util[_0x4f1d('0xf7')](_0x33a977,{'showHidden':![],'depth':null}),_0x20d3d4[_0x4f1d('0xee')]?_0x20d3d4[_0x4f1d('0xee')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1174ae,_0x191fcf,_0x58c78d){var _0x372e52=0x0;var _0x1ab6c3=0x0;var _0x3371cb=![];var _0x4d654c;var _0x531369;return db[_0x4f1d('0x3b')]['find']({'where':{'id':_0x1174ae[_0x4f1d('0x54')]['id']},'include':[{'model':db[_0x4f1d('0xf8')],'as':_0x4f1d('0xf8'),'include':[{'model':db['Interval'],'as':_0x4f1d('0xf9'),'attributes':['id',_0x4f1d('0xf0')],'raw':!![]}]}]})[_0x4f1d('0x31')](handleEntityNotFound(_0x191fcf,null))['then'](function(_0x4a697d){if(_0x4a697d){_0x4d654c=_0x4a697d;return _0x4a697d['getProactiveActions']({'raw':!![]});}})[_0x4f1d('0x31')](function(_0x388dfd){if(_0x4d654c){if(_0x388dfd){_0x531369=_0x388dfd;}}return require('../../config/license/util')[_0x4f1d('0xfa')]();})[_0x4f1d('0x31')](function(_0xd639c9){if(_0xd639c9){_0x1ab6c3=_0xd639c9[_0x4f1d('0xfb')];_0x3371cb=_0xd639c9[_0x4f1d('0x7e')];}})[_0x4f1d('0x31')](function(){return db[_0x4f1d('0xb9')][_0x4f1d('0x4e')]({'where':{'closed':![]}});})[_0x4f1d('0x31')](function(_0x20fadd){_0x372e52=_0x20fadd;if(_0x1ab6c3&&_0x20fadd>_0x1ab6c3){return db[_0x4f1d('0xfc')][_0x4f1d('0x65')]({'where':{'id':0x1}})['then'](function(_0x596f16){if(_0x596f16){_0x596f16[_0x4f1d('0xfd')](_0x4f1d('0xfe'));}});}})[_0x4f1d('0x31')](function(){if(_0x4d654c['Interval']&&_0x4d654c['Interval'][_0x4f1d('0xf9')]){var _0x1c4f8d=[];for(var _0x42bc8a=0x0;_0x42bc8a<_0x4d654c[_0x4f1d('0xf8')][_0x4f1d('0xf9')][_0x4f1d('0x42')];_0x42bc8a++){var _0x2c617f=_0x4d654c[_0x4f1d('0xf8')][_0x4f1d('0xf9')][_0x42bc8a][_0x4f1d('0x33')]({'plain':!![]});_0x1c4f8d['push'](iftimePromise(_0x2c617f,_0x4d654c));}return BPromise[_0x4f1d('0xff')](_0x1c4f8d)[_0x4f1d('0x31')](function(_0x5452fd){return _[_0x4f1d('0x100')](_0x5452fd);});}else{return!![];}})[_0x4f1d('0x31')](function(_0x2edbdf){var _0x5223ce=fs[_0x4f1d('0xd1')](path[_0x4f1d('0x7a')](config[_0x4f1d('0x7b')],_0x4f1d('0x101')),_0x4f1d('0x102'));var _0x4f9f01={'remote':_0x4d654c[_0x4f1d('0x103')],'query':querystring[_0x4f1d('0x23')](_[_0x4f1d('0x4a')](_0x4d654c[_0x4f1d('0x33')]({'plain':!![]}),{'customerIp':_0x1174ae['headers'][_0x4f1d('0x104')]||_0x1174ae['headers'][_0x4f1d('0x105')]||_0x1174ae[_0x4f1d('0x106')][_0x4f1d('0x107')]||_0x1174ae['ip'],'referer':_0x1174ae['headers'][_0x4f1d('0x108')],'openedInteractions':_0x372e52,'maxInteractions':_0x1ab6c3,'virtual':_0x3371cb['virtual'],'online':_0x2edbdf,'custom':_0x3371cb}))['replace'](/'/g,'\x5c\x27')};_0x191fcf['send'](ejs[_0x4f1d('0xd3')](Mustache[_0x4f1d('0xd3')](_0x5223ce,_0x4f9f01),{'proactiveActions':_0x531369,'alignment':_0x4d654c[_0x4f1d('0x109')],'verticalAlignment':_0x4d654c[_0x4f1d('0x10a')]}));})[_0x4f1d('0x28')](handleError(_0x191fcf,null));};exports['addApplications']=function(_0x14b018,_0x4f5cab,_0x1da6a2){return db['ChatWebsite'][_0x4f1d('0x65')]({'where':{'id':_0x14b018[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x4f5cab,null))[_0x4f1d('0x31')](function(_0x1dbfa1){if(_0x1dbfa1){return db[_0x4f1d('0x10b')]['transaction'](function(_0x9f91be){return db['ChatApplication'][_0x4f1d('0x32')]({'where':{'ChatWebsiteId':_0x14b018[_0x4f1d('0x54')]['id']},'transaction':_0x9f91be})[_0x4f1d('0x31')](function(_0x56e33b){var _0x575aef=_[_0x4f1d('0x67')](_0x14b018[_0x4f1d('0x60')],function(_0x488858){_0x488858[_0x4f1d('0x62')]=_0x14b018['params']['id'];return _0x488858;});return db[_0x4f1d('0xa3')]['bulkCreate'](_0x575aef,{'transaction':_0x9f91be});});})['then'](function(){return db[_0x4f1d('0xa3')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x14b018[_0x4f1d('0x54')]['id']},'order':_0x4f1d('0xa9')});});}})[_0x4f1d('0x31')](respondWithResult(_0x4f5cab,null))[_0x4f1d('0x28')](handleError(_0x4f5cab,null));};exports[_0x4f1d('0x10c')]=function(_0x4f1001,_0x36bb22,_0x196bf2){var _0x549e95={};var _0xe7e97={};var _0x2a8160;var _0x9d5f54;return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x4f1001[_0x4f1d('0x54')]['id']}})['then'](handleEntityNotFound(_0x36bb22,null))[_0x4f1d('0x31')](function(_0x241431){if(_0x241431){_0x2a8160=_0x241431;_0xe7e97[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db[_0x4f1d('0xa3')]['rawAttributes']);_0xe7e97[_0x4f1d('0x3d')]=_[_0x4f1d('0x56')](_0x4f1001[_0x4f1d('0x3d')]);_0xe7e97[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0xe7e97['model'],_0xe7e97['query']);_0x549e95[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0xe7e97[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x4f1001[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x549e95['attributes']=_0x549e95[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0x549e95[_0x4f1d('0x40')]:_0xe7e97['model'];_0x549e95['order']=qs['sort'](_0x4f1001[_0x4f1d('0x3d')]['sort']);_0x549e95['where']=qs['filters'](_[_0x4f1d('0x66')](_0x4f1001[_0x4f1d('0x3d')],_0xe7e97['filters']));if(_0x4f1001['query'][_0x4f1d('0x49')]){_0x549e95[_0x4f1d('0x48')]=_[_0x4f1d('0x4a')](_0x549e95[_0x4f1d('0x48')],{'$or':_['map'](_0x549e95[_0x4f1d('0x40')],function(_0xe302f2){var _0x3f98f5={};_0x3f98f5[_0xe302f2]={'$like':'%'+_0x4f1001[_0x4f1d('0x3d')][_0x4f1d('0x49')]+'%'};return _0x3f98f5;})});}_0x549e95=_[_0x4f1d('0x4a')]({},_0x549e95,_0x4f1001['options']);return _0x2a8160[_0x4f1d('0x10c')](_0x549e95);}})[_0x4f1d('0x31')](function(_0x2ba114){if(_0x2ba114){_0x9d5f54=_0x2ba114['length'];if(!_0x4f1001['query'][_0x4f1d('0x43')]('nolimit')){_0x549e95[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x4f1001[_0x4f1d('0x3d')]['limit']);_0x549e95[_0x4f1d('0x2c')]=qs['offset'](_0x4f1001['query'][_0x4f1d('0x2c')]);}return _0x2a8160[_0x4f1d('0x10c')](_0x549e95);}})[_0x4f1d('0x31')](function(_0x4d7adf){if(_0x4d7adf){return _0x4d7adf?{'count':_0x9d5f54,'rows':_0x4d7adf}:null;}})[_0x4f1d('0x31')](respondWithResult(_0x36bb22,null))[_0x4f1d('0x28')](handleError(_0x36bb22,null));};exports[_0x4f1d('0x10d')]=function(_0x5eb9a4,_0x30c3a9,_0x1921f1){return db['chatProactiveAction']['find']({'where':{'id':_0x5eb9a4[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x30c3a9,null))[_0x4f1d('0x31')](function(_0xf4f658){if(_0xf4f658){return _0xf4f658['addProactiveActions'](_0x5eb9a4[_0x4f1d('0x60')][_0x4f1d('0x69')],_[_0x4f1d('0x10e')](_0x5eb9a4[_0x4f1d('0x60')],[_0x4f1d('0x69'),'id'])||{});}})[_0x4f1d('0x31')](respondWithResult(_0x30c3a9,null))[_0x4f1d('0x28')](handleError(_0x30c3a9,null));};exports['getProactiveActions']=function(_0x39cb46,_0x1926c7,_0x5e1a2b){var _0x3dc088={};var _0xe0010c={};var _0xa3a82c;var _0xc9ca3d;return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x39cb46[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x1926c7,null))['then'](function(_0x434086){if(_0x434086){_0xa3a82c=_0x434086;_0xe0010c[_0x4f1d('0x3c')]=_['keys'](db['ChatProactiveAction'][_0x4f1d('0x6d')]);_0xe0010c['query']=_[_0x4f1d('0x56')](_0x39cb46[_0x4f1d('0x3d')]);_0xe0010c['filters']=_[_0x4f1d('0x3f')](_0xe0010c['model'],_0xe0010c[_0x4f1d('0x3d')]);_0x3dc088['attributes']=_[_0x4f1d('0x3f')](_0xe0010c[_0x4f1d('0x3c')],qs['fields'](_0x39cb46[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x3dc088['attributes']=_0x3dc088[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0x3dc088[_0x4f1d('0x40')]:_0xe0010c[_0x4f1d('0x3c')];_0x3dc088['order']=qs[_0x4f1d('0x47')](_0x39cb46[_0x4f1d('0x3d')][_0x4f1d('0x47')]);_0x3dc088[_0x4f1d('0x48')]=qs[_0x4f1d('0x3e')](_[_0x4f1d('0x66')](_0x39cb46[_0x4f1d('0x3d')],_0xe0010c[_0x4f1d('0x3e')]));if(_0x39cb46[_0x4f1d('0x3d')]['filter']){_0x3dc088[_0x4f1d('0x48')]=_[_0x4f1d('0x4a')](_0x3dc088[_0x4f1d('0x48')],{'$or':_[_0x4f1d('0x67')](_0x3dc088[_0x4f1d('0x40')],function(_0x29c97c){var _0x51cee5={};_0x51cee5[_0x29c97c]={'$like':'%'+_0x39cb46[_0x4f1d('0x3d')][_0x4f1d('0x49')]+'%'};return _0x51cee5;})});}_0x3dc088=_[_0x4f1d('0x4a')]({},_0x3dc088,_0x39cb46[_0x4f1d('0x4d')]);return _0xa3a82c[_0x4f1d('0x10f')](_0x3dc088);}})[_0x4f1d('0x31')](function(_0x3e4fd1){if(_0x3e4fd1){_0xc9ca3d=_0x3e4fd1[_0x4f1d('0x42')];if(!_0x39cb46[_0x4f1d('0x3d')][_0x4f1d('0x43')]('nolimit')){_0x3dc088[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x39cb46[_0x4f1d('0x3d')][_0x4f1d('0x45')]);_0x3dc088[_0x4f1d('0x2c')]=qs[_0x4f1d('0x2c')](_0x39cb46[_0x4f1d('0x3d')]['offset']);}return _0xa3a82c[_0x4f1d('0x10f')](_0x3dc088);}})[_0x4f1d('0x31')](function(_0x52a113){if(_0x52a113){return _0x52a113?{'count':_0xc9ca3d,'rows':_0x52a113}:null;}})[_0x4f1d('0x31')](respondWithResult(_0x1926c7,null))[_0x4f1d('0x28')](handleError(_0x1926c7,null));};exports[_0x4f1d('0x110')]=function(_0x5cc98d,_0xdd17d5,_0x59871e){var _0x1806a4=_0x5cc98d[_0x4f1d('0x3d')][_0x4f1d('0x111')]===_0x4f1d('0x112')?_0x4f1d('0x113'):_0x4f1d('0x114');return db[_0x4f1d('0x3b')]['find']({'attributes':['id',_0x1806a4],'where':{'id':_0x5cc98d[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0xdd17d5,null))['then'](function(_0x35d384){if(_0x35d384){var _0x3e1ad2=_0x35d384[_0x1806a4];var _0x5aa972=_0x3e1ad2&&_0x3e1ad2['items']?_0x3e1ad2[_0x4f1d('0x115')]:[];_0xdd17d5[_0x4f1d('0x39')]({'fromKey':_[_0x4f1d('0x7f')](_0x3e1ad2[_0x4f1d('0x116')])?undefined:_0x3e1ad2[_0x4f1d('0x116')],'count':_0x5aa972[_0x4f1d('0x42')],'rows':_0x5aa972});}})[_0x4f1d('0x28')](handleError(_0xdd17d5,null));};exports[_0x4f1d('0x117')]=function(_0x74e49d,_0x4941d8,_0x2ea488){var _0x382c7b={'raw':!![],'where':{}};var _0x1f4310={};var _0x449936={'count':0x0,'rows':[]};return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x74e49d['params']['id']}})['then'](handleEntityNotFound(_0x4941d8,null))[_0x4f1d('0x31')](function(_0x8b6cf1){if(_0x8b6cf1){_0x1f4310[_0x4f1d('0x3c')]=_[_0x4f1d('0x56')](db[_0x4f1d('0x118')][_0x4f1d('0x6d')]);_0x1f4310[_0x4f1d('0x3d')]=_[_0x4f1d('0x56')](_0x74e49d[_0x4f1d('0x3d')]);_0x1f4310[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x1f4310['model'],_0x1f4310['query']);_0x382c7b[_0x4f1d('0x40')]=_[_0x4f1d('0x3f')](_0x1f4310[_0x4f1d('0x3c')],qs['fields'](_0x74e49d[_0x4f1d('0x3d')][_0x4f1d('0x41')]));_0x382c7b[_0x4f1d('0x40')]=_0x382c7b['attributes'][_0x4f1d('0x42')]?_0x382c7b[_0x4f1d('0x40')]:_0x1f4310[_0x4f1d('0x3c')];if(!_0x74e49d[_0x4f1d('0x3d')][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0x382c7b[_0x4f1d('0x45')]=qs[_0x4f1d('0x45')](_0x74e49d['query'][_0x4f1d('0x45')]);_0x382c7b[_0x4f1d('0x2c')]=qs['offset'](_0x74e49d[_0x4f1d('0x3d')][_0x4f1d('0x2c')]);}_0x382c7b[_0x4f1d('0x46')]=qs[_0x4f1d('0x47')](_0x74e49d['query']['sort']);_0x382c7b[_0x4f1d('0x48')]=qs['filters'](_['pick'](_0x74e49d[_0x4f1d('0x3d')],_0x1f4310[_0x4f1d('0x3e')]));_0x382c7b['where'][_0x4f1d('0x62')]=_0x8b6cf1['id'];if(_0x74e49d[_0x4f1d('0x3d')][_0x4f1d('0x49')]){_0x382c7b[_0x4f1d('0x48')]=_['merge'](_0x382c7b[_0x4f1d('0x48')],{'$or':_[_0x4f1d('0x67')](_0x382c7b[_0x4f1d('0x40')],function(_0x75954f){var _0x36f82a={};_0x36f82a[_0x75954f]={'$like':'%'+_0x74e49d[_0x4f1d('0x3d')][_0x4f1d('0x49')]+'%'};return _0x36f82a;})});}_0x382c7b=_[_0x4f1d('0x4a')]({},_0x382c7b,_0x74e49d[_0x4f1d('0x4d')]);return db[_0x4f1d('0x118')][_0x4f1d('0x4e')]({'where':_0x382c7b[_0x4f1d('0x48')]})[_0x4f1d('0x31')](function(_0x19783b){_0x449936['count']=_0x19783b;if(_0x74e49d[_0x4f1d('0x3d')]['includeAll']){_0x382c7b[_0x4f1d('0x50')]=[{'all':!![]}];}return db[_0x4f1d('0x118')][_0x4f1d('0x51')](_0x382c7b);})['then'](function(_0x38ae36){_0x449936[_0x4f1d('0x52')]=_0x38ae36;return _0x449936;});}})[_0x4f1d('0x31')](respondWithFilteredResult(_0x4941d8,_0x382c7b))['catch'](handleError(_0x4941d8,null));};exports[_0x4f1d('0x119')]=function(_0x2b4acb,_0x4fa337,_0x45bf7c){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x2b4acb['params']['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x4fa337,null))[_0x4f1d('0x31')](function(_0x50bcdb){if(_0x50bcdb){return _0x50bcdb[_0x4f1d('0x119')](_0x2b4acb[_0x4f1d('0x60')][_0x4f1d('0x69')],_['omit'](_0x2b4acb[_0x4f1d('0x60')],[_0x4f1d('0x69'),'id'])||{})[_0x4f1d('0xbd')](function(_0x13caad){for(var _0x54c27c=0x0;_0x54c27c<_0x2b4acb[_0x4f1d('0x60')][_0x4f1d('0x69')]['length'];_0x54c27c+=0x1){socket[_0x4f1d('0x11a')](_0x4f1d('0x11b'),{'UserId':_0x2b4acb[_0x4f1d('0x60')][_0x4f1d('0x69')][_0x54c27c],'ChatWebsiteId':_0x2b4acb[_0x4f1d('0x54')]['id']});}return _0x13caad;});}})[_0x4f1d('0x31')](respondWithResult(_0x4fa337,null))[_0x4f1d('0x28')](handleError(_0x4fa337,null));};exports['removeAgents']=function(_0x4ccb0c,_0x1c6afc,_0x59b585){return db[_0x4f1d('0x3b')][_0x4f1d('0x57')]({'where':{'id':_0x4ccb0c['params']['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x1c6afc,null))[_0x4f1d('0x31')](function(_0x3f8014){if(_0x3f8014){return _0x3f8014['removeAgents'](_0x4ccb0c[_0x4f1d('0x3d')]['ids'])[_0x4f1d('0x31')](function(){if(_[_0x4f1d('0x11c')](_0x4ccb0c[_0x4f1d('0x3d')][_0x4f1d('0x69')])){for(var _0x13a1fd=0x0;_0x13a1fd<_0x4ccb0c[_0x4f1d('0x3d')][_0x4f1d('0x69')][_0x4f1d('0x42')];_0x13a1fd+=0x1){socket['emit'](_0x4f1d('0x11d'),{'UserId':Number(_0x4ccb0c['query'][_0x4f1d('0x69')][_0x13a1fd]),'ChatWebsiteId':Number(_0x4ccb0c[_0x4f1d('0x54')]['id'])});}}else{socket[_0x4f1d('0x11a')](_0x4f1d('0x11d'),{'UserId':Number(_0x4ccb0c['query'][_0x4f1d('0x69')]),'ChatWebsiteId':Number(_0x4ccb0c[_0x4f1d('0x54')]['id'])});}});}})[_0x4f1d('0x31')](respondWithStatusCode(_0x1c6afc,null))[_0x4f1d('0x28')](handleError(_0x1c6afc,null));};exports[_0x4f1d('0x11e')]=function(_0x53ec2e,_0x14dd76,_0x408c61){var _0x5dd7ca={};var _0x5d6b45={};var _0x2ade8c;var _0xe08ee6;return db[_0x4f1d('0x3b')][_0x4f1d('0x65')]({'where':{'id':_0x53ec2e[_0x4f1d('0x54')]['id']}})[_0x4f1d('0x31')](handleEntityNotFound(_0x14dd76,null))['then'](function(_0x2876dc){if(_0x2876dc){_0x2ade8c=_0x2876dc;_0x5d6b45[_0x4f1d('0x3c')]=_['keys'](db[_0x4f1d('0xc4')][_0x4f1d('0x6d')]);_0x5d6b45['query']=_[_0x4f1d('0x56')](_0x53ec2e[_0x4f1d('0x3d')]);_0x5d6b45[_0x4f1d('0x3e')]=_[_0x4f1d('0x3f')](_0x5d6b45['model'],_0x5d6b45['query']);_0x5dd7ca[_0x4f1d('0x40')]=_['intersection'](_0x5d6b45[_0x4f1d('0x3c')],qs[_0x4f1d('0x41')](_0x53ec2e['query']['fields']));_0x5dd7ca[_0x4f1d('0x40')]=_0x5dd7ca[_0x4f1d('0x40')][_0x4f1d('0x42')]?_0x5dd7ca[_0x4f1d('0x40')]:_0x5d6b45['model'];_0x5dd7ca[_0x4f1d('0x46')]=qs[_0x4f1d('0x47')](_0x53ec2e[_0x4f1d('0x3d')]['sort']);_0x5dd7ca['where']=qs[_0x4f1d('0x3e')](_[_0x4f1d('0x66')](_0x53ec2e[_0x4f1d('0x3d')],_0x5d6b45['filters']));if(_0x53ec2e[_0x4f1d('0x3d')][_0x4f1d('0x49')]){_0x5dd7ca[_0x4f1d('0x48')]=_['merge'](_0x5dd7ca[_0x4f1d('0x48')],{'$or':_[_0x4f1d('0x67')](_0x5dd7ca[_0x4f1d('0x40')],function(_0x385b66){var _0x2c4155={};_0x2c4155[_0x385b66]={'$like':'%'+_0x53ec2e[_0x4f1d('0x3d')][_0x4f1d('0x49')]+'%'};return _0x2c4155;})});}_0x5dd7ca=_[_0x4f1d('0x4a')]({},_0x5dd7ca,_0x53ec2e[_0x4f1d('0x4d')]);return _0x2ade8c[_0x4f1d('0x11e')](_0x5dd7ca);}})[_0x4f1d('0x31')](function(_0x50291c){if(_0x50291c){_0xe08ee6=_0x50291c[_0x4f1d('0x42')];if(!_0x53ec2e['query'][_0x4f1d('0x43')](_0x4f1d('0x44'))){_0x5dd7ca[_0x4f1d('0x45')]=qs['limit'](_0x53ec2e[_0x4f1d('0x3d')][_0x4f1d('0x45')]);_0x5dd7ca['offset']=qs['offset'](_0x53ec2e['query']['offset']);}return _0x2ade8c[_0x4f1d('0x11e')](_0x5dd7ca);}})[_0x4f1d('0x31')](function(_0xc8f42b){if(_0xc8f42b){return _0xc8f42b?{'count':_0xe08ee6,'rows':_0xc8f42b}:null;}})['then'](respondWithResult(_0x14dd76,null))[_0x4f1d('0x28')](handleError(_0x14dd76,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 82f0ef3..b94f74e 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 _0x4e28=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x457887,_0x19b7f1){var _0x2e9b1c=function(_0x41a97b){while(--_0x41a97b){_0x457887['push'](_0x457887['shift']());}};_0x2e9b1c(++_0x19b7f1);}(_0x4e28,0x1df));var _0x84e2=function(_0x11ddf2,_0x4dc742){_0x11ddf2=_0x11ddf2-0x0;var _0x46af6f=_0x4e28[_0x11ddf2];return _0x46af6f;};'use strict';var EventEmitter=require(_0x84e2('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x84e2('0x1')](0x0);var events={'afterCreate':_0x84e2('0x2'),'afterUpdate':_0x84e2('0x3'),'afterDestroy':_0x84e2('0x4')};function emitEvent(_0xbc0fb9){return function(_0x103deb,_0x508f13,_0x23cdfa){ChatWebsiteEvents[_0x84e2('0x5')](_0xbc0fb9+':'+_0x103deb['id'],_0x103deb);ChatWebsiteEvents[_0x84e2('0x5')](_0xbc0fb9,_0x103deb);_0x23cdfa(null);};}for(var e in events){if(events[_0x84e2('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x84e2('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xd487=['emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove'];(function(_0x11ab36,_0x21ef36){var _0x16eb60=function(_0x503162){while(--_0x503162){_0x11ab36['push'](_0x11ab36['shift']());}};_0x16eb60(++_0x21ef36);}(_0xd487,0x108));var _0x7d48=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0xd487[_0x5c9f56];return _0x2a726b;};'use strict';var EventEmitter=require(_0x7d48('0x0'));var ChatWebsite=require(_0x7d48('0x1'))['db'][_0x7d48('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7d48('0x3')](0x0);var events={'afterCreate':_0x7d48('0x4'),'afterUpdate':'update','afterDestroy':_0x7d48('0x5')};function emitEvent(_0x316b18){return function(_0x23c751,_0x294146,_0xea55d9){ChatWebsiteEvents[_0x7d48('0x6')](_0x316b18+':'+_0x23c751['id'],_0x23c751);ChatWebsiteEvents['emit'](_0x316b18,_0x23c751);_0xea55d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7d48('0x7')](e,emitEvent(event));}}module[_0x7d48('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4d74e83..e2b563f 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 _0x3d0f=['chat_websites','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4c3c84,_0x2cd5b7){var _0x498e75=function(_0x164d46){while(--_0x164d46){_0x4c3c84['push'](_0x4c3c84['shift']());}};_0x498e75(++_0x2cd5b7);}(_0x3d0f,0x1f0));var _0xf3d0=function(_0x325c1d,_0xaac33){_0x325c1d=_0x325c1d-0x0;var _0x41620d=_0x3d0f[_0x325c1d];return _0x41620d;};'use strict';var _=require(_0xf3d0('0x0'));var util=require(_0xf3d0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf3d0('0x2'));var BPromise=require(_0xf3d0('0x3'));var rp=require(_0xf3d0('0x4'));var fs=require('fs');var path=require(_0xf3d0('0x5'));var rimraf=require(_0xf3d0('0x6'));var config=require(_0xf3d0('0x7'));var attributes=require(_0xf3d0('0x8'));module[_0xf3d0('0x9')]=function(_0x4e23aa,_0x554d11){return _0x4e23aa['define']('ChatWebsite',attributes,{'tableName':_0xf3d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e81=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites'];(function(_0x205e8e,_0x4901f7){var _0xcf96fe=function(_0x3544ad){while(--_0x3544ad){_0x205e8e['push'](_0x205e8e['shift']());}};_0xcf96fe(++_0x4901f7);}(_0x2e81,0xf0));var _0x12e8=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x2e81[_0x2feb53];return _0x5700ee;};'use strict';var _=require('lodash');var util=require(_0x12e8('0x0'));var logger=require(_0x12e8('0x1'))(_0x12e8('0x2'));var moment=require('moment');var BPromise=require(_0x12e8('0x3'));var rp=require(_0x12e8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12e8('0x5'));var attributes=require(_0x12e8('0x6'));module[_0x12e8('0x7')]=function(_0x4ce749,_0x3e363e){return _0x4ce749['define'](_0x12e8('0x8'),attributes,{'tableName':_0x12e8('0x9'),'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 994cdc9..21eb581 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 _0x2f29=['socket.io-emitter','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f29,0x6c));var _0x92f2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x2f29[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x92f2('0x0'));var util=require(_0x92f2('0x1'));var moment=require(_0x92f2('0x2'));var BPromise=require(_0x92f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x92f2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x92f2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x92f2('0x7')][_0x92f2('0x8')]({'port':0x232a});config[_0x92f2('0x9')]=_[_0x92f2('0xa')](config['redis'],{'host':_0x92f2('0xb'),'port':0x18eb});var socket=require(_0x92f2('0xc'))(new Redis(config[_0x92f2('0x9')]));require('./chatWebsite.socket')[_0x92f2('0xd')](socket);function respondWithRpcPromise(_0x3f0cbb,_0x17e66e,_0x1b6056){return new BPromise(function(_0x15f468,_0x23a8aa){return client[_0x92f2('0xe')](_0x3f0cbb,_0x1b6056)['then'](function(_0x33328b){logger[_0x92f2('0xf')](_0x92f2('0x10'),_0x17e66e,'request\x20sent');logger[_0x92f2('0x11')](_0x92f2('0x12'),_0x17e66e,_0x92f2('0x13'),JSON[_0x92f2('0x14')](_0x33328b));if(_0x33328b[_0x92f2('0x15')]){if(_0x33328b[_0x92f2('0x15')]['code']===0x1f4){logger[_0x92f2('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x17e66e,_0x33328b[_0x92f2('0x15')][_0x92f2('0x16')]);return _0x23a8aa(_0x33328b[_0x92f2('0x15')][_0x92f2('0x16')]);}logger[_0x92f2('0x15')](_0x92f2('0x10'),_0x17e66e,_0x33328b[_0x92f2('0x15')]['message']);return _0x15f468(_0x33328b[_0x92f2('0x15')][_0x92f2('0x16')]);}else{logger['info'](_0x92f2('0x10'),_0x17e66e,'request\x20sent');_0x15f468(_0x33328b['result'][_0x92f2('0x16')]);}})[_0x92f2('0x17')](function(_0x1ef21d){logger['error'](_0x92f2('0x10'),_0x17e66e,_0x1ef21d);_0x23a8aa(_0x1ef21d);});});} \ No newline at end of file +var _0x2f92=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0xd0df48,_0x474cbe){var _0xd110ac=function(_0x49c72c){while(--_0x49c72c){_0xd0df48['push'](_0xd0df48['shift']());}};_0xd110ac(++_0x474cbe);}(_0x2f92,0x1d1));var _0x22f9=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x2f92[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x22f9('0x0'));var moment=require(_0x22f9('0x1'));var BPromise=require('bluebird');var rs=require(_0x22f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22f9('0x3'));var logger=require('../../config/logger')(_0x22f9('0x4'));var config=require(_0x22f9('0x5'));var jayson=require(_0x22f9('0x6'));var client=jayson[_0x22f9('0x7')][_0x22f9('0x8')]({'port':0x232a});config[_0x22f9('0x9')]=_[_0x22f9('0xa')](config[_0x22f9('0x9')],{'host':_0x22f9('0xb'),'port':0x18eb});var socket=require(_0x22f9('0xc'))(new Redis(config[_0x22f9('0x9')]));require(_0x22f9('0xd'))[_0x22f9('0xe')](socket);function respondWithRpcPromise(_0x172e9f,_0x19f9e5,_0x2cc217){return new BPromise(function(_0x3e529e,_0x28913a){return client[_0x22f9('0xf')](_0x172e9f,_0x2cc217)['then'](function(_0xabb980){logger['info'](_0x22f9('0x10'),_0x19f9e5,_0x22f9('0x11'));logger[_0x22f9('0x12')](_0x22f9('0x13'),_0x19f9e5,_0x22f9('0x11'),JSON[_0x22f9('0x14')](_0xabb980));if(_0xabb980['error']){if(_0xabb980['error']['code']===0x1f4){logger['error'](_0x22f9('0x10'),_0x19f9e5,_0xabb980[_0x22f9('0x15')][_0x22f9('0x16')]);return _0x28913a(_0xabb980[_0x22f9('0x15')][_0x22f9('0x16')]);}logger['error'](_0x22f9('0x10'),_0x19f9e5,_0xabb980[_0x22f9('0x15')][_0x22f9('0x16')]);return _0x3e529e(_0xabb980[_0x22f9('0x15')][_0x22f9('0x16')]);}else{logger[_0x22f9('0x17')](_0x22f9('0x10'),_0x19f9e5,_0x22f9('0x11'));_0x3e529e(_0xabb980['result'][_0x22f9('0x16')]);}})[_0x22f9('0x18')](function(_0x175912){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x19f9e5,_0x175912);_0x28913a(_0x175912);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2933c4d..abcf7d4 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 _0x095b=['update','removeListener','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x095b,0x6e));var _0xb095=function(_0x4cda99,_0xfff96){_0x4cda99=_0x4cda99-0x0;var _0x3b0c1=_0x095b[_0x4cda99];return _0x3b0c1;};'use strict';var ChatWebsiteEvents=require(_0xb095('0x0'));var events=['save',_0xb095('0x1'),_0xb095('0x2')];function createListener(_0x3e60de,_0x33ef98){return function(_0x33888f){_0x33ef98['emit'](_0x3e60de,_0x33888f);};}function removeListener(_0x1a42a5,_0x25f040){return function(){ChatWebsiteEvents[_0xb095('0x3')](_0x1a42a5,_0x25f040);};}exports[_0xb095('0x4')]=function(_0x10a03d){for(var _0x3e4cc9=0x0,_0x24deed=events[_0xb095('0x5')];_0x3e4cc9<_0x24deed;_0x3e4cc9++){var _0x39fc96=events[_0x3e4cc9];var _0x47a5eb=createListener(_0xb095('0x6')+_0x39fc96,_0x10a03d);ChatWebsiteEvents['on'](_0x39fc96,_0x47a5eb);}}; \ No newline at end of file +var _0xfe20=['register','chatWebsite:','./chatWebsite.events','remove','removeListener'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xfe20,0x11f));var _0x0fe2=function(_0x158578,_0x726914){_0x158578=_0x158578-0x0;var _0x14fcb2=_0xfe20[_0x158578];return _0x14fcb2;};'use strict';var ChatWebsiteEvents=require(_0x0fe2('0x0'));var events=['save',_0x0fe2('0x1'),'update'];function createListener(_0xc90876,_0x459cf3){return function(_0x537dea){_0x459cf3['emit'](_0xc90876,_0x537dea);};}function removeListener(_0x5c2f96,_0x1d5f0d){return function(){ChatWebsiteEvents[_0x0fe2('0x2')](_0x5c2f96,_0x1d5f0d);};}exports[_0x0fe2('0x3')]=function(_0x4201bb){for(var _0xd99832=0x0,_0x5f5868=events['length'];_0xd99832<_0x5f5868;_0xd99832++){var _0x1a50d2=events[_0xd99832];var _0x52e72e=createListener(_0x0fe2('0x4')+_0x1a50d2,_0x4201bb);ChatWebsiteEvents['on'](_0x1a50d2,_0x52e72e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5c18f9b..45e1aac 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 _0x24cf=['delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','addAnswer','diskStorage','join','root','server/files/images/logos/','now','file','addLogo','server/files/images/avatars/','originalname','addAvatar','format','%s-%s','/:id/customer_avatar','single','addCustomerAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x24cf,0x1d5));var _0xf24c=function(_0x3a591a,_0x42fd80){_0x3a591a=_0x3a591a-0x0;var _0x3ba077=_0x24cf[_0x3a591a];return _0x3ba077;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf24c('0x0'));var timeout=require(_0xf24c('0x1'));var express=require(_0xf24c('0x2'));var router=express[_0xf24c('0x3')]();var auth=require(_0xf24c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf24c('0x5'));var controller=require(_0xf24c('0x6'));router[_0xf24c('0x7')]('/',auth[_0xf24c('0x8')](),controller['index']);router['get']('/describe',auth[_0xf24c('0x8')](),controller['describe']);router[_0xf24c('0x7')](_0xf24c('0x9'),auth[_0xf24c('0x8')](),controller[_0xf24c('0xa')]);router['get'](_0xf24c('0xb'),auth[_0xf24c('0x8')](),controller[_0xf24c('0xc')]);router[_0xf24c('0x7')](_0xf24c('0xd'),auth[_0xf24c('0x8')](),controller['getAnswers']);router[_0xf24c('0x7')](_0xf24c('0xe'),controller[_0xf24c('0xf')]);router['get'](_0xf24c('0x10'),controller[_0xf24c('0x11')]);router['get']('/:id/customer_avatar',controller[_0xf24c('0x12')]);router['get'](_0xf24c('0x13'),controller[_0xf24c('0x14')]);router['get'](_0xf24c('0x15'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x16')]);router[_0xf24c('0x7')](_0xf24c('0x17'),controller['getSnippet']);router['get'](_0xf24c('0x18'),auth[_0xf24c('0x8')](),controller['getApplications']);router[_0xf24c('0x7')](_0xf24c('0x19'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x1a')]);router[_0xf24c('0x7')](_0xf24c('0x1b'),controller[_0xf24c('0x1c')]);router[_0xf24c('0x7')](_0xf24c('0x1d'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x1e')]);router[_0xf24c('0x7')]('/:id/users',auth[_0xf24c('0x8')](),controller[_0xf24c('0x1f')]);router['post']('/',auth[_0xf24c('0x8')](),controller[_0xf24c('0x20')]);router[_0xf24c('0x21')]('/:id/dispositions',auth[_0xf24c('0x8')](),controller['addDisposition']);router[_0xf24c('0x21')](_0xf24c('0xd'),auth['isAuthenticated'](),controller[_0xf24c('0x22')]);var upload=multer({'storage':multer[_0xf24c('0x23')]({'destination':function(_0x106771,_0x35ba83,_0x273a80){_0x273a80(null,path[_0xf24c('0x24')](config[_0xf24c('0x25')],_0xf24c('0x26')));},'filename':function(_0xa8d02f,_0xc9fd87,_0x14003a){_0x14003a(null,util['format']('%s-%s',Date[_0xf24c('0x27')](),_0xc9fd87['originalname']));}})});router['post'](_0xf24c('0xe'),upload['single'](_0xf24c('0x28')),controller[_0xf24c('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x563ebe,_0x54a76f,_0x12129f){_0x12129f(null,path['join'](config[_0xf24c('0x25')],_0xf24c('0x2a')));},'filename':function(_0x2ee712,_0x5c8588,_0x2033a8){_0x2033a8(null,util['format']('%s-%s',Date[_0xf24c('0x27')](),_0x5c8588[_0xf24c('0x2b')]));}})});router[_0xf24c('0x21')](_0xf24c('0x10'),upload['single'](_0xf24c('0x28')),controller[_0xf24c('0x2c')]);var upload=multer({'storage':multer[_0xf24c('0x23')]({'destination':function(_0x311801,_0x3cfe5d,_0x16c827){_0x16c827(null,path['join'](config[_0xf24c('0x25')],_0xf24c('0x2a')));},'filename':function(_0x2441f7,_0x146a1f,_0x2f399a){_0x2f399a(null,util[_0xf24c('0x2d')](_0xf24c('0x2e'),Date['now'](),_0x146a1f[_0xf24c('0x2b')]));}})});router['post'](_0xf24c('0x2f'),upload[_0xf24c('0x30')]('file'),controller[_0xf24c('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bf4b2,_0x269d1b,_0x17f2b7){_0x17f2b7(null,path['join'](config[_0xf24c('0x25')],'server/files/images/avatars/'));},'filename':function(_0x24d8f1,_0x527472,_0x5648e8){_0x5648e8(null,util['format'](_0xf24c('0x2e'),Date[_0xf24c('0x27')](),_0x527472[_0xf24c('0x2b')]));}})});router[_0xf24c('0x21')](_0xf24c('0x13'),upload[_0xf24c('0x30')](_0xf24c('0x28')),controller['addSystemAvatar']);router[_0xf24c('0x21')](_0xf24c('0x32'),controller[_0xf24c('0x33')]);router[_0xf24c('0x21')](_0xf24c('0x34'),controller['offline']);router[_0xf24c('0x21')]('/:id/interactions',auth[_0xf24c('0x8')](),controller[_0xf24c('0x35')]);router[_0xf24c('0x21')](_0xf24c('0x18'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x36')]);router[_0xf24c('0x21')](_0xf24c('0x19'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x37')]);router[_0xf24c('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xf24c('0x38')]);router[_0xf24c('0x39')](_0xf24c('0x9'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x3a')]);router[_0xf24c('0x3b')](_0xf24c('0x9'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x3c')]);router[_0xf24c('0x3b')](_0xf24c('0xb'),auth['isAuthenticated'](),controller[_0xf24c('0x3d')]);router['delete'](_0xf24c('0xd'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x3e')]);router[_0xf24c('0x3b')](_0xf24c('0x3f'),auth[_0xf24c('0x8')](),controller[_0xf24c('0x40')]);module[_0xf24c('0x41')]=router; \ No newline at end of file +var _0x8ec7=['isAuthenticated','index','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','now','single','file','addLogo','server/files/images/avatars/','format','%s-%s','originalname','addAvatar','addCustomerAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get'];(function(_0x3f411e,_0x518795){var _0x103cf5=function(_0x3b112e){while(--_0x3b112e){_0x3f411e['push'](_0x3f411e['shift']());}};_0x103cf5(++_0x518795);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x8ec7[_0x83af7f];return _0x32d85c;};'use strict';var multer=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var path=require('path');var timeout=require(_0x78ec('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x78ec('0x3'));var interaction=require(_0x78ec('0x4'));var config=require('../../config/environment');var controller=require(_0x78ec('0x5'));router[_0x78ec('0x6')]('/',auth[_0x78ec('0x7')](),controller[_0x78ec('0x8')]);router[_0x78ec('0x6')]('/describe',auth[_0x78ec('0x7')](),controller['describe']);router[_0x78ec('0x6')](_0x78ec('0x9'),auth[_0x78ec('0x7')](),controller['show']);router[_0x78ec('0x6')](_0x78ec('0xa'),auth[_0x78ec('0x7')](),controller[_0x78ec('0xb')]);router[_0x78ec('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x78ec('0xc')]);router[_0x78ec('0x6')](_0x78ec('0xd'),controller['getLogo']);router[_0x78ec('0x6')](_0x78ec('0xe'),controller[_0x78ec('0xf')]);router[_0x78ec('0x6')](_0x78ec('0x10'),controller[_0x78ec('0x11')]);router[_0x78ec('0x6')](_0x78ec('0x12'),controller[_0x78ec('0x13')]);router[_0x78ec('0x6')](_0x78ec('0x14'),auth['isAuthenticated'](),controller[_0x78ec('0x15')]);router[_0x78ec('0x6')](_0x78ec('0x16'),controller[_0x78ec('0x17')]);router[_0x78ec('0x6')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x78ec('0x18'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x19')]);router[_0x78ec('0x6')](_0x78ec('0x1a'),controller[_0x78ec('0x1b')]);router[_0x78ec('0x6')](_0x78ec('0x1c'),auth[_0x78ec('0x7')](),controller['getOfflineMessages']);router[_0x78ec('0x6')](_0x78ec('0x1d'),auth[_0x78ec('0x7')](),controller['getAgents']);router[_0x78ec('0x1e')]('/',auth['isAuthenticated'](),controller[_0x78ec('0x1f')]);router[_0x78ec('0x1e')]('/:id/dispositions',auth[_0x78ec('0x7')](),controller['addDisposition']);router[_0x78ec('0x1e')](_0x78ec('0x20'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x21')]);var upload=multer({'storage':multer[_0x78ec('0x22')]({'destination':function(_0x5c2180,_0x3bdb9a,_0x395b5d){_0x395b5d(null,path[_0x78ec('0x23')](config[_0x78ec('0x24')],_0x78ec('0x25')));},'filename':function(_0x407674,_0x2dd10e,_0x347b39){_0x347b39(null,util['format']('%s-%s',Date[_0x78ec('0x26')](),_0x2dd10e['originalname']));}})});router[_0x78ec('0x1e')](_0x78ec('0xd'),upload[_0x78ec('0x27')](_0x78ec('0x28')),controller[_0x78ec('0x29')]);var upload=multer({'storage':multer[_0x78ec('0x22')]({'destination':function(_0x5b9e35,_0x4f57e0,_0x3429f3){_0x3429f3(null,path['join'](config[_0x78ec('0x24')],_0x78ec('0x2a')));},'filename':function(_0x2355a1,_0x44cd9f,_0x16de6d){_0x16de6d(null,util[_0x78ec('0x2b')](_0x78ec('0x2c'),Date[_0x78ec('0x26')](),_0x44cd9f[_0x78ec('0x2d')]));}})});router[_0x78ec('0x1e')]('/:id/avatar',upload[_0x78ec('0x27')](_0x78ec('0x28')),controller[_0x78ec('0x2e')]);var upload=multer({'storage':multer[_0x78ec('0x22')]({'destination':function(_0x34dd4d,_0x1a6f2b,_0x1612c8){_0x1612c8(null,path['join'](config[_0x78ec('0x24')],'server/files/images/avatars/'));},'filename':function(_0x88521f,_0x44c8c1,_0x5957b4){_0x5957b4(null,util[_0x78ec('0x2b')](_0x78ec('0x2c'),Date[_0x78ec('0x26')](),_0x44c8c1['originalname']));}})});router[_0x78ec('0x1e')](_0x78ec('0x10'),upload[_0x78ec('0x27')](_0x78ec('0x28')),controller[_0x78ec('0x2f')]);var upload=multer({'storage':multer[_0x78ec('0x22')]({'destination':function(_0x177ae0,_0x585e5e,_0x50580f){_0x50580f(null,path[_0x78ec('0x23')](config['root'],_0x78ec('0x2a')));},'filename':function(_0x46336b,_0x5ed1c4,_0x175809){_0x175809(null,util['format']('%s-%s',Date[_0x78ec('0x26')](),_0x5ed1c4[_0x78ec('0x2d')]));}})});router[_0x78ec('0x1e')]('/:id/system_avatar',upload[_0x78ec('0x27')]('file'),controller['addSystemAvatar']);router[_0x78ec('0x1e')](_0x78ec('0x30'),controller[_0x78ec('0x31')]);router[_0x78ec('0x1e')](_0x78ec('0x32'),controller[_0x78ec('0x33')]);router[_0x78ec('0x1e')](_0x78ec('0x14'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x34')]);router[_0x78ec('0x1e')](_0x78ec('0x35'),auth[_0x78ec('0x7')](),controller['addApplications']);router[_0x78ec('0x1e')](_0x78ec('0x18'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x36')]);router[_0x78ec('0x1e')](_0x78ec('0x1d'),auth['isAuthenticated'](),controller[_0x78ec('0x37')]);router[_0x78ec('0x38')](_0x78ec('0x9'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x39')]);router[_0x78ec('0x3a')]('/:id',auth[_0x78ec('0x7')](),controller[_0x78ec('0x3b')]);router[_0x78ec('0x3a')](_0x78ec('0xa'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x78ec('0x3a')]('/:id/canned_answers',auth[_0x78ec('0x7')](),controller[_0x78ec('0x3c')]);router['delete'](_0x78ec('0x1d'),auth[_0x78ec('0x7')](),controller[_0x78ec('0x3d')]);module[_0x78ec('0x3e')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 009b9e4..8a17fa0 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 _0x09f8=['name','sequelize','STRING'];(function(_0x4ff25e,_0xcadbf3){var _0xcf10d5=function(_0x12d29f){while(--_0x12d29f){_0x4ff25e['push'](_0x4ff25e['shift']());}};_0xcf10d5(++_0xcadbf3);}(_0x09f8,0xcd));var _0x809f=function(_0x2a2c95,_0x4b8878){_0x2a2c95=_0x2a2c95-0x0;var _0x198da1=_0x09f8[_0x2a2c95];return _0x198da1;};'use strict';var Sequelize=require(_0x809f('0x0'));module['exports']={'name':{'type':Sequelize[_0x809f('0x1')],'unique':_0x809f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x809f('0x1')]},'companyId':{'type':Sequelize[_0x809f('0x1')]},'website':{'type':Sequelize[_0x809f('0x1')]},'phone':{'type':Sequelize[_0x809f('0x1')]},'fax':{'type':Sequelize[_0x809f('0x1')]},'type':{'type':Sequelize[_0x809f('0x1')]},'street':{'type':Sequelize[_0x809f('0x1')]},'postalCode':{'type':Sequelize[_0x809f('0x1')]},'city':{'type':Sequelize[_0x809f('0x1')]},'country':{'type':Sequelize[_0x809f('0x1')]},'email':{'type':Sequelize[_0x809f('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x809f('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x809f('0x1')]}}; \ No newline at end of file +var _0x1c59=['STRING','name','exports'];(function(_0x2a61c5,_0x591fa3){var _0x1f066d=function(_0x521438){while(--_0x521438){_0x2a61c5['push'](_0x2a61c5['shift']());}};_0x1f066d(++_0x591fa3);}(_0x1c59,0x164));var _0x91c5=function(_0x1341a2,_0xe7a381){_0x1341a2=_0x1341a2-0x0;var _0xb9edfa=_0x1c59[_0x1341a2];return _0xb9edfa;};'use strict';var Sequelize=require('sequelize');module[_0x91c5('0x0')]={'name':{'type':Sequelize[_0x91c5('0x1')],'unique':_0x91c5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x91c5('0x1')]},'companyId':{'type':Sequelize[_0x91c5('0x1')]},'website':{'type':Sequelize[_0x91c5('0x1')]},'phone':{'type':Sequelize[_0x91c5('0x1')]},'fax':{'type':Sequelize[_0x91c5('0x1')]},'type':{'type':Sequelize[_0x91c5('0x1')]},'street':{'type':Sequelize[_0x91c5('0x1')]},'postalCode':{'type':Sequelize[_0x91c5('0x1')]},'city':{'type':Sequelize[_0x91c5('0x1')]},'country':{'type':Sequelize[_0x91c5('0x1')]},'email':{'type':Sequelize[_0x91c5('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x91c5('0x1')]},'sStreet':{'type':Sequelize[_0x91c5('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x91c5('0x1')]},'description':{'type':Sequelize[_0x91c5('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index c65580e..9b83689 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 _0x0f2f=['CmCompany','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','field','options','include','findAll','show','includeAll','create','user','role','find','userProfileId','autoAssociation','catch','body','params','addContacts','CmContact','ids','omit','findOne','order','map','getContacts','hasOwnProperty','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','send'];(function(_0x2b1952,_0x87b984){var _0x547118=function(_0x556b0e){while(--_0x556b0e){_0x2b1952['push'](_0x2b1952['shift']());}};_0x547118(++_0x87b984);}(_0x0f2f,0x7c));var _0xf0f2=function(_0x4556df,_0x2266bd){_0x4556df=_0x4556df-0x0;var _0x2c86d3=_0x0f2f[_0x4556df];return _0x2c86d3;};'use strict';var pdf=require(_0xf0f2('0x0'));var emlformat=require(_0xf0f2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0f2('0x2'));var moment=require(_0xf0f2('0x3'));var BPromise=require(_0xf0f2('0x4'));var Mustache=require('mustache');var util=require(_0xf0f2('0x5'));var path=require(_0xf0f2('0x6'));var sox=require(_0xf0f2('0x7'));var csv=require(_0xf0f2('0x8'));var ejs=require(_0xf0f2('0x9'));var fs=require('fs');var _=require(_0xf0f2('0xa'));var squel=require(_0xf0f2('0xb'));var crypto=require(_0xf0f2('0xc'));var jsforce=require(_0xf0f2('0xd'));var deskjs=require(_0xf0f2('0xe'));var toCsv=require(_0xf0f2('0x8'));var querystring=require('querystring');var Papa=require(_0xf0f2('0xf'));var Redis=require('ioredis');var authService=require(_0xf0f2('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0f2('0x11'));var utils=require(_0xf0f2('0x12'));var config=require(_0xf0f2('0x13'));var db=require(_0xf0f2('0x14'))['db'];function respondWithStatusCode(_0x126c98,_0x8d51d3){_0x8d51d3=_0x8d51d3||0xcc;return function(_0x34637d){if(_0x34637d){return _0x126c98[_0xf0f2('0x15')](_0x8d51d3);}return _0x126c98[_0xf0f2('0x16')](_0x8d51d3)['end']();};}function respondWithResult(_0x387c33,_0x23210c){_0x23210c=_0x23210c||0xc8;return function(_0x78e106){if(_0x78e106){return _0x387c33[_0xf0f2('0x16')](_0x23210c)['json'](_0x78e106);}};}function respondWithFilteredResult(_0xac7f5e,_0x345625){return function(_0x4e2947){if(_0x4e2947){var _0x3f6412=_0x4e2947[_0xf0f2('0x17')],_0x518e05=_0x345625[_0xf0f2('0x18')],_0x936dae=_0x345625[_0xf0f2('0x18')]+_0x345625['limit'],_0x54a7ef;if(_0x936dae>=_0x3f6412){_0x936dae=_0x3f6412;_0x54a7ef=0xc8;}else{_0x54a7ef=0xce;}_0xac7f5e[_0xf0f2('0x16')](_0x54a7ef);return _0xac7f5e['set'](_0xf0f2('0x19'),_0x518e05+'-'+_0x936dae+'/'+_0x3f6412)[_0xf0f2('0x1a')](_0x4e2947);}return null;};}function patchUpdates(_0x41c572){return function(_0x33b008){try{jsonpatch['apply'](_0x33b008,_0x41c572,!![]);}catch(_0x396bb4){return BPromise[_0xf0f2('0x1b')](_0x396bb4);}return _0x33b008[_0xf0f2('0x1c')]();};}function saveUpdates(_0xd9ba07,_0x4f6252){return function(_0x3049d4){if(_0x3049d4){return _0x3049d4[_0xf0f2('0x1d')](_0xd9ba07)[_0xf0f2('0x1e')](function(_0x4434a5){return _0x4434a5;});}return null;};}function removeEntity(_0x3058d9,_0x188eac){return function(_0x22d44c){if(_0x22d44c){return _0x22d44c[_0xf0f2('0x1f')]()[_0xf0f2('0x1e')](function(){var _0x560925=_0x22d44c[_0xf0f2('0x20')]({'plain':!![]});var _0x8dede8=_0xf0f2('0x21');return db[_0xf0f2('0x22')]['destroy']({'where':{'type':_0x8dede8,'resourceId':_0x560925['id']}})[_0xf0f2('0x1e')](function(){return _0x22d44c;});})[_0xf0f2('0x1e')](function(){_0x3058d9[_0xf0f2('0x16')](0xcc)[_0xf0f2('0x23')]();});}};}function handleEntityNotFound(_0x591417,_0x5ce39a){return function(_0x4208ff){if(!_0x4208ff){_0x591417[_0xf0f2('0x15')](0x194);}return _0x4208ff;};}function handleError(_0x34ac07,_0x271444){_0x271444=_0x271444||0x1f4;return function(_0x3db061){logger[_0xf0f2('0x24')](_0x3db061[_0xf0f2('0x25')]);if(_0x3db061[_0xf0f2('0x26')]){delete _0x3db061[_0xf0f2('0x26')];}_0x34ac07['status'](_0x271444)[_0xf0f2('0x27')](_0x3db061);};}exports['index']=function(_0x3cb29c,_0x2ea755){var _0x30edc1={},_0x2b77ec={},_0x235085={'count':0x0,'rows':[]};var _0x45c5e1=db[_0xf0f2('0x28')][_0xf0f2('0x29')];_0x2b77ec[_0xf0f2('0x2a')]=_[_0xf0f2('0x2b')](_0x45c5e1);_0x2b77ec['query']=_[_0xf0f2('0x2b')](_0x3cb29c[_0xf0f2('0x2c')]);_0x2b77ec[_0xf0f2('0x2d')]=_[_0xf0f2('0x2e')](_0x2b77ec[_0xf0f2('0x2a')],_0x2b77ec[_0xf0f2('0x2c')]);_0x30edc1[_0xf0f2('0x2f')]=_[_0xf0f2('0x2e')](_0x2b77ec[_0xf0f2('0x2a')],qs[_0xf0f2('0x30')](_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x30')]));_0x30edc1[_0xf0f2('0x2f')]=_0x30edc1['attributes'][_0xf0f2('0x31')]?_0x30edc1[_0xf0f2('0x2f')]:_0x2b77ec[_0xf0f2('0x2a')];if(!_0x3cb29c[_0xf0f2('0x2c')]['hasOwnProperty'](_0xf0f2('0x32'))){_0x30edc1['limit']=qs[_0xf0f2('0x33')](_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x33')]);_0x30edc1[_0xf0f2('0x18')]=qs[_0xf0f2('0x18')](_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x18')]);}_0x30edc1['order']=qs[_0xf0f2('0x34')](_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x34')]);_0x30edc1['where']=qs['filters'](_[_0xf0f2('0x35')](_0x3cb29c['query'],_0x2b77ec['filters']));if(_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x36')]){_0x30edc1[_0xf0f2('0x37')]=_[_0xf0f2('0x38')](_0x30edc1[_0xf0f2('0x37')],{'$or':_['map'](_0x45c5e1,function(_0x321986){if(_0x321986['type']['key']!==_0xf0f2('0x39')){var _0x115847={};_0x115847[_0x321986[_0xf0f2('0x3a')]]={'$like':'%'+_0x3cb29c[_0xf0f2('0x2c')][_0xf0f2('0x36')]+'%'};return _0x115847;}})});}_0x30edc1=_[_0xf0f2('0x38')]({},_0x30edc1,_0x3cb29c[_0xf0f2('0x3b')]);var _0x1d23ed={'where':_0x30edc1['where']};return db['CmCompany']['count'](_0x1d23ed)[_0xf0f2('0x1e')](function(_0xc0e960){_0x235085[_0xf0f2('0x17')]=_0xc0e960;if(_0x3cb29c[_0xf0f2('0x2c')]['includeAll']){_0x30edc1[_0xf0f2('0x3c')]=[{'all':!![]}];}return db[_0xf0f2('0x28')][_0xf0f2('0x3d')](_0x30edc1);})[_0xf0f2('0x1e')](function(_0x35bacb){_0x235085['rows']=_0x35bacb;return _0x235085;})['then'](respondWithFilteredResult(_0x2ea755,_0x30edc1))['catch'](handleError(_0x2ea755,null));};exports[_0xf0f2('0x3e')]=function(_0x320a4c,_0x2718af){var _0x2d423f={'raw':![],'where':{'id':_0x320a4c['params']['id']}},_0xd73752={};_0xd73752[_0xf0f2('0x2a')]=_[_0xf0f2('0x2b')](db[_0xf0f2('0x28')]['rawAttributes']);_0xd73752[_0xf0f2('0x2c')]=_['keys'](_0x320a4c['query']);_0xd73752['filters']=_[_0xf0f2('0x2e')](_0xd73752['model'],_0xd73752['query']);_0x2d423f['attributes']=_['intersection'](_0xd73752[_0xf0f2('0x2a')],qs['fields'](_0x320a4c[_0xf0f2('0x2c')][_0xf0f2('0x30')]));_0x2d423f[_0xf0f2('0x2f')]=_0x2d423f[_0xf0f2('0x2f')][_0xf0f2('0x31')]?_0x2d423f[_0xf0f2('0x2f')]:_0xd73752[_0xf0f2('0x2a')];if(_0x320a4c[_0xf0f2('0x2c')][_0xf0f2('0x3f')]){_0x2d423f[_0xf0f2('0x3c')]=[{'all':!![]}];}_0x2d423f=_[_0xf0f2('0x38')]({},_0x2d423f,_0x320a4c[_0xf0f2('0x3b')]);return db[_0xf0f2('0x28')]['find'](_0x2d423f)[_0xf0f2('0x1e')](handleEntityNotFound(_0x2718af,null))[_0xf0f2('0x1e')](respondWithResult(_0x2718af,null))['catch'](handleError(_0x2718af,null));};exports[_0xf0f2('0x40')]=function(_0x2dae02,_0xa624d8){return db['CmCompany'][_0xf0f2('0x40')](_0x2dae02['body'],{})[_0xf0f2('0x1e')](function(_0x2996ad){var _0x14b31b=_0x2dae02[_0xf0f2('0x41')][_0xf0f2('0x20')]({'plain':!![]});if(!_0x14b31b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14b31b[_0xf0f2('0x42')]===_0xf0f2('0x41')){var _0xed557f=_0x2996ad[_0xf0f2('0x20')]({'plain':!![]});var _0x59d06e=_0xf0f2('0x21');return db['UserProfileSection'][_0xf0f2('0x43')]({'where':{'name':_0x59d06e,'userProfileId':_0x14b31b[_0xf0f2('0x44')]},'raw':!![]})[_0xf0f2('0x1e')](function(_0x1c0022){if(_0x1c0022&&_0x1c0022[_0xf0f2('0x45')]===0x0){return db[_0xf0f2('0x22')][_0xf0f2('0x40')]({'name':_0xed557f[_0xf0f2('0x26')],'resourceId':_0xed557f['id'],'type':_0x1c0022[_0xf0f2('0x26')],'sectionId':_0x1c0022['id']},{})[_0xf0f2('0x1e')](function(){return _0x2996ad;});}else{return _0x2996ad;}})[_0xf0f2('0x46')](function(_0x51358b){logger[_0xf0f2('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51358b);throw _0x51358b;});}return _0x2996ad;})[_0xf0f2('0x1e')](respondWithResult(_0xa624d8,0xc9))[_0xf0f2('0x46')](handleError(_0xa624d8,null));};exports[_0xf0f2('0x1d')]=function(_0x170437,_0x50e866){if(_0x170437[_0xf0f2('0x47')]['id']){delete _0x170437[_0xf0f2('0x47')]['id'];}return db['CmCompany'][_0xf0f2('0x43')]({'where':{'id':_0x170437[_0xf0f2('0x48')]['id']}})[_0xf0f2('0x1e')](handleEntityNotFound(_0x50e866,null))[_0xf0f2('0x1e')](saveUpdates(_0x170437['body'],null))[_0xf0f2('0x1e')](respondWithResult(_0x50e866,null))[_0xf0f2('0x46')](handleError(_0x50e866,null));};exports[_0xf0f2('0x1f')]=function(_0x4f2eab,_0x346a9d){return db[_0xf0f2('0x28')][_0xf0f2('0x43')]({'where':{'id':_0x4f2eab[_0xf0f2('0x48')]['id']}})[_0xf0f2('0x1e')](handleEntityNotFound(_0x346a9d,null))[_0xf0f2('0x1e')](removeEntity(_0x346a9d,null))[_0xf0f2('0x46')](handleError(_0x346a9d,null));};exports[_0xf0f2('0x49')]=function(_0x29f4e5,_0x1104b8,_0x409970){return db[_0xf0f2('0x4a')]['find']({'where':{'id':_0x29f4e5[_0xf0f2('0x48')]['id']}})[_0xf0f2('0x1e')](handleEntityNotFound(_0x1104b8,null))['then'](function(_0xb12f28){if(_0xb12f28){return _0xb12f28[_0xf0f2('0x49')](_0x29f4e5[_0xf0f2('0x47')][_0xf0f2('0x4b')],_[_0xf0f2('0x4c')](_0x29f4e5['body'],[_0xf0f2('0x4b'),'id'])||{});}})[_0xf0f2('0x1e')](respondWithResult(_0x1104b8,null))[_0xf0f2('0x46')](handleError(_0x1104b8,null));};exports['getContacts']=function(_0x49c581,_0x258a4b,_0x3b1cf0){var _0x16539e={};var _0x127111={};var _0x302cee;var _0x3f76f4;return db[_0xf0f2('0x28')][_0xf0f2('0x4d')]({'where':{'id':_0x49c581[_0xf0f2('0x48')]['id']}})[_0xf0f2('0x1e')](handleEntityNotFound(_0x258a4b,null))['then'](function(_0x13a758){if(_0x13a758){_0x302cee=_0x13a758;_0x127111['model']=_['keys'](db[_0xf0f2('0x4a')]['rawAttributes']);_0x127111[_0xf0f2('0x2c')]=_['keys'](_0x49c581[_0xf0f2('0x2c')]);_0x127111['filters']=_[_0xf0f2('0x2e')](_0x127111[_0xf0f2('0x2a')],_0x127111[_0xf0f2('0x2c')]);_0x16539e[_0xf0f2('0x2f')]=_[_0xf0f2('0x2e')](_0x127111[_0xf0f2('0x2a')],qs[_0xf0f2('0x30')](_0x49c581[_0xf0f2('0x2c')][_0xf0f2('0x30')]));_0x16539e[_0xf0f2('0x2f')]=_0x16539e['attributes'][_0xf0f2('0x31')]?_0x16539e[_0xf0f2('0x2f')]:_0x127111['model'];_0x16539e[_0xf0f2('0x4e')]=qs[_0xf0f2('0x34')](_0x49c581[_0xf0f2('0x2c')][_0xf0f2('0x34')]);_0x16539e['where']=qs[_0xf0f2('0x2d')](_[_0xf0f2('0x35')](_0x49c581['query'],_0x127111[_0xf0f2('0x2d')]));if(_0x49c581[_0xf0f2('0x2c')]['filter']){_0x16539e[_0xf0f2('0x37')]=_[_0xf0f2('0x38')](_0x16539e[_0xf0f2('0x37')],{'$or':_[_0xf0f2('0x4f')](_0x16539e[_0xf0f2('0x2f')],function(_0x1ab05e){var _0x5de4f0={};_0x5de4f0[_0x1ab05e]={'$like':'%'+_0x49c581[_0xf0f2('0x2c')][_0xf0f2('0x36')]+'%'};return _0x5de4f0;})});}_0x16539e=_[_0xf0f2('0x38')]({},_0x16539e,_0x49c581[_0xf0f2('0x3b')]);return _0x302cee[_0xf0f2('0x50')](_0x16539e);}})[_0xf0f2('0x1e')](function(_0x4e47a3){if(_0x4e47a3){_0x3f76f4=_0x4e47a3[_0xf0f2('0x31')];if(!_0x49c581[_0xf0f2('0x2c')][_0xf0f2('0x51')]('nolimit')){_0x16539e[_0xf0f2('0x33')]=qs['limit'](_0x49c581['query']['limit']);_0x16539e[_0xf0f2('0x18')]=qs[_0xf0f2('0x18')](_0x49c581[_0xf0f2('0x2c')][_0xf0f2('0x18')]);}return _0x302cee[_0xf0f2('0x50')](_0x16539e);}})['then'](function(_0xc4ce7c){if(_0xc4ce7c){return _0xc4ce7c?{'count':_0x3f76f4,'rows':_0xc4ce7c}:null;}})['then'](respondWithResult(_0x258a4b,null))['catch'](handleError(_0x258a4b,null));}; \ No newline at end of file +var _0x5b80=['rows','show','params','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','order','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','end','sendStatus','stack','name','send','CmCompany','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','options','include','findAll'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5b80,0x114));var _0x05b8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x5b80[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x05b8('0x0'));var emlformat=require(_0x05b8('0x1'));var rimraf=require(_0x05b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05b8('0x3'));var rp=require(_0x05b8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x05b8('0x5'));var sox=require(_0x05b8('0x6'));var csv=require(_0x05b8('0x7'));var ejs=require(_0x05b8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05b8('0x9'));var deskjs=require(_0x05b8('0xa'));var toCsv=require(_0x05b8('0x7'));var querystring=require(_0x05b8('0xb'));var Papa=require(_0x05b8('0xc'));var Redis=require(_0x05b8('0xd'));var authService=require(_0x05b8('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x05b8('0xf'));var logger=require(_0x05b8('0x10'))(_0x05b8('0x11'));var utils=require(_0x05b8('0x12'));var config=require(_0x05b8('0x13'));var db=require(_0x05b8('0x14'))['db'];function respondWithStatusCode(_0x1d1724,_0x11186e){_0x11186e=_0x11186e||0xcc;return function(_0x1cf853){if(_0x1cf853){return _0x1d1724['sendStatus'](_0x11186e);}return _0x1d1724['status'](_0x11186e)['end']();};}function respondWithResult(_0x5b4415,_0xee3521){_0xee3521=_0xee3521||0xc8;return function(_0x49532b){if(_0x49532b){return _0x5b4415[_0x05b8('0x15')](_0xee3521)[_0x05b8('0x16')](_0x49532b);}};}function respondWithFilteredResult(_0x5d1c4e,_0x1218a8){return function(_0x562abf){if(_0x562abf){var _0x4e2863=_0x562abf[_0x05b8('0x17')],_0x47b21c=_0x1218a8[_0x05b8('0x18')],_0x1873af=_0x1218a8[_0x05b8('0x18')]+_0x1218a8[_0x05b8('0x19')],_0x36336f;if(_0x1873af>=_0x4e2863){_0x1873af=_0x4e2863;_0x36336f=0xc8;}else{_0x36336f=0xce;}_0x5d1c4e['status'](_0x36336f);return _0x5d1c4e[_0x05b8('0x1a')](_0x05b8('0x1b'),_0x47b21c+'-'+_0x1873af+'/'+_0x4e2863)[_0x05b8('0x16')](_0x562abf);}return null;};}function patchUpdates(_0x1a0aba){return function(_0x42e81b){try{jsonpatch[_0x05b8('0x1c')](_0x42e81b,_0x1a0aba,!![]);}catch(_0x4292d0){return BPromise[_0x05b8('0x1d')](_0x4292d0);}return _0x42e81b[_0x05b8('0x1e')]();};}function saveUpdates(_0x43d8b8,_0x3dfb47){return function(_0x113070){if(_0x113070){return _0x113070[_0x05b8('0x1f')](_0x43d8b8)[_0x05b8('0x20')](function(_0x13ce05){return _0x13ce05;});}return null;};}function removeEntity(_0x14a5b3,_0x153387){return function(_0x37c7d0){if(_0x37c7d0){return _0x37c7d0['destroy']()['then'](function(){var _0x3687c9=_0x37c7d0[_0x05b8('0x21')]({'plain':!![]});var _0x167aa4=_0x05b8('0x22');return db[_0x05b8('0x23')][_0x05b8('0x24')]({'where':{'type':_0x167aa4,'resourceId':_0x3687c9['id']}})[_0x05b8('0x20')](function(){return _0x37c7d0;});})[_0x05b8('0x20')](function(){_0x14a5b3[_0x05b8('0x15')](0xcc)[_0x05b8('0x25')]();});}};}function handleEntityNotFound(_0x2645ce,_0x5ba152){return function(_0x37d4ab){if(!_0x37d4ab){_0x2645ce[_0x05b8('0x26')](0x194);}return _0x37d4ab;};}function handleError(_0x224ea9,_0x972caa){_0x972caa=_0x972caa||0x1f4;return function(_0x5d61ce){logger['error'](_0x5d61ce[_0x05b8('0x27')]);if(_0x5d61ce[_0x05b8('0x28')]){delete _0x5d61ce[_0x05b8('0x28')];}_0x224ea9[_0x05b8('0x15')](_0x972caa)[_0x05b8('0x29')](_0x5d61ce);};}exports['index']=function(_0x508f3e,_0x20ccf8){var _0x2337b4={},_0x237ed3={},_0x500bec={'count':0x0,'rows':[]};var _0x2a7da1=db[_0x05b8('0x2a')]['rawAttributes'];_0x237ed3['model']=_[_0x05b8('0x2b')](_0x2a7da1);_0x237ed3[_0x05b8('0x2c')]=_[_0x05b8('0x2b')](_0x508f3e[_0x05b8('0x2c')]);_0x237ed3[_0x05b8('0x2d')]=_['intersection'](_0x237ed3[_0x05b8('0x2e')],_0x237ed3[_0x05b8('0x2c')]);_0x2337b4['attributes']=_[_0x05b8('0x2f')](_0x237ed3[_0x05b8('0x2e')],qs['fields'](_0x508f3e[_0x05b8('0x2c')][_0x05b8('0x30')]));_0x2337b4[_0x05b8('0x31')]=_0x2337b4[_0x05b8('0x31')][_0x05b8('0x32')]?_0x2337b4[_0x05b8('0x31')]:_0x237ed3[_0x05b8('0x2e')];if(!_0x508f3e['query'][_0x05b8('0x33')](_0x05b8('0x34'))){_0x2337b4[_0x05b8('0x19')]=qs[_0x05b8('0x19')](_0x508f3e['query'][_0x05b8('0x19')]);_0x2337b4[_0x05b8('0x18')]=qs[_0x05b8('0x18')](_0x508f3e['query']['offset']);}_0x2337b4['order']=qs[_0x05b8('0x35')](_0x508f3e['query'][_0x05b8('0x35')]);_0x2337b4[_0x05b8('0x36')]=qs[_0x05b8('0x2d')](_[_0x05b8('0x37')](_0x508f3e[_0x05b8('0x2c')],_0x237ed3['filters']));if(_0x508f3e[_0x05b8('0x2c')][_0x05b8('0x38')]){_0x2337b4[_0x05b8('0x36')]=_[_0x05b8('0x39')](_0x2337b4[_0x05b8('0x36')],{'$or':_[_0x05b8('0x3a')](_0x2a7da1,function(_0x51532d){if(_0x51532d['type'][_0x05b8('0x3b')]!==_0x05b8('0x3c')){var _0x383c4c={};_0x383c4c[_0x51532d['field']]={'$like':'%'+_0x508f3e['query'][_0x05b8('0x38')]+'%'};return _0x383c4c;}})});}_0x2337b4=_[_0x05b8('0x39')]({},_0x2337b4,_0x508f3e[_0x05b8('0x3d')]);var _0x468775={'where':_0x2337b4[_0x05b8('0x36')]};return db['CmCompany']['count'](_0x468775)[_0x05b8('0x20')](function(_0x4ab772){_0x500bec['count']=_0x4ab772;if(_0x508f3e['query']['includeAll']){_0x2337b4[_0x05b8('0x3e')]=[{'all':!![]}];}return db[_0x05b8('0x2a')][_0x05b8('0x3f')](_0x2337b4);})[_0x05b8('0x20')](function(_0x1432dd){_0x500bec[_0x05b8('0x40')]=_0x1432dd;return _0x500bec;})['then'](respondWithFilteredResult(_0x20ccf8,_0x2337b4))['catch'](handleError(_0x20ccf8,null));};exports[_0x05b8('0x41')]=function(_0x1d3633,_0x1e6852){var _0x4b8b30={'raw':![],'where':{'id':_0x1d3633[_0x05b8('0x42')]['id']}},_0x50fa90={};_0x50fa90[_0x05b8('0x2e')]=_[_0x05b8('0x2b')](db[_0x05b8('0x2a')]['rawAttributes']);_0x50fa90['query']=_[_0x05b8('0x2b')](_0x1d3633[_0x05b8('0x2c')]);_0x50fa90[_0x05b8('0x2d')]=_[_0x05b8('0x2f')](_0x50fa90[_0x05b8('0x2e')],_0x50fa90['query']);_0x4b8b30[_0x05b8('0x31')]=_[_0x05b8('0x2f')](_0x50fa90[_0x05b8('0x2e')],qs['fields'](_0x1d3633[_0x05b8('0x2c')][_0x05b8('0x30')]));_0x4b8b30[_0x05b8('0x31')]=_0x4b8b30[_0x05b8('0x31')]['length']?_0x4b8b30[_0x05b8('0x31')]:_0x50fa90[_0x05b8('0x2e')];if(_0x1d3633[_0x05b8('0x2c')][_0x05b8('0x43')]){_0x4b8b30[_0x05b8('0x3e')]=[{'all':!![]}];}_0x4b8b30=_[_0x05b8('0x39')]({},_0x4b8b30,_0x1d3633[_0x05b8('0x3d')]);return db['CmCompany'][_0x05b8('0x44')](_0x4b8b30)['then'](handleEntityNotFound(_0x1e6852,null))['then'](respondWithResult(_0x1e6852,null))[_0x05b8('0x45')](handleError(_0x1e6852,null));};exports['create']=function(_0x481e94,_0x269feb){return db[_0x05b8('0x2a')][_0x05b8('0x46')](_0x481e94[_0x05b8('0x47')],{})[_0x05b8('0x20')](function(_0x17ae92){var _0x58b629=_0x481e94[_0x05b8('0x48')][_0x05b8('0x21')]({'plain':!![]});if(!_0x58b629)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58b629[_0x05b8('0x49')]===_0x05b8('0x48')){var _0x8d3163=_0x17ae92[_0x05b8('0x21')]({'plain':!![]});var _0x59ad85=_0x05b8('0x22');return db[_0x05b8('0x4a')][_0x05b8('0x44')]({'where':{'name':_0x59ad85,'userProfileId':_0x58b629[_0x05b8('0x4b')]},'raw':!![]})[_0x05b8('0x20')](function(_0x2f7ac7){if(_0x2f7ac7&&_0x2f7ac7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x8d3163[_0x05b8('0x28')],'resourceId':_0x8d3163['id'],'type':_0x2f7ac7['name'],'sectionId':_0x2f7ac7['id']},{})[_0x05b8('0x20')](function(){return _0x17ae92;});}else{return _0x17ae92;}})[_0x05b8('0x45')](function(_0x43d420){logger[_0x05b8('0x4c')](_0x05b8('0x4d'),_0x43d420);throw _0x43d420;});}return _0x17ae92;})[_0x05b8('0x20')](respondWithResult(_0x269feb,0xc9))[_0x05b8('0x45')](handleError(_0x269feb,null));};exports[_0x05b8('0x1f')]=function(_0x558a14,_0x3633b2){if(_0x558a14['body']['id']){delete _0x558a14[_0x05b8('0x47')]['id'];}return db[_0x05b8('0x2a')][_0x05b8('0x44')]({'where':{'id':_0x558a14['params']['id']}})[_0x05b8('0x20')](handleEntityNotFound(_0x3633b2,null))[_0x05b8('0x20')](saveUpdates(_0x558a14['body'],null))[_0x05b8('0x20')](respondWithResult(_0x3633b2,null))['catch'](handleError(_0x3633b2,null));};exports['destroy']=function(_0x574fac,_0x5ef43a){return db[_0x05b8('0x2a')]['find']({'where':{'id':_0x574fac[_0x05b8('0x42')]['id']}})[_0x05b8('0x20')](handleEntityNotFound(_0x5ef43a,null))[_0x05b8('0x20')](removeEntity(_0x5ef43a,null))[_0x05b8('0x45')](handleError(_0x5ef43a,null));};exports['addContacts']=function(_0x2e2d2c,_0x19abc0,_0x409536){return db[_0x05b8('0x4e')][_0x05b8('0x44')]({'where':{'id':_0x2e2d2c[_0x05b8('0x42')]['id']}})[_0x05b8('0x20')](handleEntityNotFound(_0x19abc0,null))['then'](function(_0x3a1aa9){if(_0x3a1aa9){return _0x3a1aa9[_0x05b8('0x4f')](_0x2e2d2c[_0x05b8('0x47')][_0x05b8('0x50')],_[_0x05b8('0x51')](_0x2e2d2c[_0x05b8('0x47')],[_0x05b8('0x50'),'id'])||{});}})[_0x05b8('0x20')](respondWithResult(_0x19abc0,null))[_0x05b8('0x45')](handleError(_0x19abc0,null));};exports[_0x05b8('0x52')]=function(_0x31ee0d,_0x42ee17,_0x5bd187){var _0x2cedb8={};var _0xc9683d={};var _0x43c7d3;var _0x17ffb0;return db[_0x05b8('0x2a')][_0x05b8('0x53')]({'where':{'id':_0x31ee0d[_0x05b8('0x42')]['id']}})[_0x05b8('0x20')](handleEntityNotFound(_0x42ee17,null))[_0x05b8('0x20')](function(_0x54a824){if(_0x54a824){_0x43c7d3=_0x54a824;_0xc9683d[_0x05b8('0x2e')]=_[_0x05b8('0x2b')](db[_0x05b8('0x4e')]['rawAttributes']);_0xc9683d[_0x05b8('0x2c')]=_['keys'](_0x31ee0d[_0x05b8('0x2c')]);_0xc9683d['filters']=_[_0x05b8('0x2f')](_0xc9683d[_0x05b8('0x2e')],_0xc9683d[_0x05b8('0x2c')]);_0x2cedb8['attributes']=_[_0x05b8('0x2f')](_0xc9683d[_0x05b8('0x2e')],qs[_0x05b8('0x30')](_0x31ee0d[_0x05b8('0x2c')][_0x05b8('0x30')]));_0x2cedb8[_0x05b8('0x31')]=_0x2cedb8[_0x05b8('0x31')][_0x05b8('0x32')]?_0x2cedb8[_0x05b8('0x31')]:_0xc9683d[_0x05b8('0x2e')];_0x2cedb8[_0x05b8('0x54')]=qs[_0x05b8('0x35')](_0x31ee0d[_0x05b8('0x2c')][_0x05b8('0x35')]);_0x2cedb8[_0x05b8('0x36')]=qs[_0x05b8('0x2d')](_[_0x05b8('0x37')](_0x31ee0d[_0x05b8('0x2c')],_0xc9683d[_0x05b8('0x2d')]));if(_0x31ee0d[_0x05b8('0x2c')]['filter']){_0x2cedb8[_0x05b8('0x36')]=_[_0x05b8('0x39')](_0x2cedb8[_0x05b8('0x36')],{'$or':_[_0x05b8('0x3a')](_0x2cedb8[_0x05b8('0x31')],function(_0x50db90){var _0x39c75f={};_0x39c75f[_0x50db90]={'$like':'%'+_0x31ee0d[_0x05b8('0x2c')][_0x05b8('0x38')]+'%'};return _0x39c75f;})});}_0x2cedb8=_[_0x05b8('0x39')]({},_0x2cedb8,_0x31ee0d[_0x05b8('0x3d')]);return _0x43c7d3[_0x05b8('0x52')](_0x2cedb8);}})[_0x05b8('0x20')](function(_0x483b5e){if(_0x483b5e){_0x17ffb0=_0x483b5e[_0x05b8('0x32')];if(!_0x31ee0d[_0x05b8('0x2c')][_0x05b8('0x33')](_0x05b8('0x34'))){_0x2cedb8[_0x05b8('0x19')]=qs[_0x05b8('0x19')](_0x31ee0d[_0x05b8('0x2c')]['limit']);_0x2cedb8[_0x05b8('0x18')]=qs[_0x05b8('0x18')](_0x31ee0d[_0x05b8('0x2c')][_0x05b8('0x18')]);}return _0x43c7d3[_0x05b8('0x52')](_0x2cedb8);}})[_0x05b8('0x20')](function(_0x8265ea){if(_0x8265ea){return _0x8265ea?{'count':_0x17ffb0,'rows':_0x8265ea}:null;}})[_0x05b8('0x20')](respondWithResult(_0x42ee17,null))[_0x05b8('0x45')](handleError(_0x42ee17,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4cf49b1..67cad4e 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 _0x2272=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','CmCompany','cm_companies'];(function(_0x494f3e,_0x5999dc){var _0x2ee240=function(_0x552840){while(--_0x552840){_0x494f3e['push'](_0x494f3e['shift']());}};_0x2ee240(++_0x5999dc);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x2227('0x8')]=function(_0x3b8661,_0xb33647){return _0x3b8661[_0x2227('0x9')](_0x2227('0xa'),attributes,{'tableName':_0x2227('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe820=['exports','define','CmCompany','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x177176,_0x1b4da9){var _0x55e425=function(_0x5ef5a6){while(--_0x5ef5a6){_0x177176['push'](_0x177176['shift']());}};_0x55e425(++_0x1b4da9);}(_0xe820,0xd2));var _0x0e82=function(_0x5f27da,_0xb76c2d){_0x5f27da=_0x5f27da-0x0;var _0x57d7bd=_0xe820[_0x5f27da];return _0x57d7bd;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./cmCompany.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),attributes,{'tableName':'cm_companies','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 1469bc6..306b9dc 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 _0xf81d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xf81d,0xeb));var _0xdf81=function(_0x221b0b,_0x4dfb48){_0x221b0b=_0x221b0b-0x0;var _0x5b6ba0=_0xf81d[_0x221b0b];return _0x5b6ba0;};'use strict';var _=require('lodash');var util=require(_0xdf81('0x0'));var moment=require(_0xdf81('0x1'));var BPromise=require(_0xdf81('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf81('0x3'));var db=require(_0xdf81('0x4'))['db'];var utils=require(_0xdf81('0x5'));var logger=require(_0xdf81('0x6'))('rpc');var config=require(_0xdf81('0x7'));var jayson=require(_0xdf81('0x8'));var client=jayson[_0xdf81('0x9')][_0xdf81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286d10,_0x98bced,_0x33b596){return new BPromise(function(_0x384c93,_0x3224b1){return client[_0xdf81('0xb')](_0x286d10,_0x33b596)['then'](function(_0x5dc669){logger['info']('CmCompany,\x20%s,\x20%s',_0x98bced,_0xdf81('0xc'));logger['debug'](_0xdf81('0xd'),_0x98bced,_0xdf81('0xc'),JSON[_0xdf81('0xe')](_0x5dc669));if(_0x5dc669[_0xdf81('0xf')]){if(_0x5dc669[_0xdf81('0xf')][_0xdf81('0x10')]===0x1f4){logger[_0xdf81('0xf')]('CmCompany,\x20%s,\x20%s',_0x98bced,_0x5dc669[_0xdf81('0xf')]['message']);return _0x3224b1(_0x5dc669[_0xdf81('0xf')][_0xdf81('0x11')]);}logger[_0xdf81('0xf')](_0xdf81('0x12'),_0x98bced,_0x5dc669[_0xdf81('0xf')][_0xdf81('0x11')]);return _0x384c93(_0x5dc669[_0xdf81('0xf')][_0xdf81('0x11')]);}else{logger['info'](_0xdf81('0x12'),_0x98bced,'request\x20sent');_0x384c93(_0x5dc669[_0xdf81('0x13')]['message']);}})['catch'](function(_0x51de99){logger['error'](_0xdf81('0x12'),_0x98bced,_0x51de99);_0x3224b1(_0x51de99);});});} \ No newline at end of file +var _0x20ff=['client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xa12d03,_0x445612){var _0x2bfbbf=function(_0x2d589b){while(--_0x2d589b){_0xa12d03['push'](_0xa12d03['shift']());}};_0x2bfbbf(++_0x445612);}(_0x20ff,0x1f1));var _0xf20f=function(_0x6b885d,_0x32b712){_0x6b885d=_0x6b885d-0x0;var _0xa79168=_0x20ff[_0x6b885d];return _0xa79168;};'use strict';var _=require('lodash');var util=require(_0xf20f('0x0'));var moment=require(_0xf20f('0x1'));var BPromise=require(_0xf20f('0x2'));var rs=require(_0xf20f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf20f('0x4'))['db'];var utils=require(_0xf20f('0x5'));var logger=require(_0xf20f('0x6'))(_0xf20f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf20f('0x8'));var client=jayson[_0xf20f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eae0c,_0x4c598c,_0x16fc05){return new BPromise(function(_0x3412eb,_0x256efc){return client[_0xf20f('0xa')](_0x3eae0c,_0x16fc05)[_0xf20f('0xb')](function(_0x3e3acf){logger[_0xf20f('0xc')](_0xf20f('0xd'),_0x4c598c,_0xf20f('0xe'));logger['debug'](_0xf20f('0xf'),_0x4c598c,_0xf20f('0xe'),JSON[_0xf20f('0x10')](_0x3e3acf));if(_0x3e3acf[_0xf20f('0x11')]){if(_0x3e3acf[_0xf20f('0x11')][_0xf20f('0x12')]===0x1f4){logger[_0xf20f('0x11')]('CmCompany,\x20%s,\x20%s',_0x4c598c,_0x3e3acf[_0xf20f('0x11')][_0xf20f('0x13')]);return _0x256efc(_0x3e3acf[_0xf20f('0x11')][_0xf20f('0x13')]);}logger[_0xf20f('0x11')]('CmCompany,\x20%s,\x20%s',_0x4c598c,_0x3e3acf[_0xf20f('0x11')][_0xf20f('0x13')]);return _0x3412eb(_0x3e3acf['error']['message']);}else{logger[_0xf20f('0xc')](_0xf20f('0xd'),_0x4c598c,_0xf20f('0xe'));_0x3412eb(_0x3e3acf[_0xf20f('0x14')][_0xf20f('0x13')]);}})[_0xf20f('0x15')](function(_0x459eea){logger['error'](_0xf20f('0xd'),_0x4c598c,_0x459eea);_0x256efc(_0x459eea);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 649457f..c9758b8 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 _0xe2c7=['Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','index','isAuthenticated','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','destroy','exports','multer','connect-timeout','express'];(function(_0x4a73dd,_0x58e46c){var _0x279e6b=function(_0x25254b){while(--_0x25254b){_0x4a73dd['push'](_0x4a73dd['shift']());}};_0x279e6b(++_0x58e46c);}(_0xe2c7,0xc5));var _0x7e2c=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xe2c7[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x7e2c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7e2c('0x1'));var express=require(_0x7e2c('0x2'));var router=express[_0x7e2c('0x3')]();var auth=require(_0x7e2c('0x4'));var interaction=require(_0x7e2c('0x5'));var config=require('../../config/environment');var controller=require(_0x7e2c('0x6'));router[_0x7e2c('0x7')]('/',auth['isAuthenticated'](),controller[_0x7e2c('0x8')]);router['get']('/:id',auth[_0x7e2c('0x9')](),controller['show']);router['get'](_0x7e2c('0xa'),auth[_0x7e2c('0x9')](),controller[_0x7e2c('0xb')]);router[_0x7e2c('0xc')]('/',auth[_0x7e2c('0x9')](),controller[_0x7e2c('0xd')]);router['post'](_0x7e2c('0xa'),auth[_0x7e2c('0x9')](),controller[_0x7e2c('0xe')]);router[_0x7e2c('0xf')](_0x7e2c('0x10'),auth['isAuthenticated'](),controller[_0x7e2c('0x11')]);router['delete']('/:id',auth[_0x7e2c('0x9')](),controller[_0x7e2c('0x12')]);module[_0x7e2c('0x13')]=router; \ No newline at end of file +var _0xb085=['Router','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0xb085,0xd8));var _0x5b08=function(_0x3db2d3,_0x34239b){_0x3db2d3=_0x3db2d3-0x0;var _0x37aff2=_0xb085[_0x3db2d3];return _0x37aff2;};'use strict';var multer=require(_0x5b08('0x0'));var util=require('util');var path=require(_0x5b08('0x1'));var timeout=require(_0x5b08('0x2'));var express=require(_0x5b08('0x3'));var router=express[_0x5b08('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5b08('0x5'));var config=require('../../config/environment');var controller=require(_0x5b08('0x6'));router['get']('/',auth[_0x5b08('0x7')](),controller[_0x5b08('0x8')]);router[_0x5b08('0x9')]('/:id',auth[_0x5b08('0x7')](),controller[_0x5b08('0xa')]);router[_0x5b08('0x9')](_0x5b08('0xb'),auth[_0x5b08('0x7')](),controller[_0x5b08('0xc')]);router[_0x5b08('0xd')]('/',auth[_0x5b08('0x7')](),controller[_0x5b08('0xe')]);router[_0x5b08('0xd')](_0x5b08('0xb'),auth[_0x5b08('0x7')](),controller[_0x5b08('0xf')]);router[_0x5b08('0x10')](_0x5b08('0x11'),auth[_0x5b08('0x7')](),controller[_0x5b08('0x12')]);router[_0x5b08('0x13')](_0x5b08('0x11'),auth['isAuthenticated'](),controller[_0x5b08('0x14')]);module[_0x5b08('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a3cdb7c..85d9110 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 _0x9041=['STRING','TEXT','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x37fddc,_0xce493c){var _0x504eeb=function(_0x9eb2c0){while(--_0x9eb2c0){_0x37fddc['push'](_0x37fddc['shift']());}};_0x504eeb(++_0xce493c);}(_0x9041,0x1cc));var _0x1904=function(_0x53229f,_0x231c09){_0x53229f=_0x53229f-0x0;var _0x25b111=_0x9041[_0x53229f];return _0x25b111;};'use strict';var _=require('lodash');var Sequelize=require(_0x1904('0x0'));module[_0x1904('0x1')]={'firstName':{'type':Sequelize[_0x1904('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1904('0x2')]},'street':{'type':Sequelize[_0x1904('0x2')]},'postalCode':{'type':Sequelize[_0x1904('0x2')]},'city':{'type':Sequelize[_0x1904('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1904('0x2')]},'description':{'type':Sequelize[_0x1904('0x3')]},'phone':{'type':Sequelize[_0x1904('0x2')]},'mobile':{'type':Sequelize[_0x1904('0x2')]},'fax':{'type':Sequelize[_0x1904('0x2')]},'email':{'type':Sequelize[_0x1904('0x2')]},'url':{'type':Sequelize[_0x1904('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x1904('0x2')]},'twitter':{'type':Sequelize[_0x1904('0x2')]},'skype':{'type':Sequelize[_0x1904('0x2')]},'teams':{'type':Sequelize[_0x1904('0x2')]},'viber':{'type':Sequelize[_0x1904('0x2')]},'line':{'type':Sequelize[_0x1904('0x2')]},'wechat':{'type':Sequelize[_0x1904('0x2')]},'telegram':{'type':Sequelize[_0x1904('0x2')]},'UserId':{'type':Sequelize[_0x1904('0x4')]},'priority':{'type':Sequelize[_0x1904('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1904('0x5')],'defaultValue':Sequelize[_0x1904('0x6')]}}; \ No newline at end of file +var _0x424f=['DATE','NOW','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4bf732,_0x48c40a){var _0x14edc4=function(_0x464978){while(--_0x464978){_0x4bf732['push'](_0x4bf732['shift']());}};_0x14edc4(++_0x48c40a);}(_0x424f,0xf0));var _0xf424=function(_0x563bc9,_0x32b909){_0x563bc9=_0x563bc9-0x0;var _0x19f6ed=_0x424f[_0x563bc9];return _0x19f6ed;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0xf424('0x0')]={'firstName':{'type':Sequelize[_0xf424('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf424('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xf424('0x1')]},'description':{'type':Sequelize[_0xf424('0x2')]},'phone':{'type':Sequelize[_0xf424('0x1')]},'mobile':{'type':Sequelize[_0xf424('0x1')]},'fax':{'type':Sequelize[_0xf424('0x1')]},'email':{'type':Sequelize[_0xf424('0x1')]},'url':{'type':Sequelize[_0xf424('0x1')]},'facebook':{'type':Sequelize[_0xf424('0x1')]},'fb_data':{'type':Sequelize[_0xf424('0x1')]},'twitter':{'type':Sequelize[_0xf424('0x1')]},'skype':{'type':Sequelize[_0xf424('0x1')]},'teams':{'type':Sequelize[_0xf424('0x1')]},'viber':{'type':Sequelize[_0xf424('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xf424('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf424('0x3')]},'priority':{'type':Sequelize[_0xf424('0x3')](0x2)[_0xf424('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf424('0x5')],'defaultValue':Sequelize[_0xf424('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e7b83d3..f37a198 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 _0x7bc4=['MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','findOrCreate','error','show','$and','omit','format','startsWith','cf_%d','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','pick','setTags','ids','getHoppers','findOne','options','ContactId','includeAll','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','meta','User','agent','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','pid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','CmContact','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','select','field','color','from','tools_tags','c.deletedAt\x20IS\x20NULL','expr','parse','advancedFilter','forEach','condition','value','length','and','\x20IN\x20?','tableAlias','\x20=\x20?','\x20LIKE\x20?','\x20<\x20?','map','filter','isNil','ListId','where','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','order','DESC','c.id','QueryTypes','clone','isArray','tag','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','push','rows','catch','destroy','find','params','describe','cf_','columnName','CmCustomField','findAll','displayName','alias','custom','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage'];(function(_0x4fc64e,_0x201d7e){var _0xb8c120=function(_0x11edf6){while(--_0x11edf6){_0x4fc64e['push'](_0x4fc64e['shift']());}};_0xb8c120(++_0x201d7e);}(_0x7bc4,0x126));var _0x47bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7bc4[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x47bc('0x0'));var emlformat=require(_0x47bc('0x1'));var rimraf=require(_0x47bc('0x2'));var zipdir=require(_0x47bc('0x3'));var jsonpatch=require(_0x47bc('0x4'));var rp=require(_0x47bc('0x5'));var moment=require(_0x47bc('0x6'));var BPromise=require(_0x47bc('0x7'));var Mustache=require(_0x47bc('0x8'));var util=require(_0x47bc('0x9'));var path=require('path');var sox=require(_0x47bc('0xa'));var csv=require(_0x47bc('0xb'));var ejs=require(_0x47bc('0xc'));var fs=require('fs');var _=require(_0x47bc('0xd'));var squel=require('squel');var crypto=require(_0x47bc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x47bc('0xf'));var toCsv=require(_0x47bc('0xb'));var querystring=require(_0x47bc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x47bc('0x11'));var qs=require(_0x47bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47bc('0x13'));var utils=require(_0x47bc('0x14'));var config=require(_0x47bc('0x15'));var db=require('../../mysqldb')['db'];config[_0x47bc('0x16')]=_[_0x47bc('0x17')](config[_0x47bc('0x16')],{'host':_0x47bc('0x18'),'port':0x18eb});var socket=require(_0x47bc('0x19'))(new Redis(config[_0x47bc('0x16')]));require(_0x47bc('0x1a'))[_0x47bc('0x1b')](socket);function respondWithStatusCode(_0x2ce357,_0x289aa1){_0x289aa1=_0x289aa1||0xcc;return function(_0x56b4a2){if(_0x56b4a2){return _0x2ce357[_0x47bc('0x1c')](_0x289aa1);}return _0x2ce357[_0x47bc('0x1d')](_0x289aa1)[_0x47bc('0x1e')]();};}function respondWithResult(_0x555c14,_0x58563d){_0x58563d=_0x58563d||0xc8;return function(_0x54ddac){if(_0x54ddac){return _0x555c14['status'](_0x58563d)['json'](_0x54ddac);}};}function respondWithFilteredResult(_0x309785,_0x511f28){return function(_0x403388){if(_0x403388){var _0x545cd0=_0x403388[_0x47bc('0x1f')],_0xf731aa=_0x511f28[_0x47bc('0x20')],_0x1be404=_0x511f28[_0x47bc('0x20')]+_0x511f28[_0x47bc('0x21')],_0x4c9dad;if(_0x1be404>=_0x545cd0){_0x1be404=_0x545cd0;_0x4c9dad=0xc8;}else{_0x4c9dad=0xce;}_0x309785[_0x47bc('0x1d')](_0x4c9dad);return _0x309785[_0x47bc('0x22')](_0x47bc('0x23'),_0xf731aa+'-'+_0x1be404+'/'+_0x545cd0)[_0x47bc('0x24')](_0x403388);}return null;};}function patchUpdates(_0x6b5f51){return function(_0x51e841){try{jsonpatch[_0x47bc('0x25')](_0x51e841,_0x6b5f51,!![]);}catch(_0x323cc0){return BPromise[_0x47bc('0x26')](_0x323cc0);}return _0x51e841[_0x47bc('0x27')]();};}function saveUpdates(_0x15b21e,_0x24c6e6){return function(_0x3e0bcc){if(_0x3e0bcc){return _0x3e0bcc[_0x47bc('0x28')](_0x15b21e)[_0x47bc('0x29')](function(_0x225a66){return _0x225a66;});}return null;};}function removeEntity(_0xca0edd,_0x2ca0a7){return function(_0x778060){if(_0x778060){return _0x778060['destroy']()['then'](function(){_0xca0edd['status'](0xcc)[_0x47bc('0x1e')]();});}};}function handleEntityNotFound(_0x2f1956,_0x2acb87){return function(_0x313bdf){if(!_0x313bdf){_0x2f1956[_0x47bc('0x1c')](0x194);}return _0x313bdf;};}function handleError(_0x1bd4d2,_0x2fec8f){_0x2fec8f=_0x2fec8f||0x1f4;return function(_0xeeb335){logger['error'](_0xeeb335[_0x47bc('0x2a')]);if(_0xeeb335['name']){delete _0xeeb335[_0x47bc('0x2b')];}_0x1bd4d2[_0x47bc('0x1d')](_0x2fec8f)[_0x47bc('0x2c')](_0xeeb335);};}exports[_0x47bc('0x2d')]=function(_0x98c515,_0x1f25f7){var _0x18596c={},_0x25b7f2={},_0x446652={'count':0x0,'rows':[]};return db[_0x47bc('0x2e')]['describe']()[_0x47bc('0x29')](function(_0x114884){_0x25b7f2[_0x47bc('0x2f')]=_['keys'](_0x114884);_0x25b7f2[_0x47bc('0x30')]=_[_0x47bc('0x31')](_0x98c515['query']);_0x25b7f2[_0x47bc('0x32')]=_[_0x47bc('0x33')](_0x25b7f2[_0x47bc('0x2f')],_0x25b7f2[_0x47bc('0x30')]);_0x18596c[_0x47bc('0x34')]=_[_0x47bc('0x33')](_0x25b7f2['model'],qs[_0x47bc('0x35')](_0x98c515['query'][_0x47bc('0x35')]));_0x18596c[_0x47bc('0x34')]=_0x18596c[_0x47bc('0x34')]['length']?_0x18596c[_0x47bc('0x34')]:_0x25b7f2[_0x47bc('0x2f')];if(!_0x98c515[_0x47bc('0x30')][_0x47bc('0x36')](_0x47bc('0x37'))){_0x18596c['limit']=qs['limit'](_0x98c515['query'][_0x47bc('0x21')]);_0x18596c[_0x47bc('0x20')]=qs[_0x47bc('0x20')](_0x98c515[_0x47bc('0x30')][_0x47bc('0x20')]);}_0x18596c['order']=qs[_0x47bc('0x38')](_0x98c515[_0x47bc('0x30')]['sort']);_0x18596c['where']=qs[_0x47bc('0x32')](_['pick'](_0x98c515[_0x47bc('0x30')],_0x25b7f2[_0x47bc('0x32')]));var _0x2a9d88=[];var _0x1354b1=squel[_0x47bc('0x39')]()[_0x47bc('0x3a')]('id')['field'](_0x47bc('0x2b'))['field'](_0x47bc('0x3b'))[_0x47bc('0x3c')](_0x47bc('0x3d'));var _0x4d4148=squel[_0x47bc('0x39')]()[_0x47bc('0x3c')]('cm_contacts','c')['where'](_0x47bc('0x3e'));var _0x6e6530=squel[_0x47bc('0x3f')]();if(_0x98c515[_0x47bc('0x30')]['advancedFilter']){var _0x49003=JSON[_0x47bc('0x40')](_0x98c515[_0x47bc('0x30')][_0x47bc('0x41')]);_['keys'](_0x49003)[_0x47bc('0x42')](function(_0x335bef){var _0x211a89=_0x49003[_0x335bef];switch(_0x211a89[_0x47bc('0x43')]){case'IS':if(_['isArray'](_0x211a89[_0x47bc('0x44')])&&_0x211a89['value'][_0x47bc('0x45')]>0x1){_0x6e6530[_0x47bc('0x46')](_0x211a89['tableAlias']+'.'+_0x335bef+_0x47bc('0x47'),_0x211a89['value']);}else{_0x6e6530['and'](_0x211a89[_0x47bc('0x48')]+'.'+_0x335bef+'\x20=\x20?',_0x211a89[_0x47bc('0x44')][0x0]);}break;case'=':_0x6e6530[_0x47bc('0x46')](_0x211a89[_0x47bc('0x48')]+'.'+_0x335bef+_0x47bc('0x49'),_0x211a89['value']);break;case'LIKE':_0x6e6530['and'](_0x211a89[_0x47bc('0x48')]+'.'+_0x335bef+_0x47bc('0x4a'),'%'+_0x211a89[_0x47bc('0x44')]+'%');break;case'>':_0x6e6530[_0x47bc('0x46')](_0x211a89[_0x47bc('0x48')]+'.'+_0x335bef+'\x20>\x20?',_0x211a89[_0x47bc('0x44')]);break;case'<':_0x6e6530[_0x47bc('0x46')](_0x211a89[_0x47bc('0x48')]+'.'+_0x335bef+_0x47bc('0x4b'),_0x211a89[_0x47bc('0x44')]);break;}});}else{var _0x52a8d3=_(Object['keys'](_0x98c515[_0x47bc('0x30')]))[_0x47bc('0x4c')](function(_0x1f18d2){return _0x114884[_0x47bc('0x36')](_0x1f18d2)?_0x1f18d2:undefined;})[_0x47bc('0x4d')](function(_0xe7cac1){return!_[_0x47bc('0x4e')](_0xe7cac1);})['value']();if(!_['isEmpty'](_0x52a8d3)){_0x52a8d3['forEach'](function(_0x3a584c){if(_0x3a584c===_0x47bc('0x4f')){_0x4d4148[_0x47bc('0x50')](_0x47bc('0x51'),[][_0x47bc('0x52')](_0x98c515[_0x47bc('0x30')][_0x3a584c]));}else{_0x4d4148[_0x47bc('0x50')]('c.'+_0x3a584c+'\x20=\x20?',_0x98c515[_0x47bc('0x30')][_0x3a584c]);}});}if(_0x98c515[_0x47bc('0x30')]['filter']){var _0x5ce171=_0x98c515['query'][_0x47bc('0x4d')][_0x47bc('0x53')]('\x5c','\x5c\x5c')[_0x47bc('0x53')]('\x27\x27',_0x47bc('0x54'));if(qs[_0x47bc('0x55')](_0x5ce171)){_0x6e6530['or'](_0x47bc('0x56'),_0x5ce171+'%');_0x6e6530['or']('c.phone\x20LIKE\x20?',_0x5ce171+'%');_0x6e6530['or'](_0x47bc('0x57'),_0x5ce171+'%');_0x6e6530['or'](_0x47bc('0x58'),_0x5ce171+'%');}else if(qs['isEmail'](_0x5ce171)){_0x6e6530['or'](_0x47bc('0x59'),_0x5ce171+'%');}else{_0x6e6530['or'](_0x47bc('0x59'),_0x5ce171+'%');_0x6e6530['or'](_0x47bc('0x5a'),_0x5ce171+'%');_0x6e6530['or'](_0x47bc('0x5b'),_0x5ce171+'%');}}}_0x4d4148[_0x47bc('0x50')](_0x6e6530);if(_0x18596c[_0x47bc('0x5c')]){_0x18596c[_0x47bc('0x5c')]['forEach'](function(_0x28dc9c){_0x4d4148[_0x47bc('0x5c')]('c.'+_0x28dc9c[0x0],_0x28dc9c[0x1]===_0x47bc('0x5d')?![]:!![]);});}_0x4d4148['group'](_0x47bc('0x5e'));var _0x4f2f55={'type':db['Sequelize'][_0x47bc('0x5f')]['SELECT'],'raw':!![]};var _0x5805fa=_0x4d4148[_0x47bc('0x60')]()['field']('COUNT(*)');if(!_0x98c515['query'][_0x47bc('0x41')]){if(_0x98c515[_0x47bc('0x30')]['tag']){var _0x3c336b=_[_0x47bc('0x61')](_0x98c515[_0x47bc('0x30')][_0x47bc('0x62')])?_0x98c515[_0x47bc('0x30')]['tag']:new Array(_0x98c515['query'][_0x47bc('0x62')]);var _0x34e882=squel[_0x47bc('0x3f')]();_0x3c336b[_0x47bc('0x42')](function(_0x183f87){_0x34e882['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x183f87+',%');});_0x4d4148['having'](_0x34e882);_0x5805fa[_0x47bc('0x63')](_0x47bc('0x64'),'ct',_0x47bc('0x65'));_0x5805fa[_0x47bc('0x63')](_0x47bc('0x3d'),'t',_0x47bc('0x66'));_0x5805fa['where'](_0x47bc('0x67'),_0x3c336b);}}db[_0x47bc('0x68')][_0x47bc('0x30')](_0x1354b1[_0x47bc('0x69')](),_0x4f2f55)[_0x47bc('0x29')](function(_0xd80ba4){_0x2a9d88=_[_0x47bc('0x6a')](_0xd80ba4,'id');return db[_0x47bc('0x68')][_0x47bc('0x30')](_0x5805fa[_0x47bc('0x69')](),_0x4f2f55);})[_0x47bc('0x29')](function(_0x6b272c){_0x446652[_0x47bc('0x1f')]=_0x6b272c[_0x47bc('0x45')];_0x4f2f55=_[_0x47bc('0x6b')](_0x4f2f55,{'model':db[_0x47bc('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4d4148['field']('c.*');_0x4d4148[_0x47bc('0x3a')](_0x47bc('0x6c'),_0x47bc('0x6d'));_0x4d4148[_0x47bc('0x63')](_0x47bc('0x64'),'ct',_0x47bc('0x65'));_0x4d4148[_0x47bc('0x63')]('tools_tags','t',_0x47bc('0x66'));if(_0x18596c['limit']){_0x4d4148['limit'](_0x18596c['limit']);}if(_0x18596c['offset']){_0x4d4148['offset'](_0x18596c[_0x47bc('0x20')]);}db[_0x47bc('0x68')]['query'](_0x4d4148[_0x47bc('0x69')](),_0x4f2f55)['then'](function(_0x42dca5){_0x42dca5[_0x47bc('0x42')](function(_0x4e318a){if(_0x4e318a['TagIds']){_0x4e318a[_0x47bc('0x6e')]=[];_0x4e318a['TagIds']['split'](',')['forEach'](function(_0x140c5a){_0x4e318a[_0x47bc('0x6e')][_0x47bc('0x6f')](_0x2a9d88[_0x140c5a]);});}delete _0x4e318a[_0x47bc('0x6d')];});_0x446652[_0x47bc('0x70')]=_0x42dca5;return _0x446652;})[_0x47bc('0x29')](respondWithFilteredResult(_0x1f25f7,_0x18596c))[_0x47bc('0x71')](handleError(_0x1f25f7,null));});});};exports[_0x47bc('0x72')]=function(_0x50f972,_0x348938){return db['CmContact'][_0x47bc('0x73')]({'where':{'id':_0x50f972[_0x47bc('0x74')]['id']}})[_0x47bc('0x29')](handleEntityNotFound(_0x348938,null))[_0x47bc('0x29')](removeEntity(_0x348938,null))['catch'](handleError(_0x348938,null));};exports[_0x47bc('0x75')]=function(_0x15b794,_0x31b9ff){return db[_0x47bc('0x2e')][_0x47bc('0x75')]()['then'](function(_0x499c04){for(var _0x150d49=0x0;_0x150d49=_0x19b1b7){_0x48e929=_0x19b1b7;_0x2761b6=0xc8;}else{_0x2761b6=0xce;}_0xc21446['status'](_0x2761b6);return _0xc21446[_0x514c('0x24')]('Content-Range',_0x597635+'-'+_0x48e929+'/'+_0x19b1b7)['json'](_0x52bff3);}return null;};}function patchUpdates(_0x2f36bb){return function(_0x1f9518){try{jsonpatch[_0x514c('0x25')](_0x1f9518,_0x2f36bb,!![]);}catch(_0x381973){return BPromise[_0x514c('0x26')](_0x381973);}return _0x1f9518['save']();};}function saveUpdates(_0x321f22,_0x3efd7e){return function(_0x1d4d0d){if(_0x1d4d0d){return _0x1d4d0d[_0x514c('0x27')](_0x321f22)[_0x514c('0x28')](function(_0x5f2648){return _0x5f2648;});}return null;};}function removeEntity(_0x2c2843,_0x3bb714){return function(_0x229150){if(_0x229150){return _0x229150[_0x514c('0x29')]()[_0x514c('0x28')](function(){_0x2c2843[_0x514c('0x1e')](0xcc)[_0x514c('0x1f')]();});}};}function handleEntityNotFound(_0x33b941,_0x4eeab7){return function(_0x504b51){if(!_0x504b51){_0x33b941[_0x514c('0x2a')](0x194);}return _0x504b51;};}function handleError(_0x4a797b,_0x4181fd){_0x4181fd=_0x4181fd||0x1f4;return function(_0x52279a){logger[_0x514c('0x2b')](_0x52279a[_0x514c('0x2c')]);if(_0x52279a['name']){delete _0x52279a[_0x514c('0x2d')];}_0x4a797b['status'](_0x4181fd)['send'](_0x52279a);};}exports[_0x514c('0x2e')]=function(_0x2c2a41,_0x59c397){var _0x2f3088={},_0x3cceb9={},_0x2b1d2a={'count':0x0,'rows':[]};return db[_0x514c('0x2f')][_0x514c('0x30')]()[_0x514c('0x28')](function(_0x20e76a){_0x3cceb9[_0x514c('0x31')]=_['keys'](_0x20e76a);_0x3cceb9[_0x514c('0x32')]=_[_0x514c('0x33')](_0x2c2a41['query']);_0x3cceb9[_0x514c('0x34')]=_[_0x514c('0x35')](_0x3cceb9[_0x514c('0x31')],_0x3cceb9[_0x514c('0x32')]);_0x2f3088[_0x514c('0x36')]=_[_0x514c('0x35')](_0x3cceb9[_0x514c('0x31')],qs[_0x514c('0x37')](_0x2c2a41[_0x514c('0x32')][_0x514c('0x37')]));_0x2f3088[_0x514c('0x36')]=_0x2f3088['attributes']['length']?_0x2f3088[_0x514c('0x36')]:_0x3cceb9['model'];if(!_0x2c2a41[_0x514c('0x32')][_0x514c('0x38')](_0x514c('0x39'))){_0x2f3088[_0x514c('0x23')]=qs[_0x514c('0x23')](_0x2c2a41[_0x514c('0x32')]['limit']);_0x2f3088[_0x514c('0x22')]=qs[_0x514c('0x22')](_0x2c2a41[_0x514c('0x32')][_0x514c('0x22')]);}_0x2f3088[_0x514c('0x3a')]=qs[_0x514c('0x3b')](_0x2c2a41[_0x514c('0x32')]['sort']);_0x2f3088[_0x514c('0x3c')]=qs[_0x514c('0x34')](_[_0x514c('0x3d')](_0x2c2a41[_0x514c('0x32')],_0x3cceb9[_0x514c('0x34')]));var _0x3a01e1=[];var _0x694375=squel[_0x514c('0x3e')]()['field']('id')[_0x514c('0x3f')](_0x514c('0x2d'))['field'](_0x514c('0x40'))[_0x514c('0x41')](_0x514c('0x42'));var _0x37d30f=squel[_0x514c('0x3e')]()[_0x514c('0x41')](_0x514c('0x43'),'c')[_0x514c('0x3c')](_0x514c('0x44'));var _0x454a55=squel['expr']();if(_0x2c2a41[_0x514c('0x32')]['advancedFilter']){var _0x31bd5a=JSON[_0x514c('0x45')](_0x2c2a41['query'][_0x514c('0x46')]);_[_0x514c('0x33')](_0x31bd5a)[_0x514c('0x47')](function(_0x2253da){var _0x39e6ea=_0x31bd5a[_0x2253da];switch(_0x39e6ea[_0x514c('0x48')]){case'IS':if(_[_0x514c('0x49')](_0x39e6ea[_0x514c('0x4a')])&&_0x39e6ea[_0x514c('0x4a')][_0x514c('0x4b')]>0x1){_0x454a55[_0x514c('0x4c')](_0x39e6ea['tableAlias']+'.'+_0x2253da+_0x514c('0x4d'),_0x39e6ea['value']);}else{_0x454a55[_0x514c('0x4c')](_0x39e6ea['tableAlias']+'.'+_0x2253da+_0x514c('0x4e'),_0x39e6ea['value'][0x0]);}break;case'=':_0x454a55[_0x514c('0x4c')](_0x39e6ea[_0x514c('0x4f')]+'.'+_0x2253da+_0x514c('0x4e'),_0x39e6ea['value']);break;case _0x514c('0x50'):_0x454a55[_0x514c('0x4c')](_0x39e6ea[_0x514c('0x4f')]+'.'+_0x2253da+_0x514c('0x51'),'%'+_0x39e6ea[_0x514c('0x4a')]+'%');break;case'>':_0x454a55[_0x514c('0x4c')](_0x39e6ea['tableAlias']+'.'+_0x2253da+'\x20>\x20?',_0x39e6ea[_0x514c('0x4a')]);break;case'<':_0x454a55['and'](_0x39e6ea[_0x514c('0x4f')]+'.'+_0x2253da+_0x514c('0x52'),_0x39e6ea[_0x514c('0x4a')]);break;}});}else{var _0x17d901=_(Object['keys'](_0x2c2a41[_0x514c('0x32')]))[_0x514c('0x53')](function(_0x54f4ef){return _0x20e76a['hasOwnProperty'](_0x54f4ef)?_0x54f4ef:undefined;})[_0x514c('0x54')](function(_0x2a5a1b){return!_['isNil'](_0x2a5a1b);})['value']();if(!_['isEmpty'](_0x17d901)){_0x17d901[_0x514c('0x47')](function(_0x259a0d){if(_0x259a0d===_0x514c('0x55')){_0x37d30f['where'](_0x514c('0x56'),[]['concat'](_0x2c2a41['query'][_0x259a0d]));}else{_0x37d30f[_0x514c('0x3c')]('c.'+_0x259a0d+_0x514c('0x4e'),_0x2c2a41['query'][_0x259a0d]);}});}if(_0x2c2a41['query']['filter']){var _0x37fc9c=_0x2c2a41[_0x514c('0x32')]['filter'][_0x514c('0x57')]('\x5c','\x5c\x5c')[_0x514c('0x57')]('\x27\x27',_0x514c('0x58'));if(qs[_0x514c('0x59')](_0x37fc9c)){_0x454a55['or'](_0x514c('0x5a'),_0x37fc9c+'%');_0x454a55['or'](_0x514c('0x5b'),_0x37fc9c+'%');_0x454a55['or'](_0x514c('0x5c'),_0x37fc9c+'%');_0x454a55['or'](_0x514c('0x5d'),_0x37fc9c+'%');}else if(qs['isEmail'](_0x37fc9c)){_0x454a55['or'](_0x514c('0x5e'),_0x37fc9c+'%');}else{_0x454a55['or'](_0x514c('0x5e'),_0x37fc9c+'%');_0x454a55['or'](_0x514c('0x5f'),_0x37fc9c+'%');_0x454a55['or'](_0x514c('0x60'),_0x37fc9c+'%');}}}_0x37d30f['where'](_0x454a55);if(_0x2f3088[_0x514c('0x3a')]){_0x2f3088[_0x514c('0x3a')][_0x514c('0x47')](function(_0xe56fdd){_0x37d30f['order']('c.'+_0xe56fdd[0x0],_0xe56fdd[0x1]===_0x514c('0x61')?![]:!![]);});}_0x37d30f[_0x514c('0x62')]('c.id');var _0x1be728={'type':db[_0x514c('0x63')][_0x514c('0x64')][_0x514c('0x65')],'raw':!![]};var _0x53089d=_0x37d30f[_0x514c('0x66')]()[_0x514c('0x3f')](_0x514c('0x67'));if(!_0x2c2a41['query'][_0x514c('0x46')]){if(_0x2c2a41[_0x514c('0x32')][_0x514c('0x68')]){var _0x31e6f0=_[_0x514c('0x49')](_0x2c2a41[_0x514c('0x32')][_0x514c('0x68')])?_0x2c2a41[_0x514c('0x32')][_0x514c('0x68')]:new Array(_0x2c2a41[_0x514c('0x32')][_0x514c('0x68')]);var _0x5543f9=squel[_0x514c('0x69')]();_0x31e6f0[_0x514c('0x47')](function(_0x282e59){_0x5543f9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x282e59+',%');});_0x37d30f[_0x514c('0x6a')](_0x5543f9);_0x53089d[_0x514c('0x6b')](_0x514c('0x6c'),'ct',_0x514c('0x6d'));_0x53089d[_0x514c('0x6b')](_0x514c('0x42'),'t',_0x514c('0x6e'));_0x53089d[_0x514c('0x3c')](_0x514c('0x6f'),_0x31e6f0);}}db[_0x514c('0x70')][_0x514c('0x32')](_0x694375[_0x514c('0x71')](),_0x1be728)[_0x514c('0x28')](function(_0x2d392e){_0x3a01e1=_[_0x514c('0x72')](_0x2d392e,'id');return db['sequelize'][_0x514c('0x32')](_0x53089d[_0x514c('0x71')](),_0x1be728);})[_0x514c('0x28')](function(_0x1d801d){_0x2b1d2a[_0x514c('0x21')]=_0x1d801d[_0x514c('0x4b')];_0x1be728=_['merge'](_0x1be728,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x37d30f[_0x514c('0x3f')](_0x514c('0x73'));_0x37d30f['field'](_0x514c('0x74'),'TagIds');_0x37d30f[_0x514c('0x6b')](_0x514c('0x6c'),'ct',_0x514c('0x6d'));_0x37d30f['left_join']('tools_tags','t',_0x514c('0x6e'));if(_0x2f3088[_0x514c('0x23')]){_0x37d30f[_0x514c('0x23')](_0x2f3088['limit']);}if(_0x2f3088[_0x514c('0x22')]){_0x37d30f[_0x514c('0x22')](_0x2f3088['offset']);}db[_0x514c('0x70')]['query'](_0x37d30f[_0x514c('0x71')](),_0x1be728)[_0x514c('0x28')](function(_0x1118c3){_0x1118c3[_0x514c('0x47')](function(_0x218cf0){if(_0x218cf0[_0x514c('0x75')]){_0x218cf0['Tags']=[];_0x218cf0[_0x514c('0x75')][_0x514c('0x76')](',')[_0x514c('0x47')](function(_0x49d2d6){_0x218cf0[_0x514c('0x77')][_0x514c('0x78')](_0x3a01e1[_0x49d2d6]);});}delete _0x218cf0[_0x514c('0x75')];});_0x2b1d2a[_0x514c('0x79')]=_0x1118c3;return _0x2b1d2a;})[_0x514c('0x28')](respondWithFilteredResult(_0x59c397,_0x2f3088))[_0x514c('0x7a')](handleError(_0x59c397,null));});});};exports[_0x514c('0x29')]=function(_0x3cd406,_0x12639f){return db[_0x514c('0x2f')][_0x514c('0x7b')]({'where':{'id':_0x3cd406['params']['id']}})['then'](handleEntityNotFound(_0x12639f,null))[_0x514c('0x28')](removeEntity(_0x12639f,null))[_0x514c('0x7a')](handleError(_0x12639f,null));};exports[_0x514c('0x30')]=function(_0x41a718,_0xdd50f6){return db['CmContact'][_0x514c('0x30')]()[_0x514c('0x28')](function(_0x3bd8e4){for(var _0x44ae69=0x0;_0x44ae69{}\s\\|]/g,'-');_0x484640(null,util[_0xd0e3('0x1f')](_0xd0e3('0x20'),path[_0xd0e3('0x21')](_0x487644[_0xd0e3('0x1d')],path[_0xd0e3('0x22')](_0x487644[_0xd0e3('0x1d')])),Date['now'](),path['extname'](_0x487644[_0xd0e3('0x1d')])));}})});router[_0xd0e3('0x15')]('/csv',upload['single'](_0xd0e3('0x23')),controller[_0xd0e3('0x24')]);var upload=multer({'storage':multer[_0xd0e3('0x25')]({'destination':function(_0x1f671a,_0x325816,_0x3abae3){_0x3abae3(null,path['join'](config[_0xd0e3('0x26')],_0xd0e3('0x1c')));},'filename':function(_0x3f11a8,_0xecc6ee,_0x1945c9){_0xecc6ee[_0xd0e3('0x1d')]=_0xecc6ee['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1945c9(null,util[_0xd0e3('0x1f')](_0xd0e3('0x20'),path['basename'](_0xecc6ee[_0xd0e3('0x1d')],path[_0xd0e3('0x22')](_0xecc6ee[_0xd0e3('0x1d')])),Date[_0xd0e3('0x27')](),path[_0xd0e3('0x22')](_0xecc6ee[_0xd0e3('0x1d')])));}})});router[_0xd0e3('0x15')]('/upload',upload[_0xd0e3('0x28')](_0xd0e3('0x23')),controller['upload']);router[_0xd0e3('0x15')](_0xd0e3('0x29'),auth[_0xd0e3('0x7')](),controller['import']);router[_0xd0e3('0x2a')](_0xd0e3('0xa'),auth[_0xd0e3('0x7')](),controller[_0xd0e3('0x2b')]);router[_0xd0e3('0x2c')](_0xd0e3('0xa'),auth[_0xd0e3('0x7')](),controller[_0xd0e3('0x2d')]);module[_0xd0e3('0x2e')]=router; \ No newline at end of file +var _0xafae=['put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJscriptySessions','post','/merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','now','/csv','single','file','basename','/upload','upload','/upload/:id','import'];(function(_0x1b5507,_0x3de4a3){var _0x4e0abb=function(_0x371f17){while(--_0x371f17){_0x1b5507['push'](_0x1b5507['shift']());}};_0x4e0abb(++_0x3de4a3);}(_0xafae,0x98));var _0xeafa=function(_0x98020e,_0x109498){_0x98020e=_0x98020e-0x0;var _0x355f5e=_0xafae[_0x98020e];return _0x355f5e;};'use strict';var multer=require(_0xeafa('0x0'));var util=require(_0xeafa('0x1'));var path=require(_0xeafa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeafa('0x3')]();var auth=require(_0xeafa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeafa('0x5'));router[_0xeafa('0x6')]('/',auth[_0xeafa('0x7')](),controller[_0xeafa('0x8')]);router['get'](_0xeafa('0x9'),auth['isAuthenticated'](),controller[_0xeafa('0xa')]);router[_0xeafa('0x6')](_0xeafa('0xb'),auth['isAuthenticated'](),controller[_0xeafa('0xc')]);router['get'](_0xeafa('0xd'),auth[_0xeafa('0x7')](),controller[_0xeafa('0xe')]);router[_0xeafa('0x6')](_0xeafa('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xeafa('0x6')](_0xeafa('0x10'),auth[_0xeafa('0x7')](),controller[_0xeafa('0x11')]);router[_0xeafa('0x6')](_0xeafa('0x12'),auth[_0xeafa('0x7')](),controller['getHopperFinals']);router[_0xeafa('0x6')]('/:id/jscripty_sessions',auth['isAuthenticated'](),controller[_0xeafa('0x13')]);router[_0xeafa('0x14')](_0xeafa('0x15'),auth[_0xeafa('0x7')](),controller['merge']);router[_0xeafa('0x14')]('/',auth[_0xeafa('0x7')](),controller[_0xeafa('0x16')]);router[_0xeafa('0x14')](_0xeafa('0x17'),auth[_0xeafa('0x7')](),controller[_0xeafa('0x18')]);router[_0xeafa('0x14')](_0xeafa('0xd'),auth[_0xeafa('0x7')](),controller[_0xeafa('0x19')]);var upload=multer({'storage':multer[_0xeafa('0x1a')]({'destination':function(_0xffe7ec,_0x13c166,_0x3ba8e1){_0x3ba8e1(null,path[_0xeafa('0x1b')](config[_0xeafa('0x1c')],_0xeafa('0x1d')));},'filename':function(_0x1ad2b9,_0x2002b5,_0x421759){_0x2002b5[_0xeafa('0x1e')]=_0x2002b5['originalname'][_0xeafa('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x421759(null,util[_0xeafa('0x20')](_0xeafa('0x21'),path['basename'](_0x2002b5['originalname'],path[_0xeafa('0x22')](_0x2002b5['originalname'])),Date[_0xeafa('0x23')](),path['extname'](_0x2002b5['originalname'])));}})});router[_0xeafa('0x14')](_0xeafa('0x24'),upload[_0xeafa('0x25')](_0xeafa('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xeafa('0x1a')]({'destination':function(_0x5d208c,_0x12c1d1,_0x66306e){_0x66306e(null,path[_0xeafa('0x1b')](config[_0xeafa('0x1c')],_0xeafa('0x1d')));},'filename':function(_0x1525c3,_0x252efb,_0x1d75e8){_0x252efb[_0xeafa('0x1e')]=_0x252efb[_0xeafa('0x1e')][_0xeafa('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d75e8(null,util[_0xeafa('0x20')](_0xeafa('0x21'),path[_0xeafa('0x27')](_0x252efb['originalname'],path[_0xeafa('0x22')](_0x252efb[_0xeafa('0x1e')])),Date[_0xeafa('0x23')](),path[_0xeafa('0x22')](_0x252efb[_0xeafa('0x1e')])));}})});router[_0xeafa('0x14')](_0xeafa('0x28'),upload[_0xeafa('0x25')](_0xeafa('0x26')),controller[_0xeafa('0x29')]);router[_0xeafa('0x14')](_0xeafa('0x2a'),auth[_0xeafa('0x7')](),controller[_0xeafa('0x2b')]);router[_0xeafa('0x2c')]('/:id',auth[_0xeafa('0x7')](),controller[_0xeafa('0x2d')]);router[_0xeafa('0x2e')]('/:id',auth[_0xeafa('0x7')](),controller[_0xeafa('0x2f')]);module[_0xeafa('0x30')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c5bd663..3e4bf89 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 _0x6fcb=['select','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type'];(function(_0x31fe17,_0x8021ae){var _0xda7364=function(_0x52d439){while(--_0x52d439){_0x31fe17['push'](_0x31fe17['shift']());}};_0xda7364(++_0x8021ae);}(_0x6fcb,0x148));var _0xb6fc=function(_0x14cced,_0x50dd2f){_0x14cced=_0x14cced-0x0;var _0x5e1ce6=_0x6fcb[_0x14cced];return _0x5e1ce6;};'use strict';var Sequelize=require(_0xb6fc('0x0'));var _=require(_0xb6fc('0x1'));module[_0xb6fc('0x2')]={'name':{'type':Sequelize[_0xb6fc('0x3')],'get':function(_0x46920d){return this[_0xb6fc('0x4')](_0xb6fc('0x5'));}},'alias':{'type':Sequelize[_0xb6fc('0x6')],'allowNull':![],'set':function(_0x15d841){this[_0xb6fc('0x7')](_0xb6fc('0x5'),_0x15d841?_0x15d841:this[_0xb6fc('0x4')](_0xb6fc('0x8')));}},'type':{'type':Sequelize[_0xb6fc('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xb6fc('0x9')](_0xb6fc('0xa')),'get':function(){if(this[_0xb6fc('0x4')](_0xb6fc('0xb'))===_0xb6fc('0xc')){return JSON['parse'](this[_0xb6fc('0x4')]('values'));}else{return this['getDataValue'](_0xb6fc('0xd'));}},'set':function(_0x29c497){if(Array[_0xb6fc('0xe')](_0x29c497)){this[_0xb6fc('0x7')](_0xb6fc('0xd'),JSON[_0xb6fc('0xf')](_0x29c497));}else{this[_0xb6fc('0x7')](_0xb6fc('0xd'),_0x29c497);}}},'required':{'type':Sequelize[_0xb6fc('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x2f67=['setDataValue','name','TEXT','long','select','parse','values','isArray','stringify','BOOLEAN','sequelize','getDataValue','alias','STRING'];(function(_0x62507b,_0x49420b){var _0x3c5574=function(_0x43780f){while(--_0x43780f){_0x62507b['push'](_0x62507b['shift']());}};_0x3c5574(++_0x49420b);}(_0x2f67,0xea));var _0x72f6=function(_0x22f3e6,_0x5af796){_0x22f3e6=_0x22f3e6-0x0;var _0x168821=_0x2f67[_0x22f3e6];return _0x168821;};'use strict';var Sequelize=require(_0x72f6('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4bed5d){return this[_0x72f6('0x1')](_0x72f6('0x2'));}},'alias':{'type':Sequelize[_0x72f6('0x3')],'allowNull':![],'set':function(_0x27bb41){this[_0x72f6('0x4')](_0x72f6('0x2'),_0x27bb41?_0x27bb41:this[_0x72f6('0x1')](_0x72f6('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x72f6('0x6')](_0x72f6('0x7')),'get':function(){if(this['getDataValue']('type')===_0x72f6('0x8')){return JSON[_0x72f6('0x9')](this[_0x72f6('0x1')](_0x72f6('0xa')));}else{return this[_0x72f6('0x1')](_0x72f6('0xa'));}},'set':function(_0x314f83){if(Array[_0x72f6('0xb')](_0x314f83)){this[_0x72f6('0x4')]('values',JSON[_0x72f6('0xc')](_0x314f83));}else{this[_0x72f6('0x4')](_0x72f6('0xa'),_0x314f83);}}},'required':{'type':Sequelize[_0x72f6('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 707c57c..02bf01e 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 _0x84bc=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','stack','name','send','CmCustomField','rawAttributes','model','differenceBy','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','key','field','filter','options','includeAll','include','findAll','rows','params','catch','create','sequelize','transaction','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','lodash','squel','crypto'];(function(_0x20b8d,_0x471e78){var _0x44b833=function(_0xcfc880){while(--_0xcfc880){_0x20b8d['push'](_0x20b8d['shift']());}};_0x44b833(++_0x471e78);}(_0x84bc,0xc7));var _0xc84b=function(_0x1f2fd2,_0x1777f5){_0x1f2fd2=_0x1f2fd2-0x0;var _0x3149b8=_0x84bc[_0x1f2fd2];return _0x3149b8;};'use strict';var pdf=require(_0xc84b('0x0'));var emlformat=require(_0xc84b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc84b('0x2'));var jsonpatch=require(_0xc84b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc84b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc84b('0x5'));var sox=require(_0xc84b('0x6'));var csv=require(_0xc84b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc84b('0x8'));var squel=require(_0xc84b('0x9'));var crypto=require(_0xc84b('0xa'));var jsforce=require(_0xc84b('0xb'));var deskjs=require(_0xc84b('0xc'));var toCsv=require(_0xc84b('0x7'));var querystring=require(_0xc84b('0xd'));var Papa=require(_0xc84b('0xe'));var Redis=require(_0xc84b('0xf'));var authService=require(_0xc84b('0x10'));var qs=require(_0xc84b('0x11'));var hardwareService=require(_0xc84b('0x12'));var logger=require('../../config/logger')(_0xc84b('0x13'));var utils=require('../../config/utils');var config=require(_0xc84b('0x14'));var db=require(_0xc84b('0x15'))['db'];function respondWithStatusCode(_0x37c05f,_0x387a17){_0x387a17=_0x387a17||0xcc;return function(_0x27e081){if(_0x27e081){return _0x37c05f[_0xc84b('0x16')](_0x387a17);}return _0x37c05f[_0xc84b('0x17')](_0x387a17)[_0xc84b('0x18')]();};}function respondWithResult(_0x2168ed,_0x536058){_0x536058=_0x536058||0xc8;return function(_0x2eec10){if(_0x2eec10){return _0x2168ed['status'](_0x536058)[_0xc84b('0x19')](_0x2eec10);}};}function respondWithFilteredResult(_0x144b67,_0x41cc86){return function(_0x5632b4){if(_0x5632b4){var _0x33f7a6=_0x5632b4[_0xc84b('0x1a')],_0x265e4b=_0x41cc86[_0xc84b('0x1b')],_0x482cf7=_0x41cc86['offset']+_0x41cc86[_0xc84b('0x1c')],_0x4a871c;if(_0x482cf7>=_0x33f7a6){_0x482cf7=_0x33f7a6;_0x4a871c=0xc8;}else{_0x4a871c=0xce;}_0x144b67['status'](_0x4a871c);return _0x144b67['set'](_0xc84b('0x1d'),_0x265e4b+'-'+_0x482cf7+'/'+_0x33f7a6)[_0xc84b('0x19')](_0x5632b4);}return null;};}function patchUpdates(_0x3d2fcc){return function(_0x5ba3f7){try{jsonpatch[_0xc84b('0x1e')](_0x5ba3f7,_0x3d2fcc,!![]);}catch(_0x478f32){return BPromise[_0xc84b('0x1f')](_0x478f32);}return _0x5ba3f7['save']();};}function saveUpdates(_0x55ff4c,_0x9b6963){return function(_0x4e6f8e){if(_0x4e6f8e){return _0x4e6f8e[_0xc84b('0x20')](_0x55ff4c)[_0xc84b('0x21')](function(_0x454b00){return _0x454b00;});}return null;};}function removeEntity(_0x4dab61,_0x10478e){return function(_0x2343c1){if(_0x2343c1){return _0x2343c1['destroy']()[_0xc84b('0x21')](function(){_0x4dab61['status'](0xcc)[_0xc84b('0x18')]();});}};}function handleEntityNotFound(_0x38d580,_0x403016){return function(_0x45236f){if(!_0x45236f){_0x38d580[_0xc84b('0x16')](0x194);}return _0x45236f;};}function handleError(_0x56d175,_0x3b7193){_0x3b7193=_0x3b7193||0x1f4;return function(_0x31e795){logger['error'](_0x31e795[_0xc84b('0x22')]);if(_0x31e795[_0xc84b('0x23')]){delete _0x31e795[_0xc84b('0x23')];}_0x56d175[_0xc84b('0x17')](_0x3b7193)[_0xc84b('0x24')](_0x31e795);};}exports['index']=function(_0x25a76f,_0x1dfa2f){var _0x3551ab={},_0x461d35={},_0x19c6bb={'count':0x0,'rows':[]};var _0x2223d8=db[_0xc84b('0x25')][_0xc84b('0x26')];_0x461d35[_0xc84b('0x27')]=_[_0xc84b('0x28')](_[_0xc84b('0x29')](_0x2223d8),['name']);_0x461d35['query']=_['keys'](_0x25a76f[_0xc84b('0x2a')]);_0x461d35['filters']=_['intersection'](_0x461d35[_0xc84b('0x27')],_0x461d35[_0xc84b('0x2a')]);_0x3551ab[_0xc84b('0x2b')]=_[_0xc84b('0x2c')](_0x461d35['model'],qs[_0xc84b('0x2d')](_0x25a76f[_0xc84b('0x2a')][_0xc84b('0x2d')]));_0x3551ab[_0xc84b('0x2b')]=_0x3551ab['attributes'][_0xc84b('0x2e')]?_0x3551ab[_0xc84b('0x2b')]:_0x461d35[_0xc84b('0x27')];if(!_0x25a76f['query'][_0xc84b('0x2f')](_0xc84b('0x30'))){_0x3551ab['limit']=qs[_0xc84b('0x1c')](_0x25a76f[_0xc84b('0x2a')][_0xc84b('0x1c')]);_0x3551ab[_0xc84b('0x1b')]=qs['offset'](_0x25a76f[_0xc84b('0x2a')]['offset']);}_0x3551ab['order']=qs[_0xc84b('0x31')](_0x25a76f['query'][_0xc84b('0x31')]);_0x3551ab['where']=qs[_0xc84b('0x32')](_[_0xc84b('0x33')](_0x25a76f[_0xc84b('0x2a')],_0x461d35[_0xc84b('0x32')]));if(_0x25a76f[_0xc84b('0x2a')]['filter']){_0x3551ab[_0xc84b('0x34')]=_[_0xc84b('0x35')](_0x3551ab[_0xc84b('0x34')],{'$or':_['map'](_0x2223d8,function(_0x10a2b2){if(_0x10a2b2['type'][_0xc84b('0x36')]!=='VIRTUAL'){var _0x122b8b={};_0x122b8b[_0x10a2b2[_0xc84b('0x37')]]={'$like':'%'+_0x25a76f[_0xc84b('0x2a')][_0xc84b('0x38')]+'%'};return _0x122b8b;}})});}_0x3551ab=_[_0xc84b('0x35')]({},_0x3551ab,_0x25a76f[_0xc84b('0x39')]);var _0x482ff6={'where':_0x3551ab[_0xc84b('0x34')]};return db[_0xc84b('0x25')][_0xc84b('0x1a')](_0x482ff6)[_0xc84b('0x21')](function(_0x5ad623){_0x19c6bb['count']=_0x5ad623;if(_0x25a76f['query'][_0xc84b('0x3a')]){_0x3551ab[_0xc84b('0x3b')]=[{'all':!![]}];}return db[_0xc84b('0x25')][_0xc84b('0x3c')](_0x3551ab);})[_0xc84b('0x21')](function(_0x32caee){_0x19c6bb[_0xc84b('0x3d')]=_0x32caee;return _0x19c6bb;})['then'](respondWithFilteredResult(_0x1dfa2f,_0x3551ab))['catch'](handleError(_0x1dfa2f,null));};exports['show']=function(_0x526553,_0x2fb395){var _0x2f697f={'raw':!![],'where':{'id':_0x526553[_0xc84b('0x3e')]['id']}},_0x2a94ee={};_0x2a94ee[_0xc84b('0x27')]=_['keys'](db['CmCustomField'][_0xc84b('0x26')]);_0x2a94ee[_0xc84b('0x2a')]=_['keys'](_0x526553[_0xc84b('0x2a')]);_0x2a94ee[_0xc84b('0x32')]=_['intersection'](_0x2a94ee['model'],_0x2a94ee[_0xc84b('0x2a')]);_0x2f697f['attributes']=_[_0xc84b('0x2c')](_0x2a94ee[_0xc84b('0x27')],qs[_0xc84b('0x2d')](_0x526553[_0xc84b('0x2a')]['fields']));_0x2f697f['attributes']=_0x2f697f['attributes'][_0xc84b('0x2e')]?_0x2f697f['attributes']:_0x2a94ee[_0xc84b('0x27')];if(_0x526553[_0xc84b('0x2a')][_0xc84b('0x3a')]){_0x2f697f[_0xc84b('0x3b')]=[{'all':!![]}];}_0x2f697f=_[_0xc84b('0x35')]({},_0x2f697f,_0x526553[_0xc84b('0x39')]);return db[_0xc84b('0x25')]['find'](_0x2f697f)[_0xc84b('0x21')](handleEntityNotFound(_0x2fb395,null))[_0xc84b('0x21')](respondWithResult(_0x2fb395,null))[_0xc84b('0x3f')](handleError(_0x2fb395,null));};exports[_0xc84b('0x40')]=function(_0x35447e,_0x335acc){return db[_0xc84b('0x41')][_0xc84b('0x42')](function(_0x48cb12){return db[_0xc84b('0x25')][_0xc84b('0x40')](_0x35447e['body'],{'transaction':_0x48cb12});})['then'](respondWithResult(_0x335acc,0xc9))[_0xc84b('0x3f')](handleError(_0x335acc,null));};exports[_0xc84b('0x20')]=function(_0x15b310,_0x7fed6f){if(_0x15b310[_0xc84b('0x43')]['id']){delete _0x15b310[_0xc84b('0x43')]['id'];}return db[_0xc84b('0x25')][_0xc84b('0x44')]({'where':{'id':_0x15b310['params']['id']}})[_0xc84b('0x21')](handleEntityNotFound(_0x7fed6f,null))[_0xc84b('0x21')](saveUpdates(_0x15b310[_0xc84b('0x43')],null))['then'](respondWithResult(_0x7fed6f,null))['catch'](handleError(_0x7fed6f,null));};exports[_0xc84b('0x45')]=function(_0x43f626,_0x43a934){return db[_0xc84b('0x25')][_0xc84b('0x44')]({'where':{'id':_0x43f626[_0xc84b('0x3e')]['id']}})[_0xc84b('0x21')](handleEntityNotFound(_0x43a934,null))[_0xc84b('0x21')](removeEntity(_0x43a934,null))[_0xc84b('0x3f')](handleError(_0x43a934,null));}; \ No newline at end of file +var _0xa9cf=['pick','filter','where','merge','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','create','sequelize','transaction','body','update','find','html-pdf','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','name','send','index','CmCustomField','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x55a802,_0x10ab3a){var _0x1a0461=function(_0x43d162){while(--_0x43d162){_0x55a802['push'](_0x55a802['shift']());}};_0x1a0461(++_0x10ab3a);}(_0xa9cf,0x187));var _0xfa9c=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0xa9cf[_0x57cbfb];return _0x4cb933;};'use strict';var pdf=require(_0xfa9c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfa9c('0x1'));var zipdir=require(_0xfa9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa9c('0x3'));var moment=require(_0xfa9c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfa9c('0x5'));var sox=require(_0xfa9c('0x6'));var csv=require(_0xfa9c('0x7'));var ejs=require(_0xfa9c('0x8'));var fs=require('fs');var _=require(_0xfa9c('0x9'));var squel=require(_0xfa9c('0xa'));var crypto=require(_0xfa9c('0xb'));var jsforce=require(_0xfa9c('0xc'));var deskjs=require(_0xfa9c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfa9c('0xe'));var Papa=require(_0xfa9c('0xf'));var Redis=require(_0xfa9c('0x10'));var authService=require(_0xfa9c('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa9c('0x12'));var utils=require(_0xfa9c('0x13'));var config=require(_0xfa9c('0x14'));var db=require(_0xfa9c('0x15'))['db'];function respondWithStatusCode(_0x4874d4,_0x3248e9){_0x3248e9=_0x3248e9||0xcc;return function(_0x2c02c4){if(_0x2c02c4){return _0x4874d4['sendStatus'](_0x3248e9);}return _0x4874d4[_0xfa9c('0x16')](_0x3248e9)[_0xfa9c('0x17')]();};}function respondWithResult(_0x434ed2,_0x34f6db){_0x34f6db=_0x34f6db||0xc8;return function(_0x1133ba){if(_0x1133ba){return _0x434ed2['status'](_0x34f6db)[_0xfa9c('0x18')](_0x1133ba);}};}function respondWithFilteredResult(_0x5e421e,_0x41f99a){return function(_0x556cd4){if(_0x556cd4){var _0x37616b=_0x556cd4[_0xfa9c('0x19')],_0x20f848=_0x41f99a[_0xfa9c('0x1a')],_0x15aca0=_0x41f99a[_0xfa9c('0x1a')]+_0x41f99a[_0xfa9c('0x1b')],_0x58c54f;if(_0x15aca0>=_0x37616b){_0x15aca0=_0x37616b;_0x58c54f=0xc8;}else{_0x58c54f=0xce;}_0x5e421e['status'](_0x58c54f);return _0x5e421e[_0xfa9c('0x1c')](_0xfa9c('0x1d'),_0x20f848+'-'+_0x15aca0+'/'+_0x37616b)[_0xfa9c('0x18')](_0x556cd4);}return null;};}function patchUpdates(_0x3d6cec){return function(_0x416c5d){try{jsonpatch[_0xfa9c('0x1e')](_0x416c5d,_0x3d6cec,!![]);}catch(_0x8d6fdf){return BPromise[_0xfa9c('0x1f')](_0x8d6fdf);}return _0x416c5d[_0xfa9c('0x20')]();};}function saveUpdates(_0x3b8aad,_0xc3aedc){return function(_0x323e90){if(_0x323e90){return _0x323e90['update'](_0x3b8aad)['then'](function(_0x1ce966){return _0x1ce966;});}return null;};}function removeEntity(_0xbc3af4,_0x28abc9){return function(_0x581563){if(_0x581563){return _0x581563[_0xfa9c('0x21')]()[_0xfa9c('0x22')](function(){_0xbc3af4[_0xfa9c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ed198,_0x394db5){return function(_0x392d69){if(!_0x392d69){_0x5ed198[_0xfa9c('0x23')](0x194);}return _0x392d69;};}function handleError(_0x1854d1,_0x56923d){_0x56923d=_0x56923d||0x1f4;return function(_0x5c771d){logger['error'](_0x5c771d['stack']);if(_0x5c771d[_0xfa9c('0x24')]){delete _0x5c771d['name'];}_0x1854d1[_0xfa9c('0x16')](_0x56923d)[_0xfa9c('0x25')](_0x5c771d);};}exports[_0xfa9c('0x26')]=function(_0x1c5eeb,_0x3973c2){var _0x381ec8={},_0x3c77d6={},_0x13bef8={'count':0x0,'rows':[]};var _0x436583=db[_0xfa9c('0x27')][_0xfa9c('0x28')];_0x3c77d6[_0xfa9c('0x29')]=_[_0xfa9c('0x2a')](_[_0xfa9c('0x2b')](_0x436583),[_0xfa9c('0x24')]);_0x3c77d6[_0xfa9c('0x2c')]=_[_0xfa9c('0x2b')](_0x1c5eeb[_0xfa9c('0x2c')]);_0x3c77d6[_0xfa9c('0x2d')]=_[_0xfa9c('0x2e')](_0x3c77d6[_0xfa9c('0x29')],_0x3c77d6['query']);_0x381ec8[_0xfa9c('0x2f')]=_[_0xfa9c('0x2e')](_0x3c77d6[_0xfa9c('0x29')],qs[_0xfa9c('0x30')](_0x1c5eeb[_0xfa9c('0x2c')][_0xfa9c('0x30')]));_0x381ec8[_0xfa9c('0x2f')]=_0x381ec8[_0xfa9c('0x2f')]['length']?_0x381ec8[_0xfa9c('0x2f')]:_0x3c77d6[_0xfa9c('0x29')];if(!_0x1c5eeb['query'][_0xfa9c('0x31')](_0xfa9c('0x32'))){_0x381ec8[_0xfa9c('0x1b')]=qs['limit'](_0x1c5eeb['query'][_0xfa9c('0x1b')]);_0x381ec8[_0xfa9c('0x1a')]=qs[_0xfa9c('0x1a')](_0x1c5eeb[_0xfa9c('0x2c')]['offset']);}_0x381ec8[_0xfa9c('0x33')]=qs[_0xfa9c('0x34')](_0x1c5eeb[_0xfa9c('0x2c')][_0xfa9c('0x34')]);_0x381ec8['where']=qs['filters'](_[_0xfa9c('0x35')](_0x1c5eeb['query'],_0x3c77d6[_0xfa9c('0x2d')]));if(_0x1c5eeb[_0xfa9c('0x2c')][_0xfa9c('0x36')]){_0x381ec8[_0xfa9c('0x37')]=_[_0xfa9c('0x38')](_0x381ec8[_0xfa9c('0x37')],{'$or':_['map'](_0x436583,function(_0x51d48f){if(_0x51d48f[_0xfa9c('0x39')]['key']!==_0xfa9c('0x3a')){var _0x27751a={};_0x27751a[_0x51d48f[_0xfa9c('0x3b')]]={'$like':'%'+_0x1c5eeb[_0xfa9c('0x2c')][_0xfa9c('0x36')]+'%'};return _0x27751a;}})});}_0x381ec8=_['merge']({},_0x381ec8,_0x1c5eeb['options']);var _0x53f1f0={'where':_0x381ec8[_0xfa9c('0x37')]};return db['CmCustomField']['count'](_0x53f1f0)[_0xfa9c('0x22')](function(_0x185744){_0x13bef8[_0xfa9c('0x19')]=_0x185744;if(_0x1c5eeb[_0xfa9c('0x2c')][_0xfa9c('0x3c')]){_0x381ec8[_0xfa9c('0x3d')]=[{'all':!![]}];}return db[_0xfa9c('0x27')][_0xfa9c('0x3e')](_0x381ec8);})['then'](function(_0x2fc1de){_0x13bef8[_0xfa9c('0x3f')]=_0x2fc1de;return _0x13bef8;})[_0xfa9c('0x22')](respondWithFilteredResult(_0x3973c2,_0x381ec8))[_0xfa9c('0x40')](handleError(_0x3973c2,null));};exports[_0xfa9c('0x41')]=function(_0x22e232,_0x5a8d6a){var _0x1510be={'raw':!![],'where':{'id':_0x22e232[_0xfa9c('0x42')]['id']}},_0x15e293={};_0x15e293['model']=_[_0xfa9c('0x2b')](db[_0xfa9c('0x27')][_0xfa9c('0x28')]);_0x15e293[_0xfa9c('0x2c')]=_[_0xfa9c('0x2b')](_0x22e232[_0xfa9c('0x2c')]);_0x15e293[_0xfa9c('0x2d')]=_[_0xfa9c('0x2e')](_0x15e293['model'],_0x15e293['query']);_0x1510be[_0xfa9c('0x2f')]=_[_0xfa9c('0x2e')](_0x15e293[_0xfa9c('0x29')],qs['fields'](_0x22e232[_0xfa9c('0x2c')]['fields']));_0x1510be[_0xfa9c('0x2f')]=_0x1510be['attributes']['length']?_0x1510be['attributes']:_0x15e293[_0xfa9c('0x29')];if(_0x22e232[_0xfa9c('0x2c')]['includeAll']){_0x1510be[_0xfa9c('0x3d')]=[{'all':!![]}];}_0x1510be=_[_0xfa9c('0x38')]({},_0x1510be,_0x22e232[_0xfa9c('0x43')]);return db[_0xfa9c('0x27')]['find'](_0x1510be)[_0xfa9c('0x22')](handleEntityNotFound(_0x5a8d6a,null))[_0xfa9c('0x22')](respondWithResult(_0x5a8d6a,null))[_0xfa9c('0x40')](handleError(_0x5a8d6a,null));};exports[_0xfa9c('0x44')]=function(_0x11ae06,_0x54dc65){return db[_0xfa9c('0x45')][_0xfa9c('0x46')](function(_0x1388b3){return db[_0xfa9c('0x27')]['create'](_0x11ae06[_0xfa9c('0x47')],{'transaction':_0x1388b3});})[_0xfa9c('0x22')](respondWithResult(_0x54dc65,0xc9))[_0xfa9c('0x40')](handleError(_0x54dc65,null));};exports[_0xfa9c('0x48')]=function(_0x3153cb,_0xf827af){if(_0x3153cb[_0xfa9c('0x47')]['id']){delete _0x3153cb[_0xfa9c('0x47')]['id'];}return db[_0xfa9c('0x27')]['find']({'where':{'id':_0x3153cb['params']['id']}})['then'](handleEntityNotFound(_0xf827af,null))[_0xfa9c('0x22')](saveUpdates(_0x3153cb[_0xfa9c('0x47')],null))[_0xfa9c('0x22')](respondWithResult(_0xf827af,null))[_0xfa9c('0x40')](handleError(_0xf827af,null));};exports['destroy']=function(_0x1c7276,_0x3a7bdf){return db[_0xfa9c('0x27')][_0xfa9c('0x49')]({'where':{'id':_0x1c7276['params']['id']}})[_0xfa9c('0x22')](handleEntityNotFound(_0x3a7bdf,null))[_0xfa9c('0x22')](removeEntity(_0x3a7bdf,null))[_0xfa9c('0x40')](handleError(_0x3a7bdf,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 1e19426..8d0270c 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 _0xf5d4=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','CmCustomField','cm_custom_fields','get','TEXT','transaction','type','text','number','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','cf_%d'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf5d4,0x1b5));var _0x4f5d=function(_0x4af830,_0x433e36){_0x4af830=_0x4af830-0x0;var _0xe81e20=_0xf5d4[_0x4af830];return _0xe81e20;};'use strict';var _=require(_0x4f5d('0x0'));var util=require('util');var logger=require(_0x4f5d('0x1'))(_0x4f5d('0x2'));var moment=require(_0x4f5d('0x3'));var BPromise=require(_0x4f5d('0x4'));var rp=require(_0x4f5d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f5d('0x6'));var attributes=require('./cmCustomField.attributes');module[_0x4f5d('0x7')]=function(_0x29b6b3,_0x26f36f){return _0x29b6b3[_0x4f5d('0x8')](_0x4f5d('0x9'),attributes,{'tableName':_0x4f5d('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x13ac40,_0x4c86b8,_0xc31a2){var _0xfdc87b=_0x13ac40[_0x4f5d('0xb')]({'plain':!![]});var _0x1dfe46={'type':_0x26f36f[_0x4f5d('0xc')],'transaction':_0x4c86b8[_0x4f5d('0xd')]};switch(_0xfdc87b[_0x4f5d('0xe')]){case _0x4f5d('0xf'):_0x1dfe46[_0x4f5d('0xe')]=_0x26f36f['TEXT'];break;case _0x4f5d('0x10'):_0x1dfe46[_0x4f5d('0xe')]=_0x26f36f[_0x4f5d('0x11')];break;case _0x4f5d('0x12'):_0x1dfe46['type']=_0x26f36f[_0x4f5d('0x13')];_0x1dfe46['defaultValue']=![];break;}_0x29b6b3[_0x4f5d('0x14')]['addColumn'](_0x4f5d('0x15'),util['format'](_0x4f5d('0x16'),_0xfdc87b['id']),_0x1dfe46);_0xc31a2();}}});}; \ No newline at end of file +var _0x00a8=['INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','TEXT','type','text','number'];(function(_0x4578da,_0x167447){var _0x10c671=function(_0x40365f){while(--_0x40365f){_0x4578da['push'](_0x4578da['shift']());}};_0x10c671(++_0x167447);}(_0x00a8,0x19f));var _0x800a=function(_0x52d27a,_0x14e5f4){_0x52d27a=_0x52d27a-0x0;var _0x13e761=_0x00a8[_0x52d27a];return _0x13e761;};'use strict';var _=require(_0x800a('0x0'));var util=require(_0x800a('0x1'));var logger=require('../../config/logger')(_0x800a('0x2'));var moment=require(_0x800a('0x3'));var BPromise=require(_0x800a('0x4'));var rp=require(_0x800a('0x5'));var fs=require('fs');var path=require(_0x800a('0x6'));var rimraf=require('rimraf');var config=require(_0x800a('0x7'));var attributes=require(_0x800a('0x8'));module[_0x800a('0x9')]=function(_0x2e963b,_0x1fcf94){return _0x2e963b[_0x800a('0xa')](_0x800a('0xb'),attributes,{'tableName':_0x800a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x221cc4,_0x25e5b6,_0x276dad){var _0x20b513=_0x221cc4['get']({'plain':!![]});var _0x228ddf={'type':_0x1fcf94[_0x800a('0xd')],'transaction':_0x25e5b6['transaction']};switch(_0x20b513[_0x800a('0xe')]){case _0x800a('0xf'):_0x228ddf[_0x800a('0xe')]=_0x1fcf94[_0x800a('0xd')];break;case _0x800a('0x10'):_0x228ddf[_0x800a('0xe')]=_0x1fcf94[_0x800a('0x11')];break;case _0x800a('0x12'):_0x228ddf[_0x800a('0xe')]=_0x1fcf94[_0x800a('0x13')];_0x228ddf[_0x800a('0x14')]=![];break;}_0x2e963b[_0x800a('0x15')]['addColumn'](_0x800a('0x16'),util[_0x800a('0x17')]('cf_%d',_0x20b513['id']),_0x228ddf);_0x276dad();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 66fb03c..41d5e60 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 _0x4e2b=['request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s'];(function(_0x4550cc,_0x16f0c2){var _0x24eacd=function(_0x5315f1){while(--_0x5315f1){_0x4550cc['push'](_0x4550cc['shift']());}};_0x24eacd(++_0x16f0c2);}(_0x4e2b,0xb8));var _0xb4e2=function(_0x1cd5ae,_0x4db99b){_0x1cd5ae=_0x1cd5ae-0x0;var _0x132122=_0x4e2b[_0x1cd5ae];return _0x132122;};'use strict';var _=require(_0xb4e2('0x0'));var util=require('util');var moment=require(_0xb4e2('0x1'));var BPromise=require(_0xb4e2('0x2'));var rs=require(_0xb4e2('0x3'));var fs=require('fs');var Redis=require(_0xb4e2('0x4'));var db=require(_0xb4e2('0x5'))['db'];var utils=require(_0xb4e2('0x6'));var logger=require(_0xb4e2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb4e2('0x8'));var client=jayson[_0xb4e2('0x9')][_0xb4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d5319,_0x254f59,_0x571664){return new BPromise(function(_0x3326ec,_0x1efa8b){return client[_0xb4e2('0xb')](_0x3d5319,_0x571664)['then'](function(_0x3f9146){logger[_0xb4e2('0xc')](_0xb4e2('0xd'),_0x254f59,_0xb4e2('0xe'));logger[_0xb4e2('0xf')](_0xb4e2('0x10'),_0x254f59,'request\x20sent',JSON['stringify'](_0x3f9146));if(_0x3f9146[_0xb4e2('0x11')]){if(_0x3f9146[_0xb4e2('0x11')][_0xb4e2('0x12')]===0x1f4){logger[_0xb4e2('0x11')](_0xb4e2('0xd'),_0x254f59,_0x3f9146['error'][_0xb4e2('0x13')]);return _0x1efa8b(_0x3f9146[_0xb4e2('0x11')][_0xb4e2('0x13')]);}logger[_0xb4e2('0x11')](_0xb4e2('0xd'),_0x254f59,_0x3f9146[_0xb4e2('0x11')][_0xb4e2('0x13')]);return _0x3326ec(_0x3f9146[_0xb4e2('0x11')][_0xb4e2('0x13')]);}else{logger['info'](_0xb4e2('0xd'),_0x254f59,_0xb4e2('0xe'));_0x3326ec(_0x3f9146[_0xb4e2('0x14')][_0xb4e2('0x13')]);}})[_0xb4e2('0x15')](function(_0x482377){logger[_0xb4e2('0x11')](_0xb4e2('0xd'),_0x254f59,_0x482377);_0x1efa8b(_0x482377);});});} \ No newline at end of file +var _0xd0c5=['../../config/environment','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x59bc55,_0x201b3b){var _0x280865=function(_0x108ef0){while(--_0x108ef0){_0x59bc55['push'](_0x59bc55['shift']());}};_0x280865(++_0x201b3b);}(_0xd0c5,0xe8));var _0x5d0c=function(_0x3b211d,_0x258eaa){_0x3b211d=_0x3b211d-0x0;var _0x267f41=_0xd0c5[_0x3b211d];return _0x267f41;};'use strict';var _=require(_0x5d0c('0x0'));var util=require(_0x5d0c('0x1'));var moment=require(_0x5d0c('0x2'));var BPromise=require(_0x5d0c('0x3'));var rs=require(_0x5d0c('0x4'));var fs=require('fs');var Redis=require(_0x5d0c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d0c('0x6'))(_0x5d0c('0x7'));var config=require(_0x5d0c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5d0c('0x9')][_0x5d0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a98bf,_0x11fd8a,_0x1e21d0){return new BPromise(function(_0x2a7db0,_0x3f8c2d){return client['request'](_0x1a98bf,_0x1e21d0)[_0x5d0c('0xb')](function(_0x4f3d27){logger['info'](_0x5d0c('0xc'),_0x11fd8a,_0x5d0c('0xd'));logger[_0x5d0c('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x11fd8a,_0x5d0c('0xd'),JSON[_0x5d0c('0xf')](_0x4f3d27));if(_0x4f3d27['error']){if(_0x4f3d27['error'][_0x5d0c('0x10')]===0x1f4){logger[_0x5d0c('0x11')](_0x5d0c('0xc'),_0x11fd8a,_0x4f3d27['error'][_0x5d0c('0x12')]);return _0x3f8c2d(_0x4f3d27[_0x5d0c('0x11')][_0x5d0c('0x12')]);}logger[_0x5d0c('0x11')](_0x5d0c('0xc'),_0x11fd8a,_0x4f3d27[_0x5d0c('0x11')]['message']);return _0x2a7db0(_0x4f3d27[_0x5d0c('0x11')][_0x5d0c('0x12')]);}else{logger['info'](_0x5d0c('0xc'),_0x11fd8a,_0x5d0c('0xd'));_0x2a7db0(_0x4f3d27['result'][_0x5d0c('0x12')]);}})[_0x5d0c('0x13')](function(_0x1f25ca){logger['error'](_0x5d0c('0xc'),_0x11fd8a,_0x1f25ca);_0x3f8c2d(_0x1f25ca);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3378e57..675b49f 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 _0xfa1e=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3d967,_0x1d3d71){var _0x22caf4=function(_0x36da94){while(--_0x36da94){_0x3d967['push'](_0x3d967['shift']());}};_0x22caf4(++_0x1d3d71);}(_0xfa1e,0x196));var _0xefa1=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0xfa1e[_0x3cae69];return _0x3128eb;};'use strict';var multer=require('multer');var util=require(_0xefa1('0x0'));var path=require(_0xefa1('0x1'));var timeout=require(_0xefa1('0x2'));var express=require(_0xefa1('0x3'));var router=express[_0xefa1('0x4')]();var auth=require(_0xefa1('0x5'));var interaction=require(_0xefa1('0x6'));var config=require(_0xefa1('0x7'));var controller=require(_0xefa1('0x8'));router[_0xefa1('0x9')]('/',auth['isAuthenticated'](),controller[_0xefa1('0xa')]);router['get'](_0xefa1('0xb'),auth[_0xefa1('0xc')](),controller[_0xefa1('0xd')]);router[_0xefa1('0xe')]('/',auth[_0xefa1('0xc')](),controller['create']);router[_0xefa1('0xf')](_0xefa1('0xb'),auth[_0xefa1('0xc')](),controller[_0xefa1('0x10')]);router[_0xefa1('0x11')](_0xefa1('0xb'),auth[_0xefa1('0xc')](),controller[_0xefa1('0x12')]);module[_0xefa1('0x13')]=router; \ No newline at end of file +var _0xafee=['isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','show','post'];(function(_0x136b6f,_0x51f859){var _0x705233=function(_0x3a77a4){while(--_0x3a77a4){_0x136b6f['push'](_0x136b6f['shift']());}};_0x705233(++_0x51f859);}(_0xafee,0x159));var _0xeafe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafee[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xeafe('0x0'));var timeout=require(_0xeafe('0x1'));var express=require(_0xeafe('0x2'));var router=express['Router']();var auth=require(_0xeafe('0x3'));var interaction=require(_0xeafe('0x4'));var config=require(_0xeafe('0x5'));var controller=require(_0xeafe('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xeafe('0x7')]);router[_0xeafe('0x8')](_0xeafe('0x9'),auth['isAuthenticated'](),controller[_0xeafe('0xa')]);router[_0xeafe('0xb')]('/',auth[_0xeafe('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xeafe('0xd')]);router[_0xeafe('0xe')](_0xeafe('0x9'),auth[_0xeafe('0xc')](),controller[_0xeafe('0xf')]);module[_0xeafe('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 18cedbb..6d54e42 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 _0xc2c3=['INTEGER','STRING','DATE','UNSIGNED','contactListQueue','sequelize','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3571b5,_0x284a82){var _0x3c126a=function(_0x5b5ea5){while(--_0x5b5ea5){_0x3571b5['push'](_0x3571b5['shift']());}};_0x3c126a(++_0x284a82);}(_0xc2c3,0x1c7));var _0x3c2c=function(_0x170f46,_0x422fbd){_0x170f46=_0x170f46-0x0;var _0x46fe1d=_0xc2c3[_0x170f46];return _0x46fe1d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3c2c('0x0'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x3c2c('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x3c2c('0x2')](_0x3c2c('0x3'))},'countbusyretry':{'type':Sequelize[_0x3c2c('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c2c('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3c2c('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c2c('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3c2c('0x6')]},'priority':{'type':Sequelize[_0x3c2c('0x4')](0x2)[_0x3c2c('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3c2c('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3c2c('0x4')],'unique':_0x3c2c('0x8')},'ListId':{'type':Sequelize[_0x3c2c('0x4')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3c2c('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x3c2c('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3c2c('0x4')]}}; \ No newline at end of file +var _0xd9a6=['exports','STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment','sequelize'];(function(_0x1c8c2f,_0x1d99fe){var _0x24fa67=function(_0x15fd50){while(--_0x15fd50){_0x1c8c2f['push'](_0x1c8c2f['shift']());}};_0x24fa67(++_0x1d99fe);}(_0xd9a6,0x11e));var _0x6d9a=function(_0x233e96,_0x453ba2){_0x233e96=_0x233e96-0x0;var _0x5295ac=_0xd9a6[_0x233e96];return _0x5295ac;};'use strict';var moment=require(_0x6d9a('0x0'));var Sequelize=require(_0x6d9a('0x1'));module[_0x6d9a('0x2')]={'phone':{'type':Sequelize[_0x6d9a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x6d9a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6d9a('0x5')],'defaultValue':moment()[_0x6d9a('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6d9a('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6d9a('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6d9a('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6d9a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6d9a('0x5')]},'priority':{'type':Sequelize[_0x6d9a('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6d9a('0x7')],'unique':_0x6d9a('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6d9a('0x8')},'UserId':{'type':Sequelize[_0x6d9a('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6d9a('0x8')},'CampaignId':{'type':Sequelize[_0x6d9a('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0dac2c7..66d2029 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 _0x48c4=['CmList','List','Queue','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','CmHopper','includeAll','include','findAll','rows','catch','show','fields','create','body','find','describe','destroy','params','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','statedesc','membername','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getVoiceQueues','outbound','preview','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x48c4,0x134));var _0x448c=function(_0x67e4d2,_0x49cfe4){_0x67e4d2=_0x67e4d2-0x0;var _0x1ba917=_0x48c4[_0x67e4d2];return _0x1ba917;};'use strict';var pdf=require(_0x448c('0x0'));var emlformat=require(_0x448c('0x1'));var rimraf=require(_0x448c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x448c('0x3'));var rp=require(_0x448c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x448c('0x5'));var util=require('util');var path=require(_0x448c('0x6'));var sox=require(_0x448c('0x7'));var csv=require(_0x448c('0x8'));var ejs=require(_0x448c('0x9'));var fs=require('fs');var _=require(_0x448c('0xa'));var squel=require('squel');var crypto=require(_0x448c('0xb'));var jsforce=require(_0x448c('0xc'));var deskjs=require(_0x448c('0xd'));var toCsv=require(_0x448c('0x8'));var querystring=require(_0x448c('0xe'));var Papa=require(_0x448c('0xf'));var Redis=require(_0x448c('0x10'));var authService=require(_0x448c('0x11'));var qs=require(_0x448c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x448c('0x13'));var utils=require(_0x448c('0x14'));var config=require(_0x448c('0x15'));var db=require(_0x448c('0x16'))['db'];function respondWithStatusCode(_0x219eac,_0x5aa716){_0x5aa716=_0x5aa716||0xcc;return function(_0x325b4d){if(_0x325b4d){return _0x219eac['sendStatus'](_0x5aa716);}return _0x219eac[_0x448c('0x17')](_0x5aa716)[_0x448c('0x18')]();};}function respondWithResult(_0x5a3f1d,_0x26a5fe){_0x26a5fe=_0x26a5fe||0xc8;return function(_0x4ac329){if(_0x4ac329){return _0x5a3f1d[_0x448c('0x17')](_0x26a5fe)['json'](_0x4ac329);}};}function respondWithFilteredResult(_0x149d80,_0x5ad6bc){return function(_0x19b5b9){if(_0x19b5b9){var _0x463a1e=_0x19b5b9[_0x448c('0x19')],_0x2f8334=_0x5ad6bc[_0x448c('0x1a')],_0x414e54=_0x5ad6bc[_0x448c('0x1a')]+_0x5ad6bc[_0x448c('0x1b')],_0x4d1d46;if(_0x414e54>=_0x463a1e){_0x414e54=_0x463a1e;_0x4d1d46=0xc8;}else{_0x4d1d46=0xce;}_0x149d80[_0x448c('0x17')](_0x4d1d46);return _0x149d80[_0x448c('0x1c')](_0x448c('0x1d'),_0x2f8334+'-'+_0x414e54+'/'+_0x463a1e)[_0x448c('0x1e')](_0x19b5b9);}return null;};}function patchUpdates(_0x4cbbea){return function(_0x2510f7){try{jsonpatch[_0x448c('0x1f')](_0x2510f7,_0x4cbbea,!![]);}catch(_0x277c1f){return BPromise['reject'](_0x277c1f);}return _0x2510f7[_0x448c('0x20')]();};}function saveUpdates(_0x435d02,_0x4085f8){return function(_0x309078){if(_0x309078){return _0x309078[_0x448c('0x21')](_0x435d02)[_0x448c('0x22')](function(_0x422998){return _0x422998;});}return null;};}function removeEntity(_0x1f05df,_0x1a0b9a){return function(_0x557f7d){if(_0x557f7d){return _0x557f7d['destroy']()[_0x448c('0x22')](function(){_0x1f05df[_0x448c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9e48,_0x476d94){return function(_0x1f6d1e){if(!_0x1f6d1e){_0x5d9e48[_0x448c('0x23')](0x194);}return _0x1f6d1e;};}function handleError(_0x336a8f,_0x4ea4c5){_0x4ea4c5=_0x4ea4c5||0x1f4;return function(_0x5f24d5){logger[_0x448c('0x24')](_0x5f24d5[_0x448c('0x25')]);if(_0x5f24d5[_0x448c('0x26')]){delete _0x5f24d5[_0x448c('0x26')];}_0x336a8f[_0x448c('0x17')](_0x4ea4c5)[_0x448c('0x27')](_0x5f24d5);};}exports[_0x448c('0x28')]=function(_0x42e096,_0x1de1a1){var _0x11554e={},_0xd51334={},_0x8d6188={'count':0x0,'rows':[]};var _0x26a28e=db['CmHopper'][_0x448c('0x29')];_0xd51334['model']=_[_0x448c('0x2a')](_0x26a28e);_0xd51334[_0x448c('0x2b')]=_[_0x448c('0x2a')](_0x42e096[_0x448c('0x2b')]);_0xd51334[_0x448c('0x2c')]=_[_0x448c('0x2d')](_0xd51334[_0x448c('0x2e')],_0xd51334[_0x448c('0x2b')]);_0xd51334[_0x448c('0x2c')]=_[_0x448c('0x2f')](_0xd51334[_0x448c('0x2c')],[_0x448c('0x30'),_0x448c('0x31'),_0x448c('0x32'),_0x448c('0x33'),_0x448c('0x34'),_0x448c('0x35'),_0x448c('0x36'),_0x448c('0x37'),'$not',_0x448c('0x38'),_0x448c('0x39'),_0x448c('0x3a'),_0x448c('0x3b'),'$like',_0x448c('0x3c'),_0x448c('0x3d'),_0x448c('0x3e'),_0x448c('0x3f'),_0x448c('0x40'),_0x448c('0x41'),_0x448c('0x42'),_0x448c('0x43')]);_0x11554e[_0x448c('0x44')]=_[_0x448c('0x2d')](_0xd51334[_0x448c('0x2e')],qs['fields'](_0x42e096[_0x448c('0x2b')]['fields']));_0x11554e[_0x448c('0x44')]=_0x11554e[_0x448c('0x44')][_0x448c('0x45')]?_0x11554e['attributes']:_0xd51334['model'];if(!_0x42e096[_0x448c('0x2b')]['hasOwnProperty'](_0x448c('0x46'))){_0x11554e[_0x448c('0x1b')]=qs['limit'](_0x42e096[_0x448c('0x2b')][_0x448c('0x1b')]);_0x11554e['offset']=qs[_0x448c('0x1a')](_0x42e096['query'][_0x448c('0x1a')]);}_0x11554e[_0x448c('0x47')]=qs[_0x448c('0x48')](_0x42e096[_0x448c('0x2b')][_0x448c('0x48')]);_0x11554e[_0x448c('0x49')]=qs[_0x448c('0x2c')](_[_0x448c('0x4a')](_0x42e096[_0x448c('0x2b')],_0xd51334[_0x448c('0x2c')]));if(_0x42e096['query'][_0x448c('0x4b')]){_0x11554e['where']=_[_0x448c('0x4c')](_0x11554e[_0x448c('0x49')],{'$or':_[_0x448c('0x4d')](_0x26a28e,function(_0x25603a){if(_0x25603a[_0x448c('0x4e')][_0x448c('0x4f')]!==_0x448c('0x50')){var _0x143f67={};_0x143f67[_0x25603a[_0x448c('0x51')]]={'$like':'%'+_0x42e096[_0x448c('0x2b')][_0x448c('0x4b')]+'%'};return _0x143f67;}})});}_0x11554e=_['merge']({},_0x11554e,_0x42e096[_0x448c('0x52')]);var _0x430ed6={'where':_0x11554e['where']};return db[_0x448c('0x53')][_0x448c('0x19')](_0x430ed6)[_0x448c('0x22')](function(_0x268e2f){_0x8d6188['count']=_0x268e2f;if(_0x42e096[_0x448c('0x2b')][_0x448c('0x54')]){_0x11554e[_0x448c('0x55')]=[{'all':!![]}];}return db[_0x448c('0x53')][_0x448c('0x56')](_0x11554e);})['then'](function(_0x31329f){_0x8d6188[_0x448c('0x57')]=_0x31329f;return _0x8d6188;})[_0x448c('0x22')](respondWithFilteredResult(_0x1de1a1,_0x11554e))[_0x448c('0x58')](handleError(_0x1de1a1,null));};exports[_0x448c('0x59')]=function(_0x163684,_0x51b8eb){var _0x5deafe={'raw':!![],'where':{'id':_0x163684['params']['id']}},_0x3bb9c4={};_0x3bb9c4[_0x448c('0x2e')]=_[_0x448c('0x2a')](db[_0x448c('0x53')][_0x448c('0x29')]);_0x3bb9c4[_0x448c('0x2b')]=_[_0x448c('0x2a')](_0x163684[_0x448c('0x2b')]);_0x3bb9c4[_0x448c('0x2c')]=_[_0x448c('0x2d')](_0x3bb9c4[_0x448c('0x2e')],_0x3bb9c4['query']);_0x5deafe['attributes']=_['intersection'](_0x3bb9c4['model'],qs[_0x448c('0x5a')](_0x163684[_0x448c('0x2b')][_0x448c('0x5a')]));_0x5deafe['attributes']=_0x5deafe[_0x448c('0x44')][_0x448c('0x45')]?_0x5deafe['attributes']:_0x3bb9c4[_0x448c('0x2e')];if(_0x163684[_0x448c('0x2b')][_0x448c('0x54')]){_0x5deafe[_0x448c('0x55')]=[{'all':!![]}];}_0x5deafe=_[_0x448c('0x4c')]({},_0x5deafe,_0x163684[_0x448c('0x52')]);return db[_0x448c('0x53')]['find'](_0x5deafe)[_0x448c('0x22')](handleEntityNotFound(_0x51b8eb,null))[_0x448c('0x22')](respondWithResult(_0x51b8eb,null))[_0x448c('0x58')](handleError(_0x51b8eb,null));};exports[_0x448c('0x5b')]=function(_0x1bb08d,_0x3cabb6){return db[_0x448c('0x53')][_0x448c('0x5b')](_0x1bb08d[_0x448c('0x5c')],{})['then'](respondWithResult(_0x3cabb6,0xc9))['catch'](handleError(_0x3cabb6,null));};exports['update']=function(_0x3c44ff,_0x169edd){if(_0x3c44ff[_0x448c('0x5c')]['id']){delete _0x3c44ff[_0x448c('0x5c')]['id'];}return db[_0x448c('0x53')][_0x448c('0x5d')]({'where':{'id':_0x3c44ff['params']['id']}})['then'](handleEntityNotFound(_0x169edd,null))['then'](saveUpdates(_0x3c44ff[_0x448c('0x5c')],null))[_0x448c('0x22')](respondWithResult(_0x169edd,null))[_0x448c('0x58')](handleError(_0x169edd,null));};exports[_0x448c('0x5e')]=function(_0x11c424,_0x3683be){return db[_0x448c('0x53')]['describe']()['then'](respondWithResult(_0x3683be,null))['catch'](handleError(_0x3683be,null));};exports[_0x448c('0x5f')]=function(_0xec1fe8,_0x57e4db){var _0x1517af;return db[_0x448c('0x53')][_0x448c('0x5d')]({'where':{'id':_0xec1fe8[_0x448c('0x60')]['id']}})[_0x448c('0x22')](handleEntityNotFound(_0x57e4db,null))[_0x448c('0x22')](function(_0x454422){if(_0x454422){return _0x454422[_0x448c('0x5f')]()[_0x448c('0x22')](function(_0x2a0aad){return _0x2a0aad;});}})['then'](function(_0x20985d){_0x1517af=_0x20985d;if(_0x20985d){if(_0x20985d['VoiceQueueId']||_0x20985d['CampaignId']){return db[_0x20985d[_0x448c('0x61')]?_0x448c('0x62'):_0x448c('0x63')][_0x448c('0x5d')]({'where':{'id':_0x20985d[_0x448c('0x61')]?_0x20985d['VoiceQueueId']:_0x20985d[_0x448c('0x64')]},'attributes':['id',_0x448c('0x26')],'raw':!![]});}}})['then'](function(_0x560dc9){var _0x10d33c={};if(_0x560dc9){_['merge'](_0x10d33c,_[_0x448c('0x65')](_0x1517af['dataValues'],[_0x448c('0x66'),_0x448c('0x67'),'id']));_0x10d33c[_0x448c('0x68')]=0x15;_0x10d33c[_0x448c('0x69')]='deleted';_0x10d33c['campaign']=_0x560dc9['name'];_0x10d33c[_0x448c('0x6a')]=_0xec1fe8['user'][_0x448c('0x26')];_0x10d33c[_0x448c('0x6b')]=_0xec1fe8[_0x448c('0x6c')]['id'];_0x10d33c[_0x448c('0x6d')]=!![];_0x10d33c[_0x448c('0x6e')]=moment()[_0x448c('0x6f')](_0x448c('0x70'));_0x10d33c[_0x448c('0x71')]=_0x1517af[_0x448c('0x72')];_0x10d33c[_0x448c('0x73')]=_0x1517af[_0x448c('0x61')]?'queue':_0x448c('0x74');return db[_0x448c('0x75')][_0x448c('0x5d')]({'where':{'id':_0x10d33c[_0x448c('0x76')]},'attributes':[_0x448c('0x77'),_0x448c('0x78')]})[_0x448c('0x22')](function(_0x49157d){if(!_['isNil'](_0x57e4db)&&!_[_0x448c('0x79')](_0x49157d['firstName'])){_0x10d33c[_0x448c('0x7a')]=_0x49157d[_0x448c('0x77')];if(!_[_0x448c('0x79')](_0x49157d[_0x448c('0x78')])){_0x10d33c[_0x448c('0x7a')]+='\x20'+_0x49157d[_0x448c('0x78')];}}})[_0x448c('0x7b')](function(){return db['CmHopperFinal'][_0x448c('0x5b')](_0x10d33c);});}})[_0x448c('0x22')](function(){return _0x57e4db['status'](0xcc)[_0x448c('0x18')]();})[_0x448c('0x58')](handleError(_0x57e4db,null));};exports['getPreview']=function(_0x216d42,_0xb799c0,_0x1a6f5b){var _0x37cd61=[];return db['CmContact'][_0x448c('0x5e')]()[_0x448c('0x22')](function(_0xccc911){_0x37cd61=_['keys'](_0xccc911);return _0x216d42[_0x448c('0x6c')][_0x448c('0x7c')]({'where':{'type':_0x448c('0x7d'),'dialActive':!![],'dialMethod':_0x448c('0x7e')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x448c('0x22')](function(_0x1dfd70){if(_0x1dfd70&&_0x1dfd70[_0x448c('0x45')]){return db[_0x448c('0x7f')][_0x448c('0x80')](function(_0x198846){var _0x5f58a1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x448c('0x6f')](_0x448c('0x70'))},'VoiceQueueId':{'$in':_[_0x448c('0x4d')](_0x1dfd70,'id')},'$or':[{'UserId':null},{'UserId':_0x216d42['user']['id']}]};var _0x3d14c3=[];if(_0x216d42[_0x448c('0x5c')][_0x448c('0x81')]&&_0x216d42[_0x448c('0x5c')][_0x448c('0x81')]===_0x448c('0x82')){if(!_[_0x448c('0x83')](_0x216d42[_0x448c('0x5c')]['hopperIds'])){_0x5f58a1['id']={'$in':_0x216d42[_0x448c('0x5c')][_0x448c('0x84')]};}_0x3d14c3=[[_0x448c('0x85'),_0x448c('0x86')],[_0x448c('0x87'),_0x1dfd70[0x0][_0x448c('0x88')]===_0x448c('0x86')?_0x448c('0x89'):_0x448c('0x86')],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x448c('0x83')](_0x216d42[_0x448c('0x5c')]['hopperIds'])){_0x5f58a1['id']={'$notIn':_0x216d42[_0x448c('0x5c')]['hopperIds']};}_0x3d14c3=[['priority','DESC'],[_0x448c('0x87'),_0x1dfd70[0x0]['dialOrderByScheduledAt']],db[_0x448c('0x7f')][_0x448c('0x8a')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x448c('0x86')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x448c('0x8b')],'where':_0x5f58a1,'order':_0x3d14c3,'transaction':_0x198846,'lock':_0x198846[_0x448c('0x8c')][_0x448c('0x8d')],'include':[{'model':db[_0x448c('0x75')],'as':_0x448c('0x8e'),'attributes':_0x37cd61,'include':[{'model':db[_0x448c('0x8f')],'as':_0x448c('0x90'),'attributes':['id',_0x448c('0x26')]}]},{'model':db[_0x448c('0x91')],'as':_0x448c('0x92'),'attributes':['id',_0x448c('0x26')]},{'model':db['VoiceQueue'],'as':_0x448c('0x93'),'attributes':['id',_0x448c('0x26'),_0x448c('0x94')]}]})['then'](function(_0x56c8cc){if(_0x56c8cc){return _0x56c8cc[_0x448c('0x21')]({'UserId':_0x216d42[_0x448c('0x6c')]['id']},{'transaction':_0x198846});}});});}})[_0x448c('0x22')](handleEntityNotFound(_0xb799c0,null))[_0x448c('0x22')](respondWithResult(_0xb799c0,null))[_0x448c('0x58')](handleError(_0xb799c0,null));};exports['getOpenContacts']=function(_0x12518e,_0x44529c,_0x597321){return _0x12518e[_0x448c('0x6c')][_0x448c('0x7c')]({'where':{'type':_0x448c('0x7d'),'dialActive':!![],'dialMethod':_0x448c('0x7e')},'attributes':['id'],'raw':!![]})['then'](function(_0x2d3823){if(_0x2d3823&&_0x2d3823[_0x448c('0x45')]){return db[_0x448c('0x53')][_0x448c('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x448c('0x6f')](_0x448c('0x70'))},'VoiceQueueId':{'$in':_[_0x448c('0x4d')](_0x2d3823,'id')},'$or':[{'UserId':null},{'UserId':_0x12518e[_0x448c('0x6c')]['id']}]}});}return 0x0;})[_0x448c('0x22')](function(_0x220082){if(!_[_0x448c('0x79')](_0x220082)&&_['isNumber'](_0x220082)){return _0x44529c['status'](0xc8)[_0x448c('0x1e')]({'contacts':_0x220082});}else{logger[_0x448c('0x24')](_0x448c('0x95'),'getOpenContacts',0x194,_0x448c('0x96'));_0x44529c[_0x448c('0x23')](0x194);}})[_0x448c('0x58')](handleError(_0x44529c,null));}; \ No newline at end of file +var _0x7768=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','map','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','index','CmHopper','rawAttributes','model','keys','query','filters','intersection','concat','$and','$gte','$lt','$ne','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','VoiceQueueId','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','user','UserId','deletedat','format'];(function(_0x366257,_0x5bb7ee){var _0xd082a2=function(_0x3d813f){while(--_0x3d813f){_0x366257['push'](_0x366257['shift']());}};_0xd082a2(++_0x5bb7ee);}(_0x7768,0x1ea));var _0x8776=function(_0x2a6291,_0x47f3c3){_0x2a6291=_0x2a6291-0x0;var _0x382abe=_0x7768[_0x2a6291];return _0x382abe;};'use strict';var pdf=require(_0x8776('0x0'));var emlformat=require(_0x8776('0x1'));var rimraf=require(_0x8776('0x2'));var zipdir=require(_0x8776('0x3'));var jsonpatch=require(_0x8776('0x4'));var rp=require(_0x8776('0x5'));var moment=require(_0x8776('0x6'));var BPromise=require(_0x8776('0x7'));var Mustache=require('mustache');var util=require(_0x8776('0x8'));var path=require(_0x8776('0x9'));var sox=require(_0x8776('0xa'));var csv=require(_0x8776('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8776('0xc'));var squel=require(_0x8776('0xd'));var crypto=require(_0x8776('0xe'));var jsforce=require(_0x8776('0xf'));var deskjs=require(_0x8776('0x10'));var toCsv=require(_0x8776('0xb'));var querystring=require(_0x8776('0x11'));var Papa=require(_0x8776('0x12'));var Redis=require(_0x8776('0x13'));var authService=require(_0x8776('0x14'));var qs=require(_0x8776('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8776('0x16'))(_0x8776('0x17'));var utils=require('../../config/utils');var config=require(_0x8776('0x18'));var db=require(_0x8776('0x19'))['db'];function respondWithStatusCode(_0x50c549,_0x3a8203){_0x3a8203=_0x3a8203||0xcc;return function(_0x416f8c){if(_0x416f8c){return _0x50c549['sendStatus'](_0x3a8203);}return _0x50c549[_0x8776('0x1a')](_0x3a8203)[_0x8776('0x1b')]();};}function respondWithResult(_0x21a050,_0x49c08b){_0x49c08b=_0x49c08b||0xc8;return function(_0x30ed68){if(_0x30ed68){return _0x21a050[_0x8776('0x1a')](_0x49c08b)[_0x8776('0x1c')](_0x30ed68);}};}function respondWithFilteredResult(_0x50d1aa,_0x4a3fc0){return function(_0x5f5193){if(_0x5f5193){var _0x51ec01=_0x5f5193[_0x8776('0x1d')],_0x4ca8d8=_0x4a3fc0[_0x8776('0x1e')],_0x96700=_0x4a3fc0[_0x8776('0x1e')]+_0x4a3fc0[_0x8776('0x1f')],_0x14a75b;if(_0x96700>=_0x51ec01){_0x96700=_0x51ec01;_0x14a75b=0xc8;}else{_0x14a75b=0xce;}_0x50d1aa['status'](_0x14a75b);return _0x50d1aa[_0x8776('0x20')](_0x8776('0x21'),_0x4ca8d8+'-'+_0x96700+'/'+_0x51ec01)[_0x8776('0x1c')](_0x5f5193);}return null;};}function patchUpdates(_0x1f71c6){return function(_0xcd1e79){try{jsonpatch[_0x8776('0x22')](_0xcd1e79,_0x1f71c6,!![]);}catch(_0x272382){return BPromise[_0x8776('0x23')](_0x272382);}return _0xcd1e79[_0x8776('0x24')]();};}function saveUpdates(_0x10d455,_0x47b05b){return function(_0x320bd2){if(_0x320bd2){return _0x320bd2[_0x8776('0x25')](_0x10d455)['then'](function(_0x324f93){return _0x324f93;});}return null;};}function removeEntity(_0x44140b,_0x44afd9){return function(_0x304848){if(_0x304848){return _0x304848[_0x8776('0x26')]()[_0x8776('0x27')](function(){_0x44140b[_0x8776('0x1a')](0xcc)[_0x8776('0x1b')]();});}};}function handleEntityNotFound(_0x42f7aa,_0x2f5e73){return function(_0xba09b1){if(!_0xba09b1){_0x42f7aa[_0x8776('0x28')](0x194);}return _0xba09b1;};}function handleError(_0x5da86e,_0x5d45d7){_0x5d45d7=_0x5d45d7||0x1f4;return function(_0x37c90e){logger[_0x8776('0x29')](_0x37c90e['stack']);if(_0x37c90e['name']){delete _0x37c90e[_0x8776('0x2a')];}_0x5da86e[_0x8776('0x1a')](_0x5d45d7)['send'](_0x37c90e);};}exports[_0x8776('0x2b')]=function(_0x34f71c,_0x3ec2ff){var _0xba8dc={},_0x496f60={},_0x260f57={'count':0x0,'rows':[]};var _0x395588=db[_0x8776('0x2c')][_0x8776('0x2d')];_0x496f60[_0x8776('0x2e')]=_[_0x8776('0x2f')](_0x395588);_0x496f60[_0x8776('0x30')]=_[_0x8776('0x2f')](_0x34f71c[_0x8776('0x30')]);_0x496f60[_0x8776('0x31')]=_[_0x8776('0x32')](_0x496f60['model'],_0x496f60[_0x8776('0x30')]);_0x496f60['filters']=_[_0x8776('0x33')](_0x496f60['filters'],[_0x8776('0x34'),'$or','$gt',_0x8776('0x35'),_0x8776('0x36'),'$lte',_0x8776('0x37'),'$eq',_0x8776('0x38'),_0x8776('0x39'),'$notBetween',_0x8776('0x3a'),_0x8776('0x3b'),_0x8776('0x3c'),_0x8776('0x3d'),_0x8776('0x3e'),'$notILike',_0x8776('0x3c'),_0x8776('0x3f'),_0x8776('0x40'),_0x8776('0x41'),_0x8776('0x42')]);_0xba8dc[_0x8776('0x43')]=_[_0x8776('0x32')](_0x496f60[_0x8776('0x2e')],qs['fields'](_0x34f71c[_0x8776('0x30')][_0x8776('0x44')]));_0xba8dc[_0x8776('0x43')]=_0xba8dc[_0x8776('0x43')]['length']?_0xba8dc['attributes']:_0x496f60[_0x8776('0x2e')];if(!_0x34f71c[_0x8776('0x30')][_0x8776('0x45')](_0x8776('0x46'))){_0xba8dc[_0x8776('0x1f')]=qs[_0x8776('0x1f')](_0x34f71c[_0x8776('0x30')][_0x8776('0x1f')]);_0xba8dc['offset']=qs[_0x8776('0x1e')](_0x34f71c['query'][_0x8776('0x1e')]);}_0xba8dc[_0x8776('0x47')]=qs[_0x8776('0x48')](_0x34f71c[_0x8776('0x30')][_0x8776('0x48')]);_0xba8dc[_0x8776('0x49')]=qs[_0x8776('0x31')](_[_0x8776('0x4a')](_0x34f71c[_0x8776('0x30')],_0x496f60[_0x8776('0x31')]));if(_0x34f71c[_0x8776('0x30')][_0x8776('0x4b')]){_0xba8dc['where']=_['merge'](_0xba8dc[_0x8776('0x49')],{'$or':_['map'](_0x395588,function(_0x14d305){if(_0x14d305[_0x8776('0x4c')][_0x8776('0x4d')]!=='VIRTUAL'){var _0x39727a={};_0x39727a[_0x14d305['field']]={'$like':'%'+_0x34f71c[_0x8776('0x30')][_0x8776('0x4b')]+'%'};return _0x39727a;}})});}_0xba8dc=_[_0x8776('0x4e')]({},_0xba8dc,_0x34f71c['options']);var _0x10b240={'where':_0xba8dc[_0x8776('0x49')]};return db[_0x8776('0x2c')]['count'](_0x10b240)[_0x8776('0x27')](function(_0x2f3e57){_0x260f57[_0x8776('0x1d')]=_0x2f3e57;if(_0x34f71c['query'][_0x8776('0x4f')]){_0xba8dc[_0x8776('0x50')]=[{'all':!![]}];}return db[_0x8776('0x2c')][_0x8776('0x51')](_0xba8dc);})[_0x8776('0x27')](function(_0x4ce018){_0x260f57[_0x8776('0x52')]=_0x4ce018;return _0x260f57;})[_0x8776('0x27')](respondWithFilteredResult(_0x3ec2ff,_0xba8dc))[_0x8776('0x53')](handleError(_0x3ec2ff,null));};exports[_0x8776('0x54')]=function(_0x374b10,_0x49838d){var _0x6d8e46={'raw':!![],'where':{'id':_0x374b10[_0x8776('0x55')]['id']}},_0x3a75e3={};_0x3a75e3[_0x8776('0x2e')]=_[_0x8776('0x2f')](db[_0x8776('0x2c')][_0x8776('0x2d')]);_0x3a75e3[_0x8776('0x30')]=_[_0x8776('0x2f')](_0x374b10['query']);_0x3a75e3[_0x8776('0x31')]=_['intersection'](_0x3a75e3['model'],_0x3a75e3[_0x8776('0x30')]);_0x6d8e46[_0x8776('0x43')]=_[_0x8776('0x32')](_0x3a75e3[_0x8776('0x2e')],qs[_0x8776('0x44')](_0x374b10[_0x8776('0x30')][_0x8776('0x44')]));_0x6d8e46[_0x8776('0x43')]=_0x6d8e46[_0x8776('0x43')][_0x8776('0x56')]?_0x6d8e46[_0x8776('0x43')]:_0x3a75e3[_0x8776('0x2e')];if(_0x374b10['query'][_0x8776('0x4f')]){_0x6d8e46[_0x8776('0x50')]=[{'all':!![]}];}_0x6d8e46=_['merge']({},_0x6d8e46,_0x374b10[_0x8776('0x57')]);return db['CmHopper'][_0x8776('0x58')](_0x6d8e46)['then'](handleEntityNotFound(_0x49838d,null))[_0x8776('0x27')](respondWithResult(_0x49838d,null))[_0x8776('0x53')](handleError(_0x49838d,null));};exports[_0x8776('0x59')]=function(_0x45c412,_0x116ea2){return db[_0x8776('0x2c')]['create'](_0x45c412[_0x8776('0x5a')],{})['then'](respondWithResult(_0x116ea2,0xc9))['catch'](handleError(_0x116ea2,null));};exports[_0x8776('0x25')]=function(_0x61952e,_0x21e93b){if(_0x61952e[_0x8776('0x5a')]['id']){delete _0x61952e[_0x8776('0x5a')]['id'];}return db['CmHopper'][_0x8776('0x58')]({'where':{'id':_0x61952e[_0x8776('0x55')]['id']}})[_0x8776('0x27')](handleEntityNotFound(_0x21e93b,null))[_0x8776('0x27')](saveUpdates(_0x61952e[_0x8776('0x5a')],null))[_0x8776('0x27')](respondWithResult(_0x21e93b,null))[_0x8776('0x53')](handleError(_0x21e93b,null));};exports[_0x8776('0x5b')]=function(_0x1ae7d7,_0x29b025){return db[_0x8776('0x2c')][_0x8776('0x5b')]()[_0x8776('0x27')](respondWithResult(_0x29b025,null))[_0x8776('0x53')](handleError(_0x29b025,null));};exports[_0x8776('0x26')]=function(_0x3d93e6,_0x24fe1c){var _0x1dc139;return db[_0x8776('0x2c')][_0x8776('0x58')]({'where':{'id':_0x3d93e6[_0x8776('0x55')]['id']}})[_0x8776('0x27')](handleEntityNotFound(_0x24fe1c,null))['then'](function(_0xf523a5){if(_0xf523a5){return _0xf523a5[_0x8776('0x26')]()[_0x8776('0x27')](function(_0xf383f6){return _0xf383f6;});}})[_0x8776('0x27')](function(_0x4c90c){_0x1dc139=_0x4c90c;if(_0x4c90c){if(_0x4c90c[_0x8776('0x5c')]||_0x4c90c['CampaignId']){return db[_0x4c90c[_0x8776('0x5c')]?'VoiceQueue':_0x8776('0x5d')][_0x8776('0x58')]({'where':{'id':_0x4c90c['VoiceQueueId']?_0x4c90c[_0x8776('0x5c')]:_0x4c90c[_0x8776('0x5e')]},'attributes':['id',_0x8776('0x2a')],'raw':!![]});}}})[_0x8776('0x27')](function(_0xbd28ea){var _0x1e63cc={};if(_0xbd28ea){_[_0x8776('0x4e')](_0x1e63cc,_[_0x8776('0x5f')](_0x1dc139[_0x8776('0x60')],[_0x8776('0x61'),_0x8776('0x62'),'id']));_0x1e63cc[_0x8776('0x63')]=0x15;_0x1e63cc[_0x8776('0x64')]=_0x8776('0x65');_0x1e63cc['campaign']=_0xbd28ea[_0x8776('0x2a')];_0x1e63cc['membername']=_0x3d93e6[_0x8776('0x66')]['name'];_0x1e63cc[_0x8776('0x67')]=_0x3d93e6['user']['id'];_0x1e63cc['deleted']=!![];_0x1e63cc[_0x8776('0x68')]=moment()[_0x8776('0x69')](_0x8776('0x6a'));_0x1e63cc[_0x8776('0x6b')]=_0x1dc139[_0x8776('0x6c')];_0x1e63cc[_0x8776('0x6d')]=_0x1dc139[_0x8776('0x5c')]?_0x8776('0x6e'):_0x8776('0x6f');return db[_0x8776('0x70')][_0x8776('0x58')]({'where':{'id':_0x1e63cc[_0x8776('0x71')]},'attributes':['firstName',_0x8776('0x72')]})[_0x8776('0x27')](function(_0x184f43){if(!_[_0x8776('0x73')](_0x24fe1c)&&!_[_0x8776('0x73')](_0x184f43['firstName'])){_0x1e63cc[_0x8776('0x74')]=_0x184f43[_0x8776('0x75')];if(!_[_0x8776('0x73')](_0x184f43['lastName'])){_0x1e63cc['calleridname']+='\x20'+_0x184f43[_0x8776('0x72')];}}})[_0x8776('0x76')](function(){return db[_0x8776('0x77')][_0x8776('0x59')](_0x1e63cc);});}})[_0x8776('0x27')](function(){return _0x24fe1c['status'](0xcc)[_0x8776('0x1b')]();})[_0x8776('0x53')](handleError(_0x24fe1c,null));};exports[_0x8776('0x78')]=function(_0x2d1df5,_0x5210d9,_0x3ef4d9){var _0x179380=[];return db['CmContact'][_0x8776('0x5b')]()['then'](function(_0x50f180){_0x179380=_[_0x8776('0x2f')](_0x50f180);return _0x2d1df5['user']['getVoiceQueues']({'where':{'type':_0x8776('0x79'),'dialActive':!![],'dialMethod':_0x8776('0x7a')},'attributes':['id',_0x8776('0x7b')],'raw':!![]});})['then'](function(_0x49167f){if(_0x49167f&&_0x49167f[_0x8776('0x56')]){return db[_0x8776('0x7c')][_0x8776('0x7d')](function(_0x51f2d9){var _0x47533f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8776('0x7e')](_0x49167f,'id')},'$or':[{'UserId':null},{'UserId':_0x2d1df5[_0x8776('0x66')]['id']}]};var _0x275802=[];if(_0x2d1df5[_0x8776('0x5a')][_0x8776('0x7f')]&&_0x2d1df5[_0x8776('0x5a')]['direction']==='prev'){if(!_[_0x8776('0x80')](_0x2d1df5[_0x8776('0x5a')][_0x8776('0x81')])){_0x47533f['id']={'$in':_0x2d1df5['body'][_0x8776('0x81')]};}_0x275802=[[_0x8776('0x82'),_0x8776('0x83')],[_0x8776('0x84'),_0x49167f[0x0][_0x8776('0x7b')]===_0x8776('0x83')?'DESC':'ASC'],db[_0x8776('0x7c')][_0x8776('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x8776('0x86')]];}else{if(!_[_0x8776('0x80')](_0x2d1df5[_0x8776('0x5a')]['hopperIds'])){_0x47533f['id']={'$notIn':_0x2d1df5['body'][_0x8776('0x81')]};}_0x275802=[['priority','DESC'],[_0x8776('0x84'),_0x49167f[0x0][_0x8776('0x7b')]],db['sequelize'][_0x8776('0x85')](_0x8776('0x87')),['id',_0x8776('0x83')]];}return db[_0x8776('0x2c')][_0x8776('0x88')]({'attributes':['id','scheduledat'],'where':_0x47533f,'order':_0x275802,'transaction':_0x51f2d9,'lock':_0x51f2d9[_0x8776('0x89')][_0x8776('0x8a')],'include':[{'model':db[_0x8776('0x70')],'as':_0x8776('0x8b'),'attributes':_0x179380,'include':[{'model':db[_0x8776('0x8c')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x8776('0x8d')],'as':_0x8776('0x8e'),'attributes':['id',_0x8776('0x2a')]},{'model':db[_0x8776('0x8f')],'as':_0x8776('0x90'),'attributes':['id','name',_0x8776('0x91')]}]})[_0x8776('0x27')](function(_0x51cf0b){if(_0x51cf0b){return _0x51cf0b[_0x8776('0x25')]({'UserId':_0x2d1df5[_0x8776('0x66')]['id']},{'transaction':_0x51f2d9});}});});}})[_0x8776('0x27')](handleEntityNotFound(_0x5210d9,null))[_0x8776('0x27')](respondWithResult(_0x5210d9,null))[_0x8776('0x53')](handleError(_0x5210d9,null));};exports[_0x8776('0x92')]=function(_0x2ebfba,_0xc4210f,_0x4b09f8){return _0x2ebfba[_0x8776('0x66')][_0x8776('0x93')]({'where':{'type':_0x8776('0x79'),'dialActive':!![],'dialMethod':_0x8776('0x7a')},'attributes':['id'],'raw':!![]})[_0x8776('0x27')](function(_0x5cd21c){if(_0x5cd21c&&_0x5cd21c[_0x8776('0x56')]){return db[_0x8776('0x2c')][_0x8776('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8776('0x7e')](_0x5cd21c,'id')},'$or':[{'UserId':null},{'UserId':_0x2ebfba[_0x8776('0x66')]['id']}]}});}return 0x0;})[_0x8776('0x27')](function(_0xd1567e){if(!_['isNil'](_0xd1567e)&&_['isNumber'](_0xd1567e)){return _0xc4210f['status'](0xc8)[_0x8776('0x1c')]({'contacts':_0xd1567e});}else{logger[_0x8776('0x29')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x8776('0x94'));_0xc4210f[_0x8776('0x28')](0x194);}})['catch'](handleError(_0xc4210f,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c8de5cf..7e832ce 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 _0x0102=['util','../../config/logger','api','moment','./cmHopper.attributes','exports','CmHopper','scheduledat','phone','priority'];(function(_0x2f70a4,_0xb43feb){var _0x349a6e=function(_0x386343){while(--_0x386343){_0x2f70a4['push'](_0x2f70a4['shift']());}};_0x349a6e(++_0xb43feb);}(_0x0102,0x186));var _0x2010=function(_0x4ba6c9,_0x525da4){_0x4ba6c9=_0x4ba6c9-0x0;var _0x515175=_0x0102[_0x4ba6c9];return _0x515175;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('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('../../config/environment');var attributes=require(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x2010('0x7'),'fields':[_0x2010('0x7')]},{'name':'phone','fields':[_0x2010('0x8')]},{'name':_0x2010('0x9'),'fields':[_0x2010('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd64b=['moment','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger'];(function(_0x1be5a6,_0x50dff7){var _0x1c3173=function(_0x3091e5){while(--_0x3091e5){_0x1be5a6['push'](_0x1be5a6['shift']());}};_0x1c3173(++_0x50dff7);}(_0xd64b,0xc1));var _0xbd64=function(_0x5e668f,_0x4a2f8d){_0x5e668f=_0x5e668f-0x0;var _0x23444c=_0xd64b[_0x5e668f];return _0x23444c;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[{'name':_0xbd64('0xa'),'fields':[_0xbd64('0xa')]},{'name':_0xbd64('0xb'),'fields':['phone']},{'name':'priority','fields':[_0xbd64('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 7f92704..63e0ed3 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 _0x7ddd=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','attributes','include','map','model','catch','ShowCmHopper','raw','where','CreateCmHopper','create','body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','LOCK','UPDATE','length','all','MoveContactManagedDialer','sequelize','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0x7ddd,0xc0));var _0xd7dd=function(_0xff8ff1,_0x36379d){_0xff8ff1=_0xff8ff1-0x0;var _0x184816=_0x7ddd[_0xff8ff1];return _0x184816;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd7dd('0x0'));var BPromise=require(_0xd7dd('0x1'));var rs=require(_0xd7dd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7dd('0x3'))['db'];var utils=require(_0xd7dd('0x4'));var logger=require(_0xd7dd('0x5'))(_0xd7dd('0x6'));var config=require(_0xd7dd('0x7'));var jayson=require(_0xd7dd('0x8'));var client=jayson[_0xd7dd('0x9')][_0xd7dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x426151,_0xf040e0,_0x41a573){return new BPromise(function(_0x4921b4,_0x57a82e){return client[_0xd7dd('0xb')](_0x426151,_0x41a573)[_0xd7dd('0xc')](function(_0x4142ec){logger[_0xd7dd('0xd')](_0xd7dd('0xe'),_0xf040e0,_0xd7dd('0xf'));logger[_0xd7dd('0x10')](_0xd7dd('0x11'),_0xf040e0,_0xd7dd('0xf'),JSON[_0xd7dd('0x12')](_0x4142ec));if(_0x4142ec[_0xd7dd('0x13')]){if(_0x4142ec[_0xd7dd('0x13')][_0xd7dd('0x14')]===0x1f4){logger[_0xd7dd('0x13')](_0xd7dd('0xe'),_0xf040e0,_0x4142ec['error'][_0xd7dd('0x15')]);return _0x57a82e(_0x4142ec[_0xd7dd('0x13')]['message']);}logger[_0xd7dd('0x13')](_0xd7dd('0xe'),_0xf040e0,_0x4142ec[_0xd7dd('0x13')][_0xd7dd('0x15')]);return _0x4921b4(_0x4142ec[_0xd7dd('0x13')]['message']);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0xf040e0,_0xd7dd('0xf'));_0x4921b4(_0x4142ec[_0xd7dd('0x16')][_0xd7dd('0x15')]);}})['catch'](function(_0x18e373){logger[_0xd7dd('0x13')]('CmHopper,\x20%s,\x20%s',_0xf040e0,_0x18e373);_0x57a82e(_0x18e373);});});}exports[_0xd7dd('0x17')]=function(_0x1be5b0){var _0x32a4d1=this;return new Promise(function(_0x1aea76,_0x324fd7){return db[_0xd7dd('0x18')][_0xd7dd('0x19')]({'raw':_0x1be5b0[_0xd7dd('0x1a')]?_0x1be5b0[_0xd7dd('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1be5b0[_0xd7dd('0x1a')]?_0x1be5b0[_0xd7dd('0x1a')]['where']||null:null,'attributes':_0x1be5b0[_0xd7dd('0x1a')]?_0x1be5b0[_0xd7dd('0x1a')][_0xd7dd('0x1b')]||null:null,'limit':_0x1be5b0[_0xd7dd('0x1a')]?_0x1be5b0['options']['limit']||null:null,'include':_0x1be5b0['options']?_0x1be5b0['options'][_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x1be5b0[_0xd7dd('0x1a')][_0xd7dd('0x1c')],function(_0x3c0fe6){return{'model':db[_0x3c0fe6[_0xd7dd('0x1e')]],'as':_0x3c0fe6['as'],'attributes':_0x3c0fe6['attributes'],'include':_0x3c0fe6[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x3c0fe6[_0xd7dd('0x1c')],function(_0x57639f){return{'model':db[_0x57639f[_0xd7dd('0x1e')]],'as':_0x57639f['as'],'attributes':_0x57639f[_0xd7dd('0x1b')],'include':_0x57639f[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x57639f[_0xd7dd('0x1c')],function(_0x2c86eb){return{'model':db[_0x2c86eb[_0xd7dd('0x1e')]],'as':_0x2c86eb['as'],'attributes':_0x2c86eb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7dd('0xc')](function(_0x1c4c14){logger['info'](_0xd7dd('0x17'),_0x1be5b0);logger[_0xd7dd('0x10')](_0xd7dd('0x17'),_0x1be5b0,JSON[_0xd7dd('0x12')](_0x1c4c14));_0x1aea76(_0x1c4c14);})[_0xd7dd('0x1f')](function(_0x4815a2){logger[_0xd7dd('0x13')](_0xd7dd('0x17'),_0x4815a2[_0xd7dd('0x15')],_0x1be5b0);_0x324fd7(_0x32a4d1['error'](0x1f4,_0x4815a2['message']));});});};exports[_0xd7dd('0x20')]=function(_0x2018ca){var _0x4f82ce=this;return new Promise(function(_0x4101bf,_0x3a9cc2){return db['CmHopper']['find']({'raw':_0x2018ca[_0xd7dd('0x1a')]?_0x2018ca[_0xd7dd('0x1a')][_0xd7dd('0x21')]===undefined?!![]:![]:!![],'where':_0x2018ca[_0xd7dd('0x1a')]?_0x2018ca['options'][_0xd7dd('0x22')]||null:null,'attributes':_0x2018ca[_0xd7dd('0x1a')]?_0x2018ca['options'][_0xd7dd('0x1b')]||null:null,'include':_0x2018ca[_0xd7dd('0x1a')]?_0x2018ca['options'][_0xd7dd('0x1c')]?_['map'](_0x2018ca['options']['include'],function(_0x4588cb){return{'model':db[_0x4588cb[_0xd7dd('0x1e')]],'as':_0x4588cb['as'],'attributes':_0x4588cb[_0xd7dd('0x1b')],'include':_0x4588cb[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x4588cb[_0xd7dd('0x1c')],function(_0x526d74){return{'model':db[_0x526d74['model']],'as':_0x526d74['as'],'attributes':_0x526d74[_0xd7dd('0x1b')],'include':_0x526d74[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x526d74[_0xd7dd('0x1c')],function(_0x31a9ec){return{'model':db[_0x31a9ec[_0xd7dd('0x1e')]],'as':_0x31a9ec['as'],'attributes':_0x31a9ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7dd('0xc')](function(_0x2fee0b){logger[_0xd7dd('0xd')]('ShowCmHopper',_0x2018ca);logger[_0xd7dd('0x10')](_0xd7dd('0x20'),_0x2018ca,JSON['stringify'](_0x2fee0b));_0x4101bf(_0x2fee0b);})['catch'](function(_0x567d9b){logger['error']('ShowCmHopper',_0x567d9b[_0xd7dd('0x15')],_0x2018ca);_0x3a9cc2(_0x4f82ce[_0xd7dd('0x13')](0x1f4,_0x567d9b[_0xd7dd('0x15')]));});});};exports[_0xd7dd('0x23')]=function(_0x2fae02){var _0x258084=this;return new Promise(function(_0x2ab927,_0x274c3a){return db['CmHopper'][_0xd7dd('0x24')](_0x2fae02[_0xd7dd('0x25')],{'raw':_0x2fae02[_0xd7dd('0x1a')]?_0x2fae02['options'][_0xd7dd('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x9afcf5){logger['info'](_0xd7dd('0x23'),_0x2fae02);logger[_0xd7dd('0x10')](_0xd7dd('0x23'),_0x2fae02,JSON['stringify'](_0x9afcf5));_0x2ab927(_0x9afcf5);})['catch'](function(_0x16b813){logger[_0xd7dd('0x13')](_0xd7dd('0x23'),_0x16b813[_0xd7dd('0x15')],_0x2fae02);_0x274c3a(_0x258084[_0xd7dd('0x13')](0x1f4,_0x16b813[_0xd7dd('0x15')]));});});};exports[_0xd7dd('0x26')]=function(_0x473b54){var _0x5d56c=this;return new Promise(function(_0x1f1536,_0x55e602){return db[_0xd7dd('0x18')][_0xd7dd('0x27')](_0x473b54[_0xd7dd('0x25')],{'raw':_0x473b54[_0xd7dd('0x1a')]?_0x473b54[_0xd7dd('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x473b54[_0xd7dd('0x1a')]?_0x473b54['options'][_0xd7dd('0x22')]||null:null,'attributes':_0x473b54[_0xd7dd('0x1a')]?_0x473b54[_0xd7dd('0x1a')]['attributes']||null:null,'limit':_0x473b54[_0xd7dd('0x1a')]?_0x473b54[_0xd7dd('0x1a')][_0xd7dd('0x28')]||null:null})[_0xd7dd('0xc')](function(_0x4c8078){logger[_0xd7dd('0xd')](_0xd7dd('0x26'),_0x473b54);logger[_0xd7dd('0x10')](_0xd7dd('0x26'),_0x473b54,JSON['stringify'](_0x4c8078));_0x1f1536(_0x4c8078);})[_0xd7dd('0x1f')](function(_0x33af8d){logger['error']('UpdateCmHopper',_0x33af8d[_0xd7dd('0x15')],_0x473b54);_0x55e602(_0x5d56c['error'](0x1f4,_0x33af8d[_0xd7dd('0x15')]));});});};exports[_0xd7dd('0x29')]=function(_0x52e31e){var _0x40c86d=this;return new Promise(function(_0x4129c9,_0x5bc14f){return db[_0xd7dd('0x18')][_0xd7dd('0x2a')]({'where':_0x52e31e[_0xd7dd('0x1a')]?_0x52e31e[_0xd7dd('0x1a')][_0xd7dd('0x22')]||null:null})[_0xd7dd('0xc')](function(_0x576950){logger[_0xd7dd('0xd')](_0xd7dd('0x29'),_0x52e31e);logger[_0xd7dd('0x10')](_0xd7dd('0x29'),_0x52e31e,JSON[_0xd7dd('0x12')](_0x576950));_0x4129c9(_0x576950);})[_0xd7dd('0x1f')](function(_0x53ff58){logger[_0xd7dd('0x13')](_0xd7dd('0x29'),_0x53ff58[_0xd7dd('0x15')],_0x52e31e);_0x5bc14f(_0x40c86d[_0xd7dd('0x13')](0x1f4,_0x53ff58[_0xd7dd('0x15')]));});});};exports[_0xd7dd('0x2b')]=function(_0x43cd47){var _0x129755=this;return new Promise(function(_0x3baa14,_0x280038){return db[_0xd7dd('0x2c')][_0xd7dd('0x2d')]()[_0xd7dd('0xc')](function(_0x2ed663){return db['sequelize']['transaction'](function(_0x1d3e69){return db[_0xd7dd('0x18')][_0xd7dd('0x19')]({'where':_0x43cd47[_0xd7dd('0x1a')]?_0x43cd47['options']['where']||null:null,'attributes':_0x43cd47[_0xd7dd('0x1a')]?_0x43cd47[_0xd7dd('0x1a')][_0xd7dd('0x1b')]||null:null,'limit':_0x43cd47[_0xd7dd('0x1a')]?_0x43cd47[_0xd7dd('0x1a')][_0xd7dd('0x28')]||null:null,'order':_0x43cd47['options']?_0x43cd47[_0xd7dd('0x1a')][_0xd7dd('0x2e')]||null:null,'transaction':_0x1d3e69,'lock':_0x1d3e69[_0xd7dd('0x2f')][_0xd7dd('0x30')],'include':[{'model':db[_0xd7dd('0x2c')],'as':'Contact','attributes':_['keys'](_0x2ed663)}]})['then'](function(_0x6b6c69){var _0x250ca1=[];for(var _0x43f1b1=0x0;_0x43f1b1<_0x6b6c69[_0xd7dd('0x31')];_0x43f1b1+=0x1){_0x250ca1['push'](_0x6b6c69[_0x43f1b1][_0xd7dd('0x27')](_0x43cd47['body'],{'transaction':_0x1d3e69}));}return BPromise[_0xd7dd('0x32')](_0x250ca1);});})['then'](function(_0x1a51b9){logger[_0xd7dd('0xd')]('GetContactDialer',_0x43cd47);logger[_0xd7dd('0x10')](_0xd7dd('0x2b'),_0x43cd47,JSON[_0xd7dd('0x12')](_0x1a51b9));_0x3baa14(_0x1a51b9);})[_0xd7dd('0x1f')](function(_0x4b4bdd){logger[_0xd7dd('0x13')](_0xd7dd('0x2b'),_0x4b4bdd[_0xd7dd('0x15')],_0x43cd47);_0x280038(_0x129755[_0xd7dd('0x13')](0x1f4,_0x4b4bdd[_0xd7dd('0x15')]));});});});};exports[_0xd7dd('0x33')]=function(_0x2e6127){var _0x1f4756=this;return new Promise(function(_0x5798cd,_0x1d70a2){return db[_0xd7dd('0x34')][_0xd7dd('0x35')](function(_0x3c34a9){return db['CmHopperFinal'][_0xd7dd('0x24')](_0x2e6127[_0xd7dd('0x25')],{'raw':_0x2e6127['options']?_0x2e6127['options'][_0xd7dd('0x21')]===undefined?!![]:![]:!![],'transaction':_0x3c34a9})['then'](function(){return db[_0xd7dd('0x18')][_0xd7dd('0x2a')]({'where':_0x2e6127[_0xd7dd('0x1a')]?_0x2e6127['options']['where']||null:null,'transaction':_0x3c34a9});});})[_0xd7dd('0xc')](function(_0x53d7b0){logger[_0xd7dd('0xd')](_0xd7dd('0x33'),_0x2e6127);logger[_0xd7dd('0x10')]('MoveContactManagedDialer',_0x2e6127,JSON[_0xd7dd('0x12')](_0x53d7b0));_0x5798cd(_0x53d7b0);})[_0xd7dd('0x1f')](function(_0x254fee){logger[_0xd7dd('0x13')](_0xd7dd('0x33'),_0x254fee['message'],_0x2e6127);_0x1d70a2(_0x1f4756[_0xd7dd('0x13')](0x1f4,_0x254fee[_0xd7dd('0x15')]));});});};exports[_0xd7dd('0x36')]=function(_0x354b17){var _0x1ae94e=this;return new Promise(function(_0x2035b7,_0x22a86e){return db[_0xd7dd('0x18')][_0xd7dd('0x19')]({'raw':_0x354b17['options']?_0x354b17[_0xd7dd('0x1a')][_0xd7dd('0x21')]===undefined?!![]:![]:!![],'where':_0x354b17[_0xd7dd('0x1a')]?_0x354b17[_0xd7dd('0x1a')][_0xd7dd('0x22')]||null:null,'attributes':[[db[_0xd7dd('0x34')]['fn'](_0xd7dd('0x37'),db[_0xd7dd('0x34')]['fn']('IF',db[_0xd7dd('0x34')][_0xd7dd('0x38')](_0xd7dd('0x39')+util[_0xd7dd('0x3a')](_0xd7dd('0x3b'),moment()[_0xd7dd('0x3a')](_0xd7dd('0x3c')))+_0xd7dd('0x3d')))),_0xd7dd('0x3e')]]})[_0xd7dd('0xc')](function(_0xaa5f78){logger[_0xd7dd('0xd')](_0xd7dd('0x36'),_0x354b17);logger[_0xd7dd('0x10')](_0xd7dd('0x36'),_0x354b17,JSON[_0xd7dd('0x12')](_0xaa5f78));_0x2035b7(_0xaa5f78);})['catch'](function(_0x438bcd){logger[_0xd7dd('0x13')](_0xd7dd('0x36'),_0x438bcd[_0xd7dd('0x15')],_0x354b17);_0x22a86e(_0x1ae94e['error'](0x1f4,_0x438bcd['message']));});});};exports[_0xd7dd('0x3f')]=function(_0x2ead32){var _0x2ae504=this;return new Promise(function(_0xd0ddb8,_0x3a552d){return db[_0xd7dd('0x2c')]['describe']()['then'](function(_0x58151c){return db[_0xd7dd('0x34')][_0xd7dd('0x35')](function(_0x259f16){return db[_0xd7dd('0x18')][_0xd7dd('0x19')]({'where':_0x2ead32['options']?_0x2ead32[_0xd7dd('0x1a')][_0xd7dd('0x22')]||null:null,'attributes':_0x2ead32['options']?_0x2ead32['options'][_0xd7dd('0x1b')]||null:null,'limit':0x1,'order':_0x2ead32[_0xd7dd('0x1a')]?_0x2ead32['options']['order']||null:null,'group':db['CmHopper'][_0xd7dd('0x40')],'transaction':_0x259f16,'lock':_0x259f16[_0xd7dd('0x2f')][_0xd7dd('0x30')],'include':_0x2ead32[_0xd7dd('0x1a')]?_0x2ead32[_0xd7dd('0x1a')][_0xd7dd('0x1c')]?_['map'](_0x2ead32[_0xd7dd('0x1a')][_0xd7dd('0x1c')],function(_0xb71416){return{'model':db[_0xb71416[_0xd7dd('0x1e')]],'as':_0xb71416['as'],'attributes':_0xb71416[_0xd7dd('0x1b')],'include':_0xb71416[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0xb71416['include'],function(_0x3c346e){return{'model':db[_0x3c346e[_0xd7dd('0x1e')]],'as':_0x3c346e['as'],'attributes':_0x3c346e['attributes'],'include':_0x3c346e[_0xd7dd('0x1c')]?_[_0xd7dd('0x1d')](_0x3c346e[_0xd7dd('0x1c')],function(_0x8e52d1){return{'model':db[_0x8e52d1['model']],'as':_0x8e52d1['as'],'attributes':_0x8e52d1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd7dd('0xc')](function(_0x1e8ab2){var _0x5ae544=[];for(var _0x42e469=0x0;_0x42e469<_0x1e8ab2['length'];_0x42e469+=0x1){_0x5ae544[_0xd7dd('0x41')](_0x1e8ab2[_0x42e469]['update'](_0x2ead32[_0xd7dd('0x25')],{'transaction':_0x259f16}));}return BPromise[_0xd7dd('0x32')](_0x5ae544);});})[_0xd7dd('0xc')](function(_0x97d371){logger[_0xd7dd('0xd')](_0xd7dd('0x3f'),_0x2ead32);logger[_0xd7dd('0x10')](_0xd7dd('0x3f'),_0x2ead32,JSON['stringify'](_0x97d371));_0xd0ddb8(_0x97d371);})['catch'](function(_0x31bd1b){logger['error'](_0xd7dd('0x3f'),_0x31bd1b['message'],_0x2ead32);_0x3a552d(_0x2ae504[_0xd7dd('0x13')](0x1f4,_0x31bd1b[_0xd7dd('0x15')]));});});});}; \ No newline at end of file +var _0xcc0e=['include','map','model','debug','ShowCmHopper','CreateCmHopper','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','LOCK','UPDATE','CmContact','Contact','keys','push','all','MoveContactManagedDialer','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UserId','length','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','raw','options','where','attributes','limit'];(function(_0x40c62b,_0x2c2efe){var _0x568cf0=function(_0x5d0c0e){while(--_0x5d0c0e){_0x40c62b['push'](_0x40c62b['shift']());}};_0x568cf0(++_0x2c2efe);}(_0xcc0e,0xa9));var _0xecc0=function(_0x1d3abe,_0x23f68a){_0x1d3abe=_0x1d3abe-0x0;var _0x30939b=_0xcc0e[_0x1d3abe];return _0x30939b;};'use strict';var _=require(_0xecc0('0x0'));var util=require(_0xecc0('0x1'));var moment=require(_0xecc0('0x2'));var BPromise=require(_0xecc0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xecc0('0x4'));var logger=require(_0xecc0('0x5'))(_0xecc0('0x6'));var config=require('../../config/environment');var jayson=require(_0xecc0('0x7'));var client=jayson[_0xecc0('0x8')][_0xecc0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2773c1,_0x3a8de0,_0x358003){return new BPromise(function(_0x462fae,_0xbf5af8){return client[_0xecc0('0xa')](_0x2773c1,_0x358003)[_0xecc0('0xb')](function(_0x48db8e){logger[_0xecc0('0xc')](_0xecc0('0xd'),_0x3a8de0,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x3a8de0,_0xecc0('0xe'),JSON[_0xecc0('0xf')](_0x48db8e));if(_0x48db8e['error']){if(_0x48db8e[_0xecc0('0x10')][_0xecc0('0x11')]===0x1f4){logger[_0xecc0('0x10')](_0xecc0('0xd'),_0x3a8de0,_0x48db8e['error'][_0xecc0('0x12')]);return _0xbf5af8(_0x48db8e[_0xecc0('0x10')]['message']);}logger[_0xecc0('0x10')](_0xecc0('0xd'),_0x3a8de0,_0x48db8e[_0xecc0('0x10')][_0xecc0('0x12')]);return _0x462fae(_0x48db8e[_0xecc0('0x10')][_0xecc0('0x12')]);}else{logger[_0xecc0('0xc')](_0xecc0('0xd'),_0x3a8de0,_0xecc0('0xe'));_0x462fae(_0x48db8e[_0xecc0('0x13')][_0xecc0('0x12')]);}})[_0xecc0('0x14')](function(_0x10b221){logger['error']('CmHopper,\x20%s,\x20%s',_0x3a8de0,_0x10b221);_0xbf5af8(_0x10b221);});});}exports[_0xecc0('0x15')]=function(_0x22c3eb){var _0x11d4d3=this;return new Promise(function(_0x330c55,_0x13d0c1){return db[_0xecc0('0x16')][_0xecc0('0x17')]({'raw':_0x22c3eb['options']?_0x22c3eb['options'][_0xecc0('0x18')]===undefined?!![]:![]:!![],'where':_0x22c3eb['options']?_0x22c3eb[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'attributes':_0x22c3eb['options']?_0x22c3eb['options'][_0xecc0('0x1b')]||null:null,'limit':_0x22c3eb[_0xecc0('0x19')]?_0x22c3eb[_0xecc0('0x19')][_0xecc0('0x1c')]||null:null,'include':_0x22c3eb['options']?_0x22c3eb[_0xecc0('0x19')][_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x22c3eb[_0xecc0('0x19')]['include'],function(_0x75dbad){return{'model':db[_0x75dbad[_0xecc0('0x1f')]],'as':_0x75dbad['as'],'attributes':_0x75dbad['attributes'],'include':_0x75dbad[_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x75dbad[_0xecc0('0x1d')],function(_0x1f3bf8){return{'model':db[_0x1f3bf8[_0xecc0('0x1f')]],'as':_0x1f3bf8['as'],'attributes':_0x1f3bf8['attributes'],'include':_0x1f3bf8['include']?_[_0xecc0('0x1e')](_0x1f3bf8[_0xecc0('0x1d')],function(_0x24bfe4){return{'model':db[_0x24bfe4['model']],'as':_0x24bfe4['as'],'attributes':_0x24bfe4[_0xecc0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xecc0('0xb')](function(_0x53fe32){logger[_0xecc0('0xc')](_0xecc0('0x15'),_0x22c3eb);logger[_0xecc0('0x20')](_0xecc0('0x15'),_0x22c3eb,JSON['stringify'](_0x53fe32));_0x330c55(_0x53fe32);})[_0xecc0('0x14')](function(_0x333be1){logger['error'](_0xecc0('0x15'),_0x333be1[_0xecc0('0x12')],_0x22c3eb);_0x13d0c1(_0x11d4d3['error'](0x1f4,_0x333be1[_0xecc0('0x12')]));});});};exports[_0xecc0('0x21')]=function(_0x1d175c){var _0x18930e=this;return new Promise(function(_0x1bf563,_0x22cf49){return db[_0xecc0('0x16')]['find']({'raw':_0x1d175c['options']?_0x1d175c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d175c[_0xecc0('0x19')]?_0x1d175c[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'attributes':_0x1d175c[_0xecc0('0x19')]?_0x1d175c[_0xecc0('0x19')][_0xecc0('0x1b')]||null:null,'include':_0x1d175c['options']?_0x1d175c[_0xecc0('0x19')][_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x1d175c[_0xecc0('0x19')][_0xecc0('0x1d')],function(_0x288891){return{'model':db[_0x288891[_0xecc0('0x1f')]],'as':_0x288891['as'],'attributes':_0x288891[_0xecc0('0x1b')],'include':_0x288891[_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x288891[_0xecc0('0x1d')],function(_0x6e7c5){return{'model':db[_0x6e7c5[_0xecc0('0x1f')]],'as':_0x6e7c5['as'],'attributes':_0x6e7c5[_0xecc0('0x1b')],'include':_0x6e7c5['include']?_[_0xecc0('0x1e')](_0x6e7c5[_0xecc0('0x1d')],function(_0x20a6ef){return{'model':db[_0x20a6ef['model']],'as':_0x20a6ef['as'],'attributes':_0x20a6ef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24924c){logger[_0xecc0('0xc')]('ShowCmHopper',_0x1d175c);logger['debug'](_0xecc0('0x21'),_0x1d175c,JSON['stringify'](_0x24924c));_0x1bf563(_0x24924c);})[_0xecc0('0x14')](function(_0x2e1a7e){logger['error'](_0xecc0('0x21'),_0x2e1a7e['message'],_0x1d175c);_0x22cf49(_0x18930e[_0xecc0('0x10')](0x1f4,_0x2e1a7e[_0xecc0('0x12')]));});});};exports[_0xecc0('0x22')]=function(_0x3b228e){var _0x3a92e5=this;return new Promise(function(_0x30fd5f,_0xc6d029){return db['CmHopper']['create'](_0x3b228e[_0xecc0('0x23')],{'raw':_0x3b228e[_0xecc0('0x19')]?_0x3b228e[_0xecc0('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xecc0('0xb')](function(_0x50b734){logger['info']('CreateCmHopper',_0x3b228e);logger[_0xecc0('0x20')]('CreateCmHopper',_0x3b228e,JSON[_0xecc0('0xf')](_0x50b734));_0x30fd5f(_0x50b734);})[_0xecc0('0x14')](function(_0x17f906){logger[_0xecc0('0x10')](_0xecc0('0x22'),_0x17f906['message'],_0x3b228e);_0xc6d029(_0x3a92e5[_0xecc0('0x10')](0x1f4,_0x17f906[_0xecc0('0x12')]));});});};exports['UpdateCmHopper']=function(_0x38cc32){var _0x3859d4=this;return new Promise(function(_0x47e815,_0x2cc390){return db['CmHopper'][_0xecc0('0x24')](_0x38cc32[_0xecc0('0x23')],{'raw':_0x38cc32['options']?_0x38cc32[_0xecc0('0x19')][_0xecc0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38cc32[_0xecc0('0x19')]?_0x38cc32[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'attributes':_0x38cc32[_0xecc0('0x19')]?_0x38cc32[_0xecc0('0x19')][_0xecc0('0x1b')]||null:null,'limit':_0x38cc32[_0xecc0('0x19')]?_0x38cc32[_0xecc0('0x19')]['limit']||null:null})['then'](function(_0x30c57c){logger[_0xecc0('0xc')](_0xecc0('0x25'),_0x38cc32);logger[_0xecc0('0x20')](_0xecc0('0x25'),_0x38cc32,JSON[_0xecc0('0xf')](_0x30c57c));_0x47e815(_0x30c57c);})[_0xecc0('0x14')](function(_0x2e028d){logger[_0xecc0('0x10')](_0xecc0('0x25'),_0x2e028d[_0xecc0('0x12')],_0x38cc32);_0x2cc390(_0x3859d4['error'](0x1f4,_0x2e028d[_0xecc0('0x12')]));});});};exports[_0xecc0('0x26')]=function(_0x4a3be5){var _0x3e8aa1=this;return new Promise(function(_0x263967,_0x3d0733){return db[_0xecc0('0x16')][_0xecc0('0x27')]({'where':_0x4a3be5[_0xecc0('0x19')]?_0x4a3be5['options'][_0xecc0('0x1a')]||null:null})[_0xecc0('0xb')](function(_0x282432){logger[_0xecc0('0xc')]('DestroyCmHopper',_0x4a3be5);logger[_0xecc0('0x20')](_0xecc0('0x26'),_0x4a3be5,JSON[_0xecc0('0xf')](_0x282432));_0x263967(_0x282432);})[_0xecc0('0x14')](function(_0x1fdec0){logger[_0xecc0('0x10')]('DestroyCmHopper',_0x1fdec0[_0xecc0('0x12')],_0x4a3be5);_0x3d0733(_0x3e8aa1[_0xecc0('0x10')](0x1f4,_0x1fdec0[_0xecc0('0x12')]));});});};exports[_0xecc0('0x28')]=function(_0x4a1466){var _0x1a59bb=this;return new Promise(function(_0x56e5fb,_0x5e23ba){return db['CmContact'][_0xecc0('0x29')]()['then'](function(_0x425465){return db[_0xecc0('0x2a')][_0xecc0('0x2b')](function(_0x5cc730){return db[_0xecc0('0x16')][_0xecc0('0x17')]({'where':_0x4a1466[_0xecc0('0x19')]?_0x4a1466[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'attributes':_0x4a1466['options']?_0x4a1466[_0xecc0('0x19')][_0xecc0('0x1b')]||null:null,'limit':_0x4a1466[_0xecc0('0x19')]?_0x4a1466[_0xecc0('0x19')][_0xecc0('0x1c')]||null:null,'order':_0x4a1466[_0xecc0('0x19')]?_0x4a1466['options']['order']||null:null,'transaction':_0x5cc730,'lock':_0x5cc730[_0xecc0('0x2c')][_0xecc0('0x2d')],'include':[{'model':db[_0xecc0('0x2e')],'as':_0xecc0('0x2f'),'attributes':_[_0xecc0('0x30')](_0x425465)}]})[_0xecc0('0xb')](function(_0x38d7c){var _0x3f89e5=[];for(var _0x3761cb=0x0;_0x3761cb<_0x38d7c['length'];_0x3761cb+=0x1){_0x3f89e5[_0xecc0('0x31')](_0x38d7c[_0x3761cb][_0xecc0('0x24')](_0x4a1466[_0xecc0('0x23')],{'transaction':_0x5cc730}));}return BPromise[_0xecc0('0x32')](_0x3f89e5);});})[_0xecc0('0xb')](function(_0x3ae39a){logger[_0xecc0('0xc')](_0xecc0('0x28'),_0x4a1466);logger[_0xecc0('0x20')](_0xecc0('0x28'),_0x4a1466,JSON[_0xecc0('0xf')](_0x3ae39a));_0x56e5fb(_0x3ae39a);})[_0xecc0('0x14')](function(_0x493304){logger[_0xecc0('0x10')](_0xecc0('0x28'),_0x493304[_0xecc0('0x12')],_0x4a1466);_0x5e23ba(_0x1a59bb[_0xecc0('0x10')](0x1f4,_0x493304['message']));});});});};exports[_0xecc0('0x33')]=function(_0x2bfac1){var _0xf2f7c=this;return new Promise(function(_0x37a517,_0xab4e){return db[_0xecc0('0x2a')]['transaction'](function(_0x5089a8){return db['CmHopperFinal'][_0xecc0('0x34')](_0x2bfac1[_0xecc0('0x23')],{'raw':_0x2bfac1[_0xecc0('0x19')]?_0x2bfac1['options'][_0xecc0('0x18')]===undefined?!![]:![]:!![],'transaction':_0x5089a8})[_0xecc0('0xb')](function(){return db[_0xecc0('0x16')]['destroy']({'where':_0x2bfac1['options']?_0x2bfac1[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'transaction':_0x5089a8});});})[_0xecc0('0xb')](function(_0x29f200){logger[_0xecc0('0xc')](_0xecc0('0x33'),_0x2bfac1);logger['debug'](_0xecc0('0x33'),_0x2bfac1,JSON[_0xecc0('0xf')](_0x29f200));_0x37a517(_0x29f200);})[_0xecc0('0x14')](function(_0x99e6fc){logger[_0xecc0('0x10')](_0xecc0('0x33'),_0x99e6fc[_0xecc0('0x12')],_0x2bfac1);_0xab4e(_0xf2f7c[_0xecc0('0x10')](0x1f4,_0x99e6fc[_0xecc0('0x12')]));});});};exports[_0xecc0('0x35')]=function(_0x1810ff){var _0x2d8168=this;return new Promise(function(_0x3000c6,_0x36f712){return db[_0xecc0('0x16')][_0xecc0('0x17')]({'raw':_0x1810ff['options']?_0x1810ff[_0xecc0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1810ff[_0xecc0('0x19')]?_0x1810ff['options'][_0xecc0('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0xecc0('0x36'),db[_0xecc0('0x2a')]['fn']('IF',db['sequelize'][_0xecc0('0x37')](_0xecc0('0x38')+util['format'](_0xecc0('0x39'),moment()[_0xecc0('0x3a')](_0xecc0('0x3b')))+_0xecc0('0x3c')))),_0xecc0('0x3d')]]})['then'](function(_0x8fb11b){logger['info'](_0xecc0('0x35'),_0x1810ff);logger[_0xecc0('0x20')](_0xecc0('0x35'),_0x1810ff,JSON[_0xecc0('0xf')](_0x8fb11b));_0x3000c6(_0x8fb11b);})[_0xecc0('0x14')](function(_0x306852){logger[_0xecc0('0x10')](_0xecc0('0x35'),_0x306852['message'],_0x1810ff);_0x36f712(_0x2d8168['error'](0x1f4,_0x306852['message']));});});};exports[_0xecc0('0x3e')]=function(_0x12ef6a){var _0x4f5171=this;return new Promise(function(_0x44c7c8,_0x2602ec){return db[_0xecc0('0x2e')][_0xecc0('0x29')]()[_0xecc0('0xb')](function(_0xd84d80){return db[_0xecc0('0x2a')][_0xecc0('0x2b')](function(_0x3d922b){return db[_0xecc0('0x16')][_0xecc0('0x17')]({'where':_0x12ef6a['options']?_0x12ef6a[_0xecc0('0x19')][_0xecc0('0x1a')]||null:null,'attributes':_0x12ef6a[_0xecc0('0x19')]?_0x12ef6a[_0xecc0('0x19')][_0xecc0('0x1b')]||null:null,'limit':0x1,'order':_0x12ef6a['options']?_0x12ef6a['options'][_0xecc0('0x3f')]||null:null,'group':db['CmHopper'][_0xecc0('0x40')],'transaction':_0x3d922b,'lock':_0x3d922b[_0xecc0('0x2c')][_0xecc0('0x2d')],'include':_0x12ef6a[_0xecc0('0x19')]?_0x12ef6a[_0xecc0('0x19')][_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x12ef6a[_0xecc0('0x19')][_0xecc0('0x1d')],function(_0x35c1ca){return{'model':db[_0x35c1ca['model']],'as':_0x35c1ca['as'],'attributes':_0x35c1ca[_0xecc0('0x1b')],'include':_0x35c1ca[_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x35c1ca[_0xecc0('0x1d')],function(_0x1130c0){return{'model':db[_0x1130c0[_0xecc0('0x1f')]],'as':_0x1130c0['as'],'attributes':_0x1130c0[_0xecc0('0x1b')],'include':_0x1130c0[_0xecc0('0x1d')]?_[_0xecc0('0x1e')](_0x1130c0[_0xecc0('0x1d')],function(_0x6fa2f){return{'model':db[_0x6fa2f[_0xecc0('0x1f')]],'as':_0x6fa2f['as'],'attributes':_0x6fa2f[_0xecc0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xecc0('0xb')](function(_0x1a1b1f){var _0x158fdc=[];for(var _0x378f3c=0x0;_0x378f3c<_0x1a1b1f[_0xecc0('0x41')];_0x378f3c+=0x1){_0x158fdc['push'](_0x1a1b1f[_0x378f3c][_0xecc0('0x24')](_0x12ef6a[_0xecc0('0x23')],{'transaction':_0x3d922b}));}return BPromise[_0xecc0('0x32')](_0x158fdc);});})[_0xecc0('0xb')](function(_0x170102){logger[_0xecc0('0xc')](_0xecc0('0x3e'),_0x12ef6a);logger[_0xecc0('0x20')](_0xecc0('0x3e'),_0x12ef6a,JSON[_0xecc0('0xf')](_0x170102));_0x44c7c8(_0x170102);})[_0xecc0('0x14')](function(_0x26c2c1){logger['error'](_0xecc0('0x3e'),_0x26c2c1[_0xecc0('0x12')],_0x12ef6a);_0x2602ec(_0x4f5171[_0xecc0('0x10')](0x1f4,_0x26c2c1[_0xecc0('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index f1415f3..9ac88ec 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 _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 324711b..c681841 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 _0xb695=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x2c3a19,_0x28652a){var _0x35111a=function(_0x5227bb){while(--_0x5227bb){_0x2c3a19['push'](_0x2c3a19['shift']());}};_0x35111a(++_0x28652a);}(_0xb695,0x7c));var _0x5b69=function(_0x5b897e,_0x23a626){_0x5b897e=_0x5b897e-0x0;var _0x16aa7e=_0xb695[_0x5b897e];return _0x16aa7e;};'use strict';var moment=require(_0x5b69('0x0'));var Sequelize=require(_0x5b69('0x1'));module['exports']={'phone':{'type':Sequelize[_0x5b69('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5b69('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5b69('0x3')],'unique':_0x5b69('0x4')},'VoiceQueueId':{'type':Sequelize[_0x5b69('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x23d3=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x23d3,0x89));var _0x323d=function(_0x16d1b5,_0xec42f6){_0x16d1b5=_0x16d1b5-0x0;var _0x481f6d=_0x23d3[_0x16d1b5];return _0x481f6d;};'use strict';var moment=require(_0x323d('0x0'));var Sequelize=require(_0x323d('0x1'));module[_0x323d('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x323d('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x323d('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x323d('0x3')],'unique':_0x323d('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 0d8afa8..4caf9b4 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 _0x1bbe=['destroy','then','error','name','send','CmHopperBlack','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','body','describe','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1bbe,0x18a));var _0xe1bb=function(_0x10edeb,_0x1b93b8){_0x10edeb=_0x10edeb-0x0;var _0x1c5fea=_0x1bbe[_0x10edeb];return _0x1c5fea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe1bb('0x0'));var rimraf=require(_0xe1bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1bb('0x2'));var Mustache=require(_0xe1bb('0x3'));var util=require(_0xe1bb('0x4'));var path=require(_0xe1bb('0x5'));var sox=require('sox');var csv=require(_0xe1bb('0x6'));var ejs=require(_0xe1bb('0x7'));var fs=require('fs');var _=require(_0xe1bb('0x8'));var squel=require('squel');var crypto=require(_0xe1bb('0x9'));var jsforce=require(_0xe1bb('0xa'));var deskjs=require(_0xe1bb('0xb'));var toCsv=require(_0xe1bb('0x6'));var querystring=require('querystring');var Papa=require(_0xe1bb('0xc'));var Redis=require(_0xe1bb('0xd'));var authService=require(_0xe1bb('0xe'));var qs=require(_0xe1bb('0xf'));var hardwareService=require(_0xe1bb('0x10'));var logger=require(_0xe1bb('0x11'))(_0xe1bb('0x12'));var utils=require(_0xe1bb('0x13'));var config=require(_0xe1bb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29452f,_0x11c293){_0x11c293=_0x11c293||0xcc;return function(_0x42f43f){if(_0x42f43f){return _0x29452f[_0xe1bb('0x15')](_0x11c293);}return _0x29452f[_0xe1bb('0x16')](_0x11c293)[_0xe1bb('0x17')]();};}function respondWithResult(_0x2bdd47,_0x3a09c5){_0x3a09c5=_0x3a09c5||0xc8;return function(_0x304d91){if(_0x304d91){return _0x2bdd47[_0xe1bb('0x16')](_0x3a09c5)[_0xe1bb('0x18')](_0x304d91);}};}function respondWithFilteredResult(_0x49e3ec,_0x495906){return function(_0x40fd81){if(_0x40fd81){var _0x4a0ac2=_0x40fd81['count'],_0x52d56e=_0x495906[_0xe1bb('0x19')],_0xe78b56=_0x495906[_0xe1bb('0x19')]+_0x495906[_0xe1bb('0x1a')],_0x473a8d;if(_0xe78b56>=_0x4a0ac2){_0xe78b56=_0x4a0ac2;_0x473a8d=0xc8;}else{_0x473a8d=0xce;}_0x49e3ec[_0xe1bb('0x16')](_0x473a8d);return _0x49e3ec[_0xe1bb('0x1b')](_0xe1bb('0x1c'),_0x52d56e+'-'+_0xe78b56+'/'+_0x4a0ac2)[_0xe1bb('0x18')](_0x40fd81);}return null;};}function patchUpdates(_0x1e93f4){return function(_0x2250ad){try{jsonpatch['apply'](_0x2250ad,_0x1e93f4,!![]);}catch(_0x3f490b){return BPromise[_0xe1bb('0x1d')](_0x3f490b);}return _0x2250ad[_0xe1bb('0x1e')]();};}function saveUpdates(_0x5f4d1e,_0x4a73ef){return function(_0x206e18){if(_0x206e18){return _0x206e18[_0xe1bb('0x1f')](_0x5f4d1e)['then'](function(_0x24df78){return _0x24df78;});}return null;};}function removeEntity(_0x2668d2,_0x27467d){return function(_0x4df13c){if(_0x4df13c){return _0x4df13c[_0xe1bb('0x20')]()[_0xe1bb('0x21')](function(){_0x2668d2[_0xe1bb('0x16')](0xcc)[_0xe1bb('0x17')]();});}};}function handleEntityNotFound(_0x31addf,_0x3530e0){return function(_0xcd9eca){if(!_0xcd9eca){_0x31addf[_0xe1bb('0x15')](0x194);}return _0xcd9eca;};}function handleError(_0x33b506,_0x526e0c){_0x526e0c=_0x526e0c||0x1f4;return function(_0x22bef7){logger[_0xe1bb('0x22')](_0x22bef7['stack']);if(_0x22bef7[_0xe1bb('0x23')]){delete _0x22bef7['name'];}_0x33b506[_0xe1bb('0x16')](_0x526e0c)[_0xe1bb('0x24')](_0x22bef7);};}exports['index']=function(_0x4f13d6,_0x3b991d){var _0x173134={},_0x11fc25={},_0x722479={'count':0x0,'rows':[]};var _0x1612d4=db[_0xe1bb('0x25')][_0xe1bb('0x26')];_0x11fc25[_0xe1bb('0x27')]=_['keys'](_0x1612d4);_0x11fc25[_0xe1bb('0x28')]=_[_0xe1bb('0x29')](_0x4f13d6[_0xe1bb('0x28')]);_0x11fc25[_0xe1bb('0x2a')]=_[_0xe1bb('0x2b')](_0x11fc25[_0xe1bb('0x27')],_0x11fc25[_0xe1bb('0x28')]);_0x173134[_0xe1bb('0x2c')]=_[_0xe1bb('0x2b')](_0x11fc25[_0xe1bb('0x27')],qs[_0xe1bb('0x2d')](_0x4f13d6[_0xe1bb('0x28')][_0xe1bb('0x2d')]));_0x173134[_0xe1bb('0x2c')]=_0x173134[_0xe1bb('0x2c')]['length']?_0x173134[_0xe1bb('0x2c')]:_0x11fc25[_0xe1bb('0x27')];if(!_0x4f13d6['query'][_0xe1bb('0x2e')](_0xe1bb('0x2f'))){_0x173134[_0xe1bb('0x1a')]=qs['limit'](_0x4f13d6[_0xe1bb('0x28')][_0xe1bb('0x1a')]);_0x173134['offset']=qs[_0xe1bb('0x19')](_0x4f13d6[_0xe1bb('0x28')]['offset']);}_0x173134[_0xe1bb('0x30')]=qs['sort'](_0x4f13d6[_0xe1bb('0x28')][_0xe1bb('0x31')]);_0x173134['where']=qs[_0xe1bb('0x2a')](_[_0xe1bb('0x32')](_0x4f13d6[_0xe1bb('0x28')],_0x11fc25[_0xe1bb('0x2a')]));if(_0x4f13d6[_0xe1bb('0x28')]['filter']){_0x173134[_0xe1bb('0x33')]=_[_0xe1bb('0x34')](_0x173134['where'],{'$or':_[_0xe1bb('0x35')](_0x1612d4,function(_0x2c4fa6){if(_0x2c4fa6['type'][_0xe1bb('0x36')]!==_0xe1bb('0x37')){var _0x24a9e6={};_0x24a9e6[_0x2c4fa6[_0xe1bb('0x38')]]={'$like':'%'+_0x4f13d6['query'][_0xe1bb('0x39')]+'%'};return _0x24a9e6;}})});}_0x173134=_[_0xe1bb('0x34')]({},_0x173134,_0x4f13d6[_0xe1bb('0x3a')]);var _0x1a46d0={'where':_0x173134[_0xe1bb('0x33')]};return db[_0xe1bb('0x25')]['count'](_0x1a46d0)[_0xe1bb('0x21')](function(_0x3d54ce){_0x722479[_0xe1bb('0x3b')]=_0x3d54ce;if(_0x4f13d6['query'][_0xe1bb('0x3c')]){_0x173134[_0xe1bb('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe1bb('0x3e')](_0x173134);})[_0xe1bb('0x21')](function(_0x581fdd){_0x722479[_0xe1bb('0x3f')]=_0x581fdd;return _0x722479;})[_0xe1bb('0x21')](respondWithFilteredResult(_0x3b991d,_0x173134))[_0xe1bb('0x40')](handleError(_0x3b991d,null));};exports[_0xe1bb('0x41')]=function(_0x291532,_0x54053c){var _0x150181={'raw':!![],'where':{'id':_0x291532[_0xe1bb('0x42')]['id']}},_0x2bd7e5={};_0x2bd7e5[_0xe1bb('0x27')]=_[_0xe1bb('0x29')](db[_0xe1bb('0x25')][_0xe1bb('0x26')]);_0x2bd7e5[_0xe1bb('0x28')]=_[_0xe1bb('0x29')](_0x291532[_0xe1bb('0x28')]);_0x2bd7e5[_0xe1bb('0x2a')]=_[_0xe1bb('0x2b')](_0x2bd7e5['model'],_0x2bd7e5[_0xe1bb('0x28')]);_0x150181['attributes']=_[_0xe1bb('0x2b')](_0x2bd7e5[_0xe1bb('0x27')],qs[_0xe1bb('0x2d')](_0x291532[_0xe1bb('0x28')][_0xe1bb('0x2d')]));_0x150181[_0xe1bb('0x2c')]=_0x150181[_0xe1bb('0x2c')][_0xe1bb('0x43')]?_0x150181[_0xe1bb('0x2c')]:_0x2bd7e5[_0xe1bb('0x27')];if(_0x291532[_0xe1bb('0x28')][_0xe1bb('0x3c')]){_0x150181[_0xe1bb('0x3d')]=[{'all':!![]}];}_0x150181=_['merge']({},_0x150181,_0x291532[_0xe1bb('0x3a')]);return db['CmHopperBlack'][_0xe1bb('0x44')](_0x150181)[_0xe1bb('0x21')](handleEntityNotFound(_0x54053c,null))['then'](respondWithResult(_0x54053c,null))[_0xe1bb('0x40')](handleError(_0x54053c,null));};exports[_0xe1bb('0x1f')]=function(_0x531ddb,_0x123694){if(_0x531ddb[_0xe1bb('0x45')]['id']){delete _0x531ddb[_0xe1bb('0x45')]['id'];}return db[_0xe1bb('0x25')]['find']({'where':{'id':_0x531ddb[_0xe1bb('0x42')]['id']}})[_0xe1bb('0x21')](handleEntityNotFound(_0x123694,null))[_0xe1bb('0x21')](saveUpdates(_0x531ddb[_0xe1bb('0x45')],null))[_0xe1bb('0x21')](respondWithResult(_0x123694,null))['catch'](handleError(_0x123694,null));};exports[_0xe1bb('0x20')]=function(_0x41ab48,_0x4370b1){return db['CmHopperBlack'][_0xe1bb('0x44')]({'where':{'id':_0x41ab48[_0xe1bb('0x42')]['id']}})[_0xe1bb('0x21')](handleEntityNotFound(_0x4370b1,null))[_0xe1bb('0x21')](removeEntity(_0x4370b1,null))[_0xe1bb('0x40')](handleError(_0x4370b1,null));};exports['describe']=function(_0x3a5dfa,_0x4b9041){return db[_0xe1bb('0x25')][_0xe1bb('0x46')]()[_0xe1bb('0x21')](respondWithResult(_0x4b9041,null))['catch'](handleError(_0x4b9041,null));}; \ No newline at end of file +var _0xc094=['path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','reject','then','end','sendStatus','error','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x3eb4e4,_0xc3e6da){var _0x53cded=function(_0x4794e9){while(--_0x4794e9){_0x3eb4e4['push'](_0x3eb4e4['shift']());}};_0x53cded(++_0xc3e6da);}(_0xc094,0x196));var _0x4c09=function(_0x258802,_0x253d57){_0x258802=_0x258802-0x0;var _0x2d3222=_0xc094[_0x258802];return _0x2d3222;};'use strict';var pdf=require(_0x4c09('0x0'));var emlformat=require(_0x4c09('0x1'));var rimraf=require(_0x4c09('0x2'));var zipdir=require(_0x4c09('0x3'));var jsonpatch=require(_0x4c09('0x4'));var rp=require('request-promise');var moment=require(_0x4c09('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4c09('0x6'));var util=require(_0x4c09('0x7'));var path=require(_0x4c09('0x8'));var sox=require(_0x4c09('0x9'));var csv=require('to-csv');var ejs=require(_0x4c09('0xa'));var fs=require('fs');var _=require(_0x4c09('0xb'));var squel=require('squel');var crypto=require(_0x4c09('0xc'));var jsforce=require(_0x4c09('0xd'));var deskjs=require(_0x4c09('0xe'));var toCsv=require(_0x4c09('0xf'));var querystring=require('querystring');var Papa=require(_0x4c09('0x10'));var Redis=require(_0x4c09('0x11'));var authService=require(_0x4c09('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c09('0x13'))(_0x4c09('0x14'));var utils=require(_0x4c09('0x15'));var config=require(_0x4c09('0x16'));var db=require(_0x4c09('0x17'))['db'];function respondWithStatusCode(_0x35577f,_0x9a5dfb){_0x9a5dfb=_0x9a5dfb||0xcc;return function(_0x2e7cc8){if(_0x2e7cc8){return _0x35577f['sendStatus'](_0x9a5dfb);}return _0x35577f[_0x4c09('0x18')](_0x9a5dfb)['end']();};}function respondWithResult(_0x345916,_0x3c5de3){_0x3c5de3=_0x3c5de3||0xc8;return function(_0x21829c){if(_0x21829c){return _0x345916[_0x4c09('0x18')](_0x3c5de3)[_0x4c09('0x19')](_0x21829c);}};}function respondWithFilteredResult(_0x5ed01f,_0x345099){return function(_0xa5a03){if(_0xa5a03){var _0x439196=_0xa5a03['count'],_0x1b5de4=_0x345099[_0x4c09('0x1a')],_0x252d21=_0x345099[_0x4c09('0x1a')]+_0x345099[_0x4c09('0x1b')],_0x1fe407;if(_0x252d21>=_0x439196){_0x252d21=_0x439196;_0x1fe407=0xc8;}else{_0x1fe407=0xce;}_0x5ed01f[_0x4c09('0x18')](_0x1fe407);return _0x5ed01f[_0x4c09('0x1c')]('Content-Range',_0x1b5de4+'-'+_0x252d21+'/'+_0x439196)[_0x4c09('0x19')](_0xa5a03);}return null;};}function patchUpdates(_0x399a7b){return function(_0x23db44){try{jsonpatch['apply'](_0x23db44,_0x399a7b,!![]);}catch(_0x4a6c32){return BPromise[_0x4c09('0x1d')](_0x4a6c32);}return _0x23db44['save']();};}function saveUpdates(_0x246945,_0x3ad0d2){return function(_0x414c34){if(_0x414c34){return _0x414c34['update'](_0x246945)[_0x4c09('0x1e')](function(_0x3621cf){return _0x3621cf;});}return null;};}function removeEntity(_0x50e394,_0x439d29){return function(_0x55c0c0){if(_0x55c0c0){return _0x55c0c0['destroy']()[_0x4c09('0x1e')](function(){_0x50e394[_0x4c09('0x18')](0xcc)[_0x4c09('0x1f')]();});}};}function handleEntityNotFound(_0x2952d5,_0x56fd91){return function(_0x31c309){if(!_0x31c309){_0x2952d5[_0x4c09('0x20')](0x194);}return _0x31c309;};}function handleError(_0x469c2a,_0xcf0663){_0xcf0663=_0xcf0663||0x1f4;return function(_0x9468cc){logger[_0x4c09('0x21')](_0x9468cc['stack']);if(_0x9468cc['name']){delete _0x9468cc[_0x4c09('0x22')];}_0x469c2a[_0x4c09('0x18')](_0xcf0663)[_0x4c09('0x23')](_0x9468cc);};}exports[_0x4c09('0x24')]=function(_0x24a76c,_0xc4382c){var _0x4ca924={},_0x1dfe04={},_0x15a03c={'count':0x0,'rows':[]};var _0x2345a0=db[_0x4c09('0x25')][_0x4c09('0x26')];_0x1dfe04[_0x4c09('0x27')]=_[_0x4c09('0x28')](_0x2345a0);_0x1dfe04['query']=_[_0x4c09('0x28')](_0x24a76c[_0x4c09('0x29')]);_0x1dfe04[_0x4c09('0x2a')]=_[_0x4c09('0x2b')](_0x1dfe04['model'],_0x1dfe04['query']);_0x4ca924[_0x4c09('0x2c')]=_[_0x4c09('0x2b')](_0x1dfe04[_0x4c09('0x27')],qs[_0x4c09('0x2d')](_0x24a76c[_0x4c09('0x29')]['fields']));_0x4ca924[_0x4c09('0x2c')]=_0x4ca924[_0x4c09('0x2c')]['length']?_0x4ca924[_0x4c09('0x2c')]:_0x1dfe04[_0x4c09('0x27')];if(!_0x24a76c[_0x4c09('0x29')][_0x4c09('0x2e')]('nolimit')){_0x4ca924['limit']=qs[_0x4c09('0x1b')](_0x24a76c[_0x4c09('0x29')][_0x4c09('0x1b')]);_0x4ca924[_0x4c09('0x1a')]=qs[_0x4c09('0x1a')](_0x24a76c[_0x4c09('0x29')][_0x4c09('0x1a')]);}_0x4ca924[_0x4c09('0x2f')]=qs[_0x4c09('0x30')](_0x24a76c['query']['sort']);_0x4ca924['where']=qs[_0x4c09('0x2a')](_[_0x4c09('0x31')](_0x24a76c['query'],_0x1dfe04['filters']));if(_0x24a76c[_0x4c09('0x29')][_0x4c09('0x32')]){_0x4ca924[_0x4c09('0x33')]=_[_0x4c09('0x34')](_0x4ca924[_0x4c09('0x33')],{'$or':_[_0x4c09('0x35')](_0x2345a0,function(_0xf84db9){if(_0xf84db9[_0x4c09('0x36')]['key']!==_0x4c09('0x37')){var _0x5795f2={};_0x5795f2[_0xf84db9[_0x4c09('0x38')]]={'$like':'%'+_0x24a76c[_0x4c09('0x29')][_0x4c09('0x32')]+'%'};return _0x5795f2;}})});}_0x4ca924=_['merge']({},_0x4ca924,_0x24a76c[_0x4c09('0x39')]);var _0x20360f={'where':_0x4ca924['where']};return db[_0x4c09('0x25')][_0x4c09('0x3a')](_0x20360f)['then'](function(_0x49cea6){_0x15a03c[_0x4c09('0x3a')]=_0x49cea6;if(_0x24a76c['query'][_0x4c09('0x3b')]){_0x4ca924[_0x4c09('0x3c')]=[{'all':!![]}];}return db[_0x4c09('0x25')][_0x4c09('0x3d')](_0x4ca924);})['then'](function(_0x3e95d6){_0x15a03c[_0x4c09('0x3e')]=_0x3e95d6;return _0x15a03c;})[_0x4c09('0x1e')](respondWithFilteredResult(_0xc4382c,_0x4ca924))[_0x4c09('0x3f')](handleError(_0xc4382c,null));};exports[_0x4c09('0x40')]=function(_0x3564d7,_0x5d0f93){var _0x4e400b={'raw':!![],'where':{'id':_0x3564d7['params']['id']}},_0xb1838a={};_0xb1838a[_0x4c09('0x27')]=_[_0x4c09('0x28')](db['CmHopperBlack']['rawAttributes']);_0xb1838a['query']=_[_0x4c09('0x28')](_0x3564d7[_0x4c09('0x29')]);_0xb1838a[_0x4c09('0x2a')]=_[_0x4c09('0x2b')](_0xb1838a[_0x4c09('0x27')],_0xb1838a[_0x4c09('0x29')]);_0x4e400b['attributes']=_['intersection'](_0xb1838a['model'],qs['fields'](_0x3564d7[_0x4c09('0x29')][_0x4c09('0x2d')]));_0x4e400b[_0x4c09('0x2c')]=_0x4e400b[_0x4c09('0x2c')]['length']?_0x4e400b[_0x4c09('0x2c')]:_0xb1838a['model'];if(_0x3564d7[_0x4c09('0x29')][_0x4c09('0x3b')]){_0x4e400b[_0x4c09('0x3c')]=[{'all':!![]}];}_0x4e400b=_['merge']({},_0x4e400b,_0x3564d7[_0x4c09('0x39')]);return db[_0x4c09('0x25')][_0x4c09('0x41')](_0x4e400b)[_0x4c09('0x1e')](handleEntityNotFound(_0x5d0f93,null))[_0x4c09('0x1e')](respondWithResult(_0x5d0f93,null))[_0x4c09('0x3f')](handleError(_0x5d0f93,null));};exports['update']=function(_0x59fef6,_0x4591a5){if(_0x59fef6['body']['id']){delete _0x59fef6[_0x4c09('0x42')]['id'];}return db[_0x4c09('0x25')][_0x4c09('0x41')]({'where':{'id':_0x59fef6[_0x4c09('0x43')]['id']}})[_0x4c09('0x1e')](handleEntityNotFound(_0x4591a5,null))['then'](saveUpdates(_0x59fef6['body'],null))[_0x4c09('0x1e')](respondWithResult(_0x4591a5,null))[_0x4c09('0x3f')](handleError(_0x4591a5,null));};exports['destroy']=function(_0x10927c,_0x1af69a){return db[_0x4c09('0x25')]['find']({'where':{'id':_0x10927c[_0x4c09('0x43')]['id']}})['then'](handleEntityNotFound(_0x1af69a,null))['then'](removeEntity(_0x1af69a,null))['catch'](handleError(_0x1af69a,null));};exports[_0x4c09('0x44')]=function(_0x142d2f,_0x2785fe){return db[_0x4c09('0x25')]['describe']()[_0x4c09('0x1e')](respondWithResult(_0x2785fe,null))[_0x4c09('0x3f')](handleError(_0x2785fe,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index aab3304..781b0c1 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 _0x008c=['define','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x008c,0x188));var _0xc008=function(_0x15d9bc,_0x513b46){_0x15d9bc=_0x15d9bc-0x0;var _0x5868fe=_0x008c[_0x15d9bc];return _0x5868fe;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('CmHopperBlack',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack'];(function(_0xceefd6,_0x50c3bd){var _0x1404bf=function(_0x2390ba){while(--_0x2390ba){_0xceefd6['push'](_0xceefd6['shift']());}};_0x1404bf(++_0x50c3bd);}(_0x34e8,0x12c));var _0x834e=function(_0x5e59e5,_0xa845fb){_0x5e59e5=_0x5e59e5-0x0;var _0x5f1850=_0x34e8[_0x5e59e5];return _0x5f1850;};'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/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index ab6aad6..6243f0a 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 _0xd2a4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','map','model','update','limit','UpdateCmHopperBlack','catch','destroy','DestroyCmHopperBlack','lodash'];(function(_0x315759,_0x34b3c2){var _0x9a8fa7=function(_0x2a2d85){while(--_0x2a2d85){_0x315759['push'](_0x315759['shift']());}};_0x9a8fa7(++_0x34b3c2);}(_0xd2a4,0x1bb));var _0x4d2a=function(_0x5a7574,_0x1f9463){_0x5a7574=_0x5a7574-0x0;var _0x4301b1=_0xd2a4[_0x5a7574];return _0x4301b1;};'use strict';var _=require(_0x4d2a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d2a('0x1'));var rs=require(_0x4d2a('0x2'));var fs=require('fs');var Redis=require(_0x4d2a('0x3'));var db=require(_0x4d2a('0x4'))['db'];var utils=require(_0x4d2a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4d2a('0x6'));var jayson=require(_0x4d2a('0x7'));var client=jayson['client'][_0x4d2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x356053,_0x383a3b,_0x2884ba){return new BPromise(function(_0x49729a,_0x37e6bc){return client[_0x4d2a('0x9')](_0x356053,_0x2884ba)[_0x4d2a('0xa')](function(_0x3ef779){logger['info'](_0x4d2a('0xb'),_0x383a3b,_0x4d2a('0xc'));logger[_0x4d2a('0xd')](_0x4d2a('0xe'),_0x383a3b,_0x4d2a('0xc'),JSON[_0x4d2a('0xf')](_0x3ef779));if(_0x3ef779[_0x4d2a('0x10')]){if(_0x3ef779[_0x4d2a('0x10')][_0x4d2a('0x11')]===0x1f4){logger[_0x4d2a('0x10')](_0x4d2a('0xb'),_0x383a3b,_0x3ef779[_0x4d2a('0x10')]['message']);return _0x37e6bc(_0x3ef779[_0x4d2a('0x10')][_0x4d2a('0x12')]);}logger[_0x4d2a('0x10')](_0x4d2a('0xb'),_0x383a3b,_0x3ef779[_0x4d2a('0x10')][_0x4d2a('0x12')]);return _0x49729a(_0x3ef779[_0x4d2a('0x10')]['message']);}else{logger[_0x4d2a('0x13')](_0x4d2a('0xb'),_0x383a3b,_0x4d2a('0xc'));_0x49729a(_0x3ef779[_0x4d2a('0x14')]['message']);}})['catch'](function(_0x487d0d){logger[_0x4d2a('0x10')](_0x4d2a('0xb'),_0x383a3b,_0x487d0d);_0x37e6bc(_0x487d0d);});});}exports[_0x4d2a('0x15')]=function(_0x6ca594){var _0xff7fe5=this;return new Promise(function(_0x2474a5,_0x29ed3f){return db[_0x4d2a('0x16')][_0x4d2a('0x17')]({'raw':_0x6ca594[_0x4d2a('0x18')]?_0x6ca594[_0x4d2a('0x18')][_0x4d2a('0x19')]===undefined?!![]:![]:!![],'where':_0x6ca594[_0x4d2a('0x18')]?_0x6ca594[_0x4d2a('0x18')][_0x4d2a('0x1a')]||null:null,'attributes':_0x6ca594[_0x4d2a('0x18')]?_0x6ca594[_0x4d2a('0x18')][_0x4d2a('0x1b')]||null:null,'limit':_0x6ca594[_0x4d2a('0x18')]?_0x6ca594[_0x4d2a('0x18')]['limit']||null:null,'include':_0x6ca594[_0x4d2a('0x18')]?_0x6ca594[_0x4d2a('0x18')][_0x4d2a('0x1c')]?_[_0x4d2a('0x1d')](_0x6ca594[_0x4d2a('0x18')]['include'],function(_0x197278){return{'model':db[_0x197278[_0x4d2a('0x1e')]],'as':_0x197278['as'],'attributes':_0x197278[_0x4d2a('0x1b')],'include':_0x197278[_0x4d2a('0x1c')]?_[_0x4d2a('0x1d')](_0x197278['include'],function(_0x34cb78){return{'model':db[_0x34cb78['model']],'as':_0x34cb78['as'],'attributes':_0x34cb78[_0x4d2a('0x1b')],'include':_0x34cb78['include']?_['map'](_0x34cb78[_0x4d2a('0x1c')],function(_0x1dfdb1){return{'model':db[_0x1dfdb1[_0x4d2a('0x1e')]],'as':_0x1dfdb1['as'],'attributes':_0x1dfdb1[_0x4d2a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d2a('0xa')](function(_0x18c1b0){logger[_0x4d2a('0x13')](_0x4d2a('0x15'),_0x6ca594);logger['debug'](_0x4d2a('0x15'),_0x6ca594,JSON[_0x4d2a('0xf')](_0x18c1b0));_0x2474a5(_0x18c1b0);})['catch'](function(_0x6ff35d){logger[_0x4d2a('0x10')](_0x4d2a('0x15'),_0x6ff35d[_0x4d2a('0x12')],_0x6ca594);_0x29ed3f(_0xff7fe5[_0x4d2a('0x10')](0x1f4,_0x6ff35d[_0x4d2a('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x160c9e){var _0x5f16fe=this;return new Promise(function(_0x422e30,_0x32e368){return db['CmHopperBlack'][_0x4d2a('0x1f')](_0x160c9e['body'],{'raw':_0x160c9e['options']?_0x160c9e['options'][_0x4d2a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x160c9e[_0x4d2a('0x18')]?_0x160c9e[_0x4d2a('0x18')][_0x4d2a('0x1a')]||null:null,'attributes':_0x160c9e[_0x4d2a('0x18')]?_0x160c9e[_0x4d2a('0x18')]['attributes']||null:null,'limit':_0x160c9e[_0x4d2a('0x18')]?_0x160c9e['options'][_0x4d2a('0x20')]||null:null})[_0x4d2a('0xa')](function(_0x51ff27){logger['info']('UpdateCmHopperBlack',_0x160c9e);logger[_0x4d2a('0xd')](_0x4d2a('0x21'),_0x160c9e,JSON[_0x4d2a('0xf')](_0x51ff27));_0x422e30(_0x51ff27);})[_0x4d2a('0x22')](function(_0x48577){logger['error'](_0x4d2a('0x21'),_0x48577[_0x4d2a('0x12')],_0x160c9e);_0x32e368(_0x5f16fe[_0x4d2a('0x10')](0x1f4,_0x48577[_0x4d2a('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x2269b9){var _0x24f171=this;return new Promise(function(_0xeb8fc8,_0x448c4f){return db[_0x4d2a('0x16')][_0x4d2a('0x23')]({'where':_0x2269b9['options']?_0x2269b9[_0x4d2a('0x18')][_0x4d2a('0x1a')]||null:null})[_0x4d2a('0xa')](function(_0x1e9620){logger[_0x4d2a('0x13')](_0x4d2a('0x24'),_0x2269b9);logger[_0x4d2a('0xd')](_0x4d2a('0x24'),_0x2269b9,JSON[_0x4d2a('0xf')](_0x1e9620));_0xeb8fc8(_0x1e9620);})[_0x4d2a('0x22')](function(_0x197bf3){logger['error']('DestroyCmHopperBlack',_0x197bf3[_0x4d2a('0x12')],_0x2269b9);_0x448c4f(_0x24f171[_0x4d2a('0x10')](0x1f4,_0x197bf3[_0x4d2a('0x12')]));});});}; \ No newline at end of file +var _0x1595=['where','limit','include','map','model','attributes','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x1595,0xd7));var _0x5159=function(_0x5bd3dd,_0x1f5096){_0x5bd3dd=_0x5bd3dd-0x0;var _0x8daec3=_0x1595[_0x5bd3dd];return _0x8daec3;};'use strict';var _=require('lodash');var util=require(_0x5159('0x0'));var moment=require(_0x5159('0x1'));var BPromise=require(_0x5159('0x2'));var rs=require(_0x5159('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5159('0x4'))['db'];var utils=require(_0x5159('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5159('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x55e874,_0x47efd6,_0x111002){return new BPromise(function(_0x42ec56,_0x4459a6){return client[_0x5159('0x7')](_0x55e874,_0x111002)[_0x5159('0x8')](function(_0x23bd8c){logger[_0x5159('0x9')](_0x5159('0xa'),_0x47efd6,_0x5159('0xb'));logger[_0x5159('0xc')](_0x5159('0xd'),_0x47efd6,'request\x20sent',JSON[_0x5159('0xe')](_0x23bd8c));if(_0x23bd8c['error']){if(_0x23bd8c[_0x5159('0xf')]['code']===0x1f4){logger[_0x5159('0xf')](_0x5159('0xa'),_0x47efd6,_0x23bd8c['error'][_0x5159('0x10')]);return _0x4459a6(_0x23bd8c['error'][_0x5159('0x10')]);}logger[_0x5159('0xf')](_0x5159('0xa'),_0x47efd6,_0x23bd8c[_0x5159('0xf')]['message']);return _0x42ec56(_0x23bd8c['error'][_0x5159('0x10')]);}else{logger[_0x5159('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x47efd6,_0x5159('0xb'));_0x42ec56(_0x23bd8c['result'][_0x5159('0x10')]);}})[_0x5159('0x11')](function(_0x415737){logger[_0x5159('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x47efd6,_0x415737);_0x4459a6(_0x415737);});});}exports[_0x5159('0x12')]=function(_0x5575fc){var _0x31cfc7=this;return new Promise(function(_0x26bd57,_0x37287d){return db[_0x5159('0x13')][_0x5159('0x14')]({'raw':_0x5575fc[_0x5159('0x15')]?_0x5575fc['options'][_0x5159('0x16')]===undefined?!![]:![]:!![],'where':_0x5575fc[_0x5159('0x15')]?_0x5575fc[_0x5159('0x15')][_0x5159('0x17')]||null:null,'attributes':_0x5575fc[_0x5159('0x15')]?_0x5575fc[_0x5159('0x15')]['attributes']||null:null,'limit':_0x5575fc[_0x5159('0x15')]?_0x5575fc[_0x5159('0x15')][_0x5159('0x18')]||null:null,'include':_0x5575fc[_0x5159('0x15')]?_0x5575fc['options'][_0x5159('0x19')]?_[_0x5159('0x1a')](_0x5575fc[_0x5159('0x15')]['include'],function(_0x1ca888){return{'model':db[_0x1ca888[_0x5159('0x1b')]],'as':_0x1ca888['as'],'attributes':_0x1ca888[_0x5159('0x1c')],'include':_0x1ca888[_0x5159('0x19')]?_[_0x5159('0x1a')](_0x1ca888['include'],function(_0x5ce393){return{'model':db[_0x5ce393[_0x5159('0x1b')]],'as':_0x5ce393['as'],'attributes':_0x5ce393[_0x5159('0x1c')],'include':_0x5ce393['include']?_[_0x5159('0x1a')](_0x5ce393[_0x5159('0x19')],function(_0x4ee11a){return{'model':db[_0x4ee11a[_0x5159('0x1b')]],'as':_0x4ee11a['as'],'attributes':_0x4ee11a[_0x5159('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5159('0x8')](function(_0x461b42){logger[_0x5159('0x9')](_0x5159('0x12'),_0x5575fc);logger[_0x5159('0xc')](_0x5159('0x12'),_0x5575fc,JSON[_0x5159('0xe')](_0x461b42));_0x26bd57(_0x461b42);})['catch'](function(_0x2e03a3){logger[_0x5159('0xf')](_0x5159('0x12'),_0x2e03a3[_0x5159('0x10')],_0x5575fc);_0x37287d(_0x31cfc7[_0x5159('0xf')](0x1f4,_0x2e03a3['message']));});});};exports[_0x5159('0x1d')]=function(_0x2b0e78){var _0x574b51=this;return new Promise(function(_0x1dc46e,_0x3b5fb8){return db[_0x5159('0x13')][_0x5159('0x1e')](_0x2b0e78[_0x5159('0x1f')],{'raw':_0x2b0e78[_0x5159('0x15')]?_0x2b0e78[_0x5159('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0e78[_0x5159('0x15')]?_0x2b0e78[_0x5159('0x15')][_0x5159('0x17')]||null:null,'attributes':_0x2b0e78[_0x5159('0x15')]?_0x2b0e78['options']['attributes']||null:null,'limit':_0x2b0e78[_0x5159('0x15')]?_0x2b0e78[_0x5159('0x15')][_0x5159('0x18')]||null:null})[_0x5159('0x8')](function(_0x2a9a4b){logger['info'](_0x5159('0x1d'),_0x2b0e78);logger[_0x5159('0xc')]('UpdateCmHopperBlack',_0x2b0e78,JSON[_0x5159('0xe')](_0x2a9a4b));_0x1dc46e(_0x2a9a4b);})[_0x5159('0x11')](function(_0x312940){logger[_0x5159('0xf')](_0x5159('0x1d'),_0x312940[_0x5159('0x10')],_0x2b0e78);_0x3b5fb8(_0x574b51[_0x5159('0xf')](0x1f4,_0x312940['message']));});});};exports[_0x5159('0x20')]=function(_0x20db7c){var _0x2c3ac9=this;return new Promise(function(_0x363b20,_0x54c8f4){return db[_0x5159('0x13')][_0x5159('0x21')]({'where':_0x20db7c[_0x5159('0x15')]?_0x20db7c[_0x5159('0x15')][_0x5159('0x17')]||null:null})['then'](function(_0x26b17e){logger['info'](_0x5159('0x20'),_0x20db7c);logger[_0x5159('0xc')](_0x5159('0x20'),_0x20db7c,JSON[_0x5159('0xe')](_0x26b17e));_0x363b20(_0x26b17e);})[_0x5159('0x11')](function(_0x557173){logger[_0x5159('0xf')]('DestroyCmHopperBlack',_0x557173[_0x5159('0x10')],_0x20db7c);_0x54c8f4(_0x2c3ac9[_0x5159('0xf')](0x1f4,_0x557173[_0x5159('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 3a37849..3d7f38b 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 _0x5697=['delete','destroy','exports','multer','path','connect-timeout','express','get','/describe','isAuthenticated','describe','/:id','put','update'];(function(_0x153079,_0x360c32){var _0x53f0f8=function(_0x42fa09){while(--_0x42fa09){_0x153079['push'](_0x153079['shift']());}};_0x53f0f8(++_0x360c32);}(_0x5697,0x1b5));var _0x7569=function(_0x53199f,_0x1dac3a){_0x53199f=_0x53199f-0x0;var _0x1f9609=_0x5697[_0x53199f];return _0x1f9609;};'use strict';var multer=require(_0x7569('0x0'));var util=require('util');var path=require(_0x7569('0x1'));var timeout=require(_0x7569('0x2'));var express=require(_0x7569('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x7569('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7569('0x5'),auth[_0x7569('0x6')](),controller[_0x7569('0x7')]);router[_0x7569('0x4')](_0x7569('0x8'),auth[_0x7569('0x6')](),controller['show']);router[_0x7569('0x9')]('/:id',auth[_0x7569('0x6')](),controller[_0x7569('0xa')]);router[_0x7569('0xb')](_0x7569('0x8'),auth[_0x7569('0x6')](),controller[_0x7569('0xc')]);module[_0x7569('0xd')]=router; \ No newline at end of file +var _0x861c=['/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0xd8323,_0x28a00e){var _0x583d69=function(_0x286db9){while(--_0x286db9){_0xd8323['push'](_0xd8323['shift']());}};_0x583d69(++_0x28a00e);}(_0x861c,0xdb));var _0xc861=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x861c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var path=require(_0xc861('0x2'));var timeout=require(_0xc861('0x3'));var express=require(_0xc861('0x4'));var router=express[_0xc861('0x5')]();var auth=require(_0xc861('0x6'));var interaction=require(_0xc861('0x7'));var config=require(_0xc861('0x8'));var controller=require(_0xc861('0x9'));router[_0xc861('0xa')]('/',auth[_0xc861('0xb')](),controller['index']);router[_0xc861('0xa')](_0xc861('0xc'),auth[_0xc861('0xb')](),controller[_0xc861('0xd')]);router[_0xc861('0xa')](_0xc861('0xe'),auth[_0xc861('0xb')](),controller[_0xc861('0xf')]);router[_0xc861('0x10')](_0xc861('0xe'),auth[_0xc861('0xb')](),controller[_0xc861('0x11')]);router[_0xc861('0x12')]('/:id',auth[_0xc861('0xb')](),controller[_0xc861('0x13')]);module[_0xc861('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 857ce5d..4e6fea5 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 _0x1ee0=['diff','seconds','dispositionat','BOOLEAN','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime'];(function(_0x1670aa,_0x498c32){var _0x52d286=function(_0x218aae){while(--_0x218aae){_0x1670aa['push'](_0x1670aa['shift']());}};_0x52d286(++_0x498c32);}(_0x1ee0,0x19c));var _0x01ee=function(_0x58e577,_0x4d1eb1){_0x58e577=_0x58e577-0x0;var _0x132131=_0x1ee0[_0x58e577];return _0x132131;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x01ee('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x01ee('0x1')]},'scheduledat':{'type':Sequelize[_0x01ee('0x2')]},'countbusyretry':{'type':Sequelize[_0x01ee('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x01ee('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x01ee('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x01ee('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x01ee('0x1')]},'calleridname':{'type':Sequelize[_0x01ee('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x01ee('0x2')]},'endtime':{'type':Sequelize[_0x01ee('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x01ee('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x01ee('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x01ee('0x1')]},'campaign':{'type':Sequelize[_0x01ee('0x1')]},'campaigntype':{'type':Sequelize[_0x01ee('0x1')]},'membername':{'type':Sequelize[_0x01ee('0x1')]},'reason':{'type':Sequelize[_0x01ee('0x1')]},'disposition':{'type':Sequelize[_0x01ee('0x1')]},'dispositionat':{'type':Sequelize[_0x01ee('0x2')],'set':function(_0x1fc5b9){var _0xbdd0e5=this[_0x01ee('0x4')](_0x01ee('0x5'));if(_0xbdd0e5&&_0x1fc5b9){this[_0x01ee('0x6')](_0x01ee('0x7'),moment(_0x1fc5b9)[_0x01ee('0x8')](moment(_0xbdd0e5),_0x01ee('0x9')));}return this[_0x01ee('0x6')](_0x01ee('0xa'),_0x1fc5b9);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x01ee('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x01ee('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x01ee('0x2')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x01ee('0x2')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8ae0=['BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ae0,0xb1));var _0x08ae=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8ae0[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x08ae('0x0'));var moment=require(_0x08ae('0x1'));module[_0x08ae('0x2')]={'state':{'type':Sequelize[_0x08ae('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x08ae('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x08ae('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x08ae('0x5')]},'starttime':{'type':Sequelize[_0x08ae('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x08ae('0x4')]},'droptime':{'type':Sequelize[_0x08ae('0x4')]},'endtime':{'type':Sequelize[_0x08ae('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x08ae('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x08ae('0x5')]},'campaign':{'type':Sequelize[_0x08ae('0x5')]},'campaigntype':{'type':Sequelize[_0x08ae('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x08ae('0x5')]},'disposition':{'type':Sequelize[_0x08ae('0x5')]},'dispositionat':{'type':Sequelize[_0x08ae('0x4')],'set':function(_0x255223){var _0x5d5fae=this[_0x08ae('0x6')](_0x08ae('0x7'));if(_0x5d5fae&&_0x255223){this[_0x08ae('0x8')](_0x08ae('0x9'),moment(_0x255223)['diff'](moment(_0x5d5fae),'seconds'));}return this[_0x08ae('0x8')]('dispositionat',_0x255223);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x08ae('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x08ae('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x08ae('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x08ae('0x4')]},'deleted':{'type':Sequelize[_0x08ae('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x08ae('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x08ae('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index acf055b..9239ff0 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 _0x0856=['fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state\x20=\x20?','state','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','CmHopperFinal','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','type','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','rawAttributes','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','findAll','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','congestionContacts','VoiceQueue','into'];(function(_0x516e0c,_0x497880){var _0x3a1ae8=function(_0x5694b1){while(--_0x5694b1){_0x516e0c['push'](_0x516e0c['shift']());}};_0x3a1ae8(++_0x497880);}(_0x0856,0xa2));var _0x6085=function(_0x4c343e,_0x85642){_0x4c343e=_0x4c343e-0x0;var _0x32eef2=_0x0856[_0x4c343e];return _0x32eef2;};'use strict';var pdf=require(_0x6085('0x0'));var emlformat=require(_0x6085('0x1'));var rimraf=require(_0x6085('0x2'));var zipdir=require(_0x6085('0x3'));var jsonpatch=require(_0x6085('0x4'));var rp=require(_0x6085('0x5'));var moment=require(_0x6085('0x6'));var BPromise=require(_0x6085('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6085('0x8'));var sox=require('sox');var csv=require(_0x6085('0x9'));var ejs=require(_0x6085('0xa'));var fs=require('fs');var _=require(_0x6085('0xb'));var squel=require(_0x6085('0xc'));var crypto=require(_0x6085('0xd'));var jsforce=require(_0x6085('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6085('0xf'));var Papa=require(_0x6085('0x10'));var Redis=require(_0x6085('0x11'));var authService=require(_0x6085('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6085('0x13'));var logger=require(_0x6085('0x14'))(_0x6085('0x15'));var utils=require(_0x6085('0x16'));var config=require(_0x6085('0x17'));var db=require(_0x6085('0x18'))['db'];function respondWithStatusCode(_0xbe2eba,_0x46db11){_0x46db11=_0x46db11||0xcc;return function(_0x39e8fb){if(_0x39e8fb){return _0xbe2eba[_0x6085('0x19')](_0x46db11);}return _0xbe2eba[_0x6085('0x1a')](_0x46db11)[_0x6085('0x1b')]();};}function respondWithResult(_0x561142,_0x454b53){_0x454b53=_0x454b53||0xc8;return function(_0x590fd4){if(_0x590fd4){return _0x561142[_0x6085('0x1a')](_0x454b53)[_0x6085('0x1c')](_0x590fd4);}};}function respondWithFilteredResult(_0x537022,_0x2f8dd0){return function(_0x23e9f1){if(_0x23e9f1){var _0x307425=_0x23e9f1['count'],_0x26b879=_0x2f8dd0[_0x6085('0x1d')],_0x187cab=_0x2f8dd0[_0x6085('0x1d')]+_0x2f8dd0[_0x6085('0x1e')],_0x2b47cf;if(_0x187cab>=_0x307425){_0x187cab=_0x307425;_0x2b47cf=0xc8;}else{_0x2b47cf=0xce;}_0x537022[_0x6085('0x1a')](_0x2b47cf);return _0x537022[_0x6085('0x1f')](_0x6085('0x20'),_0x26b879+'-'+_0x187cab+'/'+_0x307425)[_0x6085('0x1c')](_0x23e9f1);}return null;};}function patchUpdates(_0x5166d4){return function(_0x52586e){try{jsonpatch['apply'](_0x52586e,_0x5166d4,!![]);}catch(_0x2b47f4){return BPromise[_0x6085('0x21')](_0x2b47f4);}return _0x52586e['save']();};}function saveUpdates(_0x13b237,_0x2f0db9){return function(_0xbaf26c){if(_0xbaf26c){return _0xbaf26c[_0x6085('0x22')](_0x13b237)['then'](function(_0x22ea36){return _0x22ea36;});}return null;};}function removeEntity(_0x49b9d7,_0x337cde){return function(_0x49e139){if(_0x49e139){return _0x49e139['destroy']()[_0x6085('0x23')](function(){_0x49b9d7[_0x6085('0x1a')](0xcc)[_0x6085('0x1b')]();});}};}function handleEntityNotFound(_0x50c407,_0x54f85d){return function(_0x3397fc){if(!_0x3397fc){_0x50c407[_0x6085('0x19')](0x194);}return _0x3397fc;};}function handleError(_0x455ba4,_0x3da5b4){_0x3da5b4=_0x3da5b4||0x1f4;return function(_0x140e4d){logger[_0x6085('0x24')](_0x140e4d[_0x6085('0x25')]);if(_0x140e4d[_0x6085('0x26')]){delete _0x140e4d[_0x6085('0x26')];}_0x455ba4[_0x6085('0x1a')](_0x3da5b4)[_0x6085('0x27')](_0x140e4d);};}exports[_0x6085('0x28')]=function(_0x3d29ed,_0x355f8e){var _0x51aae3={},_0x1a8fa0={},_0x22131c={'count':0x0,'rows':[]};var _0x35bf9f=db[_0x6085('0x29')]['rawAttributes'];_0x1a8fa0['model']=_[_0x6085('0x2a')](_0x35bf9f);_0x1a8fa0['query']=_[_0x6085('0x2a')](_0x3d29ed[_0x6085('0x2b')]);_0x1a8fa0[_0x6085('0x2c')]=_['intersection'](_0x1a8fa0[_0x6085('0x2d')],_0x1a8fa0['query']);_0x51aae3['attributes']=_[_0x6085('0x2e')](_0x1a8fa0[_0x6085('0x2d')],qs['fields'](_0x3d29ed[_0x6085('0x2b')][_0x6085('0x2f')]));_0x51aae3[_0x6085('0x30')]=_0x51aae3['attributes'][_0x6085('0x31')]?_0x51aae3[_0x6085('0x30')]:_0x1a8fa0['model'];if(!_0x3d29ed[_0x6085('0x2b')]['hasOwnProperty'](_0x6085('0x32'))){_0x51aae3[_0x6085('0x1e')]=qs[_0x6085('0x1e')](_0x3d29ed[_0x6085('0x2b')][_0x6085('0x1e')]);_0x51aae3[_0x6085('0x1d')]=qs[_0x6085('0x1d')](_0x3d29ed[_0x6085('0x2b')]['offset']);}_0x51aae3[_0x6085('0x33')]=qs['sort'](_0x3d29ed[_0x6085('0x2b')]['sort']);_0x51aae3['where']=qs[_0x6085('0x2c')](_[_0x6085('0x34')](_0x3d29ed['query'],_0x1a8fa0[_0x6085('0x2c')]));if(_0x3d29ed[_0x6085('0x2b')][_0x6085('0x35')]){_0x51aae3[_0x6085('0x36')]=_[_0x6085('0x37')](_0x51aae3[_0x6085('0x36')],{'$or':_['map'](_0x35bf9f,function(_0x5123cb){if(_0x5123cb[_0x6085('0x38')][_0x6085('0x39')]!==_0x6085('0x3a')){var _0x4fd470={};_0x4fd470[_0x5123cb[_0x6085('0x3b')]]={'$like':'%'+_0x3d29ed[_0x6085('0x2b')][_0x6085('0x35')]+'%'};return _0x4fd470;}})});}_0x51aae3=_[_0x6085('0x37')]({},_0x51aae3,_0x3d29ed[_0x6085('0x3c')]);var _0x4889a9={'where':_0x51aae3[_0x6085('0x36')]};return db[_0x6085('0x29')]['count'](_0x4889a9)[_0x6085('0x23')](function(_0x1b8c06){_0x22131c[_0x6085('0x3d')]=_0x1b8c06;if(_0x3d29ed[_0x6085('0x2b')][_0x6085('0x3e')]){_0x51aae3[_0x6085('0x3f')]=[{'all':!![]}];}return db[_0x6085('0x29')]['findAll'](_0x51aae3);})[_0x6085('0x23')](function(_0x4c6c98){_0x22131c[_0x6085('0x40')]=_0x4c6c98;return _0x22131c;})[_0x6085('0x23')](respondWithFilteredResult(_0x355f8e,_0x51aae3))[_0x6085('0x41')](handleError(_0x355f8e,null));};exports[_0x6085('0x42')]=function(_0x592502,_0x17f2c7){var _0x52feae={'raw':!![],'where':{'id':_0x592502[_0x6085('0x43')]['id']}},_0x59d4dd={};_0x59d4dd[_0x6085('0x2d')]=_[_0x6085('0x2a')](db[_0x6085('0x29')][_0x6085('0x44')]);_0x59d4dd['query']=_[_0x6085('0x2a')](_0x592502[_0x6085('0x2b')]);_0x59d4dd[_0x6085('0x2c')]=_[_0x6085('0x2e')](_0x59d4dd['model'],_0x59d4dd[_0x6085('0x2b')]);_0x52feae[_0x6085('0x30')]=_['intersection'](_0x59d4dd['model'],qs[_0x6085('0x2f')](_0x592502[_0x6085('0x2b')][_0x6085('0x2f')]));_0x52feae[_0x6085('0x30')]=_0x52feae['attributes'][_0x6085('0x31')]?_0x52feae[_0x6085('0x30')]:_0x59d4dd[_0x6085('0x2d')];if(_0x592502['query'][_0x6085('0x3e')]){_0x52feae[_0x6085('0x3f')]=[{'all':!![]}];}_0x52feae=_[_0x6085('0x37')]({},_0x52feae,_0x592502[_0x6085('0x3c')]);return db['CmHopperFinal']['find'](_0x52feae)[_0x6085('0x23')](handleEntityNotFound(_0x17f2c7,null))['then'](respondWithResult(_0x17f2c7,null))['catch'](handleError(_0x17f2c7,null));};exports['describe']=function(_0x2d4d17,_0x4e2021){return db['CmHopperFinal'][_0x6085('0x45')]()[_0x6085('0x23')](respondWithResult(_0x4e2021,null))[_0x6085('0x41')](handleError(_0x4e2021,null));};exports[_0x6085('0x22')]=function(_0xf1e03a,_0x4bde17){if(_0xf1e03a[_0x6085('0x46')][_0x6085('0x47')]){delete _0xf1e03a['body']['uniqueid'];}return db[_0x6085('0x29')][_0x6085('0x48')]({'where':{'uniqueid':_0xf1e03a[_0x6085('0x43')]['id']}})[_0x6085('0x23')](handleEntityNotFound(_0x4bde17,null))[_0x6085('0x23')](saveUpdates(_0xf1e03a[_0x6085('0x46')],null))[_0x6085('0x23')](respondWithResult(_0x4bde17,null))[_0x6085('0x41')](handleError(_0x4bde17,null));};exports[_0x6085('0x49')]=function(_0x1ef68a,_0x17f9bd,_0x50f345){return db[_0x6085('0x29')][_0x6085('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0x1ef68a[_0x6085('0x43')]['id']},'attributes':[[db[_0x6085('0x4b')]['fn']('COUNT',db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x4d')))),_0x6085('0x4e')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')]('`state`\x20=\x203,\x201,\x20null'))),_0x6085('0x50')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')]['literal'](_0x6085('0x51')))),_0x6085('0x52')],[db['sequelize']['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x53')))),'congestionContacts'],[db[_0x6085('0x4b')]['fn']('COUNT',db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x54')))),_0x6085('0x55')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db['sequelize'][_0x6085('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6085('0x56')],[db[_0x6085('0x4b')]['fn']('COUNT',db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x57')))),_0x6085('0x58')],[db['sequelize']['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db['sequelize'][_0x6085('0x4c')](_0x6085('0x59')))),_0x6085('0x5a')]]})[_0x6085('0x23')](handleEntityNotFound(_0x17f9bd,null))['then'](respondWithResult(_0x17f9bd,null))['catch'](handleError(_0x17f9bd,null));};exports[_0x6085('0x5b')]=function(_0xea8652,_0x9c17ab,_0x200b99){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0xea8652['params']['id']},'attributes':[[db['sequelize']['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db['sequelize'][_0x6085('0x4c')](_0x6085('0x4d')))),_0x6085('0x4e')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db['sequelize'][_0x6085('0x4c')](_0x6085('0x5c')))),'noAnswerContacts'],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')]('`state`\x20=\x205,\x201,\x20null'))),_0x6085('0x52')],[db[_0x6085('0x4b')]['fn']('COUNT',db[_0x6085('0x4b')]['fn']('IF',db['sequelize'][_0x6085('0x4c')](_0x6085('0x53')))),_0x6085('0x5d')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6085('0x54')))),_0x6085('0x55')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6085('0x56')],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x57')))),'reCallContacts'],[db[_0x6085('0x4b')]['fn'](_0x6085('0x4f'),db[_0x6085('0x4b')]['fn']('IF',db[_0x6085('0x4b')][_0x6085('0x4c')](_0x6085('0x59')))),_0x6085('0x5a')]]})[_0x6085('0x23')](handleEntityNotFound(_0x9c17ab,null))[_0x6085('0x23')](respondWithResult(_0x9c17ab,null))['catch'](handleError(_0x9c17ab,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2ef851,_0xf634e2,_0x445bdb){return db[_0x6085('0x5e')][_0x6085('0x48')]({'where':{'id':_0x2ef851['params']['id']}})[_0x6085('0x23')](handleEntityNotFound(_0xf634e2,null))[_0x6085('0x23')](function(_0x402316){var _0x4a6fc4;if(_0x402316){_0x4a6fc4=squel['insert']()[_0x6085('0x5f')]('cm_hopper')[_0x6085('0x60')]([_0x6085('0x61'),_0x6085('0x62'),_0x6085('0x63'),_0x6085('0x64'),_0x6085('0x65'),_0x6085('0x66'),'updatedAt'],squel[_0x6085('0x67')]()[_0x6085('0x3b')]('ANY_VALUE(calleridnum)','phone')[_0x6085('0x3b')](_0x6085('0x68'),_0x6085('0x62'))[_0x6085('0x3b')](_0x6085('0x69'),_0x6085('0x63'))['field']('ANY_VALUE(ListId)',_0x6085('0x64'))['field'](_0x6085('0x6a'),_0x6085('0x65'))[_0x6085('0x3b')](_0x6085('0x68'),_0x6085('0x66'))['field'](_0x6085('0x68'),_0x6085('0x6b'))[_0x6085('0x6c')](_0x6085('0x6d'))[_0x6085('0x36')]('VoiceQueueId\x20=\x20?',_0x2ef851[_0x6085('0x43')]['id'][_0x6085('0x6e')]())['where'](_0x6085('0x6f'),_0x2ef851[_0x6085('0x46')][_0x6085('0x70')][_0x6085('0x6e')]())[_0x6085('0x36')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6085('0x67')]()[_0x6085('0x3b')](_0x6085('0x61'))[_0x6085('0x6c')](_0x6085('0x71'))[_0x6085('0x36')](_0x6085('0x72'),_0x2ef851[_0x6085('0x43')]['id'][_0x6085('0x6e')]()))[_0x6085('0x36')](_0x6085('0x73'),squel[_0x6085('0x67')]()[_0x6085('0x3b')](_0x6085('0x74'))['from'](_0x6085('0x6d'))['where']('VoiceQueueId\x20=\x20?',_0x2ef851[_0x6085('0x43')]['id'][_0x6085('0x6e')]())[_0x6085('0x36')](_0x6085('0x75')))[_0x6085('0x76')](_0x6085('0x63')))['toString']();return db['sequelize'][_0x6085('0x2b')](_0x4a6fc4);}return[];})['then'](respondWithResult(_0xf634e2,null))[_0x6085('0x41')](handleError(_0xf634e2,null));};exports[_0x6085('0x77')]=function(_0x25442e,_0x2dfd87,_0x3e6fd5){return db['Campaign']['find']({'where':{'id':_0x25442e['params']['id']}})['then'](handleEntityNotFound(_0x2dfd87,null))[_0x6085('0x23')](function(_0x19b84c){var _0x5c253b;if(_0x19b84c){_0x5c253b=squel['insert']()[_0x6085('0x5f')](_0x6085('0x71'))['fromQuery']([_0x6085('0x61'),_0x6085('0x62'),_0x6085('0x63'),'ListId','CampaignId',_0x6085('0x66'),'updatedAt'],squel[_0x6085('0x67')]()[_0x6085('0x3b')](_0x6085('0x78'),_0x6085('0x61'))[_0x6085('0x3b')](_0x6085('0x68'),_0x6085('0x62'))['field'](_0x6085('0x69'),_0x6085('0x63'))[_0x6085('0x3b')](_0x6085('0x79'),_0x6085('0x64'))['field'](_0x6085('0x7a'),_0x6085('0x7b'))[_0x6085('0x3b')](_0x6085('0x68'),'createdAt')[_0x6085('0x3b')]('NOW()',_0x6085('0x6b'))[_0x6085('0x6c')](_0x6085('0x6d'))[_0x6085('0x36')](_0x6085('0x7c'),_0x25442e[_0x6085('0x43')]['id'][_0x6085('0x6e')]())[_0x6085('0x36')](_0x6085('0x6f'),_0x25442e[_0x6085('0x46')][_0x6085('0x70')]['toString']())[_0x6085('0x36')](_0x6085('0x7d'))[_0x6085('0x36')](_0x6085('0x73'),squel['select']()[_0x6085('0x3b')]('phone')[_0x6085('0x6c')](_0x6085('0x71'))[_0x6085('0x36')](_0x6085('0x7c'),_0x25442e[_0x6085('0x43')]['id'][_0x6085('0x6e')]()))['where'](_0x6085('0x73'),squel[_0x6085('0x67')]()['field'](_0x6085('0x74'))[_0x6085('0x6c')](_0x6085('0x6d'))[_0x6085('0x36')](_0x6085('0x7c'),_0x25442e[_0x6085('0x43')]['id']['toString']())[_0x6085('0x36')]('state\x20=\x204'))['group'](_0x6085('0x63')))[_0x6085('0x6e')]();return db[_0x6085('0x4b')][_0x6085('0x2b')](_0x5c253b);}return[];})['then'](respondWithResult(_0x2dfd87,null))[_0x6085('0x41')](handleError(_0x2dfd87,null));};exports[_0x6085('0x7e')]=function(_0x285f69,_0x257bac,_0x49cb7a){return db[_0x6085('0x7f')][_0x6085('0x80')]({'where':{'VoiceQueueId':_0x285f69[_0x6085('0x46')][_0x6085('0x65')],'CampaignId':_0x285f69[_0x6085('0x46')]['CampaignId'],'ContactId':_0x285f69[_0x6085('0x46')][_0x6085('0x63')]}})[_0x6085('0x23')](handleEntityNotFound(_0x257bac,null))[_0x6085('0x23')](function(_0x4078c4){if(_0x4078c4){return _0x4078c4;}return null;})[_0x6085('0x23')](respondWithResult(_0x257bac,null))[_0x6085('0x41')](handleError(_0x257bac,null));}; \ No newline at end of file +var _0x6d35=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperFinal','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','type','key','field','merge','options','count','include','findAll','rows','includeAll','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0x6d35,0xa5));var _0x56d3=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x6d35[_0x58965a];return _0x254efc;};'use strict';var pdf=require(_0x56d3('0x0'));var emlformat=require(_0x56d3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x56d3('0x2'));var jsonpatch=require(_0x56d3('0x3'));var rp=require('request-promise');var moment=require(_0x56d3('0x4'));var BPromise=require(_0x56d3('0x5'));var Mustache=require(_0x56d3('0x6'));var util=require(_0x56d3('0x7'));var path=require(_0x56d3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x56d3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x56d3('0xa'));var crypto=require(_0x56d3('0xb'));var jsforce=require(_0x56d3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x56d3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x56d3('0xe'));var hardwareService=require(_0x56d3('0xf'));var logger=require(_0x56d3('0x10'))(_0x56d3('0x11'));var utils=require('../../config/utils');var config=require(_0x56d3('0x12'));var db=require(_0x56d3('0x13'))['db'];function respondWithStatusCode(_0x9e8c9d,_0x3acb97){_0x3acb97=_0x3acb97||0xcc;return function(_0x4c1799){if(_0x4c1799){return _0x9e8c9d[_0x56d3('0x14')](_0x3acb97);}return _0x9e8c9d[_0x56d3('0x15')](_0x3acb97)[_0x56d3('0x16')]();};}function respondWithResult(_0x1047d1,_0x1132a8){_0x1132a8=_0x1132a8||0xc8;return function(_0x10c4ff){if(_0x10c4ff){return _0x1047d1[_0x56d3('0x15')](_0x1132a8)[_0x56d3('0x17')](_0x10c4ff);}};}function respondWithFilteredResult(_0x11af7c,_0x23c909){return function(_0x2cbab6){if(_0x2cbab6){var _0x4da974=_0x2cbab6['count'],_0x46ad83=_0x23c909[_0x56d3('0x18')],_0x16ece5=_0x23c909['offset']+_0x23c909[_0x56d3('0x19')],_0x4145b1;if(_0x16ece5>=_0x4da974){_0x16ece5=_0x4da974;_0x4145b1=0xc8;}else{_0x4145b1=0xce;}_0x11af7c[_0x56d3('0x15')](_0x4145b1);return _0x11af7c['set'](_0x56d3('0x1a'),_0x46ad83+'-'+_0x16ece5+'/'+_0x4da974)['json'](_0x2cbab6);}return null;};}function patchUpdates(_0x54b2d4){return function(_0x3237a8){try{jsonpatch[_0x56d3('0x1b')](_0x3237a8,_0x54b2d4,!![]);}catch(_0x1a3d75){return BPromise[_0x56d3('0x1c')](_0x1a3d75);}return _0x3237a8[_0x56d3('0x1d')]();};}function saveUpdates(_0x35f575,_0x4288a8){return function(_0xef0010){if(_0xef0010){return _0xef0010[_0x56d3('0x1e')](_0x35f575)[_0x56d3('0x1f')](function(_0x50214c){return _0x50214c;});}return null;};}function removeEntity(_0x41573f,_0x2f1e23){return function(_0x349a4c){if(_0x349a4c){return _0x349a4c[_0x56d3('0x20')]()[_0x56d3('0x1f')](function(){_0x41573f[_0x56d3('0x15')](0xcc)[_0x56d3('0x16')]();});}};}function handleEntityNotFound(_0x5025a9,_0x27318f){return function(_0x307149){if(!_0x307149){_0x5025a9['sendStatus'](0x194);}return _0x307149;};}function handleError(_0x1f6e84,_0x366604){_0x366604=_0x366604||0x1f4;return function(_0x3ef473){logger['error'](_0x3ef473[_0x56d3('0x21')]);if(_0x3ef473[_0x56d3('0x22')]){delete _0x3ef473[_0x56d3('0x22')];}_0x1f6e84[_0x56d3('0x15')](_0x366604)[_0x56d3('0x23')](_0x3ef473);};}exports[_0x56d3('0x24')]=function(_0x3f8587,_0x5c2515){var _0x3701b4={},_0x41d52b={},_0xc01d1={'count':0x0,'rows':[]};var _0x42a569=db[_0x56d3('0x25')][_0x56d3('0x26')];_0x41d52b[_0x56d3('0x27')]=_['keys'](_0x42a569);_0x41d52b[_0x56d3('0x28')]=_[_0x56d3('0x29')](_0x3f8587['query']);_0x41d52b[_0x56d3('0x2a')]=_[_0x56d3('0x2b')](_0x41d52b[_0x56d3('0x27')],_0x41d52b['query']);_0x3701b4[_0x56d3('0x2c')]=_[_0x56d3('0x2b')](_0x41d52b[_0x56d3('0x27')],qs[_0x56d3('0x2d')](_0x3f8587[_0x56d3('0x28')][_0x56d3('0x2d')]));_0x3701b4[_0x56d3('0x2c')]=_0x3701b4[_0x56d3('0x2c')][_0x56d3('0x2e')]?_0x3701b4[_0x56d3('0x2c')]:_0x41d52b[_0x56d3('0x27')];if(!_0x3f8587[_0x56d3('0x28')][_0x56d3('0x2f')]('nolimit')){_0x3701b4[_0x56d3('0x19')]=qs['limit'](_0x3f8587[_0x56d3('0x28')][_0x56d3('0x19')]);_0x3701b4[_0x56d3('0x18')]=qs[_0x56d3('0x18')](_0x3f8587[_0x56d3('0x28')][_0x56d3('0x18')]);}_0x3701b4[_0x56d3('0x30')]=qs[_0x56d3('0x31')](_0x3f8587[_0x56d3('0x28')][_0x56d3('0x31')]);_0x3701b4[_0x56d3('0x32')]=qs[_0x56d3('0x2a')](_['pick'](_0x3f8587[_0x56d3('0x28')],_0x41d52b[_0x56d3('0x2a')]));if(_0x3f8587[_0x56d3('0x28')][_0x56d3('0x33')]){_0x3701b4['where']=_['merge'](_0x3701b4['where'],{'$or':_[_0x56d3('0x34')](_0x42a569,function(_0x194e8a){if(_0x194e8a[_0x56d3('0x35')][_0x56d3('0x36')]!=='VIRTUAL'){var _0x2bd467={};_0x2bd467[_0x194e8a[_0x56d3('0x37')]]={'$like':'%'+_0x3f8587[_0x56d3('0x28')]['filter']+'%'};return _0x2bd467;}})});}_0x3701b4=_[_0x56d3('0x38')]({},_0x3701b4,_0x3f8587[_0x56d3('0x39')]);var _0xd166c1={'where':_0x3701b4['where']};return db['CmHopperFinal']['count'](_0xd166c1)['then'](function(_0x455afc){_0xc01d1[_0x56d3('0x3a')]=_0x455afc;if(_0x3f8587[_0x56d3('0x28')]['includeAll']){_0x3701b4[_0x56d3('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x56d3('0x3c')](_0x3701b4);})[_0x56d3('0x1f')](function(_0x4a872d){_0xc01d1[_0x56d3('0x3d')]=_0x4a872d;return _0xc01d1;})[_0x56d3('0x1f')](respondWithFilteredResult(_0x5c2515,_0x3701b4))['catch'](handleError(_0x5c2515,null));};exports['show']=function(_0x132ca1,_0x2f7583){var _0x51159b={'raw':!![],'where':{'id':_0x132ca1['params']['id']}},_0x2c25dc={};_0x2c25dc['model']=_[_0x56d3('0x29')](db[_0x56d3('0x25')][_0x56d3('0x26')]);_0x2c25dc[_0x56d3('0x28')]=_[_0x56d3('0x29')](_0x132ca1[_0x56d3('0x28')]);_0x2c25dc[_0x56d3('0x2a')]=_['intersection'](_0x2c25dc[_0x56d3('0x27')],_0x2c25dc['query']);_0x51159b[_0x56d3('0x2c')]=_['intersection'](_0x2c25dc[_0x56d3('0x27')],qs[_0x56d3('0x2d')](_0x132ca1[_0x56d3('0x28')]['fields']));_0x51159b[_0x56d3('0x2c')]=_0x51159b['attributes'][_0x56d3('0x2e')]?_0x51159b[_0x56d3('0x2c')]:_0x2c25dc['model'];if(_0x132ca1[_0x56d3('0x28')][_0x56d3('0x3e')]){_0x51159b['include']=[{'all':!![]}];}_0x51159b=_[_0x56d3('0x38')]({},_0x51159b,_0x132ca1['options']);return db[_0x56d3('0x25')][_0x56d3('0x3f')](_0x51159b)[_0x56d3('0x1f')](handleEntityNotFound(_0x2f7583,null))[_0x56d3('0x1f')](respondWithResult(_0x2f7583,null))[_0x56d3('0x40')](handleError(_0x2f7583,null));};exports[_0x56d3('0x41')]=function(_0x3f534d,_0x366dd1){return db['CmHopperFinal'][_0x56d3('0x41')]()[_0x56d3('0x1f')](respondWithResult(_0x366dd1,null))[_0x56d3('0x40')](handleError(_0x366dd1,null));};exports[_0x56d3('0x1e')]=function(_0x5a191a,_0x141a64){if(_0x5a191a[_0x56d3('0x42')][_0x56d3('0x43')]){delete _0x5a191a[_0x56d3('0x42')]['uniqueid'];}return db[_0x56d3('0x25')][_0x56d3('0x3f')]({'where':{'uniqueid':_0x5a191a[_0x56d3('0x44')]['id']}})[_0x56d3('0x1f')](handleEntityNotFound(_0x141a64,null))[_0x56d3('0x1f')](saveUpdates(_0x5a191a['body'],null))[_0x56d3('0x1f')](respondWithResult(_0x141a64,null))[_0x56d3('0x40')](handleError(_0x141a64,null));};exports[_0x56d3('0x45')]=function(_0x99943c,_0xa0eee8,_0x1a9f85){return db[_0x56d3('0x25')][_0x56d3('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x99943c[_0x56d3('0x44')]['id']},'attributes':[[db[_0x56d3('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')]('`state`\x20=\x200,\x201,\x20null'))),_0x56d3('0x48')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db['sequelize']['literal'](_0x56d3('0x4a')))),_0x56d3('0x4b')],[db[_0x56d3('0x46')]['fn']('COUNT',db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4c')))),_0x56d3('0x4d')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4f')))),'dropContacts'],[db['sequelize']['fn'](_0x56d3('0x49'),db['sequelize']['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x50')))),_0x56d3('0x51')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db['sequelize']['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x52')))),_0x56d3('0x53')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db['sequelize'][_0x56d3('0x47')](_0x56d3('0x54')))),_0x56d3('0x55')]]})[_0x56d3('0x1f')](handleEntityNotFound(_0xa0eee8,null))[_0x56d3('0x1f')](respondWithResult(_0xa0eee8,null))[_0x56d3('0x40')](handleError(_0xa0eee8,null));};exports[_0x56d3('0x56')]=function(_0x5968ac,_0x1edcd9,_0xd4b9fb){return db[_0x56d3('0x25')][_0x56d3('0x3c')]({'raw':![],'where':{'CampaignId':_0x5968ac[_0x56d3('0x44')]['id']},'attributes':[[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')]('`state`\x20=\x200,\x201,\x20null'))),_0x56d3('0x48')],[db['sequelize']['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4a')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4c')))),_0x56d3('0x4d')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4e')))),_0x56d3('0x57')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')](_0x56d3('0x4f')))),_0x56d3('0x58')],[db[_0x56d3('0x46')]['fn']('COUNT',db[_0x56d3('0x46')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x56d3('0x51')],[db['sequelize']['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db['sequelize'][_0x56d3('0x47')](_0x56d3('0x52')))),_0x56d3('0x53')],[db[_0x56d3('0x46')]['fn'](_0x56d3('0x49'),db[_0x56d3('0x46')]['fn']('IF',db[_0x56d3('0x46')][_0x56d3('0x47')]('`state`\x20=\x2019,\x201,\x20null'))),_0x56d3('0x55')]]})['then'](handleEntityNotFound(_0x1edcd9,null))[_0x56d3('0x1f')](respondWithResult(_0x1edcd9,null))[_0x56d3('0x40')](handleError(_0x1edcd9,null));};exports[_0x56d3('0x59')]=function(_0xc9f49f,_0x17844a,_0x3fd54d){return db[_0x56d3('0x5a')][_0x56d3('0x3f')]({'where':{'id':_0xc9f49f[_0x56d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x17844a,null))[_0x56d3('0x1f')](function(_0xef6977){var _0x3f3369;if(_0xef6977){_0x3f3369=squel[_0x56d3('0x5b')]()[_0x56d3('0x5c')](_0x56d3('0x5d'))[_0x56d3('0x5e')]([_0x56d3('0x5f'),_0x56d3('0x60'),_0x56d3('0x61'),_0x56d3('0x62'),_0x56d3('0x63'),_0x56d3('0x64'),_0x56d3('0x65')],squel[_0x56d3('0x66')]()[_0x56d3('0x37')]('ANY_VALUE(calleridnum)',_0x56d3('0x5f'))['field'](_0x56d3('0x67'),_0x56d3('0x60'))['field']('ANY_VALUE(ContactId)',_0x56d3('0x61'))['field'](_0x56d3('0x68'),_0x56d3('0x62'))[_0x56d3('0x37')](_0x56d3('0x69'),_0x56d3('0x63'))[_0x56d3('0x37')](_0x56d3('0x67'),_0x56d3('0x64'))[_0x56d3('0x37')](_0x56d3('0x67'),'updatedAt')[_0x56d3('0x6a')](_0x56d3('0x6b'))[_0x56d3('0x32')]('VoiceQueueId\x20=\x20?',_0xc9f49f['params']['id'][_0x56d3('0x6c')]())[_0x56d3('0x32')]('state\x20=\x20?',_0xc9f49f[_0x56d3('0x42')][_0x56d3('0x6d')][_0x56d3('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x56d3('0x32')](_0x56d3('0x6e'),squel[_0x56d3('0x66')]()['field'](_0x56d3('0x5f'))['from'](_0x56d3('0x5d'))['where'](_0x56d3('0x6f'),_0xc9f49f[_0x56d3('0x44')]['id'][_0x56d3('0x6c')]()))['where'](_0x56d3('0x6e'),squel[_0x56d3('0x66')]()['field'](_0x56d3('0x70'))[_0x56d3('0x6a')](_0x56d3('0x6b'))['where'](_0x56d3('0x6f'),_0xc9f49f[_0x56d3('0x44')]['id'][_0x56d3('0x6c')]())[_0x56d3('0x32')](_0x56d3('0x71')))['group'](_0x56d3('0x61')))[_0x56d3('0x6c')]();return db[_0x56d3('0x46')][_0x56d3('0x28')](_0x3f3369);}return[];})[_0x56d3('0x1f')](respondWithResult(_0x17844a,null))['catch'](handleError(_0x17844a,null));};exports[_0x56d3('0x72')]=function(_0x1c20be,_0xbca0f1,_0x5c4023){return db[_0x56d3('0x73')][_0x56d3('0x3f')]({'where':{'id':_0x1c20be[_0x56d3('0x44')]['id']}})[_0x56d3('0x1f')](handleEntityNotFound(_0xbca0f1,null))[_0x56d3('0x1f')](function(_0x35482d){var _0xc010c2;if(_0x35482d){_0xc010c2=squel['insert']()['into'](_0x56d3('0x5d'))[_0x56d3('0x5e')](['phone',_0x56d3('0x60'),_0x56d3('0x61'),_0x56d3('0x62'),'CampaignId','createdAt',_0x56d3('0x65')],squel['select']()[_0x56d3('0x37')](_0x56d3('0x74'),_0x56d3('0x5f'))[_0x56d3('0x37')](_0x56d3('0x67'),_0x56d3('0x60'))[_0x56d3('0x37')](_0x56d3('0x75'),_0x56d3('0x61'))[_0x56d3('0x37')](_0x56d3('0x68'),'ListId')[_0x56d3('0x37')](_0x56d3('0x76'),'CampaignId')[_0x56d3('0x37')]('NOW()','createdAt')[_0x56d3('0x37')](_0x56d3('0x67'),_0x56d3('0x65'))['from'](_0x56d3('0x6b'))[_0x56d3('0x32')](_0x56d3('0x77'),_0x1c20be[_0x56d3('0x44')]['id'][_0x56d3('0x6c')]())['where']('state\x20=\x20?',_0x1c20be[_0x56d3('0x42')][_0x56d3('0x6d')]['toString']())[_0x56d3('0x32')](_0x56d3('0x78'))[_0x56d3('0x32')](_0x56d3('0x6e'),squel[_0x56d3('0x66')]()['field'](_0x56d3('0x5f'))[_0x56d3('0x6a')](_0x56d3('0x5d'))['where'](_0x56d3('0x77'),_0x1c20be['params']['id'][_0x56d3('0x6c')]()))[_0x56d3('0x32')](_0x56d3('0x6e'),squel[_0x56d3('0x66')]()[_0x56d3('0x37')]('calleridnum')[_0x56d3('0x6a')]('cm_hopper_final')[_0x56d3('0x32')]('CampaignId\x20=\x20?',_0x1c20be[_0x56d3('0x44')]['id'][_0x56d3('0x6c')]())[_0x56d3('0x32')](_0x56d3('0x71')))['group'](_0x56d3('0x61')))[_0x56d3('0x6c')]();return db[_0x56d3('0x46')][_0x56d3('0x28')](_0xc010c2);}return[];})[_0x56d3('0x1f')](respondWithResult(_0xbca0f1,null))[_0x56d3('0x40')](handleError(_0xbca0f1,null));};exports[_0x56d3('0x79')]=function(_0x293e1e,_0x34e186,_0x5fe6cc){return db[_0x56d3('0x7a')][_0x56d3('0x7b')]({'where':{'VoiceQueueId':_0x293e1e[_0x56d3('0x42')][_0x56d3('0x63')],'CampaignId':_0x293e1e['body']['CampaignId'],'ContactId':_0x293e1e[_0x56d3('0x42')][_0x56d3('0x61')]}})['then'](handleEntityNotFound(_0x34e186,null))[_0x56d3('0x1f')](function(_0x52f90a){if(_0x52f90a){return _0x52f90a;}return null;})[_0x56d3('0x1f')](respondWithResult(_0x34e186,null))['catch'](handleError(_0x34e186,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1abf848..a389aaa 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 _0x323a=['../../config/logger','moment','bluebird','path','rimraf','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x2f6cf3,_0x281218){var _0xeebe3b=function(_0x3bb35f){while(--_0x3bb35f){_0x2f6cf3['push'](_0x2f6cf3['shift']());}};_0xeebe3b(++_0x281218);}(_0x323a,0x99));var _0xa323=function(_0x3f23d9,_0x4f118e){_0x3f23d9=_0x3f23d9-0x0;var _0x5f15be=_0x323a[_0x3f23d9];return _0x5f15be;};'use strict';var _=require(_0xa323('0x0'));var util=require('util');var logger=require(_0xa323('0x1'))('api');var moment=require(_0xa323('0x2'));var BPromise=require(_0xa323('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa323('0x4'));var rimraf=require(_0xa323('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xa323('0x6')]=function(_0x26bd57,_0x8935be){return _0x26bd57['define'](_0xa323('0x7'),attributes,{'tableName':_0xa323('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xa323('0x9')]},{'name':'uniqueid','fields':[_0xa323('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x173b=['./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5b58e2,_0x39808f){var _0x36a0cd=function(_0x593b7c){while(--_0x593b7c){_0x5b58e2['push'](_0x5b58e2['shift']());}};_0x36a0cd(++_0x39808f);}(_0x173b,0xad));var _0xb173=function(_0x1b69a4,_0x3e9f5f){_0x1b69a4=_0x1b69a4-0x0;var _0x4ab6a6=_0x173b[_0x1b69a4];return _0x4ab6a6;};'use strict';var _=require(_0xb173('0x0'));var util=require(_0xb173('0x1'));var logger=require(_0xb173('0x2'))(_0xb173('0x3'));var moment=require(_0xb173('0x4'));var BPromise=require(_0xb173('0x5'));var rp=require(_0xb173('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb173('0x7'));var config=require(_0xb173('0x8'));var attributes=require(_0xb173('0x9'));module['exports']=function(_0x280172,_0x5b30e8){return _0x280172[_0xb173('0xa')](_0xb173('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xb173('0xc'),'fields':[_0xb173('0xc')]},{'name':_0xb173('0xd'),'fields':[_0xb173('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 9787121..cab1e25 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 _0x750a=['error','code','CmHopperFinal,\x20%s,\x20%s','message','catch','body','options','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x7d4dc8,_0x14d70e){var _0x20b216=function(_0x3575b0){while(--_0x3575b0){_0x7d4dc8['push'](_0x7d4dc8['shift']());}};_0x20b216(++_0x14d70e);}(_0x750a,0x140));var _0xa750=function(_0x56b8a3,_0x412e85){_0x56b8a3=_0x56b8a3-0x0;var _0x39cc44=_0x750a[_0x56b8a3];return _0x39cc44;};'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});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['CreateCmHopperFinal']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['CmHopperFinal']['create'](_0x433dbd[_0xa750('0x15')],{'raw':_0x433dbd['options']?_0x433dbd[_0xa750('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xa750('0x17')](function(_0x4a007d){logger[_0xa750('0xc')]('CreateCmHopperFinal',_0x433dbd);logger[_0xa750('0xe')]('CreateCmHopperFinal',_0x433dbd,JSON['stringify'](_0x4a007d));_0x4f1faa(_0x4a007d);})[_0xa750('0x14')](function(_0x52da84){logger[_0xa750('0x10')]('CreateCmHopperFinal',_0x52da84['message'],_0x433dbd);_0x36dcca(_0x1bde87['error'](0x1f4,_0x52da84['message']));});});}; \ No newline at end of file +var _0xc6d8=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create','body','options','raw','CreateCmHopperFinal','lodash'];(function(_0x28e378,_0x42e118){var _0x294511=function(_0x44a0a4){while(--_0x44a0a4){_0x28e378['push'](_0x28e378['shift']());}};_0x294511(++_0x42e118);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x893787,_0x2ecfe4){_0x893787=_0x893787-0x0;var _0x4d2cb0=_0xc6d8[_0x893787];return _0x4d2cb0;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('CmHopperFinal,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['CreateCmHopperFinal']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['CmHopperFinal'][_0x8c6d('0x13')](_0x3e5495[_0x8c6d('0x14')],{'raw':_0x3e5495[_0x8c6d('0x15')]?_0x3e5495[_0x8c6d('0x15')][_0x8c6d('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5512be){logger['info'](_0x8c6d('0x17'),_0x3e5495);logger['debug'](_0x8c6d('0x17'),_0x3e5495,JSON['stringify'](_0x5512be));_0x4c2f8d(_0x5512be);})['catch'](function(_0x37fd7c){logger[_0x8c6d('0x10')]('CreateCmHopperFinal',_0x37fd7c['message'],_0x3e5495);_0x21b8ee(_0x5a22de['error'](0x1f4,_0x37fd7c['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6d4b6e7..70586e8 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x4a80f8,_0x4ad29a){var _0x4f0c29=function(_0x16f28f){while(--_0x16f28f){_0x4a80f8['push'](_0x4a80f8['shift']());}};_0x4f0c29(++_0x4ad29a);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x3b20de,_0x56bdfe){var _0x1ab210=function(_0x552161){while(--_0x552161){_0x3b20de['push'](_0x3b20de['shift']());}};_0x1ab210(++_0x56bdfe);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 06557ef..f5e7e37 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 _0x1159=['DATE','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x42ed24,_0x36048b){var _0x11bfc4=function(_0x380889){while(--_0x380889){_0x42ed24['push'](_0x42ed24['shift']());}};_0x11bfc4(++_0x36048b);}(_0x1159,0xf3));var _0x9115=function(_0x37896f,_0xfbd34d){_0x37896f=_0x37896f-0x0;var _0x543d6a=_0x1159[_0x37896f];return _0x543d6a;};'use strict';var Sequelize=require(_0x9115('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9115('0x1')]},'scheduledat':{'type':Sequelize[_0x9115('0x2')]},'countbusyretry':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9115('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x9115('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9115('0x1')]},'calleridname':{'type':Sequelize[_0x9115('0x1')]},'starttime':{'type':Sequelize[_0x9115('0x2')]},'responsetime':{'type':Sequelize[_0x9115('0x2')]},'answertime':{'type':Sequelize[_0x9115('0x2')]},'droptime':{'type':Sequelize[_0x9115('0x2')]},'endtime':{'type':Sequelize[_0x9115('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9115('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x9115('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9115('0x1')]},'reason':{'type':Sequelize[_0x9115('0x1')]},'amd':{'type':Sequelize[_0x9115('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9115('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9115('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9115('0x2')]},'recallme':{'type':Sequelize[_0x9115('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9115('0x2')]},'edited':{'type':Sequelize[_0x9115('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xeff8=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xeff8,0x186));var _0x8eff=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xeff8[_0xf0bc07];return _0x1c50c2;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8eff('0x2')]},'scheduledat':{'type':Sequelize[_0x8eff('0x3')]},'countbusyretry':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8eff('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x8eff('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8eff('0x2')]},'calleridname':{'type':Sequelize[_0x8eff('0x2')]},'starttime':{'type':Sequelize[_0x8eff('0x3')]},'responsetime':{'type':Sequelize[_0x8eff('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8eff('0x3')]},'endtime':{'type':Sequelize[_0x8eff('0x3')]},'ringtime':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8eff('0x2')]},'campaign':{'type':Sequelize[_0x8eff('0x2')]},'campaigntype':{'type':Sequelize[_0x8eff('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8eff('0x2')]},'amd':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8eff('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8eff('0x3')]},'edited':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d71de72..54376ed 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x494969,_0x2deef4){var _0x2d0f26=function(_0x3d4cac){while(--_0x3d4cac){_0x494969['push'](_0x494969['shift']());}};_0x2d0f26(++_0x2deef4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','update','uniqueid','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','CmHopperHistory','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x3971c4,_0xe986e7){var _0x13eedd=function(_0x1ef1f7){while(--_0x1ef1f7){_0x3971c4['push'](_0x3971c4['shift']());}};_0x13eedd(++_0xe986e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['CmHopperHistory'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){return db['CmHopperHistory'][_0x0a9e('0x41')]()['then'](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')]){delete _0x8d6dd1[_0x0a9e('0x40')][_0x0a9e('0x43')];}return db[_0x0a9e('0x24')][_0x0a9e('0x3e')]({'where':{'uniqueid':_0x8d6dd1[_0x0a9e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x3b')](handleError(_0x562fb4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index bf0f76a..2e2c631 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 _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0xfd061f,_0x119079){var _0x31c95a=function(_0x49f875){while(--_0x49f875){_0xfd061f['push'](_0xfd061f['shift']());}};_0x31c95a(++_0x119079);}(_0x34e8,0x12c));var _0x834e=function(_0x4388f7,_0x2ab60b){_0x4388f7=_0x4388f7-0x0;var _0x58dc99=_0x34e8[_0x4388f7];return _0x58dc99;};'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':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xd')]},{'name':_0x834e('0xe'),'fields':[_0x834e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','define'];(function(_0x5ac1f0,_0x557b2c){var _0x3b98a6=function(_0x45873c){while(--_0x45873c){_0x5ac1f0['push'](_0x5ac1f0['shift']());}};_0x3b98a6(++_0x557b2c);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x49c4('0xa')]},{'name':_0x49c4('0xb'),'fields':[_0x49c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index df624ca..fe869f0 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 _0x136c=['CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a2759,_0x285779){var _0x25d4e4=function(_0x8f08e1){while(--_0x8f08e1){_0x2a2759['push'](_0x2a2759['shift']());}};_0x25d4e4(++_0x285779);}(_0x136c,0x1d2));var _0xc136=function(_0x15501a,_0x5d6b93){_0x15501a=_0x15501a-0x0;var _0x33ecf1=_0x136c[_0x15501a];return _0x33ecf1;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['create'](_0x1ccf5f[_0xc136('0x18')],{'raw':_0x1ccf5f[_0xc136('0x19')]?_0x1ccf5f[_0xc136('0x19')][_0xc136('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8527){logger[_0xc136('0xd')]('CreateCmHopperHistory',_0x1ccf5f);logger[_0xc136('0x10')]('CreateCmHopperHistory',_0x1ccf5f,JSON['stringify'](_0x2b8527));_0x5df9b7(_0x2b8527);})[_0xc136('0x15')](function(_0x1a350a){logger['error'](_0xc136('0x16'),_0x1a350a[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1a350a[_0xc136('0x14')]));});});};exports['AvgHandleTime']=function(_0x6f0831){var _0x27719e=this;return new Promise(function(_0x584706,_0x3432b0){return db['CmHopperHistory'][_0xc136('0x1b')]({'raw':_0x6f0831[_0xc136('0x19')]?_0x6f0831['options']['raw']===undefined?!![]:![]:!![],'where':_0x6f0831[_0xc136('0x19')]?_0x6f0831[_0xc136('0x19')]['where']||null:null,'attributes':[[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')][_0xc136('0x1e')]('id')),_0xc136('0x1f')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x21')))),_0xc136('0x22')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0xc136('0x23')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xc136('0x24')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x25'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xc136('0x26')],[db[_0xc136('0x1c')]['fn']('AVG',db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x27')))),_0xc136('0x28')]]})[_0xc136('0x29')](function(_0xdaf3f1){logger[_0xc136('0xd')](_0xc136('0x2a'),_0x6f0831);logger[_0xc136('0x10')](_0xc136('0x2a'),_0x6f0831,JSON[_0xc136('0x12')](_0xdaf3f1));_0x584706(_0xdaf3f1);})['catch'](function(_0x20d05a){logger[_0xc136('0x13')](_0xc136('0x2a'),_0x20d05a[_0xc136('0x14')],_0x6f0831);_0x3432b0(_0x27719e[_0xc136('0x13')](0x1f4,_0x20d05a[_0xc136('0x14')]));});});};exports[_0xc136('0x2b')]=function(_0x513984){var _0x1ea381=this;return new Promise(function(_0x33c54c,_0x33e35e){return db[_0xc136('0x17')][_0xc136('0x1b')]({'raw':_0x513984[_0xc136('0x19')]?_0x513984[_0xc136('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x513984[_0xc136('0x19')]?_0x513984[_0xc136('0x19')][_0xc136('0x2c')]||null:null,'attributes':[[_0xc136('0x2d'),_0xc136('0x2e')],[db['sequelize']['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db['sequelize'][_0xc136('0x20')](_0xc136('0x2f')))),_0xc136('0x30')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xc136('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0xc136('0x31')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x21')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0xc136('0x32')],[db[_0xc136('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc136('0x20')](_0xc136('0x33')))),'outboundCongestionCallsDay'],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db['sequelize'][_0xc136('0x20')](_0xc136('0x34')))),_0xc136('0x35')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x36')))),_0xc136('0x37')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x38')))),_0xc136('0x39')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x3a')))),_0xc136('0x3b')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x3c')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x3d')))),'outboundRejectCallsDay'],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x3e')))),_0xc136('0x3f')],[db['sequelize']['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db['sequelize']['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x40')))),_0xc136('0x41')]],'group':[_0xc136('0x2d')]})[_0xc136('0x29')](function(_0x2e91d2){logger[_0xc136('0xd')](_0xc136('0x2b'),_0x513984);logger[_0xc136('0x10')]('GetVoiceQueueHopperHistory',_0x513984,JSON['stringify'](_0x2e91d2));_0x33c54c(_0x2e91d2);})[_0xc136('0x15')](function(_0x297158){logger[_0xc136('0x13')](_0xc136('0x2b'),_0x297158[_0xc136('0x14')],_0x513984);_0x33e35e(_0x1ea381[_0xc136('0x13')](0x1f4,_0x297158[_0xc136('0x14')]));});});};exports[_0xc136('0x42')]=function(_0x5c532b){var _0x485f64=this;return new Promise(function(_0x56f636,_0x5cc9ce){return db[_0xc136('0x17')]['findAll']({'raw':_0x5c532b['options']?_0x5c532b[_0xc136('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5c532b[_0xc136('0x19')]?_0x5c532b[_0xc136('0x19')]['where']||null:null,'attributes':[[_0xc136('0x2d'),_0xc136('0x2e')],[db[_0xc136('0x1c')]['fn']('COUNT',db['sequelize'][_0xc136('0x1e')]('id')),_0xc136('0x43')],[db[_0xc136('0x1c')]['fn'](_0xc136('0x1d'),db[_0xc136('0x1c')]['fn']('IF',db[_0xc136('0x1c')][_0xc136('0x20')](_0xc136('0x21')))),_0xc136('0x44')]],'group':[_0xc136('0x2d')]})[_0xc136('0x29')](function(_0x38c2a6){logger[_0xc136('0xd')](_0xc136('0x42'),_0x5c532b);logger[_0xc136('0x10')](_0xc136('0x42'),_0x5c532b,JSON[_0xc136('0x12')](_0x38c2a6));_0x56f636(_0x38c2a6);})[_0xc136('0x15')](function(_0x4360c4){logger[_0xc136('0x13')](_0xc136('0x42'),_0x4360c4['message'],_0x5c532b);_0x5cc9ce(_0x485f64['error'](0x1f4,_0x4360c4[_0xc136('0x14')]));});});}; \ No newline at end of file +var _0x9bc3=['`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','raw','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateCmHopperHistory','create','body','options','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','outboundNoSuchCallsDay','`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','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9bc3,0x137));var _0x39bc=function(_0x48d4e5,_0x45a903){_0x48d4e5=_0x48d4e5-0x0;var _0x1b1f21=_0x9bc3[_0x48d4e5];return _0x1b1f21;};'use strict';var _=require(_0x39bc('0x0'));var util=require(_0x39bc('0x1'));var moment=require(_0x39bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x39bc('0x3'));var fs=require('fs');var Redis=require(_0x39bc('0x4'));var db=require(_0x39bc('0x5'))['db'];var utils=require(_0x39bc('0x6'));var logger=require('../../config/logger')(_0x39bc('0x7'));var config=require(_0x39bc('0x8'));var jayson=require(_0x39bc('0x9'));var client=jayson[_0x39bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d6ce,_0x1367c6,_0x86cff3){return new BPromise(function(_0x10be27,_0x3fa4bd){return client[_0x39bc('0xb')](_0x38d6ce,_0x86cff3)[_0x39bc('0xc')](function(_0x2533c1){logger['info'](_0x39bc('0xd'),_0x1367c6,_0x39bc('0xe'));logger[_0x39bc('0xf')](_0x39bc('0x10'),_0x1367c6,_0x39bc('0xe'),JSON[_0x39bc('0x11')](_0x2533c1));if(_0x2533c1['error']){if(_0x2533c1['error'][_0x39bc('0x12')]===0x1f4){logger[_0x39bc('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')][_0x39bc('0x14')]);return _0x3fa4bd(_0x2533c1[_0x39bc('0x13')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1367c6,_0x2533c1[_0x39bc('0x13')]['message']);return _0x10be27(_0x2533c1['error'][_0x39bc('0x14')]);}else{logger[_0x39bc('0x15')]('CmHopperHistory,\x20%s,\x20%s',_0x1367c6,'request\x20sent');_0x10be27(_0x2533c1[_0x39bc('0x16')][_0x39bc('0x14')]);}})[_0x39bc('0x17')](function(_0x5d6b18){logger[_0x39bc('0x13')](_0x39bc('0xd'),_0x1367c6,_0x5d6b18);_0x3fa4bd(_0x5d6b18);});});}exports[_0x39bc('0x18')]=function(_0x1e121f){var _0x3064c1=this;return new Promise(function(_0x3f13c8,_0x311923){return db['CmHopperHistory'][_0x39bc('0x19')](_0x1e121f[_0x39bc('0x1a')],{'raw':_0x1e121f[_0x39bc('0x1b')]?_0x1e121f[_0x39bc('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x39bc('0xc')](function(_0x4ad3ef){logger[_0x39bc('0x15')]('CreateCmHopperHistory',_0x1e121f);logger[_0x39bc('0xf')](_0x39bc('0x18'),_0x1e121f,JSON[_0x39bc('0x11')](_0x4ad3ef));_0x3f13c8(_0x4ad3ef);})[_0x39bc('0x17')](function(_0x364873){logger['error'](_0x39bc('0x18'),_0x364873[_0x39bc('0x14')],_0x1e121f);_0x311923(_0x3064c1['error'](0x1f4,_0x364873[_0x39bc('0x14')]));});});};exports[_0x39bc('0x1c')]=function(_0x4fc150){var _0x5b2e62=this;return new Promise(function(_0x173f12,_0x2f0830){return db['CmHopperHistory'][_0x39bc('0x1d')]({'raw':_0x4fc150[_0x39bc('0x1b')]?_0x4fc150['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fc150['options']?_0x4fc150[_0x39bc('0x1b')][_0x39bc('0x1e')]||null:null,'attributes':[[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')][_0x39bc('0x21')]('id')),_0x39bc('0x22')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x24')))),_0x39bc('0x25')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x26')))),_0x39bc('0x27')],[db[_0x39bc('0x1f')]['fn']('COUNT',db[_0x39bc('0x1f')]['fn']('IF',db['sequelize'][_0x39bc('0x23')](_0x39bc('0x28')))),_0x39bc('0x29')],[db[_0x39bc('0x1f')]['fn']('AVG',db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x39bc('0x2a')],[db['sequelize']['fn'](_0x39bc('0x2b'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x2c')))),_0x39bc('0x2d')]]})[_0x39bc('0xc')](function(_0x24f179){logger[_0x39bc('0x15')](_0x39bc('0x1c'),_0x4fc150);logger[_0x39bc('0xf')](_0x39bc('0x1c'),_0x4fc150,JSON[_0x39bc('0x11')](_0x24f179));_0x173f12(_0x24f179);})[_0x39bc('0x17')](function(_0x84667c){logger[_0x39bc('0x13')](_0x39bc('0x1c'),_0x84667c['message'],_0x4fc150);_0x2f0830(_0x5b2e62['error'](0x1f4,_0x84667c[_0x39bc('0x14')]));});});};exports[_0x39bc('0x2e')]=function(_0x4f4163){var _0x276d38=this;return new Promise(function(_0x4288fe,_0x5a5fcf){return db[_0x39bc('0x2f')][_0x39bc('0x1d')]({'raw':_0x4f4163[_0x39bc('0x1b')]?_0x4f4163['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f4163['options']?_0x4f4163[_0x39bc('0x1b')][_0x39bc('0x1e')]||null:null,'attributes':[[_0x39bc('0x30'),_0x39bc('0x31')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db['sequelize']['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x39bc('0x32')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x39bc('0x33')))),_0x39bc('0x34')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x39bc('0x35')],[db['sequelize']['fn'](_0x39bc('0x20'),db['sequelize']['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x36')))),_0x39bc('0x37')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x39bc('0x23')](_0x39bc('0x38')))),_0x39bc('0x39')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db['sequelize']['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x39bc('0x3a')],[db[_0x39bc('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x3b')))),_0x39bc('0x3c')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x3d')))),_0x39bc('0x3e')],[db[_0x39bc('0x1f')]['fn']('COUNT',db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')]('`state`\x20=\x2013,\x201,\x20null'))),_0x39bc('0x3f')],[db[_0x39bc('0x1f')]['fn']('COUNT',db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x40')))),_0x39bc('0x41')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db['sequelize'][_0x39bc('0x23')](_0x39bc('0x42')))),_0x39bc('0x43')],[db['sequelize']['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db['sequelize'][_0x39bc('0x23')](_0x39bc('0x44')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x39bc('0x1f')]['fn']('IF',db['sequelize'][_0x39bc('0x23')](_0x39bc('0x45')))),_0x39bc('0x43')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x46')))),_0x39bc('0x47')]],'group':['campaign']})[_0x39bc('0xc')](function(_0x4a9c1f){logger[_0x39bc('0x15')](_0x39bc('0x2e'),_0x4f4163);logger['debug'](_0x39bc('0x2e'),_0x4f4163,JSON[_0x39bc('0x11')](_0x4a9c1f));_0x4288fe(_0x4a9c1f);})[_0x39bc('0x17')](function(_0x8ad0c3){logger[_0x39bc('0x13')]('GetVoiceQueueHopperHistory',_0x8ad0c3[_0x39bc('0x14')],_0x4f4163);_0x5a5fcf(_0x276d38[_0x39bc('0x13')](0x1f4,_0x8ad0c3[_0x39bc('0x14')]));});});};exports[_0x39bc('0x48')]=function(_0x108d03){var _0xaf3811=this;return new Promise(function(_0x797155,_0x2eefb7){return db[_0x39bc('0x2f')][_0x39bc('0x1d')]({'raw':_0x108d03['options']?_0x108d03[_0x39bc('0x1b')][_0x39bc('0x49')]===undefined?!![]:![]:!![],'where':_0x108d03['options']?_0x108d03[_0x39bc('0x1b')][_0x39bc('0x1e')]||null:null,'attributes':[[_0x39bc('0x30'),_0x39bc('0x31')],[db[_0x39bc('0x1f')]['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')][_0x39bc('0x21')]('id')),_0x39bc('0x4a')],[db['sequelize']['fn'](_0x39bc('0x20'),db[_0x39bc('0x1f')]['fn']('IF',db[_0x39bc('0x1f')][_0x39bc('0x23')](_0x39bc('0x24')))),_0x39bc('0x4b')]],'group':[_0x39bc('0x30')]})[_0x39bc('0xc')](function(_0x4a6a56){logger[_0x39bc('0x15')](_0x39bc('0x48'),_0x108d03);logger[_0x39bc('0xf')]('GetCampaignHopperHistory',_0x108d03,JSON[_0x39bc('0x11')](_0x4a6a56));_0x797155(_0x4a6a56);})[_0x39bc('0x17')](function(_0xe79197){logger['error'](_0x39bc('0x48'),_0xe79197[_0x39bc('0x14')],_0x108d03);_0x2eefb7(_0xaf3811[_0x39bc('0x13')](0x1f4,_0xe79197['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index fe3f018..768d5a0 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 _0x5419=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5419,0x175));var _0x9541=function(_0x28d2e5,_0x30179f){_0x28d2e5=_0x28d2e5-0x0;var _0x19372b=_0x5419[_0x28d2e5];return _0x19372b;};'use strict';var multer=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var path=require(_0x9541('0x2'));var timeout=require(_0x9541('0x3'));var express=require(_0x9541('0x4'));var router=express[_0x9541('0x5')]();var auth=require(_0x9541('0x6'));var interaction=require(_0x9541('0x7'));var config=require(_0x9541('0x8'));var controller=require(_0x9541('0x9'));router['get']('/',auth[_0x9541('0xa')](),controller[_0x9541('0xb')]);router[_0x9541('0xc')](_0x9541('0xd'),auth[_0x9541('0xa')](),controller[_0x9541('0xe')]);router[_0x9541('0xc')](_0x9541('0xf'),auth['isAuthenticated'](),controller[_0x9541('0x10')]);router['post']('/',auth[_0x9541('0xa')](),controller[_0x9541('0x11')]);router[_0x9541('0x12')](_0x9541('0xf'),auth[_0x9541('0xa')](),controller[_0x9541('0x13')]);module[_0x9541('0x14')]=router; \ No newline at end of file +var _0xcbd3=['./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x168054,_0x1ff8d9){var _0x2ff58f=function(_0x1b9e68){while(--_0x1b9e68){_0x168054['push'](_0x168054['shift']());}};_0x2ff58f(++_0x1ff8d9);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x58acaf,_0x4326f6){_0x58acaf=_0x58acaf-0x0;var _0x2b5780=_0xcbd3[_0x58acaf];return _0x2b5780;};'use strict';var multer=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var path=require(_0x3cbd('0x2'));var timeout=require(_0x3cbd('0x3'));var express=require(_0x3cbd('0x4'));var router=express[_0x3cbd('0x5')]();var auth=require(_0x3cbd('0x6'));var interaction=require(_0x3cbd('0x7'));var config=require(_0x3cbd('0x8'));var controller=require(_0x3cbd('0x9'));router['get']('/',auth[_0x3cbd('0xa')](),controller[_0x3cbd('0xb')]);router['get'](_0x3cbd('0xc'),auth['isAuthenticated'](),controller[_0x3cbd('0xd')]);router['get'](_0x3cbd('0xe'),auth[_0x3cbd('0xa')](),controller[_0x3cbd('0xf')]);router[_0x3cbd('0x10')]('/',auth[_0x3cbd('0xa')](),controller['create']);router[_0x3cbd('0x11')]('/:id',auth[_0x3cbd('0xa')](),controller[_0x3cbd('0x12')]);module[_0x3cbd('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index d8f6f2f..b8346be 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 _0x326f=['name','STRING','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x326f,0xd1));var _0xf326=function(_0x3803cb,_0x274044){_0x3803cb=_0x3803cb-0x0;var _0x4d4578=_0x326f[_0x3803cb];return _0x4d4578;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf326('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf326('0x2')]},'dialPrefix':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file +var _0x326f=['name','STRING','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x326f,0xd1));var _0xf326=function(_0x4cba8c,_0x1a8e6c){_0x4cba8c=_0x4cba8c-0x0;var _0x4d4d33=_0x326f[_0x4cba8c];return _0x4d4d33;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf326('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf326('0x2')]},'dialPrefix':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 312b0ae..5c41cba 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 _0x675a=['removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','localhost','redis','sendStatus','status','end','json','count','offset','set','reject','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','send','index','CmList','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','map','type','filter','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ListId','Disposition','removeDispositions','CmContact','tags','isArray','join','push','each','ids','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findOne','addAgents','spread','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x675a,0xfe));var _0xa675=function(_0x312944,_0x594eba){_0x312944=_0x312944-0x0;var _0x996a46=_0x675a[_0x312944];return _0x996a46;};'use strict';var pdf=require(_0xa675('0x0'));var emlformat=require(_0xa675('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa675('0x2'));var jsonpatch=require(_0xa675('0x3'));var rp=require(_0xa675('0x4'));var moment=require('moment');var BPromise=require(_0xa675('0x5'));var Mustache=require(_0xa675('0x6'));var util=require(_0xa675('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa675('0x8'));var ejs=require(_0xa675('0x9'));var fs=require('fs');var _=require(_0xa675('0xa'));var squel=require(_0xa675('0xb'));var crypto=require(_0xa675('0xc'));var jsforce=require(_0xa675('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa675('0x8'));var querystring=require(_0xa675('0xe'));var Papa=require('papaparse');var Redis=require(_0xa675('0xf'));var authService=require(_0xa675('0x10'));var qs=require(_0xa675('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa675('0x12'));var utils=require('../../config/utils');var config=require(_0xa675('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa675('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa675('0x15')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x54504b,_0x55c32e){_0x55c32e=_0x55c32e||0xcc;return function(_0x1f0722){if(_0x1f0722){return _0x54504b[_0xa675('0x16')](_0x55c32e);}return _0x54504b[_0xa675('0x17')](_0x55c32e)[_0xa675('0x18')]();};}function respondWithResult(_0x329e21,_0x3c893d){_0x3c893d=_0x3c893d||0xc8;return function(_0x5a4f80){if(_0x5a4f80){return _0x329e21[_0xa675('0x17')](_0x3c893d)[_0xa675('0x19')](_0x5a4f80);}};}function respondWithFilteredResult(_0x31170c,_0x8d9fd3){return function(_0x152e13){if(_0x152e13){var _0x27b1bc=_0x152e13[_0xa675('0x1a')],_0x4e50fe=_0x8d9fd3['offset'],_0x5dd40e=_0x8d9fd3[_0xa675('0x1b')]+_0x8d9fd3['limit'],_0x4f1a21;if(_0x5dd40e>=_0x27b1bc){_0x5dd40e=_0x27b1bc;_0x4f1a21=0xc8;}else{_0x4f1a21=0xce;}_0x31170c[_0xa675('0x17')](_0x4f1a21);return _0x31170c[_0xa675('0x1c')]('Content-Range',_0x4e50fe+'-'+_0x5dd40e+'/'+_0x27b1bc)[_0xa675('0x19')](_0x152e13);}return null;};}function patchUpdates(_0x186946){return function(_0x44e812){try{jsonpatch['apply'](_0x44e812,_0x186946,!![]);}catch(_0x3f8f92){return BPromise[_0xa675('0x1d')](_0x3f8f92);}return _0x44e812['save']();};}function saveUpdates(_0x1bdb54,_0x3c6605){return function(_0x2797d5){if(_0x2797d5){return _0x2797d5[_0xa675('0x1e')](_0x1bdb54)['then'](function(_0x2dcd5d){return _0x2dcd5d;});}return null;};}function removeEntity(_0x51505c,_0x32ea23){return function(_0x160c7b){if(_0x160c7b){return _0x160c7b['destroy']()[_0xa675('0x1f')](function(){var _0x1c9010=_0x160c7b[_0xa675('0x20')]({'plain':!![]});var _0x3b51de=_0xa675('0x21');return db[_0xa675('0x22')][_0xa675('0x23')]({'where':{'type':_0x3b51de,'resourceId':_0x1c9010['id']}})[_0xa675('0x1f')](function(){return _0x160c7b;});})[_0xa675('0x1f')](function(){_0x51505c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dae7f,_0x213407){return function(_0x4447a5){if(!_0x4447a5){_0x5dae7f['sendStatus'](0x194);}return _0x4447a5;};}function handleError(_0x2ed870,_0x4c1075){_0x4c1075=_0x4c1075||0x1f4;return function(_0x477450){logger[_0xa675('0x24')](_0x477450[_0xa675('0x25')]);if(_0x477450[_0xa675('0x26')]){delete _0x477450[_0xa675('0x26')];}_0x2ed870[_0xa675('0x17')](_0x4c1075)[_0xa675('0x27')](_0x477450);};}exports[_0xa675('0x28')]=function(_0x1ad6df,_0x1e1bdb){var _0x5c9a5a={},_0xa24667={},_0x495b4a={'count':0x0,'rows':[]};var _0x4d9c06=db[_0xa675('0x29')]['rawAttributes'];_0xa24667['model']=_[_0xa675('0x2a')](_0x4d9c06);_0xa24667[_0xa675('0x2b')]=_[_0xa675('0x2a')](_0x1ad6df[_0xa675('0x2b')]);_0xa24667[_0xa675('0x2c')]=_[_0xa675('0x2d')](_0xa24667[_0xa675('0x2e')],_0xa24667[_0xa675('0x2b')]);_0x5c9a5a[_0xa675('0x2f')]=_['intersection'](_0xa24667[_0xa675('0x2e')],qs[_0xa675('0x30')](_0x1ad6df['query'][_0xa675('0x30')]));_0x5c9a5a['attributes']=_0x5c9a5a[_0xa675('0x2f')][_0xa675('0x31')]?_0x5c9a5a[_0xa675('0x2f')]:_0xa24667['model'];if(!_0x1ad6df[_0xa675('0x2b')][_0xa675('0x32')](_0xa675('0x33'))){_0x5c9a5a[_0xa675('0x34')]=qs[_0xa675('0x34')](_0x1ad6df[_0xa675('0x2b')][_0xa675('0x34')]);_0x5c9a5a[_0xa675('0x1b')]=qs['offset'](_0x1ad6df[_0xa675('0x2b')]['offset']);}_0x5c9a5a[_0xa675('0x35')]=qs[_0xa675('0x36')](_0x1ad6df['query'][_0xa675('0x36')]);_0x5c9a5a['where']=qs[_0xa675('0x2c')](_[_0xa675('0x37')](_0x1ad6df[_0xa675('0x2b')],_0xa24667[_0xa675('0x2c')]));if(_0x1ad6df[_0xa675('0x2b')]['filter']){_0x5c9a5a['where']=_[_0xa675('0x38')](_0x5c9a5a[_0xa675('0x39')],{'$or':_[_0xa675('0x3a')](_0x4d9c06,function(_0x24b47c){if(_0x24b47c[_0xa675('0x3b')]['key']!=='VIRTUAL'){var _0x48faf1={};_0x48faf1[_0x24b47c['field']]={'$like':'%'+_0x1ad6df[_0xa675('0x2b')][_0xa675('0x3c')]+'%'};return _0x48faf1;}})});}_0x5c9a5a=_[_0xa675('0x38')]({},_0x5c9a5a,_0x1ad6df[_0xa675('0x3d')]);var _0x1213dd={'where':_0x5c9a5a[_0xa675('0x39')]};return db[_0xa675('0x29')][_0xa675('0x1a')](_0x1213dd)[_0xa675('0x1f')](function(_0x186f46){_0x495b4a[_0xa675('0x1a')]=_0x186f46;if(_0x1ad6df['query']['includeAll']){_0x5c9a5a[_0xa675('0x3e')]=[{'all':!![]}];}return db[_0xa675('0x29')][_0xa675('0x3f')](_0x5c9a5a);})['then'](function(_0x1029f4){_0x495b4a[_0xa675('0x40')]=_0x1029f4;return _0x495b4a;})['then'](respondWithFilteredResult(_0x1e1bdb,_0x5c9a5a))[_0xa675('0x41')](handleError(_0x1e1bdb,null));};exports[_0xa675('0x42')]=function(_0x10e507,_0x366ad7){var _0x423b79={'raw':![],'where':{'id':_0x10e507['params']['id']}},_0x2122a2={};_0x2122a2['model']=_['keys'](db['CmList'][_0xa675('0x43')]);_0x2122a2[_0xa675('0x2b')]=_[_0xa675('0x2a')](_0x10e507[_0xa675('0x2b')]);_0x2122a2['filters']=_['intersection'](_0x2122a2[_0xa675('0x2e')],_0x2122a2['query']);_0x423b79[_0xa675('0x2f')]=_[_0xa675('0x2d')](_0x2122a2[_0xa675('0x2e')],qs['fields'](_0x10e507[_0xa675('0x2b')][_0xa675('0x30')]));_0x423b79['attributes']=_0x423b79[_0xa675('0x2f')][_0xa675('0x31')]?_0x423b79[_0xa675('0x2f')]:_0x2122a2[_0xa675('0x2e')];if(_0x10e507[_0xa675('0x2b')][_0xa675('0x44')]){_0x423b79[_0xa675('0x3e')]=[{'all':!![]}];}_0x423b79=_[_0xa675('0x38')]({},_0x423b79,_0x10e507[_0xa675('0x3d')]);return db[_0xa675('0x29')][_0xa675('0x45')](_0x423b79)[_0xa675('0x1f')](handleEntityNotFound(_0x366ad7,null))['then'](respondWithResult(_0x366ad7,null))[_0xa675('0x41')](handleError(_0x366ad7,null));};exports[_0xa675('0x46')]=function(_0xadc25b,_0x4e99ea){return db[_0xa675('0x29')][_0xa675('0x46')](_0xadc25b[_0xa675('0x47')],{})['then'](function(_0x5ecdf0){var _0xd8cc8e=_0xadc25b[_0xa675('0x48')][_0xa675('0x20')]({'plain':!![]});if(!_0xd8cc8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd8cc8e['role']==='user'){var _0x36d4d7=_0x5ecdf0[_0xa675('0x20')]({'plain':!![]});var _0x118998=_0xa675('0x21');return db['UserProfileSection'][_0xa675('0x45')]({'where':{'name':_0x118998,'userProfileId':_0xd8cc8e[_0xa675('0x49')]},'raw':!![]})[_0xa675('0x1f')](function(_0xfb5169){if(_0xfb5169&&_0xfb5169[_0xa675('0x4a')]===0x0){return db[_0xa675('0x22')][_0xa675('0x46')]({'name':_0x36d4d7[_0xa675('0x26')],'resourceId':_0x36d4d7['id'],'type':_0xfb5169[_0xa675('0x26')],'sectionId':_0xfb5169['id']},{})[_0xa675('0x1f')](function(){return _0x5ecdf0;});}else{return _0x5ecdf0;}})[_0xa675('0x41')](function(_0x1d1941){logger[_0xa675('0x24')](_0xa675('0x4b'),_0x1d1941);throw _0x1d1941;});}return _0x5ecdf0;})[_0xa675('0x1f')](respondWithResult(_0x4e99ea,0xc9))[_0xa675('0x41')](handleError(_0x4e99ea,null));};exports[_0xa675('0x1e')]=function(_0x34ccc0,_0x30d82c){if(_0x34ccc0[_0xa675('0x47')]['id']){delete _0x34ccc0[_0xa675('0x47')]['id'];}return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x34ccc0[_0xa675('0x4c')]['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0x30d82c,null))[_0xa675('0x1f')](saveUpdates(_0x34ccc0[_0xa675('0x47')],null))[_0xa675('0x1f')](respondWithResult(_0x30d82c,null))[_0xa675('0x41')](handleError(_0x30d82c,null));};exports[_0xa675('0x23')]=function(_0x1cc92e,_0x1ff738){return db[_0xa675('0x29')]['find']({'where':{'id':_0x1cc92e[_0xa675('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ff738,null))[_0xa675('0x1f')](removeEntity(_0x1ff738,null))['catch'](handleError(_0x1ff738,null));};exports[_0xa675('0x4d')]=function(_0x3855fc,_0x75e2e0){return db['CmList'][_0xa675('0x4d')]()['then'](respondWithResult(_0x75e2e0,null))[_0xa675('0x41')](handleError(_0x75e2e0,null));};exports['addDisposition']=function(_0x372475,_0x4fbf7f,_0x100c5){if(_0x372475[_0xa675('0x47')]['id']){delete _0x372475[_0xa675('0x47')]['id'];}return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x372475[_0xa675('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4fbf7f,null))[_0xa675('0x1f')](function(_0x64b86f){if(_0x64b86f){_0x372475[_0xa675('0x47')][_0xa675('0x4e')]=_0x64b86f['id'];return db[_0xa675('0x4f')][_0xa675('0x46')](_0x372475['body']);}})[_0xa675('0x1f')](respondWithResult(_0x4fbf7f,null))['catch'](handleError(_0x4fbf7f,null));};exports['getDispositions']=function(_0x8e9679,_0x440316,_0x58d313){var _0x2c326d={'raw':![],'where':{}};var _0x3204a7={};var _0x8211bd={'count':0x0,'rows':[]};return db[_0xa675('0x29')]['findOne']({'where':{'id':_0x8e9679[_0xa675('0x4c')]['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0x440316,null))[_0xa675('0x1f')](function(_0xc55b4){if(_0xc55b4){_0x3204a7['model']=_[_0xa675('0x2a')](db[_0xa675('0x4f')][_0xa675('0x43')]);_0x3204a7[_0xa675('0x2b')]=_['keys'](_0x8e9679[_0xa675('0x2b')]);_0x3204a7[_0xa675('0x2c')]=_[_0xa675('0x2d')](_0x3204a7[_0xa675('0x2e')],_0x3204a7['query']);_0x2c326d[_0xa675('0x2f')]=_[_0xa675('0x2d')](_0x3204a7[_0xa675('0x2e')],qs[_0xa675('0x30')](_0x8e9679[_0xa675('0x2b')][_0xa675('0x30')]));_0x2c326d[_0xa675('0x2f')]=_0x2c326d[_0xa675('0x2f')][_0xa675('0x31')]?_0x2c326d[_0xa675('0x2f')]:_0x3204a7[_0xa675('0x2e')];if(!_0x8e9679[_0xa675('0x2b')][_0xa675('0x32')](_0xa675('0x33'))){_0x2c326d[_0xa675('0x34')]=qs[_0xa675('0x34')](_0x8e9679[_0xa675('0x2b')]['limit']);_0x2c326d['offset']=qs['offset'](_0x8e9679[_0xa675('0x2b')]['offset']);}_0x2c326d[_0xa675('0x35')]=qs[_0xa675('0x36')](_0x8e9679[_0xa675('0x2b')][_0xa675('0x36')]);_0x2c326d[_0xa675('0x39')]=qs[_0xa675('0x2c')](_[_0xa675('0x37')](_0x8e9679['query'],_0x3204a7[_0xa675('0x2c')]));_0x2c326d[_0xa675('0x39')]['ListId']=_0xc55b4['id'];if(_0x8e9679[_0xa675('0x2b')][_0xa675('0x3c')]){_0x2c326d[_0xa675('0x39')]=_['merge'](_0x2c326d['where'],{'$or':_[_0xa675('0x3a')](_0x2c326d[_0xa675('0x2f')],function(_0x5cab34){var _0x3b1ceb={};_0x3b1ceb[_0x5cab34]={'$like':'%'+_0x8e9679[_0xa675('0x2b')][_0xa675('0x3c')]+'%'};return _0x3b1ceb;})});}_0x2c326d=_['merge']({},_0x2c326d,_0x8e9679[_0xa675('0x3d')]);return db[_0xa675('0x4f')][_0xa675('0x1a')]({'where':_0x2c326d['where']})[_0xa675('0x1f')](function(_0x1631f7){_0x8211bd[_0xa675('0x1a')]=_0x1631f7;if(_0x8e9679[_0xa675('0x2b')][_0xa675('0x44')]){_0x2c326d[_0xa675('0x3e')]=[{'all':!![]}];}return db[_0xa675('0x4f')][_0xa675('0x3f')](_0x2c326d);})['then'](function(_0x101057){_0x8211bd['rows']=_0x101057;return _0x8211bd;});}})[_0xa675('0x1f')](respondWithFilteredResult(_0x440316,_0x2c326d))[_0xa675('0x41')](handleError(_0x440316,null));};exports[_0xa675('0x50')]=function(_0x4e52ac,_0x322134,_0x3415cd){return db[_0xa675('0x29')]['find']({'where':{'id':_0x4e52ac[_0xa675('0x4c')]['id']}})['then'](handleEntityNotFound(_0x322134,null))['then'](function(_0x1d4663){if(_0x1d4663){return _0x1d4663[_0xa675('0x50')](_0x4e52ac['query']['ids']);}})[_0xa675('0x1f')](respondWithStatusCode(_0x322134,null))[_0xa675('0x41')](handleError(_0x322134,null));};exports['addContacts']=function(_0x148003,_0x3b0436,_0x756bab){return db[_0xa675('0x29')]['find']({'where':{'id':_0x148003['params']['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0x3b0436,null))[_0xa675('0x1f')](function(_0x144920){if(_0x144920){var _0x542471=[];var _0x1518b8={'success':[],'errors':[]};return db[_0xa675('0x51')][_0xa675('0x4d')]()['then'](function(_0x3567f8){if(_0x148003[_0xa675('0x47')][_0xa675('0x52')]&&_[_0xa675('0x53')](_0x148003[_0xa675('0x47')][_0xa675('0x52')])){if(_0x148003[_0xa675('0x47')][_0xa675('0x52')]['length']){_0x148003[_0xa675('0x47')][_0xa675('0x52')]=_0x148003[_0xa675('0x47')]['tags'][_0xa675('0x54')](';')+';';}else{_0x148003[_0xa675('0x47')][_0xa675('0x52')]=null;}}else{_0x148003['body'][_0xa675('0x52')]=null;}if(_0x148003[_0xa675('0x47')]&&_[_0xa675('0x53')](_0x148003[_0xa675('0x47')])){for(var _0x2a7c19=0x0;_0x2a7c19<_0x148003[_0xa675('0x47')][_0xa675('0x31')];_0x2a7c19+=0x1){_0x148003['body'][_0x2a7c19][_0xa675('0x4e')]=_0x148003[_0xa675('0x4c')]['id'];_0x542471[_0xa675('0x55')](_0x148003[_0xa675('0x47')][_0x2a7c19]);}return BPromise[_0xa675('0x56')](_0x542471,function(_0xec6444){return db[_0xa675('0x51')][_0xa675('0x46')](_['omit'](_0xec6444,[_0xa675('0x57'),'id'])||{},{'fields':_['keys'](_0x3567f8),'raw':!![]})[_0xa675('0x1f')](function(_0x189af8){_0x1518b8[_0xa675('0x58')][_0xa675('0x55')](_0x189af8[_0xa675('0x59')]);})[_0xa675('0x41')](function(_0x290ec7){_0x1518b8[_0xa675('0x5a')][_0xa675('0x55')]({'data':_0xec6444,'error':_0x290ec7['message']});});})[_0xa675('0x1f')](function(_0x9efa09){return _0x1518b8;})[_0xa675('0x41')](function(_0xfb98a){return _0xfb98a;});}else{_0x3b0436[_0xa675('0x17')](0x190)[_0xa675('0x19')]({'message':_0xa675('0x5b')});}});}})[_0xa675('0x1f')](respondWithResult(_0x3b0436,null))[_0xa675('0x41')](handleError(_0x3b0436,null));};exports[_0xa675('0x5c')]=function(_0x5a20e9,_0x19b2e7,_0x1ba378){var _0x223963;return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x5a20e9[_0xa675('0x4c')]['id']},'include':[{'model':db[_0xa675('0x5d')],'as':_0xa675('0x5e')}]})[_0xa675('0x1f')](handleEntityNotFound(_0x19b2e7,null))[_0xa675('0x1f')](function(_0x1a1477){if(_0x1a1477){_0x223963=_0x1a1477;return db[_0xa675('0x51')][_0xa675('0x43')];}})['then'](function(_0x5e10b8){if(_0x5e10b8){var _0x1d0548={};var _0x4fab9d={};_0x4fab9d['model']=_['concat'](_[_0xa675('0x2a')](_0x5e10b8),_['map'](_0x223963[_0xa675('0x5e')],function(_0x705d3d){return util[_0xa675('0x5f')](_0xa675('0x60'),_0x705d3d['id']);}));_0x4fab9d[_0xa675('0x2b')]=_[_0xa675('0x2a')](_0x5a20e9[_0xa675('0x2b')]);_0x4fab9d[_0xa675('0x2c')]=_[_0xa675('0x2d')](_0x4fab9d[_0xa675('0x2e')],_0x4fab9d[_0xa675('0x2b')]);_0x1d0548[_0xa675('0x2f')]=_[_0xa675('0x2d')](_0x4fab9d[_0xa675('0x2e')],qs['fields'](_0x5a20e9[_0xa675('0x2b')]['fields']));_0x1d0548[_0xa675('0x2f')]=_0x1d0548[_0xa675('0x2f')]['length']?_0x1d0548['attributes']:_0x4fab9d[_0xa675('0x2e')];if(!_0x5a20e9[_0xa675('0x2b')]['hasOwnProperty']('nolimit')){_0x1d0548[_0xa675('0x34')]=qs[_0xa675('0x34')](_0x5a20e9[_0xa675('0x2b')][_0xa675('0x34')]);_0x1d0548[_0xa675('0x1b')]=qs[_0xa675('0x1b')](_0x5a20e9['query']['offset']);}_0x1d0548['order']=qs['sort'](_0x5a20e9[_0xa675('0x2b')]['sort']);_0x1d0548[_0xa675('0x39')]=qs[_0xa675('0x2c')](_[_0xa675('0x37')](_0x5a20e9[_0xa675('0x2b')],_0x4fab9d[_0xa675('0x2c')]));_0x1d0548['raw']=!![];if(_0x5a20e9['query'][_0xa675('0x3c')]){_0x1d0548['where']=_[_0xa675('0x38')](_0x1d0548[_0xa675('0x39')],{'$or':_[_0xa675('0x3a')](_0x1d0548[_0xa675('0x2f')],function(_0x10adb4){var _0x116bd7={};_0x116bd7[_0x10adb4]={'$like':'%'+_0x5a20e9['query'][_0xa675('0x3c')]+'%'};return _0x116bd7;})});}_0x1d0548=_['merge']({},_0x1d0548,_0x5a20e9[_0xa675('0x3d')]);return _0x223963[_0xa675('0x5c')](_0x1d0548);}})['then'](respondWithResult(_0x19b2e7,null))[_0xa675('0x41')](handleError(_0x19b2e7,null));};exports[_0xa675('0x61')]=function(_0x477ebf,_0x2c1909,_0x2eca1e){var _0x7ba6db;return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x477ebf[_0xa675('0x4c')]['id']},'include':[{'model':db[_0xa675('0x5d')],'as':'CustomFields'}]})[_0xa675('0x1f')](handleEntityNotFound(_0x2c1909,null))[_0xa675('0x1f')](function(_0x3ba1f9){if(_0x3ba1f9){_0x7ba6db=_0x3ba1f9;return db[_0xa675('0x51')][_0xa675('0x43')];}})['then'](function(_0x27049f){if(_0x27049f){var _0x18b597={};var _0x218b47={};_0x218b47[_0xa675('0x2e')]=_['concat'](_[_0xa675('0x2a')](_0x27049f),_[_0xa675('0x3a')](_0x7ba6db[_0xa675('0x5e')],function(_0x2b429f){return util[_0xa675('0x5f')](_0xa675('0x60'),_0x2b429f['id']);}));_0x218b47[_0xa675('0x2b')]=_['keys'](_0x477ebf['query']);_0x218b47[_0xa675('0x2c')]=_[_0xa675('0x2d')](_0x218b47[_0xa675('0x2e')],_0x218b47[_0xa675('0x2b')]);_0x18b597['attributes']=_[_0xa675('0x2d')](_0x218b47[_0xa675('0x2e')],qs[_0xa675('0x30')](_0x477ebf[_0xa675('0x2b')][_0xa675('0x30')]));_0x18b597['attributes']=_0x18b597[_0xa675('0x2f')][_0xa675('0x31')]?_0x18b597[_0xa675('0x2f')]:_0x218b47[_0xa675('0x2e')];if(!_0x477ebf[_0xa675('0x2b')][_0xa675('0x32')](_0xa675('0x33'))){_0x18b597[_0xa675('0x34')]=qs['limit'](_0x477ebf[_0xa675('0x2b')]['limit']);_0x18b597[_0xa675('0x1b')]=qs[_0xa675('0x1b')](_0x477ebf[_0xa675('0x2b')][_0xa675('0x1b')]);}_0x18b597[_0xa675('0x35')]=qs[_0xa675('0x36')](_0x477ebf[_0xa675('0x2b')][_0xa675('0x36')]);_0x18b597[_0xa675('0x39')]=qs[_0xa675('0x2c')](_[_0xa675('0x37')](_0x477ebf['query'],_0x218b47[_0xa675('0x2c')]));_0x18b597['raw']=!![];if(_0x477ebf[_0xa675('0x2b')][_0xa675('0x3c')]){_0x18b597['where']=_[_0xa675('0x38')](_0x18b597['where'],{'$or':_[_0xa675('0x3a')](_0x18b597[_0xa675('0x2f')],function(_0x3cde92){var _0x7081a7={};_0x7081a7[_0x3cde92]={'$like':'%'+_0x477ebf[_0xa675('0x2b')][_0xa675('0x3c')]+'%'};return _0x7081a7;})});}_0x18b597=_[_0xa675('0x38')]({},_0x18b597,_0x477ebf[_0xa675('0x3d')]);return _0x7ba6db[_0xa675('0x5c')](_0x18b597);}})['then'](function(_0x32ec50){if(!_['isEmpty'](_0x32ec50)){var _0x5ec776=toCsv(_0x32ec50);var _0x1f7c65=Date['now']();fs['writeFileSync'](util[_0xa675('0x5f')]('/tmp/list_%d_%s.csv',_0x7ba6db['id'],_0x1f7c65),_0x5ec776);_0x2c1909[_0xa675('0x62')](_0xa675('0x63'),_0xa675('0x64')+util['format']('list_%d_%s.csv',_0x7ba6db['id'],_0x1f7c65));_0x2c1909[_0xa675('0x62')](_0xa675('0x65'),'text/csv');return _0x2c1909[_0xa675('0x66')](util['format']('/tmp/list_%d_%s.csv',_0x7ba6db['id'],_0x1f7c65));}else{return _0x2c1909[_0xa675('0x16')](0xcc);}})[_0xa675('0x41')](handleError(_0x2c1909,null));};exports[_0xa675('0x67')]=function(_0x514a4e,_0xa368e2,_0x5d7ec1){var _0x7b27b7;delete _0x514a4e[_0xa675('0x47')]['id'];return db[_0xa675('0x29')]['findOne']({'where':{'id':_0x514a4e[_0xa675('0x4c')]['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0xa368e2,null))[_0xa675('0x1f')](function(_0x37b71c){if(_0x37b71c){return db[_0xa675('0x68')][_0xa675('0x69')](function(_0x119fa0){return db[_0xa675('0x5d')][_0xa675('0x46')](_0x514a4e[_0xa675('0x47')],{'transaction':_0x119fa0})['then'](function(_0x536d65){_0x7b27b7=_0x536d65;return _0x37b71c['addCustomFields'](_0x536d65,{'transaction':_0x119fa0});})[_0xa675('0x1f')](function(){var _0x661f8d={'type':db[_0xa675('0x6a')][_0xa675('0x6b')],'transaction':_0x119fa0};switch(_0x514a4e[_0xa675('0x47')][_0xa675('0x3b')]){case _0xa675('0x6c'):_0x661f8d[_0xa675('0x3b')]=db[_0xa675('0x6a')]['TEXT'];break;case _0xa675('0x6d'):_0x661f8d[_0xa675('0x3b')]=db[_0xa675('0x6a')][_0xa675('0x6e')];break;case _0xa675('0x6f'):_0x661f8d[_0xa675('0x3b')]=db[_0xa675('0x6a')][_0xa675('0x70')];_0x661f8d[_0xa675('0x71')]=![];break;default:}return db[_0xa675('0x68')][_0xa675('0x72')][_0xa675('0x73')]('cm_contacts',util[_0xa675('0x5f')]('cf_%s',_0x7b27b7['id']),_0x661f8d);})[_0xa675('0x1f')](function(){return _0x7b27b7;});});}})[_0xa675('0x1f')](respondWithResult(_0xa368e2,null))[_0xa675('0x41')](handleError(_0xa368e2,null));};exports[_0xa675('0x74')]=function(_0x560d1c,_0x376f19,_0x3b7330){var _0x2332d9={};var _0x2ea311={};var _0x4bb03e;var _0x38e032;return db['CmList'][_0xa675('0x75')]({'where':{'id':_0x560d1c['params']['id']}})['then'](handleEntityNotFound(_0x376f19,null))[_0xa675('0x1f')](function(_0x2a495d){if(_0x2a495d){_0x4bb03e=_0x2a495d;_0x2ea311[_0xa675('0x2e')]=_[_0xa675('0x2a')](db[_0xa675('0x5d')]['rawAttributes']);_0x2ea311['query']=_[_0xa675('0x2a')](_0x560d1c[_0xa675('0x2b')]);_0x2ea311['filters']=_['intersection'](_0x2ea311[_0xa675('0x2e')],_0x2ea311[_0xa675('0x2b')]);_0x2332d9[_0xa675('0x2f')]=_['intersection'](_0x2ea311[_0xa675('0x2e')],qs[_0xa675('0x30')](_0x560d1c['query'][_0xa675('0x30')]));_0x2332d9[_0xa675('0x2f')]=_0x2332d9[_0xa675('0x2f')][_0xa675('0x31')]?_0x2332d9[_0xa675('0x2f')]:_0x2ea311[_0xa675('0x2e')];_0x2332d9[_0xa675('0x35')]=qs['sort'](_0x560d1c[_0xa675('0x2b')][_0xa675('0x36')]);_0x2332d9[_0xa675('0x39')]=qs[_0xa675('0x2c')](_[_0xa675('0x37')](_0x560d1c[_0xa675('0x2b')],_0x2ea311[_0xa675('0x2c')]));_0x2332d9[_0xa675('0x39')]=_[_0xa675('0x38')](_0x2332d9[_0xa675('0x39')],{'$or':[{'ListId':_0x2a495d['id']},{'ListId':null}]});if(_0x560d1c['query'][_0xa675('0x3c')]){_0x2332d9[_0xa675('0x39')]=_['merge'](_0x2332d9[_0xa675('0x39')],{'$or':_[_0xa675('0x3a')](_0x2332d9[_0xa675('0x2f')],function(_0xcf2e51){var _0x54bbf5={};_0x54bbf5[_0xcf2e51]={'$like':'%'+_0x560d1c[_0xa675('0x2b')][_0xa675('0x3c')]+'%'};return _0x54bbf5;})});}_0x2332d9=_['merge']({},_0x2332d9,_0x560d1c['options']);return db[_0xa675('0x5d')]['findAndCountAll'](_0x2332d9);}})[_0xa675('0x1f')](respondWithResult(_0x376f19,null))[_0xa675('0x41')](handleError(_0x376f19,null));};exports['addAgents']=function(_0x5d032e,_0xd0cdc6,_0x3067ff){return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x5d032e[_0xa675('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd0cdc6,null))['then'](function(_0x5d5174){if(_0x5d5174){return _0x5d5174[_0xa675('0x76')](_0x5d032e['body'][_0xa675('0x57')],_['omit'](_0x5d032e[_0xa675('0x47')],[_0xa675('0x57'),'id'])||{})[_0xa675('0x77')](function(_0x1eb576){for(var _0x2addeb=0x0;_0x2addeb<_0x5d032e[_0xa675('0x47')][_0xa675('0x57')][_0xa675('0x31')];_0x2addeb+=0x1){socket[_0xa675('0x78')]('userCmList:save',{'UserId':_0x5d032e['body']['ids'][_0x2addeb],'CmListId':_0x5d032e[_0xa675('0x4c')]['id']});}return _0x1eb576;});}})[_0xa675('0x1f')](respondWithResult(_0xd0cdc6,null))[_0xa675('0x41')](handleError(_0xd0cdc6,null));};exports[_0xa675('0x79')]=function(_0x580306,_0x4fbde1,_0x43bdc7){return db[_0xa675('0x29')][_0xa675('0x45')]({'where':{'id':_0x580306[_0xa675('0x4c')]['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0x4fbde1,null))['then'](function(_0x316f6d){if(_0x316f6d){return _0x316f6d[_0xa675('0x79')](_0x580306[_0xa675('0x2b')][_0xa675('0x57')])[_0xa675('0x1f')](function(){if(_[_0xa675('0x53')](_0x580306[_0xa675('0x2b')]['ids'])){for(var _0x111e7a=0x0;_0x111e7a<_0x580306[_0xa675('0x2b')][_0xa675('0x57')][_0xa675('0x31')];_0x111e7a+=0x1){socket[_0xa675('0x78')]('userCmList:remove',{'UserId':Number(_0x580306[_0xa675('0x2b')][_0xa675('0x57')][_0x111e7a]),'CmListId':Number(_0x580306[_0xa675('0x4c')]['id'])});}}else{socket[_0xa675('0x78')](_0xa675('0x7a'),{'UserId':Number(_0x580306[_0xa675('0x2b')][_0xa675('0x57')]),'CmListId':Number(_0x580306['params']['id'])});}});}})[_0xa675('0x1f')](respondWithStatusCode(_0x4fbde1,null))[_0xa675('0x41')](handleError(_0x4fbde1,null));};exports[_0xa675('0x7b')]=function(_0x1d002e,_0x2baf01,_0x3e87e8){var _0x533075={};var _0x576359={};var _0x4df3a9;var _0x35a207;return db[_0xa675('0x29')][_0xa675('0x75')]({'where':{'id':_0x1d002e[_0xa675('0x4c')]['id']}})[_0xa675('0x1f')](handleEntityNotFound(_0x2baf01,null))[_0xa675('0x1f')](function(_0x2a6c84){if(_0x2a6c84){_0x4df3a9=_0x2a6c84;_0x576359[_0xa675('0x2e')]=_[_0xa675('0x2a')](db[_0xa675('0x7c')][_0xa675('0x43')]);_0x576359[_0xa675('0x2b')]=_[_0xa675('0x2a')](_0x1d002e[_0xa675('0x2b')]);_0x576359[_0xa675('0x2c')]=_['intersection'](_0x576359[_0xa675('0x2e')],_0x576359['query']);_0x533075['attributes']=_[_0xa675('0x2d')](_0x576359[_0xa675('0x2e')],qs[_0xa675('0x30')](_0x1d002e[_0xa675('0x2b')]['fields']));_0x533075[_0xa675('0x2f')]=_0x533075['attributes'][_0xa675('0x31')]?_0x533075[_0xa675('0x2f')]:_0x576359[_0xa675('0x2e')];_0x533075[_0xa675('0x35')]=qs['sort'](_0x1d002e['query'][_0xa675('0x36')]);_0x533075[_0xa675('0x39')]=qs[_0xa675('0x2c')](_['pick'](_0x1d002e['query'],_0x576359['filters']));if(_0x1d002e[_0xa675('0x2b')][_0xa675('0x3c')]){_0x533075['where']=_['merge'](_0x533075[_0xa675('0x39')],{'$or':_[_0xa675('0x3a')](_0x533075[_0xa675('0x2f')],function(_0x17d5a9){var _0x5bbf54={};_0x5bbf54[_0x17d5a9]={'$like':'%'+_0x1d002e[_0xa675('0x2b')]['filter']+'%'};return _0x5bbf54;})});}_0x533075=_['merge']({},_0x533075,_0x1d002e[_0xa675('0x3d')]);return _0x4df3a9[_0xa675('0x7b')](_0x533075);}})[_0xa675('0x1f')](function(_0x5d569a){if(_0x5d569a){_0x35a207=_0x5d569a[_0xa675('0x31')];if(!_0x1d002e[_0xa675('0x2b')][_0xa675('0x32')]('nolimit')){_0x533075[_0xa675('0x34')]=qs[_0xa675('0x34')](_0x1d002e['query'][_0xa675('0x34')]);_0x533075['offset']=qs[_0xa675('0x1b')](_0x1d002e['query'][_0xa675('0x1b')]);}return _0x4df3a9[_0xa675('0x7b')](_0x533075);}})[_0xa675('0x1f')](function(_0x250a9f){if(_0x250a9f){return _0x250a9f?{'count':_0x35a207,'rows':_0x250a9f}:null;}})[_0xa675('0x1f')](respondWithResult(_0x2baf01,null))[_0xa675('0x41')](handleError(_0x2baf01,null));}; \ No newline at end of file +var _0xa321=['sort','pick','where','merge','map','type','key','filter','options','count','include','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','ListId','includeAll','findAll','removeDispositions','ids','CmContact','tags','isArray','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','concat','CustomFields','format','getContactsCsv','CmCustomField','cf_%d','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','text','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','./cmList.socket','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','CmList','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5aba61,_0x1c4633){var _0x3ed40b=function(_0x554c0f){while(--_0x554c0f){_0x5aba61['push'](_0x5aba61['shift']());}};_0x3ed40b(++_0x1c4633);}(_0xa321,0x171));var _0x1a32=function(_0x174a2d,_0x44cf92){_0x174a2d=_0x174a2d-0x0;var _0x3a58c3=_0xa321[_0x174a2d];return _0x3a58c3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1a32('0x0'));var rimraf=require(_0x1a32('0x1'));var zipdir=require(_0x1a32('0x2'));var jsonpatch=require(_0x1a32('0x3'));var rp=require(_0x1a32('0x4'));var moment=require(_0x1a32('0x5'));var BPromise=require(_0x1a32('0x6'));var Mustache=require(_0x1a32('0x7'));var util=require(_0x1a32('0x8'));var path=require(_0x1a32('0x9'));var sox=require(_0x1a32('0xa'));var csv=require(_0x1a32('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1a32('0xc'));var crypto=require(_0x1a32('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1a32('0xb'));var querystring=require('querystring');var Papa=require(_0x1a32('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1a32('0xf'));var hardwareService=require(_0x1a32('0x10'));var logger=require(_0x1a32('0x11'))(_0x1a32('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1a32('0x13'))['db'];config['redis']=_['defaults'](config[_0x1a32('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a32('0x15'))['register'](socket);function respondWithStatusCode(_0x1b5a04,_0x3d89b9){_0x3d89b9=_0x3d89b9||0xcc;return function(_0x159d33){if(_0x159d33){return _0x1b5a04[_0x1a32('0x16')](_0x3d89b9);}return _0x1b5a04['status'](_0x3d89b9)[_0x1a32('0x17')]();};}function respondWithResult(_0x3944bf,_0x326728){_0x326728=_0x326728||0xc8;return function(_0x5dfafa){if(_0x5dfafa){return _0x3944bf[_0x1a32('0x18')](_0x326728)['json'](_0x5dfafa);}};}function respondWithFilteredResult(_0x510f3d,_0x2191fb){return function(_0x456cab){if(_0x456cab){var _0x588bb6=_0x456cab['count'],_0x3d2201=_0x2191fb[_0x1a32('0x19')],_0xf16ea3=_0x2191fb[_0x1a32('0x19')]+_0x2191fb[_0x1a32('0x1a')],_0x31878c;if(_0xf16ea3>=_0x588bb6){_0xf16ea3=_0x588bb6;_0x31878c=0xc8;}else{_0x31878c=0xce;}_0x510f3d['status'](_0x31878c);return _0x510f3d[_0x1a32('0x1b')](_0x1a32('0x1c'),_0x3d2201+'-'+_0xf16ea3+'/'+_0x588bb6)[_0x1a32('0x1d')](_0x456cab);}return null;};}function patchUpdates(_0x3a12c1){return function(_0x10c93c){try{jsonpatch[_0x1a32('0x1e')](_0x10c93c,_0x3a12c1,!![]);}catch(_0x5da1b4){return BPromise[_0x1a32('0x1f')](_0x5da1b4);}return _0x10c93c[_0x1a32('0x20')]();};}function saveUpdates(_0x52d331,_0x20fc89){return function(_0x59297c){if(_0x59297c){return _0x59297c[_0x1a32('0x21')](_0x52d331)[_0x1a32('0x22')](function(_0x9632fb){return _0x9632fb;});}return null;};}function removeEntity(_0x39179c,_0x206068){return function(_0x4f2018){if(_0x4f2018){return _0x4f2018['destroy']()[_0x1a32('0x22')](function(){var _0x55b0c2=_0x4f2018[_0x1a32('0x23')]({'plain':!![]});var _0x1f4c9d='Lists';return db[_0x1a32('0x24')][_0x1a32('0x25')]({'where':{'type':_0x1f4c9d,'resourceId':_0x55b0c2['id']}})[_0x1a32('0x22')](function(){return _0x4f2018;});})['then'](function(){_0x39179c[_0x1a32('0x18')](0xcc)[_0x1a32('0x17')]();});}};}function handleEntityNotFound(_0x4460f0,_0x330e90){return function(_0x5bbae9){if(!_0x5bbae9){_0x4460f0[_0x1a32('0x16')](0x194);}return _0x5bbae9;};}function handleError(_0x484438,_0x5e1305){_0x5e1305=_0x5e1305||0x1f4;return function(_0x5d9035){logger['error'](_0x5d9035[_0x1a32('0x26')]);if(_0x5d9035[_0x1a32('0x27')]){delete _0x5d9035[_0x1a32('0x27')];}_0x484438[_0x1a32('0x18')](_0x5e1305)[_0x1a32('0x28')](_0x5d9035);};}exports[_0x1a32('0x29')]=function(_0x1c97e3,_0x11460e){var _0x495a3b={},_0x2f32cb={},_0x2b08fd={'count':0x0,'rows':[]};var _0x10265d=db[_0x1a32('0x2a')]['rawAttributes'];_0x2f32cb[_0x1a32('0x2b')]=_[_0x1a32('0x2c')](_0x10265d);_0x2f32cb[_0x1a32('0x2d')]=_['keys'](_0x1c97e3['query']);_0x2f32cb[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x2f32cb[_0x1a32('0x2b')],_0x2f32cb[_0x1a32('0x2d')]);_0x495a3b[_0x1a32('0x30')]=_['intersection'](_0x2f32cb['model'],qs[_0x1a32('0x31')](_0x1c97e3[_0x1a32('0x2d')][_0x1a32('0x31')]));_0x495a3b[_0x1a32('0x30')]=_0x495a3b[_0x1a32('0x30')][_0x1a32('0x32')]?_0x495a3b[_0x1a32('0x30')]:_0x2f32cb['model'];if(!_0x1c97e3[_0x1a32('0x2d')][_0x1a32('0x33')](_0x1a32('0x34'))){_0x495a3b[_0x1a32('0x1a')]=qs[_0x1a32('0x1a')](_0x1c97e3[_0x1a32('0x2d')]['limit']);_0x495a3b[_0x1a32('0x19')]=qs[_0x1a32('0x19')](_0x1c97e3['query'][_0x1a32('0x19')]);}_0x495a3b[_0x1a32('0x35')]=qs['sort'](_0x1c97e3['query'][_0x1a32('0x36')]);_0x495a3b['where']=qs[_0x1a32('0x2e')](_[_0x1a32('0x37')](_0x1c97e3[_0x1a32('0x2d')],_0x2f32cb['filters']));if(_0x1c97e3[_0x1a32('0x2d')]['filter']){_0x495a3b[_0x1a32('0x38')]=_[_0x1a32('0x39')](_0x495a3b[_0x1a32('0x38')],{'$or':_[_0x1a32('0x3a')](_0x10265d,function(_0x484b6e){if(_0x484b6e[_0x1a32('0x3b')][_0x1a32('0x3c')]!=='VIRTUAL'){var _0xaee1ef={};_0xaee1ef[_0x484b6e['field']]={'$like':'%'+_0x1c97e3[_0x1a32('0x2d')][_0x1a32('0x3d')]+'%'};return _0xaee1ef;}})});}_0x495a3b=_[_0x1a32('0x39')]({},_0x495a3b,_0x1c97e3[_0x1a32('0x3e')]);var _0x1c440b={'where':_0x495a3b[_0x1a32('0x38')]};return db['CmList'][_0x1a32('0x3f')](_0x1c440b)[_0x1a32('0x22')](function(_0x502f2a){_0x2b08fd['count']=_0x502f2a;if(_0x1c97e3[_0x1a32('0x2d')]['includeAll']){_0x495a3b[_0x1a32('0x40')]=[{'all':!![]}];}return db[_0x1a32('0x2a')]['findAll'](_0x495a3b);})[_0x1a32('0x22')](function(_0x12847d){_0x2b08fd[_0x1a32('0x41')]=_0x12847d;return _0x2b08fd;})[_0x1a32('0x22')](respondWithFilteredResult(_0x11460e,_0x495a3b))['catch'](handleError(_0x11460e,null));};exports[_0x1a32('0x42')]=function(_0x2a54d9,_0x54dd0f){var _0x2eb752={'raw':![],'where':{'id':_0x2a54d9['params']['id']}},_0x3d5d90={};_0x3d5d90[_0x1a32('0x2b')]=_[_0x1a32('0x2c')](db[_0x1a32('0x2a')]['rawAttributes']);_0x3d5d90[_0x1a32('0x2d')]=_[_0x1a32('0x2c')](_0x2a54d9[_0x1a32('0x2d')]);_0x3d5d90['filters']=_[_0x1a32('0x2f')](_0x3d5d90['model'],_0x3d5d90[_0x1a32('0x2d')]);_0x2eb752[_0x1a32('0x30')]=_['intersection'](_0x3d5d90[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x2a54d9[_0x1a32('0x2d')]['fields']));_0x2eb752[_0x1a32('0x30')]=_0x2eb752[_0x1a32('0x30')][_0x1a32('0x32')]?_0x2eb752[_0x1a32('0x30')]:_0x3d5d90[_0x1a32('0x2b')];if(_0x2a54d9[_0x1a32('0x2d')]['includeAll']){_0x2eb752[_0x1a32('0x40')]=[{'all':!![]}];}_0x2eb752=_[_0x1a32('0x39')]({},_0x2eb752,_0x2a54d9['options']);return db[_0x1a32('0x2a')][_0x1a32('0x43')](_0x2eb752)[_0x1a32('0x22')](handleEntityNotFound(_0x54dd0f,null))[_0x1a32('0x22')](respondWithResult(_0x54dd0f,null))[_0x1a32('0x44')](handleError(_0x54dd0f,null));};exports['create']=function(_0xcc0b68,_0x5849b9){return db[_0x1a32('0x2a')][_0x1a32('0x45')](_0xcc0b68[_0x1a32('0x46')],{})[_0x1a32('0x22')](function(_0x2578c0){var _0x50d83f=_0xcc0b68[_0x1a32('0x47')][_0x1a32('0x23')]({'plain':!![]});if(!_0x50d83f)throw new Error(_0x1a32('0x48'));if(_0x50d83f[_0x1a32('0x49')]==='user'){var _0x56fcc6=_0x2578c0['get']({'plain':!![]});var _0x37ad7c=_0x1a32('0x4a');return db[_0x1a32('0x4b')]['find']({'where':{'name':_0x37ad7c,'userProfileId':_0x50d83f[_0x1a32('0x4c')]},'raw':!![]})['then'](function(_0x375180){if(_0x375180&&_0x375180[_0x1a32('0x4d')]===0x0){return db[_0x1a32('0x24')][_0x1a32('0x45')]({'name':_0x56fcc6[_0x1a32('0x27')],'resourceId':_0x56fcc6['id'],'type':_0x375180[_0x1a32('0x27')],'sectionId':_0x375180['id']},{})['then'](function(){return _0x2578c0;});}else{return _0x2578c0;}})[_0x1a32('0x44')](function(_0x5a2829){logger['error'](_0x1a32('0x4e'),_0x5a2829);throw _0x5a2829;});}return _0x2578c0;})['then'](respondWithResult(_0x5849b9,0xc9))['catch'](handleError(_0x5849b9,null));};exports[_0x1a32('0x21')]=function(_0x52bcf1,_0x38fcbd){if(_0x52bcf1[_0x1a32('0x46')]['id']){delete _0x52bcf1[_0x1a32('0x46')]['id'];}return db['CmList'][_0x1a32('0x43')]({'where':{'id':_0x52bcf1[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x38fcbd,null))[_0x1a32('0x22')](saveUpdates(_0x52bcf1[_0x1a32('0x46')],null))['then'](respondWithResult(_0x38fcbd,null))[_0x1a32('0x44')](handleError(_0x38fcbd,null));};exports[_0x1a32('0x25')]=function(_0x4509cb,_0x25ec8c){return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x4509cb['params']['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x25ec8c,null))['then'](removeEntity(_0x25ec8c,null))[_0x1a32('0x44')](handleError(_0x25ec8c,null));};exports['describe']=function(_0x36e917,_0x22d9a3){return db[_0x1a32('0x2a')][_0x1a32('0x50')]()[_0x1a32('0x22')](respondWithResult(_0x22d9a3,null))[_0x1a32('0x44')](handleError(_0x22d9a3,null));};exports[_0x1a32('0x51')]=function(_0x3d2cad,_0x498d61,_0x3993b0){if(_0x3d2cad[_0x1a32('0x46')]['id']){delete _0x3d2cad[_0x1a32('0x46')]['id'];}return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x3d2cad[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x498d61,null))['then'](function(_0x572156){if(_0x572156){_0x3d2cad[_0x1a32('0x46')]['ListId']=_0x572156['id'];return db[_0x1a32('0x52')]['create'](_0x3d2cad['body']);}})['then'](respondWithResult(_0x498d61,null))[_0x1a32('0x44')](handleError(_0x498d61,null));};exports[_0x1a32('0x53')]=function(_0x5f4dde,_0x56164f,_0x4abea7){var _0x1370a6={'raw':![],'where':{}};var _0x529505={};var _0x1074ca={'count':0x0,'rows':[]};return db[_0x1a32('0x2a')][_0x1a32('0x54')]({'where':{'id':_0x5f4dde['params']['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x56164f,null))[_0x1a32('0x22')](function(_0x2f9ddb){if(_0x2f9ddb){_0x529505[_0x1a32('0x2b')]=_[_0x1a32('0x2c')](db[_0x1a32('0x52')][_0x1a32('0x55')]);_0x529505['query']=_['keys'](_0x5f4dde[_0x1a32('0x2d')]);_0x529505[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x529505[_0x1a32('0x2b')],_0x529505[_0x1a32('0x2d')]);_0x1370a6[_0x1a32('0x30')]=_[_0x1a32('0x2f')](_0x529505[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x5f4dde[_0x1a32('0x2d')]['fields']));_0x1370a6['attributes']=_0x1370a6['attributes']['length']?_0x1370a6['attributes']:_0x529505[_0x1a32('0x2b')];if(!_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x33')](_0x1a32('0x34'))){_0x1370a6['limit']=qs['limit'](_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x1a')]);_0x1370a6['offset']=qs['offset'](_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x19')]);}_0x1370a6[_0x1a32('0x35')]=qs[_0x1a32('0x36')](_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x36')]);_0x1370a6[_0x1a32('0x38')]=qs[_0x1a32('0x2e')](_[_0x1a32('0x37')](_0x5f4dde[_0x1a32('0x2d')],_0x529505[_0x1a32('0x2e')]));_0x1370a6[_0x1a32('0x38')][_0x1a32('0x56')]=_0x2f9ddb['id'];if(_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x3d')]){_0x1370a6[_0x1a32('0x38')]=_[_0x1a32('0x39')](_0x1370a6[_0x1a32('0x38')],{'$or':_[_0x1a32('0x3a')](_0x1370a6[_0x1a32('0x30')],function(_0x21cdf9){var _0x5de0d3={};_0x5de0d3[_0x21cdf9]={'$like':'%'+_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x3d')]+'%'};return _0x5de0d3;})});}_0x1370a6=_[_0x1a32('0x39')]({},_0x1370a6,_0x5f4dde[_0x1a32('0x3e')]);return db[_0x1a32('0x52')][_0x1a32('0x3f')]({'where':_0x1370a6['where']})[_0x1a32('0x22')](function(_0x3d7e6e){_0x1074ca['count']=_0x3d7e6e;if(_0x5f4dde[_0x1a32('0x2d')][_0x1a32('0x57')]){_0x1370a6['include']=[{'all':!![]}];}return db['Disposition'][_0x1a32('0x58')](_0x1370a6);})[_0x1a32('0x22')](function(_0x165c3e){_0x1074ca[_0x1a32('0x41')]=_0x165c3e;return _0x1074ca;});}})[_0x1a32('0x22')](respondWithFilteredResult(_0x56164f,_0x1370a6))['catch'](handleError(_0x56164f,null));};exports[_0x1a32('0x59')]=function(_0x9a412a,_0x2ecb00,_0x234b99){return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x9a412a[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x2ecb00,null))[_0x1a32('0x22')](function(_0x24ff14){if(_0x24ff14){return _0x24ff14[_0x1a32('0x59')](_0x9a412a[_0x1a32('0x2d')][_0x1a32('0x5a')]);}})[_0x1a32('0x22')](respondWithStatusCode(_0x2ecb00,null))[_0x1a32('0x44')](handleError(_0x2ecb00,null));};exports['addContacts']=function(_0x9ad137,_0x1e81d8,_0x5bdf0f){return db['CmList']['find']({'where':{'id':_0x9ad137[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x1e81d8,null))['then'](function(_0x2b4834){if(_0x2b4834){var _0x58e41a=[];var _0x5d96c3={'success':[],'errors':[]};return db[_0x1a32('0x5b')][_0x1a32('0x50')]()['then'](function(_0x432a21){if(_0x9ad137[_0x1a32('0x46')][_0x1a32('0x5c')]&&_[_0x1a32('0x5d')](_0x9ad137[_0x1a32('0x46')][_0x1a32('0x5c')])){if(_0x9ad137['body'][_0x1a32('0x5c')]['length']){_0x9ad137[_0x1a32('0x46')][_0x1a32('0x5c')]=_0x9ad137[_0x1a32('0x46')]['tags']['join'](';')+';';}else{_0x9ad137['body'][_0x1a32('0x5c')]=null;}}else{_0x9ad137[_0x1a32('0x46')][_0x1a32('0x5c')]=null;}if(_0x9ad137[_0x1a32('0x46')]&&_['isArray'](_0x9ad137[_0x1a32('0x46')])){for(var _0x39f834=0x0;_0x39f834<_0x9ad137[_0x1a32('0x46')][_0x1a32('0x32')];_0x39f834+=0x1){_0x9ad137[_0x1a32('0x46')][_0x39f834][_0x1a32('0x56')]=_0x9ad137[_0x1a32('0x4f')]['id'];_0x58e41a['push'](_0x9ad137[_0x1a32('0x46')][_0x39f834]);}return BPromise[_0x1a32('0x5e')](_0x58e41a,function(_0x104bc0){return db[_0x1a32('0x5b')]['create'](_[_0x1a32('0x5f')](_0x104bc0,[_0x1a32('0x5a'),'id'])||{},{'fields':_[_0x1a32('0x2c')](_0x432a21),'raw':!![]})[_0x1a32('0x22')](function(_0x1a6ae6){_0x5d96c3[_0x1a32('0x60')][_0x1a32('0x61')](_0x1a6ae6[_0x1a32('0x62')]);})[_0x1a32('0x44')](function(_0x5c03a0){_0x5d96c3['errors'][_0x1a32('0x61')]({'data':_0x104bc0,'error':_0x5c03a0[_0x1a32('0x63')]});});})['then'](function(_0x29106c){return _0x5d96c3;})[_0x1a32('0x44')](function(_0x3195e6){return _0x3195e6;});}else{_0x1e81d8[_0x1a32('0x18')](0x190)[_0x1a32('0x1d')]({'message':_0x1a32('0x64')});}});}})[_0x1a32('0x22')](respondWithResult(_0x1e81d8,null))['catch'](handleError(_0x1e81d8,null));};exports[_0x1a32('0x65')]=function(_0x37040e,_0x36b46b,_0x628209){var _0xe7fada;return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x37040e[_0x1a32('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x36b46b,null))[_0x1a32('0x22')](function(_0x5a4f9e){if(_0x5a4f9e){_0xe7fada=_0x5a4f9e;return db[_0x1a32('0x5b')][_0x1a32('0x55')];}})[_0x1a32('0x22')](function(_0x51dd60){if(_0x51dd60){var _0x419b71={};var _0x52994e={};_0x52994e['model']=_[_0x1a32('0x66')](_['keys'](_0x51dd60),_[_0x1a32('0x3a')](_0xe7fada[_0x1a32('0x67')],function(_0x4e3ef6){return util[_0x1a32('0x68')]('cf_%d',_0x4e3ef6['id']);}));_0x52994e[_0x1a32('0x2d')]=_[_0x1a32('0x2c')](_0x37040e[_0x1a32('0x2d')]);_0x52994e[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x52994e['model'],_0x52994e[_0x1a32('0x2d')]);_0x419b71['attributes']=_[_0x1a32('0x2f')](_0x52994e[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x37040e[_0x1a32('0x2d')][_0x1a32('0x31')]));_0x419b71['attributes']=_0x419b71['attributes'][_0x1a32('0x32')]?_0x419b71['attributes']:_0x52994e[_0x1a32('0x2b')];if(!_0x37040e[_0x1a32('0x2d')][_0x1a32('0x33')]('nolimit')){_0x419b71[_0x1a32('0x1a')]=qs['limit'](_0x37040e[_0x1a32('0x2d')][_0x1a32('0x1a')]);_0x419b71[_0x1a32('0x19')]=qs[_0x1a32('0x19')](_0x37040e[_0x1a32('0x2d')][_0x1a32('0x19')]);}_0x419b71[_0x1a32('0x35')]=qs[_0x1a32('0x36')](_0x37040e['query'][_0x1a32('0x36')]);_0x419b71[_0x1a32('0x38')]=qs['filters'](_['pick'](_0x37040e[_0x1a32('0x2d')],_0x52994e['filters']));_0x419b71['raw']=!![];if(_0x37040e[_0x1a32('0x2d')]['filter']){_0x419b71['where']=_[_0x1a32('0x39')](_0x419b71[_0x1a32('0x38')],{'$or':_[_0x1a32('0x3a')](_0x419b71[_0x1a32('0x30')],function(_0x4907e2){var _0x25ca5d={};_0x25ca5d[_0x4907e2]={'$like':'%'+_0x37040e['query'][_0x1a32('0x3d')]+'%'};return _0x25ca5d;})});}_0x419b71=_['merge']({},_0x419b71,_0x37040e[_0x1a32('0x3e')]);return _0xe7fada['getContacts'](_0x419b71);}})['then'](respondWithResult(_0x36b46b,null))[_0x1a32('0x44')](handleError(_0x36b46b,null));};exports[_0x1a32('0x69')]=function(_0x33268c,_0x387627,_0x1093f5){var _0x147ccd;return db['CmList'][_0x1a32('0x43')]({'where':{'id':_0x33268c[_0x1a32('0x4f')]['id']},'include':[{'model':db[_0x1a32('0x6a')],'as':_0x1a32('0x67')}]})[_0x1a32('0x22')](handleEntityNotFound(_0x387627,null))[_0x1a32('0x22')](function(_0x3b4973){if(_0x3b4973){_0x147ccd=_0x3b4973;return db['CmContact'][_0x1a32('0x55')];}})[_0x1a32('0x22')](function(_0x132b65){if(_0x132b65){var _0xa3b6c3={};var _0x5c3db2={};_0x5c3db2[_0x1a32('0x2b')]=_[_0x1a32('0x66')](_[_0x1a32('0x2c')](_0x132b65),_[_0x1a32('0x3a')](_0x147ccd[_0x1a32('0x67')],function(_0x812b1e){return util[_0x1a32('0x68')](_0x1a32('0x6b'),_0x812b1e['id']);}));_0x5c3db2[_0x1a32('0x2d')]=_[_0x1a32('0x2c')](_0x33268c[_0x1a32('0x2d')]);_0x5c3db2[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x5c3db2[_0x1a32('0x2b')],_0x5c3db2['query']);_0xa3b6c3[_0x1a32('0x30')]=_['intersection'](_0x5c3db2[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x33268c['query']['fields']));_0xa3b6c3[_0x1a32('0x30')]=_0xa3b6c3['attributes'][_0x1a32('0x32')]?_0xa3b6c3[_0x1a32('0x30')]:_0x5c3db2[_0x1a32('0x2b')];if(!_0x33268c[_0x1a32('0x2d')][_0x1a32('0x33')](_0x1a32('0x34'))){_0xa3b6c3[_0x1a32('0x1a')]=qs[_0x1a32('0x1a')](_0x33268c[_0x1a32('0x2d')]['limit']);_0xa3b6c3[_0x1a32('0x19')]=qs[_0x1a32('0x19')](_0x33268c[_0x1a32('0x2d')][_0x1a32('0x19')]);}_0xa3b6c3[_0x1a32('0x35')]=qs[_0x1a32('0x36')](_0x33268c[_0x1a32('0x2d')][_0x1a32('0x36')]);_0xa3b6c3[_0x1a32('0x38')]=qs[_0x1a32('0x2e')](_[_0x1a32('0x37')](_0x33268c[_0x1a32('0x2d')],_0x5c3db2[_0x1a32('0x2e')]));_0xa3b6c3[_0x1a32('0x6c')]=!![];if(_0x33268c[_0x1a32('0x2d')][_0x1a32('0x3d')]){_0xa3b6c3[_0x1a32('0x38')]=_[_0x1a32('0x39')](_0xa3b6c3[_0x1a32('0x38')],{'$or':_['map'](_0xa3b6c3[_0x1a32('0x30')],function(_0x315bbc){var _0xee1117={};_0xee1117[_0x315bbc]={'$like':'%'+_0x33268c[_0x1a32('0x2d')][_0x1a32('0x3d')]+'%'};return _0xee1117;})});}_0xa3b6c3=_[_0x1a32('0x39')]({},_0xa3b6c3,_0x33268c[_0x1a32('0x3e')]);return _0x147ccd[_0x1a32('0x65')](_0xa3b6c3);}})[_0x1a32('0x22')](function(_0x19eea2){if(!_[_0x1a32('0x6d')](_0x19eea2)){var _0x19d470=toCsv(_0x19eea2);var _0x11ce34=Date['now']();fs[_0x1a32('0x6e')](util[_0x1a32('0x68')](_0x1a32('0x6f'),_0x147ccd['id'],_0x11ce34),_0x19d470);_0x387627['setHeader']('Content-disposition','attachment;\x20filename='+util[_0x1a32('0x68')](_0x1a32('0x70'),_0x147ccd['id'],_0x11ce34));_0x387627[_0x1a32('0x71')](_0x1a32('0x72'),_0x1a32('0x73'));return _0x387627[_0x1a32('0x74')](util[_0x1a32('0x68')](_0x1a32('0x6f'),_0x147ccd['id'],_0x11ce34));}else{return _0x387627[_0x1a32('0x16')](0xcc);}})[_0x1a32('0x44')](handleError(_0x387627,null));};exports[_0x1a32('0x75')]=function(_0x4266e1,_0x265b7e,_0xcc4701){var _0x26c57a;delete _0x4266e1['body']['id'];return db[_0x1a32('0x2a')]['findOne']({'where':{'id':_0x4266e1[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x265b7e,null))[_0x1a32('0x22')](function(_0x3d860e){if(_0x3d860e){return db[_0x1a32('0x76')][_0x1a32('0x77')](function(_0x448125){return db[_0x1a32('0x6a')][_0x1a32('0x45')](_0x4266e1[_0x1a32('0x46')],{'transaction':_0x448125})[_0x1a32('0x22')](function(_0x13992d){_0x26c57a=_0x13992d;return _0x3d860e[_0x1a32('0x78')](_0x13992d,{'transaction':_0x448125});})['then'](function(){var _0x219258={'type':db['Sequelize']['TEXT'],'transaction':_0x448125};switch(_0x4266e1[_0x1a32('0x46')]['type']){case _0x1a32('0x79'):_0x219258[_0x1a32('0x3b')]=db[_0x1a32('0x7a')][_0x1a32('0x7b')];break;case _0x1a32('0x7c'):_0x219258['type']=db['Sequelize']['INTEGER'];break;case _0x1a32('0x7d'):_0x219258[_0x1a32('0x3b')]=db['Sequelize'][_0x1a32('0x7e')];_0x219258[_0x1a32('0x7f')]=![];break;default:}return db[_0x1a32('0x76')][_0x1a32('0x80')][_0x1a32('0x81')](_0x1a32('0x82'),util['format'](_0x1a32('0x83'),_0x26c57a['id']),_0x219258);})[_0x1a32('0x22')](function(){return _0x26c57a;});});}})[_0x1a32('0x22')](respondWithResult(_0x265b7e,null))[_0x1a32('0x44')](handleError(_0x265b7e,null));};exports[_0x1a32('0x84')]=function(_0x39ddf2,_0x1b395b,_0x2ac1c9){var _0x6350b4={};var _0x31c50a={};var _0xd09a59;var _0x24e3cf;return db[_0x1a32('0x2a')][_0x1a32('0x54')]({'where':{'id':_0x39ddf2[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x1b395b,null))[_0x1a32('0x22')](function(_0x17a0e4){if(_0x17a0e4){_0xd09a59=_0x17a0e4;_0x31c50a[_0x1a32('0x2b')]=_[_0x1a32('0x2c')](db[_0x1a32('0x6a')]['rawAttributes']);_0x31c50a['query']=_[_0x1a32('0x2c')](_0x39ddf2[_0x1a32('0x2d')]);_0x31c50a['filters']=_['intersection'](_0x31c50a[_0x1a32('0x2b')],_0x31c50a[_0x1a32('0x2d')]);_0x6350b4[_0x1a32('0x30')]=_[_0x1a32('0x2f')](_0x31c50a[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x39ddf2['query'][_0x1a32('0x31')]));_0x6350b4['attributes']=_0x6350b4[_0x1a32('0x30')][_0x1a32('0x32')]?_0x6350b4[_0x1a32('0x30')]:_0x31c50a['model'];_0x6350b4['order']=qs[_0x1a32('0x36')](_0x39ddf2['query'][_0x1a32('0x36')]);_0x6350b4[_0x1a32('0x38')]=qs['filters'](_[_0x1a32('0x37')](_0x39ddf2['query'],_0x31c50a['filters']));_0x6350b4[_0x1a32('0x38')]=_[_0x1a32('0x39')](_0x6350b4['where'],{'$or':[{'ListId':_0x17a0e4['id']},{'ListId':null}]});if(_0x39ddf2[_0x1a32('0x2d')][_0x1a32('0x3d')]){_0x6350b4[_0x1a32('0x38')]=_[_0x1a32('0x39')](_0x6350b4[_0x1a32('0x38')],{'$or':_[_0x1a32('0x3a')](_0x6350b4[_0x1a32('0x30')],function(_0x48e86d){var _0x3e6757={};_0x3e6757[_0x48e86d]={'$like':'%'+_0x39ddf2[_0x1a32('0x2d')]['filter']+'%'};return _0x3e6757;})});}_0x6350b4=_[_0x1a32('0x39')]({},_0x6350b4,_0x39ddf2[_0x1a32('0x3e')]);return db[_0x1a32('0x6a')][_0x1a32('0x85')](_0x6350b4);}})[_0x1a32('0x22')](respondWithResult(_0x1b395b,null))[_0x1a32('0x44')](handleError(_0x1b395b,null));};exports[_0x1a32('0x86')]=function(_0x3b5db8,_0x34666a,_0x4bf452){return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x3b5db8[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x34666a,null))['then'](function(_0x3efc5a){if(_0x3efc5a){return _0x3efc5a[_0x1a32('0x86')](_0x3b5db8[_0x1a32('0x46')]['ids'],_['omit'](_0x3b5db8[_0x1a32('0x46')],[_0x1a32('0x5a'),'id'])||{})[_0x1a32('0x87')](function(_0x52986c){for(var _0x24b985=0x0;_0x24b985<_0x3b5db8[_0x1a32('0x46')][_0x1a32('0x5a')][_0x1a32('0x32')];_0x24b985+=0x1){socket[_0x1a32('0x88')](_0x1a32('0x89'),{'UserId':_0x3b5db8[_0x1a32('0x46')][_0x1a32('0x5a')][_0x24b985],'CmListId':_0x3b5db8[_0x1a32('0x4f')]['id']});}return _0x52986c;});}})[_0x1a32('0x22')](respondWithResult(_0x34666a,null))[_0x1a32('0x44')](handleError(_0x34666a,null));};exports['removeAgents']=function(_0x34bc4a,_0x52d54a,_0x339a90){return db[_0x1a32('0x2a')][_0x1a32('0x43')]({'where':{'id':_0x34bc4a[_0x1a32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52d54a,null))[_0x1a32('0x22')](function(_0x2f6a33){if(_0x2f6a33){return _0x2f6a33[_0x1a32('0x8a')](_0x34bc4a[_0x1a32('0x2d')][_0x1a32('0x5a')])[_0x1a32('0x22')](function(){if(_[_0x1a32('0x5d')](_0x34bc4a[_0x1a32('0x2d')][_0x1a32('0x5a')])){for(var _0x303d1d=0x0;_0x303d1d<_0x34bc4a[_0x1a32('0x2d')]['ids'][_0x1a32('0x32')];_0x303d1d+=0x1){socket[_0x1a32('0x88')]('userCmList:remove',{'UserId':Number(_0x34bc4a[_0x1a32('0x2d')]['ids'][_0x303d1d]),'CmListId':Number(_0x34bc4a['params']['id'])});}}else{socket[_0x1a32('0x88')](_0x1a32('0x8b'),{'UserId':Number(_0x34bc4a['query'][_0x1a32('0x5a')]),'CmListId':Number(_0x34bc4a[_0x1a32('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x52d54a,null))[_0x1a32('0x44')](handleError(_0x52d54a,null));};exports[_0x1a32('0x8c')]=function(_0x13d4ec,_0x3adaf6,_0x3bf1fc){var _0x40f4d6={};var _0x468d18={};var _0x3a711f;var _0xde4dc2;return db[_0x1a32('0x2a')][_0x1a32('0x54')]({'where':{'id':_0x13d4ec[_0x1a32('0x4f')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x3adaf6,null))['then'](function(_0x3ff6cb){if(_0x3ff6cb){_0x3a711f=_0x3ff6cb;_0x468d18[_0x1a32('0x2b')]=_[_0x1a32('0x2c')](db['User'][_0x1a32('0x55')]);_0x468d18['query']=_[_0x1a32('0x2c')](_0x13d4ec[_0x1a32('0x2d')]);_0x468d18[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x468d18[_0x1a32('0x2b')],_0x468d18[_0x1a32('0x2d')]);_0x40f4d6[_0x1a32('0x30')]=_[_0x1a32('0x2f')](_0x468d18[_0x1a32('0x2b')],qs[_0x1a32('0x31')](_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x31')]));_0x40f4d6[_0x1a32('0x30')]=_0x40f4d6['attributes'][_0x1a32('0x32')]?_0x40f4d6[_0x1a32('0x30')]:_0x468d18['model'];_0x40f4d6['order']=qs[_0x1a32('0x36')](_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x36')]);_0x40f4d6['where']=qs[_0x1a32('0x2e')](_[_0x1a32('0x37')](_0x13d4ec[_0x1a32('0x2d')],_0x468d18['filters']));if(_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x3d')]){_0x40f4d6['where']=_[_0x1a32('0x39')](_0x40f4d6['where'],{'$or':_['map'](_0x40f4d6['attributes'],function(_0x18db37){var _0x38d4e3={};_0x38d4e3[_0x18db37]={'$like':'%'+_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x3d')]+'%'};return _0x38d4e3;})});}_0x40f4d6=_[_0x1a32('0x39')]({},_0x40f4d6,_0x13d4ec[_0x1a32('0x3e')]);return _0x3a711f['getAgents'](_0x40f4d6);}})[_0x1a32('0x22')](function(_0x1d7e3d){if(_0x1d7e3d){_0xde4dc2=_0x1d7e3d[_0x1a32('0x32')];if(!_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x33')]('nolimit')){_0x40f4d6[_0x1a32('0x1a')]=qs[_0x1a32('0x1a')](_0x13d4ec['query'][_0x1a32('0x1a')]);_0x40f4d6[_0x1a32('0x19')]=qs[_0x1a32('0x19')](_0x13d4ec[_0x1a32('0x2d')][_0x1a32('0x19')]);}return _0x3a711f[_0x1a32('0x8c')](_0x40f4d6);}})[_0x1a32('0x22')](function(_0x532b3f){if(_0x532b3f){return _0x532b3f?{'count':_0xde4dc2,'rows':_0x532b3f}:null;}})[_0x1a32('0x22')](respondWithResult(_0x3adaf6,null))['catch'](handleError(_0x3adaf6,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1d41013..45f76af 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 _0x83a8=['update','remove','emit','hook','exports','events','../../mysqldb','CmList','save'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x83a8,0x149));var _0x883a=function(_0x1f28b1,_0x462b32){_0x1f28b1=_0x1f28b1-0x0;var _0x57d103=_0x83a8[_0x1f28b1];return _0x57d103;};'use strict';var EventEmitter=require(_0x883a('0x0'));var CmList=require(_0x883a('0x1'))['db'][_0x883a('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x883a('0x3'),'afterUpdate':_0x883a('0x4'),'afterDestroy':_0x883a('0x5')};function emitEvent(_0x3f4b7c){return function(_0x4d7e02,_0x368e80,_0x3dbf95){CmListEvents['emit'](_0x3f4b7c+':'+_0x4d7e02['id'],_0x4d7e02);CmListEvents[_0x883a('0x6')](_0x3f4b7c,_0x4d7e02);_0x3dbf95(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x883a('0x7')](e,emitEvent(event));}}module[_0x883a('0x8')]=CmListEvents; \ No newline at end of file +var _0x0fcf=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2a8ba5,_0x1f7e3c){var _0x467d44=function(_0x46be50){while(--_0x46be50){_0x2a8ba5['push'](_0x2a8ba5['shift']());}};_0x467d44(++_0x1f7e3c);}(_0x0fcf,0x1af));var _0xf0fc=function(_0x332d6c,_0x8eb626){_0x332d6c=_0x332d6c-0x0;var _0x1af1bd=_0x0fcf[_0x332d6c];return _0x1af1bd;};'use strict';var EventEmitter=require(_0xf0fc('0x0'));var CmList=require(_0xf0fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0fc('0x2'),'afterUpdate':_0xf0fc('0x3'),'afterDestroy':_0xf0fc('0x4')};function emitEvent(_0x5bef83){return function(_0x1cc608,_0x20ed04,_0x5eb6e6){CmListEvents[_0xf0fc('0x5')](_0x5bef83+':'+_0x1cc608['id'],_0x1cc608);CmListEvents[_0xf0fc('0x5')](_0x5bef83,_0x1cc608);_0x5eb6e6(null);};}for(var e in events){if(events[_0xf0fc('0x6')](e)){var event=events[e];CmList[_0xf0fc('0x7')](e,emitEvent(event));}}module[_0xf0fc('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 ec7099d..64af151 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 _0x9585=['CmList','cm_lists','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define'];(function(_0x78881f,_0x3d584a){var _0x1e6b33=function(_0x10bb1c){while(--_0x10bb1c){_0x78881f['push'](_0x78881f['shift']());}};_0x1e6b33(++_0x3d584a);}(_0x9585,0x15e));var _0x5958=function(_0x11e45f,_0x111c88){_0x11e45f=_0x11e45f-0x0;var _0x4f21dd=_0x9585[_0x11e45f];return _0x4f21dd;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require('../../config/logger')(_0x5958('0x1'));var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var fs=require('fs');var path=require(_0x5958('0x5'));var rimraf=require(_0x5958('0x6'));var config=require(_0x5958('0x7'));var attributes=require(_0x5958('0x8'));module['exports']=function(_0x202d6f,_0x48ddaf){return _0x202d6f[_0x5958('0x9')](_0x5958('0xa'),attributes,{'tableName':_0x5958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ebf=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmList','cm_lists'];(function(_0xe90c52,_0x4a190d){var _0x1c8334=function(_0x121ce1){while(--_0x121ce1){_0xe90c52['push'](_0xe90c52['shift']());}};_0x1c8334(++_0x4a190d);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x8ebf[_0x37756b];return _0x46efec;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('api');var moment=require(_0xf8eb('0x3'));var BPromise=require(_0xf8eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8eb('0x5'));var rimraf=require(_0xf8eb('0x6'));var config=require(_0xf8eb('0x7'));var attributes=require('./cmList.attributes');module[_0xf8eb('0x8')]=function(_0x36fde3,_0x4cbeaa){return _0x36fde3[_0xf8eb('0x9')](_0xf8eb('0xa'),attributes,{'tableName':_0xf8eb('0xb'),'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 46a60d2..7b1468c 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 _0x09d4=['http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a0916,_0x4abc9a){var _0x5a9bd6=function(_0x51aa1f){while(--_0x51aa1f){_0x3a0916['push'](_0x3a0916['shift']());}};_0x5a9bd6(++_0x4abc9a);}(_0x09d4,0x1c3));var _0x409d=function(_0x4dfedb,_0x496cbb){_0x4dfedb=_0x4dfedb-0x0;var _0x34636f=_0x09d4[_0x4dfedb];return _0x34636f;};'use strict';var _=require(_0x409d('0x0'));var util=require(_0x409d('0x1'));var moment=require(_0x409d('0x2'));var BPromise=require(_0x409d('0x3'));var rs=require(_0x409d('0x4'));var fs=require('fs');var Redis=require(_0x409d('0x5'));var db=require(_0x409d('0x6'))['db'];var utils=require(_0x409d('0x7'));var logger=require(_0x409d('0x8'))(_0x409d('0x9'));var config=require(_0x409d('0xa'));var jayson=require(_0x409d('0xb'));var client=jayson[_0x409d('0xc')][_0x409d('0xd')]({'port':0x232a});config[_0x409d('0xe')]=_[_0x409d('0xf')](config['redis'],{'host':_0x409d('0x10'),'port':0x18eb});var socket=require(_0x409d('0x11'))(new Redis(config[_0x409d('0xe')]));require(_0x409d('0x12'))[_0x409d('0x13')](socket);function respondWithRpcPromise(_0x11179f,_0x4a5b90,_0x1a1096){return new BPromise(function(_0x14085c,_0x142234){return client['request'](_0x11179f,_0x1a1096)[_0x409d('0x14')](function(_0x54ee93){logger['info'](_0x409d('0x15'),_0x4a5b90,_0x409d('0x16'));logger[_0x409d('0x17')](_0x409d('0x18'),_0x4a5b90,_0x409d('0x16'),JSON['stringify'](_0x54ee93));if(_0x54ee93[_0x409d('0x19')]){if(_0x54ee93['error'][_0x409d('0x1a')]===0x1f4){logger[_0x409d('0x19')](_0x409d('0x15'),_0x4a5b90,_0x54ee93[_0x409d('0x19')]['message']);return _0x142234(_0x54ee93[_0x409d('0x19')][_0x409d('0x1b')]);}logger[_0x409d('0x19')](_0x409d('0x15'),_0x4a5b90,_0x54ee93[_0x409d('0x19')]['message']);return _0x14085c(_0x54ee93[_0x409d('0x19')][_0x409d('0x1b')]);}else{logger['info'](_0x409d('0x15'),_0x4a5b90,_0x409d('0x16'));_0x14085c(_0x54ee93['result'][_0x409d('0x1b')]);}})[_0x409d('0x1c')](function(_0x533323){logger[_0x409d('0x19')](_0x409d('0x15'),_0x4a5b90,_0x533323);_0x142234(_0x533323);});});} \ No newline at end of file +var _0xed41=['socket.io-emitter','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x2650cb,_0x42aff9){var _0x4fc972=function(_0x113496){while(--_0x113496){_0x2650cb['push'](_0x2650cb['shift']());}};_0x4fc972(++_0x42aff9);}(_0xed41,0x1c1));var _0x1ed4=function(_0x2c9c0e,_0x685c90){_0x2c9c0e=_0x2c9c0e-0x0;var _0x381b5c=_0xed41[_0x2c9c0e];return _0x381b5c;};'use strict';var _=require(_0x1ed4('0x0'));var util=require(_0x1ed4('0x1'));var moment=require(_0x1ed4('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ed4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ed4('0x4'))['db'];var utils=require(_0x1ed4('0x5'));var logger=require(_0x1ed4('0x6'))(_0x1ed4('0x7'));var config=require(_0x1ed4('0x8'));var jayson=require(_0x1ed4('0x9'));var client=jayson[_0x1ed4('0xa')][_0x1ed4('0xb')]({'port':0x232a});config['redis']=_[_0x1ed4('0xc')](config[_0x1ed4('0xd')],{'host':_0x1ed4('0xe'),'port':0x18eb});var socket=require(_0x1ed4('0xf'))(new Redis(config[_0x1ed4('0xd')]));require('./cmList.socket')[_0x1ed4('0x10')](socket);function respondWithRpcPromise(_0xa61829,_0x406b0a,_0x45d639){return new BPromise(function(_0x8ba837,_0x116d0c){return client[_0x1ed4('0x11')](_0xa61829,_0x45d639)[_0x1ed4('0x12')](function(_0x54b06e){logger[_0x1ed4('0x13')]('CmList,\x20%s,\x20%s',_0x406b0a,_0x1ed4('0x14'));logger[_0x1ed4('0x15')](_0x1ed4('0x16'),_0x406b0a,_0x1ed4('0x14'),JSON[_0x1ed4('0x17')](_0x54b06e));if(_0x54b06e['error']){if(_0x54b06e[_0x1ed4('0x18')]['code']===0x1f4){logger['error'](_0x1ed4('0x19'),_0x406b0a,_0x54b06e[_0x1ed4('0x18')][_0x1ed4('0x1a')]);return _0x116d0c(_0x54b06e[_0x1ed4('0x18')][_0x1ed4('0x1a')]);}logger[_0x1ed4('0x18')](_0x1ed4('0x19'),_0x406b0a,_0x54b06e[_0x1ed4('0x18')][_0x1ed4('0x1a')]);return _0x8ba837(_0x54b06e['error'][_0x1ed4('0x1a')]);}else{logger[_0x1ed4('0x13')](_0x1ed4('0x19'),_0x406b0a,_0x1ed4('0x14'));_0x8ba837(_0x54b06e[_0x1ed4('0x1b')][_0x1ed4('0x1a')]);}})[_0x1ed4('0x1c')](function(_0x1267c4){logger[_0x1ed4('0x18')]('CmList,\x20%s,\x20%s',_0x406b0a,_0x1267c4);_0x116d0c(_0x1267c4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 77c3fca..e488322 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 _0x11ba=['cmList:','./cmList.events','emit','removeListener','register','length'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x11ba,0x10f));var _0xa11b=function(_0x593705,_0xd89e7a){_0x593705=_0x593705-0x0;var _0x5cff4e=_0x11ba[_0x593705];return _0x5cff4e;};'use strict';var CmListEvents=require(_0xa11b('0x0'));var events=['save','remove','update'];function createListener(_0x560648,_0x4d4e9f){return function(_0xb94242){_0x4d4e9f[_0xa11b('0x1')](_0x560648,_0xb94242);};}function removeListener(_0x32f71f,_0x2d6a88){return function(){CmListEvents[_0xa11b('0x2')](_0x32f71f,_0x2d6a88);};}exports[_0xa11b('0x3')]=function(_0x326747){for(var _0x4f5688=0x0,_0x100360=events[_0xa11b('0x4')];_0x4f5688<_0x100360;_0x4f5688++){var _0x5d9e92=events[_0x4f5688];var _0x38c643=createListener(_0xa11b('0x5')+_0x5d9e92,_0x326747);CmListEvents['on'](_0x5d9e92,_0x38c643);}}; \ No newline at end of file +var _0xb53d=['length','cmList:','save','emit','removeListener'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0xb53d,0x165));var _0xdb53=function(_0x1751c2,_0x39e0ab){_0x1751c2=_0x1751c2-0x0;var _0x57ca6e=_0xb53d[_0x1751c2];return _0x57ca6e;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xdb53('0x0'),'remove','update'];function createListener(_0x420d31,_0xc22b8a){return function(_0x39c88b){_0xc22b8a[_0xdb53('0x1')](_0x420d31,_0x39c88b);};}function removeListener(_0x2b8ff6,_0x46391a){return function(){CmListEvents[_0xdb53('0x2')](_0x2b8ff6,_0x46391a);};}exports['register']=function(_0x5442e1){for(var _0x52484b=0x0,_0x1cad63=events[_0xdb53('0x3')];_0x52484b<_0x1cad63;_0x52484b++){var _0x2c5196=events[_0x52484b];var _0xbb974b=createListener(_0xdb53('0x4')+_0x2c5196,_0x5442e1);CmListEvents['on'](_0x2c5196,_0xbb974b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 6e06d9a..6cda2b1 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 _0xc7af=['getCustomFields','/:id/users','getAgents','post','create','/:id/contacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','exports','util','connect-timeout','express','Router','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','getContactsCsv','/:id/fields'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc7af,0x1a0));var _0xfc7a=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xc7af[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0xfc7a('0x0'));var path=require('path');var timeout=require(_0xfc7a('0x1'));var express=require(_0xfc7a('0x2'));var router=express[_0xfc7a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc7a('0x4'));var controller=require(_0xfc7a('0x5'));router[_0xfc7a('0x6')]('/',auth['isAuthenticated'](),controller[_0xfc7a('0x7')]);router[_0xfc7a('0x6')](_0xfc7a('0x8'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0xa')]);router[_0xfc7a('0x6')](_0xfc7a('0xb'),auth['isAuthenticated'](),controller[_0xfc7a('0xc')]);router['get'](_0xfc7a('0xd'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0xe')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0xfc7a('0xf')]);router[_0xfc7a('0x6')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xfc7a('0x10')]);router['get'](_0xfc7a('0x11'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x12')]);router['get'](_0xfc7a('0x13'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x14')]);router[_0xfc7a('0x15')]('/',auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x16')]);router['post']('/:id/dispositions',auth[_0xfc7a('0x9')](),controller['addDisposition']);router[_0xfc7a('0x15')](_0xfc7a('0x17'),auth[_0xfc7a('0x9')](),controller['addContacts']);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0xfc7a('0x18')]);router[_0xfc7a('0x15')]('/:id/users',auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x19')]);router[_0xfc7a('0x1a')](_0xfc7a('0xb'),auth[_0xfc7a('0x9')](),controller['update']);router[_0xfc7a('0x1b')](_0xfc7a('0xb'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x1c')]);router[_0xfc7a('0x1b')](_0xfc7a('0xd'),auth[_0xfc7a('0x9')](),controller[_0xfc7a('0x1d')]);router[_0xfc7a('0x1b')](_0xfc7a('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfc7a('0x1e')]=router; \ No newline at end of file +var _0x766a=['getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','/:id','delete','removeDispositions','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','show','getDispositions','isAuthenticated','/:id/contacts/csv'];(function(_0x3d210c,_0x56c1f1){var _0x453e2d=function(_0x4f22ce){while(--_0x4f22ce){_0x3d210c['push'](_0x3d210c['shift']());}};_0x453e2d(++_0x56c1f1);}(_0x766a,0x167));var _0xa766=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x766a[_0x87506e];return _0x5496a4;};'use strict';var multer=require(_0xa766('0x0'));var util=require(_0xa766('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa766('0x2')]();var auth=require(_0xa766('0x3'));var interaction=require(_0xa766('0x4'));var config=require(_0xa766('0x5'));var controller=require('./cmList.controller');router[_0xa766('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa766('0x6')](_0xa766('0x7'),auth['isAuthenticated'](),controller[_0xa766('0x8')]);router[_0xa766('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xa766('0x9')]);router[_0xa766('0x6')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa766('0xa')]);router['get']('/:id/contacts',auth[_0xa766('0xb')](),controller['getContacts']);router[_0xa766('0x6')](_0xa766('0xc'),auth[_0xa766('0xb')](),controller[_0xa766('0xd')]);router['get'](_0xa766('0xe'),auth['isAuthenticated'](),controller[_0xa766('0xf')]);router[_0xa766('0x6')](_0xa766('0x10'),auth[_0xa766('0xb')](),controller['getAgents']);router[_0xa766('0x11')]('/',auth[_0xa766('0xb')](),controller[_0xa766('0x12')]);router[_0xa766('0x11')](_0xa766('0x13'),auth[_0xa766('0xb')](),controller[_0xa766('0x14')]);router[_0xa766('0x11')](_0xa766('0x15'),auth[_0xa766('0xb')](),controller[_0xa766('0x16')]);router[_0xa766('0x11')](_0xa766('0xe'),auth[_0xa766('0xb')](),controller[_0xa766('0x17')]);router[_0xa766('0x11')]('/:id/users',auth[_0xa766('0xb')](),controller[_0xa766('0x18')]);router[_0xa766('0x19')](_0xa766('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0xa766('0x1b')](_0xa766('0x1a'),auth[_0xa766('0xb')](),controller['destroy']);router[_0xa766('0x1b')](_0xa766('0x13'),auth[_0xa766('0xb')](),controller[_0xa766('0x1c')]);router['delete'](_0xa766('0x10'),auth[_0xa766('0xb')](),controller[_0xa766('0x1d')]);module[_0xa766('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 12d8c90..7fa2b33 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 _0xebee=['getDataValue','STRING','sequelize','exports','VIRTUAL'];(function(_0x181a83,_0x5a56b5){var _0x548e46=function(_0x2acdef){while(--_0x2acdef){_0x181a83['push'](_0x181a83['shift']());}};_0x548e46(++_0x5a56b5);}(_0xebee,0x142));var _0xeebe=function(_0x5fd895,_0x32ac4e){_0x5fd895=_0x5fd895-0x0;var _0x1f2f90=_0xebee[_0x5fd895];return _0x1f2f90;};'use strict';var Sequelize=require(_0xeebe('0x0'));module[_0xeebe('0x1')]={'name':{'type':Sequelize[_0xeebe('0x2')],'get':function(_0x7be82e){return this[_0xeebe('0x3')]('field');}},'field':{'type':Sequelize[_0xeebe('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xeebe('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xeebe('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x718b=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x4593ef,_0x1d3acf){var _0x4fab91=function(_0x1ecd95){while(--_0x1ecd95){_0x4593ef['push'](_0x4593ef['shift']());}};_0x4fab91(++_0x1d3acf);}(_0x718b,0x1e8));var _0xb718=function(_0x1b5d5f,_0x5ed766){_0x1b5d5f=_0x1b5d5f-0x0;var _0x3c9347=_0x718b[_0x1b5d5f];return _0x3c9347;};'use strict';var Sequelize=require(_0xb718('0x0'));module[_0xb718('0x1')]={'name':{'type':Sequelize[_0xb718('0x2')],'get':function(_0x2ca174){return this[_0xb718('0x3')](_0xb718('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb718('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 8abc868..d531ba8 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 _0xcf80=['send','body','Condition','params','find','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcf80,0x148));var _0x0cf8=function(_0x1329a6,_0x1cc82b){_0x1329a6=_0x1329a6-0x0;var _0x4a7d38=_0xcf80[_0x1329a6];return _0x4a7d38;};'use strict';var pdf=require(_0x0cf8('0x0'));var emlformat=require(_0x0cf8('0x1'));var rimraf=require(_0x0cf8('0x2'));var zipdir=require(_0x0cf8('0x3'));var jsonpatch=require(_0x0cf8('0x4'));var rp=require(_0x0cf8('0x5'));var moment=require(_0x0cf8('0x6'));var BPromise=require(_0x0cf8('0x7'));var Mustache=require(_0x0cf8('0x8'));var util=require('util');var path=require(_0x0cf8('0x9'));var sox=require(_0x0cf8('0xa'));var csv=require(_0x0cf8('0xb'));var ejs=require(_0x0cf8('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0cf8('0xd'));var jsforce=require(_0x0cf8('0xe'));var deskjs=require(_0x0cf8('0xf'));var toCsv=require(_0x0cf8('0xb'));var querystring=require(_0x0cf8('0x10'));var Papa=require(_0x0cf8('0x11'));var Redis=require(_0x0cf8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0cf8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cf8('0x14'))(_0x0cf8('0x15'));var utils=require(_0x0cf8('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe1dd5,_0x3c22fe){_0x3c22fe=_0x3c22fe||0xcc;return function(_0x33e904){if(_0x33e904){return _0xe1dd5['sendStatus'](_0x3c22fe);}return _0xe1dd5['status'](_0x3c22fe)['end']();};}function respondWithResult(_0x80a1d1,_0x500b86){_0x500b86=_0x500b86||0xc8;return function(_0x1f7004){if(_0x1f7004){return _0x80a1d1[_0x0cf8('0x17')](_0x500b86)[_0x0cf8('0x18')](_0x1f7004);}};}function respondWithFilteredResult(_0x5d8fdf,_0x10d0ab){return function(_0x36393a){if(_0x36393a){var _0x509300=_0x36393a[_0x0cf8('0x19')],_0xf89189=_0x10d0ab['offset'],_0x5036fa=_0x10d0ab['offset']+_0x10d0ab[_0x0cf8('0x1a')],_0x162b4c;if(_0x5036fa>=_0x509300){_0x5036fa=_0x509300;_0x162b4c=0xc8;}else{_0x162b4c=0xce;}_0x5d8fdf[_0x0cf8('0x17')](_0x162b4c);return _0x5d8fdf[_0x0cf8('0x1b')](_0x0cf8('0x1c'),_0xf89189+'-'+_0x5036fa+'/'+_0x509300)[_0x0cf8('0x18')](_0x36393a);}return null;};}function patchUpdates(_0x3671ed){return function(_0x55679b){try{jsonpatch[_0x0cf8('0x1d')](_0x55679b,_0x3671ed,!![]);}catch(_0x3f6948){return BPromise[_0x0cf8('0x1e')](_0x3f6948);}return _0x55679b[_0x0cf8('0x1f')]();};}function saveUpdates(_0x311a61,_0x4a72ad){return function(_0x30d145){if(_0x30d145){return _0x30d145[_0x0cf8('0x20')](_0x311a61)[_0x0cf8('0x21')](function(_0x26423c){return _0x26423c;});}return null;};}function removeEntity(_0x28073a,_0x32e0b5){return function(_0x1f696b){if(_0x1f696b){return _0x1f696b[_0x0cf8('0x22')]()[_0x0cf8('0x21')](function(){_0x28073a['status'](0xcc)[_0x0cf8('0x23')]();});}};}function handleEntityNotFound(_0x457c1c,_0x14d827){return function(_0x1db14b){if(!_0x1db14b){_0x457c1c[_0x0cf8('0x24')](0x194);}return _0x1db14b;};}function handleError(_0xa525b9,_0x1d32ef){_0x1d32ef=_0x1d32ef||0x1f4;return function(_0x36892e){logger[_0x0cf8('0x25')](_0x36892e[_0x0cf8('0x26')]);if(_0x36892e['name']){delete _0x36892e[_0x0cf8('0x27')];}_0xa525b9[_0x0cf8('0x17')](_0x1d32ef)[_0x0cf8('0x28')](_0x36892e);};}exports[_0x0cf8('0x20')]=function(_0x1ab030,_0x3fd015){if(_0x1ab030[_0x0cf8('0x29')]['id']){delete _0x1ab030[_0x0cf8('0x29')]['id'];}return db[_0x0cf8('0x2a')]['find']({'where':{'id':_0x1ab030[_0x0cf8('0x2b')]['id']}})[_0x0cf8('0x21')](handleEntityNotFound(_0x3fd015,null))[_0x0cf8('0x21')](saveUpdates(_0x1ab030['body'],null))[_0x0cf8('0x21')](respondWithResult(_0x3fd015,null))['catch'](handleError(_0x3fd015,null));};exports['destroy']=function(_0xa24edd,_0x42091b){return db[_0x0cf8('0x2a')][_0x0cf8('0x2c')]({'where':{'id':_0xa24edd[_0x0cf8('0x2b')]['id']}})[_0x0cf8('0x21')](handleEntityNotFound(_0x42091b,null))['then'](removeEntity(_0x42091b,null))[_0x0cf8('0x2d')](handleError(_0x42091b,null));}; \ No newline at end of file +var _0x3e89=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','update','body','Condition','find','catch','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e89,0xcb));var _0x93e8=function(_0x1520bd,_0x1dacd8){_0x1520bd=_0x1520bd-0x0;var _0x2c6e81=_0x3e89[_0x1520bd];return _0x2c6e81;};'use strict';var pdf=require(_0x93e8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x93e8('0x1'));var zipdir=require(_0x93e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93e8('0x3'));var moment=require(_0x93e8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93e8('0x5'));var util=require(_0x93e8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93e8('0x7'));var ejs=require(_0x93e8('0x8'));var fs=require('fs');var _=require(_0x93e8('0x9'));var squel=require(_0x93e8('0xa'));var crypto=require(_0x93e8('0xb'));var jsforce=require(_0x93e8('0xc'));var deskjs=require(_0x93e8('0xd'));var toCsv=require(_0x93e8('0x7'));var querystring=require(_0x93e8('0xe'));var Papa=require('papaparse');var Redis=require(_0x93e8('0xf'));var authService=require(_0x93e8('0x10'));var qs=require(_0x93e8('0x11'));var hardwareService=require(_0x93e8('0x12'));var logger=require(_0x93e8('0x13'))(_0x93e8('0x14'));var utils=require(_0x93e8('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bb05b,_0x152280){_0x152280=_0x152280||0xcc;return function(_0x36a4ab){if(_0x36a4ab){return _0x4bb05b[_0x93e8('0x16')](_0x152280);}return _0x4bb05b['status'](_0x152280)[_0x93e8('0x17')]();};}function respondWithResult(_0x527454,_0x1c6310){_0x1c6310=_0x1c6310||0xc8;return function(_0x285e11){if(_0x285e11){return _0x527454[_0x93e8('0x18')](_0x1c6310)['json'](_0x285e11);}};}function respondWithFilteredResult(_0x44441b,_0x351546){return function(_0x2dade5){if(_0x2dade5){var _0x548afa=_0x2dade5[_0x93e8('0x19')],_0x29caa5=_0x351546[_0x93e8('0x1a')],_0x4a503a=_0x351546[_0x93e8('0x1a')]+_0x351546[_0x93e8('0x1b')],_0x19c963;if(_0x4a503a>=_0x548afa){_0x4a503a=_0x548afa;_0x19c963=0xc8;}else{_0x19c963=0xce;}_0x44441b['status'](_0x19c963);return _0x44441b[_0x93e8('0x1c')](_0x93e8('0x1d'),_0x29caa5+'-'+_0x4a503a+'/'+_0x548afa)[_0x93e8('0x1e')](_0x2dade5);}return null;};}function patchUpdates(_0x596bc1){return function(_0xae3861){try{jsonpatch[_0x93e8('0x1f')](_0xae3861,_0x596bc1,!![]);}catch(_0x1bf1f0){return BPromise[_0x93e8('0x20')](_0x1bf1f0);}return _0xae3861[_0x93e8('0x21')]();};}function saveUpdates(_0x1513e5,_0x1b0877){return function(_0x1de665){if(_0x1de665){return _0x1de665['update'](_0x1513e5)[_0x93e8('0x22')](function(_0x2cceb9){return _0x2cceb9;});}return null;};}function removeEntity(_0x590fdf,_0x4d2d26){return function(_0x16fbbc){if(_0x16fbbc){return _0x16fbbc[_0x93e8('0x23')]()[_0x93e8('0x22')](function(){_0x590fdf[_0x93e8('0x18')](0xcc)[_0x93e8('0x17')]();});}};}function handleEntityNotFound(_0xfe278b,_0x418b2b){return function(_0x29a33a){if(!_0x29a33a){_0xfe278b['sendStatus'](0x194);}return _0x29a33a;};}function handleError(_0x293938,_0x4c483a){_0x4c483a=_0x4c483a||0x1f4;return function(_0x242650){logger['error'](_0x242650[_0x93e8('0x24')]);if(_0x242650[_0x93e8('0x25')]){delete _0x242650[_0x93e8('0x25')];}_0x293938[_0x93e8('0x18')](_0x4c483a)[_0x93e8('0x26')](_0x242650);};}exports[_0x93e8('0x27')]=function(_0x5d3d71,_0x1921ab){if(_0x5d3d71[_0x93e8('0x28')]['id']){delete _0x5d3d71[_0x93e8('0x28')]['id'];}return db[_0x93e8('0x29')][_0x93e8('0x2a')]({'where':{'id':_0x5d3d71['params']['id']}})[_0x93e8('0x22')](handleEntityNotFound(_0x1921ab,null))[_0x93e8('0x22')](saveUpdates(_0x5d3d71[_0x93e8('0x28')],null))[_0x93e8('0x22')](respondWithResult(_0x1921ab,null))[_0x93e8('0x2b')](handleError(_0x1921ab,null));};exports[_0x93e8('0x23')]=function(_0x28e314,_0x519e5f){return db['Condition'][_0x93e8('0x2a')]({'where':{'id':_0x28e314['params']['id']}})[_0x93e8('0x22')](handleEntityNotFound(_0x519e5f,null))[_0x93e8('0x22')](removeEntity(_0x519e5f,null))[_0x93e8('0x2b')](handleError(_0x519e5f,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 6371d6f..4991a64 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 _0xdf17=['define','Condition','tools_conditions','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x5b21a2,_0x2c6461){var _0x57166b=function(_0x2c0c1a){while(--_0x2c0c1a){_0x5b21a2['push'](_0x5b21a2['shift']());}};_0x57166b(++_0x2c6461);}(_0xdf17,0x1d7));var _0x7df1=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xdf17[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x7df1('0x0'));var util=require(_0x7df1('0x1'));var logger=require(_0x7df1('0x2'))(_0x7df1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7df1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7df1('0x5'));var config=require(_0x7df1('0x6'));var attributes=require(_0x7df1('0x7'));module[_0x7df1('0x8')]=function(_0xce6460,_0x3c23eb){return _0xce6460[_0x7df1('0x9')](_0x7df1('0xa'),attributes,{'tableName':_0x7df1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e67=['util','../../config/logger','api','moment','request-promise','path','rimraf','./condition.attributes','define','tools_conditions'];(function(_0x1d8736,_0xc7ead7){var _0x440bff=function(_0x53bf90){while(--_0x53bf90){_0x1d8736['push'](_0x1d8736['shift']());}};_0x440bff(++_0xc7ead7);}(_0x4e67,0x12c));var _0x74e6=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x4e67[_0x3932eb];return _0x5316e5;};'use strict';var _=require('lodash');var util=require(_0x74e6('0x0'));var logger=require(_0x74e6('0x1'))(_0x74e6('0x2'));var moment=require(_0x74e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x74e6('0x4'));var fs=require('fs');var path=require(_0x74e6('0x5'));var rimraf=require(_0x74e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x74e6('0x7'));module['exports']=function(_0xb472ac,_0x2bb5b4){return _0xb472ac[_0x74e6('0x8')]('Condition',attributes,{'tableName':_0x74e6('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 c164977..747a7a4 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 _0xec2a=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s'];(function(_0x39ef73,_0x41c3eb){var _0x274e9f=function(_0x56bc33){while(--_0x56bc33){_0x39ef73['push'](_0x39ef73['shift']());}};_0x274e9f(++_0x41c3eb);}(_0xec2a,0x100));var _0xaec2=function(_0x2a0739,_0x148e11){_0x2a0739=_0x2a0739-0x0;var _0x2c0f19=_0xec2a[_0x2a0739];return _0x2c0f19;};'use strict';var _=require(_0xaec2('0x0'));var util=require(_0xaec2('0x1'));var moment=require('moment');var BPromise=require(_0xaec2('0x2'));var rs=require(_0xaec2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaec2('0x4'))['db'];var utils=require(_0xaec2('0x5'));var logger=require(_0xaec2('0x6'))(_0xaec2('0x7'));var config=require(_0xaec2('0x8'));var jayson=require(_0xaec2('0x9'));var client=jayson[_0xaec2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e7fcf,_0x4dd69c,_0x12ea60){return new BPromise(function(_0x29c547,_0x1b4416){return client[_0xaec2('0xb')](_0x3e7fcf,_0x12ea60)['then'](function(_0xd13ec1){logger[_0xaec2('0xc')]('Condition,\x20%s,\x20%s',_0x4dd69c,_0xaec2('0xd'));logger[_0xaec2('0xe')](_0xaec2('0xf'),_0x4dd69c,_0xaec2('0xd'),JSON[_0xaec2('0x10')](_0xd13ec1));if(_0xd13ec1[_0xaec2('0x11')]){if(_0xd13ec1[_0xaec2('0x11')][_0xaec2('0x12')]===0x1f4){logger[_0xaec2('0x11')](_0xaec2('0x13'),_0x4dd69c,_0xd13ec1[_0xaec2('0x11')][_0xaec2('0x14')]);return _0x1b4416(_0xd13ec1['error']['message']);}logger[_0xaec2('0x11')](_0xaec2('0x13'),_0x4dd69c,_0xd13ec1[_0xaec2('0x11')]['message']);return _0x29c547(_0xd13ec1[_0xaec2('0x11')][_0xaec2('0x14')]);}else{logger[_0xaec2('0xc')](_0xaec2('0x13'),_0x4dd69c,'request\x20sent');_0x29c547(_0xd13ec1[_0xaec2('0x15')][_0xaec2('0x14')]);}})[_0xaec2('0x16')](function(_0x33628b){logger[_0xaec2('0x11')]('Condition,\x20%s,\x20%s',_0x4dd69c,_0x33628b);_0x1b4416(_0x33628b);});});} \ No newline at end of file +var _0x8a48=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','randomstring'];(function(_0x14b9e1,_0x569da3){var _0x2083ce=function(_0x554c1a){while(--_0x554c1a){_0x14b9e1['push'](_0x14b9e1['shift']());}};_0x2083ce(++_0x569da3);}(_0x8a48,0x120));var _0x88a4=function(_0x49a44c,_0x18f602){_0x49a44c=_0x49a44c-0x0;var _0x438426=_0x8a48[_0x49a44c];return _0x438426;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x88a4('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88a4('0x1'))['db'];var utils=require(_0x88a4('0x2'));var logger=require(_0x88a4('0x3'))(_0x88a4('0x4'));var config=require(_0x88a4('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x88a4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4cec29,_0x10e815,_0x47b5ff){return new BPromise(function(_0x4e9125,_0x5eda9b){return client[_0x88a4('0x7')](_0x4cec29,_0x47b5ff)[_0x88a4('0x8')](function(_0x604463){logger['info'](_0x88a4('0x9'),_0x10e815,_0x88a4('0xa'));logger['debug'](_0x88a4('0xb'),_0x10e815,_0x88a4('0xa'),JSON['stringify'](_0x604463));if(_0x604463[_0x88a4('0xc')]){if(_0x604463['error']['code']===0x1f4){logger[_0x88a4('0xc')](_0x88a4('0x9'),_0x10e815,_0x604463['error'][_0x88a4('0xd')]);return _0x5eda9b(_0x604463[_0x88a4('0xc')][_0x88a4('0xd')]);}logger['error'](_0x88a4('0x9'),_0x10e815,_0x604463[_0x88a4('0xc')][_0x88a4('0xd')]);return _0x4e9125(_0x604463[_0x88a4('0xc')][_0x88a4('0xd')]);}else{logger[_0x88a4('0xe')](_0x88a4('0x9'),_0x10e815,_0x88a4('0xa'));_0x4e9125(_0x604463[_0x88a4('0xf')][_0x88a4('0xd')]);}})[_0x88a4('0x10')](function(_0xaceec7){logger[_0x88a4('0xc')](_0x88a4('0x9'),_0x10e815,_0xaceec7);_0x5eda9b(_0xaceec7);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index bbcb6ec..0db16a4 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 _0x70cc=['../../components/interaction/service','../../config/environment','put','/:id','update','delete','isAuthenticated','multer','util','path','express','Router','../../components/auth/service'];(function(_0x4148fa,_0x2100a0){var _0x33df58=function(_0x50c5c3){while(--_0x50c5c3){_0x4148fa['push'](_0x4148fa['shift']());}};_0x33df58(++_0x2100a0);}(_0x70cc,0x125));var _0xc70c=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x70cc[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0xc70c('0x0'));var util=require(_0xc70c('0x1'));var path=require(_0xc70c('0x2'));var timeout=require('connect-timeout');var express=require(_0xc70c('0x3'));var router=express[_0xc70c('0x4')]();var auth=require(_0xc70c('0x5'));var interaction=require(_0xc70c('0x6'));var config=require(_0xc70c('0x7'));var controller=require('./condition.controller');router[_0xc70c('0x8')](_0xc70c('0x9'),auth['isAuthenticated'](),controller[_0xc70c('0xa')]);router[_0xc70c('0xb')](_0xc70c('0x9'),auth[_0xc70c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x603b=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','update','/:id','isAuthenticated'];(function(_0x4fa628,_0x5b7a8e){var _0x55d591=function(_0x259e43){while(--_0x259e43){_0x4fa628['push'](_0x4fa628['shift']());}};_0x55d591(++_0x5b7a8e);}(_0x603b,0x194));var _0xb603=function(_0x26ad1b,_0x2f4bc6){_0x26ad1b=_0x26ad1b-0x0;var _0x29c248=_0x603b[_0x26ad1b];return _0x29c248;};'use strict';var multer=require(_0xb603('0x0'));var util=require(_0xb603('0x1'));var path=require('path');var timeout=require(_0xb603('0x2'));var express=require('express');var router=express[_0xb603('0x3')]();var auth=require(_0xb603('0x4'));var interaction=require(_0xb603('0x5'));var config=require(_0xb603('0x6'));var controller=require(_0xb603('0x7'));router[_0xb603('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb603('0x9')]);router['delete'](_0xb603('0xa'),auth[_0xb603('0xb')](),controller[_0xb603('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4fc381f..d5087d9 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 _0x9274=['STRING'];(function(_0x4ddb99,_0x3152bb){var _0x34fed2=function(_0x158302){while(--_0x158302){_0x4ddb99['push'](_0x4ddb99['shift']());}};_0x34fed2(++_0x3152bb);}(_0x9274,0x130));var _0x4927=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9274[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x4927('0x0')]}}; \ No newline at end of file +var _0x776f=['exports','STRING','name','sequelize'];(function(_0x8f5dff,_0x3558c1){var _0x164f92=function(_0x26c6fb){while(--_0x26c6fb){_0x8f5dff['push'](_0x8f5dff['shift']());}};_0x164f92(++_0x3558c1);}(_0x776f,0x187));var _0xf776=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x776f[_0x2bd1ec];return _0x2f7577;};'use strict';var Sequelize=require(_0xf776('0x0'));module[_0xf776('0x1')]={'name':{'type':Sequelize[_0xf776('0x2')],'allowNull':![],'unique':_0xf776('0x3')},'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 f51d393..f6d46fa 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 _0xbc53=['catch','show','params','rawAttributes','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','end','error','stack','name','index','Dashboard','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','rows'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbc53,0xa6));var _0x3bc5=function(_0x643c5f,_0x1fa3b8){_0x643c5f=_0x643c5f-0x0;var _0x3e9fcf=_0xbc53[_0x643c5f];return _0x3e9fcf;};'use strict';var pdf=require(_0x3bc5('0x0'));var emlformat=require(_0x3bc5('0x1'));var rimraf=require(_0x3bc5('0x2'));var zipdir=require(_0x3bc5('0x3'));var jsonpatch=require(_0x3bc5('0x4'));var rp=require(_0x3bc5('0x5'));var moment=require(_0x3bc5('0x6'));var BPromise=require(_0x3bc5('0x7'));var Mustache=require(_0x3bc5('0x8'));var util=require(_0x3bc5('0x9'));var path=require(_0x3bc5('0xa'));var sox=require(_0x3bc5('0xb'));var csv=require(_0x3bc5('0xc'));var ejs=require(_0x3bc5('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3bc5('0xe'));var jsforce=require(_0x3bc5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3bc5('0xc'));var querystring=require('querystring');var Papa=require(_0x3bc5('0x10'));var Redis=require(_0x3bc5('0x11'));var authService=require(_0x3bc5('0x12'));var qs=require(_0x3bc5('0x13'));var hardwareService=require(_0x3bc5('0x14'));var logger=require(_0x3bc5('0x15'))(_0x3bc5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3bc5('0x17'))['db'];config[_0x3bc5('0x18')]=_[_0x3bc5('0x19')](config[_0x3bc5('0x18')],{'host':_0x3bc5('0x1a'),'port':0x18eb});var socket=require(_0x3bc5('0x1b'))(new Redis(config[_0x3bc5('0x18')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x2df60f,_0x518164){_0x518164=_0x518164||0xcc;return function(_0x282fba){if(_0x282fba){return _0x2df60f['sendStatus'](_0x518164);}return _0x2df60f[_0x3bc5('0x1c')](_0x518164)['end']();};}function respondWithResult(_0x3d144b,_0x1de4a9){_0x1de4a9=_0x1de4a9||0xc8;return function(_0x5a5684){if(_0x5a5684){return _0x3d144b[_0x3bc5('0x1c')](_0x1de4a9)['json'](_0x5a5684);}};}function respondWithFilteredResult(_0x123e46,_0x47816b){return function(_0xe6ddb1){if(_0xe6ddb1){var _0x17c022=_0xe6ddb1['count'],_0x2ff7bf=_0x47816b['offset'],_0x3b505b=_0x47816b[_0x3bc5('0x1d')]+_0x47816b[_0x3bc5('0x1e')],_0x3e81ee;if(_0x3b505b>=_0x17c022){_0x3b505b=_0x17c022;_0x3e81ee=0xc8;}else{_0x3e81ee=0xce;}_0x123e46['status'](_0x3e81ee);return _0x123e46[_0x3bc5('0x1f')](_0x3bc5('0x20'),_0x2ff7bf+'-'+_0x3b505b+'/'+_0x17c022)['json'](_0xe6ddb1);}return null;};}function patchUpdates(_0x16e044){return function(_0x45c97b){try{jsonpatch[_0x3bc5('0x21')](_0x45c97b,_0x16e044,!![]);}catch(_0xd63952){return BPromise['reject'](_0xd63952);}return _0x45c97b[_0x3bc5('0x22')]();};}function saveUpdates(_0x4534ba,_0x1200fd){return function(_0x3a77ed){if(_0x3a77ed){return _0x3a77ed[_0x3bc5('0x23')](_0x4534ba)[_0x3bc5('0x24')](function(_0x47bbe8){return _0x47bbe8;});}return null;};}function removeEntity(_0x541722,_0x24c602){return function(_0x42f2e6){if(_0x42f2e6){return _0x42f2e6[_0x3bc5('0x25')]()['then'](function(){var _0x58fb0c=_0x42f2e6['get']({'plain':!![]});var _0x314565='CustomDashboards';return db[_0x3bc5('0x26')][_0x3bc5('0x25')]({'where':{'type':_0x314565,'resourceId':_0x58fb0c['id']}})[_0x3bc5('0x24')](function(){return _0x42f2e6;});})['then'](function(){_0x541722['status'](0xcc)[_0x3bc5('0x27')]();});}};}function handleEntityNotFound(_0x3a4ca1,_0x4c85b1){return function(_0x528526){if(!_0x528526){_0x3a4ca1['sendStatus'](0x194);}return _0x528526;};}function handleError(_0xb91358,_0x4389cc){_0x4389cc=_0x4389cc||0x1f4;return function(_0x202b7e){logger[_0x3bc5('0x28')](_0x202b7e[_0x3bc5('0x29')]);if(_0x202b7e['name']){delete _0x202b7e[_0x3bc5('0x2a')];}_0xb91358[_0x3bc5('0x1c')](_0x4389cc)['send'](_0x202b7e);};}exports[_0x3bc5('0x2b')]=function(_0x404739,_0x26cd64){var _0x301791={},_0x392bac={},_0x4606a8={'count':0x0,'rows':[]};var _0x4aaa08=db[_0x3bc5('0x2c')]['rawAttributes'];_0x392bac[_0x3bc5('0x2d')]=_[_0x3bc5('0x2e')](_0x4aaa08);_0x392bac[_0x3bc5('0x2f')]=_[_0x3bc5('0x2e')](_0x404739[_0x3bc5('0x2f')]);_0x392bac[_0x3bc5('0x30')]=_[_0x3bc5('0x31')](_0x392bac[_0x3bc5('0x2d')],_0x392bac[_0x3bc5('0x2f')]);_0x301791[_0x3bc5('0x32')]=_[_0x3bc5('0x31')](_0x392bac[_0x3bc5('0x2d')],qs[_0x3bc5('0x33')](_0x404739[_0x3bc5('0x2f')][_0x3bc5('0x33')]));_0x301791[_0x3bc5('0x32')]=_0x301791[_0x3bc5('0x32')][_0x3bc5('0x34')]?_0x301791['attributes']:_0x392bac[_0x3bc5('0x2d')];if(!_0x404739[_0x3bc5('0x2f')][_0x3bc5('0x35')](_0x3bc5('0x36'))){_0x301791[_0x3bc5('0x1e')]=qs[_0x3bc5('0x1e')](_0x404739[_0x3bc5('0x2f')][_0x3bc5('0x1e')]);_0x301791['offset']=qs[_0x3bc5('0x1d')](_0x404739[_0x3bc5('0x2f')][_0x3bc5('0x1d')]);}_0x301791[_0x3bc5('0x37')]=qs[_0x3bc5('0x38')](_0x404739['query']['sort']);_0x301791[_0x3bc5('0x39')]=qs['filters'](_['pick'](_0x404739['query'],_0x392bac[_0x3bc5('0x30')]));if(_0x404739['query'][_0x3bc5('0x3a')]){_0x301791[_0x3bc5('0x39')]=_[_0x3bc5('0x3b')](_0x301791[_0x3bc5('0x39')],{'$or':_[_0x3bc5('0x3c')](_0x4aaa08,function(_0x2f640e){if(_0x2f640e[_0x3bc5('0x3d')][_0x3bc5('0x3e')]!==_0x3bc5('0x3f')){var _0x35b1f1={};_0x35b1f1[_0x2f640e[_0x3bc5('0x40')]]={'$like':'%'+_0x404739[_0x3bc5('0x2f')]['filter']+'%'};return _0x35b1f1;}})});}_0x301791=_[_0x3bc5('0x3b')]({},_0x301791,_0x404739[_0x3bc5('0x41')]);var _0xd908f5={'where':_0x301791[_0x3bc5('0x39')]};return db[_0x3bc5('0x2c')][_0x3bc5('0x42')](_0xd908f5)[_0x3bc5('0x24')](function(_0x36787a){_0x4606a8[_0x3bc5('0x42')]=_0x36787a;if(_0x404739[_0x3bc5('0x2f')][_0x3bc5('0x43')]){_0x301791[_0x3bc5('0x44')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x301791);})[_0x3bc5('0x24')](function(_0x45cce9){_0x4606a8[_0x3bc5('0x45')]=_0x45cce9;return _0x4606a8;})[_0x3bc5('0x24')](respondWithFilteredResult(_0x26cd64,_0x301791))[_0x3bc5('0x46')](handleError(_0x26cd64,null));};exports[_0x3bc5('0x47')]=function(_0x57701f,_0x3a99ce){var _0x57b828={'raw':![],'where':{'id':_0x57701f[_0x3bc5('0x48')]['id']}},_0x4c48ae={};_0x4c48ae[_0x3bc5('0x2d')]=_[_0x3bc5('0x2e')](db['Dashboard'][_0x3bc5('0x49')]);_0x4c48ae[_0x3bc5('0x2f')]=_[_0x3bc5('0x2e')](_0x57701f[_0x3bc5('0x2f')]);_0x4c48ae['filters']=_[_0x3bc5('0x31')](_0x4c48ae[_0x3bc5('0x2d')],_0x4c48ae[_0x3bc5('0x2f')]);_0x57b828[_0x3bc5('0x32')]=_['intersection'](_0x4c48ae[_0x3bc5('0x2d')],qs[_0x3bc5('0x33')](_0x57701f['query'][_0x3bc5('0x33')]));_0x57b828['attributes']=_0x57b828[_0x3bc5('0x32')][_0x3bc5('0x34')]?_0x57b828[_0x3bc5('0x32')]:_0x4c48ae['model'];if(_0x57701f['query']['includeAll']){_0x57b828['include']=[{'all':!![]}];}_0x57b828=_['merge']({},_0x57b828,_0x57701f[_0x3bc5('0x41')]);return db['Dashboard'][_0x3bc5('0x4a')](_0x57b828)[_0x3bc5('0x24')](handleEntityNotFound(_0x3a99ce,null))[_0x3bc5('0x24')](respondWithResult(_0x3a99ce,null))[_0x3bc5('0x46')](handleError(_0x3a99ce,null));};exports['create']=function(_0x1e1841,_0x528295){return db[_0x3bc5('0x2c')]['create'](_0x1e1841['body'],{})[_0x3bc5('0x24')](function(_0xe5225){var _0x358281=_0x1e1841[_0x3bc5('0x4b')][_0x3bc5('0x4c')]({'plain':!![]});if(!_0x358281)throw new Error(_0x3bc5('0x4d'));if(_0x358281['role']===_0x3bc5('0x4b')){var _0xdda5ce=_0xe5225[_0x3bc5('0x4c')]({'plain':!![]});var _0x17e7c=_0x3bc5('0x4e');return db['UserProfileSection'][_0x3bc5('0x4a')]({'where':{'name':_0x17e7c,'userProfileId':_0x358281[_0x3bc5('0x4f')]},'raw':!![]})[_0x3bc5('0x24')](function(_0xa3c373){if(_0xa3c373&&_0xa3c373['autoAssociation']===0x0){return db[_0x3bc5('0x26')][_0x3bc5('0x50')]({'name':_0xdda5ce[_0x3bc5('0x2a')],'resourceId':_0xdda5ce['id'],'type':_0xa3c373['name'],'sectionId':_0xa3c373['id']},{})[_0x3bc5('0x24')](function(){return _0xe5225;});}else{return _0xe5225;}})[_0x3bc5('0x46')](function(_0x36c95f){logger[_0x3bc5('0x28')](_0x3bc5('0x51'),_0x36c95f);throw _0x36c95f;});}return _0xe5225;})[_0x3bc5('0x24')](respondWithResult(_0x528295,0xc9))[_0x3bc5('0x46')](handleError(_0x528295,null));};exports['clone']=function(_0x9bff96,_0x4f211b){var _0x3167aa={'raw':![],'where':{'id':_0x9bff96[_0x3bc5('0x48')]['id']}},_0x411177={};_0x411177[_0x3bc5('0x2d')]=_['keys'](db['Dashboard'][_0x3bc5('0x49')]);_0x3167aa[_0x3bc5('0x32')]=_['intersection'](_0x411177[_0x3bc5('0x2d')],qs['fields'](_0x9bff96['query'][_0x3bc5('0x33')]));_0x3167aa['attributes']=_0x3167aa[_0x3bc5('0x32')][_0x3bc5('0x34')]?_0x3167aa[_0x3bc5('0x32')]:_0x411177['model'];if(_0x9bff96['query'][_0x3bc5('0x43')]){_0x3167aa['include']=[{'all':!![]}];}_0x3167aa=_['merge']({},_0x3167aa,_0x9bff96[_0x3bc5('0x41')]);return db[_0x3bc5('0x2c')][_0x3bc5('0x4a')](_0x3167aa)[_0x3bc5('0x24')](handleEntityNotFound(_0x4f211b,null))[_0x3bc5('0x24')](function(_0x57e1a2){if(_0x57e1a2){var _0x4a7d38=_0x57e1a2['get']({'plain':!![]});_0x4a7d38=qs[_0x3bc5('0x52')](_0x4a7d38,['id',_0x3bc5('0x53'),_0x3bc5('0x54')]);_0x9bff96['body']=_[_0x3bc5('0x52')](_0x9bff96['body'],['id',_0x3bc5('0x53'),'updatedAt']);return db[_0x3bc5('0x2c')]['create'](_[_0x3bc5('0x3b')](_0x4a7d38,_0x9bff96[_0x3bc5('0x55')]),{'include':_0x9bff96['query']['includeAll']?[{'all':!![]}]:undefined})[_0x3bc5('0x24')](function(_0x4d97fa){var _0x7970f6=_0x9bff96[_0x3bc5('0x4b')][_0x3bc5('0x4c')]({'plain':!![]});if(!_0x7970f6)throw new Error(_0x3bc5('0x4d'));if(_0x7970f6[_0x3bc5('0x56')]==='user'){var _0x12397d=_0x4d97fa[_0x3bc5('0x4c')]({'plain':!![]});var _0x432055=_0x3bc5('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x432055,'userProfileId':_0x7970f6[_0x3bc5('0x4f')]},'raw':!![]})['then'](function(_0x1758de){if(_0x1758de&&_0x1758de[_0x3bc5('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x12397d['name'],'resourceId':_0x12397d['id'],'type':_0x1758de[_0x3bc5('0x2a')],'sectionId':_0x1758de['id']},{})[_0x3bc5('0x24')](function(){return _0x4d97fa;});}else{return _0x4d97fa;}})[_0x3bc5('0x46')](function(_0x4a6ecb){logger[_0x3bc5('0x28')](_0x3bc5('0x51'),_0x4a6ecb);throw _0x4a6ecb;});}return _0x4d97fa;});}})[_0x3bc5('0x24')](respondWithResult(_0x4f211b,0xc9))['catch'](handleError(_0x4f211b,null));};exports[_0x3bc5('0x23')]=function(_0xac08df,_0x5e0e24){if(_0xac08df[_0x3bc5('0x55')]['id']){delete _0xac08df[_0x3bc5('0x55')]['id'];}return db[_0x3bc5('0x2c')][_0x3bc5('0x4a')]({'where':{'id':_0xac08df[_0x3bc5('0x48')]['id']}})[_0x3bc5('0x24')](handleEntityNotFound(_0x5e0e24,null))[_0x3bc5('0x24')](saveUpdates(_0xac08df[_0x3bc5('0x55')],null))[_0x3bc5('0x24')](respondWithResult(_0x5e0e24,null))[_0x3bc5('0x46')](handleError(_0x5e0e24,null));};exports[_0x3bc5('0x25')]=function(_0x2987f4,_0x1452a3){return db[_0x3bc5('0x2c')][_0x3bc5('0x4a')]({'where':{'id':_0x2987f4[_0x3bc5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1452a3,null))['then'](removeEntity(_0x1452a3,null))[_0x3bc5('0x46')](handleError(_0x1452a3,null));};function widgetAttributes(_0x545405){try{switch(_0x545405['type']){case _0x3bc5('0x58'):return[{'name':_0x3bc5('0x59'),'value':_0x545405[_0x3bc5('0x59')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405['attrs'][0x0][_0x3bc5('0x5b')]:undefined)||_0x3bc5('0x5c')}];case _0x3bc5('0x5d'):return[{'name':_0x3bc5('0x5e'),'value':_0x545405[_0x3bc5('0x5e')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0][_0x3bc5('0x5b')]:undefined)||''}];case _0x3bc5('0x5f'):return[{'name':'attrHourFormat','value':_0x545405[_0x3bc5('0x60')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0]['value']:undefined)||_0x3bc5('0x61')},{'name':_0x3bc5('0x62'),'value':_0x545405[_0x3bc5('0x62')]||(_0x545405['attrs']&&_0x545405[_0x3bc5('0x5a')][0x1]?_0x545405[_0x3bc5('0x5a')][0x1][_0x3bc5('0x5b')]:undefined)||_0x3bc5('0x63')},{'name':'attrFontSize','value':_0x545405['attrFontSize']||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x2]?_0x545405['attrs'][0x2]['value']:undefined)||0xc}];case _0x3bc5('0x64'):return[{'name':'attrMetric','value':_0x545405[_0x3bc5('0x65')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0]['value']:undefined)||_0x3bc5('0x66')},{'name':_0x3bc5('0x67'),'value':_0x545405[_0x3bc5('0x67')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x1]?_0x545405[_0x3bc5('0x5a')][0x1]['value']:undefined)||[]},{'name':_0x3bc5('0x68'),'value':_0x545405[_0x3bc5('0x68')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x2]?_0x545405['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x3bc5('0x69'):return[{'name':_0x3bc5('0x6a'),'value':_0x545405[_0x3bc5('0x6a')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0][_0x3bc5('0x5b')]:undefined)||_0x3bc5('0x66')},{'name':_0x3bc5('0x6b'),'value':_0x545405[_0x3bc5('0x6b')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x1]?_0x545405['attrs'][0x1][_0x3bc5('0x5b')]:undefined)||null},{'name':_0x3bc5('0x6c'),'value':_0x545405[_0x3bc5('0x6c')]||(_0x545405['attrs']&&_0x545405[_0x3bc5('0x5a')][0x2]?_0x545405['attrs'][0x2][_0x3bc5('0x5b')]:undefined)||null},{'name':_0x3bc5('0x67'),'value':_0x545405[_0x3bc5('0x67')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x3]?_0x545405['attrs'][0x3][_0x3bc5('0x5b')]:undefined)||[]}];case'web-report':return[{'name':_0x3bc5('0x6d'),'type':_0x545405['reportType']||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0][_0x3bc5('0x3d')]:undefined)||null,'value':_0x545405['attrReport']||(_0x545405[_0x3bc5('0x5a')]&&_0x545405[_0x3bc5('0x5a')][0x0]?_0x545405[_0x3bc5('0x5a')][0x0]['value']:undefined)||null},{'name':_0x3bc5('0x6e'),'value':_0x545405[_0x3bc5('0x6e')]||(_0x545405[_0x3bc5('0x5a')]&&_0x545405['attrs'][0x1]?_0x545405['attrs'][0x1][_0x3bc5('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x316fb0){logger['error']('widgetAttributes:\x20%s',JSON[_0x3bc5('0x6f')](_0x316fb0));return[];}}exports[_0x3bc5('0x70')]=function(_0x4ce0a0,_0x434213,_0x1397b4){if(_0x4ce0a0[_0x3bc5('0x55')]['id']){delete _0x4ce0a0[_0x3bc5('0x55')]['id'];}return db[_0x3bc5('0x2c')][_0x3bc5('0x4a')]({'where':{'id':_0x4ce0a0[_0x3bc5('0x48')]['id']}})[_0x3bc5('0x24')](handleEntityNotFound(_0x434213,null))[_0x3bc5('0x24')](function(_0x346519){if(_0x346519){_0x4ce0a0[_0x3bc5('0x55')][_0x3bc5('0x71')]=_0x346519['id'];_0x4ce0a0[_0x3bc5('0x55')][_0x3bc5('0x5a')]=widgetAttributes(_0x4ce0a0['body']);return db[_0x3bc5('0x72')][_0x3bc5('0x50')](_0x4ce0a0[_0x3bc5('0x55')]);}})[_0x3bc5('0x24')](respondWithResult(_0x434213,null))[_0x3bc5('0x46')](handleError(_0x434213,null));};exports[_0x3bc5('0x73')]=function(_0x517bba,_0x4ac2b9,_0x6975f8){var _0x2a4034={};var _0x3c5c2b={};var _0x4515ff;var _0x497f26;return db[_0x3bc5('0x2c')][_0x3bc5('0x74')]({'where':{'id':_0x517bba[_0x3bc5('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ac2b9,null))[_0x3bc5('0x24')](function(_0xf0b2ab){if(_0xf0b2ab){_0x4515ff=_0xf0b2ab;_0x3c5c2b['model']=_[_0x3bc5('0x2e')](db[_0x3bc5('0x72')][_0x3bc5('0x49')]);_0x3c5c2b['query']=_[_0x3bc5('0x2e')](_0x517bba[_0x3bc5('0x2f')]);_0x3c5c2b[_0x3bc5('0x30')]=_[_0x3bc5('0x31')](_0x3c5c2b[_0x3bc5('0x2d')],_0x3c5c2b[_0x3bc5('0x2f')]);_0x2a4034['attributes']=_[_0x3bc5('0x31')](_0x3c5c2b[_0x3bc5('0x2d')],qs[_0x3bc5('0x33')](_0x517bba[_0x3bc5('0x2f')][_0x3bc5('0x33')]));_0x2a4034[_0x3bc5('0x32')]=_0x2a4034['attributes'][_0x3bc5('0x34')]?_0x2a4034[_0x3bc5('0x32')]:_0x3c5c2b[_0x3bc5('0x2d')];_0x2a4034[_0x3bc5('0x37')]=qs['sort'](_0x517bba['query']['sort']);_0x2a4034[_0x3bc5('0x39')]=qs['filters'](_[_0x3bc5('0x75')](_0x517bba[_0x3bc5('0x2f')],_0x3c5c2b[_0x3bc5('0x30')]));if(_0x517bba[_0x3bc5('0x2f')][_0x3bc5('0x3a')]){_0x2a4034['where']=_[_0x3bc5('0x3b')](_0x2a4034[_0x3bc5('0x39')],{'$or':_[_0x3bc5('0x3c')](_0x2a4034['attributes'],function(_0x55f7f8){var _0x3e8294={};_0x3e8294[_0x55f7f8]={'$like':'%'+_0x517bba['query'][_0x3bc5('0x3a')]+'%'};return _0x3e8294;})});}_0x2a4034=_[_0x3bc5('0x3b')]({},_0x2a4034,_0x517bba[_0x3bc5('0x41')]);return _0x4515ff[_0x3bc5('0x73')](_0x2a4034);}})[_0x3bc5('0x24')](function(_0x47770b){if(_0x47770b){_0x497f26=_0x47770b[_0x3bc5('0x34')];if(!_0x517bba['query'][_0x3bc5('0x35')](_0x3bc5('0x36'))){_0x2a4034['limit']=qs[_0x3bc5('0x1e')](_0x517bba['query'][_0x3bc5('0x1e')]);_0x2a4034[_0x3bc5('0x1d')]=qs[_0x3bc5('0x1d')](_0x517bba[_0x3bc5('0x2f')][_0x3bc5('0x1d')]);}return _0x4515ff['getItems'](_0x2a4034);}})[_0x3bc5('0x24')](function(_0x501d09){if(_0x501d09){return _0x501d09?{'count':_0x497f26,'rows':_0x501d09}:null;}})[_0x3bc5('0x24')](respondWithResult(_0x4ac2b9,null))[_0x3bc5('0x46')](handleError(_0x4ac2b9,null));}; \ No newline at end of file +var _0x6482=['lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','set','Content-Range','json','reject','save','update','destroy','then','CustomDashboards','UserProfileResource','error','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','count','includeAll','include','Dashboard','findAll','rows','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','updatedAt','autoAssociation','params','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','options','getItems','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x128a56,_0x45840c){var _0x2de25d=function(_0x1ce79f){while(--_0x1ce79f){_0x128a56['push'](_0x128a56['shift']());}};_0x2de25d(++_0x45840c);}(_0x6482,0xe8));var _0x2648=function(_0x20466f,_0x34d7ad){_0x20466f=_0x20466f-0x0;var _0x4d0a60=_0x6482[_0x20466f];return _0x4d0a60;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2648('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2648('0x1'));var rp=require(_0x2648('0x2'));var moment=require(_0x2648('0x3'));var BPromise=require(_0x2648('0x4'));var Mustache=require('mustache');var util=require(_0x2648('0x5'));var path=require(_0x2648('0x6'));var sox=require(_0x2648('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2648('0x8'));var squel=require('squel');var crypto=require(_0x2648('0x9'));var jsforce=require(_0x2648('0xa'));var deskjs=require(_0x2648('0xb'));var toCsv=require(_0x2648('0xc'));var querystring=require(_0x2648('0xd'));var Papa=require(_0x2648('0xe'));var Redis=require(_0x2648('0xf'));var authService=require(_0x2648('0x10'));var qs=require(_0x2648('0x11'));var hardwareService=require(_0x2648('0x12'));var logger=require(_0x2648('0x13'))(_0x2648('0x14'));var utils=require(_0x2648('0x15'));var config=require('../../config/environment');var db=require(_0x2648('0x16'))['db'];config['redis']=_['defaults'](config[_0x2648('0x17')],{'host':_0x2648('0x18'),'port':0x18eb});var socket=require(_0x2648('0x19'))(new Redis(config[_0x2648('0x17')]));require(_0x2648('0x1a'))[_0x2648('0x1b')](socket);function respondWithStatusCode(_0x3d8749,_0x327475){_0x327475=_0x327475||0xcc;return function(_0x1edc6f){if(_0x1edc6f){return _0x3d8749[_0x2648('0x1c')](_0x327475);}return _0x3d8749[_0x2648('0x1d')](_0x327475)[_0x2648('0x1e')]();};}function respondWithResult(_0x4211d7,_0x404b10){_0x404b10=_0x404b10||0xc8;return function(_0x1b9686){if(_0x1b9686){return _0x4211d7['status'](_0x404b10)['json'](_0x1b9686);}};}function respondWithFilteredResult(_0x1e266b,_0x1cc5e6){return function(_0x5578bd){if(_0x5578bd){var _0x5bde50=_0x5578bd['count'],_0x3c7101=_0x1cc5e6[_0x2648('0x1f')],_0x2c4411=_0x1cc5e6['offset']+_0x1cc5e6['limit'],_0x422576;if(_0x2c4411>=_0x5bde50){_0x2c4411=_0x5bde50;_0x422576=0xc8;}else{_0x422576=0xce;}_0x1e266b[_0x2648('0x1d')](_0x422576);return _0x1e266b[_0x2648('0x20')](_0x2648('0x21'),_0x3c7101+'-'+_0x2c4411+'/'+_0x5bde50)[_0x2648('0x22')](_0x5578bd);}return null;};}function patchUpdates(_0x5c8c8c){return function(_0x2535bb){try{jsonpatch['apply'](_0x2535bb,_0x5c8c8c,!![]);}catch(_0x309331){return BPromise[_0x2648('0x23')](_0x309331);}return _0x2535bb[_0x2648('0x24')]();};}function saveUpdates(_0x8824f0,_0xd43962){return function(_0x259a77){if(_0x259a77){return _0x259a77[_0x2648('0x25')](_0x8824f0)['then'](function(_0x4947c8){return _0x4947c8;});}return null;};}function removeEntity(_0x25bac8,_0x4224f0){return function(_0xad3c11){if(_0xad3c11){return _0xad3c11[_0x2648('0x26')]()[_0x2648('0x27')](function(){var _0x2a748a=_0xad3c11['get']({'plain':!![]});var _0x125475=_0x2648('0x28');return db[_0x2648('0x29')][_0x2648('0x26')]({'where':{'type':_0x125475,'resourceId':_0x2a748a['id']}})['then'](function(){return _0xad3c11;});})[_0x2648('0x27')](function(){_0x25bac8[_0x2648('0x1d')](0xcc)[_0x2648('0x1e')]();});}};}function handleEntityNotFound(_0x4a537d,_0x545323){return function(_0x8b6d21){if(!_0x8b6d21){_0x4a537d['sendStatus'](0x194);}return _0x8b6d21;};}function handleError(_0x274886,_0x4a600d){_0x4a600d=_0x4a600d||0x1f4;return function(_0x13c145){logger[_0x2648('0x2a')](_0x13c145['stack']);if(_0x13c145['name']){delete _0x13c145['name'];}_0x274886['status'](_0x4a600d)[_0x2648('0x2b')](_0x13c145);};}exports[_0x2648('0x2c')]=function(_0x1225ce,_0x16235a){var _0x2bc8aa={},_0x5ea003={},_0x32a4a7={'count':0x0,'rows':[]};var _0x1809b7=db['Dashboard'][_0x2648('0x2d')];_0x5ea003[_0x2648('0x2e')]=_['keys'](_0x1809b7);_0x5ea003[_0x2648('0x2f')]=_[_0x2648('0x30')](_0x1225ce[_0x2648('0x2f')]);_0x5ea003[_0x2648('0x31')]=_[_0x2648('0x32')](_0x5ea003[_0x2648('0x2e')],_0x5ea003[_0x2648('0x2f')]);_0x2bc8aa[_0x2648('0x33')]=_['intersection'](_0x5ea003[_0x2648('0x2e')],qs[_0x2648('0x34')](_0x1225ce[_0x2648('0x2f')][_0x2648('0x34')]));_0x2bc8aa[_0x2648('0x33')]=_0x2bc8aa[_0x2648('0x33')][_0x2648('0x35')]?_0x2bc8aa[_0x2648('0x33')]:_0x5ea003[_0x2648('0x2e')];if(!_0x1225ce['query']['hasOwnProperty'](_0x2648('0x36'))){_0x2bc8aa['limit']=qs[_0x2648('0x37')](_0x1225ce[_0x2648('0x2f')][_0x2648('0x37')]);_0x2bc8aa[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0x1225ce[_0x2648('0x2f')][_0x2648('0x1f')]);}_0x2bc8aa[_0x2648('0x38')]=qs[_0x2648('0x39')](_0x1225ce[_0x2648('0x2f')][_0x2648('0x39')]);_0x2bc8aa[_0x2648('0x3a')]=qs[_0x2648('0x31')](_[_0x2648('0x3b')](_0x1225ce['query'],_0x5ea003['filters']));if(_0x1225ce[_0x2648('0x2f')][_0x2648('0x3c')]){_0x2bc8aa[_0x2648('0x3a')]=_[_0x2648('0x3d')](_0x2bc8aa[_0x2648('0x3a')],{'$or':_[_0x2648('0x3e')](_0x1809b7,function(_0x3aa2f0){if(_0x3aa2f0[_0x2648('0x3f')][_0x2648('0x40')]!==_0x2648('0x41')){var _0x3ca9dc={};_0x3ca9dc[_0x3aa2f0['field']]={'$like':'%'+_0x1225ce[_0x2648('0x2f')][_0x2648('0x3c')]+'%'};return _0x3ca9dc;}})});}_0x2bc8aa=_[_0x2648('0x3d')]({},_0x2bc8aa,_0x1225ce['options']);var _0x441acf={'where':_0x2bc8aa['where']};return db['Dashboard'][_0x2648('0x42')](_0x441acf)[_0x2648('0x27')](function(_0x5c3dae){_0x32a4a7[_0x2648('0x42')]=_0x5c3dae;if(_0x1225ce[_0x2648('0x2f')][_0x2648('0x43')]){_0x2bc8aa[_0x2648('0x44')]=[{'all':!![]}];}return db[_0x2648('0x45')][_0x2648('0x46')](_0x2bc8aa);})['then'](function(_0x200791){_0x32a4a7[_0x2648('0x47')]=_0x200791;return _0x32a4a7;})[_0x2648('0x27')](respondWithFilteredResult(_0x16235a,_0x2bc8aa))['catch'](handleError(_0x16235a,null));};exports[_0x2648('0x48')]=function(_0xec5225,_0x5df59e){var _0x2da125={'raw':![],'where':{'id':_0xec5225['params']['id']}},_0x5636ee={};_0x5636ee[_0x2648('0x2e')]=_['keys'](db[_0x2648('0x45')][_0x2648('0x2d')]);_0x5636ee[_0x2648('0x2f')]=_[_0x2648('0x30')](_0xec5225[_0x2648('0x2f')]);_0x5636ee[_0x2648('0x31')]=_[_0x2648('0x32')](_0x5636ee[_0x2648('0x2e')],_0x5636ee['query']);_0x2da125[_0x2648('0x33')]=_[_0x2648('0x32')](_0x5636ee[_0x2648('0x2e')],qs[_0x2648('0x34')](_0xec5225[_0x2648('0x2f')][_0x2648('0x34')]));_0x2da125[_0x2648('0x33')]=_0x2da125[_0x2648('0x33')][_0x2648('0x35')]?_0x2da125[_0x2648('0x33')]:_0x5636ee[_0x2648('0x2e')];if(_0xec5225[_0x2648('0x2f')][_0x2648('0x43')]){_0x2da125[_0x2648('0x44')]=[{'all':!![]}];}_0x2da125=_[_0x2648('0x3d')]({},_0x2da125,_0xec5225['options']);return db[_0x2648('0x45')]['find'](_0x2da125)['then'](handleEntityNotFound(_0x5df59e,null))[_0x2648('0x27')](respondWithResult(_0x5df59e,null))[_0x2648('0x49')](handleError(_0x5df59e,null));};exports[_0x2648('0x4a')]=function(_0x45ca9c,_0xecdac1){return db[_0x2648('0x45')][_0x2648('0x4a')](_0x45ca9c[_0x2648('0x4b')],{})['then'](function(_0x3e35a0){var _0x5ec9ec=_0x45ca9c[_0x2648('0x4c')][_0x2648('0x4d')]({'plain':!![]});if(!_0x5ec9ec)throw new Error(_0x2648('0x4e'));if(_0x5ec9ec[_0x2648('0x4f')]===_0x2648('0x4c')){var _0x5c3bca=_0x3e35a0['get']({'plain':!![]});var _0x72ba9='CustomDashboards';return db[_0x2648('0x50')]['find']({'where':{'name':_0x72ba9,'userProfileId':_0x5ec9ec[_0x2648('0x51')]},'raw':!![]})['then'](function(_0x5a2ca4){if(_0x5a2ca4&&_0x5a2ca4['autoAssociation']===0x0){return db[_0x2648('0x29')][_0x2648('0x4a')]({'name':_0x5c3bca[_0x2648('0x52')],'resourceId':_0x5c3bca['id'],'type':_0x5a2ca4[_0x2648('0x52')],'sectionId':_0x5a2ca4['id']},{})[_0x2648('0x27')](function(){return _0x3e35a0;});}else{return _0x3e35a0;}})[_0x2648('0x49')](function(_0x14d9d4){logger[_0x2648('0x2a')](_0x2648('0x53'),_0x14d9d4);throw _0x14d9d4;});}return _0x3e35a0;})[_0x2648('0x27')](respondWithResult(_0xecdac1,0xc9))['catch'](handleError(_0xecdac1,null));};exports['clone']=function(_0x4bed5b,_0x559c8a){var _0x1daa0b={'raw':![],'where':{'id':_0x4bed5b['params']['id']}},_0x41b2a9={};_0x41b2a9['model']=_[_0x2648('0x30')](db[_0x2648('0x45')][_0x2648('0x2d')]);_0x1daa0b[_0x2648('0x33')]=_[_0x2648('0x32')](_0x41b2a9[_0x2648('0x2e')],qs['fields'](_0x4bed5b[_0x2648('0x2f')]['fields']));_0x1daa0b[_0x2648('0x33')]=_0x1daa0b['attributes'][_0x2648('0x35')]?_0x1daa0b['attributes']:_0x41b2a9[_0x2648('0x2e')];if(_0x4bed5b['query'][_0x2648('0x43')]){_0x1daa0b[_0x2648('0x44')]=[{'all':!![]}];}_0x1daa0b=_[_0x2648('0x3d')]({},_0x1daa0b,_0x4bed5b['options']);return db[_0x2648('0x45')][_0x2648('0x54')](_0x1daa0b)['then'](handleEntityNotFound(_0x559c8a,null))[_0x2648('0x27')](function(_0x2cbe99){if(_0x2cbe99){var _0x3dcca3=_0x2cbe99[_0x2648('0x4d')]({'plain':!![]});_0x3dcca3=qs[_0x2648('0x55')](_0x3dcca3,['id','createdAt',_0x2648('0x56')]);_0x4bed5b['body']=_[_0x2648('0x55')](_0x4bed5b[_0x2648('0x4b')],['id','createdAt',_0x2648('0x56')]);return db['Dashboard'][_0x2648('0x4a')](_[_0x2648('0x3d')](_0x3dcca3,_0x4bed5b[_0x2648('0x4b')]),{'include':_0x4bed5b[_0x2648('0x2f')][_0x2648('0x43')]?[{'all':!![]}]:undefined})[_0x2648('0x27')](function(_0x44ddef){var _0x2cd714=_0x4bed5b[_0x2648('0x4c')]['get']({'plain':!![]});if(!_0x2cd714)throw new Error(_0x2648('0x4e'));if(_0x2cd714['role']===_0x2648('0x4c')){var _0xa1ae1c=_0x44ddef[_0x2648('0x4d')]({'plain':!![]});var _0x36d463=_0x2648('0x28');return db['UserProfileSection'][_0x2648('0x54')]({'where':{'name':_0x36d463,'userProfileId':_0x2cd714[_0x2648('0x51')]},'raw':!![]})[_0x2648('0x27')](function(_0x1001ec){if(_0x1001ec&&_0x1001ec[_0x2648('0x57')]===0x0){return db[_0x2648('0x29')][_0x2648('0x4a')]({'name':_0xa1ae1c[_0x2648('0x52')],'resourceId':_0xa1ae1c['id'],'type':_0x1001ec['name'],'sectionId':_0x1001ec['id']},{})[_0x2648('0x27')](function(){return _0x44ddef;});}else{return _0x44ddef;}})[_0x2648('0x49')](function(_0x36d436){logger['error'](_0x2648('0x53'),_0x36d436);throw _0x36d436;});}return _0x44ddef;});}})[_0x2648('0x27')](respondWithResult(_0x559c8a,0xc9))[_0x2648('0x49')](handleError(_0x559c8a,null));};exports[_0x2648('0x25')]=function(_0x51fd53,_0x105901){if(_0x51fd53[_0x2648('0x4b')]['id']){delete _0x51fd53[_0x2648('0x4b')]['id'];}return db[_0x2648('0x45')][_0x2648('0x54')]({'where':{'id':_0x51fd53[_0x2648('0x58')]['id']}})[_0x2648('0x27')](handleEntityNotFound(_0x105901,null))['then'](saveUpdates(_0x51fd53[_0x2648('0x4b')],null))[_0x2648('0x27')](respondWithResult(_0x105901,null))[_0x2648('0x49')](handleError(_0x105901,null));};exports[_0x2648('0x26')]=function(_0x3220aa,_0x10eac9){return db[_0x2648('0x45')]['find']({'where':{'id':_0x3220aa[_0x2648('0x58')]['id']}})[_0x2648('0x27')](handleEntityNotFound(_0x10eac9,null))[_0x2648('0x27')](removeEntity(_0x10eac9,null))[_0x2648('0x49')](handleError(_0x10eac9,null));};function widgetAttributes(_0x531e79){try{switch(_0x531e79['type']){case _0x2648('0x59'):return[{'name':_0x2648('0x5a'),'value':_0x531e79[_0x2648('0x5a')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0][_0x2648('0x5c')]:undefined)||_0x2648('0x5d')}];case'custom':return[{'name':'attrPath','value':_0x531e79[_0x2648('0x5e')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0]['value']:undefined)||''}];case _0x2648('0x5f'):return[{'name':'attrHourFormat','value':_0x531e79[_0x2648('0x60')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0][_0x2648('0x5c')]:undefined)||_0x2648('0x61')},{'name':_0x2648('0x62'),'value':_0x531e79['attrTimezone']||(_0x531e79['attrs']&&_0x531e79[_0x2648('0x5b')][0x1]?_0x531e79[_0x2648('0x5b')][0x1][_0x2648('0x5c')]:undefined)||'0.00'},{'name':_0x2648('0x63'),'value':_0x531e79['attrFontSize']||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x2]?_0x531e79[_0x2648('0x5b')][0x2][_0x2648('0x5c')]:undefined)||0xc}];case _0x2648('0x64'):return[{'name':'attrMetric','value':_0x531e79['attrMetric']||(_0x531e79['attrs']&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0][_0x2648('0x5c')]:undefined)||'total'},{'name':_0x2648('0x65'),'value':_0x531e79[_0x2648('0x65')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79['attrs'][0x1]?_0x531e79[_0x2648('0x5b')][0x1][_0x2648('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x531e79[_0x2648('0x63')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x2]?_0x531e79[_0x2648('0x5b')][0x2][_0x2648('0x5c')]:undefined)||0x14}];case _0x2648('0x66'):case _0x2648('0x67'):return[{'name':_0x2648('0x68'),'value':_0x531e79[_0x2648('0x68')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79['attrs'][0x0][_0x2648('0x5c')]:undefined)||_0x2648('0x69')},{'name':_0x2648('0x6a'),'value':_0x531e79[_0x2648('0x6a')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x1]?_0x531e79[_0x2648('0x5b')][0x1][_0x2648('0x5c')]:undefined)||null},{'name':_0x2648('0x6b'),'value':_0x531e79[_0x2648('0x6b')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x2]?_0x531e79[_0x2648('0x5b')][0x2][_0x2648('0x5c')]:undefined)||null},{'name':_0x2648('0x65'),'value':_0x531e79[_0x2648('0x65')]||(_0x531e79['attrs']&&_0x531e79['attrs'][0x3]?_0x531e79[_0x2648('0x5b')][0x3][_0x2648('0x5c')]:undefined)||[]}];case _0x2648('0x6c'):return[{'name':'attrReport','type':_0x531e79[_0x2648('0x6d')]||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0][_0x2648('0x3f')]:undefined)||null,'value':_0x531e79['attrReport']||(_0x531e79[_0x2648('0x5b')]&&_0x531e79[_0x2648('0x5b')][0x0]?_0x531e79[_0x2648('0x5b')][0x0]['value']:undefined)||null},{'name':_0x2648('0x6e'),'value':_0x531e79[_0x2648('0x6e')]||(_0x531e79['attrs']&&_0x531e79[_0x2648('0x5b')][0x1]?_0x531e79[_0x2648('0x5b')][0x1][_0x2648('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0xce6850){logger[_0x2648('0x2a')](_0x2648('0x6f'),JSON[_0x2648('0x70')](_0xce6850));return[];}}exports[_0x2648('0x71')]=function(_0x1adc96,_0x13d7b1,_0x4c88cf){if(_0x1adc96[_0x2648('0x4b')]['id']){delete _0x1adc96[_0x2648('0x4b')]['id'];}return db[_0x2648('0x45')][_0x2648('0x54')]({'where':{'id':_0x1adc96[_0x2648('0x58')]['id']}})['then'](handleEntityNotFound(_0x13d7b1,null))['then'](function(_0xef4b6f){if(_0xef4b6f){_0x1adc96[_0x2648('0x4b')][_0x2648('0x72')]=_0xef4b6f['id'];_0x1adc96[_0x2648('0x4b')][_0x2648('0x5b')]=widgetAttributes(_0x1adc96[_0x2648('0x4b')]);return db[_0x2648('0x73')][_0x2648('0x4a')](_0x1adc96[_0x2648('0x4b')]);}})[_0x2648('0x27')](respondWithResult(_0x13d7b1,null))[_0x2648('0x49')](handleError(_0x13d7b1,null));};exports['getItems']=function(_0x1128e9,_0x347cbc,_0x4fd7b6){var _0x412b95={};var _0x4c2b7a={};var _0x52046a;var _0x4203c2;return db[_0x2648('0x45')][_0x2648('0x74')]({'where':{'id':_0x1128e9[_0x2648('0x58')]['id']}})[_0x2648('0x27')](handleEntityNotFound(_0x347cbc,null))[_0x2648('0x27')](function(_0x2e9bc4){if(_0x2e9bc4){_0x52046a=_0x2e9bc4;_0x4c2b7a[_0x2648('0x2e')]=_['keys'](db[_0x2648('0x73')][_0x2648('0x2d')]);_0x4c2b7a['query']=_[_0x2648('0x30')](_0x1128e9[_0x2648('0x2f')]);_0x4c2b7a[_0x2648('0x31')]=_['intersection'](_0x4c2b7a[_0x2648('0x2e')],_0x4c2b7a[_0x2648('0x2f')]);_0x412b95['attributes']=_[_0x2648('0x32')](_0x4c2b7a[_0x2648('0x2e')],qs['fields'](_0x1128e9[_0x2648('0x2f')][_0x2648('0x34')]));_0x412b95[_0x2648('0x33')]=_0x412b95[_0x2648('0x33')][_0x2648('0x35')]?_0x412b95[_0x2648('0x33')]:_0x4c2b7a[_0x2648('0x2e')];_0x412b95[_0x2648('0x38')]=qs[_0x2648('0x39')](_0x1128e9[_0x2648('0x2f')][_0x2648('0x39')]);_0x412b95['where']=qs[_0x2648('0x31')](_[_0x2648('0x3b')](_0x1128e9[_0x2648('0x2f')],_0x4c2b7a[_0x2648('0x31')]));if(_0x1128e9[_0x2648('0x2f')]['filter']){_0x412b95['where']=_[_0x2648('0x3d')](_0x412b95[_0x2648('0x3a')],{'$or':_[_0x2648('0x3e')](_0x412b95[_0x2648('0x33')],function(_0x7ab381){var _0x57c5e8={};_0x57c5e8[_0x7ab381]={'$like':'%'+_0x1128e9['query']['filter']+'%'};return _0x57c5e8;})});}_0x412b95=_[_0x2648('0x3d')]({},_0x412b95,_0x1128e9[_0x2648('0x75')]);return _0x52046a[_0x2648('0x76')](_0x412b95);}})[_0x2648('0x27')](function(_0x1295d7){if(_0x1295d7){_0x4203c2=_0x1295d7[_0x2648('0x35')];if(!_0x1128e9[_0x2648('0x2f')][_0x2648('0x77')](_0x2648('0x36'))){_0x412b95[_0x2648('0x37')]=qs[_0x2648('0x37')](_0x1128e9['query']['limit']);_0x412b95[_0x2648('0x1f')]=qs['offset'](_0x1128e9[_0x2648('0x2f')][_0x2648('0x1f')]);}return _0x52046a[_0x2648('0x76')](_0x412b95);}})[_0x2648('0x27')](function(_0x34888b){if(_0x34888b){return _0x34888b?{'count':_0x4203c2,'rows':_0x34888b}:null;}})['then'](respondWithResult(_0x347cbc,null))['catch'](handleError(_0x347cbc,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bbc3de5..5a8a97b 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 _0x54c7=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x4eab08,_0x5b39de){var _0x1ce1cc=function(_0x204df9){while(--_0x204df9){_0x4eab08['push'](_0x4eab08['shift']());}};_0x1ce1cc(++_0x5b39de);}(_0x54c7,0x161));var _0x754c=function(_0x3ed66d,_0x3a6428){_0x3ed66d=_0x3ed66d-0x0;var _0x25371e=_0x54c7[_0x3ed66d];return _0x25371e;};'use strict';var EventEmitter=require(_0x754c('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x754c('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x754c('0x2')](0x0);var events={'afterCreate':_0x754c('0x3'),'afterUpdate':_0x754c('0x4'),'afterDestroy':_0x754c('0x5')};function emitEvent(_0x4bb46c){return function(_0x5000a8,_0x4a028d,_0x338ac1){DashboardEvents[_0x754c('0x6')](_0x4bb46c+':'+_0x5000a8['id'],_0x5000a8);DashboardEvents['emit'](_0x4bb46c,_0x5000a8);_0x338ac1(null);};}for(var e in events){if(events[_0x754c('0x7')](e)){var event=events[e];Dashboard[_0x754c('0x8')](e,emitEvent(event));}}module[_0x754c('0x9')]=DashboardEvents; \ No newline at end of file +var _0x7172=['update','remove','emit','hook','exports','Dashboard','save'];(function(_0x2bd440,_0xfb5a9d){var _0x58f325=function(_0x19847f){while(--_0x19847f){_0x2bd440['push'](_0x2bd440['shift']());}};_0x58f325(++_0xfb5a9d);}(_0x7172,0x1ef));var _0x2717=function(_0x146f92,_0x2ca3f7){_0x146f92=_0x146f92-0x0;var _0x303d3d=_0x7172[_0x146f92];return _0x303d3d;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x2717('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2717('0x1'),'afterUpdate':_0x2717('0x2'),'afterDestroy':_0x2717('0x3')};function emitEvent(_0x349ec6){return function(_0x772f4,_0x283b00,_0x2b3c58){DashboardEvents[_0x2717('0x4')](_0x349ec6+':'+_0x772f4['id'],_0x772f4);DashboardEvents[_0x2717('0x4')](_0x349ec6,_0x772f4);_0x2b3c58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x2717('0x5')](e,emitEvent(event));}}module[_0x2717('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 1954c24..025832a 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 _0x1696=['./dashboard.attributes','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c9bc4,_0x4b7f44){var _0xac3173=function(_0x55a5f6){while(--_0x55a5f6){_0x4c9bc4['push'](_0x4c9bc4['shift']());}};_0xac3173(++_0x4b7f44);}(_0x1696,0x79));var _0x6169=function(_0x4941aa,_0x4ea258){_0x4941aa=_0x4941aa-0x0;var _0x337cbc=_0x1696[_0x4941aa];return _0x337cbc;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var logger=require(_0x6169('0x1'))(_0x6169('0x2'));var moment=require(_0x6169('0x3'));var BPromise=require(_0x6169('0x4'));var rp=require(_0x6169('0x5'));var fs=require('fs');var path=require(_0x6169('0x6'));var rimraf=require(_0x6169('0x7'));var config=require(_0x6169('0x8'));var attributes=require(_0x6169('0x9'));module['exports']=function(_0x3569ff,_0x128cf1){return _0x3569ff[_0x6169('0xa')](_0x6169('0xb'),attributes,{'tableName':_0x6169('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc770=['path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','moment','bluebird','request-promise'];(function(_0x386f76,_0x2a7554){var _0x8e3723=function(_0x39d075){while(--_0x39d075){_0x386f76['push'](_0x386f76['shift']());}};_0x8e3723(++_0x2a7554);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('Dashboard',attributes,{'tableName':_0x0c77('0xb'),'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 85c7bf7..74c9271 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 _0x0894=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x897b38,_0x20943a){var _0x5365b7=function(_0x577666){while(--_0x577666){_0x897b38['push'](_0x897b38['shift']());}};_0x5365b7(++_0x20943a);}(_0x0894,0x11a));var _0x4089=function(_0x2ec5a9,_0x2e89c6){_0x2ec5a9=_0x2ec5a9-0x0;var _0x331c27=_0x0894[_0x2ec5a9];return _0x331c27;};'use strict';var _=require(_0x4089('0x0'));var util=require(_0x4089('0x1'));var moment=require(_0x4089('0x2'));var BPromise=require(_0x4089('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4089('0x4'));var db=require(_0x4089('0x5'))['db'];var utils=require(_0x4089('0x6'));var logger=require(_0x4089('0x7'))(_0x4089('0x8'));var config=require(_0x4089('0x9'));var jayson=require(_0x4089('0xa'));var client=jayson['client'][_0x4089('0xb')]({'port':0x232a});config[_0x4089('0xc')]=_[_0x4089('0xd')](config[_0x4089('0xc')],{'host':_0x4089('0xe'),'port':0x18eb});var socket=require(_0x4089('0xf'))(new Redis(config[_0x4089('0xc')]));require('./dashboard.socket')[_0x4089('0x10')](socket);function respondWithRpcPromise(_0x5a7822,_0x41f371,_0x4afce4){return new BPromise(function(_0x57b331,_0x18432a){return client[_0x4089('0x11')](_0x5a7822,_0x4afce4)[_0x4089('0x12')](function(_0x579545){logger[_0x4089('0x13')](_0x4089('0x14'),_0x41f371,_0x4089('0x15'));logger[_0x4089('0x16')](_0x4089('0x17'),_0x41f371,'request\x20sent',JSON[_0x4089('0x18')](_0x579545));if(_0x579545['error']){if(_0x579545[_0x4089('0x19')]['code']===0x1f4){logger[_0x4089('0x19')](_0x4089('0x14'),_0x41f371,_0x579545['error'][_0x4089('0x1a')]);return _0x18432a(_0x579545[_0x4089('0x19')][_0x4089('0x1a')]);}logger[_0x4089('0x19')]('Dashboard,\x20%s,\x20%s',_0x41f371,_0x579545[_0x4089('0x19')][_0x4089('0x1a')]);return _0x57b331(_0x579545['error'][_0x4089('0x1a')]);}else{logger[_0x4089('0x13')](_0x4089('0x14'),_0x41f371,_0x4089('0x15'));_0x57b331(_0x579545[_0x4089('0x1b')]['message']);}})['catch'](function(_0x45ca5b){logger['error'](_0x4089('0x14'),_0x41f371,_0x45ca5b);_0x18432a(_0x45ca5b);});});} \ No newline at end of file +var _0x1a80=['socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x4d9b68,_0x1fbb7e){var _0x521af4=function(_0x2c6e60){while(--_0x2c6e60){_0x4d9b68['push'](_0x4d9b68['shift']());}};_0x521af4(++_0x1fbb7e);}(_0x1a80,0x1b1));var _0x01a8=function(_0x5e900b,_0x32ba47){_0x5e900b=_0x5e900b-0x0;var _0x23d480=_0x1a80[_0x5e900b];return _0x23d480;};'use strict';var _=require(_0x01a8('0x0'));var util=require(_0x01a8('0x1'));var moment=require('moment');var BPromise=require(_0x01a8('0x2'));var rs=require(_0x01a8('0x3'));var fs=require('fs');var Redis=require(_0x01a8('0x4'));var db=require(_0x01a8('0x5'))['db'];var utils=require(_0x01a8('0x6'));var logger=require(_0x01a8('0x7'))('rpc');var config=require(_0x01a8('0x8'));var jayson=require(_0x01a8('0x9'));var client=jayson[_0x01a8('0xa')][_0x01a8('0xb')]({'port':0x232a});config['redis']=_[_0x01a8('0xc')](config[_0x01a8('0xd')],{'host':_0x01a8('0xe'),'port':0x18eb});var socket=require(_0x01a8('0xf'))(new Redis(config[_0x01a8('0xd')]));require(_0x01a8('0x10'))[_0x01a8('0x11')](socket);function respondWithRpcPromise(_0x85146e,_0x5b9ef2,_0x5f5d10){return new BPromise(function(_0x5ed867,_0x1942a7){return client['request'](_0x85146e,_0x5f5d10)[_0x01a8('0x12')](function(_0x246668){logger[_0x01a8('0x13')](_0x01a8('0x14'),_0x5b9ef2,'request\x20sent');logger[_0x01a8('0x15')](_0x01a8('0x16'),_0x5b9ef2,'request\x20sent',JSON[_0x01a8('0x17')](_0x246668));if(_0x246668[_0x01a8('0x18')]){if(_0x246668[_0x01a8('0x18')]['code']===0x1f4){logger['error'](_0x01a8('0x14'),_0x5b9ef2,_0x246668[_0x01a8('0x18')]['message']);return _0x1942a7(_0x246668[_0x01a8('0x18')][_0x01a8('0x19')]);}logger['error'](_0x01a8('0x14'),_0x5b9ef2,_0x246668[_0x01a8('0x18')][_0x01a8('0x19')]);return _0x5ed867(_0x246668[_0x01a8('0x18')][_0x01a8('0x19')]);}else{logger['info'](_0x01a8('0x14'),_0x5b9ef2,_0x01a8('0x1a'));_0x5ed867(_0x246668[_0x01a8('0x1b')][_0x01a8('0x19')]);}})['catch'](function(_0x26f6fd){logger[_0x01a8('0x18')](_0x01a8('0x14'),_0x5b9ef2,_0x26f6fd);_0x1942a7(_0x26f6fd);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 0bc5b99..1518a98 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 _0x5b46=['./dashboard.events','save','remove','update','emit','register','length','dashboard:'];(function(_0x50a463,_0x517a1a){var _0x2971df=function(_0x1f9cf1){while(--_0x1f9cf1){_0x50a463['push'](_0x50a463['shift']());}};_0x2971df(++_0x517a1a);}(_0x5b46,0xa8));var _0x65b4=function(_0x574573,_0x3814fc){_0x574573=_0x574573-0x0;var _0x394187=_0x5b46[_0x574573];return _0x394187;};'use strict';var DashboardEvents=require(_0x65b4('0x0'));var events=[_0x65b4('0x1'),_0x65b4('0x2'),_0x65b4('0x3')];function createListener(_0x5867c2,_0x71dab1){return function(_0x32090a){_0x71dab1[_0x65b4('0x4')](_0x5867c2,_0x32090a);};}function removeListener(_0x3d78a7,_0x15908b){return function(){DashboardEvents['removeListener'](_0x3d78a7,_0x15908b);};}exports[_0x65b4('0x5')]=function(_0xc9b89f){for(var _0x419fc9=0x0,_0x66f5c2=events[_0x65b4('0x6')];_0x419fc9<_0x66f5c2;_0x419fc9++){var _0x5ea7df=events[_0x419fc9];var _0x1202c7=createListener(_0x65b4('0x7')+_0x5ea7df,_0xc9b89f);DashboardEvents['on'](_0x5ea7df,_0x1202c7);}}; \ No newline at end of file +var _0x51d0=['length','./dashboard.events','save','remove','removeListener','register'];(function(_0x3b6414,_0x46987e){var _0x1269c2=function(_0x14b829){while(--_0x14b829){_0x3b6414['push'](_0x3b6414['shift']());}};_0x1269c2(++_0x46987e);}(_0x51d0,0x10f));var _0x051d=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x51d0[_0x1694f5];return _0x5b4321;};'use strict';var DashboardEvents=require(_0x051d('0x0'));var events=[_0x051d('0x1'),_0x051d('0x2'),'update'];function createListener(_0x503802,_0x2412e6){return function(_0x52150c){_0x2412e6['emit'](_0x503802,_0x52150c);};}function removeListener(_0x38683f,_0x27f2ef){return function(){DashboardEvents[_0x051d('0x3')](_0x38683f,_0x27f2ef);};}exports[_0x051d('0x4')]=function(_0x2bcf1d){for(var _0x3a3c64=0x0,_0x4a071e=events[_0x051d('0x5')];_0x3a3c64<_0x4a071e;_0x3a3c64++){var _0x3ea4a5=events[_0x3a3c64];var _0xb933e=createListener('dashboard:'+_0x3ea4a5,_0x2bcf1d);DashboardEvents['on'](_0x3ea4a5,_0xb933e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9f24dc6..7d34c37 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 _0xc9f0=['destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','getItems','post','create','clone','/:id/items','addItem','put','update','delete'];(function(_0x3562bf,_0x3ccc6e){var _0x4c8cdf=function(_0x3b061d){while(--_0x3b061d){_0x3562bf['push'](_0x3562bf['shift']());}};_0x4c8cdf(++_0x3ccc6e);}(_0xc9f0,0x86));var _0x0c9f=function(_0x4a6fa1,_0x5291bf){_0x4a6fa1=_0x4a6fa1-0x0;var _0x3ea91f=_0xc9f0[_0x4a6fa1];return _0x3ea91f;};'use strict';var multer=require('multer');var util=require(_0x0c9f('0x0'));var path=require('path');var timeout=require(_0x0c9f('0x1'));var express=require('express');var router=express[_0x0c9f('0x2')]();var auth=require(_0x0c9f('0x3'));var interaction=require(_0x0c9f('0x4'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router['get']('/',auth[_0x0c9f('0x5')](),controller['index']);router[_0x0c9f('0x6')](_0x0c9f('0x7'),auth[_0x0c9f('0x5')](),controller[_0x0c9f('0x8')]);router[_0x0c9f('0x6')]('/:id/items',auth[_0x0c9f('0x5')](),controller[_0x0c9f('0x9')]);router[_0x0c9f('0xa')]('/',auth[_0x0c9f('0x5')](),controller[_0x0c9f('0xb')]);router[_0x0c9f('0xa')]('/:id/clone',auth[_0x0c9f('0x5')](),controller[_0x0c9f('0xc')]);router['post'](_0x0c9f('0xd'),auth[_0x0c9f('0x5')](),controller[_0x0c9f('0xe')]);router[_0x0c9f('0xf')](_0x0c9f('0x7'),auth[_0x0c9f('0x5')](),controller[_0x0c9f('0x10')]);router[_0x0c9f('0x11')](_0x0c9f('0x7'),auth[_0x0c9f('0x5')](),controller[_0x0c9f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa2b8=['/:id/clone','clone','/:id/items','addItem','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x84ce4d,_0x24c6d7){var _0x327d33=function(_0x5748f9){while(--_0x5748f9){_0x84ce4d['push'](_0x84ce4d['shift']());}};_0x327d33(++_0x24c6d7);}(_0xa2b8,0x15a));var _0x8a2b=function(_0x763ae7,_0x249791){_0x763ae7=_0x763ae7-0x0;var _0x386de2=_0xa2b8[_0x763ae7];return _0x386de2;};'use strict';var multer=require(_0x8a2b('0x0'));var util=require('util');var path=require(_0x8a2b('0x1'));var timeout=require(_0x8a2b('0x2'));var express=require(_0x8a2b('0x3'));var router=express['Router']();var auth=require(_0x8a2b('0x4'));var interaction=require(_0x8a2b('0x5'));var config=require(_0x8a2b('0x6'));var controller=require(_0x8a2b('0x7'));router[_0x8a2b('0x8')]('/',auth[_0x8a2b('0x9')](),controller[_0x8a2b('0xa')]);router[_0x8a2b('0x8')](_0x8a2b('0xb'),auth[_0x8a2b('0x9')](),controller['show']);router[_0x8a2b('0x8')]('/:id/items',auth[_0x8a2b('0x9')](),controller['getItems']);router[_0x8a2b('0xc')]('/',auth[_0x8a2b('0x9')](),controller[_0x8a2b('0xd')]);router[_0x8a2b('0xc')](_0x8a2b('0xe'),auth['isAuthenticated'](),controller[_0x8a2b('0xf')]);router[_0x8a2b('0xc')](_0x8a2b('0x10'),auth[_0x8a2b('0x9')](),controller[_0x8a2b('0x11')]);router['put'](_0x8a2b('0xb'),auth[_0x8a2b('0x9')](),controller['update']);router['delete'](_0x8a2b('0xb'),auth[_0x8a2b('0x9')](),controller[_0x8a2b('0x12')]);module[_0x8a2b('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 552efad..edf081a 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 _0x3d84=['INTEGER','#ffffff','sequelize','squel','STRING','long','getDataValue','attrs','setDataValue','stringify'];(function(_0x2c46c2,_0x3b2c78){var _0x26af87=function(_0x3e1dbf){while(--_0x3e1dbf){_0x2c46c2['push'](_0x2c46c2['shift']());}};_0x26af87(++_0x3b2c78);}(_0x3d84,0x106));var _0x43d8=function(_0x4d686d,_0x3e00ed){_0x4d686d=_0x4d686d-0x0;var _0x55a15a=_0x3d84[_0x4d686d];return _0x55a15a;};'use strict';var Sequelize=require(_0x43d8('0x0'));var squel=require(_0x43d8('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x43d8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x43d8('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x43d8('0x3')),'get':function(){try{return JSON['parse'](this[_0x43d8('0x4')](_0x43d8('0x5')));}catch(_0xb5b1b0){return[];}},'set':function(_0x5b2b8e){try{this[_0x43d8('0x6')](_0x43d8('0x5'),JSON[_0x43d8('0x7')](_0x5b2b8e));}catch(_0x3f47eb){this[_0x43d8('0x6')](_0x43d8('0x5'),JSON[_0x43d8('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x43d8('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x43d8('0x8')]},'col':{'type':Sequelize[_0x43d8('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x43d8('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x43d8('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x43d8('0x2')]}}; \ No newline at end of file +var _0x2ff3=['sequelize','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x47adec,_0x3fbd62){var _0x39aaba=function(_0x3d8d0a){while(--_0x3d8d0a){_0x47adec['push'](_0x47adec['shift']());}};_0x39aaba(++_0x3fbd62);}(_0x2ff3,0xf7));var _0x32ff=function(_0x1a992d,_0x2d36c3){_0x1a992d=_0x1a992d-0x0;var _0xb91059=_0x2ff3[_0x1a992d];return _0xb91059;};'use strict';var Sequelize=require(_0x32ff('0x0'));var squel=require('squel');var _=require(_0x32ff('0x1'));module[_0x32ff('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x32ff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x32ff('0x4')](_0x32ff('0x5')),'get':function(){try{return JSON[_0x32ff('0x6')](this['getDataValue'](_0x32ff('0x7')));}catch(_0x3fa146){return[];}},'set':function(_0x671507){try{this[_0x32ff('0x8')](_0x32ff('0x7'),JSON[_0x32ff('0x9')](_0x671507));}catch(_0x46b73d){this[_0x32ff('0x8')](_0x32ff('0x7'),JSON[_0x32ff('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ff('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ff('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x32ff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ff('0x3')],'allowNull':![],'defaultValue':_0x32ff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 8d5eed9..0418f09 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 _0xc86d=['attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','stringify','body','create','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','error','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock'];(function(_0x58e84b,_0x1f0cb1){var _0x17bebf=function(_0x27c30f){while(--_0x27c30f){_0x58e84b['push'](_0x58e84b['shift']());}};_0x17bebf(++_0x1f0cb1);}(_0xc86d,0x66));var _0xdc86=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc86d[_0x491a7f];return _0x3d8f44;};'use strict';var pdf=require(_0xdc86('0x0'));var emlformat=require(_0xdc86('0x1'));var rimraf=require(_0xdc86('0x2'));var zipdir=require(_0xdc86('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc86('0x4'));var moment=require(_0xdc86('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc86('0x6'));var util=require('util');var path=require(_0xdc86('0x7'));var sox=require(_0xdc86('0x8'));var csv=require('to-csv');var ejs=require(_0xdc86('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdc86('0xa'));var jsforce=require(_0xdc86('0xb'));var deskjs=require(_0xdc86('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdc86('0xd'));var Papa=require(_0xdc86('0xe'));var Redis=require(_0xdc86('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdc86('0x10'));var logger=require(_0xdc86('0x11'))('api');var utils=require(_0xdc86('0x12'));var config=require(_0xdc86('0x13'));var db=require(_0xdc86('0x14'))['db'];config[_0xdc86('0x15')]=_['defaults'](config['redis'],{'host':_0xdc86('0x16'),'port':0x18eb});var socket=require(_0xdc86('0x17'))(new Redis(config[_0xdc86('0x15')]));require('./dashboardItem.socket')[_0xdc86('0x18')](socket);function respondWithStatusCode(_0x494e58,_0x5f34af){_0x5f34af=_0x5f34af||0xcc;return function(_0x3d1c90){if(_0x3d1c90){return _0x494e58[_0xdc86('0x19')](_0x5f34af);}return _0x494e58[_0xdc86('0x1a')](_0x5f34af)[_0xdc86('0x1b')]();};}function respondWithResult(_0x39f438,_0x4ab1fb){_0x4ab1fb=_0x4ab1fb||0xc8;return function(_0x3ea0b3){if(_0x3ea0b3){return _0x39f438[_0xdc86('0x1a')](_0x4ab1fb)[_0xdc86('0x1c')](_0x3ea0b3);}};}function respondWithFilteredResult(_0x2f58c1,_0xd61370){return function(_0x160dda){if(_0x160dda){var _0x4aa5db=_0x160dda['count'],_0x17c8b1=_0xd61370[_0xdc86('0x1d')],_0x5179d6=_0xd61370[_0xdc86('0x1d')]+_0xd61370[_0xdc86('0x1e')],_0xafa4d2;if(_0x5179d6>=_0x4aa5db){_0x5179d6=_0x4aa5db;_0xafa4d2=0xc8;}else{_0xafa4d2=0xce;}_0x2f58c1[_0xdc86('0x1a')](_0xafa4d2);return _0x2f58c1[_0xdc86('0x1f')](_0xdc86('0x20'),_0x17c8b1+'-'+_0x5179d6+'/'+_0x4aa5db)[_0xdc86('0x1c')](_0x160dda);}return null;};}function patchUpdates(_0x25f317){return function(_0x11be4e){try{jsonpatch[_0xdc86('0x21')](_0x11be4e,_0x25f317,!![]);}catch(_0x3e2d71){return BPromise['reject'](_0x3e2d71);}return _0x11be4e[_0xdc86('0x22')]();};}function saveUpdates(_0xbb6198,_0x37e310){return function(_0x9f472){if(_0x9f472){return _0x9f472[_0xdc86('0x23')](_0xbb6198)[_0xdc86('0x24')](function(_0x401ea5){return _0x401ea5;});}return null;};}function removeEntity(_0x396c83,_0x4ac06a){return function(_0x33262a){if(_0x33262a){return _0x33262a['destroy']()[_0xdc86('0x24')](function(){_0x396c83[_0xdc86('0x1a')](0xcc)[_0xdc86('0x1b')]();});}};}function handleEntityNotFound(_0x28deed,_0x296cde){return function(_0x35fbcd){if(!_0x35fbcd){_0x28deed[_0xdc86('0x19')](0x194);}return _0x35fbcd;};}function handleError(_0x5c416a,_0x318bcc){_0x318bcc=_0x318bcc||0x1f4;return function(_0xb38219){logger[_0xdc86('0x25')](_0xb38219['stack']);if(_0xb38219[_0xdc86('0x26')]){delete _0xb38219[_0xdc86('0x26')];}_0x5c416a[_0xdc86('0x1a')](_0x318bcc)[_0xdc86('0x27')](_0xb38219);};}exports[_0xdc86('0x28')]=function(_0x1d77e1,_0x2b66a8){var _0x4539c6={'raw':![],'where':{'id':_0x1d77e1[_0xdc86('0x29')]['id']}},_0x189902={};_0x189902[_0xdc86('0x2a')]=_[_0xdc86('0x2b')](db[_0xdc86('0x2c')][_0xdc86('0x2d')]);_0x189902[_0xdc86('0x2e')]=_[_0xdc86('0x2b')](_0x1d77e1[_0xdc86('0x2e')]);_0x189902[_0xdc86('0x2f')]=_[_0xdc86('0x30')](_0x189902[_0xdc86('0x2a')],_0x189902['query']);_0x4539c6['attributes']=_[_0xdc86('0x30')](_0x189902['model'],qs[_0xdc86('0x31')](_0x1d77e1[_0xdc86('0x2e')][_0xdc86('0x31')]));_0x4539c6[_0xdc86('0x32')]=_0x4539c6[_0xdc86('0x32')][_0xdc86('0x33')]?_0x4539c6[_0xdc86('0x32')]:_0x189902[_0xdc86('0x2a')];if(_0x1d77e1[_0xdc86('0x2e')][_0xdc86('0x34')]){_0x4539c6[_0xdc86('0x35')]=[{'all':!![]}];}_0x4539c6=_[_0xdc86('0x36')]({},_0x4539c6,_0x1d77e1[_0xdc86('0x37')]);return db[_0xdc86('0x2c')][_0xdc86('0x38')](_0x4539c6)[_0xdc86('0x24')](handleEntityNotFound(_0x2b66a8,null))[_0xdc86('0x24')](respondWithResult(_0x2b66a8,null))[_0xdc86('0x39')](handleError(_0x2b66a8,null));};exports['destroy']=function(_0x1d8d9d,_0x3d0731){return db['DashboardItem'][_0xdc86('0x38')]({'where':{'id':_0x1d8d9d[_0xdc86('0x29')]['id']}})['then'](handleEntityNotFound(_0x3d0731,null))[_0xdc86('0x24')](removeEntity(_0x3d0731,null))[_0xdc86('0x39')](handleError(_0x3d0731,null));};function widgetAttributes(_0x9b30c4){try{switch(_0x9b30c4[_0xdc86('0x3a')]){case _0xdc86('0x3b'):return[{'name':_0xdc86('0x3c'),'value':_0x9b30c4['attrUrl']||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x0]?_0x9b30c4[_0xdc86('0x3d')][0x0][_0xdc86('0x3e')]:undefined)||'https://'}];case _0xdc86('0x3f'):return[{'name':_0xdc86('0x40'),'value':_0x9b30c4['attrPath']||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4['attrs'][0x0]?_0x9b30c4[_0xdc86('0x3d')][0x0]['value']:undefined)||''}];case _0xdc86('0x41'):return[{'name':_0xdc86('0x42'),'value':_0x9b30c4[_0xdc86('0x42')]||(_0x9b30c4['attrs']&&_0x9b30c4[_0xdc86('0x3d')][0x0]?_0x9b30c4['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x9b30c4[_0xdc86('0x43')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x1]?_0x9b30c4[_0xdc86('0x3d')][0x1][_0xdc86('0x3e')]:undefined)||_0xdc86('0x44')},{'name':_0xdc86('0x45'),'value':_0x9b30c4[_0xdc86('0x45')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x2]?_0x9b30c4[_0xdc86('0x3d')][0x2][_0xdc86('0x3e')]:undefined)||0xc}];case'counter':return[{'name':_0xdc86('0x46'),'value':_0x9b30c4[_0xdc86('0x46')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x0]?_0x9b30c4[_0xdc86('0x3d')][0x0]['value']:undefined)||_0xdc86('0x47')},{'name':_0xdc86('0x48'),'value':_0x9b30c4['attrVoiceQueues']||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x1]?_0x9b30c4[_0xdc86('0x3d')][0x1][_0xdc86('0x3e')]:undefined)||[]},{'name':_0xdc86('0x45'),'value':_0x9b30c4[_0xdc86('0x45')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x2]?_0x9b30c4[_0xdc86('0x3d')][0x2]['value']:undefined)||0x14}];case _0xdc86('0x49'):case _0xdc86('0x4a'):return[{'name':_0xdc86('0x4b'),'value':_0x9b30c4[_0xdc86('0x4b')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4['attrs'][0x0]?_0x9b30c4[_0xdc86('0x3d')][0x0][_0xdc86('0x3e')]:undefined)||_0xdc86('0x47')},{'name':_0xdc86('0x4c'),'value':_0x9b30c4[_0xdc86('0x4c')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x1]?_0x9b30c4['attrs'][0x1]['value']:undefined)||null},{'name':_0xdc86('0x4d'),'value':_0x9b30c4['attrSerie3']||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x2]?_0x9b30c4[_0xdc86('0x3d')][0x2]['value']:undefined)||null},{'name':_0xdc86('0x48'),'value':_0x9b30c4[_0xdc86('0x48')]||(_0x9b30c4['attrs']&&_0x9b30c4[_0xdc86('0x3d')][0x3]?_0x9b30c4[_0xdc86('0x3d')][0x3]['value']:undefined)||[]}];case _0xdc86('0x4e'):return[{'name':'attrReport','type':_0x9b30c4[_0xdc86('0x4f')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x0]?_0x9b30c4[_0xdc86('0x3d')][0x0]['type']:undefined)||null,'value':_0x9b30c4['attrReport']||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4['attrs'][0x0]?_0x9b30c4['attrs'][0x0]['value']:undefined)||null},{'name':_0xdc86('0x50'),'value':_0x9b30c4[_0xdc86('0x50')]||(_0x9b30c4[_0xdc86('0x3d')]&&_0x9b30c4[_0xdc86('0x3d')][0x1]?_0x9b30c4[_0xdc86('0x3d')][0x1][_0xdc86('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x2068c3){logger[_0xdc86('0x25')]('widgetAttributes:\x20%s',JSON[_0xdc86('0x51')](_0x2068c3));return[];}}exports['create']=function(_0x6a3a6c,_0x5c6ccc){if(_0x6a3a6c[_0xdc86('0x52')]){_0x6a3a6c[_0xdc86('0x52')][_0xdc86('0x3d')]=widgetAttributes(_0x6a3a6c[_0xdc86('0x52')]);}return db[_0xdc86('0x2c')][_0xdc86('0x53')](_0x6a3a6c[_0xdc86('0x52')],{})[_0xdc86('0x24')](respondWithResult(_0x5c6ccc,0xc9))[_0xdc86('0x39')](handleError(_0x5c6ccc,null));};exports[_0xdc86('0x23')]=function(_0xa7fd6f,_0x5ad3c9){if(_0xa7fd6f[_0xdc86('0x52')]['id']){delete _0xa7fd6f[_0xdc86('0x52')]['id'];}_0xa7fd6f[_0xdc86('0x52')][_0xdc86('0x3d')]=widgetAttributes(_0xa7fd6f[_0xdc86('0x52')]);return db[_0xdc86('0x2c')][_0xdc86('0x38')]({'where':{'id':_0xa7fd6f['params']['id']}})['then'](handleEntityNotFound(_0x5ad3c9,null))[_0xdc86('0x24')](saveUpdates(_0xa7fd6f['body'],null))[_0xdc86('0x24')](respondWithResult(_0x5ad3c9,null))['catch'](handleError(_0x5ad3c9,null));}; \ No newline at end of file +var _0x81c7=['reject','update','then','sendStatus','error','stack','name','show','params','model','keys','DashboardItem','query','filters','intersection','attributes','length','includeAll','include','merge','catch','destroy','find','attrUrl','attrs','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','value','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','register','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x81c7,0x1ca));var _0x781c=function(_0x5b7e3d,_0x48026e){_0x5b7e3d=_0x5b7e3d-0x0;var _0x1c015f=_0x81c7[_0x5b7e3d];return _0x1c015f;};'use strict';var pdf=require(_0x781c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x781c('0x1'));var jsonpatch=require(_0x781c('0x2'));var rp=require(_0x781c('0x3'));var moment=require(_0x781c('0x4'));var BPromise=require(_0x781c('0x5'));var Mustache=require('mustache');var util=require(_0x781c('0x6'));var path=require(_0x781c('0x7'));var sox=require('sox');var csv=require(_0x781c('0x8'));var ejs=require(_0x781c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x781c('0xa'));var crypto=require(_0x781c('0xb'));var jsforce=require(_0x781c('0xc'));var deskjs=require(_0x781c('0xd'));var toCsv=require(_0x781c('0x8'));var querystring=require(_0x781c('0xe'));var Papa=require(_0x781c('0xf'));var Redis=require('ioredis');var authService=require(_0x781c('0x10'));var qs=require(_0x781c('0x11'));var hardwareService=require(_0x781c('0x12'));var logger=require(_0x781c('0x13'))('api');var utils=require(_0x781c('0x14'));var config=require(_0x781c('0x15'));var db=require(_0x781c('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x781c('0x17')]));require('./dashboardItem.socket')[_0x781c('0x18')](socket);function respondWithStatusCode(_0x53f03a,_0x2c02e2){_0x2c02e2=_0x2c02e2||0xcc;return function(_0xdf2ad0){if(_0xdf2ad0){return _0x53f03a['sendStatus'](_0x2c02e2);}return _0x53f03a[_0x781c('0x19')](_0x2c02e2)[_0x781c('0x1a')]();};}function respondWithResult(_0x38dfb5,_0x505709){_0x505709=_0x505709||0xc8;return function(_0xf0c05e){if(_0xf0c05e){return _0x38dfb5['status'](_0x505709)[_0x781c('0x1b')](_0xf0c05e);}};}function respondWithFilteredResult(_0x5e6ce2,_0x38d56a){return function(_0x370670){if(_0x370670){var _0xc693b0=_0x370670[_0x781c('0x1c')],_0x2bd164=_0x38d56a[_0x781c('0x1d')],_0x1b4607=_0x38d56a[_0x781c('0x1d')]+_0x38d56a[_0x781c('0x1e')],_0x3a98c9;if(_0x1b4607>=_0xc693b0){_0x1b4607=_0xc693b0;_0x3a98c9=0xc8;}else{_0x3a98c9=0xce;}_0x5e6ce2[_0x781c('0x19')](_0x3a98c9);return _0x5e6ce2[_0x781c('0x1f')](_0x781c('0x20'),_0x2bd164+'-'+_0x1b4607+'/'+_0xc693b0)[_0x781c('0x1b')](_0x370670);}return null;};}function patchUpdates(_0x4e4410){return function(_0x4c1d24){try{jsonpatch[_0x781c('0x21')](_0x4c1d24,_0x4e4410,!![]);}catch(_0x1a7480){return BPromise[_0x781c('0x22')](_0x1a7480);}return _0x4c1d24['save']();};}function saveUpdates(_0x445c4f,_0x30fee1){return function(_0x59ef04){if(_0x59ef04){return _0x59ef04[_0x781c('0x23')](_0x445c4f)['then'](function(_0x18210a){return _0x18210a;});}return null;};}function removeEntity(_0x3def6c,_0x675edd){return function(_0x343304){if(_0x343304){return _0x343304['destroy']()[_0x781c('0x24')](function(){_0x3def6c[_0x781c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483eb5,_0xb74d8e){return function(_0x4fce90){if(!_0x4fce90){_0x483eb5[_0x781c('0x25')](0x194);}return _0x4fce90;};}function handleError(_0x44e84b,_0x3eeb54){_0x3eeb54=_0x3eeb54||0x1f4;return function(_0x4bd929){logger[_0x781c('0x26')](_0x4bd929[_0x781c('0x27')]);if(_0x4bd929[_0x781c('0x28')]){delete _0x4bd929['name'];}_0x44e84b['status'](_0x3eeb54)['send'](_0x4bd929);};}exports[_0x781c('0x29')]=function(_0x4ff880,_0x141588){var _0x478dee={'raw':![],'where':{'id':_0x4ff880[_0x781c('0x2a')]['id']}},_0x27828b={};_0x27828b[_0x781c('0x2b')]=_[_0x781c('0x2c')](db[_0x781c('0x2d')]['rawAttributes']);_0x27828b[_0x781c('0x2e')]=_[_0x781c('0x2c')](_0x4ff880[_0x781c('0x2e')]);_0x27828b[_0x781c('0x2f')]=_[_0x781c('0x30')](_0x27828b[_0x781c('0x2b')],_0x27828b[_0x781c('0x2e')]);_0x478dee['attributes']=_[_0x781c('0x30')](_0x27828b['model'],qs['fields'](_0x4ff880['query']['fields']));_0x478dee[_0x781c('0x31')]=_0x478dee[_0x781c('0x31')][_0x781c('0x32')]?_0x478dee[_0x781c('0x31')]:_0x27828b['model'];if(_0x4ff880[_0x781c('0x2e')][_0x781c('0x33')]){_0x478dee[_0x781c('0x34')]=[{'all':!![]}];}_0x478dee=_[_0x781c('0x35')]({},_0x478dee,_0x4ff880['options']);return db[_0x781c('0x2d')]['find'](_0x478dee)[_0x781c('0x24')](handleEntityNotFound(_0x141588,null))['then'](respondWithResult(_0x141588,null))[_0x781c('0x36')](handleError(_0x141588,null));};exports[_0x781c('0x37')]=function(_0x3a6d5f,_0x4fb57e){return db[_0x781c('0x2d')][_0x781c('0x38')]({'where':{'id':_0x3a6d5f[_0x781c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4fb57e,null))[_0x781c('0x24')](removeEntity(_0x4fb57e,null))['catch'](handleError(_0x4fb57e,null));};function widgetAttributes(_0x444916){try{switch(_0x444916['type']){case'iframe':return[{'name':_0x781c('0x39'),'value':_0x444916[_0x781c('0x39')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916[_0x781c('0x3a')][0x0]['value']:undefined)||_0x781c('0x3b')}];case'custom':return[{'name':_0x781c('0x3c'),'value':_0x444916['attrPath']||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916[_0x781c('0x3a')][0x0]['value']:undefined)||''}];case _0x781c('0x3d'):return[{'name':_0x781c('0x3e'),'value':_0x444916[_0x781c('0x3e')]||(_0x444916['attrs']&&_0x444916['attrs'][0x0]?_0x444916[_0x781c('0x3a')][0x0]['value']:undefined)||_0x781c('0x3f')},{'name':_0x781c('0x40'),'value':_0x444916['attrTimezone']||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x1]?_0x444916[_0x781c('0x3a')][0x1]['value']:undefined)||'0.00'},{'name':_0x781c('0x41'),'value':_0x444916[_0x781c('0x41')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x2]?_0x444916[_0x781c('0x3a')][0x2]['value']:undefined)||0xc}];case _0x781c('0x42'):return[{'name':_0x781c('0x43'),'value':_0x444916['attrMetric']||(_0x444916['attrs']&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916[_0x781c('0x3a')][0x0]['value']:undefined)||_0x781c('0x44')},{'name':_0x781c('0x45'),'value':_0x444916[_0x781c('0x45')]||(_0x444916[_0x781c('0x3a')]&&_0x444916['attrs'][0x1]?_0x444916[_0x781c('0x3a')][0x1][_0x781c('0x46')]:undefined)||[]},{'name':_0x781c('0x41'),'value':_0x444916[_0x781c('0x41')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x2]?_0x444916[_0x781c('0x3a')][0x2][_0x781c('0x46')]:undefined)||0x14}];case _0x781c('0x47'):case'pie-chart':return[{'name':_0x781c('0x48'),'value':_0x444916['attrSerie1']||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916[_0x781c('0x3a')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x444916[_0x781c('0x49')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x1]?_0x444916[_0x781c('0x3a')][0x1][_0x781c('0x46')]:undefined)||null},{'name':'attrSerie3','value':_0x444916[_0x781c('0x4a')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x2]?_0x444916[_0x781c('0x3a')][0x2][_0x781c('0x46')]:undefined)||null},{'name':_0x781c('0x45'),'value':_0x444916[_0x781c('0x45')]||(_0x444916['attrs']&&_0x444916[_0x781c('0x3a')][0x3]?_0x444916['attrs'][0x3][_0x781c('0x46')]:undefined)||[]}];case _0x781c('0x4b'):return[{'name':_0x781c('0x4c'),'type':_0x444916[_0x781c('0x4d')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916[_0x781c('0x3a')][0x0]['type']:undefined)||null,'value':_0x444916[_0x781c('0x4c')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x0]?_0x444916['attrs'][0x0][_0x781c('0x46')]:undefined)||null},{'name':_0x781c('0x4e'),'value':_0x444916[_0x781c('0x4e')]||(_0x444916[_0x781c('0x3a')]&&_0x444916[_0x781c('0x3a')][0x1]?_0x444916['attrs'][0x1][_0x781c('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x3ac61f){logger[_0x781c('0x26')]('widgetAttributes:\x20%s',JSON[_0x781c('0x4f')](_0x3ac61f));return[];}}exports[_0x781c('0x50')]=function(_0x508ba3,_0x314d9c){if(_0x508ba3[_0x781c('0x51')]){_0x508ba3['body']['attrs']=widgetAttributes(_0x508ba3[_0x781c('0x51')]);}return db[_0x781c('0x2d')][_0x781c('0x50')](_0x508ba3[_0x781c('0x51')],{})[_0x781c('0x24')](respondWithResult(_0x314d9c,0xc9))[_0x781c('0x36')](handleError(_0x314d9c,null));};exports[_0x781c('0x23')]=function(_0x49d256,_0x427b9d){if(_0x49d256[_0x781c('0x51')]['id']){delete _0x49d256[_0x781c('0x51')]['id'];}_0x49d256['body'][_0x781c('0x3a')]=widgetAttributes(_0x49d256['body']);return db[_0x781c('0x2d')][_0x781c('0x38')]({'where':{'id':_0x49d256[_0x781c('0x2a')]['id']}})[_0x781c('0x24')](handleEntityNotFound(_0x427b9d,null))[_0x781c('0x24')](saveUpdates(_0x49d256[_0x781c('0x51')],null))['then'](respondWithResult(_0x427b9d,null))[_0x781c('0x36')](handleError(_0x427b9d,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index aebcbf8..a40edd9 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 _0x32f4=['update','remove','emit','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0xbc60b5,_0xaf34a0){var _0x261773=function(_0x3a1675){while(--_0x3a1675){_0xbc60b5['push'](_0xbc60b5['shift']());}};_0x261773(++_0xaf34a0);}(_0x32f4,0x154));var _0x432f=function(_0x50ea03,_0x111d6d){_0x50ea03=_0x50ea03-0x0;var _0x442b60=_0x32f4[_0x50ea03];return _0x442b60;};'use strict';var EventEmitter=require(_0x432f('0x0'));var DashboardItem=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x432f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x432f('0x4'),'afterDestroy':_0x432f('0x5')};function emitEvent(_0x51a71a){return function(_0x354293,_0x1eabac,_0x344a29){DashboardItemEvents[_0x432f('0x6')](_0x51a71a+':'+_0x354293['id'],_0x354293);DashboardItemEvents[_0x432f('0x6')](_0x51a71a,_0x354293);_0x344a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x432f('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xe61c=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','DashboardItem'];(function(_0x3c34f7,_0x33db45){var _0x106ef1=function(_0x109c7f){while(--_0x109c7f){_0x3c34f7['push'](_0x3c34f7['shift']());}};_0x106ef1(++_0x33db45);}(_0xe61c,0xee));var _0xce61=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xe61c[_0x80f51a];return _0x327148;};'use strict';var EventEmitter=require(_0xce61('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xce61('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce61('0x2')](0x0);var events={'afterCreate':_0xce61('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x265c61){return function(_0x549866,_0x322876,_0xefb221){DashboardItemEvents[_0xce61('0x4')](_0x265c61+':'+_0x549866['id'],_0x549866);DashboardItemEvents[_0xce61('0x4')](_0x265c61,_0x549866);_0xefb221(null);};}for(var e in events){if(events[_0xce61('0x5')](e)){var event=events[e];DashboardItem[_0xce61('0x6')](e,emitEvent(event));}}module[_0xce61('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3d757e0..e12979b 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 _0xb02d=['bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','util','../../config/logger','api'];(function(_0x397a4c,_0x39f610){var _0x3732b0=function(_0x4d5f5a){while(--_0x4d5f5a){_0x397a4c['push'](_0x397a4c['shift']());}};_0x3732b0(++_0x39f610);}(_0xb02d,0xf9));var _0xdb02=function(_0x37a85d,_0x34d0c3){_0x37a85d=_0x37a85d-0x0;var _0x21c0fc=_0xb02d[_0x37a85d];return _0x21c0fc;};'use strict';var _=require(_0xdb02('0x0'));var util=require(_0xdb02('0x1'));var logger=require(_0xdb02('0x2'))(_0xdb02('0x3'));var moment=require('moment');var BPromise=require(_0xdb02('0x4'));var rp=require(_0xdb02('0x5'));var fs=require('fs');var path=require(_0xdb02('0x6'));var rimraf=require('rimraf');var config=require(_0xdb02('0x7'));var attributes=require(_0xdb02('0x8'));module['exports']=function(_0x223b3c,_0x304c6e){return _0x223b3c[_0xdb02('0x9')](_0xdb02('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e1=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x97cff3,_0x4ea69b){var _0x4165c9=function(_0x43417c){while(--_0x43417c){_0x97cff3['push'](_0x97cff3['shift']());}};_0x4165c9(++_0x4ea69b);}(_0xd0e1,0x1a6));var _0x1d0e=function(_0xa47927,_0x288112){_0xa47927=_0xa47927-0x0;var _0x419338=_0xd0e1[_0xa47927];return _0x419338;};'use strict';var _=require(_0x1d0e('0x0'));var util=require(_0x1d0e('0x1'));var logger=require(_0x1d0e('0x2'))(_0x1d0e('0x3'));var moment=require(_0x1d0e('0x4'));var BPromise=require(_0x1d0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d0e('0x6'));var rimraf=require(_0x1d0e('0x7'));var config=require(_0x1d0e('0x8'));var attributes=require(_0x1d0e('0x9'));module[_0x1d0e('0xa')]=function(_0x3408d3,_0x1d0276){return _0x3408d3[_0x1d0e('0xb')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 2d320c9..ae9d3a0 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 _0x219e=['socket.io-emitter','./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','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x219e,0x1ce));var _0xe219=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x219e[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0xe219('0x0'));var moment=require(_0xe219('0x1'));var BPromise=require(_0xe219('0x2'));var rs=require(_0xe219('0x3'));var fs=require('fs');var Redis=require(_0xe219('0x4'));var db=require(_0xe219('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe219('0x6'))(_0xe219('0x7'));var config=require(_0xe219('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe219('0x9')][_0xe219('0xa')]({'port':0x232a});config['redis']=_[_0xe219('0xb')](config[_0xe219('0xc')],{'host':_0xe219('0xd'),'port':0x18eb});var socket=require(_0xe219('0xe'))(new Redis(config[_0xe219('0xc')]));require(_0xe219('0xf'))[_0xe219('0x10')](socket);function respondWithRpcPromise(_0x365523,_0x33f921,_0x4b245d){return new BPromise(function(_0x2882c4,_0x83b6b7){return client['request'](_0x365523,_0x4b245d)[_0xe219('0x11')](function(_0x1260e7){logger[_0xe219('0x12')](_0xe219('0x13'),_0x33f921,_0xe219('0x14'));logger[_0xe219('0x15')](_0xe219('0x16'),_0x33f921,_0xe219('0x14'),JSON[_0xe219('0x17')](_0x1260e7));if(_0x1260e7['error']){if(_0x1260e7[_0xe219('0x18')][_0xe219('0x19')]===0x1f4){logger[_0xe219('0x18')](_0xe219('0x13'),_0x33f921,_0x1260e7['error'][_0xe219('0x1a')]);return _0x83b6b7(_0x1260e7[_0xe219('0x18')][_0xe219('0x1a')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x33f921,_0x1260e7[_0xe219('0x18')][_0xe219('0x1a')]);return _0x2882c4(_0x1260e7['error'][_0xe219('0x1a')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x33f921,_0xe219('0x14'));_0x2882c4(_0x1260e7[_0xe219('0x1b')][_0xe219('0x1a')]);}})['catch'](function(_0x556e5d){logger[_0xe219('0x18')](_0xe219('0x13'),_0x33f921,_0x556e5d);_0x83b6b7(_0x556e5d);});});} \ No newline at end of file +var _0xba1c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x5ab013,_0x326c2c){var _0x47c194=function(_0x330956){while(--_0x330956){_0x5ab013['push'](_0x5ab013['shift']());}};_0x47c194(++_0x326c2c);}(_0xba1c,0xb4));var _0xcba1=function(_0x375964,_0x28b6d7){_0x375964=_0x375964-0x0;var _0x1ad6e6=_0xba1c[_0x375964];return _0x1ad6e6;};'use strict';var _=require(_0xcba1('0x0'));var util=require(_0xcba1('0x1'));var moment=require('moment');var BPromise=require(_0xcba1('0x2'));var rs=require(_0xcba1('0x3'));var fs=require('fs');var Redis=require(_0xcba1('0x4'));var db=require(_0xcba1('0x5'))['db'];var utils=require(_0xcba1('0x6'));var logger=require(_0xcba1('0x7'))(_0xcba1('0x8'));var config=require(_0xcba1('0x9'));var jayson=require(_0xcba1('0xa'));var client=jayson[_0xcba1('0xb')]['http']({'port':0x232a});config[_0xcba1('0xc')]=_[_0xcba1('0xd')](config[_0xcba1('0xc')],{'host':_0xcba1('0xe'),'port':0x18eb});var socket=require(_0xcba1('0xf'))(new Redis(config['redis']));require(_0xcba1('0x10'))[_0xcba1('0x11')](socket);function respondWithRpcPromise(_0xcb076,_0x3782fd,_0x14300d){return new BPromise(function(_0x4a6d84,_0x1d9ade){return client['request'](_0xcb076,_0x14300d)[_0xcba1('0x12')](function(_0x587663){logger['info']('DashboardItem,\x20%s,\x20%s',_0x3782fd,_0xcba1('0x13'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3782fd,_0xcba1('0x13'),JSON[_0xcba1('0x14')](_0x587663));if(_0x587663[_0xcba1('0x15')]){if(_0x587663['error'][_0xcba1('0x16')]===0x1f4){logger[_0xcba1('0x15')](_0xcba1('0x17'),_0x3782fd,_0x587663[_0xcba1('0x15')][_0xcba1('0x18')]);return _0x1d9ade(_0x587663['error'][_0xcba1('0x18')]);}logger[_0xcba1('0x15')](_0xcba1('0x17'),_0x3782fd,_0x587663[_0xcba1('0x15')]['message']);return _0x4a6d84(_0x587663[_0xcba1('0x15')][_0xcba1('0x18')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x3782fd,_0xcba1('0x13'));_0x4a6d84(_0x587663['result'][_0xcba1('0x18')]);}})[_0xcba1('0x19')](function(_0x344b4f){logger[_0xcba1('0x15')](_0xcba1('0x17'),_0x3782fd,_0x344b4f);_0x1d9ade(_0x344b4f);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7d05606..1491f1c 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 _0x008c=['./dashboardItem.events','save','remove','update','emit','removeListener','register','dashboardItem:'];(function(_0x1a8fa1,_0x1c124b){var _0x467573=function(_0x12e534){while(--_0x12e534){_0x1a8fa1['push'](_0x1a8fa1['shift']());}};_0x467573(++_0x1c124b);}(_0x008c,0x188));var _0xc008=function(_0xc81f5f,_0x181205){_0xc81f5f=_0xc81f5f-0x0;var _0x4410dc=_0x008c[_0xc81f5f];return _0x4410dc;};'use strict';var DashboardItemEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){DashboardItemEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);DashboardItemEvents['on'](_0x428fa9,_0x5aa09b);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x3e74,0x175));var _0x43e7=function(_0x478873,_0x7c1aaa){_0x478873=_0x478873-0x0;var _0x30ef83=_0x3e74[_0x478873];return _0x30ef83;};'use strict';var DashboardItemEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){DashboardItemEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);DashboardItemEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d3ab544..78d5fea 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 _0xa82a=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa82a,0x187));var _0xaa82=function(_0x2d9bcc,_0x318dd3){_0x2d9bcc=_0x2d9bcc-0x0;var _0x48eb43=_0xa82a[_0x2d9bcc];return _0x48eb43;};'use strict';var multer=require(_0xaa82('0x0'));var util=require(_0xaa82('0x1'));var path=require('path');var timeout=require(_0xaa82('0x2'));var express=require(_0xaa82('0x3'));var router=express[_0xaa82('0x4')]();var auth=require(_0xaa82('0x5'));var interaction=require(_0xaa82('0x6'));var config=require(_0xaa82('0x7'));var controller=require(_0xaa82('0x8'));router['get'](_0xaa82('0x9'),auth[_0xaa82('0xa')](),controller[_0xaa82('0xb')]);router['post']('/',auth[_0xaa82('0xa')](),controller['create']);router['put'](_0xaa82('0x9'),auth[_0xaa82('0xa')](),controller[_0xaa82('0xc')]);router[_0xaa82('0xd')](_0xaa82('0x9'),auth['isAuthenticated'](),controller[_0xaa82('0xe')]);module[_0xaa82('0xf')]=router; \ No newline at end of file +var _0x1dff=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x48b6ef,_0x55bc21){var _0x4838cd=function(_0x1c4636){while(--_0x1c4636){_0x48b6ef['push'](_0x48b6ef['shift']());}};_0x4838cd(++_0x55bc21);}(_0x1dff,0x71));var _0xf1df=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x1dff[_0x79cd47];return _0x3b9484;};'use strict';var multer=require(_0xf1df('0x0'));var util=require(_0xf1df('0x1'));var path=require(_0xf1df('0x2'));var timeout=require(_0xf1df('0x3'));var express=require(_0xf1df('0x4'));var router=express[_0xf1df('0x5')]();var auth=require(_0xf1df('0x6'));var interaction=require(_0xf1df('0x7'));var config=require(_0xf1df('0x8'));var controller=require(_0xf1df('0x9'));router[_0xf1df('0xa')](_0xf1df('0xb'),auth[_0xf1df('0xc')](),controller[_0xf1df('0xd')]);router['post']('/',auth[_0xf1df('0xc')](),controller[_0xf1df('0xe')]);router['put'](_0xf1df('0xb'),auth[_0xf1df('0xc')](),controller[_0xf1df('0xf')]);router['delete'](_0xf1df('0xb'),auth[_0xf1df('0xc')](),controller[_0xf1df('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index f4a21f2..69b273f 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 _0x528f=['exports','STRING','sequelize'];(function(_0x21c3ee,_0x4c4b6f){var _0x8657b2=function(_0x284dcf){while(--_0x284dcf){_0x21c3ee['push'](_0x21c3ee['shift']());}};_0x8657b2(++_0x4c4b6f);}(_0x528f,0x131));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf528('0x0'));module[_0xf528('0x1')]={'name':{'type':Sequelize[_0xf528('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xab43=['STRING','sequelize'];(function(_0x3f6969,_0x41acc0){var _0x21d6ba=function(_0x2ab0cc){while(--_0x2ab0cc){_0x3f6969['push'](_0x3f6969['shift']());}};_0x21d6ba(++_0x41acc0);}(_0xab43,0x11d));var _0x3ab4=function(_0x26cfdd,_0x5c9bcd){_0x26cfdd=_0x26cfdd-0x0;var _0x1dd842=_0xab43[_0x26cfdd];return _0x1dd842;};'use strict';var Sequelize=require(_0x3ab4('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ab4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 5bb11d8..a8f3827 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 _0x11e5=['keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','map','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','Disposition','rawAttributes','model'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x11e5,0x117));var _0x511e=function(_0x4cca27,_0x18e06f){_0x4cca27=_0x4cca27-0x0;var _0x3d8219=_0x11e5[_0x4cca27];return _0x3d8219;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x511e('0x0'));var rimraf=require(_0x511e('0x1'));var zipdir=require(_0x511e('0x2'));var jsonpatch=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var moment=require(_0x511e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x511e('0x6'));var util=require(_0x511e('0x7'));var path=require('path');var sox=require(_0x511e('0x8'));var csv=require(_0x511e('0x9'));var ejs=require(_0x511e('0xa'));var fs=require('fs');var _=require(_0x511e('0xb'));var squel=require(_0x511e('0xc'));var crypto=require(_0x511e('0xd'));var jsforce=require(_0x511e('0xe'));var deskjs=require(_0x511e('0xf'));var toCsv=require(_0x511e('0x9'));var querystring=require(_0x511e('0x10'));var Papa=require('papaparse');var Redis=require(_0x511e('0x11'));var authService=require(_0x511e('0x12'));var qs=require(_0x511e('0x13'));var hardwareService=require(_0x511e('0x14'));var logger=require(_0x511e('0x15'))(_0x511e('0x16'));var utils=require('../../config/utils');var config=require(_0x511e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130b40,_0x1ca897){_0x1ca897=_0x1ca897||0xcc;return function(_0x5a8e85){if(_0x5a8e85){return _0x130b40[_0x511e('0x18')](_0x1ca897);}return _0x130b40['status'](_0x1ca897)[_0x511e('0x19')]();};}function respondWithResult(_0x287f68,_0x5a086a){_0x5a086a=_0x5a086a||0xc8;return function(_0x5a1299){if(_0x5a1299){return _0x287f68[_0x511e('0x1a')](_0x5a086a)['json'](_0x5a1299);}};}function respondWithFilteredResult(_0x192872,_0x3120b8){return function(_0x1ddd2a){if(_0x1ddd2a){var _0xbf708=_0x1ddd2a[_0x511e('0x1b')],_0x331bd7=_0x3120b8['offset'],_0x3b4a57=_0x3120b8[_0x511e('0x1c')]+_0x3120b8['limit'],_0x3b8946;if(_0x3b4a57>=_0xbf708){_0x3b4a57=_0xbf708;_0x3b8946=0xc8;}else{_0x3b8946=0xce;}_0x192872[_0x511e('0x1a')](_0x3b8946);return _0x192872[_0x511e('0x1d')](_0x511e('0x1e'),_0x331bd7+'-'+_0x3b4a57+'/'+_0xbf708)[_0x511e('0x1f')](_0x1ddd2a);}return null;};}function patchUpdates(_0x6899b1){return function(_0x22f717){try{jsonpatch['apply'](_0x22f717,_0x6899b1,!![]);}catch(_0x4985c2){return BPromise[_0x511e('0x20')](_0x4985c2);}return _0x22f717[_0x511e('0x21')]();};}function saveUpdates(_0x3f0074,_0x2c4a77){return function(_0x6246d6){if(_0x6246d6){return _0x6246d6[_0x511e('0x22')](_0x3f0074)[_0x511e('0x23')](function(_0x300f28){return _0x300f28;});}return null;};}function removeEntity(_0x3e0586,_0xf18f93){return function(_0x35dc39){if(_0x35dc39){return _0x35dc39[_0x511e('0x24')]()[_0x511e('0x23')](function(){var _0x3cfaf8=_0x35dc39['get']({'plain':!![]});var _0x33183b='Dispositions';return db['UserProfileResource'][_0x511e('0x24')]({'where':{'type':_0x33183b,'resourceId':_0x3cfaf8['id']}})[_0x511e('0x23')](function(){return _0x35dc39;});})[_0x511e('0x23')](function(){_0x3e0586[_0x511e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167225,_0x416643){return function(_0x39e31a){if(!_0x39e31a){_0x167225[_0x511e('0x18')](0x194);}return _0x39e31a;};}function handleError(_0x159fcf,_0x329e5c){_0x329e5c=_0x329e5c||0x1f4;return function(_0x253f35){logger[_0x511e('0x25')](_0x253f35[_0x511e('0x26')]);if(_0x253f35[_0x511e('0x27')]){delete _0x253f35['name'];}_0x159fcf[_0x511e('0x1a')](_0x329e5c)[_0x511e('0x28')](_0x253f35);};}exports[_0x511e('0x29')]=function(_0x5cf8c3,_0x170eed){var _0x186ebd={},_0x18c928={},_0x225970={'count':0x0,'rows':[]};var _0x37d883=db[_0x511e('0x2a')][_0x511e('0x2b')];_0x18c928[_0x511e('0x2c')]=_[_0x511e('0x2d')](_0x37d883);_0x18c928[_0x511e('0x2e')]=_['keys'](_0x5cf8c3[_0x511e('0x2e')]);_0x18c928[_0x511e('0x2f')]=_['intersection'](_0x18c928['model'],_0x18c928[_0x511e('0x2e')]);_0x186ebd[_0x511e('0x30')]=_[_0x511e('0x31')](_0x18c928['model'],qs['fields'](_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x32')]));_0x186ebd[_0x511e('0x30')]=_0x186ebd[_0x511e('0x30')][_0x511e('0x33')]?_0x186ebd[_0x511e('0x30')]:_0x18c928[_0x511e('0x2c')];if(!_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x34')](_0x511e('0x35'))){_0x186ebd[_0x511e('0x36')]=qs[_0x511e('0x36')](_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x36')]);_0x186ebd[_0x511e('0x1c')]=qs[_0x511e('0x1c')](_0x5cf8c3['query']['offset']);}_0x186ebd['order']=qs[_0x511e('0x37')](_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x37')]);_0x186ebd[_0x511e('0x38')]=qs[_0x511e('0x2f')](_[_0x511e('0x39')](_0x5cf8c3[_0x511e('0x2e')],_0x18c928['filters']));if(_0x5cf8c3[_0x511e('0x2e')]['filter']){_0x186ebd[_0x511e('0x38')]=_['merge'](_0x186ebd['where'],{'$or':_[_0x511e('0x3a')](_0x37d883,function(_0x520082){if(_0x520082['type']['key']!==_0x511e('0x3b')){var _0x4cf56b={};_0x4cf56b[_0x520082[_0x511e('0x3c')]]={'$like':'%'+_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x3d')]+'%'};return _0x4cf56b;}})});}_0x186ebd=_['merge']({},_0x186ebd,_0x5cf8c3[_0x511e('0x3e')]);var _0x2bcd57={'where':_0x186ebd[_0x511e('0x38')]};return db[_0x511e('0x2a')][_0x511e('0x1b')](_0x2bcd57)[_0x511e('0x23')](function(_0x3d72ba){_0x225970[_0x511e('0x1b')]=_0x3d72ba;if(_0x5cf8c3[_0x511e('0x2e')][_0x511e('0x3f')]){_0x186ebd[_0x511e('0x40')]=[{'all':!![]}];}return db[_0x511e('0x2a')][_0x511e('0x41')](_0x186ebd);})[_0x511e('0x23')](function(_0x5cd3db){_0x225970[_0x511e('0x42')]=_0x5cd3db;return _0x225970;})[_0x511e('0x23')](respondWithFilteredResult(_0x170eed,_0x186ebd))[_0x511e('0x43')](handleError(_0x170eed,null));};exports[_0x511e('0x44')]=function(_0x4c3ae9,_0x51554a){var _0xa1230f={'raw':!![],'where':{'id':_0x4c3ae9['params']['id']}},_0x273cfb={};_0x273cfb[_0x511e('0x2c')]=_[_0x511e('0x2d')](db[_0x511e('0x2a')]['rawAttributes']);_0x273cfb[_0x511e('0x2e')]=_[_0x511e('0x2d')](_0x4c3ae9[_0x511e('0x2e')]);_0x273cfb[_0x511e('0x2f')]=_[_0x511e('0x31')](_0x273cfb[_0x511e('0x2c')],_0x273cfb['query']);_0xa1230f[_0x511e('0x30')]=_[_0x511e('0x31')](_0x273cfb[_0x511e('0x2c')],qs[_0x511e('0x32')](_0x4c3ae9[_0x511e('0x2e')]['fields']));_0xa1230f[_0x511e('0x30')]=_0xa1230f[_0x511e('0x30')][_0x511e('0x33')]?_0xa1230f['attributes']:_0x273cfb[_0x511e('0x2c')];if(_0x4c3ae9[_0x511e('0x2e')][_0x511e('0x3f')]){_0xa1230f[_0x511e('0x40')]=[{'all':!![]}];}_0xa1230f=_['merge']({},_0xa1230f,_0x4c3ae9[_0x511e('0x3e')]);return db[_0x511e('0x2a')][_0x511e('0x45')](_0xa1230f)[_0x511e('0x23')](handleEntityNotFound(_0x51554a,null))[_0x511e('0x23')](respondWithResult(_0x51554a,null))['catch'](handleError(_0x51554a,null));};exports[_0x511e('0x46')]=function(_0x1f77c6,_0x97d192){return db['Disposition'][_0x511e('0x46')](_0x1f77c6[_0x511e('0x47')],{})['then'](function(_0x48be27){var _0x4d0c43=_0x1f77c6[_0x511e('0x48')][_0x511e('0x49')]({'plain':!![]});if(!_0x4d0c43)throw new Error(_0x511e('0x4a'));if(_0x4d0c43[_0x511e('0x4b')]==='user'){var _0x1461c8=_0x48be27[_0x511e('0x49')]({'plain':!![]});var _0x449c7b='Dispositions';return db[_0x511e('0x4c')][_0x511e('0x45')]({'where':{'name':_0x449c7b,'userProfileId':_0x4d0c43[_0x511e('0x4d')]},'raw':!![]})['then'](function(_0x2a1b07){if(_0x2a1b07&&_0x2a1b07['autoAssociation']===0x0){return db[_0x511e('0x4e')]['create']({'name':_0x1461c8[_0x511e('0x27')],'resourceId':_0x1461c8['id'],'type':_0x2a1b07['name'],'sectionId':_0x2a1b07['id']},{})[_0x511e('0x23')](function(){return _0x48be27;});}else{return _0x48be27;}})[_0x511e('0x43')](function(_0xd6e60){logger[_0x511e('0x25')](_0x511e('0x4f'),_0xd6e60);throw _0xd6e60;});}return _0x48be27;})['then'](respondWithResult(_0x97d192,0xc9))[_0x511e('0x43')](handleError(_0x97d192,null));};exports[_0x511e('0x22')]=function(_0x4e4421,_0x17ed07){if(_0x4e4421[_0x511e('0x47')]['id']){delete _0x4e4421[_0x511e('0x47')]['id'];}return db[_0x511e('0x2a')]['find']({'where':{'id':_0x4e4421[_0x511e('0x50')]['id']}})[_0x511e('0x23')](handleEntityNotFound(_0x17ed07,null))[_0x511e('0x23')](saveUpdates(_0x4e4421[_0x511e('0x47')],null))['then'](respondWithResult(_0x17ed07,null))['catch'](handleError(_0x17ed07,null));};exports['destroy']=function(_0x1495f9,_0x335f6e){return db[_0x511e('0x2a')][_0x511e('0x45')]({'where':{'id':_0x1495f9[_0x511e('0x50')]['id']}})[_0x511e('0x23')](handleEntityNotFound(_0x335f6e,null))[_0x511e('0x23')](removeEntity(_0x335f6e,null))[_0x511e('0x43')](handleError(_0x335f6e,null));}; \ No newline at end of file +var _0xdff6=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','json','update','then','destroy','get','Dispositions','UserProfileResource','end','error','send','index','Disposition','rawAttributes','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4dfc2c,_0x14aee4){var _0x463fdb=function(_0x9d87ef){while(--_0x9d87ef){_0x4dfc2c['push'](_0x4dfc2c['shift']());}};_0x463fdb(++_0x14aee4);}(_0xdff6,0xe0));var _0x6dff=function(_0x586991,_0xa8908f){_0x586991=_0x586991-0x0;var _0x13484f=_0xdff6[_0x586991];return _0x13484f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6dff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dff('0x1'));var rp=require('request-promise');var moment=require(_0x6dff('0x2'));var BPromise=require(_0x6dff('0x3'));var Mustache=require(_0x6dff('0x4'));var util=require(_0x6dff('0x5'));var path=require(_0x6dff('0x6'));var sox=require(_0x6dff('0x7'));var csv=require(_0x6dff('0x8'));var ejs=require(_0x6dff('0x9'));var fs=require('fs');var _=require(_0x6dff('0xa'));var squel=require(_0x6dff('0xb'));var crypto=require(_0x6dff('0xc'));var jsforce=require(_0x6dff('0xd'));var deskjs=require(_0x6dff('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6dff('0xf'));var Papa=require(_0x6dff('0x10'));var Redis=require(_0x6dff('0x11'));var authService=require(_0x6dff('0x12'));var qs=require(_0x6dff('0x13'));var hardwareService=require(_0x6dff('0x14'));var logger=require(_0x6dff('0x15'))(_0x6dff('0x16'));var utils=require(_0x6dff('0x17'));var config=require('../../config/environment');var db=require(_0x6dff('0x18'))['db'];function respondWithStatusCode(_0x28c63d,_0x5e3cbe){_0x5e3cbe=_0x5e3cbe||0xcc;return function(_0xff7766){if(_0xff7766){return _0x28c63d[_0x6dff('0x19')](_0x5e3cbe);}return _0x28c63d[_0x6dff('0x1a')](_0x5e3cbe)['end']();};}function respondWithResult(_0x38f939,_0x25eca3){_0x25eca3=_0x25eca3||0xc8;return function(_0x2cdba2){if(_0x2cdba2){return _0x38f939['status'](_0x25eca3)['json'](_0x2cdba2);}};}function respondWithFilteredResult(_0x4f5823,_0x5db4d5){return function(_0x9e0b06){if(_0x9e0b06){var _0x559480=_0x9e0b06[_0x6dff('0x1b')],_0x53a470=_0x5db4d5['offset'],_0x4f4f0a=_0x5db4d5[_0x6dff('0x1c')]+_0x5db4d5[_0x6dff('0x1d')],_0x20c6f8;if(_0x4f4f0a>=_0x559480){_0x4f4f0a=_0x559480;_0x20c6f8=0xc8;}else{_0x20c6f8=0xce;}_0x4f5823[_0x6dff('0x1a')](_0x20c6f8);return _0x4f5823['set']('Content-Range',_0x53a470+'-'+_0x4f4f0a+'/'+_0x559480)[_0x6dff('0x1e')](_0x9e0b06);}return null;};}function patchUpdates(_0x2024c4){return function(_0x5c4b3e){try{jsonpatch['apply'](_0x5c4b3e,_0x2024c4,!![]);}catch(_0x2ef772){return BPromise['reject'](_0x2ef772);}return _0x5c4b3e['save']();};}function saveUpdates(_0x5a7277,_0x550bc5){return function(_0x48591e){if(_0x48591e){return _0x48591e[_0x6dff('0x1f')](_0x5a7277)[_0x6dff('0x20')](function(_0x1539d5){return _0x1539d5;});}return null;};}function removeEntity(_0x3a49c1,_0x177dfb){return function(_0x371fb4){if(_0x371fb4){return _0x371fb4[_0x6dff('0x21')]()[_0x6dff('0x20')](function(){var _0x62475e=_0x371fb4[_0x6dff('0x22')]({'plain':!![]});var _0x351b8c=_0x6dff('0x23');return db[_0x6dff('0x24')][_0x6dff('0x21')]({'where':{'type':_0x351b8c,'resourceId':_0x62475e['id']}})[_0x6dff('0x20')](function(){return _0x371fb4;});})[_0x6dff('0x20')](function(){_0x3a49c1[_0x6dff('0x1a')](0xcc)[_0x6dff('0x25')]();});}};}function handleEntityNotFound(_0x588bdd,_0x3acd17){return function(_0xa21798){if(!_0xa21798){_0x588bdd['sendStatus'](0x194);}return _0xa21798;};}function handleError(_0x1f885c,_0x57b6fe){_0x57b6fe=_0x57b6fe||0x1f4;return function(_0xb0ce4d){logger[_0x6dff('0x26')](_0xb0ce4d['stack']);if(_0xb0ce4d['name']){delete _0xb0ce4d['name'];}_0x1f885c[_0x6dff('0x1a')](_0x57b6fe)[_0x6dff('0x27')](_0xb0ce4d);};}exports[_0x6dff('0x28')]=function(_0x2b33bb,_0x5af083){var _0x157154={},_0x54914a={},_0x21f9e9={'count':0x0,'rows':[]};var _0xa570b1=db[_0x6dff('0x29')][_0x6dff('0x2a')];_0x54914a[_0x6dff('0x2b')]=_[_0x6dff('0x2c')](_0xa570b1);_0x54914a['query']=_[_0x6dff('0x2c')](_0x2b33bb['query']);_0x54914a[_0x6dff('0x2d')]=_[_0x6dff('0x2e')](_0x54914a[_0x6dff('0x2b')],_0x54914a[_0x6dff('0x2f')]);_0x157154[_0x6dff('0x30')]=_[_0x6dff('0x2e')](_0x54914a[_0x6dff('0x2b')],qs[_0x6dff('0x31')](_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x31')]));_0x157154[_0x6dff('0x30')]=_0x157154[_0x6dff('0x30')]['length']?_0x157154[_0x6dff('0x30')]:_0x54914a[_0x6dff('0x2b')];if(!_0x2b33bb['query']['hasOwnProperty'](_0x6dff('0x32'))){_0x157154['limit']=qs[_0x6dff('0x1d')](_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x1d')]);_0x157154['offset']=qs[_0x6dff('0x1c')](_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x1c')]);}_0x157154[_0x6dff('0x33')]=qs[_0x6dff('0x34')](_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x34')]);_0x157154[_0x6dff('0x35')]=qs[_0x6dff('0x2d')](_[_0x6dff('0x36')](_0x2b33bb[_0x6dff('0x2f')],_0x54914a[_0x6dff('0x2d')]));if(_0x2b33bb['query'][_0x6dff('0x37')]){_0x157154['where']=_[_0x6dff('0x38')](_0x157154[_0x6dff('0x35')],{'$or':_['map'](_0xa570b1,function(_0x37b299){if(_0x37b299[_0x6dff('0x39')][_0x6dff('0x3a')]!==_0x6dff('0x3b')){var _0x5a29cc={};_0x5a29cc[_0x37b299[_0x6dff('0x3c')]]={'$like':'%'+_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x37')]+'%'};return _0x5a29cc;}})});}_0x157154=_[_0x6dff('0x38')]({},_0x157154,_0x2b33bb[_0x6dff('0x3d')]);var _0x29ff33={'where':_0x157154['where']};return db[_0x6dff('0x29')][_0x6dff('0x1b')](_0x29ff33)[_0x6dff('0x20')](function(_0xd6f895){_0x21f9e9[_0x6dff('0x1b')]=_0xd6f895;if(_0x2b33bb[_0x6dff('0x2f')][_0x6dff('0x3e')]){_0x157154['include']=[{'all':!![]}];}return db[_0x6dff('0x29')][_0x6dff('0x3f')](_0x157154);})[_0x6dff('0x20')](function(_0x59f3a5){_0x21f9e9[_0x6dff('0x40')]=_0x59f3a5;return _0x21f9e9;})[_0x6dff('0x20')](respondWithFilteredResult(_0x5af083,_0x157154))[_0x6dff('0x41')](handleError(_0x5af083,null));};exports[_0x6dff('0x42')]=function(_0xa466a3,_0x420087){var _0x53a858={'raw':!![],'where':{'id':_0xa466a3['params']['id']}},_0xc65251={};_0xc65251[_0x6dff('0x2b')]=_[_0x6dff('0x2c')](db[_0x6dff('0x29')][_0x6dff('0x2a')]);_0xc65251['query']=_[_0x6dff('0x2c')](_0xa466a3['query']);_0xc65251[_0x6dff('0x2d')]=_[_0x6dff('0x2e')](_0xc65251[_0x6dff('0x2b')],_0xc65251[_0x6dff('0x2f')]);_0x53a858[_0x6dff('0x30')]=_[_0x6dff('0x2e')](_0xc65251['model'],qs['fields'](_0xa466a3[_0x6dff('0x2f')][_0x6dff('0x31')]));_0x53a858[_0x6dff('0x30')]=_0x53a858[_0x6dff('0x30')][_0x6dff('0x43')]?_0x53a858[_0x6dff('0x30')]:_0xc65251[_0x6dff('0x2b')];if(_0xa466a3[_0x6dff('0x2f')]['includeAll']){_0x53a858[_0x6dff('0x44')]=[{'all':!![]}];}_0x53a858=_[_0x6dff('0x38')]({},_0x53a858,_0xa466a3[_0x6dff('0x3d')]);return db[_0x6dff('0x29')][_0x6dff('0x45')](_0x53a858)[_0x6dff('0x20')](handleEntityNotFound(_0x420087,null))[_0x6dff('0x20')](respondWithResult(_0x420087,null))['catch'](handleError(_0x420087,null));};exports[_0x6dff('0x46')]=function(_0x44c428,_0xdda709){return db[_0x6dff('0x29')]['create'](_0x44c428[_0x6dff('0x47')],{})[_0x6dff('0x20')](function(_0x3cff4e){var _0x13df19=_0x44c428[_0x6dff('0x48')]['get']({'plain':!![]});if(!_0x13df19)throw new Error(_0x6dff('0x49'));if(_0x13df19[_0x6dff('0x4a')]===_0x6dff('0x48')){var _0xd9c981=_0x3cff4e['get']({'plain':!![]});var _0x10fdeb=_0x6dff('0x23');return db[_0x6dff('0x4b')]['find']({'where':{'name':_0x10fdeb,'userProfileId':_0x13df19[_0x6dff('0x4c')]},'raw':!![]})[_0x6dff('0x20')](function(_0x5b5f9a){if(_0x5b5f9a&&_0x5b5f9a['autoAssociation']===0x0){return db[_0x6dff('0x24')][_0x6dff('0x46')]({'name':_0xd9c981[_0x6dff('0x4d')],'resourceId':_0xd9c981['id'],'type':_0x5b5f9a['name'],'sectionId':_0x5b5f9a['id']},{})[_0x6dff('0x20')](function(){return _0x3cff4e;});}else{return _0x3cff4e;}})['catch'](function(_0x17a51f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17a51f);throw _0x17a51f;});}return _0x3cff4e;})[_0x6dff('0x20')](respondWithResult(_0xdda709,0xc9))[_0x6dff('0x41')](handleError(_0xdda709,null));};exports[_0x6dff('0x1f')]=function(_0x23db42,_0x505532){if(_0x23db42[_0x6dff('0x47')]['id']){delete _0x23db42[_0x6dff('0x47')]['id'];}return db['Disposition'][_0x6dff('0x45')]({'where':{'id':_0x23db42[_0x6dff('0x4e')]['id']}})[_0x6dff('0x20')](handleEntityNotFound(_0x505532,null))[_0x6dff('0x20')](saveUpdates(_0x23db42[_0x6dff('0x47')],null))[_0x6dff('0x20')](respondWithResult(_0x505532,null))['catch'](handleError(_0x505532,null));};exports[_0x6dff('0x21')]=function(_0x28555c,_0x197a14){return db['Disposition'][_0x6dff('0x45')]({'where':{'id':_0x28555c[_0x6dff('0x4e')]['id']}})[_0x6dff('0x20')](handleEntityNotFound(_0x197a14,null))[_0x6dff('0x20')](removeEntity(_0x197a14,null))[_0x6dff('0x41')](handleError(_0x197a14,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1c96ae1..3908fa3 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 _0x0d1d=['ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name'];(function(_0x5e0c97,_0x407d7d){var _0x1ebe95=function(_0x2210a1){while(--_0x2210a1){_0x5e0c97['push'](_0x5e0c97['shift']());}};_0x1ebe95(++_0x407d7d);}(_0x0d1d,0x15a));var _0xd0d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0d1('0x0'));var util=require(_0xd0d1('0x1'));var logger=require('../../config/logger')(_0xd0d1('0x2'));var moment=require(_0xd0d1('0x3'));var BPromise=require(_0xd0d1('0x4'));var rp=require(_0xd0d1('0x5'));var fs=require('fs');var path=require(_0xd0d1('0x6'));var rimraf=require('rimraf');var config=require(_0xd0d1('0x7'));var attributes=require(_0xd0d1('0x8'));module[_0xd0d1('0x9')]=function(_0x103112,_0x317c14){return _0x103112[_0xd0d1('0xa')](_0xd0d1('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xd0d1('0xc'),'fields':[_0xd0d1('0xd'),_0xd0d1('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0xd0d1('0xd'),_0xd0d1('0xf')]},{'unique':!![],'name':_0xd0d1('0x10'),'fields':[_0xd0d1('0xd'),_0xd0d1('0x11')]},{'unique':!![],'name':_0xd0d1('0x12'),'fields':[_0xd0d1('0xd'),_0xd0d1('0x13')]},{'unique':!![],'name':_0xd0d1('0x14'),'fields':[_0xd0d1('0xd'),_0xd0d1('0x15')]},{'unique':!![],'name':_0xd0d1('0x16'),'fields':[_0xd0d1('0xd'),_0xd0d1('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x61ee=['name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','define','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_mail'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x61ee,0x12b));var _0xe61e=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x61ee[_0x2a558d];return _0xa7bc9c;};'use strict';var _=require('lodash');var util=require(_0xe61e('0x0'));var logger=require(_0xe61e('0x1'))(_0xe61e('0x2'));var moment=require(_0xe61e('0x3'));var BPromise=require(_0xe61e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe61e('0x5'));var rimraf=require(_0xe61e('0x6'));var config=require(_0xe61e('0x7'));var attributes=require(_0xe61e('0x8'));module['exports']=function(_0x3c60e5,_0x24c300){return _0x3c60e5[_0xe61e('0x9')]('Disposition',attributes,{'tableName':_0xe61e('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe61e('0xb'),'fields':[_0xe61e('0xc'),'ListId']},{'unique':!![],'name':_0xe61e('0xd'),'fields':['name',_0xe61e('0xe')]},{'unique':!![],'name':_0xe61e('0xf'),'fields':[_0xe61e('0xc'),'MailAccountId']},{'unique':!![],'name':_0xe61e('0x10'),'fields':[_0xe61e('0xc'),_0xe61e('0x11')]},{'unique':!![],'name':_0xe61e('0x12'),'fields':[_0xe61e('0xc'),_0xe61e('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0xe61e('0xc'),_0xe61e('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 37ca7d1..8b4ed93 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 _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5577,0x1b4));var _0x7557=function(_0x46cb7e,_0x4818ad){_0x46cb7e=_0x46cb7e-0x0;var _0x47cfe7=_0x5577[_0x46cb7e];return _0x47cfe7;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('Disposition,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('Disposition,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file +var _0x723e=['Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0xa0e317,_0xf5c888){var _0x4e6c74=function(_0x3eed4d){while(--_0x3eed4d){_0xa0e317['push'](_0xa0e317['shift']());}};_0x4e6c74(++_0xf5c888);}(_0x723e,0x179));var _0xe723=function(_0x5c967a,_0x254ae5){_0x5c967a=_0x5c967a-0x0;var _0x412b4a=_0x723e[_0x5c967a];return _0x412b4a;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1335cd,_0x3bf082,_0x2aebbd){return new BPromise(function(_0xe50f7,_0x1b46e0){return client[_0xe723('0xc')](_0x1335cd,_0x2aebbd)['then'](function(_0x380444){logger[_0xe723('0xd')](_0xe723('0xe'),_0x3bf082,'request\x20sent');logger[_0xe723('0xf')](_0xe723('0x10'),_0x3bf082,_0xe723('0x11'),JSON['stringify'](_0x380444));if(_0x380444[_0xe723('0x12')]){if(_0x380444[_0xe723('0x12')][_0xe723('0x13')]===0x1f4){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x380444['error'][_0xe723('0x14')]);return _0x1b46e0(_0x380444['error']['message']);}logger['error']('Disposition,\x20%s,\x20%s',_0x3bf082,_0x380444[_0xe723('0x12')][_0xe723('0x14')]);return _0xe50f7(_0x380444[_0xe723('0x12')][_0xe723('0x14')]);}else{logger[_0xe723('0xd')]('Disposition,\x20%s,\x20%s',_0x3bf082,_0xe723('0x11'));_0xe50f7(_0x380444[_0xe723('0x15')][_0xe723('0x14')]);}})[_0xe723('0x16')](function(_0x347fa0){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x347fa0);_0x1b46e0(_0x347fa0);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index df791fd..8aef61c 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 _0x98b0=['isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x76fe56,_0x5b5954){var _0x6174e7=function(_0x4caaec){while(--_0x4caaec){_0x76fe56['push'](_0x76fe56['shift']());}};_0x6174e7(++_0x5b5954);}(_0x98b0,0x126));var _0x098b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x98b0[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x098b('0x0'));var util=require(_0x098b('0x1'));var path=require(_0x098b('0x2'));var timeout=require(_0x098b('0x3'));var express=require(_0x098b('0x4'));var router=express[_0x098b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x098b('0x6'));var config=require(_0x098b('0x7'));var controller=require(_0x098b('0x8'));router[_0x098b('0x9')]('/',auth[_0x098b('0xa')](),controller[_0x098b('0xb')]);router[_0x098b('0x9')](_0x098b('0xc'),auth[_0x098b('0xa')](),controller[_0x098b('0xd')]);router[_0x098b('0xe')]('/',auth[_0x098b('0xa')](),controller[_0x098b('0xf')]);router['put'](_0x098b('0xc'),auth[_0x098b('0xa')](),controller['update']);router[_0x098b('0x10')](_0x098b('0xc'),auth[_0x098b('0xa')](),controller[_0x098b('0x11')]);module[_0x098b('0x12')]=router; \ No newline at end of file +var _0x4deb=['post','create','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4deb,0x154));var _0xb4de=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x4deb[_0x277fa3];return _0x2e4520;};'use strict';var multer=require('multer');var util=require(_0xb4de('0x0'));var path=require(_0xb4de('0x1'));var timeout=require(_0xb4de('0x2'));var express=require('express');var router=express[_0xb4de('0x3')]();var auth=require(_0xb4de('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb4de('0x5'));var controller=require(_0xb4de('0x6'));router[_0xb4de('0x7')]('/',auth[_0xb4de('0x8')](),controller[_0xb4de('0x9')]);router[_0xb4de('0x7')](_0xb4de('0xa'),auth[_0xb4de('0x8')](),controller[_0xb4de('0xb')]);router[_0xb4de('0xc')]('/',auth[_0xb4de('0x8')](),controller[_0xb4de('0xd')]);router['put']('/:id',auth[_0xb4de('0x8')](),controller['update']);router[_0xb4de('0xe')](_0xb4de('0xa'),auth[_0xb4de('0x8')](),controller['destroy']);module[_0xb4de('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a1976f5..23e95ef 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 _0x26ab=['SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','14400','2400','4800','v17,v27,v29','INTEGER'];(function(_0x56b13c,_0xea4749){var _0x39798c=function(_0x53acda){while(--_0x53acda){_0x56b13c['push'](_0x56b13c['shift']());}};_0x39798c(++_0xea4749);}(_0x26ab,0x19c));var _0xb26a=function(_0x2e7cd1,_0x55737b){_0x2e7cd1=_0x2e7cd1-0x0;var _0x2866f2=_0x26ab[_0x2e7cd1];return _0x2866f2;};'use strict';var Sequelize=require('sequelize');module[_0xb26a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb26a('0x1')]},'ecm':{'type':Sequelize[_0xb26a('0x2')](_0xb26a('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xb26a('0x1')],'defaultValue':_0xb26a('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xb26a('0x2')]('2400','4800',_0xb26a('0x5'),_0xb26a('0x6'),_0xb26a('0x7'),_0xb26a('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb26a('0x2')](_0xb26a('0x9'),_0xb26a('0xa'),_0xb26a('0x5'),'9600','12000',_0xb26a('0x8')),'defaultValue':_0xb26a('0x8')},'modem':{'type':Sequelize[_0xb26a('0x1')],'defaultValue':_0xb26a('0xb')},'gateway':{'type':Sequelize[_0xb26a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb26a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb26a('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xb26a('0xd'),_0xb26a('0xe'),_0xb26a('0xf'),_0xb26a('0x10')),'defaultValue':_0xb26a('0xd')},'key':{'type':Sequelize[_0xb26a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb26a('0x11')],'defaultValue':function(){return _0xb26a('0x12');}},'notificationSound':{'type':Sequelize[_0xb26a('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb26a('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb26a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb26a('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb26a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb26a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb26a('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xb26a('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xb26a('0x13')],'defaultValue':![],'comment':_0xb26a('0x15'),'set':function(_0x32a78d){if(!_0x32a78d)this[_0xb26a('0x16')](_0xb26a('0x17'),null);this[_0xb26a('0x16')](_0xb26a('0x18'),_0x32a78d);}}}; \ No newline at end of file +var _0x567d=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400'];(function(_0x2a64cc,_0x5a786a){var _0x5dbf19=function(_0xb5accd){while(--_0xb5accd){_0x2a64cc['push'](_0x2a64cc['shift']());}};_0x5dbf19(++_0x5a786a);}(_0x567d,0x9b));var _0xd567=function(_0x13bb44,_0x3535c0){_0x13bb44=_0x13bb44-0x0;var _0x3708df=_0x567d[_0x13bb44];return _0x3708df;};'use strict';var Sequelize=require(_0xd567('0x0'));module[_0xd567('0x1')]={'name':{'type':Sequelize[_0xd567('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd567('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd567('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xd567('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xd567('0x5')},'minrate':{'type':Sequelize[_0xd567('0x6')](_0xd567('0x7'),_0xd567('0x8'),_0xd567('0x9'),_0xd567('0xa'),_0xd567('0xb'),_0xd567('0xc')),'defaultValue':_0xd567('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0xd567('0x7'),_0xd567('0x8'),_0xd567('0x9'),'9600',_0xd567('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xd567('0x2')],'defaultValue':_0xd567('0xd')},'gateway':{'type':Sequelize[_0xd567('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd567('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd567('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xd567('0xf'),_0xd567('0x10'),_0xd567('0x11'),_0xd567('0x12')),'defaultValue':_0xd567('0xf')},'key':{'type':Sequelize[_0xd567('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd567('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd567('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd567('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd567('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd567('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd567('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd567('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd567('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd567('0x14')],'defaultValue':![],'comment':_0xd567('0x15'),'set':function(_0x417810){if(!_0x417810)this[_0xd567('0x16')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xd567('0x17'),_0x417810);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7c8cad6..4e4a7e9 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 _0x26f4=['addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./faxAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','key','VIRTUAL','options','where','includeAll','include','FaxAccount','findAll','rows','params','Pause','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','map','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','system','description','Fax\x20Extension','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','push','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x26f4,0xca));var _0x426f=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0x26f4[_0x2c3a47];return _0x1c04de;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x426f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x426f('0x1'));var rp=require(_0x426f('0x2'));var moment=require(_0x426f('0x3'));var BPromise=require(_0x426f('0x4'));var Mustache=require(_0x426f('0x5'));var util=require('util');var path=require(_0x426f('0x6'));var sox=require(_0x426f('0x7'));var csv=require(_0x426f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x426f('0x9'));var squel=require('squel');var crypto=require(_0x426f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x426f('0xb'));var toCsv=require(_0x426f('0x8'));var querystring=require(_0x426f('0xc'));var Papa=require(_0x426f('0xd'));var Redis=require(_0x426f('0xe'));var authService=require(_0x426f('0xf'));var qs=require(_0x426f('0x10'));var hardwareService=require(_0x426f('0x11'));var logger=require('../../config/logger')(_0x426f('0x12'));var utils=require(_0x426f('0x13'));var config=require(_0x426f('0x14'));var db=require(_0x426f('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x426f('0x16'))(new Redis(config[_0x426f('0x17')]));require(_0x426f('0x18'))[_0x426f('0x19')](socket);var jayson=require(_0x426f('0x1a'));var client=jayson[_0x426f('0x1b')][_0x426f('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x426f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x19bdcc,_0x4a41fe,_0x206060){if(_0x206060){var _0x40c7eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c7eb[_0x426f('0x1d')](_0x4a41fe)){return _0x19bdcc;}else{throw new Error(_0x426f('0x1e'));}}else{return _0x19bdcc;}}function respondWithRpcPromise(_0x396e2b,_0x2110ad,_0x2b1dbe,_0x4b542c){return new BPromise(function(_0x23f032,_0xa9cb79){var _0x15960f=_0x4b542c||client;return _0x15960f[_0x426f('0x1f')](_0x396e2b,_0x2b1dbe)['then'](function(_0xbaaafb){logger[_0x426f('0x20')](_0x426f('0x21'),_0x2110ad,_0x426f('0x22'));logger['debug'](_0x426f('0x23'),_0x2110ad,_0x426f('0x22'),JSON['stringify'](_0xbaaafb));if(_0xbaaafb[_0x426f('0x24')]){if(_0xbaaafb[_0x426f('0x24')][_0x426f('0x25')]===0x1f4){logger[_0x426f('0x24')]('FaxAccount,\x20%s,\x20%s',_0x2110ad,_0xbaaafb[_0x426f('0x24')][_0x426f('0x26')]);return _0xa9cb79(_0xbaaafb['error'][_0x426f('0x26')]);}logger[_0x426f('0x24')](_0x426f('0x21'),_0x2110ad,_0xbaaafb[_0x426f('0x24')]['message']);return _0x23f032(_0xbaaafb['error'][_0x426f('0x26')]);}else{logger[_0x426f('0x20')](_0x426f('0x21'),_0x2110ad,_0x426f('0x22'));_0x23f032(_0xbaaafb[_0x426f('0x27')][_0x426f('0x26')]);}})[_0x426f('0x28')](function(_0x24a9fd){logger[_0x426f('0x24')](_0x426f('0x21'),_0x2110ad,_0x24a9fd);_0xa9cb79(_0x24a9fd);});});}function respondWithStatusCode(_0x557394,_0xa15f67){_0xa15f67=_0xa15f67||0xcc;return function(_0x272d89){if(_0x272d89){return _0x557394['sendStatus'](_0xa15f67);}return _0x557394[_0x426f('0x29')](_0xa15f67)[_0x426f('0x2a')]();};}function respondWithResult(_0x2c6501,_0x3ae5c2){_0x3ae5c2=_0x3ae5c2||0xc8;return function(_0xc73005){if(_0xc73005){return _0x2c6501['status'](_0x3ae5c2)[_0x426f('0x2b')](_0xc73005);}};}function respondWithFilteredResult(_0x341e0f,_0x1497f9){return function(_0x4e6f38){if(_0x4e6f38){var _0x2c6da2=_0x4e6f38[_0x426f('0x2c')],_0x9956a=_0x1497f9[_0x426f('0x2d')],_0x41bbb8=_0x1497f9[_0x426f('0x2d')]+_0x1497f9[_0x426f('0x2e')],_0x52b17f;if(_0x41bbb8>=_0x2c6da2){_0x41bbb8=_0x2c6da2;_0x52b17f=0xc8;}else{_0x52b17f=0xce;}_0x341e0f[_0x426f('0x29')](_0x52b17f);return _0x341e0f[_0x426f('0x2f')](_0x426f('0x30'),_0x9956a+'-'+_0x41bbb8+'/'+_0x2c6da2)[_0x426f('0x2b')](_0x4e6f38);}return null;};}function patchUpdates(_0x119192){return function(_0x538f96){try{jsonpatch[_0x426f('0x31')](_0x538f96,_0x119192,!![]);}catch(_0x4100c3){return BPromise['reject'](_0x4100c3);}return _0x538f96[_0x426f('0x32')]();};}function saveUpdates(_0x4b8166,_0x2c71a5){return function(_0xc70e7b){if(_0xc70e7b){return _0xc70e7b[_0x426f('0x33')](_0x4b8166)[_0x426f('0x34')](function(_0x2a1149){return _0x2a1149;});}return null;};}function removeEntity(_0x36099a,_0x3cbde8){return function(_0x2551f2){if(_0x2551f2){return _0x2551f2[_0x426f('0x35')]()[_0x426f('0x34')](function(){var _0x59ac74=_0x2551f2[_0x426f('0x36')]({'plain':!![]});var _0x5514c1=_0x426f('0x37');return db[_0x426f('0x38')][_0x426f('0x35')]({'where':{'type':_0x5514c1,'resourceId':_0x59ac74['id']}})[_0x426f('0x34')](function(){return _0x2551f2;});})['then'](function(){_0x36099a[_0x426f('0x29')](0xcc)[_0x426f('0x2a')]();});}};}function handleEntityNotFound(_0x9b8c97,_0x531bf2){return function(_0x46e1b0){if(!_0x46e1b0){_0x9b8c97[_0x426f('0x39')](0x194);}return _0x46e1b0;};}function handleError(_0x377351,_0x54ad07){_0x54ad07=_0x54ad07||0x1f4;return function(_0x3192d7){logger[_0x426f('0x24')](_0x3192d7[_0x426f('0x3a')]);if(_0x3192d7[_0x426f('0x3b')]){delete _0x3192d7[_0x426f('0x3b')];}_0x377351[_0x426f('0x29')](_0x54ad07)[_0x426f('0x3c')](_0x3192d7);};}exports['index']=function(_0x5b0521,_0x29494a){var _0x2bc10a={'include':[{'model':db['Pause'],'as':_0x426f('0x3d')}]},_0x5e40a5={},_0x49b762={'count':0x0,'rows':[]};var _0x4310ea=db['FaxAccount'][_0x426f('0x3e')];_0x5e40a5[_0x426f('0x3f')]=_[_0x426f('0x40')](_0x4310ea);_0x5e40a5['query']=_['keys'](_0x5b0521[_0x426f('0x41')]);_0x5e40a5[_0x426f('0x42')]=_[_0x426f('0x43')](_0x5e40a5[_0x426f('0x3f')],_0x5e40a5[_0x426f('0x41')]);_0x2bc10a[_0x426f('0x44')]=_[_0x426f('0x43')](_0x5e40a5[_0x426f('0x3f')],qs['fields'](_0x5b0521[_0x426f('0x41')][_0x426f('0x45')]));_0x2bc10a['attributes']=_0x2bc10a['attributes'][_0x426f('0x46')]?_0x2bc10a[_0x426f('0x44')]:_0x5e40a5[_0x426f('0x3f')];if(!_0x5b0521[_0x426f('0x41')][_0x426f('0x47')](_0x426f('0x48'))){_0x2bc10a[_0x426f('0x2e')]=qs[_0x426f('0x2e')](_0x5b0521[_0x426f('0x41')][_0x426f('0x2e')]);_0x2bc10a[_0x426f('0x2d')]=qs['offset'](_0x5b0521['query'][_0x426f('0x2d')]);}_0x2bc10a[_0x426f('0x49')]=qs[_0x426f('0x4a')](_0x5b0521[_0x426f('0x41')][_0x426f('0x4a')]);_0x2bc10a['where']=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x5b0521[_0x426f('0x41')],_0x5e40a5['filters']));if(_0x5b0521[_0x426f('0x41')][_0x426f('0x4c')]){_0x2bc10a['where']=_[_0x426f('0x4d')](_0x2bc10a['where'],{'$or':_['map'](_0x4310ea,function(_0x3eaddc){if(_0x3eaddc[_0x426f('0x4e')][_0x426f('0x4f')]!==_0x426f('0x50')){var _0x4ba195={};_0x4ba195[_0x3eaddc['field']]={'$like':'%'+_0x5b0521[_0x426f('0x41')]['filter']+'%'};return _0x4ba195;}})});}_0x2bc10a=_[_0x426f('0x4d')]({},_0x2bc10a,_0x5b0521[_0x426f('0x51')]);var _0x1f530d={'where':_0x2bc10a[_0x426f('0x52')]};return db['FaxAccount'][_0x426f('0x2c')](_0x1f530d)[_0x426f('0x34')](function(_0x3b725c){_0x49b762['count']=_0x3b725c;if(_0x5b0521[_0x426f('0x41')][_0x426f('0x53')]){_0x2bc10a[_0x426f('0x54')]=[{'all':!![]}];}return db[_0x426f('0x55')][_0x426f('0x56')](_0x2bc10a);})[_0x426f('0x34')](function(_0x43d1da){_0x49b762[_0x426f('0x57')]=_0x43d1da;return _0x49b762;})['then'](respondWithFilteredResult(_0x29494a,_0x2bc10a))[_0x426f('0x28')](handleError(_0x29494a,null));};exports['show']=function(_0x422399,_0xb90e8){var _0x34ec55={'raw':![],'where':{'id':_0x422399[_0x426f('0x58')]['id']},'include':[{'model':db[_0x426f('0x59')],'as':_0x426f('0x3d')}]},_0x592789={};_0x592789[_0x426f('0x3f')]=_['keys'](db[_0x426f('0x55')]['rawAttributes']);_0x592789[_0x426f('0x41')]=_['keys'](_0x422399[_0x426f('0x41')]);_0x592789[_0x426f('0x42')]=_['intersection'](_0x592789[_0x426f('0x3f')],_0x592789[_0x426f('0x41')]);_0x34ec55[_0x426f('0x44')]=_[_0x426f('0x43')](_0x592789[_0x426f('0x3f')],qs[_0x426f('0x45')](_0x422399['query'][_0x426f('0x45')]));_0x34ec55[_0x426f('0x44')]=_0x34ec55['attributes'][_0x426f('0x46')]?_0x34ec55[_0x426f('0x44')]:_0x592789[_0x426f('0x3f')];if(_0x422399[_0x426f('0x41')][_0x426f('0x53')]){_0x34ec55['include']=[{'all':!![]}];}_0x34ec55=_['merge']({},_0x34ec55,_0x422399[_0x426f('0x51')]);return db[_0x426f('0x55')][_0x426f('0x5a')](_0x34ec55)[_0x426f('0x34')](handleEntityNotFound(_0xb90e8,null))[_0x426f('0x34')](respondWithResult(_0xb90e8,null))['catch'](handleError(_0xb90e8,null));};exports[_0x426f('0x5b')]=function(_0x25ae10,_0x2ab94a){return db[_0x426f('0x55')][_0x426f('0x5b')](_0x25ae10['body'],{})[_0x426f('0x34')](function(_0xe26f41){var _0x3287a0=_0x25ae10[_0x426f('0x5c')][_0x426f('0x36')]({'plain':!![]});if(!_0x3287a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3287a0[_0x426f('0x5d')]===_0x426f('0x5c')){var _0x102bd1=_0xe26f41[_0x426f('0x36')]({'plain':!![]});var _0x3dad2d=_0x426f('0x37');return db[_0x426f('0x5e')]['find']({'where':{'name':_0x3dad2d,'userProfileId':_0x3287a0[_0x426f('0x5f')]},'raw':!![]})[_0x426f('0x34')](function(_0x191370){if(_0x191370&&_0x191370['autoAssociation']===0x0){return db[_0x426f('0x38')][_0x426f('0x5b')]({'name':_0x102bd1[_0x426f('0x3b')],'resourceId':_0x102bd1['id'],'type':_0x191370[_0x426f('0x3b')],'sectionId':_0x191370['id']},{})[_0x426f('0x34')](function(){return _0xe26f41;});}else{return _0xe26f41;}})[_0x426f('0x28')](function(_0x21cdf0){logger[_0x426f('0x24')](_0x426f('0x60'),_0x21cdf0);throw _0x21cdf0;});}return _0xe26f41;})[_0x426f('0x34')](respondWithResult(_0x2ab94a,0xc9))['catch'](handleError(_0x2ab94a,null));};exports[_0x426f('0x33')]=function(_0x17760e,_0x220905){if(_0x17760e['body']['id']){delete _0x17760e[_0x426f('0x61')]['id'];}return db[_0x426f('0x55')][_0x426f('0x5a')]({'where':{'id':_0x17760e[_0x426f('0x58')]['id']},'include':[{'model':db[_0x426f('0x59')],'as':_0x426f('0x3d')}]})[_0x426f('0x34')](handleEntityNotFound(_0x220905,null))[_0x426f('0x34')](saveUpdates(_0x17760e['body'],null))[_0x426f('0x34')](respondWithResult(_0x220905,null))['catch'](handleError(_0x220905,null));};exports[_0x426f('0x35')]=function(_0x1ec787,_0x2b5437){return db[_0x426f('0x55')][_0x426f('0x5a')]({'where':{'id':_0x1ec787['params']['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x2b5437,null))[_0x426f('0x34')](removeEntity(_0x2b5437,null))[_0x426f('0x28')](handleError(_0x2b5437,null));};exports[_0x426f('0x62')]=function(_0x5302d9,_0x5e5dd3){return db[_0x426f('0x55')][_0x426f('0x62')]()[_0x426f('0x34')](respondWithResult(_0x5e5dd3,null))[_0x426f('0x28')](handleError(_0x5e5dd3,null));};exports[_0x426f('0x63')]=function(_0x52bf2d,_0x101c9f,_0xb6d7){if(_0x52bf2d[_0x426f('0x61')]['id']){delete _0x52bf2d[_0x426f('0x61')]['id'];}return db['FaxAccount'][_0x426f('0x5a')]({'where':{'id':_0x52bf2d[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x101c9f,null))['then'](function(_0x5af809){if(_0x5af809){_0x52bf2d['body'][_0x426f('0x64')]=_0x5af809['id'];return db[_0x426f('0x65')][_0x426f('0x5b')](_0x52bf2d['body']);}})['then'](respondWithResult(_0x101c9f,null))[_0x426f('0x28')](handleError(_0x101c9f,null));};exports[_0x426f('0x66')]=function(_0x294867,_0x2d802a,_0x5a8b15){var _0x5f15f7={'raw':![],'where':{}};var _0x2813c9={};var _0x57e1c8={'count':0x0,'rows':[]};return db[_0x426f('0x55')][_0x426f('0x67')]({'where':{'id':_0x294867['params']['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x2d802a,null))['then'](function(_0x3c715f){if(_0x3c715f){_0x2813c9[_0x426f('0x3f')]=_[_0x426f('0x40')](db[_0x426f('0x65')][_0x426f('0x3e')]);_0x2813c9[_0x426f('0x41')]=_['keys'](_0x294867['query']);_0x2813c9['filters']=_['intersection'](_0x2813c9['model'],_0x2813c9[_0x426f('0x41')]);_0x5f15f7['attributes']=_[_0x426f('0x43')](_0x2813c9['model'],qs[_0x426f('0x45')](_0x294867[_0x426f('0x41')]['fields']));_0x5f15f7[_0x426f('0x44')]=_0x5f15f7['attributes'][_0x426f('0x46')]?_0x5f15f7[_0x426f('0x44')]:_0x2813c9[_0x426f('0x3f')];if(!_0x294867[_0x426f('0x41')][_0x426f('0x47')](_0x426f('0x48'))){_0x5f15f7[_0x426f('0x2e')]=qs[_0x426f('0x2e')](_0x294867[_0x426f('0x41')][_0x426f('0x2e')]);_0x5f15f7['offset']=qs['offset'](_0x294867[_0x426f('0x41')][_0x426f('0x2d')]);}_0x5f15f7['order']=qs[_0x426f('0x4a')](_0x294867[_0x426f('0x41')][_0x426f('0x4a')]);_0x5f15f7[_0x426f('0x52')]=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x294867[_0x426f('0x41')],_0x2813c9[_0x426f('0x42')]));_0x5f15f7[_0x426f('0x52')][_0x426f('0x64')]=_0x3c715f['id'];if(_0x294867[_0x426f('0x41')][_0x426f('0x4c')]){_0x5f15f7[_0x426f('0x52')]=_['merge'](_0x5f15f7[_0x426f('0x52')],{'$or':_[_0x426f('0x68')](_0x5f15f7[_0x426f('0x44')],function(_0x34f082){var _0x3d53bd={};_0x3d53bd[_0x34f082]={'$like':'%'+_0x294867[_0x426f('0x41')][_0x426f('0x4c')]+'%'};return _0x3d53bd;})});}_0x5f15f7=_[_0x426f('0x4d')]({},_0x5f15f7,_0x294867[_0x426f('0x51')]);return db[_0x426f('0x65')][_0x426f('0x2c')]({'where':_0x5f15f7[_0x426f('0x52')]})['then'](function(_0x3b8f9d){_0x57e1c8[_0x426f('0x2c')]=_0x3b8f9d;if(_0x294867['query'][_0x426f('0x53')]){_0x5f15f7['include']=[{'all':!![]}];}return db['Disposition'][_0x426f('0x56')](_0x5f15f7);})[_0x426f('0x34')](function(_0x561c88){_0x57e1c8[_0x426f('0x57')]=_0x561c88;return _0x57e1c8;});}})[_0x426f('0x34')](respondWithFilteredResult(_0x2d802a,_0x5f15f7))[_0x426f('0x28')](handleError(_0x2d802a,null));};exports[_0x426f('0x69')]=function(_0x3a18a3,_0x526182,_0x1e43d9){return db[_0x426f('0x55')]['find']({'where':{'id':_0x3a18a3[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x526182,null))[_0x426f('0x34')](function(_0x34899f){if(_0x34899f){return _0x34899f['removeDispositions'](_0x3a18a3['query']['ids']);}})[_0x426f('0x34')](respondWithStatusCode(_0x526182,null))[_0x426f('0x28')](handleError(_0x526182,null));};exports[_0x426f('0x6a')]=function(_0x92b93,_0x1ff4b1,_0x1ea40a){if(_0x92b93['body']['id']){delete _0x92b93[_0x426f('0x61')]['id'];}return db[_0x426f('0x55')][_0x426f('0x5a')]({'where':{'id':_0x92b93[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x1ff4b1,null))[_0x426f('0x34')](function(_0x1e4e82){if(_0x1e4e82){_0x92b93['body']['FaxAccountId']=_0x1e4e82['id'];return db[_0x426f('0x6b')]['create'](_0x92b93[_0x426f('0x61')]);}})[_0x426f('0x34')](respondWithResult(_0x1ff4b1,null))[_0x426f('0x28')](handleError(_0x1ff4b1,null));};exports[_0x426f('0x6c')]=function(_0x47fe91,_0x36dd3b,_0x962b8c){var _0x4bbf56={'raw':![],'where':{}};var _0x3b8ab6={};var _0x3dd2c1={'count':0x0,'rows':[]};return db[_0x426f('0x55')]['findOne']({'where':{'id':_0x47fe91[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x36dd3b,null))[_0x426f('0x34')](function(_0x2ca242){if(_0x2ca242){_0x3b8ab6[_0x426f('0x3f')]=_['keys'](db[_0x426f('0x6b')][_0x426f('0x3e')]);_0x3b8ab6['query']=_['keys'](_0x47fe91[_0x426f('0x41')]);_0x3b8ab6['filters']=_['intersection'](_0x3b8ab6[_0x426f('0x3f')],_0x3b8ab6['query']);_0x4bbf56[_0x426f('0x44')]=_[_0x426f('0x43')](_0x3b8ab6[_0x426f('0x3f')],qs[_0x426f('0x45')](_0x47fe91[_0x426f('0x41')]['fields']));_0x4bbf56[_0x426f('0x44')]=_0x4bbf56['attributes'][_0x426f('0x46')]?_0x4bbf56[_0x426f('0x44')]:_0x3b8ab6[_0x426f('0x3f')];if(!_0x47fe91[_0x426f('0x41')]['hasOwnProperty']('nolimit')){_0x4bbf56[_0x426f('0x2e')]=qs[_0x426f('0x2e')](_0x47fe91[_0x426f('0x41')]['limit']);_0x4bbf56[_0x426f('0x2d')]=qs[_0x426f('0x2d')](_0x47fe91[_0x426f('0x41')]['offset']);}_0x4bbf56[_0x426f('0x49')]=qs[_0x426f('0x4a')](_0x47fe91[_0x426f('0x41')][_0x426f('0x4a')]);_0x4bbf56[_0x426f('0x52')]=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x47fe91[_0x426f('0x41')],_0x3b8ab6['filters']));_0x4bbf56[_0x426f('0x52')]['FaxAccountId']=_0x2ca242['id'];if(_0x47fe91['query'][_0x426f('0x4c')]){_0x4bbf56['where']=_['merge'](_0x4bbf56['where'],{'$or':_['map'](_0x4bbf56[_0x426f('0x44')],function(_0x3c2225){var _0x17ec91={};_0x17ec91[_0x3c2225]={'$like':'%'+_0x47fe91[_0x426f('0x41')][_0x426f('0x4c')]+'%'};return _0x17ec91;})});}_0x4bbf56=_[_0x426f('0x4d')]({},_0x4bbf56,_0x47fe91[_0x426f('0x51')]);return db[_0x426f('0x6b')][_0x426f('0x2c')]({'where':_0x4bbf56['where']})[_0x426f('0x34')](function(_0x380c68){_0x3dd2c1['count']=_0x380c68;if(_0x47fe91['query'][_0x426f('0x53')]){_0x4bbf56[_0x426f('0x54')]=[{'all':!![]}];}return db[_0x426f('0x6b')][_0x426f('0x56')](_0x4bbf56);})[_0x426f('0x34')](function(_0xe1fbab){_0x3dd2c1[_0x426f('0x57')]=_0xe1fbab;return _0x3dd2c1;});}})[_0x426f('0x34')](respondWithFilteredResult(_0x36dd3b,_0x4bbf56))[_0x426f('0x28')](handleError(_0x36dd3b,null));};exports[_0x426f('0x6d')]=function(_0x2a5d8d,_0x4997b5,_0x1079d8){return db[_0x426f('0x55')][_0x426f('0x5a')]({'where':{'id':_0x2a5d8d[_0x426f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4997b5,null))[_0x426f('0x34')](function(_0x2ecfad){if(_0x2ecfad){return _0x2ecfad[_0x426f('0x6d')](_0x2a5d8d['query'][_0x426f('0x6e')]);}})[_0x426f('0x34')](respondWithStatusCode(_0x4997b5,null))[_0x426f('0x28')](handleError(_0x4997b5,null));};exports[_0x426f('0x6f')]=function(_0x4d5be7,_0x1e92f0,_0x3abc02){return db[_0x426f('0x70')][_0x426f('0x5a')]({'where':{'id':_0x4d5be7[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x1e92f0,null))[_0x426f('0x34')](function(_0x16fcd1){if(_0x16fcd1){return _0x16fcd1['addInteraction'](_0x4d5be7['body'][_0x426f('0x6e')],_[_0x426f('0x71')](_0x4d5be7[_0x426f('0x61')],[_0x426f('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x1e92f0,null))[_0x426f('0x28')](handleError(_0x1e92f0,null));};exports[_0x426f('0x72')]=function(_0x1fe30c,_0x45fca7,_0x47f3f0){var _0x2612e5={'raw':![],'where':{}};var _0x507c30={};var _0xc5ba9e={'count':0x0,'rows':[]};return db[_0x426f('0x55')]['findOne']({'where':{'id':_0x1fe30c['params']['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x45fca7,null))[_0x426f('0x34')](function(_0x41aeb8){if(_0x41aeb8){_0x507c30[_0x426f('0x3f')]=_['keys'](db['FaxInteraction'][_0x426f('0x3e')]);_0x507c30[_0x426f('0x41')]=_[_0x426f('0x40')](_0x1fe30c['query']);_0x507c30[_0x426f('0x42')]=_[_0x426f('0x43')](_0x507c30[_0x426f('0x3f')],_0x507c30[_0x426f('0x41')]);_0x2612e5['attributes']=_[_0x426f('0x43')](_0x507c30[_0x426f('0x3f')],qs[_0x426f('0x45')](_0x1fe30c[_0x426f('0x41')]['fields']));_0x2612e5[_0x426f('0x44')]=_0x2612e5['attributes'][_0x426f('0x46')]?_0x2612e5[_0x426f('0x44')]:_0x507c30[_0x426f('0x3f')];if(!_0x1fe30c[_0x426f('0x41')][_0x426f('0x47')]('nolimit')){_0x2612e5[_0x426f('0x2e')]=qs[_0x426f('0x2e')](_0x1fe30c[_0x426f('0x41')][_0x426f('0x2e')]);_0x2612e5[_0x426f('0x2d')]=qs['offset'](_0x1fe30c[_0x426f('0x41')][_0x426f('0x2d')]);}_0x2612e5[_0x426f('0x49')]=qs['sort'](_0x1fe30c['query'][_0x426f('0x4a')]);_0x2612e5[_0x426f('0x52')]=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x1fe30c['query'],_0x507c30[_0x426f('0x42')]));_0x2612e5[_0x426f('0x52')]['FaxAccountId']=_0x41aeb8['id'];if(_0x1fe30c[_0x426f('0x41')]['filter']){_0x2612e5[_0x426f('0x52')]=_[_0x426f('0x4d')](_0x2612e5[_0x426f('0x52')],{'$or':_[_0x426f('0x68')](_0x2612e5[_0x426f('0x44')],function(_0x1ce3e2){var _0x3cdcb4={};_0x3cdcb4[_0x1ce3e2]={'$like':'%'+_0x1fe30c[_0x426f('0x41')][_0x426f('0x4c')]+'%'};return _0x3cdcb4;})});}_0x2612e5=_[_0x426f('0x4d')]({},_0x2612e5,_0x1fe30c[_0x426f('0x51')]);return db[_0x426f('0x70')]['count']({'where':_0x2612e5[_0x426f('0x52')]})[_0x426f('0x34')](function(_0x41bdc7){_0xc5ba9e[_0x426f('0x2c')]=_0x41bdc7;if(_0x1fe30c[_0x426f('0x41')][_0x426f('0x53')]){_0x2612e5['include']=[{'model':db[_0x426f('0x73')],'as':_0x426f('0x74'),'required':![]},{'model':db[_0x426f('0x75')],'as':_0x426f('0x76'),'attributes':['name',_0x426f('0x77'),_0x426f('0x78')],'required':![]},{'model':db['Tag'],'as':_0x426f('0x79'),'attributes':['id',_0x426f('0x3b'),_0x426f('0x7a')],'where':_0x1fe30c[_0x426f('0x41')][_0x426f('0x7b')]?{'id':_0x1fe30c['query'][_0x426f('0x7b')]}:undefined,'required':_0x1fe30c['query'][_0x426f('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0x426f('0x56')](_0x2612e5);})[_0x426f('0x34')](function(_0x34e1d2){_0xc5ba9e[_0x426f('0x57')]=_0x34e1d2;return _0xc5ba9e;});}})[_0x426f('0x34')](respondWithFilteredResult(_0x45fca7,_0x2612e5))[_0x426f('0x28')](handleError(_0x45fca7,null));};exports[_0x426f('0x7c')]=function(_0x37cfd0,_0x153e98,_0x587762){return db[_0x426f('0x55')][_0x426f('0x67')]({'where':{'id':_0x37cfd0['params']['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x153e98,null))['then'](function(_0x182864){if(_0x182864){return db[_0x426f('0x7d')][_0x426f('0x7e')](function(_0x34b9e4){return db[_0x426f('0x7f')][_0x426f('0x35')]({'where':{'FaxAccountId':_0x37cfd0['params']['id']},'transaction':_0x34b9e4})[_0x426f('0x34')](function(_0x9d91a3){var _0x2581b2=_[_0x426f('0x68')](_0x37cfd0[_0x426f('0x61')],function(_0x1d3788){_0x1d3788[_0x426f('0x64')]=_0x37cfd0[_0x426f('0x58')]['id'];return _0x1d3788;});return db[_0x426f('0x7f')][_0x426f('0x80')](_0x2581b2,{'transaction':_0x34b9e4});});})['then'](function(){return db[_0x426f('0x7f')][_0x426f('0x81')]({'where':{'FaxAccountId':_0x37cfd0[_0x426f('0x58')]['id']},'order':_0x426f('0x82')});});}})[_0x426f('0x34')](respondWithResult(_0x153e98,null))['catch'](handleError(_0x153e98,null));};exports['getApplications']=function(_0x359d11,_0x14bfa3,_0x1cc8d4){var _0xf9d20a={};var _0x411c6c={};var _0x531e97;var _0x3a66e4;return db[_0x426f('0x55')][_0x426f('0x67')]({'where':{'id':_0x359d11['params']['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x14bfa3,null))[_0x426f('0x34')](function(_0xb0699b){if(_0xb0699b){_0x531e97=_0xb0699b;_0x411c6c[_0x426f('0x3f')]=_[_0x426f('0x40')](db['FaxApplication'][_0x426f('0x3e')]);_0x411c6c[_0x426f('0x41')]=_[_0x426f('0x40')](_0x359d11[_0x426f('0x41')]);_0x411c6c[_0x426f('0x42')]=_['intersection'](_0x411c6c[_0x426f('0x3f')],_0x411c6c['query']);_0xf9d20a[_0x426f('0x44')]=_['intersection'](_0x411c6c[_0x426f('0x3f')],qs['fields'](_0x359d11[_0x426f('0x41')][_0x426f('0x45')]));_0xf9d20a[_0x426f('0x44')]=_0xf9d20a[_0x426f('0x44')][_0x426f('0x46')]?_0xf9d20a[_0x426f('0x44')]:_0x411c6c[_0x426f('0x3f')];_0xf9d20a[_0x426f('0x49')]=qs['sort'](_0x359d11[_0x426f('0x41')]['sort']);_0xf9d20a[_0x426f('0x52')]=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x359d11['query'],_0x411c6c[_0x426f('0x42')]));if(_0x359d11['query'][_0x426f('0x4c')]){_0xf9d20a[_0x426f('0x52')]=_[_0x426f('0x4d')](_0xf9d20a[_0x426f('0x52')],{'$or':_[_0x426f('0x68')](_0xf9d20a[_0x426f('0x44')],function(_0x33297f){var _0x34bede={};_0x34bede[_0x33297f]={'$like':'%'+_0x359d11[_0x426f('0x41')]['filter']+'%'};return _0x34bede;})});}_0xf9d20a=_[_0x426f('0x4d')]({},_0xf9d20a,_0x359d11[_0x426f('0x51')]);return _0x531e97[_0x426f('0x83')](_0xf9d20a);}})[_0x426f('0x34')](function(_0x349700){if(_0x349700){_0x3a66e4=_0x349700[_0x426f('0x46')];if(!_0x359d11['query'][_0x426f('0x47')](_0x426f('0x48'))){_0xf9d20a[_0x426f('0x2e')]=qs['limit'](_0x359d11[_0x426f('0x41')][_0x426f('0x2e')]);_0xf9d20a['offset']=qs['offset'](_0x359d11[_0x426f('0x41')][_0x426f('0x2d')]);}return _0x531e97['getApplications'](_0xf9d20a);}})[_0x426f('0x34')](function(_0x417382){if(_0x417382){return _0x417382?{'count':_0x3a66e4,'rows':_0x417382}:null;}})[_0x426f('0x34')](respondWithResult(_0x14bfa3,null))[_0x426f('0x28')](handleError(_0x14bfa3,null));};function Extension(_0x10bc9,_0x4e8823,_0x12e188,_0x541ab8){this[_0x426f('0x84')]=_0x426f('0x85');this[_0x426f('0x86')]=_0x10bc9['localstationid'];this['app']=_0x541ab8;this[_0x426f('0x4e')]=_0x426f('0x87');this[_0x426f('0x88')]=_0x426f('0x89');this[_0x426f('0x64')]=_0x10bc9['id'];this[_0x426f('0x82')]=_0x4e8823;this['appdata']=_0x12e188;}function createExtensionsReciveFax(_0x336918){var _0x1f0956=0x1;var _0x15c7d6=[];_0x15c7d6['push'](new Extension(_0x336918,_0x1f0956,'','Answer'));_0x1f0956+=0x1;_0x15c7d6['push'](new Extension(_0x336918,_0x1f0956,'CDR(type)=inbound-fax','Set'));_0x1f0956+=0x1;for(var _0x4cda58 in _0x336918){if(_0x336918[_0x426f('0x47')](_0x4cda58)&&(_0x4cda58===_0x426f('0x8a')||_0x4cda58===_0x426f('0x8b')||_0x4cda58==='gateway'||_0x4cda58===_0x426f('0x8c')||_0x4cda58===_0x426f('0x8d')||_0x4cda58===_0x426f('0x8e')||_0x4cda58===_0x426f('0x8f')||_0x4cda58===_0x426f('0x90')||_0x4cda58===_0x426f('0x91'))){_0x15c7d6[_0x426f('0x92')](new Extension(_0x336918,_0x1f0956,_0x426f('0x93')+_0x4cda58+')='+_0x336918[_0x4cda58],_0x426f('0x94')));_0x1f0956+=0x1;}}_0x15c7d6[_0x426f('0x92')](new Extension(_0x336918,_0x1f0956,'6',_0x426f('0x95')));_0x1f0956+=0x1;_0x15c7d6[_0x426f('0x92')](new Extension(_0x336918,_0x1f0956,_0x426f('0x96'),_0x426f('0x97')));_0x1f0956=0x0;return _0x15c7d6;}exports['addAccountApplications']=function(_0x3f33d6,_0xc0b72c,_0x405055){var _0x938197;return db[_0x426f('0x7d')][_0x426f('0x7e')](function(_0x2ae8ac){return db[_0x426f('0x55')][_0x426f('0x5b')](_0x3f33d6['body'],{'transaction':_0x2ae8ac})[_0x426f('0x34')](function(_0x5e5ccf){_0x938197=_0x5e5ccf[_0x426f('0x36')]({'plain':!![]});return db[_0x426f('0x98')][_0x426f('0x80')](createExtensionsReciveFax(_0x938197),{'transaction':_0x2ae8ac});});})['then'](function(){return _0x938197;})[_0x426f('0x34')](respondWithResult(_0xc0b72c,null))['catch'](handleError(_0xc0b72c,null));};exports[_0x426f('0x99')]=function(_0x1786f8,_0x4ff60f,_0x1bd59d){var _0x3292f5;return db[_0x426f('0x7d')]['transaction'](function(_0x2a041e){return db[_0x426f('0x55')][_0x426f('0x33')](_0x1786f8[_0x426f('0x61')],{'where':{'id':_0x1786f8['body']['id']},'transaction':_0x2a041e})[_0x426f('0x34')](function(_0x3bd06b){return db[_0x426f('0x98')][_0x426f('0x35')]({'where':{'FaxAccountId':_0x1786f8[_0x426f('0x61')]['id']},'transaction':_0x2a041e})[_0x426f('0x34')](function(_0xeb314b){return db[_0x426f('0x98')][_0x426f('0x80')](createExtensionsReciveFax(_[_0x426f('0x71')](_0x1786f8['body'],['tech','key',_0x426f('0x9a'),_0x426f('0x9b'),_0x426f('0x9c'),_0x426f('0x9d')])),{'transaction':_0x2a041e});});});})[_0x426f('0x34')](function(){return db[_0x426f('0x55')][_0x426f('0x9e')](_0x1786f8[_0x426f('0x61')]['id']);})[_0x426f('0x34')](respondWithResult(_0x4ff60f,null))[_0x426f('0x28')](handleError(_0x4ff60f,null));};exports[_0x426f('0x9f')]=function(_0x3368c4,_0x3c64d0,_0xadf9a6){var _0x27ed4f={'raw':!![],'where':{}};var _0x10450f={};var _0x2f3628={'count':0x0,'rows':[]};return db[_0x426f('0x55')][_0x426f('0x67')]({'where':{'id':_0x3368c4[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x3c64d0,null))[_0x426f('0x34')](function(_0x2e2f02){if(_0x2e2f02){_0x10450f[_0x426f('0x3f')]=_['keys'](db[_0x426f('0xa0')][_0x426f('0x3e')]);_0x10450f['query']=_[_0x426f('0x40')](_0x3368c4[_0x426f('0x41')]);_0x10450f[_0x426f('0x42')]=_['intersection'](_0x10450f[_0x426f('0x3f')],_0x10450f['query']);_0x27ed4f[_0x426f('0x44')]=_[_0x426f('0x43')](_0x10450f[_0x426f('0x3f')],qs[_0x426f('0x45')](_0x3368c4[_0x426f('0x41')][_0x426f('0x45')]));_0x27ed4f[_0x426f('0x44')]=_0x27ed4f['attributes'][_0x426f('0x46')]?_0x27ed4f[_0x426f('0x44')]:_0x10450f[_0x426f('0x3f')];if(!_0x3368c4['query']['hasOwnProperty']('nolimit')){_0x27ed4f[_0x426f('0x2e')]=qs[_0x426f('0x2e')](_0x3368c4[_0x426f('0x41')][_0x426f('0x2e')]);_0x27ed4f['offset']=qs['offset'](_0x3368c4[_0x426f('0x41')][_0x426f('0x2d')]);}_0x27ed4f[_0x426f('0x49')]=qs[_0x426f('0x4a')](_0x3368c4[_0x426f('0x41')][_0x426f('0x4a')]);_0x27ed4f[_0x426f('0x52')]=qs[_0x426f('0x42')](_['pick'](_0x3368c4['query'],_0x10450f[_0x426f('0x42')]));_0x27ed4f['where'][_0x426f('0x64')]=_0x2e2f02['id'];if(_0x3368c4[_0x426f('0x41')][_0x426f('0x4c')]){_0x27ed4f[_0x426f('0x52')]=_[_0x426f('0x4d')](_0x27ed4f[_0x426f('0x52')],{'$or':_[_0x426f('0x68')](_0x27ed4f[_0x426f('0x44')],function(_0x4883a4){var _0x301c09={};_0x301c09[_0x4883a4]={'$like':'%'+_0x3368c4[_0x426f('0x41')][_0x426f('0x4c')]+'%'};return _0x301c09;})});}if(_0x3368c4['query'][_0x426f('0xa1')]){var _0x547030=_0x3368c4['query']['$gte'][_0x426f('0xa2')](',');var _0x2fb269={};_0x2fb269[_0x547030[0x0]]={'$gte':moment(_0x547030[0x1])[_0x426f('0xa3')](_0x426f('0xa4'))};_0x27ed4f[_0x426f('0x52')]=_['merge'](_0x27ed4f[_0x426f('0x52')],_0x2fb269);}_0x27ed4f=_[_0x426f('0x4d')]({},_0x27ed4f,_0x3368c4['options']);return db[_0x426f('0xa0')][_0x426f('0x2c')]({'where':_0x27ed4f['where']})[_0x426f('0x34')](function(_0x25bf23){_0x2f3628['count']=_0x25bf23;if(_0x3368c4['query'][_0x426f('0x53')]){_0x27ed4f[_0x426f('0x54')]=[{'all':!![]}];}return db[_0x426f('0xa0')][_0x426f('0x56')](_0x27ed4f);})['then'](function(_0x7abafa){_0x2f3628[_0x426f('0x57')]=_0x7abafa;return _0x2f3628;});}})[_0x426f('0x34')](respondWithFilteredResult(_0x3c64d0,_0x27ed4f))[_0x426f('0x28')](handleError(_0x3c64d0,null));};exports['send']=function(_0x1651dc,_0x5cd640,_0xe1e5ba){var _0x5cd30c,_0x29c316={},_0x34b726;if(_0x1651dc[_0x426f('0x61')]['to']){_0x34b726=_0x1651dc[_0x426f('0x61')]['to'][0x0];}return db[_0x426f('0x55')]['find']({'where':{'id':_0x1651dc['params']['id']},'include':[{'model':db[_0x426f('0xa5')],'as':_0x426f('0xa6'),'include':[{'model':db[_0x426f('0x73')],'as':_0x426f('0xa7'),'where':{'fax':_0x34b726},'limit':0x1,'order':[[_0x426f('0x9b'),_0x426f('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x5cd640,null))['then'](function(_0x385725){_0x5cd30c=_0x385725;if(_0x1651dc['body']['attachments']&&_0x1651dc['body'][_0x426f('0xa9')][_0x426f('0x46')]){for(var _0x2a6a78=0x0;_0x2a6a78<_0x1651dc['body'][_0x426f('0xa9')][_0x426f('0x46')];_0x2a6a78+=0x1){_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][_0x2a6a78]={'filename':_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][_0x2a6a78][_0x426f('0x3b')],'id':_0x1651dc['body'][_0x426f('0xa9')][_0x2a6a78]['id'],'path':path[_0x426f('0xaa')](config[_0x426f('0xab')],'server/files/attachments',_0x1651dc[_0x426f('0x61')]['attachments'][_0x2a6a78][_0x426f('0xac')])};}}return respondWithRpcPromise(_0x426f('0xad'),'CheckAfterSend',{'FaxAccountId':_[_0x426f('0xae')](_0x1651dc[_0x426f('0x58')]['id'])?undefined:_0x1651dc[_0x426f('0x58')]['id'],'path':_[_0x426f('0xae')](_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][0x0][_0x426f('0x6')])?undefined:_0x1651dc[_0x426f('0x61')]['attachments'][0x0]['path'],'fax':_[_0x426f('0xae')](_0x1651dc['body']['to'][0x0])?undefined:_0x1651dc['body']['to'][0x0]},client9002);})[_0x426f('0x34')](function(){if(_0x5cd30c){if(_['isNil'](_0x1651dc[_0x426f('0x61')]['from'])){_0x1651dc[_0x426f('0x61')]['from']=util[_0x426f('0xa3')](_0x426f('0xaf'),_0x5cd30c[_0x426f('0x3b')],_0x5cd30c[_0x426f('0xb0')]);}if(_0x5cd30c[_0x426f('0xa6')]){if(_0x5cd30c[_0x426f('0xa6')][_0x426f('0xa7')][_0x426f('0x46')]){return _0x5cd30c[_0x426f('0xa6')][_0x426f('0xa7')][0x0];}else{return db[_0x426f('0x73')][_0x426f('0x5b')](_[_0x426f('0xb1')](_0x1651dc['body'],{'firstName':_0x1651dc[_0x426f('0x61')]['to'][0x0],'phone':_0x1651dc[_0x426f('0x61')]['to'][0x0],'fax':_0x1651dc[_0x426f('0x61')]['to'][0x0],'ListId':_0x5cd30c[_0x426f('0x9d')]}));}}else{throw new Error(_0x426f('0xb2'));}}else{throw new Error(_0x426f('0xb3'));}})['then'](function(_0x44943a){if(_0x44943a){return db[_0x426f('0x70')]['find']({'where':{'ContactId':_0x44943a['id'],'closed':![],'FaxAccountId':_0x5cd30c['id']}})[_0x426f('0x34')](function(_0x47c0a6){if(_0x47c0a6){return[_0x47c0a6,![]];}return db[_0x426f('0x70')][_0x426f('0x5b')]({'UserId':_0x1651dc[_0x426f('0x5c')]['id'],'ContactId':_0x44943a['id'],'FaxAccountId':_0x5cd30c['id'],'fax':_0x1651dc[_0x426f('0x61')]['to'][0x0],'firstMsgDirection':_0x426f('0xb4'),'Messages':[_[_0x426f('0x4d')](_0x1651dc[_0x426f('0x61')],{'read':![],'body':_0x1651dc[_0x426f('0x61')]['attachments'][0x0]['filename'],'FaxAccountId':_0x5cd30c['id'],'UserId':_0x1651dc['user']['id'],'ContactId':_0x44943a['id'],'AttachmentId':_0x1651dc['body'][_0x426f('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x426f('0xa0')],'as':'Messages'}]})[_0x426f('0x34')](function(_0x2aa570){return[_0x2aa570,!![]];});});}else{throw new Error(_0x426f('0xb5'));}})[_0x426f('0xb6')](function(_0x52d1c3,_0xae7c4c){if(_0xae7c4c){return _0x52d1c3;}return db[_0x426f('0xa0')]['create']({'direction':_0x426f('0xb4'),'read':![],'body':_0x1651dc['body'][_0x426f('0xa9')][0x0]['filename'],'FaxAccountId':_0x5cd30c['id'],'FaxInteractionId':_0x52d1c3['id'],'UserId':_0x1651dc[_0x426f('0x5c')]['id'],'ContactId':_0x52d1c3[_0x426f('0xb7')],'AttachmentId':_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][0x0]['id']})[_0x426f('0x34')](function(_0x1788b8){_0x52d1c3[_0x426f('0xb8')][_0x426f('0xb9')]=[];_0x52d1c3[_0x426f('0xb8')]['Messages'][_0x426f('0x92')](_0x1788b8[_0x426f('0xb8')]);return _0x52d1c3;});})[_0x426f('0x34')](function(_0x18a6ff){respondWithRpcPromise('SendFax',_0x426f('0xba'),{'FaxAccountId':_[_0x426f('0xae')](_0x1651dc['params']['id'])?undefined:_0x1651dc[_0x426f('0x58')]['id'],'path':_[_0x426f('0xae')](_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][0x0][_0x426f('0x6')])?undefined:_0x1651dc['body'][_0x426f('0xa9')][0x0][_0x426f('0x6')],'fax':_['isNil'](_0x1651dc[_0x426f('0x61')]['to'][0x0])?undefined:_0x1651dc[_0x426f('0x61')]['to'][0x0],'AttachmentId':_0x1651dc[_0x426f('0x61')][_0x426f('0xa9')][0x0]['id']},client9002)[_0x426f('0x34')](function(_0x58b4cb){logger[_0x426f('0x20')](_0x426f('0xbb'),_0x58b4cb);})[_0x426f('0x28')](function(_0x21bd52){logger['info'](_0x426f('0xbb'),_0x21bd52);});return _0x18a6ff;})['then'](respondWithResult(_0x5cd640,null))[_0x426f('0x28')](handleError(_0x5cd640,null));};exports[_0x426f('0xbc')]=function(_0x3d32b6,_0x36781e,_0x3982a6){return db['FaxAccount'][_0x426f('0x5a')]({'where':{'id':_0x3d32b6['params']['id']}})['then'](handleEntityNotFound(_0x36781e,null))[_0x426f('0x34')](function(_0x5c03d3){if(_0x5c03d3){return _0x5c03d3['addAgents'](_0x3d32b6[_0x426f('0x61')][_0x426f('0x6e')],_[_0x426f('0x71')](_0x3d32b6[_0x426f('0x61')],[_0x426f('0x6e'),'id'])||{})['spread'](function(_0x3e3854){for(var _0x5d0a7d=0x0;_0x5d0a7d<_0x3d32b6[_0x426f('0x61')][_0x426f('0x6e')]['length'];_0x5d0a7d+=0x1){socket[_0x426f('0xbd')](_0x426f('0xbe'),{'UserId':_0x3d32b6[_0x426f('0x61')][_0x426f('0x6e')][_0x5d0a7d],'FaxAccountId':_0x3d32b6[_0x426f('0x58')]['id']});}return _0x3e3854;});}})['then'](respondWithResult(_0x36781e,null))['catch'](handleError(_0x36781e,null));};exports[_0x426f('0xbf')]=function(_0x5ab302,_0x46263c,_0x56c7c9){return db['FaxAccount'][_0x426f('0x5a')]({'where':{'id':_0x5ab302[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x46263c,null))[_0x426f('0x34')](function(_0x122689){if(_0x122689){return _0x122689['removeAgents'](_0x5ab302['query']['ids'])[_0x426f('0x34')](function(){if(_[_0x426f('0xc0')](_0x5ab302[_0x426f('0x41')]['ids'])){for(var _0x3dc593=0x0;_0x3dc593<_0x5ab302['query'][_0x426f('0x6e')][_0x426f('0x46')];_0x3dc593+=0x1){socket[_0x426f('0xbd')](_0x426f('0xc1'),{'UserId':Number(_0x5ab302[_0x426f('0x41')]['ids'][_0x3dc593]),'FaxAccountId':Number(_0x5ab302['params']['id'])});}}else{socket[_0x426f('0xbd')](_0x426f('0xc1'),{'UserId':Number(_0x5ab302[_0x426f('0x41')][_0x426f('0x6e')]),'FaxAccountId':Number(_0x5ab302['params']['id'])});}});}})[_0x426f('0x34')](respondWithStatusCode(_0x46263c,null))[_0x426f('0x28')](handleError(_0x46263c,null));};exports['getAgents']=function(_0x2eb6ef,_0x27958b,_0xb31ffa){var _0x26a911={};var _0x47eb06={};var _0xfd7157;var _0x163cdc;return db[_0x426f('0x55')]['findOne']({'where':{'id':_0x2eb6ef[_0x426f('0x58')]['id']}})[_0x426f('0x34')](handleEntityNotFound(_0x27958b,null))[_0x426f('0x34')](function(_0x5bb38c){if(_0x5bb38c){_0xfd7157=_0x5bb38c;_0x47eb06[_0x426f('0x3f')]=_[_0x426f('0x40')](db[_0x426f('0x75')][_0x426f('0x3e')]);_0x47eb06[_0x426f('0x41')]=_[_0x426f('0x40')](_0x2eb6ef[_0x426f('0x41')]);_0x47eb06[_0x426f('0x42')]=_[_0x426f('0x43')](_0x47eb06[_0x426f('0x3f')],_0x47eb06[_0x426f('0x41')]);_0x26a911[_0x426f('0x44')]=_['intersection'](_0x47eb06[_0x426f('0x3f')],qs[_0x426f('0x45')](_0x2eb6ef[_0x426f('0x41')][_0x426f('0x45')]));_0x26a911['attributes']=_0x26a911[_0x426f('0x44')][_0x426f('0x46')]?_0x26a911[_0x426f('0x44')]:_0x47eb06[_0x426f('0x3f')];_0x26a911[_0x426f('0x49')]=qs[_0x426f('0x4a')](_0x2eb6ef['query'][_0x426f('0x4a')]);_0x26a911['where']=qs[_0x426f('0x42')](_[_0x426f('0x4b')](_0x2eb6ef[_0x426f('0x41')],_0x47eb06['filters']));if(_0x2eb6ef[_0x426f('0x41')][_0x426f('0x4c')]){_0x26a911[_0x426f('0x52')]=_[_0x426f('0x4d')](_0x26a911[_0x426f('0x52')],{'$or':_['map'](_0x26a911[_0x426f('0x44')],function(_0x36d719){var _0x4acf4a={};_0x4acf4a[_0x36d719]={'$like':'%'+_0x2eb6ef[_0x426f('0x41')]['filter']+'%'};return _0x4acf4a;})});}_0x26a911=_[_0x426f('0x4d')]({},_0x26a911,_0x2eb6ef[_0x426f('0x51')]);return _0xfd7157['getAgents'](_0x26a911);}})[_0x426f('0x34')](function(_0x5b144b){if(_0x5b144b){_0x163cdc=_0x5b144b[_0x426f('0x46')];if(!_0x2eb6ef[_0x426f('0x41')]['hasOwnProperty'](_0x426f('0x48'))){_0x26a911[_0x426f('0x2e')]=qs['limit'](_0x2eb6ef[_0x426f('0x41')][_0x426f('0x2e')]);_0x26a911[_0x426f('0x2d')]=qs[_0x426f('0x2d')](_0x2eb6ef[_0x426f('0x41')][_0x426f('0x2d')]);}return _0xfd7157[_0x426f('0xc2')](_0x26a911);}})['then'](function(_0x307828){if(_0x307828){return _0x307828?{'count':_0x163cdc,'rows':_0x307828}:null;}})[_0x426f('0x34')](respondWithResult(_0x27958b,null))[_0x426f('0x28')](handleError(_0x27958b,null));}; \ No newline at end of file +var _0x19c9=['mandatoryDispositionPause','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','type','system','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','FaxAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x19c9,0x1df));var _0x919c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x19c9[_0x487b0c];return _0x1adbdc;};'use strict';var pdf=require(_0x919c('0x0'));var emlformat=require(_0x919c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x919c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x919c('0x3'));var moment=require(_0x919c('0x4'));var BPromise=require(_0x919c('0x5'));var Mustache=require(_0x919c('0x6'));var util=require('util');var path=require(_0x919c('0x7'));var sox=require(_0x919c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x919c('0x9'));var crypto=require(_0x919c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x919c('0xb'));var Papa=require(_0x919c('0xc'));var Redis=require(_0x919c('0xd'));var authService=require(_0x919c('0xe'));var qs=require(_0x919c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x919c('0x10'))('api');var utils=require(_0x919c('0x11'));var config=require(_0x919c('0x12'));var db=require(_0x919c('0x13'))['db'];config[_0x919c('0x14')]=_[_0x919c('0x15')](config['redis'],{'host':_0x919c('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x919c('0x14')]));require('./faxAccount.socket')[_0x919c('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x919c('0x18')][_0x919c('0x19')]({'port':0x232c});var client9002=jayson[_0x919c('0x18')][_0x919c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x23f045,_0x23ea2b,_0x14af35){if(_0x14af35){var _0x5d676f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d676f[_0x919c('0x1a')](_0x23ea2b)){return _0x23f045;}else{throw new Error(_0x919c('0x1b'));}}else{return _0x23f045;}}function respondWithRpcPromise(_0x5b977e,_0x1fbf91,_0x4fb8b2,_0xfa5c78){return new BPromise(function(_0x258ab3,_0x178ee8){var _0x418184=_0xfa5c78||client;return _0x418184[_0x919c('0x1c')](_0x5b977e,_0x4fb8b2)['then'](function(_0x42ef2e){logger[_0x919c('0x1d')](_0x919c('0x1e'),_0x1fbf91,_0x919c('0x1f'));logger[_0x919c('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1fbf91,_0x919c('0x1f'),JSON[_0x919c('0x21')](_0x42ef2e));if(_0x42ef2e[_0x919c('0x22')]){if(_0x42ef2e['error'][_0x919c('0x23')]===0x1f4){logger[_0x919c('0x22')]('FaxAccount,\x20%s,\x20%s',_0x1fbf91,_0x42ef2e['error']['message']);return _0x178ee8(_0x42ef2e[_0x919c('0x22')][_0x919c('0x24')]);}logger[_0x919c('0x22')](_0x919c('0x1e'),_0x1fbf91,_0x42ef2e[_0x919c('0x22')][_0x919c('0x24')]);return _0x258ab3(_0x42ef2e[_0x919c('0x22')][_0x919c('0x24')]);}else{logger[_0x919c('0x1d')](_0x919c('0x1e'),_0x1fbf91,_0x919c('0x1f'));_0x258ab3(_0x42ef2e[_0x919c('0x25')]['message']);}})[_0x919c('0x26')](function(_0x55a0c4){logger[_0x919c('0x22')]('FaxAccount,\x20%s,\x20%s',_0x1fbf91,_0x55a0c4);_0x178ee8(_0x55a0c4);});});}function respondWithStatusCode(_0x16c0c3,_0x134714){_0x134714=_0x134714||0xcc;return function(_0x1783b0){if(_0x1783b0){return _0x16c0c3[_0x919c('0x27')](_0x134714);}return _0x16c0c3[_0x919c('0x28')](_0x134714)[_0x919c('0x29')]();};}function respondWithResult(_0x4ec4e8,_0x6c7f2d){_0x6c7f2d=_0x6c7f2d||0xc8;return function(_0x5130c7){if(_0x5130c7){return _0x4ec4e8[_0x919c('0x28')](_0x6c7f2d)['json'](_0x5130c7);}};}function respondWithFilteredResult(_0x5ba6cd,_0x366766){return function(_0xe65663){if(_0xe65663){var _0xf5990=_0xe65663['count'],_0x1ffdbc=_0x366766[_0x919c('0x2a')],_0xfca05b=_0x366766['offset']+_0x366766[_0x919c('0x2b')],_0x17eadf;if(_0xfca05b>=_0xf5990){_0xfca05b=_0xf5990;_0x17eadf=0xc8;}else{_0x17eadf=0xce;}_0x5ba6cd[_0x919c('0x28')](_0x17eadf);return _0x5ba6cd[_0x919c('0x2c')](_0x919c('0x2d'),_0x1ffdbc+'-'+_0xfca05b+'/'+_0xf5990)[_0x919c('0x2e')](_0xe65663);}return null;};}function patchUpdates(_0x450b28){return function(_0x59e057){try{jsonpatch[_0x919c('0x2f')](_0x59e057,_0x450b28,!![]);}catch(_0x35c699){return BPromise['reject'](_0x35c699);}return _0x59e057['save']();};}function saveUpdates(_0x41d20a,_0x49e559){return function(_0x23f127){if(_0x23f127){return _0x23f127['update'](_0x41d20a)[_0x919c('0x30')](function(_0x5f02aa){return _0x5f02aa;});}return null;};}function removeEntity(_0x4972a6,_0x43d01f){return function(_0x334c48){if(_0x334c48){return _0x334c48[_0x919c('0x31')]()['then'](function(){var _0x481fdf=_0x334c48['get']({'plain':!![]});var _0x297664=_0x919c('0x32');return db[_0x919c('0x33')][_0x919c('0x31')]({'where':{'type':_0x297664,'resourceId':_0x481fdf['id']}})[_0x919c('0x30')](function(){return _0x334c48;});})[_0x919c('0x30')](function(){_0x4972a6[_0x919c('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488f8c,_0x580a65){return function(_0x4bed42){if(!_0x4bed42){_0x488f8c[_0x919c('0x27')](0x194);}return _0x4bed42;};}function handleError(_0x4aaae9,_0x40a29c){_0x40a29c=_0x40a29c||0x1f4;return function(_0x32dd6e){logger[_0x919c('0x22')](_0x32dd6e[_0x919c('0x34')]);if(_0x32dd6e['name']){delete _0x32dd6e[_0x919c('0x35')];}_0x4aaae9[_0x919c('0x28')](_0x40a29c)[_0x919c('0x36')](_0x32dd6e);};}exports[_0x919c('0x37')]=function(_0x5b21bb,_0x205aca){var _0x38211a={'include':[{'model':db[_0x919c('0x38')],'as':'mandatoryDispositionPause'}]},_0x192d21={},_0x2d8056={'count':0x0,'rows':[]};var _0x4dc900=db[_0x919c('0x39')][_0x919c('0x3a')];_0x192d21['model']=_[_0x919c('0x3b')](_0x4dc900);_0x192d21[_0x919c('0x3c')]=_[_0x919c('0x3b')](_0x5b21bb[_0x919c('0x3c')]);_0x192d21[_0x919c('0x3d')]=_[_0x919c('0x3e')](_0x192d21[_0x919c('0x3f')],_0x192d21[_0x919c('0x3c')]);_0x38211a[_0x919c('0x40')]=_['intersection'](_0x192d21['model'],qs[_0x919c('0x41')](_0x5b21bb['query'][_0x919c('0x41')]));_0x38211a[_0x919c('0x40')]=_0x38211a[_0x919c('0x40')]['length']?_0x38211a['attributes']:_0x192d21[_0x919c('0x3f')];if(!_0x5b21bb[_0x919c('0x3c')][_0x919c('0x42')](_0x919c('0x43'))){_0x38211a[_0x919c('0x2b')]=qs[_0x919c('0x2b')](_0x5b21bb[_0x919c('0x3c')][_0x919c('0x2b')]);_0x38211a[_0x919c('0x2a')]=qs[_0x919c('0x2a')](_0x5b21bb[_0x919c('0x3c')][_0x919c('0x2a')]);}_0x38211a[_0x919c('0x44')]=qs[_0x919c('0x45')](_0x5b21bb[_0x919c('0x3c')][_0x919c('0x45')]);_0x38211a[_0x919c('0x46')]=qs[_0x919c('0x3d')](_[_0x919c('0x47')](_0x5b21bb[_0x919c('0x3c')],_0x192d21['filters']));if(_0x5b21bb[_0x919c('0x3c')][_0x919c('0x48')]){_0x38211a[_0x919c('0x46')]=_['merge'](_0x38211a['where'],{'$or':_[_0x919c('0x49')](_0x4dc900,function(_0x9a0413){if(_0x9a0413['type'][_0x919c('0x4a')]!==_0x919c('0x4b')){var _0x3cf3d0={};_0x3cf3d0[_0x9a0413['field']]={'$like':'%'+_0x5b21bb[_0x919c('0x3c')][_0x919c('0x48')]+'%'};return _0x3cf3d0;}})});}_0x38211a=_[_0x919c('0x4c')]({},_0x38211a,_0x5b21bb[_0x919c('0x4d')]);var _0x36236e={'where':_0x38211a['where']};return db[_0x919c('0x39')][_0x919c('0x4e')](_0x36236e)[_0x919c('0x30')](function(_0x417bb7){_0x2d8056[_0x919c('0x4e')]=_0x417bb7;if(_0x5b21bb[_0x919c('0x3c')][_0x919c('0x4f')]){_0x38211a[_0x919c('0x50')]=[{'all':!![]}];}return db[_0x919c('0x39')][_0x919c('0x51')](_0x38211a);})[_0x919c('0x30')](function(_0x36b413){_0x2d8056[_0x919c('0x52')]=_0x36b413;return _0x2d8056;})[_0x919c('0x30')](respondWithFilteredResult(_0x205aca,_0x38211a))['catch'](handleError(_0x205aca,null));};exports[_0x919c('0x53')]=function(_0x1f0e23,_0x51c788){var _0x5d468b={'raw':![],'where':{'id':_0x1f0e23[_0x919c('0x54')]['id']},'include':[{'model':db[_0x919c('0x38')],'as':_0x919c('0x55')}]},_0x393610={};_0x393610[_0x919c('0x3f')]=_[_0x919c('0x3b')](db['FaxAccount'][_0x919c('0x3a')]);_0x393610['query']=_[_0x919c('0x3b')](_0x1f0e23[_0x919c('0x3c')]);_0x393610[_0x919c('0x3d')]=_[_0x919c('0x3e')](_0x393610[_0x919c('0x3f')],_0x393610[_0x919c('0x3c')]);_0x5d468b[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x393610[_0x919c('0x3f')],qs[_0x919c('0x41')](_0x1f0e23['query'][_0x919c('0x41')]));_0x5d468b[_0x919c('0x40')]=_0x5d468b[_0x919c('0x40')][_0x919c('0x56')]?_0x5d468b[_0x919c('0x40')]:_0x393610['model'];if(_0x1f0e23[_0x919c('0x3c')][_0x919c('0x4f')]){_0x5d468b[_0x919c('0x50')]=[{'all':!![]}];}_0x5d468b=_[_0x919c('0x4c')]({},_0x5d468b,_0x1f0e23[_0x919c('0x4d')]);return db[_0x919c('0x39')][_0x919c('0x57')](_0x5d468b)[_0x919c('0x30')](handleEntityNotFound(_0x51c788,null))[_0x919c('0x30')](respondWithResult(_0x51c788,null))['catch'](handleError(_0x51c788,null));};exports[_0x919c('0x58')]=function(_0xffc397,_0x4f01b5){return db[_0x919c('0x39')]['create'](_0xffc397[_0x919c('0x59')],{})[_0x919c('0x30')](function(_0xaa4a2b){var _0x5b6998=_0xffc397['user'][_0x919c('0x5a')]({'plain':!![]});if(!_0x5b6998)throw new Error(_0x919c('0x5b'));if(_0x5b6998['role']===_0x919c('0x5c')){var _0x3bdf64=_0xaa4a2b[_0x919c('0x5a')]({'plain':!![]});var _0xf0669a=_0x919c('0x32');return db[_0x919c('0x5d')][_0x919c('0x57')]({'where':{'name':_0xf0669a,'userProfileId':_0x5b6998['userProfileId']},'raw':!![]})[_0x919c('0x30')](function(_0x34ecbd){if(_0x34ecbd&&_0x34ecbd[_0x919c('0x5e')]===0x0){return db[_0x919c('0x33')][_0x919c('0x58')]({'name':_0x3bdf64[_0x919c('0x35')],'resourceId':_0x3bdf64['id'],'type':_0x34ecbd[_0x919c('0x35')],'sectionId':_0x34ecbd['id']},{})['then'](function(){return _0xaa4a2b;});}else{return _0xaa4a2b;}})[_0x919c('0x26')](function(_0x52730e){logger[_0x919c('0x22')](_0x919c('0x5f'),_0x52730e);throw _0x52730e;});}return _0xaa4a2b;})[_0x919c('0x30')](respondWithResult(_0x4f01b5,0xc9))[_0x919c('0x26')](handleError(_0x4f01b5,null));};exports['update']=function(_0x4eb855,_0x2c5ecc){if(_0x4eb855[_0x919c('0x59')]['id']){delete _0x4eb855['body']['id'];}return db[_0x919c('0x39')][_0x919c('0x57')]({'where':{'id':_0x4eb855[_0x919c('0x54')]['id']},'include':[{'model':db[_0x919c('0x38')],'as':_0x919c('0x55')}]})['then'](handleEntityNotFound(_0x2c5ecc,null))[_0x919c('0x30')](saveUpdates(_0x4eb855['body'],null))[_0x919c('0x30')](respondWithResult(_0x2c5ecc,null))[_0x919c('0x26')](handleError(_0x2c5ecc,null));};exports[_0x919c('0x31')]=function(_0x4fc96f,_0x41bbc7){return db[_0x919c('0x39')]['find']({'where':{'id':_0x4fc96f[_0x919c('0x54')]['id']}})['then'](handleEntityNotFound(_0x41bbc7,null))[_0x919c('0x30')](removeEntity(_0x41bbc7,null))[_0x919c('0x26')](handleError(_0x41bbc7,null));};exports[_0x919c('0x60')]=function(_0x1b5be6,_0x417a80){return db[_0x919c('0x39')][_0x919c('0x60')]()[_0x919c('0x30')](respondWithResult(_0x417a80,null))[_0x919c('0x26')](handleError(_0x417a80,null));};exports['addDisposition']=function(_0x570071,_0x5d5165,_0x579471){if(_0x570071[_0x919c('0x59')]['id']){delete _0x570071['body']['id'];}return db[_0x919c('0x39')][_0x919c('0x57')]({'where':{'id':_0x570071[_0x919c('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d5165,null))[_0x919c('0x30')](function(_0x262531){if(_0x262531){_0x570071[_0x919c('0x59')][_0x919c('0x61')]=_0x262531['id'];return db[_0x919c('0x62')][_0x919c('0x58')](_0x570071[_0x919c('0x59')]);}})['then'](respondWithResult(_0x5d5165,null))[_0x919c('0x26')](handleError(_0x5d5165,null));};exports[_0x919c('0x63')]=function(_0x33e1bb,_0x4993b1,_0x2d5d7c){var _0x106f28={'raw':![],'where':{}};var _0x524887={};var _0x26baec={'count':0x0,'rows':[]};return db[_0x919c('0x39')][_0x919c('0x64')]({'where':{'id':_0x33e1bb[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x4993b1,null))[_0x919c('0x30')](function(_0x309b5a){if(_0x309b5a){_0x524887['model']=_[_0x919c('0x3b')](db[_0x919c('0x62')][_0x919c('0x3a')]);_0x524887[_0x919c('0x3c')]=_[_0x919c('0x3b')](_0x33e1bb['query']);_0x524887[_0x919c('0x3d')]=_['intersection'](_0x524887[_0x919c('0x3f')],_0x524887[_0x919c('0x3c')]);_0x106f28[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x524887['model'],qs[_0x919c('0x41')](_0x33e1bb[_0x919c('0x3c')][_0x919c('0x41')]));_0x106f28['attributes']=_0x106f28[_0x919c('0x40')][_0x919c('0x56')]?_0x106f28['attributes']:_0x524887[_0x919c('0x3f')];if(!_0x33e1bb[_0x919c('0x3c')][_0x919c('0x42')]('nolimit')){_0x106f28[_0x919c('0x2b')]=qs[_0x919c('0x2b')](_0x33e1bb[_0x919c('0x3c')][_0x919c('0x2b')]);_0x106f28[_0x919c('0x2a')]=qs[_0x919c('0x2a')](_0x33e1bb[_0x919c('0x3c')][_0x919c('0x2a')]);}_0x106f28[_0x919c('0x44')]=qs['sort'](_0x33e1bb['query'][_0x919c('0x45')]);_0x106f28[_0x919c('0x46')]=qs[_0x919c('0x3d')](_[_0x919c('0x47')](_0x33e1bb[_0x919c('0x3c')],_0x524887[_0x919c('0x3d')]));_0x106f28[_0x919c('0x46')][_0x919c('0x61')]=_0x309b5a['id'];if(_0x33e1bb[_0x919c('0x3c')][_0x919c('0x48')]){_0x106f28[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x106f28[_0x919c('0x46')],{'$or':_[_0x919c('0x49')](_0x106f28[_0x919c('0x40')],function(_0x1caab4){var _0x2e350c={};_0x2e350c[_0x1caab4]={'$like':'%'+_0x33e1bb[_0x919c('0x3c')]['filter']+'%'};return _0x2e350c;})});}_0x106f28=_[_0x919c('0x4c')]({},_0x106f28,_0x33e1bb[_0x919c('0x4d')]);return db[_0x919c('0x62')][_0x919c('0x4e')]({'where':_0x106f28['where']})[_0x919c('0x30')](function(_0x4f7113){_0x26baec[_0x919c('0x4e')]=_0x4f7113;if(_0x33e1bb['query'][_0x919c('0x4f')]){_0x106f28[_0x919c('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x919c('0x51')](_0x106f28);})[_0x919c('0x30')](function(_0x1da37c){_0x26baec[_0x919c('0x52')]=_0x1da37c;return _0x26baec;});}})['then'](respondWithFilteredResult(_0x4993b1,_0x106f28))[_0x919c('0x26')](handleError(_0x4993b1,null));};exports[_0x919c('0x65')]=function(_0x3ad216,_0x154fb4,_0x2db155){return db['FaxAccount'][_0x919c('0x57')]({'where':{'id':_0x3ad216['params']['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x154fb4,null))[_0x919c('0x30')](function(_0x20d323){if(_0x20d323){return _0x20d323[_0x919c('0x65')](_0x3ad216[_0x919c('0x3c')][_0x919c('0x66')]);}})[_0x919c('0x30')](respondWithStatusCode(_0x154fb4,null))['catch'](handleError(_0x154fb4,null));};exports[_0x919c('0x67')]=function(_0x1cbbfd,_0xefaeba,_0x548bea){if(_0x1cbbfd['body']['id']){delete _0x1cbbfd[_0x919c('0x59')]['id'];}return db[_0x919c('0x39')][_0x919c('0x57')]({'where':{'id':_0x1cbbfd[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0xefaeba,null))[_0x919c('0x30')](function(_0x597d7b){if(_0x597d7b){_0x1cbbfd[_0x919c('0x59')][_0x919c('0x61')]=_0x597d7b['id'];return db[_0x919c('0x68')][_0x919c('0x58')](_0x1cbbfd[_0x919c('0x59')]);}})[_0x919c('0x30')](respondWithResult(_0xefaeba,null))[_0x919c('0x26')](handleError(_0xefaeba,null));};exports['getAnswers']=function(_0x324454,_0x10b3a4,_0x487b71){var _0x521430={'raw':![],'where':{}};var _0x1b0d17={};var _0x30f7cb={'count':0x0,'rows':[]};return db[_0x919c('0x39')][_0x919c('0x64')]({'where':{'id':_0x324454[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x10b3a4,null))[_0x919c('0x30')](function(_0x2b4dfc){if(_0x2b4dfc){_0x1b0d17[_0x919c('0x3f')]=_[_0x919c('0x3b')](db[_0x919c('0x68')][_0x919c('0x3a')]);_0x1b0d17[_0x919c('0x3c')]=_['keys'](_0x324454[_0x919c('0x3c')]);_0x1b0d17[_0x919c('0x3d')]=_[_0x919c('0x3e')](_0x1b0d17[_0x919c('0x3f')],_0x1b0d17[_0x919c('0x3c')]);_0x521430[_0x919c('0x40')]=_['intersection'](_0x1b0d17['model'],qs['fields'](_0x324454[_0x919c('0x3c')][_0x919c('0x41')]));_0x521430['attributes']=_0x521430[_0x919c('0x40')]['length']?_0x521430[_0x919c('0x40')]:_0x1b0d17['model'];if(!_0x324454[_0x919c('0x3c')][_0x919c('0x42')](_0x919c('0x43'))){_0x521430[_0x919c('0x2b')]=qs['limit'](_0x324454['query']['limit']);_0x521430['offset']=qs[_0x919c('0x2a')](_0x324454[_0x919c('0x3c')]['offset']);}_0x521430['order']=qs[_0x919c('0x45')](_0x324454[_0x919c('0x3c')][_0x919c('0x45')]);_0x521430[_0x919c('0x46')]=qs[_0x919c('0x3d')](_[_0x919c('0x47')](_0x324454[_0x919c('0x3c')],_0x1b0d17[_0x919c('0x3d')]));_0x521430['where'][_0x919c('0x61')]=_0x2b4dfc['id'];if(_0x324454[_0x919c('0x3c')][_0x919c('0x48')]){_0x521430['where']=_[_0x919c('0x4c')](_0x521430[_0x919c('0x46')],{'$or':_[_0x919c('0x49')](_0x521430[_0x919c('0x40')],function(_0x3f5cd3){var _0x5e311d={};_0x5e311d[_0x3f5cd3]={'$like':'%'+_0x324454[_0x919c('0x3c')][_0x919c('0x48')]+'%'};return _0x5e311d;})});}_0x521430=_['merge']({},_0x521430,_0x324454['options']);return db[_0x919c('0x68')][_0x919c('0x4e')]({'where':_0x521430[_0x919c('0x46')]})[_0x919c('0x30')](function(_0x433459){_0x30f7cb[_0x919c('0x4e')]=_0x433459;if(_0x324454[_0x919c('0x3c')]['includeAll']){_0x521430[_0x919c('0x50')]=[{'all':!![]}];}return db[_0x919c('0x68')][_0x919c('0x51')](_0x521430);})['then'](function(_0x38d44f){_0x30f7cb[_0x919c('0x52')]=_0x38d44f;return _0x30f7cb;});}})['then'](respondWithFilteredResult(_0x10b3a4,_0x521430))[_0x919c('0x26')](handleError(_0x10b3a4,null));};exports[_0x919c('0x69')]=function(_0x595929,_0x537095,_0x2c3526){return db['FaxAccount'][_0x919c('0x57')]({'where':{'id':_0x595929[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x537095,null))[_0x919c('0x30')](function(_0x260c1a){if(_0x260c1a){return _0x260c1a[_0x919c('0x69')](_0x595929['query'][_0x919c('0x66')]);}})['then'](respondWithStatusCode(_0x537095,null))[_0x919c('0x26')](handleError(_0x537095,null));};exports[_0x919c('0x6a')]=function(_0x4a2e61,_0x7c89d3,_0xfb26dc){return db[_0x919c('0x6b')][_0x919c('0x57')]({'where':{'id':_0x4a2e61['params']['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x7c89d3,null))['then'](function(_0x17b58c){if(_0x17b58c){return _0x17b58c[_0x919c('0x6a')](_0x4a2e61[_0x919c('0x59')][_0x919c('0x66')],_[_0x919c('0x6c')](_0x4a2e61[_0x919c('0x59')],[_0x919c('0x66'),'id'])||{});}})[_0x919c('0x30')](respondWithResult(_0x7c89d3,null))['catch'](handleError(_0x7c89d3,null));};exports[_0x919c('0x6d')]=function(_0x33a25b,_0x59a142,_0x1a8974){var _0x285720={'raw':![],'where':{}};var _0x2f9167={};var _0x166c1a={'count':0x0,'rows':[]};return db[_0x919c('0x39')][_0x919c('0x64')]({'where':{'id':_0x33a25b[_0x919c('0x54')]['id']}})['then'](handleEntityNotFound(_0x59a142,null))['then'](function(_0x3832b1){if(_0x3832b1){_0x2f9167[_0x919c('0x3f')]=_[_0x919c('0x3b')](db[_0x919c('0x6b')]['rawAttributes']);_0x2f9167[_0x919c('0x3c')]=_['keys'](_0x33a25b[_0x919c('0x3c')]);_0x2f9167[_0x919c('0x3d')]=_[_0x919c('0x3e')](_0x2f9167[_0x919c('0x3f')],_0x2f9167[_0x919c('0x3c')]);_0x285720[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x2f9167[_0x919c('0x3f')],qs[_0x919c('0x41')](_0x33a25b['query'][_0x919c('0x41')]));_0x285720[_0x919c('0x40')]=_0x285720[_0x919c('0x40')][_0x919c('0x56')]?_0x285720[_0x919c('0x40')]:_0x2f9167[_0x919c('0x3f')];if(!_0x33a25b[_0x919c('0x3c')]['hasOwnProperty'](_0x919c('0x43'))){_0x285720[_0x919c('0x2b')]=qs['limit'](_0x33a25b[_0x919c('0x3c')]['limit']);_0x285720['offset']=qs[_0x919c('0x2a')](_0x33a25b['query'][_0x919c('0x2a')]);}_0x285720['order']=qs[_0x919c('0x45')](_0x33a25b[_0x919c('0x3c')][_0x919c('0x45')]);_0x285720[_0x919c('0x46')]=qs[_0x919c('0x3d')](_[_0x919c('0x47')](_0x33a25b['query'],_0x2f9167[_0x919c('0x3d')]));_0x285720[_0x919c('0x46')][_0x919c('0x61')]=_0x3832b1['id'];if(_0x33a25b['query']['filter']){_0x285720[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x285720[_0x919c('0x46')],{'$or':_[_0x919c('0x49')](_0x285720[_0x919c('0x40')],function(_0x3c4acd){var _0x127cb9={};_0x127cb9[_0x3c4acd]={'$like':'%'+_0x33a25b[_0x919c('0x3c')]['filter']+'%'};return _0x127cb9;})});}_0x285720=_[_0x919c('0x4c')]({},_0x285720,_0x33a25b[_0x919c('0x4d')]);return db[_0x919c('0x6b')]['count']({'where':_0x285720[_0x919c('0x46')]})[_0x919c('0x30')](function(_0x539672){_0x166c1a[_0x919c('0x4e')]=_0x539672;if(_0x33a25b[_0x919c('0x3c')][_0x919c('0x4f')]){_0x285720['include']=[{'model':db[_0x919c('0x6e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x919c('0x6f'),'attributes':[_0x919c('0x35'),_0x919c('0x70'),_0x919c('0x71')],'required':![]},{'model':db['Tag'],'as':_0x919c('0x72'),'attributes':['id',_0x919c('0x35'),_0x919c('0x73')],'where':_0x33a25b[_0x919c('0x3c')][_0x919c('0x74')]?{'id':_0x33a25b['query'][_0x919c('0x74')]}:undefined,'required':_0x33a25b[_0x919c('0x3c')]['tag']?!![]:![]}];}return db[_0x919c('0x6b')][_0x919c('0x51')](_0x285720);})[_0x919c('0x30')](function(_0xbac81a){_0x166c1a['rows']=_0xbac81a;return _0x166c1a;});}})[_0x919c('0x30')](respondWithFilteredResult(_0x59a142,_0x285720))['catch'](handleError(_0x59a142,null));};exports[_0x919c('0x75')]=function(_0x358eed,_0x5a742e,_0x2bd58a){return db[_0x919c('0x39')]['findOne']({'where':{'id':_0x358eed[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x5a742e,null))[_0x919c('0x30')](function(_0x30714d){if(_0x30714d){return db[_0x919c('0x76')][_0x919c('0x77')](function(_0x23cad5){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x358eed[_0x919c('0x54')]['id']},'transaction':_0x23cad5})[_0x919c('0x30')](function(_0x221488){var _0x96da4d=_[_0x919c('0x49')](_0x358eed['body'],function(_0x5e794a){_0x5e794a['FaxAccountId']=_0x358eed[_0x919c('0x54')]['id'];return _0x5e794a;});return db['FaxApplication'][_0x919c('0x78')](_0x96da4d,{'transaction':_0x23cad5});});})[_0x919c('0x30')](function(){return db[_0x919c('0x79')][_0x919c('0x7a')]({'where':{'FaxAccountId':_0x358eed[_0x919c('0x54')]['id']},'order':_0x919c('0x7b')});});}})['then'](respondWithResult(_0x5a742e,null))['catch'](handleError(_0x5a742e,null));};exports[_0x919c('0x7c')]=function(_0x1a20af,_0x3b93ec,_0x2a6527){var _0x5e465f={};var _0x335401={};var _0x14570b;var _0x4613b9;return db['FaxAccount']['findOne']({'where':{'id':_0x1a20af[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x3b93ec,null))[_0x919c('0x30')](function(_0x615e9c){if(_0x615e9c){_0x14570b=_0x615e9c;_0x335401[_0x919c('0x3f')]=_[_0x919c('0x3b')](db[_0x919c('0x79')][_0x919c('0x3a')]);_0x335401['query']=_[_0x919c('0x3b')](_0x1a20af[_0x919c('0x3c')]);_0x335401[_0x919c('0x3d')]=_['intersection'](_0x335401[_0x919c('0x3f')],_0x335401[_0x919c('0x3c')]);_0x5e465f[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x335401[_0x919c('0x3f')],qs['fields'](_0x1a20af[_0x919c('0x3c')][_0x919c('0x41')]));_0x5e465f[_0x919c('0x40')]=_0x5e465f['attributes'][_0x919c('0x56')]?_0x5e465f[_0x919c('0x40')]:_0x335401[_0x919c('0x3f')];_0x5e465f[_0x919c('0x44')]=qs[_0x919c('0x45')](_0x1a20af[_0x919c('0x3c')][_0x919c('0x45')]);_0x5e465f['where']=qs[_0x919c('0x3d')](_['pick'](_0x1a20af[_0x919c('0x3c')],_0x335401[_0x919c('0x3d')]));if(_0x1a20af['query']['filter']){_0x5e465f[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x5e465f[_0x919c('0x46')],{'$or':_['map'](_0x5e465f[_0x919c('0x40')],function(_0x1b624d){var _0x3aae28={};_0x3aae28[_0x1b624d]={'$like':'%'+_0x1a20af[_0x919c('0x3c')][_0x919c('0x48')]+'%'};return _0x3aae28;})});}_0x5e465f=_[_0x919c('0x4c')]({},_0x5e465f,_0x1a20af[_0x919c('0x4d')]);return _0x14570b[_0x919c('0x7c')](_0x5e465f);}})[_0x919c('0x30')](function(_0x158592){if(_0x158592){_0x4613b9=_0x158592['length'];if(!_0x1a20af[_0x919c('0x3c')]['hasOwnProperty'](_0x919c('0x43'))){_0x5e465f['limit']=qs[_0x919c('0x2b')](_0x1a20af[_0x919c('0x3c')][_0x919c('0x2b')]);_0x5e465f[_0x919c('0x2a')]=qs[_0x919c('0x2a')](_0x1a20af[_0x919c('0x3c')]['offset']);}return _0x14570b[_0x919c('0x7c')](_0x5e465f);}})[_0x919c('0x30')](function(_0x28753f){if(_0x28753f){return _0x28753f?{'count':_0x4613b9,'rows':_0x28753f}:null;}})[_0x919c('0x30')](respondWithResult(_0x3b93ec,null))[_0x919c('0x26')](handleError(_0x3b93ec,null));};function Extension(_0x4dc846,_0x492c56,_0x99145e,_0x13a933){this['context']=_0x919c('0x7d');this[_0x919c('0x7e')]=_0x4dc846[_0x919c('0x7f')];this['app']=_0x13a933;this[_0x919c('0x80')]=_0x919c('0x81');this['description']='Fax\x20Extension';this[_0x919c('0x61')]=_0x4dc846['id'];this['priority']=_0x492c56;this['appdata']=_0x99145e;}function createExtensionsReciveFax(_0x48d378){var _0x43dbf5=0x1;var _0x50aaf2=[];_0x50aaf2[_0x919c('0x82')](new Extension(_0x48d378,_0x43dbf5,'',_0x919c('0x83')));_0x43dbf5+=0x1;_0x50aaf2[_0x919c('0x82')](new Extension(_0x48d378,_0x43dbf5,'CDR(type)=inbound-fax',_0x919c('0x84')));_0x43dbf5+=0x1;for(var _0x22d0d0 in _0x48d378){if(_0x48d378[_0x919c('0x42')](_0x22d0d0)&&(_0x22d0d0===_0x919c('0x85')||_0x22d0d0===_0x919c('0x7f')||_0x22d0d0===_0x919c('0x86')||_0x22d0d0===_0x919c('0x87')||_0x22d0d0===_0x919c('0x88')||_0x22d0d0==='maxrate'||_0x22d0d0===_0x919c('0x89')||_0x22d0d0===_0x919c('0x8a')||_0x22d0d0===_0x919c('0x8b'))){_0x50aaf2['push'](new Extension(_0x48d378,_0x43dbf5,_0x919c('0x8c')+_0x22d0d0+')='+_0x48d378[_0x22d0d0],_0x919c('0x84')));_0x43dbf5+=0x1;}}_0x50aaf2[_0x919c('0x82')](new Extension(_0x48d378,_0x43dbf5,'6','Wait'));_0x43dbf5+=0x1;_0x50aaf2[_0x919c('0x82')](new Extension(_0x48d378,_0x43dbf5,_0x919c('0x8d'),_0x919c('0x8e')));_0x43dbf5=0x0;return _0x50aaf2;}exports[_0x919c('0x8f')]=function(_0x403710,_0x33cffd,_0x439ef0){var _0x8245f7;return db[_0x919c('0x76')][_0x919c('0x77')](function(_0x3b0d53){return db[_0x919c('0x39')][_0x919c('0x58')](_0x403710['body'],{'transaction':_0x3b0d53})['then'](function(_0x2e07d9){_0x8245f7=_0x2e07d9['get']({'plain':!![]});return db[_0x919c('0x90')]['bulkCreate'](createExtensionsReciveFax(_0x8245f7),{'transaction':_0x3b0d53});});})[_0x919c('0x30')](function(){return _0x8245f7;})[_0x919c('0x30')](respondWithResult(_0x33cffd,null))[_0x919c('0x26')](handleError(_0x33cffd,null));};exports[_0x919c('0x91')]=function(_0x5ecc82,_0x550c50,_0x5988ad){var _0x372600;return db[_0x919c('0x76')][_0x919c('0x77')](function(_0x256df7){return db[_0x919c('0x39')]['update'](_0x5ecc82['body'],{'where':{'id':_0x5ecc82[_0x919c('0x59')]['id']},'transaction':_0x256df7})[_0x919c('0x30')](function(_0x5138cc){return db[_0x919c('0x90')][_0x919c('0x31')]({'where':{'FaxAccountId':_0x5ecc82['body']['id']},'transaction':_0x256df7})[_0x919c('0x30')](function(_0x3773cc){return db[_0x919c('0x90')][_0x919c('0x78')](createExtensionsReciveFax(_[_0x919c('0x6c')](_0x5ecc82[_0x919c('0x59')],[_0x919c('0x92'),_0x919c('0x4a'),_0x919c('0x93'),'updatedAt',_0x919c('0x94'),_0x919c('0x95')])),{'transaction':_0x256df7});});});})[_0x919c('0x30')](function(){return db[_0x919c('0x39')][_0x919c('0x96')](_0x5ecc82[_0x919c('0x59')]['id']);})['then'](respondWithResult(_0x550c50,null))[_0x919c('0x26')](handleError(_0x550c50,null));};exports[_0x919c('0x97')]=function(_0x5130fe,_0x5cd9b9,_0x45cc43){var _0x562298={'raw':!![],'where':{}};var _0x888fe1={};var _0x283cee={'count':0x0,'rows':[]};return db[_0x919c('0x39')]['findOne']({'where':{'id':_0x5130fe[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x5cd9b9,null))[_0x919c('0x30')](function(_0x3bd7a2){if(_0x3bd7a2){_0x888fe1['model']=_['keys'](db['FaxMessage'][_0x919c('0x3a')]);_0x888fe1[_0x919c('0x3c')]=_[_0x919c('0x3b')](_0x5130fe['query']);_0x888fe1['filters']=_[_0x919c('0x3e')](_0x888fe1['model'],_0x888fe1[_0x919c('0x3c')]);_0x562298[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x888fe1[_0x919c('0x3f')],qs[_0x919c('0x41')](_0x5130fe[_0x919c('0x3c')][_0x919c('0x41')]));_0x562298['attributes']=_0x562298[_0x919c('0x40')][_0x919c('0x56')]?_0x562298[_0x919c('0x40')]:_0x888fe1[_0x919c('0x3f')];if(!_0x5130fe[_0x919c('0x3c')][_0x919c('0x42')]('nolimit')){_0x562298[_0x919c('0x2b')]=qs[_0x919c('0x2b')](_0x5130fe[_0x919c('0x3c')]['limit']);_0x562298[_0x919c('0x2a')]=qs[_0x919c('0x2a')](_0x5130fe[_0x919c('0x3c')][_0x919c('0x2a')]);}_0x562298[_0x919c('0x44')]=qs[_0x919c('0x45')](_0x5130fe[_0x919c('0x3c')][_0x919c('0x45')]);_0x562298['where']=qs['filters'](_[_0x919c('0x47')](_0x5130fe['query'],_0x888fe1[_0x919c('0x3d')]));_0x562298[_0x919c('0x46')][_0x919c('0x61')]=_0x3bd7a2['id'];if(_0x5130fe[_0x919c('0x3c')]['filter']){_0x562298[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x562298[_0x919c('0x46')],{'$or':_[_0x919c('0x49')](_0x562298[_0x919c('0x40')],function(_0x21aeab){var _0x32da1a={};_0x32da1a[_0x21aeab]={'$like':'%'+_0x5130fe['query']['filter']+'%'};return _0x32da1a;})});}if(_0x5130fe[_0x919c('0x3c')][_0x919c('0x98')]){var _0x5e9ceb=_0x5130fe['query'][_0x919c('0x98')][_0x919c('0x99')](',');var _0x221790={};_0x221790[_0x5e9ceb[0x0]]={'$gte':moment(_0x5e9ceb[0x1])[_0x919c('0x9a')](_0x919c('0x9b'))};_0x562298[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x562298[_0x919c('0x46')],_0x221790);}_0x562298=_[_0x919c('0x4c')]({},_0x562298,_0x5130fe[_0x919c('0x4d')]);return db[_0x919c('0x9c')][_0x919c('0x4e')]({'where':_0x562298[_0x919c('0x46')]})[_0x919c('0x30')](function(_0x3bc926){_0x283cee[_0x919c('0x4e')]=_0x3bc926;if(_0x5130fe[_0x919c('0x3c')][_0x919c('0x4f')]){_0x562298[_0x919c('0x50')]=[{'all':!![]}];}return db[_0x919c('0x9c')][_0x919c('0x51')](_0x562298);})['then'](function(_0x12c28a){_0x283cee['rows']=_0x12c28a;return _0x283cee;});}})[_0x919c('0x30')](respondWithFilteredResult(_0x5cd9b9,_0x562298))['catch'](handleError(_0x5cd9b9,null));};exports[_0x919c('0x36')]=function(_0x211d07,_0x41c1bb,_0x25e00d){var _0x4b3019,_0x2120e8={},_0x4868df;if(_0x211d07['body']['to']){_0x4868df=_0x211d07[_0x919c('0x59')]['to'][0x0];}return db['FaxAccount'][_0x919c('0x57')]({'where':{'id':_0x211d07[_0x919c('0x54')]['id']},'include':[{'model':db[_0x919c('0x9d')],'as':_0x919c('0x9e'),'include':[{'model':db['CmContact'],'as':_0x919c('0x9f'),'where':{'fax':_0x4868df},'limit':0x1,'order':[['updatedAt',_0x919c('0xa0')]]}]}]})[_0x919c('0x30')](handleEntityNotFound(_0x41c1bb,null))[_0x919c('0x30')](function(_0x3d1d0c){_0x4b3019=_0x3d1d0c;if(_0x211d07[_0x919c('0x59')][_0x919c('0xa1')]&&_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][_0x919c('0x56')]){for(var _0x45948c=0x0;_0x45948c<_0x211d07['body']['attachments']['length'];_0x45948c+=0x1){_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][_0x45948c]={'filename':_0x211d07['body']['attachments'][_0x45948c][_0x919c('0x35')],'id':_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][_0x45948c]['id'],'path':path[_0x919c('0xa2')](config[_0x919c('0xa3')],_0x919c('0xa4'),_0x211d07['body']['attachments'][_0x45948c][_0x919c('0xa5')])};}}return respondWithRpcPromise(_0x919c('0xa6'),_0x919c('0xa6'),{'FaxAccountId':_[_0x919c('0xa7')](_0x211d07['params']['id'])?undefined:_0x211d07['params']['id'],'path':_[_0x919c('0xa7')](_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0][_0x919c('0x7')])?undefined:_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0][_0x919c('0x7')],'fax':_[_0x919c('0xa7')](_0x211d07[_0x919c('0x59')]['to'][0x0])?undefined:_0x211d07[_0x919c('0x59')]['to'][0x0]},client9002);})[_0x919c('0x30')](function(){if(_0x4b3019){if(_[_0x919c('0xa7')](_0x211d07[_0x919c('0x59')]['from'])){_0x211d07[_0x919c('0x59')]['from']=util[_0x919c('0x9a')](_0x919c('0xa8'),_0x4b3019['name'],_0x4b3019[_0x919c('0xa9')]);}if(_0x4b3019[_0x919c('0x9e')]){if(_0x4b3019[_0x919c('0x9e')][_0x919c('0x9f')][_0x919c('0x56')]){return _0x4b3019['List']['Contacts'][0x0];}else{return db[_0x919c('0x6e')]['create'](_[_0x919c('0x15')](_0x211d07[_0x919c('0x59')],{'firstName':_0x211d07[_0x919c('0x59')]['to'][0x0],'phone':_0x211d07[_0x919c('0x59')]['to'][0x0],'fax':_0x211d07[_0x919c('0x59')]['to'][0x0],'ListId':_0x4b3019[_0x919c('0x95')]}));}}else{throw new Error(_0x919c('0xaa'));}}else{throw new Error(_0x919c('0xab'));}})[_0x919c('0x30')](function(_0x40a9aa){if(_0x40a9aa){return db[_0x919c('0x6b')][_0x919c('0x57')]({'where':{'ContactId':_0x40a9aa['id'],'closed':![],'FaxAccountId':_0x4b3019['id']}})[_0x919c('0x30')](function(_0x5d4ed9){if(_0x5d4ed9){return[_0x5d4ed9,![]];}return db[_0x919c('0x6b')][_0x919c('0x58')]({'UserId':_0x211d07['user']['id'],'ContactId':_0x40a9aa['id'],'FaxAccountId':_0x4b3019['id'],'fax':_0x211d07[_0x919c('0x59')]['to'][0x0],'firstMsgDirection':_0x919c('0xac'),'Messages':[_[_0x919c('0x4c')](_0x211d07[_0x919c('0x59')],{'read':![],'body':_0x211d07['body'][_0x919c('0xa1')][0x0][_0x919c('0xad')],'FaxAccountId':_0x4b3019['id'],'UserId':_0x211d07['user']['id'],'ContactId':_0x40a9aa['id'],'AttachmentId':_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x919c('0x9c')],'as':_0x919c('0xae')}]})['then'](function(_0x3f88b7){return[_0x3f88b7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x21f01b,_0x1b67f7){if(_0x1b67f7){return _0x21f01b;}return db[_0x919c('0x9c')][_0x919c('0x58')]({'direction':_0x919c('0xac'),'read':![],'body':_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0][_0x919c('0xad')],'FaxAccountId':_0x4b3019['id'],'FaxInteractionId':_0x21f01b['id'],'UserId':_0x211d07['user']['id'],'ContactId':_0x21f01b[_0x919c('0xaf')],'AttachmentId':_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0]['id']})[_0x919c('0x30')](function(_0x3184d5){_0x21f01b[_0x919c('0xb0')][_0x919c('0xae')]=[];_0x21f01b['dataValues'][_0x919c('0xae')]['push'](_0x3184d5['dataValues']);return _0x21f01b;});})[_0x919c('0x30')](function(_0x4cc836){respondWithRpcPromise(_0x919c('0xb1'),'SendFax',{'FaxAccountId':_[_0x919c('0xa7')](_0x211d07[_0x919c('0x54')]['id'])?undefined:_0x211d07[_0x919c('0x54')]['id'],'path':_[_0x919c('0xa7')](_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0][_0x919c('0x7')])?undefined:_0x211d07['body'][_0x919c('0xa1')][0x0][_0x919c('0x7')],'fax':_['isNil'](_0x211d07[_0x919c('0x59')]['to'][0x0])?undefined:_0x211d07[_0x919c('0x59')]['to'][0x0],'AttachmentId':_0x211d07[_0x919c('0x59')][_0x919c('0xa1')][0x0]['id']},client9002)['then'](function(_0x893f52){logger[_0x919c('0x1d')](_0x919c('0xb2'),_0x893f52);})[_0x919c('0x26')](function(_0x3306b6){logger[_0x919c('0x1d')](_0x919c('0xb2'),_0x3306b6);});return _0x4cc836;})['then'](respondWithResult(_0x41c1bb,null))[_0x919c('0x26')](handleError(_0x41c1bb,null));};exports[_0x919c('0xb3')]=function(_0xb1c720,_0x116dbb,_0xcaf977){return db[_0x919c('0x39')][_0x919c('0x57')]({'where':{'id':_0xb1c720[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x116dbb,null))['then'](function(_0x5e3f5a){if(_0x5e3f5a){return _0x5e3f5a['addAgents'](_0xb1c720[_0x919c('0x59')][_0x919c('0x66')],_[_0x919c('0x6c')](_0xb1c720[_0x919c('0x59')],[_0x919c('0x66'),'id'])||{})[_0x919c('0xb4')](function(_0x1ddc44){for(var _0x275081=0x0;_0x275081<_0xb1c720[_0x919c('0x59')][_0x919c('0x66')][_0x919c('0x56')];_0x275081+=0x1){socket[_0x919c('0xb5')](_0x919c('0xb6'),{'UserId':_0xb1c720[_0x919c('0x59')]['ids'][_0x275081],'FaxAccountId':_0xb1c720[_0x919c('0x54')]['id']});}return _0x1ddc44;});}})[_0x919c('0x30')](respondWithResult(_0x116dbb,null))[_0x919c('0x26')](handleError(_0x116dbb,null));};exports[_0x919c('0xb7')]=function(_0xe75a3f,_0x457d8d,_0x333432){return db[_0x919c('0x39')]['find']({'where':{'id':_0xe75a3f[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x457d8d,null))[_0x919c('0x30')](function(_0x25ce02){if(_0x25ce02){return _0x25ce02['removeAgents'](_0xe75a3f[_0x919c('0x3c')]['ids'])[_0x919c('0x30')](function(){if(_[_0x919c('0xb8')](_0xe75a3f[_0x919c('0x3c')][_0x919c('0x66')])){for(var _0x2dd152=0x0;_0x2dd152<_0xe75a3f[_0x919c('0x3c')][_0x919c('0x66')][_0x919c('0x56')];_0x2dd152+=0x1){socket[_0x919c('0xb5')](_0x919c('0xb9'),{'UserId':Number(_0xe75a3f[_0x919c('0x3c')]['ids'][_0x2dd152]),'FaxAccountId':Number(_0xe75a3f[_0x919c('0x54')]['id'])});}}else{socket[_0x919c('0xb5')](_0x919c('0xb9'),{'UserId':Number(_0xe75a3f['query']['ids']),'FaxAccountId':Number(_0xe75a3f[_0x919c('0x54')]['id'])});}});}})[_0x919c('0x30')](respondWithStatusCode(_0x457d8d,null))[_0x919c('0x26')](handleError(_0x457d8d,null));};exports['getAgents']=function(_0x1b2fc6,_0x254a23,_0x38cc52){var _0x562f7f={};var _0x1cee65={};var _0x516554;var _0x874e16;return db[_0x919c('0x39')][_0x919c('0x64')]({'where':{'id':_0x1b2fc6[_0x919c('0x54')]['id']}})[_0x919c('0x30')](handleEntityNotFound(_0x254a23,null))['then'](function(_0x9c8471){if(_0x9c8471){_0x516554=_0x9c8471;_0x1cee65[_0x919c('0x3f')]=_[_0x919c('0x3b')](db[_0x919c('0xba')][_0x919c('0x3a')]);_0x1cee65[_0x919c('0x3c')]=_[_0x919c('0x3b')](_0x1b2fc6[_0x919c('0x3c')]);_0x1cee65['filters']=_['intersection'](_0x1cee65['model'],_0x1cee65[_0x919c('0x3c')]);_0x562f7f[_0x919c('0x40')]=_[_0x919c('0x3e')](_0x1cee65[_0x919c('0x3f')],qs['fields'](_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x41')]));_0x562f7f['attributes']=_0x562f7f[_0x919c('0x40')][_0x919c('0x56')]?_0x562f7f[_0x919c('0x40')]:_0x1cee65[_0x919c('0x3f')];_0x562f7f['order']=qs[_0x919c('0x45')](_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x45')]);_0x562f7f[_0x919c('0x46')]=qs[_0x919c('0x3d')](_['pick'](_0x1b2fc6[_0x919c('0x3c')],_0x1cee65[_0x919c('0x3d')]));if(_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x48')]){_0x562f7f[_0x919c('0x46')]=_[_0x919c('0x4c')](_0x562f7f[_0x919c('0x46')],{'$or':_[_0x919c('0x49')](_0x562f7f[_0x919c('0x40')],function(_0x1d9104){var _0x5667ac={};_0x5667ac[_0x1d9104]={'$like':'%'+_0x1b2fc6['query'][_0x919c('0x48')]+'%'};return _0x5667ac;})});}_0x562f7f=_['merge']({},_0x562f7f,_0x1b2fc6[_0x919c('0x4d')]);return _0x516554[_0x919c('0xbb')](_0x562f7f);}})[_0x919c('0x30')](function(_0x1c99f5){if(_0x1c99f5){_0x874e16=_0x1c99f5[_0x919c('0x56')];if(!_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x42')]('nolimit')){_0x562f7f[_0x919c('0x2b')]=qs[_0x919c('0x2b')](_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x2b')]);_0x562f7f['offset']=qs[_0x919c('0x2a')](_0x1b2fc6[_0x919c('0x3c')][_0x919c('0x2a')]);}return _0x516554[_0x919c('0xbb')](_0x562f7f);}})['then'](function(_0x31fabf){if(_0x31fabf){return _0x31fabf?{'count':_0x874e16,'rows':_0x31fabf}:null;}})['then'](respondWithResult(_0x254a23,null))[_0x919c('0x26')](handleError(_0x254a23,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 0987e26..9833288 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 _0x6196=['events','FaxAccount','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x6196,0xfc));var _0x6619=function(_0x47bbcf,_0x33ce5e){_0x47bbcf=_0x47bbcf-0x0;var _0x10f7b7=_0x6196[_0x47bbcf];return _0x10f7b7;};'use strict';var EventEmitter=require(_0x6619('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x6619('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6619('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6619('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1401cc){return function(_0x4acbc4,_0x48acba,_0x24af04){FaxAccountEvents[_0x6619('0x4')](_0x1401cc+':'+_0x4acbc4['id'],_0x4acbc4);FaxAccountEvents[_0x6619('0x4')](_0x1401cc,_0x4acbc4);_0x24af04(null);};}for(var e in events){if(events[_0x6619('0x5')](e)){var event=events[e];FaxAccount[_0x6619('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x744b=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x744b,0xf2));var _0xb744=function(_0x1d8295,_0xeb509d){_0x1d8295=_0x1d8295-0x0;var _0x259513=_0x744b[_0x1d8295];return _0x259513;};'use strict';var EventEmitter=require(_0xb744('0x0'));var FaxAccount=require(_0xb744('0x1'))['db'][_0xb744('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb744('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb744('0x4'),'afterDestroy':_0xb744('0x5')};function emitEvent(_0x5c110f){return function(_0x18f004,_0x4c0e03,_0x25c29b){FaxAccountEvents[_0xb744('0x6')](_0x5c110f+':'+_0x18f004['id'],_0x18f004);FaxAccountEvents[_0xb744('0x6')](_0x5c110f,_0x18f004);_0x25c29b(null);};}for(var e in events){if(events[_0xb744('0x7')](e)){var event=events[e];FaxAccount[_0xb744('0x8')](e,emitEvent(event));}}module[_0xb744('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2199a24..443d92c 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 _0x26bb=['define','FaxAccount','lodash','util','api','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes'];(function(_0x28a3d2,_0xa20401){var _0x2a3494=function(_0x5341e2){while(--_0x5341e2){_0x28a3d2['push'](_0x28a3d2['shift']());}};_0x2a3494(++_0xa20401);}(_0x26bb,0x8e));var _0xb26b=function(_0x3c3e37,_0x328f11){_0x3c3e37=_0x3c3e37-0x0;var _0x547fe1=_0x26bb[_0x3c3e37];return _0x547fe1;};'use strict';var _=require(_0xb26b('0x0'));var util=require(_0xb26b('0x1'));var logger=require('../../config/logger')(_0xb26b('0x2'));var moment=require('moment');var BPromise=require(_0xb26b('0x3'));var rp=require(_0xb26b('0x4'));var fs=require('fs');var path=require(_0xb26b('0x5'));var rimraf=require('rimraf');var config=require(_0xb26b('0x6'));var attributes=require(_0xb26b('0x7'));module['exports']=function(_0x55a597,_0x1f14bd){return _0x55a597[_0xb26b('0x8')](_0xb26b('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2b3=['./faxAccount.attributes','define','fax_accounts','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x34fbff,_0x1c37c4){var _0x3f37c7=function(_0x2225d0){while(--_0x2225d0){_0x34fbff['push'](_0x34fbff['shift']());}};_0x3f37c7(++_0x1c37c4);}(_0xd2b3,0x67));var _0x3d2b=function(_0x532ebf,_0x299c3b){_0x532ebf=_0x532ebf-0x0;var _0x1c6467=_0xd2b3[_0x532ebf];return _0x1c6467;};'use strict';var _=require(_0x3d2b('0x0'));var util=require(_0x3d2b('0x1'));var logger=require('../../config/logger')(_0x3d2b('0x2'));var moment=require(_0x3d2b('0x3'));var BPromise=require('bluebird');var rp=require(_0x3d2b('0x4'));var fs=require('fs');var path=require(_0x3d2b('0x5'));var rimraf=require(_0x3d2b('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d2b('0x7'));module['exports']=function(_0xbddb57,_0xf3b73c){return _0xbddb57[_0x3d2b('0x8')]('FaxAccount',attributes,{'tableName':_0x3d2b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 50e8547..e333531 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 _0x035c=['ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','updatedAt','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','defaults','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./faxAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','FaxAccount','options','raw','attributes','limit','include','model','map','GetFaxAccount','catch','NotifyFaxAccount','fax','CmContact','Sequelize'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0x035c,0x87));var _0xc035=function(_0x4989d4,_0x2173ae){_0x4989d4=_0x4989d4-0x0;var _0x562420=_0x035c[_0x4989d4];return _0x562420;};'use strict';var _=require(_0xc035('0x0'));var util=require(_0xc035('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc035('0x2'));var fs=require('fs');var Redis=require(_0xc035('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc035('0x4'))(_0xc035('0x5'));var config=require(_0xc035('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc035('0x7')][_0xc035('0x8')]({'port':0x232c});config[_0xc035('0x9')]=_['defaults'](config[_0xc035('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc035('0xa'))(new Redis(config['redis']));require(_0xc035('0xb'))['register'](socket);function respondWithRpcPromise(_0x24e746,_0x3b5f20,_0x4128e8){return new BPromise(function(_0x246cd5,_0x7b0ac5){return client[_0xc035('0xc')](_0x24e746,_0x4128e8)[_0xc035('0xd')](function(_0xe3bbca){logger[_0xc035('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3b5f20,_0xc035('0xf'));logger[_0xc035('0x10')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3b5f20,'request\x20sent',JSON[_0xc035('0x11')](_0xe3bbca));if(_0xe3bbca['error']){if(_0xe3bbca[_0xc035('0x12')][_0xc035('0x13')]===0x1f4){logger[_0xc035('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3b5f20,_0xe3bbca[_0xc035('0x12')][_0xc035('0x14')]);return _0x7b0ac5(_0xe3bbca[_0xc035('0x12')]['message']);}logger[_0xc035('0x12')](_0xc035('0x15'),_0x3b5f20,_0xe3bbca[_0xc035('0x12')][_0xc035('0x14')]);return _0x246cd5(_0xe3bbca[_0xc035('0x12')]['message']);}else{logger[_0xc035('0xe')]('FaxAccount,\x20%s,\x20%s',_0x3b5f20,_0xc035('0xf'));_0x246cd5(_0xe3bbca[_0xc035('0x16')][_0xc035('0x14')]);}})['catch'](function(_0x5af500){logger[_0xc035('0x12')](_0xc035('0x15'),_0x3b5f20,_0x5af500);_0x7b0ac5(_0x5af500);});});}exports['GetFaxAccount']=function(_0x2bbe65){var _0x2882c3=this;return new Promise(function(_0x2dff4a,_0x34a4a5){return db[_0xc035('0x17')]['findAll']({'raw':_0x2bbe65[_0xc035('0x18')]?_0x2bbe65[_0xc035('0x18')][_0xc035('0x19')]===undefined?!![]:![]:!![],'where':_0x2bbe65[_0xc035('0x18')]?_0x2bbe65['options']['where']||null:null,'attributes':_0x2bbe65[_0xc035('0x18')]?_0x2bbe65[_0xc035('0x18')][_0xc035('0x1a')]||null:null,'limit':_0x2bbe65[_0xc035('0x18')]?_0x2bbe65[_0xc035('0x18')][_0xc035('0x1b')]||null:null,'include':_0x2bbe65[_0xc035('0x18')]?_0x2bbe65[_0xc035('0x18')][_0xc035('0x1c')]?_['map'](_0x2bbe65[_0xc035('0x18')][_0xc035('0x1c')],function(_0x3959aa){return{'model':db[_0x3959aa[_0xc035('0x1d')]],'as':_0x3959aa['as'],'attributes':_0x3959aa[_0xc035('0x1a')],'include':_0x3959aa[_0xc035('0x1c')]?_['map'](_0x3959aa[_0xc035('0x1c')],function(_0x361dfe){return{'model':db[_0x361dfe['model']],'as':_0x361dfe['as'],'attributes':_0x361dfe[_0xc035('0x1a')],'include':_0x361dfe[_0xc035('0x1c')]?_[_0xc035('0x1e')](_0x361dfe[_0xc035('0x1c')],function(_0x480f9b){return{'model':db[_0x480f9b[_0xc035('0x1d')]],'as':_0x480f9b['as'],'attributes':_0x480f9b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44078d){logger[_0xc035('0xe')](_0xc035('0x1f'),_0x2bbe65);logger[_0xc035('0x10')]('GetFaxAccount',_0x2bbe65,JSON[_0xc035('0x11')](_0x44078d));_0x2dff4a(_0x44078d);})[_0xc035('0x20')](function(_0x3b48cb){logger[_0xc035('0x12')](_0xc035('0x1f'),_0x3b48cb['message'],_0x2bbe65);_0x34a4a5(_0x2882c3['error'](0x1f4,_0x3b48cb['message']));});});};exports[_0xc035('0x21')]=function(_0x40a090,_0x14c1f1,_0x42aa92){var _0x5158a2=this;return new Promise(function(_0x2110a6,_0x22520c){var _0x2d16fe={'body':_0x40a090['body'],'channel':_0xc035('0x22')};var _0x477c3a=[];var _0x35986b=[];var _0x1ff30a={};return db[_0xc035('0x23')]['describe']()['then'](function(_0x3eb014){if(!_0x3eb014){throw new db[(_0xc035('0x24'))][(_0xc035('0x25'))](_0xc035('0x26'));}_0x477c3a=_['difference'](_['keys'](_0x3eb014),['createdAt','updatedAt']);_0x35986b=_[_0xc035('0x27')](_['keys'](_0x3eb014),[_0xc035('0x28'),'updatedAt',_0xc035('0x29'),'ListId']);if(_0x40a090[_0xc035('0x2a')]['id']){delete _0x40a090[_0xc035('0x2a')]['id'];}if(_['isNil'](_0x40a090['body'][_0xc035('0x2b')])){throw new db[(_0xc035('0x24'))]['ValidationError'](_0xc035('0x2c'));}if(_[_0xc035('0x2d')](_0x40a090[_0xc035('0x2a')][_0xc035('0x2a')])||_0x40a090[_0xc035('0x2a')]['body']===''){throw new db[(_0xc035('0x24'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x40a090[_0xc035('0x2a')][_0xc035('0x2e')])){throw new db['Sequelize'][(_0xc035('0x25'))](_0xc035('0x2f')+_0x35986b);}if(!_['includes'](_0x35986b,_0x40a090[_0xc035('0x2a')]['mapKey'])){throw new db[(_0xc035('0x24'))][(_0xc035('0x25'))](_0xc035('0x30')+_0x35986b);}_0x1ff30a[_0x40a090[_0xc035('0x2a')][_0xc035('0x2e')]]=_0x40a090[_0xc035('0x2a')][_0xc035('0x2b')];})[_0xc035('0xd')](function(){return db[_0xc035('0x17')][_0xc035('0x31')]({'where':{'id':_0x40a090[_0xc035('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0xc035('0x33'),'include':[{'model':db[_0xc035('0x23')],'as':'Contacts','where':_0x1ff30a,'limit':0x1,'order':[[_0xc035('0x34'),_0xc035('0x35')]]}]},{'model':db[_0xc035('0x36')],'as':_0xc035('0x37')}]});})[_0xc035('0xd')](function(_0x388d16){if(_0x388d16&&_0x388d16[_0xc035('0x33')]){var _0x167ab8=_0x388d16[_0xc035('0x38')]({'plain':!![]});_0x2d16fe[_0xc035('0x32')]=_0x167ab8;_0x2d16fe[_0xc035('0x39')]=_0x167ab8[_0xc035('0x37')];_0x2d16fe[_0xc035('0x3a')]=_0x167ab8['List'];_0x2d16fe[_0xc035('0x39')]=_[_0xc035('0x3b')](_0x2d16fe['applications'],[_0xc035('0x3c')],[_0xc035('0x3d')]);if(_0x2d16fe[_0xc035('0x32')][_0xc035('0x37')]){delete _0x2d16fe[_0xc035('0x32')][_0xc035('0x37')];}if(_0x2d16fe[_0xc035('0x32')][_0xc035('0x33')]&&_0x2d16fe['account'][_0xc035('0x33')][_0xc035('0x3e')][_0xc035('0x3f')]){return _0x2d16fe[_0xc035('0x32')][_0xc035('0x33')][_0xc035('0x3e')][0x0];}var _0x12b5b5=_[_0xc035('0x40')](_0x40a090['body'],{'firstName':_0x40a090[_0xc035('0x2a')][_0xc035('0x2b')],'ListId':_0x167ab8[_0xc035('0x41')]});_0x12b5b5[_0x40a090[_0xc035('0x2a')][_0xc035('0x2e')]]=_0x40a090['body'][_0xc035('0x2b')];return db[_0xc035('0x23')][_0xc035('0x42')](_0x12b5b5,{'fields':_0x477c3a,'raw':!![]});}})[_0xc035('0xd')](function(_0x217861){_0x2d16fe[_0xc035('0x43')]=_0x217861;if(_0x217861){var _0x3741d9={'ContactId':_0x217861['id'],'FaxAccountId':_0x40a090[_0xc035('0x32')]['id'],'fax':_0x217861[_0xc035('0x22')]};return db['FaxInteraction'][_0xc035('0x31')]({'where':{'ContactId':_0x217861['id'],'closed':![],'FaxAccountId':_0x40a090[_0xc035('0x32')]['id']}})[_0xc035('0xd')](function(_0x4cc05e){if(_0x4cc05e){return[_0x4cc05e,![]];}return db[_0xc035('0x44')]['create'](_0x3741d9)[_0xc035('0xd')](function(_0x5730cb){return[_0x5730cb,!![]];});});}else{throw new Error(_0xc035('0x45'));}})['spread'](function(_0x3611ee,_0x4886f3){var _0x44ff0e=_0x3611ee[_0xc035('0x38')]({'plain':!![]});if(_0x4886f3){if(_0x2d16fe['account'][_0xc035('0x46')]){_0x2d16fe[_0xc035('0x39')][_0xc035('0x47')]({'id':0x0,'priority':_0x2d16fe['applications'][_0xc035('0x3f')]+0x1,'app':_0xc035('0x48'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x44ff0e[_0xc035('0x49')]=!![];}else{_0x44ff0e[_0xc035('0x49')]=![];}_0x2d16fe[_0xc035('0x4a')]=_0x44ff0e;return db[_0xc035('0x4b')][_0xc035('0x42')]({'body':_0x40a090[_0xc035('0x2a')][_0xc035('0x2a')],'FaxAccountId':_0x40a090[_0xc035('0x32')]['id'],'FaxInteractionId':_0x3611ee['id'],'direction':'in','ContactId':_0x3611ee[_0xc035('0x4c')],'AttachmentId':_0x40a090[_0xc035('0x2a')][_0xc035('0x4d')]});})[_0xc035('0xd')](function(_0x4be9f0){_0x2d16fe[_0xc035('0x14')]=_0x4be9f0;if(_0x2d16fe[_0xc035('0x4a')][_0xc035('0x4e')]){return db['User'][_0xc035('0x31')]({'attributes':['id',_0xc035('0x4f')],'where':{'id':_0x2d16fe[_0xc035('0x4a')][_0xc035('0x4e')]}})[_0xc035('0xd')](function(_0x5c5fab){if(_0x5c5fab){_0x2d16fe['applications'][_0xc035('0x50')]({'id':0x0,'priority':0x0,'app':_0xc035('0x51'),'appdata':_0x5c5fab['name']+','+(_0x2d16fe[_0xc035('0x32')][_0xc035('0x52')]||0xa),'interval':_0xc035('0x53')});}return respondWithRpcPromise(_0xc035('0x54'),_0xc035('0x55'),_0x2d16fe);});}return respondWithRpcPromise('Start',_0xc035('0x55'),_0x2d16fe);})[_0xc035('0xd')](function(_0x4c0d1e){_0x2110a6(_0x4c0d1e);})['catch'](function(_0x6791da){_0x22520c(_0x5158a2[_0xc035('0x12')](0x1f4,_0x6791da['message']));});});}; \ No newline at end of file +var _0x351f=['find','account','CmList','CmContact','Contacts','List','get','applications','Applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','agent','Start','startRouting','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','map','model','attributes','then','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x351f,0xd5));var _0xf351=function(_0x3d574f,_0xa07912){_0x3d574f=_0x3d574f-0x0;var _0x17fe6b=_0x351f[_0x3d574f];return _0x17fe6b;};'use strict';var _=require(_0xf351('0x0'));var util=require(_0xf351('0x1'));var moment=require(_0xf351('0x2'));var BPromise=require('bluebird');var rs=require(_0xf351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf351('0x4'))['db'];var utils=require(_0xf351('0x5'));var logger=require(_0xf351('0x6'))('rpc');var config=require(_0xf351('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf351('0x8')][_0xf351('0x9')]({'port':0x232c});config[_0xf351('0xa')]=_[_0xf351('0xb')](config[_0xf351('0xa')],{'host':_0xf351('0xc'),'port':0x18eb});var socket=require(_0xf351('0xd'))(new Redis(config[_0xf351('0xa')]));require(_0xf351('0xe'))['register'](socket);function respondWithRpcPromise(_0x335d58,_0x813420,_0x4db80c){return new BPromise(function(_0x251058,_0x42d24f){return client['request'](_0x335d58,_0x4db80c)['then'](function(_0x201c26){logger[_0xf351('0xf')]('FaxAccount,\x20%s,\x20%s',_0x813420,_0xf351('0x10'));logger[_0xf351('0x11')](_0xf351('0x12'),_0x813420,_0xf351('0x10'),JSON[_0xf351('0x13')](_0x201c26));if(_0x201c26[_0xf351('0x14')]){if(_0x201c26['error'][_0xf351('0x15')]===0x1f4){logger['error'](_0xf351('0x16'),_0x813420,_0x201c26[_0xf351('0x14')][_0xf351('0x17')]);return _0x42d24f(_0x201c26[_0xf351('0x14')][_0xf351('0x17')]);}logger[_0xf351('0x14')]('FaxAccount,\x20%s,\x20%s',_0x813420,_0x201c26[_0xf351('0x14')]['message']);return _0x251058(_0x201c26['error'][_0xf351('0x17')]);}else{logger[_0xf351('0xf')](_0xf351('0x16'),_0x813420,_0xf351('0x10'));_0x251058(_0x201c26[_0xf351('0x18')]['message']);}})[_0xf351('0x19')](function(_0x5d6727){logger['error'](_0xf351('0x16'),_0x813420,_0x5d6727);_0x42d24f(_0x5d6727);});});}exports[_0xf351('0x1a')]=function(_0x4d8bab){var _0x5ad57d=this;return new Promise(function(_0x5ccae8,_0x14e904){return db[_0xf351('0x1b')][_0xf351('0x1c')]({'raw':_0x4d8bab[_0xf351('0x1d')]?_0x4d8bab[_0xf351('0x1d')][_0xf351('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d8bab['options']?_0x4d8bab[_0xf351('0x1d')][_0xf351('0x1f')]||null:null,'attributes':_0x4d8bab[_0xf351('0x1d')]?_0x4d8bab[_0xf351('0x1d')]['attributes']||null:null,'limit':_0x4d8bab[_0xf351('0x1d')]?_0x4d8bab[_0xf351('0x1d')]['limit']||null:null,'include':_0x4d8bab[_0xf351('0x1d')]?_0x4d8bab['options'][_0xf351('0x20')]?_[_0xf351('0x21')](_0x4d8bab[_0xf351('0x1d')][_0xf351('0x20')],function(_0x511a65){return{'model':db[_0x511a65[_0xf351('0x22')]],'as':_0x511a65['as'],'attributes':_0x511a65['attributes'],'include':_0x511a65['include']?_['map'](_0x511a65[_0xf351('0x20')],function(_0x320d78){return{'model':db[_0x320d78['model']],'as':_0x320d78['as'],'attributes':_0x320d78[_0xf351('0x23')],'include':_0x320d78[_0xf351('0x20')]?_[_0xf351('0x21')](_0x320d78[_0xf351('0x20')],function(_0x3c537d){return{'model':db[_0x3c537d[_0xf351('0x22')]],'as':_0x3c537d['as'],'attributes':_0x3c537d[_0xf351('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf351('0x24')](function(_0x2094ce){logger[_0xf351('0xf')](_0xf351('0x1a'),_0x4d8bab);logger['debug']('GetFaxAccount',_0x4d8bab,JSON['stringify'](_0x2094ce));_0x5ccae8(_0x2094ce);})[_0xf351('0x19')](function(_0x110758){logger['error'](_0xf351('0x1a'),_0x110758['message'],_0x4d8bab);_0x14e904(_0x5ad57d['error'](0x1f4,_0x110758[_0xf351('0x17')]));});});};exports[_0xf351('0x25')]=function(_0x4624d8,_0x2df290,_0x1d788b){var _0x326475=this;return new Promise(function(_0x152604,_0x545523){var _0x5affe5={'body':_0x4624d8[_0xf351('0x26')],'channel':_0xf351('0x27')};var _0x77d71d=[];var _0x3d738b=[];var _0x16ec56={};return db['CmContact'][_0xf351('0x28')]()[_0xf351('0x24')](function(_0x514615){if(!_0x514615){throw new db[(_0xf351('0x29'))][(_0xf351('0x2a'))](_0xf351('0x2b'));}_0x77d71d=_[_0xf351('0x2c')](_[_0xf351('0x2d')](_0x514615),[_0xf351('0x2e'),_0xf351('0x2f')]);_0x3d738b=_['difference'](_[_0xf351('0x2d')](_0x514615),['createdAt','updatedAt','CompanyId','ListId']);if(_0x4624d8['body']['id']){delete _0x4624d8[_0xf351('0x26')]['id'];}if(_['isNil'](_0x4624d8[_0xf351('0x26')][_0xf351('0x30')])){throw new db[(_0xf351('0x29'))]['ValidationError'](_0xf351('0x31'));}if(_[_0xf351('0x32')](_0x4624d8[_0xf351('0x26')][_0xf351('0x26')])||_0x4624d8[_0xf351('0x26')][_0xf351('0x26')]===''){throw new db['Sequelize'][(_0xf351('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf351('0x32')](_0x4624d8[_0xf351('0x26')][_0xf351('0x33')])){throw new db[(_0xf351('0x29'))]['ValidationError'](_0xf351('0x34')+_0x3d738b);}if(!_[_0xf351('0x35')](_0x3d738b,_0x4624d8[_0xf351('0x26')][_0xf351('0x33')])){throw new db[(_0xf351('0x29'))][(_0xf351('0x2a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d738b);}_0x16ec56[_0x4624d8['body']['mapKey']]=_0x4624d8[_0xf351('0x26')][_0xf351('0x30')];})[_0xf351('0x24')](function(){return db[_0xf351('0x1b')][_0xf351('0x36')]({'where':{'id':_0x4624d8[_0xf351('0x37')]['id']},'include':[{'model':db[_0xf351('0x38')],'as':'List','include':[{'model':db[_0xf351('0x39')],'as':_0xf351('0x3a'),'where':_0x16ec56,'limit':0x1,'order':[[_0xf351('0x2f'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf351('0x24')](function(_0x5d33e6){if(_0x5d33e6&&_0x5d33e6[_0xf351('0x3b')]){var _0x425102=_0x5d33e6[_0xf351('0x3c')]({'plain':!![]});_0x5affe5[_0xf351('0x37')]=_0x425102;_0x5affe5[_0xf351('0x3d')]=_0x425102[_0xf351('0x3e')];_0x5affe5[_0xf351('0x3f')]=_0x425102[_0xf351('0x3b')];_0x5affe5['applications']=_[_0xf351('0x40')](_0x5affe5[_0xf351('0x3d')],[_0xf351('0x41')],[_0xf351('0x42')]);if(_0x5affe5['account'][_0xf351('0x3e')]){delete _0x5affe5[_0xf351('0x37')][_0xf351('0x3e')];}if(_0x5affe5[_0xf351('0x37')][_0xf351('0x3b')]&&_0x5affe5[_0xf351('0x37')][_0xf351('0x3b')][_0xf351('0x3a')][_0xf351('0x43')]){return _0x5affe5['account'][_0xf351('0x3b')][_0xf351('0x3a')][0x0];}var _0x6208d8=_[_0xf351('0xb')](_0x4624d8[_0xf351('0x26')],{'firstName':_0x4624d8[_0xf351('0x26')][_0xf351('0x30')],'ListId':_0x425102[_0xf351('0x44')]});_0x6208d8[_0x4624d8[_0xf351('0x26')][_0xf351('0x33')]]=_0x4624d8[_0xf351('0x26')][_0xf351('0x30')];return db[_0xf351('0x39')][_0xf351('0x45')](_0x6208d8,{'fields':_0x77d71d,'raw':!![]});}})[_0xf351('0x24')](function(_0x30ac91){_0x5affe5[_0xf351('0x46')]=_0x30ac91;if(_0x30ac91){var _0x38a46d={'ContactId':_0x30ac91['id'],'FaxAccountId':_0x4624d8['account']['id'],'fax':_0x30ac91[_0xf351('0x27')]};return db[_0xf351('0x47')][_0xf351('0x36')]({'where':{'ContactId':_0x30ac91['id'],'closed':![],'FaxAccountId':_0x4624d8[_0xf351('0x37')]['id']}})[_0xf351('0x24')](function(_0x57a232){if(_0x57a232){return[_0x57a232,![]];}return db[_0xf351('0x47')][_0xf351('0x45')](_0x38a46d)[_0xf351('0x24')](function(_0x3d362c){return[_0x3d362c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf351('0x48')](function(_0x345041,_0x19ef83){var _0x35cd08=_0x345041['get']({'plain':!![]});if(_0x19ef83){if(_0x5affe5['account'][_0xf351('0x49')]){_0x5affe5[_0xf351('0x3d')][_0xf351('0x4a')]({'id':0x0,'priority':_0x5affe5['applications'][_0xf351('0x43')]+0x1,'app':_0xf351('0x4b'),'appdata':_0xf351('0x4c'),'interval':_0xf351('0x4d')});}_0x35cd08[_0xf351('0x4e')]=!![];}else{_0x35cd08[_0xf351('0x4e')]=![];}_0x5affe5['interaction']=_0x35cd08;return db[_0xf351('0x4f')][_0xf351('0x45')]({'body':_0x4624d8[_0xf351('0x26')][_0xf351('0x26')],'FaxAccountId':_0x4624d8['account']['id'],'FaxInteractionId':_0x345041['id'],'direction':'in','ContactId':_0x345041[_0xf351('0x50')],'AttachmentId':_0x4624d8[_0xf351('0x26')][_0xf351('0x51')]});})[_0xf351('0x24')](function(_0x33e74f){_0x5affe5[_0xf351('0x17')]=_0x33e74f;if(_0x5affe5[_0xf351('0x52')][_0xf351('0x53')]){return db[_0xf351('0x54')][_0xf351('0x36')]({'attributes':['id',_0xf351('0x55')],'where':{'id':_0x5affe5[_0xf351('0x52')][_0xf351('0x53')]}})[_0xf351('0x24')](function(_0x10864a){if(_0x10864a){_0x5affe5[_0xf351('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf351('0x56'),'appdata':_0x10864a['name']+','+(_0x5affe5[_0xf351('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0xf351('0x4d')});}return respondWithRpcPromise(_0xf351('0x57'),_0xf351('0x58'),_0x5affe5);});}return respondWithRpcPromise('Start',_0xf351('0x58'),_0x5affe5);})[_0xf351('0x24')](function(_0x30d252){_0x152604(_0x30d252);})['catch'](function(_0x3d92cf){_0x545523(_0x326475[_0xf351('0x14')](0x1f4,_0x3d92cf[_0xf351('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 832eccf..86b9a97 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 _0x709c=['emit','register','length','./faxAccount.events','remove','update'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x709c,0x135));var _0xc709=function(_0x4b478f,_0x13ace5){_0x4b478f=_0x4b478f-0x0;var _0x4128d6=_0x709c[_0x4b478f];return _0x4128d6;};'use strict';var FaxAccountEvents=require(_0xc709('0x0'));var events=['save',_0xc709('0x1'),_0xc709('0x2')];function createListener(_0x355666,_0x3c96d6){return function(_0x9fa816){_0x3c96d6[_0xc709('0x3')](_0x355666,_0x9fa816);};}function removeListener(_0x325c5b,_0x2c81a9){return function(){FaxAccountEvents['removeListener'](_0x325c5b,_0x2c81a9);};}exports[_0xc709('0x4')]=function(_0x5483c0){for(var _0x2e28f=0x0,_0x5f38d0=events[_0xc709('0x5')];_0x2e28f<_0x5f38d0;_0x2e28f++){var _0x1c4dc3=events[_0x2e28f];var _0x5804cf=createListener('faxAccount:'+_0x1c4dc3,_0x5483c0);FaxAccountEvents['on'](_0x1c4dc3,_0x5804cf);}}; \ No newline at end of file +var _0xfb39=['faxAccount:','./faxAccount.events','update','register'];(function(_0x20d897,_0x3ee792){var _0x137f93=function(_0x566655){while(--_0x566655){_0x20d897['push'](_0x20d897['shift']());}};_0x137f93(++_0x3ee792);}(_0xfb39,0x75));var _0x9fb3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb39[_0x3b380d];return _0x54502b;};'use strict';var FaxAccountEvents=require(_0x9fb3('0x0'));var events=['save','remove',_0x9fb3('0x1')];function createListener(_0x10831c,_0x1bbfa6){return function(_0x4f5675){_0x1bbfa6['emit'](_0x10831c,_0x4f5675);};}function removeListener(_0x230a3b,_0x2a8631){return function(){FaxAccountEvents['removeListener'](_0x230a3b,_0x2a8631);};}exports[_0x9fb3('0x2')]=function(_0xfcaf42){for(var _0x57cb54=0x0,_0x568ba7=events['length'];_0x57cb54<_0x568ba7;_0x57cb54++){var _0x3728f3=events[_0x57cb54];var _0x550dd2=createListener(_0x9fb3('0x3')+_0x3728f3,_0xfcaf42);FaxAccountEvents['on'](_0x3728f3,_0x550dd2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 376041c..c255512 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 _0x8c45=['./faxAccount.controller','get','index','/describe','describe','/:id','show','isAuthenticated','getDispositions','/:id/canned_answers','/:id/interactions','/:id/applications','/:id/messages','getMessages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','removeDispositions','/:id/users','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44fb50,_0x2852b5){var _0x41c71e=function(_0x15022a){while(--_0x15022a){_0x44fb50['push'](_0x44fb50['shift']());}};_0x41c71e(++_0x2852b5);}(_0x8c45,0xee));var _0x58c4=function(_0x5b6ff1,_0x21f181){_0x5b6ff1=_0x5b6ff1-0x0;var _0x12efd6=_0x8c45[_0x5b6ff1];return _0x12efd6;};'use strict';var multer=require(_0x58c4('0x0'));var util=require(_0x58c4('0x1'));var path=require(_0x58c4('0x2'));var timeout=require('connect-timeout');var express=require(_0x58c4('0x3'));var router=express[_0x58c4('0x4')]();var auth=require(_0x58c4('0x5'));var interaction=require(_0x58c4('0x6'));var config=require(_0x58c4('0x7'));var controller=require(_0x58c4('0x8'));router[_0x58c4('0x9')]('/',auth['isAuthenticated'](),controller[_0x58c4('0xa')]);router['get'](_0x58c4('0xb'),auth['isAuthenticated'](),controller[_0x58c4('0xc')]);router[_0x58c4('0x9')](_0x58c4('0xd'),auth['isAuthenticated'](),controller[_0x58c4('0xe')]);router[_0x58c4('0x9')]('/:id/dispositions',auth[_0x58c4('0xf')](),controller[_0x58c4('0x10')]);router[_0x58c4('0x9')](_0x58c4('0x11'),auth[_0x58c4('0xf')](),controller['getAnswers']);router['get'](_0x58c4('0x12'),auth[_0x58c4('0xf')](),controller['getInteractions']);router['get'](_0x58c4('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0x58c4('0x9')](_0x58c4('0x14'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x15')]);router[_0x58c4('0x9')]('/:id/users',auth[_0x58c4('0xf')](),controller[_0x58c4('0x16')]);router[_0x58c4('0x17')]('/',auth['isAuthenticated'](),controller[_0x58c4('0x18')]);router[_0x58c4('0x17')](_0x58c4('0x19'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x1a')]);router['post'](_0x58c4('0x11'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x1b')]);router[_0x58c4('0x17')](_0x58c4('0x12'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x1c')]);router['post'](_0x58c4('0x13'),auth[_0x58c4('0xf')](),controller['addApplications']);router[_0x58c4('0x17')](_0x58c4('0x1d'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x1e')]);router[_0x58c4('0x17')](_0x58c4('0x1f'),auth['isAuthenticated'](),controller[_0x58c4('0x20')]);router['post'](_0x58c4('0x21'),auth[_0x58c4('0xf')](),controller[_0x58c4('0x22')]);router[_0x58c4('0x17')]('/:id/users',auth[_0x58c4('0xf')](),controller[_0x58c4('0x23')]);router['put']('/:id',auth[_0x58c4('0xf')](),controller[_0x58c4('0x24')]);router[_0x58c4('0x25')](_0x58c4('0xd'),auth[_0x58c4('0xf')](),controller['destroy']);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x58c4('0x26')]);router['delete']('/:id/canned_answers',auth[_0x58c4('0xf')](),controller['removeAnswers']);router[_0x58c4('0x25')](_0x58c4('0x27'),auth[_0x58c4('0xf')](),controller['removeAgents']);module[_0x58c4('0x28')]=router; \ No newline at end of file +var _0x6526=['addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','addAgents','update','delete','removeDispositions','removeAnswers','exports','util','express','Router','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','addDisposition','addAnswer'];(function(_0x579df3,_0x11a7b6){var _0x1a3d9b=function(_0x353c19){while(--_0x353c19){_0x579df3['push'](_0x579df3['shift']());}};_0x1a3d9b(++_0x11a7b6);}(_0x6526,0xd1));var _0x6652=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x6526[_0x355ce8];return _0x1db8b8;};'use strict';var multer=require('multer');var util=require(_0x6652('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6652('0x1'));var router=express[_0x6652('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6652('0x3'));router[_0x6652('0x4')]('/',auth[_0x6652('0x5')](),controller[_0x6652('0x6')]);router[_0x6652('0x4')](_0x6652('0x7'),auth['isAuthenticated'](),controller[_0x6652('0x8')]);router[_0x6652('0x4')](_0x6652('0x9'),auth[_0x6652('0x5')](),controller[_0x6652('0xa')]);router[_0x6652('0x4')](_0x6652('0xb'),auth[_0x6652('0x5')](),controller[_0x6652('0xc')]);router[_0x6652('0x4')](_0x6652('0xd'),auth['isAuthenticated'](),controller[_0x6652('0xe')]);router['get'](_0x6652('0xf'),auth[_0x6652('0x5')](),controller[_0x6652('0x10')]);router[_0x6652('0x4')](_0x6652('0x11'),auth['isAuthenticated'](),controller[_0x6652('0x12')]);router[_0x6652('0x4')](_0x6652('0x13'),auth['isAuthenticated'](),controller[_0x6652('0x14')]);router['get']('/:id/users',auth[_0x6652('0x5')](),controller[_0x6652('0x15')]);router[_0x6652('0x16')]('/',auth[_0x6652('0x5')](),controller['create']);router[_0x6652('0x16')](_0x6652('0xb'),auth['isAuthenticated'](),controller[_0x6652('0x17')]);router[_0x6652('0x16')]('/:id/canned_answers',auth[_0x6652('0x5')](),controller[_0x6652('0x18')]);router['post'](_0x6652('0xf'),auth[_0x6652('0x5')](),controller[_0x6652('0x19')]);router[_0x6652('0x16')](_0x6652('0x11'),auth[_0x6652('0x5')](),controller[_0x6652('0x1a')]);router[_0x6652('0x16')](_0x6652('0x1b'),auth['isAuthenticated'](),controller['addAccountApplications']);router[_0x6652('0x16')](_0x6652('0x1c'),auth[_0x6652('0x5')](),controller[_0x6652('0x1d')]);router[_0x6652('0x16')](_0x6652('0x1e'),auth[_0x6652('0x5')](),controller[_0x6652('0x1f')]);router[_0x6652('0x16')](_0x6652('0x20'),auth[_0x6652('0x5')](),controller[_0x6652('0x21')]);router['put'](_0x6652('0x9'),auth[_0x6652('0x5')](),controller[_0x6652('0x22')]);router['delete'](_0x6652('0x9'),auth[_0x6652('0x5')](),controller['destroy']);router[_0x6652('0x23')](_0x6652('0xb'),auth['isAuthenticated'](),controller[_0x6652('0x24')]);router[_0x6652('0x23')](_0x6652('0xd'),auth[_0x6652('0x5')](),controller[_0x6652('0x25')]);router['delete'](_0x6652('0x20'),auth[_0x6652('0x5')](),controller['removeAgents']);module[_0x6652('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 7f69edd..3f7b2eb 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 _0xf5b6=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x26db61,_0x8674a5){_0x26db61=_0x26db61-0x0;var _0x1c5e55=_0xf5b6[_0x26db61];return _0x1c5e55;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x6f5b('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x6f5b('0x1')],'allowNull':![],'defaultValue':_0x6f5b('0x2')},'appdata':{'type':Sequelize[_0x6f5b('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6f5b('0x1')],'defaultValue':_0x6f5b('0x4')}}; \ No newline at end of file +var _0xf5c0=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x564c3f,_0x183ea6){var _0x53b35a=function(_0x533692){while(--_0x533692){_0x564c3f['push'](_0x564c3f['shift']());}};_0x53b35a(++_0x183ea6);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x3f6b67,_0x2736d1){_0x3f6b67=_0x3f6b67-0x0;var _0x3d2b4c=_0xf5c0[_0x3f6b67];return _0x3d2b4c;};'use strict';var Sequelize=require(_0x0f5c('0x0'));module[_0x0f5c('0x1')]={'priority':{'type':Sequelize[_0x0f5c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0f5c('0x3')],'allowNull':![],'defaultValue':_0x0f5c('0x4')},'appdata':{'type':Sequelize[_0x0f5c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0f5c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b9f7112..7dce7e5 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 _0xf8b8=['stack','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','FaxApplication','rawAttributes','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy'];(function(_0x2f02d4,_0x27b24a){var _0x4b707d=function(_0x52f3ba){while(--_0x52f3ba){_0x2f02d4['push'](_0x2f02d4['shift']());}};_0x4b707d(++_0x27b24a);}(_0xf8b8,0x1a0));var _0x8f8b=function(_0xaac449,_0x393732){_0xaac449=_0xaac449-0x0;var _0x53b5b9=_0xf8b8[_0xaac449];return _0x53b5b9;};'use strict';var pdf=require(_0x8f8b('0x0'));var emlformat=require(_0x8f8b('0x1'));var rimraf=require(_0x8f8b('0x2'));var zipdir=require(_0x8f8b('0x3'));var jsonpatch=require(_0x8f8b('0x4'));var rp=require(_0x8f8b('0x5'));var moment=require(_0x8f8b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8f8b('0x7'));var util=require(_0x8f8b('0x8'));var path=require(_0x8f8b('0x9'));var sox=require(_0x8f8b('0xa'));var csv=require(_0x8f8b('0xb'));var ejs=require(_0x8f8b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f8b('0xd'));var jsforce=require(_0x8f8b('0xe'));var deskjs=require(_0x8f8b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8f8b('0x10'));var Papa=require(_0x8f8b('0x11'));var Redis=require(_0x8f8b('0x12'));var authService=require(_0x8f8b('0x13'));var qs=require(_0x8f8b('0x14'));var hardwareService=require(_0x8f8b('0x15'));var logger=require(_0x8f8b('0x16'))(_0x8f8b('0x17'));var utils=require('../../config/utils');var config=require(_0x8f8b('0x18'));var db=require(_0x8f8b('0x19'))['db'];function respondWithStatusCode(_0x192eeb,_0x45689a){_0x45689a=_0x45689a||0xcc;return function(_0x53ac4b){if(_0x53ac4b){return _0x192eeb[_0x8f8b('0x1a')](_0x45689a);}return _0x192eeb[_0x8f8b('0x1b')](_0x45689a)[_0x8f8b('0x1c')]();};}function respondWithResult(_0x4026a2,_0x3b3c2c){_0x3b3c2c=_0x3b3c2c||0xc8;return function(_0x50c26a){if(_0x50c26a){return _0x4026a2[_0x8f8b('0x1b')](_0x3b3c2c)[_0x8f8b('0x1d')](_0x50c26a);}};}function respondWithFilteredResult(_0x32fe96,_0x3caecc){return function(_0x166586){if(_0x166586){var _0x41c2f9=_0x166586[_0x8f8b('0x1e')],_0x4816b4=_0x3caecc['offset'],_0x3402fa=_0x3caecc[_0x8f8b('0x1f')]+_0x3caecc[_0x8f8b('0x20')],_0x7c2ac1;if(_0x3402fa>=_0x41c2f9){_0x3402fa=_0x41c2f9;_0x7c2ac1=0xc8;}else{_0x7c2ac1=0xce;}_0x32fe96[_0x8f8b('0x1b')](_0x7c2ac1);return _0x32fe96[_0x8f8b('0x21')](_0x8f8b('0x22'),_0x4816b4+'-'+_0x3402fa+'/'+_0x41c2f9)[_0x8f8b('0x1d')](_0x166586);}return null;};}function patchUpdates(_0x56c389){return function(_0x17ea8c){try{jsonpatch['apply'](_0x17ea8c,_0x56c389,!![]);}catch(_0x17daa0){return BPromise[_0x8f8b('0x23')](_0x17daa0);}return _0x17ea8c[_0x8f8b('0x24')]();};}function saveUpdates(_0x54d8e1,_0x127b6c){return function(_0x55bc78){if(_0x55bc78){return _0x55bc78[_0x8f8b('0x25')](_0x54d8e1)[_0x8f8b('0x26')](function(_0x4fda9f){return _0x4fda9f;});}return null;};}function removeEntity(_0x32c0c3,_0x4915a9){return function(_0x2e1e3e){if(_0x2e1e3e){return _0x2e1e3e[_0x8f8b('0x27')]()['then'](function(){_0x32c0c3[_0x8f8b('0x1b')](0xcc)[_0x8f8b('0x1c')]();});}};}function handleEntityNotFound(_0x334a5d,_0x544f17){return function(_0x3424b7){if(!_0x3424b7){_0x334a5d[_0x8f8b('0x1a')](0x194);}return _0x3424b7;};}function handleError(_0xd3e58c,_0x31eca1){_0x31eca1=_0x31eca1||0x1f4;return function(_0xd50dd7){logger['error'](_0xd50dd7[_0x8f8b('0x28')]);if(_0xd50dd7[_0x8f8b('0x29')]){delete _0xd50dd7[_0x8f8b('0x29')];}_0xd3e58c[_0x8f8b('0x1b')](_0x31eca1)[_0x8f8b('0x2a')](_0xd50dd7);};}exports[_0x8f8b('0x2b')]=function(_0x5a2edc,_0x564ce4){var _0x4f6cfe={},_0xe29d60={},_0x54dbd6={'count':0x0,'rows':[]};var _0x442acd=db['FaxApplication']['rawAttributes'];_0xe29d60[_0x8f8b('0x2c')]=_[_0x8f8b('0x2d')](_0x442acd);_0xe29d60[_0x8f8b('0x2e')]=_['keys'](_0x5a2edc[_0x8f8b('0x2e')]);_0xe29d60['filters']=_[_0x8f8b('0x2f')](_0xe29d60[_0x8f8b('0x2c')],_0xe29d60[_0x8f8b('0x2e')]);_0x4f6cfe[_0x8f8b('0x30')]=_['intersection'](_0xe29d60[_0x8f8b('0x2c')],qs['fields'](_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x31')]));_0x4f6cfe['attributes']=_0x4f6cfe[_0x8f8b('0x30')][_0x8f8b('0x32')]?_0x4f6cfe['attributes']:_0xe29d60[_0x8f8b('0x2c')];if(!_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x33')](_0x8f8b('0x34'))){_0x4f6cfe[_0x8f8b('0x20')]=qs[_0x8f8b('0x20')](_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x20')]);_0x4f6cfe[_0x8f8b('0x1f')]=qs[_0x8f8b('0x1f')](_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x1f')]);}_0x4f6cfe[_0x8f8b('0x35')]=qs[_0x8f8b('0x36')](_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x36')]);_0x4f6cfe[_0x8f8b('0x37')]=qs[_0x8f8b('0x38')](_[_0x8f8b('0x39')](_0x5a2edc[_0x8f8b('0x2e')],_0xe29d60[_0x8f8b('0x38')]));if(_0x5a2edc['query'][_0x8f8b('0x3a')]){_0x4f6cfe[_0x8f8b('0x37')]=_[_0x8f8b('0x3b')](_0x4f6cfe[_0x8f8b('0x37')],{'$or':_['map'](_0x442acd,function(_0x374fee){if(_0x374fee[_0x8f8b('0x3c')][_0x8f8b('0x3d')]!==_0x8f8b('0x3e')){var _0x4cce66={};_0x4cce66[_0x374fee[_0x8f8b('0x3f')]]={'$like':'%'+_0x5a2edc[_0x8f8b('0x2e')]['filter']+'%'};return _0x4cce66;}})});}_0x4f6cfe=_[_0x8f8b('0x3b')]({},_0x4f6cfe,_0x5a2edc[_0x8f8b('0x40')]);var _0x4fd670={'where':_0x4f6cfe[_0x8f8b('0x37')]};return db['FaxApplication'][_0x8f8b('0x1e')](_0x4fd670)[_0x8f8b('0x26')](function(_0x470f82){_0x54dbd6[_0x8f8b('0x1e')]=_0x470f82;if(_0x5a2edc[_0x8f8b('0x2e')][_0x8f8b('0x41')]){_0x4f6cfe[_0x8f8b('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x8f8b('0x43')](_0x4f6cfe);})[_0x8f8b('0x26')](function(_0xf7091b){_0x54dbd6['rows']=_0xf7091b;return _0x54dbd6;})[_0x8f8b('0x26')](respondWithFilteredResult(_0x564ce4,_0x4f6cfe))['catch'](handleError(_0x564ce4,null));};exports[_0x8f8b('0x44')]=function(_0x23813d,_0x343813){var _0x5c41c2={'raw':!![],'where':{'id':_0x23813d[_0x8f8b('0x45')]['id']}},_0x54a13b={};_0x54a13b[_0x8f8b('0x2c')]=_[_0x8f8b('0x2d')](db[_0x8f8b('0x46')][_0x8f8b('0x47')]);_0x54a13b['query']=_[_0x8f8b('0x2d')](_0x23813d[_0x8f8b('0x2e')]);_0x54a13b[_0x8f8b('0x38')]=_['intersection'](_0x54a13b[_0x8f8b('0x2c')],_0x54a13b['query']);_0x5c41c2[_0x8f8b('0x30')]=_[_0x8f8b('0x2f')](_0x54a13b['model'],qs[_0x8f8b('0x31')](_0x23813d[_0x8f8b('0x2e')][_0x8f8b('0x31')]));_0x5c41c2[_0x8f8b('0x30')]=_0x5c41c2[_0x8f8b('0x30')][_0x8f8b('0x32')]?_0x5c41c2[_0x8f8b('0x30')]:_0x54a13b['model'];if(_0x23813d[_0x8f8b('0x2e')][_0x8f8b('0x41')]){_0x5c41c2[_0x8f8b('0x42')]=[{'all':!![]}];}_0x5c41c2=_[_0x8f8b('0x3b')]({},_0x5c41c2,_0x23813d[_0x8f8b('0x40')]);return db[_0x8f8b('0x46')][_0x8f8b('0x48')](_0x5c41c2)[_0x8f8b('0x26')](handleEntityNotFound(_0x343813,null))[_0x8f8b('0x26')](respondWithResult(_0x343813,null))['catch'](handleError(_0x343813,null));};exports['create']=function(_0xbbc3ee,_0x3efdfe){return db[_0x8f8b('0x46')][_0x8f8b('0x49')](_0xbbc3ee[_0x8f8b('0x4a')],{})[_0x8f8b('0x26')](respondWithResult(_0x3efdfe,0xc9))['catch'](handleError(_0x3efdfe,null));};exports[_0x8f8b('0x25')]=function(_0x2ff99,_0x5a01d0){if(_0x2ff99[_0x8f8b('0x4a')]['id']){delete _0x2ff99['body']['id'];}return db[_0x8f8b('0x46')][_0x8f8b('0x48')]({'where':{'id':_0x2ff99[_0x8f8b('0x45')]['id']}})[_0x8f8b('0x26')](handleEntityNotFound(_0x5a01d0,null))[_0x8f8b('0x26')](saveUpdates(_0x2ff99[_0x8f8b('0x4a')],null))[_0x8f8b('0x26')](respondWithResult(_0x5a01d0,null))['catch'](handleError(_0x5a01d0,null));};exports['destroy']=function(_0x5966d9,_0x3b6cc9){return db[_0x8f8b('0x46')][_0x8f8b('0x48')]({'where':{'id':_0x5966d9[_0x8f8b('0x45')]['id']}})[_0x8f8b('0x26')](handleEntityNotFound(_0x3b6cc9,null))[_0x8f8b('0x26')](removeEntity(_0x3b6cc9,null))[_0x8f8b('0x4b')](handleError(_0x3b6cc9,null));}; \ No newline at end of file +var _0xec61=['set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','catch','show','params','length','includeAll','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','limit','status'];(function(_0xd0d20,_0x5696a1){var _0x290afc=function(_0x59a776){while(--_0x59a776){_0xd0d20['push'](_0xd0d20['shift']());}};_0x290afc(++_0x5696a1);}(_0xec61,0x15b));var _0x1ec6=function(_0x19cc21,_0x4e6b89){_0x19cc21=_0x19cc21-0x0;var _0x476767=_0xec61[_0x19cc21];return _0x476767;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1ec6('0x0'));var zipdir=require(_0x1ec6('0x1'));var jsonpatch=require(_0x1ec6('0x2'));var rp=require(_0x1ec6('0x3'));var moment=require(_0x1ec6('0x4'));var BPromise=require(_0x1ec6('0x5'));var Mustache=require(_0x1ec6('0x6'));var util=require(_0x1ec6('0x7'));var path=require(_0x1ec6('0x8'));var sox=require('sox');var csv=require(_0x1ec6('0x9'));var ejs=require(_0x1ec6('0xa'));var fs=require('fs');var _=require(_0x1ec6('0xb'));var squel=require('squel');var crypto=require(_0x1ec6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1ec6('0xd'));var toCsv=require(_0x1ec6('0x9'));var querystring=require(_0x1ec6('0xe'));var Papa=require(_0x1ec6('0xf'));var Redis=require(_0x1ec6('0x10'));var authService=require(_0x1ec6('0x11'));var qs=require(_0x1ec6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ec6('0x13'));var utils=require(_0x1ec6('0x14'));var config=require(_0x1ec6('0x15'));var db=require(_0x1ec6('0x16'))['db'];function respondWithStatusCode(_0x277e1b,_0x2b06ce){_0x2b06ce=_0x2b06ce||0xcc;return function(_0x876625){if(_0x876625){return _0x277e1b['sendStatus'](_0x2b06ce);}return _0x277e1b['status'](_0x2b06ce)[_0x1ec6('0x17')]();};}function respondWithResult(_0x468b41,_0x3f7838){_0x3f7838=_0x3f7838||0xc8;return function(_0x3da72a){if(_0x3da72a){return _0x468b41['status'](_0x3f7838)[_0x1ec6('0x18')](_0x3da72a);}};}function respondWithFilteredResult(_0x6d4f0d,_0x5cc73f){return function(_0x303a9b){if(_0x303a9b){var _0x48dc58=_0x303a9b[_0x1ec6('0x19')],_0x4cf755=_0x5cc73f['offset'],_0x1a657c=_0x5cc73f['offset']+_0x5cc73f[_0x1ec6('0x1a')],_0x432e8c;if(_0x1a657c>=_0x48dc58){_0x1a657c=_0x48dc58;_0x432e8c=0xc8;}else{_0x432e8c=0xce;}_0x6d4f0d[_0x1ec6('0x1b')](_0x432e8c);return _0x6d4f0d[_0x1ec6('0x1c')](_0x1ec6('0x1d'),_0x4cf755+'-'+_0x1a657c+'/'+_0x48dc58)[_0x1ec6('0x18')](_0x303a9b);}return null;};}function patchUpdates(_0x45db71){return function(_0x5705f2){try{jsonpatch[_0x1ec6('0x1e')](_0x5705f2,_0x45db71,!![]);}catch(_0x50cba3){return BPromise['reject'](_0x50cba3);}return _0x5705f2[_0x1ec6('0x1f')]();};}function saveUpdates(_0x45bea6,_0x84df4e){return function(_0x5394d1){if(_0x5394d1){return _0x5394d1[_0x1ec6('0x20')](_0x45bea6)[_0x1ec6('0x21')](function(_0x3de427){return _0x3de427;});}return null;};}function removeEntity(_0x6f6d2e,_0x812d09){return function(_0x5aabf8){if(_0x5aabf8){return _0x5aabf8[_0x1ec6('0x22')]()['then'](function(){_0x6f6d2e[_0x1ec6('0x1b')](0xcc)[_0x1ec6('0x17')]();});}};}function handleEntityNotFound(_0x3f34d7,_0x1abff4){return function(_0x24a714){if(!_0x24a714){_0x3f34d7[_0x1ec6('0x23')](0x194);}return _0x24a714;};}function handleError(_0x23c162,_0x7fe1c2){_0x7fe1c2=_0x7fe1c2||0x1f4;return function(_0x4265cc){logger[_0x1ec6('0x24')](_0x4265cc[_0x1ec6('0x25')]);if(_0x4265cc[_0x1ec6('0x26')]){delete _0x4265cc[_0x1ec6('0x26')];}_0x23c162[_0x1ec6('0x1b')](_0x7fe1c2)[_0x1ec6('0x27')](_0x4265cc);};}exports[_0x1ec6('0x28')]=function(_0x14e042,_0x357336){var _0x3eb9c9={},_0x4ffb68={},_0x404f82={'count':0x0,'rows':[]};var _0x4aef64=db[_0x1ec6('0x29')][_0x1ec6('0x2a')];_0x4ffb68[_0x1ec6('0x2b')]=_[_0x1ec6('0x2c')](_0x4aef64);_0x4ffb68['query']=_[_0x1ec6('0x2c')](_0x14e042[_0x1ec6('0x2d')]);_0x4ffb68[_0x1ec6('0x2e')]=_[_0x1ec6('0x2f')](_0x4ffb68[_0x1ec6('0x2b')],_0x4ffb68[_0x1ec6('0x2d')]);_0x3eb9c9[_0x1ec6('0x30')]=_[_0x1ec6('0x2f')](_0x4ffb68[_0x1ec6('0x2b')],qs[_0x1ec6('0x31')](_0x14e042[_0x1ec6('0x2d')][_0x1ec6('0x31')]));_0x3eb9c9[_0x1ec6('0x30')]=_0x3eb9c9[_0x1ec6('0x30')]['length']?_0x3eb9c9[_0x1ec6('0x30')]:_0x4ffb68[_0x1ec6('0x2b')];if(!_0x14e042[_0x1ec6('0x2d')][_0x1ec6('0x32')](_0x1ec6('0x33'))){_0x3eb9c9[_0x1ec6('0x1a')]=qs[_0x1ec6('0x1a')](_0x14e042[_0x1ec6('0x2d')][_0x1ec6('0x1a')]);_0x3eb9c9[_0x1ec6('0x34')]=qs[_0x1ec6('0x34')](_0x14e042[_0x1ec6('0x2d')][_0x1ec6('0x34')]);}_0x3eb9c9[_0x1ec6('0x35')]=qs[_0x1ec6('0x36')](_0x14e042[_0x1ec6('0x2d')]['sort']);_0x3eb9c9[_0x1ec6('0x37')]=qs[_0x1ec6('0x2e')](_[_0x1ec6('0x38')](_0x14e042[_0x1ec6('0x2d')],_0x4ffb68[_0x1ec6('0x2e')]));if(_0x14e042[_0x1ec6('0x2d')][_0x1ec6('0x39')]){_0x3eb9c9['where']=_[_0x1ec6('0x3a')](_0x3eb9c9[_0x1ec6('0x37')],{'$or':_[_0x1ec6('0x3b')](_0x4aef64,function(_0xd7fa5e){if(_0xd7fa5e[_0x1ec6('0x3c')][_0x1ec6('0x3d')]!==_0x1ec6('0x3e')){var _0x4b3bca={};_0x4b3bca[_0xd7fa5e[_0x1ec6('0x3f')]]={'$like':'%'+_0x14e042[_0x1ec6('0x2d')]['filter']+'%'};return _0x4b3bca;}})});}_0x3eb9c9=_[_0x1ec6('0x3a')]({},_0x3eb9c9,_0x14e042[_0x1ec6('0x40')]);var _0x2c3bd4={'where':_0x3eb9c9[_0x1ec6('0x37')]};return db[_0x1ec6('0x29')][_0x1ec6('0x19')](_0x2c3bd4)[_0x1ec6('0x21')](function(_0x565e66){_0x404f82[_0x1ec6('0x19')]=_0x565e66;if(_0x14e042[_0x1ec6('0x2d')]['includeAll']){_0x3eb9c9['include']=[{'all':!![]}];}return db[_0x1ec6('0x29')][_0x1ec6('0x41')](_0x3eb9c9);})[_0x1ec6('0x21')](function(_0x2e910f){_0x404f82['rows']=_0x2e910f;return _0x404f82;})[_0x1ec6('0x21')](respondWithFilteredResult(_0x357336,_0x3eb9c9))[_0x1ec6('0x42')](handleError(_0x357336,null));};exports[_0x1ec6('0x43')]=function(_0x58b422,_0x187ff4){var _0x393f6a={'raw':!![],'where':{'id':_0x58b422[_0x1ec6('0x44')]['id']}},_0x85da9d={};_0x85da9d['model']=_[_0x1ec6('0x2c')](db['FaxApplication'][_0x1ec6('0x2a')]);_0x85da9d['query']=_[_0x1ec6('0x2c')](_0x58b422[_0x1ec6('0x2d')]);_0x85da9d[_0x1ec6('0x2e')]=_[_0x1ec6('0x2f')](_0x85da9d[_0x1ec6('0x2b')],_0x85da9d['query']);_0x393f6a['attributes']=_[_0x1ec6('0x2f')](_0x85da9d['model'],qs[_0x1ec6('0x31')](_0x58b422['query'][_0x1ec6('0x31')]));_0x393f6a[_0x1ec6('0x30')]=_0x393f6a[_0x1ec6('0x30')][_0x1ec6('0x45')]?_0x393f6a[_0x1ec6('0x30')]:_0x85da9d[_0x1ec6('0x2b')];if(_0x58b422[_0x1ec6('0x2d')][_0x1ec6('0x46')]){_0x393f6a[_0x1ec6('0x47')]=[{'all':!![]}];}_0x393f6a=_[_0x1ec6('0x3a')]({},_0x393f6a,_0x58b422[_0x1ec6('0x40')]);return db['FaxApplication'][_0x1ec6('0x48')](_0x393f6a)[_0x1ec6('0x21')](handleEntityNotFound(_0x187ff4,null))[_0x1ec6('0x21')](respondWithResult(_0x187ff4,null))[_0x1ec6('0x42')](handleError(_0x187ff4,null));};exports[_0x1ec6('0x49')]=function(_0x17af2d,_0x3be9f8){return db[_0x1ec6('0x29')][_0x1ec6('0x49')](_0x17af2d['body'],{})[_0x1ec6('0x21')](respondWithResult(_0x3be9f8,0xc9))[_0x1ec6('0x42')](handleError(_0x3be9f8,null));};exports['update']=function(_0x36c656,_0x465e94){if(_0x36c656['body']['id']){delete _0x36c656[_0x1ec6('0x4a')]['id'];}return db[_0x1ec6('0x29')][_0x1ec6('0x48')]({'where':{'id':_0x36c656['params']['id']}})[_0x1ec6('0x21')](handleEntityNotFound(_0x465e94,null))['then'](saveUpdates(_0x36c656[_0x1ec6('0x4a')],null))[_0x1ec6('0x21')](respondWithResult(_0x465e94,null))[_0x1ec6('0x42')](handleError(_0x465e94,null));};exports[_0x1ec6('0x22')]=function(_0x551a1f,_0xe8756f){return db['FaxApplication']['find']({'where':{'id':_0x551a1f[_0x1ec6('0x44')]['id']}})['then'](handleEntityNotFound(_0xe8756f,null))[_0x1ec6('0x21')](removeEntity(_0xe8756f,null))['catch'](handleError(_0xe8756f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f89a9aa..032c82e 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 _0xc3b5=['rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22f530,_0x395c18){var _0x43b61a=function(_0xc99c58){while(--_0xc99c58){_0x22f530['push'](_0x22f530['shift']());}};_0x43b61a(++_0x395c18);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x307ee7,_0x231d8a){_0x307ee7=_0x307ee7-0x0;var _0x410009=_0xc3b5[_0x307ee7];return _0x410009;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./faxApplication.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5c3b('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x277c=['define','fax_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40fd6d,_0x3d49f3){var _0x278fcf=function(_0x4e3346){while(--_0x4e3346){_0x40fd6d['push'](_0x40fd6d['shift']());}};_0x278fcf(++_0x3d49f3);}(_0x277c,0x153));var _0xc277=function(_0x5aff97,_0x13605b){_0x5aff97=_0x5aff97-0x0;var _0x30ac7e=_0x277c[_0x5aff97];return _0x30ac7e;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('FaxApplication',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc277('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6522d1f..2d5fc88 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 _0x3873=['FaxApplication,\x20%s,\x20%s,\x20%s','error','FaxApplication,\x20%s,\x20%s','message','FaxApplication','body','options','attributes','limit','info','debug','UpdateFaxApplication','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x54301e,_0x1bf9f2){var _0x3382aa=function(_0x1832d5){while(--_0x1832d5){_0x54301e['push'](_0x54301e['shift']());}};_0x3382aa(++_0x1bf9f2);}(_0x3873,0x65));var _0x3387=function(_0x4a4c4d,_0x27a5c3){_0x4a4c4d=_0x4a4c4d-0x0;var _0x2080ad=_0x3873[_0x4a4c4d];return _0x2080ad;};'use strict';var _=require('lodash');var util=require(_0x3387('0x0'));var moment=require(_0x3387('0x1'));var BPromise=require(_0x3387('0x2'));var rs=require(_0x3387('0x3'));var fs=require('fs');var Redis=require(_0x3387('0x4'));var db=require(_0x3387('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3387('0x6'))(_0x3387('0x7'));var config=require(_0x3387('0x8'));var jayson=require(_0x3387('0x9'));var client=jayson[_0x3387('0xa')][_0x3387('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46647a,_0x8d9af8,_0x4a81c1){return new BPromise(function(_0x16c881,_0x516fec){return client[_0x3387('0xc')](_0x46647a,_0x4a81c1)[_0x3387('0xd')](function(_0x5f2473){logger['info']('FaxApplication,\x20%s,\x20%s',_0x8d9af8,_0x3387('0xe'));logger['debug'](_0x3387('0xf'),_0x8d9af8,_0x3387('0xe'),JSON['stringify'](_0x5f2473));if(_0x5f2473[_0x3387('0x10')]){if(_0x5f2473[_0x3387('0x10')]['code']===0x1f4){logger['error'](_0x3387('0x11'),_0x8d9af8,_0x5f2473[_0x3387('0x10')][_0x3387('0x12')]);return _0x516fec(_0x5f2473[_0x3387('0x10')]['message']);}logger[_0x3387('0x10')](_0x3387('0x11'),_0x8d9af8,_0x5f2473[_0x3387('0x10')]['message']);return _0x16c881(_0x5f2473[_0x3387('0x10')]['message']);}else{logger['info'](_0x3387('0x11'),_0x8d9af8,_0x3387('0xe'));_0x16c881(_0x5f2473['result'][_0x3387('0x12')]);}})['catch'](function(_0x64ca43){logger[_0x3387('0x10')](_0x3387('0x11'),_0x8d9af8,_0x64ca43);_0x516fec(_0x64ca43);});});}exports['UpdateFaxApplication']=function(_0x5adaaa){var _0x212514=this;return new Promise(function(_0x313915,_0x118f03){return db[_0x3387('0x13')]['update'](_0x5adaaa[_0x3387('0x14')],{'raw':_0x5adaaa[_0x3387('0x15')]?_0x5adaaa[_0x3387('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5adaaa['options']?_0x5adaaa[_0x3387('0x15')]['where']||null:null,'attributes':_0x5adaaa[_0x3387('0x15')]?_0x5adaaa[_0x3387('0x15')][_0x3387('0x16')]||null:null,'limit':_0x5adaaa['options']?_0x5adaaa[_0x3387('0x15')][_0x3387('0x17')]||null:null})['then'](function(_0x56ab1e){logger[_0x3387('0x18')]('UpdateFaxApplication',_0x5adaaa);logger[_0x3387('0x19')](_0x3387('0x1a'),_0x5adaaa,JSON[_0x3387('0x1b')](_0x56ab1e));_0x313915(_0x56ab1e);})[_0x3387('0x1c')](function(_0x266641){logger['error'](_0x3387('0x1a'),_0x266641[_0x3387('0x12')],_0x5adaaa);_0x118f03(_0x212514[_0x3387('0x10')](0x1f4,_0x266641['message']));});});}; \ No newline at end of file +var _0x059d=['../../config/logger','rpc','jayson/promise','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxApplication','update','body','options','where','attributes','UpdateFaxApplication','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ffb89,_0x17f6ee){var _0x433ad9=function(_0x18d01f){while(--_0x18d01f){_0x4ffb89['push'](_0x4ffb89['shift']());}};_0x433ad9(++_0x17f6ee);}(_0x059d,0x17f));var _0xd059=function(_0x4a3970,_0x39a6e3){_0x4a3970=_0x4a3970-0x0;var _0x31c34f=_0x059d[_0x4a3970];return _0x31c34f;};'use strict';var _=require(_0xd059('0x0'));var util=require(_0xd059('0x1'));var moment=require(_0xd059('0x2'));var BPromise=require(_0xd059('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd059('0x4'));var db=require(_0xd059('0x5'))['db'];var utils=require(_0xd059('0x6'));var logger=require(_0xd059('0x7'))(_0xd059('0x8'));var config=require('../../config/environment');var jayson=require(_0xd059('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9dca9e,_0x5b8703,_0x15da61){return new BPromise(function(_0x5a5755,_0x5840f8){return client[_0xd059('0xa')](_0x9dca9e,_0x15da61)[_0xd059('0xb')](function(_0x3d6eef){logger['info'](_0xd059('0xc'),_0x5b8703,_0xd059('0xd'));logger['debug'](_0xd059('0xe'),_0x5b8703,_0xd059('0xd'),JSON[_0xd059('0xf')](_0x3d6eef));if(_0x3d6eef[_0xd059('0x10')]){if(_0x3d6eef[_0xd059('0x10')][_0xd059('0x11')]===0x1f4){logger['error'](_0xd059('0xc'),_0x5b8703,_0x3d6eef[_0xd059('0x10')][_0xd059('0x12')]);return _0x5840f8(_0x3d6eef[_0xd059('0x10')][_0xd059('0x12')]);}logger[_0xd059('0x10')](_0xd059('0xc'),_0x5b8703,_0x3d6eef['error'][_0xd059('0x12')]);return _0x5a5755(_0x3d6eef['error'][_0xd059('0x12')]);}else{logger[_0xd059('0x13')](_0xd059('0xc'),_0x5b8703,_0xd059('0xd'));_0x5a5755(_0x3d6eef[_0xd059('0x14')][_0xd059('0x12')]);}})[_0xd059('0x15')](function(_0x2c0438){logger['error'](_0xd059('0xc'),_0x5b8703,_0x2c0438);_0x5840f8(_0x2c0438);});});}exports['UpdateFaxApplication']=function(_0xf7d5b2){var _0x27ca63=this;return new Promise(function(_0x5846ac,_0x3dfe76){return db[_0xd059('0x16')][_0xd059('0x17')](_0xf7d5b2[_0xd059('0x18')],{'raw':_0xf7d5b2[_0xd059('0x19')]?_0xf7d5b2[_0xd059('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf7d5b2[_0xd059('0x19')]?_0xf7d5b2[_0xd059('0x19')][_0xd059('0x1a')]||null:null,'attributes':_0xf7d5b2[_0xd059('0x19')]?_0xf7d5b2[_0xd059('0x19')][_0xd059('0x1b')]||null:null,'limit':_0xf7d5b2[_0xd059('0x19')]?_0xf7d5b2[_0xd059('0x19')]['limit']||null:null})['then'](function(_0x95a708){logger[_0xd059('0x13')](_0xd059('0x1c'),_0xf7d5b2);logger[_0xd059('0x1d')](_0xd059('0x1c'),_0xf7d5b2,JSON['stringify'](_0x95a708));_0x5846ac(_0x95a708);})[_0xd059('0x15')](function(_0x5a369b){logger[_0xd059('0x10')]('UpdateFaxApplication',_0x5a369b[_0xd059('0x12')],_0xf7d5b2);_0x3dfe76(_0x27ca63[_0xd059('0x10')](0x1f4,_0x5a369b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 430f7ad..1d10820 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 _0xeffd=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x35dadd,_0x3ed50f){var _0x2728ed=function(_0x80656f){while(--_0x80656f){_0x35dadd['push'](_0x35dadd['shift']());}};_0x2728ed(++_0x3ed50f);}(_0xeffd,0x6b));var _0xdeff=function(_0x2a5c2b,_0x1ef7a6){_0x2a5c2b=_0x2a5c2b-0x0;var _0xb4ce07=_0xeffd[_0x2a5c2b];return _0xb4ce07;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var auth=require(_0xdeff('0x5'));var interaction=require(_0xdeff('0x6'));var config=require(_0xdeff('0x7'));var controller=require(_0xdeff('0x8'));router[_0xdeff('0x9')]('/',auth[_0xdeff('0xa')](),controller[_0xdeff('0xb')]);router[_0xdeff('0x9')](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller[_0xdeff('0xd')]);router[_0xdeff('0xe')]('/',auth[_0xdeff('0xa')](),controller['create']);router[_0xdeff('0xf')](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller['update']);router[_0xdeff('0x10')](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller[_0xdeff('0x11')]);module[_0xdeff('0x12')]=router; \ No newline at end of file +var _0xe5b5=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xb400ce,_0x51e8dc){var _0x50b4bc=function(_0x3bf6d4){while(--_0x3bf6d4){_0xb400ce['push'](_0xb400ce['shift']());}};_0x50b4bc(++_0x51e8dc);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0xe5b5[_0x5a7d5f];return _0x5dcded;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var auth=require(_0x5e5b('0x6'));var interaction=require(_0x5e5b('0x7'));var config=require(_0x5e5b('0x8'));var controller=require(_0x5e5b('0x9'));router[_0x5e5b('0xa')]('/',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xc')]);router[_0x5e5b('0xa')](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xe')]);router[_0x5e5b('0xf')]('/',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x10')]);router[_0x5e5b('0x11')](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller['update']);router[_0x5e5b('0x12')]('/:id',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x13')]);module[_0x5e5b('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 59da706..e740a29 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 _0x81cf=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x81cf,0x89));var _0xf81c=function(_0x1f4be1,_0x111849){_0x1f4be1=_0x1f4be1-0x0;var _0x45e879=_0x81cf[_0x1f4be1];return _0x45e879;};'use strict';var Sequelize=require('sequelize');module[_0xf81c('0x0')]={'closed':{'type':Sequelize[_0xf81c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf81c('0x2')]},'disposition':{'type':Sequelize[_0xf81c('0x3')]},'note':{'type':Sequelize[_0xf81c('0x3')]},'read1stAt':{'type':Sequelize[_0xf81c('0x2')]},'fax':{'type':Sequelize[_0xf81c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf81c('0x4')]('in',_0xf81c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf81c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf81c('0x4')]('in',_0xf81c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x924a=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4595ac,_0x4a6c83){var _0x13c73c=function(_0x3b5faf){while(--_0x3b5faf){_0x4595ac['push'](_0x4595ac['shift']());}};_0x13c73c(++_0x4a6c83);}(_0x924a,0xf4));var _0xa924=function(_0xd6ea6a,_0xebcf57){_0xd6ea6a=_0xd6ea6a-0x0;var _0xc242f8=_0x924a[_0xd6ea6a];return _0xc242f8;};'use strict';var Sequelize=require(_0xa924('0x0'));module[_0xa924('0x1')]={'closed':{'type':Sequelize[_0xa924('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa924('0x3')]},'disposition':{'type':Sequelize[_0xa924('0x4')]},'note':{'type':Sequelize[_0xa924('0x4')]},'read1stAt':{'type':Sequelize[_0xa924('0x3')]},'fax':{'type':Sequelize[_0xa924('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa924('0x5')]('in',_0xa924('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa924('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa924('0x6')),'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 6a6829c..07f3487 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 _0xd8a5=['Content-Range','apply','reject','save','then','destroy','send','Users','map','TagIds','Tags','forEach','push','catch','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','field','name','color','tools_tags','select','from','fax_messages','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','c.email','filter','isNil','FaxAccountId','i.FaxAccountId\x20IN\x20?','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','unreadMessages','toString','sequelize','keyBy','merge','COUNT(me.id)','Account.key','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','params','FaxInteraction','includeAll','include','options','create','body','update','find','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','rawAttributes','FaxInteractionId','split','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','faxInteractionTags:save','removeTags','join','root','server','files','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','pipe','createWriteStream','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','count','limit','set'];(function(_0xe11921,_0x3c1e04){var _0x3cf02e=function(_0x289299){while(--_0x289299){_0xe11921['push'](_0xe11921['shift']());}};_0x3cf02e(++_0x3c1e04);}(_0xd8a5,0xa5));var _0x5d8a=function(_0x4f778f,_0x80c5b1){_0x4f778f=_0x4f778f-0x0;var _0x5513ef=_0xd8a5[_0x4f778f];return _0x5513ef;};'use strict';var pdf=require(_0x5d8a('0x0'));var emlformat=require(_0x5d8a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x2'));var jsonpatch=require(_0x5d8a('0x3'));var rp=require('request-promise');var moment=require(_0x5d8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5d8a('0x5'));var util=require('util');var path=require(_0x5d8a('0x6'));var sox=require(_0x5d8a('0x7'));var csv=require(_0x5d8a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5d8a('0x9'));var squel=require(_0x5d8a('0xa'));var crypto=require(_0x5d8a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d8a('0xc'));var toCsv=require(_0x5d8a('0x8'));var querystring=require(_0x5d8a('0xd'));var Papa=require(_0x5d8a('0xe'));var Redis=require('ioredis');var authService=require(_0x5d8a('0xf'));var qs=require(_0x5d8a('0x10'));var hardwareService=require(_0x5d8a('0x11'));var logger=require(_0x5d8a('0x12'))(_0x5d8a('0x13'));var utils=require(_0x5d8a('0x14'));var config=require(_0x5d8a('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5d8a('0x16')](config[_0x5d8a('0x17')],{'host':_0x5d8a('0x18'),'port':0x18eb});var socket=require(_0x5d8a('0x19'))(new Redis(config[_0x5d8a('0x17')]));require(_0x5d8a('0x1a'))['register'](socket);function respondWithStatusCode(_0xf4e85f,_0x2b617d){_0x2b617d=_0x2b617d||0xcc;return function(_0x1933fe){if(_0x1933fe){return _0xf4e85f[_0x5d8a('0x1b')](_0x2b617d);}return _0xf4e85f[_0x5d8a('0x1c')](_0x2b617d)[_0x5d8a('0x1d')]();};}function respondWithResult(_0x21c88e,_0x5c16c2){_0x5c16c2=_0x5c16c2||0xc8;return function(_0x5e3b49){if(_0x5e3b49){return _0x21c88e[_0x5d8a('0x1c')](_0x5c16c2)[_0x5d8a('0x1e')](_0x5e3b49);}};}function respondWithFilteredResult(_0x7686fb,_0x2f715a){return function(_0x16432c){if(_0x16432c){var _0x7089b6=_0x16432c[_0x5d8a('0x1f')],_0x1f0315=_0x2f715a['offset'],_0x5e0eeb=_0x2f715a['offset']+_0x2f715a[_0x5d8a('0x20')],_0x54a49b;if(_0x5e0eeb>=_0x7089b6){_0x5e0eeb=_0x7089b6;_0x54a49b=0xc8;}else{_0x54a49b=0xce;}_0x7686fb[_0x5d8a('0x1c')](_0x54a49b);return _0x7686fb[_0x5d8a('0x21')](_0x5d8a('0x22'),_0x1f0315+'-'+_0x5e0eeb+'/'+_0x7089b6)[_0x5d8a('0x1e')](_0x16432c);}return null;};}function patchUpdates(_0xf628bc){return function(_0x51da47){try{jsonpatch[_0x5d8a('0x23')](_0x51da47,_0xf628bc,!![]);}catch(_0x1a7afb){return BPromise[_0x5d8a('0x24')](_0x1a7afb);}return _0x51da47[_0x5d8a('0x25')]();};}function saveUpdates(_0x345be9,_0x5d21c9){return function(_0x2d63da){if(_0x2d63da){return _0x2d63da['update'](_0x345be9)[_0x5d8a('0x26')](function(_0x18b9f9){return _0x18b9f9;});}return null;};}function removeEntity(_0x287f7e,_0x251d5d){return function(_0x830126){if(_0x830126){return _0x830126[_0x5d8a('0x27')]()[_0x5d8a('0x26')](function(){_0x287f7e[_0x5d8a('0x1c')](0xcc)[_0x5d8a('0x1d')]();});}};}function handleEntityNotFound(_0x15f2cd,_0x3e6a34){return function(_0x5803c1){if(!_0x5803c1){_0x15f2cd['sendStatus'](0x194);}return _0x5803c1;};}function handleError(_0x590870,_0x143ce1){_0x143ce1=_0x143ce1||0x1f4;return function(_0xa32f3e){logger['error'](_0xa32f3e['stack']);if(_0xa32f3e['name']){delete _0xa32f3e['name'];}_0x590870[_0x5d8a('0x1c')](_0x143ce1)[_0x5d8a('0x28')](_0xa32f3e);};}function getInteractionUsers(_0xe950b,_0x483aec){return new BPromise(function(_0x3a43ca,_0x14c390){try{if(_0x483aec[_0xe950b['id']]){_0xe950b[_0x5d8a('0x29')]=_[_0x5d8a('0x2a')](_0x483aec[_0xe950b['id']],function(_0x379075){return{'id':_0x379075['id']};});}}catch(_0x3de0d6){_0x14c390(_0x3de0d6);}_0x3a43ca(_0xe950b);});}function getInteractionTags(_0x488caf,_0x2e7df5){return new BPromise(function(_0x8390c3,_0x4acb6b){try{if(_0x488caf[_0x5d8a('0x2b')]){_0x488caf[_0x5d8a('0x2c')]=[];_0x488caf[_0x5d8a('0x2b')]['split'](',')[_0x5d8a('0x2d')](function(_0x28a92a){_0x488caf[_0x5d8a('0x2c')][_0x5d8a('0x2e')](_0x2e7df5[_0x28a92a]);});}delete _0x488caf[_0x5d8a('0x2b')];}catch(_0x3ae5f9){_0x4acb6b(_0x3ae5f9);}_0x8390c3(_0x488caf);});}function updateFaxInteraction(_0x2cebd9,_0x4ff152,_0x556c8f){return new BPromise(function(_0x2fda01,_0x3c3965){return getInteractionUsers(_0x2cebd9,_0x556c8f)['then'](function(_0x42cb4b){return getInteractionTags(_0x42cb4b,_0x4ff152);})[_0x5d8a('0x26')](function(_0x5dae93){_0x2fda01(_0x5dae93);})[_0x5d8a('0x2f')](function(_0x7e021d){_0x3c3965(_0x7e021d);});});}exports[_0x5d8a('0x30')]=function(_0x633156,_0x25266f){var _0x4b2b1f={},_0x4a8b47={},_0x19075e={'count':0x0,'rows':[]};var _0x214f8c=db['FaxInteraction']['rawAttributes'];_0x4a8b47[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](_0x214f8c);_0x4a8b47[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x633156[_0x5d8a('0x33')]);_0x4a8b47[_0x5d8a('0x34')]=_[_0x5d8a('0x35')](_0x4a8b47['model'],_0x4a8b47[_0x5d8a('0x33')]);_0x4b2b1f[_0x5d8a('0x36')]=_[_0x5d8a('0x35')](_0x4a8b47[_0x5d8a('0x31')],qs[_0x5d8a('0x37')](_0x633156[_0x5d8a('0x33')][_0x5d8a('0x37')]));_0x4b2b1f[_0x5d8a('0x36')]=_0x4b2b1f[_0x5d8a('0x36')][_0x5d8a('0x38')]?_0x4b2b1f[_0x5d8a('0x36')]:_0x4a8b47[_0x5d8a('0x31')];if(!_0x633156[_0x5d8a('0x33')][_0x5d8a('0x39')](_0x5d8a('0x3a'))){_0x4b2b1f[_0x5d8a('0x20')]=qs[_0x5d8a('0x20')](_0x633156[_0x5d8a('0x33')][_0x5d8a('0x20')]);_0x4b2b1f[_0x5d8a('0x3b')]=qs[_0x5d8a('0x3b')](_0x633156['query']['offset']);}_0x4b2b1f[_0x5d8a('0x3c')]=qs[_0x5d8a('0x3d')](_0x633156['query'][_0x5d8a('0x3d')]);_0x4b2b1f[_0x5d8a('0x3e')]=qs[_0x5d8a('0x34')](_['pick'](_0x633156[_0x5d8a('0x33')],_0x4a8b47[_0x5d8a('0x34')]));var _0x5e3ff5=[];var _0x2beaa9=squel['select']()[_0x5d8a('0x3f')]('id')[_0x5d8a('0x3f')](_0x5d8a('0x40'))[_0x5d8a('0x3f')](_0x5d8a('0x41'))['from'](_0x5d8a('0x42'));var _0x38a729=squel[_0x5d8a('0x43')]()[_0x5d8a('0x3f')]('COUNT(*)')[_0x5d8a('0x44')](_0x5d8a('0x45'),'me')['where'](_0x5d8a('0x46'))[_0x5d8a('0x3e')](_0x5d8a('0x47'))[_0x5d8a('0x3e')](_0x5d8a('0x48'));var _0x363353=squel[_0x5d8a('0x43')]()[_0x5d8a('0x3f')]('u.id')[_0x5d8a('0x3f')]('ui.FaxInteractionId')[_0x5d8a('0x44')](_0x5d8a('0x49'),'ui')[_0x5d8a('0x4a')](_0x5d8a('0x4b'),'u',_0x5d8a('0x4c'));var _0x273e87=squel[_0x5d8a('0x43')]()[_0x5d8a('0x44')](_0x5d8a('0x4d'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5d8a('0x4a')](_0x5d8a('0x4b'),'o',_0x5d8a('0x4e'))[_0x5d8a('0x4a')](_0x5d8a('0x4f'),'a',_0x5d8a('0x50'))[_0x5d8a('0x4a')](_0x5d8a('0x45'),'me',_0x5d8a('0x51'));var _0x2bb9ba=squel[_0x5d8a('0x52')]();if(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x53')]){var _0x548210=JSON[_0x5d8a('0x54')](_0x633156[_0x5d8a('0x33')][_0x5d8a('0x53')]);_[_0x5d8a('0x32')](_0x548210)['forEach'](function(_0x58488a){var _0x311f61=_0x548210[_0x58488a];if(_0x58488a===_0x5d8a('0x55')){var _0x5c5cd2=moment(_0x311f61[_0x5d8a('0x56')][_0x5d8a('0x57')])[_0x5d8a('0x58')](_0x5d8a('0x59'))[_0x5d8a('0x5a')]()[_0x5d8a('0x5b')]();var _0x57e03f=moment(_0x57e03f)[_0x5d8a('0x5a')]()[_0x5d8a('0x5c')](_0x5d8a('0x59'))['format']();_0x2bb9ba[_0x5d8a('0x5d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5c5cd2,_0x57e03f);}else{if(_[_0x5d8a('0x5e')](_0x311f61['condition'])){_0x311f61[_0x5d8a('0x5f')][_0x5d8a('0x2d')](function(_0x4a0650){switch(_0x311f61['condition'][_0x5d8a('0x56')]){case'IS':if(_0x58488a!==_0x5d8a('0x60')&&_0x58488a!=='unreadMessages'){if(_['isArray'](_0x311f61['value'])&&_0x311f61[_0x5d8a('0x56')]['length']>0x1){_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x62'),_0x311f61[_0x5d8a('0x56')]);}else{_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61['tableAlias']+'.'+_0x58488a+_0x5d8a('0x63'),_0x311f61[_0x5d8a('0x56')][0x0]);}}break;case'=':_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x63'),_0x311f61['value']);break;case _0x5d8a('0x64'):if(_0x58488a===_0x5d8a('0x65')){_0x2bb9ba[_0x5d8a('0x5d')](_0x5d8a('0x66')+_0x5d8a('0x67'),'%'+_0x311f61[_0x5d8a('0x56')]+'%');_0x2bb9ba['or'](_0x5d8a('0x68')+'\x20LIKE\x20?','%'+_0x311f61[_0x5d8a('0x56')]+'%');_0x2bb9ba['or']('c.email'+_0x5d8a('0x67'),'%'+_0x311f61[_0x5d8a('0x56')]+'%');}else{_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x67'),'%'+_0x311f61['value']+'%');}break;case'>':_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x69'),_0x311f61[_0x5d8a('0x56')]);break;case'<':_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61['tableAlias']+'.'+_0x58488a+_0x5d8a('0x6a'),_0x311f61[_0x5d8a('0x56')]);break;}});}else{switch(_0x311f61[_0x5d8a('0x5f')]['value']){case'IS':if(_0x58488a!==_0x5d8a('0x60')&&_0x58488a!=='unreadMessages'){if(_[_0x5d8a('0x5e')](_0x311f61[_0x5d8a('0x56')])&&_0x311f61[_0x5d8a('0x56')][_0x5d8a('0x38')]>0x1){_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+'\x20IN\x20?',_0x311f61[_0x5d8a('0x56')]);}else{_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x63'),_0x311f61[_0x5d8a('0x56')][0x0]);}}break;case'=':_0x2bb9ba['and'](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+'\x20=\x20?',_0x311f61[_0x5d8a('0x56')]);break;case _0x5d8a('0x64'):if(_0x58488a===_0x5d8a('0x65')){_0x2bb9ba[_0x5d8a('0x5d')](_0x5d8a('0x66')+_0x5d8a('0x67'),'%'+_0x311f61[_0x5d8a('0x56')]+'%');_0x2bb9ba['or'](_0x5d8a('0x68')+_0x5d8a('0x67'),'%'+_0x311f61[_0x5d8a('0x56')]+'%');_0x2bb9ba['or'](_0x5d8a('0x6b')+_0x5d8a('0x67'),'%'+_0x311f61[_0x5d8a('0x56')]+'%');}else{_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+_0x5d8a('0x67'),'%'+_0x311f61['value']+'%');}break;case'>':_0x2bb9ba[_0x5d8a('0x5d')](_0x311f61[_0x5d8a('0x61')]+'.'+_0x58488a+'\x20>\x20?',_0x311f61[_0x5d8a('0x56')]);break;case'<':_0x2bb9ba['and'](_0x311f61['tableAlias']+'.'+_0x58488a+_0x5d8a('0x6a'),_0x311f61[_0x5d8a('0x56')]);break;}}}});}else{var _0x239c8e=_(Object[_0x5d8a('0x32')](_0x633156['query']))['map'](function(_0x426dbb){return _0x214f8c[_0x5d8a('0x39')](_0x426dbb)?_0x426dbb:undefined;})[_0x5d8a('0x6c')](function(_0x15649a){return!_[_0x5d8a('0x6d')](_0x15649a);})[_0x5d8a('0x56')]();if(!_['isEmpty'](_0x239c8e)){_0x239c8e[_0x5d8a('0x2d')](function(_0xde0c05){if(_0xde0c05===_0x5d8a('0x6e')){_0x273e87[_0x5d8a('0x3e')](_0x5d8a('0x6f'),[]['concat'](_0x633156[_0x5d8a('0x33')][_0xde0c05]));}else if(_0xde0c05===_0x5d8a('0x55')){var _0x574d07=JSON[_0x5d8a('0x54')](_0x633156['query'][_0xde0c05])[_0x5d8a('0x70')];var _0x2441de=JSON[_0x5d8a('0x54')](_0x633156[_0x5d8a('0x33')][_0xde0c05])['$lte'];_0x273e87['where'](_0x5d8a('0x71'),_0x574d07,_0x2441de);}else{if(_0x633156[_0x5d8a('0x33')][_0xde0c05]===_0x5d8a('0x72')){_0x273e87[_0x5d8a('0x3e')]('i.'+_0xde0c05+'\x20IS\x20NULL');}else{_0x273e87[_0x5d8a('0x3e')]('i.'+_0xde0c05+_0x5d8a('0x63'),_0x633156['query'][_0xde0c05]);}}});}if(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x6c')]){var _0x45df94=_0x633156[_0x5d8a('0x33')]['filter']['replace']('\x5c','\x5c\x5c')[_0x5d8a('0x73')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x45df94)){_0x2bb9ba['or'](_0x5d8a('0x74'),_0x45df94+'%')['or'](_0x5d8a('0x75'),_0x45df94+'%');}_0x2bb9ba['or'](_0x5d8a('0x76'),_0x45df94+'%');}}_0x273e87['where'](_0x2bb9ba);if(_0x4b2b1f[_0x5d8a('0x3c')]){_0x4b2b1f[_0x5d8a('0x3c')]['forEach'](function(_0x4106e6){_0x273e87[_0x5d8a('0x3c')]('i.'+_0x4106e6[0x0],_0x4106e6[0x1]==='DESC'?![]:!![]);});}_0x273e87[_0x5d8a('0x77')](_0x5d8a('0x78'));var _0x36723c={'type':db[_0x5d8a('0x79')][_0x5d8a('0x7a')][_0x5d8a('0x7b')],'raw':!![]};var _0x5481c9=_0x273e87[_0x5d8a('0x7c')]()['field'](_0x5d8a('0x7d'))[_0x5d8a('0x3f')]('COUNT(me.id)','unreadMessages');if(!_0x633156['query'][_0x5d8a('0x53')]){if(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x7e')]){if(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x7e')]==0x1){_0x5481c9[_0x5d8a('0x7f')](_0x5d8a('0x80'));_0x273e87['having'](_0x5d8a('0x80'));}else{_0x5481c9[_0x5d8a('0x7f')]('`unreadMessages`\x20>\x200');_0x273e87[_0x5d8a('0x7f')](_0x5d8a('0x81'));}}if(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x82')]){var _0x32f1a3=_[_0x5d8a('0x5e')](_0x633156[_0x5d8a('0x33')][_0x5d8a('0x82')])?_0x633156[_0x5d8a('0x33')][_0x5d8a('0x82')]:new Array(_0x633156[_0x5d8a('0x33')][_0x5d8a('0x82')]);var _0x1e64fc=squel['expr']();_0x32f1a3['forEach'](function(_0x2e47cd){_0x1e64fc['or'](_0x5d8a('0x83'),'%,'+_0x2e47cd+',%');});_0x273e87[_0x5d8a('0x7f')](_0x1e64fc);_0x5481c9['left_join'](_0x5d8a('0x84'),'it',_0x5d8a('0x85'));_0x5481c9['left_join']('tools_tags','t',_0x5d8a('0x86'));_0x5481c9[_0x5d8a('0x3e')](_0x5d8a('0x87'),_0x32f1a3);}}else{var _0x548210=JSON[_0x5d8a('0x54')](_0x633156[_0x5d8a('0x33')][_0x5d8a('0x53')]);_[_0x5d8a('0x32')](_0x548210)[_0x5d8a('0x2d')](function(_0xd3304b){var _0xc05bb8=_0x548210[_0xd3304b];if(_0xd3304b===_0x5d8a('0x60')){var _0x2bd26a=_0xc05bb8['value'];var _0x37b1f0=squel[_0x5d8a('0x52')]();_0x2bd26a[_0x5d8a('0x2d')](function(_0x188612){_0x37b1f0['or'](_0x5d8a('0x83'),'%,'+_0x188612+',%');});_0x273e87['having'](_0x37b1f0);_0x5481c9[_0x5d8a('0x4a')](_0x5d8a('0x88'),'it',_0x5d8a('0x89'));_0x5481c9[_0x5d8a('0x4a')]('tools_tags','t',_0x5d8a('0x86'));_0x5481c9['where'](_0x5d8a('0x87'),_0x2bd26a);}else if(_0xd3304b===_0x5d8a('0x8a')){if(_0xc05bb8[_0x5d8a('0x56')][_0x5d8a('0x38')]===0x1){if(_0xc05bb8['value'][0x0]===0x1){_0x5481c9[_0x5d8a('0x7f')]('`unreadMessages`\x20=\x200');_0x273e87['having']('`unreadMessages`\x20=\x200');}else{_0x5481c9['having']('`unreadMessages`\x20>\x200');_0x273e87[_0x5d8a('0x7f')](_0x5d8a('0x81'));}}}});}db['sequelize'][_0x5d8a('0x33')](_0x5481c9[_0x5d8a('0x8b')](),_0x36723c)[_0x5d8a('0x26')](function(_0x540ed1){_0x19075e['count']=_0x540ed1[_0x5d8a('0x38')];if(_0x19075e[_0x5d8a('0x1f')]===0x0)return[];return db[_0x5d8a('0x8c')][_0x5d8a('0x33')](_0x2beaa9[_0x5d8a('0x8b')](),_0x36723c)[_0x5d8a('0x26')](function(_0x1e229a){_0x5e3ff5=_[_0x5d8a('0x8d')](_0x1e229a,'id');_0x36723c=_[_0x5d8a('0x8e')](_0x36723c,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x273e87[_0x5d8a('0x3f')](_0x5d8a('0x8f'),_0x5d8a('0x8a'));_0x273e87[_0x5d8a('0x3f')]('a.key',_0x5d8a('0x90'));_0x273e87['field']('i.*');_0x273e87[_0x5d8a('0x3f')]('c.firstName',_0x5d8a('0x91'));_0x273e87['field'](_0x5d8a('0x68'),_0x5d8a('0x92'));_0x273e87[_0x5d8a('0x3f')](_0x5d8a('0x6b'),'Contact.email');_0x273e87[_0x5d8a('0x3f')](_0x5d8a('0x93'),_0x5d8a('0x94'));_0x273e87[_0x5d8a('0x3f')]('c.mobile',_0x5d8a('0x95'));_0x273e87[_0x5d8a('0x3f')](_0x5d8a('0x96'),_0x5d8a('0x97'));_0x273e87[_0x5d8a('0x3f')](_0x5d8a('0x98'),_0x5d8a('0x2b'));_0x273e87[_0x5d8a('0x4a')](_0x5d8a('0x84'),'it',_0x5d8a('0x85'));_0x273e87[_0x5d8a('0x4a')]('tools_tags','t',_0x5d8a('0x86'));_0x273e87[_0x5d8a('0x20')](_0x4b2b1f[_0x5d8a('0x20')]);_0x273e87[_0x5d8a('0x3b')](_0x4b2b1f[_0x5d8a('0x3b')]);return db[_0x5d8a('0x8c')][_0x5d8a('0x33')](_0x273e87['toString'](),_0x36723c);})[_0x5d8a('0x26')](function(_0x338485){_0x363353['where'](_0x5d8a('0x99'),_[_0x5d8a('0x2a')](_0x338485,'id'));return db[_0x5d8a('0x8c')]['query'](_0x363353[_0x5d8a('0x8b')](),_0x36723c)[_0x5d8a('0x26')](function(_0x689c90){var _0x42ec02=_[_0x5d8a('0x9a')](_0x689c90,'FaxInteractionId');var _0x46e1b8=[];_0x338485['forEach'](function(_0x3f7a60){_0x46e1b8['push'](updateFaxInteraction(_0x3f7a60,_0x5e3ff5,_0x42ec02));});return BPromise[_0x5d8a('0x9b')](_0x46e1b8);});});})[_0x5d8a('0x26')](function(_0x2bfeb5){_0x19075e[_0x5d8a('0x9c')]=_0x2bfeb5;return _0x19075e;})[_0x5d8a('0x26')](respondWithFilteredResult(_0x25266f,_0x4b2b1f))[_0x5d8a('0x2f')](handleError(_0x25266f,null));};exports[_0x5d8a('0x9d')]=function(_0x1622f2,_0x4849f4){var _0x2124be={'raw':![],'where':{'id':_0x1622f2[_0x5d8a('0x9e')]['id']}},_0x1fc1b3={};_0x1fc1b3[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](db[_0x5d8a('0x9f')]['rawAttributes']);_0x1fc1b3[_0x5d8a('0x33')]=_['keys'](_0x1622f2[_0x5d8a('0x33')]);_0x1fc1b3[_0x5d8a('0x34')]=_['intersection'](_0x1fc1b3[_0x5d8a('0x31')],_0x1fc1b3['query']);_0x2124be[_0x5d8a('0x36')]=_['intersection'](_0x1fc1b3[_0x5d8a('0x31')],qs[_0x5d8a('0x37')](_0x1622f2[_0x5d8a('0x33')][_0x5d8a('0x37')]));_0x2124be['attributes']=_0x2124be[_0x5d8a('0x36')][_0x5d8a('0x38')]?_0x2124be[_0x5d8a('0x36')]:_0x1fc1b3[_0x5d8a('0x31')];if(_0x1622f2[_0x5d8a('0x33')][_0x5d8a('0xa0')]){_0x2124be[_0x5d8a('0xa1')]=[{'all':!![]}];}_0x2124be=_[_0x5d8a('0x8e')]({},_0x2124be,_0x1622f2[_0x5d8a('0xa2')]);return db[_0x5d8a('0x9f')]['find'](_0x2124be)[_0x5d8a('0x26')](handleEntityNotFound(_0x4849f4,null))['then'](respondWithResult(_0x4849f4,null))[_0x5d8a('0x2f')](handleError(_0x4849f4,null));};exports[_0x5d8a('0xa3')]=function(_0x4b5496,_0x2ffa96){return db[_0x5d8a('0x9f')][_0x5d8a('0xa3')](_0x4b5496[_0x5d8a('0xa4')],{})[_0x5d8a('0x26')](respondWithResult(_0x2ffa96,0xc9))['catch'](handleError(_0x2ffa96,null));};exports[_0x5d8a('0xa5')]=function(_0x5efd44,_0x50e087){if(_0x5efd44[_0x5d8a('0xa4')]['id']){delete _0x5efd44[_0x5d8a('0xa4')]['id'];}return db[_0x5d8a('0x9f')][_0x5d8a('0xa6')]({'where':{'id':_0x5efd44[_0x5d8a('0x9e')]['id']}})['then'](handleEntityNotFound(_0x50e087,null))[_0x5d8a('0x26')](saveUpdates(_0x5efd44['body'],null))[_0x5d8a('0x26')](respondWithResult(_0x50e087,null))[_0x5d8a('0x2f')](handleError(_0x50e087,null));};exports[_0x5d8a('0x27')]=function(_0x2f5db7,_0x335acb){return db['FaxInteraction']['find']({'where':{'id':_0x2f5db7['params']['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x335acb,null))[_0x5d8a('0x26')](removeEntity(_0x335acb,null))[_0x5d8a('0x2f')](handleError(_0x335acb,null));};exports[_0x5d8a('0xa7')]=function(_0x32d442,_0x2cb936){return db['FaxInteraction'][_0x5d8a('0xa7')]()[_0x5d8a('0x26')](respondWithResult(_0x2cb936,null))[_0x5d8a('0x2f')](handleError(_0x2cb936,null));};exports[_0x5d8a('0xa8')]=function(_0x1764ac,_0x4619f8,_0x363999){return db[_0x5d8a('0xa9')][_0x5d8a('0xa6')]({'where':{'id':_0x1764ac[_0x5d8a('0x9e')]['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x4619f8,null))[_0x5d8a('0x26')](function(_0x55aa61){if(_0x55aa61){return _0x55aa61[_0x5d8a('0xa8')](_0x1764ac[_0x5d8a('0xa4')][_0x5d8a('0xaa')],_[_0x5d8a('0xab')](_0x1764ac[_0x5d8a('0xa4')],[_0x5d8a('0xaa'),'id'])||{});}})['then'](respondWithResult(_0x4619f8,null))[_0x5d8a('0x2f')](handleError(_0x4619f8,null));};exports[_0x5d8a('0xac')]=function(_0x354dde,_0x5a8a4c,_0x349f4d){var _0x41fa2b={'raw':![],'where':{}};var _0x3197f={};var _0x454013={'count':0x0,'rows':[]};return db[_0x5d8a('0x9f')][_0x5d8a('0xad')]({'where':{'id':_0x354dde[_0x5d8a('0x9e')]['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x5a8a4c,null))[_0x5d8a('0x26')](function(_0x532105){if(_0x532105){_0x3197f['model']=_[_0x5d8a('0x32')](db[_0x5d8a('0xa9')][_0x5d8a('0xae')]);_0x3197f[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x354dde['query']);_0x3197f[_0x5d8a('0x34')]=_[_0x5d8a('0x35')](_0x3197f['model'],_0x3197f[_0x5d8a('0x33')]);_0x41fa2b[_0x5d8a('0x36')]=_['intersection'](_0x3197f['model'],qs[_0x5d8a('0x37')](_0x354dde['query'][_0x5d8a('0x37')]));_0x41fa2b['attributes']=_0x41fa2b['attributes']['length']?_0x41fa2b[_0x5d8a('0x36')]:_0x3197f[_0x5d8a('0x31')];if(!_0x354dde[_0x5d8a('0x33')][_0x5d8a('0x39')](_0x5d8a('0x3a'))){_0x41fa2b['limit']=qs[_0x5d8a('0x20')](_0x354dde[_0x5d8a('0x33')]['limit']);_0x41fa2b['offset']=qs[_0x5d8a('0x3b')](_0x354dde[_0x5d8a('0x33')][_0x5d8a('0x3b')]);}_0x41fa2b['order']=qs[_0x5d8a('0x3d')](_0x354dde[_0x5d8a('0x33')]['sort']);_0x41fa2b[_0x5d8a('0x3e')]=qs[_0x5d8a('0x34')](_['pick'](_0x354dde[_0x5d8a('0x33')],_0x3197f[_0x5d8a('0x34')]));_0x41fa2b[_0x5d8a('0x3e')][_0x5d8a('0xaf')]=_0x532105['id'];if(_0x354dde[_0x5d8a('0x33')]['filter']){_0x41fa2b['where']=_[_0x5d8a('0x8e')](_0x41fa2b['where'],{'$or':_[_0x5d8a('0x2a')](_0x41fa2b[_0x5d8a('0x36')],function(_0x2e0126){var _0x41db38={};_0x41db38[_0x2e0126]={'$like':'%'+_0x354dde[_0x5d8a('0x33')][_0x5d8a('0x6c')]+'%'};return _0x41db38;})});}if(_0x354dde['query'][_0x5d8a('0x70')]){var _0x4871a6=_0x354dde[_0x5d8a('0x33')][_0x5d8a('0x70')][_0x5d8a('0xb0')](',');var _0x422b03={};_0x422b03[_0x4871a6[0x0]]={'$gte':moment(_0x4871a6[0x1])[_0x5d8a('0x5b')](_0x5d8a('0xb1'))};_0x41fa2b['where']=_[_0x5d8a('0x8e')](_0x41fa2b[_0x5d8a('0x3e')],_0x422b03);}_0x41fa2b=_['merge']({},_0x41fa2b,_0x354dde[_0x5d8a('0xa2')]);return db['FaxMessage']['count']({'where':_0x41fa2b['where']})[_0x5d8a('0x26')](function(_0x180045){_0x454013['count']=_0x180045;if(_0x354dde['query'][_0x5d8a('0xa0')]){_0x41fa2b[_0x5d8a('0xa1')]=[{'all':!![]}];}return db[_0x5d8a('0xa9')][_0x5d8a('0xb2')](_0x41fa2b);})[_0x5d8a('0x26')](function(_0x5d5d02){_0x454013[_0x5d8a('0x9c')]=_0x5d5d02;return _0x454013;});}})[_0x5d8a('0x26')](respondWithFilteredResult(_0x5a8a4c,_0x41fa2b))[_0x5d8a('0x2f')](handleError(_0x5a8a4c,null));};exports[_0x5d8a('0xb3')]=function(_0x4362c9,_0x162490,_0x1f7703){return db[_0x5d8a('0x9f')][_0x5d8a('0xa6')]({'where':{'id':_0x4362c9['params']['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x162490,null))['then'](function(_0x2e48b6){if(_0x2e48b6){return _0x2e48b6[_0x5d8a('0xb4')](_0x4362c9[_0x5d8a('0xa4')][_0x5d8a('0xaa')],_[_0x5d8a('0xab')](_0x4362c9[_0x5d8a('0xa4')],[_0x5d8a('0xaa'),'id'])||{})[_0x5d8a('0xb5')](function(){return db[_0x5d8a('0xb6')][_0x5d8a('0xb2')]({'attributes':['id',_0x5d8a('0x40'),_0x5d8a('0x41')],'where':{'id':_0x4362c9[_0x5d8a('0xa4')]['ids']}});})['then'](function(_0x32571d){socket['emit'](_0x5d8a('0xb7'),{'id':Number(_0x4362c9[_0x5d8a('0x9e')]['id']),'tags':_0x32571d||[]});return{'id':Number(_0x4362c9[_0x5d8a('0x9e')]['id']),'tags':_0x32571d||[]};});}})[_0x5d8a('0x26')](respondWithResult(_0x162490,null))[_0x5d8a('0x2f')](handleError(_0x162490,null));};exports[_0x5d8a('0xb8')]=function(_0x26a81d,_0x121745,_0x109bb8){return db[_0x5d8a('0x9f')][_0x5d8a('0xa6')]({'where':{'id':_0x26a81d[_0x5d8a('0x9e')]['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x121745,null))['then'](function(_0x2025b6){if(_0x2025b6){return _0x2025b6[_0x5d8a('0xb8')](_0x26a81d['query']['ids']);}})[_0x5d8a('0x26')](respondWithStatusCode(_0x121745,null))['catch'](handleError(_0x121745,null));};exports['download']=function(_0x4a6844,_0x440c35){var _0x1c2898=moment()['unix']()[_0x5d8a('0x8b')]();var _0xfb19d8=path[_0x5d8a('0xb9')](config[_0x5d8a('0xba')],_0x5d8a('0xbb'),_0x5d8a('0xbc'),'attachments');var _0x18fd6d=path[_0x5d8a('0xb9')](config[_0x5d8a('0xba')],_0x5d8a('0xbb'),_0x5d8a('0xbc'),_0x5d8a('0xbd'));var _0x3b7652=path[_0x5d8a('0xb9')](_0x18fd6d,_0x1c2898);var _0x1119a6=util[_0x5d8a('0x5b')](_0x5d8a('0xbe'),_0x1c2898);var _0x133527=path[_0x5d8a('0xb9')](_0x18fd6d,_0x1119a6);var _0x65bac=![];return db['FaxInteraction'][_0x5d8a('0xa6')]({'where':{'id':_0x4a6844['params']['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x440c35,null))[_0x5d8a('0x26')](function(_0x400fad){if(_0x400fad){return _0x400fad[_0x5d8a('0xac')]({'attributes':['id',_0x5d8a('0xa4'),'createdAt'],'include':[{'model':db[_0x5d8a('0xbf')],'as':_0x5d8a('0xbf')}]});}return[];})[_0x5d8a('0x26')](function(_0x252c73){_0x65bac=_0x252c73[_0x5d8a('0x38')];if(_0x252c73[_0x5d8a('0x38')]){fs[_0x5d8a('0xc0')](_0x3b7652);for(var _0xd6632b=0x0;_0xd6632b<_0x252c73['length'];_0xd6632b++){var _0x588fa7=_0x252c73[_0xd6632b];var _0xf15e37=_0x588fa7[_0x5d8a('0xbf')];if(_0xf15e37){var _0x3defbd=path['join'](_0xfb19d8,_0xf15e37[_0x5d8a('0xc1')]);if(fs['existsSync'](_0x3defbd)){fs[_0x5d8a('0xc2')](_0x3defbd)[_0x5d8a('0xc3')](fs[_0x5d8a('0xc4')](path[_0x5d8a('0xb9')](_0x3b7652,_0xf15e37[_0x5d8a('0xc1')])));}}}}})[_0x5d8a('0x26')](function(){if(_0x65bac){return new BPromise(function(_0x349d1a,_0x37e351){zipdir(_0x3b7652,{'saveTo':_0x133527},function(_0x175a5d,_0x2fb251){if(_0x175a5d)return _0x37e351(_0x175a5d);return _0x349d1a(_0x2fb251);});});}})['then'](function(){if(_0x65bac){return new BPromise(function(_0x4e9979,_0x59fae8){rimraf(_0x3b7652,function(_0x2068b2){if(_0x2068b2)_0x59fae8(_0x2068b2);return _0x4e9979();});});}})[_0x5d8a('0x26')](function(){if(_0x65bac){return _0x440c35['download'](_0x133527,_0x1119a6,function(_0x4b217c){if(_0x4b217c){console['log'](_0x5d8a('0xc5'),_0x4b217c);}else{fs[_0x5d8a('0xc6')](_0x133527);}});}else{return _0x440c35[_0x5d8a('0x1b')](0xc8);}})[_0x5d8a('0x2f')](handleError(_0x440c35,null));}; \ No newline at end of file +var _0x0374=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','json','offset','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','index','FaxInteraction','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','select','color','from','tools_tags','field','COUNT(*)','fax_messages','where','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','createdAt','value','dateStart','utc','endOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','unreadMessages','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','TagId','\x20IN\x20?','map','filter','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','fax_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','count','keyBy','merge','a.key','Account.key','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','it.FaxInteractionId\x20=\x20i.id','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','include','find','create','body','catch','update','describe','FaxMessage','omit','ids','rawAttributes','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','findAll','spread','Tag','emit','faxInteractionTags:save','removeTags','root','server','files','join','tmp','interaction-%s.zip','getMessages','Attachment','mkdirSync','basename','createWriteStream','download','log','err','unlinkSync','html-pdf','eml-format'];(function(_0x518221,_0x4439d9){var _0x31796f=function(_0x552857){while(--_0x552857){_0x518221['push'](_0x518221['shift']());}};_0x31796f(++_0x4439d9);}(_0x0374,0x18e));var _0x4037=function(_0x187fe2,_0x10e06a){_0x187fe2=_0x187fe2-0x0;var _0x2d3f14=_0x0374[_0x187fe2];return _0x2d3f14;};'use strict';var pdf=require(_0x4037('0x0'));var emlformat=require(_0x4037('0x1'));var rimraf=require(_0x4037('0x2'));var zipdir=require(_0x4037('0x3'));var jsonpatch=require(_0x4037('0x4'));var rp=require(_0x4037('0x5'));var moment=require(_0x4037('0x6'));var BPromise=require(_0x4037('0x7'));var Mustache=require(_0x4037('0x8'));var util=require(_0x4037('0x9'));var path=require(_0x4037('0xa'));var sox=require(_0x4037('0xb'));var csv=require('to-csv');var ejs=require(_0x4037('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4037('0xd'));var jsforce=require(_0x4037('0xe'));var deskjs=require(_0x4037('0xf'));var toCsv=require(_0x4037('0x10'));var querystring=require(_0x4037('0x11'));var Papa=require(_0x4037('0x12'));var Redis=require(_0x4037('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4037('0x14'));var hardwareService=require(_0x4037('0x15'));var logger=require('../../config/logger')(_0x4037('0x16'));var utils=require(_0x4037('0x17'));var config=require(_0x4037('0x18'));var db=require(_0x4037('0x19'))['db'];config[_0x4037('0x1a')]=_[_0x4037('0x1b')](config[_0x4037('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4037('0x1a')]));require(_0x4037('0x1c'))[_0x4037('0x1d')](socket);function respondWithStatusCode(_0x4604b6,_0xe32913){_0xe32913=_0xe32913||0xcc;return function(_0x4f75b6){if(_0x4f75b6){return _0x4604b6[_0x4037('0x1e')](_0xe32913);}return _0x4604b6['status'](_0xe32913)['end']();};}function respondWithResult(_0x816df7,_0x2f0a0f){_0x2f0a0f=_0x2f0a0f||0xc8;return function(_0xec3c45){if(_0xec3c45){return _0x816df7[_0x4037('0x1f')](_0x2f0a0f)[_0x4037('0x20')](_0xec3c45);}};}function respondWithFilteredResult(_0xb50e47,_0x14e8b0){return function(_0x519d27){if(_0x519d27){var _0x45870b=_0x519d27['count'],_0x3c3574=_0x14e8b0[_0x4037('0x21')],_0x3bf91e=_0x14e8b0[_0x4037('0x21')]+_0x14e8b0[_0x4037('0x22')],_0x5521ae;if(_0x3bf91e>=_0x45870b){_0x3bf91e=_0x45870b;_0x5521ae=0xc8;}else{_0x5521ae=0xce;}_0xb50e47[_0x4037('0x1f')](_0x5521ae);return _0xb50e47['set'](_0x4037('0x23'),_0x3c3574+'-'+_0x3bf91e+'/'+_0x45870b)['json'](_0x519d27);}return null;};}function patchUpdates(_0x3099cf){return function(_0xfe2142){try{jsonpatch[_0x4037('0x24')](_0xfe2142,_0x3099cf,!![]);}catch(_0x55dfdc){return BPromise[_0x4037('0x25')](_0x55dfdc);}return _0xfe2142['save']();};}function saveUpdates(_0x2d426f,_0x29037d){return function(_0x4a29da){if(_0x4a29da){return _0x4a29da['update'](_0x2d426f)[_0x4037('0x26')](function(_0x23ad60){return _0x23ad60;});}return null;};}function removeEntity(_0x192a16,_0x33430){return function(_0x36428d){if(_0x36428d){return _0x36428d[_0x4037('0x27')]()[_0x4037('0x26')](function(){_0x192a16['status'](0xcc)[_0x4037('0x28')]();});}};}function handleEntityNotFound(_0x2b4005,_0x2858fa){return function(_0x593bf0){if(!_0x593bf0){_0x2b4005['sendStatus'](0x194);}return _0x593bf0;};}function handleError(_0x424fe3,_0x56f58f){_0x56f58f=_0x56f58f||0x1f4;return function(_0x16a6bc){logger[_0x4037('0x29')](_0x16a6bc[_0x4037('0x2a')]);if(_0x16a6bc['name']){delete _0x16a6bc[_0x4037('0x2b')];}_0x424fe3[_0x4037('0x1f')](_0x56f58f)[_0x4037('0x2c')](_0x16a6bc);};}function getInteractionUsers(_0x387b27,_0xd7aabb){return new BPromise(function(_0x35f674,_0x38b89f){try{if(_0xd7aabb[_0x387b27['id']]){_0x387b27[_0x4037('0x2d')]=_['map'](_0xd7aabb[_0x387b27['id']],function(_0x16d24a){return{'id':_0x16d24a['id']};});}}catch(_0x5ee673){_0x38b89f(_0x5ee673);}_0x35f674(_0x387b27);});}function getInteractionTags(_0x12cec9,_0x56a5ca){return new BPromise(function(_0x587332,_0x29b55a){try{if(_0x12cec9[_0x4037('0x2e')]){_0x12cec9[_0x4037('0x2f')]=[];_0x12cec9[_0x4037('0x2e')][_0x4037('0x30')](',')[_0x4037('0x31')](function(_0x240d48){_0x12cec9[_0x4037('0x2f')][_0x4037('0x32')](_0x56a5ca[_0x240d48]);});}delete _0x12cec9[_0x4037('0x2e')];}catch(_0x7cafdb){_0x29b55a(_0x7cafdb);}_0x587332(_0x12cec9);});}function updateFaxInteraction(_0x362d9b,_0x57d7e4,_0x3a9c4c){return new BPromise(function(_0xa535c7,_0x2f3cbb){return getInteractionUsers(_0x362d9b,_0x3a9c4c)[_0x4037('0x26')](function(_0x52fa51){return getInteractionTags(_0x52fa51,_0x57d7e4);})[_0x4037('0x26')](function(_0x4ceb0d){_0xa535c7(_0x4ceb0d);})['catch'](function(_0x3564b8){_0x2f3cbb(_0x3564b8);});});}exports[_0x4037('0x33')]=function(_0x37d79d,_0xe03cdc){var _0xee0da2={},_0x4e4144={},_0x47f1b9={'count':0x0,'rows':[]};var _0x297a19=db[_0x4037('0x34')]['rawAttributes'];_0x4e4144['model']=_[_0x4037('0x35')](_0x297a19);_0x4e4144[_0x4037('0x36')]=_[_0x4037('0x35')](_0x37d79d[_0x4037('0x36')]);_0x4e4144[_0x4037('0x37')]=_['intersection'](_0x4e4144['model'],_0x4e4144[_0x4037('0x36')]);_0xee0da2[_0x4037('0x38')]=_[_0x4037('0x39')](_0x4e4144[_0x4037('0x3a')],qs[_0x4037('0x3b')](_0x37d79d[_0x4037('0x36')][_0x4037('0x3b')]));_0xee0da2[_0x4037('0x38')]=_0xee0da2[_0x4037('0x38')][_0x4037('0x3c')]?_0xee0da2['attributes']:_0x4e4144['model'];if(!_0x37d79d[_0x4037('0x36')][_0x4037('0x3d')]('nolimit')){_0xee0da2[_0x4037('0x22')]=qs[_0x4037('0x22')](_0x37d79d[_0x4037('0x36')][_0x4037('0x22')]);_0xee0da2[_0x4037('0x21')]=qs['offset'](_0x37d79d['query'][_0x4037('0x21')]);}_0xee0da2[_0x4037('0x3e')]=qs[_0x4037('0x3f')](_0x37d79d[_0x4037('0x36')][_0x4037('0x3f')]);_0xee0da2['where']=qs['filters'](_['pick'](_0x37d79d[_0x4037('0x36')],_0x4e4144[_0x4037('0x37')]));var _0x265e44=[];var _0xc36279=squel[_0x4037('0x40')]()['field']('id')['field']('name')['field'](_0x4037('0x41'))[_0x4037('0x42')](_0x4037('0x43'));var _0x4f50c2=squel[_0x4037('0x40')]()[_0x4037('0x44')](_0x4037('0x45'))['from'](_0x4037('0x46'),'me')[_0x4037('0x47')](_0x4037('0x48'))[_0x4037('0x47')](_0x4037('0x49'))[_0x4037('0x47')](_0x4037('0x4a'));var _0xf45814=squel[_0x4037('0x40')]()[_0x4037('0x44')](_0x4037('0x4b'))[_0x4037('0x44')](_0x4037('0x4c'))[_0x4037('0x42')](_0x4037('0x4d'),'ui')[_0x4037('0x4e')](_0x4037('0x4f'),'u',_0x4037('0x50'));var _0x12f05e=squel[_0x4037('0x40')]()[_0x4037('0x42')](_0x4037('0x51'),'i')[_0x4037('0x4e')](_0x4037('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x4037('0x4f'),'o',_0x4037('0x53'))[_0x4037('0x4e')]('fax_accounts','a',_0x4037('0x54'))[_0x4037('0x4e')](_0x4037('0x46'),'me',_0x4037('0x55'));var _0x1235e9=squel[_0x4037('0x56')]();if(_0x37d79d['query']['advancedFilter']){var _0x4fa9e6=JSON['parse'](_0x37d79d['query']['advancedFilter']);_[_0x4037('0x35')](_0x4fa9e6)[_0x4037('0x31')](function(_0x26bad3){var _0x183c16=_0x4fa9e6[_0x26bad3];if(_0x26bad3===_0x4037('0x57')){var _0x23a667=moment(_0x183c16[_0x4037('0x58')][_0x4037('0x59')])['startOf']('day')[_0x4037('0x5a')]()['format']();var _0xa8fa1=moment(_0xa8fa1)[_0x4037('0x5a')]()[_0x4037('0x5b')](_0x4037('0x5c'))[_0x4037('0x5d')]();_0x1235e9[_0x4037('0x5e')](_0x4037('0x5f'),_0x23a667,_0xa8fa1);}else{if(_[_0x4037('0x60')](_0x183c16['condition'])){_0x183c16[_0x4037('0x61')][_0x4037('0x31')](function(_0x253e77){switch(_0x183c16[_0x4037('0x61')]['value']){case'IS':if(_0x26bad3!=='TagId'&&_0x26bad3!==_0x4037('0x62')){if(_['isArray'](_0x183c16['value'])&&_0x183c16[_0x4037('0x58')][_0x4037('0x3c')]>0x1){_0x1235e9[_0x4037('0x5e')](_0x183c16['tableAlias']+'.'+_0x26bad3+'\x20IN\x20?',_0x183c16[_0x4037('0x58')]);}else{_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+_0x4037('0x64'),_0x183c16[_0x4037('0x58')][0x0]);}}break;case'=':_0x1235e9['and'](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+'\x20=\x20?',_0x183c16[_0x4037('0x58')]);break;case _0x4037('0x65'):if(_0x26bad3===_0x4037('0x66')){_0x1235e9['and']('c.firstName'+_0x4037('0x67'),'%'+_0x183c16['value']+'%');_0x1235e9['or'](_0x4037('0x68')+_0x4037('0x67'),'%'+_0x183c16[_0x4037('0x58')]+'%');_0x1235e9['or'](_0x4037('0x69')+_0x4037('0x67'),'%'+_0x183c16['value']+'%');}else{_0x1235e9[_0x4037('0x5e')](_0x183c16['tableAlias']+'.'+_0x26bad3+'\x20LIKE\x20?','%'+_0x183c16[_0x4037('0x58')]+'%');}break;case'>':_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+'\x20>\x20?',_0x183c16['value']);break;case'<':_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+_0x4037('0x6a'),_0x183c16[_0x4037('0x58')]);break;}});}else{switch(_0x183c16['condition'][_0x4037('0x58')]){case'IS':if(_0x26bad3!==_0x4037('0x6b')&&_0x26bad3!=='unreadMessages'){if(_[_0x4037('0x60')](_0x183c16[_0x4037('0x58')])&&_0x183c16[_0x4037('0x58')]['length']>0x1){_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+_0x4037('0x6c'),_0x183c16[_0x4037('0x58')]);}else{_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+'\x20=\x20?',_0x183c16[_0x4037('0x58')][0x0]);}}break;case'=':_0x1235e9[_0x4037('0x5e')](_0x183c16['tableAlias']+'.'+_0x26bad3+_0x4037('0x64'),_0x183c16[_0x4037('0x58')]);break;case'LIKE':if(_0x26bad3===_0x4037('0x66')){_0x1235e9['and']('c.firstName'+_0x4037('0x67'),'%'+_0x183c16[_0x4037('0x58')]+'%');_0x1235e9['or'](_0x4037('0x68')+_0x4037('0x67'),'%'+_0x183c16[_0x4037('0x58')]+'%');_0x1235e9['or']('c.email'+'\x20LIKE\x20?','%'+_0x183c16[_0x4037('0x58')]+'%');}else{_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+'\x20LIKE\x20?','%'+_0x183c16[_0x4037('0x58')]+'%');}break;case'>':_0x1235e9[_0x4037('0x5e')](_0x183c16[_0x4037('0x63')]+'.'+_0x26bad3+'\x20>\x20?',_0x183c16[_0x4037('0x58')]);break;case'<':_0x1235e9[_0x4037('0x5e')](_0x183c16['tableAlias']+'.'+_0x26bad3+_0x4037('0x6a'),_0x183c16[_0x4037('0x58')]);break;}}}});}else{var _0x3aca75=_(Object['keys'](_0x37d79d['query']))[_0x4037('0x6d')](function(_0x523186){return _0x297a19[_0x4037('0x3d')](_0x523186)?_0x523186:undefined;})[_0x4037('0x6e')](function(_0x948f62){return!_['isNil'](_0x948f62);})[_0x4037('0x58')]();if(!_['isEmpty'](_0x3aca75)){_0x3aca75[_0x4037('0x31')](function(_0x351b5f){if(_0x351b5f===_0x4037('0x6f')){_0x12f05e[_0x4037('0x47')](_0x4037('0x70'),[][_0x4037('0x71')](_0x37d79d[_0x4037('0x36')][_0x351b5f]));}else if(_0x351b5f===_0x4037('0x57')){var _0xb47181=JSON['parse'](_0x37d79d[_0x4037('0x36')][_0x351b5f])[_0x4037('0x72')];var _0x43a73c=JSON['parse'](_0x37d79d[_0x4037('0x36')][_0x351b5f])[_0x4037('0x73')];_0x12f05e['where'](_0x4037('0x5f'),_0xb47181,_0x43a73c);}else{if(_0x37d79d[_0x4037('0x36')][_0x351b5f]===_0x4037('0x74')){_0x12f05e[_0x4037('0x47')]('i.'+_0x351b5f+_0x4037('0x75'));}else{_0x12f05e[_0x4037('0x47')]('i.'+_0x351b5f+_0x4037('0x64'),_0x37d79d[_0x4037('0x36')][_0x351b5f]);}}});}if(_0x37d79d['query']['filter']){var _0x5a007e=_0x37d79d[_0x4037('0x36')][_0x4037('0x6e')][_0x4037('0x76')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x4037('0x77')](_0x5a007e)){_0x1235e9['or'](_0x4037('0x78'),_0x5a007e+'%')['or']('i.fax\x20LIKE\x20?',_0x5a007e+'%');}_0x1235e9['or'](_0x4037('0x79'),_0x5a007e+'%');}}_0x12f05e[_0x4037('0x47')](_0x1235e9);if(_0xee0da2[_0x4037('0x3e')]){_0xee0da2[_0x4037('0x3e')][_0x4037('0x31')](function(_0x13b591){_0x12f05e['order']('i.'+_0x13b591[0x0],_0x13b591[0x1]===_0x4037('0x7a')?![]:!![]);});}_0x12f05e[_0x4037('0x7b')]('i.id');var _0x376c3a={'type':db[_0x4037('0x7c')][_0x4037('0x7d')][_0x4037('0x7e')],'raw':!![]};var _0x3f5a20=_0x12f05e[_0x4037('0x7f')]()['field'](_0x4037('0x45'))[_0x4037('0x44')](_0x4037('0x80'),_0x4037('0x62'));if(!_0x37d79d[_0x4037('0x36')]['advancedFilter']){if(_0x37d79d[_0x4037('0x36')][_0x4037('0x81')]){if(_0x37d79d['query'][_0x4037('0x81')]==0x1){_0x3f5a20[_0x4037('0x82')](_0x4037('0x83'));_0x12f05e['having'](_0x4037('0x83'));}else{_0x3f5a20[_0x4037('0x82')]('`unreadMessages`\x20>\x200');_0x12f05e['having'](_0x4037('0x84'));}}if(_0x37d79d['query']['tag']){var _0x21a646=_[_0x4037('0x60')](_0x37d79d[_0x4037('0x36')][_0x4037('0x85')])?_0x37d79d[_0x4037('0x36')][_0x4037('0x85')]:new Array(_0x37d79d['query'][_0x4037('0x85')]);var _0x5ef756=squel[_0x4037('0x56')]();_0x21a646['forEach'](function(_0x41be4c){_0x5ef756['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x41be4c+',%');});_0x12f05e[_0x4037('0x82')](_0x5ef756);_0x3f5a20[_0x4037('0x4e')](_0x4037('0x86'),'it','it.FaxInteractionId\x20=\x20i.id');_0x3f5a20[_0x4037('0x4e')](_0x4037('0x43'),'t',_0x4037('0x87'));_0x3f5a20[_0x4037('0x47')](_0x4037('0x88'),_0x21a646);}}else{var _0x4fa9e6=JSON['parse'](_0x37d79d[_0x4037('0x36')]['advancedFilter']);_[_0x4037('0x35')](_0x4fa9e6)[_0x4037('0x31')](function(_0x8e822e){var _0x24ecba=_0x4fa9e6[_0x8e822e];if(_0x8e822e===_0x4037('0x6b')){var _0x526793=_0x24ecba[_0x4037('0x58')];var _0x52d321=squel[_0x4037('0x56')]();_0x526793[_0x4037('0x31')](function(_0x232eb4){_0x52d321['or'](_0x4037('0x89'),'%,'+_0x232eb4+',%');});_0x12f05e['having'](_0x52d321);_0x3f5a20[_0x4037('0x4e')](_0x4037('0x8a'),'it',_0x4037('0x8b'));_0x3f5a20[_0x4037('0x4e')](_0x4037('0x43'),'t','t.id\x20=\x20it.TagId');_0x3f5a20[_0x4037('0x47')](_0x4037('0x88'),_0x526793);}else if(_0x8e822e===_0x4037('0x62')){if(_0x24ecba[_0x4037('0x58')][_0x4037('0x3c')]===0x1){if(_0x24ecba[_0x4037('0x58')][0x0]===0x1){_0x3f5a20[_0x4037('0x82')](_0x4037('0x83'));_0x12f05e[_0x4037('0x82')](_0x4037('0x83'));}else{_0x3f5a20[_0x4037('0x82')](_0x4037('0x84'));_0x12f05e[_0x4037('0x82')](_0x4037('0x84'));}}}});}db[_0x4037('0x8c')][_0x4037('0x36')](_0x3f5a20[_0x4037('0x8d')](),_0x376c3a)[_0x4037('0x26')](function(_0x5922b2){_0x47f1b9[_0x4037('0x8e')]=_0x5922b2['length'];if(_0x47f1b9[_0x4037('0x8e')]===0x0)return[];return db[_0x4037('0x8c')][_0x4037('0x36')](_0xc36279[_0x4037('0x8d')](),_0x376c3a)[_0x4037('0x26')](function(_0x5d142e){_0x265e44=_[_0x4037('0x8f')](_0x5d142e,'id');_0x376c3a=_[_0x4037('0x90')](_0x376c3a,{'model':db[_0x4037('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x12f05e[_0x4037('0x44')](_0x4037('0x80'),_0x4037('0x62'));_0x12f05e[_0x4037('0x44')](_0x4037('0x91'),_0x4037('0x92'));_0x12f05e[_0x4037('0x44')]('i.*');_0x12f05e[_0x4037('0x44')](_0x4037('0x93'),_0x4037('0x94'));_0x12f05e['field']('c.lastName',_0x4037('0x95'));_0x12f05e[_0x4037('0x44')](_0x4037('0x69'),_0x4037('0x96'));_0x12f05e['field'](_0x4037('0x97'),_0x4037('0x98'));_0x12f05e[_0x4037('0x44')](_0x4037('0x99'),_0x4037('0x9a'));_0x12f05e['field'](_0x4037('0x9b'),_0x4037('0x9c'));_0x12f05e[_0x4037('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4037('0x2e'));_0x12f05e[_0x4037('0x4e')]('fax_interaction_has_tags','it',_0x4037('0x9d'));_0x12f05e[_0x4037('0x4e')]('tools_tags','t',_0x4037('0x87'));_0x12f05e['limit'](_0xee0da2[_0x4037('0x22')]);_0x12f05e[_0x4037('0x21')](_0xee0da2['offset']);return db['sequelize'][_0x4037('0x36')](_0x12f05e[_0x4037('0x8d')](),_0x376c3a);})['then'](function(_0x499fc3){_0xf45814['where'](_0x4037('0x9e'),_['map'](_0x499fc3,'id'));return db[_0x4037('0x8c')][_0x4037('0x36')](_0xf45814[_0x4037('0x8d')](),_0x376c3a)['then'](function(_0x4416cf){var _0x577ff4=_[_0x4037('0x9f')](_0x4416cf,_0x4037('0xa0'));var _0x1ea859=[];_0x499fc3['forEach'](function(_0x3d4c84){_0x1ea859[_0x4037('0x32')](updateFaxInteraction(_0x3d4c84,_0x265e44,_0x577ff4));});return BPromise[_0x4037('0xa1')](_0x1ea859);});});})[_0x4037('0x26')](function(_0x5d9f65){_0x47f1b9['rows']=_0x5d9f65;return _0x47f1b9;})[_0x4037('0x26')](respondWithFilteredResult(_0xe03cdc,_0xee0da2))['catch'](handleError(_0xe03cdc,null));};exports[_0x4037('0xa2')]=function(_0x40e19d,_0x11b681){var _0x569015={'raw':![],'where':{'id':_0x40e19d[_0x4037('0xa3')]['id']}},_0x5ce45d={};_0x5ce45d[_0x4037('0x3a')]=_[_0x4037('0x35')](db[_0x4037('0x34')]['rawAttributes']);_0x5ce45d[_0x4037('0x36')]=_[_0x4037('0x35')](_0x40e19d['query']);_0x5ce45d[_0x4037('0x37')]=_[_0x4037('0x39')](_0x5ce45d[_0x4037('0x3a')],_0x5ce45d['query']);_0x569015[_0x4037('0x38')]=_[_0x4037('0x39')](_0x5ce45d[_0x4037('0x3a')],qs[_0x4037('0x3b')](_0x40e19d[_0x4037('0x36')][_0x4037('0x3b')]));_0x569015[_0x4037('0x38')]=_0x569015[_0x4037('0x38')][_0x4037('0x3c')]?_0x569015['attributes']:_0x5ce45d[_0x4037('0x3a')];if(_0x40e19d['query'][_0x4037('0xa4')]){_0x569015[_0x4037('0xa5')]=[{'all':!![]}];}_0x569015=_['merge']({},_0x569015,_0x40e19d['options']);return db[_0x4037('0x34')][_0x4037('0xa6')](_0x569015)[_0x4037('0x26')](handleEntityNotFound(_0x11b681,null))[_0x4037('0x26')](respondWithResult(_0x11b681,null))['catch'](handleError(_0x11b681,null));};exports[_0x4037('0xa7')]=function(_0x463a14,_0x1bb5d8){return db[_0x4037('0x34')][_0x4037('0xa7')](_0x463a14[_0x4037('0xa8')],{})['then'](respondWithResult(_0x1bb5d8,0xc9))[_0x4037('0xa9')](handleError(_0x1bb5d8,null));};exports[_0x4037('0xaa')]=function(_0x26210c,_0x4b4c69){if(_0x26210c[_0x4037('0xa8')]['id']){delete _0x26210c[_0x4037('0xa8')]['id'];}return db[_0x4037('0x34')]['find']({'where':{'id':_0x26210c[_0x4037('0xa3')]['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x4b4c69,null))[_0x4037('0x26')](saveUpdates(_0x26210c[_0x4037('0xa8')],null))[_0x4037('0x26')](respondWithResult(_0x4b4c69,null))[_0x4037('0xa9')](handleError(_0x4b4c69,null));};exports[_0x4037('0x27')]=function(_0x2f27ca,_0x528fa5){return db[_0x4037('0x34')][_0x4037('0xa6')]({'where':{'id':_0x2f27ca[_0x4037('0xa3')]['id']}})['then'](handleEntityNotFound(_0x528fa5,null))[_0x4037('0x26')](removeEntity(_0x528fa5,null))['catch'](handleError(_0x528fa5,null));};exports[_0x4037('0xab')]=function(_0x3bcc9c,_0x1d20c6){return db[_0x4037('0x34')][_0x4037('0xab')]()['then'](respondWithResult(_0x1d20c6,null))['catch'](handleError(_0x1d20c6,null));};exports['addMessage']=function(_0x2e8c68,_0x31976d,_0x407fa5){return db[_0x4037('0xac')][_0x4037('0xa6')]({'where':{'id':_0x2e8c68['params']['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x31976d,null))[_0x4037('0x26')](function(_0x23acb5){if(_0x23acb5){return _0x23acb5['addMessage'](_0x2e8c68[_0x4037('0xa8')]['ids'],_[_0x4037('0xad')](_0x2e8c68['body'],[_0x4037('0xae'),'id'])||{});}})[_0x4037('0x26')](respondWithResult(_0x31976d,null))[_0x4037('0xa9')](handleError(_0x31976d,null));};exports['getMessages']=function(_0x2fdc3a,_0x59a756,_0xcbb34f){var _0x10265c={'raw':![],'where':{}};var _0x4f3adc={};var _0x191f22={'count':0x0,'rows':[]};return db[_0x4037('0x34')]['findOne']({'where':{'id':_0x2fdc3a[_0x4037('0xa3')]['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x59a756,null))[_0x4037('0x26')](function(_0xfeec6c){if(_0xfeec6c){_0x4f3adc[_0x4037('0x3a')]=_[_0x4037('0x35')](db[_0x4037('0xac')][_0x4037('0xaf')]);_0x4f3adc['query']=_[_0x4037('0x35')](_0x2fdc3a[_0x4037('0x36')]);_0x4f3adc['filters']=_[_0x4037('0x39')](_0x4f3adc[_0x4037('0x3a')],_0x4f3adc[_0x4037('0x36')]);_0x10265c[_0x4037('0x38')]=_[_0x4037('0x39')](_0x4f3adc[_0x4037('0x3a')],qs[_0x4037('0x3b')](_0x2fdc3a[_0x4037('0x36')][_0x4037('0x3b')]));_0x10265c['attributes']=_0x10265c[_0x4037('0x38')][_0x4037('0x3c')]?_0x10265c['attributes']:_0x4f3adc[_0x4037('0x3a')];if(!_0x2fdc3a[_0x4037('0x36')][_0x4037('0x3d')](_0x4037('0xb0'))){_0x10265c[_0x4037('0x22')]=qs[_0x4037('0x22')](_0x2fdc3a[_0x4037('0x36')][_0x4037('0x22')]);_0x10265c[_0x4037('0x21')]=qs[_0x4037('0x21')](_0x2fdc3a[_0x4037('0x36')][_0x4037('0x21')]);}_0x10265c[_0x4037('0x3e')]=qs['sort'](_0x2fdc3a['query'][_0x4037('0x3f')]);_0x10265c['where']=qs[_0x4037('0x37')](_['pick'](_0x2fdc3a[_0x4037('0x36')],_0x4f3adc[_0x4037('0x37')]));_0x10265c[_0x4037('0x47')]['FaxInteractionId']=_0xfeec6c['id'];if(_0x2fdc3a[_0x4037('0x36')][_0x4037('0x6e')]){_0x10265c['where']=_['merge'](_0x10265c[_0x4037('0x47')],{'$or':_[_0x4037('0x6d')](_0x10265c[_0x4037('0x38')],function(_0x4210dc){var _0x5dddad={};_0x5dddad[_0x4210dc]={'$like':'%'+_0x2fdc3a['query'][_0x4037('0x6e')]+'%'};return _0x5dddad;})});}if(_0x2fdc3a[_0x4037('0x36')]['$gte']){var _0x4fbd30=_0x2fdc3a['query'][_0x4037('0x72')][_0x4037('0x30')](',');var _0x52ff3b={};_0x52ff3b[_0x4fbd30[0x0]]={'$gte':moment(_0x4fbd30[0x1])[_0x4037('0x5d')](_0x4037('0xb1'))};_0x10265c[_0x4037('0x47')]=_[_0x4037('0x90')](_0x10265c[_0x4037('0x47')],_0x52ff3b);}_0x10265c=_['merge']({},_0x10265c,_0x2fdc3a[_0x4037('0xb2')]);return db['FaxMessage'][_0x4037('0x8e')]({'where':_0x10265c[_0x4037('0x47')]})[_0x4037('0x26')](function(_0x56372b){_0x191f22['count']=_0x56372b;if(_0x2fdc3a[_0x4037('0x36')][_0x4037('0xa4')]){_0x10265c[_0x4037('0xa5')]=[{'all':!![]}];}return db[_0x4037('0xac')][_0x4037('0xb3')](_0x10265c);})[_0x4037('0x26')](function(_0x55a638){_0x191f22['rows']=_0x55a638;return _0x191f22;});}})[_0x4037('0x26')](respondWithFilteredResult(_0x59a756,_0x10265c))[_0x4037('0xa9')](handleError(_0x59a756,null));};exports['addTags']=function(_0x2dc6e7,_0x226a4e,_0x12376f){return db[_0x4037('0x34')][_0x4037('0xa6')]({'where':{'id':_0x2dc6e7['params']['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x226a4e,null))['then'](function(_0x38afeb){if(_0x38afeb){return _0x38afeb['setTags'](_0x2dc6e7[_0x4037('0xa8')]['ids'],_['omit'](_0x2dc6e7['body'],[_0x4037('0xae'),'id'])||{})[_0x4037('0xb4')](function(){return db[_0x4037('0xb5')][_0x4037('0xb3')]({'attributes':['id',_0x4037('0x2b'),_0x4037('0x41')],'where':{'id':_0x2dc6e7[_0x4037('0xa8')]['ids']}});})[_0x4037('0x26')](function(_0x4f9380){socket[_0x4037('0xb6')](_0x4037('0xb7'),{'id':Number(_0x2dc6e7[_0x4037('0xa3')]['id']),'tags':_0x4f9380||[]});return{'id':Number(_0x2dc6e7[_0x4037('0xa3')]['id']),'tags':_0x4f9380||[]};});}})['then'](respondWithResult(_0x226a4e,null))['catch'](handleError(_0x226a4e,null));};exports[_0x4037('0xb8')]=function(_0x65a9f6,_0x10372c,_0x40f046){return db[_0x4037('0x34')][_0x4037('0xa6')]({'where':{'id':_0x65a9f6['params']['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x10372c,null))[_0x4037('0x26')](function(_0x254d7e){if(_0x254d7e){return _0x254d7e[_0x4037('0xb8')](_0x65a9f6[_0x4037('0x36')][_0x4037('0xae')]);}})[_0x4037('0x26')](respondWithStatusCode(_0x10372c,null))[_0x4037('0xa9')](handleError(_0x10372c,null));};exports['download']=function(_0x74da7d,_0x230650){var _0x44de80=moment()['unix']()[_0x4037('0x8d')]();var _0x218eab=path['join'](config[_0x4037('0xb9')],_0x4037('0xba'),_0x4037('0xbb'),'attachments');var _0x43119f=path[_0x4037('0xbc')](config[_0x4037('0xb9')],'server',_0x4037('0xbb'),_0x4037('0xbd'));var _0x32c431=path['join'](_0x43119f,_0x44de80);var _0x6f5eef=util['format'](_0x4037('0xbe'),_0x44de80);var _0x493fd0=path['join'](_0x43119f,_0x6f5eef);var _0x51ce30=![];return db['FaxInteraction'][_0x4037('0xa6')]({'where':{'id':_0x74da7d[_0x4037('0xa3')]['id']}})[_0x4037('0x26')](handleEntityNotFound(_0x230650,null))[_0x4037('0x26')](function(_0x49a09e){if(_0x49a09e){return _0x49a09e[_0x4037('0xbf')]({'attributes':['id','body',_0x4037('0x57')],'include':[{'model':db[_0x4037('0xc0')],'as':'Attachment'}]});}return[];})['then'](function(_0x57644f){_0x51ce30=_0x57644f[_0x4037('0x3c')];if(_0x57644f[_0x4037('0x3c')]){fs[_0x4037('0xc1')](_0x32c431);for(var _0x7c25d9=0x0;_0x7c25d9<_0x57644f[_0x4037('0x3c')];_0x7c25d9++){var _0xbb48ec=_0x57644f[_0x7c25d9];var _0x9e586d=_0xbb48ec[_0x4037('0xc0')];if(_0x9e586d){var _0x50464c=path[_0x4037('0xbc')](_0x218eab,_0x9e586d[_0x4037('0xc2')]);if(fs['existsSync'](_0x50464c)){fs['createReadStream'](_0x50464c)['pipe'](fs[_0x4037('0xc3')](path[_0x4037('0xbc')](_0x32c431,_0x9e586d[_0x4037('0xc2')])));}}}}})[_0x4037('0x26')](function(){if(_0x51ce30){return new BPromise(function(_0x84072f,_0x2f9fb0){zipdir(_0x32c431,{'saveTo':_0x493fd0},function(_0x5f45dc,_0x272dae){if(_0x5f45dc)return _0x2f9fb0(_0x5f45dc);return _0x84072f(_0x272dae);});});}})[_0x4037('0x26')](function(){if(_0x51ce30){return new BPromise(function(_0x1acba3,_0x4729dc){rimraf(_0x32c431,function(_0x31339d){if(_0x31339d)_0x4729dc(_0x31339d);return _0x1acba3();});});}})[_0x4037('0x26')](function(){if(_0x51ce30){return _0x230650[_0x4037('0xc4')](_0x493fd0,_0x6f5eef,function(_0x33a204){if(_0x33a204){console[_0x4037('0xc5')](_0x4037('0xc6'),_0x33a204);}else{fs[_0x4037('0xc7')](_0x493fd0);}});}else{return _0x230650[_0x4037('0x1e')](0xc8);}})['catch'](handleError(_0x230650,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8b01bff..adb3310 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 _0x95f4=['getUsers','setDataValue','Users','map','then','length','emit','hook','../../mysqldb','FaxMessage','save','update','remove'];(function(_0x59ae95,_0x5c3671){var _0x5276f7=function(_0x4094ee){while(--_0x4094ee){_0x59ae95['push'](_0x59ae95['shift']());}};_0x5276f7(++_0x5c3671);}(_0x95f4,0x19b));var _0x495f=function(_0x53a137,_0x1808b9){_0x53a137=_0x53a137-0x0;var _0x40da7b=_0x95f4[_0x53a137];return _0x40da7b;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x495f('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x495f('0x0'))['db'][_0x495f('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x495f('0x2'),'afterUpdate':_0x495f('0x3'),'afterDestroy':_0x495f('0x4')};function emitEvent(_0x12f818){return function(_0x8595ca,_0x18ade9,_0x52dea1){_0x8595ca[_0x495f('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1ca649){_0x8595ca[_0x495f('0x6')](_0x495f('0x7'),_0x1ca649[_0x495f('0x8')](function(_0x54b646){return{'id':_0x54b646['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x8595ca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x495f('0x9')](function(_0x45cc87){_0x8595ca[_0x495f('0x6')]('unreadMessages',_0x45cc87[_0x495f('0xa')]);FaxInteractionEvents[_0x495f('0xb')](_0x12f818+':'+_0x8595ca['id'],_0x8595ca);FaxInteractionEvents['emit'](_0x12f818,_0x8595ca);_0x52dea1(null);})['catch'](_0x52dea1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x495f('0xc')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x78c1=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','length','emit'];(function(_0x4705c9,_0x35b2a4){var _0x872d98=function(_0x2d2b8a){while(--_0x2d2b8a){_0x4705c9['push'](_0x4705c9['shift']());}};_0x872d98(++_0x35b2a4);}(_0x78c1,0x15a));var _0x178c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x78c1[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x178c('0x0'));var FaxInteraction=require(_0x178c('0x1'))['db'][_0x178c('0x2')];var FaxMessage=require(_0x178c('0x1'))['db'][_0x178c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x178c('0x4')](0x0);var events={'afterCreate':_0x178c('0x5'),'afterUpdate':_0x178c('0x6'),'afterDestroy':_0x178c('0x7')};function emitEvent(_0x179e19){return function(_0x47f4c0,_0x30ad31,_0x15667f){_0x47f4c0['getUsers']({'attributes':['id'],'raw':!![]})[_0x178c('0x8')](function(_0x49d114){_0x47f4c0[_0x178c('0x9')](_0x178c('0xa'),_0x49d114[_0x178c('0xb')](function(_0x17f986){return{'id':_0x17f986['id']};}));return FaxMessage[_0x178c('0xc')]({'where':{'FaxInteractionId':_0x47f4c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x178c('0x8')](function(_0xb66cca){_0x47f4c0[_0x178c('0x9')]('unreadMessages',_0xb66cca[_0x178c('0xd')]);FaxInteractionEvents[_0x178c('0xe')](_0x179e19+':'+_0x47f4c0['id'],_0x47f4c0);FaxInteractionEvents[_0x178c('0xe')](_0x179e19,_0x47f4c0);_0x15667f(null);})[_0x178c('0xf')](_0x15667f(null));};}for(var e in events){if(events[_0x178c('0x10')](e)){var event=events[e];FaxInteraction[_0x178c('0x11')](e,emitEvent(event));}}module[_0x178c('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 3d7620f..fb121e8 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 _0x4836=['../../config/logger','api','moment','path','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x4836,0x1cc));var _0x6483=function(_0xd77219,_0x34eaf2){_0xd77219=_0xd77219-0x0;var _0x3db9f1=_0x4836[_0xd77219];return _0x3db9f1;};'use strict';var _=require(_0x6483('0x0'));var util=require(_0x6483('0x1'));var logger=require(_0x6483('0x2'))(_0x6483('0x3'));var moment=require(_0x6483('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6483('0x5'));var rimraf=require('rimraf');var config=require(_0x6483('0x6'));var attributes=require(_0x6483('0x7'));module['exports']=function(_0x40a63d,_0x13b690){return _0x40a63d[_0x6483('0x8')](_0x6483('0x9'),attributes,{'tableName':_0x6483('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55b184,_0x5f2c8d,_0x48f965){if(_0x55b184[_0x6483('0xb')](_0x6483('0xc'))){_0x55b184['closedAt']=moment()['format'](_0x6483('0xd'));}_0x48f965(null,_0x55b184);}}});}; \ No newline at end of file +var _0x7f1e=['fax_interactions','changed','closed','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','FaxInteraction'];(function(_0x2e612a,_0x106dd7){var _0x3cb97c=function(_0x367d2f){while(--_0x367d2f){_0x2e612a['push'](_0x2e612a['shift']());}};_0x3cb97c(++_0x106dd7);}(_0x7f1e,0x162));var _0xe7f1=function(_0x1f92fe,_0x53f008){_0x1f92fe=_0x1f92fe-0x0;var _0x38485f=_0x7f1e[_0x1f92fe];return _0x38485f;};'use strict';var _=require(_0xe7f1('0x0'));var util=require(_0xe7f1('0x1'));var logger=require(_0xe7f1('0x2'))(_0xe7f1('0x3'));var moment=require('moment');var BPromise=require(_0xe7f1('0x4'));var rp=require(_0xe7f1('0x5'));var fs=require('fs');var path=require(_0xe7f1('0x6'));var rimraf=require('rimraf');var config=require(_0xe7f1('0x7'));var attributes=require(_0xe7f1('0x8'));module['exports']=function(_0x475b5e,_0x591c32){return _0x475b5e['define'](_0xe7f1('0x9'),attributes,{'tableName':_0xe7f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1269c6,_0x3c11df,_0x41f09b){if(_0x1269c6[_0xe7f1('0xb')](_0xe7f1('0xc'))){_0x1269c6['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x41f09b(null,_0x1269c6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 59a5463..257354d 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 _0x3752=['bluebird','../../mysqldb','../../config/utils','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','UpdateFaxInteraction','FaxInteraction','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','find','body','ids','spread','AddTags','lodash','util','moment'];(function(_0x4cebcc,_0x56253e){var _0x4d1669=function(_0x89e326){while(--_0x89e326){_0x4cebcc['push'](_0x4cebcc['shift']());}};_0x4d1669(++_0x56253e);}(_0x3752,0x6f));var _0x2375=function(_0x11963b,_0x5d2da7){_0x11963b=_0x11963b-0x0;var _0x5d451e=_0x3752[_0x11963b];return _0x5d451e;};'use strict';var _=require(_0x2375('0x0'));var util=require(_0x2375('0x1'));var moment=require(_0x2375('0x2'));var BPromise=require(_0x2375('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2375('0x4'))['db'];var utils=require(_0x2375('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2375('0x6')]['http']({'port':0x232a});config[_0x2375('0x7')]=_[_0x2375('0x8')](config[_0x2375('0x7')],{'host':_0x2375('0x9'),'port':0x18eb});var socket=require(_0x2375('0xa'))(new Redis(config[_0x2375('0x7')]));require(_0x2375('0xb'))[_0x2375('0xc')](socket);function respondWithRpcPromise(_0x2fcc05,_0x3266da,_0x5a2d5f){return new BPromise(function(_0x571c28,_0x225f30){return client[_0x2375('0xd')](_0x2fcc05,_0x5a2d5f)[_0x2375('0xe')](function(_0x27a867){logger['info'](_0x2375('0xf'),_0x3266da,'request\x20sent');logger[_0x2375('0x10')](_0x2375('0x11'),_0x3266da,_0x2375('0x12'),JSON[_0x2375('0x13')](_0x27a867));if(_0x27a867[_0x2375('0x14')]){if(_0x27a867[_0x2375('0x14')]['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3266da,_0x27a867[_0x2375('0x14')][_0x2375('0x15')]);return _0x225f30(_0x27a867[_0x2375('0x14')]['message']);}logger[_0x2375('0x14')](_0x2375('0xf'),_0x3266da,_0x27a867['error'][_0x2375('0x15')]);return _0x571c28(_0x27a867[_0x2375('0x14')][_0x2375('0x15')]);}else{logger[_0x2375('0x16')](_0x2375('0xf'),_0x3266da,_0x2375('0x12'));_0x571c28(_0x27a867[_0x2375('0x17')][_0x2375('0x15')]);}})['catch'](function(_0x584515){logger['error'](_0x2375('0xf'),_0x3266da,_0x584515);_0x225f30(_0x584515);});});}exports[_0x2375('0x18')]=function(_0x54cf59){var _0x3f50b7=this;return new Promise(function(_0x5d196c,_0x4e8313){return db[_0x2375('0x19')]['update'](_0x54cf59['body'],{'raw':_0x54cf59[_0x2375('0x1a')]?_0x54cf59[_0x2375('0x1a')][_0x2375('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54cf59[_0x2375('0x1a')]?_0x54cf59[_0x2375('0x1a')][_0x2375('0x1c')]||null:null,'attributes':_0x54cf59[_0x2375('0x1a')]?_0x54cf59[_0x2375('0x1a')][_0x2375('0x1d')]||null:null,'limit':_0x54cf59[_0x2375('0x1a')]?_0x54cf59[_0x2375('0x1a')][_0x2375('0x1e')]||null:null})[_0x2375('0xe')](function(_0x46665b){logger[_0x2375('0x16')]('UpdateFaxInteraction',_0x54cf59);logger[_0x2375('0x10')](_0x2375('0x18'),_0x54cf59,JSON[_0x2375('0x13')](_0x46665b));_0x5d196c(_0x46665b);})[_0x2375('0x1f')](function(_0x47e143){logger[_0x2375('0x14')]('UpdateFaxInteraction',_0x47e143[_0x2375('0x15')],_0x54cf59);_0x4e8313(_0x3f50b7[_0x2375('0x14')](0x1f4,_0x47e143[_0x2375('0x15')]));});});};exports[_0x2375('0x20')]=function(_0x27c43f){return new Promise(function(_0x541637,_0x121f8e){return db[_0x2375('0x19')][_0x2375('0x21')]({'where':_0x27c43f['options']?_0x27c43f[_0x2375('0x1a')][_0x2375('0x1c')]||null:null})[_0x2375('0xe')](function(_0x40fe28){if(_0x40fe28){return _0x40fe28['addTags'](_0x27c43f[_0x2375('0x22')][_0x2375('0x23')],_['omit'](_0x27c43f[_0x2375('0x22')],['ids','id'])||{});}})[_0x2375('0x24')](function(_0x2aa341){logger[_0x2375('0x16')](_0x2375('0x25'),_0x27c43f);logger[_0x2375('0x10')](_0x2375('0x25'),_0x27c43f,JSON[_0x2375('0x13')](_0x2aa341));_0x541637(_0x2aa341);})[_0x2375('0x1f')](function(_0x56157e){logger['error'](_0x2375('0x25'),_0x56157e['message'],_0x27c43f);_0x121f8e(_this['error'](0x1f4,_0x56157e[_0x2375('0x15')]));});});}; \ No newline at end of file +var _0xd201=['../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xd201,0x1e3));var _0x1d20=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xd201[_0x2abc3d];return _0x252745;};'use strict';var _=require(_0x1d20('0x0'));var util=require(_0x1d20('0x1'));var moment=require(_0x1d20('0x2'));var BPromise=require(_0x1d20('0x3'));var rs=require(_0x1d20('0x4'));var fs=require('fs');var Redis=require(_0x1d20('0x5'));var db=require(_0x1d20('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d20('0x7'))(_0x1d20('0x8'));var config=require(_0x1d20('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1d20('0xa')][_0x1d20('0xb')]({'port':0x232a});config['redis']=_[_0x1d20('0xc')](config[_0x1d20('0xd')],{'host':_0x1d20('0xe'),'port':0x18eb});var socket=require(_0x1d20('0xf'))(new Redis(config[_0x1d20('0xd')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x17cee9,_0x2c0c9,_0x4b2358){return new BPromise(function(_0x202c6a,_0x5c6d7e){return client['request'](_0x17cee9,_0x4b2358)[_0x1d20('0x10')](function(_0x3e7291){logger['info'](_0x1d20('0x11'),_0x2c0c9,_0x1d20('0x12'));logger[_0x1d20('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2c0c9,_0x1d20('0x12'),JSON[_0x1d20('0x14')](_0x3e7291));if(_0x3e7291[_0x1d20('0x15')]){if(_0x3e7291[_0x1d20('0x15')][_0x1d20('0x16')]===0x1f4){logger[_0x1d20('0x15')](_0x1d20('0x11'),_0x2c0c9,_0x3e7291['error']['message']);return _0x5c6d7e(_0x3e7291[_0x1d20('0x15')]['message']);}logger[_0x1d20('0x15')](_0x1d20('0x11'),_0x2c0c9,_0x3e7291[_0x1d20('0x15')][_0x1d20('0x17')]);return _0x202c6a(_0x3e7291[_0x1d20('0x15')][_0x1d20('0x17')]);}else{logger[_0x1d20('0x18')](_0x1d20('0x11'),_0x2c0c9,_0x1d20('0x12'));_0x202c6a(_0x3e7291[_0x1d20('0x19')][_0x1d20('0x17')]);}})[_0x1d20('0x1a')](function(_0x4f9db1){logger[_0x1d20('0x15')](_0x1d20('0x11'),_0x2c0c9,_0x4f9db1);_0x5c6d7e(_0x4f9db1);});});}exports[_0x1d20('0x1b')]=function(_0x7c5a1e){var _0x45a610=this;return new Promise(function(_0x38f695,_0x2ccbd7){return db['FaxInteraction'][_0x1d20('0x1c')](_0x7c5a1e[_0x1d20('0x1d')],{'raw':_0x7c5a1e[_0x1d20('0x1e')]?_0x7c5a1e[_0x1d20('0x1e')][_0x1d20('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7c5a1e[_0x1d20('0x1e')]?_0x7c5a1e[_0x1d20('0x1e')]['where']||null:null,'attributes':_0x7c5a1e['options']?_0x7c5a1e['options'][_0x1d20('0x20')]||null:null,'limit':_0x7c5a1e['options']?_0x7c5a1e[_0x1d20('0x1e')][_0x1d20('0x21')]||null:null})[_0x1d20('0x10')](function(_0x4a276e){logger[_0x1d20('0x18')](_0x1d20('0x1b'),_0x7c5a1e);logger[_0x1d20('0x13')](_0x1d20('0x1b'),_0x7c5a1e,JSON['stringify'](_0x4a276e));_0x38f695(_0x4a276e);})[_0x1d20('0x1a')](function(_0x4bca2d){logger[_0x1d20('0x15')](_0x1d20('0x1b'),_0x4bca2d['message'],_0x7c5a1e);_0x2ccbd7(_0x45a610[_0x1d20('0x15')](0x1f4,_0x4bca2d[_0x1d20('0x17')]));});});};exports[_0x1d20('0x22')]=function(_0x223bb8){return new Promise(function(_0x582f9a,_0x19daee){return db['FaxInteraction'][_0x1d20('0x23')]({'where':_0x223bb8[_0x1d20('0x1e')]?_0x223bb8[_0x1d20('0x1e')][_0x1d20('0x24')]||null:null})[_0x1d20('0x10')](function(_0x2c2cc7){if(_0x2c2cc7){return _0x2c2cc7[_0x1d20('0x25')](_0x223bb8[_0x1d20('0x1d')][_0x1d20('0x26')],_['omit'](_0x223bb8[_0x1d20('0x1d')],[_0x1d20('0x26'),'id'])||{});}})[_0x1d20('0x27')](function(_0xc78014){logger[_0x1d20('0x18')](_0x1d20('0x28'),_0x223bb8);logger[_0x1d20('0x13')](_0x1d20('0x28'),_0x223bb8,JSON[_0x1d20('0x14')](_0xc78014));_0x582f9a(_0xc78014);})[_0x1d20('0x1a')](function(_0x586631){logger['error']('AddTags',_0x586631[_0x1d20('0x17')],_0x223bb8);_0x19daee(_this['error'](0x1f4,_0x586631[_0x1d20('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b9a93fe..1130650 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 _0xc1c4=['emit','removeListener','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x133138,_0x55be23){var _0x419f46=function(_0x2c191d){while(--_0x2c191d){_0x133138['push'](_0x133138['shift']());}};_0x419f46(++_0x55be23);}(_0xc1c4,0x195));var _0x4c1c=function(_0x59df9c,_0x5668b9){_0x59df9c=_0x59df9c-0x0;var _0x248b8a=_0xc1c4[_0x59df9c];return _0x248b8a;};'use strict';var FaxInteractionEvents=require(_0x4c1c('0x0'));var events=['save',_0x4c1c('0x1'),_0x4c1c('0x2')];function createListener(_0x495bec,_0x51d375){return function(_0x1521f6){_0x51d375[_0x4c1c('0x3')](_0x495bec,_0x1521f6);};}function removeListener(_0xc3724c,_0x48f662){return function(){FaxInteractionEvents[_0x4c1c('0x4')](_0xc3724c,_0x48f662);};}exports['register']=function(_0x54afb4){for(var _0x2d80da=0x0,_0x4d7559=events['length'];_0x2d80da<_0x4d7559;_0x2d80da++){var _0xf8fcb7=events[_0x2d80da];var _0x2dcadb=createListener(_0x4c1c('0x5')+_0xf8fcb7,_0x54afb4);FaxInteractionEvents['on'](_0xf8fcb7,_0x2dcadb);}}; \ No newline at end of file +var _0xb8f2=['removeListener','register','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x5d6dae,_0x4c26ca){var _0x5ded0e=function(_0x310826){while(--_0x310826){_0x5d6dae['push'](_0x5d6dae['shift']());}};_0x5ded0e(++_0x4c26ca);}(_0xb8f2,0x111));var _0x2b8f=function(_0x4a9f71,_0x1db1ce){_0x4a9f71=_0x4a9f71-0x0;var _0x1134cd=_0xb8f2[_0x4a9f71];return _0x1134cd;};'use strict';var FaxInteractionEvents=require(_0x2b8f('0x0'));var events=['save',_0x2b8f('0x1'),_0x2b8f('0x2')];function createListener(_0x3f8c97,_0x125360){return function(_0x569d79){_0x125360['emit'](_0x3f8c97,_0x569d79);};}function removeListener(_0xfd2bd9,_0x537390){return function(){FaxInteractionEvents[_0x2b8f('0x3')](_0xfd2bd9,_0x537390);};}exports[_0x2b8f('0x4')]=function(_0x540d50){for(var _0x205648=0x0,_0x5d44a0=events['length'];_0x205648<_0x5d44a0;_0x205648++){var _0x4634ee=events[_0x205648];var _0x474901=createListener(_0x2b8f('0x5')+_0x4634ee,_0x540d50);FaxInteractionEvents['on'](_0x4634ee,_0x474901);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index f400273..b14d288 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 _0x6c90=['post','/:id/messages','faxinteraction:addtags','addTags','tracked','fax','faxinteraction:update','delete','faxinteraction:destroy','/:id/tags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/download','download'];(function(_0x18b59f,_0x1b4f64){var _0x2aff9b=function(_0x17f3d9){while(--_0x17f3d9){_0x18b59f['push'](_0x18b59f['shift']());}};_0x2aff9b(++_0x1b4f64);}(_0x6c90,0xe3));var _0x06c9=function(_0x50cd93,_0x202271){_0x50cd93=_0x50cd93-0x0;var _0x130fff=_0x6c90[_0x50cd93];return _0x130fff;};'use strict';var multer=require(_0x06c9('0x0'));var util=require(_0x06c9('0x1'));var path=require(_0x06c9('0x2'));var timeout=require(_0x06c9('0x3'));var express=require('express');var router=express[_0x06c9('0x4')]();var auth=require(_0x06c9('0x5'));var interaction=require(_0x06c9('0x6'));var config=require(_0x06c9('0x7'));var controller=require(_0x06c9('0x8'));router['get']('/',auth[_0x06c9('0x9')](),controller['index']);router[_0x06c9('0xa')](_0x06c9('0xb'),auth[_0x06c9('0x9')](),controller[_0x06c9('0xc')]);router[_0x06c9('0xa')](_0x06c9('0xd'),auth[_0x06c9('0x9')](),controller['show']);router[_0x06c9('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x06c9('0xe'),auth['isAuthenticated'](),controller[_0x06c9('0xf')]);router['post']('/',auth[_0x06c9('0x9')](),controller['create']);router[_0x06c9('0x10')](_0x06c9('0x11'),auth[_0x06c9('0x9')](),controller['addMessage']);router[_0x06c9('0x10')]('/:id/tags',auth[_0x06c9('0x9')](),interaction['tracked']('fax',_0x06c9('0x12')),controller[_0x06c9('0x13')]);router['put'](_0x06c9('0xd'),auth[_0x06c9('0x9')](),interaction[_0x06c9('0x14')](_0x06c9('0x15'),_0x06c9('0x16')),controller['update']);router[_0x06c9('0x17')](_0x06c9('0xd'),auth['isAuthenticated'](),interaction[_0x06c9('0x14')](_0x06c9('0x15'),_0x06c9('0x18')),controller['destroy']);router[_0x06c9('0x17')](_0x06c9('0x19'),auth[_0x06c9('0x9')](),controller['removeTags']);module[_0x06c9('0x1a')]=router; \ No newline at end of file +var _0xced5=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','/describe','get','/:id/messages','getMessages','download','post','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','destroy','removeTags','multer'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0xced5,0x8b));var _0x5ced=function(_0x3c96e4,_0x340a54){_0x3c96e4=_0x3c96e4-0x0;var _0x5919ad=_0xced5[_0x3c96e4];return _0x5919ad;};'use strict';var multer=require(_0x5ced('0x0'));var util=require(_0x5ced('0x1'));var path=require('path');var timeout=require(_0x5ced('0x2'));var express=require('express');var router=express[_0x5ced('0x3')]();var auth=require(_0x5ced('0x4'));var interaction=require(_0x5ced('0x5'));var config=require('../../config/environment');var controller=require(_0x5ced('0x6'));router['get']('/',auth[_0x5ced('0x7')](),controller[_0x5ced('0x8')]);router['get'](_0x5ced('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5ced('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5ced('0xa')](_0x5ced('0xb'),auth[_0x5ced('0x7')](),controller[_0x5ced('0xc')]);router[_0x5ced('0xa')]('/:id/download',auth[_0x5ced('0x7')](),controller[_0x5ced('0xd')]);router[_0x5ced('0xe')]('/',auth[_0x5ced('0x7')](),controller['create']);router[_0x5ced('0xe')](_0x5ced('0xb'),auth['isAuthenticated'](),controller['addMessage']);router[_0x5ced('0xe')](_0x5ced('0xf'),auth['isAuthenticated'](),interaction[_0x5ced('0x10')]('fax',_0x5ced('0x11')),controller[_0x5ced('0x12')]);router[_0x5ced('0x13')]('/:id',auth[_0x5ced('0x7')](),interaction[_0x5ced('0x10')](_0x5ced('0x14'),_0x5ced('0x15')),controller[_0x5ced('0x16')]);router[_0x5ced('0x17')](_0x5ced('0x18'),auth[_0x5ced('0x7')](),interaction[_0x5ced('0x10')](_0x5ced('0x14'),_0x5ced('0x19')),controller[_0x5ced('0x1a')]);router[_0x5ced('0x17')]('/:id/tags',auth[_0x5ced('0x7')](),controller[_0x5ced('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 03a6d0a..3d50515 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 _0x9cc7=['TEXT','DATE','sequelize','exports','medium','BOOLEAN','out'];(function(_0x22d423,_0x4ee083){var _0x1017ed=function(_0x29dd73){while(--_0x29dd73){_0x22d423['push'](_0x22d423['shift']());}};_0x1017ed(++_0x4ee083);}(_0x9cc7,0x64));var _0x79cc=function(_0x5534b7,_0xbe6ba4){_0x5534b7=_0x5534b7-0x0;var _0x34af05=_0x9cc7[_0x5534b7];return _0x34af05;};'use strict';var Sequelize=require(_0x79cc('0x0'));module[_0x79cc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x79cc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x79cc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x79cc('0x4')),'defaultValue':_0x79cc('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x79cc('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x79cc('0x6')]}}; \ No newline at end of file +var _0x5aa1=['medium','out','TEXT','DATE','sequelize','exports'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5aa1,0x12a));var _0x15aa=function(_0x3b13af,_0xfee785){_0x3b13af=_0x3b13af-0x0;var _0x1942f8=_0x5aa1[_0x3b13af];return _0x1942f8;};'use strict';var Sequelize=require(_0x15aa('0x0'));module[_0x15aa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x15aa('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x15aa('0x3')),'defaultValue':_0x15aa('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x15aa('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x15aa('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 0ae56e6..47592a5 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 _0xad95=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','end','status','json','count','offset','set','apply','reject','save','stack','name','send','FaxMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','pick','filter','where','merge','type','key','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','update','body','destroy','describe','../../config/logger','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','user','role','manual','interface','SIP/%s','channel','EventManager','acceptmessage','fax','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','basename','root','server','files','attachments','download','join','html-pdf','eml-format','rimraf','request-promise','moment','util','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4ceda9,_0x10a0b1){var _0x2ab459=function(_0x25ecf5){while(--_0x25ecf5){_0x4ceda9['push'](_0x4ceda9['shift']());}};_0x2ab459(++_0x10a0b1);}(_0xad95,0x70));var _0x5ad9=function(_0x343b85,_0x378fa8){_0x343b85=_0x343b85-0x0;var _0x21434e=_0xad95[_0x343b85];return _0x21434e;};'use strict';var pdf=require(_0x5ad9('0x0'));var emlformat=require(_0x5ad9('0x1'));var rimraf=require(_0x5ad9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ad9('0x3'));var moment=require(_0x5ad9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ad9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var hardwareService=require(_0x5ad9('0xe'));var logger=require('../../config/logger')(_0x5ad9('0xf'));var utils=require(_0x5ad9('0x10'));var config=require('../../config/environment');var db=require(_0x5ad9('0x11'))['db'];config[_0x5ad9('0x12')]=_[_0x5ad9('0x13')](config[_0x5ad9('0x12')],{'host':_0x5ad9('0x14'),'port':0x18eb});var socket=require(_0x5ad9('0x15'))(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x5ad9('0x16'));var client=jayson[_0x5ad9('0x17')]['http']({'port':0x232c});var client9002=jayson[_0x5ad9('0x17')][_0x5ad9('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3f16ef,_0x543743,_0x3da125){if(_0x3da125){var _0x32b0bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32b0bd[_0x5ad9('0x19')](_0x543743)){return _0x3f16ef;}else{throw new Error(_0x5ad9('0x1a'));}}else{return _0x3f16ef;}}function respondWithRpcPromise(_0x36e61f,_0x390d96,_0x521cc3,_0x1c0b8e){return new BPromise(function(_0x54f392,_0x3d1c8f){var _0x28682f=_0x1c0b8e||client;return _0x28682f[_0x5ad9('0x1b')](_0x36e61f,_0x521cc3)[_0x5ad9('0x1c')](function(_0x1c5ab7){logger[_0x5ad9('0x1d')](_0x5ad9('0x1e'),_0x390d96,'request\x20sent');logger[_0x5ad9('0x1f')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x390d96,'request\x20sent',JSON[_0x5ad9('0x20')](_0x1c5ab7));if(_0x1c5ab7['error']){if(_0x1c5ab7[_0x5ad9('0x21')][_0x5ad9('0x22')]===0x1f4){logger[_0x5ad9('0x21')](_0x5ad9('0x1e'),_0x390d96,_0x1c5ab7[_0x5ad9('0x21')]['message']);return _0x3d1c8f(_0x1c5ab7[_0x5ad9('0x21')]['message']);}logger[_0x5ad9('0x21')]('FaxMessage,\x20%s,\x20%s',_0x390d96,_0x1c5ab7['error']['message']);return _0x54f392(_0x1c5ab7[_0x5ad9('0x21')][_0x5ad9('0x23')]);}else{logger[_0x5ad9('0x1d')](_0x5ad9('0x1e'),_0x390d96,_0x5ad9('0x24'));_0x54f392(_0x1c5ab7[_0x5ad9('0x25')][_0x5ad9('0x23')]);}})['catch'](function(_0x54e9dd){logger[_0x5ad9('0x21')]('FaxMessage,\x20%s,\x20%s',_0x390d96,_0x54e9dd);_0x3d1c8f(_0x54e9dd);});});}function respondWithStatusCode(_0x3a2357,_0x584de3){_0x584de3=_0x584de3||0xcc;return function(_0x346f35){if(_0x346f35){return _0x3a2357['sendStatus'](_0x584de3);}return _0x3a2357['status'](_0x584de3)[_0x5ad9('0x26')]();};}function respondWithResult(_0x46d565,_0x49b3df){_0x49b3df=_0x49b3df||0xc8;return function(_0x509d41){if(_0x509d41){return _0x46d565[_0x5ad9('0x27')](_0x49b3df)[_0x5ad9('0x28')](_0x509d41);}};}function respondWithFilteredResult(_0x1b6faf,_0x2ad078){return function(_0xe06a1d){if(_0xe06a1d){var _0x3a4720=_0xe06a1d[_0x5ad9('0x29')],_0x5e5656=_0x2ad078[_0x5ad9('0x2a')],_0x132ec6=_0x2ad078['offset']+_0x2ad078['limit'],_0x12867b;if(_0x132ec6>=_0x3a4720){_0x132ec6=_0x3a4720;_0x12867b=0xc8;}else{_0x12867b=0xce;}_0x1b6faf[_0x5ad9('0x27')](_0x12867b);return _0x1b6faf[_0x5ad9('0x2b')]('Content-Range',_0x5e5656+'-'+_0x132ec6+'/'+_0x3a4720)['json'](_0xe06a1d);}return null;};}function patchUpdates(_0x59ca94){return function(_0x43dc66){try{jsonpatch[_0x5ad9('0x2c')](_0x43dc66,_0x59ca94,!![]);}catch(_0x51069d){return BPromise[_0x5ad9('0x2d')](_0x51069d);}return _0x43dc66[_0x5ad9('0x2e')]();};}function saveUpdates(_0x4688fc,_0x356373){return function(_0x4daf7b){if(_0x4daf7b){return _0x4daf7b['update'](_0x4688fc)[_0x5ad9('0x1c')](function(_0x433728){return _0x433728;});}return null;};}function removeEntity(_0x2406d5,_0x240e5a){return function(_0x211426){if(_0x211426){return _0x211426['destroy']()[_0x5ad9('0x1c')](function(){_0x2406d5[_0x5ad9('0x27')](0xcc)[_0x5ad9('0x26')]();});}};}function handleEntityNotFound(_0x18d300,_0x7a673f){return function(_0x1f67d4){if(!_0x1f67d4){_0x18d300['sendStatus'](0x194);}return _0x1f67d4;};}function handleError(_0x1486af,_0x4cad35){_0x4cad35=_0x4cad35||0x1f4;return function(_0x47ae79){logger[_0x5ad9('0x21')](_0x47ae79[_0x5ad9('0x2f')]);if(_0x47ae79['name']){delete _0x47ae79[_0x5ad9('0x30')];}_0x1486af[_0x5ad9('0x27')](_0x4cad35)[_0x5ad9('0x31')](_0x47ae79);};}exports['index']=function(_0x2154f6,_0x1815cc){var _0x1f8b9b={},_0x234f92={},_0x51712a={'count':0x0,'rows':[]};var _0x25f1ab=db[_0x5ad9('0x32')][_0x5ad9('0x33')];_0x234f92[_0x5ad9('0x34')]=_[_0x5ad9('0x35')](_0x25f1ab);_0x234f92[_0x5ad9('0x36')]=_[_0x5ad9('0x35')](_0x2154f6[_0x5ad9('0x36')]);_0x234f92[_0x5ad9('0x37')]=_['intersection'](_0x234f92[_0x5ad9('0x34')],_0x234f92[_0x5ad9('0x36')]);_0x1f8b9b[_0x5ad9('0x38')]=_[_0x5ad9('0x39')](_0x234f92[_0x5ad9('0x34')],qs['fields'](_0x2154f6[_0x5ad9('0x36')][_0x5ad9('0x3a')]));_0x1f8b9b[_0x5ad9('0x38')]=_0x1f8b9b['attributes'][_0x5ad9('0x3b')]?_0x1f8b9b[_0x5ad9('0x38')]:_0x234f92[_0x5ad9('0x34')];if(!_0x2154f6['query'][_0x5ad9('0x3c')]('nolimit')){_0x1f8b9b['limit']=qs[_0x5ad9('0x3d')](_0x2154f6[_0x5ad9('0x36')][_0x5ad9('0x3d')]);_0x1f8b9b[_0x5ad9('0x2a')]=qs['offset'](_0x2154f6['query'][_0x5ad9('0x2a')]);}_0x1f8b9b['order']=qs[_0x5ad9('0x3e')](_0x2154f6['query'][_0x5ad9('0x3e')]);_0x1f8b9b['where']=qs[_0x5ad9('0x37')](_[_0x5ad9('0x3f')](_0x2154f6[_0x5ad9('0x36')],_0x234f92[_0x5ad9('0x37')]));if(_0x2154f6[_0x5ad9('0x36')][_0x5ad9('0x40')]){_0x1f8b9b[_0x5ad9('0x41')]=_[_0x5ad9('0x42')](_0x1f8b9b[_0x5ad9('0x41')],{'$or':_['map'](_0x25f1ab,function(_0x3c43d4){if(_0x3c43d4[_0x5ad9('0x43')][_0x5ad9('0x44')]!==_0x5ad9('0x45')){var _0x46af56={};_0x46af56[_0x3c43d4['field']]={'$like':'%'+_0x2154f6[_0x5ad9('0x36')]['filter']+'%'};return _0x46af56;}})});}_0x1f8b9b=_['merge']({},_0x1f8b9b,_0x2154f6['options']);var _0x2c094c={'where':_0x1f8b9b[_0x5ad9('0x41')]};return db[_0x5ad9('0x32')]['count'](_0x2c094c)[_0x5ad9('0x1c')](function(_0x21074f){_0x51712a[_0x5ad9('0x29')]=_0x21074f;if(_0x2154f6[_0x5ad9('0x36')]['includeAll']){_0x1f8b9b[_0x5ad9('0x46')]=[{'all':!![]}];}return db[_0x5ad9('0x32')][_0x5ad9('0x47')](_0x1f8b9b);})[_0x5ad9('0x1c')](function(_0x4fdbb6){_0x51712a[_0x5ad9('0x48')]=_0x4fdbb6;return _0x51712a;})[_0x5ad9('0x1c')](respondWithFilteredResult(_0x1815cc,_0x1f8b9b))[_0x5ad9('0x49')](handleError(_0x1815cc,null));};exports[_0x5ad9('0x4a')]=function(_0x479bbc,_0x22c2f9){var _0x1b741d={'raw':!![],'where':{'id':_0x479bbc[_0x5ad9('0x4b')]['id']}},_0x5f42a8={};_0x5f42a8['model']=_[_0x5ad9('0x35')](db[_0x5ad9('0x32')][_0x5ad9('0x33')]);_0x5f42a8[_0x5ad9('0x36')]=_[_0x5ad9('0x35')](_0x479bbc[_0x5ad9('0x36')]);_0x5f42a8[_0x5ad9('0x37')]=_[_0x5ad9('0x39')](_0x5f42a8[_0x5ad9('0x34')],_0x5f42a8[_0x5ad9('0x36')]);_0x1b741d[_0x5ad9('0x38')]=_[_0x5ad9('0x39')](_0x5f42a8[_0x5ad9('0x34')],qs[_0x5ad9('0x3a')](_0x479bbc[_0x5ad9('0x36')]['fields']));_0x1b741d[_0x5ad9('0x38')]=_0x1b741d[_0x5ad9('0x38')][_0x5ad9('0x3b')]?_0x1b741d[_0x5ad9('0x38')]:_0x5f42a8[_0x5ad9('0x34')];if(_0x479bbc[_0x5ad9('0x36')][_0x5ad9('0x4c')]){_0x1b741d[_0x5ad9('0x46')]=[{'all':!![]}];}_0x1b741d=_['merge']({},_0x1b741d,_0x479bbc[_0x5ad9('0x4d')]);return db['FaxMessage'][_0x5ad9('0x4e')](_0x1b741d)[_0x5ad9('0x1c')](handleEntityNotFound(_0x22c2f9,null))[_0x5ad9('0x1c')](respondWithResult(_0x22c2f9,null))['catch'](handleError(_0x22c2f9,null));};exports[_0x5ad9('0x4f')]=function(_0x4d1e5c,_0x3f2430){if(_0x4d1e5c['body']['id']){delete _0x4d1e5c[_0x5ad9('0x50')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x4d1e5c[_0x5ad9('0x4b')]['id']}})[_0x5ad9('0x1c')](handleEntityNotFound(_0x3f2430,null))['then'](saveUpdates(_0x4d1e5c['body'],null))[_0x5ad9('0x1c')](respondWithResult(_0x3f2430,null))[_0x5ad9('0x49')](handleError(_0x3f2430,null));};exports[_0x5ad9('0x51')]=function(_0x76bc66,_0x255b03){return db[_0x5ad9('0x32')][_0x5ad9('0x4e')]({'where':{'id':_0x76bc66[_0x5ad9('0x4b')]['id']}})[_0x5ad9('0x1c')](handleEntityNotFound(_0x255b03,null))['then'](removeEntity(_0x255b03,null))[_0x5ad9('0x49')](handleError(_0x255b03,null));};exports[_0x5ad9('0x52')]=function(_0x4e0ace,_0x3afa73){return db[_0x5ad9('0x32')][_0x5ad9('0x52')]()['then'](respondWithResult(_0x3afa73,null))[_0x5ad9('0x49')](handleError(_0x3afa73,null));};var interaction_log=require(_0x5ad9('0x53'))(_0x5ad9('0x54'));exports[_0x5ad9('0x55')]=function(_0x426fbe,_0x2ea39d,_0x33deef){var _0x3e429f={'channel':'fax'};if(_0x426fbe[_0x5ad9('0x50')]['id']){delete _0x426fbe[_0x5ad9('0x50')]['id'];}_0x426fbe[_0x5ad9('0x50')][_0x5ad9('0x56')]=!![];_0x426fbe[_0x5ad9('0x50')][_0x5ad9('0x57')]=moment()[_0x5ad9('0x58')](_0x5ad9('0x59'));_0x426fbe[_0x5ad9('0x50')][_0x5ad9('0x5a')]=_0x426fbe[_0x5ad9('0x50')][_0x5ad9('0x5a')]||_0x426fbe['user']['id'];return db[_0x5ad9('0x32')][_0x5ad9('0x4e')]({'where':{'id':_0x426fbe[_0x5ad9('0x4b')]['id'],'UserId':null},'include':[{'model':db[_0x5ad9('0x5b')],'as':'Contact'}]})[_0x5ad9('0x1c')](handleEntityNotFound(_0x2ea39d,null))['then'](saveUpdates(_0x426fbe[_0x5ad9('0x50')],null))[_0x5ad9('0x1c')](function(_0x9b5af5){if(_0x9b5af5){_0x3e429f['message']=_0x9b5af5[_0x5ad9('0x5c')]({'plain':!![]});return db[_0x5ad9('0x5d')][_0x5ad9('0x4e')]({'where':{'id':_0x9b5af5[_0x5ad9('0x5e')]}});}return null;})[_0x5ad9('0x1c')](handleEntityNotFound(_0x2ea39d,null))[_0x5ad9('0x1c')](function(_0x5f53aa){if(_0x5f53aa){return _0x5f53aa[_0x5ad9('0x4f')]({'UserId':_0x426fbe[_0x5ad9('0x50')]['UserId'],'read1stAt':_[_0x5ad9('0x5f')](_0x5f53aa[_0x5ad9('0x60')])?moment()['format'](_0x5ad9('0x59')):undefined});}return null;})[_0x5ad9('0x1c')](function(_0x5b800f){if(_0x5b800f){_0x3e429f[_0x5ad9('0x61')]=_0x5b800f[_0x5ad9('0x5c')]({'plain':!![]});interaction_log[_0x5ad9('0x1d')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x426fbe[_0x5ad9('0x62')]['id'],_0x426fbe[_0x5ad9('0x62')][_0x5ad9('0x30')],_0x426fbe[_0x5ad9('0x62')][_0x5ad9('0x63')],_0x3e429f['interaction']['id'],_0x426fbe['body']?JSON['stringify'](_0x426fbe['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3e429f);}return null;})[_0x5ad9('0x1c')](function(_0x28196b){if(_0x28196b){if(_0x426fbe[_0x5ad9('0x50')][_0x5ad9('0x64')]){_0x3e429f[_0x5ad9('0x23')][_0x5ad9('0x65')]=util[_0x5ad9('0x58')](_0x5ad9('0x66'),_0x426fbe[_0x5ad9('0x62')]['name']);_0x3e429f[_0x5ad9('0x23')][_0x5ad9('0x67')]=_0x3e429f['channel'];_0x3e429f[_0x5ad9('0x23')]['event']=_0x5ad9('0x55');return respondWithRpcPromise(_0x5ad9('0x68'),_0x5ad9('0x68'),{'event':_0x5ad9('0x69'),'message':_0x3e429f[_0x5ad9('0x23')]},client9002)['then'](function(){return _0x3e429f;});}return _0x3e429f;}return null;})['then'](respondWithResult(_0x2ea39d,null))[_0x5ad9('0x49')](handleError(_0x2ea39d,null));};var interaction_log=require(_0x5ad9('0x53'))(_0x5ad9('0x54'));exports[_0x5ad9('0x2d')]=function(_0xf9b1c1,_0x3320d5,_0x381662){var _0x649938={'agent':{},'channel':_0x5ad9('0x6a')};if(_0xf9b1c1[_0x5ad9('0x50')]['id']){delete _0xf9b1c1[_0x5ad9('0x50')]['id'];}_0xf9b1c1[_0x5ad9('0x50')][_0x5ad9('0x5a')]=_0xf9b1c1[_0x5ad9('0x50')][_0x5ad9('0x5a')]||_0xf9b1c1['user']['id'];_0x649938[_0x5ad9('0x6b')]['id']=_0xf9b1c1[_0x5ad9('0x50')][_0x5ad9('0x5a')];return db[_0x5ad9('0x32')]['find']({'where':{'id':_0xf9b1c1[_0x5ad9('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3320d5,null))[_0x5ad9('0x1c')](function(_0x370445){if(_0x370445){_0x649938[_0x5ad9('0x23')]=_0x370445[_0x5ad9('0x5c')]({'plain':!![]});return db[_0x5ad9('0x5d')][_0x5ad9('0x4e')]({'where':{'id':_0x370445[_0x5ad9('0x5e')]}});}return null;})[_0x5ad9('0x1c')](handleEntityNotFound(_0x3320d5,null))['then'](function(_0x58b9d2){if(_0x58b9d2){_0x649938[_0x5ad9('0x61')]=_0x58b9d2[_0x5ad9('0x5c')]({'plain':!![]});interaction_log['info'](_0x5ad9('0x6c'),_0xf9b1c1[_0x5ad9('0x62')]['id'],_0xf9b1c1[_0x5ad9('0x62')][_0x5ad9('0x30')],_0xf9b1c1[_0x5ad9('0x62')][_0x5ad9('0x63')],_0x649938[_0x5ad9('0x61')]['id'],_0xf9b1c1[_0x5ad9('0x50')]?JSON['stringify'](_0xf9b1c1['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x649938);}return null;})[_0x5ad9('0x1c')](function(_0x2194e5){if(_0x2194e5){_0x2194e5[_0x5ad9('0x23')][_0x5ad9('0x65')]=util[_0x5ad9('0x58')]('SIP/%s',_0xf9b1c1[_0x5ad9('0x62')][_0x5ad9('0x30')]);_0x2194e5[_0x5ad9('0x23')][_0x5ad9('0x67')]=_0x649938['channel'];_0x2194e5['message']['event']=_0x5ad9('0x2d');respondWithRpcPromise('EventManager',_0x5ad9('0x68'),{'event':'rejectmessage','message':_0x2194e5['message']},client9002);return _0x649938;}return null;})[_0x5ad9('0x1c')](respondWithResult(_0x3320d5,null))[_0x5ad9('0x49')](handleError(_0x3320d5,null));};exports[_0x5ad9('0x6d')]=function(_0x147bb0,_0x1ea467){var _0x350e5d;return db[_0x5ad9('0x32')][_0x5ad9('0x6d')](_0x147bb0[_0x5ad9('0x50')],{})['then'](function(_0x243c60){_0x350e5d=_0x243c60;return db[_0x5ad9('0x5b')][_0x5ad9('0x6e')]({'where':{'id':_0x350e5d[_0x5ad9('0x6f')]}});})[_0x5ad9('0x1c')](function(_0x2778da){if(_['isNil'](_0x2778da)){return;}else{_0x350e5d[_0x5ad9('0x6a')]=_0x2778da[_0x5ad9('0x6a')];return db[_0x5ad9('0x70')][_0x5ad9('0x6e')]({'where':{'id':_0x350e5d[_0x5ad9('0x71')]}});}})[_0x5ad9('0x1c')](function(_0x1bae3b){return respondWithRpcPromise(_0x5ad9('0x72'),_0x5ad9('0x72'),{'FaxAccountId':_[_0x5ad9('0x5f')](_0x147bb0['body'])?undefined:_0x147bb0[_0x5ad9('0x50')][_0x5ad9('0x73')],'path':_[_0x5ad9('0x5f')](_0x1bae3b)?undefined:util[_0x5ad9('0x58')]('/var/opt/motion2/server/files/attachments/%s',_0x1bae3b[_0x5ad9('0x74')]),'fax':_[_0x5ad9('0x5f')](_0x350e5d[_0x5ad9('0x6a')])?undefined:_0x350e5d[_0x5ad9('0x6a')],'AttachmentId':_0x350e5d[_0x5ad9('0x71')]},client9002);})[_0x5ad9('0x1c')](respondWithResult(_0x1ea467,0xc9))[_0x5ad9('0x49')](handleError(_0x1ea467,null));};exports['download']=function(_0x22c1e0,_0x8cde16){var _0x494966=path['join'](config[_0x5ad9('0x75')],_0x5ad9('0x76'),_0x5ad9('0x77'),_0x5ad9('0x78'));return db[_0x5ad9('0x32')]['find']({'where':{'id':_0x22c1e0[_0x5ad9('0x4b')]['id']},'include':[{'model':db[_0x5ad9('0x70')],'as':_0x5ad9('0x70')}]})[_0x5ad9('0x1c')](handleEntityNotFound(_0x8cde16,null))[_0x5ad9('0x1c')](function(_0x2a39af){if(_0x2a39af){return _0x8cde16[_0x5ad9('0x79')](path[_0x5ad9('0x7a')](_0x494966,_0x2a39af[_0x5ad9('0x70')][_0x5ad9('0x74')]));}})[_0x5ad9('0x49')](handleError(_0x8cde16,null));}; \ No newline at end of file +var _0x4156=['ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','count','offset','limit','json','reject','save','update','name','status','send','index','FaxMessage','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','key','VIRTUAL','field','merge','options','include','findAll','rows','params','keys','includeAll','find','body','destroy','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','UserId','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','manual','interface','SIP/%s','event','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','rejectmessage','create','ContactId','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x4156,0xf1));var _0x6415=function(_0xe3096b,_0x5433a8){_0xe3096b=_0xe3096b-0x0;var _0x5178da=_0x4156[_0xe3096b];return _0x5178da;};'use strict';var pdf=require(_0x6415('0x0'));var emlformat=require(_0x6415('0x1'));var rimraf=require(_0x6415('0x2'));var zipdir=require(_0x6415('0x3'));var jsonpatch=require(_0x6415('0x4'));var rp=require('request-promise');var moment=require(_0x6415('0x5'));var BPromise=require(_0x6415('0x6'));var Mustache=require(_0x6415('0x7'));var util=require(_0x6415('0x8'));var path=require(_0x6415('0x9'));var sox=require(_0x6415('0xa'));var csv=require(_0x6415('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6415('0xc'));var squel=require('squel');var crypto=require(_0x6415('0xd'));var jsforce=require(_0x6415('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6415('0xb'));var querystring=require(_0x6415('0xf'));var Papa=require(_0x6415('0x10'));var Redis=require(_0x6415('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6415('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6415('0x13'));var utils=require(_0x6415('0x14'));var config=require(_0x6415('0x15'));var db=require(_0x6415('0x16'))['db'];config[_0x6415('0x17')]=_[_0x6415('0x18')](config[_0x6415('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6415('0x17')]));require(_0x6415('0x19'))[_0x6415('0x1a')](socket);var jayson=require(_0x6415('0x1b'));var client=jayson[_0x6415('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6415('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x780643,_0x48017d,_0x1d540c){if(_0x1d540c){var _0x41f9b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41f9b0['test'](_0x48017d)){return _0x780643;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x780643;}}function respondWithRpcPromise(_0x352a04,_0x4216c8,_0x3f739d,_0xe513fe){return new BPromise(function(_0x2ef73b,_0xa3d00a){var _0x2c74c6=_0xe513fe||client;return _0x2c74c6[_0x6415('0x1e')](_0x352a04,_0x3f739d)[_0x6415('0x1f')](function(_0x4f644e){logger['info']('FaxMessage,\x20%s,\x20%s',_0x4216c8,_0x6415('0x20'));logger[_0x6415('0x21')](_0x6415('0x22'),_0x4216c8,_0x6415('0x20'),JSON['stringify'](_0x4f644e));if(_0x4f644e[_0x6415('0x23')]){if(_0x4f644e[_0x6415('0x23')][_0x6415('0x24')]===0x1f4){logger['error'](_0x6415('0x25'),_0x4216c8,_0x4f644e[_0x6415('0x23')][_0x6415('0x26')]);return _0xa3d00a(_0x4f644e[_0x6415('0x23')][_0x6415('0x26')]);}logger[_0x6415('0x23')](_0x6415('0x25'),_0x4216c8,_0x4f644e[_0x6415('0x23')][_0x6415('0x26')]);return _0x2ef73b(_0x4f644e['error'][_0x6415('0x26')]);}else{logger[_0x6415('0x27')]('FaxMessage,\x20%s,\x20%s',_0x4216c8,_0x6415('0x20'));_0x2ef73b(_0x4f644e[_0x6415('0x28')][_0x6415('0x26')]);}})[_0x6415('0x29')](function(_0x31dabc){logger['error'](_0x6415('0x25'),_0x4216c8,_0x31dabc);_0xa3d00a(_0x31dabc);});});}function respondWithStatusCode(_0x561586,_0x24528f){_0x24528f=_0x24528f||0xcc;return function(_0xbe3a32){if(_0xbe3a32){return _0x561586[_0x6415('0x2a')](_0x24528f);}return _0x561586['status'](_0x24528f)['end']();};}function respondWithResult(_0x514f51,_0x61e827){_0x61e827=_0x61e827||0xc8;return function(_0x31f717){if(_0x31f717){return _0x514f51['status'](_0x61e827)['json'](_0x31f717);}};}function respondWithFilteredResult(_0xf3e415,_0x4426ed){return function(_0x162889){if(_0x162889){var _0x422cdc=_0x162889[_0x6415('0x2b')],_0x25e97f=_0x4426ed[_0x6415('0x2c')],_0x2ba17d=_0x4426ed[_0x6415('0x2c')]+_0x4426ed[_0x6415('0x2d')],_0x5b15fd;if(_0x2ba17d>=_0x422cdc){_0x2ba17d=_0x422cdc;_0x5b15fd=0xc8;}else{_0x5b15fd=0xce;}_0xf3e415['status'](_0x5b15fd);return _0xf3e415['set']('Content-Range',_0x25e97f+'-'+_0x2ba17d+'/'+_0x422cdc)[_0x6415('0x2e')](_0x162889);}return null;};}function patchUpdates(_0x4880ee){return function(_0x2a4346){try{jsonpatch['apply'](_0x2a4346,_0x4880ee,!![]);}catch(_0x1ee01f){return BPromise[_0x6415('0x2f')](_0x1ee01f);}return _0x2a4346[_0x6415('0x30')]();};}function saveUpdates(_0x30ce91,_0x5e851d){return function(_0x5be641){if(_0x5be641){return _0x5be641[_0x6415('0x31')](_0x30ce91)[_0x6415('0x1f')](function(_0x87d807){return _0x87d807;});}return null;};}function removeEntity(_0x2cd321,_0x3e7497){return function(_0x143163){if(_0x143163){return _0x143163['destroy']()[_0x6415('0x1f')](function(){_0x2cd321['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e07c6,_0x587b47){return function(_0x53f991){if(!_0x53f991){_0x4e07c6[_0x6415('0x2a')](0x194);}return _0x53f991;};}function handleError(_0x9276b,_0x49e7a8){_0x49e7a8=_0x49e7a8||0x1f4;return function(_0x29223d){logger[_0x6415('0x23')](_0x29223d['stack']);if(_0x29223d[_0x6415('0x32')]){delete _0x29223d[_0x6415('0x32')];}_0x9276b[_0x6415('0x33')](_0x49e7a8)[_0x6415('0x34')](_0x29223d);};}exports[_0x6415('0x35')]=function(_0x59d828,_0x15c32f){var _0x5773a6={},_0x326f6d={},_0x1ddab3={'count':0x0,'rows':[]};var _0x4cf322=db[_0x6415('0x36')][_0x6415('0x37')];_0x326f6d['model']=_['keys'](_0x4cf322);_0x326f6d[_0x6415('0x38')]=_['keys'](_0x59d828[_0x6415('0x38')]);_0x326f6d['filters']=_[_0x6415('0x39')](_0x326f6d[_0x6415('0x3a')],_0x326f6d['query']);_0x5773a6[_0x6415('0x3b')]=_['intersection'](_0x326f6d[_0x6415('0x3a')],qs[_0x6415('0x3c')](_0x59d828[_0x6415('0x38')][_0x6415('0x3c')]));_0x5773a6[_0x6415('0x3b')]=_0x5773a6[_0x6415('0x3b')][_0x6415('0x3d')]?_0x5773a6[_0x6415('0x3b')]:_0x326f6d[_0x6415('0x3a')];if(!_0x59d828[_0x6415('0x38')][_0x6415('0x3e')](_0x6415('0x3f'))){_0x5773a6[_0x6415('0x2d')]=qs[_0x6415('0x2d')](_0x59d828[_0x6415('0x38')][_0x6415('0x2d')]);_0x5773a6[_0x6415('0x2c')]=qs[_0x6415('0x2c')](_0x59d828[_0x6415('0x38')]['offset']);}_0x5773a6[_0x6415('0x40')]=qs['sort'](_0x59d828[_0x6415('0x38')][_0x6415('0x41')]);_0x5773a6['where']=qs[_0x6415('0x42')](_[_0x6415('0x43')](_0x59d828[_0x6415('0x38')],_0x326f6d[_0x6415('0x42')]));if(_0x59d828['query']['filter']){_0x5773a6[_0x6415('0x44')]=_['merge'](_0x5773a6[_0x6415('0x44')],{'$or':_['map'](_0x4cf322,function(_0xa2deb0){if(_0xa2deb0[_0x6415('0x45')][_0x6415('0x46')]!==_0x6415('0x47')){var _0x87d56b={};_0x87d56b[_0xa2deb0[_0x6415('0x48')]]={'$like':'%'+_0x59d828[_0x6415('0x38')]['filter']+'%'};return _0x87d56b;}})});}_0x5773a6=_[_0x6415('0x49')]({},_0x5773a6,_0x59d828[_0x6415('0x4a')]);var _0x5636eb={'where':_0x5773a6[_0x6415('0x44')]};return db['FaxMessage'][_0x6415('0x2b')](_0x5636eb)[_0x6415('0x1f')](function(_0x42715d){_0x1ddab3[_0x6415('0x2b')]=_0x42715d;if(_0x59d828[_0x6415('0x38')]['includeAll']){_0x5773a6[_0x6415('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x6415('0x4c')](_0x5773a6);})[_0x6415('0x1f')](function(_0x325c5f){_0x1ddab3[_0x6415('0x4d')]=_0x325c5f;return _0x1ddab3;})['then'](respondWithFilteredResult(_0x15c32f,_0x5773a6))[_0x6415('0x29')](handleError(_0x15c32f,null));};exports['show']=function(_0x4130c5,_0x1e2f12){var _0x55a350={'raw':!![],'where':{'id':_0x4130c5[_0x6415('0x4e')]['id']}},_0x2218d0={};_0x2218d0[_0x6415('0x3a')]=_['keys'](db[_0x6415('0x36')][_0x6415('0x37')]);_0x2218d0[_0x6415('0x38')]=_[_0x6415('0x4f')](_0x4130c5[_0x6415('0x38')]);_0x2218d0[_0x6415('0x42')]=_[_0x6415('0x39')](_0x2218d0[_0x6415('0x3a')],_0x2218d0['query']);_0x55a350[_0x6415('0x3b')]=_[_0x6415('0x39')](_0x2218d0[_0x6415('0x3a')],qs[_0x6415('0x3c')](_0x4130c5[_0x6415('0x38')]['fields']));_0x55a350[_0x6415('0x3b')]=_0x55a350[_0x6415('0x3b')][_0x6415('0x3d')]?_0x55a350[_0x6415('0x3b')]:_0x2218d0[_0x6415('0x3a')];if(_0x4130c5[_0x6415('0x38')][_0x6415('0x50')]){_0x55a350[_0x6415('0x4b')]=[{'all':!![]}];}_0x55a350=_[_0x6415('0x49')]({},_0x55a350,_0x4130c5[_0x6415('0x4a')]);return db['FaxMessage'][_0x6415('0x51')](_0x55a350)[_0x6415('0x1f')](handleEntityNotFound(_0x1e2f12,null))[_0x6415('0x1f')](respondWithResult(_0x1e2f12,null))[_0x6415('0x29')](handleError(_0x1e2f12,null));};exports[_0x6415('0x31')]=function(_0x5acdee,_0x41335d){if(_0x5acdee[_0x6415('0x52')]['id']){delete _0x5acdee[_0x6415('0x52')]['id'];}return db['FaxMessage'][_0x6415('0x51')]({'where':{'id':_0x5acdee[_0x6415('0x4e')]['id']}})[_0x6415('0x1f')](handleEntityNotFound(_0x41335d,null))[_0x6415('0x1f')](saveUpdates(_0x5acdee[_0x6415('0x52')],null))[_0x6415('0x1f')](respondWithResult(_0x41335d,null))['catch'](handleError(_0x41335d,null));};exports[_0x6415('0x53')]=function(_0x4a0fc1,_0x2cc41c){return db[_0x6415('0x36')]['find']({'where':{'id':_0x4a0fc1[_0x6415('0x4e')]['id']}})[_0x6415('0x1f')](handleEntityNotFound(_0x2cc41c,null))[_0x6415('0x1f')](removeEntity(_0x2cc41c,null))[_0x6415('0x29')](handleError(_0x2cc41c,null));};exports[_0x6415('0x54')]=function(_0xa1ab22,_0x498d88){return db[_0x6415('0x36')][_0x6415('0x54')]()[_0x6415('0x1f')](respondWithResult(_0x498d88,null))[_0x6415('0x29')](handleError(_0x498d88,null));};var interaction_log=require(_0x6415('0x55'))(_0x6415('0x56'));exports[_0x6415('0x57')]=function(_0x3e6ef8,_0x33e460,_0x5f4d04){var _0x5a709a={'channel':_0x6415('0x58')};if(_0x3e6ef8[_0x6415('0x52')]['id']){delete _0x3e6ef8['body']['id'];}_0x3e6ef8[_0x6415('0x52')][_0x6415('0x59')]=!![];_0x3e6ef8[_0x6415('0x52')][_0x6415('0x5a')]=moment()[_0x6415('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e6ef8[_0x6415('0x52')]['UserId']=_0x3e6ef8[_0x6415('0x52')][_0x6415('0x5c')]||_0x3e6ef8['user']['id'];return db[_0x6415('0x36')][_0x6415('0x51')]({'where':{'id':_0x3e6ef8[_0x6415('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0x6415('0x5d')],'as':_0x6415('0x5e')}]})[_0x6415('0x1f')](handleEntityNotFound(_0x33e460,null))[_0x6415('0x1f')](saveUpdates(_0x3e6ef8['body'],null))['then'](function(_0x2c5085){if(_0x2c5085){_0x5a709a[_0x6415('0x26')]=_0x2c5085[_0x6415('0x5f')]({'plain':!![]});return db[_0x6415('0x60')]['find']({'where':{'id':_0x2c5085[_0x6415('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x33e460,null))[_0x6415('0x1f')](function(_0x441186){if(_0x441186){return _0x441186[_0x6415('0x31')]({'UserId':_0x3e6ef8[_0x6415('0x52')][_0x6415('0x5c')],'read1stAt':_[_0x6415('0x62')](_0x441186[_0x6415('0x63')])?moment()[_0x6415('0x5b')](_0x6415('0x64')):undefined});}return null;})[_0x6415('0x1f')](function(_0x350e5a){if(_0x350e5a){_0x5a709a[_0x6415('0x65')]=_0x350e5a[_0x6415('0x5f')]({'plain':!![]});interaction_log[_0x6415('0x27')](_0x6415('0x66'),_0x3e6ef8[_0x6415('0x67')]['id'],_0x3e6ef8[_0x6415('0x67')][_0x6415('0x32')],_0x3e6ef8[_0x6415('0x67')][_0x6415('0x68')],_0x5a709a[_0x6415('0x65')]['id'],_0x3e6ef8[_0x6415('0x52')]?JSON[_0x6415('0x69')](_0x3e6ef8['body']):_0x6415('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5a709a);}return null;})[_0x6415('0x1f')](function(_0x54d12f){if(_0x54d12f){if(_0x3e6ef8['body'][_0x6415('0x6b')]){_0x5a709a[_0x6415('0x26')][_0x6415('0x6c')]=util['format'](_0x6415('0x6d'),_0x3e6ef8[_0x6415('0x67')][_0x6415('0x32')]);_0x5a709a['message']['channel']=_0x5a709a['channel'];_0x5a709a['message'][_0x6415('0x6e')]=_0x6415('0x57');return respondWithRpcPromise(_0x6415('0x6f'),'EventManager',{'event':'acceptmessage','message':_0x5a709a[_0x6415('0x26')]},client9002)[_0x6415('0x1f')](function(){return _0x5a709a;});}return _0x5a709a;}return null;})[_0x6415('0x1f')](respondWithResult(_0x33e460,null))[_0x6415('0x29')](handleError(_0x33e460,null));};var interaction_log=require(_0x6415('0x55'))(_0x6415('0x56'));exports['reject']=function(_0x27454b,_0x2b1688,_0x4fa282){var _0x5739ca={'agent':{},'channel':_0x6415('0x58')};if(_0x27454b[_0x6415('0x52')]['id']){delete _0x27454b[_0x6415('0x52')]['id'];}_0x27454b['body'][_0x6415('0x5c')]=_0x27454b[_0x6415('0x52')][_0x6415('0x5c')]||_0x27454b[_0x6415('0x67')]['id'];_0x5739ca['agent']['id']=_0x27454b['body'][_0x6415('0x5c')];return db['FaxMessage'][_0x6415('0x51')]({'where':{'id':_0x27454b[_0x6415('0x4e')]['id'],'UserId':null}})[_0x6415('0x1f')](handleEntityNotFound(_0x2b1688,null))[_0x6415('0x1f')](function(_0x4d4993){if(_0x4d4993){_0x5739ca['message']=_0x4d4993[_0x6415('0x5f')]({'plain':!![]});return db[_0x6415('0x60')][_0x6415('0x51')]({'where':{'id':_0x4d4993['FaxInteractionId']}});}return null;})[_0x6415('0x1f')](handleEntityNotFound(_0x2b1688,null))[_0x6415('0x1f')](function(_0x4fd9aa){if(_0x4fd9aa){_0x5739ca[_0x6415('0x65')]=_0x4fd9aa[_0x6415('0x5f')]({'plain':!![]});interaction_log['info'](_0x6415('0x70'),_0x27454b[_0x6415('0x67')]['id'],_0x27454b[_0x6415('0x67')]['name'],_0x27454b[_0x6415('0x67')][_0x6415('0x68')],_0x5739ca['interaction']['id'],_0x27454b[_0x6415('0x52')]?JSON[_0x6415('0x69')](_0x27454b[_0x6415('0x52')]):'null');return respondWithRpcPromise(_0x6415('0x71'),_0x6415('0x72'),_0x5739ca);}return null;})[_0x6415('0x1f')](function(_0x163673){if(_0x163673){_0x163673[_0x6415('0x26')][_0x6415('0x6c')]=util[_0x6415('0x5b')](_0x6415('0x6d'),_0x27454b[_0x6415('0x67')]['name']);_0x163673[_0x6415('0x26')][_0x6415('0x73')]=_0x5739ca[_0x6415('0x73')];_0x163673[_0x6415('0x26')][_0x6415('0x6e')]=_0x6415('0x2f');respondWithRpcPromise(_0x6415('0x6f'),_0x6415('0x6f'),{'event':_0x6415('0x74'),'message':_0x163673['message']},client9002);return _0x5739ca;}return null;})[_0x6415('0x1f')](respondWithResult(_0x2b1688,null))[_0x6415('0x29')](handleError(_0x2b1688,null));};exports[_0x6415('0x75')]=function(_0x3f7f3b,_0x2a1172){var _0xb39fbe;return db[_0x6415('0x36')][_0x6415('0x75')](_0x3f7f3b[_0x6415('0x52')],{})[_0x6415('0x1f')](function(_0x29fae0){_0xb39fbe=_0x29fae0;return db['CmContact']['findOne']({'where':{'id':_0xb39fbe[_0x6415('0x76')]}});})[_0x6415('0x1f')](function(_0x19972c){if(_[_0x6415('0x62')](_0x19972c)){return;}else{_0xb39fbe[_0x6415('0x58')]=_0x19972c[_0x6415('0x58')];return db[_0x6415('0x77')]['findOne']({'where':{'id':_0xb39fbe[_0x6415('0x78')]}});}})['then'](function(_0x599765){return respondWithRpcPromise(_0x6415('0x79'),_0x6415('0x79'),{'FaxAccountId':_[_0x6415('0x62')](_0x3f7f3b[_0x6415('0x52')])?undefined:_0x3f7f3b['body']['FaxAccountId'],'path':_['isNil'](_0x599765)?undefined:util[_0x6415('0x5b')](_0x6415('0x7a'),_0x599765[_0x6415('0x7b')]),'fax':_[_0x6415('0x62')](_0xb39fbe['fax'])?undefined:_0xb39fbe[_0x6415('0x58')],'AttachmentId':_0xb39fbe[_0x6415('0x78')]},client9002);})['then'](respondWithResult(_0x2a1172,0xc9))['catch'](handleError(_0x2a1172,null));};exports['download']=function(_0x1aa163,_0x46e3a6){var _0x36b625=path[_0x6415('0x7c')](config['root'],_0x6415('0x7d'),_0x6415('0x7e'),_0x6415('0x7f'));return db['FaxMessage'][_0x6415('0x51')]({'where':{'id':_0x1aa163[_0x6415('0x4e')]['id']},'include':[{'model':db[_0x6415('0x77')],'as':'Attachment'}]})[_0x6415('0x1f')](handleEntityNotFound(_0x46e3a6,null))[_0x6415('0x1f')](function(_0x309512){if(_0x309512){return _0x46e3a6[_0x6415('0x80')](path['join'](_0x36b625,_0x309512[_0x6415('0x77')][_0x6415('0x7b')]));}})[_0x6415('0x29')](handleError(_0x46e3a6,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index a02f280..266ff74 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 _0xfd56=['hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5df39f,_0x46c78a){var _0x18353a=function(_0x506208){while(--_0x506208){_0x5df39f['push'](_0x5df39f['shift']());}};_0x18353a(++_0x46c78a);}(_0xfd56,0x17c));var _0x6fd5=function(_0x5973ee,_0x4a097f){_0x5973ee=_0x5973ee-0x0;var _0x2b88d1=_0xfd56[_0x5973ee];return _0x2b88d1;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x6fd5('0x0'))['db'][_0x6fd5('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6fd5('0x2')](0x0);var events={'afterCreate':_0x6fd5('0x3'),'afterUpdate':_0x6fd5('0x4'),'afterDestroy':_0x6fd5('0x5')};function emitEvent(_0x454042){return function(_0x6d4a8b,_0x1f155a,_0x5e4e0e){FaxMessageEvents[_0x6fd5('0x6')](_0x454042+':'+_0x6d4a8b['id'],_0x6d4a8b);FaxMessageEvents[_0x6fd5('0x6')](_0x454042,_0x6d4a8b);_0x5e4e0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x6fd5('0x7')](e,emitEvent(event));}}module[_0x6fd5('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x9b04=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9b04,0x19b));var _0x49b0=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0x9b04[_0x1e2372];return _0x4cd59b;};'use strict';var EventEmitter=require(_0x49b0('0x0'));var FaxMessage=require(_0x49b0('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x49b0('0x2')};function emitEvent(_0x51948f){return function(_0x4bd411,_0x2a3b38,_0x56a64e){FaxMessageEvents[_0x49b0('0x3')](_0x51948f+':'+_0x4bd411['id'],_0x4bd411);FaxMessageEvents[_0x49b0('0x3')](_0x51948f,_0x4bd411);_0x56a64e(null);};}for(var e in events){if(events[_0x49b0('0x4')](e)){var event=events[e];FaxMessage[_0x49b0('0x5')](e,emitEvent(event));}}module[_0x49b0('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 7d6ebae..cfde0be 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 _0x843f=['FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','secret','isNil','FaxInteraction','findOne','createdAt','catch','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x553e3d,_0x4d9a80){var _0x3403a9=function(_0x117a6a){while(--_0x117a6a){_0x553e3d['push'](_0x553e3d['shift']());}};_0x3403a9(++_0x4d9a80);}(_0x843f,0x16d));var _0xf843=function(_0x29c73e,_0x171227){_0x29c73e=_0x29c73e-0x0;var _0x3b8d55=_0x843f[_0x29c73e];return _0x3b8d55;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf843('0x0'))(_0xf843('0x1'));var moment=require(_0xf843('0x2'));var BPromise=require(_0xf843('0x3'));var rp=require(_0xf843('0x4'));var fs=require('fs');var path=require(_0xf843('0x5'));var rimraf=require(_0xf843('0x6'));var config=require(_0xf843('0x7'));var attributes=require(_0xf843('0x8'));module[_0xf843('0x9')]=function(_0x1d2ca6,_0x9fc29c){return _0x1d2ca6['define'](_0xf843('0xa'),attributes,{'tableName':_0xf843('0xb'),'paranoid':![],'indexes':[{'name':_0xf843('0xc'),'fields':[_0xf843('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x260c76,_0x49a98b,_0xd9f0af){var _0x1876f1=_0x1d2ca6[_0xf843('0xe')];var _0x2b8f9d=_0x260c76[_0xf843('0xf')]({'plain':!![]});if(_0x2b8f9d[_0xf843('0x10')]['toLowerCase']()==='in'||_0x2b8f9d[_0xf843('0x10')][_0xf843('0x11')]()==='out'&&!_0x2b8f9d[_0xf843('0x12')]&&!_[_0xf843('0x13')](_0x2b8f9d['UserId'])){_0x1876f1[_0xf843('0x14')][_0xf843('0x15')]({'where':{'id':_0x2b8f9d['FaxInteractionId']}})['then'](function(_0x458ce4){if(_0x458ce4){_0x458ce4['update']({'lastMsgAt':_0x2b8f9d[_0xf843('0x16')],'lastMsgDirection':_0x2b8f9d[_0xf843('0x10')][_0xf843('0x11')]()});}})[_0xf843('0x17')](function(_0x5161b5){console['error'](_0x5161b5);});}_0xd9f0af();}},'charset':_0xf843('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7e42=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','toLowerCase','out','secret','isNil','UserId','FaxInteraction','then','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7e42,0x1a5));var _0x27e4=function(_0x49517a,_0x2d2f1d){_0x49517a=_0x49517a-0x0;var _0x5b52c9=_0x7e42[_0x49517a];return _0x5b52c9;};'use strict';var _=require(_0x27e4('0x0'));var util=require(_0x27e4('0x1'));var logger=require('../../config/logger')(_0x27e4('0x2'));var moment=require(_0x27e4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x27e4('0x4'));var config=require('../../config/environment');var attributes=require(_0x27e4('0x5'));module[_0x27e4('0x6')]=function(_0x513f7c,_0x287644){return _0x513f7c[_0x27e4('0x7')](_0x27e4('0x8'),attributes,{'tableName':_0x27e4('0x9'),'paranoid':![],'indexes':[{'name':_0x27e4('0xa'),'fields':[_0x27e4('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59588b,_0x27caf8,_0x587c19){var _0x5f5c92=_0x513f7c[_0x27e4('0xc')];var _0x52428c=_0x59588b['get']({'plain':!![]});if(_0x52428c['direction']['toLowerCase']()==='in'||_0x52428c['direction'][_0x27e4('0xd')]()===_0x27e4('0xe')&&!_0x52428c[_0x27e4('0xf')]&&!_[_0x27e4('0x10')](_0x52428c[_0x27e4('0x11')])){_0x5f5c92[_0x27e4('0x12')]['findOne']({'where':{'id':_0x52428c['FaxInteractionId']}})[_0x27e4('0x13')](function(_0x4a96cb){if(_0x4a96cb){_0x4a96cb[_0x27e4('0x14')]({'lastMsgAt':_0x52428c[_0x27e4('0x15')],'lastMsgDirection':_0x52428c['direction'][_0x27e4('0xd')]()});}})[_0x27e4('0x16')](function(_0x789cc1){console[_0x27e4('0x17')](_0x789cc1);});}_0x587c19();}},'charset':_0x27e4('0x18'),'collate':_0x27e4('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 9f064e7..0991d2c 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 _0x37cc=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','options','stringify','UpdateFaxMessage','update','raw','attributes','limit','lodash'];(function(_0x600794,_0x37421d){var _0x33f912=function(_0x4a9317){while(--_0x4a9317){_0x600794['push'](_0x600794['shift']());}};_0x33f912(++_0x37421d);}(_0x37cc,0x185));var _0xc37c=function(_0x471d6a,_0x56e87c){_0x471d6a=_0x471d6a-0x0;var _0x5e837e=_0x37cc[_0x471d6a];return _0x5e837e;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var moment=require(_0xc37c('0x2'));var BPromise=require(_0xc37c('0x3'));var rs=require(_0xc37c('0x4'));var fs=require('fs');var Redis=require(_0xc37c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc37c('0x6'))(_0xc37c('0x7'));var config=require(_0xc37c('0x8'));var jayson=require(_0xc37c('0x9'));var client=jayson[_0xc37c('0xa')][_0xc37c('0xb')]({'port':0x232a});config[_0xc37c('0xc')]=_[_0xc37c('0xd')](config[_0xc37c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc37c('0xe'))(new Redis(config[_0xc37c('0xc')]));require(_0xc37c('0xf'))[_0xc37c('0x10')](socket);function respondWithRpcPromise(_0xbef543,_0x596406,_0xccce4e){return new BPromise(function(_0x35840a,_0xe0e5c7){return client[_0xc37c('0x11')](_0xbef543,_0xccce4e)[_0xc37c('0x12')](function(_0x6feb0c){logger[_0xc37c('0x13')](_0xc37c('0x14'),_0x596406,_0xc37c('0x15'));logger[_0xc37c('0x16')](_0xc37c('0x17'),_0x596406,'request\x20sent',JSON['stringify'](_0x6feb0c));if(_0x6feb0c[_0xc37c('0x18')]){if(_0x6feb0c[_0xc37c('0x18')][_0xc37c('0x19')]===0x1f4){logger[_0xc37c('0x18')](_0xc37c('0x14'),_0x596406,_0x6feb0c[_0xc37c('0x18')]['message']);return _0xe0e5c7(_0x6feb0c[_0xc37c('0x18')]['message']);}logger[_0xc37c('0x18')](_0xc37c('0x14'),_0x596406,_0x6feb0c[_0xc37c('0x18')][_0xc37c('0x1a')]);return _0x35840a(_0x6feb0c[_0xc37c('0x18')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x596406,_0xc37c('0x15'));_0x35840a(_0x6feb0c['result'][_0xc37c('0x1a')]);}})[_0xc37c('0x1b')](function(_0x520223){logger[_0xc37c('0x18')](_0xc37c('0x14'),_0x596406,_0x520223);_0xe0e5c7(_0x520223);});});}exports[_0xc37c('0x1c')]=function(_0x27158f){var _0x481d1a=this;return new Promise(function(_0x22b4a4,_0x4d3aa4){return db[_0xc37c('0x1d')][_0xc37c('0x1e')](_0x27158f[_0xc37c('0x1f')],{'raw':_0x27158f[_0xc37c('0x20')]?_0x27158f[_0xc37c('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xc37c('0x12')](function(_0x33aa68){logger[_0xc37c('0x13')](_0xc37c('0x1c'),_0x27158f);logger[_0xc37c('0x16')](_0xc37c('0x1c'),_0x27158f,JSON[_0xc37c('0x21')](_0x33aa68));_0x22b4a4(_0x33aa68);})[_0xc37c('0x1b')](function(_0x1e61d4){logger[_0xc37c('0x18')](_0xc37c('0x1c'),_0x1e61d4[_0xc37c('0x1a')],_0x27158f);_0x4d3aa4(_0x481d1a[_0xc37c('0x18')](0x1f4,_0x1e61d4['message']));});});};exports[_0xc37c('0x22')]=function(_0x1ecf92){var _0x1d59fa=this;return new Promise(function(_0x484c43,_0x53f062){return db[_0xc37c('0x1d')][_0xc37c('0x23')](_0x1ecf92[_0xc37c('0x1f')],{'raw':_0x1ecf92[_0xc37c('0x20')]?_0x1ecf92[_0xc37c('0x20')][_0xc37c('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ecf92[_0xc37c('0x20')]?_0x1ecf92[_0xc37c('0x20')]['where']||null:null,'attributes':_0x1ecf92[_0xc37c('0x20')]?_0x1ecf92[_0xc37c('0x20')][_0xc37c('0x25')]||null:null,'limit':_0x1ecf92[_0xc37c('0x20')]?_0x1ecf92[_0xc37c('0x20')][_0xc37c('0x26')]||null:null})[_0xc37c('0x12')](function(_0x1c3e9d){logger[_0xc37c('0x13')](_0xc37c('0x22'),_0x1ecf92);logger[_0xc37c('0x16')](_0xc37c('0x22'),_0x1ecf92,JSON[_0xc37c('0x21')](_0x1c3e9d));_0x484c43(_0x1c3e9d);})['catch'](function(_0x1690f3){logger[_0xc37c('0x18')]('UpdateFaxMessage',_0x1690f3['message'],_0x1ecf92);_0x53f062(_0x1d59fa[_0xc37c('0x18')](0x1f4,_0x1690f3[_0xc37c('0x1a')]));});});}; \ No newline at end of file +var _0xe9e8=['body','options','raw','catch','UpdateFaxMessage','FaxMessage','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','create'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xe9e8,0x179));var _0x8e9e=function(_0x430933,_0x3b3620){_0x430933=_0x430933-0x0;var _0x20f315=_0xe9e8[_0x430933];return _0x20f315;};'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'))('rpc');var config=require(_0x8e9e('0x8'));var jayson=require(_0x8e9e('0x9'));var client=jayson[_0x8e9e('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8e9e('0xb')](config[_0x8e9e('0xc')],{'host':_0x8e9e('0xd'),'port':0x18eb});var socket=require(_0x8e9e('0xe'))(new Redis(config[_0x8e9e('0xc')]));require(_0x8e9e('0xf'))['register'](socket);function respondWithRpcPromise(_0x50f4ba,_0x3b7df2,_0x7bdff6){return new BPromise(function(_0x2488a3,_0x439d4a){return client[_0x8e9e('0x10')](_0x50f4ba,_0x7bdff6)[_0x8e9e('0x11')](function(_0x808ec6){logger[_0x8e9e('0x12')](_0x8e9e('0x13'),_0x3b7df2,_0x8e9e('0x14'));logger[_0x8e9e('0x15')](_0x8e9e('0x16'),_0x3b7df2,_0x8e9e('0x14'),JSON[_0x8e9e('0x17')](_0x808ec6));if(_0x808ec6['error']){if(_0x808ec6[_0x8e9e('0x18')][_0x8e9e('0x19')]===0x1f4){logger[_0x8e9e('0x18')](_0x8e9e('0x13'),_0x3b7df2,_0x808ec6['error'][_0x8e9e('0x1a')]);return _0x439d4a(_0x808ec6['error'][_0x8e9e('0x1a')]);}logger[_0x8e9e('0x18')](_0x8e9e('0x13'),_0x3b7df2,_0x808ec6['error']['message']);return _0x2488a3(_0x808ec6[_0x8e9e('0x18')][_0x8e9e('0x1a')]);}else{logger['info'](_0x8e9e('0x13'),_0x3b7df2,_0x8e9e('0x14'));_0x2488a3(_0x808ec6[_0x8e9e('0x1b')][_0x8e9e('0x1a')]);}})['catch'](function(_0x2ed9e0){logger['error'](_0x8e9e('0x13'),_0x3b7df2,_0x2ed9e0);_0x439d4a(_0x2ed9e0);});});}exports[_0x8e9e('0x1c')]=function(_0x246b77){var _0x368805=this;return new Promise(function(_0x48ab67,_0x51f7a2){return db['FaxMessage'][_0x8e9e('0x1d')](_0x246b77[_0x8e9e('0x1e')],{'raw':_0x246b77[_0x8e9e('0x1f')]?_0x246b77[_0x8e9e('0x1f')][_0x8e9e('0x20')]===undefined?!![]:![]:!![]})[_0x8e9e('0x11')](function(_0x2cb0c1){logger[_0x8e9e('0x12')](_0x8e9e('0x1c'),_0x246b77);logger[_0x8e9e('0x15')](_0x8e9e('0x1c'),_0x246b77,JSON[_0x8e9e('0x17')](_0x2cb0c1));_0x48ab67(_0x2cb0c1);})[_0x8e9e('0x21')](function(_0x2060c8){logger[_0x8e9e('0x18')]('CreateFaxMessage',_0x2060c8[_0x8e9e('0x1a')],_0x246b77);_0x51f7a2(_0x368805['error'](0x1f4,_0x2060c8[_0x8e9e('0x1a')]));});});};exports[_0x8e9e('0x22')]=function(_0x38c361){var _0x40ad67=this;return new Promise(function(_0x465748,_0x326aff){return db[_0x8e9e('0x23')]['update'](_0x38c361[_0x8e9e('0x1e')],{'raw':_0x38c361[_0x8e9e('0x1f')]?_0x38c361[_0x8e9e('0x1f')][_0x8e9e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38c361[_0x8e9e('0x1f')]?_0x38c361['options'][_0x8e9e('0x24')]||null:null,'attributes':_0x38c361[_0x8e9e('0x1f')]?_0x38c361[_0x8e9e('0x1f')]['attributes']||null:null,'limit':_0x38c361[_0x8e9e('0x1f')]?_0x38c361[_0x8e9e('0x1f')]['limit']||null:null})[_0x8e9e('0x11')](function(_0xfb822e){logger[_0x8e9e('0x12')](_0x8e9e('0x22'),_0x38c361);logger[_0x8e9e('0x15')](_0x8e9e('0x22'),_0x38c361,JSON['stringify'](_0xfb822e));_0x465748(_0xfb822e);})[_0x8e9e('0x21')](function(_0x31ee40){logger[_0x8e9e('0x18')](_0x8e9e('0x22'),_0x31ee40[_0x8e9e('0x1a')],_0x38c361);_0x326aff(_0x40ad67[_0x8e9e('0x18')](0x1f4,_0x31ee40['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 973a453..f806ef6 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 _0x36aa=['emit','register','length','faxMessage:','./faxMessage.events','remove','update'];(function(_0x3852ce,_0x1017a6){var _0xfb8ef3=function(_0x128695){while(--_0x128695){_0x3852ce['push'](_0x3852ce['shift']());}};_0xfb8ef3(++_0x1017a6);}(_0x36aa,0x170));var _0xa36a=function(_0x4cc984,_0x28d876){_0x4cc984=_0x4cc984-0x0;var _0x2bce2e=_0x36aa[_0x4cc984];return _0x2bce2e;};'use strict';var FaxMessageEvents=require(_0xa36a('0x0'));var events=['save',_0xa36a('0x1'),_0xa36a('0x2')];function createListener(_0x3f0ffa,_0x258fef){return function(_0x56f880){_0x258fef[_0xa36a('0x3')](_0x3f0ffa,_0x56f880);};}function removeListener(_0x588aad,_0x4c039c){return function(){FaxMessageEvents['removeListener'](_0x588aad,_0x4c039c);};}exports[_0xa36a('0x4')]=function(_0x3712fc){for(var _0x59f262=0x0,_0x4b6625=events[_0xa36a('0x5')];_0x59f262<_0x4b6625;_0x59f262++){var _0x27fbfc=events[_0x59f262];var _0x577ec4=createListener(_0xa36a('0x6')+_0x27fbfc,_0x3712fc);FaxMessageEvents['on'](_0x27fbfc,_0x577ec4);}}; \ No newline at end of file +var _0xdcd0=['./faxMessage.events','remove','removeListener','length','faxMessage:'];(function(_0x1a0aa6,_0x5c14e9){var _0x1e974c=function(_0x590c51){while(--_0x590c51){_0x1a0aa6['push'](_0x1a0aa6['shift']());}};_0x1e974c(++_0x5c14e9);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x802a15,_0x348490){_0x802a15=_0x802a15-0x0;var _0x45901c=_0xdcd0[_0x802a15];return _0x45901c;};'use strict';var FaxMessageEvents=require(_0x0dcd('0x0'));var events=['save',_0x0dcd('0x1'),'update'];function createListener(_0x48e388,_0x429da0){return function(_0x15efc5){_0x429da0['emit'](_0x48e388,_0x15efc5);};}function removeListener(_0xa1c82b,_0x2d63b8){return function(){FaxMessageEvents[_0x0dcd('0x2')](_0xa1c82b,_0x2d63b8);};}exports['register']=function(_0xed46fb){for(var _0x440bdd=0x0,_0x19ac5a=events[_0x0dcd('0x3')];_0x440bdd<_0x19ac5a;_0x440bdd++){var _0x4f8f15=events[_0x440bdd];var _0x448421=createListener(_0x0dcd('0x4')+_0x4f8f15,_0xed46fb);FaxMessageEvents['on'](_0x4f8f15,_0x448421);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 94e40ab..078f535 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 _0x7880=['update','accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','download','post','tracked','faxmessage:create','create','put','/:id'];(function(_0x2f43a9,_0x28179a){var _0x20f22d=function(_0x460760){while(--_0x460760){_0x2f43a9['push'](_0x2f43a9['shift']());}};_0x20f22d(++_0x28179a);}(_0x7880,0x1f4));var _0x0788=function(_0x5c2e65,_0x20e630){_0x5c2e65=_0x5c2e65-0x0;var _0x445359=_0x7880[_0x5c2e65];return _0x445359;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0x8')]('/:id',auth[_0x0788('0x9')](),controller['show']);router[_0x0788('0x8')]('/:id/download',auth[_0x0788('0x9')](),controller[_0x0788('0xd')]);router[_0x0788('0xe')]('/',auth[_0x0788('0x9')](),interaction[_0x0788('0xf')]('fax',_0x0788('0x10')),controller[_0x0788('0x11')]);router[_0x0788('0x12')](_0x0788('0x13'),auth[_0x0788('0x9')](),controller[_0x0788('0x14')]);router[_0x0788('0x12')]('/:id/accept',auth[_0x0788('0x9')](),controller[_0x0788('0x15')]);router[_0x0788('0x12')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router['delete'](_0x0788('0x13'),auth[_0x0788('0x9')](),controller[_0x0788('0x18')]);module[_0x0788('0x19')]=router; \ No newline at end of file +var _0xfb11=['show','/:id/download','download','fax','create','put','update','accept','/:id/reject','reject','delete','multer','path','connect-timeout','Router','../../components/interaction/service','./faxMessage.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x1f99c6,_0x31cb6a){var _0x30031a=function(_0x2f1ec5){while(--_0x2f1ec5){_0x1f99c6['push'](_0x1f99c6['shift']());}};_0x30031a(++_0x31cb6a);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xfb11[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1fb1('0x4'));var config=require('../../config/environment');var controller=require(_0x1fb1('0x5'));router[_0x1fb1('0x6')]('/',auth['isAuthenticated'](),controller[_0x1fb1('0x7')]);router[_0x1fb1('0x6')]('/describe',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x9')]);router[_0x1fb1('0x6')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xb')]);router[_0x1fb1('0x6')](_0x1fb1('0xc'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0xd')]);router['post']('/',auth[_0x1fb1('0x8')](),interaction['tracked'](_0x1fb1('0xe'),'faxmessage:create'),controller[_0x1fb1('0xf')]);router[_0x1fb1('0x10')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x11')]);router[_0x1fb1('0x10')]('/:id/accept',auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x12')]);router[_0x1fb1('0x10')](_0x1fb1('0x13'),auth[_0x1fb1('0x8')](),controller[_0x1fb1('0x14')]);router[_0x1fb1('0x15')](_0x1fb1('0xa'),auth[_0x1fb1('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 6d0aaaf..a3c1076 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 _0xdd93=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x2354f1,_0xabfc06){var _0x2274ca=function(_0x94e694){while(--_0x94e694){_0x2354f1['push'](_0x2354f1['shift']());}};_0x2274ca(++_0xabfc06);}(_0xdd93,0x127));var _0x3dd9=function(_0x4b2c37,_0x209312){_0x4b2c37=_0x4b2c37-0x0;var _0x281cf2=_0xdd93[_0x4b2c37];return _0x281cf2;};'use strict';var Sequelize=require(_0x3dd9('0x0'));module[_0x3dd9('0x1')]={'name':{'type':Sequelize[_0x3dd9('0x2')],'unique':_0x3dd9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3dd9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3dd9('0x4')](_0x3dd9('0x5'),_0x3dd9('0x6'),_0x3dd9('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6874=['INTEGER','ENUM','roundrobin','exports','STRING'];(function(_0x46a50c,_0x3a7f4a){var _0x4274db=function(_0x213af1){while(--_0x213af1){_0x46a50c['push'](_0x46a50c['shift']());}};_0x4274db(++_0x3a7f4a);}(_0x6874,0x189));var _0x4687=function(_0x181167,_0x5a5269){_0x181167=_0x181167-0x0;var _0x10484f=_0x6874[_0x181167];return _0x10484f;};'use strict';var Sequelize=require('sequelize');module[_0x4687('0x0')]={'name':{'type':Sequelize[_0x4687('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4687('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4687('0x3')]('rrmemory','beepall',_0x4687('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4687('0x2')],'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 c3f070e..def8e77 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 _0x9685=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','register','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','stack','name','send','index','FaxQueue','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','userProfileId','autoAssociation','params','describe','UserFaxQueue','order','FaxQueueId','map','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','teams','User','flatMap','Agents','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','includes','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents'];(function(_0x272725,_0x50a84c){var _0x6622ae=function(_0x54d7da){while(--_0x54d7da){_0x272725['push'](_0x272725['shift']());}};_0x6622ae(++_0x50a84c);}(_0x9685,0x18c));var _0x5968=function(_0x36bf89,_0x3679ce){_0x36bf89=_0x36bf89-0x0;var _0x969757=_0x9685[_0x36bf89];return _0x969757;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5968('0x0'));var rimraf=require(_0x5968('0x1'));var zipdir=require(_0x5968('0x2'));var jsonpatch=require(_0x5968('0x3'));var rp=require('request-promise');var moment=require(_0x5968('0x4'));var BPromise=require(_0x5968('0x5'));var Mustache=require(_0x5968('0x6'));var util=require(_0x5968('0x7'));var path=require(_0x5968('0x8'));var sox=require(_0x5968('0x9'));var csv=require(_0x5968('0xa'));var ejs=require(_0x5968('0xb'));var fs=require('fs');var _=require(_0x5968('0xc'));var squel=require('squel');var crypto=require(_0x5968('0xd'));var jsforce=require(_0x5968('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5968('0xf'));var Papa=require('papaparse');var Redis=require(_0x5968('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5968('0x11'));var hardwareService=require(_0x5968('0x12'));var logger=require(_0x5968('0x13'))(_0x5968('0x14'));var utils=require(_0x5968('0x15'));var config=require('../../config/environment');var db=require(_0x5968('0x16'))['db'];config[_0x5968('0x17')]=_[_0x5968('0x18')](config[_0x5968('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5968('0x17')]));require('./faxQueue.socket')[_0x5968('0x19')](socket);function respondWithStatusCode(_0x17f526,_0x1bbd50){_0x1bbd50=_0x1bbd50||0xcc;return function(_0x32329b){if(_0x32329b){return _0x17f526[_0x5968('0x1a')](_0x1bbd50);}return _0x17f526[_0x5968('0x1b')](_0x1bbd50)['end']();};}function respondWithResult(_0x434d18,_0xd37fa7){_0xd37fa7=_0xd37fa7||0xc8;return function(_0x890989){if(_0x890989){return _0x434d18[_0x5968('0x1b')](_0xd37fa7)['json'](_0x890989);}};}function respondWithFilteredResult(_0x4c6cd0,_0x58754b){return function(_0x23e3d5){if(_0x23e3d5){var _0x3a9686=_0x23e3d5[_0x5968('0x1c')],_0x401274=_0x58754b['offset'],_0x58f1d8=_0x58754b[_0x5968('0x1d')]+_0x58754b[_0x5968('0x1e')],_0x532365;if(_0x58f1d8>=_0x3a9686){_0x58f1d8=_0x3a9686;_0x532365=0xc8;}else{_0x532365=0xce;}_0x4c6cd0[_0x5968('0x1b')](_0x532365);return _0x4c6cd0[_0x5968('0x1f')](_0x5968('0x20'),_0x401274+'-'+_0x58f1d8+'/'+_0x3a9686)['json'](_0x23e3d5);}return null;};}function patchUpdates(_0x4965ad){return function(_0x4c907a){try{jsonpatch[_0x5968('0x21')](_0x4c907a,_0x4965ad,!![]);}catch(_0x33d7e5){return BPromise[_0x5968('0x22')](_0x33d7e5);}return _0x4c907a[_0x5968('0x23')]();};}function saveUpdates(_0x1e8e07,_0x5ada15){return function(_0xc5e6b2){if(_0xc5e6b2){return _0xc5e6b2[_0x5968('0x24')](_0x1e8e07)[_0x5968('0x25')](function(_0x9c091b){return _0x9c091b;});}return null;};}function removeEntity(_0x2b9d2d,_0x26d5ff){return function(_0x191633){if(_0x191633){return _0x191633[_0x5968('0x26')]()[_0x5968('0x25')](function(){var _0x3a2b04=_0x191633[_0x5968('0x27')]({'plain':!![]});var _0x7c6f33=_0x5968('0x28');return db[_0x5968('0x29')][_0x5968('0x26')]({'where':{'type':_0x7c6f33,'resourceId':_0x3a2b04['id']}})['then'](function(){return _0x191633;});})[_0x5968('0x25')](function(){_0x2b9d2d[_0x5968('0x1b')](0xcc)[_0x5968('0x2a')]();});}};}function handleEntityNotFound(_0xd7f972,_0x308844){return function(_0x596996){if(!_0x596996){_0xd7f972[_0x5968('0x1a')](0x194);}return _0x596996;};}function handleError(_0x5e9cce,_0x314314){_0x314314=_0x314314||0x1f4;return function(_0x310c45){logger['error'](_0x310c45[_0x5968('0x2b')]);if(_0x310c45['name']){delete _0x310c45[_0x5968('0x2c')];}_0x5e9cce[_0x5968('0x1b')](_0x314314)[_0x5968('0x2d')](_0x310c45);};}exports[_0x5968('0x2e')]=function(_0x1b291e,_0x318d11){var _0x49c63a={},_0x3a7bde={},_0x3011db={'count':0x0,'rows':[]};var _0x2a8677=db[_0x5968('0x2f')][_0x5968('0x30')];_0x3a7bde[_0x5968('0x31')]=_[_0x5968('0x32')](_0x2a8677);_0x3a7bde['query']=_[_0x5968('0x32')](_0x1b291e['query']);_0x3a7bde[_0x5968('0x33')]=_[_0x5968('0x34')](_0x3a7bde[_0x5968('0x31')],_0x3a7bde[_0x5968('0x35')]);_0x49c63a[_0x5968('0x36')]=_['intersection'](_0x3a7bde['model'],qs['fields'](_0x1b291e['query'][_0x5968('0x37')]));_0x49c63a[_0x5968('0x36')]=_0x49c63a[_0x5968('0x36')][_0x5968('0x38')]?_0x49c63a[_0x5968('0x36')]:_0x3a7bde['model'];if(!_0x1b291e['query'][_0x5968('0x39')](_0x5968('0x3a'))){_0x49c63a['limit']=qs[_0x5968('0x1e')](_0x1b291e[_0x5968('0x35')][_0x5968('0x1e')]);_0x49c63a[_0x5968('0x1d')]=qs[_0x5968('0x1d')](_0x1b291e[_0x5968('0x35')][_0x5968('0x1d')]);}_0x49c63a['order']=qs['sort'](_0x1b291e['query'][_0x5968('0x3b')]);_0x49c63a[_0x5968('0x3c')]=qs[_0x5968('0x33')](_[_0x5968('0x3d')](_0x1b291e['query'],_0x3a7bde[_0x5968('0x33')]));if(_0x1b291e[_0x5968('0x35')][_0x5968('0x3e')]){_0x49c63a[_0x5968('0x3c')]=_[_0x5968('0x3f')](_0x49c63a['where'],{'$or':_['map'](_0x2a8677,function(_0x330a2d){if(_0x330a2d[_0x5968('0x40')][_0x5968('0x41')]!==_0x5968('0x42')){var _0x317fc2={};_0x317fc2[_0x330a2d[_0x5968('0x43')]]={'$like':'%'+_0x1b291e[_0x5968('0x35')][_0x5968('0x3e')]+'%'};return _0x317fc2;}})});}_0x49c63a=_['merge']({},_0x49c63a,_0x1b291e[_0x5968('0x44')]);var _0x58c74c={'where':_0x49c63a[_0x5968('0x3c')]};return db[_0x5968('0x2f')][_0x5968('0x1c')](_0x58c74c)['then'](function(_0x37084e){_0x3011db[_0x5968('0x1c')]=_0x37084e;if(_0x1b291e[_0x5968('0x35')][_0x5968('0x45')]){_0x49c63a['include']=[{'all':!![]}];}return db[_0x5968('0x2f')][_0x5968('0x46')](_0x49c63a);})[_0x5968('0x25')](function(_0x106f17){_0x3011db[_0x5968('0x47')]=_0x106f17;return _0x3011db;})[_0x5968('0x25')](respondWithFilteredResult(_0x318d11,_0x49c63a))[_0x5968('0x48')](handleError(_0x318d11,null));};exports[_0x5968('0x49')]=function(_0x30b75c,_0x4a950f){var _0x4f1c8f={'raw':!![],'where':{'id':_0x30b75c['params']['id']}},_0x3e5d92={};_0x3e5d92[_0x5968('0x31')]=_[_0x5968('0x32')](db['FaxQueue'][_0x5968('0x30')]);_0x3e5d92['query']=_[_0x5968('0x32')](_0x30b75c[_0x5968('0x35')]);_0x3e5d92[_0x5968('0x33')]=_[_0x5968('0x34')](_0x3e5d92[_0x5968('0x31')],_0x3e5d92['query']);_0x4f1c8f[_0x5968('0x36')]=_[_0x5968('0x34')](_0x3e5d92[_0x5968('0x31')],qs[_0x5968('0x37')](_0x30b75c[_0x5968('0x35')][_0x5968('0x37')]));_0x4f1c8f['attributes']=_0x4f1c8f[_0x5968('0x36')][_0x5968('0x38')]?_0x4f1c8f[_0x5968('0x36')]:_0x3e5d92[_0x5968('0x31')];if(_0x30b75c['query'][_0x5968('0x45')]){_0x4f1c8f[_0x5968('0x4a')]=[{'all':!![]}];}_0x4f1c8f=_[_0x5968('0x3f')]({},_0x4f1c8f,_0x30b75c[_0x5968('0x44')]);return db[_0x5968('0x2f')][_0x5968('0x4b')](_0x4f1c8f)['then'](handleEntityNotFound(_0x4a950f,null))[_0x5968('0x25')](respondWithResult(_0x4a950f,null))[_0x5968('0x48')](handleError(_0x4a950f,null));};exports[_0x5968('0x4c')]=function(_0x1f52b4,_0x3e81a7){return db['FaxQueue'][_0x5968('0x4c')](_0x1f52b4[_0x5968('0x4d')],{})['then'](function(_0x273fee){var _0x2090c2=_0x1f52b4['user'][_0x5968('0x27')]({'plain':!![]});if(!_0x2090c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2090c2['role']==='user'){var _0x5e039a=_0x273fee[_0x5968('0x27')]({'plain':!![]});var _0x2dc377=_0x5968('0x28');return db['UserProfileSection'][_0x5968('0x4b')]({'where':{'name':_0x2dc377,'userProfileId':_0x2090c2[_0x5968('0x4e')]},'raw':!![]})['then'](function(_0x46d576){if(_0x46d576&&_0x46d576[_0x5968('0x4f')]===0x0){return db['UserProfileResource'][_0x5968('0x4c')]({'name':_0x5e039a[_0x5968('0x2c')],'resourceId':_0x5e039a['id'],'type':_0x46d576[_0x5968('0x2c')],'sectionId':_0x46d576['id']},{})[_0x5968('0x25')](function(){return _0x273fee;});}else{return _0x273fee;}})[_0x5968('0x48')](function(_0x3dd4ba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dd4ba);throw _0x3dd4ba;});}return _0x273fee;})[_0x5968('0x25')](respondWithResult(_0x3e81a7,0xc9))[_0x5968('0x48')](handleError(_0x3e81a7,null));};exports['update']=function(_0x28dd27,_0x5f0446){if(_0x28dd27[_0x5968('0x4d')]['id']){delete _0x28dd27[_0x5968('0x4d')]['id'];}return db[_0x5968('0x2f')][_0x5968('0x4b')]({'where':{'id':_0x28dd27[_0x5968('0x50')]['id']}})[_0x5968('0x25')](handleEntityNotFound(_0x5f0446,null))[_0x5968('0x25')](saveUpdates(_0x28dd27[_0x5968('0x4d')],null))[_0x5968('0x25')](respondWithResult(_0x5f0446,null))[_0x5968('0x48')](handleError(_0x5f0446,null));};exports[_0x5968('0x26')]=function(_0x4124e7,_0x5991c3){return db[_0x5968('0x2f')]['find']({'where':{'id':_0x4124e7[_0x5968('0x50')]['id']}})[_0x5968('0x25')](handleEntityNotFound(_0x5991c3,null))[_0x5968('0x25')](removeEntity(_0x5991c3,null))[_0x5968('0x48')](handleError(_0x5991c3,null));};exports[_0x5968('0x51')]=function(_0x49e579,_0x478717){return db['FaxQueue']['describe']()[_0x5968('0x25')](respondWithResult(_0x478717,null))['catch'](handleError(_0x478717,null));};exports['getMembers']=function(_0xa762a3,_0x3c2a22,_0x66930a){var _0x42e042={'raw':!![],'where':{}},_0x2673fa={},_0x267738;return db[_0x5968('0x2f')]['findOne']({'where':{'id':_0xa762a3[_0x5968('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c2a22,null))[_0x5968('0x25')](function(_0x4f30cb){if(_0x4f30cb){_0x267738=_0x4f30cb[_0x5968('0x27')]({'plain':!![]});_0x2673fa[_0x5968('0x31')]=_[_0x5968('0x32')](db[_0x5968('0x52')][_0x5968('0x30')]);_0x2673fa[_0x5968('0x35')]=_[_0x5968('0x32')](_0xa762a3['query']);_0x2673fa[_0x5968('0x33')]=_[_0x5968('0x34')](_0x2673fa[_0x5968('0x31')],_0x2673fa[_0x5968('0x35')]);_0x42e042[_0x5968('0x36')]=_[_0x5968('0x34')](_0x2673fa[_0x5968('0x31')],qs[_0x5968('0x37')](_0xa762a3[_0x5968('0x35')]['fields']));_0x42e042[_0x5968('0x36')]=_0x42e042[_0x5968('0x36')]['length']?_0x42e042['attributes']:_0x2673fa['model'];if(!_0xa762a3[_0x5968('0x35')][_0x5968('0x39')](_0x5968('0x3a'))){_0x42e042[_0x5968('0x1e')]=qs[_0x5968('0x1e')](_0xa762a3[_0x5968('0x35')][_0x5968('0x1e')]);_0x42e042['offset']=qs[_0x5968('0x1d')](_0xa762a3[_0x5968('0x35')][_0x5968('0x1d')]);}_0x42e042[_0x5968('0x53')]=qs[_0x5968('0x3b')](_0xa762a3['query'][_0x5968('0x3b')]);_0x42e042[_0x5968('0x3c')]=qs[_0x5968('0x33')](_[_0x5968('0x3d')](_0xa762a3[_0x5968('0x35')],_0x2673fa[_0x5968('0x33')]));_0x42e042[_0x5968('0x3c')][_0x5968('0x54')]=_0x4f30cb['id'];if(_0xa762a3[_0x5968('0x35')][_0x5968('0x3e')]){_0x42e042['where']=_[_0x5968('0x3f')](_0x42e042['where'],{'$or':_[_0x5968('0x55')](_0x42e042[_0x5968('0x36')],function(_0x4c8048){var _0x530891={};_0x530891[_0x4c8048]={'$like':'%'+_0xa762a3[_0x5968('0x35')]['filter']+'%'};return _0x530891;})});}_0x42e042=_[_0x5968('0x3f')]({},_0x42e042,_0xa762a3[_0x5968('0x44')]);return db[_0x5968('0x52')][_0x5968('0x46')](_0x42e042);}})[_0x5968('0x25')](function(_0x3a722d){if(_0x3a722d){return db['User'][_0x5968('0x56')]({'where':{'id':_['map'](_0x3a722d,_0x5968('0x57')),'role':'agent'},'attributes':['id',_0x5968('0x2c'),_0x5968('0x58'),_0x5968('0x59'),_0x5968('0x5a')]});}})[_0x5968('0x25')](function(_0x38d9ff){if(_0x38d9ff){return{'count':_0x38d9ff[_0x5968('0x1c')],'rows':_[_0x5968('0x55')](_0x38d9ff['rows'],function(_0x5f35a0){return{'membername':_0x5f35a0[_0x5968('0x2c')],'UserId':_0x5f35a0['id'],'queue_name':_0x267738[_0x5968('0x2c')],'FaxQueueId':_0x267738['id'],'interface':util[_0x5968('0x5b')](_0x5968('0x5c'),_0x5968('0x5d'),_0x5f35a0[_0x5968('0x2c')]),'penalty':0x0,'paused':_0x5f35a0[_0x5968('0x58')],'createdAt':_0x5f35a0[_0x5968('0x5a')],'updatedAt':_0x5f35a0[_0x5968('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5968('0x25')](respondWithFilteredResult(_0x3c2a22,_0x42e042))['catch'](handleError(_0x3c2a22,null));};exports['getTeams']=function(_0x535482,_0x252b99,_0x2c861d){var _0x4fb036={};var _0x1b8b84={};var _0x4e0dd7;var _0x804e6e;return db['FaxQueue'][_0x5968('0x5e')]({'where':{'id':_0x535482['params']['id']}})[_0x5968('0x25')](handleEntityNotFound(_0x252b99,null))[_0x5968('0x25')](function(_0x59d42e){if(_0x59d42e){_0x4e0dd7=_0x59d42e;_0x1b8b84['model']=_[_0x5968('0x32')](db[_0x5968('0x5f')][_0x5968('0x30')]);_0x1b8b84[_0x5968('0x35')]=_[_0x5968('0x32')](_0x535482['query']);_0x1b8b84['filters']=_[_0x5968('0x34')](_0x1b8b84['model'],_0x1b8b84['query']);_0x4fb036['attributes']=_['intersection'](_0x1b8b84[_0x5968('0x31')],qs[_0x5968('0x37')](_0x535482[_0x5968('0x35')]['fields']));_0x4fb036['attributes']=_0x4fb036['attributes'][_0x5968('0x38')]?_0x4fb036[_0x5968('0x36')]:_0x1b8b84['model'];_0x4fb036[_0x5968('0x53')]=qs[_0x5968('0x3b')](_0x535482[_0x5968('0x35')][_0x5968('0x3b')]);_0x4fb036[_0x5968('0x3c')]=qs[_0x5968('0x33')](_[_0x5968('0x3d')](_0x535482[_0x5968('0x35')],_0x1b8b84[_0x5968('0x33')]));if(_0x535482['query']['filter']){_0x4fb036[_0x5968('0x3c')]=_['merge'](_0x4fb036[_0x5968('0x3c')],{'$or':_[_0x5968('0x55')](_0x4fb036['attributes'],function(_0x405ca1){var _0x3847cb={};_0x3847cb[_0x405ca1]={'$like':'%'+_0x535482[_0x5968('0x35')]['filter']+'%'};return _0x3847cb;})});}_0x4fb036=_[_0x5968('0x3f')]({},_0x4fb036,_0x535482[_0x5968('0x44')]);return _0x4e0dd7['getTeams'](_0x4fb036);}})[_0x5968('0x25')](function(_0x5b0797){if(_0x5b0797){_0x804e6e=_0x5b0797[_0x5968('0x38')];if(!_0x535482[_0x5968('0x35')]['hasOwnProperty'](_0x5968('0x3a'))){_0x4fb036[_0x5968('0x1e')]=qs[_0x5968('0x1e')](_0x535482['query'][_0x5968('0x1e')]);_0x4fb036[_0x5968('0x1d')]=qs[_0x5968('0x1d')](_0x535482[_0x5968('0x35')]['offset']);}return _0x4e0dd7[_0x5968('0x60')](_0x4fb036);}})['then'](function(_0x142cf7){if(_0x142cf7){return _0x142cf7?{'count':_0x804e6e,'rows':_0x142cf7}:null;}})[_0x5968('0x25')](respondWithResult(_0x252b99,null))['catch'](handleError(_0x252b99,null));};exports[_0x5968('0x61')]=function(_0x1d8186,_0x4cb6b6,_0xbf5a49){var _0xf503bb=_0x1d8186['body'][_0x5968('0x62')];return db['Team'][_0x5968('0x46')]({'where':{'id':_[_0x5968('0x55')](_0xf503bb,'id')},'attributes':['id'],'include':[{'model':db[_0x5968('0x63')],'as':'Agents','attributes':['id',_0x5968('0x2c'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x34a916){if(_0x34a916){var _0x113762=_[_0x5968('0x64')](_0x34a916,function(_0x2d02c4){var _0xb766e8=_0x2d02c4['get']({'plain':!![]});return _0xb766e8[_0x5968('0x65')];});return db[_0x5968('0x2f')]['find']({'where':{'id':_0x1d8186[_0x5968('0x50')]['id']}})[_0x5968('0x25')](function(_0x27be25){return db['sequelize'][_0x5968('0x66')](function(_0x4efb02){return _0x27be25[_0x5968('0x61')](_[_0x5968('0x55')](_0xf503bb,'id'),{'transaction':_0x4efb02})[_0x5968('0x25')](function(){return BPromise[_0x5968('0x67')](_0x113762,function(_0x4cef44){return db['UserFaxQueue'][_0x5968('0x68')]({'where':{'UserId':_0x4cef44['id'],'FaxQueueId':_0x1d8186['params']['id']},'transaction':_0x4efb02});});})[_0x5968('0x25')](function(){_0x113762[_0x5968('0x69')](function(_0x51e304){socket['emit'](_0x5968('0x6a'),{'UserId':_0x51e304['id'],'FaxQueueId':_0x27be25['id']});});});});});}})[_0x5968('0x25')](respondWithStatusCode(_0x4cb6b6,null))[_0x5968('0x48')](handleError(_0x4cb6b6,null));};exports[_0x5968('0x6b')]=function(_0x22b12f,_0x5eb620,_0x28f9c5){return db[_0x5968('0x5f')]['findAll']({'where':{'id':_0x22b12f[_0x5968('0x35')][_0x5968('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x5968('0x63')],'as':_0x5968('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5eb620,null))[_0x5968('0x25')](function(_0x28e6e4){var _0x399aae=_[_0x5968('0x55')](_0x28e6e4,'id');var _0x456567=[];var _0x292e5d=[];var _0x12411b=squel[_0x5968('0x6d')]();_0x12411b[_0x5968('0x43')](_0x5968('0x6e'))[_0x5968('0x6f')](_0x5968('0x70'),'tq')[_0x5968('0x71')](_0x5968('0x72'),'ut',_0x5968('0x73'))['where'](_0x5968('0x74'),_0x22b12f[_0x5968('0x50')]['id']);for(var _0x4785d5=0x0;_0x4785d5<_0x28e6e4[_0x5968('0x38')];_0x4785d5+=0x1){let _0x53391b=_0x28e6e4[_0x4785d5];for(var _0x24c136=0x0;_0x24c136<_0x53391b['Agents']['length'];_0x24c136+=0x1){let _0x16bbd0=_0x53391b['Agents'][_0x24c136];var _0x200bd6=_0x12411b[_0x5968('0x75')]();_0x200bd6['where']('ut.UserId\x20=\x20?',_0x16bbd0['id']);_0x292e5d[_0x5968('0x76')](db['sequelize'][_0x5968('0x35')](_0x200bd6[_0x5968('0x77')](),{'type':db[_0x5968('0x78')][_0x5968('0x79')]['SELECT']})[_0x5968('0x25')](function(_0x2dc78b){if(_0x2dc78b[_0x5968('0x38')]===0x1){return _0x16bbd0['id'];}else{var _0x2a051b=_['every'](_[_0x5968('0x55')](_0x2dc78b,'TeamId'),function(_0x5ed81a){return _[_0x5968('0x7a')](_0x399aae,_0x5ed81a);});if(_0x2a051b){return _0x16bbd0['id'];}}}));}}return BPromise['all'](_0x292e5d)[_0x5968('0x25')](function(_0x568510){_0x456567=_(_0x456567)['union'](_0x568510)['compact']()['value']();return db[_0x5968('0x2f')][_0x5968('0x4b')]({'where':{'id':_0x22b12f[_0x5968('0x50')]['id']}})[_0x5968('0x25')](function(_0x4fd3f0){return db[_0x5968('0x78')]['transaction'](function(_0x54a22f){return _0x4fd3f0[_0x5968('0x6b')](_0x22b12f[_0x5968('0x35')][_0x5968('0x6c')],{'transaction':_0x54a22f})[_0x5968('0x25')](function(){if(!_[_0x5968('0x7b')](_0x456567)){return _0x4fd3f0[_0x5968('0x7c')](_0x456567,{'transaction':_0x54a22f});}})[_0x5968('0x25')](function(){_0x456567[_0x5968('0x69')](function(_0x2d360e){socket[_0x5968('0x7d')](_0x5968('0x7e'),{'UserId':_0x2d360e,'FaxQueueId':_0x4fd3f0['id']});});});});});});})[_0x5968('0x25')](respondWithStatusCode(_0x5eb620,null))[_0x5968('0x48')](handleError(_0x5eb620,null));};exports[_0x5968('0x7f')]=function(_0x1afad3,_0x5bdb9b,_0x11c27e){return db['FaxQueue'][_0x5968('0x4b')]({'where':{'id':_0x1afad3[_0x5968('0x50')]['id']}})['then'](handleEntityNotFound(_0x5bdb9b,null))['then'](function(_0x46e9b2){if(_0x46e9b2){return _0x46e9b2['addAgents'](_0x1afad3[_0x5968('0x4d')][_0x5968('0x6c')],_[_0x5968('0x80')](_0x1afad3[_0x5968('0x4d')],[_0x5968('0x6c'),'id'])||{})[_0x5968('0x81')](function(_0x1bf20e){for(var _0x4f53c6=0x0;_0x4f53c6<_0x1afad3['body'][_0x5968('0x6c')][_0x5968('0x38')];_0x4f53c6+=0x1){socket['emit'](_0x5968('0x6a'),{'UserId':_0x1afad3['body']['ids'][_0x4f53c6],'FaxQueueId':_0x1afad3[_0x5968('0x50')]['id']});}return _0x1bf20e;});}})[_0x5968('0x25')](respondWithResult(_0x5bdb9b,null))['catch'](handleError(_0x5bdb9b,null));};exports[_0x5968('0x7c')]=function(_0x5bbe96,_0x393eab,_0x1cf1eb){return db['FaxQueue'][_0x5968('0x4b')]({'where':{'id':_0x5bbe96[_0x5968('0x50')]['id']}})[_0x5968('0x25')](handleEntityNotFound(_0x393eab,null))['then'](function(_0x1d46ab){if(_0x1d46ab){return _0x1d46ab['removeAgents'](_0x5bbe96[_0x5968('0x35')][_0x5968('0x6c')])[_0x5968('0x25')](function(){if(_[_0x5968('0x82')](_0x5bbe96[_0x5968('0x35')]['ids'])){for(var _0x4b754a=0x0;_0x4b754a<_0x5bbe96[_0x5968('0x35')]['ids'][_0x5968('0x38')];_0x4b754a+=0x1){socket[_0x5968('0x7d')](_0x5968('0x7e'),{'UserId':Number(_0x5bbe96['query'][_0x5968('0x6c')][_0x4b754a]),'FaxQueueId':Number(_0x5bbe96[_0x5968('0x50')]['id'])});}}else{socket['emit'](_0x5968('0x7e'),{'UserId':Number(_0x5bbe96[_0x5968('0x35')][_0x5968('0x6c')]),'FaxQueueId':Number(_0x5bbe96[_0x5968('0x50')]['id'])});}});}})[_0x5968('0x25')](respondWithStatusCode(_0x393eab,null))[_0x5968('0x48')](handleError(_0x393eab,null));};exports[_0x5968('0x83')]=function(_0x5a675a,_0xe0ab8d,_0x2fa722){var _0x4fa908={};var _0x5b306a={};var _0x4d476b;var _0x162eaa;return db[_0x5968('0x2f')]['findOne']({'where':{'id':_0x5a675a['params']['id']}})['then'](handleEntityNotFound(_0xe0ab8d,null))[_0x5968('0x25')](function(_0x4704a3){if(_0x4704a3){_0x4d476b=_0x4704a3;_0x5b306a['model']=_[_0x5968('0x32')](db[_0x5968('0x63')]['rawAttributes']);_0x5b306a['query']=_[_0x5968('0x32')](_0x5a675a[_0x5968('0x35')]);_0x5b306a[_0x5968('0x33')]=_[_0x5968('0x34')](_0x5b306a[_0x5968('0x31')],_0x5b306a[_0x5968('0x35')]);_0x4fa908[_0x5968('0x36')]=_['intersection'](_0x5b306a[_0x5968('0x31')],qs[_0x5968('0x37')](_0x5a675a[_0x5968('0x35')][_0x5968('0x37')]));_0x4fa908[_0x5968('0x36')]=_0x4fa908[_0x5968('0x36')]['length']?_0x4fa908[_0x5968('0x36')]:_0x5b306a[_0x5968('0x31')];_0x4fa908[_0x5968('0x53')]=qs[_0x5968('0x3b')](_0x5a675a['query'][_0x5968('0x3b')]);_0x4fa908[_0x5968('0x3c')]=qs['filters'](_[_0x5968('0x3d')](_0x5a675a[_0x5968('0x35')],_0x5b306a[_0x5968('0x33')]));if(_0x5a675a[_0x5968('0x35')][_0x5968('0x3e')]){_0x4fa908[_0x5968('0x3c')]=_['merge'](_0x4fa908[_0x5968('0x3c')],{'$or':_[_0x5968('0x55')](_0x4fa908[_0x5968('0x36')],function(_0x415b4c){var _0x41f6db={};_0x41f6db[_0x415b4c]={'$like':'%'+_0x5a675a[_0x5968('0x35')][_0x5968('0x3e')]+'%'};return _0x41f6db;})});}_0x4fa908=_[_0x5968('0x3f')]({},_0x4fa908,_0x5a675a['options']);return _0x4d476b[_0x5968('0x83')](_0x4fa908);}})['then'](function(_0x2ee6e1){if(_0x2ee6e1){_0x162eaa=_0x2ee6e1[_0x5968('0x38')];if(!_0x5a675a[_0x5968('0x35')][_0x5968('0x39')]('nolimit')){_0x4fa908['limit']=qs['limit'](_0x5a675a[_0x5968('0x35')][_0x5968('0x1e')]);_0x4fa908[_0x5968('0x1d')]=qs[_0x5968('0x1d')](_0x5a675a[_0x5968('0x35')][_0x5968('0x1d')]);}return _0x4d476b[_0x5968('0x83')](_0x4fa908);}})[_0x5968('0x25')](function(_0x174caf){if(_0x174caf){return _0x174caf?{'count':_0x162eaa,'rows':_0x174caf}:null;}})['then'](respondWithResult(_0xe0ab8d,null))[_0x5968('0x48')](handleError(_0xe0ab8d,null));}; \ No newline at end of file +var _0x9276=['ejs','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','teams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','value','ids','removeAgents','emit','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x30f45,_0x5ae903){var _0x178aa5=function(_0xca1d44){while(--_0xca1d44){_0x30f45['push'](_0x30f45['shift']());}};_0x178aa5(++_0x5ae903);}(_0x9276,0x7e));var _0x6927=function(_0x2ccbdf,_0x2349ca){_0x2ccbdf=_0x2ccbdf-0x0;var _0xc44a03=_0x9276[_0x2ccbdf];return _0xc44a03;};'use strict';var pdf=require(_0x6927('0x0'));var emlformat=require(_0x6927('0x1'));var rimraf=require(_0x6927('0x2'));var zipdir=require(_0x6927('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6927('0x4'));var moment=require(_0x6927('0x5'));var BPromise=require(_0x6927('0x6'));var Mustache=require(_0x6927('0x7'));var util=require(_0x6927('0x8'));var path=require(_0x6927('0x9'));var sox=require(_0x6927('0xa'));var csv=require(_0x6927('0xb'));var ejs=require(_0x6927('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6927('0xd'));var crypto=require('crypto');var jsforce=require(_0x6927('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6927('0xb'));var querystring=require(_0x6927('0xf'));var Papa=require('papaparse');var Redis=require(_0x6927('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6927('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6927('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6927('0x13'));var db=require('../../mysqldb')['db'];config[_0x6927('0x14')]=_[_0x6927('0x15')](config['redis'],{'host':_0x6927('0x16'),'port':0x18eb});var socket=require(_0x6927('0x17'))(new Redis(config[_0x6927('0x14')]));require(_0x6927('0x18'))[_0x6927('0x19')](socket);function respondWithStatusCode(_0x45887e,_0x100552){_0x100552=_0x100552||0xcc;return function(_0x175ed2){if(_0x175ed2){return _0x45887e[_0x6927('0x1a')](_0x100552);}return _0x45887e['status'](_0x100552)[_0x6927('0x1b')]();};}function respondWithResult(_0x4c9843,_0x475fff){_0x475fff=_0x475fff||0xc8;return function(_0x468d00){if(_0x468d00){return _0x4c9843['status'](_0x475fff)[_0x6927('0x1c')](_0x468d00);}};}function respondWithFilteredResult(_0x3b8b30,_0x26de85){return function(_0x3708ad){if(_0x3708ad){var _0x9b011b=_0x3708ad[_0x6927('0x1d')],_0x445101=_0x26de85[_0x6927('0x1e')],_0x2d18d0=_0x26de85['offset']+_0x26de85[_0x6927('0x1f')],_0x5d4f8a;if(_0x2d18d0>=_0x9b011b){_0x2d18d0=_0x9b011b;_0x5d4f8a=0xc8;}else{_0x5d4f8a=0xce;}_0x3b8b30[_0x6927('0x20')](_0x5d4f8a);return _0x3b8b30[_0x6927('0x21')](_0x6927('0x22'),_0x445101+'-'+_0x2d18d0+'/'+_0x9b011b)['json'](_0x3708ad);}return null;};}function patchUpdates(_0x54ac42){return function(_0x27e79c){try{jsonpatch['apply'](_0x27e79c,_0x54ac42,!![]);}catch(_0x854a72){return BPromise[_0x6927('0x23')](_0x854a72);}return _0x27e79c[_0x6927('0x24')]();};}function saveUpdates(_0x51542f,_0x1ee8cb){return function(_0x53e984){if(_0x53e984){return _0x53e984[_0x6927('0x25')](_0x51542f)[_0x6927('0x26')](function(_0x1d985b){return _0x1d985b;});}return null;};}function removeEntity(_0x2f9060,_0x32ffc1){return function(_0x20a492){if(_0x20a492){return _0x20a492[_0x6927('0x27')]()[_0x6927('0x26')](function(){var _0x4a6d7f=_0x20a492[_0x6927('0x28')]({'plain':!![]});var _0x2de1e6=_0x6927('0x29');return db[_0x6927('0x2a')][_0x6927('0x27')]({'where':{'type':_0x2de1e6,'resourceId':_0x4a6d7f['id']}})['then'](function(){return _0x20a492;});})[_0x6927('0x26')](function(){_0x2f9060[_0x6927('0x20')](0xcc)[_0x6927('0x1b')]();});}};}function handleEntityNotFound(_0x2984d5,_0x62f50b){return function(_0x4ae17e){if(!_0x4ae17e){_0x2984d5[_0x6927('0x1a')](0x194);}return _0x4ae17e;};}function handleError(_0x3805ae,_0x782eb9){_0x782eb9=_0x782eb9||0x1f4;return function(_0xa041c8){logger[_0x6927('0x2b')](_0xa041c8[_0x6927('0x2c')]);if(_0xa041c8[_0x6927('0x2d')]){delete _0xa041c8[_0x6927('0x2d')];}_0x3805ae[_0x6927('0x20')](_0x782eb9)[_0x6927('0x2e')](_0xa041c8);};}exports[_0x6927('0x2f')]=function(_0x1bc7e1,_0xaad05b){var _0x557013={},_0x3da0bc={},_0x43cbd4={'count':0x0,'rows':[]};var _0x456e49=db[_0x6927('0x30')][_0x6927('0x31')];_0x3da0bc[_0x6927('0x32')]=_[_0x6927('0x33')](_0x456e49);_0x3da0bc['query']=_[_0x6927('0x33')](_0x1bc7e1['query']);_0x3da0bc['filters']=_[_0x6927('0x34')](_0x3da0bc['model'],_0x3da0bc['query']);_0x557013[_0x6927('0x35')]=_[_0x6927('0x34')](_0x3da0bc[_0x6927('0x32')],qs[_0x6927('0x36')](_0x1bc7e1['query']['fields']));_0x557013[_0x6927('0x35')]=_0x557013[_0x6927('0x35')][_0x6927('0x37')]?_0x557013[_0x6927('0x35')]:_0x3da0bc['model'];if(!_0x1bc7e1[_0x6927('0x38')][_0x6927('0x39')](_0x6927('0x3a'))){_0x557013[_0x6927('0x1f')]=qs['limit'](_0x1bc7e1[_0x6927('0x38')][_0x6927('0x1f')]);_0x557013['offset']=qs[_0x6927('0x1e')](_0x1bc7e1[_0x6927('0x38')][_0x6927('0x1e')]);}_0x557013[_0x6927('0x3b')]=qs[_0x6927('0x3c')](_0x1bc7e1[_0x6927('0x38')]['sort']);_0x557013[_0x6927('0x3d')]=qs[_0x6927('0x3e')](_[_0x6927('0x3f')](_0x1bc7e1['query'],_0x3da0bc[_0x6927('0x3e')]));if(_0x1bc7e1[_0x6927('0x38')][_0x6927('0x40')]){_0x557013[_0x6927('0x3d')]=_[_0x6927('0x41')](_0x557013['where'],{'$or':_[_0x6927('0x42')](_0x456e49,function(_0x1e0a2f){if(_0x1e0a2f[_0x6927('0x43')][_0x6927('0x44')]!=='VIRTUAL'){var _0x38fd16={};_0x38fd16[_0x1e0a2f['field']]={'$like':'%'+_0x1bc7e1['query'][_0x6927('0x40')]+'%'};return _0x38fd16;}})});}_0x557013=_[_0x6927('0x41')]({},_0x557013,_0x1bc7e1[_0x6927('0x45')]);var _0x5d5a5e={'where':_0x557013[_0x6927('0x3d')]};return db['FaxQueue'][_0x6927('0x1d')](_0x5d5a5e)[_0x6927('0x26')](function(_0x5d8ef6){_0x43cbd4[_0x6927('0x1d')]=_0x5d8ef6;if(_0x1bc7e1[_0x6927('0x38')][_0x6927('0x46')]){_0x557013[_0x6927('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x6927('0x48')](_0x557013);})['then'](function(_0xa3591e){_0x43cbd4[_0x6927('0x49')]=_0xa3591e;return _0x43cbd4;})[_0x6927('0x26')](respondWithFilteredResult(_0xaad05b,_0x557013))[_0x6927('0x4a')](handleError(_0xaad05b,null));};exports[_0x6927('0x4b')]=function(_0x174206,_0x573c57){var _0x51b8a6={'raw':!![],'where':{'id':_0x174206[_0x6927('0x4c')]['id']}},_0x5c43cf={};_0x5c43cf['model']=_[_0x6927('0x33')](db['FaxQueue']['rawAttributes']);_0x5c43cf[_0x6927('0x38')]=_[_0x6927('0x33')](_0x174206['query']);_0x5c43cf[_0x6927('0x3e')]=_[_0x6927('0x34')](_0x5c43cf[_0x6927('0x32')],_0x5c43cf[_0x6927('0x38')]);_0x51b8a6[_0x6927('0x35')]=_[_0x6927('0x34')](_0x5c43cf[_0x6927('0x32')],qs['fields'](_0x174206[_0x6927('0x38')][_0x6927('0x36')]));_0x51b8a6[_0x6927('0x35')]=_0x51b8a6[_0x6927('0x35')][_0x6927('0x37')]?_0x51b8a6['attributes']:_0x5c43cf[_0x6927('0x32')];if(_0x174206[_0x6927('0x38')][_0x6927('0x46')]){_0x51b8a6['include']=[{'all':!![]}];}_0x51b8a6=_[_0x6927('0x41')]({},_0x51b8a6,_0x174206[_0x6927('0x45')]);return db[_0x6927('0x30')][_0x6927('0x4d')](_0x51b8a6)[_0x6927('0x26')](handleEntityNotFound(_0x573c57,null))[_0x6927('0x26')](respondWithResult(_0x573c57,null))[_0x6927('0x4a')](handleError(_0x573c57,null));};exports[_0x6927('0x4e')]=function(_0x501a81,_0x257253){return db[_0x6927('0x30')][_0x6927('0x4e')](_0x501a81[_0x6927('0x4f')],{})[_0x6927('0x26')](function(_0x1b429d){var _0x4244b4=_0x501a81['user'][_0x6927('0x28')]({'plain':!![]});if(!_0x4244b4)throw new Error(_0x6927('0x50'));if(_0x4244b4[_0x6927('0x51')]==='user'){var _0x2d5836=_0x1b429d['get']({'plain':!![]});var _0x318ed9=_0x6927('0x29');return db[_0x6927('0x52')][_0x6927('0x4d')]({'where':{'name':_0x318ed9,'userProfileId':_0x4244b4[_0x6927('0x53')]},'raw':!![]})['then'](function(_0x48f469){if(_0x48f469&&_0x48f469[_0x6927('0x54')]===0x0){return db[_0x6927('0x2a')][_0x6927('0x4e')]({'name':_0x2d5836[_0x6927('0x2d')],'resourceId':_0x2d5836['id'],'type':_0x48f469['name'],'sectionId':_0x48f469['id']},{})[_0x6927('0x26')](function(){return _0x1b429d;});}else{return _0x1b429d;}})['catch'](function(_0x478c43){logger[_0x6927('0x2b')](_0x6927('0x55'),_0x478c43);throw _0x478c43;});}return _0x1b429d;})['then'](respondWithResult(_0x257253,0xc9))[_0x6927('0x4a')](handleError(_0x257253,null));};exports[_0x6927('0x25')]=function(_0x1c51ca,_0x33f682){if(_0x1c51ca[_0x6927('0x4f')]['id']){delete _0x1c51ca[_0x6927('0x4f')]['id'];}return db[_0x6927('0x30')][_0x6927('0x4d')]({'where':{'id':_0x1c51ca['params']['id']}})[_0x6927('0x26')](handleEntityNotFound(_0x33f682,null))['then'](saveUpdates(_0x1c51ca['body'],null))[_0x6927('0x26')](respondWithResult(_0x33f682,null))['catch'](handleError(_0x33f682,null));};exports[_0x6927('0x27')]=function(_0x32e608,_0x5845aa){return db[_0x6927('0x30')]['find']({'where':{'id':_0x32e608['params']['id']}})[_0x6927('0x26')](handleEntityNotFound(_0x5845aa,null))['then'](removeEntity(_0x5845aa,null))[_0x6927('0x4a')](handleError(_0x5845aa,null));};exports['describe']=function(_0x4a4393,_0xe0beac){return db[_0x6927('0x30')][_0x6927('0x56')]()[_0x6927('0x26')](respondWithResult(_0xe0beac,null))[_0x6927('0x4a')](handleError(_0xe0beac,null));};exports[_0x6927('0x57')]=function(_0x510247,_0x10c4e9,_0x26f7a8){var _0x3ba953={'raw':!![],'where':{}},_0x2b825f={},_0x493a7b;return db[_0x6927('0x30')][_0x6927('0x58')]({'where':{'id':_0x510247['params']['id']}})[_0x6927('0x26')](handleEntityNotFound(_0x10c4e9,null))[_0x6927('0x26')](function(_0xa2c42f){if(_0xa2c42f){_0x493a7b=_0xa2c42f[_0x6927('0x28')]({'plain':!![]});_0x2b825f[_0x6927('0x32')]=_['keys'](db[_0x6927('0x59')][_0x6927('0x31')]);_0x2b825f[_0x6927('0x38')]=_[_0x6927('0x33')](_0x510247[_0x6927('0x38')]);_0x2b825f[_0x6927('0x3e')]=_[_0x6927('0x34')](_0x2b825f[_0x6927('0x32')],_0x2b825f[_0x6927('0x38')]);_0x3ba953[_0x6927('0x35')]=_[_0x6927('0x34')](_0x2b825f[_0x6927('0x32')],qs[_0x6927('0x36')](_0x510247[_0x6927('0x38')][_0x6927('0x36')]));_0x3ba953[_0x6927('0x35')]=_0x3ba953[_0x6927('0x35')][_0x6927('0x37')]?_0x3ba953[_0x6927('0x35')]:_0x2b825f['model'];if(!_0x510247[_0x6927('0x38')]['hasOwnProperty']('nolimit')){_0x3ba953[_0x6927('0x1f')]=qs[_0x6927('0x1f')](_0x510247[_0x6927('0x38')][_0x6927('0x1f')]);_0x3ba953[_0x6927('0x1e')]=qs['offset'](_0x510247[_0x6927('0x38')][_0x6927('0x1e')]);}_0x3ba953['order']=qs[_0x6927('0x3c')](_0x510247['query'][_0x6927('0x3c')]);_0x3ba953[_0x6927('0x3d')]=qs[_0x6927('0x3e')](_[_0x6927('0x3f')](_0x510247[_0x6927('0x38')],_0x2b825f[_0x6927('0x3e')]));_0x3ba953[_0x6927('0x3d')]['FaxQueueId']=_0xa2c42f['id'];if(_0x510247[_0x6927('0x38')][_0x6927('0x40')]){_0x3ba953['where']=_[_0x6927('0x41')](_0x3ba953[_0x6927('0x3d')],{'$or':_[_0x6927('0x42')](_0x3ba953[_0x6927('0x35')],function(_0x2524f3){var _0x2fbf2b={};_0x2fbf2b[_0x2524f3]={'$like':'%'+_0x510247['query']['filter']+'%'};return _0x2fbf2b;})});}_0x3ba953=_['merge']({},_0x3ba953,_0x510247[_0x6927('0x45')]);return db['UserFaxQueue']['findAll'](_0x3ba953);}})['then'](function(_0x18b3bb){if(_0x18b3bb){return db[_0x6927('0x5a')][_0x6927('0x5b')]({'where':{'id':_['map'](_0x18b3bb,_0x6927('0x5c')),'role':_0x6927('0x5d')},'attributes':['id','name',_0x6927('0x5e'),_0x6927('0x5f'),_0x6927('0x60')]});}})[_0x6927('0x26')](function(_0x11e1c0){if(_0x11e1c0){return{'count':_0x11e1c0[_0x6927('0x1d')],'rows':_['map'](_0x11e1c0[_0x6927('0x49')],function(_0x211d40){return{'membername':_0x211d40[_0x6927('0x2d')],'UserId':_0x211d40['id'],'queue_name':_0x493a7b[_0x6927('0x2d')],'FaxQueueId':_0x493a7b['id'],'interface':util[_0x6927('0x61')](_0x6927('0x62'),_0x6927('0x63'),_0x211d40[_0x6927('0x2d')]),'penalty':0x0,'paused':_0x211d40['faxPause'],'createdAt':_0x211d40[_0x6927('0x60')],'updatedAt':_0x211d40['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x10c4e9,_0x3ba953))['catch'](handleError(_0x10c4e9,null));};exports['getTeams']=function(_0x361e72,_0x53fef2,_0x29ed69){var _0x28907d={};var _0x34c654={};var _0x290733;var _0x1651f3;return db[_0x6927('0x30')]['findOne']({'where':{'id':_0x361e72['params']['id']}})[_0x6927('0x26')](handleEntityNotFound(_0x53fef2,null))['then'](function(_0x1b8d95){if(_0x1b8d95){_0x290733=_0x1b8d95;_0x34c654['model']=_[_0x6927('0x33')](db['Team'][_0x6927('0x31')]);_0x34c654[_0x6927('0x38')]=_[_0x6927('0x33')](_0x361e72['query']);_0x34c654[_0x6927('0x3e')]=_[_0x6927('0x34')](_0x34c654['model'],_0x34c654['query']);_0x28907d[_0x6927('0x35')]=_[_0x6927('0x34')](_0x34c654[_0x6927('0x32')],qs['fields'](_0x361e72['query']['fields']));_0x28907d[_0x6927('0x35')]=_0x28907d[_0x6927('0x35')][_0x6927('0x37')]?_0x28907d[_0x6927('0x35')]:_0x34c654['model'];_0x28907d[_0x6927('0x3b')]=qs['sort'](_0x361e72['query'][_0x6927('0x3c')]);_0x28907d[_0x6927('0x3d')]=qs[_0x6927('0x3e')](_[_0x6927('0x3f')](_0x361e72[_0x6927('0x38')],_0x34c654[_0x6927('0x3e')]));if(_0x361e72[_0x6927('0x38')][_0x6927('0x40')]){_0x28907d[_0x6927('0x3d')]=_['merge'](_0x28907d['where'],{'$or':_[_0x6927('0x42')](_0x28907d[_0x6927('0x35')],function(_0x3d3153){var _0x3a4da0={};_0x3a4da0[_0x3d3153]={'$like':'%'+_0x361e72[_0x6927('0x38')][_0x6927('0x40')]+'%'};return _0x3a4da0;})});}_0x28907d=_[_0x6927('0x41')]({},_0x28907d,_0x361e72[_0x6927('0x45')]);return _0x290733[_0x6927('0x64')](_0x28907d);}})[_0x6927('0x26')](function(_0x33a74a){if(_0x33a74a){_0x1651f3=_0x33a74a[_0x6927('0x37')];if(!_0x361e72[_0x6927('0x38')][_0x6927('0x39')](_0x6927('0x3a'))){_0x28907d[_0x6927('0x1f')]=qs['limit'](_0x361e72[_0x6927('0x38')][_0x6927('0x1f')]);_0x28907d[_0x6927('0x1e')]=qs[_0x6927('0x1e')](_0x361e72['query']['offset']);}return _0x290733['getTeams'](_0x28907d);}})['then'](function(_0x28a837){if(_0x28a837){return _0x28a837?{'count':_0x1651f3,'rows':_0x28a837}:null;}})[_0x6927('0x26')](respondWithResult(_0x53fef2,null))[_0x6927('0x4a')](handleError(_0x53fef2,null));};exports['addTeams']=function(_0x5c7feb,_0x3bd933,_0x5893ac){var _0x2bc099=_0x5c7feb['body'][_0x6927('0x65')];return db[_0x6927('0x66')][_0x6927('0x48')]({'where':{'id':_[_0x6927('0x42')](_0x2bc099,'id')},'attributes':['id'],'include':[{'model':db[_0x6927('0x5a')],'as':_0x6927('0x67'),'attributes':['id',_0x6927('0x2d'),_0x6927('0x68'),_0x6927('0x69'),_0x6927('0x6a')],'raw':!![]}]})[_0x6927('0x26')](function(_0x3ec875){if(_0x3ec875){var _0x1338f0=_[_0x6927('0x6b')](_0x3ec875,function(_0x2fb903){var _0x5703f9=_0x2fb903['get']({'plain':!![]});return _0x5703f9[_0x6927('0x67')];});return db[_0x6927('0x30')][_0x6927('0x4d')]({'where':{'id':_0x5c7feb[_0x6927('0x4c')]['id']}})['then'](function(_0x1e4702){return db[_0x6927('0x6c')][_0x6927('0x6d')](function(_0x435620){return _0x1e4702['addTeams'](_[_0x6927('0x42')](_0x2bc099,'id'),{'transaction':_0x435620})[_0x6927('0x26')](function(){return BPromise['each'](_0x1338f0,function(_0x1840ee){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x1840ee['id'],'FaxQueueId':_0x5c7feb['params']['id']},'transaction':_0x435620});});})[_0x6927('0x26')](function(){_0x1338f0[_0x6927('0x6e')](function(_0x3d093e){socket['emit']('userFaxQueue:save',{'UserId':_0x3d093e['id'],'FaxQueueId':_0x1e4702['id']});});});});});}})[_0x6927('0x26')](respondWithStatusCode(_0x3bd933,null))[_0x6927('0x4a')](handleError(_0x3bd933,null));};exports[_0x6927('0x6f')]=function(_0x271fc4,_0x20dde4,_0x5e5b22){return db[_0x6927('0x66')][_0x6927('0x48')]({'where':{'id':_0x271fc4[_0x6927('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6927('0x26')](handleEntityNotFound(_0x20dde4,null))[_0x6927('0x26')](function(_0x5000de){var _0x3d9463=_[_0x6927('0x42')](_0x5000de,'id');var _0x989b86=[];var _0x5b5e0e=[];var _0x19a313=squel[_0x6927('0x70')]();_0x19a313[_0x6927('0x71')]('tq.TeamId')[_0x6927('0x72')](_0x6927('0x73'),'tq')[_0x6927('0x74')](_0x6927('0x75'),'ut',_0x6927('0x76'))['where']('FaxQueueId\x20=\x20?',_0x271fc4[_0x6927('0x4c')]['id']);for(var _0x6f47e0=0x0;_0x6f47e0<_0x5000de[_0x6927('0x37')];_0x6f47e0+=0x1){let _0x1517a5=_0x5000de[_0x6f47e0];for(var _0x1d85ea=0x0;_0x1d85ea<_0x1517a5['Agents']['length'];_0x1d85ea+=0x1){let _0x1fe221=_0x1517a5[_0x6927('0x67')][_0x1d85ea];var _0x4ee49a=_0x19a313[_0x6927('0x77')]();_0x4ee49a['where'](_0x6927('0x78'),_0x1fe221['id']);_0x5b5e0e[_0x6927('0x79')](db['sequelize'][_0x6927('0x38')](_0x4ee49a['toString'](),{'type':db[_0x6927('0x6c')][_0x6927('0x7a')][_0x6927('0x7b')]})['then'](function(_0x1386c8){if(_0x1386c8['length']===0x1){return _0x1fe221['id'];}else{var _0x27b2e0=_[_0x6927('0x7c')](_['map'](_0x1386c8,_0x6927('0x7d')),function(_0x386a00){return _['includes'](_0x3d9463,_0x386a00);});if(_0x27b2e0){return _0x1fe221['id'];}}}));}}return BPromise[_0x6927('0x7e')](_0x5b5e0e)[_0x6927('0x26')](function(_0x2589f7){_0x989b86=_(_0x989b86)[_0x6927('0x7f')](_0x2589f7)['compact']()[_0x6927('0x80')]();return db[_0x6927('0x30')][_0x6927('0x4d')]({'where':{'id':_0x271fc4[_0x6927('0x4c')]['id']}})['then'](function(_0x5b671d){return db['sequelize'][_0x6927('0x6d')](function(_0x42897e){return _0x5b671d['removeTeams'](_0x271fc4['query'][_0x6927('0x81')],{'transaction':_0x42897e})[_0x6927('0x26')](function(){if(!_['isEmpty'](_0x989b86)){return _0x5b671d[_0x6927('0x82')](_0x989b86,{'transaction':_0x42897e});}})['then'](function(){_0x989b86[_0x6927('0x6e')](function(_0x34d277){socket[_0x6927('0x83')](_0x6927('0x84'),{'UserId':_0x34d277,'FaxQueueId':_0x5b671d['id']});});});});});});})[_0x6927('0x26')](respondWithStatusCode(_0x20dde4,null))[_0x6927('0x4a')](handleError(_0x20dde4,null));};exports[_0x6927('0x85')]=function(_0x2dc7a0,_0x318a0,_0x22b43b){return db['FaxQueue']['find']({'where':{'id':_0x2dc7a0[_0x6927('0x4c')]['id']}})['then'](handleEntityNotFound(_0x318a0,null))[_0x6927('0x26')](function(_0x383248){if(_0x383248){return _0x383248['addAgents'](_0x2dc7a0['body'][_0x6927('0x81')],_[_0x6927('0x86')](_0x2dc7a0[_0x6927('0x4f')],[_0x6927('0x81'),'id'])||{})['spread'](function(_0x29844d){for(var _0x3a1b86=0x0;_0x3a1b86<_0x2dc7a0[_0x6927('0x4f')][_0x6927('0x81')]['length'];_0x3a1b86+=0x1){socket['emit'](_0x6927('0x87'),{'UserId':_0x2dc7a0[_0x6927('0x4f')]['ids'][_0x3a1b86],'FaxQueueId':_0x2dc7a0[_0x6927('0x4c')]['id']});}return _0x29844d;});}})['then'](respondWithResult(_0x318a0,null))[_0x6927('0x4a')](handleError(_0x318a0,null));};exports[_0x6927('0x82')]=function(_0x1c3fbe,_0x4914a2,_0x102ad3){return db[_0x6927('0x30')][_0x6927('0x4d')]({'where':{'id':_0x1c3fbe['params']['id']}})['then'](handleEntityNotFound(_0x4914a2,null))['then'](function(_0x336520){if(_0x336520){return _0x336520[_0x6927('0x82')](_0x1c3fbe[_0x6927('0x38')]['ids'])[_0x6927('0x26')](function(){if(_[_0x6927('0x88')](_0x1c3fbe[_0x6927('0x38')][_0x6927('0x81')])){for(var _0xb9182e=0x0;_0xb9182e<_0x1c3fbe[_0x6927('0x38')]['ids']['length'];_0xb9182e+=0x1){socket[_0x6927('0x83')](_0x6927('0x84'),{'UserId':Number(_0x1c3fbe[_0x6927('0x38')][_0x6927('0x81')][_0xb9182e]),'FaxQueueId':Number(_0x1c3fbe['params']['id'])});}}else{socket[_0x6927('0x83')](_0x6927('0x84'),{'UserId':Number(_0x1c3fbe[_0x6927('0x38')]['ids']),'FaxQueueId':Number(_0x1c3fbe[_0x6927('0x4c')]['id'])});}});}})[_0x6927('0x26')](respondWithStatusCode(_0x4914a2,null))['catch'](handleError(_0x4914a2,null));};exports[_0x6927('0x89')]=function(_0x14c39c,_0x3e396e,_0x586db8){var _0x5d84b4={};var _0xa7cd58={};var _0x2d8c26;var _0x2d93b9;return db[_0x6927('0x30')][_0x6927('0x58')]({'where':{'id':_0x14c39c[_0x6927('0x4c')]['id']}})[_0x6927('0x26')](handleEntityNotFound(_0x3e396e,null))[_0x6927('0x26')](function(_0x1ab14c){if(_0x1ab14c){_0x2d8c26=_0x1ab14c;_0xa7cd58[_0x6927('0x32')]=_['keys'](db[_0x6927('0x5a')][_0x6927('0x31')]);_0xa7cd58[_0x6927('0x38')]=_[_0x6927('0x33')](_0x14c39c[_0x6927('0x38')]);_0xa7cd58[_0x6927('0x3e')]=_[_0x6927('0x34')](_0xa7cd58['model'],_0xa7cd58[_0x6927('0x38')]);_0x5d84b4[_0x6927('0x35')]=_['intersection'](_0xa7cd58['model'],qs[_0x6927('0x36')](_0x14c39c[_0x6927('0x38')]['fields']));_0x5d84b4['attributes']=_0x5d84b4['attributes']['length']?_0x5d84b4[_0x6927('0x35')]:_0xa7cd58['model'];_0x5d84b4[_0x6927('0x3b')]=qs[_0x6927('0x3c')](_0x14c39c['query']['sort']);_0x5d84b4[_0x6927('0x3d')]=qs['filters'](_[_0x6927('0x3f')](_0x14c39c[_0x6927('0x38')],_0xa7cd58[_0x6927('0x3e')]));if(_0x14c39c['query'][_0x6927('0x40')]){_0x5d84b4[_0x6927('0x3d')]=_[_0x6927('0x41')](_0x5d84b4[_0x6927('0x3d')],{'$or':_[_0x6927('0x42')](_0x5d84b4[_0x6927('0x35')],function(_0x4cf7ea){var _0x429e4c={};_0x429e4c[_0x4cf7ea]={'$like':'%'+_0x14c39c[_0x6927('0x38')][_0x6927('0x40')]+'%'};return _0x429e4c;})});}_0x5d84b4=_[_0x6927('0x41')]({},_0x5d84b4,_0x14c39c[_0x6927('0x45')]);return _0x2d8c26[_0x6927('0x89')](_0x5d84b4);}})[_0x6927('0x26')](function(_0x2e3f86){if(_0x2e3f86){_0x2d93b9=_0x2e3f86[_0x6927('0x37')];if(!_0x14c39c['query'][_0x6927('0x39')](_0x6927('0x3a'))){_0x5d84b4[_0x6927('0x1f')]=qs[_0x6927('0x1f')](_0x14c39c['query'][_0x6927('0x1f')]);_0x5d84b4[_0x6927('0x1e')]=qs[_0x6927('0x1e')](_0x14c39c[_0x6927('0x38')]['offset']);}return _0x2d8c26['getAgents'](_0x5d84b4);}})[_0x6927('0x26')](function(_0x58067d){if(_0x58067d){return _0x58067d?{'count':_0x2d93b9,'rows':_0x58067d}:null;}})[_0x6927('0x26')](respondWithResult(_0x3e396e,null))['catch'](handleError(_0x3e396e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 79fea97..3a39638 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 _0x6324=['hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners','update','emit'];(function(_0x2565ee,_0x289dc3){var _0x44f1c0=function(_0xa5ac78){while(--_0xa5ac78){_0x2565ee['push'](_0x2565ee['shift']());}};_0x44f1c0(++_0x289dc3);}(_0x6324,0x142));var _0x4632=function(_0x1db7fb,_0x54396b){_0x1db7fb=_0x1db7fb-0x0;var _0x5dd4c7=_0x6324[_0x1db7fb];return _0x5dd4c7;};'use strict';var EventEmitter=require(_0x4632('0x0'));var FaxQueue=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bea40){return function(_0x54c200,_0x13b218,_0x592e39){FaxQueueEvents[_0x4632('0x5')](_0x3bea40+':'+_0x54c200['id'],_0x54c200);FaxQueueEvents[_0x4632('0x5')](_0x3bea40,_0x54c200);_0x592e39(null);};}for(var e in events){if(events[_0x4632('0x6')](e)){var event=events[e];FaxQueue[_0x4632('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x351d=['events','FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x1a8396,_0x280126){var _0x29ce3=function(_0x2a205a){while(--_0x2a205a){_0x1a8396['push'](_0x1a8396['shift']());}};_0x29ce3(++_0x280126);}(_0x351d,0x90));var _0xd351=function(_0x3f5f1e,_0x4a60b5){_0x3f5f1e=_0x3f5f1e-0x0;var _0x2cd8f1=_0x351d[_0x3f5f1e];return _0x2cd8f1;};'use strict';var EventEmitter=require(_0xd351('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xd351('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd351('0x2')](0x0);var events={'afterCreate':_0xd351('0x3'),'afterUpdate':'update','afterDestroy':_0xd351('0x4')};function emitEvent(_0x48f60e){return function(_0x41d16d,_0x151391,_0x49610f){FaxQueueEvents[_0xd351('0x5')](_0x48f60e+':'+_0x41d16d['id'],_0x41d16d);FaxQueueEvents[_0xd351('0x5')](_0x48f60e,_0x41d16d);_0x49610f(null);};}for(var e in events){if(events[_0xd351('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd351('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 153b3e6..36b506b 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 _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x411d7e,_0x49ddac){var _0x5ae79a=function(_0x33c2b6){while(--_0x33c2b6){_0x411d7e['push'](_0x411d7e['shift']());}};_0x5ae79a(++_0x49ddac);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd77b35,_0x5d0d78){_0xd77b35=_0xd77b35-0x0;var _0x27f5e4=_0x5f2f[_0xd77b35];return _0x27f5e4;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x28ec10,_0x22d05){var _0x145dba=function(_0x5da99c){while(--_0x5da99c){_0x28ec10['push'](_0x28ec10['shift']());}};_0x145dba(++_0x22d05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x94312,_0x512ea1){_0x94312=_0x94312-0x0;var _0x1a34eb=_0x5f2f[_0x94312];return _0x1a34eb;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'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 5865199..6535622 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 _0xb949=['catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowFaxQueue','find','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x909dfe,_0x36e38a){var _0x5cb58f=function(_0x3f3000){while(--_0x3f3000){_0x909dfe['push'](_0x909dfe['shift']());}};_0x5cb58f(++_0x36e38a);}(_0xb949,0xfa));var _0x9b94=function(_0x5b0716,_0x4a8bc8){_0x5b0716=_0x5b0716-0x0;var _0x2815c2=_0xb949[_0x5b0716];return _0x2815c2;};'use strict';var _=require('lodash');var util=require(_0x9b94('0x0'));var moment=require('moment');var BPromise=require(_0x9b94('0x1'));var rs=require(_0x9b94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b94('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b94('0x4'))(_0x9b94('0x5'));var config=require(_0x9b94('0x6'));var jayson=require(_0x9b94('0x7'));var client=jayson[_0x9b94('0x8')][_0x9b94('0x9')]({'port':0x232a});config[_0x9b94('0xa')]=_[_0x9b94('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9b94('0xc'))(new Redis(config[_0x9b94('0xa')]));require(_0x9b94('0xd'))[_0x9b94('0xe')](socket);function respondWithRpcPromise(_0x34461e,_0x773d8a,_0x1d58ad){return new BPromise(function(_0x953e9d,_0x3ebd65){return client['request'](_0x34461e,_0x1d58ad)['then'](function(_0x50caa8){logger[_0x9b94('0xf')](_0x9b94('0x10'),_0x773d8a,_0x9b94('0x11'));logger[_0x9b94('0x12')](_0x9b94('0x13'),_0x773d8a,_0x9b94('0x11'),JSON['stringify'](_0x50caa8));if(_0x50caa8[_0x9b94('0x14')]){if(_0x50caa8[_0x9b94('0x14')]['code']===0x1f4){logger[_0x9b94('0x14')](_0x9b94('0x10'),_0x773d8a,_0x50caa8[_0x9b94('0x14')][_0x9b94('0x15')]);return _0x3ebd65(_0x50caa8[_0x9b94('0x14')]['message']);}logger[_0x9b94('0x14')]('FaxQueue,\x20%s,\x20%s',_0x773d8a,_0x50caa8[_0x9b94('0x14')]['message']);return _0x953e9d(_0x50caa8[_0x9b94('0x14')]['message']);}else{logger[_0x9b94('0xf')](_0x9b94('0x10'),_0x773d8a,_0x9b94('0x11'));_0x953e9d(_0x50caa8[_0x9b94('0x16')][_0x9b94('0x15')]);}})[_0x9b94('0x17')](function(_0xbbbe8e){logger['error'](_0x9b94('0x10'),_0x773d8a,_0xbbbe8e);_0x3ebd65(_0xbbbe8e);});});}exports[_0x9b94('0x18')]=function(_0x3e9291){var _0x49e5d0=this;return new Promise(function(_0x1ad4e5,_0x5b5533){return db[_0x9b94('0x19')][_0x9b94('0x1a')]({'raw':_0x3e9291['options']?_0x3e9291[_0x9b94('0x1b')][_0x9b94('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e9291[_0x9b94('0x1b')]?_0x3e9291[_0x9b94('0x1b')][_0x9b94('0x1d')]||null:null,'attributes':_0x3e9291[_0x9b94('0x1b')]?_0x3e9291[_0x9b94('0x1b')][_0x9b94('0x1e')]||null:null,'limit':_0x3e9291[_0x9b94('0x1b')]?_0x3e9291[_0x9b94('0x1b')][_0x9b94('0x1f')]||null:null,'include':_0x3e9291['options']?_0x3e9291[_0x9b94('0x1b')][_0x9b94('0x20')]?_[_0x9b94('0x21')](_0x3e9291[_0x9b94('0x1b')]['include'],function(_0xc18445){return{'model':db[_0xc18445[_0x9b94('0x22')]],'as':_0xc18445['as'],'attributes':_0xc18445[_0x9b94('0x1e')],'include':_0xc18445[_0x9b94('0x20')]?_[_0x9b94('0x21')](_0xc18445[_0x9b94('0x20')],function(_0x246924){return{'model':db[_0x246924[_0x9b94('0x22')]],'as':_0x246924['as'],'attributes':_0x246924['attributes'],'include':_0x246924['include']?_[_0x9b94('0x21')](_0x246924['include'],function(_0x222d5d){return{'model':db[_0x222d5d[_0x9b94('0x22')]],'as':_0x222d5d['as'],'attributes':_0x222d5d[_0x9b94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b94('0x23')](function(_0x3a3b69){logger['info'](_0x9b94('0x18'),_0x3e9291);logger[_0x9b94('0x12')](_0x9b94('0x18'),_0x3e9291,JSON[_0x9b94('0x24')](_0x3a3b69));_0x1ad4e5(_0x3a3b69);})[_0x9b94('0x17')](function(_0x24d040){logger[_0x9b94('0x14')](_0x9b94('0x18'),_0x24d040[_0x9b94('0x15')],_0x3e9291);_0x5b5533(_0x49e5d0[_0x9b94('0x14')](0x1f4,_0x24d040['message']));});});};exports[_0x9b94('0x25')]=function(_0x1640f6){var _0x126561=this;return new Promise(function(_0x2eb3bc,_0x20fd37){return db[_0x9b94('0x19')][_0x9b94('0x26')]({'raw':_0x1640f6[_0x9b94('0x1b')]?_0x1640f6[_0x9b94('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1640f6[_0x9b94('0x1b')]?_0x1640f6[_0x9b94('0x1b')][_0x9b94('0x1d')]||null:null,'attributes':_0x1640f6[_0x9b94('0x1b')]?_0x1640f6[_0x9b94('0x1b')][_0x9b94('0x1e')]||null:null,'include':_0x1640f6[_0x9b94('0x1b')]?_0x1640f6[_0x9b94('0x1b')][_0x9b94('0x20')]?_['map'](_0x1640f6[_0x9b94('0x1b')][_0x9b94('0x20')],function(_0x4b039e){return{'model':db[_0x4b039e[_0x9b94('0x22')]],'as':_0x4b039e['as'],'attributes':_0x4b039e[_0x9b94('0x1e')],'include':_0x4b039e['include']?_[_0x9b94('0x21')](_0x4b039e[_0x9b94('0x20')],function(_0x4ac6bc){return{'model':db[_0x4ac6bc[_0x9b94('0x22')]],'as':_0x4ac6bc['as'],'attributes':_0x4ac6bc[_0x9b94('0x1e')],'include':_0x4ac6bc[_0x9b94('0x20')]?_[_0x9b94('0x21')](_0x4ac6bc['include'],function(_0x14a2e7){return{'model':db[_0x14a2e7['model']],'as':_0x14a2e7['as'],'attributes':_0x14a2e7[_0x9b94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b94('0x23')](function(_0x515e50){logger[_0x9b94('0xf')](_0x9b94('0x25'),_0x1640f6);logger[_0x9b94('0x12')](_0x9b94('0x25'),_0x1640f6,JSON[_0x9b94('0x24')](_0x515e50));_0x2eb3bc(_0x515e50);})[_0x9b94('0x17')](function(_0x1d8a2c){logger[_0x9b94('0x14')]('ShowFaxQueue',_0x1d8a2c['message'],_0x1640f6);_0x20fd37(_0x126561[_0x9b94('0x14')](0x1f4,_0x1d8a2c[_0x9b94('0x15')]));});});}; \ No newline at end of file +var _0x2804=['options','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2804,0xcc));var _0x4280=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2804[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4280('0x0'));var util=require(_0x4280('0x1'));var moment=require(_0x4280('0x2'));var BPromise=require(_0x4280('0x3'));var rs=require(_0x4280('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4280('0x5'))['db'];var utils=require(_0x4280('0x6'));var logger=require('../../config/logger')(_0x4280('0x7'));var config=require(_0x4280('0x8'));var jayson=require(_0x4280('0x9'));var client=jayson[_0x4280('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4280('0xb')],{'host':_0x4280('0xc'),'port':0x18eb});var socket=require(_0x4280('0xd'))(new Redis(config[_0x4280('0xb')]));require(_0x4280('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f2403,_0xab312,_0x418d2f){return new BPromise(function(_0x980041,_0x453d6e){return client[_0x4280('0xf')](_0x4f2403,_0x418d2f)[_0x4280('0x10')](function(_0x4f127b){logger['info'](_0x4280('0x11'),_0xab312,_0x4280('0x12'));logger[_0x4280('0x13')](_0x4280('0x14'),_0xab312,_0x4280('0x12'),JSON[_0x4280('0x15')](_0x4f127b));if(_0x4f127b[_0x4280('0x16')]){if(_0x4f127b[_0x4280('0x16')]['code']===0x1f4){logger['error'](_0x4280('0x11'),_0xab312,_0x4f127b['error']['message']);return _0x453d6e(_0x4f127b[_0x4280('0x16')][_0x4280('0x17')]);}logger[_0x4280('0x16')](_0x4280('0x11'),_0xab312,_0x4f127b[_0x4280('0x16')][_0x4280('0x17')]);return _0x980041(_0x4f127b['error'][_0x4280('0x17')]);}else{logger[_0x4280('0x18')](_0x4280('0x11'),_0xab312,_0x4280('0x12'));_0x980041(_0x4f127b[_0x4280('0x19')][_0x4280('0x17')]);}})[_0x4280('0x1a')](function(_0xad0193){logger[_0x4280('0x16')](_0x4280('0x11'),_0xab312,_0xad0193);_0x453d6e(_0xad0193);});});}exports[_0x4280('0x1b')]=function(_0x9a0f98){var _0x32fcb4=this;return new Promise(function(_0x419ffe,_0x500078){return db[_0x4280('0x1c')][_0x4280('0x1d')]({'raw':_0x9a0f98[_0x4280('0x1e')]?_0x9a0f98[_0x4280('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x9a0f98[_0x4280('0x1e')]?_0x9a0f98[_0x4280('0x1e')][_0x4280('0x1f')]||null:null,'attributes':_0x9a0f98[_0x4280('0x1e')]?_0x9a0f98[_0x4280('0x1e')][_0x4280('0x20')]||null:null,'limit':_0x9a0f98[_0x4280('0x1e')]?_0x9a0f98[_0x4280('0x1e')][_0x4280('0x21')]||null:null,'include':_0x9a0f98['options']?_0x9a0f98[_0x4280('0x1e')][_0x4280('0x22')]?_[_0x4280('0x23')](_0x9a0f98[_0x4280('0x1e')]['include'],function(_0xb609e4){return{'model':db[_0xb609e4[_0x4280('0x24')]],'as':_0xb609e4['as'],'attributes':_0xb609e4[_0x4280('0x20')],'include':_0xb609e4[_0x4280('0x22')]?_[_0x4280('0x23')](_0xb609e4[_0x4280('0x22')],function(_0x12f496){return{'model':db[_0x12f496[_0x4280('0x24')]],'as':_0x12f496['as'],'attributes':_0x12f496[_0x4280('0x20')],'include':_0x12f496['include']?_[_0x4280('0x23')](_0x12f496['include'],function(_0x502dc5){return{'model':db[_0x502dc5[_0x4280('0x24')]],'as':_0x502dc5['as'],'attributes':_0x502dc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4280('0x10')](function(_0x100aba){logger[_0x4280('0x18')]('GetFaxQueue',_0x9a0f98);logger[_0x4280('0x13')](_0x4280('0x1b'),_0x9a0f98,JSON['stringify'](_0x100aba));_0x419ffe(_0x100aba);})[_0x4280('0x1a')](function(_0x5cc4a7){logger['error']('GetFaxQueue',_0x5cc4a7[_0x4280('0x17')],_0x9a0f98);_0x500078(_0x32fcb4[_0x4280('0x16')](0x1f4,_0x5cc4a7[_0x4280('0x17')]));});});};exports[_0x4280('0x25')]=function(_0xf1a13f){var _0x476985=this;return new Promise(function(_0x59d12c,_0x4165c9){return db['FaxQueue'][_0x4280('0x26')]({'raw':_0xf1a13f[_0x4280('0x1e')]?_0xf1a13f[_0x4280('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xf1a13f[_0x4280('0x1e')]?_0xf1a13f['options'][_0x4280('0x1f')]||null:null,'attributes':_0xf1a13f[_0x4280('0x1e')]?_0xf1a13f[_0x4280('0x1e')][_0x4280('0x20')]||null:null,'include':_0xf1a13f[_0x4280('0x1e')]?_0xf1a13f[_0x4280('0x1e')][_0x4280('0x22')]?_[_0x4280('0x23')](_0xf1a13f[_0x4280('0x1e')][_0x4280('0x22')],function(_0x40c658){return{'model':db[_0x40c658[_0x4280('0x24')]],'as':_0x40c658['as'],'attributes':_0x40c658[_0x4280('0x20')],'include':_0x40c658['include']?_['map'](_0x40c658[_0x4280('0x22')],function(_0x39ce1a){return{'model':db[_0x39ce1a[_0x4280('0x24')]],'as':_0x39ce1a['as'],'attributes':_0x39ce1a['attributes'],'include':_0x39ce1a['include']?_['map'](_0x39ce1a[_0x4280('0x22')],function(_0xb6eade){return{'model':db[_0xb6eade[_0x4280('0x24')]],'as':_0xb6eade['as'],'attributes':_0xb6eade[_0x4280('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4280('0x10')](function(_0x2a3a55){logger['info'](_0x4280('0x25'),_0xf1a13f);logger[_0x4280('0x13')](_0x4280('0x25'),_0xf1a13f,JSON[_0x4280('0x15')](_0x2a3a55));_0x59d12c(_0x2a3a55);})[_0x4280('0x1a')](function(_0x1fb25c){logger[_0x4280('0x16')](_0x4280('0x25'),_0x1fb25c[_0x4280('0x17')],_0xf1a13f);_0x4165c9(_0x476985['error'](0x1f4,_0x1fb25c[_0x4280('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 8d8649e..310b62d 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 _0x666f=['update','emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove'];(function(_0x27aaf2,_0x2fa2fd){var _0x571d2e=function(_0x30c0ba){while(--_0x30c0ba){_0x27aaf2['push'](_0x27aaf2['shift']());}};_0x571d2e(++_0x2fa2fd);}(_0x666f,0xcd));var _0xf666=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x666f[_0x46698a];return _0x356db0;};'use strict';var FaxQueueEvents=require(_0xf666('0x0'));var events=[_0xf666('0x1'),_0xf666('0x2'),_0xf666('0x3')];function createListener(_0x47c020,_0xc4e4bb){return function(_0x4c2cb6){_0xc4e4bb[_0xf666('0x4')](_0x47c020,_0x4c2cb6);};}function removeListener(_0x58a9ec,_0x5ba812){return function(){FaxQueueEvents[_0xf666('0x5')](_0x58a9ec,_0x5ba812);};}exports[_0xf666('0x6')]=function(_0x588c80){for(var _0x5977f4=0x0,_0xf7130d=events['length'];_0x5977f4<_0xf7130d;_0x5977f4++){var _0x56e0d1=events[_0x5977f4];var _0x1096c0=createListener(_0xf666('0x7')+_0x56e0d1,_0x588c80);FaxQueueEvents['on'](_0x56e0d1,_0x1096c0);}}; \ No newline at end of file +var _0xc010=['removeListener','length','faxQueue:','save','remove','emit'];(function(_0x1788a0,_0x2ea3ba){var _0x12a906=function(_0x4239f8){while(--_0x4239f8){_0x1788a0['push'](_0x1788a0['shift']());}};_0x12a906(++_0x2ea3ba);}(_0xc010,0x1b3));var _0x0c01=function(_0x487b24,_0x56c972){_0x487b24=_0x487b24-0x0;var _0x35595a=_0xc010[_0x487b24];return _0x35595a;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x0c01('0x0'),_0x0c01('0x1'),'update'];function createListener(_0x3e2557,_0x43bb39){return function(_0x16994f){_0x43bb39[_0x0c01('0x2')](_0x3e2557,_0x16994f);};}function removeListener(_0x547de0,_0x231e0c){return function(){FaxQueueEvents[_0x0c01('0x3')](_0x547de0,_0x231e0c);};}exports['register']=function(_0x3c656f){for(var _0x4806e6=0x0,_0x1f6e40=events[_0x0c01('0x4')];_0x4806e6<_0x1f6e40;_0x4806e6++){var _0x4a111d=events[_0x4806e6];var _0xa42e8=createListener(_0x0c01('0x5')+_0x4a111d,_0x3c656f);FaxQueueEvents['on'](_0x4a111d,_0xa42e8);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index a6a8507..3eeb58b 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 _0xbebc=['describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xbebc,0xe9));var _0xcbeb=function(_0xb79918,_0x2614f1){_0xb79918=_0xb79918-0x0;var _0x161b08=_0xbebc[_0xb79918];return _0x161b08;};'use strict';var multer=require(_0xcbeb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbeb('0x1'));var express=require('express');var router=express[_0xcbeb('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xcbeb('0x3'));var config=require(_0xcbeb('0x4'));var controller=require(_0xcbeb('0x5'));router['get']('/',auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x7')]);router[_0xcbeb('0x8')](_0xcbeb('0x9'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0xa')]);router['get'](_0xcbeb('0xb'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0xc')]);router[_0xcbeb('0x8')]('/:id/members',auth[_0xcbeb('0x6')](),controller['getMembers']);router['get'](_0xcbeb('0xd'),auth['isAuthenticated'](),controller[_0xcbeb('0xe')]);router['get'](_0xcbeb('0xf'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x10')]);router[_0xcbeb('0x11')]('/',auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x12')]);router[_0xcbeb('0x11')](_0xcbeb('0xd'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x13')]);router[_0xcbeb('0x11')](_0xcbeb('0xf'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x14')]);router[_0xcbeb('0x15')]('/:id',auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x16')]);router[_0xcbeb('0x17')](_0xcbeb('0xb'),auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x18')]);router[_0xcbeb('0x17')]('/:id/teams',auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x19')]);router[_0xcbeb('0x17')]('/:id/users',auth[_0xcbeb('0x6')](),controller[_0xcbeb('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xe933=['/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','destroy','removeTeams','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','/describe','isAuthenticated','describe'];(function(_0x24d676,_0x1e9245){var _0x39a144=function(_0x4bb05f){while(--_0x4bb05f){_0x24d676['push'](_0x24d676['shift']());}};_0x39a144(++_0x1e9245);}(_0xe933,0xef));var _0x3e93=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xe933[_0x1deb03];return _0x189fe7;};'use strict';var multer=require('multer');var util=require(_0x3e93('0x0'));var path=require(_0x3e93('0x1'));var timeout=require(_0x3e93('0x2'));var express=require(_0x3e93('0x3'));var router=express[_0x3e93('0x4')]();var auth=require(_0x3e93('0x5'));var interaction=require(_0x3e93('0x6'));var config=require(_0x3e93('0x7'));var controller=require(_0x3e93('0x8'));router[_0x3e93('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3e93('0x9')](_0x3e93('0xa'),auth[_0x3e93('0xb')](),controller[_0x3e93('0xc')]);router[_0x3e93('0x9')](_0x3e93('0xd'),auth[_0x3e93('0xb')](),controller['show']);router[_0x3e93('0x9')](_0x3e93('0xe'),auth[_0x3e93('0xb')](),controller[_0x3e93('0xf')]);router['get'](_0x3e93('0x10'),auth[_0x3e93('0xb')](),controller[_0x3e93('0x11')]);router[_0x3e93('0x9')](_0x3e93('0x12'),auth['isAuthenticated'](),controller[_0x3e93('0x13')]);router[_0x3e93('0x14')]('/',auth[_0x3e93('0xb')](),controller['create']);router[_0x3e93('0x14')](_0x3e93('0x10'),auth['isAuthenticated'](),controller[_0x3e93('0x15')]);router[_0x3e93('0x14')](_0x3e93('0x12'),auth[_0x3e93('0xb')](),controller[_0x3e93('0x16')]);router['put'](_0x3e93('0xd'),auth[_0x3e93('0xb')](),controller['update']);router['delete'](_0x3e93('0xd'),auth['isAuthenticated'](),controller[_0x3e93('0x17')]);router['delete'](_0x3e93('0x10'),auth[_0x3e93('0xb')](),controller[_0x3e93('0x18')]);router[_0x3e93('0x19')](_0x3e93('0x12'),auth[_0x3e93('0xb')](),controller[_0x3e93('0x1a')]);module[_0x3e93('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 630d3d1..3a7659c 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 _0x9ec1=['STRING','DATE','sequelize','exports'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x9ec1,0x14a));var _0x19ec=function(_0x14be12,_0x6f0e11){_0x14be12=_0x14be12-0x0;var _0x30baab=_0x9ec1[_0x14be12];return _0x30baab;};'use strict';var moment=require('moment');var Sequelize=require(_0x19ec('0x0'));module[_0x19ec('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x19ec('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x19ec('0x3')]},'acceptAt':{'type':Sequelize[_0x19ec('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x19ec('0x2')]}}; \ No newline at end of file +var _0xab02=['STRING','DATE','moment','sequelize'];(function(_0x426cf2,_0x1cbc09){var _0x249ab9=function(_0x23e395){while(--_0x23e395){_0x426cf2['push'](_0x426cf2['shift']());}};_0x249ab9(++_0x1cbc09);}(_0xab02,0x1a6));var _0x2ab0=function(_0x451896,_0x318846){_0x451896=_0x451896-0x0;var _0x4f6ffe=_0xab02[_0x451896];return _0x4f6ffe;};'use strict';var moment=require(_0x2ab0('0x0'));var Sequelize=require(_0x2ab0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2ab0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2ab0('0x3')]},'leaveAt':{'type':Sequelize[_0x2ab0('0x3')]},'acceptAt':{'type':Sequelize[_0x2ab0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2ab0('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c20cdb4..559eced 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 _0x4b79=['status','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','end','stack','name','send','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','map','key','VIRTUAL','field','options','include','FaxQueueReport','findAll','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x963a04,_0x42b440){var _0xf1bc9e=function(_0x4b3a09){while(--_0x4b3a09){_0x963a04['push'](_0x963a04['shift']());}};_0xf1bc9e(++_0x42b440);}(_0x4b79,0xad));var _0x94b7=function(_0x323c5f,_0x489e9f){_0x323c5f=_0x323c5f-0x0;var _0x296169=_0x4b79[_0x323c5f];return _0x296169;};'use strict';var pdf=require(_0x94b7('0x0'));var emlformat=require(_0x94b7('0x1'));var rimraf=require(_0x94b7('0x2'));var zipdir=require(_0x94b7('0x3'));var jsonpatch=require(_0x94b7('0x4'));var rp=require('request-promise');var moment=require(_0x94b7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x94b7('0x6'));var util=require(_0x94b7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94b7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x94b7('0x9'));var crypto=require('crypto');var jsforce=require(_0x94b7('0xa'));var deskjs=require(_0x94b7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x94b7('0xc'));var Papa=require(_0x94b7('0xd'));var Redis=require(_0x94b7('0xe'));var authService=require(_0x94b7('0xf'));var qs=require(_0x94b7('0x10'));var hardwareService=require(_0x94b7('0x11'));var logger=require('../../config/logger')(_0x94b7('0x12'));var utils=require(_0x94b7('0x13'));var config=require(_0x94b7('0x14'));var db=require(_0x94b7('0x15'))['db'];function respondWithStatusCode(_0x49036d,_0x1c4cc9){_0x1c4cc9=_0x1c4cc9||0xcc;return function(_0x1d0a0c){if(_0x1d0a0c){return _0x49036d['sendStatus'](_0x1c4cc9);}return _0x49036d['status'](_0x1c4cc9)['end']();};}function respondWithResult(_0x152b12,_0x3d827b){_0x3d827b=_0x3d827b||0xc8;return function(_0x3b8358){if(_0x3b8358){return _0x152b12[_0x94b7('0x16')](_0x3d827b)['json'](_0x3b8358);}};}function respondWithFilteredResult(_0x506571,_0x4938cf){return function(_0x47af4e){if(_0x47af4e){var _0x4088f3=_0x47af4e[_0x94b7('0x17')],_0x10d0df=_0x4938cf[_0x94b7('0x18')],_0x2d5715=_0x4938cf[_0x94b7('0x18')]+_0x4938cf[_0x94b7('0x19')],_0x1a083c;if(_0x2d5715>=_0x4088f3){_0x2d5715=_0x4088f3;_0x1a083c=0xc8;}else{_0x1a083c=0xce;}_0x506571[_0x94b7('0x16')](_0x1a083c);return _0x506571[_0x94b7('0x1a')](_0x94b7('0x1b'),_0x10d0df+'-'+_0x2d5715+'/'+_0x4088f3)[_0x94b7('0x1c')](_0x47af4e);}return null;};}function patchUpdates(_0x621cc1){return function(_0x1a8494){try{jsonpatch['apply'](_0x1a8494,_0x621cc1,!![]);}catch(_0x2b6873){return BPromise[_0x94b7('0x1d')](_0x2b6873);}return _0x1a8494['save']();};}function saveUpdates(_0xc72153,_0x31595a){return function(_0x719148){if(_0x719148){return _0x719148[_0x94b7('0x1e')](_0xc72153)[_0x94b7('0x1f')](function(_0x5841c6){return _0x5841c6;});}return null;};}function removeEntity(_0x31de88,_0x47ebe9){return function(_0x267ad1){if(_0x267ad1){return _0x267ad1[_0x94b7('0x20')]()[_0x94b7('0x1f')](function(){_0x31de88[_0x94b7('0x16')](0xcc)[_0x94b7('0x21')]();});}};}function handleEntityNotFound(_0x35f740,_0x32d63b){return function(_0x137732){if(!_0x137732){_0x35f740['sendStatus'](0x194);}return _0x137732;};}function handleError(_0x1ac2a1,_0x299bab){_0x299bab=_0x299bab||0x1f4;return function(_0x5832a9){logger['error'](_0x5832a9[_0x94b7('0x22')]);if(_0x5832a9[_0x94b7('0x23')]){delete _0x5832a9['name'];}_0x1ac2a1['status'](_0x299bab)[_0x94b7('0x24')](_0x5832a9);};}exports['index']=function(_0x240df2,_0x2146ec){var _0xc0477e={},_0x16f9f8={},_0x122717={'count':0x0,'rows':[]};var _0x3e2276=db['FaxQueueReport']['rawAttributes'];_0x16f9f8[_0x94b7('0x25')]=_[_0x94b7('0x26')](_0x3e2276);_0x16f9f8[_0x94b7('0x27')]=_['keys'](_0x240df2[_0x94b7('0x27')]);_0x16f9f8['filters']=_[_0x94b7('0x28')](_0x16f9f8[_0x94b7('0x25')],_0x16f9f8[_0x94b7('0x27')]);_0xc0477e[_0x94b7('0x29')]=_[_0x94b7('0x28')](_0x16f9f8[_0x94b7('0x25')],qs[_0x94b7('0x2a')](_0x240df2[_0x94b7('0x27')][_0x94b7('0x2a')]));_0xc0477e['attributes']=_0xc0477e[_0x94b7('0x29')][_0x94b7('0x2b')]?_0xc0477e[_0x94b7('0x29')]:_0x16f9f8[_0x94b7('0x25')];if(!_0x240df2['query'][_0x94b7('0x2c')]('nolimit')){_0xc0477e[_0x94b7('0x19')]=qs[_0x94b7('0x19')](_0x240df2['query'][_0x94b7('0x19')]);_0xc0477e[_0x94b7('0x18')]=qs[_0x94b7('0x18')](_0x240df2[_0x94b7('0x27')][_0x94b7('0x18')]);}_0xc0477e['order']=qs[_0x94b7('0x2d')](_0x240df2[_0x94b7('0x27')][_0x94b7('0x2d')]);_0xc0477e[_0x94b7('0x2e')]=qs[_0x94b7('0x2f')](_['pick'](_0x240df2[_0x94b7('0x27')],_0x16f9f8[_0x94b7('0x2f')]));if(_0x240df2[_0x94b7('0x27')][_0x94b7('0x30')]){_0xc0477e['where']=_[_0x94b7('0x31')](_0xc0477e[_0x94b7('0x2e')],{'$or':_[_0x94b7('0x32')](_0x3e2276,function(_0x11f83b){if(_0x11f83b['type'][_0x94b7('0x33')]!==_0x94b7('0x34')){var _0x3cec71={};_0x3cec71[_0x11f83b[_0x94b7('0x35')]]={'$like':'%'+_0x240df2[_0x94b7('0x27')][_0x94b7('0x30')]+'%'};return _0x3cec71;}})});}_0xc0477e=_[_0x94b7('0x31')]({},_0xc0477e,_0x240df2[_0x94b7('0x36')]);var _0x49b4b3={'where':_0xc0477e[_0x94b7('0x2e')]};return db['FaxQueueReport'][_0x94b7('0x17')](_0x49b4b3)[_0x94b7('0x1f')](function(_0x36aa38){_0x122717['count']=_0x36aa38;if(_0x240df2[_0x94b7('0x27')]['includeAll']){_0xc0477e[_0x94b7('0x37')]=[{'all':!![]}];}return db[_0x94b7('0x38')][_0x94b7('0x39')](_0xc0477e);})[_0x94b7('0x1f')](function(_0x4ef295){_0x122717['rows']=_0x4ef295;return _0x122717;})[_0x94b7('0x1f')](respondWithFilteredResult(_0x2146ec,_0xc0477e))[_0x94b7('0x3a')](handleError(_0x2146ec,null));};exports[_0x94b7('0x3b')]=function(_0x79d6b3,_0x16d471){var _0x35444e={'raw':!![],'where':{'id':_0x79d6b3[_0x94b7('0x3c')]['id']}},_0x38f3c3={};_0x38f3c3[_0x94b7('0x25')]=_[_0x94b7('0x26')](db[_0x94b7('0x38')]['rawAttributes']);_0x38f3c3[_0x94b7('0x27')]=_[_0x94b7('0x26')](_0x79d6b3[_0x94b7('0x27')]);_0x38f3c3['filters']=_[_0x94b7('0x28')](_0x38f3c3[_0x94b7('0x25')],_0x38f3c3[_0x94b7('0x27')]);_0x35444e['attributes']=_['intersection'](_0x38f3c3[_0x94b7('0x25')],qs[_0x94b7('0x2a')](_0x79d6b3[_0x94b7('0x27')][_0x94b7('0x2a')]));_0x35444e[_0x94b7('0x29')]=_0x35444e[_0x94b7('0x29')][_0x94b7('0x2b')]?_0x35444e[_0x94b7('0x29')]:_0x38f3c3['model'];if(_0x79d6b3[_0x94b7('0x27')][_0x94b7('0x3d')]){_0x35444e[_0x94b7('0x37')]=[{'all':!![]}];}_0x35444e=_['merge']({},_0x35444e,_0x79d6b3['options']);return db[_0x94b7('0x38')][_0x94b7('0x3e')](_0x35444e)[_0x94b7('0x1f')](handleEntityNotFound(_0x16d471,null))[_0x94b7('0x1f')](respondWithResult(_0x16d471,null))[_0x94b7('0x3a')](handleError(_0x16d471,null));};exports[_0x94b7('0x3f')]=function(_0x232840,_0x1e64d0){return db['FaxQueueReport'][_0x94b7('0x3f')](_0x232840[_0x94b7('0x40')],{})[_0x94b7('0x1f')](respondWithResult(_0x1e64d0,0xc9))['catch'](handleError(_0x1e64d0,null));};exports[_0x94b7('0x1e')]=function(_0x2dd5fc,_0x1925bc){if(_0x2dd5fc['body']['id']){delete _0x2dd5fc[_0x94b7('0x40')]['id'];}return db['FaxQueueReport'][_0x94b7('0x3e')]({'where':{'id':_0x2dd5fc[_0x94b7('0x3c')]['id']}})[_0x94b7('0x1f')](handleEntityNotFound(_0x1925bc,null))[_0x94b7('0x1f')](saveUpdates(_0x2dd5fc['body'],null))['then'](respondWithResult(_0x1925bc,null))[_0x94b7('0x3a')](handleError(_0x1925bc,null));};exports[_0x94b7('0x20')]=function(_0x29e1dd,_0x47d3ff){return db[_0x94b7('0x38')][_0x94b7('0x3e')]({'where':{'id':_0x29e1dd[_0x94b7('0x3c')]['id']}})[_0x94b7('0x1f')](handleEntityNotFound(_0x47d3ff,null))[_0x94b7('0x1f')](removeEntity(_0x47d3ff,null))['catch'](handleError(_0x47d3ff,null));};exports['describe']=function(_0x54ff3b,_0x8eea96){return db[_0x94b7('0x38')]['describe']()[_0x94b7('0x1f')](respondWithResult(_0x8eea96,null))[_0x94b7('0x3a')](handleError(_0x8eea96,null));}; \ No newline at end of file +var _0x4f4c=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','field','include','findAll','rows','show','params','length','includeAll','options','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x4f4c,0x1f3));var _0xc4f4=function(_0x129c92,_0x51b9d1){_0x129c92=_0x129c92-0x0;var _0x11e8f8=_0x4f4c[_0x129c92];return _0x11e8f8;};'use strict';var pdf=require(_0xc4f4('0x0'));var emlformat=require(_0xc4f4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc4f4('0x2'));var jsonpatch=require(_0xc4f4('0x3'));var rp=require(_0xc4f4('0x4'));var moment=require('moment');var BPromise=require(_0xc4f4('0x5'));var Mustache=require(_0xc4f4('0x6'));var util=require('util');var path=require(_0xc4f4('0x7'));var sox=require(_0xc4f4('0x8'));var csv=require(_0xc4f4('0x9'));var ejs=require(_0xc4f4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc4f4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc4f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc4f4('0xd'));var Papa=require('papaparse');var Redis=require(_0xc4f4('0xe'));var authService=require(_0xc4f4('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4f4('0x10'))(_0xc4f4('0x11'));var utils=require(_0xc4f4('0x12'));var config=require(_0xc4f4('0x13'));var db=require(_0xc4f4('0x14'))['db'];function respondWithStatusCode(_0x2a6b38,_0x4a5d9e){_0x4a5d9e=_0x4a5d9e||0xcc;return function(_0x16eb16){if(_0x16eb16){return _0x2a6b38[_0xc4f4('0x15')](_0x4a5d9e);}return _0x2a6b38[_0xc4f4('0x16')](_0x4a5d9e)[_0xc4f4('0x17')]();};}function respondWithResult(_0x287d36,_0x39cf44){_0x39cf44=_0x39cf44||0xc8;return function(_0x2f6f1d){if(_0x2f6f1d){return _0x287d36[_0xc4f4('0x16')](_0x39cf44)[_0xc4f4('0x18')](_0x2f6f1d);}};}function respondWithFilteredResult(_0x4b797a,_0x3be82f){return function(_0x46f51e){if(_0x46f51e){var _0x4e2242=_0x46f51e[_0xc4f4('0x19')],_0x375b0=_0x3be82f[_0xc4f4('0x1a')],_0x5a2cd7=_0x3be82f['offset']+_0x3be82f[_0xc4f4('0x1b')],_0x4ab39e;if(_0x5a2cd7>=_0x4e2242){_0x5a2cd7=_0x4e2242;_0x4ab39e=0xc8;}else{_0x4ab39e=0xce;}_0x4b797a[_0xc4f4('0x16')](_0x4ab39e);return _0x4b797a[_0xc4f4('0x1c')](_0xc4f4('0x1d'),_0x375b0+'-'+_0x5a2cd7+'/'+_0x4e2242)[_0xc4f4('0x18')](_0x46f51e);}return null;};}function patchUpdates(_0x3ec844){return function(_0x43e152){try{jsonpatch[_0xc4f4('0x1e')](_0x43e152,_0x3ec844,!![]);}catch(_0x293475){return BPromise[_0xc4f4('0x1f')](_0x293475);}return _0x43e152[_0xc4f4('0x20')]();};}function saveUpdates(_0xfeae0f,_0x441a1f){return function(_0x1b705e){if(_0x1b705e){return _0x1b705e[_0xc4f4('0x21')](_0xfeae0f)[_0xc4f4('0x22')](function(_0x52c097){return _0x52c097;});}return null;};}function removeEntity(_0x1a5f3f,_0x5eb806){return function(_0x5abacc){if(_0x5abacc){return _0x5abacc[_0xc4f4('0x23')]()[_0xc4f4('0x22')](function(){_0x1a5f3f[_0xc4f4('0x16')](0xcc)[_0xc4f4('0x17')]();});}};}function handleEntityNotFound(_0x544050,_0x240932){return function(_0xd2709f){if(!_0xd2709f){_0x544050[_0xc4f4('0x15')](0x194);}return _0xd2709f;};}function handleError(_0x590019,_0x38156e){_0x38156e=_0x38156e||0x1f4;return function(_0x3febc5){logger[_0xc4f4('0x24')](_0x3febc5[_0xc4f4('0x25')]);if(_0x3febc5[_0xc4f4('0x26')]){delete _0x3febc5[_0xc4f4('0x26')];}_0x590019[_0xc4f4('0x16')](_0x38156e)[_0xc4f4('0x27')](_0x3febc5);};}exports[_0xc4f4('0x28')]=function(_0x14f243,_0x1b9815){var _0x23809f={},_0x4aabcc={},_0x2ad84b={'count':0x0,'rows':[]};var _0x1724d8=db[_0xc4f4('0x29')][_0xc4f4('0x2a')];_0x4aabcc[_0xc4f4('0x2b')]=_[_0xc4f4('0x2c')](_0x1724d8);_0x4aabcc[_0xc4f4('0x2d')]=_[_0xc4f4('0x2c')](_0x14f243[_0xc4f4('0x2d')]);_0x4aabcc['filters']=_['intersection'](_0x4aabcc[_0xc4f4('0x2b')],_0x4aabcc[_0xc4f4('0x2d')]);_0x23809f[_0xc4f4('0x2e')]=_[_0xc4f4('0x2f')](_0x4aabcc[_0xc4f4('0x2b')],qs[_0xc4f4('0x30')](_0x14f243[_0xc4f4('0x2d')][_0xc4f4('0x30')]));_0x23809f[_0xc4f4('0x2e')]=_0x23809f[_0xc4f4('0x2e')]['length']?_0x23809f[_0xc4f4('0x2e')]:_0x4aabcc[_0xc4f4('0x2b')];if(!_0x14f243['query'][_0xc4f4('0x31')](_0xc4f4('0x32'))){_0x23809f['limit']=qs['limit'](_0x14f243[_0xc4f4('0x2d')][_0xc4f4('0x1b')]);_0x23809f[_0xc4f4('0x1a')]=qs[_0xc4f4('0x1a')](_0x14f243[_0xc4f4('0x2d')][_0xc4f4('0x1a')]);}_0x23809f[_0xc4f4('0x33')]=qs[_0xc4f4('0x34')](_0x14f243[_0xc4f4('0x2d')][_0xc4f4('0x34')]);_0x23809f[_0xc4f4('0x35')]=qs[_0xc4f4('0x36')](_[_0xc4f4('0x37')](_0x14f243[_0xc4f4('0x2d')],_0x4aabcc[_0xc4f4('0x36')]));if(_0x14f243['query'][_0xc4f4('0x38')]){_0x23809f[_0xc4f4('0x35')]=_[_0xc4f4('0x39')](_0x23809f[_0xc4f4('0x35')],{'$or':_[_0xc4f4('0x3a')](_0x1724d8,function(_0x3d454e){if(_0x3d454e['type']['key']!==_0xc4f4('0x3b')){var _0x116365={};_0x116365[_0x3d454e[_0xc4f4('0x3c')]]={'$like':'%'+_0x14f243[_0xc4f4('0x2d')][_0xc4f4('0x38')]+'%'};return _0x116365;}})});}_0x23809f=_[_0xc4f4('0x39')]({},_0x23809f,_0x14f243['options']);var _0xc3ca35={'where':_0x23809f[_0xc4f4('0x35')]};return db[_0xc4f4('0x29')][_0xc4f4('0x19')](_0xc3ca35)[_0xc4f4('0x22')](function(_0x17da0b){_0x2ad84b['count']=_0x17da0b;if(_0x14f243[_0xc4f4('0x2d')]['includeAll']){_0x23809f[_0xc4f4('0x3d')]=[{'all':!![]}];}return db[_0xc4f4('0x29')][_0xc4f4('0x3e')](_0x23809f);})[_0xc4f4('0x22')](function(_0x4cadb5){_0x2ad84b[_0xc4f4('0x3f')]=_0x4cadb5;return _0x2ad84b;})[_0xc4f4('0x22')](respondWithFilteredResult(_0x1b9815,_0x23809f))['catch'](handleError(_0x1b9815,null));};exports[_0xc4f4('0x40')]=function(_0x33649f,_0x50d695){var _0x493b74={'raw':!![],'where':{'id':_0x33649f[_0xc4f4('0x41')]['id']}},_0x4e5f0c={};_0x4e5f0c[_0xc4f4('0x2b')]=_[_0xc4f4('0x2c')](db[_0xc4f4('0x29')][_0xc4f4('0x2a')]);_0x4e5f0c[_0xc4f4('0x2d')]=_[_0xc4f4('0x2c')](_0x33649f[_0xc4f4('0x2d')]);_0x4e5f0c[_0xc4f4('0x36')]=_[_0xc4f4('0x2f')](_0x4e5f0c[_0xc4f4('0x2b')],_0x4e5f0c[_0xc4f4('0x2d')]);_0x493b74[_0xc4f4('0x2e')]=_[_0xc4f4('0x2f')](_0x4e5f0c[_0xc4f4('0x2b')],qs[_0xc4f4('0x30')](_0x33649f[_0xc4f4('0x2d')][_0xc4f4('0x30')]));_0x493b74[_0xc4f4('0x2e')]=_0x493b74['attributes'][_0xc4f4('0x42')]?_0x493b74[_0xc4f4('0x2e')]:_0x4e5f0c['model'];if(_0x33649f['query'][_0xc4f4('0x43')]){_0x493b74[_0xc4f4('0x3d')]=[{'all':!![]}];}_0x493b74=_['merge']({},_0x493b74,_0x33649f[_0xc4f4('0x44')]);return db[_0xc4f4('0x29')][_0xc4f4('0x45')](_0x493b74)['then'](handleEntityNotFound(_0x50d695,null))[_0xc4f4('0x22')](respondWithResult(_0x50d695,null))[_0xc4f4('0x46')](handleError(_0x50d695,null));};exports[_0xc4f4('0x47')]=function(_0x18f20a,_0x4c2048){return db[_0xc4f4('0x29')][_0xc4f4('0x47')](_0x18f20a[_0xc4f4('0x48')],{})[_0xc4f4('0x22')](respondWithResult(_0x4c2048,0xc9))[_0xc4f4('0x46')](handleError(_0x4c2048,null));};exports[_0xc4f4('0x21')]=function(_0x26127c,_0x41f324){if(_0x26127c[_0xc4f4('0x48')]['id']){delete _0x26127c['body']['id'];}return db[_0xc4f4('0x29')][_0xc4f4('0x45')]({'where':{'id':_0x26127c[_0xc4f4('0x41')]['id']}})['then'](handleEntityNotFound(_0x41f324,null))[_0xc4f4('0x22')](saveUpdates(_0x26127c['body'],null))[_0xc4f4('0x22')](respondWithResult(_0x41f324,null))['catch'](handleError(_0x41f324,null));};exports[_0xc4f4('0x23')]=function(_0x35c588,_0x1b2c06){return db[_0xc4f4('0x29')][_0xc4f4('0x45')]({'where':{'id':_0x35c588[_0xc4f4('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b2c06,null))[_0xc4f4('0x22')](removeEntity(_0x1b2c06,null))[_0xc4f4('0x46')](handleError(_0x1b2c06,null));};exports[_0xc4f4('0x49')]=function(_0x451d6b,_0x3b5cd0){return db[_0xc4f4('0x29')][_0xc4f4('0x49')]()[_0xc4f4('0x22')](respondWithResult(_0x3b5cd0,null))[_0xc4f4('0x46')](handleError(_0x3b5cd0,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 31a2232..e9cd67e 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 _0xd4ee=['./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5baadf,_0x1bb942){var _0x3cd985=function(_0x15810c){while(--_0x15810c){_0x5baadf['push'](_0x5baadf['shift']());}};_0x3cd985(++_0x1bb942);}(_0xd4ee,0xc5));var _0xed4e=function(_0x3475f5,_0x66eca9){_0x3475f5=_0x3475f5-0x0;var _0x8ac27b=_0xd4ee[_0x3475f5];return _0x8ac27b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed4e('0x0'))('api');var moment=require(_0xed4e('0x1'));var BPromise=require(_0xed4e('0x2'));var rp=require(_0xed4e('0x3'));var fs=require('fs');var path=require(_0xed4e('0x4'));var rimraf=require(_0xed4e('0x5'));var config=require(_0xed4e('0x6'));var attributes=require(_0xed4e('0x7'));module[_0xed4e('0x8')]=function(_0x346574,_0x54b43c){return _0x346574[_0xed4e('0x9')](_0xed4e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xed4e('0xb'),'fields':[_0xed4e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd182=['uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue'];(function(_0xb973e7,_0x3fe372){var _0x5ef736=function(_0x5024a4){while(--_0x5024a4){_0xb973e7['push'](_0xb973e7['shift']());}};_0x5ef736(++_0x3fe372);}(_0xd182,0x135));var _0x2d18=function(_0x2c928f,_0x3012f0){_0x2c928f=_0x2c928f-0x0;var _0x2bd65c=_0xd182[_0x2c928f];return _0x2bd65c;};'use strict';var _=require(_0x2d18('0x0'));var util=require(_0x2d18('0x1'));var logger=require(_0x2d18('0x2'))('api');var moment=require(_0x2d18('0x3'));var BPromise=require(_0x2d18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d18('0x5'));var rimraf=require(_0x2d18('0x6'));var config=require(_0x2d18('0x7'));var attributes=require(_0x2d18('0x8'));module[_0x2d18('0x9')]=function(_0x2c70ea,_0x33cea3){return _0x2c70ea[_0x2d18('0xa')](_0x2d18('0xb'),attributes,{'tableName':_0x2d18('0xc'),'paranoid':![],'indexes':[{'name':_0x2d18('0xd'),'fields':[_0x2d18('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 81dec19..0d9dbaf 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 _0x0c71=['create','body','options','raw','info','debug','UpdateFaxQueueReport','FaxQueueReport','update','where','limit','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x0c71,0xfb));var _0x10c7=function(_0x475e74,_0x28e8a5){_0x475e74=_0x475e74-0x0;var _0x53d550=_0x0c71[_0x475e74];return _0x53d550;};'use strict';var _=require('lodash');var util=require(_0x10c7('0x0'));var moment=require('moment');var BPromise=require(_0x10c7('0x1'));var rs=require(_0x10c7('0x2'));var fs=require('fs');var Redis=require(_0x10c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x10c7('0x4'))('rpc');var config=require(_0x10c7('0x5'));var jayson=require(_0x10c7('0x6'));var client=jayson[_0x10c7('0x7')][_0x10c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbe32,_0xd955fc,_0x4d8fc8){return new BPromise(function(_0x3cbcd7,_0x221c8f){return client['request'](_0x2dbe32,_0x4d8fc8)[_0x10c7('0x9')](function(_0x566146){logger['info'](_0x10c7('0xa'),_0xd955fc,_0x10c7('0xb'));logger['debug'](_0x10c7('0xc'),_0xd955fc,_0x10c7('0xb'),JSON[_0x10c7('0xd')](_0x566146));if(_0x566146[_0x10c7('0xe')]){if(_0x566146[_0x10c7('0xe')][_0x10c7('0xf')]===0x1f4){logger[_0x10c7('0xe')](_0x10c7('0xa'),_0xd955fc,_0x566146[_0x10c7('0xe')][_0x10c7('0x10')]);return _0x221c8f(_0x566146['error'][_0x10c7('0x10')]);}logger[_0x10c7('0xe')](_0x10c7('0xa'),_0xd955fc,_0x566146[_0x10c7('0xe')][_0x10c7('0x10')]);return _0x3cbcd7(_0x566146[_0x10c7('0xe')][_0x10c7('0x10')]);}else{logger['info'](_0x10c7('0xa'),_0xd955fc,_0x10c7('0xb'));_0x3cbcd7(_0x566146['result'][_0x10c7('0x10')]);}})[_0x10c7('0x11')](function(_0xbfd3a4){logger[_0x10c7('0xe')](_0x10c7('0xa'),_0xd955fc,_0xbfd3a4);_0x221c8f(_0xbfd3a4);});});}exports[_0x10c7('0x12')]=function(_0x3168e1){var _0x1bd968=this;return new Promise(function(_0x2ecb76,_0x4ce96d){return db['FaxQueueReport'][_0x10c7('0x13')](_0x3168e1[_0x10c7('0x14')],{'raw':_0x3168e1['options']?_0x3168e1[_0x10c7('0x15')][_0x10c7('0x16')]===undefined?!![]:![]:!![]})[_0x10c7('0x9')](function(_0x5373cf){logger[_0x10c7('0x17')]('CreateFaxQueueReport',_0x3168e1);logger[_0x10c7('0x18')](_0x10c7('0x12'),_0x3168e1,JSON[_0x10c7('0xd')](_0x5373cf));_0x2ecb76(_0x5373cf);})['catch'](function(_0x29a2e5){logger[_0x10c7('0xe')](_0x10c7('0x12'),_0x29a2e5[_0x10c7('0x10')],_0x3168e1);_0x4ce96d(_0x1bd968[_0x10c7('0xe')](0x1f4,_0x29a2e5[_0x10c7('0x10')]));});});};exports[_0x10c7('0x19')]=function(_0x308e3a){var _0x33b697=this;return new Promise(function(_0x3cd18a,_0x6a062b){return db[_0x10c7('0x1a')][_0x10c7('0x1b')](_0x308e3a[_0x10c7('0x14')],{'raw':_0x308e3a[_0x10c7('0x15')]?_0x308e3a[_0x10c7('0x15')][_0x10c7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x308e3a[_0x10c7('0x15')]?_0x308e3a[_0x10c7('0x15')][_0x10c7('0x1c')]||null:null,'attributes':_0x308e3a['options']?_0x308e3a['options']['attributes']||null:null,'limit':_0x308e3a[_0x10c7('0x15')]?_0x308e3a[_0x10c7('0x15')][_0x10c7('0x1d')]||null:null})[_0x10c7('0x9')](function(_0x27ac7e){logger[_0x10c7('0x17')]('UpdateFaxQueueReport',_0x308e3a);logger[_0x10c7('0x18')]('UpdateFaxQueueReport',_0x308e3a,JSON[_0x10c7('0xd')](_0x27ac7e));_0x3cd18a(_0x27ac7e);})['catch'](function(_0x3731a1){logger[_0x10c7('0xe')]('UpdateFaxQueueReport',_0x3731a1[_0x10c7('0x10')],_0x308e3a);_0x6a062b(_0x33b697[_0x10c7('0xe')](0x1f4,_0x3731a1[_0x10c7('0x10')]));});});}; \ No newline at end of file +var _0xa321=['limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','where','attributes'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0xa321,0x9d));var _0x1a32=function(_0x3b7fb0,_0x553e21){_0x3b7fb0=_0x3b7fb0-0x0;var _0x3b7fc5=_0xa321[_0x3b7fb0];return _0x3b7fc5;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});}exports[_0x1a32('0x14')]=function(_0x3b2983){var _0x43404b=this;return new Promise(function(_0x303afb,_0x4141c4){return db[_0x1a32('0x15')][_0x1a32('0x16')](_0x3b2983[_0x1a32('0x17')],{'raw':_0x3b2983[_0x1a32('0x18')]?_0x3b2983['options'][_0x1a32('0x19')]===undefined?!![]:![]:!![]})[_0x1a32('0x1a')](function(_0x235fd0){logger['info'](_0x1a32('0x14'),_0x3b2983);logger[_0x1a32('0xc')]('CreateFaxQueueReport',_0x3b2983,JSON[_0x1a32('0xe')](_0x235fd0));_0x303afb(_0x235fd0);})['catch'](function(_0x125504){logger[_0x1a32('0xf')]('CreateFaxQueueReport',_0x125504[_0x1a32('0x12')],_0x3b2983);_0x4141c4(_0x43404b[_0x1a32('0xf')](0x1f4,_0x125504[_0x1a32('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x2d6637){var _0x1fe746=this;return new Promise(function(_0x4bf0a0,_0x372b95){return db[_0x1a32('0x15')]['update'](_0x2d6637[_0x1a32('0x17')],{'raw':_0x2d6637['options']?_0x2d6637['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d6637['options']?_0x2d6637['options'][_0x1a32('0x1b')]||null:null,'attributes':_0x2d6637[_0x1a32('0x18')]?_0x2d6637[_0x1a32('0x18')][_0x1a32('0x1c')]||null:null,'limit':_0x2d6637[_0x1a32('0x18')]?_0x2d6637[_0x1a32('0x18')][_0x1a32('0x1d')]||null:null})[_0x1a32('0x1a')](function(_0x48d69d){logger[_0x1a32('0xa')](_0x1a32('0x1e'),_0x2d6637);logger[_0x1a32('0xc')](_0x1a32('0x1e'),_0x2d6637,JSON[_0x1a32('0xe')](_0x48d69d));_0x4bf0a0(_0x48d69d);})[_0x1a32('0x13')](function(_0x821dbf){logger[_0x1a32('0xf')](_0x1a32('0x1e'),_0x821dbf['message'],_0x2d6637);_0x372b95(_0x1fe746[_0x1a32('0xf')](0x1f4,_0x821dbf[_0x1a32('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 1571a3a..b95040a 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 _0x74fd=['destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x74fd,0x1a6));var _0xd74f=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x74fd[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0xd74f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd74f('0x1'));var express=require('express');var router=express[_0xd74f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd74f('0x3'));var config=require(_0xd74f('0x4'));var controller=require(_0xd74f('0x5'));router[_0xd74f('0x6')]('/',auth[_0xd74f('0x7')](),controller[_0xd74f('0x8')]);router[_0xd74f('0x6')](_0xd74f('0x9'),auth[_0xd74f('0x7')](),controller[_0xd74f('0xa')]);router[_0xd74f('0x6')](_0xd74f('0xb'),auth[_0xd74f('0x7')](),controller[_0xd74f('0xc')]);router[_0xd74f('0xd')]('/',auth[_0xd74f('0x7')](),controller[_0xd74f('0xe')]);router[_0xd74f('0xf')](_0xd74f('0xb'),auth[_0xd74f('0x7')](),controller[_0xd74f('0x10')]);router[_0xd74f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd74f('0x12')]);module[_0xd74f('0x13')]=router; \ No newline at end of file +var _0x66c1=['delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id','update'];(function(_0x1cf326,_0x55e9dc){var _0x4e95d8=function(_0x1f8cb4){while(--_0x1f8cb4){_0x1cf326['push'](_0x1cf326['shift']());}};_0x4e95d8(++_0x55e9dc);}(_0x66c1,0x74));var _0x166c=function(_0x5b9386,_0x3e26b5){_0x5b9386=_0x5b9386-0x0;var _0x2a58f8=_0x66c1[_0x5b9386];return _0x2a58f8;};'use strict';var multer=require(_0x166c('0x0'));var util=require('util');var path=require(_0x166c('0x1'));var timeout=require('connect-timeout');var express=require(_0x166c('0x2'));var router=express[_0x166c('0x3')]();var auth=require(_0x166c('0x4'));var interaction=require(_0x166c('0x5'));var config=require(_0x166c('0x6'));var controller=require('./faxQueueReport.controller');router[_0x166c('0x7')]('/',auth[_0x166c('0x8')](),controller[_0x166c('0x9')]);router[_0x166c('0x7')]('/describe',auth[_0x166c('0x8')](),controller[_0x166c('0xa')]);router[_0x166c('0x7')]('/:id',auth[_0x166c('0x8')](),controller[_0x166c('0xb')]);router[_0x166c('0xc')]('/',auth[_0x166c('0x8')](),controller[_0x166c('0xd')]);router[_0x166c('0xe')](_0x166c('0xf'),auth[_0x166c('0x8')](),controller[_0x166c('0x10')]);router[_0x166c('0x11')](_0x166c('0xf'),auth[_0x166c('0x8')](),controller[_0x166c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9918ff8..113db0e 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 _0x6864=['exports','STRING','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x3ccd07,_0x586c61){var _0xe72103=function(_0x59ac53){while(--_0x59ac53){_0x3ccd07['push'](_0x3ccd07['shift']());}};_0xe72103(++_0x586c61);}(_0x6864,0x7f));var _0x4686=function(_0x5db740,_0x1aa8b7){_0x5db740=_0x5db740-0x0;var _0x352dbe=_0x6864[_0x5db740];return _0x352dbe;};'use strict';var moment=require(_0x4686('0x0'));var Sequelize=require('sequelize');module[_0x4686('0x1')]={'uniqueid':{'type':Sequelize[_0x4686('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4686('0x3')]('account',_0x4686('0x4'),_0x4686('0x5')),'allowNull':![],'defaultValue':_0x4686('0x5')},'transferredAt':{'type':Sequelize[_0x4686('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x4686('0x7')]}}; \ No newline at end of file +var _0x78e8=['NOW','sequelize','exports','ENUM','account','queue','DATE'];(function(_0x47cdee,_0x5dbc85){var _0x55576e=function(_0x2afd11){while(--_0x2afd11){_0x47cdee['push'](_0x47cdee['shift']());}};_0x55576e(++_0x5dbc85);}(_0x78e8,0x94));var _0x878e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x78e8[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require('moment');var Sequelize=require(_0x878e('0x0'));module[_0x878e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x878e('0x2')](_0x878e('0x3'),'agent',_0x878e('0x4')),'allowNull':![],'defaultValue':_0x878e('0x4')},'transferredAt':{'type':Sequelize[_0x878e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x878e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ee789a4..2f0034e 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 _0xee33=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','error','name','index','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','type','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xee33,0xfb));var _0x3ee3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xee33[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3ee3('0x0'));var emlformat=require(_0x3ee3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ee3('0x2'));var rp=require('request-promise');var moment=require(_0x3ee3('0x3'));var BPromise=require(_0x3ee3('0x4'));var Mustache=require('mustache');var util=require(_0x3ee3('0x5'));var path=require(_0x3ee3('0x6'));var sox=require(_0x3ee3('0x7'));var csv=require(_0x3ee3('0x8'));var ejs=require(_0x3ee3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3ee3('0xa'));var crypto=require('crypto');var jsforce=require(_0x3ee3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3ee3('0x8'));var querystring=require(_0x3ee3('0xc'));var Papa=require('papaparse');var Redis=require(_0x3ee3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3ee3('0xe'));var hardwareService=require(_0x3ee3('0xf'));var logger=require('../../config/logger')(_0x3ee3('0x10'));var utils=require(_0x3ee3('0x11'));var config=require(_0x3ee3('0x12'));var db=require(_0x3ee3('0x13'))['db'];function respondWithStatusCode(_0x3ee1f7,_0x5df3cc){_0x5df3cc=_0x5df3cc||0xcc;return function(_0x189e27){if(_0x189e27){return _0x3ee1f7[_0x3ee3('0x14')](_0x5df3cc);}return _0x3ee1f7['status'](_0x5df3cc)[_0x3ee3('0x15')]();};}function respondWithResult(_0x195a11,_0x14c127){_0x14c127=_0x14c127||0xc8;return function(_0x3a2db4){if(_0x3a2db4){return _0x195a11[_0x3ee3('0x16')](_0x14c127)[_0x3ee3('0x17')](_0x3a2db4);}};}function respondWithFilteredResult(_0x3398da,_0x1874b7){return function(_0x9948cf){if(_0x9948cf){var _0x7e1834=_0x9948cf['count'],_0x44f51f=_0x1874b7[_0x3ee3('0x18')],_0xb82874=_0x1874b7[_0x3ee3('0x18')]+_0x1874b7[_0x3ee3('0x19')],_0x166eb6;if(_0xb82874>=_0x7e1834){_0xb82874=_0x7e1834;_0x166eb6=0xc8;}else{_0x166eb6=0xce;}_0x3398da[_0x3ee3('0x16')](_0x166eb6);return _0x3398da[_0x3ee3('0x1a')]('Content-Range',_0x44f51f+'-'+_0xb82874+'/'+_0x7e1834)['json'](_0x9948cf);}return null;};}function patchUpdates(_0x23795a){return function(_0x51e14f){try{jsonpatch[_0x3ee3('0x1b')](_0x51e14f,_0x23795a,!![]);}catch(_0x46bef9){return BPromise[_0x3ee3('0x1c')](_0x46bef9);}return _0x51e14f[_0x3ee3('0x1d')]();};}function saveUpdates(_0x24946e,_0x5ef377){return function(_0x5c65e4){if(_0x5c65e4){return _0x5c65e4[_0x3ee3('0x1e')](_0x24946e)[_0x3ee3('0x1f')](function(_0x538907){return _0x538907;});}return null;};}function removeEntity(_0x580828,_0x2ae8c3){return function(_0x1b995e){if(_0x1b995e){return _0x1b995e['destroy']()[_0x3ee3('0x1f')](function(){_0x580828[_0x3ee3('0x16')](0xcc)[_0x3ee3('0x15')]();});}};}function handleEntityNotFound(_0x420ca3,_0x2bd83e){return function(_0xc66dd3){if(!_0xc66dd3){_0x420ca3['sendStatus'](0x194);}return _0xc66dd3;};}function handleError(_0x49c24f,_0x4d214d){_0x4d214d=_0x4d214d||0x1f4;return function(_0x5c1e0e){logger[_0x3ee3('0x20')](_0x5c1e0e['stack']);if(_0x5c1e0e['name']){delete _0x5c1e0e[_0x3ee3('0x21')];}_0x49c24f['status'](_0x4d214d)['send'](_0x5c1e0e);};}exports[_0x3ee3('0x22')]=function(_0x40cc83,_0x35f80d){var _0x5bda0e={},_0x9367ea={},_0x41706d={'count':0x0,'rows':[]};var _0x35cdf7=db['FaxTransferReport'][_0x3ee3('0x23')];_0x9367ea[_0x3ee3('0x24')]=_['keys'](_0x35cdf7);_0x9367ea[_0x3ee3('0x25')]=_[_0x3ee3('0x26')](_0x40cc83['query']);_0x9367ea['filters']=_[_0x3ee3('0x27')](_0x9367ea[_0x3ee3('0x24')],_0x9367ea[_0x3ee3('0x25')]);_0x5bda0e[_0x3ee3('0x28')]=_[_0x3ee3('0x27')](_0x9367ea['model'],qs[_0x3ee3('0x29')](_0x40cc83['query'][_0x3ee3('0x29')]));_0x5bda0e['attributes']=_0x5bda0e[_0x3ee3('0x28')]['length']?_0x5bda0e['attributes']:_0x9367ea[_0x3ee3('0x24')];if(!_0x40cc83['query'][_0x3ee3('0x2a')]('nolimit')){_0x5bda0e['limit']=qs['limit'](_0x40cc83[_0x3ee3('0x25')]['limit']);_0x5bda0e['offset']=qs[_0x3ee3('0x18')](_0x40cc83[_0x3ee3('0x25')][_0x3ee3('0x18')]);}_0x5bda0e[_0x3ee3('0x2b')]=qs[_0x3ee3('0x2c')](_0x40cc83['query'][_0x3ee3('0x2c')]);_0x5bda0e['where']=qs[_0x3ee3('0x2d')](_[_0x3ee3('0x2e')](_0x40cc83['query'],_0x9367ea[_0x3ee3('0x2d')]));if(_0x40cc83[_0x3ee3('0x25')][_0x3ee3('0x2f')]){_0x5bda0e[_0x3ee3('0x30')]=_[_0x3ee3('0x31')](_0x5bda0e[_0x3ee3('0x30')],{'$or':_[_0x3ee3('0x32')](_0x35cdf7,function(_0x1ef6f3){if(_0x1ef6f3[_0x3ee3('0x33')]['key']!=='VIRTUAL'){var _0x2649a2={};_0x2649a2[_0x1ef6f3['field']]={'$like':'%'+_0x40cc83[_0x3ee3('0x25')][_0x3ee3('0x2f')]+'%'};return _0x2649a2;}})});}_0x5bda0e=_[_0x3ee3('0x31')]({},_0x5bda0e,_0x40cc83[_0x3ee3('0x34')]);var _0x455c17={'where':_0x5bda0e['where']};return db[_0x3ee3('0x35')]['count'](_0x455c17)['then'](function(_0x5d6621){_0x41706d['count']=_0x5d6621;if(_0x40cc83[_0x3ee3('0x25')][_0x3ee3('0x36')]){_0x5bda0e[_0x3ee3('0x37')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x3ee3('0x38')](_0x5bda0e);})[_0x3ee3('0x1f')](function(_0x318686){_0x41706d[_0x3ee3('0x39')]=_0x318686;return _0x41706d;})[_0x3ee3('0x1f')](respondWithFilteredResult(_0x35f80d,_0x5bda0e))[_0x3ee3('0x3a')](handleError(_0x35f80d,null));};exports[_0x3ee3('0x3b')]=function(_0x18b195,_0x32519a){var _0x30e410={'raw':!![],'where':{'id':_0x18b195[_0x3ee3('0x3c')]['id']}},_0x6adcdc={};_0x6adcdc[_0x3ee3('0x24')]=_[_0x3ee3('0x26')](db[_0x3ee3('0x35')]['rawAttributes']);_0x6adcdc[_0x3ee3('0x25')]=_[_0x3ee3('0x26')](_0x18b195[_0x3ee3('0x25')]);_0x6adcdc[_0x3ee3('0x2d')]=_[_0x3ee3('0x27')](_0x6adcdc[_0x3ee3('0x24')],_0x6adcdc['query']);_0x30e410['attributes']=_[_0x3ee3('0x27')](_0x6adcdc['model'],qs[_0x3ee3('0x29')](_0x18b195[_0x3ee3('0x25')][_0x3ee3('0x29')]));_0x30e410[_0x3ee3('0x28')]=_0x30e410['attributes'][_0x3ee3('0x3d')]?_0x30e410[_0x3ee3('0x28')]:_0x6adcdc[_0x3ee3('0x24')];if(_0x18b195[_0x3ee3('0x25')][_0x3ee3('0x36')]){_0x30e410[_0x3ee3('0x37')]=[{'all':!![]}];}_0x30e410=_[_0x3ee3('0x31')]({},_0x30e410,_0x18b195[_0x3ee3('0x34')]);return db[_0x3ee3('0x35')][_0x3ee3('0x3e')](_0x30e410)[_0x3ee3('0x1f')](handleEntityNotFound(_0x32519a,null))[_0x3ee3('0x1f')](respondWithResult(_0x32519a,null))['catch'](handleError(_0x32519a,null));};exports[_0x3ee3('0x3f')]=function(_0x140e59,_0x2035ef){return db[_0x3ee3('0x35')]['create'](_0x140e59[_0x3ee3('0x40')],{})[_0x3ee3('0x1f')](respondWithResult(_0x2035ef,0xc9))[_0x3ee3('0x3a')](handleError(_0x2035ef,null));};exports['update']=function(_0x3ebdf2,_0x3bc252){if(_0x3ebdf2[_0x3ee3('0x40')]['id']){delete _0x3ebdf2[_0x3ee3('0x40')]['id'];}return db['FaxTransferReport'][_0x3ee3('0x3e')]({'where':{'id':_0x3ebdf2[_0x3ee3('0x3c')]['id']}})[_0x3ee3('0x1f')](handleEntityNotFound(_0x3bc252,null))[_0x3ee3('0x1f')](saveUpdates(_0x3ebdf2[_0x3ee3('0x40')],null))[_0x3ee3('0x1f')](respondWithResult(_0x3bc252,null))['catch'](handleError(_0x3bc252,null));};exports['destroy']=function(_0x48b579,_0x582157){return db['FaxTransferReport'][_0x3ee3('0x3e')]({'where':{'id':_0x48b579[_0x3ee3('0x3c')]['id']}})[_0x3ee3('0x1f')](handleEntityNotFound(_0x582157,null))['then'](removeEntity(_0x582157,null))[_0x3ee3('0x3a')](handleError(_0x582157,null));};exports[_0x3ee3('0x41')]=function(_0x1f7c2e,_0x27ed70){return db['FaxTransferReport'][_0x3ee3('0x41')]()[_0x3ee3('0x1f')](respondWithResult(_0x27ed70,null))[_0x3ee3('0x3a')](handleError(_0x27ed70,null));}; \ No newline at end of file +var _0x876b=['find','describe','eml-format','request-promise','moment','bluebird','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','set','reject','save','update','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','create','body'];(function(_0xe8c5f7,_0xd172be){var _0x1a83de=function(_0xa6f86a){while(--_0xa6f86a){_0xe8c5f7['push'](_0xe8c5f7['shift']());}};_0x1a83de(++_0xd172be);}(_0x876b,0xce));var _0xb876=function(_0x405f31,_0xcef8c5){_0x405f31=_0x405f31-0x0;var _0x52707d=_0x876b[_0x405f31];return _0x52707d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb876('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb876('0x1'));var moment=require(_0xb876('0x2'));var BPromise=require(_0xb876('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb876('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb876('0x5'));var fs=require('fs');var _=require(_0xb876('0x6'));var squel=require(_0xb876('0x7'));var crypto=require(_0xb876('0x8'));var jsforce=require(_0xb876('0x9'));var deskjs=require(_0xb876('0xa'));var toCsv=require(_0xb876('0xb'));var querystring=require(_0xb876('0xc'));var Papa=require(_0xb876('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb876('0xe'));var logger=require(_0xb876('0xf'))(_0xb876('0x10'));var utils=require(_0xb876('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x417f10,_0x21f950){_0x21f950=_0x21f950||0xcc;return function(_0x1fee6f){if(_0x1fee6f){return _0x417f10[_0xb876('0x12')](_0x21f950);}return _0x417f10[_0xb876('0x13')](_0x21f950)['end']();};}function respondWithResult(_0x6f08b2,_0xf6c36b){_0xf6c36b=_0xf6c36b||0xc8;return function(_0x463d17){if(_0x463d17){return _0x6f08b2[_0xb876('0x13')](_0xf6c36b)[_0xb876('0x14')](_0x463d17);}};}function respondWithFilteredResult(_0x233f95,_0x401bce){return function(_0x38a1cb){if(_0x38a1cb){var _0xeeba5=_0x38a1cb[_0xb876('0x15')],_0x34a9e2=_0x401bce['offset'],_0x231437=_0x401bce[_0xb876('0x16')]+_0x401bce['limit'],_0x551b2f;if(_0x231437>=_0xeeba5){_0x231437=_0xeeba5;_0x551b2f=0xc8;}else{_0x551b2f=0xce;}_0x233f95['status'](_0x551b2f);return _0x233f95[_0xb876('0x17')]('Content-Range',_0x34a9e2+'-'+_0x231437+'/'+_0xeeba5)[_0xb876('0x14')](_0x38a1cb);}return null;};}function patchUpdates(_0x38457d){return function(_0x3184da){try{jsonpatch['apply'](_0x3184da,_0x38457d,!![]);}catch(_0x46f010){return BPromise[_0xb876('0x18')](_0x46f010);}return _0x3184da[_0xb876('0x19')]();};}function saveUpdates(_0x9ced5c,_0x3769cf){return function(_0x1ce867){if(_0x1ce867){return _0x1ce867[_0xb876('0x1a')](_0x9ced5c)[_0xb876('0x1b')](function(_0x232ee3){return _0x232ee3;});}return null;};}function removeEntity(_0x4f948c,_0x1a9443){return function(_0x4dd7ed){if(_0x4dd7ed){return _0x4dd7ed['destroy']()[_0xb876('0x1b')](function(){_0x4f948c[_0xb876('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa3ea5,_0x236334){return function(_0x1ad2ac){if(!_0x1ad2ac){_0xa3ea5[_0xb876('0x12')](0x194);}return _0x1ad2ac;};}function handleError(_0x6edaa1,_0x370498){_0x370498=_0x370498||0x1f4;return function(_0x8eafd7){logger[_0xb876('0x1c')](_0x8eafd7[_0xb876('0x1d')]);if(_0x8eafd7[_0xb876('0x1e')]){delete _0x8eafd7['name'];}_0x6edaa1[_0xb876('0x13')](_0x370498)[_0xb876('0x1f')](_0x8eafd7);};}exports[_0xb876('0x20')]=function(_0x28a265,_0x41b3c2){var _0x2a3709={},_0x34a9b9={},_0x3155b0={'count':0x0,'rows':[]};var _0x299ae1=db[_0xb876('0x21')][_0xb876('0x22')];_0x34a9b9[_0xb876('0x23')]=_[_0xb876('0x24')](_0x299ae1);_0x34a9b9[_0xb876('0x25')]=_[_0xb876('0x24')](_0x28a265[_0xb876('0x25')]);_0x34a9b9[_0xb876('0x26')]=_[_0xb876('0x27')](_0x34a9b9['model'],_0x34a9b9[_0xb876('0x25')]);_0x2a3709['attributes']=_[_0xb876('0x27')](_0x34a9b9[_0xb876('0x23')],qs[_0xb876('0x28')](_0x28a265['query'][_0xb876('0x28')]));_0x2a3709[_0xb876('0x29')]=_0x2a3709['attributes']['length']?_0x2a3709[_0xb876('0x29')]:_0x34a9b9[_0xb876('0x23')];if(!_0x28a265[_0xb876('0x25')][_0xb876('0x2a')](_0xb876('0x2b'))){_0x2a3709[_0xb876('0x2c')]=qs[_0xb876('0x2c')](_0x28a265[_0xb876('0x25')][_0xb876('0x2c')]);_0x2a3709[_0xb876('0x16')]=qs[_0xb876('0x16')](_0x28a265[_0xb876('0x25')]['offset']);}_0x2a3709[_0xb876('0x2d')]=qs['sort'](_0x28a265['query'][_0xb876('0x2e')]);_0x2a3709[_0xb876('0x2f')]=qs[_0xb876('0x26')](_[_0xb876('0x30')](_0x28a265[_0xb876('0x25')],_0x34a9b9[_0xb876('0x26')]));if(_0x28a265[_0xb876('0x25')][_0xb876('0x31')]){_0x2a3709['where']=_[_0xb876('0x32')](_0x2a3709[_0xb876('0x2f')],{'$or':_['map'](_0x299ae1,function(_0x3093b8){if(_0x3093b8[_0xb876('0x33')][_0xb876('0x34')]!==_0xb876('0x35')){var _0x286af5={};_0x286af5[_0x3093b8[_0xb876('0x36')]]={'$like':'%'+_0x28a265[_0xb876('0x25')][_0xb876('0x31')]+'%'};return _0x286af5;}})});}_0x2a3709=_[_0xb876('0x32')]({},_0x2a3709,_0x28a265[_0xb876('0x37')]);var _0x1517eb={'where':_0x2a3709[_0xb876('0x2f')]};return db[_0xb876('0x21')][_0xb876('0x15')](_0x1517eb)['then'](function(_0x4f9a51){_0x3155b0[_0xb876('0x15')]=_0x4f9a51;if(_0x28a265[_0xb876('0x25')][_0xb876('0x38')]){_0x2a3709[_0xb876('0x39')]=[{'all':!![]}];}return db[_0xb876('0x21')][_0xb876('0x3a')](_0x2a3709);})[_0xb876('0x1b')](function(_0x288896){_0x3155b0[_0xb876('0x3b')]=_0x288896;return _0x3155b0;})[_0xb876('0x1b')](respondWithFilteredResult(_0x41b3c2,_0x2a3709))[_0xb876('0x3c')](handleError(_0x41b3c2,null));};exports[_0xb876('0x3d')]=function(_0xc05ce5,_0x313bb4){var _0x113547={'raw':!![],'where':{'id':_0xc05ce5[_0xb876('0x3e')]['id']}},_0x58829c={};_0x58829c[_0xb876('0x23')]=_[_0xb876('0x24')](db[_0xb876('0x21')]['rawAttributes']);_0x58829c['query']=_[_0xb876('0x24')](_0xc05ce5[_0xb876('0x25')]);_0x58829c[_0xb876('0x26')]=_[_0xb876('0x27')](_0x58829c[_0xb876('0x23')],_0x58829c[_0xb876('0x25')]);_0x113547[_0xb876('0x29')]=_[_0xb876('0x27')](_0x58829c['model'],qs['fields'](_0xc05ce5[_0xb876('0x25')][_0xb876('0x28')]));_0x113547[_0xb876('0x29')]=_0x113547[_0xb876('0x29')][_0xb876('0x3f')]?_0x113547[_0xb876('0x29')]:_0x58829c[_0xb876('0x23')];if(_0xc05ce5[_0xb876('0x25')]['includeAll']){_0x113547[_0xb876('0x39')]=[{'all':!![]}];}_0x113547=_[_0xb876('0x32')]({},_0x113547,_0xc05ce5[_0xb876('0x37')]);return db[_0xb876('0x21')]['find'](_0x113547)[_0xb876('0x1b')](handleEntityNotFound(_0x313bb4,null))[_0xb876('0x1b')](respondWithResult(_0x313bb4,null))[_0xb876('0x3c')](handleError(_0x313bb4,null));};exports[_0xb876('0x40')]=function(_0x1b47bf,_0x11fb66){return db[_0xb876('0x21')][_0xb876('0x40')](_0x1b47bf[_0xb876('0x41')],{})[_0xb876('0x1b')](respondWithResult(_0x11fb66,0xc9))[_0xb876('0x3c')](handleError(_0x11fb66,null));};exports[_0xb876('0x1a')]=function(_0x363195,_0x12503a){if(_0x363195['body']['id']){delete _0x363195['body']['id'];}return db[_0xb876('0x21')][_0xb876('0x42')]({'where':{'id':_0x363195['params']['id']}})[_0xb876('0x1b')](handleEntityNotFound(_0x12503a,null))[_0xb876('0x1b')](saveUpdates(_0x363195[_0xb876('0x41')],null))[_0xb876('0x1b')](respondWithResult(_0x12503a,null))['catch'](handleError(_0x12503a,null));};exports['destroy']=function(_0xb24331,_0x2c3c90){return db[_0xb876('0x21')][_0xb876('0x42')]({'where':{'id':_0xb24331[_0xb876('0x3e')]['id']}})[_0xb876('0x1b')](handleEntityNotFound(_0x2c3c90,null))[_0xb876('0x1b')](removeEntity(_0x2c3c90,null))['catch'](handleError(_0x2c3c90,null));};exports[_0xb876('0x43')]=function(_0x423fca,_0x2388ea){return db[_0xb876('0x21')][_0xb876('0x43')]()[_0xb876('0x1b')](respondWithResult(_0x2388ea,null))[_0xb876('0x3c')](handleError(_0x2388ea,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c569d54..f7d6908 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 _0xc74e=['exports','define','FaxTransferReport','report_fax_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes'];(function(_0xa97f62,_0x3ab559){var _0x184087=function(_0x4be14d){while(--_0x4be14d){_0xa97f62['push'](_0xa97f62['shift']());}};_0x184087(++_0x3ab559);}(_0xc74e,0xfb));var _0xec74=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc74e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xec74('0x0'));var util=require(_0xec74('0x1'));var logger=require(_0xec74('0x2'))('api');var moment=require(_0xec74('0x3'));var BPromise=require(_0xec74('0x4'));var rp=require(_0xec74('0x5'));var fs=require('fs');var path=require(_0xec74('0x6'));var rimraf=require(_0xec74('0x7'));var config=require('../../config/environment');var attributes=require(_0xec74('0x8'));module[_0xec74('0x9')]=function(_0x460767,_0x501acc){return _0x460767[_0xec74('0xa')](_0xec74('0xb'),attributes,{'tableName':_0xec74('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8875=['uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8875,0xb5));var _0x5887=function(_0x15ca62,_0x23e37f){_0x15ca62=_0x15ca62-0x0;var _0x2fc128=_0x8875[_0x15ca62];return _0x2fc128;};'use strict';var _=require('lodash');var util=require(_0x5887('0x0'));var logger=require(_0x5887('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5887('0x2'));var rp=require(_0x5887('0x3'));var fs=require('fs');var path=require(_0x5887('0x4'));var rimraf=require(_0x5887('0x5'));var config=require(_0x5887('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x5887('0x7')]=function(_0x4e5ac3,_0x71ebaf){return _0x4e5ac3[_0x5887('0x8')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x5887('0x9'),'fields':[_0x5887('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index d883f55..f41e2d1 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 _0x8c6c=['../../config/utils','rpc','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x9af06d,_0x1b6c7d){var _0x69405c=function(_0x3dc85c){while(--_0x3dc85c){_0x9af06d['push'](_0x9af06d['shift']());}};_0x69405c(++_0x1b6c7d);}(_0x8c6c,0x1a0));var _0xc8c6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c6c[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xc8c6('0x0'));var moment=require('moment');var BPromise=require(_0xc8c6('0x1'));var rs=require(_0xc8c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8c6('0x3'))['db'];var utils=require(_0xc8c6('0x4'));var logger=require('../../config/logger')(_0xc8c6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc8c6('0x6'));var client=jayson[_0xc8c6('0x7')][_0xc8c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3afcf7,_0x5065aa,_0x272fdd){return new BPromise(function(_0x2603d0,_0x2d1f0e){return client['request'](_0x3afcf7,_0x272fdd)[_0xc8c6('0x9')](function(_0xaf5193){logger['info'](_0xc8c6('0xa'),_0x5065aa,'request\x20sent');logger[_0xc8c6('0xb')](_0xc8c6('0xc'),_0x5065aa,_0xc8c6('0xd'),JSON[_0xc8c6('0xe')](_0xaf5193));if(_0xaf5193[_0xc8c6('0xf')]){if(_0xaf5193[_0xc8c6('0xf')][_0xc8c6('0x10')]===0x1f4){logger[_0xc8c6('0xf')](_0xc8c6('0xa'),_0x5065aa,_0xaf5193[_0xc8c6('0xf')][_0xc8c6('0x11')]);return _0x2d1f0e(_0xaf5193[_0xc8c6('0xf')][_0xc8c6('0x11')]);}logger[_0xc8c6('0xf')](_0xc8c6('0xa'),_0x5065aa,_0xaf5193[_0xc8c6('0xf')]['message']);return _0x2603d0(_0xaf5193[_0xc8c6('0xf')][_0xc8c6('0x11')]);}else{logger[_0xc8c6('0x12')](_0xc8c6('0xa'),_0x5065aa,'request\x20sent');_0x2603d0(_0xaf5193['result'][_0xc8c6('0x11')]);}})[_0xc8c6('0x13')](function(_0x5b45a9){logger[_0xc8c6('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x5065aa,_0x5b45a9);_0x2d1f0e(_0x5b45a9);});});} \ No newline at end of file +var _0x8d40=['error','message','FaxTransferReport,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5e8fe9,_0x1d3d88){var _0x5158b9=function(_0x2686dd){while(--_0x2686dd){_0x5e8fe9['push'](_0x5e8fe9['shift']());}};_0x5158b9(++_0x1d3d88);}(_0x8d40,0x155));var _0x08d4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8d40[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x08d4('0x0'));var util=require(_0x08d4('0x1'));var moment=require(_0x08d4('0x2'));var BPromise=require(_0x08d4('0x3'));var rs=require(_0x08d4('0x4'));var fs=require('fs');var Redis=require(_0x08d4('0x5'));var db=require(_0x08d4('0x6'))['db'];var utils=require(_0x08d4('0x7'));var logger=require(_0x08d4('0x8'))(_0x08d4('0x9'));var config=require(_0x08d4('0xa'));var jayson=require(_0x08d4('0xb'));var client=jayson[_0x08d4('0xc')][_0x08d4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xe8e3f2,_0x3455e0,_0x51eb23){return new BPromise(function(_0x292ffd,_0xa861ef){return client[_0x08d4('0xe')](_0xe8e3f2,_0x51eb23)[_0x08d4('0xf')](function(_0x7462b0){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3455e0,_0x08d4('0x10'));logger[_0x08d4('0x11')](_0x08d4('0x12'),_0x3455e0,_0x08d4('0x10'),JSON['stringify'](_0x7462b0));if(_0x7462b0[_0x08d4('0x13')]){if(_0x7462b0[_0x08d4('0x13')]['code']===0x1f4){logger[_0x08d4('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x3455e0,_0x7462b0[_0x08d4('0x13')][_0x08d4('0x14')]);return _0xa861ef(_0x7462b0[_0x08d4('0x13')][_0x08d4('0x14')]);}logger[_0x08d4('0x13')](_0x08d4('0x15'),_0x3455e0,_0x7462b0['error'][_0x08d4('0x14')]);return _0x292ffd(_0x7462b0[_0x08d4('0x13')][_0x08d4('0x14')]);}else{logger[_0x08d4('0x16')]('FaxTransferReport,\x20%s,\x20%s',_0x3455e0,'request\x20sent');_0x292ffd(_0x7462b0['result']['message']);}})[_0x08d4('0x17')](function(_0x150992){logger[_0x08d4('0x13')](_0x08d4('0x15'),_0x3455e0,_0x150992);_0xa861ef(_0x150992);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 00759f8..b217bf6 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 _0xf2ca=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id'];(function(_0x576ad9,_0x4fa7d3){var _0x59a99e=function(_0x239446){while(--_0x239446){_0x576ad9['push'](_0x576ad9['shift']());}};_0x59a99e(++_0x4fa7d3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2ca[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get']('/',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xa')]);router[_0xaf2c('0xb')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xb')]('/:id',auth[_0xaf2c('0x9')](),controller['show']);router[_0xaf2c('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0x11'),auth[_0xaf2c('0x9')](),controller['update']);router['delete'](_0xaf2c('0x11'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router; \ No newline at end of file +var _0xae24=['isAuthenticated','index','/describe','/:id','post','put','update','destroy','multer','path','express','Router','../../config/environment','get'];(function(_0x55bf2a,_0x4d41e6){var _0x2d3b1e=function(_0x2fa6c0){while(--_0x2fa6c0){_0x55bf2a['push'](_0x55bf2a['shift']());}};_0x2d3b1e(++_0x4d41e6);}(_0xae24,0x182));var _0x4ae2=function(_0x4d34c3,_0x367475){_0x4d34c3=_0x4d34c3-0x0;var _0x29e9db=_0xae24[_0x4d34c3];return _0x29e9db;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ae2('0x4'));var controller=require('./faxTransferReport.controller');router[_0x4ae2('0x5')]('/',auth[_0x4ae2('0x6')](),controller[_0x4ae2('0x7')]);router[_0x4ae2('0x5')](_0x4ae2('0x8'),auth[_0x4ae2('0x6')](),controller['describe']);router['get'](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4ae2('0xa')]('/',auth[_0x4ae2('0x6')](),controller['create']);router[_0x4ae2('0xb')](_0x4ae2('0x9'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xc')]);router['delete'](_0x4ae2('0x9'),auth[_0x4ae2('0x6')](),controller[_0x4ae2('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 432d264..0c3f12f 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 _0x5daa=['/:id','show','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x146a97,_0x542454){var _0x4abc6c=function(_0x21d0e0){while(--_0x21d0e0){_0x146a97['push'](_0x146a97['shift']());}};_0x4abc6c(++_0x542454);}(_0x5daa,0x83));var _0xa5da=function(_0x372f7b,_0x440e4c){_0x372f7b=_0x372f7b-0x0;var _0x3512ff=_0x5daa[_0x372f7b];return _0x3512ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa5da('0x0'));var timeout=require(_0xa5da('0x1'));var express=require('express');var router=express[_0xa5da('0x2')]();var auth=require(_0xa5da('0x3'));var interaction=require(_0xa5da('0x4'));var config=require(_0xa5da('0x5'));var controller=require('./intDeskAccount.controller');router[_0xa5da('0x6')]('/',auth[_0xa5da('0x7')](),controller[_0xa5da('0x8')]);router[_0xa5da('0x6')](_0xa5da('0x9'),auth['isAuthenticated'](),controller[_0xa5da('0xa')]);router[_0xa5da('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xa5da('0x6')](_0xa5da('0xb'),auth[_0xa5da('0x7')](),controller[_0xa5da('0xc')]);router[_0xa5da('0xd')]('/',auth[_0xa5da('0x7')](),controller[_0xa5da('0xe')]);router[_0xa5da('0xd')]('/:id/configurations',auth[_0xa5da('0x7')](),controller[_0xa5da('0xf')]);router[_0xa5da('0x10')](_0xa5da('0x9'),auth[_0xa5da('0x7')](),controller[_0xa5da('0x11')]);router[_0xa5da('0x12')](_0xa5da('0x9'),auth[_0xa5da('0x7')](),controller['destroy']);module[_0xa5da('0x13')]=router; \ No newline at end of file +var _0xd621=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xd621,0x161));var _0x1d62=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xd621[_0xdaab62];return _0x13d767;};'use strict';var multer=require('multer');var util=require(_0x1d62('0x0'));var path=require('path');var timeout=require(_0x1d62('0x1'));var express=require(_0x1d62('0x2'));var router=express[_0x1d62('0x3')]();var auth=require(_0x1d62('0x4'));var interaction=require(_0x1d62('0x5'));var config=require(_0x1d62('0x6'));var controller=require(_0x1d62('0x7'));router[_0x1d62('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d62('0x8')](_0x1d62('0x9'),auth[_0x1d62('0xa')](),controller[_0x1d62('0xb')]);router[_0x1d62('0x8')](_0x1d62('0xc'),auth['isAuthenticated'](),controller[_0x1d62('0xd')]);router[_0x1d62('0x8')](_0x1d62('0xe'),auth[_0x1d62('0xa')](),controller['getFields']);router[_0x1d62('0xf')]('/',auth['isAuthenticated'](),controller[_0x1d62('0x10')]);router['post'](_0x1d62('0xc'),auth['isAuthenticated'](),controller[_0x1d62('0x11')]);router[_0x1d62('0x12')]('/:id',auth[_0x1d62('0xa')](),controller['update']);router[_0x1d62('0x13')](_0x1d62('0x9'),auth[_0x1d62('0xa')](),controller[_0x1d62('0x14')]);module[_0x1d62('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 0d13986..b698089 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 _0x22fe=['newTab','sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22fe,0x1b1));var _0xe22f=function(_0x5dc501,_0x4f8b81){_0x5dc501=_0x5dc501-0x0;var _0x493952=_0x22fe[_0x5dc501];return _0x493952;};'use strict';var Sequelize=require(_0xe22f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe22f('0x1')]},'remoteUri':{'type':Sequelize[_0xe22f('0x1')]},'authType':{'type':Sequelize[_0xe22f('0x2')]('basic'),'defaultValue':_0xe22f('0x3')},'password':{'type':Sequelize[_0xe22f('0x1')]},'consumerKey':{'type':Sequelize[_0xe22f('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe22f('0x1')]},'tokenSecret':{'type':Sequelize[_0xe22f('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe22f('0x2')](_0xe22f('0x4'),_0xe22f('0x5')),'defaultValue':_0xe22f('0x4')}}; \ No newline at end of file +var _0x64f5=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x1774f2,_0x4da78e){var _0x38273c=function(_0x3d164e){while(--_0x3d164e){_0x1774f2['push'](_0x1774f2['shift']());}};_0x38273c(++_0x4da78e);}(_0x64f5,0x1c0));var _0x564f=function(_0x410c86,_0x1a414c){_0x410c86=_0x410c86-0x0;var _0x570dde=_0x64f5[_0x410c86];return _0x570dde;};'use strict';var Sequelize=require(_0x564f('0x0'));module[_0x564f('0x1')]={'name':{'type':Sequelize[_0x564f('0x2')]},'description':{'type':Sequelize[_0x564f('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x564f('0x2')]},'authType':{'type':Sequelize[_0x564f('0x3')](_0x564f('0x4')),'defaultValue':_0x564f('0x4')},'password':{'type':Sequelize[_0x564f('0x2')]},'consumerKey':{'type':Sequelize[_0x564f('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x564f('0x2')]},'tokenSecret':{'type':Sequelize[_0x564f('0x2')]},'serverUrl':{'type':Sequelize[_0x564f('0x2')]},'type':{'type':Sequelize[_0x564f('0x3')](_0x564f('0x5'),_0x564f('0x6')),'defaultValue':_0x564f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index dbd2bbe..931f126 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 _0xd8b0=['findAll','rows','show','params','rawAttributes','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','options','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','%s/custom_fields','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','map','active','label','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','limit','set','json','save','destroy','stack','name','index','DeskAccount','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','field','count','include'];(function(_0x53c7ac,_0x3c62b6){var _0x22940a=function(_0xc1c638){while(--_0xc1c638){_0x53c7ac['push'](_0x53c7ac['shift']());}};_0x22940a(++_0x3c62b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];var integrations=require(_0x0d8b('0x15'));var jayson=require(_0x0d8b('0x16'));var client=jayson[_0x0d8b('0x17')][_0x0d8b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x32bb1a,_0x15dd0f,_0x31a8cc){if(_0x31a8cc){var _0x1d4bbc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d4bbc[_0x0d8b('0x19')](_0x15dd0f)){return _0x32bb1a;}else{throw new Error(_0x0d8b('0x1a'));}}else{return _0x32bb1a;}}function respondWithRpcPromise(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){var _0x17f7df=_0x4f6f21||client;return _0x17f7df[_0x0d8b('0x1b')](_0xe65334,_0x2d4e1c)[_0x0d8b('0x1c')](function(_0x5cd485){logger[_0x0d8b('0x1d')](_0x0d8b('0x1e'),_0x1567ce,_0x0d8b('0x1f'));logger[_0x0d8b('0x20')](_0x0d8b('0x21'),_0x1567ce,_0x0d8b('0x1f'),JSON[_0x0d8b('0x22')](_0x5cd485));if(_0x5cd485[_0x0d8b('0x23')]){if(_0x5cd485['error'][_0x0d8b('0x24')]===0x1f4){logger[_0x0d8b('0x23')](_0x0d8b('0x1e'),_0x1567ce,_0x5cd485[_0x0d8b('0x23')][_0x0d8b('0x25')]);return _0xa86349(_0x5cd485[_0x0d8b('0x23')][_0x0d8b('0x25')]);}logger[_0x0d8b('0x23')]('DeskAccount,\x20%s,\x20%s',_0x1567ce,_0x5cd485['error'][_0x0d8b('0x25')]);return _0x23eb7b(_0x5cd485['error']['message']);}else{logger['info'](_0x0d8b('0x1e'),_0x1567ce,_0x0d8b('0x1f'));_0x23eb7b(_0x5cd485[_0x0d8b('0x26')][_0x0d8b('0x25')]);}})[_0x0d8b('0x27')](function(_0x2c64e2){logger[_0x0d8b('0x23')](_0x0d8b('0x1e'),_0x1567ce,_0x2c64e2);_0xa86349(_0x2c64e2);});});}function respondWithStatusCode(_0x27b695,_0x5e5bc3){_0x5e5bc3=_0x5e5bc3||0xcc;return function(_0xe8bbee){if(_0xe8bbee){return _0x27b695[_0x0d8b('0x28')](_0x5e5bc3);}return _0x27b695['status'](_0x5e5bc3)[_0x0d8b('0x29')]();};}function respondWithResult(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0xc8;return function(_0x234bdd){if(_0x234bdd){return _0x4a0ae4[_0x0d8b('0x2a')](_0x3dd149)['json'](_0x234bdd);}};}function respondWithFilteredResult(_0x59a905,_0x28f639){return function(_0x3ef745){if(_0x3ef745){var _0x4c05ee=_0x3ef745['count'],_0xcbc4ac=_0x28f639[_0x0d8b('0x2b')],_0x59aa83=_0x28f639['offset']+_0x28f639[_0x0d8b('0x2c')],_0x1b2b59;if(_0x59aa83>=_0x4c05ee){_0x59aa83=_0x4c05ee;_0x1b2b59=0xc8;}else{_0x1b2b59=0xce;}_0x59a905['status'](_0x1b2b59);return _0x59a905[_0x0d8b('0x2d')]('Content-Range',_0xcbc4ac+'-'+_0x59aa83+'/'+_0x4c05ee)[_0x0d8b('0x2e')](_0x3ef745);}return null;};}function patchUpdates(_0x106e4c){return function(_0x2c058d){try{jsonpatch['apply'](_0x2c058d,_0x106e4c,!![]);}catch(_0x4c80a2){return BPromise['reject'](_0x4c80a2);}return _0x2c058d[_0x0d8b('0x2f')]();};}function saveUpdates(_0x5515d2,_0x3cdf3c){return function(_0x54f6f3){if(_0x54f6f3){return _0x54f6f3['update'](_0x5515d2)[_0x0d8b('0x1c')](function(_0x1b6920){return _0x1b6920;});}return null;};}function removeEntity(_0x109c14,_0xdeee5d){return function(_0x183220){if(_0x183220){return _0x183220[_0x0d8b('0x30')]()[_0x0d8b('0x1c')](function(){_0x109c14[_0x0d8b('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ca42,_0x3ef48d){return function(_0x4b3ea0){if(!_0x4b3ea0){_0x37ca42[_0x0d8b('0x28')](0x194);}return _0x4b3ea0;};}function handleError(_0x23f7f6,_0x18a905){_0x18a905=_0x18a905||0x1f4;return function(_0x4f2ed2){logger[_0x0d8b('0x23')](_0x4f2ed2[_0x0d8b('0x31')]);if(_0x4f2ed2[_0x0d8b('0x32')]){delete _0x4f2ed2[_0x0d8b('0x32')];}_0x23f7f6[_0x0d8b('0x2a')](_0x18a905)['send'](_0x4f2ed2);};}exports[_0x0d8b('0x33')]=function(_0x1649fc,_0x5ad0fe){var _0x1180ac={},_0x3cc3ee={},_0x188af2={'count':0x0,'rows':[]};var _0x974b9b=db[_0x0d8b('0x34')]['rawAttributes'];_0x3cc3ee['model']=_[_0x0d8b('0x35')](_0x974b9b);_0x3cc3ee['query']=_['keys'](_0x1649fc[_0x0d8b('0x36')]);_0x3cc3ee[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x3cc3ee[_0x0d8b('0x39')],_0x3cc3ee[_0x0d8b('0x36')]);_0x1180ac[_0x0d8b('0x3a')]=_['intersection'](_0x3cc3ee[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x3b')]));_0x1180ac[_0x0d8b('0x3a')]=_0x1180ac[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0x1180ac['attributes']:_0x3cc3ee[_0x0d8b('0x39')];if(!_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x3d')](_0x0d8b('0x3e'))){_0x1180ac['limit']=qs[_0x0d8b('0x2c')](_0x1649fc['query'][_0x0d8b('0x2c')]);_0x1180ac[_0x0d8b('0x2b')]=qs[_0x0d8b('0x2b')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x2b')]);}_0x1180ac[_0x0d8b('0x3f')]=qs[_0x0d8b('0x40')](_0x1649fc[_0x0d8b('0x36')][_0x0d8b('0x40')]);_0x1180ac[_0x0d8b('0x41')]=qs['filters'](_['pick'](_0x1649fc['query'],_0x3cc3ee['filters']));if(_0x1649fc['query'][_0x0d8b('0x42')]){_0x1180ac[_0x0d8b('0x41')]=_[_0x0d8b('0x43')](_0x1180ac['where'],{'$or':_['map'](_0x974b9b,function(_0x1b216d){if(_0x1b216d[_0x0d8b('0x44')][_0x0d8b('0x45')]!=='VIRTUAL'){var _0x214583={};_0x214583[_0x1b216d[_0x0d8b('0x46')]]={'$like':'%'+_0x1649fc['query']['filter']+'%'};return _0x214583;}})});}_0x1180ac=_[_0x0d8b('0x43')]({},_0x1180ac,_0x1649fc['options']);var _0x1e22e5={'where':_0x1180ac['where']};return db['DeskAccount'][_0x0d8b('0x47')](_0x1e22e5)[_0x0d8b('0x1c')](function(_0x5a75c7){_0x188af2['count']=_0x5a75c7;if(_0x1649fc['query']['includeAll']){_0x1180ac[_0x0d8b('0x48')]=[{'all':!![]}];}return db[_0x0d8b('0x34')][_0x0d8b('0x49')](_0x1180ac);})['then'](function(_0xb0910e){_0x188af2[_0x0d8b('0x4a')]=_0xb0910e;return _0x188af2;})[_0x0d8b('0x1c')](respondWithFilteredResult(_0x5ad0fe,_0x1180ac))[_0x0d8b('0x27')](handleError(_0x5ad0fe,null));};exports[_0x0d8b('0x4b')]=function(_0x2d5246,_0x11d22b){var _0x1d5067={'raw':![],'where':{'id':_0x2d5246[_0x0d8b('0x4c')]['id']}},_0x384a5e={};_0x384a5e[_0x0d8b('0x39')]=_[_0x0d8b('0x35')](db[_0x0d8b('0x34')][_0x0d8b('0x4d')]);_0x384a5e[_0x0d8b('0x36')]=_[_0x0d8b('0x35')](_0x2d5246[_0x0d8b('0x36')]);_0x384a5e[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x384a5e['model'],_0x384a5e[_0x0d8b('0x36')]);_0x1d5067['attributes']=_['intersection'](_0x384a5e[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0x2d5246[_0x0d8b('0x36')][_0x0d8b('0x3b')]));_0x1d5067['attributes']=_0x1d5067[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0x1d5067[_0x0d8b('0x3a')]:_0x384a5e[_0x0d8b('0x39')];if(_0x2d5246[_0x0d8b('0x36')]['includeAll']){_0x1d5067['include']=[{'all':!![]}];}_0x1d5067=_['merge']({},_0x1d5067,_0x2d5246['options']);return db[_0x0d8b('0x34')][_0x0d8b('0x4e')](_0x1d5067)['then'](handleEntityNotFound(_0x11d22b,null))['then'](respondWithResult(_0x11d22b,null))[_0x0d8b('0x27')](handleError(_0x11d22b,null));};exports[_0x0d8b('0x4f')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x34')][_0x0d8b('0x4f')](_0x5c5bd7[_0x0d8b('0x50')],{})[_0x0d8b('0x1c')](respondWithResult(_0x5ef6c3,0xc9))[_0x0d8b('0x27')](handleError(_0x5ef6c3,null));};exports['update']=function(_0x2de903,_0x2afe34){if(_0x2de903['body']['id']){delete _0x2de903['body']['id'];}return db[_0x0d8b('0x34')][_0x0d8b('0x4e')]({'where':{'id':_0x2de903['params']['id']}})['then'](handleEntityNotFound(_0x2afe34,null))[_0x0d8b('0x1c')](saveUpdates(_0x2de903[_0x0d8b('0x50')],null))[_0x0d8b('0x1c')](respondWithResult(_0x2afe34,null))[_0x0d8b('0x27')](handleError(_0x2afe34,null));};exports['destroy']=function(_0x356b3d,_0x598e03){return db['DeskAccount'][_0x0d8b('0x4e')]({'where':{'id':_0x356b3d[_0x0d8b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x598e03,null))['then'](removeEntity(_0x598e03,null))[_0x0d8b('0x27')](handleError(_0x598e03,null));};exports[_0x0d8b('0x51')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76={};var _0x3978e5={};var _0x3bead7;var _0x5418d8;return db[_0x0d8b('0x34')][_0x0d8b('0x52')]({'where':{'id':_0xccc2a9[_0x0d8b('0x4c')]['id']}})[_0x0d8b('0x1c')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x1c')](function(_0x47104e){if(_0x47104e){_0x3bead7=_0x47104e;_0x3978e5[_0x0d8b('0x39')]=_[_0x0d8b('0x35')](db[_0x0d8b('0x53')]['rawAttributes']);_0x3978e5[_0x0d8b('0x36')]=_[_0x0d8b('0x35')](_0xccc2a9[_0x0d8b('0x36')]);_0x3978e5[_0x0d8b('0x37')]=_[_0x0d8b('0x38')](_0x3978e5['model'],_0x3978e5[_0x0d8b('0x36')]);_0xb66e76[_0x0d8b('0x3a')]=_[_0x0d8b('0x38')](_0x3978e5[_0x0d8b('0x39')],qs[_0x0d8b('0x3b')](_0xccc2a9['query']['fields']));_0xb66e76[_0x0d8b('0x3a')]=_0xb66e76[_0x0d8b('0x3a')][_0x0d8b('0x3c')]?_0xb66e76[_0x0d8b('0x3a')]:_0x3978e5['model'];_0xb66e76[_0x0d8b('0x3f')]=qs[_0x0d8b('0x40')](_0xccc2a9[_0x0d8b('0x36')]['sort']);_0xb66e76[_0x0d8b('0x41')]=qs['filters'](_[_0x0d8b('0x54')](_0xccc2a9[_0x0d8b('0x36')],_0x3978e5[_0x0d8b('0x37')]));if(_0xccc2a9[_0x0d8b('0x36')][_0x0d8b('0x42')]){_0xb66e76[_0x0d8b('0x41')]=_['merge'](_0xb66e76[_0x0d8b('0x41')],{'$or':_['map'](_0xb66e76[_0x0d8b('0x3a')],function(_0x4577c8){var _0xafeeb0={};_0xafeeb0[_0x4577c8]={'$like':'%'+_0xccc2a9[_0x0d8b('0x36')]['filter']+'%'};return _0xafeeb0;})});}_0xb66e76=_[_0x0d8b('0x43')]({},_0xb66e76,_0xccc2a9[_0x0d8b('0x55')]);return _0x3bead7[_0x0d8b('0x51')](_0xb66e76);}})[_0x0d8b('0x1c')](function(_0x2ccdae){if(_0x2ccdae){_0x5418d8=_0x2ccdae[_0x0d8b('0x3c')];if(!_0xccc2a9[_0x0d8b('0x36')][_0x0d8b('0x3d')](_0x0d8b('0x3e'))){_0xb66e76[_0x0d8b('0x2c')]=qs['limit'](_0xccc2a9['query'][_0x0d8b('0x2c')]);_0xb66e76[_0x0d8b('0x2b')]=qs['offset'](_0xccc2a9[_0x0d8b('0x36')]['offset']);}return _0x3bead7['getConfigurations'](_0xb66e76);}})[_0x0d8b('0x1c')](function(_0x1c4e96){if(_0x1c4e96){return _0x1c4e96?{'count':_0x5418d8,'rows':_0x1c4e96}:null;}})['then'](respondWithResult(_0x2c1eb0,null))['catch'](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x56')]=function(_0x1c007b,_0x70e4b2,_0x435090){if(_0x1c007b[_0x0d8b('0x50')]['id']){delete _0x1c007b[_0x0d8b('0x50')]['id'];}return db[_0x0d8b('0x34')]['findOne']({'where':{'id':_0x1c007b[_0x0d8b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70e4b2,null))[_0x0d8b('0x1c')](function(_0x2c6242){if(_0x2c6242){_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x57')]=_0x2c6242['id'];_0x1c007b['body'][_0x0d8b('0x58')]=integrations['getSubjects'](_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x59')],_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x44')]);_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x5a')]=integrations[_0x0d8b('0x5b')](_0x1c007b[_0x0d8b('0x50')][_0x0d8b('0x59')],_0x1c007b[_0x0d8b('0x50')]['type']);return db[_0x0d8b('0x53')]['create'](_0x1c007b[_0x0d8b('0x50')],{'include':[{'model':db[_0x0d8b('0x5c')],'as':'Subjects'},{'model':db[_0x0d8b('0x5c')],'as':'Descriptions'}]});}return null;})[_0x0d8b('0x1c')](respondWithResult(_0x70e4b2,null))[_0x0d8b('0x27')](handleError(_0x70e4b2,null));};exports[_0x0d8b('0x5d')]=function(_0x259ac9,_0x2242cd,_0x299f98){var _0x3a073b=[{'name':_0x0d8b('0x5e'),'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 _0x10eca6='';return db[_0x0d8b('0x34')]['findOne']({'where':{'id':_0x259ac9[_0x0d8b('0x4c')]['id']},'attributes':['id',_0x0d8b('0x5f'),_0x0d8b('0x60'),_0x0d8b('0x61'),_0x0d8b('0x62'),_0x0d8b('0x63'),_0x0d8b('0x64'),_0x0d8b('0x65'),_0x0d8b('0x66')]})[_0x0d8b('0x1c')](handleEntityNotFound(_0x2242cd,null))[_0x0d8b('0x1c')](function(_0x16df83){if(_0x16df83){_0x10eca6=_0x16df83['remoteUri'];var _0x1ece98=_0x10eca6[_0x0d8b('0x67')](-0x1);if(_0x1ece98==='/'){_0x10eca6=_0x10eca6[_0x0d8b('0x68')](0x0,_0x10eca6['lastIndexOf'](_0x1ece98));}var _0x5db3b4={'method':_0x0d8b('0x69'),'uri':util[_0x0d8b('0x6a')](_0x0d8b('0x6b'),_0x10eca6),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x16df83[_0x0d8b('0x60')]===_0x0d8b('0x6c')){_0x5db3b4[_0x0d8b('0x6d')][_0x0d8b('0x6e')]=util[_0x0d8b('0x6a')](_0x0d8b('0x6f'),new Buffer(util[_0x0d8b('0x6a')](_0x0d8b('0x70'),_0x16df83[_0x0d8b('0x61')],_0x16df83[_0x0d8b('0x62')]))[_0x0d8b('0x71')](_0x0d8b('0x72')));}return rp(_0x5db3b4)[_0x0d8b('0x1c')](function(_0x5dbc6b){return _0x3a073b[_0x0d8b('0x73')](_[_0x0d8b('0x74')](_0x5dbc6b['_embedded']['entries'],function(_0x1a1029){return{'id':_0x1a1029[_0x0d8b('0x32')],'name':_0x1a1029[_0x0d8b('0x32')],'type':_0x1a1029[_0x0d8b('0x44')],'active':_0x1a1029[_0x0d8b('0x75')],'label':_0x1a1029[_0x0d8b('0x76')],'custom':!![]};}));});}})['then'](function(_0x502715){return{'count':_0x502715['length'],'rows':_0x502715};})[_0x0d8b('0x1c')](respondWithResult(_0x2242cd,null))[_0x0d8b('0x27')](function(_0x466442){var _0x28f9b7=_0x259ac9[_0x0d8b('0x36')][_0x0d8b('0x19')]?0x1f4:_0x466442['statusCode']||0x1f4;logger[_0x0d8b('0x23')](_0x0d8b('0x77'),'getFields',_0x28f9b7,JSON[_0x0d8b('0x22')](_0x466442));delete _0x466442['name'];if(_0x28f9b7===0x191){_0x28f9b7=0x190;}_0x2242cd[_0x0d8b('0x2a')](_0x28f9b7)[_0x0d8b('0x78')](_0x259ac9[_0x0d8b('0x36')][_0x0d8b('0x19')]?{'message':_0x0d8b('0x79'),'statusCode':_0x466442[_0x0d8b('0x7a')]}:_0x466442);});}; \ No newline at end of file +var _0xb10b=['includeAll','findAll','rows','show','params','intersection','include','find','create','body','update','getConfigurations','DeskConfiguration','map','nolimit','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','reject','then','destroy','sendStatus','name','send','DeskAccount','rawAttributes','model','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','field','merge','options'];(function(_0x54b56d,_0x43cee0){var _0x29e581=function(_0x2d0f0f){while(--_0x2d0f0f){_0x54b56d['push'](_0x54b56d['shift']());}};_0x29e581(++_0x43cee0);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c3bd9,_0x45f815){_0x2c3bd9=_0x2c3bd9-0x0;var _0x112e55=_0xb10b[_0x2c3bd9];return _0x112e55;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');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('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xbb10('0x18'));var client=jayson[_0xbb10('0x19')][_0xbb10('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x193a27,_0x442548,_0x147230){if(_0x147230){var _0x58a612=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58a612[_0xbb10('0x1b')](_0x442548)){return _0x193a27;}else{throw new Error(_0xbb10('0x1c'));}}else{return _0x193a27;}}function respondWithRpcPromise(_0x45b9d6,_0x17fd46,_0x3df17b,_0x2f2ebf){return new BPromise(function(_0x24a57b,_0x36b5e8){var _0x3e26f4=_0x2f2ebf||client;return _0x3e26f4[_0xbb10('0x1d')](_0x45b9d6,_0x3df17b)['then'](function(_0x2eca0f){logger[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x17fd46,_0xbb10('0x20'));logger[_0xbb10('0x21')](_0xbb10('0x22'),_0x17fd46,_0xbb10('0x20'),JSON[_0xbb10('0x23')](_0x2eca0f));if(_0x2eca0f[_0xbb10('0x24')]){if(_0x2eca0f[_0xbb10('0x24')]['code']===0x1f4){logger[_0xbb10('0x24')](_0xbb10('0x1f'),_0x17fd46,_0x2eca0f[_0xbb10('0x24')][_0xbb10('0x25')]);return _0x36b5e8(_0x2eca0f[_0xbb10('0x24')][_0xbb10('0x25')]);}logger['error'](_0xbb10('0x1f'),_0x17fd46,_0x2eca0f[_0xbb10('0x24')]['message']);return _0x24a57b(_0x2eca0f['error'][_0xbb10('0x25')]);}else{logger[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x17fd46,_0xbb10('0x20'));_0x24a57b(_0x2eca0f[_0xbb10('0x26')][_0xbb10('0x25')]);}})[_0xbb10('0x27')](function(_0x436104){logger[_0xbb10('0x24')](_0xbb10('0x1f'),_0x17fd46,_0x436104);_0x36b5e8(_0x436104);});});}function respondWithStatusCode(_0x3ba6cd,_0x26ad93){_0x26ad93=_0x26ad93||0xcc;return function(_0x537898){if(_0x537898){return _0x3ba6cd['sendStatus'](_0x26ad93);}return _0x3ba6cd['status'](_0x26ad93)[_0xbb10('0x28')]();};}function respondWithResult(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xc8;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x29')](_0x2c89b9)[_0xbb10('0x2a')](_0x4e25ff);}};}function respondWithFilteredResult(_0x6ed43b,_0x1d5e95){return function(_0x1acce9){if(_0x1acce9){var _0x20d946=_0x1acce9[_0xbb10('0x2b')],_0x2a0e8b=_0x1d5e95[_0xbb10('0x2c')],_0x4aabb9=_0x1d5e95[_0xbb10('0x2c')]+_0x1d5e95[_0xbb10('0x2d')],_0x3796c7;if(_0x4aabb9>=_0x20d946){_0x4aabb9=_0x20d946;_0x3796c7=0xc8;}else{_0x3796c7=0xce;}_0x6ed43b[_0xbb10('0x29')](_0x3796c7);return _0x6ed43b['set'](_0xbb10('0x2e'),_0x2a0e8b+'-'+_0x4aabb9+'/'+_0x20d946)['json'](_0x1acce9);}return null;};}function patchUpdates(_0x448d5c){return function(_0x56f2da){try{jsonpatch[_0xbb10('0x2f')](_0x56f2da,_0x448d5c,!![]);}catch(_0x1dcc9c){return BPromise[_0xbb10('0x30')](_0x1dcc9c);}return _0x56f2da['save']();};}function saveUpdates(_0x518d47,_0x4c3744){return function(_0x34f65e){if(_0x34f65e){return _0x34f65e['update'](_0x518d47)[_0xbb10('0x31')](function(_0x37dde7){return _0x37dde7;});}return null;};}function removeEntity(_0x2f653f,_0x1c0b57){return function(_0x37a83f){if(_0x37a83f){return _0x37a83f[_0xbb10('0x32')]()[_0xbb10('0x31')](function(){_0x2f653f['status'](0xcc)[_0xbb10('0x28')]();});}};}function handleEntityNotFound(_0x1da9c9,_0x441d15){return function(_0x8c1ce6){if(!_0x8c1ce6){_0x1da9c9[_0xbb10('0x33')](0x194);}return _0x8c1ce6;};}function handleError(_0x9de708,_0x188cbd){_0x188cbd=_0x188cbd||0x1f4;return function(_0x10202c){logger[_0xbb10('0x24')](_0x10202c['stack']);if(_0x10202c[_0xbb10('0x34')]){delete _0x10202c[_0xbb10('0x34')];}_0x9de708[_0xbb10('0x29')](_0x188cbd)[_0xbb10('0x35')](_0x10202c);};}exports['index']=function(_0x111762,_0x5de37b){var _0x4e2754={},_0x3eb3cc={},_0x40c164={'count':0x0,'rows':[]};var _0x26e76a=db[_0xbb10('0x36')][_0xbb10('0x37')];_0x3eb3cc[_0xbb10('0x38')]=_['keys'](_0x26e76a);_0x3eb3cc[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x111762['query']);_0x3eb3cc['filters']=_['intersection'](_0x3eb3cc[_0xbb10('0x38')],_0x3eb3cc[_0xbb10('0x39')]);_0x4e2754[_0xbb10('0x3b')]=_['intersection'](_0x3eb3cc[_0xbb10('0x38')],qs[_0xbb10('0x3c')](_0x111762[_0xbb10('0x39')]['fields']));_0x4e2754[_0xbb10('0x3b')]=_0x4e2754[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x4e2754[_0xbb10('0x3b')]:_0x3eb3cc['model'];if(!_0x111762[_0xbb10('0x39')][_0xbb10('0x3e')]('nolimit')){_0x4e2754[_0xbb10('0x2d')]=qs[_0xbb10('0x2d')](_0x111762[_0xbb10('0x39')][_0xbb10('0x2d')]);_0x4e2754[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x111762['query'][_0xbb10('0x2c')]);}_0x4e2754[_0xbb10('0x3f')]=qs[_0xbb10('0x40')](_0x111762[_0xbb10('0x39')]['sort']);_0x4e2754[_0xbb10('0x41')]=qs[_0xbb10('0x42')](_[_0xbb10('0x43')](_0x111762[_0xbb10('0x39')],_0x3eb3cc['filters']));if(_0x111762[_0xbb10('0x39')][_0xbb10('0x44')]){_0x4e2754['where']=_['merge'](_0x4e2754[_0xbb10('0x41')],{'$or':_['map'](_0x26e76a,function(_0x318984){if(_0x318984[_0xbb10('0x45')]['key']!==_0xbb10('0x46')){var _0x1d82bf={};_0x1d82bf[_0x318984[_0xbb10('0x47')]]={'$like':'%'+_0x111762['query'][_0xbb10('0x44')]+'%'};return _0x1d82bf;}})});}_0x4e2754=_[_0xbb10('0x48')]({},_0x4e2754,_0x111762[_0xbb10('0x49')]);var _0x32b729={'where':_0x4e2754[_0xbb10('0x41')]};return db[_0xbb10('0x36')][_0xbb10('0x2b')](_0x32b729)[_0xbb10('0x31')](function(_0x205bb4){_0x40c164[_0xbb10('0x2b')]=_0x205bb4;if(_0x111762[_0xbb10('0x39')][_0xbb10('0x4a')]){_0x4e2754['include']=[{'all':!![]}];}return db[_0xbb10('0x36')][_0xbb10('0x4b')](_0x4e2754);})['then'](function(_0x14e1cb){_0x40c164[_0xbb10('0x4c')]=_0x14e1cb;return _0x40c164;})[_0xbb10('0x31')](respondWithFilteredResult(_0x5de37b,_0x4e2754))[_0xbb10('0x27')](handleError(_0x5de37b,null));};exports[_0xbb10('0x4d')]=function(_0x39f0de,_0x3e06b0){var _0x5be85e={'raw':![],'where':{'id':_0x39f0de[_0xbb10('0x4e')]['id']}},_0x4a9793={};_0x4a9793[_0xbb10('0x38')]=_[_0xbb10('0x3a')](db['DeskAccount']['rawAttributes']);_0x4a9793[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x39f0de[_0xbb10('0x39')]);_0x4a9793[_0xbb10('0x42')]=_[_0xbb10('0x4f')](_0x4a9793[_0xbb10('0x38')],_0x4a9793[_0xbb10('0x39')]);_0x5be85e[_0xbb10('0x3b')]=_[_0xbb10('0x4f')](_0x4a9793[_0xbb10('0x38')],qs['fields'](_0x39f0de['query'][_0xbb10('0x3c')]));_0x5be85e[_0xbb10('0x3b')]=_0x5be85e[_0xbb10('0x3b')][_0xbb10('0x3d')]?_0x5be85e[_0xbb10('0x3b')]:_0x4a9793[_0xbb10('0x38')];if(_0x39f0de[_0xbb10('0x39')][_0xbb10('0x4a')]){_0x5be85e[_0xbb10('0x50')]=[{'all':!![]}];}_0x5be85e=_[_0xbb10('0x48')]({},_0x5be85e,_0x39f0de[_0xbb10('0x49')]);return db[_0xbb10('0x36')][_0xbb10('0x51')](_0x5be85e)[_0xbb10('0x31')](handleEntityNotFound(_0x3e06b0,null))[_0xbb10('0x31')](respondWithResult(_0x3e06b0,null))['catch'](handleError(_0x3e06b0,null));};exports[_0xbb10('0x52')]=function(_0x5bd44d,_0x33d60a){return db[_0xbb10('0x36')][_0xbb10('0x52')](_0x5bd44d[_0xbb10('0x53')],{})[_0xbb10('0x31')](respondWithResult(_0x33d60a,0xc9))[_0xbb10('0x27')](handleError(_0x33d60a,null));};exports[_0xbb10('0x54')]=function(_0x44eec1,_0x180400){if(_0x44eec1[_0xbb10('0x53')]['id']){delete _0x44eec1[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x36')][_0xbb10('0x51')]({'where':{'id':_0x44eec1[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x180400,null))['then'](saveUpdates(_0x44eec1[_0xbb10('0x53')],null))[_0xbb10('0x31')](respondWithResult(_0x180400,null))[_0xbb10('0x27')](handleError(_0x180400,null));};exports[_0xbb10('0x32')]=function(_0xbffa3c,_0x379d8c){return db['DeskAccount'][_0xbb10('0x51')]({'where':{'id':_0xbffa3c[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x379d8c,null))[_0xbb10('0x31')](removeEntity(_0x379d8c,null))[_0xbb10('0x27')](handleError(_0x379d8c,null));};exports[_0xbb10('0x55')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb={};var _0x2eb05a={};var _0x2a1ce1;var _0x16932f;return db['DeskAccount']['findOne']({'where':{'id':_0x175872[_0xbb10('0x4e')]['id']}})[_0xbb10('0x31')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x31')](function(_0x8b0a7d){if(_0x8b0a7d){_0x2a1ce1=_0x8b0a7d;_0x2eb05a['model']=_['keys'](db[_0xbb10('0x56')][_0xbb10('0x37')]);_0x2eb05a[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x175872[_0xbb10('0x39')]);_0x2eb05a[_0xbb10('0x42')]=_[_0xbb10('0x4f')](_0x2eb05a['model'],_0x2eb05a[_0xbb10('0x39')]);_0x40c4fb[_0xbb10('0x3b')]=_['intersection'](_0x2eb05a['model'],qs['fields'](_0x175872[_0xbb10('0x39')][_0xbb10('0x3c')]));_0x40c4fb[_0xbb10('0x3b')]=_0x40c4fb['attributes']['length']?_0x40c4fb['attributes']:_0x2eb05a[_0xbb10('0x38')];_0x40c4fb[_0xbb10('0x3f')]=qs[_0xbb10('0x40')](_0x175872['query'][_0xbb10('0x40')]);_0x40c4fb[_0xbb10('0x41')]=qs['filters'](_['pick'](_0x175872[_0xbb10('0x39')],_0x2eb05a[_0xbb10('0x42')]));if(_0x175872[_0xbb10('0x39')][_0xbb10('0x44')]){_0x40c4fb['where']=_[_0xbb10('0x48')](_0x40c4fb[_0xbb10('0x41')],{'$or':_[_0xbb10('0x57')](_0x40c4fb['attributes'],function(_0x402a01){var _0x2f05bc={};_0x2f05bc[_0x402a01]={'$like':'%'+_0x175872[_0xbb10('0x39')]['filter']+'%'};return _0x2f05bc;})});}_0x40c4fb=_[_0xbb10('0x48')]({},_0x40c4fb,_0x175872[_0xbb10('0x49')]);return _0x2a1ce1[_0xbb10('0x55')](_0x40c4fb);}})[_0xbb10('0x31')](function(_0x5e4a6e){if(_0x5e4a6e){_0x16932f=_0x5e4a6e[_0xbb10('0x3d')];if(!_0x175872[_0xbb10('0x39')][_0xbb10('0x3e')](_0xbb10('0x58'))){_0x40c4fb['limit']=qs[_0xbb10('0x2d')](_0x175872[_0xbb10('0x39')][_0xbb10('0x2d')]);_0x40c4fb[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x175872[_0xbb10('0x39')][_0xbb10('0x2c')]);}return _0x2a1ce1['getConfigurations'](_0x40c4fb);}})['then'](function(_0x5acd5e){if(_0x5acd5e){return _0x5acd5e?{'count':_0x16932f,'rows':_0x5acd5e}:null;}})[_0xbb10('0x31')](respondWithResult(_0x12ec18,null))[_0xbb10('0x27')](handleError(_0x12ec18,null));};exports[_0xbb10('0x59')]=function(_0x5c9afc,_0x5cd089,_0x46f462){if(_0x5c9afc[_0xbb10('0x53')]['id']){delete _0x5c9afc[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x36')][_0xbb10('0x5a')]({'where':{'id':_0x5c9afc[_0xbb10('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cd089,null))[_0xbb10('0x31')](function(_0x15fae2){if(_0x15fae2){_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x5b')]=_0x15fae2['id'];_0x5c9afc[_0xbb10('0x53')]['Subjects']=integrations['getSubjects'](_0x5c9afc['body'][_0xbb10('0x5c')],_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x45')]);_0x5c9afc[_0xbb10('0x53')][_0xbb10('0x5d')]=integrations[_0xbb10('0x5e')](_0x5c9afc['body'][_0xbb10('0x5c')],_0x5c9afc['body']['type']);return db['DeskConfiguration'][_0xbb10('0x52')](_0x5c9afc[_0xbb10('0x53')],{'include':[{'model':db[_0xbb10('0x5f')],'as':_0xbb10('0x60')},{'model':db['DeskField'],'as':_0xbb10('0x5d')}]});}return null;})['then'](respondWithResult(_0x5cd089,null))['catch'](handleError(_0x5cd089,null));};exports[_0xbb10('0x61')]=function(_0xfe3db0,_0x29529c,_0x2bd2ab){var _0xfa3c7c=[{'name':'priority','label':_0xbb10('0x62'),'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 _0x19fcec='';return db[_0xbb10('0x36')][_0xbb10('0x5a')]({'where':{'id':_0xfe3db0[_0xbb10('0x4e')]['id']},'attributes':['id',_0xbb10('0x63'),_0xbb10('0x64'),'username',_0xbb10('0x65'),_0xbb10('0x66'),_0xbb10('0x67'),_0xbb10('0x68'),_0xbb10('0x69')]})[_0xbb10('0x31')](handleEntityNotFound(_0x29529c,null))[_0xbb10('0x31')](function(_0x312a08){if(_0x312a08){_0x19fcec=_0x312a08['remoteUri'];var _0x428146=_0x19fcec[_0xbb10('0x6a')](-0x1);if(_0x428146==='/'){_0x19fcec=_0x19fcec[_0xbb10('0x6b')](0x0,_0x19fcec['lastIndexOf'](_0x428146));}var _0x4ee101={'method':'GET','uri':util[_0xbb10('0x6c')]('%s/custom_fields',_0x19fcec),'headers':{'Content-Type':'application/json','Accept':_0xbb10('0x6d')},'json':!![]};if(_0x312a08[_0xbb10('0x64')]===_0xbb10('0x6e')){_0x4ee101[_0xbb10('0x6f')][_0xbb10('0x70')]=util[_0xbb10('0x6c')](_0xbb10('0x71'),new Buffer(util[_0xbb10('0x6c')](_0xbb10('0x72'),_0x312a08['username'],_0x312a08[_0xbb10('0x65')]))[_0xbb10('0x73')](_0xbb10('0x74')));}return rp(_0x4ee101)[_0xbb10('0x31')](function(_0x5c8eb8){return _0xfa3c7c['concat'](_[_0xbb10('0x57')](_0x5c8eb8[_0xbb10('0x75')][_0xbb10('0x76')],function(_0x32bb25){return{'id':_0x32bb25['name'],'name':_0x32bb25[_0xbb10('0x34')],'type':_0x32bb25[_0xbb10('0x45')],'active':_0x32bb25[_0xbb10('0x77')],'label':_0x32bb25[_0xbb10('0x78')],'custom':!![]};}));});}})[_0xbb10('0x31')](function(_0x517185){return{'count':_0x517185['length'],'rows':_0x517185};})[_0xbb10('0x31')](respondWithResult(_0x29529c,null))[_0xbb10('0x27')](function(_0x22c030){var _0x5239da=_0xfe3db0[_0xbb10('0x39')][_0xbb10('0x1b')]?0x1f4:_0x22c030['statusCode']||0x1f4;logger['error'](_0xbb10('0x79'),_0xbb10('0x61'),_0x5239da,JSON[_0xbb10('0x23')](_0x22c030));delete _0x22c030['name'];if(_0x5239da===0x191){_0x5239da=0x190;}_0x29529c[_0xbb10('0x29')](_0x5239da)[_0xbb10('0x35')](_0xfe3db0[_0xbb10('0x39')][_0xbb10('0x1b')]?{'message':_0xbb10('0x7a'),'statusCode':_0x22c030[_0xbb10('0x7b')]}:_0x22c030);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e041a0a..7b34cc2 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 _0x2547=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2547,0x1cd));var _0x7254=function(_0x581c82,_0x4ea9d8){_0x581c82=_0x581c82-0x0;var _0x40b994=_0x2547[_0x581c82];return _0x40b994;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));var integrations=require(_0x7254('0x9'));module[_0x7254('0xa')]=function(_0x119f66,_0x4b845f){return _0x119f66[_0x7254('0xb')](_0x7254('0xc'),attributes,{'tableName':_0x7254('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash','../../config/logger','api','moment'];(function(_0x39e118,_0x550bf2){var _0x1f3215=function(_0x31c8bc){while(--_0x31c8bc){_0x39e118['push'](_0x39e118['shift']());}};_0x1f3215(++_0x550bf2);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xb4e6[_0x79b649];return _0x1af9b1;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));var integrations=require(_0x6b4e('0x9'));module[_0x6b4e('0xa')]=function(_0x49de51,_0xd3138f){return _0x49de51['define']('DeskAccount',attributes,{'tableName':_0x6b4e('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 bf49cd7..b8ace6d 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 _0x896e=['limit','include','model','attributes','map','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetDeskAccount','DeskAccount','findAll','options','raw'];(function(_0x4a9649,_0x4ead95){var _0xf73c8c=function(_0x489b93){while(--_0x489b93){_0x4a9649['push'](_0x4a9649['shift']());}};_0xf73c8c(++_0x4ead95);}(_0x896e,0x1e9));var _0xe896=function(_0x169687,_0x1c07ce){_0x169687=_0x169687-0x0;var _0x59156d=_0x896e[_0x169687];return _0x59156d;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('DeskAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetDeskAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowDeskAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowDeskAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file +var _0x4cf5=['catch','GetDeskAccount','findAll','options','where','attributes','include','map','model','then','info','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x527e1d,_0xfbd061){var _0x17e3ae=function(_0x5451d4){while(--_0x5451d4){_0x527e1d['push'](_0x527e1d['shift']());}};_0x17e3ae(++_0xfbd061);}(_0x4cf5,0x12e));var _0x54cf=function(_0x5060a3,_0x50986c){_0x5060a3=_0x5060a3-0x0;var _0x6e484d=_0x4cf5[_0x5060a3];return _0x6e484d;};'use strict';var _=require(_0x54cf('0x0'));var util=require(_0x54cf('0x1'));var moment=require(_0x54cf('0x2'));var BPromise=require(_0x54cf('0x3'));var rs=require(_0x54cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x54cf('0x5'));var logger=require(_0x54cf('0x6'))(_0x54cf('0x7'));var config=require('../../config/environment');var jayson=require(_0x54cf('0x8'));var client=jayson['client'][_0x54cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4308fb,_0x3807b9,_0x3342d9){return new BPromise(function(_0x446671,_0x5781a6){return client['request'](_0x4308fb,_0x3342d9)['then'](function(_0x3cca5e){logger['info'](_0x54cf('0xa'),_0x3807b9,_0x54cf('0xb'));logger[_0x54cf('0xc')](_0x54cf('0xd'),_0x3807b9,'request\x20sent',JSON[_0x54cf('0xe')](_0x3cca5e));if(_0x3cca5e[_0x54cf('0xf')]){if(_0x3cca5e[_0x54cf('0xf')][_0x54cf('0x10')]===0x1f4){logger[_0x54cf('0xf')](_0x54cf('0xa'),_0x3807b9,_0x3cca5e['error'][_0x54cf('0x11')]);return _0x5781a6(_0x3cca5e[_0x54cf('0xf')][_0x54cf('0x11')]);}logger[_0x54cf('0xf')]('DeskAccount,\x20%s,\x20%s',_0x3807b9,_0x3cca5e[_0x54cf('0xf')][_0x54cf('0x11')]);return _0x446671(_0x3cca5e[_0x54cf('0xf')][_0x54cf('0x11')]);}else{logger['info'](_0x54cf('0xa'),_0x3807b9,_0x54cf('0xb'));_0x446671(_0x3cca5e['result'][_0x54cf('0x11')]);}})[_0x54cf('0x12')](function(_0x51a789){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3807b9,_0x51a789);_0x5781a6(_0x51a789);});});}exports[_0x54cf('0x13')]=function(_0x3b3921){var _0x4412e3=this;return new Promise(function(_0x56eb20,_0x180def){return db['DeskAccount'][_0x54cf('0x14')]({'raw':_0x3b3921[_0x54cf('0x15')]?_0x3b3921['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b3921[_0x54cf('0x15')]?_0x3b3921[_0x54cf('0x15')][_0x54cf('0x16')]||null:null,'attributes':_0x3b3921['options']?_0x3b3921[_0x54cf('0x15')][_0x54cf('0x17')]||null:null,'limit':_0x3b3921[_0x54cf('0x15')]?_0x3b3921['options']['limit']||null:null,'include':_0x3b3921[_0x54cf('0x15')]?_0x3b3921[_0x54cf('0x15')][_0x54cf('0x18')]?_[_0x54cf('0x19')](_0x3b3921[_0x54cf('0x15')][_0x54cf('0x18')],function(_0x581795){return{'model':db[_0x581795['model']],'as':_0x581795['as'],'attributes':_0x581795[_0x54cf('0x17')],'include':_0x581795['include']?_['map'](_0x581795[_0x54cf('0x18')],function(_0x44e970){return{'model':db[_0x44e970[_0x54cf('0x1a')]],'as':_0x44e970['as'],'attributes':_0x44e970[_0x54cf('0x17')],'include':_0x44e970['include']?_[_0x54cf('0x19')](_0x44e970[_0x54cf('0x18')],function(_0x56bfcf){return{'model':db[_0x56bfcf[_0x54cf('0x1a')]],'as':_0x56bfcf['as'],'attributes':_0x56bfcf[_0x54cf('0x17')]};}):[]};}):[]};}):[]:[]})[_0x54cf('0x1b')](function(_0x592121){logger[_0x54cf('0x1c')](_0x54cf('0x13'),_0x3b3921);logger[_0x54cf('0xc')](_0x54cf('0x13'),_0x3b3921,JSON[_0x54cf('0xe')](_0x592121));_0x56eb20(_0x592121);})['catch'](function(_0xdeba42){logger['error'](_0x54cf('0x13'),_0xdeba42[_0x54cf('0x11')],_0x3b3921);_0x180def(_0x4412e3[_0x54cf('0xf')](0x1f4,_0xdeba42['message']));});});};exports[_0x54cf('0x1d')]=function(_0x232e72){var _0x5678b8=this;return new Promise(function(_0x403fd7,_0x23f87f){return db['DeskAccount'][_0x54cf('0x1e')]({'raw':_0x232e72[_0x54cf('0x15')]?_0x232e72[_0x54cf('0x15')][_0x54cf('0x1f')]===undefined?!![]:![]:!![],'where':_0x232e72[_0x54cf('0x15')]?_0x232e72['options'][_0x54cf('0x16')]||null:null,'attributes':_0x232e72['options']?_0x232e72[_0x54cf('0x15')]['attributes']||null:null,'include':_0x232e72[_0x54cf('0x15')]?_0x232e72[_0x54cf('0x15')][_0x54cf('0x18')]?_[_0x54cf('0x19')](_0x232e72[_0x54cf('0x15')][_0x54cf('0x18')],function(_0x450ea7){return{'model':db[_0x450ea7['model']],'as':_0x450ea7['as'],'attributes':_0x450ea7[_0x54cf('0x17')],'include':_0x450ea7[_0x54cf('0x18')]?_[_0x54cf('0x19')](_0x450ea7[_0x54cf('0x18')],function(_0x1eaab0){return{'model':db[_0x1eaab0[_0x54cf('0x1a')]],'as':_0x1eaab0['as'],'attributes':_0x1eaab0[_0x54cf('0x17')],'include':_0x1eaab0[_0x54cf('0x18')]?_[_0x54cf('0x19')](_0x1eaab0[_0x54cf('0x18')],function(_0x46d09f){return{'model':db[_0x46d09f['model']],'as':_0x46d09f['as'],'attributes':_0x46d09f[_0x54cf('0x17')]};}):[]};}):[]};}):[]:[]})[_0x54cf('0x1b')](function(_0x30ec01){logger['info'](_0x54cf('0x1d'),_0x232e72);logger[_0x54cf('0xc')](_0x54cf('0x1d'),_0x232e72,JSON[_0x54cf('0xe')](_0x30ec01));_0x403fd7(_0x30ec01);})[_0x54cf('0x12')](function(_0x4d97ce){logger['error'](_0x54cf('0x1d'),_0x4d97ce['message'],_0x232e72);_0x23f87f(_0x5678b8[_0x54cf('0xf')](0x1f4,_0x4d97ce[_0x54cf('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 45009ec..48899f9 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 _0x7072=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','/:id/tags','put','destroy','exports','util'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7072,0xce));var _0x2707=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x7072[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require('path');var timeout=require(_0x2707('0x1'));var express=require(_0x2707('0x2'));var router=express[_0x2707('0x3')]();var auth=require(_0x2707('0x4'));var interaction=require(_0x2707('0x5'));var config=require(_0x2707('0x6'));var controller=require(_0x2707('0x7'));router[_0x2707('0x8')]('/',auth[_0x2707('0x9')](),controller[_0x2707('0xa')]);router[_0x2707('0x8')](_0x2707('0xb'),auth[_0x2707('0x9')](),controller[_0x2707('0xc')]);router[_0x2707('0x8')](_0x2707('0xd'),auth['isAuthenticated'](),controller[_0x2707('0xe')]);router[_0x2707('0x8')](_0x2707('0xf'),auth['isAuthenticated'](),controller[_0x2707('0x10')]);router[_0x2707('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2707('0x11')]);router[_0x2707('0x8')]('/:id/tags',auth[_0x2707('0x9')](),controller['getTags']);router[_0x2707('0x12')]('/',auth[_0x2707('0x9')](),controller['create']);router[_0x2707('0x12')](_0x2707('0x13'),auth[_0x2707('0x9')](),controller['setTags']);router[_0x2707('0x14')]('/:id',auth[_0x2707('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2707('0x9')](),controller[_0x2707('0x15')]);module[_0x2707('0x16')]=router; \ No newline at end of file +var _0x3e8f=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','setTags','/:id','update','destroy','multer','util','path','../../components/auth/service'];(function(_0x3f4ab2,_0x5e1d18){var _0x23165d=function(_0x35f438){while(--_0x35f438){_0x3f4ab2['push'](_0x3f4ab2['shift']());}};_0x23165d(++_0x5e1d18);}(_0x3e8f,0xb0));var _0xf3e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e8f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf3e8('0x0'));var util=require(_0xf3e8('0x1'));var path=require(_0xf3e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xf3e8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf3e8('0x4'));var controller=require(_0xf3e8('0x5'));router[_0xf3e8('0x6')]('/',auth[_0xf3e8('0x7')](),controller[_0xf3e8('0x8')]);router['get']('/:id',auth[_0xf3e8('0x7')](),controller[_0xf3e8('0x9')]);router[_0xf3e8('0x6')]('/:id/fields',auth[_0xf3e8('0x7')](),controller[_0xf3e8('0xa')]);router[_0xf3e8('0x6')](_0xf3e8('0xb'),auth['isAuthenticated'](),controller[_0xf3e8('0xc')]);router[_0xf3e8('0x6')](_0xf3e8('0xd'),auth[_0xf3e8('0x7')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0xf3e8('0x7')](),controller['getTags']);router[_0xf3e8('0xe')]('/',auth['isAuthenticated'](),controller[_0xf3e8('0xf')]);router[_0xf3e8('0xe')]('/:id/tags',auth[_0xf3e8('0x7')](),controller[_0xf3e8('0x10')]);router['put'](_0xf3e8('0x11'),auth[_0xf3e8('0x7')](),controller[_0xf3e8('0x12')]);router['delete'](_0xf3e8('0x11'),auth['isAuthenticated'](),controller[_0xf3e8('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b85d784..6e4bb6f 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 _0x01b5=['sequelize','exports'];(function(_0x23e5a5,_0x301634){var _0x402035=function(_0x4c96e7){while(--_0x4c96e7){_0x23e5a5['push'](_0x23e5a5['shift']());}};_0x402035(++_0x301634);}(_0x01b5,0x1ca));var _0x501b=function(_0x4553e6,_0x17e145){_0x4553e6=_0x4553e6-0x0;var _0x3bf59a=_0x01b5[_0x4553e6];return _0x3bf59a;};'use strict';var Sequelize=require(_0x501b('0x0'));module[_0x501b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1b91=['STRING','sequelize'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0x1b91,0xa1));var _0x11b9=function(_0x243107,_0x27bb29){_0x243107=_0x243107-0x0;var _0xe648b7=_0x1b91[_0x243107];return _0xe648b7;};'use strict';var Sequelize=require(_0x11b9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11b9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 19ed72f..4686643 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 _0xe186=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','index','DeskConfiguration','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','type','key','merge','options','where','includeAll','include','rows','rawAttributes','find','create','body','params','getFields','findOne','DeskField','order','filter','map','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','request','then','info','debug','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus'];(function(_0x1968c4,_0x4ce2bb){var _0x153766=function(_0x5ef90d){while(--_0x5ef90d){_0x1968c4['push'](_0x1968c4['shift']());}};_0x153766(++_0x4ce2bb);}(_0xe186,0x146));var _0x6e18=function(_0x506e5a,_0x418a48){_0x506e5a=_0x506e5a-0x0;var _0x4bc31b=_0xe186[_0x506e5a];return _0x4bc31b;};'use strict';var pdf=require(_0x6e18('0x0'));var emlformat=require(_0x6e18('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6e18('0x2'));var jsonpatch=require(_0x6e18('0x3'));var rp=require(_0x6e18('0x4'));var moment=require(_0x6e18('0x5'));var BPromise=require(_0x6e18('0x6'));var Mustache=require('mustache');var util=require(_0x6e18('0x7'));var path=require('path');var sox=require(_0x6e18('0x8'));var csv=require(_0x6e18('0x9'));var ejs=require(_0x6e18('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6e18('0xb'));var jsforce=require(_0x6e18('0xc'));var deskjs=require(_0x6e18('0xd'));var toCsv=require(_0x6e18('0x9'));var querystring=require(_0x6e18('0xe'));var Papa=require(_0x6e18('0xf'));var Redis=require(_0x6e18('0x10'));var authService=require(_0x6e18('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6e18('0x12'));var logger=require(_0x6e18('0x13'))(_0x6e18('0x14'));var utils=require(_0x6e18('0x15'));var config=require(_0x6e18('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6e18('0x17'));var client=jayson['client'][_0x6e18('0x18')]({'port':0x232a});function checkPasswordPattern(_0x25a9cf,_0x386427,_0x37a1de){if(_0x37a1de){var _0x227b81=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x227b81[_0x6e18('0x19')](_0x386427)){return _0x25a9cf;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x25a9cf;}}function respondWithRpcPromise(_0x795515,_0x254bba,_0x32c848,_0x4dcc63){return new BPromise(function(_0xef7033,_0x339e17){var _0x252bb3=_0x4dcc63||client;return _0x252bb3[_0x6e18('0x1a')](_0x795515,_0x32c848)[_0x6e18('0x1b')](function(_0x521f5c){logger[_0x6e18('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x254bba,'request\x20sent');logger[_0x6e18('0x1d')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x254bba,'request\x20sent',JSON[_0x6e18('0x1e')](_0x521f5c));if(_0x521f5c['error']){if(_0x521f5c[_0x6e18('0x1f')][_0x6e18('0x20')]===0x1f4){logger[_0x6e18('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x254bba,_0x521f5c['error'][_0x6e18('0x21')]);return _0x339e17(_0x521f5c[_0x6e18('0x1f')][_0x6e18('0x21')]);}logger[_0x6e18('0x1f')](_0x6e18('0x22'),_0x254bba,_0x521f5c[_0x6e18('0x1f')][_0x6e18('0x21')]);return _0xef7033(_0x521f5c['error'][_0x6e18('0x21')]);}else{logger[_0x6e18('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x254bba,'request\x20sent');_0xef7033(_0x521f5c[_0x6e18('0x23')][_0x6e18('0x21')]);}})[_0x6e18('0x24')](function(_0x36cb1f){logger[_0x6e18('0x1f')](_0x6e18('0x22'),_0x254bba,_0x36cb1f);_0x339e17(_0x36cb1f);});});}function respondWithStatusCode(_0x3bb43d,_0x18d214){_0x18d214=_0x18d214||0xcc;return function(_0x39159e){if(_0x39159e){return _0x3bb43d[_0x6e18('0x25')](_0x18d214);}return _0x3bb43d[_0x6e18('0x26')](_0x18d214)[_0x6e18('0x27')]();};}function respondWithResult(_0x34a2a7,_0x243508){_0x243508=_0x243508||0xc8;return function(_0x193051){if(_0x193051){return _0x34a2a7[_0x6e18('0x26')](_0x243508)[_0x6e18('0x28')](_0x193051);}};}function respondWithFilteredResult(_0x4a56b1,_0x113feb){return function(_0x2f4d11){if(_0x2f4d11){var _0x4dc894=_0x2f4d11[_0x6e18('0x29')],_0x35734e=_0x113feb['offset'],_0x3007d9=_0x113feb[_0x6e18('0x2a')]+_0x113feb[_0x6e18('0x2b')],_0x176ad5;if(_0x3007d9>=_0x4dc894){_0x3007d9=_0x4dc894;_0x176ad5=0xc8;}else{_0x176ad5=0xce;}_0x4a56b1[_0x6e18('0x26')](_0x176ad5);return _0x4a56b1[_0x6e18('0x2c')](_0x6e18('0x2d'),_0x35734e+'-'+_0x3007d9+'/'+_0x4dc894)[_0x6e18('0x28')](_0x2f4d11);}return null;};}function patchUpdates(_0x17ed8e){return function(_0x1391af){try{jsonpatch[_0x6e18('0x2e')](_0x1391af,_0x17ed8e,!![]);}catch(_0x9acdc){return BPromise[_0x6e18('0x2f')](_0x9acdc);}return _0x1391af[_0x6e18('0x30')]();};}function saveUpdates(_0x5248c0,_0x739a56){return function(_0x301920){if(_0x301920){return _0x301920[_0x6e18('0x31')](_0x5248c0)[_0x6e18('0x1b')](function(_0x1ab9cc){return _0x1ab9cc;});}return null;};}function removeEntity(_0x916f68,_0x3c4c0f){return function(_0x45bc42){if(_0x45bc42){return _0x45bc42[_0x6e18('0x32')]()[_0x6e18('0x1b')](function(){_0x916f68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ee5,_0x25f2ce){return function(_0x180163){if(!_0x180163){_0x258ee5[_0x6e18('0x25')](0x194);}return _0x180163;};}function handleError(_0x11be2f,_0x2113fa){_0x2113fa=_0x2113fa||0x1f4;return function(_0x4cc94d){logger[_0x6e18('0x1f')](_0x4cc94d['stack']);if(_0x4cc94d[_0x6e18('0x33')]){delete _0x4cc94d['name'];}_0x11be2f[_0x6e18('0x26')](_0x2113fa)['send'](_0x4cc94d);};}exports[_0x6e18('0x34')]=function(_0xf0b158,_0x5e3ac6){var _0x372731={},_0xcc9156={},_0x2e16c5={'count':0x0,'rows':[]};var _0x1208f7=db[_0x6e18('0x35')]['rawAttributes'];_0xcc9156['model']=_[_0x6e18('0x36')](_0x1208f7);_0xcc9156[_0x6e18('0x37')]=_[_0x6e18('0x36')](_0xf0b158[_0x6e18('0x37')]);_0xcc9156[_0x6e18('0x38')]=_[_0x6e18('0x39')](_0xcc9156[_0x6e18('0x3a')],_0xcc9156[_0x6e18('0x37')]);_0x372731[_0x6e18('0x3b')]=_[_0x6e18('0x39')](_0xcc9156[_0x6e18('0x3a')],qs[_0x6e18('0x3c')](_0xf0b158[_0x6e18('0x37')]['fields']));_0x372731[_0x6e18('0x3b')]=_0x372731['attributes'][_0x6e18('0x3d')]?_0x372731[_0x6e18('0x3b')]:_0xcc9156[_0x6e18('0x3a')];if(!_0xf0b158[_0x6e18('0x37')]['hasOwnProperty'](_0x6e18('0x3e'))){_0x372731[_0x6e18('0x2b')]=qs[_0x6e18('0x2b')](_0xf0b158[_0x6e18('0x37')][_0x6e18('0x2b')]);_0x372731[_0x6e18('0x2a')]=qs['offset'](_0xf0b158[_0x6e18('0x37')][_0x6e18('0x2a')]);}_0x372731['order']=qs[_0x6e18('0x3f')](_0xf0b158[_0x6e18('0x37')]['sort']);_0x372731['where']=qs['filters'](_[_0x6e18('0x40')](_0xf0b158[_0x6e18('0x37')],_0xcc9156[_0x6e18('0x38')]));if(_0xf0b158['query']['filter']){_0x372731['where']=_['merge'](_0x372731['where'],{'$or':_['map'](_0x1208f7,function(_0x4ccbda){if(_0x4ccbda[_0x6e18('0x41')][_0x6e18('0x42')]!=='VIRTUAL'){var _0x2a24d7={};_0x2a24d7[_0x4ccbda['field']]={'$like':'%'+_0xf0b158[_0x6e18('0x37')]['filter']+'%'};return _0x2a24d7;}})});}_0x372731=_[_0x6e18('0x43')]({},_0x372731,_0xf0b158[_0x6e18('0x44')]);var _0x4c93fa={'where':_0x372731[_0x6e18('0x45')]};return db['DeskConfiguration'][_0x6e18('0x29')](_0x4c93fa)[_0x6e18('0x1b')](function(_0x1c06fb){_0x2e16c5[_0x6e18('0x29')]=_0x1c06fb;if(_0xf0b158[_0x6e18('0x37')][_0x6e18('0x46')]){_0x372731[_0x6e18('0x47')]=[{'all':!![]}];}return db[_0x6e18('0x35')]['findAll'](_0x372731);})['then'](function(_0x6234d9){_0x2e16c5[_0x6e18('0x48')]=_0x6234d9;return _0x2e16c5;})[_0x6e18('0x1b')](respondWithFilteredResult(_0x5e3ac6,_0x372731))['catch'](handleError(_0x5e3ac6,null));};exports['show']=function(_0x4e34b4,_0x4c4163){var _0x522f4f={'raw':![],'where':{'id':_0x4e34b4['params']['id']}},_0x11f1e5={};_0x11f1e5[_0x6e18('0x3a')]=_[_0x6e18('0x36')](db[_0x6e18('0x35')][_0x6e18('0x49')]);_0x11f1e5['query']=_['keys'](_0x4e34b4['query']);_0x11f1e5[_0x6e18('0x38')]=_[_0x6e18('0x39')](_0x11f1e5[_0x6e18('0x3a')],_0x11f1e5['query']);_0x522f4f[_0x6e18('0x3b')]=_[_0x6e18('0x39')](_0x11f1e5[_0x6e18('0x3a')],qs[_0x6e18('0x3c')](_0x4e34b4[_0x6e18('0x37')][_0x6e18('0x3c')]));_0x522f4f[_0x6e18('0x3b')]=_0x522f4f['attributes'][_0x6e18('0x3d')]?_0x522f4f[_0x6e18('0x3b')]:_0x11f1e5[_0x6e18('0x3a')];if(_0x4e34b4[_0x6e18('0x37')][_0x6e18('0x46')]){_0x522f4f[_0x6e18('0x47')]=[{'all':!![]}];}_0x522f4f=_['merge']({},_0x522f4f,_0x4e34b4['options']);return db['DeskConfiguration'][_0x6e18('0x4a')](_0x522f4f)[_0x6e18('0x1b')](handleEntityNotFound(_0x4c4163,null))[_0x6e18('0x1b')](respondWithResult(_0x4c4163,null))[_0x6e18('0x24')](handleError(_0x4c4163,null));};exports[_0x6e18('0x4b')]=function(_0x4a4c05,_0x20c70b){return db['DeskConfiguration'][_0x6e18('0x4b')](_0x4a4c05[_0x6e18('0x4c')],{})[_0x6e18('0x1b')](respondWithResult(_0x20c70b,0xc9))[_0x6e18('0x24')](handleError(_0x20c70b,null));};exports['update']=function(_0x24eeec,_0x525474){if(_0x24eeec[_0x6e18('0x4c')]['id']){delete _0x24eeec[_0x6e18('0x4c')]['id'];}return db[_0x6e18('0x35')][_0x6e18('0x4a')]({'where':{'id':_0x24eeec[_0x6e18('0x4d')]['id']}})[_0x6e18('0x1b')](handleEntityNotFound(_0x525474,null))['then'](saveUpdates(_0x24eeec[_0x6e18('0x4c')],null))[_0x6e18('0x1b')](respondWithResult(_0x525474,null))[_0x6e18('0x24')](handleError(_0x525474,null));};exports['destroy']=function(_0x16e440,_0x3b545e){return db[_0x6e18('0x35')][_0x6e18('0x4a')]({'where':{'id':_0x16e440['params']['id']}})[_0x6e18('0x1b')](handleEntityNotFound(_0x3b545e,null))[_0x6e18('0x1b')](removeEntity(_0x3b545e,null))['catch'](handleError(_0x3b545e,null));};exports[_0x6e18('0x4e')]=function(_0x178b37,_0x3762b4,_0x2e2f5f){var _0x2042b1={};var _0x1915db={};var _0x351559;var _0x4424d6;return db[_0x6e18('0x35')][_0x6e18('0x4f')]({'where':{'id':_0x178b37[_0x6e18('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3762b4,null))[_0x6e18('0x1b')](function(_0x5d27a0){if(_0x5d27a0){_0x351559=_0x5d27a0;_0x1915db['model']=_[_0x6e18('0x36')](db[_0x6e18('0x50')]['rawAttributes']);_0x1915db[_0x6e18('0x37')]=_[_0x6e18('0x36')](_0x178b37[_0x6e18('0x37')]);_0x1915db['filters']=_[_0x6e18('0x39')](_0x1915db[_0x6e18('0x3a')],_0x1915db[_0x6e18('0x37')]);_0x2042b1[_0x6e18('0x3b')]=_['intersection'](_0x1915db[_0x6e18('0x3a')],qs[_0x6e18('0x3c')](_0x178b37['query']['fields']));_0x2042b1[_0x6e18('0x3b')]=_0x2042b1[_0x6e18('0x3b')][_0x6e18('0x3d')]?_0x2042b1[_0x6e18('0x3b')]:_0x1915db[_0x6e18('0x3a')];_0x2042b1[_0x6e18('0x51')]=qs['sort'](_0x178b37[_0x6e18('0x37')][_0x6e18('0x3f')]);_0x2042b1[_0x6e18('0x45')]=qs[_0x6e18('0x38')](_[_0x6e18('0x40')](_0x178b37[_0x6e18('0x37')],_0x1915db[_0x6e18('0x38')]));if(_0x178b37[_0x6e18('0x37')][_0x6e18('0x52')]){_0x2042b1['where']=_['merge'](_0x2042b1['where'],{'$or':_[_0x6e18('0x53')](_0x2042b1['attributes'],function(_0x20d094){var _0x4be074={};_0x4be074[_0x20d094]={'$like':'%'+_0x178b37[_0x6e18('0x37')]['filter']+'%'};return _0x4be074;})});}_0x2042b1=_[_0x6e18('0x43')]({},_0x2042b1,_0x178b37[_0x6e18('0x44')]);return _0x351559[_0x6e18('0x4e')](_0x2042b1);}})['then'](function(_0x2d900f){if(_0x2d900f){_0x4424d6=_0x2d900f['length'];if(!_0x178b37[_0x6e18('0x37')][_0x6e18('0x54')](_0x6e18('0x3e'))){_0x2042b1['limit']=qs[_0x6e18('0x2b')](_0x178b37[_0x6e18('0x37')][_0x6e18('0x2b')]);_0x2042b1[_0x6e18('0x2a')]=qs['offset'](_0x178b37[_0x6e18('0x37')][_0x6e18('0x2a')]);}return _0x351559[_0x6e18('0x4e')](_0x2042b1);}})[_0x6e18('0x1b')](function(_0x57243c){if(_0x57243c){return _0x57243c?{'count':_0x4424d6,'rows':_0x57243c}:null;}})[_0x6e18('0x1b')](respondWithResult(_0x3762b4,null))[_0x6e18('0x24')](handleError(_0x3762b4,null));};exports[_0x6e18('0x55')]=function(_0x20a626,_0x1ab7ce,_0x1ebcbe){var _0x332be4={};var _0x5ce242={};var _0xc51e9a;var _0x4aeb15;return db[_0x6e18('0x35')][_0x6e18('0x4f')]({'where':{'id':_0x20a626[_0x6e18('0x4d')]['id']}})[_0x6e18('0x1b')](handleEntityNotFound(_0x1ab7ce,null))['then'](function(_0x2de93d){if(_0x2de93d){_0xc51e9a=_0x2de93d;_0x5ce242[_0x6e18('0x3a')]=_[_0x6e18('0x36')](db[_0x6e18('0x50')][_0x6e18('0x49')]);_0x5ce242[_0x6e18('0x37')]=_[_0x6e18('0x36')](_0x20a626['query']);_0x5ce242[_0x6e18('0x38')]=_[_0x6e18('0x39')](_0x5ce242[_0x6e18('0x3a')],_0x5ce242['query']);_0x332be4[_0x6e18('0x3b')]=_[_0x6e18('0x39')](_0x5ce242[_0x6e18('0x3a')],qs['fields'](_0x20a626[_0x6e18('0x37')][_0x6e18('0x3c')]));_0x332be4['attributes']=_0x332be4['attributes']['length']?_0x332be4[_0x6e18('0x3b')]:_0x5ce242['model'];_0x332be4['order']=qs['sort'](_0x20a626[_0x6e18('0x37')]['sort']);_0x332be4['where']=qs[_0x6e18('0x38')](_[_0x6e18('0x40')](_0x20a626[_0x6e18('0x37')],_0x5ce242[_0x6e18('0x38')]));if(_0x20a626['query']['filter']){_0x332be4[_0x6e18('0x45')]=_['merge'](_0x332be4[_0x6e18('0x45')],{'$or':_[_0x6e18('0x53')](_0x332be4[_0x6e18('0x3b')],function(_0x1a866b){var _0x31c1df={};_0x31c1df[_0x1a866b]={'$like':'%'+_0x20a626[_0x6e18('0x37')][_0x6e18('0x52')]+'%'};return _0x31c1df;})});}_0x332be4=_[_0x6e18('0x43')]({},_0x332be4,_0x20a626[_0x6e18('0x44')]);return _0xc51e9a[_0x6e18('0x55')](_0x332be4);}})[_0x6e18('0x1b')](function(_0x4f54ae){if(_0x4f54ae){_0x4aeb15=_0x4f54ae['length'];if(!_0x20a626[_0x6e18('0x37')]['hasOwnProperty']('nolimit')){_0x332be4[_0x6e18('0x2b')]=qs['limit'](_0x20a626['query'][_0x6e18('0x2b')]);_0x332be4['offset']=qs[_0x6e18('0x2a')](_0x20a626[_0x6e18('0x37')]['offset']);}return _0xc51e9a['getSubjects'](_0x332be4);}})[_0x6e18('0x1b')](function(_0x28d67e){if(_0x28d67e){return _0x28d67e?{'count':_0x4aeb15,'rows':_0x28d67e}:null;}})[_0x6e18('0x1b')](respondWithResult(_0x1ab7ce,null))['catch'](handleError(_0x1ab7ce,null));};exports[_0x6e18('0x56')]=function(_0x56ec3c,_0x6d8aa3,_0x58280e){var _0x1b1016={};var _0x3762b7={};var _0x26507f;var _0x4a5f42;return db['DeskConfiguration'][_0x6e18('0x4f')]({'where':{'id':_0x56ec3c['params']['id']}})[_0x6e18('0x1b')](handleEntityNotFound(_0x6d8aa3,null))['then'](function(_0x6c0d6e){if(_0x6c0d6e){_0x26507f=_0x6c0d6e;_0x3762b7[_0x6e18('0x3a')]=_[_0x6e18('0x36')](db[_0x6e18('0x50')][_0x6e18('0x49')]);_0x3762b7[_0x6e18('0x37')]=_['keys'](_0x56ec3c[_0x6e18('0x37')]);_0x3762b7[_0x6e18('0x38')]=_['intersection'](_0x3762b7[_0x6e18('0x3a')],_0x3762b7[_0x6e18('0x37')]);_0x1b1016['attributes']=_['intersection'](_0x3762b7[_0x6e18('0x3a')],qs['fields'](_0x56ec3c[_0x6e18('0x37')][_0x6e18('0x3c')]));_0x1b1016[_0x6e18('0x3b')]=_0x1b1016[_0x6e18('0x3b')][_0x6e18('0x3d')]?_0x1b1016[_0x6e18('0x3b')]:_0x3762b7[_0x6e18('0x3a')];_0x1b1016[_0x6e18('0x51')]=qs[_0x6e18('0x3f')](_0x56ec3c[_0x6e18('0x37')]['sort']);_0x1b1016['where']=qs[_0x6e18('0x38')](_[_0x6e18('0x40')](_0x56ec3c[_0x6e18('0x37')],_0x3762b7[_0x6e18('0x38')]));if(_0x56ec3c[_0x6e18('0x37')][_0x6e18('0x52')]){_0x1b1016[_0x6e18('0x45')]=_[_0x6e18('0x43')](_0x1b1016['where'],{'$or':_[_0x6e18('0x53')](_0x1b1016[_0x6e18('0x3b')],function(_0x3c2338){var _0x6de32={};_0x6de32[_0x3c2338]={'$like':'%'+_0x56ec3c[_0x6e18('0x37')][_0x6e18('0x52')]+'%'};return _0x6de32;})});}_0x1b1016=_[_0x6e18('0x43')]({},_0x1b1016,_0x56ec3c[_0x6e18('0x44')]);return _0x26507f['getDescriptions'](_0x1b1016);}})['then'](function(_0x59031c){if(_0x59031c){_0x4a5f42=_0x59031c[_0x6e18('0x3d')];if(!_0x56ec3c[_0x6e18('0x37')][_0x6e18('0x54')](_0x6e18('0x3e'))){_0x1b1016[_0x6e18('0x2b')]=qs['limit'](_0x56ec3c['query']['limit']);_0x1b1016['offset']=qs[_0x6e18('0x2a')](_0x56ec3c['query'][_0x6e18('0x2a')]);}return _0x26507f['getDescriptions'](_0x1b1016);}})[_0x6e18('0x1b')](function(_0x21438c){if(_0x21438c){return _0x21438c?{'count':_0x4a5f42,'rows':_0x21438c}:null;}})[_0x6e18('0x1b')](respondWithResult(_0x6d8aa3,null))[_0x6e18('0x24')](handleError(_0x6d8aa3,null));};exports[_0x6e18('0x57')]=function(_0x5ad41d,_0x394d14,_0x34abc0){var _0x5cb4d6={};var _0x59dd1b={};var _0x52e82e;var _0x553bee;return db['DeskConfiguration'][_0x6e18('0x4f')]({'where':{'id':_0x5ad41d[_0x6e18('0x4d')]['id']}})['then'](handleEntityNotFound(_0x394d14,null))['then'](function(_0x40219e){if(_0x40219e){_0x52e82e=_0x40219e;_0x59dd1b[_0x6e18('0x3a')]=_[_0x6e18('0x36')](db[_0x6e18('0x58')][_0x6e18('0x49')]);_0x59dd1b['query']=_['keys'](_0x5ad41d['query']);_0x59dd1b[_0x6e18('0x38')]=_[_0x6e18('0x39')](_0x59dd1b[_0x6e18('0x3a')],_0x59dd1b[_0x6e18('0x37')]);_0x5cb4d6[_0x6e18('0x3b')]=_['intersection'](_0x59dd1b[_0x6e18('0x3a')],qs[_0x6e18('0x3c')](_0x5ad41d[_0x6e18('0x37')][_0x6e18('0x3c')]));_0x5cb4d6['attributes']=_0x5cb4d6[_0x6e18('0x3b')][_0x6e18('0x3d')]?_0x5cb4d6[_0x6e18('0x3b')]:_0x59dd1b[_0x6e18('0x3a')];_0x5cb4d6[_0x6e18('0x51')]=qs[_0x6e18('0x3f')](_0x5ad41d['query'][_0x6e18('0x3f')]);_0x5cb4d6['where']=qs[_0x6e18('0x38')](_[_0x6e18('0x40')](_0x5ad41d[_0x6e18('0x37')],_0x59dd1b[_0x6e18('0x38')]));if(_0x5ad41d['query'][_0x6e18('0x52')]){_0x5cb4d6[_0x6e18('0x45')]=_['merge'](_0x5cb4d6['where'],{'$or':_['map'](_0x5cb4d6[_0x6e18('0x3b')],function(_0x1cb111){var _0x26c5f8={};_0x26c5f8[_0x1cb111]={'$like':'%'+_0x5ad41d['query'][_0x6e18('0x52')]+'%'};return _0x26c5f8;})});}_0x5cb4d6=_[_0x6e18('0x43')]({},_0x5cb4d6,_0x5ad41d[_0x6e18('0x44')]);return _0x52e82e[_0x6e18('0x57')](_0x5cb4d6);}})[_0x6e18('0x1b')](function(_0x40cde6){if(_0x40cde6){_0x553bee=_0x40cde6[_0x6e18('0x3d')];if(!_0x5ad41d[_0x6e18('0x37')][_0x6e18('0x54')](_0x6e18('0x3e'))){_0x5cb4d6[_0x6e18('0x2b')]=qs['limit'](_0x5ad41d[_0x6e18('0x37')][_0x6e18('0x2b')]);_0x5cb4d6[_0x6e18('0x2a')]=qs[_0x6e18('0x2a')](_0x5ad41d[_0x6e18('0x37')][_0x6e18('0x2a')]);}return _0x52e82e['getTags'](_0x5cb4d6);}})[_0x6e18('0x1b')](function(_0x583d17){if(_0x583d17){return _0x583d17?{'count':_0x553bee,'rows':_0x583d17}:null;}})[_0x6e18('0x1b')](respondWithResult(_0x394d14,null))['catch'](handleError(_0x394d14,null));};exports[_0x6e18('0x59')]=function(_0x565b08,_0x34e585,_0x58fce3){if(_0x565b08[_0x6e18('0x4c')]['id']){delete _0x565b08[_0x6e18('0x4c')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x565b08[_0x6e18('0x4d')]['id']}})[_0x6e18('0x1b')](handleEntityNotFound(_0x34e585,null))[_0x6e18('0x1b')](function(_0x214eb9){if(_0x214eb9){return _0x214eb9[_0x6e18('0x59')](_0x565b08['body'][_0x6e18('0x5a')]||[]);}return null;})['then'](respondWithResult(_0x34e585,null))[_0x6e18('0x24')](handleError(_0x34e585,null));}; \ No newline at end of file +var _0x23d3=['save','update','destroy','send','index','DeskConfiguration','model','keys','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','map','field','filter','merge','options','includeAll','findAll','show','rawAttributes','fields','length','include','create','body','find','params','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23d3,0xe8));var _0x323d=function(_0x30f1d8,_0x27a9ef){_0x30f1d8=_0x30f1d8-0x0;var _0x25501b=_0x23d3[_0x30f1d8];return _0x25501b;};'use strict';var pdf=require(_0x323d('0x0'));var emlformat=require(_0x323d('0x1'));var rimraf=require(_0x323d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x323d('0x3'));var rp=require(_0x323d('0x4'));var moment=require(_0x323d('0x5'));var BPromise=require(_0x323d('0x6'));var Mustache=require(_0x323d('0x7'));var util=require(_0x323d('0x8'));var path=require('path');var sox=require(_0x323d('0x9'));var csv=require(_0x323d('0xa'));var ejs=require(_0x323d('0xb'));var fs=require('fs');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 hardwareService=require(_0x323d('0x14'));var logger=require(_0x323d('0x15'))('api');var utils=require(_0x323d('0x16'));var config=require(_0x323d('0x17'));var db=require(_0x323d('0x18'))['db'];var jayson=require(_0x323d('0x19'));var client=jayson[_0x323d('0x1a')][_0x323d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x8ed8df,_0x5066f0,_0x3913bd){if(_0x3913bd){var _0x537c50=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x537c50[_0x323d('0x1c')](_0x5066f0)){return _0x8ed8df;}else{throw new Error(_0x323d('0x1d'));}}else{return _0x8ed8df;}}function respondWithRpcPromise(_0x1a2d9e,_0x171468,_0x302b8f,_0x19bb49){return new BPromise(function(_0x1f376c,_0x3d8b1c){var _0x6f6ad1=_0x19bb49||client;return _0x6f6ad1[_0x323d('0x1e')](_0x1a2d9e,_0x302b8f)[_0x323d('0x1f')](function(_0x468d72){logger[_0x323d('0x20')](_0x323d('0x21'),_0x171468,'request\x20sent');logger[_0x323d('0x22')](_0x323d('0x23'),_0x171468,_0x323d('0x24'),JSON[_0x323d('0x25')](_0x468d72));if(_0x468d72[_0x323d('0x26')]){if(_0x468d72[_0x323d('0x26')][_0x323d('0x27')]===0x1f4){logger['error'](_0x323d('0x21'),_0x171468,_0x468d72[_0x323d('0x26')][_0x323d('0x28')]);return _0x3d8b1c(_0x468d72[_0x323d('0x26')][_0x323d('0x28')]);}logger[_0x323d('0x26')](_0x323d('0x21'),_0x171468,_0x468d72[_0x323d('0x26')]['message']);return _0x1f376c(_0x468d72[_0x323d('0x26')][_0x323d('0x28')]);}else{logger[_0x323d('0x20')](_0x323d('0x21'),_0x171468,_0x323d('0x24'));_0x1f376c(_0x468d72['result']['message']);}})[_0x323d('0x29')](function(_0x1c6819){logger['error'](_0x323d('0x21'),_0x171468,_0x1c6819);_0x3d8b1c(_0x1c6819);});});}function respondWithStatusCode(_0x1bb908,_0xb68ec2){_0xb68ec2=_0xb68ec2||0xcc;return function(_0xadbd58){if(_0xadbd58){return _0x1bb908[_0x323d('0x2a')](_0xb68ec2);}return _0x1bb908[_0x323d('0x2b')](_0xb68ec2)[_0x323d('0x2c')]();};}function respondWithResult(_0x4d7fdf,_0x1cf1e){_0x1cf1e=_0x1cf1e||0xc8;return function(_0xf6cd44){if(_0xf6cd44){return _0x4d7fdf['status'](_0x1cf1e)[_0x323d('0x2d')](_0xf6cd44);}};}function respondWithFilteredResult(_0xca11a9,_0xf737ae){return function(_0x17543d){if(_0x17543d){var _0x1456da=_0x17543d[_0x323d('0x2e')],_0x22902e=_0xf737ae[_0x323d('0x2f')],_0x53b5d6=_0xf737ae[_0x323d('0x2f')]+_0xf737ae[_0x323d('0x30')],_0x146a80;if(_0x53b5d6>=_0x1456da){_0x53b5d6=_0x1456da;_0x146a80=0xc8;}else{_0x146a80=0xce;}_0xca11a9['status'](_0x146a80);return _0xca11a9[_0x323d('0x31')](_0x323d('0x32'),_0x22902e+'-'+_0x53b5d6+'/'+_0x1456da)[_0x323d('0x2d')](_0x17543d);}return null;};}function patchUpdates(_0x571dee){return function(_0x4737cc){try{jsonpatch[_0x323d('0x33')](_0x4737cc,_0x571dee,!![]);}catch(_0x578291){return BPromise[_0x323d('0x34')](_0x578291);}return _0x4737cc[_0x323d('0x35')]();};}function saveUpdates(_0x4150b4,_0x458290){return function(_0x108734){if(_0x108734){return _0x108734[_0x323d('0x36')](_0x4150b4)['then'](function(_0x3506cd){return _0x3506cd;});}return null;};}function removeEntity(_0x3e4b66,_0x2b9e16){return function(_0xdbeb89){if(_0xdbeb89){return _0xdbeb89[_0x323d('0x37')]()[_0x323d('0x1f')](function(){_0x3e4b66['status'](0xcc)[_0x323d('0x2c')]();});}};}function handleEntityNotFound(_0x59a3f5,_0x55d014){return function(_0x312fa6){if(!_0x312fa6){_0x59a3f5[_0x323d('0x2a')](0x194);}return _0x312fa6;};}function handleError(_0x2ec250,_0x127e00){_0x127e00=_0x127e00||0x1f4;return function(_0x18076f){logger['error'](_0x18076f['stack']);if(_0x18076f['name']){delete _0x18076f['name'];}_0x2ec250[_0x323d('0x2b')](_0x127e00)[_0x323d('0x38')](_0x18076f);};}exports[_0x323d('0x39')]=function(_0x332c85,_0x24f55a){var _0x200b29={},_0x785bed={},_0x897164={'count':0x0,'rows':[]};var _0x2f1d4a=db[_0x323d('0x3a')]['rawAttributes'];_0x785bed[_0x323d('0x3b')]=_[_0x323d('0x3c')](_0x2f1d4a);_0x785bed[_0x323d('0x3d')]=_[_0x323d('0x3c')](_0x332c85[_0x323d('0x3d')]);_0x785bed[_0x323d('0x3e')]=_['intersection'](_0x785bed['model'],_0x785bed[_0x323d('0x3d')]);_0x200b29[_0x323d('0x3f')]=_[_0x323d('0x40')](_0x785bed[_0x323d('0x3b')],qs['fields'](_0x332c85[_0x323d('0x3d')]['fields']));_0x200b29[_0x323d('0x3f')]=_0x200b29['attributes']['length']?_0x200b29[_0x323d('0x3f')]:_0x785bed[_0x323d('0x3b')];if(!_0x332c85['query'][_0x323d('0x41')](_0x323d('0x42'))){_0x200b29[_0x323d('0x30')]=qs['limit'](_0x332c85[_0x323d('0x3d')][_0x323d('0x30')]);_0x200b29[_0x323d('0x2f')]=qs[_0x323d('0x2f')](_0x332c85[_0x323d('0x3d')][_0x323d('0x2f')]);}_0x200b29[_0x323d('0x43')]=qs[_0x323d('0x44')](_0x332c85[_0x323d('0x3d')]['sort']);_0x200b29[_0x323d('0x45')]=qs[_0x323d('0x3e')](_['pick'](_0x332c85[_0x323d('0x3d')],_0x785bed['filters']));if(_0x332c85[_0x323d('0x3d')]['filter']){_0x200b29[_0x323d('0x45')]=_['merge'](_0x200b29['where'],{'$or':_[_0x323d('0x46')](_0x2f1d4a,function(_0xccf364){if(_0xccf364['type']['key']!=='VIRTUAL'){var _0x1d6aa9={};_0x1d6aa9[_0xccf364[_0x323d('0x47')]]={'$like':'%'+_0x332c85[_0x323d('0x3d')][_0x323d('0x48')]+'%'};return _0x1d6aa9;}})});}_0x200b29=_[_0x323d('0x49')]({},_0x200b29,_0x332c85[_0x323d('0x4a')]);var _0x51e9ff={'where':_0x200b29[_0x323d('0x45')]};return db['DeskConfiguration'][_0x323d('0x2e')](_0x51e9ff)[_0x323d('0x1f')](function(_0x48822b){_0x897164[_0x323d('0x2e')]=_0x48822b;if(_0x332c85[_0x323d('0x3d')][_0x323d('0x4b')]){_0x200b29['include']=[{'all':!![]}];}return db[_0x323d('0x3a')][_0x323d('0x4c')](_0x200b29);})[_0x323d('0x1f')](function(_0x1b8030){_0x897164['rows']=_0x1b8030;return _0x897164;})[_0x323d('0x1f')](respondWithFilteredResult(_0x24f55a,_0x200b29))['catch'](handleError(_0x24f55a,null));};exports[_0x323d('0x4d')]=function(_0x3efefc,_0x569085){var _0x1f202a={'raw':![],'where':{'id':_0x3efefc['params']['id']}},_0x5e01d8={};_0x5e01d8[_0x323d('0x3b')]=_['keys'](db[_0x323d('0x3a')][_0x323d('0x4e')]);_0x5e01d8[_0x323d('0x3d')]=_[_0x323d('0x3c')](_0x3efefc[_0x323d('0x3d')]);_0x5e01d8[_0x323d('0x3e')]=_[_0x323d('0x40')](_0x5e01d8[_0x323d('0x3b')],_0x5e01d8['query']);_0x1f202a[_0x323d('0x3f')]=_[_0x323d('0x40')](_0x5e01d8[_0x323d('0x3b')],qs[_0x323d('0x4f')](_0x3efefc[_0x323d('0x3d')][_0x323d('0x4f')]));_0x1f202a['attributes']=_0x1f202a[_0x323d('0x3f')][_0x323d('0x50')]?_0x1f202a['attributes']:_0x5e01d8['model'];if(_0x3efefc['query'][_0x323d('0x4b')]){_0x1f202a[_0x323d('0x51')]=[{'all':!![]}];}_0x1f202a=_[_0x323d('0x49')]({},_0x1f202a,_0x3efefc[_0x323d('0x4a')]);return db['DeskConfiguration']['find'](_0x1f202a)[_0x323d('0x1f')](handleEntityNotFound(_0x569085,null))[_0x323d('0x1f')](respondWithResult(_0x569085,null))[_0x323d('0x29')](handleError(_0x569085,null));};exports[_0x323d('0x52')]=function(_0x4723ba,_0xb33096){return db[_0x323d('0x3a')][_0x323d('0x52')](_0x4723ba['body'],{})[_0x323d('0x1f')](respondWithResult(_0xb33096,0xc9))['catch'](handleError(_0xb33096,null));};exports[_0x323d('0x36')]=function(_0x3a570c,_0x1f70ad){if(_0x3a570c[_0x323d('0x53')]['id']){delete _0x3a570c[_0x323d('0x53')]['id'];}return db[_0x323d('0x3a')][_0x323d('0x54')]({'where':{'id':_0x3a570c[_0x323d('0x55')]['id']}})[_0x323d('0x1f')](handleEntityNotFound(_0x1f70ad,null))[_0x323d('0x1f')](saveUpdates(_0x3a570c[_0x323d('0x53')],null))['then'](respondWithResult(_0x1f70ad,null))['catch'](handleError(_0x1f70ad,null));};exports[_0x323d('0x37')]=function(_0x32b665,_0x25abcd){return db[_0x323d('0x3a')][_0x323d('0x54')]({'where':{'id':_0x32b665['params']['id']}})['then'](handleEntityNotFound(_0x25abcd,null))[_0x323d('0x1f')](removeEntity(_0x25abcd,null))[_0x323d('0x29')](handleError(_0x25abcd,null));};exports[_0x323d('0x56')]=function(_0x552487,_0x298fd4,_0x2a73b6){var _0x15e8c6={};var _0x9998e3={};var _0x392f3f;var _0x2f12d3;return db[_0x323d('0x3a')][_0x323d('0x57')]({'where':{'id':_0x552487['params']['id']}})[_0x323d('0x1f')](handleEntityNotFound(_0x298fd4,null))['then'](function(_0x47cc75){if(_0x47cc75){_0x392f3f=_0x47cc75;_0x9998e3[_0x323d('0x3b')]=_['keys'](db[_0x323d('0x58')][_0x323d('0x4e')]);_0x9998e3[_0x323d('0x3d')]=_['keys'](_0x552487[_0x323d('0x3d')]);_0x9998e3['filters']=_[_0x323d('0x40')](_0x9998e3[_0x323d('0x3b')],_0x9998e3[_0x323d('0x3d')]);_0x15e8c6[_0x323d('0x3f')]=_[_0x323d('0x40')](_0x9998e3[_0x323d('0x3b')],qs[_0x323d('0x4f')](_0x552487[_0x323d('0x3d')]['fields']));_0x15e8c6[_0x323d('0x3f')]=_0x15e8c6['attributes'][_0x323d('0x50')]?_0x15e8c6[_0x323d('0x3f')]:_0x9998e3[_0x323d('0x3b')];_0x15e8c6[_0x323d('0x43')]=qs[_0x323d('0x44')](_0x552487[_0x323d('0x3d')]['sort']);_0x15e8c6[_0x323d('0x45')]=qs['filters'](_[_0x323d('0x59')](_0x552487[_0x323d('0x3d')],_0x9998e3['filters']));if(_0x552487[_0x323d('0x3d')][_0x323d('0x48')]){_0x15e8c6[_0x323d('0x45')]=_[_0x323d('0x49')](_0x15e8c6[_0x323d('0x45')],{'$or':_['map'](_0x15e8c6[_0x323d('0x3f')],function(_0x330f5a){var _0x15f707={};_0x15f707[_0x330f5a]={'$like':'%'+_0x552487['query']['filter']+'%'};return _0x15f707;})});}_0x15e8c6=_[_0x323d('0x49')]({},_0x15e8c6,_0x552487[_0x323d('0x4a')]);return _0x392f3f[_0x323d('0x56')](_0x15e8c6);}})['then'](function(_0x555e75){if(_0x555e75){_0x2f12d3=_0x555e75[_0x323d('0x50')];if(!_0x552487[_0x323d('0x3d')][_0x323d('0x41')](_0x323d('0x42'))){_0x15e8c6[_0x323d('0x30')]=qs[_0x323d('0x30')](_0x552487[_0x323d('0x3d')]['limit']);_0x15e8c6['offset']=qs[_0x323d('0x2f')](_0x552487['query'][_0x323d('0x2f')]);}return _0x392f3f[_0x323d('0x56')](_0x15e8c6);}})[_0x323d('0x1f')](function(_0x36ffc7){if(_0x36ffc7){return _0x36ffc7?{'count':_0x2f12d3,'rows':_0x36ffc7}:null;}})[_0x323d('0x1f')](respondWithResult(_0x298fd4,null))[_0x323d('0x29')](handleError(_0x298fd4,null));};exports[_0x323d('0x5a')]=function(_0x3b9980,_0x4fa1aa,_0x481be6){var _0x51c2e3={};var _0x330e65={};var _0xd74c22;var _0x227f79;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3b9980[_0x323d('0x55')]['id']}})[_0x323d('0x1f')](handleEntityNotFound(_0x4fa1aa,null))['then'](function(_0x1fbfde){if(_0x1fbfde){_0xd74c22=_0x1fbfde;_0x330e65['model']=_[_0x323d('0x3c')](db[_0x323d('0x58')][_0x323d('0x4e')]);_0x330e65[_0x323d('0x3d')]=_[_0x323d('0x3c')](_0x3b9980[_0x323d('0x3d')]);_0x330e65[_0x323d('0x3e')]=_[_0x323d('0x40')](_0x330e65[_0x323d('0x3b')],_0x330e65[_0x323d('0x3d')]);_0x51c2e3[_0x323d('0x3f')]=_['intersection'](_0x330e65['model'],qs['fields'](_0x3b9980[_0x323d('0x3d')]['fields']));_0x51c2e3['attributes']=_0x51c2e3['attributes']['length']?_0x51c2e3['attributes']:_0x330e65['model'];_0x51c2e3[_0x323d('0x43')]=qs['sort'](_0x3b9980[_0x323d('0x3d')][_0x323d('0x44')]);_0x51c2e3[_0x323d('0x45')]=qs[_0x323d('0x3e')](_[_0x323d('0x59')](_0x3b9980[_0x323d('0x3d')],_0x330e65[_0x323d('0x3e')]));if(_0x3b9980[_0x323d('0x3d')]['filter']){_0x51c2e3['where']=_[_0x323d('0x49')](_0x51c2e3[_0x323d('0x45')],{'$or':_['map'](_0x51c2e3[_0x323d('0x3f')],function(_0x3505a4){var _0x12e8fa={};_0x12e8fa[_0x3505a4]={'$like':'%'+_0x3b9980[_0x323d('0x3d')][_0x323d('0x48')]+'%'};return _0x12e8fa;})});}_0x51c2e3=_[_0x323d('0x49')]({},_0x51c2e3,_0x3b9980[_0x323d('0x4a')]);return _0xd74c22[_0x323d('0x5a')](_0x51c2e3);}})[_0x323d('0x1f')](function(_0x565edf){if(_0x565edf){_0x227f79=_0x565edf[_0x323d('0x50')];if(!_0x3b9980[_0x323d('0x3d')][_0x323d('0x41')](_0x323d('0x42'))){_0x51c2e3[_0x323d('0x30')]=qs['limit'](_0x3b9980[_0x323d('0x3d')]['limit']);_0x51c2e3[_0x323d('0x2f')]=qs[_0x323d('0x2f')](_0x3b9980[_0x323d('0x3d')][_0x323d('0x2f')]);}return _0xd74c22[_0x323d('0x5a')](_0x51c2e3);}})[_0x323d('0x1f')](function(_0x4006e1){if(_0x4006e1){return _0x4006e1?{'count':_0x227f79,'rows':_0x4006e1}:null;}})[_0x323d('0x1f')](respondWithResult(_0x4fa1aa,null))[_0x323d('0x29')](handleError(_0x4fa1aa,null));};exports[_0x323d('0x5b')]=function(_0x435e12,_0x2082c3,_0x455ad8){var _0x41fa1a={};var _0x255fa5={};var _0x75541c;var _0x40a757;return db[_0x323d('0x3a')][_0x323d('0x57')]({'where':{'id':_0x435e12[_0x323d('0x55')]['id']}})[_0x323d('0x1f')](handleEntityNotFound(_0x2082c3,null))['then'](function(_0x401e79){if(_0x401e79){_0x75541c=_0x401e79;_0x255fa5[_0x323d('0x3b')]=_[_0x323d('0x3c')](db['DeskField'][_0x323d('0x4e')]);_0x255fa5[_0x323d('0x3d')]=_[_0x323d('0x3c')](_0x435e12[_0x323d('0x3d')]);_0x255fa5[_0x323d('0x3e')]=_['intersection'](_0x255fa5['model'],_0x255fa5[_0x323d('0x3d')]);_0x41fa1a[_0x323d('0x3f')]=_[_0x323d('0x40')](_0x255fa5[_0x323d('0x3b')],qs[_0x323d('0x4f')](_0x435e12['query'][_0x323d('0x4f')]));_0x41fa1a[_0x323d('0x3f')]=_0x41fa1a[_0x323d('0x3f')][_0x323d('0x50')]?_0x41fa1a[_0x323d('0x3f')]:_0x255fa5[_0x323d('0x3b')];_0x41fa1a[_0x323d('0x43')]=qs[_0x323d('0x44')](_0x435e12[_0x323d('0x3d')][_0x323d('0x44')]);_0x41fa1a[_0x323d('0x45')]=qs[_0x323d('0x3e')](_[_0x323d('0x59')](_0x435e12[_0x323d('0x3d')],_0x255fa5['filters']));if(_0x435e12['query'][_0x323d('0x48')]){_0x41fa1a[_0x323d('0x45')]=_[_0x323d('0x49')](_0x41fa1a[_0x323d('0x45')],{'$or':_[_0x323d('0x46')](_0x41fa1a[_0x323d('0x3f')],function(_0x294c8c){var _0x605b5c={};_0x605b5c[_0x294c8c]={'$like':'%'+_0x435e12['query'][_0x323d('0x48')]+'%'};return _0x605b5c;})});}_0x41fa1a=_[_0x323d('0x49')]({},_0x41fa1a,_0x435e12[_0x323d('0x4a')]);return _0x75541c[_0x323d('0x5b')](_0x41fa1a);}})[_0x323d('0x1f')](function(_0x1e428c){if(_0x1e428c){_0x40a757=_0x1e428c[_0x323d('0x50')];if(!_0x435e12[_0x323d('0x3d')][_0x323d('0x41')](_0x323d('0x42'))){_0x41fa1a[_0x323d('0x30')]=qs[_0x323d('0x30')](_0x435e12[_0x323d('0x3d')][_0x323d('0x30')]);_0x41fa1a[_0x323d('0x2f')]=qs[_0x323d('0x2f')](_0x435e12['query'][_0x323d('0x2f')]);}return _0x75541c[_0x323d('0x5b')](_0x41fa1a);}})[_0x323d('0x1f')](function(_0x2dafd3){if(_0x2dafd3){return _0x2dafd3?{'count':_0x40a757,'rows':_0x2dafd3}:null;}})[_0x323d('0x1f')](respondWithResult(_0x2082c3,null))[_0x323d('0x29')](handleError(_0x2082c3,null));};exports[_0x323d('0x5c')]=function(_0xaef6ea,_0x33cb7a,_0x2d8b0e){var _0x5870bf={};var _0x49fd26={};var _0x380628;var _0x431d2c;return db[_0x323d('0x3a')][_0x323d('0x57')]({'where':{'id':_0xaef6ea[_0x323d('0x55')]['id']}})['then'](handleEntityNotFound(_0x33cb7a,null))['then'](function(_0x4f0f38){if(_0x4f0f38){_0x380628=_0x4f0f38;_0x49fd26[_0x323d('0x3b')]=_['keys'](db[_0x323d('0x5d')][_0x323d('0x4e')]);_0x49fd26['query']=_[_0x323d('0x3c')](_0xaef6ea['query']);_0x49fd26[_0x323d('0x3e')]=_[_0x323d('0x40')](_0x49fd26[_0x323d('0x3b')],_0x49fd26[_0x323d('0x3d')]);_0x5870bf[_0x323d('0x3f')]=_[_0x323d('0x40')](_0x49fd26['model'],qs[_0x323d('0x4f')](_0xaef6ea[_0x323d('0x3d')][_0x323d('0x4f')]));_0x5870bf[_0x323d('0x3f')]=_0x5870bf[_0x323d('0x3f')][_0x323d('0x50')]?_0x5870bf['attributes']:_0x49fd26[_0x323d('0x3b')];_0x5870bf[_0x323d('0x43')]=qs[_0x323d('0x44')](_0xaef6ea[_0x323d('0x3d')][_0x323d('0x44')]);_0x5870bf[_0x323d('0x45')]=qs[_0x323d('0x3e')](_[_0x323d('0x59')](_0xaef6ea[_0x323d('0x3d')],_0x49fd26['filters']));if(_0xaef6ea['query'][_0x323d('0x48')]){_0x5870bf[_0x323d('0x45')]=_[_0x323d('0x49')](_0x5870bf[_0x323d('0x45')],{'$or':_['map'](_0x5870bf[_0x323d('0x3f')],function(_0x3997e5){var _0xb08784={};_0xb08784[_0x3997e5]={'$like':'%'+_0xaef6ea[_0x323d('0x3d')][_0x323d('0x48')]+'%'};return _0xb08784;})});}_0x5870bf=_[_0x323d('0x49')]({},_0x5870bf,_0xaef6ea['options']);return _0x380628[_0x323d('0x5c')](_0x5870bf);}})[_0x323d('0x1f')](function(_0x49a87f){if(_0x49a87f){_0x431d2c=_0x49a87f[_0x323d('0x50')];if(!_0xaef6ea[_0x323d('0x3d')][_0x323d('0x41')](_0x323d('0x42'))){_0x5870bf['limit']=qs['limit'](_0xaef6ea[_0x323d('0x3d')]['limit']);_0x5870bf['offset']=qs[_0x323d('0x2f')](_0xaef6ea[_0x323d('0x3d')]['offset']);}return _0x380628['getTags'](_0x5870bf);}})[_0x323d('0x1f')](function(_0x3c944e){if(_0x3c944e){return _0x3c944e?{'count':_0x431d2c,'rows':_0x3c944e}:null;}})[_0x323d('0x1f')](respondWithResult(_0x33cb7a,null))[_0x323d('0x29')](handleError(_0x33cb7a,null));};exports[_0x323d('0x5e')]=function(_0x1a4fd4,_0x4d9faa,_0x13cb18){if(_0x1a4fd4[_0x323d('0x53')]['id']){delete _0x1a4fd4['body']['id'];}return db[_0x323d('0x3a')][_0x323d('0x57')]({'where':{'id':_0x1a4fd4[_0x323d('0x55')]['id']}})[_0x323d('0x1f')](handleEntityNotFound(_0x4d9faa,null))[_0x323d('0x1f')](function(_0x8d0593){if(_0x8d0593){return _0x8d0593[_0x323d('0x5e')](_0x1a4fd4[_0x323d('0x53')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4d9faa,null))['catch'](handleError(_0x4d9faa,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b97e7bb..d6a48bb 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 _0xbed1=['request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','bluebird'];(function(_0x2a0da3,_0x2c606e){var _0x21f28d=function(_0x2f6f3b){while(--_0x2f6f3b){_0x2a0da3['push'](_0x2a0da3['shift']());}};_0x21f28d(++_0x2c606e);}(_0xbed1,0x164));var _0x1bed=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xbed1[_0x587ba2];return _0x50ec73;};'use strict';var _=require(_0x1bed('0x0'));var util=require(_0x1bed('0x1'));var logger=require(_0x1bed('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1bed('0x3'));var rp=require(_0x1bed('0x4'));var fs=require('fs');var path=require(_0x1bed('0x5'));var rimraf=require('rimraf');var config=require(_0x1bed('0x6'));var attributes=require(_0x1bed('0x7'));module[_0x1bed('0x8')]=function(_0x4215d4,_0x541b81){return _0x4215d4[_0x1bed('0x9')](_0x1bed('0xa'),attributes,{'tableName':_0x1bed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9958=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x133321,_0x2ffe49){var _0xa63f12=function(_0x2a7dca){while(--_0x2a7dca){_0x133321['push'](_0x133321['shift']());}};_0xa63f12(++_0x2ffe49);}(_0x9958,0x85));var _0x8995=function(_0x45cf20,_0x4595b6){_0x45cf20=_0x45cf20-0x0;var _0x5a7b20=_0x9958[_0x45cf20];return _0x5a7b20;};'use strict';var _=require(_0x8995('0x0'));var util=require(_0x8995('0x1'));var logger=require(_0x8995('0x2'))(_0x8995('0x3'));var moment=require(_0x8995('0x4'));var BPromise=require(_0x8995('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8995('0x6'));var rimraf=require(_0x8995('0x7'));var config=require(_0x8995('0x8'));var attributes=require(_0x8995('0x9'));module[_0x8995('0xa')]=function(_0x23d66b,_0x166f8c){return _0x23d66b[_0x8995('0xb')](_0x8995('0xc'),attributes,{'tableName':_0x8995('0xd'),'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 c752056..71e7280 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x53ec,0x192));var _0xc53e=function(_0x48271f,_0xc4f6d3){_0x48271f=_0x48271f-0x0;var _0x13eb5c=_0x53ec[_0x48271f];return _0x13eb5c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4d6752,_0xe185c6){var _0x3ed1a2=function(_0x3c578d){while(--_0x3c578d){_0x4d6752['push'](_0x4d6752['shift']());}};_0x3ed1a2(++_0xe185c6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x5fc3[_0x162780];return _0x1ea2dc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6016282..2a1103f 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 _0xac77=['destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete'];(function(_0x252481,_0x32dc40){var _0x8f8023=function(_0x4ce094){while(--_0x4ce094){_0x252481['push'](_0x252481['shift']());}};_0x8f8023(++_0x32dc40);}(_0xac77,0x10f));var _0x7ac7=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xac77[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require(_0x7ac7('0x0'));var path=require('path');var timeout=require(_0x7ac7('0x1'));var express=require('express');var router=express[_0x7ac7('0x2')]();var auth=require(_0x7ac7('0x3'));var interaction=require(_0x7ac7('0x4'));var config=require(_0x7ac7('0x5'));var controller=require(_0x7ac7('0x6'));router['get']('/',auth[_0x7ac7('0x7')](),controller[_0x7ac7('0x8')]);router[_0x7ac7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7ac7('0xa')]);router[_0x7ac7('0xb')]('/',auth[_0x7ac7('0x7')](),controller[_0x7ac7('0xc')]);router[_0x7ac7('0xd')](_0x7ac7('0xe'),auth[_0x7ac7('0x7')](),controller[_0x7ac7('0xf')]);router[_0x7ac7('0x10')](_0x7ac7('0xe'),auth[_0x7ac7('0x7')](),controller[_0x7ac7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x20ec=['delete','/:id','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show'];(function(_0x146d37,_0x25d1fb){var _0x839d92=function(_0x49db24){while(--_0x49db24){_0x146d37['push'](_0x146d37['shift']());}};_0x839d92(++_0x25d1fb);}(_0x20ec,0x6d));var _0xc20e=function(_0x272fa4,_0xf712d1){_0x272fa4=_0x272fa4-0x0;var _0x25ec85=_0x20ec[_0x272fa4];return _0x25ec85;};'use strict';var multer=require('multer');var util=require(_0xc20e('0x0'));var path=require(_0xc20e('0x1'));var timeout=require('connect-timeout');var express=require(_0xc20e('0x2'));var router=express[_0xc20e('0x3')]();var auth=require(_0xc20e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc20e('0x5'));var controller=require(_0xc20e('0x6'));router[_0xc20e('0x7')]('/',auth[_0xc20e('0x8')](),controller[_0xc20e('0x9')]);router[_0xc20e('0x7')]('/:id',auth[_0xc20e('0x8')](),controller[_0xc20e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xc20e('0x8')](),controller['update']);router[_0xc20e('0xb')](_0xc20e('0xc'),auth['isAuthenticated'](),controller[_0xc20e('0xd')]);module[_0xc20e('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index f2f2391..7d00d5c 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 _0xda3f=['keyValue','STRING','string','variable','BOOLEAN','exports','ENUM'];(function(_0x11e8f3,_0x5a7c90){var _0x14a41b=function(_0x53c3ee){while(--_0x53c3ee){_0x11e8f3['push'](_0x11e8f3['shift']());}};_0x14a41b(++_0x5a7c90);}(_0xda3f,0xec));var _0xfda3=function(_0x5cf0e3,_0x50a215){_0x5cf0e3=_0x5cf0e3-0x0;var _0x29c9d5=_0xda3f[_0x5cf0e3];return _0x29c9d5;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'type':{'type':Sequelize[_0xfda3('0x1')]('string','variable','customVariable',_0xfda3('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfda3('0x3')]},'key':{'type':Sequelize[_0xfda3('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xfda3('0x4'),_0xfda3('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfda3('0x3')]},'nameField':{'type':Sequelize[_0xfda3('0x3')]},'customField':{'type':Sequelize[_0xfda3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfda3('0x3')]}}; \ No newline at end of file +var _0xec56=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x2d8cc8,_0x344af8){var _0x688977=function(_0x33c201){while(--_0x33c201){_0x2d8cc8['push'](_0x2d8cc8['shift']());}};_0x688977(++_0x344af8);}(_0xec56,0x1bd));var _0x6ec5=function(_0x219460,_0x42accc){_0x219460=_0x219460-0x0;var _0x35fcf7=_0xec56[_0x219460];return _0x35fcf7;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'),_0x6ec5('0x4')),'defaultValue':_0x6ec5('0x1')},'content':{'type':Sequelize[_0x6ec5('0x5')]},'key':{'type':Sequelize[_0x6ec5('0x5')]},'keyType':{'type':Sequelize[_0x6ec5('0x6')](_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3'))},'keyContent':{'type':Sequelize[_0x6ec5('0x5')]},'idField':{'type':Sequelize[_0x6ec5('0x5')]},'nameField':{'type':Sequelize[_0x6ec5('0x5')]},'customField':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ec5('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8f2af15..f2383bb 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 _0x03dc=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','then','error','name','send','index','DeskField','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','key','field','merge','options','count','includeAll','findAll','show','params','include','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x5ccede,_0x85d483){var _0x1b5a00=function(_0x16842a){while(--_0x16842a){_0x5ccede['push'](_0x5ccede['shift']());}};_0x1b5a00(++_0x85d483);}(_0x03dc,0x85));var _0xc03d=function(_0x326124,_0x34c3e3){_0x326124=_0x326124-0x0;var _0x6a81d4=_0x03dc[_0x326124];return _0x6a81d4;};'use strict';var pdf=require(_0xc03d('0x0'));var emlformat=require(_0xc03d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc03d('0x2'));var rp=require(_0xc03d('0x3'));var moment=require(_0xc03d('0x4'));var BPromise=require(_0xc03d('0x5'));var Mustache=require(_0xc03d('0x6'));var util=require(_0xc03d('0x7'));var path=require('path');var sox=require(_0xc03d('0x8'));var csv=require(_0xc03d('0x9'));var ejs=require(_0xc03d('0xa'));var fs=require('fs');var _=require(_0xc03d('0xb'));var squel=require(_0xc03d('0xc'));var crypto=require(_0xc03d('0xd'));var jsforce=require(_0xc03d('0xe'));var deskjs=require(_0xc03d('0xf'));var toCsv=require(_0xc03d('0x9'));var querystring=require(_0xc03d('0x10'));var Papa=require('papaparse');var Redis=require(_0xc03d('0x11'));var authService=require(_0xc03d('0x12'));var qs=require(_0xc03d('0x13'));var hardwareService=require(_0xc03d('0x14'));var logger=require(_0xc03d('0x15'))(_0xc03d('0x16'));var utils=require(_0xc03d('0x17'));var config=require(_0xc03d('0x18'));var db=require(_0xc03d('0x19'))['db'];function respondWithStatusCode(_0x2829fe,_0x4e0adb){_0x4e0adb=_0x4e0adb||0xcc;return function(_0x1be8b6){if(_0x1be8b6){return _0x2829fe[_0xc03d('0x1a')](_0x4e0adb);}return _0x2829fe[_0xc03d('0x1b')](_0x4e0adb)[_0xc03d('0x1c')]();};}function respondWithResult(_0x3add04,_0x45a86e){_0x45a86e=_0x45a86e||0xc8;return function(_0x4dd024){if(_0x4dd024){return _0x3add04[_0xc03d('0x1b')](_0x45a86e)[_0xc03d('0x1d')](_0x4dd024);}};}function respondWithFilteredResult(_0x5a5d60,_0x3cf161){return function(_0x580669){if(_0x580669){var _0x52c7f5=_0x580669['count'],_0x5e5a82=_0x3cf161['offset'],_0x2cca24=_0x3cf161[_0xc03d('0x1e')]+_0x3cf161['limit'],_0xc581c;if(_0x2cca24>=_0x52c7f5){_0x2cca24=_0x52c7f5;_0xc581c=0xc8;}else{_0xc581c=0xce;}_0x5a5d60[_0xc03d('0x1b')](_0xc581c);return _0x5a5d60[_0xc03d('0x1f')](_0xc03d('0x20'),_0x5e5a82+'-'+_0x2cca24+'/'+_0x52c7f5)[_0xc03d('0x1d')](_0x580669);}return null;};}function patchUpdates(_0x30785f){return function(_0x5995fb){try{jsonpatch[_0xc03d('0x21')](_0x5995fb,_0x30785f,!![]);}catch(_0x3db242){return BPromise['reject'](_0x3db242);}return _0x5995fb[_0xc03d('0x22')]();};}function saveUpdates(_0x5d9ee4,_0xd6b76e){return function(_0x2e8629){if(_0x2e8629){return _0x2e8629[_0xc03d('0x23')](_0x5d9ee4)['then'](function(_0x4199d9){return _0x4199d9;});}return null;};}function removeEntity(_0x54b8c5,_0x14e5e5){return function(_0x28dd00){if(_0x28dd00){return _0x28dd00['destroy']()[_0xc03d('0x24')](function(){_0x54b8c5[_0xc03d('0x1b')](0xcc)[_0xc03d('0x1c')]();});}};}function handleEntityNotFound(_0x35e3f8,_0x2bec9b){return function(_0x2eead0){if(!_0x2eead0){_0x35e3f8[_0xc03d('0x1a')](0x194);}return _0x2eead0;};}function handleError(_0x216e85,_0x3c94dd){_0x3c94dd=_0x3c94dd||0x1f4;return function(_0x263533){logger[_0xc03d('0x25')](_0x263533['stack']);if(_0x263533['name']){delete _0x263533[_0xc03d('0x26')];}_0x216e85[_0xc03d('0x1b')](_0x3c94dd)[_0xc03d('0x27')](_0x263533);};}exports[_0xc03d('0x28')]=function(_0x512434,_0x139b58){var _0x3df243={},_0x298e97={},_0x1f2e04={'count':0x0,'rows':[]};var _0x10c287=db[_0xc03d('0x29')][_0xc03d('0x2a')];_0x298e97['model']=_[_0xc03d('0x2b')](_0x10c287);_0x298e97[_0xc03d('0x2c')]=_['keys'](_0x512434[_0xc03d('0x2c')]);_0x298e97[_0xc03d('0x2d')]=_['intersection'](_0x298e97[_0xc03d('0x2e')],_0x298e97[_0xc03d('0x2c')]);_0x3df243[_0xc03d('0x2f')]=_[_0xc03d('0x30')](_0x298e97['model'],qs[_0xc03d('0x31')](_0x512434[_0xc03d('0x2c')][_0xc03d('0x31')]));_0x3df243['attributes']=_0x3df243[_0xc03d('0x2f')][_0xc03d('0x32')]?_0x3df243[_0xc03d('0x2f')]:_0x298e97[_0xc03d('0x2e')];if(!_0x512434[_0xc03d('0x2c')][_0xc03d('0x33')](_0xc03d('0x34'))){_0x3df243['limit']=qs[_0xc03d('0x35')](_0x512434[_0xc03d('0x2c')][_0xc03d('0x35')]);_0x3df243[_0xc03d('0x1e')]=qs[_0xc03d('0x1e')](_0x512434['query'][_0xc03d('0x1e')]);}_0x3df243[_0xc03d('0x36')]=qs[_0xc03d('0x37')](_0x512434['query'][_0xc03d('0x37')]);_0x3df243['where']=qs[_0xc03d('0x2d')](_[_0xc03d('0x38')](_0x512434[_0xc03d('0x2c')],_0x298e97[_0xc03d('0x2d')]));if(_0x512434[_0xc03d('0x2c')][_0xc03d('0x39')]){_0x3df243[_0xc03d('0x3a')]=_['merge'](_0x3df243[_0xc03d('0x3a')],{'$or':_[_0xc03d('0x3b')](_0x10c287,function(_0x57086f){if(_0x57086f['type'][_0xc03d('0x3c')]!=='VIRTUAL'){var _0x29bbf8={};_0x29bbf8[_0x57086f[_0xc03d('0x3d')]]={'$like':'%'+_0x512434[_0xc03d('0x2c')][_0xc03d('0x39')]+'%'};return _0x29bbf8;}})});}_0x3df243=_[_0xc03d('0x3e')]({},_0x3df243,_0x512434[_0xc03d('0x3f')]);var _0x14c3c4={'where':_0x3df243[_0xc03d('0x3a')]};return db['DeskField'][_0xc03d('0x40')](_0x14c3c4)[_0xc03d('0x24')](function(_0x3e53bc){_0x1f2e04[_0xc03d('0x40')]=_0x3e53bc;if(_0x512434[_0xc03d('0x2c')][_0xc03d('0x41')]){_0x3df243['include']=[{'all':!![]}];}return db[_0xc03d('0x29')][_0xc03d('0x42')](_0x3df243);})[_0xc03d('0x24')](function(_0x5861c2){_0x1f2e04['rows']=_0x5861c2;return _0x1f2e04;})[_0xc03d('0x24')](respondWithFilteredResult(_0x139b58,_0x3df243))['catch'](handleError(_0x139b58,null));};exports[_0xc03d('0x43')]=function(_0xb01f17,_0x1ff19f){var _0x89675e={'raw':!![],'where':{'id':_0xb01f17[_0xc03d('0x44')]['id']}},_0x2d8ba4={};_0x2d8ba4[_0xc03d('0x2e')]=_[_0xc03d('0x2b')](db[_0xc03d('0x29')][_0xc03d('0x2a')]);_0x2d8ba4[_0xc03d('0x2c')]=_[_0xc03d('0x2b')](_0xb01f17['query']);_0x2d8ba4[_0xc03d('0x2d')]=_[_0xc03d('0x30')](_0x2d8ba4['model'],_0x2d8ba4[_0xc03d('0x2c')]);_0x89675e['attributes']=_[_0xc03d('0x30')](_0x2d8ba4[_0xc03d('0x2e')],qs['fields'](_0xb01f17[_0xc03d('0x2c')][_0xc03d('0x31')]));_0x89675e['attributes']=_0x89675e[_0xc03d('0x2f')][_0xc03d('0x32')]?_0x89675e[_0xc03d('0x2f')]:_0x2d8ba4[_0xc03d('0x2e')];if(_0xb01f17['query']['includeAll']){_0x89675e[_0xc03d('0x45')]=[{'all':!![]}];}_0x89675e=_[_0xc03d('0x3e')]({},_0x89675e,_0xb01f17[_0xc03d('0x3f')]);return db[_0xc03d('0x29')]['find'](_0x89675e)['then'](handleEntityNotFound(_0x1ff19f,null))[_0xc03d('0x24')](respondWithResult(_0x1ff19f,null))[_0xc03d('0x46')](handleError(_0x1ff19f,null));};exports[_0xc03d('0x47')]=function(_0x49d0e4,_0x226212){return db['DeskField']['create'](_0x49d0e4['body'],{})['then'](respondWithResult(_0x226212,0xc9))[_0xc03d('0x46')](handleError(_0x226212,null));};exports[_0xc03d('0x23')]=function(_0x17e6d2,_0x3dcfb5){if(_0x17e6d2['body']['id']){delete _0x17e6d2[_0xc03d('0x48')]['id'];}return db[_0xc03d('0x29')]['find']({'where':{'id':_0x17e6d2[_0xc03d('0x44')]['id']}})[_0xc03d('0x24')](handleEntityNotFound(_0x3dcfb5,null))[_0xc03d('0x24')](saveUpdates(_0x17e6d2['body'],null))[_0xc03d('0x24')](respondWithResult(_0x3dcfb5,null))[_0xc03d('0x46')](handleError(_0x3dcfb5,null));};exports['destroy']=function(_0x2e5dfe,_0x200c91){return db[_0xc03d('0x29')]['find']({'where':{'id':_0x2e5dfe[_0xc03d('0x44')]['id']}})['then'](handleEntityNotFound(_0x200c91,null))[_0xc03d('0x24')](removeEntity(_0x200c91,null))[_0xc03d('0x46')](handleError(_0x200c91,null));}; \ No newline at end of file +var _0xbc5e=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','DeskField','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','merge','find','create','body','params','html-pdf'];(function(_0x1b0055,_0x38bb71){var _0x13cf94=function(_0x277a1f){while(--_0x277a1f){_0x1b0055['push'](_0x1b0055['shift']());}};_0x13cf94(++_0x38bb71);}(_0xbc5e,0xda));var _0xebc5=function(_0x1cfdde,_0x5c132c){_0x1cfdde=_0x1cfdde-0x0;var _0x185876=_0xbc5e[_0x1cfdde];return _0x185876;};'use strict';var pdf=require(_0xebc5('0x0'));var emlformat=require(_0xebc5('0x1'));var rimraf=require(_0xebc5('0x2'));var zipdir=require(_0xebc5('0x3'));var jsonpatch=require(_0xebc5('0x4'));var rp=require(_0xebc5('0x5'));var moment=require(_0xebc5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require(_0xebc5('0x9'));var sox=require('sox');var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xebc5('0xc'));var crypto=require('crypto');var jsforce=require(_0xebc5('0xd'));var deskjs=require(_0xebc5('0xe'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0xf'));var Papa=require(_0xebc5('0x10'));var Redis=require(_0xebc5('0x11'));var authService=require(_0xebc5('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xebc5('0x13'));var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require(_0xebc5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39f5d8,_0x31a833){_0x31a833=_0x31a833||0xcc;return function(_0x513c85){if(_0x513c85){return _0x39f5d8[_0xebc5('0x18')](_0x31a833);}return _0x39f5d8['status'](_0x31a833)[_0xebc5('0x19')]();};}function respondWithResult(_0x4fdb5a,_0x52038f){_0x52038f=_0x52038f||0xc8;return function(_0x1209df){if(_0x1209df){return _0x4fdb5a['status'](_0x52038f)[_0xebc5('0x1a')](_0x1209df);}};}function respondWithFilteredResult(_0x27c407,_0x5b2397){return function(_0x10f61b){if(_0x10f61b){var _0x1783fe=_0x10f61b['count'],_0x142207=_0x5b2397[_0xebc5('0x1b')],_0x5abc00=_0x5b2397[_0xebc5('0x1b')]+_0x5b2397[_0xebc5('0x1c')],_0x24851a;if(_0x5abc00>=_0x1783fe){_0x5abc00=_0x1783fe;_0x24851a=0xc8;}else{_0x24851a=0xce;}_0x27c407[_0xebc5('0x1d')](_0x24851a);return _0x27c407[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x142207+'-'+_0x5abc00+'/'+_0x1783fe)[_0xebc5('0x1a')](_0x10f61b);}return null;};}function patchUpdates(_0x464fd3){return function(_0x102d53){try{jsonpatch[_0xebc5('0x20')](_0x102d53,_0x464fd3,!![]);}catch(_0x473fea){return BPromise[_0xebc5('0x21')](_0x473fea);}return _0x102d53[_0xebc5('0x22')]();};}function saveUpdates(_0x2c4a41,_0xdf50fd){return function(_0x567f16){if(_0x567f16){return _0x567f16[_0xebc5('0x23')](_0x2c4a41)[_0xebc5('0x24')](function(_0x41c921){return _0x41c921;});}return null;};}function removeEntity(_0xf8e0ea,_0x2dabad){return function(_0x86ff0c){if(_0x86ff0c){return _0x86ff0c[_0xebc5('0x25')]()[_0xebc5('0x24')](function(){_0xf8e0ea[_0xebc5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd32aa3,_0x12e3c2){return function(_0x1039c8){if(!_0x1039c8){_0xd32aa3[_0xebc5('0x18')](0x194);}return _0x1039c8;};}function handleError(_0x424b3b,_0x2680ca){_0x2680ca=_0x2680ca||0x1f4;return function(_0x2ecf0f){logger[_0xebc5('0x26')](_0x2ecf0f[_0xebc5('0x27')]);if(_0x2ecf0f[_0xebc5('0x28')]){delete _0x2ecf0f['name'];}_0x424b3b[_0xebc5('0x1d')](_0x2680ca)[_0xebc5('0x29')](_0x2ecf0f);};}exports['index']=function(_0x521153,_0x1f1037){var _0x4ab453={},_0x5bceb2={},_0x4a8e77={'count':0x0,'rows':[]};var _0x337aba=db[_0xebc5('0x2a')][_0xebc5('0x2b')];_0x5bceb2['model']=_['keys'](_0x337aba);_0x5bceb2['query']=_[_0xebc5('0x2c')](_0x521153[_0xebc5('0x2d')]);_0x5bceb2['filters']=_['intersection'](_0x5bceb2[_0xebc5('0x2e')],_0x5bceb2[_0xebc5('0x2d')]);_0x4ab453[_0xebc5('0x2f')]=_[_0xebc5('0x30')](_0x5bceb2['model'],qs[_0xebc5('0x31')](_0x521153[_0xebc5('0x2d')][_0xebc5('0x31')]));_0x4ab453['attributes']=_0x4ab453['attributes'][_0xebc5('0x32')]?_0x4ab453[_0xebc5('0x2f')]:_0x5bceb2['model'];if(!_0x521153[_0xebc5('0x2d')][_0xebc5('0x33')](_0xebc5('0x34'))){_0x4ab453[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x521153['query'][_0xebc5('0x1c')]);_0x4ab453[_0xebc5('0x1b')]=qs[_0xebc5('0x1b')](_0x521153[_0xebc5('0x2d')]['offset']);}_0x4ab453[_0xebc5('0x35')]=qs[_0xebc5('0x36')](_0x521153[_0xebc5('0x2d')][_0xebc5('0x36')]);_0x4ab453[_0xebc5('0x37')]=qs[_0xebc5('0x38')](_[_0xebc5('0x39')](_0x521153['query'],_0x5bceb2[_0xebc5('0x38')]));if(_0x521153[_0xebc5('0x2d')]['filter']){_0x4ab453[_0xebc5('0x37')]=_['merge'](_0x4ab453[_0xebc5('0x37')],{'$or':_['map'](_0x337aba,function(_0x10ee62){if(_0x10ee62[_0xebc5('0x3a')][_0xebc5('0x3b')]!==_0xebc5('0x3c')){var _0x29472b={};_0x29472b[_0x10ee62[_0xebc5('0x3d')]]={'$like':'%'+_0x521153[_0xebc5('0x2d')]['filter']+'%'};return _0x29472b;}})});}_0x4ab453=_['merge']({},_0x4ab453,_0x521153[_0xebc5('0x3e')]);var _0x25effd={'where':_0x4ab453[_0xebc5('0x37')]};return db[_0xebc5('0x2a')][_0xebc5('0x3f')](_0x25effd)[_0xebc5('0x24')](function(_0x4f9cbc){_0x4a8e77[_0xebc5('0x3f')]=_0x4f9cbc;if(_0x521153[_0xebc5('0x2d')][_0xebc5('0x40')]){_0x4ab453[_0xebc5('0x41')]=[{'all':!![]}];}return db[_0xebc5('0x2a')][_0xebc5('0x42')](_0x4ab453);})[_0xebc5('0x24')](function(_0x39f2d8){_0x4a8e77['rows']=_0x39f2d8;return _0x4a8e77;})[_0xebc5('0x24')](respondWithFilteredResult(_0x1f1037,_0x4ab453))[_0xebc5('0x43')](handleError(_0x1f1037,null));};exports['show']=function(_0x1933ff,_0x3d27a2){var _0x27c10e={'raw':!![],'where':{'id':_0x1933ff['params']['id']}},_0x57348b={};_0x57348b[_0xebc5('0x2e')]=_[_0xebc5('0x2c')](db[_0xebc5('0x2a')][_0xebc5('0x2b')]);_0x57348b['query']=_[_0xebc5('0x2c')](_0x1933ff[_0xebc5('0x2d')]);_0x57348b[_0xebc5('0x38')]=_[_0xebc5('0x30')](_0x57348b[_0xebc5('0x2e')],_0x57348b[_0xebc5('0x2d')]);_0x27c10e[_0xebc5('0x2f')]=_[_0xebc5('0x30')](_0x57348b['model'],qs[_0xebc5('0x31')](_0x1933ff[_0xebc5('0x2d')][_0xebc5('0x31')]));_0x27c10e['attributes']=_0x27c10e['attributes']['length']?_0x27c10e[_0xebc5('0x2f')]:_0x57348b[_0xebc5('0x2e')];if(_0x1933ff[_0xebc5('0x2d')][_0xebc5('0x40')]){_0x27c10e['include']=[{'all':!![]}];}_0x27c10e=_[_0xebc5('0x44')]({},_0x27c10e,_0x1933ff[_0xebc5('0x3e')]);return db[_0xebc5('0x2a')][_0xebc5('0x45')](_0x27c10e)[_0xebc5('0x24')](handleEntityNotFound(_0x3d27a2,null))[_0xebc5('0x24')](respondWithResult(_0x3d27a2,null))[_0xebc5('0x43')](handleError(_0x3d27a2,null));};exports[_0xebc5('0x46')]=function(_0x4f2e5f,_0x3a2c52){return db['DeskField'][_0xebc5('0x46')](_0x4f2e5f['body'],{})['then'](respondWithResult(_0x3a2c52,0xc9))[_0xebc5('0x43')](handleError(_0x3a2c52,null));};exports[_0xebc5('0x23')]=function(_0x1aa4ca,_0x4eabe1){if(_0x1aa4ca['body']['id']){delete _0x1aa4ca[_0xebc5('0x47')]['id'];}return db[_0xebc5('0x2a')][_0xebc5('0x45')]({'where':{'id':_0x1aa4ca[_0xebc5('0x48')]['id']}})[_0xebc5('0x24')](handleEntityNotFound(_0x4eabe1,null))['then'](saveUpdates(_0x1aa4ca[_0xebc5('0x47')],null))[_0xebc5('0x24')](respondWithResult(_0x4eabe1,null))[_0xebc5('0x43')](handleError(_0x4eabe1,null));};exports['destroy']=function(_0xdd56fa,_0x1c378e){return db[_0xebc5('0x2a')][_0xebc5('0x45')]({'where':{'id':_0xdd56fa[_0xebc5('0x48')]['id']}})[_0xebc5('0x24')](handleEntityNotFound(_0x1c378e,null))[_0xebc5('0x24')](removeEntity(_0x1c378e,null))[_0xebc5('0x43')](handleError(_0x1c378e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4a25a9a..f74eaba 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 _0xb8ba=['request-promise','path','rimraf','../../config/environment','exports','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x4e231f,_0x315a9e){var _0x43a501=function(_0x58bdbb){while(--_0x58bdbb){_0x4e231f['push'](_0x4e231f['shift']());}};_0x43a501(++_0x315a9e);}(_0xb8ba,0xa4));var _0xab8b=function(_0x36463e,_0x572c32){_0x36463e=_0x36463e-0x0;var _0x34386f=_0xb8ba[_0x36463e];return _0x34386f;};'use strict';var _=require(_0xab8b('0x0'));var util=require(_0xab8b('0x1'));var logger=require(_0xab8b('0x2'))(_0xab8b('0x3'));var moment=require('moment');var BPromise=require(_0xab8b('0x4'));var rp=require(_0xab8b('0x5'));var fs=require('fs');var path=require(_0xab8b('0x6'));var rimraf=require(_0xab8b('0x7'));var config=require(_0xab8b('0x8'));var attributes=require('./intDeskField.attributes');module[_0xab8b('0x9')]=function(_0x53591c,_0x4d29e1){return _0x53591c['define']('DeskField',attributes,{'tableName':_0xab8b('0xa'),'paranoid':![],'indexes':[{'name':_0xab8b('0xb'),'fields':['idField',_0xab8b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf30=['DeskField','int_desk_fields','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5f2674,_0x5d92ac){var _0x4b519a=function(_0x1ef100){while(--_0x1ef100){_0x5f2674['push'](_0x5f2674['shift']());}};_0x4b519a(++_0x5d92ac);}(_0xcf30,0x1d7));var _0x0cf3=function(_0x3c2477,_0x1e3978){_0x3c2477=_0x3c2477-0x0;var _0x4346d3=_0xcf30[_0x3c2477];return _0x4346d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0cf3('0x0'))(_0x0cf3('0x1'));var moment=require(_0x0cf3('0x2'));var BPromise=require(_0x0cf3('0x3'));var rp=require(_0x0cf3('0x4'));var fs=require('fs');var path=require(_0x0cf3('0x5'));var rimraf=require('rimraf');var config=require(_0x0cf3('0x6'));var attributes=require('./intDeskField.attributes');module[_0x0cf3('0x7')]=function(_0x51335a,_0x259796){return _0x51335a[_0x0cf3('0x8')](_0x0cf3('0x9'),attributes,{'tableName':_0x0cf3('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x0cf3('0xb')],'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 aa8fbc5..edf156d 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 _0xdace=['request\x20sent','debug','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xdace,0xc5));var _0xedac=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xdace[_0xd13a88];return _0x1c993c;};'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});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('DeskField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s'];(function(_0x1ac33a,_0x52f6f8){var _0x3b6b87=function(_0x3251a1){while(--_0x3251a1){_0x1ac33a['push'](_0x1ac33a['shift']());}};_0x3b6b87(++_0x52f6f8);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5ad18c,_0x340ac2){_0x5ad18c=_0x5ad18c-0x0;var _0x23d3bb=_0xe5b3[_0x5ad18c];return _0x23d3bb;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('DeskField,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('DeskField,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index dd180f7..95ba7b4 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 _0x4634=['../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','multer','path','express','Router'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x4634,0x6e));var _0x4463=function(_0x535ea0,_0x5db65a){_0x535ea0=_0x535ea0-0x0;var _0x43980a=_0x4634[_0x535ea0];return _0x43980a;};'use strict';var multer=require(_0x4463('0x0'));var util=require('util');var path=require(_0x4463('0x1'));var timeout=require('connect-timeout');var express=require(_0x4463('0x2'));var router=express[_0x4463('0x3')]();var auth=require(_0x4463('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4463('0x5'));var controller=require(_0x4463('0x6'));router[_0x4463('0x7')]('/',auth[_0x4463('0x8')](),controller[_0x4463('0x9')]);router[_0x4463('0x7')](_0x4463('0xa'),auth[_0x4463('0x8')](),controller[_0x4463('0xb')]);router['get'](_0x4463('0xc'),auth[_0x4463('0x8')](),controller[_0x4463('0xd')]);router[_0x4463('0x7')](_0x4463('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x4463('0xf')]('/',auth[_0x4463('0x8')](),controller['create']);router['post'](_0x4463('0xc'),auth[_0x4463('0x8')](),controller[_0x4463('0x10')]);router[_0x4463('0x11')](_0x4463('0xa'),auth[_0x4463('0x8')](),controller[_0x4463('0x12')]);router['delete'](_0x4463('0xa'),auth[_0x4463('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x453d=['./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x484f22,_0x4fb346){var _0x43c329=function(_0x559480){while(--_0x559480){_0x484f22['push'](_0x484f22['shift']());}};_0x43c329(++_0x4fb346);}(_0x453d,0x15e));var _0xd453=function(_0xd95246,_0x404ed5){_0xd95246=_0xd95246-0x0;var _0x3700f8=_0x453d[_0xd95246];return _0x3700f8;};'use strict';var multer=require(_0xd453('0x0'));var util=require(_0xd453('0x1'));var path=require('path');var timeout=require(_0xd453('0x2'));var express=require('express');var router=express[_0xd453('0x3')]();var auth=require(_0xd453('0x4'));var interaction=require(_0xd453('0x5'));var config=require(_0xd453('0x6'));var controller=require(_0xd453('0x7'));router[_0xd453('0x8')]('/',auth['isAuthenticated'](),controller[_0xd453('0x9')]);router[_0xd453('0x8')](_0xd453('0xa'),auth[_0xd453('0xb')](),controller[_0xd453('0xc')]);router[_0xd453('0x8')](_0xd453('0xd'),auth[_0xd453('0xb')](),controller['getConfigurations']);router[_0xd453('0x8')](_0xd453('0xe'),auth[_0xd453('0xb')](),controller['getFields']);router[_0xd453('0xf')]('/',auth[_0xd453('0xb')](),controller[_0xd453('0x10')]);router[_0xd453('0xf')](_0xd453('0xd'),auth['isAuthenticated'](),controller[_0xd453('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd453('0x12')]);router[_0xd453('0x13')]('/:id',auth[_0xd453('0xb')](),controller[_0xd453('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 9f2627c..aa40d3c 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 _0x0cfc=['STRING','sequelize'];(function(_0x332aa6,_0x420d8b){var _0x1b2da6=function(_0x496ee0){while(--_0x496ee0){_0x332aa6['push'](_0x332aa6['shift']());}};_0x1b2da6(++_0x420d8b);}(_0x0cfc,0x153));var _0xc0cf=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0cfc[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xc0cf('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0cf('0x1')]},'username':{'type':Sequelize[_0xc0cf('0x1')]},'password':{'type':Sequelize[_0xc0cf('0x1')]},'remoteUri':{'type':Sequelize[_0xc0cf('0x1')]},'tenantId':{'type':Sequelize[_0xc0cf('0x1')]},'clientId':{'type':Sequelize[_0xc0cf('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc0cf('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb81f=['sequelize','exports','STRING'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0xb81f,0xcc));var _0xfb81=function(_0x3b6056,_0x5ac3c9){_0x3b6056=_0x3b6056-0x0;var _0x39c6b9=_0xb81f[_0x3b6056];return _0x39c6b9;};'use strict';var Sequelize=require(_0xfb81('0x0'));module[_0xfb81('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xfb81('0x2')]},'clientId':{'type':Sequelize[_0xfb81('0x2')]},'clientSecret':{'type':Sequelize[_0xfb81('0x2')]},'serverUrl':{'type':Sequelize[_0xfb81('0x2')]},'description':{'type':Sequelize[_0xfb81('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5142d5e..96d7e3d 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 _0x2f4e=['AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','primarycontactidyominame','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slainvokedidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','LogicalName','@odata.type','push','isNil','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','log','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','OptionSet','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','Dynamics365Account','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','rows','show','params','rawAttributes','fields','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','filter','nolimit','addConfiguration'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2f4e,0x14c));var _0xe2f4=function(_0x4b6cde,_0x47b03d){_0x4b6cde=_0x4b6cde-0x0;var _0x40f799=_0x2f4e[_0x4b6cde];return _0x40f799;};'use strict';var pdf=require(_0xe2f4('0x0'));var emlformat=require(_0xe2f4('0x1'));var rimraf=require(_0xe2f4('0x2'));var zipdir=require(_0xe2f4('0x3'));var jsonpatch=require(_0xe2f4('0x4'));var rp=require(_0xe2f4('0x5'));var moment=require(_0xe2f4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe2f4('0x7'));var util=require(_0xe2f4('0x8'));var path=require(_0xe2f4('0x9'));var sox=require(_0xe2f4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe2f4('0xb'));var squel=require('squel');var crypto=require(_0xe2f4('0xc'));var jsforce=require(_0xe2f4('0xd'));var deskjs=require(_0xe2f4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2f4('0xf'));var Papa=require('papaparse');var Redis=require(_0xe2f4('0x10'));var authService=require(_0xe2f4('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe2f4('0x12'));var logger=require(_0xe2f4('0x13'))(_0xe2f4('0x14'));var utils=require(_0xe2f4('0x15'));var config=require(_0xe2f4('0x16'));var db=require(_0xe2f4('0x17'))['db'];var integrations=require(_0xe2f4('0x18'));var jayson=require(_0xe2f4('0x19'));var client=jayson[_0xe2f4('0x1a')][_0xe2f4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x58071f,_0x3d9644,_0x377cdd){if(_0x377cdd){var _0x1085a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1085a5[_0xe2f4('0x1c')](_0x3d9644)){return _0x58071f;}else{throw new Error(_0xe2f4('0x1d'));}}else{return _0x58071f;}}function respondWithRpcPromise(_0x44a29c,_0x5c4c73,_0xbf6859,_0x555724){return new BPromise(function(_0x5ac2ea,_0x3f5c1e){var _0x37ebb5=_0x555724||client;return _0x37ebb5[_0xe2f4('0x1e')](_0x44a29c,_0xbf6859)[_0xe2f4('0x1f')](function(_0x4312f4){logger[_0xe2f4('0x20')](_0xe2f4('0x21'),_0x5c4c73,_0xe2f4('0x22'));logger[_0xe2f4('0x23')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5c4c73,_0xe2f4('0x22'),JSON['stringify'](_0x4312f4));if(_0x4312f4[_0xe2f4('0x24')]){if(_0x4312f4[_0xe2f4('0x24')][_0xe2f4('0x25')]===0x1f4){logger['error'](_0xe2f4('0x21'),_0x5c4c73,_0x4312f4['error'][_0xe2f4('0x26')]);return _0x3f5c1e(_0x4312f4[_0xe2f4('0x24')][_0xe2f4('0x26')]);}logger[_0xe2f4('0x24')](_0xe2f4('0x21'),_0x5c4c73,_0x4312f4[_0xe2f4('0x24')][_0xe2f4('0x26')]);return _0x5ac2ea(_0x4312f4[_0xe2f4('0x24')][_0xe2f4('0x26')]);}else{logger['info'](_0xe2f4('0x21'),_0x5c4c73,'request\x20sent');_0x5ac2ea(_0x4312f4[_0xe2f4('0x27')][_0xe2f4('0x26')]);}})[_0xe2f4('0x28')](function(_0x283c2d){logger[_0xe2f4('0x24')](_0xe2f4('0x21'),_0x5c4c73,_0x283c2d);_0x3f5c1e(_0x283c2d);});});}function respondWithStatusCode(_0x478840,_0xa6bb23){_0xa6bb23=_0xa6bb23||0xcc;return function(_0x28923c){if(_0x28923c){return _0x478840[_0xe2f4('0x29')](_0xa6bb23);}return _0x478840[_0xe2f4('0x2a')](_0xa6bb23)[_0xe2f4('0x2b')]();};}function respondWithResult(_0xbdf326,_0x1e8359){_0x1e8359=_0x1e8359||0xc8;return function(_0x4b4000){if(_0x4b4000){return _0xbdf326['status'](_0x1e8359)['json'](_0x4b4000);}};}function respondWithFilteredResult(_0x4c1bd9,_0x421892){return function(_0x1d4b5e){if(_0x1d4b5e){var _0x17483d=_0x1d4b5e[_0xe2f4('0x2c')],_0x559383=_0x421892[_0xe2f4('0x2d')],_0x483984=_0x421892[_0xe2f4('0x2d')]+_0x421892[_0xe2f4('0x2e')],_0x460c37;if(_0x483984>=_0x17483d){_0x483984=_0x17483d;_0x460c37=0xc8;}else{_0x460c37=0xce;}_0x4c1bd9[_0xe2f4('0x2a')](_0x460c37);return _0x4c1bd9['set'](_0xe2f4('0x2f'),_0x559383+'-'+_0x483984+'/'+_0x17483d)[_0xe2f4('0x30')](_0x1d4b5e);}return null;};}function patchUpdates(_0x1e9e0c){return function(_0x5cd76c){try{jsonpatch[_0xe2f4('0x31')](_0x5cd76c,_0x1e9e0c,!![]);}catch(_0x3d71ac){return BPromise[_0xe2f4('0x32')](_0x3d71ac);}return _0x5cd76c[_0xe2f4('0x33')]();};}function saveUpdates(_0x21c9a2,_0x364fd4){return function(_0x4ae1f4){if(_0x4ae1f4){return _0x4ae1f4[_0xe2f4('0x34')](_0x21c9a2)[_0xe2f4('0x1f')](function(_0x52b96d){return _0x52b96d;});}return null;};}function removeEntity(_0x19fa6a,_0x1e2277){return function(_0x258f39){if(_0x258f39){return _0x258f39[_0xe2f4('0x35')]()[_0xe2f4('0x1f')](function(){_0x19fa6a[_0xe2f4('0x2a')](0xcc)[_0xe2f4('0x2b')]();});}};}function handleEntityNotFound(_0x450e4d,_0x11027c){return function(_0x977666){if(!_0x977666){_0x450e4d[_0xe2f4('0x29')](0x194);}return _0x977666;};}function handleError(_0x4943c2,_0x993447){_0x993447=_0x993447||0x1f4;return function(_0x315ce7){logger[_0xe2f4('0x24')](_0x315ce7[_0xe2f4('0x36')]);if(_0x315ce7[_0xe2f4('0x37')]){delete _0x315ce7[_0xe2f4('0x37')];}_0x4943c2[_0xe2f4('0x2a')](_0x993447)[_0xe2f4('0x38')](_0x315ce7);};}exports[_0xe2f4('0x39')]=function(_0x4254f0,_0x2525c8){var _0x3f3c32={},_0x397d86={},_0x4028c6={'count':0x0,'rows':[]};var _0x296b83=db[_0xe2f4('0x3a')]['rawAttributes'];_0x397d86[_0xe2f4('0x3b')]=_['keys'](_0x296b83);_0x397d86[_0xe2f4('0x3c')]=_[_0xe2f4('0x3d')](_0x4254f0['query']);_0x397d86[_0xe2f4('0x3e')]=_[_0xe2f4('0x3f')](_0x397d86['model'],_0x397d86[_0xe2f4('0x3c')]);_0x3f3c32['attributes']=_[_0xe2f4('0x3f')](_0x397d86[_0xe2f4('0x3b')],qs['fields'](_0x4254f0[_0xe2f4('0x3c')]['fields']));_0x3f3c32[_0xe2f4('0x40')]=_0x3f3c32[_0xe2f4('0x40')][_0xe2f4('0x41')]?_0x3f3c32[_0xe2f4('0x40')]:_0x397d86[_0xe2f4('0x3b')];if(!_0x4254f0[_0xe2f4('0x3c')][_0xe2f4('0x42')]('nolimit')){_0x3f3c32[_0xe2f4('0x2e')]=qs[_0xe2f4('0x2e')](_0x4254f0['query'][_0xe2f4('0x2e')]);_0x3f3c32[_0xe2f4('0x2d')]=qs[_0xe2f4('0x2d')](_0x4254f0[_0xe2f4('0x3c')][_0xe2f4('0x2d')]);}_0x3f3c32[_0xe2f4('0x43')]=qs['sort'](_0x4254f0[_0xe2f4('0x3c')][_0xe2f4('0x44')]);_0x3f3c32[_0xe2f4('0x45')]=qs[_0xe2f4('0x3e')](_[_0xe2f4('0x46')](_0x4254f0[_0xe2f4('0x3c')],_0x397d86['filters']));if(_0x4254f0[_0xe2f4('0x3c')]['filter']){_0x3f3c32[_0xe2f4('0x45')]=_[_0xe2f4('0x47')](_0x3f3c32[_0xe2f4('0x45')],{'$or':_[_0xe2f4('0x48')](_0x296b83,function(_0xbcde62){if(_0xbcde62[_0xe2f4('0x49')][_0xe2f4('0x4a')]!==_0xe2f4('0x4b')){var _0xcf7da6={};_0xcf7da6[_0xbcde62[_0xe2f4('0x4c')]]={'$like':'%'+_0x4254f0[_0xe2f4('0x3c')]['filter']+'%'};return _0xcf7da6;}})});}_0x3f3c32=_[_0xe2f4('0x47')]({},_0x3f3c32,_0x4254f0[_0xe2f4('0x4d')]);var _0x5c44b8={'where':_0x3f3c32['where']};return db[_0xe2f4('0x3a')][_0xe2f4('0x2c')](_0x5c44b8)[_0xe2f4('0x1f')](function(_0xac2bd2){_0x4028c6[_0xe2f4('0x2c')]=_0xac2bd2;if(_0x4254f0[_0xe2f4('0x3c')][_0xe2f4('0x4e')]){_0x3f3c32['include']=[{'all':!![]}];}return db[_0xe2f4('0x3a')]['findAll'](_0x3f3c32);})[_0xe2f4('0x1f')](function(_0x5b30fb){_0x4028c6[_0xe2f4('0x4f')]=_0x5b30fb;return _0x4028c6;})[_0xe2f4('0x1f')](respondWithFilteredResult(_0x2525c8,_0x3f3c32))[_0xe2f4('0x28')](handleError(_0x2525c8,null));};exports[_0xe2f4('0x50')]=function(_0x32f709,_0x1e4123){var _0x69de09={'raw':![],'where':{'id':_0x32f709[_0xe2f4('0x51')]['id']}},_0x36e0fe={};_0x36e0fe[_0xe2f4('0x3b')]=_[_0xe2f4('0x3d')](db[_0xe2f4('0x3a')][_0xe2f4('0x52')]);_0x36e0fe['query']=_[_0xe2f4('0x3d')](_0x32f709[_0xe2f4('0x3c')]);_0x36e0fe[_0xe2f4('0x3e')]=_[_0xe2f4('0x3f')](_0x36e0fe['model'],_0x36e0fe[_0xe2f4('0x3c')]);_0x69de09[_0xe2f4('0x40')]=_['intersection'](_0x36e0fe[_0xe2f4('0x3b')],qs[_0xe2f4('0x53')](_0x32f709['query'][_0xe2f4('0x53')]));_0x69de09[_0xe2f4('0x40')]=_0x69de09['attributes'][_0xe2f4('0x41')]?_0x69de09[_0xe2f4('0x40')]:_0x36e0fe[_0xe2f4('0x3b')];if(_0x32f709['query'][_0xe2f4('0x4e')]){_0x69de09[_0xe2f4('0x54')]=[{'all':!![]}];}_0x69de09=_[_0xe2f4('0x47')]({},_0x69de09,_0x32f709[_0xe2f4('0x4d')]);return db['Dynamics365Account'][_0xe2f4('0x55')](_0x69de09)[_0xe2f4('0x1f')](handleEntityNotFound(_0x1e4123,null))['then'](respondWithResult(_0x1e4123,null))[_0xe2f4('0x28')](handleError(_0x1e4123,null));};exports['create']=function(_0x1096c3,_0x3dd5c7){return db[_0xe2f4('0x3a')][_0xe2f4('0x56')](_0x1096c3[_0xe2f4('0x57')],{})[_0xe2f4('0x1f')](respondWithResult(_0x3dd5c7,0xc9))[_0xe2f4('0x28')](handleError(_0x3dd5c7,null));};exports[_0xe2f4('0x34')]=function(_0xe0f8b9,_0x6e24da){if(_0xe0f8b9[_0xe2f4('0x57')]['id']){delete _0xe0f8b9['body']['id'];}return db['Dynamics365Account'][_0xe2f4('0x55')]({'where':{'id':_0xe0f8b9['params']['id']}})['then'](handleEntityNotFound(_0x6e24da,null))['then'](saveUpdates(_0xe0f8b9[_0xe2f4('0x57')],null))[_0xe2f4('0x1f')](respondWithResult(_0x6e24da,null))[_0xe2f4('0x28')](handleError(_0x6e24da,null));};exports['destroy']=function(_0x5275a6,_0x4cb336){return db[_0xe2f4('0x3a')][_0xe2f4('0x55')]({'where':{'id':_0x5275a6['params']['id']}})['then'](handleEntityNotFound(_0x4cb336,null))['then'](removeEntity(_0x4cb336,null))[_0xe2f4('0x28')](handleError(_0x4cb336,null));};exports[_0xe2f4('0x58')]=function(_0x5af769,_0x1885a3,_0x574a2b){var _0x10990b={};var _0x5eb08d={};var _0xdb9dca;var _0xca30d;return db[_0xe2f4('0x3a')][_0xe2f4('0x59')]({'where':{'id':_0x5af769[_0xe2f4('0x51')]['id']}})[_0xe2f4('0x1f')](handleEntityNotFound(_0x1885a3,null))[_0xe2f4('0x1f')](function(_0x572a6a){if(_0x572a6a){_0xdb9dca=_0x572a6a;_0x5eb08d[_0xe2f4('0x3b')]=_[_0xe2f4('0x3d')](db[_0xe2f4('0x5a')][_0xe2f4('0x52')]);_0x5eb08d[_0xe2f4('0x3c')]=_[_0xe2f4('0x3d')](_0x5af769[_0xe2f4('0x3c')]);_0x5eb08d[_0xe2f4('0x3e')]=_[_0xe2f4('0x3f')](_0x5eb08d[_0xe2f4('0x3b')],_0x5eb08d[_0xe2f4('0x3c')]);_0x10990b[_0xe2f4('0x40')]=_[_0xe2f4('0x3f')](_0x5eb08d[_0xe2f4('0x3b')],qs[_0xe2f4('0x53')](_0x5af769[_0xe2f4('0x3c')][_0xe2f4('0x53')]));_0x10990b[_0xe2f4('0x40')]=_0x10990b[_0xe2f4('0x40')][_0xe2f4('0x41')]?_0x10990b[_0xe2f4('0x40')]:_0x5eb08d[_0xe2f4('0x3b')];_0x10990b[_0xe2f4('0x43')]=qs[_0xe2f4('0x44')](_0x5af769[_0xe2f4('0x3c')][_0xe2f4('0x44')]);_0x10990b[_0xe2f4('0x45')]=qs['filters'](_['pick'](_0x5af769[_0xe2f4('0x3c')],_0x5eb08d[_0xe2f4('0x3e')]));if(_0x5af769[_0xe2f4('0x3c')]['filter']){_0x10990b[_0xe2f4('0x45')]=_[_0xe2f4('0x47')](_0x10990b[_0xe2f4('0x45')],{'$or':_[_0xe2f4('0x48')](_0x10990b['attributes'],function(_0x487ed3){var _0x142a79={};_0x142a79[_0x487ed3]={'$like':'%'+_0x5af769[_0xe2f4('0x3c')][_0xe2f4('0x5b')]+'%'};return _0x142a79;})});}_0x10990b=_[_0xe2f4('0x47')]({},_0x10990b,_0x5af769[_0xe2f4('0x4d')]);return _0xdb9dca[_0xe2f4('0x58')](_0x10990b);}})[_0xe2f4('0x1f')](function(_0x140ef5){if(_0x140ef5){_0xca30d=_0x140ef5[_0xe2f4('0x41')];if(!_0x5af769[_0xe2f4('0x3c')]['hasOwnProperty'](_0xe2f4('0x5c'))){_0x10990b[_0xe2f4('0x2e')]=qs[_0xe2f4('0x2e')](_0x5af769[_0xe2f4('0x3c')][_0xe2f4('0x2e')]);_0x10990b[_0xe2f4('0x2d')]=qs[_0xe2f4('0x2d')](_0x5af769[_0xe2f4('0x3c')][_0xe2f4('0x2d')]);}return _0xdb9dca[_0xe2f4('0x58')](_0x10990b);}})[_0xe2f4('0x1f')](function(_0x579ab2){if(_0x579ab2){return _0x579ab2?{'count':_0xca30d,'rows':_0x579ab2}:null;}})[_0xe2f4('0x1f')](respondWithResult(_0x1885a3,null))[_0xe2f4('0x28')](handleError(_0x1885a3,null));};exports[_0xe2f4('0x5d')]=function(_0x3a29dd,_0x4da0ec,_0x464fe1){if(_0x3a29dd[_0xe2f4('0x57')]['id']){delete _0x3a29dd[_0xe2f4('0x57')]['id'];}return db[_0xe2f4('0x3a')][_0xe2f4('0x59')]({'where':{'id':_0x3a29dd['params']['id']}})[_0xe2f4('0x1f')](handleEntityNotFound(_0x4da0ec,null))[_0xe2f4('0x1f')](function(_0x1974c5){if(_0x1974c5){_0x3a29dd['body'][_0xe2f4('0x5e')]=_0x1974c5['id'];_0x3a29dd[_0xe2f4('0x57')]['Subjects']=integrations[_0xe2f4('0x5f')](_0x3a29dd['body'][_0xe2f4('0x60')],_0x3a29dd[_0xe2f4('0x57')][_0xe2f4('0x49')]);_0x3a29dd[_0xe2f4('0x57')][_0xe2f4('0x61')]=integrations[_0xe2f4('0x62')](_0x3a29dd['body'][_0xe2f4('0x60')],_0x3a29dd[_0xe2f4('0x57')][_0xe2f4('0x49')]);return db[_0xe2f4('0x5a')]['create'](_0x3a29dd[_0xe2f4('0x57')],{'include':[{'model':db[_0xe2f4('0x63')],'as':'Subjects'},{'model':db[_0xe2f4('0x63')],'as':'Descriptions'}]});}return null;})[_0xe2f4('0x1f')](respondWithResult(_0x4da0ec,null))[_0xe2f4('0x28')](handleError(_0x4da0ec,null));};exports[_0xe2f4('0x64')]=function(_0x3708f2,_0x4efd64,_0x54c9bd){var _0x3eb33e=_0x3708f2[_0xe2f4('0x3c')][_0xe2f4('0x65')];var _0x58bfcf=_0x3eb33e===_0xe2f4('0x66')?_0xe2f4('0x67'):_0xe2f4('0x68');var _0x1fff44='';var _0x59c3bf='';var _0x36e8e1='';var _0x13fbea='';var _0x51cda6='';var _0x43f158='';var _0x59a0a4='';var _0x5b46d1='';var _0x914903=[_0xe2f4('0x69'),'description',_0xe2f4('0x6a'),_0xe2f4('0x6b'),'caseorigincode',_0xe2f4('0x6c'),_0xe2f4('0x6d'),_0xe2f4('0x6e'),_0xe2f4('0x6f'),_0xe2f4('0x70')];var _0x138e37=[_0xe2f4('0x71'),_0xe2f4('0x72'),'actualserviceunits','billedserviceunits',_0xe2f4('0x73'),_0xe2f4('0x74'),_0xe2f4('0x75'),_0xe2f4('0x76'),'createdbyexternalpartyname',_0xe2f4('0x77'),'createdbyname',_0xe2f4('0x78'),_0xe2f4('0x79'),_0xe2f4('0x7a'),_0xe2f4('0x7b'),_0xe2f4('0x7c'),'customeridtype',_0xe2f4('0x7d'),_0xe2f4('0x7e'),_0xe2f4('0x7f'),_0xe2f4('0x80'),_0xe2f4('0x81'),_0xe2f4('0x82'),'exchangerate',_0xe2f4('0x83'),_0xe2f4('0x84'),'importsequencenumber',_0xe2f4('0x85'),_0xe2f4('0x86'),_0xe2f4('0x87'),_0xe2f4('0x88'),'modifiedbyexternalpartyname',_0xe2f4('0x89'),'modifiedbyname',_0xe2f4('0x8a'),_0xe2f4('0x8b'),_0xe2f4('0x8c'),_0xe2f4('0x8d'),_0xe2f4('0x8e'),_0xe2f4('0x8f'),'numberofchildincidents',_0xe2f4('0x90'),'overriddencreatedon',_0xe2f4('0x91'),'owneridtype','owneridyominame','parentcaseidname','primarycontactidname',_0xe2f4('0x92'),'prioritycodename','productidname',_0xe2f4('0x93'),_0xe2f4('0x94'),_0xe2f4('0x95'),_0xe2f4('0x96'),'responsiblecontactidname',_0xe2f4('0x97'),'sentimentvalue',_0xe2f4('0x98'),'slaname','socialprofileidname','statecode',_0xe2f4('0x99'),_0xe2f4('0x9a'),_0xe2f4('0x9b'),_0xe2f4('0x9c'),_0xe2f4('0x9d'),'traversedpath',_0xe2f4('0x9e'),'versionnumber'];var _0x195404=_0x914903['concat'](_0x138e37);return db['Dynamics365Account'][_0xe2f4('0x59')]({'where':{'id':_0x3708f2['params']['id']},'attributes':['id','username',_0xe2f4('0x9f'),_0xe2f4('0xa0'),'tenantId',_0xe2f4('0xa1'),_0xe2f4('0xa2')]})[_0xe2f4('0x1f')](handleEntityNotFound(_0x4efd64,null))[_0xe2f4('0x1f')](function(_0x31d679){if(_0x31d679){_0x5b46d1=_0x31d679[_0xe2f4('0xa0')];var _0x54d383=_0x5b46d1[_0xe2f4('0xa3')](-0x1);if(_0x54d383==='/'){_0x5b46d1=_0x5b46d1[_0xe2f4('0xa4')](0x0,_0x5b46d1[_0xe2f4('0xa5')](_0x54d383));}_0x59a0a4=util[_0xe2f4('0xa6')](_0xe2f4('0xa7'),_0x5b46d1);var _0x581d63={'method':'POST','uri':_0xe2f4('0xa8')+_0x31d679[_0xe2f4('0xa9')]+_0xe2f4('0xaa'),'form':{'client_id':_0x31d679['clientId'],'resource':_0x5b46d1,'username':_0x31d679['username'],'password':_0x31d679['password'],'grant_type':_0xe2f4('0x9f'),'client_secret':_0x31d679['clientSecret']},'json':!![]};return rp(_0x581d63);}})[_0xe2f4('0x1f')](function(_0x489dd4){_0x43f158=_0x489dd4[_0xe2f4('0xab')];var _0x1f70e9={'method':'GET','uri':encodeURI(_0x59a0a4+_0xe2f4('0xac')+_0x58bfcf+'\x27'),'headers':{'Authorization':_0xe2f4('0xad')+_0x43f158,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f70e9);})['then'](function(_0x30d9d9){var _0x48f446=_0x30d9d9[_0xe2f4('0xae')][0x0];var _0x3fad02=_0x48f446[_0xe2f4('0xaf')];var _0x53ac5b={'method':_0xe2f4('0xb0'),'uri':_0x59a0a4+_0xe2f4('0xb1')+_0x3fad02+_0xe2f4('0xb2'),'headers':{'Authorization':_0xe2f4('0xad')+_0x43f158,'If-None-Match':null,'OData-Version':_0xe2f4('0xb3')},'json':!![]};return rp(_0x53ac5b);})[_0xe2f4('0x1f')](function(_0x515eb4){_0x1fff44=_0x515eb4;_0x59c3bf=_0x1fff44['Attributes'];_0x59c3bf=_[_0xe2f4('0xb4')](_0x59c3bf,function(_0x5ad7b8){return!_0x195404[_0xe2f4('0xb5')](_0x5ad7b8[_0xe2f4('0xb6')]);});var _0x2cc098=[];var _0x4ffc9c=[];_0x59c3bf['forEach'](function(_0x26fc80){if(_0x26fc80[_0xe2f4('0xb7')]){var _0x1c540f=_0x26fc80[_0xe2f4('0xb7')][_0xe2f4('0xa4')](_0x26fc80[_0xe2f4('0xb7')]['lastIndexOf']('.')+0x1);if(_0x1c540f==='PicklistAttributeMetadata'){_0x2cc098[_0xe2f4('0xb8')](getSelectList(_0x59a0a4,_0x3eb33e,_0x4ffc9c,_0x1fff44[_0xe2f4('0xaf')],_0x26fc80[_0xe2f4('0xaf')],_0x43f158));}}});return Promise['all'](_0x2cc098);})[_0xe2f4('0x1f')](function(_0x2ca84e){_0x36e8e1=_0x2ca84e[0x0];var _0x3f3dfb=[];var _0x170f82=[];_0x59c3bf['forEach'](function(_0x186af2){if(!_[_0xe2f4('0xb9')](_0x186af2[_0xe2f4('0xb7')])){var _0x22eb60=_0x186af2[_0xe2f4('0xb7')][_0xe2f4('0xa4')](_0x186af2[_0xe2f4('0xb7')]['lastIndexOf']('.')+0x1);if(_0x22eb60==='BooleanAttributeMetadata'){_0x3f3dfb[_0xe2f4('0xb8')](getBooleanList(_0x59a0a4,_0x3eb33e,_0x170f82,_0x1fff44[_0xe2f4('0xaf')],_0x186af2[_0xe2f4('0xaf')],_0x43f158));}}});return Promise[_0xe2f4('0xba')](_0x3f3dfb);})['then'](function(_0x759f40){_0x13fbea=_0x759f40[0x0];var _0x10c32a=[];var _0x134f9e=[];_0x59c3bf[_0xe2f4('0xbb')](function(_0x2c15a8){if(_0x2c15a8['@odata.type']){var _0x4af511=_0x2c15a8['@odata.type'][_0xe2f4('0xa4')](_0x2c15a8['@odata.type']['lastIndexOf']('.')+0x1);if(_0x4af511===_0xe2f4('0xbc')||_0x4af511===_0xe2f4('0xbd')||_0x4af511==='BigIntAttributeMetadata'||_0x4af511==='IntegerAttributeMetadata'||_0x4af511===_0xe2f4('0xbe')||_0x4af511===_0xe2f4('0xbf')||_0x4af511===_0xe2f4('0xc0')||_0x4af511===_0xe2f4('0xc1')||_0x4af511==='StateAttributeMetadata'||_0x4af511===_0xe2f4('0xc2')){_0x10c32a[_0xe2f4('0xb8')](getInputList(_0x59a0a4,_0x3eb33e,_0x4af511,_0x134f9e,_0x1fff44[_0xe2f4('0xaf')],_0x2c15a8[_0xe2f4('0xaf')],_0x43f158));}}});return Promise['all'](_0x10c32a);})[_0xe2f4('0x1f')](function(_0x52a903){_0x51cda6=_0x52a903[0x0];var _0x48914f=_0x36e8e1[_0xe2f4('0xc3')](_0x13fbea)[_0xe2f4('0xc3')](_0x51cda6);var _0x1bc2ce={'count':_0x48914f[_0xe2f4('0x41')],'rows':_0x48914f};return _0x1bc2ce;})[_0xe2f4('0x1f')](respondWithResult(_0x4efd64,null))['catch'](function(_0x3d2a8e){console[_0xe2f4('0xc4')](_0xe2f4('0xc5')+_0x3d2a8e);var _0x391779=_0x3708f2[_0xe2f4('0x3c')][_0xe2f4('0x1c')]?0x1f4:_0x3d2a8e[_0xe2f4('0xc6')]||0x1f4;logger[_0xe2f4('0x24')](_0x3d2a8e['stack']);delete _0x3d2a8e[_0xe2f4('0x37')];if(_0x391779===0x191){_0x391779=0x190;}_0x4efd64['status'](_0x391779)[_0xe2f4('0x38')](_0x3708f2[_0xe2f4('0x3c')][_0xe2f4('0x1c')]?{'message':_0xe2f4('0xc7'),'statusCode':_0x3d2a8e[_0xe2f4('0xc6')]}:_0x3d2a8e);});};function getSelectList(_0x10b082,_0x1ad603,_0x4a807d,_0x135780,_0x164baf,_0xe9f8b4){var _0x3efefb={'method':_0xe2f4('0xb0'),'uri':_0x10b082+_0xe2f4('0xb1')+_0x135780+_0xe2f4('0xc8')+_0x164baf+_0xe2f4('0xc9')+_0xe2f4('0xca'),'headers':{'Authorization':'Bearer\x20'+_0xe9f8b4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3efefb)[_0xe2f4('0x1f')](function(_0x9a9370){var _0x141a7d=[];var _0x1aaf22=_0x9a9370['OptionSet']['Options'];_0x1aaf22[_0xe2f4('0xbb')](function(_0x3c5374){_0x141a7d['push']({'name':_0x3c5374[_0xe2f4('0xcb')][_0xe2f4('0xcc')][_0xe2f4('0xcb')],'value':String(_0x3c5374[_0xe2f4('0xcd')])});});var _0x1d2136={'id':_0x1ad603+'_'+_0x9a9370[_0xe2f4('0xb6')],'name':_0x9a9370[_0xe2f4('0xce')][_0xe2f4('0xcc')][_0xe2f4('0xcb')],'custom':![],'options':_0x141a7d};_0x4a807d[_0xe2f4('0xb8')](_0x1d2136);return _0x4a807d;});}function getBooleanList(_0x16565e,_0x2dfea1,_0x5c78ba,_0xabf806,_0x2d3127,_0x4913e3){var _0x8d61f3={'method':_0xe2f4('0xb0'),'uri':_0x16565e+_0xe2f4('0xb1')+_0xabf806+_0xe2f4('0xc8')+_0x2d3127+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xe2f4('0xad')+_0x4913e3,'If-None-Match':null,'OData-Version':_0xe2f4('0xb3')},'json':!![]};return rp(_0x8d61f3)[_0xe2f4('0x1f')](function(_0x2510f1){var _0x50bf18=[];_0x50bf18[_0xe2f4('0xb8')]({'name':_0x2510f1['OptionSet'][_0xe2f4('0xcf')][_0xe2f4('0xcb')][_0xe2f4('0xcc')][_0xe2f4('0xcb')],'value':_0xe2f4('0xd0')},{'name':_0x2510f1[_0xe2f4('0xd1')]['FalseOption']['Label'][_0xe2f4('0xcc')]['Label'],'value':_0xe2f4('0xd2')});var _0x5e71ed={'id':_0x2dfea1+'_'+_0x2510f1[_0xe2f4('0xb6')],'name':_0x2510f1[_0xe2f4('0xce')][_0xe2f4('0xcc')]['Label'],'custom':![],'options':_0x50bf18};_0x5c78ba['push'](_0x5e71ed);return _0x5c78ba;});}function getInputList(_0x4794e3,_0x58141b,_0x9b7f93,_0x4bc002,_0x1786f6,_0x3aab6a,_0x12abd0){var _0x158bff={'method':_0xe2f4('0xb0'),'uri':_0x4794e3+_0xe2f4('0xb1')+_0x1786f6+')/Attributes('+_0x3aab6a+_0xe2f4('0xd3')+_0x9b7f93+_0xe2f4('0xd4'),'headers':{'Authorization':_0xe2f4('0xad')+_0x12abd0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x158bff)[_0xe2f4('0x1f')](function(_0x1547e1){var _0x5afc4c={'id':_0x58141b+'_'+_0x1547e1['LogicalName'],'name':_0x1547e1[_0xe2f4('0xce')][_0xe2f4('0xcc')]?_0x1547e1[_0xe2f4('0xce')][_0xe2f4('0xcc')][_0xe2f4('0xcb')]:_0x1547e1[_0xe2f4('0xb6')],'custom':![],'options':[]};_0x4bc002['push'](_0x5afc4c);return _0x4bc002;});} \ No newline at end of file +var _0xfd30=['password','remoteUri','tenantId','clientId','slice','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','substring','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','test','request','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','info','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','name','send','index','Dynamics365Account','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','show','find','create','body','destroy','params','getConfigurations','findOne','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','PhoneCall','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','concat'];(function(_0x22e954,_0xa424f0){var _0x2caf2f=function(_0x45444b){while(--_0x45444b){_0x22e954['push'](_0x22e954['shift']());}};_0x2caf2f(++_0xa424f0);}(_0xfd30,0x1d9));var _0x0fd3=function(_0x331ce4,_0x400128){_0x331ce4=_0x331ce4-0x0;var _0x3cb01f=_0xfd30[_0x331ce4];return _0x3cb01f;};'use strict';var pdf=require(_0x0fd3('0x0'));var emlformat=require(_0x0fd3('0x1'));var rimraf=require(_0x0fd3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd3('0x3'));var moment=require('moment');var BPromise=require(_0x0fd3('0x4'));var Mustache=require(_0x0fd3('0x5'));var util=require(_0x0fd3('0x6'));var path=require(_0x0fd3('0x7'));var sox=require(_0x0fd3('0x8'));var csv=require('to-csv');var ejs=require(_0x0fd3('0x9'));var fs=require('fs');var _=require(_0x0fd3('0xa'));var squel=require('squel');var crypto=require(_0x0fd3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fd3('0xc'));var toCsv=require(_0x0fd3('0xd'));var querystring=require(_0x0fd3('0xe'));var Papa=require(_0x0fd3('0xf'));var Redis=require(_0x0fd3('0x10'));var authService=require(_0x0fd3('0x11'));var qs=require(_0x0fd3('0x12'));var hardwareService=require(_0x0fd3('0x13'));var logger=require(_0x0fd3('0x14'))(_0x0fd3('0x15'));var utils=require(_0x0fd3('0x16'));var config=require(_0x0fd3('0x17'));var db=require(_0x0fd3('0x18'))['db'];var integrations=require(_0x0fd3('0x19'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x423ee1,_0xffe86b,_0x66a4ee){if(_0x66a4ee){var _0xe29f54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe29f54[_0x0fd3('0x1a')](_0xffe86b)){return _0x423ee1;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x423ee1;}}function respondWithRpcPromise(_0x43339d,_0xc39856,_0x479a5f,_0x13e653){return new BPromise(function(_0x14bb68,_0x33f42b){var _0x4afe6f=_0x13e653||client;return _0x4afe6f[_0x0fd3('0x1b')](_0x43339d,_0x479a5f)[_0x0fd3('0x1c')](function(_0x549d4d){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0xc39856,_0x0fd3('0x1d'));logger['debug'](_0x0fd3('0x1e'),_0xc39856,_0x0fd3('0x1d'),JSON[_0x0fd3('0x1f')](_0x549d4d));if(_0x549d4d[_0x0fd3('0x20')]){if(_0x549d4d[_0x0fd3('0x20')][_0x0fd3('0x21')]===0x1f4){logger[_0x0fd3('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0xc39856,_0x549d4d['error'][_0x0fd3('0x22')]);return _0x33f42b(_0x549d4d[_0x0fd3('0x20')][_0x0fd3('0x22')]);}logger[_0x0fd3('0x20')](_0x0fd3('0x23'),_0xc39856,_0x549d4d[_0x0fd3('0x20')]['message']);return _0x14bb68(_0x549d4d['error'][_0x0fd3('0x22')]);}else{logger[_0x0fd3('0x24')](_0x0fd3('0x23'),_0xc39856,_0x0fd3('0x1d'));_0x14bb68(_0x549d4d['result'][_0x0fd3('0x22')]);}})[_0x0fd3('0x25')](function(_0x2793be){logger[_0x0fd3('0x20')](_0x0fd3('0x23'),_0xc39856,_0x2793be);_0x33f42b(_0x2793be);});});}function respondWithStatusCode(_0x5db931,_0x20c964){_0x20c964=_0x20c964||0xcc;return function(_0xbb6a01){if(_0xbb6a01){return _0x5db931[_0x0fd3('0x26')](_0x20c964);}return _0x5db931[_0x0fd3('0x27')](_0x20c964)[_0x0fd3('0x28')]();};}function respondWithResult(_0x32d12b,_0x1d5f93){_0x1d5f93=_0x1d5f93||0xc8;return function(_0x30f20d){if(_0x30f20d){return _0x32d12b[_0x0fd3('0x27')](_0x1d5f93)['json'](_0x30f20d);}};}function respondWithFilteredResult(_0x68eea1,_0x1f29ce){return function(_0x490b66){if(_0x490b66){var _0x4eb205=_0x490b66[_0x0fd3('0x29')],_0x43904c=_0x1f29ce[_0x0fd3('0x2a')],_0x115d30=_0x1f29ce[_0x0fd3('0x2a')]+_0x1f29ce['limit'],_0x3cf91f;if(_0x115d30>=_0x4eb205){_0x115d30=_0x4eb205;_0x3cf91f=0xc8;}else{_0x3cf91f=0xce;}_0x68eea1[_0x0fd3('0x27')](_0x3cf91f);return _0x68eea1['set'](_0x0fd3('0x2b'),_0x43904c+'-'+_0x115d30+'/'+_0x4eb205)[_0x0fd3('0x2c')](_0x490b66);}return null;};}function patchUpdates(_0x1c5173){return function(_0x3fd69a){try{jsonpatch[_0x0fd3('0x2d')](_0x3fd69a,_0x1c5173,!![]);}catch(_0x1344af){return BPromise[_0x0fd3('0x2e')](_0x1344af);}return _0x3fd69a[_0x0fd3('0x2f')]();};}function saveUpdates(_0x41c222,_0xc59412){return function(_0x3cc32c){if(_0x3cc32c){return _0x3cc32c[_0x0fd3('0x30')](_0x41c222)[_0x0fd3('0x1c')](function(_0x589775){return _0x589775;});}return null;};}function removeEntity(_0x31c0e9,_0x3bbaf2){return function(_0x5ae271){if(_0x5ae271){return _0x5ae271['destroy']()[_0x0fd3('0x1c')](function(){_0x31c0e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae032,_0xf463d3){return function(_0x536ba2){if(!_0x536ba2){_0x1ae032[_0x0fd3('0x26')](0x194);}return _0x536ba2;};}function handleError(_0x598aec,_0x530ee5){_0x530ee5=_0x530ee5||0x1f4;return function(_0x4fbc24){logger[_0x0fd3('0x20')](_0x4fbc24['stack']);if(_0x4fbc24[_0x0fd3('0x31')]){delete _0x4fbc24[_0x0fd3('0x31')];}_0x598aec[_0x0fd3('0x27')](_0x530ee5)[_0x0fd3('0x32')](_0x4fbc24);};}exports[_0x0fd3('0x33')]=function(_0x2ce216,_0x57b65c){var _0x471505={},_0x5c900e={},_0x3fead2={'count':0x0,'rows':[]};var _0x1afd5e=db[_0x0fd3('0x34')][_0x0fd3('0x35')];_0x5c900e['model']=_[_0x0fd3('0x36')](_0x1afd5e);_0x5c900e[_0x0fd3('0x37')]=_['keys'](_0x2ce216[_0x0fd3('0x37')]);_0x5c900e[_0x0fd3('0x38')]=_[_0x0fd3('0x39')](_0x5c900e[_0x0fd3('0x3a')],_0x5c900e[_0x0fd3('0x37')]);_0x471505[_0x0fd3('0x3b')]=_['intersection'](_0x5c900e['model'],qs[_0x0fd3('0x3c')](_0x2ce216[_0x0fd3('0x37')][_0x0fd3('0x3c')]));_0x471505[_0x0fd3('0x3b')]=_0x471505[_0x0fd3('0x3b')][_0x0fd3('0x3d')]?_0x471505[_0x0fd3('0x3b')]:_0x5c900e[_0x0fd3('0x3a')];if(!_0x2ce216[_0x0fd3('0x37')]['hasOwnProperty'](_0x0fd3('0x3e'))){_0x471505[_0x0fd3('0x3f')]=qs[_0x0fd3('0x3f')](_0x2ce216[_0x0fd3('0x37')][_0x0fd3('0x3f')]);_0x471505[_0x0fd3('0x2a')]=qs[_0x0fd3('0x2a')](_0x2ce216[_0x0fd3('0x37')]['offset']);}_0x471505[_0x0fd3('0x40')]=qs[_0x0fd3('0x41')](_0x2ce216[_0x0fd3('0x37')][_0x0fd3('0x41')]);_0x471505[_0x0fd3('0x42')]=qs[_0x0fd3('0x38')](_['pick'](_0x2ce216[_0x0fd3('0x37')],_0x5c900e[_0x0fd3('0x38')]));if(_0x2ce216['query'][_0x0fd3('0x43')]){_0x471505[_0x0fd3('0x42')]=_[_0x0fd3('0x44')](_0x471505[_0x0fd3('0x42')],{'$or':_[_0x0fd3('0x45')](_0x1afd5e,function(_0x225287){if(_0x225287[_0x0fd3('0x46')]['key']!==_0x0fd3('0x47')){var _0x1cdb26={};_0x1cdb26[_0x225287[_0x0fd3('0x48')]]={'$like':'%'+_0x2ce216['query']['filter']+'%'};return _0x1cdb26;}})});}_0x471505=_[_0x0fd3('0x44')]({},_0x471505,_0x2ce216[_0x0fd3('0x49')]);var _0x5e6637={'where':_0x471505['where']};return db[_0x0fd3('0x34')]['count'](_0x5e6637)[_0x0fd3('0x1c')](function(_0x31dc15){_0x3fead2['count']=_0x31dc15;if(_0x2ce216['query'][_0x0fd3('0x4a')]){_0x471505[_0x0fd3('0x4b')]=[{'all':!![]}];}return db[_0x0fd3('0x34')][_0x0fd3('0x4c')](_0x471505);})[_0x0fd3('0x1c')](function(_0x34826a){_0x3fead2['rows']=_0x34826a;return _0x3fead2;})[_0x0fd3('0x1c')](respondWithFilteredResult(_0x57b65c,_0x471505))[_0x0fd3('0x25')](handleError(_0x57b65c,null));};exports[_0x0fd3('0x4d')]=function(_0x68c67d,_0x197504){var _0x19f248={'raw':![],'where':{'id':_0x68c67d['params']['id']}},_0x37ab79={};_0x37ab79[_0x0fd3('0x3a')]=_[_0x0fd3('0x36')](db['Dynamics365Account'][_0x0fd3('0x35')]);_0x37ab79[_0x0fd3('0x37')]=_['keys'](_0x68c67d[_0x0fd3('0x37')]);_0x37ab79[_0x0fd3('0x38')]=_[_0x0fd3('0x39')](_0x37ab79[_0x0fd3('0x3a')],_0x37ab79[_0x0fd3('0x37')]);_0x19f248['attributes']=_[_0x0fd3('0x39')](_0x37ab79['model'],qs['fields'](_0x68c67d['query'][_0x0fd3('0x3c')]));_0x19f248[_0x0fd3('0x3b')]=_0x19f248[_0x0fd3('0x3b')][_0x0fd3('0x3d')]?_0x19f248[_0x0fd3('0x3b')]:_0x37ab79[_0x0fd3('0x3a')];if(_0x68c67d[_0x0fd3('0x37')][_0x0fd3('0x4a')]){_0x19f248[_0x0fd3('0x4b')]=[{'all':!![]}];}_0x19f248=_['merge']({},_0x19f248,_0x68c67d['options']);return db['Dynamics365Account'][_0x0fd3('0x4e')](_0x19f248)[_0x0fd3('0x1c')](handleEntityNotFound(_0x197504,null))[_0x0fd3('0x1c')](respondWithResult(_0x197504,null))['catch'](handleError(_0x197504,null));};exports[_0x0fd3('0x4f')]=function(_0x3fc8a0,_0xb9feca){return db[_0x0fd3('0x34')][_0x0fd3('0x4f')](_0x3fc8a0['body'],{})[_0x0fd3('0x1c')](respondWithResult(_0xb9feca,0xc9))[_0x0fd3('0x25')](handleError(_0xb9feca,null));};exports[_0x0fd3('0x30')]=function(_0x4f841a,_0x215781){if(_0x4f841a['body']['id']){delete _0x4f841a[_0x0fd3('0x50')]['id'];}return db[_0x0fd3('0x34')][_0x0fd3('0x4e')]({'where':{'id':_0x4f841a['params']['id']}})[_0x0fd3('0x1c')](handleEntityNotFound(_0x215781,null))[_0x0fd3('0x1c')](saveUpdates(_0x4f841a[_0x0fd3('0x50')],null))['then'](respondWithResult(_0x215781,null))[_0x0fd3('0x25')](handleError(_0x215781,null));};exports[_0x0fd3('0x51')]=function(_0x1f978d,_0x5d6550){return db[_0x0fd3('0x34')]['find']({'where':{'id':_0x1f978d[_0x0fd3('0x52')]['id']}})[_0x0fd3('0x1c')](handleEntityNotFound(_0x5d6550,null))[_0x0fd3('0x1c')](removeEntity(_0x5d6550,null))[_0x0fd3('0x25')](handleError(_0x5d6550,null));};exports[_0x0fd3('0x53')]=function(_0x59c690,_0x36e413,_0x10ae3d){var _0x3b35b2={};var _0x36ef8b={};var _0x2e6c49;var _0x46423a;return db[_0x0fd3('0x34')][_0x0fd3('0x54')]({'where':{'id':_0x59c690['params']['id']}})[_0x0fd3('0x1c')](handleEntityNotFound(_0x36e413,null))[_0x0fd3('0x1c')](function(_0x2f1dba){if(_0x2f1dba){_0x2e6c49=_0x2f1dba;_0x36ef8b[_0x0fd3('0x3a')]=_[_0x0fd3('0x36')](db[_0x0fd3('0x55')][_0x0fd3('0x35')]);_0x36ef8b[_0x0fd3('0x37')]=_[_0x0fd3('0x36')](_0x59c690[_0x0fd3('0x37')]);_0x36ef8b[_0x0fd3('0x38')]=_[_0x0fd3('0x39')](_0x36ef8b['model'],_0x36ef8b[_0x0fd3('0x37')]);_0x3b35b2[_0x0fd3('0x3b')]=_[_0x0fd3('0x39')](_0x36ef8b[_0x0fd3('0x3a')],qs[_0x0fd3('0x3c')](_0x59c690['query'][_0x0fd3('0x3c')]));_0x3b35b2[_0x0fd3('0x3b')]=_0x3b35b2[_0x0fd3('0x3b')][_0x0fd3('0x3d')]?_0x3b35b2[_0x0fd3('0x3b')]:_0x36ef8b['model'];_0x3b35b2['order']=qs[_0x0fd3('0x41')](_0x59c690[_0x0fd3('0x37')][_0x0fd3('0x41')]);_0x3b35b2[_0x0fd3('0x42')]=qs[_0x0fd3('0x38')](_[_0x0fd3('0x56')](_0x59c690[_0x0fd3('0x37')],_0x36ef8b['filters']));if(_0x59c690[_0x0fd3('0x37')][_0x0fd3('0x43')]){_0x3b35b2[_0x0fd3('0x42')]=_['merge'](_0x3b35b2[_0x0fd3('0x42')],{'$or':_[_0x0fd3('0x45')](_0x3b35b2['attributes'],function(_0xb67ff9){var _0x45cc98={};_0x45cc98[_0xb67ff9]={'$like':'%'+_0x59c690[_0x0fd3('0x37')][_0x0fd3('0x43')]+'%'};return _0x45cc98;})});}_0x3b35b2=_[_0x0fd3('0x44')]({},_0x3b35b2,_0x59c690[_0x0fd3('0x49')]);return _0x2e6c49[_0x0fd3('0x53')](_0x3b35b2);}})['then'](function(_0x41f0eb){if(_0x41f0eb){_0x46423a=_0x41f0eb['length'];if(!_0x59c690['query'][_0x0fd3('0x57')](_0x0fd3('0x3e'))){_0x3b35b2[_0x0fd3('0x3f')]=qs['limit'](_0x59c690[_0x0fd3('0x37')]['limit']);_0x3b35b2[_0x0fd3('0x2a')]=qs['offset'](_0x59c690['query'][_0x0fd3('0x2a')]);}return _0x2e6c49[_0x0fd3('0x53')](_0x3b35b2);}})[_0x0fd3('0x1c')](function(_0x436f35){if(_0x436f35){return _0x436f35?{'count':_0x46423a,'rows':_0x436f35}:null;}})['then'](respondWithResult(_0x36e413,null))['catch'](handleError(_0x36e413,null));};exports[_0x0fd3('0x58')]=function(_0x358721,_0x3d0471,_0x1a0b38){if(_0x358721[_0x0fd3('0x50')]['id']){delete _0x358721['body']['id'];}return db[_0x0fd3('0x34')]['findOne']({'where':{'id':_0x358721[_0x0fd3('0x52')]['id']}})[_0x0fd3('0x1c')](handleEntityNotFound(_0x3d0471,null))[_0x0fd3('0x1c')](function(_0x134741){if(_0x134741){_0x358721[_0x0fd3('0x50')]['AccountId']=_0x134741['id'];_0x358721[_0x0fd3('0x50')][_0x0fd3('0x59')]=integrations[_0x0fd3('0x5a')](_0x358721[_0x0fd3('0x50')][_0x0fd3('0x5b')],_0x358721[_0x0fd3('0x50')][_0x0fd3('0x46')]);_0x358721[_0x0fd3('0x50')][_0x0fd3('0x5c')]=integrations[_0x0fd3('0x5d')](_0x358721['body'][_0x0fd3('0x5b')],_0x358721[_0x0fd3('0x50')][_0x0fd3('0x46')]);return db[_0x0fd3('0x55')][_0x0fd3('0x4f')](_0x358721[_0x0fd3('0x50')],{'include':[{'model':db[_0x0fd3('0x5e')],'as':'Subjects'},{'model':db[_0x0fd3('0x5e')],'as':_0x0fd3('0x5c')}]});}return null;})['then'](respondWithResult(_0x3d0471,null))[_0x0fd3('0x25')](handleError(_0x3d0471,null));};exports[_0x0fd3('0x5f')]=function(_0x32cb4a,_0x249cd8,_0x34b37e){var _0x4fc176=_0x32cb4a[_0x0fd3('0x37')]['ticketType'];var _0x24deea=_0x4fc176===_0x0fd3('0x60')?'Incident':_0x0fd3('0x61');var _0x52f474='';var _0x26d070='';var _0x32f416='';var _0x216605='';var _0x32b43e='';var _0x44f6c2='';var _0x3c90f4='';var _0x432fee='';var _0x5b8641=['title','description',_0x0fd3('0x62'),_0x0fd3('0x63'),_0x0fd3('0x64'),'subject',_0x0fd3('0x65'),_0x0fd3('0x66'),'directioncode',_0x0fd3('0x67')];var _0x48a5d7=[_0x0fd3('0x68'),_0x0fd3('0x69'),_0x0fd3('0x6a'),'billedserviceunits',_0x0fd3('0x6b'),_0x0fd3('0x6c'),_0x0fd3('0x6d'),_0x0fd3('0x6e'),_0x0fd3('0x6f'),_0x0fd3('0x70'),_0x0fd3('0x71'),_0x0fd3('0x72'),'createdon','createdonbehalfbyname',_0x0fd3('0x73'),_0x0fd3('0x74'),'customeridtype',_0x0fd3('0x75'),_0x0fd3('0x76'),_0x0fd3('0x77'),'entityimage_timestamp','entityimage_url',_0x0fd3('0x78'),_0x0fd3('0x79'),'firstresponsebykpiidname','followupby','importsequencenumber',_0x0fd3('0x7a'),_0x0fd3('0x7b'),_0x0fd3('0x7c'),_0x0fd3('0x7d'),_0x0fd3('0x7e'),_0x0fd3('0x7f'),'modifiedbyname',_0x0fd3('0x80'),_0x0fd3('0x81'),'modifiedonbehalfbyname',_0x0fd3('0x82'),'msdyn_incidenttypename',_0x0fd3('0x83'),_0x0fd3('0x84'),'onholdtime',_0x0fd3('0x85'),_0x0fd3('0x86'),_0x0fd3('0x87'),_0x0fd3('0x88'),_0x0fd3('0x89'),_0x0fd3('0x8a'),'primarycontactidyominame','prioritycodename','productidname',_0x0fd3('0x8b'),_0x0fd3('0x8c'),'resolvebykpiidname','responseby',_0x0fd3('0x8d'),_0x0fd3('0x8e'),_0x0fd3('0x8f'),_0x0fd3('0x90'),_0x0fd3('0x91'),_0x0fd3('0x92'),_0x0fd3('0x93'),'statuscode',_0x0fd3('0x94'),_0x0fd3('0x95'),_0x0fd3('0x96'),'transactioncurrencyidname',_0x0fd3('0x97'),_0x0fd3('0x98'),'versionnumber'];var _0x3ad692=_0x5b8641[_0x0fd3('0x99')](_0x48a5d7);return db['Dynamics365Account'][_0x0fd3('0x54')]({'where':{'id':_0x32cb4a[_0x0fd3('0x52')]['id']},'attributes':['id','username',_0x0fd3('0x9a'),_0x0fd3('0x9b'),_0x0fd3('0x9c'),_0x0fd3('0x9d'),'clientSecret']})[_0x0fd3('0x1c')](handleEntityNotFound(_0x249cd8,null))[_0x0fd3('0x1c')](function(_0x1be8b3){if(_0x1be8b3){_0x432fee=_0x1be8b3[_0x0fd3('0x9b')];var _0xe900b0=_0x432fee[_0x0fd3('0x9e')](-0x1);if(_0xe900b0==='/'){_0x432fee=_0x432fee['substring'](0x0,_0x432fee['lastIndexOf'](_0xe900b0));}_0x3c90f4=util['format'](_0x0fd3('0x9f'),_0x432fee);var _0x43f85c={'method':_0x0fd3('0xa0'),'uri':_0x0fd3('0xa1')+_0x1be8b3[_0x0fd3('0x9c')]+'/oauth2/token','form':{'client_id':_0x1be8b3[_0x0fd3('0x9d')],'resource':_0x432fee,'username':_0x1be8b3[_0x0fd3('0xa2')],'password':_0x1be8b3[_0x0fd3('0x9a')],'grant_type':'password','client_secret':_0x1be8b3[_0x0fd3('0xa3')]},'json':!![]};return rp(_0x43f85c);}})[_0x0fd3('0x1c')](function(_0x6c4813){_0x44f6c2=_0x6c4813['access_token'];var _0x370b7c={'method':'GET','uri':encodeURI(_0x3c90f4+_0x0fd3('0xa4')+_0x24deea+'\x27'),'headers':{'Authorization':_0x0fd3('0xa5')+_0x44f6c2,'If-None-Match':null,'OData-Version':_0x0fd3('0xa6')},'json':!![]};return rp(_0x370b7c);})['then'](function(_0x21b191){var _0x20f736=_0x21b191['value'][0x0];var _0x2d7aed=_0x20f736[_0x0fd3('0xa7')];var _0x2be039={'method':_0x0fd3('0xa8'),'uri':_0x3c90f4+_0x0fd3('0xa9')+_0x2d7aed+_0x0fd3('0xaa'),'headers':{'Authorization':_0x0fd3('0xa5')+_0x44f6c2,'If-None-Match':null,'OData-Version':_0x0fd3('0xa6')},'json':!![]};return rp(_0x2be039);})['then'](function(_0x50f4b8){_0x52f474=_0x50f4b8;_0x26d070=_0x52f474['Attributes'];_0x26d070=_[_0x0fd3('0xab')](_0x26d070,function(_0x39a337){return!_0x3ad692[_0x0fd3('0xac')](_0x39a337[_0x0fd3('0xad')]);});var _0x4bdd81=[];var _0x29b4d2=[];_0x26d070['forEach'](function(_0x9bf093){if(_0x9bf093['@odata.type']){var _0x52e405=_0x9bf093[_0x0fd3('0xae')]['substring'](_0x9bf093['@odata.type'][_0x0fd3('0xaf')]('.')+0x1);if(_0x52e405===_0x0fd3('0xb0')){_0x4bdd81[_0x0fd3('0xb1')](getSelectList(_0x3c90f4,_0x4fc176,_0x29b4d2,_0x52f474[_0x0fd3('0xa7')],_0x9bf093[_0x0fd3('0xa7')],_0x44f6c2));}}});return Promise[_0x0fd3('0xb2')](_0x4bdd81);})[_0x0fd3('0x1c')](function(_0x378a86){_0x32f416=_0x378a86[0x0];var _0x5862a4=[];var _0x296bba=[];_0x26d070[_0x0fd3('0xb3')](function(_0xa2bc95){if(!_['isNil'](_0xa2bc95['@odata.type'])){var _0x12d65a=_0xa2bc95['@odata.type'][_0x0fd3('0xb4')](_0xa2bc95['@odata.type']['lastIndexOf']('.')+0x1);if(_0x12d65a==='BooleanAttributeMetadata'){_0x5862a4[_0x0fd3('0xb1')](getBooleanList(_0x3c90f4,_0x4fc176,_0x296bba,_0x52f474[_0x0fd3('0xa7')],_0xa2bc95[_0x0fd3('0xa7')],_0x44f6c2));}}});return Promise[_0x0fd3('0xb2')](_0x5862a4);})[_0x0fd3('0x1c')](function(_0x33105a){_0x216605=_0x33105a[0x0];var _0x4d28ec=[];var _0x40555d=[];_0x26d070[_0x0fd3('0xb3')](function(_0x40c1d4){if(_0x40c1d4[_0x0fd3('0xae')]){var _0xaa973=_0x40c1d4['@odata.type'][_0x0fd3('0xb4')](_0x40c1d4[_0x0fd3('0xae')]['lastIndexOf']('.')+0x1);if(_0xaa973===_0x0fd3('0xb5')||_0xaa973===_0x0fd3('0xb6')||_0xaa973==='BigIntAttributeMetadata'||_0xaa973==='IntegerAttributeMetadata'||_0xaa973===_0x0fd3('0xb7')||_0xaa973===_0x0fd3('0xb8')||_0xaa973===_0x0fd3('0xb9')||_0xaa973===_0x0fd3('0xba')||_0xaa973===_0x0fd3('0xbb')||_0xaa973===_0x0fd3('0xbc')){_0x4d28ec[_0x0fd3('0xb1')](getInputList(_0x3c90f4,_0x4fc176,_0xaa973,_0x40555d,_0x52f474[_0x0fd3('0xa7')],_0x40c1d4['MetadataId'],_0x44f6c2));}}});return Promise['all'](_0x4d28ec);})[_0x0fd3('0x1c')](function(_0x21aa58){_0x32b43e=_0x21aa58[0x0];var _0x14f1ff=_0x32f416[_0x0fd3('0x99')](_0x216605)[_0x0fd3('0x99')](_0x32b43e);var _0x55da08={'count':_0x14f1ff['length'],'rows':_0x14f1ff};return _0x55da08;})[_0x0fd3('0x1c')](respondWithResult(_0x249cd8,null))[_0x0fd3('0x25')](function(_0x5acd47){console[_0x0fd3('0xbd')](_0x0fd3('0xbe')+_0x5acd47);var _0x1db358=_0x32cb4a[_0x0fd3('0x37')]['test']?0x1f4:_0x5acd47[_0x0fd3('0xbf')]||0x1f4;logger[_0x0fd3('0x20')](_0x5acd47['stack']);delete _0x5acd47['name'];if(_0x1db358===0x191){_0x1db358=0x190;}_0x249cd8[_0x0fd3('0x27')](_0x1db358)[_0x0fd3('0x32')](_0x32cb4a['query'][_0x0fd3('0x1a')]?{'message':_0x0fd3('0xc0'),'statusCode':_0x5acd47[_0x0fd3('0xbf')]}:_0x5acd47);});};function getSelectList(_0x430a69,_0x2700c0,_0x3e3140,_0x38a611,_0x39544d,_0x398514){var _0x5eb9b1={'method':_0x0fd3('0xa8'),'uri':_0x430a69+_0x0fd3('0xa9')+_0x38a611+_0x0fd3('0xc1')+_0x39544d+_0x0fd3('0xc2')+_0x0fd3('0xc3'),'headers':{'Authorization':_0x0fd3('0xa5')+_0x398514,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5eb9b1)[_0x0fd3('0x1c')](function(_0x19676b){var _0x2cdbdd=[];var _0x34990a=_0x19676b[_0x0fd3('0xc4')][_0x0fd3('0xc5')];_0x34990a[_0x0fd3('0xb3')](function(_0x81c0d5){_0x2cdbdd[_0x0fd3('0xb1')]({'name':_0x81c0d5['Label'][_0x0fd3('0xc6')][_0x0fd3('0xc7')],'value':String(_0x81c0d5[_0x0fd3('0xc8')])});});var _0x5b0cc0={'id':_0x2700c0+'_'+_0x19676b[_0x0fd3('0xad')],'name':_0x19676b['DisplayName'][_0x0fd3('0xc6')]['Label'],'custom':![],'options':_0x2cdbdd};_0x3e3140[_0x0fd3('0xb1')](_0x5b0cc0);return _0x3e3140;});}function getBooleanList(_0x2a3cb3,_0x5801ad,_0xd03e53,_0x567c7a,_0x2caeef,_0x1905c0){var _0x49c466={'method':_0x0fd3('0xa8'),'uri':_0x2a3cb3+_0x0fd3('0xa9')+_0x567c7a+')/Attributes('+_0x2caeef+_0x0fd3('0xc9'),'headers':{'Authorization':_0x0fd3('0xa5')+_0x1905c0,'If-None-Match':null,'OData-Version':_0x0fd3('0xa6')},'json':!![]};return rp(_0x49c466)['then'](function(_0x5d9d00){var _0x3873db=[];_0x3873db[_0x0fd3('0xb1')]({'name':_0x5d9d00[_0x0fd3('0xc4')][_0x0fd3('0xca')][_0x0fd3('0xc7')][_0x0fd3('0xc6')][_0x0fd3('0xc7')],'value':_0x0fd3('0xcb')},{'name':_0x5d9d00['OptionSet'][_0x0fd3('0xcc')][_0x0fd3('0xc7')][_0x0fd3('0xc6')]['Label'],'value':_0x0fd3('0xcd')});var _0x204a7b={'id':_0x5801ad+'_'+_0x5d9d00[_0x0fd3('0xad')],'name':_0x5d9d00[_0x0fd3('0xce')][_0x0fd3('0xc6')][_0x0fd3('0xc7')],'custom':![],'options':_0x3873db};_0xd03e53['push'](_0x204a7b);return _0xd03e53;});}function getInputList(_0x43d1a1,_0x232066,_0x32d7b3,_0x1a2173,_0x55f59e,_0x288254,_0x4ed27c){var _0x592d8d={'method':_0x0fd3('0xa8'),'uri':_0x43d1a1+_0x0fd3('0xa9')+_0x55f59e+')/Attributes('+_0x288254+_0x0fd3('0xcf')+_0x32d7b3+_0x0fd3('0xd0'),'headers':{'Authorization':_0x0fd3('0xa5')+_0x4ed27c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x592d8d)['then'](function(_0x180633){var _0x2b546c={'id':_0x232066+'_'+_0x180633['LogicalName'],'name':_0x180633[_0x0fd3('0xce')]['UserLocalizedLabel']?_0x180633['DisplayName']['UserLocalizedLabel']['Label']:_0x180633[_0x0fd3('0xad')],'custom':![],'options':[]};_0x1a2173[_0x0fd3('0xb1')](_0x2b546c);return _0x1a2173;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a39bbc8..3711373 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 _0x594e=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','exports','define','int_dynamics365_accounts','lodash','util'];(function(_0x597254,_0x1013ef){var _0x2014fd=function(_0x481d8c){while(--_0x481d8c){_0x597254['push'](_0x597254['shift']());}};_0x2014fd(++_0x1013ef);}(_0x594e,0xfa));var _0xe594=function(_0x1781fc,_0x494d1d){_0x1781fc=_0x1781fc-0x0;var _0x2c00a4=_0x594e[_0x1781fc];return _0x2c00a4;};'use strict';var _=require(_0xe594('0x0'));var util=require(_0xe594('0x1'));var logger=require(_0xe594('0x2'))(_0xe594('0x3'));var moment=require('moment');var BPromise=require(_0xe594('0x4'));var rp=require(_0xe594('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe594('0x6'));var config=require(_0xe594('0x7'));var attributes=require(_0xe594('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xe594('0x9')]=function(_0x15cade,_0xc4b351){return _0x15cade[_0xe594('0xa')]('Dynamics365Account',attributes,{'tableName':_0xe594('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x231c=['rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x231c,0x13c));var _0xc231=function(_0x111abf,_0x3d3688){_0x111abf=_0x111abf-0x0;var _0x33eadb=_0x231c[_0x111abf];return _0x33eadb;};'use strict';var _=require(_0xc231('0x0'));var util=require('util');var logger=require(_0xc231('0x1'))(_0xc231('0x2'));var moment=require(_0xc231('0x3'));var BPromise=require(_0xc231('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc231('0x5'));var rimraf=require(_0xc231('0x6'));var config=require(_0xc231('0x7'));var attributes=require(_0xc231('0x8'));var integrations=require(_0xc231('0x9'));module[_0xc231('0xa')]=function(_0x2c5c26,_0x377054){return _0x2c5c26[_0xc231('0xb')](_0xc231('0xc'),attributes,{'tableName':_0xc231('0xd'),'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 412b941..2521011 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 _0x1002=['GetDynamics365Account','ShowDynamics365Account','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x1002,0xb7));var _0x2100=function(_0x2e83e2,_0x4ffeba){_0x2e83e2=_0x2e83e2-0x0;var _0x289512=_0x1002[_0x2e83e2];return _0x289512;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2100('0x0'));var BPromise=require(_0x2100('0x1'));var rs=require(_0x2100('0x2'));var fs=require('fs');var Redis=require(_0x2100('0x3'));var db=require(_0x2100('0x4'))['db'];var utils=require(_0x2100('0x5'));var logger=require(_0x2100('0x6'))(_0x2100('0x7'));var config=require(_0x2100('0x8'));var jayson=require(_0x2100('0x9'));var client=jayson['client'][_0x2100('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b7823,_0x4805e7,_0x2e92b2){return new BPromise(function(_0x510f02,_0x34a99c){return client['request'](_0x3b7823,_0x2e92b2)[_0x2100('0xb')](function(_0x50aacc){logger['info'](_0x2100('0xc'),_0x4805e7,_0x2100('0xd'));logger[_0x2100('0xe')](_0x2100('0xf'),_0x4805e7,_0x2100('0xd'),JSON[_0x2100('0x10')](_0x50aacc));if(_0x50aacc[_0x2100('0x11')]){if(_0x50aacc['error'][_0x2100('0x12')]===0x1f4){logger[_0x2100('0x11')](_0x2100('0xc'),_0x4805e7,_0x50aacc[_0x2100('0x11')]['message']);return _0x34a99c(_0x50aacc[_0x2100('0x11')][_0x2100('0x13')]);}logger[_0x2100('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x4805e7,_0x50aacc[_0x2100('0x11')]['message']);return _0x510f02(_0x50aacc['error'][_0x2100('0x13')]);}else{logger[_0x2100('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x4805e7,_0x2100('0xd'));_0x510f02(_0x50aacc[_0x2100('0x15')][_0x2100('0x13')]);}})[_0x2100('0x16')](function(_0x190782){logger[_0x2100('0x11')](_0x2100('0xc'),_0x4805e7,_0x190782);_0x34a99c(_0x190782);});});}exports['GetDynamics365Account']=function(_0x195957){var _0x468438=this;return new Promise(function(_0x12f898,_0x211418){return db[_0x2100('0x17')][_0x2100('0x18')]({'raw':_0x195957[_0x2100('0x19')]?_0x195957[_0x2100('0x19')][_0x2100('0x1a')]===undefined?!![]:![]:!![],'where':_0x195957['options']?_0x195957[_0x2100('0x19')][_0x2100('0x1b')]||null:null,'attributes':_0x195957[_0x2100('0x19')]?_0x195957[_0x2100('0x19')][_0x2100('0x1c')]||null:null,'limit':_0x195957[_0x2100('0x19')]?_0x195957[_0x2100('0x19')][_0x2100('0x1d')]||null:null,'include':_0x195957[_0x2100('0x19')]?_0x195957[_0x2100('0x19')][_0x2100('0x1e')]?_[_0x2100('0x1f')](_0x195957[_0x2100('0x19')]['include'],function(_0x5e9c9b){return{'model':db[_0x5e9c9b['model']],'as':_0x5e9c9b['as'],'attributes':_0x5e9c9b[_0x2100('0x1c')],'include':_0x5e9c9b[_0x2100('0x1e')]?_[_0x2100('0x1f')](_0x5e9c9b['include'],function(_0x535fd2){return{'model':db[_0x535fd2[_0x2100('0x20')]],'as':_0x535fd2['as'],'attributes':_0x535fd2[_0x2100('0x1c')],'include':_0x535fd2[_0x2100('0x1e')]?_['map'](_0x535fd2[_0x2100('0x1e')],function(_0x43b5c1){return{'model':db[_0x43b5c1[_0x2100('0x20')]],'as':_0x43b5c1['as'],'attributes':_0x43b5c1[_0x2100('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2100('0xb')](function(_0x27c744){logger[_0x2100('0x14')]('GetDynamics365Account',_0x195957);logger[_0x2100('0xe')](_0x2100('0x21'),_0x195957,JSON['stringify'](_0x27c744));_0x12f898(_0x27c744);})[_0x2100('0x16')](function(_0x1d4044){logger[_0x2100('0x11')](_0x2100('0x21'),_0x1d4044[_0x2100('0x13')],_0x195957);_0x211418(_0x468438[_0x2100('0x11')](0x1f4,_0x1d4044[_0x2100('0x13')]));});});};exports[_0x2100('0x22')]=function(_0x215b53){var _0x1c571b=this;return new Promise(function(_0x4129c4,_0x1f1894){return db['Dynamics365Account'][_0x2100('0x23')]({'raw':_0x215b53[_0x2100('0x19')]?_0x215b53[_0x2100('0x19')][_0x2100('0x1a')]===undefined?!![]:![]:!![],'where':_0x215b53['options']?_0x215b53['options'][_0x2100('0x1b')]||null:null,'attributes':_0x215b53[_0x2100('0x19')]?_0x215b53[_0x2100('0x19')]['attributes']||null:null,'include':_0x215b53[_0x2100('0x19')]?_0x215b53['options'][_0x2100('0x1e')]?_[_0x2100('0x1f')](_0x215b53[_0x2100('0x19')][_0x2100('0x1e')],function(_0xefba9b){return{'model':db[_0xefba9b[_0x2100('0x20')]],'as':_0xefba9b['as'],'attributes':_0xefba9b['attributes'],'include':_0xefba9b[_0x2100('0x1e')]?_['map'](_0xefba9b[_0x2100('0x1e')],function(_0x45f407){return{'model':db[_0x45f407[_0x2100('0x20')]],'as':_0x45f407['as'],'attributes':_0x45f407[_0x2100('0x1c')],'include':_0x45f407[_0x2100('0x1e')]?_[_0x2100('0x1f')](_0x45f407[_0x2100('0x1e')],function(_0x266547){return{'model':db[_0x266547['model']],'as':_0x266547['as'],'attributes':_0x266547['attributes']};}):[]};}):[]};}):[]:[]})[_0x2100('0xb')](function(_0x30ea3f){logger[_0x2100('0x14')](_0x2100('0x22'),_0x215b53);logger['debug']('ShowDynamics365Account',_0x215b53,JSON[_0x2100('0x10')](_0x30ea3f));_0x4129c4(_0x30ea3f);})[_0x2100('0x16')](function(_0x3292b3){logger['error'](_0x2100('0x22'),_0x3292b3['message'],_0x215b53);_0x1f1894(_0x1c571b[_0x2100('0x11')](0x1f4,_0x3292b3[_0x2100('0x13')]));});});}; \ No newline at end of file +var _0xd385=['info','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','stringify','error','message','Dynamics365Account,\x20%s,\x20%s'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xd385,0xf0));var _0x5d38=function(_0x2c27f9,_0x120e57){_0x2c27f9=_0x2c27f9-0x0;var _0x38edef=_0xd385[_0x2c27f9];return _0x38edef;};'use strict';var _=require(_0x5d38('0x0'));var util=require(_0x5d38('0x1'));var moment=require('moment');var BPromise=require(_0x5d38('0x2'));var rs=require(_0x5d38('0x3'));var fs=require('fs');var Redis=require(_0x5d38('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d38('0x5'))(_0x5d38('0x6'));var config=require(_0x5d38('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5d38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa43b,_0x263bd1,_0x2bbee0){return new BPromise(function(_0x5566d8,_0x175f80){return client[_0x5d38('0x9')](_0x5aa43b,_0x2bbee0)[_0x5d38('0xa')](function(_0x145f34){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x263bd1,_0x5d38('0xb'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x263bd1,_0x5d38('0xb'),JSON[_0x5d38('0xc')](_0x145f34));if(_0x145f34[_0x5d38('0xd')]){if(_0x145f34[_0x5d38('0xd')]['code']===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x263bd1,_0x145f34['error'][_0x5d38('0xe')]);return _0x175f80(_0x145f34[_0x5d38('0xd')][_0x5d38('0xe')]);}logger['error'](_0x5d38('0xf'),_0x263bd1,_0x145f34['error']['message']);return _0x5566d8(_0x145f34[_0x5d38('0xd')][_0x5d38('0xe')]);}else{logger[_0x5d38('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x263bd1,'request\x20sent');_0x5566d8(_0x145f34[_0x5d38('0x11')]['message']);}})[_0x5d38('0x12')](function(_0x1ecfe0){logger[_0x5d38('0xd')](_0x5d38('0xf'),_0x263bd1,_0x1ecfe0);_0x175f80(_0x1ecfe0);});});}exports['GetDynamics365Account']=function(_0x2633d9){var _0x1a6c1f=this;return new Promise(function(_0x306f7f,_0x571d90){return db['Dynamics365Account'][_0x5d38('0x13')]({'raw':_0x2633d9[_0x5d38('0x14')]?_0x2633d9[_0x5d38('0x14')][_0x5d38('0x15')]===undefined?!![]:![]:!![],'where':_0x2633d9[_0x5d38('0x14')]?_0x2633d9[_0x5d38('0x14')][_0x5d38('0x16')]||null:null,'attributes':_0x2633d9[_0x5d38('0x14')]?_0x2633d9[_0x5d38('0x14')][_0x5d38('0x17')]||null:null,'limit':_0x2633d9[_0x5d38('0x14')]?_0x2633d9[_0x5d38('0x14')][_0x5d38('0x18')]||null:null,'include':_0x2633d9['options']?_0x2633d9[_0x5d38('0x14')][_0x5d38('0x19')]?_[_0x5d38('0x1a')](_0x2633d9[_0x5d38('0x14')]['include'],function(_0x1e7804){return{'model':db[_0x1e7804[_0x5d38('0x1b')]],'as':_0x1e7804['as'],'attributes':_0x1e7804[_0x5d38('0x17')],'include':_0x1e7804[_0x5d38('0x19')]?_[_0x5d38('0x1a')](_0x1e7804[_0x5d38('0x19')],function(_0x7325c4){return{'model':db[_0x7325c4[_0x5d38('0x1b')]],'as':_0x7325c4['as'],'attributes':_0x7325c4[_0x5d38('0x17')],'include':_0x7325c4[_0x5d38('0x19')]?_[_0x5d38('0x1a')](_0x7325c4[_0x5d38('0x19')],function(_0x1c6267){return{'model':db[_0x1c6267[_0x5d38('0x1b')]],'as':_0x1c6267['as'],'attributes':_0x1c6267[_0x5d38('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5d38('0xa')](function(_0x12925f){logger[_0x5d38('0x10')](_0x5d38('0x1c'),_0x2633d9);logger['debug'](_0x5d38('0x1c'),_0x2633d9,JSON[_0x5d38('0xc')](_0x12925f));_0x306f7f(_0x12925f);})[_0x5d38('0x12')](function(_0x5d0508){logger[_0x5d38('0xd')]('GetDynamics365Account',_0x5d0508[_0x5d38('0xe')],_0x2633d9);_0x571d90(_0x1a6c1f[_0x5d38('0xd')](0x1f4,_0x5d0508[_0x5d38('0xe')]));});});};exports[_0x5d38('0x1d')]=function(_0x5c180e){var _0x2db95f=this;return new Promise(function(_0x2c3f96,_0x4961f0){return db[_0x5d38('0x1e')]['find']({'raw':_0x5c180e[_0x5d38('0x14')]?_0x5c180e[_0x5d38('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5c180e[_0x5d38('0x14')]?_0x5c180e[_0x5d38('0x14')][_0x5d38('0x16')]||null:null,'attributes':_0x5c180e['options']?_0x5c180e[_0x5d38('0x14')][_0x5d38('0x17')]||null:null,'include':_0x5c180e[_0x5d38('0x14')]?_0x5c180e['options'][_0x5d38('0x19')]?_['map'](_0x5c180e['options'][_0x5d38('0x19')],function(_0x260e3f){return{'model':db[_0x260e3f[_0x5d38('0x1b')]],'as':_0x260e3f['as'],'attributes':_0x260e3f[_0x5d38('0x17')],'include':_0x260e3f['include']?_['map'](_0x260e3f[_0x5d38('0x19')],function(_0x50c9d5){return{'model':db[_0x50c9d5[_0x5d38('0x1b')]],'as':_0x50c9d5['as'],'attributes':_0x50c9d5[_0x5d38('0x17')],'include':_0x50c9d5['include']?_[_0x5d38('0x1a')](_0x50c9d5[_0x5d38('0x19')],function(_0x390d98){return{'model':db[_0x390d98[_0x5d38('0x1b')]],'as':_0x390d98['as'],'attributes':_0x390d98[_0x5d38('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5d38('0xa')](function(_0x4d086e){logger[_0x5d38('0x10')](_0x5d38('0x1d'),_0x5c180e);logger[_0x5d38('0x1f')](_0x5d38('0x1d'),_0x5c180e,JSON['stringify'](_0x4d086e));_0x2c3f96(_0x4d086e);})[_0x5d38('0x12')](function(_0x51c234){logger[_0x5d38('0xd')](_0x5d38('0x1d'),_0x51c234[_0x5d38('0xe')],_0x5c180e);_0x4961f0(_0x2db95f[_0x5d38('0xd')](0x1f4,_0x51c234[_0x5d38('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 237dbec..cbb94dd 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 _0xf2c6=['post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','index','get','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x3e8bbe,_0x515b8d){var _0xb35505=function(_0x32b52a){while(--_0x32b52a){_0x3e8bbe['push'](_0x3e8bbe['shift']());}};_0xb35505(++_0x515b8d);}(_0xf2c6,0x1d3));var _0x6f2c=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0xf2c6[_0x18b5e8];return _0x25baed;};'use strict';var multer=require(_0x6f2c('0x0'));var util=require(_0x6f2c('0x1'));var path=require('path');var timeout=require(_0x6f2c('0x2'));var express=require(_0x6f2c('0x3'));var router=express[_0x6f2c('0x4')]();var auth=require(_0x6f2c('0x5'));var interaction=require(_0x6f2c('0x6'));var config=require('../../config/environment');var controller=require(_0x6f2c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f2c('0x8')]);router[_0x6f2c('0x9')]('/:id',auth[_0x6f2c('0xa')](),controller[_0x6f2c('0xb')]);router[_0x6f2c('0x9')](_0x6f2c('0xc'),auth[_0x6f2c('0xa')](),controller['getFields']);router[_0x6f2c('0x9')]('/:id/subjects',auth[_0x6f2c('0xa')](),controller[_0x6f2c('0xd')]);router['get'](_0x6f2c('0xe'),auth[_0x6f2c('0xa')](),controller[_0x6f2c('0xf')]);router[_0x6f2c('0x10')]('/',auth[_0x6f2c('0xa')](),controller[_0x6f2c('0x11')]);router[_0x6f2c('0x12')](_0x6f2c('0x13'),auth[_0x6f2c('0xa')](),controller['update']);router[_0x6f2c('0x14')]('/:id',auth[_0x6f2c('0xa')](),controller[_0x6f2c('0x15')]);module[_0x6f2c('0x16')]=router; \ No newline at end of file +var _0x6018=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x4f4107,_0x342cd4){var _0x2f02bc=function(_0x1b9918){while(--_0x1b9918){_0x4f4107['push'](_0x4f4107['shift']());}};_0x2f02bc(++_0x342cd4);}(_0x6018,0x103));var _0x8601=function(_0x535aa3,_0x1e1ce4){_0x535aa3=_0x535aa3-0x0;var _0x363945=_0x6018[_0x535aa3];return _0x363945;};'use strict';var multer=require(_0x8601('0x0'));var util=require(_0x8601('0x1'));var path=require(_0x8601('0x2'));var timeout=require(_0x8601('0x3'));var express=require(_0x8601('0x4'));var router=express[_0x8601('0x5')]();var auth=require(_0x8601('0x6'));var interaction=require(_0x8601('0x7'));var config=require(_0x8601('0x8'));var controller=require(_0x8601('0x9'));router[_0x8601('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8601('0xa')]('/:id',auth[_0x8601('0xb')](),controller[_0x8601('0xc')]);router[_0x8601('0xa')](_0x8601('0xd'),auth[_0x8601('0xb')](),controller[_0x8601('0xe')]);router[_0x8601('0xa')](_0x8601('0xf'),auth[_0x8601('0xb')](),controller[_0x8601('0x10')]);router['get'](_0x8601('0x11'),auth[_0x8601('0xb')](),controller[_0x8601('0x12')]);router[_0x8601('0x13')]('/',auth['isAuthenticated'](),controller[_0x8601('0x14')]);router[_0x8601('0x15')](_0x8601('0x16'),auth[_0x8601('0xb')](),controller[_0x8601('0x17')]);router[_0x8601('0x18')](_0x8601('0x16'),auth[_0x8601('0xb')](),controller[_0x8601('0x19')]);module[_0x8601('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index db3ca56..a5ed5dd 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 _0xfe8c=['ENUM','incident','phonecall','sequelize','STRING'];(function(_0x200875,_0x3df837){var _0x2907bd=function(_0x30fa11){while(--_0x30fa11){_0x200875['push'](_0x200875['shift']());}};_0x2907bd(++_0x3df837);}(_0xfe8c,0x134));var _0xcfe8=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xfe8c[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0xcfe8('0x0'));module['exports']={'name':{'type':Sequelize[_0xcfe8('0x1')]},'description':{'type':Sequelize[_0xcfe8('0x1')]},'ticketType':{'type':Sequelize[_0xcfe8('0x2')](_0xcfe8('0x3'),_0xcfe8('0x4')),'defaultValue':_0xcfe8('0x3')}}; \ No newline at end of file +var _0xf01c=['phonecall','incident','sequelize','exports','STRING','ENUM'];(function(_0x1f8aa6,_0x311bfb){var _0x379441=function(_0x42c3e4){while(--_0x42c3e4){_0x1f8aa6['push'](_0x1f8aa6['shift']());}};_0x379441(++_0x311bfb);}(_0xf01c,0xce));var _0xcf01=function(_0x58edb2,_0x513405){_0x58edb2=_0x58edb2-0x0;var _0x262e52=_0xf01c[_0x58edb2];return _0x262e52;};'use strict';var Sequelize=require(_0xcf01('0x0'));module[_0xcf01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcf01('0x2')]},'ticketType':{'type':Sequelize[_0xcf01('0x3')]('incident',_0xcf01('0x4')),'defaultValue':_0xcf01('0x5')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 72b775d..a955978 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 _0x47a0=['Dynamics365Field','getSubjects','getDescriptions','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','sendStatus','status','offset','limit','Content-Range','apply','destroy','end','stack','name','send','Dynamics365Configuration','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','getFields','findOne'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x47a0,0x1ac));var _0x047a=function(_0x4e2a07,_0x29adfc){_0x4e2a07=_0x4e2a07-0x0;var _0x4992f1=_0x47a0[_0x4e2a07];return _0x4992f1;};'use strict';var pdf=require(_0x047a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x047a('0x1'));var jsonpatch=require(_0x047a('0x2'));var rp=require('request-promise');var moment=require(_0x047a('0x3'));var BPromise=require(_0x047a('0x4'));var Mustache=require('mustache');var util=require(_0x047a('0x5'));var path=require(_0x047a('0x6'));var sox=require('sox');var csv=require(_0x047a('0x7'));var ejs=require(_0x047a('0x8'));var fs=require('fs');var _=require(_0x047a('0x9'));var squel=require(_0x047a('0xa'));var crypto=require(_0x047a('0xb'));var jsforce=require(_0x047a('0xc'));var deskjs=require(_0x047a('0xd'));var toCsv=require(_0x047a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x047a('0xe'));var qs=require(_0x047a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x047a('0x10'))(_0x047a('0x11'));var utils=require(_0x047a('0x12'));var config=require('../../config/environment');var db=require(_0x047a('0x13'))['db'];var jayson=require(_0x047a('0x14'));var client=jayson[_0x047a('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x4591e9,_0x3ed83f,_0x1c5175){if(_0x1c5175){var _0xb9ab96=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb9ab96['test'](_0x3ed83f)){return _0x4591e9;}else{throw new Error(_0x047a('0x16'));}}else{return _0x4591e9;}}function respondWithRpcPromise(_0x5b5fa1,_0x136cb0,_0x2c6887,_0x39486a){return new BPromise(function(_0x505f5c,_0x44f088){var _0x50dcff=_0x39486a||client;return _0x50dcff[_0x047a('0x17')](_0x5b5fa1,_0x2c6887)[_0x047a('0x18')](function(_0x3e2c05){logger[_0x047a('0x19')]('Dynamics365Configuration,\x20%s,\x20%s',_0x136cb0,_0x047a('0x1a'));logger[_0x047a('0x1b')](_0x047a('0x1c'),_0x136cb0,_0x047a('0x1a'),JSON[_0x047a('0x1d')](_0x3e2c05));if(_0x3e2c05[_0x047a('0x1e')]){if(_0x3e2c05[_0x047a('0x1e')][_0x047a('0x1f')]===0x1f4){logger[_0x047a('0x1e')](_0x047a('0x20'),_0x136cb0,_0x3e2c05[_0x047a('0x1e')]['message']);return _0x44f088(_0x3e2c05['error'][_0x047a('0x21')]);}logger[_0x047a('0x1e')](_0x047a('0x20'),_0x136cb0,_0x3e2c05[_0x047a('0x1e')]['message']);return _0x505f5c(_0x3e2c05[_0x047a('0x1e')][_0x047a('0x21')]);}else{logger[_0x047a('0x19')](_0x047a('0x20'),_0x136cb0,_0x047a('0x1a'));_0x505f5c(_0x3e2c05[_0x047a('0x22')][_0x047a('0x21')]);}})['catch'](function(_0x1382ae){logger[_0x047a('0x1e')]('Dynamics365Configuration,\x20%s,\x20%s',_0x136cb0,_0x1382ae);_0x44f088(_0x1382ae);});});}function respondWithStatusCode(_0x1f07f4,_0x1a39fd){_0x1a39fd=_0x1a39fd||0xcc;return function(_0x6d8daa){if(_0x6d8daa){return _0x1f07f4[_0x047a('0x23')](_0x1a39fd);}return _0x1f07f4[_0x047a('0x24')](_0x1a39fd)['end']();};}function respondWithResult(_0xc15051,_0x3d101){_0x3d101=_0x3d101||0xc8;return function(_0x2ddd57){if(_0x2ddd57){return _0xc15051[_0x047a('0x24')](_0x3d101)['json'](_0x2ddd57);}};}function respondWithFilteredResult(_0x9813c0,_0x594948){return function(_0x24aeb6){if(_0x24aeb6){var _0x1ad051=_0x24aeb6['count'],_0x60c4b2=_0x594948[_0x047a('0x25')],_0x4582f8=_0x594948[_0x047a('0x25')]+_0x594948[_0x047a('0x26')],_0x976440;if(_0x4582f8>=_0x1ad051){_0x4582f8=_0x1ad051;_0x976440=0xc8;}else{_0x976440=0xce;}_0x9813c0[_0x047a('0x24')](_0x976440);return _0x9813c0['set'](_0x047a('0x27'),_0x60c4b2+'-'+_0x4582f8+'/'+_0x1ad051)['json'](_0x24aeb6);}return null;};}function patchUpdates(_0xfcdbe8){return function(_0x4d6e58){try{jsonpatch[_0x047a('0x28')](_0x4d6e58,_0xfcdbe8,!![]);}catch(_0x5c38c9){return BPromise['reject'](_0x5c38c9);}return _0x4d6e58['save']();};}function saveUpdates(_0x3f6711,_0x21663c){return function(_0x40d603){if(_0x40d603){return _0x40d603['update'](_0x3f6711)['then'](function(_0x5e26cb){return _0x5e26cb;});}return null;};}function removeEntity(_0x501e89,_0x5b7436){return function(_0x2752d4){if(_0x2752d4){return _0x2752d4[_0x047a('0x29')]()[_0x047a('0x18')](function(){_0x501e89[_0x047a('0x24')](0xcc)[_0x047a('0x2a')]();});}};}function handleEntityNotFound(_0x38d634,_0x59689c){return function(_0x2f6640){if(!_0x2f6640){_0x38d634[_0x047a('0x23')](0x194);}return _0x2f6640;};}function handleError(_0x208286,_0x296551){_0x296551=_0x296551||0x1f4;return function(_0x37eadd){logger['error'](_0x37eadd[_0x047a('0x2b')]);if(_0x37eadd[_0x047a('0x2c')]){delete _0x37eadd[_0x047a('0x2c')];}_0x208286[_0x047a('0x24')](_0x296551)[_0x047a('0x2d')](_0x37eadd);};}exports['index']=function(_0x14e855,_0x347851){var _0x101467={},_0x2fd32c={},_0x102d4b={'count':0x0,'rows':[]};var _0x50d4a4=db[_0x047a('0x2e')]['rawAttributes'];_0x2fd32c[_0x047a('0x2f')]=_[_0x047a('0x30')](_0x50d4a4);_0x2fd32c[_0x047a('0x31')]=_[_0x047a('0x30')](_0x14e855[_0x047a('0x31')]);_0x2fd32c[_0x047a('0x32')]=_['intersection'](_0x2fd32c[_0x047a('0x2f')],_0x2fd32c[_0x047a('0x31')]);_0x101467[_0x047a('0x33')]=_[_0x047a('0x34')](_0x2fd32c[_0x047a('0x2f')],qs[_0x047a('0x35')](_0x14e855[_0x047a('0x31')][_0x047a('0x35')]));_0x101467['attributes']=_0x101467[_0x047a('0x33')][_0x047a('0x36')]?_0x101467['attributes']:_0x2fd32c[_0x047a('0x2f')];if(!_0x14e855['query'][_0x047a('0x37')](_0x047a('0x38'))){_0x101467[_0x047a('0x26')]=qs['limit'](_0x14e855[_0x047a('0x31')][_0x047a('0x26')]);_0x101467[_0x047a('0x25')]=qs[_0x047a('0x25')](_0x14e855['query'][_0x047a('0x25')]);}_0x101467[_0x047a('0x39')]=qs['sort'](_0x14e855['query'][_0x047a('0x3a')]);_0x101467[_0x047a('0x3b')]=qs[_0x047a('0x32')](_[_0x047a('0x3c')](_0x14e855[_0x047a('0x31')],_0x2fd32c[_0x047a('0x32')]));if(_0x14e855[_0x047a('0x31')]['filter']){_0x101467[_0x047a('0x3b')]=_['merge'](_0x101467['where'],{'$or':_[_0x047a('0x3d')](_0x50d4a4,function(_0x243656){if(_0x243656[_0x047a('0x3e')]['key']!==_0x047a('0x3f')){var _0x1909eb={};_0x1909eb[_0x243656[_0x047a('0x40')]]={'$like':'%'+_0x14e855[_0x047a('0x31')][_0x047a('0x41')]+'%'};return _0x1909eb;}})});}_0x101467=_[_0x047a('0x42')]({},_0x101467,_0x14e855[_0x047a('0x43')]);var _0x383ffe={'where':_0x101467['where']};return db['Dynamics365Configuration'][_0x047a('0x44')](_0x383ffe)[_0x047a('0x18')](function(_0x2b8fc3){_0x102d4b[_0x047a('0x44')]=_0x2b8fc3;if(_0x14e855[_0x047a('0x31')][_0x047a('0x45')]){_0x101467[_0x047a('0x46')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x047a('0x47')](_0x101467);})['then'](function(_0x4337fb){_0x102d4b[_0x047a('0x48')]=_0x4337fb;return _0x102d4b;})[_0x047a('0x18')](respondWithFilteredResult(_0x347851,_0x101467))['catch'](handleError(_0x347851,null));};exports[_0x047a('0x49')]=function(_0x33be3c,_0x42a839){var _0x550f9b={'raw':![],'where':{'id':_0x33be3c[_0x047a('0x4a')]['id']}},_0x143ddb={};_0x143ddb[_0x047a('0x2f')]=_[_0x047a('0x30')](db[_0x047a('0x2e')][_0x047a('0x4b')]);_0x143ddb['query']=_[_0x047a('0x30')](_0x33be3c[_0x047a('0x31')]);_0x143ddb[_0x047a('0x32')]=_['intersection'](_0x143ddb[_0x047a('0x2f')],_0x143ddb[_0x047a('0x31')]);_0x550f9b[_0x047a('0x33')]=_[_0x047a('0x34')](_0x143ddb[_0x047a('0x2f')],qs['fields'](_0x33be3c[_0x047a('0x31')]['fields']));_0x550f9b[_0x047a('0x33')]=_0x550f9b[_0x047a('0x33')][_0x047a('0x36')]?_0x550f9b[_0x047a('0x33')]:_0x143ddb[_0x047a('0x2f')];if(_0x33be3c['query'][_0x047a('0x45')]){_0x550f9b[_0x047a('0x46')]=[{'all':!![]}];}_0x550f9b=_[_0x047a('0x42')]({},_0x550f9b,_0x33be3c['options']);return db[_0x047a('0x2e')][_0x047a('0x4c')](_0x550f9b)[_0x047a('0x18')](handleEntityNotFound(_0x42a839,null))[_0x047a('0x18')](respondWithResult(_0x42a839,null))['catch'](handleError(_0x42a839,null));};exports[_0x047a('0x4d')]=function(_0x33edf2,_0x392bbc){return db['Dynamics365Configuration'][_0x047a('0x4d')](_0x33edf2[_0x047a('0x4e')],{})['then'](respondWithResult(_0x392bbc,0xc9))[_0x047a('0x4f')](handleError(_0x392bbc,null));};exports['update']=function(_0x5726ff,_0x4deff4){if(_0x5726ff[_0x047a('0x4e')]['id']){delete _0x5726ff[_0x047a('0x4e')]['id'];}return db[_0x047a('0x2e')][_0x047a('0x4c')]({'where':{'id':_0x5726ff[_0x047a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4deff4,null))[_0x047a('0x18')](saveUpdates(_0x5726ff[_0x047a('0x4e')],null))['then'](respondWithResult(_0x4deff4,null))[_0x047a('0x4f')](handleError(_0x4deff4,null));};exports[_0x047a('0x29')]=function(_0x403d8b,_0x5ecb2b){return db['Dynamics365Configuration']['find']({'where':{'id':_0x403d8b['params']['id']}})[_0x047a('0x18')](handleEntityNotFound(_0x5ecb2b,null))['then'](removeEntity(_0x5ecb2b,null))['catch'](handleError(_0x5ecb2b,null));};exports[_0x047a('0x50')]=function(_0x4b9607,_0x2ac801,_0x19e7f8){var _0x2156ab={};var _0x97c56d={};var _0x41f3e0;var _0x50b10b;return db[_0x047a('0x2e')][_0x047a('0x51')]({'where':{'id':_0x4b9607['params']['id']}})['then'](handleEntityNotFound(_0x2ac801,null))['then'](function(_0x52f9a2){if(_0x52f9a2){_0x41f3e0=_0x52f9a2;_0x97c56d['model']=_['keys'](db[_0x047a('0x52')][_0x047a('0x4b')]);_0x97c56d[_0x047a('0x31')]=_['keys'](_0x4b9607[_0x047a('0x31')]);_0x97c56d[_0x047a('0x32')]=_['intersection'](_0x97c56d[_0x047a('0x2f')],_0x97c56d[_0x047a('0x31')]);_0x2156ab[_0x047a('0x33')]=_[_0x047a('0x34')](_0x97c56d['model'],qs[_0x047a('0x35')](_0x4b9607[_0x047a('0x31')][_0x047a('0x35')]));_0x2156ab[_0x047a('0x33')]=_0x2156ab[_0x047a('0x33')][_0x047a('0x36')]?_0x2156ab[_0x047a('0x33')]:_0x97c56d[_0x047a('0x2f')];_0x2156ab['order']=qs[_0x047a('0x3a')](_0x4b9607[_0x047a('0x31')]['sort']);_0x2156ab[_0x047a('0x3b')]=qs[_0x047a('0x32')](_[_0x047a('0x3c')](_0x4b9607[_0x047a('0x31')],_0x97c56d['filters']));if(_0x4b9607[_0x047a('0x31')][_0x047a('0x41')]){_0x2156ab[_0x047a('0x3b')]=_[_0x047a('0x42')](_0x2156ab[_0x047a('0x3b')],{'$or':_['map'](_0x2156ab['attributes'],function(_0x5a7562){var _0x3992bb={};_0x3992bb[_0x5a7562]={'$like':'%'+_0x4b9607[_0x047a('0x31')][_0x047a('0x41')]+'%'};return _0x3992bb;})});}_0x2156ab=_[_0x047a('0x42')]({},_0x2156ab,_0x4b9607[_0x047a('0x43')]);return _0x41f3e0[_0x047a('0x50')](_0x2156ab);}})[_0x047a('0x18')](function(_0x34afe3){if(_0x34afe3){_0x50b10b=_0x34afe3[_0x047a('0x36')];if(!_0x4b9607[_0x047a('0x31')][_0x047a('0x37')](_0x047a('0x38'))){_0x2156ab[_0x047a('0x26')]=qs[_0x047a('0x26')](_0x4b9607['query'][_0x047a('0x26')]);_0x2156ab[_0x047a('0x25')]=qs[_0x047a('0x25')](_0x4b9607[_0x047a('0x31')][_0x047a('0x25')]);}return _0x41f3e0['getFields'](_0x2156ab);}})['then'](function(_0x5301ac){if(_0x5301ac){return _0x5301ac?{'count':_0x50b10b,'rows':_0x5301ac}:null;}})[_0x047a('0x18')](respondWithResult(_0x2ac801,null))[_0x047a('0x4f')](handleError(_0x2ac801,null));};exports[_0x047a('0x53')]=function(_0xca42d6,_0x12ea29,_0x5ab2cd){var _0x2fb5e7={};var _0xb9a2e9={};var _0x2f530e;var _0x503da2;return db['Dynamics365Configuration'][_0x047a('0x51')]({'where':{'id':_0xca42d6[_0x047a('0x4a')]['id']}})[_0x047a('0x18')](handleEntityNotFound(_0x12ea29,null))[_0x047a('0x18')](function(_0x4186b0){if(_0x4186b0){_0x2f530e=_0x4186b0;_0xb9a2e9[_0x047a('0x2f')]=_['keys'](db['Dynamics365Field'][_0x047a('0x4b')]);_0xb9a2e9[_0x047a('0x31')]=_[_0x047a('0x30')](_0xca42d6[_0x047a('0x31')]);_0xb9a2e9[_0x047a('0x32')]=_[_0x047a('0x34')](_0xb9a2e9['model'],_0xb9a2e9['query']);_0x2fb5e7[_0x047a('0x33')]=_[_0x047a('0x34')](_0xb9a2e9['model'],qs[_0x047a('0x35')](_0xca42d6[_0x047a('0x31')][_0x047a('0x35')]));_0x2fb5e7[_0x047a('0x33')]=_0x2fb5e7[_0x047a('0x33')][_0x047a('0x36')]?_0x2fb5e7[_0x047a('0x33')]:_0xb9a2e9[_0x047a('0x2f')];_0x2fb5e7[_0x047a('0x39')]=qs[_0x047a('0x3a')](_0xca42d6[_0x047a('0x31')][_0x047a('0x3a')]);_0x2fb5e7[_0x047a('0x3b')]=qs[_0x047a('0x32')](_[_0x047a('0x3c')](_0xca42d6[_0x047a('0x31')],_0xb9a2e9['filters']));if(_0xca42d6[_0x047a('0x31')][_0x047a('0x41')]){_0x2fb5e7[_0x047a('0x3b')]=_[_0x047a('0x42')](_0x2fb5e7[_0x047a('0x3b')],{'$or':_[_0x047a('0x3d')](_0x2fb5e7[_0x047a('0x33')],function(_0x465fd0){var _0x25fea8={};_0x25fea8[_0x465fd0]={'$like':'%'+_0xca42d6[_0x047a('0x31')][_0x047a('0x41')]+'%'};return _0x25fea8;})});}_0x2fb5e7=_[_0x047a('0x42')]({},_0x2fb5e7,_0xca42d6['options']);return _0x2f530e[_0x047a('0x53')](_0x2fb5e7);}})['then'](function(_0x43a190){if(_0x43a190){_0x503da2=_0x43a190[_0x047a('0x36')];if(!_0xca42d6[_0x047a('0x31')][_0x047a('0x37')](_0x047a('0x38'))){_0x2fb5e7['limit']=qs[_0x047a('0x26')](_0xca42d6[_0x047a('0x31')][_0x047a('0x26')]);_0x2fb5e7[_0x047a('0x25')]=qs['offset'](_0xca42d6['query'][_0x047a('0x25')]);}return _0x2f530e[_0x047a('0x53')](_0x2fb5e7);}})[_0x047a('0x18')](function(_0x1b60d2){if(_0x1b60d2){return _0x1b60d2?{'count':_0x503da2,'rows':_0x1b60d2}:null;}})['then'](respondWithResult(_0x12ea29,null))[_0x047a('0x4f')](handleError(_0x12ea29,null));};exports[_0x047a('0x54')]=function(_0x1552a2,_0x588717,_0x29c575){var _0x9110be={};var _0x3cbc20={};var _0x2196a3;var _0x120d01;return db[_0x047a('0x2e')]['findOne']({'where':{'id':_0x1552a2[_0x047a('0x4a')]['id']}})[_0x047a('0x18')](handleEntityNotFound(_0x588717,null))[_0x047a('0x18')](function(_0x46909e){if(_0x46909e){_0x2196a3=_0x46909e;_0x3cbc20[_0x047a('0x2f')]=_[_0x047a('0x30')](db[_0x047a('0x52')][_0x047a('0x4b')]);_0x3cbc20[_0x047a('0x31')]=_[_0x047a('0x30')](_0x1552a2['query']);_0x3cbc20['filters']=_['intersection'](_0x3cbc20[_0x047a('0x2f')],_0x3cbc20[_0x047a('0x31')]);_0x9110be[_0x047a('0x33')]=_[_0x047a('0x34')](_0x3cbc20[_0x047a('0x2f')],qs[_0x047a('0x35')](_0x1552a2[_0x047a('0x31')]['fields']));_0x9110be[_0x047a('0x33')]=_0x9110be[_0x047a('0x33')][_0x047a('0x36')]?_0x9110be[_0x047a('0x33')]:_0x3cbc20[_0x047a('0x2f')];_0x9110be[_0x047a('0x39')]=qs['sort'](_0x1552a2[_0x047a('0x31')][_0x047a('0x3a')]);_0x9110be[_0x047a('0x3b')]=qs[_0x047a('0x32')](_[_0x047a('0x3c')](_0x1552a2[_0x047a('0x31')],_0x3cbc20['filters']));if(_0x1552a2[_0x047a('0x31')]['filter']){_0x9110be[_0x047a('0x3b')]=_['merge'](_0x9110be['where'],{'$or':_[_0x047a('0x3d')](_0x9110be[_0x047a('0x33')],function(_0x4f1b2d){var _0x3cc861={};_0x3cc861[_0x4f1b2d]={'$like':'%'+_0x1552a2[_0x047a('0x31')][_0x047a('0x41')]+'%'};return _0x3cc861;})});}_0x9110be=_[_0x047a('0x42')]({},_0x9110be,_0x1552a2['options']);return _0x2196a3[_0x047a('0x54')](_0x9110be);}})[_0x047a('0x18')](function(_0x3f705b){if(_0x3f705b){_0x120d01=_0x3f705b[_0x047a('0x36')];if(!_0x1552a2[_0x047a('0x31')][_0x047a('0x37')]('nolimit')){_0x9110be[_0x047a('0x26')]=qs[_0x047a('0x26')](_0x1552a2[_0x047a('0x31')][_0x047a('0x26')]);_0x9110be['offset']=qs[_0x047a('0x25')](_0x1552a2[_0x047a('0x31')][_0x047a('0x25')]);}return _0x2196a3[_0x047a('0x54')](_0x9110be);}})['then'](function(_0x2ad613){if(_0x2ad613){return _0x2ad613?{'count':_0x120d01,'rows':_0x2ad613}:null;}})[_0x047a('0x18')](respondWithResult(_0x588717,null))[_0x047a('0x4f')](handleError(_0x588717,null));}; \ No newline at end of file +var _0xdd52=['sort','pick','filter','where','map','key','VIRTUAL','field','merge','options','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','nolimit','getDescriptions','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','destroy','name','send','index','Dynamics365Configuration','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order'];(function(_0x464238,_0x428cb8){var _0xa6fdac=function(_0x457b55){while(--_0x457b55){_0x464238['push'](_0x464238['shift']());}};_0xa6fdac(++_0x428cb8);}(_0xdd52,0x11e));var _0x2dd5=function(_0x89ed5,_0x3a5f37){_0x89ed5=_0x89ed5-0x0;var _0xda35ac=_0xdd52[_0x89ed5];return _0xda35ac;};'use strict';var pdf=require(_0x2dd5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2dd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dd5('0x2'));var rp=require(_0x2dd5('0x3'));var moment=require('moment');var BPromise=require(_0x2dd5('0x4'));var Mustache=require('mustache');var util=require(_0x2dd5('0x5'));var path=require(_0x2dd5('0x6'));var sox=require(_0x2dd5('0x7'));var csv=require(_0x2dd5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2dd5('0x9'));var jsforce=require(_0x2dd5('0xa'));var deskjs=require(_0x2dd5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2dd5('0xc'));var Papa=require(_0x2dd5('0xd'));var Redis=require('ioredis');var authService=require(_0x2dd5('0xe'));var qs=require(_0x2dd5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2dd5('0x10'));var config=require(_0x2dd5('0x11'));var db=require(_0x2dd5('0x12'))['db'];var jayson=require(_0x2dd5('0x13'));var client=jayson[_0x2dd5('0x14')][_0x2dd5('0x15')]({'port':0x232a});function checkPasswordPattern(_0x298c34,_0x2811d7,_0x309e39){if(_0x309e39){var _0x1d8388=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d8388[_0x2dd5('0x16')](_0x2811d7)){return _0x298c34;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x298c34;}}function respondWithRpcPromise(_0x2359f5,_0x4d761e,_0x35c565,_0x326df2){return new BPromise(function(_0x3fc691,_0x51d394){var _0x4fad09=_0x326df2||client;return _0x4fad09[_0x2dd5('0x17')](_0x2359f5,_0x35c565)[_0x2dd5('0x18')](function(_0x41dc67){logger[_0x2dd5('0x19')](_0x2dd5('0x1a'),_0x4d761e,_0x2dd5('0x1b'));logger[_0x2dd5('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4d761e,_0x2dd5('0x1b'),JSON[_0x2dd5('0x1d')](_0x41dc67));if(_0x41dc67[_0x2dd5('0x1e')]){if(_0x41dc67[_0x2dd5('0x1e')][_0x2dd5('0x1f')]===0x1f4){logger[_0x2dd5('0x1e')](_0x2dd5('0x1a'),_0x4d761e,_0x41dc67[_0x2dd5('0x1e')][_0x2dd5('0x20')]);return _0x51d394(_0x41dc67[_0x2dd5('0x1e')][_0x2dd5('0x20')]);}logger[_0x2dd5('0x1e')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4d761e,_0x41dc67[_0x2dd5('0x1e')][_0x2dd5('0x20')]);return _0x3fc691(_0x41dc67[_0x2dd5('0x1e')][_0x2dd5('0x20')]);}else{logger[_0x2dd5('0x19')](_0x2dd5('0x1a'),_0x4d761e,'request\x20sent');_0x3fc691(_0x41dc67[_0x2dd5('0x21')][_0x2dd5('0x20')]);}})[_0x2dd5('0x22')](function(_0x568c8a){logger[_0x2dd5('0x1e')](_0x2dd5('0x1a'),_0x4d761e,_0x568c8a);_0x51d394(_0x568c8a);});});}function respondWithStatusCode(_0x5b6347,_0x2c1183){_0x2c1183=_0x2c1183||0xcc;return function(_0x550628){if(_0x550628){return _0x5b6347[_0x2dd5('0x23')](_0x2c1183);}return _0x5b6347[_0x2dd5('0x24')](_0x2c1183)[_0x2dd5('0x25')]();};}function respondWithResult(_0xa95ca4,_0x369d11){_0x369d11=_0x369d11||0xc8;return function(_0x60c075){if(_0x60c075){return _0xa95ca4['status'](_0x369d11)['json'](_0x60c075);}};}function respondWithFilteredResult(_0xaa0ee1,_0x4c41f3){return function(_0x53a588){if(_0x53a588){var _0x35689f=_0x53a588[_0x2dd5('0x26')],_0xfad815=_0x4c41f3['offset'],_0x3c57d7=_0x4c41f3[_0x2dd5('0x27')]+_0x4c41f3['limit'],_0x4d9a14;if(_0x3c57d7>=_0x35689f){_0x3c57d7=_0x35689f;_0x4d9a14=0xc8;}else{_0x4d9a14=0xce;}_0xaa0ee1[_0x2dd5('0x24')](_0x4d9a14);return _0xaa0ee1[_0x2dd5('0x28')](_0x2dd5('0x29'),_0xfad815+'-'+_0x3c57d7+'/'+_0x35689f)[_0x2dd5('0x2a')](_0x53a588);}return null;};}function patchUpdates(_0x3c9682){return function(_0x581fee){try{jsonpatch['apply'](_0x581fee,_0x3c9682,!![]);}catch(_0x3cb0ef){return BPromise[_0x2dd5('0x2b')](_0x3cb0ef);}return _0x581fee[_0x2dd5('0x2c')]();};}function saveUpdates(_0x1bac48,_0x5ea5de){return function(_0x21649f){if(_0x21649f){return _0x21649f[_0x2dd5('0x2d')](_0x1bac48)[_0x2dd5('0x18')](function(_0x3ce23a){return _0x3ce23a;});}return null;};}function removeEntity(_0x194ffc,_0x3f1b5e){return function(_0x5abd3c){if(_0x5abd3c){return _0x5abd3c[_0x2dd5('0x2e')]()['then'](function(){_0x194ffc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dee5,_0x56e606){return function(_0x2180f5){if(!_0x2180f5){_0x32dee5[_0x2dd5('0x23')](0x194);}return _0x2180f5;};}function handleError(_0x5e0a0e,_0x2927ed){_0x2927ed=_0x2927ed||0x1f4;return function(_0x59387c){logger[_0x2dd5('0x1e')](_0x59387c['stack']);if(_0x59387c[_0x2dd5('0x2f')]){delete _0x59387c[_0x2dd5('0x2f')];}_0x5e0a0e[_0x2dd5('0x24')](_0x2927ed)[_0x2dd5('0x30')](_0x59387c);};}exports[_0x2dd5('0x31')]=function(_0x3cafb6,_0xbbd0ee){var _0x689641={},_0x30c595={},_0x404b50={'count':0x0,'rows':[]};var _0x293d74=db[_0x2dd5('0x32')]['rawAttributes'];_0x30c595[_0x2dd5('0x33')]=_[_0x2dd5('0x34')](_0x293d74);_0x30c595[_0x2dd5('0x35')]=_[_0x2dd5('0x34')](_0x3cafb6[_0x2dd5('0x35')]);_0x30c595[_0x2dd5('0x36')]=_[_0x2dd5('0x37')](_0x30c595[_0x2dd5('0x33')],_0x30c595[_0x2dd5('0x35')]);_0x689641['attributes']=_[_0x2dd5('0x37')](_0x30c595[_0x2dd5('0x33')],qs[_0x2dd5('0x38')](_0x3cafb6[_0x2dd5('0x35')][_0x2dd5('0x38')]));_0x689641[_0x2dd5('0x39')]=_0x689641[_0x2dd5('0x39')][_0x2dd5('0x3a')]?_0x689641['attributes']:_0x30c595['model'];if(!_0x3cafb6[_0x2dd5('0x35')][_0x2dd5('0x3b')]('nolimit')){_0x689641[_0x2dd5('0x3c')]=qs['limit'](_0x3cafb6[_0x2dd5('0x35')][_0x2dd5('0x3c')]);_0x689641[_0x2dd5('0x27')]=qs[_0x2dd5('0x27')](_0x3cafb6[_0x2dd5('0x35')][_0x2dd5('0x27')]);}_0x689641[_0x2dd5('0x3d')]=qs[_0x2dd5('0x3e')](_0x3cafb6[_0x2dd5('0x35')][_0x2dd5('0x3e')]);_0x689641['where']=qs[_0x2dd5('0x36')](_[_0x2dd5('0x3f')](_0x3cafb6['query'],_0x30c595[_0x2dd5('0x36')]));if(_0x3cafb6['query'][_0x2dd5('0x40')]){_0x689641['where']=_['merge'](_0x689641[_0x2dd5('0x41')],{'$or':_[_0x2dd5('0x42')](_0x293d74,function(_0x47544b){if(_0x47544b['type'][_0x2dd5('0x43')]!==_0x2dd5('0x44')){var _0x275f81={};_0x275f81[_0x47544b[_0x2dd5('0x45')]]={'$like':'%'+_0x3cafb6['query'][_0x2dd5('0x40')]+'%'};return _0x275f81;}})});}_0x689641=_[_0x2dd5('0x46')]({},_0x689641,_0x3cafb6[_0x2dd5('0x47')]);var _0x4912cb={'where':_0x689641['where']};return db[_0x2dd5('0x32')]['count'](_0x4912cb)[_0x2dd5('0x18')](function(_0x54f32a){_0x404b50[_0x2dd5('0x26')]=_0x54f32a;if(_0x3cafb6[_0x2dd5('0x35')]['includeAll']){_0x689641[_0x2dd5('0x48')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x2dd5('0x49')](_0x689641);})['then'](function(_0x24692d){_0x404b50[_0x2dd5('0x4a')]=_0x24692d;return _0x404b50;})[_0x2dd5('0x18')](respondWithFilteredResult(_0xbbd0ee,_0x689641))['catch'](handleError(_0xbbd0ee,null));};exports[_0x2dd5('0x4b')]=function(_0x477194,_0x153d34){var _0x38b1ef={'raw':![],'where':{'id':_0x477194[_0x2dd5('0x4c')]['id']}},_0x6f3d03={};_0x6f3d03[_0x2dd5('0x33')]=_['keys'](db[_0x2dd5('0x32')][_0x2dd5('0x4d')]);_0x6f3d03['query']=_['keys'](_0x477194[_0x2dd5('0x35')]);_0x6f3d03['filters']=_['intersection'](_0x6f3d03['model'],_0x6f3d03[_0x2dd5('0x35')]);_0x38b1ef[_0x2dd5('0x39')]=_[_0x2dd5('0x37')](_0x6f3d03[_0x2dd5('0x33')],qs['fields'](_0x477194[_0x2dd5('0x35')]['fields']));_0x38b1ef[_0x2dd5('0x39')]=_0x38b1ef['attributes'][_0x2dd5('0x3a')]?_0x38b1ef[_0x2dd5('0x39')]:_0x6f3d03[_0x2dd5('0x33')];if(_0x477194[_0x2dd5('0x35')]['includeAll']){_0x38b1ef['include']=[{'all':!![]}];}_0x38b1ef=_[_0x2dd5('0x46')]({},_0x38b1ef,_0x477194['options']);return db[_0x2dd5('0x32')][_0x2dd5('0x4e')](_0x38b1ef)[_0x2dd5('0x18')](handleEntityNotFound(_0x153d34,null))[_0x2dd5('0x18')](respondWithResult(_0x153d34,null))[_0x2dd5('0x22')](handleError(_0x153d34,null));};exports[_0x2dd5('0x4f')]=function(_0x41dbad,_0x8cc684){return db[_0x2dd5('0x32')][_0x2dd5('0x4f')](_0x41dbad[_0x2dd5('0x50')],{})[_0x2dd5('0x18')](respondWithResult(_0x8cc684,0xc9))['catch'](handleError(_0x8cc684,null));};exports[_0x2dd5('0x2d')]=function(_0x2f5160,_0x354e55){if(_0x2f5160[_0x2dd5('0x50')]['id']){delete _0x2f5160['body']['id'];}return db[_0x2dd5('0x32')][_0x2dd5('0x4e')]({'where':{'id':_0x2f5160['params']['id']}})[_0x2dd5('0x18')](handleEntityNotFound(_0x354e55,null))[_0x2dd5('0x18')](saveUpdates(_0x2f5160[_0x2dd5('0x50')],null))[_0x2dd5('0x18')](respondWithResult(_0x354e55,null))[_0x2dd5('0x22')](handleError(_0x354e55,null));};exports[_0x2dd5('0x2e')]=function(_0x3f3bc6,_0x57e0ce){return db['Dynamics365Configuration'][_0x2dd5('0x4e')]({'where':{'id':_0x3f3bc6['params']['id']}})[_0x2dd5('0x18')](handleEntityNotFound(_0x57e0ce,null))['then'](removeEntity(_0x57e0ce,null))[_0x2dd5('0x22')](handleError(_0x57e0ce,null));};exports[_0x2dd5('0x51')]=function(_0x20adb3,_0x10d67b,_0x1ebcab){var _0xad2d2f={};var _0x2412f8={};var _0x3e5942;var _0x37275d;return db['Dynamics365Configuration'][_0x2dd5('0x52')]({'where':{'id':_0x20adb3[_0x2dd5('0x4c')]['id']}})[_0x2dd5('0x18')](handleEntityNotFound(_0x10d67b,null))[_0x2dd5('0x18')](function(_0x2cf405){if(_0x2cf405){_0x3e5942=_0x2cf405;_0x2412f8[_0x2dd5('0x33')]=_[_0x2dd5('0x34')](db[_0x2dd5('0x53')][_0x2dd5('0x4d')]);_0x2412f8['query']=_['keys'](_0x20adb3[_0x2dd5('0x35')]);_0x2412f8[_0x2dd5('0x36')]=_['intersection'](_0x2412f8[_0x2dd5('0x33')],_0x2412f8['query']);_0xad2d2f[_0x2dd5('0x39')]=_[_0x2dd5('0x37')](_0x2412f8['model'],qs[_0x2dd5('0x38')](_0x20adb3[_0x2dd5('0x35')]['fields']));_0xad2d2f[_0x2dd5('0x39')]=_0xad2d2f[_0x2dd5('0x39')][_0x2dd5('0x3a')]?_0xad2d2f[_0x2dd5('0x39')]:_0x2412f8[_0x2dd5('0x33')];_0xad2d2f['order']=qs[_0x2dd5('0x3e')](_0x20adb3[_0x2dd5('0x35')][_0x2dd5('0x3e')]);_0xad2d2f[_0x2dd5('0x41')]=qs[_0x2dd5('0x36')](_[_0x2dd5('0x3f')](_0x20adb3[_0x2dd5('0x35')],_0x2412f8[_0x2dd5('0x36')]));if(_0x20adb3[_0x2dd5('0x35')]['filter']){_0xad2d2f[_0x2dd5('0x41')]=_[_0x2dd5('0x46')](_0xad2d2f['where'],{'$or':_[_0x2dd5('0x42')](_0xad2d2f[_0x2dd5('0x39')],function(_0x193486){var _0x36bd8a={};_0x36bd8a[_0x193486]={'$like':'%'+_0x20adb3[_0x2dd5('0x35')][_0x2dd5('0x40')]+'%'};return _0x36bd8a;})});}_0xad2d2f=_[_0x2dd5('0x46')]({},_0xad2d2f,_0x20adb3[_0x2dd5('0x47')]);return _0x3e5942[_0x2dd5('0x51')](_0xad2d2f);}})[_0x2dd5('0x18')](function(_0x3aae10){if(_0x3aae10){_0x37275d=_0x3aae10[_0x2dd5('0x3a')];if(!_0x20adb3[_0x2dd5('0x35')][_0x2dd5('0x3b')]('nolimit')){_0xad2d2f[_0x2dd5('0x3c')]=qs[_0x2dd5('0x3c')](_0x20adb3[_0x2dd5('0x35')][_0x2dd5('0x3c')]);_0xad2d2f['offset']=qs[_0x2dd5('0x27')](_0x20adb3[_0x2dd5('0x35')][_0x2dd5('0x27')]);}return _0x3e5942[_0x2dd5('0x51')](_0xad2d2f);}})[_0x2dd5('0x18')](function(_0x146735){if(_0x146735){return _0x146735?{'count':_0x37275d,'rows':_0x146735}:null;}})[_0x2dd5('0x18')](respondWithResult(_0x10d67b,null))['catch'](handleError(_0x10d67b,null));};exports[_0x2dd5('0x54')]=function(_0x2f3c72,_0x2b2508,_0x184aca){var _0x5217dc={};var _0x34eee8={};var _0x48c015;var _0x3feb67;return db[_0x2dd5('0x32')][_0x2dd5('0x52')]({'where':{'id':_0x2f3c72['params']['id']}})[_0x2dd5('0x18')](handleEntityNotFound(_0x2b2508,null))[_0x2dd5('0x18')](function(_0x3bcd11){if(_0x3bcd11){_0x48c015=_0x3bcd11;_0x34eee8['model']=_[_0x2dd5('0x34')](db[_0x2dd5('0x53')][_0x2dd5('0x4d')]);_0x34eee8['query']=_[_0x2dd5('0x34')](_0x2f3c72[_0x2dd5('0x35')]);_0x34eee8[_0x2dd5('0x36')]=_[_0x2dd5('0x37')](_0x34eee8['model'],_0x34eee8[_0x2dd5('0x35')]);_0x5217dc[_0x2dd5('0x39')]=_[_0x2dd5('0x37')](_0x34eee8[_0x2dd5('0x33')],qs['fields'](_0x2f3c72[_0x2dd5('0x35')][_0x2dd5('0x38')]));_0x5217dc[_0x2dd5('0x39')]=_0x5217dc[_0x2dd5('0x39')][_0x2dd5('0x3a')]?_0x5217dc[_0x2dd5('0x39')]:_0x34eee8[_0x2dd5('0x33')];_0x5217dc[_0x2dd5('0x3d')]=qs[_0x2dd5('0x3e')](_0x2f3c72[_0x2dd5('0x35')]['sort']);_0x5217dc['where']=qs['filters'](_[_0x2dd5('0x3f')](_0x2f3c72[_0x2dd5('0x35')],_0x34eee8['filters']));if(_0x2f3c72[_0x2dd5('0x35')][_0x2dd5('0x40')]){_0x5217dc[_0x2dd5('0x41')]=_[_0x2dd5('0x46')](_0x5217dc['where'],{'$or':_['map'](_0x5217dc['attributes'],function(_0x2869f5){var _0x332104={};_0x332104[_0x2869f5]={'$like':'%'+_0x2f3c72['query'][_0x2dd5('0x40')]+'%'};return _0x332104;})});}_0x5217dc=_['merge']({},_0x5217dc,_0x2f3c72[_0x2dd5('0x47')]);return _0x48c015[_0x2dd5('0x54')](_0x5217dc);}})['then'](function(_0x309a61){if(_0x309a61){_0x3feb67=_0x309a61['length'];if(!_0x2f3c72[_0x2dd5('0x35')][_0x2dd5('0x3b')](_0x2dd5('0x55'))){_0x5217dc['limit']=qs[_0x2dd5('0x3c')](_0x2f3c72[_0x2dd5('0x35')]['limit']);_0x5217dc[_0x2dd5('0x27')]=qs[_0x2dd5('0x27')](_0x2f3c72[_0x2dd5('0x35')][_0x2dd5('0x27')]);}return _0x48c015[_0x2dd5('0x54')](_0x5217dc);}})[_0x2dd5('0x18')](function(_0x1333a4){if(_0x1333a4){return _0x1333a4?{'count':_0x3feb67,'rows':_0x1333a4}:null;}})[_0x2dd5('0x18')](respondWithResult(_0x2b2508,null))['catch'](handleError(_0x2b2508,null));};exports[_0x2dd5('0x56')]=function(_0x47bdbf,_0x589944,_0x5681ee){var _0x16c684={};var _0x20d349={};var _0x1832c8;var _0x4f7271;return db['Dynamics365Configuration'][_0x2dd5('0x52')]({'where':{'id':_0x47bdbf['params']['id']}})[_0x2dd5('0x18')](handleEntityNotFound(_0x589944,null))[_0x2dd5('0x18')](function(_0x457de8){if(_0x457de8){_0x1832c8=_0x457de8;_0x20d349['model']=_['keys'](db[_0x2dd5('0x53')][_0x2dd5('0x4d')]);_0x20d349[_0x2dd5('0x35')]=_[_0x2dd5('0x34')](_0x47bdbf['query']);_0x20d349[_0x2dd5('0x36')]=_[_0x2dd5('0x37')](_0x20d349[_0x2dd5('0x33')],_0x20d349[_0x2dd5('0x35')]);_0x16c684['attributes']=_[_0x2dd5('0x37')](_0x20d349[_0x2dd5('0x33')],qs[_0x2dd5('0x38')](_0x47bdbf[_0x2dd5('0x35')][_0x2dd5('0x38')]));_0x16c684[_0x2dd5('0x39')]=_0x16c684[_0x2dd5('0x39')]['length']?_0x16c684[_0x2dd5('0x39')]:_0x20d349[_0x2dd5('0x33')];_0x16c684['order']=qs[_0x2dd5('0x3e')](_0x47bdbf[_0x2dd5('0x35')][_0x2dd5('0x3e')]);_0x16c684[_0x2dd5('0x41')]=qs[_0x2dd5('0x36')](_[_0x2dd5('0x3f')](_0x47bdbf[_0x2dd5('0x35')],_0x20d349[_0x2dd5('0x36')]));if(_0x47bdbf[_0x2dd5('0x35')][_0x2dd5('0x40')]){_0x16c684[_0x2dd5('0x41')]=_['merge'](_0x16c684[_0x2dd5('0x41')],{'$or':_['map'](_0x16c684[_0x2dd5('0x39')],function(_0x564535){var _0x21954b={};_0x21954b[_0x564535]={'$like':'%'+_0x47bdbf['query'][_0x2dd5('0x40')]+'%'};return _0x21954b;})});}_0x16c684=_[_0x2dd5('0x46')]({},_0x16c684,_0x47bdbf[_0x2dd5('0x47')]);return _0x1832c8['getDescriptions'](_0x16c684);}})[_0x2dd5('0x18')](function(_0x3add34){if(_0x3add34){_0x4f7271=_0x3add34['length'];if(!_0x47bdbf['query']['hasOwnProperty'](_0x2dd5('0x55'))){_0x16c684[_0x2dd5('0x3c')]=qs['limit'](_0x47bdbf[_0x2dd5('0x35')][_0x2dd5('0x3c')]);_0x16c684[_0x2dd5('0x27')]=qs[_0x2dd5('0x27')](_0x47bdbf['query'][_0x2dd5('0x27')]);}return _0x1832c8[_0x2dd5('0x56')](_0x16c684);}})[_0x2dd5('0x18')](function(_0x12f463){if(_0x12f463){return _0x12f463?{'count':_0x4f7271,'rows':_0x12f463}:null;}})[_0x2dd5('0x18')](respondWithResult(_0x589944,null))['catch'](handleError(_0x589944,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 46ae1ce..c99ebcb 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 _0xb131=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x360b94,_0x540c61){var _0x2f8421=function(_0x1f3322){while(--_0x1f3322){_0x360b94['push'](_0x360b94['shift']());}};_0x2f8421(++_0x540c61);}(_0xb131,0x16f));var _0x1b13=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xb131[_0x5d6c3e];return _0x44ecb7;};'use strict';var _=require(_0x1b13('0x0'));var util=require(_0x1b13('0x1'));var logger=require(_0x1b13('0x2'))(_0x1b13('0x3'));var moment=require(_0x1b13('0x4'));var BPromise=require(_0x1b13('0x5'));var rp=require(_0x1b13('0x6'));var fs=require('fs');var path=require(_0x1b13('0x7'));var rimraf=require(_0x1b13('0x8'));var config=require(_0x1b13('0x9'));var attributes=require('./intDynamics365Configuration.attributes');module[_0x1b13('0xa')]=function(_0x1d7c95,_0x254799){return _0x1d7c95[_0x1b13('0xb')](_0x1b13('0xc'),attributes,{'tableName':_0x1b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe0f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0xbe0f,0x1cd));var _0xfbe0=function(_0x4b719b,_0x440b42){_0x4b719b=_0x4b719b-0x0;var _0x90fbee=_0xbe0f[_0x4b719b];return _0x90fbee;};'use strict';var _=require(_0xfbe0('0x0'));var util=require(_0xfbe0('0x1'));var logger=require(_0xfbe0('0x2'))(_0xfbe0('0x3'));var moment=require(_0xfbe0('0x4'));var BPromise=require(_0xfbe0('0x5'));var rp=require(_0xfbe0('0x6'));var fs=require('fs');var path=require(_0xfbe0('0x7'));var rimraf=require(_0xfbe0('0x8'));var config=require(_0xfbe0('0x9'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xfbe0('0xa')]=function(_0x41241d,_0x1c1d69){return _0x41241d[_0xfbe0('0xb')](_0xfbe0('0xc'),attributes,{'tableName':_0xfbe0('0xd'),'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 578c6a8..72bde75 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 _0xa436=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x227b67,_0x5c4075){var _0x16f616=function(_0x46e857){while(--_0x46e857){_0x227b67['push'](_0x227b67['shift']());}};_0x16f616(++_0x5c4075);}(_0xa436,0x1c9));var _0x6a43=function(_0x2057ce,_0x4ae54c){_0x2057ce=_0x2057ce-0x0;var _0x2311db=_0xa436[_0x2057ce];return _0x2311db;};'use strict';var _=require(_0x6a43('0x0'));var util=require('util');var moment=require(_0x6a43('0x1'));var BPromise=require(_0x6a43('0x2'));var rs=require(_0x6a43('0x3'));var fs=require('fs');var Redis=require(_0x6a43('0x4'));var db=require(_0x6a43('0x5'))['db'];var utils=require(_0x6a43('0x6'));var logger=require('../../config/logger')(_0x6a43('0x7'));var config=require(_0x6a43('0x8'));var jayson=require(_0x6a43('0x9'));var client=jayson[_0x6a43('0xa')][_0x6a43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d31d4,_0x477bc9,_0x503017){return new BPromise(function(_0x4da1f5,_0x5bfa4b){return client[_0x6a43('0xc')](_0x5d31d4,_0x503017)[_0x6a43('0xd')](function(_0x3ad19c){logger[_0x6a43('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x477bc9,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x477bc9,'request\x20sent',JSON[_0x6a43('0xf')](_0x3ad19c));if(_0x3ad19c[_0x6a43('0x10')]){if(_0x3ad19c[_0x6a43('0x10')]['code']===0x1f4){logger['error'](_0x6a43('0x11'),_0x477bc9,_0x3ad19c[_0x6a43('0x10')][_0x6a43('0x12')]);return _0x5bfa4b(_0x3ad19c[_0x6a43('0x10')][_0x6a43('0x12')]);}logger[_0x6a43('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x477bc9,_0x3ad19c[_0x6a43('0x10')][_0x6a43('0x12')]);return _0x4da1f5(_0x3ad19c[_0x6a43('0x10')][_0x6a43('0x12')]);}else{logger[_0x6a43('0xe')](_0x6a43('0x11'),_0x477bc9,_0x6a43('0x13'));_0x4da1f5(_0x3ad19c['result'][_0x6a43('0x12')]);}})[_0x6a43('0x14')](function(_0x31672d){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x477bc9,_0x31672d);_0x5bfa4b(_0x31672d);});});} \ No newline at end of file +var _0x1fad=['info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x26b459,_0x2b100d){var _0x439618=function(_0x3a0d9f){while(--_0x3a0d9f){_0x26b459['push'](_0x26b459['shift']());}};_0x439618(++_0x2b100d);}(_0x1fad,0xf1));var _0xd1fa=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x1fad[_0x1ca890];return _0x3f8e01;};'use strict';var _=require(_0xd1fa('0x0'));var util=require('util');var moment=require(_0xd1fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xd1fa('0x2'));var fs=require('fs');var Redis=require(_0xd1fa('0x3'));var db=require(_0xd1fa('0x4'))['db'];var utils=require(_0xd1fa('0x5'));var logger=require('../../config/logger')(_0xd1fa('0x6'));var config=require(_0xd1fa('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd1fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13624c,_0x48158c,_0x5b8e94){return new BPromise(function(_0x383829,_0x768181){return client[_0xd1fa('0x9')](_0x13624c,_0x5b8e94)[_0xd1fa('0xa')](function(_0x56291b){logger[_0xd1fa('0xb')](_0xd1fa('0xc'),_0x48158c,'request\x20sent');logger[_0xd1fa('0xd')](_0xd1fa('0xe'),_0x48158c,_0xd1fa('0xf'),JSON[_0xd1fa('0x10')](_0x56291b));if(_0x56291b[_0xd1fa('0x11')]){if(_0x56291b[_0xd1fa('0x11')][_0xd1fa('0x12')]===0x1f4){logger['error'](_0xd1fa('0xc'),_0x48158c,_0x56291b[_0xd1fa('0x11')][_0xd1fa('0x13')]);return _0x768181(_0x56291b[_0xd1fa('0x11')][_0xd1fa('0x13')]);}logger[_0xd1fa('0x11')](_0xd1fa('0xc'),_0x48158c,_0x56291b[_0xd1fa('0x11')][_0xd1fa('0x13')]);return _0x383829(_0x56291b[_0xd1fa('0x11')][_0xd1fa('0x13')]);}else{logger[_0xd1fa('0xb')](_0xd1fa('0xc'),_0x48158c,_0xd1fa('0xf'));_0x383829(_0x56291b['result'][_0xd1fa('0x13')]);}})[_0xd1fa('0x14')](function(_0x4c1897){logger['error'](_0xd1fa('0xc'),_0x48158c,_0x4c1897);_0x768181(_0x4c1897);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f644682..b8015e6 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 _0x971f=['show','post','put','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id'];(function(_0x5fc886,_0x21b8f5){var _0x26bce4=function(_0x24d0a4){while(--_0x24d0a4){_0x5fc886['push'](_0x5fc886['shift']());}};_0x26bce4(++_0x21b8f5);}(_0x971f,0x17c));var _0xf971=function(_0x31b262,_0x4b7a9c){_0x31b262=_0x31b262-0x0;var _0x2f4b16=_0x971f[_0x31b262];return _0x2f4b16;};'use strict';var multer=require('multer');var util=require(_0xf971('0x0'));var path=require(_0xf971('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf971('0x2')]();var auth=require(_0xf971('0x3'));var interaction=require(_0xf971('0x4'));var config=require(_0xf971('0x5'));var controller=require(_0xf971('0x6'));router[_0xf971('0x7')]('/',auth[_0xf971('0x8')](),controller[_0xf971('0x9')]);router[_0xf971('0x7')](_0xf971('0xa'),auth['isAuthenticated'](),controller[_0xf971('0xb')]);router[_0xf971('0xc')]('/',auth[_0xf971('0x8')](),controller['create']);router[_0xf971('0xd')]('/:id',auth[_0xf971('0x8')](),controller['update']);router[_0xf971('0xe')](_0xf971('0xa'),auth['isAuthenticated'](),controller[_0xf971('0xf')]);module[_0xf971('0x10')]=router; \ No newline at end of file +var _0x2f4d=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3684cd,_0x5a9da4){var _0x1736e3=function(_0x267142){while(--_0x267142){_0x3684cd['push'](_0x3684cd['shift']());}};_0x1736e3(++_0x5a9da4);}(_0x2f4d,0x177));var _0xd2f4=function(_0x11e557,_0x3a27e2){_0x11e557=_0x11e557-0x0;var _0x19edd5=_0x2f4d[_0x11e557];return _0x19edd5;};'use strict';var multer=require(_0xd2f4('0x0'));var util=require(_0xd2f4('0x1'));var path=require(_0xd2f4('0x2'));var timeout=require(_0xd2f4('0x3'));var express=require(_0xd2f4('0x4'));var router=express[_0xd2f4('0x5')]();var auth=require(_0xd2f4('0x6'));var interaction=require(_0xd2f4('0x7'));var config=require(_0xd2f4('0x8'));var controller=require(_0xd2f4('0x9'));router[_0xd2f4('0xa')]('/',auth[_0xd2f4('0xb')](),controller[_0xd2f4('0xc')]);router[_0xd2f4('0xa')](_0xd2f4('0xd'),auth['isAuthenticated'](),controller[_0xd2f4('0xe')]);router[_0xd2f4('0xf')]('/',auth[_0xd2f4('0xb')](),controller[_0xd2f4('0x10')]);router[_0xd2f4('0x11')]('/:id',auth[_0xd2f4('0xb')](),controller[_0xd2f4('0x12')]);router[_0xd2f4('0x13')](_0xd2f4('0xd'),auth[_0xd2f4('0xb')](),controller[_0xd2f4('0x14')]);module[_0xd2f4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index cdf313f..4faa537 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 _0x1be1=['STRING','variable','BOOLEAN','ENUM','string','customVariable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1be1,0x192));var _0x11be=function(_0x254c95,_0x4b0a4e){_0x254c95=_0x254c95-0x0;var _0x578b91=_0x1be1[_0x254c95];return _0x578b91;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),'variable',_0x11be('0x2'),_0x11be('0x3')),'defaultValue':_0x11be('0x1')},'content':{'type':Sequelize[_0x11be('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11be('0x0')](_0x11be('0x1'),_0x11be('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x11be('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11be('0x4')]},'customField':{'type':Sequelize[_0x11be('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11be('0x4')]}}; \ No newline at end of file +var _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x52343a,_0x500496){var _0x6adb4=function(_0x47a928){while(--_0x47a928){_0x52343a['push'](_0x52343a['shift']());}};_0x6adb4(++_0x500496);}(_0xe605,0x92));var _0x5e60=function(_0x982019,_0x3e54ae){_0x982019=_0x982019-0x0;var _0x423c8e=_0xe605[_0x982019];return _0x423c8e;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'),_0x5e60('0x5')),'defaultValue':_0x5e60('0x2')},'content':{'type':Sequelize[_0x5e60('0x6')]},'key':{'type':Sequelize[_0x5e60('0x6')]},'keyType':{'type':Sequelize[_0x5e60('0x7')](_0x5e60('0x2'),_0x5e60('0x3'),_0x5e60('0x4'))},'keyContent':{'type':Sequelize[_0x5e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e60('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 23a06d8..b6807fc 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Dynamics365Field','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0xa0a8d5,_0x5662bb){var _0x1de145=function(_0x413ec4){while(--_0x413ec4){_0xa0a8d5['push'](_0xa0a8d5['shift']());}};_0x1de145(++_0x5662bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Dynamics365Field'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Dynamics365Field'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xd8b0=['stack','name','index','rawAttributes','keys','filters','model','attributes','intersection','length','query','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','key','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then'];(function(_0x3c80fa,_0x410492){var _0x6609d0=function(_0x35e0c5){while(--_0x35e0c5){_0x3c80fa['push'](_0x3c80fa['shift']());}};_0x6609d0(++_0x410492);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];function respondWithStatusCode(_0xc574a3,_0x340cc4){_0x340cc4=_0x340cc4||0xcc;return function(_0x92cdd8){if(_0x92cdd8){return _0xc574a3[_0x0d8b('0x15')](_0x340cc4);}return _0xc574a3[_0x0d8b('0x16')](_0x340cc4)[_0x0d8b('0x17')]();};}function respondWithResult(_0x31a8cc,_0x1d4bbc){_0x1d4bbc=_0x1d4bbc||0xc8;return function(_0x2ce75e){if(_0x2ce75e){return _0x31a8cc[_0x0d8b('0x16')](_0x1d4bbc)[_0x0d8b('0x18')](_0x2ce75e);}};}function respondWithFilteredResult(_0x1567ce,_0x2d4e1c){return function(_0x4f6f21){if(_0x4f6f21){var _0x23eb7b=_0x4f6f21[_0x0d8b('0x19')],_0xa86349=_0x2d4e1c['offset'],_0x17f7df=_0x2d4e1c[_0x0d8b('0x1a')]+_0x2d4e1c[_0x0d8b('0x1b')],_0xe2e167;if(_0x17f7df>=_0x23eb7b){_0x17f7df=_0x23eb7b;_0xe2e167=0xc8;}else{_0xe2e167=0xce;}_0x1567ce[_0x0d8b('0x16')](_0xe2e167);return _0x1567ce[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0xa86349+'-'+_0x17f7df+'/'+_0x23eb7b)[_0x0d8b('0x18')](_0x4f6f21);}return null;};}function patchUpdates(_0x264b39){return function(_0xa3612a){try{jsonpatch['apply'](_0xa3612a,_0x264b39,!![]);}catch(_0x27512e){return BPromise[_0x0d8b('0x1e')](_0x27512e);}return _0xa3612a[_0x0d8b('0x1f')]();};}function saveUpdates(_0x143372,_0x24e8ed){return function(_0x5b709c){if(_0x5b709c){return _0x5b709c[_0x0d8b('0x20')](_0x143372)[_0x0d8b('0x21')](function(_0x50ec1e){return _0x50ec1e;});}return null;};}function removeEntity(_0x4f0a1a,_0x33fb87){return function(_0x54a9a7){if(_0x54a9a7){return _0x54a9a7['destroy']()['then'](function(){_0x4f0a1a[_0x0d8b('0x16')](0xcc)[_0x0d8b('0x17')]();});}};}function handleEntityNotFound(_0x214778,_0x38efc8){return function(_0x221071){if(!_0x221071){_0x214778[_0x0d8b('0x15')](0x194);}return _0x221071;};}function handleError(_0x30980c,_0x4562cb){_0x4562cb=_0x4562cb||0x1f4;return function(_0x27b695){logger['error'](_0x27b695[_0x0d8b('0x22')]);if(_0x27b695[_0x0d8b('0x23')]){delete _0x27b695['name'];}_0x30980c[_0x0d8b('0x16')](_0x4562cb)['send'](_0x27b695);};}exports[_0x0d8b('0x24')]=function(_0x234bdd,_0xa2af02){var _0x4fe6f9={},_0x59a905={},_0x28f639={'count':0x0,'rows':[]};var _0x3ef745=db['Dynamics365Field'][_0x0d8b('0x25')];_0x59a905['model']=_[_0x0d8b('0x26')](_0x3ef745);_0x59a905['query']=_[_0x0d8b('0x26')](_0x234bdd['query']);_0x59a905[_0x0d8b('0x27')]=_['intersection'](_0x59a905[_0x0d8b('0x28')],_0x59a905['query']);_0x4fe6f9[_0x0d8b('0x29')]=_[_0x0d8b('0x2a')](_0x59a905[_0x0d8b('0x28')],qs['fields'](_0x234bdd['query']['fields']));_0x4fe6f9[_0x0d8b('0x29')]=_0x4fe6f9['attributes'][_0x0d8b('0x2b')]?_0x4fe6f9['attributes']:_0x59a905['model'];if(!_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2d')](_0x0d8b('0x2e'))){_0x4fe6f9[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x4fe6f9[_0x0d8b('0x1a')]=qs['offset'](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x4fe6f9['order']=qs[_0x0d8b('0x2f')](_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x2f')]);_0x4fe6f9['where']=qs[_0x0d8b('0x27')](_[_0x0d8b('0x30')](_0x234bdd[_0x0d8b('0x2c')],_0x59a905[_0x0d8b('0x27')]));if(_0x234bdd[_0x0d8b('0x2c')]['filter']){_0x4fe6f9[_0x0d8b('0x31')]=_[_0x0d8b('0x32')](_0x4fe6f9['where'],{'$or':_[_0x0d8b('0x33')](_0x3ef745,function(_0x3cc3ee){if(_0x3cc3ee[_0x0d8b('0x34')][_0x0d8b('0x35')]!==_0x0d8b('0x36')){var _0x519088={};_0x519088[_0x3cc3ee['field']]={'$like':'%'+_0x234bdd[_0x0d8b('0x2c')]['filter']+'%'};return _0x519088;}})});}_0x4fe6f9=_['merge']({},_0x4fe6f9,_0x234bdd[_0x0d8b('0x37')]);var _0x2e279c={'where':_0x4fe6f9[_0x0d8b('0x31')]};return db[_0x0d8b('0x38')][_0x0d8b('0x19')](_0x2e279c)[_0x0d8b('0x21')](function(_0x579324){_0x28f639[_0x0d8b('0x19')]=_0x579324;if(_0x234bdd[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4fe6f9[_0x0d8b('0x3a')]=[{'all':!![]}];}return db[_0x0d8b('0x38')][_0x0d8b('0x3b')](_0x4fe6f9);})[_0x0d8b('0x21')](function(_0x5c980b){_0x28f639[_0x0d8b('0x3c')]=_0x5c980b;return _0x28f639;})[_0x0d8b('0x21')](respondWithFilteredResult(_0xa2af02,_0x4fe6f9))[_0x0d8b('0x3d')](handleError(_0xa2af02,null));};exports[_0x0d8b('0x3e')]=function(_0x59d3ad,_0xe0bf42){var _0x4b4bde={'raw':!![],'where':{'id':_0x59d3ad[_0x0d8b('0x3f')]['id']}},_0x37b26c={};_0x37b26c[_0x0d8b('0x28')]=_[_0x0d8b('0x26')](db[_0x0d8b('0x38')][_0x0d8b('0x25')]);_0x37b26c[_0x0d8b('0x2c')]=_[_0x0d8b('0x26')](_0x59d3ad[_0x0d8b('0x2c')]);_0x37b26c[_0x0d8b('0x27')]=_['intersection'](_0x37b26c['model'],_0x37b26c['query']);_0x4b4bde['attributes']=_['intersection'](_0x37b26c[_0x0d8b('0x28')],qs[_0x0d8b('0x40')](_0x59d3ad[_0x0d8b('0x2c')]['fields']));_0x4b4bde['attributes']=_0x4b4bde[_0x0d8b('0x29')][_0x0d8b('0x2b')]?_0x4b4bde[_0x0d8b('0x29')]:_0x37b26c['model'];if(_0x59d3ad[_0x0d8b('0x2c')][_0x0d8b('0x39')]){_0x4b4bde['include']=[{'all':!![]}];}_0x4b4bde=_['merge']({},_0x4b4bde,_0x59d3ad[_0x0d8b('0x37')]);return db['Dynamics365Field'][_0x0d8b('0x41')](_0x4b4bde)['then'](handleEntityNotFound(_0xe0bf42,null))['then'](respondWithResult(_0xe0bf42,null))[_0x0d8b('0x3d')](handleError(_0xe0bf42,null));};exports[_0x0d8b('0x42')]=function(_0x5a75c7,_0x5ebe8a){return db['Dynamics365Field']['create'](_0x5a75c7[_0x0d8b('0x43')],{})[_0x0d8b('0x21')](respondWithResult(_0x5ebe8a,0xc9))[_0x0d8b('0x3d')](handleError(_0x5ebe8a,null));};exports['update']=function(_0xb0910e,_0x1afe8a){if(_0xb0910e[_0x0d8b('0x43')]['id']){delete _0xb0910e[_0x0d8b('0x43')]['id'];}return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0xb0910e[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x1afe8a,null))[_0x0d8b('0x21')](saveUpdates(_0xb0910e[_0x0d8b('0x43')],null))[_0x0d8b('0x21')](respondWithResult(_0x1afe8a,null))[_0x0d8b('0x3d')](handleError(_0x1afe8a,null));};exports[_0x0d8b('0x44')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x38')][_0x0d8b('0x41')]({'where':{'id':_0x3e569b[_0x0d8b('0x3f')]['id']}})[_0x0d8b('0x21')](handleEntityNotFound(_0x570af8,null))['then'](removeEntity(_0x570af8,null))[_0x0d8b('0x3d')](handleError(_0x570af8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index cd63da6..9f3ed7e 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x1afea9,_0x1d9e58){var _0x340032=function(_0x4e4946){while(--_0x4e4946){_0x1afea9['push'](_0x1afea9['shift']());}};_0x340032(++_0x1d9e58);}(_0xb10b,0x12a));var _0xbb10=function(_0x24f22d,_0x1f6649){_0x24f22d=_0x24f22d-0x0;var _0x321679=_0xb10b[_0x24f22d];return _0x321679;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x2a5041,_0x96348d){var _0x16733a=function(_0x295f67){while(--_0x295f67){_0x2a5041['push'](_0x2a5041['shift']());}};_0x16733a(++_0x96348d);}(_0xb10b,0x12a));var _0xbb10=function(_0x86a8fa,_0x323e96){_0x86a8fa=_0x86a8fa-0x0;var _0x551384=_0xb10b[_0x86a8fa];return _0x551384;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('Dynamics365Field',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd'),_0xbb10('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 9eb5143..f539925 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 _0xfbe6=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0xfbe6,0x6d));var _0x6fbe=function(_0x472d6f,_0x4d598d){_0x472d6f=_0x472d6f-0x0;var _0x26b18b=_0xfbe6[_0x472d6f];return _0x26b18b;};'use strict';var _=require(_0x6fbe('0x0'));var util=require(_0x6fbe('0x1'));var moment=require(_0x6fbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x6fbe('0x3'));var fs=require('fs');var Redis=require(_0x6fbe('0x4'));var db=require(_0x6fbe('0x5'))['db'];var utils=require(_0x6fbe('0x6'));var logger=require(_0x6fbe('0x7'))(_0x6fbe('0x8'));var config=require(_0x6fbe('0x9'));var jayson=require(_0x6fbe('0xa'));var client=jayson[_0x6fbe('0xb')][_0x6fbe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x533992,_0x1b4712,_0x1be794){return new BPromise(function(_0x439feb,_0x5532b3){return client[_0x6fbe('0xd')](_0x533992,_0x1be794)[_0x6fbe('0xe')](function(_0x348ba5){logger[_0x6fbe('0xf')](_0x6fbe('0x10'),_0x1b4712,_0x6fbe('0x11'));logger[_0x6fbe('0x12')](_0x6fbe('0x13'),_0x1b4712,_0x6fbe('0x11'),JSON[_0x6fbe('0x14')](_0x348ba5));if(_0x348ba5['error']){if(_0x348ba5[_0x6fbe('0x15')][_0x6fbe('0x16')]===0x1f4){logger[_0x6fbe('0x15')](_0x6fbe('0x10'),_0x1b4712,_0x348ba5[_0x6fbe('0x15')][_0x6fbe('0x17')]);return _0x5532b3(_0x348ba5[_0x6fbe('0x15')][_0x6fbe('0x17')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1b4712,_0x348ba5[_0x6fbe('0x15')][_0x6fbe('0x17')]);return _0x439feb(_0x348ba5[_0x6fbe('0x15')]['message']);}else{logger[_0x6fbe('0xf')](_0x6fbe('0x10'),_0x1b4712,_0x6fbe('0x11'));_0x439feb(_0x348ba5[_0x6fbe('0x18')][_0x6fbe('0x17')]);}})[_0x6fbe('0x19')](function(_0x3b9bc0){logger[_0x6fbe('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x1b4712,_0x3b9bc0);_0x5532b3(_0x3b9bc0);});});} \ No newline at end of file +var _0x9d01=['request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9d01,0x1ec));var _0x19d0=function(_0x27850c,_0x4753fd){_0x27850c=_0x27850c-0x0;var _0xd47c47=_0x9d01[_0x27850c];return _0xd47c47;};'use strict';var _=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var moment=require(_0x19d0('0x2'));var BPromise=require(_0x19d0('0x3'));var rs=require(_0x19d0('0x4'));var fs=require('fs');var Redis=require(_0x19d0('0x5'));var db=require(_0x19d0('0x6'))['db'];var utils=require(_0x19d0('0x7'));var logger=require('../../config/logger')(_0x19d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x19d0('0x9'));var client=jayson[_0x19d0('0xa')][_0x19d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x593c5e,_0x355cbf,_0x30cca9){return new BPromise(function(_0x2be5a9,_0x37e035){return client[_0x19d0('0xc')](_0x593c5e,_0x30cca9)[_0x19d0('0xd')](function(_0x1cfab8){logger[_0x19d0('0xe')](_0x19d0('0xf'),_0x355cbf,_0x19d0('0x10'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x355cbf,_0x19d0('0x10'),JSON[_0x19d0('0x11')](_0x1cfab8));if(_0x1cfab8[_0x19d0('0x12')]){if(_0x1cfab8[_0x19d0('0x12')]['code']===0x1f4){logger['error'](_0x19d0('0xf'),_0x355cbf,_0x1cfab8['error'][_0x19d0('0x13')]);return _0x37e035(_0x1cfab8[_0x19d0('0x12')][_0x19d0('0x13')]);}logger['error'](_0x19d0('0xf'),_0x355cbf,_0x1cfab8[_0x19d0('0x12')][_0x19d0('0x13')]);return _0x2be5a9(_0x1cfab8['error'][_0x19d0('0x13')]);}else{logger[_0x19d0('0xe')](_0x19d0('0xf'),_0x355cbf,_0x19d0('0x10'));_0x2be5a9(_0x1cfab8[_0x19d0('0x14')]['message']);}})['catch'](function(_0x3b4206){logger[_0x19d0('0x12')](_0x19d0('0xf'),_0x355cbf,_0x3b4206);_0x37e035(_0x3b4206);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f7df6e5..1056347 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 _0x3216=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','post','addConfiguration','put','update','delete','destroy','multer','util','path'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3216,0x89));var _0x6321=function(_0x542790,_0x43552b){_0x542790=_0x542790-0x0;var _0x57bd5f=_0x3216[_0x542790];return _0x57bd5f;};'use strict';var multer=require(_0x6321('0x0'));var util=require(_0x6321('0x1'));var path=require(_0x6321('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6321('0x3')]();var auth=require(_0x6321('0x4'));var interaction=require(_0x6321('0x5'));var config=require(_0x6321('0x6'));var controller=require(_0x6321('0x7'));router[_0x6321('0x8')]('/',auth[_0x6321('0x9')](),controller[_0x6321('0xa')]);router['get'](_0x6321('0xb'),auth[_0x6321('0x9')](),controller[_0x6321('0xc')]);router[_0x6321('0x8')](_0x6321('0xd'),auth[_0x6321('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6321('0x9')](),controller['getFields']);router[_0x6321('0xe')]('/',auth[_0x6321('0x9')](),controller['create']);router[_0x6321('0xe')](_0x6321('0xd'),auth[_0x6321('0x9')](),controller[_0x6321('0xf')]);router[_0x6321('0x10')]('/:id',auth[_0x6321('0x9')](),controller[_0x6321('0x11')]);router[_0x6321('0x12')](_0x6321('0xb'),auth[_0x6321('0x9')](),controller[_0x6321('0x13')]);module['exports']=router; \ No newline at end of file +var _0x077d=['get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0xe46156,_0x25a639){var _0x32d0ef=function(_0x35e336){while(--_0x35e336){_0xe46156['push'](_0xe46156['shift']());}};_0x32d0ef(++_0x25a639);}(_0x077d,0x16d));var _0xd077=function(_0x3c77fc,_0x310987){_0x3c77fc=_0x3c77fc-0x0;var _0x348df9=_0x077d[_0x3c77fc];return _0x348df9;};'use strict';var multer=require(_0xd077('0x0'));var util=require(_0xd077('0x1'));var path=require(_0xd077('0x2'));var timeout=require(_0xd077('0x3'));var express=require(_0xd077('0x4'));var router=express[_0xd077('0x5')]();var auth=require(_0xd077('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd077('0x7'));var controller=require(_0xd077('0x8'));router[_0xd077('0x9')]('/',auth[_0xd077('0xa')](),controller[_0xd077('0xb')]);router[_0xd077('0x9')](_0xd077('0xc'),auth[_0xd077('0xa')](),controller[_0xd077('0xd')]);router[_0xd077('0x9')](_0xd077('0xe'),auth[_0xd077('0xa')](),controller['getConfigurations']);router[_0xd077('0x9')]('/:id/fields',auth[_0xd077('0xa')](),controller[_0xd077('0xf')]);router[_0xd077('0x10')]('/',auth[_0xd077('0xa')](),controller[_0xd077('0x11')]);router[_0xd077('0x10')](_0xd077('0xe'),auth[_0xd077('0xa')](),controller['addConfiguration']);router['put'](_0xd077('0xc'),auth[_0xd077('0xa')](),controller[_0xd077('0x12')]);router[_0xd077('0x13')](_0xd077('0xc'),auth[_0xd077('0xa')](),controller[_0xd077('0x14')]);module[_0xd077('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c82c98c..87a3ec2 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 _0xe170=['exports','STRING','remoteUri','sequelize'];(function(_0x29938d,_0x4b5e7c){var _0x1ef03f=function(_0x445147){while(--_0x445147){_0x29938d['push'](_0x29938d['shift']());}};_0x1ef03f(++_0x4b5e7c);}(_0xe170,0x1b3));var _0x0e17=function(_0xbf1875,_0x34b144){_0xbf1875=_0xbf1875-0x0;var _0x2e598b=_0xe170[_0xbf1875];return _0x2e598b;};'use strict';var Sequelize=require(_0x0e17('0x0'));module[_0x0e17('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x0e17('0x2')]},'remoteUri':{'type':Sequelize[_0x0e17('0x2')],'unique':_0x0e17('0x3')},'serverUrl':{'type':Sequelize[_0x0e17('0x2')]}}; \ No newline at end of file +var _0x3066=['username','remoteUri','exports','STRING'];(function(_0x740521,_0x5a529b){var _0x33ca12=function(_0x13f664){while(--_0x13f664){_0x740521['push'](_0x740521['shift']());}};_0x33ca12(++_0x5a529b);}(_0x3066,0x136));var _0x6306=function(_0xf18ecf,_0x30b685){_0xf18ecf=_0xf18ecf-0x0;var _0x56406c=_0x3066[_0xf18ecf];return _0x56406c;};'use strict';var Sequelize=require('sequelize');module[_0x6306('0x0')]={'name':{'type':Sequelize[_0x6306('0x1')]},'description':{'type':Sequelize[_0x6306('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6306('0x2')},'apiKey':{'type':Sequelize[_0x6306('0x1')]},'remoteUri':{'type':Sequelize[_0x6306('0x1')],'unique':_0x6306('0x3')},'serverUrl':{'type':Sequelize[_0x6306('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0627e62..ee0442b 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 _0x309e=['json','count','offset','limit','set','apply','update','destroy','then','stack','name','send','index','model','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','FreshdeskAccount','includeAll','include','findAll','show','params','length','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','source','ticket_type','group','company','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x4166af,_0x533024){var _0x5a6721=function(_0x329bd9){while(--_0x329bd9){_0x4166af['push'](_0x4166af['shift']());}};_0x5a6721(++_0x533024);}(_0x309e,0x155));var _0xe309=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x309e[_0x273c39];return _0x46d6b5;};'use strict';var pdf=require(_0xe309('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe309('0x1'));var zipdir=require(_0xe309('0x2'));var jsonpatch=require(_0xe309('0x3'));var rp=require(_0xe309('0x4'));var moment=require(_0xe309('0x5'));var BPromise=require(_0xe309('0x6'));var Mustache=require(_0xe309('0x7'));var util=require(_0xe309('0x8'));var path=require(_0xe309('0x9'));var sox=require(_0xe309('0xa'));var csv=require(_0xe309('0xb'));var ejs=require(_0xe309('0xc'));var fs=require('fs');var _=require(_0xe309('0xd'));var squel=require(_0xe309('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe309('0xb'));var querystring=require(_0xe309('0xf'));var Papa=require(_0xe309('0x10'));var Redis=require(_0xe309('0x11'));var authService=require(_0xe309('0x12'));var qs=require(_0xe309('0x13'));var hardwareService=require(_0xe309('0x14'));var logger=require(_0xe309('0x15'))(_0xe309('0x16'));var utils=require(_0xe309('0x17'));var config=require('../../config/environment');var db=require(_0xe309('0x18'))['db'];var integrations=require(_0xe309('0x19'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe309('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4dd791,_0x2ffc72,_0x30dc81){if(_0x30dc81){var _0x6f62e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6f62e8[_0xe309('0x1b')](_0x2ffc72)){return _0x4dd791;}else{throw new Error(_0xe309('0x1c'));}}else{return _0x4dd791;}}function respondWithRpcPromise(_0x5118f7,_0x26f452,_0x249823,_0x32453e){return new BPromise(function(_0x2d4723,_0x50379d){var _0x5bf794=_0x32453e||client;return _0x5bf794['request'](_0x5118f7,_0x249823)['then'](function(_0xa59e97){logger[_0xe309('0x1d')](_0xe309('0x1e'),_0x26f452,_0xe309('0x1f'));logger[_0xe309('0x20')](_0xe309('0x21'),_0x26f452,_0xe309('0x1f'),JSON[_0xe309('0x22')](_0xa59e97));if(_0xa59e97[_0xe309('0x23')]){if(_0xa59e97[_0xe309('0x23')][_0xe309('0x24')]===0x1f4){logger['error'](_0xe309('0x1e'),_0x26f452,_0xa59e97['error'][_0xe309('0x25')]);return _0x50379d(_0xa59e97[_0xe309('0x23')][_0xe309('0x25')]);}logger[_0xe309('0x23')](_0xe309('0x1e'),_0x26f452,_0xa59e97['error'][_0xe309('0x25')]);return _0x2d4723(_0xa59e97[_0xe309('0x23')][_0xe309('0x25')]);}else{logger[_0xe309('0x1d')](_0xe309('0x1e'),_0x26f452,'request\x20sent');_0x2d4723(_0xa59e97[_0xe309('0x26')][_0xe309('0x25')]);}})[_0xe309('0x27')](function(_0x423c22){logger[_0xe309('0x23')](_0xe309('0x1e'),_0x26f452,_0x423c22);_0x50379d(_0x423c22);});});}function respondWithStatusCode(_0x3cda7f,_0x486d09){_0x486d09=_0x486d09||0xcc;return function(_0x701075){if(_0x701075){return _0x3cda7f[_0xe309('0x28')](_0x486d09);}return _0x3cda7f[_0xe309('0x29')](_0x486d09)[_0xe309('0x2a')]();};}function respondWithResult(_0x486863,_0x24328f){_0x24328f=_0x24328f||0xc8;return function(_0x3d7807){if(_0x3d7807){return _0x486863[_0xe309('0x29')](_0x24328f)[_0xe309('0x2b')](_0x3d7807);}};}function respondWithFilteredResult(_0x10ee33,_0x4d6288){return function(_0x5a9c9a){if(_0x5a9c9a){var _0x372a31=_0x5a9c9a[_0xe309('0x2c')],_0x549bc7=_0x4d6288[_0xe309('0x2d')],_0x10f8f8=_0x4d6288[_0xe309('0x2d')]+_0x4d6288[_0xe309('0x2e')],_0x5e4685;if(_0x10f8f8>=_0x372a31){_0x10f8f8=_0x372a31;_0x5e4685=0xc8;}else{_0x5e4685=0xce;}_0x10ee33[_0xe309('0x29')](_0x5e4685);return _0x10ee33[_0xe309('0x2f')]('Content-Range',_0x549bc7+'-'+_0x10f8f8+'/'+_0x372a31)['json'](_0x5a9c9a);}return null;};}function patchUpdates(_0x667f54){return function(_0x3b4979){try{jsonpatch[_0xe309('0x30')](_0x3b4979,_0x667f54,!![]);}catch(_0xf0e6d0){return BPromise['reject'](_0xf0e6d0);}return _0x3b4979['save']();};}function saveUpdates(_0x5126b7,_0x222393){return function(_0x49d850){if(_0x49d850){return _0x49d850[_0xe309('0x31')](_0x5126b7)['then'](function(_0x1efbca){return _0x1efbca;});}return null;};}function removeEntity(_0x2c39fb,_0x2be12a){return function(_0x4a116e){if(_0x4a116e){return _0x4a116e[_0xe309('0x32')]()[_0xe309('0x33')](function(){_0x2c39fb[_0xe309('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50ce76,_0x25ab7c){return function(_0x1621e7){if(!_0x1621e7){_0x50ce76[_0xe309('0x28')](0x194);}return _0x1621e7;};}function handleError(_0xab2c7b,_0xd3d5d4){_0xd3d5d4=_0xd3d5d4||0x1f4;return function(_0x1224dc){logger[_0xe309('0x23')](_0x1224dc[_0xe309('0x34')]);if(_0x1224dc[_0xe309('0x35')]){delete _0x1224dc['name'];}_0xab2c7b[_0xe309('0x29')](_0xd3d5d4)[_0xe309('0x36')](_0x1224dc);};}exports[_0xe309('0x37')]=function(_0xfceeaa,_0xe41d9f){var _0x5c2b32={},_0x5c8ebb={},_0x13a0fa={'count':0x0,'rows':[]};var _0x2cf8a4=db['FreshdeskAccount']['rawAttributes'];_0x5c8ebb[_0xe309('0x38')]=_[_0xe309('0x39')](_0x2cf8a4);_0x5c8ebb['query']=_[_0xe309('0x39')](_0xfceeaa[_0xe309('0x3a')]);_0x5c8ebb['filters']=_[_0xe309('0x3b')](_0x5c8ebb[_0xe309('0x38')],_0x5c8ebb[_0xe309('0x3a')]);_0x5c2b32['attributes']=_['intersection'](_0x5c8ebb[_0xe309('0x38')],qs[_0xe309('0x3c')](_0xfceeaa[_0xe309('0x3a')][_0xe309('0x3c')]));_0x5c2b32['attributes']=_0x5c2b32[_0xe309('0x3d')]['length']?_0x5c2b32['attributes']:_0x5c8ebb[_0xe309('0x38')];if(!_0xfceeaa[_0xe309('0x3a')][_0xe309('0x3e')]('nolimit')){_0x5c2b32[_0xe309('0x2e')]=qs[_0xe309('0x2e')](_0xfceeaa[_0xe309('0x3a')]['limit']);_0x5c2b32[_0xe309('0x2d')]=qs[_0xe309('0x2d')](_0xfceeaa['query'][_0xe309('0x2d')]);}_0x5c2b32[_0xe309('0x3f')]=qs[_0xe309('0x40')](_0xfceeaa[_0xe309('0x3a')][_0xe309('0x40')]);_0x5c2b32[_0xe309('0x41')]=qs[_0xe309('0x42')](_[_0xe309('0x43')](_0xfceeaa[_0xe309('0x3a')],_0x5c8ebb[_0xe309('0x42')]));if(_0xfceeaa[_0xe309('0x3a')][_0xe309('0x44')]){_0x5c2b32[_0xe309('0x41')]=_[_0xe309('0x45')](_0x5c2b32[_0xe309('0x41')],{'$or':_[_0xe309('0x46')](_0x2cf8a4,function(_0x30f504){if(_0x30f504[_0xe309('0x47')][_0xe309('0x48')]!==_0xe309('0x49')){var _0x2bffe5={};_0x2bffe5[_0x30f504['field']]={'$like':'%'+_0xfceeaa[_0xe309('0x3a')][_0xe309('0x44')]+'%'};return _0x2bffe5;}})});}_0x5c2b32=_[_0xe309('0x45')]({},_0x5c2b32,_0xfceeaa[_0xe309('0x4a')]);var _0x426f0f={'where':_0x5c2b32[_0xe309('0x41')]};return db[_0xe309('0x4b')][_0xe309('0x2c')](_0x426f0f)[_0xe309('0x33')](function(_0x1078d1){_0x13a0fa[_0xe309('0x2c')]=_0x1078d1;if(_0xfceeaa['query'][_0xe309('0x4c')]){_0x5c2b32[_0xe309('0x4d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xe309('0x4e')](_0x5c2b32);})[_0xe309('0x33')](function(_0x3da6b8){_0x13a0fa['rows']=_0x3da6b8;return _0x13a0fa;})[_0xe309('0x33')](respondWithFilteredResult(_0xe41d9f,_0x5c2b32))[_0xe309('0x27')](handleError(_0xe41d9f,null));};exports[_0xe309('0x4f')]=function(_0x356080,_0x5a0e7b){var _0x4b8615={'raw':![],'where':{'id':_0x356080[_0xe309('0x50')]['id']}},_0x42137b={};_0x42137b[_0xe309('0x38')]=_[_0xe309('0x39')](db[_0xe309('0x4b')]['rawAttributes']);_0x42137b['query']=_[_0xe309('0x39')](_0x356080[_0xe309('0x3a')]);_0x42137b[_0xe309('0x42')]=_['intersection'](_0x42137b[_0xe309('0x38')],_0x42137b[_0xe309('0x3a')]);_0x4b8615[_0xe309('0x3d')]=_[_0xe309('0x3b')](_0x42137b[_0xe309('0x38')],qs[_0xe309('0x3c')](_0x356080[_0xe309('0x3a')][_0xe309('0x3c')]));_0x4b8615[_0xe309('0x3d')]=_0x4b8615[_0xe309('0x3d')][_0xe309('0x51')]?_0x4b8615[_0xe309('0x3d')]:_0x42137b[_0xe309('0x38')];if(_0x356080[_0xe309('0x3a')]['includeAll']){_0x4b8615['include']=[{'all':!![]}];}_0x4b8615=_[_0xe309('0x45')]({},_0x4b8615,_0x356080[_0xe309('0x4a')]);return db[_0xe309('0x4b')]['find'](_0x4b8615)['then'](handleEntityNotFound(_0x5a0e7b,null))[_0xe309('0x33')](respondWithResult(_0x5a0e7b,null))[_0xe309('0x27')](handleError(_0x5a0e7b,null));};exports[_0xe309('0x52')]=function(_0x2c1bbf,_0x337f07){return db['FreshdeskAccount']['create'](_0x2c1bbf[_0xe309('0x53')],{})[_0xe309('0x33')](respondWithResult(_0x337f07,0xc9))[_0xe309('0x27')](handleError(_0x337f07,null));};exports[_0xe309('0x31')]=function(_0x3c0277,_0x199845){if(_0x3c0277['body']['id']){delete _0x3c0277[_0xe309('0x53')]['id'];}return db[_0xe309('0x4b')][_0xe309('0x54')]({'where':{'id':_0x3c0277[_0xe309('0x50')]['id']}})[_0xe309('0x33')](handleEntityNotFound(_0x199845,null))['then'](saveUpdates(_0x3c0277[_0xe309('0x53')],null))[_0xe309('0x33')](respondWithResult(_0x199845,null))[_0xe309('0x27')](handleError(_0x199845,null));};exports[_0xe309('0x32')]=function(_0x5c4071,_0x2e8e15){return db[_0xe309('0x4b')][_0xe309('0x54')]({'where':{'id':_0x5c4071[_0xe309('0x50')]['id']}})[_0xe309('0x33')](handleEntityNotFound(_0x2e8e15,null))[_0xe309('0x33')](removeEntity(_0x2e8e15,null))['catch'](handleError(_0x2e8e15,null));};exports[_0xe309('0x55')]=function(_0x4ee33a,_0x48b2c5,_0x28c2dd){var _0x34ed9e={};var _0x3926ed={};var _0x114d60;var _0x15d75a;return db[_0xe309('0x4b')][_0xe309('0x56')]({'where':{'id':_0x4ee33a[_0xe309('0x50')]['id']}})['then'](handleEntityNotFound(_0x48b2c5,null))[_0xe309('0x33')](function(_0x443099){if(_0x443099){_0x114d60=_0x443099;_0x3926ed['model']=_[_0xe309('0x39')](db[_0xe309('0x57')][_0xe309('0x58')]);_0x3926ed[_0xe309('0x3a')]=_[_0xe309('0x39')](_0x4ee33a['query']);_0x3926ed[_0xe309('0x42')]=_[_0xe309('0x3b')](_0x3926ed[_0xe309('0x38')],_0x3926ed[_0xe309('0x3a')]);_0x34ed9e['attributes']=_[_0xe309('0x3b')](_0x3926ed['model'],qs['fields'](_0x4ee33a[_0xe309('0x3a')]['fields']));_0x34ed9e['attributes']=_0x34ed9e[_0xe309('0x3d')][_0xe309('0x51')]?_0x34ed9e[_0xe309('0x3d')]:_0x3926ed['model'];_0x34ed9e[_0xe309('0x3f')]=qs[_0xe309('0x40')](_0x4ee33a[_0xe309('0x3a')][_0xe309('0x40')]);_0x34ed9e[_0xe309('0x41')]=qs[_0xe309('0x42')](_[_0xe309('0x43')](_0x4ee33a[_0xe309('0x3a')],_0x3926ed[_0xe309('0x42')]));if(_0x4ee33a['query'][_0xe309('0x44')]){_0x34ed9e[_0xe309('0x41')]=_[_0xe309('0x45')](_0x34ed9e['where'],{'$or':_[_0xe309('0x46')](_0x34ed9e['attributes'],function(_0x5aa177){var _0x2b4701={};_0x2b4701[_0x5aa177]={'$like':'%'+_0x4ee33a[_0xe309('0x3a')][_0xe309('0x44')]+'%'};return _0x2b4701;})});}_0x34ed9e=_[_0xe309('0x45')]({},_0x34ed9e,_0x4ee33a[_0xe309('0x4a')]);return _0x114d60[_0xe309('0x55')](_0x34ed9e);}})[_0xe309('0x33')](function(_0x1de60d){if(_0x1de60d){_0x15d75a=_0x1de60d['length'];if(!_0x4ee33a[_0xe309('0x3a')][_0xe309('0x3e')]('nolimit')){_0x34ed9e[_0xe309('0x2e')]=qs[_0xe309('0x2e')](_0x4ee33a[_0xe309('0x3a')][_0xe309('0x2e')]);_0x34ed9e['offset']=qs[_0xe309('0x2d')](_0x4ee33a[_0xe309('0x3a')][_0xe309('0x2d')]);}return _0x114d60[_0xe309('0x55')](_0x34ed9e);}})[_0xe309('0x33')](function(_0x16fa63){if(_0x16fa63){return _0x16fa63?{'count':_0x15d75a,'rows':_0x16fa63}:null;}})['then'](respondWithResult(_0x48b2c5,null))[_0xe309('0x27')](handleError(_0x48b2c5,null));};exports[_0xe309('0x59')]=function(_0x66da25,_0x4c8c4b,_0x1b973b){if(_0x66da25[_0xe309('0x53')]['id']){delete _0x66da25[_0xe309('0x53')]['id'];}return db[_0xe309('0x4b')][_0xe309('0x56')]({'where':{'id':_0x66da25[_0xe309('0x50')]['id']}})[_0xe309('0x33')](handleEntityNotFound(_0x4c8c4b,null))[_0xe309('0x33')](function(_0x834735){if(_0x834735){_0x66da25[_0xe309('0x53')][_0xe309('0x5a')]=_0x834735['id'];_0x66da25[_0xe309('0x53')][_0xe309('0x5b')]=integrations[_0xe309('0x5c')](_0x66da25[_0xe309('0x53')]['channel'],_0x66da25['body'][_0xe309('0x47')]);_0x66da25[_0xe309('0x53')][_0xe309('0x5d')]=integrations[_0xe309('0x5e')](_0x66da25[_0xe309('0x53')][_0xe309('0x5f')],_0x66da25['body'][_0xe309('0x47')]);return db['FreshdeskConfiguration'][_0xe309('0x52')](_0x66da25[_0xe309('0x53')],{'include':[{'model':db['FreshdeskField'],'as':_0xe309('0x5b')},{'model':db[_0xe309('0x60')],'as':_0xe309('0x5d')}]});}return null;})[_0xe309('0x33')](respondWithResult(_0x4c8c4b,null))[_0xe309('0x27')](handleError(_0x4c8c4b,null));};exports[_0xe309('0x61')]=function(_0x5addf4,_0x3efe2f,_0xbfacce){var _0x6e84f3='';return db['FreshdeskAccount'][_0xe309('0x56')]({'where':{'id':_0x5addf4[_0xe309('0x50')]['id']},'attributes':['id',_0xe309('0x62'),_0xe309('0x63')]})['then'](handleEntityNotFound(_0x3efe2f,null))[_0xe309('0x33')](function(_0x4a59da){if(_0x4a59da){_0x6e84f3=_0x4a59da[_0xe309('0x62')];var _0x2fa6be=_0x6e84f3[_0xe309('0x64')](-0x1);if(_0x2fa6be==='/'){_0x6e84f3=_0x6e84f3[_0xe309('0x65')](0x0,_0x6e84f3[_0xe309('0x66')](_0x2fa6be));}return rp({'method':_0xe309('0x67'),'uri':util[_0xe309('0x68')]('%s/%s',_0x6e84f3,_0xe309('0x69')),'headers':{'Authorization':util[_0xe309('0x68')](_0xe309('0x6a'),new Buffer(util['format'](_0xe309('0x6b'),_0x4a59da['apiKey']))[_0xe309('0x6c')](_0xe309('0x6d')))},'json':!![]});}})[_0xe309('0x33')](function(_0x127e61){if(_0x127e61){var _0x390ed7=[_0xe309('0x6e'),_0xe309('0x6f'),'agent',_0xe309('0x70'),_0xe309('0x29'),_0xe309('0x71'),'group',_0xe309('0x72'),_0xe309('0x73'),_0xe309('0x74'),_0xe309('0x75')];_[_0xe309('0x76')](_0x127e61,function(_0x15dcd5){return _0x390ed7[_0xe309('0x77')](_0x15dcd5[_0xe309('0x35')])||!_0x15dcd5['default']&&_0x15dcd5[_0xe309('0x47')]!==_0xe309('0x78')&&_0x15dcd5[_0xe309('0x47')]!==_0xe309('0x79');});return{'count':_0x127e61['length'],'rows':_[_0xe309('0x46')](_0x127e61,function(_0x27f45f){return{'id':_0x27f45f[_0xe309('0x35')],'name':_0x27f45f[_0xe309('0x7a')],'custom':!_0x27f45f[_0xe309('0x7b')],'options':_0x27f45f[_0xe309('0x7c')]?_[_0xe309('0x46')](_0x27f45f[_0xe309('0x7c')],function(_0x446255){return{'name':_[_0xe309('0x7d')](_0x446255),'value':_0x446255};}):[]};})};}})['then'](respondWithResult(_0x3efe2f,null))[_0xe309('0x27')](function(_0x23004b){var _0x1c6b5d=_0x5addf4[_0xe309('0x3a')]['test']?0x1f4:_0x23004b[_0xe309('0x7e')]||0x1f4;logger[_0xe309('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xe309('0x61'),_0x1c6b5d,JSON['stringify'](_0x23004b));delete _0x23004b[_0xe309('0x35')];if(_0x1c6b5d===0x191){_0x1c6b5d=0x190;}_0x3efe2f['status'](_0x1c6b5d)['send'](_0x5addf4['query'][_0xe309('0x1b')]?{'message':_0xe309('0x7f'),'statusCode':_0x23004b['statusCode']}:_0x23004b);});}; \ No newline at end of file +var _0xfbc0=['include','rows','show','intersection','find','create','body','update','getConfigurations','findOne','params','FreshdeskConfiguration','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','group','source','includes','custom_text','custom_dropdown','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','limit','Content-Range','apply','save','destroy','name','send','index','FreshdeskAccount','keys','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll'];(function(_0x3635d8,_0x18378c){var _0x4d3982=function(_0x351823){while(--_0x351823){_0x3635d8['push'](_0x3635d8['shift']());}};_0x4d3982(++_0x18378c);}(_0xfbc0,0xa2));var _0x0fbc=function(_0x508f76,_0x497123){_0x508f76=_0x508f76-0x0;var _0xe40eb7=_0xfbc0[_0x508f76];return _0xe40eb7;};'use strict';var pdf=require(_0x0fbc('0x0'));var emlformat=require(_0x0fbc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0fbc('0x2'));var jsonpatch=require(_0x0fbc('0x3'));var rp=require('request-promise');var moment=require(_0x0fbc('0x4'));var BPromise=require(_0x0fbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0fbc('0x6'));var sox=require(_0x0fbc('0x7'));var csv=require(_0x0fbc('0x8'));var ejs=require(_0x0fbc('0x9'));var fs=require('fs');var _=require(_0x0fbc('0xa'));var squel=require('squel');var crypto=require(_0x0fbc('0xb'));var jsforce=require(_0x0fbc('0xc'));var deskjs=require(_0x0fbc('0xd'));var toCsv=require(_0x0fbc('0x8'));var querystring=require(_0x0fbc('0xe'));var Papa=require(_0x0fbc('0xf'));var Redis=require('ioredis');var authService=require(_0x0fbc('0x10'));var qs=require(_0x0fbc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fbc('0x12'))(_0x0fbc('0x13'));var utils=require(_0x0fbc('0x14'));var config=require(_0x0fbc('0x15'));var db=require(_0x0fbc('0x16'))['db'];var integrations=require(_0x0fbc('0x17'));var jayson=require(_0x0fbc('0x18'));var client=jayson[_0x0fbc('0x19')][_0x0fbc('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x29a134,_0x4a452c,_0x2879d5){if(_0x2879d5){var _0x127213=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x127213['test'](_0x4a452c)){return _0x29a134;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x29a134;}}function respondWithRpcPromise(_0x31cf72,_0x1d8a0a,_0x4cca7c,_0x4018b4){return new BPromise(function(_0x49751e,_0x2afa37){var _0x2d8501=_0x4018b4||client;return _0x2d8501[_0x0fbc('0x1b')](_0x31cf72,_0x4cca7c)[_0x0fbc('0x1c')](function(_0x450a2f){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x1d8a0a,_0x0fbc('0x1d'));logger['debug'](_0x0fbc('0x1e'),_0x1d8a0a,'request\x20sent',JSON[_0x0fbc('0x1f')](_0x450a2f));if(_0x450a2f[_0x0fbc('0x20')]){if(_0x450a2f[_0x0fbc('0x20')]['code']===0x1f4){logger[_0x0fbc('0x20')](_0x0fbc('0x21'),_0x1d8a0a,_0x450a2f[_0x0fbc('0x20')][_0x0fbc('0x22')]);return _0x2afa37(_0x450a2f[_0x0fbc('0x20')][_0x0fbc('0x22')]);}logger[_0x0fbc('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x1d8a0a,_0x450a2f['error'][_0x0fbc('0x22')]);return _0x49751e(_0x450a2f['error']['message']);}else{logger[_0x0fbc('0x23')](_0x0fbc('0x21'),_0x1d8a0a,_0x0fbc('0x1d'));_0x49751e(_0x450a2f[_0x0fbc('0x24')][_0x0fbc('0x22')]);}})[_0x0fbc('0x25')](function(_0x174f71){logger['error'](_0x0fbc('0x21'),_0x1d8a0a,_0x174f71);_0x2afa37(_0x174f71);});});}function respondWithStatusCode(_0x9dc332,_0x5f1b33){_0x5f1b33=_0x5f1b33||0xcc;return function(_0x30a255){if(_0x30a255){return _0x9dc332[_0x0fbc('0x26')](_0x5f1b33);}return _0x9dc332[_0x0fbc('0x27')](_0x5f1b33)[_0x0fbc('0x28')]();};}function respondWithResult(_0x9d369c,_0x233485){_0x233485=_0x233485||0xc8;return function(_0x242d90){if(_0x242d90){return _0x9d369c[_0x0fbc('0x27')](_0x233485)['json'](_0x242d90);}};}function respondWithFilteredResult(_0x3821d9,_0x570c97){return function(_0x43cfbc){if(_0x43cfbc){var _0x2bffd0=_0x43cfbc['count'],_0x246c42=_0x570c97[_0x0fbc('0x29')],_0xde61e6=_0x570c97[_0x0fbc('0x29')]+_0x570c97[_0x0fbc('0x2a')],_0x4dee51;if(_0xde61e6>=_0x2bffd0){_0xde61e6=_0x2bffd0;_0x4dee51=0xc8;}else{_0x4dee51=0xce;}_0x3821d9['status'](_0x4dee51);return _0x3821d9['set'](_0x0fbc('0x2b'),_0x246c42+'-'+_0xde61e6+'/'+_0x2bffd0)['json'](_0x43cfbc);}return null;};}function patchUpdates(_0x442d0b){return function(_0x5e36e1){try{jsonpatch[_0x0fbc('0x2c')](_0x5e36e1,_0x442d0b,!![]);}catch(_0x1317e6){return BPromise['reject'](_0x1317e6);}return _0x5e36e1[_0x0fbc('0x2d')]();};}function saveUpdates(_0x1db254,_0x2d04e3){return function(_0x56392d){if(_0x56392d){return _0x56392d['update'](_0x1db254)[_0x0fbc('0x1c')](function(_0xd8f77e){return _0xd8f77e;});}return null;};}function removeEntity(_0x4e2c52,_0x386b4f){return function(_0x24544c){if(_0x24544c){return _0x24544c[_0x0fbc('0x2e')]()[_0x0fbc('0x1c')](function(){_0x4e2c52['status'](0xcc)[_0x0fbc('0x28')]();});}};}function handleEntityNotFound(_0x101b20,_0x5e08e7){return function(_0x9d662){if(!_0x9d662){_0x101b20[_0x0fbc('0x26')](0x194);}return _0x9d662;};}function handleError(_0x2a5521,_0x5f3d1e){_0x5f3d1e=_0x5f3d1e||0x1f4;return function(_0x40172b){logger['error'](_0x40172b['stack']);if(_0x40172b[_0x0fbc('0x2f')]){delete _0x40172b[_0x0fbc('0x2f')];}_0x2a5521[_0x0fbc('0x27')](_0x5f3d1e)[_0x0fbc('0x30')](_0x40172b);};}exports[_0x0fbc('0x31')]=function(_0x1ff65d,_0x5132a4){var _0x32b3c4={},_0x7e75ad={},_0x4619a5={'count':0x0,'rows':[]};var _0x167263=db[_0x0fbc('0x32')]['rawAttributes'];_0x7e75ad['model']=_[_0x0fbc('0x33')](_0x167263);_0x7e75ad[_0x0fbc('0x34')]=_['keys'](_0x1ff65d[_0x0fbc('0x34')]);_0x7e75ad['filters']=_['intersection'](_0x7e75ad[_0x0fbc('0x35')],_0x7e75ad['query']);_0x32b3c4[_0x0fbc('0x36')]=_['intersection'](_0x7e75ad['model'],qs[_0x0fbc('0x37')](_0x1ff65d[_0x0fbc('0x34')][_0x0fbc('0x37')]));_0x32b3c4[_0x0fbc('0x36')]=_0x32b3c4[_0x0fbc('0x36')][_0x0fbc('0x38')]?_0x32b3c4[_0x0fbc('0x36')]:_0x7e75ad[_0x0fbc('0x35')];if(!_0x1ff65d[_0x0fbc('0x34')][_0x0fbc('0x39')](_0x0fbc('0x3a'))){_0x32b3c4[_0x0fbc('0x2a')]=qs['limit'](_0x1ff65d[_0x0fbc('0x34')][_0x0fbc('0x2a')]);_0x32b3c4[_0x0fbc('0x29')]=qs['offset'](_0x1ff65d[_0x0fbc('0x34')]['offset']);}_0x32b3c4[_0x0fbc('0x3b')]=qs[_0x0fbc('0x3c')](_0x1ff65d[_0x0fbc('0x34')][_0x0fbc('0x3c')]);_0x32b3c4[_0x0fbc('0x3d')]=qs[_0x0fbc('0x3e')](_[_0x0fbc('0x3f')](_0x1ff65d[_0x0fbc('0x34')],_0x7e75ad['filters']));if(_0x1ff65d[_0x0fbc('0x34')]['filter']){_0x32b3c4[_0x0fbc('0x3d')]=_[_0x0fbc('0x40')](_0x32b3c4[_0x0fbc('0x3d')],{'$or':_[_0x0fbc('0x41')](_0x167263,function(_0x4f4e8f){if(_0x4f4e8f[_0x0fbc('0x42')][_0x0fbc('0x43')]!==_0x0fbc('0x44')){var _0x33b9ed={};_0x33b9ed[_0x4f4e8f[_0x0fbc('0x45')]]={'$like':'%'+_0x1ff65d[_0x0fbc('0x34')][_0x0fbc('0x46')]+'%'};return _0x33b9ed;}})});}_0x32b3c4=_[_0x0fbc('0x40')]({},_0x32b3c4,_0x1ff65d[_0x0fbc('0x47')]);var _0x427ab2={'where':_0x32b3c4['where']};return db['FreshdeskAccount'][_0x0fbc('0x48')](_0x427ab2)[_0x0fbc('0x1c')](function(_0x4e9d10){_0x4619a5['count']=_0x4e9d10;if(_0x1ff65d['query'][_0x0fbc('0x49')]){_0x32b3c4[_0x0fbc('0x4a')]=[{'all':!![]}];}return db[_0x0fbc('0x32')]['findAll'](_0x32b3c4);})[_0x0fbc('0x1c')](function(_0x2f4892){_0x4619a5[_0x0fbc('0x4b')]=_0x2f4892;return _0x4619a5;})['then'](respondWithFilteredResult(_0x5132a4,_0x32b3c4))['catch'](handleError(_0x5132a4,null));};exports[_0x0fbc('0x4c')]=function(_0x42de43,_0x22cfee){var _0x32e44a={'raw':![],'where':{'id':_0x42de43['params']['id']}},_0x2a9259={};_0x2a9259[_0x0fbc('0x35')]=_[_0x0fbc('0x33')](db['FreshdeskAccount']['rawAttributes']);_0x2a9259[_0x0fbc('0x34')]=_[_0x0fbc('0x33')](_0x42de43[_0x0fbc('0x34')]);_0x2a9259[_0x0fbc('0x3e')]=_[_0x0fbc('0x4d')](_0x2a9259['model'],_0x2a9259['query']);_0x32e44a[_0x0fbc('0x36')]=_[_0x0fbc('0x4d')](_0x2a9259[_0x0fbc('0x35')],qs[_0x0fbc('0x37')](_0x42de43[_0x0fbc('0x34')][_0x0fbc('0x37')]));_0x32e44a['attributes']=_0x32e44a['attributes'][_0x0fbc('0x38')]?_0x32e44a[_0x0fbc('0x36')]:_0x2a9259[_0x0fbc('0x35')];if(_0x42de43['query'][_0x0fbc('0x49')]){_0x32e44a[_0x0fbc('0x4a')]=[{'all':!![]}];}_0x32e44a=_[_0x0fbc('0x40')]({},_0x32e44a,_0x42de43[_0x0fbc('0x47')]);return db['FreshdeskAccount'][_0x0fbc('0x4e')](_0x32e44a)[_0x0fbc('0x1c')](handleEntityNotFound(_0x22cfee,null))['then'](respondWithResult(_0x22cfee,null))[_0x0fbc('0x25')](handleError(_0x22cfee,null));};exports['create']=function(_0xff281b,_0x44e637){return db[_0x0fbc('0x32')][_0x0fbc('0x4f')](_0xff281b[_0x0fbc('0x50')],{})['then'](respondWithResult(_0x44e637,0xc9))[_0x0fbc('0x25')](handleError(_0x44e637,null));};exports[_0x0fbc('0x51')]=function(_0x337030,_0x3a0c34){if(_0x337030[_0x0fbc('0x50')]['id']){delete _0x337030['body']['id'];}return db['FreshdeskAccount'][_0x0fbc('0x4e')]({'where':{'id':_0x337030['params']['id']}})[_0x0fbc('0x1c')](handleEntityNotFound(_0x3a0c34,null))[_0x0fbc('0x1c')](saveUpdates(_0x337030[_0x0fbc('0x50')],null))[_0x0fbc('0x1c')](respondWithResult(_0x3a0c34,null))[_0x0fbc('0x25')](handleError(_0x3a0c34,null));};exports[_0x0fbc('0x2e')]=function(_0x57a7dc,_0x2cd8f2){return db[_0x0fbc('0x32')][_0x0fbc('0x4e')]({'where':{'id':_0x57a7dc['params']['id']}})['then'](handleEntityNotFound(_0x2cd8f2,null))['then'](removeEntity(_0x2cd8f2,null))[_0x0fbc('0x25')](handleError(_0x2cd8f2,null));};exports[_0x0fbc('0x52')]=function(_0x1be990,_0x2a1e49,_0x56f23a){var _0x3ea4c6={};var _0x4fdb85={};var _0xa880e1;var _0x5b10f1;return db[_0x0fbc('0x32')][_0x0fbc('0x53')]({'where':{'id':_0x1be990[_0x0fbc('0x54')]['id']}})[_0x0fbc('0x1c')](handleEntityNotFound(_0x2a1e49,null))[_0x0fbc('0x1c')](function(_0x3213c9){if(_0x3213c9){_0xa880e1=_0x3213c9;_0x4fdb85['model']=_[_0x0fbc('0x33')](db[_0x0fbc('0x55')][_0x0fbc('0x56')]);_0x4fdb85[_0x0fbc('0x34')]=_[_0x0fbc('0x33')](_0x1be990[_0x0fbc('0x34')]);_0x4fdb85[_0x0fbc('0x3e')]=_['intersection'](_0x4fdb85['model'],_0x4fdb85[_0x0fbc('0x34')]);_0x3ea4c6[_0x0fbc('0x36')]=_[_0x0fbc('0x4d')](_0x4fdb85['model'],qs['fields'](_0x1be990[_0x0fbc('0x34')][_0x0fbc('0x37')]));_0x3ea4c6[_0x0fbc('0x36')]=_0x3ea4c6['attributes'][_0x0fbc('0x38')]?_0x3ea4c6['attributes']:_0x4fdb85['model'];_0x3ea4c6[_0x0fbc('0x3b')]=qs['sort'](_0x1be990['query'][_0x0fbc('0x3c')]);_0x3ea4c6[_0x0fbc('0x3d')]=qs['filters'](_[_0x0fbc('0x3f')](_0x1be990[_0x0fbc('0x34')],_0x4fdb85[_0x0fbc('0x3e')]));if(_0x1be990['query'][_0x0fbc('0x46')]){_0x3ea4c6[_0x0fbc('0x3d')]=_[_0x0fbc('0x40')](_0x3ea4c6[_0x0fbc('0x3d')],{'$or':_[_0x0fbc('0x41')](_0x3ea4c6[_0x0fbc('0x36')],function(_0x55d08c){var _0x30e69d={};_0x30e69d[_0x55d08c]={'$like':'%'+_0x1be990['query']['filter']+'%'};return _0x30e69d;})});}_0x3ea4c6=_['merge']({},_0x3ea4c6,_0x1be990[_0x0fbc('0x47')]);return _0xa880e1[_0x0fbc('0x52')](_0x3ea4c6);}})[_0x0fbc('0x1c')](function(_0x2ed9d1){if(_0x2ed9d1){_0x5b10f1=_0x2ed9d1[_0x0fbc('0x38')];if(!_0x1be990[_0x0fbc('0x34')][_0x0fbc('0x39')](_0x0fbc('0x3a'))){_0x3ea4c6['limit']=qs[_0x0fbc('0x2a')](_0x1be990[_0x0fbc('0x34')][_0x0fbc('0x2a')]);_0x3ea4c6[_0x0fbc('0x29')]=qs[_0x0fbc('0x29')](_0x1be990[_0x0fbc('0x34')][_0x0fbc('0x29')]);}return _0xa880e1[_0x0fbc('0x52')](_0x3ea4c6);}})[_0x0fbc('0x1c')](function(_0x48053d){if(_0x48053d){return _0x48053d?{'count':_0x5b10f1,'rows':_0x48053d}:null;}})['then'](respondWithResult(_0x2a1e49,null))[_0x0fbc('0x25')](handleError(_0x2a1e49,null));};exports[_0x0fbc('0x57')]=function(_0x4544f0,_0x33b670,_0x517fb3){if(_0x4544f0[_0x0fbc('0x50')]['id']){delete _0x4544f0[_0x0fbc('0x50')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x4544f0[_0x0fbc('0x54')]['id']}})['then'](handleEntityNotFound(_0x33b670,null))[_0x0fbc('0x1c')](function(_0x5d28dc){if(_0x5d28dc){_0x4544f0[_0x0fbc('0x50')][_0x0fbc('0x58')]=_0x5d28dc['id'];_0x4544f0[_0x0fbc('0x50')][_0x0fbc('0x59')]=integrations[_0x0fbc('0x5a')](_0x4544f0[_0x0fbc('0x50')][_0x0fbc('0x5b')],_0x4544f0[_0x0fbc('0x50')]['type']);_0x4544f0[_0x0fbc('0x50')][_0x0fbc('0x5c')]=integrations['getDescriptions'](_0x4544f0['body'][_0x0fbc('0x5b')],_0x4544f0[_0x0fbc('0x50')][_0x0fbc('0x42')]);return db[_0x0fbc('0x55')][_0x0fbc('0x4f')](_0x4544f0[_0x0fbc('0x50')],{'include':[{'model':db[_0x0fbc('0x5d')],'as':_0x0fbc('0x59')},{'model':db[_0x0fbc('0x5d')],'as':_0x0fbc('0x5c')}]});}return null;})[_0x0fbc('0x1c')](respondWithResult(_0x33b670,null))[_0x0fbc('0x25')](handleError(_0x33b670,null));};exports[_0x0fbc('0x5e')]=function(_0xbaeb9a,_0x11b369,_0x5ce1df){var _0x555214='';return db[_0x0fbc('0x32')]['findOne']({'where':{'id':_0xbaeb9a[_0x0fbc('0x54')]['id']},'attributes':['id',_0x0fbc('0x5f'),_0x0fbc('0x60')]})[_0x0fbc('0x1c')](handleEntityNotFound(_0x11b369,null))[_0x0fbc('0x1c')](function(_0xc73756){if(_0xc73756){_0x555214=_0xc73756[_0x0fbc('0x5f')];var _0x586b63=_0x555214['slice'](-0x1);if(_0x586b63==='/'){_0x555214=_0x555214[_0x0fbc('0x61')](0x0,_0x555214[_0x0fbc('0x62')](_0x586b63));}return rp({'method':_0x0fbc('0x63'),'uri':util['format']('%s/%s',_0x555214,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x0fbc('0x64')](_0x0fbc('0x65'),new Buffer(util[_0x0fbc('0x64')](_0x0fbc('0x66'),_0xc73756['apiKey']))[_0x0fbc('0x67')](_0x0fbc('0x68')))},'json':!![]});}})['then'](function(_0xe66a64){if(_0xe66a64){var _0x1cd199=[_0x0fbc('0x69'),_0x0fbc('0x6a'),_0x0fbc('0x6b'),'description',_0x0fbc('0x27'),'priority',_0x0fbc('0x6c'),_0x0fbc('0x6d'),'ticket_type',_0x0fbc('0x6c'),'company'];_['remove'](_0xe66a64,function(_0x4dd8e0){return _0x1cd199[_0x0fbc('0x6e')](_0x4dd8e0[_0x0fbc('0x2f')])||!_0x4dd8e0['default']&&_0x4dd8e0[_0x0fbc('0x42')]!==_0x0fbc('0x6f')&&_0x4dd8e0['type']!==_0x0fbc('0x70');});return{'count':_0xe66a64['length'],'rows':_[_0x0fbc('0x41')](_0xe66a64,function(_0x2597e3){return{'id':_0x2597e3[_0x0fbc('0x2f')],'name':_0x2597e3['label'],'custom':!_0x2597e3['default'],'options':_0x2597e3[_0x0fbc('0x71')]?_[_0x0fbc('0x41')](_0x2597e3[_0x0fbc('0x71')],function(_0x4da7bf){return{'name':_[_0x0fbc('0x72')](_0x4da7bf),'value':_0x4da7bf};}):[]};})};}})[_0x0fbc('0x1c')](respondWithResult(_0x11b369,null))['catch'](function(_0x2fa538){var _0x492852=_0xbaeb9a[_0x0fbc('0x34')][_0x0fbc('0x73')]?0x1f4:_0x2fa538['statusCode']||0x1f4;logger['error'](_0x0fbc('0x74'),_0x0fbc('0x5e'),_0x492852,JSON[_0x0fbc('0x1f')](_0x2fa538));delete _0x2fa538[_0x0fbc('0x2f')];if(_0x492852===0x191){_0x492852=0x190;}_0x11b369[_0x0fbc('0x27')](_0x492852)[_0x0fbc('0x30')](_0xbaeb9a['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2fa538[_0x0fbc('0x75')]}:_0x2fa538);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index cc3f52f..e99cd15 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 _0x29a3=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x29a3,0x12b));var _0x329a=function(_0x25c524,_0x590cd6){_0x25c524=_0x25c524-0x0;var _0x496c5b=_0x29a3[_0x25c524];return _0x496c5b;};'use strict';var _=require(_0x329a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x329a('0x1'));var moment=require(_0x329a('0x2'));var BPromise=require(_0x329a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x329a('0x4'));var rimraf=require(_0x329a('0x5'));var config=require(_0x329a('0x6'));var attributes=require(_0x329a('0x7'));var integrations=require(_0x329a('0x8'));module[_0x329a('0x9')]=function(_0x21aac9,_0x404111){return _0x21aac9[_0x329a('0xa')](_0x329a('0xb'),attributes,{'tableName':_0x329a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c29=['int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount'];(function(_0x3a604a,_0x1b5e07){var _0xde7ac9=function(_0x46e8e3){while(--_0x46e8e3){_0x3a604a['push'](_0x3a604a['shift']());}};_0xde7ac9(++_0x1b5e07);}(_0x1c29,0x121));var _0x91c2=function(_0x3ad178,_0x1154fe){_0x3ad178=_0x3ad178-0x0;var _0x14f691=_0x1c29[_0x3ad178];return _0x14f691;};'use strict';var _=require(_0x91c2('0x0'));var util=require(_0x91c2('0x1'));var logger=require(_0x91c2('0x2'))(_0x91c2('0x3'));var moment=require('moment');var BPromise=require(_0x91c2('0x4'));var rp=require(_0x91c2('0x5'));var fs=require('fs');var path=require(_0x91c2('0x6'));var rimraf=require('rimraf');var config=require(_0x91c2('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x91c2('0x8'));module['exports']=function(_0x3f87fa,_0x2ebdd0){return _0x3f87fa[_0x91c2('0x9')](_0x91c2('0xa'),attributes,{'tableName':_0x91c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index bb9a7fb..e1fce14 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 _0xbf62=['request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','model','map','attributes','catch','ShowFreshdeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xbf62,0x1a5));var _0x2bf6=function(_0xb4ce16,_0x2bd30c){_0xb4ce16=_0xb4ce16-0x0;var _0x14055c=_0xbf62[_0xb4ce16];return _0x14055c;};'use strict';var _=require(_0x2bf6('0x0'));var util=require(_0x2bf6('0x1'));var moment=require(_0x2bf6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bf6('0x3'));var db=require(_0x2bf6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2bf6('0x5'));var config=require('../../config/environment');var jayson=require(_0x2bf6('0x6'));var client=jayson[_0x2bf6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb432,_0x4f634d,_0x578e52){return new BPromise(function(_0x2e5582,_0x4cf23f){return client[_0x2bf6('0x8')](_0x1bb432,_0x578e52)[_0x2bf6('0x9')](function(_0x18d0af){logger[_0x2bf6('0xa')](_0x2bf6('0xb'),_0x4f634d,_0x2bf6('0xc'));logger[_0x2bf6('0xd')](_0x2bf6('0xe'),_0x4f634d,_0x2bf6('0xc'),JSON[_0x2bf6('0xf')](_0x18d0af));if(_0x18d0af['error']){if(_0x18d0af[_0x2bf6('0x10')][_0x2bf6('0x11')]===0x1f4){logger[_0x2bf6('0x10')](_0x2bf6('0xb'),_0x4f634d,_0x18d0af['error'][_0x2bf6('0x12')]);return _0x4cf23f(_0x18d0af[_0x2bf6('0x10')][_0x2bf6('0x12')]);}logger['error'](_0x2bf6('0xb'),_0x4f634d,_0x18d0af[_0x2bf6('0x10')][_0x2bf6('0x12')]);return _0x2e5582(_0x18d0af['error'][_0x2bf6('0x12')]);}else{logger[_0x2bf6('0xa')](_0x2bf6('0xb'),_0x4f634d,_0x2bf6('0xc'));_0x2e5582(_0x18d0af['result']['message']);}})['catch'](function(_0x32d688){logger['error'](_0x2bf6('0xb'),_0x4f634d,_0x32d688);_0x4cf23f(_0x32d688);});});}exports[_0x2bf6('0x13')]=function(_0x186001){var _0x427eca=this;return new Promise(function(_0x5b212b,_0x54db15){return db[_0x2bf6('0x14')][_0x2bf6('0x15')]({'raw':_0x186001[_0x2bf6('0x16')]?_0x186001[_0x2bf6('0x16')][_0x2bf6('0x17')]===undefined?!![]:![]:!![],'where':_0x186001['options']?_0x186001[_0x2bf6('0x16')][_0x2bf6('0x18')]||null:null,'attributes':_0x186001[_0x2bf6('0x16')]?_0x186001['options']['attributes']||null:null,'limit':_0x186001[_0x2bf6('0x16')]?_0x186001[_0x2bf6('0x16')][_0x2bf6('0x19')]||null:null,'include':_0x186001['options']?_0x186001['options'][_0x2bf6('0x1a')]?_['map'](_0x186001[_0x2bf6('0x16')][_0x2bf6('0x1a')],function(_0x9a515f){return{'model':db[_0x9a515f[_0x2bf6('0x1b')]],'as':_0x9a515f['as'],'attributes':_0x9a515f['attributes'],'include':_0x9a515f[_0x2bf6('0x1a')]?_[_0x2bf6('0x1c')](_0x9a515f[_0x2bf6('0x1a')],function(_0x16e22c){return{'model':db[_0x16e22c[_0x2bf6('0x1b')]],'as':_0x16e22c['as'],'attributes':_0x16e22c[_0x2bf6('0x1d')],'include':_0x16e22c[_0x2bf6('0x1a')]?_[_0x2bf6('0x1c')](_0x16e22c[_0x2bf6('0x1a')],function(_0x6065a2){return{'model':db[_0x6065a2['model']],'as':_0x6065a2['as'],'attributes':_0x6065a2[_0x2bf6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2bf6('0x9')](function(_0x51cd4c){logger[_0x2bf6('0xa')](_0x2bf6('0x13'),_0x186001);logger['debug'](_0x2bf6('0x13'),_0x186001,JSON['stringify'](_0x51cd4c));_0x5b212b(_0x51cd4c);})[_0x2bf6('0x1e')](function(_0x55732a){logger[_0x2bf6('0x10')](_0x2bf6('0x13'),_0x55732a[_0x2bf6('0x12')],_0x186001);_0x54db15(_0x427eca[_0x2bf6('0x10')](0x1f4,_0x55732a['message']));});});};exports[_0x2bf6('0x1f')]=function(_0x4e940f){var _0x420228=this;return new Promise(function(_0x57984b,_0x3c1374){return db[_0x2bf6('0x14')][_0x2bf6('0x20')]({'raw':_0x4e940f[_0x2bf6('0x16')]?_0x4e940f[_0x2bf6('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4e940f[_0x2bf6('0x16')]?_0x4e940f[_0x2bf6('0x16')][_0x2bf6('0x18')]||null:null,'attributes':_0x4e940f[_0x2bf6('0x16')]?_0x4e940f[_0x2bf6('0x16')]['attributes']||null:null,'include':_0x4e940f['options']?_0x4e940f[_0x2bf6('0x16')][_0x2bf6('0x1a')]?_[_0x2bf6('0x1c')](_0x4e940f[_0x2bf6('0x16')][_0x2bf6('0x1a')],function(_0x119c1d){return{'model':db[_0x119c1d[_0x2bf6('0x1b')]],'as':_0x119c1d['as'],'attributes':_0x119c1d['attributes'],'include':_0x119c1d[_0x2bf6('0x1a')]?_[_0x2bf6('0x1c')](_0x119c1d['include'],function(_0x183665){return{'model':db[_0x183665[_0x2bf6('0x1b')]],'as':_0x183665['as'],'attributes':_0x183665[_0x2bf6('0x1d')],'include':_0x183665[_0x2bf6('0x1a')]?_[_0x2bf6('0x1c')](_0x183665[_0x2bf6('0x1a')],function(_0x5a27b6){return{'model':db[_0x5a27b6[_0x2bf6('0x1b')]],'as':_0x5a27b6['as'],'attributes':_0x5a27b6[_0x2bf6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2bf6('0x9')](function(_0x34a64b){logger[_0x2bf6('0xa')](_0x2bf6('0x1f'),_0x4e940f);logger[_0x2bf6('0xd')]('ShowFreshdeskAccount',_0x4e940f,JSON['stringify'](_0x34a64b));_0x57984b(_0x34a64b);})[_0x2bf6('0x1e')](function(_0x3dfac5){logger[_0x2bf6('0x10')](_0x2bf6('0x1f'),_0x3dfac5[_0x2bf6('0x12')],_0x4e940f);_0x3c1374(_0x420228[_0x2bf6('0x10')](0x1f4,_0x3dfac5[_0x2bf6('0x12')]));});});}; \ No newline at end of file +var _0x50d1=['../../config/logger','rpc','../../config/environment','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','info','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x39d306,_0x39d35b){var _0x552e79=function(_0x3a045e){while(--_0x3a045e){_0x39d306['push'](_0x39d306['shift']());}};_0x552e79(++_0x39d35b);}(_0x50d1,0x16e));var _0x150d=function(_0x5cc969,_0x355874){_0x5cc969=_0x5cc969-0x0;var _0x11ffad=_0x50d1[_0x5cc969];return _0x11ffad;};'use strict';var _=require(_0x150d('0x0'));var util=require(_0x150d('0x1'));var moment=require(_0x150d('0x2'));var BPromise=require(_0x150d('0x3'));var rs=require(_0x150d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x150d('0x5'));var logger=require(_0x150d('0x6'))(_0x150d('0x7'));var config=require(_0x150d('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x179afd,_0x3373c0,_0x4683bb){return new BPromise(function(_0x500a13,_0x216cf3){return client[_0x150d('0x9')](_0x179afd,_0x4683bb)[_0x150d('0xa')](function(_0x4fef49){logger['info'](_0x150d('0xb'),_0x3373c0,_0x150d('0xc'));logger[_0x150d('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3373c0,_0x150d('0xc'),JSON['stringify'](_0x4fef49));if(_0x4fef49['error']){if(_0x4fef49[_0x150d('0xe')][_0x150d('0xf')]===0x1f4){logger['error'](_0x150d('0xb'),_0x3373c0,_0x4fef49[_0x150d('0xe')]['message']);return _0x216cf3(_0x4fef49[_0x150d('0xe')]['message']);}logger[_0x150d('0xe')](_0x150d('0xb'),_0x3373c0,_0x4fef49['error']['message']);return _0x500a13(_0x4fef49[_0x150d('0xe')][_0x150d('0x10')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x3373c0,'request\x20sent');_0x500a13(_0x4fef49['result']['message']);}})['catch'](function(_0x4381db){logger[_0x150d('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3373c0,_0x4381db);_0x216cf3(_0x4381db);});});}exports[_0x150d('0x11')]=function(_0x45c941){var _0x13d5f1=this;return new Promise(function(_0x35c7c7,_0x12ae66){return db[_0x150d('0x12')][_0x150d('0x13')]({'raw':_0x45c941[_0x150d('0x14')]?_0x45c941[_0x150d('0x14')][_0x150d('0x15')]===undefined?!![]:![]:!![],'where':_0x45c941['options']?_0x45c941[_0x150d('0x14')][_0x150d('0x16')]||null:null,'attributes':_0x45c941[_0x150d('0x14')]?_0x45c941['options'][_0x150d('0x17')]||null:null,'limit':_0x45c941[_0x150d('0x14')]?_0x45c941[_0x150d('0x14')]['limit']||null:null,'include':_0x45c941[_0x150d('0x14')]?_0x45c941[_0x150d('0x14')][_0x150d('0x18')]?_[_0x150d('0x19')](_0x45c941[_0x150d('0x14')][_0x150d('0x18')],function(_0x628d84){return{'model':db[_0x628d84[_0x150d('0x1a')]],'as':_0x628d84['as'],'attributes':_0x628d84[_0x150d('0x17')],'include':_0x628d84['include']?_[_0x150d('0x19')](_0x628d84[_0x150d('0x18')],function(_0x218ce8){return{'model':db[_0x218ce8[_0x150d('0x1a')]],'as':_0x218ce8['as'],'attributes':_0x218ce8['attributes'],'include':_0x218ce8[_0x150d('0x18')]?_['map'](_0x218ce8['include'],function(_0x3598fd){return{'model':db[_0x3598fd[_0x150d('0x1a')]],'as':_0x3598fd['as'],'attributes':_0x3598fd[_0x150d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14dff8){logger[_0x150d('0x1b')](_0x150d('0x11'),_0x45c941);logger[_0x150d('0xd')](_0x150d('0x11'),_0x45c941,JSON['stringify'](_0x14dff8));_0x35c7c7(_0x14dff8);})[_0x150d('0x1c')](function(_0x587127){logger[_0x150d('0xe')](_0x150d('0x11'),_0x587127['message'],_0x45c941);_0x12ae66(_0x13d5f1[_0x150d('0xe')](0x1f4,_0x587127[_0x150d('0x10')]));});});};exports[_0x150d('0x1d')]=function(_0x4e2f02){var _0x14d16b=this;return new Promise(function(_0x1e293b,_0x3dae83){return db[_0x150d('0x12')][_0x150d('0x1e')]({'raw':_0x4e2f02['options']?_0x4e2f02[_0x150d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4e2f02['options']?_0x4e2f02['options'][_0x150d('0x16')]||null:null,'attributes':_0x4e2f02[_0x150d('0x14')]?_0x4e2f02['options'][_0x150d('0x17')]||null:null,'include':_0x4e2f02[_0x150d('0x14')]?_0x4e2f02['options'][_0x150d('0x18')]?_[_0x150d('0x19')](_0x4e2f02[_0x150d('0x14')][_0x150d('0x18')],function(_0x147898){return{'model':db[_0x147898['model']],'as':_0x147898['as'],'attributes':_0x147898['attributes'],'include':_0x147898['include']?_[_0x150d('0x19')](_0x147898[_0x150d('0x18')],function(_0x3e050e){return{'model':db[_0x3e050e[_0x150d('0x1a')]],'as':_0x3e050e['as'],'attributes':_0x3e050e['attributes'],'include':_0x3e050e[_0x150d('0x18')]?_[_0x150d('0x19')](_0x3e050e[_0x150d('0x18')],function(_0x263626){return{'model':db[_0x263626[_0x150d('0x1a')]],'as':_0x263626['as'],'attributes':_0x263626[_0x150d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e75cd){logger[_0x150d('0x1b')]('ShowFreshdeskAccount',_0x4e2f02);logger[_0x150d('0xd')]('ShowFreshdeskAccount',_0x4e2f02,JSON['stringify'](_0x3e75cd));_0x1e293b(_0x3e75cd);})[_0x150d('0x1c')](function(_0x212e73){logger[_0x150d('0xe')]('ShowFreshdeskAccount',_0x212e73[_0x150d('0x10')],_0x4e2f02);_0x3dae83(_0x14d16b[_0x150d('0xe')](0x1f4,_0x212e73[_0x150d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 48c99e3..d7224c1 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 _0xcca7=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','setTags','put','/:id','update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x458d44,_0x45224c){var _0x5ac860=function(_0x31059e){while(--_0x31059e){_0x458d44['push'](_0x458d44['shift']());}};_0x5ac860(++_0x45224c);}(_0xcca7,0x1aa));var _0x7cca=function(_0x797f5c,_0x39f0db){_0x797f5c=_0x797f5c-0x0;var _0x9053f7=_0xcca7[_0x797f5c];return _0x9053f7;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7cca('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7cca('0x5'));var controller=require(_0x7cca('0x6'));router[_0x7cca('0x7')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0x9')]);router[_0x7cca('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7cca('0xa')]);router[_0x7cca('0x7')](_0x7cca('0xb'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xc')]);router[_0x7cca('0x7')](_0x7cca('0xd'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xe')]);router[_0x7cca('0x7')]('/:id/descriptions',auth[_0x7cca('0x8')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x7')](_0x7cca('0x10'),auth[_0x7cca('0x8')](),controller['getTags']);router[_0x7cca('0x11')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0x12')]);router['post']('/:id/tags',auth[_0x7cca('0x8')](),controller[_0x7cca('0x13')]);router[_0x7cca('0x14')](_0x7cca('0x15'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x16')]);router[_0x7cca('0x17')]('/:id',auth[_0x7cca('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x207c=['create','setTags','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post'];(function(_0x4d36ea,_0x301069){var _0xbf11e2=function(_0x3787c8){while(--_0x3787c8){_0x4d36ea['push'](_0x4d36ea['shift']());}};_0xbf11e2(++_0x301069);}(_0x207c,0x1e8));var _0xc207=function(_0x215e8e,_0x2e9b00){_0x215e8e=_0x215e8e-0x0;var _0x43ce3b=_0x207c[_0x215e8e];return _0x43ce3b;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['show']);router[_0xc207('0x8')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller['getFields']);router[_0xc207('0x8')](_0xc207('0xc'),auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0x8')](_0xc207('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xc207('0xf'),auth['isAuthenticated'](),controller[_0xc207('0x10')]);router[_0xc207('0x11')]('/',auth['isAuthenticated'](),controller[_0xc207('0x12')]);router[_0xc207('0x11')](_0xc207('0xf'),auth[_0xc207('0xa')](),controller[_0xc207('0x13')]);router['put'](_0xc207('0x9'),auth[_0xc207('0xa')](),controller[_0xc207('0x14')]);router[_0xc207('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc207('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 3daa171..e0a2532 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 _0x71c3=['exports','STRING','sequelize'];(function(_0x1a9957,_0x346fb1){var _0xf39d99=function(_0x438cb2){while(--_0x438cb2){_0x1a9957['push'](_0x1a9957['shift']());}};_0xf39d99(++_0x346fb1);}(_0x71c3,0x1d6));var _0x371c=function(_0x3da20c,_0x2c48be){_0x3da20c=_0x3da20c-0x0;var _0x50831e=_0x71c3[_0x3da20c];return _0x50831e;};'use strict';var Sequelize=require(_0x371c('0x0'));module[_0x371c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x371c('0x2')]}}; \ No newline at end of file +var _0x98ba=['exports','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x98ba,0x1d9));var _0xa98b=function(_0x595767,_0x1f97de){_0x595767=_0x595767-0x0;var _0x1123bb=_0x98ba[_0x595767];return _0x1123bb;};'use strict';var Sequelize=require(_0xa98b('0x0'));module[_0xa98b('0x1')]={'name':{'type':Sequelize[_0xa98b('0x2')]},'description':{'type':Sequelize[_0xa98b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f7cb9b4..f81acf4 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 _0x26b2=['merge','body','find','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','end','name','send','index','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','field','options','count','includeAll','FreshdeskConfiguration','findAll','rows','params','fields'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x26b2,0xc5));var _0x226b=function(_0x3d385a,_0x37bf08){_0x3d385a=_0x3d385a-0x0;var _0x1a495f=_0x26b2[_0x3d385a];return _0x1a495f;};'use strict';var pdf=require(_0x226b('0x0'));var emlformat=require(_0x226b('0x1'));var rimraf=require(_0x226b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x226b('0x3'));var rp=require(_0x226b('0x4'));var moment=require(_0x226b('0x5'));var BPromise=require(_0x226b('0x6'));var Mustache=require(_0x226b('0x7'));var util=require(_0x226b('0x8'));var path=require(_0x226b('0x9'));var sox=require(_0x226b('0xa'));var csv=require(_0x226b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x226b('0xc'));var squel=require('squel');var crypto=require(_0x226b('0xd'));var jsforce=require(_0x226b('0xe'));var deskjs=require(_0x226b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x226b('0x10'));var Redis=require(_0x226b('0x11'));var authService=require(_0x226b('0x12'));var qs=require(_0x226b('0x13'));var hardwareService=require(_0x226b('0x14'));var logger=require(_0x226b('0x15'))('api');var utils=require(_0x226b('0x16'));var config=require('../../config/environment');var db=require(_0x226b('0x17'))['db'];var jayson=require(_0x226b('0x18'));var client=jayson[_0x226b('0x19')][_0x226b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x21b041,_0x3781a8,_0x4e8ad7){if(_0x4e8ad7){var _0x22a82c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22a82c[_0x226b('0x1b')](_0x3781a8)){return _0x21b041;}else{throw new Error(_0x226b('0x1c'));}}else{return _0x21b041;}}function respondWithRpcPromise(_0x3a69b9,_0x4f86e8,_0x396f4a,_0x197d8e){return new BPromise(function(_0x1e83f8,_0x41cdf4){var _0x2a93f=_0x197d8e||client;return _0x2a93f[_0x226b('0x1d')](_0x3a69b9,_0x396f4a)['then'](function(_0x3c1e31){logger[_0x226b('0x1e')](_0x226b('0x1f'),_0x4f86e8,_0x226b('0x20'));logger[_0x226b('0x21')](_0x226b('0x22'),_0x4f86e8,_0x226b('0x20'),JSON['stringify'](_0x3c1e31));if(_0x3c1e31[_0x226b('0x23')]){if(_0x3c1e31[_0x226b('0x23')][_0x226b('0x24')]===0x1f4){logger['error'](_0x226b('0x1f'),_0x4f86e8,_0x3c1e31['error'][_0x226b('0x25')]);return _0x41cdf4(_0x3c1e31['error'][_0x226b('0x25')]);}logger[_0x226b('0x23')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4f86e8,_0x3c1e31[_0x226b('0x23')][_0x226b('0x25')]);return _0x1e83f8(_0x3c1e31[_0x226b('0x23')][_0x226b('0x25')]);}else{logger[_0x226b('0x1e')](_0x226b('0x1f'),_0x4f86e8,_0x226b('0x20'));_0x1e83f8(_0x3c1e31[_0x226b('0x26')][_0x226b('0x25')]);}})[_0x226b('0x27')](function(_0x8fbd85){logger[_0x226b('0x23')](_0x226b('0x1f'),_0x4f86e8,_0x8fbd85);_0x41cdf4(_0x8fbd85);});});}function respondWithStatusCode(_0x2a5c79,_0x286a38){_0x286a38=_0x286a38||0xcc;return function(_0x5555a9){if(_0x5555a9){return _0x2a5c79[_0x226b('0x28')](_0x286a38);}return _0x2a5c79[_0x226b('0x29')](_0x286a38)['end']();};}function respondWithResult(_0x1e2053,_0x4d8e1e){_0x4d8e1e=_0x4d8e1e||0xc8;return function(_0x2bb39d){if(_0x2bb39d){return _0x1e2053[_0x226b('0x29')](_0x4d8e1e)[_0x226b('0x2a')](_0x2bb39d);}};}function respondWithFilteredResult(_0x370d72,_0x2bc294){return function(_0x5b51e0){if(_0x5b51e0){var _0x42d4ed=_0x5b51e0['count'],_0xb9c059=_0x2bc294[_0x226b('0x2b')],_0x3799d9=_0x2bc294[_0x226b('0x2b')]+_0x2bc294[_0x226b('0x2c')],_0x37c0dd;if(_0x3799d9>=_0x42d4ed){_0x3799d9=_0x42d4ed;_0x37c0dd=0xc8;}else{_0x37c0dd=0xce;}_0x370d72[_0x226b('0x29')](_0x37c0dd);return _0x370d72['set'](_0x226b('0x2d'),_0xb9c059+'-'+_0x3799d9+'/'+_0x42d4ed)[_0x226b('0x2a')](_0x5b51e0);}return null;};}function patchUpdates(_0xfabd15){return function(_0x586c93){try{jsonpatch[_0x226b('0x2e')](_0x586c93,_0xfabd15,!![]);}catch(_0x353e8e){return BPromise[_0x226b('0x2f')](_0x353e8e);}return _0x586c93['save']();};}function saveUpdates(_0x27dcca,_0xd6f7bd){return function(_0x392efd){if(_0x392efd){return _0x392efd[_0x226b('0x30')](_0x27dcca)[_0x226b('0x31')](function(_0x3e04f5){return _0x3e04f5;});}return null;};}function removeEntity(_0x25f569,_0x1be4f7){return function(_0x46bec5){if(_0x46bec5){return _0x46bec5[_0x226b('0x32')]()[_0x226b('0x31')](function(){_0x25f569[_0x226b('0x29')](0xcc)[_0x226b('0x33')]();});}};}function handleEntityNotFound(_0x50664d,_0x3fe01f){return function(_0x9cf9fb){if(!_0x9cf9fb){_0x50664d[_0x226b('0x28')](0x194);}return _0x9cf9fb;};}function handleError(_0x1d8636,_0x589845){_0x589845=_0x589845||0x1f4;return function(_0x3d4725){logger[_0x226b('0x23')](_0x3d4725['stack']);if(_0x3d4725[_0x226b('0x34')]){delete _0x3d4725[_0x226b('0x34')];}_0x1d8636[_0x226b('0x29')](_0x589845)[_0x226b('0x35')](_0x3d4725);};}exports[_0x226b('0x36')]=function(_0x1e973a,_0x4cdf7c){var _0xb3f9a6={},_0x2e53ff={},_0x53227f={'count':0x0,'rows':[]};var _0x3d16fc=db['FreshdeskConfiguration'][_0x226b('0x37')];_0x2e53ff[_0x226b('0x38')]=_[_0x226b('0x39')](_0x3d16fc);_0x2e53ff[_0x226b('0x3a')]=_['keys'](_0x1e973a[_0x226b('0x3a')]);_0x2e53ff['filters']=_[_0x226b('0x3b')](_0x2e53ff[_0x226b('0x38')],_0x2e53ff[_0x226b('0x3a')]);_0xb3f9a6['attributes']=_[_0x226b('0x3b')](_0x2e53ff[_0x226b('0x38')],qs['fields'](_0x1e973a[_0x226b('0x3a')]['fields']));_0xb3f9a6[_0x226b('0x3c')]=_0xb3f9a6['attributes'][_0x226b('0x3d')]?_0xb3f9a6[_0x226b('0x3c')]:_0x2e53ff[_0x226b('0x38')];if(!_0x1e973a[_0x226b('0x3a')][_0x226b('0x3e')](_0x226b('0x3f'))){_0xb3f9a6[_0x226b('0x2c')]=qs[_0x226b('0x2c')](_0x1e973a['query'][_0x226b('0x2c')]);_0xb3f9a6[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x1e973a[_0x226b('0x3a')][_0x226b('0x2b')]);}_0xb3f9a6[_0x226b('0x40')]=qs[_0x226b('0x41')](_0x1e973a['query']['sort']);_0xb3f9a6[_0x226b('0x42')]=qs[_0x226b('0x43')](_[_0x226b('0x44')](_0x1e973a[_0x226b('0x3a')],_0x2e53ff[_0x226b('0x43')]));if(_0x1e973a[_0x226b('0x3a')][_0x226b('0x45')]){_0xb3f9a6['where']=_['merge'](_0xb3f9a6[_0x226b('0x42')],{'$or':_[_0x226b('0x46')](_0x3d16fc,function(_0x18097b){if(_0x18097b[_0x226b('0x47')][_0x226b('0x48')]!=='VIRTUAL'){var _0x2a9a90={};_0x2a9a90[_0x18097b[_0x226b('0x49')]]={'$like':'%'+_0x1e973a[_0x226b('0x3a')][_0x226b('0x45')]+'%'};return _0x2a9a90;}})});}_0xb3f9a6=_['merge']({},_0xb3f9a6,_0x1e973a[_0x226b('0x4a')]);var _0x4adef0={'where':_0xb3f9a6['where']};return db['FreshdeskConfiguration'][_0x226b('0x4b')](_0x4adef0)[_0x226b('0x31')](function(_0x57d535){_0x53227f['count']=_0x57d535;if(_0x1e973a[_0x226b('0x3a')][_0x226b('0x4c')]){_0xb3f9a6['include']=[{'all':!![]}];}return db[_0x226b('0x4d')][_0x226b('0x4e')](_0xb3f9a6);})[_0x226b('0x31')](function(_0x13d6a8){_0x53227f[_0x226b('0x4f')]=_0x13d6a8;return _0x53227f;})['then'](respondWithFilteredResult(_0x4cdf7c,_0xb3f9a6))[_0x226b('0x27')](handleError(_0x4cdf7c,null));};exports['show']=function(_0x258706,_0x4bf7d6){var _0x461e8e={'raw':![],'where':{'id':_0x258706[_0x226b('0x50')]['id']}},_0x322511={};_0x322511[_0x226b('0x38')]=_[_0x226b('0x39')](db[_0x226b('0x4d')][_0x226b('0x37')]);_0x322511[_0x226b('0x3a')]=_[_0x226b('0x39')](_0x258706[_0x226b('0x3a')]);_0x322511[_0x226b('0x43')]=_[_0x226b('0x3b')](_0x322511['model'],_0x322511[_0x226b('0x3a')]);_0x461e8e[_0x226b('0x3c')]=_[_0x226b('0x3b')](_0x322511[_0x226b('0x38')],qs[_0x226b('0x51')](_0x258706['query'][_0x226b('0x51')]));_0x461e8e[_0x226b('0x3c')]=_0x461e8e[_0x226b('0x3c')][_0x226b('0x3d')]?_0x461e8e[_0x226b('0x3c')]:_0x322511[_0x226b('0x38')];if(_0x258706[_0x226b('0x3a')][_0x226b('0x4c')]){_0x461e8e['include']=[{'all':!![]}];}_0x461e8e=_[_0x226b('0x52')]({},_0x461e8e,_0x258706[_0x226b('0x4a')]);return db[_0x226b('0x4d')]['find'](_0x461e8e)[_0x226b('0x31')](handleEntityNotFound(_0x4bf7d6,null))[_0x226b('0x31')](respondWithResult(_0x4bf7d6,null))[_0x226b('0x27')](handleError(_0x4bf7d6,null));};exports['create']=function(_0x3946a5,_0x343f1a){return db['FreshdeskConfiguration']['create'](_0x3946a5[_0x226b('0x53')],{})[_0x226b('0x31')](respondWithResult(_0x343f1a,0xc9))[_0x226b('0x27')](handleError(_0x343f1a,null));};exports[_0x226b('0x30')]=function(_0x38ec61,_0x3e7ac7){if(_0x38ec61[_0x226b('0x53')]['id']){delete _0x38ec61[_0x226b('0x53')]['id'];}return db['FreshdeskConfiguration'][_0x226b('0x54')]({'where':{'id':_0x38ec61['params']['id']}})[_0x226b('0x31')](handleEntityNotFound(_0x3e7ac7,null))[_0x226b('0x31')](saveUpdates(_0x38ec61[_0x226b('0x53')],null))[_0x226b('0x31')](respondWithResult(_0x3e7ac7,null))[_0x226b('0x27')](handleError(_0x3e7ac7,null));};exports[_0x226b('0x32')]=function(_0x2a823e,_0x5dd864){return db[_0x226b('0x4d')][_0x226b('0x54')]({'where':{'id':_0x2a823e[_0x226b('0x50')]['id']}})[_0x226b('0x31')](handleEntityNotFound(_0x5dd864,null))['then'](removeEntity(_0x5dd864,null))[_0x226b('0x27')](handleError(_0x5dd864,null));};exports['getFields']=function(_0x774284,_0x1a4fd4,_0x5c2d3f){var _0x30c46b={};var _0x2c17ff={};var _0x22c3ec;var _0x204b2a;return db['FreshdeskConfiguration'][_0x226b('0x55')]({'where':{'id':_0x774284[_0x226b('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a4fd4,null))[_0x226b('0x31')](function(_0x487393){if(_0x487393){_0x22c3ec=_0x487393;_0x2c17ff['model']=_[_0x226b('0x39')](db[_0x226b('0x56')][_0x226b('0x37')]);_0x2c17ff['query']=_[_0x226b('0x39')](_0x774284['query']);_0x2c17ff[_0x226b('0x43')]=_['intersection'](_0x2c17ff['model'],_0x2c17ff['query']);_0x30c46b['attributes']=_[_0x226b('0x3b')](_0x2c17ff[_0x226b('0x38')],qs[_0x226b('0x51')](_0x774284[_0x226b('0x3a')][_0x226b('0x51')]));_0x30c46b['attributes']=_0x30c46b[_0x226b('0x3c')]['length']?_0x30c46b[_0x226b('0x3c')]:_0x2c17ff[_0x226b('0x38')];_0x30c46b['order']=qs[_0x226b('0x41')](_0x774284[_0x226b('0x3a')][_0x226b('0x41')]);_0x30c46b[_0x226b('0x42')]=qs[_0x226b('0x43')](_['pick'](_0x774284['query'],_0x2c17ff['filters']));if(_0x774284[_0x226b('0x3a')]['filter']){_0x30c46b[_0x226b('0x42')]=_['merge'](_0x30c46b[_0x226b('0x42')],{'$or':_[_0x226b('0x46')](_0x30c46b[_0x226b('0x3c')],function(_0x2d5417){var _0x521b3f={};_0x521b3f[_0x2d5417]={'$like':'%'+_0x774284[_0x226b('0x3a')][_0x226b('0x45')]+'%'};return _0x521b3f;})});}_0x30c46b=_[_0x226b('0x52')]({},_0x30c46b,_0x774284['options']);return _0x22c3ec['getFields'](_0x30c46b);}})[_0x226b('0x31')](function(_0x2b8e42){if(_0x2b8e42){_0x204b2a=_0x2b8e42[_0x226b('0x3d')];if(!_0x774284[_0x226b('0x3a')][_0x226b('0x3e')]('nolimit')){_0x30c46b[_0x226b('0x2c')]=qs['limit'](_0x774284[_0x226b('0x3a')][_0x226b('0x2c')]);_0x30c46b['offset']=qs['offset'](_0x774284[_0x226b('0x3a')][_0x226b('0x2b')]);}return _0x22c3ec['getFields'](_0x30c46b);}})[_0x226b('0x31')](function(_0x5d6a10){if(_0x5d6a10){return _0x5d6a10?{'count':_0x204b2a,'rows':_0x5d6a10}:null;}})[_0x226b('0x31')](respondWithResult(_0x1a4fd4,null))[_0x226b('0x27')](handleError(_0x1a4fd4,null));};exports['getSubjects']=function(_0x36aa2d,_0x5eb9e1,_0xaef518){var _0x5efe42={};var _0x46d025={};var _0x3366cc;var _0x4acf8a;return db[_0x226b('0x4d')][_0x226b('0x55')]({'where':{'id':_0x36aa2d[_0x226b('0x50')]['id']}})[_0x226b('0x31')](handleEntityNotFound(_0x5eb9e1,null))['then'](function(_0x1598f7){if(_0x1598f7){_0x3366cc=_0x1598f7;_0x46d025[_0x226b('0x38')]=_['keys'](db[_0x226b('0x56')][_0x226b('0x37')]);_0x46d025[_0x226b('0x3a')]=_[_0x226b('0x39')](_0x36aa2d[_0x226b('0x3a')]);_0x46d025['filters']=_[_0x226b('0x3b')](_0x46d025[_0x226b('0x38')],_0x46d025['query']);_0x5efe42[_0x226b('0x3c')]=_['intersection'](_0x46d025[_0x226b('0x38')],qs[_0x226b('0x51')](_0x36aa2d['query'][_0x226b('0x51')]));_0x5efe42[_0x226b('0x3c')]=_0x5efe42['attributes']['length']?_0x5efe42['attributes']:_0x46d025[_0x226b('0x38')];_0x5efe42[_0x226b('0x40')]=qs[_0x226b('0x41')](_0x36aa2d[_0x226b('0x3a')][_0x226b('0x41')]);_0x5efe42['where']=qs['filters'](_[_0x226b('0x44')](_0x36aa2d[_0x226b('0x3a')],_0x46d025[_0x226b('0x43')]));if(_0x36aa2d[_0x226b('0x3a')][_0x226b('0x45')]){_0x5efe42[_0x226b('0x42')]=_[_0x226b('0x52')](_0x5efe42[_0x226b('0x42')],{'$or':_[_0x226b('0x46')](_0x5efe42[_0x226b('0x3c')],function(_0x301a9d){var _0x1571ed={};_0x1571ed[_0x301a9d]={'$like':'%'+_0x36aa2d['query'][_0x226b('0x45')]+'%'};return _0x1571ed;})});}_0x5efe42=_['merge']({},_0x5efe42,_0x36aa2d[_0x226b('0x4a')]);return _0x3366cc[_0x226b('0x57')](_0x5efe42);}})[_0x226b('0x31')](function(_0x559034){if(_0x559034){_0x4acf8a=_0x559034[_0x226b('0x3d')];if(!_0x36aa2d[_0x226b('0x3a')][_0x226b('0x3e')](_0x226b('0x3f'))){_0x5efe42[_0x226b('0x2c')]=qs[_0x226b('0x2c')](_0x36aa2d[_0x226b('0x3a')][_0x226b('0x2c')]);_0x5efe42[_0x226b('0x2b')]=qs['offset'](_0x36aa2d[_0x226b('0x3a')]['offset']);}return _0x3366cc[_0x226b('0x57')](_0x5efe42);}})['then'](function(_0xa1a28a){if(_0xa1a28a){return _0xa1a28a?{'count':_0x4acf8a,'rows':_0xa1a28a}:null;}})[_0x226b('0x31')](respondWithResult(_0x5eb9e1,null))[_0x226b('0x27')](handleError(_0x5eb9e1,null));};exports['getDescriptions']=function(_0x319384,_0xf0190f,_0xd71b91){var _0x50c362={};var _0x2704be={};var _0x49ef44;var _0x2bf878;return db[_0x226b('0x4d')][_0x226b('0x55')]({'where':{'id':_0x319384['params']['id']}})[_0x226b('0x31')](handleEntityNotFound(_0xf0190f,null))[_0x226b('0x31')](function(_0x48a64c){if(_0x48a64c){_0x49ef44=_0x48a64c;_0x2704be[_0x226b('0x38')]=_['keys'](db[_0x226b('0x56')][_0x226b('0x37')]);_0x2704be[_0x226b('0x3a')]=_[_0x226b('0x39')](_0x319384['query']);_0x2704be[_0x226b('0x43')]=_[_0x226b('0x3b')](_0x2704be['model'],_0x2704be[_0x226b('0x3a')]);_0x50c362[_0x226b('0x3c')]=_[_0x226b('0x3b')](_0x2704be['model'],qs[_0x226b('0x51')](_0x319384[_0x226b('0x3a')][_0x226b('0x51')]));_0x50c362[_0x226b('0x3c')]=_0x50c362[_0x226b('0x3c')][_0x226b('0x3d')]?_0x50c362[_0x226b('0x3c')]:_0x2704be[_0x226b('0x38')];_0x50c362['order']=qs[_0x226b('0x41')](_0x319384[_0x226b('0x3a')][_0x226b('0x41')]);_0x50c362['where']=qs[_0x226b('0x43')](_['pick'](_0x319384['query'],_0x2704be['filters']));if(_0x319384['query'][_0x226b('0x45')]){_0x50c362[_0x226b('0x42')]=_[_0x226b('0x52')](_0x50c362['where'],{'$or':_[_0x226b('0x46')](_0x50c362[_0x226b('0x3c')],function(_0x3f9a8c){var _0x12128b={};_0x12128b[_0x3f9a8c]={'$like':'%'+_0x319384['query'][_0x226b('0x45')]+'%'};return _0x12128b;})});}_0x50c362=_[_0x226b('0x52')]({},_0x50c362,_0x319384[_0x226b('0x4a')]);return _0x49ef44[_0x226b('0x58')](_0x50c362);}})['then'](function(_0x474904){if(_0x474904){_0x2bf878=_0x474904['length'];if(!_0x319384[_0x226b('0x3a')][_0x226b('0x3e')](_0x226b('0x3f'))){_0x50c362[_0x226b('0x2c')]=qs[_0x226b('0x2c')](_0x319384['query']['limit']);_0x50c362[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x319384[_0x226b('0x3a')][_0x226b('0x2b')]);}return _0x49ef44[_0x226b('0x58')](_0x50c362);}})[_0x226b('0x31')](function(_0x8134ca){if(_0x8134ca){return _0x8134ca?{'count':_0x2bf878,'rows':_0x8134ca}:null;}})['then'](respondWithResult(_0xf0190f,null))[_0x226b('0x27')](handleError(_0xf0190f,null));};exports[_0x226b('0x59')]=function(_0x579718,_0x59f832,_0x1313aa){var _0x26b330={};var _0x3ef69e={};var _0x156185;var _0x25d0d6;return db[_0x226b('0x4d')][_0x226b('0x55')]({'where':{'id':_0x579718['params']['id']}})[_0x226b('0x31')](handleEntityNotFound(_0x59f832,null))[_0x226b('0x31')](function(_0x14e9ff){if(_0x14e9ff){_0x156185=_0x14e9ff;_0x3ef69e[_0x226b('0x38')]=_[_0x226b('0x39')](db[_0x226b('0x5a')]['rawAttributes']);_0x3ef69e['query']=_[_0x226b('0x39')](_0x579718[_0x226b('0x3a')]);_0x3ef69e['filters']=_[_0x226b('0x3b')](_0x3ef69e[_0x226b('0x38')],_0x3ef69e[_0x226b('0x3a')]);_0x26b330[_0x226b('0x3c')]=_[_0x226b('0x3b')](_0x3ef69e[_0x226b('0x38')],qs[_0x226b('0x51')](_0x579718[_0x226b('0x3a')][_0x226b('0x51')]));_0x26b330['attributes']=_0x26b330[_0x226b('0x3c')]['length']?_0x26b330[_0x226b('0x3c')]:_0x3ef69e[_0x226b('0x38')];_0x26b330[_0x226b('0x40')]=qs[_0x226b('0x41')](_0x579718[_0x226b('0x3a')]['sort']);_0x26b330['where']=qs[_0x226b('0x43')](_['pick'](_0x579718[_0x226b('0x3a')],_0x3ef69e['filters']));if(_0x579718[_0x226b('0x3a')][_0x226b('0x45')]){_0x26b330[_0x226b('0x42')]=_[_0x226b('0x52')](_0x26b330['where'],{'$or':_[_0x226b('0x46')](_0x26b330[_0x226b('0x3c')],function(_0x24665f){var _0x2ab202={};_0x2ab202[_0x24665f]={'$like':'%'+_0x579718[_0x226b('0x3a')][_0x226b('0x45')]+'%'};return _0x2ab202;})});}_0x26b330=_['merge']({},_0x26b330,_0x579718[_0x226b('0x4a')]);return _0x156185[_0x226b('0x59')](_0x26b330);}})[_0x226b('0x31')](function(_0x184ca6){if(_0x184ca6){_0x25d0d6=_0x184ca6['length'];if(!_0x579718[_0x226b('0x3a')][_0x226b('0x3e')](_0x226b('0x3f'))){_0x26b330[_0x226b('0x2c')]=qs[_0x226b('0x2c')](_0x579718[_0x226b('0x3a')][_0x226b('0x2c')]);_0x26b330[_0x226b('0x2b')]=qs[_0x226b('0x2b')](_0x579718[_0x226b('0x3a')]['offset']);}return _0x156185[_0x226b('0x59')](_0x26b330);}})['then'](function(_0x3a9021){if(_0x3a9021){return _0x3a9021?{'count':_0x25d0d6,'rows':_0x3a9021}:null;}})[_0x226b('0x31')](respondWithResult(_0x59f832,null))[_0x226b('0x27')](handleError(_0x59f832,null));};exports[_0x226b('0x5b')]=function(_0x15064b,_0x4e9842,_0x32d680){if(_0x15064b['body']['id']){delete _0x15064b['body']['id'];}return db['FreshdeskConfiguration'][_0x226b('0x55')]({'where':{'id':_0x15064b[_0x226b('0x50')]['id']}})[_0x226b('0x31')](handleEntityNotFound(_0x4e9842,null))['then'](function(_0x166377){if(_0x166377){return _0x166377[_0x226b('0x5b')](_0x15064b[_0x226b('0x53')][_0x226b('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x4e9842,null))['catch'](handleError(_0x4e9842,null));}; \ No newline at end of file +var _0x6df9=['FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','zip-dir','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','stack','name','send','index'];(function(_0x4aef68,_0x78d74){var _0x7a3f7b=function(_0x88ad14){while(--_0x88ad14){_0x4aef68['push'](_0x4aef68['shift']());}};_0x7a3f7b(++_0x78d74);}(_0x6df9,0x84));var _0x96df=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6df9[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x96df('0x0'));var emlformat=require(_0x96df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x96df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96df('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x96df('0x4'));var util=require('util');var path=require(_0x96df('0x5'));var sox=require('sox');var csv=require(_0x96df('0x6'));var ejs=require(_0x96df('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x96df('0x8'));var crypto=require(_0x96df('0x9'));var jsforce=require(_0x96df('0xa'));var deskjs=require(_0x96df('0xb'));var toCsv=require('to-csv');var querystring=require(_0x96df('0xc'));var Papa=require(_0x96df('0xd'));var Redis=require('ioredis');var authService=require(_0x96df('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x96df('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x96df('0x10'));var db=require(_0x96df('0x11'))['db'];var jayson=require(_0x96df('0x12'));var client=jayson[_0x96df('0x13')][_0x96df('0x14')]({'port':0x232a});function checkPasswordPattern(_0x94b613,_0x4fd401,_0x279d58){if(_0x279d58){var _0x161dbb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x161dbb[_0x96df('0x15')](_0x4fd401)){return _0x94b613;}else{throw new Error(_0x96df('0x16'));}}else{return _0x94b613;}}function respondWithRpcPromise(_0x1ea5c4,_0x2648d1,_0x5d070d,_0x5e335c){return new BPromise(function(_0x5c96a6,_0x96e39){var _0x44dde7=_0x5e335c||client;return _0x44dde7[_0x96df('0x17')](_0x1ea5c4,_0x5d070d)[_0x96df('0x18')](function(_0x160111){logger[_0x96df('0x19')](_0x96df('0x1a'),_0x2648d1,_0x96df('0x1b'));logger[_0x96df('0x1c')](_0x96df('0x1d'),_0x2648d1,_0x96df('0x1b'),JSON[_0x96df('0x1e')](_0x160111));if(_0x160111[_0x96df('0x1f')]){if(_0x160111['error'][_0x96df('0x20')]===0x1f4){logger[_0x96df('0x1f')](_0x96df('0x1a'),_0x2648d1,_0x160111['error'][_0x96df('0x21')]);return _0x96e39(_0x160111[_0x96df('0x1f')][_0x96df('0x21')]);}logger[_0x96df('0x1f')](_0x96df('0x1a'),_0x2648d1,_0x160111['error'][_0x96df('0x21')]);return _0x5c96a6(_0x160111[_0x96df('0x1f')][_0x96df('0x21')]);}else{logger[_0x96df('0x19')](_0x96df('0x1a'),_0x2648d1,_0x96df('0x1b'));_0x5c96a6(_0x160111['result']['message']);}})[_0x96df('0x22')](function(_0x35ca83){logger[_0x96df('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2648d1,_0x35ca83);_0x96e39(_0x35ca83);});});}function respondWithStatusCode(_0x43047a,_0x4c5dea){_0x4c5dea=_0x4c5dea||0xcc;return function(_0x3ee67f){if(_0x3ee67f){return _0x43047a[_0x96df('0x23')](_0x4c5dea);}return _0x43047a[_0x96df('0x24')](_0x4c5dea)[_0x96df('0x25')]();};}function respondWithResult(_0x2f8dd6,_0x8056b7){_0x8056b7=_0x8056b7||0xc8;return function(_0xf49d02){if(_0xf49d02){return _0x2f8dd6[_0x96df('0x24')](_0x8056b7)['json'](_0xf49d02);}};}function respondWithFilteredResult(_0x4fb292,_0x552b2d){return function(_0x3fc959){if(_0x3fc959){var _0x340b85=_0x3fc959[_0x96df('0x26')],_0x47d8f3=_0x552b2d[_0x96df('0x27')],_0x1cee9c=_0x552b2d[_0x96df('0x27')]+_0x552b2d[_0x96df('0x28')],_0x17af9e;if(_0x1cee9c>=_0x340b85){_0x1cee9c=_0x340b85;_0x17af9e=0xc8;}else{_0x17af9e=0xce;}_0x4fb292[_0x96df('0x24')](_0x17af9e);return _0x4fb292[_0x96df('0x29')](_0x96df('0x2a'),_0x47d8f3+'-'+_0x1cee9c+'/'+_0x340b85)[_0x96df('0x2b')](_0x3fc959);}return null;};}function patchUpdates(_0x21bd5a){return function(_0x2cea86){try{jsonpatch[_0x96df('0x2c')](_0x2cea86,_0x21bd5a,!![]);}catch(_0x33819e){return BPromise[_0x96df('0x2d')](_0x33819e);}return _0x2cea86[_0x96df('0x2e')]();};}function saveUpdates(_0x1fc888,_0x2eca9c){return function(_0x3457f4){if(_0x3457f4){return _0x3457f4[_0x96df('0x2f')](_0x1fc888)[_0x96df('0x18')](function(_0x599bc7){return _0x599bc7;});}return null;};}function removeEntity(_0x128852,_0x197e1c){return function(_0x58f6a3){if(_0x58f6a3){return _0x58f6a3['destroy']()[_0x96df('0x18')](function(){_0x128852['status'](0xcc)[_0x96df('0x25')]();});}};}function handleEntityNotFound(_0x139f36,_0x365978){return function(_0x410d3d){if(!_0x410d3d){_0x139f36[_0x96df('0x23')](0x194);}return _0x410d3d;};}function handleError(_0xfe1020,_0x7de4ff){_0x7de4ff=_0x7de4ff||0x1f4;return function(_0x2168d8){logger['error'](_0x2168d8[_0x96df('0x30')]);if(_0x2168d8[_0x96df('0x31')]){delete _0x2168d8[_0x96df('0x31')];}_0xfe1020[_0x96df('0x24')](_0x7de4ff)[_0x96df('0x32')](_0x2168d8);};}exports[_0x96df('0x33')]=function(_0x15711a,_0x19e665){var _0xeb4b87={},_0x543350={},_0x86ee69={'count':0x0,'rows':[]};var _0x176cdb=db[_0x96df('0x34')][_0x96df('0x35')];_0x543350[_0x96df('0x36')]=_[_0x96df('0x37')](_0x176cdb);_0x543350['query']=_[_0x96df('0x37')](_0x15711a[_0x96df('0x38')]);_0x543350[_0x96df('0x39')]=_[_0x96df('0x3a')](_0x543350[_0x96df('0x36')],_0x543350[_0x96df('0x38')]);_0xeb4b87['attributes']=_[_0x96df('0x3a')](_0x543350['model'],qs[_0x96df('0x3b')](_0x15711a['query'][_0x96df('0x3b')]));_0xeb4b87[_0x96df('0x3c')]=_0xeb4b87[_0x96df('0x3c')]['length']?_0xeb4b87['attributes']:_0x543350[_0x96df('0x36')];if(!_0x15711a['query'][_0x96df('0x3d')](_0x96df('0x3e'))){_0xeb4b87[_0x96df('0x28')]=qs[_0x96df('0x28')](_0x15711a[_0x96df('0x38')]['limit']);_0xeb4b87['offset']=qs['offset'](_0x15711a[_0x96df('0x38')]['offset']);}_0xeb4b87[_0x96df('0x3f')]=qs[_0x96df('0x40')](_0x15711a['query'][_0x96df('0x40')]);_0xeb4b87[_0x96df('0x41')]=qs[_0x96df('0x39')](_[_0x96df('0x42')](_0x15711a[_0x96df('0x38')],_0x543350['filters']));if(_0x15711a[_0x96df('0x38')][_0x96df('0x43')]){_0xeb4b87[_0x96df('0x41')]=_[_0x96df('0x44')](_0xeb4b87[_0x96df('0x41')],{'$or':_[_0x96df('0x45')](_0x176cdb,function(_0xcb26fa){if(_0xcb26fa['type']['key']!==_0x96df('0x46')){var _0x3eb901={};_0x3eb901[_0xcb26fa['field']]={'$like':'%'+_0x15711a[_0x96df('0x38')][_0x96df('0x43')]+'%'};return _0x3eb901;}})});}_0xeb4b87=_[_0x96df('0x44')]({},_0xeb4b87,_0x15711a[_0x96df('0x47')]);var _0x2b7195={'where':_0xeb4b87[_0x96df('0x41')]};return db[_0x96df('0x34')][_0x96df('0x26')](_0x2b7195)['then'](function(_0x9d6f98){_0x86ee69[_0x96df('0x26')]=_0x9d6f98;if(_0x15711a[_0x96df('0x38')][_0x96df('0x48')]){_0xeb4b87[_0x96df('0x49')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x96df('0x4a')](_0xeb4b87);})[_0x96df('0x18')](function(_0x3cf475){_0x86ee69[_0x96df('0x4b')]=_0x3cf475;return _0x86ee69;})[_0x96df('0x18')](respondWithFilteredResult(_0x19e665,_0xeb4b87))['catch'](handleError(_0x19e665,null));};exports[_0x96df('0x4c')]=function(_0x22fb00,_0x287bfd){var _0x25f435={'raw':![],'where':{'id':_0x22fb00[_0x96df('0x4d')]['id']}},_0x40047b={};_0x40047b[_0x96df('0x36')]=_[_0x96df('0x37')](db[_0x96df('0x34')][_0x96df('0x35')]);_0x40047b[_0x96df('0x38')]=_[_0x96df('0x37')](_0x22fb00[_0x96df('0x38')]);_0x40047b[_0x96df('0x39')]=_[_0x96df('0x3a')](_0x40047b[_0x96df('0x36')],_0x40047b[_0x96df('0x38')]);_0x25f435[_0x96df('0x3c')]=_[_0x96df('0x3a')](_0x40047b[_0x96df('0x36')],qs[_0x96df('0x3b')](_0x22fb00[_0x96df('0x38')][_0x96df('0x3b')]));_0x25f435[_0x96df('0x3c')]=_0x25f435[_0x96df('0x3c')][_0x96df('0x4e')]?_0x25f435[_0x96df('0x3c')]:_0x40047b[_0x96df('0x36')];if(_0x22fb00[_0x96df('0x38')][_0x96df('0x48')]){_0x25f435[_0x96df('0x49')]=[{'all':!![]}];}_0x25f435=_['merge']({},_0x25f435,_0x22fb00['options']);return db[_0x96df('0x34')][_0x96df('0x4f')](_0x25f435)[_0x96df('0x18')](handleEntityNotFound(_0x287bfd,null))[_0x96df('0x18')](respondWithResult(_0x287bfd,null))[_0x96df('0x22')](handleError(_0x287bfd,null));};exports[_0x96df('0x50')]=function(_0x1634f5,_0x561d5e){return db[_0x96df('0x34')]['create'](_0x1634f5[_0x96df('0x51')],{})[_0x96df('0x18')](respondWithResult(_0x561d5e,0xc9))[_0x96df('0x22')](handleError(_0x561d5e,null));};exports['update']=function(_0x5d75e0,_0x18cda5){if(_0x5d75e0[_0x96df('0x51')]['id']){delete _0x5d75e0[_0x96df('0x51')]['id'];}return db[_0x96df('0x34')][_0x96df('0x4f')]({'where':{'id':_0x5d75e0['params']['id']}})['then'](handleEntityNotFound(_0x18cda5,null))[_0x96df('0x18')](saveUpdates(_0x5d75e0['body'],null))[_0x96df('0x18')](respondWithResult(_0x18cda5,null))[_0x96df('0x22')](handleError(_0x18cda5,null));};exports[_0x96df('0x52')]=function(_0xe27bbb,_0x365c9d){return db[_0x96df('0x34')][_0x96df('0x4f')]({'where':{'id':_0xe27bbb[_0x96df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x365c9d,null))['then'](removeEntity(_0x365c9d,null))['catch'](handleError(_0x365c9d,null));};exports[_0x96df('0x53')]=function(_0x5b66f0,_0x2b6b54,_0x1fde4e){var _0x3d15ad={};var _0x9e5b10={};var _0x46559d;var _0x47f223;return db[_0x96df('0x34')][_0x96df('0x54')]({'where':{'id':_0x5b66f0[_0x96df('0x4d')]['id']}})[_0x96df('0x18')](handleEntityNotFound(_0x2b6b54,null))['then'](function(_0x15c67a){if(_0x15c67a){_0x46559d=_0x15c67a;_0x9e5b10[_0x96df('0x36')]=_[_0x96df('0x37')](db[_0x96df('0x55')][_0x96df('0x35')]);_0x9e5b10[_0x96df('0x38')]=_[_0x96df('0x37')](_0x5b66f0[_0x96df('0x38')]);_0x9e5b10[_0x96df('0x39')]=_[_0x96df('0x3a')](_0x9e5b10[_0x96df('0x36')],_0x9e5b10[_0x96df('0x38')]);_0x3d15ad[_0x96df('0x3c')]=_[_0x96df('0x3a')](_0x9e5b10[_0x96df('0x36')],qs[_0x96df('0x3b')](_0x5b66f0[_0x96df('0x38')][_0x96df('0x3b')]));_0x3d15ad[_0x96df('0x3c')]=_0x3d15ad[_0x96df('0x3c')][_0x96df('0x4e')]?_0x3d15ad[_0x96df('0x3c')]:_0x9e5b10[_0x96df('0x36')];_0x3d15ad['order']=qs[_0x96df('0x40')](_0x5b66f0[_0x96df('0x38')]['sort']);_0x3d15ad['where']=qs['filters'](_[_0x96df('0x42')](_0x5b66f0[_0x96df('0x38')],_0x9e5b10[_0x96df('0x39')]));if(_0x5b66f0[_0x96df('0x38')][_0x96df('0x43')]){_0x3d15ad['where']=_[_0x96df('0x44')](_0x3d15ad[_0x96df('0x41')],{'$or':_['map'](_0x3d15ad[_0x96df('0x3c')],function(_0x5d0e0b){var _0x4ec130={};_0x4ec130[_0x5d0e0b]={'$like':'%'+_0x5b66f0[_0x96df('0x38')][_0x96df('0x43')]+'%'};return _0x4ec130;})});}_0x3d15ad=_[_0x96df('0x44')]({},_0x3d15ad,_0x5b66f0[_0x96df('0x47')]);return _0x46559d[_0x96df('0x53')](_0x3d15ad);}})[_0x96df('0x18')](function(_0x16e34b){if(_0x16e34b){_0x47f223=_0x16e34b[_0x96df('0x4e')];if(!_0x5b66f0['query']['hasOwnProperty'](_0x96df('0x3e'))){_0x3d15ad[_0x96df('0x28')]=qs[_0x96df('0x28')](_0x5b66f0[_0x96df('0x38')]['limit']);_0x3d15ad['offset']=qs[_0x96df('0x27')](_0x5b66f0[_0x96df('0x38')][_0x96df('0x27')]);}return _0x46559d['getFields'](_0x3d15ad);}})['then'](function(_0xf79b5e){if(_0xf79b5e){return _0xf79b5e?{'count':_0x47f223,'rows':_0xf79b5e}:null;}})[_0x96df('0x18')](respondWithResult(_0x2b6b54,null))[_0x96df('0x22')](handleError(_0x2b6b54,null));};exports[_0x96df('0x56')]=function(_0x529678,_0x31efa0,_0x35c3f4){var _0x5e3ac9={};var _0x3d8960={};var _0x10f0b0;var _0x59ec6e;return db['FreshdeskConfiguration'][_0x96df('0x54')]({'where':{'id':_0x529678[_0x96df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31efa0,null))['then'](function(_0x11f06e){if(_0x11f06e){_0x10f0b0=_0x11f06e;_0x3d8960[_0x96df('0x36')]=_[_0x96df('0x37')](db['FreshdeskField'][_0x96df('0x35')]);_0x3d8960[_0x96df('0x38')]=_[_0x96df('0x37')](_0x529678[_0x96df('0x38')]);_0x3d8960['filters']=_['intersection'](_0x3d8960[_0x96df('0x36')],_0x3d8960['query']);_0x5e3ac9[_0x96df('0x3c')]=_[_0x96df('0x3a')](_0x3d8960['model'],qs[_0x96df('0x3b')](_0x529678[_0x96df('0x38')][_0x96df('0x3b')]));_0x5e3ac9[_0x96df('0x3c')]=_0x5e3ac9[_0x96df('0x3c')][_0x96df('0x4e')]?_0x5e3ac9[_0x96df('0x3c')]:_0x3d8960['model'];_0x5e3ac9['order']=qs[_0x96df('0x40')](_0x529678['query'][_0x96df('0x40')]);_0x5e3ac9[_0x96df('0x41')]=qs[_0x96df('0x39')](_[_0x96df('0x42')](_0x529678[_0x96df('0x38')],_0x3d8960[_0x96df('0x39')]));if(_0x529678['query']['filter']){_0x5e3ac9[_0x96df('0x41')]=_['merge'](_0x5e3ac9[_0x96df('0x41')],{'$or':_[_0x96df('0x45')](_0x5e3ac9['attributes'],function(_0x1ed639){var _0x104d02={};_0x104d02[_0x1ed639]={'$like':'%'+_0x529678[_0x96df('0x38')][_0x96df('0x43')]+'%'};return _0x104d02;})});}_0x5e3ac9=_[_0x96df('0x44')]({},_0x5e3ac9,_0x529678['options']);return _0x10f0b0[_0x96df('0x56')](_0x5e3ac9);}})['then'](function(_0x2798eb){if(_0x2798eb){_0x59ec6e=_0x2798eb['length'];if(!_0x529678[_0x96df('0x38')]['hasOwnProperty'](_0x96df('0x3e'))){_0x5e3ac9[_0x96df('0x28')]=qs['limit'](_0x529678[_0x96df('0x38')][_0x96df('0x28')]);_0x5e3ac9['offset']=qs[_0x96df('0x27')](_0x529678[_0x96df('0x38')]['offset']);}return _0x10f0b0['getSubjects'](_0x5e3ac9);}})[_0x96df('0x18')](function(_0x5ee64b){if(_0x5ee64b){return _0x5ee64b?{'count':_0x59ec6e,'rows':_0x5ee64b}:null;}})[_0x96df('0x18')](respondWithResult(_0x31efa0,null))[_0x96df('0x22')](handleError(_0x31efa0,null));};exports[_0x96df('0x57')]=function(_0x22856d,_0x4caa52,_0x46d3e9){var _0x10e5e5={};var _0x57c744={};var _0x3f58be;var _0x4fdf36;return db['FreshdeskConfiguration'][_0x96df('0x54')]({'where':{'id':_0x22856d[_0x96df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4caa52,null))['then'](function(_0xa857bb){if(_0xa857bb){_0x3f58be=_0xa857bb;_0x57c744[_0x96df('0x36')]=_[_0x96df('0x37')](db[_0x96df('0x55')][_0x96df('0x35')]);_0x57c744['query']=_[_0x96df('0x37')](_0x22856d['query']);_0x57c744[_0x96df('0x39')]=_['intersection'](_0x57c744[_0x96df('0x36')],_0x57c744['query']);_0x10e5e5[_0x96df('0x3c')]=_['intersection'](_0x57c744[_0x96df('0x36')],qs['fields'](_0x22856d[_0x96df('0x38')][_0x96df('0x3b')]));_0x10e5e5[_0x96df('0x3c')]=_0x10e5e5[_0x96df('0x3c')][_0x96df('0x4e')]?_0x10e5e5[_0x96df('0x3c')]:_0x57c744[_0x96df('0x36')];_0x10e5e5[_0x96df('0x3f')]=qs[_0x96df('0x40')](_0x22856d[_0x96df('0x38')][_0x96df('0x40')]);_0x10e5e5[_0x96df('0x41')]=qs[_0x96df('0x39')](_['pick'](_0x22856d[_0x96df('0x38')],_0x57c744[_0x96df('0x39')]));if(_0x22856d[_0x96df('0x38')][_0x96df('0x43')]){_0x10e5e5[_0x96df('0x41')]=_[_0x96df('0x44')](_0x10e5e5[_0x96df('0x41')],{'$or':_['map'](_0x10e5e5['attributes'],function(_0x3623d3){var _0x272282={};_0x272282[_0x3623d3]={'$like':'%'+_0x22856d[_0x96df('0x38')][_0x96df('0x43')]+'%'};return _0x272282;})});}_0x10e5e5=_['merge']({},_0x10e5e5,_0x22856d[_0x96df('0x47')]);return _0x3f58be[_0x96df('0x57')](_0x10e5e5);}})[_0x96df('0x18')](function(_0x287750){if(_0x287750){_0x4fdf36=_0x287750[_0x96df('0x4e')];if(!_0x22856d[_0x96df('0x38')][_0x96df('0x3d')]('nolimit')){_0x10e5e5['limit']=qs[_0x96df('0x28')](_0x22856d[_0x96df('0x38')][_0x96df('0x28')]);_0x10e5e5['offset']=qs[_0x96df('0x27')](_0x22856d[_0x96df('0x38')][_0x96df('0x27')]);}return _0x3f58be[_0x96df('0x57')](_0x10e5e5);}})['then'](function(_0x56bee1){if(_0x56bee1){return _0x56bee1?{'count':_0x4fdf36,'rows':_0x56bee1}:null;}})[_0x96df('0x18')](respondWithResult(_0x4caa52,null))[_0x96df('0x22')](handleError(_0x4caa52,null));};exports['getTags']=function(_0x1146e9,_0x2e3acb,_0x159c11){var _0x3fa094={};var _0x46a371={};var _0x372e89;var _0x44ceec;return db[_0x96df('0x34')][_0x96df('0x54')]({'where':{'id':_0x1146e9[_0x96df('0x4d')]['id']}})[_0x96df('0x18')](handleEntityNotFound(_0x2e3acb,null))[_0x96df('0x18')](function(_0xc393e4){if(_0xc393e4){_0x372e89=_0xc393e4;_0x46a371['model']=_[_0x96df('0x37')](db[_0x96df('0x58')]['rawAttributes']);_0x46a371[_0x96df('0x38')]=_[_0x96df('0x37')](_0x1146e9['query']);_0x46a371['filters']=_[_0x96df('0x3a')](_0x46a371['model'],_0x46a371['query']);_0x3fa094[_0x96df('0x3c')]=_[_0x96df('0x3a')](_0x46a371[_0x96df('0x36')],qs[_0x96df('0x3b')](_0x1146e9[_0x96df('0x38')][_0x96df('0x3b')]));_0x3fa094[_0x96df('0x3c')]=_0x3fa094[_0x96df('0x3c')][_0x96df('0x4e')]?_0x3fa094[_0x96df('0x3c')]:_0x46a371[_0x96df('0x36')];_0x3fa094[_0x96df('0x3f')]=qs['sort'](_0x1146e9['query']['sort']);_0x3fa094[_0x96df('0x41')]=qs[_0x96df('0x39')](_['pick'](_0x1146e9[_0x96df('0x38')],_0x46a371[_0x96df('0x39')]));if(_0x1146e9[_0x96df('0x38')][_0x96df('0x43')]){_0x3fa094[_0x96df('0x41')]=_['merge'](_0x3fa094[_0x96df('0x41')],{'$or':_['map'](_0x3fa094[_0x96df('0x3c')],function(_0x5f3d8b){var _0x228df4={};_0x228df4[_0x5f3d8b]={'$like':'%'+_0x1146e9[_0x96df('0x38')][_0x96df('0x43')]+'%'};return _0x228df4;})});}_0x3fa094=_[_0x96df('0x44')]({},_0x3fa094,_0x1146e9[_0x96df('0x47')]);return _0x372e89[_0x96df('0x59')](_0x3fa094);}})[_0x96df('0x18')](function(_0x39dd71){if(_0x39dd71){_0x44ceec=_0x39dd71['length'];if(!_0x1146e9[_0x96df('0x38')]['hasOwnProperty'](_0x96df('0x3e'))){_0x3fa094[_0x96df('0x28')]=qs[_0x96df('0x28')](_0x1146e9[_0x96df('0x38')][_0x96df('0x28')]);_0x3fa094['offset']=qs[_0x96df('0x27')](_0x1146e9[_0x96df('0x38')][_0x96df('0x27')]);}return _0x372e89[_0x96df('0x59')](_0x3fa094);}})['then'](function(_0x27eb45){if(_0x27eb45){return _0x27eb45?{'count':_0x44ceec,'rows':_0x27eb45}:null;}})[_0x96df('0x18')](respondWithResult(_0x2e3acb,null))[_0x96df('0x22')](handleError(_0x2e3acb,null));};exports[_0x96df('0x5a')]=function(_0x1147e3,_0xd74b00,_0x26c8d0){if(_0x1147e3[_0x96df('0x51')]['id']){delete _0x1147e3[_0x96df('0x51')]['id'];}return db[_0x96df('0x34')]['findOne']({'where':{'id':_0x1147e3['params']['id']}})[_0x96df('0x18')](handleEntityNotFound(_0xd74b00,null))['then'](function(_0x4d6a16){if(_0x4d6a16){return _0x4d6a16[_0x96df('0x5a')](_0x1147e3[_0x96df('0x51')][_0x96df('0x5b')]||[]);}return null;})[_0x96df('0x18')](respondWithResult(_0xd74b00,null))[_0x96df('0x22')](handleError(_0xd74b00,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 0641d9d..f09575b 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 _0x04de=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x04de,0x10b));var _0xe04d=function(_0x5063a4,_0x554767){_0x5063a4=_0x5063a4-0x0;var _0x467a81=_0x04de[_0x5063a4];return _0x467a81;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x3013f2,_0x423575){return _0x3013f2['define']('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b95=['lodash','util','api','moment','path','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x2b95,0x168));var _0x52b9=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x2b95[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0x52b9('0x0'));var util=require(_0x52b9('0x1'));var logger=require('../../config/logger')(_0x52b9('0x2'));var moment=require(_0x52b9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x52b9('0x4'));var rimraf=require(_0x52b9('0x5'));var config=require(_0x52b9('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x4c3b03,_0x120f74){return _0x4c3b03[_0x52b9('0x7')](_0x52b9('0x8'),attributes,{'tableName':_0x52b9('0x9'),'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 bb814c2..14f36d7 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 _0xcb55=['message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0xcb55,0x1a5));var _0x5cb5=function(_0xf6a46,_0x9b06b9){_0xf6a46=_0xf6a46-0x0;var _0x2b51f5=_0xcb55[_0xf6a46];return _0x2b51f5;};'use strict';var _=require(_0x5cb5('0x0'));var util=require('util');var moment=require(_0x5cb5('0x1'));var BPromise=require('bluebird');var rs=require(_0x5cb5('0x2'));var fs=require('fs');var Redis=require(_0x5cb5('0x3'));var db=require(_0x5cb5('0x4'))['db'];var utils=require(_0x5cb5('0x5'));var logger=require('../../config/logger')(_0x5cb5('0x6'));var config=require(_0x5cb5('0x7'));var jayson=require(_0x5cb5('0x8'));var client=jayson[_0x5cb5('0x9')][_0x5cb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5de53f,_0x5034eb,_0x251bc4){return new BPromise(function(_0xee9b73,_0x13cdb7){return client['request'](_0x5de53f,_0x251bc4)[_0x5cb5('0xb')](function(_0x206b73){logger['info'](_0x5cb5('0xc'),_0x5034eb,_0x5cb5('0xd'));logger[_0x5cb5('0xe')](_0x5cb5('0xf'),_0x5034eb,'request\x20sent',JSON[_0x5cb5('0x10')](_0x206b73));if(_0x206b73[_0x5cb5('0x11')]){if(_0x206b73['error'][_0x5cb5('0x12')]===0x1f4){logger[_0x5cb5('0x11')](_0x5cb5('0xc'),_0x5034eb,_0x206b73[_0x5cb5('0x11')][_0x5cb5('0x13')]);return _0x13cdb7(_0x206b73[_0x5cb5('0x11')][_0x5cb5('0x13')]);}logger[_0x5cb5('0x11')](_0x5cb5('0xc'),_0x5034eb,_0x206b73[_0x5cb5('0x11')][_0x5cb5('0x13')]);return _0xee9b73(_0x206b73['error'][_0x5cb5('0x13')]);}else{logger[_0x5cb5('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5034eb,_0x5cb5('0xd'));_0xee9b73(_0x206b73['result']['message']);}})[_0x5cb5('0x15')](function(_0x1603d5){logger[_0x5cb5('0x11')](_0x5cb5('0xc'),_0x5034eb,_0x1603d5);_0x13cdb7(_0x1603d5);});});} \ No newline at end of file +var _0x9f58=['http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x420c11,_0x29f4d8){var _0xc7775f=function(_0x101c47){while(--_0x101c47){_0x420c11['push'](_0x420c11['shift']());}};_0xc7775f(++_0x29f4d8);}(_0x9f58,0x15d));var _0x89f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f58[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x89f5('0x0'));var moment=require(_0x89f5('0x1'));var BPromise=require(_0x89f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89f5('0x3'));var db=require(_0x89f5('0x4'))['db'];var utils=require(_0x89f5('0x5'));var logger=require(_0x89f5('0x6'))(_0x89f5('0x7'));var config=require(_0x89f5('0x8'));var jayson=require(_0x89f5('0x9'));var client=jayson[_0x89f5('0xa')][_0x89f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x301e5f,_0x58c4d9,_0x1d0445){return new BPromise(function(_0x4b5489,_0xbca3f4){return client['request'](_0x301e5f,_0x1d0445)[_0x89f5('0xc')](function(_0x35c109){logger[_0x89f5('0xd')](_0x89f5('0xe'),_0x58c4d9,_0x89f5('0xf'));logger[_0x89f5('0x10')](_0x89f5('0x11'),_0x58c4d9,_0x89f5('0xf'),JSON[_0x89f5('0x12')](_0x35c109));if(_0x35c109['error']){if(_0x35c109[_0x89f5('0x13')][_0x89f5('0x14')]===0x1f4){logger[_0x89f5('0x13')](_0x89f5('0xe'),_0x58c4d9,_0x35c109['error'][_0x89f5('0x15')]);return _0xbca3f4(_0x35c109[_0x89f5('0x13')][_0x89f5('0x15')]);}logger[_0x89f5('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x58c4d9,_0x35c109[_0x89f5('0x13')][_0x89f5('0x15')]);return _0x4b5489(_0x35c109['error'][_0x89f5('0x15')]);}else{logger[_0x89f5('0xd')](_0x89f5('0xe'),_0x58c4d9,'request\x20sent');_0x4b5489(_0x35c109[_0x89f5('0x16')][_0x89f5('0x15')]);}})[_0x89f5('0x17')](function(_0x8ed012){logger[_0x89f5('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x58c4d9,_0x8ed012);_0xbca3f4(_0x8ed012);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2319233..4f6b73b 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 _0xf993=['exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id'];(function(_0x2226c1,_0x2bed75){var _0x178716=function(_0x54bb7e){while(--_0x54bb7e){_0x2226c1['push'](_0x2226c1['shift']());}};_0x178716(++_0x2bed75);}(_0xf993,0x1d5));var _0x3f99=function(_0x55002e,_0x5debdd){_0x55002e=_0x55002e-0x0;var _0x573b1f=_0xf993[_0x55002e];return _0x573b1f;};'use strict';var multer=require(_0x3f99('0x0'));var util=require(_0x3f99('0x1'));var path=require(_0x3f99('0x2'));var timeout=require(_0x3f99('0x3'));var express=require(_0x3f99('0x4'));var router=express[_0x3f99('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f99('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x3f99('0x7')]('/',auth[_0x3f99('0x8')](),controller[_0x3f99('0x9')]);router['get']('/:id',auth[_0x3f99('0x8')](),controller[_0x3f99('0xa')]);router[_0x3f99('0xb')]('/',auth['isAuthenticated'](),controller[_0x3f99('0xc')]);router[_0x3f99('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3f99('0xe')]);router[_0x3f99('0xf')](_0x3f99('0x10'),auth[_0x3f99('0x8')](),controller['destroy']);module[_0x3f99('0x11')]=router; \ No newline at end of file +var _0xb8ba=['multer','path','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x2e7468,_0x57e2f6){var _0x55eaf9=function(_0x249372){while(--_0x249372){_0x2e7468['push'](_0x2e7468['shift']());}};_0x55eaf9(++_0x57e2f6);}(_0xb8ba,0x1a9));var _0xab8b=function(_0x45151d,_0x577b07){_0x45151d=_0x45151d-0x0;var _0x4c063e=_0xb8ba[_0x45151d];return _0x4c063e;};'use strict';var multer=require(_0xab8b('0x0'));var util=require('util');var path=require(_0xab8b('0x1'));var timeout=require('connect-timeout');var express=require(_0xab8b('0x2'));var router=express[_0xab8b('0x3')]();var auth=require(_0xab8b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xab8b('0x5'));var controller=require(_0xab8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xab8b('0x7')]);router['get'](_0xab8b('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xab8b('0x9')]('/',auth[_0xab8b('0xa')](),controller[_0xab8b('0xb')]);router[_0xab8b('0xc')](_0xab8b('0x8'),auth[_0xab8b('0xa')](),controller[_0xab8b('0xd')]);router[_0xab8b('0xe')](_0xab8b('0x8'),auth[_0xab8b('0xa')](),controller[_0xab8b('0xf')]);module[_0xab8b('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 58a2841..0e8b0a9 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 _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3c81,0x102));var _0x13c8=function(_0x47c5a6,_0xa6ce77){_0x47c5a6=_0x47c5a6-0x0;var _0x4da519=_0x3c81[_0x47c5a6];return _0x4da519;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x27d928,_0x3622de){var _0x3a3366=function(_0x2ceb64){while(--_0x2ceb64){_0x27d928['push'](_0x27d928['shift']());}};_0x3a3366(++_0x3622de);}(_0xd64b,0xc1));var _0xbd64=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0xd64b[_0x623e7];return _0x121131;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a371be3..6b12c65 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 _0x9341=['query','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','field','options','FreshdeskField','count','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','update','then','sendStatus','stack','name','index','model','keys','intersection','attributes','fields'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x9341,0xa4));var _0x1934=function(_0x26c6f8,_0x23b370){_0x26c6f8=_0x26c6f8-0x0;var _0x4ba556=_0x9341[_0x26c6f8];return _0x4ba556;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1934('0x0'));var rimraf=require(_0x1934('0x1'));var zipdir=require(_0x1934('0x2'));var jsonpatch=require(_0x1934('0x3'));var rp=require(_0x1934('0x4'));var moment=require(_0x1934('0x5'));var BPromise=require(_0x1934('0x6'));var Mustache=require(_0x1934('0x7'));var util=require('util');var path=require(_0x1934('0x8'));var sox=require(_0x1934('0x9'));var csv=require(_0x1934('0xa'));var ejs=require(_0x1934('0xb'));var fs=require('fs');var _=require(_0x1934('0xc'));var squel=require(_0x1934('0xd'));var crypto=require('crypto');var jsforce=require(_0x1934('0xe'));var deskjs=require(_0x1934('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1934('0x10'));var Papa=require(_0x1934('0x11'));var Redis=require(_0x1934('0x12'));var authService=require(_0x1934('0x13'));var qs=require(_0x1934('0x14'));var hardwareService=require(_0x1934('0x15'));var logger=require('../../config/logger')(_0x1934('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1934('0x17'))['db'];function respondWithStatusCode(_0x5e835c,_0x5ad41a){_0x5ad41a=_0x5ad41a||0xcc;return function(_0x5b821d){if(_0x5b821d){return _0x5e835c['sendStatus'](_0x5ad41a);}return _0x5e835c[_0x1934('0x18')](_0x5ad41a)[_0x1934('0x19')]();};}function respondWithResult(_0x4056a4,_0x4374b6){_0x4374b6=_0x4374b6||0xc8;return function(_0x412d18){if(_0x412d18){return _0x4056a4['status'](_0x4374b6)[_0x1934('0x1a')](_0x412d18);}};}function respondWithFilteredResult(_0x3023b6,_0xb48dfc){return function(_0x5d9b1c){if(_0x5d9b1c){var _0x50df7e=_0x5d9b1c['count'],_0x52e5d9=_0xb48dfc['offset'],_0x2f66d9=_0xb48dfc[_0x1934('0x1b')]+_0xb48dfc[_0x1934('0x1c')],_0x5f24e4;if(_0x2f66d9>=_0x50df7e){_0x2f66d9=_0x50df7e;_0x5f24e4=0xc8;}else{_0x5f24e4=0xce;}_0x3023b6[_0x1934('0x18')](_0x5f24e4);return _0x3023b6[_0x1934('0x1d')](_0x1934('0x1e'),_0x52e5d9+'-'+_0x2f66d9+'/'+_0x50df7e)[_0x1934('0x1a')](_0x5d9b1c);}return null;};}function patchUpdates(_0x161775){return function(_0x4494c9){try{jsonpatch['apply'](_0x4494c9,_0x161775,!![]);}catch(_0x4676d2){return BPromise[_0x1934('0x1f')](_0x4676d2);}return _0x4494c9['save']();};}function saveUpdates(_0x76a454,_0x446a6e){return function(_0x7b834){if(_0x7b834){return _0x7b834[_0x1934('0x20')](_0x76a454)['then'](function(_0x1e961b){return _0x1e961b;});}return null;};}function removeEntity(_0x524da9,_0x3622a9){return function(_0x40c178){if(_0x40c178){return _0x40c178['destroy']()[_0x1934('0x21')](function(){_0x524da9['status'](0xcc)[_0x1934('0x19')]();});}};}function handleEntityNotFound(_0x26ad87,_0x100a77){return function(_0x54052f){if(!_0x54052f){_0x26ad87[_0x1934('0x22')](0x194);}return _0x54052f;};}function handleError(_0xf0a7cd,_0x4d4ea0){_0x4d4ea0=_0x4d4ea0||0x1f4;return function(_0x50e78b){logger['error'](_0x50e78b[_0x1934('0x23')]);if(_0x50e78b[_0x1934('0x24')]){delete _0x50e78b[_0x1934('0x24')];}_0xf0a7cd['status'](_0x4d4ea0)['send'](_0x50e78b);};}exports[_0x1934('0x25')]=function(_0x52a0ae,_0x1d5f88){var _0x3f46ce={},_0x430e9b={},_0x539ca1={'count':0x0,'rows':[]};var _0x1ceb53=db['FreshdeskField']['rawAttributes'];_0x430e9b[_0x1934('0x26')]=_[_0x1934('0x27')](_0x1ceb53);_0x430e9b['query']=_['keys'](_0x52a0ae['query']);_0x430e9b['filters']=_[_0x1934('0x28')](_0x430e9b[_0x1934('0x26')],_0x430e9b['query']);_0x3f46ce[_0x1934('0x29')]=_[_0x1934('0x28')](_0x430e9b[_0x1934('0x26')],qs[_0x1934('0x2a')](_0x52a0ae['query'][_0x1934('0x2a')]));_0x3f46ce[_0x1934('0x29')]=_0x3f46ce[_0x1934('0x29')]['length']?_0x3f46ce[_0x1934('0x29')]:_0x430e9b[_0x1934('0x26')];if(!_0x52a0ae[_0x1934('0x2b')][_0x1934('0x2c')](_0x1934('0x2d'))){_0x3f46ce['limit']=qs[_0x1934('0x1c')](_0x52a0ae['query'][_0x1934('0x1c')]);_0x3f46ce[_0x1934('0x1b')]=qs['offset'](_0x52a0ae['query'][_0x1934('0x1b')]);}_0x3f46ce[_0x1934('0x2e')]=qs[_0x1934('0x2f')](_0x52a0ae['query'][_0x1934('0x2f')]);_0x3f46ce[_0x1934('0x30')]=qs[_0x1934('0x31')](_['pick'](_0x52a0ae[_0x1934('0x2b')],_0x430e9b[_0x1934('0x31')]));if(_0x52a0ae['query'][_0x1934('0x32')]){_0x3f46ce[_0x1934('0x30')]=_[_0x1934('0x33')](_0x3f46ce[_0x1934('0x30')],{'$or':_[_0x1934('0x34')](_0x1ceb53,function(_0x2ba230){if(_0x2ba230[_0x1934('0x35')]['key']!=='VIRTUAL'){var _0x429abe={};_0x429abe[_0x2ba230[_0x1934('0x36')]]={'$like':'%'+_0x52a0ae[_0x1934('0x2b')][_0x1934('0x32')]+'%'};return _0x429abe;}})});}_0x3f46ce=_['merge']({},_0x3f46ce,_0x52a0ae[_0x1934('0x37')]);var _0x4d262d={'where':_0x3f46ce[_0x1934('0x30')]};return db[_0x1934('0x38')]['count'](_0x4d262d)[_0x1934('0x21')](function(_0x146792){_0x539ca1[_0x1934('0x39')]=_0x146792;if(_0x52a0ae[_0x1934('0x2b')][_0x1934('0x3a')]){_0x3f46ce[_0x1934('0x3b')]=[{'all':!![]}];}return db[_0x1934('0x38')]['findAll'](_0x3f46ce);})['then'](function(_0x320f3e){_0x539ca1[_0x1934('0x3c')]=_0x320f3e;return _0x539ca1;})[_0x1934('0x21')](respondWithFilteredResult(_0x1d5f88,_0x3f46ce))['catch'](handleError(_0x1d5f88,null));};exports[_0x1934('0x3d')]=function(_0x27655a,_0x15764c){var _0x5fe5ba={'raw':!![],'where':{'id':_0x27655a[_0x1934('0x3e')]['id']}},_0x46990f={};_0x46990f[_0x1934('0x26')]=_['keys'](db['FreshdeskField'][_0x1934('0x3f')]);_0x46990f[_0x1934('0x2b')]=_[_0x1934('0x27')](_0x27655a[_0x1934('0x2b')]);_0x46990f[_0x1934('0x31')]=_[_0x1934('0x28')](_0x46990f[_0x1934('0x26')],_0x46990f[_0x1934('0x2b')]);_0x5fe5ba[_0x1934('0x29')]=_[_0x1934('0x28')](_0x46990f['model'],qs[_0x1934('0x2a')](_0x27655a[_0x1934('0x2b')][_0x1934('0x2a')]));_0x5fe5ba[_0x1934('0x29')]=_0x5fe5ba[_0x1934('0x29')][_0x1934('0x40')]?_0x5fe5ba[_0x1934('0x29')]:_0x46990f[_0x1934('0x26')];if(_0x27655a['query'][_0x1934('0x3a')]){_0x5fe5ba[_0x1934('0x3b')]=[{'all':!![]}];}_0x5fe5ba=_[_0x1934('0x33')]({},_0x5fe5ba,_0x27655a['options']);return db['FreshdeskField'][_0x1934('0x41')](_0x5fe5ba)['then'](handleEntityNotFound(_0x15764c,null))[_0x1934('0x21')](respondWithResult(_0x15764c,null))[_0x1934('0x42')](handleError(_0x15764c,null));};exports[_0x1934('0x43')]=function(_0x10c55f,_0x4ed142){return db[_0x1934('0x38')]['create'](_0x10c55f['body'],{})['then'](respondWithResult(_0x4ed142,0xc9))[_0x1934('0x42')](handleError(_0x4ed142,null));};exports[_0x1934('0x20')]=function(_0x3cd120,_0x19950a){if(_0x3cd120[_0x1934('0x44')]['id']){delete _0x3cd120[_0x1934('0x44')]['id'];}return db[_0x1934('0x38')][_0x1934('0x41')]({'where':{'id':_0x3cd120[_0x1934('0x3e')]['id']}})[_0x1934('0x21')](handleEntityNotFound(_0x19950a,null))['then'](saveUpdates(_0x3cd120[_0x1934('0x44')],null))[_0x1934('0x21')](respondWithResult(_0x19950a,null))['catch'](handleError(_0x19950a,null));};exports['destroy']=function(_0x5bfbb6,_0x4c0be2){return db[_0x1934('0x38')]['find']({'where':{'id':_0x5bfbb6[_0x1934('0x3e')]['id']}})[_0x1934('0x21')](handleEntityNotFound(_0x4c0be2,null))['then'](removeEntity(_0x4c0be2,null))[_0x1934('0x42')](handleError(_0x4c0be2,null));}; \ No newline at end of file +var _0xbdb8=['json','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','FreshdeskField','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','filter','type','key','field','includeAll','show','params','include','merge','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end'];(function(_0x13f980,_0x1e1c56){var _0x27153c=function(_0x3953d5){while(--_0x3953d5){_0x13f980['push'](_0x13f980['shift']());}};_0x27153c(++_0x1e1c56);}(_0xbdb8,0xe2));var _0x8bdb=function(_0x54f978,_0x3a6b7e){_0x54f978=_0x54f978-0x0;var _0x5d40b3=_0xbdb8[_0x54f978];return _0x5d40b3;};'use strict';var pdf=require(_0x8bdb('0x0'));var emlformat=require(_0x8bdb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8bdb('0x2'));var jsonpatch=require(_0x8bdb('0x3'));var rp=require('request-promise');var moment=require(_0x8bdb('0x4'));var BPromise=require(_0x8bdb('0x5'));var Mustache=require(_0x8bdb('0x6'));var util=require('util');var path=require(_0x8bdb('0x7'));var sox=require(_0x8bdb('0x8'));var csv=require('to-csv');var ejs=require(_0x8bdb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8bdb('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8bdb('0xb'));var toCsv=require(_0x8bdb('0xc'));var querystring=require(_0x8bdb('0xd'));var Papa=require('papaparse');var Redis=require(_0x8bdb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8bdb('0xf'));var logger=require(_0x8bdb('0x10'))(_0x8bdb('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8bdb('0x12'))['db'];function respondWithStatusCode(_0x4a7b9b,_0x5e0de9){_0x5e0de9=_0x5e0de9||0xcc;return function(_0x4cab19){if(_0x4cab19){return _0x4a7b9b[_0x8bdb('0x13')](_0x5e0de9);}return _0x4a7b9b[_0x8bdb('0x14')](_0x5e0de9)[_0x8bdb('0x15')]();};}function respondWithResult(_0x4ead27,_0x44498e){_0x44498e=_0x44498e||0xc8;return function(_0x48fbd7){if(_0x48fbd7){return _0x4ead27[_0x8bdb('0x14')](_0x44498e)[_0x8bdb('0x16')](_0x48fbd7);}};}function respondWithFilteredResult(_0x5722cb,_0x2c685f){return function(_0x4d4c1d){if(_0x4d4c1d){var _0x845519=_0x4d4c1d[_0x8bdb('0x17')],_0x362607=_0x2c685f[_0x8bdb('0x18')],_0x3d08f4=_0x2c685f['offset']+_0x2c685f['limit'],_0x185f98;if(_0x3d08f4>=_0x845519){_0x3d08f4=_0x845519;_0x185f98=0xc8;}else{_0x185f98=0xce;}_0x5722cb[_0x8bdb('0x14')](_0x185f98);return _0x5722cb[_0x8bdb('0x19')](_0x8bdb('0x1a'),_0x362607+'-'+_0x3d08f4+'/'+_0x845519)[_0x8bdb('0x16')](_0x4d4c1d);}return null;};}function patchUpdates(_0x3341a5){return function(_0xc412a3){try{jsonpatch[_0x8bdb('0x1b')](_0xc412a3,_0x3341a5,!![]);}catch(_0x5d41e4){return BPromise[_0x8bdb('0x1c')](_0x5d41e4);}return _0xc412a3[_0x8bdb('0x1d')]();};}function saveUpdates(_0xe66465,_0x1fa3aa){return function(_0xfc2878){if(_0xfc2878){return _0xfc2878[_0x8bdb('0x1e')](_0xe66465)[_0x8bdb('0x1f')](function(_0xee5a39){return _0xee5a39;});}return null;};}function removeEntity(_0x5e4146,_0x1dd596){return function(_0x55140f){if(_0x55140f){return _0x55140f['destroy']()[_0x8bdb('0x1f')](function(){_0x5e4146['status'](0xcc)[_0x8bdb('0x15')]();});}};}function handleEntityNotFound(_0x34e41d,_0x320b80){return function(_0x394e64){if(!_0x394e64){_0x34e41d[_0x8bdb('0x13')](0x194);}return _0x394e64;};}function handleError(_0x2013f3,_0x88986d){_0x88986d=_0x88986d||0x1f4;return function(_0x309e3a){logger['error'](_0x309e3a['stack']);if(_0x309e3a[_0x8bdb('0x20')]){delete _0x309e3a['name'];}_0x2013f3[_0x8bdb('0x14')](_0x88986d)[_0x8bdb('0x21')](_0x309e3a);};}exports[_0x8bdb('0x22')]=function(_0x2f683a,_0x2ff49c){var _0x409528={},_0x209ee0={},_0x18697e={'count':0x0,'rows':[]};var _0x428bce=db[_0x8bdb('0x23')][_0x8bdb('0x24')];_0x209ee0[_0x8bdb('0x25')]=_[_0x8bdb('0x26')](_0x428bce);_0x209ee0[_0x8bdb('0x27')]=_[_0x8bdb('0x26')](_0x2f683a[_0x8bdb('0x27')]);_0x209ee0['filters']=_[_0x8bdb('0x28')](_0x209ee0[_0x8bdb('0x25')],_0x209ee0[_0x8bdb('0x27')]);_0x409528[_0x8bdb('0x29')]=_['intersection'](_0x209ee0[_0x8bdb('0x25')],qs[_0x8bdb('0x2a')](_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x2a')]));_0x409528['attributes']=_0x409528[_0x8bdb('0x29')][_0x8bdb('0x2b')]?_0x409528['attributes']:_0x209ee0[_0x8bdb('0x25')];if(!_0x2f683a[_0x8bdb('0x27')]['hasOwnProperty'](_0x8bdb('0x2c'))){_0x409528[_0x8bdb('0x2d')]=qs[_0x8bdb('0x2d')](_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x2d')]);_0x409528[_0x8bdb('0x18')]=qs[_0x8bdb('0x18')](_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x18')]);}_0x409528['order']=qs[_0x8bdb('0x2e')](_0x2f683a['query']['sort']);_0x409528[_0x8bdb('0x2f')]=qs[_0x8bdb('0x30')](_['pick'](_0x2f683a[_0x8bdb('0x27')],_0x209ee0[_0x8bdb('0x30')]));if(_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x31')]){_0x409528['where']=_['merge'](_0x409528['where'],{'$or':_['map'](_0x428bce,function(_0x13b8f3){if(_0x13b8f3[_0x8bdb('0x32')][_0x8bdb('0x33')]!=='VIRTUAL'){var _0xe0726c={};_0xe0726c[_0x13b8f3[_0x8bdb('0x34')]]={'$like':'%'+_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x31')]+'%'};return _0xe0726c;}})});}_0x409528=_['merge']({},_0x409528,_0x2f683a['options']);var _0x202c65={'where':_0x409528[_0x8bdb('0x2f')]};return db[_0x8bdb('0x23')][_0x8bdb('0x17')](_0x202c65)['then'](function(_0x151a6a){_0x18697e[_0x8bdb('0x17')]=_0x151a6a;if(_0x2f683a[_0x8bdb('0x27')][_0x8bdb('0x35')]){_0x409528['include']=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x409528);})['then'](function(_0x1623f0){_0x18697e['rows']=_0x1623f0;return _0x18697e;})[_0x8bdb('0x1f')](respondWithFilteredResult(_0x2ff49c,_0x409528))['catch'](handleError(_0x2ff49c,null));};exports[_0x8bdb('0x36')]=function(_0x2d792d,_0x215499){var _0x2ca323={'raw':!![],'where':{'id':_0x2d792d[_0x8bdb('0x37')]['id']}},_0x4b0a5a={};_0x4b0a5a[_0x8bdb('0x25')]=_[_0x8bdb('0x26')](db[_0x8bdb('0x23')]['rawAttributes']);_0x4b0a5a[_0x8bdb('0x27')]=_['keys'](_0x2d792d[_0x8bdb('0x27')]);_0x4b0a5a[_0x8bdb('0x30')]=_['intersection'](_0x4b0a5a[_0x8bdb('0x25')],_0x4b0a5a[_0x8bdb('0x27')]);_0x2ca323['attributes']=_[_0x8bdb('0x28')](_0x4b0a5a[_0x8bdb('0x25')],qs[_0x8bdb('0x2a')](_0x2d792d[_0x8bdb('0x27')][_0x8bdb('0x2a')]));_0x2ca323['attributes']=_0x2ca323[_0x8bdb('0x29')][_0x8bdb('0x2b')]?_0x2ca323[_0x8bdb('0x29')]:_0x4b0a5a[_0x8bdb('0x25')];if(_0x2d792d[_0x8bdb('0x27')][_0x8bdb('0x35')]){_0x2ca323[_0x8bdb('0x38')]=[{'all':!![]}];}_0x2ca323=_[_0x8bdb('0x39')]({},_0x2ca323,_0x2d792d['options']);return db[_0x8bdb('0x23')][_0x8bdb('0x3a')](_0x2ca323)[_0x8bdb('0x1f')](handleEntityNotFound(_0x215499,null))[_0x8bdb('0x1f')](respondWithResult(_0x215499,null))[_0x8bdb('0x3b')](handleError(_0x215499,null));};exports['create']=function(_0x2e54a6,_0x37d80a){return db[_0x8bdb('0x23')][_0x8bdb('0x3c')](_0x2e54a6[_0x8bdb('0x3d')],{})[_0x8bdb('0x1f')](respondWithResult(_0x37d80a,0xc9))[_0x8bdb('0x3b')](handleError(_0x37d80a,null));};exports[_0x8bdb('0x1e')]=function(_0x15bd18,_0x55ec18){if(_0x15bd18[_0x8bdb('0x3d')]['id']){delete _0x15bd18[_0x8bdb('0x3d')]['id'];}return db[_0x8bdb('0x23')][_0x8bdb('0x3a')]({'where':{'id':_0x15bd18[_0x8bdb('0x37')]['id']}})[_0x8bdb('0x1f')](handleEntityNotFound(_0x55ec18,null))[_0x8bdb('0x1f')](saveUpdates(_0x15bd18[_0x8bdb('0x3d')],null))['then'](respondWithResult(_0x55ec18,null))[_0x8bdb('0x3b')](handleError(_0x55ec18,null));};exports['destroy']=function(_0xe0281,_0x40ae68){return db['FreshdeskField'][_0x8bdb('0x3a')]({'where':{'id':_0xe0281[_0x8bdb('0x37')]['id']}})[_0x8bdb('0x1f')](handleEntityNotFound(_0x40ae68,null))[_0x8bdb('0x1f')](removeEntity(_0x40ae68,null))[_0x8bdb('0x3b')](handleError(_0x40ae68,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index b22d2f7..f670019 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 _0x55b0=['moment','bluebird','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','FieldId','util','api'];(function(_0x519002,_0x5d2bcf){var _0x439e16=function(_0x44afce){while(--_0x44afce){_0x519002['push'](_0x519002['shift']());}};_0x439e16(++_0x5d2bcf);}(_0x55b0,0xca));var _0x055b=function(_0x1ee178,_0x3d1992){_0x1ee178=_0x1ee178-0x0;var _0x28d2df=_0x55b0[_0x1ee178];return _0x28d2df;};'use strict';var _=require('lodash');var util=require(_0x055b('0x0'));var logger=require('../../config/logger')(_0x055b('0x1'));var moment=require(_0x055b('0x2'));var BPromise=require(_0x055b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x055b('0x4'));var rimraf=require(_0x055b('0x5'));var config=require('../../config/environment');var attributes=require(_0x055b('0x6'));module[_0x055b('0x7')]=function(_0x58629c,_0x45edfa){return _0x58629c[_0x055b('0x8')](_0x055b('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x055b('0xa'),'fields':['idField',_0x055b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60a8=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x5af9ba,_0x30adfb){var _0x488c7c=function(_0x558245){while(--_0x558245){_0x5af9ba['push'](_0x5af9ba['shift']());}};_0x488c7c(++_0x30adfb);}(_0x60a8,0x191));var _0x860a=function(_0x243823,_0x1d88c3){_0x243823=_0x243823-0x0;var _0x29d012=_0x60a8[_0x243823];return _0x29d012;};'use strict';var _=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var logger=require(_0x860a('0x2'))(_0x860a('0x3'));var moment=require(_0x860a('0x4'));var BPromise=require(_0x860a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x860a('0x6'));var rimraf=require(_0x860a('0x7'));var config=require(_0x860a('0x8'));var attributes=require(_0x860a('0x9'));module[_0x860a('0xa')]=function(_0x1f69e3,_0x517d55){return _0x1f69e3['define'](_0x860a('0xb'),attributes,{'tableName':_0x860a('0xc'),'paranoid':![],'indexes':[{'name':_0x860a('0xd'),'fields':[_0x860a('0xe'),_0x860a('0xf')],'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 e8d8961..c10a523 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 _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0xbccc47,_0x548dbf){var _0x1d840a=function(_0x25413e){while(--_0x25413e){_0xbccc47['push'](_0xbccc47['shift']());}};_0x1d840a(++_0x548dbf);}(_0x2dae,0xc3));var _0xe2da=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x2dae[_0x5eaa0b];return _0x28b295;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file +var _0xf725=['http','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x394cc1,_0x2ea520){var _0x175726=function(_0x37fe33){while(--_0x37fe33){_0x394cc1['push'](_0x394cc1['shift']());}};_0x175726(++_0x2ea520);}(_0xf725,0x7e));var _0x5f72=function(_0x57be97,_0x13b579){_0x57be97=_0x57be97-0x0;var _0xc56176=_0xf725[_0x57be97];return _0xc56176;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 6085904..c954b35 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 _0x32d3=['put','/:id','update','destroy','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','isAuthenticated','/:id/fields','getFields','post','/:id/configurations','addConfiguration'];(function(_0x46d621,_0x6b5a93){var _0x37dae3=function(_0x18a361){while(--_0x18a361){_0x46d621['push'](_0x46d621['shift']());}};_0x37dae3(++_0x6b5a93);}(_0x32d3,0xee));var _0x332d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x32d3[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x332d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x332d('0x1')]();var auth=require(_0x332d('0x2'));var interaction=require(_0x332d('0x3'));var config=require(_0x332d('0x4'));var controller=require('./intSalesforceAccount.controller');router[_0x332d('0x5')]('/',auth['isAuthenticated'](),controller[_0x332d('0x6')]);router[_0x332d('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x332d('0x7')]);router[_0x332d('0x5')]('/:id/configurations',auth[_0x332d('0x8')](),controller['getConfigurations']);router[_0x332d('0x5')](_0x332d('0x9'),auth[_0x332d('0x8')](),controller[_0x332d('0xa')]);router[_0x332d('0xb')]('/',auth[_0x332d('0x8')](),controller['create']);router['post'](_0x332d('0xc'),auth[_0x332d('0x8')](),controller[_0x332d('0xd')]);router[_0x332d('0xe')](_0x332d('0xf'),auth[_0x332d('0x8')](),controller[_0x332d('0x10')]);router['delete'](_0x332d('0xf'),auth[_0x332d('0x8')](),controller[_0x332d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3c60=['create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','show','getFields','post'];(function(_0x24cdb2,_0x274828){var _0x1d2631=function(_0x55511e){while(--_0x55511e){_0x24cdb2['push'](_0x24cdb2['shift']());}};_0x1d2631(++_0x274828);}(_0x3c60,0x14c));var _0x03c6=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x3c60[_0x3e0763];return _0x351ca2;};'use strict';var multer=require('multer');var util=require(_0x03c6('0x0'));var path=require(_0x03c6('0x1'));var timeout=require(_0x03c6('0x2'));var express=require(_0x03c6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03c6('0x4'));var controller=require('./intSalesforceAccount.controller');router[_0x03c6('0x5')]('/',auth[_0x03c6('0x6')](),controller['index']);router[_0x03c6('0x5')]('/:id',auth[_0x03c6('0x6')](),controller[_0x03c6('0x7')]);router[_0x03c6('0x5')]('/:id/configurations',auth[_0x03c6('0x6')](),controller['getConfigurations']);router[_0x03c6('0x5')]('/:id/fields',auth[_0x03c6('0x6')](),controller[_0x03c6('0x8')]);router[_0x03c6('0x9')]('/',auth[_0x03c6('0x6')](),controller[_0x03c6('0xa')]);router[_0x03c6('0x9')](_0x03c6('0xb'),auth[_0x03c6('0x6')](),controller[_0x03c6('0xc')]);router[_0x03c6('0xd')](_0x03c6('0xe'),auth[_0x03c6('0x6')](),controller[_0x03c6('0xf')]);router[_0x03c6('0x10')]('/:id',auth[_0x03c6('0x6')](),controller[_0x03c6('0x11')]);module[_0x03c6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d092804..de66a6c 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 _0xc5b2=['sequelize','exports','STRING','integrationTab'];(function(_0x178814,_0x8cbb99){var _0x5a2c00=function(_0x31256a){while(--_0x31256a){_0x178814['push'](_0x178814['shift']());}};_0x5a2c00(++_0x8cbb99);}(_0xc5b2,0x170));var _0x2c5b=function(_0x27e001,_0x23025b){_0x27e001=_0x27e001-0x0;var _0xe60c5f=_0xc5b2[_0x27e001];return _0xe60c5f;};'use strict';var Sequelize=require(_0x2c5b('0x0'));module[_0x2c5b('0x1')]={'name':{'type':Sequelize[_0x2c5b('0x2')]},'description':{'type':Sequelize[_0x2c5b('0x2')]},'username':{'type':Sequelize[_0x2c5b('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x2c5b('0x2')]},'password':{'type':Sequelize[_0x2c5b('0x2')]},'clientId':{'type':Sequelize[_0x2c5b('0x2')]},'clientSecret':{'type':Sequelize[_0x2c5b('0x2')]},'securityToken':{'type':Sequelize[_0x2c5b('0x2')]},'serverUrl':{'type':Sequelize[_0x2c5b('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2c5b('0x3'),'newTab'),'defaultValue':_0x2c5b('0x3')}}; \ No newline at end of file +var _0x9ee3=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x9ee3,0x11d));var _0x39ee=function(_0x5c426a,_0x52ef4c){_0x5c426a=_0x5c426a-0x0;var _0x152a01=_0x9ee3[_0x5c426a];return _0x152a01;};'use strict';var Sequelize=require(_0x39ee('0x0'));module[_0x39ee('0x1')]={'name':{'type':Sequelize[_0x39ee('0x2')]},'description':{'type':Sequelize[_0x39ee('0x2')]},'username':{'type':Sequelize[_0x39ee('0x2')],'unique':_0x39ee('0x3')},'remoteUri':{'type':Sequelize[_0x39ee('0x2')]},'password':{'type':Sequelize[_0x39ee('0x2')]},'clientId':{'type':Sequelize[_0x39ee('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x39ee('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x39ee('0x4')]('integrationTab',_0x39ee('0x5')),'defaultValue':_0x39ee('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 7477a53..e68921f 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 _0x338e=['SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','lastIndexOf','Connection','login','password','concat','securityToken','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Type','Origin','Reason','Status','IsEscalated','SuppliedName','remove','custom','picklistValues','value','boolean','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','http','then','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','SalesforceConfiguration','sort','merge','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x338e,0x137));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xe338('0x0'));var emlformat=require(_0xe338('0x1'));var rimraf=require(_0xe338('0x2'));var zipdir=require(_0xe338('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe338('0x4'));var moment=require(_0xe338('0x5'));var BPromise=require(_0xe338('0x6'));var Mustache=require(_0xe338('0x7'));var util=require(_0xe338('0x8'));var path=require(_0xe338('0x9'));var sox=require(_0xe338('0xa'));var csv=require(_0xe338('0xb'));var ejs=require(_0xe338('0xc'));var fs=require('fs');var _=require(_0xe338('0xd'));var squel=require(_0xe338('0xe'));var crypto=require(_0xe338('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe338('0x10'));var toCsv=require(_0xe338('0xb'));var querystring=require(_0xe338('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe338('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe338('0x13'));var logger=require(_0xe338('0x14'))(_0xe338('0x15'));var utils=require('../../config/utils');var config=require(_0xe338('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe338('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xe338('0x18')][_0xe338('0x19')]({'port':0x232a});function checkPasswordPattern(_0x278dc8,_0x43f46d,_0x4da7ea){if(_0x4da7ea){var _0x3645ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3645ee['test'](_0x43f46d)){return _0x278dc8;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x278dc8;}}function respondWithRpcPromise(_0x47c13c,_0x57dc4c,_0x253e98,_0x5c9cb4){return new BPromise(function(_0x125c00,_0x4df29b){var _0x21722a=_0x5c9cb4||client;return _0x21722a['request'](_0x47c13c,_0x253e98)[_0xe338('0x1a')](function(_0x4ade13){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x57dc4c,'request\x20sent');logger['debug'](_0xe338('0x1b'),_0x57dc4c,_0xe338('0x1c'),JSON[_0xe338('0x1d')](_0x4ade13));if(_0x4ade13['error']){if(_0x4ade13[_0xe338('0x1e')][_0xe338('0x1f')]===0x1f4){logger[_0xe338('0x1e')](_0xe338('0x20'),_0x57dc4c,_0x4ade13[_0xe338('0x1e')][_0xe338('0x21')]);return _0x4df29b(_0x4ade13[_0xe338('0x1e')][_0xe338('0x21')]);}logger['error'](_0xe338('0x20'),_0x57dc4c,_0x4ade13[_0xe338('0x1e')][_0xe338('0x21')]);return _0x125c00(_0x4ade13[_0xe338('0x1e')]['message']);}else{logger[_0xe338('0x22')](_0xe338('0x20'),_0x57dc4c,'request\x20sent');_0x125c00(_0x4ade13[_0xe338('0x23')][_0xe338('0x21')]);}})['catch'](function(_0x1854f7){logger[_0xe338('0x1e')](_0xe338('0x20'),_0x57dc4c,_0x1854f7);_0x4df29b(_0x1854f7);});});}function respondWithStatusCode(_0x5ed542,_0x4cddac){_0x4cddac=_0x4cddac||0xcc;return function(_0x501c0a){if(_0x501c0a){return _0x5ed542[_0xe338('0x24')](_0x4cddac);}return _0x5ed542[_0xe338('0x25')](_0x4cddac)[_0xe338('0x26')]();};}function respondWithResult(_0x44ad20,_0x47caa6){_0x47caa6=_0x47caa6||0xc8;return function(_0x42405d){if(_0x42405d){return _0x44ad20[_0xe338('0x25')](_0x47caa6)[_0xe338('0x27')](_0x42405d);}};}function respondWithFilteredResult(_0x32df21,_0x3d2c89){return function(_0x4177fc){if(_0x4177fc){var _0x1f24d3=_0x4177fc[_0xe338('0x28')],_0x4ea0ab=_0x3d2c89['offset'],_0x29e6f7=_0x3d2c89[_0xe338('0x29')]+_0x3d2c89['limit'],_0x2a6cff;if(_0x29e6f7>=_0x1f24d3){_0x29e6f7=_0x1f24d3;_0x2a6cff=0xc8;}else{_0x2a6cff=0xce;}_0x32df21[_0xe338('0x25')](_0x2a6cff);return _0x32df21[_0xe338('0x2a')](_0xe338('0x2b'),_0x4ea0ab+'-'+_0x29e6f7+'/'+_0x1f24d3)[_0xe338('0x27')](_0x4177fc);}return null;};}function patchUpdates(_0x52fae9){return function(_0x453e7f){try{jsonpatch['apply'](_0x453e7f,_0x52fae9,!![]);}catch(_0x1a437b){return BPromise['reject'](_0x1a437b);}return _0x453e7f[_0xe338('0x2c')]();};}function saveUpdates(_0x4285ae,_0x2f6e22){return function(_0x133594){if(_0x133594){return _0x133594[_0xe338('0x2d')](_0x4285ae)[_0xe338('0x1a')](function(_0x29bb34){return _0x29bb34;});}return null;};}function removeEntity(_0x1bcf52,_0x324bb6){return function(_0x3f2c24){if(_0x3f2c24){return _0x3f2c24[_0xe338('0x2e')]()[_0xe338('0x1a')](function(){_0x1bcf52[_0xe338('0x25')](0xcc)[_0xe338('0x26')]();});}};}function handleEntityNotFound(_0x1360a0,_0x161c09){return function(_0x1894ee){if(!_0x1894ee){_0x1360a0[_0xe338('0x24')](0x194);}return _0x1894ee;};}function handleError(_0x440bcd,_0x55f24e){_0x55f24e=_0x55f24e||0x1f4;return function(_0x551c8b){logger[_0xe338('0x1e')](_0x551c8b[_0xe338('0x2f')]);if(_0x551c8b[_0xe338('0x30')]){delete _0x551c8b[_0xe338('0x30')];}_0x440bcd[_0xe338('0x25')](_0x55f24e)[_0xe338('0x31')](_0x551c8b);};}exports[_0xe338('0x32')]=function(_0x2ebd49,_0x1da13c){var _0x52fe95={},_0x4f79fd={},_0x15298d={'count':0x0,'rows':[]};var _0x2b7ec8=db[_0xe338('0x33')][_0xe338('0x34')];_0x4f79fd['model']=_['keys'](_0x2b7ec8);_0x4f79fd[_0xe338('0x35')]=_[_0xe338('0x36')](_0x2ebd49[_0xe338('0x35')]);_0x4f79fd[_0xe338('0x37')]=_[_0xe338('0x38')](_0x4f79fd[_0xe338('0x39')],_0x4f79fd[_0xe338('0x35')]);_0x52fe95[_0xe338('0x3a')]=_[_0xe338('0x38')](_0x4f79fd[_0xe338('0x39')],qs[_0xe338('0x3b')](_0x2ebd49[_0xe338('0x35')]['fields']));_0x52fe95[_0xe338('0x3a')]=_0x52fe95[_0xe338('0x3a')]['length']?_0x52fe95[_0xe338('0x3a')]:_0x4f79fd[_0xe338('0x39')];if(!_0x2ebd49[_0xe338('0x35')][_0xe338('0x3c')](_0xe338('0x3d'))){_0x52fe95[_0xe338('0x3e')]=qs[_0xe338('0x3e')](_0x2ebd49['query']['limit']);_0x52fe95[_0xe338('0x29')]=qs[_0xe338('0x29')](_0x2ebd49[_0xe338('0x35')]['offset']);}_0x52fe95[_0xe338('0x3f')]=qs['sort'](_0x2ebd49[_0xe338('0x35')]['sort']);_0x52fe95[_0xe338('0x40')]=qs[_0xe338('0x37')](_[_0xe338('0x41')](_0x2ebd49[_0xe338('0x35')],_0x4f79fd[_0xe338('0x37')]));if(_0x2ebd49[_0xe338('0x35')][_0xe338('0x42')]){_0x52fe95[_0xe338('0x40')]=_['merge'](_0x52fe95[_0xe338('0x40')],{'$or':_[_0xe338('0x43')](_0x2b7ec8,function(_0x35dffd){if(_0x35dffd[_0xe338('0x44')]['key']!==_0xe338('0x45')){var _0x2daebd={};_0x2daebd[_0x35dffd[_0xe338('0x46')]]={'$like':'%'+_0x2ebd49[_0xe338('0x35')][_0xe338('0x42')]+'%'};return _0x2daebd;}})});}_0x52fe95=_['merge']({},_0x52fe95,_0x2ebd49[_0xe338('0x47')]);var _0x80a79a={'where':_0x52fe95[_0xe338('0x40')]};return db[_0xe338('0x33')]['count'](_0x80a79a)[_0xe338('0x1a')](function(_0x46459e){_0x15298d[_0xe338('0x28')]=_0x46459e;if(_0x2ebd49[_0xe338('0x35')][_0xe338('0x48')]){_0x52fe95[_0xe338('0x49')]=[{'all':!![]}];}return db[_0xe338('0x33')][_0xe338('0x4a')](_0x52fe95);})[_0xe338('0x1a')](function(_0x3c1e91){_0x15298d[_0xe338('0x4b')]=_0x3c1e91;return _0x15298d;})['then'](respondWithFilteredResult(_0x1da13c,_0x52fe95))[_0xe338('0x4c')](handleError(_0x1da13c,null));};exports[_0xe338('0x4d')]=function(_0x1c945a,_0x27e5c4){var _0x190919={'raw':![],'where':{'id':_0x1c945a[_0xe338('0x4e')]['id']}},_0x516e8a={};_0x516e8a[_0xe338('0x39')]=_[_0xe338('0x36')](db['SalesforceAccount']['rawAttributes']);_0x516e8a[_0xe338('0x35')]=_['keys'](_0x1c945a['query']);_0x516e8a['filters']=_['intersection'](_0x516e8a[_0xe338('0x39')],_0x516e8a[_0xe338('0x35')]);_0x190919[_0xe338('0x3a')]=_[_0xe338('0x38')](_0x516e8a['model'],qs[_0xe338('0x3b')](_0x1c945a[_0xe338('0x35')][_0xe338('0x3b')]));_0x190919['attributes']=_0x190919[_0xe338('0x3a')][_0xe338('0x4f')]?_0x190919['attributes']:_0x516e8a[_0xe338('0x39')];if(_0x1c945a[_0xe338('0x35')]['includeAll']){_0x190919[_0xe338('0x49')]=[{'all':!![]}];}_0x190919=_['merge']({},_0x190919,_0x1c945a[_0xe338('0x47')]);return db['SalesforceAccount'][_0xe338('0x50')](_0x190919)['then'](handleEntityNotFound(_0x27e5c4,null))['then'](respondWithResult(_0x27e5c4,null))['catch'](handleError(_0x27e5c4,null));};exports[_0xe338('0x51')]=function(_0x4de64f,_0x18c9ba){return db[_0xe338('0x33')][_0xe338('0x51')](_0x4de64f[_0xe338('0x52')],{})[_0xe338('0x1a')](respondWithResult(_0x18c9ba,0xc9))['catch'](handleError(_0x18c9ba,null));};exports[_0xe338('0x2d')]=function(_0x412ef0,_0x212bd){if(_0x412ef0[_0xe338('0x52')]['id']){delete _0x412ef0['body']['id'];}return db[_0xe338('0x33')][_0xe338('0x50')]({'where':{'id':_0x412ef0[_0xe338('0x4e')]['id']}})[_0xe338('0x1a')](handleEntityNotFound(_0x212bd,null))[_0xe338('0x1a')](saveUpdates(_0x412ef0[_0xe338('0x52')],null))[_0xe338('0x1a')](respondWithResult(_0x212bd,null))[_0xe338('0x4c')](handleError(_0x212bd,null));};exports[_0xe338('0x2e')]=function(_0x33809d,_0x3242eb){return db[_0xe338('0x33')][_0xe338('0x50')]({'where':{'id':_0x33809d[_0xe338('0x4e')]['id']}})[_0xe338('0x1a')](handleEntityNotFound(_0x3242eb,null))[_0xe338('0x1a')](removeEntity(_0x3242eb,null))[_0xe338('0x4c')](handleError(_0x3242eb,null));};exports[_0xe338('0x53')]=function(_0x2d7323,_0x423230,_0x49f867){var _0x20c6f6={};var _0xa9b9e5={};var _0x851048;var _0x3d561a;return db['SalesforceAccount'][_0xe338('0x54')]({'where':{'id':_0x2d7323[_0xe338('0x4e')]['id']}})[_0xe338('0x1a')](handleEntityNotFound(_0x423230,null))[_0xe338('0x1a')](function(_0x18063e){if(_0x18063e){_0x851048=_0x18063e;_0xa9b9e5['model']=_[_0xe338('0x36')](db[_0xe338('0x55')][_0xe338('0x34')]);_0xa9b9e5['query']=_['keys'](_0x2d7323['query']);_0xa9b9e5[_0xe338('0x37')]=_['intersection'](_0xa9b9e5['model'],_0xa9b9e5[_0xe338('0x35')]);_0x20c6f6[_0xe338('0x3a')]=_[_0xe338('0x38')](_0xa9b9e5[_0xe338('0x39')],qs[_0xe338('0x3b')](_0x2d7323['query'][_0xe338('0x3b')]));_0x20c6f6[_0xe338('0x3a')]=_0x20c6f6['attributes'][_0xe338('0x4f')]?_0x20c6f6[_0xe338('0x3a')]:_0xa9b9e5[_0xe338('0x39')];_0x20c6f6[_0xe338('0x3f')]=qs[_0xe338('0x56')](_0x2d7323[_0xe338('0x35')][_0xe338('0x56')]);_0x20c6f6[_0xe338('0x40')]=qs['filters'](_[_0xe338('0x41')](_0x2d7323[_0xe338('0x35')],_0xa9b9e5[_0xe338('0x37')]));if(_0x2d7323[_0xe338('0x35')][_0xe338('0x42')]){_0x20c6f6[_0xe338('0x40')]=_[_0xe338('0x57')](_0x20c6f6[_0xe338('0x40')],{'$or':_[_0xe338('0x43')](_0x20c6f6[_0xe338('0x3a')],function(_0x542299){var _0x5ac8b2={};_0x5ac8b2[_0x542299]={'$like':'%'+_0x2d7323[_0xe338('0x35')][_0xe338('0x42')]+'%'};return _0x5ac8b2;})});}_0x20c6f6=_[_0xe338('0x57')]({},_0x20c6f6,_0x2d7323[_0xe338('0x47')]);return _0x851048[_0xe338('0x53')](_0x20c6f6);}})[_0xe338('0x1a')](function(_0x4a754e){if(_0x4a754e){_0x3d561a=_0x4a754e[_0xe338('0x4f')];if(!_0x2d7323['query']['hasOwnProperty'](_0xe338('0x3d'))){_0x20c6f6[_0xe338('0x3e')]=qs[_0xe338('0x3e')](_0x2d7323['query'][_0xe338('0x3e')]);_0x20c6f6['offset']=qs[_0xe338('0x29')](_0x2d7323[_0xe338('0x35')][_0xe338('0x29')]);}return _0x851048[_0xe338('0x53')](_0x20c6f6);}})['then'](function(_0x2ad1ab){if(_0x2ad1ab){return _0x2ad1ab?{'count':_0x3d561a,'rows':_0x2ad1ab}:null;}})[_0xe338('0x1a')](respondWithResult(_0x423230,null))[_0xe338('0x4c')](handleError(_0x423230,null));};exports[_0xe338('0x58')]=function(_0x330321,_0x934b11,_0x49a764){if(_0x330321[_0xe338('0x52')]['id']){delete _0x330321[_0xe338('0x52')]['id'];}return db[_0xe338('0x33')]['findOne']({'where':{'id':_0x330321[_0xe338('0x4e')]['id']}})[_0xe338('0x1a')](handleEntityNotFound(_0x934b11,null))[_0xe338('0x1a')](function(_0x1897fe){if(_0x1897fe){_0x330321['body'][_0xe338('0x59')]=_0x1897fe['id'];_0x330321[_0xe338('0x52')][_0xe338('0x5a')]=integrations['getSubjects'](_0x330321['body']['channel'],_0x330321[_0xe338('0x52')]['type']);_0x330321[_0xe338('0x52')][_0xe338('0x5b')]=integrations[_0xe338('0x5c')](_0x330321[_0xe338('0x52')][_0xe338('0x5d')],_0x330321[_0xe338('0x52')][_0xe338('0x44')]);return db[_0xe338('0x55')][_0xe338('0x51')](_0x330321[_0xe338('0x52')],{'include':[{'model':db[_0xe338('0x5e')],'as':_0xe338('0x5a')},{'model':db[_0xe338('0x5e')],'as':'Descriptions'}]});}return null;})[_0xe338('0x1a')](respondWithResult(_0x934b11,null))['catch'](handleError(_0x934b11,null));};exports[_0xe338('0x5f')]=function(_0x53c756,_0x2a21e1,_0x245de7){var _0x362855;var _0x4c3146='';var _0x4577ea=_0xe338('0x60');return db[_0xe338('0x33')][_0xe338('0x54')]({'where':{'id':_0x53c756[_0xe338('0x4e')]['id']},'attributes':['id',_0xe338('0x61'),_0xe338('0x62'),_0xe338('0x63'),_0xe338('0x64'),'password','securityToken']})[_0xe338('0x1a')](handleEntityNotFound(_0x2a21e1,null))['then'](function(_0x486e0a){if(_0x486e0a){_0x4c3146=_0x486e0a[_0xe338('0x61')];var _0x1d52ea=_0x4c3146['slice'](-0x1);if(_0x1d52ea==='/'){_0x4c3146=_0x4c3146['substring'](0x0,_0x4c3146[_0xe338('0x65')](_0x1d52ea));}_0x362855=new jsforce[(_0xe338('0x66'))]({'oauth2':{'loginUrl':_0x4c3146,'clientId':_0x486e0a[_0xe338('0x62')],'clientSecret':_0x486e0a[_0xe338('0x63')]}});return _0x362855[_0xe338('0x67')](_0x486e0a[_0xe338('0x64')],_0x486e0a[_0xe338('0x68')][_0xe338('0x69')](_0x486e0a[_0xe338('0x6a')]));}})['then'](function(_0x27d531){if(_0x27d531){if(!_[_0xe338('0x6b')](_0x53c756[_0xe338('0x35')][_0xe338('0x6c')])){_0x4577ea=_0x53c756['query'][_0xe338('0x6c')];}return _0x362855[_0xe338('0x6d')](_0x4577ea)[_0xe338('0x6e')]();}})['then'](function(_0x162315){var _0x475817=[_0xe338('0x6f'),_0xe338('0x70'),_0xe338('0x71'),_0xe338('0x72'),_0xe338('0x73'),_0xe338('0x74'),'Status',_0xe338('0x75')];if(!_[_0xe338('0x6b')](_0x53c756[_0xe338('0x35')][_0xe338('0x6c')])&&_0x53c756[_0xe338('0x35')]['ticketType']==='Case'){_0x475817=[_0xe338('0x75'),_0xe338('0x76'),_0xe338('0x77'),_0xe338('0x78'),_0xe338('0x74'),_0xe338('0x79'),_0xe338('0x7a'),'SuppliedCompany'];}if(_0x162315){_[_0xe338('0x7b')](_0x162315[_0xe338('0x3b')],function(_0x4dead5){return _0x4dead5[_0xe338('0x7c')]===![]&&!_0x475817['includes'](_0x4dead5['name']);});return{'count':_0x162315[_0xe338('0x3b')][_0xe338('0x4f')],'rows':_[_0xe338('0x43')](_0x162315['fields'],function(_0x25be82){return{'id':_0x25be82[_0xe338('0x30')],'name':_0x25be82['label'],'custom':_0x25be82['custom'],'options':_0x25be82[_0xe338('0x7d')][_0xe338('0x4f')]>0x0?_[_0xe338('0x43')](_0x25be82['picklistValues'],function(_0x1de632){return{'name':_0x1de632['label'],'value':_0x1de632[_0xe338('0x7e')]};}):_0x25be82[_0xe338('0x44')]==_0xe338('0x7f')?[{'name':'True','value':_0xe338('0x80')},{'name':_0xe338('0x81'),'value':_0xe338('0x82')}]:[]};})};}})[_0xe338('0x1a')](respondWithResult(_0x2a21e1,null))['catch'](function(_0x56d602){var _0x290b2d=_0x53c756[_0xe338('0x35')][_0xe338('0x83')]?0x1f4:_0x56d602[_0xe338('0x84')]||0x1f4;logger['error'](_0xe338('0x85'),_0xe338('0x5f'),_0x290b2d,JSON[_0xe338('0x1d')](_0x56d602));delete _0x56d602[_0xe338('0x30')];if(_0x290b2d===0x191){_0x290b2d=0x190;}_0x2a21e1[_0xe338('0x25')](_0x290b2d)['send'](_0x53c756['query']['test']?{'message':_0xe338('0x86'),'statusCode':_0x56d602[_0xe338('0x84')]}:_0x56d602);});}; \ No newline at end of file +var _0x449f=['find','params','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','sobject','describe','CallDisposition','CallDurationInSeconds','CallType','Status','Type','ticketType','Case','Reason','Priority','IsEscalated','SuppliedName','custom','includes','picklistValues','value','True','true','False','statusCode','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','info','request\x20sent','debug','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','keys','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','SalesforceAccount','findAll','rows','attributes','create','body'];(function(_0x46b13b,_0x57716b){var _0x245bb6=function(_0x479b2f){while(--_0x479b2f){_0x46b13b['push'](_0x46b13b['shift']());}};_0x245bb6(++_0x57716b);}(_0x449f,0xb2));var _0xf449=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0x449f[_0x1265fa];return _0x1fe35e;};'use strict';var pdf=require(_0xf449('0x0'));var emlformat=require(_0xf449('0x1'));var rimraf=require(_0xf449('0x2'));var zipdir=require(_0xf449('0x3'));var jsonpatch=require(_0xf449('0x4'));var rp=require(_0xf449('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf449('0x6'));var sox=require(_0xf449('0x7'));var csv=require(_0xf449('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf449('0x9'));var squel=require(_0xf449('0xa'));var crypto=require(_0xf449('0xb'));var jsforce=require(_0xf449('0xc'));var deskjs=require(_0xf449('0xd'));var toCsv=require(_0xf449('0x8'));var querystring=require(_0xf449('0xe'));var Papa=require(_0xf449('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf449('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf449('0x11'))(_0xf449('0x12'));var utils=require(_0xf449('0x13'));var config=require('../../config/environment');var db=require(_0xf449('0x14'))['db'];var integrations=require(_0xf449('0x15'));var jayson=require(_0xf449('0x16'));var client=jayson[_0xf449('0x17')][_0xf449('0x18')]({'port':0x232a});function checkPasswordPattern(_0x42d3f6,_0xee8adb,_0x1a2a49){if(_0x1a2a49){var _0x423f82=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x423f82[_0xf449('0x19')](_0xee8adb)){return _0x42d3f6;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x42d3f6;}}function respondWithRpcPromise(_0x48fd98,_0x5db85e,_0x5479b5,_0xc78fd5){return new BPromise(function(_0x34413d,_0x36d760){var _0x288d80=_0xc78fd5||client;return _0x288d80[_0xf449('0x1a')](_0x48fd98,_0x5479b5)[_0xf449('0x1b')](function(_0x356f57){logger[_0xf449('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x5db85e,_0xf449('0x1d'));logger[_0xf449('0x1e')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x5db85e,_0xf449('0x1d'),JSON['stringify'](_0x356f57));if(_0x356f57[_0xf449('0x1f')]){if(_0x356f57[_0xf449('0x1f')]['code']===0x1f4){logger[_0xf449('0x1f')](_0xf449('0x20'),_0x5db85e,_0x356f57[_0xf449('0x1f')]['message']);return _0x36d760(_0x356f57[_0xf449('0x1f')][_0xf449('0x21')]);}logger[_0xf449('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x5db85e,_0x356f57[_0xf449('0x1f')][_0xf449('0x21')]);return _0x34413d(_0x356f57[_0xf449('0x1f')][_0xf449('0x21')]);}else{logger[_0xf449('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x5db85e,_0xf449('0x1d'));_0x34413d(_0x356f57[_0xf449('0x22')]['message']);}})[_0xf449('0x23')](function(_0x2f1f8a){logger[_0xf449('0x1f')](_0xf449('0x20'),_0x5db85e,_0x2f1f8a);_0x36d760(_0x2f1f8a);});});}function respondWithStatusCode(_0x272a48,_0x45e1ff){_0x45e1ff=_0x45e1ff||0xcc;return function(_0x5ad867){if(_0x5ad867){return _0x272a48[_0xf449('0x24')](_0x45e1ff);}return _0x272a48[_0xf449('0x25')](_0x45e1ff)['end']();};}function respondWithResult(_0x24936a,_0x4ae6cf){_0x4ae6cf=_0x4ae6cf||0xc8;return function(_0x47cb95){if(_0x47cb95){return _0x24936a[_0xf449('0x25')](_0x4ae6cf)[_0xf449('0x26')](_0x47cb95);}};}function respondWithFilteredResult(_0x513e49,_0xe879a8){return function(_0x1fd9d0){if(_0x1fd9d0){var _0x3e46ed=_0x1fd9d0[_0xf449('0x27')],_0x10e193=_0xe879a8[_0xf449('0x28')],_0x3466ad=_0xe879a8[_0xf449('0x28')]+_0xe879a8[_0xf449('0x29')],_0x17ea9d;if(_0x3466ad>=_0x3e46ed){_0x3466ad=_0x3e46ed;_0x17ea9d=0xc8;}else{_0x17ea9d=0xce;}_0x513e49[_0xf449('0x25')](_0x17ea9d);return _0x513e49[_0xf449('0x2a')](_0xf449('0x2b'),_0x10e193+'-'+_0x3466ad+'/'+_0x3e46ed)[_0xf449('0x26')](_0x1fd9d0);}return null;};}function patchUpdates(_0x53ed4c){return function(_0x53ddbc){try{jsonpatch['apply'](_0x53ddbc,_0x53ed4c,!![]);}catch(_0x52d83a){return BPromise[_0xf449('0x2c')](_0x52d83a);}return _0x53ddbc[_0xf449('0x2d')]();};}function saveUpdates(_0x5e0b4f,_0x16511d){return function(_0x333d1b){if(_0x333d1b){return _0x333d1b[_0xf449('0x2e')](_0x5e0b4f)[_0xf449('0x1b')](function(_0x437df5){return _0x437df5;});}return null;};}function removeEntity(_0x10fe36,_0x5db38f){return function(_0x216a3f){if(_0x216a3f){return _0x216a3f[_0xf449('0x2f')]()['then'](function(){_0x10fe36[_0xf449('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d693b,_0x2d20da){return function(_0x17e1e3){if(!_0x17e1e3){_0x2d693b['sendStatus'](0x194);}return _0x17e1e3;};}function handleError(_0x3da23f,_0x23111c){_0x23111c=_0x23111c||0x1f4;return function(_0x114997){logger['error'](_0x114997['stack']);if(_0x114997['name']){delete _0x114997[_0xf449('0x30')];}_0x3da23f['status'](_0x23111c)[_0xf449('0x31')](_0x114997);};}exports['index']=function(_0x4c1d55,_0x5efa30){var _0x40889f={},_0xf02ab2={},_0x4eb824={'count':0x0,'rows':[]};var _0x343125=db['SalesforceAccount']['rawAttributes'];_0xf02ab2['model']=_[_0xf449('0x32')](_0x343125);_0xf02ab2[_0xf449('0x33')]=_[_0xf449('0x32')](_0x4c1d55[_0xf449('0x33')]);_0xf02ab2[_0xf449('0x34')]=_[_0xf449('0x35')](_0xf02ab2[_0xf449('0x36')],_0xf02ab2[_0xf449('0x33')]);_0x40889f['attributes']=_[_0xf449('0x35')](_0xf02ab2[_0xf449('0x36')],qs[_0xf449('0x37')](_0x4c1d55[_0xf449('0x33')][_0xf449('0x37')]));_0x40889f['attributes']=_0x40889f['attributes'][_0xf449('0x38')]?_0x40889f['attributes']:_0xf02ab2[_0xf449('0x36')];if(!_0x4c1d55['query'][_0xf449('0x39')](_0xf449('0x3a'))){_0x40889f[_0xf449('0x29')]=qs['limit'](_0x4c1d55[_0xf449('0x33')]['limit']);_0x40889f[_0xf449('0x28')]=qs[_0xf449('0x28')](_0x4c1d55['query']['offset']);}_0x40889f[_0xf449('0x3b')]=qs[_0xf449('0x3c')](_0x4c1d55[_0xf449('0x33')][_0xf449('0x3c')]);_0x40889f[_0xf449('0x3d')]=qs['filters'](_[_0xf449('0x3e')](_0x4c1d55[_0xf449('0x33')],_0xf02ab2[_0xf449('0x34')]));if(_0x4c1d55[_0xf449('0x33')][_0xf449('0x3f')]){_0x40889f['where']=_[_0xf449('0x40')](_0x40889f[_0xf449('0x3d')],{'$or':_[_0xf449('0x41')](_0x343125,function(_0xb73a68){if(_0xb73a68[_0xf449('0x42')][_0xf449('0x43')]!==_0xf449('0x44')){var _0x1113ba={};_0x1113ba[_0xb73a68['field']]={'$like':'%'+_0x4c1d55[_0xf449('0x33')]['filter']+'%'};return _0x1113ba;}})});}_0x40889f=_['merge']({},_0x40889f,_0x4c1d55[_0xf449('0x45')]);var _0x39a4a2={'where':_0x40889f[_0xf449('0x3d')]};return db['SalesforceAccount'][_0xf449('0x27')](_0x39a4a2)[_0xf449('0x1b')](function(_0x45a373){_0x4eb824[_0xf449('0x27')]=_0x45a373;if(_0x4c1d55[_0xf449('0x33')][_0xf449('0x46')]){_0x40889f[_0xf449('0x47')]=[{'all':!![]}];}return db[_0xf449('0x48')][_0xf449('0x49')](_0x40889f);})[_0xf449('0x1b')](function(_0x10733a){_0x4eb824[_0xf449('0x4a')]=_0x10733a;return _0x4eb824;})['then'](respondWithFilteredResult(_0x5efa30,_0x40889f))[_0xf449('0x23')](handleError(_0x5efa30,null));};exports['show']=function(_0x3f9873,_0x2b8cd4){var _0x13dc24={'raw':![],'where':{'id':_0x3f9873['params']['id']}},_0x24e9f0={};_0x24e9f0[_0xf449('0x36')]=_[_0xf449('0x32')](db['SalesforceAccount']['rawAttributes']);_0x24e9f0['query']=_['keys'](_0x3f9873[_0xf449('0x33')]);_0x24e9f0[_0xf449('0x34')]=_[_0xf449('0x35')](_0x24e9f0['model'],_0x24e9f0[_0xf449('0x33')]);_0x13dc24[_0xf449('0x4b')]=_[_0xf449('0x35')](_0x24e9f0['model'],qs[_0xf449('0x37')](_0x3f9873[_0xf449('0x33')][_0xf449('0x37')]));_0x13dc24[_0xf449('0x4b')]=_0x13dc24['attributes'][_0xf449('0x38')]?_0x13dc24[_0xf449('0x4b')]:_0x24e9f0['model'];if(_0x3f9873[_0xf449('0x33')][_0xf449('0x46')]){_0x13dc24[_0xf449('0x47')]=[{'all':!![]}];}_0x13dc24=_[_0xf449('0x40')]({},_0x13dc24,_0x3f9873[_0xf449('0x45')]);return db[_0xf449('0x48')]['find'](_0x13dc24)['then'](handleEntityNotFound(_0x2b8cd4,null))[_0xf449('0x1b')](respondWithResult(_0x2b8cd4,null))[_0xf449('0x23')](handleError(_0x2b8cd4,null));};exports[_0xf449('0x4c')]=function(_0x1161b8,_0x22e15b){return db[_0xf449('0x48')][_0xf449('0x4c')](_0x1161b8[_0xf449('0x4d')],{})[_0xf449('0x1b')](respondWithResult(_0x22e15b,0xc9))[_0xf449('0x23')](handleError(_0x22e15b,null));};exports[_0xf449('0x2e')]=function(_0x4ccb15,_0x3fca03){if(_0x4ccb15[_0xf449('0x4d')]['id']){delete _0x4ccb15['body']['id'];}return db[_0xf449('0x48')][_0xf449('0x4e')]({'where':{'id':_0x4ccb15['params']['id']}})['then'](handleEntityNotFound(_0x3fca03,null))['then'](saveUpdates(_0x4ccb15[_0xf449('0x4d')],null))[_0xf449('0x1b')](respondWithResult(_0x3fca03,null))[_0xf449('0x23')](handleError(_0x3fca03,null));};exports[_0xf449('0x2f')]=function(_0x2fc38e,_0x157d4e){return db[_0xf449('0x48')]['find']({'where':{'id':_0x2fc38e[_0xf449('0x4f')]['id']}})[_0xf449('0x1b')](handleEntityNotFound(_0x157d4e,null))[_0xf449('0x1b')](removeEntity(_0x157d4e,null))[_0xf449('0x23')](handleError(_0x157d4e,null));};exports[_0xf449('0x50')]=function(_0x24ba45,_0x244618,_0x4969a7){var _0x5483ef={};var _0xe0b4cf={};var _0x4a0d17;var _0x20df74;return db['SalesforceAccount']['findOne']({'where':{'id':_0x24ba45[_0xf449('0x4f')]['id']}})[_0xf449('0x1b')](handleEntityNotFound(_0x244618,null))[_0xf449('0x1b')](function(_0x46636d){if(_0x46636d){_0x4a0d17=_0x46636d;_0xe0b4cf[_0xf449('0x36')]=_[_0xf449('0x32')](db[_0xf449('0x51')]['rawAttributes']);_0xe0b4cf[_0xf449('0x33')]=_[_0xf449('0x32')](_0x24ba45[_0xf449('0x33')]);_0xe0b4cf[_0xf449('0x34')]=_[_0xf449('0x35')](_0xe0b4cf[_0xf449('0x36')],_0xe0b4cf[_0xf449('0x33')]);_0x5483ef[_0xf449('0x4b')]=_[_0xf449('0x35')](_0xe0b4cf[_0xf449('0x36')],qs[_0xf449('0x37')](_0x24ba45[_0xf449('0x33')][_0xf449('0x37')]));_0x5483ef[_0xf449('0x4b')]=_0x5483ef['attributes'][_0xf449('0x38')]?_0x5483ef[_0xf449('0x4b')]:_0xe0b4cf[_0xf449('0x36')];_0x5483ef[_0xf449('0x3b')]=qs[_0xf449('0x3c')](_0x24ba45[_0xf449('0x33')][_0xf449('0x3c')]);_0x5483ef[_0xf449('0x3d')]=qs[_0xf449('0x34')](_[_0xf449('0x3e')](_0x24ba45[_0xf449('0x33')],_0xe0b4cf[_0xf449('0x34')]));if(_0x24ba45[_0xf449('0x33')][_0xf449('0x3f')]){_0x5483ef[_0xf449('0x3d')]=_[_0xf449('0x40')](_0x5483ef[_0xf449('0x3d')],{'$or':_[_0xf449('0x41')](_0x5483ef[_0xf449('0x4b')],function(_0x5c3359){var _0x24387e={};_0x24387e[_0x5c3359]={'$like':'%'+_0x24ba45[_0xf449('0x33')][_0xf449('0x3f')]+'%'};return _0x24387e;})});}_0x5483ef=_[_0xf449('0x40')]({},_0x5483ef,_0x24ba45['options']);return _0x4a0d17['getConfigurations'](_0x5483ef);}})[_0xf449('0x1b')](function(_0x5c1aa1){if(_0x5c1aa1){_0x20df74=_0x5c1aa1['length'];if(!_0x24ba45[_0xf449('0x33')][_0xf449('0x39')](_0xf449('0x3a'))){_0x5483ef[_0xf449('0x29')]=qs['limit'](_0x24ba45['query'][_0xf449('0x29')]);_0x5483ef['offset']=qs[_0xf449('0x28')](_0x24ba45[_0xf449('0x33')][_0xf449('0x28')]);}return _0x4a0d17[_0xf449('0x50')](_0x5483ef);}})[_0xf449('0x1b')](function(_0x4a9614){if(_0x4a9614){return _0x4a9614?{'count':_0x20df74,'rows':_0x4a9614}:null;}})[_0xf449('0x1b')](respondWithResult(_0x244618,null))['catch'](handleError(_0x244618,null));};exports[_0xf449('0x52')]=function(_0x1ff937,_0x152589,_0x281799){if(_0x1ff937[_0xf449('0x4d')]['id']){delete _0x1ff937[_0xf449('0x4d')]['id'];}return db['SalesforceAccount'][_0xf449('0x53')]({'where':{'id':_0x1ff937['params']['id']}})[_0xf449('0x1b')](handleEntityNotFound(_0x152589,null))[_0xf449('0x1b')](function(_0x4bae70){if(_0x4bae70){_0x1ff937[_0xf449('0x4d')][_0xf449('0x54')]=_0x4bae70['id'];_0x1ff937[_0xf449('0x4d')][_0xf449('0x55')]=integrations[_0xf449('0x56')](_0x1ff937[_0xf449('0x4d')][_0xf449('0x57')],_0x1ff937[_0xf449('0x4d')][_0xf449('0x42')]);_0x1ff937[_0xf449('0x4d')][_0xf449('0x58')]=integrations[_0xf449('0x59')](_0x1ff937[_0xf449('0x4d')][_0xf449('0x57')],_0x1ff937[_0xf449('0x4d')][_0xf449('0x42')]);return db[_0xf449('0x51')]['create'](_0x1ff937[_0xf449('0x4d')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xf449('0x5a')],'as':_0xf449('0x58')}]});}return null;})['then'](respondWithResult(_0x152589,null))[_0xf449('0x23')](handleError(_0x152589,null));};exports[_0xf449('0x5b')]=function(_0x29e0cd,_0x788840,_0x40dc4c){var _0x1631f2;var _0x509a25='';var _0x19c742=_0xf449('0x5c');return db[_0xf449('0x48')][_0xf449('0x53')]({'where':{'id':_0x29e0cd[_0xf449('0x4f')]['id']},'attributes':['id',_0xf449('0x5d'),_0xf449('0x5e'),'clientSecret',_0xf449('0x5f'),_0xf449('0x60'),'securityToken']})[_0xf449('0x1b')](handleEntityNotFound(_0x788840,null))[_0xf449('0x1b')](function(_0x5792b5){if(_0x5792b5){_0x509a25=_0x5792b5['remoteUri'];var _0x30fb74=_0x509a25[_0xf449('0x61')](-0x1);if(_0x30fb74==='/'){_0x509a25=_0x509a25[_0xf449('0x62')](0x0,_0x509a25[_0xf449('0x63')](_0x30fb74));}_0x1631f2=new jsforce[(_0xf449('0x64'))]({'oauth2':{'loginUrl':_0x509a25,'clientId':_0x5792b5['clientId'],'clientSecret':_0x5792b5['clientSecret']}});return _0x1631f2[_0xf449('0x65')](_0x5792b5[_0xf449('0x5f')],_0x5792b5[_0xf449('0x60')][_0xf449('0x66')](_0x5792b5[_0xf449('0x67')]));}})[_0xf449('0x1b')](function(_0x4f8ca4){if(_0x4f8ca4){if(!_[_0xf449('0x68')](_0x29e0cd['query']['ticketType'])){_0x19c742=_0x29e0cd['query']['ticketType'];}return _0x1631f2[_0xf449('0x69')](_0x19c742)[_0xf449('0x6a')]();}})[_0xf449('0x1b')](function(_0x5db97d){var _0x16018c=[_0xf449('0x6b'),_0xf449('0x6c'),'CallObject',_0xf449('0x6d'),'IsArchived','Priority',_0xf449('0x6e'),_0xf449('0x6f')];if(!_[_0xf449('0x68')](_0x29e0cd[_0xf449('0x33')][_0xf449('0x70')])&&_0x29e0cd[_0xf449('0x33')][_0xf449('0x70')]===_0xf449('0x71')){_0x16018c=[_0xf449('0x6f'),'Origin',_0xf449('0x72'),_0xf449('0x6e'),_0xf449('0x73'),_0xf449('0x74'),_0xf449('0x75'),'SuppliedCompany'];}if(_0x5db97d){_['remove'](_0x5db97d[_0xf449('0x37')],function(_0x57c2ac){return _0x57c2ac[_0xf449('0x76')]===![]&&!_0x16018c[_0xf449('0x77')](_0x57c2ac['name']);});return{'count':_0x5db97d[_0xf449('0x37')][_0xf449('0x38')],'rows':_['map'](_0x5db97d['fields'],function(_0x4fda25){return{'id':_0x4fda25[_0xf449('0x30')],'name':_0x4fda25['label'],'custom':_0x4fda25[_0xf449('0x76')],'options':_0x4fda25['picklistValues'][_0xf449('0x38')]>0x0?_[_0xf449('0x41')](_0x4fda25[_0xf449('0x78')],function(_0x5896f0){return{'name':_0x5896f0['label'],'value':_0x5896f0[_0xf449('0x79')]};}):_0x4fda25[_0xf449('0x42')]=='boolean'?[{'name':_0xf449('0x7a'),'value':_0xf449('0x7b')},{'name':_0xf449('0x7c'),'value':'false'}]:[]};})};}})[_0xf449('0x1b')](respondWithResult(_0x788840,null))['catch'](function(_0x137025){var _0x27df8e=_0x29e0cd[_0xf449('0x33')]['test']?0x1f4:_0x137025[_0xf449('0x7d')]||0x1f4;logger[_0xf449('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xf449('0x5b'),_0x27df8e,JSON[_0xf449('0x7e')](_0x137025));delete _0x137025[_0xf449('0x30')];if(_0x27df8e===0x191){_0x27df8e=0x190;}_0x788840[_0xf449('0x25')](_0x27df8e)[_0xf449('0x31')](_0x29e0cd[_0xf449('0x33')][_0xf449('0x19')]?{'message':_0xf449('0x7f'),'statusCode':_0x137025[_0xf449('0x7d')]}:_0x137025);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 12b46c1..f96aab0 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 _0x536f=['lodash','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','int_salesforce_accounts'];(function(_0x3bb418,_0x4b5550){var _0x57344c=function(_0x5c53bb){while(--_0x5c53bb){_0x3bb418['push'](_0x3bb418['shift']());}};_0x57344c(++_0x4b5550);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf536('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf536('0x1'));var rp=require(_0xf536('0x2'));var fs=require('fs');var path=require(_0xf536('0x3'));var rimraf=require(_0xf536('0x4'));var config=require('../../config/environment');var attributes=require(_0xf536('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xf536('0x6')]=function(_0x7e339b,_0x2fc517){return _0x7e339b['define']('SalesforceAccount',attributes,{'tableName':_0xf536('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ec6=['moment','request-promise','rimraf','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x277343,_0x1c3b8d){var _0x6a51b2=function(_0x4bafca){while(--_0x4bafca){_0x277343['push'](_0x277343['shift']());}};_0x6a51b2(++_0x1c3b8d);}(_0x5ec6,0x7f));var _0x65ec=function(_0x33137c,_0x2abf7e){_0x33137c=_0x33137c-0x0;var _0x54bf0f=_0x5ec6[_0x33137c];return _0x54bf0f;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var logger=require(_0x65ec('0x2'))('api');var moment=require(_0x65ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x65ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x65ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x65ec('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x65ec('0x7')]=function(_0xbb2e56,_0x5d6254){return _0xbb2e56[_0x65ec('0x8')](_0x65ec('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index e1d3c4d..b45ad48 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 _0x9eb0=['catch','ShowSalesforceAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','raw','options','attributes','limit','include','map','model','GetSalesforceAccount'];(function(_0x2fb55e,_0x1811ba){var _0x4bd46d=function(_0x44466b){while(--_0x44466b){_0x2fb55e['push'](_0x2fb55e['shift']());}};_0x4bd46d(++_0x1811ba);}(_0x9eb0,0x185));var _0x09eb=function(_0x314bbf,_0x50b79e){_0x314bbf=_0x314bbf-0x0;var _0x3c8bb5=_0x9eb0[_0x314bbf];return _0x3c8bb5;};'use strict';var _=require(_0x09eb('0x0'));var util=require(_0x09eb('0x1'));var moment=require(_0x09eb('0x2'));var BPromise=require(_0x09eb('0x3'));var rs=require(_0x09eb('0x4'));var fs=require('fs');var Redis=require(_0x09eb('0x5'));var db=require(_0x09eb('0x6'))['db'];var utils=require(_0x09eb('0x7'));var logger=require(_0x09eb('0x8'))(_0x09eb('0x9'));var config=require('../../config/environment');var jayson=require(_0x09eb('0xa'));var client=jayson[_0x09eb('0xb')][_0x09eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ce30f,_0x493c36,_0x2c2434){return new BPromise(function(_0x982b0f,_0x5ced57){return client[_0x09eb('0xd')](_0x4ce30f,_0x2c2434)[_0x09eb('0xe')](function(_0x3f52f5){logger[_0x09eb('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x493c36,'request\x20sent');logger[_0x09eb('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x493c36,'request\x20sent',JSON[_0x09eb('0x11')](_0x3f52f5));if(_0x3f52f5[_0x09eb('0x12')]){if(_0x3f52f5[_0x09eb('0x12')][_0x09eb('0x13')]===0x1f4){logger[_0x09eb('0x12')](_0x09eb('0x14'),_0x493c36,_0x3f52f5[_0x09eb('0x12')][_0x09eb('0x15')]);return _0x5ced57(_0x3f52f5['error'][_0x09eb('0x15')]);}logger[_0x09eb('0x12')](_0x09eb('0x14'),_0x493c36,_0x3f52f5['error'][_0x09eb('0x15')]);return _0x982b0f(_0x3f52f5[_0x09eb('0x12')][_0x09eb('0x15')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x493c36,'request\x20sent');_0x982b0f(_0x3f52f5[_0x09eb('0x16')][_0x09eb('0x15')]);}})['catch'](function(_0x3fd163){logger[_0x09eb('0x12')](_0x09eb('0x14'),_0x493c36,_0x3fd163);_0x5ced57(_0x3fd163);});});}exports['GetSalesforceAccount']=function(_0x5ed998){var _0x3652f1=this;return new Promise(function(_0x435c2a,_0x2492ef){return db['SalesforceAccount']['findAll']({'raw':_0x5ed998['options']?_0x5ed998['options'][_0x09eb('0x17')]===undefined?!![]:![]:!![],'where':_0x5ed998[_0x09eb('0x18')]?_0x5ed998[_0x09eb('0x18')]['where']||null:null,'attributes':_0x5ed998[_0x09eb('0x18')]?_0x5ed998['options'][_0x09eb('0x19')]||null:null,'limit':_0x5ed998[_0x09eb('0x18')]?_0x5ed998[_0x09eb('0x18')][_0x09eb('0x1a')]||null:null,'include':_0x5ed998[_0x09eb('0x18')]?_0x5ed998[_0x09eb('0x18')][_0x09eb('0x1b')]?_[_0x09eb('0x1c')](_0x5ed998[_0x09eb('0x18')][_0x09eb('0x1b')],function(_0x54a4c9){return{'model':db[_0x54a4c9['model']],'as':_0x54a4c9['as'],'attributes':_0x54a4c9['attributes'],'include':_0x54a4c9['include']?_['map'](_0x54a4c9[_0x09eb('0x1b')],function(_0x3ba6c6){return{'model':db[_0x3ba6c6[_0x09eb('0x1d')]],'as':_0x3ba6c6['as'],'attributes':_0x3ba6c6[_0x09eb('0x19')],'include':_0x3ba6c6[_0x09eb('0x1b')]?_['map'](_0x3ba6c6[_0x09eb('0x1b')],function(_0x2b2933){return{'model':db[_0x2b2933[_0x09eb('0x1d')]],'as':_0x2b2933['as'],'attributes':_0x2b2933[_0x09eb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x09eb('0xe')](function(_0x53f6dc){logger[_0x09eb('0xf')](_0x09eb('0x1e'),_0x5ed998);logger[_0x09eb('0x10')](_0x09eb('0x1e'),_0x5ed998,JSON[_0x09eb('0x11')](_0x53f6dc));_0x435c2a(_0x53f6dc);})[_0x09eb('0x1f')](function(_0x37e8ea){logger['error'](_0x09eb('0x1e'),_0x37e8ea[_0x09eb('0x15')],_0x5ed998);_0x2492ef(_0x3652f1[_0x09eb('0x12')](0x1f4,_0x37e8ea[_0x09eb('0x15')]));});});};exports[_0x09eb('0x20')]=function(_0x731f99){var _0x236912=this;return new Promise(function(_0x5ea7ac,_0x52bb84){return db['SalesforceAccount'][_0x09eb('0x21')]({'raw':_0x731f99[_0x09eb('0x18')]?_0x731f99[_0x09eb('0x18')][_0x09eb('0x17')]===undefined?!![]:![]:!![],'where':_0x731f99[_0x09eb('0x18')]?_0x731f99[_0x09eb('0x18')][_0x09eb('0x22')]||null:null,'attributes':_0x731f99[_0x09eb('0x18')]?_0x731f99[_0x09eb('0x18')][_0x09eb('0x19')]||null:null,'include':_0x731f99['options']?_0x731f99['options']['include']?_[_0x09eb('0x1c')](_0x731f99['options'][_0x09eb('0x1b')],function(_0x4ec468){return{'model':db[_0x4ec468['model']],'as':_0x4ec468['as'],'attributes':_0x4ec468[_0x09eb('0x19')],'include':_0x4ec468['include']?_[_0x09eb('0x1c')](_0x4ec468['include'],function(_0xd8002d){return{'model':db[_0xd8002d[_0x09eb('0x1d')]],'as':_0xd8002d['as'],'attributes':_0xd8002d['attributes'],'include':_0xd8002d['include']?_[_0x09eb('0x1c')](_0xd8002d['include'],function(_0x410983){return{'model':db[_0x410983[_0x09eb('0x1d')]],'as':_0x410983['as'],'attributes':_0x410983['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x389110){logger[_0x09eb('0xf')]('ShowSalesforceAccount',_0x731f99);logger[_0x09eb('0x10')]('ShowSalesforceAccount',_0x731f99,JSON[_0x09eb('0x11')](_0x389110));_0x5ea7ac(_0x389110);})[_0x09eb('0x1f')](function(_0x1dafdd){logger[_0x09eb('0x12')]('ShowSalesforceAccount',_0x1dafdd[_0x09eb('0x15')],_0x731f99);_0x52bb84(_0x236912[_0x09eb('0x12')](0x1f4,_0x1dafdd['message']));});});}; \ No newline at end of file +var _0x8fae=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','attributes','model','find','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x8fae,0x13d));var _0xe8fa=function(_0x31e9b4,_0x4473f6){_0x31e9b4=_0x31e9b4-0x0;var _0x1ada54=_0x8fae[_0x31e9b4];return _0x1ada54;};'use strict';var _=require(_0xe8fa('0x0'));var util=require(_0xe8fa('0x1'));var moment=require(_0xe8fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8fa('0x3'));var fs=require('fs');var Redis=require(_0xe8fa('0x4'));var db=require(_0xe8fa('0x5'))['db'];var utils=require(_0xe8fa('0x6'));var logger=require(_0xe8fa('0x7'))(_0xe8fa('0x8'));var config=require(_0xe8fa('0x9'));var jayson=require(_0xe8fa('0xa'));var client=jayson[_0xe8fa('0xb')][_0xe8fa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44398b,_0x153244,_0x58dca5){return new BPromise(function(_0x324952,_0x4422ae){return client[_0xe8fa('0xd')](_0x44398b,_0x58dca5)[_0xe8fa('0xe')](function(_0x55f8bc){logger[_0xe8fa('0xf')](_0xe8fa('0x10'),_0x153244,_0xe8fa('0x11'));logger[_0xe8fa('0x12')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x153244,_0xe8fa('0x11'),JSON[_0xe8fa('0x13')](_0x55f8bc));if(_0x55f8bc[_0xe8fa('0x14')]){if(_0x55f8bc[_0xe8fa('0x14')][_0xe8fa('0x15')]===0x1f4){logger['error'](_0xe8fa('0x10'),_0x153244,_0x55f8bc['error'][_0xe8fa('0x16')]);return _0x4422ae(_0x55f8bc[_0xe8fa('0x14')][_0xe8fa('0x16')]);}logger[_0xe8fa('0x14')](_0xe8fa('0x10'),_0x153244,_0x55f8bc[_0xe8fa('0x14')]['message']);return _0x324952(_0x55f8bc[_0xe8fa('0x14')][_0xe8fa('0x16')]);}else{logger[_0xe8fa('0xf')](_0xe8fa('0x10'),_0x153244,_0xe8fa('0x11'));_0x324952(_0x55f8bc['result'][_0xe8fa('0x16')]);}})[_0xe8fa('0x17')](function(_0x2f7b46){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x153244,_0x2f7b46);_0x4422ae(_0x2f7b46);});});}exports[_0xe8fa('0x18')]=function(_0x2fe5a4){var _0x356570=this;return new Promise(function(_0x3a3a3c,_0x41584c){return db[_0xe8fa('0x19')][_0xe8fa('0x1a')]({'raw':_0x2fe5a4[_0xe8fa('0x1b')]?_0x2fe5a4[_0xe8fa('0x1b')][_0xe8fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fe5a4[_0xe8fa('0x1b')]?_0x2fe5a4['options']['where']||null:null,'attributes':_0x2fe5a4[_0xe8fa('0x1b')]?_0x2fe5a4[_0xe8fa('0x1b')]['attributes']||null:null,'limit':_0x2fe5a4[_0xe8fa('0x1b')]?_0x2fe5a4[_0xe8fa('0x1b')][_0xe8fa('0x1d')]||null:null,'include':_0x2fe5a4[_0xe8fa('0x1b')]?_0x2fe5a4[_0xe8fa('0x1b')][_0xe8fa('0x1e')]?_[_0xe8fa('0x1f')](_0x2fe5a4[_0xe8fa('0x1b')]['include'],function(_0x3b6884){return{'model':db[_0x3b6884['model']],'as':_0x3b6884['as'],'attributes':_0x3b6884['attributes'],'include':_0x3b6884[_0xe8fa('0x1e')]?_[_0xe8fa('0x1f')](_0x3b6884[_0xe8fa('0x1e')],function(_0x2fae2a){return{'model':db[_0x2fae2a['model']],'as':_0x2fae2a['as'],'attributes':_0x2fae2a[_0xe8fa('0x20')],'include':_0x2fae2a[_0xe8fa('0x1e')]?_[_0xe8fa('0x1f')](_0x2fae2a['include'],function(_0x20c7fe){return{'model':db[_0x20c7fe[_0xe8fa('0x21')]],'as':_0x20c7fe['as'],'attributes':_0x20c7fe[_0xe8fa('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1925ae){logger['info']('GetSalesforceAccount',_0x2fe5a4);logger[_0xe8fa('0x12')](_0xe8fa('0x18'),_0x2fe5a4,JSON[_0xe8fa('0x13')](_0x1925ae));_0x3a3a3c(_0x1925ae);})[_0xe8fa('0x17')](function(_0x1df26e){logger[_0xe8fa('0x14')](_0xe8fa('0x18'),_0x1df26e[_0xe8fa('0x16')],_0x2fe5a4);_0x41584c(_0x356570[_0xe8fa('0x14')](0x1f4,_0x1df26e[_0xe8fa('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x44d424){var _0x5edbec=this;return new Promise(function(_0x3343af,_0x1c2f4e){return db[_0xe8fa('0x19')][_0xe8fa('0x22')]({'raw':_0x44d424['options']?_0x44d424['options'][_0xe8fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x44d424[_0xe8fa('0x1b')]?_0x44d424['options']['where']||null:null,'attributes':_0x44d424[_0xe8fa('0x1b')]?_0x44d424[_0xe8fa('0x1b')][_0xe8fa('0x20')]||null:null,'include':_0x44d424[_0xe8fa('0x1b')]?_0x44d424[_0xe8fa('0x1b')][_0xe8fa('0x1e')]?_[_0xe8fa('0x1f')](_0x44d424[_0xe8fa('0x1b')]['include'],function(_0x2d790c){return{'model':db[_0x2d790c[_0xe8fa('0x21')]],'as':_0x2d790c['as'],'attributes':_0x2d790c['attributes'],'include':_0x2d790c[_0xe8fa('0x1e')]?_[_0xe8fa('0x1f')](_0x2d790c[_0xe8fa('0x1e')],function(_0x4595e5){return{'model':db[_0x4595e5[_0xe8fa('0x21')]],'as':_0x4595e5['as'],'attributes':_0x4595e5['attributes'],'include':_0x4595e5[_0xe8fa('0x1e')]?_['map'](_0x4595e5[_0xe8fa('0x1e')],function(_0x49a403){return{'model':db[_0x49a403['model']],'as':_0x49a403['as'],'attributes':_0x49a403[_0xe8fa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe8fa('0xe')](function(_0x1c7804){logger['info'](_0xe8fa('0x23'),_0x44d424);logger['debug'](_0xe8fa('0x23'),_0x44d424,JSON['stringify'](_0x1c7804));_0x3343af(_0x1c7804);})[_0xe8fa('0x17')](function(_0x499d79){logger[_0xe8fa('0x14')](_0xe8fa('0x23'),_0x499d79[_0xe8fa('0x16')],_0x44d424);_0x1c2f4e(_0x5edbec['error'](0x1f4,_0x499d79[_0xe8fa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 266dd3f..c3ea38b 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 _0x2004=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0x2004,0x10b));var _0x4200=function(_0x420276,_0x24d91a){_0x420276=_0x420276-0x0;var _0x276093=_0x2004[_0x420276];return _0x276093;};'use strict';var multer=require(_0x4200('0x0'));var util=require(_0x4200('0x1'));var path=require(_0x4200('0x2'));var timeout=require(_0x4200('0x3'));var express=require(_0x4200('0x4'));var router=express[_0x4200('0x5')]();var auth=require(_0x4200('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4200('0x7'));var controller=require(_0x4200('0x8'));router[_0x4200('0x9')]('/',auth[_0x4200('0xa')](),controller[_0x4200('0xb')]);router[_0x4200('0x9')](_0x4200('0xc'),auth[_0x4200('0xa')](),controller['show']);router[_0x4200('0x9')](_0x4200('0xd'),auth['isAuthenticated'](),controller[_0x4200('0xe')]);router[_0x4200('0x9')]('/:id/subjects',auth[_0x4200('0xa')](),controller[_0x4200('0xf')]);router['get'](_0x4200('0x10'),auth[_0x4200('0xa')](),controller[_0x4200('0x11')]);router[_0x4200('0x12')]('/',auth[_0x4200('0xa')](),controller['create']);router[_0x4200('0x13')](_0x4200('0xc'),auth[_0x4200('0xa')](),controller[_0x4200('0x14')]);router[_0x4200('0x15')](_0x4200('0xc'),auth['isAuthenticated'](),controller[_0x4200('0x16')]);module[_0x4200('0x17')]=router; \ No newline at end of file +var _0xeeca=['express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x43ab53,_0x4715e6){var _0x2bf9b1=function(_0x4f414b){while(--_0x4f414b){_0x43ab53['push'](_0x43ab53['shift']());}};_0x2bf9b1(++_0x4715e6);}(_0xeeca,0x1e1));var _0xaeec=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xeeca[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xaeec('0x0'));var util=require(_0xaeec('0x1'));var path=require('path');var timeout=require(_0xaeec('0x2'));var express=require(_0xaeec('0x3'));var router=express[_0xaeec('0x4')]();var auth=require(_0xaeec('0x5'));var interaction=require(_0xaeec('0x6'));var config=require('../../config/environment');var controller=require(_0xaeec('0x7'));router[_0xaeec('0x8')]('/',auth[_0xaeec('0x9')](),controller['index']);router[_0xaeec('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xaeec('0xa')]);router[_0xaeec('0x8')](_0xaeec('0xb'),auth[_0xaeec('0x9')](),controller[_0xaeec('0xc')]);router[_0xaeec('0x8')](_0xaeec('0xd'),auth['isAuthenticated'](),controller[_0xaeec('0xe')]);router['get'](_0xaeec('0xf'),auth[_0xaeec('0x9')](),controller['getDescriptions']);router[_0xaeec('0x10')]('/',auth[_0xaeec('0x9')](),controller[_0xaeec('0x11')]);router['put']('/:id',auth[_0xaeec('0x9')](),controller[_0xaeec('0x12')]);router[_0xaeec('0x13')]('/:id',auth[_0xaeec('0x9')](),controller[_0xaeec('0x14')]);module[_0xaeec('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index afd49dc..75cdde1 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 _0x3a88=['STRING','ENUM','Task','contact_lead','contact','lead','nothing','sequelize','exports'];(function(_0x586f88,_0x1d2c8f){var _0x323829=function(_0x307be9){while(--_0x307be9){_0x586f88['push'](_0x586f88['shift']());}};_0x323829(++_0x1d2c8f);}(_0x3a88,0x130));var _0x83a8=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x3a88[_0x1fdb40];return _0x281f93;};'use strict';var Sequelize=require(_0x83a8('0x0'));module[_0x83a8('0x1')]={'name':{'type':Sequelize[_0x83a8('0x2')]},'description':{'type':Sequelize[_0x83a8('0x2')]},'ticketType':{'type':Sequelize[_0x83a8('0x3')]('Task','Case'),'defaultValue':_0x83a8('0x4')},'moduleSearch':{'type':Sequelize[_0x83a8('0x3')](_0x83a8('0x5'),_0x83a8('0x6'),_0x83a8('0x7')),'defaultValue':_0x83a8('0x5')},'moduleCreate':{'type':Sequelize[_0x83a8('0x3')](_0x83a8('0x8'),'contact',_0x83a8('0x7')),'defaultValue':'lead'}}; \ No newline at end of file +var _0x918e=['nothing','lead','exports','STRING','ENUM','Task','Case','contact'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x918e,0x82));var _0xe918=function(_0x468989,_0x2d7d05){_0x468989=_0x468989-0x0;var _0x3de51b=_0x918e[_0x468989];return _0x3de51b;};'use strict';var Sequelize=require('sequelize');module[_0xe918('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe918('0x1')]},'ticketType':{'type':Sequelize[_0xe918('0x2')](_0xe918('0x3'),_0xe918('0x4')),'defaultValue':_0xe918('0x3')},'moduleSearch':{'type':Sequelize[_0xe918('0x2')]('contact_lead',_0xe918('0x5'),'lead'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xe918('0x2')](_0xe918('0x6'),_0xe918('0x5'),'lead'),'defaultValue':_0xe918('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 689e069..7cd5218 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 _0x0740=['include','findAll','length','find','create','body','update','params','destroy','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','json','count','offset','status','set','Content-Range','save','stack','name','send','index','SalesforceConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','merge','map','type','key','filter','options','includeAll'];(function(_0x56fb73,_0x491492){var _0xa9dd3=function(_0x3411dc){while(--_0x3411dc){_0x56fb73['push'](_0x56fb73['shift']());}};_0xa9dd3(++_0x491492);}(_0x0740,0x14f));var _0x0074=function(_0x4cc646,_0x43de8a){_0x4cc646=_0x4cc646-0x0;var _0xa533ee=_0x0740[_0x4cc646];return _0xa533ee;};'use strict';var pdf=require(_0x0074('0x0'));var emlformat=require(_0x0074('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0074('0x2'));var jsonpatch=require(_0x0074('0x3'));var rp=require(_0x0074('0x4'));var moment=require('moment');var BPromise=require(_0x0074('0x5'));var Mustache=require(_0x0074('0x6'));var util=require(_0x0074('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0074('0x8'));var ejs=require(_0x0074('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0074('0xa'));var crypto=require(_0x0074('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0074('0x8'));var querystring=require(_0x0074('0xc'));var Papa=require('papaparse');var Redis=require(_0x0074('0xd'));var authService=require(_0x0074('0xe'));var qs=require(_0x0074('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0074('0x10'));var utils=require(_0x0074('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0074('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c1da7,_0x513551,_0x41b68e){if(_0x41b68e){var _0x27aa79=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27aa79[_0x0074('0x13')](_0x513551)){return _0x4c1da7;}else{throw new Error(_0x0074('0x14'));}}else{return _0x4c1da7;}}function respondWithRpcPromise(_0x243aa7,_0x9b89c9,_0x2a65a8,_0x1b9db8){return new BPromise(function(_0x52ad5d,_0x33d720){var _0x4faeeb=_0x1b9db8||client;return _0x4faeeb['request'](_0x243aa7,_0x2a65a8)[_0x0074('0x15')](function(_0x18ebfc){logger[_0x0074('0x16')](_0x0074('0x17'),_0x9b89c9,_0x0074('0x18'));logger[_0x0074('0x19')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x9b89c9,_0x0074('0x18'),JSON[_0x0074('0x1a')](_0x18ebfc));if(_0x18ebfc['error']){if(_0x18ebfc['error']['code']===0x1f4){logger[_0x0074('0x1b')]('SalesforceConfiguration,\x20%s,\x20%s',_0x9b89c9,_0x18ebfc[_0x0074('0x1b')][_0x0074('0x1c')]);return _0x33d720(_0x18ebfc[_0x0074('0x1b')][_0x0074('0x1c')]);}logger[_0x0074('0x1b')](_0x0074('0x17'),_0x9b89c9,_0x18ebfc[_0x0074('0x1b')][_0x0074('0x1c')]);return _0x52ad5d(_0x18ebfc[_0x0074('0x1b')][_0x0074('0x1c')]);}else{logger[_0x0074('0x16')](_0x0074('0x17'),_0x9b89c9,_0x0074('0x18'));_0x52ad5d(_0x18ebfc[_0x0074('0x1d')]['message']);}})[_0x0074('0x1e')](function(_0x26e20f){logger[_0x0074('0x1b')](_0x0074('0x17'),_0x9b89c9,_0x26e20f);_0x33d720(_0x26e20f);});});}function respondWithStatusCode(_0xc771a2,_0xd57086){_0xd57086=_0xd57086||0xcc;return function(_0x891916){if(_0x891916){return _0xc771a2[_0x0074('0x1f')](_0xd57086);}return _0xc771a2['status'](_0xd57086)['end']();};}function respondWithResult(_0x1c7f2d,_0x5027a5){_0x5027a5=_0x5027a5||0xc8;return function(_0x52a524){if(_0x52a524){return _0x1c7f2d['status'](_0x5027a5)[_0x0074('0x20')](_0x52a524);}};}function respondWithFilteredResult(_0x406bd8,_0x5cfa73){return function(_0x5eb65f){if(_0x5eb65f){var _0x4aa1bb=_0x5eb65f[_0x0074('0x21')],_0x219491=_0x5cfa73[_0x0074('0x22')],_0x449792=_0x5cfa73['offset']+_0x5cfa73['limit'],_0x5dd6ea;if(_0x449792>=_0x4aa1bb){_0x449792=_0x4aa1bb;_0x5dd6ea=0xc8;}else{_0x5dd6ea=0xce;}_0x406bd8[_0x0074('0x23')](_0x5dd6ea);return _0x406bd8[_0x0074('0x24')](_0x0074('0x25'),_0x219491+'-'+_0x449792+'/'+_0x4aa1bb)['json'](_0x5eb65f);}return null;};}function patchUpdates(_0x415869){return function(_0x55199a){try{jsonpatch['apply'](_0x55199a,_0x415869,!![]);}catch(_0x38b2ec){return BPromise['reject'](_0x38b2ec);}return _0x55199a[_0x0074('0x26')]();};}function saveUpdates(_0x216d8b,_0x228c4){return function(_0x68536a){if(_0x68536a){return _0x68536a['update'](_0x216d8b)['then'](function(_0x3f9fbb){return _0x3f9fbb;});}return null;};}function removeEntity(_0x14f708,_0x39f05d){return function(_0x3936c2){if(_0x3936c2){return _0x3936c2['destroy']()['then'](function(){_0x14f708[_0x0074('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x404340,_0x4df344){return function(_0x2e96b6){if(!_0x2e96b6){_0x404340['sendStatus'](0x194);}return _0x2e96b6;};}function handleError(_0x2af73f,_0x172ec6){_0x172ec6=_0x172ec6||0x1f4;return function(_0x194998){logger[_0x0074('0x1b')](_0x194998[_0x0074('0x27')]);if(_0x194998[_0x0074('0x28')]){delete _0x194998[_0x0074('0x28')];}_0x2af73f[_0x0074('0x23')](_0x172ec6)[_0x0074('0x29')](_0x194998);};}exports[_0x0074('0x2a')]=function(_0x2d0c87,_0x422a84){var _0x41ea43={},_0x58cf0c={},_0x46d956={'count':0x0,'rows':[]};var _0x1b1a10=db[_0x0074('0x2b')][_0x0074('0x2c')];_0x58cf0c['model']=_[_0x0074('0x2d')](_0x1b1a10);_0x58cf0c[_0x0074('0x2e')]=_[_0x0074('0x2d')](_0x2d0c87[_0x0074('0x2e')]);_0x58cf0c[_0x0074('0x2f')]=_[_0x0074('0x30')](_0x58cf0c[_0x0074('0x31')],_0x58cf0c[_0x0074('0x2e')]);_0x41ea43[_0x0074('0x32')]=_['intersection'](_0x58cf0c[_0x0074('0x31')],qs[_0x0074('0x33')](_0x2d0c87[_0x0074('0x2e')][_0x0074('0x33')]));_0x41ea43['attributes']=_0x41ea43[_0x0074('0x32')]['length']?_0x41ea43[_0x0074('0x32')]:_0x58cf0c[_0x0074('0x31')];if(!_0x2d0c87[_0x0074('0x2e')][_0x0074('0x34')]('nolimit')){_0x41ea43[_0x0074('0x35')]=qs[_0x0074('0x35')](_0x2d0c87[_0x0074('0x2e')][_0x0074('0x35')]);_0x41ea43[_0x0074('0x22')]=qs[_0x0074('0x22')](_0x2d0c87[_0x0074('0x2e')][_0x0074('0x22')]);}_0x41ea43[_0x0074('0x36')]=qs[_0x0074('0x37')](_0x2d0c87['query']['sort']);_0x41ea43[_0x0074('0x38')]=qs[_0x0074('0x2f')](_[_0x0074('0x39')](_0x2d0c87[_0x0074('0x2e')],_0x58cf0c['filters']));if(_0x2d0c87['query']['filter']){_0x41ea43[_0x0074('0x38')]=_[_0x0074('0x3a')](_0x41ea43[_0x0074('0x38')],{'$or':_[_0x0074('0x3b')](_0x1b1a10,function(_0x266de6){if(_0x266de6[_0x0074('0x3c')][_0x0074('0x3d')]!=='VIRTUAL'){var _0x40d6cc={};_0x40d6cc[_0x266de6['field']]={'$like':'%'+_0x2d0c87[_0x0074('0x2e')][_0x0074('0x3e')]+'%'};return _0x40d6cc;}})});}_0x41ea43=_[_0x0074('0x3a')]({},_0x41ea43,_0x2d0c87[_0x0074('0x3f')]);var _0x256254={'where':_0x41ea43[_0x0074('0x38')]};return db[_0x0074('0x2b')]['count'](_0x256254)[_0x0074('0x15')](function(_0x1c4b75){_0x46d956[_0x0074('0x21')]=_0x1c4b75;if(_0x2d0c87[_0x0074('0x2e')][_0x0074('0x40')]){_0x41ea43[_0x0074('0x41')]=[{'all':!![]}];}return db[_0x0074('0x2b')][_0x0074('0x42')](_0x41ea43);})[_0x0074('0x15')](function(_0x24d7a8){_0x46d956['rows']=_0x24d7a8;return _0x46d956;})[_0x0074('0x15')](respondWithFilteredResult(_0x422a84,_0x41ea43))[_0x0074('0x1e')](handleError(_0x422a84,null));};exports['show']=function(_0x5216ba,_0x26249f){var _0xcbde3a={'raw':![],'where':{'id':_0x5216ba['params']['id']}},_0x1fc6f4={};_0x1fc6f4[_0x0074('0x31')]=_['keys'](db[_0x0074('0x2b')][_0x0074('0x2c')]);_0x1fc6f4[_0x0074('0x2e')]=_[_0x0074('0x2d')](_0x5216ba[_0x0074('0x2e')]);_0x1fc6f4[_0x0074('0x2f')]=_[_0x0074('0x30')](_0x1fc6f4[_0x0074('0x31')],_0x1fc6f4[_0x0074('0x2e')]);_0xcbde3a[_0x0074('0x32')]=_[_0x0074('0x30')](_0x1fc6f4['model'],qs[_0x0074('0x33')](_0x5216ba[_0x0074('0x2e')]['fields']));_0xcbde3a[_0x0074('0x32')]=_0xcbde3a['attributes'][_0x0074('0x43')]?_0xcbde3a[_0x0074('0x32')]:_0x1fc6f4[_0x0074('0x31')];if(_0x5216ba[_0x0074('0x2e')]['includeAll']){_0xcbde3a[_0x0074('0x41')]=[{'all':!![]}];}_0xcbde3a=_[_0x0074('0x3a')]({},_0xcbde3a,_0x5216ba[_0x0074('0x3f')]);return db['SalesforceConfiguration'][_0x0074('0x44')](_0xcbde3a)[_0x0074('0x15')](handleEntityNotFound(_0x26249f,null))[_0x0074('0x15')](respondWithResult(_0x26249f,null))[_0x0074('0x1e')](handleError(_0x26249f,null));};exports['create']=function(_0x123000,_0x288832){return db['SalesforceConfiguration'][_0x0074('0x45')](_0x123000[_0x0074('0x46')],{})[_0x0074('0x15')](respondWithResult(_0x288832,0xc9))[_0x0074('0x1e')](handleError(_0x288832,null));};exports[_0x0074('0x47')]=function(_0x21dc73,_0x15461a){if(_0x21dc73[_0x0074('0x46')]['id']){delete _0x21dc73[_0x0074('0x46')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x21dc73[_0x0074('0x48')]['id']}})[_0x0074('0x15')](handleEntityNotFound(_0x15461a,null))['then'](saveUpdates(_0x21dc73['body'],null))['then'](respondWithResult(_0x15461a,null))[_0x0074('0x1e')](handleError(_0x15461a,null));};exports[_0x0074('0x49')]=function(_0x5c1004,_0x27923c){return db[_0x0074('0x2b')][_0x0074('0x44')]({'where':{'id':_0x5c1004[_0x0074('0x48')]['id']}})[_0x0074('0x15')](handleEntityNotFound(_0x27923c,null))[_0x0074('0x15')](removeEntity(_0x27923c,null))[_0x0074('0x1e')](handleError(_0x27923c,null));};exports[_0x0074('0x4a')]=function(_0x459ad1,_0x5c867b,_0x1e17d9){var _0x15b6f8={};var _0xd080b2={};var _0xf34c77;var _0x493c7a;return db[_0x0074('0x2b')][_0x0074('0x4b')]({'where':{'id':_0x459ad1[_0x0074('0x48')]['id']}})[_0x0074('0x15')](handleEntityNotFound(_0x5c867b,null))[_0x0074('0x15')](function(_0x25595d){if(_0x25595d){_0xf34c77=_0x25595d;_0xd080b2['model']=_['keys'](db[_0x0074('0x4c')][_0x0074('0x2c')]);_0xd080b2[_0x0074('0x2e')]=_[_0x0074('0x2d')](_0x459ad1[_0x0074('0x2e')]);_0xd080b2[_0x0074('0x2f')]=_[_0x0074('0x30')](_0xd080b2['model'],_0xd080b2[_0x0074('0x2e')]);_0x15b6f8[_0x0074('0x32')]=_['intersection'](_0xd080b2[_0x0074('0x31')],qs[_0x0074('0x33')](_0x459ad1['query']['fields']));_0x15b6f8[_0x0074('0x32')]=_0x15b6f8[_0x0074('0x32')]['length']?_0x15b6f8[_0x0074('0x32')]:_0xd080b2[_0x0074('0x31')];_0x15b6f8[_0x0074('0x36')]=qs['sort'](_0x459ad1[_0x0074('0x2e')]['sort']);_0x15b6f8['where']=qs[_0x0074('0x2f')](_[_0x0074('0x39')](_0x459ad1[_0x0074('0x2e')],_0xd080b2['filters']));if(_0x459ad1['query'][_0x0074('0x3e')]){_0x15b6f8[_0x0074('0x38')]=_[_0x0074('0x3a')](_0x15b6f8[_0x0074('0x38')],{'$or':_[_0x0074('0x3b')](_0x15b6f8[_0x0074('0x32')],function(_0x55de69){var _0x583d9a={};_0x583d9a[_0x55de69]={'$like':'%'+_0x459ad1['query'][_0x0074('0x3e')]+'%'};return _0x583d9a;})});}_0x15b6f8=_[_0x0074('0x3a')]({},_0x15b6f8,_0x459ad1[_0x0074('0x3f')]);return _0xf34c77['getFields'](_0x15b6f8);}})[_0x0074('0x15')](function(_0x2e86f8){if(_0x2e86f8){_0x493c7a=_0x2e86f8[_0x0074('0x43')];if(!_0x459ad1[_0x0074('0x2e')]['hasOwnProperty'](_0x0074('0x4d'))){_0x15b6f8[_0x0074('0x35')]=qs[_0x0074('0x35')](_0x459ad1[_0x0074('0x2e')][_0x0074('0x35')]);_0x15b6f8[_0x0074('0x22')]=qs[_0x0074('0x22')](_0x459ad1[_0x0074('0x2e')][_0x0074('0x22')]);}return _0xf34c77[_0x0074('0x4a')](_0x15b6f8);}})[_0x0074('0x15')](function(_0x5f42b7){if(_0x5f42b7){return _0x5f42b7?{'count':_0x493c7a,'rows':_0x5f42b7}:null;}})[_0x0074('0x15')](respondWithResult(_0x5c867b,null))[_0x0074('0x1e')](handleError(_0x5c867b,null));};exports[_0x0074('0x4e')]=function(_0x3eacfa,_0x3d9fd0,_0x2d6af1){var _0x11ab02={};var _0x331e90={};var _0x2777f1;var _0x52d8ee;return db['SalesforceConfiguration'][_0x0074('0x4b')]({'where':{'id':_0x3eacfa['params']['id']}})[_0x0074('0x15')](handleEntityNotFound(_0x3d9fd0,null))[_0x0074('0x15')](function(_0x46eed8){if(_0x46eed8){_0x2777f1=_0x46eed8;_0x331e90[_0x0074('0x31')]=_[_0x0074('0x2d')](db['SalesforceField'][_0x0074('0x2c')]);_0x331e90[_0x0074('0x2e')]=_['keys'](_0x3eacfa['query']);_0x331e90[_0x0074('0x2f')]=_['intersection'](_0x331e90['model'],_0x331e90[_0x0074('0x2e')]);_0x11ab02['attributes']=_['intersection'](_0x331e90['model'],qs[_0x0074('0x33')](_0x3eacfa[_0x0074('0x2e')][_0x0074('0x33')]));_0x11ab02['attributes']=_0x11ab02[_0x0074('0x32')][_0x0074('0x43')]?_0x11ab02[_0x0074('0x32')]:_0x331e90['model'];_0x11ab02[_0x0074('0x36')]=qs['sort'](_0x3eacfa[_0x0074('0x2e')][_0x0074('0x37')]);_0x11ab02[_0x0074('0x38')]=qs['filters'](_['pick'](_0x3eacfa[_0x0074('0x2e')],_0x331e90[_0x0074('0x2f')]));if(_0x3eacfa['query']['filter']){_0x11ab02[_0x0074('0x38')]=_[_0x0074('0x3a')](_0x11ab02['where'],{'$or':_['map'](_0x11ab02[_0x0074('0x32')],function(_0x19dbda){var _0x3e9acb={};_0x3e9acb[_0x19dbda]={'$like':'%'+_0x3eacfa[_0x0074('0x2e')][_0x0074('0x3e')]+'%'};return _0x3e9acb;})});}_0x11ab02=_['merge']({},_0x11ab02,_0x3eacfa[_0x0074('0x3f')]);return _0x2777f1[_0x0074('0x4e')](_0x11ab02);}})[_0x0074('0x15')](function(_0x21e6d6){if(_0x21e6d6){_0x52d8ee=_0x21e6d6[_0x0074('0x43')];if(!_0x3eacfa[_0x0074('0x2e')][_0x0074('0x34')]('nolimit')){_0x11ab02['limit']=qs[_0x0074('0x35')](_0x3eacfa[_0x0074('0x2e')]['limit']);_0x11ab02[_0x0074('0x22')]=qs[_0x0074('0x22')](_0x3eacfa[_0x0074('0x2e')]['offset']);}return _0x2777f1[_0x0074('0x4e')](_0x11ab02);}})['then'](function(_0x771f3e){if(_0x771f3e){return _0x771f3e?{'count':_0x52d8ee,'rows':_0x771f3e}:null;}})[_0x0074('0x15')](respondWithResult(_0x3d9fd0,null))['catch'](handleError(_0x3d9fd0,null));};exports['getDescriptions']=function(_0x1d5cd3,_0x1ba05d,_0x2be0e0){var _0x393d22={};var _0x5b0dd7={};var _0x53a410;var _0x32bbda;return db[_0x0074('0x2b')]['findOne']({'where':{'id':_0x1d5cd3[_0x0074('0x48')]['id']}})[_0x0074('0x15')](handleEntityNotFound(_0x1ba05d,null))[_0x0074('0x15')](function(_0x5929c0){if(_0x5929c0){_0x53a410=_0x5929c0;_0x5b0dd7[_0x0074('0x31')]=_[_0x0074('0x2d')](db[_0x0074('0x4c')]['rawAttributes']);_0x5b0dd7['query']=_['keys'](_0x1d5cd3['query']);_0x5b0dd7[_0x0074('0x2f')]=_['intersection'](_0x5b0dd7[_0x0074('0x31')],_0x5b0dd7[_0x0074('0x2e')]);_0x393d22[_0x0074('0x32')]=_[_0x0074('0x30')](_0x5b0dd7[_0x0074('0x31')],qs[_0x0074('0x33')](_0x1d5cd3[_0x0074('0x2e')][_0x0074('0x33')]));_0x393d22['attributes']=_0x393d22[_0x0074('0x32')][_0x0074('0x43')]?_0x393d22[_0x0074('0x32')]:_0x5b0dd7[_0x0074('0x31')];_0x393d22[_0x0074('0x36')]=qs[_0x0074('0x37')](_0x1d5cd3[_0x0074('0x2e')]['sort']);_0x393d22['where']=qs[_0x0074('0x2f')](_[_0x0074('0x39')](_0x1d5cd3[_0x0074('0x2e')],_0x5b0dd7['filters']));if(_0x1d5cd3[_0x0074('0x2e')][_0x0074('0x3e')]){_0x393d22[_0x0074('0x38')]=_['merge'](_0x393d22[_0x0074('0x38')],{'$or':_['map'](_0x393d22[_0x0074('0x32')],function(_0x61e945){var _0xd83e5c={};_0xd83e5c[_0x61e945]={'$like':'%'+_0x1d5cd3['query']['filter']+'%'};return _0xd83e5c;})});}_0x393d22=_['merge']({},_0x393d22,_0x1d5cd3[_0x0074('0x3f')]);return _0x53a410[_0x0074('0x4f')](_0x393d22);}})[_0x0074('0x15')](function(_0x4e3c3e){if(_0x4e3c3e){_0x32bbda=_0x4e3c3e['length'];if(!_0x1d5cd3[_0x0074('0x2e')]['hasOwnProperty'](_0x0074('0x4d'))){_0x393d22['limit']=qs[_0x0074('0x35')](_0x1d5cd3[_0x0074('0x2e')]['limit']);_0x393d22['offset']=qs[_0x0074('0x22')](_0x1d5cd3[_0x0074('0x2e')][_0x0074('0x22')]);}return _0x53a410[_0x0074('0x4f')](_0x393d22);}})[_0x0074('0x15')](function(_0x2857ba){if(_0x2857ba){return _0x2857ba?{'count':_0x32bbda,'rows':_0x2857ba}:null;}})[_0x0074('0x15')](respondWithResult(_0x1ba05d,null))[_0x0074('0x1e')](handleError(_0x1ba05d,null));}; \ No newline at end of file +var _0xe9cf=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','stack','name','send','rawAttributes','query','keys','filters','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','SalesforceConfiguration','includeAll','include','findAll','rows','params','intersection','find','create','body','destroy','getFields','findOne','SalesforceField','map','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis'];(function(_0x7c865,_0x3587e2){var _0x16caaf=function(_0x391204){while(--_0x391204){_0x7c865['push'](_0x7c865['shift']());}};_0x16caaf(++_0x3587e2);}(_0xe9cf,0xff));var _0xfe9c=function(_0x1cbff5,_0x4d5c69){_0x1cbff5=_0x1cbff5-0x0;var _0x5fcda9=_0xe9cf[_0x1cbff5];return _0x5fcda9;};'use strict';var pdf=require(_0xfe9c('0x0'));var emlformat=require(_0xfe9c('0x1'));var rimraf=require(_0xfe9c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfe9c('0x3'));var moment=require('moment');var BPromise=require(_0xfe9c('0x4'));var Mustache=require(_0xfe9c('0x5'));var util=require('util');var path=require(_0xfe9c('0x6'));var sox=require(_0xfe9c('0x7'));var csv=require(_0xfe9c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfe9c('0x9'));var squel=require(_0xfe9c('0xa'));var crypto=require('crypto');var jsforce=require(_0xfe9c('0xb'));var deskjs=require(_0xfe9c('0xc'));var toCsv=require(_0xfe9c('0x8'));var querystring=require('querystring');var Papa=require(_0xfe9c('0xd'));var Redis=require(_0xfe9c('0xe'));var authService=require(_0xfe9c('0xf'));var qs=require(_0xfe9c('0x10'));var hardwareService=require(_0xfe9c('0x11'));var logger=require(_0xfe9c('0x12'))(_0xfe9c('0x13'));var utils=require(_0xfe9c('0x14'));var config=require(_0xfe9c('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xfe9c('0x16')][_0xfe9c('0x17')]({'port':0x232a});function checkPasswordPattern(_0x49da03,_0x2717f5,_0x15a85d){if(_0x15a85d){var _0x3ed51c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ed51c[_0xfe9c('0x18')](_0x2717f5)){return _0x49da03;}else{throw new Error(_0xfe9c('0x19'));}}else{return _0x49da03;}}function respondWithRpcPromise(_0x4af8e4,_0x4c0b66,_0x46f22c,_0x3c0ddc){return new BPromise(function(_0x3dd28f,_0x49928d){var _0x52a773=_0x3c0ddc||client;return _0x52a773['request'](_0x4af8e4,_0x46f22c)[_0xfe9c('0x1a')](function(_0x1f64f6){logger['info'](_0xfe9c('0x1b'),_0x4c0b66,_0xfe9c('0x1c'));logger[_0xfe9c('0x1d')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4c0b66,'request\x20sent',JSON[_0xfe9c('0x1e')](_0x1f64f6));if(_0x1f64f6['error']){if(_0x1f64f6[_0xfe9c('0x1f')][_0xfe9c('0x20')]===0x1f4){logger[_0xfe9c('0x1f')](_0xfe9c('0x1b'),_0x4c0b66,_0x1f64f6[_0xfe9c('0x1f')][_0xfe9c('0x21')]);return _0x49928d(_0x1f64f6['error'][_0xfe9c('0x21')]);}logger['error'](_0xfe9c('0x1b'),_0x4c0b66,_0x1f64f6[_0xfe9c('0x1f')][_0xfe9c('0x21')]);return _0x3dd28f(_0x1f64f6[_0xfe9c('0x1f')][_0xfe9c('0x21')]);}else{logger[_0xfe9c('0x22')](_0xfe9c('0x1b'),_0x4c0b66,_0xfe9c('0x1c'));_0x3dd28f(_0x1f64f6[_0xfe9c('0x23')]['message']);}})[_0xfe9c('0x24')](function(_0x4ae5c7){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4c0b66,_0x4ae5c7);_0x49928d(_0x4ae5c7);});});}function respondWithStatusCode(_0x241fe0,_0x36e604){_0x36e604=_0x36e604||0xcc;return function(_0x4250bf){if(_0x4250bf){return _0x241fe0[_0xfe9c('0x25')](_0x36e604);}return _0x241fe0[_0xfe9c('0x26')](_0x36e604)[_0xfe9c('0x27')]();};}function respondWithResult(_0x37446c,_0x17da3f){_0x17da3f=_0x17da3f||0xc8;return function(_0x59eec3){if(_0x59eec3){return _0x37446c['status'](_0x17da3f)[_0xfe9c('0x28')](_0x59eec3);}};}function respondWithFilteredResult(_0x4ee0b0,_0x3ba5cd){return function(_0x1f4a05){if(_0x1f4a05){var _0xec945e=_0x1f4a05[_0xfe9c('0x29')],_0xb2d22=_0x3ba5cd[_0xfe9c('0x2a')],_0x1a7ec8=_0x3ba5cd[_0xfe9c('0x2a')]+_0x3ba5cd[_0xfe9c('0x2b')],_0x2ee42e;if(_0x1a7ec8>=_0xec945e){_0x1a7ec8=_0xec945e;_0x2ee42e=0xc8;}else{_0x2ee42e=0xce;}_0x4ee0b0[_0xfe9c('0x26')](_0x2ee42e);return _0x4ee0b0[_0xfe9c('0x2c')](_0xfe9c('0x2d'),_0xb2d22+'-'+_0x1a7ec8+'/'+_0xec945e)['json'](_0x1f4a05);}return null;};}function patchUpdates(_0x4e8c4c){return function(_0x468185){try{jsonpatch[_0xfe9c('0x2e')](_0x468185,_0x4e8c4c,!![]);}catch(_0x255655){return BPromise[_0xfe9c('0x2f')](_0x255655);}return _0x468185['save']();};}function saveUpdates(_0xf9be88,_0x5e9ed7){return function(_0x23822d){if(_0x23822d){return _0x23822d[_0xfe9c('0x30')](_0xf9be88)['then'](function(_0x1e5259){return _0x1e5259;});}return null;};}function removeEntity(_0x800ccf,_0x5a08aa){return function(_0x1b730b){if(_0x1b730b){return _0x1b730b['destroy']()['then'](function(){_0x800ccf[_0xfe9c('0x26')](0xcc)[_0xfe9c('0x27')]();});}};}function handleEntityNotFound(_0x110283,_0x5541f1){return function(_0x3c38b0){if(!_0x3c38b0){_0x110283[_0xfe9c('0x25')](0x194);}return _0x3c38b0;};}function handleError(_0x2415f1,_0x38fa4c){_0x38fa4c=_0x38fa4c||0x1f4;return function(_0x2476c0){logger[_0xfe9c('0x1f')](_0x2476c0[_0xfe9c('0x31')]);if(_0x2476c0[_0xfe9c('0x32')]){delete _0x2476c0[_0xfe9c('0x32')];}_0x2415f1[_0xfe9c('0x26')](_0x38fa4c)[_0xfe9c('0x33')](_0x2476c0);};}exports['index']=function(_0x166b32,_0x3b0bdd){var _0x5b19f1={},_0x2a5ce4={},_0x307e83={'count':0x0,'rows':[]};var _0x9dd14=db['SalesforceConfiguration'][_0xfe9c('0x34')];_0x2a5ce4['model']=_['keys'](_0x9dd14);_0x2a5ce4[_0xfe9c('0x35')]=_[_0xfe9c('0x36')](_0x166b32[_0xfe9c('0x35')]);_0x2a5ce4[_0xfe9c('0x37')]=_['intersection'](_0x2a5ce4[_0xfe9c('0x38')],_0x2a5ce4['query']);_0x5b19f1['attributes']=_['intersection'](_0x2a5ce4[_0xfe9c('0x38')],qs[_0xfe9c('0x39')](_0x166b32[_0xfe9c('0x35')][_0xfe9c('0x39')]));_0x5b19f1['attributes']=_0x5b19f1[_0xfe9c('0x3a')][_0xfe9c('0x3b')]?_0x5b19f1[_0xfe9c('0x3a')]:_0x2a5ce4[_0xfe9c('0x38')];if(!_0x166b32[_0xfe9c('0x35')]['hasOwnProperty'](_0xfe9c('0x3c'))){_0x5b19f1[_0xfe9c('0x2b')]=qs[_0xfe9c('0x2b')](_0x166b32[_0xfe9c('0x35')]['limit']);_0x5b19f1[_0xfe9c('0x2a')]=qs['offset'](_0x166b32['query'][_0xfe9c('0x2a')]);}_0x5b19f1[_0xfe9c('0x3d')]=qs[_0xfe9c('0x3e')](_0x166b32['query']['sort']);_0x5b19f1[_0xfe9c('0x3f')]=qs['filters'](_[_0xfe9c('0x40')](_0x166b32[_0xfe9c('0x35')],_0x2a5ce4[_0xfe9c('0x37')]));if(_0x166b32[_0xfe9c('0x35')][_0xfe9c('0x41')]){_0x5b19f1[_0xfe9c('0x3f')]=_[_0xfe9c('0x42')](_0x5b19f1[_0xfe9c('0x3f')],{'$or':_['map'](_0x9dd14,function(_0x13f513){if(_0x13f513[_0xfe9c('0x43')][_0xfe9c('0x44')]!==_0xfe9c('0x45')){var _0x156e05={};_0x156e05[_0x13f513[_0xfe9c('0x46')]]={'$like':'%'+_0x166b32[_0xfe9c('0x35')][_0xfe9c('0x41')]+'%'};return _0x156e05;}})});}_0x5b19f1=_[_0xfe9c('0x42')]({},_0x5b19f1,_0x166b32[_0xfe9c('0x47')]);var _0x104929={'where':_0x5b19f1[_0xfe9c('0x3f')]};return db[_0xfe9c('0x48')][_0xfe9c('0x29')](_0x104929)[_0xfe9c('0x1a')](function(_0x44f648){_0x307e83['count']=_0x44f648;if(_0x166b32[_0xfe9c('0x35')][_0xfe9c('0x49')]){_0x5b19f1[_0xfe9c('0x4a')]=[{'all':!![]}];}return db[_0xfe9c('0x48')][_0xfe9c('0x4b')](_0x5b19f1);})['then'](function(_0x4d581a){_0x307e83[_0xfe9c('0x4c')]=_0x4d581a;return _0x307e83;})[_0xfe9c('0x1a')](respondWithFilteredResult(_0x3b0bdd,_0x5b19f1))[_0xfe9c('0x24')](handleError(_0x3b0bdd,null));};exports['show']=function(_0x38576b,_0x1fb94d){var _0x13668f={'raw':![],'where':{'id':_0x38576b[_0xfe9c('0x4d')]['id']}},_0x4edd30={};_0x4edd30[_0xfe9c('0x38')]=_['keys'](db[_0xfe9c('0x48')]['rawAttributes']);_0x4edd30[_0xfe9c('0x35')]=_[_0xfe9c('0x36')](_0x38576b[_0xfe9c('0x35')]);_0x4edd30[_0xfe9c('0x37')]=_[_0xfe9c('0x4e')](_0x4edd30['model'],_0x4edd30[_0xfe9c('0x35')]);_0x13668f['attributes']=_[_0xfe9c('0x4e')](_0x4edd30['model'],qs[_0xfe9c('0x39')](_0x38576b[_0xfe9c('0x35')][_0xfe9c('0x39')]));_0x13668f[_0xfe9c('0x3a')]=_0x13668f[_0xfe9c('0x3a')][_0xfe9c('0x3b')]?_0x13668f[_0xfe9c('0x3a')]:_0x4edd30[_0xfe9c('0x38')];if(_0x38576b[_0xfe9c('0x35')][_0xfe9c('0x49')]){_0x13668f[_0xfe9c('0x4a')]=[{'all':!![]}];}_0x13668f=_['merge']({},_0x13668f,_0x38576b['options']);return db[_0xfe9c('0x48')][_0xfe9c('0x4f')](_0x13668f)['then'](handleEntityNotFound(_0x1fb94d,null))['then'](respondWithResult(_0x1fb94d,null))['catch'](handleError(_0x1fb94d,null));};exports[_0xfe9c('0x50')]=function(_0x432d1d,_0xe59a8d){return db[_0xfe9c('0x48')][_0xfe9c('0x50')](_0x432d1d['body'],{})['then'](respondWithResult(_0xe59a8d,0xc9))['catch'](handleError(_0xe59a8d,null));};exports['update']=function(_0x2bc97d,_0x775e78){if(_0x2bc97d[_0xfe9c('0x51')]['id']){delete _0x2bc97d[_0xfe9c('0x51')]['id'];}return db[_0xfe9c('0x48')][_0xfe9c('0x4f')]({'where':{'id':_0x2bc97d[_0xfe9c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x775e78,null))[_0xfe9c('0x1a')](saveUpdates(_0x2bc97d[_0xfe9c('0x51')],null))['then'](respondWithResult(_0x775e78,null))['catch'](handleError(_0x775e78,null));};exports[_0xfe9c('0x52')]=function(_0x88aac3,_0x2188c3){return db[_0xfe9c('0x48')][_0xfe9c('0x4f')]({'where':{'id':_0x88aac3['params']['id']}})[_0xfe9c('0x1a')](handleEntityNotFound(_0x2188c3,null))[_0xfe9c('0x1a')](removeEntity(_0x2188c3,null))['catch'](handleError(_0x2188c3,null));};exports[_0xfe9c('0x53')]=function(_0x2124fd,_0x5aeb27,_0x221646){var _0x5be1f2={};var _0x724bbc={};var _0x2d0c1d;var _0x47c03b;return db['SalesforceConfiguration'][_0xfe9c('0x54')]({'where':{'id':_0x2124fd[_0xfe9c('0x4d')]['id']}})[_0xfe9c('0x1a')](handleEntityNotFound(_0x5aeb27,null))[_0xfe9c('0x1a')](function(_0x1e6de2){if(_0x1e6de2){_0x2d0c1d=_0x1e6de2;_0x724bbc[_0xfe9c('0x38')]=_[_0xfe9c('0x36')](db[_0xfe9c('0x55')][_0xfe9c('0x34')]);_0x724bbc[_0xfe9c('0x35')]=_[_0xfe9c('0x36')](_0x2124fd[_0xfe9c('0x35')]);_0x724bbc['filters']=_[_0xfe9c('0x4e')](_0x724bbc['model'],_0x724bbc['query']);_0x5be1f2['attributes']=_[_0xfe9c('0x4e')](_0x724bbc[_0xfe9c('0x38')],qs['fields'](_0x2124fd[_0xfe9c('0x35')][_0xfe9c('0x39')]));_0x5be1f2[_0xfe9c('0x3a')]=_0x5be1f2[_0xfe9c('0x3a')][_0xfe9c('0x3b')]?_0x5be1f2[_0xfe9c('0x3a')]:_0x724bbc[_0xfe9c('0x38')];_0x5be1f2[_0xfe9c('0x3d')]=qs['sort'](_0x2124fd['query'][_0xfe9c('0x3e')]);_0x5be1f2[_0xfe9c('0x3f')]=qs[_0xfe9c('0x37')](_[_0xfe9c('0x40')](_0x2124fd[_0xfe9c('0x35')],_0x724bbc[_0xfe9c('0x37')]));if(_0x2124fd[_0xfe9c('0x35')][_0xfe9c('0x41')]){_0x5be1f2[_0xfe9c('0x3f')]=_[_0xfe9c('0x42')](_0x5be1f2[_0xfe9c('0x3f')],{'$or':_[_0xfe9c('0x56')](_0x5be1f2[_0xfe9c('0x3a')],function(_0x4b51e5){var _0x2d8f43={};_0x2d8f43[_0x4b51e5]={'$like':'%'+_0x2124fd['query']['filter']+'%'};return _0x2d8f43;})});}_0x5be1f2=_[_0xfe9c('0x42')]({},_0x5be1f2,_0x2124fd[_0xfe9c('0x47')]);return _0x2d0c1d[_0xfe9c('0x53')](_0x5be1f2);}})[_0xfe9c('0x1a')](function(_0x3aca77){if(_0x3aca77){_0x47c03b=_0x3aca77[_0xfe9c('0x3b')];if(!_0x2124fd['query'][_0xfe9c('0x57')](_0xfe9c('0x3c'))){_0x5be1f2['limit']=qs['limit'](_0x2124fd[_0xfe9c('0x35')][_0xfe9c('0x2b')]);_0x5be1f2[_0xfe9c('0x2a')]=qs['offset'](_0x2124fd[_0xfe9c('0x35')][_0xfe9c('0x2a')]);}return _0x2d0c1d[_0xfe9c('0x53')](_0x5be1f2);}})[_0xfe9c('0x1a')](function(_0x471819){if(_0x471819){return _0x471819?{'count':_0x47c03b,'rows':_0x471819}:null;}})[_0xfe9c('0x1a')](respondWithResult(_0x5aeb27,null))['catch'](handleError(_0x5aeb27,null));};exports[_0xfe9c('0x58')]=function(_0x47c2f6,_0x428657,_0x1b2517){var _0x5944c3={};var _0x34a389={};var _0xe3badb;var _0x186736;return db[_0xfe9c('0x48')][_0xfe9c('0x54')]({'where':{'id':_0x47c2f6[_0xfe9c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x428657,null))[_0xfe9c('0x1a')](function(_0x30b925){if(_0x30b925){_0xe3badb=_0x30b925;_0x34a389[_0xfe9c('0x38')]=_['keys'](db[_0xfe9c('0x55')][_0xfe9c('0x34')]);_0x34a389[_0xfe9c('0x35')]=_[_0xfe9c('0x36')](_0x47c2f6[_0xfe9c('0x35')]);_0x34a389[_0xfe9c('0x37')]=_['intersection'](_0x34a389[_0xfe9c('0x38')],_0x34a389[_0xfe9c('0x35')]);_0x5944c3[_0xfe9c('0x3a')]=_['intersection'](_0x34a389['model'],qs[_0xfe9c('0x39')](_0x47c2f6[_0xfe9c('0x35')][_0xfe9c('0x39')]));_0x5944c3['attributes']=_0x5944c3[_0xfe9c('0x3a')][_0xfe9c('0x3b')]?_0x5944c3[_0xfe9c('0x3a')]:_0x34a389[_0xfe9c('0x38')];_0x5944c3[_0xfe9c('0x3d')]=qs['sort'](_0x47c2f6[_0xfe9c('0x35')][_0xfe9c('0x3e')]);_0x5944c3[_0xfe9c('0x3f')]=qs[_0xfe9c('0x37')](_[_0xfe9c('0x40')](_0x47c2f6[_0xfe9c('0x35')],_0x34a389[_0xfe9c('0x37')]));if(_0x47c2f6[_0xfe9c('0x35')][_0xfe9c('0x41')]){_0x5944c3[_0xfe9c('0x3f')]=_[_0xfe9c('0x42')](_0x5944c3['where'],{'$or':_[_0xfe9c('0x56')](_0x5944c3['attributes'],function(_0x380d15){var _0x23cee9={};_0x23cee9[_0x380d15]={'$like':'%'+_0x47c2f6[_0xfe9c('0x35')]['filter']+'%'};return _0x23cee9;})});}_0x5944c3=_[_0xfe9c('0x42')]({},_0x5944c3,_0x47c2f6[_0xfe9c('0x47')]);return _0xe3badb[_0xfe9c('0x58')](_0x5944c3);}})[_0xfe9c('0x1a')](function(_0x31312d){if(_0x31312d){_0x186736=_0x31312d[_0xfe9c('0x3b')];if(!_0x47c2f6[_0xfe9c('0x35')]['hasOwnProperty'](_0xfe9c('0x3c'))){_0x5944c3[_0xfe9c('0x2b')]=qs[_0xfe9c('0x2b')](_0x47c2f6['query'][_0xfe9c('0x2b')]);_0x5944c3[_0xfe9c('0x2a')]=qs[_0xfe9c('0x2a')](_0x47c2f6['query']['offset']);}return _0xe3badb[_0xfe9c('0x58')](_0x5944c3);}})[_0xfe9c('0x1a')](function(_0x57e3bd){if(_0x57e3bd){return _0x57e3bd?{'count':_0x186736,'rows':_0x57e3bd}:null;}})[_0xfe9c('0x1a')](respondWithResult(_0x428657,null))[_0xfe9c('0x24')](handleError(_0x428657,null));};exports[_0xfe9c('0x59')]=function(_0x5c5088,_0xad3177,_0x50329e){var _0xd332d0={};var _0x2f5f0b={};var _0x106866;var _0x49aba9;return db[_0xfe9c('0x48')][_0xfe9c('0x54')]({'where':{'id':_0x5c5088[_0xfe9c('0x4d')]['id']}})['then'](handleEntityNotFound(_0xad3177,null))['then'](function(_0x5db402){if(_0x5db402){_0x106866=_0x5db402;_0x2f5f0b[_0xfe9c('0x38')]=_[_0xfe9c('0x36')](db[_0xfe9c('0x55')][_0xfe9c('0x34')]);_0x2f5f0b[_0xfe9c('0x35')]=_[_0xfe9c('0x36')](_0x5c5088[_0xfe9c('0x35')]);_0x2f5f0b[_0xfe9c('0x37')]=_[_0xfe9c('0x4e')](_0x2f5f0b[_0xfe9c('0x38')],_0x2f5f0b[_0xfe9c('0x35')]);_0xd332d0[_0xfe9c('0x3a')]=_[_0xfe9c('0x4e')](_0x2f5f0b[_0xfe9c('0x38')],qs['fields'](_0x5c5088[_0xfe9c('0x35')]['fields']));_0xd332d0[_0xfe9c('0x3a')]=_0xd332d0[_0xfe9c('0x3a')]['length']?_0xd332d0['attributes']:_0x2f5f0b[_0xfe9c('0x38')];_0xd332d0['order']=qs['sort'](_0x5c5088['query'][_0xfe9c('0x3e')]);_0xd332d0[_0xfe9c('0x3f')]=qs[_0xfe9c('0x37')](_[_0xfe9c('0x40')](_0x5c5088['query'],_0x2f5f0b['filters']));if(_0x5c5088['query']['filter']){_0xd332d0[_0xfe9c('0x3f')]=_[_0xfe9c('0x42')](_0xd332d0[_0xfe9c('0x3f')],{'$or':_[_0xfe9c('0x56')](_0xd332d0[_0xfe9c('0x3a')],function(_0xf62470){var _0xdc3e8a={};_0xdc3e8a[_0xf62470]={'$like':'%'+_0x5c5088[_0xfe9c('0x35')]['filter']+'%'};return _0xdc3e8a;})});}_0xd332d0=_[_0xfe9c('0x42')]({},_0xd332d0,_0x5c5088['options']);return _0x106866[_0xfe9c('0x59')](_0xd332d0);}})[_0xfe9c('0x1a')](function(_0x5cb2ce){if(_0x5cb2ce){_0x49aba9=_0x5cb2ce['length'];if(!_0x5c5088[_0xfe9c('0x35')]['hasOwnProperty']('nolimit')){_0xd332d0['limit']=qs['limit'](_0x5c5088[_0xfe9c('0x35')][_0xfe9c('0x2b')]);_0xd332d0[_0xfe9c('0x2a')]=qs[_0xfe9c('0x2a')](_0x5c5088['query']['offset']);}return _0x106866[_0xfe9c('0x59')](_0xd332d0);}})[_0xfe9c('0x1a')](function(_0x4b4b12){if(_0x4b4b12){return _0x4b4b12?{'count':_0x49aba9,'rows':_0x4b4b12}:null;}})[_0xfe9c('0x1a')](respondWithResult(_0xad3177,null))[_0xfe9c('0x24')](handleError(_0xad3177,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 2b310d2..f501b02 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 _0x54ef=['../../config/environment','exports','define','int_salesforce_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x15aea4,_0x17820f){var _0x143cca=function(_0x15f079){while(--_0x15f079){_0x15aea4['push'](_0x15aea4['shift']());}};_0x143cca(++_0x17820f);}(_0x54ef,0x126));var _0xf54e=function(_0x53ff9b,_0x34c414){_0x53ff9b=_0x53ff9b-0x0;var _0x45d831=_0x54ef[_0x53ff9b];return _0x45d831;};'use strict';var _=require(_0xf54e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rp=require(_0xf54e('0x3'));var fs=require('fs');var path=require(_0xf54e('0x4'));var rimraf=require(_0xf54e('0x5'));var config=require(_0xf54e('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf54e('0x7')]=function(_0x310a7e,_0x285d77){return _0x310a7e[_0xf54e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0xf54e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x090d=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x24deaa,_0xe780f7){var _0x7eb552=function(_0x18756a){while(--_0x18756a){_0x24deaa['push'](_0x24deaa['shift']());}};_0x7eb552(++_0xe780f7);}(_0x090d,0xb8));var _0xd090=function(_0x5b327a,_0x1c8061){_0x5b327a=_0x5b327a-0x0;var _0x57b0fa=_0x090d[_0x5b327a];return _0x57b0fa;};'use strict';var _=require(_0xd090('0x0'));var util=require(_0xd090('0x1'));var logger=require(_0xd090('0x2'))(_0xd090('0x3'));var moment=require('moment');var BPromise=require(_0xd090('0x4'));var rp=require(_0xd090('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd090('0x6'));var config=require(_0xd090('0x7'));var attributes=require(_0xd090('0x8'));module['exports']=function(_0x51d18b,_0x5b7144){return _0x51d18b['define'](_0xd090('0x9'),attributes,{'tableName':'int_salesforce_configurations','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 8868593..350799a 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 _0x326f=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x530bf2,_0x28409e){var _0x356d35=function(_0x42dd56){while(--_0x42dd56){_0x530bf2['push'](_0x530bf2['shift']());}};_0x356d35(++_0x28409e);}(_0x326f,0xd1));var _0xf326=function(_0x473c91,_0x64c6c6){_0x473c91=_0x473c91-0x0;var _0x3a7f9c=_0x326f[_0x473c91];return _0x3a7f9c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7217,0x19e));var _0x7721=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7217[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a3faa50..1fc1c67 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 _0x96b5=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96b5,0x18e));var _0x596b=function(_0x52aecf,_0x371776){_0x52aecf=_0x52aecf-0x0;var _0x32c3ee=_0x96b5[_0x52aecf];return _0x32c3ee;};'use strict';var multer=require(_0x596b('0x0'));var util=require(_0x596b('0x1'));var path=require(_0x596b('0x2'));var timeout=require(_0x596b('0x3'));var express=require(_0x596b('0x4'));var router=express['Router']();var auth=require(_0x596b('0x5'));var interaction=require(_0x596b('0x6'));var config=require('../../config/environment');var controller=require(_0x596b('0x7'));router[_0x596b('0x8')]('/',auth[_0x596b('0x9')](),controller['index']);router[_0x596b('0x8')](_0x596b('0xa'),auth[_0x596b('0x9')](),controller[_0x596b('0xb')]);router[_0x596b('0xc')]('/',auth[_0x596b('0x9')](),controller[_0x596b('0xd')]);router[_0x596b('0xe')](_0x596b('0xa'),auth[_0x596b('0x9')](),controller[_0x596b('0xf')]);router['delete'](_0x596b('0xa'),auth[_0x596b('0x9')](),controller['destroy']);module[_0x596b('0x10')]=router; \ No newline at end of file +var _0xd43a=['put','/:id','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','get','index','show','post','isAuthenticated','create'];(function(_0x13dac8,_0x46131f){var _0x194add=function(_0x4f60b2){while(--_0x4f60b2){_0x13dac8['push'](_0x13dac8['shift']());}};_0x194add(++_0x46131f);}(_0xd43a,0x1ae));var _0xad43=function(_0x376226,_0x4b0c2d){_0x376226=_0x376226-0x0;var _0x3fe71a=_0xd43a[_0x376226];return _0x3fe71a;};'use strict';var multer=require(_0xad43('0x0'));var util=require(_0xad43('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad43('0x2'));var router=express[_0xad43('0x3')]();var auth=require(_0xad43('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xad43('0x5'));var controller=require('./intSalesforceField.controller');router[_0xad43('0x6')]('/',auth['isAuthenticated'](),controller[_0xad43('0x7')]);router[_0xad43('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xad43('0x8')]);router[_0xad43('0x9')]('/',auth[_0xad43('0xa')](),controller[_0xad43('0xb')]);router[_0xad43('0xc')](_0xad43('0xd'),auth['isAuthenticated'](),controller[_0xad43('0xe')]);router[_0xad43('0xf')]('/:id',auth[_0xad43('0xa')](),controller['destroy']);module[_0xad43('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index a9cfe09..d797aeb 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 _0xff3f=['exports','ENUM','string','variable','customVariable','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff3f,0x1b6));var _0xfff3=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xff3f[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require('sequelize');module[_0xfff3('0x0')]={'type':{'type':Sequelize[_0xfff3('0x1')](_0xfff3('0x2'),_0xfff3('0x3'),_0xfff3('0x4'),'keyValue'),'defaultValue':_0xfff3('0x2')},'content':{'type':Sequelize[_0xfff3('0x5')]},'key':{'type':Sequelize[_0xfff3('0x5')]},'keyType':{'type':Sequelize[_0xfff3('0x1')](_0xfff3('0x2'),'variable',_0xfff3('0x4'))},'keyContent':{'type':Sequelize[_0xfff3('0x5')]},'idField':{'type':Sequelize[_0xfff3('0x5')]},'variableName':{'type':Sequelize[_0xfff3('0x5')]}}; \ No newline at end of file +var _0x185b=['variable','customVariable','keyValue','string','STRING','sequelize','ENUM'];(function(_0x1b4fe8,_0x2a2275){var _0x2e8941=function(_0x3fa208){while(--_0x3fa208){_0x1b4fe8['push'](_0x1b4fe8['shift']());}};_0x2e8941(++_0x2a2275);}(_0x185b,0x1ef));var _0xb185=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x185b[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xb185('0x0'));module['exports']={'type':{'type':Sequelize[_0xb185('0x1')]('string',_0xb185('0x2'),_0xb185('0x3'),_0xb185('0x4')),'defaultValue':_0xb185('0x5')},'content':{'type':Sequelize[_0xb185('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb185('0x5'),_0xb185('0x2'),_0xb185('0x3'))},'keyContent':{'type':Sequelize[_0xb185('0x6')]},'idField':{'type':Sequelize[_0xb185('0x6')]},'variableName':{'type':Sequelize[_0xb185('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index dffec30..94a901d 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 _0x4227=['moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','where','pick','map','type','key','VIRTUAL','filter','merge','options','SalesforceField','findAll','rows','show','params','intersection','includeAll','find','catch','create','body','html-pdf','zip-dir','request-promise'];(function(_0x127c0f,_0x13da71){var _0x2bf7b0=function(_0x586def){while(--_0x586def){_0x127c0f['push'](_0x127c0f['shift']());}};_0x2bf7b0(++_0x13da71);}(_0x4227,0x89));var _0x7422=function(_0x453861,_0x48f5c1){_0x453861=_0x453861-0x0;var _0x27a6a1=_0x4227[_0x453861];return _0x27a6a1;};'use strict';var pdf=require(_0x7422('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7422('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7422('0x2'));var moment=require(_0x7422('0x3'));var BPromise=require(_0x7422('0x4'));var Mustache=require('mustache');var util=require(_0x7422('0x5'));var path=require(_0x7422('0x6'));var sox=require(_0x7422('0x7'));var csv=require(_0x7422('0x8'));var ejs=require(_0x7422('0x9'));var fs=require('fs');var _=require(_0x7422('0xa'));var squel=require(_0x7422('0xb'));var crypto=require(_0x7422('0xc'));var jsforce=require(_0x7422('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7422('0x8'));var querystring=require(_0x7422('0xe'));var Papa=require(_0x7422('0xf'));var Redis=require('ioredis');var authService=require(_0x7422('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7422('0x11'));var logger=require(_0x7422('0x12'))(_0x7422('0x13'));var utils=require(_0x7422('0x14'));var config=require(_0x7422('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30d474,_0x348a19){_0x348a19=_0x348a19||0xcc;return function(_0x575c47){if(_0x575c47){return _0x30d474[_0x7422('0x16')](_0x348a19);}return _0x30d474[_0x7422('0x17')](_0x348a19)['end']();};}function respondWithResult(_0x117e37,_0x12a5cd){_0x12a5cd=_0x12a5cd||0xc8;return function(_0x555082){if(_0x555082){return _0x117e37['status'](_0x12a5cd)[_0x7422('0x18')](_0x555082);}};}function respondWithFilteredResult(_0x4ca0e4,_0x105e1b){return function(_0x788829){if(_0x788829){var _0x487c93=_0x788829[_0x7422('0x19')],_0x149c50=_0x105e1b[_0x7422('0x1a')],_0x39c31c=_0x105e1b[_0x7422('0x1a')]+_0x105e1b['limit'],_0x31c3ec;if(_0x39c31c>=_0x487c93){_0x39c31c=_0x487c93;_0x31c3ec=0xc8;}else{_0x31c3ec=0xce;}_0x4ca0e4[_0x7422('0x17')](_0x31c3ec);return _0x4ca0e4[_0x7422('0x1b')](_0x7422('0x1c'),_0x149c50+'-'+_0x39c31c+'/'+_0x487c93)[_0x7422('0x18')](_0x788829);}return null;};}function patchUpdates(_0x57b8bf){return function(_0x1f9e09){try{jsonpatch['apply'](_0x1f9e09,_0x57b8bf,!![]);}catch(_0x22a1c8){return BPromise[_0x7422('0x1d')](_0x22a1c8);}return _0x1f9e09[_0x7422('0x1e')]();};}function saveUpdates(_0x4a53a3,_0x24db36){return function(_0xacaad1){if(_0xacaad1){return _0xacaad1[_0x7422('0x1f')](_0x4a53a3)[_0x7422('0x20')](function(_0x55f98f){return _0x55f98f;});}return null;};}function removeEntity(_0x58e617,_0x2fedd2){return function(_0x380ef7){if(_0x380ef7){return _0x380ef7[_0x7422('0x21')]()[_0x7422('0x20')](function(){_0x58e617[_0x7422('0x17')](0xcc)[_0x7422('0x22')]();});}};}function handleEntityNotFound(_0xe4f174,_0x596b89){return function(_0x24ce62){if(!_0x24ce62){_0xe4f174[_0x7422('0x16')](0x194);}return _0x24ce62;};}function handleError(_0x4fc200,_0x3a5a0c){_0x3a5a0c=_0x3a5a0c||0x1f4;return function(_0x23fb68){logger[_0x7422('0x23')](_0x23fb68[_0x7422('0x24')]);if(_0x23fb68['name']){delete _0x23fb68[_0x7422('0x25')];}_0x4fc200[_0x7422('0x17')](_0x3a5a0c)[_0x7422('0x26')](_0x23fb68);};}exports[_0x7422('0x27')]=function(_0x3438d1,_0x5e997b){var _0x34f1b0={},_0x9c29c0={},_0x81c27e={'count':0x0,'rows':[]};var _0x11e94f=db['SalesforceField'][_0x7422('0x28')];_0x9c29c0[_0x7422('0x29')]=_[_0x7422('0x2a')](_0x11e94f);_0x9c29c0[_0x7422('0x2b')]=_['keys'](_0x3438d1[_0x7422('0x2b')]);_0x9c29c0[_0x7422('0x2c')]=_['intersection'](_0x9c29c0['model'],_0x9c29c0[_0x7422('0x2b')]);_0x34f1b0[_0x7422('0x2d')]=_['intersection'](_0x9c29c0[_0x7422('0x29')],qs[_0x7422('0x2e')](_0x3438d1[_0x7422('0x2b')][_0x7422('0x2e')]));_0x34f1b0[_0x7422('0x2d')]=_0x34f1b0[_0x7422('0x2d')][_0x7422('0x2f')]?_0x34f1b0[_0x7422('0x2d')]:_0x9c29c0[_0x7422('0x29')];if(!_0x3438d1[_0x7422('0x2b')][_0x7422('0x30')]('nolimit')){_0x34f1b0[_0x7422('0x31')]=qs[_0x7422('0x31')](_0x3438d1[_0x7422('0x2b')][_0x7422('0x31')]);_0x34f1b0['offset']=qs[_0x7422('0x1a')](_0x3438d1[_0x7422('0x2b')][_0x7422('0x1a')]);}_0x34f1b0['order']=qs['sort'](_0x3438d1[_0x7422('0x2b')]['sort']);_0x34f1b0[_0x7422('0x32')]=qs['filters'](_[_0x7422('0x33')](_0x3438d1['query'],_0x9c29c0[_0x7422('0x2c')]));if(_0x3438d1['query']['filter']){_0x34f1b0[_0x7422('0x32')]=_['merge'](_0x34f1b0[_0x7422('0x32')],{'$or':_[_0x7422('0x34')](_0x11e94f,function(_0x1b2a14){if(_0x1b2a14[_0x7422('0x35')][_0x7422('0x36')]!==_0x7422('0x37')){var _0x404309={};_0x404309[_0x1b2a14['field']]={'$like':'%'+_0x3438d1[_0x7422('0x2b')][_0x7422('0x38')]+'%'};return _0x404309;}})});}_0x34f1b0=_[_0x7422('0x39')]({},_0x34f1b0,_0x3438d1[_0x7422('0x3a')]);var _0x242903={'where':_0x34f1b0['where']};return db[_0x7422('0x3b')][_0x7422('0x19')](_0x242903)['then'](function(_0x20b4df){_0x81c27e['count']=_0x20b4df;if(_0x3438d1[_0x7422('0x2b')]['includeAll']){_0x34f1b0['include']=[{'all':!![]}];}return db[_0x7422('0x3b')][_0x7422('0x3c')](_0x34f1b0);})[_0x7422('0x20')](function(_0x57a500){_0x81c27e[_0x7422('0x3d')]=_0x57a500;return _0x81c27e;})[_0x7422('0x20')](respondWithFilteredResult(_0x5e997b,_0x34f1b0))['catch'](handleError(_0x5e997b,null));};exports[_0x7422('0x3e')]=function(_0x5df470,_0x37f696){var _0x21e89c={'raw':!![],'where':{'id':_0x5df470[_0x7422('0x3f')]['id']}},_0x45ce6d={};_0x45ce6d[_0x7422('0x29')]=_[_0x7422('0x2a')](db[_0x7422('0x3b')]['rawAttributes']);_0x45ce6d[_0x7422('0x2b')]=_[_0x7422('0x2a')](_0x5df470['query']);_0x45ce6d[_0x7422('0x2c')]=_[_0x7422('0x40')](_0x45ce6d['model'],_0x45ce6d[_0x7422('0x2b')]);_0x21e89c['attributes']=_[_0x7422('0x40')](_0x45ce6d['model'],qs[_0x7422('0x2e')](_0x5df470[_0x7422('0x2b')][_0x7422('0x2e')]));_0x21e89c[_0x7422('0x2d')]=_0x21e89c[_0x7422('0x2d')][_0x7422('0x2f')]?_0x21e89c[_0x7422('0x2d')]:_0x45ce6d[_0x7422('0x29')];if(_0x5df470[_0x7422('0x2b')][_0x7422('0x41')]){_0x21e89c['include']=[{'all':!![]}];}_0x21e89c=_[_0x7422('0x39')]({},_0x21e89c,_0x5df470['options']);return db['SalesforceField'][_0x7422('0x42')](_0x21e89c)[_0x7422('0x20')](handleEntityNotFound(_0x37f696,null))['then'](respondWithResult(_0x37f696,null))[_0x7422('0x43')](handleError(_0x37f696,null));};exports[_0x7422('0x44')]=function(_0x1d09e9,_0x26bb3e){return db[_0x7422('0x3b')][_0x7422('0x44')](_0x1d09e9[_0x7422('0x45')],{})['then'](respondWithResult(_0x26bb3e,0xc9))[_0x7422('0x43')](handleError(_0x26bb3e,null));};exports[_0x7422('0x1f')]=function(_0x433457,_0x45ad30){if(_0x433457['body']['id']){delete _0x433457[_0x7422('0x45')]['id'];}return db[_0x7422('0x3b')][_0x7422('0x42')]({'where':{'id':_0x433457['params']['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x45ad30,null))[_0x7422('0x20')](saveUpdates(_0x433457['body'],null))['then'](respondWithResult(_0x45ad30,null))['catch'](handleError(_0x45ad30,null));};exports[_0x7422('0x21')]=function(_0xbbc9ab,_0x5b4694){return db[_0x7422('0x3b')]['find']({'where':{'id':_0xbbc9ab[_0x7422('0x3f')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x5b4694,null))[_0x7422('0x20')](removeEntity(_0x5b4694,null))[_0x7422('0x43')](handleError(_0x5b4694,null));}; \ No newline at end of file +var _0x8c3f=['to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','then','end','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','map','type','key','VIRTUAL','filter','options','SalesforceField','count','findAll','rows','catch','show','params','length','include','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','sox'];(function(_0x4c56ae,_0x337482){var _0x4bc390=function(_0x54d7f0){while(--_0x54d7f0){_0x4c56ae['push'](_0x4c56ae['shift']());}};_0x4bc390(++_0x337482);}(_0x8c3f,0xc5));var _0xf8c3=function(_0x4006eb,_0x2a39e9){_0x4006eb=_0x4006eb-0x0;var _0x5d9a90=_0x8c3f[_0x4006eb];return _0x5d9a90;};'use strict';var pdf=require(_0xf8c3('0x0'));var emlformat=require(_0xf8c3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8c3('0x2'));var rp=require(_0xf8c3('0x3'));var moment=require(_0xf8c3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf8c3('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf8c3('0x6'));var csv=require(_0xf8c3('0x7'));var ejs=require(_0xf8c3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf8c3('0x9'));var jsforce=require(_0xf8c3('0xa'));var deskjs=require(_0xf8c3('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf8c3('0xc'));var Papa=require(_0xf8c3('0xd'));var Redis=require('ioredis');var authService=require(_0xf8c3('0xe'));var qs=require(_0xf8c3('0xf'));var hardwareService=require(_0xf8c3('0x10'));var logger=require(_0xf8c3('0x11'))(_0xf8c3('0x12'));var utils=require(_0xf8c3('0x13'));var config=require(_0xf8c3('0x14'));var db=require(_0xf8c3('0x15'))['db'];function respondWithStatusCode(_0x59ef5b,_0x2367bb){_0x2367bb=_0x2367bb||0xcc;return function(_0x3332a8){if(_0x3332a8){return _0x59ef5b[_0xf8c3('0x16')](_0x2367bb);}return _0x59ef5b[_0xf8c3('0x17')](_0x2367bb)['end']();};}function respondWithResult(_0x58a3ce,_0x2c3d01){_0x2c3d01=_0x2c3d01||0xc8;return function(_0x5a7beb){if(_0x5a7beb){return _0x58a3ce['status'](_0x2c3d01)[_0xf8c3('0x18')](_0x5a7beb);}};}function respondWithFilteredResult(_0x1baca4,_0xe4b307){return function(_0x3ede58){if(_0x3ede58){var _0x2d8757=_0x3ede58['count'],_0x5ef85f=_0xe4b307['offset'],_0x50122a=_0xe4b307[_0xf8c3('0x19')]+_0xe4b307[_0xf8c3('0x1a')],_0x1ec317;if(_0x50122a>=_0x2d8757){_0x50122a=_0x2d8757;_0x1ec317=0xc8;}else{_0x1ec317=0xce;}_0x1baca4['status'](_0x1ec317);return _0x1baca4[_0xf8c3('0x1b')](_0xf8c3('0x1c'),_0x5ef85f+'-'+_0x50122a+'/'+_0x2d8757)['json'](_0x3ede58);}return null;};}function patchUpdates(_0x47e210){return function(_0x33fe37){try{jsonpatch[_0xf8c3('0x1d')](_0x33fe37,_0x47e210,!![]);}catch(_0x4803ba){return BPromise[_0xf8c3('0x1e')](_0x4803ba);}return _0x33fe37['save']();};}function saveUpdates(_0x470f38,_0x3e8d99){return function(_0x3323e0){if(_0x3323e0){return _0x3323e0['update'](_0x470f38)[_0xf8c3('0x1f')](function(_0x15f6f2){return _0x15f6f2;});}return null;};}function removeEntity(_0x3893b1,_0x360822){return function(_0x4d6783){if(_0x4d6783){return _0x4d6783['destroy']()[_0xf8c3('0x1f')](function(){_0x3893b1['status'](0xcc)[_0xf8c3('0x20')]();});}};}function handleEntityNotFound(_0x27e517,_0xc0d803){return function(_0x2acaa8){if(!_0x2acaa8){_0x27e517[_0xf8c3('0x16')](0x194);}return _0x2acaa8;};}function handleError(_0x4476fd,_0x506fb3){_0x506fb3=_0x506fb3||0x1f4;return function(_0x3de7e2){logger[_0xf8c3('0x21')](_0x3de7e2['stack']);if(_0x3de7e2[_0xf8c3('0x22')]){delete _0x3de7e2[_0xf8c3('0x22')];}_0x4476fd['status'](_0x506fb3)[_0xf8c3('0x23')](_0x3de7e2);};}exports[_0xf8c3('0x24')]=function(_0x4495fc,_0x45059e){var _0x38b504={},_0x282fe3={},_0x5b9189={'count':0x0,'rows':[]};var _0x49871a=db['SalesforceField']['rawAttributes'];_0x282fe3[_0xf8c3('0x25')]=_[_0xf8c3('0x26')](_0x49871a);_0x282fe3['query']=_[_0xf8c3('0x26')](_0x4495fc[_0xf8c3('0x27')]);_0x282fe3[_0xf8c3('0x28')]=_[_0xf8c3('0x29')](_0x282fe3['model'],_0x282fe3[_0xf8c3('0x27')]);_0x38b504[_0xf8c3('0x2a')]=_['intersection'](_0x282fe3[_0xf8c3('0x25')],qs[_0xf8c3('0x2b')](_0x4495fc[_0xf8c3('0x27')][_0xf8c3('0x2b')]));_0x38b504[_0xf8c3('0x2a')]=_0x38b504[_0xf8c3('0x2a')]['length']?_0x38b504['attributes']:_0x282fe3[_0xf8c3('0x25')];if(!_0x4495fc[_0xf8c3('0x27')][_0xf8c3('0x2c')](_0xf8c3('0x2d'))){_0x38b504[_0xf8c3('0x1a')]=qs[_0xf8c3('0x1a')](_0x4495fc[_0xf8c3('0x27')][_0xf8c3('0x1a')]);_0x38b504['offset']=qs[_0xf8c3('0x19')](_0x4495fc['query'][_0xf8c3('0x19')]);}_0x38b504[_0xf8c3('0x2e')]=qs[_0xf8c3('0x2f')](_0x4495fc[_0xf8c3('0x27')]['sort']);_0x38b504['where']=qs[_0xf8c3('0x28')](_[_0xf8c3('0x30')](_0x4495fc[_0xf8c3('0x27')],_0x282fe3[_0xf8c3('0x28')]));if(_0x4495fc[_0xf8c3('0x27')]['filter']){_0x38b504[_0xf8c3('0x31')]=_['merge'](_0x38b504['where'],{'$or':_[_0xf8c3('0x32')](_0x49871a,function(_0x15debc){if(_0x15debc[_0xf8c3('0x33')][_0xf8c3('0x34')]!==_0xf8c3('0x35')){var _0x409b88={};_0x409b88[_0x15debc['field']]={'$like':'%'+_0x4495fc['query'][_0xf8c3('0x36')]+'%'};return _0x409b88;}})});}_0x38b504=_['merge']({},_0x38b504,_0x4495fc[_0xf8c3('0x37')]);var _0x3fb96e={'where':_0x38b504[_0xf8c3('0x31')]};return db[_0xf8c3('0x38')][_0xf8c3('0x39')](_0x3fb96e)[_0xf8c3('0x1f')](function(_0x267d58){_0x5b9189[_0xf8c3('0x39')]=_0x267d58;if(_0x4495fc[_0xf8c3('0x27')]['includeAll']){_0x38b504['include']=[{'all':!![]}];}return db[_0xf8c3('0x38')][_0xf8c3('0x3a')](_0x38b504);})[_0xf8c3('0x1f')](function(_0xb4e68f){_0x5b9189[_0xf8c3('0x3b')]=_0xb4e68f;return _0x5b9189;})['then'](respondWithFilteredResult(_0x45059e,_0x38b504))[_0xf8c3('0x3c')](handleError(_0x45059e,null));};exports[_0xf8c3('0x3d')]=function(_0x438ce0,_0x96b678){var _0x42be71={'raw':!![],'where':{'id':_0x438ce0[_0xf8c3('0x3e')]['id']}},_0x22dbf5={};_0x22dbf5[_0xf8c3('0x25')]=_[_0xf8c3('0x26')](db[_0xf8c3('0x38')]['rawAttributes']);_0x22dbf5[_0xf8c3('0x27')]=_['keys'](_0x438ce0['query']);_0x22dbf5[_0xf8c3('0x28')]=_[_0xf8c3('0x29')](_0x22dbf5[_0xf8c3('0x25')],_0x22dbf5[_0xf8c3('0x27')]);_0x42be71['attributes']=_[_0xf8c3('0x29')](_0x22dbf5[_0xf8c3('0x25')],qs[_0xf8c3('0x2b')](_0x438ce0[_0xf8c3('0x27')]['fields']));_0x42be71[_0xf8c3('0x2a')]=_0x42be71[_0xf8c3('0x2a')][_0xf8c3('0x3f')]?_0x42be71['attributes']:_0x22dbf5['model'];if(_0x438ce0[_0xf8c3('0x27')]['includeAll']){_0x42be71[_0xf8c3('0x40')]=[{'all':!![]}];}_0x42be71=_['merge']({},_0x42be71,_0x438ce0[_0xf8c3('0x37')]);return db[_0xf8c3('0x38')][_0xf8c3('0x41')](_0x42be71)['then'](handleEntityNotFound(_0x96b678,null))[_0xf8c3('0x1f')](respondWithResult(_0x96b678,null))[_0xf8c3('0x3c')](handleError(_0x96b678,null));};exports[_0xf8c3('0x42')]=function(_0x42690f,_0x37b609){return db[_0xf8c3('0x38')][_0xf8c3('0x42')](_0x42690f['body'],{})['then'](respondWithResult(_0x37b609,0xc9))[_0xf8c3('0x3c')](handleError(_0x37b609,null));};exports['update']=function(_0x3294fd,_0x41c239){if(_0x3294fd['body']['id']){delete _0x3294fd[_0xf8c3('0x43')]['id'];}return db[_0xf8c3('0x38')][_0xf8c3('0x41')]({'where':{'id':_0x3294fd[_0xf8c3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x41c239,null))[_0xf8c3('0x1f')](saveUpdates(_0x3294fd[_0xf8c3('0x43')],null))['then'](respondWithResult(_0x41c239,null))['catch'](handleError(_0x41c239,null));};exports['destroy']=function(_0x100f5c,_0x37ff02){return db['SalesforceField']['find']({'where':{'id':_0x100f5c['params']['id']}})[_0xf8c3('0x1f')](handleEntityNotFound(_0x37ff02,null))[_0xf8c3('0x1f')](removeEntity(_0x37ff02,null))[_0xf8c3('0x3c')](handleError(_0x37ff02,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 217aa41..78b2009 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 _0x1d01=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x1d01,0x1b0));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11d0('0x0'));var util=require(_0x11d0('0x1'));var logger=require(_0x11d0('0x2'))(_0x11d0('0x3'));var moment=require('moment');var BPromise=require(_0x11d0('0x4'));var rp=require(_0x11d0('0x5'));var fs=require('fs');var path=require(_0x11d0('0x6'));var rimraf=require(_0x11d0('0x7'));var config=require(_0x11d0('0x8'));var attributes=require(_0x11d0('0x9'));module[_0x11d0('0xa')]=function(_0x1b95b2,_0x2bbf33){return _0x1b95b2[_0x11d0('0xb')](_0x11d0('0xc'),attributes,{'tableName':_0x11d0('0xd'),'paranoid':![],'indexes':[{'name':_0x11d0('0xe'),'fields':[_0x11d0('0xf'),_0x11d0('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe222=['./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','rimraf','../../config/environment'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xe222,0xbd));var _0x2e22=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xe222[_0x232ec0];return _0x356705;};'use strict';var _=require(_0x2e22('0x0'));var util=require(_0x2e22('0x1'));var logger=require('../../config/logger')(_0x2e22('0x2'));var moment=require(_0x2e22('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e22('0x4'));var config=require(_0x2e22('0x5'));var attributes=require(_0x2e22('0x6'));module['exports']=function(_0x4b4837,_0x4fbdd6){return _0x4b4837[_0x2e22('0x7')](_0x2e22('0x8'),attributes,{'tableName':_0x2e22('0x9'),'paranoid':![],'indexes':[{'name':_0x2e22('0xa'),'fields':[_0x2e22('0xb'),_0x2e22('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 3c372ca..5197f69 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 _0x7e93=['rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9bb472,_0x16ea0a){var _0x6a6522=function(_0x59be3a){while(--_0x59be3a){_0x9bb472['push'](_0x9bb472['shift']());}};_0x6a6522(++_0x16ea0a);}(_0x7e93,0x12f));var _0x37e9=function(_0x5f43df,_0x5833c4){_0x5f43df=_0x5f43df-0x0;var _0x371d4f=_0x7e93[_0x5f43df];return _0x371d4f;};'use strict';var _=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var moment=require(_0x37e9('0x2'));var BPromise=require(_0x37e9('0x3'));var rs=require(_0x37e9('0x4'));var fs=require('fs');var Redis=require(_0x37e9('0x5'));var db=require(_0x37e9('0x6'))['db'];var utils=require(_0x37e9('0x7'));var logger=require(_0x37e9('0x8'))(_0x37e9('0x9'));var config=require(_0x37e9('0xa'));var jayson=require(_0x37e9('0xb'));var client=jayson[_0x37e9('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x244566,_0x1114d4,_0x126208){return new BPromise(function(_0x59ca6c,_0x32673a){return client[_0x37e9('0xd')](_0x244566,_0x126208)[_0x37e9('0xe')](function(_0x73ff65){logger[_0x37e9('0xf')](_0x37e9('0x10'),_0x1114d4,_0x37e9('0x11'));logger[_0x37e9('0x12')](_0x37e9('0x13'),_0x1114d4,_0x37e9('0x11'),JSON[_0x37e9('0x14')](_0x73ff65));if(_0x73ff65[_0x37e9('0x15')]){if(_0x73ff65['error'][_0x37e9('0x16')]===0x1f4){logger[_0x37e9('0x15')](_0x37e9('0x10'),_0x1114d4,_0x73ff65[_0x37e9('0x15')][_0x37e9('0x17')]);return _0x32673a(_0x73ff65[_0x37e9('0x15')][_0x37e9('0x17')]);}logger[_0x37e9('0x15')](_0x37e9('0x10'),_0x1114d4,_0x73ff65[_0x37e9('0x15')][_0x37e9('0x17')]);return _0x59ca6c(_0x73ff65[_0x37e9('0x15')][_0x37e9('0x17')]);}else{logger[_0x37e9('0xf')](_0x37e9('0x10'),_0x1114d4,_0x37e9('0x11'));_0x59ca6c(_0x73ff65[_0x37e9('0x18')][_0x37e9('0x17')]);}})[_0x37e9('0x19')](function(_0x882c06){logger[_0x37e9('0x15')]('SalesforceField,\x20%s,\x20%s',_0x1114d4,_0x882c06);_0x32673a(_0x882c06);});});} \ No newline at end of file +var _0xacda=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1a5758,_0xcbe907){var _0x5dbc86=function(_0xd23a5c){while(--_0xd23a5c){_0x1a5758['push'](_0x1a5758['shift']());}};_0x5dbc86(++_0xcbe907);}(_0xacda,0x172));var _0xaacd=function(_0x5e72a8,_0x3929ed){_0x5e72a8=_0x5e72a8-0x0;var _0x4dc3dd=_0xacda[_0x5e72a8];return _0x4dc3dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xaacd('0x0'));var rs=require(_0xaacd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaacd('0x2'))['db'];var utils=require(_0xaacd('0x3'));var logger=require(_0xaacd('0x4'))(_0xaacd('0x5'));var config=require(_0xaacd('0x6'));var jayson=require(_0xaacd('0x7'));var client=jayson[_0xaacd('0x8')][_0xaacd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9894c0,_0x52ec03,_0x566d6d){return new BPromise(function(_0xa9043e,_0x170e1c){return client[_0xaacd('0xa')](_0x9894c0,_0x566d6d)['then'](function(_0x189aee){logger[_0xaacd('0xb')](_0xaacd('0xc'),_0x52ec03,_0xaacd('0xd'));logger[_0xaacd('0xe')](_0xaacd('0xf'),_0x52ec03,_0xaacd('0xd'),JSON[_0xaacd('0x10')](_0x189aee));if(_0x189aee['error']){if(_0x189aee[_0xaacd('0x11')][_0xaacd('0x12')]===0x1f4){logger[_0xaacd('0x11')](_0xaacd('0xc'),_0x52ec03,_0x189aee[_0xaacd('0x11')][_0xaacd('0x13')]);return _0x170e1c(_0x189aee[_0xaacd('0x11')]['message']);}logger[_0xaacd('0x11')](_0xaacd('0xc'),_0x52ec03,_0x189aee[_0xaacd('0x11')]['message']);return _0xa9043e(_0x189aee[_0xaacd('0x11')][_0xaacd('0x13')]);}else{logger[_0xaacd('0xb')](_0xaacd('0xc'),_0x52ec03,_0xaacd('0xd'));_0xa9043e(_0x189aee[_0xaacd('0x14')][_0xaacd('0x13')]);}})[_0xaacd('0x15')](function(_0x3c4abb){logger[_0xaacd('0x11')](_0xaacd('0xc'),_0x52ec03,_0x3c4abb);_0x170e1c(_0x3c4abb);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 4403e7b..5678430 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 _0x727a=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x727a,0xc1));var _0xa727=function(_0xc51bca,_0x5a682a){_0xc51bca=_0xc51bca-0x0;var _0x5d8c3e=_0x727a[_0xc51bca];return _0x5d8c3e;};'use strict';var multer=require(_0xa727('0x0'));var util=require(_0xa727('0x1'));var path=require(_0xa727('0x2'));var timeout=require(_0xa727('0x3'));var express=require(_0xa727('0x4'));var router=express['Router']();var auth=require(_0xa727('0x5'));var interaction=require(_0xa727('0x6'));var config=require(_0xa727('0x7'));var controller=require(_0xa727('0x8'));router[_0xa727('0x9')]('/',auth[_0xa727('0xa')](),controller[_0xa727('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa727('0xc')]);router[_0xa727('0x9')](_0xa727('0xd'),auth[_0xa727('0xa')](),controller['getConfigurations']);router[_0xa727('0x9')](_0xa727('0xe'),auth[_0xa727('0xa')](),controller[_0xa727('0xf')]);router[_0xa727('0x10')]('/',auth[_0xa727('0xa')](),controller['create']);router['post'](_0xa727('0xd'),auth[_0xa727('0xa')](),controller[_0xa727('0x11')]);router[_0xa727('0x12')](_0xa727('0x13'),auth[_0xa727('0xa')](),controller[_0xa727('0x14')]);router[_0xa727('0x15')]('/:id',auth[_0xa727('0xa')](),controller[_0xa727('0x16')]);module[_0xa727('0x17')]=router; \ No newline at end of file +var _0xcc03=['addConfiguration','update','delete','destroy','exports','multer','util','express','Router','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xcc03,0xd7));var _0x3cc0=function(_0x4cba56,_0x5b2c44){_0x4cba56=_0x4cba56-0x0;var _0x3cc9f3=_0xcc03[_0x4cba56];return _0x3cc9f3;};'use strict';var multer=require(_0x3cc0('0x0'));var util=require(_0x3cc0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3cc0('0x2'));var router=express[_0x3cc0('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3cc0('0x4'));var controller=require(_0x3cc0('0x5'));router[_0x3cc0('0x6')]('/',auth[_0x3cc0('0x7')](),controller[_0x3cc0('0x8')]);router[_0x3cc0('0x6')](_0x3cc0('0x9'),auth[_0x3cc0('0x7')](),controller[_0x3cc0('0xa')]);router[_0x3cc0('0x6')]('/:id/configurations',auth[_0x3cc0('0x7')](),controller[_0x3cc0('0xb')]);router[_0x3cc0('0x6')](_0x3cc0('0xc'),auth[_0x3cc0('0x7')](),controller[_0x3cc0('0xd')]);router[_0x3cc0('0xe')]('/',auth['isAuthenticated'](),controller[_0x3cc0('0xf')]);router[_0x3cc0('0xe')]('/:id/configurations',auth[_0x3cc0('0x7')](),controller[_0x3cc0('0x10')]);router['put']('/:id',auth[_0x3cc0('0x7')](),controller[_0x3cc0('0x11')]);router[_0x3cc0('0x12')](_0x3cc0('0x9'),auth[_0x3cc0('0x7')](),controller[_0x3cc0('0x13')]);module[_0x3cc0('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 9f88431..1d5f8d0 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 _0x6324=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0x6324,0x142));var _0x4632=function(_0x247b0b,_0x3df01f){_0x247b0b=_0x247b0b-0x0;var _0x44dfde=_0x6324[_0x247b0b];return _0x44dfde;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'name':{'type':Sequelize[_0x4632('0x2')]},'description':{'type':Sequelize[_0x4632('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4632('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4632('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4632('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x91a7=['exports','STRING','username'];(function(_0x1c816c,_0x2e0355){var _0x3ba6eb=function(_0x37f730){while(--_0x37f730){_0x1c816c['push'](_0x1c816c['shift']());}};_0x3ba6eb(++_0x2e0355);}(_0x91a7,0xe7));var _0x791a=function(_0x12f4de,_0x2199c4){_0x12f4de=_0x12f4de-0x0;var _0xbfa026=_0x91a7[_0x12f4de];return _0xbfa026;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x791a('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x791a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 75ac5ac..87cfef7 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 _0xe74e=['time_worked','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','username','GET','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','concat','ServiceNow\x20error:\x20','statusCode','boolean','True','true','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ServicenowAccount,\x20%s,\x20%s','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','then','include','rows','show','length','includeAll','find','create','body','getConfigurations','findOne','params','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xe74e,0x10a));var _0xee74=function(_0x5eb52b,_0x112c2d){_0x5eb52b=_0x5eb52b-0x0;var _0x1d9c7e=_0xe74e[_0x5eb52b];return _0x1d9c7e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xee74('0x0'));var rimraf=require(_0xee74('0x1'));var zipdir=require(_0xee74('0x2'));var jsonpatch=require(_0xee74('0x3'));var rp=require(_0xee74('0x4'));var moment=require(_0xee74('0x5'));var BPromise=require(_0xee74('0x6'));var Mustache=require(_0xee74('0x7'));var util=require(_0xee74('0x8'));var path=require(_0xee74('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee74('0xa'));var fs=require('fs');var _=require(_0xee74('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xee74('0xc'));var deskjs=require(_0xee74('0xd'));var toCsv=require(_0xee74('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xee74('0xf'));var authService=require(_0xee74('0x10'));var qs=require(_0xee74('0x11'));var hardwareService=require(_0xee74('0x12'));var logger=require(_0xee74('0x13'))(_0xee74('0x14'));var utils=require('../../config/utils');var config=require(_0xee74('0x15'));var db=require(_0xee74('0x16'))['db'];var integrations=require(_0xee74('0x17'));var jayson=require(_0xee74('0x18'));var client=jayson['client'][_0xee74('0x19')]({'port':0x232a});function checkPasswordPattern(_0xf608e2,_0x2f8b37,_0x25ffd1){if(_0x25ffd1){var _0x5ee1b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ee1b4[_0xee74('0x1a')](_0x2f8b37)){return _0xf608e2;}else{throw new Error(_0xee74('0x1b'));}}else{return _0xf608e2;}}function respondWithRpcPromise(_0x2dfe0f,_0x2d136c,_0x15d6f3,_0x24184e){return new BPromise(function(_0x489b98,_0x18789e){var _0x456c3f=_0x24184e||client;return _0x456c3f[_0xee74('0x1c')](_0x2dfe0f,_0x15d6f3)['then'](function(_0x988fb5){logger[_0xee74('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x2d136c,'request\x20sent');logger[_0xee74('0x1e')](_0xee74('0x1f'),_0x2d136c,_0xee74('0x20'),JSON[_0xee74('0x21')](_0x988fb5));if(_0x988fb5[_0xee74('0x22')]){if(_0x988fb5['error'][_0xee74('0x23')]===0x1f4){logger[_0xee74('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x2d136c,_0x988fb5[_0xee74('0x22')][_0xee74('0x24')]);return _0x18789e(_0x988fb5[_0xee74('0x22')][_0xee74('0x24')]);}logger[_0xee74('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x2d136c,_0x988fb5[_0xee74('0x22')][_0xee74('0x24')]);return _0x489b98(_0x988fb5[_0xee74('0x22')][_0xee74('0x24')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x2d136c,'request\x20sent');_0x489b98(_0x988fb5[_0xee74('0x25')][_0xee74('0x24')]);}})[_0xee74('0x26')](function(_0x1aa325){logger[_0xee74('0x22')](_0xee74('0x27'),_0x2d136c,_0x1aa325);_0x18789e(_0x1aa325);});});}function respondWithStatusCode(_0x111d69,_0xbf115d){_0xbf115d=_0xbf115d||0xcc;return function(_0x7bbf7e){if(_0x7bbf7e){return _0x111d69[_0xee74('0x28')](_0xbf115d);}return _0x111d69[_0xee74('0x29')](_0xbf115d)[_0xee74('0x2a')]();};}function respondWithResult(_0x42e392,_0xcdbcd5){_0xcdbcd5=_0xcdbcd5||0xc8;return function(_0x40a655){if(_0x40a655){return _0x42e392[_0xee74('0x29')](_0xcdbcd5)[_0xee74('0x2b')](_0x40a655);}};}function respondWithFilteredResult(_0x353c8f,_0x3fda83){return function(_0x1f0e7b){if(_0x1f0e7b){var _0x5c6096=_0x1f0e7b[_0xee74('0x2c')],_0x2cd871=_0x3fda83[_0xee74('0x2d')],_0x3e62bc=_0x3fda83[_0xee74('0x2d')]+_0x3fda83['limit'],_0x1d217b;if(_0x3e62bc>=_0x5c6096){_0x3e62bc=_0x5c6096;_0x1d217b=0xc8;}else{_0x1d217b=0xce;}_0x353c8f[_0xee74('0x29')](_0x1d217b);return _0x353c8f[_0xee74('0x2e')](_0xee74('0x2f'),_0x2cd871+'-'+_0x3e62bc+'/'+_0x5c6096)['json'](_0x1f0e7b);}return null;};}function patchUpdates(_0x413c57){return function(_0x25d3c9){try{jsonpatch[_0xee74('0x30')](_0x25d3c9,_0x413c57,!![]);}catch(_0x414713){return BPromise[_0xee74('0x31')](_0x414713);}return _0x25d3c9[_0xee74('0x32')]();};}function saveUpdates(_0x1edb74,_0xb8cc6f){return function(_0x378dbd){if(_0x378dbd){return _0x378dbd[_0xee74('0x33')](_0x1edb74)['then'](function(_0x2cd414){return _0x2cd414;});}return null;};}function removeEntity(_0x4cb876,_0x57b8ee){return function(_0x30b18b){if(_0x30b18b){return _0x30b18b['destroy']()['then'](function(){_0x4cb876[_0xee74('0x29')](0xcc)[_0xee74('0x2a')]();});}};}function handleEntityNotFound(_0x4acc6b,_0x301fbf){return function(_0x276c48){if(!_0x276c48){_0x4acc6b[_0xee74('0x28')](0x194);}return _0x276c48;};}function handleError(_0x4261c2,_0x4d543a){_0x4d543a=_0x4d543a||0x1f4;return function(_0x46a585){logger['error'](_0x46a585[_0xee74('0x34')]);if(_0x46a585[_0xee74('0x35')]){delete _0x46a585[_0xee74('0x35')];}_0x4261c2['status'](_0x4d543a)[_0xee74('0x36')](_0x46a585);};}exports['index']=function(_0x4a03c6,_0x7e86f9){var _0x21f000={},_0xbb8064={},_0x4fdc5d={'count':0x0,'rows':[]};var _0x4b91d7=db[_0xee74('0x37')][_0xee74('0x38')];_0xbb8064[_0xee74('0x39')]=_[_0xee74('0x3a')](_0x4b91d7);_0xbb8064[_0xee74('0x3b')]=_[_0xee74('0x3a')](_0x4a03c6[_0xee74('0x3b')]);_0xbb8064[_0xee74('0x3c')]=_[_0xee74('0x3d')](_0xbb8064[_0xee74('0x39')],_0xbb8064['query']);_0x21f000[_0xee74('0x3e')]=_[_0xee74('0x3d')](_0xbb8064[_0xee74('0x39')],qs['fields'](_0x4a03c6[_0xee74('0x3b')][_0xee74('0x3f')]));_0x21f000[_0xee74('0x3e')]=_0x21f000[_0xee74('0x3e')]['length']?_0x21f000['attributes']:_0xbb8064[_0xee74('0x39')];if(!_0x4a03c6['query'][_0xee74('0x40')](_0xee74('0x41'))){_0x21f000[_0xee74('0x42')]=qs[_0xee74('0x42')](_0x4a03c6[_0xee74('0x3b')][_0xee74('0x42')]);_0x21f000['offset']=qs[_0xee74('0x2d')](_0x4a03c6[_0xee74('0x3b')][_0xee74('0x2d')]);}_0x21f000[_0xee74('0x43')]=qs['sort'](_0x4a03c6[_0xee74('0x3b')][_0xee74('0x44')]);_0x21f000[_0xee74('0x45')]=qs[_0xee74('0x3c')](_['pick'](_0x4a03c6['query'],_0xbb8064[_0xee74('0x3c')]));if(_0x4a03c6['query'][_0xee74('0x46')]){_0x21f000[_0xee74('0x45')]=_[_0xee74('0x47')](_0x21f000['where'],{'$or':_[_0xee74('0x48')](_0x4b91d7,function(_0x547f7e){if(_0x547f7e[_0xee74('0x49')][_0xee74('0x4a')]!==_0xee74('0x4b')){var _0x4a0e63={};_0x4a0e63[_0x547f7e[_0xee74('0x4c')]]={'$like':'%'+_0x4a03c6[_0xee74('0x3b')]['filter']+'%'};return _0x4a0e63;}})});}_0x21f000=_[_0xee74('0x47')]({},_0x21f000,_0x4a03c6[_0xee74('0x4d')]);var _0x559a68={'where':_0x21f000[_0xee74('0x45')]};return db[_0xee74('0x37')][_0xee74('0x2c')](_0x559a68)[_0xee74('0x4e')](function(_0x56296b){_0x4fdc5d[_0xee74('0x2c')]=_0x56296b;if(_0x4a03c6[_0xee74('0x3b')]['includeAll']){_0x21f000[_0xee74('0x4f')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x21f000);})[_0xee74('0x4e')](function(_0x5bc14f){_0x4fdc5d[_0xee74('0x50')]=_0x5bc14f;return _0x4fdc5d;})[_0xee74('0x4e')](respondWithFilteredResult(_0x7e86f9,_0x21f000))[_0xee74('0x26')](handleError(_0x7e86f9,null));};exports[_0xee74('0x51')]=function(_0x3c713d,_0x100a4f){var _0x38934d={'raw':![],'where':{'id':_0x3c713d['params']['id']}},_0x4ea5d6={};_0x4ea5d6[_0xee74('0x39')]=_[_0xee74('0x3a')](db['ServicenowAccount'][_0xee74('0x38')]);_0x4ea5d6[_0xee74('0x3b')]=_['keys'](_0x3c713d[_0xee74('0x3b')]);_0x4ea5d6[_0xee74('0x3c')]=_[_0xee74('0x3d')](_0x4ea5d6[_0xee74('0x39')],_0x4ea5d6[_0xee74('0x3b')]);_0x38934d[_0xee74('0x3e')]=_[_0xee74('0x3d')](_0x4ea5d6['model'],qs[_0xee74('0x3f')](_0x3c713d[_0xee74('0x3b')][_0xee74('0x3f')]));_0x38934d['attributes']=_0x38934d['attributes'][_0xee74('0x52')]?_0x38934d[_0xee74('0x3e')]:_0x4ea5d6[_0xee74('0x39')];if(_0x3c713d[_0xee74('0x3b')][_0xee74('0x53')]){_0x38934d[_0xee74('0x4f')]=[{'all':!![]}];}_0x38934d=_[_0xee74('0x47')]({},_0x38934d,_0x3c713d['options']);return db[_0xee74('0x37')][_0xee74('0x54')](_0x38934d)[_0xee74('0x4e')](handleEntityNotFound(_0x100a4f,null))[_0xee74('0x4e')](respondWithResult(_0x100a4f,null))[_0xee74('0x26')](handleError(_0x100a4f,null));};exports[_0xee74('0x55')]=function(_0xb50829,_0x5461d1){return db[_0xee74('0x37')][_0xee74('0x55')](_0xb50829[_0xee74('0x56')],{})[_0xee74('0x4e')](respondWithResult(_0x5461d1,0xc9))[_0xee74('0x26')](handleError(_0x5461d1,null));};exports[_0xee74('0x33')]=function(_0x28e326,_0xa4a705){if(_0x28e326['body']['id']){delete _0x28e326[_0xee74('0x56')]['id'];}return db[_0xee74('0x37')][_0xee74('0x54')]({'where':{'id':_0x28e326['params']['id']}})[_0xee74('0x4e')](handleEntityNotFound(_0xa4a705,null))[_0xee74('0x4e')](saveUpdates(_0x28e326['body'],null))[_0xee74('0x4e')](respondWithResult(_0xa4a705,null))[_0xee74('0x26')](handleError(_0xa4a705,null));};exports['destroy']=function(_0x4ff77c,_0x1c44bc){return db['ServicenowAccount'][_0xee74('0x54')]({'where':{'id':_0x4ff77c['params']['id']}})['then'](handleEntityNotFound(_0x1c44bc,null))[_0xee74('0x4e')](removeEntity(_0x1c44bc,null))['catch'](handleError(_0x1c44bc,null));};exports[_0xee74('0x57')]=function(_0x787a0e,_0x5aa70a,_0x530847){var _0x2bad71={};var _0x185f99={};var _0x537968;var _0x5ebf1f;return db[_0xee74('0x37')][_0xee74('0x58')]({'where':{'id':_0x787a0e[_0xee74('0x59')]['id']}})[_0xee74('0x4e')](handleEntityNotFound(_0x5aa70a,null))[_0xee74('0x4e')](function(_0x4583c6){if(_0x4583c6){_0x537968=_0x4583c6;_0x185f99['model']=_[_0xee74('0x3a')](db[_0xee74('0x5a')][_0xee74('0x38')]);_0x185f99['query']=_[_0xee74('0x3a')](_0x787a0e[_0xee74('0x3b')]);_0x185f99[_0xee74('0x3c')]=_[_0xee74('0x3d')](_0x185f99['model'],_0x185f99[_0xee74('0x3b')]);_0x2bad71[_0xee74('0x3e')]=_[_0xee74('0x3d')](_0x185f99[_0xee74('0x39')],qs[_0xee74('0x3f')](_0x787a0e[_0xee74('0x3b')]['fields']));_0x2bad71['attributes']=_0x2bad71['attributes'][_0xee74('0x52')]?_0x2bad71[_0xee74('0x3e')]:_0x185f99['model'];_0x2bad71[_0xee74('0x43')]=qs['sort'](_0x787a0e[_0xee74('0x3b')][_0xee74('0x44')]);_0x2bad71[_0xee74('0x45')]=qs[_0xee74('0x3c')](_[_0xee74('0x5b')](_0x787a0e['query'],_0x185f99[_0xee74('0x3c')]));if(_0x787a0e[_0xee74('0x3b')][_0xee74('0x46')]){_0x2bad71[_0xee74('0x45')]=_[_0xee74('0x47')](_0x2bad71['where'],{'$or':_[_0xee74('0x48')](_0x2bad71[_0xee74('0x3e')],function(_0x1e7c63){var _0x28e663={};_0x28e663[_0x1e7c63]={'$like':'%'+_0x787a0e[_0xee74('0x3b')][_0xee74('0x46')]+'%'};return _0x28e663;})});}_0x2bad71=_[_0xee74('0x47')]({},_0x2bad71,_0x787a0e['options']);return _0x537968['getConfigurations'](_0x2bad71);}})[_0xee74('0x4e')](function(_0xe005db){if(_0xe005db){_0x5ebf1f=_0xe005db[_0xee74('0x52')];if(!_0x787a0e[_0xee74('0x3b')]['hasOwnProperty'](_0xee74('0x41'))){_0x2bad71[_0xee74('0x42')]=qs['limit'](_0x787a0e[_0xee74('0x3b')][_0xee74('0x42')]);_0x2bad71[_0xee74('0x2d')]=qs[_0xee74('0x2d')](_0x787a0e['query'][_0xee74('0x2d')]);}return _0x537968[_0xee74('0x57')](_0x2bad71);}})[_0xee74('0x4e')](function(_0x3f75f4){if(_0x3f75f4){return _0x3f75f4?{'count':_0x5ebf1f,'rows':_0x3f75f4}:null;}})['then'](respondWithResult(_0x5aa70a,null))[_0xee74('0x26')](handleError(_0x5aa70a,null));};exports[_0xee74('0x5c')]=function(_0x4eccbe,_0x19b826,_0x3f4d79){if(_0x4eccbe[_0xee74('0x56')]['id']){delete _0x4eccbe[_0xee74('0x56')]['id'];}return db['ServicenowAccount'][_0xee74('0x58')]({'where':{'id':_0x4eccbe[_0xee74('0x59')]['id']}})[_0xee74('0x4e')](handleEntityNotFound(_0x19b826,null))['then'](function(_0x42fb9a){if(_0x42fb9a){_0x4eccbe[_0xee74('0x56')][_0xee74('0x5d')]=_0x42fb9a['id'];_0x4eccbe[_0xee74('0x56')][_0xee74('0x5e')]=integrations['getSubjects'](_0x4eccbe[_0xee74('0x56')][_0xee74('0x5f')],_0x4eccbe[_0xee74('0x56')]['type']);_0x4eccbe[_0xee74('0x56')][_0xee74('0x60')]=integrations[_0xee74('0x61')](_0x4eccbe[_0xee74('0x56')][_0xee74('0x5f')],_0x4eccbe[_0xee74('0x56')]['type']);return db[_0xee74('0x5a')][_0xee74('0x55')](_0x4eccbe[_0xee74('0x56')],{'include':[{'model':db[_0xee74('0x62')],'as':_0xee74('0x5e')},{'model':db['ServicenowField'],'as':_0xee74('0x60')}]});}return null;})[_0xee74('0x4e')](respondWithResult(_0x19b826,null))[_0xee74('0x26')](handleError(_0x19b826,null));};exports[_0xee74('0x63')]=function(_0x42347d,_0x3d456f,_0x364da4){var _0x550afc=[_0xee74('0x64'),_0xee74('0x65'),_0xee74('0x66'),_0xee74('0x67'),_0xee74('0x68'),'notify','incident_state','severity','category'];var _0x18436d=['parent',_0xee74('0x64'),'caused_by',_0xee74('0x69'),'upon_reject',_0xee74('0x6a'),_0xee74('0x6b'),'hold_reason','approval_history',_0xee74('0x6c'),_0xee74('0x6d'),_0xee74('0x6e'),_0xee74('0x6f'),_0xee74('0x70'),_0xee74('0x71'),'sys_domain',_0xee74('0x72'),_0xee74('0x73'),_0xee74('0x66'),_0xee74('0x43'),'calendar_stc',_0xee74('0x74'),_0xee74('0x75'),_0xee74('0x76'),_0xee74('0x77'),_0xee74('0x78'),_0xee74('0x79'),_0xee74('0x7a'),_0xee74('0x7b'),_0xee74('0x7c'),_0xee74('0x7d'),_0xee74('0x7e'),'expected_start',_0xee74('0x7f'),_0xee74('0x80'),'group_list',_0xee74('0x81'),_0xee74('0x82'),_0xee74('0x83'),_0xee74('0x84'),_0xee74('0x85'),_0xee74('0x67'),'work_notes',_0xee74('0x86'),'close_code',_0xee74('0x87'),_0xee74('0x88'),_0xee74('0x89'),'assignment_group',_0xee74('0x8a'),_0xee74('0x8b'),_0xee74('0x8c'),_0xee74('0x8d'),_0xee74('0x8e'),_0xee74('0x8f'),_0xee74('0x90'),_0xee74('0x91'),_0xee74('0x92'),_0xee74('0x93'),_0xee74('0x94'),_0xee74('0x95'),_0xee74('0x96'),'incident_state',_0xee74('0x97'),_0xee74('0x98'),_0xee74('0x99'),'reassignment_count',_0xee74('0x9a'),_0xee74('0x9b'),_0xee74('0x9c'),_0xee74('0x9d'),'sla_due',_0xee74('0x9e'),_0xee74('0x9f'),_0xee74('0xa0'),'sys_mod_count',_0xee74('0xa1'),'sys_tags',_0xee74('0xa2'),_0xee74('0xa3'),_0xee74('0xa4'),_0xee74('0xa5'),_0xee74('0xa6')];var _0x3b6825='';var _0x31ab93='';var _0x361b47=[];var _0x45c563='';var _0x21a2d9='';var _0x1dc3f1=[];var _0x4a67a3='';var _0x4d9fe3='';var _0x595155={};var _0x439d32='';return db[_0xee74('0x37')]['findOne']({'where':{'id':_0x42347d[_0xee74('0x59')]['id']},'attributes':['id','username',_0xee74('0xa7'),_0xee74('0xa8'),_0xee74('0xa9'),_0xee74('0xaa')]})[_0xee74('0x4e')](handleEntityNotFound(_0x3d456f,null))[_0xee74('0x4e')](function(_0x5daa8c){if(_0x5daa8c){_0x439d32=_0x5daa8c[_0xee74('0xa9')];var _0x4470bb=_0x439d32[_0xee74('0xab')](-0x1);if(_0x4470bb==='/'){_0x439d32=_0x439d32[_0xee74('0xac')](0x0,_0x439d32[_0xee74('0xad')](_0x4470bb));}_0x4d9fe3=util[_0xee74('0xae')]('%s/api/now/doc/table/schema/',_0x439d32);_0x4a67a3=util[_0xee74('0xae')]('%s/api/now/table/',_0x439d32);_0x595155={'user':_0x5daa8c[_0xee74('0xaf')],'pass':_0x5daa8c['password']};var _0xf572d0={'method':_0xee74('0xb0'),'uri':_0x4d9fe3+'incident?sysparm_display_value=all','auth':_0x595155,'json':!![]};return rp(_0xf572d0);}})['then'](function(_0x1d1498){if(_0x1d1498[_0xee74('0x25')][_0xee74('0x52')]>0x0){_0x3b6825=_0x1d1498[_0xee74('0x25')];}console['log']('incident\x20table\x20objects',_0x3b6825);_0x1dc3f1=[];_0x31ab93=Object[_0xee74('0xb1')]([],_0x3b6825);_[_0xee74('0xb2')](_0x31ab93,function(_0x4b8b3a){return!_0x550afc[_0xee74('0xb3')](_0x4b8b3a[_0xee74('0x35')]);});_0x31ab93[_0xee74('0xb4')](function(_0x2a76dd){var _0x478cec=createFieldObject(_0x4a67a3,_0x595155,_0x2a76dd[_0xee74('0xb5')],_0x2a76dd[_0xee74('0x35')],_0x2a76dd[_0xee74('0xb6')],![]);_0x1dc3f1[_0xee74('0xb7')](_0x478cec);});return Promise[_0xee74('0xb8')](_0x1dc3f1);})[_0xee74('0x4e')](function(_0x5d6d81){_0x361b47=_0x5d6d81;_0x45c563=Object[_0xee74('0xb1')]([],_0x3b6825);console[_0xee74('0xb9')](_0xee74('0xba'),_0x3b6825);_[_0xee74('0xb2')](_0x45c563,function(_0x187c2a){return _0x18436d[_0xee74('0xb3')](_0x187c2a[_0xee74('0x35')]);});console[_0xee74('0xb9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x45c563);_0x1dc3f1=[];_0x45c563[_0xee74('0xb4')](function(_0x19cc48){var _0x211a71=createFieldObject(_0x4a67a3,_0x595155,_0x19cc48[_0xee74('0xb5')],_0x19cc48[_0xee74('0x35')],_0x19cc48[_0xee74('0xb6')],!![]);_0x1dc3f1[_0xee74('0xb7')](_0x211a71);});return Promise[_0xee74('0xb8')](_0x1dc3f1);})[_0xee74('0x4e')](function(_0x5dec14){_0x21a2d9=_0x5dec14;var _0x13247a=_0x361b47[_0xee74('0xbb')](_0x21a2d9);return{'count':_0x13247a[_0xee74('0x52')],'rows':_0x13247a};})['then'](respondWithResult(_0x3d456f,null))[_0xee74('0x26')](function(_0x25d8c7){console['log'](_0xee74('0xbc')+_0x25d8c7);var _0x2bbbf2=_0x42347d[_0xee74('0x3b')]['test']?0x1f4:_0x25d8c7[_0xee74('0xbd')]||0x1f4;logger[_0xee74('0x22')](_0x25d8c7['stack']);delete _0x25d8c7[_0xee74('0x35')];if(_0x2bbbf2===0x191){_0x2bbbf2=0x190;}_0x3d456f[_0xee74('0x29')](_0x2bbbf2)[_0xee74('0x36')](_0x42347d[_0xee74('0x3b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x25d8c7[_0xee74('0xbd')]}:_0x25d8c7);});};function createFieldObject(_0x34fa45,_0x1fbcae,_0xbecab0,_0x5cfe2e,_0x214f67,_0x2008d2){return new Promise(function(_0x5a6165,_0x537127){var _0x4b706d={'id':_0x5cfe2e,'name':_0x214f67,'custom':_0x2008d2};if(_0xbecab0===_0xee74('0xbe')){_0x4b706d[_0xee74('0x4d')]=[{'name':_0xee74('0xbf'),'value':_0xee74('0xc0')},{'name':'False','value':'false'}];_0x5a6165(_0x4b706d);}else{var _0x27cc3c={'method':'GET','uri':_0x34fa45+_0xee74('0xc1')+_0x5cfe2e,'auth':_0x1fbcae,'json':!![]};return rp(_0x27cc3c)[_0xee74('0x4e')](function(_0x1f0daf){var _0x4f1093=[];if(_0x1f0daf[_0xee74('0x25')][_0xee74('0x52')]>0x0){_0x1f0daf['result'][_0xee74('0xb4')](function(_0x1c9285){if(_0x1c9285['inactive']===_0xee74('0xc2')){var _0x2de276={'name':_0x1c9285['label'],'value':_0x1c9285[_0xee74('0xc3')]};_0x4f1093[_0xee74('0xb7')](_0x2de276);}});}_0x4b706d[_0xee74('0x4d')]=_0x4f1093;if(_0x4b706d[_0xee74('0x4d')][_0xee74('0x52')]>0x0){_0x5a6165(_0x4b706d);}else{if(_0x2008d2==![]){_0x5a6165();}else{_0x5a6165(_0x4b706d);}}});}});} \ No newline at end of file +var _0xd555=['assigned_to','severity','comments','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','statusCode','stack','send','Wrong\x20credentials','boolean','True','true','False','inactive','false','value','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','catch','end','status','count','offset','limit','set','Content-Range','json','reject','update','destroy','sendStatus','name','index','rawAttributes','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','field','includeAll','ServicenowAccount','findAll','rows','show','params','intersection','include','find','create','getConfigurations','findOne','ServicenowConfiguration','order','options','addConfiguration','body','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','parent','caused_by','watch_list','child_incidents','hold_reason','approval_history','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due'];(function(_0x4787de,_0x39da05){var _0x366a64=function(_0x2de2de){while(--_0x2de2de){_0x4787de['push'](_0x4787de['shift']());}};_0x366a64(++_0x39da05);}(_0xd555,0xef));var _0x5d55=function(_0x2302a1,_0x4bc33d){_0x2302a1=_0x2302a1-0x0;var _0x413cae=_0xd555[_0x2302a1];return _0x413cae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5d55('0x0'));var rimraf=require(_0x5d55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d55('0x2'));var moment=require(_0x5d55('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5d55('0x4'));var util=require(_0x5d55('0x5'));var path=require(_0x5d55('0x6'));var sox=require(_0x5d55('0x7'));var csv=require(_0x5d55('0x8'));var ejs=require(_0x5d55('0x9'));var fs=require('fs');var _=require(_0x5d55('0xa'));var squel=require(_0x5d55('0xb'));var crypto=require(_0x5d55('0xc'));var jsforce=require(_0x5d55('0xd'));var deskjs=require(_0x5d55('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5d55('0xf'));var Papa=require(_0x5d55('0x10'));var Redis=require(_0x5d55('0x11'));var authService=require(_0x5d55('0x12'));var qs=require(_0x5d55('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d55('0x14'))(_0x5d55('0x15'));var utils=require(_0x5d55('0x16'));var config=require(_0x5d55('0x17'));var db=require(_0x5d55('0x18'))['db'];var integrations=require(_0x5d55('0x19'));var jayson=require(_0x5d55('0x1a'));var client=jayson[_0x5d55('0x1b')][_0x5d55('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x11f04a,_0x19a6eb,_0x54fc4c){if(_0x54fc4c){var _0x153b0a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x153b0a[_0x5d55('0x1d')](_0x19a6eb)){return _0x11f04a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x11f04a;}}function respondWithRpcPromise(_0x46712e,_0x22039f,_0x4854b3,_0x5ac222){return new BPromise(function(_0x1eea92,_0x2c4413){var _0x332e5b=_0x5ac222||client;return _0x332e5b[_0x5d55('0x1e')](_0x46712e,_0x4854b3)[_0x5d55('0x1f')](function(_0x2f88ef){logger[_0x5d55('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x22039f,_0x5d55('0x21'));logger['debug'](_0x5d55('0x22'),_0x22039f,_0x5d55('0x21'),JSON[_0x5d55('0x23')](_0x2f88ef));if(_0x2f88ef[_0x5d55('0x24')]){if(_0x2f88ef[_0x5d55('0x24')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x22039f,_0x2f88ef[_0x5d55('0x24')][_0x5d55('0x25')]);return _0x2c4413(_0x2f88ef[_0x5d55('0x24')]['message']);}logger[_0x5d55('0x24')](_0x5d55('0x26'),_0x22039f,_0x2f88ef[_0x5d55('0x24')][_0x5d55('0x25')]);return _0x1eea92(_0x2f88ef[_0x5d55('0x24')][_0x5d55('0x25')]);}else{logger[_0x5d55('0x20')](_0x5d55('0x26'),_0x22039f,'request\x20sent');_0x1eea92(_0x2f88ef['result'][_0x5d55('0x25')]);}})[_0x5d55('0x27')](function(_0x2b2339){logger[_0x5d55('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x22039f,_0x2b2339);_0x2c4413(_0x2b2339);});});}function respondWithStatusCode(_0xd33ce9,_0x1dde0e){_0x1dde0e=_0x1dde0e||0xcc;return function(_0x2280cd){if(_0x2280cd){return _0xd33ce9['sendStatus'](_0x1dde0e);}return _0xd33ce9['status'](_0x1dde0e)[_0x5d55('0x28')]();};}function respondWithResult(_0xa3bb88,_0x5ade2e){_0x5ade2e=_0x5ade2e||0xc8;return function(_0x3ccc50){if(_0x3ccc50){return _0xa3bb88[_0x5d55('0x29')](_0x5ade2e)['json'](_0x3ccc50);}};}function respondWithFilteredResult(_0x50d234,_0x2dafd8){return function(_0x119ef0){if(_0x119ef0){var _0x2fe3cb=_0x119ef0[_0x5d55('0x2a')],_0x295b16=_0x2dafd8[_0x5d55('0x2b')],_0x261bf9=_0x2dafd8['offset']+_0x2dafd8[_0x5d55('0x2c')],_0x4e6a02;if(_0x261bf9>=_0x2fe3cb){_0x261bf9=_0x2fe3cb;_0x4e6a02=0xc8;}else{_0x4e6a02=0xce;}_0x50d234['status'](_0x4e6a02);return _0x50d234[_0x5d55('0x2d')](_0x5d55('0x2e'),_0x295b16+'-'+_0x261bf9+'/'+_0x2fe3cb)[_0x5d55('0x2f')](_0x119ef0);}return null;};}function patchUpdates(_0x4c3f3f){return function(_0x188392){try{jsonpatch['apply'](_0x188392,_0x4c3f3f,!![]);}catch(_0x5ed909){return BPromise[_0x5d55('0x30')](_0x5ed909);}return _0x188392['save']();};}function saveUpdates(_0x2aa168,_0x53857e){return function(_0x322e74){if(_0x322e74){return _0x322e74[_0x5d55('0x31')](_0x2aa168)[_0x5d55('0x1f')](function(_0x15dcdb){return _0x15dcdb;});}return null;};}function removeEntity(_0x32ec65,_0x56acf2){return function(_0x2cf09e){if(_0x2cf09e){return _0x2cf09e[_0x5d55('0x32')]()[_0x5d55('0x1f')](function(){_0x32ec65[_0x5d55('0x29')](0xcc)[_0x5d55('0x28')]();});}};}function handleEntityNotFound(_0x18e1b4,_0x21ff89){return function(_0x4cacc9){if(!_0x4cacc9){_0x18e1b4[_0x5d55('0x33')](0x194);}return _0x4cacc9;};}function handleError(_0x3293a2,_0x449d3a){_0x449d3a=_0x449d3a||0x1f4;return function(_0x3f8f32){logger[_0x5d55('0x24')](_0x3f8f32['stack']);if(_0x3f8f32[_0x5d55('0x34')]){delete _0x3f8f32['name'];}_0x3293a2[_0x5d55('0x29')](_0x449d3a)['send'](_0x3f8f32);};}exports[_0x5d55('0x35')]=function(_0x1228a3,_0xbd10b7){var _0x137097={},_0x32aa94={},_0x1708db={'count':0x0,'rows':[]};var _0x1ffa95=db['ServicenowAccount'][_0x5d55('0x36')];_0x32aa94[_0x5d55('0x37')]=_[_0x5d55('0x38')](_0x1ffa95);_0x32aa94['query']=_['keys'](_0x1228a3['query']);_0x32aa94[_0x5d55('0x39')]=_['intersection'](_0x32aa94[_0x5d55('0x37')],_0x32aa94[_0x5d55('0x3a')]);_0x137097[_0x5d55('0x3b')]=_['intersection'](_0x32aa94[_0x5d55('0x37')],qs[_0x5d55('0x3c')](_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x3c')]));_0x137097['attributes']=_0x137097['attributes'][_0x5d55('0x3d')]?_0x137097[_0x5d55('0x3b')]:_0x32aa94[_0x5d55('0x37')];if(!_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x3e')](_0x5d55('0x3f'))){_0x137097[_0x5d55('0x2c')]=qs['limit'](_0x1228a3['query'][_0x5d55('0x2c')]);_0x137097['offset']=qs[_0x5d55('0x2b')](_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x2b')]);}_0x137097['order']=qs[_0x5d55('0x40')](_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x40')]);_0x137097[_0x5d55('0x41')]=qs[_0x5d55('0x39')](_[_0x5d55('0x42')](_0x1228a3[_0x5d55('0x3a')],_0x32aa94[_0x5d55('0x39')]));if(_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x43')]){_0x137097[_0x5d55('0x41')]=_[_0x5d55('0x44')](_0x137097[_0x5d55('0x41')],{'$or':_[_0x5d55('0x45')](_0x1ffa95,function(_0x2c812c){if(_0x2c812c[_0x5d55('0x46')]['key']!=='VIRTUAL'){var _0x1c1a87={};_0x1c1a87[_0x2c812c[_0x5d55('0x47')]]={'$like':'%'+_0x1228a3['query'][_0x5d55('0x43')]+'%'};return _0x1c1a87;}})});}_0x137097=_[_0x5d55('0x44')]({},_0x137097,_0x1228a3['options']);var _0x8c504={'where':_0x137097[_0x5d55('0x41')]};return db['ServicenowAccount'][_0x5d55('0x2a')](_0x8c504)[_0x5d55('0x1f')](function(_0x34b958){_0x1708db[_0x5d55('0x2a')]=_0x34b958;if(_0x1228a3[_0x5d55('0x3a')][_0x5d55('0x48')]){_0x137097['include']=[{'all':!![]}];}return db[_0x5d55('0x49')][_0x5d55('0x4a')](_0x137097);})['then'](function(_0x15b3b5){_0x1708db[_0x5d55('0x4b')]=_0x15b3b5;return _0x1708db;})['then'](respondWithFilteredResult(_0xbd10b7,_0x137097))[_0x5d55('0x27')](handleError(_0xbd10b7,null));};exports[_0x5d55('0x4c')]=function(_0x18cb76,_0x591cec){var _0x24f01d={'raw':![],'where':{'id':_0x18cb76[_0x5d55('0x4d')]['id']}},_0x453211={};_0x453211[_0x5d55('0x37')]=_[_0x5d55('0x38')](db['ServicenowAccount']['rawAttributes']);_0x453211[_0x5d55('0x3a')]=_[_0x5d55('0x38')](_0x18cb76[_0x5d55('0x3a')]);_0x453211[_0x5d55('0x39')]=_[_0x5d55('0x4e')](_0x453211['model'],_0x453211[_0x5d55('0x3a')]);_0x24f01d[_0x5d55('0x3b')]=_[_0x5d55('0x4e')](_0x453211[_0x5d55('0x37')],qs['fields'](_0x18cb76[_0x5d55('0x3a')][_0x5d55('0x3c')]));_0x24f01d[_0x5d55('0x3b')]=_0x24f01d[_0x5d55('0x3b')][_0x5d55('0x3d')]?_0x24f01d[_0x5d55('0x3b')]:_0x453211[_0x5d55('0x37')];if(_0x18cb76[_0x5d55('0x3a')][_0x5d55('0x48')]){_0x24f01d[_0x5d55('0x4f')]=[{'all':!![]}];}_0x24f01d=_[_0x5d55('0x44')]({},_0x24f01d,_0x18cb76['options']);return db['ServicenowAccount'][_0x5d55('0x50')](_0x24f01d)[_0x5d55('0x1f')](handleEntityNotFound(_0x591cec,null))['then'](respondWithResult(_0x591cec,null))[_0x5d55('0x27')](handleError(_0x591cec,null));};exports[_0x5d55('0x51')]=function(_0x5df1de,_0xf69b8b){return db['ServicenowAccount']['create'](_0x5df1de['body'],{})[_0x5d55('0x1f')](respondWithResult(_0xf69b8b,0xc9))[_0x5d55('0x27')](handleError(_0xf69b8b,null));};exports[_0x5d55('0x31')]=function(_0x5c80e4,_0x3bedfb){if(_0x5c80e4['body']['id']){delete _0x5c80e4['body']['id'];}return db[_0x5d55('0x49')][_0x5d55('0x50')]({'where':{'id':_0x5c80e4[_0x5d55('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bedfb,null))['then'](saveUpdates(_0x5c80e4['body'],null))['then'](respondWithResult(_0x3bedfb,null))['catch'](handleError(_0x3bedfb,null));};exports[_0x5d55('0x32')]=function(_0x50923d,_0x562afe){return db['ServicenowAccount']['find']({'where':{'id':_0x50923d[_0x5d55('0x4d')]['id']}})[_0x5d55('0x1f')](handleEntityNotFound(_0x562afe,null))[_0x5d55('0x1f')](removeEntity(_0x562afe,null))[_0x5d55('0x27')](handleError(_0x562afe,null));};exports[_0x5d55('0x52')]=function(_0x483d2b,_0x54220a,_0x5b0d07){var _0x20d231={};var _0x205b9b={};var _0x418469;var _0x3ae1b4;return db[_0x5d55('0x49')][_0x5d55('0x53')]({'where':{'id':_0x483d2b[_0x5d55('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54220a,null))[_0x5d55('0x1f')](function(_0x5cf8e5){if(_0x5cf8e5){_0x418469=_0x5cf8e5;_0x205b9b[_0x5d55('0x37')]=_['keys'](db[_0x5d55('0x54')][_0x5d55('0x36')]);_0x205b9b[_0x5d55('0x3a')]=_[_0x5d55('0x38')](_0x483d2b[_0x5d55('0x3a')]);_0x205b9b[_0x5d55('0x39')]=_[_0x5d55('0x4e')](_0x205b9b[_0x5d55('0x37')],_0x205b9b['query']);_0x20d231[_0x5d55('0x3b')]=_[_0x5d55('0x4e')](_0x205b9b[_0x5d55('0x37')],qs['fields'](_0x483d2b['query'][_0x5d55('0x3c')]));_0x20d231[_0x5d55('0x3b')]=_0x20d231[_0x5d55('0x3b')][_0x5d55('0x3d')]?_0x20d231[_0x5d55('0x3b')]:_0x205b9b[_0x5d55('0x37')];_0x20d231[_0x5d55('0x55')]=qs['sort'](_0x483d2b[_0x5d55('0x3a')][_0x5d55('0x40')]);_0x20d231[_0x5d55('0x41')]=qs[_0x5d55('0x39')](_[_0x5d55('0x42')](_0x483d2b[_0x5d55('0x3a')],_0x205b9b['filters']));if(_0x483d2b['query'][_0x5d55('0x43')]){_0x20d231[_0x5d55('0x41')]=_['merge'](_0x20d231[_0x5d55('0x41')],{'$or':_[_0x5d55('0x45')](_0x20d231[_0x5d55('0x3b')],function(_0x299b6e){var _0x23f059={};_0x23f059[_0x299b6e]={'$like':'%'+_0x483d2b[_0x5d55('0x3a')]['filter']+'%'};return _0x23f059;})});}_0x20d231=_[_0x5d55('0x44')]({},_0x20d231,_0x483d2b[_0x5d55('0x56')]);return _0x418469[_0x5d55('0x52')](_0x20d231);}})[_0x5d55('0x1f')](function(_0x42a6e3){if(_0x42a6e3){_0x3ae1b4=_0x42a6e3[_0x5d55('0x3d')];if(!_0x483d2b[_0x5d55('0x3a')][_0x5d55('0x3e')](_0x5d55('0x3f'))){_0x20d231['limit']=qs[_0x5d55('0x2c')](_0x483d2b['query'][_0x5d55('0x2c')]);_0x20d231[_0x5d55('0x2b')]=qs[_0x5d55('0x2b')](_0x483d2b['query'][_0x5d55('0x2b')]);}return _0x418469[_0x5d55('0x52')](_0x20d231);}})[_0x5d55('0x1f')](function(_0x413984){if(_0x413984){return _0x413984?{'count':_0x3ae1b4,'rows':_0x413984}:null;}})[_0x5d55('0x1f')](respondWithResult(_0x54220a,null))[_0x5d55('0x27')](handleError(_0x54220a,null));};exports[_0x5d55('0x57')]=function(_0x217353,_0x31932f,_0x247195){if(_0x217353[_0x5d55('0x58')]['id']){delete _0x217353[_0x5d55('0x58')]['id'];}return db[_0x5d55('0x49')]['findOne']({'where':{'id':_0x217353[_0x5d55('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31932f,null))[_0x5d55('0x1f')](function(_0x5671a5){if(_0x5671a5){_0x217353[_0x5d55('0x58')]['AccountId']=_0x5671a5['id'];_0x217353[_0x5d55('0x58')][_0x5d55('0x59')]=integrations['getSubjects'](_0x217353[_0x5d55('0x58')][_0x5d55('0x5a')],_0x217353[_0x5d55('0x58')][_0x5d55('0x46')]);_0x217353[_0x5d55('0x58')][_0x5d55('0x5b')]=integrations[_0x5d55('0x5c')](_0x217353[_0x5d55('0x58')][_0x5d55('0x5a')],_0x217353[_0x5d55('0x58')][_0x5d55('0x46')]);return db[_0x5d55('0x54')][_0x5d55('0x51')](_0x217353[_0x5d55('0x58')],{'include':[{'model':db[_0x5d55('0x5d')],'as':'Subjects'},{'model':db[_0x5d55('0x5d')],'as':_0x5d55('0x5b')}]});}return null;})[_0x5d55('0x1f')](respondWithResult(_0x31932f,null))[_0x5d55('0x27')](handleError(_0x31932f,null));};exports[_0x5d55('0x5e')]=function(_0x3ef410,_0x3025a2,_0x29e231){var _0x4449eb=[_0x5d55('0x5f'),'hold_reason',_0x5d55('0x60'),_0x5d55('0x61'),_0x5d55('0x62'),_0x5d55('0x63'),_0x5d55('0x64'),'severity','category'];var _0x57f430=[_0x5d55('0x65'),_0x5d55('0x5f'),_0x5d55('0x66'),_0x5d55('0x67'),'upon_reject','sys_updated_on',_0x5d55('0x68'),_0x5d55('0x69'),_0x5d55('0x6a'),'number','resolved_by','sys_updated_by','opened_by',_0x5d55('0x6b'),_0x5d55('0x6c'),_0x5d55('0x6d'),'state',_0x5d55('0x6e'),_0x5d55('0x60'),_0x5d55('0x55'),_0x5d55('0x6f'),'closed_at',_0x5d55('0x70'),_0x5d55('0x71'),_0x5d55('0x72'),_0x5d55('0x73'),_0x5d55('0x74'),_0x5d55('0x75'),_0x5d55('0x76'),'sys_domain_path',_0x5d55('0x77'),_0x5d55('0x78'),_0x5d55('0x79'),'opened_at',_0x5d55('0x7a'),_0x5d55('0x7b'),_0x5d55('0x7c'),_0x5d55('0x7d'),_0x5d55('0x7e'),_0x5d55('0x7f'),'approval_set',_0x5d55('0x61'),_0x5d55('0x80'),_0x5d55('0x81'),_0x5d55('0x62'),_0x5d55('0x82'),_0x5d55('0x83'),_0x5d55('0x84'),'assignment_group',_0x5d55('0x85'),_0x5d55('0x86'),_0x5d55('0x87'),_0x5d55('0x88'),_0x5d55('0x63'),_0x5d55('0x89'),_0x5d55('0x8a'),_0x5d55('0x8b'),_0x5d55('0x8c'),_0x5d55('0x8d'),'sys_id',_0x5d55('0x8e'),_0x5d55('0x8f'),_0x5d55('0x64'),_0x5d55('0x90'),_0x5d55('0x91'),_0x5d55('0x92'),_0x5d55('0x93'),_0x5d55('0x94'),_0x5d55('0x95'),_0x5d55('0x96'),_0x5d55('0x97'),'sla_due','approval',_0x5d55('0x98'),'due_date','sys_mod_count',_0x5d55('0x99'),_0x5d55('0x9a'),_0x5d55('0x9b'),_0x5d55('0x9c'),_0x5d55('0x9d'),'location',_0x5d55('0x9e')];var _0x5c5556='';var _0x5c2522='';var _0x1a2d64=[];var _0x203253='';var _0x58e66b='';var _0x29572b=[];var _0x3bb6db='';var _0x56b604='';var _0x242761={};var _0x42b0a3='';return db[_0x5d55('0x49')]['findOne']({'where':{'id':_0x3ef410['params']['id']},'attributes':['id',_0x5d55('0x9f'),_0x5d55('0xa0'),_0x5d55('0xa1'),_0x5d55('0xa2'),_0x5d55('0xa3')]})[_0x5d55('0x1f')](handleEntityNotFound(_0x3025a2,null))[_0x5d55('0x1f')](function(_0x1df272){if(_0x1df272){_0x42b0a3=_0x1df272['remoteUri'];var _0x106a60=_0x42b0a3[_0x5d55('0xa4')](-0x1);if(_0x106a60==='/'){_0x42b0a3=_0x42b0a3['substring'](0x0,_0x42b0a3[_0x5d55('0xa5')](_0x106a60));}_0x56b604=util[_0x5d55('0xa6')]('%s/api/now/doc/table/schema/',_0x42b0a3);_0x3bb6db=util[_0x5d55('0xa6')](_0x5d55('0xa7'),_0x42b0a3);_0x242761={'user':_0x1df272[_0x5d55('0x9f')],'pass':_0x1df272[_0x5d55('0xa0')]};var _0xdad3d9={'method':_0x5d55('0xa8'),'uri':_0x56b604+_0x5d55('0xa9'),'auth':_0x242761,'json':!![]};return rp(_0xdad3d9);}})[_0x5d55('0x1f')](function(_0x36cb95){if(_0x36cb95[_0x5d55('0xaa')][_0x5d55('0x3d')]>0x0){_0x5c5556=_0x36cb95['result'];}console['log'](_0x5d55('0xab'),_0x5c5556);_0x29572b=[];_0x5c2522=Object[_0x5d55('0xac')]([],_0x5c5556);_[_0x5d55('0xad')](_0x5c2522,function(_0x534478){return!_0x4449eb[_0x5d55('0xae')](_0x534478['name']);});_0x5c2522[_0x5d55('0xaf')](function(_0x4348ef){var _0x2782eb=createFieldObject(_0x3bb6db,_0x242761,_0x4348ef['internalType'],_0x4348ef[_0x5d55('0x34')],_0x4348ef[_0x5d55('0xb0')],![]);_0x29572b[_0x5d55('0xb1')](_0x2782eb);});return Promise[_0x5d55('0xb2')](_0x29572b);})[_0x5d55('0x1f')](function(_0x2b8247){_0x1a2d64=_0x2b8247;_0x203253=Object[_0x5d55('0xac')]([],_0x5c5556);console[_0x5d55('0xb3')](_0x5d55('0xb4'),_0x5c5556);_[_0x5d55('0xad')](_0x203253,function(_0x368309){return _0x57f430[_0x5d55('0xae')](_0x368309['name']);});console[_0x5d55('0xb3')](_0x5d55('0xb5'),_0x203253);_0x29572b=[];_0x203253[_0x5d55('0xaf')](function(_0x4067e5){var _0xb5382e=createFieldObject(_0x3bb6db,_0x242761,_0x4067e5['internalType'],_0x4067e5['name'],_0x4067e5[_0x5d55('0xb0')],!![]);_0x29572b[_0x5d55('0xb1')](_0xb5382e);});return Promise[_0x5d55('0xb2')](_0x29572b);})[_0x5d55('0x1f')](function(_0x24d257){_0x58e66b=_0x24d257;var _0x10f06d=_0x1a2d64[_0x5d55('0xb6')](_0x58e66b);return{'count':_0x10f06d[_0x5d55('0x3d')],'rows':_0x10f06d};})['then'](respondWithResult(_0x3025a2,null))['catch'](function(_0x227112){console['log']('ServiceNow\x20error:\x20'+_0x227112);var _0x411ce6=_0x3ef410[_0x5d55('0x3a')][_0x5d55('0x1d')]?0x1f4:_0x227112[_0x5d55('0xb7')]||0x1f4;logger[_0x5d55('0x24')](_0x227112[_0x5d55('0xb8')]);delete _0x227112[_0x5d55('0x34')];if(_0x411ce6===0x191){_0x411ce6=0x190;}_0x3025a2[_0x5d55('0x29')](_0x411ce6)[_0x5d55('0xb9')](_0x3ef410[_0x5d55('0x3a')][_0x5d55('0x1d')]?{'message':_0x5d55('0xba'),'statusCode':_0x227112[_0x5d55('0xb7')]}:_0x227112);});};function createFieldObject(_0x4a2aad,_0x54a4c9,_0x1a221c,_0x22c3ed,_0x50560d,_0x1d5881){return new Promise(function(_0x271f72,_0x4593af){var _0x8cd768={'id':_0x22c3ed,'name':_0x50560d,'custom':_0x1d5881};if(_0x1a221c===_0x5d55('0xbb')){_0x8cd768['options']=[{'name':_0x5d55('0xbc'),'value':_0x5d55('0xbd')},{'name':_0x5d55('0xbe'),'value':'false'}];_0x271f72(_0x8cd768);}else{var _0x1c0861={'method':_0x5d55('0xa8'),'uri':_0x4a2aad+'sys_choice?sysparm_query=name=incident^element='+_0x22c3ed,'auth':_0x54a4c9,'json':!![]};return rp(_0x1c0861)[_0x5d55('0x1f')](function(_0x536373){var _0x35ca3b=[];if(_0x536373[_0x5d55('0xaa')][_0x5d55('0x3d')]>0x0){_0x536373[_0x5d55('0xaa')][_0x5d55('0xaf')](function(_0x468cd4){if(_0x468cd4[_0x5d55('0xbf')]===_0x5d55('0xc0')){var _0x2378dd={'name':_0x468cd4[_0x5d55('0xb0')],'value':_0x468cd4[_0x5d55('0xc1')]};_0x35ca3b[_0x5d55('0xb1')](_0x2378dd);}});}_0x8cd768['options']=_0x35ca3b;if(_0x8cd768['options'][_0x5d55('0x3d')]>0x0){_0x271f72(_0x8cd768);}else{if(_0x1d5881==![]){_0x271f72();}else{_0x271f72(_0x8cd768);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index dd3d4de..3f99d9c 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x316329,_0x339c6e){var _0xfc77f=function(_0xb94334){while(--_0xb94334){_0x316329['push'](_0x316329['shift']());}};_0xfc77f(++_0x339c6e);}(_0x814b,0x1a2));var _0xb814=function(_0x32e758,_0x13c271){_0x32e758=_0x32e758-0x0;var _0x349316=_0x814b[_0x32e758];return _0x349316;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0x55738f,_0x595b6f){var _0x5f40b8=function(_0x390ee8){while(--_0x390ee8){_0x55738f['push'](_0x55738f['shift']());}};_0x5f40b8(++_0x595b6f);}(_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'));var integrations=require(_0x7995('0x9'));module[_0x7995('0xa')]=function(_0x219534,_0xbda126){return _0x219534[_0x7995('0xb')]('ServicenowAccount',attributes,{'tableName':_0x7995('0xc'),'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 58b0558..3411071 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 _0x2fc7=['limit','include','map','model','attributes','ShowServicenowAccount','find','where','lodash','moment','randomstring','../../config/logger','jayson/promise','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw'];(function(_0x12e409,_0x379bb4){var _0xacb87b=function(_0x53ad8c){while(--_0x53ad8c){_0x12e409['push'](_0x12e409['shift']());}};_0xacb87b(++_0x379bb4);}(_0x2fc7,0x108));var _0x72fc=function(_0x17710e,_0x5dcbc3){_0x17710e=_0x17710e-0x0;var _0x4cb606=_0x2fc7[_0x17710e];return _0x4cb606;};'use strict';var _=require(_0x72fc('0x0'));var util=require('util');var moment=require(_0x72fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x72fc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x72fc('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x72fc('0x4'));var client=jayson['client'][_0x72fc('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5b1e13,_0x43eb30,_0x105f49){return new BPromise(function(_0x4b6780,_0x19b7ad){return client[_0x72fc('0x6')](_0x5b1e13,_0x105f49)[_0x72fc('0x7')](function(_0x1c0cf8){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x43eb30,_0x72fc('0x8'));logger[_0x72fc('0x9')](_0x72fc('0xa'),_0x43eb30,'request\x20sent',JSON[_0x72fc('0xb')](_0x1c0cf8));if(_0x1c0cf8['error']){if(_0x1c0cf8[_0x72fc('0xc')][_0x72fc('0xd')]===0x1f4){logger['error'](_0x72fc('0xe'),_0x43eb30,_0x1c0cf8[_0x72fc('0xc')]['message']);return _0x19b7ad(_0x1c0cf8['error'][_0x72fc('0xf')]);}logger[_0x72fc('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x43eb30,_0x1c0cf8[_0x72fc('0xc')][_0x72fc('0xf')]);return _0x4b6780(_0x1c0cf8[_0x72fc('0xc')][_0x72fc('0xf')]);}else{logger[_0x72fc('0x10')](_0x72fc('0xe'),_0x43eb30,'request\x20sent');_0x4b6780(_0x1c0cf8[_0x72fc('0x11')]['message']);}})[_0x72fc('0x12')](function(_0x5953cb){logger[_0x72fc('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x43eb30,_0x5953cb);_0x19b7ad(_0x5953cb);});});}exports[_0x72fc('0x13')]=function(_0x378c51){var _0x94b10f=this;return new Promise(function(_0x427f4b,_0x207c7e){return db[_0x72fc('0x14')][_0x72fc('0x15')]({'raw':_0x378c51['options']?_0x378c51[_0x72fc('0x16')][_0x72fc('0x17')]===undefined?!![]:![]:!![],'where':_0x378c51['options']?_0x378c51[_0x72fc('0x16')]['where']||null:null,'attributes':_0x378c51[_0x72fc('0x16')]?_0x378c51[_0x72fc('0x16')]['attributes']||null:null,'limit':_0x378c51[_0x72fc('0x16')]?_0x378c51[_0x72fc('0x16')][_0x72fc('0x18')]||null:null,'include':_0x378c51['options']?_0x378c51['options'][_0x72fc('0x19')]?_[_0x72fc('0x1a')](_0x378c51['options'][_0x72fc('0x19')],function(_0x4258e7){return{'model':db[_0x4258e7[_0x72fc('0x1b')]],'as':_0x4258e7['as'],'attributes':_0x4258e7[_0x72fc('0x1c')],'include':_0x4258e7[_0x72fc('0x19')]?_[_0x72fc('0x1a')](_0x4258e7[_0x72fc('0x19')],function(_0x4172e1){return{'model':db[_0x4172e1[_0x72fc('0x1b')]],'as':_0x4172e1['as'],'attributes':_0x4172e1['attributes'],'include':_0x4172e1[_0x72fc('0x19')]?_[_0x72fc('0x1a')](_0x4172e1[_0x72fc('0x19')],function(_0x510093){return{'model':db[_0x510093[_0x72fc('0x1b')]],'as':_0x510093['as'],'attributes':_0x510093['attributes']};}):[]};}):[]};}):[]:[]})[_0x72fc('0x7')](function(_0x2d3c38){logger[_0x72fc('0x10')](_0x72fc('0x13'),_0x378c51);logger['debug'](_0x72fc('0x13'),_0x378c51,JSON['stringify'](_0x2d3c38));_0x427f4b(_0x2d3c38);})[_0x72fc('0x12')](function(_0x2c2c4b){logger[_0x72fc('0xc')](_0x72fc('0x13'),_0x2c2c4b[_0x72fc('0xf')],_0x378c51);_0x207c7e(_0x94b10f[_0x72fc('0xc')](0x1f4,_0x2c2c4b[_0x72fc('0xf')]));});});};exports[_0x72fc('0x1d')]=function(_0x24243d){var _0x24069a=this;return new Promise(function(_0xf2aac7,_0x1b4611){return db['ServicenowAccount'][_0x72fc('0x1e')]({'raw':_0x24243d[_0x72fc('0x16')]?_0x24243d[_0x72fc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x24243d[_0x72fc('0x16')]?_0x24243d[_0x72fc('0x16')][_0x72fc('0x1f')]||null:null,'attributes':_0x24243d[_0x72fc('0x16')]?_0x24243d[_0x72fc('0x16')][_0x72fc('0x1c')]||null:null,'include':_0x24243d[_0x72fc('0x16')]?_0x24243d[_0x72fc('0x16')][_0x72fc('0x19')]?_['map'](_0x24243d[_0x72fc('0x16')]['include'],function(_0x3fdc20){return{'model':db[_0x3fdc20[_0x72fc('0x1b')]],'as':_0x3fdc20['as'],'attributes':_0x3fdc20[_0x72fc('0x1c')],'include':_0x3fdc20[_0x72fc('0x19')]?_[_0x72fc('0x1a')](_0x3fdc20[_0x72fc('0x19')],function(_0x3ac969){return{'model':db[_0x3ac969[_0x72fc('0x1b')]],'as':_0x3ac969['as'],'attributes':_0x3ac969[_0x72fc('0x1c')],'include':_0x3ac969[_0x72fc('0x19')]?_[_0x72fc('0x1a')](_0x3ac969[_0x72fc('0x19')],function(_0x31fa3f){return{'model':db[_0x31fa3f[_0x72fc('0x1b')]],'as':_0x31fa3f['as'],'attributes':_0x31fa3f[_0x72fc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x72fc('0x7')](function(_0x3114a5){logger[_0x72fc('0x10')](_0x72fc('0x1d'),_0x24243d);logger[_0x72fc('0x9')](_0x72fc('0x1d'),_0x24243d,JSON['stringify'](_0x3114a5));_0xf2aac7(_0x3114a5);})[_0x72fc('0x12')](function(_0x5711f7){logger[_0x72fc('0xc')](_0x72fc('0x1d'),_0x5711f7[_0x72fc('0xf')],_0x24243d);_0x1b4611(_0x24069a[_0x72fc('0xc')](0x1f4,_0x5711f7[_0x72fc('0xf')]));});});}; \ No newline at end of file +var _0x2c84=['../../config/environment','client','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','ServicenowAccount','findAll','options','where','attributes','include','map','model','then','GetServicenowAccount','stringify','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a0494,_0x2bf757){var _0x8c5f93=function(_0x563583){while(--_0x563583){_0x3a0494['push'](_0x3a0494['shift']());}};_0x8c5f93(++_0x2bf757);}(_0x2c84,0x1a5));var _0x42c8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2c84[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x42c8('0x0'));var util=require(_0x42c8('0x1'));var moment=require('moment');var BPromise=require(_0x42c8('0x2'));var rs=require(_0x42c8('0x3'));var fs=require('fs');var Redis=require(_0x42c8('0x4'));var db=require(_0x42c8('0x5'))['db'];var utils=require(_0x42c8('0x6'));var logger=require(_0x42c8('0x7'))('rpc');var config=require(_0x42c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x42c8('0x9')][_0x42c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c8d46,_0x76d2c5,_0x5f4430){return new BPromise(function(_0x390ff3,_0x291e72){return client['request'](_0x4c8d46,_0x5f4430)['then'](function(_0x233868){logger[_0x42c8('0xb')](_0x42c8('0xc'),_0x76d2c5,_0x42c8('0xd'));logger[_0x42c8('0xe')](_0x42c8('0xf'),_0x76d2c5,_0x42c8('0xd'),JSON['stringify'](_0x233868));if(_0x233868[_0x42c8('0x10')]){if(_0x233868['error']['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x76d2c5,_0x233868[_0x42c8('0x10')][_0x42c8('0x11')]);return _0x291e72(_0x233868[_0x42c8('0x10')][_0x42c8('0x11')]);}logger['error'](_0x42c8('0xc'),_0x76d2c5,_0x233868[_0x42c8('0x10')][_0x42c8('0x11')]);return _0x390ff3(_0x233868[_0x42c8('0x10')][_0x42c8('0x11')]);}else{logger['info'](_0x42c8('0xc'),_0x76d2c5,_0x42c8('0xd'));_0x390ff3(_0x233868[_0x42c8('0x12')]['message']);}})[_0x42c8('0x13')](function(_0x2c16c8){logger[_0x42c8('0x10')](_0x42c8('0xc'),_0x76d2c5,_0x2c16c8);_0x291e72(_0x2c16c8);});});}exports['GetServicenowAccount']=function(_0x2a32ac){var _0x5b296c=this;return new Promise(function(_0x29b939,_0x21fa14){return db[_0x42c8('0x14')][_0x42c8('0x15')]({'raw':_0x2a32ac[_0x42c8('0x16')]?_0x2a32ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a32ac['options']?_0x2a32ac[_0x42c8('0x16')][_0x42c8('0x17')]||null:null,'attributes':_0x2a32ac['options']?_0x2a32ac[_0x42c8('0x16')][_0x42c8('0x18')]||null:null,'limit':_0x2a32ac['options']?_0x2a32ac[_0x42c8('0x16')]['limit']||null:null,'include':_0x2a32ac[_0x42c8('0x16')]?_0x2a32ac[_0x42c8('0x16')][_0x42c8('0x19')]?_[_0x42c8('0x1a')](_0x2a32ac['options']['include'],function(_0x62d24c){return{'model':db[_0x62d24c[_0x42c8('0x1b')]],'as':_0x62d24c['as'],'attributes':_0x62d24c['attributes'],'include':_0x62d24c['include']?_[_0x42c8('0x1a')](_0x62d24c['include'],function(_0xc670dc){return{'model':db[_0xc670dc['model']],'as':_0xc670dc['as'],'attributes':_0xc670dc[_0x42c8('0x18')],'include':_0xc670dc[_0x42c8('0x19')]?_[_0x42c8('0x1a')](_0xc670dc['include'],function(_0x16ff41){return{'model':db[_0x16ff41[_0x42c8('0x1b')]],'as':_0x16ff41['as'],'attributes':_0x16ff41[_0x42c8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x42c8('0x1c')](function(_0x145578){logger[_0x42c8('0xb')](_0x42c8('0x1d'),_0x2a32ac);logger[_0x42c8('0xe')](_0x42c8('0x1d'),_0x2a32ac,JSON[_0x42c8('0x1e')](_0x145578));_0x29b939(_0x145578);})[_0x42c8('0x13')](function(_0x26affe){logger['error'](_0x42c8('0x1d'),_0x26affe[_0x42c8('0x11')],_0x2a32ac);_0x21fa14(_0x5b296c[_0x42c8('0x10')](0x1f4,_0x26affe[_0x42c8('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x1cfbc6){var _0x2fd6c0=this;return new Promise(function(_0x4424ef,_0x3f74d7){return db['ServicenowAccount'][_0x42c8('0x1f')]({'raw':_0x1cfbc6[_0x42c8('0x16')]?_0x1cfbc6[_0x42c8('0x16')][_0x42c8('0x20')]===undefined?!![]:![]:!![],'where':_0x1cfbc6[_0x42c8('0x16')]?_0x1cfbc6[_0x42c8('0x16')][_0x42c8('0x17')]||null:null,'attributes':_0x1cfbc6[_0x42c8('0x16')]?_0x1cfbc6[_0x42c8('0x16')][_0x42c8('0x18')]||null:null,'include':_0x1cfbc6[_0x42c8('0x16')]?_0x1cfbc6[_0x42c8('0x16')][_0x42c8('0x19')]?_[_0x42c8('0x1a')](_0x1cfbc6[_0x42c8('0x16')][_0x42c8('0x19')],function(_0x2af4bb){return{'model':db[_0x2af4bb[_0x42c8('0x1b')]],'as':_0x2af4bb['as'],'attributes':_0x2af4bb['attributes'],'include':_0x2af4bb[_0x42c8('0x19')]?_[_0x42c8('0x1a')](_0x2af4bb['include'],function(_0x230617){return{'model':db[_0x230617['model']],'as':_0x230617['as'],'attributes':_0x230617[_0x42c8('0x18')],'include':_0x230617[_0x42c8('0x19')]?_[_0x42c8('0x1a')](_0x230617[_0x42c8('0x19')],function(_0x3284ee){return{'model':db[_0x3284ee[_0x42c8('0x1b')]],'as':_0x3284ee['as'],'attributes':_0x3284ee[_0x42c8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x42c8('0x1c')](function(_0x3dd078){logger[_0x42c8('0xb')]('ShowServicenowAccount',_0x1cfbc6);logger[_0x42c8('0xe')]('ShowServicenowAccount',_0x1cfbc6,JSON[_0x42c8('0x1e')](_0x3dd078));_0x4424ef(_0x3dd078);})['catch'](function(_0x1d065d){logger[_0x42c8('0x10')]('ShowServicenowAccount',_0x1d065d['message'],_0x1cfbc6);_0x3f74d7(_0x2fd6c0[_0x42c8('0x10')](0x1f4,_0x1d065d[_0x42c8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 5bca3f6..147f5aa 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 _0xb54a=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xb54a,0xe2));var _0xab54=function(_0x279ba5,_0x53770d){_0x279ba5=_0x279ba5-0x0;var _0x4c3a9d=_0xb54a[_0x279ba5];return _0x4c3a9d;};'use strict';var multer=require(_0xab54('0x0'));var util=require(_0xab54('0x1'));var path=require(_0xab54('0x2'));var timeout=require(_0xab54('0x3'));var express=require(_0xab54('0x4'));var router=express['Router']();var auth=require(_0xab54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab54('0x6'));var controller=require(_0xab54('0x7'));router[_0xab54('0x8')]('/',auth[_0xab54('0x9')](),controller[_0xab54('0xa')]);router['get'](_0xab54('0xb'),auth[_0xab54('0x9')](),controller[_0xab54('0xc')]);router[_0xab54('0x8')]('/:id/fields',auth[_0xab54('0x9')](),controller[_0xab54('0xd')]);router[_0xab54('0x8')](_0xab54('0xe'),auth[_0xab54('0x9')](),controller[_0xab54('0xf')]);router[_0xab54('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xab54('0x10')]('/',auth[_0xab54('0x9')](),controller[_0xab54('0x11')]);router[_0xab54('0x12')](_0xab54('0xb'),auth[_0xab54('0x9')](),controller[_0xab54('0x13')]);router[_0xab54('0x14')](_0xab54('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xab54('0x15')]=router; \ No newline at end of file +var _0xc47b=['/:id/fields','/:id/subjects','getDescriptions','post','create','put','update','/:id','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xc47b,0x15d));var _0xbc47=function(_0x3eb0b7,_0x4f541f){_0x3eb0b7=_0x3eb0b7-0x0;var _0x3e1d06=_0xc47b[_0x3eb0b7];return _0x3e1d06;};'use strict';var multer=require(_0xbc47('0x0'));var util=require(_0xbc47('0x1'));var path=require(_0xbc47('0x2'));var timeout=require(_0xbc47('0x3'));var express=require(_0xbc47('0x4'));var router=express['Router']();var auth=require(_0xbc47('0x5'));var interaction=require(_0xbc47('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0xbc47('0x7')]('/',auth[_0xbc47('0x8')](),controller[_0xbc47('0x9')]);router[_0xbc47('0x7')]('/:id',auth[_0xbc47('0x8')](),controller[_0xbc47('0xa')]);router[_0xbc47('0x7')](_0xbc47('0xb'),auth[_0xbc47('0x8')](),controller['getFields']);router['get'](_0xbc47('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xbc47('0xd')]);router[_0xbc47('0xe')]('/',auth[_0xbc47('0x8')](),controller[_0xbc47('0xf')]);router[_0xbc47('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbc47('0x11')]);router['delete'](_0xbc47('0x12'),auth[_0xbc47('0x8')](),controller[_0xbc47('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 828c252..4a19bfb 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 _0xd40c=['sequelize','exports','STRING'];(function(_0x5b4938,_0x4a904c){var _0x1db7ea=function(_0x145f5b){while(--_0x145f5b){_0x5b4938['push'](_0x5b4938['shift']());}};_0x1db7ea(++_0x4a904c);}(_0xd40c,0x165));var _0xcd40=function(_0x1f63a7,_0x55f853){_0x1f63a7=_0x1f63a7-0x0;var _0xaa2a9=_0xd40c[_0x1f63a7];return _0xaa2a9;};'use strict';var Sequelize=require(_0xcd40('0x0'));module[_0xcd40('0x1')]={'name':{'type':Sequelize[_0xcd40('0x2')]},'description':{'type':Sequelize[_0xcd40('0x2')]}}; \ No newline at end of file +var _0x6317=['exports','sequelize'];(function(_0x536c49,_0x1cb4e0){var _0x515604=function(_0x6c89b0){while(--_0x6c89b0){_0x536c49['push'](_0x536c49['shift']());}};_0x515604(++_0x1cb4e0);}(_0x6317,0x199));var _0x7631=function(_0x40a808,_0x346ac4){_0x40a808=_0x40a808-0x0;var _0x45a130=_0x6317[_0x40a808];return _0x45a130;};'use strict';var Sequelize=require(_0x7631('0x0'));module[_0x7631('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 05198c0..8811f56 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 _0xffd6=['key','field','options','ServicenowConfiguration','include','rows','show','params','includeAll','find','create','body','update','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type'];(function(_0x40d5f7,_0x30fa9d){var _0x15b094=function(_0x2011ff){while(--_0x2011ff){_0x40d5f7['push'](_0x40d5f7['shift']());}};_0x15b094(++_0x30fa9d);}(_0xffd6,0x1d4));var _0x6ffd=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xffd6[_0x28e74e];return _0xb45ac1;};'use strict';var pdf=require(_0x6ffd('0x0'));var emlformat=require(_0x6ffd('0x1'));var rimraf=require(_0x6ffd('0x2'));var zipdir=require(_0x6ffd('0x3'));var jsonpatch=require(_0x6ffd('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ffd('0x5'));var Mustache=require(_0x6ffd('0x6'));var util=require(_0x6ffd('0x7'));var path=require('path');var sox=require(_0x6ffd('0x8'));var csv=require('to-csv');var ejs=require(_0x6ffd('0x9'));var fs=require('fs');var _=require(_0x6ffd('0xa'));var squel=require(_0x6ffd('0xb'));var crypto=require(_0x6ffd('0xc'));var jsforce=require(_0x6ffd('0xd'));var deskjs=require(_0x6ffd('0xe'));var toCsv=require(_0x6ffd('0xf'));var querystring=require('querystring');var Papa=require(_0x6ffd('0x10'));var Redis=require('ioredis');var authService=require(_0x6ffd('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6ffd('0x12'));var logger=require(_0x6ffd('0x13'))(_0x6ffd('0x14'));var utils=require(_0x6ffd('0x15'));var config=require(_0x6ffd('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6ffd('0x17'));var client=jayson[_0x6ffd('0x18')][_0x6ffd('0x19')]({'port':0x232a});function checkPasswordPattern(_0x44eee9,_0x3ed2c9,_0x142560){if(_0x142560){var _0x2ca351=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ca351[_0x6ffd('0x1a')](_0x3ed2c9)){return _0x44eee9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x44eee9;}}function respondWithRpcPromise(_0x23a0e3,_0x150b03,_0x3a8da6,_0x3a7630){return new BPromise(function(_0x19e83c,_0x1b9c77){var _0x26eeda=_0x3a7630||client;return _0x26eeda[_0x6ffd('0x1b')](_0x23a0e3,_0x3a8da6)['then'](function(_0x286152){logger['info'](_0x6ffd('0x1c'),_0x150b03,_0x6ffd('0x1d'));logger[_0x6ffd('0x1e')](_0x6ffd('0x1f'),_0x150b03,_0x6ffd('0x1d'),JSON[_0x6ffd('0x20')](_0x286152));if(_0x286152[_0x6ffd('0x21')]){if(_0x286152[_0x6ffd('0x21')]['code']===0x1f4){logger[_0x6ffd('0x21')](_0x6ffd('0x1c'),_0x150b03,_0x286152[_0x6ffd('0x21')][_0x6ffd('0x22')]);return _0x1b9c77(_0x286152[_0x6ffd('0x21')][_0x6ffd('0x22')]);}logger[_0x6ffd('0x21')](_0x6ffd('0x1c'),_0x150b03,_0x286152['error'][_0x6ffd('0x22')]);return _0x19e83c(_0x286152[_0x6ffd('0x21')][_0x6ffd('0x22')]);}else{logger[_0x6ffd('0x23')](_0x6ffd('0x1c'),_0x150b03,_0x6ffd('0x1d'));_0x19e83c(_0x286152['result'][_0x6ffd('0x22')]);}})[_0x6ffd('0x24')](function(_0x2f89bb){logger[_0x6ffd('0x21')](_0x6ffd('0x1c'),_0x150b03,_0x2f89bb);_0x1b9c77(_0x2f89bb);});});}function respondWithStatusCode(_0x396851,_0x7a60ca){_0x7a60ca=_0x7a60ca||0xcc;return function(_0x5ebb3b){if(_0x5ebb3b){return _0x396851['sendStatus'](_0x7a60ca);}return _0x396851[_0x6ffd('0x25')](_0x7a60ca)[_0x6ffd('0x26')]();};}function respondWithResult(_0x5897c3,_0x49f3d7){_0x49f3d7=_0x49f3d7||0xc8;return function(_0x5b7e8d){if(_0x5b7e8d){return _0x5897c3[_0x6ffd('0x25')](_0x49f3d7)[_0x6ffd('0x27')](_0x5b7e8d);}};}function respondWithFilteredResult(_0x3ba263,_0x3d481d){return function(_0x54d66a){if(_0x54d66a){var _0x1480e2=_0x54d66a[_0x6ffd('0x28')],_0x3a53e2=_0x3d481d[_0x6ffd('0x29')],_0x1a3eec=_0x3d481d[_0x6ffd('0x29')]+_0x3d481d[_0x6ffd('0x2a')],_0x530ced;if(_0x1a3eec>=_0x1480e2){_0x1a3eec=_0x1480e2;_0x530ced=0xc8;}else{_0x530ced=0xce;}_0x3ba263['status'](_0x530ced);return _0x3ba263[_0x6ffd('0x2b')](_0x6ffd('0x2c'),_0x3a53e2+'-'+_0x1a3eec+'/'+_0x1480e2)[_0x6ffd('0x27')](_0x54d66a);}return null;};}function patchUpdates(_0x355894){return function(_0x25e105){try{jsonpatch['apply'](_0x25e105,_0x355894,!![]);}catch(_0x1f611b){return BPromise[_0x6ffd('0x2d')](_0x1f611b);}return _0x25e105[_0x6ffd('0x2e')]();};}function saveUpdates(_0x4cc709,_0x5eaa08){return function(_0x3a5ae4){if(_0x3a5ae4){return _0x3a5ae4['update'](_0x4cc709)['then'](function(_0x2f4ff4){return _0x2f4ff4;});}return null;};}function removeEntity(_0x229104,_0x1c6dd1){return function(_0x254863){if(_0x254863){return _0x254863[_0x6ffd('0x2f')]()[_0x6ffd('0x30')](function(){_0x229104[_0x6ffd('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45995b,_0x3b1f51){return function(_0x5854d7){if(!_0x5854d7){_0x45995b[_0x6ffd('0x31')](0x194);}return _0x5854d7;};}function handleError(_0x1629bb,_0x461d61){_0x461d61=_0x461d61||0x1f4;return function(_0x41415f){logger[_0x6ffd('0x21')](_0x41415f[_0x6ffd('0x32')]);if(_0x41415f[_0x6ffd('0x33')]){delete _0x41415f['name'];}_0x1629bb[_0x6ffd('0x25')](_0x461d61)[_0x6ffd('0x34')](_0x41415f);};}exports[_0x6ffd('0x35')]=function(_0x2346c5,_0x54c817){var _0x140791={},_0x14ff3e={},_0xd355f4={'count':0x0,'rows':[]};var _0x11ba1d=db['ServicenowConfiguration'][_0x6ffd('0x36')];_0x14ff3e[_0x6ffd('0x37')]=_[_0x6ffd('0x38')](_0x11ba1d);_0x14ff3e[_0x6ffd('0x39')]=_[_0x6ffd('0x38')](_0x2346c5[_0x6ffd('0x39')]);_0x14ff3e[_0x6ffd('0x3a')]=_[_0x6ffd('0x3b')](_0x14ff3e[_0x6ffd('0x37')],_0x14ff3e[_0x6ffd('0x39')]);_0x140791['attributes']=_['intersection'](_0x14ff3e[_0x6ffd('0x37')],qs[_0x6ffd('0x3c')](_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x3c')]));_0x140791[_0x6ffd('0x3d')]=_0x140791[_0x6ffd('0x3d')][_0x6ffd('0x3e')]?_0x140791[_0x6ffd('0x3d')]:_0x14ff3e[_0x6ffd('0x37')];if(!_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x3f')]('nolimit')){_0x140791['limit']=qs[_0x6ffd('0x2a')](_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x2a')]);_0x140791['offset']=qs[_0x6ffd('0x29')](_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x29')]);}_0x140791[_0x6ffd('0x40')]=qs[_0x6ffd('0x41')](_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x41')]);_0x140791['where']=qs[_0x6ffd('0x3a')](_[_0x6ffd('0x42')](_0x2346c5[_0x6ffd('0x39')],_0x14ff3e[_0x6ffd('0x3a')]));if(_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x43')]){_0x140791[_0x6ffd('0x44')]=_[_0x6ffd('0x45')](_0x140791[_0x6ffd('0x44')],{'$or':_[_0x6ffd('0x46')](_0x11ba1d,function(_0x17ec76){if(_0x17ec76[_0x6ffd('0x47')][_0x6ffd('0x48')]!=='VIRTUAL'){var _0xa9edf3={};_0xa9edf3[_0x17ec76[_0x6ffd('0x49')]]={'$like':'%'+_0x2346c5[_0x6ffd('0x39')][_0x6ffd('0x43')]+'%'};return _0xa9edf3;}})});}_0x140791=_[_0x6ffd('0x45')]({},_0x140791,_0x2346c5[_0x6ffd('0x4a')]);var _0x363cc4={'where':_0x140791[_0x6ffd('0x44')]};return db[_0x6ffd('0x4b')][_0x6ffd('0x28')](_0x363cc4)[_0x6ffd('0x30')](function(_0x44de1b){_0xd355f4[_0x6ffd('0x28')]=_0x44de1b;if(_0x2346c5['query']['includeAll']){_0x140791[_0x6ffd('0x4c')]=[{'all':!![]}];}return db[_0x6ffd('0x4b')]['findAll'](_0x140791);})[_0x6ffd('0x30')](function(_0x49323e){_0xd355f4[_0x6ffd('0x4d')]=_0x49323e;return _0xd355f4;})['then'](respondWithFilteredResult(_0x54c817,_0x140791))[_0x6ffd('0x24')](handleError(_0x54c817,null));};exports[_0x6ffd('0x4e')]=function(_0x4b9637,_0x4f7d48){var _0x5caaba={'raw':![],'where':{'id':_0x4b9637[_0x6ffd('0x4f')]['id']}},_0x43e700={};_0x43e700[_0x6ffd('0x37')]=_[_0x6ffd('0x38')](db[_0x6ffd('0x4b')][_0x6ffd('0x36')]);_0x43e700['query']=_['keys'](_0x4b9637['query']);_0x43e700[_0x6ffd('0x3a')]=_[_0x6ffd('0x3b')](_0x43e700[_0x6ffd('0x37')],_0x43e700[_0x6ffd('0x39')]);_0x5caaba[_0x6ffd('0x3d')]=_[_0x6ffd('0x3b')](_0x43e700[_0x6ffd('0x37')],qs[_0x6ffd('0x3c')](_0x4b9637[_0x6ffd('0x39')]['fields']));_0x5caaba[_0x6ffd('0x3d')]=_0x5caaba['attributes'][_0x6ffd('0x3e')]?_0x5caaba[_0x6ffd('0x3d')]:_0x43e700['model'];if(_0x4b9637[_0x6ffd('0x39')][_0x6ffd('0x50')]){_0x5caaba[_0x6ffd('0x4c')]=[{'all':!![]}];}_0x5caaba=_[_0x6ffd('0x45')]({},_0x5caaba,_0x4b9637['options']);return db[_0x6ffd('0x4b')][_0x6ffd('0x51')](_0x5caaba)['then'](handleEntityNotFound(_0x4f7d48,null))['then'](respondWithResult(_0x4f7d48,null))[_0x6ffd('0x24')](handleError(_0x4f7d48,null));};exports[_0x6ffd('0x52')]=function(_0x2f28aa,_0x43ce4a){return db[_0x6ffd('0x4b')][_0x6ffd('0x52')](_0x2f28aa[_0x6ffd('0x53')],{})['then'](respondWithResult(_0x43ce4a,0xc9))[_0x6ffd('0x24')](handleError(_0x43ce4a,null));};exports[_0x6ffd('0x54')]=function(_0x468589,_0x589903){if(_0x468589[_0x6ffd('0x53')]['id']){delete _0x468589[_0x6ffd('0x53')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x468589[_0x6ffd('0x4f')]['id']}})[_0x6ffd('0x30')](handleEntityNotFound(_0x589903,null))['then'](saveUpdates(_0x468589['body'],null))[_0x6ffd('0x30')](respondWithResult(_0x589903,null))[_0x6ffd('0x24')](handleError(_0x589903,null));};exports['destroy']=function(_0x1bf079,_0x2f21cb){return db[_0x6ffd('0x4b')]['find']({'where':{'id':_0x1bf079[_0x6ffd('0x4f')]['id']}})[_0x6ffd('0x30')](handleEntityNotFound(_0x2f21cb,null))[_0x6ffd('0x30')](removeEntity(_0x2f21cb,null))['catch'](handleError(_0x2f21cb,null));};exports['getFields']=function(_0x54f25e,_0xf1fec6,_0x3f204a){var _0x2074f7={};var _0x11a20b={};var _0x1d0625;var _0x4616aa;return db[_0x6ffd('0x4b')][_0x6ffd('0x55')]({'where':{'id':_0x54f25e['params']['id']}})[_0x6ffd('0x30')](handleEntityNotFound(_0xf1fec6,null))[_0x6ffd('0x30')](function(_0x47dbfd){if(_0x47dbfd){_0x1d0625=_0x47dbfd;_0x11a20b[_0x6ffd('0x37')]=_[_0x6ffd('0x38')](db[_0x6ffd('0x56')][_0x6ffd('0x36')]);_0x11a20b['query']=_['keys'](_0x54f25e[_0x6ffd('0x39')]);_0x11a20b[_0x6ffd('0x3a')]=_[_0x6ffd('0x3b')](_0x11a20b[_0x6ffd('0x37')],_0x11a20b[_0x6ffd('0x39')]);_0x2074f7[_0x6ffd('0x3d')]=_['intersection'](_0x11a20b[_0x6ffd('0x37')],qs[_0x6ffd('0x3c')](_0x54f25e[_0x6ffd('0x39')][_0x6ffd('0x3c')]));_0x2074f7['attributes']=_0x2074f7[_0x6ffd('0x3d')][_0x6ffd('0x3e')]?_0x2074f7[_0x6ffd('0x3d')]:_0x11a20b[_0x6ffd('0x37')];_0x2074f7[_0x6ffd('0x40')]=qs[_0x6ffd('0x41')](_0x54f25e[_0x6ffd('0x39')][_0x6ffd('0x41')]);_0x2074f7[_0x6ffd('0x44')]=qs[_0x6ffd('0x3a')](_[_0x6ffd('0x42')](_0x54f25e[_0x6ffd('0x39')],_0x11a20b[_0x6ffd('0x3a')]));if(_0x54f25e['query'][_0x6ffd('0x43')]){_0x2074f7[_0x6ffd('0x44')]=_[_0x6ffd('0x45')](_0x2074f7['where'],{'$or':_['map'](_0x2074f7['attributes'],function(_0x213108){var _0x18ddbc={};_0x18ddbc[_0x213108]={'$like':'%'+_0x54f25e[_0x6ffd('0x39')]['filter']+'%'};return _0x18ddbc;})});}_0x2074f7=_[_0x6ffd('0x45')]({},_0x2074f7,_0x54f25e[_0x6ffd('0x4a')]);return _0x1d0625['getFields'](_0x2074f7);}})['then'](function(_0xe11fe2){if(_0xe11fe2){_0x4616aa=_0xe11fe2[_0x6ffd('0x3e')];if(!_0x54f25e[_0x6ffd('0x39')][_0x6ffd('0x3f')](_0x6ffd('0x57'))){_0x2074f7[_0x6ffd('0x2a')]=qs[_0x6ffd('0x2a')](_0x54f25e['query']['limit']);_0x2074f7[_0x6ffd('0x29')]=qs['offset'](_0x54f25e[_0x6ffd('0x39')][_0x6ffd('0x29')]);}return _0x1d0625['getFields'](_0x2074f7);}})[_0x6ffd('0x30')](function(_0x2b5674){if(_0x2b5674){return _0x2b5674?{'count':_0x4616aa,'rows':_0x2b5674}:null;}})[_0x6ffd('0x30')](respondWithResult(_0xf1fec6,null))[_0x6ffd('0x24')](handleError(_0xf1fec6,null));};exports['getSubjects']=function(_0x43d018,_0x4fa89a,_0x551395){var _0x4e5ee8={};var _0x18c8a4={};var _0x1f8a8a;var _0x3fdb3c;return db[_0x6ffd('0x4b')][_0x6ffd('0x55')]({'where':{'id':_0x43d018['params']['id']}})['then'](handleEntityNotFound(_0x4fa89a,null))['then'](function(_0x35a249){if(_0x35a249){_0x1f8a8a=_0x35a249;_0x18c8a4[_0x6ffd('0x37')]=_[_0x6ffd('0x38')](db[_0x6ffd('0x56')]['rawAttributes']);_0x18c8a4['query']=_[_0x6ffd('0x38')](_0x43d018[_0x6ffd('0x39')]);_0x18c8a4['filters']=_[_0x6ffd('0x3b')](_0x18c8a4[_0x6ffd('0x37')],_0x18c8a4[_0x6ffd('0x39')]);_0x4e5ee8[_0x6ffd('0x3d')]=_[_0x6ffd('0x3b')](_0x18c8a4[_0x6ffd('0x37')],qs[_0x6ffd('0x3c')](_0x43d018['query']['fields']));_0x4e5ee8[_0x6ffd('0x3d')]=_0x4e5ee8[_0x6ffd('0x3d')][_0x6ffd('0x3e')]?_0x4e5ee8[_0x6ffd('0x3d')]:_0x18c8a4[_0x6ffd('0x37')];_0x4e5ee8[_0x6ffd('0x40')]=qs[_0x6ffd('0x41')](_0x43d018[_0x6ffd('0x39')]['sort']);_0x4e5ee8['where']=qs[_0x6ffd('0x3a')](_[_0x6ffd('0x42')](_0x43d018[_0x6ffd('0x39')],_0x18c8a4[_0x6ffd('0x3a')]));if(_0x43d018[_0x6ffd('0x39')][_0x6ffd('0x43')]){_0x4e5ee8[_0x6ffd('0x44')]=_[_0x6ffd('0x45')](_0x4e5ee8['where'],{'$or':_[_0x6ffd('0x46')](_0x4e5ee8['attributes'],function(_0x3ab87c){var _0x509942={};_0x509942[_0x3ab87c]={'$like':'%'+_0x43d018[_0x6ffd('0x39')][_0x6ffd('0x43')]+'%'};return _0x509942;})});}_0x4e5ee8=_['merge']({},_0x4e5ee8,_0x43d018['options']);return _0x1f8a8a[_0x6ffd('0x58')](_0x4e5ee8);}})[_0x6ffd('0x30')](function(_0x1e664e){if(_0x1e664e){_0x3fdb3c=_0x1e664e[_0x6ffd('0x3e')];if(!_0x43d018[_0x6ffd('0x39')][_0x6ffd('0x3f')](_0x6ffd('0x57'))){_0x4e5ee8[_0x6ffd('0x2a')]=qs[_0x6ffd('0x2a')](_0x43d018['query'][_0x6ffd('0x2a')]);_0x4e5ee8['offset']=qs[_0x6ffd('0x29')](_0x43d018['query'][_0x6ffd('0x29')]);}return _0x1f8a8a[_0x6ffd('0x58')](_0x4e5ee8);}})[_0x6ffd('0x30')](function(_0x5da594){if(_0x5da594){return _0x5da594?{'count':_0x3fdb3c,'rows':_0x5da594}:null;}})[_0x6ffd('0x30')](respondWithResult(_0x4fa89a,null))[_0x6ffd('0x24')](handleError(_0x4fa89a,null));};exports[_0x6ffd('0x59')]=function(_0x183a1b,_0x100f8f,_0x3a6c17){var _0x2f3935={};var _0x25546e={};var _0x2f996e;var _0x220fd7;return db[_0x6ffd('0x4b')]['findOne']({'where':{'id':_0x183a1b['params']['id']}})[_0x6ffd('0x30')](handleEntityNotFound(_0x100f8f,null))[_0x6ffd('0x30')](function(_0x5d7b94){if(_0x5d7b94){_0x2f996e=_0x5d7b94;_0x25546e[_0x6ffd('0x37')]=_[_0x6ffd('0x38')](db[_0x6ffd('0x56')]['rawAttributes']);_0x25546e[_0x6ffd('0x39')]=_[_0x6ffd('0x38')](_0x183a1b['query']);_0x25546e[_0x6ffd('0x3a')]=_['intersection'](_0x25546e[_0x6ffd('0x37')],_0x25546e[_0x6ffd('0x39')]);_0x2f3935['attributes']=_[_0x6ffd('0x3b')](_0x25546e[_0x6ffd('0x37')],qs[_0x6ffd('0x3c')](_0x183a1b[_0x6ffd('0x39')]['fields']));_0x2f3935[_0x6ffd('0x3d')]=_0x2f3935[_0x6ffd('0x3d')][_0x6ffd('0x3e')]?_0x2f3935[_0x6ffd('0x3d')]:_0x25546e[_0x6ffd('0x37')];_0x2f3935[_0x6ffd('0x40')]=qs['sort'](_0x183a1b['query'][_0x6ffd('0x41')]);_0x2f3935[_0x6ffd('0x44')]=qs[_0x6ffd('0x3a')](_[_0x6ffd('0x42')](_0x183a1b[_0x6ffd('0x39')],_0x25546e[_0x6ffd('0x3a')]));if(_0x183a1b['query']['filter']){_0x2f3935['where']=_[_0x6ffd('0x45')](_0x2f3935[_0x6ffd('0x44')],{'$or':_['map'](_0x2f3935[_0x6ffd('0x3d')],function(_0x294dac){var _0x4cc217={};_0x4cc217[_0x294dac]={'$like':'%'+_0x183a1b[_0x6ffd('0x39')][_0x6ffd('0x43')]+'%'};return _0x4cc217;})});}_0x2f3935=_[_0x6ffd('0x45')]({},_0x2f3935,_0x183a1b[_0x6ffd('0x4a')]);return _0x2f996e[_0x6ffd('0x59')](_0x2f3935);}})[_0x6ffd('0x30')](function(_0x4f6506){if(_0x4f6506){_0x220fd7=_0x4f6506['length'];if(!_0x183a1b['query']['hasOwnProperty'](_0x6ffd('0x57'))){_0x2f3935[_0x6ffd('0x2a')]=qs[_0x6ffd('0x2a')](_0x183a1b[_0x6ffd('0x39')][_0x6ffd('0x2a')]);_0x2f3935[_0x6ffd('0x29')]=qs['offset'](_0x183a1b[_0x6ffd('0x39')][_0x6ffd('0x29')]);}return _0x2f996e[_0x6ffd('0x59')](_0x2f3935);}})[_0x6ffd('0x30')](function(_0x2546f9){if(_0x2546f9){return _0x2546f9?{'count':_0x220fd7,'rows':_0x2546f9}:null;}})[_0x6ffd('0x30')](respondWithResult(_0x100f8f,null))[_0x6ffd('0x24')](handleError(_0x100f8f,null));}; \ No newline at end of file +var _0xfeff=['code','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','params','fields','includeAll','find','create','body','getFields','findOne','ServicenowField','getSubjects','hasOwnProperty','nolimit','getDescriptions','html-pdf','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ae516,_0x4b97c5){var _0x2b257a=function(_0x1aa718){while(--_0x1aa718){_0x3ae516['push'](_0x3ae516['shift']());}};_0x2b257a(++_0x4b97c5);}(_0xfeff,0xe5));var _0xffef=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xfeff[_0xc8a931];return _0x28bd27;};'use strict';var pdf=require(_0xffef('0x0'));var emlformat=require(_0xffef('0x1'));var rimraf=require(_0xffef('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffef('0x3'));var Mustache=require(_0xffef('0x4'));var util=require(_0xffef('0x5'));var path=require(_0xffef('0x6'));var sox=require(_0xffef('0x7'));var csv=require(_0xffef('0x8'));var ejs=require(_0xffef('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xffef('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xffef('0xb'));var toCsv=require(_0xffef('0x8'));var querystring=require('querystring');var Papa=require(_0xffef('0xc'));var Redis=require(_0xffef('0xd'));var authService=require(_0xffef('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xffef('0xf'));var logger=require(_0xffef('0x10'))(_0xffef('0x11'));var utils=require(_0xffef('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xffef('0x13'));var client=jayson[_0xffef('0x14')][_0xffef('0x15')]({'port':0x232a});function checkPasswordPattern(_0x553c37,_0xf78459,_0x10d083){if(_0x10d083){var _0x2b34d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b34d3['test'](_0xf78459)){return _0x553c37;}else{throw new Error(_0xffef('0x16'));}}else{return _0x553c37;}}function respondWithRpcPromise(_0x3ec520,_0x11074a,_0x170216,_0x3d4223){return new BPromise(function(_0x3f2765,_0x1ff561){var _0x1f972b=_0x3d4223||client;return _0x1f972b[_0xffef('0x17')](_0x3ec520,_0x170216)['then'](function(_0x43abce){logger[_0xffef('0x18')](_0xffef('0x19'),_0x11074a,_0xffef('0x1a'));logger['debug'](_0xffef('0x1b'),_0x11074a,_0xffef('0x1a'),JSON[_0xffef('0x1c')](_0x43abce));if(_0x43abce['error']){if(_0x43abce['error'][_0xffef('0x1d')]===0x1f4){logger[_0xffef('0x1e')](_0xffef('0x19'),_0x11074a,_0x43abce[_0xffef('0x1e')][_0xffef('0x1f')]);return _0x1ff561(_0x43abce[_0xffef('0x1e')][_0xffef('0x1f')]);}logger[_0xffef('0x1e')](_0xffef('0x19'),_0x11074a,_0x43abce[_0xffef('0x1e')][_0xffef('0x1f')]);return _0x3f2765(_0x43abce[_0xffef('0x1e')][_0xffef('0x1f')]);}else{logger[_0xffef('0x18')](_0xffef('0x19'),_0x11074a,_0xffef('0x1a'));_0x3f2765(_0x43abce[_0xffef('0x20')][_0xffef('0x1f')]);}})[_0xffef('0x21')](function(_0x3cf6e4){logger['error'](_0xffef('0x19'),_0x11074a,_0x3cf6e4);_0x1ff561(_0x3cf6e4);});});}function respondWithStatusCode(_0x49dabd,_0x3a9b21){_0x3a9b21=_0x3a9b21||0xcc;return function(_0x514f91){if(_0x514f91){return _0x49dabd[_0xffef('0x22')](_0x3a9b21);}return _0x49dabd['status'](_0x3a9b21)[_0xffef('0x23')]();};}function respondWithResult(_0x23d9fd,_0x2d7034){_0x2d7034=_0x2d7034||0xc8;return function(_0xa8d67){if(_0xa8d67){return _0x23d9fd[_0xffef('0x24')](_0x2d7034)[_0xffef('0x25')](_0xa8d67);}};}function respondWithFilteredResult(_0x3e6ba3,_0x455c24){return function(_0x5e3533){if(_0x5e3533){var _0x985603=_0x5e3533[_0xffef('0x26')],_0x32b125=_0x455c24['offset'],_0x488cad=_0x455c24[_0xffef('0x27')]+_0x455c24[_0xffef('0x28')],_0xba0d38;if(_0x488cad>=_0x985603){_0x488cad=_0x985603;_0xba0d38=0xc8;}else{_0xba0d38=0xce;}_0x3e6ba3[_0xffef('0x24')](_0xba0d38);return _0x3e6ba3[_0xffef('0x29')]('Content-Range',_0x32b125+'-'+_0x488cad+'/'+_0x985603)[_0xffef('0x25')](_0x5e3533);}return null;};}function patchUpdates(_0x427256){return function(_0xd13044){try{jsonpatch[_0xffef('0x2a')](_0xd13044,_0x427256,!![]);}catch(_0xa14a50){return BPromise['reject'](_0xa14a50);}return _0xd13044[_0xffef('0x2b')]();};}function saveUpdates(_0x2b0d8f,_0x84ed2f){return function(_0x3c6cdb){if(_0x3c6cdb){return _0x3c6cdb[_0xffef('0x2c')](_0x2b0d8f)[_0xffef('0x2d')](function(_0x3f8043){return _0x3f8043;});}return null;};}function removeEntity(_0x2050ee,_0xb86022){return function(_0x299d79){if(_0x299d79){return _0x299d79[_0xffef('0x2e')]()[_0xffef('0x2d')](function(){_0x2050ee[_0xffef('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e821f,_0x17f9a4){return function(_0x37c538){if(!_0x37c538){_0x3e821f['sendStatus'](0x194);}return _0x37c538;};}function handleError(_0x3c22bd,_0x51f9e0){_0x51f9e0=_0x51f9e0||0x1f4;return function(_0x9616b6){logger['error'](_0x9616b6['stack']);if(_0x9616b6[_0xffef('0x2f')]){delete _0x9616b6[_0xffef('0x2f')];}_0x3c22bd['status'](_0x51f9e0)[_0xffef('0x30')](_0x9616b6);};}exports[_0xffef('0x31')]=function(_0x4159c4,_0x46f5b2){var _0x2513dd={},_0x4c7045={},_0x4dc3b3={'count':0x0,'rows':[]};var _0x514f92=db[_0xffef('0x32')][_0xffef('0x33')];_0x4c7045[_0xffef('0x34')]=_[_0xffef('0x35')](_0x514f92);_0x4c7045[_0xffef('0x36')]=_[_0xffef('0x35')](_0x4159c4[_0xffef('0x36')]);_0x4c7045[_0xffef('0x37')]=_[_0xffef('0x38')](_0x4c7045[_0xffef('0x34')],_0x4c7045[_0xffef('0x36')]);_0x2513dd[_0xffef('0x39')]=_[_0xffef('0x38')](_0x4c7045[_0xffef('0x34')],qs['fields'](_0x4159c4[_0xffef('0x36')]['fields']));_0x2513dd[_0xffef('0x39')]=_0x2513dd[_0xffef('0x39')][_0xffef('0x3a')]?_0x2513dd[_0xffef('0x39')]:_0x4c7045[_0xffef('0x34')];if(!_0x4159c4[_0xffef('0x36')]['hasOwnProperty']('nolimit')){_0x2513dd[_0xffef('0x28')]=qs[_0xffef('0x28')](_0x4159c4[_0xffef('0x36')][_0xffef('0x28')]);_0x2513dd[_0xffef('0x27')]=qs[_0xffef('0x27')](_0x4159c4['query']['offset']);}_0x2513dd[_0xffef('0x3b')]=qs['sort'](_0x4159c4['query'][_0xffef('0x3c')]);_0x2513dd[_0xffef('0x3d')]=qs['filters'](_[_0xffef('0x3e')](_0x4159c4[_0xffef('0x36')],_0x4c7045['filters']));if(_0x4159c4[_0xffef('0x36')][_0xffef('0x3f')]){_0x2513dd[_0xffef('0x3d')]=_[_0xffef('0x40')](_0x2513dd[_0xffef('0x3d')],{'$or':_[_0xffef('0x41')](_0x514f92,function(_0x5f4e72){if(_0x5f4e72[_0xffef('0x42')]['key']!==_0xffef('0x43')){var _0x153ad8={};_0x153ad8[_0x5f4e72[_0xffef('0x44')]]={'$like':'%'+_0x4159c4[_0xffef('0x36')]['filter']+'%'};return _0x153ad8;}})});}_0x2513dd=_[_0xffef('0x40')]({},_0x2513dd,_0x4159c4[_0xffef('0x45')]);var _0x5da66f={'where':_0x2513dd['where']};return db[_0xffef('0x32')][_0xffef('0x26')](_0x5da66f)[_0xffef('0x2d')](function(_0x50ec66){_0x4dc3b3[_0xffef('0x26')]=_0x50ec66;if(_0x4159c4['query']['includeAll']){_0x2513dd[_0xffef('0x46')]=[{'all':!![]}];}return db[_0xffef('0x32')][_0xffef('0x47')](_0x2513dd);})['then'](function(_0x2bf055){_0x4dc3b3[_0xffef('0x48')]=_0x2bf055;return _0x4dc3b3;})[_0xffef('0x2d')](respondWithFilteredResult(_0x46f5b2,_0x2513dd))['catch'](handleError(_0x46f5b2,null));};exports['show']=function(_0x7ca679,_0x2aef64){var _0x59db3d={'raw':![],'where':{'id':_0x7ca679[_0xffef('0x49')]['id']}},_0x3c1712={};_0x3c1712[_0xffef('0x34')]=_['keys'](db[_0xffef('0x32')][_0xffef('0x33')]);_0x3c1712[_0xffef('0x36')]=_[_0xffef('0x35')](_0x7ca679[_0xffef('0x36')]);_0x3c1712[_0xffef('0x37')]=_[_0xffef('0x38')](_0x3c1712[_0xffef('0x34')],_0x3c1712['query']);_0x59db3d[_0xffef('0x39')]=_[_0xffef('0x38')](_0x3c1712['model'],qs[_0xffef('0x4a')](_0x7ca679[_0xffef('0x36')]['fields']));_0x59db3d[_0xffef('0x39')]=_0x59db3d['attributes']['length']?_0x59db3d[_0xffef('0x39')]:_0x3c1712['model'];if(_0x7ca679[_0xffef('0x36')][_0xffef('0x4b')]){_0x59db3d[_0xffef('0x46')]=[{'all':!![]}];}_0x59db3d=_[_0xffef('0x40')]({},_0x59db3d,_0x7ca679[_0xffef('0x45')]);return db[_0xffef('0x32')][_0xffef('0x4c')](_0x59db3d)[_0xffef('0x2d')](handleEntityNotFound(_0x2aef64,null))[_0xffef('0x2d')](respondWithResult(_0x2aef64,null))[_0xffef('0x21')](handleError(_0x2aef64,null));};exports[_0xffef('0x4d')]=function(_0x4c3844,_0x33f1b1){return db[_0xffef('0x32')][_0xffef('0x4d')](_0x4c3844[_0xffef('0x4e')],{})[_0xffef('0x2d')](respondWithResult(_0x33f1b1,0xc9))[_0xffef('0x21')](handleError(_0x33f1b1,null));};exports['update']=function(_0x8bf226,_0xcd2ba5){if(_0x8bf226[_0xffef('0x4e')]['id']){delete _0x8bf226[_0xffef('0x4e')]['id'];}return db[_0xffef('0x32')][_0xffef('0x4c')]({'where':{'id':_0x8bf226[_0xffef('0x49')]['id']}})['then'](handleEntityNotFound(_0xcd2ba5,null))[_0xffef('0x2d')](saveUpdates(_0x8bf226[_0xffef('0x4e')],null))['then'](respondWithResult(_0xcd2ba5,null))[_0xffef('0x21')](handleError(_0xcd2ba5,null));};exports[_0xffef('0x2e')]=function(_0x4232a4,_0x54c312){return db[_0xffef('0x32')][_0xffef('0x4c')]({'where':{'id':_0x4232a4['params']['id']}})[_0xffef('0x2d')](handleEntityNotFound(_0x54c312,null))[_0xffef('0x2d')](removeEntity(_0x54c312,null))[_0xffef('0x21')](handleError(_0x54c312,null));};exports[_0xffef('0x4f')]=function(_0x5c5958,_0x3c19dc,_0x5b5ab5){var _0x16e9e2={};var _0x7b984d={};var _0xa90051;var _0x3f0ce1;return db[_0xffef('0x32')][_0xffef('0x50')]({'where':{'id':_0x5c5958[_0xffef('0x49')]['id']}})[_0xffef('0x2d')](handleEntityNotFound(_0x3c19dc,null))[_0xffef('0x2d')](function(_0xf955cd){if(_0xf955cd){_0xa90051=_0xf955cd;_0x7b984d[_0xffef('0x34')]=_[_0xffef('0x35')](db['ServicenowField'][_0xffef('0x33')]);_0x7b984d['query']=_[_0xffef('0x35')](_0x5c5958[_0xffef('0x36')]);_0x7b984d[_0xffef('0x37')]=_[_0xffef('0x38')](_0x7b984d['model'],_0x7b984d['query']);_0x16e9e2[_0xffef('0x39')]=_['intersection'](_0x7b984d['model'],qs['fields'](_0x5c5958['query'][_0xffef('0x4a')]));_0x16e9e2[_0xffef('0x39')]=_0x16e9e2[_0xffef('0x39')][_0xffef('0x3a')]?_0x16e9e2['attributes']:_0x7b984d[_0xffef('0x34')];_0x16e9e2[_0xffef('0x3b')]=qs[_0xffef('0x3c')](_0x5c5958['query'][_0xffef('0x3c')]);_0x16e9e2[_0xffef('0x3d')]=qs[_0xffef('0x37')](_[_0xffef('0x3e')](_0x5c5958[_0xffef('0x36')],_0x7b984d['filters']));if(_0x5c5958['query'][_0xffef('0x3f')]){_0x16e9e2[_0xffef('0x3d')]=_[_0xffef('0x40')](_0x16e9e2['where'],{'$or':_['map'](_0x16e9e2[_0xffef('0x39')],function(_0x1473f1){var _0x298784={};_0x298784[_0x1473f1]={'$like':'%'+_0x5c5958['query'][_0xffef('0x3f')]+'%'};return _0x298784;})});}_0x16e9e2=_[_0xffef('0x40')]({},_0x16e9e2,_0x5c5958[_0xffef('0x45')]);return _0xa90051[_0xffef('0x4f')](_0x16e9e2);}})[_0xffef('0x2d')](function(_0x15dd8c){if(_0x15dd8c){_0x3f0ce1=_0x15dd8c['length'];if(!_0x5c5958[_0xffef('0x36')]['hasOwnProperty']('nolimit')){_0x16e9e2[_0xffef('0x28')]=qs[_0xffef('0x28')](_0x5c5958[_0xffef('0x36')][_0xffef('0x28')]);_0x16e9e2[_0xffef('0x27')]=qs[_0xffef('0x27')](_0x5c5958[_0xffef('0x36')]['offset']);}return _0xa90051[_0xffef('0x4f')](_0x16e9e2);}})[_0xffef('0x2d')](function(_0x390c6e){if(_0x390c6e){return _0x390c6e?{'count':_0x3f0ce1,'rows':_0x390c6e}:null;}})['then'](respondWithResult(_0x3c19dc,null))[_0xffef('0x21')](handleError(_0x3c19dc,null));};exports['getSubjects']=function(_0x4f2dab,_0x4e508a,_0x1a6fe5){var _0xbae197={};var _0x3c43ad={};var _0x40703b;var _0x1f5ef9;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4f2dab['params']['id']}})[_0xffef('0x2d')](handleEntityNotFound(_0x4e508a,null))[_0xffef('0x2d')](function(_0x24e2d3){if(_0x24e2d3){_0x40703b=_0x24e2d3;_0x3c43ad['model']=_[_0xffef('0x35')](db[_0xffef('0x51')]['rawAttributes']);_0x3c43ad[_0xffef('0x36')]=_[_0xffef('0x35')](_0x4f2dab[_0xffef('0x36')]);_0x3c43ad['filters']=_['intersection'](_0x3c43ad[_0xffef('0x34')],_0x3c43ad[_0xffef('0x36')]);_0xbae197[_0xffef('0x39')]=_['intersection'](_0x3c43ad[_0xffef('0x34')],qs[_0xffef('0x4a')](_0x4f2dab['query']['fields']));_0xbae197['attributes']=_0xbae197[_0xffef('0x39')][_0xffef('0x3a')]?_0xbae197[_0xffef('0x39')]:_0x3c43ad[_0xffef('0x34')];_0xbae197['order']=qs[_0xffef('0x3c')](_0x4f2dab['query'][_0xffef('0x3c')]);_0xbae197[_0xffef('0x3d')]=qs[_0xffef('0x37')](_['pick'](_0x4f2dab['query'],_0x3c43ad[_0xffef('0x37')]));if(_0x4f2dab['query'][_0xffef('0x3f')]){_0xbae197[_0xffef('0x3d')]=_[_0xffef('0x40')](_0xbae197['where'],{'$or':_[_0xffef('0x41')](_0xbae197[_0xffef('0x39')],function(_0x2faa65){var _0x42412b={};_0x42412b[_0x2faa65]={'$like':'%'+_0x4f2dab[_0xffef('0x36')]['filter']+'%'};return _0x42412b;})});}_0xbae197=_['merge']({},_0xbae197,_0x4f2dab[_0xffef('0x45')]);return _0x40703b[_0xffef('0x52')](_0xbae197);}})[_0xffef('0x2d')](function(_0x1febfc){if(_0x1febfc){_0x1f5ef9=_0x1febfc[_0xffef('0x3a')];if(!_0x4f2dab['query'][_0xffef('0x53')](_0xffef('0x54'))){_0xbae197[_0xffef('0x28')]=qs[_0xffef('0x28')](_0x4f2dab[_0xffef('0x36')][_0xffef('0x28')]);_0xbae197[_0xffef('0x27')]=qs[_0xffef('0x27')](_0x4f2dab[_0xffef('0x36')][_0xffef('0x27')]);}return _0x40703b['getSubjects'](_0xbae197);}})[_0xffef('0x2d')](function(_0xf065bf){if(_0xf065bf){return _0xf065bf?{'count':_0x1f5ef9,'rows':_0xf065bf}:null;}})['then'](respondWithResult(_0x4e508a,null))[_0xffef('0x21')](handleError(_0x4e508a,null));};exports[_0xffef('0x55')]=function(_0x7e8a6e,_0x59b9ca,_0x133517){var _0x1d98fb={};var _0x54d47f={};var _0x541888;var _0x5a2bb3;return db[_0xffef('0x32')][_0xffef('0x50')]({'where':{'id':_0x7e8a6e[_0xffef('0x49')]['id']}})[_0xffef('0x2d')](handleEntityNotFound(_0x59b9ca,null))[_0xffef('0x2d')](function(_0x43ba81){if(_0x43ba81){_0x541888=_0x43ba81;_0x54d47f[_0xffef('0x34')]=_['keys'](db[_0xffef('0x51')][_0xffef('0x33')]);_0x54d47f['query']=_[_0xffef('0x35')](_0x7e8a6e[_0xffef('0x36')]);_0x54d47f[_0xffef('0x37')]=_[_0xffef('0x38')](_0x54d47f[_0xffef('0x34')],_0x54d47f[_0xffef('0x36')]);_0x1d98fb[_0xffef('0x39')]=_['intersection'](_0x54d47f['model'],qs[_0xffef('0x4a')](_0x7e8a6e[_0xffef('0x36')]['fields']));_0x1d98fb[_0xffef('0x39')]=_0x1d98fb['attributes'][_0xffef('0x3a')]?_0x1d98fb[_0xffef('0x39')]:_0x54d47f['model'];_0x1d98fb[_0xffef('0x3b')]=qs['sort'](_0x7e8a6e['query']['sort']);_0x1d98fb[_0xffef('0x3d')]=qs[_0xffef('0x37')](_[_0xffef('0x3e')](_0x7e8a6e[_0xffef('0x36')],_0x54d47f[_0xffef('0x37')]));if(_0x7e8a6e['query'][_0xffef('0x3f')]){_0x1d98fb[_0xffef('0x3d')]=_[_0xffef('0x40')](_0x1d98fb[_0xffef('0x3d')],{'$or':_[_0xffef('0x41')](_0x1d98fb[_0xffef('0x39')],function(_0x29f546){var _0x3fefef={};_0x3fefef[_0x29f546]={'$like':'%'+_0x7e8a6e[_0xffef('0x36')][_0xffef('0x3f')]+'%'};return _0x3fefef;})});}_0x1d98fb=_[_0xffef('0x40')]({},_0x1d98fb,_0x7e8a6e[_0xffef('0x45')]);return _0x541888[_0xffef('0x55')](_0x1d98fb);}})['then'](function(_0x4f0842){if(_0x4f0842){_0x5a2bb3=_0x4f0842[_0xffef('0x3a')];if(!_0x7e8a6e[_0xffef('0x36')][_0xffef('0x53')](_0xffef('0x54'))){_0x1d98fb[_0xffef('0x28')]=qs[_0xffef('0x28')](_0x7e8a6e['query'][_0xffef('0x28')]);_0x1d98fb['offset']=qs[_0xffef('0x27')](_0x7e8a6e[_0xffef('0x36')][_0xffef('0x27')]);}return _0x541888[_0xffef('0x55')](_0x1d98fb);}})[_0xffef('0x2d')](function(_0x3b50dd){if(_0x3b50dd){return _0x3b50dd?{'count':_0x5a2bb3,'rows':_0x3b50dd}:null;}})[_0xffef('0x2d')](respondWithResult(_0x59b9ca,null))['catch'](handleError(_0x59b9ca,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e1a0cf2..4988527 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 _0x3963=['define','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','./intServicenowConfiguration.attributes','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3963,0x12e));var _0x3396=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x3963[_0x44039a];return _0x525de5;};'use strict';var _=require(_0x3396('0x0'));var util=require(_0x3396('0x1'));var logger=require(_0x3396('0x2'))('api');var moment=require(_0x3396('0x3'));var BPromise=require(_0x3396('0x4'));var rp=require(_0x3396('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3396('0x6'));module[_0x3396('0x7')]=function(_0x52ee51,_0x2caca6){return _0x52ee51[_0x3396('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x3396('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2da8=['../../config/environment','exports','define','ServicenowConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2da8,0x1d2));var _0x82da=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2da8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x82da('0x0'));var util=require(_0x82da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82da('0x2'));var BPromise=require(_0x82da('0x3'));var rp=require(_0x82da('0x4'));var fs=require('fs');var path=require(_0x82da('0x5'));var rimraf=require(_0x82da('0x6'));var config=require(_0x82da('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x82da('0x8')]=function(_0x2f9c26,_0x15fce8){return _0x2f9c26[_0x82da('0x9')](_0x82da('0xa'),attributes,{'tableName':'int_servicenow_configurations','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 2d849e9..3bb4d03 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 _0xb12d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0xc70436,_0x593fcd){var _0x51cd6e=function(_0x1cf79b){while(--_0x1cf79b){_0xc70436['push'](_0xc70436['shift']());}};_0x51cd6e(++_0x593fcd);}(_0xb12d,0x1b3));var _0xdb12=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xb12d[_0xe4d6c6];return _0x3a8935;};'use strict';var _=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var moment=require(_0xdb12('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb12('0x3'));var fs=require('fs');var Redis=require(_0xdb12('0x4'));var db=require(_0xdb12('0x5'))['db'];var utils=require(_0xdb12('0x6'));var logger=require('../../config/logger')(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson[_0xdb12('0xa')][_0xdb12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da571,_0x2824fe,_0x32196f){return new BPromise(function(_0x2293e8,_0x154be1){return client[_0xdb12('0xc')](_0x4da571,_0x32196f)['then'](function(_0x12fdf1){logger[_0xdb12('0xd')](_0xdb12('0xe'),_0x2824fe,_0xdb12('0xf'));logger[_0xdb12('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2824fe,_0xdb12('0xf'),JSON[_0xdb12('0x11')](_0x12fdf1));if(_0x12fdf1[_0xdb12('0x12')]){if(_0x12fdf1['error'][_0xdb12('0x13')]===0x1f4){logger['error'](_0xdb12('0xe'),_0x2824fe,_0x12fdf1[_0xdb12('0x12')][_0xdb12('0x14')]);return _0x154be1(_0x12fdf1[_0xdb12('0x12')][_0xdb12('0x14')]);}logger[_0xdb12('0x12')](_0xdb12('0xe'),_0x2824fe,_0x12fdf1['error'][_0xdb12('0x14')]);return _0x2293e8(_0x12fdf1['error'][_0xdb12('0x14')]);}else{logger[_0xdb12('0xd')](_0xdb12('0xe'),_0x2824fe,_0xdb12('0xf'));_0x2293e8(_0x12fdf1[_0xdb12('0x15')][_0xdb12('0x14')]);}})['catch'](function(_0x40aea3){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2824fe,_0x40aea3);_0x154be1(_0x40aea3);});});} \ No newline at end of file +var _0x7df7=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4105bb,_0x1469c3){var _0x2dd50c=function(_0x3643b7){while(--_0x3643b7){_0x4105bb['push'](_0x4105bb['shift']());}};_0x2dd50c(++_0x1469c3);}(_0x7df7,0xac));var _0x77df=function(_0x34c8af,_0x17630b){_0x34c8af=_0x34c8af-0x0;var _0x5cb585=_0x7df7[_0x34c8af];return _0x5cb585;};'use strict';var _=require(_0x77df('0x0'));var util=require(_0x77df('0x1'));var moment=require(_0x77df('0x2'));var BPromise=require(_0x77df('0x3'));var rs=require(_0x77df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77df('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77df('0x6'))(_0x77df('0x7'));var config=require('../../config/environment');var jayson=require(_0x77df('0x8'));var client=jayson[_0x77df('0x9')][_0x77df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x409c6f,_0x3c7a44,_0x327a61){return new BPromise(function(_0x4b4c09,_0x28cf10){return client[_0x77df('0xb')](_0x409c6f,_0x327a61)[_0x77df('0xc')](function(_0x19aa9f){logger[_0x77df('0xd')](_0x77df('0xe'),_0x3c7a44,'request\x20sent');logger[_0x77df('0xf')](_0x77df('0x10'),_0x3c7a44,'request\x20sent',JSON[_0x77df('0x11')](_0x19aa9f));if(_0x19aa9f[_0x77df('0x12')]){if(_0x19aa9f[_0x77df('0x12')][_0x77df('0x13')]===0x1f4){logger[_0x77df('0x12')](_0x77df('0xe'),_0x3c7a44,_0x19aa9f[_0x77df('0x12')][_0x77df('0x14')]);return _0x28cf10(_0x19aa9f[_0x77df('0x12')]['message']);}logger[_0x77df('0x12')](_0x77df('0xe'),_0x3c7a44,_0x19aa9f['error'][_0x77df('0x14')]);return _0x4b4c09(_0x19aa9f[_0x77df('0x12')][_0x77df('0x14')]);}else{logger[_0x77df('0xd')](_0x77df('0xe'),_0x3c7a44,'request\x20sent');_0x4b4c09(_0x19aa9f['result'][_0x77df('0x14')]);}})['catch'](function(_0x263dc5){logger['error'](_0x77df('0xe'),_0x3c7a44,_0x263dc5);_0x28cf10(_0x263dc5);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 26eff71..5a48343 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 _0xb0d1=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post'];(function(_0x56973c,_0x2c9a63){var _0x19cb6d=function(_0x55cf2d){while(--_0x55cf2d){_0x56973c['push'](_0x56973c['shift']());}};_0x19cb6d(++_0x2c9a63);}(_0xb0d1,0x19d));var _0x1b0d=function(_0x2edcd3,_0x45a348){_0x2edcd3=_0x2edcd3-0x0;var _0x1018b4=_0xb0d1[_0x2edcd3];return _0x1018b4;};'use strict';var multer=require(_0x1b0d('0x0'));var util=require(_0x1b0d('0x1'));var path=require(_0x1b0d('0x2'));var timeout=require(_0x1b0d('0x3'));var express=require(_0x1b0d('0x4'));var router=express['Router']();var auth=require(_0x1b0d('0x5'));var interaction=require(_0x1b0d('0x6'));var config=require(_0x1b0d('0x7'));var controller=require('./intServicenowField.controller');router[_0x1b0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b0d('0x8')](_0x1b0d('0x9'),auth[_0x1b0d('0xa')](),controller['show']);router[_0x1b0d('0xb')]('/',auth[_0x1b0d('0xa')](),controller[_0x1b0d('0xc')]);router[_0x1b0d('0xd')](_0x1b0d('0x9'),auth[_0x1b0d('0xa')](),controller['update']);router[_0x1b0d('0xe')](_0x1b0d('0x9'),auth[_0x1b0d('0xa')](),controller[_0x1b0d('0xf')]);module[_0x1b0d('0x10')]=router; \ No newline at end of file +var _0x5c94=['show','post','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x494c26,_0x40255a){var _0x51b3b5=function(_0x35e0c1){while(--_0x35e0c1){_0x494c26['push'](_0x494c26['shift']());}};_0x51b3b5(++_0x40255a);}(_0x5c94,0x126));var _0x45c9=function(_0x16f455,_0xe77ae){_0x16f455=_0x16f455-0x0;var _0x16dbfd=_0x5c94[_0x16f455];return _0x16dbfd;};'use strict';var multer=require('multer');var util=require(_0x45c9('0x0'));var path=require(_0x45c9('0x1'));var timeout=require(_0x45c9('0x2'));var express=require(_0x45c9('0x3'));var router=express[_0x45c9('0x4')]();var auth=require(_0x45c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x45c9('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x45c9('0x7')](),controller[_0x45c9('0x8')]);router['get'](_0x45c9('0x9'),auth['isAuthenticated'](),controller[_0x45c9('0xa')]);router[_0x45c9('0xb')]('/',auth[_0x45c9('0x7')](),controller['create']);router[_0x45c9('0xc')]('/:id',auth[_0x45c9('0x7')](),controller[_0x45c9('0xd')]);router[_0x45c9('0xe')](_0x45c9('0x9'),auth[_0x45c9('0x7')](),controller['destroy']);module[_0x45c9('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 13432ac..e83908b 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 _0xa74f=['keyValue','string','STRING','BOOLEAN','ENUM','customVariable'];(function(_0x588227,_0x33f6c0){var _0x5acede=function(_0x4d68b3){while(--_0x4d68b3){_0x588227['push'](_0x588227['shift']());}};_0x5acede(++_0x33f6c0);}(_0xa74f,0x9a));var _0xfa74=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xa74f[_0x452968];return _0xb6f9ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'),_0xfa74('0x2')),'defaultValue':_0xfa74('0x3')},'content':{'type':Sequelize[_0xfa74('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfa74('0x0')]('string','variable',_0xfa74('0x1'))},'keyContent':{'type':Sequelize[_0xfa74('0x4')]},'idField':{'type':Sequelize[_0xfa74('0x4')]},'nameField':{'type':Sequelize[_0xfa74('0x4')]},'customField':{'type':Sequelize[_0xfa74('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa74('0x4')]}}; \ No newline at end of file +var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x38d33b,_0x5ab09d){var _0x3a18e9=function(_0x12b8cb){while(--_0x12b8cb){_0x38d33b['push'](_0x38d33b['shift']());}};_0x3a18e9(++_0x5ab09d);}(_0x750a,0x140));var _0xa750=function(_0x219c94,_0x804879){_0x219c94=_0x219c94-0x0;var _0x15c0a0=_0x750a[_0x219c94];return _0x15c0a0;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c2c19f3..cba1715 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 _0x2842=['sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','ServicenowField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x2f38ae,_0xef2739){var _0x170b7c=function(_0x4e439b){while(--_0x4e439b){_0x2f38ae['push'](_0x2f38ae['shift']());}};_0x170b7c(++_0xef2739);}(_0x2842,0x1ba));var _0x2284=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2842[_0x1035c1];return _0x308d67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2284('0x0'));var rimraf=require(_0x2284('0x1'));var zipdir=require(_0x2284('0x2'));var jsonpatch=require(_0x2284('0x3'));var rp=require(_0x2284('0x4'));var moment=require('moment');var BPromise=require(_0x2284('0x5'));var Mustache=require(_0x2284('0x6'));var util=require('util');var path=require(_0x2284('0x7'));var sox=require(_0x2284('0x8'));var csv=require(_0x2284('0x9'));var ejs=require(_0x2284('0xa'));var fs=require('fs');var _=require(_0x2284('0xb'));var squel=require(_0x2284('0xc'));var crypto=require('crypto');var jsforce=require(_0x2284('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2284('0x9'));var querystring=require(_0x2284('0xe'));var Papa=require(_0x2284('0xf'));var Redis=require('ioredis');var authService=require(_0x2284('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2284('0x11'));var logger=require(_0x2284('0x12'))(_0x2284('0x13'));var utils=require(_0x2284('0x14'));var config=require(_0x2284('0x15'));var db=require(_0x2284('0x16'))['db'];function respondWithStatusCode(_0xcdbe21,_0x57b9f1){_0x57b9f1=_0x57b9f1||0xcc;return function(_0x3523ef){if(_0x3523ef){return _0xcdbe21['sendStatus'](_0x57b9f1);}return _0xcdbe21[_0x2284('0x17')](_0x57b9f1)[_0x2284('0x18')]();};}function respondWithResult(_0x419d51,_0x39a510){_0x39a510=_0x39a510||0xc8;return function(_0x56b45b){if(_0x56b45b){return _0x419d51[_0x2284('0x17')](_0x39a510)[_0x2284('0x19')](_0x56b45b);}};}function respondWithFilteredResult(_0x59bad7,_0x41de4c){return function(_0x5cb2a7){if(_0x5cb2a7){var _0x4e09ba=_0x5cb2a7[_0x2284('0x1a')],_0x390719=_0x41de4c[_0x2284('0x1b')],_0x18b7a0=_0x41de4c['offset']+_0x41de4c[_0x2284('0x1c')],_0x46dfe2;if(_0x18b7a0>=_0x4e09ba){_0x18b7a0=_0x4e09ba;_0x46dfe2=0xc8;}else{_0x46dfe2=0xce;}_0x59bad7[_0x2284('0x17')](_0x46dfe2);return _0x59bad7[_0x2284('0x1d')]('Content-Range',_0x390719+'-'+_0x18b7a0+'/'+_0x4e09ba)[_0x2284('0x19')](_0x5cb2a7);}return null;};}function patchUpdates(_0x1108c3){return function(_0x177530){try{jsonpatch[_0x2284('0x1e')](_0x177530,_0x1108c3,!![]);}catch(_0x499a9a){return BPromise[_0x2284('0x1f')](_0x499a9a);}return _0x177530[_0x2284('0x20')]();};}function saveUpdates(_0x48c319,_0x823e25){return function(_0x55733f){if(_0x55733f){return _0x55733f[_0x2284('0x21')](_0x48c319)['then'](function(_0x34f1d4){return _0x34f1d4;});}return null;};}function removeEntity(_0x5d35ef,_0x36b6bc){return function(_0x132b87){if(_0x132b87){return _0x132b87[_0x2284('0x22')]()[_0x2284('0x23')](function(){_0x5d35ef[_0x2284('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8f59,_0x43b99d){return function(_0x173303){if(!_0x173303){_0x3e8f59[_0x2284('0x24')](0x194);}return _0x173303;};}function handleError(_0x470002,_0x4fb08b){_0x4fb08b=_0x4fb08b||0x1f4;return function(_0x23e6f8){logger[_0x2284('0x25')](_0x23e6f8[_0x2284('0x26')]);if(_0x23e6f8[_0x2284('0x27')]){delete _0x23e6f8[_0x2284('0x27')];}_0x470002[_0x2284('0x17')](_0x4fb08b)[_0x2284('0x28')](_0x23e6f8);};}exports[_0x2284('0x29')]=function(_0x3aa78d,_0x5852c2){var _0x3b5f00={},_0x54c29c={},_0x36b42a={'count':0x0,'rows':[]};var _0x11049c=db[_0x2284('0x2a')][_0x2284('0x2b')];_0x54c29c['model']=_[_0x2284('0x2c')](_0x11049c);_0x54c29c[_0x2284('0x2d')]=_['keys'](_0x3aa78d[_0x2284('0x2d')]);_0x54c29c[_0x2284('0x2e')]=_[_0x2284('0x2f')](_0x54c29c[_0x2284('0x30')],_0x54c29c['query']);_0x3b5f00[_0x2284('0x31')]=_[_0x2284('0x2f')](_0x54c29c[_0x2284('0x30')],qs[_0x2284('0x32')](_0x3aa78d[_0x2284('0x2d')]['fields']));_0x3b5f00[_0x2284('0x31')]=_0x3b5f00[_0x2284('0x31')][_0x2284('0x33')]?_0x3b5f00[_0x2284('0x31')]:_0x54c29c[_0x2284('0x30')];if(!_0x3aa78d[_0x2284('0x2d')][_0x2284('0x34')](_0x2284('0x35'))){_0x3b5f00[_0x2284('0x1c')]=qs[_0x2284('0x1c')](_0x3aa78d['query'][_0x2284('0x1c')]);_0x3b5f00['offset']=qs[_0x2284('0x1b')](_0x3aa78d['query'][_0x2284('0x1b')]);}_0x3b5f00[_0x2284('0x36')]=qs[_0x2284('0x37')](_0x3aa78d[_0x2284('0x2d')][_0x2284('0x37')]);_0x3b5f00[_0x2284('0x38')]=qs[_0x2284('0x2e')](_[_0x2284('0x39')](_0x3aa78d[_0x2284('0x2d')],_0x54c29c[_0x2284('0x2e')]));if(_0x3aa78d[_0x2284('0x2d')][_0x2284('0x3a')]){_0x3b5f00[_0x2284('0x38')]=_[_0x2284('0x3b')](_0x3b5f00['where'],{'$or':_[_0x2284('0x3c')](_0x11049c,function(_0x319acf){if(_0x319acf['type'][_0x2284('0x3d')]!==_0x2284('0x3e')){var _0x5a7b4e={};_0x5a7b4e[_0x319acf[_0x2284('0x3f')]]={'$like':'%'+_0x3aa78d[_0x2284('0x2d')][_0x2284('0x3a')]+'%'};return _0x5a7b4e;}})});}_0x3b5f00=_['merge']({},_0x3b5f00,_0x3aa78d[_0x2284('0x40')]);var _0x1c7df2={'where':_0x3b5f00[_0x2284('0x38')]};return db[_0x2284('0x2a')][_0x2284('0x1a')](_0x1c7df2)[_0x2284('0x23')](function(_0x419e8f){_0x36b42a[_0x2284('0x1a')]=_0x419e8f;if(_0x3aa78d[_0x2284('0x2d')][_0x2284('0x41')]){_0x3b5f00[_0x2284('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0x2284('0x43')](_0x3b5f00);})['then'](function(_0x475bf9){_0x36b42a[_0x2284('0x44')]=_0x475bf9;return _0x36b42a;})[_0x2284('0x23')](respondWithFilteredResult(_0x5852c2,_0x3b5f00))['catch'](handleError(_0x5852c2,null));};exports[_0x2284('0x45')]=function(_0x542dd2,_0x8c52e){var _0x2208fc={'raw':!![],'where':{'id':_0x542dd2[_0x2284('0x46')]['id']}},_0x5972fc={};_0x5972fc['model']=_['keys'](db[_0x2284('0x2a')][_0x2284('0x2b')]);_0x5972fc[_0x2284('0x2d')]=_[_0x2284('0x2c')](_0x542dd2[_0x2284('0x2d')]);_0x5972fc['filters']=_['intersection'](_0x5972fc[_0x2284('0x30')],_0x5972fc[_0x2284('0x2d')]);_0x2208fc[_0x2284('0x31')]=_[_0x2284('0x2f')](_0x5972fc[_0x2284('0x30')],qs[_0x2284('0x32')](_0x542dd2[_0x2284('0x2d')][_0x2284('0x32')]));_0x2208fc['attributes']=_0x2208fc[_0x2284('0x31')]['length']?_0x2208fc[_0x2284('0x31')]:_0x5972fc[_0x2284('0x30')];if(_0x542dd2[_0x2284('0x2d')][_0x2284('0x41')]){_0x2208fc[_0x2284('0x42')]=[{'all':!![]}];}_0x2208fc=_[_0x2284('0x3b')]({},_0x2208fc,_0x542dd2['options']);return db[_0x2284('0x2a')]['find'](_0x2208fc)[_0x2284('0x23')](handleEntityNotFound(_0x8c52e,null))[_0x2284('0x23')](respondWithResult(_0x8c52e,null))[_0x2284('0x47')](handleError(_0x8c52e,null));};exports[_0x2284('0x48')]=function(_0x4bca0c,_0x27d994){return db[_0x2284('0x2a')][_0x2284('0x48')](_0x4bca0c['body'],{})[_0x2284('0x23')](respondWithResult(_0x27d994,0xc9))[_0x2284('0x47')](handleError(_0x27d994,null));};exports['update']=function(_0x1b3ae3,_0x5799e4){if(_0x1b3ae3[_0x2284('0x49')]['id']){delete _0x1b3ae3['body']['id'];}return db[_0x2284('0x2a')]['find']({'where':{'id':_0x1b3ae3[_0x2284('0x46')]['id']}})[_0x2284('0x23')](handleEntityNotFound(_0x5799e4,null))['then'](saveUpdates(_0x1b3ae3[_0x2284('0x49')],null))['then'](respondWithResult(_0x5799e4,null))['catch'](handleError(_0x5799e4,null));};exports[_0x2284('0x22')]=function(_0x59fbb6,_0x5178cb){return db[_0x2284('0x2a')][_0x2284('0x4a')]({'where':{'id':_0x59fbb6[_0x2284('0x46')]['id']}})[_0x2284('0x23')](handleEntityNotFound(_0x5178cb,null))[_0x2284('0x23')](removeEntity(_0x5178cb,null))['catch'](handleError(_0x5178cb,null));}; \ No newline at end of file +var _0x2558=['limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','ServicenowField','count','includeAll','include','findAll','rows','length','options','find','catch','create','body','params','eml-format','request-promise','moment','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset'];(function(_0x439f45,_0x542c73){var _0x6aa2e3=function(_0xc3474){while(--_0xc3474){_0x439f45['push'](_0x439f45['shift']());}};_0x6aa2e3(++_0x542c73);}(_0x2558,0xf2));var _0x8255=function(_0x5e2c5e,_0x6717d4){_0x5e2c5e=_0x5e2c5e-0x0;var _0x2396a0=_0x2558[_0x5e2c5e];return _0x2396a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8255('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8255('0x1'));var moment=require(_0x8255('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8255('0x3'));var path=require('path');var sox=require(_0x8255('0x4'));var csv=require('to-csv');var ejs=require(_0x8255('0x5'));var fs=require('fs');var _=require(_0x8255('0x6'));var squel=require(_0x8255('0x7'));var crypto=require(_0x8255('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x8255('0x9'));var toCsv=require('to-csv');var querystring=require(_0x8255('0xa'));var Papa=require(_0x8255('0xb'));var Redis=require(_0x8255('0xc'));var authService=require(_0x8255('0xd'));var qs=require(_0x8255('0xe'));var hardwareService=require(_0x8255('0xf'));var logger=require(_0x8255('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8255('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3472cc,_0x29d2e1){_0x29d2e1=_0x29d2e1||0xcc;return function(_0x4cff60){if(_0x4cff60){return _0x3472cc[_0x8255('0x12')](_0x29d2e1);}return _0x3472cc[_0x8255('0x13')](_0x29d2e1)['end']();};}function respondWithResult(_0x3c9f3d,_0x47579e){_0x47579e=_0x47579e||0xc8;return function(_0x560c2c){if(_0x560c2c){return _0x3c9f3d[_0x8255('0x13')](_0x47579e)[_0x8255('0x14')](_0x560c2c);}};}function respondWithFilteredResult(_0x493a2a,_0x3b30af){return function(_0x50a53e){if(_0x50a53e){var _0x3397f7=_0x50a53e['count'],_0x22f484=_0x3b30af[_0x8255('0x15')],_0x465d61=_0x3b30af[_0x8255('0x15')]+_0x3b30af[_0x8255('0x16')],_0x21d34d;if(_0x465d61>=_0x3397f7){_0x465d61=_0x3397f7;_0x21d34d=0xc8;}else{_0x21d34d=0xce;}_0x493a2a[_0x8255('0x13')](_0x21d34d);return _0x493a2a[_0x8255('0x17')](_0x8255('0x18'),_0x22f484+'-'+_0x465d61+'/'+_0x3397f7)[_0x8255('0x14')](_0x50a53e);}return null;};}function patchUpdates(_0x51d0e8){return function(_0x4377b9){try{jsonpatch[_0x8255('0x19')](_0x4377b9,_0x51d0e8,!![]);}catch(_0x58f200){return BPromise[_0x8255('0x1a')](_0x58f200);}return _0x4377b9[_0x8255('0x1b')]();};}function saveUpdates(_0x53b597,_0x2202d6){return function(_0x25f391){if(_0x25f391){return _0x25f391[_0x8255('0x1c')](_0x53b597)[_0x8255('0x1d')](function(_0x46e61c){return _0x46e61c;});}return null;};}function removeEntity(_0x2f3a8d,_0x119d5a){return function(_0x201200){if(_0x201200){return _0x201200[_0x8255('0x1e')]()[_0x8255('0x1d')](function(){_0x2f3a8d[_0x8255('0x13')](0xcc)[_0x8255('0x1f')]();});}};}function handleEntityNotFound(_0x5eb679,_0x5f33c4){return function(_0x18697b){if(!_0x18697b){_0x5eb679[_0x8255('0x12')](0x194);}return _0x18697b;};}function handleError(_0x55bc54,_0x41aa99){_0x41aa99=_0x41aa99||0x1f4;return function(_0x4de5ca){logger['error'](_0x4de5ca[_0x8255('0x20')]);if(_0x4de5ca[_0x8255('0x21')]){delete _0x4de5ca[_0x8255('0x21')];}_0x55bc54[_0x8255('0x13')](_0x41aa99)['send'](_0x4de5ca);};}exports['index']=function(_0x396fef,_0x3a419c){var _0x47557={},_0x26d841={},_0x120eaf={'count':0x0,'rows':[]};var _0x322808=db['ServicenowField'][_0x8255('0x22')];_0x26d841[_0x8255('0x23')]=_[_0x8255('0x24')](_0x322808);_0x26d841['query']=_['keys'](_0x396fef[_0x8255('0x25')]);_0x26d841[_0x8255('0x26')]=_['intersection'](_0x26d841['model'],_0x26d841['query']);_0x47557[_0x8255('0x27')]=_[_0x8255('0x28')](_0x26d841['model'],qs[_0x8255('0x29')](_0x396fef[_0x8255('0x25')][_0x8255('0x29')]));_0x47557[_0x8255('0x27')]=_0x47557[_0x8255('0x27')]['length']?_0x47557[_0x8255('0x27')]:_0x26d841[_0x8255('0x23')];if(!_0x396fef[_0x8255('0x25')]['hasOwnProperty'](_0x8255('0x2a'))){_0x47557[_0x8255('0x16')]=qs[_0x8255('0x16')](_0x396fef[_0x8255('0x25')][_0x8255('0x16')]);_0x47557[_0x8255('0x15')]=qs['offset'](_0x396fef['query'][_0x8255('0x15')]);}_0x47557[_0x8255('0x2b')]=qs['sort'](_0x396fef[_0x8255('0x25')][_0x8255('0x2c')]);_0x47557[_0x8255('0x2d')]=qs[_0x8255('0x26')](_[_0x8255('0x2e')](_0x396fef['query'],_0x26d841[_0x8255('0x26')]));if(_0x396fef[_0x8255('0x25')][_0x8255('0x2f')]){_0x47557[_0x8255('0x2d')]=_[_0x8255('0x30')](_0x47557[_0x8255('0x2d')],{'$or':_['map'](_0x322808,function(_0x164ce5){if(_0x164ce5[_0x8255('0x31')][_0x8255('0x32')]!==_0x8255('0x33')){var _0x81cd58={};_0x81cd58[_0x164ce5[_0x8255('0x34')]]={'$like':'%'+_0x396fef[_0x8255('0x25')][_0x8255('0x2f')]+'%'};return _0x81cd58;}})});}_0x47557=_['merge']({},_0x47557,_0x396fef['options']);var _0x18520b={'where':_0x47557[_0x8255('0x2d')]};return db[_0x8255('0x35')][_0x8255('0x36')](_0x18520b)[_0x8255('0x1d')](function(_0x36749b){_0x120eaf[_0x8255('0x36')]=_0x36749b;if(_0x396fef[_0x8255('0x25')][_0x8255('0x37')]){_0x47557[_0x8255('0x38')]=[{'all':!![]}];}return db[_0x8255('0x35')][_0x8255('0x39')](_0x47557);})[_0x8255('0x1d')](function(_0x45f1da){_0x120eaf[_0x8255('0x3a')]=_0x45f1da;return _0x120eaf;})[_0x8255('0x1d')](respondWithFilteredResult(_0x3a419c,_0x47557))['catch'](handleError(_0x3a419c,null));};exports['show']=function(_0x16b755,_0x1559a5){var _0x10da25={'raw':!![],'where':{'id':_0x16b755['params']['id']}},_0x562e18={};_0x562e18[_0x8255('0x23')]=_[_0x8255('0x24')](db[_0x8255('0x35')][_0x8255('0x22')]);_0x562e18[_0x8255('0x25')]=_[_0x8255('0x24')](_0x16b755[_0x8255('0x25')]);_0x562e18[_0x8255('0x26')]=_[_0x8255('0x28')](_0x562e18[_0x8255('0x23')],_0x562e18[_0x8255('0x25')]);_0x10da25[_0x8255('0x27')]=_[_0x8255('0x28')](_0x562e18[_0x8255('0x23')],qs['fields'](_0x16b755['query'][_0x8255('0x29')]));_0x10da25[_0x8255('0x27')]=_0x10da25[_0x8255('0x27')][_0x8255('0x3b')]?_0x10da25[_0x8255('0x27')]:_0x562e18['model'];if(_0x16b755[_0x8255('0x25')]['includeAll']){_0x10da25['include']=[{'all':!![]}];}_0x10da25=_['merge']({},_0x10da25,_0x16b755[_0x8255('0x3c')]);return db[_0x8255('0x35')][_0x8255('0x3d')](_0x10da25)[_0x8255('0x1d')](handleEntityNotFound(_0x1559a5,null))[_0x8255('0x1d')](respondWithResult(_0x1559a5,null))[_0x8255('0x3e')](handleError(_0x1559a5,null));};exports[_0x8255('0x3f')]=function(_0x54b62a,_0xb06a9f){return db[_0x8255('0x35')]['create'](_0x54b62a[_0x8255('0x40')],{})['then'](respondWithResult(_0xb06a9f,0xc9))['catch'](handleError(_0xb06a9f,null));};exports[_0x8255('0x1c')]=function(_0x3df56c,_0x51e851){if(_0x3df56c[_0x8255('0x40')]['id']){delete _0x3df56c[_0x8255('0x40')]['id'];}return db[_0x8255('0x35')][_0x8255('0x3d')]({'where':{'id':_0x3df56c[_0x8255('0x41')]['id']}})[_0x8255('0x1d')](handleEntityNotFound(_0x51e851,null))['then'](saveUpdates(_0x3df56c[_0x8255('0x40')],null))[_0x8255('0x1d')](respondWithResult(_0x51e851,null))[_0x8255('0x3e')](handleError(_0x51e851,null));};exports[_0x8255('0x1e')]=function(_0x102237,_0x5caa2a){return db[_0x8255('0x35')][_0x8255('0x3d')]({'where':{'id':_0x102237['params']['id']}})[_0x8255('0x1d')](handleEntityNotFound(_0x5caa2a,null))[_0x8255('0x1d')](removeEntity(_0x5caa2a,null))[_0x8255('0x3e')](handleError(_0x5caa2a,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 424019c..206de7a 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 _0xce6f=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','FieldId','lodash','../../config/logger','api','moment'];(function(_0x460dae,_0x3a907f){var _0x36e6d0=function(_0x447057){while(--_0x447057){_0x460dae['push'](_0x460dae['shift']());}};_0x36e6d0(++_0x3a907f);}(_0xce6f,0x194));var _0xfce6=function(_0x4b8824,_0x474b85){_0x4b8824=_0x4b8824-0x0;var _0x434ad3=_0xce6f[_0x4b8824];return _0x434ad3;};'use strict';var _=require(_0xfce6('0x0'));var util=require('util');var logger=require(_0xfce6('0x1'))(_0xfce6('0x2'));var moment=require(_0xfce6('0x3'));var BPromise=require(_0xfce6('0x4'));var rp=require(_0xfce6('0x5'));var fs=require('fs');var path=require(_0xfce6('0x6'));var rimraf=require(_0xfce6('0x7'));var config=require(_0xfce6('0x8'));var attributes=require(_0xfce6('0x9'));module[_0xfce6('0xa')]=function(_0x1159c2,_0x35ec9e){return _0x1159c2['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xfce6('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5add=['bluebird','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','FieldId','lodash','../../config/logger','api','moment'];(function(_0x21fac5,_0x511e16){var _0x50a172=function(_0x3f022e){while(--_0x3f022e){_0x21fac5['push'](_0x21fac5['shift']());}};_0x50a172(++_0x511e16);}(_0x5add,0x188));var _0xd5ad=function(_0x3d6fcd,_0x14839c){_0x3d6fcd=_0x3d6fcd-0x0;var _0x595400=_0x5add[_0x3d6fcd];return _0x595400;};'use strict';var _=require(_0xd5ad('0x0'));var util=require('util');var logger=require(_0xd5ad('0x1'))(_0xd5ad('0x2'));var moment=require(_0xd5ad('0x3'));var BPromise=require(_0xd5ad('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5ad('0x5'));var rimraf=require(_0xd5ad('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5ad('0x7'));module[_0xd5ad('0x8')]=function(_0x25bc18,_0x4994ac){return _0x25bc18[_0xd5ad('0x9')]('ServicenowField',attributes,{'tableName':_0xd5ad('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xd5ad('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 7f33b97..63fe79d 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 _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x25ccff,_0x4ff95d){var _0x528b99=function(_0x59c602){while(--_0x59c602){_0x25ccff['push'](_0x25ccff['shift']());}};_0x528b99(++_0x4ff95d);}(_0x9582,0x95));var _0x2958=function(_0x196aaa,_0x482880){_0x196aaa=_0x196aaa-0x0;var _0x1edb47=_0x9582[_0x196aaa];return _0x1edb47;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('ServicenowField,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('ServicenowField,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0x1261=['then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x39c98f,_0x4014e0){var _0x36fd40=function(_0x3d6963){while(--_0x3d6963){_0x39c98f['push'](_0x39c98f['shift']());}};_0x36fd40(++_0x4014e0);}(_0x1261,0x144));var _0x1126=function(_0x509f97,_0x442414){_0x509f97=_0x509f97-0x0;var _0x18bbef=_0x1261[_0x509f97];return _0x18bbef;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('ServicenowField,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 69cdb18..b5cc0ec 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 _0xf585=['/:id/fields','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getConfigurations'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xf585,0x186));var _0x5f58=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf585[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0x5f58('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f58('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5f58('0x2'));var interaction=require(_0x5f58('0x3'));var config=require(_0x5f58('0x4'));var controller=require('./intSugarcrmAccount.controller');router[_0x5f58('0x5')]('/',auth[_0x5f58('0x6')](),controller[_0x5f58('0x7')]);router['get']('/:id',auth[_0x5f58('0x6')](),controller['show']);router[_0x5f58('0x5')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5f58('0x8')]);router[_0x5f58('0x5')](_0x5f58('0x9'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x5f58('0x6')](),controller['create']);router[_0x5f58('0xa')](_0x5f58('0xb'),auth['isAuthenticated'](),controller[_0x5f58('0xc')]);router[_0x5f58('0xd')](_0x5f58('0xe'),auth['isAuthenticated'](),controller[_0x5f58('0xf')]);router[_0x5f58('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5f58('0x11')]);module[_0x5f58('0x12')]=router; \ No newline at end of file +var _0x67bf=['addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x6306b4,_0x5f4647){var _0x46e442=function(_0x281912){while(--_0x281912){_0x6306b4['push'](_0x6306b4['shift']());}};_0x46e442(++_0x5f4647);}(_0x67bf,0x118));var _0xf67b=function(_0x4229f7,_0x52165d){_0x4229f7=_0x4229f7-0x0;var _0x1d9cab=_0x67bf[_0x4229f7];return _0x1d9cab;};'use strict';var multer=require(_0xf67b('0x0'));var util=require(_0xf67b('0x1'));var path=require(_0xf67b('0x2'));var timeout=require(_0xf67b('0x3'));var express=require(_0xf67b('0x4'));var router=express[_0xf67b('0x5')]();var auth=require(_0xf67b('0x6'));var interaction=require(_0xf67b('0x7'));var config=require(_0xf67b('0x8'));var controller=require('./intSugarcrmAccount.controller');router[_0xf67b('0x9')]('/',auth[_0xf67b('0xa')](),controller[_0xf67b('0xb')]);router[_0xf67b('0x9')](_0xf67b('0xc'),auth[_0xf67b('0xa')](),controller[_0xf67b('0xd')]);router[_0xf67b('0x9')](_0xf67b('0xe'),auth[_0xf67b('0xa')](),controller[_0xf67b('0xf')]);router[_0xf67b('0x9')](_0xf67b('0x10'),auth[_0xf67b('0xa')](),controller[_0xf67b('0x11')]);router['post']('/',auth[_0xf67b('0xa')](),controller['create']);router[_0xf67b('0x12')](_0xf67b('0xe'),auth[_0xf67b('0xa')](),controller[_0xf67b('0x13')]);router[_0xf67b('0x14')](_0xf67b('0xc'),auth['isAuthenticated'](),controller[_0xf67b('0x15')]);router['delete'](_0xf67b('0xc'),auth[_0xf67b('0xa')](),controller['destroy']);module[_0xf67b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 50e497c..b0fc5b7 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 _0xc1e1=['exports','STRING','username','remoteUri'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xc1e1,0x130));var _0x1c1e=function(_0x579940,_0x5ba0b5){_0x579940=_0x579940-0x0;var _0x150486=_0xc1e1[_0x579940];return _0x150486;};'use strict';var Sequelize=require('sequelize');module[_0x1c1e('0x0')]={'name':{'type':Sequelize[_0x1c1e('0x1')]},'description':{'type':Sequelize[_0x1c1e('0x1')]},'username':{'type':Sequelize[_0x1c1e('0x1')],'unique':_0x1c1e('0x2')},'password':{'type':Sequelize[_0x1c1e('0x1')]},'remoteUri':{'type':Sequelize[_0x1c1e('0x1')],'unique':_0x1c1e('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x33a1=['STRING','username','remoteUri','sequelize','exports'];(function(_0x456904,_0x4cb25c){var _0x4b0063=function(_0x2cb59f){while(--_0x2cb59f){_0x456904['push'](_0x456904['shift']());}};_0x4b0063(++_0x4cb25c);}(_0x33a1,0xd0));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x133a('0x0'));module[_0x133a('0x1')]={'name':{'type':Sequelize[_0x133a('0x2')]},'description':{'type':Sequelize[_0x133a('0x2')]},'username':{'type':Sequelize[_0x133a('0x2')],'unique':_0x133a('0x3')},'password':{'type':Sequelize[_0x133a('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x133a('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index ff7eefe..c9d4624 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 _0x14e8=['SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','then','name','SugarcrmAccount','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','create','update','body','params','destroy','find','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','order','AccountId','Subjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','slice','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','values','module_fields','remove','includes','label','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client'];(function(_0x1c9a0a,_0x56a77d){var _0x2fea2c=function(_0x3d1eac){while(--_0x3d1eac){_0x1c9a0a['push'](_0x1c9a0a['shift']());}};_0x2fea2c(++_0x56a77d);}(_0x14e8,0xdb));var _0x814e=function(_0xc90eeb,_0x762091){_0xc90eeb=_0xc90eeb-0x0;var _0x39cfa5=_0x14e8[_0xc90eeb];return _0x39cfa5;};'use strict';var pdf=require(_0x814e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x814e('0x1'));var zipdir=require(_0x814e('0x2'));var jsonpatch=require(_0x814e('0x3'));var rp=require(_0x814e('0x4'));var moment=require('moment');var BPromise=require(_0x814e('0x5'));var Mustache=require('mustache');var util=require(_0x814e('0x6'));var path=require(_0x814e('0x7'));var sox=require(_0x814e('0x8'));var csv=require(_0x814e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x814e('0xa'));var squel=require(_0x814e('0xb'));var crypto=require(_0x814e('0xc'));var jsforce=require(_0x814e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x814e('0x9'));var querystring=require(_0x814e('0xe'));var Papa=require('papaparse');var Redis=require(_0x814e('0xf'));var authService=require(_0x814e('0x10'));var qs=require(_0x814e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x814e('0x12'))(_0x814e('0x13'));var utils=require(_0x814e('0x14'));var config=require(_0x814e('0x15'));var db=require(_0x814e('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x814e('0x17'));var client=jayson[_0x814e('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x5427e1,_0x1d69ef,_0x1bcaa4){if(_0x1bcaa4){var _0x3a435b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a435b['test'](_0x1d69ef)){return _0x5427e1;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5427e1;}}function respondWithRpcPromise(_0x310c4a,_0x39046b,_0x3a49cb,_0x3f68a7){return new BPromise(function(_0x440a80,_0x1ba5f8){var _0x6f58c6=_0x3f68a7||client;return _0x6f58c6['request'](_0x310c4a,_0x3a49cb)['then'](function(_0x1ddb90){logger['info'](_0x814e('0x19'),_0x39046b,'request\x20sent');logger['debug'](_0x814e('0x1a'),_0x39046b,_0x814e('0x1b'),JSON[_0x814e('0x1c')](_0x1ddb90));if(_0x1ddb90[_0x814e('0x1d')]){if(_0x1ddb90[_0x814e('0x1d')][_0x814e('0x1e')]===0x1f4){logger[_0x814e('0x1d')](_0x814e('0x19'),_0x39046b,_0x1ddb90[_0x814e('0x1d')][_0x814e('0x1f')]);return _0x1ba5f8(_0x1ddb90[_0x814e('0x1d')][_0x814e('0x1f')]);}logger[_0x814e('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0x39046b,_0x1ddb90[_0x814e('0x1d')][_0x814e('0x1f')]);return _0x440a80(_0x1ddb90['error'][_0x814e('0x1f')]);}else{logger['info'](_0x814e('0x19'),_0x39046b,'request\x20sent');_0x440a80(_0x1ddb90[_0x814e('0x20')]['message']);}})[_0x814e('0x21')](function(_0x538944){logger[_0x814e('0x1d')](_0x814e('0x19'),_0x39046b,_0x538944);_0x1ba5f8(_0x538944);});});}function respondWithStatusCode(_0x3a89b0,_0x2cc340){_0x2cc340=_0x2cc340||0xcc;return function(_0x281f1a){if(_0x281f1a){return _0x3a89b0['sendStatus'](_0x2cc340);}return _0x3a89b0['status'](_0x2cc340)['end']();};}function respondWithResult(_0x374279,_0x126711){_0x126711=_0x126711||0xc8;return function(_0x2a888d){if(_0x2a888d){return _0x374279[_0x814e('0x22')](_0x126711)['json'](_0x2a888d);}};}function respondWithFilteredResult(_0x4b98d9,_0x323bf0){return function(_0x481497){if(_0x481497){var _0x19d36f=_0x481497[_0x814e('0x23')],_0xbf81d6=_0x323bf0[_0x814e('0x24')],_0x3ed172=_0x323bf0[_0x814e('0x24')]+_0x323bf0[_0x814e('0x25')],_0x366247;if(_0x3ed172>=_0x19d36f){_0x3ed172=_0x19d36f;_0x366247=0xc8;}else{_0x366247=0xce;}_0x4b98d9[_0x814e('0x22')](_0x366247);return _0x4b98d9[_0x814e('0x26')](_0x814e('0x27'),_0xbf81d6+'-'+_0x3ed172+'/'+_0x19d36f)[_0x814e('0x28')](_0x481497);}return null;};}function patchUpdates(_0x1825c3){return function(_0x23e029){try{jsonpatch[_0x814e('0x29')](_0x23e029,_0x1825c3,!![]);}catch(_0x165f33){return BPromise[_0x814e('0x2a')](_0x165f33);}return _0x23e029['save']();};}function saveUpdates(_0x1b4a8a,_0x64ff6f){return function(_0x449c75){if(_0x449c75){return _0x449c75['update'](_0x1b4a8a)[_0x814e('0x2b')](function(_0x268564){return _0x268564;});}return null;};}function removeEntity(_0x1fe4df,_0x4b2de8){return function(_0x4bde2d){if(_0x4bde2d){return _0x4bde2d['destroy']()['then'](function(){_0x1fe4df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27966e,_0xcc3150){return function(_0x42a753){if(!_0x42a753){_0x27966e['sendStatus'](0x194);}return _0x42a753;};}function handleError(_0x4353a1,_0xef95f3){_0xef95f3=_0xef95f3||0x1f4;return function(_0x456a7a){logger[_0x814e('0x1d')](_0x456a7a['stack']);if(_0x456a7a[_0x814e('0x2c')]){delete _0x456a7a[_0x814e('0x2c')];}_0x4353a1['status'](_0xef95f3)['send'](_0x456a7a);};}exports['index']=function(_0x803158,_0xc0cef7){var _0x35be89={},_0x49e0ea={},_0x356c7={'count':0x0,'rows':[]};var _0x538e30=db[_0x814e('0x2d')]['rawAttributes'];_0x49e0ea['model']=_[_0x814e('0x2e')](_0x538e30);_0x49e0ea['query']=_[_0x814e('0x2e')](_0x803158['query']);_0x49e0ea[_0x814e('0x2f')]=_[_0x814e('0x30')](_0x49e0ea[_0x814e('0x31')],_0x49e0ea[_0x814e('0x32')]);_0x35be89[_0x814e('0x33')]=_['intersection'](_0x49e0ea[_0x814e('0x31')],qs[_0x814e('0x34')](_0x803158['query'][_0x814e('0x34')]));_0x35be89[_0x814e('0x33')]=_0x35be89['attributes'][_0x814e('0x35')]?_0x35be89['attributes']:_0x49e0ea[_0x814e('0x31')];if(!_0x803158[_0x814e('0x32')][_0x814e('0x36')](_0x814e('0x37'))){_0x35be89[_0x814e('0x25')]=qs[_0x814e('0x25')](_0x803158[_0x814e('0x32')][_0x814e('0x25')]);_0x35be89[_0x814e('0x24')]=qs[_0x814e('0x24')](_0x803158[_0x814e('0x32')]['offset']);}_0x35be89['order']=qs[_0x814e('0x38')](_0x803158[_0x814e('0x32')][_0x814e('0x38')]);_0x35be89['where']=qs[_0x814e('0x2f')](_[_0x814e('0x39')](_0x803158[_0x814e('0x32')],_0x49e0ea['filters']));if(_0x803158['query'][_0x814e('0x3a')]){_0x35be89[_0x814e('0x3b')]=_[_0x814e('0x3c')](_0x35be89[_0x814e('0x3b')],{'$or':_[_0x814e('0x3d')](_0x538e30,function(_0x4974c9){if(_0x4974c9[_0x814e('0x3e')][_0x814e('0x3f')]!==_0x814e('0x40')){var _0x7182d5={};_0x7182d5[_0x4974c9[_0x814e('0x41')]]={'$like':'%'+_0x803158['query'][_0x814e('0x3a')]+'%'};return _0x7182d5;}})});}_0x35be89=_[_0x814e('0x3c')]({},_0x35be89,_0x803158[_0x814e('0x42')]);var _0x38662a={'where':_0x35be89[_0x814e('0x3b')]};return db[_0x814e('0x2d')][_0x814e('0x23')](_0x38662a)[_0x814e('0x2b')](function(_0x23e5eb){_0x356c7['count']=_0x23e5eb;if(_0x803158[_0x814e('0x32')][_0x814e('0x43')]){_0x35be89[_0x814e('0x44')]=[{'all':!![]}];}return db[_0x814e('0x2d')][_0x814e('0x45')](_0x35be89);})[_0x814e('0x2b')](function(_0x32b306){_0x356c7[_0x814e('0x46')]=_0x32b306;return _0x356c7;})[_0x814e('0x2b')](respondWithFilteredResult(_0xc0cef7,_0x35be89))[_0x814e('0x21')](handleError(_0xc0cef7,null));};exports[_0x814e('0x47')]=function(_0x57e123,_0x363199){var _0xcae1c9={'raw':![],'where':{'id':_0x57e123['params']['id']}},_0x2a2418={};_0x2a2418['model']=_[_0x814e('0x2e')](db[_0x814e('0x2d')]['rawAttributes']);_0x2a2418[_0x814e('0x32')]=_[_0x814e('0x2e')](_0x57e123[_0x814e('0x32')]);_0x2a2418[_0x814e('0x2f')]=_[_0x814e('0x30')](_0x2a2418[_0x814e('0x31')],_0x2a2418[_0x814e('0x32')]);_0xcae1c9[_0x814e('0x33')]=_[_0x814e('0x30')](_0x2a2418['model'],qs[_0x814e('0x34')](_0x57e123[_0x814e('0x32')]['fields']));_0xcae1c9[_0x814e('0x33')]=_0xcae1c9[_0x814e('0x33')][_0x814e('0x35')]?_0xcae1c9[_0x814e('0x33')]:_0x2a2418[_0x814e('0x31')];if(_0x57e123[_0x814e('0x32')][_0x814e('0x43')]){_0xcae1c9[_0x814e('0x44')]=[{'all':!![]}];}_0xcae1c9=_[_0x814e('0x3c')]({},_0xcae1c9,_0x57e123['options']);return db[_0x814e('0x2d')]['find'](_0xcae1c9)[_0x814e('0x2b')](handleEntityNotFound(_0x363199,null))[_0x814e('0x2b')](respondWithResult(_0x363199,null))['catch'](handleError(_0x363199,null));};exports[_0x814e('0x48')]=function(_0x20dd3a,_0x15f119){return db[_0x814e('0x2d')][_0x814e('0x48')](_0x20dd3a['body'],{})[_0x814e('0x2b')](respondWithResult(_0x15f119,0xc9))[_0x814e('0x21')](handleError(_0x15f119,null));};exports[_0x814e('0x49')]=function(_0x3a49c9,_0x272c74){if(_0x3a49c9[_0x814e('0x4a')]['id']){delete _0x3a49c9['body']['id'];}return db[_0x814e('0x2d')]['find']({'where':{'id':_0x3a49c9[_0x814e('0x4b')]['id']}})[_0x814e('0x2b')](handleEntityNotFound(_0x272c74,null))[_0x814e('0x2b')](saveUpdates(_0x3a49c9['body'],null))[_0x814e('0x2b')](respondWithResult(_0x272c74,null))['catch'](handleError(_0x272c74,null));};exports[_0x814e('0x4c')]=function(_0x17035e,_0x1e062b){return db['SugarcrmAccount'][_0x814e('0x4d')]({'where':{'id':_0x17035e['params']['id']}})[_0x814e('0x2b')](handleEntityNotFound(_0x1e062b,null))[_0x814e('0x2b')](removeEntity(_0x1e062b,null))[_0x814e('0x21')](handleError(_0x1e062b,null));};exports[_0x814e('0x4e')]=function(_0x238892,_0x5833bf,_0x54407e){var _0x48d5e8={};var _0x282845={};var _0xe0a53b;var _0x2bcc93;return db['SugarcrmAccount'][_0x814e('0x4f')]({'where':{'id':_0x238892[_0x814e('0x4b')]['id']}})[_0x814e('0x2b')](handleEntityNotFound(_0x5833bf,null))[_0x814e('0x2b')](function(_0x6f1824){if(_0x6f1824){_0xe0a53b=_0x6f1824;_0x282845[_0x814e('0x31')]=_[_0x814e('0x2e')](db[_0x814e('0x50')][_0x814e('0x51')]);_0x282845['query']=_[_0x814e('0x2e')](_0x238892[_0x814e('0x32')]);_0x282845[_0x814e('0x2f')]=_['intersection'](_0x282845[_0x814e('0x31')],_0x282845[_0x814e('0x32')]);_0x48d5e8[_0x814e('0x33')]=_[_0x814e('0x30')](_0x282845[_0x814e('0x31')],qs[_0x814e('0x34')](_0x238892[_0x814e('0x32')][_0x814e('0x34')]));_0x48d5e8[_0x814e('0x33')]=_0x48d5e8['attributes']['length']?_0x48d5e8[_0x814e('0x33')]:_0x282845['model'];_0x48d5e8[_0x814e('0x52')]=qs[_0x814e('0x38')](_0x238892[_0x814e('0x32')][_0x814e('0x38')]);_0x48d5e8[_0x814e('0x3b')]=qs['filters'](_[_0x814e('0x39')](_0x238892[_0x814e('0x32')],_0x282845['filters']));if(_0x238892[_0x814e('0x32')][_0x814e('0x3a')]){_0x48d5e8['where']=_[_0x814e('0x3c')](_0x48d5e8['where'],{'$or':_[_0x814e('0x3d')](_0x48d5e8['attributes'],function(_0x35d6e9){var _0x364b7d={};_0x364b7d[_0x35d6e9]={'$like':'%'+_0x238892['query'][_0x814e('0x3a')]+'%'};return _0x364b7d;})});}_0x48d5e8=_[_0x814e('0x3c')]({},_0x48d5e8,_0x238892['options']);return _0xe0a53b['getConfigurations'](_0x48d5e8);}})[_0x814e('0x2b')](function(_0x44f59c){if(_0x44f59c){_0x2bcc93=_0x44f59c['length'];if(!_0x238892[_0x814e('0x32')]['hasOwnProperty']('nolimit')){_0x48d5e8[_0x814e('0x25')]=qs[_0x814e('0x25')](_0x238892[_0x814e('0x32')][_0x814e('0x25')]);_0x48d5e8['offset']=qs['offset'](_0x238892[_0x814e('0x32')][_0x814e('0x24')]);}return _0xe0a53b[_0x814e('0x4e')](_0x48d5e8);}})['then'](function(_0xa79413){if(_0xa79413){return _0xa79413?{'count':_0x2bcc93,'rows':_0xa79413}:null;}})['then'](respondWithResult(_0x5833bf,null))['catch'](handleError(_0x5833bf,null));};exports['addConfiguration']=function(_0x3e312f,_0x284ef0,_0x551500){if(_0x3e312f[_0x814e('0x4a')]['id']){delete _0x3e312f[_0x814e('0x4a')]['id'];}return db[_0x814e('0x2d')]['findOne']({'where':{'id':_0x3e312f[_0x814e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x284ef0,null))[_0x814e('0x2b')](function(_0x34b201){if(_0x34b201){_0x3e312f[_0x814e('0x4a')][_0x814e('0x53')]=_0x34b201['id'];_0x3e312f[_0x814e('0x4a')][_0x814e('0x54')]=integrations['getSubjects'](_0x3e312f[_0x814e('0x4a')][_0x814e('0x55')],_0x3e312f['body'][_0x814e('0x3e')]);_0x3e312f[_0x814e('0x4a')][_0x814e('0x56')]=integrations['getDescriptions'](_0x3e312f['body'][_0x814e('0x55')],_0x3e312f[_0x814e('0x4a')][_0x814e('0x3e')]);return db[_0x814e('0x50')][_0x814e('0x48')](_0x3e312f[_0x814e('0x4a')],{'include':[{'model':db[_0x814e('0x57')],'as':_0x814e('0x54')},{'model':db[_0x814e('0x57')],'as':_0x814e('0x56')}]});}return null;})[_0x814e('0x2b')](respondWithResult(_0x284ef0,null))['catch'](handleError(_0x284ef0,null));};exports[_0x814e('0x58')]=function(_0x3a9105,_0x188844,_0x5b941f){var _0x327535='';var _0x170257=['id',_0x814e('0x2c'),_0x814e('0x59'),_0x814e('0x5a'),_0x814e('0x5b'),_0x814e('0x5c'),_0x814e('0x5d'),_0x814e('0x5e'),_0x814e('0x5f'),'parent_type','parent_name',_0x814e('0x60')];return db[_0x814e('0x2d')][_0x814e('0x4f')]({'where':{'id':_0x3a9105[_0x814e('0x4b')]['id']},'attributes':['id',_0x814e('0x61'),_0x814e('0x62'),_0x814e('0x63')]})[_0x814e('0x2b')](handleEntityNotFound(_0x188844,null))[_0x814e('0x2b')](function(_0x33c3c4){if(_0x33c3c4){_0x327535=_0x33c3c4[_0x814e('0x63')];var _0x548ef7=_0x327535[_0x814e('0x64')](-0x1);if(_0x548ef7==='/'){_0x327535=_0x327535['substring'](0x0,_0x327535[_0x814e('0x65')](_0x548ef7));}return rp({'method':'POST','uri':util[_0x814e('0x66')](_0x814e('0x67'),_0x327535,_0x814e('0x68')),'json':!![],'form':{'method':_0x814e('0x69'),'input_type':'JSON','response_type':_0x814e('0x6a'),'rest_data':JSON[_0x814e('0x1c')]({'user_auth':{'user_name':_0x33c3c4[_0x814e('0x61')],'password':_0x33c3c4['password'],'encryption':_0x814e('0x6b')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x2e06a5){if(_0x2e06a5&&_0x2e06a5[_0x814e('0x2c')]!==_0x814e('0x6c')&&_0x2e06a5[_0x814e('0x2c')]!==_0x814e('0x6d')){return rp({'method':_0x814e('0x6e'),'uri':util[_0x814e('0x66')](_0x814e('0x67'),_0x327535,_0x814e('0x68')),'json':!![],'form':{'method':_0x814e('0x6f'),'input_type':_0x814e('0x6a'),'response_type':'JSON','rest_data':JSON[_0x814e('0x1c')]({'session':_0x2e06a5['id'],'module_name':'Calls'})}})['then'](function(_0x4a20c0){if(_0x4a20c0){var _0x2356c9=_[_0x814e('0x70')](_0x4a20c0[_0x814e('0x71')]);_[_0x814e('0x72')](_0x2356c9,function(_0x49736a){return _0x170257[_0x814e('0x73')](_0x49736a[_0x814e('0x2c')]);});return{'count':_0x2356c9[_0x814e('0x35')],'rows':_[_0x814e('0x3d')](_0x2356c9,function(_0x1679c4){return{'id':_0x1679c4[_0x814e('0x2c')],'name':_0x1679c4[_0x814e('0x74')],'custom':_['endsWith'](_0x1679c4[_0x814e('0x2c')],'_c')?!![]:![],'options':_0x1679c4[_0x814e('0x42')]?_[_0x814e('0x3d')](_[_0x814e('0x70')](_0x1679c4['options']),function(_0x2e31bf){return{'name':_0x2e31bf[_0x814e('0x75')],'value':_0x2e31bf[_0x814e('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x188844,null))['catch'](function(_0x29cf30){var _0x723a00=_0x3a9105[_0x814e('0x32')][_0x814e('0x76')]?0x1f4:_0x29cf30['statusCode']||0x1f4;logger[_0x814e('0x1d')](_0x814e('0x77'),'getFields',_0x723a00,JSON[_0x814e('0x1c')](_0x29cf30));delete _0x29cf30['name'];if(_0x723a00===0x191){_0x723a00=0x190;}_0x188844[_0x814e('0x22')](_0x723a00)['send'](_0x3a9105['query'][_0x814e('0x76')]?{'message':_0x814e('0x78'),'statusCode':_0x29cf30['statusCode']}:_0x29cf30);});}else{var _0x7b9f88=0x1f4;_0x188844[_0x814e('0x22')](_0x7b9f88)[_0x814e('0x79')]({'message':_0x814e('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6bc5=['slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','type','filter','options','SugarcrmAccount','include','findAll','show','rawAttributes','length','includeAll','create','body','find','params','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','remoteUri'];(function(_0x5e757c,_0x3e3294){var _0x36c09c=function(_0x3a9d1d){while(--_0x3a9d1d){_0x5e757c['push'](_0x5e757c['shift']());}};_0x36c09c(++_0x3e3294);}(_0x6bc5,0x11c));var _0x56bc=function(_0x58b555,_0x10d0f4){_0x58b555=_0x58b555-0x0;var _0x5bdf13=_0x6bc5[_0x58b555];return _0x5bdf13;};'use strict';var pdf=require(_0x56bc('0x0'));var emlformat=require(_0x56bc('0x1'));var rimraf=require(_0x56bc('0x2'));var zipdir=require(_0x56bc('0x3'));var jsonpatch=require(_0x56bc('0x4'));var rp=require(_0x56bc('0x5'));var moment=require(_0x56bc('0x6'));var BPromise=require(_0x56bc('0x7'));var Mustache=require(_0x56bc('0x8'));var util=require(_0x56bc('0x9'));var path=require(_0x56bc('0xa'));var sox=require(_0x56bc('0xb'));var csv=require('to-csv');var ejs=require(_0x56bc('0xc'));var fs=require('fs');var _=require(_0x56bc('0xd'));var squel=require(_0x56bc('0xe'));var crypto=require('crypto');var jsforce=require(_0x56bc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x56bc('0x10'));var querystring=require(_0x56bc('0x11'));var Papa=require(_0x56bc('0x12'));var Redis=require(_0x56bc('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x56bc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56bc('0x15'))(_0x56bc('0x16'));var utils=require('../../config/utils');var config=require(_0x56bc('0x17'));var db=require(_0x56bc('0x18'))['db'];var integrations=require(_0x56bc('0x19'));var jayson=require(_0x56bc('0x1a'));var client=jayson[_0x56bc('0x1b')][_0x56bc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5df9cd,_0x6847b5,_0x16fbd4){if(_0x16fbd4){var _0x3b6861=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b6861[_0x56bc('0x1d')](_0x6847b5)){return _0x5df9cd;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5df9cd;}}function respondWithRpcPromise(_0xe83e1c,_0x3f666f,_0x5e094c,_0x6875ec){return new BPromise(function(_0x104ad8,_0x2c91fd){var _0x327fdb=_0x6875ec||client;return _0x327fdb[_0x56bc('0x1e')](_0xe83e1c,_0x5e094c)[_0x56bc('0x1f')](function(_0x218e6d){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x3f666f,_0x56bc('0x20'));logger[_0x56bc('0x21')](_0x56bc('0x22'),_0x3f666f,_0x56bc('0x20'),JSON[_0x56bc('0x23')](_0x218e6d));if(_0x218e6d[_0x56bc('0x24')]){if(_0x218e6d[_0x56bc('0x24')][_0x56bc('0x25')]===0x1f4){logger[_0x56bc('0x24')](_0x56bc('0x26'),_0x3f666f,_0x218e6d[_0x56bc('0x24')][_0x56bc('0x27')]);return _0x2c91fd(_0x218e6d[_0x56bc('0x24')][_0x56bc('0x27')]);}logger[_0x56bc('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f666f,_0x218e6d[_0x56bc('0x24')][_0x56bc('0x27')]);return _0x104ad8(_0x218e6d[_0x56bc('0x24')]['message']);}else{logger[_0x56bc('0x28')](_0x56bc('0x26'),_0x3f666f,'request\x20sent');_0x104ad8(_0x218e6d['result']['message']);}})[_0x56bc('0x29')](function(_0x27cfbe){logger[_0x56bc('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f666f,_0x27cfbe);_0x2c91fd(_0x27cfbe);});});}function respondWithStatusCode(_0x218577,_0x31ee22){_0x31ee22=_0x31ee22||0xcc;return function(_0x4843a7){if(_0x4843a7){return _0x218577[_0x56bc('0x2a')](_0x31ee22);}return _0x218577[_0x56bc('0x2b')](_0x31ee22)[_0x56bc('0x2c')]();};}function respondWithResult(_0x3e65b5,_0x113024){_0x113024=_0x113024||0xc8;return function(_0xe0c1d2){if(_0xe0c1d2){return _0x3e65b5[_0x56bc('0x2b')](_0x113024)[_0x56bc('0x2d')](_0xe0c1d2);}};}function respondWithFilteredResult(_0x146f71,_0x1cb607){return function(_0x588cb1){if(_0x588cb1){var _0x57b1a5=_0x588cb1[_0x56bc('0x2e')],_0x3ae9f0=_0x1cb607[_0x56bc('0x2f')],_0x1207f8=_0x1cb607[_0x56bc('0x2f')]+_0x1cb607[_0x56bc('0x30')],_0x305048;if(_0x1207f8>=_0x57b1a5){_0x1207f8=_0x57b1a5;_0x305048=0xc8;}else{_0x305048=0xce;}_0x146f71[_0x56bc('0x2b')](_0x305048);return _0x146f71[_0x56bc('0x31')](_0x56bc('0x32'),_0x3ae9f0+'-'+_0x1207f8+'/'+_0x57b1a5)['json'](_0x588cb1);}return null;};}function patchUpdates(_0x2f57e6){return function(_0x2c886c){try{jsonpatch[_0x56bc('0x33')](_0x2c886c,_0x2f57e6,!![]);}catch(_0x2bd9e0){return BPromise[_0x56bc('0x34')](_0x2bd9e0);}return _0x2c886c['save']();};}function saveUpdates(_0x2a406f,_0x353b3c){return function(_0x4a4558){if(_0x4a4558){return _0x4a4558[_0x56bc('0x35')](_0x2a406f)[_0x56bc('0x1f')](function(_0x470cb4){return _0x470cb4;});}return null;};}function removeEntity(_0x410a9a,_0x577308){return function(_0x1c49c8){if(_0x1c49c8){return _0x1c49c8[_0x56bc('0x36')]()[_0x56bc('0x1f')](function(){_0x410a9a[_0x56bc('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x239d28,_0x56a0fd){return function(_0x4928f1){if(!_0x4928f1){_0x239d28[_0x56bc('0x2a')](0x194);}return _0x4928f1;};}function handleError(_0x525ca3,_0x40226c){_0x40226c=_0x40226c||0x1f4;return function(_0x33938c){logger['error'](_0x33938c[_0x56bc('0x37')]);if(_0x33938c[_0x56bc('0x38')]){delete _0x33938c['name'];}_0x525ca3[_0x56bc('0x2b')](_0x40226c)[_0x56bc('0x39')](_0x33938c);};}exports[_0x56bc('0x3a')]=function(_0x57576c,_0x545f48){var _0x14f657={},_0x41e862={},_0x708c01={'count':0x0,'rows':[]};var _0x15c8f3=db['SugarcrmAccount']['rawAttributes'];_0x41e862[_0x56bc('0x3b')]=_[_0x56bc('0x3c')](_0x15c8f3);_0x41e862[_0x56bc('0x3d')]=_['keys'](_0x57576c[_0x56bc('0x3d')]);_0x41e862[_0x56bc('0x3e')]=_[_0x56bc('0x3f')](_0x41e862[_0x56bc('0x3b')],_0x41e862['query']);_0x14f657[_0x56bc('0x40')]=_[_0x56bc('0x3f')](_0x41e862[_0x56bc('0x3b')],qs[_0x56bc('0x41')](_0x57576c['query'][_0x56bc('0x41')]));_0x14f657['attributes']=_0x14f657['attributes']['length']?_0x14f657[_0x56bc('0x40')]:_0x41e862[_0x56bc('0x3b')];if(!_0x57576c['query'][_0x56bc('0x42')](_0x56bc('0x43'))){_0x14f657[_0x56bc('0x30')]=qs[_0x56bc('0x30')](_0x57576c[_0x56bc('0x3d')]['limit']);_0x14f657['offset']=qs['offset'](_0x57576c['query'][_0x56bc('0x2f')]);}_0x14f657[_0x56bc('0x44')]=qs[_0x56bc('0x45')](_0x57576c[_0x56bc('0x3d')][_0x56bc('0x45')]);_0x14f657[_0x56bc('0x46')]=qs[_0x56bc('0x3e')](_['pick'](_0x57576c['query'],_0x41e862['filters']));if(_0x57576c['query']['filter']){_0x14f657[_0x56bc('0x46')]=_[_0x56bc('0x47')](_0x14f657['where'],{'$or':_[_0x56bc('0x48')](_0x15c8f3,function(_0x262a99){if(_0x262a99[_0x56bc('0x49')]['key']!=='VIRTUAL'){var _0x35fc77={};_0x35fc77[_0x262a99['field']]={'$like':'%'+_0x57576c[_0x56bc('0x3d')][_0x56bc('0x4a')]+'%'};return _0x35fc77;}})});}_0x14f657=_[_0x56bc('0x47')]({},_0x14f657,_0x57576c[_0x56bc('0x4b')]);var _0x24a508={'where':_0x14f657['where']};return db[_0x56bc('0x4c')][_0x56bc('0x2e')](_0x24a508)[_0x56bc('0x1f')](function(_0x4efcae){_0x708c01[_0x56bc('0x2e')]=_0x4efcae;if(_0x57576c[_0x56bc('0x3d')]['includeAll']){_0x14f657[_0x56bc('0x4d')]=[{'all':!![]}];}return db[_0x56bc('0x4c')][_0x56bc('0x4e')](_0x14f657);})[_0x56bc('0x1f')](function(_0x4b453c){_0x708c01['rows']=_0x4b453c;return _0x708c01;})[_0x56bc('0x1f')](respondWithFilteredResult(_0x545f48,_0x14f657))[_0x56bc('0x29')](handleError(_0x545f48,null));};exports[_0x56bc('0x4f')]=function(_0x17f76d,_0x64b6f3){var _0x30ee5a={'raw':![],'where':{'id':_0x17f76d['params']['id']}},_0x485a51={};_0x485a51[_0x56bc('0x3b')]=_[_0x56bc('0x3c')](db['SugarcrmAccount'][_0x56bc('0x50')]);_0x485a51[_0x56bc('0x3d')]=_[_0x56bc('0x3c')](_0x17f76d['query']);_0x485a51['filters']=_[_0x56bc('0x3f')](_0x485a51[_0x56bc('0x3b')],_0x485a51[_0x56bc('0x3d')]);_0x30ee5a[_0x56bc('0x40')]=_[_0x56bc('0x3f')](_0x485a51[_0x56bc('0x3b')],qs['fields'](_0x17f76d[_0x56bc('0x3d')][_0x56bc('0x41')]));_0x30ee5a[_0x56bc('0x40')]=_0x30ee5a[_0x56bc('0x40')][_0x56bc('0x51')]?_0x30ee5a[_0x56bc('0x40')]:_0x485a51[_0x56bc('0x3b')];if(_0x17f76d[_0x56bc('0x3d')][_0x56bc('0x52')]){_0x30ee5a[_0x56bc('0x4d')]=[{'all':!![]}];}_0x30ee5a=_[_0x56bc('0x47')]({},_0x30ee5a,_0x17f76d[_0x56bc('0x4b')]);return db[_0x56bc('0x4c')]['find'](_0x30ee5a)[_0x56bc('0x1f')](handleEntityNotFound(_0x64b6f3,null))[_0x56bc('0x1f')](respondWithResult(_0x64b6f3,null))[_0x56bc('0x29')](handleError(_0x64b6f3,null));};exports[_0x56bc('0x53')]=function(_0x3a00ad,_0x1b8db0){return db[_0x56bc('0x4c')][_0x56bc('0x53')](_0x3a00ad[_0x56bc('0x54')],{})[_0x56bc('0x1f')](respondWithResult(_0x1b8db0,0xc9))[_0x56bc('0x29')](handleError(_0x1b8db0,null));};exports[_0x56bc('0x35')]=function(_0x3267fd,_0x5bbe7d){if(_0x3267fd[_0x56bc('0x54')]['id']){delete _0x3267fd[_0x56bc('0x54')]['id'];}return db[_0x56bc('0x4c')][_0x56bc('0x55')]({'where':{'id':_0x3267fd['params']['id']}})[_0x56bc('0x1f')](handleEntityNotFound(_0x5bbe7d,null))['then'](saveUpdates(_0x3267fd[_0x56bc('0x54')],null))[_0x56bc('0x1f')](respondWithResult(_0x5bbe7d,null))[_0x56bc('0x29')](handleError(_0x5bbe7d,null));};exports[_0x56bc('0x36')]=function(_0x1e4929,_0x55919d){return db['SugarcrmAccount'][_0x56bc('0x55')]({'where':{'id':_0x1e4929[_0x56bc('0x56')]['id']}})['then'](handleEntityNotFound(_0x55919d,null))[_0x56bc('0x1f')](removeEntity(_0x55919d,null))[_0x56bc('0x29')](handleError(_0x55919d,null));};exports[_0x56bc('0x57')]=function(_0x2f787b,_0x20f5d0,_0x32e1a){var _0x1d16a9={};var _0x4c0250={};var _0x2d3da9;var _0x56bc24;return db['SugarcrmAccount'][_0x56bc('0x58')]({'where':{'id':_0x2f787b['params']['id']}})[_0x56bc('0x1f')](handleEntityNotFound(_0x20f5d0,null))[_0x56bc('0x1f')](function(_0x32e8e3){if(_0x32e8e3){_0x2d3da9=_0x32e8e3;_0x4c0250[_0x56bc('0x3b')]=_[_0x56bc('0x3c')](db[_0x56bc('0x59')][_0x56bc('0x50')]);_0x4c0250[_0x56bc('0x3d')]=_[_0x56bc('0x3c')](_0x2f787b[_0x56bc('0x3d')]);_0x4c0250[_0x56bc('0x3e')]=_['intersection'](_0x4c0250['model'],_0x4c0250['query']);_0x1d16a9[_0x56bc('0x40')]=_['intersection'](_0x4c0250[_0x56bc('0x3b')],qs[_0x56bc('0x41')](_0x2f787b[_0x56bc('0x3d')][_0x56bc('0x41')]));_0x1d16a9[_0x56bc('0x40')]=_0x1d16a9[_0x56bc('0x40')][_0x56bc('0x51')]?_0x1d16a9[_0x56bc('0x40')]:_0x4c0250[_0x56bc('0x3b')];_0x1d16a9['order']=qs['sort'](_0x2f787b['query']['sort']);_0x1d16a9[_0x56bc('0x46')]=qs[_0x56bc('0x3e')](_[_0x56bc('0x5a')](_0x2f787b['query'],_0x4c0250[_0x56bc('0x3e')]));if(_0x2f787b[_0x56bc('0x3d')]['filter']){_0x1d16a9[_0x56bc('0x46')]=_[_0x56bc('0x47')](_0x1d16a9[_0x56bc('0x46')],{'$or':_['map'](_0x1d16a9[_0x56bc('0x40')],function(_0x16ece9){var _0x377394={};_0x377394[_0x16ece9]={'$like':'%'+_0x2f787b[_0x56bc('0x3d')][_0x56bc('0x4a')]+'%'};return _0x377394;})});}_0x1d16a9=_[_0x56bc('0x47')]({},_0x1d16a9,_0x2f787b['options']);return _0x2d3da9['getConfigurations'](_0x1d16a9);}})[_0x56bc('0x1f')](function(_0x3b39ad){if(_0x3b39ad){_0x56bc24=_0x3b39ad[_0x56bc('0x51')];if(!_0x2f787b[_0x56bc('0x3d')][_0x56bc('0x42')](_0x56bc('0x43'))){_0x1d16a9[_0x56bc('0x30')]=qs['limit'](_0x2f787b['query']['limit']);_0x1d16a9[_0x56bc('0x2f')]=qs[_0x56bc('0x2f')](_0x2f787b[_0x56bc('0x3d')][_0x56bc('0x2f')]);}return _0x2d3da9['getConfigurations'](_0x1d16a9);}})[_0x56bc('0x1f')](function(_0x4a4f30){if(_0x4a4f30){return _0x4a4f30?{'count':_0x56bc24,'rows':_0x4a4f30}:null;}})[_0x56bc('0x1f')](respondWithResult(_0x20f5d0,null))[_0x56bc('0x29')](handleError(_0x20f5d0,null));};exports[_0x56bc('0x5b')]=function(_0x46c493,_0x8036f1,_0x5f9f08){if(_0x46c493[_0x56bc('0x54')]['id']){delete _0x46c493[_0x56bc('0x54')]['id'];}return db['SugarcrmAccount'][_0x56bc('0x58')]({'where':{'id':_0x46c493[_0x56bc('0x56')]['id']}})[_0x56bc('0x1f')](handleEntityNotFound(_0x8036f1,null))[_0x56bc('0x1f')](function(_0x3b69db){if(_0x3b69db){_0x46c493[_0x56bc('0x54')][_0x56bc('0x5c')]=_0x3b69db['id'];_0x46c493[_0x56bc('0x54')][_0x56bc('0x5d')]=integrations[_0x56bc('0x5e')](_0x46c493['body'][_0x56bc('0x5f')],_0x46c493['body']['type']);_0x46c493[_0x56bc('0x54')][_0x56bc('0x60')]=integrations[_0x56bc('0x61')](_0x46c493[_0x56bc('0x54')][_0x56bc('0x5f')],_0x46c493['body']['type']);return db[_0x56bc('0x59')][_0x56bc('0x53')](_0x46c493[_0x56bc('0x54')],{'include':[{'model':db[_0x56bc('0x62')],'as':_0x56bc('0x5d')},{'model':db['SugarcrmField'],'as':_0x56bc('0x60')}]});}return null;})[_0x56bc('0x1f')](respondWithResult(_0x8036f1,null))[_0x56bc('0x29')](handleError(_0x8036f1,null));};exports[_0x56bc('0x63')]=function(_0x8abf49,_0x486518,_0x11e977){var _0x155b87='';var _0x8e98e6=['id','name',_0x56bc('0x64'),'created_by',_0x56bc('0x65'),_0x56bc('0x66'),_0x56bc('0x67'),_0x56bc('0x68'),_0x56bc('0x69'),_0x56bc('0x6a'),'parent_name','direction'];return db['SugarcrmAccount'][_0x56bc('0x58')]({'where':{'id':_0x8abf49['params']['id']},'attributes':['id',_0x56bc('0x6b'),'password','remoteUri']})[_0x56bc('0x1f')](handleEntityNotFound(_0x486518,null))[_0x56bc('0x1f')](function(_0x40671f){if(_0x40671f){_0x155b87=_0x40671f[_0x56bc('0x6c')];var _0x13d403=_0x155b87[_0x56bc('0x6d')](-0x1);if(_0x13d403==='/'){_0x155b87=_0x155b87[_0x56bc('0x6e')](0x0,_0x155b87['lastIndexOf'](_0x13d403));}return rp({'method':_0x56bc('0x6f'),'uri':util[_0x56bc('0x70')](_0x56bc('0x71'),_0x155b87,_0x56bc('0x72')),'json':!![],'form':{'method':_0x56bc('0x73'),'input_type':'JSON','response_type':_0x56bc('0x74'),'rest_data':JSON[_0x56bc('0x23')]({'user_auth':{'user_name':_0x40671f[_0x56bc('0x6b')],'password':_0x40671f['password'],'encryption':_0x56bc('0x75')},'application':_0x56bc('0x76')})}});}})['then'](function(_0x321303){if(_0x321303&&_0x321303[_0x56bc('0x38')]!==_0x56bc('0x77')&&_0x321303[_0x56bc('0x38')]!==_0x56bc('0x78')){return rp({'method':'POST','uri':util[_0x56bc('0x70')](_0x56bc('0x71'),_0x155b87,_0x56bc('0x72')),'json':!![],'form':{'method':_0x56bc('0x79'),'input_type':_0x56bc('0x74'),'response_type':_0x56bc('0x74'),'rest_data':JSON[_0x56bc('0x23')]({'session':_0x321303['id'],'module_name':_0x56bc('0x7a')})}})[_0x56bc('0x1f')](function(_0x22d5c6){if(_0x22d5c6){var _0x5edba1=_[_0x56bc('0x7b')](_0x22d5c6[_0x56bc('0x7c')]);_[_0x56bc('0x7d')](_0x5edba1,function(_0x224c25){return _0x8e98e6[_0x56bc('0x7e')](_0x224c25['name']);});return{'count':_0x5edba1['length'],'rows':_[_0x56bc('0x48')](_0x5edba1,function(_0x423453){return{'id':_0x423453['name'],'name':_0x423453[_0x56bc('0x7f')],'custom':_[_0x56bc('0x80')](_0x423453[_0x56bc('0x38')],'_c')?!![]:![],'options':_0x423453[_0x56bc('0x4b')]?_[_0x56bc('0x48')](_[_0x56bc('0x7b')](_0x423453[_0x56bc('0x4b')]),function(_0x11c8a8){return{'name':_0x11c8a8[_0x56bc('0x81')],'value':_0x11c8a8[_0x56bc('0x38')]};}):[]};})};}})['then'](respondWithResult(_0x486518,null))[_0x56bc('0x29')](function(_0x22ecb7){var _0x51658b=_0x8abf49[_0x56bc('0x3d')][_0x56bc('0x1d')]?0x1f4:_0x22ecb7[_0x56bc('0x82')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x56bc('0x63'),_0x51658b,JSON[_0x56bc('0x23')](_0x22ecb7));delete _0x22ecb7[_0x56bc('0x38')];if(_0x51658b===0x191){_0x51658b=0x190;}_0x486518[_0x56bc('0x2b')](_0x51658b)[_0x56bc('0x39')](_0x8abf49[_0x56bc('0x3d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x22ecb7[_0x56bc('0x82')]}:_0x22ecb7);});}else{var _0x4c0091=0x1f4;_0x486518[_0x56bc('0x2b')](_0x4c0091)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index c989a71..605aafb 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 _0x65ae=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x65ae,0x132));var _0xe65a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe65a('0x0'));var util=require('util');var logger=require(_0xe65a('0x1'))(_0xe65a('0x2'));var moment=require(_0xe65a('0x3'));var BPromise=require(_0xe65a('0x4'));var rp=require(_0xe65a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe65a('0x6'));var config=require(_0xe65a('0x7'));var attributes=require(_0xe65a('0x8'));var integrations=require(_0xe65a('0x9'));module[_0xe65a('0xa')]=function(_0x2b31c3,_0x3af867){return _0x2b31c3['define'](_0xe65a('0xb'),attributes,{'tableName':_0xe65a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb562=['exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0xb562,0x9f));var _0x2b56=function(_0x198181,_0x3b25c7){_0x198181=_0x198181-0x0;var _0x6e2752=_0xb562[_0x198181];return _0x6e2752;};'use strict';var _=require(_0x2b56('0x0'));var util=require(_0x2b56('0x1'));var logger=require('../../config/logger')(_0x2b56('0x2'));var moment=require(_0x2b56('0x3'));var BPromise=require(_0x2b56('0x4'));var rp=require(_0x2b56('0x5'));var fs=require('fs');var path=require(_0x2b56('0x6'));var rimraf=require(_0x2b56('0x7'));var config=require(_0x2b56('0x8'));var attributes=require(_0x2b56('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2b56('0xa')]=function(_0x98119b,_0x22be03){return _0x98119b['define'](_0x2b56('0xb'),attributes,{'tableName':_0x2b56('0xc'),'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 65e8086..d798830 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 _0xb042=['findAll','options','raw','attributes','include','map','model','stringify','catch','ShowSugarcrmAccount','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x45abb8,_0x4266c){var _0x272418=function(_0x324441){while(--_0x324441){_0x45abb8['push'](_0x45abb8['shift']());}};_0x272418(++_0x4266c);}(_0xb042,0x198));var _0x2b04=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb042[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x2b04('0x0'));var util=require(_0x2b04('0x1'));var moment=require(_0x2b04('0x2'));var BPromise=require(_0x2b04('0x3'));var rs=require(_0x2b04('0x4'));var fs=require('fs');var Redis=require(_0x2b04('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b04('0x6'));var logger=require(_0x2b04('0x7'))(_0x2b04('0x8'));var config=require(_0x2b04('0x9'));var jayson=require(_0x2b04('0xa'));var client=jayson[_0x2b04('0xb')][_0x2b04('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x225b13,_0x3e65c9,_0x18b9e2){return new BPromise(function(_0x2033c4,_0xdf6075){return client[_0x2b04('0xd')](_0x225b13,_0x18b9e2)[_0x2b04('0xe')](function(_0x3a8acc){logger[_0x2b04('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x3e65c9,_0x2b04('0x10'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3e65c9,_0x2b04('0x10'),JSON['stringify'](_0x3a8acc));if(_0x3a8acc['error']){if(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x12')]===0x1f4){logger['error'](_0x2b04('0x13'),_0x3e65c9,_0x3a8acc['error'][_0x2b04('0x14')]);return _0xdf6075(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x14')]);}logger[_0x2b04('0x11')](_0x2b04('0x13'),_0x3e65c9,_0x3a8acc['error'][_0x2b04('0x14')]);return _0x2033c4(_0x3a8acc[_0x2b04('0x11')][_0x2b04('0x14')]);}else{logger[_0x2b04('0xf')](_0x2b04('0x13'),_0x3e65c9,'request\x20sent');_0x2033c4(_0x3a8acc[_0x2b04('0x15')]['message']);}})['catch'](function(_0x21f3fa){logger['error'](_0x2b04('0x13'),_0x3e65c9,_0x21f3fa);_0xdf6075(_0x21f3fa);});});}exports[_0x2b04('0x16')]=function(_0x6b6a25){var _0x260254=this;return new Promise(function(_0x126d1a,_0x12a713){return db[_0x2b04('0x17')][_0x2b04('0x18')]({'raw':_0x6b6a25[_0x2b04('0x19')]?_0x6b6a25[_0x2b04('0x19')][_0x2b04('0x1a')]===undefined?!![]:![]:!![],'where':_0x6b6a25[_0x2b04('0x19')]?_0x6b6a25[_0x2b04('0x19')]['where']||null:null,'attributes':_0x6b6a25[_0x2b04('0x19')]?_0x6b6a25['options'][_0x2b04('0x1b')]||null:null,'limit':_0x6b6a25['options']?_0x6b6a25[_0x2b04('0x19')]['limit']||null:null,'include':_0x6b6a25[_0x2b04('0x19')]?_0x6b6a25[_0x2b04('0x19')][_0x2b04('0x1c')]?_[_0x2b04('0x1d')](_0x6b6a25[_0x2b04('0x19')]['include'],function(_0x3e04be){return{'model':db[_0x3e04be['model']],'as':_0x3e04be['as'],'attributes':_0x3e04be[_0x2b04('0x1b')],'include':_0x3e04be[_0x2b04('0x1c')]?_[_0x2b04('0x1d')](_0x3e04be[_0x2b04('0x1c')],function(_0x313ed4){return{'model':db[_0x313ed4[_0x2b04('0x1e')]],'as':_0x313ed4['as'],'attributes':_0x313ed4[_0x2b04('0x1b')],'include':_0x313ed4[_0x2b04('0x1c')]?_[_0x2b04('0x1d')](_0x313ed4['include'],function(_0x52e81c){return{'model':db[_0x52e81c['model']],'as':_0x52e81c['as'],'attributes':_0x52e81c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57d8a2){logger[_0x2b04('0xf')](_0x2b04('0x16'),_0x6b6a25);logger['debug'](_0x2b04('0x16'),_0x6b6a25,JSON[_0x2b04('0x1f')](_0x57d8a2));_0x126d1a(_0x57d8a2);})[_0x2b04('0x20')](function(_0x17596c){logger['error'](_0x2b04('0x16'),_0x17596c['message'],_0x6b6a25);_0x12a713(_0x260254[_0x2b04('0x11')](0x1f4,_0x17596c[_0x2b04('0x14')]));});});};exports[_0x2b04('0x21')]=function(_0x2a3157){var _0x561be8=this;return new Promise(function(_0x25539d,_0x533a16){return db[_0x2b04('0x17')]['find']({'raw':_0x2a3157[_0x2b04('0x19')]?_0x2a3157[_0x2b04('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2a3157[_0x2b04('0x19')]?_0x2a3157[_0x2b04('0x19')][_0x2b04('0x22')]||null:null,'attributes':_0x2a3157[_0x2b04('0x19')]?_0x2a3157[_0x2b04('0x19')][_0x2b04('0x1b')]||null:null,'include':_0x2a3157['options']?_0x2a3157[_0x2b04('0x19')][_0x2b04('0x1c')]?_[_0x2b04('0x1d')](_0x2a3157[_0x2b04('0x19')][_0x2b04('0x1c')],function(_0x18e7f7){return{'model':db[_0x18e7f7[_0x2b04('0x1e')]],'as':_0x18e7f7['as'],'attributes':_0x18e7f7['attributes'],'include':_0x18e7f7['include']?_[_0x2b04('0x1d')](_0x18e7f7[_0x2b04('0x1c')],function(_0x5370d3){return{'model':db[_0x5370d3[_0x2b04('0x1e')]],'as':_0x5370d3['as'],'attributes':_0x5370d3['attributes'],'include':_0x5370d3['include']?_[_0x2b04('0x1d')](_0x5370d3[_0x2b04('0x1c')],function(_0x32d587){return{'model':db[_0x32d587[_0x2b04('0x1e')]],'as':_0x32d587['as'],'attributes':_0x32d587['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b04('0xe')](function(_0x33628a){logger['info'](_0x2b04('0x21'),_0x2a3157);logger[_0x2b04('0x23')]('ShowSugarcrmAccount',_0x2a3157,JSON[_0x2b04('0x1f')](_0x33628a));_0x25539d(_0x33628a);})[_0x2b04('0x20')](function(_0x4618e9){logger[_0x2b04('0x11')](_0x2b04('0x21'),_0x4618e9[_0x2b04('0x14')],_0x2a3157);_0x533a16(_0x561be8['error'](0x1f4,_0x4618e9[_0x2b04('0x14')]));});});}; \ No newline at end of file +var _0x1843=['../../config/logger','../../config/environment','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1843,0x83));var _0x3184=function(_0x233fa6,_0x3410de){_0x233fa6=_0x233fa6-0x0;var _0x70b72e=_0x1843[_0x233fa6];return _0x70b72e;};'use strict';var _=require(_0x3184('0x0'));var util=require(_0x3184('0x1'));var moment=require('moment');var BPromise=require(_0x3184('0x2'));var rs=require(_0x3184('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3184('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3184('0x5'))('rpc');var config=require(_0x3184('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3184('0x7')][_0x3184('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48fa65,_0x38a40f,_0x56e6e1){return new BPromise(function(_0x93fa3f,_0xe62d9){return client['request'](_0x48fa65,_0x56e6e1)[_0x3184('0x9')](function(_0x115d16){logger[_0x3184('0xa')](_0x3184('0xb'),_0x38a40f,_0x3184('0xc'));logger[_0x3184('0xd')](_0x3184('0xe'),_0x38a40f,'request\x20sent',JSON[_0x3184('0xf')](_0x115d16));if(_0x115d16['error']){if(_0x115d16[_0x3184('0x10')][_0x3184('0x11')]===0x1f4){logger[_0x3184('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x38a40f,_0x115d16[_0x3184('0x10')][_0x3184('0x12')]);return _0xe62d9(_0x115d16['error']['message']);}logger[_0x3184('0x10')](_0x3184('0xb'),_0x38a40f,_0x115d16[_0x3184('0x10')][_0x3184('0x12')]);return _0x93fa3f(_0x115d16['error'][_0x3184('0x12')]);}else{logger[_0x3184('0xa')](_0x3184('0xb'),_0x38a40f,_0x3184('0xc'));_0x93fa3f(_0x115d16[_0x3184('0x13')]['message']);}})[_0x3184('0x14')](function(_0x567363){logger[_0x3184('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x38a40f,_0x567363);_0xe62d9(_0x567363);});});}exports[_0x3184('0x15')]=function(_0x4de3ea){var _0x5f42bc=this;return new Promise(function(_0x530bfd,_0x43568f){return db['SugarcrmAccount'][_0x3184('0x16')]({'raw':_0x4de3ea[_0x3184('0x17')]?_0x4de3ea['options'][_0x3184('0x18')]===undefined?!![]:![]:!![],'where':_0x4de3ea['options']?_0x4de3ea['options'][_0x3184('0x19')]||null:null,'attributes':_0x4de3ea[_0x3184('0x17')]?_0x4de3ea[_0x3184('0x17')][_0x3184('0x1a')]||null:null,'limit':_0x4de3ea['options']?_0x4de3ea[_0x3184('0x17')][_0x3184('0x1b')]||null:null,'include':_0x4de3ea[_0x3184('0x17')]?_0x4de3ea[_0x3184('0x17')][_0x3184('0x1c')]?_[_0x3184('0x1d')](_0x4de3ea['options'][_0x3184('0x1c')],function(_0x1519fe){return{'model':db[_0x1519fe[_0x3184('0x1e')]],'as':_0x1519fe['as'],'attributes':_0x1519fe[_0x3184('0x1a')],'include':_0x1519fe[_0x3184('0x1c')]?_['map'](_0x1519fe[_0x3184('0x1c')],function(_0x73b1f0){return{'model':db[_0x73b1f0['model']],'as':_0x73b1f0['as'],'attributes':_0x73b1f0[_0x3184('0x1a')],'include':_0x73b1f0[_0x3184('0x1c')]?_[_0x3184('0x1d')](_0x73b1f0[_0x3184('0x1c')],function(_0x1cdd33){return{'model':db[_0x1cdd33[_0x3184('0x1e')]],'as':_0x1cdd33['as'],'attributes':_0x1cdd33[_0x3184('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7a316){logger[_0x3184('0xa')](_0x3184('0x15'),_0x4de3ea);logger[_0x3184('0xd')](_0x3184('0x15'),_0x4de3ea,JSON[_0x3184('0xf')](_0xf7a316));_0x530bfd(_0xf7a316);})['catch'](function(_0xfeb73e){logger['error']('GetSugarcrmAccount',_0xfeb73e['message'],_0x4de3ea);_0x43568f(_0x5f42bc[_0x3184('0x10')](0x1f4,_0xfeb73e['message']));});});};exports[_0x3184('0x1f')]=function(_0x61fef0){var _0x5dade2=this;return new Promise(function(_0x30d343,_0x207265){return db[_0x3184('0x20')][_0x3184('0x21')]({'raw':_0x61fef0[_0x3184('0x17')]?_0x61fef0[_0x3184('0x17')][_0x3184('0x18')]===undefined?!![]:![]:!![],'where':_0x61fef0[_0x3184('0x17')]?_0x61fef0[_0x3184('0x17')][_0x3184('0x19')]||null:null,'attributes':_0x61fef0[_0x3184('0x17')]?_0x61fef0[_0x3184('0x17')][_0x3184('0x1a')]||null:null,'include':_0x61fef0[_0x3184('0x17')]?_0x61fef0['options'][_0x3184('0x1c')]?_[_0x3184('0x1d')](_0x61fef0[_0x3184('0x17')][_0x3184('0x1c')],function(_0x6b490b){return{'model':db[_0x6b490b['model']],'as':_0x6b490b['as'],'attributes':_0x6b490b[_0x3184('0x1a')],'include':_0x6b490b['include']?_['map'](_0x6b490b[_0x3184('0x1c')],function(_0x24c259){return{'model':db[_0x24c259[_0x3184('0x1e')]],'as':_0x24c259['as'],'attributes':_0x24c259[_0x3184('0x1a')],'include':_0x24c259[_0x3184('0x1c')]?_[_0x3184('0x1d')](_0x24c259[_0x3184('0x1c')],function(_0xd0becd){return{'model':db[_0xd0becd[_0x3184('0x1e')]],'as':_0xd0becd['as'],'attributes':_0xd0becd['attributes']};}):[]};}):[]};}):[]:[]})[_0x3184('0x9')](function(_0x13e424){logger[_0x3184('0xa')]('ShowSugarcrmAccount',_0x61fef0);logger['debug'](_0x3184('0x1f'),_0x61fef0,JSON[_0x3184('0xf')](_0x13e424));_0x30d343(_0x13e424);})[_0x3184('0x14')](function(_0x1a758b){logger[_0x3184('0x10')](_0x3184('0x1f'),_0x1a758b[_0x3184('0x12')],_0x61fef0);_0x207265(_0x5dade2['error'](0x1f4,_0x1a758b[_0x3184('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ddd82f6..0cdb23e 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 _0xde9f=['/:id/descriptions','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','getSubjects'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xde9f,0x16d));var _0xfde9=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0xde9f[_0x90a39a];return _0x2b62f7;};'use strict';var multer=require(_0xfde9('0x0'));var util=require(_0xfde9('0x1'));var path=require('path');var timeout=require(_0xfde9('0x2'));var express=require('express');var router=express[_0xfde9('0x3')]();var auth=require(_0xfde9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfde9('0x5'));var controller=require(_0xfde9('0x6'));router[_0xfde9('0x7')]('/',auth[_0xfde9('0x8')](),controller['index']);router['get']('/:id',auth[_0xfde9('0x8')](),controller[_0xfde9('0x9')]);router['get'](_0xfde9('0xa'),auth['isAuthenticated'](),controller[_0xfde9('0xb')]);router[_0xfde9('0x7')]('/:id/subjects',auth[_0xfde9('0x8')](),controller[_0xfde9('0xc')]);router[_0xfde9('0x7')](_0xfde9('0xd'),auth[_0xfde9('0x8')](),controller['getDescriptions']);router[_0xfde9('0xe')]('/',auth[_0xfde9('0x8')](),controller[_0xfde9('0xf')]);router[_0xfde9('0x10')](_0xfde9('0x11'),auth[_0xfde9('0x8')](),controller['update']);router[_0xfde9('0x12')]('/:id',auth[_0xfde9('0x8')](),controller[_0xfde9('0x13')]);module[_0xfde9('0x14')]=router; \ No newline at end of file +var _0xd00a=['getSubjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id'];(function(_0x2538c4,_0xe9d364){var _0x15602e=function(_0xea4daa){while(--_0xea4daa){_0x2538c4['push'](_0x2538c4['shift']());}};_0x15602e(++_0xe9d364);}(_0xd00a,0x1e3));var _0xad00=function(_0x55f687,_0x31dfc9){_0x55f687=_0x55f687-0x0;var _0x4e0ccd=_0xd00a[_0x55f687];return _0x4e0ccd;};'use strict';var multer=require(_0xad00('0x0'));var util=require(_0xad00('0x1'));var path=require(_0xad00('0x2'));var timeout=require('connect-timeout');var express=require(_0xad00('0x3'));var router=express['Router']();var auth=require(_0xad00('0x4'));var interaction=require(_0xad00('0x5'));var config=require(_0xad00('0x6'));var controller=require(_0xad00('0x7'));router[_0xad00('0x8')]('/',auth[_0xad00('0x9')](),controller['index']);router[_0xad00('0x8')](_0xad00('0xa'),auth[_0xad00('0x9')](),controller['show']);router[_0xad00('0x8')]('/:id/fields',auth[_0xad00('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xad00('0xb')]);router[_0xad00('0x8')](_0xad00('0xc'),auth[_0xad00('0x9')](),controller[_0xad00('0xd')]);router['post']('/',auth[_0xad00('0x9')](),controller[_0xad00('0xe')]);router['put'](_0xad00('0xa'),auth[_0xad00('0x9')](),controller[_0xad00('0xf')]);router[_0xad00('0x10')](_0xad00('0xa'),auth[_0xad00('0x9')](),controller[_0xad00('0x11')]);module[_0xad00('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a62cd9f..c364a45 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 _0xa382=['STRING'];(function(_0x57c7b3,_0x294734){var _0x572f94=function(_0x5b8ef7){while(--_0x5b8ef7){_0x57c7b3['push'](_0x57c7b3['shift']());}};_0x572f94(++_0x294734);}(_0xa382,0x1a2));var _0x2a38=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xa382[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2a38('0x0')]}}; \ No newline at end of file +var _0x5e1f=['exports','STRING','sequelize'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0x5e1f,0xe6));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf5e1('0x0'));module[_0xf5e1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf5e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 070a248..9b83e8a 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 _0x50de=['pick','filter','where','merge','VIRTUAL','field','options','include','show','params','includeAll','catch','body','update','SugarcrmField','map','getFields','findOne','getSubjects','hasOwnProperty','nolimit','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','test','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','query','intersection','attributes','fields','length','order','sort','filters'];(function(_0x5e6c81,_0x34ae3e){var _0x4ab4ab=function(_0x2771ec){while(--_0x2771ec){_0x5e6c81['push'](_0x5e6c81['shift']());}};_0x4ab4ab(++_0x34ae3e);}(_0x50de,0x69));var _0xe50d=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0x50de[_0x3f4a8e];return _0x7f68fd;};'use strict';var pdf=require(_0xe50d('0x0'));var emlformat=require(_0xe50d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe50d('0x2'));var jsonpatch=require(_0xe50d('0x3'));var rp=require('request-promise');var moment=require(_0xe50d('0x4'));var BPromise=require(_0xe50d('0x5'));var Mustache=require(_0xe50d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe50d('0x7'));var csv=require(_0xe50d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe50d('0x9'));var squel=require(_0xe50d('0xa'));var crypto=require(_0xe50d('0xb'));var jsforce=require(_0xe50d('0xc'));var deskjs=require(_0xe50d('0xd'));var toCsv=require(_0xe50d('0x8'));var querystring=require(_0xe50d('0xe'));var Papa=require(_0xe50d('0xf'));var Redis=require(_0xe50d('0x10'));var authService=require(_0xe50d('0x11'));var qs=require(_0xe50d('0x12'));var hardwareService=require(_0xe50d('0x13'));var logger=require(_0xe50d('0x14'))('api');var utils=require(_0xe50d('0x15'));var config=require(_0xe50d('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe50d('0x17')]({'port':0x232a});function checkPasswordPattern(_0x33c180,_0x548704,_0x55e2e6){if(_0x55e2e6){var _0x5db329=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db329[_0xe50d('0x18')](_0x548704)){return _0x33c180;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x33c180;}}function respondWithRpcPromise(_0x3b5cf9,_0x3b0dd9,_0x417f19,_0x4204b6){return new BPromise(function(_0x4ceb0c,_0x53c2e9){var _0x27631e=_0x4204b6||client;return _0x27631e['request'](_0x3b5cf9,_0x417f19)['then'](function(_0x3cbab1){logger['info'](_0xe50d('0x19'),_0x3b0dd9,_0xe50d('0x1a'));logger[_0xe50d('0x1b')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3b0dd9,_0xe50d('0x1a'),JSON[_0xe50d('0x1c')](_0x3cbab1));if(_0x3cbab1[_0xe50d('0x1d')]){if(_0x3cbab1[_0xe50d('0x1d')][_0xe50d('0x1e')]===0x1f4){logger[_0xe50d('0x1d')](_0xe50d('0x19'),_0x3b0dd9,_0x3cbab1[_0xe50d('0x1d')][_0xe50d('0x1f')]);return _0x53c2e9(_0x3cbab1[_0xe50d('0x1d')][_0xe50d('0x1f')]);}logger[_0xe50d('0x1d')](_0xe50d('0x19'),_0x3b0dd9,_0x3cbab1[_0xe50d('0x1d')]['message']);return _0x4ceb0c(_0x3cbab1['error'][_0xe50d('0x1f')]);}else{logger[_0xe50d('0x20')](_0xe50d('0x19'),_0x3b0dd9,_0xe50d('0x1a'));_0x4ceb0c(_0x3cbab1['result'][_0xe50d('0x1f')]);}})['catch'](function(_0x32fbd3){logger[_0xe50d('0x1d')](_0xe50d('0x19'),_0x3b0dd9,_0x32fbd3);_0x53c2e9(_0x32fbd3);});});}function respondWithStatusCode(_0x20cd20,_0x1ee754){_0x1ee754=_0x1ee754||0xcc;return function(_0x2a315b){if(_0x2a315b){return _0x20cd20['sendStatus'](_0x1ee754);}return _0x20cd20['status'](_0x1ee754)[_0xe50d('0x21')]();};}function respondWithResult(_0x501d7b,_0x4c9985){_0x4c9985=_0x4c9985||0xc8;return function(_0x22a2ef){if(_0x22a2ef){return _0x501d7b[_0xe50d('0x22')](_0x4c9985)[_0xe50d('0x23')](_0x22a2ef);}};}function respondWithFilteredResult(_0x1fc31b,_0x1b0add){return function(_0x213dd9){if(_0x213dd9){var _0x41215e=_0x213dd9[_0xe50d('0x24')],_0x4107e9=_0x1b0add['offset'],_0x2818d6=_0x1b0add[_0xe50d('0x25')]+_0x1b0add[_0xe50d('0x26')],_0x5d77ad;if(_0x2818d6>=_0x41215e){_0x2818d6=_0x41215e;_0x5d77ad=0xc8;}else{_0x5d77ad=0xce;}_0x1fc31b[_0xe50d('0x22')](_0x5d77ad);return _0x1fc31b[_0xe50d('0x27')](_0xe50d('0x28'),_0x4107e9+'-'+_0x2818d6+'/'+_0x41215e)[_0xe50d('0x23')](_0x213dd9);}return null;};}function patchUpdates(_0x3db718){return function(_0x3c8fd5){try{jsonpatch[_0xe50d('0x29')](_0x3c8fd5,_0x3db718,!![]);}catch(_0x1fdf0c){return BPromise['reject'](_0x1fdf0c);}return _0x3c8fd5[_0xe50d('0x2a')]();};}function saveUpdates(_0x3fd5be,_0x5c3799){return function(_0x3a4e50){if(_0x3a4e50){return _0x3a4e50['update'](_0x3fd5be)[_0xe50d('0x2b')](function(_0x172233){return _0x172233;});}return null;};}function removeEntity(_0x483e5a,_0x1cc32f){return function(_0x52794a){if(_0x52794a){return _0x52794a[_0xe50d('0x2c')]()[_0xe50d('0x2b')](function(){_0x483e5a[_0xe50d('0x22')](0xcc)[_0xe50d('0x21')]();});}};}function handleEntityNotFound(_0xbd88d3,_0x4b662a){return function(_0xf1b4ad){if(!_0xf1b4ad){_0xbd88d3[_0xe50d('0x2d')](0x194);}return _0xf1b4ad;};}function handleError(_0x2f1b11,_0x21b058){_0x21b058=_0x21b058||0x1f4;return function(_0x5bf9d0){logger[_0xe50d('0x1d')](_0x5bf9d0['stack']);if(_0x5bf9d0[_0xe50d('0x2e')]){delete _0x5bf9d0['name'];}_0x2f1b11[_0xe50d('0x22')](_0x21b058)[_0xe50d('0x2f')](_0x5bf9d0);};}exports[_0xe50d('0x30')]=function(_0x5efe53,_0x39fd0e){var _0x35bb31={},_0x190f83={},_0x54c029={'count':0x0,'rows':[]};var _0x4150b3=db[_0xe50d('0x31')][_0xe50d('0x32')];_0x190f83[_0xe50d('0x33')]=_[_0xe50d('0x34')](_0x4150b3);_0x190f83[_0xe50d('0x35')]=_[_0xe50d('0x34')](_0x5efe53[_0xe50d('0x35')]);_0x190f83['filters']=_[_0xe50d('0x36')](_0x190f83[_0xe50d('0x33')],_0x190f83['query']);_0x35bb31[_0xe50d('0x37')]=_[_0xe50d('0x36')](_0x190f83[_0xe50d('0x33')],qs[_0xe50d('0x38')](_0x5efe53[_0xe50d('0x35')][_0xe50d('0x38')]));_0x35bb31[_0xe50d('0x37')]=_0x35bb31[_0xe50d('0x37')][_0xe50d('0x39')]?_0x35bb31['attributes']:_0x190f83[_0xe50d('0x33')];if(!_0x5efe53[_0xe50d('0x35')]['hasOwnProperty']('nolimit')){_0x35bb31[_0xe50d('0x26')]=qs[_0xe50d('0x26')](_0x5efe53[_0xe50d('0x35')][_0xe50d('0x26')]);_0x35bb31[_0xe50d('0x25')]=qs[_0xe50d('0x25')](_0x5efe53[_0xe50d('0x35')]['offset']);}_0x35bb31[_0xe50d('0x3a')]=qs[_0xe50d('0x3b')](_0x5efe53['query'][_0xe50d('0x3b')]);_0x35bb31['where']=qs[_0xe50d('0x3c')](_[_0xe50d('0x3d')](_0x5efe53['query'],_0x190f83[_0xe50d('0x3c')]));if(_0x5efe53['query'][_0xe50d('0x3e')]){_0x35bb31[_0xe50d('0x3f')]=_[_0xe50d('0x40')](_0x35bb31[_0xe50d('0x3f')],{'$or':_['map'](_0x4150b3,function(_0x333723){if(_0x333723['type']['key']!==_0xe50d('0x41')){var _0x1e474d={};_0x1e474d[_0x333723[_0xe50d('0x42')]]={'$like':'%'+_0x5efe53[_0xe50d('0x35')][_0xe50d('0x3e')]+'%'};return _0x1e474d;}})});}_0x35bb31=_[_0xe50d('0x40')]({},_0x35bb31,_0x5efe53[_0xe50d('0x43')]);var _0x1baa40={'where':_0x35bb31[_0xe50d('0x3f')]};return db[_0xe50d('0x31')][_0xe50d('0x24')](_0x1baa40)['then'](function(_0xe5f354){_0x54c029[_0xe50d('0x24')]=_0xe5f354;if(_0x5efe53[_0xe50d('0x35')]['includeAll']){_0x35bb31[_0xe50d('0x44')]=[{'all':!![]}];}return db[_0xe50d('0x31')]['findAll'](_0x35bb31);})[_0xe50d('0x2b')](function(_0x260876){_0x54c029['rows']=_0x260876;return _0x54c029;})[_0xe50d('0x2b')](respondWithFilteredResult(_0x39fd0e,_0x35bb31))['catch'](handleError(_0x39fd0e,null));};exports[_0xe50d('0x45')]=function(_0x2ae8c3,_0x5edcbc){var _0xbf30fa={'raw':![],'where':{'id':_0x2ae8c3[_0xe50d('0x46')]['id']}},_0x4e5519={};_0x4e5519['model']=_['keys'](db[_0xe50d('0x31')]['rawAttributes']);_0x4e5519['query']=_[_0xe50d('0x34')](_0x2ae8c3['query']);_0x4e5519[_0xe50d('0x3c')]=_[_0xe50d('0x36')](_0x4e5519[_0xe50d('0x33')],_0x4e5519['query']);_0xbf30fa['attributes']=_[_0xe50d('0x36')](_0x4e5519[_0xe50d('0x33')],qs[_0xe50d('0x38')](_0x2ae8c3[_0xe50d('0x35')][_0xe50d('0x38')]));_0xbf30fa[_0xe50d('0x37')]=_0xbf30fa['attributes']['length']?_0xbf30fa[_0xe50d('0x37')]:_0x4e5519[_0xe50d('0x33')];if(_0x2ae8c3[_0xe50d('0x35')][_0xe50d('0x47')]){_0xbf30fa['include']=[{'all':!![]}];}_0xbf30fa=_[_0xe50d('0x40')]({},_0xbf30fa,_0x2ae8c3[_0xe50d('0x43')]);return db['SugarcrmConfiguration']['find'](_0xbf30fa)[_0xe50d('0x2b')](handleEntityNotFound(_0x5edcbc,null))[_0xe50d('0x2b')](respondWithResult(_0x5edcbc,null))[_0xe50d('0x48')](handleError(_0x5edcbc,null));};exports['create']=function(_0x10be7b,_0x4a76d2){return db['SugarcrmConfiguration']['create'](_0x10be7b[_0xe50d('0x49')],{})[_0xe50d('0x2b')](respondWithResult(_0x4a76d2,0xc9))[_0xe50d('0x48')](handleError(_0x4a76d2,null));};exports[_0xe50d('0x4a')]=function(_0x224ace,_0x5a996c){if(_0x224ace['body']['id']){delete _0x224ace[_0xe50d('0x49')]['id'];}return db[_0xe50d('0x31')]['find']({'where':{'id':_0x224ace[_0xe50d('0x46')]['id']}})[_0xe50d('0x2b')](handleEntityNotFound(_0x5a996c,null))[_0xe50d('0x2b')](saveUpdates(_0x224ace['body'],null))['then'](respondWithResult(_0x5a996c,null))['catch'](handleError(_0x5a996c,null));};exports[_0xe50d('0x2c')]=function(_0x23ec10,_0x547992){return db[_0xe50d('0x31')]['find']({'where':{'id':_0x23ec10[_0xe50d('0x46')]['id']}})[_0xe50d('0x2b')](handleEntityNotFound(_0x547992,null))[_0xe50d('0x2b')](removeEntity(_0x547992,null))[_0xe50d('0x48')](handleError(_0x547992,null));};exports['getFields']=function(_0xf8bf51,_0x5c0389,_0x12b8a0){var _0x522d81={};var _0x41a9a3={};var _0x159de9;var _0x314f00;return db[_0xe50d('0x31')]['findOne']({'where':{'id':_0xf8bf51[_0xe50d('0x46')]['id']}})[_0xe50d('0x2b')](handleEntityNotFound(_0x5c0389,null))[_0xe50d('0x2b')](function(_0x33fdb6){if(_0x33fdb6){_0x159de9=_0x33fdb6;_0x41a9a3[_0xe50d('0x33')]=_[_0xe50d('0x34')](db[_0xe50d('0x4b')][_0xe50d('0x32')]);_0x41a9a3[_0xe50d('0x35')]=_[_0xe50d('0x34')](_0xf8bf51[_0xe50d('0x35')]);_0x41a9a3[_0xe50d('0x3c')]=_[_0xe50d('0x36')](_0x41a9a3['model'],_0x41a9a3[_0xe50d('0x35')]);_0x522d81[_0xe50d('0x37')]=_[_0xe50d('0x36')](_0x41a9a3[_0xe50d('0x33')],qs['fields'](_0xf8bf51['query'][_0xe50d('0x38')]));_0x522d81[_0xe50d('0x37')]=_0x522d81['attributes'][_0xe50d('0x39')]?_0x522d81['attributes']:_0x41a9a3[_0xe50d('0x33')];_0x522d81[_0xe50d('0x3a')]=qs[_0xe50d('0x3b')](_0xf8bf51[_0xe50d('0x35')][_0xe50d('0x3b')]);_0x522d81['where']=qs[_0xe50d('0x3c')](_[_0xe50d('0x3d')](_0xf8bf51[_0xe50d('0x35')],_0x41a9a3[_0xe50d('0x3c')]));if(_0xf8bf51[_0xe50d('0x35')][_0xe50d('0x3e')]){_0x522d81['where']=_[_0xe50d('0x40')](_0x522d81[_0xe50d('0x3f')],{'$or':_[_0xe50d('0x4c')](_0x522d81[_0xe50d('0x37')],function(_0x4579f9){var _0x57e6d8={};_0x57e6d8[_0x4579f9]={'$like':'%'+_0xf8bf51[_0xe50d('0x35')][_0xe50d('0x3e')]+'%'};return _0x57e6d8;})});}_0x522d81=_[_0xe50d('0x40')]({},_0x522d81,_0xf8bf51[_0xe50d('0x43')]);return _0x159de9['getFields'](_0x522d81);}})[_0xe50d('0x2b')](function(_0x2aa519){if(_0x2aa519){_0x314f00=_0x2aa519['length'];if(!_0xf8bf51['query']['hasOwnProperty']('nolimit')){_0x522d81[_0xe50d('0x26')]=qs[_0xe50d('0x26')](_0xf8bf51[_0xe50d('0x35')][_0xe50d('0x26')]);_0x522d81['offset']=qs[_0xe50d('0x25')](_0xf8bf51['query']['offset']);}return _0x159de9[_0xe50d('0x4d')](_0x522d81);}})['then'](function(_0x1317b9){if(_0x1317b9){return _0x1317b9?{'count':_0x314f00,'rows':_0x1317b9}:null;}})['then'](respondWithResult(_0x5c0389,null))[_0xe50d('0x48')](handleError(_0x5c0389,null));};exports['getSubjects']=function(_0x5f0f57,_0x278892,_0x4ff529){var _0x30054a={};var _0x31a511={};var _0x455130;var _0x571592;return db[_0xe50d('0x31')][_0xe50d('0x4e')]({'where':{'id':_0x5f0f57[_0xe50d('0x46')]['id']}})[_0xe50d('0x2b')](handleEntityNotFound(_0x278892,null))[_0xe50d('0x2b')](function(_0xb538b5){if(_0xb538b5){_0x455130=_0xb538b5;_0x31a511[_0xe50d('0x33')]=_[_0xe50d('0x34')](db[_0xe50d('0x4b')][_0xe50d('0x32')]);_0x31a511[_0xe50d('0x35')]=_['keys'](_0x5f0f57[_0xe50d('0x35')]);_0x31a511[_0xe50d('0x3c')]=_['intersection'](_0x31a511[_0xe50d('0x33')],_0x31a511[_0xe50d('0x35')]);_0x30054a['attributes']=_['intersection'](_0x31a511[_0xe50d('0x33')],qs[_0xe50d('0x38')](_0x5f0f57[_0xe50d('0x35')][_0xe50d('0x38')]));_0x30054a[_0xe50d('0x37')]=_0x30054a[_0xe50d('0x37')][_0xe50d('0x39')]?_0x30054a['attributes']:_0x31a511['model'];_0x30054a['order']=qs[_0xe50d('0x3b')](_0x5f0f57[_0xe50d('0x35')]['sort']);_0x30054a[_0xe50d('0x3f')]=qs[_0xe50d('0x3c')](_[_0xe50d('0x3d')](_0x5f0f57[_0xe50d('0x35')],_0x31a511[_0xe50d('0x3c')]));if(_0x5f0f57[_0xe50d('0x35')][_0xe50d('0x3e')]){_0x30054a[_0xe50d('0x3f')]=_[_0xe50d('0x40')](_0x30054a['where'],{'$or':_[_0xe50d('0x4c')](_0x30054a[_0xe50d('0x37')],function(_0xb4759a){var _0x2f96c3={};_0x2f96c3[_0xb4759a]={'$like':'%'+_0x5f0f57[_0xe50d('0x35')][_0xe50d('0x3e')]+'%'};return _0x2f96c3;})});}_0x30054a=_[_0xe50d('0x40')]({},_0x30054a,_0x5f0f57['options']);return _0x455130[_0xe50d('0x4f')](_0x30054a);}})['then'](function(_0x3cb1b9){if(_0x3cb1b9){_0x571592=_0x3cb1b9[_0xe50d('0x39')];if(!_0x5f0f57[_0xe50d('0x35')]['hasOwnProperty']('nolimit')){_0x30054a[_0xe50d('0x26')]=qs[_0xe50d('0x26')](_0x5f0f57[_0xe50d('0x35')][_0xe50d('0x26')]);_0x30054a[_0xe50d('0x25')]=qs[_0xe50d('0x25')](_0x5f0f57['query'][_0xe50d('0x25')]);}return _0x455130[_0xe50d('0x4f')](_0x30054a);}})[_0xe50d('0x2b')](function(_0x1090ce){if(_0x1090ce){return _0x1090ce?{'count':_0x571592,'rows':_0x1090ce}:null;}})['then'](respondWithResult(_0x278892,null))[_0xe50d('0x48')](handleError(_0x278892,null));};exports['getDescriptions']=function(_0x29744d,_0x9d0327,_0x520d14){var _0x36a696={};var _0x8d29d1={};var _0x2f9c3d;var _0xb7593d;return db[_0xe50d('0x31')][_0xe50d('0x4e')]({'where':{'id':_0x29744d[_0xe50d('0x46')]['id']}})[_0xe50d('0x2b')](handleEntityNotFound(_0x9d0327,null))['then'](function(_0x4ea75e){if(_0x4ea75e){_0x2f9c3d=_0x4ea75e;_0x8d29d1[_0xe50d('0x33')]=_[_0xe50d('0x34')](db[_0xe50d('0x4b')][_0xe50d('0x32')]);_0x8d29d1[_0xe50d('0x35')]=_[_0xe50d('0x34')](_0x29744d[_0xe50d('0x35')]);_0x8d29d1[_0xe50d('0x3c')]=_[_0xe50d('0x36')](_0x8d29d1[_0xe50d('0x33')],_0x8d29d1[_0xe50d('0x35')]);_0x36a696[_0xe50d('0x37')]=_[_0xe50d('0x36')](_0x8d29d1[_0xe50d('0x33')],qs[_0xe50d('0x38')](_0x29744d[_0xe50d('0x35')][_0xe50d('0x38')]));_0x36a696[_0xe50d('0x37')]=_0x36a696['attributes'][_0xe50d('0x39')]?_0x36a696[_0xe50d('0x37')]:_0x8d29d1[_0xe50d('0x33')];_0x36a696[_0xe50d('0x3a')]=qs[_0xe50d('0x3b')](_0x29744d['query']['sort']);_0x36a696[_0xe50d('0x3f')]=qs[_0xe50d('0x3c')](_['pick'](_0x29744d['query'],_0x8d29d1[_0xe50d('0x3c')]));if(_0x29744d[_0xe50d('0x35')][_0xe50d('0x3e')]){_0x36a696[_0xe50d('0x3f')]=_[_0xe50d('0x40')](_0x36a696[_0xe50d('0x3f')],{'$or':_[_0xe50d('0x4c')](_0x36a696[_0xe50d('0x37')],function(_0x25c45b){var _0x2c48f5={};_0x2c48f5[_0x25c45b]={'$like':'%'+_0x29744d['query'][_0xe50d('0x3e')]+'%'};return _0x2c48f5;})});}_0x36a696=_[_0xe50d('0x40')]({},_0x36a696,_0x29744d[_0xe50d('0x43')]);return _0x2f9c3d['getDescriptions'](_0x36a696);}})['then'](function(_0x1e5fbc){if(_0x1e5fbc){_0xb7593d=_0x1e5fbc[_0xe50d('0x39')];if(!_0x29744d['query'][_0xe50d('0x50')](_0xe50d('0x51'))){_0x36a696[_0xe50d('0x26')]=qs[_0xe50d('0x26')](_0x29744d['query']['limit']);_0x36a696[_0xe50d('0x25')]=qs[_0xe50d('0x25')](_0x29744d[_0xe50d('0x35')][_0xe50d('0x25')]);}return _0x2f9c3d[_0xe50d('0x52')](_0x36a696);}})[_0xe50d('0x2b')](function(_0x6d6ad9){if(_0x6d6ad9){return _0x6d6ad9?{'count':_0xb7593d,'rows':_0x6d6ad9}:null;}})[_0xe50d('0x2b')](respondWithResult(_0x9d0327,null))['catch'](handleError(_0x9d0327,null));}; \ No newline at end of file +var _0xb036=['getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','status','end','json','count','offset','limit','apply','reject','save','update','destroy','sendStatus','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','key','VIRTUAL','field','merge','SugarcrmConfiguration','includeAll','include','findAll','rows','params','body','find','findOne','map','options','getFields','nolimit'];(function(_0x4f5036,_0xe42582){var _0x2c3171=function(_0x594fb9){while(--_0x594fb9){_0x4f5036['push'](_0x4f5036['shift']());}};_0x2c3171(++_0xe42582);}(_0xb036,0x167));var _0x6b03=function(_0x31c644,_0x4c02ae){_0x31c644=_0x31c644-0x0;var _0x2be432=_0xb036[_0x31c644];return _0x2be432;};'use strict';var pdf=require(_0x6b03('0x0'));var emlformat=require(_0x6b03('0x1'));var rimraf=require(_0x6b03('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b03('0x3'));var rp=require(_0x6b03('0x4'));var moment=require(_0x6b03('0x5'));var BPromise=require(_0x6b03('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b03('0x7'));var sox=require(_0x6b03('0x8'));var csv=require(_0x6b03('0x9'));var ejs=require(_0x6b03('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b03('0xb'));var crypto=require(_0x6b03('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6b03('0xd'));var toCsv=require(_0x6b03('0x9'));var querystring=require('querystring');var Papa=require(_0x6b03('0xe'));var Redis=require(_0x6b03('0xf'));var authService=require(_0x6b03('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6b03('0x11'));var logger=require(_0x6b03('0x12'))(_0x6b03('0x13'));var utils=require(_0x6b03('0x14'));var config=require(_0x6b03('0x15'));var db=require(_0x6b03('0x16'))['db'];var jayson=require(_0x6b03('0x17'));var client=jayson['client'][_0x6b03('0x18')]({'port':0x232a});function checkPasswordPattern(_0x34fca9,_0x241866,_0x5a0efc){if(_0x5a0efc){var _0x4ae964=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ae964[_0x6b03('0x19')](_0x241866)){return _0x34fca9;}else{throw new Error(_0x6b03('0x1a'));}}else{return _0x34fca9;}}function respondWithRpcPromise(_0x21e097,_0x436fa3,_0x1d67e0,_0x1df116){return new BPromise(function(_0x3f50c7,_0x4b1e61){var _0x34c5fa=_0x1df116||client;return _0x34c5fa['request'](_0x21e097,_0x1d67e0)[_0x6b03('0x1b')](function(_0x5109f5){logger['info'](_0x6b03('0x1c'),_0x436fa3,_0x6b03('0x1d'));logger[_0x6b03('0x1e')](_0x6b03('0x1f'),_0x436fa3,_0x6b03('0x1d'),JSON[_0x6b03('0x20')](_0x5109f5));if(_0x5109f5['error']){if(_0x5109f5['error'][_0x6b03('0x21')]===0x1f4){logger[_0x6b03('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x436fa3,_0x5109f5[_0x6b03('0x22')][_0x6b03('0x23')]);return _0x4b1e61(_0x5109f5[_0x6b03('0x22')][_0x6b03('0x23')]);}logger['error'](_0x6b03('0x1c'),_0x436fa3,_0x5109f5[_0x6b03('0x22')][_0x6b03('0x23')]);return _0x3f50c7(_0x5109f5[_0x6b03('0x22')]['message']);}else{logger[_0x6b03('0x24')](_0x6b03('0x1c'),_0x436fa3,_0x6b03('0x1d'));_0x3f50c7(_0x5109f5[_0x6b03('0x25')][_0x6b03('0x23')]);}})[_0x6b03('0x26')](function(_0x8cfd6e){logger[_0x6b03('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x436fa3,_0x8cfd6e);_0x4b1e61(_0x8cfd6e);});});}function respondWithStatusCode(_0x1062d8,_0x44e91a){_0x44e91a=_0x44e91a||0xcc;return function(_0x1ee650){if(_0x1ee650){return _0x1062d8['sendStatus'](_0x44e91a);}return _0x1062d8[_0x6b03('0x27')](_0x44e91a)[_0x6b03('0x28')]();};}function respondWithResult(_0x2f6fcd,_0x4706d6){_0x4706d6=_0x4706d6||0xc8;return function(_0x1e1582){if(_0x1e1582){return _0x2f6fcd['status'](_0x4706d6)[_0x6b03('0x29')](_0x1e1582);}};}function respondWithFilteredResult(_0x309f8e,_0x3d5a64){return function(_0x4503c4){if(_0x4503c4){var _0x328bfa=_0x4503c4[_0x6b03('0x2a')],_0xf87ddb=_0x3d5a64[_0x6b03('0x2b')],_0x21fdda=_0x3d5a64[_0x6b03('0x2b')]+_0x3d5a64[_0x6b03('0x2c')],_0x57ddc1;if(_0x21fdda>=_0x328bfa){_0x21fdda=_0x328bfa;_0x57ddc1=0xc8;}else{_0x57ddc1=0xce;}_0x309f8e['status'](_0x57ddc1);return _0x309f8e['set']('Content-Range',_0xf87ddb+'-'+_0x21fdda+'/'+_0x328bfa)[_0x6b03('0x29')](_0x4503c4);}return null;};}function patchUpdates(_0x3c90de){return function(_0x2bf8e0){try{jsonpatch[_0x6b03('0x2d')](_0x2bf8e0,_0x3c90de,!![]);}catch(_0x7e864f){return BPromise[_0x6b03('0x2e')](_0x7e864f);}return _0x2bf8e0[_0x6b03('0x2f')]();};}function saveUpdates(_0x550c3f,_0x4a380b){return function(_0x43f3b1){if(_0x43f3b1){return _0x43f3b1[_0x6b03('0x30')](_0x550c3f)['then'](function(_0x2a5891){return _0x2a5891;});}return null;};}function removeEntity(_0x125b99,_0x1a137b){return function(_0x31e099){if(_0x31e099){return _0x31e099[_0x6b03('0x31')]()[_0x6b03('0x1b')](function(){_0x125b99[_0x6b03('0x27')](0xcc)[_0x6b03('0x28')]();});}};}function handleEntityNotFound(_0xf66eb,_0xca5c59){return function(_0x262aac){if(!_0x262aac){_0xf66eb[_0x6b03('0x32')](0x194);}return _0x262aac;};}function handleError(_0x2bf858,_0x4e72d7){_0x4e72d7=_0x4e72d7||0x1f4;return function(_0x4a60ca){logger[_0x6b03('0x22')](_0x4a60ca['stack']);if(_0x4a60ca[_0x6b03('0x33')]){delete _0x4a60ca[_0x6b03('0x33')];}_0x2bf858[_0x6b03('0x27')](_0x4e72d7)['send'](_0x4a60ca);};}exports[_0x6b03('0x34')]=function(_0x3ef072,_0x225149){var _0x39a72b={},_0x479612={},_0x140825={'count':0x0,'rows':[]};var _0x46d8bc=db['SugarcrmConfiguration'][_0x6b03('0x35')];_0x479612[_0x6b03('0x36')]=_[_0x6b03('0x37')](_0x46d8bc);_0x479612[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x3ef072[_0x6b03('0x38')]);_0x479612[_0x6b03('0x39')]=_[_0x6b03('0x3a')](_0x479612[_0x6b03('0x36')],_0x479612[_0x6b03('0x38')]);_0x39a72b[_0x6b03('0x3b')]=_[_0x6b03('0x3a')](_0x479612[_0x6b03('0x36')],qs[_0x6b03('0x3c')](_0x3ef072['query']['fields']));_0x39a72b[_0x6b03('0x3b')]=_0x39a72b[_0x6b03('0x3b')][_0x6b03('0x3d')]?_0x39a72b['attributes']:_0x479612['model'];if(!_0x3ef072['query'][_0x6b03('0x3e')]('nolimit')){_0x39a72b[_0x6b03('0x2c')]=qs[_0x6b03('0x2c')](_0x3ef072[_0x6b03('0x38')][_0x6b03('0x2c')]);_0x39a72b[_0x6b03('0x2b')]=qs[_0x6b03('0x2b')](_0x3ef072['query'][_0x6b03('0x2b')]);}_0x39a72b[_0x6b03('0x3f')]=qs[_0x6b03('0x40')](_0x3ef072['query'][_0x6b03('0x40')]);_0x39a72b[_0x6b03('0x41')]=qs[_0x6b03('0x39')](_[_0x6b03('0x42')](_0x3ef072['query'],_0x479612['filters']));if(_0x3ef072[_0x6b03('0x38')][_0x6b03('0x43')]){_0x39a72b[_0x6b03('0x41')]=_['merge'](_0x39a72b[_0x6b03('0x41')],{'$or':_['map'](_0x46d8bc,function(_0x5bd2e3){if(_0x5bd2e3[_0x6b03('0x44')][_0x6b03('0x45')]!==_0x6b03('0x46')){var _0x291b97={};_0x291b97[_0x5bd2e3[_0x6b03('0x47')]]={'$like':'%'+_0x3ef072[_0x6b03('0x38')][_0x6b03('0x43')]+'%'};return _0x291b97;}})});}_0x39a72b=_[_0x6b03('0x48')]({},_0x39a72b,_0x3ef072['options']);var _0x203df0={'where':_0x39a72b[_0x6b03('0x41')]};return db[_0x6b03('0x49')][_0x6b03('0x2a')](_0x203df0)[_0x6b03('0x1b')](function(_0x4d4e3c){_0x140825[_0x6b03('0x2a')]=_0x4d4e3c;if(_0x3ef072[_0x6b03('0x38')][_0x6b03('0x4a')]){_0x39a72b[_0x6b03('0x4b')]=[{'all':!![]}];}return db[_0x6b03('0x49')][_0x6b03('0x4c')](_0x39a72b);})[_0x6b03('0x1b')](function(_0x130039){_0x140825[_0x6b03('0x4d')]=_0x130039;return _0x140825;})[_0x6b03('0x1b')](respondWithFilteredResult(_0x225149,_0x39a72b))[_0x6b03('0x26')](handleError(_0x225149,null));};exports['show']=function(_0xc14aab,_0x3dd3c6){var _0x4698f8={'raw':![],'where':{'id':_0xc14aab[_0x6b03('0x4e')]['id']}},_0x58baf3={};_0x58baf3[_0x6b03('0x36')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x58baf3[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0xc14aab[_0x6b03('0x38')]);_0x58baf3[_0x6b03('0x39')]=_[_0x6b03('0x3a')](_0x58baf3['model'],_0x58baf3[_0x6b03('0x38')]);_0x4698f8['attributes']=_[_0x6b03('0x3a')](_0x58baf3['model'],qs[_0x6b03('0x3c')](_0xc14aab['query']['fields']));_0x4698f8[_0x6b03('0x3b')]=_0x4698f8[_0x6b03('0x3b')][_0x6b03('0x3d')]?_0x4698f8[_0x6b03('0x3b')]:_0x58baf3[_0x6b03('0x36')];if(_0xc14aab[_0x6b03('0x38')][_0x6b03('0x4a')]){_0x4698f8[_0x6b03('0x4b')]=[{'all':!![]}];}_0x4698f8=_['merge']({},_0x4698f8,_0xc14aab['options']);return db[_0x6b03('0x49')]['find'](_0x4698f8)[_0x6b03('0x1b')](handleEntityNotFound(_0x3dd3c6,null))[_0x6b03('0x1b')](respondWithResult(_0x3dd3c6,null))[_0x6b03('0x26')](handleError(_0x3dd3c6,null));};exports['create']=function(_0x2057ab,_0x1bdb48){return db[_0x6b03('0x49')]['create'](_0x2057ab[_0x6b03('0x4f')],{})[_0x6b03('0x1b')](respondWithResult(_0x1bdb48,0xc9))[_0x6b03('0x26')](handleError(_0x1bdb48,null));};exports['update']=function(_0x1cdc3b,_0x164849){if(_0x1cdc3b[_0x6b03('0x4f')]['id']){delete _0x1cdc3b[_0x6b03('0x4f')]['id'];}return db[_0x6b03('0x49')][_0x6b03('0x50')]({'where':{'id':_0x1cdc3b[_0x6b03('0x4e')]['id']}})[_0x6b03('0x1b')](handleEntityNotFound(_0x164849,null))[_0x6b03('0x1b')](saveUpdates(_0x1cdc3b[_0x6b03('0x4f')],null))[_0x6b03('0x1b')](respondWithResult(_0x164849,null))[_0x6b03('0x26')](handleError(_0x164849,null));};exports['destroy']=function(_0x1a8417,_0x2d7060){return db[_0x6b03('0x49')]['find']({'where':{'id':_0x1a8417['params']['id']}})[_0x6b03('0x1b')](handleEntityNotFound(_0x2d7060,null))[_0x6b03('0x1b')](removeEntity(_0x2d7060,null))[_0x6b03('0x26')](handleError(_0x2d7060,null));};exports['getFields']=function(_0x1f3053,_0x501bac,_0x2b4611){var _0x11f14b={};var _0x2cd372={};var _0x1694e6;var _0x3bd4b1;return db['SugarcrmConfiguration'][_0x6b03('0x51')]({'where':{'id':_0x1f3053[_0x6b03('0x4e')]['id']}})[_0x6b03('0x1b')](handleEntityNotFound(_0x501bac,null))[_0x6b03('0x1b')](function(_0x2155ae){if(_0x2155ae){_0x1694e6=_0x2155ae;_0x2cd372[_0x6b03('0x36')]=_[_0x6b03('0x37')](db['SugarcrmField'][_0x6b03('0x35')]);_0x2cd372[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x1f3053[_0x6b03('0x38')]);_0x2cd372['filters']=_['intersection'](_0x2cd372[_0x6b03('0x36')],_0x2cd372[_0x6b03('0x38')]);_0x11f14b[_0x6b03('0x3b')]=_[_0x6b03('0x3a')](_0x2cd372['model'],qs['fields'](_0x1f3053[_0x6b03('0x38')][_0x6b03('0x3c')]));_0x11f14b[_0x6b03('0x3b')]=_0x11f14b[_0x6b03('0x3b')]['length']?_0x11f14b[_0x6b03('0x3b')]:_0x2cd372[_0x6b03('0x36')];_0x11f14b['order']=qs[_0x6b03('0x40')](_0x1f3053[_0x6b03('0x38')][_0x6b03('0x40')]);_0x11f14b[_0x6b03('0x41')]=qs[_0x6b03('0x39')](_[_0x6b03('0x42')](_0x1f3053[_0x6b03('0x38')],_0x2cd372[_0x6b03('0x39')]));if(_0x1f3053[_0x6b03('0x38')]['filter']){_0x11f14b['where']=_['merge'](_0x11f14b[_0x6b03('0x41')],{'$or':_[_0x6b03('0x52')](_0x11f14b[_0x6b03('0x3b')],function(_0x135bfa){var _0x9acca9={};_0x9acca9[_0x135bfa]={'$like':'%'+_0x1f3053['query'][_0x6b03('0x43')]+'%'};return _0x9acca9;})});}_0x11f14b=_[_0x6b03('0x48')]({},_0x11f14b,_0x1f3053[_0x6b03('0x53')]);return _0x1694e6[_0x6b03('0x54')](_0x11f14b);}})[_0x6b03('0x1b')](function(_0x14fdcc){if(_0x14fdcc){_0x3bd4b1=_0x14fdcc[_0x6b03('0x3d')];if(!_0x1f3053['query']['hasOwnProperty'](_0x6b03('0x55'))){_0x11f14b[_0x6b03('0x2c')]=qs[_0x6b03('0x2c')](_0x1f3053[_0x6b03('0x38')][_0x6b03('0x2c')]);_0x11f14b[_0x6b03('0x2b')]=qs[_0x6b03('0x2b')](_0x1f3053[_0x6b03('0x38')][_0x6b03('0x2b')]);}return _0x1694e6[_0x6b03('0x54')](_0x11f14b);}})[_0x6b03('0x1b')](function(_0x5d2421){if(_0x5d2421){return _0x5d2421?{'count':_0x3bd4b1,'rows':_0x5d2421}:null;}})[_0x6b03('0x1b')](respondWithResult(_0x501bac,null))[_0x6b03('0x26')](handleError(_0x501bac,null));};exports[_0x6b03('0x56')]=function(_0x4e7c36,_0x490c25,_0x381c8e){var _0x5b41af={};var _0x29fa36={};var _0x10f564;var _0x266009;return db[_0x6b03('0x49')][_0x6b03('0x51')]({'where':{'id':_0x4e7c36['params']['id']}})['then'](handleEntityNotFound(_0x490c25,null))[_0x6b03('0x1b')](function(_0x2f878a){if(_0x2f878a){_0x10f564=_0x2f878a;_0x29fa36[_0x6b03('0x36')]=_[_0x6b03('0x37')](db[_0x6b03('0x57')][_0x6b03('0x35')]);_0x29fa36[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x4e7c36['query']);_0x29fa36[_0x6b03('0x39')]=_[_0x6b03('0x3a')](_0x29fa36[_0x6b03('0x36')],_0x29fa36[_0x6b03('0x38')]);_0x5b41af[_0x6b03('0x3b')]=_['intersection'](_0x29fa36[_0x6b03('0x36')],qs[_0x6b03('0x3c')](_0x4e7c36[_0x6b03('0x38')][_0x6b03('0x3c')]));_0x5b41af[_0x6b03('0x3b')]=_0x5b41af['attributes']['length']?_0x5b41af['attributes']:_0x29fa36[_0x6b03('0x36')];_0x5b41af[_0x6b03('0x3f')]=qs[_0x6b03('0x40')](_0x4e7c36[_0x6b03('0x38')]['sort']);_0x5b41af['where']=qs[_0x6b03('0x39')](_[_0x6b03('0x42')](_0x4e7c36[_0x6b03('0x38')],_0x29fa36[_0x6b03('0x39')]));if(_0x4e7c36[_0x6b03('0x38')][_0x6b03('0x43')]){_0x5b41af[_0x6b03('0x41')]=_[_0x6b03('0x48')](_0x5b41af['where'],{'$or':_['map'](_0x5b41af[_0x6b03('0x3b')],function(_0x118b13){var _0x1694c4={};_0x1694c4[_0x118b13]={'$like':'%'+_0x4e7c36[_0x6b03('0x38')]['filter']+'%'};return _0x1694c4;})});}_0x5b41af=_['merge']({},_0x5b41af,_0x4e7c36[_0x6b03('0x53')]);return _0x10f564['getSubjects'](_0x5b41af);}})['then'](function(_0x2e81de){if(_0x2e81de){_0x266009=_0x2e81de['length'];if(!_0x4e7c36[_0x6b03('0x38')][_0x6b03('0x3e')](_0x6b03('0x55'))){_0x5b41af['limit']=qs[_0x6b03('0x2c')](_0x4e7c36[_0x6b03('0x38')]['limit']);_0x5b41af[_0x6b03('0x2b')]=qs[_0x6b03('0x2b')](_0x4e7c36[_0x6b03('0x38')]['offset']);}return _0x10f564['getSubjects'](_0x5b41af);}})[_0x6b03('0x1b')](function(_0x45a7fb){if(_0x45a7fb){return _0x45a7fb?{'count':_0x266009,'rows':_0x45a7fb}:null;}})[_0x6b03('0x1b')](respondWithResult(_0x490c25,null))[_0x6b03('0x26')](handleError(_0x490c25,null));};exports['getDescriptions']=function(_0x1d1ef4,_0xb936fa,_0x10cef4){var _0x3e37c1={};var _0x2710c3={};var _0x415af9;var _0x59395e;return db[_0x6b03('0x49')][_0x6b03('0x51')]({'where':{'id':_0x1d1ef4[_0x6b03('0x4e')]['id']}})[_0x6b03('0x1b')](handleEntityNotFound(_0xb936fa,null))[_0x6b03('0x1b')](function(_0x3d24bd){if(_0x3d24bd){_0x415af9=_0x3d24bd;_0x2710c3[_0x6b03('0x36')]=_[_0x6b03('0x37')](db[_0x6b03('0x57')]['rawAttributes']);_0x2710c3[_0x6b03('0x38')]=_[_0x6b03('0x37')](_0x1d1ef4[_0x6b03('0x38')]);_0x2710c3[_0x6b03('0x39')]=_[_0x6b03('0x3a')](_0x2710c3[_0x6b03('0x36')],_0x2710c3[_0x6b03('0x38')]);_0x3e37c1[_0x6b03('0x3b')]=_[_0x6b03('0x3a')](_0x2710c3['model'],qs[_0x6b03('0x3c')](_0x1d1ef4[_0x6b03('0x38')][_0x6b03('0x3c')]));_0x3e37c1[_0x6b03('0x3b')]=_0x3e37c1[_0x6b03('0x3b')][_0x6b03('0x3d')]?_0x3e37c1[_0x6b03('0x3b')]:_0x2710c3['model'];_0x3e37c1[_0x6b03('0x3f')]=qs[_0x6b03('0x40')](_0x1d1ef4['query']['sort']);_0x3e37c1['where']=qs[_0x6b03('0x39')](_[_0x6b03('0x42')](_0x1d1ef4[_0x6b03('0x38')],_0x2710c3[_0x6b03('0x39')]));if(_0x1d1ef4['query'][_0x6b03('0x43')]){_0x3e37c1[_0x6b03('0x41')]=_[_0x6b03('0x48')](_0x3e37c1[_0x6b03('0x41')],{'$or':_['map'](_0x3e37c1[_0x6b03('0x3b')],function(_0x2f97e7){var _0x1756ec={};_0x1756ec[_0x2f97e7]={'$like':'%'+_0x1d1ef4[_0x6b03('0x38')][_0x6b03('0x43')]+'%'};return _0x1756ec;})});}_0x3e37c1=_['merge']({},_0x3e37c1,_0x1d1ef4[_0x6b03('0x53')]);return _0x415af9[_0x6b03('0x58')](_0x3e37c1);}})['then'](function(_0x1e5244){if(_0x1e5244){_0x59395e=_0x1e5244[_0x6b03('0x3d')];if(!_0x1d1ef4['query'][_0x6b03('0x3e')]('nolimit')){_0x3e37c1[_0x6b03('0x2c')]=qs[_0x6b03('0x2c')](_0x1d1ef4[_0x6b03('0x38')][_0x6b03('0x2c')]);_0x3e37c1['offset']=qs[_0x6b03('0x2b')](_0x1d1ef4['query'][_0x6b03('0x2b')]);}return _0x415af9['getDescriptions'](_0x3e37c1);}})[_0x6b03('0x1b')](function(_0x3e4eb5){if(_0x3e4eb5){return _0x3e4eb5?{'count':_0x59395e,'rows':_0x3e4eb5}:null;}})[_0x6b03('0x1b')](respondWithResult(_0xb936fa,null))[_0x6b03('0x26')](handleError(_0xb936fa,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 250c28f..63bda5d 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 _0x8039=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','api','moment','path','rimraf'];(function(_0x246c1a,_0x596d45){var _0x4cee0d=function(_0x332317){while(--_0x332317){_0x246c1a['push'](_0x246c1a['shift']());}};_0x4cee0d(++_0x596d45);}(_0x8039,0x1bd));var _0x9803=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x8039[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0x9803('0x0'));var util=require(_0x9803('0x1'));var logger=require('../../config/logger')(_0x9803('0x2'));var moment=require(_0x9803('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9803('0x4'));var rimraf=require(_0x9803('0x5'));var config=require(_0x9803('0x6'));var attributes=require(_0x9803('0x7'));module[_0x9803('0x8')]=function(_0x5bdb00,_0x57a9e5){return _0x5bdb00[_0x9803('0x9')](_0x9803('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f93=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x304bec,_0xbec8df){var _0x23db01=function(_0x1ded94){while(--_0x1ded94){_0x304bec['push'](_0x304bec['shift']());}};_0x23db01(++_0xbec8df);}(_0x6f93,0x78));var _0x36f9=function(_0x5a207f,_0x6b012b){_0x5a207f=_0x5a207f-0x0;var _0x12c799=_0x6f93[_0x5a207f];return _0x12c799;};'use strict';var _=require(_0x36f9('0x0'));var util=require('util');var logger=require(_0x36f9('0x1'))(_0x36f9('0x2'));var moment=require(_0x36f9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f9('0x4'));var rimraf=require(_0x36f9('0x5'));var config=require('../../config/environment');var attributes=require(_0x36f9('0x6'));module[_0x36f9('0x7')]=function(_0x3127f7,_0x5ef839){return _0x3127f7['define'](_0x36f9('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 67487a5..63df014 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 _0xbf15=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf15,0xec));var _0x5bf1=function(_0x4bb8e4,_0xc37658){_0x4bb8e4=_0x4bb8e4-0x0;var _0x4eaca0=_0xbf15[_0x4bb8e4];return _0x4eaca0;};'use strict';var _=require(_0x5bf1('0x0'));var util=require(_0x5bf1('0x1'));var moment=require('moment');var BPromise=require(_0x5bf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bf1('0x3'));var db=require(_0x5bf1('0x4'))['db'];var utils=require(_0x5bf1('0x5'));var logger=require(_0x5bf1('0x6'))(_0x5bf1('0x7'));var config=require(_0x5bf1('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e88e0,_0x4fd981,_0x25b4a3){return new BPromise(function(_0x572df8,_0x49d567){return client[_0x5bf1('0x9')](_0x2e88e0,_0x25b4a3)[_0x5bf1('0xa')](function(_0x586879){logger[_0x5bf1('0xb')](_0x5bf1('0xc'),_0x4fd981,'request\x20sent');logger['debug'](_0x5bf1('0xd'),_0x4fd981,_0x5bf1('0xe'),JSON[_0x5bf1('0xf')](_0x586879));if(_0x586879[_0x5bf1('0x10')]){if(_0x586879['error'][_0x5bf1('0x11')]===0x1f4){logger[_0x5bf1('0x10')](_0x5bf1('0xc'),_0x4fd981,_0x586879[_0x5bf1('0x10')][_0x5bf1('0x12')]);return _0x49d567(_0x586879[_0x5bf1('0x10')]['message']);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4fd981,_0x586879[_0x5bf1('0x10')][_0x5bf1('0x12')]);return _0x572df8(_0x586879[_0x5bf1('0x10')][_0x5bf1('0x12')]);}else{logger[_0x5bf1('0xb')](_0x5bf1('0xc'),_0x4fd981,_0x5bf1('0xe'));_0x572df8(_0x586879[_0x5bf1('0x13')][_0x5bf1('0x12')]);}})[_0x5bf1('0x14')](function(_0x10921f){logger['error'](_0x5bf1('0xc'),_0x4fd981,_0x10921f);_0x49d567(_0x10921f);});});} \ No newline at end of file +var _0x4996=['http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47543d,_0xcd7c7d){var _0x392bd4=function(_0x233d4c){while(--_0x233d4c){_0x47543d['push'](_0x47543d['shift']());}};_0x392bd4(++_0xcd7c7d);}(_0x4996,0x109));var _0x6499=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0x4996[_0x1af8d3];return _0x3a50c5;};'use strict';var _=require('lodash');var util=require(_0x6499('0x0'));var moment=require(_0x6499('0x1'));var BPromise=require(_0x6499('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6499('0x3'));var db=require(_0x6499('0x4'))['db'];var utils=require(_0x6499('0x5'));var logger=require(_0x6499('0x6'))(_0x6499('0x7'));var config=require(_0x6499('0x8'));var jayson=require(_0x6499('0x9'));var client=jayson[_0x6499('0xa')][_0x6499('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x284c32,_0x415a53,_0x3d6594){return new BPromise(function(_0x4d0a57,_0x2d6d8e){return client[_0x6499('0xc')](_0x284c32,_0x3d6594)[_0x6499('0xd')](function(_0x1959b9){logger[_0x6499('0xe')](_0x6499('0xf'),_0x415a53,_0x6499('0x10'));logger[_0x6499('0x11')](_0x6499('0x12'),_0x415a53,'request\x20sent',JSON[_0x6499('0x13')](_0x1959b9));if(_0x1959b9[_0x6499('0x14')]){if(_0x1959b9[_0x6499('0x14')]['code']===0x1f4){logger[_0x6499('0x14')](_0x6499('0xf'),_0x415a53,_0x1959b9[_0x6499('0x14')]['message']);return _0x2d6d8e(_0x1959b9[_0x6499('0x14')][_0x6499('0x15')]);}logger[_0x6499('0x14')](_0x6499('0xf'),_0x415a53,_0x1959b9[_0x6499('0x14')][_0x6499('0x15')]);return _0x4d0a57(_0x1959b9['error']['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x415a53,'request\x20sent');_0x4d0a57(_0x1959b9['result'][_0x6499('0x15')]);}})[_0x6499('0x16')](function(_0x3e5ae9){logger[_0x6499('0x14')](_0x6499('0xf'),_0x415a53,_0x3e5ae9);_0x2d6d8e(_0x3e5ae9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9bf1fda..3756228 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 _0x37ef=['multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x37ef,0x1d0));var _0xf37e=function(_0x7598c2,_0x3e0d4a){_0x7598c2=_0x7598c2-0x0;var _0x72ad3d=_0x37ef[_0x7598c2];return _0x72ad3d;};'use strict';var multer=require(_0xf37e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf37e('0x1'));var express=require(_0xf37e('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf37e('0x3'));var config=require(_0xf37e('0x4'));var controller=require(_0xf37e('0x5'));router[_0xf37e('0x6')]('/',auth[_0xf37e('0x7')](),controller[_0xf37e('0x8')]);router[_0xf37e('0x6')](_0xf37e('0x9'),auth[_0xf37e('0x7')](),controller[_0xf37e('0xa')]);router[_0xf37e('0xb')]('/',auth['isAuthenticated'](),controller[_0xf37e('0xc')]);router['put'](_0xf37e('0x9'),auth[_0xf37e('0x7')](),controller[_0xf37e('0xd')]);router[_0xf37e('0xe')](_0xf37e('0x9'),auth[_0xf37e('0x7')](),controller[_0xf37e('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3310=['Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','isAuthenticated','show','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4fb34f,_0x1a95cf){var _0x1d4726=function(_0x158f05){while(--_0x158f05){_0x4fb34f['push'](_0x4fb34f['shift']());}};_0x1d4726(++_0x1a95cf);}(_0x3310,0x1d0));var _0x0331=function(_0x42252c,_0x2f8684){_0x42252c=_0x42252c-0x0;var _0x41428a=_0x3310[_0x42252c];return _0x41428a;};'use strict';var multer=require(_0x0331('0x0'));var util=require(_0x0331('0x1'));var path=require('path');var timeout=require(_0x0331('0x2'));var express=require(_0x0331('0x3'));var router=express[_0x0331('0x4')]();var auth=require(_0x0331('0x5'));var interaction=require(_0x0331('0x6'));var config=require('../../config/environment');var controller=require(_0x0331('0x7'));router[_0x0331('0x8')]('/',auth['isAuthenticated'](),controller[_0x0331('0x9')]);router[_0x0331('0x8')]('/:id',auth[_0x0331('0xa')](),controller[_0x0331('0xb')]);router['post']('/',auth[_0x0331('0xa')](),controller[_0x0331('0xc')]);router[_0x0331('0xd')]('/:id',auth[_0x0331('0xa')](),controller[_0x0331('0xe')]);router['delete'](_0x0331('0xf'),auth['isAuthenticated'](),controller[_0x0331('0x10')]);module[_0x0331('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 486af40..23d911b 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 _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x1f7baf,_0x2a7fe8){var _0x239696=function(_0x59460a){while(--_0x59460a){_0x1f7baf['push'](_0x1f7baf['shift']());}};_0x239696(++_0x2a7fe8);}(_0x22fb,0x192));var _0xb22f=function(_0xaeafbc,_0x4b59aa){_0xaeafbc=_0xaeafbc-0x0;var _0x1d6ffa=_0x22fb[_0xaeafbc];return _0x1d6ffa;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file +var _0xe706=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x336082,_0x5c364b){var _0x2ea2eb=function(_0x4c6c53){while(--_0x4c6c53){_0x336082['push'](_0x336082['shift']());}};_0x2ea2eb(++_0x5c364b);}(_0xe706,0xa3));var _0x6e70=function(_0x321d5e,_0x1ae4a9){_0x321d5e=_0x321d5e-0x0;var _0x3458cd=_0xe706[_0x321d5e];return _0x3458cd;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'type':{'type':Sequelize[_0x6e70('0x2')]('string',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x6')},'content':{'type':Sequelize[_0x6e70('0x7')]},'key':{'type':Sequelize[_0x6e70('0x7')]},'keyType':{'type':Sequelize[_0x6e70('0x2')](_0x6e70('0x6'),_0x6e70('0x3'),_0x6e70('0x4'))},'keyContent':{'type':Sequelize[_0x6e70('0x7')]},'idField':{'type':Sequelize[_0x6e70('0x7')]},'nameField':{'type':Sequelize[_0x6e70('0x7')]},'customField':{'type':Sequelize[_0x6e70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e70('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index b2ba340..802cb41 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 _0x5edb=['save','update','then','destroy','stack','name','send','index','SugarcrmField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','count','includeAll','include','findAll','catch','show','options','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','set','apply'];(function(_0x44d64d,_0x3b5380){var _0x2e7908=function(_0x2b634c){while(--_0x2b634c){_0x44d64d['push'](_0x44d64d['shift']());}};_0x2e7908(++_0x3b5380);}(_0x5edb,0xb5));var _0xb5ed=function(_0x456c88,_0x37819e){_0x456c88=_0x456c88-0x0;var _0x35d0a4=_0x5edb[_0x456c88];return _0x35d0a4;};'use strict';var pdf=require(_0xb5ed('0x0'));var emlformat=require(_0xb5ed('0x1'));var rimraf=require(_0xb5ed('0x2'));var zipdir=require(_0xb5ed('0x3'));var jsonpatch=require(_0xb5ed('0x4'));var rp=require(_0xb5ed('0x5'));var moment=require(_0xb5ed('0x6'));var BPromise=require(_0xb5ed('0x7'));var Mustache=require(_0xb5ed('0x8'));var util=require(_0xb5ed('0x9'));var path=require('path');var sox=require(_0xb5ed('0xa'));var csv=require(_0xb5ed('0xb'));var ejs=require(_0xb5ed('0xc'));var fs=require('fs');var _=require(_0xb5ed('0xd'));var squel=require('squel');var crypto=require(_0xb5ed('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb5ed('0xb'));var querystring=require('querystring');var Papa=require(_0xb5ed('0xf'));var Redis=require(_0xb5ed('0x10'));var authService=require(_0xb5ed('0x11'));var qs=require(_0xb5ed('0x12'));var hardwareService=require(_0xb5ed('0x13'));var logger=require(_0xb5ed('0x14'))(_0xb5ed('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa49322,_0x4b8f8d){_0x4b8f8d=_0x4b8f8d||0xcc;return function(_0x498e6d){if(_0x498e6d){return _0xa49322[_0xb5ed('0x16')](_0x4b8f8d);}return _0xa49322[_0xb5ed('0x17')](_0x4b8f8d)[_0xb5ed('0x18')]();};}function respondWithResult(_0x599500,_0x67028){_0x67028=_0x67028||0xc8;return function(_0x1f5759){if(_0x1f5759){return _0x599500['status'](_0x67028)[_0xb5ed('0x19')](_0x1f5759);}};}function respondWithFilteredResult(_0x2d5141,_0x410acc){return function(_0x514c8c){if(_0x514c8c){var _0x49637a=_0x514c8c['count'],_0x1929a0=_0x410acc['offset'],_0xd0fb14=_0x410acc[_0xb5ed('0x1a')]+_0x410acc['limit'],_0x2c85fa;if(_0xd0fb14>=_0x49637a){_0xd0fb14=_0x49637a;_0x2c85fa=0xc8;}else{_0x2c85fa=0xce;}_0x2d5141['status'](_0x2c85fa);return _0x2d5141[_0xb5ed('0x1b')]('Content-Range',_0x1929a0+'-'+_0xd0fb14+'/'+_0x49637a)[_0xb5ed('0x19')](_0x514c8c);}return null;};}function patchUpdates(_0x53bb9c){return function(_0x4d2752){try{jsonpatch[_0xb5ed('0x1c')](_0x4d2752,_0x53bb9c,!![]);}catch(_0x389ad1){return BPromise['reject'](_0x389ad1);}return _0x4d2752[_0xb5ed('0x1d')]();};}function saveUpdates(_0x338ac5,_0x575237){return function(_0x50a1ee){if(_0x50a1ee){return _0x50a1ee[_0xb5ed('0x1e')](_0x338ac5)[_0xb5ed('0x1f')](function(_0x499f9c){return _0x499f9c;});}return null;};}function removeEntity(_0x4ddc66,_0x367c6f){return function(_0x119c8b){if(_0x119c8b){return _0x119c8b[_0xb5ed('0x20')]()[_0xb5ed('0x1f')](function(){_0x4ddc66[_0xb5ed('0x17')](0xcc)[_0xb5ed('0x18')]();});}};}function handleEntityNotFound(_0x550961,_0x4c731a){return function(_0x35d585){if(!_0x35d585){_0x550961[_0xb5ed('0x16')](0x194);}return _0x35d585;};}function handleError(_0x52b2c7,_0x4846ab){_0x4846ab=_0x4846ab||0x1f4;return function(_0x53a52e){logger['error'](_0x53a52e[_0xb5ed('0x21')]);if(_0x53a52e[_0xb5ed('0x22')]){delete _0x53a52e[_0xb5ed('0x22')];}_0x52b2c7['status'](_0x4846ab)[_0xb5ed('0x23')](_0x53a52e);};}exports[_0xb5ed('0x24')]=function(_0x1de5e5,_0x24cda8){var _0x2f25fe={},_0x5ceaee={},_0x25b46a={'count':0x0,'rows':[]};var _0x206f50=db[_0xb5ed('0x25')][_0xb5ed('0x26')];_0x5ceaee['model']=_[_0xb5ed('0x27')](_0x206f50);_0x5ceaee[_0xb5ed('0x28')]=_['keys'](_0x1de5e5['query']);_0x5ceaee[_0xb5ed('0x29')]=_[_0xb5ed('0x2a')](_0x5ceaee[_0xb5ed('0x2b')],_0x5ceaee[_0xb5ed('0x28')]);_0x2f25fe[_0xb5ed('0x2c')]=_[_0xb5ed('0x2a')](_0x5ceaee[_0xb5ed('0x2b')],qs[_0xb5ed('0x2d')](_0x1de5e5[_0xb5ed('0x28')][_0xb5ed('0x2d')]));_0x2f25fe[_0xb5ed('0x2c')]=_0x2f25fe[_0xb5ed('0x2c')][_0xb5ed('0x2e')]?_0x2f25fe[_0xb5ed('0x2c')]:_0x5ceaee[_0xb5ed('0x2b')];if(!_0x1de5e5['query'][_0xb5ed('0x2f')](_0xb5ed('0x30'))){_0x2f25fe[_0xb5ed('0x31')]=qs[_0xb5ed('0x31')](_0x1de5e5['query'][_0xb5ed('0x31')]);_0x2f25fe[_0xb5ed('0x1a')]=qs[_0xb5ed('0x1a')](_0x1de5e5['query'][_0xb5ed('0x1a')]);}_0x2f25fe[_0xb5ed('0x32')]=qs['sort'](_0x1de5e5['query'][_0xb5ed('0x33')]);_0x2f25fe[_0xb5ed('0x34')]=qs[_0xb5ed('0x29')](_[_0xb5ed('0x35')](_0x1de5e5[_0xb5ed('0x28')],_0x5ceaee[_0xb5ed('0x29')]));if(_0x1de5e5[_0xb5ed('0x28')][_0xb5ed('0x36')]){_0x2f25fe[_0xb5ed('0x34')]=_[_0xb5ed('0x37')](_0x2f25fe['where'],{'$or':_[_0xb5ed('0x38')](_0x206f50,function(_0x1dda50){if(_0x1dda50[_0xb5ed('0x39')]['key']!==_0xb5ed('0x3a')){var _0xde2355={};_0xde2355[_0x1dda50['field']]={'$like':'%'+_0x1de5e5[_0xb5ed('0x28')][_0xb5ed('0x36')]+'%'};return _0xde2355;}})});}_0x2f25fe=_[_0xb5ed('0x37')]({},_0x2f25fe,_0x1de5e5['options']);var _0x362e70={'where':_0x2f25fe[_0xb5ed('0x34')]};return db['SugarcrmField'][_0xb5ed('0x3b')](_0x362e70)['then'](function(_0x230e2d){_0x25b46a[_0xb5ed('0x3b')]=_0x230e2d;if(_0x1de5e5[_0xb5ed('0x28')][_0xb5ed('0x3c')]){_0x2f25fe[_0xb5ed('0x3d')]=[{'all':!![]}];}return db[_0xb5ed('0x25')][_0xb5ed('0x3e')](_0x2f25fe);})[_0xb5ed('0x1f')](function(_0x36c62e){_0x25b46a['rows']=_0x36c62e;return _0x25b46a;})[_0xb5ed('0x1f')](respondWithFilteredResult(_0x24cda8,_0x2f25fe))[_0xb5ed('0x3f')](handleError(_0x24cda8,null));};exports[_0xb5ed('0x40')]=function(_0x24807b,_0x20299b){var _0x2d6594={'raw':!![],'where':{'id':_0x24807b['params']['id']}},_0x34bd97={};_0x34bd97[_0xb5ed('0x2b')]=_[_0xb5ed('0x27')](db[_0xb5ed('0x25')]['rawAttributes']);_0x34bd97[_0xb5ed('0x28')]=_[_0xb5ed('0x27')](_0x24807b[_0xb5ed('0x28')]);_0x34bd97[_0xb5ed('0x29')]=_['intersection'](_0x34bd97[_0xb5ed('0x2b')],_0x34bd97[_0xb5ed('0x28')]);_0x2d6594[_0xb5ed('0x2c')]=_[_0xb5ed('0x2a')](_0x34bd97[_0xb5ed('0x2b')],qs['fields'](_0x24807b[_0xb5ed('0x28')][_0xb5ed('0x2d')]));_0x2d6594[_0xb5ed('0x2c')]=_0x2d6594['attributes'][_0xb5ed('0x2e')]?_0x2d6594[_0xb5ed('0x2c')]:_0x34bd97['model'];if(_0x24807b['query'][_0xb5ed('0x3c')]){_0x2d6594['include']=[{'all':!![]}];}_0x2d6594=_[_0xb5ed('0x37')]({},_0x2d6594,_0x24807b[_0xb5ed('0x41')]);return db[_0xb5ed('0x25')]['find'](_0x2d6594)[_0xb5ed('0x1f')](handleEntityNotFound(_0x20299b,null))['then'](respondWithResult(_0x20299b,null))[_0xb5ed('0x3f')](handleError(_0x20299b,null));};exports['create']=function(_0x16588f,_0x409532){return db['SugarcrmField'][_0xb5ed('0x42')](_0x16588f[_0xb5ed('0x43')],{})[_0xb5ed('0x1f')](respondWithResult(_0x409532,0xc9))[_0xb5ed('0x3f')](handleError(_0x409532,null));};exports['update']=function(_0x464bc3,_0x2209df){if(_0x464bc3[_0xb5ed('0x43')]['id']){delete _0x464bc3[_0xb5ed('0x43')]['id'];}return db[_0xb5ed('0x25')][_0xb5ed('0x44')]({'where':{'id':_0x464bc3[_0xb5ed('0x45')]['id']}})['then'](handleEntityNotFound(_0x2209df,null))[_0xb5ed('0x1f')](saveUpdates(_0x464bc3[_0xb5ed('0x43')],null))[_0xb5ed('0x1f')](respondWithResult(_0x2209df,null))[_0xb5ed('0x3f')](handleError(_0x2209df,null));};exports[_0xb5ed('0x20')]=function(_0x5504a4,_0x1de1bf){return db[_0xb5ed('0x25')]['find']({'where':{'id':_0x5504a4[_0xb5ed('0x45')]['id']}})[_0xb5ed('0x1f')](handleEntityNotFound(_0x1de1bf,null))[_0xb5ed('0x1f')](removeEntity(_0x1de1bf,null))[_0xb5ed('0x3f')](handleError(_0x1de1bf,null));}; \ No newline at end of file +var _0x58dc=['set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','SugarcrmField','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','field','findAll','catch','show','includeAll','include','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x58dc,0x104));var _0xc58d=function(_0x4e30d4,_0x40470f){_0x4e30d4=_0x4e30d4-0x0;var _0x32c506=_0x58dc[_0x4e30d4];return _0x32c506;};'use strict';var pdf=require(_0xc58d('0x0'));var emlformat=require(_0xc58d('0x1'));var rimraf=require(_0xc58d('0x2'));var zipdir=require(_0xc58d('0x3'));var jsonpatch=require(_0xc58d('0x4'));var rp=require(_0xc58d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc58d('0x6'));var sox=require(_0xc58d('0x7'));var csv=require(_0xc58d('0x8'));var ejs=require(_0xc58d('0x9'));var fs=require('fs');var _=require(_0xc58d('0xa'));var squel=require(_0xc58d('0xb'));var crypto=require('crypto');var jsforce=require(_0xc58d('0xc'));var deskjs=require(_0xc58d('0xd'));var toCsv=require(_0xc58d('0x8'));var querystring=require(_0xc58d('0xe'));var Papa=require(_0xc58d('0xf'));var Redis=require(_0xc58d('0x10'));var authService=require(_0xc58d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc58d('0x12'));var logger=require('../../config/logger')(_0xc58d('0x13'));var utils=require(_0xc58d('0x14'));var config=require('../../config/environment');var db=require(_0xc58d('0x15'))['db'];function respondWithStatusCode(_0x401107,_0x2d5f49){_0x2d5f49=_0x2d5f49||0xcc;return function(_0x124196){if(_0x124196){return _0x401107['sendStatus'](_0x2d5f49);}return _0x401107[_0xc58d('0x16')](_0x2d5f49)[_0xc58d('0x17')]();};}function respondWithResult(_0x43f20f,_0x575954){_0x575954=_0x575954||0xc8;return function(_0x4fd1ca){if(_0x4fd1ca){return _0x43f20f[_0xc58d('0x16')](_0x575954)[_0xc58d('0x18')](_0x4fd1ca);}};}function respondWithFilteredResult(_0x45b8e9,_0xfc7fa1){return function(_0xc6ae23){if(_0xc6ae23){var _0x3911c0=_0xc6ae23[_0xc58d('0x19')],_0x52551f=_0xfc7fa1[_0xc58d('0x1a')],_0x59f866=_0xfc7fa1['offset']+_0xfc7fa1[_0xc58d('0x1b')],_0x1053aa;if(_0x59f866>=_0x3911c0){_0x59f866=_0x3911c0;_0x1053aa=0xc8;}else{_0x1053aa=0xce;}_0x45b8e9[_0xc58d('0x16')](_0x1053aa);return _0x45b8e9[_0xc58d('0x1c')](_0xc58d('0x1d'),_0x52551f+'-'+_0x59f866+'/'+_0x3911c0)[_0xc58d('0x18')](_0xc6ae23);}return null;};}function patchUpdates(_0xff1384){return function(_0x307441){try{jsonpatch[_0xc58d('0x1e')](_0x307441,_0xff1384,!![]);}catch(_0x1d0265){return BPromise[_0xc58d('0x1f')](_0x1d0265);}return _0x307441[_0xc58d('0x20')]();};}function saveUpdates(_0x951d31,_0x219fae){return function(_0x377d8b){if(_0x377d8b){return _0x377d8b[_0xc58d('0x21')](_0x951d31)[_0xc58d('0x22')](function(_0x1b215d){return _0x1b215d;});}return null;};}function removeEntity(_0x436c0c,_0x27fe71){return function(_0x3e615e){if(_0x3e615e){return _0x3e615e[_0xc58d('0x23')]()[_0xc58d('0x22')](function(){_0x436c0c[_0xc58d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x181eac,_0xca9c7b){return function(_0x27dda1){if(!_0x27dda1){_0x181eac[_0xc58d('0x24')](0x194);}return _0x27dda1;};}function handleError(_0x148e39,_0x2f1afc){_0x2f1afc=_0x2f1afc||0x1f4;return function(_0x4e4d3b){logger[_0xc58d('0x25')](_0x4e4d3b[_0xc58d('0x26')]);if(_0x4e4d3b['name']){delete _0x4e4d3b['name'];}_0x148e39['status'](_0x2f1afc)[_0xc58d('0x27')](_0x4e4d3b);};}exports[_0xc58d('0x28')]=function(_0x184922,_0x43603b){var _0x9207c5={},_0x32a46d={},_0x14a32d={'count':0x0,'rows':[]};var _0x412731=db[_0xc58d('0x29')][_0xc58d('0x2a')];_0x32a46d[_0xc58d('0x2b')]=_[_0xc58d('0x2c')](_0x412731);_0x32a46d[_0xc58d('0x2d')]=_[_0xc58d('0x2c')](_0x184922[_0xc58d('0x2d')]);_0x32a46d['filters']=_[_0xc58d('0x2e')](_0x32a46d[_0xc58d('0x2b')],_0x32a46d[_0xc58d('0x2d')]);_0x9207c5['attributes']=_['intersection'](_0x32a46d['model'],qs['fields'](_0x184922[_0xc58d('0x2d')][_0xc58d('0x2f')]));_0x9207c5[_0xc58d('0x30')]=_0x9207c5[_0xc58d('0x30')][_0xc58d('0x31')]?_0x9207c5[_0xc58d('0x30')]:_0x32a46d[_0xc58d('0x2b')];if(!_0x184922[_0xc58d('0x2d')][_0xc58d('0x32')](_0xc58d('0x33'))){_0x9207c5[_0xc58d('0x1b')]=qs['limit'](_0x184922[_0xc58d('0x2d')][_0xc58d('0x1b')]);_0x9207c5[_0xc58d('0x1a')]=qs['offset'](_0x184922[_0xc58d('0x2d')][_0xc58d('0x1a')]);}_0x9207c5[_0xc58d('0x34')]=qs[_0xc58d('0x35')](_0x184922['query'][_0xc58d('0x35')]);_0x9207c5[_0xc58d('0x36')]=qs[_0xc58d('0x37')](_[_0xc58d('0x38')](_0x184922[_0xc58d('0x2d')],_0x32a46d[_0xc58d('0x37')]));if(_0x184922[_0xc58d('0x2d')][_0xc58d('0x39')]){_0x9207c5[_0xc58d('0x36')]=_[_0xc58d('0x3a')](_0x9207c5[_0xc58d('0x36')],{'$or':_['map'](_0x412731,function(_0x114c50){if(_0x114c50[_0xc58d('0x3b')][_0xc58d('0x3c')]!=='VIRTUAL'){var _0x1c247a={};_0x1c247a[_0x114c50[_0xc58d('0x3d')]]={'$like':'%'+_0x184922[_0xc58d('0x2d')][_0xc58d('0x39')]+'%'};return _0x1c247a;}})});}_0x9207c5=_[_0xc58d('0x3a')]({},_0x9207c5,_0x184922['options']);var _0x1d9987={'where':_0x9207c5[_0xc58d('0x36')]};return db[_0xc58d('0x29')][_0xc58d('0x19')](_0x1d9987)[_0xc58d('0x22')](function(_0x34862c){_0x14a32d[_0xc58d('0x19')]=_0x34862c;if(_0x184922[_0xc58d('0x2d')]['includeAll']){_0x9207c5['include']=[{'all':!![]}];}return db[_0xc58d('0x29')][_0xc58d('0x3e')](_0x9207c5);})[_0xc58d('0x22')](function(_0x462be7){_0x14a32d['rows']=_0x462be7;return _0x14a32d;})[_0xc58d('0x22')](respondWithFilteredResult(_0x43603b,_0x9207c5))[_0xc58d('0x3f')](handleError(_0x43603b,null));};exports[_0xc58d('0x40')]=function(_0x56b7c2,_0x2c5131){var _0xdbfe4e={'raw':!![],'where':{'id':_0x56b7c2['params']['id']}},_0x502091={};_0x502091['model']=_['keys'](db[_0xc58d('0x29')][_0xc58d('0x2a')]);_0x502091[_0xc58d('0x2d')]=_[_0xc58d('0x2c')](_0x56b7c2[_0xc58d('0x2d')]);_0x502091[_0xc58d('0x37')]=_[_0xc58d('0x2e')](_0x502091['model'],_0x502091[_0xc58d('0x2d')]);_0xdbfe4e[_0xc58d('0x30')]=_[_0xc58d('0x2e')](_0x502091[_0xc58d('0x2b')],qs[_0xc58d('0x2f')](_0x56b7c2[_0xc58d('0x2d')][_0xc58d('0x2f')]));_0xdbfe4e['attributes']=_0xdbfe4e[_0xc58d('0x30')][_0xc58d('0x31')]?_0xdbfe4e[_0xc58d('0x30')]:_0x502091[_0xc58d('0x2b')];if(_0x56b7c2[_0xc58d('0x2d')][_0xc58d('0x41')]){_0xdbfe4e[_0xc58d('0x42')]=[{'all':!![]}];}_0xdbfe4e=_[_0xc58d('0x3a')]({},_0xdbfe4e,_0x56b7c2[_0xc58d('0x43')]);return db[_0xc58d('0x29')][_0xc58d('0x44')](_0xdbfe4e)[_0xc58d('0x22')](handleEntityNotFound(_0x2c5131,null))[_0xc58d('0x22')](respondWithResult(_0x2c5131,null))[_0xc58d('0x3f')](handleError(_0x2c5131,null));};exports[_0xc58d('0x45')]=function(_0x1173b1,_0x227b25){return db['SugarcrmField'][_0xc58d('0x45')](_0x1173b1[_0xc58d('0x46')],{})[_0xc58d('0x22')](respondWithResult(_0x227b25,0xc9))[_0xc58d('0x3f')](handleError(_0x227b25,null));};exports[_0xc58d('0x21')]=function(_0x68a377,_0x44d281){if(_0x68a377[_0xc58d('0x46')]['id']){delete _0x68a377[_0xc58d('0x46')]['id'];}return db[_0xc58d('0x29')][_0xc58d('0x44')]({'where':{'id':_0x68a377[_0xc58d('0x47')]['id']}})[_0xc58d('0x22')](handleEntityNotFound(_0x44d281,null))[_0xc58d('0x22')](saveUpdates(_0x68a377[_0xc58d('0x46')],null))[_0xc58d('0x22')](respondWithResult(_0x44d281,null))['catch'](handleError(_0x44d281,null));};exports[_0xc58d('0x23')]=function(_0x332638,_0x198b59){return db['SugarcrmField'][_0xc58d('0x44')]({'where':{'id':_0x332638[_0xc58d('0x47')]['id']}})[_0xc58d('0x22')](handleEntityNotFound(_0x198b59,null))[_0xc58d('0x22')](removeEntity(_0x198b59,null))[_0xc58d('0x3f')](handleError(_0x198b59,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b18ef4a..d9b6e21 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 _0x47e3=['int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x2c1b5b,_0x19570c){var _0x288aac=function(_0x2c9727){while(--_0x2c9727){_0x2c1b5b['push'](_0x2c1b5b['shift']());}};_0x288aac(++_0x19570c);}(_0x47e3,0xc7));var _0x347e=function(_0x588a9c,_0x338327){_0x588a9c=_0x588a9c-0x0;var _0x4166bc=_0x47e3[_0x588a9c];return _0x4166bc;};'use strict';var _=require(_0x347e('0x0'));var util=require('util');var logger=require(_0x347e('0x1'))(_0x347e('0x2'));var moment=require(_0x347e('0x3'));var BPromise=require(_0x347e('0x4'));var rp=require(_0x347e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x347e('0x6'));var attributes=require(_0x347e('0x7'));module[_0x347e('0x8')]=function(_0x33dd3c,_0x3d2792){return _0x33dd3c[_0x347e('0x9')](_0x347e('0xa'),attributes,{'tableName':_0x347e('0xb'),'paranoid':![],'indexes':[{'name':_0x347e('0xc'),'fields':[_0x347e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x891f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','lodash','util','../../config/logger'];(function(_0x4abafc,_0x35877c){var _0x408aaf=function(_0x5413f2){while(--_0x5413f2){_0x4abafc['push'](_0x4abafc['shift']());}};_0x408aaf(++_0x35877c);}(_0x891f,0x15b));var _0xf891=function(_0x1d317c,_0x419346){_0x1d317c=_0x1d317c-0x0;var _0x3accc7=_0x891f[_0x1d317c];return _0x3accc7;};'use strict';var _=require(_0xf891('0x0'));var util=require(_0xf891('0x1'));var logger=require(_0xf891('0x2'))('api');var moment=require(_0xf891('0x3'));var BPromise=require(_0xf891('0x4'));var rp=require(_0xf891('0x5'));var fs=require('fs');var path=require(_0xf891('0x6'));var rimraf=require(_0xf891('0x7'));var config=require(_0xf891('0x8'));var attributes=require(_0xf891('0x9'));module['exports']=function(_0x3d1402,_0x360d4a){return _0x3d1402[_0xf891('0xa')](_0xf891('0xb'),attributes,{'tableName':_0xf891('0xc'),'paranoid':![],'indexes':[{'name':_0xf891('0xd'),'fields':['idField','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 2ed39ba..8f7dc54 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 _0x88c0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s'];(function(_0x8ff3d1,_0x3a3d67){var _0x4b4fde=function(_0x1024bd){while(--_0x1024bd){_0x8ff3d1['push'](_0x8ff3d1['shift']());}};_0x4b4fde(++_0x3a3d67);}(_0x88c0,0x165));var _0x088c=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0x88c0[_0x5c52a3];return _0x5537b9;};'use strict';var _=require('lodash');var util=require(_0x088c('0x0'));var moment=require(_0x088c('0x1'));var BPromise=require(_0x088c('0x2'));var rs=require(_0x088c('0x3'));var fs=require('fs');var Redis=require(_0x088c('0x4'));var db=require(_0x088c('0x5'))['db'];var utils=require(_0x088c('0x6'));var logger=require('../../config/logger')(_0x088c('0x7'));var config=require(_0x088c('0x8'));var jayson=require(_0x088c('0x9'));var client=jayson['client'][_0x088c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27650d,_0x12a911,_0x38dd77){return new BPromise(function(_0x3cbe3e,_0x186a61){return client[_0x088c('0xb')](_0x27650d,_0x38dd77)[_0x088c('0xc')](function(_0x25311b){logger[_0x088c('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x12a911,_0x088c('0xe'));logger[_0x088c('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x12a911,_0x088c('0xe'),JSON[_0x088c('0x10')](_0x25311b));if(_0x25311b[_0x088c('0x11')]){if(_0x25311b[_0x088c('0x11')][_0x088c('0x12')]===0x1f4){logger[_0x088c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x12a911,_0x25311b[_0x088c('0x11')]['message']);return _0x186a61(_0x25311b[_0x088c('0x11')][_0x088c('0x13')]);}logger[_0x088c('0x11')](_0x088c('0x14'),_0x12a911,_0x25311b[_0x088c('0x11')][_0x088c('0x13')]);return _0x3cbe3e(_0x25311b[_0x088c('0x11')][_0x088c('0x13')]);}else{logger[_0x088c('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x12a911,_0x088c('0xe'));_0x3cbe3e(_0x25311b['result'][_0x088c('0x13')]);}})['catch'](function(_0x13a647){logger[_0x088c('0x11')](_0x088c('0x14'),_0x12a911,_0x13a647);_0x186a61(_0x13a647);});});} \ No newline at end of file +var _0x118c=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xddf136,_0x1974ad){var _0x16e835=function(_0x4a39f0){while(--_0x4a39f0){_0xddf136['push'](_0xddf136['shift']());}};_0x16e835(++_0x1974ad);}(_0x118c,0x9c));var _0xc118=function(_0x3f186c,_0x407d8c){_0x3f186c=_0x3f186c-0x0;var _0x16f766=_0x118c[_0x3f186c];return _0x16f766;};'use strict';var _=require(_0xc118('0x0'));var util=require(_0xc118('0x1'));var moment=require(_0xc118('0x2'));var BPromise=require(_0xc118('0x3'));var rs=require(_0xc118('0x4'));var fs=require('fs');var Redis=require(_0xc118('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc118('0x6'))(_0xc118('0x7'));var config=require(_0xc118('0x8'));var jayson=require(_0xc118('0x9'));var client=jayson[_0xc118('0xa')][_0xc118('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39960e,_0x1b81fe,_0x596d69){return new BPromise(function(_0x7bc5af,_0x41db5f){return client[_0xc118('0xc')](_0x39960e,_0x596d69)[_0xc118('0xd')](function(_0x35c73b){logger[_0xc118('0xe')](_0xc118('0xf'),_0x1b81fe,_0xc118('0x10'));logger[_0xc118('0x11')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1b81fe,_0xc118('0x10'),JSON[_0xc118('0x12')](_0x35c73b));if(_0x35c73b[_0xc118('0x13')]){if(_0x35c73b['error']['code']===0x1f4){logger['error'](_0xc118('0xf'),_0x1b81fe,_0x35c73b[_0xc118('0x13')][_0xc118('0x14')]);return _0x41db5f(_0x35c73b[_0xc118('0x13')][_0xc118('0x14')]);}logger[_0xc118('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1b81fe,_0x35c73b[_0xc118('0x13')][_0xc118('0x14')]);return _0x7bc5af(_0x35c73b[_0xc118('0x13')]['message']);}else{logger[_0xc118('0xe')](_0xc118('0xf'),_0x1b81fe,_0xc118('0x10'));_0x7bc5af(_0x35c73b['result'][_0xc118('0x14')]);}})[_0xc118('0x15')](function(_0x5a0c06){logger[_0xc118('0x13')](_0xc118('0xf'),_0x1b81fe,_0x5a0c06);_0x41db5f(_0x5a0c06);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index c068bd0..b3ebe2d 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 _0xd67d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x803017,_0x1f83ce){var _0x5b7fd5=function(_0x346912){while(--_0x346912){_0x803017['push'](_0x803017['shift']());}};_0x5b7fd5(++_0x1f83ce);}(_0xd67d,0x7f));var _0xdd67=function(_0x582b0f,_0x35a9de){_0x582b0f=_0x582b0f-0x0;var _0x4658f0=_0xd67d[_0x582b0f];return _0x4658f0;};'use strict';var multer=require(_0xdd67('0x0'));var util=require(_0xdd67('0x1'));var path=require(_0xdd67('0x2'));var timeout=require(_0xdd67('0x3'));var express=require(_0xdd67('0x4'));var router=express[_0xdd67('0x5')]();var auth=require(_0xdd67('0x6'));var interaction=require(_0xdd67('0x7'));var config=require(_0xdd67('0x8'));var controller=require(_0xdd67('0x9'));router[_0xdd67('0xa')]('/',auth[_0xdd67('0xb')](),controller[_0xdd67('0xc')]);router['get'](_0xdd67('0xd'),auth[_0xdd67('0xb')](),controller[_0xdd67('0xe')]);router[_0xdd67('0xa')](_0xdd67('0xf'),auth[_0xdd67('0xb')](),controller[_0xdd67('0x10')]);router['get'](_0xdd67('0x11'),auth[_0xdd67('0xb')](),controller[_0xdd67('0x12')]);router[_0xdd67('0x13')]('/',auth['isAuthenticated'](),controller[_0xdd67('0x14')]);router[_0xdd67('0x13')](_0xdd67('0xf'),auth[_0xdd67('0xb')](),controller['addConfiguration']);router[_0xdd67('0x15')](_0xdd67('0xd'),auth[_0xdd67('0xb')](),controller[_0xdd67('0x16')]);router[_0xdd67('0x17')](_0xdd67('0xd'),auth[_0xdd67('0xb')](),controller[_0xdd67('0x18')]);module[_0xdd67('0x19')]=router; \ No newline at end of file +var _0xe531=['get','isAuthenticated','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','/:id','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0xe531,0x98));var _0x1e53=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0xe531[_0x3cca7a];return _0x34e717;};'use strict';var multer=require(_0x1e53('0x0'));var util=require(_0x1e53('0x1'));var path=require(_0x1e53('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e53('0x3'));var router=express[_0x1e53('0x4')]();var auth=require(_0x1e53('0x5'));var interaction=require(_0x1e53('0x6'));var config=require(_0x1e53('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x1e53('0x8')]('/',auth[_0x1e53('0x9')](),controller['index']);router[_0x1e53('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e53('0xa')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e53('0xb')]);router[_0x1e53('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1e53('0xc')]);router[_0x1e53('0xd')]('/',auth[_0x1e53('0x9')](),controller['create']);router[_0x1e53('0xd')](_0x1e53('0xe'),auth['isAuthenticated'](),controller[_0x1e53('0xf')]);router[_0x1e53('0x10')](_0x1e53('0x11'),auth[_0x1e53('0x9')](),controller[_0x1e53('0x12')]);router[_0x1e53('0x13')](_0x1e53('0x11'),auth[_0x1e53('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 13b9050..6ed76f1 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 _0x2a00=['STRING','HelpDesk','sequelize','exports'];(function(_0x167089,_0x1d96a2){var _0x1f388f=function(_0x187b6c){while(--_0x187b6c){_0x167089['push'](_0x167089['shift']());}};_0x1f388f(++_0x1d96a2);}(_0x2a00,0x12a));var _0x02a0=function(_0x1af5a8,_0x39a1f5){_0x1af5a8=_0x1af5a8-0x0;var _0xc26e05=_0x2a00[_0x1af5a8];return _0xc26e05;};'use strict';var Sequelize=require(_0x02a0('0x0'));module[_0x02a0('0x1')]={'name':{'type':Sequelize[_0x02a0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x02a0('0x2')]},'username':{'type':Sequelize[_0x02a0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x02a0('0x2')],'allowNull':![],'defaultValue':_0x02a0('0x3')},'remoteUri':{'type':Sequelize[_0x02a0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x02a0('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x357f=['exports','STRING','HelpDesk'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x357f,0x12f));var _0xf357=function(_0x16c07f,_0x57df50){_0x16c07f=_0x16c07f-0x0;var _0x120328=_0x357f[_0x16c07f];return _0x120328;};'use strict';var Sequelize=require('sequelize');module[_0xf357('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf357('0x1')]},'username':{'type':Sequelize[_0xf357('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf357('0x1')],'allowNull':![],'defaultValue':_0xf357('0x2')},'remoteUri':{'type':Sequelize[_0xf357('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xf357('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 9d69f18..3d18139 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 _0xdbbf=['md5','getFields','findOne','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','username','success','POST','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','stack','name','send','VtigerAccount','rawAttributes','model','keys','query','filters','attributes','intersection','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','getConfigurations','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField'];(function(_0x39a3e9,_0x13b485){var _0x2019fd=function(_0x4b6670){while(--_0x4b6670){_0x39a3e9['push'](_0x39a3e9['shift']());}};_0x2019fd(++_0x13b485);}(_0xdbbf,0xab));var _0xfdbb=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xdbbf[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0xfdbb('0x0'));var emlformat=require(_0xfdbb('0x1'));var rimraf=require(_0xfdbb('0x2'));var zipdir=require(_0xfdbb('0x3'));var jsonpatch=require(_0xfdbb('0x4'));var rp=require(_0xfdbb('0x5'));var moment=require(_0xfdbb('0x6'));var BPromise=require(_0xfdbb('0x7'));var Mustache=require(_0xfdbb('0x8'));var util=require(_0xfdbb('0x9'));var path=require('path');var sox=require(_0xfdbb('0xa'));var csv=require('to-csv');var ejs=require(_0xfdbb('0xb'));var fs=require('fs');var _=require(_0xfdbb('0xc'));var squel=require('squel');var crypto=require(_0xfdbb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfdbb('0xe'));var Papa=require(_0xfdbb('0xf'));var Redis=require(_0xfdbb('0x10'));var authService=require(_0xfdbb('0x11'));var qs=require(_0xfdbb('0x12'));var hardwareService=require(_0xfdbb('0x13'));var logger=require(_0xfdbb('0x14'))(_0xfdbb('0x15'));var utils=require(_0xfdbb('0x16'));var config=require(_0xfdbb('0x17'));var db=require(_0xfdbb('0x18'))['db'];var integrations=require(_0xfdbb('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xfdbb('0x1a')][_0xfdbb('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x8100af,_0x250dc1,_0x2d58ce){if(_0x2d58ce){var _0x449c12=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x449c12['test'](_0x250dc1)){return _0x8100af;}else{throw new Error(_0xfdbb('0x1c'));}}else{return _0x8100af;}}function respondWithRpcPromise(_0x225660,_0x3dc8e3,_0x30b1c7,_0x163211){return new BPromise(function(_0x3ccd5a,_0x59a5cb){var _0xe4dec=_0x163211||client;return _0xe4dec[_0xfdbb('0x1d')](_0x225660,_0x30b1c7)[_0xfdbb('0x1e')](function(_0x4983e7){logger[_0xfdbb('0x1f')](_0xfdbb('0x20'),_0x3dc8e3,_0xfdbb('0x21'));logger['debug'](_0xfdbb('0x22'),_0x3dc8e3,_0xfdbb('0x21'),JSON[_0xfdbb('0x23')](_0x4983e7));if(_0x4983e7['error']){if(_0x4983e7[_0xfdbb('0x24')][_0xfdbb('0x25')]===0x1f4){logger[_0xfdbb('0x24')](_0xfdbb('0x20'),_0x3dc8e3,_0x4983e7['error'][_0xfdbb('0x26')]);return _0x59a5cb(_0x4983e7['error'][_0xfdbb('0x26')]);}logger[_0xfdbb('0x24')]('VtigerAccount,\x20%s,\x20%s',_0x3dc8e3,_0x4983e7[_0xfdbb('0x24')][_0xfdbb('0x26')]);return _0x3ccd5a(_0x4983e7[_0xfdbb('0x24')]['message']);}else{logger[_0xfdbb('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x3dc8e3,'request\x20sent');_0x3ccd5a(_0x4983e7[_0xfdbb('0x27')]['message']);}})[_0xfdbb('0x28')](function(_0x37c376){logger['error'](_0xfdbb('0x20'),_0x3dc8e3,_0x37c376);_0x59a5cb(_0x37c376);});});}function respondWithStatusCode(_0x47bf16,_0x4ae751){_0x4ae751=_0x4ae751||0xcc;return function(_0x3941c1){if(_0x3941c1){return _0x47bf16[_0xfdbb('0x29')](_0x4ae751);}return _0x47bf16[_0xfdbb('0x2a')](_0x4ae751)[_0xfdbb('0x2b')]();};}function respondWithResult(_0x18ade3,_0x32e2ca){_0x32e2ca=_0x32e2ca||0xc8;return function(_0x42d736){if(_0x42d736){return _0x18ade3[_0xfdbb('0x2a')](_0x32e2ca)[_0xfdbb('0x2c')](_0x42d736);}};}function respondWithFilteredResult(_0x2b6319,_0x18d0c4){return function(_0x159485){if(_0x159485){var _0xf9a4e3=_0x159485[_0xfdbb('0x2d')],_0x505d38=_0x18d0c4[_0xfdbb('0x2e')],_0x29c0af=_0x18d0c4[_0xfdbb('0x2e')]+_0x18d0c4[_0xfdbb('0x2f')],_0x21de70;if(_0x29c0af>=_0xf9a4e3){_0x29c0af=_0xf9a4e3;_0x21de70=0xc8;}else{_0x21de70=0xce;}_0x2b6319[_0xfdbb('0x2a')](_0x21de70);return _0x2b6319['set'](_0xfdbb('0x30'),_0x505d38+'-'+_0x29c0af+'/'+_0xf9a4e3)[_0xfdbb('0x2c')](_0x159485);}return null;};}function patchUpdates(_0x35bce7){return function(_0x33d600){try{jsonpatch['apply'](_0x33d600,_0x35bce7,!![]);}catch(_0x259660){return BPromise['reject'](_0x259660);}return _0x33d600[_0xfdbb('0x31')]();};}function saveUpdates(_0x47d76e,_0x5757ad){return function(_0x4d7eb8){if(_0x4d7eb8){return _0x4d7eb8[_0xfdbb('0x32')](_0x47d76e)[_0xfdbb('0x1e')](function(_0x3a1490){return _0x3a1490;});}return null;};}function removeEntity(_0x3b81ef,_0x543729){return function(_0x54d134){if(_0x54d134){return _0x54d134[_0xfdbb('0x33')]()[_0xfdbb('0x1e')](function(){_0x3b81ef[_0xfdbb('0x2a')](0xcc)[_0xfdbb('0x2b')]();});}};}function handleEntityNotFound(_0x530948,_0x175216){return function(_0x1bce07){if(!_0x1bce07){_0x530948[_0xfdbb('0x29')](0x194);}return _0x1bce07;};}function handleError(_0x156f81,_0x551c84){_0x551c84=_0x551c84||0x1f4;return function(_0x29965a){logger[_0xfdbb('0x24')](_0x29965a[_0xfdbb('0x34')]);if(_0x29965a['name']){delete _0x29965a[_0xfdbb('0x35')];}_0x156f81[_0xfdbb('0x2a')](_0x551c84)[_0xfdbb('0x36')](_0x29965a);};}exports['index']=function(_0x41579d,_0x4b9ec2){var _0x37f1e6={},_0x5b8384={},_0x3d048f={'count':0x0,'rows':[]};var _0x121465=db[_0xfdbb('0x37')][_0xfdbb('0x38')];_0x5b8384[_0xfdbb('0x39')]=_[_0xfdbb('0x3a')](_0x121465);_0x5b8384[_0xfdbb('0x3b')]=_[_0xfdbb('0x3a')](_0x41579d[_0xfdbb('0x3b')]);_0x5b8384[_0xfdbb('0x3c')]=_['intersection'](_0x5b8384['model'],_0x5b8384[_0xfdbb('0x3b')]);_0x37f1e6[_0xfdbb('0x3d')]=_[_0xfdbb('0x3e')](_0x5b8384['model'],qs['fields'](_0x41579d[_0xfdbb('0x3b')]['fields']));_0x37f1e6[_0xfdbb('0x3d')]=_0x37f1e6[_0xfdbb('0x3d')]['length']?_0x37f1e6['attributes']:_0x5b8384['model'];if(!_0x41579d['query']['hasOwnProperty'](_0xfdbb('0x3f'))){_0x37f1e6[_0xfdbb('0x2f')]=qs[_0xfdbb('0x2f')](_0x41579d[_0xfdbb('0x3b')][_0xfdbb('0x2f')]);_0x37f1e6['offset']=qs[_0xfdbb('0x2e')](_0x41579d['query'][_0xfdbb('0x2e')]);}_0x37f1e6[_0xfdbb('0x40')]=qs['sort'](_0x41579d[_0xfdbb('0x3b')][_0xfdbb('0x41')]);_0x37f1e6[_0xfdbb('0x42')]=qs[_0xfdbb('0x3c')](_['pick'](_0x41579d[_0xfdbb('0x3b')],_0x5b8384[_0xfdbb('0x3c')]));if(_0x41579d[_0xfdbb('0x3b')][_0xfdbb('0x43')]){_0x37f1e6[_0xfdbb('0x42')]=_[_0xfdbb('0x44')](_0x37f1e6[_0xfdbb('0x42')],{'$or':_[_0xfdbb('0x45')](_0x121465,function(_0x4701d1){if(_0x4701d1[_0xfdbb('0x46')][_0xfdbb('0x47')]!==_0xfdbb('0x48')){var _0x20328a={};_0x20328a[_0x4701d1[_0xfdbb('0x49')]]={'$like':'%'+_0x41579d['query'][_0xfdbb('0x43')]+'%'};return _0x20328a;}})});}_0x37f1e6=_[_0xfdbb('0x44')]({},_0x37f1e6,_0x41579d[_0xfdbb('0x4a')]);var _0x295bae={'where':_0x37f1e6['where']};return db[_0xfdbb('0x37')][_0xfdbb('0x2d')](_0x295bae)['then'](function(_0x412afc){_0x3d048f[_0xfdbb('0x2d')]=_0x412afc;if(_0x41579d['query'][_0xfdbb('0x4b')]){_0x37f1e6[_0xfdbb('0x4c')]=[{'all':!![]}];}return db[_0xfdbb('0x37')][_0xfdbb('0x4d')](_0x37f1e6);})[_0xfdbb('0x1e')](function(_0x913eb1){_0x3d048f[_0xfdbb('0x4e')]=_0x913eb1;return _0x3d048f;})[_0xfdbb('0x1e')](respondWithFilteredResult(_0x4b9ec2,_0x37f1e6))[_0xfdbb('0x28')](handleError(_0x4b9ec2,null));};exports[_0xfdbb('0x4f')]=function(_0x1bc2b0,_0x4c096a){var _0x37f39e={'raw':![],'where':{'id':_0x1bc2b0[_0xfdbb('0x50')]['id']}},_0x261421={};_0x261421[_0xfdbb('0x39')]=_['keys'](db['VtigerAccount'][_0xfdbb('0x38')]);_0x261421[_0xfdbb('0x3b')]=_[_0xfdbb('0x3a')](_0x1bc2b0['query']);_0x261421['filters']=_[_0xfdbb('0x3e')](_0x261421[_0xfdbb('0x39')],_0x261421[_0xfdbb('0x3b')]);_0x37f39e['attributes']=_[_0xfdbb('0x3e')](_0x261421[_0xfdbb('0x39')],qs[_0xfdbb('0x51')](_0x1bc2b0['query']['fields']));_0x37f39e[_0xfdbb('0x3d')]=_0x37f39e['attributes']['length']?_0x37f39e[_0xfdbb('0x3d')]:_0x261421['model'];if(_0x1bc2b0['query'][_0xfdbb('0x4b')]){_0x37f39e[_0xfdbb('0x4c')]=[{'all':!![]}];}_0x37f39e=_[_0xfdbb('0x44')]({},_0x37f39e,_0x1bc2b0[_0xfdbb('0x4a')]);return db[_0xfdbb('0x37')][_0xfdbb('0x52')](_0x37f39e)['then'](handleEntityNotFound(_0x4c096a,null))['then'](respondWithResult(_0x4c096a,null))[_0xfdbb('0x28')](handleError(_0x4c096a,null));};exports[_0xfdbb('0x53')]=function(_0x2a6a7a,_0x30ed45){return db['VtigerAccount'][_0xfdbb('0x53')](_0x2a6a7a[_0xfdbb('0x54')],{})['then'](respondWithResult(_0x30ed45,0xc9))[_0xfdbb('0x28')](handleError(_0x30ed45,null));};exports[_0xfdbb('0x32')]=function(_0x585a39,_0x516183){if(_0x585a39['body']['id']){delete _0x585a39[_0xfdbb('0x54')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x585a39['params']['id']}})['then'](handleEntityNotFound(_0x516183,null))[_0xfdbb('0x1e')](saveUpdates(_0x585a39[_0xfdbb('0x54')],null))[_0xfdbb('0x1e')](respondWithResult(_0x516183,null))[_0xfdbb('0x28')](handleError(_0x516183,null));};exports['destroy']=function(_0x57295c,_0x364bd6){return db[_0xfdbb('0x37')][_0xfdbb('0x52')]({'where':{'id':_0x57295c[_0xfdbb('0x50')]['id']}})[_0xfdbb('0x1e')](handleEntityNotFound(_0x364bd6,null))['then'](removeEntity(_0x364bd6,null))[_0xfdbb('0x28')](handleError(_0x364bd6,null));};exports[_0xfdbb('0x55')]=function(_0x4cdfdc,_0x2106db,_0x545712){var _0x54df4d={};var _0x94d153={};var _0x316abd;var _0x486f4c;return db[_0xfdbb('0x37')]['findOne']({'where':{'id':_0x4cdfdc[_0xfdbb('0x50')]['id']}})[_0xfdbb('0x1e')](handleEntityNotFound(_0x2106db,null))[_0xfdbb('0x1e')](function(_0x10e633){if(_0x10e633){_0x316abd=_0x10e633;_0x94d153[_0xfdbb('0x39')]=_[_0xfdbb('0x3a')](db['VtigerConfiguration'][_0xfdbb('0x38')]);_0x94d153[_0xfdbb('0x3b')]=_[_0xfdbb('0x3a')](_0x4cdfdc[_0xfdbb('0x3b')]);_0x94d153[_0xfdbb('0x3c')]=_[_0xfdbb('0x3e')](_0x94d153[_0xfdbb('0x39')],_0x94d153[_0xfdbb('0x3b')]);_0x54df4d[_0xfdbb('0x3d')]=_[_0xfdbb('0x3e')](_0x94d153['model'],qs[_0xfdbb('0x51')](_0x4cdfdc[_0xfdbb('0x3b')][_0xfdbb('0x51')]));_0x54df4d['attributes']=_0x54df4d[_0xfdbb('0x3d')][_0xfdbb('0x56')]?_0x54df4d['attributes']:_0x94d153[_0xfdbb('0x39')];_0x54df4d['order']=qs['sort'](_0x4cdfdc[_0xfdbb('0x3b')][_0xfdbb('0x41')]);_0x54df4d['where']=qs['filters'](_['pick'](_0x4cdfdc[_0xfdbb('0x3b')],_0x94d153[_0xfdbb('0x3c')]));if(_0x4cdfdc['query'][_0xfdbb('0x43')]){_0x54df4d[_0xfdbb('0x42')]=_[_0xfdbb('0x44')](_0x54df4d[_0xfdbb('0x42')],{'$or':_[_0xfdbb('0x45')](_0x54df4d[_0xfdbb('0x3d')],function(_0x5e6838){var _0x66e154={};_0x66e154[_0x5e6838]={'$like':'%'+_0x4cdfdc[_0xfdbb('0x3b')][_0xfdbb('0x43')]+'%'};return _0x66e154;})});}_0x54df4d=_[_0xfdbb('0x44')]({},_0x54df4d,_0x4cdfdc[_0xfdbb('0x4a')]);return _0x316abd[_0xfdbb('0x55')](_0x54df4d);}})['then'](function(_0x32c399){if(_0x32c399){_0x486f4c=_0x32c399[_0xfdbb('0x56')];if(!_0x4cdfdc[_0xfdbb('0x3b')][_0xfdbb('0x57')](_0xfdbb('0x3f'))){_0x54df4d['limit']=qs[_0xfdbb('0x2f')](_0x4cdfdc[_0xfdbb('0x3b')]['limit']);_0x54df4d[_0xfdbb('0x2e')]=qs['offset'](_0x4cdfdc[_0xfdbb('0x3b')][_0xfdbb('0x2e')]);}return _0x316abd['getConfigurations'](_0x54df4d);}})['then'](function(_0x414a3b){if(_0x414a3b){return _0x414a3b?{'count':_0x486f4c,'rows':_0x414a3b}:null;}})[_0xfdbb('0x1e')](respondWithResult(_0x2106db,null))[_0xfdbb('0x28')](handleError(_0x2106db,null));};exports[_0xfdbb('0x58')]=function(_0x44fc8f,_0x13c484,_0x52c259){if(_0x44fc8f[_0xfdbb('0x54')]['id']){delete _0x44fc8f[_0xfdbb('0x54')]['id'];}return db[_0xfdbb('0x37')]['findOne']({'where':{'id':_0x44fc8f[_0xfdbb('0x50')]['id']}})[_0xfdbb('0x1e')](handleEntityNotFound(_0x13c484,null))[_0xfdbb('0x1e')](function(_0x44dc88){if(_0x44dc88){_0x44fc8f[_0xfdbb('0x54')][_0xfdbb('0x59')]=_0x44dc88['id'];_0x44fc8f[_0xfdbb('0x54')][_0xfdbb('0x5a')]=integrations[_0xfdbb('0x5b')](_0x44fc8f['body'][_0xfdbb('0x5c')],_0x44fc8f[_0xfdbb('0x54')]['type']);_0x44fc8f['body'][_0xfdbb('0x5d')]=integrations[_0xfdbb('0x5e')](_0x44fc8f[_0xfdbb('0x54')][_0xfdbb('0x5c')],_0x44fc8f[_0xfdbb('0x54')]['type']);return db[_0xfdbb('0x5f')]['create'](_0x44fc8f['body'],{'include':[{'model':db['VtigerField'],'as':_0xfdbb('0x5a')},{'model':db[_0xfdbb('0x60')],'as':'Descriptions'}]});}return null;})[_0xfdbb('0x1e')](respondWithResult(_0x13c484,null))[_0xfdbb('0x28')](handleError(_0x13c484,null));};var md5=require(_0xfdbb('0x61'));exports[_0xfdbb('0x62')]=function(_0x7f72dc,_0x2fdb1a,_0x2b6d78){var _0x11cc22=null;var _0x4cb48e=null;var _0x4060a5=null;var _0x28df6f=null;var _0x1a23dc='';return db['VtigerAccount'][_0xfdbb('0x63')]({'where':{'id':_0x7f72dc[_0xfdbb('0x50')]['id']},'attributes':['id','name','username',_0xfdbb('0x64'),_0xfdbb('0x65'),_0xfdbb('0x66'),_0xfdbb('0x67'),'accessKey']})[_0xfdbb('0x1e')](handleEntityNotFound(_0x2fdb1a,null))[_0xfdbb('0x1e')](function(_0x587cec){if(_0x587cec){_0x11cc22=_0x587cec['username'];_0x4cb48e=_0x587cec[_0xfdbb('0x68')];_0x4060a5=_0x587cec['moduleName'];_0x1a23dc=_0x587cec[_0xfdbb('0x66')];var _0x570011=_0x1a23dc[_0xfdbb('0x69')](-0x1);if(_0x570011==='/'){_0x1a23dc=_0x1a23dc['substring'](0x0,_0x1a23dc[_0xfdbb('0x6a')](_0x570011));}_0x28df6f=util['format'](_0xfdbb('0x6b'),_0x1a23dc);var _0x31d940={'method':_0xfdbb('0x6c'),'uri':_0x28df6f,'qs':{'operation':_0xfdbb('0x6d'),'username':_0x587cec[_0xfdbb('0x6e')]},'json':!![]};return rp(_0x31d940);}})[_0xfdbb('0x1e')](function(_0x5e1256){if(_0x5e1256[_0xfdbb('0x6f')]){var _0x9bf8d={'method':_0xfdbb('0x70'),'uri':_0x28df6f,'form':{'operation':'login','username':_0x11cc22,'accessKey':md5(_0x5e1256[_0xfdbb('0x27')][_0xfdbb('0x71')]+_0x4cb48e)},'json':!![]};return rp(_0x9bf8d);}})[_0xfdbb('0x1e')](function(_0x1db57d){if(_0x1db57d[_0xfdbb('0x6f')]){var _0x323346={'method':_0xfdbb('0x6c'),'uri':_0x28df6f,'qs':{'operation':_0xfdbb('0x72'),'username':_0x11cc22,'sessionName':_0x1db57d[_0xfdbb('0x27')][_0xfdbb('0x73')],'elementType':_0x4060a5},'json':!![]};return rp(_0x323346);}})[_0xfdbb('0x1e')](function(_0x267a87){if(_0x267a87['success']){var _0x3744a1=[_0xfdbb('0x74'),_0xfdbb('0x75'),_0xfdbb('0x76')];_[_0xfdbb('0x77')](_0x267a87['result'][_0xfdbb('0x51')],function(_0x36deba){return _0x3744a1[_0xfdbb('0x78')](_0x36deba['type'][_0xfdbb('0x35')]);});_[_0xfdbb('0x77')](_0x267a87[_0xfdbb('0x27')][_0xfdbb('0x51')],function(_0x269890){return _0x269890[_0xfdbb('0x79')]===_0xfdbb('0x7a');});return{'count':_0x267a87[_0xfdbb('0x27')][_0xfdbb('0x51')][_0xfdbb('0x56')],'rows':_['map'](_0x267a87[_0xfdbb('0x27')][_0xfdbb('0x51')],function(_0xc0b72c){return{'id':_0xc0b72c[_0xfdbb('0x35')],'name':_0xc0b72c[_0xfdbb('0x7b')],'custom':_[_0xfdbb('0x7c')](_0xc0b72c[_0xfdbb('0x35')],_0xfdbb('0x7d'))?!![]:![],'options':_0xc0b72c[_0xfdbb('0x46')][_0xfdbb('0x35')]===_0xfdbb('0x7e')&&_0xc0b72c['type'][_0xfdbb('0x7f')]['length']>0x0?_[_0xfdbb('0x45')](_0xc0b72c[_0xfdbb('0x46')][_0xfdbb('0x7f')],function(_0x4d048e){return{'name':_0x4d048e[_0xfdbb('0x7b')],'value':_0x4d048e[_0xfdbb('0x80')]};}):[]};})};}})[_0xfdbb('0x1e')](respondWithResult(_0x2fdb1a,null))[_0xfdbb('0x28')](function(_0x30c3f8){console[_0xfdbb('0x81')](_0xfdbb('0x82')+_0x30c3f8);var _0x327293=_0x7f72dc[_0xfdbb('0x3b')][_0xfdbb('0x83')]?0x1f4:_0x30c3f8['statusCode']||0x1f4;logger[_0xfdbb('0x24')](_0xfdbb('0x84'),'getFields',_0x327293,JSON[_0xfdbb('0x23')](_0x30c3f8));delete _0x30c3f8[_0xfdbb('0x35')];if(_0x327293===0x191){_0x327293=0x190;}_0x2fdb1a[_0xfdbb('0x2a')](_0x327293)['send'](_0x7f72dc[_0xfdbb('0x3b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x30c3f8[_0xfdbb('0x85')]}:_0x30c3f8);});}; \ No newline at end of file +var _0x948b=['format','%s/webservice.php','GET','success','POST','login','describe','sessionName','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','Content-Range','apply','reject','update','destroy','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','VtigerAccount','rawAttributes','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','channel','VtigerField','getFields','username','description','serverUrl','accessKey','moduleName','remoteUri','slice','lastIndexOf'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x948b,0x198));var _0xb948=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x948b[_0x47aa64];return _0x549c7a;};'use strict';var pdf=require(_0xb948('0x0'));var emlformat=require(_0xb948('0x1'));var rimraf=require(_0xb948('0x2'));var zipdir=require(_0xb948('0x3'));var jsonpatch=require(_0xb948('0x4'));var rp=require(_0xb948('0x5'));var moment=require(_0xb948('0x6'));var BPromise=require(_0xb948('0x7'));var Mustache=require(_0xb948('0x8'));var util=require('util');var path=require('path');var sox=require(_0xb948('0x9'));var csv=require('to-csv');var ejs=require(_0xb948('0xa'));var fs=require('fs');var _=require(_0xb948('0xb'));var squel=require(_0xb948('0xc'));var crypto=require(_0xb948('0xd'));var jsforce=require(_0xb948('0xe'));var deskjs=require(_0xb948('0xf'));var toCsv=require(_0xb948('0x10'));var querystring=require(_0xb948('0x11'));var Papa=require(_0xb948('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb948('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb948('0x14'));var config=require('../../config/environment');var db=require(_0xb948('0x15'))['db'];var integrations=require(_0xb948('0x16'));var jayson=require(_0xb948('0x17'));var client=jayson['client'][_0xb948('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4c5899,_0x5f3e45,_0x352696){if(_0x352696){var _0x547f4c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x547f4c[_0xb948('0x19')](_0x5f3e45)){return _0x4c5899;}else{throw new Error(_0xb948('0x1a'));}}else{return _0x4c5899;}}function respondWithRpcPromise(_0x1b87aa,_0x52294c,_0x4f96ac,_0x18ccb6){return new BPromise(function(_0x841a0,_0x242857){var _0x1fb027=_0x18ccb6||client;return _0x1fb027['request'](_0x1b87aa,_0x4f96ac)[_0xb948('0x1b')](function(_0x46b368){logger[_0xb948('0x1c')](_0xb948('0x1d'),_0x52294c,'request\x20sent');logger[_0xb948('0x1e')](_0xb948('0x1f'),_0x52294c,_0xb948('0x20'),JSON[_0xb948('0x21')](_0x46b368));if(_0x46b368['error']){if(_0x46b368['error']['code']===0x1f4){logger[_0xb948('0x22')](_0xb948('0x1d'),_0x52294c,_0x46b368['error'][_0xb948('0x23')]);return _0x242857(_0x46b368[_0xb948('0x22')][_0xb948('0x23')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x52294c,_0x46b368[_0xb948('0x22')][_0xb948('0x23')]);return _0x841a0(_0x46b368[_0xb948('0x22')]['message']);}else{logger[_0xb948('0x1c')](_0xb948('0x1d'),_0x52294c,_0xb948('0x20'));_0x841a0(_0x46b368[_0xb948('0x24')]['message']);}})[_0xb948('0x25')](function(_0x1f6ee4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x52294c,_0x1f6ee4);_0x242857(_0x1f6ee4);});});}function respondWithStatusCode(_0x4141bf,_0x4240ba){_0x4240ba=_0x4240ba||0xcc;return function(_0x5ab3a3){if(_0x5ab3a3){return _0x4141bf[_0xb948('0x26')](_0x4240ba);}return _0x4141bf['status'](_0x4240ba)[_0xb948('0x27')]();};}function respondWithResult(_0xffb851,_0x2d92b0){_0x2d92b0=_0x2d92b0||0xc8;return function(_0x517428){if(_0x517428){return _0xffb851[_0xb948('0x28')](_0x2d92b0)[_0xb948('0x29')](_0x517428);}};}function respondWithFilteredResult(_0x3777ab,_0x3885d1){return function(_0x5dd3ed){if(_0x5dd3ed){var _0x31205e=_0x5dd3ed['count'],_0x4f72c4=_0x3885d1['offset'],_0x238a42=_0x3885d1[_0xb948('0x2a')]+_0x3885d1['limit'],_0x2a00df;if(_0x238a42>=_0x31205e){_0x238a42=_0x31205e;_0x2a00df=0xc8;}else{_0x2a00df=0xce;}_0x3777ab['status'](_0x2a00df);return _0x3777ab['set'](_0xb948('0x2b'),_0x4f72c4+'-'+_0x238a42+'/'+_0x31205e)[_0xb948('0x29')](_0x5dd3ed);}return null;};}function patchUpdates(_0x2f5ed2){return function(_0x4484f2){try{jsonpatch[_0xb948('0x2c')](_0x4484f2,_0x2f5ed2,!![]);}catch(_0x3e5e05){return BPromise[_0xb948('0x2d')](_0x3e5e05);}return _0x4484f2['save']();};}function saveUpdates(_0xf76ab8,_0x444ffc){return function(_0x304ada){if(_0x304ada){return _0x304ada[_0xb948('0x2e')](_0xf76ab8)[_0xb948('0x1b')](function(_0x2c7e81){return _0x2c7e81;});}return null;};}function removeEntity(_0x11ad98,_0x23e675){return function(_0x26cb62){if(_0x26cb62){return _0x26cb62[_0xb948('0x2f')]()[_0xb948('0x1b')](function(){_0x11ad98[_0xb948('0x28')](0xcc)[_0xb948('0x27')]();});}};}function handleEntityNotFound(_0x3acaa4,_0x18ac1f){return function(_0x24ffc4){if(!_0x24ffc4){_0x3acaa4[_0xb948('0x26')](0x194);}return _0x24ffc4;};}function handleError(_0x13b4a6,_0x27098e){_0x27098e=_0x27098e||0x1f4;return function(_0x4af595){logger[_0xb948('0x22')](_0x4af595[_0xb948('0x30')]);if(_0x4af595[_0xb948('0x31')]){delete _0x4af595[_0xb948('0x31')];}_0x13b4a6['status'](_0x27098e)[_0xb948('0x32')](_0x4af595);};}exports[_0xb948('0x33')]=function(_0x3aedbe,_0x5d4767){var _0xceb2e7={},_0x5d4b06={},_0x2562a9={'count':0x0,'rows':[]};var _0x44aa02=db['VtigerAccount']['rawAttributes'];_0x5d4b06[_0xb948('0x34')]=_[_0xb948('0x35')](_0x44aa02);_0x5d4b06[_0xb948('0x36')]=_[_0xb948('0x35')](_0x3aedbe[_0xb948('0x36')]);_0x5d4b06[_0xb948('0x37')]=_['intersection'](_0x5d4b06[_0xb948('0x34')],_0x5d4b06['query']);_0xceb2e7[_0xb948('0x38')]=_[_0xb948('0x39')](_0x5d4b06[_0xb948('0x34')],qs[_0xb948('0x3a')](_0x3aedbe['query'][_0xb948('0x3a')]));_0xceb2e7['attributes']=_0xceb2e7[_0xb948('0x38')][_0xb948('0x3b')]?_0xceb2e7[_0xb948('0x38')]:_0x5d4b06[_0xb948('0x34')];if(!_0x3aedbe['query']['hasOwnProperty']('nolimit')){_0xceb2e7[_0xb948('0x3c')]=qs[_0xb948('0x3c')](_0x3aedbe[_0xb948('0x36')][_0xb948('0x3c')]);_0xceb2e7[_0xb948('0x2a')]=qs[_0xb948('0x2a')](_0x3aedbe[_0xb948('0x36')][_0xb948('0x2a')]);}_0xceb2e7[_0xb948('0x3d')]=qs[_0xb948('0x3e')](_0x3aedbe[_0xb948('0x36')][_0xb948('0x3e')]);_0xceb2e7[_0xb948('0x3f')]=qs[_0xb948('0x37')](_['pick'](_0x3aedbe[_0xb948('0x36')],_0x5d4b06[_0xb948('0x37')]));if(_0x3aedbe[_0xb948('0x36')][_0xb948('0x40')]){_0xceb2e7[_0xb948('0x3f')]=_[_0xb948('0x41')](_0xceb2e7[_0xb948('0x3f')],{'$or':_[_0xb948('0x42')](_0x44aa02,function(_0xe0be00){if(_0xe0be00[_0xb948('0x43')][_0xb948('0x44')]!==_0xb948('0x45')){var _0xc36c9f={};_0xc36c9f[_0xe0be00[_0xb948('0x46')]]={'$like':'%'+_0x3aedbe[_0xb948('0x36')][_0xb948('0x40')]+'%'};return _0xc36c9f;}})});}_0xceb2e7=_[_0xb948('0x41')]({},_0xceb2e7,_0x3aedbe[_0xb948('0x47')]);var _0x5bfbb4={'where':_0xceb2e7[_0xb948('0x3f')]};return db['VtigerAccount']['count'](_0x5bfbb4)[_0xb948('0x1b')](function(_0x473809){_0x2562a9['count']=_0x473809;if(_0x3aedbe[_0xb948('0x36')][_0xb948('0x48')]){_0xceb2e7[_0xb948('0x49')]=[{'all':!![]}];}return db['VtigerAccount'][_0xb948('0x4a')](_0xceb2e7);})['then'](function(_0xb77560){_0x2562a9[_0xb948('0x4b')]=_0xb77560;return _0x2562a9;})['then'](respondWithFilteredResult(_0x5d4767,_0xceb2e7))[_0xb948('0x25')](handleError(_0x5d4767,null));};exports[_0xb948('0x4c')]=function(_0x14d8c8,_0x319ae9){var _0x4b9de2={'raw':![],'where':{'id':_0x14d8c8[_0xb948('0x4d')]['id']}},_0x18ea41={};_0x18ea41[_0xb948('0x34')]=_['keys'](db[_0xb948('0x4e')][_0xb948('0x4f')]);_0x18ea41[_0xb948('0x36')]=_[_0xb948('0x35')](_0x14d8c8['query']);_0x18ea41[_0xb948('0x37')]=_[_0xb948('0x39')](_0x18ea41['model'],_0x18ea41['query']);_0x4b9de2[_0xb948('0x38')]=_[_0xb948('0x39')](_0x18ea41[_0xb948('0x34')],qs[_0xb948('0x3a')](_0x14d8c8[_0xb948('0x36')][_0xb948('0x3a')]));_0x4b9de2[_0xb948('0x38')]=_0x4b9de2[_0xb948('0x38')][_0xb948('0x3b')]?_0x4b9de2['attributes']:_0x18ea41[_0xb948('0x34')];if(_0x14d8c8[_0xb948('0x36')]['includeAll']){_0x4b9de2[_0xb948('0x49')]=[{'all':!![]}];}_0x4b9de2=_[_0xb948('0x41')]({},_0x4b9de2,_0x14d8c8[_0xb948('0x47')]);return db[_0xb948('0x4e')][_0xb948('0x50')](_0x4b9de2)['then'](handleEntityNotFound(_0x319ae9,null))[_0xb948('0x1b')](respondWithResult(_0x319ae9,null))[_0xb948('0x25')](handleError(_0x319ae9,null));};exports[_0xb948('0x51')]=function(_0x15f4bf,_0x33c5ec){return db[_0xb948('0x4e')][_0xb948('0x51')](_0x15f4bf[_0xb948('0x52')],{})[_0xb948('0x1b')](respondWithResult(_0x33c5ec,0xc9))[_0xb948('0x25')](handleError(_0x33c5ec,null));};exports['update']=function(_0x2b7ef0,_0x582e8e){if(_0x2b7ef0[_0xb948('0x52')]['id']){delete _0x2b7ef0['body']['id'];}return db[_0xb948('0x4e')][_0xb948('0x50')]({'where':{'id':_0x2b7ef0[_0xb948('0x4d')]['id']}})[_0xb948('0x1b')](handleEntityNotFound(_0x582e8e,null))[_0xb948('0x1b')](saveUpdates(_0x2b7ef0[_0xb948('0x52')],null))[_0xb948('0x1b')](respondWithResult(_0x582e8e,null))[_0xb948('0x25')](handleError(_0x582e8e,null));};exports[_0xb948('0x2f')]=function(_0x37ea23,_0x1c4b50){return db['VtigerAccount'][_0xb948('0x50')]({'where':{'id':_0x37ea23['params']['id']}})[_0xb948('0x1b')](handleEntityNotFound(_0x1c4b50,null))[_0xb948('0x1b')](removeEntity(_0x1c4b50,null))['catch'](handleError(_0x1c4b50,null));};exports[_0xb948('0x53')]=function(_0x1fb29c,_0x5cf545,_0x3603bb){var _0xe3b7fa={};var _0x4468b1={};var _0x266a9e;var _0x4975df;return db[_0xb948('0x4e')][_0xb948('0x54')]({'where':{'id':_0x1fb29c[_0xb948('0x4d')]['id']}})[_0xb948('0x1b')](handleEntityNotFound(_0x5cf545,null))[_0xb948('0x1b')](function(_0x36dc13){if(_0x36dc13){_0x266a9e=_0x36dc13;_0x4468b1[_0xb948('0x34')]=_[_0xb948('0x35')](db[_0xb948('0x55')][_0xb948('0x4f')]);_0x4468b1['query']=_[_0xb948('0x35')](_0x1fb29c['query']);_0x4468b1['filters']=_[_0xb948('0x39')](_0x4468b1[_0xb948('0x34')],_0x4468b1['query']);_0xe3b7fa[_0xb948('0x38')]=_[_0xb948('0x39')](_0x4468b1[_0xb948('0x34')],qs[_0xb948('0x3a')](_0x1fb29c[_0xb948('0x36')][_0xb948('0x3a')]));_0xe3b7fa[_0xb948('0x38')]=_0xe3b7fa[_0xb948('0x38')][_0xb948('0x3b')]?_0xe3b7fa[_0xb948('0x38')]:_0x4468b1[_0xb948('0x34')];_0xe3b7fa['order']=qs['sort'](_0x1fb29c[_0xb948('0x36')][_0xb948('0x3e')]);_0xe3b7fa[_0xb948('0x3f')]=qs[_0xb948('0x37')](_[_0xb948('0x56')](_0x1fb29c[_0xb948('0x36')],_0x4468b1['filters']));if(_0x1fb29c['query']['filter']){_0xe3b7fa[_0xb948('0x3f')]=_['merge'](_0xe3b7fa[_0xb948('0x3f')],{'$or':_['map'](_0xe3b7fa[_0xb948('0x38')],function(_0x201368){var _0x28f419={};_0x28f419[_0x201368]={'$like':'%'+_0x1fb29c[_0xb948('0x36')]['filter']+'%'};return _0x28f419;})});}_0xe3b7fa=_['merge']({},_0xe3b7fa,_0x1fb29c['options']);return _0x266a9e[_0xb948('0x53')](_0xe3b7fa);}})[_0xb948('0x1b')](function(_0xe55ba2){if(_0xe55ba2){_0x4975df=_0xe55ba2['length'];if(!_0x1fb29c[_0xb948('0x36')][_0xb948('0x57')](_0xb948('0x58'))){_0xe3b7fa[_0xb948('0x3c')]=qs[_0xb948('0x3c')](_0x1fb29c[_0xb948('0x36')][_0xb948('0x3c')]);_0xe3b7fa['offset']=qs[_0xb948('0x2a')](_0x1fb29c[_0xb948('0x36')][_0xb948('0x2a')]);}return _0x266a9e[_0xb948('0x53')](_0xe3b7fa);}})[_0xb948('0x1b')](function(_0xa5c4db){if(_0xa5c4db){return _0xa5c4db?{'count':_0x4975df,'rows':_0xa5c4db}:null;}})['then'](respondWithResult(_0x5cf545,null))[_0xb948('0x25')](handleError(_0x5cf545,null));};exports[_0xb948('0x59')]=function(_0x2c17a4,_0x58b7de,_0x24b76a){if(_0x2c17a4['body']['id']){delete _0x2c17a4['body']['id'];}return db[_0xb948('0x4e')][_0xb948('0x54')]({'where':{'id':_0x2c17a4['params']['id']}})['then'](handleEntityNotFound(_0x58b7de,null))['then'](function(_0x573c11){if(_0x573c11){_0x2c17a4[_0xb948('0x52')]['AccountId']=_0x573c11['id'];_0x2c17a4[_0xb948('0x52')][_0xb948('0x5a')]=integrations[_0xb948('0x5b')](_0x2c17a4[_0xb948('0x52')]['channel'],_0x2c17a4[_0xb948('0x52')][_0xb948('0x43')]);_0x2c17a4[_0xb948('0x52')][_0xb948('0x5c')]=integrations['getDescriptions'](_0x2c17a4['body'][_0xb948('0x5d')],_0x2c17a4['body']['type']);return db[_0xb948('0x55')][_0xb948('0x51')](_0x2c17a4[_0xb948('0x52')],{'include':[{'model':db[_0xb948('0x5e')],'as':_0xb948('0x5a')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xb948('0x1b')](respondWithResult(_0x58b7de,null))[_0xb948('0x25')](handleError(_0x58b7de,null));};var md5=require('md5');exports[_0xb948('0x5f')]=function(_0x2c9abe,_0x1b40f3,_0x594657){var _0x2c3cba=null;var _0x51fddd=null;var _0x455a34=null;var _0x21adcd=null;var _0x38adc1='';return db[_0xb948('0x4e')]['findOne']({'where':{'id':_0x2c9abe[_0xb948('0x4d')]['id']},'attributes':['id',_0xb948('0x31'),_0xb948('0x60'),_0xb948('0x61'),'moduleName','remoteUri',_0xb948('0x62'),'accessKey']})[_0xb948('0x1b')](handleEntityNotFound(_0x1b40f3,null))[_0xb948('0x1b')](function(_0x414840){if(_0x414840){_0x2c3cba=_0x414840[_0xb948('0x60')];_0x51fddd=_0x414840[_0xb948('0x63')];_0x455a34=_0x414840[_0xb948('0x64')];_0x38adc1=_0x414840[_0xb948('0x65')];var _0x2490ef=_0x38adc1[_0xb948('0x66')](-0x1);if(_0x2490ef==='/'){_0x38adc1=_0x38adc1['substring'](0x0,_0x38adc1[_0xb948('0x67')](_0x2490ef));}_0x21adcd=util[_0xb948('0x68')](_0xb948('0x69'),_0x38adc1);var _0x1d2452={'method':_0xb948('0x6a'),'uri':_0x21adcd,'qs':{'operation':'getchallenge','username':_0x414840['username']},'json':!![]};return rp(_0x1d2452);}})[_0xb948('0x1b')](function(_0x326ca7){if(_0x326ca7[_0xb948('0x6b')]){var _0x18ff91={'method':_0xb948('0x6c'),'uri':_0x21adcd,'form':{'operation':_0xb948('0x6d'),'username':_0x2c3cba,'accessKey':md5(_0x326ca7[_0xb948('0x24')]['token']+_0x51fddd)},'json':!![]};return rp(_0x18ff91);}})['then'](function(_0x124eaa){if(_0x124eaa[_0xb948('0x6b')]){var _0x123de8={'method':_0xb948('0x6a'),'uri':_0x21adcd,'qs':{'operation':_0xb948('0x6e'),'username':_0x2c3cba,'sessionName':_0x124eaa[_0xb948('0x24')][_0xb948('0x6f')],'elementType':_0x455a34},'json':!![]};return rp(_0x123de8);}})[_0xb948('0x1b')](function(_0x717873){if(_0x717873['success']){var _0x16b11b=[_0xb948('0x70'),_0xb948('0x71'),'owner'];_[_0xb948('0x72')](_0x717873[_0xb948('0x24')][_0xb948('0x3a')],function(_0xe8d06b){return _0x16b11b[_0xb948('0x73')](_0xe8d06b[_0xb948('0x43')][_0xb948('0x31')]);});_[_0xb948('0x72')](_0x717873[_0xb948('0x24')]['fields'],function(_0xd147f7){return _0xd147f7['editable']===_0xb948('0x74');});return{'count':_0x717873[_0xb948('0x24')][_0xb948('0x3a')][_0xb948('0x3b')],'rows':_[_0xb948('0x42')](_0x717873[_0xb948('0x24')]['fields'],function(_0x372089){return{'id':_0x372089[_0xb948('0x31')],'name':_0x372089[_0xb948('0x75')],'custom':_[_0xb948('0x76')](_0x372089[_0xb948('0x31')],_0xb948('0x77'))?!![]:![],'options':_0x372089[_0xb948('0x43')][_0xb948('0x31')]===_0xb948('0x78')&&_0x372089['type'][_0xb948('0x79')][_0xb948('0x3b')]>0x0?_[_0xb948('0x42')](_0x372089[_0xb948('0x43')][_0xb948('0x79')],function(_0x24d937){return{'name':_0x24d937['label'],'value':_0x24d937[_0xb948('0x7a')]};}):[]};})};}})[_0xb948('0x1b')](respondWithResult(_0x1b40f3,null))[_0xb948('0x25')](function(_0x402803){console[_0xb948('0x7b')](_0xb948('0x7c')+_0x402803);var _0x2364ad=_0x2c9abe[_0xb948('0x36')][_0xb948('0x19')]?0x1f4:_0x402803[_0xb948('0x7d')]||0x1f4;logger[_0xb948('0x22')](_0xb948('0x7e'),_0xb948('0x5f'),_0x2364ad,JSON['stringify'](_0x402803));delete _0x402803[_0xb948('0x31')];if(_0x2364ad===0x191){_0x2364ad=0x190;}_0x1b40f3[_0xb948('0x28')](_0x2364ad)[_0xb948('0x32')](_0x2c9abe['query'][_0xb948('0x19')]?{'message':_0xb948('0x7f'),'statusCode':_0x402803[_0xb948('0x7d')]}:_0x402803);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1c19011..b4b84fb 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 _0x1893=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x465b89,_0x5daa97){var _0x31a252=function(_0x4fe129){while(--_0x4fe129){_0x465b89['push'](_0x465b89['shift']());}};_0x31a252(++_0x5daa97);}(_0x1893,0xa2));var _0x3189=function(_0x224f30,_0x4483c7){_0x224f30=_0x224f30-0x0;var _0x2a67ad=_0x1893[_0x224f30];return _0x2a67ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));var integrations=require(_0x3189('0x8'));module[_0x3189('0x9')]=function(_0x4080a9,_0x77c566){return _0x4080a9[_0x3189('0xa')](_0x3189('0xb'),attributes,{'tableName':_0x3189('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14b2=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api'];(function(_0x149eee,_0x17a09b){var _0x27488c=function(_0x33b09a){while(--_0x33b09a){_0x149eee['push'](_0x149eee['shift']());}};_0x27488c(++_0x17a09b);}(_0x14b2,0x1a1));var _0x214b=function(_0x3c02fd,_0x1ab9a8){_0x3c02fd=_0x3c02fd-0x0;var _0x1a6058=_0x14b2[_0x3c02fd];return _0x1a6058;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var logger=require('../../config/logger')(_0x214b('0x2'));var moment=require(_0x214b('0x3'));var BPromise=require(_0x214b('0x4'));var rp=require(_0x214b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x214b('0x6'));var config=require(_0x214b('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x214b('0x8')]=function(_0x264d5e,_0x30867e){return _0x264d5e[_0x214b('0x9')](_0x214b('0xa'),attributes,{'tableName':_0x214b('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 58f49ec..9153ca0 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 _0x64e0=['model','info','ShowVtigerAccount','where','catch','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map'];(function(_0xc1af05,_0x4a1a4a){var _0x652c0=function(_0x5a9add){while(--_0x5a9add){_0xc1af05['push'](_0xc1af05['shift']());}};_0x652c0(++_0x4a1a4a);}(_0x64e0,0x185));var _0x064e=function(_0xb7cb72,_0x19d391){_0xb7cb72=_0xb7cb72-0x0;var _0x4b7570=_0x64e0[_0xb7cb72];return _0x4b7570;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x064e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x064e('0x1'));var db=require(_0x064e('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x064e('0x3'));var config=require(_0x064e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x064e('0x5')][_0x064e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1fa13e,_0x50690b,_0x294c25){return new BPromise(function(_0x3e49e4,_0x25193b){return client[_0x064e('0x7')](_0x1fa13e,_0x294c25)[_0x064e('0x8')](function(_0x2543c6){logger['info'](_0x064e('0x9'),_0x50690b,_0x064e('0xa'));logger[_0x064e('0xb')](_0x064e('0xc'),_0x50690b,_0x064e('0xa'),JSON[_0x064e('0xd')](_0x2543c6));if(_0x2543c6[_0x064e('0xe')]){if(_0x2543c6[_0x064e('0xe')][_0x064e('0xf')]===0x1f4){logger[_0x064e('0xe')](_0x064e('0x9'),_0x50690b,_0x2543c6[_0x064e('0xe')][_0x064e('0x10')]);return _0x25193b(_0x2543c6[_0x064e('0xe')][_0x064e('0x10')]);}logger[_0x064e('0xe')](_0x064e('0x9'),_0x50690b,_0x2543c6['error'][_0x064e('0x10')]);return _0x3e49e4(_0x2543c6[_0x064e('0xe')][_0x064e('0x10')]);}else{logger['info'](_0x064e('0x9'),_0x50690b,'request\x20sent');_0x3e49e4(_0x2543c6[_0x064e('0x11')][_0x064e('0x10')]);}})['catch'](function(_0x28b877){logger[_0x064e('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x50690b,_0x28b877);_0x25193b(_0x28b877);});});}exports[_0x064e('0x12')]=function(_0x89152b){var _0x173222=this;return new Promise(function(_0x152432,_0x20a3f4){return db[_0x064e('0x13')][_0x064e('0x14')]({'raw':_0x89152b[_0x064e('0x15')]?_0x89152b[_0x064e('0x15')][_0x064e('0x16')]===undefined?!![]:![]:!![],'where':_0x89152b[_0x064e('0x15')]?_0x89152b[_0x064e('0x15')]['where']||null:null,'attributes':_0x89152b[_0x064e('0x15')]?_0x89152b[_0x064e('0x15')][_0x064e('0x17')]||null:null,'limit':_0x89152b[_0x064e('0x15')]?_0x89152b[_0x064e('0x15')][_0x064e('0x18')]||null:null,'include':_0x89152b[_0x064e('0x15')]?_0x89152b['options'][_0x064e('0x19')]?_[_0x064e('0x1a')](_0x89152b['options'][_0x064e('0x19')],function(_0x2758ec){return{'model':db[_0x2758ec['model']],'as':_0x2758ec['as'],'attributes':_0x2758ec[_0x064e('0x17')],'include':_0x2758ec[_0x064e('0x19')]?_[_0x064e('0x1a')](_0x2758ec[_0x064e('0x19')],function(_0x3b9b5d){return{'model':db[_0x3b9b5d['model']],'as':_0x3b9b5d['as'],'attributes':_0x3b9b5d['attributes'],'include':_0x3b9b5d[_0x064e('0x19')]?_[_0x064e('0x1a')](_0x3b9b5d[_0x064e('0x19')],function(_0x194124){return{'model':db[_0x194124[_0x064e('0x1b')]],'as':_0x194124['as'],'attributes':_0x194124[_0x064e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x064e('0x8')](function(_0x5da479){logger[_0x064e('0x1c')](_0x064e('0x12'),_0x89152b);logger['debug'](_0x064e('0x12'),_0x89152b,JSON[_0x064e('0xd')](_0x5da479));_0x152432(_0x5da479);})['catch'](function(_0x5342db){logger['error'](_0x064e('0x12'),_0x5342db['message'],_0x89152b);_0x20a3f4(_0x173222[_0x064e('0xe')](0x1f4,_0x5342db['message']));});});};exports[_0x064e('0x1d')]=function(_0x2bed69){var _0x119e32=this;return new Promise(function(_0x940aac,_0x249b99){return db[_0x064e('0x13')]['find']({'raw':_0x2bed69[_0x064e('0x15')]?_0x2bed69['options'][_0x064e('0x16')]===undefined?!![]:![]:!![],'where':_0x2bed69['options']?_0x2bed69[_0x064e('0x15')][_0x064e('0x1e')]||null:null,'attributes':_0x2bed69[_0x064e('0x15')]?_0x2bed69['options'][_0x064e('0x17')]||null:null,'include':_0x2bed69[_0x064e('0x15')]?_0x2bed69['options']['include']?_[_0x064e('0x1a')](_0x2bed69[_0x064e('0x15')][_0x064e('0x19')],function(_0x27f3ff){return{'model':db[_0x27f3ff[_0x064e('0x1b')]],'as':_0x27f3ff['as'],'attributes':_0x27f3ff[_0x064e('0x17')],'include':_0x27f3ff[_0x064e('0x19')]?_[_0x064e('0x1a')](_0x27f3ff[_0x064e('0x19')],function(_0x429ed3){return{'model':db[_0x429ed3['model']],'as':_0x429ed3['as'],'attributes':_0x429ed3[_0x064e('0x17')],'include':_0x429ed3[_0x064e('0x19')]?_[_0x064e('0x1a')](_0x429ed3[_0x064e('0x19')],function(_0x29a77b){return{'model':db[_0x29a77b[_0x064e('0x1b')]],'as':_0x29a77b['as'],'attributes':_0x29a77b[_0x064e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x064e('0x8')](function(_0x129022){logger[_0x064e('0x1c')]('ShowVtigerAccount',_0x2bed69);logger[_0x064e('0xb')](_0x064e('0x1d'),_0x2bed69,JSON[_0x064e('0xd')](_0x129022));_0x940aac(_0x129022);})[_0x064e('0x1f')](function(_0x474d21){logger[_0x064e('0xe')](_0x064e('0x1d'),_0x474d21[_0x064e('0x10')],_0x2bed69);_0x249b99(_0x119e32[_0x064e('0xe')](0x1f4,_0x474d21[_0x064e('0x10')]));});});}; \ No newline at end of file +var _0xe83c=['stringify','error','message','result','catch','findAll','options','where','attributes','include','model','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2b6eb0,_0x44f80b){var _0x5d3621=function(_0x495e7f){while(--_0x495e7f){_0x2b6eb0['push'](_0x2b6eb0['shift']());}};_0x5d3621(++_0x44f80b);}(_0xe83c,0x1c1));var _0xce83=function(_0x15f236,_0x59a12b){_0x15f236=_0x15f236-0x0;var _0x3645c0=_0xe83c[_0x15f236];return _0x3645c0;};'use strict';var _=require('lodash');var util=require(_0xce83('0x0'));var moment=require(_0xce83('0x1'));var BPromise=require(_0xce83('0x2'));var rs=require(_0xce83('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce83('0x4'))['db'];var utils=require(_0xce83('0x5'));var logger=require(_0xce83('0x6'))(_0xce83('0x7'));var config=require(_0xce83('0x8'));var jayson=require(_0xce83('0x9'));var client=jayson[_0xce83('0xa')][_0xce83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245b9d,_0x434404,_0x1fbff3){return new BPromise(function(_0x3e339d,_0x655ded){return client[_0xce83('0xc')](_0x245b9d,_0x1fbff3)[_0xce83('0xd')](function(_0x539e9e){logger[_0xce83('0xe')](_0xce83('0xf'),_0x434404,_0xce83('0x10'));logger[_0xce83('0x11')](_0xce83('0x12'),_0x434404,_0xce83('0x10'),JSON[_0xce83('0x13')](_0x539e9e));if(_0x539e9e[_0xce83('0x14')]){if(_0x539e9e['error']['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x434404,_0x539e9e[_0xce83('0x14')][_0xce83('0x15')]);return _0x655ded(_0x539e9e[_0xce83('0x14')][_0xce83('0x15')]);}logger[_0xce83('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x434404,_0x539e9e[_0xce83('0x14')][_0xce83('0x15')]);return _0x3e339d(_0x539e9e['error']['message']);}else{logger[_0xce83('0xe')](_0xce83('0xf'),_0x434404,_0xce83('0x10'));_0x3e339d(_0x539e9e[_0xce83('0x16')][_0xce83('0x15')]);}})[_0xce83('0x17')](function(_0x363e21){logger[_0xce83('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x434404,_0x363e21);_0x655ded(_0x363e21);});});}exports['GetVtigerAccount']=function(_0x9e648c){var _0x58f42c=this;return new Promise(function(_0x7ce83e,_0x763e45){return db['VtigerAccount'][_0xce83('0x18')]({'raw':_0x9e648c[_0xce83('0x19')]?_0x9e648c['options']['raw']===undefined?!![]:![]:!![],'where':_0x9e648c[_0xce83('0x19')]?_0x9e648c[_0xce83('0x19')][_0xce83('0x1a')]||null:null,'attributes':_0x9e648c['options']?_0x9e648c['options'][_0xce83('0x1b')]||null:null,'limit':_0x9e648c[_0xce83('0x19')]?_0x9e648c[_0xce83('0x19')]['limit']||null:null,'include':_0x9e648c[_0xce83('0x19')]?_0x9e648c[_0xce83('0x19')][_0xce83('0x1c')]?_['map'](_0x9e648c[_0xce83('0x19')][_0xce83('0x1c')],function(_0x2cb4ea){return{'model':db[_0x2cb4ea[_0xce83('0x1d')]],'as':_0x2cb4ea['as'],'attributes':_0x2cb4ea[_0xce83('0x1b')],'include':_0x2cb4ea[_0xce83('0x1c')]?_[_0xce83('0x1e')](_0x2cb4ea[_0xce83('0x1c')],function(_0x197942){return{'model':db[_0x197942[_0xce83('0x1d')]],'as':_0x197942['as'],'attributes':_0x197942['attributes'],'include':_0x197942['include']?_['map'](_0x197942['include'],function(_0x75aa52){return{'model':db[_0x75aa52[_0xce83('0x1d')]],'as':_0x75aa52['as'],'attributes':_0x75aa52[_0xce83('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce83('0xd')](function(_0x43b677){logger['info'](_0xce83('0x1f'),_0x9e648c);logger[_0xce83('0x11')]('GetVtigerAccount',_0x9e648c,JSON[_0xce83('0x13')](_0x43b677));_0x7ce83e(_0x43b677);})[_0xce83('0x17')](function(_0x1b0306){logger[_0xce83('0x14')](_0xce83('0x1f'),_0x1b0306[_0xce83('0x15')],_0x9e648c);_0x763e45(_0x58f42c[_0xce83('0x14')](0x1f4,_0x1b0306[_0xce83('0x15')]));});});};exports[_0xce83('0x20')]=function(_0x68a25f){var _0x3dbecf=this;return new Promise(function(_0x3a5361,_0x533cfa){return db[_0xce83('0x21')][_0xce83('0x22')]({'raw':_0x68a25f[_0xce83('0x19')]?_0x68a25f[_0xce83('0x19')][_0xce83('0x23')]===undefined?!![]:![]:!![],'where':_0x68a25f['options']?_0x68a25f[_0xce83('0x19')][_0xce83('0x1a')]||null:null,'attributes':_0x68a25f['options']?_0x68a25f['options'][_0xce83('0x1b')]||null:null,'include':_0x68a25f['options']?_0x68a25f[_0xce83('0x19')][_0xce83('0x1c')]?_[_0xce83('0x1e')](_0x68a25f[_0xce83('0x19')][_0xce83('0x1c')],function(_0x1d3488){return{'model':db[_0x1d3488[_0xce83('0x1d')]],'as':_0x1d3488['as'],'attributes':_0x1d3488[_0xce83('0x1b')],'include':_0x1d3488['include']?_[_0xce83('0x1e')](_0x1d3488[_0xce83('0x1c')],function(_0x428512){return{'model':db[_0x428512[_0xce83('0x1d')]],'as':_0x428512['as'],'attributes':_0x428512[_0xce83('0x1b')],'include':_0x428512[_0xce83('0x1c')]?_['map'](_0x428512[_0xce83('0x1c')],function(_0x340576){return{'model':db[_0x340576[_0xce83('0x1d')]],'as':_0x340576['as'],'attributes':_0x340576[_0xce83('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce83('0xd')](function(_0x171d7d){logger['info']('ShowVtigerAccount',_0x68a25f);logger['debug'](_0xce83('0x20'),_0x68a25f,JSON['stringify'](_0x171d7d));_0x3a5361(_0x171d7d);})['catch'](function(_0x2e9527){logger['error'](_0xce83('0x20'),_0x2e9527[_0xce83('0x15')],_0x68a25f);_0x533cfa(_0x3dbecf[_0xce83('0x14')](0x1f4,_0x2e9527[_0xce83('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index e883b47..3dfd9ed 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 _0xe706=['update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0xe706,0xa3));var _0x6e70=function(_0x127af0,_0x49fbc5){_0x127af0=_0x127af0-0x0;var _0x1fc410=_0xe706[_0x127af0];return _0x1fc410;};'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 auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x9')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router[_0x6e70('0x14')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0713=['post','create','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1eb4e0,_0x4ebc2d){var _0x18ec21=function(_0x28c9a9){while(--_0x28c9a9){_0x1eb4e0['push'](_0x1eb4e0['shift']());}};_0x18ec21(++_0x4ebc2d);}(_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 auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x7')](_0x3071('0x10'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x13')]);router[_0x3071('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x15')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6ca6b46..40f7c18 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 _0xa6ec=['sequelize','exports','STRING'];(function(_0x1d18a0,_0x156273){var _0x4df4a6=function(_0x1c95a1){while(--_0x1c95a1){_0x1d18a0['push'](_0x1d18a0['shift']());}};_0x4df4a6(++_0x156273);}(_0xa6ec,0x81));var _0xca6e=function(_0x58b961,_0x57776a){_0x58b961=_0x58b961-0x0;var _0x432a84=_0xa6ec[_0x58b961];return _0x432a84;};'use strict';var Sequelize=require(_0xca6e('0x0'));module[_0xca6e('0x1')]={'name':{'type':Sequelize[_0xca6e('0x2')]},'description':{'type':Sequelize[_0xca6e('0x2')]}}; \ No newline at end of file +var _0x8a57=['STRING','sequelize','exports'];(function(_0x1c02ee,_0x1d7fdf){var _0x30df30=function(_0x152ef7){while(--_0x152ef7){_0x1c02ee['push'](_0x1c02ee['shift']());}};_0x30df30(++_0x1d7fdf);}(_0x8a57,0x163));var _0x78a5=function(_0xee6113,_0x5933d6){_0xee6113=_0xee6113-0x0;var _0x257a33=_0x8a57[_0xee6113];return _0x257a33;};'use strict';var Sequelize=require(_0x78a5('0x0'));module[_0x78a5('0x1')]={'name':{'type':Sequelize[_0x78a5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 475f688..429fbe0 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 _0x6785=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','VtigerConfiguration','includeAll','include','findAll','then','rows','show','params','options','create','body','find','findOne','VtigerField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x173b35,_0x5830a){var _0x5d68fb=function(_0x3a0dab){while(--_0x3a0dab){_0x173b35['push'](_0x173b35['shift']());}};_0x5d68fb(++_0x5830a);}(_0x6785,0xa6));var _0x5678=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6785[_0x36eaaa];return _0x461349;};'use strict';var pdf=require(_0x5678('0x0'));var emlformat=require(_0x5678('0x1'));var rimraf=require(_0x5678('0x2'));var zipdir=require(_0x5678('0x3'));var jsonpatch=require(_0x5678('0x4'));var rp=require(_0x5678('0x5'));var moment=require(_0x5678('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5678('0x7'));var util=require(_0x5678('0x8'));var path=require(_0x5678('0x9'));var sox=require(_0x5678('0xa'));var csv=require('to-csv');var ejs=require(_0x5678('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5678('0xc'));var crypto=require(_0x5678('0xd'));var jsforce=require(_0x5678('0xe'));var deskjs=require(_0x5678('0xf'));var toCsv=require(_0x5678('0x10'));var querystring=require('querystring');var Papa=require(_0x5678('0x11'));var Redis=require('ioredis');var authService=require(_0x5678('0x12'));var qs=require(_0x5678('0x13'));var hardwareService=require(_0x5678('0x14'));var logger=require(_0x5678('0x15'))(_0x5678('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5678('0x17'))['db'];var jayson=require(_0x5678('0x18'));var client=jayson[_0x5678('0x19')][_0x5678('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x441732,_0x5cf38b,_0x3c481e){if(_0x3c481e){var _0x4d3a83=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d3a83[_0x5678('0x1b')](_0x5cf38b)){return _0x441732;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x441732;}}function respondWithRpcPromise(_0x10c45b,_0x4a70fd,_0x17ba35,_0x179ec5){return new BPromise(function(_0x7a6f6f,_0x83513a){var _0x59df32=_0x179ec5||client;return _0x59df32['request'](_0x10c45b,_0x17ba35)['then'](function(_0x3839d7){logger[_0x5678('0x1c')](_0x5678('0x1d'),_0x4a70fd,_0x5678('0x1e'));logger[_0x5678('0x1f')](_0x5678('0x20'),_0x4a70fd,_0x5678('0x1e'),JSON['stringify'](_0x3839d7));if(_0x3839d7[_0x5678('0x21')]){if(_0x3839d7['error'][_0x5678('0x22')]===0x1f4){logger[_0x5678('0x21')](_0x5678('0x1d'),_0x4a70fd,_0x3839d7['error']['message']);return _0x83513a(_0x3839d7[_0x5678('0x21')][_0x5678('0x23')]);}logger[_0x5678('0x21')](_0x5678('0x1d'),_0x4a70fd,_0x3839d7[_0x5678('0x21')][_0x5678('0x23')]);return _0x7a6f6f(_0x3839d7[_0x5678('0x21')][_0x5678('0x23')]);}else{logger[_0x5678('0x1c')](_0x5678('0x1d'),_0x4a70fd,_0x5678('0x1e'));_0x7a6f6f(_0x3839d7['result']['message']);}})[_0x5678('0x24')](function(_0x4a824d){logger[_0x5678('0x21')](_0x5678('0x1d'),_0x4a70fd,_0x4a824d);_0x83513a(_0x4a824d);});});}function respondWithStatusCode(_0xa2e795,_0x54cf8c){_0x54cf8c=_0x54cf8c||0xcc;return function(_0x2668df){if(_0x2668df){return _0xa2e795[_0x5678('0x25')](_0x54cf8c);}return _0xa2e795['status'](_0x54cf8c)['end']();};}function respondWithResult(_0x3e2d3e,_0x712ef4){_0x712ef4=_0x712ef4||0xc8;return function(_0x171f3c){if(_0x171f3c){return _0x3e2d3e[_0x5678('0x26')](_0x712ef4)[_0x5678('0x27')](_0x171f3c);}};}function respondWithFilteredResult(_0x277aeb,_0x1885a0){return function(_0x128928){if(_0x128928){var _0x1eed8c=_0x128928[_0x5678('0x28')],_0x45cd03=_0x1885a0[_0x5678('0x29')],_0x1b7dcb=_0x1885a0['offset']+_0x1885a0[_0x5678('0x2a')],_0x171d74;if(_0x1b7dcb>=_0x1eed8c){_0x1b7dcb=_0x1eed8c;_0x171d74=0xc8;}else{_0x171d74=0xce;}_0x277aeb['status'](_0x171d74);return _0x277aeb[_0x5678('0x2b')](_0x5678('0x2c'),_0x45cd03+'-'+_0x1b7dcb+'/'+_0x1eed8c)[_0x5678('0x27')](_0x128928);}return null;};}function patchUpdates(_0x4cd8dc){return function(_0x411ee9){try{jsonpatch['apply'](_0x411ee9,_0x4cd8dc,!![]);}catch(_0x979630){return BPromise[_0x5678('0x2d')](_0x979630);}return _0x411ee9[_0x5678('0x2e')]();};}function saveUpdates(_0x101a63,_0x53ecad){return function(_0x357703){if(_0x357703){return _0x357703[_0x5678('0x2f')](_0x101a63)['then'](function(_0x4a6b8f){return _0x4a6b8f;});}return null;};}function removeEntity(_0x337334,_0xa89539){return function(_0x5c0cf1){if(_0x5c0cf1){return _0x5c0cf1[_0x5678('0x30')]()['then'](function(){_0x337334[_0x5678('0x26')](0xcc)[_0x5678('0x31')]();});}};}function handleEntityNotFound(_0xf0a235,_0x4d6540){return function(_0x2db7b0){if(!_0x2db7b0){_0xf0a235[_0x5678('0x25')](0x194);}return _0x2db7b0;};}function handleError(_0x261ab8,_0x88d6ec){_0x88d6ec=_0x88d6ec||0x1f4;return function(_0x11539f){logger[_0x5678('0x21')](_0x11539f[_0x5678('0x32')]);if(_0x11539f[_0x5678('0x33')]){delete _0x11539f[_0x5678('0x33')];}_0x261ab8['status'](_0x88d6ec)[_0x5678('0x34')](_0x11539f);};}exports['index']=function(_0xb66932,_0x351ba2){var _0x3221d4={},_0x553277={},_0x39850e={'count':0x0,'rows':[]};var _0x3afce7=db['VtigerConfiguration'][_0x5678('0x35')];_0x553277[_0x5678('0x36')]=_[_0x5678('0x37')](_0x3afce7);_0x553277[_0x5678('0x38')]=_[_0x5678('0x37')](_0xb66932[_0x5678('0x38')]);_0x553277[_0x5678('0x39')]=_[_0x5678('0x3a')](_0x553277[_0x5678('0x36')],_0x553277[_0x5678('0x38')]);_0x3221d4[_0x5678('0x3b')]=_[_0x5678('0x3a')](_0x553277['model'],qs[_0x5678('0x3c')](_0xb66932['query'][_0x5678('0x3c')]));_0x3221d4[_0x5678('0x3b')]=_0x3221d4[_0x5678('0x3b')][_0x5678('0x3d')]?_0x3221d4[_0x5678('0x3b')]:_0x553277['model'];if(!_0xb66932[_0x5678('0x38')][_0x5678('0x3e')](_0x5678('0x3f'))){_0x3221d4[_0x5678('0x2a')]=qs['limit'](_0xb66932[_0x5678('0x38')][_0x5678('0x2a')]);_0x3221d4[_0x5678('0x29')]=qs[_0x5678('0x29')](_0xb66932['query']['offset']);}_0x3221d4[_0x5678('0x40')]=qs['sort'](_0xb66932[_0x5678('0x38')][_0x5678('0x41')]);_0x3221d4[_0x5678('0x42')]=qs[_0x5678('0x39')](_[_0x5678('0x43')](_0xb66932[_0x5678('0x38')],_0x553277[_0x5678('0x39')]));if(_0xb66932[_0x5678('0x38')]['filter']){_0x3221d4[_0x5678('0x42')]=_[_0x5678('0x44')](_0x3221d4[_0x5678('0x42')],{'$or':_[_0x5678('0x45')](_0x3afce7,function(_0x9d5656){if(_0x9d5656[_0x5678('0x46')][_0x5678('0x47')]!==_0x5678('0x48')){var _0x5ccf05={};_0x5ccf05[_0x9d5656[_0x5678('0x49')]]={'$like':'%'+_0xb66932['query'][_0x5678('0x4a')]+'%'};return _0x5ccf05;}})});}_0x3221d4=_[_0x5678('0x44')]({},_0x3221d4,_0xb66932['options']);var _0x171c8e={'where':_0x3221d4['where']};return db[_0x5678('0x4b')]['count'](_0x171c8e)['then'](function(_0x2bf229){_0x39850e['count']=_0x2bf229;if(_0xb66932[_0x5678('0x38')][_0x5678('0x4c')]){_0x3221d4[_0x5678('0x4d')]=[{'all':!![]}];}return db[_0x5678('0x4b')][_0x5678('0x4e')](_0x3221d4);})[_0x5678('0x4f')](function(_0x4f4fce){_0x39850e[_0x5678('0x50')]=_0x4f4fce;return _0x39850e;})[_0x5678('0x4f')](respondWithFilteredResult(_0x351ba2,_0x3221d4))['catch'](handleError(_0x351ba2,null));};exports[_0x5678('0x51')]=function(_0x21e8dc,_0x37e2b6){var _0x1621a9={'raw':![],'where':{'id':_0x21e8dc[_0x5678('0x52')]['id']}},_0x492217={};_0x492217[_0x5678('0x36')]=_[_0x5678('0x37')](db[_0x5678('0x4b')]['rawAttributes']);_0x492217[_0x5678('0x38')]=_['keys'](_0x21e8dc[_0x5678('0x38')]);_0x492217[_0x5678('0x39')]=_[_0x5678('0x3a')](_0x492217[_0x5678('0x36')],_0x492217[_0x5678('0x38')]);_0x1621a9[_0x5678('0x3b')]=_[_0x5678('0x3a')](_0x492217[_0x5678('0x36')],qs[_0x5678('0x3c')](_0x21e8dc[_0x5678('0x38')]['fields']));_0x1621a9[_0x5678('0x3b')]=_0x1621a9[_0x5678('0x3b')][_0x5678('0x3d')]?_0x1621a9[_0x5678('0x3b')]:_0x492217[_0x5678('0x36')];if(_0x21e8dc[_0x5678('0x38')]['includeAll']){_0x1621a9[_0x5678('0x4d')]=[{'all':!![]}];}_0x1621a9=_['merge']({},_0x1621a9,_0x21e8dc[_0x5678('0x53')]);return db[_0x5678('0x4b')]['find'](_0x1621a9)['then'](handleEntityNotFound(_0x37e2b6,null))[_0x5678('0x4f')](respondWithResult(_0x37e2b6,null))[_0x5678('0x24')](handleError(_0x37e2b6,null));};exports[_0x5678('0x54')]=function(_0x33012f,_0x2f5c7c){return db['VtigerConfiguration'][_0x5678('0x54')](_0x33012f[_0x5678('0x55')],{})['then'](respondWithResult(_0x2f5c7c,0xc9))['catch'](handleError(_0x2f5c7c,null));};exports[_0x5678('0x2f')]=function(_0xb21192,_0x28b246){if(_0xb21192['body']['id']){delete _0xb21192[_0x5678('0x55')]['id'];}return db[_0x5678('0x4b')]['find']({'where':{'id':_0xb21192[_0x5678('0x52')]['id']}})[_0x5678('0x4f')](handleEntityNotFound(_0x28b246,null))[_0x5678('0x4f')](saveUpdates(_0xb21192[_0x5678('0x55')],null))[_0x5678('0x4f')](respondWithResult(_0x28b246,null))[_0x5678('0x24')](handleError(_0x28b246,null));};exports['destroy']=function(_0x2135d1,_0x228b28){return db[_0x5678('0x4b')][_0x5678('0x56')]({'where':{'id':_0x2135d1['params']['id']}})[_0x5678('0x4f')](handleEntityNotFound(_0x228b28,null))['then'](removeEntity(_0x228b28,null))[_0x5678('0x24')](handleError(_0x228b28,null));};exports['getFields']=function(_0x237ebc,_0x1060e3,_0x1b76e3){var _0x5cfe81={};var _0x12d83b={};var _0x4678e4;var _0x2fe96e;return db['VtigerConfiguration'][_0x5678('0x57')]({'where':{'id':_0x237ebc[_0x5678('0x52')]['id']}})['then'](handleEntityNotFound(_0x1060e3,null))[_0x5678('0x4f')](function(_0x51f1d1){if(_0x51f1d1){_0x4678e4=_0x51f1d1;_0x12d83b[_0x5678('0x36')]=_[_0x5678('0x37')](db[_0x5678('0x58')]['rawAttributes']);_0x12d83b[_0x5678('0x38')]=_[_0x5678('0x37')](_0x237ebc[_0x5678('0x38')]);_0x12d83b[_0x5678('0x39')]=_[_0x5678('0x3a')](_0x12d83b['model'],_0x12d83b[_0x5678('0x38')]);_0x5cfe81['attributes']=_[_0x5678('0x3a')](_0x12d83b[_0x5678('0x36')],qs[_0x5678('0x3c')](_0x237ebc[_0x5678('0x38')][_0x5678('0x3c')]));_0x5cfe81[_0x5678('0x3b')]=_0x5cfe81['attributes']['length']?_0x5cfe81[_0x5678('0x3b')]:_0x12d83b[_0x5678('0x36')];_0x5cfe81[_0x5678('0x40')]=qs[_0x5678('0x41')](_0x237ebc[_0x5678('0x38')][_0x5678('0x41')]);_0x5cfe81['where']=qs[_0x5678('0x39')](_[_0x5678('0x43')](_0x237ebc[_0x5678('0x38')],_0x12d83b[_0x5678('0x39')]));if(_0x237ebc[_0x5678('0x38')][_0x5678('0x4a')]){_0x5cfe81[_0x5678('0x42')]=_[_0x5678('0x44')](_0x5cfe81[_0x5678('0x42')],{'$or':_[_0x5678('0x45')](_0x5cfe81[_0x5678('0x3b')],function(_0x344a01){var _0x1554bd={};_0x1554bd[_0x344a01]={'$like':'%'+_0x237ebc[_0x5678('0x38')][_0x5678('0x4a')]+'%'};return _0x1554bd;})});}_0x5cfe81=_['merge']({},_0x5cfe81,_0x237ebc[_0x5678('0x53')]);return _0x4678e4[_0x5678('0x59')](_0x5cfe81);}})['then'](function(_0x1a1b1a){if(_0x1a1b1a){_0x2fe96e=_0x1a1b1a[_0x5678('0x3d')];if(!_0x237ebc[_0x5678('0x38')]['hasOwnProperty'](_0x5678('0x3f'))){_0x5cfe81[_0x5678('0x2a')]=qs['limit'](_0x237ebc[_0x5678('0x38')][_0x5678('0x2a')]);_0x5cfe81[_0x5678('0x29')]=qs[_0x5678('0x29')](_0x237ebc['query'][_0x5678('0x29')]);}return _0x4678e4[_0x5678('0x59')](_0x5cfe81);}})['then'](function(_0x48e8dd){if(_0x48e8dd){return _0x48e8dd?{'count':_0x2fe96e,'rows':_0x48e8dd}:null;}})[_0x5678('0x4f')](respondWithResult(_0x1060e3,null))[_0x5678('0x24')](handleError(_0x1060e3,null));};exports[_0x5678('0x5a')]=function(_0x1d0631,_0x7141cd,_0x25ce28){var _0x3e87e5={};var _0x2183cb={};var _0x38907c;var _0x138e2a;return db[_0x5678('0x4b')]['findOne']({'where':{'id':_0x1d0631['params']['id']}})[_0x5678('0x4f')](handleEntityNotFound(_0x7141cd,null))['then'](function(_0x2df26e){if(_0x2df26e){_0x38907c=_0x2df26e;_0x2183cb[_0x5678('0x36')]=_[_0x5678('0x37')](db[_0x5678('0x58')][_0x5678('0x35')]);_0x2183cb[_0x5678('0x38')]=_[_0x5678('0x37')](_0x1d0631['query']);_0x2183cb[_0x5678('0x39')]=_[_0x5678('0x3a')](_0x2183cb[_0x5678('0x36')],_0x2183cb[_0x5678('0x38')]);_0x3e87e5['attributes']=_[_0x5678('0x3a')](_0x2183cb['model'],qs[_0x5678('0x3c')](_0x1d0631[_0x5678('0x38')]['fields']));_0x3e87e5[_0x5678('0x3b')]=_0x3e87e5[_0x5678('0x3b')][_0x5678('0x3d')]?_0x3e87e5[_0x5678('0x3b')]:_0x2183cb[_0x5678('0x36')];_0x3e87e5[_0x5678('0x40')]=qs[_0x5678('0x41')](_0x1d0631[_0x5678('0x38')][_0x5678('0x41')]);_0x3e87e5[_0x5678('0x42')]=qs['filters'](_['pick'](_0x1d0631[_0x5678('0x38')],_0x2183cb[_0x5678('0x39')]));if(_0x1d0631['query']['filter']){_0x3e87e5[_0x5678('0x42')]=_['merge'](_0x3e87e5['where'],{'$or':_['map'](_0x3e87e5[_0x5678('0x3b')],function(_0x3390df){var _0x21242c={};_0x21242c[_0x3390df]={'$like':'%'+_0x1d0631['query'][_0x5678('0x4a')]+'%'};return _0x21242c;})});}_0x3e87e5=_[_0x5678('0x44')]({},_0x3e87e5,_0x1d0631[_0x5678('0x53')]);return _0x38907c[_0x5678('0x5a')](_0x3e87e5);}})[_0x5678('0x4f')](function(_0x5013ef){if(_0x5013ef){_0x138e2a=_0x5013ef[_0x5678('0x3d')];if(!_0x1d0631['query']['hasOwnProperty'](_0x5678('0x3f'))){_0x3e87e5['limit']=qs[_0x5678('0x2a')](_0x1d0631['query'][_0x5678('0x2a')]);_0x3e87e5[_0x5678('0x29')]=qs['offset'](_0x1d0631[_0x5678('0x38')][_0x5678('0x29')]);}return _0x38907c[_0x5678('0x5a')](_0x3e87e5);}})[_0x5678('0x4f')](function(_0x1aede2){if(_0x1aede2){return _0x1aede2?{'count':_0x138e2a,'rows':_0x1aede2}:null;}})['then'](respondWithResult(_0x7141cd,null))[_0x5678('0x24')](handleError(_0x7141cd,null));};exports[_0x5678('0x5b')]=function(_0x2e5375,_0x4c5edf,_0x2c69b1){var _0x169109={};var _0x4c6090={};var _0x2b44d0;var _0x21ecfb;return db[_0x5678('0x4b')]['findOne']({'where':{'id':_0x2e5375[_0x5678('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c5edf,null))[_0x5678('0x4f')](function(_0x539828){if(_0x539828){_0x2b44d0=_0x539828;_0x4c6090[_0x5678('0x36')]=_['keys'](db[_0x5678('0x58')]['rawAttributes']);_0x4c6090['query']=_[_0x5678('0x37')](_0x2e5375[_0x5678('0x38')]);_0x4c6090['filters']=_['intersection'](_0x4c6090[_0x5678('0x36')],_0x4c6090[_0x5678('0x38')]);_0x169109[_0x5678('0x3b')]=_['intersection'](_0x4c6090['model'],qs[_0x5678('0x3c')](_0x2e5375[_0x5678('0x38')][_0x5678('0x3c')]));_0x169109['attributes']=_0x169109['attributes'][_0x5678('0x3d')]?_0x169109[_0x5678('0x3b')]:_0x4c6090[_0x5678('0x36')];_0x169109[_0x5678('0x40')]=qs['sort'](_0x2e5375[_0x5678('0x38')][_0x5678('0x41')]);_0x169109[_0x5678('0x42')]=qs['filters'](_[_0x5678('0x43')](_0x2e5375[_0x5678('0x38')],_0x4c6090[_0x5678('0x39')]));if(_0x2e5375[_0x5678('0x38')][_0x5678('0x4a')]){_0x169109[_0x5678('0x42')]=_[_0x5678('0x44')](_0x169109[_0x5678('0x42')],{'$or':_[_0x5678('0x45')](_0x169109[_0x5678('0x3b')],function(_0x539f7a){var _0x4d063b={};_0x4d063b[_0x539f7a]={'$like':'%'+_0x2e5375[_0x5678('0x38')][_0x5678('0x4a')]+'%'};return _0x4d063b;})});}_0x169109=_[_0x5678('0x44')]({},_0x169109,_0x2e5375[_0x5678('0x53')]);return _0x2b44d0['getDescriptions'](_0x169109);}})['then'](function(_0x4162fd){if(_0x4162fd){_0x21ecfb=_0x4162fd[_0x5678('0x3d')];if(!_0x2e5375[_0x5678('0x38')][_0x5678('0x3e')](_0x5678('0x3f'))){_0x169109['limit']=qs[_0x5678('0x2a')](_0x2e5375[_0x5678('0x38')][_0x5678('0x2a')]);_0x169109[_0x5678('0x29')]=qs[_0x5678('0x29')](_0x2e5375['query'][_0x5678('0x29')]);}return _0x2b44d0[_0x5678('0x5b')](_0x169109);}})[_0x5678('0x4f')](function(_0x392e2e){if(_0x392e2e){return _0x392e2e?{'count':_0x21ecfb,'rows':_0x392e2e}:null;}})['then'](respondWithResult(_0x4c5edf,null))['catch'](handleError(_0x4c5edf,null));}; \ No newline at end of file +var _0x7f44=['name','VtigerConfiguration','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack'];(function(_0x1d9655,_0x50886a){var _0x1e7c51=function(_0x2096b0){while(--_0x2096b0){_0x1d9655['push'](_0x1d9655['shift']());}};_0x1e7c51(++_0x50886a);}(_0x7f44,0xe7));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x47f4('0x0'));var emlformat=require(_0x47f4('0x1'));var rimraf=require(_0x47f4('0x2'));var zipdir=require(_0x47f4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47f4('0x4'));var moment=require(_0x47f4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47f4('0x6'));var path=require(_0x47f4('0x7'));var sox=require('sox');var csv=require(_0x47f4('0x8'));var ejs=require(_0x47f4('0x9'));var fs=require('fs');var _=require(_0x47f4('0xa'));var squel=require(_0x47f4('0xb'));var crypto=require(_0x47f4('0xc'));var jsforce=require(_0x47f4('0xd'));var deskjs=require(_0x47f4('0xe'));var toCsv=require(_0x47f4('0x8'));var querystring=require(_0x47f4('0xf'));var Papa=require(_0x47f4('0x10'));var Redis=require(_0x47f4('0x11'));var authService=require(_0x47f4('0x12'));var qs=require(_0x47f4('0x13'));var hardwareService=require(_0x47f4('0x14'));var logger=require(_0x47f4('0x15'))(_0x47f4('0x16'));var utils=require('../../config/utils');var config=require(_0x47f4('0x17'));var db=require(_0x47f4('0x18'))['db'];var jayson=require(_0x47f4('0x19'));var client=jayson[_0x47f4('0x1a')][_0x47f4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x115a54,_0x2defe4,_0x5dc1bd){if(_0x5dc1bd){var _0x4e9830=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e9830[_0x47f4('0x1c')](_0x2defe4)){return _0x115a54;}else{throw new Error(_0x47f4('0x1d'));}}else{return _0x115a54;}}function respondWithRpcPromise(_0x43018a,_0x14a9f1,_0x4e0b7f,_0x394893){return new BPromise(function(_0x13d612,_0x4dd6a7){var _0x1a41fe=_0x394893||client;return _0x1a41fe[_0x47f4('0x1e')](_0x43018a,_0x4e0b7f)['then'](function(_0x38d9e0){logger[_0x47f4('0x1f')](_0x47f4('0x20'),_0x14a9f1,_0x47f4('0x21'));logger[_0x47f4('0x22')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x14a9f1,'request\x20sent',JSON[_0x47f4('0x23')](_0x38d9e0));if(_0x38d9e0[_0x47f4('0x24')]){if(_0x38d9e0[_0x47f4('0x24')]['code']===0x1f4){logger['error'](_0x47f4('0x20'),_0x14a9f1,_0x38d9e0[_0x47f4('0x24')][_0x47f4('0x25')]);return _0x4dd6a7(_0x38d9e0[_0x47f4('0x24')][_0x47f4('0x25')]);}logger[_0x47f4('0x24')](_0x47f4('0x20'),_0x14a9f1,_0x38d9e0['error'][_0x47f4('0x25')]);return _0x13d612(_0x38d9e0['error'][_0x47f4('0x25')]);}else{logger[_0x47f4('0x1f')](_0x47f4('0x20'),_0x14a9f1,_0x47f4('0x21'));_0x13d612(_0x38d9e0[_0x47f4('0x26')][_0x47f4('0x25')]);}})['catch'](function(_0x1440c4){logger[_0x47f4('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x14a9f1,_0x1440c4);_0x4dd6a7(_0x1440c4);});});}function respondWithStatusCode(_0x49d19b,_0x3444c2){_0x3444c2=_0x3444c2||0xcc;return function(_0x1c724d){if(_0x1c724d){return _0x49d19b[_0x47f4('0x27')](_0x3444c2);}return _0x49d19b[_0x47f4('0x28')](_0x3444c2)[_0x47f4('0x29')]();};}function respondWithResult(_0x24019b,_0xecab89){_0xecab89=_0xecab89||0xc8;return function(_0x1810a0){if(_0x1810a0){return _0x24019b[_0x47f4('0x28')](_0xecab89)[_0x47f4('0x2a')](_0x1810a0);}};}function respondWithFilteredResult(_0x2923b2,_0x386a47){return function(_0x249a54){if(_0x249a54){var _0x427d5f=_0x249a54[_0x47f4('0x2b')],_0x3cf75a=_0x386a47[_0x47f4('0x2c')],_0x9de54f=_0x386a47[_0x47f4('0x2c')]+_0x386a47[_0x47f4('0x2d')],_0x579cbb;if(_0x9de54f>=_0x427d5f){_0x9de54f=_0x427d5f;_0x579cbb=0xc8;}else{_0x579cbb=0xce;}_0x2923b2[_0x47f4('0x28')](_0x579cbb);return _0x2923b2[_0x47f4('0x2e')](_0x47f4('0x2f'),_0x3cf75a+'-'+_0x9de54f+'/'+_0x427d5f)[_0x47f4('0x2a')](_0x249a54);}return null;};}function patchUpdates(_0x5c7c43){return function(_0x226744){try{jsonpatch[_0x47f4('0x30')](_0x226744,_0x5c7c43,!![]);}catch(_0x1e1e62){return BPromise[_0x47f4('0x31')](_0x1e1e62);}return _0x226744[_0x47f4('0x32')]();};}function saveUpdates(_0x105cab,_0x100ca0){return function(_0xd215c9){if(_0xd215c9){return _0xd215c9[_0x47f4('0x33')](_0x105cab)[_0x47f4('0x34')](function(_0x536582){return _0x536582;});}return null;};}function removeEntity(_0x37bf5d,_0x135f43){return function(_0x427cf2){if(_0x427cf2){return _0x427cf2['destroy']()[_0x47f4('0x34')](function(){_0x37bf5d[_0x47f4('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5697,_0x5d75c9){return function(_0x4c32ec){if(!_0x4c32ec){_0x1c5697['sendStatus'](0x194);}return _0x4c32ec;};}function handleError(_0x3962c9,_0x512818){_0x512818=_0x512818||0x1f4;return function(_0xa99418){logger[_0x47f4('0x24')](_0xa99418[_0x47f4('0x35')]);if(_0xa99418[_0x47f4('0x36')]){delete _0xa99418[_0x47f4('0x36')];}_0x3962c9['status'](_0x512818)['send'](_0xa99418);};}exports['index']=function(_0x2d42b2,_0x58b289){var _0x4c49ec={},_0x554852={},_0xe671b4={'count':0x0,'rows':[]};var _0x58a5c1=db[_0x47f4('0x37')][_0x47f4('0x38')];_0x554852['model']=_[_0x47f4('0x39')](_0x58a5c1);_0x554852[_0x47f4('0x3a')]=_[_0x47f4('0x39')](_0x2d42b2[_0x47f4('0x3a')]);_0x554852['filters']=_[_0x47f4('0x3b')](_0x554852[_0x47f4('0x3c')],_0x554852[_0x47f4('0x3a')]);_0x4c49ec[_0x47f4('0x3d')]=_[_0x47f4('0x3b')](_0x554852[_0x47f4('0x3c')],qs[_0x47f4('0x3e')](_0x2d42b2[_0x47f4('0x3a')][_0x47f4('0x3e')]));_0x4c49ec[_0x47f4('0x3d')]=_0x4c49ec['attributes'][_0x47f4('0x3f')]?_0x4c49ec[_0x47f4('0x3d')]:_0x554852['model'];if(!_0x2d42b2['query'][_0x47f4('0x40')](_0x47f4('0x41'))){_0x4c49ec[_0x47f4('0x2d')]=qs[_0x47f4('0x2d')](_0x2d42b2[_0x47f4('0x3a')][_0x47f4('0x2d')]);_0x4c49ec['offset']=qs[_0x47f4('0x2c')](_0x2d42b2[_0x47f4('0x3a')]['offset']);}_0x4c49ec[_0x47f4('0x42')]=qs[_0x47f4('0x43')](_0x2d42b2[_0x47f4('0x3a')][_0x47f4('0x43')]);_0x4c49ec[_0x47f4('0x44')]=qs['filters'](_[_0x47f4('0x45')](_0x2d42b2[_0x47f4('0x3a')],_0x554852[_0x47f4('0x46')]));if(_0x2d42b2[_0x47f4('0x3a')]['filter']){_0x4c49ec['where']=_[_0x47f4('0x47')](_0x4c49ec['where'],{'$or':_[_0x47f4('0x48')](_0x58a5c1,function(_0x1fbd03){if(_0x1fbd03[_0x47f4('0x49')][_0x47f4('0x4a')]!==_0x47f4('0x4b')){var _0x19e1a4={};_0x19e1a4[_0x1fbd03[_0x47f4('0x4c')]]={'$like':'%'+_0x2d42b2['query'][_0x47f4('0x4d')]+'%'};return _0x19e1a4;}})});}_0x4c49ec=_[_0x47f4('0x47')]({},_0x4c49ec,_0x2d42b2[_0x47f4('0x4e')]);var _0x754790={'where':_0x4c49ec[_0x47f4('0x44')]};return db['VtigerConfiguration']['count'](_0x754790)[_0x47f4('0x34')](function(_0x33ea83){_0xe671b4['count']=_0x33ea83;if(_0x2d42b2[_0x47f4('0x3a')][_0x47f4('0x4f')]){_0x4c49ec['include']=[{'all':!![]}];}return db[_0x47f4('0x37')][_0x47f4('0x50')](_0x4c49ec);})[_0x47f4('0x34')](function(_0x185a6e){_0xe671b4[_0x47f4('0x51')]=_0x185a6e;return _0xe671b4;})[_0x47f4('0x34')](respondWithFilteredResult(_0x58b289,_0x4c49ec))[_0x47f4('0x52')](handleError(_0x58b289,null));};exports[_0x47f4('0x53')]=function(_0x450efd,_0x3d8026){var _0x220da9={'raw':![],'where':{'id':_0x450efd[_0x47f4('0x54')]['id']}},_0x305448={};_0x305448[_0x47f4('0x3c')]=_[_0x47f4('0x39')](db['VtigerConfiguration']['rawAttributes']);_0x305448[_0x47f4('0x3a')]=_['keys'](_0x450efd['query']);_0x305448[_0x47f4('0x46')]=_[_0x47f4('0x3b')](_0x305448[_0x47f4('0x3c')],_0x305448[_0x47f4('0x3a')]);_0x220da9[_0x47f4('0x3d')]=_[_0x47f4('0x3b')](_0x305448[_0x47f4('0x3c')],qs[_0x47f4('0x3e')](_0x450efd['query'][_0x47f4('0x3e')]));_0x220da9[_0x47f4('0x3d')]=_0x220da9[_0x47f4('0x3d')][_0x47f4('0x3f')]?_0x220da9['attributes']:_0x305448[_0x47f4('0x3c')];if(_0x450efd[_0x47f4('0x3a')]['includeAll']){_0x220da9[_0x47f4('0x55')]=[{'all':!![]}];}_0x220da9=_[_0x47f4('0x47')]({},_0x220da9,_0x450efd['options']);return db[_0x47f4('0x37')][_0x47f4('0x56')](_0x220da9)[_0x47f4('0x34')](handleEntityNotFound(_0x3d8026,null))[_0x47f4('0x34')](respondWithResult(_0x3d8026,null))[_0x47f4('0x52')](handleError(_0x3d8026,null));};exports[_0x47f4('0x57')]=function(_0x51555f,_0x4d4d65){return db[_0x47f4('0x37')][_0x47f4('0x57')](_0x51555f[_0x47f4('0x58')],{})['then'](respondWithResult(_0x4d4d65,0xc9))[_0x47f4('0x52')](handleError(_0x4d4d65,null));};exports[_0x47f4('0x33')]=function(_0x44f6b8,_0x343a65){if(_0x44f6b8[_0x47f4('0x58')]['id']){delete _0x44f6b8['body']['id'];}return db['VtigerConfiguration'][_0x47f4('0x56')]({'where':{'id':_0x44f6b8[_0x47f4('0x54')]['id']}})[_0x47f4('0x34')](handleEntityNotFound(_0x343a65,null))[_0x47f4('0x34')](saveUpdates(_0x44f6b8[_0x47f4('0x58')],null))[_0x47f4('0x34')](respondWithResult(_0x343a65,null))[_0x47f4('0x52')](handleError(_0x343a65,null));};exports[_0x47f4('0x59')]=function(_0x46cab4,_0x2a1aa7){return db[_0x47f4('0x37')][_0x47f4('0x56')]({'where':{'id':_0x46cab4['params']['id']}})[_0x47f4('0x34')](handleEntityNotFound(_0x2a1aa7,null))['then'](removeEntity(_0x2a1aa7,null))['catch'](handleError(_0x2a1aa7,null));};exports[_0x47f4('0x5a')]=function(_0x17d6d3,_0x50d646,_0x9f39a5){var _0x268e4c={};var _0x12ade9={};var _0x56d114;var _0x4204da;return db[_0x47f4('0x37')][_0x47f4('0x5b')]({'where':{'id':_0x17d6d3[_0x47f4('0x54')]['id']}})[_0x47f4('0x34')](handleEntityNotFound(_0x50d646,null))[_0x47f4('0x34')](function(_0x42e2d4){if(_0x42e2d4){_0x56d114=_0x42e2d4;_0x12ade9[_0x47f4('0x3c')]=_[_0x47f4('0x39')](db[_0x47f4('0x5c')][_0x47f4('0x38')]);_0x12ade9['query']=_[_0x47f4('0x39')](_0x17d6d3[_0x47f4('0x3a')]);_0x12ade9['filters']=_[_0x47f4('0x3b')](_0x12ade9['model'],_0x12ade9[_0x47f4('0x3a')]);_0x268e4c[_0x47f4('0x3d')]=_[_0x47f4('0x3b')](_0x12ade9['model'],qs[_0x47f4('0x3e')](_0x17d6d3[_0x47f4('0x3a')][_0x47f4('0x3e')]));_0x268e4c['attributes']=_0x268e4c[_0x47f4('0x3d')][_0x47f4('0x3f')]?_0x268e4c[_0x47f4('0x3d')]:_0x12ade9[_0x47f4('0x3c')];_0x268e4c[_0x47f4('0x42')]=qs['sort'](_0x17d6d3[_0x47f4('0x3a')]['sort']);_0x268e4c[_0x47f4('0x44')]=qs['filters'](_[_0x47f4('0x45')](_0x17d6d3[_0x47f4('0x3a')],_0x12ade9[_0x47f4('0x46')]));if(_0x17d6d3[_0x47f4('0x3a')][_0x47f4('0x4d')]){_0x268e4c[_0x47f4('0x44')]=_[_0x47f4('0x47')](_0x268e4c[_0x47f4('0x44')],{'$or':_[_0x47f4('0x48')](_0x268e4c[_0x47f4('0x3d')],function(_0x45fb18){var _0x50e4df={};_0x50e4df[_0x45fb18]={'$like':'%'+_0x17d6d3['query'][_0x47f4('0x4d')]+'%'};return _0x50e4df;})});}_0x268e4c=_['merge']({},_0x268e4c,_0x17d6d3[_0x47f4('0x4e')]);return _0x56d114[_0x47f4('0x5a')](_0x268e4c);}})[_0x47f4('0x34')](function(_0x4eb805){if(_0x4eb805){_0x4204da=_0x4eb805[_0x47f4('0x3f')];if(!_0x17d6d3[_0x47f4('0x3a')]['hasOwnProperty'](_0x47f4('0x41'))){_0x268e4c[_0x47f4('0x2d')]=qs['limit'](_0x17d6d3[_0x47f4('0x3a')][_0x47f4('0x2d')]);_0x268e4c[_0x47f4('0x2c')]=qs['offset'](_0x17d6d3[_0x47f4('0x3a')][_0x47f4('0x2c')]);}return _0x56d114[_0x47f4('0x5a')](_0x268e4c);}})[_0x47f4('0x34')](function(_0x2414f7){if(_0x2414f7){return _0x2414f7?{'count':_0x4204da,'rows':_0x2414f7}:null;}})[_0x47f4('0x34')](respondWithResult(_0x50d646,null))[_0x47f4('0x52')](handleError(_0x50d646,null));};exports[_0x47f4('0x5d')]=function(_0x20ba54,_0x545688,_0x57266c){var _0x2429af={};var _0x1f0684={};var _0x1a8b43;var _0x5ee246;return db['VtigerConfiguration'][_0x47f4('0x5b')]({'where':{'id':_0x20ba54['params']['id']}})['then'](handleEntityNotFound(_0x545688,null))[_0x47f4('0x34')](function(_0x5cad7a){if(_0x5cad7a){_0x1a8b43=_0x5cad7a;_0x1f0684[_0x47f4('0x3c')]=_['keys'](db['VtigerField'][_0x47f4('0x38')]);_0x1f0684[_0x47f4('0x3a')]=_[_0x47f4('0x39')](_0x20ba54['query']);_0x1f0684[_0x47f4('0x46')]=_[_0x47f4('0x3b')](_0x1f0684[_0x47f4('0x3c')],_0x1f0684[_0x47f4('0x3a')]);_0x2429af[_0x47f4('0x3d')]=_['intersection'](_0x1f0684['model'],qs[_0x47f4('0x3e')](_0x20ba54['query']['fields']));_0x2429af[_0x47f4('0x3d')]=_0x2429af[_0x47f4('0x3d')][_0x47f4('0x3f')]?_0x2429af[_0x47f4('0x3d')]:_0x1f0684[_0x47f4('0x3c')];_0x2429af[_0x47f4('0x42')]=qs[_0x47f4('0x43')](_0x20ba54['query'][_0x47f4('0x43')]);_0x2429af[_0x47f4('0x44')]=qs[_0x47f4('0x46')](_[_0x47f4('0x45')](_0x20ba54[_0x47f4('0x3a')],_0x1f0684['filters']));if(_0x20ba54[_0x47f4('0x3a')][_0x47f4('0x4d')]){_0x2429af[_0x47f4('0x44')]=_[_0x47f4('0x47')](_0x2429af[_0x47f4('0x44')],{'$or':_[_0x47f4('0x48')](_0x2429af[_0x47f4('0x3d')],function(_0x292f07){var _0x56dcc3={};_0x56dcc3[_0x292f07]={'$like':'%'+_0x20ba54[_0x47f4('0x3a')][_0x47f4('0x4d')]+'%'};return _0x56dcc3;})});}_0x2429af=_['merge']({},_0x2429af,_0x20ba54[_0x47f4('0x4e')]);return _0x1a8b43[_0x47f4('0x5d')](_0x2429af);}})[_0x47f4('0x34')](function(_0x4191a3){if(_0x4191a3){_0x5ee246=_0x4191a3[_0x47f4('0x3f')];if(!_0x20ba54[_0x47f4('0x3a')]['hasOwnProperty'](_0x47f4('0x41'))){_0x2429af[_0x47f4('0x2d')]=qs[_0x47f4('0x2d')](_0x20ba54[_0x47f4('0x3a')]['limit']);_0x2429af['offset']=qs[_0x47f4('0x2c')](_0x20ba54[_0x47f4('0x3a')][_0x47f4('0x2c')]);}return _0x1a8b43[_0x47f4('0x5d')](_0x2429af);}})[_0x47f4('0x34')](function(_0x403d68){if(_0x403d68){return _0x403d68?{'count':_0x5ee246,'rows':_0x403d68}:null;}})[_0x47f4('0x34')](respondWithResult(_0x545688,null))[_0x47f4('0x52')](handleError(_0x545688,null));};exports['getDescriptions']=function(_0x380ee9,_0x1c6db7,_0x1f42b8){var _0x3356a9={};var _0x401e20={};var _0x562eed;var _0x49bcdd;return db['VtigerConfiguration'][_0x47f4('0x5b')]({'where':{'id':_0x380ee9[_0x47f4('0x54')]['id']}})[_0x47f4('0x34')](handleEntityNotFound(_0x1c6db7,null))[_0x47f4('0x34')](function(_0x2d6781){if(_0x2d6781){_0x562eed=_0x2d6781;_0x401e20[_0x47f4('0x3c')]=_[_0x47f4('0x39')](db[_0x47f4('0x5c')][_0x47f4('0x38')]);_0x401e20[_0x47f4('0x3a')]=_[_0x47f4('0x39')](_0x380ee9['query']);_0x401e20[_0x47f4('0x46')]=_['intersection'](_0x401e20['model'],_0x401e20[_0x47f4('0x3a')]);_0x3356a9['attributes']=_[_0x47f4('0x3b')](_0x401e20[_0x47f4('0x3c')],qs['fields'](_0x380ee9[_0x47f4('0x3a')][_0x47f4('0x3e')]));_0x3356a9[_0x47f4('0x3d')]=_0x3356a9['attributes'][_0x47f4('0x3f')]?_0x3356a9[_0x47f4('0x3d')]:_0x401e20[_0x47f4('0x3c')];_0x3356a9['order']=qs[_0x47f4('0x43')](_0x380ee9[_0x47f4('0x3a')][_0x47f4('0x43')]);_0x3356a9[_0x47f4('0x44')]=qs[_0x47f4('0x46')](_[_0x47f4('0x45')](_0x380ee9[_0x47f4('0x3a')],_0x401e20[_0x47f4('0x46')]));if(_0x380ee9['query'][_0x47f4('0x4d')]){_0x3356a9[_0x47f4('0x44')]=_[_0x47f4('0x47')](_0x3356a9[_0x47f4('0x44')],{'$or':_['map'](_0x3356a9['attributes'],function(_0x513dbb){var _0x232664={};_0x232664[_0x513dbb]={'$like':'%'+_0x380ee9[_0x47f4('0x3a')][_0x47f4('0x4d')]+'%'};return _0x232664;})});}_0x3356a9=_[_0x47f4('0x47')]({},_0x3356a9,_0x380ee9[_0x47f4('0x4e')]);return _0x562eed[_0x47f4('0x5e')](_0x3356a9);}})['then'](function(_0x3029fb){if(_0x3029fb){_0x49bcdd=_0x3029fb[_0x47f4('0x3f')];if(!_0x380ee9[_0x47f4('0x3a')][_0x47f4('0x40')](_0x47f4('0x41'))){_0x3356a9[_0x47f4('0x2d')]=qs['limit'](_0x380ee9['query'][_0x47f4('0x2d')]);_0x3356a9[_0x47f4('0x2c')]=qs[_0x47f4('0x2c')](_0x380ee9['query'][_0x47f4('0x2c')]);}return _0x562eed[_0x47f4('0x5e')](_0x3356a9);}})['then'](function(_0x348d2f){if(_0x348d2f){return _0x348d2f?{'count':_0x49bcdd,'rows':_0x348d2f}:null;}})[_0x47f4('0x34')](respondWithResult(_0x1c6db7,null))[_0x47f4('0x52')](handleError(_0x1c6db7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ca8b50b..43e8bbd 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x439618,_0x3d9129){var _0x3680cd=function(_0x2deff3){while(--_0x2deff3){_0x439618['push'](_0x439618['shift']());}};_0x3680cd(++_0x3d9129);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xd00525,_0x3a202f){var _0x9d4a51=function(_0x252082){while(--_0x252082){_0xd00525['push'](_0xd00525['shift']());}};_0x9d4a51(++_0x3a202f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 9e3cdc0..d7889ef 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 _0x4a88=['result','catch','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x232e4a,_0x8418a9){var _0x105d12=function(_0x4af0d9){while(--_0x4af0d9){_0x232e4a['push'](_0x232e4a['shift']());}};_0x105d12(++_0x8418a9);}(_0x4a88,0xad));var _0x84a8=function(_0x561200,_0x14a854){_0x561200=_0x561200-0x0;var _0x2d7516=_0x4a88[_0x561200];return _0x2d7516;};'use strict';var _=require('lodash');var util=require(_0x84a8('0x0'));var moment=require(_0x84a8('0x1'));var BPromise=require(_0x84a8('0x2'));var rs=require(_0x84a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84a8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x84a8('0x5'));var client=jayson[_0x84a8('0x6')][_0x84a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4de0d2,_0x263fec,_0x29af20){return new BPromise(function(_0x30d36d,_0x2535bd){return client[_0x84a8('0x8')](_0x4de0d2,_0x29af20)['then'](function(_0x1d1ddf){logger[_0x84a8('0x9')](_0x84a8('0xa'),_0x263fec,_0x84a8('0xb'));logger[_0x84a8('0xc')](_0x84a8('0xd'),_0x263fec,'request\x20sent',JSON['stringify'](_0x1d1ddf));if(_0x1d1ddf[_0x84a8('0xe')]){if(_0x1d1ddf[_0x84a8('0xe')][_0x84a8('0xf')]===0x1f4){logger[_0x84a8('0xe')](_0x84a8('0xa'),_0x263fec,_0x1d1ddf[_0x84a8('0xe')][_0x84a8('0x10')]);return _0x2535bd(_0x1d1ddf['error'][_0x84a8('0x10')]);}logger[_0x84a8('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x263fec,_0x1d1ddf[_0x84a8('0xe')]['message']);return _0x30d36d(_0x1d1ddf[_0x84a8('0xe')]['message']);}else{logger[_0x84a8('0x9')](_0x84a8('0xa'),_0x263fec,'request\x20sent');_0x30d36d(_0x1d1ddf[_0x84a8('0x11')][_0x84a8('0x10')]);}})[_0x84a8('0x12')](function(_0x41b7ee){logger[_0x84a8('0xe')](_0x84a8('0xa'),_0x263fec,_0x41b7ee);_0x2535bd(_0x41b7ee);});});} \ No newline at end of file +var _0xc169=['message','result','catch','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0xf12a24,_0x44df0c){var _0x26e5d4=function(_0x3d8ea3){while(--_0x3d8ea3){_0xf12a24['push'](_0xf12a24['shift']());}};_0x26e5d4(++_0x44df0c);}(_0xc169,0x135));var _0x9c16=function(_0x26a74d,_0x37ecfc){_0x26a74d=_0x26a74d-0x0;var _0xcbb1a3=_0xc169[_0x26a74d];return _0xcbb1a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9c16('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c16('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c16('0x2'));var logger=require(_0x9c16('0x3'))(_0x9c16('0x4'));var config=require('../../config/environment');var jayson=require(_0x9c16('0x5'));var client=jayson[_0x9c16('0x6')][_0x9c16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x170a51,_0x36cf8a,_0x177d82){return new BPromise(function(_0x118b6b,_0x554e3d){return client[_0x9c16('0x8')](_0x170a51,_0x177d82)['then'](function(_0x3054fb){logger[_0x9c16('0x9')](_0x9c16('0xa'),_0x36cf8a,'request\x20sent');logger[_0x9c16('0xb')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x36cf8a,_0x9c16('0xc'),JSON['stringify'](_0x3054fb));if(_0x3054fb[_0x9c16('0xd')]){if(_0x3054fb[_0x9c16('0xd')][_0x9c16('0xe')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x36cf8a,_0x3054fb[_0x9c16('0xd')][_0x9c16('0xf')]);return _0x554e3d(_0x3054fb[_0x9c16('0xd')][_0x9c16('0xf')]);}logger[_0x9c16('0xd')](_0x9c16('0xa'),_0x36cf8a,_0x3054fb['error'][_0x9c16('0xf')]);return _0x118b6b(_0x3054fb['error'][_0x9c16('0xf')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x36cf8a,'request\x20sent');_0x118b6b(_0x3054fb[_0x9c16('0x10')]['message']);}})[_0x9c16('0x11')](function(_0x1fe83f){logger[_0x9c16('0xd')](_0x9c16('0xa'),_0x36cf8a,_0x1fe83f);_0x554e3d(_0x1fe83f);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index dc2b627..c8c9ccb 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 _0xb193=['util','path','connect-timeout','express','../../config/environment','./intVtigerField.controller','get','isAuthenticated','create','put','update','/:id','destroy','exports'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xb193,0x142));var _0x3b19=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xb193[_0x5f25b3];return _0x4ab9bf;};'use strict';var multer=require('multer');var util=require(_0x3b19('0x0'));var path=require(_0x3b19('0x1'));var timeout=require(_0x3b19('0x2'));var express=require(_0x3b19('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b19('0x4'));var controller=require(_0x3b19('0x5'));router[_0x3b19('0x6')]('/',auth[_0x3b19('0x7')](),controller['index']);router['get']('/:id',auth[_0x3b19('0x7')](),controller['show']);router['post']('/',auth[_0x3b19('0x7')](),controller[_0x3b19('0x8')]);router[_0x3b19('0x9')]('/:id',auth[_0x3b19('0x7')](),controller[_0x3b19('0xa')]);router['delete'](_0x3b19('0xb'),auth[_0x3b19('0x7')](),controller[_0x3b19('0xc')]);module[_0x3b19('0xd')]=router; \ No newline at end of file +var _0xf53e=['put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x437fd7,_0x28ad4d){var _0x25f584=function(_0x2bf413){while(--_0x2bf413){_0x437fd7['push'](_0x437fd7['shift']());}};_0x25f584(++_0x28ad4d);}(_0xf53e,0xb4));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var path=require(_0xef53('0x2'));var timeout=require('connect-timeout');var express=require(_0xef53('0x3'));var router=express['Router']();var auth=require(_0xef53('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef53('0x5'));router[_0xef53('0x6')]('/',auth[_0xef53('0x7')](),controller['index']);router['get'](_0xef53('0x8'),auth[_0xef53('0x7')](),controller[_0xef53('0x9')]);router[_0xef53('0xa')]('/',auth[_0xef53('0x7')](),controller[_0xef53('0xb')]);router[_0xef53('0xc')](_0xef53('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xef53('0xd')]('/:id',auth[_0xef53('0x7')](),controller[_0xef53('0xe')]);module[_0xef53('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e58db98..76baf7d 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 _0xbdb7=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x272fed,_0x243d67){_0x272fed=_0x272fed-0x0;var _0x2f7ead=_0xbdb7[_0x272fed];return _0x2f7ead;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'type':{'type':Sequelize[_0x7bdb('0x2')](_0x7bdb('0x3'),_0x7bdb('0x4'),_0x7bdb('0x5'),_0x7bdb('0x6')),'defaultValue':_0x7bdb('0x3')},'content':{'type':Sequelize[_0x7bdb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7bdb('0x2')]('string','variable',_0x7bdb('0x5'))},'keyContent':{'type':Sequelize[_0x7bdb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7bdb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7bdb('0x7')]}}; \ No newline at end of file +var _0x0bb5=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x0bb5,0x148));var _0x50bb=function(_0x22a938,_0xe8f05){_0x22a938=_0x22a938-0x0;var _0x4be5d3=_0x0bb5[_0x22a938];return _0x4be5d3;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x50bb('0x2'),_0x50bb('0x3'),_0x50bb('0x4')),'defaultValue':_0x50bb('0x5')},'content':{'type':Sequelize[_0x50bb('0x6')]},'key':{'type':Sequelize[_0x50bb('0x6')]},'keyType':{'type':Sequelize[_0x50bb('0x7')](_0x50bb('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x50bb('0x6')]},'idField':{'type':Sequelize[_0x50bb('0x6')]},'nameField':{'type':Sequelize[_0x50bb('0x6')]},'customField':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7aa03fb..df700f4 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 _0x6324=['name','send','index','VtigerField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','map','type','key','field','includeAll','include','findAll','rows','show','length','merge','options','find','create','body','catch','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0xf22dce,_0x46f799){var _0x55c4ba=function(_0xc09efa){while(--_0xc09efa){_0xf22dce['push'](_0xf22dce['shift']());}};_0x55c4ba(++_0x46f799);}(_0x6324,0x142));var _0x4632=function(_0x5d1df9,_0x4a95bf){_0x5d1df9=_0x5d1df9-0x0;var _0x5d4feb=_0x6324[_0x5d1df9];return _0x5d4feb;};'use strict';var pdf=require(_0x4632('0x0'));var emlformat=require(_0x4632('0x1'));var rimraf=require(_0x4632('0x2'));var zipdir=require(_0x4632('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4632('0x4'));var moment=require('moment');var BPromise=require(_0x4632('0x5'));var Mustache=require('mustache');var util=require(_0x4632('0x6'));var path=require('path');var sox=require(_0x4632('0x7'));var csv=require(_0x4632('0x8'));var ejs=require(_0x4632('0x9'));var fs=require('fs');var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var hardwareService=require(_0x4632('0x11'));var logger=require(_0x4632('0x12'))(_0x4632('0x13'));var utils=require(_0x4632('0x14'));var config=require(_0x4632('0x15'));var db=require(_0x4632('0x16'))['db'];function respondWithStatusCode(_0x17f9d1,_0x4a4cdd){_0x4a4cdd=_0x4a4cdd||0xcc;return function(_0x2b3f0f){if(_0x2b3f0f){return _0x17f9d1['sendStatus'](_0x4a4cdd);}return _0x17f9d1[_0x4632('0x17')](_0x4a4cdd)[_0x4632('0x18')]();};}function respondWithResult(_0x3ef228,_0x2dce9f){_0x2dce9f=_0x2dce9f||0xc8;return function(_0x51ee37){if(_0x51ee37){return _0x3ef228[_0x4632('0x17')](_0x2dce9f)[_0x4632('0x19')](_0x51ee37);}};}function respondWithFilteredResult(_0x3b9901,_0x37d798){return function(_0x1c1be0){if(_0x1c1be0){var _0x5438ab=_0x1c1be0[_0x4632('0x1a')],_0x47b349=_0x37d798[_0x4632('0x1b')],_0x2fd7ae=_0x37d798['offset']+_0x37d798[_0x4632('0x1c')],_0x38bedd;if(_0x2fd7ae>=_0x5438ab){_0x2fd7ae=_0x5438ab;_0x38bedd=0xc8;}else{_0x38bedd=0xce;}_0x3b9901[_0x4632('0x17')](_0x38bedd);return _0x3b9901[_0x4632('0x1d')]('Content-Range',_0x47b349+'-'+_0x2fd7ae+'/'+_0x5438ab)[_0x4632('0x19')](_0x1c1be0);}return null;};}function patchUpdates(_0x1894bb){return function(_0x58e193){try{jsonpatch['apply'](_0x58e193,_0x1894bb,!![]);}catch(_0x1c0523){return BPromise[_0x4632('0x1e')](_0x1c0523);}return _0x58e193[_0x4632('0x1f')]();};}function saveUpdates(_0x3e3766,_0x2d63b1){return function(_0x3d2d23){if(_0x3d2d23){return _0x3d2d23[_0x4632('0x20')](_0x3e3766)[_0x4632('0x21')](function(_0x29f875){return _0x29f875;});}return null;};}function removeEntity(_0x3ea0d1,_0x414aa9){return function(_0x2d656a){if(_0x2d656a){return _0x2d656a[_0x4632('0x22')]()[_0x4632('0x21')](function(){_0x3ea0d1[_0x4632('0x17')](0xcc)[_0x4632('0x18')]();});}};}function handleEntityNotFound(_0x4264d5,_0x3537ed){return function(_0x380a9f){if(!_0x380a9f){_0x4264d5[_0x4632('0x23')](0x194);}return _0x380a9f;};}function handleError(_0x38cbbc,_0x4455ef){_0x4455ef=_0x4455ef||0x1f4;return function(_0x3b0823){logger[_0x4632('0x24')](_0x3b0823[_0x4632('0x25')]);if(_0x3b0823[_0x4632('0x26')]){delete _0x3b0823[_0x4632('0x26')];}_0x38cbbc[_0x4632('0x17')](_0x4455ef)[_0x4632('0x27')](_0x3b0823);};}exports[_0x4632('0x28')]=function(_0x22d0f5,_0x2a0b11){var _0x438354={},_0x4d9098={},_0x57798a={'count':0x0,'rows':[]};var _0x466126=db[_0x4632('0x29')][_0x4632('0x2a')];_0x4d9098[_0x4632('0x2b')]=_[_0x4632('0x2c')](_0x466126);_0x4d9098[_0x4632('0x2d')]=_[_0x4632('0x2c')](_0x22d0f5['query']);_0x4d9098[_0x4632('0x2e')]=_[_0x4632('0x2f')](_0x4d9098['model'],_0x4d9098[_0x4632('0x2d')]);_0x438354['attributes']=_[_0x4632('0x2f')](_0x4d9098['model'],qs['fields'](_0x22d0f5[_0x4632('0x2d')][_0x4632('0x30')]));_0x438354[_0x4632('0x31')]=_0x438354['attributes']['length']?_0x438354[_0x4632('0x31')]:_0x4d9098[_0x4632('0x2b')];if(!_0x22d0f5['query']['hasOwnProperty'](_0x4632('0x32'))){_0x438354[_0x4632('0x1c')]=qs['limit'](_0x22d0f5[_0x4632('0x2d')][_0x4632('0x1c')]);_0x438354[_0x4632('0x1b')]=qs[_0x4632('0x1b')](_0x22d0f5[_0x4632('0x2d')]['offset']);}_0x438354[_0x4632('0x33')]=qs[_0x4632('0x34')](_0x22d0f5['query']['sort']);_0x438354[_0x4632('0x35')]=qs['filters'](_['pick'](_0x22d0f5[_0x4632('0x2d')],_0x4d9098['filters']));if(_0x22d0f5[_0x4632('0x2d')][_0x4632('0x36')]){_0x438354[_0x4632('0x35')]=_['merge'](_0x438354[_0x4632('0x35')],{'$or':_[_0x4632('0x37')](_0x466126,function(_0x39305a){if(_0x39305a[_0x4632('0x38')][_0x4632('0x39')]!=='VIRTUAL'){var _0x486f6c={};_0x486f6c[_0x39305a[_0x4632('0x3a')]]={'$like':'%'+_0x22d0f5[_0x4632('0x2d')][_0x4632('0x36')]+'%'};return _0x486f6c;}})});}_0x438354=_['merge']({},_0x438354,_0x22d0f5['options']);var _0x53b436={'where':_0x438354[_0x4632('0x35')]};return db[_0x4632('0x29')]['count'](_0x53b436)[_0x4632('0x21')](function(_0x20a700){_0x57798a[_0x4632('0x1a')]=_0x20a700;if(_0x22d0f5[_0x4632('0x2d')][_0x4632('0x3b')]){_0x438354[_0x4632('0x3c')]=[{'all':!![]}];}return db[_0x4632('0x29')][_0x4632('0x3d')](_0x438354);})[_0x4632('0x21')](function(_0x2c04a8){_0x57798a[_0x4632('0x3e')]=_0x2c04a8;return _0x57798a;})[_0x4632('0x21')](respondWithFilteredResult(_0x2a0b11,_0x438354))['catch'](handleError(_0x2a0b11,null));};exports[_0x4632('0x3f')]=function(_0x45bff6,_0x4c0e13){var _0x19fdd0={'raw':!![],'where':{'id':_0x45bff6['params']['id']}},_0x1c39bc={};_0x1c39bc[_0x4632('0x2b')]=_['keys'](db[_0x4632('0x29')][_0x4632('0x2a')]);_0x1c39bc[_0x4632('0x2d')]=_[_0x4632('0x2c')](_0x45bff6['query']);_0x1c39bc[_0x4632('0x2e')]=_[_0x4632('0x2f')](_0x1c39bc[_0x4632('0x2b')],_0x1c39bc[_0x4632('0x2d')]);_0x19fdd0['attributes']=_['intersection'](_0x1c39bc[_0x4632('0x2b')],qs[_0x4632('0x30')](_0x45bff6[_0x4632('0x2d')]['fields']));_0x19fdd0[_0x4632('0x31')]=_0x19fdd0[_0x4632('0x31')][_0x4632('0x40')]?_0x19fdd0[_0x4632('0x31')]:_0x1c39bc[_0x4632('0x2b')];if(_0x45bff6[_0x4632('0x2d')][_0x4632('0x3b')]){_0x19fdd0['include']=[{'all':!![]}];}_0x19fdd0=_[_0x4632('0x41')]({},_0x19fdd0,_0x45bff6[_0x4632('0x42')]);return db[_0x4632('0x29')][_0x4632('0x43')](_0x19fdd0)[_0x4632('0x21')](handleEntityNotFound(_0x4c0e13,null))['then'](respondWithResult(_0x4c0e13,null))['catch'](handleError(_0x4c0e13,null));};exports[_0x4632('0x44')]=function(_0x3a1d52,_0x23b0df){return db[_0x4632('0x29')]['create'](_0x3a1d52[_0x4632('0x45')],{})[_0x4632('0x21')](respondWithResult(_0x23b0df,0xc9))[_0x4632('0x46')](handleError(_0x23b0df,null));};exports[_0x4632('0x20')]=function(_0x3afe87,_0x59e7b0){if(_0x3afe87[_0x4632('0x45')]['id']){delete _0x3afe87[_0x4632('0x45')]['id'];}return db[_0x4632('0x29')][_0x4632('0x43')]({'where':{'id':_0x3afe87[_0x4632('0x47')]['id']}})[_0x4632('0x21')](handleEntityNotFound(_0x59e7b0,null))[_0x4632('0x21')](saveUpdates(_0x3afe87[_0x4632('0x45')],null))[_0x4632('0x21')](respondWithResult(_0x59e7b0,null))[_0x4632('0x46')](handleError(_0x59e7b0,null));};exports[_0x4632('0x22')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x29')][_0x4632('0x43')]({'where':{'id':_0x517584['params']['id']}})[_0x4632('0x21')](handleEntityNotFound(_0xc3ffd0,null))[_0x4632('0x21')](removeEntity(_0xc3ffd0,null))[_0x4632('0x46')](handleError(_0xc3ffd0,null));}; \ No newline at end of file +var _0x9354=['fields','sort','pick','filter','where','merge','key','options','VtigerField','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','model','keys','query','filters','intersection','attributes'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x9354,0x96));var _0x4935=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9354[_0x2faddb];return _0x273c05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4935('0x0'));var rimraf=require(_0x4935('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4935('0x2'));var rp=require(_0x4935('0x3'));var moment=require(_0x4935('0x4'));var BPromise=require(_0x4935('0x5'));var Mustache=require('mustache');var util=require(_0x4935('0x6'));var path=require(_0x4935('0x7'));var sox=require(_0x4935('0x8'));var csv=require(_0x4935('0x9'));var ejs=require(_0x4935('0xa'));var fs=require('fs');var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x9'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var hardwareService=require(_0x4935('0x13'));var logger=require(_0x4935('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4935('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4823d0,_0x3f6eef){_0x3f6eef=_0x3f6eef||0xcc;return function(_0x32916f){if(_0x32916f){return _0x4823d0[_0x4935('0x16')](_0x3f6eef);}return _0x4823d0[_0x4935('0x17')](_0x3f6eef)[_0x4935('0x18')]();};}function respondWithResult(_0x2bf1b3,_0x102c63){_0x102c63=_0x102c63||0xc8;return function(_0x3a7c30){if(_0x3a7c30){return _0x2bf1b3[_0x4935('0x17')](_0x102c63)[_0x4935('0x19')](_0x3a7c30);}};}function respondWithFilteredResult(_0x1ce1ba,_0x1799e4){return function(_0xa41961){if(_0xa41961){var _0x3652c4=_0xa41961[_0x4935('0x1a')],_0x24cc99=_0x1799e4[_0x4935('0x1b')],_0x395a43=_0x1799e4[_0x4935('0x1b')]+_0x1799e4[_0x4935('0x1c')],_0x57d7ed;if(_0x395a43>=_0x3652c4){_0x395a43=_0x3652c4;_0x57d7ed=0xc8;}else{_0x57d7ed=0xce;}_0x1ce1ba[_0x4935('0x17')](_0x57d7ed);return _0x1ce1ba[_0x4935('0x1d')]('Content-Range',_0x24cc99+'-'+_0x395a43+'/'+_0x3652c4)[_0x4935('0x19')](_0xa41961);}return null;};}function patchUpdates(_0x145277){return function(_0x4fe356){try{jsonpatch[_0x4935('0x1e')](_0x4fe356,_0x145277,!![]);}catch(_0x10407f){return BPromise[_0x4935('0x1f')](_0x10407f);}return _0x4fe356['save']();};}function saveUpdates(_0x4d58aa,_0x125688){return function(_0x6b849f){if(_0x6b849f){return _0x6b849f[_0x4935('0x20')](_0x4d58aa)[_0x4935('0x21')](function(_0x41d76e){return _0x41d76e;});}return null;};}function removeEntity(_0x16ab7c,_0x7a50ab){return function(_0xe482a5){if(_0xe482a5){return _0xe482a5['destroy']()[_0x4935('0x21')](function(){_0x16ab7c[_0x4935('0x17')](0xcc)[_0x4935('0x18')]();});}};}function handleEntityNotFound(_0x2c701f,_0x52c65a){return function(_0x53530f){if(!_0x53530f){_0x2c701f['sendStatus'](0x194);}return _0x53530f;};}function handleError(_0x36e76a,_0x142fdf){_0x142fdf=_0x142fdf||0x1f4;return function(_0x3786ff){logger[_0x4935('0x22')](_0x3786ff[_0x4935('0x23')]);if(_0x3786ff[_0x4935('0x24')]){delete _0x3786ff[_0x4935('0x24')];}_0x36e76a[_0x4935('0x17')](_0x142fdf)[_0x4935('0x25')](_0x3786ff);};}exports[_0x4935('0x26')]=function(_0x1d08b5,_0x39d07b){var _0x2c47ab={},_0xbb00d6={},_0x359522={'count':0x0,'rows':[]};var _0x55616e=db['VtigerField']['rawAttributes'];_0xbb00d6[_0x4935('0x27')]=_[_0x4935('0x28')](_0x55616e);_0xbb00d6['query']=_[_0x4935('0x28')](_0x1d08b5[_0x4935('0x29')]);_0xbb00d6[_0x4935('0x2a')]=_[_0x4935('0x2b')](_0xbb00d6[_0x4935('0x27')],_0xbb00d6[_0x4935('0x29')]);_0x2c47ab[_0x4935('0x2c')]=_[_0x4935('0x2b')](_0xbb00d6['model'],qs[_0x4935('0x2d')](_0x1d08b5[_0x4935('0x29')]['fields']));_0x2c47ab['attributes']=_0x2c47ab[_0x4935('0x2c')]['length']?_0x2c47ab[_0x4935('0x2c')]:_0xbb00d6[_0x4935('0x27')];if(!_0x1d08b5[_0x4935('0x29')]['hasOwnProperty']('nolimit')){_0x2c47ab[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x1d08b5['query'][_0x4935('0x1c')]);_0x2c47ab[_0x4935('0x1b')]=qs[_0x4935('0x1b')](_0x1d08b5[_0x4935('0x29')][_0x4935('0x1b')]);}_0x2c47ab['order']=qs['sort'](_0x1d08b5[_0x4935('0x29')][_0x4935('0x2e')]);_0x2c47ab['where']=qs['filters'](_[_0x4935('0x2f')](_0x1d08b5['query'],_0xbb00d6[_0x4935('0x2a')]));if(_0x1d08b5[_0x4935('0x29')][_0x4935('0x30')]){_0x2c47ab[_0x4935('0x31')]=_[_0x4935('0x32')](_0x2c47ab[_0x4935('0x31')],{'$or':_['map'](_0x55616e,function(_0x11b18b){if(_0x11b18b['type'][_0x4935('0x33')]!=='VIRTUAL'){var _0x279708={};_0x279708[_0x11b18b['field']]={'$like':'%'+_0x1d08b5[_0x4935('0x29')][_0x4935('0x30')]+'%'};return _0x279708;}})});}_0x2c47ab=_[_0x4935('0x32')]({},_0x2c47ab,_0x1d08b5[_0x4935('0x34')]);var _0x447eff={'where':_0x2c47ab[_0x4935('0x31')]};return db[_0x4935('0x35')]['count'](_0x447eff)['then'](function(_0x2efc45){_0x359522['count']=_0x2efc45;if(_0x1d08b5['query'][_0x4935('0x36')]){_0x2c47ab['include']=[{'all':!![]}];}return db[_0x4935('0x35')][_0x4935('0x37')](_0x2c47ab);})[_0x4935('0x21')](function(_0x99b7c5){_0x359522[_0x4935('0x38')]=_0x99b7c5;return _0x359522;})['then'](respondWithFilteredResult(_0x39d07b,_0x2c47ab))['catch'](handleError(_0x39d07b,null));};exports[_0x4935('0x39')]=function(_0x2be169,_0x28f545){var _0x29d408={'raw':!![],'where':{'id':_0x2be169[_0x4935('0x3a')]['id']}},_0x4d9436={};_0x4d9436[_0x4935('0x27')]=_[_0x4935('0x28')](db['VtigerField']['rawAttributes']);_0x4d9436[_0x4935('0x29')]=_[_0x4935('0x28')](_0x2be169['query']);_0x4d9436[_0x4935('0x2a')]=_[_0x4935('0x2b')](_0x4d9436[_0x4935('0x27')],_0x4d9436[_0x4935('0x29')]);_0x29d408['attributes']=_['intersection'](_0x4d9436[_0x4935('0x27')],qs[_0x4935('0x2d')](_0x2be169['query'][_0x4935('0x2d')]));_0x29d408[_0x4935('0x2c')]=_0x29d408[_0x4935('0x2c')]['length']?_0x29d408[_0x4935('0x2c')]:_0x4d9436[_0x4935('0x27')];if(_0x2be169[_0x4935('0x29')][_0x4935('0x36')]){_0x29d408[_0x4935('0x3b')]=[{'all':!![]}];}_0x29d408=_[_0x4935('0x32')]({},_0x29d408,_0x2be169[_0x4935('0x34')]);return db[_0x4935('0x35')][_0x4935('0x3c')](_0x29d408)[_0x4935('0x21')](handleEntityNotFound(_0x28f545,null))[_0x4935('0x21')](respondWithResult(_0x28f545,null))[_0x4935('0x3d')](handleError(_0x28f545,null));};exports[_0x4935('0x3e')]=function(_0xf4e847,_0x131483){return db[_0x4935('0x35')][_0x4935('0x3e')](_0xf4e847[_0x4935('0x3f')],{})['then'](respondWithResult(_0x131483,0xc9))[_0x4935('0x3d')](handleError(_0x131483,null));};exports['update']=function(_0x13d78c,_0x144ac5){if(_0x13d78c[_0x4935('0x3f')]['id']){delete _0x13d78c[_0x4935('0x3f')]['id'];}return db['VtigerField'][_0x4935('0x3c')]({'where':{'id':_0x13d78c[_0x4935('0x3a')]['id']}})[_0x4935('0x21')](handleEntityNotFound(_0x144ac5,null))[_0x4935('0x21')](saveUpdates(_0x13d78c[_0x4935('0x3f')],null))[_0x4935('0x21')](respondWithResult(_0x144ac5,null))[_0x4935('0x3d')](handleError(_0x144ac5,null));};exports[_0x4935('0x40')]=function(_0x29b932,_0x392cba){return db['VtigerField'][_0x4935('0x3c')]({'where':{'id':_0x29b932[_0x4935('0x3a')]['id']}})['then'](handleEntityNotFound(_0x392cba,null))[_0x4935('0x21')](removeEntity(_0x392cba,null))[_0x4935('0x3d')](handleError(_0x392cba,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0359c02..b0e56fd 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 _0x9a57=['vtiger_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields'];(function(_0x48fb93,_0xbf2078){var _0x36033b=function(_0x51d5ed){while(--_0x51d5ed){_0x48fb93['push'](_0x48fb93['shift']());}};_0x36033b(++_0xbf2078);}(_0x9a57,0x1a3));var _0x79a5=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x9a57[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x79a5('0x0'));var util=require('util');var logger=require(_0x79a5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x79a5('0x2'));var rp=require(_0x79a5('0x3'));var fs=require('fs');var path=require(_0x79a5('0x4'));var rimraf=require('rimraf');var config=require(_0x79a5('0x5'));var attributes=require(_0x79a5('0x6'));module[_0x79a5('0x7')]=function(_0x5dc12d,_0x3aac7c){return _0x5dc12d['define'](_0x79a5('0x8'),attributes,{'tableName':_0x79a5('0x9'),'paranoid':![],'indexes':[{'name':_0x79a5('0xa'),'fields':[_0x79a5('0xb'),_0x79a5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc389=['../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5c6660,_0xd6e60e){var _0xe34709=function(_0x29bbc6){while(--_0x29bbc6){_0x5c6660['push'](_0x5c6660['shift']());}};_0xe34709(++_0xd6e60e);}(_0xc389,0x1cd));var _0x9c38=function(_0x4af64b,_0xc7e66b){_0x4af64b=_0x4af64b-0x0;var _0x41ce56=_0xc389[_0x4af64b];return _0x41ce56;};'use strict';var _=require(_0x9c38('0x0'));var util=require('util');var logger=require(_0x9c38('0x1'))(_0x9c38('0x2'));var moment=require(_0x9c38('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c38('0x4'));var fs=require('fs');var path=require(_0x9c38('0x5'));var rimraf=require(_0x9c38('0x6'));var config=require(_0x9c38('0x7'));var attributes=require(_0x9c38('0x8'));module[_0x9c38('0x9')]=function(_0xbfeb15,_0x49d2f7){return _0xbfeb15['define'](_0x9c38('0xa'),attributes,{'tableName':_0x9c38('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x9c38('0xc')],'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 952905e..494bfa3 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 _0x7342=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x5a32c7,_0x3d43fe){var _0x296b98=function(_0x6f637e){while(--_0x6f637e){_0x5a32c7['push'](_0x5a32c7['shift']());}};_0x296b98(++_0x3d43fe);}(_0x7342,0xa3));var _0x2734=function(_0x59bc36,_0x12aae8){_0x59bc36=_0x59bc36-0x0;var _0x1f27ce=_0x7342[_0x59bc36];return _0x1f27ce;};'use strict';var _=require(_0x2734('0x0'));var util=require(_0x2734('0x1'));var moment=require('moment');var BPromise=require(_0x2734('0x2'));var rs=require(_0x2734('0x3'));var fs=require('fs');var Redis=require(_0x2734('0x4'));var db=require(_0x2734('0x5'))['db'];var utils=require(_0x2734('0x6'));var logger=require(_0x2734('0x7'))('rpc');var config=require(_0x2734('0x8'));var jayson=require(_0x2734('0x9'));var client=jayson[_0x2734('0xa')][_0x2734('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x494e78,_0x5b273a,_0x229784){return new BPromise(function(_0x3c3d11,_0x265491){return client[_0x2734('0xc')](_0x494e78,_0x229784)[_0x2734('0xd')](function(_0x248379){logger[_0x2734('0xe')](_0x2734('0xf'),_0x5b273a,'request\x20sent');logger['debug'](_0x2734('0x10'),_0x5b273a,'request\x20sent',JSON['stringify'](_0x248379));if(_0x248379[_0x2734('0x11')]){if(_0x248379[_0x2734('0x11')][_0x2734('0x12')]===0x1f4){logger[_0x2734('0x11')](_0x2734('0xf'),_0x5b273a,_0x248379[_0x2734('0x11')]['message']);return _0x265491(_0x248379[_0x2734('0x11')]['message']);}logger[_0x2734('0x11')](_0x2734('0xf'),_0x5b273a,_0x248379['error'][_0x2734('0x13')]);return _0x3c3d11(_0x248379['error'][_0x2734('0x13')]);}else{logger[_0x2734('0xe')](_0x2734('0xf'),_0x5b273a,_0x2734('0x14'));_0x3c3d11(_0x248379[_0x2734('0x15')][_0x2734('0x13')]);}})[_0x2734('0x16')](function(_0x38413d){logger[_0x2734('0x11')](_0x2734('0xf'),_0x5b273a,_0x38413d);_0x265491(_0x38413d);});});} \ No newline at end of file +var _0xbfdc=['message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x323fff,_0x38f93e){var _0x326de5=function(_0x5520f9){while(--_0x5520f9){_0x323fff['push'](_0x323fff['shift']());}};_0x326de5(++_0x38f93e);}(_0xbfdc,0xe8));var _0xcbfd=function(_0x176715,_0x2ccd43){_0x176715=_0x176715-0x0;var _0x27a6a5=_0xbfdc[_0x176715];return _0x27a6a5;};'use strict';var _=require(_0xcbfd('0x0'));var util=require(_0xcbfd('0x1'));var moment=require(_0xcbfd('0x2'));var BPromise=require(_0xcbfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcbfd('0x4'));var logger=require('../../config/logger')(_0xcbfd('0x5'));var config=require('../../config/environment');var jayson=require(_0xcbfd('0x6'));var client=jayson[_0xcbfd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36f55f,_0xcb78ec,_0x1ae272){return new BPromise(function(_0x2136c6,_0x31461d){return client[_0xcbfd('0x8')](_0x36f55f,_0x1ae272)['then'](function(_0x114f76){logger[_0xcbfd('0x9')]('VtigerField,\x20%s,\x20%s',_0xcb78ec,_0xcbfd('0xa'));logger[_0xcbfd('0xb')]('VtigerField,\x20%s,\x20%s,\x20%s',_0xcb78ec,_0xcbfd('0xa'),JSON[_0xcbfd('0xc')](_0x114f76));if(_0x114f76[_0xcbfd('0xd')]){if(_0x114f76[_0xcbfd('0xd')][_0xcbfd('0xe')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0xcb78ec,_0x114f76[_0xcbfd('0xd')]['message']);return _0x31461d(_0x114f76['error'][_0xcbfd('0xf')]);}logger[_0xcbfd('0xd')]('VtigerField,\x20%s,\x20%s',_0xcb78ec,_0x114f76[_0xcbfd('0xd')][_0xcbfd('0xf')]);return _0x2136c6(_0x114f76[_0xcbfd('0xd')][_0xcbfd('0xf')]);}else{logger[_0xcbfd('0x9')](_0xcbfd('0x10'),_0xcb78ec,_0xcbfd('0xa'));_0x2136c6(_0x114f76[_0xcbfd('0x11')][_0xcbfd('0xf')]);}})[_0xcbfd('0x12')](function(_0x2c810d){logger[_0xcbfd('0xd')](_0xcbfd('0x10'),_0xcb78ec,_0x2c810d);_0x31461d(_0x2c810d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3e825bc..feddb24 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 _0x14b8=['get','isAuthenticated','index','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller'];(function(_0x1639de,_0x54d0c5){var _0x13d544=function(_0x45526d){while(--_0x45526d){_0x1639de['push'](_0x1639de['shift']());}};_0x13d544(++_0x54d0c5);}(_0x14b8,0xec));var _0x814b=function(_0x4066e7,_0x3315c5){_0x4066e7=_0x4066e7-0x0;var _0xe5a3ca=_0x14b8[_0x4066e7];return _0xe5a3ca;};'use strict';var multer=require('multer');var util=require(_0x814b('0x0'));var path=require(_0x814b('0x1'));var timeout=require(_0x814b('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x814b('0x3'));var interaction=require(_0x814b('0x4'));var config=require('../../config/environment');var controller=require(_0x814b('0x5'));router[_0x814b('0x6')]('/',auth[_0x814b('0x7')](),controller[_0x814b('0x8')]);router[_0x814b('0x6')]('/:id',auth[_0x814b('0x7')](),controller[_0x814b('0x9')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x814b('0xa')]);router[_0x814b('0x6')](_0x814b('0xb'),auth[_0x814b('0x7')](),controller['getFields']);router[_0x814b('0xc')]('/',auth[_0x814b('0x7')](),controller[_0x814b('0xd')]);router['post'](_0x814b('0xe'),auth[_0x814b('0x7')](),controller[_0x814b('0xf')]);router[_0x814b('0x10')](_0x814b('0x11'),auth[_0x814b('0x7')](),controller[_0x814b('0x12')]);router[_0x814b('0x13')](_0x814b('0x11'),auth[_0x814b('0x7')](),controller[_0x814b('0x14')]);module[_0x814b('0x15')]=router; \ No newline at end of file +var _0x5a1c=['/:id/configurations','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2a7dad,_0x4f4b8b){var _0x283bda=function(_0x433812){while(--_0x433812){_0x2a7dad['push'](_0x2a7dad['shift']());}};_0x283bda(++_0x4f4b8b);}(_0x5a1c,0xb9));var _0xc5a1=function(_0x51906f,_0x1bace2){_0x51906f=_0x51906f-0x0;var _0xd29157=_0x5a1c[_0x51906f];return _0xd29157;};'use strict';var multer=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var path=require(_0xc5a1('0x2'));var timeout=require(_0xc5a1('0x3'));var express=require(_0xc5a1('0x4'));var router=express[_0xc5a1('0x5')]();var auth=require(_0xc5a1('0x6'));var interaction=require(_0xc5a1('0x7'));var config=require(_0xc5a1('0x8'));var controller=require('./intZendeskAccount.controller');router[_0xc5a1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc5a1('0xa')]);router[_0xc5a1('0x9')](_0xc5a1('0xb'),auth[_0xc5a1('0xc')](),controller['show']);router[_0xc5a1('0x9')](_0xc5a1('0xd'),auth[_0xc5a1('0xc')](),controller['getConfigurations']);router[_0xc5a1('0x9')]('/:id/fields',auth[_0xc5a1('0xc')](),controller[_0xc5a1('0xe')]);router[_0xc5a1('0xf')]('/',auth['isAuthenticated'](),controller[_0xc5a1('0x10')]);router[_0xc5a1('0xf')]('/:id/configurations',auth[_0xc5a1('0xc')](),controller[_0xc5a1('0x11')]);router[_0xc5a1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xc5a1('0x13')]);router['delete'](_0xc5a1('0xb'),auth['isAuthenticated'](),controller[_0xc5a1('0x14')]);module[_0xc5a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index bd9f636..2d27117 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 _0x60ce=['sequelize','exports','STRING','username','password','ENUM','newTab','integrationTab'];(function(_0x56e4d7,_0x14407c){var _0x4641a9=function(_0x1b02e9){while(--_0x1b02e9){_0x56e4d7['push'](_0x56e4d7['shift']());}};_0x4641a9(++_0x14407c);}(_0x60ce,0x118));var _0xe60c=function(_0xbdde8a,_0x3b8784){_0xbdde8a=_0xbdde8a-0x0;var _0x1cc96f=_0x60ce[_0xbdde8a];return _0x1cc96f;};'use strict';var Sequelize=require(_0xe60c('0x0'));module[_0xe60c('0x1')]={'name':{'type':Sequelize[_0xe60c('0x2')]},'description':{'type':Sequelize[_0xe60c('0x2')]},'username':{'type':Sequelize[_0xe60c('0x2')],'unique':_0xe60c('0x3')},'password':{'type':Sequelize[_0xe60c('0x2')]},'token':{'type':Sequelize[_0xe60c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0xe60c('0x4'),'token'),'defaultValue':_0xe60c('0x4')},'serverUrl':{'type':Sequelize[_0xe60c('0x2')]},'type':{'type':Sequelize[_0xe60c('0x5')]('integrationTab',_0xe60c('0x6')),'defaultValue':_0xe60c('0x7')}}; \ No newline at end of file +var _0x8c32=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports'];(function(_0x464d67,_0x210a1a){var _0x4c681d=function(_0x2d1979){while(--_0x2d1979){_0x464d67['push'](_0x464d67['shift']());}};_0x4c681d(++_0x210a1a);}(_0x8c32,0x130));var _0x28c3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8c32[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x28c3('0x0'));module[_0x28c3('0x1')]={'name':{'type':Sequelize[_0x28c3('0x2')]},'description':{'type':Sequelize[_0x28c3('0x2')]},'username':{'type':Sequelize[_0x28c3('0x2')],'unique':_0x28c3('0x3')},'password':{'type':Sequelize[_0x28c3('0x2')]},'token':{'type':Sequelize[_0x28c3('0x2')]},'remoteUri':{'type':Sequelize[_0x28c3('0x2')],'unique':_0x28c3('0x4')},'authType':{'type':Sequelize[_0x28c3('0x5')](_0x28c3('0x6'),'token'),'defaultValue':_0x28c3('0x6')},'serverUrl':{'type':Sequelize[_0x28c3('0x2')]},'type':{'type':Sequelize[_0x28c3('0x5')](_0x28c3('0x7'),_0x28c3('0x8')),'defaultValue':_0x28c3('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d7317d0..5c1fc95 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 _0x3486=['remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','username','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','map','title','position','system_field_options','custom_field_options','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','options','count','include','rows','show','params','create','body','find','getConfigurations','ZendeskConfiguration','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZendeskField','token','authType'];(function(_0x4a8812,_0x430080){var _0x55a784=function(_0x4b25cf){while(--_0x4b25cf){_0x4a8812['push'](_0x4a8812['shift']());}};_0x55a784(++_0x430080);}(_0x3486,0xa2));var _0x6348=function(_0x1c0d45,_0x3a9ee9){_0x1c0d45=_0x1c0d45-0x0;var _0x2ab11e=_0x3486[_0x1c0d45];return _0x2ab11e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6348('0x0'));var rimraf=require(_0x6348('0x1'));var zipdir=require(_0x6348('0x2'));var jsonpatch=require(_0x6348('0x3'));var rp=require(_0x6348('0x4'));var moment=require(_0x6348('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6348('0x6'));var util=require('util');var path=require(_0x6348('0x7'));var sox=require(_0x6348('0x8'));var csv=require(_0x6348('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6348('0xa'));var squel=require(_0x6348('0xb'));var crypto=require(_0x6348('0xc'));var jsforce=require(_0x6348('0xd'));var deskjs=require(_0x6348('0xe'));var toCsv=require(_0x6348('0x9'));var querystring=require(_0x6348('0xf'));var Papa=require(_0x6348('0x10'));var Redis=require(_0x6348('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6348('0x12'));var hardwareService=require(_0x6348('0x13'));var logger=require(_0x6348('0x14'))(_0x6348('0x15'));var utils=require(_0x6348('0x16'));var config=require(_0x6348('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6348('0x18'));var jayson=require(_0x6348('0x19'));var client=jayson['client'][_0x6348('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2c84fa,_0x425977,_0x3f1eb5){if(_0x3f1eb5){var _0x3f30b3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f30b3[_0x6348('0x1b')](_0x425977)){return _0x2c84fa;}else{throw new Error(_0x6348('0x1c'));}}else{return _0x2c84fa;}}function respondWithRpcPromise(_0x8e9df2,_0x11f683,_0x558b05,_0x32e3d6){return new BPromise(function(_0xbf0ba9,_0x321079){var _0x4bfa29=_0x32e3d6||client;return _0x4bfa29[_0x6348('0x1d')](_0x8e9df2,_0x558b05)[_0x6348('0x1e')](function(_0x8d2920){logger[_0x6348('0x1f')](_0x6348('0x20'),_0x11f683,'request\x20sent');logger[_0x6348('0x21')](_0x6348('0x22'),_0x11f683,_0x6348('0x23'),JSON[_0x6348('0x24')](_0x8d2920));if(_0x8d2920['error']){if(_0x8d2920['error']['code']===0x1f4){logger[_0x6348('0x25')](_0x6348('0x20'),_0x11f683,_0x8d2920[_0x6348('0x25')]['message']);return _0x321079(_0x8d2920['error'][_0x6348('0x26')]);}logger[_0x6348('0x25')](_0x6348('0x20'),_0x11f683,_0x8d2920[_0x6348('0x25')]['message']);return _0xbf0ba9(_0x8d2920[_0x6348('0x25')][_0x6348('0x26')]);}else{logger[_0x6348('0x1f')](_0x6348('0x20'),_0x11f683,_0x6348('0x23'));_0xbf0ba9(_0x8d2920[_0x6348('0x27')][_0x6348('0x26')]);}})[_0x6348('0x28')](function(_0x3ca1a3){logger[_0x6348('0x25')](_0x6348('0x20'),_0x11f683,_0x3ca1a3);_0x321079(_0x3ca1a3);});});}function respondWithStatusCode(_0x3eeeaf,_0x2e99b6){_0x2e99b6=_0x2e99b6||0xcc;return function(_0x3f00f3){if(_0x3f00f3){return _0x3eeeaf[_0x6348('0x29')](_0x2e99b6);}return _0x3eeeaf[_0x6348('0x2a')](_0x2e99b6)[_0x6348('0x2b')]();};}function respondWithResult(_0x45f836,_0x35f7df){_0x35f7df=_0x35f7df||0xc8;return function(_0x200997){if(_0x200997){return _0x45f836[_0x6348('0x2a')](_0x35f7df)[_0x6348('0x2c')](_0x200997);}};}function respondWithFilteredResult(_0x5211d1,_0x5a0f9e){return function(_0x7dcd61){if(_0x7dcd61){var _0x5a8244=_0x7dcd61['count'],_0x45cad6=_0x5a0f9e[_0x6348('0x2d')],_0x55de4c=_0x5a0f9e[_0x6348('0x2d')]+_0x5a0f9e[_0x6348('0x2e')],_0x1c8066;if(_0x55de4c>=_0x5a8244){_0x55de4c=_0x5a8244;_0x1c8066=0xc8;}else{_0x1c8066=0xce;}_0x5211d1[_0x6348('0x2a')](_0x1c8066);return _0x5211d1[_0x6348('0x2f')](_0x6348('0x30'),_0x45cad6+'-'+_0x55de4c+'/'+_0x5a8244)['json'](_0x7dcd61);}return null;};}function patchUpdates(_0x14d5f5){return function(_0x5035b3){try{jsonpatch[_0x6348('0x31')](_0x5035b3,_0x14d5f5,!![]);}catch(_0x138616){return BPromise[_0x6348('0x32')](_0x138616);}return _0x5035b3[_0x6348('0x33')]();};}function saveUpdates(_0x1273e5,_0x2f1aa4){return function(_0x16dff6){if(_0x16dff6){return _0x16dff6[_0x6348('0x34')](_0x1273e5)['then'](function(_0x359518){return _0x359518;});}return null;};}function removeEntity(_0x58d6fd,_0x5ba267){return function(_0x54ef90){if(_0x54ef90){return _0x54ef90[_0x6348('0x35')]()[_0x6348('0x1e')](function(){_0x58d6fd[_0x6348('0x2a')](0xcc)[_0x6348('0x2b')]();});}};}function handleEntityNotFound(_0xd66ae3,_0x19ef98){return function(_0x3cf628){if(!_0x3cf628){_0xd66ae3['sendStatus'](0x194);}return _0x3cf628;};}function handleError(_0x384cd6,_0x451280){_0x451280=_0x451280||0x1f4;return function(_0x4032a3){logger['error'](_0x4032a3[_0x6348('0x36')]);if(_0x4032a3['name']){delete _0x4032a3[_0x6348('0x37')];}_0x384cd6['status'](_0x451280)[_0x6348('0x38')](_0x4032a3);};}exports[_0x6348('0x39')]=function(_0x3ef96d,_0x504c65){var _0x21f8cd={},_0x3036a1={},_0x10cb1d={'count':0x0,'rows':[]};var _0x4eae74=db[_0x6348('0x3a')][_0x6348('0x3b')];_0x3036a1[_0x6348('0x3c')]=_[_0x6348('0x3d')](_0x4eae74);_0x3036a1['query']=_[_0x6348('0x3d')](_0x3ef96d[_0x6348('0x3e')]);_0x3036a1[_0x6348('0x3f')]=_[_0x6348('0x40')](_0x3036a1['model'],_0x3036a1['query']);_0x21f8cd[_0x6348('0x41')]=_[_0x6348('0x40')](_0x3036a1[_0x6348('0x3c')],qs[_0x6348('0x42')](_0x3ef96d['query']['fields']));_0x21f8cd[_0x6348('0x41')]=_0x21f8cd['attributes'][_0x6348('0x43')]?_0x21f8cd['attributes']:_0x3036a1[_0x6348('0x3c')];if(!_0x3ef96d[_0x6348('0x3e')]['hasOwnProperty'](_0x6348('0x44'))){_0x21f8cd[_0x6348('0x2e')]=qs[_0x6348('0x2e')](_0x3ef96d['query'][_0x6348('0x2e')]);_0x21f8cd[_0x6348('0x2d')]=qs[_0x6348('0x2d')](_0x3ef96d[_0x6348('0x3e')][_0x6348('0x2d')]);}_0x21f8cd['order']=qs[_0x6348('0x45')](_0x3ef96d[_0x6348('0x3e')][_0x6348('0x45')]);_0x21f8cd[_0x6348('0x46')]=qs['filters'](_[_0x6348('0x47')](_0x3ef96d[_0x6348('0x3e')],_0x3036a1['filters']));if(_0x3ef96d[_0x6348('0x3e')][_0x6348('0x48')]){_0x21f8cd['where']=_[_0x6348('0x49')](_0x21f8cd[_0x6348('0x46')],{'$or':_['map'](_0x4eae74,function(_0x39e335){if(_0x39e335['type'][_0x6348('0x4a')]!==_0x6348('0x4b')){var _0xdc78c6={};_0xdc78c6[_0x39e335['field']]={'$like':'%'+_0x3ef96d[_0x6348('0x3e')][_0x6348('0x48')]+'%'};return _0xdc78c6;}})});}_0x21f8cd=_[_0x6348('0x49')]({},_0x21f8cd,_0x3ef96d[_0x6348('0x4c')]);var _0x16cabb={'where':_0x21f8cd['where']};return db[_0x6348('0x3a')][_0x6348('0x4d')](_0x16cabb)['then'](function(_0x3827c9){_0x10cb1d[_0x6348('0x4d')]=_0x3827c9;if(_0x3ef96d[_0x6348('0x3e')]['includeAll']){_0x21f8cd[_0x6348('0x4e')]=[{'all':!![]}];}return db[_0x6348('0x3a')]['findAll'](_0x21f8cd);})['then'](function(_0x5f21e4){_0x10cb1d[_0x6348('0x4f')]=_0x5f21e4;return _0x10cb1d;})['then'](respondWithFilteredResult(_0x504c65,_0x21f8cd))[_0x6348('0x28')](handleError(_0x504c65,null));};exports[_0x6348('0x50')]=function(_0x563e43,_0x196c98){var _0x15fb70={'raw':![],'where':{'id':_0x563e43[_0x6348('0x51')]['id']}},_0x3fa8fd={};_0x3fa8fd[_0x6348('0x3c')]=_['keys'](db[_0x6348('0x3a')][_0x6348('0x3b')]);_0x3fa8fd[_0x6348('0x3e')]=_[_0x6348('0x3d')](_0x563e43[_0x6348('0x3e')]);_0x3fa8fd[_0x6348('0x3f')]=_[_0x6348('0x40')](_0x3fa8fd[_0x6348('0x3c')],_0x3fa8fd[_0x6348('0x3e')]);_0x15fb70[_0x6348('0x41')]=_['intersection'](_0x3fa8fd['model'],qs[_0x6348('0x42')](_0x563e43[_0x6348('0x3e')]['fields']));_0x15fb70[_0x6348('0x41')]=_0x15fb70[_0x6348('0x41')][_0x6348('0x43')]?_0x15fb70[_0x6348('0x41')]:_0x3fa8fd[_0x6348('0x3c')];if(_0x563e43[_0x6348('0x3e')]['includeAll']){_0x15fb70[_0x6348('0x4e')]=[{'all':!![]}];}_0x15fb70=_['merge']({},_0x15fb70,_0x563e43[_0x6348('0x4c')]);return db[_0x6348('0x3a')]['find'](_0x15fb70)[_0x6348('0x1e')](handleEntityNotFound(_0x196c98,null))[_0x6348('0x1e')](respondWithResult(_0x196c98,null))[_0x6348('0x28')](handleError(_0x196c98,null));};exports[_0x6348('0x52')]=function(_0x256ffb,_0x26e4b6){return db[_0x6348('0x3a')][_0x6348('0x52')](_0x256ffb['body'],{})['then'](respondWithResult(_0x26e4b6,0xc9))['catch'](handleError(_0x26e4b6,null));};exports['update']=function(_0x135a21,_0xd8d837){if(_0x135a21[_0x6348('0x53')]['id']){delete _0x135a21[_0x6348('0x53')]['id'];}return db[_0x6348('0x3a')]['find']({'where':{'id':_0x135a21[_0x6348('0x51')]['id']}})[_0x6348('0x1e')](handleEntityNotFound(_0xd8d837,null))[_0x6348('0x1e')](saveUpdates(_0x135a21['body'],null))[_0x6348('0x1e')](respondWithResult(_0xd8d837,null))[_0x6348('0x28')](handleError(_0xd8d837,null));};exports[_0x6348('0x35')]=function(_0x411b6c,_0x114bfd){return db['ZendeskAccount'][_0x6348('0x54')]({'where':{'id':_0x411b6c['params']['id']}})[_0x6348('0x1e')](handleEntityNotFound(_0x114bfd,null))['then'](removeEntity(_0x114bfd,null))['catch'](handleError(_0x114bfd,null));};exports[_0x6348('0x55')]=function(_0x4bc434,_0x1429fd,_0x4b7547){var _0x49ae01={};var _0x5d3346={};var _0x15028b;var _0x269608;return db[_0x6348('0x3a')]['findOne']({'where':{'id':_0x4bc434[_0x6348('0x51')]['id']}})[_0x6348('0x1e')](handleEntityNotFound(_0x1429fd,null))[_0x6348('0x1e')](function(_0x4eaae9){if(_0x4eaae9){_0x15028b=_0x4eaae9;_0x5d3346[_0x6348('0x3c')]=_[_0x6348('0x3d')](db[_0x6348('0x56')]['rawAttributes']);_0x5d3346[_0x6348('0x3e')]=_['keys'](_0x4bc434[_0x6348('0x3e')]);_0x5d3346['filters']=_[_0x6348('0x40')](_0x5d3346[_0x6348('0x3c')],_0x5d3346[_0x6348('0x3e')]);_0x49ae01[_0x6348('0x41')]=_[_0x6348('0x40')](_0x5d3346[_0x6348('0x3c')],qs['fields'](_0x4bc434['query']['fields']));_0x49ae01[_0x6348('0x41')]=_0x49ae01[_0x6348('0x41')][_0x6348('0x43')]?_0x49ae01[_0x6348('0x41')]:_0x5d3346[_0x6348('0x3c')];_0x49ae01[_0x6348('0x57')]=qs[_0x6348('0x45')](_0x4bc434['query'][_0x6348('0x45')]);_0x49ae01[_0x6348('0x46')]=qs[_0x6348('0x3f')](_[_0x6348('0x47')](_0x4bc434[_0x6348('0x3e')],_0x5d3346[_0x6348('0x3f')]));if(_0x4bc434[_0x6348('0x3e')][_0x6348('0x48')]){_0x49ae01[_0x6348('0x46')]=_['merge'](_0x49ae01[_0x6348('0x46')],{'$or':_['map'](_0x49ae01[_0x6348('0x41')],function(_0x2998ca){var _0x4a9999={};_0x4a9999[_0x2998ca]={'$like':'%'+_0x4bc434[_0x6348('0x3e')][_0x6348('0x48')]+'%'};return _0x4a9999;})});}_0x49ae01=_['merge']({},_0x49ae01,_0x4bc434[_0x6348('0x4c')]);return _0x15028b[_0x6348('0x55')](_0x49ae01);}})[_0x6348('0x1e')](function(_0x178a08){if(_0x178a08){_0x269608=_0x178a08[_0x6348('0x43')];if(!_0x4bc434[_0x6348('0x3e')][_0x6348('0x58')]('nolimit')){_0x49ae01['limit']=qs[_0x6348('0x2e')](_0x4bc434[_0x6348('0x3e')][_0x6348('0x2e')]);_0x49ae01[_0x6348('0x2d')]=qs[_0x6348('0x2d')](_0x4bc434[_0x6348('0x3e')][_0x6348('0x2d')]);}return _0x15028b['getConfigurations'](_0x49ae01);}})[_0x6348('0x1e')](function(_0x396a73){if(_0x396a73){return _0x396a73?{'count':_0x269608,'rows':_0x396a73}:null;}})[_0x6348('0x1e')](respondWithResult(_0x1429fd,null))['catch'](handleError(_0x1429fd,null));};exports[_0x6348('0x59')]=function(_0x6c2c43,_0x1dee26,_0x5262c4){if(_0x6c2c43[_0x6348('0x53')]['id']){delete _0x6c2c43['body']['id'];}return db[_0x6348('0x3a')][_0x6348('0x5a')]({'where':{'id':_0x6c2c43['params']['id']}})[_0x6348('0x1e')](handleEntityNotFound(_0x1dee26,null))[_0x6348('0x1e')](function(_0x4fc8c1){if(_0x4fc8c1){_0x6c2c43[_0x6348('0x53')][_0x6348('0x5b')]=_0x4fc8c1['id'];_0x6c2c43[_0x6348('0x53')][_0x6348('0x5c')]=integrations['getSubjects'](_0x6c2c43[_0x6348('0x53')][_0x6348('0x5d')],_0x6c2c43['body'][_0x6348('0x5e')]);_0x6c2c43[_0x6348('0x53')][_0x6348('0x5f')]=integrations[_0x6348('0x60')](_0x6c2c43[_0x6348('0x53')][_0x6348('0x5d')],_0x6c2c43[_0x6348('0x53')]['type']);return db['ZendeskConfiguration'][_0x6348('0x52')](_0x6c2c43[_0x6348('0x53')],{'include':[{'model':db[_0x6348('0x61')],'as':_0x6348('0x5c')},{'model':db[_0x6348('0x61')],'as':'Descriptions'}]});}return null;})[_0x6348('0x1e')](respondWithResult(_0x1dee26,null))['catch'](handleError(_0x1dee26,null));};exports['getFields']=function(_0x472bb0,_0x51a30a,_0x19f53b){var _0x3445dc='';return db[_0x6348('0x3a')]['findOne']({'where':{'id':_0x472bb0['params']['id']},'attributes':['id','username','password',_0x6348('0x62'),_0x6348('0x63'),_0x6348('0x64')]})[_0x6348('0x1e')](handleEntityNotFound(_0x51a30a,null))[_0x6348('0x1e')](function(_0x159bc9){if(_0x159bc9){_0x3445dc=_0x159bc9[_0x6348('0x64')];var _0x58fa32=_0x3445dc[_0x6348('0x65')](-0x1);if(_0x58fa32==='/'){_0x3445dc=_0x3445dc['substring'](0x0,_0x3445dc[_0x6348('0x66')](_0x58fa32));}var _0x376ec9={'method':_0x6348('0x67'),'uri':util[_0x6348('0x68')](_0x6348('0x69'),_0x3445dc,_0x6348('0x6a')),'json':!![]};switch(_0x159bc9['authType']){case _0x6348('0x6b'):_0x376ec9[_0x6348('0x6c')]={'Authorization':util['format'](_0x6348('0x6d'),new Buffer(util[_0x6348('0x68')](_0x6348('0x6e'),_0x159bc9['username'],_0x159bc9[_0x6348('0x6b')]))[_0x6348('0x6f')]('base64'))};break;case _0x6348('0x62'):_0x376ec9['headers']={'Authorization':util[_0x6348('0x68')](_0x6348('0x6d'),new Buffer(util['format'](_0x6348('0x70'),_0x159bc9[_0x6348('0x71')],_0x159bc9[_0x6348('0x62')]))[_0x6348('0x6f')](_0x6348('0x72')))};break;default:throw new db[(_0x6348('0x73'))][(_0x6348('0x74'))](_0x6348('0x75'));}return rp(_0x376ec9);}})[_0x6348('0x1e')](function(_0x4bbdc0){if(_0x4bbdc0){var _0x35364a=[_0x6348('0x76'),_0x6348('0x77'),'group',_0x6348('0x78')];_[_0x6348('0x79')](_0x4bbdc0[_0x6348('0x6a')],function(_0x21cc63){return _0x35364a[_0x6348('0x7a')](_0x21cc63['type']);});return{'count':_0x4bbdc0[_0x6348('0x6a')][_0x6348('0x43')],'rows':_[_0x6348('0x7b')](_0x4bbdc0['ticket_fields'],function(_0x41bd63){return{'id':_0x41bd63['id'],'name':_0x41bd63['position']>0x7?_0x41bd63[_0x6348('0x7c')]:_0x41bd63[_0x6348('0x5e')],'custom':_0x41bd63[_0x6348('0x7d')]>0x7?!![]:![],'options':_0x41bd63[_0x6348('0x7e')]?_0x41bd63['system_field_options']:_0x41bd63[_0x6348('0x7f')]?_0x41bd63[_0x6348('0x7f')]:[]};})};}})[_0x6348('0x1e')](respondWithResult(_0x51a30a,null))[_0x6348('0x28')](function(_0x17ccdc){var _0x1f0bc6=_0x472bb0['query'][_0x6348('0x1b')]?0x1f4:_0x17ccdc[_0x6348('0x80')]||0x1f4;logger[_0x6348('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x6348('0x81'),_0x1f0bc6,JSON['stringify'](_0x17ccdc));delete _0x17ccdc[_0x6348('0x37')];if(_0x1f0bc6===0x191){_0x1f0bc6=0x190;}_0x51a30a[_0x6348('0x2a')](_0x1f0bc6)[_0x6348('0x38')](_0x472bb0[_0x6348('0x3e')]['test']?{'message':_0x6348('0x82'),'statusCode':_0x17ccdc[_0x6348('0x80')]}:_0x17ccdc);});}; \ No newline at end of file +var _0x99f4=['to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','name','send','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','rows','show','find','create','body','params','order','pick','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','type','ZendeskConfiguration','Subjects','getFields','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','includes','position','system_field_options','custom_field_options','statusCode','html-pdf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x170362,_0x1bf09a){var _0x2fd172=function(_0x525b86){while(--_0x525b86){_0x170362['push'](_0x170362['shift']());}};_0x2fd172(++_0x1bf09a);}(_0x99f4,0x73));var _0x499f=function(_0x170ec2,_0x1f33fe){_0x170ec2=_0x170ec2-0x0;var _0x3ab0b3=_0x99f4[_0x170ec2];return _0x3ab0b3;};'use strict';var pdf=require(_0x499f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x499f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x499f('0x2'));var moment=require(_0x499f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x499f('0x4'));var util=require(_0x499f('0x5'));var path=require(_0x499f('0x6'));var sox=require(_0x499f('0x7'));var csv=require(_0x499f('0x8'));var ejs=require(_0x499f('0x9'));var fs=require('fs');var _=require(_0x499f('0xa'));var squel=require('squel');var crypto=require(_0x499f('0xb'));var jsforce=require(_0x499f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x499f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x499f('0xd'));var authService=require(_0x499f('0xe'));var qs=require(_0x499f('0xf'));var hardwareService=require(_0x499f('0x10'));var logger=require('../../config/logger')(_0x499f('0x11'));var utils=require(_0x499f('0x12'));var config=require('../../config/environment');var db=require(_0x499f('0x13'))['db'];var integrations=require(_0x499f('0x14'));var jayson=require(_0x499f('0x15'));var client=jayson[_0x499f('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0xc856f6,_0x38f598,_0x5617d0){if(_0x5617d0){var _0x54d330=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54d330[_0x499f('0x17')](_0x38f598)){return _0xc856f6;}else{throw new Error(_0x499f('0x18'));}}else{return _0xc856f6;}}function respondWithRpcPromise(_0x504bcd,_0x4d0dfc,_0x54b721,_0x5c2010){return new BPromise(function(_0x161ffa,_0x2b523a){var _0xd84c62=_0x5c2010||client;return _0xd84c62[_0x499f('0x19')](_0x504bcd,_0x54b721)['then'](function(_0x27e8d9){logger[_0x499f('0x1a')]('ZendeskAccount,\x20%s,\x20%s',_0x4d0dfc,'request\x20sent');logger['debug'](_0x499f('0x1b'),_0x4d0dfc,_0x499f('0x1c'),JSON[_0x499f('0x1d')](_0x27e8d9));if(_0x27e8d9[_0x499f('0x1e')]){if(_0x27e8d9[_0x499f('0x1e')][_0x499f('0x1f')]===0x1f4){logger['error'](_0x499f('0x20'),_0x4d0dfc,_0x27e8d9[_0x499f('0x1e')]['message']);return _0x2b523a(_0x27e8d9['error'][_0x499f('0x21')]);}logger[_0x499f('0x1e')](_0x499f('0x20'),_0x4d0dfc,_0x27e8d9[_0x499f('0x1e')][_0x499f('0x21')]);return _0x161ffa(_0x27e8d9[_0x499f('0x1e')][_0x499f('0x21')]);}else{logger[_0x499f('0x1a')](_0x499f('0x20'),_0x4d0dfc,_0x499f('0x1c'));_0x161ffa(_0x27e8d9[_0x499f('0x22')][_0x499f('0x21')]);}})[_0x499f('0x23')](function(_0x337a6a){logger[_0x499f('0x1e')](_0x499f('0x20'),_0x4d0dfc,_0x337a6a);_0x2b523a(_0x337a6a);});});}function respondWithStatusCode(_0x35b237,_0x1b03a5){_0x1b03a5=_0x1b03a5||0xcc;return function(_0x5ea046){if(_0x5ea046){return _0x35b237[_0x499f('0x24')](_0x1b03a5);}return _0x35b237[_0x499f('0x25')](_0x1b03a5)[_0x499f('0x26')]();};}function respondWithResult(_0x4d02e5,_0x20ebd2){_0x20ebd2=_0x20ebd2||0xc8;return function(_0x2d6d0f){if(_0x2d6d0f){return _0x4d02e5[_0x499f('0x25')](_0x20ebd2)[_0x499f('0x27')](_0x2d6d0f);}};}function respondWithFilteredResult(_0xa1baf,_0x1acfe0){return function(_0x5c2663){if(_0x5c2663){var _0x217f47=_0x5c2663[_0x499f('0x28')],_0x43f91a=_0x1acfe0[_0x499f('0x29')],_0x6e3eb1=_0x1acfe0[_0x499f('0x29')]+_0x1acfe0['limit'],_0x519ff8;if(_0x6e3eb1>=_0x217f47){_0x6e3eb1=_0x217f47;_0x519ff8=0xc8;}else{_0x519ff8=0xce;}_0xa1baf[_0x499f('0x25')](_0x519ff8);return _0xa1baf[_0x499f('0x2a')](_0x499f('0x2b'),_0x43f91a+'-'+_0x6e3eb1+'/'+_0x217f47)['json'](_0x5c2663);}return null;};}function patchUpdates(_0x4f2a64){return function(_0x388309){try{jsonpatch[_0x499f('0x2c')](_0x388309,_0x4f2a64,!![]);}catch(_0x43819a){return BPromise[_0x499f('0x2d')](_0x43819a);}return _0x388309['save']();};}function saveUpdates(_0x43b4a8,_0x27c4e6){return function(_0x420c7f){if(_0x420c7f){return _0x420c7f[_0x499f('0x2e')](_0x43b4a8)['then'](function(_0x4657b8){return _0x4657b8;});}return null;};}function removeEntity(_0x54cedc,_0xe772ac){return function(_0x4b5fa0){if(_0x4b5fa0){return _0x4b5fa0[_0x499f('0x2f')]()[_0x499f('0x30')](function(){_0x54cedc[_0x499f('0x25')](0xcc)[_0x499f('0x26')]();});}};}function handleEntityNotFound(_0x20b3d1,_0x44255c){return function(_0x50fd0c){if(!_0x50fd0c){_0x20b3d1[_0x499f('0x24')](0x194);}return _0x50fd0c;};}function handleError(_0x46776d,_0x1b4b0c){_0x1b4b0c=_0x1b4b0c||0x1f4;return function(_0x5ab36f){logger['error'](_0x5ab36f['stack']);if(_0x5ab36f[_0x499f('0x31')]){delete _0x5ab36f['name'];}_0x46776d['status'](_0x1b4b0c)[_0x499f('0x32')](_0x5ab36f);};}exports['index']=function(_0x55c0ba,_0x3a9c41){var _0x5d7be5={},_0x41610d={},_0x1867b8={'count':0x0,'rows':[]};var _0x40b803=db[_0x499f('0x33')][_0x499f('0x34')];_0x41610d[_0x499f('0x35')]=_[_0x499f('0x36')](_0x40b803);_0x41610d['query']=_['keys'](_0x55c0ba[_0x499f('0x37')]);_0x41610d[_0x499f('0x38')]=_[_0x499f('0x39')](_0x41610d[_0x499f('0x35')],_0x41610d[_0x499f('0x37')]);_0x5d7be5['attributes']=_[_0x499f('0x39')](_0x41610d['model'],qs[_0x499f('0x3a')](_0x55c0ba['query'][_0x499f('0x3a')]));_0x5d7be5[_0x499f('0x3b')]=_0x5d7be5['attributes'][_0x499f('0x3c')]?_0x5d7be5[_0x499f('0x3b')]:_0x41610d[_0x499f('0x35')];if(!_0x55c0ba[_0x499f('0x37')][_0x499f('0x3d')](_0x499f('0x3e'))){_0x5d7be5['limit']=qs[_0x499f('0x3f')](_0x55c0ba[_0x499f('0x37')][_0x499f('0x3f')]);_0x5d7be5[_0x499f('0x29')]=qs['offset'](_0x55c0ba['query'][_0x499f('0x29')]);}_0x5d7be5['order']=qs[_0x499f('0x40')](_0x55c0ba[_0x499f('0x37')][_0x499f('0x40')]);_0x5d7be5[_0x499f('0x41')]=qs[_0x499f('0x38')](_['pick'](_0x55c0ba[_0x499f('0x37')],_0x41610d['filters']));if(_0x55c0ba['query'][_0x499f('0x42')]){_0x5d7be5[_0x499f('0x41')]=_[_0x499f('0x43')](_0x5d7be5[_0x499f('0x41')],{'$or':_[_0x499f('0x44')](_0x40b803,function(_0x435493){if(_0x435493['type'][_0x499f('0x45')]!=='VIRTUAL'){var _0x3bd34b={};_0x3bd34b[_0x435493[_0x499f('0x46')]]={'$like':'%'+_0x55c0ba[_0x499f('0x37')][_0x499f('0x42')]+'%'};return _0x3bd34b;}})});}_0x5d7be5=_[_0x499f('0x43')]({},_0x5d7be5,_0x55c0ba[_0x499f('0x47')]);var _0x3334cd={'where':_0x5d7be5['where']};return db['ZendeskAccount'][_0x499f('0x28')](_0x3334cd)[_0x499f('0x30')](function(_0x5514d3){_0x1867b8[_0x499f('0x28')]=_0x5514d3;if(_0x55c0ba[_0x499f('0x37')][_0x499f('0x48')]){_0x5d7be5[_0x499f('0x49')]=[{'all':!![]}];}return db[_0x499f('0x33')][_0x499f('0x4a')](_0x5d7be5);})[_0x499f('0x30')](function(_0x46df55){_0x1867b8[_0x499f('0x4b')]=_0x46df55;return _0x1867b8;})[_0x499f('0x30')](respondWithFilteredResult(_0x3a9c41,_0x5d7be5))[_0x499f('0x23')](handleError(_0x3a9c41,null));};exports[_0x499f('0x4c')]=function(_0x1a0ccf,_0x31541c){var _0x45b2a1={'raw':![],'where':{'id':_0x1a0ccf['params']['id']}},_0x4adf0={};_0x4adf0[_0x499f('0x35')]=_[_0x499f('0x36')](db[_0x499f('0x33')][_0x499f('0x34')]);_0x4adf0['query']=_[_0x499f('0x36')](_0x1a0ccf[_0x499f('0x37')]);_0x4adf0[_0x499f('0x38')]=_[_0x499f('0x39')](_0x4adf0[_0x499f('0x35')],_0x4adf0['query']);_0x45b2a1[_0x499f('0x3b')]=_[_0x499f('0x39')](_0x4adf0[_0x499f('0x35')],qs[_0x499f('0x3a')](_0x1a0ccf[_0x499f('0x37')][_0x499f('0x3a')]));_0x45b2a1['attributes']=_0x45b2a1[_0x499f('0x3b')][_0x499f('0x3c')]?_0x45b2a1[_0x499f('0x3b')]:_0x4adf0[_0x499f('0x35')];if(_0x1a0ccf[_0x499f('0x37')]['includeAll']){_0x45b2a1[_0x499f('0x49')]=[{'all':!![]}];}_0x45b2a1=_['merge']({},_0x45b2a1,_0x1a0ccf[_0x499f('0x47')]);return db[_0x499f('0x33')][_0x499f('0x4d')](_0x45b2a1)['then'](handleEntityNotFound(_0x31541c,null))['then'](respondWithResult(_0x31541c,null))[_0x499f('0x23')](handleError(_0x31541c,null));};exports['create']=function(_0x429865,_0x389444){return db[_0x499f('0x33')][_0x499f('0x4e')](_0x429865[_0x499f('0x4f')],{})[_0x499f('0x30')](respondWithResult(_0x389444,0xc9))[_0x499f('0x23')](handleError(_0x389444,null));};exports[_0x499f('0x2e')]=function(_0x1ac5c1,_0x9a3665){if(_0x1ac5c1[_0x499f('0x4f')]['id']){delete _0x1ac5c1['body']['id'];}return db[_0x499f('0x33')][_0x499f('0x4d')]({'where':{'id':_0x1ac5c1['params']['id']}})[_0x499f('0x30')](handleEntityNotFound(_0x9a3665,null))[_0x499f('0x30')](saveUpdates(_0x1ac5c1['body'],null))['then'](respondWithResult(_0x9a3665,null))[_0x499f('0x23')](handleError(_0x9a3665,null));};exports[_0x499f('0x2f')]=function(_0x2f1077,_0x385a9c){return db[_0x499f('0x33')]['find']({'where':{'id':_0x2f1077[_0x499f('0x50')]['id']}})['then'](handleEntityNotFound(_0x385a9c,null))[_0x499f('0x30')](removeEntity(_0x385a9c,null))[_0x499f('0x23')](handleError(_0x385a9c,null));};exports['getConfigurations']=function(_0x21d41f,_0x34fe89,_0x3d6b5f){var _0x388a24={};var _0x7d7aa5={};var _0x25d43a;var _0x2978bc;return db[_0x499f('0x33')]['findOne']({'where':{'id':_0x21d41f['params']['id']}})[_0x499f('0x30')](handleEntityNotFound(_0x34fe89,null))[_0x499f('0x30')](function(_0x71990e){if(_0x71990e){_0x25d43a=_0x71990e;_0x7d7aa5[_0x499f('0x35')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x7d7aa5[_0x499f('0x37')]=_[_0x499f('0x36')](_0x21d41f['query']);_0x7d7aa5[_0x499f('0x38')]=_[_0x499f('0x39')](_0x7d7aa5[_0x499f('0x35')],_0x7d7aa5[_0x499f('0x37')]);_0x388a24[_0x499f('0x3b')]=_[_0x499f('0x39')](_0x7d7aa5[_0x499f('0x35')],qs[_0x499f('0x3a')](_0x21d41f[_0x499f('0x37')][_0x499f('0x3a')]));_0x388a24[_0x499f('0x3b')]=_0x388a24[_0x499f('0x3b')][_0x499f('0x3c')]?_0x388a24[_0x499f('0x3b')]:_0x7d7aa5[_0x499f('0x35')];_0x388a24[_0x499f('0x51')]=qs[_0x499f('0x40')](_0x21d41f[_0x499f('0x37')][_0x499f('0x40')]);_0x388a24[_0x499f('0x41')]=qs[_0x499f('0x38')](_[_0x499f('0x52')](_0x21d41f[_0x499f('0x37')],_0x7d7aa5[_0x499f('0x38')]));if(_0x21d41f[_0x499f('0x37')][_0x499f('0x42')]){_0x388a24['where']=_['merge'](_0x388a24[_0x499f('0x41')],{'$or':_[_0x499f('0x44')](_0x388a24[_0x499f('0x3b')],function(_0x4cdeb0){var _0x53fe2d={};_0x53fe2d[_0x4cdeb0]={'$like':'%'+_0x21d41f[_0x499f('0x37')][_0x499f('0x42')]+'%'};return _0x53fe2d;})});}_0x388a24=_[_0x499f('0x43')]({},_0x388a24,_0x21d41f[_0x499f('0x47')]);return _0x25d43a[_0x499f('0x53')](_0x388a24);}})[_0x499f('0x30')](function(_0x710b21){if(_0x710b21){_0x2978bc=_0x710b21[_0x499f('0x3c')];if(!_0x21d41f[_0x499f('0x37')][_0x499f('0x3d')]('nolimit')){_0x388a24['limit']=qs[_0x499f('0x3f')](_0x21d41f[_0x499f('0x37')][_0x499f('0x3f')]);_0x388a24['offset']=qs[_0x499f('0x29')](_0x21d41f[_0x499f('0x37')]['offset']);}return _0x25d43a['getConfigurations'](_0x388a24);}})[_0x499f('0x30')](function(_0x199472){if(_0x199472){return _0x199472?{'count':_0x2978bc,'rows':_0x199472}:null;}})[_0x499f('0x30')](respondWithResult(_0x34fe89,null))['catch'](handleError(_0x34fe89,null));};exports[_0x499f('0x54')]=function(_0x4dff09,_0x502900,_0x4c099e){if(_0x4dff09['body']['id']){delete _0x4dff09[_0x499f('0x4f')]['id'];}return db['ZendeskAccount'][_0x499f('0x55')]({'where':{'id':_0x4dff09[_0x499f('0x50')]['id']}})[_0x499f('0x30')](handleEntityNotFound(_0x502900,null))[_0x499f('0x30')](function(_0xcf0d13){if(_0xcf0d13){_0x4dff09[_0x499f('0x4f')][_0x499f('0x56')]=_0xcf0d13['id'];_0x4dff09['body']['Subjects']=integrations[_0x499f('0x57')](_0x4dff09['body'][_0x499f('0x58')],_0x4dff09[_0x499f('0x4f')]['type']);_0x4dff09[_0x499f('0x4f')][_0x499f('0x59')]=integrations[_0x499f('0x5a')](_0x4dff09[_0x499f('0x4f')]['channel'],_0x4dff09[_0x499f('0x4f')][_0x499f('0x5b')]);return db[_0x499f('0x5c')][_0x499f('0x4e')](_0x4dff09['body'],{'include':[{'model':db['ZendeskField'],'as':_0x499f('0x5d')},{'model':db['ZendeskField'],'as':_0x499f('0x59')}]});}return null;})[_0x499f('0x30')](respondWithResult(_0x502900,null))[_0x499f('0x23')](handleError(_0x502900,null));};exports[_0x499f('0x5e')]=function(_0x7cb0c6,_0x2918fb,_0x39f947){var _0x169619='';return db[_0x499f('0x33')][_0x499f('0x55')]({'where':{'id':_0x7cb0c6[_0x499f('0x50')]['id']},'attributes':['id','username',_0x499f('0x5f'),_0x499f('0x60'),_0x499f('0x61'),_0x499f('0x62')]})[_0x499f('0x30')](handleEntityNotFound(_0x2918fb,null))[_0x499f('0x30')](function(_0x28cee9){if(_0x28cee9){_0x169619=_0x28cee9[_0x499f('0x62')];var _0x26b53b=_0x169619[_0x499f('0x63')](-0x1);if(_0x26b53b==='/'){_0x169619=_0x169619[_0x499f('0x64')](0x0,_0x169619[_0x499f('0x65')](_0x26b53b));}var _0x58f46d={'method':_0x499f('0x66'),'uri':util[_0x499f('0x67')](_0x499f('0x68'),_0x169619,_0x499f('0x69')),'json':!![]};switch(_0x28cee9[_0x499f('0x61')]){case _0x499f('0x5f'):_0x58f46d[_0x499f('0x6a')]={'Authorization':util[_0x499f('0x67')](_0x499f('0x6b'),new Buffer(util['format'](_0x499f('0x6c'),_0x28cee9[_0x499f('0x6d')],_0x28cee9[_0x499f('0x5f')]))['toString'](_0x499f('0x6e')))};break;case'token':_0x58f46d['headers']={'Authorization':util[_0x499f('0x67')](_0x499f('0x6b'),new Buffer(util[_0x499f('0x67')](_0x499f('0x6f'),_0x28cee9[_0x499f('0x6d')],_0x28cee9['token']))[_0x499f('0x70')]('base64'))};break;default:throw new db['Sequelize'][(_0x499f('0x71'))](_0x499f('0x72'));}return rp(_0x58f46d);}})[_0x499f('0x30')](function(_0x24bb4e){if(_0x24bb4e){var _0x34caf2=[_0x499f('0x73'),_0x499f('0x74'),'group',_0x499f('0x75')];_['remove'](_0x24bb4e[_0x499f('0x69')],function(_0x32b62f){return _0x34caf2[_0x499f('0x76')](_0x32b62f['type']);});return{'count':_0x24bb4e['ticket_fields'][_0x499f('0x3c')],'rows':_[_0x499f('0x44')](_0x24bb4e[_0x499f('0x69')],function(_0x59bdfa){return{'id':_0x59bdfa['id'],'name':_0x59bdfa[_0x499f('0x77')]>0x7?_0x59bdfa['title']:_0x59bdfa[_0x499f('0x5b')],'custom':_0x59bdfa['position']>0x7?!![]:![],'options':_0x59bdfa[_0x499f('0x78')]?_0x59bdfa[_0x499f('0x78')]:_0x59bdfa[_0x499f('0x79')]?_0x59bdfa[_0x499f('0x79')]:[]};})};}})[_0x499f('0x30')](respondWithResult(_0x2918fb,null))[_0x499f('0x23')](function(_0xda0b9){var _0x483104=_0x7cb0c6[_0x499f('0x37')][_0x499f('0x17')]?0x1f4:_0xda0b9[_0x499f('0x7a')]||0x1f4;logger[_0x499f('0x1e')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x483104,JSON['stringify'](_0xda0b9));delete _0xda0b9[_0x499f('0x31')];if(_0x483104===0x191){_0x483104=0x190;}_0x2918fb['status'](_0x483104)['send'](_0x7cb0c6['query'][_0x499f('0x17')]?{'message':'Wrong\x20credentials','statusCode':_0xda0b9[_0x499f('0x7a')]}:_0xda0b9);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 6e37667..9fd785c 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 _0xfd20=['ZendeskAccount','int_zendesk_accounts','util','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x67b075,_0x43557d){var _0x39d030=function(_0x4f25e1){while(--_0x4f25e1){_0x67b075['push'](_0x67b075['shift']());}};_0x39d030(++_0x43557d);}(_0xfd20,0x66));var _0x0fd2=function(_0x56fb73,_0x491492){_0x56fb73=_0x56fb73-0x0;var _0xa9dd3=_0xfd20[_0x56fb73];return _0xa9dd3;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0fd2('0x1'));var BPromise=require(_0x0fd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd2('0x3'));var rimraf=require('rimraf');var config=require(_0x0fd2('0x4'));var attributes=require(_0x0fd2('0x5'));var integrations=require(_0x0fd2('0x6'));module[_0x0fd2('0x7')]=function(_0x247d6e,_0x4d114c){return _0x247d6e['define'](_0x0fd2('0x8'),attributes,{'tableName':_0x0fd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4667=['rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','request-promise','path'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x4667,0x10f));var _0x7466=function(_0x425540,_0x97a491){_0x425540=_0x425540-0x0;var _0x117693=_0x4667[_0x425540];return _0x117693;};'use strict';var _=require(_0x7466('0x0'));var util=require(_0x7466('0x1'));var logger=require('../../config/logger')(_0x7466('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7466('0x3'));var fs=require('fs');var path=require(_0x7466('0x4'));var rimraf=require(_0x7466('0x5'));var config=require('../../config/environment');var attributes=require(_0x7466('0x6'));var integrations=require(_0x7466('0x7'));module[_0x7466('0x8')]=function(_0x25e38d,_0x2d1fbb){return _0x25e38d[_0x7466('0x9')](_0x7466('0xa'),attributes,{'tableName':_0x7466('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 6d838b5..3c58b87 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 _0xa318=['http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','map','include','model','stringify','ShowZendeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0xa85dbd,_0x2838a5){var _0x3be7aa=function(_0x2573f8){while(--_0x2573f8){_0xa85dbd['push'](_0xa85dbd['shift']());}};_0x3be7aa(++_0x2838a5);}(_0xa318,0x9c));var _0x8a31=function(_0x23648e,_0x4e9160){_0x23648e=_0x23648e-0x0;var _0x520be8=_0xa318[_0x23648e];return _0x520be8;};'use strict';var _=require(_0x8a31('0x0'));var util=require(_0x8a31('0x1'));var moment=require(_0x8a31('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a31('0x3'));var fs=require('fs');var Redis=require(_0x8a31('0x4'));var db=require(_0x8a31('0x5'))['db'];var utils=require(_0x8a31('0x6'));var logger=require('../../config/logger')(_0x8a31('0x7'));var config=require('../../config/environment');var jayson=require(_0x8a31('0x8'));var client=jayson['client'][_0x8a31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e9905,_0x4f6ce8,_0x5b46fb){return new BPromise(function(_0x2cb37c,_0x24b501){return client[_0x8a31('0xa')](_0x2e9905,_0x5b46fb)[_0x8a31('0xb')](function(_0x180ebe){logger[_0x8a31('0xc')](_0x8a31('0xd'),_0x4f6ce8,_0x8a31('0xe'));logger[_0x8a31('0xf')](_0x8a31('0x10'),_0x4f6ce8,'request\x20sent',JSON['stringify'](_0x180ebe));if(_0x180ebe[_0x8a31('0x11')]){if(_0x180ebe[_0x8a31('0x11')][_0x8a31('0x12')]===0x1f4){logger[_0x8a31('0x11')](_0x8a31('0xd'),_0x4f6ce8,_0x180ebe[_0x8a31('0x11')][_0x8a31('0x13')]);return _0x24b501(_0x180ebe[_0x8a31('0x11')][_0x8a31('0x13')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f6ce8,_0x180ebe[_0x8a31('0x11')][_0x8a31('0x13')]);return _0x2cb37c(_0x180ebe[_0x8a31('0x11')]['message']);}else{logger['info'](_0x8a31('0xd'),_0x4f6ce8,_0x8a31('0xe'));_0x2cb37c(_0x180ebe['result'][_0x8a31('0x13')]);}})['catch'](function(_0x581745){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f6ce8,_0x581745);_0x24b501(_0x581745);});});}exports[_0x8a31('0x14')]=function(_0x14093c){var _0x1f7e31=this;return new Promise(function(_0x1d18b7,_0x25c1c6){return db[_0x8a31('0x15')]['findAll']({'raw':_0x14093c[_0x8a31('0x16')]?_0x14093c['options'][_0x8a31('0x17')]===undefined?!![]:![]:!![],'where':_0x14093c[_0x8a31('0x16')]?_0x14093c[_0x8a31('0x16')][_0x8a31('0x18')]||null:null,'attributes':_0x14093c['options']?_0x14093c[_0x8a31('0x16')][_0x8a31('0x19')]||null:null,'limit':_0x14093c[_0x8a31('0x16')]?_0x14093c[_0x8a31('0x16')][_0x8a31('0x1a')]||null:null,'include':_0x14093c[_0x8a31('0x16')]?_0x14093c[_0x8a31('0x16')]['include']?_[_0x8a31('0x1b')](_0x14093c['options'][_0x8a31('0x1c')],function(_0x5848f8){return{'model':db[_0x5848f8['model']],'as':_0x5848f8['as'],'attributes':_0x5848f8[_0x8a31('0x19')],'include':_0x5848f8['include']?_['map'](_0x5848f8[_0x8a31('0x1c')],function(_0x207681){return{'model':db[_0x207681[_0x8a31('0x1d')]],'as':_0x207681['as'],'attributes':_0x207681[_0x8a31('0x19')],'include':_0x207681[_0x8a31('0x1c')]?_[_0x8a31('0x1b')](_0x207681[_0x8a31('0x1c')],function(_0xfbc915){return{'model':db[_0xfbc915[_0x8a31('0x1d')]],'as':_0xfbc915['as'],'attributes':_0xfbc915['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a31('0xb')](function(_0x122256){logger[_0x8a31('0xc')](_0x8a31('0x14'),_0x14093c);logger[_0x8a31('0xf')](_0x8a31('0x14'),_0x14093c,JSON[_0x8a31('0x1e')](_0x122256));_0x1d18b7(_0x122256);})['catch'](function(_0x4cf22d){logger[_0x8a31('0x11')](_0x8a31('0x14'),_0x4cf22d[_0x8a31('0x13')],_0x14093c);_0x25c1c6(_0x1f7e31[_0x8a31('0x11')](0x1f4,_0x4cf22d['message']));});});};exports[_0x8a31('0x1f')]=function(_0x5ba92b){var _0x32d70b=this;return new Promise(function(_0x5431e0,_0x45d671){return db[_0x8a31('0x15')][_0x8a31('0x20')]({'raw':_0x5ba92b[_0x8a31('0x16')]?_0x5ba92b['options'][_0x8a31('0x17')]===undefined?!![]:![]:!![],'where':_0x5ba92b[_0x8a31('0x16')]?_0x5ba92b[_0x8a31('0x16')]['where']||null:null,'attributes':_0x5ba92b[_0x8a31('0x16')]?_0x5ba92b[_0x8a31('0x16')]['attributes']||null:null,'include':_0x5ba92b[_0x8a31('0x16')]?_0x5ba92b[_0x8a31('0x16')][_0x8a31('0x1c')]?_[_0x8a31('0x1b')](_0x5ba92b[_0x8a31('0x16')]['include'],function(_0x49c888){return{'model':db[_0x49c888[_0x8a31('0x1d')]],'as':_0x49c888['as'],'attributes':_0x49c888['attributes'],'include':_0x49c888[_0x8a31('0x1c')]?_[_0x8a31('0x1b')](_0x49c888[_0x8a31('0x1c')],function(_0x174e17){return{'model':db[_0x174e17['model']],'as':_0x174e17['as'],'attributes':_0x174e17[_0x8a31('0x19')],'include':_0x174e17['include']?_[_0x8a31('0x1b')](_0x174e17[_0x8a31('0x1c')],function(_0x571cd4){return{'model':db[_0x571cd4[_0x8a31('0x1d')]],'as':_0x571cd4['as'],'attributes':_0x571cd4[_0x8a31('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35be9f){logger['info'](_0x8a31('0x1f'),_0x5ba92b);logger[_0x8a31('0xf')](_0x8a31('0x1f'),_0x5ba92b,JSON[_0x8a31('0x1e')](_0x35be9f));_0x5431e0(_0x35be9f);})['catch'](function(_0x5efe81){logger[_0x8a31('0x11')](_0x8a31('0x1f'),_0x5efe81[_0x8a31('0x13')],_0x5ba92b);_0x45d671(_0x32d70b[_0x8a31('0x11')](0x1f4,_0x5efe81[_0x8a31('0x13')]));});});}; \ No newline at end of file +var _0xd6d7=['then','info','ShowZendeskAccount','find','raw','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','catch','GetZendeskAccount','options','attributes','limit','include','map','model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd6d7,0x70));var _0x7d6d=function(_0xc3d968,_0x1ef126){_0xc3d968=_0xc3d968-0x0;var _0x27c1f3=_0xd6d7[_0xc3d968];return _0x27c1f3;};'use strict';var _=require(_0x7d6d('0x0'));var util=require(_0x7d6d('0x1'));var moment=require(_0x7d6d('0x2'));var BPromise=require(_0x7d6d('0x3'));var rs=require(_0x7d6d('0x4'));var fs=require('fs');var Redis=require(_0x7d6d('0x5'));var db=require(_0x7d6d('0x6'))['db'];var utils=require(_0x7d6d('0x7'));var logger=require(_0x7d6d('0x8'))(_0x7d6d('0x9'));var config=require(_0x7d6d('0xa'));var jayson=require(_0x7d6d('0xb'));var client=jayson[_0x7d6d('0xc')][_0x7d6d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xda917e,_0x346afa,_0x4ef787){return new BPromise(function(_0x255d96,_0x5dee0e){return client[_0x7d6d('0xe')](_0xda917e,_0x4ef787)['then'](function(_0x55f9fe){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x346afa,_0x7d6d('0xf'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x346afa,_0x7d6d('0xf'),JSON[_0x7d6d('0x10')](_0x55f9fe));if(_0x55f9fe[_0x7d6d('0x11')]){if(_0x55f9fe[_0x7d6d('0x11')]['code']===0x1f4){logger[_0x7d6d('0x11')](_0x7d6d('0x12'),_0x346afa,_0x55f9fe[_0x7d6d('0x11')]['message']);return _0x5dee0e(_0x55f9fe[_0x7d6d('0x11')][_0x7d6d('0x13')]);}logger['error'](_0x7d6d('0x12'),_0x346afa,_0x55f9fe[_0x7d6d('0x11')][_0x7d6d('0x13')]);return _0x255d96(_0x55f9fe['error'][_0x7d6d('0x13')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x346afa,_0x7d6d('0xf'));_0x255d96(_0x55f9fe['result'][_0x7d6d('0x13')]);}})[_0x7d6d('0x14')](function(_0x2bb7e7){logger[_0x7d6d('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x346afa,_0x2bb7e7);_0x5dee0e(_0x2bb7e7);});});}exports[_0x7d6d('0x15')]=function(_0x14cf5a){var _0x5dcce5=this;return new Promise(function(_0x49c4c0,_0x14f13d){return db['ZendeskAccount']['findAll']({'raw':_0x14cf5a['options']?_0x14cf5a[_0x7d6d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x14cf5a[_0x7d6d('0x16')]?_0x14cf5a['options']['where']||null:null,'attributes':_0x14cf5a[_0x7d6d('0x16')]?_0x14cf5a['options'][_0x7d6d('0x17')]||null:null,'limit':_0x14cf5a[_0x7d6d('0x16')]?_0x14cf5a[_0x7d6d('0x16')][_0x7d6d('0x18')]||null:null,'include':_0x14cf5a[_0x7d6d('0x16')]?_0x14cf5a['options'][_0x7d6d('0x19')]?_[_0x7d6d('0x1a')](_0x14cf5a[_0x7d6d('0x16')][_0x7d6d('0x19')],function(_0x5c6bd3){return{'model':db[_0x5c6bd3[_0x7d6d('0x1b')]],'as':_0x5c6bd3['as'],'attributes':_0x5c6bd3[_0x7d6d('0x17')],'include':_0x5c6bd3[_0x7d6d('0x19')]?_[_0x7d6d('0x1a')](_0x5c6bd3[_0x7d6d('0x19')],function(_0x2885cc){return{'model':db[_0x2885cc[_0x7d6d('0x1b')]],'as':_0x2885cc['as'],'attributes':_0x2885cc[_0x7d6d('0x17')],'include':_0x2885cc[_0x7d6d('0x19')]?_[_0x7d6d('0x1a')](_0x2885cc[_0x7d6d('0x19')],function(_0x3fbccd){return{'model':db[_0x3fbccd[_0x7d6d('0x1b')]],'as':_0x3fbccd['as'],'attributes':_0x3fbccd[_0x7d6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7d6d('0x1c')](function(_0xe2afdb){logger[_0x7d6d('0x1d')](_0x7d6d('0x15'),_0x14cf5a);logger['debug'](_0x7d6d('0x15'),_0x14cf5a,JSON[_0x7d6d('0x10')](_0xe2afdb));_0x49c4c0(_0xe2afdb);})[_0x7d6d('0x14')](function(_0x5bd672){logger[_0x7d6d('0x11')](_0x7d6d('0x15'),_0x5bd672[_0x7d6d('0x13')],_0x14cf5a);_0x14f13d(_0x5dcce5['error'](0x1f4,_0x5bd672[_0x7d6d('0x13')]));});});};exports[_0x7d6d('0x1e')]=function(_0x43d733){var _0x2925e9=this;return new Promise(function(_0x27aaf2,_0x4ea857){return db['ZendeskAccount'][_0x7d6d('0x1f')]({'raw':_0x43d733['options']?_0x43d733[_0x7d6d('0x16')][_0x7d6d('0x20')]===undefined?!![]:![]:!![],'where':_0x43d733['options']?_0x43d733[_0x7d6d('0x16')][_0x7d6d('0x21')]||null:null,'attributes':_0x43d733['options']?_0x43d733['options']['attributes']||null:null,'include':_0x43d733['options']?_0x43d733[_0x7d6d('0x16')][_0x7d6d('0x19')]?_[_0x7d6d('0x1a')](_0x43d733[_0x7d6d('0x16')][_0x7d6d('0x19')],function(_0x40cf4a){return{'model':db[_0x40cf4a[_0x7d6d('0x1b')]],'as':_0x40cf4a['as'],'attributes':_0x40cf4a[_0x7d6d('0x17')],'include':_0x40cf4a[_0x7d6d('0x19')]?_[_0x7d6d('0x1a')](_0x40cf4a['include'],function(_0x77ff28){return{'model':db[_0x77ff28[_0x7d6d('0x1b')]],'as':_0x77ff28['as'],'attributes':_0x77ff28[_0x7d6d('0x17')],'include':_0x77ff28['include']?_[_0x7d6d('0x1a')](_0x77ff28[_0x7d6d('0x19')],function(_0xc2b040){return{'model':db[_0xc2b040[_0x7d6d('0x1b')]],'as':_0xc2b040['as'],'attributes':_0xc2b040[_0x7d6d('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ccf0a){logger['info'](_0x7d6d('0x1e'),_0x43d733);logger[_0x7d6d('0x22')](_0x7d6d('0x1e'),_0x43d733,JSON[_0x7d6d('0x10')](_0x1ccf0a));_0x27aaf2(_0x1ccf0a);})[_0x7d6d('0x14')](function(_0x490ea6){logger[_0x7d6d('0x11')]('ShowZendeskAccount',_0x490ea6[_0x7d6d('0x13')],_0x43d733);_0x4ea857(_0x2925e9['error'](0x1f4,_0x490ea6[_0x7d6d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 90377f6..ff7f1d1 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 _0x46d6=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','create','put','update','delete'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x46d6,0x15b));var _0x646d=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x46d6[_0xcda377];return _0x1c024f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x646d('0x0'));var timeout=require(_0x646d('0x1'));var express=require(_0x646d('0x2'));var router=express[_0x646d('0x3')]();var auth=require(_0x646d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x646d('0x5'));var controller=require(_0x646d('0x6'));router[_0x646d('0x7')]('/',auth[_0x646d('0x8')](),controller[_0x646d('0x9')]);router[_0x646d('0x7')]('/:id',auth[_0x646d('0x8')](),controller[_0x646d('0xa')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x646d('0xb')]);router['get'](_0x646d('0xc'),auth[_0x646d('0x8')](),controller[_0x646d('0xd')]);router[_0x646d('0x7')](_0x646d('0xe'),auth[_0x646d('0x8')](),controller['getDescriptions']);router[_0x646d('0x7')](_0x646d('0xf'),auth[_0x646d('0x8')](),controller['getTags']);router[_0x646d('0x10')]('/',auth[_0x646d('0x8')](),controller[_0x646d('0x11')]);router['post'](_0x646d('0xf'),auth['isAuthenticated'](),controller['setTags']);router[_0x646d('0x12')]('/:id',auth[_0x646d('0x8')](),controller[_0x646d('0x13')]);router[_0x646d('0x14')]('/:id',auth[_0x646d('0x8')](),controller[_0x646d('0x15')]);module[_0x646d('0x16')]=router; \ No newline at end of file +var _0xb2c9=['getDescriptions','create','post','/:id/tags','setTags','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0xb2c9,0xb9));var _0x9b2c=function(_0x3a2797,_0x1f905c){_0x3a2797=_0x3a2797-0x0;var _0x5c2d96=_0xb2c9[_0x3a2797];return _0x5c2d96;};'use strict';var multer=require('multer');var util=require(_0x9b2c('0x0'));var path=require('path');var timeout=require(_0x9b2c('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x9b2c('0x2'));var interaction=require(_0x9b2c('0x3'));var config=require(_0x9b2c('0x4'));var controller=require(_0x9b2c('0x5'));router[_0x9b2c('0x6')]('/',auth['isAuthenticated'](),controller[_0x9b2c('0x7')]);router['get'](_0x9b2c('0x8'),auth['isAuthenticated'](),controller[_0x9b2c('0x9')]);router[_0x9b2c('0x6')]('/:id/fields',auth[_0x9b2c('0xa')](),controller[_0x9b2c('0xb')]);router[_0x9b2c('0x6')](_0x9b2c('0xc'),auth['isAuthenticated'](),controller[_0x9b2c('0xd')]);router[_0x9b2c('0x6')](_0x9b2c('0xe'),auth[_0x9b2c('0xa')](),controller[_0x9b2c('0xf')]);router[_0x9b2c('0x6')]('/:id/tags',auth[_0x9b2c('0xa')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x9b2c('0x10')]);router[_0x9b2c('0x11')](_0x9b2c('0x12'),auth[_0x9b2c('0xa')](),controller[_0x9b2c('0x13')]);router[_0x9b2c('0x14')](_0x9b2c('0x8'),auth['isAuthenticated'](),controller[_0x9b2c('0x15')]);router[_0x9b2c('0x16')]('/:id',auth[_0x9b2c('0xa')](),controller[_0x9b2c('0x17')]);module[_0x9b2c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e5cc43a..a688135 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 _0xb8f8=['STRING','exports'];(function(_0x2d7f79,_0x1e8b1e){var _0x2d1388=function(_0x484f62){while(--_0x484f62){_0x2d7f79['push'](_0x2d7f79['shift']());}};_0x2d1388(++_0x1e8b1e);}(_0xb8f8,0x1d7));var _0x8b8f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb8f8[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x8b8f('0x0')]={'name':{'type':Sequelize[_0x8b8f('0x1')]},'description':{'type':Sequelize[_0x8b8f('0x1')]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c6a209d..b84e2c7 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 _0x7232=['error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','end','stack','name','index','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','where','merge','map','key','VIRTUAL','field','filter','options','ZendeskConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','order','ZendeskField','getSubjects','getDescriptions','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x7232,0x98));var _0x2723=function(_0x3e691b,_0x2a7b7c){_0x3e691b=_0x3e691b-0x0;var _0x137aab=_0x7232[_0x3e691b];return _0x137aab;};'use strict';var pdf=require(_0x2723('0x0'));var emlformat=require(_0x2723('0x1'));var rimraf=require(_0x2723('0x2'));var zipdir=require(_0x2723('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2723('0x4'));var BPromise=require(_0x2723('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2723('0x6'));var sox=require(_0x2723('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2723('0x8'));var squel=require('squel');var crypto=require(_0x2723('0x9'));var jsforce=require(_0x2723('0xa'));var deskjs=require(_0x2723('0xb'));var toCsv=require(_0x2723('0xc'));var querystring=require(_0x2723('0xd'));var Papa=require(_0x2723('0xe'));var Redis=require('ioredis');var authService=require(_0x2723('0xf'));var qs=require(_0x2723('0x10'));var hardwareService=require(_0x2723('0x11'));var logger=require(_0x2723('0x12'))(_0x2723('0x13'));var utils=require(_0x2723('0x14'));var config=require(_0x2723('0x15'));var db=require(_0x2723('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2723('0x17')][_0x2723('0x18')]({'port':0x232a});function checkPasswordPattern(_0x18bf21,_0x31a505,_0x4b8387){if(_0x4b8387){var _0x585308=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x585308['test'](_0x31a505)){return _0x18bf21;}else{throw new Error(_0x2723('0x19'));}}else{return _0x18bf21;}}function respondWithRpcPromise(_0x16b9a8,_0x342f8e,_0xd5766a,_0x27f672){return new BPromise(function(_0x5e0aa8,_0x274b0a){var _0x4b58ee=_0x27f672||client;return _0x4b58ee['request'](_0x16b9a8,_0xd5766a)['then'](function(_0x1c265d){logger[_0x2723('0x1a')](_0x2723('0x1b'),_0x342f8e,_0x2723('0x1c'));logger[_0x2723('0x1d')](_0x2723('0x1e'),_0x342f8e,_0x2723('0x1c'),JSON[_0x2723('0x1f')](_0x1c265d));if(_0x1c265d[_0x2723('0x20')]){if(_0x1c265d['error'][_0x2723('0x21')]===0x1f4){logger['error'](_0x2723('0x1b'),_0x342f8e,_0x1c265d[_0x2723('0x20')]['message']);return _0x274b0a(_0x1c265d['error'][_0x2723('0x22')]);}logger[_0x2723('0x20')](_0x2723('0x1b'),_0x342f8e,_0x1c265d[_0x2723('0x20')][_0x2723('0x22')]);return _0x5e0aa8(_0x1c265d[_0x2723('0x20')][_0x2723('0x22')]);}else{logger['info'](_0x2723('0x1b'),_0x342f8e,_0x2723('0x1c'));_0x5e0aa8(_0x1c265d[_0x2723('0x23')][_0x2723('0x22')]);}})[_0x2723('0x24')](function(_0x5431fa){logger[_0x2723('0x20')]('ZendeskConfiguration,\x20%s,\x20%s',_0x342f8e,_0x5431fa);_0x274b0a(_0x5431fa);});});}function respondWithStatusCode(_0x17d22d,_0x21b24a){_0x21b24a=_0x21b24a||0xcc;return function(_0x37acbc){if(_0x37acbc){return _0x17d22d[_0x2723('0x25')](_0x21b24a);}return _0x17d22d[_0x2723('0x26')](_0x21b24a)['end']();};}function respondWithResult(_0x1202b8,_0x261ddd){_0x261ddd=_0x261ddd||0xc8;return function(_0x39ffe0){if(_0x39ffe0){return _0x1202b8[_0x2723('0x26')](_0x261ddd)[_0x2723('0x27')](_0x39ffe0);}};}function respondWithFilteredResult(_0x2a6b23,_0x44b3f6){return function(_0x301a44){if(_0x301a44){var _0x23cc50=_0x301a44[_0x2723('0x28')],_0xca5ea7=_0x44b3f6['offset'],_0x277246=_0x44b3f6[_0x2723('0x29')]+_0x44b3f6[_0x2723('0x2a')],_0x428502;if(_0x277246>=_0x23cc50){_0x277246=_0x23cc50;_0x428502=0xc8;}else{_0x428502=0xce;}_0x2a6b23[_0x2723('0x26')](_0x428502);return _0x2a6b23['set'](_0x2723('0x2b'),_0xca5ea7+'-'+_0x277246+'/'+_0x23cc50)['json'](_0x301a44);}return null;};}function patchUpdates(_0x45395b){return function(_0x250b46){try{jsonpatch['apply'](_0x250b46,_0x45395b,!![]);}catch(_0x98045f){return BPromise[_0x2723('0x2c')](_0x98045f);}return _0x250b46[_0x2723('0x2d')]();};}function saveUpdates(_0x39d2a4,_0x3df16e){return function(_0x1f9ae5){if(_0x1f9ae5){return _0x1f9ae5[_0x2723('0x2e')](_0x39d2a4)[_0x2723('0x2f')](function(_0x38f580){return _0x38f580;});}return null;};}function removeEntity(_0x36c994,_0x4bf975){return function(_0xdc11ea){if(_0xdc11ea){return _0xdc11ea[_0x2723('0x30')]()[_0x2723('0x2f')](function(){_0x36c994[_0x2723('0x26')](0xcc)[_0x2723('0x31')]();});}};}function handleEntityNotFound(_0xa7bf52,_0x555157){return function(_0x25c752){if(!_0x25c752){_0xa7bf52[_0x2723('0x25')](0x194);}return _0x25c752;};}function handleError(_0x255881,_0x943672){_0x943672=_0x943672||0x1f4;return function(_0x5bdeff){logger['error'](_0x5bdeff[_0x2723('0x32')]);if(_0x5bdeff[_0x2723('0x33')]){delete _0x5bdeff[_0x2723('0x33')];}_0x255881[_0x2723('0x26')](_0x943672)['send'](_0x5bdeff);};}exports[_0x2723('0x34')]=function(_0x5c9f9f,_0x103c60){var _0x28bb84={},_0x5acd02={},_0x52244d={'count':0x0,'rows':[]};var _0x3487fb=db['ZendeskConfiguration'][_0x2723('0x35')];_0x5acd02[_0x2723('0x36')]=_['keys'](_0x3487fb);_0x5acd02[_0x2723('0x37')]=_[_0x2723('0x38')](_0x5c9f9f[_0x2723('0x37')]);_0x5acd02['filters']=_[_0x2723('0x39')](_0x5acd02['model'],_0x5acd02[_0x2723('0x37')]);_0x28bb84['attributes']=_[_0x2723('0x39')](_0x5acd02[_0x2723('0x36')],qs[_0x2723('0x3a')](_0x5c9f9f[_0x2723('0x37')][_0x2723('0x3a')]));_0x28bb84[_0x2723('0x3b')]=_0x28bb84['attributes'][_0x2723('0x3c')]?_0x28bb84['attributes']:_0x5acd02[_0x2723('0x36')];if(!_0x5c9f9f[_0x2723('0x37')][_0x2723('0x3d')](_0x2723('0x3e'))){_0x28bb84[_0x2723('0x2a')]=qs[_0x2723('0x2a')](_0x5c9f9f[_0x2723('0x37')]['limit']);_0x28bb84[_0x2723('0x29')]=qs[_0x2723('0x29')](_0x5c9f9f[_0x2723('0x37')][_0x2723('0x29')]);}_0x28bb84['order']=qs['sort'](_0x5c9f9f[_0x2723('0x37')][_0x2723('0x3f')]);_0x28bb84['where']=qs['filters'](_[_0x2723('0x40')](_0x5c9f9f[_0x2723('0x37')],_0x5acd02[_0x2723('0x41')]));if(_0x5c9f9f['query']['filter']){_0x28bb84[_0x2723('0x42')]=_[_0x2723('0x43')](_0x28bb84[_0x2723('0x42')],{'$or':_[_0x2723('0x44')](_0x3487fb,function(_0x255c65){if(_0x255c65['type'][_0x2723('0x45')]!==_0x2723('0x46')){var _0x45ffaf={};_0x45ffaf[_0x255c65[_0x2723('0x47')]]={'$like':'%'+_0x5c9f9f[_0x2723('0x37')][_0x2723('0x48')]+'%'};return _0x45ffaf;}})});}_0x28bb84=_['merge']({},_0x28bb84,_0x5c9f9f[_0x2723('0x49')]);var _0x1163d2={'where':_0x28bb84['where']};return db[_0x2723('0x4a')][_0x2723('0x28')](_0x1163d2)[_0x2723('0x2f')](function(_0xcdf5ec){_0x52244d['count']=_0xcdf5ec;if(_0x5c9f9f[_0x2723('0x37')][_0x2723('0x4b')]){_0x28bb84[_0x2723('0x4c')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x2723('0x4d')](_0x28bb84);})[_0x2723('0x2f')](function(_0x3441da){_0x52244d[_0x2723('0x4e')]=_0x3441da;return _0x52244d;})[_0x2723('0x2f')](respondWithFilteredResult(_0x103c60,_0x28bb84))['catch'](handleError(_0x103c60,null));};exports[_0x2723('0x4f')]=function(_0x32f441,_0x38b197){var _0x386a29={'raw':![],'where':{'id':_0x32f441[_0x2723('0x50')]['id']}},_0x8962b8={};_0x8962b8[_0x2723('0x36')]=_[_0x2723('0x38')](db[_0x2723('0x4a')][_0x2723('0x35')]);_0x8962b8[_0x2723('0x37')]=_[_0x2723('0x38')](_0x32f441['query']);_0x8962b8[_0x2723('0x41')]=_[_0x2723('0x39')](_0x8962b8[_0x2723('0x36')],_0x8962b8['query']);_0x386a29['attributes']=_[_0x2723('0x39')](_0x8962b8[_0x2723('0x36')],qs[_0x2723('0x3a')](_0x32f441[_0x2723('0x37')][_0x2723('0x3a')]));_0x386a29[_0x2723('0x3b')]=_0x386a29[_0x2723('0x3b')][_0x2723('0x3c')]?_0x386a29['attributes']:_0x8962b8[_0x2723('0x36')];if(_0x32f441[_0x2723('0x37')][_0x2723('0x4b')]){_0x386a29[_0x2723('0x4c')]=[{'all':!![]}];}_0x386a29=_[_0x2723('0x43')]({},_0x386a29,_0x32f441[_0x2723('0x49')]);return db[_0x2723('0x4a')][_0x2723('0x51')](_0x386a29)['then'](handleEntityNotFound(_0x38b197,null))[_0x2723('0x2f')](respondWithResult(_0x38b197,null))['catch'](handleError(_0x38b197,null));};exports[_0x2723('0x52')]=function(_0x423aa4,_0x12c81c){return db[_0x2723('0x4a')][_0x2723('0x52')](_0x423aa4[_0x2723('0x53')],{})[_0x2723('0x2f')](respondWithResult(_0x12c81c,0xc9))[_0x2723('0x24')](handleError(_0x12c81c,null));};exports['update']=function(_0x1e4b45,_0xbdb804){if(_0x1e4b45[_0x2723('0x53')]['id']){delete _0x1e4b45[_0x2723('0x53')]['id'];}return db[_0x2723('0x4a')][_0x2723('0x51')]({'where':{'id':_0x1e4b45[_0x2723('0x50')]['id']}})['then'](handleEntityNotFound(_0xbdb804,null))[_0x2723('0x2f')](saveUpdates(_0x1e4b45[_0x2723('0x53')],null))[_0x2723('0x2f')](respondWithResult(_0xbdb804,null))['catch'](handleError(_0xbdb804,null));};exports['destroy']=function(_0x55c284,_0x8ecb9d){return db[_0x2723('0x4a')][_0x2723('0x51')]({'where':{'id':_0x55c284['params']['id']}})['then'](handleEntityNotFound(_0x8ecb9d,null))[_0x2723('0x2f')](removeEntity(_0x8ecb9d,null))[_0x2723('0x24')](handleError(_0x8ecb9d,null));};exports[_0x2723('0x54')]=function(_0x5a0cbd,_0x585b05,_0x5b237f){var _0xe34b8={};var _0x3e0496={};var _0x196b9a;var _0xec595f;return db[_0x2723('0x4a')][_0x2723('0x55')]({'where':{'id':_0x5a0cbd['params']['id']}})[_0x2723('0x2f')](handleEntityNotFound(_0x585b05,null))['then'](function(_0x515081){if(_0x515081){_0x196b9a=_0x515081;_0x3e0496['model']=_[_0x2723('0x38')](db['ZendeskField']['rawAttributes']);_0x3e0496['query']=_[_0x2723('0x38')](_0x5a0cbd[_0x2723('0x37')]);_0x3e0496['filters']=_['intersection'](_0x3e0496[_0x2723('0x36')],_0x3e0496[_0x2723('0x37')]);_0xe34b8[_0x2723('0x3b')]=_[_0x2723('0x39')](_0x3e0496[_0x2723('0x36')],qs[_0x2723('0x3a')](_0x5a0cbd[_0x2723('0x37')][_0x2723('0x3a')]));_0xe34b8['attributes']=_0xe34b8[_0x2723('0x3b')][_0x2723('0x3c')]?_0xe34b8['attributes']:_0x3e0496[_0x2723('0x36')];_0xe34b8[_0x2723('0x56')]=qs[_0x2723('0x3f')](_0x5a0cbd[_0x2723('0x37')][_0x2723('0x3f')]);_0xe34b8[_0x2723('0x42')]=qs[_0x2723('0x41')](_[_0x2723('0x40')](_0x5a0cbd['query'],_0x3e0496[_0x2723('0x41')]));if(_0x5a0cbd[_0x2723('0x37')]['filter']){_0xe34b8['where']=_[_0x2723('0x43')](_0xe34b8[_0x2723('0x42')],{'$or':_[_0x2723('0x44')](_0xe34b8[_0x2723('0x3b')],function(_0x3d17f6){var _0x4d428b={};_0x4d428b[_0x3d17f6]={'$like':'%'+_0x5a0cbd[_0x2723('0x37')][_0x2723('0x48')]+'%'};return _0x4d428b;})});}_0xe34b8=_[_0x2723('0x43')]({},_0xe34b8,_0x5a0cbd['options']);return _0x196b9a[_0x2723('0x54')](_0xe34b8);}})[_0x2723('0x2f')](function(_0x44af1e){if(_0x44af1e){_0xec595f=_0x44af1e[_0x2723('0x3c')];if(!_0x5a0cbd[_0x2723('0x37')][_0x2723('0x3d')](_0x2723('0x3e'))){_0xe34b8[_0x2723('0x2a')]=qs[_0x2723('0x2a')](_0x5a0cbd[_0x2723('0x37')][_0x2723('0x2a')]);_0xe34b8[_0x2723('0x29')]=qs[_0x2723('0x29')](_0x5a0cbd['query'][_0x2723('0x29')]);}return _0x196b9a[_0x2723('0x54')](_0xe34b8);}})[_0x2723('0x2f')](function(_0x13d820){if(_0x13d820){return _0x13d820?{'count':_0xec595f,'rows':_0x13d820}:null;}})[_0x2723('0x2f')](respondWithResult(_0x585b05,null))['catch'](handleError(_0x585b05,null));};exports['getSubjects']=function(_0x458df2,_0x20c2f8,_0x104f9c){var _0x4150e3={};var _0x3382d2={};var _0x5cb90f;var _0x4296e0;return db['ZendeskConfiguration'][_0x2723('0x55')]({'where':{'id':_0x458df2[_0x2723('0x50')]['id']}})[_0x2723('0x2f')](handleEntityNotFound(_0x20c2f8,null))[_0x2723('0x2f')](function(_0xf75607){if(_0xf75607){_0x5cb90f=_0xf75607;_0x3382d2[_0x2723('0x36')]=_[_0x2723('0x38')](db[_0x2723('0x57')][_0x2723('0x35')]);_0x3382d2['query']=_[_0x2723('0x38')](_0x458df2['query']);_0x3382d2[_0x2723('0x41')]=_[_0x2723('0x39')](_0x3382d2[_0x2723('0x36')],_0x3382d2[_0x2723('0x37')]);_0x4150e3[_0x2723('0x3b')]=_[_0x2723('0x39')](_0x3382d2['model'],qs[_0x2723('0x3a')](_0x458df2['query'][_0x2723('0x3a')]));_0x4150e3['attributes']=_0x4150e3['attributes'][_0x2723('0x3c')]?_0x4150e3[_0x2723('0x3b')]:_0x3382d2[_0x2723('0x36')];_0x4150e3['order']=qs[_0x2723('0x3f')](_0x458df2[_0x2723('0x37')]['sort']);_0x4150e3['where']=qs['filters'](_[_0x2723('0x40')](_0x458df2[_0x2723('0x37')],_0x3382d2[_0x2723('0x41')]));if(_0x458df2[_0x2723('0x37')][_0x2723('0x48')]){_0x4150e3['where']=_[_0x2723('0x43')](_0x4150e3[_0x2723('0x42')],{'$or':_[_0x2723('0x44')](_0x4150e3[_0x2723('0x3b')],function(_0x288a10){var _0x1e084c={};_0x1e084c[_0x288a10]={'$like':'%'+_0x458df2['query']['filter']+'%'};return _0x1e084c;})});}_0x4150e3=_[_0x2723('0x43')]({},_0x4150e3,_0x458df2[_0x2723('0x49')]);return _0x5cb90f[_0x2723('0x58')](_0x4150e3);}})[_0x2723('0x2f')](function(_0x27f29c){if(_0x27f29c){_0x4296e0=_0x27f29c[_0x2723('0x3c')];if(!_0x458df2['query'][_0x2723('0x3d')](_0x2723('0x3e'))){_0x4150e3['limit']=qs['limit'](_0x458df2[_0x2723('0x37')]['limit']);_0x4150e3[_0x2723('0x29')]=qs[_0x2723('0x29')](_0x458df2[_0x2723('0x37')][_0x2723('0x29')]);}return _0x5cb90f[_0x2723('0x58')](_0x4150e3);}})[_0x2723('0x2f')](function(_0x4088bf){if(_0x4088bf){return _0x4088bf?{'count':_0x4296e0,'rows':_0x4088bf}:null;}})[_0x2723('0x2f')](respondWithResult(_0x20c2f8,null))[_0x2723('0x24')](handleError(_0x20c2f8,null));};exports['getDescriptions']=function(_0x1ba5fa,_0x327391,_0x4365ec){var _0x3bb5f6={};var _0x5ca930={};var _0x693440;var _0x5ca2e6;return db[_0x2723('0x4a')][_0x2723('0x55')]({'where':{'id':_0x1ba5fa['params']['id']}})[_0x2723('0x2f')](handleEntityNotFound(_0x327391,null))[_0x2723('0x2f')](function(_0x23837e){if(_0x23837e){_0x693440=_0x23837e;_0x5ca930[_0x2723('0x36')]=_[_0x2723('0x38')](db[_0x2723('0x57')][_0x2723('0x35')]);_0x5ca930[_0x2723('0x37')]=_[_0x2723('0x38')](_0x1ba5fa[_0x2723('0x37')]);_0x5ca930[_0x2723('0x41')]=_[_0x2723('0x39')](_0x5ca930['model'],_0x5ca930[_0x2723('0x37')]);_0x3bb5f6[_0x2723('0x3b')]=_[_0x2723('0x39')](_0x5ca930['model'],qs[_0x2723('0x3a')](_0x1ba5fa[_0x2723('0x37')][_0x2723('0x3a')]));_0x3bb5f6['attributes']=_0x3bb5f6['attributes']['length']?_0x3bb5f6[_0x2723('0x3b')]:_0x5ca930[_0x2723('0x36')];_0x3bb5f6['order']=qs[_0x2723('0x3f')](_0x1ba5fa['query'][_0x2723('0x3f')]);_0x3bb5f6[_0x2723('0x42')]=qs[_0x2723('0x41')](_['pick'](_0x1ba5fa[_0x2723('0x37')],_0x5ca930['filters']));if(_0x1ba5fa[_0x2723('0x37')][_0x2723('0x48')]){_0x3bb5f6[_0x2723('0x42')]=_[_0x2723('0x43')](_0x3bb5f6[_0x2723('0x42')],{'$or':_['map'](_0x3bb5f6['attributes'],function(_0x46f4da){var _0x1416b3={};_0x1416b3[_0x46f4da]={'$like':'%'+_0x1ba5fa[_0x2723('0x37')][_0x2723('0x48')]+'%'};return _0x1416b3;})});}_0x3bb5f6=_[_0x2723('0x43')]({},_0x3bb5f6,_0x1ba5fa[_0x2723('0x49')]);return _0x693440[_0x2723('0x59')](_0x3bb5f6);}})[_0x2723('0x2f')](function(_0x1bc28e){if(_0x1bc28e){_0x5ca2e6=_0x1bc28e[_0x2723('0x3c')];if(!_0x1ba5fa[_0x2723('0x37')]['hasOwnProperty'](_0x2723('0x3e'))){_0x3bb5f6[_0x2723('0x2a')]=qs[_0x2723('0x2a')](_0x1ba5fa['query'][_0x2723('0x2a')]);_0x3bb5f6[_0x2723('0x29')]=qs[_0x2723('0x29')](_0x1ba5fa[_0x2723('0x37')]['offset']);}return _0x693440[_0x2723('0x59')](_0x3bb5f6);}})[_0x2723('0x2f')](function(_0x36aa77){if(_0x36aa77){return _0x36aa77?{'count':_0x5ca2e6,'rows':_0x36aa77}:null;}})[_0x2723('0x2f')](respondWithResult(_0x327391,null))[_0x2723('0x24')](handleError(_0x327391,null));};exports['getTags']=function(_0x115e66,_0x1afa3b,_0x34341c){var _0x2d736b={};var _0x58447a={};var _0x56ff01;var _0x51f315;return db[_0x2723('0x4a')]['findOne']({'where':{'id':_0x115e66[_0x2723('0x50')]['id']}})[_0x2723('0x2f')](handleEntityNotFound(_0x1afa3b,null))[_0x2723('0x2f')](function(_0x1ec0b3){if(_0x1ec0b3){_0x56ff01=_0x1ec0b3;_0x58447a[_0x2723('0x36')]=_[_0x2723('0x38')](db['Tag'][_0x2723('0x35')]);_0x58447a[_0x2723('0x37')]=_[_0x2723('0x38')](_0x115e66[_0x2723('0x37')]);_0x58447a[_0x2723('0x41')]=_[_0x2723('0x39')](_0x58447a[_0x2723('0x36')],_0x58447a['query']);_0x2d736b[_0x2723('0x3b')]=_[_0x2723('0x39')](_0x58447a[_0x2723('0x36')],qs[_0x2723('0x3a')](_0x115e66[_0x2723('0x37')]['fields']));_0x2d736b['attributes']=_0x2d736b[_0x2723('0x3b')][_0x2723('0x3c')]?_0x2d736b[_0x2723('0x3b')]:_0x58447a['model'];_0x2d736b[_0x2723('0x56')]=qs['sort'](_0x115e66[_0x2723('0x37')][_0x2723('0x3f')]);_0x2d736b['where']=qs[_0x2723('0x41')](_['pick'](_0x115e66[_0x2723('0x37')],_0x58447a[_0x2723('0x41')]));if(_0x115e66[_0x2723('0x37')][_0x2723('0x48')]){_0x2d736b[_0x2723('0x42')]=_[_0x2723('0x43')](_0x2d736b[_0x2723('0x42')],{'$or':_[_0x2723('0x44')](_0x2d736b['attributes'],function(_0x1c96f1){var _0x5e45ff={};_0x5e45ff[_0x1c96f1]={'$like':'%'+_0x115e66[_0x2723('0x37')][_0x2723('0x48')]+'%'};return _0x5e45ff;})});}_0x2d736b=_['merge']({},_0x2d736b,_0x115e66[_0x2723('0x49')]);return _0x56ff01[_0x2723('0x5a')](_0x2d736b);}})[_0x2723('0x2f')](function(_0x16352d){if(_0x16352d){_0x51f315=_0x16352d[_0x2723('0x3c')];if(!_0x115e66['query'][_0x2723('0x3d')](_0x2723('0x3e'))){_0x2d736b[_0x2723('0x2a')]=qs[_0x2723('0x2a')](_0x115e66['query']['limit']);_0x2d736b['offset']=qs['offset'](_0x115e66[_0x2723('0x37')][_0x2723('0x29')]);}return _0x56ff01[_0x2723('0x5a')](_0x2d736b);}})['then'](function(_0x1a4226){if(_0x1a4226){return _0x1a4226?{'count':_0x51f315,'rows':_0x1a4226}:null;}})[_0x2723('0x2f')](respondWithResult(_0x1afa3b,null))['catch'](handleError(_0x1afa3b,null));};exports[_0x2723('0x5b')]=function(_0x559d78,_0x55151e,_0x14b182){if(_0x559d78[_0x2723('0x53')]['id']){delete _0x559d78[_0x2723('0x53')]['id'];}return db[_0x2723('0x4a')][_0x2723('0x55')]({'where':{'id':_0x559d78[_0x2723('0x50')]['id']}})[_0x2723('0x2f')](handleEntityNotFound(_0x55151e,null))[_0x2723('0x2f')](function(_0x287ae4){if(_0x287ae4){return _0x287ae4[_0x2723('0x5b')](_0x559d78['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x55151e,null))[_0x2723('0x24')](handleError(_0x55151e,null));}; \ No newline at end of file +var _0x1f52=['create','body','params','getFields','findOne','ZendeskField','length','map','getSubjects','getDescriptions','setTags','ids','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','then','info','request\x20sent','debug','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','save','update','destroy','stack','send','index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','count','includeAll','include','findAll','options','find'];(function(_0x203ca9,_0x4e1728){var _0x22e206=function(_0x28b125){while(--_0x28b125){_0x203ca9['push'](_0x203ca9['shift']());}};_0x22e206(++_0x4e1728);}(_0x1f52,0xba));var _0x21f5=function(_0x4f9db0,_0x2da2b1){_0x4f9db0=_0x4f9db0-0x0;var _0x10b83e=_0x1f52[_0x4f9db0];return _0x10b83e;};'use strict';var pdf=require(_0x21f5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21f5('0x1'));var jsonpatch=require(_0x21f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21f5('0x3'));var Mustache=require(_0x21f5('0x4'));var util=require(_0x21f5('0x5'));var path=require(_0x21f5('0x6'));var sox=require(_0x21f5('0x7'));var csv=require(_0x21f5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x21f5('0x9'));var squel=require('squel');var crypto=require(_0x21f5('0xa'));var jsforce=require(_0x21f5('0xb'));var deskjs=require(_0x21f5('0xc'));var toCsv=require(_0x21f5('0x8'));var querystring=require(_0x21f5('0xd'));var Papa=require(_0x21f5('0xe'));var Redis=require(_0x21f5('0xf'));var authService=require(_0x21f5('0x10'));var qs=require(_0x21f5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21f5('0x12'))(_0x21f5('0x13'));var utils=require(_0x21f5('0x14'));var config=require(_0x21f5('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x21f5('0x16'));var client=jayson[_0x21f5('0x17')][_0x21f5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x23f334,_0x537d53,_0x319eb1){if(_0x319eb1){var _0x4b6a45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b6a45[_0x21f5('0x19')](_0x537d53)){return _0x23f334;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23f334;}}function respondWithRpcPromise(_0x38e5ef,_0x4cfc44,_0x233bc9,_0x38b895){return new BPromise(function(_0x961dd0,_0x4c259d){var _0x4b3116=_0x38b895||client;return _0x4b3116['request'](_0x38e5ef,_0x233bc9)[_0x21f5('0x1a')](function(_0x1f45b0){logger[_0x21f5('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4cfc44,_0x21f5('0x1c'));logger[_0x21f5('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4cfc44,_0x21f5('0x1c'),JSON['stringify'](_0x1f45b0));if(_0x1f45b0[_0x21f5('0x1e')]){if(_0x1f45b0[_0x21f5('0x1e')][_0x21f5('0x1f')]===0x1f4){logger[_0x21f5('0x1e')](_0x21f5('0x20'),_0x4cfc44,_0x1f45b0[_0x21f5('0x1e')][_0x21f5('0x21')]);return _0x4c259d(_0x1f45b0['error']['message']);}logger[_0x21f5('0x1e')](_0x21f5('0x20'),_0x4cfc44,_0x1f45b0[_0x21f5('0x1e')][_0x21f5('0x21')]);return _0x961dd0(_0x1f45b0['error'][_0x21f5('0x21')]);}else{logger[_0x21f5('0x1b')](_0x21f5('0x20'),_0x4cfc44,_0x21f5('0x1c'));_0x961dd0(_0x1f45b0[_0x21f5('0x22')][_0x21f5('0x21')]);}})[_0x21f5('0x23')](function(_0xdbc66c){logger[_0x21f5('0x1e')](_0x21f5('0x20'),_0x4cfc44,_0xdbc66c);_0x4c259d(_0xdbc66c);});});}function respondWithStatusCode(_0x4cede4,_0x51060a){_0x51060a=_0x51060a||0xcc;return function(_0x3f80ce){if(_0x3f80ce){return _0x4cede4[_0x21f5('0x24')](_0x51060a);}return _0x4cede4[_0x21f5('0x25')](_0x51060a)[_0x21f5('0x26')]();};}function respondWithResult(_0x14a8d,_0x3b767c){_0x3b767c=_0x3b767c||0xc8;return function(_0x62a12a){if(_0x62a12a){return _0x14a8d[_0x21f5('0x25')](_0x3b767c)[_0x21f5('0x27')](_0x62a12a);}};}function respondWithFilteredResult(_0x383189,_0x4b0364){return function(_0x437f77){if(_0x437f77){var _0x1a3c91=_0x437f77['count'],_0x8c1a12=_0x4b0364[_0x21f5('0x28')],_0x5c06ad=_0x4b0364[_0x21f5('0x28')]+_0x4b0364[_0x21f5('0x29')],_0x26f653;if(_0x5c06ad>=_0x1a3c91){_0x5c06ad=_0x1a3c91;_0x26f653=0xc8;}else{_0x26f653=0xce;}_0x383189[_0x21f5('0x25')](_0x26f653);return _0x383189[_0x21f5('0x2a')]('Content-Range',_0x8c1a12+'-'+_0x5c06ad+'/'+_0x1a3c91)[_0x21f5('0x27')](_0x437f77);}return null;};}function patchUpdates(_0x3b0d70){return function(_0x5725cd){try{jsonpatch['apply'](_0x5725cd,_0x3b0d70,!![]);}catch(_0x3d2694){return BPromise['reject'](_0x3d2694);}return _0x5725cd[_0x21f5('0x2b')]();};}function saveUpdates(_0x298535,_0x54bd7d){return function(_0x59e9ed){if(_0x59e9ed){return _0x59e9ed[_0x21f5('0x2c')](_0x298535)[_0x21f5('0x1a')](function(_0x256840){return _0x256840;});}return null;};}function removeEntity(_0x12189c,_0x47afc9){return function(_0x307d67){if(_0x307d67){return _0x307d67[_0x21f5('0x2d')]()[_0x21f5('0x1a')](function(){_0x12189c[_0x21f5('0x25')](0xcc)[_0x21f5('0x26')]();});}};}function handleEntityNotFound(_0x3598d7,_0x1285d9){return function(_0x1ffdf1){if(!_0x1ffdf1){_0x3598d7[_0x21f5('0x24')](0x194);}return _0x1ffdf1;};}function handleError(_0x269ce2,_0x5c9137){_0x5c9137=_0x5c9137||0x1f4;return function(_0x7fbf0f){logger['error'](_0x7fbf0f[_0x21f5('0x2e')]);if(_0x7fbf0f['name']){delete _0x7fbf0f['name'];}_0x269ce2[_0x21f5('0x25')](_0x5c9137)[_0x21f5('0x2f')](_0x7fbf0f);};}exports[_0x21f5('0x30')]=function(_0x3798cd,_0x1f12cf){var _0x5e6bd4={},_0x4e5596={},_0x423482={'count':0x0,'rows':[]};var _0x1ab9ff=db[_0x21f5('0x31')][_0x21f5('0x32')];_0x4e5596['model']=_[_0x21f5('0x33')](_0x1ab9ff);_0x4e5596['query']=_[_0x21f5('0x33')](_0x3798cd[_0x21f5('0x34')]);_0x4e5596[_0x21f5('0x35')]=_[_0x21f5('0x36')](_0x4e5596[_0x21f5('0x37')],_0x4e5596['query']);_0x5e6bd4[_0x21f5('0x38')]=_[_0x21f5('0x36')](_0x4e5596['model'],qs['fields'](_0x3798cd['query'][_0x21f5('0x39')]));_0x5e6bd4['attributes']=_0x5e6bd4['attributes']['length']?_0x5e6bd4[_0x21f5('0x38')]:_0x4e5596['model'];if(!_0x3798cd[_0x21f5('0x34')][_0x21f5('0x3a')](_0x21f5('0x3b'))){_0x5e6bd4[_0x21f5('0x29')]=qs['limit'](_0x3798cd[_0x21f5('0x34')][_0x21f5('0x29')]);_0x5e6bd4[_0x21f5('0x28')]=qs[_0x21f5('0x28')](_0x3798cd[_0x21f5('0x34')][_0x21f5('0x28')]);}_0x5e6bd4[_0x21f5('0x3c')]=qs[_0x21f5('0x3d')](_0x3798cd[_0x21f5('0x34')][_0x21f5('0x3d')]);_0x5e6bd4[_0x21f5('0x3e')]=qs[_0x21f5('0x35')](_[_0x21f5('0x3f')](_0x3798cd[_0x21f5('0x34')],_0x4e5596[_0x21f5('0x35')]));if(_0x3798cd[_0x21f5('0x34')][_0x21f5('0x40')]){_0x5e6bd4['where']=_[_0x21f5('0x41')](_0x5e6bd4['where'],{'$or':_['map'](_0x1ab9ff,function(_0x1291d6){if(_0x1291d6[_0x21f5('0x42')]['key']!==_0x21f5('0x43')){var _0x2d100f={};_0x2d100f[_0x1291d6[_0x21f5('0x44')]]={'$like':'%'+_0x3798cd[_0x21f5('0x34')][_0x21f5('0x40')]+'%'};return _0x2d100f;}})});}_0x5e6bd4=_[_0x21f5('0x41')]({},_0x5e6bd4,_0x3798cd['options']);var _0x7340e0={'where':_0x5e6bd4['where']};return db['ZendeskConfiguration'][_0x21f5('0x45')](_0x7340e0)[_0x21f5('0x1a')](function(_0x406b35){_0x423482['count']=_0x406b35;if(_0x3798cd[_0x21f5('0x34')][_0x21f5('0x46')]){_0x5e6bd4[_0x21f5('0x47')]=[{'all':!![]}];}return db[_0x21f5('0x31')][_0x21f5('0x48')](_0x5e6bd4);})['then'](function(_0x553dae){_0x423482['rows']=_0x553dae;return _0x423482;})[_0x21f5('0x1a')](respondWithFilteredResult(_0x1f12cf,_0x5e6bd4))[_0x21f5('0x23')](handleError(_0x1f12cf,null));};exports['show']=function(_0x1788c2,_0x322e72){var _0x1312ca={'raw':![],'where':{'id':_0x1788c2['params']['id']}},_0xc8469c={};_0xc8469c['model']=_[_0x21f5('0x33')](db[_0x21f5('0x31')][_0x21f5('0x32')]);_0xc8469c[_0x21f5('0x34')]=_[_0x21f5('0x33')](_0x1788c2[_0x21f5('0x34')]);_0xc8469c[_0x21f5('0x35')]=_[_0x21f5('0x36')](_0xc8469c[_0x21f5('0x37')],_0xc8469c['query']);_0x1312ca['attributes']=_['intersection'](_0xc8469c['model'],qs[_0x21f5('0x39')](_0x1788c2[_0x21f5('0x34')]['fields']));_0x1312ca[_0x21f5('0x38')]=_0x1312ca[_0x21f5('0x38')]['length']?_0x1312ca[_0x21f5('0x38')]:_0xc8469c[_0x21f5('0x37')];if(_0x1788c2[_0x21f5('0x34')][_0x21f5('0x46')]){_0x1312ca['include']=[{'all':!![]}];}_0x1312ca=_[_0x21f5('0x41')]({},_0x1312ca,_0x1788c2[_0x21f5('0x49')]);return db[_0x21f5('0x31')][_0x21f5('0x4a')](_0x1312ca)[_0x21f5('0x1a')](handleEntityNotFound(_0x322e72,null))[_0x21f5('0x1a')](respondWithResult(_0x322e72,null))[_0x21f5('0x23')](handleError(_0x322e72,null));};exports[_0x21f5('0x4b')]=function(_0x14e901,_0x48b58f){return db[_0x21f5('0x31')]['create'](_0x14e901[_0x21f5('0x4c')],{})[_0x21f5('0x1a')](respondWithResult(_0x48b58f,0xc9))['catch'](handleError(_0x48b58f,null));};exports[_0x21f5('0x2c')]=function(_0x44788f,_0x927613){if(_0x44788f[_0x21f5('0x4c')]['id']){delete _0x44788f[_0x21f5('0x4c')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x44788f[_0x21f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x927613,null))[_0x21f5('0x1a')](saveUpdates(_0x44788f[_0x21f5('0x4c')],null))[_0x21f5('0x1a')](respondWithResult(_0x927613,null))['catch'](handleError(_0x927613,null));};exports[_0x21f5('0x2d')]=function(_0x4de887,_0x2ca3f3){return db[_0x21f5('0x31')]['find']({'where':{'id':_0x4de887[_0x21f5('0x4d')]['id']}})[_0x21f5('0x1a')](handleEntityNotFound(_0x2ca3f3,null))[_0x21f5('0x1a')](removeEntity(_0x2ca3f3,null))['catch'](handleError(_0x2ca3f3,null));};exports[_0x21f5('0x4e')]=function(_0x59712b,_0xa1a440,_0x48074e){var _0x46781c={};var _0x45fc39={};var _0x45dcb9;var _0x14e334;return db['ZendeskConfiguration'][_0x21f5('0x4f')]({'where':{'id':_0x59712b[_0x21f5('0x4d')]['id']}})[_0x21f5('0x1a')](handleEntityNotFound(_0xa1a440,null))[_0x21f5('0x1a')](function(_0x432c74){if(_0x432c74){_0x45dcb9=_0x432c74;_0x45fc39[_0x21f5('0x37')]=_[_0x21f5('0x33')](db[_0x21f5('0x50')][_0x21f5('0x32')]);_0x45fc39[_0x21f5('0x34')]=_[_0x21f5('0x33')](_0x59712b['query']);_0x45fc39['filters']=_['intersection'](_0x45fc39['model'],_0x45fc39['query']);_0x46781c['attributes']=_[_0x21f5('0x36')](_0x45fc39['model'],qs[_0x21f5('0x39')](_0x59712b[_0x21f5('0x34')][_0x21f5('0x39')]));_0x46781c['attributes']=_0x46781c['attributes'][_0x21f5('0x51')]?_0x46781c[_0x21f5('0x38')]:_0x45fc39['model'];_0x46781c[_0x21f5('0x3c')]=qs[_0x21f5('0x3d')](_0x59712b[_0x21f5('0x34')]['sort']);_0x46781c[_0x21f5('0x3e')]=qs['filters'](_[_0x21f5('0x3f')](_0x59712b['query'],_0x45fc39['filters']));if(_0x59712b['query'][_0x21f5('0x40')]){_0x46781c[_0x21f5('0x3e')]=_[_0x21f5('0x41')](_0x46781c[_0x21f5('0x3e')],{'$or':_[_0x21f5('0x52')](_0x46781c['attributes'],function(_0x113790){var _0x4bc38c={};_0x4bc38c[_0x113790]={'$like':'%'+_0x59712b[_0x21f5('0x34')]['filter']+'%'};return _0x4bc38c;})});}_0x46781c=_['merge']({},_0x46781c,_0x59712b[_0x21f5('0x49')]);return _0x45dcb9[_0x21f5('0x4e')](_0x46781c);}})[_0x21f5('0x1a')](function(_0x20847b){if(_0x20847b){_0x14e334=_0x20847b['length'];if(!_0x59712b[_0x21f5('0x34')]['hasOwnProperty'](_0x21f5('0x3b'))){_0x46781c['limit']=qs[_0x21f5('0x29')](_0x59712b[_0x21f5('0x34')][_0x21f5('0x29')]);_0x46781c[_0x21f5('0x28')]=qs[_0x21f5('0x28')](_0x59712b[_0x21f5('0x34')][_0x21f5('0x28')]);}return _0x45dcb9['getFields'](_0x46781c);}})[_0x21f5('0x1a')](function(_0xcd3ca){if(_0xcd3ca){return _0xcd3ca?{'count':_0x14e334,'rows':_0xcd3ca}:null;}})[_0x21f5('0x1a')](respondWithResult(_0xa1a440,null))[_0x21f5('0x23')](handleError(_0xa1a440,null));};exports[_0x21f5('0x53')]=function(_0x41fdbf,_0x3445d5,_0x15e638){var _0x215b6e={};var _0x189b72={};var _0x35a25b;var _0x1dc04b;return db[_0x21f5('0x31')][_0x21f5('0x4f')]({'where':{'id':_0x41fdbf[_0x21f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3445d5,null))[_0x21f5('0x1a')](function(_0x198b69){if(_0x198b69){_0x35a25b=_0x198b69;_0x189b72['model']=_[_0x21f5('0x33')](db['ZendeskField'][_0x21f5('0x32')]);_0x189b72[_0x21f5('0x34')]=_[_0x21f5('0x33')](_0x41fdbf[_0x21f5('0x34')]);_0x189b72[_0x21f5('0x35')]=_[_0x21f5('0x36')](_0x189b72['model'],_0x189b72[_0x21f5('0x34')]);_0x215b6e[_0x21f5('0x38')]=_[_0x21f5('0x36')](_0x189b72[_0x21f5('0x37')],qs[_0x21f5('0x39')](_0x41fdbf[_0x21f5('0x34')][_0x21f5('0x39')]));_0x215b6e[_0x21f5('0x38')]=_0x215b6e[_0x21f5('0x38')]['length']?_0x215b6e[_0x21f5('0x38')]:_0x189b72[_0x21f5('0x37')];_0x215b6e[_0x21f5('0x3c')]=qs['sort'](_0x41fdbf[_0x21f5('0x34')]['sort']);_0x215b6e['where']=qs['filters'](_['pick'](_0x41fdbf[_0x21f5('0x34')],_0x189b72[_0x21f5('0x35')]));if(_0x41fdbf['query']['filter']){_0x215b6e[_0x21f5('0x3e')]=_['merge'](_0x215b6e[_0x21f5('0x3e')],{'$or':_[_0x21f5('0x52')](_0x215b6e[_0x21f5('0x38')],function(_0x22ec7d){var _0x41328={};_0x41328[_0x22ec7d]={'$like':'%'+_0x41fdbf[_0x21f5('0x34')][_0x21f5('0x40')]+'%'};return _0x41328;})});}_0x215b6e=_[_0x21f5('0x41')]({},_0x215b6e,_0x41fdbf[_0x21f5('0x49')]);return _0x35a25b[_0x21f5('0x53')](_0x215b6e);}})[_0x21f5('0x1a')](function(_0x5d5f15){if(_0x5d5f15){_0x1dc04b=_0x5d5f15[_0x21f5('0x51')];if(!_0x41fdbf[_0x21f5('0x34')]['hasOwnProperty'](_0x21f5('0x3b'))){_0x215b6e[_0x21f5('0x29')]=qs[_0x21f5('0x29')](_0x41fdbf['query'][_0x21f5('0x29')]);_0x215b6e[_0x21f5('0x28')]=qs[_0x21f5('0x28')](_0x41fdbf[_0x21f5('0x34')][_0x21f5('0x28')]);}return _0x35a25b[_0x21f5('0x53')](_0x215b6e);}})[_0x21f5('0x1a')](function(_0x544500){if(_0x544500){return _0x544500?{'count':_0x1dc04b,'rows':_0x544500}:null;}})[_0x21f5('0x1a')](respondWithResult(_0x3445d5,null))[_0x21f5('0x23')](handleError(_0x3445d5,null));};exports[_0x21f5('0x54')]=function(_0x1828f2,_0x38228f,_0x4a2687){var _0x5010a9={};var _0x46e602={};var _0xaa589c;var _0x5f10d2;return db['ZendeskConfiguration'][_0x21f5('0x4f')]({'where':{'id':_0x1828f2['params']['id']}})[_0x21f5('0x1a')](handleEntityNotFound(_0x38228f,null))['then'](function(_0x59857a){if(_0x59857a){_0xaa589c=_0x59857a;_0x46e602[_0x21f5('0x37')]=_[_0x21f5('0x33')](db[_0x21f5('0x50')]['rawAttributes']);_0x46e602[_0x21f5('0x34')]=_[_0x21f5('0x33')](_0x1828f2[_0x21f5('0x34')]);_0x46e602['filters']=_[_0x21f5('0x36')](_0x46e602[_0x21f5('0x37')],_0x46e602['query']);_0x5010a9[_0x21f5('0x38')]=_[_0x21f5('0x36')](_0x46e602[_0x21f5('0x37')],qs[_0x21f5('0x39')](_0x1828f2['query'][_0x21f5('0x39')]));_0x5010a9[_0x21f5('0x38')]=_0x5010a9[_0x21f5('0x38')]['length']?_0x5010a9[_0x21f5('0x38')]:_0x46e602[_0x21f5('0x37')];_0x5010a9['order']=qs[_0x21f5('0x3d')](_0x1828f2[_0x21f5('0x34')]['sort']);_0x5010a9[_0x21f5('0x3e')]=qs[_0x21f5('0x35')](_[_0x21f5('0x3f')](_0x1828f2[_0x21f5('0x34')],_0x46e602[_0x21f5('0x35')]));if(_0x1828f2[_0x21f5('0x34')][_0x21f5('0x40')]){_0x5010a9['where']=_['merge'](_0x5010a9[_0x21f5('0x3e')],{'$or':_[_0x21f5('0x52')](_0x5010a9[_0x21f5('0x38')],function(_0x99efcc){var _0x47617d={};_0x47617d[_0x99efcc]={'$like':'%'+_0x1828f2['query'][_0x21f5('0x40')]+'%'};return _0x47617d;})});}_0x5010a9=_[_0x21f5('0x41')]({},_0x5010a9,_0x1828f2['options']);return _0xaa589c['getDescriptions'](_0x5010a9);}})[_0x21f5('0x1a')](function(_0x14b75f){if(_0x14b75f){_0x5f10d2=_0x14b75f[_0x21f5('0x51')];if(!_0x1828f2[_0x21f5('0x34')][_0x21f5('0x3a')](_0x21f5('0x3b'))){_0x5010a9['limit']=qs[_0x21f5('0x29')](_0x1828f2[_0x21f5('0x34')][_0x21f5('0x29')]);_0x5010a9[_0x21f5('0x28')]=qs[_0x21f5('0x28')](_0x1828f2[_0x21f5('0x34')][_0x21f5('0x28')]);}return _0xaa589c[_0x21f5('0x54')](_0x5010a9);}})['then'](function(_0x51ee64){if(_0x51ee64){return _0x51ee64?{'count':_0x5f10d2,'rows':_0x51ee64}:null;}})[_0x21f5('0x1a')](respondWithResult(_0x38228f,null))[_0x21f5('0x23')](handleError(_0x38228f,null));};exports['getTags']=function(_0x24a04e,_0x20a2af,_0x261c70){var _0x1ca627={};var _0x3aca09={};var _0xd47f49;var _0xe97fb0;return db['ZendeskConfiguration'][_0x21f5('0x4f')]({'where':{'id':_0x24a04e[_0x21f5('0x4d')]['id']}})[_0x21f5('0x1a')](handleEntityNotFound(_0x20a2af,null))['then'](function(_0x19ee94){if(_0x19ee94){_0xd47f49=_0x19ee94;_0x3aca09['model']=_['keys'](db['Tag']['rawAttributes']);_0x3aca09[_0x21f5('0x34')]=_[_0x21f5('0x33')](_0x24a04e['query']);_0x3aca09[_0x21f5('0x35')]=_[_0x21f5('0x36')](_0x3aca09[_0x21f5('0x37')],_0x3aca09[_0x21f5('0x34')]);_0x1ca627[_0x21f5('0x38')]=_[_0x21f5('0x36')](_0x3aca09[_0x21f5('0x37')],qs[_0x21f5('0x39')](_0x24a04e[_0x21f5('0x34')][_0x21f5('0x39')]));_0x1ca627[_0x21f5('0x38')]=_0x1ca627['attributes'][_0x21f5('0x51')]?_0x1ca627[_0x21f5('0x38')]:_0x3aca09[_0x21f5('0x37')];_0x1ca627['order']=qs['sort'](_0x24a04e[_0x21f5('0x34')][_0x21f5('0x3d')]);_0x1ca627['where']=qs[_0x21f5('0x35')](_[_0x21f5('0x3f')](_0x24a04e['query'],_0x3aca09['filters']));if(_0x24a04e[_0x21f5('0x34')]['filter']){_0x1ca627[_0x21f5('0x3e')]=_[_0x21f5('0x41')](_0x1ca627[_0x21f5('0x3e')],{'$or':_[_0x21f5('0x52')](_0x1ca627[_0x21f5('0x38')],function(_0x1c2f70){var _0x3ce262={};_0x3ce262[_0x1c2f70]={'$like':'%'+_0x24a04e[_0x21f5('0x34')][_0x21f5('0x40')]+'%'};return _0x3ce262;})});}_0x1ca627=_[_0x21f5('0x41')]({},_0x1ca627,_0x24a04e['options']);return _0xd47f49['getTags'](_0x1ca627);}})[_0x21f5('0x1a')](function(_0x4c90bf){if(_0x4c90bf){_0xe97fb0=_0x4c90bf[_0x21f5('0x51')];if(!_0x24a04e['query'][_0x21f5('0x3a')]('nolimit')){_0x1ca627['limit']=qs[_0x21f5('0x29')](_0x24a04e['query'][_0x21f5('0x29')]);_0x1ca627[_0x21f5('0x28')]=qs['offset'](_0x24a04e[_0x21f5('0x34')][_0x21f5('0x28')]);}return _0xd47f49['getTags'](_0x1ca627);}})[_0x21f5('0x1a')](function(_0x1bd003){if(_0x1bd003){return _0x1bd003?{'count':_0xe97fb0,'rows':_0x1bd003}:null;}})[_0x21f5('0x1a')](respondWithResult(_0x20a2af,null))[_0x21f5('0x23')](handleError(_0x20a2af,null));};exports[_0x21f5('0x55')]=function(_0x47375f,_0x19e808,_0x2bddc6){if(_0x47375f[_0x21f5('0x4c')]['id']){delete _0x47375f['body']['id'];}return db[_0x21f5('0x31')][_0x21f5('0x4f')]({'where':{'id':_0x47375f['params']['id']}})[_0x21f5('0x1a')](handleEntityNotFound(_0x19e808,null))[_0x21f5('0x1a')](function(_0x582c7b){if(_0x582c7b){return _0x582c7b['setTags'](_0x47375f[_0x21f5('0x4c')][_0x21f5('0x56')]||[]);}return null;})[_0x21f5('0x1a')](respondWithResult(_0x19e808,null))['catch'](handleError(_0x19e808,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a4773ed..923b2be 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 _0xdda4=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdda4,0xce));var _0x4dda=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0xdda4[_0x25248b];return _0x509939;};'use strict';var _=require(_0x4dda('0x0'));var util=require(_0x4dda('0x1'));var logger=require(_0x4dda('0x2'))(_0x4dda('0x3'));var moment=require(_0x4dda('0x4'));var BPromise=require(_0x4dda('0x5'));var rp=require(_0x4dda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4dda('0x7'));var attributes=require(_0x4dda('0x8'));module[_0x4dda('0x9')]=function(_0x12f446,_0x5d6f5b){return _0x12f446['define'](_0x4dda('0xa'),attributes,{'tableName':_0x4dda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ed7=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x543412,_0x4d2bea){var _0x4cab53=function(_0x21519f){while(--_0x21519f){_0x543412['push'](_0x543412['shift']());}};_0x4cab53(++_0x4d2bea);}(_0x9ed7,0x1a6));var _0x79ed=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x9ed7[_0x4a8bad];return _0x30cf32;};'use strict';var _=require(_0x79ed('0x0'));var util=require(_0x79ed('0x1'));var logger=require(_0x79ed('0x2'))('api');var moment=require(_0x79ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x79ed('0x4'));var fs=require('fs');var path=require(_0x79ed('0x5'));var rimraf=require(_0x79ed('0x6'));var config=require(_0x79ed('0x7'));var attributes=require(_0x79ed('0x8'));module[_0x79ed('0x9')]=function(_0x434250,_0x516d0c){return _0x434250[_0x79ed('0xa')](_0x79ed('0xb'),attributes,{'tableName':_0x79ed('0xc'),'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 9a48eb0..3e299e1 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 _0x3bfc=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x17cb2f,_0x57666d){var _0xb40bee=function(_0x21c1d9){while(--_0x21c1d9){_0x17cb2f['push'](_0x17cb2f['shift']());}};_0xb40bee(++_0x57666d);}(_0x3bfc,0xa9));var _0xc3bf=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x3bfc[_0x34b5ca];return _0x2d72c0;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var moment=require(_0xc3bf('0x2'));var BPromise=require(_0xc3bf('0x3'));var rs=require(_0xc3bf('0x4'));var fs=require('fs');var Redis=require(_0xc3bf('0x5'));var db=require(_0xc3bf('0x6'))['db'];var utils=require(_0xc3bf('0x7'));var logger=require('../../config/logger')(_0xc3bf('0x8'));var config=require(_0xc3bf('0x9'));var jayson=require(_0xc3bf('0xa'));var client=jayson[_0xc3bf('0xb')][_0xc3bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47d070,_0x2bc7e1,_0x3db485){return new BPromise(function(_0x231555,_0x17da9c){return client[_0xc3bf('0xd')](_0x47d070,_0x3db485)[_0xc3bf('0xe')](function(_0x3ba729){logger[_0xc3bf('0xf')](_0xc3bf('0x10'),_0x2bc7e1,_0xc3bf('0x11'));logger[_0xc3bf('0x12')](_0xc3bf('0x13'),_0x2bc7e1,'request\x20sent',JSON[_0xc3bf('0x14')](_0x3ba729));if(_0x3ba729['error']){if(_0x3ba729[_0xc3bf('0x15')][_0xc3bf('0x16')]===0x1f4){logger[_0xc3bf('0x15')](_0xc3bf('0x10'),_0x2bc7e1,_0x3ba729[_0xc3bf('0x15')]['message']);return _0x17da9c(_0x3ba729['error']['message']);}logger[_0xc3bf('0x15')](_0xc3bf('0x10'),_0x2bc7e1,_0x3ba729[_0xc3bf('0x15')][_0xc3bf('0x17')]);return _0x231555(_0x3ba729[_0xc3bf('0x15')]['message']);}else{logger[_0xc3bf('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2bc7e1,_0xc3bf('0x11'));_0x231555(_0x3ba729[_0xc3bf('0x18')][_0xc3bf('0x17')]);}})[_0xc3bf('0x19')](function(_0xaee749){logger[_0xc3bf('0x15')](_0xc3bf('0x10'),_0x2bc7e1,_0xaee749);_0x17da9c(_0xaee749);});});} \ No newline at end of file +var _0xadb3=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','then'];(function(_0x1147fa,_0x2dbd41){var _0xeed163=function(_0x2c9c1d){while(--_0x2c9c1d){_0x1147fa['push'](_0x1147fa['shift']());}};_0xeed163(++_0x2dbd41);}(_0xadb3,0x1d6));var _0x3adb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xadb3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3adb('0x0'));var util=require(_0x3adb('0x1'));var moment=require(_0x3adb('0x2'));var BPromise=require('bluebird');var rs=require(_0x3adb('0x3'));var fs=require('fs');var Redis=require(_0x3adb('0x4'));var db=require(_0x3adb('0x5'))['db'];var utils=require(_0x3adb('0x6'));var logger=require(_0x3adb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3adb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xedee7b,_0x407ee0,_0x20cb6d){return new BPromise(function(_0x3786b9,_0x5344a3){return client['request'](_0xedee7b,_0x20cb6d)[_0x3adb('0x9')](function(_0x179502){logger[_0x3adb('0xa')](_0x3adb('0xb'),_0x407ee0,_0x3adb('0xc'));logger[_0x3adb('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x407ee0,_0x3adb('0xc'),JSON[_0x3adb('0xe')](_0x179502));if(_0x179502['error']){if(_0x179502[_0x3adb('0xf')][_0x3adb('0x10')]===0x1f4){logger[_0x3adb('0xf')](_0x3adb('0xb'),_0x407ee0,_0x179502[_0x3adb('0xf')]['message']);return _0x5344a3(_0x179502[_0x3adb('0xf')]['message']);}logger[_0x3adb('0xf')](_0x3adb('0xb'),_0x407ee0,_0x179502['error']['message']);return _0x3786b9(_0x179502[_0x3adb('0xf')][_0x3adb('0x11')]);}else{logger[_0x3adb('0xa')](_0x3adb('0xb'),_0x407ee0,_0x3adb('0xc'));_0x3786b9(_0x179502[_0x3adb('0x12')][_0x3adb('0x11')]);}})[_0x3adb('0x13')](function(_0x3b5f25){logger[_0x3adb('0xf')](_0x3adb('0xb'),_0x407ee0,_0x3b5f25);_0x5344a3(_0x3b5f25);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 93465a1..6e9fff8 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x545c97,_0x50f984){var _0x32fb77=function(_0x16a3be){while(--_0x16a3be){_0x545c97['push'](_0x545c97['shift']());}};_0x32fb77(++_0x50f984);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index a79f789..247af66 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 _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x123935,_0x1670ba){var _0x1a8ebf=function(_0xa6933e){while(--_0xa6933e){_0x123935['push'](_0x123935['shift']());}};_0x1a8ebf(++_0x1670ba);}(_0xb58b,0x1f1));var _0xbb58=function(_0x34bb86,_0x20aac2){_0x34bb86=_0x34bb86-0x0;var _0x120380=_0xb58b[_0x34bb86];return _0x120380;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file +var _0x4ea3=['sequelize','exports','ENUM','string','customVariable','variable','STRING'];(function(_0xaa5340,_0xd5b447){var _0x26f1d2=function(_0x509e77){while(--_0x509e77){_0xaa5340['push'](_0xaa5340['shift']());}};_0x26f1d2(++_0xd5b447);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'type':{'type':Sequelize[_0x34ea('0x2')](_0x34ea('0x3'),'variable',_0x34ea('0x4'),'keyValue'),'defaultValue':_0x34ea('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x34ea('0x2')](_0x34ea('0x3'),_0x34ea('0x5'),_0x34ea('0x4'))},'keyContent':{'type':Sequelize[_0x34ea('0x6')]},'idField':{'type':Sequelize[_0x34ea('0x6')]},'nameField':{'type':Sequelize[_0x34ea('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x34ea('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d75487a..8f229d2 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 _0x7348=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','map','VIRTUAL','field','options','ZendeskField','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','rawAttributes'];(function(_0x24aba7,_0xaf2aec){var _0xda207b=function(_0x1cb051){while(--_0x1cb051){_0x24aba7['push'](_0x24aba7['shift']());}};_0xda207b(++_0xaf2aec);}(_0x7348,0x16b));var _0x8734=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7348[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8734('0x0'));var rimraf=require(_0x8734('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8734('0x2'));var rp=require(_0x8734('0x3'));var moment=require(_0x8734('0x4'));var BPromise=require(_0x8734('0x5'));var Mustache=require(_0x8734('0x6'));var util=require('util');var path=require(_0x8734('0x7'));var sox=require('sox');var csv=require(_0x8734('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8734('0x9'));var squel=require(_0x8734('0xa'));var crypto=require(_0x8734('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8734('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8734('0xd'));var Redis=require('ioredis');var authService=require(_0x8734('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8734('0xf'));var logger=require(_0x8734('0x10'))(_0x8734('0x11'));var utils=require(_0x8734('0x12'));var config=require('../../config/environment');var db=require(_0x8734('0x13'))['db'];function respondWithStatusCode(_0xc09672,_0x32b0be){_0x32b0be=_0x32b0be||0xcc;return function(_0x9c3bf3){if(_0x9c3bf3){return _0xc09672[_0x8734('0x14')](_0x32b0be);}return _0xc09672[_0x8734('0x15')](_0x32b0be)[_0x8734('0x16')]();};}function respondWithResult(_0x5f085c,_0x123b12){_0x123b12=_0x123b12||0xc8;return function(_0x4986b6){if(_0x4986b6){return _0x5f085c['status'](_0x123b12)['json'](_0x4986b6);}};}function respondWithFilteredResult(_0x117bf3,_0x16cf2d){return function(_0xcd2b64){if(_0xcd2b64){var _0x381cfb=_0xcd2b64[_0x8734('0x17')],_0x642d54=_0x16cf2d['offset'],_0x4a90aa=_0x16cf2d[_0x8734('0x18')]+_0x16cf2d[_0x8734('0x19')],_0x331872;if(_0x4a90aa>=_0x381cfb){_0x4a90aa=_0x381cfb;_0x331872=0xc8;}else{_0x331872=0xce;}_0x117bf3[_0x8734('0x15')](_0x331872);return _0x117bf3[_0x8734('0x1a')](_0x8734('0x1b'),_0x642d54+'-'+_0x4a90aa+'/'+_0x381cfb)[_0x8734('0x1c')](_0xcd2b64);}return null;};}function patchUpdates(_0x25f144){return function(_0x548f22){try{jsonpatch['apply'](_0x548f22,_0x25f144,!![]);}catch(_0x3d2e95){return BPromise[_0x8734('0x1d')](_0x3d2e95);}return _0x548f22[_0x8734('0x1e')]();};}function saveUpdates(_0x380097,_0x3e010c){return function(_0xdf974b){if(_0xdf974b){return _0xdf974b['update'](_0x380097)['then'](function(_0x4d85bf){return _0x4d85bf;});}return null;};}function removeEntity(_0x345cf3,_0x21fde7){return function(_0x5ee54a){if(_0x5ee54a){return _0x5ee54a[_0x8734('0x1f')]()[_0x8734('0x20')](function(){_0x345cf3[_0x8734('0x15')](0xcc)[_0x8734('0x16')]();});}};}function handleEntityNotFound(_0x538bc6,_0x25b002){return function(_0x4a022e){if(!_0x4a022e){_0x538bc6[_0x8734('0x14')](0x194);}return _0x4a022e;};}function handleError(_0xa65ce6,_0x25b87e){_0x25b87e=_0x25b87e||0x1f4;return function(_0x316fe6){logger[_0x8734('0x21')](_0x316fe6[_0x8734('0x22')]);if(_0x316fe6[_0x8734('0x23')]){delete _0x316fe6[_0x8734('0x23')];}_0xa65ce6['status'](_0x25b87e)[_0x8734('0x24')](_0x316fe6);};}exports[_0x8734('0x25')]=function(_0x3e7bcf,_0x3d66bc){var _0x14ea87={},_0x232170={},_0xa831f3={'count':0x0,'rows':[]};var _0x3acb61=db['ZendeskField'][_0x8734('0x26')];_0x232170[_0x8734('0x27')]=_[_0x8734('0x28')](_0x3acb61);_0x232170[_0x8734('0x29')]=_[_0x8734('0x28')](_0x3e7bcf[_0x8734('0x29')]);_0x232170['filters']=_[_0x8734('0x2a')](_0x232170[_0x8734('0x27')],_0x232170['query']);_0x14ea87[_0x8734('0x2b')]=_['intersection'](_0x232170[_0x8734('0x27')],qs[_0x8734('0x2c')](_0x3e7bcf[_0x8734('0x29')][_0x8734('0x2c')]));_0x14ea87[_0x8734('0x2b')]=_0x14ea87[_0x8734('0x2b')][_0x8734('0x2d')]?_0x14ea87['attributes']:_0x232170[_0x8734('0x27')];if(!_0x3e7bcf[_0x8734('0x29')][_0x8734('0x2e')]('nolimit')){_0x14ea87[_0x8734('0x19')]=qs[_0x8734('0x19')](_0x3e7bcf[_0x8734('0x29')][_0x8734('0x19')]);_0x14ea87[_0x8734('0x18')]=qs[_0x8734('0x18')](_0x3e7bcf[_0x8734('0x29')]['offset']);}_0x14ea87['order']=qs['sort'](_0x3e7bcf[_0x8734('0x29')][_0x8734('0x2f')]);_0x14ea87[_0x8734('0x30')]=qs[_0x8734('0x31')](_['pick'](_0x3e7bcf[_0x8734('0x29')],_0x232170[_0x8734('0x31')]));if(_0x3e7bcf[_0x8734('0x29')][_0x8734('0x32')]){_0x14ea87[_0x8734('0x30')]=_[_0x8734('0x33')](_0x14ea87['where'],{'$or':_[_0x8734('0x34')](_0x3acb61,function(_0x4f7324){if(_0x4f7324['type']['key']!==_0x8734('0x35')){var _0x2dfef9={};_0x2dfef9[_0x4f7324[_0x8734('0x36')]]={'$like':'%'+_0x3e7bcf[_0x8734('0x29')][_0x8734('0x32')]+'%'};return _0x2dfef9;}})});}_0x14ea87=_[_0x8734('0x33')]({},_0x14ea87,_0x3e7bcf[_0x8734('0x37')]);var _0x221a52={'where':_0x14ea87['where']};return db[_0x8734('0x38')]['count'](_0x221a52)[_0x8734('0x20')](function(_0x13b555){_0xa831f3['count']=_0x13b555;if(_0x3e7bcf[_0x8734('0x29')]['includeAll']){_0x14ea87[_0x8734('0x39')]=[{'all':!![]}];}return db[_0x8734('0x38')][_0x8734('0x3a')](_0x14ea87);})[_0x8734('0x20')](function(_0x7328c2){_0xa831f3[_0x8734('0x3b')]=_0x7328c2;return _0xa831f3;})[_0x8734('0x20')](respondWithFilteredResult(_0x3d66bc,_0x14ea87))[_0x8734('0x3c')](handleError(_0x3d66bc,null));};exports[_0x8734('0x3d')]=function(_0x2c84de,_0x34a7e5){var _0x2fea68={'raw':!![],'where':{'id':_0x2c84de[_0x8734('0x3e')]['id']}},_0x57f665={};_0x57f665[_0x8734('0x27')]=_[_0x8734('0x28')](db[_0x8734('0x38')][_0x8734('0x26')]);_0x57f665[_0x8734('0x29')]=_[_0x8734('0x28')](_0x2c84de[_0x8734('0x29')]);_0x57f665[_0x8734('0x31')]=_[_0x8734('0x2a')](_0x57f665['model'],_0x57f665[_0x8734('0x29')]);_0x2fea68[_0x8734('0x2b')]=_[_0x8734('0x2a')](_0x57f665[_0x8734('0x27')],qs[_0x8734('0x2c')](_0x2c84de[_0x8734('0x29')]['fields']));_0x2fea68['attributes']=_0x2fea68['attributes']['length']?_0x2fea68[_0x8734('0x2b')]:_0x57f665['model'];if(_0x2c84de[_0x8734('0x29')]['includeAll']){_0x2fea68[_0x8734('0x39')]=[{'all':!![]}];}_0x2fea68=_[_0x8734('0x33')]({},_0x2fea68,_0x2c84de[_0x8734('0x37')]);return db[_0x8734('0x38')][_0x8734('0x3f')](_0x2fea68)[_0x8734('0x20')](handleEntityNotFound(_0x34a7e5,null))['then'](respondWithResult(_0x34a7e5,null))[_0x8734('0x3c')](handleError(_0x34a7e5,null));};exports[_0x8734('0x40')]=function(_0x379a38,_0x3ffd72){return db[_0x8734('0x38')][_0x8734('0x40')](_0x379a38[_0x8734('0x41')],{})[_0x8734('0x20')](respondWithResult(_0x3ffd72,0xc9))['catch'](handleError(_0x3ffd72,null));};exports[_0x8734('0x42')]=function(_0xe5bb27,_0x3045ac){if(_0xe5bb27[_0x8734('0x41')]['id']){delete _0xe5bb27['body']['id'];}return db[_0x8734('0x38')][_0x8734('0x3f')]({'where':{'id':_0xe5bb27[_0x8734('0x3e')]['id']}})[_0x8734('0x20')](handleEntityNotFound(_0x3045ac,null))[_0x8734('0x20')](saveUpdates(_0xe5bb27['body'],null))[_0x8734('0x20')](respondWithResult(_0x3045ac,null))['catch'](handleError(_0x3045ac,null));};exports[_0x8734('0x1f')]=function(_0x5ece7c,_0x14ea98){return db['ZendeskField'][_0x8734('0x3f')]({'where':{'id':_0x5ece7c['params']['id']}})['then'](handleEntityNotFound(_0x14ea98,null))['then'](removeEntity(_0x14ea98,null))[_0x8734('0x3c')](handleError(_0x14ea98,null));}; \ No newline at end of file +var _0x7d8a=['util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','send','ZendeskField','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x595b9b,_0xa58ff){var _0x3be4c6=function(_0x324f94){while(--_0x324f94){_0x595b9b['push'](_0x595b9b['shift']());}};_0x3be4c6(++_0xa58ff);}(_0x7d8a,0xbf));var _0xa7d8=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x7d8a[_0x5cb97e];return _0x1714b4;};'use strict';var pdf=require(_0xa7d8('0x0'));var emlformat=require(_0xa7d8('0x1'));var rimraf=require(_0xa7d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7d8('0x3'));var rp=require('request-promise');var moment=require(_0xa7d8('0x4'));var BPromise=require(_0xa7d8('0x5'));var Mustache=require(_0xa7d8('0x6'));var util=require(_0xa7d8('0x7'));var path=require(_0xa7d8('0x8'));var sox=require('sox');var csv=require(_0xa7d8('0x9'));var ejs=require(_0xa7d8('0xa'));var fs=require('fs');var _=require(_0xa7d8('0xb'));var squel=require(_0xa7d8('0xc'));var crypto=require('crypto');var jsforce=require(_0xa7d8('0xd'));var deskjs=require(_0xa7d8('0xe'));var toCsv=require(_0xa7d8('0x9'));var querystring=require('querystring');var Papa=require(_0xa7d8('0xf'));var Redis=require(_0xa7d8('0x10'));var authService=require(_0xa7d8('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa7d8('0x12'));var logger=require(_0xa7d8('0x13'))(_0xa7d8('0x14'));var utils=require(_0xa7d8('0x15'));var config=require(_0xa7d8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2b1b,_0x298bd2){_0x298bd2=_0x298bd2||0xcc;return function(_0x226747){if(_0x226747){return _0x4c2b1b[_0xa7d8('0x17')](_0x298bd2);}return _0x4c2b1b[_0xa7d8('0x18')](_0x298bd2)[_0xa7d8('0x19')]();};}function respondWithResult(_0x44c1ec,_0xe3a551){_0xe3a551=_0xe3a551||0xc8;return function(_0x41ba33){if(_0x41ba33){return _0x44c1ec[_0xa7d8('0x18')](_0xe3a551)[_0xa7d8('0x1a')](_0x41ba33);}};}function respondWithFilteredResult(_0x4df516,_0x4609bd){return function(_0x167ca4){if(_0x167ca4){var _0x40d52e=_0x167ca4[_0xa7d8('0x1b')],_0x23f768=_0x4609bd['offset'],_0x31142f=_0x4609bd[_0xa7d8('0x1c')]+_0x4609bd[_0xa7d8('0x1d')],_0x2fbb63;if(_0x31142f>=_0x40d52e){_0x31142f=_0x40d52e;_0x2fbb63=0xc8;}else{_0x2fbb63=0xce;}_0x4df516[_0xa7d8('0x18')](_0x2fbb63);return _0x4df516['set'](_0xa7d8('0x1e'),_0x23f768+'-'+_0x31142f+'/'+_0x40d52e)['json'](_0x167ca4);}return null;};}function patchUpdates(_0x51dd1e){return function(_0x59151f){try{jsonpatch[_0xa7d8('0x1f')](_0x59151f,_0x51dd1e,!![]);}catch(_0x2570c1){return BPromise[_0xa7d8('0x20')](_0x2570c1);}return _0x59151f['save']();};}function saveUpdates(_0x25550a,_0x5aed47){return function(_0xa774ff){if(_0xa774ff){return _0xa774ff[_0xa7d8('0x21')](_0x25550a)[_0xa7d8('0x22')](function(_0x179863){return _0x179863;});}return null;};}function removeEntity(_0x4a4d56,_0x347491){return function(_0x1253b8){if(_0x1253b8){return _0x1253b8[_0xa7d8('0x23')]()[_0xa7d8('0x22')](function(){_0x4a4d56[_0xa7d8('0x18')](0xcc)[_0xa7d8('0x19')]();});}};}function handleEntityNotFound(_0x384691,_0x3b5cfc){return function(_0x465c01){if(!_0x465c01){_0x384691[_0xa7d8('0x17')](0x194);}return _0x465c01;};}function handleError(_0xd2e163,_0xae56a8){_0xae56a8=_0xae56a8||0x1f4;return function(_0x242b5e){logger[_0xa7d8('0x24')](_0x242b5e[_0xa7d8('0x25')]);if(_0x242b5e['name']){delete _0x242b5e['name'];}_0xd2e163['status'](_0xae56a8)[_0xa7d8('0x26')](_0x242b5e);};}exports['index']=function(_0x5918db,_0x2364bd){var _0x32619b={},_0x164138={},_0x21e63c={'count':0x0,'rows':[]};var _0x21a398=db[_0xa7d8('0x27')]['rawAttributes'];_0x164138[_0xa7d8('0x28')]=_[_0xa7d8('0x29')](_0x21a398);_0x164138[_0xa7d8('0x2a')]=_[_0xa7d8('0x29')](_0x5918db[_0xa7d8('0x2a')]);_0x164138[_0xa7d8('0x2b')]=_[_0xa7d8('0x2c')](_0x164138['model'],_0x164138['query']);_0x32619b[_0xa7d8('0x2d')]=_[_0xa7d8('0x2c')](_0x164138[_0xa7d8('0x28')],qs['fields'](_0x5918db[_0xa7d8('0x2a')][_0xa7d8('0x2e')]));_0x32619b['attributes']=_0x32619b[_0xa7d8('0x2d')]['length']?_0x32619b[_0xa7d8('0x2d')]:_0x164138['model'];if(!_0x5918db[_0xa7d8('0x2a')]['hasOwnProperty'](_0xa7d8('0x2f'))){_0x32619b[_0xa7d8('0x1d')]=qs[_0xa7d8('0x1d')](_0x5918db['query'][_0xa7d8('0x1d')]);_0x32619b['offset']=qs[_0xa7d8('0x1c')](_0x5918db['query']['offset']);}_0x32619b[_0xa7d8('0x30')]=qs[_0xa7d8('0x31')](_0x5918db[_0xa7d8('0x2a')][_0xa7d8('0x31')]);_0x32619b[_0xa7d8('0x32')]=qs['filters'](_['pick'](_0x5918db[_0xa7d8('0x2a')],_0x164138['filters']));if(_0x5918db[_0xa7d8('0x2a')][_0xa7d8('0x33')]){_0x32619b['where']=_[_0xa7d8('0x34')](_0x32619b[_0xa7d8('0x32')],{'$or':_['map'](_0x21a398,function(_0x27ae4c){if(_0x27ae4c['type']['key']!==_0xa7d8('0x35')){var _0x4f631c={};_0x4f631c[_0x27ae4c['field']]={'$like':'%'+_0x5918db['query'][_0xa7d8('0x33')]+'%'};return _0x4f631c;}})});}_0x32619b=_[_0xa7d8('0x34')]({},_0x32619b,_0x5918db[_0xa7d8('0x36')]);var _0x586826={'where':_0x32619b['where']};return db[_0xa7d8('0x27')]['count'](_0x586826)[_0xa7d8('0x22')](function(_0x1ffb3e){_0x21e63c[_0xa7d8('0x1b')]=_0x1ffb3e;if(_0x5918db['query'][_0xa7d8('0x37')]){_0x32619b[_0xa7d8('0x38')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x32619b);})[_0xa7d8('0x22')](function(_0x12d12b){_0x21e63c[_0xa7d8('0x39')]=_0x12d12b;return _0x21e63c;})[_0xa7d8('0x22')](respondWithFilteredResult(_0x2364bd,_0x32619b))[_0xa7d8('0x3a')](handleError(_0x2364bd,null));};exports[_0xa7d8('0x3b')]=function(_0x32c291,_0x4291e1){var _0x29210d={'raw':!![],'where':{'id':_0x32c291[_0xa7d8('0x3c')]['id']}},_0x393b44={};_0x393b44['model']=_['keys'](db['ZendeskField'][_0xa7d8('0x3d')]);_0x393b44['query']=_[_0xa7d8('0x29')](_0x32c291['query']);_0x393b44['filters']=_[_0xa7d8('0x2c')](_0x393b44['model'],_0x393b44[_0xa7d8('0x2a')]);_0x29210d[_0xa7d8('0x2d')]=_[_0xa7d8('0x2c')](_0x393b44[_0xa7d8('0x28')],qs[_0xa7d8('0x2e')](_0x32c291[_0xa7d8('0x2a')]['fields']));_0x29210d[_0xa7d8('0x2d')]=_0x29210d[_0xa7d8('0x2d')][_0xa7d8('0x3e')]?_0x29210d[_0xa7d8('0x2d')]:_0x393b44['model'];if(_0x32c291[_0xa7d8('0x2a')][_0xa7d8('0x37')]){_0x29210d[_0xa7d8('0x38')]=[{'all':!![]}];}_0x29210d=_[_0xa7d8('0x34')]({},_0x29210d,_0x32c291['options']);return db['ZendeskField'][_0xa7d8('0x3f')](_0x29210d)[_0xa7d8('0x22')](handleEntityNotFound(_0x4291e1,null))[_0xa7d8('0x22')](respondWithResult(_0x4291e1,null))[_0xa7d8('0x3a')](handleError(_0x4291e1,null));};exports[_0xa7d8('0x40')]=function(_0x38156a,_0x56d893){return db['ZendeskField'][_0xa7d8('0x40')](_0x38156a[_0xa7d8('0x41')],{})[_0xa7d8('0x22')](respondWithResult(_0x56d893,0xc9))[_0xa7d8('0x3a')](handleError(_0x56d893,null));};exports['update']=function(_0x2109d9,_0x116edf){if(_0x2109d9[_0xa7d8('0x41')]['id']){delete _0x2109d9[_0xa7d8('0x41')]['id'];}return db[_0xa7d8('0x27')][_0xa7d8('0x3f')]({'where':{'id':_0x2109d9['params']['id']}})[_0xa7d8('0x22')](handleEntityNotFound(_0x116edf,null))[_0xa7d8('0x22')](saveUpdates(_0x2109d9[_0xa7d8('0x41')],null))[_0xa7d8('0x22')](respondWithResult(_0x116edf,null))[_0xa7d8('0x3a')](handleError(_0x116edf,null));};exports[_0xa7d8('0x23')]=function(_0x15102f,_0x589bc5){return db['ZendeskField'][_0xa7d8('0x3f')]({'where':{'id':_0x15102f[_0xa7d8('0x3c')]['id']}})[_0xa7d8('0x22')](handleEntityNotFound(_0x589bc5,null))[_0xa7d8('0x22')](removeEntity(_0x589bc5,null))[_0xa7d8('0x3a')](handleError(_0x589bc5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 57240d9..0ad0c49 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 _0x537e=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','idField'];(function(_0x32f241,_0x2fa830){var _0x84107=function(_0x56fd2a){while(--_0x56fd2a){_0x32f241['push'](_0x32f241['shift']());}};_0x84107(++_0x2fa830);}(_0x537e,0x168));var _0xe537=function(_0x58924e,_0x183128){_0x58924e=_0x58924e-0x0;var _0x4c9f62=_0x537e[_0x58924e];return _0x4c9f62;};'use strict';var _=require(_0xe537('0x0'));var util=require(_0xe537('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe537('0x2'));var BPromise=require(_0xe537('0x3'));var rp=require(_0xe537('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe537('0x5'));var config=require(_0xe537('0x6'));var attributes=require(_0xe537('0x7'));module[_0xe537('0x8')]=function(_0x39591b,_0x17eea9){return _0x39591b['define'](_0xe537('0x9'),attributes,{'tableName':_0xe537('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xe537('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99cb=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x99cb,0x1c7));var _0xb99c=function(_0x2619a4,_0x58b57c){_0x2619a4=_0x2619a4-0x0;var _0x3a3745=_0x99cb[_0x2619a4];return _0x3a3745;};'use strict';var _=require(_0xb99c('0x0'));var util=require('util');var logger=require(_0xb99c('0x1'))(_0xb99c('0x2'));var moment=require('moment');var BPromise=require(_0xb99c('0x3'));var rp=require(_0xb99c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb99c('0x5'));var config=require(_0xb99c('0x6'));var attributes=require('./intZendeskField.attributes');module[_0xb99c('0x7')]=function(_0x76e73f,_0x1234a9){return _0x76e73f['define'](_0xb99c('0x8'),attributes,{'tableName':_0xb99c('0x9'),'paranoid':![],'indexes':[{'name':_0xb99c('0xa'),'fields':[_0xb99c('0xb'),_0xb99c('0xc')],'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 9039f94..cefebad 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 _0x4bde=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskField,\x20%s,\x20%s','message','info','result'];(function(_0x134745,_0x3c7be0){var _0x11c05b=function(_0x3d67c7){while(--_0x3d67c7){_0x134745['push'](_0x134745['shift']());}};_0x11c05b(++_0x3c7be0);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x2a977f,_0x248bb8){_0x2a977f=_0x2a977f-0x0;var _0x3f8c63=_0x4bde[_0x2a977f];return _0x3f8c63;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('ZendeskField,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('ZendeskField,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});} \ No newline at end of file +var _0x5ec6=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','ZendeskField,\x20%s,\x20%s','debug'];(function(_0x2c4bb4,_0x793dcd){var _0x5f1243=function(_0x52c523){while(--_0x52c523){_0x2c4bb4['push'](_0x2c4bb4['shift']());}};_0x5f1243(++_0x793dcd);}(_0x5ec6,0x7f));var _0x65ec=function(_0x6d975f,_0x61b2f){_0x6d975f=_0x6d975f-0x0;var _0x2b1ef5=_0x5ec6[_0x6d975f];return _0x2b1ef5;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('ZendeskField,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 52ec958..a5fd2df 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 _0xf7b4=['express','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1c734d,_0x3aa648){_0x1c734d=_0x1c734d-0x0;var _0x220218=_0xf7b4[_0x1c734d];return _0x220218;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['getConfigurations']);router[_0x4f7b('0x6')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0xe')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xf')]);router[_0x4f7b('0xe')]('/:id/configurations',auth[_0x4f7b('0x7')](),controller['addConfiguration']);router['put'](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x10')]);router[_0x4f7b('0x11')]('/:id',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x12')]);module[_0x4f7b('0x13')]=router; \ No newline at end of file +var _0x5eb8=['getFields','post','create','/:id/configurations','put','/:id','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x4bb593,_0x272ed0){var _0x2da2d8=function(_0x4b25e9){while(--_0x4b25e9){_0x4bb593['push'](_0x4bb593['shift']());}};_0x2da2d8(++_0x272ed0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6b23f3,_0x4189c9){_0x6b23f3=_0x6b23f3-0x0;var _0x473e8f=_0x5eb8[_0x6b23f3];return _0x473e8f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0x8')]('/:id/configurations',auth[_0x85eb('0x9')](),controller['getConfigurations']);router[_0x85eb('0x8')](_0x85eb('0xc'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xd')]);router[_0x85eb('0xe')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router['post'](_0x85eb('0x10'),auth[_0x85eb('0x9')](),controller['addConfiguration']);router[_0x85eb('0x11')](_0x85eb('0x12'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x13')]);router['delete']('/:id',auth[_0x85eb('0x9')](),controller['destroy']);module[_0x85eb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 18af72f..0a4ffbf 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 _0xb8be=['exports','STRING'];(function(_0x1a3184,_0x453b7d){var _0x13bd42=function(_0x14c57e){while(--_0x14c57e){_0x1a3184['push'](_0x1a3184['shift']());}};_0x13bd42(++_0x453b7d);}(_0xb8be,0xde));var _0xeb8b=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0xb8be[_0x308213];return _0x2e1619;};'use strict';var Sequelize=require('sequelize');module[_0xeb8b('0x0')]={'name':{'type':Sequelize[_0xeb8b('0x1')]},'description':{'type':Sequelize[_0xeb8b('0x1')]},'authToken':{'type':Sequelize[_0xeb8b('0x1')]},'host':{'type':Sequelize[_0xeb8b('0x1')]},'serverUrl':{'type':Sequelize[_0xeb8b('0x1')]}}; \ No newline at end of file +var _0x501e=['sequelize','exports','STRING'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x501e,0xc3));var _0xe501=function(_0xcc6751,_0x349c6a){_0xcc6751=_0xcc6751-0x0;var _0x3463b1=_0x501e[_0xcc6751];return _0x3463b1;};'use strict';var Sequelize=require(_0xe501('0x0'));module[_0xe501('0x1')]={'name':{'type':Sequelize[_0xe501('0x2')]},'description':{'type':Sequelize[_0xe501('0x2')]},'authToken':{'type':Sequelize[_0xe501('0x2')]},'host':{'type':Sequelize[_0xe501('0x2')]},'serverUrl':{'type':Sequelize[_0xe501('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 91e6803..6152e01 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 _0x21e3=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','ZohoAccount','count','includeAll','rows','show','params','include','find','create','body','update','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','getFields','authToken','host','slice','substring','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','Call\x20Purpose','push','customfield','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','end','offset','limit','set','Content-Range','json','apply','save','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','query','filters'];(function(_0x2a4b4c,_0x43ecff){var _0x1eb3d2=function(_0xae694a){while(--_0xae694a){_0x2a4b4c['push'](_0x2a4b4c['shift']());}};_0x1eb3d2(++_0x43ecff);}(_0x21e3,0x121));var _0x321e=function(_0xec548b,_0x1e09b){_0xec548b=_0xec548b-0x0;var _0x52874d=_0x21e3[_0xec548b];return _0x52874d;};'use strict';var pdf=require(_0x321e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x321e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x321e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x321e('0x3'));var util=require(_0x321e('0x4'));var path=require(_0x321e('0x5'));var sox=require(_0x321e('0x6'));var csv=require(_0x321e('0x7'));var ejs=require(_0x321e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x321e('0x9'));var crypto=require(_0x321e('0xa'));var jsforce=require(_0x321e('0xb'));var deskjs=require(_0x321e('0xc'));var toCsv=require(_0x321e('0x7'));var querystring=require(_0x321e('0xd'));var Papa=require(_0x321e('0xe'));var Redis=require(_0x321e('0xf'));var authService=require(_0x321e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x321e('0x11'));var logger=require('../../config/logger')(_0x321e('0x12'));var utils=require(_0x321e('0x13'));var config=require(_0x321e('0x14'));var db=require(_0x321e('0x15'))['db'];var integrations=require(_0x321e('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x321e('0x17')][_0x321e('0x18')]({'port':0x232a});function checkPasswordPattern(_0x225e8d,_0x4ba40a,_0x40d95d){if(_0x40d95d){var _0x4ae3ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ae3ba[_0x321e('0x19')](_0x4ba40a)){return _0x225e8d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x225e8d;}}function respondWithRpcPromise(_0x37ca38,_0x282c0a,_0x31f7a8,_0x460559){return new BPromise(function(_0xd543b5,_0x1d58bf){var _0x539a5f=_0x460559||client;return _0x539a5f[_0x321e('0x1a')](_0x37ca38,_0x31f7a8)[_0x321e('0x1b')](function(_0x323060){logger[_0x321e('0x1c')](_0x321e('0x1d'),_0x282c0a,'request\x20sent');logger[_0x321e('0x1e')](_0x321e('0x1f'),_0x282c0a,'request\x20sent',JSON['stringify'](_0x323060));if(_0x323060[_0x321e('0x20')]){if(_0x323060[_0x321e('0x20')][_0x321e('0x21')]===0x1f4){logger['error'](_0x321e('0x1d'),_0x282c0a,_0x323060[_0x321e('0x20')][_0x321e('0x22')]);return _0x1d58bf(_0x323060[_0x321e('0x20')][_0x321e('0x22')]);}logger[_0x321e('0x20')](_0x321e('0x1d'),_0x282c0a,_0x323060['error'][_0x321e('0x22')]);return _0xd543b5(_0x323060[_0x321e('0x20')][_0x321e('0x22')]);}else{logger[_0x321e('0x1c')](_0x321e('0x1d'),_0x282c0a,_0x321e('0x23'));_0xd543b5(_0x323060['result']['message']);}})[_0x321e('0x24')](function(_0x2e3bc7){logger[_0x321e('0x20')](_0x321e('0x1d'),_0x282c0a,_0x2e3bc7);_0x1d58bf(_0x2e3bc7);});});}function respondWithStatusCode(_0x322e29,_0x4574ab){_0x4574ab=_0x4574ab||0xcc;return function(_0x28d2a2){if(_0x28d2a2){return _0x322e29['sendStatus'](_0x4574ab);}return _0x322e29[_0x321e('0x25')](_0x4574ab)[_0x321e('0x26')]();};}function respondWithResult(_0x488e06,_0x5bcd00){_0x5bcd00=_0x5bcd00||0xc8;return function(_0x19733a){if(_0x19733a){return _0x488e06[_0x321e('0x25')](_0x5bcd00)['json'](_0x19733a);}};}function respondWithFilteredResult(_0x1237c2,_0x118a1c){return function(_0x350c37){if(_0x350c37){var _0x4c8ee0=_0x350c37['count'],_0x59d061=_0x118a1c[_0x321e('0x27')],_0x34d9ea=_0x118a1c[_0x321e('0x27')]+_0x118a1c[_0x321e('0x28')],_0x51981f;if(_0x34d9ea>=_0x4c8ee0){_0x34d9ea=_0x4c8ee0;_0x51981f=0xc8;}else{_0x51981f=0xce;}_0x1237c2[_0x321e('0x25')](_0x51981f);return _0x1237c2[_0x321e('0x29')](_0x321e('0x2a'),_0x59d061+'-'+_0x34d9ea+'/'+_0x4c8ee0)[_0x321e('0x2b')](_0x350c37);}return null;};}function patchUpdates(_0x3d4b2f){return function(_0x477dff){try{jsonpatch[_0x321e('0x2c')](_0x477dff,_0x3d4b2f,!![]);}catch(_0x51e1dc){return BPromise['reject'](_0x51e1dc);}return _0x477dff[_0x321e('0x2d')]();};}function saveUpdates(_0x1848d5,_0x351cc5){return function(_0x32b9d3){if(_0x32b9d3){return _0x32b9d3['update'](_0x1848d5)[_0x321e('0x1b')](function(_0xc32538){return _0xc32538;});}return null;};}function removeEntity(_0x1164e3,_0x3eef7b){return function(_0x32cfe2){if(_0x32cfe2){return _0x32cfe2[_0x321e('0x2e')]()[_0x321e('0x1b')](function(){_0x1164e3[_0x321e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc83c82,_0x381d33){return function(_0x2890e6){if(!_0x2890e6){_0xc83c82[_0x321e('0x2f')](0x194);}return _0x2890e6;};}function handleError(_0x5c76de,_0x4b8210){_0x4b8210=_0x4b8210||0x1f4;return function(_0x33fcfa){logger[_0x321e('0x20')](_0x33fcfa[_0x321e('0x30')]);if(_0x33fcfa[_0x321e('0x31')]){delete _0x33fcfa[_0x321e('0x31')];}_0x5c76de[_0x321e('0x25')](_0x4b8210)[_0x321e('0x32')](_0x33fcfa);};}exports[_0x321e('0x33')]=function(_0xd10854,_0x5aaac0){var _0x3ef305={},_0x4be6ed={},_0x394600={'count':0x0,'rows':[]};var _0x5c5b55=db['ZohoAccount'][_0x321e('0x34')];_0x4be6ed['model']=_[_0x321e('0x35')](_0x5c5b55);_0x4be6ed[_0x321e('0x36')]=_['keys'](_0xd10854[_0x321e('0x36')]);_0x4be6ed[_0x321e('0x37')]=_[_0x321e('0x38')](_0x4be6ed[_0x321e('0x39')],_0x4be6ed[_0x321e('0x36')]);_0x3ef305[_0x321e('0x3a')]=_['intersection'](_0x4be6ed['model'],qs[_0x321e('0x3b')](_0xd10854['query'][_0x321e('0x3b')]));_0x3ef305[_0x321e('0x3a')]=_0x3ef305[_0x321e('0x3a')][_0x321e('0x3c')]?_0x3ef305[_0x321e('0x3a')]:_0x4be6ed['model'];if(!_0xd10854['query'][_0x321e('0x3d')](_0x321e('0x3e'))){_0x3ef305[_0x321e('0x28')]=qs['limit'](_0xd10854[_0x321e('0x36')][_0x321e('0x28')]);_0x3ef305[_0x321e('0x27')]=qs[_0x321e('0x27')](_0xd10854['query'][_0x321e('0x27')]);}_0x3ef305[_0x321e('0x3f')]=qs[_0x321e('0x40')](_0xd10854['query'][_0x321e('0x40')]);_0x3ef305[_0x321e('0x41')]=qs[_0x321e('0x37')](_[_0x321e('0x42')](_0xd10854[_0x321e('0x36')],_0x4be6ed[_0x321e('0x37')]));if(_0xd10854[_0x321e('0x36')][_0x321e('0x43')]){_0x3ef305[_0x321e('0x41')]=_[_0x321e('0x44')](_0x3ef305[_0x321e('0x41')],{'$or':_['map'](_0x5c5b55,function(_0x1bf59b){if(_0x1bf59b[_0x321e('0x45')][_0x321e('0x46')]!==_0x321e('0x47')){var _0x4abe2d={};_0x4abe2d[_0x1bf59b['field']]={'$like':'%'+_0xd10854[_0x321e('0x36')][_0x321e('0x43')]+'%'};return _0x4abe2d;}})});}_0x3ef305=_[_0x321e('0x44')]({},_0x3ef305,_0xd10854[_0x321e('0x48')]);var _0x4c1bad={'where':_0x3ef305[_0x321e('0x41')]};return db[_0x321e('0x49')]['count'](_0x4c1bad)['then'](function(_0xe6fdb7){_0x394600[_0x321e('0x4a')]=_0xe6fdb7;if(_0xd10854[_0x321e('0x36')][_0x321e('0x4b')]){_0x3ef305['include']=[{'all':!![]}];}return db[_0x321e('0x49')]['findAll'](_0x3ef305);})[_0x321e('0x1b')](function(_0x2955aa){_0x394600[_0x321e('0x4c')]=_0x2955aa;return _0x394600;})[_0x321e('0x1b')](respondWithFilteredResult(_0x5aaac0,_0x3ef305))[_0x321e('0x24')](handleError(_0x5aaac0,null));};exports[_0x321e('0x4d')]=function(_0x4a0a02,_0x540410){var _0x191750={'raw':![],'where':{'id':_0x4a0a02[_0x321e('0x4e')]['id']}},_0x2fd821={};_0x2fd821[_0x321e('0x39')]=_[_0x321e('0x35')](db['ZohoAccount']['rawAttributes']);_0x2fd821['query']=_[_0x321e('0x35')](_0x4a0a02[_0x321e('0x36')]);_0x2fd821[_0x321e('0x37')]=_[_0x321e('0x38')](_0x2fd821[_0x321e('0x39')],_0x2fd821[_0x321e('0x36')]);_0x191750[_0x321e('0x3a')]=_['intersection'](_0x2fd821[_0x321e('0x39')],qs[_0x321e('0x3b')](_0x4a0a02[_0x321e('0x36')][_0x321e('0x3b')]));_0x191750[_0x321e('0x3a')]=_0x191750[_0x321e('0x3a')][_0x321e('0x3c')]?_0x191750[_0x321e('0x3a')]:_0x2fd821[_0x321e('0x39')];if(_0x4a0a02['query'][_0x321e('0x4b')]){_0x191750[_0x321e('0x4f')]=[{'all':!![]}];}_0x191750=_[_0x321e('0x44')]({},_0x191750,_0x4a0a02[_0x321e('0x48')]);return db[_0x321e('0x49')][_0x321e('0x50')](_0x191750)[_0x321e('0x1b')](handleEntityNotFound(_0x540410,null))[_0x321e('0x1b')](respondWithResult(_0x540410,null))[_0x321e('0x24')](handleError(_0x540410,null));};exports[_0x321e('0x51')]=function(_0x36c231,_0x5219ae){return db[_0x321e('0x49')]['create'](_0x36c231[_0x321e('0x52')],{})[_0x321e('0x1b')](respondWithResult(_0x5219ae,0xc9))[_0x321e('0x24')](handleError(_0x5219ae,null));};exports[_0x321e('0x53')]=function(_0x189b20,_0xd19ac1){if(_0x189b20[_0x321e('0x52')]['id']){delete _0x189b20[_0x321e('0x52')]['id'];}return db[_0x321e('0x49')]['find']({'where':{'id':_0x189b20[_0x321e('0x4e')]['id']}})[_0x321e('0x1b')](handleEntityNotFound(_0xd19ac1,null))[_0x321e('0x1b')](saveUpdates(_0x189b20['body'],null))['then'](respondWithResult(_0xd19ac1,null))['catch'](handleError(_0xd19ac1,null));};exports[_0x321e('0x2e')]=function(_0x45bfdc,_0x570502){return db['ZohoAccount'][_0x321e('0x50')]({'where':{'id':_0x45bfdc[_0x321e('0x4e')]['id']}})[_0x321e('0x1b')](handleEntityNotFound(_0x570502,null))['then'](removeEntity(_0x570502,null))['catch'](handleError(_0x570502,null));};exports['getConfigurations']=function(_0x4ab1a1,_0x313cc3,_0x1f83d9){var _0x4c8773={};var _0x53ae62={};var _0x594767;var _0x4f8188;return db[_0x321e('0x49')][_0x321e('0x54')]({'where':{'id':_0x4ab1a1['params']['id']}})[_0x321e('0x1b')](handleEntityNotFound(_0x313cc3,null))[_0x321e('0x1b')](function(_0x3889b6){if(_0x3889b6){_0x594767=_0x3889b6;_0x53ae62[_0x321e('0x39')]=_[_0x321e('0x35')](db[_0x321e('0x55')][_0x321e('0x34')]);_0x53ae62['query']=_[_0x321e('0x35')](_0x4ab1a1['query']);_0x53ae62[_0x321e('0x37')]=_[_0x321e('0x38')](_0x53ae62[_0x321e('0x39')],_0x53ae62[_0x321e('0x36')]);_0x4c8773[_0x321e('0x3a')]=_[_0x321e('0x38')](_0x53ae62[_0x321e('0x39')],qs['fields'](_0x4ab1a1[_0x321e('0x36')][_0x321e('0x3b')]));_0x4c8773['attributes']=_0x4c8773[_0x321e('0x3a')][_0x321e('0x3c')]?_0x4c8773['attributes']:_0x53ae62[_0x321e('0x39')];_0x4c8773[_0x321e('0x3f')]=qs[_0x321e('0x40')](_0x4ab1a1[_0x321e('0x36')]['sort']);_0x4c8773[_0x321e('0x41')]=qs[_0x321e('0x37')](_[_0x321e('0x42')](_0x4ab1a1[_0x321e('0x36')],_0x53ae62[_0x321e('0x37')]));if(_0x4ab1a1['query'][_0x321e('0x43')]){_0x4c8773[_0x321e('0x41')]=_[_0x321e('0x44')](_0x4c8773['where'],{'$or':_['map'](_0x4c8773[_0x321e('0x3a')],function(_0x35e43f){var _0x3964dc={};_0x3964dc[_0x35e43f]={'$like':'%'+_0x4ab1a1[_0x321e('0x36')][_0x321e('0x43')]+'%'};return _0x3964dc;})});}_0x4c8773=_[_0x321e('0x44')]({},_0x4c8773,_0x4ab1a1[_0x321e('0x48')]);return _0x594767[_0x321e('0x56')](_0x4c8773);}})['then'](function(_0x11c929){if(_0x11c929){_0x4f8188=_0x11c929[_0x321e('0x3c')];if(!_0x4ab1a1[_0x321e('0x36')][_0x321e('0x3d')](_0x321e('0x3e'))){_0x4c8773[_0x321e('0x28')]=qs[_0x321e('0x28')](_0x4ab1a1[_0x321e('0x36')][_0x321e('0x28')]);_0x4c8773[_0x321e('0x27')]=qs['offset'](_0x4ab1a1['query'][_0x321e('0x27')]);}return _0x594767[_0x321e('0x56')](_0x4c8773);}})[_0x321e('0x1b')](function(_0x532373){if(_0x532373){return _0x532373?{'count':_0x4f8188,'rows':_0x532373}:null;}})[_0x321e('0x1b')](respondWithResult(_0x313cc3,null))[_0x321e('0x24')](handleError(_0x313cc3,null));};exports[_0x321e('0x57')]=function(_0x5cd57b,_0x511575,_0x4cf985){if(_0x5cd57b[_0x321e('0x52')]['id']){delete _0x5cd57b[_0x321e('0x52')]['id'];}return db[_0x321e('0x49')][_0x321e('0x54')]({'where':{'id':_0x5cd57b['params']['id']}})[_0x321e('0x1b')](handleEntityNotFound(_0x511575,null))[_0x321e('0x1b')](function(_0x4b880b){if(_0x4b880b){_0x5cd57b['body'][_0x321e('0x58')]=_0x4b880b['id'];_0x5cd57b[_0x321e('0x52')][_0x321e('0x59')]=integrations['getSubjects'](_0x5cd57b[_0x321e('0x52')][_0x321e('0x5a')],_0x5cd57b[_0x321e('0x52')][_0x321e('0x45')]);_0x5cd57b[_0x321e('0x52')]['Descriptions']=integrations[_0x321e('0x5b')](_0x5cd57b[_0x321e('0x52')][_0x321e('0x5a')],_0x5cd57b[_0x321e('0x52')][_0x321e('0x45')]);return db[_0x321e('0x55')]['create'](_0x5cd57b['body'],{'include':[{'model':db[_0x321e('0x5c')],'as':'Subjects'},{'model':db[_0x321e('0x5c')],'as':_0x321e('0x5d')}]});}return null;})[_0x321e('0x1b')](respondWithResult(_0x511575,null))[_0x321e('0x24')](handleError(_0x511575,null));};exports[_0x321e('0x5e')]=function(_0x4419c5,_0x4f889d,_0x3c555d){var _0x289a23='';return db['ZohoAccount'][_0x321e('0x54')]({'where':{'id':_0x4419c5[_0x321e('0x4e')]['id']},'attributes':['id','host',_0x321e('0x5f')]})[_0x321e('0x1b')](handleEntityNotFound(_0x4f889d,null))['then'](function(_0x4ba925){if(_0x4ba925){_0x289a23=_0x4ba925[_0x321e('0x60')];var _0x48b1e6=_0x289a23[_0x321e('0x61')](-0x1);if(_0x48b1e6==='/'){_0x289a23=_0x289a23[_0x321e('0x62')](0x0,_0x289a23[_0x321e('0x63')](_0x48b1e6));}return rp({'method':_0x321e('0x64'),'uri':util[_0x321e('0x65')](_0x321e('0x66'),_0x289a23),'qs':{'authtoken':_0x4ba925[_0x321e('0x5f')],'scope':_0x321e('0x67')},'json':!![]});}})[_0x321e('0x1b')](function(_0x206e6b){if(_0x206e6b){if(_0x206e6b['response']&&_0x206e6b[_0x321e('0x68')][_0x321e('0x20')]){throw new Error(_0x206e6b[_0x321e('0x68')][_0x321e('0x20')]['message']);}var _0x2420c5=[];if(_0x206e6b[_0x321e('0x69')]&&_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]){if(_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]['FL']){var _0x4979ff=[_0x321e('0x6b')];for(var _0x11469a=0x0,_0x2d93b3=_0x206e6b['Calls']['section']['FL']['length'];_0x11469a<_0x2d93b3;_0x11469a++){if(_['includes'](_0x4979ff,_0x206e6b['Calls']['section']['FL'][_0x11469a]['dv'])){_0x2420c5[_0x321e('0x6c')]({'id':_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]['FL'][_0x11469a]['dv'],'name':_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]['FL'][_0x11469a]['label'],'custom':_0x206e6b['Calls'][_0x321e('0x6a')]['FL'][_0x11469a][_0x321e('0x6d')]==='true'?!![]:![],'options':_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]['FL'][_0x11469a][_0x321e('0x45')]===_0x321e('0x6e')&&_0x206e6b[_0x321e('0x69')][_0x321e('0x6a')]['FL'][_0x11469a][_0x321e('0x6f')]?_['map'](_0x206e6b[_0x321e('0x69')]['section']['FL'][_0x11469a][_0x321e('0x6f')],function(_0x15f1ac){return{'name':_0x15f1ac,'value':_0x15f1ac};}):[]});}}}}return{'count':_0x2420c5[_0x321e('0x3c')],'rows':_0x2420c5};}})[_0x321e('0x1b')](respondWithResult(_0x4f889d,null))[_0x321e('0x24')](function(_0x383b17){var _0xc773c=_0x4419c5[_0x321e('0x36')][_0x321e('0x19')]?0x1f4:_0x383b17[_0x321e('0x70')]||0x1f4;logger[_0x321e('0x20')](_0x321e('0x71'),_0x321e('0x5e'),_0xc773c,JSON['stringify'](_0x383b17));delete _0x383b17['name'];if(_0xc773c===0x191){_0xc773c=0x190;}_0x4f889d[_0x321e('0x25')](_0xc773c)[_0x321e('0x32')](_0x4419c5[_0x321e('0x36')]['test']?{'message':_0x321e('0x72'),'statusCode':_0x383b17[_0x321e('0x70')]}:_0x383b17);});}; \ No newline at end of file +var _0x0956=['update','end','stack','send','index','model','query','keys','filters','intersection','attributes','fields','order','sort','merge','map','type','VIRTUAL','options','where','ZohoAccount','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','destroy','getConfigurations','findOne','length','pick','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','host','authToken','substring','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','section','Calls','Call\x20Purpose','includes','push','label','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','apply'];(function(_0x10c44d,_0x21bf2d){var _0x1c5ce1=function(_0x2eb4ef){while(--_0x2eb4ef){_0x10c44d['push'](_0x10c44d['shift']());}};_0x1c5ce1(++_0x21bf2d);}(_0x0956,0xbd));var _0x6095=function(_0x51b52b,_0xbdac2){_0x51b52b=_0x51b52b-0x0;var _0x1c2d37=_0x0956[_0x51b52b];return _0x1c2d37;};'use strict';var pdf=require(_0x6095('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6095('0x1'));var zipdir=require(_0x6095('0x2'));var jsonpatch=require(_0x6095('0x3'));var rp=require(_0x6095('0x4'));var moment=require(_0x6095('0x5'));var BPromise=require(_0x6095('0x6'));var Mustache=require(_0x6095('0x7'));var util=require(_0x6095('0x8'));var path=require(_0x6095('0x9'));var sox=require(_0x6095('0xa'));var csv=require(_0x6095('0xb'));var ejs=require(_0x6095('0xc'));var fs=require('fs');var _=require(_0x6095('0xd'));var squel=require(_0x6095('0xe'));var crypto=require(_0x6095('0xf'));var jsforce=require(_0x6095('0x10'));var deskjs=require(_0x6095('0x11'));var toCsv=require(_0x6095('0xb'));var querystring=require('querystring');var Papa=require(_0x6095('0x12'));var Redis=require('ioredis');var authService=require(_0x6095('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6095('0x14'));var logger=require('../../config/logger')(_0x6095('0x15'));var utils=require(_0x6095('0x16'));var config=require(_0x6095('0x17'));var db=require(_0x6095('0x18'))['db'];var integrations=require(_0x6095('0x19'));var jayson=require(_0x6095('0x1a'));var client=jayson[_0x6095('0x1b')][_0x6095('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x43a2e7,_0x59c929,_0x27e865){if(_0x27e865){var _0x2ad0d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ad0d2[_0x6095('0x1d')](_0x59c929)){return _0x43a2e7;}else{throw new Error(_0x6095('0x1e'));}}else{return _0x43a2e7;}}function respondWithRpcPromise(_0x2b48d5,_0x502233,_0x41340c,_0x105587){return new BPromise(function(_0x5ad90b,_0x8fa90){var _0x2d57a1=_0x105587||client;return _0x2d57a1[_0x6095('0x1f')](_0x2b48d5,_0x41340c)[_0x6095('0x20')](function(_0x12bfb6){logger[_0x6095('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x502233,_0x6095('0x22'));logger[_0x6095('0x23')](_0x6095('0x24'),_0x502233,_0x6095('0x22'),JSON[_0x6095('0x25')](_0x12bfb6));if(_0x12bfb6[_0x6095('0x26')]){if(_0x12bfb6[_0x6095('0x26')][_0x6095('0x27')]===0x1f4){logger[_0x6095('0x26')](_0x6095('0x28'),_0x502233,_0x12bfb6[_0x6095('0x26')][_0x6095('0x29')]);return _0x8fa90(_0x12bfb6[_0x6095('0x26')][_0x6095('0x29')]);}logger[_0x6095('0x26')](_0x6095('0x28'),_0x502233,_0x12bfb6[_0x6095('0x26')][_0x6095('0x29')]);return _0x5ad90b(_0x12bfb6['error'][_0x6095('0x29')]);}else{logger[_0x6095('0x21')](_0x6095('0x28'),_0x502233,'request\x20sent');_0x5ad90b(_0x12bfb6[_0x6095('0x2a')]['message']);}})[_0x6095('0x2b')](function(_0x42033a){logger[_0x6095('0x26')](_0x6095('0x28'),_0x502233,_0x42033a);_0x8fa90(_0x42033a);});});}function respondWithStatusCode(_0x2ad3aa,_0x415698){_0x415698=_0x415698||0xcc;return function(_0x5ca40c){if(_0x5ca40c){return _0x2ad3aa[_0x6095('0x2c')](_0x415698);}return _0x2ad3aa[_0x6095('0x2d')](_0x415698)['end']();};}function respondWithResult(_0x321a1e,_0xbf0c71){_0xbf0c71=_0xbf0c71||0xc8;return function(_0x24d12d){if(_0x24d12d){return _0x321a1e[_0x6095('0x2d')](_0xbf0c71)['json'](_0x24d12d);}};}function respondWithFilteredResult(_0x21658d,_0x26cd56){return function(_0xf33c24){if(_0xf33c24){var _0x57ee81=_0xf33c24[_0x6095('0x2e')],_0x273d09=_0x26cd56[_0x6095('0x2f')],_0x57acd1=_0x26cd56[_0x6095('0x2f')]+_0x26cd56[_0x6095('0x30')],_0x993f85;if(_0x57acd1>=_0x57ee81){_0x57acd1=_0x57ee81;_0x993f85=0xc8;}else{_0x993f85=0xce;}_0x21658d['status'](_0x993f85);return _0x21658d[_0x6095('0x31')]('Content-Range',_0x273d09+'-'+_0x57acd1+'/'+_0x57ee81)['json'](_0xf33c24);}return null;};}function patchUpdates(_0xdcfcd7){return function(_0x3ee1f5){try{jsonpatch[_0x6095('0x32')](_0x3ee1f5,_0xdcfcd7,!![]);}catch(_0x3a285e){return BPromise['reject'](_0x3a285e);}return _0x3ee1f5['save']();};}function saveUpdates(_0x594aed,_0x2f800f){return function(_0x83a2cd){if(_0x83a2cd){return _0x83a2cd[_0x6095('0x33')](_0x594aed)['then'](function(_0x57143c){return _0x57143c;});}return null;};}function removeEntity(_0x5a5a92,_0x51d4a8){return function(_0x464612){if(_0x464612){return _0x464612['destroy']()['then'](function(){_0x5a5a92[_0x6095('0x2d')](0xcc)[_0x6095('0x34')]();});}};}function handleEntityNotFound(_0x8fb925,_0x4c5d23){return function(_0x36e218){if(!_0x36e218){_0x8fb925[_0x6095('0x2c')](0x194);}return _0x36e218;};}function handleError(_0x46ca34,_0x373c4a){_0x373c4a=_0x373c4a||0x1f4;return function(_0x2e6c3d){logger[_0x6095('0x26')](_0x2e6c3d[_0x6095('0x35')]);if(_0x2e6c3d['name']){delete _0x2e6c3d['name'];}_0x46ca34[_0x6095('0x2d')](_0x373c4a)[_0x6095('0x36')](_0x2e6c3d);};}exports[_0x6095('0x37')]=function(_0x209160,_0x46b8ca){var _0x1e8a64={},_0x4bb9b1={},_0x5690d8={'count':0x0,'rows':[]};var _0x106901=db['ZohoAccount']['rawAttributes'];_0x4bb9b1[_0x6095('0x38')]=_['keys'](_0x106901);_0x4bb9b1[_0x6095('0x39')]=_[_0x6095('0x3a')](_0x209160[_0x6095('0x39')]);_0x4bb9b1[_0x6095('0x3b')]=_[_0x6095('0x3c')](_0x4bb9b1['model'],_0x4bb9b1[_0x6095('0x39')]);_0x1e8a64[_0x6095('0x3d')]=_[_0x6095('0x3c')](_0x4bb9b1[_0x6095('0x38')],qs['fields'](_0x209160[_0x6095('0x39')][_0x6095('0x3e')]));_0x1e8a64[_0x6095('0x3d')]=_0x1e8a64['attributes']['length']?_0x1e8a64[_0x6095('0x3d')]:_0x4bb9b1[_0x6095('0x38')];if(!_0x209160['query']['hasOwnProperty']('nolimit')){_0x1e8a64['limit']=qs[_0x6095('0x30')](_0x209160[_0x6095('0x39')][_0x6095('0x30')]);_0x1e8a64[_0x6095('0x2f')]=qs['offset'](_0x209160['query']['offset']);}_0x1e8a64[_0x6095('0x3f')]=qs[_0x6095('0x40')](_0x209160[_0x6095('0x39')][_0x6095('0x40')]);_0x1e8a64['where']=qs[_0x6095('0x3b')](_['pick'](_0x209160[_0x6095('0x39')],_0x4bb9b1[_0x6095('0x3b')]));if(_0x209160['query']['filter']){_0x1e8a64['where']=_[_0x6095('0x41')](_0x1e8a64['where'],{'$or':_[_0x6095('0x42')](_0x106901,function(_0x48e4c7){if(_0x48e4c7[_0x6095('0x43')]['key']!==_0x6095('0x44')){var _0x43cdea={};_0x43cdea[_0x48e4c7['field']]={'$like':'%'+_0x209160[_0x6095('0x39')]['filter']+'%'};return _0x43cdea;}})});}_0x1e8a64=_['merge']({},_0x1e8a64,_0x209160[_0x6095('0x45')]);var _0x597a27={'where':_0x1e8a64[_0x6095('0x46')]};return db[_0x6095('0x47')][_0x6095('0x2e')](_0x597a27)['then'](function(_0x94d3ef){_0x5690d8['count']=_0x94d3ef;if(_0x209160[_0x6095('0x39')]['includeAll']){_0x1e8a64[_0x6095('0x48')]=[{'all':!![]}];}return db[_0x6095('0x47')][_0x6095('0x49')](_0x1e8a64);})[_0x6095('0x20')](function(_0x20bf85){_0x5690d8[_0x6095('0x4a')]=_0x20bf85;return _0x5690d8;})[_0x6095('0x20')](respondWithFilteredResult(_0x46b8ca,_0x1e8a64))['catch'](handleError(_0x46b8ca,null));};exports[_0x6095('0x4b')]=function(_0x16ef84,_0x345871){var _0x44a9ab={'raw':![],'where':{'id':_0x16ef84[_0x6095('0x4c')]['id']}},_0x434cb0={};_0x434cb0[_0x6095('0x38')]=_[_0x6095('0x3a')](db[_0x6095('0x47')][_0x6095('0x4d')]);_0x434cb0[_0x6095('0x39')]=_[_0x6095('0x3a')](_0x16ef84[_0x6095('0x39')]);_0x434cb0[_0x6095('0x3b')]=_[_0x6095('0x3c')](_0x434cb0[_0x6095('0x38')],_0x434cb0[_0x6095('0x39')]);_0x44a9ab[_0x6095('0x3d')]=_[_0x6095('0x3c')](_0x434cb0[_0x6095('0x38')],qs[_0x6095('0x3e')](_0x16ef84[_0x6095('0x39')]['fields']));_0x44a9ab[_0x6095('0x3d')]=_0x44a9ab[_0x6095('0x3d')]['length']?_0x44a9ab[_0x6095('0x3d')]:_0x434cb0[_0x6095('0x38')];if(_0x16ef84[_0x6095('0x39')][_0x6095('0x4e')]){_0x44a9ab[_0x6095('0x48')]=[{'all':!![]}];}_0x44a9ab=_[_0x6095('0x41')]({},_0x44a9ab,_0x16ef84[_0x6095('0x45')]);return db['ZohoAccount'][_0x6095('0x4f')](_0x44a9ab)[_0x6095('0x20')](handleEntityNotFound(_0x345871,null))[_0x6095('0x20')](respondWithResult(_0x345871,null))[_0x6095('0x2b')](handleError(_0x345871,null));};exports['create']=function(_0x3c2811,_0x1e4396){return db[_0x6095('0x47')][_0x6095('0x50')](_0x3c2811[_0x6095('0x51')],{})[_0x6095('0x20')](respondWithResult(_0x1e4396,0xc9))[_0x6095('0x2b')](handleError(_0x1e4396,null));};exports[_0x6095('0x33')]=function(_0x174452,_0x4a394d){if(_0x174452[_0x6095('0x51')]['id']){delete _0x174452['body']['id'];}return db[_0x6095('0x47')][_0x6095('0x4f')]({'where':{'id':_0x174452[_0x6095('0x4c')]['id']}})[_0x6095('0x20')](handleEntityNotFound(_0x4a394d,null))[_0x6095('0x20')](saveUpdates(_0x174452['body'],null))[_0x6095('0x20')](respondWithResult(_0x4a394d,null))['catch'](handleError(_0x4a394d,null));};exports[_0x6095('0x52')]=function(_0x42f0b9,_0x9051eb){return db[_0x6095('0x47')][_0x6095('0x4f')]({'where':{'id':_0x42f0b9[_0x6095('0x4c')]['id']}})[_0x6095('0x20')](handleEntityNotFound(_0x9051eb,null))[_0x6095('0x20')](removeEntity(_0x9051eb,null))[_0x6095('0x2b')](handleError(_0x9051eb,null));};exports[_0x6095('0x53')]=function(_0x809c0e,_0x4c72c7,_0x1df0f2){var _0x6f170a={};var _0x1ffd78={};var _0x262234;var _0x159327;return db['ZohoAccount'][_0x6095('0x54')]({'where':{'id':_0x809c0e[_0x6095('0x4c')]['id']}})[_0x6095('0x20')](handleEntityNotFound(_0x4c72c7,null))[_0x6095('0x20')](function(_0x43160a){if(_0x43160a){_0x262234=_0x43160a;_0x1ffd78[_0x6095('0x38')]=_[_0x6095('0x3a')](db['ZohoConfiguration']['rawAttributes']);_0x1ffd78['query']=_[_0x6095('0x3a')](_0x809c0e['query']);_0x1ffd78[_0x6095('0x3b')]=_[_0x6095('0x3c')](_0x1ffd78[_0x6095('0x38')],_0x1ffd78[_0x6095('0x39')]);_0x6f170a[_0x6095('0x3d')]=_[_0x6095('0x3c')](_0x1ffd78[_0x6095('0x38')],qs[_0x6095('0x3e')](_0x809c0e['query'][_0x6095('0x3e')]));_0x6f170a[_0x6095('0x3d')]=_0x6f170a['attributes'][_0x6095('0x55')]?_0x6f170a[_0x6095('0x3d')]:_0x1ffd78['model'];_0x6f170a[_0x6095('0x3f')]=qs[_0x6095('0x40')](_0x809c0e[_0x6095('0x39')][_0x6095('0x40')]);_0x6f170a[_0x6095('0x46')]=qs['filters'](_[_0x6095('0x56')](_0x809c0e[_0x6095('0x39')],_0x1ffd78['filters']));if(_0x809c0e['query'][_0x6095('0x57')]){_0x6f170a['where']=_['merge'](_0x6f170a[_0x6095('0x46')],{'$or':_[_0x6095('0x42')](_0x6f170a[_0x6095('0x3d')],function(_0x48c1f5){var _0x23b4d7={};_0x23b4d7[_0x48c1f5]={'$like':'%'+_0x809c0e['query'][_0x6095('0x57')]+'%'};return _0x23b4d7;})});}_0x6f170a=_[_0x6095('0x41')]({},_0x6f170a,_0x809c0e[_0x6095('0x45')]);return _0x262234['getConfigurations'](_0x6f170a);}})['then'](function(_0x2f309e){if(_0x2f309e){_0x159327=_0x2f309e[_0x6095('0x55')];if(!_0x809c0e[_0x6095('0x39')][_0x6095('0x58')]('nolimit')){_0x6f170a[_0x6095('0x30')]=qs[_0x6095('0x30')](_0x809c0e['query'][_0x6095('0x30')]);_0x6f170a[_0x6095('0x2f')]=qs[_0x6095('0x2f')](_0x809c0e[_0x6095('0x39')]['offset']);}return _0x262234[_0x6095('0x53')](_0x6f170a);}})[_0x6095('0x20')](function(_0x4f30df){if(_0x4f30df){return _0x4f30df?{'count':_0x159327,'rows':_0x4f30df}:null;}})[_0x6095('0x20')](respondWithResult(_0x4c72c7,null))['catch'](handleError(_0x4c72c7,null));};exports[_0x6095('0x59')]=function(_0x2078db,_0xd4695a,_0x1e30d7){if(_0x2078db[_0x6095('0x51')]['id']){delete _0x2078db[_0x6095('0x51')]['id'];}return db[_0x6095('0x47')][_0x6095('0x54')]({'where':{'id':_0x2078db['params']['id']}})[_0x6095('0x20')](handleEntityNotFound(_0xd4695a,null))[_0x6095('0x20')](function(_0x516e33){if(_0x516e33){_0x2078db['body'][_0x6095('0x5a')]=_0x516e33['id'];_0x2078db['body'][_0x6095('0x5b')]=integrations[_0x6095('0x5c')](_0x2078db[_0x6095('0x51')][_0x6095('0x5d')],_0x2078db[_0x6095('0x51')][_0x6095('0x43')]);_0x2078db[_0x6095('0x51')][_0x6095('0x5e')]=integrations[_0x6095('0x5f')](_0x2078db['body']['channel'],_0x2078db[_0x6095('0x51')][_0x6095('0x43')]);return db['ZohoConfiguration'][_0x6095('0x50')](_0x2078db[_0x6095('0x51')],{'include':[{'model':db[_0x6095('0x60')],'as':'Subjects'},{'model':db[_0x6095('0x60')],'as':_0x6095('0x5e')}]});}return null;})[_0x6095('0x20')](respondWithResult(_0xd4695a,null))[_0x6095('0x2b')](handleError(_0xd4695a,null));};exports['getFields']=function(_0x3d88ed,_0x4cf850,_0x406999){var _0x4c1936='';return db[_0x6095('0x47')]['findOne']({'where':{'id':_0x3d88ed[_0x6095('0x4c')]['id']},'attributes':['id',_0x6095('0x61'),_0x6095('0x62')]})[_0x6095('0x20')](handleEntityNotFound(_0x4cf850,null))['then'](function(_0x35bf55){if(_0x35bf55){_0x4c1936=_0x35bf55[_0x6095('0x61')];var _0x5daf2e=_0x4c1936['slice'](-0x1);if(_0x5daf2e==='/'){_0x4c1936=_0x4c1936[_0x6095('0x63')](0x0,_0x4c1936[_0x6095('0x64')](_0x5daf2e));}return rp({'method':_0x6095('0x65'),'uri':util[_0x6095('0x66')](_0x6095('0x67'),_0x4c1936),'qs':{'authtoken':_0x35bf55[_0x6095('0x62')],'scope':_0x6095('0x68')},'json':!![]});}})[_0x6095('0x20')](function(_0x257cb2){if(_0x257cb2){if(_0x257cb2[_0x6095('0x69')]&&_0x257cb2[_0x6095('0x69')][_0x6095('0x26')]){throw new Error(_0x257cb2[_0x6095('0x69')]['error'][_0x6095('0x29')]);}var _0xe9f507=[];if(_0x257cb2['Calls']&&_0x257cb2['Calls'][_0x6095('0x6a')]){if(_0x257cb2[_0x6095('0x6b')][_0x6095('0x6a')]['FL']){var _0x5b9c0b=[_0x6095('0x6c')];for(var _0x1a7fa3=0x0,_0x58854e=_0x257cb2[_0x6095('0x6b')]['section']['FL']['length'];_0x1a7fa3<_0x58854e;_0x1a7fa3++){if(_[_0x6095('0x6d')](_0x5b9c0b,_0x257cb2[_0x6095('0x6b')][_0x6095('0x6a')]['FL'][_0x1a7fa3]['dv'])){_0xe9f507[_0x6095('0x6e')]({'id':_0x257cb2['Calls'][_0x6095('0x6a')]['FL'][_0x1a7fa3]['dv'],'name':_0x257cb2[_0x6095('0x6b')]['section']['FL'][_0x1a7fa3][_0x6095('0x6f')],'custom':_0x257cb2[_0x6095('0x6b')][_0x6095('0x6a')]['FL'][_0x1a7fa3][_0x6095('0x70')]===_0x6095('0x71')?!![]:![],'options':_0x257cb2['Calls'][_0x6095('0x6a')]['FL'][_0x1a7fa3][_0x6095('0x43')]===_0x6095('0x72')&&_0x257cb2[_0x6095('0x6b')]['section']['FL'][_0x1a7fa3][_0x6095('0x73')]?_[_0x6095('0x42')](_0x257cb2[_0x6095('0x6b')]['section']['FL'][_0x1a7fa3][_0x6095('0x73')],function(_0x329a3b){return{'name':_0x329a3b,'value':_0x329a3b};}):[]});}}}}return{'count':_0xe9f507['length'],'rows':_0xe9f507};}})['then'](respondWithResult(_0x4cf850,null))[_0x6095('0x2b')](function(_0x4968d1){var _0x3ead0c=_0x3d88ed[_0x6095('0x39')][_0x6095('0x1d')]?0x1f4:_0x4968d1[_0x6095('0x74')]||0x1f4;logger[_0x6095('0x26')](_0x6095('0x75'),_0x6095('0x76'),_0x3ead0c,JSON['stringify'](_0x4968d1));delete _0x4968d1['name'];if(_0x3ead0c===0x191){_0x3ead0c=0x190;}_0x4cf850[_0x6095('0x2d')](_0x3ead0c)[_0x6095('0x36')](_0x3d88ed[_0x6095('0x39')][_0x6095('0x1d')]?{'message':_0x6095('0x77'),'statusCode':_0x4968d1[_0x6095('0x74')]}:_0x4968d1);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0d727a0..18f27a6 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 _0x7fec=['int_zoho_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0x7fec,0x14b));var _0xc7fe=function(_0x4f44fa,_0x426680){_0x4f44fa=_0x4f44fa-0x0;var _0x27dd71=_0x7fec[_0x4f44fa];return _0x27dd71;};'use strict';var _=require(_0xc7fe('0x0'));var util=require(_0xc7fe('0x1'));var logger=require(_0xc7fe('0x2'))(_0xc7fe('0x3'));var moment=require(_0xc7fe('0x4'));var BPromise=require(_0xc7fe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7fe('0x6'));var rimraf=require(_0xc7fe('0x7'));var config=require(_0xc7fe('0x8'));var attributes=require(_0xc7fe('0x9'));var integrations=require(_0xc7fe('0xa'));module[_0xc7fe('0xb')]=function(_0x4de230,_0x55a0d3){return _0x4de230[_0xc7fe('0xc')](_0xc7fe('0xd'),attributes,{'tableName':_0xc7fe('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c4a=['../../config/environment','./intZohoAccount.attributes','define','int_zoho_accounts','../../config/logger','api','bluebird','rimraf'];(function(_0x59a086,_0xb2d894){var _0x1f3a42=function(_0x9fcb9b){while(--_0x9fcb9b){_0x59a086['push'](_0x59a086['shift']());}};_0x1f3a42(++_0xb2d894);}(_0x0c4a,0x17c));var _0xa0c4=function(_0x37fed4,_0x2b2029){_0x37fed4=_0x37fed4-0x0;var _0x13bbb0=_0x0c4a[_0x37fed4];return _0x13bbb0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa0c4('0x0'))(_0xa0c4('0x1'));var moment=require('moment');var BPromise=require(_0xa0c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa0c4('0x3'));var config=require(_0xa0c4('0x4'));var attributes=require(_0xa0c4('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xfcb753,_0x316f9b){return _0xfcb753[_0xa0c4('0x6')]('ZohoAccount',attributes,{'tableName':_0xa0c4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index e52e770..aa3fa1c 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 _0xf264=['attributes','limit','include','model','map','stringify','ShowZohoAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xf264,0xfd));var _0x4f26=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xf264[_0x351b46];return _0x1515df;};'use strict';var _=require(_0x4f26('0x0'));var util=require(_0x4f26('0x1'));var moment=require(_0x4f26('0x2'));var BPromise=require(_0x4f26('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f26('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f26('0x5'));var logger=require('../../config/logger')(_0x4f26('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f26('0x7'));var client=jayson[_0x4f26('0x8')][_0x4f26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x714d88,_0x1d47d5,_0x5f320a){return new BPromise(function(_0x4a8588,_0x243e54){return client[_0x4f26('0xa')](_0x714d88,_0x5f320a)[_0x4f26('0xb')](function(_0x1c97fc){logger[_0x4f26('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1d47d5,_0x4f26('0xd'));logger[_0x4f26('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x1d47d5,'request\x20sent',JSON['stringify'](_0x1c97fc));if(_0x1c97fc[_0x4f26('0xf')]){if(_0x1c97fc[_0x4f26('0xf')][_0x4f26('0x10')]===0x1f4){logger[_0x4f26('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x1d47d5,_0x1c97fc[_0x4f26('0xf')][_0x4f26('0x11')]);return _0x243e54(_0x1c97fc[_0x4f26('0xf')]['message']);}logger[_0x4f26('0xf')](_0x4f26('0x12'),_0x1d47d5,_0x1c97fc[_0x4f26('0xf')][_0x4f26('0x11')]);return _0x4a8588(_0x1c97fc[_0x4f26('0xf')]['message']);}else{logger[_0x4f26('0xc')](_0x4f26('0x12'),_0x1d47d5,'request\x20sent');_0x4a8588(_0x1c97fc[_0x4f26('0x13')][_0x4f26('0x11')]);}})[_0x4f26('0x14')](function(_0x544ebb){logger[_0x4f26('0xf')](_0x4f26('0x12'),_0x1d47d5,_0x544ebb);_0x243e54(_0x544ebb);});});}exports[_0x4f26('0x15')]=function(_0x593561){var _0x49069a=this;return new Promise(function(_0x5a8004,_0x53b74c){return db[_0x4f26('0x16')][_0x4f26('0x17')]({'raw':_0x593561[_0x4f26('0x18')]?_0x593561['options'][_0x4f26('0x19')]===undefined?!![]:![]:!![],'where':_0x593561[_0x4f26('0x18')]?_0x593561['options'][_0x4f26('0x1a')]||null:null,'attributes':_0x593561['options']?_0x593561[_0x4f26('0x18')][_0x4f26('0x1b')]||null:null,'limit':_0x593561['options']?_0x593561[_0x4f26('0x18')][_0x4f26('0x1c')]||null:null,'include':_0x593561[_0x4f26('0x18')]?_0x593561[_0x4f26('0x18')]['include']?_['map'](_0x593561[_0x4f26('0x18')][_0x4f26('0x1d')],function(_0x1717dd){return{'model':db[_0x1717dd[_0x4f26('0x1e')]],'as':_0x1717dd['as'],'attributes':_0x1717dd[_0x4f26('0x1b')],'include':_0x1717dd[_0x4f26('0x1d')]?_[_0x4f26('0x1f')](_0x1717dd[_0x4f26('0x1d')],function(_0x9fa472){return{'model':db[_0x9fa472[_0x4f26('0x1e')]],'as':_0x9fa472['as'],'attributes':_0x9fa472['attributes'],'include':_0x9fa472[_0x4f26('0x1d')]?_[_0x4f26('0x1f')](_0x9fa472[_0x4f26('0x1d')],function(_0x39f7a8){return{'model':db[_0x39f7a8[_0x4f26('0x1e')]],'as':_0x39f7a8['as'],'attributes':_0x39f7a8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f26('0xb')](function(_0x281e65){logger['info'](_0x4f26('0x15'),_0x593561);logger[_0x4f26('0xe')](_0x4f26('0x15'),_0x593561,JSON[_0x4f26('0x20')](_0x281e65));_0x5a8004(_0x281e65);})['catch'](function(_0x5351b7){logger[_0x4f26('0xf')](_0x4f26('0x15'),_0x5351b7[_0x4f26('0x11')],_0x593561);_0x53b74c(_0x49069a['error'](0x1f4,_0x5351b7['message']));});});};exports[_0x4f26('0x21')]=function(_0x3496ef){var _0x35d205=this;return new Promise(function(_0x58c529,_0xe780f8){return db['ZohoAccount'][_0x4f26('0x22')]({'raw':_0x3496ef['options']?_0x3496ef[_0x4f26('0x18')][_0x4f26('0x19')]===undefined?!![]:![]:!![],'where':_0x3496ef[_0x4f26('0x18')]?_0x3496ef['options'][_0x4f26('0x1a')]||null:null,'attributes':_0x3496ef[_0x4f26('0x18')]?_0x3496ef[_0x4f26('0x18')][_0x4f26('0x1b')]||null:null,'include':_0x3496ef['options']?_0x3496ef[_0x4f26('0x18')][_0x4f26('0x1d')]?_[_0x4f26('0x1f')](_0x3496ef['options'][_0x4f26('0x1d')],function(_0x8b8863){return{'model':db[_0x8b8863[_0x4f26('0x1e')]],'as':_0x8b8863['as'],'attributes':_0x8b8863['attributes'],'include':_0x8b8863['include']?_[_0x4f26('0x1f')](_0x8b8863['include'],function(_0x2df3dd){return{'model':db[_0x2df3dd['model']],'as':_0x2df3dd['as'],'attributes':_0x2df3dd[_0x4f26('0x1b')],'include':_0x2df3dd[_0x4f26('0x1d')]?_[_0x4f26('0x1f')](_0x2df3dd['include'],function(_0x14237b){return{'model':db[_0x14237b[_0x4f26('0x1e')]],'as':_0x14237b['as'],'attributes':_0x14237b[_0x4f26('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f26('0xb')](function(_0x1e71b1){logger[_0x4f26('0xc')]('ShowZohoAccount',_0x3496ef);logger[_0x4f26('0xe')]('ShowZohoAccount',_0x3496ef,JSON[_0x4f26('0x20')](_0x1e71b1));_0x58c529(_0x1e71b1);})[_0x4f26('0x14')](function(_0x2682e7){logger['error'](_0x4f26('0x21'),_0x2682e7[_0x4f26('0x11')],_0x3496ef);_0xe780f8(_0x35d205[_0x4f26('0xf')](0x1f4,_0x2682e7[_0x4f26('0x11')]));});});}; \ No newline at end of file +var _0x2d20=['client','http','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dd8ae,_0x28f7b0){var _0x3f9085=function(_0x5f1dee){while(--_0x5f1dee){_0x2dd8ae['push'](_0x2dd8ae['shift']());}};_0x3f9085(++_0x28f7b0);}(_0x2d20,0x1d1));var _0x02d2=function(_0x472f61,_0x1f7f39){_0x472f61=_0x472f61-0x0;var _0x18ef04=_0x2d20[_0x472f61];return _0x18ef04;};'use strict';var _=require(_0x02d2('0x0'));var util=require(_0x02d2('0x1'));var moment=require(_0x02d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x02d2('0x3'));var fs=require('fs');var Redis=require(_0x02d2('0x4'));var db=require(_0x02d2('0x5'))['db'];var utils=require(_0x02d2('0x6'));var logger=require(_0x02d2('0x7'))(_0x02d2('0x8'));var config=require(_0x02d2('0x9'));var jayson=require(_0x02d2('0xa'));var client=jayson[_0x02d2('0xb')][_0x02d2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e9660,_0x1c6af3,_0x5f30e0){return new BPromise(function(_0x5368bc,_0x40c0bf){return client['request'](_0x2e9660,_0x5f30e0)['then'](function(_0x184997){logger[_0x02d2('0xd')](_0x02d2('0xe'),_0x1c6af3,'request\x20sent');logger[_0x02d2('0xf')](_0x02d2('0x10'),_0x1c6af3,_0x02d2('0x11'),JSON[_0x02d2('0x12')](_0x184997));if(_0x184997[_0x02d2('0x13')]){if(_0x184997[_0x02d2('0x13')][_0x02d2('0x14')]===0x1f4){logger[_0x02d2('0x13')](_0x02d2('0xe'),_0x1c6af3,_0x184997['error'][_0x02d2('0x15')]);return _0x40c0bf(_0x184997[_0x02d2('0x13')][_0x02d2('0x15')]);}logger[_0x02d2('0x13')](_0x02d2('0xe'),_0x1c6af3,_0x184997[_0x02d2('0x13')][_0x02d2('0x15')]);return _0x5368bc(_0x184997[_0x02d2('0x13')][_0x02d2('0x15')]);}else{logger['info'](_0x02d2('0xe'),_0x1c6af3,'request\x20sent');_0x5368bc(_0x184997['result'][_0x02d2('0x15')]);}})['catch'](function(_0x59a71c){logger['error'](_0x02d2('0xe'),_0x1c6af3,_0x59a71c);_0x40c0bf(_0x59a71c);});});}exports[_0x02d2('0x16')]=function(_0x1812c6){var _0x13ad45=this;return new Promise(function(_0x318ead,_0x321fe8){return db[_0x02d2('0x17')]['findAll']({'raw':_0x1812c6[_0x02d2('0x18')]?_0x1812c6['options'][_0x02d2('0x19')]===undefined?!![]:![]:!![],'where':_0x1812c6[_0x02d2('0x18')]?_0x1812c6[_0x02d2('0x18')][_0x02d2('0x1a')]||null:null,'attributes':_0x1812c6['options']?_0x1812c6[_0x02d2('0x18')][_0x02d2('0x1b')]||null:null,'limit':_0x1812c6[_0x02d2('0x18')]?_0x1812c6['options'][_0x02d2('0x1c')]||null:null,'include':_0x1812c6[_0x02d2('0x18')]?_0x1812c6[_0x02d2('0x18')][_0x02d2('0x1d')]?_[_0x02d2('0x1e')](_0x1812c6[_0x02d2('0x18')][_0x02d2('0x1d')],function(_0x343675){return{'model':db[_0x343675[_0x02d2('0x1f')]],'as':_0x343675['as'],'attributes':_0x343675['attributes'],'include':_0x343675['include']?_[_0x02d2('0x1e')](_0x343675[_0x02d2('0x1d')],function(_0x4572ca){return{'model':db[_0x4572ca[_0x02d2('0x1f')]],'as':_0x4572ca['as'],'attributes':_0x4572ca['attributes'],'include':_0x4572ca['include']?_[_0x02d2('0x1e')](_0x4572ca[_0x02d2('0x1d')],function(_0x2b7bbb){return{'model':db[_0x2b7bbb[_0x02d2('0x1f')]],'as':_0x2b7bbb['as'],'attributes':_0x2b7bbb[_0x02d2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d378){logger[_0x02d2('0xd')](_0x02d2('0x16'),_0x1812c6);logger['debug'](_0x02d2('0x16'),_0x1812c6,JSON[_0x02d2('0x12')](_0x42d378));_0x318ead(_0x42d378);})[_0x02d2('0x20')](function(_0x439723){logger[_0x02d2('0x13')]('GetZohoAccount',_0x439723['message'],_0x1812c6);_0x321fe8(_0x13ad45[_0x02d2('0x13')](0x1f4,_0x439723[_0x02d2('0x15')]));});});};exports[_0x02d2('0x21')]=function(_0x533e58){var _0x36e6b1=this;return new Promise(function(_0x5ea1c8,_0x5d789a){return db[_0x02d2('0x17')]['find']({'raw':_0x533e58['options']?_0x533e58[_0x02d2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x533e58[_0x02d2('0x18')]?_0x533e58['options'][_0x02d2('0x1a')]||null:null,'attributes':_0x533e58[_0x02d2('0x18')]?_0x533e58[_0x02d2('0x18')][_0x02d2('0x1b')]||null:null,'include':_0x533e58['options']?_0x533e58[_0x02d2('0x18')][_0x02d2('0x1d')]?_[_0x02d2('0x1e')](_0x533e58[_0x02d2('0x18')][_0x02d2('0x1d')],function(_0x22655b){return{'model':db[_0x22655b[_0x02d2('0x1f')]],'as':_0x22655b['as'],'attributes':_0x22655b[_0x02d2('0x1b')],'include':_0x22655b[_0x02d2('0x1d')]?_[_0x02d2('0x1e')](_0x22655b[_0x02d2('0x1d')],function(_0x58dbef){return{'model':db[_0x58dbef[_0x02d2('0x1f')]],'as':_0x58dbef['as'],'attributes':_0x58dbef[_0x02d2('0x1b')],'include':_0x58dbef['include']?_[_0x02d2('0x1e')](_0x58dbef[_0x02d2('0x1d')],function(_0x4d4cb1){return{'model':db[_0x4d4cb1['model']],'as':_0x4d4cb1['as'],'attributes':_0x4d4cb1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x148a13){logger[_0x02d2('0xd')](_0x02d2('0x21'),_0x533e58);logger['debug'](_0x02d2('0x21'),_0x533e58,JSON[_0x02d2('0x12')](_0x148a13));_0x5ea1c8(_0x148a13);})[_0x02d2('0x20')](function(_0x5815a8){logger[_0x02d2('0x13')](_0x02d2('0x21'),_0x5815a8['message'],_0x533e58);_0x5d789a(_0x36e6b1[_0x02d2('0x13')](0x1f4,_0x5815a8[_0x02d2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9bea7a9..104da5b 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 _0x5ebe=['index','/:id','show','getSubjects','getDescriptions','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe5eb('0x0'));var path=require(_0xe5eb('0x1'));var timeout=require(_0xe5eb('0x2'));var express=require(_0xe5eb('0x3'));var router=express[_0xe5eb('0x4')]();var auth=require(_0xe5eb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe5eb('0x6'));router[_0xe5eb('0x7')]('/',auth[_0xe5eb('0x8')](),controller[_0xe5eb('0x9')]);router[_0xe5eb('0x7')](_0xe5eb('0xa'),auth[_0xe5eb('0x8')](),controller[_0xe5eb('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xe5eb('0x7')]('/:id/subjects',auth[_0xe5eb('0x8')](),controller[_0xe5eb('0xc')]);router[_0xe5eb('0x7')]('/:id/descriptions',auth[_0xe5eb('0x8')](),controller[_0xe5eb('0xd')]);router[_0xe5eb('0xe')]('/',auth[_0xe5eb('0x8')](),controller[_0xe5eb('0xf')]);router['put'](_0xe5eb('0xa'),auth[_0xe5eb('0x8')](),controller[_0xe5eb('0x10')]);router['delete']('/:id',auth[_0xe5eb('0x8')](),controller[_0xe5eb('0x11')]);module[_0xe5eb('0x12')]=router; \ No newline at end of file +var _0x9ffd=['/:id/fields','getFields','/:id/subjects','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','/:id','isAuthenticated','get'];(function(_0x5916f8,_0x1fa584){var _0x5751ed=function(_0x5806a9){while(--_0x5806a9){_0x5916f8['push'](_0x5916f8['shift']());}};_0x5751ed(++_0x1fa584);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x99fa79,_0x152b6c){_0x99fa79=_0x99fa79-0x0;var _0x546c65=_0x9ffd[_0x99fa79];return _0x546c65;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require(_0xd9ff('0x3'));var express=require('express');var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router['get'](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller['show']);router[_0xd9ff('0xc')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['get'](_0xd9ff('0xf'),auth[_0xd9ff('0xb')](),controller['getSubjects']);router[_0xd9ff('0xc')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x10')]);router[_0xd9ff('0x11')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x12')]);router[_0xd9ff('0x13')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x14')]);module[_0xd9ff('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 845e9f9..bb1ffa7 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 _0x8bbf=['sequelize','exports','STRING'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x8bbf,0x1c2));var _0xf8bb=function(_0x2a8250,_0x2bf826){_0x2a8250=_0x2a8250-0x0;var _0x24a6e8=_0x8bbf[_0x2a8250];return _0x24a6e8;};'use strict';var Sequelize=require(_0xf8bb('0x0'));module[_0xf8bb('0x1')]={'name':{'type':Sequelize[_0xf8bb('0x2')]},'description':{'type':Sequelize[_0xf8bb('0x2')]}}; \ No newline at end of file +var _0x79a5=['STRING','sequelize','exports'];(function(_0x378baa,_0x58e216){var _0xbb3cef=function(_0x18e4ed){while(--_0x18e4ed){_0x378baa['push'](_0x378baa['shift']());}};_0xbb3cef(++_0x58e216);}(_0x79a5,0xd0));var _0x579a=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x79a5[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x579a('0x0'));module[_0x579a('0x1')]={'name':{'type':Sequelize[_0x579a('0x2')]},'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 26bcde2..0c6efbf 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 _0xb406=['status','end','json','count','offset','limit','reject','destroy','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','field','options','ZohoConfiguration','include','rows','catch','params','includeAll','merge','create','body','update','find','getFields','ZohoField','length','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb406,0xd1));var _0x6b40=function(_0x2d9b31,_0x22393b){_0x2d9b31=_0x2d9b31-0x0;var _0x534d1b=_0xb406[_0x2d9b31];return _0x534d1b;};'use strict';var pdf=require(_0x6b40('0x0'));var emlformat=require(_0x6b40('0x1'));var rimraf=require(_0x6b40('0x2'));var zipdir=require(_0x6b40('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b40('0x4'));var BPromise=require(_0x6b40('0x5'));var Mustache=require(_0x6b40('0x6'));var util=require(_0x6b40('0x7'));var path=require('path');var sox=require(_0x6b40('0x8'));var csv=require(_0x6b40('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b40('0xa'));var jsforce=require(_0x6b40('0xb'));var deskjs=require(_0x6b40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6b40('0xd'));var Papa=require('papaparse');var Redis=require(_0x6b40('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b40('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b40('0x10'))('api');var utils=require(_0x6b40('0x11'));var config=require(_0x6b40('0x12'));var db=require(_0x6b40('0x13'))['db'];var jayson=require(_0x6b40('0x14'));var client=jayson['client'][_0x6b40('0x15')]({'port':0x232a});function checkPasswordPattern(_0x14bd3c,_0x4cd350,_0x26af53){if(_0x26af53){var _0x191bd5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x191bd5['test'](_0x4cd350)){return _0x14bd3c;}else{throw new Error(_0x6b40('0x16'));}}else{return _0x14bd3c;}}function respondWithRpcPromise(_0x4b28b4,_0x2fd573,_0x37b06d,_0x86e318){return new BPromise(function(_0x519d97,_0x444143){var _0x11ad99=_0x86e318||client;return _0x11ad99['request'](_0x4b28b4,_0x37b06d)[_0x6b40('0x17')](function(_0x5e985f){logger[_0x6b40('0x18')](_0x6b40('0x19'),_0x2fd573,_0x6b40('0x1a'));logger[_0x6b40('0x1b')](_0x6b40('0x1c'),_0x2fd573,'request\x20sent',JSON[_0x6b40('0x1d')](_0x5e985f));if(_0x5e985f[_0x6b40('0x1e')]){if(_0x5e985f[_0x6b40('0x1e')][_0x6b40('0x1f')]===0x1f4){logger[_0x6b40('0x1e')](_0x6b40('0x19'),_0x2fd573,_0x5e985f['error'][_0x6b40('0x20')]);return _0x444143(_0x5e985f[_0x6b40('0x1e')][_0x6b40('0x20')]);}logger[_0x6b40('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x2fd573,_0x5e985f[_0x6b40('0x1e')][_0x6b40('0x20')]);return _0x519d97(_0x5e985f[_0x6b40('0x1e')][_0x6b40('0x20')]);}else{logger[_0x6b40('0x18')](_0x6b40('0x19'),_0x2fd573,_0x6b40('0x1a'));_0x519d97(_0x5e985f['result']['message']);}})['catch'](function(_0x1401b7){logger[_0x6b40('0x1e')](_0x6b40('0x19'),_0x2fd573,_0x1401b7);_0x444143(_0x1401b7);});});}function respondWithStatusCode(_0x4a9328,_0x3b17d9){_0x3b17d9=_0x3b17d9||0xcc;return function(_0x49b25c){if(_0x49b25c){return _0x4a9328[_0x6b40('0x21')](_0x3b17d9);}return _0x4a9328[_0x6b40('0x22')](_0x3b17d9)[_0x6b40('0x23')]();};}function respondWithResult(_0x2984c0,_0x22892d){_0x22892d=_0x22892d||0xc8;return function(_0x18312a){if(_0x18312a){return _0x2984c0[_0x6b40('0x22')](_0x22892d)[_0x6b40('0x24')](_0x18312a);}};}function respondWithFilteredResult(_0x3a1f5e,_0x1f6b80){return function(_0x6c4ddd){if(_0x6c4ddd){var _0x5b5f6f=_0x6c4ddd[_0x6b40('0x25')],_0x56f59c=_0x1f6b80[_0x6b40('0x26')],_0x4da483=_0x1f6b80[_0x6b40('0x26')]+_0x1f6b80[_0x6b40('0x27')],_0x660957;if(_0x4da483>=_0x5b5f6f){_0x4da483=_0x5b5f6f;_0x660957=0xc8;}else{_0x660957=0xce;}_0x3a1f5e[_0x6b40('0x22')](_0x660957);return _0x3a1f5e['set']('Content-Range',_0x56f59c+'-'+_0x4da483+'/'+_0x5b5f6f)[_0x6b40('0x24')](_0x6c4ddd);}return null;};}function patchUpdates(_0x59e16e){return function(_0x4a29a5){try{jsonpatch['apply'](_0x4a29a5,_0x59e16e,!![]);}catch(_0x2380f5){return BPromise[_0x6b40('0x28')](_0x2380f5);}return _0x4a29a5['save']();};}function saveUpdates(_0x3abcc4,_0x5a8687){return function(_0x164dde){if(_0x164dde){return _0x164dde['update'](_0x3abcc4)[_0x6b40('0x17')](function(_0x4ad2b9){return _0x4ad2b9;});}return null;};}function removeEntity(_0x389770,_0x5702bd){return function(_0x5994de){if(_0x5994de){return _0x5994de[_0x6b40('0x29')]()[_0x6b40('0x17')](function(){_0x389770[_0x6b40('0x22')](0xcc)[_0x6b40('0x23')]();});}};}function handleEntityNotFound(_0x5069d2,_0x4b2994){return function(_0x38a796){if(!_0x38a796){_0x5069d2[_0x6b40('0x21')](0x194);}return _0x38a796;};}function handleError(_0x34b7e9,_0x55a091){_0x55a091=_0x55a091||0x1f4;return function(_0x168f8e){logger['error'](_0x168f8e[_0x6b40('0x2a')]);if(_0x168f8e[_0x6b40('0x2b')]){delete _0x168f8e[_0x6b40('0x2b')];}_0x34b7e9[_0x6b40('0x22')](_0x55a091)[_0x6b40('0x2c')](_0x168f8e);};}exports[_0x6b40('0x2d')]=function(_0x4864f4,_0x43898f){var _0x5305bc={},_0x31ed41={},_0x183093={'count':0x0,'rows':[]};var _0xa126b9=db['ZohoConfiguration'][_0x6b40('0x2e')];_0x31ed41[_0x6b40('0x2f')]=_[_0x6b40('0x30')](_0xa126b9);_0x31ed41[_0x6b40('0x31')]=_[_0x6b40('0x30')](_0x4864f4['query']);_0x31ed41['filters']=_[_0x6b40('0x32')](_0x31ed41[_0x6b40('0x2f')],_0x31ed41[_0x6b40('0x31')]);_0x5305bc['attributes']=_[_0x6b40('0x32')](_0x31ed41[_0x6b40('0x2f')],qs[_0x6b40('0x33')](_0x4864f4[_0x6b40('0x31')]['fields']));_0x5305bc[_0x6b40('0x34')]=_0x5305bc[_0x6b40('0x34')]['length']?_0x5305bc[_0x6b40('0x34')]:_0x31ed41[_0x6b40('0x2f')];if(!_0x4864f4[_0x6b40('0x31')][_0x6b40('0x35')](_0x6b40('0x36'))){_0x5305bc[_0x6b40('0x27')]=qs[_0x6b40('0x27')](_0x4864f4['query']['limit']);_0x5305bc[_0x6b40('0x26')]=qs[_0x6b40('0x26')](_0x4864f4[_0x6b40('0x31')][_0x6b40('0x26')]);}_0x5305bc[_0x6b40('0x37')]=qs[_0x6b40('0x38')](_0x4864f4[_0x6b40('0x31')][_0x6b40('0x38')]);_0x5305bc[_0x6b40('0x39')]=qs[_0x6b40('0x3a')](_[_0x6b40('0x3b')](_0x4864f4['query'],_0x31ed41['filters']));if(_0x4864f4['query'][_0x6b40('0x3c')]){_0x5305bc['where']=_['merge'](_0x5305bc[_0x6b40('0x39')],{'$or':_[_0x6b40('0x3d')](_0xa126b9,function(_0x973505){if(_0x973505['type']['key']!=='VIRTUAL'){var _0x53d62f={};_0x53d62f[_0x973505[_0x6b40('0x3e')]]={'$like':'%'+_0x4864f4[_0x6b40('0x31')][_0x6b40('0x3c')]+'%'};return _0x53d62f;}})});}_0x5305bc=_['merge']({},_0x5305bc,_0x4864f4[_0x6b40('0x3f')]);var _0x89ede4={'where':_0x5305bc[_0x6b40('0x39')]};return db[_0x6b40('0x40')]['count'](_0x89ede4)[_0x6b40('0x17')](function(_0x92fd0e){_0x183093[_0x6b40('0x25')]=_0x92fd0e;if(_0x4864f4[_0x6b40('0x31')]['includeAll']){_0x5305bc[_0x6b40('0x41')]=[{'all':!![]}];}return db[_0x6b40('0x40')]['findAll'](_0x5305bc);})['then'](function(_0x2ab3f8){_0x183093[_0x6b40('0x42')]=_0x2ab3f8;return _0x183093;})[_0x6b40('0x17')](respondWithFilteredResult(_0x43898f,_0x5305bc))[_0x6b40('0x43')](handleError(_0x43898f,null));};exports['show']=function(_0x375e78,_0x39c1e4){var _0x776b13={'raw':![],'where':{'id':_0x375e78[_0x6b40('0x44')]['id']}},_0x404682={};_0x404682[_0x6b40('0x2f')]=_[_0x6b40('0x30')](db[_0x6b40('0x40')][_0x6b40('0x2e')]);_0x404682[_0x6b40('0x31')]=_[_0x6b40('0x30')](_0x375e78[_0x6b40('0x31')]);_0x404682[_0x6b40('0x3a')]=_[_0x6b40('0x32')](_0x404682[_0x6b40('0x2f')],_0x404682[_0x6b40('0x31')]);_0x776b13[_0x6b40('0x34')]=_['intersection'](_0x404682['model'],qs[_0x6b40('0x33')](_0x375e78[_0x6b40('0x31')][_0x6b40('0x33')]));_0x776b13['attributes']=_0x776b13[_0x6b40('0x34')]['length']?_0x776b13['attributes']:_0x404682[_0x6b40('0x2f')];if(_0x375e78[_0x6b40('0x31')][_0x6b40('0x45')]){_0x776b13[_0x6b40('0x41')]=[{'all':!![]}];}_0x776b13=_[_0x6b40('0x46')]({},_0x776b13,_0x375e78[_0x6b40('0x3f')]);return db[_0x6b40('0x40')]['find'](_0x776b13)[_0x6b40('0x17')](handleEntityNotFound(_0x39c1e4,null))[_0x6b40('0x17')](respondWithResult(_0x39c1e4,null))[_0x6b40('0x43')](handleError(_0x39c1e4,null));};exports[_0x6b40('0x47')]=function(_0x200af1,_0xf76d16){return db['ZohoConfiguration'][_0x6b40('0x47')](_0x200af1[_0x6b40('0x48')],{})[_0x6b40('0x17')](respondWithResult(_0xf76d16,0xc9))[_0x6b40('0x43')](handleError(_0xf76d16,null));};exports[_0x6b40('0x49')]=function(_0xb8b7c5,_0x24ab4a){if(_0xb8b7c5[_0x6b40('0x48')]['id']){delete _0xb8b7c5[_0x6b40('0x48')]['id'];}return db['ZohoConfiguration'][_0x6b40('0x4a')]({'where':{'id':_0xb8b7c5['params']['id']}})[_0x6b40('0x17')](handleEntityNotFound(_0x24ab4a,null))[_0x6b40('0x17')](saveUpdates(_0xb8b7c5[_0x6b40('0x48')],null))[_0x6b40('0x17')](respondWithResult(_0x24ab4a,null))[_0x6b40('0x43')](handleError(_0x24ab4a,null));};exports['destroy']=function(_0x52ea07,_0x57b973){return db[_0x6b40('0x40')][_0x6b40('0x4a')]({'where':{'id':_0x52ea07[_0x6b40('0x44')]['id']}})['then'](handleEntityNotFound(_0x57b973,null))[_0x6b40('0x17')](removeEntity(_0x57b973,null))['catch'](handleError(_0x57b973,null));};exports[_0x6b40('0x4b')]=function(_0x48a2b7,_0x5b9126,_0x35ebff){var _0x364079={};var _0x54d23e={};var _0x91df37;var _0x2552c1;return db[_0x6b40('0x40')]['findOne']({'where':{'id':_0x48a2b7['params']['id']}})['then'](handleEntityNotFound(_0x5b9126,null))[_0x6b40('0x17')](function(_0x3dc7f0){if(_0x3dc7f0){_0x91df37=_0x3dc7f0;_0x54d23e['model']=_[_0x6b40('0x30')](db[_0x6b40('0x4c')][_0x6b40('0x2e')]);_0x54d23e['query']=_[_0x6b40('0x30')](_0x48a2b7[_0x6b40('0x31')]);_0x54d23e[_0x6b40('0x3a')]=_['intersection'](_0x54d23e['model'],_0x54d23e[_0x6b40('0x31')]);_0x364079[_0x6b40('0x34')]=_[_0x6b40('0x32')](_0x54d23e[_0x6b40('0x2f')],qs['fields'](_0x48a2b7['query']['fields']));_0x364079[_0x6b40('0x34')]=_0x364079[_0x6b40('0x34')][_0x6b40('0x4d')]?_0x364079['attributes']:_0x54d23e[_0x6b40('0x2f')];_0x364079[_0x6b40('0x37')]=qs[_0x6b40('0x38')](_0x48a2b7[_0x6b40('0x31')]['sort']);_0x364079[_0x6b40('0x39')]=qs['filters'](_[_0x6b40('0x3b')](_0x48a2b7[_0x6b40('0x31')],_0x54d23e['filters']));if(_0x48a2b7['query'][_0x6b40('0x3c')]){_0x364079[_0x6b40('0x39')]=_[_0x6b40('0x46')](_0x364079['where'],{'$or':_[_0x6b40('0x3d')](_0x364079[_0x6b40('0x34')],function(_0x12992d){var _0x1ca2a0={};_0x1ca2a0[_0x12992d]={'$like':'%'+_0x48a2b7[_0x6b40('0x31')][_0x6b40('0x3c')]+'%'};return _0x1ca2a0;})});}_0x364079=_[_0x6b40('0x46')]({},_0x364079,_0x48a2b7[_0x6b40('0x3f')]);return _0x91df37[_0x6b40('0x4b')](_0x364079);}})['then'](function(_0x49805a){if(_0x49805a){_0x2552c1=_0x49805a['length'];if(!_0x48a2b7[_0x6b40('0x31')][_0x6b40('0x35')](_0x6b40('0x36'))){_0x364079[_0x6b40('0x27')]=qs[_0x6b40('0x27')](_0x48a2b7['query'][_0x6b40('0x27')]);_0x364079[_0x6b40('0x26')]=qs[_0x6b40('0x26')](_0x48a2b7['query'][_0x6b40('0x26')]);}return _0x91df37[_0x6b40('0x4b')](_0x364079);}})['then'](function(_0x7e96ed){if(_0x7e96ed){return _0x7e96ed?{'count':_0x2552c1,'rows':_0x7e96ed}:null;}})[_0x6b40('0x17')](respondWithResult(_0x5b9126,null))[_0x6b40('0x43')](handleError(_0x5b9126,null));};exports[_0x6b40('0x4e')]=function(_0x42f63b,_0x254b12,_0x2c7a23){var _0x4cd124={};var _0x10a877={};var _0x1dfc8a;var _0x11ce7e;return db[_0x6b40('0x40')]['findOne']({'where':{'id':_0x42f63b[_0x6b40('0x44')]['id']}})[_0x6b40('0x17')](handleEntityNotFound(_0x254b12,null))[_0x6b40('0x17')](function(_0x703b31){if(_0x703b31){_0x1dfc8a=_0x703b31;_0x10a877[_0x6b40('0x2f')]=_[_0x6b40('0x30')](db['ZohoField'][_0x6b40('0x2e')]);_0x10a877['query']=_[_0x6b40('0x30')](_0x42f63b[_0x6b40('0x31')]);_0x10a877['filters']=_['intersection'](_0x10a877[_0x6b40('0x2f')],_0x10a877[_0x6b40('0x31')]);_0x4cd124['attributes']=_[_0x6b40('0x32')](_0x10a877['model'],qs['fields'](_0x42f63b[_0x6b40('0x31')]['fields']));_0x4cd124['attributes']=_0x4cd124[_0x6b40('0x34')][_0x6b40('0x4d')]?_0x4cd124[_0x6b40('0x34')]:_0x10a877[_0x6b40('0x2f')];_0x4cd124['order']=qs[_0x6b40('0x38')](_0x42f63b[_0x6b40('0x31')]['sort']);_0x4cd124[_0x6b40('0x39')]=qs[_0x6b40('0x3a')](_[_0x6b40('0x3b')](_0x42f63b['query'],_0x10a877[_0x6b40('0x3a')]));if(_0x42f63b[_0x6b40('0x31')]['filter']){_0x4cd124[_0x6b40('0x39')]=_[_0x6b40('0x46')](_0x4cd124[_0x6b40('0x39')],{'$or':_[_0x6b40('0x3d')](_0x4cd124[_0x6b40('0x34')],function(_0x37f233){var _0x503fac={};_0x503fac[_0x37f233]={'$like':'%'+_0x42f63b['query'][_0x6b40('0x3c')]+'%'};return _0x503fac;})});}_0x4cd124=_['merge']({},_0x4cd124,_0x42f63b[_0x6b40('0x3f')]);return _0x1dfc8a[_0x6b40('0x4e')](_0x4cd124);}})[_0x6b40('0x17')](function(_0x2ad703){if(_0x2ad703){_0x11ce7e=_0x2ad703[_0x6b40('0x4d')];if(!_0x42f63b[_0x6b40('0x31')]['hasOwnProperty'](_0x6b40('0x36'))){_0x4cd124[_0x6b40('0x27')]=qs[_0x6b40('0x27')](_0x42f63b['query'][_0x6b40('0x27')]);_0x4cd124[_0x6b40('0x26')]=qs['offset'](_0x42f63b['query'][_0x6b40('0x26')]);}return _0x1dfc8a[_0x6b40('0x4e')](_0x4cd124);}})[_0x6b40('0x17')](function(_0x5c2e31){if(_0x5c2e31){return _0x5c2e31?{'count':_0x11ce7e,'rows':_0x5c2e31}:null;}})['then'](respondWithResult(_0x254b12,null))[_0x6b40('0x43')](handleError(_0x254b12,null));};exports[_0x6b40('0x4f')]=function(_0x3e2bae,_0x12012e,_0x3239b9){var _0x351208={};var _0x402fa3={};var _0x1072cf;var _0x1841de;return db[_0x6b40('0x40')][_0x6b40('0x50')]({'where':{'id':_0x3e2bae[_0x6b40('0x44')]['id']}})[_0x6b40('0x17')](handleEntityNotFound(_0x12012e,null))[_0x6b40('0x17')](function(_0x1c851c){if(_0x1c851c){_0x1072cf=_0x1c851c;_0x402fa3[_0x6b40('0x2f')]=_[_0x6b40('0x30')](db[_0x6b40('0x4c')][_0x6b40('0x2e')]);_0x402fa3[_0x6b40('0x31')]=_[_0x6b40('0x30')](_0x3e2bae[_0x6b40('0x31')]);_0x402fa3[_0x6b40('0x3a')]=_['intersection'](_0x402fa3[_0x6b40('0x2f')],_0x402fa3[_0x6b40('0x31')]);_0x351208[_0x6b40('0x34')]=_[_0x6b40('0x32')](_0x402fa3[_0x6b40('0x2f')],qs[_0x6b40('0x33')](_0x3e2bae[_0x6b40('0x31')][_0x6b40('0x33')]));_0x351208[_0x6b40('0x34')]=_0x351208[_0x6b40('0x34')][_0x6b40('0x4d')]?_0x351208[_0x6b40('0x34')]:_0x402fa3[_0x6b40('0x2f')];_0x351208[_0x6b40('0x37')]=qs['sort'](_0x3e2bae['query'][_0x6b40('0x38')]);_0x351208[_0x6b40('0x39')]=qs[_0x6b40('0x3a')](_[_0x6b40('0x3b')](_0x3e2bae['query'],_0x402fa3['filters']));if(_0x3e2bae['query'][_0x6b40('0x3c')]){_0x351208[_0x6b40('0x39')]=_[_0x6b40('0x46')](_0x351208['where'],{'$or':_[_0x6b40('0x3d')](_0x351208[_0x6b40('0x34')],function(_0x3d640f){var _0x9f6017={};_0x9f6017[_0x3d640f]={'$like':'%'+_0x3e2bae[_0x6b40('0x31')][_0x6b40('0x3c')]+'%'};return _0x9f6017;})});}_0x351208=_[_0x6b40('0x46')]({},_0x351208,_0x3e2bae['options']);return _0x1072cf[_0x6b40('0x4f')](_0x351208);}})[_0x6b40('0x17')](function(_0x5107a9){if(_0x5107a9){_0x1841de=_0x5107a9['length'];if(!_0x3e2bae['query'][_0x6b40('0x35')](_0x6b40('0x36'))){_0x351208['limit']=qs[_0x6b40('0x27')](_0x3e2bae[_0x6b40('0x31')][_0x6b40('0x27')]);_0x351208[_0x6b40('0x26')]=qs[_0x6b40('0x26')](_0x3e2bae['query']['offset']);}return _0x1072cf['getDescriptions'](_0x351208);}})[_0x6b40('0x17')](function(_0x1dbbde){if(_0x1dbbde){return _0x1dbbde?{'count':_0x1841de,'rows':_0x1dbbde}:null;}})['then'](respondWithResult(_0x12012e,null))[_0x6b40('0x43')](handleError(_0x12012e,null));}; \ No newline at end of file +var _0xb25a=['ZohoField','sort','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','then','end','stack','send','ZohoConfiguration','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','type','key','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','getFields','findOne'];(function(_0x4921d9,_0x3aaa45){var _0x57f374=function(_0x5ccee7){while(--_0x5ccee7){_0x4921d9['push'](_0x4921d9['shift']());}};_0x57f374(++_0x3aaa45);}(_0xb25a,0x171));var _0xab25=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb25a[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0xab25('0x0'));var emlformat=require(_0xab25('0x1'));var rimraf=require(_0xab25('0x2'));var zipdir=require(_0xab25('0x3'));var jsonpatch=require(_0xab25('0x4'));var rp=require(_0xab25('0x5'));var moment=require(_0xab25('0x6'));var BPromise=require(_0xab25('0x7'));var Mustache=require(_0xab25('0x8'));var util=require('util');var path=require(_0xab25('0x9'));var sox=require(_0xab25('0xa'));var csv=require(_0xab25('0xb'));var ejs=require(_0xab25('0xc'));var fs=require('fs');var _=require(_0xab25('0xd'));var squel=require(_0xab25('0xe'));var crypto=require(_0xab25('0xf'));var jsforce=require(_0xab25('0x10'));var deskjs=require(_0xab25('0x11'));var toCsv=require(_0xab25('0xb'));var querystring=require('querystring');var Papa=require(_0xab25('0x12'));var Redis=require('ioredis');var authService=require(_0xab25('0x13'));var qs=require(_0xab25('0x14'));var hardwareService=require(_0xab25('0x15'));var logger=require(_0xab25('0x16'))(_0xab25('0x17'));var utils=require('../../config/utils');var config=require(_0xab25('0x18'));var db=require(_0xab25('0x19'))['db'];var jayson=require(_0xab25('0x1a'));var client=jayson[_0xab25('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x3c103d,_0x18b321,_0x410cb3){if(_0x410cb3){var _0x58c61c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58c61c[_0xab25('0x1c')](_0x18b321)){return _0x3c103d;}else{throw new Error(_0xab25('0x1d'));}}else{return _0x3c103d;}}function respondWithRpcPromise(_0x33320a,_0x508d3c,_0x2540e5,_0x1cb4df){return new BPromise(function(_0x243c16,_0xc78f65){var _0x2618da=_0x1cb4df||client;return _0x2618da[_0xab25('0x1e')](_0x33320a,_0x2540e5)['then'](function(_0x49457e){logger[_0xab25('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x508d3c,_0xab25('0x20'));logger['debug'](_0xab25('0x21'),_0x508d3c,_0xab25('0x20'),JSON[_0xab25('0x22')](_0x49457e));if(_0x49457e[_0xab25('0x23')]){if(_0x49457e[_0xab25('0x23')]['code']===0x1f4){logger['error'](_0xab25('0x24'),_0x508d3c,_0x49457e[_0xab25('0x23')][_0xab25('0x25')]);return _0xc78f65(_0x49457e[_0xab25('0x23')][_0xab25('0x25')]);}logger[_0xab25('0x23')](_0xab25('0x24'),_0x508d3c,_0x49457e[_0xab25('0x23')][_0xab25('0x25')]);return _0x243c16(_0x49457e[_0xab25('0x23')][_0xab25('0x25')]);}else{logger['info'](_0xab25('0x24'),_0x508d3c,_0xab25('0x20'));_0x243c16(_0x49457e['result'][_0xab25('0x25')]);}})[_0xab25('0x26')](function(_0x137a43){logger['error'](_0xab25('0x24'),_0x508d3c,_0x137a43);_0xc78f65(_0x137a43);});});}function respondWithStatusCode(_0x464558,_0x4ac3c3){_0x4ac3c3=_0x4ac3c3||0xcc;return function(_0x1536ac){if(_0x1536ac){return _0x464558[_0xab25('0x27')](_0x4ac3c3);}return _0x464558[_0xab25('0x28')](_0x4ac3c3)['end']();};}function respondWithResult(_0x1b16da,_0x46a7e2){_0x46a7e2=_0x46a7e2||0xc8;return function(_0x292b10){if(_0x292b10){return _0x1b16da[_0xab25('0x28')](_0x46a7e2)['json'](_0x292b10);}};}function respondWithFilteredResult(_0x3bc583,_0xca0a51){return function(_0x21c360){if(_0x21c360){var _0x3d5d8b=_0x21c360[_0xab25('0x29')],_0x154fa1=_0xca0a51[_0xab25('0x2a')],_0x2099b1=_0xca0a51[_0xab25('0x2a')]+_0xca0a51[_0xab25('0x2b')],_0xed630a;if(_0x2099b1>=_0x3d5d8b){_0x2099b1=_0x3d5d8b;_0xed630a=0xc8;}else{_0xed630a=0xce;}_0x3bc583['status'](_0xed630a);return _0x3bc583[_0xab25('0x2c')](_0xab25('0x2d'),_0x154fa1+'-'+_0x2099b1+'/'+_0x3d5d8b)[_0xab25('0x2e')](_0x21c360);}return null;};}function patchUpdates(_0x3d1a3c){return function(_0x47955){try{jsonpatch[_0xab25('0x2f')](_0x47955,_0x3d1a3c,!![]);}catch(_0xe7f0a7){return BPromise['reject'](_0xe7f0a7);}return _0x47955['save']();};}function saveUpdates(_0x3c8c77,_0x5dd5ad){return function(_0xfb0b12){if(_0xfb0b12){return _0xfb0b12[_0xab25('0x30')](_0x3c8c77)['then'](function(_0x2aff58){return _0x2aff58;});}return null;};}function removeEntity(_0x26782e,_0x20ac3e){return function(_0x7a4cfe){if(_0x7a4cfe){return _0x7a4cfe[_0xab25('0x31')]()[_0xab25('0x32')](function(){_0x26782e['status'](0xcc)[_0xab25('0x33')]();});}};}function handleEntityNotFound(_0x1f3a67,_0x325835){return function(_0x405580){if(!_0x405580){_0x1f3a67[_0xab25('0x27')](0x194);}return _0x405580;};}function handleError(_0x2ca6f1,_0xbf2e57){_0xbf2e57=_0xbf2e57||0x1f4;return function(_0x22c4a6){logger[_0xab25('0x23')](_0x22c4a6[_0xab25('0x34')]);if(_0x22c4a6['name']){delete _0x22c4a6['name'];}_0x2ca6f1['status'](_0xbf2e57)[_0xab25('0x35')](_0x22c4a6);};}exports['index']=function(_0x31f9b4,_0x44ebb2){var _0x1c436d={},_0x478bc6={},_0x5740a0={'count':0x0,'rows':[]};var _0x42f76e=db[_0xab25('0x36')][_0xab25('0x37')];_0x478bc6[_0xab25('0x38')]=_[_0xab25('0x39')](_0x42f76e);_0x478bc6[_0xab25('0x3a')]=_['keys'](_0x31f9b4[_0xab25('0x3a')]);_0x478bc6[_0xab25('0x3b')]=_['intersection'](_0x478bc6[_0xab25('0x38')],_0x478bc6[_0xab25('0x3a')]);_0x1c436d[_0xab25('0x3c')]=_[_0xab25('0x3d')](_0x478bc6[_0xab25('0x38')],qs[_0xab25('0x3e')](_0x31f9b4[_0xab25('0x3a')][_0xab25('0x3e')]));_0x1c436d[_0xab25('0x3c')]=_0x1c436d[_0xab25('0x3c')][_0xab25('0x3f')]?_0x1c436d[_0xab25('0x3c')]:_0x478bc6[_0xab25('0x38')];if(!_0x31f9b4[_0xab25('0x3a')][_0xab25('0x40')](_0xab25('0x41'))){_0x1c436d[_0xab25('0x2b')]=qs[_0xab25('0x2b')](_0x31f9b4[_0xab25('0x3a')]['limit']);_0x1c436d[_0xab25('0x2a')]=qs['offset'](_0x31f9b4[_0xab25('0x3a')][_0xab25('0x2a')]);}_0x1c436d[_0xab25('0x42')]=qs['sort'](_0x31f9b4[_0xab25('0x3a')]['sort']);_0x1c436d['where']=qs[_0xab25('0x3b')](_[_0xab25('0x43')](_0x31f9b4[_0xab25('0x3a')],_0x478bc6[_0xab25('0x3b')]));if(_0x31f9b4[_0xab25('0x3a')][_0xab25('0x44')]){_0x1c436d[_0xab25('0x45')]=_['merge'](_0x1c436d['where'],{'$or':_['map'](_0x42f76e,function(_0xa6b6b2){if(_0xa6b6b2[_0xab25('0x46')][_0xab25('0x47')]!==_0xab25('0x48')){var _0x2fcfd8={};_0x2fcfd8[_0xa6b6b2['field']]={'$like':'%'+_0x31f9b4[_0xab25('0x3a')][_0xab25('0x44')]+'%'};return _0x2fcfd8;}})});}_0x1c436d=_[_0xab25('0x49')]({},_0x1c436d,_0x31f9b4[_0xab25('0x4a')]);var _0x4fe507={'where':_0x1c436d['where']};return db['ZohoConfiguration']['count'](_0x4fe507)[_0xab25('0x32')](function(_0x2582c6){_0x5740a0['count']=_0x2582c6;if(_0x31f9b4[_0xab25('0x3a')][_0xab25('0x4b')]){_0x1c436d['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xab25('0x4c')](_0x1c436d);})[_0xab25('0x32')](function(_0x30131a){_0x5740a0[_0xab25('0x4d')]=_0x30131a;return _0x5740a0;})['then'](respondWithFilteredResult(_0x44ebb2,_0x1c436d))[_0xab25('0x26')](handleError(_0x44ebb2,null));};exports[_0xab25('0x4e')]=function(_0x121b90,_0x495405){var _0x107dab={'raw':![],'where':{'id':_0x121b90[_0xab25('0x4f')]['id']}},_0x177404={};_0x177404['model']=_['keys'](db[_0xab25('0x36')][_0xab25('0x37')]);_0x177404['query']=_[_0xab25('0x39')](_0x121b90['query']);_0x177404[_0xab25('0x3b')]=_[_0xab25('0x3d')](_0x177404['model'],_0x177404[_0xab25('0x3a')]);_0x107dab[_0xab25('0x3c')]=_[_0xab25('0x3d')](_0x177404[_0xab25('0x38')],qs[_0xab25('0x3e')](_0x121b90[_0xab25('0x3a')]['fields']));_0x107dab[_0xab25('0x3c')]=_0x107dab['attributes'][_0xab25('0x3f')]?_0x107dab['attributes']:_0x177404[_0xab25('0x38')];if(_0x121b90['query'][_0xab25('0x4b')]){_0x107dab[_0xab25('0x50')]=[{'all':!![]}];}_0x107dab=_[_0xab25('0x49')]({},_0x107dab,_0x121b90['options']);return db[_0xab25('0x36')][_0xab25('0x51')](_0x107dab)[_0xab25('0x32')](handleEntityNotFound(_0x495405,null))[_0xab25('0x32')](respondWithResult(_0x495405,null))[_0xab25('0x26')](handleError(_0x495405,null));};exports[_0xab25('0x52')]=function(_0x3f082d,_0x5cc07d){return db['ZohoConfiguration'][_0xab25('0x52')](_0x3f082d[_0xab25('0x53')],{})[_0xab25('0x32')](respondWithResult(_0x5cc07d,0xc9))['catch'](handleError(_0x5cc07d,null));};exports[_0xab25('0x30')]=function(_0x3da2c0,_0x3189e9){if(_0x3da2c0[_0xab25('0x53')]['id']){delete _0x3da2c0['body']['id'];}return db[_0xab25('0x36')][_0xab25('0x51')]({'where':{'id':_0x3da2c0['params']['id']}})[_0xab25('0x32')](handleEntityNotFound(_0x3189e9,null))[_0xab25('0x32')](saveUpdates(_0x3da2c0[_0xab25('0x53')],null))[_0xab25('0x32')](respondWithResult(_0x3189e9,null))['catch'](handleError(_0x3189e9,null));};exports[_0xab25('0x31')]=function(_0x3dad4f,_0x5a102b){return db[_0xab25('0x36')][_0xab25('0x51')]({'where':{'id':_0x3dad4f[_0xab25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a102b,null))[_0xab25('0x32')](removeEntity(_0x5a102b,null))['catch'](handleError(_0x5a102b,null));};exports[_0xab25('0x54')]=function(_0x2e5d26,_0x3987a1,_0x25a1e9){var _0x5bf068={};var _0x2d37e0={};var _0xb8f2fc;var _0x19f445;return db[_0xab25('0x36')][_0xab25('0x55')]({'where':{'id':_0x2e5d26[_0xab25('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3987a1,null))[_0xab25('0x32')](function(_0xdb86cd){if(_0xdb86cd){_0xb8f2fc=_0xdb86cd;_0x2d37e0[_0xab25('0x38')]=_[_0xab25('0x39')](db[_0xab25('0x56')]['rawAttributes']);_0x2d37e0[_0xab25('0x3a')]=_['keys'](_0x2e5d26[_0xab25('0x3a')]);_0x2d37e0[_0xab25('0x3b')]=_[_0xab25('0x3d')](_0x2d37e0['model'],_0x2d37e0[_0xab25('0x3a')]);_0x5bf068[_0xab25('0x3c')]=_['intersection'](_0x2d37e0[_0xab25('0x38')],qs['fields'](_0x2e5d26['query'][_0xab25('0x3e')]));_0x5bf068[_0xab25('0x3c')]=_0x5bf068[_0xab25('0x3c')][_0xab25('0x3f')]?_0x5bf068['attributes']:_0x2d37e0[_0xab25('0x38')];_0x5bf068[_0xab25('0x42')]=qs[_0xab25('0x57')](_0x2e5d26[_0xab25('0x3a')]['sort']);_0x5bf068[_0xab25('0x45')]=qs['filters'](_['pick'](_0x2e5d26[_0xab25('0x3a')],_0x2d37e0[_0xab25('0x3b')]));if(_0x2e5d26[_0xab25('0x3a')]['filter']){_0x5bf068[_0xab25('0x45')]=_[_0xab25('0x49')](_0x5bf068['where'],{'$or':_[_0xab25('0x58')](_0x5bf068[_0xab25('0x3c')],function(_0x3ed184){var _0x30612a={};_0x30612a[_0x3ed184]={'$like':'%'+_0x2e5d26[_0xab25('0x3a')]['filter']+'%'};return _0x30612a;})});}_0x5bf068=_['merge']({},_0x5bf068,_0x2e5d26['options']);return _0xb8f2fc[_0xab25('0x54')](_0x5bf068);}})[_0xab25('0x32')](function(_0x2b76e0){if(_0x2b76e0){_0x19f445=_0x2b76e0[_0xab25('0x3f')];if(!_0x2e5d26[_0xab25('0x3a')]['hasOwnProperty'](_0xab25('0x41'))){_0x5bf068[_0xab25('0x2b')]=qs[_0xab25('0x2b')](_0x2e5d26['query'][_0xab25('0x2b')]);_0x5bf068[_0xab25('0x2a')]=qs['offset'](_0x2e5d26['query'][_0xab25('0x2a')]);}return _0xb8f2fc[_0xab25('0x54')](_0x5bf068);}})[_0xab25('0x32')](function(_0x14c1ad){if(_0x14c1ad){return _0x14c1ad?{'count':_0x19f445,'rows':_0x14c1ad}:null;}})[_0xab25('0x32')](respondWithResult(_0x3987a1,null))[_0xab25('0x26')](handleError(_0x3987a1,null));};exports[_0xab25('0x59')]=function(_0x3b517c,_0x4d977e,_0x400a1e){var _0x359b16={};var _0x308b62={};var _0x2fb82d;var _0x42756e;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x3b517c[_0xab25('0x4f')]['id']}})[_0xab25('0x32')](handleEntityNotFound(_0x4d977e,null))[_0xab25('0x32')](function(_0x1db899){if(_0x1db899){_0x2fb82d=_0x1db899;_0x308b62[_0xab25('0x38')]=_[_0xab25('0x39')](db[_0xab25('0x56')]['rawAttributes']);_0x308b62[_0xab25('0x3a')]=_['keys'](_0x3b517c[_0xab25('0x3a')]);_0x308b62[_0xab25('0x3b')]=_[_0xab25('0x3d')](_0x308b62[_0xab25('0x38')],_0x308b62[_0xab25('0x3a')]);_0x359b16[_0xab25('0x3c')]=_['intersection'](_0x308b62[_0xab25('0x38')],qs[_0xab25('0x3e')](_0x3b517c[_0xab25('0x3a')][_0xab25('0x3e')]));_0x359b16[_0xab25('0x3c')]=_0x359b16[_0xab25('0x3c')][_0xab25('0x3f')]?_0x359b16[_0xab25('0x3c')]:_0x308b62[_0xab25('0x38')];_0x359b16[_0xab25('0x42')]=qs[_0xab25('0x57')](_0x3b517c['query']['sort']);_0x359b16[_0xab25('0x45')]=qs[_0xab25('0x3b')](_['pick'](_0x3b517c[_0xab25('0x3a')],_0x308b62[_0xab25('0x3b')]));if(_0x3b517c[_0xab25('0x3a')][_0xab25('0x44')]){_0x359b16[_0xab25('0x45')]=_[_0xab25('0x49')](_0x359b16[_0xab25('0x45')],{'$or':_[_0xab25('0x58')](_0x359b16[_0xab25('0x3c')],function(_0x32f071){var _0x1003d2={};_0x1003d2[_0x32f071]={'$like':'%'+_0x3b517c[_0xab25('0x3a')][_0xab25('0x44')]+'%'};return _0x1003d2;})});}_0x359b16=_['merge']({},_0x359b16,_0x3b517c[_0xab25('0x4a')]);return _0x2fb82d['getSubjects'](_0x359b16);}})[_0xab25('0x32')](function(_0x4da19a){if(_0x4da19a){_0x42756e=_0x4da19a[_0xab25('0x3f')];if(!_0x3b517c[_0xab25('0x3a')]['hasOwnProperty'](_0xab25('0x41'))){_0x359b16[_0xab25('0x2b')]=qs[_0xab25('0x2b')](_0x3b517c['query']['limit']);_0x359b16['offset']=qs[_0xab25('0x2a')](_0x3b517c['query']['offset']);}return _0x2fb82d[_0xab25('0x59')](_0x359b16);}})['then'](function(_0x180a5b){if(_0x180a5b){return _0x180a5b?{'count':_0x42756e,'rows':_0x180a5b}:null;}})[_0xab25('0x32')](respondWithResult(_0x4d977e,null))[_0xab25('0x26')](handleError(_0x4d977e,null));};exports[_0xab25('0x5a')]=function(_0x44378f,_0x433ac8,_0xed71c2){var _0x11ad89={};var _0x5b0d05={};var _0x50fdc7;var _0x477df9;return db['ZohoConfiguration'][_0xab25('0x55')]({'where':{'id':_0x44378f['params']['id']}})[_0xab25('0x32')](handleEntityNotFound(_0x433ac8,null))[_0xab25('0x32')](function(_0x2b52a4){if(_0x2b52a4){_0x50fdc7=_0x2b52a4;_0x5b0d05[_0xab25('0x38')]=_[_0xab25('0x39')](db['ZohoField'][_0xab25('0x37')]);_0x5b0d05[_0xab25('0x3a')]=_[_0xab25('0x39')](_0x44378f['query']);_0x5b0d05[_0xab25('0x3b')]=_[_0xab25('0x3d')](_0x5b0d05[_0xab25('0x38')],_0x5b0d05[_0xab25('0x3a')]);_0x11ad89[_0xab25('0x3c')]=_[_0xab25('0x3d')](_0x5b0d05[_0xab25('0x38')],qs[_0xab25('0x3e')](_0x44378f[_0xab25('0x3a')][_0xab25('0x3e')]));_0x11ad89[_0xab25('0x3c')]=_0x11ad89[_0xab25('0x3c')][_0xab25('0x3f')]?_0x11ad89[_0xab25('0x3c')]:_0x5b0d05[_0xab25('0x38')];_0x11ad89['order']=qs[_0xab25('0x57')](_0x44378f[_0xab25('0x3a')][_0xab25('0x57')]);_0x11ad89[_0xab25('0x45')]=qs[_0xab25('0x3b')](_['pick'](_0x44378f[_0xab25('0x3a')],_0x5b0d05['filters']));if(_0x44378f[_0xab25('0x3a')][_0xab25('0x44')]){_0x11ad89['where']=_[_0xab25('0x49')](_0x11ad89[_0xab25('0x45')],{'$or':_[_0xab25('0x58')](_0x11ad89[_0xab25('0x3c')],function(_0x2722){var _0x50dd20={};_0x50dd20[_0x2722]={'$like':'%'+_0x44378f[_0xab25('0x3a')][_0xab25('0x44')]+'%'};return _0x50dd20;})});}_0x11ad89=_[_0xab25('0x49')]({},_0x11ad89,_0x44378f[_0xab25('0x4a')]);return _0x50fdc7[_0xab25('0x5a')](_0x11ad89);}})[_0xab25('0x32')](function(_0x2bf60b){if(_0x2bf60b){_0x477df9=_0x2bf60b[_0xab25('0x3f')];if(!_0x44378f['query'][_0xab25('0x40')](_0xab25('0x41'))){_0x11ad89[_0xab25('0x2b')]=qs['limit'](_0x44378f[_0xab25('0x3a')][_0xab25('0x2b')]);_0x11ad89[_0xab25('0x2a')]=qs[_0xab25('0x2a')](_0x44378f[_0xab25('0x3a')][_0xab25('0x2a')]);}return _0x50fdc7[_0xab25('0x5a')](_0x11ad89);}})[_0xab25('0x32')](function(_0x4e49a2){if(_0x4e49a2){return _0x4e49a2?{'count':_0x477df9,'rows':_0x4e49a2}:null;}})[_0xab25('0x32')](respondWithResult(_0x433ac8,null))[_0xab25('0x26')](handleError(_0x433ac8,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d56d428..4fe9114 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 _0xb688=['exports','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x5ef0ef,_0x55c55d){var _0x5c8ec6=function(_0x3d4872){while(--_0x3d4872){_0x5ef0ef['push'](_0x5ef0ef['shift']());}};_0x5c8ec6(++_0x55c55d);}(_0xb688,0xcf));var _0x8b68=function(_0x50d0d8,_0x6cb90c){_0x50d0d8=_0x50d0d8-0x0;var _0x260963=_0xb688[_0x50d0d8];return _0x260963;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49e9=['bluebird','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x2f040e,_0x2320e3){var _0x47f6e0=function(_0x1b2e3c){while(--_0x1b2e3c){_0x2f040e['push'](_0x2f040e['shift']());}};_0x47f6e0(++_0x2320e3);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require('../../config/logger')(_0x949e('0x2'));var moment=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x949e('0x5'));var config=require('../../config/environment');var attributes=require(_0x949e('0x6'));module[_0x949e('0x7')]=function(_0x360308,_0x56c7b2){return _0x360308[_0x949e('0x8')](_0x949e('0x9'),attributes,{'tableName':_0x949e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 76e3141..fd02d7c 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 _0xfbc4=['http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b3432,_0x1411a0){var _0x341808=function(_0x583ffe){while(--_0x583ffe){_0x2b3432['push'](_0x2b3432['shift']());}};_0x341808(++_0x1411a0);}(_0xfbc4,0x197));var _0x4fbc=function(_0x572f87,_0x365b1f){_0x572f87=_0x572f87-0x0;var _0x4ee7e0=_0xfbc4[_0x572f87];return _0x4ee7e0;};'use strict';var _=require('lodash');var util=require(_0x4fbc('0x0'));var moment=require(_0x4fbc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fbc('0x2'));var fs=require('fs');var Redis=require(_0x4fbc('0x3'));var db=require(_0x4fbc('0x4'))['db'];var utils=require(_0x4fbc('0x5'));var logger=require(_0x4fbc('0x6'))(_0x4fbc('0x7'));var config=require(_0x4fbc('0x8'));var jayson=require(_0x4fbc('0x9'));var client=jayson[_0x4fbc('0xa')][_0x4fbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x335473,_0x50b082,_0x1f5e8d){return new BPromise(function(_0x4d8c55,_0x1c9eb8){return client[_0x4fbc('0xc')](_0x335473,_0x1f5e8d)[_0x4fbc('0xd')](function(_0x1a2245){logger[_0x4fbc('0xe')](_0x4fbc('0xf'),_0x50b082,_0x4fbc('0x10'));logger['debug'](_0x4fbc('0x11'),_0x50b082,_0x4fbc('0x10'),JSON[_0x4fbc('0x12')](_0x1a2245));if(_0x1a2245[_0x4fbc('0x13')]){if(_0x1a2245[_0x4fbc('0x13')]['code']===0x1f4){logger[_0x4fbc('0x13')](_0x4fbc('0xf'),_0x50b082,_0x1a2245['error'][_0x4fbc('0x14')]);return _0x1c9eb8(_0x1a2245[_0x4fbc('0x13')][_0x4fbc('0x14')]);}logger[_0x4fbc('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x50b082,_0x1a2245[_0x4fbc('0x13')][_0x4fbc('0x14')]);return _0x4d8c55(_0x1a2245[_0x4fbc('0x13')]['message']);}else{logger[_0x4fbc('0xe')](_0x4fbc('0xf'),_0x50b082,_0x4fbc('0x10'));_0x4d8c55(_0x1a2245[_0x4fbc('0x15')]['message']);}})['catch'](function(_0x564bad){logger[_0x4fbc('0x13')](_0x4fbc('0xf'),_0x50b082,_0x564bad);_0x1c9eb8(_0x564bad);});});} \ No newline at end of file +var _0x6ace=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment'];(function(_0x5a93f5,_0x10f241){var _0x1f4487=function(_0x38a0c7){while(--_0x38a0c7){_0x5a93f5['push'](_0x5a93f5['shift']());}};_0x1f4487(++_0x10f241);}(_0x6ace,0x1ca));var _0xe6ac=function(_0x175f6f,_0x1a4a05){_0x175f6f=_0x175f6f-0x0;var _0x1aa501=_0x6ace[_0x175f6f];return _0x1aa501;};'use strict';var _=require(_0xe6ac('0x0'));var util=require('util');var moment=require(_0xe6ac('0x1'));var BPromise=require(_0xe6ac('0x2'));var rs=require(_0xe6ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6ac('0x4'))['db'];var utils=require(_0xe6ac('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe6ac('0x6'));var jayson=require(_0xe6ac('0x7'));var client=jayson[_0xe6ac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ca96c,_0x2997f5,_0x5c83c4){return new BPromise(function(_0x5773ed,_0xdb5ba9){return client[_0xe6ac('0x9')](_0x3ca96c,_0x5c83c4)['then'](function(_0x4dd93d){logger[_0xe6ac('0xa')](_0xe6ac('0xb'),_0x2997f5,_0xe6ac('0xc'));logger[_0xe6ac('0xd')](_0xe6ac('0xe'),_0x2997f5,_0xe6ac('0xc'),JSON[_0xe6ac('0xf')](_0x4dd93d));if(_0x4dd93d[_0xe6ac('0x10')]){if(_0x4dd93d[_0xe6ac('0x10')][_0xe6ac('0x11')]===0x1f4){logger[_0xe6ac('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2997f5,_0x4dd93d[_0xe6ac('0x10')][_0xe6ac('0x12')]);return _0xdb5ba9(_0x4dd93d['error'][_0xe6ac('0x12')]);}logger[_0xe6ac('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2997f5,_0x4dd93d[_0xe6ac('0x10')][_0xe6ac('0x12')]);return _0x5773ed(_0x4dd93d[_0xe6ac('0x10')]['message']);}else{logger[_0xe6ac('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x2997f5,_0xe6ac('0xc'));_0x5773ed(_0x4dd93d[_0xe6ac('0x13')][_0xe6ac('0x12')]);}})['catch'](function(_0x62eb6d){logger[_0xe6ac('0x10')](_0xe6ac('0xb'),_0x2997f5,_0x62eb6d);_0xdb5ba9(_0x62eb6d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6be24ad..8952bbf 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 _0x8d57=['isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x3a0d4b,_0x5bcf1a){var _0x4f3fdf=function(_0x8e1419){while(--_0x8e1419){_0x3a0d4b['push'](_0x3a0d4b['shift']());}};_0x4f3fdf(++_0x5bcf1a);}(_0x8d57,0x183));var _0x78d5=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x8d57[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require('multer');var util=require(_0x78d5('0x0'));var path=require(_0x78d5('0x1'));var timeout=require(_0x78d5('0x2'));var express=require('express');var router=express[_0x78d5('0x3')]();var auth=require(_0x78d5('0x4'));var interaction=require(_0x78d5('0x5'));var config=require(_0x78d5('0x6'));var controller=require(_0x78d5('0x7'));router[_0x78d5('0x8')]('/',auth[_0x78d5('0x9')](),controller['index']);router['get'](_0x78d5('0xa'),auth[_0x78d5('0x9')](),controller[_0x78d5('0xb')]);router[_0x78d5('0xc')]('/',auth[_0x78d5('0x9')](),controller[_0x78d5('0xd')]);router[_0x78d5('0xe')](_0x78d5('0xa'),auth['isAuthenticated'](),controller[_0x78d5('0xf')]);router[_0x78d5('0x10')](_0x78d5('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x78d5('0x11')]=router; \ No newline at end of file +var _0x9d1b=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','post','create'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x9d1b,0x111));var _0xb9d1=function(_0x1b5b29,_0xfd5dd8){_0x1b5b29=_0x1b5b29-0x0;var _0x2b125e=_0x9d1b[_0x1b5b29];return _0x2b125e;};'use strict';var multer=require(_0xb9d1('0x0'));var util=require(_0xb9d1('0x1'));var path=require(_0xb9d1('0x2'));var timeout=require(_0xb9d1('0x3'));var express=require(_0xb9d1('0x4'));var router=express[_0xb9d1('0x5')]();var auth=require(_0xb9d1('0x6'));var interaction=require(_0xb9d1('0x7'));var config=require(_0xb9d1('0x8'));var controller=require(_0xb9d1('0x9'));router[_0xb9d1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb9d1('0xb'),auth[_0xb9d1('0xc')](),controller['show']);router[_0xb9d1('0xd')]('/',auth['isAuthenticated'](),controller[_0xb9d1('0xe')]);router[_0xb9d1('0xf')](_0xb9d1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb9d1('0x10')](_0xb9d1('0xb'),auth[_0xb9d1('0xc')](),controller[_0xb9d1('0x11')]);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 718f4fb..09bb1b9 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 _0xa75b=['customVariable','keyValue','STRING','ENUM','sequelize','string','variable'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa75b,0x170));var _0xba75=function(_0xb4d6ba,_0x84ae3f){_0xb4d6ba=_0xb4d6ba-0x0;var _0xa36d32=_0xa75b[_0xb4d6ba];return _0xa36d32;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xba75('0x1'),_0xba75('0x2'),_0xba75('0x3'),_0xba75('0x4')),'defaultValue':_0xba75('0x1')},'content':{'type':Sequelize[_0xba75('0x5')]},'key':{'type':Sequelize[_0xba75('0x5')]},'keyType':{'type':Sequelize[_0xba75('0x6')](_0xba75('0x1'),_0xba75('0x2'),_0xba75('0x3'))},'keyContent':{'type':Sequelize[_0xba75('0x5')]},'idField':{'type':Sequelize[_0xba75('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba75('0x5')]}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x6c76,0x184));var _0x66c7=function(_0x57c04a,_0x172058){_0x57c04a=_0x57c04a-0x0;var _0x40f391=_0x6c76[_0x57c04a];return _0x40f391;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c23dab7..934ef2e 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 _0xbaf0=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var hardwareService=require(_0x0baf('0x15'));var logger=require(_0x0baf('0x16'))(_0x0baf('0x17'));var utils=require(_0x0baf('0x18'));var config=require(_0x0baf('0x19'));var db=require(_0x0baf('0x1a'))['db'];function respondWithStatusCode(_0x51d93c,_0x5a53e2){_0x5a53e2=_0x5a53e2||0xcc;return function(_0x465dd7){if(_0x465dd7){return _0x51d93c[_0x0baf('0x1b')](_0x5a53e2);}return _0x51d93c[_0x0baf('0x1c')](_0x5a53e2)[_0x0baf('0x1d')]();};}function respondWithResult(_0x5a0583,_0x2ab33e){_0x2ab33e=_0x2ab33e||0xc8;return function(_0x49e44b){if(_0x49e44b){return _0x5a0583[_0x0baf('0x1c')](_0x2ab33e)[_0x0baf('0x1e')](_0x49e44b);}};}function respondWithFilteredResult(_0x7fbf67,_0x2bc381){return function(_0xb8339e){if(_0xb8339e){var _0x469599=_0xb8339e[_0x0baf('0x1f')],_0x4f80a8=_0x2bc381[_0x0baf('0x20')],_0x4cd79d=_0x2bc381[_0x0baf('0x20')]+_0x2bc381[_0x0baf('0x21')],_0x2312c7;if(_0x4cd79d>=_0x469599){_0x4cd79d=_0x469599;_0x2312c7=0xc8;}else{_0x2312c7=0xce;}_0x7fbf67[_0x0baf('0x1c')](_0x2312c7);return _0x7fbf67['set'](_0x0baf('0x22'),_0x4f80a8+'-'+_0x4cd79d+'/'+_0x469599)[_0x0baf('0x1e')](_0xb8339e);}return null;};}function patchUpdates(_0x1ef0e5){return function(_0x3e9cb4){try{jsonpatch[_0x0baf('0x23')](_0x3e9cb4,_0x1ef0e5,!![]);}catch(_0x42b7f2){return BPromise['reject'](_0x42b7f2);}return _0x3e9cb4['save']();};}function saveUpdates(_0x1410ec,_0x154f48){return function(_0x32e839){if(_0x32e839){return _0x32e839[_0x0baf('0x24')](_0x1410ec)[_0x0baf('0x25')](function(_0x3e3e20){return _0x3e3e20;});}return null;};}function removeEntity(_0x210cd8,_0x636a13){return function(_0x2c42e2){if(_0x2c42e2){return _0x2c42e2[_0x0baf('0x26')]()['then'](function(){_0x210cd8[_0x0baf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6c158,_0x5dbf00){return function(_0x4de74c){if(!_0x4de74c){_0xf6c158[_0x0baf('0x1b')](0x194);}return _0x4de74c;};}function handleError(_0x48a0e9,_0x4be1b9){_0x4be1b9=_0x4be1b9||0x1f4;return function(_0x47c4b){logger[_0x0baf('0x27')](_0x47c4b[_0x0baf('0x28')]);if(_0x47c4b[_0x0baf('0x29')]){delete _0x47c4b[_0x0baf('0x29')];}_0x48a0e9['status'](_0x4be1b9)[_0x0baf('0x2a')](_0x47c4b);};}exports[_0x0baf('0x2b')]=function(_0x1ca35a,_0x366e71){var _0x3843b8={},_0x3b9b31={},_0x453525={'count':0x0,'rows':[]};var _0x549fd0=db[_0x0baf('0x2c')][_0x0baf('0x2d')];_0x3b9b31[_0x0baf('0x2e')]=_[_0x0baf('0x2f')](_0x549fd0);_0x3b9b31['query']=_[_0x0baf('0x2f')](_0x1ca35a[_0x0baf('0x30')]);_0x3b9b31['filters']=_[_0x0baf('0x31')](_0x3b9b31[_0x0baf('0x2e')],_0x3b9b31[_0x0baf('0x30')]);_0x3843b8[_0x0baf('0x32')]=_[_0x0baf('0x31')](_0x3b9b31[_0x0baf('0x2e')],qs[_0x0baf('0x33')](_0x1ca35a['query'][_0x0baf('0x33')]));_0x3843b8[_0x0baf('0x32')]=_0x3843b8[_0x0baf('0x32')][_0x0baf('0x34')]?_0x3843b8[_0x0baf('0x32')]:_0x3b9b31[_0x0baf('0x2e')];if(!_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x35')](_0x0baf('0x36'))){_0x3843b8[_0x0baf('0x21')]=qs[_0x0baf('0x21')](_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x21')]);_0x3843b8[_0x0baf('0x20')]=qs['offset'](_0x1ca35a[_0x0baf('0x30')]['offset']);}_0x3843b8[_0x0baf('0x37')]=qs[_0x0baf('0x38')](_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x38')]);_0x3843b8['where']=qs[_0x0baf('0x39')](_[_0x0baf('0x3a')](_0x1ca35a['query'],_0x3b9b31[_0x0baf('0x39')]));if(_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x3b')]){_0x3843b8[_0x0baf('0x3c')]=_[_0x0baf('0x3d')](_0x3843b8[_0x0baf('0x3c')],{'$or':_[_0x0baf('0x3e')](_0x549fd0,function(_0x675461){if(_0x675461['type'][_0x0baf('0x3f')]!==_0x0baf('0x40')){var _0x5b991f={};_0x5b991f[_0x675461[_0x0baf('0x41')]]={'$like':'%'+_0x1ca35a['query']['filter']+'%'};return _0x5b991f;}})});}_0x3843b8=_[_0x0baf('0x3d')]({},_0x3843b8,_0x1ca35a[_0x0baf('0x42')]);var _0x5d3ad1={'where':_0x3843b8['where']};return db[_0x0baf('0x2c')][_0x0baf('0x1f')](_0x5d3ad1)[_0x0baf('0x25')](function(_0xb2d9ab){_0x453525[_0x0baf('0x1f')]=_0xb2d9ab;if(_0x1ca35a[_0x0baf('0x30')][_0x0baf('0x43')]){_0x3843b8[_0x0baf('0x44')]=[{'all':!![]}];}return db[_0x0baf('0x2c')][_0x0baf('0x45')](_0x3843b8);})[_0x0baf('0x25')](function(_0x148540){_0x453525[_0x0baf('0x46')]=_0x148540;return _0x453525;})[_0x0baf('0x25')](respondWithFilteredResult(_0x366e71,_0x3843b8))['catch'](handleError(_0x366e71,null));};exports[_0x0baf('0x47')]=function(_0x1435d5,_0x4f1de9){var _0x38006a={'raw':!![],'where':{'id':_0x1435d5[_0x0baf('0x48')]['id']}},_0x324369={};_0x324369[_0x0baf('0x2e')]=_[_0x0baf('0x2f')](db[_0x0baf('0x2c')]['rawAttributes']);_0x324369[_0x0baf('0x30')]=_[_0x0baf('0x2f')](_0x1435d5['query']);_0x324369[_0x0baf('0x39')]=_[_0x0baf('0x31')](_0x324369[_0x0baf('0x2e')],_0x324369[_0x0baf('0x30')]);_0x38006a['attributes']=_[_0x0baf('0x31')](_0x324369[_0x0baf('0x2e')],qs[_0x0baf('0x33')](_0x1435d5[_0x0baf('0x30')][_0x0baf('0x33')]));_0x38006a[_0x0baf('0x32')]=_0x38006a[_0x0baf('0x32')][_0x0baf('0x34')]?_0x38006a[_0x0baf('0x32')]:_0x324369[_0x0baf('0x2e')];if(_0x1435d5['query'][_0x0baf('0x43')]){_0x38006a[_0x0baf('0x44')]=[{'all':!![]}];}_0x38006a=_[_0x0baf('0x3d')]({},_0x38006a,_0x1435d5[_0x0baf('0x42')]);return db[_0x0baf('0x2c')]['find'](_0x38006a)[_0x0baf('0x25')](handleEntityNotFound(_0x4f1de9,null))[_0x0baf('0x25')](respondWithResult(_0x4f1de9,null))[_0x0baf('0x49')](handleError(_0x4f1de9,null));};exports[_0x0baf('0x4a')]=function(_0x35b5db,_0x54ed41){return db[_0x0baf('0x2c')][_0x0baf('0x4a')](_0x35b5db[_0x0baf('0x4b')],{})[_0x0baf('0x25')](respondWithResult(_0x54ed41,0xc9))[_0x0baf('0x49')](handleError(_0x54ed41,null));};exports[_0x0baf('0x24')]=function(_0x178995,_0x5679d9){if(_0x178995[_0x0baf('0x4b')]['id']){delete _0x178995[_0x0baf('0x4b')]['id'];}return db[_0x0baf('0x2c')]['find']({'where':{'id':_0x178995[_0x0baf('0x48')]['id']}})[_0x0baf('0x25')](handleEntityNotFound(_0x5679d9,null))[_0x0baf('0x25')](saveUpdates(_0x178995[_0x0baf('0x4b')],null))[_0x0baf('0x25')](respondWithResult(_0x5679d9,null))[_0x0baf('0x49')](handleError(_0x5679d9,null));};exports[_0x0baf('0x26')]=function(_0x5a54bb,_0x22c451){return db[_0x0baf('0x2c')][_0x0baf('0x4c')]({'where':{'id':_0x5a54bb[_0x0baf('0x48')]['id']}})[_0x0baf('0x25')](handleEntityNotFound(_0x22c451,null))[_0x0baf('0x25')](removeEntity(_0x22c451,null))[_0x0baf('0x49')](handleError(_0x22c451,null));}; \ No newline at end of file +var _0xb4e6=['pick','filter','merge','type','key','ZohoField','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','offset','sort','where'];(function(_0x1a57c7,_0x1f0c32){var _0xb5899c=function(_0x4b7242){while(--_0x4b7242){_0x1a57c7['push'](_0x1a57c7['shift']());}};_0xb5899c(++_0x1f0c32);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0xb4e6[_0x1e1965];return _0x1a2e96;};'use strict';var pdf=require(_0x6b4e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b4e('0x1'));var zipdir=require(_0x6b4e('0x2'));var jsonpatch=require(_0x6b4e('0x3'));var rp=require(_0x6b4e('0x4'));var moment=require(_0x6b4e('0x5'));var BPromise=require(_0x6b4e('0x6'));var Mustache=require(_0x6b4e('0x7'));var util=require('util');var path=require(_0x6b4e('0x8'));var sox=require(_0x6b4e('0x9'));var csv=require(_0x6b4e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var hardwareService=require(_0x6b4e('0x12'));var logger=require(_0x6b4e('0x13'))('api');var utils=require(_0x6b4e('0x14'));var config=require(_0x6b4e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a4d0f,_0x9cd7da){_0x9cd7da=_0x9cd7da||0xcc;return function(_0x432399){if(_0x432399){return _0x2a4d0f[_0x6b4e('0x16')](_0x9cd7da);}return _0x2a4d0f[_0x6b4e('0x17')](_0x9cd7da)[_0x6b4e('0x18')]();};}function respondWithResult(_0x1db513,_0x531eec){_0x531eec=_0x531eec||0xc8;return function(_0x36f8a5){if(_0x36f8a5){return _0x1db513[_0x6b4e('0x17')](_0x531eec)['json'](_0x36f8a5);}};}function respondWithFilteredResult(_0x29a6df,_0x4b62ad){return function(_0x355f10){if(_0x355f10){var _0x2195c1=_0x355f10[_0x6b4e('0x19')],_0x3ba513=_0x4b62ad['offset'],_0x42e265=_0x4b62ad['offset']+_0x4b62ad[_0x6b4e('0x1a')],_0x28c3ba;if(_0x42e265>=_0x2195c1){_0x42e265=_0x2195c1;_0x28c3ba=0xc8;}else{_0x28c3ba=0xce;}_0x29a6df[_0x6b4e('0x17')](_0x28c3ba);return _0x29a6df[_0x6b4e('0x1b')](_0x6b4e('0x1c'),_0x3ba513+'-'+_0x42e265+'/'+_0x2195c1)[_0x6b4e('0x1d')](_0x355f10);}return null;};}function patchUpdates(_0x1a585d){return function(_0xbba4e9){try{jsonpatch[_0x6b4e('0x1e')](_0xbba4e9,_0x1a585d,!![]);}catch(_0x35aee1){return BPromise[_0x6b4e('0x1f')](_0x35aee1);}return _0xbba4e9[_0x6b4e('0x20')]();};}function saveUpdates(_0x5cb81b,_0x378233){return function(_0x248fea){if(_0x248fea){return _0x248fea[_0x6b4e('0x21')](_0x5cb81b)[_0x6b4e('0x22')](function(_0x5e5dcd){return _0x5e5dcd;});}return null;};}function removeEntity(_0x1b48b5,_0x507703){return function(_0x2503a5){if(_0x2503a5){return _0x2503a5[_0x6b4e('0x23')]()[_0x6b4e('0x22')](function(){_0x1b48b5[_0x6b4e('0x17')](0xcc)[_0x6b4e('0x18')]();});}};}function handleEntityNotFound(_0x346566,_0x3e636f){return function(_0x5c33be){if(!_0x5c33be){_0x346566[_0x6b4e('0x16')](0x194);}return _0x5c33be;};}function handleError(_0x4a8ac4,_0x29cb4a){_0x29cb4a=_0x29cb4a||0x1f4;return function(_0x884b7e){logger[_0x6b4e('0x24')](_0x884b7e[_0x6b4e('0x25')]);if(_0x884b7e['name']){delete _0x884b7e[_0x6b4e('0x26')];}_0x4a8ac4[_0x6b4e('0x17')](_0x29cb4a)['send'](_0x884b7e);};}exports[_0x6b4e('0x27')]=function(_0x381ff0,_0x3513b2){var _0x44b399={},_0x5bfe9e={},_0x2d42be={'count':0x0,'rows':[]};var _0x182375=db['ZohoField'][_0x6b4e('0x28')];_0x5bfe9e[_0x6b4e('0x29')]=_[_0x6b4e('0x2a')](_0x182375);_0x5bfe9e[_0x6b4e('0x2b')]=_['keys'](_0x381ff0[_0x6b4e('0x2b')]);_0x5bfe9e[_0x6b4e('0x2c')]=_['intersection'](_0x5bfe9e[_0x6b4e('0x29')],_0x5bfe9e[_0x6b4e('0x2b')]);_0x44b399[_0x6b4e('0x2d')]=_['intersection'](_0x5bfe9e['model'],qs[_0x6b4e('0x2e')](_0x381ff0[_0x6b4e('0x2b')][_0x6b4e('0x2e')]));_0x44b399['attributes']=_0x44b399[_0x6b4e('0x2d')][_0x6b4e('0x2f')]?_0x44b399[_0x6b4e('0x2d')]:_0x5bfe9e['model'];if(!_0x381ff0['query'][_0x6b4e('0x30')]('nolimit')){_0x44b399[_0x6b4e('0x1a')]=qs[_0x6b4e('0x1a')](_0x381ff0['query'][_0x6b4e('0x1a')]);_0x44b399[_0x6b4e('0x31')]=qs[_0x6b4e('0x31')](_0x381ff0[_0x6b4e('0x2b')]['offset']);}_0x44b399['order']=qs[_0x6b4e('0x32')](_0x381ff0[_0x6b4e('0x2b')][_0x6b4e('0x32')]);_0x44b399[_0x6b4e('0x33')]=qs[_0x6b4e('0x2c')](_[_0x6b4e('0x34')](_0x381ff0[_0x6b4e('0x2b')],_0x5bfe9e[_0x6b4e('0x2c')]));if(_0x381ff0[_0x6b4e('0x2b')][_0x6b4e('0x35')]){_0x44b399[_0x6b4e('0x33')]=_[_0x6b4e('0x36')](_0x44b399[_0x6b4e('0x33')],{'$or':_['map'](_0x182375,function(_0x162786){if(_0x162786[_0x6b4e('0x37')][_0x6b4e('0x38')]!=='VIRTUAL'){var _0x287e74={};_0x287e74[_0x162786['field']]={'$like':'%'+_0x381ff0[_0x6b4e('0x2b')][_0x6b4e('0x35')]+'%'};return _0x287e74;}})});}_0x44b399=_[_0x6b4e('0x36')]({},_0x44b399,_0x381ff0['options']);var _0x550a12={'where':_0x44b399[_0x6b4e('0x33')]};return db[_0x6b4e('0x39')]['count'](_0x550a12)['then'](function(_0x2362e1){_0x2d42be[_0x6b4e('0x19')]=_0x2362e1;if(_0x381ff0[_0x6b4e('0x2b')][_0x6b4e('0x3a')]){_0x44b399[_0x6b4e('0x3b')]=[{'all':!![]}];}return db[_0x6b4e('0x39')][_0x6b4e('0x3c')](_0x44b399);})[_0x6b4e('0x22')](function(_0x2faf8d){_0x2d42be[_0x6b4e('0x3d')]=_0x2faf8d;return _0x2d42be;})[_0x6b4e('0x22')](respondWithFilteredResult(_0x3513b2,_0x44b399))['catch'](handleError(_0x3513b2,null));};exports[_0x6b4e('0x3e')]=function(_0x5516e7,_0x5d5d55){var _0x2a6855={'raw':!![],'where':{'id':_0x5516e7[_0x6b4e('0x3f')]['id']}},_0x29353b={};_0x29353b[_0x6b4e('0x29')]=_[_0x6b4e('0x2a')](db['ZohoField']['rawAttributes']);_0x29353b[_0x6b4e('0x2b')]=_['keys'](_0x5516e7[_0x6b4e('0x2b')]);_0x29353b[_0x6b4e('0x2c')]=_['intersection'](_0x29353b[_0x6b4e('0x29')],_0x29353b['query']);_0x2a6855[_0x6b4e('0x2d')]=_['intersection'](_0x29353b[_0x6b4e('0x29')],qs[_0x6b4e('0x2e')](_0x5516e7[_0x6b4e('0x2b')][_0x6b4e('0x2e')]));_0x2a6855['attributes']=_0x2a6855[_0x6b4e('0x2d')][_0x6b4e('0x2f')]?_0x2a6855[_0x6b4e('0x2d')]:_0x29353b['model'];if(_0x5516e7[_0x6b4e('0x2b')][_0x6b4e('0x3a')]){_0x2a6855[_0x6b4e('0x3b')]=[{'all':!![]}];}_0x2a6855=_[_0x6b4e('0x36')]({},_0x2a6855,_0x5516e7[_0x6b4e('0x40')]);return db[_0x6b4e('0x39')][_0x6b4e('0x41')](_0x2a6855)[_0x6b4e('0x22')](handleEntityNotFound(_0x5d5d55,null))[_0x6b4e('0x22')](respondWithResult(_0x5d5d55,null))['catch'](handleError(_0x5d5d55,null));};exports[_0x6b4e('0x42')]=function(_0x12abfc,_0x148b66){return db[_0x6b4e('0x39')][_0x6b4e('0x42')](_0x12abfc['body'],{})[_0x6b4e('0x22')](respondWithResult(_0x148b66,0xc9))['catch'](handleError(_0x148b66,null));};exports[_0x6b4e('0x21')]=function(_0x3bcfcc,_0x2f2973){if(_0x3bcfcc[_0x6b4e('0x43')]['id']){delete _0x3bcfcc['body']['id'];}return db[_0x6b4e('0x39')][_0x6b4e('0x41')]({'where':{'id':_0x3bcfcc[_0x6b4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f2973,null))[_0x6b4e('0x22')](saveUpdates(_0x3bcfcc[_0x6b4e('0x43')],null))[_0x6b4e('0x22')](respondWithResult(_0x2f2973,null))[_0x6b4e('0x44')](handleError(_0x2f2973,null));};exports[_0x6b4e('0x23')]=function(_0x33c797,_0x289dfa){return db[_0x6b4e('0x39')][_0x6b4e('0x41')]({'where':{'id':_0x33c797[_0x6b4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x289dfa,null))[_0x6b4e('0x22')](removeEntity(_0x289dfa,null))[_0x6b4e('0x44')](handleError(_0x289dfa,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 57cf75f..cc937ef 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 _0x7ea8=['int_zoho_fields','idField','FieldId','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','ZohoField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ea8,0xbe));var _0x87ea=function(_0x716e2c,_0x486adc){_0x716e2c=_0x716e2c-0x0;var _0x458086=_0x7ea8[_0x716e2c];return _0x458086;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x87ea('0x0'))(_0x87ea('0x1'));var moment=require(_0x87ea('0x2'));var BPromise=require('bluebird');var rp=require(_0x87ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87ea('0x4'));var config=require(_0x87ea('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x377608,_0x5814a3){return _0x377608[_0x87ea('0x6')](_0x87ea('0x7'),attributes,{'tableName':_0x87ea('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x87ea('0x9'),_0x87ea('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xedb5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util'];(function(_0x20e7e2,_0x25fe9e){var _0x244716=function(_0xde567f){while(--_0xde567f){_0x20e7e2['push'](_0x20e7e2['shift']());}};_0x244716(++_0x25fe9e);}(_0xedb5,0x1de));var _0x5edb=function(_0x479a53,_0x205f80){_0x479a53=_0x479a53-0x0;var _0x339db5=_0xedb5[_0x479a53];return _0x339db5;};'use strict';var _=require(_0x5edb('0x0'));var util=require(_0x5edb('0x1'));var logger=require(_0x5edb('0x2'))(_0x5edb('0x3'));var moment=require(_0x5edb('0x4'));var BPromise=require(_0x5edb('0x5'));var rp=require(_0x5edb('0x6'));var fs=require('fs');var path=require(_0x5edb('0x7'));var rimraf=require(_0x5edb('0x8'));var config=require(_0x5edb('0x9'));var attributes=require('./intZohoField.attributes');module[_0x5edb('0xa')]=function(_0x1ecc29,_0x1d95b0){return _0x1ecc29['define'](_0x5edb('0xb'),attributes,{'tableName':_0x5edb('0xc'),'paranoid':![],'indexes':[{'name':_0x5edb('0xd'),'fields':[_0x5edb('0xe'),_0x5edb('0xf')],'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 ecf4c7f..f16d1a1 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 _0x42c1=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util'];(function(_0x34a934,_0xf898ad){var _0x7702f9=function(_0x9aa2c1){while(--_0x9aa2c1){_0x34a934['push'](_0x34a934['shift']());}};_0x7702f9(++_0xf898ad);}(_0x42c1,0x98));var _0x142c=function(_0xd220c1,_0x23848b){_0xd220c1=_0xd220c1-0x0;var _0x47d512=_0x42c1[_0xd220c1];return _0x47d512;};'use strict';var _=require(_0x142c('0x0'));var util=require(_0x142c('0x1'));var moment=require(_0x142c('0x2'));var BPromise=require(_0x142c('0x3'));var rs=require(_0x142c('0x4'));var fs=require('fs');var Redis=require(_0x142c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x142c('0x6'));var logger=require(_0x142c('0x7'))('rpc');var config=require(_0x142c('0x8'));var jayson=require(_0x142c('0x9'));var client=jayson[_0x142c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51bb98,_0x554990,_0x598bc6){return new BPromise(function(_0x2411bc,_0x5f4d62){return client[_0x142c('0xb')](_0x51bb98,_0x598bc6)[_0x142c('0xc')](function(_0x6c16e8){logger[_0x142c('0xd')](_0x142c('0xe'),_0x554990,_0x142c('0xf'));logger[_0x142c('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x554990,_0x142c('0xf'),JSON['stringify'](_0x6c16e8));if(_0x6c16e8[_0x142c('0x11')]){if(_0x6c16e8[_0x142c('0x11')][_0x142c('0x12')]===0x1f4){logger[_0x142c('0x11')](_0x142c('0xe'),_0x554990,_0x6c16e8['error']['message']);return _0x5f4d62(_0x6c16e8[_0x142c('0x11')][_0x142c('0x13')]);}logger[_0x142c('0x11')](_0x142c('0xe'),_0x554990,_0x6c16e8[_0x142c('0x11')][_0x142c('0x13')]);return _0x2411bc(_0x6c16e8[_0x142c('0x11')][_0x142c('0x13')]);}else{logger[_0x142c('0xd')](_0x142c('0xe'),_0x554990,_0x142c('0xf'));_0x2411bc(_0x6c16e8[_0x142c('0x14')]['message']);}})[_0x142c('0x15')](function(_0x23057b){logger['error'](_0x142c('0xe'),_0x554990,_0x23057b);_0x5f4d62(_0x23057b);});});} \ No newline at end of file +var _0xab90=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2cc10a,_0x25ac14){var _0x498d80=function(_0x56aef4){while(--_0x56aef4){_0x2cc10a['push'](_0x2cc10a['shift']());}};_0x498d80(++_0x25ac14);}(_0xab90,0x191));var _0x0ab9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xab90[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var moment=require(_0x0ab9('0x2'));var BPromise=require(_0x0ab9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab9('0x4'));var db=require(_0x0ab9('0x5'))['db'];var utils=require(_0x0ab9('0x6'));var logger=require(_0x0ab9('0x7'))(_0x0ab9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5f5b,_0x2a50b6,_0x1a3259){return new BPromise(function(_0x5afec0,_0x45f915){return client[_0x0ab9('0xa')](_0x1c5f5b,_0x1a3259)['then'](function(_0x3df8c7){logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x2a50b6,_0x0ab9('0xd'));logger[_0x0ab9('0xe')](_0x0ab9('0xf'),_0x2a50b6,_0x0ab9('0xd'),JSON['stringify'](_0x3df8c7));if(_0x3df8c7[_0x0ab9('0x10')]){if(_0x3df8c7['error'][_0x0ab9('0x11')]===0x1f4){logger[_0x0ab9('0x10')](_0x0ab9('0xc'),_0x2a50b6,_0x3df8c7['error'][_0x0ab9('0x12')]);return _0x45f915(_0x3df8c7['error'][_0x0ab9('0x12')]);}logger[_0x0ab9('0x10')](_0x0ab9('0xc'),_0x2a50b6,_0x3df8c7[_0x0ab9('0x10')][_0x0ab9('0x12')]);return _0x5afec0(_0x3df8c7[_0x0ab9('0x10')][_0x0ab9('0x12')]);}else{logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x2a50b6,_0x0ab9('0xd'));_0x5afec0(_0x3df8c7[_0x0ab9('0x13')]['message']);}})['catch'](function(_0x2f919c){logger[_0x0ab9('0x10')]('ZohoField,\x20%s,\x20%s',_0x2a50b6,_0x2f919c);_0x45f915(_0x2f919c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dadf4ff..d7df6fa 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 _0x8375=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0xad5775,_0x45f14c){var _0x3ccb65=function(_0x29e505){while(--_0x29e505){_0xad5775['push'](_0xad5775['shift']());}};_0x3ccb65(++_0x45f14c);}(_0x8375,0xa8));var _0x5837=function(_0x42f1de,_0x4e136a){_0x42f1de=_0x42f1de-0x0;var _0x3ca734=_0x8375[_0x42f1de];return _0x3ca734;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var auth=require(_0x5837('0x5'));var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));module[_0x5837('0x8')]=router; \ No newline at end of file +var _0x8784=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','multer'];(function(_0x4e1d2d,_0x5a44e1){var _0x520f96=function(_0x432d2d){while(--_0x432d2d){_0x4e1d2d['push'](_0x4e1d2d['shift']());}};_0x520f96(++_0x5a44e1);}(_0x8784,0x172));var _0x4878=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x8784[_0x5d80de];return _0x1c7556;};'use strict';var multer=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var path=require('path');var timeout=require(_0x4878('0x2'));var express=require(_0x4878('0x3'));var router=express[_0x4878('0x4')]();var auth=require(_0x4878('0x5'));var interaction=require(_0x4878('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 26e0477..2ea184d 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 _0xc943=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x45b36c,_0x4efbfe){var _0x1dad2f=function(_0x1532af){while(--_0x1532af){_0x45b36c['push'](_0x45b36c['shift']());}};_0x1dad2f(++_0x4efbfe);}(_0xc943,0x145));var _0x3c94=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0xc943[_0x56608c];return _0x3c7fb0;};'use strict';var Sequelize=require(_0x3c94('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c94('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x3c94('0x1')],'allowNull':![],'unique':_0x3c94('0x2')},'main':{'type':Sequelize[_0x3c94('0x1')],'defaultValue':_0x3c94('0x3')},'filename':{'type':Sequelize[_0x3c94('0x1')]},'path':{'type':Sequelize[_0x3c94('0x1')]},'type':{'type':Sequelize[_0x3c94('0x1')]},'size':{'type':Sequelize[_0x3c94('0x4')]},'active':{'type':Sequelize[_0x3c94('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x3c94('0x1')]},'state':{'type':Sequelize[_0x3c94('0x1')],'unique':_0x3c94('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3c94('0x1')]},'link':{'type':Sequelize[_0x3c94('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x42b5=['unique_name_and_version','STRING','app.js','state','sequelize'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x42b5,0xd1));var _0x542b=function(_0x5809db,_0x40bc95){_0x5809db=_0x5809db-0x0;var _0x3399bc=_0x42b5[_0x5809db];return _0x3399bc;};'use strict';var Sequelize=require(_0x542b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x542b('0x1')},'version':{'type':Sequelize[_0x542b('0x2')],'allowNull':![],'unique':_0x542b('0x1')},'main':{'type':Sequelize[_0x542b('0x2')],'defaultValue':_0x542b('0x3')},'filename':{'type':Sequelize[_0x542b('0x2')]},'path':{'type':Sequelize[_0x542b('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x542b('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x542b('0x4')},'description':{'type':Sequelize[_0x542b('0x2')]},'title':{'type':Sequelize[_0x542b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x542b('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 6c92128..461b674 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 _0x6da5=['status','json','count','offset','set','Content-Range','reject','then','destroy','end','error','stack','index','Integration','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','type','field','options','includeAll','findAll','rows','catch','params','find','create','body','html-pdf','request-promise','bluebird','path','sox','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xd67ffb,_0x2f7ebc){var _0x51d5fb=function(_0x1e2dfd){while(--_0x1e2dfd){_0xd67ffb['push'](_0xd67ffb['shift']());}};_0x51d5fb(++_0x2f7ebc);}(_0x6da5,0x12c));var _0x56da=function(_0x3c28aa,_0x43d5dc){_0x3c28aa=_0x3c28aa-0x0;var _0x426778=_0x6da5[_0x3c28aa];return _0x426778;};'use strict';var pdf=require(_0x56da('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56da('0x1'));var moment=require('moment');var BPromise=require(_0x56da('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x56da('0x3'));var sox=require(_0x56da('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x56da('0x5'));var squel=require(_0x56da('0x6'));var crypto=require(_0x56da('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x56da('0x8'));var querystring=require(_0x56da('0x9'));var Papa=require('papaparse');var Redis=require(_0x56da('0xa'));var authService=require(_0x56da('0xb'));var qs=require(_0x56da('0xc'));var hardwareService=require(_0x56da('0xd'));var logger=require(_0x56da('0xe'))(_0x56da('0xf'));var utils=require(_0x56da('0x10'));var config=require(_0x56da('0x11'));var db=require(_0x56da('0x12'))['db'];function respondWithStatusCode(_0x2514fd,_0x522737){_0x522737=_0x522737||0xcc;return function(_0x53b176){if(_0x53b176){return _0x2514fd[_0x56da('0x13')](_0x522737);}return _0x2514fd['status'](_0x522737)['end']();};}function respondWithResult(_0x4f3ef5,_0x4c04f1){_0x4c04f1=_0x4c04f1||0xc8;return function(_0x345c3a){if(_0x345c3a){return _0x4f3ef5[_0x56da('0x14')](_0x4c04f1)[_0x56da('0x15')](_0x345c3a);}};}function respondWithFilteredResult(_0x3d9d20,_0x37e35c){return function(_0x3dac0b){if(_0x3dac0b){var _0x18d16f=_0x3dac0b[_0x56da('0x16')],_0x332744=_0x37e35c[_0x56da('0x17')],_0x59f1e2=_0x37e35c[_0x56da('0x17')]+_0x37e35c['limit'],_0x37b575;if(_0x59f1e2>=_0x18d16f){_0x59f1e2=_0x18d16f;_0x37b575=0xc8;}else{_0x37b575=0xce;}_0x3d9d20[_0x56da('0x14')](_0x37b575);return _0x3d9d20[_0x56da('0x18')](_0x56da('0x19'),_0x332744+'-'+_0x59f1e2+'/'+_0x18d16f)[_0x56da('0x15')](_0x3dac0b);}return null;};}function patchUpdates(_0x198198){return function(_0xc974c5){try{jsonpatch['apply'](_0xc974c5,_0x198198,!![]);}catch(_0x151940){return BPromise[_0x56da('0x1a')](_0x151940);}return _0xc974c5['save']();};}function saveUpdates(_0x31a440,_0xc6436b){return function(_0x12a116){if(_0x12a116){return _0x12a116['update'](_0x31a440)[_0x56da('0x1b')](function(_0x240121){return _0x240121;});}return null;};}function removeEntity(_0x42e476,_0x23d237){return function(_0x5a7550){if(_0x5a7550){return _0x5a7550[_0x56da('0x1c')]()[_0x56da('0x1b')](function(){_0x42e476['status'](0xcc)[_0x56da('0x1d')]();});}};}function handleEntityNotFound(_0x5073bf,_0x59b693){return function(_0x2e9b6f){if(!_0x2e9b6f){_0x5073bf[_0x56da('0x13')](0x194);}return _0x2e9b6f;};}function handleError(_0x3aad19,_0x3d301f){_0x3d301f=_0x3d301f||0x1f4;return function(_0x2d2131){logger[_0x56da('0x1e')](_0x2d2131[_0x56da('0x1f')]);if(_0x2d2131['name']){delete _0x2d2131['name'];}_0x3aad19[_0x56da('0x14')](_0x3d301f)['send'](_0x2d2131);};}exports[_0x56da('0x20')]=function(_0x955089,_0x2c9233){var _0x272cba={},_0x108f32={},_0x6cdfb6={'count':0x0,'rows':[]};var _0x55af01=db[_0x56da('0x21')][_0x56da('0x22')];_0x108f32['model']=_[_0x56da('0x23')](_0x55af01);_0x108f32[_0x56da('0x24')]=_[_0x56da('0x23')](_0x955089[_0x56da('0x24')]);_0x108f32[_0x56da('0x25')]=_[_0x56da('0x26')](_0x108f32[_0x56da('0x27')],_0x108f32['query']);_0x272cba['attributes']=_[_0x56da('0x26')](_0x108f32['model'],qs[_0x56da('0x28')](_0x955089[_0x56da('0x24')][_0x56da('0x28')]));_0x272cba[_0x56da('0x29')]=_0x272cba['attributes'][_0x56da('0x2a')]?_0x272cba[_0x56da('0x29')]:_0x108f32['model'];if(!_0x955089[_0x56da('0x24')][_0x56da('0x2b')](_0x56da('0x2c'))){_0x272cba[_0x56da('0x2d')]=qs[_0x56da('0x2d')](_0x955089[_0x56da('0x24')][_0x56da('0x2d')]);_0x272cba['offset']=qs['offset'](_0x955089['query'][_0x56da('0x17')]);}_0x272cba[_0x56da('0x2e')]=qs[_0x56da('0x2f')](_0x955089[_0x56da('0x24')][_0x56da('0x2f')]);_0x272cba['where']=qs[_0x56da('0x25')](_[_0x56da('0x30')](_0x955089[_0x56da('0x24')],_0x108f32[_0x56da('0x25')]));if(_0x955089[_0x56da('0x24')][_0x56da('0x31')]){_0x272cba[_0x56da('0x32')]=_[_0x56da('0x33')](_0x272cba[_0x56da('0x32')],{'$or':_[_0x56da('0x34')](_0x55af01,function(_0x16976d){if(_0x16976d[_0x56da('0x35')]['key']!=='VIRTUAL'){var _0x523e77={};_0x523e77[_0x16976d[_0x56da('0x36')]]={'$like':'%'+_0x955089[_0x56da('0x24')][_0x56da('0x31')]+'%'};return _0x523e77;}})});}_0x272cba=_[_0x56da('0x33')]({},_0x272cba,_0x955089[_0x56da('0x37')]);var _0x2ce880={'where':_0x272cba[_0x56da('0x32')]};return db[_0x56da('0x21')][_0x56da('0x16')](_0x2ce880)[_0x56da('0x1b')](function(_0x407753){_0x6cdfb6[_0x56da('0x16')]=_0x407753;if(_0x955089[_0x56da('0x24')][_0x56da('0x38')]){_0x272cba['include']=[{'all':!![]}];}return db[_0x56da('0x21')][_0x56da('0x39')](_0x272cba);})[_0x56da('0x1b')](function(_0x2bcabf){_0x6cdfb6[_0x56da('0x3a')]=_0x2bcabf;return _0x6cdfb6;})['then'](respondWithFilteredResult(_0x2c9233,_0x272cba))[_0x56da('0x3b')](handleError(_0x2c9233,null));};exports['show']=function(_0x329486,_0x321643){var _0x55491e={'raw':![],'where':{'id':_0x329486[_0x56da('0x3c')]['id']}},_0x4d3ff2={};_0x4d3ff2[_0x56da('0x27')]=_['keys'](db[_0x56da('0x21')][_0x56da('0x22')]);_0x4d3ff2[_0x56da('0x24')]=_['keys'](_0x329486[_0x56da('0x24')]);_0x4d3ff2[_0x56da('0x25')]=_[_0x56da('0x26')](_0x4d3ff2['model'],_0x4d3ff2[_0x56da('0x24')]);_0x55491e[_0x56da('0x29')]=_[_0x56da('0x26')](_0x4d3ff2[_0x56da('0x27')],qs[_0x56da('0x28')](_0x329486['query']['fields']));_0x55491e[_0x56da('0x29')]=_0x55491e[_0x56da('0x29')]['length']?_0x55491e[_0x56da('0x29')]:_0x4d3ff2['model'];if(_0x329486[_0x56da('0x24')][_0x56da('0x38')]){_0x55491e['include']=[{'all':!![]}];}_0x55491e=_[_0x56da('0x33')]({},_0x55491e,_0x329486['options']);return db['Integration'][_0x56da('0x3d')](_0x55491e)['then'](handleEntityNotFound(_0x321643,null))[_0x56da('0x1b')](respondWithResult(_0x321643,null))['catch'](handleError(_0x321643,null));};exports[_0x56da('0x3e')]=function(_0x5acaa7,_0x1e1940){return db['Integration'][_0x56da('0x3e')](_0x5acaa7[_0x56da('0x3f')],{})[_0x56da('0x1b')](respondWithResult(_0x1e1940,0xc9))['catch'](handleError(_0x1e1940,null));};exports['update']=function(_0x4b9eea,_0x2f4cca){if(_0x4b9eea[_0x56da('0x3f')]['id']){delete _0x4b9eea[_0x56da('0x3f')]['id'];}return db[_0x56da('0x21')][_0x56da('0x3d')]({'where':{'id':_0x4b9eea[_0x56da('0x3c')]['id']}})[_0x56da('0x1b')](handleEntityNotFound(_0x2f4cca,null))[_0x56da('0x1b')](saveUpdates(_0x4b9eea[_0x56da('0x3f')],null))[_0x56da('0x1b')](respondWithResult(_0x2f4cca,null))['catch'](handleError(_0x2f4cca,null));};exports[_0x56da('0x1c')]=function(_0x26bddc,_0x330998){return db[_0x56da('0x21')]['find']({'where':{'id':_0x26bddc['params']['id']}})[_0x56da('0x1b')](handleEntityNotFound(_0x330998,null))[_0x56da('0x1b')](removeEntity(_0x330998,null))['catch'](handleError(_0x330998,null));}; \ No newline at end of file +var _0x327c=['status','end','count','offset','limit','set','apply','reject','then','error','stack','name','index','Integration','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','create','body','update','find','destroy','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x3c68ca,_0x3dc3d7){var _0x287e70=function(_0x4f7e51){while(--_0x4f7e51){_0x3c68ca['push'](_0x3c68ca['shift']());}};_0x287e70(++_0x3dc3d7);}(_0x327c,0xf6));var _0xc327=function(_0x46c596,_0x46c67c){_0x46c596=_0x46c596-0x0;var _0x2e167b=_0x327c[_0x46c596];return _0x2e167b;};'use strict';var pdf=require(_0xc327('0x0'));var emlformat=require(_0xc327('0x1'));var rimraf=require(_0xc327('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc327('0x3'));var moment=require(_0xc327('0x4'));var BPromise=require(_0xc327('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc327('0x6'));var csv=require('to-csv');var ejs=require(_0xc327('0x7'));var fs=require('fs');var _=require(_0xc327('0x8'));var squel=require(_0xc327('0x9'));var crypto=require(_0xc327('0xa'));var jsforce=require(_0xc327('0xb'));var deskjs=require(_0xc327('0xc'));var toCsv=require(_0xc327('0xd'));var querystring=require(_0xc327('0xe'));var Papa=require(_0xc327('0xf'));var Redis=require('ioredis');var authService=require(_0xc327('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc327('0x11'));var logger=require('../../config/logger')(_0xc327('0x12'));var utils=require(_0xc327('0x13'));var config=require(_0xc327('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ce1c2,_0x3fb874){_0x3fb874=_0x3fb874||0xcc;return function(_0x144168){if(_0x144168){return _0x4ce1c2[_0xc327('0x15')](_0x3fb874);}return _0x4ce1c2[_0xc327('0x16')](_0x3fb874)[_0xc327('0x17')]();};}function respondWithResult(_0x25f915,_0x4dfc60){_0x4dfc60=_0x4dfc60||0xc8;return function(_0x5c3f7c){if(_0x5c3f7c){return _0x25f915[_0xc327('0x16')](_0x4dfc60)['json'](_0x5c3f7c);}};}function respondWithFilteredResult(_0x3ba5d2,_0x5e74fc){return function(_0x22f5d8){if(_0x22f5d8){var _0x1fe0ff=_0x22f5d8[_0xc327('0x18')],_0x59618a=_0x5e74fc[_0xc327('0x19')],_0x54183f=_0x5e74fc['offset']+_0x5e74fc[_0xc327('0x1a')],_0x1dacaa;if(_0x54183f>=_0x1fe0ff){_0x54183f=_0x1fe0ff;_0x1dacaa=0xc8;}else{_0x1dacaa=0xce;}_0x3ba5d2[_0xc327('0x16')](_0x1dacaa);return _0x3ba5d2[_0xc327('0x1b')]('Content-Range',_0x59618a+'-'+_0x54183f+'/'+_0x1fe0ff)['json'](_0x22f5d8);}return null;};}function patchUpdates(_0xfc3d43){return function(_0x4645a9){try{jsonpatch[_0xc327('0x1c')](_0x4645a9,_0xfc3d43,!![]);}catch(_0x1d48e7){return BPromise[_0xc327('0x1d')](_0x1d48e7);}return _0x4645a9['save']();};}function saveUpdates(_0x4cb240,_0xa7fbae){return function(_0xcd3854){if(_0xcd3854){return _0xcd3854['update'](_0x4cb240)['then'](function(_0x1350b3){return _0x1350b3;});}return null;};}function removeEntity(_0x1a77af,_0xdd0f10){return function(_0x19e60a){if(_0x19e60a){return _0x19e60a['destroy']()[_0xc327('0x1e')](function(){_0x1a77af[_0xc327('0x16')](0xcc)[_0xc327('0x17')]();});}};}function handleEntityNotFound(_0x1ae82b,_0x29a228){return function(_0x285a64){if(!_0x285a64){_0x1ae82b[_0xc327('0x15')](0x194);}return _0x285a64;};}function handleError(_0x3db21b,_0x5737ff){_0x5737ff=_0x5737ff||0x1f4;return function(_0x3a0857){logger[_0xc327('0x1f')](_0x3a0857[_0xc327('0x20')]);if(_0x3a0857[_0xc327('0x21')]){delete _0x3a0857[_0xc327('0x21')];}_0x3db21b[_0xc327('0x16')](_0x5737ff)['send'](_0x3a0857);};}exports[_0xc327('0x22')]=function(_0x2aa53e,_0x541daa){var _0x33bd86={},_0x53b1b5={},_0x36ee55={'count':0x0,'rows':[]};var _0x5b08ac=db[_0xc327('0x23')][_0xc327('0x24')];_0x53b1b5[_0xc327('0x25')]=_[_0xc327('0x26')](_0x5b08ac);_0x53b1b5[_0xc327('0x27')]=_[_0xc327('0x26')](_0x2aa53e[_0xc327('0x27')]);_0x53b1b5['filters']=_[_0xc327('0x28')](_0x53b1b5['model'],_0x53b1b5['query']);_0x33bd86[_0xc327('0x29')]=_['intersection'](_0x53b1b5['model'],qs[_0xc327('0x2a')](_0x2aa53e[_0xc327('0x27')][_0xc327('0x2a')]));_0x33bd86[_0xc327('0x29')]=_0x33bd86['attributes']['length']?_0x33bd86['attributes']:_0x53b1b5[_0xc327('0x25')];if(!_0x2aa53e[_0xc327('0x27')][_0xc327('0x2b')](_0xc327('0x2c'))){_0x33bd86[_0xc327('0x1a')]=qs[_0xc327('0x1a')](_0x2aa53e[_0xc327('0x27')][_0xc327('0x1a')]);_0x33bd86[_0xc327('0x19')]=qs[_0xc327('0x19')](_0x2aa53e[_0xc327('0x27')][_0xc327('0x19')]);}_0x33bd86['order']=qs[_0xc327('0x2d')](_0x2aa53e[_0xc327('0x27')][_0xc327('0x2d')]);_0x33bd86[_0xc327('0x2e')]=qs['filters'](_['pick'](_0x2aa53e[_0xc327('0x27')],_0x53b1b5[_0xc327('0x2f')]));if(_0x2aa53e[_0xc327('0x27')][_0xc327('0x30')]){_0x33bd86['where']=_[_0xc327('0x31')](_0x33bd86['where'],{'$or':_[_0xc327('0x32')](_0x5b08ac,function(_0x30ee25){if(_0x30ee25['type'][_0xc327('0x33')]!==_0xc327('0x34')){var _0x17b493={};_0x17b493[_0x30ee25[_0xc327('0x35')]]={'$like':'%'+_0x2aa53e[_0xc327('0x27')][_0xc327('0x30')]+'%'};return _0x17b493;}})});}_0x33bd86=_[_0xc327('0x31')]({},_0x33bd86,_0x2aa53e['options']);var _0x383849={'where':_0x33bd86[_0xc327('0x2e')]};return db[_0xc327('0x23')][_0xc327('0x18')](_0x383849)[_0xc327('0x1e')](function(_0x362800){_0x36ee55[_0xc327('0x18')]=_0x362800;if(_0x2aa53e[_0xc327('0x27')][_0xc327('0x36')]){_0x33bd86[_0xc327('0x37')]=[{'all':!![]}];}return db['Integration'][_0xc327('0x38')](_0x33bd86);})['then'](function(_0x1c5971){_0x36ee55[_0xc327('0x39')]=_0x1c5971;return _0x36ee55;})[_0xc327('0x1e')](respondWithFilteredResult(_0x541daa,_0x33bd86))[_0xc327('0x3a')](handleError(_0x541daa,null));};exports[_0xc327('0x3b')]=function(_0xb713f8,_0x49d60b){var _0x2b3c9a={'raw':![],'where':{'id':_0xb713f8[_0xc327('0x3c')]['id']}},_0x41904c={};_0x41904c['model']=_['keys'](db[_0xc327('0x23')]['rawAttributes']);_0x41904c[_0xc327('0x27')]=_['keys'](_0xb713f8[_0xc327('0x27')]);_0x41904c[_0xc327('0x2f')]=_[_0xc327('0x28')](_0x41904c[_0xc327('0x25')],_0x41904c['query']);_0x2b3c9a[_0xc327('0x29')]=_[_0xc327('0x28')](_0x41904c[_0xc327('0x25')],qs[_0xc327('0x2a')](_0xb713f8['query']['fields']));_0x2b3c9a[_0xc327('0x29')]=_0x2b3c9a[_0xc327('0x29')]['length']?_0x2b3c9a[_0xc327('0x29')]:_0x41904c['model'];if(_0xb713f8['query'][_0xc327('0x36')]){_0x2b3c9a[_0xc327('0x37')]=[{'all':!![]}];}_0x2b3c9a=_[_0xc327('0x31')]({},_0x2b3c9a,_0xb713f8[_0xc327('0x3d')]);return db[_0xc327('0x23')]['find'](_0x2b3c9a)[_0xc327('0x1e')](handleEntityNotFound(_0x49d60b,null))[_0xc327('0x1e')](respondWithResult(_0x49d60b,null))['catch'](handleError(_0x49d60b,null));};exports[_0xc327('0x3e')]=function(_0x249d18,_0x1a6870){return db[_0xc327('0x23')]['create'](_0x249d18[_0xc327('0x3f')],{})[_0xc327('0x1e')](respondWithResult(_0x1a6870,0xc9))[_0xc327('0x3a')](handleError(_0x1a6870,null));};exports[_0xc327('0x40')]=function(_0xf707fd,_0xf766a6){if(_0xf707fd[_0xc327('0x3f')]['id']){delete _0xf707fd[_0xc327('0x3f')]['id'];}return db['Integration'][_0xc327('0x41')]({'where':{'id':_0xf707fd[_0xc327('0x3c')]['id']}})[_0xc327('0x1e')](handleEntityNotFound(_0xf766a6,null))[_0xc327('0x1e')](saveUpdates(_0xf707fd[_0xc327('0x3f')],null))[_0xc327('0x1e')](respondWithResult(_0xf766a6,null))['catch'](handleError(_0xf766a6,null));};exports[_0xc327('0x42')]=function(_0x5890b2,_0x2db117){return db[_0xc327('0x23')][_0xc327('0x41')]({'where':{'id':_0x5890b2[_0xc327('0x3c')]['id']}})[_0xc327('0x1e')](handleEntityNotFound(_0x2db117,null))[_0xc327('0x1e')](removeEntity(_0x2db117,null))['catch'](handleError(_0x2db117,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 595b545..ede23fd 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 _0x9b6b=['bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b6b,0x11a));var _0xb9b6=function(_0x2e0621,_0x2ac6c0){_0x2e0621=_0x2e0621-0x0;var _0x4a21c1=_0x9b6b[_0x2e0621];return _0x4a21c1;};'use strict';var _=require(_0xb9b6('0x0'));var util=require(_0xb9b6('0x1'));var logger=require('../../config/logger')(_0xb9b6('0x2'));var moment=require(_0xb9b6('0x3'));var BPromise=require(_0xb9b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9b6('0x5'));var config=require(_0xb9b6('0x6'));var attributes=require(_0xb9b6('0x7'));module[_0xb9b6('0x8')]=function(_0x13d0fb,_0x212080){return _0x13d0fb[_0xb9b6('0x9')]('Integration',attributes,{'tableName':_0xb9b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7987=['bluebird','path','exports','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x378fcb,_0x32e78c){var _0x5dfe9b=function(_0x14cf62){while(--_0x14cf62){_0x378fcb['push'](_0x378fcb['shift']());}};_0x5dfe9b(++_0x32e78c);}(_0x7987,0x9e));var _0x7798=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x7987[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x7798('0x0'));var util=require(_0x7798('0x1'));var logger=require(_0x7798('0x2'))(_0x7798('0x3'));var moment=require('moment');var BPromise=require(_0x7798('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7798('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x7798('0x6')]=function(_0x568daf,_0x1d36d6){return _0x568daf['define'](_0x7798('0x7'),attributes,{'tableName':_0x7798('0x8'),'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 ba90e01..dd20be3 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 _0xef93=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xef93,0x188));var _0x3ef9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef93[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3ef9('0x0'));var util=require(_0x3ef9('0x1'));var moment=require(_0x3ef9('0x2'));var BPromise=require(_0x3ef9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ef9('0x4'));var db=require(_0x3ef9('0x5'))['db'];var utils=require(_0x3ef9('0x6'));var logger=require(_0x3ef9('0x7'))(_0x3ef9('0x8'));var config=require(_0x3ef9('0x9'));var jayson=require(_0x3ef9('0xa'));var client=jayson['client'][_0x3ef9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x444982,_0x128171,_0x3fd169){return new BPromise(function(_0x189dff,_0x286927){return client[_0x3ef9('0xc')](_0x444982,_0x3fd169)['then'](function(_0x39780e){logger['info'](_0x3ef9('0xd'),_0x128171,_0x3ef9('0xe'));logger['debug'](_0x3ef9('0xf'),_0x128171,_0x3ef9('0xe'),JSON[_0x3ef9('0x10')](_0x39780e));if(_0x39780e[_0x3ef9('0x11')]){if(_0x39780e[_0x3ef9('0x11')]['code']===0x1f4){logger[_0x3ef9('0x11')](_0x3ef9('0xd'),_0x128171,_0x39780e[_0x3ef9('0x11')][_0x3ef9('0x12')]);return _0x286927(_0x39780e[_0x3ef9('0x11')][_0x3ef9('0x12')]);}logger[_0x3ef9('0x11')](_0x3ef9('0xd'),_0x128171,_0x39780e[_0x3ef9('0x11')]['message']);return _0x189dff(_0x39780e[_0x3ef9('0x11')][_0x3ef9('0x12')]);}else{logger[_0x3ef9('0x13')](_0x3ef9('0xd'),_0x128171,_0x3ef9('0xe'));_0x189dff(_0x39780e['result']['message']);}})[_0x3ef9('0x14')](function(_0x4a9196){logger[_0x3ef9('0x11')]('Integration,\x20%s,\x20%s',_0x128171,_0x4a9196);_0x286927(_0x4a9196);});});} \ No newline at end of file +var _0x0f2c=['bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x5d338b,_0x42aac5){var _0x5a5df4=function(_0x432501){while(--_0x432501){_0x5d338b['push'](_0x5d338b['shift']());}};_0x5a5df4(++_0x42aac5);}(_0x0f2c,0x1a2));var _0xc0f2=function(_0x572f1b,_0x2d80ca){_0x572f1b=_0x572f1b-0x0;var _0x53836c=_0x0f2c[_0x572f1b];return _0x53836c;};'use strict';var _=require(_0xc0f2('0x0'));var util=require(_0xc0f2('0x1'));var moment=require('moment');var BPromise=require(_0xc0f2('0x2'));var rs=require(_0xc0f2('0x3'));var fs=require('fs');var Redis=require(_0xc0f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc0f2('0x5'));var config=require('../../config/environment');var jayson=require(_0xc0f2('0x6'));var client=jayson[_0xc0f2('0x7')][_0xc0f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e83ea,_0x4cd4ee,_0x32e968){return new BPromise(function(_0xc0cc8f,_0x2c89db){return client[_0xc0f2('0x9')](_0x1e83ea,_0x32e968)[_0xc0f2('0xa')](function(_0x5a0081){logger[_0xc0f2('0xb')](_0xc0f2('0xc'),_0x4cd4ee,_0xc0f2('0xd'));logger[_0xc0f2('0xe')](_0xc0f2('0xf'),_0x4cd4ee,'request\x20sent',JSON['stringify'](_0x5a0081));if(_0x5a0081[_0xc0f2('0x10')]){if(_0x5a0081[_0xc0f2('0x10')][_0xc0f2('0x11')]===0x1f4){logger[_0xc0f2('0x10')]('Integration,\x20%s,\x20%s',_0x4cd4ee,_0x5a0081[_0xc0f2('0x10')][_0xc0f2('0x12')]);return _0x2c89db(_0x5a0081[_0xc0f2('0x10')][_0xc0f2('0x12')]);}logger['error'](_0xc0f2('0xc'),_0x4cd4ee,_0x5a0081[_0xc0f2('0x10')][_0xc0f2('0x12')]);return _0xc0cc8f(_0x5a0081['error'][_0xc0f2('0x12')]);}else{logger[_0xc0f2('0xb')](_0xc0f2('0xc'),_0x4cd4ee,_0xc0f2('0xd'));_0xc0cc8f(_0x5a0081[_0xc0f2('0x13')][_0xc0f2('0x12')]);}})[_0xc0f2('0x14')](function(_0x3a46c6){logger['error'](_0xc0f2('0xc'),_0x4cd4ee,_0x3a46c6);_0x2c89db(_0x3a46c6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8d2dbf3..f4e144e 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 _0x2052=['/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2052,0x7a));var _0x2205=function(_0x4c39f0,_0x137862){_0x4c39f0=_0x4c39f0-0x0;var _0x380cc2=_0x2052[_0x4c39f0];return _0x380cc2;};'use strict';var multer=require('multer');var util=require(_0x2205('0x0'));var path=require('path');var timeout=require(_0x2205('0x1'));var express=require(_0x2205('0x2'));var router=express['Router']();var auth=require(_0x2205('0x3'));var interaction=require(_0x2205('0x4'));var config=require(_0x2205('0x5'));var controller=require(_0x2205('0x6'));router[_0x2205('0x7')]('/',auth[_0x2205('0x8')](),controller[_0x2205('0x9')]);router[_0x2205('0x7')](_0x2205('0xa'),auth[_0x2205('0x8')](),controller['describe']);router[_0x2205('0x7')](_0x2205('0xb'),auth['isAuthenticated'](),controller[_0x2205('0xc')]);router[_0x2205('0xd')]('/',auth[_0x2205('0x8')](),controller[_0x2205('0xe')]);router[_0x2205('0xf')](_0x2205('0xb'),auth[_0x2205('0x8')](),controller[_0x2205('0x10')]);router[_0x2205('0x11')]('/:id',auth[_0x2205('0x8')](),controller[_0x2205('0x12')]);module['exports']=router; \ No newline at end of file +var _0x190b=['../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy','exports','multer','util','path','express','Router'];(function(_0xc2ecb1,_0x5746a2){var _0x32f153=function(_0x417213){while(--_0x417213){_0xc2ecb1['push'](_0xc2ecb1['shift']());}};_0x32f153(++_0x5746a2);}(_0x190b,0x1ab));var _0xb190=function(_0x4e18db,_0x57ec67){_0x4e18db=_0x4e18db-0x0;var _0xe7bde9=_0x190b[_0x4e18db];return _0xe7bde9;};'use strict';var multer=require(_0xb190('0x0'));var util=require(_0xb190('0x1'));var path=require(_0xb190('0x2'));var timeout=require('connect-timeout');var express=require(_0xb190('0x3'));var router=express[_0xb190('0x4')]();var auth=require(_0xb190('0x5'));var interaction=require(_0xb190('0x6'));var config=require('../../config/environment');var controller=require(_0xb190('0x7'));router[_0xb190('0x8')]('/',auth[_0xb190('0x9')](),controller[_0xb190('0xa')]);router[_0xb190('0x8')](_0xb190('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb190('0x8')](_0xb190('0xc'),auth[_0xb190('0x9')](),controller[_0xb190('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb190('0xe')](_0xb190('0xc'),auth[_0xb190('0x9')](),controller['update']);router[_0xb190('0xf')]('/:id',auth[_0xb190('0x9')](),controller[_0xb190('0x10')]);module[_0xb190('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4ba090d..ab48a01 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 _0x70d0=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70d0,0xee));var _0x070d=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x70d0[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x070d('0x0'));module[_0x070d('0x1')]={'integration':{'type':Sequelize[_0x070d('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x070d('0x2')]},'ticketId':{'type':Sequelize[_0x070d('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x070d('0x2')]},'uniqueid':{'type':Sequelize[_0x070d('0x2')]},'calleridnum':{'type':Sequelize[_0x070d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x070d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x070d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x070d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x070d('0x3')]},'holdtime':{'type':Sequelize[_0x070d('0x4')]},'agentcomplete':{'type':Sequelize[_0x070d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x070d('0x3')]},'talktime':{'type':Sequelize[_0x070d('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x070d('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x070d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x070d('0x3')]},'agentdump':{'type':Sequelize[_0x070d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x070d('0x3')]},'lastevent':{'type':Sequelize[_0x070d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x070d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x070d('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x070d('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x070d('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x070d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x070d('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x070d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x070d('0x2')]},'destuniqueid':{'type':Sequelize[_0x070d('0x2')]},'messageId':{'type':Sequelize[_0x070d('0x2')]},'inReplyTo':{'type':Sequelize[_0x070d('0x2')]},'subject':{'type':Sequelize[_0x070d('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x070d('0x2')]},'cc':{'type':Sequelize[_0x070d('0x2')]},'attachment':{'type':Sequelize[_0x070d('0x6')]},'html':{'type':Sequelize[_0x070d('0x6')]},'text':{'type':Sequelize[_0x070d('0x6')]},'status':{'type':Sequelize[_0x070d('0x7')](_0x070d('0x8'),_0x070d('0x9'),_0x070d('0xa'),_0x070d('0xb'))},'url':{'type':Sequelize[_0x070d('0x2')]},'app':{'type':Sequelize[_0x070d('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x070d('0x4')]}}; \ No newline at end of file +var _0xa8da=['sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x2cf7cb,_0x21baf9){var _0x1132bf=function(_0x46a88a){while(--_0x46a88a){_0x2cf7cb['push'](_0x2cf7cb['shift']());}};_0x1132bf(++_0x21baf9);}(_0xa8da,0x186));var _0xaa8d=function(_0x1814bd,_0x274d75){_0x1814bd=_0x1814bd-0x0;var _0x58c235=_0xa8da[_0x1814bd];return _0x58c235;};'use strict';var Sequelize=require(_0xaa8d('0x0'));module['exports']={'integration':{'type':Sequelize[_0xaa8d('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xaa8d('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xaa8d('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaa8d('0x1')]},'calleridnum':{'type':Sequelize[_0xaa8d('0x1')]},'calleridname':{'type':Sequelize[_0xaa8d('0x1')]},'queue':{'type':Sequelize[_0xaa8d('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xaa8d('0x1')]},'agentcalledAt':{'type':Sequelize[_0xaa8d('0x3')]},'agentconnectAt':{'type':Sequelize[_0xaa8d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xaa8d('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xaa8d('0x3')]},'talktime':{'type':Sequelize[_0xaa8d('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xaa8d('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xaa8d('0x3')]},'agentdump':{'type':Sequelize[_0xaa8d('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xaa8d('0x3')]},'lastevent':{'type':Sequelize[_0xaa8d('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaa8d('0x2')]},'channelstatedesc':{'type':Sequelize[_0xaa8d('0x1')]},'connectedlinenum':{'type':Sequelize[_0xaa8d('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaa8d('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa8d('0x1')]},'exten':{'type':Sequelize[_0xaa8d('0x1')]},'priority':{'type':Sequelize[_0xaa8d('0x1')]},'destchannel':{'type':Sequelize[_0xaa8d('0x1')]},'destchannelstate':{'type':Sequelize[_0xaa8d('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaa8d('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xaa8d('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xaa8d('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xaa8d('0x1')]},'destpriority':{'type':Sequelize[_0xaa8d('0x1')]},'destuniqueid':{'type':Sequelize[_0xaa8d('0x1')]},'messageId':{'type':Sequelize[_0xaa8d('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xaa8d('0x1')]},'from':{'type':Sequelize[_0xaa8d('0x1')]},'to':{'type':Sequelize[_0xaa8d('0x1')]},'cc':{'type':Sequelize[_0xaa8d('0x1')]},'attachment':{'type':Sequelize[_0xaa8d('0x5')]},'html':{'type':Sequelize[_0xaa8d('0x5')]},'text':{'type':Sequelize[_0xaa8d('0x5')]},'status':{'type':Sequelize[_0xaa8d('0x6')](_0xaa8d('0x7'),_0xaa8d('0x8'),_0xaa8d('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xaa8d('0x1')]},'projectId':{'type':Sequelize[_0xaa8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 35e7889..eb037d2 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 _0x0b78=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','index','IntegrationReport','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','show','params','rawAttributes','length','include','create','catch','update','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x20642b,_0x4960e0){var _0x12523c=function(_0x440044){while(--_0x440044){_0x20642b['push'](_0x20642b['shift']());}};_0x12523c(++_0x4960e0);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x80b7('0x0'));var emlformat=require(_0x80b7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x80b7('0x2'));var jsonpatch=require(_0x80b7('0x3'));var rp=require('request-promise');var moment=require(_0x80b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x80b7('0x5'));var util=require(_0x80b7('0x6'));var path=require(_0x80b7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x80b7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x80b7('0x9'));var crypto=require(_0x80b7('0xa'));var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x80b7('0xd'));var Papa=require(_0x80b7('0xe'));var Redis=require(_0x80b7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x11'))(_0x80b7('0x12'));var utils=require(_0x80b7('0x13'));var config=require(_0x80b7('0x14'));var db=require(_0x80b7('0x15'))['db'];function respondWithStatusCode(_0x2d61d4,_0x3f8c16){_0x3f8c16=_0x3f8c16||0xcc;return function(_0x145241){if(_0x145241){return _0x2d61d4[_0x80b7('0x16')](_0x3f8c16);}return _0x2d61d4[_0x80b7('0x17')](_0x3f8c16)[_0x80b7('0x18')]();};}function respondWithResult(_0x519401,_0x2c2668){_0x2c2668=_0x2c2668||0xc8;return function(_0x401ad3){if(_0x401ad3){return _0x519401['status'](_0x2c2668)[_0x80b7('0x19')](_0x401ad3);}};}function respondWithFilteredResult(_0x1a6317,_0x4aaa02){return function(_0x46822c){if(_0x46822c){var _0x3b6b13=_0x46822c[_0x80b7('0x1a')],_0x21ea65=_0x4aaa02[_0x80b7('0x1b')],_0x2c0c4e=_0x4aaa02[_0x80b7('0x1b')]+_0x4aaa02[_0x80b7('0x1c')],_0x36d0bb;if(_0x2c0c4e>=_0x3b6b13){_0x2c0c4e=_0x3b6b13;_0x36d0bb=0xc8;}else{_0x36d0bb=0xce;}_0x1a6317[_0x80b7('0x17')](_0x36d0bb);return _0x1a6317['set'](_0x80b7('0x1d'),_0x21ea65+'-'+_0x2c0c4e+'/'+_0x3b6b13)[_0x80b7('0x19')](_0x46822c);}return null;};}function patchUpdates(_0x205457){return function(_0x125c47){try{jsonpatch['apply'](_0x125c47,_0x205457,!![]);}catch(_0x48c356){return BPromise[_0x80b7('0x1e')](_0x48c356);}return _0x125c47[_0x80b7('0x1f')]();};}function saveUpdates(_0x1b584b,_0xd51ad9){return function(_0x574e5c){if(_0x574e5c){return _0x574e5c['update'](_0x1b584b)[_0x80b7('0x20')](function(_0x3aed77){return _0x3aed77;});}return null;};}function removeEntity(_0xa465d2,_0x3ad8c1){return function(_0x527d0f){if(_0x527d0f){return _0x527d0f[_0x80b7('0x21')]()['then'](function(){_0xa465d2['status'](0xcc)[_0x80b7('0x18')]();});}};}function handleEntityNotFound(_0xdab5e0,_0x65d31d){return function(_0x155c00){if(!_0x155c00){_0xdab5e0[_0x80b7('0x16')](0x194);}return _0x155c00;};}function handleError(_0x3a029b,_0x29a4e6){_0x29a4e6=_0x29a4e6||0x1f4;return function(_0x8fa95e){logger[_0x80b7('0x22')](_0x8fa95e[_0x80b7('0x23')]);if(_0x8fa95e[_0x80b7('0x24')]){delete _0x8fa95e[_0x80b7('0x24')];}_0x3a029b[_0x80b7('0x17')](_0x29a4e6)[_0x80b7('0x25')](_0x8fa95e);};}exports[_0x80b7('0x26')]=function(_0x481cd2,_0x40cfd3){var _0x1661be={},_0x5e3f6f={},_0x370bfb={'count':0x0,'rows':[]};var _0x37fda1=db[_0x80b7('0x27')]['rawAttributes'];_0x5e3f6f[_0x80b7('0x28')]=_[_0x80b7('0x29')](_0x37fda1);_0x5e3f6f[_0x80b7('0x2a')]=_[_0x80b7('0x29')](_0x481cd2[_0x80b7('0x2a')]);_0x5e3f6f[_0x80b7('0x2b')]=_[_0x80b7('0x2c')](_0x5e3f6f[_0x80b7('0x28')],_0x5e3f6f[_0x80b7('0x2a')]);_0x1661be[_0x80b7('0x2d')]=_[_0x80b7('0x2c')](_0x5e3f6f[_0x80b7('0x28')],qs[_0x80b7('0x2e')](_0x481cd2['query']['fields']));_0x1661be[_0x80b7('0x2d')]=_0x1661be[_0x80b7('0x2d')]['length']?_0x1661be['attributes']:_0x5e3f6f[_0x80b7('0x28')];if(!_0x481cd2[_0x80b7('0x2a')][_0x80b7('0x2f')](_0x80b7('0x30'))){_0x1661be[_0x80b7('0x1c')]=qs[_0x80b7('0x1c')](_0x481cd2['query'][_0x80b7('0x1c')]);_0x1661be[_0x80b7('0x1b')]=qs[_0x80b7('0x1b')](_0x481cd2[_0x80b7('0x2a')]['offset']);}_0x1661be[_0x80b7('0x31')]=qs[_0x80b7('0x32')](_0x481cd2['query'][_0x80b7('0x32')]);_0x1661be[_0x80b7('0x33')]=qs[_0x80b7('0x2b')](_[_0x80b7('0x34')](_0x481cd2[_0x80b7('0x2a')],_0x5e3f6f[_0x80b7('0x2b')]));if(_0x481cd2[_0x80b7('0x2a')][_0x80b7('0x35')]){_0x1661be['where']=_['merge'](_0x1661be['where'],{'$or':_[_0x80b7('0x36')](_0x37fda1,function(_0x26da30){if(_0x26da30[_0x80b7('0x37')][_0x80b7('0x38')]!==_0x80b7('0x39')){var _0x2e0136={};_0x2e0136[_0x26da30[_0x80b7('0x3a')]]={'$like':'%'+_0x481cd2[_0x80b7('0x2a')]['filter']+'%'};return _0x2e0136;}})});}_0x1661be=_[_0x80b7('0x3b')]({},_0x1661be,_0x481cd2[_0x80b7('0x3c')]);var _0x15e1e2={'where':_0x1661be[_0x80b7('0x33')]};return db[_0x80b7('0x27')][_0x80b7('0x1a')](_0x15e1e2)['then'](function(_0x287f7e){_0x370bfb['count']=_0x287f7e;if(_0x481cd2[_0x80b7('0x2a')][_0x80b7('0x3d')]){_0x1661be['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x80b7('0x3e')](_0x1661be);})['then'](function(_0x5c91d8){_0x370bfb[_0x80b7('0x3f')]=_0x5c91d8;return _0x370bfb;})[_0x80b7('0x20')](respondWithFilteredResult(_0x40cfd3,_0x1661be))['catch'](handleError(_0x40cfd3,null));};exports[_0x80b7('0x40')]=function(_0x196f48,_0x55cf02){var _0x59e0c4={'raw':![],'where':{'id':_0x196f48[_0x80b7('0x41')]['id']}},_0x2fdd6d={};_0x2fdd6d[_0x80b7('0x28')]=_[_0x80b7('0x29')](db[_0x80b7('0x27')][_0x80b7('0x42')]);_0x2fdd6d['query']=_[_0x80b7('0x29')](_0x196f48[_0x80b7('0x2a')]);_0x2fdd6d[_0x80b7('0x2b')]=_[_0x80b7('0x2c')](_0x2fdd6d['model'],_0x2fdd6d[_0x80b7('0x2a')]);_0x59e0c4['attributes']=_[_0x80b7('0x2c')](_0x2fdd6d[_0x80b7('0x28')],qs[_0x80b7('0x2e')](_0x196f48[_0x80b7('0x2a')][_0x80b7('0x2e')]));_0x59e0c4[_0x80b7('0x2d')]=_0x59e0c4[_0x80b7('0x2d')][_0x80b7('0x43')]?_0x59e0c4[_0x80b7('0x2d')]:_0x2fdd6d[_0x80b7('0x28')];if(_0x196f48[_0x80b7('0x2a')][_0x80b7('0x3d')]){_0x59e0c4[_0x80b7('0x44')]=[{'all':!![]}];}_0x59e0c4=_['merge']({},_0x59e0c4,_0x196f48[_0x80b7('0x3c')]);return db[_0x80b7('0x27')]['find'](_0x59e0c4)[_0x80b7('0x20')](handleEntityNotFound(_0x55cf02,null))['then'](respondWithResult(_0x55cf02,null))['catch'](handleError(_0x55cf02,null));};exports[_0x80b7('0x45')]=function(_0x59e065,_0x50ad92){return db[_0x80b7('0x27')][_0x80b7('0x45')](_0x59e065['body'],{})[_0x80b7('0x20')](respondWithResult(_0x50ad92,0xc9))[_0x80b7('0x46')](handleError(_0x50ad92,null));};exports[_0x80b7('0x47')]=function(_0x5455a5,_0x385e84){if(_0x5455a5[_0x80b7('0x48')]['id']){delete _0x5455a5[_0x80b7('0x48')]['id'];}return db[_0x80b7('0x27')]['find']({'where':{'id':_0x5455a5['params']['id']}})['then'](handleEntityNotFound(_0x385e84,null))[_0x80b7('0x20')](saveUpdates(_0x5455a5[_0x80b7('0x48')],null))[_0x80b7('0x20')](respondWithResult(_0x385e84,null))[_0x80b7('0x46')](handleError(_0x385e84,null));};exports[_0x80b7('0x21')]=function(_0x44b23d,_0x398925){return db[_0x80b7('0x27')]['find']({'where':{'id':_0x44b23d['params']['id']}})[_0x80b7('0x20')](handleEntityNotFound(_0x398925,null))[_0x80b7('0x20')](removeEntity(_0x398925,null))[_0x80b7('0x46')](handleError(_0x398925,null));};exports[_0x80b7('0x49')]=function(_0x1fff8c,_0x2da4a1){return db['IntegrationReport'][_0x80b7('0x49')]()[_0x80b7('0x20')](respondWithResult(_0x2da4a1,null))['catch'](handleError(_0x2da4a1,null));}; \ No newline at end of file +var _0x4be6=['ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','error','name','model','query','keys','filters','intersection','attributes','fields','order','sort','where','map','key','VIRTUAL','field','filter','includeAll','include','IntegrationReport','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x5d0b60,_0x40a2fa){var _0x2263dc=function(_0x5e9d49){while(--_0x5e9d49){_0x5d0b60['push'](_0x5d0b60['shift']());}};_0x2263dc(++_0x40a2fa);}(_0x4be6,0xb5));var _0x64be=function(_0x42ec50,_0x13563d){_0x42ec50=_0x42ec50-0x0;var _0x35e7c0=_0x4be6[_0x42ec50];return _0x35e7c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x64be('0x0'));var rimraf=require(_0x64be('0x1'));var zipdir=require(_0x64be('0x2'));var jsonpatch=require(_0x64be('0x3'));var rp=require(_0x64be('0x4'));var moment=require(_0x64be('0x5'));var BPromise=require(_0x64be('0x6'));var Mustache=require(_0x64be('0x7'));var util=require(_0x64be('0x8'));var path=require(_0x64be('0x9'));var sox=require('sox');var csv=require(_0x64be('0xa'));var ejs=require(_0x64be('0xb'));var fs=require('fs');var _=require(_0x64be('0xc'));var squel=require('squel');var crypto=require(_0x64be('0xd'));var jsforce=require(_0x64be('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64be('0xa'));var querystring=require('querystring');var Papa=require(_0x64be('0xf'));var Redis=require(_0x64be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x64be('0x11'));var hardwareService=require(_0x64be('0x12'));var logger=require(_0x64be('0x13'))(_0x64be('0x14'));var utils=require('../../config/utils');var config=require(_0x64be('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee4280,_0x1c73e2){_0x1c73e2=_0x1c73e2||0xcc;return function(_0x31d09b){if(_0x31d09b){return _0xee4280[_0x64be('0x16')](_0x1c73e2);}return _0xee4280[_0x64be('0x17')](_0x1c73e2)['end']();};}function respondWithResult(_0x407cb8,_0x5aef83){_0x5aef83=_0x5aef83||0xc8;return function(_0x6cf582){if(_0x6cf582){return _0x407cb8[_0x64be('0x17')](_0x5aef83)[_0x64be('0x18')](_0x6cf582);}};}function respondWithFilteredResult(_0x46d207,_0x17ba47){return function(_0x507bca){if(_0x507bca){var _0x54f8a9=_0x507bca[_0x64be('0x19')],_0x87036e=_0x17ba47[_0x64be('0x1a')],_0xd53297=_0x17ba47['offset']+_0x17ba47[_0x64be('0x1b')],_0x1163df;if(_0xd53297>=_0x54f8a9){_0xd53297=_0x54f8a9;_0x1163df=0xc8;}else{_0x1163df=0xce;}_0x46d207[_0x64be('0x17')](_0x1163df);return _0x46d207[_0x64be('0x1c')]('Content-Range',_0x87036e+'-'+_0xd53297+'/'+_0x54f8a9)[_0x64be('0x18')](_0x507bca);}return null;};}function patchUpdates(_0x3e0371){return function(_0x3aea7f){try{jsonpatch[_0x64be('0x1d')](_0x3aea7f,_0x3e0371,!![]);}catch(_0x52268d){return BPromise[_0x64be('0x1e')](_0x52268d);}return _0x3aea7f[_0x64be('0x1f')]();};}function saveUpdates(_0x4cc470,_0x281dfe){return function(_0x4cb781){if(_0x4cb781){return _0x4cb781[_0x64be('0x20')](_0x4cc470)[_0x64be('0x21')](function(_0x1be2cd){return _0x1be2cd;});}return null;};}function removeEntity(_0x3cc51c,_0x3b17dc){return function(_0x2a72c6){if(_0x2a72c6){return _0x2a72c6['destroy']()[_0x64be('0x21')](function(){_0x3cc51c[_0x64be('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x455090,_0x5acddc){return function(_0x16e37c){if(!_0x16e37c){_0x455090['sendStatus'](0x194);}return _0x16e37c;};}function handleError(_0xb1f2f9,_0x53d6c3){_0x53d6c3=_0x53d6c3||0x1f4;return function(_0x18909b){logger[_0x64be('0x22')](_0x18909b['stack']);if(_0x18909b['name']){delete _0x18909b[_0x64be('0x23')];}_0xb1f2f9[_0x64be('0x17')](_0x53d6c3)['send'](_0x18909b);};}exports['index']=function(_0x591486,_0x503b30){var _0x379dcf={},_0x504429={},_0x3b58ac={'count':0x0,'rows':[]};var _0x343150=db['IntegrationReport']['rawAttributes'];_0x504429[_0x64be('0x24')]=_['keys'](_0x343150);_0x504429[_0x64be('0x25')]=_[_0x64be('0x26')](_0x591486[_0x64be('0x25')]);_0x504429[_0x64be('0x27')]=_[_0x64be('0x28')](_0x504429['model'],_0x504429['query']);_0x379dcf[_0x64be('0x29')]=_['intersection'](_0x504429[_0x64be('0x24')],qs[_0x64be('0x2a')](_0x591486['query'][_0x64be('0x2a')]));_0x379dcf[_0x64be('0x29')]=_0x379dcf[_0x64be('0x29')]['length']?_0x379dcf[_0x64be('0x29')]:_0x504429['model'];if(!_0x591486[_0x64be('0x25')]['hasOwnProperty']('nolimit')){_0x379dcf[_0x64be('0x1b')]=qs[_0x64be('0x1b')](_0x591486[_0x64be('0x25')][_0x64be('0x1b')]);_0x379dcf['offset']=qs['offset'](_0x591486[_0x64be('0x25')][_0x64be('0x1a')]);}_0x379dcf[_0x64be('0x2b')]=qs[_0x64be('0x2c')](_0x591486[_0x64be('0x25')][_0x64be('0x2c')]);_0x379dcf[_0x64be('0x2d')]=qs[_0x64be('0x27')](_['pick'](_0x591486['query'],_0x504429[_0x64be('0x27')]));if(_0x591486[_0x64be('0x25')]['filter']){_0x379dcf[_0x64be('0x2d')]=_['merge'](_0x379dcf[_0x64be('0x2d')],{'$or':_[_0x64be('0x2e')](_0x343150,function(_0x47d35f){if(_0x47d35f['type'][_0x64be('0x2f')]!==_0x64be('0x30')){var _0x56f8e8={};_0x56f8e8[_0x47d35f[_0x64be('0x31')]]={'$like':'%'+_0x591486[_0x64be('0x25')][_0x64be('0x32')]+'%'};return _0x56f8e8;}})});}_0x379dcf=_['merge']({},_0x379dcf,_0x591486['options']);var _0x58492b={'where':_0x379dcf[_0x64be('0x2d')]};return db['IntegrationReport']['count'](_0x58492b)['then'](function(_0xbc4987){_0x3b58ac[_0x64be('0x19')]=_0xbc4987;if(_0x591486['query'][_0x64be('0x33')]){_0x379dcf[_0x64be('0x34')]=[{'all':!![]}];}return db[_0x64be('0x35')]['findAll'](_0x379dcf);})[_0x64be('0x21')](function(_0x52a118){_0x3b58ac[_0x64be('0x36')]=_0x52a118;return _0x3b58ac;})[_0x64be('0x21')](respondWithFilteredResult(_0x503b30,_0x379dcf))[_0x64be('0x37')](handleError(_0x503b30,null));};exports[_0x64be('0x38')]=function(_0xafe2e3,_0x38895b){var _0xe25dd4={'raw':![],'where':{'id':_0xafe2e3[_0x64be('0x39')]['id']}},_0x249e27={};_0x249e27[_0x64be('0x24')]=_[_0x64be('0x26')](db[_0x64be('0x35')][_0x64be('0x3a')]);_0x249e27[_0x64be('0x25')]=_['keys'](_0xafe2e3[_0x64be('0x25')]);_0x249e27[_0x64be('0x27')]=_[_0x64be('0x28')](_0x249e27[_0x64be('0x24')],_0x249e27[_0x64be('0x25')]);_0xe25dd4[_0x64be('0x29')]=_['intersection'](_0x249e27['model'],qs['fields'](_0xafe2e3[_0x64be('0x25')]['fields']));_0xe25dd4[_0x64be('0x29')]=_0xe25dd4[_0x64be('0x29')]['length']?_0xe25dd4[_0x64be('0x29')]:_0x249e27[_0x64be('0x24')];if(_0xafe2e3['query']['includeAll']){_0xe25dd4[_0x64be('0x34')]=[{'all':!![]}];}_0xe25dd4=_['merge']({},_0xe25dd4,_0xafe2e3['options']);return db[_0x64be('0x35')][_0x64be('0x3b')](_0xe25dd4)[_0x64be('0x21')](handleEntityNotFound(_0x38895b,null))[_0x64be('0x21')](respondWithResult(_0x38895b,null))[_0x64be('0x37')](handleError(_0x38895b,null));};exports[_0x64be('0x3c')]=function(_0x3607ef,_0x27f833){return db[_0x64be('0x35')][_0x64be('0x3c')](_0x3607ef[_0x64be('0x3d')],{})[_0x64be('0x21')](respondWithResult(_0x27f833,0xc9))[_0x64be('0x37')](handleError(_0x27f833,null));};exports[_0x64be('0x20')]=function(_0x136d0a,_0xac9b80){if(_0x136d0a[_0x64be('0x3d')]['id']){delete _0x136d0a['body']['id'];}return db['IntegrationReport'][_0x64be('0x3b')]({'where':{'id':_0x136d0a[_0x64be('0x39')]['id']}})[_0x64be('0x21')](handleEntityNotFound(_0xac9b80,null))[_0x64be('0x21')](saveUpdates(_0x136d0a[_0x64be('0x3d')],null))[_0x64be('0x21')](respondWithResult(_0xac9b80,null))['catch'](handleError(_0xac9b80,null));};exports[_0x64be('0x3e')]=function(_0x2a98a3,_0x342d3a){return db[_0x64be('0x35')][_0x64be('0x3b')]({'where':{'id':_0x2a98a3[_0x64be('0x39')]['id']}})[_0x64be('0x21')](handleEntityNotFound(_0x342d3a,null))[_0x64be('0x21')](removeEntity(_0x342d3a,null))[_0x64be('0x37')](handleError(_0x342d3a,null));};exports['describe']=function(_0x28e308,_0x15f14d){return db[_0x64be('0x35')][_0x64be('0x3f')]()[_0x64be('0x21')](respondWithResult(_0x15f14d,null))[_0x64be('0x37')](handleError(_0x15f14d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d02ae4a..832af7b 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 _0x41fe=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x1caeb4,_0x4ebfa5){var _0x40193b=function(_0x5dcd6f){while(--_0x5dcd6f){_0x1caeb4['push'](_0x1caeb4['shift']());}};_0x40193b(++_0x4ebfa5);}(_0x41fe,0xd1));var _0xe41f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x41fe[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var logger=require(_0xe41f('0x2'))(_0xe41f('0x3'));var moment=require(_0xe41f('0x4'));var BPromise=require(_0xe41f('0x5'));var rp=require(_0xe41f('0x6'));var fs=require('fs');var path=require(_0xe41f('0x7'));var rimraf=require(_0xe41f('0x8'));var config=require(_0xe41f('0x9'));var attributes=require(_0xe41f('0xa'));module[_0xe41f('0xb')]=function(_0xd3c763,_0x370385){return _0xd3c763[_0xe41f('0xc')](_0xe41f('0xd'),attributes,{'tableName':_0xe41f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c09=['rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2b1f79,_0x8cfab1){var _0x40079e=function(_0x94ddef){while(--_0x94ddef){_0x2b1f79['push'](_0x2b1f79['shift']());}};_0x40079e(++_0x8cfab1);}(_0x7c09,0x102));var _0x97c0=function(_0x41dc59,_0x667f64){_0x41dc59=_0x41dc59-0x0;var _0x1a786d=_0x7c09[_0x41dc59];return _0x1a786d;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 7d7195c..71f2e4a 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 _0x5b41=['jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4cc571,_0x48754f){var _0x1c2123=function(_0x59b2e1){while(--_0x59b2e1){_0x4cc571['push'](_0x4cc571['shift']());}};_0x1c2123(++_0x48754f);}(_0x5b41,0xa5));var _0x15b4=function(_0x12ec84,_0x27bf9c){_0x12ec84=_0x12ec84-0x0;var _0x574e18=_0x5b41[_0x12ec84];return _0x574e18;};'use strict';var _=require(_0x15b4('0x0'));var util=require(_0x15b4('0x1'));var moment=require(_0x15b4('0x2'));var BPromise=require(_0x15b4('0x3'));var rs=require(_0x15b4('0x4'));var fs=require('fs');var Redis=require(_0x15b4('0x5'));var db=require(_0x15b4('0x6'))['db'];var utils=require(_0x15b4('0x7'));var logger=require(_0x15b4('0x8'))(_0x15b4('0x9'));var config=require('../../config/environment');var jayson=require(_0x15b4('0xa'));var client=jayson[_0x15b4('0xb')][_0x15b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51bdf2,_0x1e3d35,_0x39fd77){return new BPromise(function(_0x176919,_0x2936c5){return client[_0x15b4('0xd')](_0x51bdf2,_0x39fd77)[_0x15b4('0xe')](function(_0x21b88d){logger[_0x15b4('0xf')](_0x15b4('0x10'),_0x1e3d35,_0x15b4('0x11'));logger[_0x15b4('0x12')](_0x15b4('0x13'),_0x1e3d35,'request\x20sent',JSON[_0x15b4('0x14')](_0x21b88d));if(_0x21b88d[_0x15b4('0x15')]){if(_0x21b88d[_0x15b4('0x15')]['code']===0x1f4){logger[_0x15b4('0x15')](_0x15b4('0x10'),_0x1e3d35,_0x21b88d[_0x15b4('0x15')][_0x15b4('0x16')]);return _0x2936c5(_0x21b88d['error'][_0x15b4('0x16')]);}logger[_0x15b4('0x15')](_0x15b4('0x10'),_0x1e3d35,_0x21b88d[_0x15b4('0x15')][_0x15b4('0x16')]);return _0x176919(_0x21b88d[_0x15b4('0x15')]['message']);}else{logger[_0x15b4('0xf')](_0x15b4('0x10'),_0x1e3d35,'request\x20sent');_0x176919(_0x21b88d[_0x15b4('0x17')][_0x15b4('0x16')]);}})[_0x15b4('0x18')](function(_0x29735a){logger[_0x15b4('0x15')]('IntegrationReport,\x20%s,\x20%s',_0x1e3d35,_0x29735a);_0x2936c5(_0x29735a);});});} \ No newline at end of file +var _0x3852=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x39cd3c,_0xa21102){var _0x47a0ae=function(_0x330b05){while(--_0x330b05){_0x39cd3c['push'](_0x39cd3c['shift']());}};_0x47a0ae(++_0xa21102);}(_0x3852,0x9c));var _0x2385=function(_0x14eb96,_0xb9d19c){_0x14eb96=_0x14eb96-0x0;var _0x11ad4f=_0x3852[_0x14eb96];return _0x11ad4f;};'use strict';var _=require(_0x2385('0x0'));var util=require('util');var moment=require(_0x2385('0x1'));var BPromise=require(_0x2385('0x2'));var rs=require(_0x2385('0x3'));var fs=require('fs');var Redis=require(_0x2385('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2385('0x5'));var logger=require(_0x2385('0x6'))(_0x2385('0x7'));var config=require(_0x2385('0x8'));var jayson=require(_0x2385('0x9'));var client=jayson[_0x2385('0xa')][_0x2385('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a049,_0xf8cd75,_0x213960){return new BPromise(function(_0x583c26,_0x1a3c21){return client['request'](_0x49a049,_0x213960)[_0x2385('0xc')](function(_0x2d426a){logger['info'](_0x2385('0xd'),_0xf8cd75,'request\x20sent');logger[_0x2385('0xe')](_0x2385('0xf'),_0xf8cd75,_0x2385('0x10'),JSON[_0x2385('0x11')](_0x2d426a));if(_0x2d426a[_0x2385('0x12')]){if(_0x2d426a[_0x2385('0x12')][_0x2385('0x13')]===0x1f4){logger[_0x2385('0x12')]('IntegrationReport,\x20%s,\x20%s',_0xf8cd75,_0x2d426a['error']['message']);return _0x1a3c21(_0x2d426a[_0x2385('0x12')]['message']);}logger[_0x2385('0x12')](_0x2385('0xd'),_0xf8cd75,_0x2d426a[_0x2385('0x12')]['message']);return _0x583c26(_0x2d426a[_0x2385('0x12')][_0x2385('0x14')]);}else{logger['info'](_0x2385('0xd'),_0xf8cd75,_0x2385('0x10'));_0x583c26(_0x2d426a[_0x2385('0x15')][_0x2385('0x14')]);}})[_0x2385('0x16')](function(_0x537dfd){logger[_0x2385('0x12')]('IntegrationReport,\x20%s,\x20%s',_0xf8cd75,_0x537dfd);_0x1a3c21(_0x537dfd);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index dff408b..d8a4096 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 _0xd7ab=['/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd7ab[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbd7a('0x0'));var util=require(_0xbd7a('0x1'));var path=require(_0xbd7a('0x2'));var timeout=require(_0xbd7a('0x3'));var express=require(_0xbd7a('0x4'));var router=express[_0xbd7a('0x5')]();var auth=require(_0xbd7a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xbd7a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbd7a('0x7')](_0xbd7a('0x8'),auth[_0xbd7a('0x9')](),controller['show']);router[_0xbd7a('0x7')](_0xbd7a('0xa'),auth['isAuthenticated'](),controller[_0xbd7a('0xb')]);router['post']('/',auth[_0xbd7a('0x9')](),controller['create']);router['post'](_0xbd7a('0xa'),auth['isAuthenticated'](),controller['addInterval']);router[_0xbd7a('0xc')](_0xbd7a('0xd'),auth[_0xbd7a('0x9')](),controller[_0xbd7a('0xe')]);router[_0xbd7a('0xf')]('/:id',auth[_0xbd7a('0x9')](),controller['update']);router[_0xbd7a('0x10')](_0xbd7a('0x8'),auth[_0xbd7a('0x9')](),controller[_0xbd7a('0x11')]);module[_0xbd7a('0x12')]=router; \ No newline at end of file +var _0xd5bc=['getIntervals','post','/:id/sub_intervals','addInterval','addIntervals','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','show'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xd5bc,0x78));var _0xcd5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcd5b('0x0'));var util=require(_0xcd5b('0x1'));var path=require(_0xcd5b('0x2'));var timeout=require(_0xcd5b('0x3'));var express=require(_0xcd5b('0x4'));var router=express[_0xcd5b('0x5')]();var auth=require(_0xcd5b('0x6'));var interaction=require(_0xcd5b('0x7'));var config=require('../../config/environment');var controller=require(_0xcd5b('0x8'));router[_0xcd5b('0x9')]('/',auth[_0xcd5b('0xa')](),controller['index']);router[_0xcd5b('0x9')]('/:id',auth[_0xcd5b('0xa')](),controller[_0xcd5b('0xb')]);router[_0xcd5b('0x9')]('/:id/sub_intervals',auth[_0xcd5b('0xa')](),controller[_0xcd5b('0xc')]);router[_0xcd5b('0xd')]('/',auth[_0xcd5b('0xa')](),controller['create']);router['post'](_0xcd5b('0xe'),auth[_0xcd5b('0xa')](),controller[_0xcd5b('0xf')]);router['post']('/:id/sub_intervals/create_many',auth[_0xcd5b('0xa')](),controller[_0xcd5b('0x10')]);router['put'](_0xcd5b('0x11'),auth[_0xcd5b('0xa')](),controller[_0xcd5b('0x12')]);router[_0xcd5b('0x13')](_0xcd5b('0x11'),auth[_0xcd5b('0xa')](),controller[_0xcd5b('0x14')]);module[_0xcd5b('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a0efa46..fc5ff99 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 _0x07f6=['sequelize','exports','STRING'];(function(_0x5c1128,_0x50bb34){var _0xde8554=function(_0x13e46d){while(--_0x13e46d){_0x5c1128['push'](_0x5c1128['shift']());}};_0xde8554(++_0x50bb34);}(_0x07f6,0xa8));var _0x607f=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x07f6[_0x1d1d09];return _0x8827e;};'use strict';var Sequelize=require(_0x607f('0x0'));module[_0x607f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x607f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5167=['sequelize','exports','STRING'];(function(_0x313207,_0x488a2c){var _0x58a3ed=function(_0x1a4fbd){while(--_0x1a4fbd){_0x313207['push'](_0x313207['shift']());}};_0x58a3ed(++_0x488a2c);}(_0x5167,0xff));var _0x7516=function(_0x2f4999,_0x234eda){_0x2f4999=_0x2f4999-0x0;var _0x33f50=_0x5167[_0x2f4999];return _0x33f50;};'use strict';var Sequelize=require(_0x7516('0x0'));module[_0x7516('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7516('0x2')]},'interval':{'type':Sequelize[_0x7516('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 2430e4c..2e081b3 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 _0x39e4=['sox','to-csv','ejs','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','count','offset','limit','set','reject','save','then','destroy','UserProfileResource','sendStatus','error','name','send','Interval','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','map','type','VIRTUAL','field','merge','options','includeAll','findAll','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','addInterval','IntervalId','length','order','filter','getIntervals','sequelize','bulkCreate','eml-format','fast-json-patch','moment','util','path'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x39e4,0x17c));var _0x439e=function(_0x28204c,_0x3bc01a){_0x28204c=_0x28204c-0x0;var _0x33f018=_0x39e4[_0x28204c];return _0x33f018;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x439e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x439e('0x1'));var rp=require('request-promise');var moment=require(_0x439e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439e('0x3'));var path=require(_0x439e('0x4'));var sox=require(_0x439e('0x5'));var csv=require(_0x439e('0x6'));var ejs=require(_0x439e('0x7'));var fs=require('fs');var _=require(_0x439e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x439e('0x6'));var querystring=require('querystring');var Papa=require(_0x439e('0x9'));var Redis=require(_0x439e('0xa'));var authService=require(_0x439e('0xb'));var qs=require(_0x439e('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x439e('0xd'))(_0x439e('0xe'));var utils=require(_0x439e('0xf'));var config=require(_0x439e('0x10'));var db=require(_0x439e('0x11'))['db'];var extensions=require(_0x439e('0x12'));function respondWithStatusCode(_0x10d5a3,_0x5ae073){_0x5ae073=_0x5ae073||0xcc;return function(_0x479548){if(_0x479548){return _0x10d5a3['sendStatus'](_0x5ae073);}return _0x10d5a3[_0x439e('0x13')](_0x5ae073)[_0x439e('0x14')]();};}function respondWithResult(_0x32667c,_0x5bdfff){_0x5bdfff=_0x5bdfff||0xc8;return function(_0x27e267){if(_0x27e267){return _0x32667c[_0x439e('0x13')](_0x5bdfff)['json'](_0x27e267);}};}function respondWithFilteredResult(_0x5f3134,_0xdfe272){return function(_0x3697df){if(_0x3697df){var _0x41edeb=_0x3697df[_0x439e('0x15')],_0x3f0d2a=_0xdfe272[_0x439e('0x16')],_0x3d39ce=_0xdfe272[_0x439e('0x16')]+_0xdfe272[_0x439e('0x17')],_0x12f142;if(_0x3d39ce>=_0x41edeb){_0x3d39ce=_0x41edeb;_0x12f142=0xc8;}else{_0x12f142=0xce;}_0x5f3134[_0x439e('0x13')](_0x12f142);return _0x5f3134[_0x439e('0x18')]('Content-Range',_0x3f0d2a+'-'+_0x3d39ce+'/'+_0x41edeb)['json'](_0x3697df);}return null;};}function patchUpdates(_0x4f5b5b){return function(_0x42656a){try{jsonpatch['apply'](_0x42656a,_0x4f5b5b,!![]);}catch(_0x575004){return BPromise[_0x439e('0x19')](_0x575004);}return _0x42656a[_0x439e('0x1a')]();};}function saveUpdates(_0xb79f44,_0x288892){return function(_0x1c6154){if(_0x1c6154){return _0x1c6154['update'](_0xb79f44)[_0x439e('0x1b')](function(_0xe508de){return _0xe508de;});}return null;};}function removeEntity(_0x472372,_0x4bd7e0){return function(_0x7dc4bd){if(_0x7dc4bd){return _0x7dc4bd[_0x439e('0x1c')]()[_0x439e('0x1b')](function(){var _0x32b20e=_0x7dc4bd['get']({'plain':!![]});var _0x47555b='Intervals';return db[_0x439e('0x1d')]['destroy']({'where':{'type':_0x47555b,'resourceId':_0x32b20e['id']}})[_0x439e('0x1b')](function(){return _0x7dc4bd;});})[_0x439e('0x1b')](function(){_0x472372['status'](0xcc)[_0x439e('0x14')]();});}};}function handleEntityNotFound(_0x31007c,_0x1bfc96){return function(_0x54aed5){if(!_0x54aed5){_0x31007c[_0x439e('0x1e')](0x194);}return _0x54aed5;};}function handleError(_0x23ee9c,_0x4034d0){_0x4034d0=_0x4034d0||0x1f4;return function(_0x1b2dca){logger[_0x439e('0x1f')](_0x1b2dca['stack']);if(_0x1b2dca[_0x439e('0x20')]){delete _0x1b2dca[_0x439e('0x20')];}_0x23ee9c['status'](_0x4034d0)[_0x439e('0x21')](_0x1b2dca);};}exports['index']=function(_0xa91d33,_0x56cea4){var _0xe0b9c8={},_0x3227c1={},_0x5ba84a={'count':0x0,'rows':[]};var _0x2e6f57=db[_0x439e('0x22')][_0x439e('0x23')];_0x3227c1[_0x439e('0x24')]=_['keys'](_0x2e6f57);_0x3227c1['query']=_[_0x439e('0x25')](_0xa91d33[_0x439e('0x26')]);_0x3227c1['filters']=_[_0x439e('0x27')](_0x3227c1[_0x439e('0x24')],_0x3227c1[_0x439e('0x26')]);_0xe0b9c8[_0x439e('0x28')]=_[_0x439e('0x27')](_0x3227c1[_0x439e('0x24')],qs[_0x439e('0x29')](_0xa91d33[_0x439e('0x26')][_0x439e('0x29')]));_0xe0b9c8[_0x439e('0x28')]=_0xe0b9c8[_0x439e('0x28')]['length']?_0xe0b9c8[_0x439e('0x28')]:_0x3227c1[_0x439e('0x24')];if(!_0xa91d33[_0x439e('0x26')][_0x439e('0x2a')](_0x439e('0x2b'))){_0xe0b9c8[_0x439e('0x17')]=qs[_0x439e('0x17')](_0xa91d33[_0x439e('0x26')][_0x439e('0x17')]);_0xe0b9c8[_0x439e('0x16')]=qs[_0x439e('0x16')](_0xa91d33[_0x439e('0x26')][_0x439e('0x16')]);}_0xe0b9c8['order']=qs[_0x439e('0x2c')](_0xa91d33[_0x439e('0x26')][_0x439e('0x2c')]);_0xe0b9c8[_0x439e('0x2d')]=qs['filters'](_[_0x439e('0x2e')](_0xa91d33[_0x439e('0x26')],_0x3227c1[_0x439e('0x2f')]));if(_0xa91d33[_0x439e('0x26')]['filter']){_0xe0b9c8[_0x439e('0x2d')]=_['merge'](_0xe0b9c8[_0x439e('0x2d')],{'$or':_[_0x439e('0x30')](_0x2e6f57,function(_0x51c575){if(_0x51c575[_0x439e('0x31')]['key']!==_0x439e('0x32')){var _0x5a04ea={};_0x5a04ea[_0x51c575[_0x439e('0x33')]]={'$like':'%'+_0xa91d33[_0x439e('0x26')]['filter']+'%'};return _0x5a04ea;}})});}_0xe0b9c8=_[_0x439e('0x34')]({},_0xe0b9c8,_0xa91d33[_0x439e('0x35')]);var _0x36423a={'where':_0xe0b9c8[_0x439e('0x2d')]};return db[_0x439e('0x22')][_0x439e('0x15')](_0x36423a)[_0x439e('0x1b')](function(_0x77c5d3){_0x5ba84a[_0x439e('0x15')]=_0x77c5d3;if(_0xa91d33['query'][_0x439e('0x36')]){_0xe0b9c8['include']=[{'all':!![]}];}return db['Interval'][_0x439e('0x37')](_0xe0b9c8);})[_0x439e('0x1b')](function(_0x2d0b31){_0x5ba84a['rows']=_0x2d0b31;return _0x5ba84a;})[_0x439e('0x1b')](respondWithFilteredResult(_0x56cea4,_0xe0b9c8))['catch'](handleError(_0x56cea4,null));};exports[_0x439e('0x38')]=function(_0x1805ad,_0x26f625){var _0x3777b7={'raw':!![],'where':{'id':_0x1805ad[_0x439e('0x39')]['id']}},_0x7bd6ec={};_0x7bd6ec['model']=_[_0x439e('0x25')](db['Interval']['rawAttributes']);_0x7bd6ec['query']=_[_0x439e('0x25')](_0x1805ad[_0x439e('0x26')]);_0x7bd6ec[_0x439e('0x2f')]=_['intersection'](_0x7bd6ec['model'],_0x7bd6ec[_0x439e('0x26')]);_0x3777b7['attributes']=_[_0x439e('0x27')](_0x7bd6ec[_0x439e('0x24')],qs[_0x439e('0x29')](_0x1805ad[_0x439e('0x26')][_0x439e('0x29')]));_0x3777b7[_0x439e('0x28')]=_0x3777b7['attributes']['length']?_0x3777b7[_0x439e('0x28')]:_0x7bd6ec[_0x439e('0x24')];if(_0x1805ad['query'][_0x439e('0x36')]){_0x3777b7[_0x439e('0x3a')]=[{'all':!![]}];}_0x3777b7=_[_0x439e('0x34')]({},_0x3777b7,_0x1805ad[_0x439e('0x35')]);return db[_0x439e('0x22')][_0x439e('0x3b')](_0x3777b7)[_0x439e('0x1b')](handleEntityNotFound(_0x26f625,null))[_0x439e('0x1b')](respondWithResult(_0x26f625,null))['catch'](handleError(_0x26f625,null));};exports[_0x439e('0x3c')]=function(_0x3c0d34,_0x53f18b){return db['Interval']['create'](_0x3c0d34[_0x439e('0x3d')],{})[_0x439e('0x1b')](function(_0x109395){var _0x89d69=_0x3c0d34[_0x439e('0x3e')]['get']({'plain':!![]});if(!_0x89d69)throw new Error(_0x439e('0x3f'));if(_0x89d69[_0x439e('0x40')]===_0x439e('0x3e')){var _0x44dd56=_0x109395['get']({'plain':!![]});var _0x3c1cef=_0x439e('0x41');return db['UserProfileSection'][_0x439e('0x3b')]({'where':{'name':_0x3c1cef,'userProfileId':_0x89d69['userProfileId']},'raw':!![]})[_0x439e('0x1b')](function(_0x3afe47){if(_0x3afe47&&_0x3afe47[_0x439e('0x42')]===0x0){return db[_0x439e('0x1d')]['create']({'name':_0x44dd56[_0x439e('0x20')],'resourceId':_0x44dd56['id'],'type':_0x3afe47[_0x439e('0x20')],'sectionId':_0x3afe47['id']},{})['then'](function(){return _0x109395;});}else{return _0x109395;}})['catch'](function(_0x64db47){logger[_0x439e('0x1f')](_0x439e('0x43'),_0x64db47);throw _0x64db47;});}return _0x109395;})[_0x439e('0x1b')](respondWithResult(_0x53f18b,0xc9))[_0x439e('0x44')](handleError(_0x53f18b,null));};exports['update']=function(_0x4f6abb,_0x2c247e){if(_0x4f6abb['body']['id']){delete _0x4f6abb[_0x439e('0x3d')]['id'];}return db[_0x439e('0x22')][_0x439e('0x3b')]({'where':{'id':_0x4f6abb['params']['id']}})[_0x439e('0x1b')](handleEntityNotFound(_0x2c247e,null))['then'](saveUpdates(_0x4f6abb['body'],null))['then'](respondWithResult(_0x2c247e,null))[_0x439e('0x44')](handleError(_0x2c247e,null));};exports[_0x439e('0x1c')]=function(_0x24c76c,_0x427833){return db['Interval'][_0x439e('0x3b')]({'where':{'id':_0x24c76c[_0x439e('0x39')]['id']}})[_0x439e('0x1b')](handleEntityNotFound(_0x427833,null))[_0x439e('0x1b')](removeEntity(_0x427833,null))[_0x439e('0x44')](handleError(_0x427833,null));};exports[_0x439e('0x45')]=function(_0x1775e2,_0x5875c9,_0x4e6259){if(_0x1775e2['body']['id']){delete _0x1775e2[_0x439e('0x3d')]['id'];}return db[_0x439e('0x22')][_0x439e('0x3b')]({'where':{'id':_0x1775e2[_0x439e('0x39')]['id']}})['then'](handleEntityNotFound(_0x5875c9,null))[_0x439e('0x1b')](function(_0x5b9e89){if(_0x5b9e89){_0x1775e2[_0x439e('0x3d')][_0x439e('0x46')]=_0x5b9e89['id'];return db[_0x439e('0x22')][_0x439e('0x3c')](_0x1775e2[_0x439e('0x3d')]);}})[_0x439e('0x1b')](respondWithResult(_0x5875c9,null))[_0x439e('0x44')](handleError(_0x5875c9,null));};exports['getIntervals']=function(_0x26c470,_0x862f84,_0x1e99e8){var _0x2cdd3d={};var _0x57a163={};var _0x11f902;var _0x1ccb54;return db[_0x439e('0x22')]['findOne']({'where':{'id':_0x26c470[_0x439e('0x39')]['id']}})[_0x439e('0x1b')](handleEntityNotFound(_0x862f84,null))[_0x439e('0x1b')](function(_0x18fe0f){if(_0x18fe0f){_0x11f902=_0x18fe0f;_0x57a163[_0x439e('0x24')]=_[_0x439e('0x25')](db[_0x439e('0x22')][_0x439e('0x23')]);_0x57a163[_0x439e('0x26')]=_[_0x439e('0x25')](_0x26c470['query']);_0x57a163[_0x439e('0x2f')]=_[_0x439e('0x27')](_0x57a163[_0x439e('0x24')],_0x57a163['query']);_0x2cdd3d[_0x439e('0x28')]=_[_0x439e('0x27')](_0x57a163[_0x439e('0x24')],qs[_0x439e('0x29')](_0x26c470[_0x439e('0x26')]['fields']));_0x2cdd3d[_0x439e('0x28')]=_0x2cdd3d[_0x439e('0x28')][_0x439e('0x47')]?_0x2cdd3d[_0x439e('0x28')]:_0x57a163['model'];_0x2cdd3d[_0x439e('0x48')]=qs['sort'](_0x26c470[_0x439e('0x26')][_0x439e('0x2c')]);_0x2cdd3d[_0x439e('0x2d')]=qs['filters'](_[_0x439e('0x2e')](_0x26c470['query'],_0x57a163[_0x439e('0x2f')]));if(_0x26c470[_0x439e('0x26')][_0x439e('0x49')]){_0x2cdd3d[_0x439e('0x2d')]=_[_0x439e('0x34')](_0x2cdd3d[_0x439e('0x2d')],{'$or':_['map'](_0x2cdd3d[_0x439e('0x28')],function(_0x374dc3){var _0x372549={};_0x372549[_0x374dc3]={'$like':'%'+_0x26c470['query']['filter']+'%'};return _0x372549;})});}_0x2cdd3d=_[_0x439e('0x34')]({},_0x2cdd3d,_0x26c470[_0x439e('0x35')]);return _0x11f902[_0x439e('0x4a')](_0x2cdd3d);}})['then'](function(_0x17bdf7){if(_0x17bdf7){_0x1ccb54=_0x17bdf7[_0x439e('0x47')];if(!_0x26c470[_0x439e('0x26')][_0x439e('0x2a')]('nolimit')){_0x2cdd3d['limit']=qs[_0x439e('0x17')](_0x26c470[_0x439e('0x26')][_0x439e('0x17')]);_0x2cdd3d[_0x439e('0x16')]=qs[_0x439e('0x16')](_0x26c470[_0x439e('0x26')][_0x439e('0x16')]);}return _0x11f902[_0x439e('0x4a')](_0x2cdd3d);}})['then'](function(_0x304539){if(_0x304539){return _0x304539?{'count':_0x1ccb54,'rows':_0x304539}:null;}})[_0x439e('0x1b')](respondWithResult(_0x862f84,null))[_0x439e('0x44')](handleError(_0x862f84,null));};exports['addIntervals']=function(_0x1b4310,_0x371ff3,_0x1d15f9){return db[_0x439e('0x22')]['findOne']({'where':{'id':_0x1b4310[_0x439e('0x39')]['id']}})[_0x439e('0x1b')](handleEntityNotFound(_0x371ff3,null))[_0x439e('0x1b')](function(_0x4ec2f4){if(_0x4ec2f4){return db[_0x439e('0x4b')]['transaction'](function(_0x1c8830){return db[_0x439e('0x22')][_0x439e('0x1c')]({'where':{'IntervalId':_0x1b4310[_0x439e('0x39')]['id']},'transaction':_0x1c8830})['then'](function(_0x295fd0){var _0x18b452=_['map'](_0x1b4310[_0x439e('0x3d')],function(_0x2173c6){delete _0x2173c6['id'];_0x2173c6[_0x439e('0x46')]=_0x1b4310['params']['id'];return _0x2173c6;});return db['Interval'][_0x439e('0x4c')](_0x18b452,{'transaction':_0x1c8830});});})['then'](function(){return db[_0x439e('0x22')][_0x439e('0x37')]({'where':{'IntervalId':_0x1b4310[_0x439e('0x39')]['id']}});});}})[_0x439e('0x1b')](respondWithResult(_0x371ff3,null))[_0x439e('0x44')](handleError(_0x371ff3,null));}; \ No newline at end of file +var _0xeba1=['apply','reject','then','get','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','Interval','findAll','catch','show','params','keys','rawAttributes','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','update','addInterval','IntervalId','getIntervals','findOne','filter','hasOwnProperty','addIntervals','transaction','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','count','offset','limit','set','Content-Range'];(function(_0x56e9f9,_0x556b40){var _0x9e834c=function(_0x43f1e7){while(--_0x43f1e7){_0x56e9f9['push'](_0x56e9f9['shift']());}};_0x9e834c(++_0x556b40);}(_0xeba1,0xe1));var _0x1eba=function(_0x5cfe00,_0x5b619b){_0x5cfe00=_0x5cfe00-0x0;var _0x19249e=_0xeba1[_0x5cfe00];return _0x19249e;};'use strict';var pdf=require(_0x1eba('0x0'));var emlformat=require(_0x1eba('0x1'));var rimraf=require(_0x1eba('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1eba('0x3'));var rp=require('request-promise');var moment=require(_0x1eba('0x4'));var BPromise=require(_0x1eba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1eba('0x6'));var sox=require(_0x1eba('0x7'));var csv=require(_0x1eba('0x8'));var ejs=require(_0x1eba('0x9'));var fs=require('fs');var _=require(_0x1eba('0xa'));var squel=require(_0x1eba('0xb'));var crypto=require('crypto');var jsforce=require(_0x1eba('0xc'));var deskjs=require(_0x1eba('0xd'));var toCsv=require(_0x1eba('0x8'));var querystring=require(_0x1eba('0xe'));var Papa=require(_0x1eba('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1eba('0x10'));var hardwareService=require(_0x1eba('0x11'));var logger=require(_0x1eba('0x12'))(_0x1eba('0x13'));var utils=require('../../config/utils');var config=require(_0x1eba('0x14'));var db=require(_0x1eba('0x15'))['db'];var extensions=require(_0x1eba('0x16'));function respondWithStatusCode(_0x14a699,_0x1f50fd){_0x1f50fd=_0x1f50fd||0xcc;return function(_0x2177ec){if(_0x2177ec){return _0x14a699['sendStatus'](_0x1f50fd);}return _0x14a699[_0x1eba('0x17')](_0x1f50fd)['end']();};}function respondWithResult(_0x26dc46,_0x2c325e){_0x2c325e=_0x2c325e||0xc8;return function(_0x3a501d){if(_0x3a501d){return _0x26dc46[_0x1eba('0x17')](_0x2c325e)[_0x1eba('0x18')](_0x3a501d);}};}function respondWithFilteredResult(_0x40a2ee,_0x17ea8f){return function(_0x542acb){if(_0x542acb){var _0x37ec73=_0x542acb[_0x1eba('0x19')],_0xaed927=_0x17ea8f[_0x1eba('0x1a')],_0x220c0a=_0x17ea8f[_0x1eba('0x1a')]+_0x17ea8f[_0x1eba('0x1b')],_0x32025e;if(_0x220c0a>=_0x37ec73){_0x220c0a=_0x37ec73;_0x32025e=0xc8;}else{_0x32025e=0xce;}_0x40a2ee[_0x1eba('0x17')](_0x32025e);return _0x40a2ee[_0x1eba('0x1c')](_0x1eba('0x1d'),_0xaed927+'-'+_0x220c0a+'/'+_0x37ec73)[_0x1eba('0x18')](_0x542acb);}return null;};}function patchUpdates(_0x5c3804){return function(_0x377544){try{jsonpatch[_0x1eba('0x1e')](_0x377544,_0x5c3804,!![]);}catch(_0x44cdac){return BPromise[_0x1eba('0x1f')](_0x44cdac);}return _0x377544['save']();};}function saveUpdates(_0x108f10,_0x4af7eb){return function(_0xb64c52){if(_0xb64c52){return _0xb64c52['update'](_0x108f10)[_0x1eba('0x20')](function(_0x4d466a){return _0x4d466a;});}return null;};}function removeEntity(_0x39d2d7,_0x3a7f4b){return function(_0x5d7845){if(_0x5d7845){return _0x5d7845['destroy']()[_0x1eba('0x20')](function(){var _0xd2d414=_0x5d7845[_0x1eba('0x21')]({'plain':!![]});var _0x58c2a3='Intervals';return db[_0x1eba('0x22')][_0x1eba('0x23')]({'where':{'type':_0x58c2a3,'resourceId':_0xd2d414['id']}})[_0x1eba('0x20')](function(){return _0x5d7845;});})[_0x1eba('0x20')](function(){_0x39d2d7[_0x1eba('0x17')](0xcc)[_0x1eba('0x24')]();});}};}function handleEntityNotFound(_0x2ac4de,_0x139e5b){return function(_0x2edfae){if(!_0x2edfae){_0x2ac4de[_0x1eba('0x25')](0x194);}return _0x2edfae;};}function handleError(_0x8926cd,_0x4fc179){_0x4fc179=_0x4fc179||0x1f4;return function(_0x46889f){logger['error'](_0x46889f[_0x1eba('0x26')]);if(_0x46889f[_0x1eba('0x27')]){delete _0x46889f[_0x1eba('0x27')];}_0x8926cd[_0x1eba('0x17')](_0x4fc179)[_0x1eba('0x28')](_0x46889f);};}exports[_0x1eba('0x29')]=function(_0x478f77,_0x2f35f7){var _0x15c259={},_0x2f2dc0={},_0x31fe47={'count':0x0,'rows':[]};var _0x5f255e=db['Interval']['rawAttributes'];_0x2f2dc0[_0x1eba('0x2a')]=_['keys'](_0x5f255e);_0x2f2dc0['query']=_['keys'](_0x478f77[_0x1eba('0x2b')]);_0x2f2dc0[_0x1eba('0x2c')]=_['intersection'](_0x2f2dc0[_0x1eba('0x2a')],_0x2f2dc0[_0x1eba('0x2b')]);_0x15c259[_0x1eba('0x2d')]=_[_0x1eba('0x2e')](_0x2f2dc0['model'],qs[_0x1eba('0x2f')](_0x478f77['query'][_0x1eba('0x2f')]));_0x15c259[_0x1eba('0x2d')]=_0x15c259[_0x1eba('0x2d')][_0x1eba('0x30')]?_0x15c259[_0x1eba('0x2d')]:_0x2f2dc0[_0x1eba('0x2a')];if(!_0x478f77[_0x1eba('0x2b')]['hasOwnProperty'](_0x1eba('0x31'))){_0x15c259[_0x1eba('0x1b')]=qs['limit'](_0x478f77[_0x1eba('0x2b')][_0x1eba('0x1b')]);_0x15c259['offset']=qs[_0x1eba('0x1a')](_0x478f77[_0x1eba('0x2b')][_0x1eba('0x1a')]);}_0x15c259['order']=qs[_0x1eba('0x32')](_0x478f77[_0x1eba('0x2b')]['sort']);_0x15c259[_0x1eba('0x33')]=qs[_0x1eba('0x2c')](_[_0x1eba('0x34')](_0x478f77[_0x1eba('0x2b')],_0x2f2dc0[_0x1eba('0x2c')]));if(_0x478f77[_0x1eba('0x2b')]['filter']){_0x15c259[_0x1eba('0x33')]=_[_0x1eba('0x35')](_0x15c259[_0x1eba('0x33')],{'$or':_[_0x1eba('0x36')](_0x5f255e,function(_0x1f527f){if(_0x1f527f[_0x1eba('0x37')]['key']!==_0x1eba('0x38')){var _0x569dd9={};_0x569dd9[_0x1f527f['field']]={'$like':'%'+_0x478f77[_0x1eba('0x2b')]['filter']+'%'};return _0x569dd9;}})});}_0x15c259=_[_0x1eba('0x35')]({},_0x15c259,_0x478f77[_0x1eba('0x39')]);var _0x54d119={'where':_0x15c259[_0x1eba('0x33')]};return db['Interval'][_0x1eba('0x19')](_0x54d119)[_0x1eba('0x20')](function(_0x57c095){_0x31fe47['count']=_0x57c095;if(_0x478f77[_0x1eba('0x2b')][_0x1eba('0x3a')]){_0x15c259[_0x1eba('0x3b')]=[{'all':!![]}];}return db[_0x1eba('0x3c')][_0x1eba('0x3d')](_0x15c259);})[_0x1eba('0x20')](function(_0x2ac174){_0x31fe47['rows']=_0x2ac174;return _0x31fe47;})['then'](respondWithFilteredResult(_0x2f35f7,_0x15c259))[_0x1eba('0x3e')](handleError(_0x2f35f7,null));};exports[_0x1eba('0x3f')]=function(_0xa7747c,_0x140a90){var _0x1804fa={'raw':!![],'where':{'id':_0xa7747c[_0x1eba('0x40')]['id']}},_0x25471f={};_0x25471f['model']=_[_0x1eba('0x41')](db[_0x1eba('0x3c')][_0x1eba('0x42')]);_0x25471f[_0x1eba('0x2b')]=_['keys'](_0xa7747c['query']);_0x25471f['filters']=_['intersection'](_0x25471f['model'],_0x25471f['query']);_0x1804fa[_0x1eba('0x2d')]=_[_0x1eba('0x2e')](_0x25471f[_0x1eba('0x2a')],qs['fields'](_0xa7747c['query'][_0x1eba('0x2f')]));_0x1804fa[_0x1eba('0x2d')]=_0x1804fa[_0x1eba('0x2d')]['length']?_0x1804fa[_0x1eba('0x2d')]:_0x25471f[_0x1eba('0x2a')];if(_0xa7747c[_0x1eba('0x2b')][_0x1eba('0x3a')]){_0x1804fa[_0x1eba('0x3b')]=[{'all':!![]}];}_0x1804fa=_[_0x1eba('0x35')]({},_0x1804fa,_0xa7747c[_0x1eba('0x39')]);return db['Interval'][_0x1eba('0x43')](_0x1804fa)[_0x1eba('0x20')](handleEntityNotFound(_0x140a90,null))[_0x1eba('0x20')](respondWithResult(_0x140a90,null))[_0x1eba('0x3e')](handleError(_0x140a90,null));};exports[_0x1eba('0x44')]=function(_0x45cc96,_0x2295f4){return db[_0x1eba('0x3c')][_0x1eba('0x44')](_0x45cc96[_0x1eba('0x45')],{})[_0x1eba('0x20')](function(_0xb0d045){var _0x4db64e=_0x45cc96['user'][_0x1eba('0x21')]({'plain':!![]});if(!_0x4db64e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4db64e[_0x1eba('0x46')]===_0x1eba('0x47')){var _0x1b5b5c=_0xb0d045[_0x1eba('0x21')]({'plain':!![]});var _0x1b10cc='Intervals';return db[_0x1eba('0x48')][_0x1eba('0x43')]({'where':{'name':_0x1b10cc,'userProfileId':_0x4db64e[_0x1eba('0x49')]},'raw':!![]})[_0x1eba('0x20')](function(_0x6faf1d){if(_0x6faf1d&&_0x6faf1d[_0x1eba('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x1b5b5c['name'],'resourceId':_0x1b5b5c['id'],'type':_0x6faf1d[_0x1eba('0x27')],'sectionId':_0x6faf1d['id']},{})[_0x1eba('0x20')](function(){return _0xb0d045;});}else{return _0xb0d045;}})[_0x1eba('0x3e')](function(_0x4ded18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ded18);throw _0x4ded18;});}return _0xb0d045;})[_0x1eba('0x20')](respondWithResult(_0x2295f4,0xc9))[_0x1eba('0x3e')](handleError(_0x2295f4,null));};exports[_0x1eba('0x4b')]=function(_0x292424,_0x3393b0){if(_0x292424['body']['id']){delete _0x292424[_0x1eba('0x45')]['id'];}return db['Interval'][_0x1eba('0x43')]({'where':{'id':_0x292424[_0x1eba('0x40')]['id']}})[_0x1eba('0x20')](handleEntityNotFound(_0x3393b0,null))[_0x1eba('0x20')](saveUpdates(_0x292424[_0x1eba('0x45')],null))['then'](respondWithResult(_0x3393b0,null))['catch'](handleError(_0x3393b0,null));};exports[_0x1eba('0x23')]=function(_0x1d0fdd,_0x34d79b){return db[_0x1eba('0x3c')][_0x1eba('0x43')]({'where':{'id':_0x1d0fdd[_0x1eba('0x40')]['id']}})[_0x1eba('0x20')](handleEntityNotFound(_0x34d79b,null))['then'](removeEntity(_0x34d79b,null))[_0x1eba('0x3e')](handleError(_0x34d79b,null));};exports[_0x1eba('0x4c')]=function(_0x5bd27c,_0x5a89dc,_0x5582d1){if(_0x5bd27c[_0x1eba('0x45')]['id']){delete _0x5bd27c[_0x1eba('0x45')]['id'];}return db[_0x1eba('0x3c')][_0x1eba('0x43')]({'where':{'id':_0x5bd27c[_0x1eba('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a89dc,null))[_0x1eba('0x20')](function(_0x3e9df5){if(_0x3e9df5){_0x5bd27c[_0x1eba('0x45')][_0x1eba('0x4d')]=_0x3e9df5['id'];return db[_0x1eba('0x3c')][_0x1eba('0x44')](_0x5bd27c[_0x1eba('0x45')]);}})['then'](respondWithResult(_0x5a89dc,null))[_0x1eba('0x3e')](handleError(_0x5a89dc,null));};exports[_0x1eba('0x4e')]=function(_0x5bf0b3,_0x248d12,_0x6c3068){var _0x43bf32={};var _0x81ed4f={};var _0x483dd0;var _0x423d78;return db['Interval'][_0x1eba('0x4f')]({'where':{'id':_0x5bf0b3[_0x1eba('0x40')]['id']}})['then'](handleEntityNotFound(_0x248d12,null))[_0x1eba('0x20')](function(_0x5b1cdd){if(_0x5b1cdd){_0x483dd0=_0x5b1cdd;_0x81ed4f[_0x1eba('0x2a')]=_[_0x1eba('0x41')](db[_0x1eba('0x3c')][_0x1eba('0x42')]);_0x81ed4f[_0x1eba('0x2b')]=_[_0x1eba('0x41')](_0x5bf0b3[_0x1eba('0x2b')]);_0x81ed4f[_0x1eba('0x2c')]=_[_0x1eba('0x2e')](_0x81ed4f[_0x1eba('0x2a')],_0x81ed4f[_0x1eba('0x2b')]);_0x43bf32[_0x1eba('0x2d')]=_['intersection'](_0x81ed4f[_0x1eba('0x2a')],qs['fields'](_0x5bf0b3[_0x1eba('0x2b')][_0x1eba('0x2f')]));_0x43bf32[_0x1eba('0x2d')]=_0x43bf32[_0x1eba('0x2d')][_0x1eba('0x30')]?_0x43bf32[_0x1eba('0x2d')]:_0x81ed4f[_0x1eba('0x2a')];_0x43bf32['order']=qs['sort'](_0x5bf0b3[_0x1eba('0x2b')][_0x1eba('0x32')]);_0x43bf32[_0x1eba('0x33')]=qs[_0x1eba('0x2c')](_[_0x1eba('0x34')](_0x5bf0b3[_0x1eba('0x2b')],_0x81ed4f[_0x1eba('0x2c')]));if(_0x5bf0b3[_0x1eba('0x2b')][_0x1eba('0x50')]){_0x43bf32[_0x1eba('0x33')]=_[_0x1eba('0x35')](_0x43bf32[_0x1eba('0x33')],{'$or':_[_0x1eba('0x36')](_0x43bf32[_0x1eba('0x2d')],function(_0xe12b91){var _0x68e2db={};_0x68e2db[_0xe12b91]={'$like':'%'+_0x5bf0b3['query'][_0x1eba('0x50')]+'%'};return _0x68e2db;})});}_0x43bf32=_['merge']({},_0x43bf32,_0x5bf0b3[_0x1eba('0x39')]);return _0x483dd0['getIntervals'](_0x43bf32);}})[_0x1eba('0x20')](function(_0x58dfee){if(_0x58dfee){_0x423d78=_0x58dfee[_0x1eba('0x30')];if(!_0x5bf0b3[_0x1eba('0x2b')][_0x1eba('0x51')]('nolimit')){_0x43bf32[_0x1eba('0x1b')]=qs['limit'](_0x5bf0b3['query']['limit']);_0x43bf32[_0x1eba('0x1a')]=qs[_0x1eba('0x1a')](_0x5bf0b3[_0x1eba('0x2b')][_0x1eba('0x1a')]);}return _0x483dd0['getIntervals'](_0x43bf32);}})[_0x1eba('0x20')](function(_0x36e453){if(_0x36e453){return _0x36e453?{'count':_0x423d78,'rows':_0x36e453}:null;}})['then'](respondWithResult(_0x248d12,null))[_0x1eba('0x3e')](handleError(_0x248d12,null));};exports[_0x1eba('0x52')]=function(_0x1656e9,_0x307c19,_0x57d1f1){return db[_0x1eba('0x3c')]['findOne']({'where':{'id':_0x1656e9['params']['id']}})['then'](handleEntityNotFound(_0x307c19,null))[_0x1eba('0x20')](function(_0x13aa25){if(_0x13aa25){return db['sequelize'][_0x1eba('0x53')](function(_0x414c2a){return db[_0x1eba('0x3c')][_0x1eba('0x23')]({'where':{'IntervalId':_0x1656e9[_0x1eba('0x40')]['id']},'transaction':_0x414c2a})[_0x1eba('0x20')](function(_0x26e5d2){var _0x5ae35d=_[_0x1eba('0x36')](_0x1656e9[_0x1eba('0x45')],function(_0x50500f){delete _0x50500f['id'];_0x50500f[_0x1eba('0x4d')]=_0x1656e9[_0x1eba('0x40')]['id'];return _0x50500f;});return db[_0x1eba('0x3c')][_0x1eba('0x54')](_0x5ae35d,{'transaction':_0x414c2a});});})[_0x1eba('0x20')](function(){return db[_0x1eba('0x3c')][_0x1eba('0x3d')]({'where':{'IntervalId':_0x1656e9['params']['id']}});});}})['then'](respondWithResult(_0x307c19,null))[_0x1eba('0x3e')](handleError(_0x307c19,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 90d4893..f898ab8 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 _0x863f=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','../../config/logger','api','moment','request-promise'];(function(_0x57172c,_0x1df512){var _0x38e8a4=function(_0x1bc9a5){while(--_0x1bc9a5){_0x57172c['push'](_0x57172c['shift']());}};_0x38e8a4(++_0x1df512);}(_0x863f,0x1ca));var _0xf863=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x863f[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf863('0x0'))(_0xf863('0x1'));var moment=require(_0xf863('0x2'));var BPromise=require('bluebird');var rp=require(_0xf863('0x3'));var fs=require('fs');var path=require(_0xf863('0x4'));var rimraf=require(_0xf863('0x5'));var config=require(_0xf863('0x6'));var attributes=require(_0xf863('0x7'));var extensions=require(_0xf863('0x8'));module[_0xf863('0x9')]=function(_0x514b1f,_0x397b92){return _0x514b1f[_0xf863('0xa')](_0xf863('0xb'),attributes,{'tableName':_0xf863('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e91b6,_0x32db1e){extensions[_0xf863('0xd')](_0x514b1f,_0x2e91b6);},'afterBulkCreate':function(_0x368e15,_0x227d0c,_0x4e8b9a){_0x4e8b9a();extensions[_0xf863('0xd')](_0x514b1f,_0x368e15[0x0]);},'afterUpdate':function(_0x1a50cb,_0x17f609){extensions['rewrite'](_0x514b1f,_0x1a50cb);},'afterDestroy':function(_0x5107c4,_0x229bf2){extensions[_0xf863('0xd')](_0x514b1f,_0x5107c4);}}});}; \ No newline at end of file +var _0xacdb=['../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0xacdb,0x142));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbacd('0x0'));var util=require(_0xbacd('0x1'));var logger=require(_0xbacd('0x2'))(_0xbacd('0x3'));var moment=require(_0xbacd('0x4'));var BPromise=require(_0xbacd('0x5'));var rp=require(_0xbacd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbacd('0x7'));var config=require(_0xbacd('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0xbacd('0x9'));module[_0xbacd('0xa')]=function(_0x5676d9,_0x44da7a){return _0x5676d9[_0xbacd('0xb')](_0xbacd('0xc'),attributes,{'tableName':_0xbacd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56cc4a,_0x4c225c){extensions[_0xbacd('0xe')](_0x5676d9,_0x56cc4a);},'afterBulkCreate':function(_0x3f77f0,_0x427f86,_0x2905c3){_0x2905c3();extensions[_0xbacd('0xe')](_0x5676d9,_0x3f77f0[0x0]);},'afterUpdate':function(_0x73f25d,_0x36b685){extensions['rewrite'](_0x5676d9,_0x73f25d);},'afterDestroy':function(_0x1dabe6,_0x12927a){extensions['rewrite'](_0x5676d9,_0x1dabe6);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c56f6e2..dbc0717 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 _0x04de=['Interval','findAll','options','raw','where','attributes','include','model','ShowInterval','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Interval,\x20%s,\x20%s','result','catch','GetInterval'];(function(_0x659560,_0x34805a){var _0x27f83e=function(_0x5b280d){while(--_0x5b280d){_0x659560['push'](_0x659560['shift']());}};_0x27f83e(++_0x34805a);}(_0x04de,0x107));var _0xe04d=function(_0x9f95dd,_0x7aeacc){_0x9f95dd=_0x9f95dd-0x0;var _0x29a974=_0x04de[_0x9f95dd];return _0x29a974;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('Interval,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('Interval,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});}exports[_0xe04d('0x18')]=function(_0x93b107){var _0x4090e0=this;return new Promise(function(_0x35a2b4,_0x251772){return db[_0xe04d('0x19')][_0xe04d('0x1a')]({'raw':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0x93b107[_0xe04d('0x1b')]?_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1d')]||null:null,'attributes':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options'][_0xe04d('0x1e')]||null:null,'limit':_0x93b107[_0xe04d('0x1b')]?_0x93b107['options']['limit']||null:null,'include':_0x93b107['options']?_0x93b107[_0xe04d('0x1b')]['include']?_['map'](_0x93b107[_0xe04d('0x1b')][_0xe04d('0x1f')],function(_0x495f73){return{'model':db[_0x495f73[_0xe04d('0x20')]],'as':_0x495f73['as'],'attributes':_0x495f73['attributes'],'include':_0x495f73[_0xe04d('0x1f')]?_['map'](_0x495f73[_0xe04d('0x1f')],function(_0x456822){return{'model':db[_0x456822[_0xe04d('0x20')]],'as':_0x456822['as'],'attributes':_0x456822[_0xe04d('0x1e')],'include':_0x456822[_0xe04d('0x1f')]?_['map'](_0x456822[_0xe04d('0x1f')],function(_0x3e43ca){return{'model':db[_0x3e43ca[_0xe04d('0x20')]],'as':_0x3e43ca['as'],'attributes':_0x3e43ca[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc73068){logger[_0xe04d('0xd')](_0xe04d('0x18'),_0x93b107);logger['debug'](_0xe04d('0x18'),_0x93b107,JSON['stringify'](_0xc73068));_0x35a2b4(_0xc73068);})['catch'](function(_0x569e4b){logger[_0xe04d('0x12')](_0xe04d('0x18'),_0x569e4b['message'],_0x93b107);_0x251772(_0x4090e0['error'](0x1f4,_0x569e4b[_0xe04d('0x14')]));});});};exports[_0xe04d('0x21')]=function(_0xff4dfb){var _0x4a2a10=this;return new Promise(function(_0x2cf005,_0x370cea){return db['Interval'][_0xe04d('0x22')]({'raw':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1c')]===undefined?!![]:![]:!![],'where':_0xff4dfb['options']?_0xff4dfb[_0xe04d('0x1b')]['where']||null:null,'attributes':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1e')]||null:null,'include':_0xff4dfb[_0xe04d('0x1b')]?_0xff4dfb[_0xe04d('0x1b')][_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0xff4dfb['options'][_0xe04d('0x1f')],function(_0x152837){return{'model':db[_0x152837[_0xe04d('0x20')]],'as':_0x152837['as'],'attributes':_0x152837[_0xe04d('0x1e')],'include':_0x152837[_0xe04d('0x1f')]?_[_0xe04d('0x23')](_0x152837[_0xe04d('0x1f')],function(_0x10b44f){return{'model':db[_0x10b44f[_0xe04d('0x20')]],'as':_0x10b44f['as'],'attributes':_0x10b44f['attributes'],'include':_0x10b44f[_0xe04d('0x1f')]?_['map'](_0x10b44f[_0xe04d('0x1f')],function(_0x547f56){return{'model':db[_0x547f56['model']],'as':_0x547f56['as'],'attributes':_0x547f56[_0xe04d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe04d('0xc')](function(_0x261116){logger[_0xe04d('0xd')]('ShowInterval',_0xff4dfb);logger[_0xe04d('0xf')](_0xe04d('0x21'),_0xff4dfb,JSON[_0xe04d('0x11')](_0x261116));_0x2cf005(_0x261116);})[_0xe04d('0x17')](function(_0x322228){logger['error']('ShowInterval',_0x322228[_0xe04d('0x14')],_0xff4dfb);_0x370cea(_0x4a2a10['error'](0x1f4,_0x322228['message']));});});}; \ No newline at end of file +var _0x3eea=['ShowInterval','Interval','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','GetInterval','findAll','options','raw','limit','include','map','model','attributes','then'];(function(_0x37cb7e,_0x59b8ad){var _0x25dda8=function(_0x2f3de5){while(--_0x2f3de5){_0x37cb7e['push'](_0x37cb7e['shift']());}};_0x25dda8(++_0x59b8ad);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x320c03,_0x14db02){_0x320c03=_0x320c03-0x0;var _0x5eb525=_0x3eea[_0x320c03];return _0x5eb525;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var moment=require(_0xa3ee('0x1'));var BPromise=require(_0xa3ee('0x2'));var rs=require(_0xa3ee('0x3'));var fs=require('fs');var Redis=require(_0xa3ee('0x4'));var db=require(_0xa3ee('0x5'))['db'];var utils=require(_0xa3ee('0x6'));var logger=require(_0xa3ee('0x7'))(_0xa3ee('0x8'));var config=require(_0xa3ee('0x9'));var jayson=require(_0xa3ee('0xa'));var client=jayson[_0xa3ee('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){return client[_0xa3ee('0xc')](_0x538bf9,_0x4e4588)['then'](function(_0xb1b96d){logger['info'](_0xa3ee('0xd'),_0x4183ee,_0xa3ee('0xe'));logger[_0xa3ee('0xf')]('Interval,\x20%s,\x20%s,\x20%s',_0x4183ee,_0xa3ee('0xe'),JSON[_0xa3ee('0x10')](_0xb1b96d));if(_0xb1b96d['error']){if(_0xb1b96d['error'][_0xa3ee('0x11')]===0x1f4){logger[_0xa3ee('0x12')](_0xa3ee('0xd'),_0x4183ee,_0xb1b96d[_0xa3ee('0x12')]['message']);return _0x56f37b(_0xb1b96d[_0xa3ee('0x12')]['message']);}logger[_0xa3ee('0x12')](_0xa3ee('0xd'),_0x4183ee,_0xb1b96d[_0xa3ee('0x12')][_0xa3ee('0x13')]);return _0x37a3f0(_0xb1b96d['error'][_0xa3ee('0x13')]);}else{logger[_0xa3ee('0x14')]('Interval,\x20%s,\x20%s',_0x4183ee,'request\x20sent');_0x37a3f0(_0xb1b96d['result'][_0xa3ee('0x13')]);}})[_0xa3ee('0x15')](function(_0x354dd5){logger[_0xa3ee('0x12')]('Interval,\x20%s,\x20%s',_0x4183ee,_0x354dd5);_0x56f37b(_0x354dd5);});});}exports[_0xa3ee('0x16')]=function(_0x40ffdb){var _0x339758=this;return new Promise(function(_0x299b1e,_0xfab13e){return db['Interval'][_0xa3ee('0x17')]({'raw':_0x40ffdb[_0xa3ee('0x18')]?_0x40ffdb[_0xa3ee('0x18')][_0xa3ee('0x19')]===undefined?!![]:![]:!![],'where':_0x40ffdb[_0xa3ee('0x18')]?_0x40ffdb[_0xa3ee('0x18')]['where']||null:null,'attributes':_0x40ffdb[_0xa3ee('0x18')]?_0x40ffdb[_0xa3ee('0x18')]['attributes']||null:null,'limit':_0x40ffdb[_0xa3ee('0x18')]?_0x40ffdb['options'][_0xa3ee('0x1a')]||null:null,'include':_0x40ffdb[_0xa3ee('0x18')]?_0x40ffdb[_0xa3ee('0x18')][_0xa3ee('0x1b')]?_[_0xa3ee('0x1c')](_0x40ffdb[_0xa3ee('0x18')][_0xa3ee('0x1b')],function(_0x12108e){return{'model':db[_0x12108e[_0xa3ee('0x1d')]],'as':_0x12108e['as'],'attributes':_0x12108e[_0xa3ee('0x1e')],'include':_0x12108e['include']?_[_0xa3ee('0x1c')](_0x12108e[_0xa3ee('0x1b')],function(_0x157071){return{'model':db[_0x157071[_0xa3ee('0x1d')]],'as':_0x157071['as'],'attributes':_0x157071[_0xa3ee('0x1e')],'include':_0x157071['include']?_[_0xa3ee('0x1c')](_0x157071[_0xa3ee('0x1b')],function(_0x146493){return{'model':db[_0x146493[_0xa3ee('0x1d')]],'as':_0x146493['as'],'attributes':_0x146493[_0xa3ee('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x1f')](function(_0x443507){logger[_0xa3ee('0x14')](_0xa3ee('0x16'),_0x40ffdb);logger[_0xa3ee('0xf')]('GetInterval',_0x40ffdb,JSON['stringify'](_0x443507));_0x299b1e(_0x443507);})['catch'](function(_0x78e581){logger['error'](_0xa3ee('0x16'),_0x78e581[_0xa3ee('0x13')],_0x40ffdb);_0xfab13e(_0x339758[_0xa3ee('0x12')](0x1f4,_0x78e581[_0xa3ee('0x13')]));});});};exports[_0xa3ee('0x20')]=function(_0x14547d){var _0x30ba4e=this;return new Promise(function(_0x1dd03b,_0x120d81){return db[_0xa3ee('0x21')]['find']({'raw':_0x14547d[_0xa3ee('0x18')]?_0x14547d['options'][_0xa3ee('0x19')]===undefined?!![]:![]:!![],'where':_0x14547d[_0xa3ee('0x18')]?_0x14547d['options'][_0xa3ee('0x22')]||null:null,'attributes':_0x14547d['options']?_0x14547d[_0xa3ee('0x18')]['attributes']||null:null,'include':_0x14547d[_0xa3ee('0x18')]?_0x14547d[_0xa3ee('0x18')][_0xa3ee('0x1b')]?_[_0xa3ee('0x1c')](_0x14547d[_0xa3ee('0x18')]['include'],function(_0x241a19){return{'model':db[_0x241a19[_0xa3ee('0x1d')]],'as':_0x241a19['as'],'attributes':_0x241a19[_0xa3ee('0x1e')],'include':_0x241a19['include']?_[_0xa3ee('0x1c')](_0x241a19['include'],function(_0x10caa5){return{'model':db[_0x10caa5['model']],'as':_0x10caa5['as'],'attributes':_0x10caa5[_0xa3ee('0x1e')],'include':_0x10caa5['include']?_[_0xa3ee('0x1c')](_0x10caa5[_0xa3ee('0x1b')],function(_0x3f67af){return{'model':db[_0x3f67af[_0xa3ee('0x1d')]],'as':_0x3f67af['as'],'attributes':_0x3f67af[_0xa3ee('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x1f')](function(_0xcc8e71){logger[_0xa3ee('0x14')](_0xa3ee('0x20'),_0x14547d);logger[_0xa3ee('0xf')](_0xa3ee('0x20'),_0x14547d,JSON[_0xa3ee('0x10')](_0xcc8e71));_0x1dd03b(_0xcc8e71);})[_0xa3ee('0x15')](function(_0x595b55){logger[_0xa3ee('0x12')](_0xa3ee('0x20'),_0x595b55[_0xa3ee('0x13')],_0x14547d);_0x120d81(_0x30ba4e[_0xa3ee('0x12')](0x1f4,_0x595b55['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 0601673..5bd9923 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x15a3ad,_0x1a1ee2){var _0x2d7283=function(_0x2ba6af){while(--_0x2ba6af){_0x15a3ad['push'](_0x15a3ad['shift']());}};_0x2d7283(++_0x1a1ee2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b936a,_0x1961be){_0x3b936a=_0x3b936a-0x0;var _0x594d1e=_0x5f2f[_0x3b936a];return _0x594d1e;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x0b0e,0x187));var _0xe0b0=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x0b0e[_0x166e96];return _0x553d73;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5e7f38c..9b82bcd 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 _0xbaf0=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x30ed4c,_0x236b8d){var _0x12bce2=function(_0x2d8574){while(--_0x2d8574){_0x30ed4c['push'](_0x30ed4c['shift']());}};_0x12bce2(++_0x236b8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require('bluebird');var https=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var USERNAME=_0x0baf('0x3');var PASSWORD=_0x0baf('0x4');function openIssue(_0x4d2e72,_0x5a3e42){var _0x232cc7={'fields':{'project':{'key':_0x4d2e72[_0x0baf('0x5')]||_0x0baf('0x6')},'summary':(_0x4d2e72[_0x0baf('0x7')]||_0x0baf('0x8'))+_0x0baf('0x9')+_0x4d2e72['ip'],'description':_0x4d2e72[_0x0baf('0xa')]||JSON[_0x0baf('0xb')](_0x4d2e72),'issuetype':{'name':_0x4d2e72[_0x0baf('0xc')]||'Bug'}}};_0x232cc7[_0x0baf('0xd')]['customfield_11500']=_0x4d2e72[_0x0baf('0xe')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0xf')]=_0x4d2e72[_0x0baf('0x10')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x11')]=_0x4d2e72[_0x0baf('0x12')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x13')]=_0x4d2e72[_0x0baf('0x14')];_0x232cc7[_0x0baf('0xd')]['customfield_11504']=_0x4d2e72['reason'];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x15')]=_0x4d2e72['ip'];var _0x5db689={'host':_0x0baf('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0baf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0baf('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0baf('0x19')](_0x0baf('0x1a'))}};var _0x2bc381=JSON[_0x0baf('0xb')](_0x232cc7);var _0x469599=https['request'](_0x5db689,function(_0x4cd79d){_0x4cd79d[_0x0baf('0x1b')](_0x0baf('0x1c'));var _0x283408='';_0x4cd79d['on'](_0x0baf('0x1d'),function(_0x2cf7da){_0x283408+=_0x2cf7da;});_0x4cd79d['on'](_0x0baf('0x1e'),function(){if(_0x5a3e42){return _0x5a3e42['status'](_0x4cd79d[_0x0baf('0x1f')])[_0x0baf('0x20')](JSON[_0x0baf('0x21')](_0x283408));}});});_0x469599['on'](_0x0baf('0x22'),function(_0x47070d){if(_0x5a3e42){return _0x5a3e42[_0x0baf('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0baf('0x24')}]});}});_0x469599[_0x0baf('0x25')](_0x2bc381);_0x469599[_0x0baf('0x1e')]();}exports[_0x0baf('0x26')]=openIssue;exports[_0x0baf('0x27')]=function(_0x3e3e20,_0x210cd8){_0x3e3e20[_0x0baf('0x28')]['ip']=_0x3e3e20[_0x0baf('0x29')][_0x0baf('0x2a')]||_0x3e3e20['connection'][_0x0baf('0x2b')]||_0x3e3e20['socket'][_0x0baf('0x2b')]||_0x3e3e20['connection']['socket'][_0x0baf('0x2b')];return openIssue(_0x3e3e20['body'],_0x210cd8);}; \ No newline at end of file +var _0xcb91=['summary','\x20from\x20','description','issuetype','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','stringify','setEncoding','utf8','data','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','api','support','3eAmWpBVP0','MOTGUI'];(function(_0x31f7b8,_0x44168d){var _0x471a56=function(_0x18dc3c){while(--_0x18dc3c){_0x31f7b8['push'](_0x31f7b8['shift']());}};_0x471a56(++_0x44168d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xcb91[_0x15876a];return _0xbd900f;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var USERNAME=_0x1cb9('0x2');var PASSWORD=_0x1cb9('0x3');function openIssue(_0x4c37e8,_0x8c392f){var _0x2c17b8={'fields':{'project':{'key':_0x4c37e8['key']||_0x1cb9('0x4')},'summary':(_0x4c37e8[_0x1cb9('0x5')]||'Report')+_0x1cb9('0x6')+_0x4c37e8['ip'],'description':_0x4c37e8[_0x1cb9('0x7')]||JSON['stringify'](_0x4c37e8),'issuetype':{'name':_0x4c37e8[_0x1cb9('0x8')]||_0x1cb9('0x9')}}};_0x2c17b8['fields'][_0x1cb9('0xa')]=_0x4c37e8['email'];_0x2c17b8['fields'][_0x1cb9('0xb')]=_0x4c37e8[_0x1cb9('0xc')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0xe')]=_0x4c37e8[_0x1cb9('0xf')];_0x2c17b8['fields'][_0x1cb9('0x10')]=_0x4c37e8[_0x1cb9('0x11')];_0x2c17b8[_0x1cb9('0xd')][_0x1cb9('0x12')]=_0x4c37e8[_0x1cb9('0x13')];_0x2c17b8['fields']['customfield_10102']=_0x4c37e8['ip'];var _0x59dec3={'host':_0x1cb9('0x14'),'port':0x1bb,'path':_0x1cb9('0x15'),'method':_0x1cb9('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x1cb9('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x1cb9('0x18')](_0x1cb9('0x19'))}};var _0x1b3cd7=JSON[_0x1cb9('0x1a')](_0x2c17b8);var _0x3e2d11=https['request'](_0x59dec3,function(_0x5572cb){_0x5572cb[_0x1cb9('0x1b')](_0x1cb9('0x1c'));var _0x3904b7='';_0x5572cb['on'](_0x1cb9('0x1d'),function(_0x3e21e0){_0x3904b7+=_0x3e21e0;});_0x5572cb['on'](_0x1cb9('0x1e'),function(){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](_0x5572cb['statusCode'])['json'](JSON[_0x1cb9('0x20')](_0x3904b7));}});});_0x3e2d11['on'](_0x1cb9('0x21'),function(_0x2b2669){if(_0x8c392f){return _0x8c392f[_0x1cb9('0x1f')](0x1f4)[_0x1cb9('0x22')]({'errors':[{'message':_0x1cb9('0x23'),'type':_0x1cb9('0x24')}]});}});_0x3e2d11['write'](_0x1b3cd7);_0x3e2d11['end']();}exports[_0x1cb9('0x25')]=openIssue;exports['send']=function(_0x4750b1,_0x2265ea){_0x4750b1['body']['ip']=_0x4750b1['headers'][_0x1cb9('0x26')]||_0x4750b1[_0x1cb9('0x27')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x29')][_0x1cb9('0x28')]||_0x4750b1[_0x1cb9('0x27')]['socket']['remoteAddress'];return openIssue(_0x4750b1[_0x1cb9('0x2a')],_0x2265ea);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4711026..22ef2d7 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 _0x6355=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x1415ef,_0x5c219e){var _0x234acc=function(_0x2dbfca){while(--_0x2dbfca){_0x1415ef['push'](_0x1415ef['shift']());}};_0x234acc(++_0x5c219e);}(_0x6355,0x1ae));var _0x5635=function(_0x542c88,_0x5d6405){_0x542c88=_0x542c88-0x0;var _0x141def=_0x6355[_0x542c88];return _0x141def;};'use strict';var multer=require(_0x5635('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5635('0x1'));var express=require(_0x5635('0x2'));var router=express[_0x5635('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5635('0x4'));var config=require(_0x5635('0x5'));var controller=require('./jscriptyAnswerReport.controller');router[_0x5635('0x6')]('/',auth[_0x5635('0x7')](),controller[_0x5635('0x8')]);router['get'](_0x5635('0x9'),auth['isAuthenticated'](),controller[_0x5635('0xa')]);router[_0x5635('0x6')](_0x5635('0xb'),auth[_0x5635('0x7')](),controller[_0x5635('0xc')]);router[_0x5635('0xd')]('/',auth[_0x5635('0x7')](),controller[_0x5635('0xe')]);router[_0x5635('0xf')](_0x5635('0xb'),auth['isAuthenticated'](),controller[_0x5635('0x10')]);router['delete'](_0x5635('0xb'),auth[_0x5635('0x7')](),controller[_0x5635('0x11')]);module[_0x5635('0x12')]=router; \ No newline at end of file +var _0x1528=['../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2d9fa4,_0x24fd77){var _0x4bc4c5=function(_0x143ba6){while(--_0x143ba6){_0x2d9fa4['push'](_0x2d9fa4['shift']());}};_0x4bc4c5(++_0x24fd77);}(_0x1528,0xd8));var _0x8152=function(_0x3adc42,_0x254e31){_0x3adc42=_0x3adc42-0x0;var _0x15d9e3=_0x1528[_0x3adc42];return _0x15d9e3;};'use strict';var multer=require(_0x8152('0x0'));var util=require(_0x8152('0x1'));var path=require(_0x8152('0x2'));var timeout=require(_0x8152('0x3'));var express=require('express');var router=express[_0x8152('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8152('0x5'));var controller=require(_0x8152('0x6'));router[_0x8152('0x7')]('/',auth[_0x8152('0x8')](),controller['index']);router[_0x8152('0x7')]('/describe',auth[_0x8152('0x8')](),controller[_0x8152('0x9')]);router[_0x8152('0x7')](_0x8152('0xa'),auth[_0x8152('0x8')](),controller[_0x8152('0xb')]);router['post']('/',auth[_0x8152('0x8')](),controller[_0x8152('0xc')]);router['put'](_0x8152('0xa'),auth[_0x8152('0x8')](),controller[_0x8152('0xd')]);router[_0x8152('0xe')](_0x8152('0xa'),auth[_0x8152('0x8')](),controller[_0x8152('0xf')]);module[_0x8152('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 06da2e9..9acef3a 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 _0xc718=['STRING','TEXT','sequelize'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xc718,0xb6));var _0x8c71=function(_0x58a663,_0x1fc9bd){_0x58a663=_0x58a663-0x0;var _0x2a8b7c=_0xc718[_0x58a663];return _0x2a8b7c;};'use strict';var Sequelize=require(_0x8c71('0x0'));module['exports']={'question':{'type':Sequelize[_0x8c71('0x1')]},'answer':{'type':Sequelize[_0x8c71('0x2')]('long')},'membername':{'type':Sequelize[_0x8c71('0x1')]},'projectname':{'type':Sequelize[_0x8c71('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8c71('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8c99=['exports','STRING','TEXT','long','sequelize'];(function(_0x3adfef,_0x557d7b){var _0x306280=function(_0x44f35d){while(--_0x44f35d){_0x3adfef['push'](_0x3adfef['shift']());}};_0x306280(++_0x557d7b);}(_0x8c99,0x1a8));var _0x98c9=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0x8c99[_0xfd9b19];return _0x514918;};'use strict';var Sequelize=require(_0x98c9('0x0'));module[_0x98c9('0x1')]={'question':{'type':Sequelize[_0x98c9('0x2')]},'answer':{'type':Sequelize[_0x98c9('0x3')](_0x98c9('0x4'))},'membername':{'type':Sequelize[_0x98c9('0x2')]},'projectname':{'type':Sequelize[_0x98c9('0x2')]},'queue':{'type':Sequelize[_0x98c9('0x2')]},'uniqueid':{'type':Sequelize[_0x98c9('0x2')]},'calleridname':{'type':Sequelize[_0x98c9('0x2')]},'calleridnum':{'type':Sequelize[_0x98c9('0x2')]},'questionId':{'type':Sequelize[_0x98c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 75f3565..d26e738 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 _0xaf26=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','JscriptyAnswerReport','include','findAll','params','includeAll','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','jsforce','desk.js','to-csv','querystring'];(function(_0x373612,_0x5734cb){var _0x29057d=function(_0x498844){while(--_0x498844){_0x373612['push'](_0x373612['shift']());}};_0x29057d(++_0x5734cb);}(_0xaf26,0x158));var _0x6af2=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xaf26[_0x4c7935];return _0x30651d;};'use strict';var pdf=require(_0x6af2('0x0'));var emlformat=require(_0x6af2('0x1'));var rimraf=require(_0x6af2('0x2'));var zipdir=require(_0x6af2('0x3'));var jsonpatch=require(_0x6af2('0x4'));var rp=require(_0x6af2('0x5'));var moment=require(_0x6af2('0x6'));var BPromise=require(_0x6af2('0x7'));var Mustache=require(_0x6af2('0x8'));var util=require(_0x6af2('0x9'));var path=require('path');var sox=require(_0x6af2('0xa'));var csv=require('to-csv');var ejs=require(_0x6af2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6af2('0xc'));var deskjs=require(_0x6af2('0xd'));var toCsv=require(_0x6af2('0xe'));var querystring=require(_0x6af2('0xf'));var Papa=require(_0x6af2('0x10'));var Redis=require('ioredis');var authService=require(_0x6af2('0x11'));var qs=require(_0x6af2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6af2('0x13'));var config=require(_0x6af2('0x14'));var db=require(_0x6af2('0x15'))['db'];function respondWithStatusCode(_0x1cf40a,_0x5262f5){_0x5262f5=_0x5262f5||0xcc;return function(_0x2e2316){if(_0x2e2316){return _0x1cf40a[_0x6af2('0x16')](_0x5262f5);}return _0x1cf40a[_0x6af2('0x17')](_0x5262f5)['end']();};}function respondWithResult(_0x8afbe8,_0x45fd77){_0x45fd77=_0x45fd77||0xc8;return function(_0x4e0f41){if(_0x4e0f41){return _0x8afbe8[_0x6af2('0x17')](_0x45fd77)[_0x6af2('0x18')](_0x4e0f41);}};}function respondWithFilteredResult(_0x5caf30,_0x534e82){return function(_0x1ad632){if(_0x1ad632){var _0x904b26=_0x1ad632[_0x6af2('0x19')],_0x4011e4=_0x534e82['offset'],_0xeb5375=_0x534e82[_0x6af2('0x1a')]+_0x534e82[_0x6af2('0x1b')],_0x53887d;if(_0xeb5375>=_0x904b26){_0xeb5375=_0x904b26;_0x53887d=0xc8;}else{_0x53887d=0xce;}_0x5caf30[_0x6af2('0x17')](_0x53887d);return _0x5caf30[_0x6af2('0x1c')]('Content-Range',_0x4011e4+'-'+_0xeb5375+'/'+_0x904b26)['json'](_0x1ad632);}return null;};}function patchUpdates(_0x1c9f9a){return function(_0x86e9ac){try{jsonpatch[_0x6af2('0x1d')](_0x86e9ac,_0x1c9f9a,!![]);}catch(_0x33c9){return BPromise[_0x6af2('0x1e')](_0x33c9);}return _0x86e9ac[_0x6af2('0x1f')]();};}function saveUpdates(_0x5a4da2,_0x4e91c0){return function(_0x24c90b){if(_0x24c90b){return _0x24c90b[_0x6af2('0x20')](_0x5a4da2)[_0x6af2('0x21')](function(_0x49e87b){return _0x49e87b;});}return null;};}function removeEntity(_0x201d24,_0x1bf9fa){return function(_0x194f91){if(_0x194f91){return _0x194f91[_0x6af2('0x22')]()[_0x6af2('0x21')](function(){_0x201d24[_0x6af2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27ddb3,_0x18515a){return function(_0x5e83cc){if(!_0x5e83cc){_0x27ddb3[_0x6af2('0x16')](0x194);}return _0x5e83cc;};}function handleError(_0x476291,_0x25d504){_0x25d504=_0x25d504||0x1f4;return function(_0xf52ceb){logger[_0x6af2('0x23')](_0xf52ceb[_0x6af2('0x24')]);if(_0xf52ceb[_0x6af2('0x25')]){delete _0xf52ceb[_0x6af2('0x25')];}_0x476291[_0x6af2('0x17')](_0x25d504)[_0x6af2('0x26')](_0xf52ceb);};}exports[_0x6af2('0x27')]=function(_0x1994b9,_0x358b8e){var _0x58519c={},_0xac1e0={},_0x1fe584={'count':0x0,'rows':[]};var _0x46a120=db['JscriptyAnswerReport'][_0x6af2('0x28')];_0xac1e0['model']=_[_0x6af2('0x29')](_0x46a120);_0xac1e0[_0x6af2('0x2a')]=_[_0x6af2('0x29')](_0x1994b9[_0x6af2('0x2a')]);_0xac1e0['filters']=_[_0x6af2('0x2b')](_0xac1e0[_0x6af2('0x2c')],_0xac1e0[_0x6af2('0x2a')]);_0x58519c[_0x6af2('0x2d')]=_[_0x6af2('0x2b')](_0xac1e0[_0x6af2('0x2c')],qs[_0x6af2('0x2e')](_0x1994b9['query']['fields']));_0x58519c[_0x6af2('0x2d')]=_0x58519c[_0x6af2('0x2d')][_0x6af2('0x2f')]?_0x58519c[_0x6af2('0x2d')]:_0xac1e0[_0x6af2('0x2c')];if(!_0x1994b9[_0x6af2('0x2a')][_0x6af2('0x30')](_0x6af2('0x31'))){_0x58519c['limit']=qs[_0x6af2('0x1b')](_0x1994b9[_0x6af2('0x2a')][_0x6af2('0x1b')]);_0x58519c[_0x6af2('0x1a')]=qs[_0x6af2('0x1a')](_0x1994b9['query']['offset']);}_0x58519c[_0x6af2('0x32')]=qs[_0x6af2('0x33')](_0x1994b9['query'][_0x6af2('0x33')]);_0x58519c[_0x6af2('0x34')]=qs['filters'](_['pick'](_0x1994b9[_0x6af2('0x2a')],_0xac1e0[_0x6af2('0x35')]));if(_0x1994b9[_0x6af2('0x2a')][_0x6af2('0x36')]){_0x58519c[_0x6af2('0x34')]=_[_0x6af2('0x37')](_0x58519c[_0x6af2('0x34')],{'$or':_[_0x6af2('0x38')](_0x46a120,function(_0x2b9021){if(_0x2b9021[_0x6af2('0x39')][_0x6af2('0x3a')]!==_0x6af2('0x3b')){var _0x2b2e50={};_0x2b2e50[_0x2b9021[_0x6af2('0x3c')]]={'$like':'%'+_0x1994b9[_0x6af2('0x2a')][_0x6af2('0x36')]+'%'};return _0x2b2e50;}})});}_0x58519c=_[_0x6af2('0x37')]({},_0x58519c,_0x1994b9[_0x6af2('0x3d')]);var _0x491bc2={'where':_0x58519c['where']};return db[_0x6af2('0x3e')][_0x6af2('0x19')](_0x491bc2)[_0x6af2('0x21')](function(_0xc4bac4){_0x1fe584[_0x6af2('0x19')]=_0xc4bac4;if(_0x1994b9[_0x6af2('0x2a')]['includeAll']){_0x58519c[_0x6af2('0x3f')]=[{'all':!![]}];}return db[_0x6af2('0x3e')][_0x6af2('0x40')](_0x58519c);})[_0x6af2('0x21')](function(_0x5982af){_0x1fe584['rows']=_0x5982af;return _0x1fe584;})[_0x6af2('0x21')](respondWithFilteredResult(_0x358b8e,_0x58519c))['catch'](handleError(_0x358b8e,null));};exports['show']=function(_0x2e6022,_0x259b38){var _0x4b4262={'raw':!![],'where':{'id':_0x2e6022[_0x6af2('0x41')]['id']}},_0x1ca608={};_0x1ca608[_0x6af2('0x2c')]=_[_0x6af2('0x29')](db[_0x6af2('0x3e')]['rawAttributes']);_0x1ca608[_0x6af2('0x2a')]=_[_0x6af2('0x29')](_0x2e6022[_0x6af2('0x2a')]);_0x1ca608['filters']=_[_0x6af2('0x2b')](_0x1ca608['model'],_0x1ca608[_0x6af2('0x2a')]);_0x4b4262['attributes']=_[_0x6af2('0x2b')](_0x1ca608[_0x6af2('0x2c')],qs[_0x6af2('0x2e')](_0x2e6022[_0x6af2('0x2a')][_0x6af2('0x2e')]));_0x4b4262[_0x6af2('0x2d')]=_0x4b4262[_0x6af2('0x2d')][_0x6af2('0x2f')]?_0x4b4262['attributes']:_0x1ca608[_0x6af2('0x2c')];if(_0x2e6022[_0x6af2('0x2a')][_0x6af2('0x42')]){_0x4b4262[_0x6af2('0x3f')]=[{'all':!![]}];}_0x4b4262=_[_0x6af2('0x37')]({},_0x4b4262,_0x2e6022[_0x6af2('0x3d')]);return db[_0x6af2('0x3e')]['find'](_0x4b4262)[_0x6af2('0x21')](handleEntityNotFound(_0x259b38,null))[_0x6af2('0x21')](respondWithResult(_0x259b38,null))[_0x6af2('0x43')](handleError(_0x259b38,null));};exports[_0x6af2('0x44')]=function(_0x496a4d,_0x29338f){return db['JscriptyAnswerReport']['create'](_0x496a4d[_0x6af2('0x45')],{})['then'](respondWithResult(_0x29338f,0xc9))[_0x6af2('0x43')](handleError(_0x29338f,null));};exports['update']=function(_0x51d597,_0x46ec8e){if(_0x51d597['body']['id']){delete _0x51d597['body']['id'];}return db[_0x6af2('0x3e')][_0x6af2('0x46')]({'where':{'id':_0x51d597['params']['id']}})[_0x6af2('0x21')](handleEntityNotFound(_0x46ec8e,null))[_0x6af2('0x21')](saveUpdates(_0x51d597['body'],null))[_0x6af2('0x21')](respondWithResult(_0x46ec8e,null))[_0x6af2('0x43')](handleError(_0x46ec8e,null));};exports[_0x6af2('0x22')]=function(_0x2c9453,_0x4b332d){return db[_0x6af2('0x3e')][_0x6af2('0x46')]({'where':{'id':_0x2c9453[_0x6af2('0x41')]['id']}})[_0x6af2('0x21')](handleEntityNotFound(_0x4b332d,null))['then'](removeEntity(_0x4b332d,null))[_0x6af2('0x43')](handleError(_0x4b332d,null));};exports['describe']=function(_0x339e7c,_0x1770cc){return db[_0x6af2('0x3e')][_0x6af2('0x47')]()[_0x6af2('0x21')](respondWithResult(_0x1770cc,null))[_0x6af2('0x43')](handleError(_0x1770cc,null));}; \ No newline at end of file +var _0xc239=['params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show'];(function(_0x523fe4,_0x2ce052){var _0x3e8756=function(_0x220c92){while(--_0x220c92){_0x523fe4['push'](_0x523fe4['shift']());}};_0x3e8756(++_0x2ce052);}(_0xc239,0xa0));var _0x9c23=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xc239[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x9c23('0x0'));var emlformat=require(_0x9c23('0x1'));var rimraf=require(_0x9c23('0x2'));var zipdir=require(_0x9c23('0x3'));var jsonpatch=require(_0x9c23('0x4'));var rp=require(_0x9c23('0x5'));var moment=require(_0x9c23('0x6'));var BPromise=require(_0x9c23('0x7'));var Mustache=require(_0x9c23('0x8'));var util=require(_0x9c23('0x9'));var path=require(_0x9c23('0xa'));var sox=require('sox');var csv=require(_0x9c23('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9c23('0xc'));var squel=require(_0x9c23('0xd'));var crypto=require(_0x9c23('0xe'));var jsforce=require(_0x9c23('0xf'));var deskjs=require(_0x9c23('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9c23('0x11'));var Papa=require('papaparse');var Redis=require(_0x9c23('0x12'));var authService=require(_0x9c23('0x13'));var qs=require(_0x9c23('0x14'));var hardwareService=require(_0x9c23('0x15'));var logger=require(_0x9c23('0x16'))(_0x9c23('0x17'));var utils=require('../../config/utils');var config=require(_0x9c23('0x18'));var db=require(_0x9c23('0x19'))['db'];function respondWithStatusCode(_0x17961a,_0x202424){_0x202424=_0x202424||0xcc;return function(_0x457044){if(_0x457044){return _0x17961a[_0x9c23('0x1a')](_0x202424);}return _0x17961a[_0x9c23('0x1b')](_0x202424)[_0x9c23('0x1c')]();};}function respondWithResult(_0x228273,_0xd94220){_0xd94220=_0xd94220||0xc8;return function(_0x20784b){if(_0x20784b){return _0x228273[_0x9c23('0x1b')](_0xd94220)[_0x9c23('0x1d')](_0x20784b);}};}function respondWithFilteredResult(_0x55cf52,_0x26f5e6){return function(_0x3564ac){if(_0x3564ac){var _0x437e51=_0x3564ac[_0x9c23('0x1e')],_0x4f1ba4=_0x26f5e6[_0x9c23('0x1f')],_0x14b935=_0x26f5e6[_0x9c23('0x1f')]+_0x26f5e6[_0x9c23('0x20')],_0x30dd65;if(_0x14b935>=_0x437e51){_0x14b935=_0x437e51;_0x30dd65=0xc8;}else{_0x30dd65=0xce;}_0x55cf52[_0x9c23('0x1b')](_0x30dd65);return _0x55cf52[_0x9c23('0x21')](_0x9c23('0x22'),_0x4f1ba4+'-'+_0x14b935+'/'+_0x437e51)[_0x9c23('0x1d')](_0x3564ac);}return null;};}function patchUpdates(_0x2f75fd){return function(_0x14eac8){try{jsonpatch[_0x9c23('0x23')](_0x14eac8,_0x2f75fd,!![]);}catch(_0x12903d){return BPromise[_0x9c23('0x24')](_0x12903d);}return _0x14eac8['save']();};}function saveUpdates(_0x22d4c6,_0x485188){return function(_0xdddbbb){if(_0xdddbbb){return _0xdddbbb[_0x9c23('0x25')](_0x22d4c6)[_0x9c23('0x26')](function(_0x42e9f9){return _0x42e9f9;});}return null;};}function removeEntity(_0x5688f2,_0x3daad7){return function(_0x58267e){if(_0x58267e){return _0x58267e[_0x9c23('0x27')]()['then'](function(){_0x5688f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4c98,_0x41f473){return function(_0xa3fc36){if(!_0xa3fc36){_0x4a4c98[_0x9c23('0x1a')](0x194);}return _0xa3fc36;};}function handleError(_0x94897a,_0x151ebe){_0x151ebe=_0x151ebe||0x1f4;return function(_0x5f16f5){logger[_0x9c23('0x28')](_0x5f16f5[_0x9c23('0x29')]);if(_0x5f16f5['name']){delete _0x5f16f5[_0x9c23('0x2a')];}_0x94897a[_0x9c23('0x1b')](_0x151ebe)['send'](_0x5f16f5);};}exports[_0x9c23('0x2b')]=function(_0x4e32dd,_0x5c14af){var _0x591da4={},_0x5f3e50={},_0x190a38={'count':0x0,'rows':[]};var _0x34547d=db[_0x9c23('0x2c')][_0x9c23('0x2d')];_0x5f3e50[_0x9c23('0x2e')]=_[_0x9c23('0x2f')](_0x34547d);_0x5f3e50[_0x9c23('0x30')]=_['keys'](_0x4e32dd[_0x9c23('0x30')]);_0x5f3e50[_0x9c23('0x31')]=_[_0x9c23('0x32')](_0x5f3e50[_0x9c23('0x2e')],_0x5f3e50['query']);_0x591da4[_0x9c23('0x33')]=_[_0x9c23('0x32')](_0x5f3e50['model'],qs['fields'](_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x34')]));_0x591da4[_0x9c23('0x33')]=_0x591da4[_0x9c23('0x33')]['length']?_0x591da4['attributes']:_0x5f3e50[_0x9c23('0x2e')];if(!_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x35')](_0x9c23('0x36'))){_0x591da4['limit']=qs[_0x9c23('0x20')](_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x20')]);_0x591da4[_0x9c23('0x1f')]=qs[_0x9c23('0x1f')](_0x4e32dd['query'][_0x9c23('0x1f')]);}_0x591da4[_0x9c23('0x37')]=qs[_0x9c23('0x38')](_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x38')]);_0x591da4[_0x9c23('0x39')]=qs[_0x9c23('0x31')](_[_0x9c23('0x3a')](_0x4e32dd[_0x9c23('0x30')],_0x5f3e50['filters']));if(_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x3b')]){_0x591da4[_0x9c23('0x39')]=_['merge'](_0x591da4[_0x9c23('0x39')],{'$or':_[_0x9c23('0x3c')](_0x34547d,function(_0x85acfd){if(_0x85acfd[_0x9c23('0x3d')]['key']!==_0x9c23('0x3e')){var _0x2efe2a={};_0x2efe2a[_0x85acfd[_0x9c23('0x3f')]]={'$like':'%'+_0x4e32dd[_0x9c23('0x30')]['filter']+'%'};return _0x2efe2a;}})});}_0x591da4=_[_0x9c23('0x40')]({},_0x591da4,_0x4e32dd[_0x9c23('0x41')]);var _0x431364={'where':_0x591da4['where']};return db[_0x9c23('0x2c')]['count'](_0x431364)[_0x9c23('0x26')](function(_0x1c1b66){_0x190a38[_0x9c23('0x1e')]=_0x1c1b66;if(_0x4e32dd[_0x9c23('0x30')][_0x9c23('0x42')]){_0x591da4[_0x9c23('0x43')]=[{'all':!![]}];}return db[_0x9c23('0x2c')][_0x9c23('0x44')](_0x591da4);})['then'](function(_0x1b833f){_0x190a38[_0x9c23('0x45')]=_0x1b833f;return _0x190a38;})['then'](respondWithFilteredResult(_0x5c14af,_0x591da4))['catch'](handleError(_0x5c14af,null));};exports[_0x9c23('0x46')]=function(_0x2f506d,_0x1d3c4f){var _0x54eafa={'raw':!![],'where':{'id':_0x2f506d[_0x9c23('0x47')]['id']}},_0x2d921e={};_0x2d921e[_0x9c23('0x2e')]=_[_0x9c23('0x2f')](db[_0x9c23('0x2c')]['rawAttributes']);_0x2d921e[_0x9c23('0x30')]=_[_0x9c23('0x2f')](_0x2f506d[_0x9c23('0x30')]);_0x2d921e[_0x9c23('0x31')]=_['intersection'](_0x2d921e[_0x9c23('0x2e')],_0x2d921e['query']);_0x54eafa['attributes']=_[_0x9c23('0x32')](_0x2d921e[_0x9c23('0x2e')],qs[_0x9c23('0x34')](_0x2f506d[_0x9c23('0x30')]['fields']));_0x54eafa[_0x9c23('0x33')]=_0x54eafa[_0x9c23('0x33')]['length']?_0x54eafa[_0x9c23('0x33')]:_0x2d921e[_0x9c23('0x2e')];if(_0x2f506d[_0x9c23('0x30')][_0x9c23('0x42')]){_0x54eafa[_0x9c23('0x43')]=[{'all':!![]}];}_0x54eafa=_[_0x9c23('0x40')]({},_0x54eafa,_0x2f506d['options']);return db[_0x9c23('0x2c')][_0x9c23('0x48')](_0x54eafa)[_0x9c23('0x26')](handleEntityNotFound(_0x1d3c4f,null))['then'](respondWithResult(_0x1d3c4f,null))[_0x9c23('0x49')](handleError(_0x1d3c4f,null));};exports[_0x9c23('0x4a')]=function(_0x18652e,_0x320e02){return db[_0x9c23('0x2c')][_0x9c23('0x4a')](_0x18652e['body'],{})['then'](respondWithResult(_0x320e02,0xc9))['catch'](handleError(_0x320e02,null));};exports[_0x9c23('0x25')]=function(_0xe8f4ca,_0x111ac7){if(_0xe8f4ca[_0x9c23('0x4b')]['id']){delete _0xe8f4ca[_0x9c23('0x4b')]['id'];}return db[_0x9c23('0x2c')]['find']({'where':{'id':_0xe8f4ca[_0x9c23('0x47')]['id']}})[_0x9c23('0x26')](handleEntityNotFound(_0x111ac7,null))['then'](saveUpdates(_0xe8f4ca['body'],null))[_0x9c23('0x26')](respondWithResult(_0x111ac7,null))[_0x9c23('0x49')](handleError(_0x111ac7,null));};exports[_0x9c23('0x27')]=function(_0x3e0c47,_0x394c28){return db[_0x9c23('0x2c')][_0x9c23('0x48')]({'where':{'id':_0x3e0c47[_0x9c23('0x47')]['id']}})[_0x9c23('0x26')](handleEntityNotFound(_0x394c28,null))['then'](removeEntity(_0x394c28,null))[_0x9c23('0x49')](handleError(_0x394c28,null));};exports['describe']=function(_0x2ae955,_0x277949){return db[_0x9c23('0x2c')][_0x9c23('0x4c')]()[_0x9c23('0x26')](respondWithResult(_0x277949,null))['catch'](handleError(_0x277949,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 5a662dd..35e374e 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 _0x75b0=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','moment','request-promise','rimraf'];(function(_0x1cfad8,_0x1a5444){var _0x1e3f35=function(_0x11620d){while(--_0x11620d){_0x1cfad8['push'](_0x1cfad8['shift']());}};_0x1e3f35(++_0x1a5444);}(_0x75b0,0x1d5));var _0x075b=function(_0x41cf82,_0x44a878){_0x41cf82=_0x41cf82-0x0;var _0x25e22d=_0x75b0[_0x41cf82];return _0x25e22d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x075b('0x0'));var BPromise=require('bluebird');var rp=require(_0x075b('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x075b('0x2'));var config=require(_0x075b('0x3'));var attributes=require(_0x075b('0x4'));module[_0x075b('0x5')]=function(_0x50c102,_0x3423ae){return _0x50c102[_0x075b('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0x075b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0497=['define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','bluebird','path','./jscriptyAnswerReport.attributes','exports'];(function(_0x51cf44,_0x2b04e1){var _0xb4dbd6=function(_0x23bc29){while(--_0x23bc29){_0x51cf44['push'](_0x51cf44['shift']());}};_0xb4dbd6(++_0x2b04e1);}(_0x0497,0x67));var _0x7049=function(_0x595a21,_0x24790f){_0x595a21=_0x595a21-0x0;var _0x50df84=_0x0497[_0x595a21];return _0x50df84;};'use strict';var _=require('lodash');var util=require(_0x7049('0x0'));var logger=require(_0x7049('0x1'))(_0x7049('0x2'));var moment=require('moment');var BPromise=require(_0x7049('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7049('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7049('0x5'));module[_0x7049('0x6')]=function(_0x1d6563,_0xf8a602){return _0x1d6563[_0x7049('0x7')](_0x7049('0x8'),attributes,{'tableName':_0x7049('0x9'),'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 30350cf..b935552 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 _0x2e32=['code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f38c7,_0x4ae529){var _0x303cf7=function(_0x3eec64){while(--_0x3eec64){_0x5f38c7['push'](_0x5f38c7['shift']());}};_0x303cf7(++_0x4ae529);}(_0x2e32,0x16b));var _0x22e3=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x2e32[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x22e3('0x0'));var util=require(_0x22e3('0x1'));var moment=require('moment');var BPromise=require(_0x22e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22e3('0x3'));var db=require(_0x22e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x22e3('0x5'))(_0x22e3('0x6'));var config=require(_0x22e3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x22e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e99ac,_0x4cf43a,_0x1952bf){return new BPromise(function(_0x2b8170,_0x17ce5b){return client['request'](_0x3e99ac,_0x1952bf)[_0x22e3('0x9')](function(_0x1ed12b){logger[_0x22e3('0xa')](_0x22e3('0xb'),_0x4cf43a,_0x22e3('0xc'));logger[_0x22e3('0xd')](_0x22e3('0xe'),_0x4cf43a,'request\x20sent',JSON[_0x22e3('0xf')](_0x1ed12b));if(_0x1ed12b[_0x22e3('0x10')]){if(_0x1ed12b[_0x22e3('0x10')][_0x22e3('0x11')]===0x1f4){logger[_0x22e3('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4cf43a,_0x1ed12b[_0x22e3('0x10')][_0x22e3('0x12')]);return _0x17ce5b(_0x1ed12b[_0x22e3('0x10')][_0x22e3('0x12')]);}logger[_0x22e3('0x10')](_0x22e3('0xb'),_0x4cf43a,_0x1ed12b[_0x22e3('0x10')]['message']);return _0x2b8170(_0x1ed12b['error'][_0x22e3('0x12')]);}else{logger[_0x22e3('0xa')](_0x22e3('0xb'),_0x4cf43a,_0x22e3('0xc'));_0x2b8170(_0x1ed12b['result'][_0x22e3('0x12')]);}})[_0x22e3('0x13')](function(_0x516fdd){logger[_0x22e3('0x10')](_0x22e3('0xb'),_0x4cf43a,_0x516fdd);_0x17ce5b(_0x516fdd);});});} \ No newline at end of file +var _0x1080=['message','request\x20sent','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x10ef0c,_0x2289ad){var _0x61c723=function(_0x408f28){while(--_0x408f28){_0x10ef0c['push'](_0x10ef0c['shift']());}};_0x61c723(++_0x2289ad);}(_0x1080,0x16a));var _0x0108=function(_0x5085db,_0x4b8dd1){_0x5085db=_0x5085db-0x0;var _0x596c8f=_0x1080[_0x5085db];return _0x596c8f;};'use strict';var _=require('lodash');var util=require(_0x0108('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0108('0x1'));var db=require(_0x0108('0x2'))['db'];var utils=require(_0x0108('0x3'));var logger=require(_0x0108('0x4'))(_0x0108('0x5'));var config=require(_0x0108('0x6'));var jayson=require(_0x0108('0x7'));var client=jayson[_0x0108('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e88d5,_0x388e89,_0x2eb4b3){return new BPromise(function(_0x531317,_0x27e446){return client[_0x0108('0x9')](_0x2e88d5,_0x2eb4b3)[_0x0108('0xa')](function(_0x2fcb96){logger[_0x0108('0xb')](_0x0108('0xc'),_0x388e89,'request\x20sent');logger[_0x0108('0xd')](_0x0108('0xe'),_0x388e89,'request\x20sent',JSON['stringify'](_0x2fcb96));if(_0x2fcb96[_0x0108('0xf')]){if(_0x2fcb96[_0x0108('0xf')]['code']===0x1f4){logger[_0x0108('0xf')](_0x0108('0xc'),_0x388e89,_0x2fcb96['error'][_0x0108('0x10')]);return _0x27e446(_0x2fcb96['error'][_0x0108('0x10')]);}logger[_0x0108('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x388e89,_0x2fcb96[_0x0108('0xf')][_0x0108('0x10')]);return _0x531317(_0x2fcb96[_0x0108('0xf')][_0x0108('0x10')]);}else{logger[_0x0108('0xb')](_0x0108('0xc'),_0x388e89,_0x0108('0x11'));_0x531317(_0x2fcb96['result']['message']);}})['catch'](function(_0x1505c4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x388e89,_0x1505c4);_0x27e446(_0x1505c4);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 904974b..b4cbe5b 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 _0xa004=['get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','update','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller'];(function(_0x3b99e0,_0x4981b4){var _0xaf524c=function(_0x5d33c3){while(--_0x5d33c3){_0x3b99e0['push'](_0x3b99e0['shift']());}};_0xaf524c(++_0x4981b4);}(_0xa004,0x143));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a00('0x0'));var timeout=require('connect-timeout');var express=require(_0x4a00('0x1'));var router=express[_0x4a00('0x2')]();var auth=require(_0x4a00('0x3'));var interaction=require(_0x4a00('0x4'));var config=require(_0x4a00('0x5'));var controller=require(_0x4a00('0x6'));router[_0x4a00('0x7')]('/',auth[_0x4a00('0x8')](),controller[_0x4a00('0x9')]);router['get'](_0x4a00('0xa'),auth['isAuthenticated'](),controller[_0x4a00('0xb')]);router['get'](_0x4a00('0xc'),auth[_0x4a00('0x8')](),controller['getSessions']);router[_0x4a00('0x7')](_0x4a00('0xd'),auth['isAuthenticated'](),controller[_0x4a00('0xe')]);router['get']('/:id/summary',auth[_0x4a00('0x8')](),timeout(_0x4a00('0xf')),controller[_0x4a00('0x10')]);router[_0x4a00('0x11')]('/',auth[_0x4a00('0x8')](),controller['create']);router[_0x4a00('0x11')](_0x4a00('0x12'),auth[_0x4a00('0x8')](),controller['clone']);router['put'](_0x4a00('0xa'),auth[_0x4a00('0x8')](),controller[_0x4a00('0x13')]);router[_0x4a00('0x14')]('/:id',auth[_0x4a00('0x8')](),controller[_0x4a00('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca91=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/answers','getAnswers','/:id/summary','30s','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xfaf6c9,_0x4e90a6){var _0x31eb7a=function(_0x27d7de){while(--_0x27d7de){_0xfaf6c9['push'](_0xfaf6c9['shift']());}};_0x31eb7a(++_0x4e90a6);}(_0xca91,0x1d2));var _0x1ca9=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0xca91[_0x2002b3];return _0x2756f0;};'use strict';var multer=require(_0x1ca9('0x0'));var util=require(_0x1ca9('0x1'));var path=require(_0x1ca9('0x2'));var timeout=require(_0x1ca9('0x3'));var express=require(_0x1ca9('0x4'));var router=express[_0x1ca9('0x5')]();var auth=require(_0x1ca9('0x6'));var interaction=require(_0x1ca9('0x7'));var config=require(_0x1ca9('0x8'));var controller=require(_0x1ca9('0x9'));router[_0x1ca9('0xa')]('/',auth[_0x1ca9('0xb')](),controller[_0x1ca9('0xc')]);router[_0x1ca9('0xa')](_0x1ca9('0xd'),auth['isAuthenticated'](),controller[_0x1ca9('0xe')]);router[_0x1ca9('0xa')]('/:id/sessions',auth[_0x1ca9('0xb')](),controller['getSessions']);router[_0x1ca9('0xa')](_0x1ca9('0xf'),auth[_0x1ca9('0xb')](),controller[_0x1ca9('0x10')]);router[_0x1ca9('0xa')](_0x1ca9('0x11'),auth['isAuthenticated'](),timeout(_0x1ca9('0x12')),controller['getSummary']);router[_0x1ca9('0x13')]('/',auth['isAuthenticated'](),controller[_0x1ca9('0x14')]);router[_0x1ca9('0x13')]('/:id/clone',auth[_0x1ca9('0xb')](),controller['clone']);router[_0x1ca9('0x15')]('/:id',auth[_0x1ca9('0xb')](),controller[_0x1ca9('0x16')]);router[_0x1ca9('0x17')](_0x1ca9('0xd'),auth[_0x1ca9('0xb')](),controller[_0x1ca9('0x18')]);module[_0x1ca9('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index ac92714..d34c677 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 _0xf176=['isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x3a7f64,_0x5b3c34){var _0x5ec593=function(_0x4a7169){while(--_0x4a7169){_0x3a7f64['push'](_0x3a7f64['shift']());}};_0x5ec593(++_0x5b3c34);}(_0xf176,0x74));var _0x6f17=function(_0x1344c2,_0x540c25){_0x1344c2=_0x1344c2-0x0;var _0xf24785=_0xf176[_0x1344c2];return _0xf24785;};'use strict';var Sequelize=require(_0x6f17('0x0'));var _=require(_0x6f17('0x1'));var util=require(_0x6f17('0x2'));module[_0x6f17('0x3')]={'name':{'type':Sequelize[_0x6f17('0x4')],'unique':_0x6f17('0x5')},'description':{'type':Sequelize[_0x6f17('0x4')]},'formData':{'type':Sequelize[_0x6f17('0x6')](_0x6f17('0x7')),'set':function(_0x1c0aed){if(_[_0x6f17('0x8')](_0x1c0aed)){this[_0x6f17('0x9')](_0x6f17('0xa'),JSON[_0x6f17('0xb')](_0x1c0aed));}else if(_[_0x6f17('0xc')](_0x1c0aed)){this[_0x6f17('0x9')](_0x6f17('0xa'),_0x1c0aed);}else{this[_0x6f17('0x9')](_0x6f17('0xa'),util['format'](_0x6f17('0xd'),this[_0x6f17('0xe')](_0x6f17('0x5'))||'',this[_0x6f17('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6f17('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa0a9=['long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','util','exports','STRING'];(function(_0x5a2291,_0x3ddda7){var _0x10e3f5=function(_0xc510cc){while(--_0xc510cc){_0x5a2291['push'](_0x5a2291['shift']());}};_0x10e3f5(++_0x3ddda7);}(_0xa0a9,0xde));var _0x9a0a=function(_0x5aeedf,_0x3d746d){_0x5aeedf=_0x5aeedf-0x0;var _0x10871b=_0xa0a9[_0x5aeedf];return _0x10871b;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x9a0a('0x0'));module[_0x9a0a('0x1')]={'name':{'type':Sequelize[_0x9a0a('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x9a0a('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x9a0a('0x3')),'set':function(_0x33b344){if(_[_0x9a0a('0x4')](_0x33b344)){this['setDataValue'](_0x9a0a('0x5'),JSON[_0x9a0a('0x6')](_0x33b344));}else if(_[_0x9a0a('0x7')](_0x33b344)){this[_0x9a0a('0x8')](_0x9a0a('0x5'),_0x33b344);}else{this[_0x9a0a('0x8')](_0x9a0a('0x5'),util[_0x9a0a('0x9')](_0x9a0a('0xa'),this[_0x9a0a('0xb')](_0x9a0a('0xc'))||'',this['getDataValue'](_0x9a0a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9a0a('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 6f2ebf1..cff68aa 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 _0x3d42=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get','Projects','UserProfileResource','end','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','findAll','rows','catch','show','params','includeAll','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','body','role','getSessions','hasOwnProperty','ProjectId','JscriptySessionReport','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Content-type','text/csv','download','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x54188f,_0x40cc29){var _0x4b31f0=function(_0x448b87){while(--_0x448b87){_0x54188f['push'](_0x54188f['shift']());}};_0x4b31f0(++_0x40cc29);}(_0x3d42,0xd2));var _0x23d4=function(_0x44f347,_0x3be1a9){_0x44f347=_0x44f347-0x0;var _0x296219=_0x3d42[_0x44f347];return _0x296219;};'use strict';var pdf=require(_0x23d4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23d4('0x1'));var jsonpatch=require(_0x23d4('0x2'));var rp=require(_0x23d4('0x3'));var moment=require(_0x23d4('0x4'));var BPromise=require(_0x23d4('0x5'));var Mustache=require(_0x23d4('0x6'));var util=require(_0x23d4('0x7'));var path=require(_0x23d4('0x8'));var sox=require(_0x23d4('0x9'));var csv=require(_0x23d4('0xa'));var ejs=require(_0x23d4('0xb'));var fs=require('fs');var _=require(_0x23d4('0xc'));var squel=require(_0x23d4('0xd'));var crypto=require(_0x23d4('0xe'));var jsforce=require(_0x23d4('0xf'));var deskjs=require(_0x23d4('0x10'));var toCsv=require(_0x23d4('0xa'));var querystring=require(_0x23d4('0x11'));var Papa=require(_0x23d4('0x12'));var Redis=require(_0x23d4('0x13'));var authService=require(_0x23d4('0x14'));var qs=require(_0x23d4('0x15'));var hardwareService=require(_0x23d4('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x23d4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18bfcd,_0x20a3e3){_0x20a3e3=_0x20a3e3||0xcc;return function(_0x3f5474){if(_0x3f5474){return _0x18bfcd[_0x23d4('0x18')](_0x20a3e3);}return _0x18bfcd[_0x23d4('0x19')](_0x20a3e3)['end']();};}function respondWithResult(_0x2bb0cb,_0x35dd06){_0x35dd06=_0x35dd06||0xc8;return function(_0x3bc640){if(_0x3bc640){return _0x2bb0cb[_0x23d4('0x19')](_0x35dd06)[_0x23d4('0x1a')](_0x3bc640);}};}function respondWithFilteredResult(_0x2d9508,_0x59c8b3){return function(_0x4e479a){if(_0x4e479a){var _0x58f74d=_0x4e479a[_0x23d4('0x1b')],_0x491555=_0x59c8b3[_0x23d4('0x1c')],_0x1bd140=_0x59c8b3['offset']+_0x59c8b3[_0x23d4('0x1d')],_0x217ed5;if(_0x1bd140>=_0x58f74d){_0x1bd140=_0x58f74d;_0x217ed5=0xc8;}else{_0x217ed5=0xce;}_0x2d9508[_0x23d4('0x19')](_0x217ed5);return _0x2d9508['set'](_0x23d4('0x1e'),_0x491555+'-'+_0x1bd140+'/'+_0x58f74d)[_0x23d4('0x1a')](_0x4e479a);}return null;};}function patchUpdates(_0x1b6109){return function(_0x22d910){try{jsonpatch[_0x23d4('0x1f')](_0x22d910,_0x1b6109,!![]);}catch(_0x162601){return BPromise[_0x23d4('0x20')](_0x162601);}return _0x22d910['save']();};}function saveUpdates(_0x26ebd1,_0x316368){return function(_0x4bf00c){if(_0x4bf00c){return _0x4bf00c[_0x23d4('0x21')](_0x26ebd1)['then'](function(_0x2ebf4d){return _0x2ebf4d;});}return null;};}function removeEntity(_0x120961,_0x412ce8){return function(_0x704e2c){if(_0x704e2c){return _0x704e2c[_0x23d4('0x22')]()[_0x23d4('0x23')](function(){var _0x53846c=_0x704e2c[_0x23d4('0x24')]({'plain':!![]});var _0xdf405b=_0x23d4('0x25');return db[_0x23d4('0x26')][_0x23d4('0x22')]({'where':{'type':_0xdf405b,'resourceId':_0x53846c['id']}})[_0x23d4('0x23')](function(){return _0x704e2c;});})[_0x23d4('0x23')](function(){_0x120961['status'](0xcc)[_0x23d4('0x27')]();});}};}function handleEntityNotFound(_0x1fd4a6,_0x411f77){return function(_0x3e1a38){if(!_0x3e1a38){_0x1fd4a6[_0x23d4('0x18')](0x194);}return _0x3e1a38;};}function handleError(_0x1666a5,_0x16c290){_0x16c290=_0x16c290||0x1f4;return function(_0x2f1fde){logger[_0x23d4('0x28')](_0x2f1fde[_0x23d4('0x29')]);if(_0x2f1fde[_0x23d4('0x2a')]){delete _0x2f1fde[_0x23d4('0x2a')];}_0x1666a5[_0x23d4('0x19')](_0x16c290)[_0x23d4('0x2b')](_0x2f1fde);};}exports[_0x23d4('0x2c')]=function(_0xabe116,_0x12e266){var _0xb6533e={},_0xb90075={},_0x4de85c={'count':0x0,'rows':[]};var _0xe12f80=db[_0x23d4('0x2d')][_0x23d4('0x2e')];_0xb90075[_0x23d4('0x2f')]=_[_0x23d4('0x30')](_0xe12f80);_0xb90075[_0x23d4('0x31')]=_[_0x23d4('0x30')](_0xabe116[_0x23d4('0x31')]);_0xb90075[_0x23d4('0x32')]=_[_0x23d4('0x33')](_0xb90075[_0x23d4('0x2f')],_0xb90075['query']);_0xb6533e[_0x23d4('0x34')]=_[_0x23d4('0x33')](_0xb90075[_0x23d4('0x2f')],qs[_0x23d4('0x35')](_0xabe116[_0x23d4('0x31')][_0x23d4('0x35')]));_0xb6533e[_0x23d4('0x34')]=_0xb6533e[_0x23d4('0x34')][_0x23d4('0x36')]?_0xb6533e['attributes']:_0xb90075[_0x23d4('0x2f')];if(!_0xabe116[_0x23d4('0x31')]['hasOwnProperty'](_0x23d4('0x37'))){_0xb6533e[_0x23d4('0x1d')]=qs['limit'](_0xabe116[_0x23d4('0x31')][_0x23d4('0x1d')]);_0xb6533e[_0x23d4('0x1c')]=qs['offset'](_0xabe116[_0x23d4('0x31')][_0x23d4('0x1c')]);}_0xb6533e[_0x23d4('0x38')]=qs[_0x23d4('0x39')](_0xabe116[_0x23d4('0x31')][_0x23d4('0x39')]);_0xb6533e['where']=qs[_0x23d4('0x32')](_[_0x23d4('0x3a')](_0xabe116['query'],_0xb90075['filters']));if(_0xabe116[_0x23d4('0x31')][_0x23d4('0x3b')]){_0xb6533e[_0x23d4('0x3c')]=_[_0x23d4('0x3d')](_0xb6533e[_0x23d4('0x3c')],{'$or':_[_0x23d4('0x3e')](_0xe12f80,function(_0x10f8fb){if(_0x10f8fb[_0x23d4('0x3f')][_0x23d4('0x40')]!=='VIRTUAL'){var _0x227bf6={};_0x227bf6[_0x10f8fb[_0x23d4('0x41')]]={'$like':'%'+_0xabe116[_0x23d4('0x31')][_0x23d4('0x3b')]+'%'};return _0x227bf6;}})});}_0xb6533e=_['merge']({},_0xb6533e,_0xabe116['options']);var _0x36d279={'where':_0xb6533e[_0x23d4('0x3c')]};return db[_0x23d4('0x2d')][_0x23d4('0x1b')](_0x36d279)[_0x23d4('0x23')](function(_0x52184c){_0x4de85c[_0x23d4('0x1b')]=_0x52184c;if(_0xabe116['query']['includeAll']){_0xb6533e['include']=[{'all':!![]}];}return db[_0x23d4('0x2d')][_0x23d4('0x42')](_0xb6533e);})[_0x23d4('0x23')](function(_0x145557){_0x4de85c[_0x23d4('0x43')]=_0x145557;return _0x4de85c;})[_0x23d4('0x23')](respondWithFilteredResult(_0x12e266,_0xb6533e))[_0x23d4('0x44')](handleError(_0x12e266,null));};exports[_0x23d4('0x45')]=function(_0x2f6a2f,_0x1013c2){var _0x32af91={'raw':![],'where':{'id':_0x2f6a2f[_0x23d4('0x46')]['id']}},_0x2e47f4={};_0x2e47f4[_0x23d4('0x2f')]=_[_0x23d4('0x30')](db[_0x23d4('0x2d')][_0x23d4('0x2e')]);_0x2e47f4[_0x23d4('0x31')]=_[_0x23d4('0x30')](_0x2f6a2f[_0x23d4('0x31')]);_0x2e47f4[_0x23d4('0x32')]=_[_0x23d4('0x33')](_0x2e47f4['model'],_0x2e47f4[_0x23d4('0x31')]);_0x32af91[_0x23d4('0x34')]=_[_0x23d4('0x33')](_0x2e47f4[_0x23d4('0x2f')],qs[_0x23d4('0x35')](_0x2f6a2f[_0x23d4('0x31')]['fields']));_0x32af91[_0x23d4('0x34')]=_0x32af91[_0x23d4('0x34')][_0x23d4('0x36')]?_0x32af91[_0x23d4('0x34')]:_0x2e47f4['model'];if(_0x2f6a2f[_0x23d4('0x31')][_0x23d4('0x47')]){_0x32af91['include']=[{'all':!![]}];}_0x32af91=_['merge']({},_0x32af91,_0x2f6a2f[_0x23d4('0x48')]);return db['JscriptyProject'][_0x23d4('0x49')](_0x32af91)[_0x23d4('0x23')](handleEntityNotFound(_0x1013c2,null))['then'](respondWithResult(_0x1013c2,null))[_0x23d4('0x44')](handleError(_0x1013c2,null));};exports[_0x23d4('0x4a')]=function(_0x41131b,_0x27506c){return db[_0x23d4('0x2d')][_0x23d4('0x4a')](_0x41131b['body'],{})[_0x23d4('0x23')](function(_0x42f605){var _0x45fa32=_0x41131b[_0x23d4('0x4b')]['get']({'plain':!![]});if(!_0x45fa32)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45fa32['role']===_0x23d4('0x4b')){var _0x209ba1=_0x42f605[_0x23d4('0x24')]({'plain':!![]});var _0x4836d5='Projects';return db[_0x23d4('0x4c')]['find']({'where':{'name':_0x4836d5,'userProfileId':_0x45fa32[_0x23d4('0x4d')]},'raw':!![]})[_0x23d4('0x23')](function(_0x32c1e7){if(_0x32c1e7&&_0x32c1e7[_0x23d4('0x4e')]===0x0){return db[_0x23d4('0x26')][_0x23d4('0x4a')]({'name':_0x209ba1[_0x23d4('0x2a')],'resourceId':_0x209ba1['id'],'type':_0x32c1e7['name'],'sectionId':_0x32c1e7['id']},{})[_0x23d4('0x23')](function(){return _0x42f605;});}else{return _0x42f605;}})['catch'](function(_0x2d2957){logger[_0x23d4('0x28')](_0x23d4('0x4f'),_0x2d2957);throw _0x2d2957;});}return _0x42f605;})[_0x23d4('0x23')](respondWithResult(_0x27506c,0xc9))[_0x23d4('0x44')](handleError(_0x27506c,null));};exports[_0x23d4('0x50')]=function(_0x581106,_0x28b077){var _0x428044={'raw':![],'where':{'id':_0x581106['params']['id']}},_0x55a6eb={};_0x55a6eb[_0x23d4('0x2f')]=_['keys'](db[_0x23d4('0x2d')][_0x23d4('0x2e')]);_0x428044[_0x23d4('0x34')]=_[_0x23d4('0x33')](_0x55a6eb[_0x23d4('0x2f')],qs['fields'](_0x581106[_0x23d4('0x31')][_0x23d4('0x35')]));_0x428044['attributes']=_0x428044[_0x23d4('0x34')]['length']?_0x428044['attributes']:_0x55a6eb['model'];if(_0x581106[_0x23d4('0x31')][_0x23d4('0x47')]){_0x428044[_0x23d4('0x51')]=[{'all':!![]}];}_0x428044=_[_0x23d4('0x3d')]({},_0x428044,_0x581106[_0x23d4('0x48')]);return db['JscriptyProject']['find'](_0x428044)['then'](handleEntityNotFound(_0x28b077,null))[_0x23d4('0x23')](function(_0x2587ba){if(_0x2587ba){var _0x581e41=_0x2587ba[_0x23d4('0x24')]({'plain':!![]});_0x581e41=qs['omit'](_0x581e41,['id',_0x23d4('0x52'),_0x23d4('0x53')]);_0x581106[_0x23d4('0x54')]=_['omit'](_0x581106['body'],['id','createdAt','updatedAt']);return db['JscriptyProject'][_0x23d4('0x4a')](_[_0x23d4('0x3d')](_0x581e41,_0x581106[_0x23d4('0x54')]),{'include':_0x581106[_0x23d4('0x31')][_0x23d4('0x47')]?[{'all':!![]}]:undefined})[_0x23d4('0x23')](function(_0x494085){var _0x2640ce=_0x581106[_0x23d4('0x4b')]['get']({'plain':!![]});if(!_0x2640ce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2640ce[_0x23d4('0x55')]===_0x23d4('0x4b')){var _0x24809c=_0x494085[_0x23d4('0x24')]({'plain':!![]});var _0x3b83d2='Projects';return db[_0x23d4('0x4c')][_0x23d4('0x49')]({'where':{'name':_0x3b83d2,'userProfileId':_0x2640ce[_0x23d4('0x4d')]},'raw':!![]})['then'](function(_0xb2d4ff){if(_0xb2d4ff&&_0xb2d4ff[_0x23d4('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x24809c[_0x23d4('0x2a')],'resourceId':_0x24809c['id'],'type':_0xb2d4ff[_0x23d4('0x2a')],'sectionId':_0xb2d4ff['id']},{})[_0x23d4('0x23')](function(){return _0x494085;});}else{return _0x494085;}})[_0x23d4('0x44')](function(_0x2db70a){logger[_0x23d4('0x28')](_0x23d4('0x4f'),_0x2db70a);throw _0x2db70a;});}return _0x494085;});}})[_0x23d4('0x23')](respondWithResult(_0x28b077,0xc9))[_0x23d4('0x44')](handleError(_0x28b077,null));};exports[_0x23d4('0x21')]=function(_0xc042ff,_0x3fdefb){if(_0xc042ff['body']['id']){delete _0xc042ff[_0x23d4('0x54')]['id'];}return db[_0x23d4('0x2d')][_0x23d4('0x49')]({'where':{'id':_0xc042ff[_0x23d4('0x46')]['id']}})[_0x23d4('0x23')](handleEntityNotFound(_0x3fdefb,null))[_0x23d4('0x23')](saveUpdates(_0xc042ff[_0x23d4('0x54')],null))[_0x23d4('0x23')](respondWithResult(_0x3fdefb,null))[_0x23d4('0x44')](handleError(_0x3fdefb,null));};exports['destroy']=function(_0x7369e7,_0x1a5976){return db[_0x23d4('0x2d')][_0x23d4('0x49')]({'where':{'id':_0x7369e7['params']['id']}})[_0x23d4('0x23')](handleEntityNotFound(_0x1a5976,null))['then'](removeEntity(_0x1a5976,null))[_0x23d4('0x44')](handleError(_0x1a5976,null));};exports[_0x23d4('0x56')]=function(_0xe7d730,_0xea0f90,_0x4ec742){var _0x57e3b0={'raw':!![],'where':{}};var _0x29ba74={};var _0x34ca4c={'count':0x0,'rows':[]};return db[_0x23d4('0x2d')]['findOne']({'where':{'id':_0xe7d730[_0x23d4('0x46')]['id']}})[_0x23d4('0x23')](handleEntityNotFound(_0xea0f90,null))[_0x23d4('0x23')](function(_0x2972db){if(_0x2972db){_0x29ba74[_0x23d4('0x2f')]=_[_0x23d4('0x30')](db['JscriptySessionReport'][_0x23d4('0x2e')]);_0x29ba74[_0x23d4('0x31')]=_[_0x23d4('0x30')](_0xe7d730['query']);_0x29ba74['filters']=_[_0x23d4('0x33')](_0x29ba74[_0x23d4('0x2f')],_0x29ba74[_0x23d4('0x31')]);_0x57e3b0[_0x23d4('0x34')]=_[_0x23d4('0x33')](_0x29ba74[_0x23d4('0x2f')],qs['fields'](_0xe7d730[_0x23d4('0x31')][_0x23d4('0x35')]));_0x57e3b0['attributes']=_0x57e3b0[_0x23d4('0x34')]['length']?_0x57e3b0[_0x23d4('0x34')]:_0x29ba74[_0x23d4('0x2f')];if(!_0xe7d730['query'][_0x23d4('0x57')](_0x23d4('0x37'))){_0x57e3b0['limit']=qs[_0x23d4('0x1d')](_0xe7d730['query']['limit']);_0x57e3b0[_0x23d4('0x1c')]=qs[_0x23d4('0x1c')](_0xe7d730[_0x23d4('0x31')][_0x23d4('0x1c')]);}_0x57e3b0[_0x23d4('0x38')]=qs[_0x23d4('0x39')](_0xe7d730[_0x23d4('0x31')][_0x23d4('0x39')]);_0x57e3b0[_0x23d4('0x3c')]=qs[_0x23d4('0x32')](_[_0x23d4('0x3a')](_0xe7d730[_0x23d4('0x31')],_0x29ba74[_0x23d4('0x32')]));_0x57e3b0[_0x23d4('0x3c')][_0x23d4('0x58')]=_0x2972db['id'];if(_0xe7d730[_0x23d4('0x31')][_0x23d4('0x3b')]){_0x57e3b0[_0x23d4('0x3c')]=_[_0x23d4('0x3d')](_0x57e3b0[_0x23d4('0x3c')],{'$or':_[_0x23d4('0x3e')](_0x57e3b0[_0x23d4('0x34')],function(_0x170ef6){var _0x225d18={};_0x225d18[_0x170ef6]={'$like':'%'+_0xe7d730[_0x23d4('0x31')][_0x23d4('0x3b')]+'%'};return _0x225d18;})});}_0x57e3b0=_[_0x23d4('0x3d')]({},_0x57e3b0,_0xe7d730[_0x23d4('0x48')]);return db[_0x23d4('0x59')][_0x23d4('0x1b')]({'where':_0x57e3b0[_0x23d4('0x3c')]})[_0x23d4('0x23')](function(_0x581f54){_0x34ca4c[_0x23d4('0x1b')]=_0x581f54;if(_0xe7d730['query']['includeAll']){_0x57e3b0[_0x23d4('0x51')]=[{'all':!![]}];}return db[_0x23d4('0x59')][_0x23d4('0x42')](_0x57e3b0);})[_0x23d4('0x23')](function(_0x166be7){_0x34ca4c[_0x23d4('0x43')]=_0x166be7;return _0x34ca4c;});}})['then'](respondWithFilteredResult(_0xea0f90,_0x57e3b0))['catch'](handleError(_0xea0f90,null));};exports['getAnswers']=function(_0x46f4f2,_0x43d755,_0x52354c){var _0x5a017a={'raw':!![],'where':{}};var _0x26ab0d={};var _0x41a163={'count':0x0,'rows':[]};return db[_0x23d4('0x2d')]['findOne']({'where':{'id':_0x46f4f2[_0x23d4('0x46')]['id']}})[_0x23d4('0x23')](handleEntityNotFound(_0x43d755,null))[_0x23d4('0x23')](function(_0x35b76a){if(_0x35b76a){_0x26ab0d[_0x23d4('0x2f')]=_[_0x23d4('0x30')](db[_0x23d4('0x5a')]['rawAttributes']);_0x26ab0d[_0x23d4('0x31')]=_[_0x23d4('0x30')](_0x46f4f2[_0x23d4('0x31')]);_0x26ab0d[_0x23d4('0x32')]=_[_0x23d4('0x33')](_0x26ab0d['model'],_0x26ab0d[_0x23d4('0x31')]);_0x5a017a[_0x23d4('0x34')]=_['intersection'](_0x26ab0d[_0x23d4('0x2f')],qs[_0x23d4('0x35')](_0x46f4f2[_0x23d4('0x31')][_0x23d4('0x35')]));_0x5a017a[_0x23d4('0x34')]=_0x5a017a[_0x23d4('0x34')][_0x23d4('0x36')]?_0x5a017a['attributes']:_0x26ab0d['model'];if(!_0x46f4f2['query'][_0x23d4('0x57')](_0x23d4('0x37'))){_0x5a017a['limit']=qs[_0x23d4('0x1d')](_0x46f4f2[_0x23d4('0x31')][_0x23d4('0x1d')]);_0x5a017a[_0x23d4('0x1c')]=qs[_0x23d4('0x1c')](_0x46f4f2['query']['offset']);}_0x5a017a[_0x23d4('0x38')]=qs[_0x23d4('0x39')](_0x46f4f2[_0x23d4('0x31')][_0x23d4('0x39')]);_0x5a017a['where']=qs[_0x23d4('0x32')](_[_0x23d4('0x3a')](_0x46f4f2[_0x23d4('0x31')],_0x26ab0d[_0x23d4('0x32')]));_0x5a017a[_0x23d4('0x3c')][_0x23d4('0x58')]=_0x35b76a['id'];if(_0x46f4f2[_0x23d4('0x31')][_0x23d4('0x3b')]){_0x5a017a[_0x23d4('0x3c')]=_[_0x23d4('0x3d')](_0x5a017a[_0x23d4('0x3c')],{'$or':_['map'](_0x5a017a[_0x23d4('0x34')],function(_0x7cc0a6){var _0x37c879={};_0x37c879[_0x7cc0a6]={'$like':'%'+_0x46f4f2[_0x23d4('0x31')]['filter']+'%'};return _0x37c879;})});}_0x5a017a=_[_0x23d4('0x3d')]({},_0x5a017a,_0x46f4f2[_0x23d4('0x48')]);return db[_0x23d4('0x5a')][_0x23d4('0x1b')]({'where':_0x5a017a[_0x23d4('0x3c')]})[_0x23d4('0x23')](function(_0x306f0f){_0x41a163[_0x23d4('0x1b')]=_0x306f0f;if(_0x46f4f2['query'][_0x23d4('0x47')]){_0x5a017a[_0x23d4('0x51')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x23d4('0x42')](_0x5a017a);})['then'](function(_0x175452){_0x41a163['rows']=_0x175452;return _0x41a163;});}})[_0x23d4('0x23')](respondWithFilteredResult(_0x43d755,_0x5a017a))['catch'](handleError(_0x43d755,null));};function char(_0x1248d3){return _0x23d4('0x5b')===typeof _0x1248d3?String['fromCharCode'][_0x23d4('0x1f')](null,arguments):_0x1248d3;}function needsEncapsulation(_0xbcede0){return!!_0xbcede0&&(_0xbcede0[_0x23d4('0x5c')]()[_0x23d4('0x5d')](char(0xd))>=0x0||_0xbcede0['toString']()['indexOf'](char(0xa))>=0x0||_0xbcede0[_0x23d4('0x5c')]()[_0x23d4('0x5d')](char(0x2c))>=0x0||_0xbcede0['toString']()[_0x23d4('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x585640){var _0x43e79b=char(0x22),_0x43f6fa='\x5c'+char(0x22),_0x143d21=_0x585640[_0x23d4('0x5c')]()['replace'](new RegExp(_0x43e79b,'g'),_0x43f6fa);return _0x43e79b+_0x143d21+_0x43e79b;}exports[_0x23d4('0x5e')]=function(_0x1af605,_0xc222c0,_0x164ef1){var _0x524668,_0x197c31;var _0xd90abf={'where':{'ProjectId':_0x1af605[_0x23d4('0x46')]['id']}};if(_0x1af605[_0x23d4('0x31')][_0x23d4('0x5f')]){_0xd90abf[_0x23d4('0x3c')][_0x23d4('0x60')]=JSON['parse'](_0x1af605[_0x23d4('0x31')][_0x23d4('0x5f')]);}return db[_0x23d4('0x59')][_0x23d4('0x42')](_0xd90abf)[_0x23d4('0x23')](handleEntityNotFound(_0xc222c0,null))[_0x23d4('0x23')](function(_0x4c9733){if(_0x4c9733){_0x524668=_0x4c9733;return db['JscriptyQuestionReport'][_0x23d4('0x42')]({'where':{'SessionId':{'$in':_[_0x23d4('0x3e')](_0x524668,'id')},'ProjectId':_0x1af605['params']['id']},'order':'-createdAt'});}})[_0x23d4('0x23')](handleEntityNotFound(_0xc222c0,null))[_0x23d4('0x23')](function(_0x448226){if(_0x448226){_0x197c31=_0x448226;var _0x168364={};for(var _0x4c30ea=0x0,_0x2470c8=_0x197c31['length'];_0x4c30ea<_0x2470c8;_0x4c30ea++){if(!_0x168364[_0x23d4('0x57')](_0x197c31[_0x4c30ea][_0x23d4('0x61')])){_0x168364[_0x197c31[_0x4c30ea][_0x23d4('0x61')]]=needsEncapsulation(_0x197c31[_0x4c30ea][_0x23d4('0x62')])?encapsulate(_0x197c31[_0x4c30ea][_0x23d4('0x62')]):_0x197c31[_0x4c30ea][_0x23d4('0x62')];}}var _0x3c5dec=[],_0x202e36={};for(var _0x58cbb0=0x0,_0x263526=_0x524668['length'];_0x58cbb0<_0x263526;_0x58cbb0++){_0x202e36={'ProjectId':_0x1af605[_0x23d4('0x46')]['id'],'SessionId':_0x524668[_0x58cbb0]['id'],'StartTime':moment(_0x524668[_0x58cbb0][_0x23d4('0x60')])[_0x23d4('0x63')](_0x23d4('0x64'))};for(var _0x5f379e=0x0,_0x44093e=_0x197c31[_0x23d4('0x36')];_0x5f379e<_0x44093e;_0x5f379e++){if(_0x197c31[_0x5f379e]['SessionId']==_0x524668[_0x58cbb0]['id']&&_0x168364[_0x23d4('0x57')](_0x197c31[_0x5f379e]['questionId'])){_0x202e36[_0x168364[_0x197c31[_0x5f379e][_0x23d4('0x61')]]]=_0x197c31[_0x5f379e][_0x23d4('0x65')];}}for(var _0x1212b6 in _0x168364){if(!_0x202e36['hasOwnProperty'](_0x168364[_0x1212b6])){_0x202e36[_0x168364[_0x1212b6]]=null;}}_0x3c5dec[_0x23d4('0x66')](_0x202e36);}return _0x3c5dec;}})[_0x23d4('0x23')](function(_0x48705e){if(!_[_0x23d4('0x67')](_0x48705e)){var _0x475bc4=toCsv(_0x48705e);var _0x4b717=Date[_0x23d4('0x68')]();fs[_0x23d4('0x69')](util[_0x23d4('0x63')](_0x23d4('0x6a'),_0x1af605['params']['id'],_0x4b717),_0x475bc4);_0xc222c0[_0x23d4('0x6b')](_0x23d4('0x6c'),'attachment;\x20filename='+util[_0x23d4('0x63')]('Jscripty_Project_%d_Summary_%s.csv',_0x1af605[_0x23d4('0x46')]['id'],_0x4b717));_0xc222c0['setHeader'](_0x23d4('0x6d'),_0x23d4('0x6e'));return _0xc222c0[_0x23d4('0x6f')](util[_0x23d4('0x63')](_0x23d4('0x6a'),_0x1af605[_0x23d4('0x46')]['id'],_0x4b717));}else{return _0xc222c0[_0x23d4('0x18')](0xcc);}})['catch'](handleError(_0xc222c0,null));}; \ No newline at end of file +var _0x14d4=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Projects','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','userProfileId','update','findOne','JscriptySessionReport','nolimit','pick','ProjectId','getAnswers','hasOwnProperty','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','JscriptyProject','keys','query','intersection','model','attributes','fields','length','limit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create'];(function(_0x2f0d58,_0x360855){var _0x1b63d1=function(_0x30e4fe){while(--_0x30e4fe){_0x2f0d58['push'](_0x2f0d58['shift']());}};_0x1b63d1(++_0x360855);}(_0x14d4,0x199));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x414d('0x0'));var emlformat=require(_0x414d('0x1'));var rimraf=require(_0x414d('0x2'));var zipdir=require(_0x414d('0x3'));var jsonpatch=require(_0x414d('0x4'));var rp=require(_0x414d('0x5'));var moment=require(_0x414d('0x6'));var BPromise=require(_0x414d('0x7'));var Mustache=require(_0x414d('0x8'));var util=require('util');var path=require(_0x414d('0x9'));var sox=require(_0x414d('0xa'));var csv=require('to-csv');var ejs=require(_0x414d('0xb'));var fs=require('fs');var _=require(_0x414d('0xc'));var squel=require(_0x414d('0xd'));var crypto=require(_0x414d('0xe'));var jsforce=require(_0x414d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x414d('0x10'));var querystring=require(_0x414d('0x11'));var Papa=require(_0x414d('0x12'));var Redis=require(_0x414d('0x13'));var authService=require(_0x414d('0x14'));var qs=require(_0x414d('0x15'));var hardwareService=require(_0x414d('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x414d('0x17'));var config=require(_0x414d('0x18'));var db=require(_0x414d('0x19'))['db'];function respondWithStatusCode(_0x2ec17b,_0x829a71){_0x829a71=_0x829a71||0xcc;return function(_0x2e0361){if(_0x2e0361){return _0x2ec17b['sendStatus'](_0x829a71);}return _0x2ec17b['status'](_0x829a71)[_0x414d('0x1a')]();};}function respondWithResult(_0x4c5183,_0x1d502d){_0x1d502d=_0x1d502d||0xc8;return function(_0x298f1a){if(_0x298f1a){return _0x4c5183[_0x414d('0x1b')](_0x1d502d)[_0x414d('0x1c')](_0x298f1a);}};}function respondWithFilteredResult(_0x1f2cf9,_0xa8780d){return function(_0x384ef4){if(_0x384ef4){var _0x306639=_0x384ef4[_0x414d('0x1d')],_0x51893e=_0xa8780d[_0x414d('0x1e')],_0x10d333=_0xa8780d[_0x414d('0x1e')]+_0xa8780d['limit'],_0xd8a378;if(_0x10d333>=_0x306639){_0x10d333=_0x306639;_0xd8a378=0xc8;}else{_0xd8a378=0xce;}_0x1f2cf9['status'](_0xd8a378);return _0x1f2cf9[_0x414d('0x1f')]('Content-Range',_0x51893e+'-'+_0x10d333+'/'+_0x306639)[_0x414d('0x1c')](_0x384ef4);}return null;};}function patchUpdates(_0x5058c0){return function(_0x21f7c2){try{jsonpatch[_0x414d('0x20')](_0x21f7c2,_0x5058c0,!![]);}catch(_0x22a967){return BPromise[_0x414d('0x21')](_0x22a967);}return _0x21f7c2[_0x414d('0x22')]();};}function saveUpdates(_0x436af5,_0x2b8da5){return function(_0x4fb153){if(_0x4fb153){return _0x4fb153['update'](_0x436af5)[_0x414d('0x23')](function(_0x52bd7d){return _0x52bd7d;});}return null;};}function removeEntity(_0x4bd38d,_0x323ece){return function(_0x2d0318){if(_0x2d0318){return _0x2d0318[_0x414d('0x24')]()[_0x414d('0x23')](function(){var _0x4db2a3=_0x2d0318[_0x414d('0x25')]({'plain':!![]});var _0x86f5cb='Projects';return db[_0x414d('0x26')]['destroy']({'where':{'type':_0x86f5cb,'resourceId':_0x4db2a3['id']}})[_0x414d('0x23')](function(){return _0x2d0318;});})[_0x414d('0x23')](function(){_0x4bd38d[_0x414d('0x1b')](0xcc)[_0x414d('0x1a')]();});}};}function handleEntityNotFound(_0x5348c5,_0x294aad){return function(_0x3bd168){if(!_0x3bd168){_0x5348c5[_0x414d('0x27')](0x194);}return _0x3bd168;};}function handleError(_0x1a5c2b,_0x7ab722){_0x7ab722=_0x7ab722||0x1f4;return function(_0xf13fc6){logger[_0x414d('0x28')](_0xf13fc6[_0x414d('0x29')]);if(_0xf13fc6[_0x414d('0x2a')]){delete _0xf13fc6[_0x414d('0x2a')];}_0x1a5c2b[_0x414d('0x1b')](_0x7ab722)[_0x414d('0x2b')](_0xf13fc6);};}exports[_0x414d('0x2c')]=function(_0x5a9334,_0x5e8216){var _0x1b44db={},_0x59807a={},_0x238afc={'count':0x0,'rows':[]};var _0x32f018=db[_0x414d('0x2d')]['rawAttributes'];_0x59807a['model']=_[_0x414d('0x2e')](_0x32f018);_0x59807a['query']=_[_0x414d('0x2e')](_0x5a9334[_0x414d('0x2f')]);_0x59807a['filters']=_[_0x414d('0x30')](_0x59807a[_0x414d('0x31')],_0x59807a[_0x414d('0x2f')]);_0x1b44db[_0x414d('0x32')]=_[_0x414d('0x30')](_0x59807a[_0x414d('0x31')],qs[_0x414d('0x33')](_0x5a9334[_0x414d('0x2f')][_0x414d('0x33')]));_0x1b44db[_0x414d('0x32')]=_0x1b44db[_0x414d('0x32')][_0x414d('0x34')]?_0x1b44db[_0x414d('0x32')]:_0x59807a['model'];if(!_0x5a9334['query']['hasOwnProperty']('nolimit')){_0x1b44db[_0x414d('0x35')]=qs[_0x414d('0x35')](_0x5a9334[_0x414d('0x2f')][_0x414d('0x35')]);_0x1b44db[_0x414d('0x1e')]=qs[_0x414d('0x1e')](_0x5a9334[_0x414d('0x2f')]['offset']);}_0x1b44db[_0x414d('0x36')]=qs[_0x414d('0x37')](_0x5a9334['query'][_0x414d('0x37')]);_0x1b44db[_0x414d('0x38')]=qs[_0x414d('0x39')](_['pick'](_0x5a9334['query'],_0x59807a['filters']));if(_0x5a9334[_0x414d('0x2f')][_0x414d('0x3a')]){_0x1b44db['where']=_[_0x414d('0x3b')](_0x1b44db['where'],{'$or':_[_0x414d('0x3c')](_0x32f018,function(_0x1c2708){if(_0x1c2708[_0x414d('0x3d')][_0x414d('0x3e')]!==_0x414d('0x3f')){var _0x1b10f0={};_0x1b10f0[_0x1c2708[_0x414d('0x40')]]={'$like':'%'+_0x5a9334['query']['filter']+'%'};return _0x1b10f0;}})});}_0x1b44db=_[_0x414d('0x3b')]({},_0x1b44db,_0x5a9334[_0x414d('0x41')]);var _0x4c578c={'where':_0x1b44db[_0x414d('0x38')]};return db[_0x414d('0x2d')][_0x414d('0x1d')](_0x4c578c)[_0x414d('0x23')](function(_0x3e4f42){_0x238afc[_0x414d('0x1d')]=_0x3e4f42;if(_0x5a9334[_0x414d('0x2f')][_0x414d('0x42')]){_0x1b44db[_0x414d('0x43')]=[{'all':!![]}];}return db[_0x414d('0x2d')][_0x414d('0x44')](_0x1b44db);})[_0x414d('0x23')](function(_0x31ac66){_0x238afc[_0x414d('0x45')]=_0x31ac66;return _0x238afc;})[_0x414d('0x23')](respondWithFilteredResult(_0x5e8216,_0x1b44db))[_0x414d('0x46')](handleError(_0x5e8216,null));};exports['show']=function(_0xcb7281,_0x402c71){var _0x5d7be3={'raw':![],'where':{'id':_0xcb7281[_0x414d('0x47')]['id']}},_0x2028f2={};_0x2028f2[_0x414d('0x31')]=_[_0x414d('0x2e')](db[_0x414d('0x2d')][_0x414d('0x48')]);_0x2028f2[_0x414d('0x2f')]=_[_0x414d('0x2e')](_0xcb7281[_0x414d('0x2f')]);_0x2028f2['filters']=_[_0x414d('0x30')](_0x2028f2[_0x414d('0x31')],_0x2028f2['query']);_0x5d7be3[_0x414d('0x32')]=_['intersection'](_0x2028f2[_0x414d('0x31')],qs[_0x414d('0x33')](_0xcb7281[_0x414d('0x2f')][_0x414d('0x33')]));_0x5d7be3[_0x414d('0x32')]=_0x5d7be3['attributes'][_0x414d('0x34')]?_0x5d7be3[_0x414d('0x32')]:_0x2028f2[_0x414d('0x31')];if(_0xcb7281[_0x414d('0x2f')][_0x414d('0x42')]){_0x5d7be3['include']=[{'all':!![]}];}_0x5d7be3=_[_0x414d('0x3b')]({},_0x5d7be3,_0xcb7281[_0x414d('0x41')]);return db[_0x414d('0x2d')][_0x414d('0x49')](_0x5d7be3)['then'](handleEntityNotFound(_0x402c71,null))[_0x414d('0x23')](respondWithResult(_0x402c71,null))[_0x414d('0x46')](handleError(_0x402c71,null));};exports['create']=function(_0x4a561e,_0x2a13e2){return db['JscriptyProject'][_0x414d('0x4a')](_0x4a561e[_0x414d('0x4b')],{})[_0x414d('0x23')](function(_0x2e6ead){var _0x4f5159=_0x4a561e['user'][_0x414d('0x25')]({'plain':!![]});if(!_0x4f5159)throw new Error(_0x414d('0x4c'));if(_0x4f5159['role']===_0x414d('0x4d')){var _0x4183d6=_0x2e6ead[_0x414d('0x25')]({'plain':!![]});var _0x16a920=_0x414d('0x4e');return db['UserProfileSection'][_0x414d('0x49')]({'where':{'name':_0x16a920,'userProfileId':_0x4f5159['userProfileId']},'raw':!![]})[_0x414d('0x23')](function(_0x3933eb){if(_0x3933eb&&_0x3933eb[_0x414d('0x4f')]===0x0){return db['UserProfileResource'][_0x414d('0x4a')]({'name':_0x4183d6[_0x414d('0x2a')],'resourceId':_0x4183d6['id'],'type':_0x3933eb['name'],'sectionId':_0x3933eb['id']},{})[_0x414d('0x23')](function(){return _0x2e6ead;});}else{return _0x2e6ead;}})[_0x414d('0x46')](function(_0x374f59){logger[_0x414d('0x28')](_0x414d('0x50'),_0x374f59);throw _0x374f59;});}return _0x2e6ead;})['then'](respondWithResult(_0x2a13e2,0xc9))[_0x414d('0x46')](handleError(_0x2a13e2,null));};exports['clone']=function(_0x3e6904,_0x4080bb){var _0x5f292c={'raw':![],'where':{'id':_0x3e6904[_0x414d('0x47')]['id']}},_0x38690f={};_0x38690f[_0x414d('0x31')]=_['keys'](db['JscriptyProject'][_0x414d('0x48')]);_0x5f292c[_0x414d('0x32')]=_[_0x414d('0x30')](_0x38690f[_0x414d('0x31')],qs[_0x414d('0x33')](_0x3e6904[_0x414d('0x2f')][_0x414d('0x33')]));_0x5f292c[_0x414d('0x32')]=_0x5f292c[_0x414d('0x32')][_0x414d('0x34')]?_0x5f292c[_0x414d('0x32')]:_0x38690f[_0x414d('0x31')];if(_0x3e6904[_0x414d('0x2f')]['includeAll']){_0x5f292c['include']=[{'all':!![]}];}_0x5f292c=_[_0x414d('0x3b')]({},_0x5f292c,_0x3e6904[_0x414d('0x41')]);return db['JscriptyProject']['find'](_0x5f292c)[_0x414d('0x23')](handleEntityNotFound(_0x4080bb,null))[_0x414d('0x23')](function(_0x51f824){if(_0x51f824){var _0x1b3be3=_0x51f824[_0x414d('0x25')]({'plain':!![]});_0x1b3be3=qs[_0x414d('0x51')](_0x1b3be3,['id',_0x414d('0x52'),_0x414d('0x53')]);_0x3e6904[_0x414d('0x4b')]=_[_0x414d('0x51')](_0x3e6904[_0x414d('0x4b')],['id',_0x414d('0x52'),'updatedAt']);return db[_0x414d('0x2d')][_0x414d('0x4a')](_[_0x414d('0x3b')](_0x1b3be3,_0x3e6904[_0x414d('0x4b')]),{'include':_0x3e6904[_0x414d('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x414d('0x23')](function(_0x7e976d){var _0x245053=_0x3e6904['user'][_0x414d('0x25')]({'plain':!![]});if(!_0x245053)throw new Error(_0x414d('0x4c'));if(_0x245053['role']===_0x414d('0x4d')){var _0x35e6fa=_0x7e976d[_0x414d('0x25')]({'plain':!![]});var _0x5b3d1c=_0x414d('0x4e');return db[_0x414d('0x54')][_0x414d('0x49')]({'where':{'name':_0x5b3d1c,'userProfileId':_0x245053[_0x414d('0x55')]},'raw':!![]})[_0x414d('0x23')](function(_0xaca674){if(_0xaca674&&_0xaca674[_0x414d('0x4f')]===0x0){return db[_0x414d('0x26')][_0x414d('0x4a')]({'name':_0x35e6fa[_0x414d('0x2a')],'resourceId':_0x35e6fa['id'],'type':_0xaca674['name'],'sectionId':_0xaca674['id']},{})[_0x414d('0x23')](function(){return _0x7e976d;});}else{return _0x7e976d;}})['catch'](function(_0x17494b){logger[_0x414d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17494b);throw _0x17494b;});}return _0x7e976d;});}})['then'](respondWithResult(_0x4080bb,0xc9))['catch'](handleError(_0x4080bb,null));};exports[_0x414d('0x56')]=function(_0x588781,_0x153fb4){if(_0x588781[_0x414d('0x4b')]['id']){delete _0x588781[_0x414d('0x4b')]['id'];}return db['JscriptyProject'][_0x414d('0x49')]({'where':{'id':_0x588781[_0x414d('0x47')]['id']}})[_0x414d('0x23')](handleEntityNotFound(_0x153fb4,null))[_0x414d('0x23')](saveUpdates(_0x588781[_0x414d('0x4b')],null))[_0x414d('0x23')](respondWithResult(_0x153fb4,null))[_0x414d('0x46')](handleError(_0x153fb4,null));};exports[_0x414d('0x24')]=function(_0x42aa4e,_0x3324d7){return db[_0x414d('0x2d')][_0x414d('0x49')]({'where':{'id':_0x42aa4e[_0x414d('0x47')]['id']}})[_0x414d('0x23')](handleEntityNotFound(_0x3324d7,null))[_0x414d('0x23')](removeEntity(_0x3324d7,null))['catch'](handleError(_0x3324d7,null));};exports['getSessions']=function(_0xc78134,_0x1ef474,_0x50c557){var _0x3a0232={'raw':!![],'where':{}};var _0x56f47e={};var _0xf47bfe={'count':0x0,'rows':[]};return db[_0x414d('0x2d')][_0x414d('0x57')]({'where':{'id':_0xc78134['params']['id']}})[_0x414d('0x23')](handleEntityNotFound(_0x1ef474,null))[_0x414d('0x23')](function(_0x43660e){if(_0x43660e){_0x56f47e[_0x414d('0x31')]=_['keys'](db[_0x414d('0x58')][_0x414d('0x48')]);_0x56f47e[_0x414d('0x2f')]=_[_0x414d('0x2e')](_0xc78134['query']);_0x56f47e[_0x414d('0x39')]=_[_0x414d('0x30')](_0x56f47e[_0x414d('0x31')],_0x56f47e[_0x414d('0x2f')]);_0x3a0232[_0x414d('0x32')]=_[_0x414d('0x30')](_0x56f47e[_0x414d('0x31')],qs[_0x414d('0x33')](_0xc78134[_0x414d('0x2f')]['fields']));_0x3a0232['attributes']=_0x3a0232[_0x414d('0x32')][_0x414d('0x34')]?_0x3a0232['attributes']:_0x56f47e[_0x414d('0x31')];if(!_0xc78134[_0x414d('0x2f')]['hasOwnProperty'](_0x414d('0x59'))){_0x3a0232[_0x414d('0x35')]=qs['limit'](_0xc78134[_0x414d('0x2f')][_0x414d('0x35')]);_0x3a0232[_0x414d('0x1e')]=qs[_0x414d('0x1e')](_0xc78134['query']['offset']);}_0x3a0232[_0x414d('0x36')]=qs[_0x414d('0x37')](_0xc78134['query'][_0x414d('0x37')]);_0x3a0232['where']=qs[_0x414d('0x39')](_[_0x414d('0x5a')](_0xc78134[_0x414d('0x2f')],_0x56f47e[_0x414d('0x39')]));_0x3a0232[_0x414d('0x38')][_0x414d('0x5b')]=_0x43660e['id'];if(_0xc78134[_0x414d('0x2f')]['filter']){_0x3a0232['where']=_[_0x414d('0x3b')](_0x3a0232[_0x414d('0x38')],{'$or':_[_0x414d('0x3c')](_0x3a0232[_0x414d('0x32')],function(_0x2fec0a){var _0x2076fd={};_0x2076fd[_0x2fec0a]={'$like':'%'+_0xc78134[_0x414d('0x2f')]['filter']+'%'};return _0x2076fd;})});}_0x3a0232=_[_0x414d('0x3b')]({},_0x3a0232,_0xc78134[_0x414d('0x41')]);return db['JscriptySessionReport'][_0x414d('0x1d')]({'where':_0x3a0232[_0x414d('0x38')]})[_0x414d('0x23')](function(_0x2fb927){_0xf47bfe['count']=_0x2fb927;if(_0xc78134[_0x414d('0x2f')][_0x414d('0x42')]){_0x3a0232[_0x414d('0x43')]=[{'all':!![]}];}return db[_0x414d('0x58')]['findAll'](_0x3a0232);})[_0x414d('0x23')](function(_0x385dae){_0xf47bfe['rows']=_0x385dae;return _0xf47bfe;});}})[_0x414d('0x23')](respondWithFilteredResult(_0x1ef474,_0x3a0232))[_0x414d('0x46')](handleError(_0x1ef474,null));};exports[_0x414d('0x5c')]=function(_0x28c3f9,_0x403dd6,_0xb04ee){var _0x505441={'raw':!![],'where':{}};var _0x893902={};var _0x47386f={'count':0x0,'rows':[]};return db[_0x414d('0x2d')]['findOne']({'where':{'id':_0x28c3f9['params']['id']}})[_0x414d('0x23')](handleEntityNotFound(_0x403dd6,null))[_0x414d('0x23')](function(_0x563cf8){if(_0x563cf8){_0x893902[_0x414d('0x31')]=_[_0x414d('0x2e')](db['JscriptyAnswerReport'][_0x414d('0x48')]);_0x893902[_0x414d('0x2f')]=_[_0x414d('0x2e')](_0x28c3f9[_0x414d('0x2f')]);_0x893902[_0x414d('0x39')]=_['intersection'](_0x893902[_0x414d('0x31')],_0x893902[_0x414d('0x2f')]);_0x505441['attributes']=_['intersection'](_0x893902[_0x414d('0x31')],qs['fields'](_0x28c3f9[_0x414d('0x2f')][_0x414d('0x33')]));_0x505441['attributes']=_0x505441[_0x414d('0x32')][_0x414d('0x34')]?_0x505441[_0x414d('0x32')]:_0x893902[_0x414d('0x31')];if(!_0x28c3f9[_0x414d('0x2f')][_0x414d('0x5d')]('nolimit')){_0x505441[_0x414d('0x35')]=qs['limit'](_0x28c3f9[_0x414d('0x2f')][_0x414d('0x35')]);_0x505441['offset']=qs[_0x414d('0x1e')](_0x28c3f9[_0x414d('0x2f')]['offset']);}_0x505441[_0x414d('0x36')]=qs['sort'](_0x28c3f9[_0x414d('0x2f')][_0x414d('0x37')]);_0x505441[_0x414d('0x38')]=qs[_0x414d('0x39')](_['pick'](_0x28c3f9[_0x414d('0x2f')],_0x893902[_0x414d('0x39')]));_0x505441['where']['ProjectId']=_0x563cf8['id'];if(_0x28c3f9[_0x414d('0x2f')][_0x414d('0x3a')]){_0x505441[_0x414d('0x38')]=_['merge'](_0x505441[_0x414d('0x38')],{'$or':_[_0x414d('0x3c')](_0x505441[_0x414d('0x32')],function(_0x388f15){var _0x6ac290={};_0x6ac290[_0x388f15]={'$like':'%'+_0x28c3f9[_0x414d('0x2f')][_0x414d('0x3a')]+'%'};return _0x6ac290;})});}_0x505441=_[_0x414d('0x3b')]({},_0x505441,_0x28c3f9[_0x414d('0x41')]);return db[_0x414d('0x5e')][_0x414d('0x1d')]({'where':_0x505441[_0x414d('0x38')]})[_0x414d('0x23')](function(_0x58194d){_0x47386f[_0x414d('0x1d')]=_0x58194d;if(_0x28c3f9['query'][_0x414d('0x42')]){_0x505441[_0x414d('0x43')]=[{'all':!![]}];}return db[_0x414d('0x5e')][_0x414d('0x44')](_0x505441);})[_0x414d('0x23')](function(_0x23ea2a){_0x47386f[_0x414d('0x45')]=_0x23ea2a;return _0x47386f;});}})[_0x414d('0x23')](respondWithFilteredResult(_0x403dd6,_0x505441))[_0x414d('0x46')](handleError(_0x403dd6,null));};function char(_0x1abf44){return _0x414d('0x5f')===typeof _0x1abf44?String[_0x414d('0x60')][_0x414d('0x20')](null,arguments):_0x1abf44;}function needsEncapsulation(_0x4d63ae){return!!_0x4d63ae&&(_0x4d63ae[_0x414d('0x61')]()[_0x414d('0x62')](char(0xd))>=0x0||_0x4d63ae[_0x414d('0x61')]()[_0x414d('0x62')](char(0xa))>=0x0||_0x4d63ae[_0x414d('0x61')]()[_0x414d('0x62')](char(0x2c))>=0x0||_0x4d63ae[_0x414d('0x61')]()[_0x414d('0x62')](char(0x22))>=0x0);}function encapsulate(_0x4308ec){var _0x2469ee=char(0x22),_0x20bd91='\x5c'+char(0x22),_0x314e65=_0x4308ec['toString']()[_0x414d('0x63')](new RegExp(_0x2469ee,'g'),_0x20bd91);return _0x2469ee+_0x314e65+_0x2469ee;}exports[_0x414d('0x64')]=function(_0x137a58,_0x5ee63e,_0x514a7f){var _0x146b77,_0x39861c;var _0x11ad6b={'where':{'ProjectId':_0x137a58[_0x414d('0x47')]['id']}};if(_0x137a58[_0x414d('0x2f')][_0x414d('0x65')]){_0x11ad6b[_0x414d('0x38')]['starttime']=JSON[_0x414d('0x66')](_0x137a58[_0x414d('0x2f')][_0x414d('0x65')]);}return db[_0x414d('0x58')]['findAll'](_0x11ad6b)[_0x414d('0x23')](handleEntityNotFound(_0x5ee63e,null))[_0x414d('0x23')](function(_0x435755){if(_0x435755){_0x146b77=_0x435755;return db[_0x414d('0x67')][_0x414d('0x44')]({'where':{'SessionId':{'$in':_['map'](_0x146b77,'id')},'ProjectId':_0x137a58[_0x414d('0x47')]['id']},'order':_0x414d('0x68')});}})[_0x414d('0x23')](handleEntityNotFound(_0x5ee63e,null))[_0x414d('0x23')](function(_0x20a2c4){if(_0x20a2c4){_0x39861c=_0x20a2c4;var _0x5adcd9={};for(var _0x211c26=0x0,_0x66b3ba=_0x39861c[_0x414d('0x34')];_0x211c26<_0x66b3ba;_0x211c26++){if(!_0x5adcd9[_0x414d('0x5d')](_0x39861c[_0x211c26][_0x414d('0x69')])){_0x5adcd9[_0x39861c[_0x211c26][_0x414d('0x69')]]=needsEncapsulation(_0x39861c[_0x211c26][_0x414d('0x6a')])?encapsulate(_0x39861c[_0x211c26][_0x414d('0x6a')]):_0x39861c[_0x211c26][_0x414d('0x6a')];}}var _0x24588b=[],_0xa0cbc0={};for(var _0x2cf8d6=0x0,_0x2f2652=_0x146b77['length'];_0x2cf8d6<_0x2f2652;_0x2cf8d6++){_0xa0cbc0={'ProjectId':_0x137a58[_0x414d('0x47')]['id'],'SessionId':_0x146b77[_0x2cf8d6]['id'],'StartTime':moment(_0x146b77[_0x2cf8d6]['starttime'])[_0x414d('0x6b')](_0x414d('0x6c'))};for(var _0xaec0ac=0x0,_0x5af909=_0x39861c['length'];_0xaec0ac<_0x5af909;_0xaec0ac++){if(_0x39861c[_0xaec0ac]['SessionId']==_0x146b77[_0x2cf8d6]['id']&&_0x5adcd9[_0x414d('0x5d')](_0x39861c[_0xaec0ac][_0x414d('0x69')])){_0xa0cbc0[_0x5adcd9[_0x39861c[_0xaec0ac]['questionId']]]=_0x39861c[_0xaec0ac][_0x414d('0x6d')];}}for(var _0x6f3cf9 in _0x5adcd9){if(!_0xa0cbc0[_0x414d('0x5d')](_0x5adcd9[_0x6f3cf9])){_0xa0cbc0[_0x5adcd9[_0x6f3cf9]]=null;}}_0x24588b[_0x414d('0x6e')](_0xa0cbc0);}return _0x24588b;}})['then'](function(_0x2fc80d){if(!_[_0x414d('0x6f')](_0x2fc80d)){var _0x25d0fc=toCsv(_0x2fc80d);var _0x2c4597=Date[_0x414d('0x70')]();fs['writeFileSync'](util[_0x414d('0x6b')](_0x414d('0x71'),_0x137a58['params']['id'],_0x2c4597),_0x25d0fc);_0x5ee63e['setHeader'](_0x414d('0x72'),_0x414d('0x73')+util['format'](_0x414d('0x74'),_0x137a58[_0x414d('0x47')]['id'],_0x2c4597));_0x5ee63e[_0x414d('0x75')](_0x414d('0x76'),_0x414d('0x77'));return _0x5ee63e[_0x414d('0x78')](util[_0x414d('0x6b')](_0x414d('0x71'),_0x137a58[_0x414d('0x47')]['id'],_0x2c4597));}else{return _0x5ee63e['sendStatus'](0xcc);}})[_0x414d('0x46')](handleError(_0x5ee63e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index fdca0fa..2cfbad0 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 _0x2b0a=['../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','api','rimraf'];(function(_0x15bbe6,_0x3a8547){var _0x5b7128=function(_0x408c91){while(--_0x408c91){_0x15bbe6['push'](_0x15bbe6['shift']());}};_0x5b7128(++_0x3a8547);}(_0x2b0a,0x84));var _0xa2b0=function(_0x5a8e4e,_0x3d3283){_0x5a8e4e=_0x5a8e4e-0x0;var _0xa5a96b=_0x2b0a[_0x5a8e4e];return _0xa5a96b;};'use strict';var _=require(_0xa2b0('0x0'));var util=require(_0xa2b0('0x1'));var logger=require('../../config/logger')(_0xa2b0('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(_0xa2b0('0x3'));var config=require(_0xa2b0('0x4'));var attributes=require(_0xa2b0('0x5'));module[_0xa2b0('0x6')]=function(_0x31fab2,_0xa4e906){return _0x31fab2['define']('JscriptyProject',attributes,{'tableName':_0xa2b0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util'];(function(_0xb55628,_0x2556b6){var _0xa312fa=function(_0xe75dba){while(--_0xe75dba){_0xb55628['push'](_0xb55628['shift']());}};_0xa312fa(++_0x2556b6);}(_0xf494,0x1c6));var _0x4f49=function(_0x2f91a6,_0x4e44ff){_0x2f91a6=_0x2f91a6-0x0;var _0x324cb5=_0xf494[_0x2f91a6];return _0x324cb5;};'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')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','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 318f9be..4ed5082 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 _0xea0d=['JscriptyProject,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xea0d,0x8d));var _0xdea0=function(_0xea81a1,_0xb28e9e){_0xea81a1=_0xea81a1-0x0;var _0x2cd030=_0xea0d[_0xea81a1];return _0x2cd030;};'use strict';var _=require(_0xdea0('0x0'));var util=require(_0xdea0('0x1'));var moment=require(_0xdea0('0x2'));var BPromise=require(_0xdea0('0x3'));var rs=require(_0xdea0('0x4'));var fs=require('fs');var Redis=require(_0xdea0('0x5'));var db=require(_0xdea0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdea0('0x7'))(_0xdea0('0x8'));var config=require('../../config/environment');var jayson=require(_0xdea0('0x9'));var client=jayson[_0xdea0('0xa')][_0xdea0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fe941,_0x1b2585,_0x5aa0c2){return new BPromise(function(_0x2b77b9,_0x5cb3a0){return client['request'](_0x2fe941,_0x5aa0c2)[_0xdea0('0xc')](function(_0x578df2){logger['info'](_0xdea0('0xd'),_0x1b2585,'request\x20sent');logger[_0xdea0('0xe')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x1b2585,'request\x20sent',JSON[_0xdea0('0xf')](_0x578df2));if(_0x578df2['error']){if(_0x578df2[_0xdea0('0x10')][_0xdea0('0x11')]===0x1f4){logger[_0xdea0('0x10')](_0xdea0('0xd'),_0x1b2585,_0x578df2['error'][_0xdea0('0x12')]);return _0x5cb3a0(_0x578df2['error'][_0xdea0('0x12')]);}logger[_0xdea0('0x10')](_0xdea0('0xd'),_0x1b2585,_0x578df2[_0xdea0('0x10')][_0xdea0('0x12')]);return _0x2b77b9(_0x578df2[_0xdea0('0x10')][_0xdea0('0x12')]);}else{logger['info'](_0xdea0('0xd'),_0x1b2585,_0xdea0('0x13'));_0x2b77b9(_0x578df2[_0xdea0('0x14')][_0xdea0('0x12')]);}})[_0xdea0('0x15')](function(_0x2f6bf5){logger['error'](_0xdea0('0xd'),_0x1b2585,_0x2f6bf5);_0x5cb3a0(_0x2f6bf5);});});} \ No newline at end of file +var _0xd4e6=['request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x53a336,_0x36ada0){var _0x140b9e=function(_0x50cb56){while(--_0x50cb56){_0x53a336['push'](_0x53a336['shift']());}};_0x140b9e(++_0x36ada0);}(_0xd4e6,0x192));var _0x6d4e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xd4e6[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x6d4e('0x0'));var util=require('util');var moment=require(_0x6d4e('0x1'));var BPromise=require(_0x6d4e('0x2'));var rs=require(_0x6d4e('0x3'));var fs=require('fs');var Redis=require(_0x6d4e('0x4'));var db=require(_0x6d4e('0x5'))['db'];var utils=require(_0x6d4e('0x6'));var logger=require('../../config/logger')(_0x6d4e('0x7'));var config=require(_0x6d4e('0x8'));var jayson=require(_0x6d4e('0x9'));var client=jayson[_0x6d4e('0xa')][_0x6d4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413fd4,_0x56a0bc,_0x2b5eb6){return new BPromise(function(_0x21e347,_0x546dc9){return client[_0x6d4e('0xc')](_0x413fd4,_0x2b5eb6)[_0x6d4e('0xd')](function(_0x58fbb6){logger[_0x6d4e('0xe')](_0x6d4e('0xf'),_0x56a0bc,_0x6d4e('0x10'));logger[_0x6d4e('0x11')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x56a0bc,_0x6d4e('0x10'),JSON['stringify'](_0x58fbb6));if(_0x58fbb6[_0x6d4e('0x12')]){if(_0x58fbb6[_0x6d4e('0x12')][_0x6d4e('0x13')]===0x1f4){logger[_0x6d4e('0x12')](_0x6d4e('0xf'),_0x56a0bc,_0x58fbb6[_0x6d4e('0x12')][_0x6d4e('0x14')]);return _0x546dc9(_0x58fbb6[_0x6d4e('0x12')][_0x6d4e('0x14')]);}logger[_0x6d4e('0x12')](_0x6d4e('0xf'),_0x56a0bc,_0x58fbb6[_0x6d4e('0x12')][_0x6d4e('0x14')]);return _0x21e347(_0x58fbb6[_0x6d4e('0x12')][_0x6d4e('0x14')]);}else{logger[_0x6d4e('0xe')](_0x6d4e('0xf'),_0x56a0bc,_0x6d4e('0x10'));_0x21e347(_0x58fbb6[_0x6d4e('0x15')][_0x6d4e('0x14')]);}})[_0x6d4e('0x16')](function(_0x18e1e1){logger[_0x6d4e('0x12')](_0x6d4e('0xf'),_0x56a0bc,_0x18e1e1);_0x546dc9(_0x18e1e1);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 8b2472f..eb69172 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 _0x5f5d=['connect-timeout','Router','../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x365ae8,_0x1a0c59){var _0x16f6b5=function(_0x1f39e4){while(--_0x1f39e4){_0x365ae8['push'](_0x365ae8['shift']());}};_0x16f6b5(++_0x1a0c59);}(_0x5f5d,0x1de));var _0xd5f5=function(_0xea0a42,_0x788de3){_0xea0a42=_0xea0a42-0x0;var _0x43846d=_0x5f5d[_0xea0a42];return _0x43846d;};'use strict';var multer=require(_0xd5f5('0x0'));var util=require(_0xd5f5('0x1'));var path=require('path');var timeout=require(_0xd5f5('0x2'));var express=require('express');var router=express[_0xd5f5('0x3')]();var auth=require(_0xd5f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd5f5('0x5'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd5f5('0x6')]);router[_0xd5f5('0x7')](_0xd5f5('0x8'),auth[_0xd5f5('0x9')](),controller[_0xd5f5('0xa')]);router[_0xd5f5('0x7')](_0xd5f5('0xb'),auth[_0xd5f5('0x9')](),controller[_0xd5f5('0xc')]);router[_0xd5f5('0xd')]('/',auth['isAuthenticated'](),controller[_0xd5f5('0xe')]);router[_0xd5f5('0xf')](_0xd5f5('0xb'),auth[_0xd5f5('0x9')](),controller[_0xd5f5('0x10')]);router[_0xd5f5('0x11')](_0xd5f5('0xb'),auth[_0xd5f5('0x9')](),controller[_0xd5f5('0x12')]);module[_0xd5f5('0x13')]=router; \ No newline at end of file +var _0x625d=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','update'];(function(_0x1887f7,_0x38c853){var _0x3d4443=function(_0x545f8f){while(--_0x545f8f){_0x1887f7['push'](_0x1887f7['shift']());}};_0x3d4443(++_0x38c853);}(_0x625d,0xfe));var _0xd625=function(_0x2aac92,_0x399a96){_0x2aac92=_0x2aac92-0x0;var _0x427e08=_0x625d[_0x2aac92];return _0x427e08;};'use strict';var multer=require(_0xd625('0x0'));var util=require(_0xd625('0x1'));var path=require(_0xd625('0x2'));var timeout=require(_0xd625('0x3'));var express=require(_0xd625('0x4'));var router=express['Router']();var auth=require(_0xd625('0x5'));var interaction=require(_0xd625('0x6'));var config=require(_0xd625('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xd625('0x8')]('/',auth[_0xd625('0x9')](),controller[_0xd625('0xa')]);router['get']('/describe',auth[_0xd625('0x9')](),controller[_0xd625('0xb')]);router[_0xd625('0x8')](_0xd625('0xc'),auth[_0xd625('0x9')](),controller[_0xd625('0xd')]);router[_0xd625('0xe')]('/',auth[_0xd625('0x9')](),controller['create']);router['put'](_0xd625('0xc'),auth[_0xd625('0x9')](),controller[_0xd625('0xf')]);router['delete'](_0xd625('0xc'),auth[_0xd625('0x9')](),controller[_0xd625('0x10')]);module[_0xd625('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 78e9e79..dc4c848 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 _0x1d90=['sequelize','STRING','long'];(function(_0x4594ad,_0x3a9ca1){var _0x59f44e=function(_0x4ed666){while(--_0x4ed666){_0x4594ad['push'](_0x4594ad['shift']());}};_0x59f44e(++_0x3a9ca1);}(_0x1d90,0x13e));var _0x01d9=function(_0x262c39,_0x14b574){_0x262c39=_0x262c39-0x0;var _0x371d00=_0x1d90[_0x262c39];return _0x371d00;};'use strict';var Sequelize=require(_0x01d9('0x0'));module['exports']={'question':{'type':Sequelize[_0x01d9('0x1')]},'answer':{'type':Sequelize['TEXT'](_0x01d9('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x01d9('0x1')]},'queue':{'type':Sequelize[_0x01d9('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x01d9('0x1')]},'calleridnum':{'type':Sequelize[_0x01d9('0x1')]},'questionId':{'type':Sequelize[_0x01d9('0x1')]}}; \ No newline at end of file +var _0x4e34=['STRING','TEXT'];(function(_0x41c070,_0x143d88){var _0x4ad693=function(_0x4cc8ac){while(--_0x4cc8ac){_0x41c070['push'](_0x41c070['shift']());}};_0x4ad693(++_0x143d88);}(_0x4e34,0x19e));var _0x44e3=function(_0x5efa97,_0x26f7cb){_0x5efa97=_0x5efa97-0x0;var _0x1c9f67=_0x4e34[_0x5efa97];return _0x1c9f67;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x44e3('0x0')]},'answer':{'type':Sequelize[_0x44e3('0x1')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x44e3('0x0')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x44e3('0x0')]},'calleridname':{'type':Sequelize[_0x44e3('0x0')]},'calleridnum':{'type':Sequelize[_0x44e3('0x0')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 573e5ce..f26c497 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 _0x2484=['attributes','fields','order','sort','pick','filter','where','merge','key','field','options','include','findAll','params','length','includeAll','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection'];(function(_0x32d2e3,_0x447277){var _0x5116db=function(_0x3f8f9c){while(--_0x3f8f9c){_0x32d2e3['push'](_0x32d2e3['shift']());}};_0x5116db(++_0x447277);}(_0x2484,0x178));var _0x4248=function(_0x5520c7,_0xbee449){_0x5520c7=_0x5520c7-0x0;var _0x3b0590=_0x2484[_0x5520c7];return _0x3b0590;};'use strict';var pdf=require(_0x4248('0x0'));var emlformat=require(_0x4248('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4248('0x2'));var jsonpatch=require(_0x4248('0x3'));var rp=require(_0x4248('0x4'));var moment=require(_0x4248('0x5'));var BPromise=require(_0x4248('0x6'));var Mustache=require(_0x4248('0x7'));var util=require(_0x4248('0x8'));var path=require('path');var sox=require(_0x4248('0x9'));var csv=require(_0x4248('0xa'));var ejs=require(_0x4248('0xb'));var fs=require('fs');var _=require(_0x4248('0xc'));var squel=require(_0x4248('0xd'));var crypto=require(_0x4248('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4248('0xf'));var toCsv=require(_0x4248('0xa'));var querystring=require(_0x4248('0x10'));var Papa=require(_0x4248('0x11'));var Redis=require(_0x4248('0x12'));var authService=require(_0x4248('0x13'));var qs=require(_0x4248('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4248('0x15'))('api');var utils=require(_0x4248('0x16'));var config=require(_0x4248('0x17'));var db=require(_0x4248('0x18'))['db'];function respondWithStatusCode(_0x59180d,_0x483f49){_0x483f49=_0x483f49||0xcc;return function(_0xeb5fd1){if(_0xeb5fd1){return _0x59180d['sendStatus'](_0x483f49);}return _0x59180d[_0x4248('0x19')](_0x483f49)[_0x4248('0x1a')]();};}function respondWithResult(_0x201804,_0x3a8be9){_0x3a8be9=_0x3a8be9||0xc8;return function(_0x3a557b){if(_0x3a557b){return _0x201804['status'](_0x3a8be9)[_0x4248('0x1b')](_0x3a557b);}};}function respondWithFilteredResult(_0xada934,_0x1ae491){return function(_0x35308b){if(_0x35308b){var _0x3e7d0a=_0x35308b[_0x4248('0x1c')],_0x51c92e=_0x1ae491[_0x4248('0x1d')],_0x46cfbb=_0x1ae491[_0x4248('0x1d')]+_0x1ae491[_0x4248('0x1e')],_0xe1ab31;if(_0x46cfbb>=_0x3e7d0a){_0x46cfbb=_0x3e7d0a;_0xe1ab31=0xc8;}else{_0xe1ab31=0xce;}_0xada934[_0x4248('0x19')](_0xe1ab31);return _0xada934[_0x4248('0x1f')](_0x4248('0x20'),_0x51c92e+'-'+_0x46cfbb+'/'+_0x3e7d0a)[_0x4248('0x1b')](_0x35308b);}return null;};}function patchUpdates(_0x2c2a0d){return function(_0x2f7547){try{jsonpatch[_0x4248('0x21')](_0x2f7547,_0x2c2a0d,!![]);}catch(_0x1b2f10){return BPromise[_0x4248('0x22')](_0x1b2f10);}return _0x2f7547[_0x4248('0x23')]();};}function saveUpdates(_0x200542,_0x396fc8){return function(_0x5ab53e){if(_0x5ab53e){return _0x5ab53e[_0x4248('0x24')](_0x200542)[_0x4248('0x25')](function(_0x2d674b){return _0x2d674b;});}return null;};}function removeEntity(_0x36ed34,_0x4b6c12){return function(_0x43c75d){if(_0x43c75d){return _0x43c75d[_0x4248('0x26')]()[_0x4248('0x25')](function(){_0x36ed34['status'](0xcc)[_0x4248('0x1a')]();});}};}function handleEntityNotFound(_0x25ffa3,_0x50f032){return function(_0x3bfcf2){if(!_0x3bfcf2){_0x25ffa3['sendStatus'](0x194);}return _0x3bfcf2;};}function handleError(_0x18070b,_0x138ac1){_0x138ac1=_0x138ac1||0x1f4;return function(_0x1daf92){logger[_0x4248('0x27')](_0x1daf92['stack']);if(_0x1daf92[_0x4248('0x28')]){delete _0x1daf92[_0x4248('0x28')];}_0x18070b[_0x4248('0x19')](_0x138ac1)[_0x4248('0x29')](_0x1daf92);};}exports[_0x4248('0x2a')]=function(_0x429641,_0x3e5a78){var _0x302308={},_0x74b7e0={},_0x1f26be={'count':0x0,'rows':[]};var _0x3b29fe=db[_0x4248('0x2b')][_0x4248('0x2c')];_0x74b7e0[_0x4248('0x2d')]=_[_0x4248('0x2e')](_0x3b29fe);_0x74b7e0[_0x4248('0x2f')]=_['keys'](_0x429641[_0x4248('0x2f')]);_0x74b7e0[_0x4248('0x30')]=_[_0x4248('0x31')](_0x74b7e0['model'],_0x74b7e0[_0x4248('0x2f')]);_0x302308[_0x4248('0x32')]=_[_0x4248('0x31')](_0x74b7e0[_0x4248('0x2d')],qs[_0x4248('0x33')](_0x429641[_0x4248('0x2f')][_0x4248('0x33')]));_0x302308['attributes']=_0x302308['attributes']['length']?_0x302308['attributes']:_0x74b7e0['model'];if(!_0x429641['query']['hasOwnProperty']('nolimit')){_0x302308['limit']=qs[_0x4248('0x1e')](_0x429641[_0x4248('0x2f')][_0x4248('0x1e')]);_0x302308[_0x4248('0x1d')]=qs['offset'](_0x429641[_0x4248('0x2f')]['offset']);}_0x302308[_0x4248('0x34')]=qs[_0x4248('0x35')](_0x429641[_0x4248('0x2f')][_0x4248('0x35')]);_0x302308['where']=qs['filters'](_[_0x4248('0x36')](_0x429641[_0x4248('0x2f')],_0x74b7e0[_0x4248('0x30')]));if(_0x429641[_0x4248('0x2f')][_0x4248('0x37')]){_0x302308[_0x4248('0x38')]=_[_0x4248('0x39')](_0x302308[_0x4248('0x38')],{'$or':_['map'](_0x3b29fe,function(_0x58f9c4){if(_0x58f9c4['type'][_0x4248('0x3a')]!=='VIRTUAL'){var _0x3cedaa={};_0x3cedaa[_0x58f9c4[_0x4248('0x3b')]]={'$like':'%'+_0x429641[_0x4248('0x2f')][_0x4248('0x37')]+'%'};return _0x3cedaa;}})});}_0x302308=_[_0x4248('0x39')]({},_0x302308,_0x429641[_0x4248('0x3c')]);var _0x4edf1f={'where':_0x302308[_0x4248('0x38')]};return db['JscriptyQuestionReport'][_0x4248('0x1c')](_0x4edf1f)[_0x4248('0x25')](function(_0x571d63){_0x1f26be[_0x4248('0x1c')]=_0x571d63;if(_0x429641[_0x4248('0x2f')]['includeAll']){_0x302308[_0x4248('0x3d')]=[{'all':!![]}];}return db[_0x4248('0x2b')][_0x4248('0x3e')](_0x302308);})[_0x4248('0x25')](function(_0xb7f152){_0x1f26be['rows']=_0xb7f152;return _0x1f26be;})[_0x4248('0x25')](respondWithFilteredResult(_0x3e5a78,_0x302308))['catch'](handleError(_0x3e5a78,null));};exports['show']=function(_0x33152c,_0x2ac3e4){var _0x897341={'raw':!![],'where':{'id':_0x33152c[_0x4248('0x3f')]['id']}},_0x3a2f6a={};_0x3a2f6a[_0x4248('0x2d')]=_[_0x4248('0x2e')](db[_0x4248('0x2b')][_0x4248('0x2c')]);_0x3a2f6a[_0x4248('0x2f')]=_['keys'](_0x33152c[_0x4248('0x2f')]);_0x3a2f6a[_0x4248('0x30')]=_[_0x4248('0x31')](_0x3a2f6a['model'],_0x3a2f6a['query']);_0x897341['attributes']=_[_0x4248('0x31')](_0x3a2f6a[_0x4248('0x2d')],qs[_0x4248('0x33')](_0x33152c[_0x4248('0x2f')][_0x4248('0x33')]));_0x897341[_0x4248('0x32')]=_0x897341['attributes'][_0x4248('0x40')]?_0x897341[_0x4248('0x32')]:_0x3a2f6a[_0x4248('0x2d')];if(_0x33152c['query'][_0x4248('0x41')]){_0x897341[_0x4248('0x3d')]=[{'all':!![]}];}_0x897341=_[_0x4248('0x39')]({},_0x897341,_0x33152c['options']);return db['JscriptyQuestionReport'][_0x4248('0x42')](_0x897341)[_0x4248('0x25')](handleEntityNotFound(_0x2ac3e4,null))[_0x4248('0x25')](respondWithResult(_0x2ac3e4,null))[_0x4248('0x43')](handleError(_0x2ac3e4,null));};exports['create']=function(_0x2498ce,_0x1108c7){return db['JscriptyQuestionReport'][_0x4248('0x44')](_0x2498ce['body'],{})[_0x4248('0x25')](respondWithResult(_0x1108c7,0xc9))[_0x4248('0x43')](handleError(_0x1108c7,null));};exports['update']=function(_0x31bdfc,_0x5d79d0){if(_0x31bdfc[_0x4248('0x45')]['id']){delete _0x31bdfc[_0x4248('0x45')]['id'];}return db[_0x4248('0x2b')][_0x4248('0x42')]({'where':{'id':_0x31bdfc['params']['id']}})['then'](handleEntityNotFound(_0x5d79d0,null))['then'](saveUpdates(_0x31bdfc[_0x4248('0x45')],null))[_0x4248('0x25')](respondWithResult(_0x5d79d0,null))[_0x4248('0x43')](handleError(_0x5d79d0,null));};exports[_0x4248('0x26')]=function(_0x4c5b11,_0x42f12a){return db[_0x4248('0x2b')][_0x4248('0x42')]({'where':{'id':_0x4c5b11[_0x4248('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42f12a,null))[_0x4248('0x25')](removeEntity(_0x42f12a,null))[_0x4248('0x43')](handleError(_0x42f12a,null));};exports[_0x4248('0x46')]=function(_0x2ed764,_0x141d66){return db[_0x4248('0x2b')][_0x4248('0x46')]()[_0x4248('0x25')](respondWithResult(_0x141d66,null))[_0x4248('0x43')](handleError(_0x141d66,null));}; \ No newline at end of file +var _0xacc6=['api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','key','VIRTUAL','field','options','include','findAll','rows','params','length','includeAll','find','catch','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x23f397,_0x2a52af){var _0x4c38cf=function(_0x28f6c6){while(--_0x28f6c6){_0x23f397['push'](_0x23f397['shift']());}};_0x4c38cf(++_0x2a52af);}(_0xacc6,0x150));var _0x6acc=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0xacc6[_0x5af59e];return _0x4240df;};'use strict';var pdf=require(_0x6acc('0x0'));var emlformat=require(_0x6acc('0x1'));var rimraf=require(_0x6acc('0x2'));var zipdir=require(_0x6acc('0x3'));var jsonpatch=require(_0x6acc('0x4'));var rp=require('request-promise');var moment=require(_0x6acc('0x5'));var BPromise=require(_0x6acc('0x6'));var Mustache=require(_0x6acc('0x7'));var util=require('util');var path=require(_0x6acc('0x8'));var sox=require('sox');var csv=require(_0x6acc('0x9'));var ejs=require(_0x6acc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0x9'));var querystring=require(_0x6acc('0xe'));var Papa=require('papaparse');var Redis=require(_0x6acc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x10'));var hardwareService=require(_0x6acc('0x11'));var logger=require(_0x6acc('0x12'))(_0x6acc('0x13'));var utils=require(_0x6acc('0x14'));var config=require(_0x6acc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28347d,_0x6dba13){_0x6dba13=_0x6dba13||0xcc;return function(_0x1d951c){if(_0x1d951c){return _0x28347d[_0x6acc('0x16')](_0x6dba13);}return _0x28347d[_0x6acc('0x17')](_0x6dba13)['end']();};}function respondWithResult(_0x5c6aed,_0x15674a){_0x15674a=_0x15674a||0xc8;return function(_0x497356){if(_0x497356){return _0x5c6aed[_0x6acc('0x17')](_0x15674a)[_0x6acc('0x18')](_0x497356);}};}function respondWithFilteredResult(_0x3c0afb,_0x2e3e01){return function(_0x3c4e61){if(_0x3c4e61){var _0x4034fb=_0x3c4e61[_0x6acc('0x19')],_0xf24527=_0x2e3e01[_0x6acc('0x1a')],_0xc07208=_0x2e3e01[_0x6acc('0x1a')]+_0x2e3e01[_0x6acc('0x1b')],_0x1fe0ac;if(_0xc07208>=_0x4034fb){_0xc07208=_0x4034fb;_0x1fe0ac=0xc8;}else{_0x1fe0ac=0xce;}_0x3c0afb[_0x6acc('0x17')](_0x1fe0ac);return _0x3c0afb[_0x6acc('0x1c')](_0x6acc('0x1d'),_0xf24527+'-'+_0xc07208+'/'+_0x4034fb)['json'](_0x3c4e61);}return null;};}function patchUpdates(_0x471cb6){return function(_0x43b8ca){try{jsonpatch[_0x6acc('0x1e')](_0x43b8ca,_0x471cb6,!![]);}catch(_0x151282){return BPromise['reject'](_0x151282);}return _0x43b8ca[_0x6acc('0x1f')]();};}function saveUpdates(_0x531f7c,_0x51dea7){return function(_0x4af9e){if(_0x4af9e){return _0x4af9e['update'](_0x531f7c)[_0x6acc('0x20')](function(_0x3edf4a){return _0x3edf4a;});}return null;};}function removeEntity(_0x3c34f9,_0xc6e63f){return function(_0x245536){if(_0x245536){return _0x245536['destroy']()[_0x6acc('0x20')](function(){_0x3c34f9[_0x6acc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x334416,_0x5ba0b6){return function(_0x22abf1){if(!_0x22abf1){_0x334416[_0x6acc('0x16')](0x194);}return _0x22abf1;};}function handleError(_0x217c40,_0x205bda){_0x205bda=_0x205bda||0x1f4;return function(_0x5277b6){logger[_0x6acc('0x21')](_0x5277b6[_0x6acc('0x22')]);if(_0x5277b6['name']){delete _0x5277b6[_0x6acc('0x23')];}_0x217c40[_0x6acc('0x17')](_0x205bda)[_0x6acc('0x24')](_0x5277b6);};}exports[_0x6acc('0x25')]=function(_0x212bde,_0x472220){var _0x31b849={},_0xa15e0f={},_0x4d1c18={'count':0x0,'rows':[]};var _0x89c205=db[_0x6acc('0x26')][_0x6acc('0x27')];_0xa15e0f[_0x6acc('0x28')]=_[_0x6acc('0x29')](_0x89c205);_0xa15e0f[_0x6acc('0x2a')]=_[_0x6acc('0x29')](_0x212bde[_0x6acc('0x2a')]);_0xa15e0f[_0x6acc('0x2b')]=_[_0x6acc('0x2c')](_0xa15e0f['model'],_0xa15e0f['query']);_0x31b849['attributes']=_['intersection'](_0xa15e0f[_0x6acc('0x28')],qs[_0x6acc('0x2d')](_0x212bde[_0x6acc('0x2a')][_0x6acc('0x2d')]));_0x31b849[_0x6acc('0x2e')]=_0x31b849[_0x6acc('0x2e')]['length']?_0x31b849['attributes']:_0xa15e0f[_0x6acc('0x28')];if(!_0x212bde[_0x6acc('0x2a')][_0x6acc('0x2f')](_0x6acc('0x30'))){_0x31b849['limit']=qs[_0x6acc('0x1b')](_0x212bde[_0x6acc('0x2a')]['limit']);_0x31b849[_0x6acc('0x1a')]=qs[_0x6acc('0x1a')](_0x212bde[_0x6acc('0x2a')]['offset']);}_0x31b849['order']=qs[_0x6acc('0x31')](_0x212bde[_0x6acc('0x2a')]['sort']);_0x31b849['where']=qs[_0x6acc('0x2b')](_[_0x6acc('0x32')](_0x212bde[_0x6acc('0x2a')],_0xa15e0f['filters']));if(_0x212bde[_0x6acc('0x2a')][_0x6acc('0x33')]){_0x31b849[_0x6acc('0x34')]=_[_0x6acc('0x35')](_0x31b849[_0x6acc('0x34')],{'$or':_['map'](_0x89c205,function(_0x113c7d){if(_0x113c7d['type'][_0x6acc('0x36')]!==_0x6acc('0x37')){var _0x5d6c84={};_0x5d6c84[_0x113c7d[_0x6acc('0x38')]]={'$like':'%'+_0x212bde['query']['filter']+'%'};return _0x5d6c84;}})});}_0x31b849=_[_0x6acc('0x35')]({},_0x31b849,_0x212bde[_0x6acc('0x39')]);var _0x11290e={'where':_0x31b849['where']};return db[_0x6acc('0x26')]['count'](_0x11290e)[_0x6acc('0x20')](function(_0x4b13f7){_0x4d1c18[_0x6acc('0x19')]=_0x4b13f7;if(_0x212bde[_0x6acc('0x2a')]['includeAll']){_0x31b849[_0x6acc('0x3a')]=[{'all':!![]}];}return db[_0x6acc('0x26')][_0x6acc('0x3b')](_0x31b849);})[_0x6acc('0x20')](function(_0x46f7db){_0x4d1c18[_0x6acc('0x3c')]=_0x46f7db;return _0x4d1c18;})[_0x6acc('0x20')](respondWithFilteredResult(_0x472220,_0x31b849))['catch'](handleError(_0x472220,null));};exports['show']=function(_0x3481ad,_0x3515dd){var _0x11b0b1={'raw':!![],'where':{'id':_0x3481ad[_0x6acc('0x3d')]['id']}},_0x540820={};_0x540820[_0x6acc('0x28')]=_[_0x6acc('0x29')](db[_0x6acc('0x26')][_0x6acc('0x27')]);_0x540820[_0x6acc('0x2a')]=_[_0x6acc('0x29')](_0x3481ad[_0x6acc('0x2a')]);_0x540820[_0x6acc('0x2b')]=_[_0x6acc('0x2c')](_0x540820[_0x6acc('0x28')],_0x540820[_0x6acc('0x2a')]);_0x11b0b1['attributes']=_['intersection'](_0x540820['model'],qs[_0x6acc('0x2d')](_0x3481ad['query']['fields']));_0x11b0b1[_0x6acc('0x2e')]=_0x11b0b1[_0x6acc('0x2e')][_0x6acc('0x3e')]?_0x11b0b1[_0x6acc('0x2e')]:_0x540820[_0x6acc('0x28')];if(_0x3481ad[_0x6acc('0x2a')][_0x6acc('0x3f')]){_0x11b0b1[_0x6acc('0x3a')]=[{'all':!![]}];}_0x11b0b1=_[_0x6acc('0x35')]({},_0x11b0b1,_0x3481ad[_0x6acc('0x39')]);return db[_0x6acc('0x26')][_0x6acc('0x40')](_0x11b0b1)[_0x6acc('0x20')](handleEntityNotFound(_0x3515dd,null))['then'](respondWithResult(_0x3515dd,null))[_0x6acc('0x41')](handleError(_0x3515dd,null));};exports[_0x6acc('0x42')]=function(_0x49f57d,_0x1d6ae7){return db['JscriptyQuestionReport'][_0x6acc('0x42')](_0x49f57d[_0x6acc('0x43')],{})['then'](respondWithResult(_0x1d6ae7,0xc9))[_0x6acc('0x41')](handleError(_0x1d6ae7,null));};exports[_0x6acc('0x44')]=function(_0x28c568,_0xa29d3f){if(_0x28c568[_0x6acc('0x43')]['id']){delete _0x28c568['body']['id'];}return db[_0x6acc('0x26')][_0x6acc('0x40')]({'where':{'id':_0x28c568[_0x6acc('0x3d')]['id']}})[_0x6acc('0x20')](handleEntityNotFound(_0xa29d3f,null))[_0x6acc('0x20')](saveUpdates(_0x28c568[_0x6acc('0x43')],null))[_0x6acc('0x20')](respondWithResult(_0xa29d3f,null))[_0x6acc('0x41')](handleError(_0xa29d3f,null));};exports[_0x6acc('0x45')]=function(_0x28e601,_0x1989a6){return db[_0x6acc('0x26')][_0x6acc('0x40')]({'where':{'id':_0x28e601[_0x6acc('0x3d')]['id']}})[_0x6acc('0x20')](handleEntityNotFound(_0x1989a6,null))[_0x6acc('0x20')](removeEntity(_0x1989a6,null))[_0x6acc('0x41')](handleError(_0x1989a6,null));};exports['describe']=function(_0x5ab4af,_0x5e1fe6){return db[_0x6acc('0x26')][_0x6acc('0x46')]()['then'](respondWithResult(_0x5e1fe6,null))[_0x6acc('0x41')](handleError(_0x5e1fe6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index dfb6c40..e4844d5 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 _0xa739=['report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x462b3a,_0x52fa71){var _0xbc5daa=function(_0x10dc88){while(--_0x10dc88){_0x462b3a['push'](_0x462b3a['shift']());}};_0xbc5daa(++_0x52fa71);}(_0xa739,0x145));var _0x9a73=function(_0x3bf747,_0x20352d){_0x3bf747=_0x3bf747-0x0;var _0x425334=_0xa739[_0x3bf747];return _0x425334;};'use strict';var _=require(_0x9a73('0x0'));var util=require('util');var logger=require(_0x9a73('0x1'))(_0x9a73('0x2'));var moment=require(_0x9a73('0x3'));var BPromise=require(_0x9a73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a73('0x5'));var rimraf=require(_0x9a73('0x6'));var config=require(_0x9a73('0x7'));var attributes=require(_0x9a73('0x8'));module[_0x9a73('0x9')]=function(_0x5be63e,_0x57fc64){return _0x5be63e[_0x9a73('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x9a73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x911f=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x208ff7,_0x12129a){var _0x266751=function(_0xc816a1){while(--_0xc816a1){_0x208ff7['push'](_0x208ff7['shift']());}};_0x266751(++_0x12129a);}(_0x911f,0x91));var _0xf911=function(_0x14ff53,_0x3897b3){_0x14ff53=_0x14ff53-0x0;var _0x4e80bc=_0x911f[_0x14ff53];return _0x4e80bc;};'use strict';var _=require(_0xf911('0x0'));var util=require(_0xf911('0x1'));var logger=require(_0xf911('0x2'))(_0xf911('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf911('0x4'));var fs=require('fs');var path=require(_0xf911('0x5'));var rimraf=require(_0xf911('0x6'));var config=require(_0xf911('0x7'));var attributes=require(_0xf911('0x8'));module[_0xf911('0x9')]=function(_0x383f13,_0x15dcc5){return _0x383f13[_0xf911('0xa')](_0xf911('0xb'),attributes,{'tableName':_0xf911('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 2756cfb..4afe977 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 _0xc059=['rpc','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x41da16,_0x1e4fd9){var _0x8b9e24=function(_0x496deb){while(--_0x496deb){_0x41da16['push'](_0x41da16['shift']());}};_0x8b9e24(++_0x1e4fd9);}(_0xc059,0x83));var _0x9c05=function(_0xdc0f9,_0x5ecb9b){_0xdc0f9=_0xdc0f9-0x0;var _0x2b7260=_0xc059[_0xdc0f9];return _0x2b7260;};'use strict';var _=require(_0x9c05('0x0'));var util=require(_0x9c05('0x1'));var moment=require(_0x9c05('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c05('0x3'));var fs=require('fs');var Redis=require(_0x9c05('0x4'));var db=require(_0x9c05('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c05('0x6'))(_0x9c05('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c05('0x8'));var client=jayson[_0x9c05('0x9')][_0x9c05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45b77d,_0x570220,_0xbfb613){return new BPromise(function(_0x5e2b2d,_0x286055){return client[_0x9c05('0xb')](_0x45b77d,_0xbfb613)['then'](function(_0x4f7efe){logger['info'](_0x9c05('0xc'),_0x570220,_0x9c05('0xd'));logger[_0x9c05('0xe')](_0x9c05('0xf'),_0x570220,_0x9c05('0xd'),JSON[_0x9c05('0x10')](_0x4f7efe));if(_0x4f7efe[_0x9c05('0x11')]){if(_0x4f7efe['error'][_0x9c05('0x12')]===0x1f4){logger[_0x9c05('0x11')](_0x9c05('0xc'),_0x570220,_0x4f7efe[_0x9c05('0x11')]['message']);return _0x286055(_0x4f7efe['error'][_0x9c05('0x13')]);}logger['error'](_0x9c05('0xc'),_0x570220,_0x4f7efe[_0x9c05('0x11')][_0x9c05('0x13')]);return _0x5e2b2d(_0x4f7efe['error'][_0x9c05('0x13')]);}else{logger[_0x9c05('0x14')](_0x9c05('0xc'),_0x570220,_0x9c05('0xd'));_0x5e2b2d(_0x4f7efe[_0x9c05('0x15')]['message']);}})[_0x9c05('0x16')](function(_0x174c35){logger[_0x9c05('0x11')](_0x9c05('0xc'),_0x570220,_0x174c35);_0x286055(_0x174c35);});});} \ No newline at end of file +var _0x0447=['info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x0447,0x1ee));var _0x7044=function(_0x490772,_0x103e1b){_0x490772=_0x490772-0x0;var _0x2d828a=_0x0447[_0x490772];return _0x2d828a;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require('moment');var BPromise=require(_0x7044('0x2'));var rs=require(_0x7044('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7044('0x4'));var logger=require('../../config/logger')(_0x7044('0x5'));var config=require(_0x7044('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7044('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35668c,_0x3d452a,_0x235a52){return new BPromise(function(_0x260e25,_0x2ea097){return client[_0x7044('0x8')](_0x35668c,_0x235a52)[_0x7044('0x9')](function(_0x3e137b){logger[_0x7044('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3d452a,'request\x20sent');logger[_0x7044('0xb')](_0x7044('0xc'),_0x3d452a,_0x7044('0xd'),JSON[_0x7044('0xe')](_0x3e137b));if(_0x3e137b[_0x7044('0xf')]){if(_0x3e137b[_0x7044('0xf')][_0x7044('0x10')]===0x1f4){logger[_0x7044('0xf')](_0x7044('0x11'),_0x3d452a,_0x3e137b[_0x7044('0xf')][_0x7044('0x12')]);return _0x2ea097(_0x3e137b[_0x7044('0xf')][_0x7044('0x12')]);}logger[_0x7044('0xf')](_0x7044('0x11'),_0x3d452a,_0x3e137b['error'][_0x7044('0x12')]);return _0x260e25(_0x3e137b[_0x7044('0xf')][_0x7044('0x12')]);}else{logger[_0x7044('0xa')](_0x7044('0x11'),_0x3d452a,_0x7044('0xd'));_0x260e25(_0x3e137b[_0x7044('0x13')][_0x7044('0x12')]);}})[_0x7044('0x14')](function(_0x312d58){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3d452a,_0x312d58);_0x2ea097(_0x312d58);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index cc38e6c..8551eb7 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 _0xe758=['/describe','/:id','show','/:id/questions','getQuestions','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xe758,0x15f));var _0x8e75=function(_0x11e09c,_0x2e157d){_0x11e09c=_0x11e09c-0x0;var _0x4b67a7=_0xe758[_0x11e09c];return _0x4b67a7;};'use strict';var multer=require(_0x8e75('0x0'));var util=require('util');var path=require(_0x8e75('0x1'));var timeout=require(_0x8e75('0x2'));var express=require('express');var router=express[_0x8e75('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8e75('0x4'));var config=require(_0x8e75('0x5'));var controller=require(_0x8e75('0x6'));router[_0x8e75('0x7')]('/',auth[_0x8e75('0x8')](),controller['index']);router[_0x8e75('0x7')](_0x8e75('0x9'),auth[_0x8e75('0x8')](),controller['describe']);router['get'](_0x8e75('0xa'),auth[_0x8e75('0x8')](),controller[_0x8e75('0xb')]);router[_0x8e75('0x7')](_0x8e75('0xc'),auth[_0x8e75('0x8')](),controller[_0x8e75('0xd')]);router['post']('/',auth[_0x8e75('0x8')](),controller['create']);router[_0x8e75('0xe')](_0x8e75('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8e75('0xf')]('/:id',auth[_0x8e75('0x8')](),controller[_0x8e75('0x10')]);module[_0x8e75('0x11')]=router; \ No newline at end of file +var _0xc990=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getQuestions','post','put','update','delete','destroy','exports','multer','util'];(function(_0x149af9,_0x32039){var _0xd98f10=function(_0x58fab0){while(--_0x58fab0){_0x149af9['push'](_0x149af9['shift']());}};_0xd98f10(++_0x32039);}(_0xc990,0xa6));var _0x0c99=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc990[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x0c99('0x0'));var util=require(_0x0c99('0x1'));var path=require(_0x0c99('0x2'));var timeout=require(_0x0c99('0x3'));var express=require(_0x0c99('0x4'));var router=express[_0x0c99('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0c99('0x6'));var config=require(_0x0c99('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x0c99('0x8')]('/',auth[_0x0c99('0x9')](),controller['index']);router[_0x0c99('0x8')](_0x0c99('0xa'),auth[_0x0c99('0x9')](),controller[_0x0c99('0xb')]);router[_0x0c99('0x8')](_0x0c99('0xc'),auth[_0x0c99('0x9')](),controller[_0x0c99('0xd')]);router['get']('/:id/questions',auth[_0x0c99('0x9')](),controller[_0x0c99('0xe')]);router[_0x0c99('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c99('0x10')]('/:id',auth[_0x0c99('0x9')](),controller[_0x0c99('0x11')]);router[_0x0c99('0x12')]('/:id',auth[_0x0c99('0x9')](),controller[_0x0c99('0x13')]);module[_0x0c99('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 712b75d..12afa98 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 _0x5d9f=['DATE','starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5d9f,0x15c));var _0xf5d9=function(_0x11fd6b,_0x1dadd4){_0x11fd6b=_0x11fd6b-0x0;var _0x4869d4=_0x5d9f[_0x11fd6b];return _0x4869d4;};'use strict';var moment=require(_0xf5d9('0x0'));var Sequelize=require(_0xf5d9('0x1'));module[_0xf5d9('0x2')]={'starttime':{'type':Sequelize[_0xf5d9('0x3')],'set':function(_0x120b14){this['setDataValue'](_0xf5d9('0x4'),_0x120b14);this[_0xf5d9('0x5')]('endtime',moment()[_0xf5d9('0x6')](_0xf5d9('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xf5d9('0x8')]},'projectname':{'type':Sequelize[_0xf5d9('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf5d9('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf5d9('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x25e1=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime','endtime'];(function(_0x1d25fc,_0x46a8d5){var _0x382dd8=function(_0x1bdb16){while(--_0x1bdb16){_0x1d25fc['push'](_0x1d25fc['shift']());}};_0x382dd8(++_0x46a8d5);}(_0x25e1,0x1d0));var _0x125e=function(_0x7e7272,_0x3acdeb){_0x7e7272=_0x7e7272-0x0;var _0x46aaab=_0x25e1[_0x7e7272];return _0x46aaab;};'use strict';var moment=require(_0x125e('0x0'));var Sequelize=require('sequelize');module[_0x125e('0x1')]={'starttime':{'type':Sequelize[_0x125e('0x2')],'set':function(_0x875a4c){this[_0x125e('0x3')](_0x125e('0x4'),_0x875a4c);this[_0x125e('0x3')](_0x125e('0x5'),moment()[_0x125e('0x6')](_0x125e('0x7')));}},'endtime':{'type':Sequelize[_0x125e('0x2')]},'membername':{'type':Sequelize[_0x125e('0x8')]},'projectname':{'type':Sequelize[_0x125e('0x8')]},'queue':{'type':Sequelize[_0x125e('0x8')]},'uniqueid':{'type':Sequelize[_0x125e('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x125e('0x8')]},'completed':{'type':Sequelize[_0x125e('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 7afb639..0520166 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 _0x16a8=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe','getQuestions','order','pick','SessionId','map','JscriptyQuestionReport','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','destroy','error','name','index','JscriptySessionReport','rawAttributes','model'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x16a8,0xb4));var _0x816a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x16a8[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x816a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x816a('0x1'));var zipdir=require(_0x816a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x816a('0x3'));var BPromise=require(_0x816a('0x4'));var Mustache=require(_0x816a('0x5'));var util=require(_0x816a('0x6'));var path=require(_0x816a('0x7'));var sox=require(_0x816a('0x8'));var csv=require(_0x816a('0x9'));var ejs=require(_0x816a('0xa'));var fs=require('fs');var _=require(_0x816a('0xb'));var squel=require('squel');var crypto=require(_0x816a('0xc'));var jsforce=require(_0x816a('0xd'));var deskjs=require(_0x816a('0xe'));var toCsv=require(_0x816a('0x9'));var querystring=require(_0x816a('0xf'));var Papa=require(_0x816a('0x10'));var Redis=require(_0x816a('0x11'));var authService=require(_0x816a('0x12'));var qs=require(_0x816a('0x13'));var hardwareService=require(_0x816a('0x14'));var logger=require(_0x816a('0x15'))('api');var utils=require(_0x816a('0x16'));var config=require(_0x816a('0x17'));var db=require(_0x816a('0x18'))['db'];function respondWithStatusCode(_0x23bed9,_0x4f9d77){_0x4f9d77=_0x4f9d77||0xcc;return function(_0x4d4427){if(_0x4d4427){return _0x23bed9[_0x816a('0x19')](_0x4f9d77);}return _0x23bed9[_0x816a('0x1a')](_0x4f9d77)[_0x816a('0x1b')]();};}function respondWithResult(_0x3c8ff9,_0x41ee79){_0x41ee79=_0x41ee79||0xc8;return function(_0x3e3829){if(_0x3e3829){return _0x3c8ff9[_0x816a('0x1a')](_0x41ee79)[_0x816a('0x1c')](_0x3e3829);}};}function respondWithFilteredResult(_0x540dd1,_0x1bf38a){return function(_0x4e9d5e){if(_0x4e9d5e){var _0x3ce19d=_0x4e9d5e[_0x816a('0x1d')],_0x3d668a=_0x1bf38a[_0x816a('0x1e')],_0x106d28=_0x1bf38a[_0x816a('0x1e')]+_0x1bf38a['limit'],_0x4c03dd;if(_0x106d28>=_0x3ce19d){_0x106d28=_0x3ce19d;_0x4c03dd=0xc8;}else{_0x4c03dd=0xce;}_0x540dd1[_0x816a('0x1a')](_0x4c03dd);return _0x540dd1['set'](_0x816a('0x1f'),_0x3d668a+'-'+_0x106d28+'/'+_0x3ce19d)['json'](_0x4e9d5e);}return null;};}function patchUpdates(_0xa8db15){return function(_0x20c03f){try{jsonpatch['apply'](_0x20c03f,_0xa8db15,!![]);}catch(_0x3c8b09){return BPromise['reject'](_0x3c8b09);}return _0x20c03f[_0x816a('0x20')]();};}function saveUpdates(_0xfd3273,_0x3f2796){return function(_0x339be6){if(_0x339be6){return _0x339be6[_0x816a('0x21')](_0xfd3273)[_0x816a('0x22')](function(_0x2f5ec0){return _0x2f5ec0;});}return null;};}function removeEntity(_0x439594,_0x4af9d8){return function(_0xd5051f){if(_0xd5051f){return _0xd5051f[_0x816a('0x23')]()[_0x816a('0x22')](function(){_0x439594['status'](0xcc)[_0x816a('0x1b')]();});}};}function handleEntityNotFound(_0xb053ab,_0x5ac945){return function(_0x4108bf){if(!_0x4108bf){_0xb053ab[_0x816a('0x19')](0x194);}return _0x4108bf;};}function handleError(_0x406a34,_0x53b718){_0x53b718=_0x53b718||0x1f4;return function(_0x55281f){logger[_0x816a('0x24')](_0x55281f['stack']);if(_0x55281f[_0x816a('0x25')]){delete _0x55281f[_0x816a('0x25')];}_0x406a34[_0x816a('0x1a')](_0x53b718)['send'](_0x55281f);};}exports[_0x816a('0x26')]=function(_0x1bf75d,_0x482d17){var _0x242756={},_0x23e375={},_0x53c656={'count':0x0,'rows':[]};var _0x21d286=db[_0x816a('0x27')][_0x816a('0x28')];_0x23e375[_0x816a('0x29')]=_[_0x816a('0x2a')](_0x21d286);_0x23e375[_0x816a('0x2b')]=_['keys'](_0x1bf75d[_0x816a('0x2b')]);_0x23e375[_0x816a('0x2c')]=_['intersection'](_0x23e375[_0x816a('0x29')],_0x23e375[_0x816a('0x2b')]);_0x242756['attributes']=_[_0x816a('0x2d')](_0x23e375[_0x816a('0x29')],qs[_0x816a('0x2e')](_0x1bf75d[_0x816a('0x2b')][_0x816a('0x2e')]));_0x242756[_0x816a('0x2f')]=_0x242756[_0x816a('0x2f')][_0x816a('0x30')]?_0x242756[_0x816a('0x2f')]:_0x23e375[_0x816a('0x29')];if(!_0x1bf75d[_0x816a('0x2b')][_0x816a('0x31')](_0x816a('0x32'))){_0x242756[_0x816a('0x33')]=qs[_0x816a('0x33')](_0x1bf75d[_0x816a('0x2b')][_0x816a('0x33')]);_0x242756['offset']=qs[_0x816a('0x1e')](_0x1bf75d[_0x816a('0x2b')][_0x816a('0x1e')]);}_0x242756['order']=qs[_0x816a('0x34')](_0x1bf75d[_0x816a('0x2b')][_0x816a('0x34')]);_0x242756['where']=qs[_0x816a('0x2c')](_['pick'](_0x1bf75d[_0x816a('0x2b')],_0x23e375[_0x816a('0x2c')]));if(_0x1bf75d[_0x816a('0x2b')]['filter']){_0x242756['where']=_['merge'](_0x242756[_0x816a('0x35')],{'$or':_['map'](_0x21d286,function(_0x58b8d0){if(_0x58b8d0['type']['key']!==_0x816a('0x36')){var _0x5d99e4={};_0x5d99e4[_0x58b8d0['field']]={'$like':'%'+_0x1bf75d[_0x816a('0x2b')][_0x816a('0x37')]+'%'};return _0x5d99e4;}})});}_0x242756=_[_0x816a('0x38')]({},_0x242756,_0x1bf75d[_0x816a('0x39')]);var _0x202b66={'where':_0x242756[_0x816a('0x35')]};return db['JscriptySessionReport'][_0x816a('0x1d')](_0x202b66)['then'](function(_0x270801){_0x53c656['count']=_0x270801;if(_0x1bf75d['query'][_0x816a('0x3a')]){_0x242756['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x816a('0x3b')](_0x242756);})[_0x816a('0x22')](function(_0x5c60a9){_0x53c656[_0x816a('0x3c')]=_0x5c60a9;return _0x53c656;})[_0x816a('0x22')](respondWithFilteredResult(_0x482d17,_0x242756))[_0x816a('0x3d')](handleError(_0x482d17,null));};exports[_0x816a('0x3e')]=function(_0x20227f,_0x5156e2){var _0x4aafbb={'raw':!![],'where':{'id':_0x20227f[_0x816a('0x3f')]['id']}},_0x31d496={};_0x31d496['model']=_[_0x816a('0x2a')](db[_0x816a('0x27')]['rawAttributes']);_0x31d496[_0x816a('0x2b')]=_[_0x816a('0x2a')](_0x20227f[_0x816a('0x2b')]);_0x31d496[_0x816a('0x2c')]=_[_0x816a('0x2d')](_0x31d496[_0x816a('0x29')],_0x31d496[_0x816a('0x2b')]);_0x4aafbb[_0x816a('0x2f')]=_[_0x816a('0x2d')](_0x31d496[_0x816a('0x29')],qs['fields'](_0x20227f['query'][_0x816a('0x2e')]));_0x4aafbb[_0x816a('0x2f')]=_0x4aafbb['attributes'][_0x816a('0x30')]?_0x4aafbb[_0x816a('0x2f')]:_0x31d496[_0x816a('0x29')];if(_0x20227f['query'][_0x816a('0x3a')]){_0x4aafbb[_0x816a('0x40')]=[{'all':!![]}];}_0x4aafbb=_['merge']({},_0x4aafbb,_0x20227f[_0x816a('0x39')]);return db[_0x816a('0x27')][_0x816a('0x41')](_0x4aafbb)[_0x816a('0x22')](handleEntityNotFound(_0x5156e2,null))[_0x816a('0x22')](respondWithResult(_0x5156e2,null))[_0x816a('0x3d')](handleError(_0x5156e2,null));};exports['create']=function(_0x47e575,_0xc9906d){return db[_0x816a('0x27')]['create'](_0x47e575[_0x816a('0x42')],{})[_0x816a('0x22')](respondWithResult(_0xc9906d,0xc9))['catch'](handleError(_0xc9906d,null));};exports[_0x816a('0x21')]=function(_0x1fdda7,_0x4b01c8){if(_0x1fdda7['body']['id']){delete _0x1fdda7[_0x816a('0x42')]['id'];}return db[_0x816a('0x27')]['find']({'where':{'id':_0x1fdda7[_0x816a('0x3f')]['id']}})[_0x816a('0x22')](handleEntityNotFound(_0x4b01c8,null))['then'](saveUpdates(_0x1fdda7[_0x816a('0x42')],null))[_0x816a('0x22')](respondWithResult(_0x4b01c8,null))[_0x816a('0x3d')](handleError(_0x4b01c8,null));};exports[_0x816a('0x23')]=function(_0xc35abb,_0x59bbd0){return db['JscriptySessionReport'][_0x816a('0x41')]({'where':{'id':_0xc35abb[_0x816a('0x3f')]['id']}})[_0x816a('0x22')](handleEntityNotFound(_0x59bbd0,null))['then'](removeEntity(_0x59bbd0,null))[_0x816a('0x3d')](handleError(_0x59bbd0,null));};exports['describe']=function(_0x5e539f,_0x464b30){return db[_0x816a('0x27')][_0x816a('0x43')]()[_0x816a('0x22')](respondWithResult(_0x464b30,null))[_0x816a('0x3d')](handleError(_0x464b30,null));};exports[_0x816a('0x44')]=function(_0x27f900,_0x4c7b97,_0x3260fb){var _0x13d683={'raw':!![],'where':{}};var _0x2d8262={};var _0x531b05={'count':0x0,'rows':[]};return db[_0x816a('0x27')]['findOne']({'where':{'id':_0x27f900[_0x816a('0x3f')]['id']}})[_0x816a('0x22')](handleEntityNotFound(_0x4c7b97,null))[_0x816a('0x22')](function(_0x434746){if(_0x434746){_0x2d8262[_0x816a('0x29')]=_[_0x816a('0x2a')](db['JscriptyQuestionReport']['rawAttributes']);_0x2d8262[_0x816a('0x2b')]=_['keys'](_0x27f900[_0x816a('0x2b')]);_0x2d8262[_0x816a('0x2c')]=_[_0x816a('0x2d')](_0x2d8262[_0x816a('0x29')],_0x2d8262[_0x816a('0x2b')]);_0x13d683[_0x816a('0x2f')]=_[_0x816a('0x2d')](_0x2d8262[_0x816a('0x29')],qs['fields'](_0x27f900[_0x816a('0x2b')]['fields']));_0x13d683[_0x816a('0x2f')]=_0x13d683[_0x816a('0x2f')]['length']?_0x13d683[_0x816a('0x2f')]:_0x2d8262[_0x816a('0x29')];if(!_0x27f900['query']['hasOwnProperty']('nolimit')){_0x13d683['limit']=qs[_0x816a('0x33')](_0x27f900[_0x816a('0x2b')]['limit']);_0x13d683[_0x816a('0x1e')]=qs[_0x816a('0x1e')](_0x27f900[_0x816a('0x2b')]['offset']);}_0x13d683[_0x816a('0x45')]=qs[_0x816a('0x34')](_0x27f900['query'][_0x816a('0x34')]);_0x13d683['where']=qs[_0x816a('0x2c')](_[_0x816a('0x46')](_0x27f900['query'],_0x2d8262['filters']));_0x13d683[_0x816a('0x35')][_0x816a('0x47')]=_0x434746['id'];if(_0x27f900[_0x816a('0x2b')][_0x816a('0x37')]){_0x13d683[_0x816a('0x35')]=_['merge'](_0x13d683[_0x816a('0x35')],{'$or':_[_0x816a('0x48')](_0x13d683[_0x816a('0x2f')],function(_0x2fdfc7){var _0x6a5cb2={};_0x6a5cb2[_0x2fdfc7]={'$like':'%'+_0x27f900['query'][_0x816a('0x37')]+'%'};return _0x6a5cb2;})});}_0x13d683=_['merge']({},_0x13d683,_0x27f900[_0x816a('0x39')]);return db[_0x816a('0x49')]['count']({'where':_0x13d683[_0x816a('0x35')]})[_0x816a('0x22')](function(_0x5d03d0){_0x531b05[_0x816a('0x1d')]=_0x5d03d0;if(_0x27f900[_0x816a('0x2b')][_0x816a('0x3a')]){_0x13d683[_0x816a('0x40')]=[{'all':!![]}];}return db[_0x816a('0x49')]['findAll'](_0x13d683);})[_0x816a('0x22')](function(_0x4065dc){_0x531b05[_0x816a('0x3c')]=_0x4065dc;return _0x531b05;});}})[_0x816a('0x22')](respondWithFilteredResult(_0x4c7b97,_0x13d683))[_0x816a('0x3d')](handleError(_0x4c7b97,null));}; \ No newline at end of file +var _0x105f=['error','name','index','JscriptySessionReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','rows','catch','show','params','rawAttributes','create','update','find','body','describe','findOne','JscriptyQuestionReport','order','SessionId','map','findAll','eml-format','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','Content-Range','apply','reject','save','then','destroy','sendStatus'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x105f,0x71));var _0xf105=function(_0x3c90da,_0x104f0e){_0x3c90da=_0x3c90da-0x0;var _0x3f4b28=_0x105f[_0x3c90da];return _0x3f4b28;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf105('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf105('0x1'));var moment=require('moment');var BPromise=require(_0xf105('0x2'));var Mustache=require(_0xf105('0x3'));var util=require(_0xf105('0x4'));var path=require(_0xf105('0x5'));var sox=require('sox');var csv=require(_0xf105('0x6'));var ejs=require(_0xf105('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf105('0x8'));var crypto=require('crypto');var jsforce=require(_0xf105('0x9'));var deskjs=require(_0xf105('0xa'));var toCsv=require(_0xf105('0x6'));var querystring=require(_0xf105('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf105('0xc'));var logger=require(_0xf105('0xd'))('api');var utils=require(_0xf105('0xe'));var config=require(_0xf105('0xf'));var db=require(_0xf105('0x10'))['db'];function respondWithStatusCode(_0x2b72b1,_0x27a45d){_0x27a45d=_0x27a45d||0xcc;return function(_0x33d886){if(_0x33d886){return _0x2b72b1['sendStatus'](_0x27a45d);}return _0x2b72b1[_0xf105('0x11')](_0x27a45d)['end']();};}function respondWithResult(_0x33df6d,_0xb8cdd0){_0xb8cdd0=_0xb8cdd0||0xc8;return function(_0x36e59e){if(_0x36e59e){return _0x33df6d['status'](_0xb8cdd0)[_0xf105('0x12')](_0x36e59e);}};}function respondWithFilteredResult(_0x52812c,_0x59f99b){return function(_0x1160eb){if(_0x1160eb){var _0x443095=_0x1160eb['count'],_0x24dd40=_0x59f99b[_0xf105('0x13')],_0x27886c=_0x59f99b['offset']+_0x59f99b['limit'],_0x468643;if(_0x27886c>=_0x443095){_0x27886c=_0x443095;_0x468643=0xc8;}else{_0x468643=0xce;}_0x52812c[_0xf105('0x11')](_0x468643);return _0x52812c['set'](_0xf105('0x14'),_0x24dd40+'-'+_0x27886c+'/'+_0x443095)['json'](_0x1160eb);}return null;};}function patchUpdates(_0x2f45f1){return function(_0x3e1c5f){try{jsonpatch[_0xf105('0x15')](_0x3e1c5f,_0x2f45f1,!![]);}catch(_0xe07a35){return BPromise[_0xf105('0x16')](_0xe07a35);}return _0x3e1c5f[_0xf105('0x17')]();};}function saveUpdates(_0x2a673b,_0x403ab7){return function(_0x5c3c14){if(_0x5c3c14){return _0x5c3c14['update'](_0x2a673b)[_0xf105('0x18')](function(_0x1d6ea3){return _0x1d6ea3;});}return null;};}function removeEntity(_0xde799f,_0x9ea013){return function(_0x156860){if(_0x156860){return _0x156860[_0xf105('0x19')]()[_0xf105('0x18')](function(){_0xde799f[_0xf105('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x979041,_0x308303){return function(_0x3a1c2e){if(!_0x3a1c2e){_0x979041[_0xf105('0x1a')](0x194);}return _0x3a1c2e;};}function handleError(_0x3acb8c,_0x44fc14){_0x44fc14=_0x44fc14||0x1f4;return function(_0x20dfad){logger[_0xf105('0x1b')](_0x20dfad['stack']);if(_0x20dfad[_0xf105('0x1c')]){delete _0x20dfad['name'];}_0x3acb8c[_0xf105('0x11')](_0x44fc14)['send'](_0x20dfad);};}exports[_0xf105('0x1d')]=function(_0x1a56ea,_0x70667c){var _0x2b8f4e={},_0x31528e={},_0x1c8ff9={'count':0x0,'rows':[]};var _0x5a3b0e=db[_0xf105('0x1e')]['rawAttributes'];_0x31528e[_0xf105('0x1f')]=_[_0xf105('0x20')](_0x5a3b0e);_0x31528e[_0xf105('0x21')]=_[_0xf105('0x20')](_0x1a56ea[_0xf105('0x21')]);_0x31528e[_0xf105('0x22')]=_[_0xf105('0x23')](_0x31528e[_0xf105('0x1f')],_0x31528e[_0xf105('0x21')]);_0x2b8f4e[_0xf105('0x24')]=_['intersection'](_0x31528e['model'],qs[_0xf105('0x25')](_0x1a56ea[_0xf105('0x21')]['fields']));_0x2b8f4e['attributes']=_0x2b8f4e[_0xf105('0x24')][_0xf105('0x26')]?_0x2b8f4e[_0xf105('0x24')]:_0x31528e['model'];if(!_0x1a56ea[_0xf105('0x21')][_0xf105('0x27')](_0xf105('0x28'))){_0x2b8f4e[_0xf105('0x29')]=qs[_0xf105('0x29')](_0x1a56ea[_0xf105('0x21')][_0xf105('0x29')]);_0x2b8f4e['offset']=qs[_0xf105('0x13')](_0x1a56ea['query'][_0xf105('0x13')]);}_0x2b8f4e['order']=qs[_0xf105('0x2a')](_0x1a56ea['query'][_0xf105('0x2a')]);_0x2b8f4e[_0xf105('0x2b')]=qs[_0xf105('0x22')](_[_0xf105('0x2c')](_0x1a56ea['query'],_0x31528e[_0xf105('0x22')]));if(_0x1a56ea['query'][_0xf105('0x2d')]){_0x2b8f4e['where']=_[_0xf105('0x2e')](_0x2b8f4e[_0xf105('0x2b')],{'$or':_['map'](_0x5a3b0e,function(_0x244c8e){if(_0x244c8e[_0xf105('0x2f')][_0xf105('0x30')]!==_0xf105('0x31')){var _0x17b61c={};_0x17b61c[_0x244c8e[_0xf105('0x32')]]={'$like':'%'+_0x1a56ea[_0xf105('0x21')][_0xf105('0x2d')]+'%'};return _0x17b61c;}})});}_0x2b8f4e=_[_0xf105('0x2e')]({},_0x2b8f4e,_0x1a56ea[_0xf105('0x33')]);var _0x19d68c={'where':_0x2b8f4e[_0xf105('0x2b')]};return db[_0xf105('0x1e')][_0xf105('0x34')](_0x19d68c)[_0xf105('0x18')](function(_0xab14ed){_0x1c8ff9['count']=_0xab14ed;if(_0x1a56ea[_0xf105('0x21')]['includeAll']){_0x2b8f4e[_0xf105('0x35')]=[{'all':!![]}];}return db[_0xf105('0x1e')]['findAll'](_0x2b8f4e);})[_0xf105('0x18')](function(_0x1cdde2){_0x1c8ff9[_0xf105('0x36')]=_0x1cdde2;return _0x1c8ff9;})[_0xf105('0x18')](respondWithFilteredResult(_0x70667c,_0x2b8f4e))[_0xf105('0x37')](handleError(_0x70667c,null));};exports[_0xf105('0x38')]=function(_0x5dde5b,_0x19dee1){var _0x1346af={'raw':!![],'where':{'id':_0x5dde5b[_0xf105('0x39')]['id']}},_0x1a5f5d={};_0x1a5f5d['model']=_['keys'](db[_0xf105('0x1e')][_0xf105('0x3a')]);_0x1a5f5d[_0xf105('0x21')]=_[_0xf105('0x20')](_0x5dde5b[_0xf105('0x21')]);_0x1a5f5d[_0xf105('0x22')]=_['intersection'](_0x1a5f5d[_0xf105('0x1f')],_0x1a5f5d[_0xf105('0x21')]);_0x1346af[_0xf105('0x24')]=_[_0xf105('0x23')](_0x1a5f5d['model'],qs['fields'](_0x5dde5b[_0xf105('0x21')][_0xf105('0x25')]));_0x1346af[_0xf105('0x24')]=_0x1346af[_0xf105('0x24')][_0xf105('0x26')]?_0x1346af[_0xf105('0x24')]:_0x1a5f5d['model'];if(_0x5dde5b['query']['includeAll']){_0x1346af[_0xf105('0x35')]=[{'all':!![]}];}_0x1346af=_[_0xf105('0x2e')]({},_0x1346af,_0x5dde5b[_0xf105('0x33')]);return db[_0xf105('0x1e')]['find'](_0x1346af)[_0xf105('0x18')](handleEntityNotFound(_0x19dee1,null))[_0xf105('0x18')](respondWithResult(_0x19dee1,null))[_0xf105('0x37')](handleError(_0x19dee1,null));};exports[_0xf105('0x3b')]=function(_0x4f2039,_0x1c640b){return db[_0xf105('0x1e')][_0xf105('0x3b')](_0x4f2039['body'],{})[_0xf105('0x18')](respondWithResult(_0x1c640b,0xc9))[_0xf105('0x37')](handleError(_0x1c640b,null));};exports[_0xf105('0x3c')]=function(_0x5d65e9,_0x3feffd){if(_0x5d65e9['body']['id']){delete _0x5d65e9['body']['id'];}return db[_0xf105('0x1e')][_0xf105('0x3d')]({'where':{'id':_0x5d65e9[_0xf105('0x39')]['id']}})['then'](handleEntityNotFound(_0x3feffd,null))[_0xf105('0x18')](saveUpdates(_0x5d65e9[_0xf105('0x3e')],null))[_0xf105('0x18')](respondWithResult(_0x3feffd,null))['catch'](handleError(_0x3feffd,null));};exports['destroy']=function(_0x4b6ec9,_0x25eaf4){return db[_0xf105('0x1e')][_0xf105('0x3d')]({'where':{'id':_0x4b6ec9[_0xf105('0x39')]['id']}})[_0xf105('0x18')](handleEntityNotFound(_0x25eaf4,null))[_0xf105('0x18')](removeEntity(_0x25eaf4,null))[_0xf105('0x37')](handleError(_0x25eaf4,null));};exports['describe']=function(_0x5b3348,_0x3096e){return db['JscriptySessionReport'][_0xf105('0x3f')]()[_0xf105('0x18')](respondWithResult(_0x3096e,null))[_0xf105('0x37')](handleError(_0x3096e,null));};exports['getQuestions']=function(_0x408b91,_0xf8b7aa,_0x144202){var _0x187e43={'raw':!![],'where':{}};var _0x82de07={};var _0xc5332a={'count':0x0,'rows':[]};return db[_0xf105('0x1e')][_0xf105('0x40')]({'where':{'id':_0x408b91[_0xf105('0x39')]['id']}})[_0xf105('0x18')](handleEntityNotFound(_0xf8b7aa,null))[_0xf105('0x18')](function(_0x2f0081){if(_0x2f0081){_0x82de07[_0xf105('0x1f')]=_[_0xf105('0x20')](db[_0xf105('0x41')]['rawAttributes']);_0x82de07[_0xf105('0x21')]=_[_0xf105('0x20')](_0x408b91[_0xf105('0x21')]);_0x82de07[_0xf105('0x22')]=_[_0xf105('0x23')](_0x82de07[_0xf105('0x1f')],_0x82de07[_0xf105('0x21')]);_0x187e43['attributes']=_[_0xf105('0x23')](_0x82de07[_0xf105('0x1f')],qs['fields'](_0x408b91[_0xf105('0x21')][_0xf105('0x25')]));_0x187e43[_0xf105('0x24')]=_0x187e43[_0xf105('0x24')]['length']?_0x187e43[_0xf105('0x24')]:_0x82de07[_0xf105('0x1f')];if(!_0x408b91[_0xf105('0x21')][_0xf105('0x27')]('nolimit')){_0x187e43['limit']=qs[_0xf105('0x29')](_0x408b91[_0xf105('0x21')]['limit']);_0x187e43['offset']=qs['offset'](_0x408b91[_0xf105('0x21')][_0xf105('0x13')]);}_0x187e43[_0xf105('0x42')]=qs[_0xf105('0x2a')](_0x408b91[_0xf105('0x21')][_0xf105('0x2a')]);_0x187e43[_0xf105('0x2b')]=qs['filters'](_[_0xf105('0x2c')](_0x408b91['query'],_0x82de07[_0xf105('0x22')]));_0x187e43['where'][_0xf105('0x43')]=_0x2f0081['id'];if(_0x408b91[_0xf105('0x21')][_0xf105('0x2d')]){_0x187e43[_0xf105('0x2b')]=_['merge'](_0x187e43[_0xf105('0x2b')],{'$or':_[_0xf105('0x44')](_0x187e43[_0xf105('0x24')],function(_0x42cf71){var _0x223c3f={};_0x223c3f[_0x42cf71]={'$like':'%'+_0x408b91[_0xf105('0x21')][_0xf105('0x2d')]+'%'};return _0x223c3f;})});}_0x187e43=_[_0xf105('0x2e')]({},_0x187e43,_0x408b91[_0xf105('0x33')]);return db[_0xf105('0x41')][_0xf105('0x34')]({'where':_0x187e43[_0xf105('0x2b')]})[_0xf105('0x18')](function(_0x30e51a){_0xc5332a[_0xf105('0x34')]=_0x30e51a;if(_0x408b91['query']['includeAll']){_0x187e43[_0xf105('0x35')]=[{'all':!![]}];}return db[_0xf105('0x41')][_0xf105('0x45')](_0x187e43);})[_0xf105('0x18')](function(_0x40d402){_0xc5332a[_0xf105('0x36')]=_0x40d402;return _0xc5332a;});}})[_0xf105('0x18')](respondWithFilteredResult(_0xf8b7aa,_0x187e43))['catch'](handleError(_0xf8b7aa,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d63bc9a..3518546 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 _0xfa64=['rimraf','../../config/environment','./jscriptySessionReport.attributes','JscriptySessionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x550062,_0x231bba){var _0x5488e8=function(_0x585140){while(--_0x585140){_0x550062['push'](_0x550062['shift']());}};_0x5488e8(++_0x231bba);}(_0xfa64,0xa9));var _0x4fa6=function(_0x21c6d7,_0x4598fd){_0x21c6d7=_0x21c6d7-0x0;var _0x3ff27a=_0xfa64[_0x21c6d7];return _0x3ff27a;};'use strict';var _=require(_0x4fa6('0x0'));var util=require(_0x4fa6('0x1'));var logger=require(_0x4fa6('0x2'))(_0x4fa6('0x3'));var moment=require(_0x4fa6('0x4'));var BPromise=require(_0x4fa6('0x5'));var rp=require(_0x4fa6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fa6('0x7'));var config=require(_0x4fa6('0x8'));var attributes=require(_0x4fa6('0x9'));module['exports']=function(_0x3092ec,_0xc9cfa9){return _0x3092ec['define'](_0x4fa6('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ed6=['moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x5ed6,0x15b));var _0x65ed=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0x5ed6[_0x1a8bbc];return _0x212fc2;};'use strict';var _=require(_0x65ed('0x0'));var util=require(_0x65ed('0x1'));var logger=require(_0x65ed('0x2'))(_0x65ed('0x3'));var moment=require(_0x65ed('0x4'));var BPromise=require(_0x65ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65ed('0x6'));var rimraf=require(_0x65ed('0x7'));var config=require(_0x65ed('0x8'));var attributes=require(_0x65ed('0x9'));module[_0x65ed('0xa')]=function(_0x4dfc08,_0x432b0b){return _0x4dfc08[_0x65ed('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x65ed('0xc'),'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 d730836..e7cfa3f 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 _0x44ff=['client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../config/logger','rpc'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x44ff,0x1c3));var _0xf44f=function(_0x3b89d5,_0x3ce186){_0x3b89d5=_0x3b89d5-0x0;var _0x5192e1=_0x44ff[_0x3b89d5];return _0x5192e1;};'use strict';var _=require('lodash');var util=require(_0xf44f('0x0'));var moment=require(_0xf44f('0x1'));var BPromise=require(_0xf44f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf44f('0x3'))(_0xf44f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf44f('0x5')][_0xf44f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x24baf4,_0x536b0e,_0x1aa3e5){return new BPromise(function(_0x2dae46,_0x1a1b8a){return client['request'](_0x24baf4,_0x1aa3e5)[_0xf44f('0x7')](function(_0x1f12d7){logger[_0xf44f('0x8')](_0xf44f('0x9'),_0x536b0e,_0xf44f('0xa'));logger[_0xf44f('0xb')](_0xf44f('0xc'),_0x536b0e,_0xf44f('0xa'),JSON[_0xf44f('0xd')](_0x1f12d7));if(_0x1f12d7[_0xf44f('0xe')]){if(_0x1f12d7['error'][_0xf44f('0xf')]===0x1f4){logger[_0xf44f('0xe')](_0xf44f('0x9'),_0x536b0e,_0x1f12d7[_0xf44f('0xe')][_0xf44f('0x10')]);return _0x1a1b8a(_0x1f12d7[_0xf44f('0xe')][_0xf44f('0x10')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x536b0e,_0x1f12d7[_0xf44f('0xe')]['message']);return _0x2dae46(_0x1f12d7['error']['message']);}else{logger[_0xf44f('0x8')](_0xf44f('0x9'),_0x536b0e,_0xf44f('0xa'));_0x2dae46(_0x1f12d7[_0xf44f('0x11')]['message']);}})[_0xf44f('0x12')](function(_0x56b1ca){logger[_0xf44f('0xe')](_0xf44f('0x9'),_0x536b0e,_0x56b1ca);_0x1a1b8a(_0x56b1ca);});});} \ No newline at end of file +var _0x91c6=['request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xdb5884,_0x470c4d){var _0x55c158=function(_0x432a7a){while(--_0x432a7a){_0xdb5884['push'](_0xdb5884['shift']());}};_0x55c158(++_0x470c4d);}(_0x91c6,0xf9));var _0x691c=function(_0x234ca6,_0x2abc8f){_0x234ca6=_0x234ca6-0x0;var _0x43ad06=_0x91c6[_0x234ca6];return _0x43ad06;};'use strict';var _=require(_0x691c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x691c('0x1'));var rs=require(_0x691c('0x2'));var fs=require('fs');var Redis=require(_0x691c('0x3'));var db=require(_0x691c('0x4'))['db'];var utils=require(_0x691c('0x5'));var logger=require('../../config/logger')(_0x691c('0x6'));var config=require(_0x691c('0x7'));var jayson=require(_0x691c('0x8'));var client=jayson[_0x691c('0x9')][_0x691c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29876a,_0x5ccbe0,_0x93b7b0){return new BPromise(function(_0x40629a,_0xda904f){return client[_0x691c('0xb')](_0x29876a,_0x93b7b0)['then'](function(_0x2cfa1f){logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5ccbe0,_0x691c('0xe'),JSON[_0x691c('0xf')](_0x2cfa1f));if(_0x2cfa1f[_0x691c('0x10')]){if(_0x2cfa1f[_0x691c('0x10')]['code']===0x1f4){logger['error'](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);return _0xda904f(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x2cfa1f[_0x691c('0x10')]['message']);return _0x40629a(_0x2cfa1f[_0x691c('0x10')][_0x691c('0x11')]);}else{logger[_0x691c('0xc')](_0x691c('0xd'),_0x5ccbe0,_0x691c('0xe'));_0x40629a(_0x2cfa1f[_0x691c('0x12')][_0x691c('0x11')]);}})[_0x691c('0x13')](function(_0x482351){logger[_0x691c('0x10')](_0x691c('0xd'),_0x5ccbe0,_0x482351);_0xda904f(_0x482351);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 2758426..c5101d9 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 _0xeb79=['/:id','isAuthenticated','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xeb79,0x7b));var _0x9eb7=function(_0x3e5f69,_0x1eb2b1){_0x3e5f69=_0x3e5f69-0x0;var _0x55df21=_0xeb79[_0x3e5f69];return _0x55df21;};'use strict';var multer=require(_0x9eb7('0x0'));var util=require(_0x9eb7('0x1'));var path=require(_0x9eb7('0x2'));var timeout=require(_0x9eb7('0x3'));var express=require(_0x9eb7('0x4'));var router=express[_0x9eb7('0x5')]();var auth=require(_0x9eb7('0x6'));var interaction=require(_0x9eb7('0x7'));var config=require(_0x9eb7('0x8'));var controller=require(_0x9eb7('0x9'));router[_0x9eb7('0xa')]('/',controller[_0x9eb7('0xb')]);router['put'](_0x9eb7('0xc'),auth[_0x9eb7('0xd')](),controller[_0x9eb7('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9fdb=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0xf93076,_0x1acb30){var _0x33d1da=function(_0x29e6bf){while(--_0x29e6bf){_0xf93076['push'](_0xf93076['shift']());}};_0x33d1da(++_0x1acb30);}(_0x9fdb,0xd3));var _0xb9fd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9fdb[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xb9fd('0x0'));var util=require(_0xb9fd('0x1'));var path=require(_0xb9fd('0x2'));var timeout=require(_0xb9fd('0x3'));var express=require('express');var router=express[_0xb9fd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9fd('0x5'));var config=require(_0xb9fd('0x6'));var controller=require('./license.controller');router[_0xb9fd('0x7')]('/',controller['index']);router['put'](_0xb9fd('0x8'),auth['isAuthenticated'](),controller['update']);module[_0xb9fd('0x9')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f71eb42..01840e3 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 _0x48e0=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x4d4c73,_0x5e11c3){var _0x36ac1b=function(_0x89c2c){while(--_0x89c2c){_0x4d4c73['push'](_0x4d4c73['shift']());}};_0x36ac1b(++_0x5e11c3);}(_0x48e0,0xb4));var _0x048e=function(_0x29c5f1,_0x4dcbe9){_0x29c5f1=_0x29c5f1-0x0;var _0x591bf7=_0x48e0[_0x29c5f1];return _0x591bf7;};'use strict';var Sequelize=require(_0x048e('0x0'));module[_0x048e('0x1')]={'license':{'type':Sequelize[_0x048e('0x2')]},'data1':{'type':Sequelize[_0x048e('0x3')]},'data2':{'type':Sequelize[_0x048e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x048e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc044=['STRING','exports','TEXT'];(function(_0x5c0bba,_0x3dd5f2){var _0x138c54=function(_0x14fb1e){while(--_0x14fb1e){_0x5c0bba['push'](_0x5c0bba['shift']());}};_0x138c54(++_0x3dd5f2);}(_0xc044,0x1f3));var _0x4c04=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc044[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x4c04('0x0')]={'license':{'type':Sequelize[_0x4c04('0x1')]},'data1':{'type':Sequelize[_0x4c04('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 c8ad24c..a6611fd 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 _0xa0a1=['fields','length','merge','getLicense','update','body','params','checkLicense','key','demo','catch','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x1cb6af,_0x46be2b){_0x1cb6af=_0x1cb6af-0x0;var _0x3b9bcd=_0xa0a1[_0x1cb6af];return _0x3b9bcd;};'use strict';var pdf=require(_0x1a0a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1a0a('0x1'));var zipdir=require(_0x1a0a('0x2'));var jsonpatch=require(_0x1a0a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1a0a('0x4'));var Mustache=require(_0x1a0a('0x5'));var util=require('util');var path=require(_0x1a0a('0x6'));var sox=require(_0x1a0a('0x7'));var csv=require('to-csv');var ejs=require(_0x1a0a('0x8'));var fs=require('fs');var _=require(_0x1a0a('0x9'));var squel=require(_0x1a0a('0xa'));var crypto=require(_0x1a0a('0xb'));var jsforce=require(_0x1a0a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1a0a('0xd'));var querystring=require(_0x1a0a('0xe'));var Papa=require(_0x1a0a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1a0a('0x10'));var logger=require(_0x1a0a('0x11'))(_0x1a0a('0x12'));var utils=require('../../config/utils');var config=require(_0x1a0a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x280df2,_0x111e90){_0x111e90=_0x111e90||0xcc;return function(_0x461b36){if(_0x461b36){return _0x280df2[_0x1a0a('0x14')](_0x111e90);}return _0x280df2[_0x1a0a('0x15')](_0x111e90)[_0x1a0a('0x16')]();};}function respondWithResult(_0x3f34d2,_0x4f2b35){_0x4f2b35=_0x4f2b35||0xc8;return function(_0x88d191){if(_0x88d191){return _0x3f34d2[_0x1a0a('0x15')](_0x4f2b35)[_0x1a0a('0x17')](_0x88d191);}};}function respondWithFilteredResult(_0x26c1df,_0xe1fd03){return function(_0x4c8080){if(_0x4c8080){var _0x16b8c9=_0x4c8080[_0x1a0a('0x18')],_0x80627b=_0xe1fd03['offset'],_0x157b74=_0xe1fd03[_0x1a0a('0x19')]+_0xe1fd03['limit'],_0x5b6d15;if(_0x157b74>=_0x16b8c9){_0x157b74=_0x16b8c9;_0x5b6d15=0xc8;}else{_0x5b6d15=0xce;}_0x26c1df['status'](_0x5b6d15);return _0x26c1df[_0x1a0a('0x1a')](_0x1a0a('0x1b'),_0x80627b+'-'+_0x157b74+'/'+_0x16b8c9)[_0x1a0a('0x17')](_0x4c8080);}return null;};}function patchUpdates(_0x2ee613){return function(_0x4d11a4){try{jsonpatch['apply'](_0x4d11a4,_0x2ee613,!![]);}catch(_0x239065){return BPromise[_0x1a0a('0x1c')](_0x239065);}return _0x4d11a4[_0x1a0a('0x1d')]();};}function saveUpdates(_0x5b2884,_0x1976ba){return function(_0x3547fe){if(_0x3547fe){return _0x3547fe['update'](_0x5b2884)[_0x1a0a('0x1e')](function(_0x1ba27f){return _0x1ba27f;});}return null;};}function removeEntity(_0x316ae3,_0x53e569){return function(_0x159a2a){if(_0x159a2a){return _0x159a2a[_0x1a0a('0x1f')]()[_0x1a0a('0x1e')](function(){_0x316ae3['status'](0xcc)[_0x1a0a('0x16')]();});}};}function handleEntityNotFound(_0x47ef88,_0x28c094){return function(_0x2d426d){if(!_0x2d426d){_0x47ef88[_0x1a0a('0x14')](0x194);}return _0x2d426d;};}function handleError(_0x29bb35,_0x35e411){_0x35e411=_0x35e411||0x1f4;return function(_0x578995){logger[_0x1a0a('0x20')](_0x578995[_0x1a0a('0x21')]);if(_0x578995['name']){delete _0x578995['name'];}_0x29bb35[_0x1a0a('0x15')](_0x35e411)[_0x1a0a('0x22')](_0x578995);};}var utilLicense=require(_0x1a0a('0x23'));exports[_0x1a0a('0x24')]=function(_0x4483a3,_0x244bbf){var _0x338e8c={'raw':!![],'where':{'id':0x1}},_0x18e676={};_0x18e676[_0x1a0a('0x25')]=_[_0x1a0a('0x26')](db[_0x1a0a('0x27')][_0x1a0a('0x28')]);_0x18e676[_0x1a0a('0x29')]=_[_0x1a0a('0x26')](_0x4483a3[_0x1a0a('0x29')]);_0x18e676[_0x1a0a('0x2a')]=_[_0x1a0a('0x2b')](_0x18e676['model'],_0x18e676[_0x1a0a('0x29')]);_0x338e8c[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x18e676[_0x1a0a('0x25')],qs[_0x1a0a('0x2d')](_0x4483a3[_0x1a0a('0x29')][_0x1a0a('0x2d')]));_0x338e8c[_0x1a0a('0x2c')]=_0x338e8c[_0x1a0a('0x2c')][_0x1a0a('0x2e')]?_0x338e8c['attributes']:_0x18e676[_0x1a0a('0x25')];_0x338e8c=_[_0x1a0a('0x2f')]({},_0x338e8c,_0x4483a3['options']);return utilLicense[_0x1a0a('0x30')](_0x338e8c)['then'](respondWithResult(_0x244bbf,null))['catch'](handleError(_0x244bbf,null));};exports[_0x1a0a('0x31')]=function(_0x38c7f3,_0x4fd7b9){if(_0x38c7f3[_0x1a0a('0x32')]['id']){delete _0x38c7f3[_0x1a0a('0x32')]['id'];}return db[_0x1a0a('0x27')]['find']({'where':{'id':_0x38c7f3[_0x1a0a('0x33')]['id']}})[_0x1a0a('0x1e')](handleEntityNotFound(_0x4fd7b9,null))['then'](function(_0x439db4){var _0x20084d=_0x439db4['get']({'plain':!![]});return utilLicense[_0x1a0a('0x34')](_0x20084d,_0x38c7f3[_0x1a0a('0x32')][_0x1a0a('0x35')]);})[_0x1a0a('0x1e')](function(_0x58f689){if(!_0x58f689[_0x1a0a('0x36')]){return saveUpdates(_0x38c7f3[_0x1a0a('0x32')],null);}return _0x58f689;})[_0x1a0a('0x1e')](respondWithResult(_0x4fd7b9,null))[_0x1a0a('0x37')](handleError(_0x4fd7b9,null));}; \ No newline at end of file +var _0x03db=['body','License','find','params','get','checkLicense','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','status','json','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','merge','getLicense','catch'];(function(_0x44f4e8,_0xf948f3){var _0xdaa23d=function(_0x2cbab4){while(--_0x2cbab4){_0x44f4e8['push'](_0x44f4e8['shift']());}};_0xdaa23d(++_0xf948f3);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xb03d('0x0'));var emlformat=require(_0xb03d('0x1'));var rimraf=require(_0xb03d('0x2'));var zipdir=require(_0xb03d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb03d('0x4'));var moment=require(_0xb03d('0x5'));var BPromise=require(_0xb03d('0x6'));var Mustache=require(_0xb03d('0x7'));var util=require(_0xb03d('0x8'));var path=require('path');var sox=require(_0xb03d('0x9'));var csv=require(_0xb03d('0xa'));var ejs=require(_0xb03d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb03d('0xc'));var crypto=require('crypto');var jsforce=require(_0xb03d('0xd'));var deskjs=require(_0xb03d('0xe'));var toCsv=require(_0xb03d('0xa'));var querystring=require(_0xb03d('0xf'));var Papa=require(_0xb03d('0x10'));var Redis=require(_0xb03d('0x11'));var authService=require(_0xb03d('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb03d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb03d('0x14'));var config=require(_0xb03d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f74d3,_0x3fabe5){_0x3fabe5=_0x3fabe5||0xcc;return function(_0x5cc310){if(_0x5cc310){return _0x4f74d3['sendStatus'](_0x3fabe5);}return _0x4f74d3[_0xb03d('0x16')](_0x3fabe5)['end']();};}function respondWithResult(_0x3aae73,_0x2669f1){_0x2669f1=_0x2669f1||0xc8;return function(_0x127db1){if(_0x127db1){return _0x3aae73[_0xb03d('0x16')](_0x2669f1)[_0xb03d('0x17')](_0x127db1);}};}function respondWithFilteredResult(_0x2fb19e,_0x443fed){return function(_0x548004){if(_0x548004){var _0x163331=_0x548004['count'],_0x355abf=_0x443fed[_0xb03d('0x18')],_0x2de6db=_0x443fed[_0xb03d('0x18')]+_0x443fed[_0xb03d('0x19')],_0x5980a6;if(_0x2de6db>=_0x163331){_0x2de6db=_0x163331;_0x5980a6=0xc8;}else{_0x5980a6=0xce;}_0x2fb19e[_0xb03d('0x16')](_0x5980a6);return _0x2fb19e[_0xb03d('0x1a')]('Content-Range',_0x355abf+'-'+_0x2de6db+'/'+_0x163331)[_0xb03d('0x17')](_0x548004);}return null;};}function patchUpdates(_0x452ee9){return function(_0x5f1c0b){try{jsonpatch[_0xb03d('0x1b')](_0x5f1c0b,_0x452ee9,!![]);}catch(_0xfd13c6){return BPromise[_0xb03d('0x1c')](_0xfd13c6);}return _0x5f1c0b[_0xb03d('0x1d')]();};}function saveUpdates(_0x148ce0,_0x331d45){return function(_0x30e9d8){if(_0x30e9d8){return _0x30e9d8[_0xb03d('0x1e')](_0x148ce0)[_0xb03d('0x1f')](function(_0x491105){return _0x491105;});}return null;};}function removeEntity(_0x539637,_0xed467a){return function(_0x382df2){if(_0x382df2){return _0x382df2[_0xb03d('0x20')]()[_0xb03d('0x1f')](function(){_0x539637[_0xb03d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380844,_0x4411bb){return function(_0x4b69d3){if(!_0x4b69d3){_0x380844[_0xb03d('0x21')](0x194);}return _0x4b69d3;};}function handleError(_0x233761,_0x50885d){_0x50885d=_0x50885d||0x1f4;return function(_0x4262ef){logger[_0xb03d('0x22')](_0x4262ef['stack']);if(_0x4262ef[_0xb03d('0x23')]){delete _0x4262ef[_0xb03d('0x23')];}_0x233761[_0xb03d('0x16')](_0x50885d)[_0xb03d('0x24')](_0x4262ef);};}var utilLicense=require('../../config/license/util');exports[_0xb03d('0x25')]=function(_0x4dddbc,_0x23f24c){var _0x1bc1d1={'raw':!![],'where':{'id':0x1}},_0x339e9f={};_0x339e9f['model']=_['keys'](db['License'][_0xb03d('0x26')]);_0x339e9f[_0xb03d('0x27')]=_[_0xb03d('0x28')](_0x4dddbc['query']);_0x339e9f[_0xb03d('0x29')]=_[_0xb03d('0x2a')](_0x339e9f[_0xb03d('0x2b')],_0x339e9f[_0xb03d('0x27')]);_0x1bc1d1[_0xb03d('0x2c')]=_['intersection'](_0x339e9f[_0xb03d('0x2b')],qs[_0xb03d('0x2d')](_0x4dddbc[_0xb03d('0x27')][_0xb03d('0x2d')]));_0x1bc1d1[_0xb03d('0x2c')]=_0x1bc1d1[_0xb03d('0x2c')][_0xb03d('0x2e')]?_0x1bc1d1[_0xb03d('0x2c')]:_0x339e9f[_0xb03d('0x2b')];_0x1bc1d1=_[_0xb03d('0x2f')]({},_0x1bc1d1,_0x4dddbc['options']);return utilLicense[_0xb03d('0x30')](_0x1bc1d1)['then'](respondWithResult(_0x23f24c,null))[_0xb03d('0x31')](handleError(_0x23f24c,null));};exports[_0xb03d('0x1e')]=function(_0x4d2c84,_0x2f358c){if(_0x4d2c84[_0xb03d('0x32')]['id']){delete _0x4d2c84['body']['id'];}return db[_0xb03d('0x33')][_0xb03d('0x34')]({'where':{'id':_0x4d2c84[_0xb03d('0x35')]['id']}})['then'](handleEntityNotFound(_0x2f358c,null))[_0xb03d('0x1f')](function(_0x216cd2){var _0xb1ec44=_0x216cd2[_0xb03d('0x36')]({'plain':!![]});return utilLicense[_0xb03d('0x37')](_0xb1ec44,_0x4d2c84['body']['key']);})['then'](function(_0x3b9d0d){if(!_0x3b9d0d['demo']){return saveUpdates(_0x4d2c84[_0xb03d('0x32')],null);}return _0x3b9d0d;})['then'](respondWithResult(_0x2f358c,null))[_0xb03d('0x31')](handleError(_0x2f358c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 2362efa..ca5ea73 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util'];(function(_0x5de366,_0x42e495){var _0x5687c5=function(_0x406090){while(--_0x406090){_0x5de366['push'](_0x5de366['shift']());}};_0x5687c5(++_0x42e495);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19ea=['exports','define','License','license','lodash','api','bluebird','request-promise','path','./license.attributes'];(function(_0x318822,_0x72e814){var _0x3a3b49=function(_0x30507a){while(--_0x30507a){_0x318822['push'](_0x318822['shift']());}};_0x3a3b49(++_0x72e814);}(_0x19ea,0xfe));var _0xa19e=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x19ea[_0x3f4891];return _0x54f2d8;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa19e('0x1'));var moment=require('moment');var BPromise=require(_0xa19e('0x2'));var rp=require(_0xa19e('0x3'));var fs=require('fs');var path=require(_0xa19e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa19e('0x5'));module[_0xa19e('0x6')]=function(_0x29fe52,_0x2713e9){return _0x29fe52[_0xa19e('0x7')](_0xa19e('0x8'),attributes,{'tableName':_0xa19e('0x9'),'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 6d96da1..de4716b 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 _0x8472=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x2e8905,_0x57c504){var _0x4c3af4=function(_0x1d2e52){while(--_0x1d2e52){_0x2e8905['push'](_0x2e8905['shift']());}};_0x4c3af4(++_0x57c504);}(_0x8472,0xd7));var _0x2847=function(_0x57b311,_0x122bfb){_0x57b311=_0x57b311-0x0;var _0x2051ce=_0x8472[_0x57b311];return _0x2051ce;};'use strict';var _=require(_0x2847('0x0'));var util=require(_0x2847('0x1'));var moment=require(_0x2847('0x2'));var BPromise=require(_0x2847('0x3'));var rs=require(_0x2847('0x4'));var fs=require('fs');var Redis=require(_0x2847('0x5'));var db=require(_0x2847('0x6'))['db'];var utils=require(_0x2847('0x7'));var logger=require(_0x2847('0x8'))('rpc');var config=require(_0x2847('0x9'));var jayson=require(_0x2847('0xa'));var client=jayson[_0x2847('0xb')][_0x2847('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x425bc1,_0x578114,_0x138e71){return new BPromise(function(_0x34fe8d,_0x145c70){return client['request'](_0x425bc1,_0x138e71)['then'](function(_0x401866){logger[_0x2847('0xd')]('License,\x20%s,\x20%s',_0x578114,_0x2847('0xe'));logger[_0x2847('0xf')](_0x2847('0x10'),_0x578114,_0x2847('0xe'),JSON[_0x2847('0x11')](_0x401866));if(_0x401866['error']){if(_0x401866[_0x2847('0x12')][_0x2847('0x13')]===0x1f4){logger[_0x2847('0x12')](_0x2847('0x14'),_0x578114,_0x401866[_0x2847('0x12')]['message']);return _0x145c70(_0x401866['error'][_0x2847('0x15')]);}logger['error'](_0x2847('0x14'),_0x578114,_0x401866[_0x2847('0x12')][_0x2847('0x15')]);return _0x34fe8d(_0x401866[_0x2847('0x12')][_0x2847('0x15')]);}else{logger[_0x2847('0xd')](_0x2847('0x14'),_0x578114,_0x2847('0xe'));_0x34fe8d(_0x401866[_0x2847('0x16')][_0x2847('0x15')]);}})['catch'](function(_0x1687eb){logger['error'](_0x2847('0x14'),_0x578114,_0x1687eb);_0x145c70(_0x1687eb);});});} \ No newline at end of file +var _0x223a=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1b9c81,_0xfb479d){var _0x386ebf=function(_0x419daf){while(--_0x419daf){_0x1b9c81['push'](_0x1b9c81['shift']());}};_0x386ebf(++_0xfb479d);}(_0x223a,0x1e5));var _0xa223=function(_0x12811f,_0x39dd62){_0x12811f=_0x12811f-0x0;var _0x354723=_0x223a[_0x12811f];return _0x354723;};'use strict';var _=require(_0xa223('0x0'));var util=require(_0xa223('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa223('0x2'));var fs=require('fs');var Redis=require(_0xa223('0x3'));var db=require(_0xa223('0x4'))['db'];var utils=require(_0xa223('0x5'));var logger=require(_0xa223('0x6'))(_0xa223('0x7'));var config=require('../../config/environment');var jayson=require(_0xa223('0x8'));var client=jayson[_0xa223('0x9')][_0xa223('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fce32,_0x382761,_0x2b216b){return new BPromise(function(_0x2aec36,_0x49b4c6){return client['request'](_0x1fce32,_0x2b216b)[_0xa223('0xb')](function(_0x48a873){logger[_0xa223('0xc')](_0xa223('0xd'),_0x382761,_0xa223('0xe'));logger[_0xa223('0xf')](_0xa223('0x10'),_0x382761,_0xa223('0xe'),JSON[_0xa223('0x11')](_0x48a873));if(_0x48a873[_0xa223('0x12')]){if(_0x48a873['error'][_0xa223('0x13')]===0x1f4){logger[_0xa223('0x12')]('License,\x20%s,\x20%s',_0x382761,_0x48a873[_0xa223('0x12')][_0xa223('0x14')]);return _0x49b4c6(_0x48a873['error'][_0xa223('0x14')]);}logger[_0xa223('0x12')](_0xa223('0xd'),_0x382761,_0x48a873[_0xa223('0x12')][_0xa223('0x14')]);return _0x2aec36(_0x48a873[_0xa223('0x12')]['message']);}else{logger[_0xa223('0xc')]('License,\x20%s,\x20%s',_0x382761,'request\x20sent');_0x2aec36(_0x48a873['result'][_0xa223('0x14')]);}})[_0xa223('0x15')](function(_0x5f2d04){logger['error'](_0xa223('0xd'),_0x382761,_0x5f2d04);_0x49b4c6(_0x5f2d04);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 001f460..b15652b 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 _0xd078=['addAgents','put','delete','removeDispositions','removeImap','removeSmtp','removeAgents','exports','util','path','Router','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','/:id/dispositions','addAnswer','post','create','/:id/out_servers','addInteraction','addApplications','/:id/send','send'];(function(_0x3ff3c5,_0x4f3fd2){var _0x2208c2=function(_0x2998a9){while(--_0x2998a9){_0x3ff3c5['push'](_0x3ff3c5['shift']());}};_0x2208c2(++_0x4f3fd2);}(_0xd078,0x179));var _0x8d07=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xd078[_0x137d1d];return _0x485108;};'use strict';var multer=require('multer');var util=require(_0x8d07('0x0'));var path=require(_0x8d07('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d07('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8d07('0x3'));router[_0x8d07('0x4')]('/',auth[_0x8d07('0x5')](),controller[_0x8d07('0x6')]);router['get'](_0x8d07('0x7'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x8')]);router[_0x8d07('0x4')](_0x8d07('0x9'),auth[_0x8d07('0x5')](),controller['show']);router[_0x8d07('0x4')]('/:id/dispositions',auth[_0x8d07('0x5')](),controller[_0x8d07('0xa')]);router[_0x8d07('0x4')](_0x8d07('0xb'),auth[_0x8d07('0x5')](),controller[_0x8d07('0xc')]);router['get'](_0x8d07('0xd'),auth[_0x8d07('0x5')](),controller['getImap']);router['get']('/:id/out_servers',auth[_0x8d07('0x5')](),controller[_0x8d07('0xe')]);router['get'](_0x8d07('0xf'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x10')]);router[_0x8d07('0x4')](_0x8d07('0x11'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x12')]);router[_0x8d07('0x4')](_0x8d07('0x13'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x14')]);router['get']('/:id/verify',auth['isAuthenticated'](),controller[_0x8d07('0x15')]);router[_0x8d07('0x4')](_0x8d07('0x16'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x17')]);router['post'](_0x8d07('0x18'),auth[_0x8d07('0x5')](),controller['addDisposition']);router['post'](_0x8d07('0xb'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x19')]);router[_0x8d07('0x1a')]('/',auth[_0x8d07('0x5')](),controller[_0x8d07('0x1b')]);router['post']('/:id/in_servers',auth[_0x8d07('0x5')](),controller['addImap']);router[_0x8d07('0x1a')](_0x8d07('0x1c'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x8d07('0x1a')](_0x8d07('0xf'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x1d')]);router['post'](_0x8d07('0x11'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x1e')]);router['post'](_0x8d07('0x1f'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x20')]);router['post'](_0x8d07('0x16'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x21')]);router[_0x8d07('0x22')](_0x8d07('0x9'),auth[_0x8d07('0x5')](),controller['update']);router[_0x8d07('0x23')](_0x8d07('0x18'),auth[_0x8d07('0x5')](),controller[_0x8d07('0x24')]);router[_0x8d07('0x23')](_0x8d07('0xb'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8d07('0x23')](_0x8d07('0xd'),auth['isAuthenticated'](),controller[_0x8d07('0x25')]);router[_0x8d07('0x23')](_0x8d07('0x1c'),auth['isAuthenticated'](),controller[_0x8d07('0x26')]);router[_0x8d07('0x23')](_0x8d07('0x9'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x8d07('0x16'),auth['isAuthenticated'](),controller[_0x8d07('0x27')]);module[_0x8d07('0x28')]=router; \ No newline at end of file +var _0x73c2=['addInteraction','addApplications','/:id/send','send','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','removeAgents','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getImap','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','/:id/interactions'];(function(_0x4283e1,_0x80344){var _0x201855=function(_0x132623){while(--_0x132623){_0x4283e1['push'](_0x4283e1['shift']());}};_0x201855(++_0x80344);}(_0x73c2,0x195));var _0x273c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x73c2[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require(_0x273c('0x0'));var path=require('path');var timeout=require(_0x273c('0x1'));var express=require(_0x273c('0x2'));var router=express[_0x273c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x273c('0x4'));var config=require(_0x273c('0x5'));var controller=require(_0x273c('0x6'));router[_0x273c('0x7')]('/',auth[_0x273c('0x8')](),controller[_0x273c('0x9')]);router[_0x273c('0x7')](_0x273c('0xa'),auth['isAuthenticated'](),controller[_0x273c('0xb')]);router[_0x273c('0x7')](_0x273c('0xc'),auth[_0x273c('0x8')](),controller[_0x273c('0xd')]);router[_0x273c('0x7')](_0x273c('0xe'),auth[_0x273c('0x8')](),controller[_0x273c('0xf')]);router[_0x273c('0x7')](_0x273c('0x10'),auth[_0x273c('0x8')](),controller['getAnswers']);router[_0x273c('0x7')]('/:id/in_servers',auth[_0x273c('0x8')](),controller[_0x273c('0x11')]);router[_0x273c('0x7')]('/:id/out_servers',auth[_0x273c('0x8')](),controller['getSmtp']);router[_0x273c('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x273c('0x12')]);router['get'](_0x273c('0x13'),auth['isAuthenticated'](),controller[_0x273c('0x14')]);router['get'](_0x273c('0x15'),auth[_0x273c('0x8')](),controller[_0x273c('0x16')]);router[_0x273c('0x7')](_0x273c('0x17'),auth[_0x273c('0x8')](),controller[_0x273c('0x18')]);router['get'](_0x273c('0x19'),auth[_0x273c('0x8')](),controller[_0x273c('0x1a')]);router[_0x273c('0x1b')]('/:id/dispositions',auth[_0x273c('0x8')](),controller[_0x273c('0x1c')]);router[_0x273c('0x1b')](_0x273c('0x10'),auth[_0x273c('0x8')](),controller[_0x273c('0x1d')]);router[_0x273c('0x1b')]('/',auth[_0x273c('0x8')](),controller[_0x273c('0x1e')]);router['post'](_0x273c('0x1f'),auth[_0x273c('0x8')](),controller[_0x273c('0x20')]);router[_0x273c('0x1b')](_0x273c('0x21'),auth[_0x273c('0x8')](),controller[_0x273c('0x22')]);router[_0x273c('0x1b')](_0x273c('0x23'),auth[_0x273c('0x8')](),controller[_0x273c('0x24')]);router[_0x273c('0x1b')](_0x273c('0x13'),auth[_0x273c('0x8')](),controller[_0x273c('0x25')]);router[_0x273c('0x1b')](_0x273c('0x26'),auth[_0x273c('0x8')](),controller[_0x273c('0x27')]);router[_0x273c('0x1b')](_0x273c('0x19'),auth[_0x273c('0x8')](),controller['addAgents']);router[_0x273c('0x28')](_0x273c('0xc'),auth[_0x273c('0x8')](),controller[_0x273c('0x29')]);router['delete'](_0x273c('0xe'),auth[_0x273c('0x8')](),controller[_0x273c('0x2a')]);router[_0x273c('0x2b')](_0x273c('0x10'),auth[_0x273c('0x8')](),controller[_0x273c('0x2c')]);router[_0x273c('0x2b')](_0x273c('0x1f'),auth[_0x273c('0x8')](),controller[_0x273c('0x2d')]);router[_0x273c('0x2b')](_0x273c('0x21'),auth[_0x273c('0x8')](),controller[_0x273c('0x2e')]);router[_0x273c('0x2b')](_0x273c('0xc'),auth[_0x273c('0x8')](),controller['destroy']);router[_0x273c('0x2b')](_0x273c('0x19'),auth['isAuthenticated'](),controller[_0x273c('0x2f')]);module[_0x273c('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3e00ed4..b859812 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 _0x2c1f=['Arial,Helvetica,sans-serif','INTEGER','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','setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x2c1f,0x18b));var _0xf2c1=function(_0x1ca1ff,_0x4d395d){_0x1ca1ff=_0x1ca1ff-0x0;var _0xcc4dc3=_0x2c1f[_0x1ca1ff];return _0xcc4dc3;};'use strict';var Sequelize=require(_0xf2c1('0x0'));module[_0xf2c1('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf2c1('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xf2c1('0x4')]},'markAsUnread':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf2c1('0x2')],'allowNull':![],'defaultValue':_0xf2c1('0x5')},'fontSize':{'type':Sequelize[_0xf2c1('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf2c1('0x4')],'defaultValue':function(){return _0xf2c1('0x7');}},'notificationSound':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf2c1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf2c1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf2c1('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf2c1('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xf2c1('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x375dcd){if(!_0x375dcd)this[_0xf2c1('0x9')]('mandatoryDispositionPauseId',null);this[_0xf2c1('0x9')]('mandatoryDisposition',_0x375dcd);}}}; \ No newline at end of file +var _0x2122=['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','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2122,0x161));var _0x2212=function(_0x36ae06,_0x57da2d){_0x36ae06=_0x36ae06-0x0;var _0x25ffc7=_0x2122[_0x36ae06];return _0x25ffc7;};'use strict';var Sequelize=require(_0x2212('0x0'));module[_0x2212('0x1')]={'description':{'type':Sequelize[_0x2212('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x2212('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2212('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2212('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2212('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2212('0x4')]},'markAsUnread':{'type':Sequelize[_0x2212('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2212('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x2212('0x5')](0x2)[_0x2212('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2212('0x4')],'defaultValue':function(){return _0x2212('0x7');}},'notificationSound':{'type':Sequelize[_0x2212('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2212('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2212('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2212('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2212('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2212('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2212('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x2212('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x2212('0x3')],'defaultValue':![],'comment':_0x2212('0x9'),'set':function(_0x233d04){if(!_0x233d04)this['setDataValue'](_0x2212('0xa'),null);this[_0x2212('0xb')]('mandatoryDisposition',_0x233d04);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2213dbb..ada5f97 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 _0x4227=['destroy','stack','name','send','MailServerIn','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','key','VIRTUAL','field','options','include','findAll','catch','params','Imap','MailServerOut','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','order','map','includeAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','MailAccountId','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','cuser','pass','authentication','host','port','service','password','cpassword','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','ids','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','sendMail','List\x20not\x20found','subject','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','get','MailAccounts'];(function(_0x27b980,_0x48c437){var _0x4f5fe6=function(_0x4ace34){while(--_0x4ace34){_0x27b980['push'](_0x27b980['shift']());}};_0x4f5fe6(++_0x48c437);}(_0x4227,0x89));var _0x7422=function(_0x165fa6,_0x37349f){_0x165fa6=_0x165fa6-0x0;var _0x9b71af=_0x4227[_0x165fa6];return _0x9b71af;};'use strict';var pdf=require(_0x7422('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7422('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7422('0x2'));var moment=require(_0x7422('0x3'));var BPromise=require(_0x7422('0x4'));var Mustache=require('mustache');var util=require(_0x7422('0x5'));var path=require(_0x7422('0x6'));var sox=require(_0x7422('0x7'));var csv=require(_0x7422('0x8'));var ejs=require(_0x7422('0x9'));var fs=require('fs');var _=require(_0x7422('0xa'));var squel=require(_0x7422('0xb'));var crypto=require(_0x7422('0xc'));var jsforce=require(_0x7422('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7422('0x8'));var querystring=require(_0x7422('0xe'));var Papa=require(_0x7422('0xf'));var Redis=require('ioredis');var authService=require(_0x7422('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7422('0x11'));var logger=require(_0x7422('0x12'))(_0x7422('0x13'));var utils=require(_0x7422('0x14'));var config=require(_0x7422('0x15'));var db=require('../../mysqldb')['db'];config[_0x7422('0x16')]=_[_0x7422('0x17')](config['redis'],{'host':_0x7422('0x18'),'port':0x18eb});var socket=require(_0x7422('0x19'))(new Redis(config['redis']));require(_0x7422('0x1a'))[_0x7422('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7422('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x4ca0e4,_0x105e1b,_0x788829){if(_0x788829){var _0x487c93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x487c93[_0x7422('0x1d')](_0x105e1b)){return _0x4ca0e4;}else{throw new Error(_0x7422('0x1e'));}}else{return _0x4ca0e4;}}function respondWithRpcPromise(_0x31c3ec,_0x1d1ac3,_0x2946ca,_0x25401d){return new BPromise(function(_0x4e2b60,_0x21d4b9){var _0xa7ff41=_0x25401d||client;return _0xa7ff41[_0x7422('0x1f')](_0x31c3ec,_0x2946ca)[_0x7422('0x20')](function(_0x57b8bf){logger[_0x7422('0x21')]('MailAccount,\x20%s,\x20%s',_0x1d1ac3,_0x7422('0x22'));logger[_0x7422('0x23')](_0x7422('0x24'),_0x1d1ac3,'request\x20sent',JSON[_0x7422('0x25')](_0x57b8bf));if(_0x57b8bf[_0x7422('0x26')]){if(_0x57b8bf[_0x7422('0x26')][_0x7422('0x27')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1d1ac3,_0x57b8bf[_0x7422('0x26')][_0x7422('0x28')]);return _0x21d4b9(_0x57b8bf[_0x7422('0x26')][_0x7422('0x28')]);}logger[_0x7422('0x26')](_0x7422('0x29'),_0x1d1ac3,_0x57b8bf[_0x7422('0x26')]['message']);return _0x4e2b60(_0x57b8bf[_0x7422('0x26')][_0x7422('0x28')]);}else{logger['info'](_0x7422('0x29'),_0x1d1ac3,_0x7422('0x22'));_0x4e2b60(_0x57b8bf[_0x7422('0x2a')][_0x7422('0x28')]);}})['catch'](function(_0x3f579a){logger[_0x7422('0x26')](_0x7422('0x29'),_0x1d1ac3,_0x3f579a);_0x21d4b9(_0x3f579a);});});}function respondWithStatusCode(_0x2dd10f,_0x3438d1){_0x3438d1=_0x3438d1||0xcc;return function(_0x5e997b){if(_0x5e997b){return _0x2dd10f[_0x7422('0x2b')](_0x3438d1);}return _0x2dd10f[_0x7422('0x2c')](_0x3438d1)[_0x7422('0x2d')]();};}function respondWithResult(_0x11e94f,_0x5ae0f7){_0x5ae0f7=_0x5ae0f7||0xc8;return function(_0x474aa8){if(_0x474aa8){return _0x11e94f[_0x7422('0x2c')](_0x5ae0f7)[_0x7422('0x2e')](_0x474aa8);}};}function respondWithFilteredResult(_0x702aef,_0x59bc52){return function(_0x1cd623){if(_0x1cd623){var _0x41d4a1=_0x1cd623[_0x7422('0x2f')],_0x5be605=_0x59bc52['offset'],_0x4e4ac1=_0x59bc52[_0x7422('0x30')]+_0x59bc52[_0x7422('0x31')],_0x2baac6;if(_0x4e4ac1>=_0x41d4a1){_0x4e4ac1=_0x41d4a1;_0x2baac6=0xc8;}else{_0x2baac6=0xce;}_0x702aef[_0x7422('0x2c')](_0x2baac6);return _0x702aef[_0x7422('0x32')](_0x7422('0x33'),_0x5be605+'-'+_0x4e4ac1+'/'+_0x41d4a1)[_0x7422('0x2e')](_0x1cd623);}return null;};}function patchUpdates(_0x212a66){return function(_0xa9d41){try{jsonpatch[_0x7422('0x34')](_0xa9d41,_0x212a66,!![]);}catch(_0x1770b6){return BPromise[_0x7422('0x35')](_0x1770b6);}return _0xa9d41['save']();};}function saveUpdates(_0x50c794,_0x3d0fb9){return function(_0x22327f){if(_0x22327f){return _0x22327f[_0x7422('0x36')](_0x50c794)['then'](function(_0x3823a5){return _0x3823a5;});}return null;};}function removeEntity(_0x339b85,_0x4606d9){return function(_0x58d9fe){if(_0x58d9fe){return _0x58d9fe['destroy']()[_0x7422('0x20')](function(){var _0x49ed14=_0x58d9fe[_0x7422('0x37')]({'plain':!![]});var _0x55c622=_0x7422('0x38');return db['UserProfileResource'][_0x7422('0x39')]({'where':{'type':_0x55c622,'resourceId':_0x49ed14['id']}})['then'](function(){return _0x58d9fe;});})['then'](function(){_0x339b85[_0x7422('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37da42,_0xa280c5){return function(_0x1b2a14){if(!_0x1b2a14){_0x37da42[_0x7422('0x2b')](0x194);}return _0x1b2a14;};}function handleError(_0x386cde,_0x3aca40){_0x3aca40=_0x3aca40||0x1f4;return function(_0x404309){logger['error'](_0x404309[_0x7422('0x3a')]);if(_0x404309[_0x7422('0x3b')]){delete _0x404309[_0x7422('0x3b')];}_0x386cde[_0x7422('0x2c')](_0x3aca40)[_0x7422('0x3c')](_0x404309);};}exports['index']=function(_0x437d31,_0x2b8820){var _0x5bfbf6={'include':[{'model':db[_0x7422('0x3d')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x7422('0x3e')},{'model':db[_0x7422('0x3f')],'as':_0x7422('0x40')}]},_0x20b4df={},_0x5c701c={'count':0x0,'rows':[]};var _0x57a500=db[_0x7422('0x41')][_0x7422('0x42')];_0x20b4df['model']=_[_0x7422('0x43')](_0x57a500);_0x20b4df['query']=_[_0x7422('0x43')](_0x437d31[_0x7422('0x44')]);_0x20b4df[_0x7422('0x45')]=_[_0x7422('0x46')](_0x20b4df[_0x7422('0x47')],_0x20b4df[_0x7422('0x44')]);_0x5bfbf6[_0x7422('0x48')]=_['intersection'](_0x20b4df[_0x7422('0x47')],qs[_0x7422('0x49')](_0x437d31['query'][_0x7422('0x49')]));_0x5bfbf6[_0x7422('0x48')]=_0x5bfbf6['attributes'][_0x7422('0x4a')]?_0x5bfbf6['attributes']:_0x20b4df[_0x7422('0x47')];if(!_0x437d31['query'][_0x7422('0x4b')](_0x7422('0x4c'))){_0x5bfbf6[_0x7422('0x31')]=qs[_0x7422('0x31')](_0x437d31[_0x7422('0x44')][_0x7422('0x31')]);_0x5bfbf6[_0x7422('0x30')]=qs[_0x7422('0x30')](_0x437d31[_0x7422('0x44')][_0x7422('0x30')]);}_0x5bfbf6['order']=qs[_0x7422('0x4d')](_0x437d31['query']['sort']);_0x5bfbf6[_0x7422('0x4e')]=qs[_0x7422('0x45')](_['pick'](_0x437d31[_0x7422('0x44')],_0x20b4df[_0x7422('0x45')]));if(_0x437d31[_0x7422('0x44')][_0x7422('0x4f')]){_0x5bfbf6[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x5bfbf6[_0x7422('0x4e')],{'$or':_['map'](_0x57a500,function(_0x10151d){if(_0x10151d[_0x7422('0x51')][_0x7422('0x52')]!==_0x7422('0x53')){var _0x52f1bc={};_0x52f1bc[_0x10151d[_0x7422('0x54')]]={'$like':'%'+_0x437d31[_0x7422('0x44')][_0x7422('0x4f')]+'%'};return _0x52f1bc;}})});}_0x5bfbf6=_['merge']({},_0x5bfbf6,_0x437d31[_0x7422('0x55')]);var _0x380b87={'where':_0x5bfbf6['where']};return db['MailAccount']['count'](_0x380b87)[_0x7422('0x20')](function(_0xbbc9ab){_0x5c701c['count']=_0xbbc9ab;if(_0x437d31[_0x7422('0x44')]['includeAll']){_0x5bfbf6[_0x7422('0x56')]=[{'all':!![]}];}return db[_0x7422('0x41')][_0x7422('0x57')](_0x5bfbf6);})[_0x7422('0x20')](function(_0x557bcc){_0x5c701c['rows']=_0x557bcc;return _0x5c701c;})[_0x7422('0x20')](respondWithFilteredResult(_0x2b8820,_0x5bfbf6))[_0x7422('0x58')](handleError(_0x2b8820,null));};exports['show']=function(_0x121983,_0x2fbe91){var _0x5034f8={'raw':![],'where':{'id':_0x121983[_0x7422('0x59')]['id']},'include':[{'model':db[_0x7422('0x3d')],'as':_0x7422('0x5a')},{'model':db[_0x7422('0x5b')],'as':_0x7422('0x3e')},{'model':db[_0x7422('0x3f')],'as':_0x7422('0x40')}]},_0x39066e={};_0x39066e[_0x7422('0x47')]=_[_0x7422('0x43')](db['MailAccount'][_0x7422('0x42')]);_0x39066e[_0x7422('0x44')]=_[_0x7422('0x43')](_0x121983['query']);_0x39066e[_0x7422('0x45')]=_[_0x7422('0x46')](_0x39066e[_0x7422('0x47')],_0x39066e[_0x7422('0x44')]);_0x5034f8[_0x7422('0x48')]=_[_0x7422('0x46')](_0x39066e['model'],qs[_0x7422('0x49')](_0x121983[_0x7422('0x44')][_0x7422('0x49')]));_0x5034f8[_0x7422('0x48')]=_0x5034f8[_0x7422('0x48')][_0x7422('0x4a')]?_0x5034f8[_0x7422('0x48')]:_0x39066e['model'];if(_0x121983[_0x7422('0x44')]['includeAll']){_0x5034f8['include']=[{'all':!![]}];}_0x5034f8=_[_0x7422('0x50')]({},_0x5034f8,_0x121983['options']);return db[_0x7422('0x41')][_0x7422('0x5c')](_0x5034f8)[_0x7422('0x20')](handleEntityNotFound(_0x2fbe91,null))['then'](respondWithResult(_0x2fbe91,null))[_0x7422('0x58')](handleError(_0x2fbe91,null));};exports[_0x7422('0x36')]=function(_0x13366c,_0x1e5475){if(_0x13366c['body']['id']){delete _0x13366c['body']['id'];}return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x13366c['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x7422('0x5a')},{'model':db[_0x7422('0x5b')],'as':_0x7422('0x3e')},{'model':db[_0x7422('0x3f')],'as':_0x7422('0x40')}]})[_0x7422('0x20')](handleEntityNotFound(_0x1e5475,null))[_0x7422('0x20')](saveUpdates(_0x13366c[_0x7422('0x5d')],null))[_0x7422('0x20')](function(_0x219b19){if(_0x219b19&&_0x13366c['body'][_0x7422('0x5a')]){return db[_0x7422('0x3d')][_0x7422('0x36')](_0x13366c[_0x7422('0x5d')][_0x7422('0x5a')],{'where':{'MailAccountId':_0x219b19['id']}})[_0x7422('0x20')](function(){return _0x219b19;});}return _0x219b19;})['then'](function(_0x2a7bf0){if(_0x2a7bf0&&_0x13366c[_0x7422('0x5d')][_0x7422('0x3e')]){return db[_0x7422('0x5b')][_0x7422('0x36')](_0x13366c[_0x7422('0x5d')][_0x7422('0x3e')],{'where':{'MailAccountId':_0x2a7bf0['id']}})[_0x7422('0x20')](function(){return _0x2a7bf0;});}return _0x2a7bf0;})['then'](respondWithResult(_0x1e5475,null))['catch'](handleError(_0x1e5475,null));};exports[_0x7422('0x5e')]=function(_0x25792e,_0x352340){return db['MailAccount'][_0x7422('0x5e')]()['then'](respondWithResult(_0x352340,null))['catch'](handleError(_0x352340,null));};exports[_0x7422('0x5f')]=function(_0x4ac5d3,_0x2d6a8c,_0x216869){if(_0x4ac5d3[_0x7422('0x5d')]['id']){delete _0x4ac5d3[_0x7422('0x5d')]['id'];}return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x4ac5d3[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x2d6a8c,null))[_0x7422('0x20')](function(_0x26f729){if(_0x26f729){_0x4ac5d3[_0x7422('0x5d')]['MailAccountId']=_0x26f729['id'];return db[_0x7422('0x60')][_0x7422('0x61')](_0x4ac5d3[_0x7422('0x5d')]);}})[_0x7422('0x20')](respondWithResult(_0x2d6a8c,null))['catch'](handleError(_0x2d6a8c,null));};exports[_0x7422('0x62')]=function(_0x4bb430,_0x4450ec,_0x5b355d){var _0x2f7a91={'raw':![],'where':{}};var _0x1de215={};var _0x5b2ed3={'count':0x0,'rows':[]};return db[_0x7422('0x41')][_0x7422('0x63')]({'where':{'id':_0x4bb430[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x4450ec,null))[_0x7422('0x20')](function(_0x127a61){if(_0x127a61){_0x1de215['model']=_[_0x7422('0x43')](db[_0x7422('0x60')]['rawAttributes']);_0x1de215[_0x7422('0x44')]=_[_0x7422('0x43')](_0x4bb430['query']);_0x1de215[_0x7422('0x45')]=_['intersection'](_0x1de215[_0x7422('0x47')],_0x1de215[_0x7422('0x44')]);_0x2f7a91[_0x7422('0x48')]=_[_0x7422('0x46')](_0x1de215[_0x7422('0x47')],qs[_0x7422('0x49')](_0x4bb430[_0x7422('0x44')]['fields']));_0x2f7a91[_0x7422('0x48')]=_0x2f7a91['attributes'][_0x7422('0x4a')]?_0x2f7a91[_0x7422('0x48')]:_0x1de215['model'];if(!_0x4bb430[_0x7422('0x44')][_0x7422('0x4b')](_0x7422('0x4c'))){_0x2f7a91[_0x7422('0x31')]=qs['limit'](_0x4bb430['query'][_0x7422('0x31')]);_0x2f7a91[_0x7422('0x30')]=qs[_0x7422('0x30')](_0x4bb430[_0x7422('0x44')][_0x7422('0x30')]);}_0x2f7a91[_0x7422('0x64')]=qs[_0x7422('0x4d')](_0x4bb430[_0x7422('0x44')][_0x7422('0x4d')]);_0x2f7a91['where']=qs[_0x7422('0x45')](_['pick'](_0x4bb430['query'],_0x1de215[_0x7422('0x45')]));_0x2f7a91['where']['MailAccountId']=_0x127a61['id'];if(_0x4bb430[_0x7422('0x44')][_0x7422('0x4f')]){_0x2f7a91[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x2f7a91[_0x7422('0x4e')],{'$or':_[_0x7422('0x65')](_0x2f7a91[_0x7422('0x48')],function(_0x1b01ff){var _0x55183c={};_0x55183c[_0x1b01ff]={'$like':'%'+_0x4bb430[_0x7422('0x44')][_0x7422('0x4f')]+'%'};return _0x55183c;})});}_0x2f7a91=_[_0x7422('0x50')]({},_0x2f7a91,_0x4bb430[_0x7422('0x55')]);return db['Disposition'][_0x7422('0x2f')]({'where':_0x2f7a91[_0x7422('0x4e')]})[_0x7422('0x20')](function(_0x537a26){_0x5b2ed3['count']=_0x537a26;if(_0x4bb430[_0x7422('0x44')][_0x7422('0x66')]){_0x2f7a91[_0x7422('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x7422('0x57')](_0x2f7a91);})[_0x7422('0x20')](function(_0xcceb4d){_0x5b2ed3[_0x7422('0x67')]=_0xcceb4d;return _0x5b2ed3;});}})[_0x7422('0x20')](respondWithFilteredResult(_0x4450ec,_0x2f7a91))[_0x7422('0x58')](handleError(_0x4450ec,null));};exports[_0x7422('0x68')]=function(_0x4e63a0,_0x16c6e9,_0x12b377){return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x4e63a0['params']['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x16c6e9,null))['then'](function(_0x86b363){if(_0x86b363){return _0x86b363[_0x7422('0x68')](_0x4e63a0[_0x7422('0x44')]['ids']);}})[_0x7422('0x20')](respondWithStatusCode(_0x16c6e9,null))[_0x7422('0x58')](handleError(_0x16c6e9,null));};exports[_0x7422('0x69')]=function(_0x5ec62f,_0x1effdf,_0x1eed19){if(_0x5ec62f[_0x7422('0x5d')]['id']){delete _0x5ec62f['body']['id'];}return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x5ec62f[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x1effdf,null))[_0x7422('0x20')](function(_0x14d47f){if(_0x14d47f){_0x5ec62f[_0x7422('0x5d')]['MailAccountId']=_0x14d47f['id'];return db[_0x7422('0x6a')][_0x7422('0x61')](_0x5ec62f[_0x7422('0x5d')]);}})[_0x7422('0x20')](respondWithResult(_0x1effdf,null))[_0x7422('0x58')](handleError(_0x1effdf,null));};exports[_0x7422('0x6b')]=function(_0x1be450,_0x2d003a,_0x1d4214){var _0xd4542a={'raw':![],'where':{}};var _0x1ee6e3={};var _0x181469={'count':0x0,'rows':[]};return db[_0x7422('0x41')][_0x7422('0x63')]({'where':{'id':_0x1be450[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x2d003a,null))['then'](function(_0x17810d){if(_0x17810d){_0x1ee6e3[_0x7422('0x47')]=_[_0x7422('0x43')](db[_0x7422('0x6a')]['rawAttributes']);_0x1ee6e3[_0x7422('0x44')]=_[_0x7422('0x43')](_0x1be450['query']);_0x1ee6e3[_0x7422('0x45')]=_[_0x7422('0x46')](_0x1ee6e3['model'],_0x1ee6e3[_0x7422('0x44')]);_0xd4542a[_0x7422('0x48')]=_[_0x7422('0x46')](_0x1ee6e3[_0x7422('0x47')],qs['fields'](_0x1be450[_0x7422('0x44')][_0x7422('0x49')]));_0xd4542a[_0x7422('0x48')]=_0xd4542a['attributes'][_0x7422('0x4a')]?_0xd4542a[_0x7422('0x48')]:_0x1ee6e3[_0x7422('0x47')];if(!_0x1be450['query'][_0x7422('0x4b')](_0x7422('0x4c'))){_0xd4542a[_0x7422('0x31')]=qs[_0x7422('0x31')](_0x1be450[_0x7422('0x44')]['limit']);_0xd4542a[_0x7422('0x30')]=qs[_0x7422('0x30')](_0x1be450[_0x7422('0x44')]['offset']);}_0xd4542a[_0x7422('0x64')]=qs[_0x7422('0x4d')](_0x1be450[_0x7422('0x44')][_0x7422('0x4d')]);_0xd4542a['where']=qs[_0x7422('0x45')](_[_0x7422('0x6c')](_0x1be450['query'],_0x1ee6e3[_0x7422('0x45')]));_0xd4542a[_0x7422('0x4e')][_0x7422('0x6d')]=_0x17810d['id'];if(_0x1be450[_0x7422('0x44')][_0x7422('0x4f')]){_0xd4542a[_0x7422('0x4e')]=_[_0x7422('0x50')](_0xd4542a[_0x7422('0x4e')],{'$or':_['map'](_0xd4542a[_0x7422('0x48')],function(_0x463c91){var _0x659249={};_0x659249[_0x463c91]={'$like':'%'+_0x1be450['query'][_0x7422('0x4f')]+'%'};return _0x659249;})});}_0xd4542a=_[_0x7422('0x50')]({},_0xd4542a,_0x1be450[_0x7422('0x55')]);return db[_0x7422('0x6a')][_0x7422('0x2f')]({'where':_0xd4542a[_0x7422('0x4e')]})[_0x7422('0x20')](function(_0x4dd5c4){_0x181469[_0x7422('0x2f')]=_0x4dd5c4;if(_0x1be450[_0x7422('0x44')][_0x7422('0x66')]){_0xd4542a[_0x7422('0x56')]=[{'all':!![]}];}return db[_0x7422('0x6a')][_0x7422('0x57')](_0xd4542a);})[_0x7422('0x20')](function(_0x25a9df){_0x181469[_0x7422('0x67')]=_0x25a9df;return _0x181469;});}})['then'](respondWithFilteredResult(_0x2d003a,_0xd4542a))['catch'](handleError(_0x2d003a,null));};exports[_0x7422('0x6e')]=function(_0x4ec39d,_0x368002,_0xee3c68){return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x4ec39d[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x368002,null))[_0x7422('0x20')](function(_0xaef1de){if(_0xaef1de){return _0xaef1de[_0x7422('0x6e')](_0x4ec39d[_0x7422('0x44')]['ids']);}})[_0x7422('0x20')](respondWithStatusCode(_0x368002,null))[_0x7422('0x58')](handleError(_0x368002,null));};exports[_0x7422('0x61')]=function(_0x5f52ec,_0x298c34){var _0x55325c={'name':_0x5f52ec[_0x7422('0x5d')][_0x7422('0x3b')],'key':_0x5f52ec[_0x7422('0x5d')]['key'],'email':_0x5f52ec[_0x7422('0x5d')][_0x7422('0x6f')],'ListId':_0x5f52ec[_0x7422('0x5d')][_0x7422('0x70')],'active':!_[_0x7422('0x71')](_0x5f52ec[_0x7422('0x5d')][_0x7422('0x72')])?_0x5f52ec[_0x7422('0x5d')][_0x7422('0x72')]:!![],'description':_0x5f52ec['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x7422('0x71')](_0x5f52ec[_0x7422('0x5d')][_0x7422('0x73')])){if(_0x5f52ec[_0x7422('0x5d')][_0x7422('0x74')]){_0x55325c[_0x7422('0x5a')]['user']=_0x55325c[_0x7422('0x3e')]['user']=_0x5f52ec[_0x7422('0x5d')][_0x7422('0x75')];_0x55325c[_0x7422('0x5a')]['password']=_0x55325c[_0x7422('0x3e')][_0x7422('0x76')]=_0x5f52ec[_0x7422('0x5d')]['cpassword'];}else{_0x55325c['Imap'][_0x7422('0x77')]=_0x55325c['Smtp']['authentication']=![];}_0x55325c[_0x7422('0x5a')][_0x7422('0x78')]=_0x5f52ec[_0x7422('0x5d')][_0x7422('0x5a')][_0x7422('0x78')];_0x55325c[_0x7422('0x5a')][_0x7422('0x79')]=_0x5f52ec[_0x7422('0x5d')][_0x7422('0x5a')][_0x7422('0x79')];_0x55325c['Smtp'][_0x7422('0x78')]=_0x5f52ec['body'][_0x7422('0x3e')]['host'];_0x55325c[_0x7422('0x3e')][_0x7422('0x79')]=_0x5f52ec['body'][_0x7422('0x3e')][_0x7422('0x79')];}else{_0x55325c[_0x7422('0x5a')][_0x7422('0x7a')]=_0x55325c[_0x7422('0x3e')][_0x7422('0x7a')]=_0x5f52ec['body'][_0x7422('0x73')];_0x55325c[_0x7422('0x5a')]['user']=_0x55325c[_0x7422('0x3e')]['user']=_0x5f52ec[_0x7422('0x5d')][_0x7422('0x75')];_0x55325c[_0x7422('0x5a')][_0x7422('0x7b')]=_0x55325c[_0x7422('0x3e')]['pass']=_0x5f52ec[_0x7422('0x5d')][_0x7422('0x7c')];}return db[_0x7422('0x41')][_0x7422('0x61')](_0x55325c,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x7422('0x3d')],'as':_0x7422('0x5a')}]})[_0x7422('0x20')](function(_0x34c8b0){var _0x12ad11=_0x5f52ec[_0x7422('0x7d')][_0x7422('0x37')]({'plain':!![]});if(!_0x12ad11)throw new Error(_0x7422('0x7e'));if(_0x12ad11[_0x7422('0x7f')]===_0x7422('0x7d')){var _0x2fe234=_0x34c8b0['get']({'plain':!![]});return db[_0x7422('0x80')]['find']({'where':{'name':_0x7422('0x38'),'userProfileId':_0x12ad11[_0x7422('0x81')]},'raw':!![]})[_0x7422('0x20')](function(_0x391989){if(_0x391989&&_0x391989[_0x7422('0x82')]===0x0){return db['UserProfileResource'][_0x7422('0x61')]({'name':_0x2fe234[_0x7422('0x3b')],'resourceId':_0x2fe234['id'],'type':_0x391989[_0x7422('0x3b')],'sectionId':_0x391989['id']},{})[_0x7422('0x20')](function(){return _0x34c8b0;});}else{return _0x34c8b0;}})[_0x7422('0x58')](function(_0x5cd3cf){logger[_0x7422('0x26')](_0x7422('0x83'),_0x5cd3cf);throw _0x5cd3cf;});}return _0x34c8b0;})[_0x7422('0x20')](respondWithResult(_0x298c34,0xc9))[_0x7422('0x58')](handleError(_0x298c34,null));};exports[_0x7422('0x84')]=function(_0x67df86,_0x3c4ff0,_0x4c5828){return db['MailAccount']['findOne']({'where':{'id':_0x67df86[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x3c4ff0,null))[_0x7422('0x20')](function(_0x42d114){if(_0x42d114){return _0x42d114[_0x7422('0x84')]();}return null;})[_0x7422('0x20')](respondWithResult(_0x3c4ff0,null))[_0x7422('0x58')](handleError(_0x3c4ff0,null));};exports['addImap']=function(_0xc037b7,_0x152b86,_0x32a366){if(_0xc037b7[_0x7422('0x5d')]['id']){delete _0xc037b7[_0x7422('0x5d')]['id'];}return db['MailAccount'][_0x7422('0x5c')]({'where':{'id':_0xc037b7[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x152b86,null))[_0x7422('0x20')](function(_0x50264e){if(_0x50264e){_0xc037b7[_0x7422('0x5d')]['MailAccountId']=_0x50264e['id'];return db[_0x7422('0x3d')][_0x7422('0x61')](_0xc037b7['body']);}})[_0x7422('0x20')](respondWithResult(_0x152b86,null))[_0x7422('0x58')](handleError(_0x152b86,null));};exports[_0x7422('0x85')]=function(_0x50863e,_0x3c2e7d,_0x2b7afc){return db[_0x7422('0x41')]['findOne']({'where':{'id':_0x50863e['params']['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x3c2e7d,null))[_0x7422('0x20')](function(_0x4b0819){if(_0x4b0819){return _0x4b0819[_0x7422('0x86')](null);}return null;})[_0x7422('0x20')](respondWithStatusCode(_0x3c2e7d,null))[_0x7422('0x58')](handleError(_0x3c2e7d,null));};exports[_0x7422('0x87')]=function(_0x387036,_0x455273,_0x109ece){return db[_0x7422('0x41')][_0x7422('0x63')]({'where':{'id':_0x387036['params']['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x455273,null))[_0x7422('0x20')](function(_0x2fcee9){if(_0x2fcee9){return _0x2fcee9[_0x7422('0x87')]();}return null;})[_0x7422('0x20')](respondWithResult(_0x455273,null))[_0x7422('0x58')](handleError(_0x455273,null));};exports[_0x7422('0x88')]=function(_0x1e1a85,_0xd36f7,_0x194612){if(_0x1e1a85[_0x7422('0x5d')]['id']){delete _0x1e1a85[_0x7422('0x5d')]['id'];}return db[_0x7422('0x41')]['find']({'where':{'id':_0x1e1a85['params']['id']}})[_0x7422('0x20')](handleEntityNotFound(_0xd36f7,null))[_0x7422('0x20')](function(_0x3ecb87){if(_0x3ecb87){_0x1e1a85[_0x7422('0x5d')][_0x7422('0x6d')]=_0x3ecb87['id'];return db[_0x7422('0x5b')]['create'](_0x1e1a85[_0x7422('0x5d')]);}})[_0x7422('0x20')](respondWithResult(_0xd36f7,null))[_0x7422('0x58')](handleError(_0xd36f7,null));};exports[_0x7422('0x89')]=function(_0x10a58e,_0x3b6f96,_0x394da5){return db['MailAccount'][_0x7422('0x63')]({'where':{'id':_0x10a58e[_0x7422('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b6f96,null))[_0x7422('0x20')](function(_0x3e1acc){if(_0x3e1acc){return _0x3e1acc['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3b6f96,null))[_0x7422('0x58')](handleError(_0x3b6f96,null));};exports[_0x7422('0x8a')]=function(_0x5d1c1b,_0x33b51d,_0x2c3ce0){return db['MailInteraction'][_0x7422('0x5c')]({'where':{'id':_0x5d1c1b[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x33b51d,null))[_0x7422('0x20')](function(_0x2ee967){if(_0x2ee967){return _0x2ee967[_0x7422('0x8a')](_0x5d1c1b[_0x7422('0x5d')][_0x7422('0x8b')],_[_0x7422('0x8c')](_0x5d1c1b[_0x7422('0x5d')],[_0x7422('0x8b'),'id'])||{});}})[_0x7422('0x20')](respondWithResult(_0x33b51d,null))['catch'](handleError(_0x33b51d,null));};exports[_0x7422('0x8d')]=function(_0x1a9529,_0x901734,_0x193515){var _0x1314b1={'raw':![],'where':{}};var _0x4e31cd={};var _0x513d26={'count':0x0,'rows':[]};return db[_0x7422('0x41')]['findOne']({'where':{'id':_0x1a9529[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x901734,null))[_0x7422('0x20')](function(_0x50e0b8){if(_0x50e0b8){_0x4e31cd[_0x7422('0x47')]=_[_0x7422('0x43')](db['MailInteraction'][_0x7422('0x42')]);_0x4e31cd[_0x7422('0x44')]=_['keys'](_0x1a9529[_0x7422('0x44')]);_0x4e31cd[_0x7422('0x45')]=_[_0x7422('0x46')](_0x4e31cd[_0x7422('0x47')],_0x4e31cd[_0x7422('0x44')]);_0x1314b1[_0x7422('0x48')]=_[_0x7422('0x46')](_0x4e31cd[_0x7422('0x47')],qs[_0x7422('0x49')](_0x1a9529[_0x7422('0x44')][_0x7422('0x49')]));_0x1314b1[_0x7422('0x48')]=_0x1314b1['attributes'][_0x7422('0x4a')]?_0x1314b1['attributes']:_0x4e31cd[_0x7422('0x47')];if(!_0x1a9529[_0x7422('0x44')][_0x7422('0x4b')](_0x7422('0x4c'))){_0x1314b1['limit']=qs[_0x7422('0x31')](_0x1a9529[_0x7422('0x44')][_0x7422('0x31')]);_0x1314b1['offset']=qs[_0x7422('0x30')](_0x1a9529[_0x7422('0x44')][_0x7422('0x30')]);}_0x1314b1['order']=qs[_0x7422('0x4d')](_0x1a9529['query'][_0x7422('0x4d')]);_0x1314b1[_0x7422('0x4e')]=qs[_0x7422('0x45')](_['pick'](_0x1a9529[_0x7422('0x44')],_0x4e31cd[_0x7422('0x45')]));_0x1314b1[_0x7422('0x4e')][_0x7422('0x6d')]=_0x50e0b8['id'];if(_0x1a9529[_0x7422('0x44')][_0x7422('0x4f')]){_0x1314b1['where']=_[_0x7422('0x50')](_0x1314b1[_0x7422('0x4e')],{'$or':_['map'](_0x1314b1[_0x7422('0x48')],function(_0x59f8b2){var _0x52b5d2={};_0x52b5d2[_0x59f8b2]={'$like':'%'+_0x1a9529['query']['filter']+'%'};return _0x52b5d2;})});}_0x1314b1=_[_0x7422('0x50')]({},_0x1314b1,_0x1a9529[_0x7422('0x55')]);return db[_0x7422('0x8e')][_0x7422('0x2f')]({'where':_0x1314b1[_0x7422('0x4e')]})[_0x7422('0x20')](function(_0x1408a7){_0x513d26[_0x7422('0x2f')]=_0x1408a7;if(_0x1a9529[_0x7422('0x44')][_0x7422('0x66')]){_0x1314b1['include']=[{'model':db[_0x7422('0x8f')],'as':_0x7422('0x90'),'required':![]},{'model':db[_0x7422('0x91')],'as':_0x7422('0x92'),'attributes':['name',_0x7422('0x93'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x7422('0x3b'),_0x7422('0x94')],'where':_0x1a9529[_0x7422('0x44')][_0x7422('0x95')]?{'id':_0x1a9529[_0x7422('0x44')][_0x7422('0x95')]}:undefined,'required':_0x1a9529[_0x7422('0x44')][_0x7422('0x95')]?!![]:![]}];}return db['MailInteraction'][_0x7422('0x57')](_0x1314b1);})[_0x7422('0x20')](function(_0x4d36c9){_0x513d26[_0x7422('0x67')]=_0x4d36c9;return _0x513d26;});}})[_0x7422('0x20')](respondWithFilteredResult(_0x901734,_0x1314b1))[_0x7422('0x58')](handleError(_0x901734,null));};exports[_0x7422('0x96')]=function(_0x1d685f,_0x4dcf48,_0x4f183f){return db[_0x7422('0x41')]['findOne']({'where':{'id':_0x1d685f[_0x7422('0x59')]['id']}})['then'](handleEntityNotFound(_0x4dcf48,null))[_0x7422('0x20')](function(_0x3ec919){if(_0x3ec919){return db[_0x7422('0x97')]['transaction'](function(_0x5ad816){return db[_0x7422('0x98')]['destroy']({'where':{'MailAccountId':_0x1d685f[_0x7422('0x59')]['id']},'transaction':_0x5ad816})[_0x7422('0x20')](function(_0x5318fe){var _0x52c404=_[_0x7422('0x65')](_0x1d685f[_0x7422('0x5d')],function(_0x3ed417){_0x3ed417[_0x7422('0x6d')]=_0x1d685f[_0x7422('0x59')]['id'];return _0x3ed417;});return db[_0x7422('0x98')][_0x7422('0x99')](_0x52c404,{'transaction':_0x5ad816});});})['then'](function(){return db[_0x7422('0x98')][_0x7422('0x9a')]({'where':{'MailAccountId':_0x1d685f[_0x7422('0x59')]['id']},'order':'priority'});});}})[_0x7422('0x20')](respondWithResult(_0x4dcf48,null))[_0x7422('0x58')](handleError(_0x4dcf48,null));};exports['getApplications']=function(_0x4b6a50,_0x15b9fe,_0x12d3eb){var _0x528959={};var _0x50ec04={};var _0x13488b;var _0x7fc193;return db['MailAccount']['findOne']({'where':{'id':_0x4b6a50[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x15b9fe,null))[_0x7422('0x20')](function(_0x8a8361){if(_0x8a8361){_0x13488b=_0x8a8361;_0x50ec04[_0x7422('0x47')]=_[_0x7422('0x43')](db[_0x7422('0x98')][_0x7422('0x42')]);_0x50ec04[_0x7422('0x44')]=_[_0x7422('0x43')](_0x4b6a50[_0x7422('0x44')]);_0x50ec04[_0x7422('0x45')]=_[_0x7422('0x46')](_0x50ec04[_0x7422('0x47')],_0x50ec04[_0x7422('0x44')]);_0x528959['attributes']=_[_0x7422('0x46')](_0x50ec04['model'],qs['fields'](_0x4b6a50[_0x7422('0x44')][_0x7422('0x49')]));_0x528959['attributes']=_0x528959[_0x7422('0x48')][_0x7422('0x4a')]?_0x528959[_0x7422('0x48')]:_0x50ec04[_0x7422('0x47')];_0x528959[_0x7422('0x64')]=qs[_0x7422('0x4d')](_0x4b6a50[_0x7422('0x44')][_0x7422('0x4d')]);_0x528959['where']=qs[_0x7422('0x45')](_[_0x7422('0x6c')](_0x4b6a50[_0x7422('0x44')],_0x50ec04['filters']));if(_0x4b6a50[_0x7422('0x44')][_0x7422('0x4f')]){_0x528959[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x528959['where'],{'$or':_[_0x7422('0x65')](_0x528959[_0x7422('0x48')],function(_0x55b348){var _0x17fcc0={};_0x17fcc0[_0x55b348]={'$like':'%'+_0x4b6a50[_0x7422('0x44')][_0x7422('0x4f')]+'%'};return _0x17fcc0;})});}_0x528959=_[_0x7422('0x50')]({},_0x528959,_0x4b6a50[_0x7422('0x55')]);return _0x13488b[_0x7422('0x9b')](_0x528959);}})[_0x7422('0x20')](function(_0x47b55a){if(_0x47b55a){_0x7fc193=_0x47b55a[_0x7422('0x4a')];if(!_0x4b6a50[_0x7422('0x44')][_0x7422('0x4b')](_0x7422('0x4c'))){_0x528959['limit']=qs[_0x7422('0x31')](_0x4b6a50[_0x7422('0x44')][_0x7422('0x31')]);_0x528959[_0x7422('0x30')]=qs[_0x7422('0x30')](_0x4b6a50[_0x7422('0x44')][_0x7422('0x30')]);}return _0x13488b['getApplications'](_0x528959);}})[_0x7422('0x20')](function(_0x401874){if(_0x401874){return _0x401874?{'count':_0x7fc193,'rows':_0x401874}:null;}})[_0x7422('0x20')](respondWithResult(_0x15b9fe,null))[_0x7422('0x58')](handleError(_0x15b9fe,null));};exports[_0x7422('0x9c')]=function(_0x3875bd,_0x295a24,_0x3129a5){var _0x5a9547={'raw':!![],'where':{}};var _0x268f5e={};var _0x22fb6b={'count':0x0,'rows':[]};return db['MailAccount'][_0x7422('0x63')]({'where':{'id':_0x3875bd[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x295a24,null))['then'](function(_0x15fd6a){if(_0x15fd6a){_0x268f5e[_0x7422('0x47')]=_[_0x7422('0x43')](db['MailMessage'][_0x7422('0x42')]);_0x268f5e['query']=_['keys'](_0x3875bd[_0x7422('0x44')]);_0x268f5e[_0x7422('0x45')]=_[_0x7422('0x46')](_0x268f5e[_0x7422('0x47')],_0x268f5e[_0x7422('0x44')]);_0x5a9547[_0x7422('0x48')]=_[_0x7422('0x46')](_0x268f5e['model'],qs['fields'](_0x3875bd[_0x7422('0x44')][_0x7422('0x49')]));_0x5a9547[_0x7422('0x48')]=_0x5a9547['attributes']['length']?_0x5a9547[_0x7422('0x48')]:_0x268f5e[_0x7422('0x47')];if(!_0x3875bd[_0x7422('0x44')][_0x7422('0x4b')](_0x7422('0x4c'))){_0x5a9547['limit']=qs[_0x7422('0x31')](_0x3875bd[_0x7422('0x44')][_0x7422('0x31')]);_0x5a9547[_0x7422('0x30')]=qs['offset'](_0x3875bd[_0x7422('0x44')][_0x7422('0x30')]);}_0x5a9547['order']=qs[_0x7422('0x4d')](_0x3875bd[_0x7422('0x44')][_0x7422('0x4d')]);_0x5a9547['where']=qs[_0x7422('0x45')](_[_0x7422('0x6c')](_0x3875bd[_0x7422('0x44')],_0x268f5e[_0x7422('0x45')]));_0x5a9547[_0x7422('0x4e')][_0x7422('0x6d')]=_0x15fd6a['id'];if(_0x3875bd[_0x7422('0x44')][_0x7422('0x4f')]){_0x5a9547[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x5a9547[_0x7422('0x4e')],{'$or':_['map'](_0x5a9547[_0x7422('0x48')],function(_0x27773c){var _0x233030={};_0x233030[_0x27773c]={'$like':'%'+_0x3875bd[_0x7422('0x44')]['filter']+'%'};return _0x233030;})});}if(_0x3875bd[_0x7422('0x44')][_0x7422('0x9d')]){var _0x39f39c=_0x3875bd[_0x7422('0x44')][_0x7422('0x9d')][_0x7422('0x9e')](',');var _0x9cd86f={};_0x9cd86f[_0x39f39c[0x0]]={'$gte':moment(_0x39f39c[0x1])[_0x7422('0x9f')](_0x7422('0xa0'))};_0x5a9547[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x5a9547[_0x7422('0x4e')],_0x9cd86f);}_0x5a9547=_['merge']({},_0x5a9547,_0x3875bd[_0x7422('0x55')]);return db[_0x7422('0xa1')][_0x7422('0x2f')]({'where':_0x5a9547['where']})['then'](function(_0x1ba722){_0x22fb6b[_0x7422('0x2f')]=_0x1ba722;if(_0x3875bd['query']['includeAll']){_0x5a9547[_0x7422('0x56')]=[{'all':!![]}];}return db[_0x7422('0xa1')][_0x7422('0x57')](_0x5a9547);})[_0x7422('0x20')](function(_0x2b7013){_0x22fb6b[_0x7422('0x67')]=_0x2b7013;return _0x22fb6b;});}})[_0x7422('0x20')](respondWithFilteredResult(_0x295a24,_0x5a9547))[_0x7422('0x58')](handleError(_0x295a24,null));};exports['send']=function(_0xe74606,_0x90aa1e,_0x42cdb8){var _0x8d9d08,_0x588716={},_0x3abc56;if(_0xe74606['body']['to']){_0x3abc56=_0xe74606[_0x7422('0x5d')]['to'][_0x7422('0x9e')](',')[0x0];}return db['MailAccount'][_0x7422('0x5c')]({'where':{'id':_0xe74606[_0x7422('0x59')]['id']},'include':[{'model':db[_0x7422('0xa2')],'as':_0x7422('0xa3'),'include':[{'model':db[_0x7422('0x8f')],'as':_0x7422('0xa4'),'where':{'email':_0x3abc56},'limit':0x1,'order':[[_0x7422('0xa5'),_0x7422('0xa6')]]}]},{'model':db[_0x7422('0x5b')],'as':_0x7422('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x90aa1e,null))[_0x7422('0x20')](function(_0x44f73b){if(_0x44f73b){_0x8d9d08=_0x44f73b;if(_0x44f73b[_0x7422('0x3e')]){if(_[_0x7422('0x71')](_0xe74606[_0x7422('0x5d')][_0x7422('0xa7')])){_0xe74606['body'][_0x7422('0xa7')]=util['format'](_0x7422('0xa8'),_0x44f73b[_0x7422('0x3b')],_0x44f73b[_0x7422('0x6f')]||_0x44f73b[_0x7422('0x3e')][_0x7422('0x7d')]);}if(_0xe74606[_0x7422('0x5d')][_0x7422('0xa9')]&&_0xe74606[_0x7422('0x5d')][_0x7422('0xa9')][_0x7422('0x4a')]){for(var _0x478fca=0x0;_0x478fca<_0xe74606[_0x7422('0x5d')]['attachments']['length'];_0x478fca+=0x1){_0xe74606[_0x7422('0x5d')][_0x7422('0xa9')][_0x478fca]={'filename':_0xe74606[_0x7422('0x5d')]['attachments'][_0x478fca][_0x7422('0x3b')],'path':path[_0x7422('0xaa')](config[_0x7422('0xab')],'server/files/attachments',_0xe74606['body'][_0x7422('0xa9')][_0x478fca][_0x7422('0xac')])};}}var _0x1e2602={'tls':{'rejectUnauthorized':![]}};if(_[_0x7422('0x71')](_0x44f73b[_0x7422('0x3e')][_0x7422('0x7a')])){if(_0x44f73b[_0x7422('0x3e')][_0x7422('0x77')]){_0x1e2602[_0x7422('0xad')]={'user':_0x44f73b[_0x7422('0x3e')][_0x7422('0x7d')],'pass':_0x44f73b[_0x7422('0x3e')][_0x7422('0x76')]};}_0x1e2602['host']=_0x44f73b[_0x7422('0x3e')][_0x7422('0x78')];_0x1e2602[_0x7422('0x79')]=_0x44f73b['Smtp'][_0x7422('0x79')];_0x1e2602[_0x7422('0xae')]=_0x44f73b['Smtp'][_0x7422('0xae')];}else{_0x1e2602[_0x7422('0x7a')]=_0x44f73b['Smtp'][_0x7422('0x7a')];_0x1e2602[_0x7422('0xad')]={'user':_0x44f73b[_0x7422('0x3e')][_0x7422('0x7d')],'pass':_0x44f73b[_0x7422('0x3e')][_0x7422('0x76')]};}return respondWithRpcPromise('SendMail',_0x7422('0xaf'),{'account':_0x1e2602,'message':_0xe74606[_0x7422('0x5d')]});}else{throw new Error(_0x7422('0xb0'));}}})['then'](function(_0x1f612a){if(_0x1f612a){_0x588716=_0x1f612a;if(_0x8d9d08[_0x7422('0xa3')]){if(_0x8d9d08[_0x7422('0xa3')]['Contacts'][_0x7422('0x4a')]){return _0x8d9d08['List'][_0x7422('0xa4')][0x0];}else{return db[_0x7422('0x8f')][_0x7422('0x61')](_[_0x7422('0x17')](_0xe74606[_0x7422('0x5d')],{'firstName':_0xe74606[_0x7422('0x5d')]['to'],'email':_0xe74606['body']['to'],'phone':_0xe74606[_0x7422('0x5d')]['to'],'ListId':_0x8d9d08['ListId']}));}}else{throw new Error(_0x7422('0xb0'));}}})[_0x7422('0x20')](function(_0xd10c93){if(_0xd10c93){var _0x45883a={'UserId':_0xe74606[_0x7422('0x7d')]['id'],'ContactId':_0xd10c93['id'],'MailAccountId':_0x8d9d08['id'],'inReplyTo':_0x588716['messageId'],'to':_0xe74606[_0x7422('0x5d')][_0x7422('0xa7')],'cc':_0xe74606['body']['cc'],'subject':_0xe74606[_0x7422('0x5d')][_0x7422('0xb1')],'attach':_0xe74606['body']['attach'],'firstMsgDirection':_0x7422('0xb2'),'lastMsgAt':moment()[_0x7422('0x9f')](_0x7422('0xa0')),'lastMsgDirection':_0x7422('0xb2'),'lastMsgBody':_0xe74606[_0x7422('0x5d')]['body'],'Messages':[_[_0x7422('0x50')](_0xe74606[_0x7422('0x5d')],{'messageId':_0x588716[_0x7422('0xb3')],'sentAt':moment()[_0x7422('0x9f')](_0x7422('0xa0')),'read':!![],'MailAccountId':_0x8d9d08['id'],'UserId':_0xe74606[_0x7422('0x7d')]['id'],'ContactId':_0xd10c93['id']})]};if(_0xe74606[_0x7422('0x5d')][_0x7422('0xb4')]){_0x45883a=_[_0x7422('0x50')](_0x45883a,_0xe74606[_0x7422('0x5d')][_0x7422('0xb4')]);}return db[_0x7422('0x8e')][_0x7422('0x61')](_0x45883a,{'include':[{'model':db['MailMessage'],'as':_0x7422('0xb5')}]});}})[_0x7422('0x20')](respondWithResult(_0x90aa1e,null))[_0x7422('0x58')](handleError(_0x90aa1e,null));};exports[_0x7422('0xb6')]=function(_0x17a277,_0x1bf84f,_0x1c6231){return db[_0x7422('0x41')]['find']({'where':{'id':_0x17a277[_0x7422('0x59')]['id']},'include':[{'model':db[_0x7422('0x5b')],'as':_0x7422('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1bf84f,null))[_0x7422('0x20')](function(_0x339cc8){if(_0x339cc8&&_0x339cc8[_0x7422('0x3e')]){var _0x186567={'id':_0x339cc8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x339cc8[_0x7422('0x3e')][_0x7422('0x7a')]){_0x186567[_0x7422('0x7a')]=_0x339cc8[_0x7422('0x3e')][_0x7422('0x7a')];}else{_0x186567[_0x7422('0x78')]=_0x339cc8[_0x7422('0x3e')][_0x7422('0x78')];_0x186567[_0x7422('0x79')]=_0x339cc8[_0x7422('0x3e')]['port'];_0x186567['secure']=_0x339cc8[_0x7422('0x3e')][_0x7422('0xae')];}if(_0x339cc8[_0x7422('0x3e')][_0x7422('0x77')]){_0x186567[_0x7422('0xad')]={'user':_0x339cc8['Smtp'][_0x7422('0x7d')],'pass':_0x339cc8['Smtp'][_0x7422('0x76')]};}return respondWithRpcPromise(_0x7422('0xb7'),_0x7422('0xb6'),{'account':_0x186567});}})[_0x7422('0x20')](respondWithResult(_0x1bf84f,null))[_0x7422('0x58')](handleError(_0x1bf84f,null));};exports[_0x7422('0x39')]=function(_0x49e40d,_0x4cbc57){return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x49e40d[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x4cbc57,null))[_0x7422('0x20')](function(_0x3010fc){if(_0x3010fc&&_0x3010fc['service']){throw new db[(_0x7422('0xb8'))][(_0x7422('0xb9'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3010fc;})[_0x7422('0x20')](removeEntity(_0x4cbc57,null))['catch'](handleError(_0x4cbc57,null));};exports['addAgents']=function(_0x47edce,_0x5350b3,_0x451a20){return db[_0x7422('0x41')][_0x7422('0x5c')]({'where':{'id':_0x47edce[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x5350b3,null))['then'](function(_0x5829db){if(_0x5829db){return _0x5829db[_0x7422('0xba')](_0x47edce[_0x7422('0x5d')][_0x7422('0x8b')],_['omit'](_0x47edce[_0x7422('0x5d')],[_0x7422('0x8b'),'id'])||{})[_0x7422('0xbb')](function(_0x1e9364){for(var _0x59bfb8=0x0;_0x59bfb8<_0x47edce[_0x7422('0x5d')][_0x7422('0x8b')]['length'];_0x59bfb8+=0x1){socket[_0x7422('0xbc')](_0x7422('0xbd'),{'UserId':_0x47edce[_0x7422('0x5d')][_0x7422('0x8b')][_0x59bfb8],'MailAccountId':_0x47edce[_0x7422('0x59')]['id']});}return _0x1e9364;});}})['then'](respondWithResult(_0x5350b3,null))[_0x7422('0x58')](handleError(_0x5350b3,null));};exports[_0x7422('0xbe')]=function(_0x3aea63,_0x5d0841,_0x4138fc){return db[_0x7422('0x41')]['find']({'where':{'id':_0x3aea63[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x5d0841,null))['then'](function(_0x5d883e){if(_0x5d883e){return _0x5d883e[_0x7422('0xbe')](_0x3aea63[_0x7422('0x44')]['ids'])[_0x7422('0x20')](function(){if(_[_0x7422('0xbf')](_0x3aea63['query'][_0x7422('0x8b')])){for(var _0x11f042=0x0;_0x11f042<_0x3aea63['query'][_0x7422('0x8b')][_0x7422('0x4a')];_0x11f042+=0x1){socket[_0x7422('0xbc')](_0x7422('0xc0'),{'UserId':Number(_0x3aea63[_0x7422('0x44')][_0x7422('0x8b')][_0x11f042]),'MailAccountId':Number(_0x3aea63[_0x7422('0x59')]['id'])});}}else{socket[_0x7422('0xbc')](_0x7422('0xc0'),{'UserId':Number(_0x3aea63[_0x7422('0x44')]['ids']),'MailAccountId':Number(_0x3aea63[_0x7422('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d0841,null))[_0x7422('0x58')](handleError(_0x5d0841,null));};exports[_0x7422('0xc1')]=function(_0x2b2750,_0x52b6af,_0x3fb395){var _0x83c779={};var _0x4d95d2={};var _0x332036;var _0x505f5a;return db[_0x7422('0x41')]['findOne']({'where':{'id':_0x2b2750[_0x7422('0x59')]['id']}})[_0x7422('0x20')](handleEntityNotFound(_0x52b6af,null))[_0x7422('0x20')](function(_0x5e8e44){if(_0x5e8e44){_0x332036=_0x5e8e44;_0x4d95d2[_0x7422('0x47')]=_[_0x7422('0x43')](db[_0x7422('0x91')]['rawAttributes']);_0x4d95d2[_0x7422('0x44')]=_['keys'](_0x2b2750['query']);_0x4d95d2[_0x7422('0x45')]=_[_0x7422('0x46')](_0x4d95d2[_0x7422('0x47')],_0x4d95d2['query']);_0x83c779[_0x7422('0x48')]=_[_0x7422('0x46')](_0x4d95d2[_0x7422('0x47')],qs[_0x7422('0x49')](_0x2b2750[_0x7422('0x44')][_0x7422('0x49')]));_0x83c779[_0x7422('0x48')]=_0x83c779[_0x7422('0x48')][_0x7422('0x4a')]?_0x83c779[_0x7422('0x48')]:_0x4d95d2[_0x7422('0x47')];_0x83c779[_0x7422('0x64')]=qs['sort'](_0x2b2750['query']['sort']);_0x83c779[_0x7422('0x4e')]=qs[_0x7422('0x45')](_['pick'](_0x2b2750[_0x7422('0x44')],_0x4d95d2[_0x7422('0x45')]));if(_0x2b2750['query'][_0x7422('0x4f')]){_0x83c779[_0x7422('0x4e')]=_[_0x7422('0x50')](_0x83c779[_0x7422('0x4e')],{'$or':_[_0x7422('0x65')](_0x83c779[_0x7422('0x48')],function(_0x761674){var _0x5e29c9={};_0x5e29c9[_0x761674]={'$like':'%'+_0x2b2750[_0x7422('0x44')]['filter']+'%'};return _0x5e29c9;})});}_0x83c779=_[_0x7422('0x50')]({},_0x83c779,_0x2b2750[_0x7422('0x55')]);return _0x332036['getAgents'](_0x83c779);}})[_0x7422('0x20')](function(_0x4df252){if(_0x4df252){_0x505f5a=_0x4df252[_0x7422('0x4a')];if(!_0x2b2750['query'][_0x7422('0x4b')](_0x7422('0x4c'))){_0x83c779[_0x7422('0x31')]=qs['limit'](_0x2b2750['query']['limit']);_0x83c779[_0x7422('0x30')]=qs[_0x7422('0x30')](_0x2b2750[_0x7422('0x44')][_0x7422('0x30')]);}return _0x332036[_0x7422('0xc1')](_0x83c779);}})[_0x7422('0x20')](function(_0x769968){if(_0x769968){return _0x769968?{'count':_0x505f5a,'rows':_0x769968}:null;}})[_0x7422('0x20')](respondWithResult(_0x52b6af,null))[_0x7422('0x58')](handleError(_0x52b6af,null));}; \ No newline at end of file +var _0xa47d=['getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','service','authentication','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','end','count','offset','limit','status','set','apply','reject','save','update','destroy','get','MailAccounts','sendStatus','stack','name','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','key','VIRTUAL','field','includeAll','include','rows','show','params','Imap','merge','options','body','find','MailServerOut','describe','MailAccountId','Disposition','create','getDispositions','findOne','map','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','ListId','active','isNil','cservice','cauthentication','user','password','pass','cpassword','port','host','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','hasOwnProperty','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','MailApplication','bulkCreate','priority','getApplications'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa47d,0xe7));var _0xda47=function(_0x20e913,_0x3da54f){_0x20e913=_0x20e913-0x0;var _0x7ebc8e=_0xa47d[_0x20e913];return _0x7ebc8e;};'use strict';var pdf=require(_0xda47('0x0'));var emlformat=require(_0xda47('0x1'));var rimraf=require(_0xda47('0x2'));var zipdir=require(_0xda47('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda47('0x4'));var moment=require(_0xda47('0x5'));var BPromise=require(_0xda47('0x6'));var Mustache=require(_0xda47('0x7'));var util=require(_0xda47('0x8'));var path=require('path');var sox=require(_0xda47('0x9'));var csv=require(_0xda47('0xa'));var ejs=require(_0xda47('0xb'));var fs=require('fs');var _=require(_0xda47('0xc'));var squel=require(_0xda47('0xd'));var crypto=require('crypto');var jsforce=require(_0xda47('0xe'));var deskjs=require(_0xda47('0xf'));var toCsv=require(_0xda47('0xa'));var querystring=require(_0xda47('0x10'));var Papa=require(_0xda47('0x11'));var Redis=require('ioredis');var authService=require(_0xda47('0x12'));var qs=require(_0xda47('0x13'));var hardwareService=require(_0xda47('0x14'));var logger=require('../../config/logger')(_0xda47('0x15'));var utils=require(_0xda47('0x16'));var config=require(_0xda47('0x17'));var db=require(_0xda47('0x18'))['db'];config['redis']=_[_0xda47('0x19')](config[_0xda47('0x1a')],{'host':_0xda47('0x1b'),'port':0x18eb});var socket=require(_0xda47('0x1c'))(new Redis(config[_0xda47('0x1a')]));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xda47('0x1d')]['http']({'port':0x232b});function checkPasswordPattern(_0x2d9396,_0x312756,_0x1103bc){if(_0x1103bc){var _0x585cf6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x585cf6[_0xda47('0x1e')](_0x312756)){return _0x2d9396;}else{throw new Error(_0xda47('0x1f'));}}else{return _0x2d9396;}}function respondWithRpcPromise(_0x2eb4b5,_0x5c31fa,_0x442aec,_0x467b43){return new BPromise(function(_0x500d15,_0x37c2b0){var _0x5da4d7=_0x467b43||client;return _0x5da4d7[_0xda47('0x20')](_0x2eb4b5,_0x442aec)[_0xda47('0x21')](function(_0x518c89){logger[_0xda47('0x22')](_0xda47('0x23'),_0x5c31fa,'request\x20sent');logger[_0xda47('0x24')](_0xda47('0x25'),_0x5c31fa,_0xda47('0x26'),JSON['stringify'](_0x518c89));if(_0x518c89[_0xda47('0x27')]){if(_0x518c89[_0xda47('0x27')][_0xda47('0x28')]===0x1f4){logger['error'](_0xda47('0x23'),_0x5c31fa,_0x518c89['error'][_0xda47('0x29')]);return _0x37c2b0(_0x518c89[_0xda47('0x27')][_0xda47('0x29')]);}logger[_0xda47('0x27')](_0xda47('0x23'),_0x5c31fa,_0x518c89[_0xda47('0x27')][_0xda47('0x29')]);return _0x500d15(_0x518c89[_0xda47('0x27')][_0xda47('0x29')]);}else{logger[_0xda47('0x22')](_0xda47('0x23'),_0x5c31fa,_0xda47('0x26'));_0x500d15(_0x518c89['result'][_0xda47('0x29')]);}})[_0xda47('0x2a')](function(_0x13106b){logger[_0xda47('0x27')](_0xda47('0x23'),_0x5c31fa,_0x13106b);_0x37c2b0(_0x13106b);});});}function respondWithStatusCode(_0x49359f,_0x358608){_0x358608=_0x358608||0xcc;return function(_0x5e58e7){if(_0x5e58e7){return _0x49359f['sendStatus'](_0x358608);}return _0x49359f['status'](_0x358608)[_0xda47('0x2b')]();};}function respondWithResult(_0x218cec,_0x57fad7){_0x57fad7=_0x57fad7||0xc8;return function(_0x3b33b6){if(_0x3b33b6){return _0x218cec['status'](_0x57fad7)['json'](_0x3b33b6);}};}function respondWithFilteredResult(_0x8d1885,_0x7f1f70){return function(_0x2f760e){if(_0x2f760e){var _0xbea648=_0x2f760e[_0xda47('0x2c')],_0x2c6edc=_0x7f1f70['offset'],_0x30c759=_0x7f1f70[_0xda47('0x2d')]+_0x7f1f70[_0xda47('0x2e')],_0x2750d5;if(_0x30c759>=_0xbea648){_0x30c759=_0xbea648;_0x2750d5=0xc8;}else{_0x2750d5=0xce;}_0x8d1885[_0xda47('0x2f')](_0x2750d5);return _0x8d1885[_0xda47('0x30')]('Content-Range',_0x2c6edc+'-'+_0x30c759+'/'+_0xbea648)['json'](_0x2f760e);}return null;};}function patchUpdates(_0xeec800){return function(_0x5eea02){try{jsonpatch[_0xda47('0x31')](_0x5eea02,_0xeec800,!![]);}catch(_0x42840b){return BPromise[_0xda47('0x32')](_0x42840b);}return _0x5eea02[_0xda47('0x33')]();};}function saveUpdates(_0x135f4d,_0x2bdbfe){return function(_0x1a79a9){if(_0x1a79a9){return _0x1a79a9[_0xda47('0x34')](_0x135f4d)['then'](function(_0x38a447){return _0x38a447;});}return null;};}function removeEntity(_0x4a790d,_0xfcf4cf){return function(_0x479def){if(_0x479def){return _0x479def[_0xda47('0x35')]()[_0xda47('0x21')](function(){var _0x4e4777=_0x479def[_0xda47('0x36')]({'plain':!![]});var _0x21718e=_0xda47('0x37');return db['UserProfileResource'][_0xda47('0x35')]({'where':{'type':_0x21718e,'resourceId':_0x4e4777['id']}})[_0xda47('0x21')](function(){return _0x479def;});})[_0xda47('0x21')](function(){_0x4a790d['status'](0xcc)[_0xda47('0x2b')]();});}};}function handleEntityNotFound(_0x14bfdf,_0x2d8885){return function(_0x551e33){if(!_0x551e33){_0x14bfdf[_0xda47('0x38')](0x194);}return _0x551e33;};}function handleError(_0x598cd7,_0x457637){_0x457637=_0x457637||0x1f4;return function(_0x522338){logger[_0xda47('0x27')](_0x522338[_0xda47('0x39')]);if(_0x522338[_0xda47('0x3a')]){delete _0x522338[_0xda47('0x3a')];}_0x598cd7[_0xda47('0x2f')](_0x457637)['send'](_0x522338);};}exports[_0xda47('0x3b')]=function(_0x42eb6c,_0x3e6483){var _0xfd02fc={'include':[{'model':db[_0xda47('0x3c')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xda47('0x3d')},{'model':db[_0xda47('0x3e')],'as':_0xda47('0x3f')}]},_0x3a5fbb={},_0x125ed4={'count':0x0,'rows':[]};var _0x33b228=db[_0xda47('0x40')][_0xda47('0x41')];_0x3a5fbb[_0xda47('0x42')]=_[_0xda47('0x43')](_0x33b228);_0x3a5fbb[_0xda47('0x44')]=_[_0xda47('0x43')](_0x42eb6c[_0xda47('0x44')]);_0x3a5fbb[_0xda47('0x45')]=_['intersection'](_0x3a5fbb[_0xda47('0x42')],_0x3a5fbb[_0xda47('0x44')]);_0xfd02fc['attributes']=_[_0xda47('0x46')](_0x3a5fbb[_0xda47('0x42')],qs[_0xda47('0x47')](_0x42eb6c[_0xda47('0x44')][_0xda47('0x47')]));_0xfd02fc[_0xda47('0x48')]=_0xfd02fc['attributes'][_0xda47('0x49')]?_0xfd02fc['attributes']:_0x3a5fbb[_0xda47('0x42')];if(!_0x42eb6c[_0xda47('0x44')]['hasOwnProperty'](_0xda47('0x4a'))){_0xfd02fc['limit']=qs['limit'](_0x42eb6c[_0xda47('0x44')]['limit']);_0xfd02fc[_0xda47('0x2d')]=qs[_0xda47('0x2d')](_0x42eb6c['query'][_0xda47('0x2d')]);}_0xfd02fc[_0xda47('0x4b')]=qs[_0xda47('0x4c')](_0x42eb6c[_0xda47('0x44')][_0xda47('0x4c')]);_0xfd02fc[_0xda47('0x4d')]=qs[_0xda47('0x45')](_[_0xda47('0x4e')](_0x42eb6c['query'],_0x3a5fbb[_0xda47('0x45')]));if(_0x42eb6c[_0xda47('0x44')][_0xda47('0x4f')]){_0xfd02fc[_0xda47('0x4d')]=_['merge'](_0xfd02fc['where'],{'$or':_['map'](_0x33b228,function(_0x5b089e){if(_0x5b089e['type'][_0xda47('0x50')]!==_0xda47('0x51')){var _0x3f7072={};_0x3f7072[_0x5b089e[_0xda47('0x52')]]={'$like':'%'+_0x42eb6c[_0xda47('0x44')][_0xda47('0x4f')]+'%'};return _0x3f7072;}})});}_0xfd02fc=_['merge']({},_0xfd02fc,_0x42eb6c['options']);var _0x520da8={'where':_0xfd02fc[_0xda47('0x4d')]};return db[_0xda47('0x40')][_0xda47('0x2c')](_0x520da8)[_0xda47('0x21')](function(_0x54be50){_0x125ed4[_0xda47('0x2c')]=_0x54be50;if(_0x42eb6c[_0xda47('0x44')][_0xda47('0x53')]){_0xfd02fc[_0xda47('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0xfd02fc);})[_0xda47('0x21')](function(_0x157155){_0x125ed4[_0xda47('0x55')]=_0x157155;return _0x125ed4;})['then'](respondWithFilteredResult(_0x3e6483,_0xfd02fc))[_0xda47('0x2a')](handleError(_0x3e6483,null));};exports[_0xda47('0x56')]=function(_0x140117,_0x2ee7d9){var _0x2b5569={'raw':![],'where':{'id':_0x140117[_0xda47('0x57')]['id']},'include':[{'model':db[_0xda47('0x3c')],'as':_0xda47('0x58')},{'model':db['MailServerOut'],'as':_0xda47('0x3d')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1a13da={};_0x1a13da[_0xda47('0x42')]=_[_0xda47('0x43')](db[_0xda47('0x40')]['rawAttributes']);_0x1a13da[_0xda47('0x44')]=_[_0xda47('0x43')](_0x140117[_0xda47('0x44')]);_0x1a13da[_0xda47('0x45')]=_[_0xda47('0x46')](_0x1a13da[_0xda47('0x42')],_0x1a13da[_0xda47('0x44')]);_0x2b5569[_0xda47('0x48')]=_[_0xda47('0x46')](_0x1a13da[_0xda47('0x42')],qs['fields'](_0x140117[_0xda47('0x44')]['fields']));_0x2b5569['attributes']=_0x2b5569[_0xda47('0x48')][_0xda47('0x49')]?_0x2b5569[_0xda47('0x48')]:_0x1a13da[_0xda47('0x42')];if(_0x140117[_0xda47('0x44')][_0xda47('0x53')]){_0x2b5569[_0xda47('0x54')]=[{'all':!![]}];}_0x2b5569=_[_0xda47('0x59')]({},_0x2b5569,_0x140117[_0xda47('0x5a')]);return db[_0xda47('0x40')]['find'](_0x2b5569)[_0xda47('0x21')](handleEntityNotFound(_0x2ee7d9,null))['then'](respondWithResult(_0x2ee7d9,null))['catch'](handleError(_0x2ee7d9,null));};exports[_0xda47('0x34')]=function(_0x44fc86,_0x348043){if(_0x44fc86[_0xda47('0x5b')]['id']){delete _0x44fc86[_0xda47('0x5b')]['id'];}return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x44fc86[_0xda47('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xda47('0x58')},{'model':db[_0xda47('0x5d')],'as':_0xda47('0x3d')},{'model':db[_0xda47('0x3e')],'as':_0xda47('0x3f')}]})[_0xda47('0x21')](handleEntityNotFound(_0x348043,null))[_0xda47('0x21')](saveUpdates(_0x44fc86['body'],null))[_0xda47('0x21')](function(_0x236437){if(_0x236437&&_0x44fc86[_0xda47('0x5b')][_0xda47('0x58')]){return db[_0xda47('0x3c')][_0xda47('0x34')](_0x44fc86['body'][_0xda47('0x58')],{'where':{'MailAccountId':_0x236437['id']}})[_0xda47('0x21')](function(){return _0x236437;});}return _0x236437;})[_0xda47('0x21')](function(_0x111d85){if(_0x111d85&&_0x44fc86['body']['Smtp']){return db[_0xda47('0x5d')]['update'](_0x44fc86[_0xda47('0x5b')]['Smtp'],{'where':{'MailAccountId':_0x111d85['id']}})[_0xda47('0x21')](function(){return _0x111d85;});}return _0x111d85;})[_0xda47('0x21')](respondWithResult(_0x348043,null))[_0xda47('0x2a')](handleError(_0x348043,null));};exports[_0xda47('0x5e')]=function(_0x4531c6,_0x50ce0e){return db['MailAccount'][_0xda47('0x5e')]()['then'](respondWithResult(_0x50ce0e,null))[_0xda47('0x2a')](handleError(_0x50ce0e,null));};exports['addDisposition']=function(_0x2daf39,_0x247688,_0xdc6761){if(_0x2daf39[_0xda47('0x5b')]['id']){delete _0x2daf39[_0xda47('0x5b')]['id'];}return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x2daf39[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x247688,null))['then'](function(_0x25c69b){if(_0x25c69b){_0x2daf39[_0xda47('0x5b')][_0xda47('0x5f')]=_0x25c69b['id'];return db[_0xda47('0x60')][_0xda47('0x61')](_0x2daf39[_0xda47('0x5b')]);}})['then'](respondWithResult(_0x247688,null))[_0xda47('0x2a')](handleError(_0x247688,null));};exports[_0xda47('0x62')]=function(_0x4b9e61,_0x16daee,_0x5c6c31){var _0x1db55c={'raw':![],'where':{}};var _0x144985={};var _0x35457a={'count':0x0,'rows':[]};return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x4b9e61['params']['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x16daee,null))[_0xda47('0x21')](function(_0x5126f6){if(_0x5126f6){_0x144985[_0xda47('0x42')]=_[_0xda47('0x43')](db[_0xda47('0x60')]['rawAttributes']);_0x144985[_0xda47('0x44')]=_[_0xda47('0x43')](_0x4b9e61[_0xda47('0x44')]);_0x144985['filters']=_[_0xda47('0x46')](_0x144985[_0xda47('0x42')],_0x144985['query']);_0x1db55c[_0xda47('0x48')]=_['intersection'](_0x144985[_0xda47('0x42')],qs['fields'](_0x4b9e61['query'][_0xda47('0x47')]));_0x1db55c[_0xda47('0x48')]=_0x1db55c[_0xda47('0x48')][_0xda47('0x49')]?_0x1db55c[_0xda47('0x48')]:_0x144985[_0xda47('0x42')];if(!_0x4b9e61[_0xda47('0x44')]['hasOwnProperty'](_0xda47('0x4a'))){_0x1db55c[_0xda47('0x2e')]=qs['limit'](_0x4b9e61[_0xda47('0x44')][_0xda47('0x2e')]);_0x1db55c['offset']=qs[_0xda47('0x2d')](_0x4b9e61[_0xda47('0x44')]['offset']);}_0x1db55c[_0xda47('0x4b')]=qs[_0xda47('0x4c')](_0x4b9e61[_0xda47('0x44')][_0xda47('0x4c')]);_0x1db55c[_0xda47('0x4d')]=qs[_0xda47('0x45')](_[_0xda47('0x4e')](_0x4b9e61[_0xda47('0x44')],_0x144985['filters']));_0x1db55c[_0xda47('0x4d')][_0xda47('0x5f')]=_0x5126f6['id'];if(_0x4b9e61[_0xda47('0x44')][_0xda47('0x4f')]){_0x1db55c[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x1db55c[_0xda47('0x4d')],{'$or':_[_0xda47('0x64')](_0x1db55c[_0xda47('0x48')],function(_0x411053){var _0x24a42f={};_0x24a42f[_0x411053]={'$like':'%'+_0x4b9e61[_0xda47('0x44')][_0xda47('0x4f')]+'%'};return _0x24a42f;})});}_0x1db55c=_[_0xda47('0x59')]({},_0x1db55c,_0x4b9e61[_0xda47('0x5a')]);return db[_0xda47('0x60')][_0xda47('0x2c')]({'where':_0x1db55c['where']})[_0xda47('0x21')](function(_0x32bca1){_0x35457a[_0xda47('0x2c')]=_0x32bca1;if(_0x4b9e61['query'][_0xda47('0x53')]){_0x1db55c[_0xda47('0x54')]=[{'all':!![]}];}return db[_0xda47('0x60')][_0xda47('0x65')](_0x1db55c);})['then'](function(_0xcdb44b){_0x35457a[_0xda47('0x55')]=_0xcdb44b;return _0x35457a;});}})[_0xda47('0x21')](respondWithFilteredResult(_0x16daee,_0x1db55c))[_0xda47('0x2a')](handleError(_0x16daee,null));};exports['removeDispositions']=function(_0x10ee1,_0x104a35,_0x17c7ff){return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x10ee1[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x104a35,null))[_0xda47('0x21')](function(_0xd710ba){if(_0xd710ba){return _0xd710ba[_0xda47('0x66')](_0x10ee1[_0xda47('0x44')][_0xda47('0x67')]);}})['then'](respondWithStatusCode(_0x104a35,null))[_0xda47('0x2a')](handleError(_0x104a35,null));};exports[_0xda47('0x68')]=function(_0x6f89ba,_0x1d0def,_0x5342a4){if(_0x6f89ba['body']['id']){delete _0x6f89ba[_0xda47('0x5b')]['id'];}return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x6f89ba[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x1d0def,null))[_0xda47('0x21')](function(_0x4a907c){if(_0x4a907c){_0x6f89ba[_0xda47('0x5b')][_0xda47('0x5f')]=_0x4a907c['id'];return db['CannedAnswer']['create'](_0x6f89ba[_0xda47('0x5b')]);}})['then'](respondWithResult(_0x1d0def,null))[_0xda47('0x2a')](handleError(_0x1d0def,null));};exports['getAnswers']=function(_0x493dc0,_0x5a616b,_0x2a3c53){var _0x4360b0={'raw':![],'where':{}};var _0x259fb7={};var _0x14ef5a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x493dc0[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x5a616b,null))[_0xda47('0x21')](function(_0x548fa2){if(_0x548fa2){_0x259fb7[_0xda47('0x42')]=_[_0xda47('0x43')](db[_0xda47('0x69')][_0xda47('0x41')]);_0x259fb7['query']=_['keys'](_0x493dc0[_0xda47('0x44')]);_0x259fb7[_0xda47('0x45')]=_[_0xda47('0x46')](_0x259fb7[_0xda47('0x42')],_0x259fb7['query']);_0x4360b0[_0xda47('0x48')]=_[_0xda47('0x46')](_0x259fb7['model'],qs[_0xda47('0x47')](_0x493dc0[_0xda47('0x44')][_0xda47('0x47')]));_0x4360b0[_0xda47('0x48')]=_0x4360b0['attributes'][_0xda47('0x49')]?_0x4360b0['attributes']:_0x259fb7[_0xda47('0x42')];if(!_0x493dc0['query']['hasOwnProperty'](_0xda47('0x4a'))){_0x4360b0[_0xda47('0x2e')]=qs[_0xda47('0x2e')](_0x493dc0[_0xda47('0x44')]['limit']);_0x4360b0[_0xda47('0x2d')]=qs[_0xda47('0x2d')](_0x493dc0[_0xda47('0x44')][_0xda47('0x2d')]);}_0x4360b0[_0xda47('0x4b')]=qs[_0xda47('0x4c')](_0x493dc0['query'][_0xda47('0x4c')]);_0x4360b0[_0xda47('0x4d')]=qs[_0xda47('0x45')](_[_0xda47('0x4e')](_0x493dc0[_0xda47('0x44')],_0x259fb7['filters']));_0x4360b0[_0xda47('0x4d')]['MailAccountId']=_0x548fa2['id'];if(_0x493dc0[_0xda47('0x44')][_0xda47('0x4f')]){_0x4360b0[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x4360b0[_0xda47('0x4d')],{'$or':_[_0xda47('0x64')](_0x4360b0[_0xda47('0x48')],function(_0x3c74ed){var _0x51da7b={};_0x51da7b[_0x3c74ed]={'$like':'%'+_0x493dc0[_0xda47('0x44')][_0xda47('0x4f')]+'%'};return _0x51da7b;})});}_0x4360b0=_[_0xda47('0x59')]({},_0x4360b0,_0x493dc0[_0xda47('0x5a')]);return db[_0xda47('0x69')][_0xda47('0x2c')]({'where':_0x4360b0[_0xda47('0x4d')]})[_0xda47('0x21')](function(_0x5c6c16){_0x14ef5a[_0xda47('0x2c')]=_0x5c6c16;if(_0x493dc0[_0xda47('0x44')][_0xda47('0x53')]){_0x4360b0['include']=[{'all':!![]}];}return db[_0xda47('0x69')][_0xda47('0x65')](_0x4360b0);})[_0xda47('0x21')](function(_0x76ef4){_0x14ef5a[_0xda47('0x55')]=_0x76ef4;return _0x14ef5a;});}})[_0xda47('0x21')](respondWithFilteredResult(_0x5a616b,_0x4360b0))['catch'](handleError(_0x5a616b,null));};exports[_0xda47('0x6a')]=function(_0x57fba8,_0x107f60,_0x54a6d2){return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x57fba8['params']['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x107f60,null))[_0xda47('0x21')](function(_0x25e0c8){if(_0x25e0c8){return _0x25e0c8[_0xda47('0x6a')](_0x57fba8[_0xda47('0x44')][_0xda47('0x67')]);}})['then'](respondWithStatusCode(_0x107f60,null))['catch'](handleError(_0x107f60,null));};exports[_0xda47('0x61')]=function(_0x221ee1,_0x794e6a){var _0x5373d8={'name':_0x221ee1[_0xda47('0x5b')][_0xda47('0x3a')],'key':_0x221ee1[_0xda47('0x5b')][_0xda47('0x50')],'email':_0x221ee1['body'][_0xda47('0x6b')],'ListId':_0x221ee1[_0xda47('0x5b')][_0xda47('0x6c')],'active':!_['isNil'](_0x221ee1[_0xda47('0x5b')]['active'])?_0x221ee1[_0xda47('0x5b')][_0xda47('0x6d')]:!![],'description':_0x221ee1['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xda47('0x6e')](_0x221ee1[_0xda47('0x5b')][_0xda47('0x6f')])){if(_0x221ee1[_0xda47('0x5b')][_0xda47('0x70')]){_0x5373d8['Imap'][_0xda47('0x71')]=_0x5373d8['Smtp'][_0xda47('0x71')]=_0x221ee1[_0xda47('0x5b')]['cuser'];_0x5373d8['Imap'][_0xda47('0x72')]=_0x5373d8[_0xda47('0x3d')][_0xda47('0x73')]=_0x221ee1['body'][_0xda47('0x74')];}else{_0x5373d8[_0xda47('0x58')]['authentication']=_0x5373d8[_0xda47('0x3d')]['authentication']=![];}_0x5373d8['Imap']['host']=_0x221ee1[_0xda47('0x5b')]['Imap']['host'];_0x5373d8['Imap'][_0xda47('0x75')]=_0x221ee1['body'][_0xda47('0x58')][_0xda47('0x75')];_0x5373d8['Smtp'][_0xda47('0x76')]=_0x221ee1[_0xda47('0x5b')]['Smtp'][_0xda47('0x76')];_0x5373d8['Smtp'][_0xda47('0x75')]=_0x221ee1['body']['Smtp'][_0xda47('0x75')];}else{_0x5373d8['Imap']['service']=_0x5373d8[_0xda47('0x3d')]['service']=_0x221ee1[_0xda47('0x5b')]['cservice'];_0x5373d8[_0xda47('0x58')][_0xda47('0x71')]=_0x5373d8[_0xda47('0x3d')][_0xda47('0x71')]=_0x221ee1[_0xda47('0x5b')]['cuser'];_0x5373d8[_0xda47('0x58')]['password']=_0x5373d8[_0xda47('0x3d')][_0xda47('0x73')]=_0x221ee1[_0xda47('0x5b')][_0xda47('0x74')];}return db[_0xda47('0x40')][_0xda47('0x61')](_0x5373d8,{'include':[{'model':db[_0xda47('0x5d')],'as':_0xda47('0x3d')},{'model':db[_0xda47('0x3c')],'as':_0xda47('0x58')}]})[_0xda47('0x21')](function(_0x2ec6ed){var _0x5c22e0=_0x221ee1['user']['get']({'plain':!![]});if(!_0x5c22e0)throw new Error(_0xda47('0x77'));if(_0x5c22e0[_0xda47('0x78')]===_0xda47('0x71')){var _0x502656=_0x2ec6ed[_0xda47('0x36')]({'plain':!![]});return db[_0xda47('0x79')][_0xda47('0x5c')]({'where':{'name':'MailAccounts','userProfileId':_0x5c22e0[_0xda47('0x7a')]},'raw':!![]})[_0xda47('0x21')](function(_0x58f699){if(_0x58f699&&_0x58f699['autoAssociation']===0x0){return db['UserProfileResource'][_0xda47('0x61')]({'name':_0x502656[_0xda47('0x3a')],'resourceId':_0x502656['id'],'type':_0x58f699[_0xda47('0x3a')],'sectionId':_0x58f699['id']},{})[_0xda47('0x21')](function(){return _0x2ec6ed;});}else{return _0x2ec6ed;}})[_0xda47('0x2a')](function(_0x5eedfb){logger[_0xda47('0x27')](_0xda47('0x7b'),_0x5eedfb);throw _0x5eedfb;});}return _0x2ec6ed;})[_0xda47('0x21')](respondWithResult(_0x794e6a,0xc9))[_0xda47('0x2a')](handleError(_0x794e6a,null));};exports[_0xda47('0x7c')]=function(_0x461aa5,_0x2e2af5,_0x54bc29){return db[_0xda47('0x40')][_0xda47('0x63')]({'where':{'id':_0x461aa5[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x2e2af5,null))[_0xda47('0x21')](function(_0x24a9c3){if(_0x24a9c3){return _0x24a9c3[_0xda47('0x7c')]();}return null;})[_0xda47('0x21')](respondWithResult(_0x2e2af5,null))[_0xda47('0x2a')](handleError(_0x2e2af5,null));};exports[_0xda47('0x7d')]=function(_0x234de4,_0x1d3f61,_0x1d69f6){if(_0x234de4[_0xda47('0x5b')]['id']){delete _0x234de4[_0xda47('0x5b')]['id'];}return db['MailAccount'][_0xda47('0x5c')]({'where':{'id':_0x234de4[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x1d3f61,null))[_0xda47('0x21')](function(_0x4bd9ba){if(_0x4bd9ba){_0x234de4[_0xda47('0x5b')][_0xda47('0x5f')]=_0x4bd9ba['id'];return db[_0xda47('0x3c')][_0xda47('0x61')](_0x234de4[_0xda47('0x5b')]);}})['then'](respondWithResult(_0x1d3f61,null))['catch'](handleError(_0x1d3f61,null));};exports[_0xda47('0x7e')]=function(_0x43c75f,_0x17b39f,_0x2c1d9d){return db[_0xda47('0x40')][_0xda47('0x63')]({'where':{'id':_0x43c75f['params']['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x17b39f,null))[_0xda47('0x21')](function(_0x28c40c){if(_0x28c40c){return _0x28c40c[_0xda47('0x7f')](null);}return null;})[_0xda47('0x21')](respondWithStatusCode(_0x17b39f,null))['catch'](handleError(_0x17b39f,null));};exports[_0xda47('0x80')]=function(_0x2b3ce0,_0x43b61c,_0x1c6ddc){return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x2b3ce0[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x43b61c,null))[_0xda47('0x21')](function(_0x591134){if(_0x591134){return _0x591134[_0xda47('0x80')]();}return null;})[_0xda47('0x21')](respondWithResult(_0x43b61c,null))[_0xda47('0x2a')](handleError(_0x43b61c,null));};exports[_0xda47('0x81')]=function(_0x52c519,_0x48522c,_0x20b88a){if(_0x52c519[_0xda47('0x5b')]['id']){delete _0x52c519[_0xda47('0x5b')]['id'];}return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x52c519['params']['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x48522c,null))[_0xda47('0x21')](function(_0x5293cb){if(_0x5293cb){_0x52c519[_0xda47('0x5b')][_0xda47('0x5f')]=_0x5293cb['id'];return db['MailServerOut'][_0xda47('0x61')](_0x52c519['body']);}})[_0xda47('0x21')](respondWithResult(_0x48522c,null))[_0xda47('0x2a')](handleError(_0x48522c,null));};exports[_0xda47('0x82')]=function(_0x4debc4,_0x2a71f2,_0x2cb1d3){return db['MailAccount']['findOne']({'where':{'id':_0x4debc4[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x2a71f2,null))[_0xda47('0x21')](function(_0x51ac60){if(_0x51ac60){return _0x51ac60[_0xda47('0x83')](null);}return null;})[_0xda47('0x21')](respondWithStatusCode(_0x2a71f2,null))[_0xda47('0x2a')](handleError(_0x2a71f2,null));};exports[_0xda47('0x84')]=function(_0x56ed56,_0xb886b0,_0x2dccec){return db[_0xda47('0x85')]['find']({'where':{'id':_0x56ed56[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0xb886b0,null))[_0xda47('0x21')](function(_0x5df7ca){if(_0x5df7ca){return _0x5df7ca[_0xda47('0x84')](_0x56ed56[_0xda47('0x5b')][_0xda47('0x67')],_['omit'](_0x56ed56[_0xda47('0x5b')],[_0xda47('0x67'),'id'])||{});}})[_0xda47('0x21')](respondWithResult(_0xb886b0,null))[_0xda47('0x2a')](handleError(_0xb886b0,null));};exports[_0xda47('0x86')]=function(_0x3b44fd,_0x7c0283,_0x4f9e89){var _0x26ef75={'raw':![],'where':{}};var _0x32ec1e={};var _0x5a11a5={'count':0x0,'rows':[]};return db[_0xda47('0x40')][_0xda47('0x63')]({'where':{'id':_0x3b44fd['params']['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x7c0283,null))[_0xda47('0x21')](function(_0x209bd4){if(_0x209bd4){_0x32ec1e[_0xda47('0x42')]=_[_0xda47('0x43')](db[_0xda47('0x85')][_0xda47('0x41')]);_0x32ec1e[_0xda47('0x44')]=_['keys'](_0x3b44fd[_0xda47('0x44')]);_0x32ec1e['filters']=_['intersection'](_0x32ec1e[_0xda47('0x42')],_0x32ec1e['query']);_0x26ef75[_0xda47('0x48')]=_['intersection'](_0x32ec1e['model'],qs[_0xda47('0x47')](_0x3b44fd['query'][_0xda47('0x47')]));_0x26ef75[_0xda47('0x48')]=_0x26ef75[_0xda47('0x48')][_0xda47('0x49')]?_0x26ef75[_0xda47('0x48')]:_0x32ec1e[_0xda47('0x42')];if(!_0x3b44fd['query'][_0xda47('0x87')]('nolimit')){_0x26ef75['limit']=qs[_0xda47('0x2e')](_0x3b44fd[_0xda47('0x44')]['limit']);_0x26ef75[_0xda47('0x2d')]=qs[_0xda47('0x2d')](_0x3b44fd[_0xda47('0x44')][_0xda47('0x2d')]);}_0x26ef75['order']=qs['sort'](_0x3b44fd[_0xda47('0x44')]['sort']);_0x26ef75[_0xda47('0x4d')]=qs[_0xda47('0x45')](_['pick'](_0x3b44fd[_0xda47('0x44')],_0x32ec1e[_0xda47('0x45')]));_0x26ef75[_0xda47('0x4d')]['MailAccountId']=_0x209bd4['id'];if(_0x3b44fd['query'][_0xda47('0x4f')]){_0x26ef75[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x26ef75[_0xda47('0x4d')],{'$or':_['map'](_0x26ef75[_0xda47('0x48')],function(_0x145d30){var _0x18e256={};_0x18e256[_0x145d30]={'$like':'%'+_0x3b44fd[_0xda47('0x44')][_0xda47('0x4f')]+'%'};return _0x18e256;})});}_0x26ef75=_[_0xda47('0x59')]({},_0x26ef75,_0x3b44fd[_0xda47('0x5a')]);return db['MailInteraction'][_0xda47('0x2c')]({'where':_0x26ef75[_0xda47('0x4d')]})['then'](function(_0x2c3f4f){_0x5a11a5['count']=_0x2c3f4f;if(_0x3b44fd[_0xda47('0x44')][_0xda47('0x53')]){_0x26ef75['include']=[{'model':db[_0xda47('0x88')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xda47('0x89'),'attributes':[_0xda47('0x3a'),_0xda47('0x8a'),_0xda47('0x8b')],'required':![]},{'model':db[_0xda47('0x8c')],'as':_0xda47('0x8d'),'attributes':['id',_0xda47('0x3a'),_0xda47('0x8e')],'where':_0x3b44fd['query']['tag']?{'id':_0x3b44fd[_0xda47('0x44')][_0xda47('0x8f')]}:undefined,'required':_0x3b44fd[_0xda47('0x44')]['tag']?!![]:![]}];}return db[_0xda47('0x85')]['findAll'](_0x26ef75);})[_0xda47('0x21')](function(_0x13420a){_0x5a11a5[_0xda47('0x55')]=_0x13420a;return _0x5a11a5;});}})[_0xda47('0x21')](respondWithFilteredResult(_0x7c0283,_0x26ef75))['catch'](handleError(_0x7c0283,null));};exports['addApplications']=function(_0x7ed45,_0x3cd519,_0x1000ff){return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x7ed45[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x3cd519,null))[_0xda47('0x21')](function(_0x2b4fe0){if(_0x2b4fe0){return db[_0xda47('0x90')]['transaction'](function(_0x2488d8){return db[_0xda47('0x91')]['destroy']({'where':{'MailAccountId':_0x7ed45['params']['id']},'transaction':_0x2488d8})[_0xda47('0x21')](function(_0x41d16a){var _0x8f66d0=_['map'](_0x7ed45['body'],function(_0x314862){_0x314862[_0xda47('0x5f')]=_0x7ed45[_0xda47('0x57')]['id'];return _0x314862;});return db[_0xda47('0x91')][_0xda47('0x92')](_0x8f66d0,{'transaction':_0x2488d8});});})[_0xda47('0x21')](function(){return db[_0xda47('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0x7ed45[_0xda47('0x57')]['id']},'order':_0xda47('0x93')});});}})['then'](respondWithResult(_0x3cd519,null))['catch'](handleError(_0x3cd519,null));};exports[_0xda47('0x94')]=function(_0x4949a4,_0x1964ae,_0x811fa6){var _0x10b778={};var _0x5263b0={};var _0x2fb191;var _0x3379a5;return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x4949a4['params']['id']}})['then'](handleEntityNotFound(_0x1964ae,null))['then'](function(_0x5b3a15){if(_0x5b3a15){_0x2fb191=_0x5b3a15;_0x5263b0['model']=_['keys'](db[_0xda47('0x91')][_0xda47('0x41')]);_0x5263b0[_0xda47('0x44')]=_[_0xda47('0x43')](_0x4949a4[_0xda47('0x44')]);_0x5263b0[_0xda47('0x45')]=_[_0xda47('0x46')](_0x5263b0[_0xda47('0x42')],_0x5263b0[_0xda47('0x44')]);_0x10b778[_0xda47('0x48')]=_[_0xda47('0x46')](_0x5263b0[_0xda47('0x42')],qs['fields'](_0x4949a4[_0xda47('0x44')]['fields']));_0x10b778[_0xda47('0x48')]=_0x10b778['attributes'][_0xda47('0x49')]?_0x10b778[_0xda47('0x48')]:_0x5263b0[_0xda47('0x42')];_0x10b778['order']=qs['sort'](_0x4949a4[_0xda47('0x44')]['sort']);_0x10b778[_0xda47('0x4d')]=qs['filters'](_[_0xda47('0x4e')](_0x4949a4[_0xda47('0x44')],_0x5263b0[_0xda47('0x45')]));if(_0x4949a4[_0xda47('0x44')]['filter']){_0x10b778[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x10b778[_0xda47('0x4d')],{'$or':_[_0xda47('0x64')](_0x10b778[_0xda47('0x48')],function(_0x33f739){var _0x2f8edc={};_0x2f8edc[_0x33f739]={'$like':'%'+_0x4949a4[_0xda47('0x44')]['filter']+'%'};return _0x2f8edc;})});}_0x10b778=_['merge']({},_0x10b778,_0x4949a4[_0xda47('0x5a')]);return _0x2fb191[_0xda47('0x94')](_0x10b778);}})[_0xda47('0x21')](function(_0x41efeb){if(_0x41efeb){_0x3379a5=_0x41efeb[_0xda47('0x49')];if(!_0x4949a4[_0xda47('0x44')]['hasOwnProperty'](_0xda47('0x4a'))){_0x10b778[_0xda47('0x2e')]=qs[_0xda47('0x2e')](_0x4949a4[_0xda47('0x44')]['limit']);_0x10b778[_0xda47('0x2d')]=qs[_0xda47('0x2d')](_0x4949a4[_0xda47('0x44')][_0xda47('0x2d')]);}return _0x2fb191[_0xda47('0x94')](_0x10b778);}})[_0xda47('0x21')](function(_0x31cc51){if(_0x31cc51){return _0x31cc51?{'count':_0x3379a5,'rows':_0x31cc51}:null;}})[_0xda47('0x21')](respondWithResult(_0x1964ae,null))['catch'](handleError(_0x1964ae,null));};exports[_0xda47('0x95')]=function(_0x1d7ed5,_0x16d44c,_0x1c96af){var _0x338054={'raw':!![],'where':{}};var _0x3a3e93={};var _0x294ee6={'count':0x0,'rows':[]};return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x1d7ed5[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x16d44c,null))[_0xda47('0x21')](function(_0x64021d){if(_0x64021d){_0x3a3e93['model']=_[_0xda47('0x43')](db[_0xda47('0x96')][_0xda47('0x41')]);_0x3a3e93[_0xda47('0x44')]=_[_0xda47('0x43')](_0x1d7ed5[_0xda47('0x44')]);_0x3a3e93[_0xda47('0x45')]=_[_0xda47('0x46')](_0x3a3e93[_0xda47('0x42')],_0x3a3e93[_0xda47('0x44')]);_0x338054[_0xda47('0x48')]=_['intersection'](_0x3a3e93[_0xda47('0x42')],qs[_0xda47('0x47')](_0x1d7ed5[_0xda47('0x44')][_0xda47('0x47')]));_0x338054['attributes']=_0x338054['attributes'][_0xda47('0x49')]?_0x338054[_0xda47('0x48')]:_0x3a3e93[_0xda47('0x42')];if(!_0x1d7ed5[_0xda47('0x44')][_0xda47('0x87')](_0xda47('0x4a'))){_0x338054[_0xda47('0x2e')]=qs[_0xda47('0x2e')](_0x1d7ed5[_0xda47('0x44')][_0xda47('0x2e')]);_0x338054['offset']=qs[_0xda47('0x2d')](_0x1d7ed5[_0xda47('0x44')][_0xda47('0x2d')]);}_0x338054[_0xda47('0x4b')]=qs['sort'](_0x1d7ed5[_0xda47('0x44')][_0xda47('0x4c')]);_0x338054[_0xda47('0x4d')]=qs['filters'](_[_0xda47('0x4e')](_0x1d7ed5[_0xda47('0x44')],_0x3a3e93[_0xda47('0x45')]));_0x338054['where'][_0xda47('0x5f')]=_0x64021d['id'];if(_0x1d7ed5[_0xda47('0x44')][_0xda47('0x4f')]){_0x338054[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x338054[_0xda47('0x4d')],{'$or':_['map'](_0x338054['attributes'],function(_0x11836c){var _0x322d96={};_0x322d96[_0x11836c]={'$like':'%'+_0x1d7ed5[_0xda47('0x44')][_0xda47('0x4f')]+'%'};return _0x322d96;})});}if(_0x1d7ed5[_0xda47('0x44')][_0xda47('0x97')]){var _0x4d9f93=_0x1d7ed5['query'][_0xda47('0x97')][_0xda47('0x98')](',');var _0xc11c16={};_0xc11c16[_0x4d9f93[0x0]]={'$gte':moment(_0x4d9f93[0x1])[_0xda47('0x99')](_0xda47('0x9a'))};_0x338054[_0xda47('0x4d')]=_[_0xda47('0x59')](_0x338054[_0xda47('0x4d')],_0xc11c16);}_0x338054=_['merge']({},_0x338054,_0x1d7ed5[_0xda47('0x5a')]);return db['MailMessage'][_0xda47('0x2c')]({'where':_0x338054['where']})[_0xda47('0x21')](function(_0x49bdf0){_0x294ee6[_0xda47('0x2c')]=_0x49bdf0;if(_0x1d7ed5['query']['includeAll']){_0x338054[_0xda47('0x54')]=[{'all':!![]}];}return db[_0xda47('0x96')]['findAll'](_0x338054);})[_0xda47('0x21')](function(_0x34deda){_0x294ee6['rows']=_0x34deda;return _0x294ee6;});}})['then'](respondWithFilteredResult(_0x16d44c,_0x338054))['catch'](handleError(_0x16d44c,null));};exports[_0xda47('0x9b')]=function(_0x3d8fca,_0x140a1b,_0xa1472e){var _0x287257,_0x6bd81e={},_0x3f10c9;if(_0x3d8fca[_0xda47('0x5b')]['to']){_0x3f10c9=_0x3d8fca[_0xda47('0x5b')]['to'][_0xda47('0x98')](',')[0x0];}return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x3d8fca[_0xda47('0x57')]['id']},'include':[{'model':db[_0xda47('0x9c')],'as':_0xda47('0x9d'),'include':[{'model':db[_0xda47('0x88')],'as':'Contacts','where':{'email':_0x3f10c9},'limit':0x1,'order':[[_0xda47('0x9e'),_0xda47('0x9f')]]}]},{'model':db[_0xda47('0x5d')],'as':_0xda47('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x140a1b,null))[_0xda47('0x21')](function(_0x59692e){if(_0x59692e){_0x287257=_0x59692e;if(_0x59692e['Smtp']){if(_[_0xda47('0x6e')](_0x3d8fca[_0xda47('0x5b')][_0xda47('0xa0')])){_0x3d8fca[_0xda47('0x5b')]['from']=util[_0xda47('0x99')](_0xda47('0xa1'),_0x59692e[_0xda47('0x3a')],_0x59692e[_0xda47('0x6b')]||_0x59692e[_0xda47('0x3d')][_0xda47('0x71')]);}if(_0x3d8fca['body'][_0xda47('0xa2')]&&_0x3d8fca['body'][_0xda47('0xa2')][_0xda47('0x49')]){for(var _0x4d1df4=0x0;_0x4d1df4<_0x3d8fca['body']['attachments'][_0xda47('0x49')];_0x4d1df4+=0x1){_0x3d8fca[_0xda47('0x5b')]['attachments'][_0x4d1df4]={'filename':_0x3d8fca[_0xda47('0x5b')][_0xda47('0xa2')][_0x4d1df4]['name'],'path':path[_0xda47('0xa3')](config['root'],_0xda47('0xa4'),_0x3d8fca[_0xda47('0x5b')][_0xda47('0xa2')][_0x4d1df4]['basename'])};}}var _0x5994c1={'tls':{'rejectUnauthorized':![]}};if(_[_0xda47('0x6e')](_0x59692e[_0xda47('0x3d')][_0xda47('0xa5')])){if(_0x59692e[_0xda47('0x3d')][_0xda47('0xa6')]){_0x5994c1[_0xda47('0xa7')]={'user':_0x59692e['Smtp']['user'],'pass':_0x59692e[_0xda47('0x3d')][_0xda47('0x73')]};}_0x5994c1[_0xda47('0x76')]=_0x59692e[_0xda47('0x3d')][_0xda47('0x76')];_0x5994c1['port']=_0x59692e[_0xda47('0x3d')][_0xda47('0x75')];_0x5994c1[_0xda47('0xa8')]=_0x59692e[_0xda47('0x3d')][_0xda47('0xa8')];}else{_0x5994c1[_0xda47('0xa5')]=_0x59692e[_0xda47('0x3d')]['service'];_0x5994c1[_0xda47('0xa7')]={'user':_0x59692e['Smtp'][_0xda47('0x71')],'pass':_0x59692e['Smtp']['pass']};}return respondWithRpcPromise(_0xda47('0xa9'),_0xda47('0xaa'),{'account':_0x5994c1,'message':_0x3d8fca[_0xda47('0x5b')]});}else{throw new Error(_0xda47('0xab'));}}})[_0xda47('0x21')](function(_0x5f2985){if(_0x5f2985){_0x6bd81e=_0x5f2985;if(_0x287257['List']){if(_0x287257[_0xda47('0x9d')]['Contacts']['length']){return _0x287257[_0xda47('0x9d')][_0xda47('0xac')][0x0];}else{return db['CmContact'][_0xda47('0x61')](_[_0xda47('0x19')](_0x3d8fca[_0xda47('0x5b')],{'firstName':_0x3d8fca['body']['to'],'email':_0x3d8fca[_0xda47('0x5b')]['to'],'phone':_0x3d8fca[_0xda47('0x5b')]['to'],'ListId':_0x287257[_0xda47('0x6c')]}));}}else{throw new Error(_0xda47('0xab'));}}})['then'](function(_0x5ace1c){if(_0x5ace1c){var _0x26bd20={'UserId':_0x3d8fca['user']['id'],'ContactId':_0x5ace1c['id'],'MailAccountId':_0x287257['id'],'inReplyTo':_0x6bd81e[_0xda47('0xad')],'to':_0x3d8fca[_0xda47('0x5b')][_0xda47('0xa0')],'cc':_0x3d8fca[_0xda47('0x5b')]['cc'],'subject':_0x3d8fca[_0xda47('0x5b')][_0xda47('0xae')],'attach':_0x3d8fca['body'][_0xda47('0xaf')],'firstMsgDirection':_0xda47('0xb0'),'lastMsgAt':moment()['format'](_0xda47('0x9a')),'lastMsgDirection':_0xda47('0xb0'),'lastMsgBody':_0x3d8fca[_0xda47('0x5b')][_0xda47('0x5b')],'Messages':[_[_0xda47('0x59')](_0x3d8fca[_0xda47('0x5b')],{'messageId':_0x6bd81e['messageId'],'sentAt':moment()[_0xda47('0x99')](_0xda47('0x9a')),'read':!![],'MailAccountId':_0x287257['id'],'UserId':_0x3d8fca[_0xda47('0x71')]['id'],'ContactId':_0x5ace1c['id']})]};if(_0x3d8fca[_0xda47('0x5b')][_0xda47('0xb1')]){_0x26bd20=_[_0xda47('0x59')](_0x26bd20,_0x3d8fca['body'][_0xda47('0xb1')]);}return db['MailInteraction'][_0xda47('0x61')](_0x26bd20,{'include':[{'model':db[_0xda47('0x96')],'as':_0xda47('0xb2')}]});}})[_0xda47('0x21')](respondWithResult(_0x140a1b,null))[_0xda47('0x2a')](handleError(_0x140a1b,null));};exports[_0xda47('0xb3')]=function(_0x5314e5,_0x1caaf4,_0x1d42c3){return db['MailAccount'][_0xda47('0x5c')]({'where':{'id':_0x5314e5[_0xda47('0x57')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xda47('0x3d'),'raw':!![]}]})[_0xda47('0x21')](handleEntityNotFound(_0x1caaf4,null))['then'](function(_0x394f2e){if(_0x394f2e&&_0x394f2e[_0xda47('0x3d')]){var _0x3f1d11={'id':_0x394f2e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x394f2e[_0xda47('0x3d')][_0xda47('0xa5')]){_0x3f1d11[_0xda47('0xa5')]=_0x394f2e[_0xda47('0x3d')]['service'];}else{_0x3f1d11[_0xda47('0x76')]=_0x394f2e[_0xda47('0x3d')][_0xda47('0x76')];_0x3f1d11[_0xda47('0x75')]=_0x394f2e[_0xda47('0x3d')][_0xda47('0x75')];_0x3f1d11['secure']=_0x394f2e[_0xda47('0x3d')][_0xda47('0xa8')];}if(_0x394f2e[_0xda47('0x3d')][_0xda47('0xa6')]){_0x3f1d11[_0xda47('0xa7')]={'user':_0x394f2e[_0xda47('0x3d')][_0xda47('0x71')],'pass':_0x394f2e[_0xda47('0x3d')]['pass']};}return respondWithRpcPromise(_0xda47('0xb4'),'verifySmtp',{'account':_0x3f1d11});}})[_0xda47('0x21')](respondWithResult(_0x1caaf4,null))[_0xda47('0x2a')](handleError(_0x1caaf4,null));};exports[_0xda47('0x35')]=function(_0x59eadd,_0x44eaa4){return db['MailAccount'][_0xda47('0x5c')]({'where':{'id':_0x59eadd[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x44eaa4,null))['then'](function(_0x24ceac){if(_0x24ceac&&_0x24ceac[_0xda47('0xa5')]){throw new db['Sequelize'][(_0xda47('0xb5'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x24ceac;})[_0xda47('0x21')](removeEntity(_0x44eaa4,null))[_0xda47('0x2a')](handleError(_0x44eaa4,null));};exports[_0xda47('0xb6')]=function(_0x280e1a,_0x4edbda,_0x14529d){return db[_0xda47('0x40')]['find']({'where':{'id':_0x280e1a[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x4edbda,null))[_0xda47('0x21')](function(_0x99f724){if(_0x99f724){return _0x99f724[_0xda47('0xb6')](_0x280e1a[_0xda47('0x5b')][_0xda47('0x67')],_['omit'](_0x280e1a['body'],[_0xda47('0x67'),'id'])||{})[_0xda47('0xb7')](function(_0x3cb79c){for(var _0x2dddba=0x0;_0x2dddba<_0x280e1a[_0xda47('0x5b')]['ids']['length'];_0x2dddba+=0x1){socket[_0xda47('0xb8')]('userMailAccount:save',{'UserId':_0x280e1a[_0xda47('0x5b')][_0xda47('0x67')][_0x2dddba],'MailAccountId':_0x280e1a['params']['id']});}return _0x3cb79c;});}})[_0xda47('0x21')](respondWithResult(_0x4edbda,null))[_0xda47('0x2a')](handleError(_0x4edbda,null));};exports['removeAgents']=function(_0x5f12f4,_0x2c157b,_0x290374){return db[_0xda47('0x40')][_0xda47('0x5c')]({'where':{'id':_0x5f12f4[_0xda47('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c157b,null))['then'](function(_0x388e2c){if(_0x388e2c){return _0x388e2c[_0xda47('0xb9')](_0x5f12f4[_0xda47('0x44')]['ids'])[_0xda47('0x21')](function(){if(_[_0xda47('0xba')](_0x5f12f4[_0xda47('0x44')]['ids'])){for(var _0x2d688a=0x0;_0x2d688a<_0x5f12f4['query'][_0xda47('0x67')][_0xda47('0x49')];_0x2d688a+=0x1){socket[_0xda47('0xb8')](_0xda47('0xbb'),{'UserId':Number(_0x5f12f4[_0xda47('0x44')][_0xda47('0x67')][_0x2d688a]),'MailAccountId':Number(_0x5f12f4[_0xda47('0x57')]['id'])});}}else{socket[_0xda47('0xb8')](_0xda47('0xbb'),{'UserId':Number(_0x5f12f4[_0xda47('0x44')][_0xda47('0x67')]),'MailAccountId':Number(_0x5f12f4[_0xda47('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c157b,null))[_0xda47('0x2a')](handleError(_0x2c157b,null));};exports[_0xda47('0xbc')]=function(_0x2c8101,_0x4e45dd,_0x157c8e){var _0x3ec544={};var _0x3694b5={};var _0x28608e;var _0x7b1089;return db['MailAccount'][_0xda47('0x63')]({'where':{'id':_0x2c8101[_0xda47('0x57')]['id']}})[_0xda47('0x21')](handleEntityNotFound(_0x4e45dd,null))[_0xda47('0x21')](function(_0x2ee5bf){if(_0x2ee5bf){_0x28608e=_0x2ee5bf;_0x3694b5[_0xda47('0x42')]=_[_0xda47('0x43')](db[_0xda47('0xbd')][_0xda47('0x41')]);_0x3694b5['query']=_[_0xda47('0x43')](_0x2c8101[_0xda47('0x44')]);_0x3694b5['filters']=_['intersection'](_0x3694b5[_0xda47('0x42')],_0x3694b5['query']);_0x3ec544[_0xda47('0x48')]=_['intersection'](_0x3694b5[_0xda47('0x42')],qs[_0xda47('0x47')](_0x2c8101[_0xda47('0x44')][_0xda47('0x47')]));_0x3ec544[_0xda47('0x48')]=_0x3ec544[_0xda47('0x48')][_0xda47('0x49')]?_0x3ec544[_0xda47('0x48')]:_0x3694b5[_0xda47('0x42')];_0x3ec544[_0xda47('0x4b')]=qs[_0xda47('0x4c')](_0x2c8101['query'][_0xda47('0x4c')]);_0x3ec544[_0xda47('0x4d')]=qs[_0xda47('0x45')](_[_0xda47('0x4e')](_0x2c8101[_0xda47('0x44')],_0x3694b5['filters']));if(_0x2c8101[_0xda47('0x44')][_0xda47('0x4f')]){_0x3ec544['where']=_[_0xda47('0x59')](_0x3ec544['where'],{'$or':_[_0xda47('0x64')](_0x3ec544[_0xda47('0x48')],function(_0xc25af0){var _0x54a029={};_0x54a029[_0xc25af0]={'$like':'%'+_0x2c8101['query'][_0xda47('0x4f')]+'%'};return _0x54a029;})});}_0x3ec544=_[_0xda47('0x59')]({},_0x3ec544,_0x2c8101['options']);return _0x28608e[_0xda47('0xbc')](_0x3ec544);}})['then'](function(_0x3182fa){if(_0x3182fa){_0x7b1089=_0x3182fa[_0xda47('0x49')];if(!_0x2c8101[_0xda47('0x44')]['hasOwnProperty'](_0xda47('0x4a'))){_0x3ec544[_0xda47('0x2e')]=qs[_0xda47('0x2e')](_0x2c8101['query'][_0xda47('0x2e')]);_0x3ec544[_0xda47('0x2d')]=qs['offset'](_0x2c8101[_0xda47('0x44')][_0xda47('0x2d')]);}return _0x28608e[_0xda47('0xbc')](_0x3ec544);}})[_0xda47('0x21')](function(_0x128722){if(_0x128722){return _0x128722?{'count':_0x7b1089,'rows':_0x128722}:null;}})[_0xda47('0x21')](respondWithResult(_0x4e45dd,null))[_0xda47('0x2a')](handleError(_0x4e45dd,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 4c2e309..59538c0 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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 272cbce..01ce7ad 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 _0xfc4f=['path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x544636,_0x2c02cd){var _0x435856=function(_0x2b08ef){while(--_0x2b08ef){_0x544636['push'](_0x544636['shift']());}};_0x435856(++_0x2c02cd);}(_0xfc4f,0x192));var _0xffc4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfc4f[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xffc4('0x0'));var logger=require(_0xffc4('0x1'))(_0xffc4('0x2'));var moment=require(_0xffc4('0x3'));var BPromise=require(_0xffc4('0x4'));var rp=require(_0xffc4('0x5'));var fs=require('fs');var path=require(_0xffc4('0x6'));var rimraf=require('rimraf');var config=require(_0xffc4('0x7'));var attributes=require(_0xffc4('0x8'));module[_0xffc4('0x9')]=function(_0x2efa5f,_0x4cd469){return _0x2efa5f[_0xffc4('0xa')](_0xffc4('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb515=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailAccount','mail_accounts','lodash','../../config/logger'];(function(_0x1b6ff2,_0x50fbbf){var _0x2af927=function(_0x50a2d4){while(--_0x50a2d4){_0x1b6ff2['push'](_0x1b6ff2['shift']());}};_0x2af927(++_0x50fbbf);}(_0xb515,0x1b8));var _0x5b51=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xb515[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var logger=require(_0x5b51('0x1'))(_0x5b51('0x2'));var moment=require(_0x5b51('0x3'));var BPromise=require(_0x5b51('0x4'));var rp=require(_0x5b51('0x5'));var fs=require('fs');var path=require(_0x5b51('0x6'));var rimraf=require(_0x5b51('0x7'));var config=require(_0x5b51('0x8'));var attributes=require('./mailAccount.attributes');module[_0x5b51('0x9')]=function(_0xf9e3ac,_0x3ef482){return _0xf9e3ac[_0x5b51('0xa')](_0x5b51('0xb'),attributes,{'tableName':_0x5b51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 2564691..e18a0af 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 _0x49ec=['map','ShowMailAccount','NotifyMailAccount','difference','keys','rawAttributes','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','DESC','Applications','get','omit','applications','list','orderBy','priority','autoclose','Contacts','length','defaults','CmContact','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','interaction','created','attachments','originTo','originCc','bcc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailAccount','MailAccount','options','where','limit','attributes','include','model','find','raw'];(function(_0x256bcf,_0x32e334){var _0x1d7ae1=function(_0x42fc4d){while(--_0x42fc4d){_0x256bcf['push'](_0x256bcf['shift']());}};_0x1d7ae1(++_0x32e334);}(_0x49ec,0x15c));var _0xc49e=function(_0x20d779,_0x121367){_0x20d779=_0x20d779-0x0;var _0x433f52=_0x49ec[_0x20d779];return _0x433f52;};'use strict';var _=require('lodash');var util=require(_0xc49e('0x0'));var moment=require(_0xc49e('0x1'));var BPromise=require(_0xc49e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc49e('0x3'));var db=require(_0xc49e('0x4'))['db'];var utils=require(_0xc49e('0x5'));var logger=require(_0xc49e('0x6'))(_0xc49e('0x7'));var config=require(_0xc49e('0x8'));var jayson=require(_0xc49e('0x9'));var client=jayson[_0xc49e('0xa')][_0xc49e('0xb')]({'port':0x232c});config[_0xc49e('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc49e('0xd'))(new Redis(config[_0xc49e('0xc')]));require('./mailAccount.socket')[_0xc49e('0xe')](socket);function respondWithRpcPromise(_0x3a8650,_0xf107f6,_0xc8a7c7){return new BPromise(function(_0x4c76ba,_0x2b25e6){return client[_0xc49e('0xf')](_0x3a8650,_0xc8a7c7)[_0xc49e('0x10')](function(_0x20f573){logger[_0xc49e('0x11')](_0xc49e('0x12'),_0xf107f6,_0xc49e('0x13'));logger[_0xc49e('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xf107f6,_0xc49e('0x13'),JSON[_0xc49e('0x15')](_0x20f573));if(_0x20f573[_0xc49e('0x16')]){if(_0x20f573['error']['code']===0x1f4){logger[_0xc49e('0x16')](_0xc49e('0x12'),_0xf107f6,_0x20f573[_0xc49e('0x16')]['message']);return _0x2b25e6(_0x20f573[_0xc49e('0x16')][_0xc49e('0x17')]);}logger[_0xc49e('0x16')](_0xc49e('0x12'),_0xf107f6,_0x20f573['error'][_0xc49e('0x17')]);return _0x4c76ba(_0x20f573[_0xc49e('0x16')][_0xc49e('0x17')]);}else{logger[_0xc49e('0x11')](_0xc49e('0x12'),_0xf107f6,_0xc49e('0x13'));_0x4c76ba(_0x20f573[_0xc49e('0x18')][_0xc49e('0x17')]);}})[_0xc49e('0x19')](function(_0x5f130c){logger[_0xc49e('0x16')](_0xc49e('0x12'),_0xf107f6,_0x5f130c);_0x2b25e6(_0x5f130c);});});}exports[_0xc49e('0x1a')]=function(_0x1c9260){var _0x24ac26=this;return new Promise(function(_0x29f375,_0x4fe115){return db[_0xc49e('0x1b')]['findAll']({'raw':_0x1c9260[_0xc49e('0x1c')]?_0x1c9260[_0xc49e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1c9260[_0xc49e('0x1c')]?_0x1c9260[_0xc49e('0x1c')][_0xc49e('0x1d')]||null:null,'attributes':_0x1c9260[_0xc49e('0x1c')]?_0x1c9260['options']['attributes']||null:null,'limit':_0x1c9260[_0xc49e('0x1c')]?_0x1c9260[_0xc49e('0x1c')][_0xc49e('0x1e')]||null:null,'include':_0x1c9260[_0xc49e('0x1c')]?_0x1c9260[_0xc49e('0x1c')]['include']?_['map'](_0x1c9260[_0xc49e('0x1c')]['include'],function(_0x5af450){return{'model':db[_0x5af450['model']],'as':_0x5af450['as'],'attributes':_0x5af450[_0xc49e('0x1f')],'include':_0x5af450[_0xc49e('0x20')]?_['map'](_0x5af450[_0xc49e('0x20')],function(_0x3887e9){return{'model':db[_0x3887e9['model']],'as':_0x3887e9['as'],'attributes':_0x3887e9[_0xc49e('0x1f')],'include':_0x3887e9[_0xc49e('0x20')]?_['map'](_0x3887e9[_0xc49e('0x20')],function(_0x48f845){return{'model':db[_0x48f845[_0xc49e('0x21')]],'as':_0x48f845['as'],'attributes':_0x48f845['attributes']};}):[]};}):[]};}):[]:[]})[_0xc49e('0x10')](function(_0x243f16){logger[_0xc49e('0x11')](_0xc49e('0x1a'),_0x1c9260);logger[_0xc49e('0x14')]('GetMailAccount',_0x1c9260,JSON['stringify'](_0x243f16));_0x29f375(_0x243f16);})[_0xc49e('0x19')](function(_0x261464){logger[_0xc49e('0x16')]('GetMailAccount',_0x261464[_0xc49e('0x17')],_0x1c9260);_0x4fe115(_0x24ac26['error'](0x1f4,_0x261464[_0xc49e('0x17')]));});});};exports['ShowMailAccount']=function(_0x444afc){var _0x129a00=this;return new Promise(function(_0x59531d,_0x49a003){return db[_0xc49e('0x1b')][_0xc49e('0x22')]({'raw':_0x444afc[_0xc49e('0x1c')]?_0x444afc[_0xc49e('0x1c')][_0xc49e('0x23')]===undefined?!![]:![]:!![],'where':_0x444afc[_0xc49e('0x1c')]?_0x444afc[_0xc49e('0x1c')][_0xc49e('0x1d')]||null:null,'attributes':_0x444afc[_0xc49e('0x1c')]?_0x444afc[_0xc49e('0x1c')][_0xc49e('0x1f')]||null:null,'include':_0x444afc[_0xc49e('0x1c')]?_0x444afc[_0xc49e('0x1c')]['include']?_[_0xc49e('0x24')](_0x444afc[_0xc49e('0x1c')]['include'],function(_0x322273){return{'model':db[_0x322273[_0xc49e('0x21')]],'as':_0x322273['as'],'attributes':_0x322273[_0xc49e('0x1f')],'include':_0x322273['include']?_['map'](_0x322273['include'],function(_0x24ccfe){return{'model':db[_0x24ccfe['model']],'as':_0x24ccfe['as'],'attributes':_0x24ccfe[_0xc49e('0x1f')],'include':_0x24ccfe[_0xc49e('0x20')]?_[_0xc49e('0x24')](_0x24ccfe[_0xc49e('0x20')],function(_0x4fa603){return{'model':db[_0x4fa603[_0xc49e('0x21')]],'as':_0x4fa603['as'],'attributes':_0x4fa603[_0xc49e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc49e('0x10')](function(_0x3c7efe){logger[_0xc49e('0x11')](_0xc49e('0x25'),_0x444afc);logger[_0xc49e('0x14')](_0xc49e('0x25'),_0x444afc,JSON['stringify'](_0x3c7efe));_0x59531d(_0x3c7efe);})['catch'](function(_0x3eb021){logger[_0xc49e('0x16')](_0xc49e('0x25'),_0x3eb021[_0xc49e('0x17')],_0x444afc);_0x49a003(_0x129a00[_0xc49e('0x16')](0x1f4,_0x3eb021[_0xc49e('0x17')]));});});};exports[_0xc49e('0x26')]=function(_0x55e3c1){var _0x5f4f61=this;return new Promise(function(_0x106f92,_0x5bf038){var _0x1a279b={'body':_0x55e3c1['body'],'channel':'mail'};var _0x6967a6=_[_0xc49e('0x27')](_[_0xc49e('0x28')](db['CmContact'][_0xc49e('0x29')]),[_0xc49e('0x2a'),_0xc49e('0x2b'),'CompanyId',_0xc49e('0x2c')]);var _0x5f18ae=![];if(_0x55e3c1[_0xc49e('0x2d')]['id']){delete _0x55e3c1['body']['id'];}if(_[_0xc49e('0x2e')](_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2f')])){return _0x5bf038(_0x5f4f61[_0xc49e('0x16')](0x1f4,_0xc49e('0x30')));}if(_[_0xc49e('0x2e')](_0x55e3c1['body'][_0xc49e('0x2d')])||_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2d')]===''){return _0x5bf038(_0x5f4f61[_0xc49e('0x16')](0x1f4,_0xc49e('0x31')));}if(_[_0xc49e('0x2e')](_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x32')])){return _0x5bf038(_0x5f4f61[_0xc49e('0x16')](0x1f4,_0xc49e('0x33')+_0x6967a6));}if(!_[_0xc49e('0x34')](_0x6967a6,_0x55e3c1['body'][_0xc49e('0x32')])){return _0x5bf038(_0x5f4f61[_0xc49e('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6967a6));}var _0x4b2987={};_0x4b2987[_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x32')]]=_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2f')];return db[_0xc49e('0x1b')][_0xc49e('0x22')]({'where':{'id':_0x55e3c1[_0xc49e('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0xc49e('0x36'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4b2987,'limit':0x1,'order':[[_0xc49e('0x2b'),_0xc49e('0x37')]]}]},{'model':db['MailApplication'],'as':_0xc49e('0x38')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc49e('0x10')](function(_0x1a7ebd){if(_0x1a7ebd&&_0x1a7ebd[_0xc49e('0x36')]){var _0x2a72ab=_0x1a7ebd[_0xc49e('0x39')]({'plain':!![]});_0x1a279b[_0xc49e('0x35')]=_[_0xc49e('0x3a')](_0x2a72ab,[_0xc49e('0x38'),_0xc49e('0x36')]);_0x1a279b[_0xc49e('0x3b')]=_0x2a72ab[_0xc49e('0x38')];_0x1a279b[_0xc49e('0x3c')]=_0x2a72ab[_0xc49e('0x36')];_0x1a279b[_0xc49e('0x3b')]=_[_0xc49e('0x3d')](_0x1a279b[_0xc49e('0x3b')],[_0xc49e('0x3e')],['asc']);if(_0x1a279b[_0xc49e('0x35')]&&_0x1a279b['account'][_0xc49e('0x3f')]){_0x1a279b[_0xc49e('0x3b')]['push']({'id':0x0,'priority':_0x1a279b[_0xc49e('0x3b')]['length']+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x1a279b[_0xc49e('0x35')]['Applications']){delete _0x1a279b[_0xc49e('0x35')][_0xc49e('0x38')];}if(_0x1a279b[_0xc49e('0x35')]['List']){delete _0x1a279b[_0xc49e('0x35')][_0xc49e('0x36')];}if(_0x2a72ab[_0xc49e('0x36')][_0xc49e('0x40')][_0xc49e('0x41')]){return _0x2a72ab['List'][_0xc49e('0x40')][0x0];}var _0x4e7d50=_[_0xc49e('0x42')](_0x55e3c1[_0xc49e('0x2d')],{'firstName':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2f')],'ListId':_0x2a72ab[_0xc49e('0x2c')]});_0x4e7d50[_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x32')]]=_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2f')];return db[_0xc49e('0x43')][_0xc49e('0x44')](_0x4e7d50);}else{throw new Error(_0xc49e('0x45'));}})[_0xc49e('0x10')](function(_0x5251bf){_0x1a279b[_0xc49e('0x46')]=_0x5251bf;if(_0x5251bf){if(!_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x47')]){_0x55e3c1[_0xc49e('0x2d')]['message'][_0xc49e('0x47')]=rs['generate']()+'\x20'+_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x2f')];}var _0x80f574={'ContactId':_0x5251bf['id'],'MailAccountId':_0x55e3c1[_0xc49e('0x35')]['id'],'inReplyTo':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x47')],'to':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x2f')],'cc':_0x55e3c1[_0xc49e('0x2d')]['message']['cc'],'subject':_0x55e3c1[_0xc49e('0x2d')]['message'][_0xc49e('0x48')],'attach':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x49')],'lastMsgAt':moment()[_0xc49e('0x4a')](_0xc49e('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2d')]};return db[_0xc49e('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0x55e3c1[_0xc49e('0x35')]['id']},'include':[{'model':db[_0xc49e('0x4d')],'as':_0xc49e('0x4e'),'attributes':[_0xc49e('0x47')],'where':{'messageId':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')]['inReplyTo']}}]})[_0xc49e('0x10')](function(_0x2ad865){if(_0x2ad865){return[_0x2ad865,![]];}return db[_0xc49e('0x4c')][_0xc49e('0x44')](_0x80f574)[_0xc49e('0x10')](function(_0x2cff35){return[_0x2cff35,!![]];});});}else{throw new Error(_0xc49e('0x4f'));}})[_0xc49e('0x50')](function(_0x1910bc,_0x5c586f){if(_0x1910bc){_0x5f18ae=_0x5c586f;if(!_0x5c586f){return _0x1910bc['update']({'inReplyTo':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x47')],'to':_0x55e3c1[_0xc49e('0x2d')]['message']['from'],'cc':_0x55e3c1['body'][_0xc49e('0x17')]['cc'],'subject':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x48')],'attach':_0x1910bc['attach']?_0x1910bc['attach']:_0x55e3c1[_0xc49e('0x2d')]['message'][_0xc49e('0x49')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xc49e('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2d')]});}else{return _0x1910bc;}}})[_0xc49e('0x10')](function(_0x15f21a){_0x1a279b[_0xc49e('0x51')]=_0x15f21a[_0xc49e('0x39')]({'plain':!![]});_0x1a279b['interaction'][_0xc49e('0x52')]=_0x5f18ae;return db['MailMessage'][_0xc49e('0x44')]({'body':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x2d')],'MailAccountId':_0x55e3c1[_0xc49e('0x35')]['id'],'MailInteractionId':_0x15f21a['id'],'direction':'in','ContactId':_0x1a279b[_0xc49e('0x46')]['id'],'messageId':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')]['messageId'],'from':_0x55e3c1['body'][_0xc49e('0x17')][_0xc49e('0x2f')],'to':_0x55e3c1['body'][_0xc49e('0x17')]['to'],'cc':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')]['cc'],'subject':_0x55e3c1['body'][_0xc49e('0x17')][_0xc49e('0x48')],'attach':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')]['attach'],'Attachments':_0x55e3c1[_0xc49e('0x2d')][_0xc49e('0x17')][_0xc49e('0x53')],'originTo':_0x55e3c1['body'][_0xc49e('0x17')][_0xc49e('0x54')],'originCc':_0x55e3c1['body']['message'][_0xc49e('0x55')],'bcc':_0x55e3c1['body'][_0xc49e('0x17')][_0xc49e('0x56')]},{'include':[{'model':db['Attachment'],'as':_0xc49e('0x57')}]});})['then'](function(_0x2f27dd){_0x1a279b[_0xc49e('0x17')]=_0x2f27dd;if(_0x1a279b['interaction'][_0xc49e('0x58')]){return db[_0xc49e('0x59')][_0xc49e('0x22')]({'attributes':['id',_0xc49e('0x5a')],'where':{'id':_0x1a279b[_0xc49e('0x51')][_0xc49e('0x58')]}})[_0xc49e('0x10')](function(_0x5e07c0){if(_0x5e07c0){_0x1a279b[_0xc49e('0x3b')][_0xc49e('0x5b')]({'id':0x0,'priority':0x0,'app':_0xc49e('0x5c'),'appdata':_0x5e07c0[_0xc49e('0x5a')]+','+(_0x1a279b[_0xc49e('0x35')]['waitForTheAssignedAgent']||0xa),'interval':_0xc49e('0x5d')});}return respondWithRpcPromise(_0xc49e('0x5e'),_0xc49e('0x5f'),_0x1a279b);});}return respondWithRpcPromise(_0xc49e('0x5e'),_0xc49e('0x5f'),_0x1a279b);})[_0xc49e('0x10')](function(_0x45d3db){_0x106f92(_0x45d3db);})[_0xc49e('0x19')](function(_0x10a11d){_0x5bf038(_0x5f4f61[_0xc49e('0x16')](0x1f4,_0x10a11d[_0xc49e('0x17')]));});});}; \ No newline at end of file +var _0x87d1=['autoclose','push','close','Contacts','from','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','create','Contact\x20not\x20found','update','interaction','created','MailMessage','attachments','originTo','bcc','Attachment','Attachments','User','name','UserId','unshift','agent','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','map','include','model','stringify','ShowMailAccount','find','body','mail','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','Smtp','get','account','omit','Applications','list','applications','priority','asc'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x87d1,0x82));var _0x187d=function(_0x4c8b5e,_0x230f4a){_0x4c8b5e=_0x4c8b5e-0x0;var _0x58c154=_0x87d1[_0x4c8b5e];return _0x58c154;};'use strict';var _=require(_0x187d('0x0'));var util=require(_0x187d('0x1'));var moment=require(_0x187d('0x2'));var BPromise=require(_0x187d('0x3'));var rs=require(_0x187d('0x4'));var fs=require('fs');var Redis=require(_0x187d('0x5'));var db=require(_0x187d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x187d('0x7'))(_0x187d('0x8'));var config=require(_0x187d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x187d('0xa')][_0x187d('0xb')]({'port':0x232c});config[_0x187d('0xc')]=_[_0x187d('0xd')](config[_0x187d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x187d('0xe'))(new Redis(config[_0x187d('0xc')]));require(_0x187d('0xf'))[_0x187d('0x10')](socket);function respondWithRpcPromise(_0x2840f5,_0x4489b8,_0x16306f){return new BPromise(function(_0x249c23,_0x9a7300){return client[_0x187d('0x11')](_0x2840f5,_0x16306f)[_0x187d('0x12')](function(_0x1ddfed){logger[_0x187d('0x13')](_0x187d('0x14'),_0x4489b8,_0x187d('0x15'));logger[_0x187d('0x16')](_0x187d('0x17'),_0x4489b8,_0x187d('0x15'),JSON['stringify'](_0x1ddfed));if(_0x1ddfed['error']){if(_0x1ddfed[_0x187d('0x18')][_0x187d('0x19')]===0x1f4){logger[_0x187d('0x18')](_0x187d('0x14'),_0x4489b8,_0x1ddfed[_0x187d('0x18')]['message']);return _0x9a7300(_0x1ddfed['error'][_0x187d('0x1a')]);}logger[_0x187d('0x18')](_0x187d('0x14'),_0x4489b8,_0x1ddfed['error']['message']);return _0x249c23(_0x1ddfed[_0x187d('0x18')][_0x187d('0x1a')]);}else{logger['info'](_0x187d('0x14'),_0x4489b8,_0x187d('0x15'));_0x249c23(_0x1ddfed['result'][_0x187d('0x1a')]);}})[_0x187d('0x1b')](function(_0x81d9a7){logger[_0x187d('0x18')]('MailAccount,\x20%s,\x20%s',_0x4489b8,_0x81d9a7);_0x9a7300(_0x81d9a7);});});}exports[_0x187d('0x1c')]=function(_0x142a7a){var _0x5c2693=this;return new Promise(function(_0x2691a1,_0x170ad4){return db[_0x187d('0x1d')][_0x187d('0x1e')]({'raw':_0x142a7a[_0x187d('0x1f')]?_0x142a7a[_0x187d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x142a7a['options']?_0x142a7a[_0x187d('0x1f')][_0x187d('0x20')]||null:null,'attributes':_0x142a7a[_0x187d('0x1f')]?_0x142a7a['options'][_0x187d('0x21')]||null:null,'limit':_0x142a7a[_0x187d('0x1f')]?_0x142a7a[_0x187d('0x1f')][_0x187d('0x22')]||null:null,'include':_0x142a7a[_0x187d('0x1f')]?_0x142a7a['options']['include']?_[_0x187d('0x23')](_0x142a7a[_0x187d('0x1f')][_0x187d('0x24')],function(_0x4a1cba){return{'model':db[_0x4a1cba[_0x187d('0x25')]],'as':_0x4a1cba['as'],'attributes':_0x4a1cba[_0x187d('0x21')],'include':_0x4a1cba[_0x187d('0x24')]?_[_0x187d('0x23')](_0x4a1cba[_0x187d('0x24')],function(_0x5556f3){return{'model':db[_0x5556f3[_0x187d('0x25')]],'as':_0x5556f3['as'],'attributes':_0x5556f3['attributes'],'include':_0x5556f3[_0x187d('0x24')]?_['map'](_0x5556f3[_0x187d('0x24')],function(_0x3430c0){return{'model':db[_0x3430c0['model']],'as':_0x3430c0['as'],'attributes':_0x3430c0[_0x187d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x127270){logger[_0x187d('0x13')](_0x187d('0x1c'),_0x142a7a);logger[_0x187d('0x16')](_0x187d('0x1c'),_0x142a7a,JSON[_0x187d('0x26')](_0x127270));_0x2691a1(_0x127270);})['catch'](function(_0x43cbd6){logger[_0x187d('0x18')](_0x187d('0x1c'),_0x43cbd6['message'],_0x142a7a);_0x170ad4(_0x5c2693['error'](0x1f4,_0x43cbd6[_0x187d('0x1a')]));});});};exports[_0x187d('0x27')]=function(_0x38c834){var _0x1c421e=this;return new Promise(function(_0x45a539,_0x46872b){return db[_0x187d('0x1d')][_0x187d('0x28')]({'raw':_0x38c834[_0x187d('0x1f')]?_0x38c834[_0x187d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x38c834['options']?_0x38c834[_0x187d('0x1f')][_0x187d('0x20')]||null:null,'attributes':_0x38c834[_0x187d('0x1f')]?_0x38c834[_0x187d('0x1f')][_0x187d('0x21')]||null:null,'include':_0x38c834[_0x187d('0x1f')]?_0x38c834[_0x187d('0x1f')]['include']?_[_0x187d('0x23')](_0x38c834[_0x187d('0x1f')][_0x187d('0x24')],function(_0x4fc353){return{'model':db[_0x4fc353[_0x187d('0x25')]],'as':_0x4fc353['as'],'attributes':_0x4fc353[_0x187d('0x21')],'include':_0x4fc353[_0x187d('0x24')]?_[_0x187d('0x23')](_0x4fc353[_0x187d('0x24')],function(_0x571cd2){return{'model':db[_0x571cd2[_0x187d('0x25')]],'as':_0x571cd2['as'],'attributes':_0x571cd2[_0x187d('0x21')],'include':_0x571cd2[_0x187d('0x24')]?_[_0x187d('0x23')](_0x571cd2[_0x187d('0x24')],function(_0x392b87){return{'model':db[_0x392b87['model']],'as':_0x392b87['as'],'attributes':_0x392b87[_0x187d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9dbdeb){logger['info'](_0x187d('0x27'),_0x38c834);logger[_0x187d('0x16')](_0x187d('0x27'),_0x38c834,JSON[_0x187d('0x26')](_0x9dbdeb));_0x45a539(_0x9dbdeb);})[_0x187d('0x1b')](function(_0x3a90d5){logger[_0x187d('0x18')](_0x187d('0x27'),_0x3a90d5[_0x187d('0x1a')],_0x38c834);_0x46872b(_0x1c421e[_0x187d('0x18')](0x1f4,_0x3a90d5[_0x187d('0x1a')]));});});};exports['NotifyMailAccount']=function(_0x26ef4c){var _0x23e4c0=this;return new Promise(function(_0x4545a3,_0x24a851){var _0x44ce9d={'body':_0x26ef4c[_0x187d('0x29')],'channel':_0x187d('0x2a')};var _0x46a6d4=_[_0x187d('0x2b')](_[_0x187d('0x2c')](db['CmContact']['rawAttributes']),[_0x187d('0x2d'),_0x187d('0x2e'),_0x187d('0x2f'),_0x187d('0x30')]);var _0x449d6f=![];if(_0x26ef4c[_0x187d('0x29')]['id']){delete _0x26ef4c[_0x187d('0x29')]['id'];}if(_[_0x187d('0x31')](_0x26ef4c['body']['from'])){return _0x24a851(_0x23e4c0[_0x187d('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x26ef4c['body']['body'])||_0x26ef4c['body'][_0x187d('0x29')]===''){return _0x24a851(_0x23e4c0[_0x187d('0x18')](0x1f4,_0x187d('0x32')));}if(_['isNil'](_0x26ef4c[_0x187d('0x29')][_0x187d('0x33')])){return _0x24a851(_0x23e4c0[_0x187d('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46a6d4));}if(!_['includes'](_0x46a6d4,_0x26ef4c[_0x187d('0x29')]['mapKey'])){return _0x24a851(_0x23e4c0[_0x187d('0x18')](0x1f4,_0x187d('0x34')+_0x46a6d4));}var _0x3d75af={};_0x3d75af[_0x26ef4c[_0x187d('0x29')][_0x187d('0x33')]]=_0x26ef4c[_0x187d('0x29')]['from'];return db['MailAccount'][_0x187d('0x28')]({'where':{'id':_0x26ef4c['account']['id']},'include':[{'model':db[_0x187d('0x35')],'as':_0x187d('0x36'),'include':[{'model':db[_0x187d('0x37')],'as':'Contacts','where':_0x3d75af,'limit':0x1,'order':[[_0x187d('0x2e'),_0x187d('0x38')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x187d('0x39')}]})[_0x187d('0x12')](function(_0x3b9d87){if(_0x3b9d87&&_0x3b9d87[_0x187d('0x36')]){var _0x512dc6=_0x3b9d87[_0x187d('0x3a')]({'plain':!![]});_0x44ce9d[_0x187d('0x3b')]=_[_0x187d('0x3c')](_0x512dc6,[_0x187d('0x3d'),_0x187d('0x36')]);_0x44ce9d['applications']=_0x512dc6[_0x187d('0x3d')];_0x44ce9d[_0x187d('0x3e')]=_0x512dc6['List'];_0x44ce9d[_0x187d('0x3f')]=_['orderBy'](_0x44ce9d[_0x187d('0x3f')],[_0x187d('0x40')],[_0x187d('0x41')]);if(_0x44ce9d[_0x187d('0x3b')]&&_0x44ce9d[_0x187d('0x3b')][_0x187d('0x42')]){_0x44ce9d[_0x187d('0x3f')][_0x187d('0x43')]({'id':0x0,'priority':_0x44ce9d[_0x187d('0x3f')]['length']+0x1,'app':_0x187d('0x44'),'appdata':_0x187d('0x42'),'interval':'*,*,*,*'});}if(_0x44ce9d[_0x187d('0x3b')]['Applications']){delete _0x44ce9d[_0x187d('0x3b')]['Applications'];}if(_0x44ce9d[_0x187d('0x3b')][_0x187d('0x36')]){delete _0x44ce9d[_0x187d('0x3b')][_0x187d('0x36')];}if(_0x512dc6[_0x187d('0x36')][_0x187d('0x45')]['length']){return _0x512dc6[_0x187d('0x36')][_0x187d('0x45')][0x0];}var _0x565720=_[_0x187d('0xd')](_0x26ef4c[_0x187d('0x29')],{'firstName':_0x26ef4c[_0x187d('0x29')][_0x187d('0x46')],'ListId':_0x512dc6['ListId']});_0x565720[_0x26ef4c['body'][_0x187d('0x33')]]=_0x26ef4c[_0x187d('0x29')]['from'];return db[_0x187d('0x37')]['create'](_0x565720);}else{throw new Error(_0x187d('0x47'));}})[_0x187d('0x12')](function(_0x27016b){_0x44ce9d[_0x187d('0x48')]=_0x27016b;if(_0x27016b){if(!_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x49')]){_0x26ef4c['body'][_0x187d('0x1a')][_0x187d('0x49')]=rs[_0x187d('0x4a')]()+'\x20'+_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')]['from'];}var _0x1f3930={'ContactId':_0x27016b['id'],'MailAccountId':_0x26ef4c[_0x187d('0x3b')]['id'],'inReplyTo':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x49')],'to':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')]['from'],'cc':_0x26ef4c['body'][_0x187d('0x1a')]['cc'],'subject':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x4b')],'attach':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x4c')],'lastMsgAt':moment()[_0x187d('0x4d')](_0x187d('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x26ef4c[_0x187d('0x29')][_0x187d('0x29')]};return db[_0x187d('0x4f')][_0x187d('0x28')]({'where':{'closed':![],'MailAccountId':_0x26ef4c[_0x187d('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':_0x187d('0x50'),'attributes':[_0x187d('0x49')],'where':{'messageId':_0x26ef4c['body']['message'][_0x187d('0x51')]}}]})[_0x187d('0x12')](function(_0x211d31){if(_0x211d31){return[_0x211d31,![]];}return db[_0x187d('0x4f')][_0x187d('0x52')](_0x1f3930)['then'](function(_0x362858){return[_0x362858,!![]];});});}else{throw new Error(_0x187d('0x53'));}})['spread'](function(_0x44a893,_0x896350){if(_0x44a893){_0x449d6f=_0x896350;if(!_0x896350){return _0x44a893[_0x187d('0x54')]({'inReplyTo':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x49')],'to':_0x26ef4c['body'][_0x187d('0x1a')][_0x187d('0x46')],'cc':_0x26ef4c[_0x187d('0x29')]['message']['cc'],'subject':_0x26ef4c[_0x187d('0x29')]['message'][_0x187d('0x4b')],'attach':_0x44a893[_0x187d('0x4c')]?_0x44a893[_0x187d('0x4c')]:_0x26ef4c['body'][_0x187d('0x1a')][_0x187d('0x4c')],'substatus':null,'substatusAt':moment()[_0x187d('0x4d')](_0x187d('0x4e')),'lastMsgAt':moment()[_0x187d('0x4d')](_0x187d('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x26ef4c[_0x187d('0x29')]['body']});}else{return _0x44a893;}}})[_0x187d('0x12')](function(_0x112548){_0x44ce9d['interaction']=_0x112548[_0x187d('0x3a')]({'plain':!![]});_0x44ce9d[_0x187d('0x55')][_0x187d('0x56')]=_0x449d6f;return db[_0x187d('0x57')]['create']({'body':_0x26ef4c[_0x187d('0x29')][_0x187d('0x29')],'MailAccountId':_0x26ef4c['account']['id'],'MailInteractionId':_0x112548['id'],'direction':'in','ContactId':_0x44ce9d[_0x187d('0x48')]['id'],'messageId':_0x26ef4c['body'][_0x187d('0x1a')]['messageId'],'from':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x46')],'to':_0x26ef4c[_0x187d('0x29')]['message']['to'],'cc':_0x26ef4c[_0x187d('0x29')]['message']['cc'],'subject':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')]['subject'],'attach':_0x26ef4c['body'][_0x187d('0x1a')][_0x187d('0x4c')],'Attachments':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x58')],'originTo':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x59')],'originCc':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')]['originCc'],'bcc':_0x26ef4c[_0x187d('0x29')][_0x187d('0x1a')][_0x187d('0x5a')]},{'include':[{'model':db[_0x187d('0x5b')],'as':_0x187d('0x5c')}]});})[_0x187d('0x12')](function(_0x42087f){_0x44ce9d[_0x187d('0x1a')]=_0x42087f;if(_0x44ce9d[_0x187d('0x55')]['UserId']){return db[_0x187d('0x5d')][_0x187d('0x28')]({'attributes':['id',_0x187d('0x5e')],'where':{'id':_0x44ce9d[_0x187d('0x55')][_0x187d('0x5f')]}})['then'](function(_0x32080b){if(_0x32080b){_0x44ce9d[_0x187d('0x3f')][_0x187d('0x60')]({'id':0x0,'priority':0x0,'app':_0x187d('0x61'),'appdata':_0x32080b['name']+','+(_0x44ce9d[_0x187d('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x44ce9d);});}return respondWithRpcPromise('Start','startRouting',_0x44ce9d);})[_0x187d('0x12')](function(_0x7a33d){_0x4545a3(_0x7a33d);})[_0x187d('0x1b')](function(_0x544b81){_0x24a851(_0x23e4c0[_0x187d('0x18')](0x1f4,_0x544b81[_0x187d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2df7071..ddfb3da 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 _0xb7db=['length','mailAccount:','./mailAccount.events','save','remove','emit','removeListener','register'];(function(_0x47d773,_0x6ff2af){var _0x8d01a3=function(_0x181f13){while(--_0x181f13){_0x47d773['push'](_0x47d773['shift']());}};_0x8d01a3(++_0x6ff2af);}(_0xb7db,0x19a));var _0xbb7d=function(_0x20de1f,_0x18ff3f){_0x20de1f=_0x20de1f-0x0;var _0x22a923=_0xb7db[_0x20de1f];return _0x22a923;};'use strict';var MailAccountEvents=require(_0xbb7d('0x0'));var events=[_0xbb7d('0x1'),_0xbb7d('0x2'),'update'];function createListener(_0x32007f,_0x5f4bb0){return function(_0x50363c){_0x5f4bb0[_0xbb7d('0x3')](_0x32007f,_0x50363c);};}function removeListener(_0xaab04d,_0x317292){return function(){MailAccountEvents[_0xbb7d('0x4')](_0xaab04d,_0x317292);};}exports[_0xbb7d('0x5')]=function(_0x224445){for(var _0x2445e8=0x0,_0x7b5292=events[_0xbb7d('0x6')];_0x2445e8<_0x7b5292;_0x2445e8++){var _0xb49953=events[_0x2445e8];var _0x285ff5=createListener(_0xbb7d('0x7')+_0xb49953,_0x224445);MailAccountEvents['on'](_0xb49953,_0x285ff5);}}; \ No newline at end of file +var _0xd63d=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd63d,0x75));var _0xdd63=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xd63d[_0x55ff3e];return _0x2709eb;};'use strict';var MailAccountEvents=require(_0xdd63('0x0'));var events=[_0xdd63('0x1'),_0xdd63('0x2'),'update'];function createListener(_0x4606c3,_0x165011){return function(_0x34e4b7){_0x165011[_0xdd63('0x3')](_0x4606c3,_0x34e4b7);};}function removeListener(_0x5b758e,_0x5eb21f){return function(){MailAccountEvents[_0xdd63('0x4')](_0x5b758e,_0x5eb21f);};}exports[_0xdd63('0x5')]=function(_0x205704){for(var _0x4d76df=0x0,_0x28762e=events[_0xdd63('0x6')];_0x4d76df<_0x28762e;_0x4d76df++){var _0x57fa7d=events[_0x4d76df];var _0x11059a=createListener(_0xdd63('0x7')+_0x57fa7d,_0x205704);MailAccountEvents['on'](_0x57fa7d,_0x11059a);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b7afc77..515bc8d 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 _0x4d9e=['update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put'];(function(_0x3cfaad,_0x147050){var _0x1081c3=function(_0x10d600){while(--_0x10d600){_0x3cfaad['push'](_0x3cfaad['shift']());}};_0x1081c3(++_0x147050);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x10a563,_0x815a77){_0x10a563=_0x10a563-0x0;var _0x3a2109=_0x4d9e[_0x10a563];return _0x3a2109;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4d9('0x3'));var config=require(_0xe4d9('0x4'));var controller=require('./mailApplication.controller');router[_0xe4d9('0x5')](_0xe4d9('0x6'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x9')](_0xe4d9('0x6'),auth['isAuthenticated'](),controller[_0xe4d9('0xa')]);router[_0xe4d9('0xb')](_0xe4d9('0x6'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xc')]);module[_0xe4d9('0xd')]=router; \ No newline at end of file +var _0x6308=['/:id','update','delete','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6308,0x1f2));var _0x8630=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x6308[_0x485b5a];return _0xd2b34d;};'use strict';var multer=require(_0x8630('0x0'));var util=require('util');var path=require(_0x8630('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8630('0x2')]();var auth=require(_0x8630('0x3'));var interaction=require(_0x8630('0x4'));var config=require(_0x8630('0x5'));var controller=require(_0x8630('0x6'));router['get']('/:id',auth[_0x8630('0x7')](),controller['show']);router[_0x8630('0x8')](_0x8630('0x9'),auth[_0x8630('0x7')](),controller[_0x8630('0xa')]);router[_0x8630('0xb')](_0x8630('0x9'),auth['isAuthenticated'](),controller[_0x8630('0xc')]);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 cae54ad..c3adc03 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 _0x023e=['*,*,*,*','sequelize','TEXT','STRING'];(function(_0x540eac,_0x2c34be){var _0x27146d=function(_0xea786){while(--_0xea786){_0x540eac['push'](_0x540eac['shift']());}};_0x27146d(++_0x2c34be);}(_0x023e,0xc5));var _0xe023=function(_0x1d9153,_0x51bab0){_0x1d9153=_0x1d9153-0x0;var _0x4c6aaf=_0x023e[_0x1d9153];return _0x4c6aaf;};'use strict';var Sequelize=require(_0xe023('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe023('0x1')]()},'description':{'type':Sequelize[_0xe023('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe023('0x3')}}; \ No newline at end of file +var _0x50be=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x105278,_0x774ed2){var _0x47b1f=function(_0xf8a100){while(--_0xf8a100){_0x105278['push'](_0x105278['shift']());}};_0x47b1f(++_0x774ed2);}(_0x50be,0x191));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe50b('0x0'));module[_0xe50b('0x1')]={'priority':{'type':Sequelize[_0xe50b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe50b('0x3')},'appdata':{'type':Sequelize[_0xe50b('0x4')]()},'description':{'type':Sequelize[_0xe50b('0x5')]},'interval':{'type':Sequelize[_0xe50b('0x5')],'defaultValue':_0xe50b('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 3cdd8a2..7bcaa1e 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 _0x39dc=['model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','options','then','body','find','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','show','params'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x39dc,0x1bc));var _0xc39d=function(_0x47c6a2,_0x8eafb1){_0x47c6a2=_0x47c6a2-0x0;var _0x369198=_0x39dc[_0x47c6a2];return _0x369198;};'use strict';var pdf=require(_0xc39d('0x0'));var emlformat=require(_0xc39d('0x1'));var rimraf=require(_0xc39d('0x2'));var zipdir=require(_0xc39d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc39d('0x4'));var moment=require('moment');var BPromise=require(_0xc39d('0x5'));var Mustache=require(_0xc39d('0x6'));var util=require(_0xc39d('0x7'));var path=require(_0xc39d('0x8'));var sox=require(_0xc39d('0x9'));var csv=require(_0xc39d('0xa'));var ejs=require(_0xc39d('0xb'));var fs=require('fs');var _=require(_0xc39d('0xc'));var squel=require(_0xc39d('0xd'));var crypto=require('crypto');var jsforce=require(_0xc39d('0xe'));var deskjs=require(_0xc39d('0xf'));var toCsv=require(_0xc39d('0xa'));var querystring=require(_0xc39d('0x10'));var Papa=require(_0xc39d('0x11'));var Redis=require(_0xc39d('0x12'));var authService=require(_0xc39d('0x13'));var qs=require(_0xc39d('0x14'));var hardwareService=require(_0xc39d('0x15'));var logger=require(_0xc39d('0x16'))(_0xc39d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc39d('0x18'))['db'];function respondWithStatusCode(_0x439aef,_0x44821d){_0x44821d=_0x44821d||0xcc;return function(_0xd44acc){if(_0xd44acc){return _0x439aef['sendStatus'](_0x44821d);}return _0x439aef['status'](_0x44821d)[_0xc39d('0x19')]();};}function respondWithResult(_0x578d4d,_0x9e7127){_0x9e7127=_0x9e7127||0xc8;return function(_0x273e7c){if(_0x273e7c){return _0x578d4d[_0xc39d('0x1a')](_0x9e7127)[_0xc39d('0x1b')](_0x273e7c);}};}function respondWithFilteredResult(_0x5e60ee,_0x24e1ed){return function(_0x5386ce){if(_0x5386ce){var _0x829d6a=_0x5386ce[_0xc39d('0x1c')],_0x521e0f=_0x24e1ed[_0xc39d('0x1d')],_0x131cfb=_0x24e1ed['offset']+_0x24e1ed[_0xc39d('0x1e')],_0x5b6f38;if(_0x131cfb>=_0x829d6a){_0x131cfb=_0x829d6a;_0x5b6f38=0xc8;}else{_0x5b6f38=0xce;}_0x5e60ee[_0xc39d('0x1a')](_0x5b6f38);return _0x5e60ee['set'](_0xc39d('0x1f'),_0x521e0f+'-'+_0x131cfb+'/'+_0x829d6a)[_0xc39d('0x1b')](_0x5386ce);}return null;};}function patchUpdates(_0x20d46e){return function(_0x59bc3a){try{jsonpatch[_0xc39d('0x20')](_0x59bc3a,_0x20d46e,!![]);}catch(_0x4047d2){return BPromise[_0xc39d('0x21')](_0x4047d2);}return _0x59bc3a[_0xc39d('0x22')]();};}function saveUpdates(_0x15d728,_0x12468e){return function(_0x2da52c){if(_0x2da52c){return _0x2da52c[_0xc39d('0x23')](_0x15d728)['then'](function(_0x3f66a7){return _0x3f66a7;});}return null;};}function removeEntity(_0x3bedea,_0x1f5732){return function(_0x5bc1ed){if(_0x5bc1ed){return _0x5bc1ed[_0xc39d('0x24')]()['then'](function(){_0x3bedea[_0xc39d('0x1a')](0xcc)[_0xc39d('0x19')]();});}};}function handleEntityNotFound(_0x1e5f36,_0x3016ed){return function(_0x429030){if(!_0x429030){_0x1e5f36[_0xc39d('0x25')](0x194);}return _0x429030;};}function handleError(_0x4075ed,_0x3802fe){_0x3802fe=_0x3802fe||0x1f4;return function(_0x4c8e0b){logger[_0xc39d('0x26')](_0x4c8e0b[_0xc39d('0x27')]);if(_0x4c8e0b['name']){delete _0x4c8e0b[_0xc39d('0x28')];}_0x4075ed['status'](_0x3802fe)[_0xc39d('0x29')](_0x4c8e0b);};}exports[_0xc39d('0x2a')]=function(_0x5aa784,_0x5a848e){var _0x4d399c={'raw':!![],'where':{'id':_0x5aa784[_0xc39d('0x2b')]['id']}},_0x1ff06f={};_0x1ff06f[_0xc39d('0x2c')]=_[_0xc39d('0x2d')](db[_0xc39d('0x2e')][_0xc39d('0x2f')]);_0x1ff06f[_0xc39d('0x30')]=_[_0xc39d('0x2d')](_0x5aa784['query']);_0x1ff06f[_0xc39d('0x31')]=_['intersection'](_0x1ff06f[_0xc39d('0x2c')],_0x1ff06f[_0xc39d('0x30')]);_0x4d399c[_0xc39d('0x32')]=_[_0xc39d('0x33')](_0x1ff06f['model'],qs[_0xc39d('0x34')](_0x5aa784[_0xc39d('0x30')]['fields']));_0x4d399c['attributes']=_0x4d399c[_0xc39d('0x32')][_0xc39d('0x35')]?_0x4d399c[_0xc39d('0x32')]:_0x1ff06f[_0xc39d('0x2c')];if(_0x5aa784[_0xc39d('0x30')][_0xc39d('0x36')]){_0x4d399c[_0xc39d('0x37')]=[{'all':!![]}];}_0x4d399c=_['merge']({},_0x4d399c,_0x5aa784[_0xc39d('0x38')]);return db[_0xc39d('0x2e')]['find'](_0x4d399c)[_0xc39d('0x39')](handleEntityNotFound(_0x5a848e,null))[_0xc39d('0x39')](respondWithResult(_0x5a848e,null))['catch'](handleError(_0x5a848e,null));};exports[_0xc39d('0x23')]=function(_0x24bb9e,_0x53901b){if(_0x24bb9e[_0xc39d('0x3a')]['id']){delete _0x24bb9e[_0xc39d('0x3a')]['id'];}return db['MailApplication'][_0xc39d('0x3b')]({'where':{'id':_0x24bb9e['params']['id']}})[_0xc39d('0x39')](handleEntityNotFound(_0x53901b,null))[_0xc39d('0x39')](saveUpdates(_0x24bb9e[_0xc39d('0x3a')],null))[_0xc39d('0x39')](respondWithResult(_0x53901b,null))[_0xc39d('0x3c')](handleError(_0x53901b,null));};exports[_0xc39d('0x24')]=function(_0x4bcbc3,_0x1eaaee){return db[_0xc39d('0x2e')]['find']({'where':{'id':_0x4bcbc3[_0xc39d('0x2b')]['id']}})[_0xc39d('0x39')](handleEntityNotFound(_0x1eaaee,null))[_0xc39d('0x39')](removeEntity(_0x1eaaee,null))[_0xc39d('0x3c')](handleError(_0x1eaaee,null));}; \ No newline at end of file +var _0x506a=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','keys','MailApplication','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','params','html-pdf','rimraf'];(function(_0x2c9290,_0xc96503){var _0x15b20a=function(_0x37fc39){while(--_0x37fc39){_0x2c9290['push'](_0x2c9290['shift']());}};_0x15b20a(++_0xc96503);}(_0x506a,0x1c6));var _0xa506=function(_0x9bd55b,_0x3c7f06){_0x9bd55b=_0x9bd55b-0x0;var _0x5a94d0=_0x506a[_0x9bd55b];return _0x5a94d0;};'use strict';var pdf=require(_0xa506('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa506('0x1'));var zipdir=require(_0xa506('0x2'));var jsonpatch=require(_0xa506('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa506('0x4'));var Mustache=require(_0xa506('0x5'));var util=require(_0xa506('0x6'));var path=require(_0xa506('0x7'));var sox=require(_0xa506('0x8'));var csv=require(_0xa506('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa506('0xa'));var squel=require(_0xa506('0xb'));var crypto=require('crypto');var jsforce=require(_0xa506('0xc'));var deskjs=require(_0xa506('0xd'));var toCsv=require(_0xa506('0x9'));var querystring=require(_0xa506('0xe'));var Papa=require(_0xa506('0xf'));var Redis=require(_0xa506('0x10'));var authService=require(_0xa506('0x11'));var qs=require(_0xa506('0x12'));var hardwareService=require(_0xa506('0x13'));var logger=require('../../config/logger')(_0xa506('0x14'));var utils=require(_0xa506('0x15'));var config=require(_0xa506('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x538a59,_0x505adb){_0x505adb=_0x505adb||0xcc;return function(_0x3fab0f){if(_0x3fab0f){return _0x538a59['sendStatus'](_0x505adb);}return _0x538a59[_0xa506('0x17')](_0x505adb)[_0xa506('0x18')]();};}function respondWithResult(_0x534c0b,_0x27e4cc){_0x27e4cc=_0x27e4cc||0xc8;return function(_0x46a235){if(_0x46a235){return _0x534c0b[_0xa506('0x17')](_0x27e4cc)[_0xa506('0x19')](_0x46a235);}};}function respondWithFilteredResult(_0x269682,_0xa7597e){return function(_0x3ae7a1){if(_0x3ae7a1){var _0x3550df=_0x3ae7a1['count'],_0x304b15=_0xa7597e['offset'],_0x124dcc=_0xa7597e[_0xa506('0x1a')]+_0xa7597e['limit'],_0xd22c4d;if(_0x124dcc>=_0x3550df){_0x124dcc=_0x3550df;_0xd22c4d=0xc8;}else{_0xd22c4d=0xce;}_0x269682[_0xa506('0x17')](_0xd22c4d);return _0x269682[_0xa506('0x1b')](_0xa506('0x1c'),_0x304b15+'-'+_0x124dcc+'/'+_0x3550df)[_0xa506('0x19')](_0x3ae7a1);}return null;};}function patchUpdates(_0x20ebec){return function(_0x54246d){try{jsonpatch[_0xa506('0x1d')](_0x54246d,_0x20ebec,!![]);}catch(_0x1130f0){return BPromise[_0xa506('0x1e')](_0x1130f0);}return _0x54246d[_0xa506('0x1f')]();};}function saveUpdates(_0x5c9c0a,_0x2573c9){return function(_0xc71995){if(_0xc71995){return _0xc71995[_0xa506('0x20')](_0x5c9c0a)[_0xa506('0x21')](function(_0x37d120){return _0x37d120;});}return null;};}function removeEntity(_0x39de62,_0x391853){return function(_0x5f5671){if(_0x5f5671){return _0x5f5671[_0xa506('0x22')]()[_0xa506('0x21')](function(){_0x39de62[_0xa506('0x17')](0xcc)[_0xa506('0x18')]();});}};}function handleEntityNotFound(_0x21a7ef,_0x329065){return function(_0x1e55c8){if(!_0x1e55c8){_0x21a7ef[_0xa506('0x23')](0x194);}return _0x1e55c8;};}function handleError(_0x4ce3ea,_0x11ca92){_0x11ca92=_0x11ca92||0x1f4;return function(_0x5dc6f1){logger[_0xa506('0x24')](_0x5dc6f1[_0xa506('0x25')]);if(_0x5dc6f1[_0xa506('0x26')]){delete _0x5dc6f1['name'];}_0x4ce3ea[_0xa506('0x17')](_0x11ca92)[_0xa506('0x27')](_0x5dc6f1);};}exports[_0xa506('0x28')]=function(_0x108c17,_0x49e08f){var _0x7e1e3d={'raw':!![],'where':{'id':_0x108c17['params']['id']}},_0x3608b3={};_0x3608b3['model']=_[_0xa506('0x29')](db[_0xa506('0x2a')]['rawAttributes']);_0x3608b3[_0xa506('0x2b')]=_[_0xa506('0x29')](_0x108c17[_0xa506('0x2b')]);_0x3608b3[_0xa506('0x2c')]=_[_0xa506('0x2d')](_0x3608b3[_0xa506('0x2e')],_0x3608b3[_0xa506('0x2b')]);_0x7e1e3d[_0xa506('0x2f')]=_['intersection'](_0x3608b3[_0xa506('0x2e')],qs[_0xa506('0x30')](_0x108c17[_0xa506('0x2b')][_0xa506('0x30')]));_0x7e1e3d['attributes']=_0x7e1e3d[_0xa506('0x2f')][_0xa506('0x31')]?_0x7e1e3d[_0xa506('0x2f')]:_0x3608b3['model'];if(_0x108c17['query'][_0xa506('0x32')]){_0x7e1e3d[_0xa506('0x33')]=[{'all':!![]}];}_0x7e1e3d=_[_0xa506('0x34')]({},_0x7e1e3d,_0x108c17['options']);return db[_0xa506('0x2a')][_0xa506('0x35')](_0x7e1e3d)[_0xa506('0x21')](handleEntityNotFound(_0x49e08f,null))[_0xa506('0x21')](respondWithResult(_0x49e08f,null))[_0xa506('0x36')](handleError(_0x49e08f,null));};exports['update']=function(_0x4bfb59,_0x2d1b4b){if(_0x4bfb59[_0xa506('0x37')]['id']){delete _0x4bfb59[_0xa506('0x37')]['id'];}return db[_0xa506('0x2a')]['find']({'where':{'id':_0x4bfb59[_0xa506('0x38')]['id']}})[_0xa506('0x21')](handleEntityNotFound(_0x2d1b4b,null))[_0xa506('0x21')](saveUpdates(_0x4bfb59['body'],null))[_0xa506('0x21')](respondWithResult(_0x2d1b4b,null))[_0xa506('0x36')](handleError(_0x2d1b4b,null));};exports[_0xa506('0x22')]=function(_0x1bb60f,_0x7ca221){return db[_0xa506('0x2a')]['find']({'where':{'id':_0x1bb60f[_0xa506('0x38')]['id']}})[_0xa506('0x21')](handleEntityNotFound(_0x7ca221,null))['then'](removeEntity(_0x7ca221,null))['catch'](handleError(_0x7ca221,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index a7299f7..b11cb34 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 _0x4bb0=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication'];(function(_0x2ee981,_0x258202){var _0x31ef0d=function(_0x316a0a){while(--_0x316a0a){_0x2ee981['push'](_0x2ee981['shift']());}};_0x31ef0d(++_0x258202);}(_0x4bb0,0x73));var _0x04bb=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x4bb0[_0x506172];return _0x2723c0;};'use strict';var _=require(_0x04bb('0x0'));var util=require(_0x04bb('0x1'));var logger=require(_0x04bb('0x2'))(_0x04bb('0x3'));var moment=require(_0x04bb('0x4'));var BPromise=require(_0x04bb('0x5'));var rp=require(_0x04bb('0x6'));var fs=require('fs');var path=require(_0x04bb('0x7'));var rimraf=require(_0x04bb('0x8'));var config=require(_0x04bb('0x9'));var attributes=require(_0x04bb('0xa'));module['exports']=function(_0x2eae0e,_0x579bb4){return _0x2eae0e[_0x04bb('0xb')](_0x04bb('0xc'),attributes,{'tableName':_0x04bb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x04bb('0xe'),'collate':_0x04bb('0xf')});}; \ No newline at end of file +var _0x9245=['api','moment','bluebird','path','rimraf','./mailApplication.attributes','exports','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x9245,0x99));var _0x5924=function(_0x44c77b,_0x5c027f){_0x44c77b=_0x44c77b-0x0;var _0x154272=_0x9245[_0x44c77b];return _0x154272;};'use strict';var _=require(_0x5924('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5924('0x1'));var moment=require(_0x5924('0x2'));var BPromise=require(_0x5924('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5924('0x4'));var rimraf=require(_0x5924('0x5'));var config=require('../../config/environment');var attributes=require(_0x5924('0x6'));module[_0x5924('0x7')]=function(_0x13c041,_0x2d7a89){return _0x13c041['define'](_0x5924('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5924('0x9'),'collate':_0x5924('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b13d336..c4a8711 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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x1f3b96,_0x1ea174){var _0x1eba90=function(_0x473a75){while(--_0x473a75){_0x1f3b96['push'](_0x1f3b96['shift']());}};_0x1eba90(++_0x1ea174);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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']('MailApplication,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xf11d99,_0x20d9b3){var _0x15ce16=function(_0x175b3b){while(--_0x175b3b){_0xf11d99['push'](_0xf11d99['shift']());}};_0x15ce16(++_0x20d9b3);}(_0x7a54,0x106));var _0x47a5=function(_0x5326b4,_0x1ea863){_0x5326b4=_0x5326b4-0x0;var _0x454a4d=_0x7a54[_0x5326b4];return _0x454a4d;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9759d7c..490e17f 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mailinteraction:addtags','addTags','mail','update','delete','mailinteraction:destroy','destroy','exports'];(function(_0xf993ce,_0x7d71ec){var _0x1b6a18=function(_0x1e7c9d){while(--_0x1e7c9d){_0xf993ce['push'](_0xf993ce['shift']());}};_0x1b6a18(++_0x7d71ec);}(_0x34e8,0x12c));var _0x834e=function(_0x403192,_0x5b23b8){_0x403192=_0x403192-0x0;var _0x501bad=_0x34e8[_0x403192];return _0x501bad;};'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 auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0x13')]);router['post'](_0x834e('0xe'),auth[_0x834e('0xa')](),controller['addMessage']);router[_0x834e('0x12')](_0x834e('0x14'),auth[_0x834e('0xa')](),interaction[_0x834e('0x15')]('mail',_0x834e('0x16')),controller[_0x834e('0x17')]);router['put'](_0x834e('0xc'),auth['isAuthenticated'](),interaction[_0x834e('0x15')](_0x834e('0x18'),'mailinteraction:update'),controller[_0x834e('0x19')]);router[_0x834e('0x1a')](_0x834e('0xc'),auth['isAuthenticated'](),interaction[_0x834e('0x15')](_0x834e('0x18'),_0x834e('0x1b')),controller[_0x834e('0x1c')]);router[_0x834e('0x1a')](_0x834e('0x14'),auth[_0x834e('0xa')](),controller['removeTags']);module[_0x834e('0x1d')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','update','mailinteraction:destroy','destroy','multer','util','path'];(function(_0x51e011,_0x5abb6e){var _0x5d9aa3=function(_0x418c22){while(--_0x418c22){_0x51e011['push'](_0x51e011['shift']());}};_0x5d9aa3(++_0x5abb6e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailInteraction.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')]('/',auth['isAuthenticated'](),controller[_0x7995('0x13')]);router[_0x7995('0x12')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x7995('0x16'),_0x7995('0x17')),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0x9')](),interaction[_0x7995('0x1a')](_0x7995('0x16'),'mailinteraction:update'),controller[_0x7995('0x1b')]);router['delete'](_0x7995('0xc'),auth[_0x7995('0x9')](),interaction[_0x7995('0x1a')](_0x7995('0x16'),_0x7995('0x1c')),controller[_0x7995('0x1d')]);router['delete']('/:id/tags',auth[_0x7995('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 189ea7d..71b4fb3 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 _0x25a3=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize','iconv','exports'];(function(_0x59c76e,_0x273e2e){var _0x1bdc6b=function(_0x40aaca){while(--_0x40aaca){_0x59c76e['push'](_0x59c76e['shift']());}};_0x1bdc6b(++_0x273e2e);}(_0x25a3,0x1ab));var _0x325a=function(_0x2b045e,_0xb70f89){_0x2b045e=_0x2b045e-0x0;var _0x5329cf=_0x25a3[_0x2b045e];return _0x5329cf;};'use strict';var Sequelize=require(_0x325a('0x0'));var iconv=require(_0x325a('0x1'));module[_0x325a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x325a('0x3')]},'disposition':{'type':Sequelize[_0x325a('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x325a('0x4')](0x1fe)},'to':{'type':Sequelize[_0x325a('0x4')]},'cc':{'type':Sequelize[_0x325a('0x5')](_0x325a('0x6'))},'subject':{'type':Sequelize[_0x325a('0x5')]()},'attach':{'type':Sequelize[_0x325a('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x325a('0x8')]('in',_0x325a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x325a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x325a('0x8')]('in',_0x325a('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x325a('0x5')](_0x325a('0x6'))},'lastMsgText':{'type':Sequelize[_0x325a('0x5')](_0x325a('0x6'))}}; \ No newline at end of file +var _0xc4b4=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xc4b4,0x6b));var _0x4c4b=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xc4b4[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x4c4b('0x0'));var iconv=require('iconv');module[_0x4c4b('0x1')]={'closed':{'type':Sequelize[_0x4c4b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c4b('0x3')]},'disposition':{'type':Sequelize[_0x4c4b('0x4')]},'note':{'type':Sequelize[_0x4c4b('0x4')]},'inReplyTo':{'type':Sequelize[_0x4c4b('0x4')](0x1fe)},'to':{'type':Sequelize[_0x4c4b('0x4')]},'cc':{'type':Sequelize[_0x4c4b('0x5')](_0x4c4b('0x6'))},'subject':{'type':Sequelize[_0x4c4b('0x5')]()},'attach':{'type':Sequelize[_0x4c4b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4c4b('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x4c4b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4c4b('0x7')]('in',_0x4c4b('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4c4b('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x4c4b('0x5')](_0x4c4b('0x6'))},'lastMsgText':{'type':Sequelize[_0x4c4b('0x5')](_0x4c4b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 551a630..824229a 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 _0x0713=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./mailInteraction.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','TagIds','Tags','push','findOne','lastMsgBody','lastMsgText','trimStart','catch','MailInteraction','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','field','color','from','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','select','mail_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','keys','forEach','dateStart','startOf','day','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','unreadMessages','isArray','value','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20<\x20?','\x20IN\x20?','\x20>\x20?','map','isNil','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','split','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','keyBy','COUNT(me.id)','a.key','Account.key','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','sequelize','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','rows','rawAttributes','includeAll','include','merge','options','find','create','body','params','describe','addMessage','ids','omit','getMessages','MailMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','server','files','root','tmp','bcc','subject','attachments','Attachment','Attachments','mkdirSync','each','headers','Bcc','existsSync','type','readFileSync','build','writeFileSync','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x2c786c,_0x15d810){var _0x3d7d8e=function(_0x8accde){while(--_0x8accde){_0x2c786c['push'](_0x2c786c['shift']());}};_0x3d7d8e(++_0x15d810);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var htmlToText=require(_0x3071('0x11'));var Redis=require(_0x3071('0x12'));var authService=require(_0x3071('0x13'));var qs=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];config[_0x3071('0x1a')]=_['defaults'](config['redis'],{'host':_0x3071('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x1a')]));require(_0x3071('0x1c'))['register'](socket);function respondWithStatusCode(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xcc;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1d')](_0x4e1219);}return _0x104e73[_0x3071('0x1e')](_0x4e1219)[_0x3071('0x1f')]();};}function respondWithResult(_0x1caa5d,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xc8;return function(_0x157a47){if(_0x157a47){return _0x1caa5d[_0x3071('0x1e')](_0x2a6a4b)[_0x3071('0x20')](_0x157a47);}};}function respondWithFilteredResult(_0x344ea6,_0x5f3c22){return function(_0x224996){if(_0x224996){var _0x17dbda=_0x224996[_0x3071('0x21')],_0x1068d9=_0x5f3c22[_0x3071('0x22')],_0x108a83=_0x5f3c22[_0x3071('0x22')]+_0x5f3c22['limit'],_0x3acf0e;if(_0x108a83>=_0x17dbda){_0x108a83=_0x17dbda;_0x3acf0e=0xc8;}else{_0x3acf0e=0xce;}_0x344ea6[_0x3071('0x1e')](_0x3acf0e);return _0x344ea6[_0x3071('0x23')](_0x3071('0x24'),_0x1068d9+'-'+_0x108a83+'/'+_0x17dbda)['json'](_0x224996);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x25')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x26')](_0x43128c);}return _0x5cd80d[_0x3071('0x27')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x28')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x29')]()[_0x3071('0x2a')](function(){_0x2ce48a[_0x3071('0x1e')](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x1fe727,_0x1de5fb){return function(_0x4c7130){if(!_0x4c7130){_0x1fe727[_0x3071('0x1d')](0x194);}return _0x4c7130;};}function handleError(_0x3f1e6e,_0x177138){_0x177138=_0x177138||0x1f4;return function(_0x4d5c4b){logger[_0x3071('0x2b')](_0x4d5c4b[_0x3071('0x2c')]);if(_0x4d5c4b[_0x3071('0x2d')]){delete _0x4d5c4b[_0x3071('0x2d')];}_0x3f1e6e[_0x3071('0x1e')](_0x177138)[_0x3071('0x2e')](_0x4d5c4b);};}function getInteractionUsers(_0x177b5f,_0x3921a1){return new BPromise(function(_0x32f1b4,_0x292205){try{if(_0x3921a1[_0x177b5f['id']]){_0x177b5f[_0x3071('0x2f')]=_['map'](_0x3921a1[_0x177b5f['id']],function(_0x4f1484){return{'id':_0x4f1484['id']};});}}catch(_0x9e26d1){_0x292205(_0x9e26d1);}_0x32f1b4(_0x177b5f);});}function getInteractionTags(_0x149e0d,_0x6ddf96){return new BPromise(function(_0x40be95,_0x3f6d90){try{if(_0x149e0d[_0x3071('0x30')]){_0x149e0d[_0x3071('0x31')]=[];_0x149e0d[_0x3071('0x30')]['split'](',')['forEach'](function(_0x4ab983){_0x149e0d[_0x3071('0x31')][_0x3071('0x32')](_0x6ddf96[_0x4ab983]);});}delete _0x149e0d['TagIds'];}catch(_0x17407a){_0x3f6d90(_0x17407a);}_0x40be95(_0x149e0d);});}function getLastMessageText(_0x28747d){return new BPromise(function(_0x25250e,_0x13ae2c){return db['MailInteraction'][_0x3071('0x33')]({'where':{'id':_0x28747d['id']},'attributes':[_0x3071('0x34'),_0x3071('0x35')],'raw':!![]})[_0x3071('0x2a')](function(_0x148096){if(!_0x148096[_0x3071('0x35')]){_0x28747d[_0x3071('0x35')]=_[_0x3071('0x36')](htmlToText['fromString'](_0x148096[_0x3071('0x34')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x28747d['lastMsgText']=_0x148096['lastMsgText'];}_0x25250e(_0x28747d);})[_0x3071('0x37')](function(_0xa3a7ae){_0x13ae2c(_0xa3a7ae);});});}function updateMailInteraction(_0x54d9c3,_0x2e85c8,_0x46e94e,_0x265d76){return new BPromise(function(_0x14ac42,_0xc60572){return getInteractionUsers(_0x54d9c3,_0x46e94e)[_0x3071('0x2a')](function(_0x5610ab){return getInteractionTags(_0x5610ab,_0x2e85c8);})[_0x3071('0x2a')](function(_0xd7971f){if(_0x265d76){_0x14ac42(getLastMessageText(_0xd7971f));}else{_0x14ac42(_0xd7971f);}})['catch'](function(_0x44ad05){_0xc60572(_0x44ad05);});});}exports['index']=function(_0x28f855,_0x43133a){var _0x5733e9={},_0x593c99={},_0x283074={'count':0x0,'rows':[]};var _0x185f63=db[_0x3071('0x38')]['rawAttributes'];_0x593c99[_0x3071('0x39')]=_['keys'](_0x185f63);_0x593c99[_0x3071('0x3a')]=_['keys'](_0x28f855[_0x3071('0x3a')]);_0x593c99[_0x3071('0x3b')]=_[_0x3071('0x3c')](_0x593c99[_0x3071('0x39')],_0x593c99[_0x3071('0x3a')]);_0x5733e9['attributes']=_['intersection'](_0x593c99[_0x3071('0x39')],qs[_0x3071('0x3d')](_0x28f855[_0x3071('0x3a')][_0x3071('0x3d')]));_0x5733e9['attributes']=_0x5733e9[_0x3071('0x3e')][_0x3071('0x3f')]?_0x5733e9[_0x3071('0x3e')]:_0x593c99[_0x3071('0x39')];if(!_0x28f855[_0x3071('0x3a')][_0x3071('0x40')]('nolimit')){_0x5733e9[_0x3071('0x41')]=qs['limit'](_0x28f855['query']['limit']);_0x5733e9['offset']=qs[_0x3071('0x22')](_0x28f855[_0x3071('0x3a')][_0x3071('0x22')]);}_0x5733e9[_0x3071('0x42')]=qs[_0x3071('0x43')](_0x28f855[_0x3071('0x3a')][_0x3071('0x43')]);_0x5733e9[_0x3071('0x44')]=qs['filters'](_[_0x3071('0x45')](_0x28f855[_0x3071('0x3a')],_0x593c99[_0x3071('0x3b')]));var _0x151a9c=[];var _0x93cbcc=squel['select']()['field']('id')[_0x3071('0x46')](_0x3071('0x2d'))[_0x3071('0x46')](_0x3071('0x47'))[_0x3071('0x48')]('tools_tags');var _0x9444d=squel['select']()[_0x3071('0x46')]('COUNT(*)')['from'](_0x3071('0x49'),'me')['where'](_0x3071('0x4a'))['where'](_0x3071('0x4b'))[_0x3071('0x44')](_0x3071('0x4c'));var _0x25d752=squel['select']()[_0x3071('0x46')]('u.id')[_0x3071('0x46')]('ui.MailInteractionId')[_0x3071('0x48')](_0x3071('0x4d'),'ui')['left_join'](_0x3071('0x4e'),'u',_0x3071('0x4f'));var _0x224a70=squel[_0x3071('0x50')]()[_0x3071('0x48')](_0x3071('0x51'),'i')[_0x3071('0x52')]('cm_contacts','c',_0x3071('0x53'))[_0x3071('0x52')](_0x3071('0x4e'),'o',_0x3071('0x54'))['left_join'](_0x3071('0x55'),'a',_0x3071('0x56'))[_0x3071('0x52')](_0x3071('0x49'),'me',_0x3071('0x57'));var _0x26c8e4=squel[_0x3071('0x58')]();if(_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]){var _0x32b2e2=JSON[_0x3071('0x5a')](_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]);_[_0x3071('0x5b')](_0x32b2e2)[_0x3071('0x5c')](function(_0x12be97){var _0x596cdd=_0x32b2e2[_0x12be97];if(_0x12be97==='createdAt'){var _0x12536d=moment(_0x596cdd['value'][_0x3071('0x5d')])[_0x3071('0x5e')](_0x3071('0x5f'))['utc']()[_0x3071('0x60')]();var _0x1ada95=moment(_0x1ada95)['utc']()['endOf'](_0x3071('0x5f'))[_0x3071('0x60')]();_0x26c8e4[_0x3071('0x61')](_0x3071('0x62'),_0x12536d,_0x1ada95);}else{if(_['isArray'](_0x596cdd[_0x3071('0x63')])){_0x596cdd[_0x3071('0x63')][_0x3071('0x5c')](function(_0x41f02a){switch(_0x596cdd[_0x3071('0x63')]['value']){case'IS':if(_0x12be97!==_0x3071('0x64')&&_0x12be97!==_0x3071('0x65')){if(_[_0x3071('0x66')](_0x596cdd[_0x3071('0x67')])&&_0x596cdd[_0x3071('0x67')][_0x3071('0x3f')]>0x1){_0x26c8e4[_0x3071('0x61')](_0x596cdd['tableAlias']+'.'+_0x12be97+'\x20IN\x20?',_0x596cdd[_0x3071('0x67')]);}else{_0x26c8e4['and'](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x69'),_0x596cdd['value'][0x0]);}}break;case'=':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20=\x20?',_0x596cdd[_0x3071('0x67')]);break;case _0x3071('0x6a'):if(_0x12be97===_0x3071('0x6b')){_0x26c8e4[_0x3071('0x61')](_0x3071('0x6c')+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');_0x26c8e4['or'](_0x3071('0x6d')+_0x3071('0x6e'),'%'+_0x596cdd['value']+'%');_0x26c8e4['or'](_0x3071('0x6f')+_0x3071('0x6e'),'%'+_0x596cdd[_0x3071('0x67')]+'%');}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x6e'),'%'+_0x596cdd[_0x3071('0x67')]+'%');}break;case'>':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20>\x20?',_0x596cdd[_0x3071('0x67')]);break;case'<':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x70'),_0x596cdd[_0x3071('0x67')]);break;}});}else{switch(_0x596cdd[_0x3071('0x63')][_0x3071('0x67')]){case'IS':if(_0x12be97!==_0x3071('0x64')&&_0x12be97!==_0x3071('0x65')){if(_[_0x3071('0x66')](_0x596cdd[_0x3071('0x67')])&&_0x596cdd['value'][_0x3071('0x3f')]>0x1){_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x71'),_0x596cdd[_0x3071('0x67')]);}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x69'),_0x596cdd['value'][0x0]);}}break;case'=':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20=\x20?',_0x596cdd['value']);break;case _0x3071('0x6a'):if(_0x12be97===_0x3071('0x6b')){_0x26c8e4[_0x3071('0x61')](_0x3071('0x6c')+'\x20LIKE\x20?','%'+_0x596cdd['value']+'%');_0x26c8e4['or'](_0x3071('0x6d')+'\x20LIKE\x20?','%'+_0x596cdd['value']+'%');_0x26c8e4['or']('c.email'+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');}else{_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20LIKE\x20?','%'+_0x596cdd[_0x3071('0x67')]+'%');}break;case'>':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+_0x3071('0x72'),_0x596cdd['value']);break;case'<':_0x26c8e4[_0x3071('0x61')](_0x596cdd[_0x3071('0x68')]+'.'+_0x12be97+'\x20<\x20?',_0x596cdd[_0x3071('0x67')]);break;}}}});}else{var _0x29ee70=_(Object[_0x3071('0x5b')](_0x28f855[_0x3071('0x3a')]))[_0x3071('0x73')](function(_0x11ffdd){return _0x185f63[_0x3071('0x40')](_0x11ffdd)?_0x11ffdd:undefined;})['filter'](function(_0x5dde93){return!_[_0x3071('0x74')](_0x5dde93);})[_0x3071('0x67')]();if(!_[_0x3071('0x75')](_0x29ee70)){_0x29ee70['forEach'](function(_0x53ebfe){if(_0x53ebfe===_0x3071('0x76')){_0x224a70[_0x3071('0x44')](_0x3071('0x77'),[][_0x3071('0x78')](_0x28f855[_0x3071('0x3a')][_0x53ebfe]));}else if(_0x53ebfe===_0x3071('0x79')){var _0x19bc85=JSON[_0x3071('0x5a')](_0x28f855['query'][_0x53ebfe])[_0x3071('0x7a')];var _0x5ea33f=JSON[_0x3071('0x5a')](_0x28f855[_0x3071('0x3a')][_0x53ebfe])[_0x3071('0x7b')];_0x224a70[_0x3071('0x44')](_0x3071('0x62'),_0x19bc85,_0x5ea33f);}else{if(_0x28f855[_0x3071('0x3a')][_0x53ebfe]===_0x3071('0x7c')){_0x224a70[_0x3071('0x44')]('i.'+_0x53ebfe+'\x20IS\x20NULL');}else{_0x224a70[_0x3071('0x44')]('i.'+_0x53ebfe+_0x3071('0x69'),_0x28f855[_0x3071('0x3a')][_0x53ebfe]);}}});}if(_0x28f855['query'][_0x3071('0x7d')]){var _0x22ec7b=_0x28f855[_0x3071('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0x3071('0x7e')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x3071('0x7f')](_0x22ec7b)){_0x26c8e4['or'](_0x3071('0x80'),_0x22ec7b+'%');}else if(qs[_0x3071('0x81')](_0x22ec7b)){_0x26c8e4['or'](_0x3071('0x82'),_0x22ec7b+'%');}else{var _0x311939=[];_0x22ec7b[_0x3071('0x83')]('\x20')[_0x3071('0x5c')](function(_0x4c67ec){_0x311939[_0x3071('0x32')]('+'+_0x4c67ec[_0x3071('0x84')]());});var _0x42d310=_0x311939[_0x3071('0x85')]('\x20');_0x26c8e4['or'](_0x3071('0x86'),_0x42d310)['or'](_0x3071('0x87'),_0x42d310);}}}_0x224a70[_0x3071('0x44')](_0x26c8e4);if(_0x5733e9[_0x3071('0x42')]){_0x5733e9['order'][_0x3071('0x5c')](function(_0x5ed436){_0x224a70[_0x3071('0x42')]('i.'+_0x5ed436[0x0],_0x5ed436[0x1]===_0x3071('0x88')?![]:!![]);});}_0x224a70[_0x3071('0x89')](_0x3071('0x8a'));var _0x33746e={'type':db[_0x3071('0x8b')][_0x3071('0x8c')][_0x3071('0x8d')],'raw':!![]};var _0x77df0=_0x224a70[_0x3071('0x8e')]()['field'](_0x3071('0x8f'))[_0x3071('0x46')]('COUNT(me.id)',_0x3071('0x65'));if(!_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]){if(_0x28f855[_0x3071('0x3a')][_0x3071('0x90')]){if(_0x28f855['query']['read']==0x1){_0x77df0[_0x3071('0x91')]('`unreadMessages`\x20=\x200');_0x224a70[_0x3071('0x91')](_0x3071('0x92'));}else{_0x77df0[_0x3071('0x91')](_0x3071('0x93'));_0x224a70[_0x3071('0x91')](_0x3071('0x93'));}}if(_0x28f855['query'][_0x3071('0x94')]){var _0xa732ea=_[_0x3071('0x66')](_0x28f855[_0x3071('0x3a')]['tag'])?_0x28f855[_0x3071('0x3a')][_0x3071('0x94')]:new Array(_0x28f855['query'][_0x3071('0x94')]);var _0x2ea7e9=squel[_0x3071('0x58')]();_0xa732ea[_0x3071('0x5c')](function(_0x34e4f3){_0x2ea7e9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34e4f3+',%');});_0x224a70[_0x3071('0x91')](_0x2ea7e9);_0x77df0['left_join'](_0x3071('0x95'),'it',_0x3071('0x96'));_0x77df0[_0x3071('0x52')](_0x3071('0x97'),'t',_0x3071('0x98'));_0x77df0[_0x3071('0x44')](_0x3071('0x99'),_0xa732ea);}}else{var _0x32b2e2=JSON['parse'](_0x28f855[_0x3071('0x3a')][_0x3071('0x59')]);_[_0x3071('0x5b')](_0x32b2e2)['forEach'](function(_0xc62ee){var _0x5d22b0=_0x32b2e2[_0xc62ee];if(_0xc62ee===_0x3071('0x64')){var _0x5a5861=_0x5d22b0[_0x3071('0x67')];var _0x5e0cbd=squel[_0x3071('0x58')]();_0x5a5861[_0x3071('0x5c')](function(_0x3cbb6e){_0x5e0cbd['or'](_0x3071('0x9a'),'%,'+_0x3cbb6e+',%');});_0x224a70[_0x3071('0x91')](_0x5e0cbd);_0x77df0[_0x3071('0x52')](_0x3071('0x95'),'it',_0x3071('0x96'));_0x77df0[_0x3071('0x52')]('tools_tags','t',_0x3071('0x98'));_0x77df0[_0x3071('0x44')](_0x3071('0x99'),_0x5a5861);}else if(_0xc62ee==='unreadMessages'){if(_0x5d22b0['value']['length']===0x1){if(_0x5d22b0['value'][0x0]===0x1){_0x77df0['having'](_0x3071('0x92'));_0x224a70[_0x3071('0x91')]('`unreadMessages`\x20=\x200');}else{_0x77df0[_0x3071('0x91')](_0x3071('0x93'));_0x224a70[_0x3071('0x91')]('`unreadMessages`\x20>\x200');}}}});}db['sequelize'][_0x3071('0x3a')](_0x77df0[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x8cdb97){_0x283074[_0x3071('0x21')]=_0x8cdb97[_0x3071('0x3f')];if(_0x283074[_0x3071('0x21')]===0x0)return[];return db['sequelize']['query'](_0x93cbcc[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x3db9c8){_0x151a9c=_[_0x3071('0x9b')](_0x3db9c8,'id');_0x33746e=_['merge'](_0x33746e,{'model':db[_0x3071('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x224a70[_0x3071('0x46')](_0x3071('0x9c'),_0x3071('0x65'));_0x224a70[_0x3071('0x46')](_0x3071('0x9d'),_0x3071('0x9e'));_0x224a70[_0x3071('0x46')]('i.id');_0x224a70[_0x3071('0x46')](_0x3071('0x9f'));_0x224a70[_0x3071('0x46')](_0x3071('0xa0'));_0x224a70[_0x3071('0x46')]('i.closed');_0x224a70[_0x3071('0x46')]('i.closedAt');_0x224a70['field'](_0x3071('0xa1'));_0x224a70[_0x3071('0x46')](_0x3071('0xa2'));_0x224a70['field'](_0x3071('0xa3'));_0x224a70[_0x3071('0x46')](_0x3071('0xa4'));_0x224a70[_0x3071('0x46')](_0x3071('0xa5'));_0x224a70['field']('i.substatus');_0x224a70[_0x3071('0x46')](_0x3071('0xa6'));_0x224a70['field'](_0x3071('0xa7'));_0x224a70[_0x3071('0x46')](_0x3071('0xa8'));_0x224a70[_0x3071('0x46')](_0x3071('0xa9'));_0x224a70['field'](_0x3071('0x6c'),'Contact.firstName');_0x224a70[_0x3071('0x46')](_0x3071('0x6d'),'Contact.lastName');_0x224a70[_0x3071('0x46')]('c.email',_0x3071('0xaa'));_0x224a70[_0x3071('0x46')](_0x3071('0xab'),_0x3071('0xac'));_0x224a70['field'](_0x3071('0xad'),'Contact.mobile');_0x224a70[_0x3071('0x46')]('c.fax',_0x3071('0xae'));_0x224a70[_0x3071('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3071('0x30'));_0x224a70[_0x3071('0x52')]('mail_interaction_has_tags','it',_0x3071('0x96'));_0x224a70[_0x3071('0x52')](_0x3071('0x97'),'t',_0x3071('0x98'));_0x224a70[_0x3071('0x41')](_0x5733e9[_0x3071('0x41')]);_0x224a70[_0x3071('0x22')](_0x5733e9[_0x3071('0x22')]);return db[_0x3071('0xaf')][_0x3071('0x3a')](_0x224a70[_0x3071('0x84')](),_0x33746e);})[_0x3071('0x2a')](function(_0x397a07){_0x25d752[_0x3071('0x44')](_0x3071('0xb0'),_['map'](_0x397a07,'id'));return db[_0x3071('0xaf')][_0x3071('0x3a')](_0x25d752[_0x3071('0x84')](),_0x33746e)[_0x3071('0x2a')](function(_0x19f63d){var _0x5910a7=_['groupBy'](_0x19f63d,_0x3071('0xb1'));var _0x2e7859=[];return db['Setting'][_0x3071('0x33')]({'attributes':[_0x3071('0xb2')],'raw':!![]})['then'](function(_0x49c3e8){var _0x2edff8=_0x49c3e8[_0x3071('0xb2')];_0x397a07[_0x3071('0x5c')](function(_0x30ed66){_0x2e7859[_0x3071('0x32')](updateMailInteraction(_0x30ed66,_0x151a9c,_0x5910a7,_0x2edff8));});return BPromise[_0x3071('0xb3')](_0x2e7859);});});});})[_0x3071('0x2a')](function(_0xbee265){_0x283074[_0x3071('0xb4')]=_0xbee265;return _0x283074;})['then'](respondWithFilteredResult(_0x43133a,_0x5733e9))[_0x3071('0x37')](handleError(_0x43133a,null));};exports['show']=function(_0x1abbff,_0x322154){var _0x46ab46={'raw':![],'where':{'id':_0x1abbff['params']['id']}},_0x3d4d6b={};_0x3d4d6b['model']=_['keys'](db[_0x3071('0x38')][_0x3071('0xb5')]);_0x3d4d6b[_0x3071('0x3a')]=_[_0x3071('0x5b')](_0x1abbff['query']);_0x3d4d6b[_0x3071('0x3b')]=_[_0x3071('0x3c')](_0x3d4d6b[_0x3071('0x39')],_0x3d4d6b['query']);_0x46ab46['attributes']=_['intersection'](_0x3d4d6b['model'],qs[_0x3071('0x3d')](_0x1abbff[_0x3071('0x3a')]['fields']));_0x46ab46[_0x3071('0x3e')]=_0x46ab46[_0x3071('0x3e')][_0x3071('0x3f')]?_0x46ab46[_0x3071('0x3e')]:_0x3d4d6b[_0x3071('0x39')];if(_0x1abbff['query'][_0x3071('0xb6')]){_0x46ab46[_0x3071('0xb7')]=[{'all':!![]}];}_0x46ab46=_[_0x3071('0xb8')]({},_0x46ab46,_0x1abbff[_0x3071('0xb9')]);return db['MailInteraction'][_0x3071('0xba')](_0x46ab46)['then'](handleEntityNotFound(_0x322154,null))[_0x3071('0x2a')](respondWithResult(_0x322154,null))[_0x3071('0x37')](handleError(_0x322154,null));};exports[_0x3071('0xbb')]=function(_0x4ec7a4,_0x100be7){return db[_0x3071('0x38')][_0x3071('0xbb')](_0x4ec7a4[_0x3071('0xbc')],{})['then'](respondWithResult(_0x100be7,0xc9))[_0x3071('0x37')](handleError(_0x100be7,null));};exports[_0x3071('0x28')]=function(_0xc326c2,_0x35bde9){if(_0xc326c2[_0x3071('0xbc')]['id']){delete _0xc326c2['body']['id'];}return db['MailInteraction'][_0x3071('0xba')]({'where':{'id':_0xc326c2[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x35bde9,null))[_0x3071('0x2a')](saveUpdates(_0xc326c2['body'],null))['then'](respondWithResult(_0x35bde9,null))[_0x3071('0x37')](handleError(_0x35bde9,null));};exports[_0x3071('0x29')]=function(_0x5a18f7,_0xdd926b){return db[_0x3071('0x38')][_0x3071('0xba')]({'where':{'id':_0x5a18f7['params']['id']}})['then'](handleEntityNotFound(_0xdd926b,null))['then'](removeEntity(_0xdd926b,null))[_0x3071('0x37')](handleError(_0xdd926b,null));};exports[_0x3071('0xbe')]=function(_0x31e1,_0x4a92d8){return db['MailInteraction'][_0x3071('0xbe')]()[_0x3071('0x2a')](respondWithResult(_0x4a92d8,null))[_0x3071('0x37')](handleError(_0x4a92d8,null));};exports[_0x3071('0xbf')]=function(_0x41e6c4,_0x5d4ea9,_0x3422d8){return db['MailMessage'][_0x3071('0xba')]({'where':{'id':_0x41e6c4[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5d4ea9,null))[_0x3071('0x2a')](function(_0x1817a8){if(_0x1817a8){return _0x1817a8['addMessage'](_0x41e6c4[_0x3071('0xbc')][_0x3071('0xc0')],_[_0x3071('0xc1')](_0x41e6c4[_0x3071('0xbc')],[_0x3071('0xc0'),'id'])||{});}})[_0x3071('0x2a')](respondWithResult(_0x5d4ea9,null))[_0x3071('0x37')](handleError(_0x5d4ea9,null));};exports[_0x3071('0xc2')]=function(_0xc6bc56,_0x109d20,_0x41cc75){var _0x4ffbec={'raw':![],'where':{}};var _0x334d3a={};var _0x21d4b8={'count':0x0,'rows':[]};return db[_0x3071('0x38')][_0x3071('0x33')]({'where':{'id':_0xc6bc56['params']['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x109d20,null))['then'](function(_0x17a9f5){if(_0x17a9f5){_0x334d3a[_0x3071('0x39')]=_[_0x3071('0x5b')](db[_0x3071('0xc3')][_0x3071('0xb5')]);_0x334d3a[_0x3071('0x3a')]=_[_0x3071('0x5b')](_0xc6bc56['query']);_0x334d3a[_0x3071('0x3b')]=_['intersection'](_0x334d3a['model'],_0x334d3a[_0x3071('0x3a')]);_0x4ffbec[_0x3071('0x3e')]=_['intersection'](_0x334d3a[_0x3071('0x39')],qs['fields'](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x3d')]));_0x4ffbec[_0x3071('0x3e')]=_0x4ffbec[_0x3071('0x3e')][_0x3071('0x3f')]?_0x4ffbec[_0x3071('0x3e')]:_0x334d3a[_0x3071('0x39')];if(!_0xc6bc56[_0x3071('0x3a')][_0x3071('0x40')](_0x3071('0xc4'))){_0x4ffbec[_0x3071('0x41')]=qs['limit'](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x41')]);_0x4ffbec[_0x3071('0x22')]=qs['offset'](_0xc6bc56[_0x3071('0x3a')]['offset']);}_0x4ffbec[_0x3071('0x42')]=qs[_0x3071('0x43')](_0xc6bc56[_0x3071('0x3a')][_0x3071('0x43')]);_0x4ffbec['where']=qs['filters'](_['pick'](_0xc6bc56[_0x3071('0x3a')],_0x334d3a['filters']));_0x4ffbec['where'][_0x3071('0xb1')]=_0x17a9f5['id'];if(_0xc6bc56['query'][_0x3071('0x7d')]){_0x4ffbec[_0x3071('0x44')]=_[_0x3071('0xb8')](_0x4ffbec['where'],{'$or':_[_0x3071('0x73')](_0x4ffbec['attributes'],function(_0x587e6b){var _0x129567={};_0x129567[_0x587e6b]={'$like':'%'+_0xc6bc56[_0x3071('0x3a')][_0x3071('0x7d')]+'%'};return _0x129567;})});}if(_0xc6bc56[_0x3071('0x3a')][_0x3071('0x7a')]){var _0x38b2c5=_0xc6bc56[_0x3071('0x3a')]['$gte'][_0x3071('0x83')](',');var _0x76a69a={};_0x76a69a[_0x38b2c5[0x0]]={'$gte':moment(_0x38b2c5[0x1])[_0x3071('0x60')](_0x3071('0xc5'))};_0x4ffbec[_0x3071('0x44')]=_[_0x3071('0xb8')](_0x4ffbec[_0x3071('0x44')],_0x76a69a);}_0x4ffbec=_[_0x3071('0xb8')]({},_0x4ffbec,_0xc6bc56[_0x3071('0xb9')]);return db['MailMessage'][_0x3071('0x21')]({'where':_0x4ffbec[_0x3071('0x44')]})[_0x3071('0x2a')](function(_0x28e880){_0x21d4b8[_0x3071('0x21')]=_0x28e880;if(_0xc6bc56[_0x3071('0x3a')][_0x3071('0xb6')]){_0x4ffbec['include']=[{'all':!![]}];}return db[_0x3071('0xc3')]['findAll'](_0x4ffbec);})[_0x3071('0x2a')](function(_0x164f3d){_0x21d4b8[_0x3071('0xb4')]=_0x164f3d;return _0x21d4b8;});}})['then'](respondWithFilteredResult(_0x109d20,_0x4ffbec))['catch'](handleError(_0x109d20,null));};exports['addTags']=function(_0x475047,_0x2fb723,_0x22fdcc){return db['MailInteraction'][_0x3071('0xba')]({'where':{'id':_0x475047[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2fb723,null))[_0x3071('0x2a')](function(_0x3e788f){if(_0x3e788f){return _0x3e788f[_0x3071('0xc6')](_0x475047[_0x3071('0xbc')][_0x3071('0xc0')],_[_0x3071('0xc1')](_0x475047['body'],[_0x3071('0xc0'),'id'])||{})[_0x3071('0xc7')](function(){return db[_0x3071('0xc8')]['findAll']({'attributes':['id',_0x3071('0x2d'),_0x3071('0x47')],'where':{'id':_0x475047[_0x3071('0xbc')][_0x3071('0xc0')]}});})[_0x3071('0x2a')](function(_0x1cc091){socket[_0x3071('0xc9')](_0x3071('0xca'),{'id':Number(_0x475047[_0x3071('0xbd')]['id']),'tags':_0x1cc091||[]});return{'id':Number(_0x475047[_0x3071('0xbd')]['id']),'tags':_0x1cc091||[]};});}})[_0x3071('0x2a')](respondWithResult(_0x2fb723,null))[_0x3071('0x37')](handleError(_0x2fb723,null));};exports['removeTags']=function(_0x9e027c,_0x3e9573,_0x5dcd7a){return db['MailInteraction']['find']({'where':{'id':_0x9e027c['params']['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x3e9573,null))[_0x3071('0x2a')](function(_0x51a67d){if(_0x51a67d){return _0x51a67d[_0x3071('0xcb')](_0x9e027c[_0x3071('0x3a')][_0x3071('0xc0')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x3e9573,null))[_0x3071('0x37')](handleError(_0x3e9573,null));};exports[_0x3071('0xcc')]=function(_0x358227,_0x1f6e73){var _0xcdeec2=moment()[_0x3071('0xcd')]()[_0x3071('0x84')]();var _0x28c7bc=path[_0x3071('0x85')](config['root'],_0x3071('0xce'),_0x3071('0xcf'),'attachments');var _0x17e204=path[_0x3071('0x85')](config[_0x3071('0xd0')],_0x3071('0xce'),'files',_0x3071('0xd1'));var _0x363418=path[_0x3071('0x85')](_0x17e204,_0xcdeec2);var _0x2ec794=util['format']('interaction-%s.zip',_0xcdeec2);var _0x1afce9=path[_0x3071('0x85')](_0x17e204,_0x2ec794);var _0x10f664=![];return db[_0x3071('0x38')][_0x3071('0xba')]({'where':{'id':_0x358227[_0x3071('0xbd')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1f6e73,null))[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){return _0x4d2992[_0x3071('0xc2')]({'attributes':['id','body','from','to','cc',_0x3071('0xd2'),_0x3071('0xd3'),'createdAt'],'where':{'secret':![]},'include':_0x358227['query'][_0x3071('0xd4')]?[{'model':db[_0x3071('0xd5')],'as':_0x3071('0xd6')}]:undefined,'order':qs[_0x3071('0x43')]('id')});}return[];})['then'](function(_0x6ad3d9){_0x10f664=_0x6ad3d9[_0x3071('0x3f')];if(_0x6ad3d9[_0x3071('0x3f')]){fs[_0x3071('0xd7')](_0x363418);return BPromise[_0x3071('0xd8')](_0x6ad3d9,function(_0x47880d,_0x2bf807){var _0x1a3fe8=_0x47880d;var _0x52b7a8={'from':_0x1a3fe8['from'],'to':_0x1a3fe8['to'],'subject':_0x1a3fe8['subject'],'html':_0x1a3fe8[_0x3071('0xbc')],'headers':{'Date':moment(_0x1a3fe8[_0x3071('0x79')])[_0x3071('0x60')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x47880d['cc']){_0x52b7a8[_0x3071('0xd9')]['Cc']=_0x47880d['cc'];}if(_0x47880d[_0x3071('0xd2')]){_0x52b7a8['headers'][_0x3071('0xda')]=_0x47880d[_0x3071('0xd2')];}return new BPromise(function(_0x33efb9,_0x15edc7){if(_0x47880d[_0x3071('0xd6')]){for(var _0x5a0462=0x0;_0x5a0462<_0x47880d['Attachments'][_0x3071('0x3f')];_0x5a0462++){var _0x20230c=_0x47880d[_0x3071('0xd6')][_0x5a0462];var _0x420132=path['join'](_0x28c7bc,_0x20230c['basename']);if(fs[_0x3071('0xdb')](_0x420132)){_0x52b7a8[_0x3071('0xd4')]['push']({'name':_0x20230c[_0x3071('0x2d')],'contentType':_0x20230c[_0x3071('0xdc')],'data':fs[_0x3071('0xdd')](_0x420132)});}}}emlformat[_0x3071('0xde')](_0x52b7a8,function(_0x4e1cfa,_0x89fa53){if(_0x4e1cfa)return _0x15edc7(_0x4e1cfa);fs[_0x3071('0xdf')](path[_0x3071('0x85')](_0x363418,util[_0x3071('0x60')]('message%d.eml',_0x2bf807)),_0x89fa53);return _0x33efb9(_0x89fa53);});});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return new BPromise(function(_0x2fa596,_0x50c25d){zipdir(_0x363418,{'saveTo':_0x1afce9},function(_0x12f599,_0xaedcbd){if(_0x12f599)return _0x50c25d(_0x12f599);return _0x2fa596(_0xaedcbd);});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return new BPromise(function(_0x8ab533,_0x30ca22){rimraf(_0x363418,function(_0x5069a9){if(_0x5069a9)_0x30ca22(_0x5069a9);return _0x8ab533();});});}})[_0x3071('0x2a')](function(){if(_0x10f664){return _0x1f6e73['download'](_0x1afce9,_0x2ec794,function(_0x241635){if(_0x241635){console['log'](_0x3071('0xe0'),_0x241635);}else{fs[_0x3071('0xe1')](_0x1afce9);}});}else{return _0x1f6e73[_0x3071('0x1d')](0xc8);}})[_0x3071('0x37')](handleError(_0x1f6e73,null));}; \ No newline at end of file +var _0x70e0=['length','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','from','tools_tags','COUNT(*)','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','dateStart','startOf','day','utc','format','endOf','isArray','condition','value','TagId','unreadMessages','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','filter','isNil','isEmpty','concat','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','push','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','i.id','Sequelize','QueryTypes','SELECT','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','t.id\x20=\x20it.TagId','sequelize','keyBy','merge','a.key','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','findOne','enableEmailPreview','all','rows','params','includeAll','options','find','catch','create','body','describe','addMessage','ids','omit','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','color','emit','unix','root','server','files','attachments','tmp','interaction-%s.zip','getMessages','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','basename','readFileSync','build','message%d.eml','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','count','offset','limit','apply','reject','update','then','destroy','error','name','send','map','TagIds','split','forEach','MailInteraction','lastMsgText','trimStart','fromString','lastMsgBody','rawAttributes','model','query','keys','intersection','attributes','fields'];(function(_0x4648ff,_0x582172){var _0x26070b=function(_0x370de5){while(--_0x370de5){_0x4648ff['push'](_0x4648ff['shift']());}};_0x26070b(++_0x582172);}(_0x70e0,0x17b));var _0x070e=function(_0x4c7d20,_0x1271eb){_0x4c7d20=_0x4c7d20-0x0;var _0x682b7=_0x70e0[_0x4c7d20];return _0x682b7;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var htmlToText=require(_0x070e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];config[_0x070e('0x16')]=_[_0x070e('0x17')](config[_0x070e('0x16')],{'host':_0x070e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x19'))['register'](socket);function respondWithStatusCode(_0x4a33d2,_0x5bae0f){_0x5bae0f=_0x5bae0f||0xcc;return function(_0x11d2ce){if(_0x11d2ce){return _0x4a33d2[_0x070e('0x1a')](_0x5bae0f);}return _0x4a33d2['status'](_0x5bae0f)['end']();};}function respondWithResult(_0x373d86,_0xeae1a5){_0xeae1a5=_0xeae1a5||0xc8;return function(_0x180897){if(_0x180897){return _0x373d86[_0x070e('0x1b')](_0xeae1a5)['json'](_0x180897);}};}function respondWithFilteredResult(_0x49861b,_0x17e2e4){return function(_0x2bd937){if(_0x2bd937){var _0x38f6e6=_0x2bd937[_0x070e('0x1c')],_0x2060cc=_0x17e2e4[_0x070e('0x1d')],_0x364b3f=_0x17e2e4[_0x070e('0x1d')]+_0x17e2e4[_0x070e('0x1e')],_0x5037eb;if(_0x364b3f>=_0x38f6e6){_0x364b3f=_0x38f6e6;_0x5037eb=0xc8;}else{_0x5037eb=0xce;}_0x49861b[_0x070e('0x1b')](_0x5037eb);return _0x49861b['set']('Content-Range',_0x2060cc+'-'+_0x364b3f+'/'+_0x38f6e6)['json'](_0x2bd937);}return null;};}function patchUpdates(_0x9907cf){return function(_0x3004f0){try{jsonpatch[_0x070e('0x1f')](_0x3004f0,_0x9907cf,!![]);}catch(_0x4be0d7){return BPromise[_0x070e('0x20')](_0x4be0d7);}return _0x3004f0['save']();};}function saveUpdates(_0xf8dd5d,_0x3f6985){return function(_0x27a01e){if(_0x27a01e){return _0x27a01e[_0x070e('0x21')](_0xf8dd5d)[_0x070e('0x22')](function(_0xa86797){return _0xa86797;});}return null;};}function removeEntity(_0xe405e,_0x164cdf){return function(_0x595c7e){if(_0x595c7e){return _0x595c7e[_0x070e('0x23')]()[_0x070e('0x22')](function(){_0xe405e[_0x070e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(!_0x4a2dbd){_0xf17c56[_0x070e('0x1a')](0x194);}return _0x4a2dbd;};}function handleError(_0x25f6e,_0x41deb1){_0x41deb1=_0x41deb1||0x1f4;return function(_0x1743cc){logger[_0x070e('0x24')](_0x1743cc['stack']);if(_0x1743cc[_0x070e('0x25')]){delete _0x1743cc[_0x070e('0x25')];}_0x25f6e[_0x070e('0x1b')](_0x41deb1)[_0x070e('0x26')](_0x1743cc);};}function getInteractionUsers(_0x43dd96,_0x28d7f2){return new BPromise(function(_0x1a1892,_0x26373b){try{if(_0x28d7f2[_0x43dd96['id']]){_0x43dd96['Users']=_[_0x070e('0x27')](_0x28d7f2[_0x43dd96['id']],function(_0x351641){return{'id':_0x351641['id']};});}}catch(_0x3a16d0){_0x26373b(_0x3a16d0);}_0x1a1892(_0x43dd96);});}function getInteractionTags(_0x56fc12,_0x5c5f0d){return new BPromise(function(_0x13097f,_0x46065c){try{if(_0x56fc12[_0x070e('0x28')]){_0x56fc12['Tags']=[];_0x56fc12[_0x070e('0x28')][_0x070e('0x29')](',')[_0x070e('0x2a')](function(_0x5f2bee){_0x56fc12['Tags']['push'](_0x5c5f0d[_0x5f2bee]);});}delete _0x56fc12['TagIds'];}catch(_0x59c5b4){_0x46065c(_0x59c5b4);}_0x13097f(_0x56fc12);});}function getLastMessageText(_0xdf8945){return new BPromise(function(_0x4e0a7d,_0x1dff97){return db[_0x070e('0x2b')]['findOne']({'where':{'id':_0xdf8945['id']},'attributes':['lastMsgBody',_0x070e('0x2c')],'raw':!![]})[_0x070e('0x22')](function(_0x55288a){if(!_0x55288a['lastMsgText']){_0xdf8945[_0x070e('0x2c')]=_[_0x070e('0x2d')](htmlToText[_0x070e('0x2e')](_0x55288a[_0x070e('0x2f')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0xdf8945[_0x070e('0x2c')]=_0x55288a['lastMsgText'];}_0x4e0a7d(_0xdf8945);})['catch'](function(_0x24d17d){_0x1dff97(_0x24d17d);});});}function updateMailInteraction(_0x3011c4,_0x4bb439,_0xf57ed,_0xf11439){return new BPromise(function(_0x4deaf8,_0x22f3a9){return getInteractionUsers(_0x3011c4,_0xf57ed)[_0x070e('0x22')](function(_0x534150){return getInteractionTags(_0x534150,_0x4bb439);})[_0x070e('0x22')](function(_0x34746e){if(_0xf11439){_0x4deaf8(getLastMessageText(_0x34746e));}else{_0x4deaf8(_0x34746e);}})['catch'](function(_0x4d4ee8){_0x22f3a9(_0x4d4ee8);});});}exports['index']=function(_0x363bff,_0x3dfbf7){var _0x39dfaa={},_0x334733={},_0x33c5f8={'count':0x0,'rows':[]};var _0x5e3827=db[_0x070e('0x2b')][_0x070e('0x30')];_0x334733[_0x070e('0x31')]=_['keys'](_0x5e3827);_0x334733[_0x070e('0x32')]=_[_0x070e('0x33')](_0x363bff[_0x070e('0x32')]);_0x334733['filters']=_[_0x070e('0x34')](_0x334733[_0x070e('0x31')],_0x334733['query']);_0x39dfaa[_0x070e('0x35')]=_['intersection'](_0x334733[_0x070e('0x31')],qs[_0x070e('0x36')](_0x363bff[_0x070e('0x32')][_0x070e('0x36')]));_0x39dfaa[_0x070e('0x35')]=_0x39dfaa['attributes'][_0x070e('0x37')]?_0x39dfaa['attributes']:_0x334733['model'];if(!_0x363bff[_0x070e('0x32')][_0x070e('0x38')](_0x070e('0x39'))){_0x39dfaa['limit']=qs[_0x070e('0x1e')](_0x363bff[_0x070e('0x32')][_0x070e('0x1e')]);_0x39dfaa[_0x070e('0x1d')]=qs['offset'](_0x363bff[_0x070e('0x32')]['offset']);}_0x39dfaa['order']=qs['sort'](_0x363bff[_0x070e('0x32')][_0x070e('0x3a')]);_0x39dfaa[_0x070e('0x3b')]=qs[_0x070e('0x3c')](_[_0x070e('0x3d')](_0x363bff['query'],_0x334733[_0x070e('0x3c')]));var _0x59037e=[];var _0x23dac5=squel[_0x070e('0x3e')]()[_0x070e('0x3f')]('id')['field']('name')[_0x070e('0x3f')]('color')[_0x070e('0x40')](_0x070e('0x41'));var _0x139820=squel['select']()[_0x070e('0x3f')](_0x070e('0x42'))['from']('mail_messages','me')[_0x070e('0x3b')](_0x070e('0x43'))[_0x070e('0x3b')](_0x070e('0x44'))[_0x070e('0x3b')]('me.read\x20=\x20false');var _0x20b80e=squel[_0x070e('0x3e')]()[_0x070e('0x3f')](_0x070e('0x45'))[_0x070e('0x3f')](_0x070e('0x46'))[_0x070e('0x40')](_0x070e('0x47'),'ui')[_0x070e('0x48')](_0x070e('0x49'),'u',_0x070e('0x4a'));var _0x3be553=squel[_0x070e('0x3e')]()[_0x070e('0x40')](_0x070e('0x4b'),'i')['left_join'](_0x070e('0x4c'),'c',_0x070e('0x4d'))[_0x070e('0x48')](_0x070e('0x49'),'o',_0x070e('0x4e'))[_0x070e('0x48')](_0x070e('0x4f'),'a',_0x070e('0x50'))[_0x070e('0x48')]('mail_messages','me',_0x070e('0x51'));var _0x4c22da=squel[_0x070e('0x52')]();if(_0x363bff[_0x070e('0x32')]['advancedFilter']){var _0x39cd65=JSON[_0x070e('0x53')](_0x363bff[_0x070e('0x32')][_0x070e('0x54')]);_[_0x070e('0x33')](_0x39cd65)[_0x070e('0x2a')](function(_0x83f21e){var _0x5694fa=_0x39cd65[_0x83f21e];if(_0x83f21e===_0x070e('0x55')){var _0x5bacbd=moment(_0x5694fa['value'][_0x070e('0x56')])[_0x070e('0x57')](_0x070e('0x58'))[_0x070e('0x59')]()[_0x070e('0x5a')]();var _0x7948ed=moment(_0x7948ed)[_0x070e('0x59')]()[_0x070e('0x5b')]('day')[_0x070e('0x5a')]();_0x4c22da['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5bacbd,_0x7948ed);}else{if(_[_0x070e('0x5c')](_0x5694fa[_0x070e('0x5d')])){_0x5694fa['condition'][_0x070e('0x2a')](function(_0x1e6784){switch(_0x5694fa[_0x070e('0x5d')][_0x070e('0x5e')]){case'IS':if(_0x83f21e!==_0x070e('0x5f')&&_0x83f21e!==_0x070e('0x60')){if(_[_0x070e('0x5c')](_0x5694fa['value'])&&_0x5694fa['value']['length']>0x1){_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x63'),_0x5694fa[_0x070e('0x5e')]);}else{_0x4c22da['and'](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+'\x20=\x20?',_0x5694fa[_0x070e('0x5e')][0x0]);}}break;case'=':_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x64'),_0x5694fa[_0x070e('0x5e')]);break;case _0x070e('0x65'):if(_0x83f21e==='ContactId'){_0x4c22da[_0x070e('0x61')](_0x070e('0x66')+_0x070e('0x67'),'%'+_0x5694fa['value']+'%');_0x4c22da['or'](_0x070e('0x68')+_0x070e('0x67'),'%'+_0x5694fa['value']+'%');_0x4c22da['or'](_0x070e('0x69')+'\x20LIKE\x20?','%'+_0x5694fa[_0x070e('0x5e')]+'%');}else{_0x4c22da['and'](_0x5694fa['tableAlias']+'.'+_0x83f21e+'\x20LIKE\x20?','%'+_0x5694fa[_0x070e('0x5e')]+'%');}break;case'>':_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x6a'),_0x5694fa[_0x070e('0x5e')]);break;case'<':_0x4c22da[_0x070e('0x61')](_0x5694fa['tableAlias']+'.'+_0x83f21e+_0x070e('0x6b'),_0x5694fa['value']);break;}});}else{switch(_0x5694fa[_0x070e('0x5d')]['value']){case'IS':if(_0x83f21e!==_0x070e('0x5f')&&_0x83f21e!==_0x070e('0x60')){if(_['isArray'](_0x5694fa[_0x070e('0x5e')])&&_0x5694fa['value'][_0x070e('0x37')]>0x1){_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x63'),_0x5694fa[_0x070e('0x5e')]);}else{_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x64'),_0x5694fa[_0x070e('0x5e')][0x0]);}}break;case'=':_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x64'),_0x5694fa[_0x070e('0x5e')]);break;case _0x070e('0x65'):if(_0x83f21e==='ContactId'){_0x4c22da[_0x070e('0x61')](_0x070e('0x66')+_0x070e('0x67'),'%'+_0x5694fa[_0x070e('0x5e')]+'%');_0x4c22da['or']('c.lastName'+_0x070e('0x67'),'%'+_0x5694fa[_0x070e('0x5e')]+'%');_0x4c22da['or'](_0x070e('0x69')+_0x070e('0x67'),'%'+_0x5694fa[_0x070e('0x5e')]+'%');}else{_0x4c22da[_0x070e('0x61')](_0x5694fa['tableAlias']+'.'+_0x83f21e+_0x070e('0x67'),'%'+_0x5694fa[_0x070e('0x5e')]+'%');}break;case'>':_0x4c22da[_0x070e('0x61')](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+'\x20>\x20?',_0x5694fa[_0x070e('0x5e')]);break;case'<':_0x4c22da['and'](_0x5694fa[_0x070e('0x62')]+'.'+_0x83f21e+_0x070e('0x6b'),_0x5694fa[_0x070e('0x5e')]);break;}}}});}else{var _0x150bf6=_(Object[_0x070e('0x33')](_0x363bff['query']))[_0x070e('0x27')](function(_0x2e38c6){return _0x5e3827[_0x070e('0x38')](_0x2e38c6)?_0x2e38c6:undefined;})[_0x070e('0x6c')](function(_0x5591dd){return!_[_0x070e('0x6d')](_0x5591dd);})['value']();if(!_[_0x070e('0x6e')](_0x150bf6)){_0x150bf6[_0x070e('0x2a')](function(_0x1214d2){if(_0x1214d2==='MailAccountId'){_0x3be553[_0x070e('0x3b')]('i.MailAccountId\x20IN\x20?',[][_0x070e('0x6f')](_0x363bff['query'][_0x1214d2]));}else if(_0x1214d2===_0x070e('0x55')){var _0x17b28c=JSON['parse'](_0x363bff[_0x070e('0x32')][_0x1214d2])['$gte'];var _0x1c831f=JSON[_0x070e('0x53')](_0x363bff['query'][_0x1214d2])['$lte'];_0x3be553[_0x070e('0x3b')](_0x070e('0x70'),_0x17b28c,_0x1c831f);}else{if(_0x363bff[_0x070e('0x32')][_0x1214d2]===_0x070e('0x71')){_0x3be553[_0x070e('0x3b')]('i.'+_0x1214d2+_0x070e('0x72'));}else{_0x3be553[_0x070e('0x3b')]('i.'+_0x1214d2+_0x070e('0x64'),_0x363bff[_0x070e('0x32')][_0x1214d2]);}}});}if(_0x363bff[_0x070e('0x32')][_0x070e('0x6c')]){var _0x25670e=_0x363bff[_0x070e('0x32')]['filter'][_0x070e('0x73')]('\x5c','\x5c\x5c')[_0x070e('0x73')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x25670e)){_0x4c22da['or'](_0x070e('0x74'),_0x25670e+'%');}else if(qs[_0x070e('0x75')](_0x25670e)){_0x4c22da['or'](_0x070e('0x76'),_0x25670e+'%');}else{var _0x24bbc7=[];_0x25670e[_0x070e('0x29')]('\x20')[_0x070e('0x2a')](function(_0x3223a4){_0x24bbc7[_0x070e('0x77')]('+'+_0x3223a4[_0x070e('0x78')]());});var _0x2c80e3=_0x24bbc7[_0x070e('0x79')]('\x20');_0x4c22da['or'](_0x070e('0x7a'),_0x2c80e3)['or'](_0x070e('0x7b'),_0x2c80e3);}}}_0x3be553['where'](_0x4c22da);if(_0x39dfaa['order']){_0x39dfaa['order'][_0x070e('0x2a')](function(_0x2e4b4a){_0x3be553[_0x070e('0x7c')]('i.'+_0x2e4b4a[0x0],_0x2e4b4a[0x1]===_0x070e('0x7d')?![]:!![]);});}_0x3be553['group'](_0x070e('0x7e'));var _0x332022={'type':db[_0x070e('0x7f')][_0x070e('0x80')][_0x070e('0x81')],'raw':!![]};var _0x264d6a=_0x3be553['clone']()[_0x070e('0x3f')]('COUNT(*)')[_0x070e('0x3f')](_0x070e('0x82'),_0x070e('0x60'));if(!_0x363bff[_0x070e('0x32')][_0x070e('0x54')]){if(_0x363bff['query'][_0x070e('0x83')]){if(_0x363bff[_0x070e('0x32')]['read']==0x1){_0x264d6a[_0x070e('0x84')](_0x070e('0x85'));_0x3be553['having'](_0x070e('0x85'));}else{_0x264d6a[_0x070e('0x84')](_0x070e('0x86'));_0x3be553['having'](_0x070e('0x86'));}}if(_0x363bff[_0x070e('0x32')][_0x070e('0x87')]){var _0x1ad0bf=_[_0x070e('0x5c')](_0x363bff[_0x070e('0x32')][_0x070e('0x87')])?_0x363bff[_0x070e('0x32')][_0x070e('0x87')]:new Array(_0x363bff[_0x070e('0x32')][_0x070e('0x87')]);var _0x46d2b7=squel[_0x070e('0x52')]();_0x1ad0bf['forEach'](function(_0x28be73){_0x46d2b7['or'](_0x070e('0x88'),'%,'+_0x28be73+',%');});_0x3be553[_0x070e('0x84')](_0x46d2b7);_0x264d6a[_0x070e('0x48')](_0x070e('0x89'),'it',_0x070e('0x8a'));_0x264d6a['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x264d6a[_0x070e('0x3b')](_0x070e('0x8b'),_0x1ad0bf);}}else{var _0x39cd65=JSON[_0x070e('0x53')](_0x363bff['query'][_0x070e('0x54')]);_[_0x070e('0x33')](_0x39cd65)[_0x070e('0x2a')](function(_0x522685){var _0x9d81a9=_0x39cd65[_0x522685];if(_0x522685==='TagId'){var _0x237e3b=_0x9d81a9[_0x070e('0x5e')];var _0x59e6e5=squel['expr']();_0x237e3b[_0x070e('0x2a')](function(_0x1fa499){_0x59e6e5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fa499+',%');});_0x3be553[_0x070e('0x84')](_0x59e6e5);_0x264d6a['left_join']('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x264d6a[_0x070e('0x48')](_0x070e('0x41'),'t',_0x070e('0x8c'));_0x264d6a[_0x070e('0x3b')](_0x070e('0x8b'),_0x237e3b);}else if(_0x522685===_0x070e('0x60')){if(_0x9d81a9[_0x070e('0x5e')][_0x070e('0x37')]===0x1){if(_0x9d81a9[_0x070e('0x5e')][0x0]===0x1){_0x264d6a[_0x070e('0x84')](_0x070e('0x85'));_0x3be553[_0x070e('0x84')](_0x070e('0x85'));}else{_0x264d6a[_0x070e('0x84')](_0x070e('0x86'));_0x3be553[_0x070e('0x84')](_0x070e('0x86'));}}}});}db[_0x070e('0x8d')][_0x070e('0x32')](_0x264d6a[_0x070e('0x78')](),_0x332022)[_0x070e('0x22')](function(_0x3863f2){_0x33c5f8['count']=_0x3863f2[_0x070e('0x37')];if(_0x33c5f8[_0x070e('0x1c')]===0x0)return[];return db[_0x070e('0x8d')][_0x070e('0x32')](_0x23dac5['toString'](),_0x332022)[_0x070e('0x22')](function(_0x32fa3b){_0x59037e=_[_0x070e('0x8e')](_0x32fa3b,'id');_0x332022=_[_0x070e('0x8f')](_0x332022,{'model':db[_0x070e('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3be553[_0x070e('0x3f')]('COUNT(me.id)','unreadMessages');_0x3be553['field'](_0x070e('0x90'),'Account.key');_0x3be553[_0x070e('0x3f')](_0x070e('0x7e'));_0x3be553['field'](_0x070e('0x91'));_0x3be553[_0x070e('0x3f')]('i.updatedAt');_0x3be553['field'](_0x070e('0x92'));_0x3be553[_0x070e('0x3f')](_0x070e('0x93'));_0x3be553[_0x070e('0x3f')](_0x070e('0x94'));_0x3be553['field'](_0x070e('0x95'));_0x3be553['field'](_0x070e('0x96'));_0x3be553[_0x070e('0x3f')]('i.subject');_0x3be553[_0x070e('0x3f')](_0x070e('0x97'));_0x3be553[_0x070e('0x3f')](_0x070e('0x98'));_0x3be553[_0x070e('0x3f')](_0x070e('0x99'));_0x3be553['field'](_0x070e('0x9a'));_0x3be553[_0x070e('0x3f')](_0x070e('0x9b'));_0x3be553[_0x070e('0x3f')](_0x070e('0x9c'));_0x3be553['field'](_0x070e('0x66'),_0x070e('0x9d'));_0x3be553[_0x070e('0x3f')](_0x070e('0x68'),_0x070e('0x9e'));_0x3be553[_0x070e('0x3f')](_0x070e('0x69'),_0x070e('0x9f'));_0x3be553[_0x070e('0x3f')](_0x070e('0xa0'),_0x070e('0xa1'));_0x3be553[_0x070e('0x3f')](_0x070e('0xa2'),_0x070e('0xa3'));_0x3be553[_0x070e('0x3f')](_0x070e('0xa4'),'Contact.fax');_0x3be553['field'](_0x070e('0xa5'),_0x070e('0x28'));_0x3be553['left_join']('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x3be553['left_join'](_0x070e('0x41'),'t',_0x070e('0x8c'));_0x3be553[_0x070e('0x1e')](_0x39dfaa[_0x070e('0x1e')]);_0x3be553[_0x070e('0x1d')](_0x39dfaa[_0x070e('0x1d')]);return db[_0x070e('0x8d')][_0x070e('0x32')](_0x3be553[_0x070e('0x78')](),_0x332022);})[_0x070e('0x22')](function(_0x51f064){_0x20b80e[_0x070e('0x3b')](_0x070e('0xa6'),_['map'](_0x51f064,'id'));return db[_0x070e('0x8d')][_0x070e('0x32')](_0x20b80e[_0x070e('0x78')](),_0x332022)[_0x070e('0x22')](function(_0x59b0c5){var _0x2d46fb=_[_0x070e('0xa7')](_0x59b0c5,_0x070e('0xa8'));var _0x46d83e=[];return db['Setting'][_0x070e('0xa9')]({'attributes':[_0x070e('0xaa')],'raw':!![]})[_0x070e('0x22')](function(_0xebbb53){var _0xdb8036=_0xebbb53[_0x070e('0xaa')];_0x51f064[_0x070e('0x2a')](function(_0xb2cca5){_0x46d83e[_0x070e('0x77')](updateMailInteraction(_0xb2cca5,_0x59037e,_0x2d46fb,_0xdb8036));});return BPromise[_0x070e('0xab')](_0x46d83e);});});});})[_0x070e('0x22')](function(_0x479888){_0x33c5f8[_0x070e('0xac')]=_0x479888;return _0x33c5f8;})[_0x070e('0x22')](respondWithFilteredResult(_0x3dfbf7,_0x39dfaa))['catch'](handleError(_0x3dfbf7,null));};exports['show']=function(_0x6ac3c9,_0x53f6e7){var _0x2c759a={'raw':![],'where':{'id':_0x6ac3c9[_0x070e('0xad')]['id']}},_0x24612f={};_0x24612f[_0x070e('0x31')]=_[_0x070e('0x33')](db[_0x070e('0x2b')][_0x070e('0x30')]);_0x24612f['query']=_[_0x070e('0x33')](_0x6ac3c9[_0x070e('0x32')]);_0x24612f[_0x070e('0x3c')]=_[_0x070e('0x34')](_0x24612f['model'],_0x24612f['query']);_0x2c759a[_0x070e('0x35')]=_[_0x070e('0x34')](_0x24612f[_0x070e('0x31')],qs['fields'](_0x6ac3c9[_0x070e('0x32')][_0x070e('0x36')]));_0x2c759a['attributes']=_0x2c759a[_0x070e('0x35')][_0x070e('0x37')]?_0x2c759a[_0x070e('0x35')]:_0x24612f[_0x070e('0x31')];if(_0x6ac3c9[_0x070e('0x32')][_0x070e('0xae')]){_0x2c759a['include']=[{'all':!![]}];}_0x2c759a=_['merge']({},_0x2c759a,_0x6ac3c9[_0x070e('0xaf')]);return db['MailInteraction'][_0x070e('0xb0')](_0x2c759a)[_0x070e('0x22')](handleEntityNotFound(_0x53f6e7,null))['then'](respondWithResult(_0x53f6e7,null))[_0x070e('0xb1')](handleError(_0x53f6e7,null));};exports['create']=function(_0x1e3913,_0x31ccef){return db[_0x070e('0x2b')][_0x070e('0xb2')](_0x1e3913[_0x070e('0xb3')],{})[_0x070e('0x22')](respondWithResult(_0x31ccef,0xc9))['catch'](handleError(_0x31ccef,null));};exports[_0x070e('0x21')]=function(_0x406e44,_0x58434f){if(_0x406e44['body']['id']){delete _0x406e44[_0x070e('0xb3')]['id'];}return db[_0x070e('0x2b')][_0x070e('0xb0')]({'where':{'id':_0x406e44[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x58434f,null))[_0x070e('0x22')](saveUpdates(_0x406e44[_0x070e('0xb3')],null))[_0x070e('0x22')](respondWithResult(_0x58434f,null))['catch'](handleError(_0x58434f,null));};exports[_0x070e('0x23')]=function(_0x9a1b90,_0x26a0be){return db[_0x070e('0x2b')][_0x070e('0xb0')]({'where':{'id':_0x9a1b90[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x26a0be,null))[_0x070e('0x22')](removeEntity(_0x26a0be,null))['catch'](handleError(_0x26a0be,null));};exports[_0x070e('0xb4')]=function(_0x1f1501,_0x40532a){return db[_0x070e('0x2b')][_0x070e('0xb4')]()[_0x070e('0x22')](respondWithResult(_0x40532a,null))[_0x070e('0xb1')](handleError(_0x40532a,null));};exports[_0x070e('0xb5')]=function(_0x3d0cd2,_0x2dd9b2,_0x5b259e){return db['MailMessage'][_0x070e('0xb0')]({'where':{'id':_0x3d0cd2[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x2dd9b2,null))['then'](function(_0xefd35a){if(_0xefd35a){return _0xefd35a[_0x070e('0xb5')](_0x3d0cd2['body'][_0x070e('0xb6')],_[_0x070e('0xb7')](_0x3d0cd2[_0x070e('0xb3')],[_0x070e('0xb6'),'id'])||{});}})[_0x070e('0x22')](respondWithResult(_0x2dd9b2,null))[_0x070e('0xb1')](handleError(_0x2dd9b2,null));};exports['getMessages']=function(_0x4de58b,_0x2e2a5a,_0x3f3d7e){var _0x532f83={'raw':![],'where':{}};var _0x4055ba={};var _0x1ba1d3={'count':0x0,'rows':[]};return db[_0x070e('0x2b')][_0x070e('0xa9')]({'where':{'id':_0x4de58b[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x2e2a5a,null))['then'](function(_0xb7866f){if(_0xb7866f){_0x4055ba[_0x070e('0x31')]=_['keys'](db[_0x070e('0xb8')][_0x070e('0x30')]);_0x4055ba[_0x070e('0x32')]=_[_0x070e('0x33')](_0x4de58b['query']);_0x4055ba['filters']=_[_0x070e('0x34')](_0x4055ba[_0x070e('0x31')],_0x4055ba[_0x070e('0x32')]);_0x532f83[_0x070e('0x35')]=_[_0x070e('0x34')](_0x4055ba[_0x070e('0x31')],qs[_0x070e('0x36')](_0x4de58b[_0x070e('0x32')][_0x070e('0x36')]));_0x532f83[_0x070e('0x35')]=_0x532f83['attributes'][_0x070e('0x37')]?_0x532f83[_0x070e('0x35')]:_0x4055ba[_0x070e('0x31')];if(!_0x4de58b[_0x070e('0x32')]['hasOwnProperty'](_0x070e('0x39'))){_0x532f83[_0x070e('0x1e')]=qs['limit'](_0x4de58b['query'][_0x070e('0x1e')]);_0x532f83[_0x070e('0x1d')]=qs[_0x070e('0x1d')](_0x4de58b['query'][_0x070e('0x1d')]);}_0x532f83[_0x070e('0x7c')]=qs[_0x070e('0x3a')](_0x4de58b[_0x070e('0x32')][_0x070e('0x3a')]);_0x532f83['where']=qs[_0x070e('0x3c')](_[_0x070e('0x3d')](_0x4de58b['query'],_0x4055ba[_0x070e('0x3c')]));_0x532f83['where']['MailInteractionId']=_0xb7866f['id'];if(_0x4de58b['query'][_0x070e('0x6c')]){_0x532f83[_0x070e('0x3b')]=_[_0x070e('0x8f')](_0x532f83[_0x070e('0x3b')],{'$or':_['map'](_0x532f83[_0x070e('0x35')],function(_0x1ed436){var _0x500fa9={};_0x500fa9[_0x1ed436]={'$like':'%'+_0x4de58b[_0x070e('0x32')][_0x070e('0x6c')]+'%'};return _0x500fa9;})});}if(_0x4de58b[_0x070e('0x32')][_0x070e('0xb9')]){var _0x4ea0a6=_0x4de58b[_0x070e('0x32')]['$gte'][_0x070e('0x29')](',');var _0x4c35db={};_0x4c35db[_0x4ea0a6[0x0]]={'$gte':moment(_0x4ea0a6[0x1])[_0x070e('0x5a')](_0x070e('0xba'))};_0x532f83[_0x070e('0x3b')]=_['merge'](_0x532f83[_0x070e('0x3b')],_0x4c35db);}_0x532f83=_[_0x070e('0x8f')]({},_0x532f83,_0x4de58b[_0x070e('0xaf')]);return db['MailMessage'][_0x070e('0x1c')]({'where':_0x532f83[_0x070e('0x3b')]})['then'](function(_0x453e0e){_0x1ba1d3[_0x070e('0x1c')]=_0x453e0e;if(_0x4de58b['query']['includeAll']){_0x532f83['include']=[{'all':!![]}];}return db['MailMessage'][_0x070e('0xbb')](_0x532f83);})[_0x070e('0x22')](function(_0x1aeebb){_0x1ba1d3[_0x070e('0xac')]=_0x1aeebb;return _0x1ba1d3;});}})[_0x070e('0x22')](respondWithFilteredResult(_0x2e2a5a,_0x532f83))[_0x070e('0xb1')](handleError(_0x2e2a5a,null));};exports[_0x070e('0xbc')]=function(_0x472fc9,_0x569425,_0x5a824a){return db['MailInteraction']['find']({'where':{'id':_0x472fc9[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x569425,null))[_0x070e('0x22')](function(_0x305c58){if(_0x305c58){return _0x305c58[_0x070e('0xbd')](_0x472fc9['body']['ids'],_[_0x070e('0xb7')](_0x472fc9[_0x070e('0xb3')],['ids','id'])||{})[_0x070e('0xbe')](function(){return db[_0x070e('0xbf')][_0x070e('0xbb')]({'attributes':['id',_0x070e('0x25'),_0x070e('0xc0')],'where':{'id':_0x472fc9[_0x070e('0xb3')]['ids']}});})[_0x070e('0x22')](function(_0x1d48a9){socket[_0x070e('0xc1')]('mailInteractionTags:save',{'id':Number(_0x472fc9[_0x070e('0xad')]['id']),'tags':_0x1d48a9||[]});return{'id':Number(_0x472fc9[_0x070e('0xad')]['id']),'tags':_0x1d48a9||[]};});}})[_0x070e('0x22')](respondWithResult(_0x569425,null))[_0x070e('0xb1')](handleError(_0x569425,null));};exports['removeTags']=function(_0x4175b9,_0x2beaa8,_0x490ad3){return db[_0x070e('0x2b')][_0x070e('0xb0')]({'where':{'id':_0x4175b9['params']['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x2beaa8,null))['then'](function(_0x438384){if(_0x438384){return _0x438384['removeTags'](_0x4175b9[_0x070e('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x2beaa8,null))[_0x070e('0xb1')](handleError(_0x2beaa8,null));};exports['download']=function(_0x50529c,_0x7966d4){var _0x141d04=moment()[_0x070e('0xc2')]()[_0x070e('0x78')]();var _0x1a339e=path['join'](config[_0x070e('0xc3')],_0x070e('0xc4'),_0x070e('0xc5'),_0x070e('0xc6'));var _0x41a292=path[_0x070e('0x79')](config['root'],_0x070e('0xc4'),_0x070e('0xc5'),_0x070e('0xc7'));var _0x44c780=path['join'](_0x41a292,_0x141d04);var _0x5e22a6=util[_0x070e('0x5a')](_0x070e('0xc8'),_0x141d04);var _0x287f59=path[_0x070e('0x79')](_0x41a292,_0x5e22a6);var _0x2e7f5f=![];return db[_0x070e('0x2b')]['find']({'where':{'id':_0x50529c[_0x070e('0xad')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x7966d4,null))[_0x070e('0x22')](function(_0x3a894e){if(_0x3a894e){return _0x3a894e[_0x070e('0xc9')]({'attributes':['id',_0x070e('0xb3'),'from','to','cc','bcc',_0x070e('0xca'),_0x070e('0x55')],'where':{'secret':![]},'include':_0x50529c[_0x070e('0x32')][_0x070e('0xc6')]?[{'model':db[_0x070e('0xcb')],'as':_0x070e('0xcc')}]:undefined,'order':qs[_0x070e('0x3a')]('id')});}return[];})['then'](function(_0x2269f0){_0x2e7f5f=_0x2269f0['length'];if(_0x2269f0[_0x070e('0x37')]){fs['mkdirSync'](_0x44c780);return BPromise['each'](_0x2269f0,function(_0x4e2ff5,_0x383f39){var _0x3ca9b4=_0x4e2ff5;var _0x396809={'from':_0x3ca9b4[_0x070e('0x40')],'to':_0x3ca9b4['to'],'subject':_0x3ca9b4[_0x070e('0xca')],'html':_0x3ca9b4[_0x070e('0xb3')],'headers':{'Date':moment(_0x3ca9b4[_0x070e('0x55')])[_0x070e('0x5a')](_0x070e('0xcd'))},'attachments':[]};if(_0x4e2ff5['cc']){_0x396809['headers']['Cc']=_0x4e2ff5['cc'];}if(_0x4e2ff5[_0x070e('0xce')]){_0x396809[_0x070e('0xcf')][_0x070e('0xd0')]=_0x4e2ff5[_0x070e('0xce')];}return new BPromise(function(_0x243fc7,_0x3d3375){if(_0x4e2ff5[_0x070e('0xcc')]){for(var _0x13f234=0x0;_0x13f234<_0x4e2ff5[_0x070e('0xcc')]['length'];_0x13f234++){var _0x538f0c=_0x4e2ff5[_0x070e('0xcc')][_0x13f234];var _0x29ea7d=path['join'](_0x1a339e,_0x538f0c[_0x070e('0xd1')]);if(fs['existsSync'](_0x29ea7d)){_0x396809['attachments'][_0x070e('0x77')]({'name':_0x538f0c[_0x070e('0x25')],'contentType':_0x538f0c['type'],'data':fs[_0x070e('0xd2')](_0x29ea7d)});}}}emlformat[_0x070e('0xd3')](_0x396809,function(_0x32ea56,_0x54ea03){if(_0x32ea56)return _0x3d3375(_0x32ea56);fs['writeFileSync'](path[_0x070e('0x79')](_0x44c780,util[_0x070e('0x5a')](_0x070e('0xd4'),_0x383f39)),_0x54ea03);return _0x243fc7(_0x54ea03);});});});}})['then'](function(){if(_0x2e7f5f){return new BPromise(function(_0x36c878,_0x36a2cf){zipdir(_0x44c780,{'saveTo':_0x287f59},function(_0x57c540,_0x12faf6){if(_0x57c540)return _0x36a2cf(_0x57c540);return _0x36c878(_0x12faf6);});});}})[_0x070e('0x22')](function(){if(_0x2e7f5f){return new BPromise(function(_0x2f5f19,_0x2f648a){rimraf(_0x44c780,function(_0x3f7b2c){if(_0x3f7b2c)_0x2f648a(_0x3f7b2c);return _0x2f5f19();});});}})[_0x070e('0x22')](function(){if(_0x2e7f5f){return _0x7966d4[_0x070e('0xd5')](_0x287f59,_0x5e22a6,function(_0x1cf02b){if(_0x1cf02b){console[_0x070e('0xd6')](_0x070e('0xd7'),_0x1cf02b);}else{fs[_0x070e('0xd8')](_0x287f59);}});}else{return _0x7966d4[_0x070e('0x1a')](0xc8);}})[_0x070e('0xb1')](handleError(_0x7966d4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8125b38..df45fd4 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 _0x7766=['events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x7766,0x6c));var _0x6776=function(_0x2e32a5,_0xc5e0e4){_0x2e32a5=_0x2e32a5-0x0;var _0xeaf48a=_0x7766[_0x2e32a5];return _0xeaf48a;};'use strict';var EventEmitter=require(_0x6776('0x0'));var MailInteraction=require(_0x6776('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x6776('0x1'))['db'][_0x6776('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6776('0x3')](0x0);var events={'afterCreate':_0x6776('0x4'),'afterUpdate':_0x6776('0x5'),'afterDestroy':_0x6776('0x6')};function emitEvent(_0x5871a3){return function(_0x305371,_0x2989aa,_0x5195c3){_0x305371[_0x6776('0x7')]({'attributes':['id'],'raw':!![]})[_0x6776('0x8')](function(_0x38e1e9){_0x305371['setDataValue'](_0x6776('0x9'),_0x38e1e9['map'](function(_0x49b005){return{'id':_0x49b005['id']};}));return MailMessage[_0x6776('0xa')]({'where':{'MailInteractionId':_0x305371['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6776('0x8')](function(_0x2ec4bc){_0x305371['setDataValue'](_0x6776('0xb'),_0x2ec4bc[_0x6776('0xc')]);MailInteractionEvents[_0x6776('0xd')](_0x5871a3+':'+_0x305371['id'],_0x305371);MailInteractionEvents[_0x6776('0xd')](_0x5871a3,_0x305371);_0x5195c3(null);})[_0x6776('0xe')](_0x5195c3(null));};}for(var e in events){if(events[_0x6776('0xf')](e)){var event=events[e];MailInteraction[_0x6776('0x10')](e,emitEvent(event));}}module[_0x6776('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x064d=['findAll','setDataValue','emit','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','Users','map'];(function(_0x4cb33a,_0x39aba1){var _0x4a5509=function(_0x7d2f12){while(--_0x7d2f12){_0x4cb33a['push'](_0x4cb33a['shift']());}};_0x4a5509(++_0x39aba1);}(_0x064d,0x140));var _0xd064=function(_0x52685d,_0x167112){_0x52685d=_0x52685d-0x0;var _0x5376cd=_0x064d[_0x52685d];return _0x5376cd;};'use strict';var EventEmitter=require(_0xd064('0x0'));var MailInteraction=require(_0xd064('0x1'))['db'][_0xd064('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xd064('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd064('0x4'),'afterUpdate':_0xd064('0x5'),'afterDestroy':_0xd064('0x6')};function emitEvent(_0x22ed14){return function(_0x5bb7fd,_0x285617,_0x1d6581){_0x5bb7fd[_0xd064('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x162a83){_0x5bb7fd['setDataValue'](_0xd064('0x8'),_0x162a83[_0xd064('0x9')](function(_0x18a8f8){return{'id':_0x18a8f8['id']};}));return MailMessage[_0xd064('0xa')]({'where':{'MailInteractionId':_0x5bb7fd['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51eb6f){_0x5bb7fd[_0xd064('0xb')]('unreadMessages',_0x51eb6f['length']);MailInteractionEvents['emit'](_0x22ed14+':'+_0x5bb7fd['id'],_0x5bb7fd);MailInteractionEvents[_0xd064('0xc')](_0x22ed14,_0x5bb7fd);_0x1d6581(null);})['catch'](_0x1d6581(null));};}for(var e in events){if(events[_0xd064('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xd064('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d329e34..5371f65 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 _0xc648=['YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closed','models','update','then','catch','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','closedAt'];(function(_0xf50836,_0x4d3e35){var _0x2ca828=function(_0x1b36c3){while(--_0x1b36c3){_0xf50836['push'](_0xf50836['shift']());}};_0x2ca828(++_0x4d3e35);}(_0xc648,0x166));var _0x8c64=function(_0x232c8d,_0x2cd11b){_0x232c8d=_0x232c8d-0x0;var _0x340c6a=_0xc648[_0x232c8d];return _0x340c6a;};'use strict';var _=require(_0x8c64('0x0'));var util=require('util');var logger=require(_0x8c64('0x1'))(_0x8c64('0x2'));var moment=require(_0x8c64('0x3'));var BPromise=require(_0x8c64('0x4'));var rp=require(_0x8c64('0x5'));var fs=require('fs');var path=require(_0x8c64('0x6'));var rimraf=require(_0x8c64('0x7'));var config=require('../../config/environment');var attributes=require(_0x8c64('0x8'));module[_0x8c64('0x9')]=function(_0x33f37a,_0x43b073){return _0x33f37a[_0x8c64('0xa')]('MailInteraction',attributes,{'tableName':_0x8c64('0xb'),'paranoid':![],'indexes':[{'name':_0x8c64('0xc'),'fields':['subject','to'],'type':_0x8c64('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1fffa3,_0x3a8c4c,_0x6716ee){if(_0x1fffa3['substatus']){_0x1fffa3[_0x8c64('0xe')]=moment()[_0x8c64('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1fffa3['closed']){_0x1fffa3[_0x8c64('0x10')]=moment()[_0x8c64('0xf')](_0x8c64('0x11'));}_0x6716ee(null,_0x3a8c4c);},'beforeUpdate':function(_0x332d0a,_0x5ed5aa,_0x8d93ec){if(_0x332d0a[_0x8c64('0x12')](_0x8c64('0x13'))){_0x332d0a['substatusAt']=moment()[_0x8c64('0xf')](_0x8c64('0x11'));}if(_0x332d0a[_0x8c64('0x12')](_0x8c64('0x14'))){_0x332d0a['closedAt']=moment()['format'](_0x8c64('0x11'));}_0x8d93ec(null,_0x332d0a);},'afterUpdate':function(_0x4631b,_0x17318a,_0x227009){var _0x16e6de=_0x33f37a[_0x8c64('0x15')];var _0x5d2a5b=_0x4631b['get']({'plain':!![]});if(_0x5d2a5b['closed']){return _0x16e6de['MailMessage'][_0x8c64('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5d2a5b['id']}})[_0x8c64('0x17')](function(){_0x227009();})[_0x8c64('0x18')](function(_0x3f11b4){_0x227009(_0x3f11b4);});}else{_0x227009();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xda11=['MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatus','models','get','MailMessage','update','then','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','../../config/environment','define'];(function(_0x46257b,_0x4cc0aa){var _0x2fccee=function(_0x1b40ca){while(--_0x1b40ca){_0x46257b['push'](_0x46257b['shift']());}};_0x2fccee(++_0x4cc0aa);}(_0xda11,0x1d4));var _0x1da1=function(_0x9b6a29,_0x50a0c8){_0x9b6a29=_0x9b6a29-0x0;var _0x177f9e=_0xda11[_0x9b6a29];return _0x177f9e;};'use strict';var _=require('lodash');var util=require(_0x1da1('0x0'));var logger=require('../../config/logger')(_0x1da1('0x1'));var moment=require(_0x1da1('0x2'));var BPromise=require(_0x1da1('0x3'));var rp=require(_0x1da1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1da1('0x5'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x5d39d3,_0x2a811d){return _0x5d39d3[_0x1da1('0x6')](_0x1da1('0x7'),attributes,{'tableName':_0x1da1('0x8'),'paranoid':![],'indexes':[{'name':_0x1da1('0x9'),'fields':[_0x1da1('0xa'),'to'],'type':_0x1da1('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x42587b,_0x3ba3b1,_0x4f4d3f){if(_0x42587b['substatus']){_0x42587b[_0x1da1('0xc')]=moment()['format'](_0x1da1('0xd'));}if(_0x42587b[_0x1da1('0xe')]){_0x42587b[_0x1da1('0xf')]=moment()[_0x1da1('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4f4d3f(null,_0x3ba3b1);},'beforeUpdate':function(_0x1b3c05,_0x5a4073,_0x46d009){if(_0x1b3c05[_0x1da1('0x11')](_0x1da1('0x12'))){_0x1b3c05[_0x1da1('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1b3c05['changed'](_0x1da1('0xe'))){_0x1b3c05[_0x1da1('0xf')]=moment()[_0x1da1('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x46d009(null,_0x1b3c05);},'afterUpdate':function(_0x259171,_0x39d7f3,_0xae17a8){var _0x366df4=_0x5d39d3[_0x1da1('0x13')];var _0x544169=_0x259171[_0x1da1('0x14')]({'plain':!![]});if(_0x544169[_0x1da1('0xe')]){return _0x366df4[_0x1da1('0x15')][_0x1da1('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x544169['id']}})[_0x1da1('0x17')](function(){_0xae17a8();})['catch'](function(_0x10d958){_0xae17a8(_0x10d958);});}else{_0xae17a8();}}},'charset':'utf8mb4','collate':_0x1da1('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 832c33f..3c08387 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 _0x2cd0=['then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./mailInteraction.socket','request'];(function(_0x2ed39e,_0x4384d3){var _0x20252=function(_0x3ef0e2){while(--_0x3ef0e2){_0x2ed39e['push'](_0x2ed39e['shift']());}};_0x20252(++_0x4384d3);}(_0x2cd0,0x10f));var _0x02cd=function(_0x53e2a2,_0x38f753){_0x53e2a2=_0x53e2a2-0x0;var _0x4dcf45=_0x2cd0[_0x53e2a2];return _0x4dcf45;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var moment=require(_0x02cd('0x2'));var BPromise=require(_0x02cd('0x3'));var rs=require(_0x02cd('0x4'));var fs=require('fs');var Redis=require(_0x02cd('0x5'));var db=require(_0x02cd('0x6'))['db'];var utils=require(_0x02cd('0x7'));var logger=require('../../config/logger')(_0x02cd('0x8'));var config=require(_0x02cd('0x9'));var jayson=require(_0x02cd('0xa'));var client=jayson[_0x02cd('0xb')]['http']({'port':0x232a});config[_0x02cd('0xc')]=_[_0x02cd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cd('0xc')]));require(_0x02cd('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a74ff,_0x1f5b09,_0x2b6731){return new BPromise(function(_0x9c0497,_0x27fc91){return client[_0x02cd('0xf')](_0x4a74ff,_0x2b6731)[_0x02cd('0x10')](function(_0x50603f){logger['info'](_0x02cd('0x11'),_0x1f5b09,_0x02cd('0x12'));logger[_0x02cd('0x13')](_0x02cd('0x14'),_0x1f5b09,_0x02cd('0x12'),JSON[_0x02cd('0x15')](_0x50603f));if(_0x50603f['error']){if(_0x50603f[_0x02cd('0x16')]['code']===0x1f4){logger[_0x02cd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x1f5b09,_0x50603f['error']['message']);return _0x27fc91(_0x50603f[_0x02cd('0x16')][_0x02cd('0x17')]);}logger[_0x02cd('0x16')](_0x02cd('0x11'),_0x1f5b09,_0x50603f[_0x02cd('0x16')][_0x02cd('0x17')]);return _0x9c0497(_0x50603f[_0x02cd('0x16')][_0x02cd('0x17')]);}else{logger[_0x02cd('0x18')](_0x02cd('0x11'),_0x1f5b09,_0x02cd('0x12'));_0x9c0497(_0x50603f[_0x02cd('0x19')][_0x02cd('0x17')]);}})[_0x02cd('0x1a')](function(_0x6bbe36){logger[_0x02cd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x1f5b09,_0x6bbe36);_0x27fc91(_0x6bbe36);});});}exports[_0x02cd('0x1b')]=function(_0x2ba059){var _0x1c9327=this;return new Promise(function(_0x17c764,_0x822204){return db[_0x02cd('0x1c')][_0x02cd('0x1d')](_0x2ba059[_0x02cd('0x1e')],{'raw':_0x2ba059[_0x02cd('0x1f')]?_0x2ba059[_0x02cd('0x1f')][_0x02cd('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ba059['options']?_0x2ba059[_0x02cd('0x1f')][_0x02cd('0x21')]||null:null,'attributes':_0x2ba059[_0x02cd('0x1f')]?_0x2ba059[_0x02cd('0x1f')]['attributes']||null:null,'limit':_0x2ba059[_0x02cd('0x1f')]?_0x2ba059['options'][_0x02cd('0x22')]||null:null})[_0x02cd('0x10')](function(_0x238696){logger[_0x02cd('0x18')](_0x02cd('0x1b'),_0x2ba059);logger[_0x02cd('0x13')](_0x02cd('0x1b'),_0x2ba059,JSON['stringify'](_0x238696));_0x17c764(_0x238696);})[_0x02cd('0x1a')](function(_0x1fce0c){logger['error'](_0x02cd('0x1b'),_0x1fce0c['message'],_0x2ba059);_0x822204(_0x1c9327[_0x02cd('0x16')](0x1f4,_0x1fce0c[_0x02cd('0x17')]));});});};exports[_0x02cd('0x23')]=function(_0x3651d4){return new Promise(function(_0x478068,_0x205ee7){return db[_0x02cd('0x1c')][_0x02cd('0x24')]({'where':_0x3651d4['options']?_0x3651d4['options'][_0x02cd('0x21')]||null:null})[_0x02cd('0x10')](function(_0x2ba830){if(_0x2ba830){return _0x2ba830[_0x02cd('0x25')](_0x3651d4['body']['ids'],_[_0x02cd('0x26')](_0x3651d4[_0x02cd('0x1e')],[_0x02cd('0x27'),'id'])||{});}})['spread'](function(_0x169a70){logger['info'](_0x02cd('0x28'),_0x3651d4);logger['debug'](_0x02cd('0x28'),_0x3651d4,JSON['stringify'](_0x169a70));_0x478068(_0x169a70);})[_0x02cd('0x1a')](function(_0x3ab9f9){logger[_0x02cd('0x16')](_0x02cd('0x28'),_0x3ab9f9[_0x02cd('0x17')],_0x3651d4);_0x205ee7(_this['error'](0x1f4,_0x3ab9f9[_0x02cd('0x17')]));});});}; \ No newline at end of file +var _0xe9ef=['catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','omit','ids','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0xe9ef[_0x3bb5b4];return _0x586c60;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var moment=require(_0xfe9e('0x1'));var BPromise=require(_0xfe9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe9e('0x4'));var logger=require(_0xfe9e('0x5'))(_0xfe9e('0x6'));var config=require(_0xfe9e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe9e('0x8')][_0xfe9e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfe9e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe9e('0xb'))(new Redis(config[_0xfe9e('0xa')]));require(_0xfe9e('0xc'))['register'](socket);function respondWithRpcPromise(_0x165c47,_0x210da6,_0xba1c64){return new BPromise(function(_0x5ab3bd,_0x1cc515){return client['request'](_0x165c47,_0xba1c64)[_0xfe9e('0xd')](function(_0x318158){logger[_0xfe9e('0xe')](_0xfe9e('0xf'),_0x210da6,_0xfe9e('0x10'));logger[_0xfe9e('0x11')](_0xfe9e('0x12'),_0x210da6,_0xfe9e('0x10'),JSON[_0xfe9e('0x13')](_0x318158));if(_0x318158['error']){if(_0x318158[_0xfe9e('0x14')][_0xfe9e('0x15')]===0x1f4){logger['error'](_0xfe9e('0xf'),_0x210da6,_0x318158[_0xfe9e('0x14')][_0xfe9e('0x16')]);return _0x1cc515(_0x318158[_0xfe9e('0x14')]['message']);}logger['error'](_0xfe9e('0xf'),_0x210da6,_0x318158[_0xfe9e('0x14')][_0xfe9e('0x16')]);return _0x5ab3bd(_0x318158[_0xfe9e('0x14')]['message']);}else{logger[_0xfe9e('0xe')](_0xfe9e('0xf'),_0x210da6,_0xfe9e('0x10'));_0x5ab3bd(_0x318158[_0xfe9e('0x17')]['message']);}})[_0xfe9e('0x18')](function(_0x114434){logger[_0xfe9e('0x14')](_0xfe9e('0xf'),_0x210da6,_0x114434);_0x1cc515(_0x114434);});});}exports[_0xfe9e('0x19')]=function(_0x583641){var _0x5df7ea=this;return new Promise(function(_0x255305,_0x1c956a){return db[_0xfe9e('0x1a')][_0xfe9e('0x1b')](_0x583641[_0xfe9e('0x1c')],{'raw':_0x583641[_0xfe9e('0x1d')]?_0x583641[_0xfe9e('0x1d')][_0xfe9e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583641[_0xfe9e('0x1d')]?_0x583641[_0xfe9e('0x1d')][_0xfe9e('0x1f')]||null:null,'attributes':_0x583641[_0xfe9e('0x1d')]?_0x583641['options'][_0xfe9e('0x20')]||null:null,'limit':_0x583641[_0xfe9e('0x1d')]?_0x583641['options'][_0xfe9e('0x21')]||null:null})['then'](function(_0x73a9d1){logger[_0xfe9e('0xe')]('UpdateMailInteraction',_0x583641);logger[_0xfe9e('0x11')](_0xfe9e('0x19'),_0x583641,JSON[_0xfe9e('0x13')](_0x73a9d1));_0x255305(_0x73a9d1);})[_0xfe9e('0x18')](function(_0x46ec65){logger[_0xfe9e('0x14')](_0xfe9e('0x19'),_0x46ec65[_0xfe9e('0x16')],_0x583641);_0x1c956a(_0x5df7ea[_0xfe9e('0x14')](0x1f4,_0x46ec65[_0xfe9e('0x16')]));});});};exports[_0xfe9e('0x22')]=function(_0x46fac4){return new Promise(function(_0x1595a5,_0x4b952a){return db['MailInteraction'][_0xfe9e('0x23')]({'where':_0x46fac4[_0xfe9e('0x1d')]?_0x46fac4[_0xfe9e('0x1d')][_0xfe9e('0x1f')]||null:null})['then'](function(_0x16d40a){if(_0x16d40a){return _0x16d40a['addTags'](_0x46fac4['body']['ids'],_[_0xfe9e('0x24')](_0x46fac4[_0xfe9e('0x1c')],[_0xfe9e('0x25'),'id'])||{});}})['spread'](function(_0x536f19){logger[_0xfe9e('0xe')](_0xfe9e('0x26'),_0x46fac4);logger[_0xfe9e('0x11')](_0xfe9e('0x26'),_0x46fac4,JSON[_0xfe9e('0x13')](_0x536f19));_0x1595a5(_0x536f19);})['catch'](function(_0x54d44a){logger[_0xfe9e('0x14')](_0xfe9e('0x26'),_0x54d44a[_0xfe9e('0x16')],_0x46fac4);_0x4b952a(_this[_0xfe9e('0x14')](0x1f4,_0x54d44a[_0xfe9e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b636411..85526e4 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 _0xde25=['register','length','mailInteraction:','save','remove','emit','removeListener'];(function(_0x203c49,_0xb41d65){var _0x927c2f=function(_0x548666){while(--_0x548666){_0x203c49['push'](_0x203c49['shift']());}};_0x927c2f(++_0xb41d65);}(_0xde25,0xdc));var _0x5de2=function(_0xc965b0,_0x9faa5d){_0xc965b0=_0xc965b0-0x0;var _0x2acd28=_0xde25[_0xc965b0];return _0x2acd28;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x5de2('0x0'),_0x5de2('0x1'),'update'];function createListener(_0x45841d,_0x3b9472){return function(_0x5d5f1b){_0x3b9472[_0x5de2('0x2')](_0x45841d,_0x5d5f1b);};}function removeListener(_0x1334a3,_0x23093d){return function(){MailInteractionEvents[_0x5de2('0x3')](_0x1334a3,_0x23093d);};}exports[_0x5de2('0x4')]=function(_0x45130e){for(var _0xba8d8a=0x0,_0x185892=events[_0x5de2('0x5')];_0xba8d8a<_0x185892;_0xba8d8a++){var _0x2ad50d=events[_0xba8d8a];var _0x5af0bb=createListener(_0x5de2('0x6')+_0x2ad50d,_0x45130e);MailInteractionEvents['on'](_0x2ad50d,_0x5af0bb);}}; \ No newline at end of file +var _0x793e=['mailInteraction:','./mailInteraction.events','emit','removeListener','register','length'];(function(_0xfa514e,_0x2665aa){var _0x39d8b0=function(_0x46328e){while(--_0x46328e){_0xfa514e['push'](_0xfa514e['shift']());}};_0x39d8b0(++_0x2665aa);}(_0x793e,0x8b));var _0xe793=function(_0x54e82e,_0x5ab810){_0x54e82e=_0x54e82e-0x0;var _0x763e1c=_0x793e[_0x54e82e];return _0x763e1c;};'use strict';var MailInteractionEvents=require(_0xe793('0x0'));var events=['save','remove','update'];function createListener(_0x268b47,_0x3e530d){return function(_0x10ca6a){_0x3e530d[_0xe793('0x1')](_0x268b47,_0x10ca6a);};}function removeListener(_0x72ddb2,_0x58b35f){return function(){MailInteractionEvents[_0xe793('0x2')](_0x72ddb2,_0x58b35f);};}exports[_0xe793('0x3')]=function(_0x5b6575){for(var _0x14ccf4=0x0,_0x39dd2a=events[_0xe793('0x4')];_0x14ccf4<_0x39dd2a;_0x14ccf4++){var _0x2b9610=events[_0x14ccf4];var _0xe559fc=createListener(_0xe793('0x5')+_0x2b9610,_0x5b6575);MailInteractionEvents['on'](_0x2b9610,_0xe559fc);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a78307d..43707a0 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 _0x71ab=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','mail','create','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x138540,_0x3a1135){var _0x418516=function(_0x6b2ad1){while(--_0x6b2ad1){_0x138540['push'](_0x138540['shift']());}};_0x418516(++_0x3a1135);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0x7')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0x7')](_0xb71a('0xe'),auth['isAuthenticated'](),controller[_0xb71a('0xf')]);router['post']('/',auth[_0xb71a('0x8')](),interaction[_0xb71a('0x10')](_0xb71a('0x11'),'mailmessage:create'),controller[_0xb71a('0x12')]);router['put'](_0xb71a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb71a('0x13')](_0xb71a('0x14'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb71a('0x16')]);router[_0xb71a('0x17')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x18')]);module[_0xb71a('0x19')]=router; \ No newline at end of file +var _0x53ec=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailMessage.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/download','download','post','mail','put','update','accept','/:id/reject','reject'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x53ec,0x192));var _0xc53e=function(_0x548e1d,_0x3534d3){_0x548e1d=_0x548e1d-0x0;var _0x398584=_0x53ec[_0x548e1d];return _0x398584;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['describe']);router[_0xc53e('0x8')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0x8')](_0xc53e('0xe'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc53e('0x11'),'mailmessage:create'),controller['create']);router[_0xc53e('0x12')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x13')]);router['put']('/:id/accept',auth[_0xc53e('0xb')](),controller[_0xc53e('0x14')]);router[_0xc53e('0x12')](_0xc53e('0x15'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x16')]);router[_0xc53e('0x17')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x18')]);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 5366e48..9c0c17c 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 _0x10b8=['BOOLEAN','ENUM','out','STRING','INTEGER','DATE','sequelize','lodash','exports','TEXT','long'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x10b8,0x166));var _0x810b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x10b8[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x810b('0x0'));var _=require(_0x810b('0x1'));module[_0x810b('0x2')]={'body':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x810b('0x3')]('medium')},'read':{'type':Sequelize[_0x810b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x810b('0x6')]('in',_0x810b('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x810b('0x8')](0x1fe)},'from':{'type':Sequelize[_0x810b('0x8')]},'to':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4'))},'cc':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4'))},'bcc':{'type':Sequelize[_0x810b('0x3')]('long')},'subject':{'type':Sequelize[_0x810b('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x810b('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x810b('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x810b('0xa')]},'originTo':{'type':Sequelize[_0x810b('0x3')](_0x810b('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0x810b('0x4'))}}; \ No newline at end of file +var _0xe181=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x4108c1,_0x5f2851){var _0x3795a9=function(_0x4bba9a){while(--_0x4bba9a){_0x4108c1['push'](_0x4108c1['shift']());}};_0x3795a9(++_0x5f2851);}(_0xe181,0x17a));var _0x1e18=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xe181[_0x2bf888];return _0x3038d6;};'use strict';var Sequelize=require(_0x1e18('0x0'));var _=require(_0x1e18('0x1'));module[_0x1e18('0x2')]={'body':{'type':Sequelize[_0x1e18('0x3')](_0x1e18('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1e18('0x3')](_0x1e18('0x5'))},'read':{'type':Sequelize[_0x1e18('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1e18('0x7')]('in',_0x1e18('0x8')),'defaultValue':_0x1e18('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1e18('0x9')](0x1fe)},'from':{'type':Sequelize[_0x1e18('0x9')]},'to':{'type':Sequelize[_0x1e18('0x3')]('long')},'cc':{'type':Sequelize[_0x1e18('0x3')](_0x1e18('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x1e18('0x4'))},'subject':{'type':Sequelize[_0x1e18('0x3')]},'sentAt':{'type':Sequelize[_0x1e18('0xa')]},'attach':{'type':Sequelize[_0x1e18('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1e18('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1e18('0xa')]},'originTo':{'type':Sequelize[_0x1e18('0x3')](_0x1e18('0x4'))},'originCc':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6150c04..3da6b0e 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 _0x43ff=['service','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','MailInteractionId','RejectMessage','SIP/%s','reject','rejectmessage','toString','server','files','tmp','bcc','subject','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','err','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','defaults','redis','localhost','./mailMessage.socket','register','jayson/promise','client','http','test','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','count','offset','set','Content-Range','json','save','update','sendStatus','stack','name','send','index','MailMessage','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','merge','find','body','describe','create','out','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass'];(function(_0x5a9c42,_0x1522a0){var _0x36d349=function(_0x4cff40){while(--_0x4cff40){_0x5a9c42['push'](_0x5a9c42['shift']());}};_0x36d349(++_0x1522a0);}(_0x43ff,0x16b));var _0xf43f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43ff[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf43f('0x0'));var jsonpatch=require(_0xf43f('0x1'));var rp=require(_0xf43f('0x2'));var moment=require(_0xf43f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf43f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf43f('0x5'));var csv=require(_0xf43f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf43f('0x7'));var squel=require('squel');var crypto=require(_0xf43f('0x8'));var jsforce=require(_0xf43f('0x9'));var deskjs=require(_0xf43f('0xa'));var toCsv=require(_0xf43f('0x6'));var querystring=require('querystring');var Papa=require(_0xf43f('0xb'));var Redis=require(_0xf43f('0xc'));var authService=require(_0xf43f('0xd'));var qs=require(_0xf43f('0xe'));var hardwareService=require(_0xf43f('0xf'));var logger=require(_0xf43f('0x10'))('api');var utils=require(_0xf43f('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf43f('0x12')](config[_0xf43f('0x13')],{'host':_0xf43f('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf43f('0x13')]));require(_0xf43f('0x15'))[_0xf43f('0x16')](socket);var jayson=require(_0xf43f('0x17'));var client=jayson[_0xf43f('0x18')][_0xf43f('0x19')]({'port':0x232c});var client9003=jayson[_0xf43f('0x18')][_0xf43f('0x19')]({'port':0x232b});var client9002=jayson[_0xf43f('0x18')][_0xf43f('0x19')]({'port':0x232a});function checkPasswordPattern(_0x27b154,_0x57f2e8,_0x4f2b82){if(_0x4f2b82){var _0x1a3fb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a3fb2[_0xf43f('0x1a')](_0x57f2e8)){return _0x27b154;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x27b154;}}function respondWithRpcPromise(_0x276cc4,_0x4b72ab,_0x535818,_0x453796){return new BPromise(function(_0x397238,_0xd23928){var _0x45c58c=_0x453796||client;return _0x45c58c[_0xf43f('0x1b')](_0x276cc4,_0x535818)[_0xf43f('0x1c')](function(_0x3ffc53){logger['info'](_0xf43f('0x1d'),_0x4b72ab,_0xf43f('0x1e'));logger[_0xf43f('0x1f')](_0xf43f('0x20'),_0x4b72ab,_0xf43f('0x1e'),JSON['stringify'](_0x3ffc53));if(_0x3ffc53[_0xf43f('0x21')]){if(_0x3ffc53[_0xf43f('0x21')][_0xf43f('0x22')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x4b72ab,_0x3ffc53['error'][_0xf43f('0x23')]);return _0xd23928(_0x3ffc53['error'][_0xf43f('0x23')]);}logger[_0xf43f('0x21')](_0xf43f('0x1d'),_0x4b72ab,_0x3ffc53['error']['message']);return _0x397238(_0x3ffc53['error'][_0xf43f('0x23')]);}else{logger[_0xf43f('0x24')](_0xf43f('0x1d'),_0x4b72ab,_0xf43f('0x1e'));_0x397238(_0x3ffc53[_0xf43f('0x25')][_0xf43f('0x23')]);}})['catch'](function(_0x256a6c){logger[_0xf43f('0x21')](_0xf43f('0x1d'),_0x4b72ab,_0x256a6c);_0xd23928(_0x256a6c);});});}function respondWithStatusCode(_0x34580e,_0x30adda){_0x30adda=_0x30adda||0xcc;return function(_0x13891e){if(_0x13891e){return _0x34580e['sendStatus'](_0x30adda);}return _0x34580e[_0xf43f('0x26')](_0x30adda)[_0xf43f('0x27')]();};}function respondWithResult(_0x217421,_0x3c933a){_0x3c933a=_0x3c933a||0xc8;return function(_0x5288f9){if(_0x5288f9){return _0x217421[_0xf43f('0x26')](_0x3c933a)['json'](_0x5288f9);}};}function respondWithFilteredResult(_0x1bf0c0,_0x4246be){return function(_0x11eaa2){if(_0x11eaa2){var _0x300e0f=_0x11eaa2[_0xf43f('0x28')],_0xbd6572=_0x4246be[_0xf43f('0x29')],_0x19085f=_0x4246be['offset']+_0x4246be['limit'],_0x18f8c3;if(_0x19085f>=_0x300e0f){_0x19085f=_0x300e0f;_0x18f8c3=0xc8;}else{_0x18f8c3=0xce;}_0x1bf0c0[_0xf43f('0x26')](_0x18f8c3);return _0x1bf0c0[_0xf43f('0x2a')](_0xf43f('0x2b'),_0xbd6572+'-'+_0x19085f+'/'+_0x300e0f)[_0xf43f('0x2c')](_0x11eaa2);}return null;};}function patchUpdates(_0x3b70e1){return function(_0x5ca12c){try{jsonpatch['apply'](_0x5ca12c,_0x3b70e1,!![]);}catch(_0x4213aa){return BPromise['reject'](_0x4213aa);}return _0x5ca12c[_0xf43f('0x2d')]();};}function saveUpdates(_0x25e834,_0x55eeb0){return function(_0x54378a){if(_0x54378a){return _0x54378a[_0xf43f('0x2e')](_0x25e834)[_0xf43f('0x1c')](function(_0x48762b){return _0x48762b;});}return null;};}function removeEntity(_0x6bed27,_0xe241c1){return function(_0x8673e8){if(_0x8673e8){return _0x8673e8['destroy']()['then'](function(){_0x6bed27[_0xf43f('0x26')](0xcc)[_0xf43f('0x27')]();});}};}function handleEntityNotFound(_0x585f8a,_0x16ee71){return function(_0x1ba464){if(!_0x1ba464){_0x585f8a[_0xf43f('0x2f')](0x194);}return _0x1ba464;};}function handleError(_0x1fb25e,_0x55b436){_0x55b436=_0x55b436||0x1f4;return function(_0x277796){logger[_0xf43f('0x21')](_0x277796[_0xf43f('0x30')]);if(_0x277796[_0xf43f('0x31')]){delete _0x277796[_0xf43f('0x31')];}_0x1fb25e[_0xf43f('0x26')](_0x55b436)[_0xf43f('0x32')](_0x277796);};}exports[_0xf43f('0x33')]=function(_0x24c94b,_0x6755f6){var _0xbbad61={},_0x454d08={},_0x256d3c={'count':0x0,'rows':[]};var _0x2ec932=db[_0xf43f('0x34')]['rawAttributes'];_0x454d08[_0xf43f('0x35')]=_['keys'](_0x2ec932);_0x454d08[_0xf43f('0x36')]=_['keys'](_0x24c94b['query']);_0x454d08[_0xf43f('0x37')]=_[_0xf43f('0x38')](_0x454d08[_0xf43f('0x35')],_0x454d08[_0xf43f('0x36')]);_0xbbad61[_0xf43f('0x39')]=_[_0xf43f('0x38')](_0x454d08['model'],qs['fields'](_0x24c94b['query']['fields']));_0xbbad61['attributes']=_0xbbad61[_0xf43f('0x39')][_0xf43f('0x3a')]?_0xbbad61[_0xf43f('0x39')]:_0x454d08['model'];if(!_0x24c94b['query'][_0xf43f('0x3b')](_0xf43f('0x3c'))){_0xbbad61[_0xf43f('0x3d')]=qs[_0xf43f('0x3d')](_0x24c94b['query']['limit']);_0xbbad61[_0xf43f('0x29')]=qs[_0xf43f('0x29')](_0x24c94b[_0xf43f('0x36')]['offset']);}_0xbbad61[_0xf43f('0x3e')]=qs['sort'](_0x24c94b[_0xf43f('0x36')][_0xf43f('0x3f')]);_0xbbad61[_0xf43f('0x40')]=qs['filters'](_[_0xf43f('0x41')](_0x24c94b[_0xf43f('0x36')],_0x454d08['filters']));if(_0x24c94b[_0xf43f('0x36')][_0xf43f('0x42')]){_0xbbad61[_0xf43f('0x40')]=_['merge'](_0xbbad61['where'],{'$or':_[_0xf43f('0x43')](_0x2ec932,function(_0x2ac15f){if(_0x2ac15f[_0xf43f('0x44')]['key']!=='VIRTUAL'){var _0x200d1c={};_0x200d1c[_0x2ac15f['field']]={'$like':'%'+_0x24c94b[_0xf43f('0x36')]['filter']+'%'};return _0x200d1c;}})});}_0xbbad61=_['merge']({},_0xbbad61,_0x24c94b['options']);var _0x13098f={'where':_0xbbad61['where']};return db[_0xf43f('0x34')]['count'](_0x13098f)[_0xf43f('0x1c')](function(_0x3c0fb4){_0x256d3c[_0xf43f('0x28')]=_0x3c0fb4;if(_0x24c94b[_0xf43f('0x36')][_0xf43f('0x45')]){_0xbbad61[_0xf43f('0x46')]=[{'all':!![]}];}return db[_0xf43f('0x34')][_0xf43f('0x47')](_0xbbad61);})[_0xf43f('0x1c')](function(_0x117879){_0x256d3c[_0xf43f('0x48')]=_0x117879;return _0x256d3c;})['then'](respondWithFilteredResult(_0x6755f6,_0xbbad61))[_0xf43f('0x49')](handleError(_0x6755f6,null));};exports[_0xf43f('0x4a')]=function(_0x31ce6f,_0x4ea65e){var _0x1cbaa7={'raw':!![],'where':{'id':_0x31ce6f[_0xf43f('0x4b')]['id']}},_0x176bbf={};_0x176bbf[_0xf43f('0x35')]=_[_0xf43f('0x4c')](db[_0xf43f('0x34')][_0xf43f('0x4d')]);_0x176bbf[_0xf43f('0x36')]=_[_0xf43f('0x4c')](_0x31ce6f[_0xf43f('0x36')]);_0x176bbf['filters']=_[_0xf43f('0x38')](_0x176bbf[_0xf43f('0x35')],_0x176bbf[_0xf43f('0x36')]);_0x1cbaa7[_0xf43f('0x39')]=_['intersection'](_0x176bbf[_0xf43f('0x35')],qs[_0xf43f('0x4e')](_0x31ce6f[_0xf43f('0x36')]['fields']));_0x1cbaa7[_0xf43f('0x39')]=_0x1cbaa7[_0xf43f('0x39')][_0xf43f('0x3a')]?_0x1cbaa7[_0xf43f('0x39')]:_0x176bbf['model'];if(_0x31ce6f[_0xf43f('0x36')]['includeAll']){_0x1cbaa7['include']=[{'all':!![]}];}_0x1cbaa7=_[_0xf43f('0x4f')]({},_0x1cbaa7,_0x31ce6f['options']);return db[_0xf43f('0x34')][_0xf43f('0x50')](_0x1cbaa7)[_0xf43f('0x1c')](handleEntityNotFound(_0x4ea65e,null))['then'](respondWithResult(_0x4ea65e,null))[_0xf43f('0x49')](handleError(_0x4ea65e,null));};exports[_0xf43f('0x2e')]=function(_0x4c69c9,_0x2126cb){if(_0x4c69c9[_0xf43f('0x51')]['id']){delete _0x4c69c9[_0xf43f('0x51')]['id'];}return db[_0xf43f('0x34')][_0xf43f('0x50')]({'where':{'id':_0x4c69c9[_0xf43f('0x4b')]['id']}})[_0xf43f('0x1c')](handleEntityNotFound(_0x2126cb,null))[_0xf43f('0x1c')](saveUpdates(_0x4c69c9[_0xf43f('0x51')],null))[_0xf43f('0x1c')](respondWithResult(_0x2126cb,null))[_0xf43f('0x49')](handleError(_0x2126cb,null));};exports['destroy']=function(_0x279cd5,_0x153a5c){return db['MailMessage'][_0xf43f('0x50')]({'where':{'id':_0x279cd5[_0xf43f('0x4b')]['id']}})[_0xf43f('0x1c')](handleEntityNotFound(_0x153a5c,null))[_0xf43f('0x1c')](removeEntity(_0x153a5c,null))[_0xf43f('0x49')](handleError(_0x153a5c,null));};exports[_0xf43f('0x52')]=function(_0x2d1564,_0x5144ee){return db['MailMessage'][_0xf43f('0x52')]()[_0xf43f('0x1c')](respondWithResult(_0x5144ee,null))[_0xf43f('0x49')](handleError(_0x5144ee,null));};exports[_0xf43f('0x53')]=function(_0x39a18c,_0x573ced){return db[_0xf43f('0x34')][_0xf43f('0x53')](_0x39a18c['body'])['then'](function(_0x2a51b5){if(_0x2a51b5){if(_0x2a51b5['direction']===_0xf43f('0x54')&&!_0x2a51b5[_0xf43f('0x55')]){return db[_0xf43f('0x56')][_0xf43f('0x57')]({'where':{'id':_0x2a51b5[_0xf43f('0x58')]},'include':[{'model':db[_0xf43f('0x59')],'as':'Smtp','raw':!![]}]})[_0xf43f('0x1c')](function(_0x29928b){if(_0x29928b&&_0x29928b[_0xf43f('0x5a')]){var _0x2edaa8={'tls':{'rejectUnauthorized':![]}};if(_[_0xf43f('0x5b')](_0x29928b['Smtp']['service'])){_0x2edaa8[_0xf43f('0x5c')]=_0x29928b[_0xf43f('0x5a')][_0xf43f('0x5c')];_0x2edaa8[_0xf43f('0x5d')]=_0x29928b[_0xf43f('0x5a')]['port'];_0x2edaa8[_0xf43f('0x5e')]=_0x29928b[_0xf43f('0x5a')][_0xf43f('0x5e')];if(_0x29928b[_0xf43f('0x5a')][_0xf43f('0x5f')]){_0x2edaa8[_0xf43f('0x60')]={'user':_0x29928b[_0xf43f('0x5a')][_0xf43f('0x61')],'pass':_0x29928b[_0xf43f('0x5a')][_0xf43f('0x62')]};}}else{_0x2edaa8['service']=_0x29928b['Smtp'][_0xf43f('0x63')];_0x2edaa8[_0xf43f('0x60')]={'user':_0x29928b['Smtp'][_0xf43f('0x61')],'pass':_0x29928b[_0xf43f('0x5a')]['pass']};_0x2edaa8['secure']=_0x29928b[_0xf43f('0x5a')][_0xf43f('0x5e')];}if(_0x39a18c['body'][_0xf43f('0x64')]&&_0x39a18c[_0xf43f('0x51')][_0xf43f('0x64')][_0xf43f('0x3a')]){for(var _0x9c4816=0x0;_0x9c4816<_0x39a18c[_0xf43f('0x51')][_0xf43f('0x64')][_0xf43f('0x3a')];_0x9c4816+=0x1){_0x39a18c[_0xf43f('0x51')][_0xf43f('0x64')][_0x9c4816]={'filename':_0x39a18c['body'][_0xf43f('0x64')][_0x9c4816][_0xf43f('0x31')],'path':path[_0xf43f('0x65')](config[_0xf43f('0x66')],_0xf43f('0x67'),_0x39a18c[_0xf43f('0x51')][_0xf43f('0x64')][_0x9c4816][_0xf43f('0x68')])};}}return{'account':_0x2edaa8,'message':_0x39a18c[_0xf43f('0x51')]};}})[_0xf43f('0x1c')](function(_0x26735c){if(_0x26735c){return respondWithRpcPromise(_0xf43f('0x69'),_0xf43f('0x6a'),_0x26735c,client9003)[_0xf43f('0x1c')](function(_0x514db7){return _0x2a51b5[_0xf43f('0x2e')]({'read':!![],'messageId':_0x514db7[_0xf43f('0x6b')],'sentAt':moment()[_0xf43f('0x6c')](_0xf43f('0x6d'))});})[_0xf43f('0x49')](function(_0x13d8df){logger[_0xf43f('0x21')]('%s',JSON['stringify'](_0x13d8df));return _0x2a51b5;});}return _0x2a51b5;});}return _0x2a51b5;}})['then'](respondWithResult(_0x573ced,0xc9))[_0xf43f('0x49')](handleError(_0x573ced,null));};var interaction_log=require(_0xf43f('0x10'))(_0xf43f('0x6e'));exports[_0xf43f('0x6f')]=function(_0x4da353,_0x565f40,_0x155a5f){var _0x5a8889={'channel':_0xf43f('0x70')};if(_0x4da353[_0xf43f('0x51')]['id']){delete _0x4da353[_0xf43f('0x51')]['id'];}_0x4da353[_0xf43f('0x51')][_0xf43f('0x71')]=!![];_0x4da353['body'][_0xf43f('0x72')]=moment()[_0xf43f('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4da353[_0xf43f('0x51')][_0xf43f('0x73')]=_0x4da353[_0xf43f('0x51')][_0xf43f('0x73')]||_0x4da353[_0xf43f('0x61')]['id'];return db[_0xf43f('0x34')][_0xf43f('0x50')]({'where':{'id':_0x4da353['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xf43f('0x74')}]})[_0xf43f('0x1c')](handleEntityNotFound(_0x565f40,null))[_0xf43f('0x1c')](saveUpdates(_0x4da353[_0xf43f('0x51')],null))[_0xf43f('0x1c')](function(_0x2f9f3c){if(_0x2f9f3c){_0x5a8889['message']=_0x2f9f3c[_0xf43f('0x75')]({'plain':!![]});return db[_0xf43f('0x76')]['find']({'where':{'id':_0x2f9f3c['MailInteractionId']}});}return null;})[_0xf43f('0x1c')](handleEntityNotFound(_0x565f40,null))['then'](function(_0xfde37b){if(_0xfde37b){return _0xfde37b[_0xf43f('0x2e')]({'UserId':_0x4da353['body'][_0xf43f('0x73')],'read1stAt':_['isNil'](_0xfde37b[_0xf43f('0x77')])?moment()[_0xf43f('0x6c')](_0xf43f('0x6d')):undefined});}return null;})[_0xf43f('0x1c')](function(_0xe54f5e){if(_0xe54f5e){_0x5a8889[_0xf43f('0x78')]=_0xe54f5e[_0xf43f('0x75')]({'plain':!![]});interaction_log['info'](_0xf43f('0x79'),_0x4da353['user']['id'],_0x4da353['user'][_0xf43f('0x31')],_0x4da353[_0xf43f('0x61')][_0xf43f('0x7a')],_0x5a8889[_0xf43f('0x78')]['id'],_0x4da353[_0xf43f('0x51')]?JSON[_0xf43f('0x7b')](_0x4da353[_0xf43f('0x51')]):_0xf43f('0x7c'));return respondWithRpcPromise(_0xf43f('0x7d'),_0xf43f('0x7e'),_0x5a8889);}return null;})[_0xf43f('0x1c')](function(_0x506892){if(_0x506892){if(_0x4da353[_0xf43f('0x51')][_0xf43f('0x7f')]){_0x5a8889['message'][_0xf43f('0x80')]=util[_0xf43f('0x6c')]('SIP/%s',_0x4da353['user']['name']);_0x5a8889[_0xf43f('0x23')][_0xf43f('0x81')]=_0x5a8889[_0xf43f('0x81')];_0x5a8889['message'][_0xf43f('0x82')]=_0xf43f('0x6f');return respondWithRpcPromise(_0xf43f('0x83'),_0xf43f('0x83'),{'event':'acceptmessage','message':_0x5a8889[_0xf43f('0x23')]},client9002)[_0xf43f('0x1c')](function(){return _0x5a8889;});}return _0x5a8889;}return null;})['then'](respondWithResult(_0x565f40,null))[_0xf43f('0x49')](handleError(_0x565f40,null));};var interaction_log=require(_0xf43f('0x10'))(_0xf43f('0x6e'));exports['reject']=function(_0x16b348,_0x5ab2e2,_0x238c06){var _0x145652={'agent':{},'channel':_0xf43f('0x70')};if(_0x16b348[_0xf43f('0x51')]['id']){delete _0x16b348[_0xf43f('0x51')]['id'];}_0x16b348[_0xf43f('0x51')][_0xf43f('0x73')]=_0x16b348[_0xf43f('0x51')][_0xf43f('0x73')]||_0x16b348[_0xf43f('0x61')]['id'];_0x145652['agent']['id']=_0x16b348[_0xf43f('0x51')][_0xf43f('0x73')];return db[_0xf43f('0x34')][_0xf43f('0x50')]({'where':{'id':_0x16b348[_0xf43f('0x4b')]['id'],'UserId':null}})[_0xf43f('0x1c')](handleEntityNotFound(_0x5ab2e2,null))[_0xf43f('0x1c')](function(_0x288298){if(_0x288298){_0x145652[_0xf43f('0x23')]=_0x288298[_0xf43f('0x75')]({'plain':!![]});return db[_0xf43f('0x76')]['find']({'where':{'id':_0x288298[_0xf43f('0x84')]}});}return null;})[_0xf43f('0x1c')](handleEntityNotFound(_0x5ab2e2,null))['then'](function(_0x4d3b37){if(_0x4d3b37){_0x145652['interaction']=_0x4d3b37[_0xf43f('0x75')]({'plain':!![]});interaction_log[_0xf43f('0x24')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16b348[_0xf43f('0x61')]['id'],_0x16b348['user'][_0xf43f('0x31')],_0x16b348['user'][_0xf43f('0x7a')],_0x145652['interaction']['id'],_0x16b348[_0xf43f('0x51')]?JSON[_0xf43f('0x7b')](_0x16b348[_0xf43f('0x51')]):_0xf43f('0x7c'));return respondWithRpcPromise(_0xf43f('0x85'),'rejectMessage',_0x145652);}return null;})['then'](function(_0x583826){if(_0x583826){_0x583826[_0xf43f('0x23')]['interface']=util[_0xf43f('0x6c')](_0xf43f('0x86'),_0x16b348['user'][_0xf43f('0x31')]);_0x583826[_0xf43f('0x23')][_0xf43f('0x81')]=_0x145652[_0xf43f('0x81')];_0x583826['message']['event']=_0xf43f('0x87');respondWithRpcPromise(_0xf43f('0x83'),_0xf43f('0x83'),{'event':_0xf43f('0x88'),'message':_0x583826[_0xf43f('0x23')]},client9002);return _0x145652;}return null;})[_0xf43f('0x1c')](respondWithResult(_0x5ab2e2,null))['catch'](handleError(_0x5ab2e2,null));};exports['download']=function(_0xdd2655,_0x5d3123){var _0x5f5c9e=moment()['unix']()[_0xf43f('0x89')]();var _0x4dd8ec=path['join'](config[_0xf43f('0x66')],_0xf43f('0x8a'),_0xf43f('0x8b'),_0xf43f('0x8c'));var _0x53e036=path['join'](config[_0xf43f('0x66')],_0xf43f('0x8a'),_0xf43f('0x8b'),'attachments');var _0x42904a=util[_0xf43f('0x6c')]('message-%s.eml',_0x5f5c9e);return db[_0xf43f('0x34')]['find']({'where':{'id':_0xdd2655['params']['id']},'attributes':['id',_0xf43f('0x51'),'from','to','cc',_0xf43f('0x8d'),_0xf43f('0x8e'),'createdAt'],'include':_0xdd2655[_0xf43f('0x36')][_0xf43f('0x64')]?[{'model':db[_0xf43f('0x8f')],'as':_0xf43f('0x90')}]:undefined})['then'](handleEntityNotFound(_0x5d3123,null))[_0xf43f('0x1c')](function(_0x3e920a){if(_0x3e920a){var _0x48548a=_0x3e920a;var _0x2617ff={'from':_0x48548a[_0xf43f('0x91')],'to':_0x48548a['to'],'subject':_0x48548a[_0xf43f('0x8e')],'html':_0x48548a[_0xf43f('0x51')],'headers':{'Date':moment(_0x48548a['createdAt'])[_0xf43f('0x6c')](_0xf43f('0x92'))},'attachments':[]};if(_0x3e920a['cc']){_0x2617ff[_0xf43f('0x93')]['Cc']=_0x3e920a['cc'];}if(_0x3e920a['bcc']){_0x2617ff[_0xf43f('0x93')][_0xf43f('0x94')]=_0x3e920a[_0xf43f('0x8d')];}return new BPromise(function(_0x138630,_0x1f4b81){if(_0x3e920a['Attachments']){for(var _0x22945c=0x0;_0x22945c<_0x3e920a[_0xf43f('0x90')][_0xf43f('0x3a')];_0x22945c++){var _0x4c77ff=_0x3e920a['Attachments'][_0x22945c];var _0x2ea869=path[_0xf43f('0x65')](_0x53e036,_0x4c77ff[_0xf43f('0x68')]);if(fs[_0xf43f('0x95')](_0x2ea869)){_0x2617ff['attachments'][_0xf43f('0x96')]({'name':_0x4c77ff['name'],'contentType':_0x4c77ff[_0xf43f('0x44')],'data':fs[_0xf43f('0x97')](_0x2ea869)});}}}emlformat[_0xf43f('0x98')](_0x2617ff,function(_0x514c38,_0xe6ff3f){if(_0x514c38)return _0x1f4b81(_0x514c38);fs['writeFileSync'](path[_0xf43f('0x65')](_0x4dd8ec,_0x42904a),_0xe6ff3f);return _0x138630(_0xe6ff3f);});});}})['then'](function(_0x5bb238){if(_0x5bb238){return _0x5d3123['download'](path[_0xf43f('0x65')](_0x4dd8ec,_0x42904a),_0x42904a,function(_0x419bd2){if(_0x419bd2){console['log'](_0xf43f('0x99'),_0x419bd2);}else{fs['unlinkSync'](path[_0xf43f('0x65')](_0x4dd8ec,_0x42904a));}});}})[_0xf43f('0x49')](handleError(_0x5d3123,null));}; \ No newline at end of file +var _0xa74c=['status','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','MailMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','params','find','body','create','secret','findOne','MailAccountId','MailServerOut','Smtp','service','host','port','secure','authentication','pass','attachments','join','server/files/attachments','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','user','CmContact','Contact','get','MailInteraction','MailInteractionId','isNil','read1stAt','role','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','headers','Bcc','bcc','basename','existsSync','push','build','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','request\x20sent','sendStatus','end'];(function(_0x2bec7b,_0x3efc04){var _0x11779a=function(_0x55102d){while(--_0x55102d){_0x2bec7b['push'](_0x2bec7b['shift']());}};_0x11779a(++_0x3efc04);}(_0xa74c,0x74));var _0xca74=function(_0x516764,_0x42970b){_0x516764=_0x516764-0x0;var _0x56fcbc=_0xa74c[_0x516764];return _0x56fcbc;};'use strict';var pdf=require(_0xca74('0x0'));var emlformat=require(_0xca74('0x1'));var rimraf=require(_0xca74('0x2'));var zipdir=require(_0xca74('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca74('0x4'));var moment=require(_0xca74('0x5'));var BPromise=require(_0xca74('0x6'));var Mustache=require(_0xca74('0x7'));var util=require('util');var path=require(_0xca74('0x8'));var sox=require(_0xca74('0x9'));var csv=require(_0xca74('0xa'));var ejs=require(_0xca74('0xb'));var fs=require('fs');var _=require(_0xca74('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xca74('0xd'));var deskjs=require(_0xca74('0xe'));var toCsv=require(_0xca74('0xa'));var querystring=require(_0xca74('0xf'));var Papa=require(_0xca74('0x10'));var Redis=require(_0xca74('0x11'));var authService=require(_0xca74('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xca74('0x13'));var logger=require(_0xca74('0x14'))('api');var utils=require(_0xca74('0x15'));var config=require('../../config/environment');var db=require(_0xca74('0x16'))['db'];config['redis']=_[_0xca74('0x17')](config[_0xca74('0x18')],{'host':_0xca74('0x19'),'port':0x18eb});var socket=require(_0xca74('0x1a'))(new Redis(config[_0xca74('0x18')]));require('./mailMessage.socket')[_0xca74('0x1b')](socket);var jayson=require(_0xca74('0x1c'));var client=jayson[_0xca74('0x1d')]['http']({'port':0x232c});var client9003=jayson[_0xca74('0x1d')][_0xca74('0x1e')]({'port':0x232b});var client9002=jayson[_0xca74('0x1d')][_0xca74('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x27cef9,_0x3ae679,_0x4bb65b){if(_0x4bb65b){var _0x180105=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x180105[_0xca74('0x1f')](_0x3ae679)){return _0x27cef9;}else{throw new Error(_0xca74('0x20'));}}else{return _0x27cef9;}}function respondWithRpcPromise(_0x399888,_0x436d27,_0x3bd45d,_0x1e89ef){return new BPromise(function(_0x2e278f,_0x3a9846){var _0x162afd=_0x1e89ef||client;return _0x162afd[_0xca74('0x21')](_0x399888,_0x3bd45d)[_0xca74('0x22')](function(_0x35a9a3){logger[_0xca74('0x23')]('MailMessage,\x20%s,\x20%s',_0x436d27,'request\x20sent');logger[_0xca74('0x24')](_0xca74('0x25'),_0x436d27,'request\x20sent',JSON[_0xca74('0x26')](_0x35a9a3));if(_0x35a9a3[_0xca74('0x27')]){if(_0x35a9a3[_0xca74('0x27')][_0xca74('0x28')]===0x1f4){logger[_0xca74('0x27')](_0xca74('0x29'),_0x436d27,_0x35a9a3['error'][_0xca74('0x2a')]);return _0x3a9846(_0x35a9a3['error']['message']);}logger[_0xca74('0x27')]('MailMessage,\x20%s,\x20%s',_0x436d27,_0x35a9a3[_0xca74('0x27')][_0xca74('0x2a')]);return _0x2e278f(_0x35a9a3['error'][_0xca74('0x2a')]);}else{logger[_0xca74('0x23')](_0xca74('0x29'),_0x436d27,_0xca74('0x2b'));_0x2e278f(_0x35a9a3['result']['message']);}})['catch'](function(_0x189be5){logger[_0xca74('0x27')](_0xca74('0x29'),_0x436d27,_0x189be5);_0x3a9846(_0x189be5);});});}function respondWithStatusCode(_0x190ff4,_0x1067f2){_0x1067f2=_0x1067f2||0xcc;return function(_0x228ad8){if(_0x228ad8){return _0x190ff4[_0xca74('0x2c')](_0x1067f2);}return _0x190ff4['status'](_0x1067f2)[_0xca74('0x2d')]();};}function respondWithResult(_0x2d1a5c,_0x5e4cf0){_0x5e4cf0=_0x5e4cf0||0xc8;return function(_0x35053d){if(_0x35053d){return _0x2d1a5c[_0xca74('0x2e')](_0x5e4cf0)['json'](_0x35053d);}};}function respondWithFilteredResult(_0x34af9a,_0x5a835d){return function(_0xd70bed){if(_0xd70bed){var _0x3b4f1a=_0xd70bed['count'],_0x3ba8e2=_0x5a835d[_0xca74('0x2f')],_0x46356a=_0x5a835d[_0xca74('0x2f')]+_0x5a835d[_0xca74('0x30')],_0x5a4879;if(_0x46356a>=_0x3b4f1a){_0x46356a=_0x3b4f1a;_0x5a4879=0xc8;}else{_0x5a4879=0xce;}_0x34af9a['status'](_0x5a4879);return _0x34af9a['set'](_0xca74('0x31'),_0x3ba8e2+'-'+_0x46356a+'/'+_0x3b4f1a)[_0xca74('0x32')](_0xd70bed);}return null;};}function patchUpdates(_0x84dc8b){return function(_0x546b66){try{jsonpatch[_0xca74('0x33')](_0x546b66,_0x84dc8b,!![]);}catch(_0x166533){return BPromise[_0xca74('0x34')](_0x166533);}return _0x546b66[_0xca74('0x35')]();};}function saveUpdates(_0x3397cd,_0x142370){return function(_0x40c384){if(_0x40c384){return _0x40c384[_0xca74('0x36')](_0x3397cd)[_0xca74('0x22')](function(_0x598c86){return _0x598c86;});}return null;};}function removeEntity(_0x1c4676,_0x32be8e){return function(_0x15b8b9){if(_0x15b8b9){return _0x15b8b9[_0xca74('0x37')]()[_0xca74('0x22')](function(){_0x1c4676['status'](0xcc)[_0xca74('0x2d')]();});}};}function handleEntityNotFound(_0x13be0c,_0x35088b){return function(_0x4a4a6f){if(!_0x4a4a6f){_0x13be0c[_0xca74('0x2c')](0x194);}return _0x4a4a6f;};}function handleError(_0x2fdbcd,_0x1e9ef0){_0x1e9ef0=_0x1e9ef0||0x1f4;return function(_0x2e7cb7){logger[_0xca74('0x27')](_0x2e7cb7[_0xca74('0x38')]);if(_0x2e7cb7[_0xca74('0x39')]){delete _0x2e7cb7[_0xca74('0x39')];}_0x2fdbcd[_0xca74('0x2e')](_0x1e9ef0)[_0xca74('0x3a')](_0x2e7cb7);};}exports[_0xca74('0x3b')]=function(_0x629f36,_0x5307d4){var _0x59a3d6={},_0x439f86={},_0x427f79={'count':0x0,'rows':[]};var _0x546c97=db[_0xca74('0x3c')][_0xca74('0x3d')];_0x439f86['model']=_[_0xca74('0x3e')](_0x546c97);_0x439f86[_0xca74('0x3f')]=_[_0xca74('0x3e')](_0x629f36[_0xca74('0x3f')]);_0x439f86[_0xca74('0x40')]=_[_0xca74('0x41')](_0x439f86[_0xca74('0x42')],_0x439f86[_0xca74('0x3f')]);_0x59a3d6[_0xca74('0x43')]=_[_0xca74('0x41')](_0x439f86['model'],qs['fields'](_0x629f36['query'][_0xca74('0x44')]));_0x59a3d6[_0xca74('0x43')]=_0x59a3d6[_0xca74('0x43')][_0xca74('0x45')]?_0x59a3d6[_0xca74('0x43')]:_0x439f86['model'];if(!_0x629f36[_0xca74('0x3f')][_0xca74('0x46')](_0xca74('0x47'))){_0x59a3d6[_0xca74('0x30')]=qs[_0xca74('0x30')](_0x629f36[_0xca74('0x3f')]['limit']);_0x59a3d6[_0xca74('0x2f')]=qs['offset'](_0x629f36[_0xca74('0x3f')][_0xca74('0x2f')]);}_0x59a3d6[_0xca74('0x48')]=qs[_0xca74('0x49')](_0x629f36[_0xca74('0x3f')][_0xca74('0x49')]);_0x59a3d6[_0xca74('0x4a')]=qs[_0xca74('0x40')](_[_0xca74('0x4b')](_0x629f36['query'],_0x439f86[_0xca74('0x40')]));if(_0x629f36[_0xca74('0x3f')][_0xca74('0x4c')]){_0x59a3d6[_0xca74('0x4a')]=_[_0xca74('0x4d')](_0x59a3d6[_0xca74('0x4a')],{'$or':_['map'](_0x546c97,function(_0x2cec54){if(_0x2cec54[_0xca74('0x4e')][_0xca74('0x4f')]!==_0xca74('0x50')){var _0x2749b7={};_0x2749b7[_0x2cec54[_0xca74('0x51')]]={'$like':'%'+_0x629f36['query'][_0xca74('0x4c')]+'%'};return _0x2749b7;}})});}_0x59a3d6=_[_0xca74('0x4d')]({},_0x59a3d6,_0x629f36[_0xca74('0x52')]);var _0x100844={'where':_0x59a3d6[_0xca74('0x4a')]};return db[_0xca74('0x3c')][_0xca74('0x53')](_0x100844)['then'](function(_0x8a6093){_0x427f79[_0xca74('0x53')]=_0x8a6093;if(_0x629f36[_0xca74('0x3f')][_0xca74('0x54')]){_0x59a3d6[_0xca74('0x55')]=[{'all':!![]}];}return db[_0xca74('0x3c')][_0xca74('0x56')](_0x59a3d6);})[_0xca74('0x22')](function(_0x1598cc){_0x427f79['rows']=_0x1598cc;return _0x427f79;})['then'](respondWithFilteredResult(_0x5307d4,_0x59a3d6))[_0xca74('0x57')](handleError(_0x5307d4,null));};exports['show']=function(_0x2254cd,_0x351faa){var _0x47d39b={'raw':!![],'where':{'id':_0x2254cd[_0xca74('0x58')]['id']}},_0x3b75a0={};_0x3b75a0[_0xca74('0x42')]=_[_0xca74('0x3e')](db[_0xca74('0x3c')][_0xca74('0x3d')]);_0x3b75a0['query']=_[_0xca74('0x3e')](_0x2254cd[_0xca74('0x3f')]);_0x3b75a0[_0xca74('0x40')]=_[_0xca74('0x41')](_0x3b75a0['model'],_0x3b75a0[_0xca74('0x3f')]);_0x47d39b[_0xca74('0x43')]=_[_0xca74('0x41')](_0x3b75a0[_0xca74('0x42')],qs[_0xca74('0x44')](_0x2254cd[_0xca74('0x3f')]['fields']));_0x47d39b[_0xca74('0x43')]=_0x47d39b[_0xca74('0x43')]['length']?_0x47d39b[_0xca74('0x43')]:_0x3b75a0['model'];if(_0x2254cd['query'][_0xca74('0x54')]){_0x47d39b[_0xca74('0x55')]=[{'all':!![]}];}_0x47d39b=_['merge']({},_0x47d39b,_0x2254cd[_0xca74('0x52')]);return db['MailMessage'][_0xca74('0x59')](_0x47d39b)[_0xca74('0x22')](handleEntityNotFound(_0x351faa,null))[_0xca74('0x22')](respondWithResult(_0x351faa,null))[_0xca74('0x57')](handleError(_0x351faa,null));};exports[_0xca74('0x36')]=function(_0x543897,_0x319826){if(_0x543897[_0xca74('0x5a')]['id']){delete _0x543897[_0xca74('0x5a')]['id'];}return db['MailMessage'][_0xca74('0x59')]({'where':{'id':_0x543897['params']['id']}})[_0xca74('0x22')](handleEntityNotFound(_0x319826,null))['then'](saveUpdates(_0x543897[_0xca74('0x5a')],null))['then'](respondWithResult(_0x319826,null))[_0xca74('0x57')](handleError(_0x319826,null));};exports[_0xca74('0x37')]=function(_0x29a6a9,_0x5048a5){return db[_0xca74('0x3c')][_0xca74('0x59')]({'where':{'id':_0x29a6a9[_0xca74('0x58')]['id']}})[_0xca74('0x22')](handleEntityNotFound(_0x5048a5,null))[_0xca74('0x22')](removeEntity(_0x5048a5,null))[_0xca74('0x57')](handleError(_0x5048a5,null));};exports['describe']=function(_0x976e34,_0x1097db){return db[_0xca74('0x3c')]['describe']()[_0xca74('0x22')](respondWithResult(_0x1097db,null))['catch'](handleError(_0x1097db,null));};exports[_0xca74('0x5b')]=function(_0x5730fc,_0x28b3c1){return db[_0xca74('0x3c')][_0xca74('0x5b')](_0x5730fc[_0xca74('0x5a')])[_0xca74('0x22')](function(_0x256e10){if(_0x256e10){if(_0x256e10['direction']==='out'&&!_0x256e10[_0xca74('0x5c')]){return db['MailAccount'][_0xca74('0x5d')]({'where':{'id':_0x256e10[_0xca74('0x5e')]},'include':[{'model':db[_0xca74('0x5f')],'as':_0xca74('0x60'),'raw':!![]}]})[_0xca74('0x22')](function(_0xd8835e){if(_0xd8835e&&_0xd8835e['Smtp']){var _0x1e4947={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xd8835e['Smtp'][_0xca74('0x61')])){_0x1e4947['host']=_0xd8835e[_0xca74('0x60')][_0xca74('0x62')];_0x1e4947[_0xca74('0x63')]=_0xd8835e[_0xca74('0x60')]['port'];_0x1e4947[_0xca74('0x64')]=_0xd8835e['Smtp'][_0xca74('0x64')];if(_0xd8835e[_0xca74('0x60')][_0xca74('0x65')]){_0x1e4947['auth']={'user':_0xd8835e[_0xca74('0x60')]['user'],'pass':_0xd8835e['Smtp'][_0xca74('0x66')]};}}else{_0x1e4947[_0xca74('0x61')]=_0xd8835e[_0xca74('0x60')][_0xca74('0x61')];_0x1e4947['auth']={'user':_0xd8835e[_0xca74('0x60')]['user'],'pass':_0xd8835e[_0xca74('0x60')][_0xca74('0x66')]};_0x1e4947['secure']=_0xd8835e[_0xca74('0x60')][_0xca74('0x64')];}if(_0x5730fc['body'][_0xca74('0x67')]&&_0x5730fc[_0xca74('0x5a')]['attachments'][_0xca74('0x45')]){for(var _0x237f8c=0x0;_0x237f8c<_0x5730fc[_0xca74('0x5a')]['attachments'][_0xca74('0x45')];_0x237f8c+=0x1){_0x5730fc['body'][_0xca74('0x67')][_0x237f8c]={'filename':_0x5730fc[_0xca74('0x5a')][_0xca74('0x67')][_0x237f8c][_0xca74('0x39')],'path':path[_0xca74('0x68')](config['root'],_0xca74('0x69'),_0x5730fc[_0xca74('0x5a')][_0xca74('0x67')][_0x237f8c]['basename'])};}}return{'account':_0x1e4947,'message':_0x5730fc[_0xca74('0x5a')]};}})[_0xca74('0x22')](function(_0x24b835){if(_0x24b835){return respondWithRpcPromise(_0xca74('0x6a'),_0xca74('0x6b'),_0x24b835,client9003)['then'](function(_0x5dabdc){return _0x256e10[_0xca74('0x36')]({'read':!![],'messageId':_0x5dabdc[_0xca74('0x6c')],'sentAt':moment()[_0xca74('0x6d')](_0xca74('0x6e'))});})[_0xca74('0x57')](function(_0x5f3ae5){logger[_0xca74('0x27')]('%s',JSON[_0xca74('0x26')](_0x5f3ae5));return _0x256e10;});}return _0x256e10;});}return _0x256e10;}})[_0xca74('0x22')](respondWithResult(_0x28b3c1,0xc9))[_0xca74('0x57')](handleError(_0x28b3c1,null));};var interaction_log=require(_0xca74('0x14'))(_0xca74('0x6f'));exports[_0xca74('0x70')]=function(_0x1ca909,_0xc76d43,_0x425093){var _0x2ba657={'channel':_0xca74('0x71')};if(_0x1ca909['body']['id']){delete _0x1ca909['body']['id'];}_0x1ca909['body'][_0xca74('0x72')]=!![];_0x1ca909[_0xca74('0x5a')][_0xca74('0x73')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1ca909[_0xca74('0x5a')][_0xca74('0x74')]=_0x1ca909[_0xca74('0x5a')][_0xca74('0x74')]||_0x1ca909[_0xca74('0x75')]['id'];return db[_0xca74('0x3c')][_0xca74('0x59')]({'where':{'id':_0x1ca909['params']['id'],'UserId':null},'include':[{'model':db[_0xca74('0x76')],'as':_0xca74('0x77')}]})['then'](handleEntityNotFound(_0xc76d43,null))[_0xca74('0x22')](saveUpdates(_0x1ca909[_0xca74('0x5a')],null))['then'](function(_0x46fb06){if(_0x46fb06){_0x2ba657[_0xca74('0x2a')]=_0x46fb06[_0xca74('0x78')]({'plain':!![]});return db[_0xca74('0x79')][_0xca74('0x59')]({'where':{'id':_0x46fb06[_0xca74('0x7a')]}});}return null;})[_0xca74('0x22')](handleEntityNotFound(_0xc76d43,null))[_0xca74('0x22')](function(_0x2cc378){if(_0x2cc378){return _0x2cc378[_0xca74('0x36')]({'UserId':_0x1ca909[_0xca74('0x5a')][_0xca74('0x74')],'read1stAt':_[_0xca74('0x7b')](_0x2cc378[_0xca74('0x7c')])?moment()[_0xca74('0x6d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xca74('0x22')](function(_0x178374){if(_0x178374){_0x2ba657['interaction']=_0x178374[_0xca74('0x78')]({'plain':!![]});interaction_log[_0xca74('0x23')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ca909['user']['id'],_0x1ca909[_0xca74('0x75')]['name'],_0x1ca909[_0xca74('0x75')][_0xca74('0x7d')],_0x2ba657[_0xca74('0x7e')]['id'],_0x1ca909['body']?JSON[_0xca74('0x26')](_0x1ca909[_0xca74('0x5a')]):_0xca74('0x7f'));return respondWithRpcPromise(_0xca74('0x80'),'acceptMessage',_0x2ba657);}return null;})[_0xca74('0x22')](function(_0x4ffc6a){if(_0x4ffc6a){if(_0x1ca909[_0xca74('0x5a')][_0xca74('0x81')]){_0x2ba657[_0xca74('0x2a')][_0xca74('0x82')]=util[_0xca74('0x6d')](_0xca74('0x83'),_0x1ca909[_0xca74('0x75')][_0xca74('0x39')]);_0x2ba657[_0xca74('0x2a')][_0xca74('0x84')]=_0x2ba657['channel'];_0x2ba657['message'][_0xca74('0x85')]=_0xca74('0x70');return respondWithRpcPromise(_0xca74('0x86'),_0xca74('0x86'),{'event':_0xca74('0x87'),'message':_0x2ba657[_0xca74('0x2a')]},client9002)[_0xca74('0x22')](function(){return _0x2ba657;});}return _0x2ba657;}return null;})[_0xca74('0x22')](respondWithResult(_0xc76d43,null))[_0xca74('0x57')](handleError(_0xc76d43,null));};var interaction_log=require(_0xca74('0x14'))(_0xca74('0x6f'));exports[_0xca74('0x34')]=function(_0x1ddbe5,_0x27960a,_0xd5001f){var _0x474fd1={'agent':{},'channel':_0xca74('0x71')};if(_0x1ddbe5[_0xca74('0x5a')]['id']){delete _0x1ddbe5[_0xca74('0x5a')]['id'];}_0x1ddbe5[_0xca74('0x5a')][_0xca74('0x74')]=_0x1ddbe5[_0xca74('0x5a')][_0xca74('0x74')]||_0x1ddbe5[_0xca74('0x75')]['id'];_0x474fd1['agent']['id']=_0x1ddbe5[_0xca74('0x5a')][_0xca74('0x74')];return db[_0xca74('0x3c')][_0xca74('0x59')]({'where':{'id':_0x1ddbe5['params']['id'],'UserId':null}})[_0xca74('0x22')](handleEntityNotFound(_0x27960a,null))['then'](function(_0xa293f5){if(_0xa293f5){_0x474fd1[_0xca74('0x2a')]=_0xa293f5[_0xca74('0x78')]({'plain':!![]});return db[_0xca74('0x79')][_0xca74('0x59')]({'where':{'id':_0xa293f5['MailInteractionId']}});}return null;})[_0xca74('0x22')](handleEntityNotFound(_0x27960a,null))['then'](function(_0x1324a1){if(_0x1324a1){_0x474fd1[_0xca74('0x7e')]=_0x1324a1[_0xca74('0x78')]({'plain':!![]});interaction_log[_0xca74('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ddbe5[_0xca74('0x75')]['id'],_0x1ddbe5[_0xca74('0x75')][_0xca74('0x39')],_0x1ddbe5['user'][_0xca74('0x7d')],_0x474fd1[_0xca74('0x7e')]['id'],_0x1ddbe5[_0xca74('0x5a')]?JSON['stringify'](_0x1ddbe5[_0xca74('0x5a')]):'null');return respondWithRpcPromise(_0xca74('0x88'),_0xca74('0x89'),_0x474fd1);}return null;})[_0xca74('0x22')](function(_0x11b249){if(_0x11b249){_0x11b249[_0xca74('0x2a')]['interface']=util[_0xca74('0x6d')](_0xca74('0x83'),_0x1ddbe5['user'][_0xca74('0x39')]);_0x11b249['message'][_0xca74('0x84')]=_0x474fd1[_0xca74('0x84')];_0x11b249[_0xca74('0x2a')][_0xca74('0x85')]=_0xca74('0x34');respondWithRpcPromise(_0xca74('0x86'),_0xca74('0x86'),{'event':_0xca74('0x8a'),'message':_0x11b249[_0xca74('0x2a')]},client9002);return _0x474fd1;}return null;})[_0xca74('0x22')](respondWithResult(_0x27960a,null))[_0xca74('0x57')](handleError(_0x27960a,null));};exports[_0xca74('0x8b')]=function(_0x3203e9,_0x549e47){var _0x1b8965=moment()[_0xca74('0x8c')]()[_0xca74('0x8d')]();var _0x27861e=path['join'](config[_0xca74('0x8e')],_0xca74('0x8f'),_0xca74('0x90'),_0xca74('0x91'));var _0x22f58e=path[_0xca74('0x68')](config[_0xca74('0x8e')],_0xca74('0x8f'),_0xca74('0x90'),'attachments');var _0x58f670=util[_0xca74('0x6d')](_0xca74('0x92'),_0x1b8965);return db[_0xca74('0x3c')][_0xca74('0x59')]({'where':{'id':_0x3203e9[_0xca74('0x58')]['id']},'attributes':['id','body',_0xca74('0x93'),'to','cc','bcc',_0xca74('0x94'),_0xca74('0x95')],'include':_0x3203e9[_0xca74('0x3f')]['attachments']?[{'model':db[_0xca74('0x96')],'as':_0xca74('0x97')}]:undefined})[_0xca74('0x22')](handleEntityNotFound(_0x549e47,null))[_0xca74('0x22')](function(_0x9450b3){if(_0x9450b3){var _0x276a6c=_0x9450b3;var _0x315908={'from':_0x276a6c[_0xca74('0x93')],'to':_0x276a6c['to'],'subject':_0x276a6c[_0xca74('0x94')],'html':_0x276a6c[_0xca74('0x5a')],'headers':{'Date':moment(_0x276a6c[_0xca74('0x95')])[_0xca74('0x6d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x9450b3['cc']){_0x315908[_0xca74('0x98')]['Cc']=_0x9450b3['cc'];}if(_0x9450b3['bcc']){_0x315908['headers'][_0xca74('0x99')]=_0x9450b3[_0xca74('0x9a')];}return new BPromise(function(_0xc73e0c,_0x45cd6a){if(_0x9450b3[_0xca74('0x97')]){for(var _0x119fb6=0x0;_0x119fb6<_0x9450b3['Attachments'][_0xca74('0x45')];_0x119fb6++){var _0x418b1a=_0x9450b3[_0xca74('0x97')][_0x119fb6];var _0x375468=path['join'](_0x22f58e,_0x418b1a[_0xca74('0x9b')]);if(fs[_0xca74('0x9c')](_0x375468)){_0x315908[_0xca74('0x67')][_0xca74('0x9d')]({'name':_0x418b1a['name'],'contentType':_0x418b1a['type'],'data':fs['readFileSync'](_0x375468)});}}}emlformat[_0xca74('0x9e')](_0x315908,function(_0x24ab67,_0x2cc2bd){if(_0x24ab67)return _0x45cd6a(_0x24ab67);fs['writeFileSync'](path[_0xca74('0x68')](_0x27861e,_0x58f670),_0x2cc2bd);return _0xc73e0c(_0x2cc2bd);});});}})['then'](function(_0x1fa1de){if(_0x1fa1de){return _0x549e47['download'](path[_0xca74('0x68')](_0x27861e,_0x58f670),_0x58f670,function(_0x4bc278){if(_0x4bc278){console[_0xca74('0x9f')](_0xca74('0xa0'),_0x4bc278);}else{fs[_0xca74('0xa1')](path[_0xca74('0x68')](_0x27861e,_0x58f670));}});}})['catch'](handleError(_0x549e47,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index cf6678b..9a1a253 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 _0xc96c=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x11cc5b,_0x110244){var _0x46e399=function(_0x4ccea8){while(--_0x4ccea8){_0x11cc5b['push'](_0x11cc5b['shift']());}};_0x46e399(++_0x110244);}(_0xc96c,0x1db));var _0xcc96=function(_0x592af0,_0x6c7240){_0x592af0=_0x592af0-0x0;var _0x24ead5=_0xc96c[_0x592af0];return _0x24ead5;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xcc96('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcc96('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc96('0x2'),'afterDestroy':_0xcc96('0x3')};function emitEvent(_0x721444){return function(_0x35e628,_0x4bfc90,_0xbafba5){MailMessageEvents['emit'](_0x721444+':'+_0x35e628['id'],_0x35e628);MailMessageEvents[_0xcc96('0x4')](_0x721444,_0x35e628);_0xbafba5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xcc96('0x5')](e,emitEvent(event));}}module[_0xcc96('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xfb6d=['MailMessage','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb6d,0xf7));var _0xdfb6=function(_0x16b9e2,_0x522d08){_0x16b9e2=_0x16b9e2-0x0;var _0x53791a=_0xfb6d[_0x16b9e2];return _0x53791a;};'use strict';var EventEmitter=require(_0xdfb6('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xdfb6('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdfb6('0x2'),'afterUpdate':_0xdfb6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48cbb6){return function(_0x5bffbf,_0x594533,_0x3c4c8b){MailMessageEvents[_0xdfb6('0x4')](_0x48cbb6+':'+_0x5bffbf['id'],_0x5bffbf);MailMessageEvents[_0xdfb6('0x4')](_0x48cbb6,_0x5bffbf);_0x3c4c8b(null);};}for(var e in events){if(events[_0xdfb6('0x5')](e)){var event=events[e];MailMessage[_0xdfb6('0x6')](e,emitEvent(event));}}module[_0xdfb6('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a2bb3e7..25a8eb9 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 _0xf389=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','subject','body','fromString','models','direction','toLowerCase','out','MailInteraction','then','createdAt','catch'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0xf389,0x1a7));var _0x9f38=function(_0xddb7c,_0x338320){_0xddb7c=_0xddb7c-0x0;var _0x41f5bc=_0xf389[_0xddb7c];return _0x41f5bc;};'use strict';var _=require('lodash');var util=require(_0x9f38('0x0'));var logger=require(_0x9f38('0x1'))(_0x9f38('0x2'));var moment=require(_0x9f38('0x3'));var BPromise=require(_0x9f38('0x4'));var rp=require(_0x9f38('0x5'));var htmlToText=require(_0x9f38('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f38('0x7'));var config=require('../../config/environment');var attributes=require(_0x9f38('0x8'));module[_0x9f38('0x9')]=function(_0x531637,_0x18f4ca){return _0x531637[_0x9f38('0xa')](_0x9f38('0xb'),attributes,{'tableName':_0x9f38('0xc'),'paranoid':![],'indexes':[{'name':_0x9f38('0xd'),'fields':[_0x9f38('0xd')]},{'name':'fti_mail_messages','fields':['plainBody',_0x9f38('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c2777,_0x5d31e7,_0x37f412){if(_0x1c2777[_0x9f38('0xf')]){_0x1c2777['plainBody']=htmlToText[_0x9f38('0x10')](_0x1c2777['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x37f412(null,_0x5d31e7);},'afterCreate':function(_0x3d7466,_0x3b3763,_0x576b3a){var _0x27f314=_0x531637[_0x9f38('0x11')];var _0x5057e8=_0x3d7466['get']({'plain':!![]});if(_0x5057e8[_0x9f38('0x12')][_0x9f38('0x13')]()==='in'||_0x5057e8[_0x9f38('0x12')][_0x9f38('0x13')]()===_0x9f38('0x14')&&!_0x5057e8['secret']&&!_['isNil'](_0x5057e8['UserId'])){_0x27f314[_0x9f38('0x15')]['findOne']({'where':{'id':_0x5057e8['MailInteractionId']}})[_0x9f38('0x16')](function(_0x5413ac){if(_0x5413ac){_0x5413ac['update']({'lastMsgAt':_0x5057e8[_0x9f38('0x17')],'lastMsgDirection':_0x5057e8[_0x9f38('0x12')][_0x9f38('0x13')](),'lastMsgBody':_0x5057e8[_0x9f38('0xf')]});}})[_0x9f38('0x18')](function(_0x28ec8f){console[_0x9f38('0x19')](_0x28ec8f);});}_0x576b3a();}},'charset':_0x9f38('0x1a'),'collate':_0x9f38('0x1b')});}; \ No newline at end of file +var _0xeac5=['api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','fromString','body','direction','toLowerCase','secret','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x157027,_0x33425a){var _0x360b01=function(_0x30d794){while(--_0x30d794){_0x157027['push'](_0x157027['shift']());}};_0x360b01(++_0x33425a);}(_0xeac5,0x15d));var _0x5eac=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xeac5[_0x470bfb];return _0x2f5d97;};'use strict';var _=require(_0x5eac('0x0'));var util=require(_0x5eac('0x1'));var logger=require(_0x5eac('0x2'))(_0x5eac('0x3'));var moment=require(_0x5eac('0x4'));var BPromise=require(_0x5eac('0x5'));var rp=require(_0x5eac('0x6'));var htmlToText=require(_0x5eac('0x7'));var fs=require('fs');var path=require(_0x5eac('0x8'));var rimraf=require(_0x5eac('0x9'));var config=require('../../config/environment');var attributes=require(_0x5eac('0xa'));module[_0x5eac('0xb')]=function(_0x6d45d1,_0x59c123){return _0x6d45d1['define'](_0x5eac('0xc'),attributes,{'tableName':_0x5eac('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x5eac('0xe'),'fields':[_0x5eac('0xf'),_0x5eac('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ed0d8,_0x416569,_0x117194){if(_0x2ed0d8['body']){_0x2ed0d8[_0x5eac('0xf')]=htmlToText[_0x5eac('0x11')](_0x2ed0d8[_0x5eac('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x117194(null,_0x416569);},'afterCreate':function(_0x1472ae,_0x542ba9,_0x19cfb8){var _0x359b77=_0x6d45d1['models'];var _0x340df7=_0x1472ae['get']({'plain':!![]});if(_0x340df7[_0x5eac('0x13')][_0x5eac('0x14')]()==='in'||_0x340df7[_0x5eac('0x13')][_0x5eac('0x14')]()==='out'&&!_0x340df7[_0x5eac('0x15')]&&!_[_0x5eac('0x16')](_0x340df7['UserId'])){_0x359b77[_0x5eac('0x17')]['findOne']({'where':{'id':_0x340df7[_0x5eac('0x18')]}})[_0x5eac('0x19')](function(_0x1fcbf2){if(_0x1fcbf2){_0x1fcbf2[_0x5eac('0x1a')]({'lastMsgAt':_0x340df7[_0x5eac('0x1b')],'lastMsgDirection':_0x340df7['direction'][_0x5eac('0x14')](),'lastMsgBody':_0x340df7[_0x5eac('0x12')]});}})[_0x5eac('0x1c')](function(_0xf5f4aa){console[_0x5eac('0x1d')](_0xf5f4aa);});}_0x19cfb8();}},'charset':_0x5eac('0x1e'),'collate':_0x5eac('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 4d82e94..76447ab 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 _0x8a28=['message','result','catch','MailMessage','create','body','options','CreateMailMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x37d86b,_0x4a4334){var _0x14847d=function(_0x591420){while(--_0x591420){_0x37d86b['push'](_0x37d86b['shift']());}};_0x14847d(++_0x4a4334);}(_0x8a28,0xfd));var _0x88a2=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x8a28[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});config['redis']=_[_0x88a2('0xd')](config['redis'],{'host':_0x88a2('0xe'),'port':0x18eb});var socket=require(_0x88a2('0xf'))(new Redis(config[_0x88a2('0x10')]));require(_0x88a2('0x11'))[_0x88a2('0x12')](socket);function respondWithRpcPromise(_0x2d0fce,_0x183ca3,_0x306a59){return new BPromise(function(_0x4eec50,_0x4f02ff){return client['request'](_0x2d0fce,_0x306a59)[_0x88a2('0x13')](function(_0x430931){logger[_0x88a2('0x14')](_0x88a2('0x15'),_0x183ca3,_0x88a2('0x16'));logger['debug'](_0x88a2('0x17'),_0x183ca3,_0x88a2('0x16'),JSON[_0x88a2('0x18')](_0x430931));if(_0x430931[_0x88a2('0x19')]){if(_0x430931['error'][_0x88a2('0x1a')]===0x1f4){logger[_0x88a2('0x19')](_0x88a2('0x15'),_0x183ca3,_0x430931['error'][_0x88a2('0x1b')]);return _0x4f02ff(_0x430931[_0x88a2('0x19')][_0x88a2('0x1b')]);}logger[_0x88a2('0x19')](_0x88a2('0x15'),_0x183ca3,_0x430931[_0x88a2('0x19')][_0x88a2('0x1b')]);return _0x4eec50(_0x430931[_0x88a2('0x19')][_0x88a2('0x1b')]);}else{logger[_0x88a2('0x14')](_0x88a2('0x15'),_0x183ca3,_0x88a2('0x16'));_0x4eec50(_0x430931[_0x88a2('0x1c')][_0x88a2('0x1b')]);}})[_0x88a2('0x1d')](function(_0x162b5f){logger[_0x88a2('0x19')](_0x88a2('0x15'),_0x183ca3,_0x162b5f);_0x4f02ff(_0x162b5f);});});}exports['CreateMailMessage']=function(_0x190aac){var _0x282a27=this;return new Promise(function(_0x4cd11e,_0x499891){return db[_0x88a2('0x1e')][_0x88a2('0x1f')](_0x190aac[_0x88a2('0x20')],{'raw':_0x190aac[_0x88a2('0x21')]?_0x190aac[_0x88a2('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x88a2('0x13')](function(_0xda54c4){logger[_0x88a2('0x14')](_0x88a2('0x22'),_0x190aac);logger['debug'](_0x88a2('0x22'),_0x190aac,JSON['stringify'](_0xda54c4));_0x4cd11e(_0xda54c4);})['catch'](function(_0x26a3a6){logger[_0x88a2('0x19')]('CreateMailMessage',_0x26a3a6['message'],_0x190aac);_0x499891(_0x282a27[_0x88a2('0x19')](0x1f4,_0x26a3a6[_0x88a2('0x1b')]));});});}; \ No newline at end of file +var _0x0763=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0x0763,0x87));var _0x3076=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x0763[_0xf72786];return _0x113f3e;};'use strict';var _=require(_0x3076('0x0'));var util=require('util');var moment=require(_0x3076('0x1'));var BPromise=require(_0x3076('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3076('0x3'));var db=require(_0x3076('0x4'))['db'];var utils=require(_0x3076('0x5'));var logger=require(_0x3076('0x6'))('rpc');var config=require(_0x3076('0x7'));var jayson=require(_0x3076('0x8'));var client=jayson[_0x3076('0x9')][_0x3076('0xa')]({'port':0x232a});config[_0x3076('0xb')]=_[_0x3076('0xc')](config[_0x3076('0xb')],{'host':_0x3076('0xd'),'port':0x18eb});var socket=require(_0x3076('0xe'))(new Redis(config[_0x3076('0xb')]));require('./mailMessage.socket')[_0x3076('0xf')](socket);function respondWithRpcPromise(_0x3e5561,_0x21aab6,_0x4884cc){return new BPromise(function(_0x5e4a5e,_0x366eb6){return client[_0x3076('0x10')](_0x3e5561,_0x4884cc)[_0x3076('0x11')](function(_0xefdbf1){logger[_0x3076('0x12')]('MailMessage,\x20%s,\x20%s',_0x21aab6,_0x3076('0x13'));logger[_0x3076('0x14')](_0x3076('0x15'),_0x21aab6,_0x3076('0x13'),JSON[_0x3076('0x16')](_0xefdbf1));if(_0xefdbf1[_0x3076('0x17')]){if(_0xefdbf1[_0x3076('0x17')][_0x3076('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x21aab6,_0xefdbf1[_0x3076('0x17')][_0x3076('0x19')]);return _0x366eb6(_0xefdbf1[_0x3076('0x17')][_0x3076('0x19')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x21aab6,_0xefdbf1[_0x3076('0x17')][_0x3076('0x19')]);return _0x5e4a5e(_0xefdbf1[_0x3076('0x17')][_0x3076('0x19')]);}else{logger[_0x3076('0x12')](_0x3076('0x1a'),_0x21aab6,_0x3076('0x13'));_0x5e4a5e(_0xefdbf1[_0x3076('0x1b')][_0x3076('0x19')]);}})[_0x3076('0x1c')](function(_0x15cf30){logger[_0x3076('0x17')]('MailMessage,\x20%s,\x20%s',_0x21aab6,_0x15cf30);_0x366eb6(_0x15cf30);});});}exports[_0x3076('0x1d')]=function(_0x17d4dd){var _0x5a4eaf=this;return new Promise(function(_0xf5b8f7,_0x50f366){return db[_0x3076('0x1e')][_0x3076('0x1f')](_0x17d4dd[_0x3076('0x20')],{'raw':_0x17d4dd['options']?_0x17d4dd[_0x3076('0x21')][_0x3076('0x22')]===undefined?!![]:![]:!![]})[_0x3076('0x11')](function(_0x9b4bec){logger[_0x3076('0x12')](_0x3076('0x1d'),_0x17d4dd);logger[_0x3076('0x14')](_0x3076('0x1d'),_0x17d4dd,JSON[_0x3076('0x16')](_0x9b4bec));_0xf5b8f7(_0x9b4bec);})[_0x3076('0x1c')](function(_0x5b2e03){logger[_0x3076('0x17')]('CreateMailMessage',_0x5b2e03[_0x3076('0x19')],_0x17d4dd);_0x50f366(_0x5a4eaf['error'](0x1f4,_0x5b2e03['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index adb1020..8086d99 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 _0xbc74=['mailMessage:','./mailMessage.events','save','remove','emit','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc74,0x1c3));var _0x4bc7=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbc74[_0x35da42];return _0x370035;};'use strict';var MailMessageEvents=require(_0x4bc7('0x0'));var events=[_0x4bc7('0x1'),_0x4bc7('0x2'),'update'];function createListener(_0x370c04,_0x3b7ba0){return function(_0xcadf47){_0x3b7ba0[_0x4bc7('0x3')](_0x370c04,_0xcadf47);};}function removeListener(_0x55820b,_0x469db9){return function(){MailMessageEvents['removeListener'](_0x55820b,_0x469db9);};}exports['register']=function(_0x2f4caf){for(var _0x6a2392=0x0,_0x2db5b3=events[_0x4bc7('0x4')];_0x6a2392<_0x2db5b3;_0x6a2392++){var _0x10d3cc=events[_0x6a2392];var _0x148e37=createListener(_0x4bc7('0x5')+_0x10d3cc,_0x2f4caf);MailMessageEvents['on'](_0x10d3cc,_0x148e37);}}; \ No newline at end of file +var _0x181c=['./mailMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x20006a,_0x30e3a9){var _0x5e26ac=function(_0x16ca0a){while(--_0x16ca0a){_0x20006a['push'](_0x20006a['shift']());}};_0x5e26ac(++_0x30e3a9);}(_0x181c,0x1c0));var _0xc181=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x181c[_0xc14df7];return _0x34a445;};'use strict';var MailMessageEvents=require(_0xc181('0x0'));var events=[_0xc181('0x1'),_0xc181('0x2'),_0xc181('0x3')];function createListener(_0x16430c,_0x473e27){return function(_0x2c02ba){_0x473e27[_0xc181('0x4')](_0x16430c,_0x2c02ba);};}function removeListener(_0x2b7538,_0x2003d4){return function(){MailMessageEvents[_0xc181('0x5')](_0x2b7538,_0x2003d4);};}exports[_0xc181('0x6')]=function(_0x2dcfee){for(var _0x3dbb5a=0x0,_0x17224b=events[_0xc181('0x7')];_0x3dbb5a<_0x17224b;_0x3dbb5a++){var _0x25f52b=events[_0x3dbb5a];var _0xc2782b=createListener('mailMessage:'+_0x25f52b,_0x2dcfee);MailMessageEvents['on'](_0x25f52b,_0xc2782b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 093e73f..6636288 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 _0xd44b=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','util'];(function(_0x3c357e,_0x4c3edf){var _0x5cec9c=function(_0x428f21){while(--_0x428f21){_0x3c357e['push'](_0x3c357e['shift']());}};_0x5cec9c(++_0x4c3edf);}(_0xd44b,0x16b));var _0xbd44=function(_0xe21718,_0x57d3bd){_0xe21718=_0xe21718-0x0;var _0x2abac7=_0xd44b[_0xe21718];return _0x2abac7;};'use strict';var multer=require('multer');var util=require(_0xbd44('0x0'));var path=require('path');var timeout=require(_0xbd44('0x1'));var express=require(_0xbd44('0x2'));var router=express[_0xbd44('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd44('0x4'));var config=require(_0xbd44('0x5'));var controller=require('./mailQueue.controller');router[_0xbd44('0x6')]('/',auth[_0xbd44('0x7')](),controller[_0xbd44('0x8')]);router[_0xbd44('0x6')]('/describe',auth[_0xbd44('0x7')](),controller['describe']);router[_0xbd44('0x6')](_0xbd44('0x9'),auth['isAuthenticated'](),controller[_0xbd44('0xa')]);router[_0xbd44('0x6')](_0xbd44('0xb'),auth[_0xbd44('0x7')](),controller[_0xbd44('0xc')]);router[_0xbd44('0x6')]('/:id/teams',auth[_0xbd44('0x7')](),controller[_0xbd44('0xd')]);router[_0xbd44('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbd44('0xe')]);router[_0xbd44('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd44('0x10')]);router[_0xbd44('0xf')]('/:id/teams',auth[_0xbd44('0x7')](),controller[_0xbd44('0x11')]);router[_0xbd44('0xf')](_0xbd44('0x12'),auth[_0xbd44('0x7')](),controller['addAgents']);router[_0xbd44('0x13')]('/:id',auth[_0xbd44('0x7')](),controller[_0xbd44('0x14')]);router['delete']('/:id',auth[_0xbd44('0x7')](),controller[_0xbd44('0x15')]);router[_0xbd44('0x16')](_0xbd44('0x17'),auth[_0xbd44('0x7')](),controller[_0xbd44('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xbd44('0x19')]);module['exports']=router; \ No newline at end of file +var _0x1c6a=['/:id/users','post','create','addTeams','/:id','update','destroy','removeTeams','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x17187b,_0x4a0353){var _0x388782=function(_0x2fd2e6){while(--_0x2fd2e6){_0x17187b['push'](_0x17187b['shift']());}};_0x388782(++_0x4a0353);}(_0x1c6a,0x1bb));var _0xa1c6=function(_0xc37c8,_0x182df1){_0xc37c8=_0xc37c8-0x0;var _0x77188f=_0x1c6a[_0xc37c8];return _0x77188f;};'use strict';var multer=require('multer');var util=require(_0xa1c6('0x0'));var path=require(_0xa1c6('0x1'));var timeout=require(_0xa1c6('0x2'));var express=require(_0xa1c6('0x3'));var router=express[_0xa1c6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa1c6('0x5'));var config=require('../../config/environment');var controller=require(_0xa1c6('0x6'));router[_0xa1c6('0x7')]('/',auth['isAuthenticated'](),controller[_0xa1c6('0x8')]);router['get'](_0xa1c6('0x9'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0xb')]);router[_0xa1c6('0x7')]('/:id',auth[_0xa1c6('0xa')](),controller['show']);router[_0xa1c6('0x7')](_0xa1c6('0xc'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0xd')]);router[_0xa1c6('0x7')](_0xa1c6('0xe'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0xf')]);router[_0xa1c6('0x7')](_0xa1c6('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa1c6('0x11')]('/',auth[_0xa1c6('0xa')](),controller[_0xa1c6('0x12')]);router[_0xa1c6('0x11')](_0xa1c6('0xe'),auth['isAuthenticated'](),controller[_0xa1c6('0x13')]);router['post'](_0xa1c6('0x10'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xa1c6('0x14'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0x15')]);router['delete'](_0xa1c6('0x14'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0x16')]);router['delete'](_0xa1c6('0xe'),auth[_0xa1c6('0xa')](),controller[_0xa1c6('0x17')]);router[_0xa1c6('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xa1c6('0x19')]);module[_0xa1c6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 5ff312b..19d9128 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 _0xc7a8=['roundrobin','sequelize','exports','STRING','name','rrmemory','beepall'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xc7a8,0x17b));var _0x8c7a=function(_0x5ebc95,_0x23bb1f){_0x5ebc95=_0x5ebc95-0x0;var _0x1037e2=_0xc7a8[_0x5ebc95];return _0x1037e2;};'use strict';var Sequelize=require(_0x8c7a('0x0'));module[_0x8c7a('0x1')]={'name':{'type':Sequelize[_0x8c7a('0x2')],'unique':_0x8c7a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8c7a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8c7a('0x4'),_0x8c7a('0x5'),_0x8c7a('0x6'))}}; \ No newline at end of file +var _0x8add=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x37fc89,_0x5c425b){var _0x59c64f=function(_0x26af50){while(--_0x26af50){_0x37fc89['push'](_0x37fc89['shift']());}};_0x59c64f(++_0x5c425b);}(_0x8add,0x13a));var _0xd8ad=function(_0x2905d3,_0x550922){_0x2905d3=_0x2905d3-0x0;var _0xe1c4a3=_0x8add[_0x2905d3];return _0xe1c4a3;};'use strict';var Sequelize=require(_0xd8ad('0x0'));module[_0xd8ad('0x1')]={'name':{'type':Sequelize[_0xd8ad('0x2')],'unique':_0xd8ad('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd8ad('0x2')]},'timeout':{'type':Sequelize[_0xd8ad('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd8ad('0x5')](_0xd8ad('0x6'),_0xd8ad('0x7'),_0xd8ad('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 522044d..71728e2 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 _0xd90c=['removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','get','MailQueues','destroy','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','MailQueue','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','order','MailQueueId','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','value'];(function(_0x449b81,_0x4b2a6f){var _0xb9b60c=function(_0x2e9e0a){while(--_0x2e9e0a){_0x449b81['push'](_0x449b81['shift']());}};_0xb9b60c(++_0x4b2a6f);}(_0xd90c,0x12b));var _0xcd90=function(_0x5e45c3,_0x907997){_0x5e45c3=_0x5e45c3-0x0;var _0x5492ac=_0xd90c[_0x5e45c3];return _0x5492ac;};'use strict';var pdf=require(_0xcd90('0x0'));var emlformat=require(_0xcd90('0x1'));var rimraf=require(_0xcd90('0x2'));var zipdir=require(_0xcd90('0x3'));var jsonpatch=require(_0xcd90('0x4'));var rp=require(_0xcd90('0x5'));var moment=require(_0xcd90('0x6'));var BPromise=require(_0xcd90('0x7'));var Mustache=require(_0xcd90('0x8'));var util=require(_0xcd90('0x9'));var path=require('path');var sox=require(_0xcd90('0xa'));var csv=require(_0xcd90('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd90('0xc'));var squel=require(_0xcd90('0xd'));var crypto=require('crypto');var jsforce=require(_0xcd90('0xe'));var deskjs=require(_0xcd90('0xf'));var toCsv=require(_0xcd90('0xb'));var querystring=require(_0xcd90('0x10'));var Papa=require(_0xcd90('0x11'));var Redis=require(_0xcd90('0x12'));var authService=require(_0xcd90('0x13'));var qs=require(_0xcd90('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd90('0x15'))(_0xcd90('0x16'));var utils=require(_0xcd90('0x17'));var config=require(_0xcd90('0x18'));var db=require('../../mysqldb')['db'];config[_0xcd90('0x19')]=_[_0xcd90('0x1a')](config[_0xcd90('0x19')],{'host':_0xcd90('0x1b'),'port':0x18eb});var socket=require(_0xcd90('0x1c'))(new Redis(config[_0xcd90('0x19')]));require('./mailQueue.socket')[_0xcd90('0x1d')](socket);function respondWithStatusCode(_0x53ba4f,_0x349cb1){_0x349cb1=_0x349cb1||0xcc;return function(_0x25b3fd){if(_0x25b3fd){return _0x53ba4f[_0xcd90('0x1e')](_0x349cb1);}return _0x53ba4f[_0xcd90('0x1f')](_0x349cb1)[_0xcd90('0x20')]();};}function respondWithResult(_0x3637bc,_0x54cf7f){_0x54cf7f=_0x54cf7f||0xc8;return function(_0x1dc1a0){if(_0x1dc1a0){return _0x3637bc[_0xcd90('0x1f')](_0x54cf7f)[_0xcd90('0x21')](_0x1dc1a0);}};}function respondWithFilteredResult(_0x5dc679,_0x4202e4){return function(_0x2c0be0){if(_0x2c0be0){var _0x375061=_0x2c0be0['count'],_0x4dc75f=_0x4202e4['offset'],_0x1a7e81=_0x4202e4[_0xcd90('0x22')]+_0x4202e4[_0xcd90('0x23')],_0x48e884;if(_0x1a7e81>=_0x375061){_0x1a7e81=_0x375061;_0x48e884=0xc8;}else{_0x48e884=0xce;}_0x5dc679[_0xcd90('0x1f')](_0x48e884);return _0x5dc679[_0xcd90('0x24')](_0xcd90('0x25'),_0x4dc75f+'-'+_0x1a7e81+'/'+_0x375061)[_0xcd90('0x21')](_0x2c0be0);}return null;};}function patchUpdates(_0x2e3fa3){return function(_0x1a2cc5){try{jsonpatch['apply'](_0x1a2cc5,_0x2e3fa3,!![]);}catch(_0x1a3cf1){return BPromise[_0xcd90('0x26')](_0x1a3cf1);}return _0x1a2cc5[_0xcd90('0x27')]();};}function saveUpdates(_0x3b6c0d,_0x3084fe){return function(_0x22373b){if(_0x22373b){return _0x22373b[_0xcd90('0x28')](_0x3b6c0d)[_0xcd90('0x29')](function(_0x1fc449){return _0x1fc449;});}return null;};}function removeEntity(_0x1c31d6,_0x1cc935){return function(_0x46cdaf){if(_0x46cdaf){return _0x46cdaf['destroy']()['then'](function(){var _0x5249d0=_0x46cdaf[_0xcd90('0x2a')]({'plain':!![]});var _0x2919ce=_0xcd90('0x2b');return db['UserProfileResource'][_0xcd90('0x2c')]({'where':{'type':_0x2919ce,'resourceId':_0x5249d0['id']}})['then'](function(){return _0x46cdaf;});})[_0xcd90('0x29')](function(){_0x1c31d6[_0xcd90('0x1f')](0xcc)[_0xcd90('0x20')]();});}};}function handleEntityNotFound(_0x491039,_0x2fa37a){return function(_0x3d10e1){if(!_0x3d10e1){_0x491039[_0xcd90('0x1e')](0x194);}return _0x3d10e1;};}function handleError(_0x3860b2,_0x3cd367){_0x3cd367=_0x3cd367||0x1f4;return function(_0x20acea){logger['error'](_0x20acea[_0xcd90('0x2d')]);if(_0x20acea['name']){delete _0x20acea[_0xcd90('0x2e')];}_0x3860b2[_0xcd90('0x1f')](_0x3cd367)['send'](_0x20acea);};}exports[_0xcd90('0x2f')]=function(_0x38494b,_0x597317){var _0x376f6a={},_0x30787e={},_0x3f77b9={'count':0x0,'rows':[]};var _0x3c26b8=db['MailQueue'][_0xcd90('0x30')];_0x30787e[_0xcd90('0x31')]=_[_0xcd90('0x32')](_0x3c26b8);_0x30787e[_0xcd90('0x33')]=_[_0xcd90('0x32')](_0x38494b[_0xcd90('0x33')]);_0x30787e[_0xcd90('0x34')]=_[_0xcd90('0x35')](_0x30787e['model'],_0x30787e[_0xcd90('0x33')]);_0x376f6a[_0xcd90('0x36')]=_[_0xcd90('0x35')](_0x30787e['model'],qs['fields'](_0x38494b[_0xcd90('0x33')][_0xcd90('0x37')]));_0x376f6a[_0xcd90('0x36')]=_0x376f6a[_0xcd90('0x36')][_0xcd90('0x38')]?_0x376f6a[_0xcd90('0x36')]:_0x30787e['model'];if(!_0x38494b[_0xcd90('0x33')][_0xcd90('0x39')](_0xcd90('0x3a'))){_0x376f6a[_0xcd90('0x23')]=qs[_0xcd90('0x23')](_0x38494b[_0xcd90('0x33')][_0xcd90('0x23')]);_0x376f6a['offset']=qs[_0xcd90('0x22')](_0x38494b[_0xcd90('0x33')]['offset']);}_0x376f6a['order']=qs[_0xcd90('0x3b')](_0x38494b[_0xcd90('0x33')][_0xcd90('0x3b')]);_0x376f6a[_0xcd90('0x3c')]=qs[_0xcd90('0x34')](_[_0xcd90('0x3d')](_0x38494b[_0xcd90('0x33')],_0x30787e[_0xcd90('0x34')]));if(_0x38494b['query'][_0xcd90('0x3e')]){_0x376f6a[_0xcd90('0x3c')]=_[_0xcd90('0x3f')](_0x376f6a[_0xcd90('0x3c')],{'$or':_[_0xcd90('0x40')](_0x3c26b8,function(_0xe00803){if(_0xe00803[_0xcd90('0x41')][_0xcd90('0x42')]!==_0xcd90('0x43')){var _0x4b1f9f={};_0x4b1f9f[_0xe00803[_0xcd90('0x44')]]={'$like':'%'+_0x38494b[_0xcd90('0x33')][_0xcd90('0x3e')]+'%'};return _0x4b1f9f;}})});}_0x376f6a=_[_0xcd90('0x3f')]({},_0x376f6a,_0x38494b['options']);var _0x1e7368={'where':_0x376f6a['where']};return db[_0xcd90('0x45')][_0xcd90('0x46')](_0x1e7368)[_0xcd90('0x29')](function(_0x472c56){_0x3f77b9[_0xcd90('0x46')]=_0x472c56;if(_0x38494b[_0xcd90('0x33')][_0xcd90('0x47')]){_0x376f6a[_0xcd90('0x48')]=[{'all':!![]}];}return db[_0xcd90('0x45')][_0xcd90('0x49')](_0x376f6a);})[_0xcd90('0x29')](function(_0x5ea736){_0x3f77b9[_0xcd90('0x4a')]=_0x5ea736;return _0x3f77b9;})[_0xcd90('0x29')](respondWithFilteredResult(_0x597317,_0x376f6a))[_0xcd90('0x4b')](handleError(_0x597317,null));};exports[_0xcd90('0x4c')]=function(_0x1ff40e,_0x10f9df){var _0x37751d={'raw':!![],'where':{'id':_0x1ff40e[_0xcd90('0x4d')]['id']}},_0x4d1378={};_0x4d1378[_0xcd90('0x31')]=_[_0xcd90('0x32')](db[_0xcd90('0x45')]['rawAttributes']);_0x4d1378[_0xcd90('0x33')]=_['keys'](_0x1ff40e[_0xcd90('0x33')]);_0x4d1378[_0xcd90('0x34')]=_[_0xcd90('0x35')](_0x4d1378[_0xcd90('0x31')],_0x4d1378[_0xcd90('0x33')]);_0x37751d[_0xcd90('0x36')]=_[_0xcd90('0x35')](_0x4d1378[_0xcd90('0x31')],qs[_0xcd90('0x37')](_0x1ff40e['query'][_0xcd90('0x37')]));_0x37751d[_0xcd90('0x36')]=_0x37751d[_0xcd90('0x36')]['length']?_0x37751d['attributes']:_0x4d1378[_0xcd90('0x31')];if(_0x1ff40e['query']['includeAll']){_0x37751d[_0xcd90('0x48')]=[{'all':!![]}];}_0x37751d=_[_0xcd90('0x3f')]({},_0x37751d,_0x1ff40e[_0xcd90('0x4e')]);return db['MailQueue'][_0xcd90('0x4f')](_0x37751d)[_0xcd90('0x29')](handleEntityNotFound(_0x10f9df,null))['then'](respondWithResult(_0x10f9df,null))[_0xcd90('0x4b')](handleError(_0x10f9df,null));};exports[_0xcd90('0x50')]=function(_0x4aefd5,_0x56b116){return db[_0xcd90('0x45')][_0xcd90('0x50')](_0x4aefd5[_0xcd90('0x51')],{})[_0xcd90('0x29')](function(_0x4efac7){var _0x3581fe=_0x4aefd5[_0xcd90('0x52')]['get']({'plain':!![]});if(!_0x3581fe)throw new Error(_0xcd90('0x53'));if(_0x3581fe[_0xcd90('0x54')]===_0xcd90('0x52')){var _0x1cfcea=_0x4efac7[_0xcd90('0x2a')]({'plain':!![]});var _0x44e5bc=_0xcd90('0x2b');return db[_0xcd90('0x55')][_0xcd90('0x4f')]({'where':{'name':_0x44e5bc,'userProfileId':_0x3581fe[_0xcd90('0x56')]},'raw':!![]})['then'](function(_0x4dbb15){if(_0x4dbb15&&_0x4dbb15[_0xcd90('0x57')]===0x0){return db[_0xcd90('0x58')]['create']({'name':_0x1cfcea[_0xcd90('0x2e')],'resourceId':_0x1cfcea['id'],'type':_0x4dbb15[_0xcd90('0x2e')],'sectionId':_0x4dbb15['id']},{})[_0xcd90('0x29')](function(){return _0x4efac7;});}else{return _0x4efac7;}})['catch'](function(_0x1ac1f8){logger[_0xcd90('0x59')](_0xcd90('0x5a'),_0x1ac1f8);throw _0x1ac1f8;});}return _0x4efac7;})[_0xcd90('0x29')](respondWithResult(_0x56b116,0xc9))['catch'](handleError(_0x56b116,null));};exports['update']=function(_0x2f70d8,_0x3c2e67){if(_0x2f70d8[_0xcd90('0x51')]['id']){delete _0x2f70d8[_0xcd90('0x51')]['id'];}return db['MailQueue'][_0xcd90('0x4f')]({'where':{'id':_0x2f70d8[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x3c2e67,null))[_0xcd90('0x29')](saveUpdates(_0x2f70d8['body'],null))[_0xcd90('0x29')](respondWithResult(_0x3c2e67,null))[_0xcd90('0x4b')](handleError(_0x3c2e67,null));};exports['destroy']=function(_0x72eabb,_0x24c0af){return db[_0xcd90('0x45')][_0xcd90('0x4f')]({'where':{'id':_0x72eabb[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x24c0af,null))[_0xcd90('0x29')](removeEntity(_0x24c0af,null))[_0xcd90('0x4b')](handleError(_0x24c0af,null));};exports[_0xcd90('0x5b')]=function(_0x4dd67e,_0x24bbaa){return db[_0xcd90('0x45')][_0xcd90('0x5b')]()['then'](respondWithResult(_0x24bbaa,null))[_0xcd90('0x4b')](handleError(_0x24bbaa,null));};exports['getMembers']=function(_0x5d2049,_0x503ed7,_0x44a280){var _0x2dcc40={'raw':!![],'where':{}},_0x577c22={},_0x5d45f9;return db['MailQueue'][_0xcd90('0x5c')]({'where':{'id':_0x5d2049[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x503ed7,null))[_0xcd90('0x29')](function(_0x2171c3){if(_0x2171c3){_0x5d45f9=_0x2171c3[_0xcd90('0x2a')]({'plain':!![]});_0x577c22['model']=_[_0xcd90('0x32')](db[_0xcd90('0x5d')]['rawAttributes']);_0x577c22[_0xcd90('0x33')]=_[_0xcd90('0x32')](_0x5d2049['query']);_0x577c22[_0xcd90('0x34')]=_['intersection'](_0x577c22[_0xcd90('0x31')],_0x577c22['query']);_0x2dcc40['attributes']=_[_0xcd90('0x35')](_0x577c22[_0xcd90('0x31')],qs[_0xcd90('0x37')](_0x5d2049['query']['fields']));_0x2dcc40[_0xcd90('0x36')]=_0x2dcc40[_0xcd90('0x36')]['length']?_0x2dcc40[_0xcd90('0x36')]:_0x577c22[_0xcd90('0x31')];if(!_0x5d2049['query'][_0xcd90('0x39')](_0xcd90('0x3a'))){_0x2dcc40[_0xcd90('0x23')]=qs['limit'](_0x5d2049[_0xcd90('0x33')][_0xcd90('0x23')]);_0x2dcc40[_0xcd90('0x22')]=qs[_0xcd90('0x22')](_0x5d2049[_0xcd90('0x33')][_0xcd90('0x22')]);}_0x2dcc40[_0xcd90('0x5e')]=qs[_0xcd90('0x3b')](_0x5d2049[_0xcd90('0x33')][_0xcd90('0x3b')]);_0x2dcc40[_0xcd90('0x3c')]=qs[_0xcd90('0x34')](_[_0xcd90('0x3d')](_0x5d2049[_0xcd90('0x33')],_0x577c22[_0xcd90('0x34')]));_0x2dcc40[_0xcd90('0x3c')][_0xcd90('0x5f')]=_0x2171c3['id'];if(_0x5d2049[_0xcd90('0x33')][_0xcd90('0x3e')]){_0x2dcc40['where']=_[_0xcd90('0x3f')](_0x2dcc40[_0xcd90('0x3c')],{'$or':_[_0xcd90('0x40')](_0x2dcc40['attributes'],function(_0x589075){var _0x3a1364={};_0x3a1364[_0x589075]={'$like':'%'+_0x5d2049[_0xcd90('0x33')][_0xcd90('0x3e')]+'%'};return _0x3a1364;})});}_0x2dcc40=_['merge']({},_0x2dcc40,_0x5d2049[_0xcd90('0x4e')]);return db[_0xcd90('0x5d')][_0xcd90('0x49')](_0x2dcc40);}})[_0xcd90('0x29')](function(_0xe6d7cb){if(_0xe6d7cb){return db['User'][_0xcd90('0x60')]({'where':{'id':_[_0xcd90('0x40')](_0xe6d7cb,_0xcd90('0x61')),'role':_0xcd90('0x62')},'attributes':['id',_0xcd90('0x2e'),_0xcd90('0x63'),_0xcd90('0x64'),_0xcd90('0x65')]});}})[_0xcd90('0x29')](function(_0x1c8043){if(_0x1c8043){return{'count':_0x1c8043['count'],'rows':_[_0xcd90('0x40')](_0x1c8043[_0xcd90('0x4a')],function(_0xdf9ecc){return{'membername':_0xdf9ecc[_0xcd90('0x2e')],'UserId':_0xdf9ecc['id'],'queue_name':_0x5d45f9[_0xcd90('0x2e')],'MailQueueId':_0x5d45f9['id'],'interface':util[_0xcd90('0x66')]('%s/%s',_0xcd90('0x67'),_0xdf9ecc[_0xcd90('0x2e')]),'penalty':0x0,'paused':_0xdf9ecc[_0xcd90('0x63')],'createdAt':_0xdf9ecc[_0xcd90('0x65')],'updatedAt':_0xdf9ecc[_0xcd90('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcd90('0x29')](respondWithFilteredResult(_0x503ed7,_0x2dcc40))['catch'](handleError(_0x503ed7,null));};exports[_0xcd90('0x68')]=function(_0x4d23b2,_0x2b1c83,_0x4ac360){var _0x21a528={};var _0x4993e6={};var _0x227f3b;var _0x4e941f;return db[_0xcd90('0x45')][_0xcd90('0x5c')]({'where':{'id':_0x4d23b2['params']['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x2b1c83,null))[_0xcd90('0x29')](function(_0x519ff6){if(_0x519ff6){_0x227f3b=_0x519ff6;_0x4993e6[_0xcd90('0x31')]=_[_0xcd90('0x32')](db[_0xcd90('0x69')][_0xcd90('0x30')]);_0x4993e6[_0xcd90('0x33')]=_[_0xcd90('0x32')](_0x4d23b2[_0xcd90('0x33')]);_0x4993e6[_0xcd90('0x34')]=_[_0xcd90('0x35')](_0x4993e6['model'],_0x4993e6[_0xcd90('0x33')]);_0x21a528['attributes']=_[_0xcd90('0x35')](_0x4993e6['model'],qs[_0xcd90('0x37')](_0x4d23b2['query'][_0xcd90('0x37')]));_0x21a528[_0xcd90('0x36')]=_0x21a528[_0xcd90('0x36')][_0xcd90('0x38')]?_0x21a528[_0xcd90('0x36')]:_0x4993e6[_0xcd90('0x31')];_0x21a528[_0xcd90('0x5e')]=qs[_0xcd90('0x3b')](_0x4d23b2[_0xcd90('0x33')]['sort']);_0x21a528['where']=qs['filters'](_[_0xcd90('0x3d')](_0x4d23b2['query'],_0x4993e6[_0xcd90('0x34')]));if(_0x4d23b2[_0xcd90('0x33')][_0xcd90('0x3e')]){_0x21a528['where']=_[_0xcd90('0x3f')](_0x21a528[_0xcd90('0x3c')],{'$or':_[_0xcd90('0x40')](_0x21a528[_0xcd90('0x36')],function(_0x555a0b){var _0x33ddbd={};_0x33ddbd[_0x555a0b]={'$like':'%'+_0x4d23b2[_0xcd90('0x33')]['filter']+'%'};return _0x33ddbd;})});}_0x21a528=_[_0xcd90('0x3f')]({},_0x21a528,_0x4d23b2[_0xcd90('0x4e')]);return _0x227f3b['getTeams'](_0x21a528);}})[_0xcd90('0x29')](function(_0x5ba9b2){if(_0x5ba9b2){_0x4e941f=_0x5ba9b2[_0xcd90('0x38')];if(!_0x4d23b2[_0xcd90('0x33')][_0xcd90('0x39')](_0xcd90('0x3a'))){_0x21a528[_0xcd90('0x23')]=qs[_0xcd90('0x23')](_0x4d23b2[_0xcd90('0x33')]['limit']);_0x21a528['offset']=qs[_0xcd90('0x22')](_0x4d23b2[_0xcd90('0x33')][_0xcd90('0x22')]);}return _0x227f3b[_0xcd90('0x68')](_0x21a528);}})[_0xcd90('0x29')](function(_0x3412c6){if(_0x3412c6){return _0x3412c6?{'count':_0x4e941f,'rows':_0x3412c6}:null;}})['then'](respondWithResult(_0x2b1c83,null))[_0xcd90('0x4b')](handleError(_0x2b1c83,null));};exports[_0xcd90('0x6a')]=function(_0x1e9800,_0x21dab5,_0x237536){var _0x2c498f=_0x1e9800['body'][_0xcd90('0x6b')];return db[_0xcd90('0x69')][_0xcd90('0x49')]({'where':{'id':_[_0xcd90('0x40')](_0x2c498f,'id')},'attributes':['id'],'include':[{'model':db[_0xcd90('0x6c')],'as':'Agents','attributes':['id',_0xcd90('0x2e'),_0xcd90('0x6d'),_0xcd90('0x6e'),_0xcd90('0x6f')],'raw':!![]}]})['then'](function(_0x638e1){if(_0x638e1){var _0x2ef7a3=_[_0xcd90('0x70')](_0x638e1,function(_0xf7e27){var _0x58c1c9=_0xf7e27['get']({'plain':!![]});return _0x58c1c9[_0xcd90('0x71')];});return db['MailQueue']['find']({'where':{'id':_0x1e9800[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](function(_0x39c318){return db[_0xcd90('0x72')][_0xcd90('0x73')](function(_0xccd6aa){return _0x39c318[_0xcd90('0x6a')](_[_0xcd90('0x40')](_0x2c498f,'id'),{'transaction':_0xccd6aa})[_0xcd90('0x29')](function(){return BPromise[_0xcd90('0x74')](_0x2ef7a3,function(_0x5e7de0){return db[_0xcd90('0x5d')][_0xcd90('0x75')]({'where':{'UserId':_0x5e7de0['id'],'MailQueueId':_0x1e9800[_0xcd90('0x4d')]['id']},'transaction':_0xccd6aa});});})[_0xcd90('0x29')](function(){_0x2ef7a3[_0xcd90('0x76')](function(_0xc865d4){socket[_0xcd90('0x77')](_0xcd90('0x78'),{'UserId':_0xc865d4['id'],'MailQueueId':_0x39c318['id']});});});});});}})[_0xcd90('0x29')](respondWithStatusCode(_0x21dab5,null))[_0xcd90('0x4b')](handleError(_0x21dab5,null));};exports[_0xcd90('0x79')]=function(_0x517d45,_0x1cb3ef,_0x5082a2){return db[_0xcd90('0x69')][_0xcd90('0x49')]({'where':{'id':_0x517d45[_0xcd90('0x33')][_0xcd90('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcd90('0x71'),'attributes':['id'],'raw':!![]}]})[_0xcd90('0x29')](handleEntityNotFound(_0x1cb3ef,null))[_0xcd90('0x29')](function(_0x6f77c9){var _0x193cb9=_[_0xcd90('0x40')](_0x6f77c9,'id');var _0x143dfc=[];var _0x3f6c29=[];var _0x33572b=squel[_0xcd90('0x7b')]();_0x33572b[_0xcd90('0x44')](_0xcd90('0x7c'))[_0xcd90('0x7d')](_0xcd90('0x7e'),'tq')['join'](_0xcd90('0x7f'),'ut',_0xcd90('0x80'))[_0xcd90('0x3c')](_0xcd90('0x81'),_0x517d45[_0xcd90('0x4d')]['id']);for(var _0x43fd5d=0x0;_0x43fd5d<_0x6f77c9[_0xcd90('0x38')];_0x43fd5d+=0x1){let _0x1298ff=_0x6f77c9[_0x43fd5d];for(var _0xd0229e=0x0;_0xd0229e<_0x1298ff[_0xcd90('0x71')]['length'];_0xd0229e+=0x1){let _0x1f0c41=_0x1298ff[_0xcd90('0x71')][_0xd0229e];var _0x26fc1e=_0x33572b[_0xcd90('0x82')]();_0x26fc1e[_0xcd90('0x3c')](_0xcd90('0x83'),_0x1f0c41['id']);_0x3f6c29['push'](db['sequelize'][_0xcd90('0x33')](_0x26fc1e['toString'](),{'type':db['sequelize'][_0xcd90('0x84')][_0xcd90('0x85')]})[_0xcd90('0x29')](function(_0x4ab8e7){if(_0x4ab8e7[_0xcd90('0x38')]===0x1){return _0x1f0c41['id'];}else{var _0x1f6639=_['every'](_[_0xcd90('0x40')](_0x4ab8e7,_0xcd90('0x86')),function(_0x509e0f){return _[_0xcd90('0x87')](_0x193cb9,_0x509e0f);});if(_0x1f6639){return _0x1f0c41['id'];}}}));}}return BPromise[_0xcd90('0x88')](_0x3f6c29)['then'](function(_0x4bb6d8){_0x143dfc=_(_0x143dfc)[_0xcd90('0x89')](_0x4bb6d8)['compact']()[_0xcd90('0x8a')]();return db[_0xcd90('0x45')][_0xcd90('0x4f')]({'where':{'id':_0x517d45[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](function(_0x14001c){return db[_0xcd90('0x72')][_0xcd90('0x73')](function(_0x491bc0){return _0x14001c[_0xcd90('0x79')](_0x517d45[_0xcd90('0x33')]['ids'],{'transaction':_0x491bc0})['then'](function(){if(!_['isEmpty'](_0x143dfc)){return _0x14001c[_0xcd90('0x8b')](_0x143dfc,{'transaction':_0x491bc0});}})['then'](function(){_0x143dfc['forEach'](function(_0x388ce4){socket[_0xcd90('0x77')](_0xcd90('0x8c'),{'UserId':_0x388ce4,'MailQueueId':_0x14001c['id']});});});});});});})[_0xcd90('0x29')](respondWithStatusCode(_0x1cb3ef,null))[_0xcd90('0x4b')](handleError(_0x1cb3ef,null));};exports['addAgents']=function(_0x19fc04,_0x41941a,_0x370adb){return db[_0xcd90('0x45')][_0xcd90('0x4f')]({'where':{'id':_0x19fc04[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x41941a,null))[_0xcd90('0x29')](function(_0x4b57b6){if(_0x4b57b6){return _0x4b57b6[_0xcd90('0x8d')](_0x19fc04['body']['ids'],_[_0xcd90('0x8e')](_0x19fc04[_0xcd90('0x51')],[_0xcd90('0x7a'),'id'])||{})[_0xcd90('0x8f')](function(_0x168f6c){for(var _0x18945e=0x0;_0x18945e<_0x19fc04['body'][_0xcd90('0x7a')]['length'];_0x18945e+=0x1){socket[_0xcd90('0x77')](_0xcd90('0x78'),{'UserId':_0x19fc04[_0xcd90('0x51')][_0xcd90('0x7a')][_0x18945e],'MailQueueId':_0x19fc04[_0xcd90('0x4d')]['id']});}return _0x168f6c;});}})['then'](respondWithResult(_0x41941a,null))[_0xcd90('0x4b')](handleError(_0x41941a,null));};exports['removeAgents']=function(_0x724288,_0x286a5c,_0x1813c3){return db[_0xcd90('0x45')][_0xcd90('0x4f')]({'where':{'id':_0x724288[_0xcd90('0x4d')]['id']}})['then'](handleEntityNotFound(_0x286a5c,null))[_0xcd90('0x29')](function(_0x3d2875){if(_0x3d2875){return _0x3d2875[_0xcd90('0x8b')](_0x724288[_0xcd90('0x33')][_0xcd90('0x7a')])[_0xcd90('0x29')](function(){if(_[_0xcd90('0x90')](_0x724288['query'][_0xcd90('0x7a')])){for(var _0x38b4e7=0x0;_0x38b4e7<_0x724288['query'][_0xcd90('0x7a')][_0xcd90('0x38')];_0x38b4e7+=0x1){socket['emit'](_0xcd90('0x8c'),{'UserId':Number(_0x724288[_0xcd90('0x33')][_0xcd90('0x7a')][_0x38b4e7]),'MailQueueId':Number(_0x724288[_0xcd90('0x4d')]['id'])});}}else{socket['emit'](_0xcd90('0x8c'),{'UserId':Number(_0x724288['query'][_0xcd90('0x7a')]),'MailQueueId':Number(_0x724288[_0xcd90('0x4d')]['id'])});}});}})[_0xcd90('0x29')](respondWithStatusCode(_0x286a5c,null))[_0xcd90('0x4b')](handleError(_0x286a5c,null));};exports[_0xcd90('0x91')]=function(_0x4e222b,_0x2a74e8,_0x1a95e2){var _0x845f1e={};var _0x5e6de1={};var _0x55322d;var _0x357a7f;return db[_0xcd90('0x45')]['findOne']({'where':{'id':_0x4e222b[_0xcd90('0x4d')]['id']}})[_0xcd90('0x29')](handleEntityNotFound(_0x2a74e8,null))[_0xcd90('0x29')](function(_0x38cfe1){if(_0x38cfe1){_0x55322d=_0x38cfe1;_0x5e6de1['model']=_[_0xcd90('0x32')](db[_0xcd90('0x6c')][_0xcd90('0x30')]);_0x5e6de1[_0xcd90('0x33')]=_[_0xcd90('0x32')](_0x4e222b[_0xcd90('0x33')]);_0x5e6de1[_0xcd90('0x34')]=_[_0xcd90('0x35')](_0x5e6de1[_0xcd90('0x31')],_0x5e6de1['query']);_0x845f1e['attributes']=_[_0xcd90('0x35')](_0x5e6de1[_0xcd90('0x31')],qs[_0xcd90('0x37')](_0x4e222b[_0xcd90('0x33')][_0xcd90('0x37')]));_0x845f1e[_0xcd90('0x36')]=_0x845f1e['attributes']['length']?_0x845f1e['attributes']:_0x5e6de1[_0xcd90('0x31')];_0x845f1e[_0xcd90('0x5e')]=qs['sort'](_0x4e222b[_0xcd90('0x33')]['sort']);_0x845f1e[_0xcd90('0x3c')]=qs[_0xcd90('0x34')](_[_0xcd90('0x3d')](_0x4e222b['query'],_0x5e6de1[_0xcd90('0x34')]));if(_0x4e222b[_0xcd90('0x33')][_0xcd90('0x3e')]){_0x845f1e[_0xcd90('0x3c')]=_[_0xcd90('0x3f')](_0x845f1e[_0xcd90('0x3c')],{'$or':_['map'](_0x845f1e['attributes'],function(_0x449c6a){var _0x38afd3={};_0x38afd3[_0x449c6a]={'$like':'%'+_0x4e222b[_0xcd90('0x33')][_0xcd90('0x3e')]+'%'};return _0x38afd3;})});}_0x845f1e=_[_0xcd90('0x3f')]({},_0x845f1e,_0x4e222b[_0xcd90('0x4e')]);return _0x55322d[_0xcd90('0x91')](_0x845f1e);}})[_0xcd90('0x29')](function(_0x45dd8d){if(_0x45dd8d){_0x357a7f=_0x45dd8d[_0xcd90('0x38')];if(!_0x4e222b['query'][_0xcd90('0x39')](_0xcd90('0x3a'))){_0x845f1e[_0xcd90('0x23')]=qs[_0xcd90('0x23')](_0x4e222b[_0xcd90('0x33')]['limit']);_0x845f1e[_0xcd90('0x22')]=qs['offset'](_0x4e222b[_0xcd90('0x33')][_0xcd90('0x22')]);}return _0x55322d[_0xcd90('0x91')](_0x845f1e);}})[_0xcd90('0x29')](function(_0x51c950){if(_0x51c950){return _0x51c950?{'count':_0x357a7f,'rows':_0x51c950}:null;}})[_0xcd90('0x29')](respondWithResult(_0x2a74e8,null))[_0xcd90('0x4b')](handleError(_0x2a74e8,null));}; \ No newline at end of file +var _0xab0e=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','getMembers','findOne','User','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','teams','Agents','online','voicePause','interface','flatMap','addTeams','each','UserMailQueue','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','destroy','then','UserProfileResource','error','name','send','index','MailQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user'];(function(_0x383ed5,_0x33ff25){var _0x50a943=function(_0x2549f9){while(--_0x2549f9){_0x383ed5['push'](_0x383ed5['shift']());}};_0x50a943(++_0x33ff25);}(_0xab0e,0x14b));var _0xeab0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab0e[_0xa148b7];return _0x51efd3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeab0('0x0'));var jsonpatch=require(_0xeab0('0x1'));var rp=require(_0xeab0('0x2'));var moment=require(_0xeab0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeab0('0x4'));var util=require(_0xeab0('0x5'));var path=require('path');var sox=require(_0xeab0('0x6'));var csv=require(_0xeab0('0x7'));var ejs=require(_0xeab0('0x8'));var fs=require('fs');var _=require(_0xeab0('0x9'));var squel=require('squel');var crypto=require(_0xeab0('0xa'));var jsforce=require(_0xeab0('0xb'));var deskjs=require(_0xeab0('0xc'));var toCsv=require(_0xeab0('0x7'));var querystring=require(_0xeab0('0xd'));var Papa=require(_0xeab0('0xe'));var Redis=require(_0xeab0('0xf'));var authService=require(_0xeab0('0x10'));var qs=require(_0xeab0('0x11'));var hardwareService=require(_0xeab0('0x12'));var logger=require('../../config/logger')(_0xeab0('0x13'));var utils=require(_0xeab0('0x14'));var config=require(_0xeab0('0x15'));var db=require(_0xeab0('0x16'))['db'];config['redis']=_[_0xeab0('0x17')](config['redis'],{'host':_0xeab0('0x18'),'port':0x18eb});var socket=require(_0xeab0('0x19'))(new Redis(config[_0xeab0('0x1a')]));require(_0xeab0('0x1b'))[_0xeab0('0x1c')](socket);function respondWithStatusCode(_0x5e7dc8,_0x4aa740){_0x4aa740=_0x4aa740||0xcc;return function(_0x1fe2cc){if(_0x1fe2cc){return _0x5e7dc8[_0xeab0('0x1d')](_0x4aa740);}return _0x5e7dc8[_0xeab0('0x1e')](_0x4aa740)[_0xeab0('0x1f')]();};}function respondWithResult(_0x5349c9,_0x20c293){_0x20c293=_0x20c293||0xc8;return function(_0x3e57d8){if(_0x3e57d8){return _0x5349c9[_0xeab0('0x1e')](_0x20c293)[_0xeab0('0x20')](_0x3e57d8);}};}function respondWithFilteredResult(_0x4db1b5,_0x1a15cf){return function(_0x4df71b){if(_0x4df71b){var _0x273368=_0x4df71b['count'],_0x587160=_0x1a15cf[_0xeab0('0x21')],_0x5c6288=_0x1a15cf['offset']+_0x1a15cf[_0xeab0('0x22')],_0x114297;if(_0x5c6288>=_0x273368){_0x5c6288=_0x273368;_0x114297=0xc8;}else{_0x114297=0xce;}_0x4db1b5[_0xeab0('0x1e')](_0x114297);return _0x4db1b5[_0xeab0('0x23')](_0xeab0('0x24'),_0x587160+'-'+_0x5c6288+'/'+_0x273368)[_0xeab0('0x20')](_0x4df71b);}return null;};}function patchUpdates(_0x1822c3){return function(_0x5b9843){try{jsonpatch['apply'](_0x5b9843,_0x1822c3,!![]);}catch(_0x407066){return BPromise['reject'](_0x407066);}return _0x5b9843[_0xeab0('0x25')]();};}function saveUpdates(_0x4773ab,_0x532196){return function(_0x143f70){if(_0x143f70){return _0x143f70[_0xeab0('0x26')](_0x4773ab)['then'](function(_0xfba913){return _0xfba913;});}return null;};}function removeEntity(_0x17806f,_0x31161e){return function(_0x255f58){if(_0x255f58){return _0x255f58[_0xeab0('0x27')]()[_0xeab0('0x28')](function(){var _0x5d20cb=_0x255f58['get']({'plain':!![]});var _0x4b54dc='MailQueues';return db[_0xeab0('0x29')][_0xeab0('0x27')]({'where':{'type':_0x4b54dc,'resourceId':_0x5d20cb['id']}})[_0xeab0('0x28')](function(){return _0x255f58;});})[_0xeab0('0x28')](function(){_0x17806f[_0xeab0('0x1e')](0xcc)[_0xeab0('0x1f')]();});}};}function handleEntityNotFound(_0x193b95,_0x3ff833){return function(_0x535fb5){if(!_0x535fb5){_0x193b95[_0xeab0('0x1d')](0x194);}return _0x535fb5;};}function handleError(_0x1d0259,_0x97af3a){_0x97af3a=_0x97af3a||0x1f4;return function(_0x52ef9d){logger[_0xeab0('0x2a')](_0x52ef9d['stack']);if(_0x52ef9d[_0xeab0('0x2b')]){delete _0x52ef9d['name'];}_0x1d0259[_0xeab0('0x1e')](_0x97af3a)[_0xeab0('0x2c')](_0x52ef9d);};}exports[_0xeab0('0x2d')]=function(_0x3832e3,_0x388998){var _0x2e4536={},_0x5a6eea={},_0x1a3e20={'count':0x0,'rows':[]};var _0x408753=db[_0xeab0('0x2e')]['rawAttributes'];_0x5a6eea[_0xeab0('0x2f')]=_[_0xeab0('0x30')](_0x408753);_0x5a6eea[_0xeab0('0x31')]=_[_0xeab0('0x30')](_0x3832e3[_0xeab0('0x31')]);_0x5a6eea[_0xeab0('0x32')]=_[_0xeab0('0x33')](_0x5a6eea[_0xeab0('0x2f')],_0x5a6eea['query']);_0x2e4536[_0xeab0('0x34')]=_[_0xeab0('0x33')](_0x5a6eea['model'],qs[_0xeab0('0x35')](_0x3832e3[_0xeab0('0x31')][_0xeab0('0x35')]));_0x2e4536['attributes']=_0x2e4536['attributes'][_0xeab0('0x36')]?_0x2e4536[_0xeab0('0x34')]:_0x5a6eea[_0xeab0('0x2f')];if(!_0x3832e3[_0xeab0('0x31')][_0xeab0('0x37')](_0xeab0('0x38'))){_0x2e4536[_0xeab0('0x22')]=qs[_0xeab0('0x22')](_0x3832e3[_0xeab0('0x31')][_0xeab0('0x22')]);_0x2e4536[_0xeab0('0x21')]=qs['offset'](_0x3832e3[_0xeab0('0x31')][_0xeab0('0x21')]);}_0x2e4536[_0xeab0('0x39')]=qs[_0xeab0('0x3a')](_0x3832e3[_0xeab0('0x31')][_0xeab0('0x3a')]);_0x2e4536[_0xeab0('0x3b')]=qs[_0xeab0('0x32')](_[_0xeab0('0x3c')](_0x3832e3[_0xeab0('0x31')],_0x5a6eea[_0xeab0('0x32')]));if(_0x3832e3['query'][_0xeab0('0x3d')]){_0x2e4536[_0xeab0('0x3b')]=_[_0xeab0('0x3e')](_0x2e4536[_0xeab0('0x3b')],{'$or':_[_0xeab0('0x3f')](_0x408753,function(_0x29f0e7){if(_0x29f0e7[_0xeab0('0x40')]['key']!==_0xeab0('0x41')){var _0x4d9512={};_0x4d9512[_0x29f0e7['field']]={'$like':'%'+_0x3832e3[_0xeab0('0x31')][_0xeab0('0x3d')]+'%'};return _0x4d9512;}})});}_0x2e4536=_[_0xeab0('0x3e')]({},_0x2e4536,_0x3832e3[_0xeab0('0x42')]);var _0x27fc22={'where':_0x2e4536[_0xeab0('0x3b')]};return db[_0xeab0('0x2e')][_0xeab0('0x43')](_0x27fc22)[_0xeab0('0x28')](function(_0x4b6fbd){_0x1a3e20[_0xeab0('0x43')]=_0x4b6fbd;if(_0x3832e3[_0xeab0('0x31')][_0xeab0('0x44')]){_0x2e4536[_0xeab0('0x45')]=[{'all':!![]}];}return db['MailQueue'][_0xeab0('0x46')](_0x2e4536);})[_0xeab0('0x28')](function(_0x234f45){_0x1a3e20[_0xeab0('0x47')]=_0x234f45;return _0x1a3e20;})['then'](respondWithFilteredResult(_0x388998,_0x2e4536))[_0xeab0('0x48')](handleError(_0x388998,null));};exports[_0xeab0('0x49')]=function(_0x5d5cfc,_0x438c8a){var _0x5f53ad={'raw':!![],'where':{'id':_0x5d5cfc[_0xeab0('0x4a')]['id']}},_0x18020f={};_0x18020f[_0xeab0('0x2f')]=_[_0xeab0('0x30')](db[_0xeab0('0x2e')][_0xeab0('0x4b')]);_0x18020f[_0xeab0('0x31')]=_[_0xeab0('0x30')](_0x5d5cfc[_0xeab0('0x31')]);_0x18020f[_0xeab0('0x32')]=_[_0xeab0('0x33')](_0x18020f[_0xeab0('0x2f')],_0x18020f[_0xeab0('0x31')]);_0x5f53ad['attributes']=_[_0xeab0('0x33')](_0x18020f[_0xeab0('0x2f')],qs['fields'](_0x5d5cfc[_0xeab0('0x31')][_0xeab0('0x35')]));_0x5f53ad[_0xeab0('0x34')]=_0x5f53ad[_0xeab0('0x34')][_0xeab0('0x36')]?_0x5f53ad[_0xeab0('0x34')]:_0x18020f[_0xeab0('0x2f')];if(_0x5d5cfc[_0xeab0('0x31')][_0xeab0('0x44')]){_0x5f53ad[_0xeab0('0x45')]=[{'all':!![]}];}_0x5f53ad=_[_0xeab0('0x3e')]({},_0x5f53ad,_0x5d5cfc[_0xeab0('0x42')]);return db['MailQueue'][_0xeab0('0x4c')](_0x5f53ad)[_0xeab0('0x28')](handleEntityNotFound(_0x438c8a,null))[_0xeab0('0x28')](respondWithResult(_0x438c8a,null))[_0xeab0('0x48')](handleError(_0x438c8a,null));};exports[_0xeab0('0x4d')]=function(_0x122074,_0x245c79){return db[_0xeab0('0x2e')][_0xeab0('0x4d')](_0x122074[_0xeab0('0x4e')],{})[_0xeab0('0x28')](function(_0x39ed57){var _0x2a04ac=_0x122074[_0xeab0('0x4f')][_0xeab0('0x50')]({'plain':!![]});if(!_0x2a04ac)throw new Error(_0xeab0('0x51'));if(_0x2a04ac[_0xeab0('0x52')]===_0xeab0('0x4f')){var _0x5b22cc=_0x39ed57['get']({'plain':!![]});var _0x49fc50='MailQueues';return db['UserProfileSection'][_0xeab0('0x4c')]({'where':{'name':_0x49fc50,'userProfileId':_0x2a04ac[_0xeab0('0x53')]},'raw':!![]})['then'](function(_0x2f42f4){if(_0x2f42f4&&_0x2f42f4[_0xeab0('0x54')]===0x0){return db[_0xeab0('0x29')]['create']({'name':_0x5b22cc[_0xeab0('0x2b')],'resourceId':_0x5b22cc['id'],'type':_0x2f42f4[_0xeab0('0x2b')],'sectionId':_0x2f42f4['id']},{})['then'](function(){return _0x39ed57;});}else{return _0x39ed57;}})['catch'](function(_0x194ac7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x194ac7);throw _0x194ac7;});}return _0x39ed57;})['then'](respondWithResult(_0x245c79,0xc9))[_0xeab0('0x48')](handleError(_0x245c79,null));};exports['update']=function(_0x51656f,_0x1c8a65){if(_0x51656f[_0xeab0('0x4e')]['id']){delete _0x51656f[_0xeab0('0x4e')]['id'];}return db[_0xeab0('0x2e')][_0xeab0('0x4c')]({'where':{'id':_0x51656f[_0xeab0('0x4a')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x1c8a65,null))[_0xeab0('0x28')](saveUpdates(_0x51656f[_0xeab0('0x4e')],null))[_0xeab0('0x28')](respondWithResult(_0x1c8a65,null))[_0xeab0('0x48')](handleError(_0x1c8a65,null));};exports['destroy']=function(_0x881b93,_0x58f293){return db[_0xeab0('0x2e')][_0xeab0('0x4c')]({'where':{'id':_0x881b93['params']['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x58f293,null))[_0xeab0('0x28')](removeEntity(_0x58f293,null))[_0xeab0('0x48')](handleError(_0x58f293,null));};exports['describe']=function(_0x24e2dd,_0x29bfb1){return db['MailQueue'][_0xeab0('0x55')]()[_0xeab0('0x28')](respondWithResult(_0x29bfb1,null))[_0xeab0('0x48')](handleError(_0x29bfb1,null));};exports[_0xeab0('0x56')]=function(_0x51b161,_0x2ed676,_0x11feb9){var _0x2afed7={'raw':!![],'where':{}},_0x3f6f45={},_0x1931ed;return db[_0xeab0('0x2e')][_0xeab0('0x57')]({'where':{'id':_0x51b161[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ed676,null))[_0xeab0('0x28')](function(_0x2504be){if(_0x2504be){_0x1931ed=_0x2504be[_0xeab0('0x50')]({'plain':!![]});_0x3f6f45[_0xeab0('0x2f')]=_[_0xeab0('0x30')](db['UserMailQueue'][_0xeab0('0x4b')]);_0x3f6f45[_0xeab0('0x31')]=_[_0xeab0('0x30')](_0x51b161[_0xeab0('0x31')]);_0x3f6f45[_0xeab0('0x32')]=_[_0xeab0('0x33')](_0x3f6f45[_0xeab0('0x2f')],_0x3f6f45[_0xeab0('0x31')]);_0x2afed7[_0xeab0('0x34')]=_['intersection'](_0x3f6f45['model'],qs[_0xeab0('0x35')](_0x51b161[_0xeab0('0x31')][_0xeab0('0x35')]));_0x2afed7['attributes']=_0x2afed7[_0xeab0('0x34')]['length']?_0x2afed7[_0xeab0('0x34')]:_0x3f6f45[_0xeab0('0x2f')];if(!_0x51b161['query']['hasOwnProperty'](_0xeab0('0x38'))){_0x2afed7[_0xeab0('0x22')]=qs[_0xeab0('0x22')](_0x51b161[_0xeab0('0x31')][_0xeab0('0x22')]);_0x2afed7[_0xeab0('0x21')]=qs[_0xeab0('0x21')](_0x51b161[_0xeab0('0x31')][_0xeab0('0x21')]);}_0x2afed7[_0xeab0('0x39')]=qs[_0xeab0('0x3a')](_0x51b161[_0xeab0('0x31')][_0xeab0('0x3a')]);_0x2afed7['where']=qs[_0xeab0('0x32')](_[_0xeab0('0x3c')](_0x51b161[_0xeab0('0x31')],_0x3f6f45['filters']));_0x2afed7[_0xeab0('0x3b')]['MailQueueId']=_0x2504be['id'];if(_0x51b161[_0xeab0('0x31')]['filter']){_0x2afed7[_0xeab0('0x3b')]=_[_0xeab0('0x3e')](_0x2afed7[_0xeab0('0x3b')],{'$or':_[_0xeab0('0x3f')](_0x2afed7[_0xeab0('0x34')],function(_0x5501c4){var _0x57834d={};_0x57834d[_0x5501c4]={'$like':'%'+_0x51b161[_0xeab0('0x31')][_0xeab0('0x3d')]+'%'};return _0x57834d;})});}_0x2afed7=_[_0xeab0('0x3e')]({},_0x2afed7,_0x51b161[_0xeab0('0x42')]);return db['UserMailQueue'][_0xeab0('0x46')](_0x2afed7);}})[_0xeab0('0x28')](function(_0x326765){if(_0x326765){return db[_0xeab0('0x58')]['findAndCountAll']({'where':{'id':_[_0xeab0('0x3f')](_0x326765,_0xeab0('0x59')),'role':_0xeab0('0x5a')},'attributes':['id','name',_0xeab0('0x5b'),_0xeab0('0x5c'),_0xeab0('0x5d')]});}})[_0xeab0('0x28')](function(_0x1c19be){if(_0x1c19be){return{'count':_0x1c19be[_0xeab0('0x43')],'rows':_[_0xeab0('0x3f')](_0x1c19be['rows'],function(_0x3cf830){return{'membername':_0x3cf830[_0xeab0('0x2b')],'UserId':_0x3cf830['id'],'queue_name':_0x1931ed['name'],'MailQueueId':_0x1931ed['id'],'interface':util['format'](_0xeab0('0x5e'),_0xeab0('0x5f'),_0x3cf830['name']),'penalty':0x0,'paused':_0x3cf830[_0xeab0('0x5b')],'createdAt':_0x3cf830[_0xeab0('0x5d')],'updatedAt':_0x3cf830[_0xeab0('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2ed676,_0x2afed7))[_0xeab0('0x48')](handleError(_0x2ed676,null));};exports[_0xeab0('0x60')]=function(_0xadd01a,_0x2d3e04,_0x1a4681){var _0x2f7057={};var _0x43ec61={};var _0x4283ea;var _0x4d24ec;return db['MailQueue'][_0xeab0('0x57')]({'where':{'id':_0xadd01a['params']['id']}})['then'](handleEntityNotFound(_0x2d3e04,null))[_0xeab0('0x28')](function(_0x43c955){if(_0x43c955){_0x4283ea=_0x43c955;_0x43ec61['model']=_[_0xeab0('0x30')](db[_0xeab0('0x61')][_0xeab0('0x4b')]);_0x43ec61[_0xeab0('0x31')]=_[_0xeab0('0x30')](_0xadd01a[_0xeab0('0x31')]);_0x43ec61[_0xeab0('0x32')]=_['intersection'](_0x43ec61['model'],_0x43ec61['query']);_0x2f7057['attributes']=_['intersection'](_0x43ec61['model'],qs['fields'](_0xadd01a[_0xeab0('0x31')][_0xeab0('0x35')]));_0x2f7057['attributes']=_0x2f7057['attributes']['length']?_0x2f7057[_0xeab0('0x34')]:_0x43ec61[_0xeab0('0x2f')];_0x2f7057[_0xeab0('0x39')]=qs[_0xeab0('0x3a')](_0xadd01a['query'][_0xeab0('0x3a')]);_0x2f7057[_0xeab0('0x3b')]=qs['filters'](_[_0xeab0('0x3c')](_0xadd01a['query'],_0x43ec61[_0xeab0('0x32')]));if(_0xadd01a[_0xeab0('0x31')][_0xeab0('0x3d')]){_0x2f7057[_0xeab0('0x3b')]=_['merge'](_0x2f7057['where'],{'$or':_[_0xeab0('0x3f')](_0x2f7057[_0xeab0('0x34')],function(_0x235861){var _0xdb3dbd={};_0xdb3dbd[_0x235861]={'$like':'%'+_0xadd01a[_0xeab0('0x31')][_0xeab0('0x3d')]+'%'};return _0xdb3dbd;})});}_0x2f7057=_[_0xeab0('0x3e')]({},_0x2f7057,_0xadd01a[_0xeab0('0x42')]);return _0x4283ea[_0xeab0('0x60')](_0x2f7057);}})[_0xeab0('0x28')](function(_0x4b7752){if(_0x4b7752){_0x4d24ec=_0x4b7752[_0xeab0('0x36')];if(!_0xadd01a[_0xeab0('0x31')]['hasOwnProperty']('nolimit')){_0x2f7057[_0xeab0('0x22')]=qs[_0xeab0('0x22')](_0xadd01a[_0xeab0('0x31')][_0xeab0('0x22')]);_0x2f7057['offset']=qs[_0xeab0('0x21')](_0xadd01a['query'][_0xeab0('0x21')]);}return _0x4283ea[_0xeab0('0x60')](_0x2f7057);}})['then'](function(_0x556a32){if(_0x556a32){return _0x556a32?{'count':_0x4d24ec,'rows':_0x556a32}:null;}})['then'](respondWithResult(_0x2d3e04,null))[_0xeab0('0x48')](handleError(_0x2d3e04,null));};exports['addTeams']=function(_0x56955e,_0x48d82b,_0xae8d06){var _0x50c66d=_0x56955e[_0xeab0('0x4e')][_0xeab0('0x62')];return db[_0xeab0('0x61')][_0xeab0('0x46')]({'where':{'id':_[_0xeab0('0x3f')](_0x50c66d,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeab0('0x63'),'attributes':['id','name',_0xeab0('0x64'),_0xeab0('0x65'),_0xeab0('0x66')],'raw':!![]}]})[_0xeab0('0x28')](function(_0x56f608){if(_0x56f608){var _0x11b231=_[_0xeab0('0x67')](_0x56f608,function(_0x1e4ef3){var _0x302d7c=_0x1e4ef3[_0xeab0('0x50')]({'plain':!![]});return _0x302d7c[_0xeab0('0x63')];});return db[_0xeab0('0x2e')][_0xeab0('0x4c')]({'where':{'id':_0x56955e[_0xeab0('0x4a')]['id']}})[_0xeab0('0x28')](function(_0x3da877){return db['sequelize']['transaction'](function(_0x38e122){return _0x3da877[_0xeab0('0x68')](_[_0xeab0('0x3f')](_0x50c66d,'id'),{'transaction':_0x38e122})[_0xeab0('0x28')](function(){return BPromise[_0xeab0('0x69')](_0x11b231,function(_0x5bbcea){return db[_0xeab0('0x6a')]['findOrCreate']({'where':{'UserId':_0x5bbcea['id'],'MailQueueId':_0x56955e[_0xeab0('0x4a')]['id']},'transaction':_0x38e122});});})[_0xeab0('0x28')](function(){_0x11b231['forEach'](function(_0x27943a){socket['emit'](_0xeab0('0x6b'),{'UserId':_0x27943a['id'],'MailQueueId':_0x3da877['id']});});});});});}})[_0xeab0('0x28')](respondWithStatusCode(_0x48d82b,null))[_0xeab0('0x48')](handleError(_0x48d82b,null));};exports[_0xeab0('0x6c')]=function(_0x2f15b2,_0x2df4e0,_0x2520e5){return db[_0xeab0('0x61')]['findAll']({'where':{'id':_0x2f15b2[_0xeab0('0x31')][_0xeab0('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xeab0('0x58')],'as':_0xeab0('0x63'),'attributes':['id'],'raw':!![]}]})[_0xeab0('0x28')](handleEntityNotFound(_0x2df4e0,null))[_0xeab0('0x28')](function(_0x110551){var _0x54b605=_[_0xeab0('0x3f')](_0x110551,'id');var _0x1903a9=[];var _0x393c83=[];var _0x3fab69=squel[_0xeab0('0x6e')]();_0x3fab69[_0xeab0('0x6f')](_0xeab0('0x70'))[_0xeab0('0x71')]('team_has_mail_queues','tq')['join'](_0xeab0('0x72'),'ut',_0xeab0('0x73'))[_0xeab0('0x3b')]('MailQueueId\x20=\x20?',_0x2f15b2[_0xeab0('0x4a')]['id']);for(var _0x42510a=0x0;_0x42510a<_0x110551[_0xeab0('0x36')];_0x42510a+=0x1){let _0x292197=_0x110551[_0x42510a];for(var _0x39ba6d=0x0;_0x39ba6d<_0x292197[_0xeab0('0x63')]['length'];_0x39ba6d+=0x1){let _0x304968=_0x292197[_0xeab0('0x63')][_0x39ba6d];var _0x5a0843=_0x3fab69[_0xeab0('0x74')]();_0x5a0843['where']('ut.UserId\x20=\x20?',_0x304968['id']);_0x393c83['push'](db[_0xeab0('0x75')]['query'](_0x5a0843[_0xeab0('0x76')](),{'type':db['sequelize'][_0xeab0('0x77')]['SELECT']})[_0xeab0('0x28')](function(_0x18e85f){if(_0x18e85f['length']===0x1){return _0x304968['id'];}else{var _0x32ebe4=_[_0xeab0('0x78')](_['map'](_0x18e85f,_0xeab0('0x79')),function(_0x35e3c5){return _[_0xeab0('0x7a')](_0x54b605,_0x35e3c5);});if(_0x32ebe4){return _0x304968['id'];}}}));}}return BPromise[_0xeab0('0x7b')](_0x393c83)[_0xeab0('0x28')](function(_0x52eb9f){_0x1903a9=_(_0x1903a9)[_0xeab0('0x7c')](_0x52eb9f)[_0xeab0('0x7d')]()[_0xeab0('0x7e')]();return db[_0xeab0('0x2e')][_0xeab0('0x4c')]({'where':{'id':_0x2f15b2[_0xeab0('0x4a')]['id']}})['then'](function(_0x46d60e){return db['sequelize'][_0xeab0('0x7f')](function(_0x3bbb82){return _0x46d60e[_0xeab0('0x6c')](_0x2f15b2['query'][_0xeab0('0x6d')],{'transaction':_0x3bbb82})[_0xeab0('0x28')](function(){if(!_[_0xeab0('0x80')](_0x1903a9)){return _0x46d60e[_0xeab0('0x81')](_0x1903a9,{'transaction':_0x3bbb82});}})[_0xeab0('0x28')](function(){_0x1903a9['forEach'](function(_0x5002bb){socket[_0xeab0('0x82')](_0xeab0('0x83'),{'UserId':_0x5002bb,'MailQueueId':_0x46d60e['id']});});});});});});})[_0xeab0('0x28')](respondWithStatusCode(_0x2df4e0,null))['catch'](handleError(_0x2df4e0,null));};exports[_0xeab0('0x84')]=function(_0x13e58b,_0x1dcc25,_0x221862){return db['MailQueue']['find']({'where':{'id':_0x13e58b[_0xeab0('0x4a')]['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x1dcc25,null))[_0xeab0('0x28')](function(_0x2ea287){if(_0x2ea287){return _0x2ea287[_0xeab0('0x84')](_0x13e58b[_0xeab0('0x4e')][_0xeab0('0x6d')],_[_0xeab0('0x85')](_0x13e58b['body'],[_0xeab0('0x6d'),'id'])||{})[_0xeab0('0x86')](function(_0x57c308){for(var _0x4b7d50=0x0;_0x4b7d50<_0x13e58b[_0xeab0('0x4e')][_0xeab0('0x6d')]['length'];_0x4b7d50+=0x1){socket[_0xeab0('0x82')](_0xeab0('0x6b'),{'UserId':_0x13e58b[_0xeab0('0x4e')]['ids'][_0x4b7d50],'MailQueueId':_0x13e58b[_0xeab0('0x4a')]['id']});}return _0x57c308;});}})[_0xeab0('0x28')](respondWithResult(_0x1dcc25,null))[_0xeab0('0x48')](handleError(_0x1dcc25,null));};exports[_0xeab0('0x81')]=function(_0x1c66b6,_0x4a1075,_0x5669b3){return db[_0xeab0('0x2e')][_0xeab0('0x4c')]({'where':{'id':_0x1c66b6[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a1075,null))[_0xeab0('0x28')](function(_0x1d2a8c){if(_0x1d2a8c){return _0x1d2a8c[_0xeab0('0x81')](_0x1c66b6['query'][_0xeab0('0x6d')])[_0xeab0('0x28')](function(){if(_[_0xeab0('0x87')](_0x1c66b6[_0xeab0('0x31')][_0xeab0('0x6d')])){for(var _0x1a7a79=0x0;_0x1a7a79<_0x1c66b6[_0xeab0('0x31')][_0xeab0('0x6d')]['length'];_0x1a7a79+=0x1){socket[_0xeab0('0x82')](_0xeab0('0x83'),{'UserId':Number(_0x1c66b6[_0xeab0('0x31')][_0xeab0('0x6d')][_0x1a7a79]),'MailQueueId':Number(_0x1c66b6['params']['id'])});}}else{socket[_0xeab0('0x82')](_0xeab0('0x83'),{'UserId':Number(_0x1c66b6[_0xeab0('0x31')][_0xeab0('0x6d')]),'MailQueueId':Number(_0x1c66b6[_0xeab0('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a1075,null))['catch'](handleError(_0x4a1075,null));};exports[_0xeab0('0x88')]=function(_0xde62d3,_0x4ea99d,_0x248d10){var _0x305153={};var _0x5b0c37={};var _0x4b3465;var _0x1eae06;return db[_0xeab0('0x2e')]['findOne']({'where':{'id':_0xde62d3['params']['id']}})[_0xeab0('0x28')](handleEntityNotFound(_0x4ea99d,null))[_0xeab0('0x28')](function(_0xf6cc22){if(_0xf6cc22){_0x4b3465=_0xf6cc22;_0x5b0c37[_0xeab0('0x2f')]=_[_0xeab0('0x30')](db['User'][_0xeab0('0x4b')]);_0x5b0c37[_0xeab0('0x31')]=_['keys'](_0xde62d3[_0xeab0('0x31')]);_0x5b0c37['filters']=_[_0xeab0('0x33')](_0x5b0c37['model'],_0x5b0c37[_0xeab0('0x31')]);_0x305153[_0xeab0('0x34')]=_[_0xeab0('0x33')](_0x5b0c37[_0xeab0('0x2f')],qs['fields'](_0xde62d3[_0xeab0('0x31')][_0xeab0('0x35')]));_0x305153[_0xeab0('0x34')]=_0x305153[_0xeab0('0x34')][_0xeab0('0x36')]?_0x305153['attributes']:_0x5b0c37[_0xeab0('0x2f')];_0x305153[_0xeab0('0x39')]=qs[_0xeab0('0x3a')](_0xde62d3[_0xeab0('0x31')]['sort']);_0x305153['where']=qs[_0xeab0('0x32')](_[_0xeab0('0x3c')](_0xde62d3[_0xeab0('0x31')],_0x5b0c37['filters']));if(_0xde62d3[_0xeab0('0x31')][_0xeab0('0x3d')]){_0x305153[_0xeab0('0x3b')]=_[_0xeab0('0x3e')](_0x305153['where'],{'$or':_[_0xeab0('0x3f')](_0x305153[_0xeab0('0x34')],function(_0xe5e18a){var _0x182632={};_0x182632[_0xe5e18a]={'$like':'%'+_0xde62d3[_0xeab0('0x31')][_0xeab0('0x3d')]+'%'};return _0x182632;})});}_0x305153=_[_0xeab0('0x3e')]({},_0x305153,_0xde62d3['options']);return _0x4b3465[_0xeab0('0x88')](_0x305153);}})[_0xeab0('0x28')](function(_0x274c8f){if(_0x274c8f){_0x1eae06=_0x274c8f[_0xeab0('0x36')];if(!_0xde62d3[_0xeab0('0x31')][_0xeab0('0x37')](_0xeab0('0x38'))){_0x305153['limit']=qs['limit'](_0xde62d3[_0xeab0('0x31')][_0xeab0('0x22')]);_0x305153['offset']=qs[_0xeab0('0x21')](_0xde62d3[_0xeab0('0x31')][_0xeab0('0x21')]);}return _0x4b3465[_0xeab0('0x88')](_0x305153);}})[_0xeab0('0x28')](function(_0x4f3841){if(_0x4f3841){return _0x4f3841?{'count':_0x1eae06,'rows':_0x4f3841}:null;}})[_0xeab0('0x28')](respondWithResult(_0x4ea99d,null))[_0xeab0('0x48')](handleError(_0x4ea99d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 73ffef8..9ff36f9 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 _0x6dea=['MailQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x6dea,0x86));var _0xa6de=function(_0x2c01df,_0x113b11){_0x2c01df=_0x2c01df-0x0;var _0x367a58=_0x6dea[_0x2c01df];return _0x367a58;};'use strict';var EventEmitter=require(_0xa6de('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xa6de('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa6de('0x2')](0x0);var events={'afterCreate':_0xa6de('0x3'),'afterUpdate':_0xa6de('0x4'),'afterDestroy':_0xa6de('0x5')};function emitEvent(_0x5d992f){return function(_0x11ca79,_0x8ae013,_0x1a233e){MailQueueEvents['emit'](_0x5d992f+':'+_0x11ca79['id'],_0x11ca79);MailQueueEvents['emit'](_0x5d992f,_0x11ca79);_0x1a233e(null);};}for(var e in events){if(events[_0xa6de('0x6')](e)){var event=events[e];MailQueue[_0xa6de('0x7')](e,emitEvent(event));}}module[_0xa6de('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x312d=['../../mysqldb','MailQueue','save','update','remove','emit','hook','events'];(function(_0x508020,_0x3a0f2c){var _0x31fa9=function(_0x15a8d8){while(--_0x15a8d8){_0x508020['push'](_0x508020['shift']());}};_0x31fa9(++_0x3a0f2c);}(_0x312d,0x1d7));var _0xd312=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x312d[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require(_0xd312('0x0'));var MailQueue=require(_0xd312('0x1'))['db'][_0xd312('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd312('0x3'),'afterUpdate':_0xd312('0x4'),'afterDestroy':_0xd312('0x5')};function emitEvent(_0x33176c){return function(_0xbbd269,_0x39471c,_0x3a2c52){MailQueueEvents[_0xd312('0x6')](_0x33176c+':'+_0xbbd269['id'],_0xbbd269);MailQueueEvents[_0xd312('0x6')](_0x33176c,_0xbbd269);_0x3a2c52(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xd312('0x7')](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 96b7b61..45c8a2e 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','../../config/logger','api'];(function(_0x12dc61,_0x383811){var _0x5e3cf9=function(_0x1d2e51){while(--_0x1d2e51){_0x12dc61['push'](_0x12dc61['shift']());}};_0x5e3cf9(++_0x383811);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['MailQueue','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','define'];(function(_0x4c8ebd,_0x189ee1){var _0x1f57ba=function(_0x49faed){while(--_0x49faed){_0x4c8ebd['push'](_0x4c8ebd['shift']());}};_0x1f57ba(++_0x189ee1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 8721749..8e9272b 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 _0x642f=['raw','where','limit','include','model','attributes','map','then','ShowMailQueue','MailQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','findAll','options'];(function(_0x322a64,_0xddff42){var _0x52517f=function(_0x2f4030){while(--_0x2f4030){_0x322a64['push'](_0x322a64['shift']());}};_0x52517f(++_0xddff42);}(_0x642f,0xfb));var _0xf642=function(_0x397a95,_0x35c758){_0x397a95=_0x397a95-0x0;var _0x173be2=_0x642f[_0x397a95];return _0x173be2;};'use strict';var _=require(_0xf642('0x0'));var util=require('util');var moment=require(_0xf642('0x1'));var BPromise=require(_0xf642('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf642('0x3'));var db=require(_0xf642('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf642('0x5'))(_0xf642('0x6'));var config=require(_0xf642('0x7'));var jayson=require(_0xf642('0x8'));var client=jayson[_0xf642('0x9')][_0xf642('0xa')]({'port':0x232a});config[_0xf642('0xb')]=_[_0xf642('0xc')](config[_0xf642('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf642('0xd'))[_0xf642('0xe')](socket);function respondWithRpcPromise(_0x2ac35c,_0x267fdd,_0x2a2fbe){return new BPromise(function(_0x53a8b4,_0x23de9c){return client[_0xf642('0xf')](_0x2ac35c,_0x2a2fbe)['then'](function(_0x19daeb){logger[_0xf642('0x10')](_0xf642('0x11'),_0x267fdd,_0xf642('0x12'));logger[_0xf642('0x13')](_0xf642('0x14'),_0x267fdd,_0xf642('0x12'),JSON['stringify'](_0x19daeb));if(_0x19daeb[_0xf642('0x15')]){if(_0x19daeb['error'][_0xf642('0x16')]===0x1f4){logger['error'](_0xf642('0x11'),_0x267fdd,_0x19daeb[_0xf642('0x15')]['message']);return _0x23de9c(_0x19daeb[_0xf642('0x15')]['message']);}logger[_0xf642('0x15')]('MailQueue,\x20%s,\x20%s',_0x267fdd,_0x19daeb['error'][_0xf642('0x17')]);return _0x53a8b4(_0x19daeb[_0xf642('0x15')][_0xf642('0x17')]);}else{logger[_0xf642('0x10')]('MailQueue,\x20%s,\x20%s',_0x267fdd,_0xf642('0x12'));_0x53a8b4(_0x19daeb[_0xf642('0x18')]['message']);}})[_0xf642('0x19')](function(_0x23a139){logger[_0xf642('0x15')](_0xf642('0x11'),_0x267fdd,_0x23a139);_0x23de9c(_0x23a139);});});}exports[_0xf642('0x1a')]=function(_0x58d8ff){var _0x55d497=this;return new Promise(function(_0x2902cd,_0x1c19bf){return db['MailQueue'][_0xf642('0x1b')]({'raw':_0x58d8ff['options']?_0x58d8ff[_0xf642('0x1c')][_0xf642('0x1d')]===undefined?!![]:![]:!![],'where':_0x58d8ff[_0xf642('0x1c')]?_0x58d8ff[_0xf642('0x1c')][_0xf642('0x1e')]||null:null,'attributes':_0x58d8ff[_0xf642('0x1c')]?_0x58d8ff[_0xf642('0x1c')]['attributes']||null:null,'limit':_0x58d8ff['options']?_0x58d8ff[_0xf642('0x1c')][_0xf642('0x1f')]||null:null,'include':_0x58d8ff[_0xf642('0x1c')]?_0x58d8ff['options'][_0xf642('0x20')]?_['map'](_0x58d8ff['options'][_0xf642('0x20')],function(_0x2ea3a3){return{'model':db[_0x2ea3a3[_0xf642('0x21')]],'as':_0x2ea3a3['as'],'attributes':_0x2ea3a3[_0xf642('0x22')],'include':_0x2ea3a3[_0xf642('0x20')]?_[_0xf642('0x23')](_0x2ea3a3[_0xf642('0x20')],function(_0x532c0b){return{'model':db[_0x532c0b[_0xf642('0x21')]],'as':_0x532c0b['as'],'attributes':_0x532c0b[_0xf642('0x22')],'include':_0x532c0b[_0xf642('0x20')]?_[_0xf642('0x23')](_0x532c0b[_0xf642('0x20')],function(_0x2bf1c0){return{'model':db[_0x2bf1c0[_0xf642('0x21')]],'as':_0x2bf1c0['as'],'attributes':_0x2bf1c0[_0xf642('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf642('0x24')](function(_0x231db7){logger[_0xf642('0x10')](_0xf642('0x1a'),_0x58d8ff);logger[_0xf642('0x13')](_0xf642('0x1a'),_0x58d8ff,JSON['stringify'](_0x231db7));_0x2902cd(_0x231db7);})[_0xf642('0x19')](function(_0x48bebb){logger[_0xf642('0x15')](_0xf642('0x1a'),_0x48bebb[_0xf642('0x17')],_0x58d8ff);_0x1c19bf(_0x55d497['error'](0x1f4,_0x48bebb[_0xf642('0x17')]));});});};exports[_0xf642('0x25')]=function(_0x42af06){var _0x1c9375=this;return new Promise(function(_0x4a35a3,_0x20c5e8){return db[_0xf642('0x26')][_0xf642('0x27')]({'raw':_0x42af06[_0xf642('0x1c')]?_0x42af06[_0xf642('0x1c')][_0xf642('0x1d')]===undefined?!![]:![]:!![],'where':_0x42af06['options']?_0x42af06[_0xf642('0x1c')]['where']||null:null,'attributes':_0x42af06[_0xf642('0x1c')]?_0x42af06[_0xf642('0x1c')][_0xf642('0x22')]||null:null,'include':_0x42af06[_0xf642('0x1c')]?_0x42af06['options']['include']?_[_0xf642('0x23')](_0x42af06['options'][_0xf642('0x20')],function(_0x4d3147){return{'model':db[_0x4d3147[_0xf642('0x21')]],'as':_0x4d3147['as'],'attributes':_0x4d3147['attributes'],'include':_0x4d3147[_0xf642('0x20')]?_[_0xf642('0x23')](_0x4d3147['include'],function(_0x172698){return{'model':db[_0x172698[_0xf642('0x21')]],'as':_0x172698['as'],'attributes':_0x172698[_0xf642('0x22')],'include':_0x172698[_0xf642('0x20')]?_[_0xf642('0x23')](_0x172698[_0xf642('0x20')],function(_0x2ceb32){return{'model':db[_0x2ceb32[_0xf642('0x21')]],'as':_0x2ceb32['as'],'attributes':_0x2ceb32['attributes']};}):[]};}):[]};}):[]:[]})[_0xf642('0x24')](function(_0x32ec5a){logger[_0xf642('0x10')](_0xf642('0x25'),_0x42af06);logger[_0xf642('0x13')](_0xf642('0x25'),_0x42af06,JSON['stringify'](_0x32ec5a));_0x4a35a3(_0x32ec5a);})[_0xf642('0x19')](function(_0x401ed4){logger[_0xf642('0x15')](_0xf642('0x25'),_0x401ed4[_0xf642('0x17')],_0x42af06);_0x20c5e8(_0x1c9375['error'](0x1f4,_0x401ed4[_0xf642('0x17')]));});});}; \ No newline at end of file +var _0x1123=['then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailQueue','lodash','util','bluebird','ioredis','../../config/logger','rpc','http','redis','socket.io-emitter','./mailQueue.socket','register','request'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x1123,0x1c8));var _0x3112=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1123[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x3112('0x0'));var util=require(_0x3112('0x1'));var moment=require('moment');var BPromise=require(_0x3112('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3112('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3112('0x4'))(_0x3112('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3112('0x6')]({'port':0x232a});config[_0x3112('0x7')]=_['defaults'](config[_0x3112('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3112('0x8'))(new Redis(config[_0x3112('0x7')]));require(_0x3112('0x9'))[_0x3112('0xa')](socket);function respondWithRpcPromise(_0x48bb10,_0x4d5af3,_0x3c5093){return new BPromise(function(_0xeaf6d8,_0x470eba){return client[_0x3112('0xb')](_0x48bb10,_0x3c5093)[_0x3112('0xc')](function(_0x2aebee){logger[_0x3112('0xd')](_0x3112('0xe'),_0x4d5af3,_0x3112('0xf'));logger[_0x3112('0x10')](_0x3112('0x11'),_0x4d5af3,_0x3112('0xf'),JSON['stringify'](_0x2aebee));if(_0x2aebee[_0x3112('0x12')]){if(_0x2aebee[_0x3112('0x12')][_0x3112('0x13')]===0x1f4){logger[_0x3112('0x12')](_0x3112('0xe'),_0x4d5af3,_0x2aebee[_0x3112('0x12')][_0x3112('0x14')]);return _0x470eba(_0x2aebee['error']['message']);}logger[_0x3112('0x12')](_0x3112('0xe'),_0x4d5af3,_0x2aebee['error'][_0x3112('0x14')]);return _0xeaf6d8(_0x2aebee[_0x3112('0x12')]['message']);}else{logger[_0x3112('0xd')]('MailQueue,\x20%s,\x20%s',_0x4d5af3,_0x3112('0xf'));_0xeaf6d8(_0x2aebee[_0x3112('0x15')][_0x3112('0x14')]);}})[_0x3112('0x16')](function(_0x109421){logger[_0x3112('0x12')](_0x3112('0xe'),_0x4d5af3,_0x109421);_0x470eba(_0x109421);});});}exports[_0x3112('0x17')]=function(_0x23b9f2){var _0x45882c=this;return new Promise(function(_0x5a7a34,_0x320fb6){return db[_0x3112('0x18')][_0x3112('0x19')]({'raw':_0x23b9f2[_0x3112('0x1a')]?_0x23b9f2[_0x3112('0x1a')][_0x3112('0x1b')]===undefined?!![]:![]:!![],'where':_0x23b9f2[_0x3112('0x1a')]?_0x23b9f2[_0x3112('0x1a')][_0x3112('0x1c')]||null:null,'attributes':_0x23b9f2[_0x3112('0x1a')]?_0x23b9f2['options'][_0x3112('0x1d')]||null:null,'limit':_0x23b9f2[_0x3112('0x1a')]?_0x23b9f2[_0x3112('0x1a')][_0x3112('0x1e')]||null:null,'include':_0x23b9f2[_0x3112('0x1a')]?_0x23b9f2[_0x3112('0x1a')][_0x3112('0x1f')]?_[_0x3112('0x20')](_0x23b9f2[_0x3112('0x1a')][_0x3112('0x1f')],function(_0x18850c){return{'model':db[_0x18850c[_0x3112('0x21')]],'as':_0x18850c['as'],'attributes':_0x18850c[_0x3112('0x1d')],'include':_0x18850c[_0x3112('0x1f')]?_[_0x3112('0x20')](_0x18850c[_0x3112('0x1f')],function(_0x185917){return{'model':db[_0x185917[_0x3112('0x21')]],'as':_0x185917['as'],'attributes':_0x185917[_0x3112('0x1d')],'include':_0x185917[_0x3112('0x1f')]?_[_0x3112('0x20')](_0x185917[_0x3112('0x1f')],function(_0x55d91e){return{'model':db[_0x55d91e[_0x3112('0x21')]],'as':_0x55d91e['as'],'attributes':_0x55d91e[_0x3112('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3112('0xc')](function(_0x46a6eb){logger[_0x3112('0xd')](_0x3112('0x17'),_0x23b9f2);logger['debug'](_0x3112('0x17'),_0x23b9f2,JSON[_0x3112('0x22')](_0x46a6eb));_0x5a7a34(_0x46a6eb);})[_0x3112('0x16')](function(_0x1c3c7d){logger['error'](_0x3112('0x17'),_0x1c3c7d[_0x3112('0x14')],_0x23b9f2);_0x320fb6(_0x45882c[_0x3112('0x12')](0x1f4,_0x1c3c7d[_0x3112('0x14')]));});});};exports[_0x3112('0x23')]=function(_0xbc9c8d){var _0x43cbc0=this;return new Promise(function(_0xe9f442,_0x3cbbcf){return db[_0x3112('0x18')]['find']({'raw':_0xbc9c8d[_0x3112('0x1a')]?_0xbc9c8d[_0x3112('0x1a')][_0x3112('0x1b')]===undefined?!![]:![]:!![],'where':_0xbc9c8d[_0x3112('0x1a')]?_0xbc9c8d[_0x3112('0x1a')][_0x3112('0x1c')]||null:null,'attributes':_0xbc9c8d[_0x3112('0x1a')]?_0xbc9c8d[_0x3112('0x1a')][_0x3112('0x1d')]||null:null,'include':_0xbc9c8d[_0x3112('0x1a')]?_0xbc9c8d['options'][_0x3112('0x1f')]?_[_0x3112('0x20')](_0xbc9c8d['options'][_0x3112('0x1f')],function(_0x3f9c87){return{'model':db[_0x3f9c87['model']],'as':_0x3f9c87['as'],'attributes':_0x3f9c87[_0x3112('0x1d')],'include':_0x3f9c87[_0x3112('0x1f')]?_[_0x3112('0x20')](_0x3f9c87[_0x3112('0x1f')],function(_0x440595){return{'model':db[_0x440595[_0x3112('0x21')]],'as':_0x440595['as'],'attributes':_0x440595[_0x3112('0x1d')],'include':_0x440595[_0x3112('0x1f')]?_[_0x3112('0x20')](_0x440595[_0x3112('0x1f')],function(_0x25a287){return{'model':db[_0x25a287[_0x3112('0x21')]],'as':_0x25a287['as'],'attributes':_0x25a287['attributes']};}):[]};}):[]};}):[]:[]})[_0x3112('0xc')](function(_0x1621fa){logger[_0x3112('0xd')](_0x3112('0x23'),_0xbc9c8d);logger[_0x3112('0x10')]('ShowMailQueue',_0xbc9c8d,JSON[_0x3112('0x22')](_0x1621fa));_0xe9f442(_0x1621fa);})['catch'](function(_0xa0f707){logger['error'](_0x3112('0x23'),_0xa0f707[_0x3112('0x14')],_0xbc9c8d);_0x3cbbcf(_0x43cbc0['error'](0x1f4,_0xa0f707['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 10247aa..217dce9 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 _0xee14=['save','remove','removeListener','mailQueue:'];(function(_0x1efdbd,_0x5977e8){var _0x1534a5=function(_0x5311aa){while(--_0x5311aa){_0x1efdbd['push'](_0x1efdbd['shift']());}};_0x1534a5(++_0x5977e8);}(_0xee14,0x100));var _0x4ee1=function(_0x5e160f,_0x1b072d){_0x5e160f=_0x5e160f-0x0;var _0x5a8e67=_0xee14[_0x5e160f];return _0x5a8e67;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x4ee1('0x0'),_0x4ee1('0x1'),'update'];function createListener(_0x5e3d8b,_0x31b169){return function(_0x265977){_0x31b169['emit'](_0x5e3d8b,_0x265977);};}function removeListener(_0x3eb4d5,_0x1b8ea3){return function(){MailQueueEvents[_0x4ee1('0x2')](_0x3eb4d5,_0x1b8ea3);};}exports['register']=function(_0x14152e){for(var _0x10a44f=0x0,_0x2ae0c0=events['length'];_0x10a44f<_0x2ae0c0;_0x10a44f++){var _0x3f30dc=events[_0x10a44f];var _0xa4fa5b=createListener(_0x4ee1('0x3')+_0x3f30dc,_0x14152e);MailQueueEvents['on'](_0x3f30dc,_0xa4fa5b);}}; \ No newline at end of file +var _0x99b3=['register','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener'];(function(_0x34fb46,_0x2c9b1b){var _0x56800d=function(_0x6a1e81){while(--_0x6a1e81){_0x34fb46['push'](_0x34fb46['shift']());}};_0x56800d(++_0x2c9b1b);}(_0x99b3,0x14a));var _0x399b=function(_0x51ac04,_0x4c441a){_0x51ac04=_0x51ac04-0x0;var _0x461f81=_0x99b3[_0x51ac04];return _0x461f81;};'use strict';var MailQueueEvents=require(_0x399b('0x0'));var events=[_0x399b('0x1'),_0x399b('0x2'),_0x399b('0x3')];function createListener(_0xf8e2bc,_0x5a147c){return function(_0x2d2581){_0x5a147c[_0x399b('0x4')](_0xf8e2bc,_0x2d2581);};}function removeListener(_0x90cc5d,_0x4984d3){return function(){MailQueueEvents[_0x399b('0x5')](_0x90cc5d,_0x4984d3);};}exports[_0x399b('0x6')]=function(_0x4354ed){for(var _0x4faf0b=0x0,_0x371eaf=events['length'];_0x4faf0b<_0x371eaf;_0x4faf0b++){var _0x3c6fdc=events[_0x4faf0b];var _0x77bc95=createListener(_0x399b('0x7')+_0x3c6fdc,_0x4354ed);MailQueueEvents['on'](_0x3c6fdc,_0x77bc95);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f04836b..6d245d7 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 _0x56b9=['/describe','describe','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x56b9,0x11d));var _0x956b=function(_0x536e71,_0xd2c2c1){_0x536e71=_0x536e71-0x0;var _0x5f903e=_0x56b9[_0x536e71];return _0x5f903e;};'use strict';var multer=require(_0x956b('0x0'));var util=require('util');var path=require(_0x956b('0x1'));var timeout=require(_0x956b('0x2'));var express=require('express');var router=express[_0x956b('0x3')]();var auth=require(_0x956b('0x4'));var interaction=require(_0x956b('0x5'));var config=require(_0x956b('0x6'));var controller=require(_0x956b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x956b('0x8')]);router['get'](_0x956b('0x9'),auth['isAuthenticated'](),controller[_0x956b('0xa')]);router[_0x956b('0xb')](_0x956b('0xc'),auth[_0x956b('0xd')](),controller[_0x956b('0xe')]);router[_0x956b('0xf')]('/',auth[_0x956b('0xd')](),controller[_0x956b('0x10')]);router[_0x956b('0x11')](_0x956b('0xc'),auth[_0x956b('0xd')](),controller[_0x956b('0x12')]);router[_0x956b('0x13')]('/:id',auth[_0x956b('0xd')](),controller[_0x956b('0x14')]);module['exports']=router; \ No newline at end of file +var _0xbd71=['get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbd71,0x8a));var _0x1bd7=function(_0x152e24,_0x27eae7){_0x152e24=_0x152e24-0x0;var _0x5d6e6e=_0xbd71[_0x152e24];return _0x5d6e6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1bd7('0x0'));var timeout=require(_0x1bd7('0x1'));var express=require('express');var router=express[_0x1bd7('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1bd7('0x3'));var config=require(_0x1bd7('0x4'));var controller=require(_0x1bd7('0x5'));router[_0x1bd7('0x6')]('/',auth[_0x1bd7('0x7')](),controller[_0x1bd7('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1bd7('0x9')]);router['get'](_0x1bd7('0xa'),auth['isAuthenticated'](),controller[_0x1bd7('0xb')]);router[_0x1bd7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1bd7('0xd')](_0x1bd7('0xa'),auth[_0x1bd7('0x7')](),controller['update']);router[_0x1bd7('0xe')](_0x1bd7('0xa'),auth[_0x1bd7('0x7')](),controller[_0x1bd7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index fec9fc2..56e948d 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 _0xcd20=['STRING','DATE','moment','sequelize','exports'];(function(_0x11866f,_0x467cb1){var _0x16ba25=function(_0x3a95ef){while(--_0x3a95ef){_0x11866f['push'](_0x11866f['shift']());}};_0x16ba25(++_0x467cb1);}(_0xcd20,0x1d3));var _0x0cd2=function(_0x315cdd,_0x364667){_0x315cdd=_0x315cdd-0x0;var _0x21e583=_0xcd20[_0x315cdd];return _0x21e583;};'use strict';var moment=require(_0x0cd2('0x0'));var Sequelize=require(_0x0cd2('0x1'));module[_0x0cd2('0x2')]={'uniqueid':{'type':Sequelize[_0x0cd2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0cd2('0x3')]},'joinAt':{'type':Sequelize[_0x0cd2('0x4')]},'leaveAt':{'type':Sequelize[_0x0cd2('0x4')]},'acceptAt':{'type':Sequelize[_0x0cd2('0x4')]},'exitAt':{'type':Sequelize[_0x0cd2('0x4')]},'reason':{'type':Sequelize[_0x0cd2('0x3')]}}; \ No newline at end of file +var _0xe8d3=['sequelize','exports','STRING','DATE'];(function(_0x644dd7,_0x359e53){var _0x482ebb=function(_0x4e1d5d){while(--_0x4e1d5d){_0x644dd7['push'](_0x644dd7['shift']());}};_0x482ebb(++_0x359e53);}(_0xe8d3,0x84));var _0x3e8d=function(_0xa3965d,_0x4c5188){_0xa3965d=_0xa3965d-0x0;var _0x5cb1a2=_0xe8d3[_0xa3965d];return _0x5cb1a2;};'use strict';var moment=require('moment');var Sequelize=require(_0x3e8d('0x0'));module[_0x3e8d('0x1')]={'uniqueid':{'type':Sequelize[_0x3e8d('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3e8d('0x3')]},'acceptAt':{'type':Sequelize[_0x3e8d('0x3')]},'exitAt':{'type':Sequelize[_0x3e8d('0x3')]},'reason':{'type':Sequelize[_0x3e8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bcc3af2..11ae050 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 _0xd146=['fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','length','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','MailQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes'];(function(_0x23b7f7,_0x453675){var _0x555e34=function(_0x3e1495){while(--_0x3e1495){_0x23b7f7['push'](_0x23b7f7['shift']());}};_0x555e34(++_0x453675);}(_0xd146,0xf2));var _0x6d14=function(_0x5e8109,_0x258c6d){_0x5e8109=_0x5e8109-0x0;var _0x46fe74=_0xd146[_0x5e8109];return _0x46fe74;};'use strict';var pdf=require(_0x6d14('0x0'));var emlformat=require(_0x6d14('0x1'));var rimraf=require(_0x6d14('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d14('0x3'));var rp=require(_0x6d14('0x4'));var moment=require(_0x6d14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6d14('0x6'));var util=require(_0x6d14('0x7'));var path=require('path');var sox=require(_0x6d14('0x8'));var csv=require('to-csv');var ejs=require(_0x6d14('0x9'));var fs=require('fs');var _=require(_0x6d14('0xa'));var squel=require(_0x6d14('0xb'));var crypto=require(_0x6d14('0xc'));var jsforce=require(_0x6d14('0xd'));var deskjs=require(_0x6d14('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6d14('0xf'));var Papa=require(_0x6d14('0x10'));var Redis=require(_0x6d14('0x11'));var authService=require(_0x6d14('0x12'));var qs=require(_0x6d14('0x13'));var hardwareService=require(_0x6d14('0x14'));var logger=require(_0x6d14('0x15'))(_0x6d14('0x16'));var utils=require(_0x6d14('0x17'));var config=require('../../config/environment');var db=require(_0x6d14('0x18'))['db'];function respondWithStatusCode(_0x541d94,_0x5dad70){_0x5dad70=_0x5dad70||0xcc;return function(_0x2ebae0){if(_0x2ebae0){return _0x541d94['sendStatus'](_0x5dad70);}return _0x541d94[_0x6d14('0x19')](_0x5dad70)[_0x6d14('0x1a')]();};}function respondWithResult(_0x43c028,_0x3c8ebe){_0x3c8ebe=_0x3c8ebe||0xc8;return function(_0x5262ce){if(_0x5262ce){return _0x43c028[_0x6d14('0x19')](_0x3c8ebe)[_0x6d14('0x1b')](_0x5262ce);}};}function respondWithFilteredResult(_0x1a4906,_0x1ba9bc){return function(_0x237cd8){if(_0x237cd8){var _0x4a4ef0=_0x237cd8[_0x6d14('0x1c')],_0x12a07d=_0x1ba9bc[_0x6d14('0x1d')],_0x6bdc17=_0x1ba9bc[_0x6d14('0x1d')]+_0x1ba9bc[_0x6d14('0x1e')],_0x42cd8b;if(_0x6bdc17>=_0x4a4ef0){_0x6bdc17=_0x4a4ef0;_0x42cd8b=0xc8;}else{_0x42cd8b=0xce;}_0x1a4906[_0x6d14('0x19')](_0x42cd8b);return _0x1a4906['set'](_0x6d14('0x1f'),_0x12a07d+'-'+_0x6bdc17+'/'+_0x4a4ef0)[_0x6d14('0x1b')](_0x237cd8);}return null;};}function patchUpdates(_0x2e3bf6){return function(_0x3220da){try{jsonpatch[_0x6d14('0x20')](_0x3220da,_0x2e3bf6,!![]);}catch(_0x3f98e8){return BPromise[_0x6d14('0x21')](_0x3f98e8);}return _0x3220da[_0x6d14('0x22')]();};}function saveUpdates(_0x49b22b,_0x35d792){return function(_0xfaec3b){if(_0xfaec3b){return _0xfaec3b[_0x6d14('0x23')](_0x49b22b)[_0x6d14('0x24')](function(_0x297360){return _0x297360;});}return null;};}function removeEntity(_0x1419c1,_0x249240){return function(_0x3629ee){if(_0x3629ee){return _0x3629ee[_0x6d14('0x25')]()[_0x6d14('0x24')](function(){_0x1419c1['status'](0xcc)[_0x6d14('0x1a')]();});}};}function handleEntityNotFound(_0xad8dcf,_0x146315){return function(_0x2977ab){if(!_0x2977ab){_0xad8dcf[_0x6d14('0x26')](0x194);}return _0x2977ab;};}function handleError(_0x1351f1,_0x5bd6ed){_0x5bd6ed=_0x5bd6ed||0x1f4;return function(_0x164ac3){logger[_0x6d14('0x27')](_0x164ac3['stack']);if(_0x164ac3[_0x6d14('0x28')]){delete _0x164ac3[_0x6d14('0x28')];}_0x1351f1[_0x6d14('0x19')](_0x5bd6ed)[_0x6d14('0x29')](_0x164ac3);};}exports['index']=function(_0x5f07c5,_0x355a61){var _0x9aa9e8={},_0x1633ce={},_0x68754b={'count':0x0,'rows':[]};var _0x56d75c=db[_0x6d14('0x2a')][_0x6d14('0x2b')];_0x1633ce[_0x6d14('0x2c')]=_[_0x6d14('0x2d')](_0x56d75c);_0x1633ce[_0x6d14('0x2e')]=_[_0x6d14('0x2d')](_0x5f07c5[_0x6d14('0x2e')]);_0x1633ce[_0x6d14('0x2f')]=_[_0x6d14('0x30')](_0x1633ce[_0x6d14('0x2c')],_0x1633ce[_0x6d14('0x2e')]);_0x9aa9e8[_0x6d14('0x31')]=_[_0x6d14('0x30')](_0x1633ce[_0x6d14('0x2c')],qs[_0x6d14('0x32')](_0x5f07c5[_0x6d14('0x2e')]['fields']));_0x9aa9e8[_0x6d14('0x31')]=_0x9aa9e8[_0x6d14('0x31')]['length']?_0x9aa9e8[_0x6d14('0x31')]:_0x1633ce[_0x6d14('0x2c')];if(!_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x33')](_0x6d14('0x34'))){_0x9aa9e8[_0x6d14('0x1e')]=qs[_0x6d14('0x1e')](_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x1e')]);_0x9aa9e8[_0x6d14('0x1d')]=qs[_0x6d14('0x1d')](_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x1d')]);}_0x9aa9e8[_0x6d14('0x35')]=qs[_0x6d14('0x36')](_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x36')]);_0x9aa9e8['where']=qs[_0x6d14('0x2f')](_[_0x6d14('0x37')](_0x5f07c5['query'],_0x1633ce['filters']));if(_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x38')]){_0x9aa9e8[_0x6d14('0x39')]=_[_0x6d14('0x3a')](_0x9aa9e8[_0x6d14('0x39')],{'$or':_['map'](_0x56d75c,function(_0x10134c){if(_0x10134c['type'][_0x6d14('0x3b')]!==_0x6d14('0x3c')){var _0xde2dd0={};_0xde2dd0[_0x10134c[_0x6d14('0x3d')]]={'$like':'%'+_0x5f07c5[_0x6d14('0x2e')][_0x6d14('0x38')]+'%'};return _0xde2dd0;}})});}_0x9aa9e8=_[_0x6d14('0x3a')]({},_0x9aa9e8,_0x5f07c5[_0x6d14('0x3e')]);var _0x417529={'where':_0x9aa9e8['where']};return db[_0x6d14('0x2a')]['count'](_0x417529)[_0x6d14('0x24')](function(_0x110606){_0x68754b[_0x6d14('0x1c')]=_0x110606;if(_0x5f07c5['query'][_0x6d14('0x3f')]){_0x9aa9e8[_0x6d14('0x40')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6d14('0x41')](_0x9aa9e8);})[_0x6d14('0x24')](function(_0x2ac643){_0x68754b['rows']=_0x2ac643;return _0x68754b;})['then'](respondWithFilteredResult(_0x355a61,_0x9aa9e8))[_0x6d14('0x42')](handleError(_0x355a61,null));};exports['show']=function(_0x35af32,_0x3bd6ee){var _0x2f8d94={'raw':!![],'where':{'id':_0x35af32[_0x6d14('0x43')]['id']}},_0x40f5bc={};_0x40f5bc[_0x6d14('0x2c')]=_['keys'](db[_0x6d14('0x2a')][_0x6d14('0x2b')]);_0x40f5bc[_0x6d14('0x2e')]=_[_0x6d14('0x2d')](_0x35af32[_0x6d14('0x2e')]);_0x40f5bc[_0x6d14('0x2f')]=_[_0x6d14('0x30')](_0x40f5bc[_0x6d14('0x2c')],_0x40f5bc['query']);_0x2f8d94[_0x6d14('0x31')]=_[_0x6d14('0x30')](_0x40f5bc[_0x6d14('0x2c')],qs[_0x6d14('0x32')](_0x35af32['query'][_0x6d14('0x32')]));_0x2f8d94['attributes']=_0x2f8d94[_0x6d14('0x31')][_0x6d14('0x44')]?_0x2f8d94['attributes']:_0x40f5bc[_0x6d14('0x2c')];if(_0x35af32[_0x6d14('0x2e')]['includeAll']){_0x2f8d94[_0x6d14('0x40')]=[{'all':!![]}];}_0x2f8d94=_[_0x6d14('0x3a')]({},_0x2f8d94,_0x35af32[_0x6d14('0x3e')]);return db['MailQueueReport']['find'](_0x2f8d94)[_0x6d14('0x24')](handleEntityNotFound(_0x3bd6ee,null))[_0x6d14('0x24')](respondWithResult(_0x3bd6ee,null))[_0x6d14('0x42')](handleError(_0x3bd6ee,null));};exports['create']=function(_0xf6c444,_0x4878df){return db[_0x6d14('0x2a')][_0x6d14('0x45')](_0xf6c444['body'],{})[_0x6d14('0x24')](respondWithResult(_0x4878df,0xc9))[_0x6d14('0x42')](handleError(_0x4878df,null));};exports[_0x6d14('0x23')]=function(_0x18366e,_0x293ee4){if(_0x18366e['body']['id']){delete _0x18366e['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x18366e['params']['id']}})[_0x6d14('0x24')](handleEntityNotFound(_0x293ee4,null))['then'](saveUpdates(_0x18366e[_0x6d14('0x46')],null))[_0x6d14('0x24')](respondWithResult(_0x293ee4,null))[_0x6d14('0x42')](handleError(_0x293ee4,null));};exports[_0x6d14('0x25')]=function(_0x33e212,_0x4d872d){return db[_0x6d14('0x2a')][_0x6d14('0x47')]({'where':{'id':_0x33e212[_0x6d14('0x43')]['id']}})[_0x6d14('0x24')](handleEntityNotFound(_0x4d872d,null))[_0x6d14('0x24')](removeEntity(_0x4d872d,null))[_0x6d14('0x42')](handleError(_0x4d872d,null));};exports[_0x6d14('0x48')]=function(_0x3e6690,_0xe2cc25){return db['MailQueueReport'][_0x6d14('0x48')]()[_0x6d14('0x24')](respondWithResult(_0xe2cc25,null))[_0x6d14('0x42')](handleError(_0xe2cc25,null));}; \ No newline at end of file +var _0x09eb=['../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','MailQueueReport','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x16e47c,_0x28b449){var _0x47a327=function(_0x15bfc3){while(--_0x15bfc3){_0x16e47c['push'](_0x16e47c['shift']());}};_0x47a327(++_0x28b449);}(_0x09eb,0xc9));var _0xb09e=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x09eb[_0x912d27];return _0x31b918;};'use strict';var pdf=require(_0xb09e('0x0'));var emlformat=require(_0xb09e('0x1'));var rimraf=require(_0xb09e('0x2'));var zipdir=require(_0xb09e('0x3'));var jsonpatch=require(_0xb09e('0x4'));var rp=require('request-promise');var moment=require(_0xb09e('0x5'));var BPromise=require(_0xb09e('0x6'));var Mustache=require(_0xb09e('0x7'));var util=require(_0xb09e('0x8'));var path=require(_0xb09e('0x9'));var sox=require(_0xb09e('0xa'));var csv=require(_0xb09e('0xb'));var ejs=require(_0xb09e('0xc'));var fs=require('fs');var _=require(_0xb09e('0xd'));var squel=require(_0xb09e('0xe'));var crypto=require(_0xb09e('0xf'));var jsforce=require(_0xb09e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb09e('0xb'));var querystring=require(_0xb09e('0x11'));var Papa=require(_0xb09e('0x12'));var Redis=require(_0xb09e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb09e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb09e('0x15'))('api');var utils=require(_0xb09e('0x16'));var config=require(_0xb09e('0x17'));var db=require(_0xb09e('0x18'))['db'];function respondWithStatusCode(_0x3b081f,_0x201d4c){_0x201d4c=_0x201d4c||0xcc;return function(_0x272a0e){if(_0x272a0e){return _0x3b081f[_0xb09e('0x19')](_0x201d4c);}return _0x3b081f[_0xb09e('0x1a')](_0x201d4c)['end']();};}function respondWithResult(_0x414c5e,_0x53dba4){_0x53dba4=_0x53dba4||0xc8;return function(_0x5da485){if(_0x5da485){return _0x414c5e['status'](_0x53dba4)[_0xb09e('0x1b')](_0x5da485);}};}function respondWithFilteredResult(_0x5c8d60,_0x28962e){return function(_0x363b31){if(_0x363b31){var _0x24e442=_0x363b31[_0xb09e('0x1c')],_0x2c62f9=_0x28962e['offset'],_0x83a08a=_0x28962e[_0xb09e('0x1d')]+_0x28962e['limit'],_0x46649d;if(_0x83a08a>=_0x24e442){_0x83a08a=_0x24e442;_0x46649d=0xc8;}else{_0x46649d=0xce;}_0x5c8d60[_0xb09e('0x1a')](_0x46649d);return _0x5c8d60['set'](_0xb09e('0x1e'),_0x2c62f9+'-'+_0x83a08a+'/'+_0x24e442)['json'](_0x363b31);}return null;};}function patchUpdates(_0x133e0f){return function(_0x472176){try{jsonpatch[_0xb09e('0x1f')](_0x472176,_0x133e0f,!![]);}catch(_0xf1f87c){return BPromise['reject'](_0xf1f87c);}return _0x472176[_0xb09e('0x20')]();};}function saveUpdates(_0x4db1d7,_0x57b7ae){return function(_0x58e314){if(_0x58e314){return _0x58e314[_0xb09e('0x21')](_0x4db1d7)[_0xb09e('0x22')](function(_0x3605a1){return _0x3605a1;});}return null;};}function removeEntity(_0x127862,_0x2b7fcf){return function(_0x3a6af3){if(_0x3a6af3){return _0x3a6af3[_0xb09e('0x23')]()['then'](function(){_0x127862['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de1d7,_0x3f7f3d){return function(_0xe77006){if(!_0xe77006){_0x2de1d7[_0xb09e('0x19')](0x194);}return _0xe77006;};}function handleError(_0xebd4f7,_0x4102a3){_0x4102a3=_0x4102a3||0x1f4;return function(_0x4e3163){logger[_0xb09e('0x24')](_0x4e3163[_0xb09e('0x25')]);if(_0x4e3163[_0xb09e('0x26')]){delete _0x4e3163[_0xb09e('0x26')];}_0xebd4f7['status'](_0x4102a3)[_0xb09e('0x27')](_0x4e3163);};}exports[_0xb09e('0x28')]=function(_0x47bf11,_0x4feb16){var _0x423578={},_0x5ce22c={},_0x47ba20={'count':0x0,'rows':[]};var _0x1dc6cb=db['MailQueueReport']['rawAttributes'];_0x5ce22c[_0xb09e('0x29')]=_['keys'](_0x1dc6cb);_0x5ce22c[_0xb09e('0x2a')]=_[_0xb09e('0x2b')](_0x47bf11[_0xb09e('0x2a')]);_0x5ce22c['filters']=_[_0xb09e('0x2c')](_0x5ce22c[_0xb09e('0x29')],_0x5ce22c[_0xb09e('0x2a')]);_0x423578['attributes']=_[_0xb09e('0x2c')](_0x5ce22c[_0xb09e('0x29')],qs[_0xb09e('0x2d')](_0x47bf11['query'][_0xb09e('0x2d')]));_0x423578[_0xb09e('0x2e')]=_0x423578[_0xb09e('0x2e')][_0xb09e('0x2f')]?_0x423578[_0xb09e('0x2e')]:_0x5ce22c[_0xb09e('0x29')];if(!_0x47bf11[_0xb09e('0x2a')][_0xb09e('0x30')](_0xb09e('0x31'))){_0x423578['limit']=qs[_0xb09e('0x32')](_0x47bf11['query']['limit']);_0x423578[_0xb09e('0x1d')]=qs['offset'](_0x47bf11[_0xb09e('0x2a')][_0xb09e('0x1d')]);}_0x423578[_0xb09e('0x33')]=qs['sort'](_0x47bf11['query'][_0xb09e('0x34')]);_0x423578[_0xb09e('0x35')]=qs[_0xb09e('0x36')](_[_0xb09e('0x37')](_0x47bf11[_0xb09e('0x2a')],_0x5ce22c[_0xb09e('0x36')]));if(_0x47bf11[_0xb09e('0x2a')][_0xb09e('0x38')]){_0x423578[_0xb09e('0x35')]=_[_0xb09e('0x39')](_0x423578[_0xb09e('0x35')],{'$or':_[_0xb09e('0x3a')](_0x1dc6cb,function(_0x448792){if(_0x448792[_0xb09e('0x3b')][_0xb09e('0x3c')]!==_0xb09e('0x3d')){var _0x42728f={};_0x42728f[_0x448792[_0xb09e('0x3e')]]={'$like':'%'+_0x47bf11[_0xb09e('0x2a')][_0xb09e('0x38')]+'%'};return _0x42728f;}})});}_0x423578=_[_0xb09e('0x39')]({},_0x423578,_0x47bf11['options']);var _0x1f18b1={'where':_0x423578[_0xb09e('0x35')]};return db[_0xb09e('0x3f')]['count'](_0x1f18b1)[_0xb09e('0x22')](function(_0x57e386){_0x47ba20[_0xb09e('0x1c')]=_0x57e386;if(_0x47bf11[_0xb09e('0x2a')][_0xb09e('0x40')]){_0x423578[_0xb09e('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0xb09e('0x42')](_0x423578);})['then'](function(_0x5d6a89){_0x47ba20['rows']=_0x5d6a89;return _0x47ba20;})[_0xb09e('0x22')](respondWithFilteredResult(_0x4feb16,_0x423578))[_0xb09e('0x43')](handleError(_0x4feb16,null));};exports[_0xb09e('0x44')]=function(_0x3749bc,_0x7d3911){var _0x1a8b5d={'raw':!![],'where':{'id':_0x3749bc[_0xb09e('0x45')]['id']}},_0x25ea2b={};_0x25ea2b[_0xb09e('0x29')]=_['keys'](db[_0xb09e('0x3f')][_0xb09e('0x46')]);_0x25ea2b[_0xb09e('0x2a')]=_[_0xb09e('0x2b')](_0x3749bc[_0xb09e('0x2a')]);_0x25ea2b[_0xb09e('0x36')]=_[_0xb09e('0x2c')](_0x25ea2b[_0xb09e('0x29')],_0x25ea2b[_0xb09e('0x2a')]);_0x1a8b5d[_0xb09e('0x2e')]=_[_0xb09e('0x2c')](_0x25ea2b[_0xb09e('0x29')],qs['fields'](_0x3749bc[_0xb09e('0x2a')][_0xb09e('0x2d')]));_0x1a8b5d['attributes']=_0x1a8b5d[_0xb09e('0x2e')][_0xb09e('0x2f')]?_0x1a8b5d[_0xb09e('0x2e')]:_0x25ea2b[_0xb09e('0x29')];if(_0x3749bc[_0xb09e('0x2a')]['includeAll']){_0x1a8b5d[_0xb09e('0x41')]=[{'all':!![]}];}_0x1a8b5d=_['merge']({},_0x1a8b5d,_0x3749bc['options']);return db['MailQueueReport'][_0xb09e('0x47')](_0x1a8b5d)[_0xb09e('0x22')](handleEntityNotFound(_0x7d3911,null))[_0xb09e('0x22')](respondWithResult(_0x7d3911,null))[_0xb09e('0x43')](handleError(_0x7d3911,null));};exports[_0xb09e('0x48')]=function(_0x4be3cc,_0x276c67){return db[_0xb09e('0x3f')][_0xb09e('0x48')](_0x4be3cc[_0xb09e('0x49')],{})[_0xb09e('0x22')](respondWithResult(_0x276c67,0xc9))[_0xb09e('0x43')](handleError(_0x276c67,null));};exports[_0xb09e('0x21')]=function(_0x232b98,_0xbf3aa8){if(_0x232b98[_0xb09e('0x49')]['id']){delete _0x232b98[_0xb09e('0x49')]['id'];}return db[_0xb09e('0x3f')]['find']({'where':{'id':_0x232b98['params']['id']}})[_0xb09e('0x22')](handleEntityNotFound(_0xbf3aa8,null))[_0xb09e('0x22')](saveUpdates(_0x232b98[_0xb09e('0x49')],null))['then'](respondWithResult(_0xbf3aa8,null))['catch'](handleError(_0xbf3aa8,null));};exports[_0xb09e('0x23')]=function(_0x50ac50,_0x1d966a){return db[_0xb09e('0x3f')][_0xb09e('0x47')]({'where':{'id':_0x50ac50[_0xb09e('0x45')]['id']}})[_0xb09e('0x22')](handleEntityNotFound(_0x1d966a,null))[_0xb09e('0x22')](removeEntity(_0x1d966a,null))[_0xb09e('0x43')](handleError(_0x1d966a,null));};exports[_0xb09e('0x4a')]=function(_0xddd494,_0x37945a){return db['MailQueueReport'][_0xb09e('0x4a')]()[_0xb09e('0x22')](respondWithResult(_0x37945a,null))['catch'](handleError(_0x37945a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 5b4bbd8..36d4111 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 _0x0647=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x0647,0xd0));var _0x7064=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x0647[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var logger=require(_0x7064('0x1'))(_0x7064('0x2'));var moment=require(_0x7064('0x3'));var BPromise=require(_0x7064('0x4'));var rp=require(_0x7064('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7064('0x6'));var attributes=require(_0x7064('0x7'));module[_0x7064('0x8')]=function(_0x44b1bb,_0x2b6f9b){return _0x44b1bb[_0x7064('0x9')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7064('0xa'),'fields':[_0x7064('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8cc8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x2ea3a2,_0x5f39ac){var _0x4b098a=function(_0x1a520a){while(--_0x1a520a){_0x2ea3a2['push'](_0x2ea3a2['shift']());}};_0x4b098a(++_0x5f39ac);}(_0x8cc8,0x177));var _0x88cc=function(_0x2f52a2,_0x3c1d4c){_0x2f52a2=_0x2f52a2-0x0;var _0x2bb463=_0x8cc8[_0x2f52a2];return _0x2bb463;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var logger=require(_0x88cc('0x2'))(_0x88cc('0x3'));var moment=require(_0x88cc('0x4'));var BPromise=require(_0x88cc('0x5'));var rp=require(_0x88cc('0x6'));var fs=require('fs');var path=require(_0x88cc('0x7'));var rimraf=require(_0x88cc('0x8'));var config=require(_0x88cc('0x9'));var attributes=require(_0x88cc('0xa'));module[_0x88cc('0xb')]=function(_0x1683f9,_0x525362){return _0x1683f9['define'](_0x88cc('0xc'),attributes,{'tableName':_0x88cc('0xd'),'paranoid':![],'indexes':[{'name':_0x88cc('0xe'),'fields':[_0x88cc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 768def1..e3da6a2 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 _0x3b7e=['catch','CreateMailQueueReport','MailQueueReport','create','body','options','UpdateMailQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x47f23d,_0x286a33){var _0x526f97=function(_0x44ff9c){while(--_0x44ff9c){_0x47f23d['push'](_0x47f23d['shift']());}};_0x526f97(++_0x286a33);}(_0x3b7e,0xd7));var _0xe3b7=function(_0x437b5d,_0x48a06d){_0x437b5d=_0x437b5d-0x0;var _0x21362c=_0x3b7e[_0x437b5d];return _0x21362c;};'use strict';var _=require(_0xe3b7('0x0'));var util=require(_0xe3b7('0x1'));var moment=require(_0xe3b7('0x2'));var BPromise=require(_0xe3b7('0x3'));var rs=require(_0xe3b7('0x4'));var fs=require('fs');var Redis=require(_0xe3b7('0x5'));var db=require(_0xe3b7('0x6'))['db'];var utils=require(_0xe3b7('0x7'));var logger=require(_0xe3b7('0x8'))(_0xe3b7('0x9'));var config=require(_0xe3b7('0xa'));var jayson=require(_0xe3b7('0xb'));var client=jayson['client'][_0xe3b7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x269775,_0x4e0027,_0x3bb46d){return new BPromise(function(_0x535f07,_0xf32aac){return client[_0xe3b7('0xd')](_0x269775,_0x3bb46d)[_0xe3b7('0xe')](function(_0x1a0b47){logger[_0xe3b7('0xf')](_0xe3b7('0x10'),_0x4e0027,_0xe3b7('0x11'));logger[_0xe3b7('0x12')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x4e0027,_0xe3b7('0x11'),JSON[_0xe3b7('0x13')](_0x1a0b47));if(_0x1a0b47[_0xe3b7('0x14')]){if(_0x1a0b47[_0xe3b7('0x14')][_0xe3b7('0x15')]===0x1f4){logger['error'](_0xe3b7('0x10'),_0x4e0027,_0x1a0b47[_0xe3b7('0x14')][_0xe3b7('0x16')]);return _0xf32aac(_0x1a0b47[_0xe3b7('0x14')][_0xe3b7('0x16')]);}logger[_0xe3b7('0x14')](_0xe3b7('0x10'),_0x4e0027,_0x1a0b47[_0xe3b7('0x14')]['message']);return _0x535f07(_0x1a0b47[_0xe3b7('0x14')][_0xe3b7('0x16')]);}else{logger[_0xe3b7('0xf')](_0xe3b7('0x10'),_0x4e0027,'request\x20sent');_0x535f07(_0x1a0b47['result'][_0xe3b7('0x16')]);}})[_0xe3b7('0x17')](function(_0x1a5c69){logger[_0xe3b7('0x14')](_0xe3b7('0x10'),_0x4e0027,_0x1a5c69);_0xf32aac(_0x1a5c69);});});}exports[_0xe3b7('0x18')]=function(_0x282e54){var _0x547d67=this;return new Promise(function(_0x16c566,_0x45e9b8){return db[_0xe3b7('0x19')][_0xe3b7('0x1a')](_0x282e54[_0xe3b7('0x1b')],{'raw':_0x282e54[_0xe3b7('0x1c')]?_0x282e54[_0xe3b7('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x194200){logger[_0xe3b7('0xf')](_0xe3b7('0x18'),_0x282e54);logger['debug']('CreateMailQueueReport',_0x282e54,JSON[_0xe3b7('0x13')](_0x194200));_0x16c566(_0x194200);})[_0xe3b7('0x17')](function(_0x2351e0){logger[_0xe3b7('0x14')](_0xe3b7('0x18'),_0x2351e0[_0xe3b7('0x16')],_0x282e54);_0x45e9b8(_0x547d67[_0xe3b7('0x14')](0x1f4,_0x2351e0[_0xe3b7('0x16')]));});});};exports[_0xe3b7('0x1d')]=function(_0x1675c6){var _0x4d9d56=this;return new Promise(function(_0x38c78c,_0x57952d){return db[_0xe3b7('0x19')][_0xe3b7('0x1e')](_0x1675c6[_0xe3b7('0x1b')],{'raw':_0x1675c6[_0xe3b7('0x1c')]?_0x1675c6['options'][_0xe3b7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1675c6['options']?_0x1675c6[_0xe3b7('0x1c')][_0xe3b7('0x20')]||null:null,'attributes':_0x1675c6['options']?_0x1675c6[_0xe3b7('0x1c')][_0xe3b7('0x21')]||null:null,'limit':_0x1675c6[_0xe3b7('0x1c')]?_0x1675c6[_0xe3b7('0x1c')]['limit']||null:null})[_0xe3b7('0xe')](function(_0xdd5964){logger['info'](_0xe3b7('0x1d'),_0x1675c6);logger['debug']('UpdateMailQueueReport',_0x1675c6,JSON[_0xe3b7('0x13')](_0xdd5964));_0x38c78c(_0xdd5964);})[_0xe3b7('0x17')](function(_0x2f11a4){logger[_0xe3b7('0x14')](_0xe3b7('0x1d'),_0x2f11a4[_0xe3b7('0x16')],_0x1675c6);_0x57952d(_0x4d9d56[_0xe3b7('0x14')](0x1f4,_0x2f11a4[_0xe3b7('0x16')]));});});}; \ No newline at end of file +var _0x14ed=['util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueueReport,\x20%s,\x20%s','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','debug','UpdateMailQueueReport','update','where','attributes','limit','lodash'];(function(_0x2e803e,_0x33e40a){var _0x1bf22c=function(_0x3924e3){while(--_0x3924e3){_0x2e803e['push'](_0x2e803e['shift']());}};_0x1bf22c(++_0x33e40a);}(_0x14ed,0x65));var _0xd14e=function(_0x271e5,_0x27d591){_0x271e5=_0x271e5-0x0;var _0x395e95=_0x14ed[_0x271e5];return _0x395e95;};'use strict';var _=require(_0xd14e('0x0'));var util=require(_0xd14e('0x1'));var moment=require(_0xd14e('0x2'));var BPromise=require(_0xd14e('0x3'));var rs=require(_0xd14e('0x4'));var fs=require('fs');var Redis=require(_0xd14e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd14e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd14e('0x7'));var client=jayson[_0xd14e('0x8')][_0xd14e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da85f,_0x1a064a,_0x55e56e){return new BPromise(function(_0x4c64c4,_0x35bfe6){return client[_0xd14e('0xa')](_0x5da85f,_0x55e56e)[_0xd14e('0xb')](function(_0x215084){logger[_0xd14e('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x1a064a,_0xd14e('0xd'));logger['debug'](_0xd14e('0xe'),_0x1a064a,_0xd14e('0xd'),JSON[_0xd14e('0xf')](_0x215084));if(_0x215084[_0xd14e('0x10')]){if(_0x215084[_0xd14e('0x10')][_0xd14e('0x11')]===0x1f4){logger[_0xd14e('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x1a064a,_0x215084['error']['message']);return _0x35bfe6(_0x215084['error'][_0xd14e('0x12')]);}logger['error'](_0xd14e('0x13'),_0x1a064a,_0x215084[_0xd14e('0x10')][_0xd14e('0x12')]);return _0x4c64c4(_0x215084[_0xd14e('0x10')]['message']);}else{logger[_0xd14e('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x1a064a,_0xd14e('0xd'));_0x4c64c4(_0x215084[_0xd14e('0x14')]['message']);}})[_0xd14e('0x15')](function(_0x5adaa0){logger[_0xd14e('0x10')](_0xd14e('0x13'),_0x1a064a,_0x5adaa0);_0x35bfe6(_0x5adaa0);});});}exports[_0xd14e('0x16')]=function(_0x483848){var _0x2e48ee=this;return new Promise(function(_0x4f3b5c,_0x24ddcc){return db[_0xd14e('0x17')][_0xd14e('0x18')](_0x483848[_0xd14e('0x19')],{'raw':_0x483848[_0xd14e('0x1a')]?_0x483848['options'][_0xd14e('0x1b')]===undefined?!![]:![]:!![]})[_0xd14e('0xb')](function(_0x8e497c){logger[_0xd14e('0xc')](_0xd14e('0x16'),_0x483848);logger[_0xd14e('0x1c')]('CreateMailQueueReport',_0x483848,JSON[_0xd14e('0xf')](_0x8e497c));_0x4f3b5c(_0x8e497c);})[_0xd14e('0x15')](function(_0x15570b){logger[_0xd14e('0x10')](_0xd14e('0x16'),_0x15570b[_0xd14e('0x12')],_0x483848);_0x24ddcc(_0x2e48ee[_0xd14e('0x10')](0x1f4,_0x15570b['message']));});});};exports[_0xd14e('0x1d')]=function(_0x504e2c){var _0x5a655e=this;return new Promise(function(_0xcdcf93,_0x8f8f78){return db['MailQueueReport'][_0xd14e('0x1e')](_0x504e2c[_0xd14e('0x19')],{'raw':_0x504e2c[_0xd14e('0x1a')]?_0x504e2c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504e2c['options']?_0x504e2c[_0xd14e('0x1a')][_0xd14e('0x1f')]||null:null,'attributes':_0x504e2c[_0xd14e('0x1a')]?_0x504e2c['options'][_0xd14e('0x20')]||null:null,'limit':_0x504e2c[_0xd14e('0x1a')]?_0x504e2c[_0xd14e('0x1a')][_0xd14e('0x21')]||null:null})[_0xd14e('0xb')](function(_0x27aa4b){logger[_0xd14e('0xc')](_0xd14e('0x1d'),_0x504e2c);logger[_0xd14e('0x1c')]('UpdateMailQueueReport',_0x504e2c,JSON[_0xd14e('0xf')](_0x27aa4b));_0xcdcf93(_0x27aa4b);})[_0xd14e('0x15')](function(_0x32fad1){logger[_0xd14e('0x10')](_0xd14e('0x1d'),_0x32fad1['message'],_0x504e2c);_0x8f8f78(_0x5a655e['error'](0x1f4,_0x32fad1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 84393a9..7fa9030 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 _0x81c6=['Router','../../components/auth/service','../../components/interaction/service','exports','util'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x81c6,0x1d5));var _0x681c=function(_0xb71c35,_0x129343){_0xb71c35=_0xb71c35-0x0;var _0x39224f=_0x81c6[_0xb71c35];return _0x39224f;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var auth=require(_0x681c('0x2'));var interaction=require(_0x681c('0x3'));var config=require('../../config/environment');module[_0x681c('0x4')]=router; \ No newline at end of file +var _0xa786=['exports','multer','util','path','express','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa786,0x71));var _0x6a78=function(_0x33ef5c,_0x38c0b3){_0x33ef5c=_0x33ef5c-0x0;var _0xa8a39e=_0xa786[_0x33ef5c];return _0xa8a39e;};'use strict';var multer=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var path=require(_0x6a78('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a78('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6a78('0x4'));var config=require(_0x6a78('0x5'));module[_0x6a78('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 6d7e65f..f35751e 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 _0xe28e=['INBOX','sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x1489ef,_0x275d93){var _0x20e0e6=function(_0x26c449){while(--_0x26c449){_0x1489ef['push'](_0x1489ef['shift']());}};_0x20e0e6(++_0x275d93);}(_0xe28e,0x1ba));var _0xee28=function(_0x465b71,_0x6f65fb){_0x465b71=_0x465b71-0x0;var _0x17cd09=_0xe28e[_0x465b71];return _0x17cd09;};'use strict';var Sequelize=require(_0xee28('0x0'));module[_0xee28('0x1')]={'description':{'type':Sequelize[_0xee28('0x2')]},'host':{'type':Sequelize[_0xee28('0x2')]},'authentication':{'type':Sequelize[_0xee28('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xee28('0x2')],'unique':_0xee28('0x4')},'password':{'type':Sequelize[_0xee28('0x2')]},'port':{'type':Sequelize[_0xee28('0x5')]},'tls':{'type':Sequelize[_0xee28('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xee28('0x2')],'defaultValue':_0xee28('0x6')},'connTimeout':{'type':Sequelize[_0xee28('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xee28('0x2')]}}; \ No newline at end of file +var _0x6f7a=['INTEGER','BOOLEAN','INBOX','sequelize','exports','STRING','username'];(function(_0x228798,_0x3f9eb2){var _0x275304=function(_0x2469c0){while(--_0x2469c0){_0x228798['push'](_0x228798['shift']());}};_0x275304(++_0x3f9eb2);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5becf7,_0x5da0c5){_0x5becf7=_0x5becf7-0x0;var _0x5f40b4=_0x6f7a[_0x5becf7];return _0x5f40b4;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'description':{'type':Sequelize[_0xa6f7('0x2')]},'host':{'type':Sequelize[_0xa6f7('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xa6f7('0x2')],'unique':_0xa6f7('0x3')},'password':{'type':Sequelize[_0xa6f7('0x2')]},'port':{'type':Sequelize[_0xa6f7('0x4')]},'tls':{'type':Sequelize[_0xa6f7('0x5')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa6f7('0x2')],'defaultValue':_0xa6f7('0x6')},'connTimeout':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa6f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index f84e5b1..31b93dd 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 _0xf730=['bluebird','request-promise','rimraf','../../config/environment','exports','define','MailServerIn','lodash','util','../../config/logger'];(function(_0x13541e,_0x3a44fb){var _0x2ebb9a=function(_0x1b43d6){while(--_0x1b43d6){_0x13541e['push'](_0x13541e['shift']());}};_0x2ebb9a(++_0x3a44fb);}(_0xf730,0xbb));var _0x0f73=function(_0x4cefbc,_0x3ffa6c){_0x4cefbc=_0x4cefbc-0x0;var _0x423c86=_0xf730[_0x4cefbc];return _0x423c86;};'use strict';var _=require(_0x0f73('0x0'));var util=require(_0x0f73('0x1'));var logger=require(_0x0f73('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f73('0x3'));var rp=require(_0x0f73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f73('0x5'));var config=require(_0x0f73('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x0f73('0x7')]=function(_0x376d11,_0x525d7d){return _0x376d11[_0x0f73('0x8')](_0x0f73('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger','api','moment'];(function(_0x11b39d,_0x183501){var _0x3bfa1c=function(_0x3d0356){while(--_0x3d0356){_0x11b39d['push'](_0x11b39d['shift']());}};_0x3bfa1c(++_0x183501);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ec6a3,_0x8605b7){_0x4ec6a3=_0x4ec6a3-0x0;var _0x2179e9=_0x5f2f[_0x4ec6a3];return _0x2179e9;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'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 ec6bc43..f96c2ae 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 _0xde25=['options','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll'];(function(_0x5515d1,_0x40adf6){var _0x1c4c55=function(_0x13dec3){while(--_0x13dec3){_0x5515d1['push'](_0x5515d1['shift']());}};_0x1c4c55(++_0x40adf6);}(_0xde25,0x132));var _0x5de2=function(_0x335d99,_0x26aef3){_0x335d99=_0x335d99-0x0;var _0x143bac=_0xde25[_0x335d99];return _0x143bac;};'use strict';var _=require(_0x5de2('0x0'));var util=require(_0x5de2('0x1'));var moment=require(_0x5de2('0x2'));var BPromise=require(_0x5de2('0x3'));var rs=require(_0x5de2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5de2('0x5'))['db'];var utils=require(_0x5de2('0x6'));var logger=require(_0x5de2('0x7'))('rpc');var config=require(_0x5de2('0x8'));var jayson=require(_0x5de2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36a0fa,_0x19f9a1,_0xc58562){return new BPromise(function(_0x129a57,_0xe1a380){return client[_0x5de2('0xa')](_0x36a0fa,_0xc58562)[_0x5de2('0xb')](function(_0x4cf296){logger[_0x5de2('0xc')](_0x5de2('0xd'),_0x19f9a1,_0x5de2('0xe'));logger[_0x5de2('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x19f9a1,'request\x20sent',JSON['stringify'](_0x4cf296));if(_0x4cf296[_0x5de2('0x10')]){if(_0x4cf296['error'][_0x5de2('0x11')]===0x1f4){logger['error'](_0x5de2('0xd'),_0x19f9a1,_0x4cf296[_0x5de2('0x10')][_0x5de2('0x12')]);return _0xe1a380(_0x4cf296[_0x5de2('0x10')]['message']);}logger[_0x5de2('0x10')](_0x5de2('0xd'),_0x19f9a1,_0x4cf296[_0x5de2('0x10')]['message']);return _0x129a57(_0x4cf296[_0x5de2('0x10')]['message']);}else{logger[_0x5de2('0xc')]('MailServerIn,\x20%s,\x20%s',_0x19f9a1,_0x5de2('0xe'));_0x129a57(_0x4cf296[_0x5de2('0x13')][_0x5de2('0x12')]);}})[_0x5de2('0x14')](function(_0xd330f0){logger[_0x5de2('0x10')](_0x5de2('0xd'),_0x19f9a1,_0xd330f0);_0xe1a380(_0xd330f0);});});}exports[_0x5de2('0x15')]=function(_0x16e6ca){var _0xc50a3=this;return new Promise(function(_0x5eb8d8,_0x1639d0){return db[_0x5de2('0x16')][_0x5de2('0x17')]({'raw':_0x16e6ca[_0x5de2('0x18')]?_0x16e6ca['options']['raw']===undefined?!![]:![]:!![],'where':_0x16e6ca[_0x5de2('0x18')]?_0x16e6ca[_0x5de2('0x18')]['where']||null:null,'attributes':_0x16e6ca['options']?_0x16e6ca[_0x5de2('0x18')][_0x5de2('0x19')]||null:null,'limit':_0x16e6ca['options']?_0x16e6ca[_0x5de2('0x18')][_0x5de2('0x1a')]||null:null,'include':_0x16e6ca['options']?_0x16e6ca[_0x5de2('0x18')][_0x5de2('0x1b')]?_[_0x5de2('0x1c')](_0x16e6ca[_0x5de2('0x18')]['include'],function(_0x58410c){return{'model':db[_0x58410c[_0x5de2('0x1d')]],'as':_0x58410c['as'],'attributes':_0x58410c[_0x5de2('0x19')],'include':_0x58410c[_0x5de2('0x1b')]?_[_0x5de2('0x1c')](_0x58410c[_0x5de2('0x1b')],function(_0xe2456f){return{'model':db[_0xe2456f[_0x5de2('0x1d')]],'as':_0xe2456f['as'],'attributes':_0xe2456f[_0x5de2('0x19')],'include':_0xe2456f[_0x5de2('0x1b')]?_[_0x5de2('0x1c')](_0xe2456f[_0x5de2('0x1b')],function(_0x1d77f9){return{'model':db[_0x1d77f9[_0x5de2('0x1d')]],'as':_0x1d77f9['as'],'attributes':_0x1d77f9[_0x5de2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5de2('0xb')](function(_0x271d15){logger[_0x5de2('0xc')](_0x5de2('0x15'),_0x16e6ca);logger['debug'](_0x5de2('0x15'),_0x16e6ca,JSON['stringify'](_0x271d15));_0x5eb8d8(_0x271d15);})[_0x5de2('0x14')](function(_0xa425ad){logger['error']('GetMailServerIn',_0xa425ad[_0x5de2('0x12')],_0x16e6ca);_0x1639d0(_0xc50a3['error'](0x1f4,_0xa425ad[_0x5de2('0x12')]));});});}; \ No newline at end of file +var _0xd957=['options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetMailServerIn','MailServerIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd957,0xc1));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var moment=require('moment');var BPromise=require(_0x7d95('0x2'));var rs=require(_0x7d95('0x3'));var fs=require('fs');var Redis=require(_0x7d95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d95('0x5'));var logger=require('../../config/logger')(_0x7d95('0x6'));var config=require(_0x7d95('0x7'));var jayson=require(_0x7d95('0x8'));var client=jayson[_0x7d95('0x9')][_0x7d95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f83e6,_0x1e2382,_0x4795e5){return new BPromise(function(_0x3f339c,_0x5d8ae6){return client[_0x7d95('0xb')](_0x3f83e6,_0x4795e5)[_0x7d95('0xc')](function(_0x298788){logger[_0x7d95('0xd')](_0x7d95('0xe'),_0x1e2382,'request\x20sent');logger[_0x7d95('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1e2382,_0x7d95('0x10'),JSON[_0x7d95('0x11')](_0x298788));if(_0x298788[_0x7d95('0x12')]){if(_0x298788[_0x7d95('0x12')][_0x7d95('0x13')]===0x1f4){logger['error'](_0x7d95('0xe'),_0x1e2382,_0x298788[_0x7d95('0x12')][_0x7d95('0x14')]);return _0x5d8ae6(_0x298788[_0x7d95('0x12')]['message']);}logger['error'](_0x7d95('0xe'),_0x1e2382,_0x298788['error'][_0x7d95('0x14')]);return _0x3f339c(_0x298788[_0x7d95('0x12')][_0x7d95('0x14')]);}else{logger[_0x7d95('0xd')](_0x7d95('0xe'),_0x1e2382,'request\x20sent');_0x3f339c(_0x298788['result']['message']);}})[_0x7d95('0x15')](function(_0x3d9bdd){logger[_0x7d95('0x12')](_0x7d95('0xe'),_0x1e2382,_0x3d9bdd);_0x5d8ae6(_0x3d9bdd);});});}exports[_0x7d95('0x16')]=function(_0x3b6a8a){var _0x51f868=this;return new Promise(function(_0x2eaa9c,_0x3b130c){return db[_0x7d95('0x17')]['findAll']({'raw':_0x3b6a8a[_0x7d95('0x18')]?_0x3b6a8a[_0x7d95('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3b6a8a['options']?_0x3b6a8a[_0x7d95('0x18')][_0x7d95('0x19')]||null:null,'attributes':_0x3b6a8a['options']?_0x3b6a8a[_0x7d95('0x18')][_0x7d95('0x1a')]||null:null,'limit':_0x3b6a8a['options']?_0x3b6a8a[_0x7d95('0x18')][_0x7d95('0x1b')]||null:null,'include':_0x3b6a8a['options']?_0x3b6a8a[_0x7d95('0x18')][_0x7d95('0x1c')]?_[_0x7d95('0x1d')](_0x3b6a8a['options'][_0x7d95('0x1c')],function(_0x136f26){return{'model':db[_0x136f26[_0x7d95('0x1e')]],'as':_0x136f26['as'],'attributes':_0x136f26['attributes'],'include':_0x136f26[_0x7d95('0x1c')]?_['map'](_0x136f26['include'],function(_0x46330b){return{'model':db[_0x46330b[_0x7d95('0x1e')]],'as':_0x46330b['as'],'attributes':_0x46330b[_0x7d95('0x1a')],'include':_0x46330b['include']?_[_0x7d95('0x1d')](_0x46330b[_0x7d95('0x1c')],function(_0x17243b){return{'model':db[_0x17243b[_0x7d95('0x1e')]],'as':_0x17243b['as'],'attributes':_0x17243b[_0x7d95('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7d95('0xc')](function(_0x3a78c4){logger['info'](_0x7d95('0x16'),_0x3b6a8a);logger[_0x7d95('0xf')](_0x7d95('0x16'),_0x3b6a8a,JSON[_0x7d95('0x11')](_0x3a78c4));_0x2eaa9c(_0x3a78c4);})['catch'](function(_0x3906a1){logger[_0x7d95('0x12')](_0x7d95('0x16'),_0x3906a1[_0x7d95('0x14')],_0x3b6a8a);_0x3b130c(_0x51f868[_0x7d95('0x12')](0x1f4,_0x3906a1[_0x7d95('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index cca571a..bebe788 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 _0x30c0=['/:id','isAuthenticated','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x30c0,0x14a));var _0x030c=function(_0x3406ce,_0x17948b){_0x3406ce=_0x3406ce-0x0;var _0x6b38=_0x30c0[_0x3406ce];return _0x6b38;};'use strict';var multer=require(_0x030c('0x0'));var util=require(_0x030c('0x1'));var path=require(_0x030c('0x2'));var timeout=require(_0x030c('0x3'));var express=require(_0x030c('0x4'));var router=express[_0x030c('0x5')]();var auth=require(_0x030c('0x6'));var interaction=require(_0x030c('0x7'));var config=require(_0x030c('0x8'));var controller=require(_0x030c('0x9'));router[_0x030c('0xa')]('/',auth['isAuthenticated'](),controller[_0x030c('0xb')]);router['get'](_0x030c('0xc'),auth[_0x030c('0xd')](),controller['show']);router[_0x030c('0xe')]('/',auth[_0x030c('0xd')](),controller[_0x030c('0xf')]);router['put'](_0x030c('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x030c('0xc'),auth['isAuthenticated'](),controller[_0x030c('0x10')]);module[_0x030c('0x11')]=router; \ No newline at end of file +var _0x45b1=['get','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index'];(function(_0x44511e,_0x2242ba){var _0x243798=function(_0x29a312){while(--_0x29a312){_0x44511e['push'](_0x44511e['shift']());}};_0x243798(++_0x2242ba);}(_0x45b1,0xa1));var _0x145b=function(_0x5a569b,_0x43503c){_0x5a569b=_0x5a569b-0x0;var _0x1b5bf4=_0x45b1[_0x5a569b];return _0x1b5bf4;};'use strict';var multer=require(_0x145b('0x0'));var util=require(_0x145b('0x1'));var path=require(_0x145b('0x2'));var timeout=require('connect-timeout');var express=require(_0x145b('0x3'));var router=express[_0x145b('0x4')]();var auth=require(_0x145b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x145b('0x6'));var controller=require(_0x145b('0x7'));router['get']('/',auth[_0x145b('0x8')](),controller[_0x145b('0x9')]);router[_0x145b('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x145b('0xb')]('/',auth[_0x145b('0x8')](),controller[_0x145b('0xc')]);router[_0x145b('0xd')](_0x145b('0xe'),auth[_0x145b('0x8')](),controller[_0x145b('0xf')]);router[_0x145b('0x10')](_0x145b('0xe'),auth['isAuthenticated'](),controller[_0x145b('0x11')]);module[_0x145b('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0bf66f1..ae3f358 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 _0x64de=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x64de,0x90));var _0xe64d=function(_0xe30494,_0x5940ff){_0xe30494=_0xe30494-0x0;var _0x8e9615=_0x64de[_0xe30494];return _0x8e9615;};'use strict';var Sequelize=require('sequelize');module[_0xe64d('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe64d('0x1')]},'user':{'type':Sequelize[_0xe64d('0x1')]},'pass':{'type':Sequelize[_0xe64d('0x1')]},'port':{'type':Sequelize[_0xe64d('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe64d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6680=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4e25fe,_0x24b0c2){var _0x17fc4d=function(_0x57a3c2){while(--_0x57a3c2){_0x4e25fe['push'](_0x4e25fe['shift']());}};_0x17fc4d(++_0x24b0c2);}(_0x6680,0x1d4));var _0x0668=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x6680[_0x28f32c];return _0x355402;};'use strict';var Sequelize=require(_0x0668('0x0'));module[_0x0668('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0668('0x2')]},'user':{'type':Sequelize[_0x0668('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0668('0x3')]},'secure':{'type':Sequelize[_0x0668('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x0668('0x2')]},'authentication':{'type':Sequelize[_0x0668('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 4eacd4a..2e0e4a1 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 _0x3d9e=['offset','limit','set','then','name','send','index','MailServerOut','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','show','params','catch','create','update','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x53bdd1,_0x3f29e8){var _0x291016=function(_0x1fb28c){while(--_0x1fb28c){_0x53bdd1['push'](_0x53bdd1['shift']());}};_0x291016(++_0x3f29e8);}(_0x3d9e,0x70));var _0xe3d9=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x3d9e[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0xe3d9('0x0'));var emlformat=require(_0xe3d9('0x1'));var rimraf=require(_0xe3d9('0x2'));var zipdir=require(_0xe3d9('0x3'));var jsonpatch=require(_0xe3d9('0x4'));var rp=require(_0xe3d9('0x5'));var moment=require(_0xe3d9('0x6'));var BPromise=require(_0xe3d9('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe3d9('0x8'));var csv=require(_0xe3d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3d9('0xa'));var squel=require(_0xe3d9('0xb'));var crypto=require(_0xe3d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe3d9('0xd'));var toCsv=require(_0xe3d9('0x9'));var querystring=require(_0xe3d9('0xe'));var Papa=require(_0xe3d9('0xf'));var Redis=require(_0xe3d9('0x10'));var authService=require(_0xe3d9('0x11'));var qs=require(_0xe3d9('0x12'));var hardwareService=require(_0xe3d9('0x13'));var logger=require(_0xe3d9('0x14'))(_0xe3d9('0x15'));var utils=require('../../config/utils');var config=require(_0xe3d9('0x16'));var db=require(_0xe3d9('0x17'))['db'];function respondWithStatusCode(_0x947699,_0xaf52f6){_0xaf52f6=_0xaf52f6||0xcc;return function(_0x40b2aa){if(_0x40b2aa){return _0x947699[_0xe3d9('0x18')](_0xaf52f6);}return _0x947699[_0xe3d9('0x19')](_0xaf52f6)[_0xe3d9('0x1a')]();};}function respondWithResult(_0x27e01a,_0x3bc035){_0x3bc035=_0x3bc035||0xc8;return function(_0x11f508){if(_0x11f508){return _0x27e01a[_0xe3d9('0x19')](_0x3bc035)[_0xe3d9('0x1b')](_0x11f508);}};}function respondWithFilteredResult(_0x47d495,_0x3eec8b){return function(_0x1fff72){if(_0x1fff72){var _0x541a33=_0x1fff72['count'],_0x349c81=_0x3eec8b[_0xe3d9('0x1c')],_0x2c005f=_0x3eec8b[_0xe3d9('0x1c')]+_0x3eec8b[_0xe3d9('0x1d')],_0x381a6f;if(_0x2c005f>=_0x541a33){_0x2c005f=_0x541a33;_0x381a6f=0xc8;}else{_0x381a6f=0xce;}_0x47d495[_0xe3d9('0x19')](_0x381a6f);return _0x47d495[_0xe3d9('0x1e')]('Content-Range',_0x349c81+'-'+_0x2c005f+'/'+_0x541a33)[_0xe3d9('0x1b')](_0x1fff72);}return null;};}function patchUpdates(_0x33207e){return function(_0xeeb782){try{jsonpatch['apply'](_0xeeb782,_0x33207e,!![]);}catch(_0x502200){return BPromise['reject'](_0x502200);}return _0xeeb782['save']();};}function saveUpdates(_0x2b5e56,_0xe95e72){return function(_0x3b2bc7){if(_0x3b2bc7){return _0x3b2bc7['update'](_0x2b5e56)[_0xe3d9('0x1f')](function(_0x313bc5){return _0x313bc5;});}return null;};}function removeEntity(_0x6d297b,_0xb49021){return function(_0x1a81d2){if(_0x1a81d2){return _0x1a81d2['destroy']()[_0xe3d9('0x1f')](function(){_0x6d297b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x351a2b,_0x8d8729){return function(_0x3c4812){if(!_0x3c4812){_0x351a2b[_0xe3d9('0x18')](0x194);}return _0x3c4812;};}function handleError(_0x4524cf,_0x75fd2e){_0x75fd2e=_0x75fd2e||0x1f4;return function(_0xa88a75){logger['error'](_0xa88a75['stack']);if(_0xa88a75[_0xe3d9('0x20')]){delete _0xa88a75[_0xe3d9('0x20')];}_0x4524cf[_0xe3d9('0x19')](_0x75fd2e)[_0xe3d9('0x21')](_0xa88a75);};}exports[_0xe3d9('0x22')]=function(_0x1c2ada,_0x589b6c){var _0x25d903={},_0x3f4ed1={},_0x1c89f6={'count':0x0,'rows':[]};var _0x18cbaa=db[_0xe3d9('0x23')][_0xe3d9('0x24')];_0x3f4ed1[_0xe3d9('0x25')]=_[_0xe3d9('0x26')](_0x18cbaa);_0x3f4ed1[_0xe3d9('0x27')]=_[_0xe3d9('0x26')](_0x1c2ada[_0xe3d9('0x27')]);_0x3f4ed1[_0xe3d9('0x28')]=_['intersection'](_0x3f4ed1['model'],_0x3f4ed1[_0xe3d9('0x27')]);_0x25d903[_0xe3d9('0x29')]=_[_0xe3d9('0x2a')](_0x3f4ed1[_0xe3d9('0x25')],qs[_0xe3d9('0x2b')](_0x1c2ada['query']['fields']));_0x25d903[_0xe3d9('0x29')]=_0x25d903[_0xe3d9('0x29')][_0xe3d9('0x2c')]?_0x25d903[_0xe3d9('0x29')]:_0x3f4ed1[_0xe3d9('0x25')];if(!_0x1c2ada['query'][_0xe3d9('0x2d')]('nolimit')){_0x25d903[_0xe3d9('0x1d')]=qs['limit'](_0x1c2ada[_0xe3d9('0x27')][_0xe3d9('0x1d')]);_0x25d903['offset']=qs['offset'](_0x1c2ada[_0xe3d9('0x27')][_0xe3d9('0x1c')]);}_0x25d903[_0xe3d9('0x2e')]=qs[_0xe3d9('0x2f')](_0x1c2ada[_0xe3d9('0x27')][_0xe3d9('0x2f')]);_0x25d903[_0xe3d9('0x30')]=qs[_0xe3d9('0x28')](_[_0xe3d9('0x31')](_0x1c2ada[_0xe3d9('0x27')],_0x3f4ed1[_0xe3d9('0x28')]));if(_0x1c2ada[_0xe3d9('0x27')]['filter']){_0x25d903[_0xe3d9('0x30')]=_[_0xe3d9('0x32')](_0x25d903[_0xe3d9('0x30')],{'$or':_[_0xe3d9('0x33')](_0x18cbaa,function(_0x28da04){if(_0x28da04[_0xe3d9('0x34')][_0xe3d9('0x35')]!==_0xe3d9('0x36')){var _0x46eb5e={};_0x46eb5e[_0x28da04[_0xe3d9('0x37')]]={'$like':'%'+_0x1c2ada['query'][_0xe3d9('0x38')]+'%'};return _0x46eb5e;}})});}_0x25d903=_[_0xe3d9('0x32')]({},_0x25d903,_0x1c2ada[_0xe3d9('0x39')]);var _0x46b444={'where':_0x25d903['where']};return db[_0xe3d9('0x23')][_0xe3d9('0x3a')](_0x46b444)['then'](function(_0x2c7cdf){_0x1c89f6[_0xe3d9('0x3a')]=_0x2c7cdf;if(_0x1c2ada[_0xe3d9('0x27')][_0xe3d9('0x3b')]){_0x25d903[_0xe3d9('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0xe3d9('0x3d')](_0x25d903);})[_0xe3d9('0x1f')](function(_0x3d0f6a){_0x1c89f6['rows']=_0x3d0f6a;return _0x1c89f6;})[_0xe3d9('0x1f')](respondWithFilteredResult(_0x589b6c,_0x25d903))['catch'](handleError(_0x589b6c,null));};exports[_0xe3d9('0x3e')]=function(_0x59015e,_0x2efc23){var _0x1677b2={'raw':!![],'where':{'id':_0x59015e[_0xe3d9('0x3f')]['id']}},_0x22e389={};_0x22e389[_0xe3d9('0x25')]=_[_0xe3d9('0x26')](db[_0xe3d9('0x23')]['rawAttributes']);_0x22e389[_0xe3d9('0x27')]=_['keys'](_0x59015e[_0xe3d9('0x27')]);_0x22e389['filters']=_[_0xe3d9('0x2a')](_0x22e389[_0xe3d9('0x25')],_0x22e389[_0xe3d9('0x27')]);_0x1677b2[_0xe3d9('0x29')]=_[_0xe3d9('0x2a')](_0x22e389[_0xe3d9('0x25')],qs[_0xe3d9('0x2b')](_0x59015e['query']['fields']));_0x1677b2[_0xe3d9('0x29')]=_0x1677b2[_0xe3d9('0x29')][_0xe3d9('0x2c')]?_0x1677b2['attributes']:_0x22e389[_0xe3d9('0x25')];if(_0x59015e[_0xe3d9('0x27')][_0xe3d9('0x3b')]){_0x1677b2[_0xe3d9('0x3c')]=[{'all':!![]}];}_0x1677b2=_[_0xe3d9('0x32')]({},_0x1677b2,_0x59015e[_0xe3d9('0x39')]);return db[_0xe3d9('0x23')]['find'](_0x1677b2)['then'](handleEntityNotFound(_0x2efc23,null))[_0xe3d9('0x1f')](respondWithResult(_0x2efc23,null))[_0xe3d9('0x40')](handleError(_0x2efc23,null));};exports[_0xe3d9('0x41')]=function(_0x18a354,_0x342884){return db[_0xe3d9('0x23')][_0xe3d9('0x41')](_0x18a354['body'],{})['then'](respondWithResult(_0x342884,0xc9))['catch'](handleError(_0x342884,null));};exports[_0xe3d9('0x42')]=function(_0x1c6feb,_0x5fe3bb){if(_0x1c6feb[_0xe3d9('0x43')]['id']){delete _0x1c6feb[_0xe3d9('0x43')]['id'];}return db['MailServerOut'][_0xe3d9('0x44')]({'where':{'id':_0x1c6feb[_0xe3d9('0x3f')]['id']}})[_0xe3d9('0x1f')](handleEntityNotFound(_0x5fe3bb,null))['then'](saveUpdates(_0x1c6feb[_0xe3d9('0x43')],null))['then'](respondWithResult(_0x5fe3bb,null))[_0xe3d9('0x40')](handleError(_0x5fe3bb,null));};exports[_0xe3d9('0x45')]=function(_0x29c432,_0x42e22f){return db[_0xe3d9('0x23')]['find']({'where':{'id':_0x29c432['params']['id']}})['then'](handleEntityNotFound(_0x42e22f,null))['then'](removeEntity(_0x42e22f,null))[_0xe3d9('0x40')](handleError(_0x42e22f,null));}; \ No newline at end of file +var _0x0d56=['params','fields','length','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','filter','map','key','field','merge','options','findAll','rows','catch'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0d56,0xe2));var _0x60d5=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x0d56[_0x29b886];return _0x263ef9;};'use strict';var pdf=require(_0x60d5('0x0'));var emlformat=require(_0x60d5('0x1'));var rimraf=require(_0x60d5('0x2'));var zipdir=require(_0x60d5('0x3'));var jsonpatch=require(_0x60d5('0x4'));var rp=require(_0x60d5('0x5'));var moment=require(_0x60d5('0x6'));var BPromise=require(_0x60d5('0x7'));var Mustache=require(_0x60d5('0x8'));var util=require('util');var path=require(_0x60d5('0x9'));var sox=require(_0x60d5('0xa'));var csv=require('to-csv');var ejs=require(_0x60d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x60d5('0xc'));var crypto=require(_0x60d5('0xd'));var jsforce=require(_0x60d5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x60d5('0xf'));var Papa=require(_0x60d5('0x10'));var Redis=require(_0x60d5('0x11'));var authService=require(_0x60d5('0x12'));var qs=require(_0x60d5('0x13'));var hardwareService=require(_0x60d5('0x14'));var logger=require(_0x60d5('0x15'))(_0x60d5('0x16'));var utils=require(_0x60d5('0x17'));var config=require(_0x60d5('0x18'));var db=require(_0x60d5('0x19'))['db'];function respondWithStatusCode(_0x562f5d,_0x5229c5){_0x5229c5=_0x5229c5||0xcc;return function(_0x360e8b){if(_0x360e8b){return _0x562f5d[_0x60d5('0x1a')](_0x5229c5);}return _0x562f5d[_0x60d5('0x1b')](_0x5229c5)[_0x60d5('0x1c')]();};}function respondWithResult(_0x248fb6,_0x2afa24){_0x2afa24=_0x2afa24||0xc8;return function(_0x1ca053){if(_0x1ca053){return _0x248fb6[_0x60d5('0x1b')](_0x2afa24)[_0x60d5('0x1d')](_0x1ca053);}};}function respondWithFilteredResult(_0x4d82ae,_0x123765){return function(_0x4be0c7){if(_0x4be0c7){var _0x374517=_0x4be0c7[_0x60d5('0x1e')],_0x5d82a2=_0x123765[_0x60d5('0x1f')],_0x4fb7b2=_0x123765[_0x60d5('0x1f')]+_0x123765[_0x60d5('0x20')],_0x49c64a;if(_0x4fb7b2>=_0x374517){_0x4fb7b2=_0x374517;_0x49c64a=0xc8;}else{_0x49c64a=0xce;}_0x4d82ae['status'](_0x49c64a);return _0x4d82ae[_0x60d5('0x21')](_0x60d5('0x22'),_0x5d82a2+'-'+_0x4fb7b2+'/'+_0x374517)[_0x60d5('0x1d')](_0x4be0c7);}return null;};}function patchUpdates(_0x574644){return function(_0x1837dc){try{jsonpatch[_0x60d5('0x23')](_0x1837dc,_0x574644,!![]);}catch(_0x415ab3){return BPromise[_0x60d5('0x24')](_0x415ab3);}return _0x1837dc['save']();};}function saveUpdates(_0x534e1f,_0x1684b7){return function(_0x24780f){if(_0x24780f){return _0x24780f[_0x60d5('0x25')](_0x534e1f)[_0x60d5('0x26')](function(_0x4f9d7e){return _0x4f9d7e;});}return null;};}function removeEntity(_0x14064b,_0x2d87fd){return function(_0x4b3e41){if(_0x4b3e41){return _0x4b3e41[_0x60d5('0x27')]()[_0x60d5('0x26')](function(){_0x14064b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12452c,_0x3d6ea0){return function(_0x5a6f65){if(!_0x5a6f65){_0x12452c['sendStatus'](0x194);}return _0x5a6f65;};}function handleError(_0x7f9a2c,_0x5a08cb){_0x5a08cb=_0x5a08cb||0x1f4;return function(_0x51e9d7){logger[_0x60d5('0x28')](_0x51e9d7[_0x60d5('0x29')]);if(_0x51e9d7[_0x60d5('0x2a')]){delete _0x51e9d7[_0x60d5('0x2a')];}_0x7f9a2c[_0x60d5('0x1b')](_0x5a08cb)[_0x60d5('0x2b')](_0x51e9d7);};}exports[_0x60d5('0x2c')]=function(_0x5e42ac,_0x23b08e){var _0x28fd1c={},_0x45dad8={},_0x24eef3={'count':0x0,'rows':[]};var _0x534921=db[_0x60d5('0x2d')][_0x60d5('0x2e')];_0x45dad8[_0x60d5('0x2f')]=_[_0x60d5('0x30')](_0x534921);_0x45dad8[_0x60d5('0x31')]=_[_0x60d5('0x30')](_0x5e42ac['query']);_0x45dad8[_0x60d5('0x32')]=_[_0x60d5('0x33')](_0x45dad8[_0x60d5('0x2f')],_0x45dad8['query']);_0x28fd1c[_0x60d5('0x34')]=_[_0x60d5('0x33')](_0x45dad8[_0x60d5('0x2f')],qs['fields'](_0x5e42ac[_0x60d5('0x31')]['fields']));_0x28fd1c[_0x60d5('0x34')]=_0x28fd1c[_0x60d5('0x34')]['length']?_0x28fd1c[_0x60d5('0x34')]:_0x45dad8['model'];if(!_0x5e42ac[_0x60d5('0x31')]['hasOwnProperty'](_0x60d5('0x35'))){_0x28fd1c[_0x60d5('0x20')]=qs['limit'](_0x5e42ac[_0x60d5('0x31')]['limit']);_0x28fd1c[_0x60d5('0x1f')]=qs[_0x60d5('0x1f')](_0x5e42ac[_0x60d5('0x31')][_0x60d5('0x1f')]);}_0x28fd1c[_0x60d5('0x36')]=qs[_0x60d5('0x37')](_0x5e42ac[_0x60d5('0x31')]['sort']);_0x28fd1c[_0x60d5('0x38')]=qs[_0x60d5('0x32')](_['pick'](_0x5e42ac[_0x60d5('0x31')],_0x45dad8[_0x60d5('0x32')]));if(_0x5e42ac['query'][_0x60d5('0x39')]){_0x28fd1c[_0x60d5('0x38')]=_['merge'](_0x28fd1c[_0x60d5('0x38')],{'$or':_[_0x60d5('0x3a')](_0x534921,function(_0x3919e3){if(_0x3919e3['type'][_0x60d5('0x3b')]!=='VIRTUAL'){var _0x56201a={};_0x56201a[_0x3919e3[_0x60d5('0x3c')]]={'$like':'%'+_0x5e42ac['query']['filter']+'%'};return _0x56201a;}})});}_0x28fd1c=_[_0x60d5('0x3d')]({},_0x28fd1c,_0x5e42ac[_0x60d5('0x3e')]);var _0x381a06={'where':_0x28fd1c[_0x60d5('0x38')]};return db[_0x60d5('0x2d')]['count'](_0x381a06)[_0x60d5('0x26')](function(_0x2b6591){_0x24eef3[_0x60d5('0x1e')]=_0x2b6591;if(_0x5e42ac[_0x60d5('0x31')]['includeAll']){_0x28fd1c['include']=[{'all':!![]}];}return db[_0x60d5('0x2d')][_0x60d5('0x3f')](_0x28fd1c);})[_0x60d5('0x26')](function(_0x53b7cb){_0x24eef3[_0x60d5('0x40')]=_0x53b7cb;return _0x24eef3;})['then'](respondWithFilteredResult(_0x23b08e,_0x28fd1c))[_0x60d5('0x41')](handleError(_0x23b08e,null));};exports['show']=function(_0x192393,_0x17e3e5){var _0x56adab={'raw':!![],'where':{'id':_0x192393[_0x60d5('0x42')]['id']}},_0x114571={};_0x114571[_0x60d5('0x2f')]=_['keys'](db[_0x60d5('0x2d')][_0x60d5('0x2e')]);_0x114571[_0x60d5('0x31')]=_[_0x60d5('0x30')](_0x192393['query']);_0x114571['filters']=_['intersection'](_0x114571[_0x60d5('0x2f')],_0x114571[_0x60d5('0x31')]);_0x56adab['attributes']=_[_0x60d5('0x33')](_0x114571[_0x60d5('0x2f')],qs[_0x60d5('0x43')](_0x192393[_0x60d5('0x31')]['fields']));_0x56adab[_0x60d5('0x34')]=_0x56adab['attributes'][_0x60d5('0x44')]?_0x56adab[_0x60d5('0x34')]:_0x114571[_0x60d5('0x2f')];if(_0x192393[_0x60d5('0x31')]['includeAll']){_0x56adab[_0x60d5('0x45')]=[{'all':!![]}];}_0x56adab=_['merge']({},_0x56adab,_0x192393[_0x60d5('0x3e')]);return db['MailServerOut'][_0x60d5('0x46')](_0x56adab)[_0x60d5('0x26')](handleEntityNotFound(_0x17e3e5,null))[_0x60d5('0x26')](respondWithResult(_0x17e3e5,null))[_0x60d5('0x41')](handleError(_0x17e3e5,null));};exports[_0x60d5('0x47')]=function(_0x3f907d,_0x1a66dc){return db[_0x60d5('0x2d')][_0x60d5('0x47')](_0x3f907d[_0x60d5('0x48')],{})[_0x60d5('0x26')](respondWithResult(_0x1a66dc,0xc9))[_0x60d5('0x41')](handleError(_0x1a66dc,null));};exports[_0x60d5('0x25')]=function(_0x4eb6b7,_0x389ced){if(_0x4eb6b7[_0x60d5('0x48')]['id']){delete _0x4eb6b7['body']['id'];}return db[_0x60d5('0x2d')][_0x60d5('0x46')]({'where':{'id':_0x4eb6b7[_0x60d5('0x42')]['id']}})['then'](handleEntityNotFound(_0x389ced,null))['then'](saveUpdates(_0x4eb6b7[_0x60d5('0x48')],null))[_0x60d5('0x26')](respondWithResult(_0x389ced,null))['catch'](handleError(_0x389ced,null));};exports[_0x60d5('0x27')]=function(_0x3b61ae,_0x39a4f3){return db[_0x60d5('0x2d')][_0x60d5('0x46')]({'where':{'id':_0x3b61ae['params']['id']}})['then'](handleEntityNotFound(_0x39a4f3,null))[_0x60d5('0x26')](removeEntity(_0x39a4f3,null))[_0x60d5('0x41')](handleError(_0x39a4f3,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ea14d47..16903fe 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 _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','util'];(function(_0x31b7e9,_0x4f75a1){var _0x485d39=function(_0x199b49){while(--_0x199b49){_0x31b7e9['push'](_0x31b7e9['shift']());}};_0x485d39(++_0x4f75a1);}(_0x14a0,0x8e));var _0x014a=function(_0x6a3e29,_0x281702){_0x6a3e29=_0x6a3e29-0x0;var _0x4e2dba=_0x14a0[_0x6a3e29];return _0x4e2dba;};'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 _0x3423=['MailServerOut','mail_servers_out','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x22b245,_0x522fc5){var _0x6639c0=function(_0x5e858e){while(--_0x5e858e){_0x22b245['push'](_0x22b245['shift']());}};_0x6639c0(++_0x522fc5);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'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 fa325cf..90019d5 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 _0x1fed=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','info','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','MailServerOut,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x308f09,_0x9c9367){var _0x2b58fd=function(_0x51b231){while(--_0x51b231){_0x308f09['push'](_0x308f09['shift']());}};_0x2b58fd(++_0x9c9367);}(_0x1fed,0x7d));var _0xd1fe=function(_0x5b3b6a,_0x906f49){_0x5b3b6a=_0x5b3b6a-0x0;var _0x4a9af7=_0x1fed[_0x5b3b6a];return _0x4a9af7;};'use strict';var _=require(_0xd1fe('0x0'));var util=require(_0xd1fe('0x1'));var moment=require(_0xd1fe('0x2'));var BPromise=require(_0xd1fe('0x3'));var rs=require(_0xd1fe('0x4'));var fs=require('fs');var Redis=require(_0xd1fe('0x5'));var db=require(_0xd1fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1fe('0x7'));var config=require(_0xd1fe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd1fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54aa9f,_0x676ebf,_0x59a0e5){return new BPromise(function(_0x181b34,_0x56b87e){return client[_0xd1fe('0xa')](_0x54aa9f,_0x59a0e5)['then'](function(_0x3e54a4){logger[_0xd1fe('0xb')]('MailServerOut,\x20%s,\x20%s',_0x676ebf,_0xd1fe('0xc'));logger[_0xd1fe('0xd')](_0xd1fe('0xe'),_0x676ebf,_0xd1fe('0xc'),JSON['stringify'](_0x3e54a4));if(_0x3e54a4[_0xd1fe('0xf')]){if(_0x3e54a4[_0xd1fe('0xf')][_0xd1fe('0x10')]===0x1f4){logger[_0xd1fe('0xf')](_0xd1fe('0x11'),_0x676ebf,_0x3e54a4[_0xd1fe('0xf')][_0xd1fe('0x12')]);return _0x56b87e(_0x3e54a4['error']['message']);}logger[_0xd1fe('0xf')]('MailServerOut,\x20%s,\x20%s',_0x676ebf,_0x3e54a4['error'][_0xd1fe('0x12')]);return _0x181b34(_0x3e54a4[_0xd1fe('0xf')][_0xd1fe('0x12')]);}else{logger[_0xd1fe('0xb')](_0xd1fe('0x11'),_0x676ebf,_0xd1fe('0xc'));_0x181b34(_0x3e54a4[_0xd1fe('0x13')][_0xd1fe('0x12')]);}})[_0xd1fe('0x14')](function(_0x29531a){logger['error'](_0xd1fe('0x11'),_0x676ebf,_0x29531a);_0x56b87e(_0x29531a);});});} \ No newline at end of file +var _0xa716=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xa716,0x123));var _0x6a71=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa716[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6a71('0x0'));var util=require(_0x6a71('0x1'));var moment=require(_0x6a71('0x2'));var BPromise=require(_0x6a71('0x3'));var rs=require(_0x6a71('0x4'));var fs=require('fs');var Redis=require(_0x6a71('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a71('0x6'));var config=require(_0x6a71('0x7'));var jayson=require(_0x6a71('0x8'));var client=jayson[_0x6a71('0x9')][_0x6a71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19aa01,_0x1b4f7b,_0x3a2214){return new BPromise(function(_0x5a0353,_0x3866df){return client[_0x6a71('0xb')](_0x19aa01,_0x3a2214)[_0x6a71('0xc')](function(_0x5923a1){logger['info'](_0x6a71('0xd'),_0x1b4f7b,_0x6a71('0xe'));logger['debug'](_0x6a71('0xf'),_0x1b4f7b,'request\x20sent',JSON[_0x6a71('0x10')](_0x5923a1));if(_0x5923a1[_0x6a71('0x11')]){if(_0x5923a1[_0x6a71('0x11')]['code']===0x1f4){logger[_0x6a71('0x11')](_0x6a71('0xd'),_0x1b4f7b,_0x5923a1[_0x6a71('0x11')][_0x6a71('0x12')]);return _0x3866df(_0x5923a1[_0x6a71('0x11')][_0x6a71('0x12')]);}logger[_0x6a71('0x11')](_0x6a71('0xd'),_0x1b4f7b,_0x5923a1[_0x6a71('0x11')][_0x6a71('0x12')]);return _0x5a0353(_0x5923a1[_0x6a71('0x11')][_0x6a71('0x12')]);}else{logger[_0x6a71('0x13')](_0x6a71('0xd'),_0x1b4f7b,_0x6a71('0xe'));_0x5a0353(_0x5923a1[_0x6a71('0x14')]['message']);}})[_0x6a71('0x15')](function(_0x4b21ca){logger['error'](_0x6a71('0xd'),_0x1b4f7b,_0x4b21ca);_0x3866df(_0x4b21ca);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 75f2f33..23379a6 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 _0x9996=['get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller'];(function(_0x54840e,_0x8d4b40){var _0x4dccf7=function(_0x215063){while(--_0x215063){_0x54840e['push'](_0x54840e['shift']());}};_0x4dccf7(++_0x8d4b40);}(_0x9996,0xc7));var _0x6999=function(_0x253dfd,_0x39c169){_0x253dfd=_0x253dfd-0x0;var _0x1ec44d=_0x9996[_0x253dfd];return _0x1ec44d;};'use strict';var multer=require('multer');var util=require(_0x6999('0x0'));var path=require(_0x6999('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x6999('0x2'));var interaction=require(_0x6999('0x3'));var config=require('../../config/environment');var controller=require(_0x6999('0x4'));router[_0x6999('0x5')]('/',auth[_0x6999('0x6')](),controller['index']);router['get'](_0x6999('0x7'),auth[_0x6999('0x6')](),controller[_0x6999('0x8')]);router[_0x6999('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x6999('0x9')]);router[_0x6999('0xa')]('/',auth[_0x6999('0x6')](),controller[_0x6999('0xb')]);router[_0x6999('0xc')](_0x6999('0xd'),auth[_0x6999('0x6')](),controller[_0x6999('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6999('0xf')]);module[_0x6999('0x10')]=router; \ No newline at end of file +var _0xbc36=['util','express','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x11a238,_0x1c48fa){var _0x517b53=function(_0x29b07d){while(--_0x29b07d){_0x11a238['push'](_0x11a238['shift']());}};_0x517b53(++_0x1c48fa);}(_0xbc36,0xba));var _0x6bc3=function(_0xcd87ef,_0x1a01b1){_0xcd87ef=_0xcd87ef-0x0;var _0x13c65c=_0xbc36[_0xcd87ef];return _0x13c65c;};'use strict';var multer=require(_0x6bc3('0x0'));var util=require(_0x6bc3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6bc3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6bc3('0x3'));var config=require(_0x6bc3('0x4'));var controller=require(_0x6bc3('0x5'));router[_0x6bc3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6bc3('0x6')]('/describe',auth[_0x6bc3('0x7')](),controller[_0x6bc3('0x8')]);router[_0x6bc3('0x6')](_0x6bc3('0x9'),auth[_0x6bc3('0x7')](),controller[_0x6bc3('0xa')]);router[_0x6bc3('0xb')]('/',auth['isAuthenticated'](),controller[_0x6bc3('0xc')]);router[_0x6bc3('0xd')](_0x6bc3('0x9'),auth[_0x6bc3('0x7')](),controller['update']);router[_0x6bc3('0xe')](_0x6bc3('0x9'),auth[_0x6bc3('0x7')](),controller[_0x6bc3('0xf')]);module[_0x6bc3('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f0022e9..5436f3e 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 _0xea28=['STRING','name','sequelize','exports'];(function(_0x1e34e1,_0x13c6ee){var _0x186098=function(_0x2f8c3f){while(--_0x2f8c3f){_0x1e34e1['push'](_0x1e34e1['shift']());}};_0x186098(++_0x13c6ee);}(_0xea28,0x13a));var _0x8ea2=function(_0x1300e0,_0x570dfb){_0x1300e0=_0x1300e0-0x0;var _0x5ad48e=_0xea28[_0x1300e0];return _0x5ad48e;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'unique':_0x8ea2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8ea2('0x2')]}}; \ No newline at end of file +var _0x793b=['name','sequelize','exports','STRING'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x793b,0x189));var _0xb793=function(_0x3060f4,_0x12f429){_0x3060f4=_0x3060f4-0x0;var _0x2de7a9=_0x793b[_0x3060f4];return _0x2de7a9;};'use strict';var Sequelize=require(_0xb793('0x0'));module[_0xb793('0x1')]={'name':{'type':Sequelize[_0xb793('0x2')],'unique':_0xb793('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb793('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 00d7410..67f2bd0 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 _0x9283=['request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','then','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','field','merge','include','findAll','catch','length','includeAll','options','find','create','update','body','destroy','params','describe','html-pdf','eml-format','zip-dir'];(function(_0x3d5d87,_0x194058){var _0x4541e2=function(_0x20ef2c){while(--_0x20ef2c){_0x3d5d87['push'](_0x3d5d87['shift']());}};_0x4541e2(++_0x194058);}(_0x9283,0x10d));var _0x3928=function(_0xd5c2e1,_0x3ace14){_0xd5c2e1=_0xd5c2e1-0x0;var _0x3d799d=_0x9283[_0xd5c2e1];return _0x3d799d;};'use strict';var pdf=require(_0x3928('0x0'));var emlformat=require(_0x3928('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3928('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3928('0x3'));var moment=require(_0x3928('0x4'));var BPromise=require(_0x3928('0x5'));var Mustache=require(_0x3928('0x6'));var util=require('util');var path=require(_0x3928('0x7'));var sox=require('sox');var csv=require(_0x3928('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3928('0x9'));var squel=require(_0x3928('0xa'));var crypto=require(_0x3928('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3928('0xc'));var toCsv=require(_0x3928('0x8'));var querystring=require(_0x3928('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3928('0xe'));var qs=require(_0x3928('0xf'));var hardwareService=require(_0x3928('0x10'));var logger=require(_0x3928('0x11'))(_0x3928('0x12'));var utils=require(_0x3928('0x13'));var config=require(_0x3928('0x14'));var db=require(_0x3928('0x15'))['db'];function respondWithStatusCode(_0x322ef0,_0x1dc61c){_0x1dc61c=_0x1dc61c||0xcc;return function(_0x2567ba){if(_0x2567ba){return _0x322ef0[_0x3928('0x16')](_0x1dc61c);}return _0x322ef0[_0x3928('0x17')](_0x1dc61c)[_0x3928('0x18')]();};}function respondWithResult(_0x53fde8,_0x3f33f3){_0x3f33f3=_0x3f33f3||0xc8;return function(_0x3e6f14){if(_0x3e6f14){return _0x53fde8['status'](_0x3f33f3)['json'](_0x3e6f14);}};}function respondWithFilteredResult(_0x33934d,_0x573430){return function(_0x474924){if(_0x474924){var _0x3c98bb=_0x474924[_0x3928('0x19')],_0x383697=_0x573430['offset'],_0x550053=_0x573430[_0x3928('0x1a')]+_0x573430[_0x3928('0x1b')],_0x243649;if(_0x550053>=_0x3c98bb){_0x550053=_0x3c98bb;_0x243649=0xc8;}else{_0x243649=0xce;}_0x33934d[_0x3928('0x17')](_0x243649);return _0x33934d[_0x3928('0x1c')](_0x3928('0x1d'),_0x383697+'-'+_0x550053+'/'+_0x3c98bb)['json'](_0x474924);}return null;};}function patchUpdates(_0x42048f){return function(_0x13b8b6){try{jsonpatch['apply'](_0x13b8b6,_0x42048f,!![]);}catch(_0x268fcb){return BPromise['reject'](_0x268fcb);}return _0x13b8b6['save']();};}function saveUpdates(_0x23d375,_0x37db71){return function(_0x408c2b){if(_0x408c2b){return _0x408c2b['update'](_0x23d375)['then'](function(_0x2e5d76){return _0x2e5d76;});}return null;};}function removeEntity(_0x12df31,_0x2be52e){return function(_0x42b190){if(_0x42b190){return _0x42b190['destroy']()[_0x3928('0x1e')](function(){_0x12df31[_0x3928('0x17')](0xcc)[_0x3928('0x18')]();});}};}function handleEntityNotFound(_0x4136f5,_0x416d62){return function(_0x133d67){if(!_0x133d67){_0x4136f5[_0x3928('0x16')](0x194);}return _0x133d67;};}function handleError(_0x5e653c,_0x590b11){_0x590b11=_0x590b11||0x1f4;return function(_0x3d16d5){logger['error'](_0x3d16d5[_0x3928('0x1f')]);if(_0x3d16d5[_0x3928('0x20')]){delete _0x3d16d5[_0x3928('0x20')];}_0x5e653c[_0x3928('0x17')](_0x590b11)[_0x3928('0x21')](_0x3d16d5);};}exports[_0x3928('0x22')]=function(_0x5b3c09,_0x3e873c){var _0x5d40fc={},_0x18d442={},_0x987119={'count':0x0,'rows':[]};var _0x117497=db[_0x3928('0x23')][_0x3928('0x24')];_0x18d442[_0x3928('0x25')]=_[_0x3928('0x26')](_0x117497);_0x18d442[_0x3928('0x27')]=_[_0x3928('0x26')](_0x5b3c09[_0x3928('0x27')]);_0x18d442[_0x3928('0x28')]=_[_0x3928('0x29')](_0x18d442[_0x3928('0x25')],_0x18d442[_0x3928('0x27')]);_0x5d40fc['attributes']=_[_0x3928('0x29')](_0x18d442[_0x3928('0x25')],qs[_0x3928('0x2a')](_0x5b3c09[_0x3928('0x27')][_0x3928('0x2a')]));_0x5d40fc[_0x3928('0x2b')]=_0x5d40fc['attributes']['length']?_0x5d40fc[_0x3928('0x2b')]:_0x18d442[_0x3928('0x25')];if(!_0x5b3c09[_0x3928('0x27')][_0x3928('0x2c')](_0x3928('0x2d'))){_0x5d40fc['limit']=qs[_0x3928('0x1b')](_0x5b3c09[_0x3928('0x27')][_0x3928('0x1b')]);_0x5d40fc[_0x3928('0x1a')]=qs[_0x3928('0x1a')](_0x5b3c09['query'][_0x3928('0x1a')]);}_0x5d40fc[_0x3928('0x2e')]=qs[_0x3928('0x2f')](_0x5b3c09['query'][_0x3928('0x2f')]);_0x5d40fc['where']=qs[_0x3928('0x28')](_[_0x3928('0x30')](_0x5b3c09['query'],_0x18d442[_0x3928('0x28')]));if(_0x5b3c09[_0x3928('0x27')][_0x3928('0x31')]){_0x5d40fc['where']=_['merge'](_0x5d40fc[_0x3928('0x32')],{'$or':_[_0x3928('0x33')](_0x117497,function(_0x584444){if(_0x584444[_0x3928('0x34')]['key']!=='VIRTUAL'){var _0x8bfdd8={};_0x8bfdd8[_0x584444[_0x3928('0x35')]]={'$like':'%'+_0x5b3c09[_0x3928('0x27')][_0x3928('0x31')]+'%'};return _0x8bfdd8;}})});}_0x5d40fc=_[_0x3928('0x36')]({},_0x5d40fc,_0x5b3c09['options']);var _0x3d2966={'where':_0x5d40fc[_0x3928('0x32')]};return db[_0x3928('0x23')][_0x3928('0x19')](_0x3d2966)['then'](function(_0x449fdf){_0x987119[_0x3928('0x19')]=_0x449fdf;if(_0x5b3c09[_0x3928('0x27')]['includeAll']){_0x5d40fc[_0x3928('0x37')]=[{'all':!![]}];}return db[_0x3928('0x23')][_0x3928('0x38')](_0x5d40fc);})[_0x3928('0x1e')](function(_0x4e6c0c){_0x987119['rows']=_0x4e6c0c;return _0x987119;})[_0x3928('0x1e')](respondWithFilteredResult(_0x3e873c,_0x5d40fc))[_0x3928('0x39')](handleError(_0x3e873c,null));};exports['show']=function(_0x4585d4,_0x38f308){var _0x1e133b={'raw':!![],'where':{'id':_0x4585d4['params']['id']}},_0x4d5f02={};_0x4d5f02['model']=_[_0x3928('0x26')](db[_0x3928('0x23')]['rawAttributes']);_0x4d5f02['query']=_[_0x3928('0x26')](_0x4585d4['query']);_0x4d5f02[_0x3928('0x28')]=_['intersection'](_0x4d5f02[_0x3928('0x25')],_0x4d5f02[_0x3928('0x27')]);_0x1e133b[_0x3928('0x2b')]=_[_0x3928('0x29')](_0x4d5f02[_0x3928('0x25')],qs[_0x3928('0x2a')](_0x4585d4['query'][_0x3928('0x2a')]));_0x1e133b['attributes']=_0x1e133b[_0x3928('0x2b')][_0x3928('0x3a')]?_0x1e133b[_0x3928('0x2b')]:_0x4d5f02[_0x3928('0x25')];if(_0x4585d4[_0x3928('0x27')][_0x3928('0x3b')]){_0x1e133b[_0x3928('0x37')]=[{'all':!![]}];}_0x1e133b=_['merge']({},_0x1e133b,_0x4585d4[_0x3928('0x3c')]);return db[_0x3928('0x23')][_0x3928('0x3d')](_0x1e133b)[_0x3928('0x1e')](handleEntityNotFound(_0x38f308,null))['then'](respondWithResult(_0x38f308,null))[_0x3928('0x39')](handleError(_0x38f308,null));};exports['create']=function(_0x179381,_0x5d5b6c){return db[_0x3928('0x23')][_0x3928('0x3e')](_0x179381['body'],{})[_0x3928('0x1e')](respondWithResult(_0x5d5b6c,0xc9))[_0x3928('0x39')](handleError(_0x5d5b6c,null));};exports[_0x3928('0x3f')]=function(_0x4d2946,_0xedb4ec){if(_0x4d2946[_0x3928('0x40')]['id']){delete _0x4d2946['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x4d2946['params']['id']}})[_0x3928('0x1e')](handleEntityNotFound(_0xedb4ec,null))[_0x3928('0x1e')](saveUpdates(_0x4d2946[_0x3928('0x40')],null))[_0x3928('0x1e')](respondWithResult(_0xedb4ec,null))[_0x3928('0x39')](handleError(_0xedb4ec,null));};exports[_0x3928('0x41')]=function(_0x1eb017,_0x11a986){return db[_0x3928('0x23')][_0x3928('0x3d')]({'where':{'id':_0x1eb017[_0x3928('0x42')]['id']}})[_0x3928('0x1e')](handleEntityNotFound(_0x11a986,null))[_0x3928('0x1e')](removeEntity(_0x11a986,null))[_0x3928('0x39')](handleError(_0x11a986,null));};exports[_0x3928('0x43')]=function(_0x4bf704,_0x3e9bc8){return db[_0x3928('0x23')][_0x3928('0x43')]()[_0x3928('0x1e')](respondWithResult(_0x3e9bc8,null))[_0x3928('0x39')](handleError(_0x3e9bc8,null));}; \ No newline at end of file +var _0xbafd=['field','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','name','send','index','MailSubstatus','model','keys','query','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL'];(function(_0x3aecc6,_0x56eeac){var _0x5d57e3=function(_0x35dd7b){while(--_0x35dd7b){_0x3aecc6['push'](_0x3aecc6['shift']());}};_0x5d57e3(++_0x56eeac);}(_0xbafd,0xe4));var _0xdbaf=function(_0x88e1f5,_0x4cadc4){_0x88e1f5=_0x88e1f5-0x0;var _0xa6e625=_0xbafd[_0x88e1f5];return _0xa6e625;};'use strict';var pdf=require(_0xdbaf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbaf('0x1'));var jsonpatch=require(_0xdbaf('0x2'));var rp=require(_0xdbaf('0x3'));var moment=require('moment');var BPromise=require(_0xdbaf('0x4'));var Mustache=require(_0xdbaf('0x5'));var util=require('util');var path=require(_0xdbaf('0x6'));var sox=require(_0xdbaf('0x7'));var csv=require(_0xdbaf('0x8'));var ejs=require(_0xdbaf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdbaf('0xa'));var crypto=require('crypto');var jsforce=require(_0xdbaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdbaf('0x8'));var querystring=require('querystring');var Papa=require(_0xdbaf('0xc'));var Redis=require(_0xdbaf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdbaf('0xe'));var hardwareService=require(_0xdbaf('0xf'));var logger=require(_0xdbaf('0x10'))(_0xdbaf('0x11'));var utils=require(_0xdbaf('0x12'));var config=require(_0xdbaf('0x13'));var db=require(_0xdbaf('0x14'))['db'];function respondWithStatusCode(_0x27d4b5,_0x2824e7){_0x2824e7=_0x2824e7||0xcc;return function(_0x2e6ab5){if(_0x2e6ab5){return _0x27d4b5[_0xdbaf('0x15')](_0x2824e7);}return _0x27d4b5[_0xdbaf('0x16')](_0x2824e7)[_0xdbaf('0x17')]();};}function respondWithResult(_0x275f0b,_0x436640){_0x436640=_0x436640||0xc8;return function(_0x35af72){if(_0x35af72){return _0x275f0b['status'](_0x436640)['json'](_0x35af72);}};}function respondWithFilteredResult(_0x1a5ab4,_0x13ab0b){return function(_0x148e7d){if(_0x148e7d){var _0x4c165e=_0x148e7d[_0xdbaf('0x18')],_0x3a75a0=_0x13ab0b['offset'],_0xf07d53=_0x13ab0b[_0xdbaf('0x19')]+_0x13ab0b[_0xdbaf('0x1a')],_0x3a58b7;if(_0xf07d53>=_0x4c165e){_0xf07d53=_0x4c165e;_0x3a58b7=0xc8;}else{_0x3a58b7=0xce;}_0x1a5ab4[_0xdbaf('0x16')](_0x3a58b7);return _0x1a5ab4[_0xdbaf('0x1b')](_0xdbaf('0x1c'),_0x3a75a0+'-'+_0xf07d53+'/'+_0x4c165e)[_0xdbaf('0x1d')](_0x148e7d);}return null;};}function patchUpdates(_0x174018){return function(_0x31f167){try{jsonpatch[_0xdbaf('0x1e')](_0x31f167,_0x174018,!![]);}catch(_0x17aeb2){return BPromise['reject'](_0x17aeb2);}return _0x31f167['save']();};}function saveUpdates(_0x9ff8d1,_0x345eea){return function(_0x384a1e){if(_0x384a1e){return _0x384a1e[_0xdbaf('0x1f')](_0x9ff8d1)[_0xdbaf('0x20')](function(_0x4d6250){return _0x4d6250;});}return null;};}function removeEntity(_0x5d8df2,_0x15ad1b){return function(_0x198549){if(_0x198549){return _0x198549['destroy']()[_0xdbaf('0x20')](function(){_0x5d8df2['status'](0xcc)[_0xdbaf('0x17')]();});}};}function handleEntityNotFound(_0x452f22,_0x1cecee){return function(_0x431855){if(!_0x431855){_0x452f22['sendStatus'](0x194);}return _0x431855;};}function handleError(_0x387963,_0xd3150a){_0xd3150a=_0xd3150a||0x1f4;return function(_0x2f2c69){logger[_0xdbaf('0x21')](_0x2f2c69['stack']);if(_0x2f2c69[_0xdbaf('0x22')]){delete _0x2f2c69[_0xdbaf('0x22')];}_0x387963[_0xdbaf('0x16')](_0xd3150a)[_0xdbaf('0x23')](_0x2f2c69);};}exports[_0xdbaf('0x24')]=function(_0x5896d3,_0x4990b9){var _0xc2cbae={},_0x12a59d={},_0x2fb337={'count':0x0,'rows':[]};var _0x21aad3=db[_0xdbaf('0x25')]['rawAttributes'];_0x12a59d[_0xdbaf('0x26')]=_[_0xdbaf('0x27')](_0x21aad3);_0x12a59d['query']=_[_0xdbaf('0x27')](_0x5896d3[_0xdbaf('0x28')]);_0x12a59d['filters']=_['intersection'](_0x12a59d[_0xdbaf('0x26')],_0x12a59d['query']);_0xc2cbae[_0xdbaf('0x29')]=_[_0xdbaf('0x2a')](_0x12a59d[_0xdbaf('0x26')],qs['fields'](_0x5896d3[_0xdbaf('0x28')][_0xdbaf('0x2b')]));_0xc2cbae[_0xdbaf('0x29')]=_0xc2cbae[_0xdbaf('0x29')]['length']?_0xc2cbae['attributes']:_0x12a59d['model'];if(!_0x5896d3[_0xdbaf('0x28')]['hasOwnProperty'](_0xdbaf('0x2c'))){_0xc2cbae['limit']=qs[_0xdbaf('0x1a')](_0x5896d3[_0xdbaf('0x28')]['limit']);_0xc2cbae[_0xdbaf('0x19')]=qs[_0xdbaf('0x19')](_0x5896d3[_0xdbaf('0x28')][_0xdbaf('0x19')]);}_0xc2cbae[_0xdbaf('0x2d')]=qs[_0xdbaf('0x2e')](_0x5896d3['query'][_0xdbaf('0x2e')]);_0xc2cbae['where']=qs[_0xdbaf('0x2f')](_[_0xdbaf('0x30')](_0x5896d3['query'],_0x12a59d[_0xdbaf('0x2f')]));if(_0x5896d3[_0xdbaf('0x28')][_0xdbaf('0x31')]){_0xc2cbae[_0xdbaf('0x32')]=_[_0xdbaf('0x33')](_0xc2cbae[_0xdbaf('0x32')],{'$or':_[_0xdbaf('0x34')](_0x21aad3,function(_0x467a46){if(_0x467a46[_0xdbaf('0x35')][_0xdbaf('0x36')]!==_0xdbaf('0x37')){var _0x558ac8={};_0x558ac8[_0x467a46[_0xdbaf('0x38')]]={'$like':'%'+_0x5896d3[_0xdbaf('0x28')][_0xdbaf('0x31')]+'%'};return _0x558ac8;}})});}_0xc2cbae=_[_0xdbaf('0x33')]({},_0xc2cbae,_0x5896d3[_0xdbaf('0x39')]);var _0x3e4c24={'where':_0xc2cbae['where']};return db['MailSubstatus'][_0xdbaf('0x18')](_0x3e4c24)[_0xdbaf('0x20')](function(_0x559ac9){_0x2fb337[_0xdbaf('0x18')]=_0x559ac9;if(_0x5896d3[_0xdbaf('0x28')][_0xdbaf('0x3a')]){_0xc2cbae[_0xdbaf('0x3b')]=[{'all':!![]}];}return db[_0xdbaf('0x25')]['findAll'](_0xc2cbae);})['then'](function(_0x47dd52){_0x2fb337[_0xdbaf('0x3c')]=_0x47dd52;return _0x2fb337;})[_0xdbaf('0x20')](respondWithFilteredResult(_0x4990b9,_0xc2cbae))[_0xdbaf('0x3d')](handleError(_0x4990b9,null));};exports[_0xdbaf('0x3e')]=function(_0x384421,_0x58b2ce){var _0x1c6ff9={'raw':!![],'where':{'id':_0x384421[_0xdbaf('0x3f')]['id']}},_0x273e6a={};_0x273e6a[_0xdbaf('0x26')]=_[_0xdbaf('0x27')](db['MailSubstatus'][_0xdbaf('0x40')]);_0x273e6a[_0xdbaf('0x28')]=_[_0xdbaf('0x27')](_0x384421[_0xdbaf('0x28')]);_0x273e6a[_0xdbaf('0x2f')]=_[_0xdbaf('0x2a')](_0x273e6a[_0xdbaf('0x26')],_0x273e6a[_0xdbaf('0x28')]);_0x1c6ff9['attributes']=_[_0xdbaf('0x2a')](_0x273e6a[_0xdbaf('0x26')],qs[_0xdbaf('0x2b')](_0x384421[_0xdbaf('0x28')][_0xdbaf('0x2b')]));_0x1c6ff9[_0xdbaf('0x29')]=_0x1c6ff9[_0xdbaf('0x29')][_0xdbaf('0x41')]?_0x1c6ff9[_0xdbaf('0x29')]:_0x273e6a[_0xdbaf('0x26')];if(_0x384421[_0xdbaf('0x28')][_0xdbaf('0x3a')]){_0x1c6ff9[_0xdbaf('0x3b')]=[{'all':!![]}];}_0x1c6ff9=_[_0xdbaf('0x33')]({},_0x1c6ff9,_0x384421[_0xdbaf('0x39')]);return db[_0xdbaf('0x25')][_0xdbaf('0x42')](_0x1c6ff9)[_0xdbaf('0x20')](handleEntityNotFound(_0x58b2ce,null))[_0xdbaf('0x20')](respondWithResult(_0x58b2ce,null))[_0xdbaf('0x3d')](handleError(_0x58b2ce,null));};exports['create']=function(_0x3c7c63,_0x50a5a9){return db[_0xdbaf('0x25')][_0xdbaf('0x43')](_0x3c7c63[_0xdbaf('0x44')],{})[_0xdbaf('0x20')](respondWithResult(_0x50a5a9,0xc9))[_0xdbaf('0x3d')](handleError(_0x50a5a9,null));};exports[_0xdbaf('0x1f')]=function(_0x15dd9a,_0x55962d){if(_0x15dd9a['body']['id']){delete _0x15dd9a[_0xdbaf('0x44')]['id'];}return db[_0xdbaf('0x25')][_0xdbaf('0x42')]({'where':{'id':_0x15dd9a[_0xdbaf('0x3f')]['id']}})[_0xdbaf('0x20')](handleEntityNotFound(_0x55962d,null))[_0xdbaf('0x20')](saveUpdates(_0x15dd9a['body'],null))[_0xdbaf('0x20')](respondWithResult(_0x55962d,null))['catch'](handleError(_0x55962d,null));};exports[_0xdbaf('0x45')]=function(_0x287b87,_0x5b7185){return db['MailSubstatus'][_0xdbaf('0x42')]({'where':{'id':_0x287b87[_0xdbaf('0x3f')]['id']}})[_0xdbaf('0x20')](handleEntityNotFound(_0x5b7185,null))['then'](removeEntity(_0x5b7185,null))[_0xdbaf('0x3d')](handleError(_0x5b7185,null));};exports[_0xdbaf('0x46')]=function(_0x167155,_0x28bb47){return db[_0xdbaf('0x25')][_0xdbaf('0x46')]()[_0xdbaf('0x20')](respondWithResult(_0x28bb47,null))[_0xdbaf('0x3d')](handleError(_0x28bb47,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 638120e..fce4022 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 _0x53ff=['exports','define','MailSubstatus','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailSubstatus.attributes'];(function(_0x3b96e5,_0x124abe){var _0x8facbe=function(_0x5a95ac){while(--_0x5a95ac){_0x3b96e5['push'](_0x3b96e5['shift']());}};_0x8facbe(++_0x124abe);}(_0x53ff,0x1f1));var _0xf53f=function(_0x368eb4,_0x1512b3){_0x368eb4=_0x368eb4-0x0;var _0x398603=_0x53ff[_0x368eb4];return _0x398603;};'use strict';var _=require(_0xf53f('0x0'));var util=require(_0xf53f('0x1'));var logger=require(_0xf53f('0x2'))(_0xf53f('0x3'));var moment=require(_0xf53f('0x4'));var BPromise=require(_0xf53f('0x5'));var rp=require(_0xf53f('0x6'));var fs=require('fs');var path=require(_0xf53f('0x7'));var rimraf=require('rimraf');var config=require(_0xf53f('0x8'));var attributes=require(_0xf53f('0x9'));module[_0xf53f('0xa')]=function(_0x2d9838,_0x558583){return _0x2d9838[_0xf53f('0xb')](_0xf53f('0xc'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b30=['rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c35b6,_0x46a3f4){var _0x5614ec=function(_0x9bbfc5){while(--_0x9bbfc5){_0x1c35b6['push'](_0x1c35b6['shift']());}};_0x5614ec(++_0x46a3f4);}(_0x1b30,0x1cd));var _0x01b3=function(_0x181168,_0x51cd7b){_0x181168=_0x181168-0x0;var _0x114f9d=_0x1b30[_0x181168];return _0x114f9d;};'use strict';var _=require('lodash');var util=require(_0x01b3('0x0'));var logger=require(_0x01b3('0x1'))(_0x01b3('0x2'));var moment=require(_0x01b3('0x3'));var BPromise=require(_0x01b3('0x4'));var rp=require(_0x01b3('0x5'));var fs=require('fs');var path=require(_0x01b3('0x6'));var rimraf=require(_0x01b3('0x7'));var config=require(_0x01b3('0x8'));var attributes=require(_0x01b3('0x9'));module[_0x01b3('0xa')]=function(_0x544b2b,_0x539b9d){return _0x544b2b[_0x01b3('0xb')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6337123..f0bcea0 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 _0xbf52=['http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x315b7c,_0x19ff8e){var _0x3a99eb=function(_0x21afc2){while(--_0x21afc2){_0x315b7c['push'](_0x315b7c['shift']());}};_0x3a99eb(++_0x19ff8e);}(_0xbf52,0x109));var _0x2bf5=function(_0x89c8c1,_0x5c023f){_0x89c8c1=_0x89c8c1-0x0;var _0x5ce0ad=_0xbf52[_0x89c8c1];return _0x5ce0ad;};'use strict';var _=require(_0x2bf5('0x0'));var util=require(_0x2bf5('0x1'));var moment=require(_0x2bf5('0x2'));var BPromise=require(_0x2bf5('0x3'));var rs=require(_0x2bf5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bf5('0x5'))['db'];var utils=require(_0x2bf5('0x6'));var logger=require(_0x2bf5('0x7'))(_0x2bf5('0x8'));var config=require('../../config/environment');var jayson=require(_0x2bf5('0x9'));var client=jayson[_0x2bf5('0xa')][_0x2bf5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x102b32,_0x47cd16,_0x2d6c53){return new BPromise(function(_0x39c1e4,_0x5b22b3){return client[_0x2bf5('0xc')](_0x102b32,_0x2d6c53)['then'](function(_0xef2b6e){logger[_0x2bf5('0xd')](_0x2bf5('0xe'),_0x47cd16,_0x2bf5('0xf'));logger[_0x2bf5('0x10')](_0x2bf5('0x11'),_0x47cd16,_0x2bf5('0xf'),JSON[_0x2bf5('0x12')](_0xef2b6e));if(_0xef2b6e[_0x2bf5('0x13')]){if(_0xef2b6e[_0x2bf5('0x13')]['code']===0x1f4){logger[_0x2bf5('0x13')](_0x2bf5('0xe'),_0x47cd16,_0xef2b6e['error'][_0x2bf5('0x14')]);return _0x5b22b3(_0xef2b6e[_0x2bf5('0x13')][_0x2bf5('0x14')]);}logger['error'](_0x2bf5('0xe'),_0x47cd16,_0xef2b6e[_0x2bf5('0x13')]['message']);return _0x39c1e4(_0xef2b6e[_0x2bf5('0x13')]['message']);}else{logger[_0x2bf5('0xd')](_0x2bf5('0xe'),_0x47cd16,_0x2bf5('0xf'));_0x39c1e4(_0xef2b6e[_0x2bf5('0x15')][_0x2bf5('0x14')]);}})[_0x2bf5('0x16')](function(_0x4b9b68){logger[_0x2bf5('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x47cd16,_0x4b9b68);_0x5b22b3(_0x4b9b68);});});} \ No newline at end of file +var _0x3aec=['../../mysqldb','../../config/utils','rpc','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0x519e0d,_0x29f976){var _0x3e1159=function(_0x35e900){while(--_0x35e900){_0x519e0d['push'](_0x519e0d['shift']());}};_0x3e1159(++_0x29f976);}(_0x3aec,0x9c));var _0xc3ae=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x3aec[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xc3ae('0x0'));var util=require(_0xc3ae('0x1'));var moment=require('moment');var BPromise=require(_0xc3ae('0x2'));var rs=require(_0xc3ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ae('0x4'))['db'];var utils=require(_0xc3ae('0x5'));var logger=require('../../config/logger')(_0xc3ae('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc3ae('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x438f3c,_0x14cb94,_0x563c05){return new BPromise(function(_0x1750e4,_0x368ef8){return client[_0xc3ae('0x8')](_0x438f3c,_0x563c05)[_0xc3ae('0x9')](function(_0x5c50b1){logger['info'](_0xc3ae('0xa'),_0x14cb94,_0xc3ae('0xb'));logger[_0xc3ae('0xc')](_0xc3ae('0xd'),_0x14cb94,'request\x20sent',JSON[_0xc3ae('0xe')](_0x5c50b1));if(_0x5c50b1['error']){if(_0x5c50b1[_0xc3ae('0xf')]['code']===0x1f4){logger[_0xc3ae('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x14cb94,_0x5c50b1[_0xc3ae('0xf')]['message']);return _0x368ef8(_0x5c50b1[_0xc3ae('0xf')]['message']);}logger['error'](_0xc3ae('0xa'),_0x14cb94,_0x5c50b1['error'][_0xc3ae('0x10')]);return _0x1750e4(_0x5c50b1[_0xc3ae('0xf')][_0xc3ae('0x10')]);}else{logger[_0xc3ae('0x11')](_0xc3ae('0xa'),_0x14cb94,_0xc3ae('0xb'));_0x1750e4(_0x5c50b1[_0xc3ae('0x12')][_0xc3ae('0x10')]);}})[_0xc3ae('0x13')](function(_0x2062aa){logger[_0xc3ae('0xf')](_0xc3ae('0xa'),_0x14cb94,_0x2062aa);_0x368ef8(_0x2062aa);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 7ca33ce..9c0b98b 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 _0x3e24=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','exports','multer','util'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x3e24,0x167));var _0x43e2=function(_0x402950,_0x52d699){_0x402950=_0x402950-0x0;var _0x643b00=_0x3e24[_0x402950];return _0x643b00;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var auth=require(_0x43e2('0x5'));var interaction=require(_0x43e2('0x6'));var config=require('../../config/environment');var controller=require(_0x43e2('0x7'));router[_0x43e2('0x8')]('/',auth[_0x43e2('0x9')](),controller[_0x43e2('0xa')]);router[_0x43e2('0x8')](_0x43e2('0xb'),auth[_0x43e2('0x9')](),controller['describe']);router[_0x43e2('0x8')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0xe')]('/',auth['isAuthenticated'](),controller[_0x43e2('0xf')]);router[_0x43e2('0x10')]('/:id',auth[_0x43e2('0x9')](),controller['update']);router['delete']('/:id',auth[_0x43e2('0x9')](),controller[_0x43e2('0x11')]);module[_0x43e2('0x12')]=router; \ No newline at end of file +var _0x5496=['./mailTransferReport.controller','get','/describe','describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5496,0x175));var _0x6549=function(_0x13efd4,_0x2d9951){_0x13efd4=_0x13efd4-0x0;var _0x25b48c=_0x5496[_0x13efd4];return _0x25b48c;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var auth=require(_0x6549('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6549('0x6'));var controller=require(_0x6549('0x7'));router[_0x6549('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6549('0x8')](_0x6549('0x9'),auth['isAuthenticated'](),controller[_0x6549('0xa')]);router[_0x6549('0x8')](_0x6549('0xb'),auth['isAuthenticated'](),controller[_0x6549('0xc')]);router[_0x6549('0xd')]('/',auth[_0x6549('0xe')](),controller[_0x6549('0xf')]);router[_0x6549('0x10')](_0x6549('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6549('0x11')](_0x6549('0xb'),auth[_0x6549('0xe')](),controller[_0x6549('0x12')]);module[_0x6549('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 25ad01c..0343bbc 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 _0x6853=['STRING','ENUM','queue','DATE','NOW','sequelize'];(function(_0x3e45d6,_0x4f9118){var _0xaca519=function(_0x466e19){while(--_0x466e19){_0x3e45d6['push'](_0x3e45d6['shift']());}};_0xaca519(++_0x4f9118);}(_0x6853,0x77));var _0x3685=function(_0x41ded9,_0x50cec9){_0x41ded9=_0x41ded9-0x0;var _0x46743d=_0x6853[_0x41ded9];return _0x46743d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3685('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3685('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3685('0x2')]('account','agent',_0x3685('0x3')),'allowNull':![],'defaultValue':_0x3685('0x3')},'transferredAt':{'type':Sequelize[_0x3685('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x3685('0x5')]}}; \ No newline at end of file +var _0xb7b7=['exports','ENUM','account','queue','NOW','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7b7,0x1d9));var _0x7b7b=function(_0x86133b,_0x5ea276){_0x86133b=_0x86133b-0x0;var _0x86265f=_0xb7b7[_0x86133b];return _0x86265f;};'use strict';var moment=require('moment');var Sequelize=require(_0x7b7b('0x0'));module[_0x7b7b('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b7b('0x2')](_0x7b7b('0x3'),'agent',_0x7b7b('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7b7b('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ab4c578..d3cd7e9 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 _0xe5b5=['findAll','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','reject','update','then','error','name','index','MailTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xe5b5[_0x1b2422];return _0x376573;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require(_0x5e5b('0x4'));var rp=require(_0x5e5b('0x5'));var moment=require(_0x5e5b('0x6'));var BPromise=require(_0x5e5b('0x7'));var Mustache=require(_0x5e5b('0x8'));var util=require(_0x5e5b('0x9'));var path=require(_0x5e5b('0xa'));var sox=require(_0x5e5b('0xb'));var csv=require(_0x5e5b('0xc'));var ejs=require(_0x5e5b('0xd'));var fs=require('fs');var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xc'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e5b('0x17'))(_0x5e5b('0x18'));var utils=require(_0x5e5b('0x19'));var config=require(_0x5e5b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1424,_0x5ebf65){_0x5ebf65=_0x5ebf65||0xcc;return function(_0x310f71){if(_0x310f71){return _0x4a1424[_0x5e5b('0x1b')](_0x5ebf65);}return _0x4a1424[_0x5e5b('0x1c')](_0x5ebf65)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x13a01e,_0x1e3483){_0x1e3483=_0x1e3483||0xc8;return function(_0x2e331d){if(_0x2e331d){return _0x13a01e['status'](_0x1e3483)[_0x5e5b('0x1e')](_0x2e331d);}};}function respondWithFilteredResult(_0x2e92c3,_0x4ff37b){return function(_0x227417){if(_0x227417){var _0x578c14=_0x227417[_0x5e5b('0x1f')],_0x4e9509=_0x4ff37b['offset'],_0x13a1cb=_0x4ff37b[_0x5e5b('0x20')]+_0x4ff37b['limit'],_0x444435;if(_0x13a1cb>=_0x578c14){_0x13a1cb=_0x578c14;_0x444435=0xc8;}else{_0x444435=0xce;}_0x2e92c3[_0x5e5b('0x1c')](_0x444435);return _0x2e92c3[_0x5e5b('0x21')]('Content-Range',_0x4e9509+'-'+_0x13a1cb+'/'+_0x578c14)[_0x5e5b('0x1e')](_0x227417);}return null;};}function patchUpdates(_0x1560e1){return function(_0x2281c8){try{jsonpatch['apply'](_0x2281c8,_0x1560e1,!![]);}catch(_0x2bf0b7){return BPromise[_0x5e5b('0x22')](_0x2bf0b7);}return _0x2281c8['save']();};}function saveUpdates(_0x2fdc38,_0x1aa0c2){return function(_0x3c488e){if(_0x3c488e){return _0x3c488e[_0x5e5b('0x23')](_0x2fdc38)[_0x5e5b('0x24')](function(_0x33d61b){return _0x33d61b;});}return null;};}function removeEntity(_0x93df5c,_0x37552c){return function(_0x4a78e3){if(_0x4a78e3){return _0x4a78e3['destroy']()[_0x5e5b('0x24')](function(){_0x93df5c[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0xe1c268,_0x2e38ed){return function(_0x28cd95){if(!_0x28cd95){_0xe1c268[_0x5e5b('0x1b')](0x194);}return _0x28cd95;};}function handleError(_0x18903e,_0x161599){_0x161599=_0x161599||0x1f4;return function(_0x26bc02){logger[_0x5e5b('0x25')](_0x26bc02['stack']);if(_0x26bc02[_0x5e5b('0x26')]){delete _0x26bc02[_0x5e5b('0x26')];}_0x18903e[_0x5e5b('0x1c')](_0x161599)['send'](_0x26bc02);};}exports[_0x5e5b('0x27')]=function(_0xdb2863,_0x5ee866){var _0x13ff91={},_0x21c74b={},_0x39ce16={'count':0x0,'rows':[]};var _0x36b595=db[_0x5e5b('0x28')][_0x5e5b('0x29')];_0x21c74b[_0x5e5b('0x2a')]=_[_0x5e5b('0x2b')](_0x36b595);_0x21c74b[_0x5e5b('0x2c')]=_[_0x5e5b('0x2b')](_0xdb2863[_0x5e5b('0x2c')]);_0x21c74b[_0x5e5b('0x2d')]=_['intersection'](_0x21c74b['model'],_0x21c74b[_0x5e5b('0x2c')]);_0x13ff91[_0x5e5b('0x2e')]=_[_0x5e5b('0x2f')](_0x21c74b[_0x5e5b('0x2a')],qs[_0x5e5b('0x30')](_0xdb2863['query'][_0x5e5b('0x30')]));_0x13ff91['attributes']=_0x13ff91[_0x5e5b('0x2e')][_0x5e5b('0x31')]?_0x13ff91[_0x5e5b('0x2e')]:_0x21c74b[_0x5e5b('0x2a')];if(!_0xdb2863['query'][_0x5e5b('0x32')](_0x5e5b('0x33'))){_0x13ff91['limit']=qs[_0x5e5b('0x34')](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x34')]);_0x13ff91[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x20')]);}_0x13ff91[_0x5e5b('0x35')]=qs['sort'](_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x36')]);_0x13ff91[_0x5e5b('0x37')]=qs[_0x5e5b('0x2d')](_[_0x5e5b('0x38')](_0xdb2863[_0x5e5b('0x2c')],_0x21c74b['filters']));if(_0xdb2863['query'][_0x5e5b('0x39')]){_0x13ff91[_0x5e5b('0x37')]=_[_0x5e5b('0x3a')](_0x13ff91['where'],{'$or':_[_0x5e5b('0x3b')](_0x36b595,function(_0x14bf53){if(_0x14bf53[_0x5e5b('0x3c')][_0x5e5b('0x3d')]!=='VIRTUAL'){var _0x5b3e0d={};_0x5b3e0d[_0x14bf53[_0x5e5b('0x3e')]]={'$like':'%'+_0xdb2863['query']['filter']+'%'};return _0x5b3e0d;}})});}_0x13ff91=_[_0x5e5b('0x3a')]({},_0x13ff91,_0xdb2863[_0x5e5b('0x3f')]);var _0xee3e6f={'where':_0x13ff91['where']};return db[_0x5e5b('0x28')]['count'](_0xee3e6f)['then'](function(_0x261057){_0x39ce16[_0x5e5b('0x1f')]=_0x261057;if(_0xdb2863[_0x5e5b('0x2c')][_0x5e5b('0x40')]){_0x13ff91[_0x5e5b('0x41')]=[{'all':!![]}];}return db[_0x5e5b('0x28')][_0x5e5b('0x42')](_0x13ff91);})[_0x5e5b('0x24')](function(_0x1034fa){_0x39ce16['rows']=_0x1034fa;return _0x39ce16;})[_0x5e5b('0x24')](respondWithFilteredResult(_0x5ee866,_0x13ff91))[_0x5e5b('0x43')](handleError(_0x5ee866,null));};exports['show']=function(_0x204487,_0x4b54b0){var _0x125f95={'raw':!![],'where':{'id':_0x204487[_0x5e5b('0x44')]['id']}},_0x14b152={};_0x14b152[_0x5e5b('0x2a')]=_[_0x5e5b('0x2b')](db[_0x5e5b('0x28')][_0x5e5b('0x29')]);_0x14b152[_0x5e5b('0x2c')]=_[_0x5e5b('0x2b')](_0x204487[_0x5e5b('0x2c')]);_0x14b152[_0x5e5b('0x2d')]=_['intersection'](_0x14b152[_0x5e5b('0x2a')],_0x14b152[_0x5e5b('0x2c')]);_0x125f95[_0x5e5b('0x2e')]=_['intersection'](_0x14b152[_0x5e5b('0x2a')],qs[_0x5e5b('0x30')](_0x204487['query'][_0x5e5b('0x30')]));_0x125f95[_0x5e5b('0x2e')]=_0x125f95['attributes'][_0x5e5b('0x31')]?_0x125f95['attributes']:_0x14b152['model'];if(_0x204487['query'][_0x5e5b('0x40')]){_0x125f95['include']=[{'all':!![]}];}_0x125f95=_[_0x5e5b('0x3a')]({},_0x125f95,_0x204487['options']);return db[_0x5e5b('0x28')][_0x5e5b('0x45')](_0x125f95)[_0x5e5b('0x24')](handleEntityNotFound(_0x4b54b0,null))[_0x5e5b('0x24')](respondWithResult(_0x4b54b0,null))[_0x5e5b('0x43')](handleError(_0x4b54b0,null));};exports[_0x5e5b('0x46')]=function(_0x8b03f2,_0x4e4d03){return db['MailTransferReport'][_0x5e5b('0x46')](_0x8b03f2['body'],{})['then'](respondWithResult(_0x4e4d03,0xc9))['catch'](handleError(_0x4e4d03,null));};exports[_0x5e5b('0x23')]=function(_0x5d63cc,_0x42f42d){if(_0x5d63cc[_0x5e5b('0x47')]['id']){delete _0x5d63cc[_0x5e5b('0x47')]['id'];}return db[_0x5e5b('0x28')][_0x5e5b('0x45')]({'where':{'id':_0x5d63cc[_0x5e5b('0x44')]['id']}})['then'](handleEntityNotFound(_0x42f42d,null))[_0x5e5b('0x24')](saveUpdates(_0x5d63cc[_0x5e5b('0x47')],null))['then'](respondWithResult(_0x42f42d,null))[_0x5e5b('0x43')](handleError(_0x42f42d,null));};exports['destroy']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x28')][_0x5e5b('0x45')]({'where':{'id':_0x41e4b3['params']['id']}})[_0x5e5b('0x24')](handleEntityNotFound(_0x36d8fa,null))[_0x5e5b('0x24')](removeEntity(_0x36d8fa,null))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x48')]=function(_0x18844c,_0x1a1437){return db[_0x5e5b('0x28')][_0x5e5b('0x48')]()[_0x5e5b('0x24')](respondWithResult(_0x1a1437,null))['catch'](handleError(_0x1a1437,null));}; \ No newline at end of file +var _0xaa88=['rows','catch','show','params','rawAttributes','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','apply','reject','save','update','then','error','name','send','index','MailTransferReport','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','key','VIRTUAL','field','includeAll','include','findAll'];(function(_0xe5366,_0x32ea05){var _0x3dfd7d=function(_0x3aeb41){while(--_0x3aeb41){_0xe5366['push'](_0xe5366['shift']());}};_0x3dfd7d(++_0x32ea05);}(_0xaa88,0x137));var _0x8aa8=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0xaa88[_0x128450];return _0x4d80ed;};'use strict';var pdf=require(_0x8aa8('0x0'));var emlformat=require(_0x8aa8('0x1'));var rimraf=require(_0x8aa8('0x2'));var zipdir=require(_0x8aa8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8aa8('0x4'));var moment=require(_0x8aa8('0x5'));var BPromise=require(_0x8aa8('0x6'));var Mustache=require(_0x8aa8('0x7'));var util=require(_0x8aa8('0x8'));var path=require(_0x8aa8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8aa8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var hardwareService=require(_0x8aa8('0x13'));var logger=require(_0x8aa8('0x14'))(_0x8aa8('0x15'));var utils=require('../../config/utils');var config=require(_0x8aa8('0x16'));var db=require(_0x8aa8('0x17'))['db'];function respondWithStatusCode(_0x50787d,_0x370b25){_0x370b25=_0x370b25||0xcc;return function(_0xa691d6){if(_0xa691d6){return _0x50787d[_0x8aa8('0x18')](_0x370b25);}return _0x50787d['status'](_0x370b25)[_0x8aa8('0x19')]();};}function respondWithResult(_0x179e33,_0x2fa66f){_0x2fa66f=_0x2fa66f||0xc8;return function(_0x4b686e){if(_0x4b686e){return _0x179e33[_0x8aa8('0x1a')](_0x2fa66f)['json'](_0x4b686e);}};}function respondWithFilteredResult(_0x4f3a2e,_0x433e95){return function(_0x200662){if(_0x200662){var _0xae81a0=_0x200662[_0x8aa8('0x1b')],_0xa6c2af=_0x433e95[_0x8aa8('0x1c')],_0x42a6a4=_0x433e95[_0x8aa8('0x1c')]+_0x433e95['limit'],_0x3778f4;if(_0x42a6a4>=_0xae81a0){_0x42a6a4=_0xae81a0;_0x3778f4=0xc8;}else{_0x3778f4=0xce;}_0x4f3a2e['status'](_0x3778f4);return _0x4f3a2e[_0x8aa8('0x1d')]('Content-Range',_0xa6c2af+'-'+_0x42a6a4+'/'+_0xae81a0)['json'](_0x200662);}return null;};}function patchUpdates(_0xab7af5){return function(_0x5ac0d9){try{jsonpatch[_0x8aa8('0x1e')](_0x5ac0d9,_0xab7af5,!![]);}catch(_0x41092b){return BPromise[_0x8aa8('0x1f')](_0x41092b);}return _0x5ac0d9[_0x8aa8('0x20')]();};}function saveUpdates(_0x502547,_0xcc2c19){return function(_0x36c445){if(_0x36c445){return _0x36c445[_0x8aa8('0x21')](_0x502547)[_0x8aa8('0x22')](function(_0x4c754e){return _0x4c754e;});}return null;};}function removeEntity(_0x34f1b7,_0x5d9b62){return function(_0x26cf63){if(_0x26cf63){return _0x26cf63['destroy']()[_0x8aa8('0x22')](function(){_0x34f1b7['status'](0xcc)[_0x8aa8('0x19')]();});}};}function handleEntityNotFound(_0x557e4e,_0x65945b){return function(_0x40adb5){if(!_0x40adb5){_0x557e4e[_0x8aa8('0x18')](0x194);}return _0x40adb5;};}function handleError(_0x5e5d91,_0x24f428){_0x24f428=_0x24f428||0x1f4;return function(_0xe978ab){logger[_0x8aa8('0x23')](_0xe978ab['stack']);if(_0xe978ab['name']){delete _0xe978ab[_0x8aa8('0x24')];}_0x5e5d91[_0x8aa8('0x1a')](_0x24f428)[_0x8aa8('0x25')](_0xe978ab);};}exports[_0x8aa8('0x26')]=function(_0x24143e,_0x4a8212){var _0x2bc34a={},_0x49d561={},_0x2a0ff2={'count':0x0,'rows':[]};var _0xe7768=db[_0x8aa8('0x27')]['rawAttributes'];_0x49d561['model']=_[_0x8aa8('0x28')](_0xe7768);_0x49d561['query']=_[_0x8aa8('0x28')](_0x24143e[_0x8aa8('0x29')]);_0x49d561[_0x8aa8('0x2a')]=_[_0x8aa8('0x2b')](_0x49d561[_0x8aa8('0x2c')],_0x49d561['query']);_0x2bc34a[_0x8aa8('0x2d')]=_[_0x8aa8('0x2b')](_0x49d561['model'],qs[_0x8aa8('0x2e')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x2e')]));_0x2bc34a['attributes']=_0x2bc34a[_0x8aa8('0x2d')][_0x8aa8('0x2f')]?_0x2bc34a[_0x8aa8('0x2d')]:_0x49d561[_0x8aa8('0x2c')];if(!_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x30')](_0x8aa8('0x31'))){_0x2bc34a[_0x8aa8('0x32')]=qs[_0x8aa8('0x32')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x32')]);_0x2bc34a['offset']=qs['offset'](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x1c')]);}_0x2bc34a[_0x8aa8('0x33')]=qs[_0x8aa8('0x34')](_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x34')]);_0x2bc34a['where']=qs['filters'](_[_0x8aa8('0x35')](_0x24143e['query'],_0x49d561[_0x8aa8('0x2a')]));if(_0x24143e[_0x8aa8('0x29')][_0x8aa8('0x36')]){_0x2bc34a['where']=_[_0x8aa8('0x37')](_0x2bc34a[_0x8aa8('0x38')],{'$or':_[_0x8aa8('0x39')](_0xe7768,function(_0x5c28fa){if(_0x5c28fa['type'][_0x8aa8('0x3a')]!==_0x8aa8('0x3b')){var _0x52f87d={};_0x52f87d[_0x5c28fa[_0x8aa8('0x3c')]]={'$like':'%'+_0x24143e[_0x8aa8('0x29')]['filter']+'%'};return _0x52f87d;}})});}_0x2bc34a=_[_0x8aa8('0x37')]({},_0x2bc34a,_0x24143e['options']);var _0x530a66={'where':_0x2bc34a[_0x8aa8('0x38')]};return db['MailTransferReport'][_0x8aa8('0x1b')](_0x530a66)[_0x8aa8('0x22')](function(_0x926ff2){_0x2a0ff2[_0x8aa8('0x1b')]=_0x926ff2;if(_0x24143e['query'][_0x8aa8('0x3d')]){_0x2bc34a[_0x8aa8('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x8aa8('0x3f')](_0x2bc34a);})[_0x8aa8('0x22')](function(_0x5ea57a){_0x2a0ff2[_0x8aa8('0x40')]=_0x5ea57a;return _0x2a0ff2;})[_0x8aa8('0x22')](respondWithFilteredResult(_0x4a8212,_0x2bc34a))[_0x8aa8('0x41')](handleError(_0x4a8212,null));};exports[_0x8aa8('0x42')]=function(_0x189d53,_0xea42cb){var _0x46711b={'raw':!![],'where':{'id':_0x189d53[_0x8aa8('0x43')]['id']}},_0x3fb265={};_0x3fb265[_0x8aa8('0x2c')]=_[_0x8aa8('0x28')](db[_0x8aa8('0x27')][_0x8aa8('0x44')]);_0x3fb265[_0x8aa8('0x29')]=_[_0x8aa8('0x28')](_0x189d53[_0x8aa8('0x29')]);_0x3fb265['filters']=_[_0x8aa8('0x2b')](_0x3fb265['model'],_0x3fb265['query']);_0x46711b['attributes']=_[_0x8aa8('0x2b')](_0x3fb265['model'],qs['fields'](_0x189d53[_0x8aa8('0x29')]['fields']));_0x46711b[_0x8aa8('0x2d')]=_0x46711b['attributes']['length']?_0x46711b[_0x8aa8('0x2d')]:_0x3fb265[_0x8aa8('0x2c')];if(_0x189d53[_0x8aa8('0x29')][_0x8aa8('0x3d')]){_0x46711b[_0x8aa8('0x3e')]=[{'all':!![]}];}_0x46711b=_[_0x8aa8('0x37')]({},_0x46711b,_0x189d53[_0x8aa8('0x45')]);return db['MailTransferReport'][_0x8aa8('0x46')](_0x46711b)['then'](handleEntityNotFound(_0xea42cb,null))[_0x8aa8('0x22')](respondWithResult(_0xea42cb,null))[_0x8aa8('0x41')](handleError(_0xea42cb,null));};exports[_0x8aa8('0x47')]=function(_0x2bc6d3,_0x2a0a14){return db[_0x8aa8('0x27')]['create'](_0x2bc6d3['body'],{})[_0x8aa8('0x22')](respondWithResult(_0x2a0a14,0xc9))[_0x8aa8('0x41')](handleError(_0x2a0a14,null));};exports['update']=function(_0x35eeea,_0x25906d){if(_0x35eeea[_0x8aa8('0x48')]['id']){delete _0x35eeea['body']['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x35eeea['params']['id']}})[_0x8aa8('0x22')](handleEntityNotFound(_0x25906d,null))[_0x8aa8('0x22')](saveUpdates(_0x35eeea['body'],null))[_0x8aa8('0x22')](respondWithResult(_0x25906d,null))[_0x8aa8('0x41')](handleError(_0x25906d,null));};exports[_0x8aa8('0x49')]=function(_0x1aa1b6,_0x20384a){return db[_0x8aa8('0x27')]['find']({'where':{'id':_0x1aa1b6['params']['id']}})[_0x8aa8('0x22')](handleEntityNotFound(_0x20384a,null))['then'](removeEntity(_0x20384a,null))[_0x8aa8('0x41')](handleError(_0x20384a,null));};exports['describe']=function(_0x1b4843,_0x263620){return db[_0x8aa8('0x27')][_0x8aa8('0x4a')]()[_0x8aa8('0x22')](respondWithResult(_0x263620,null))[_0x8aa8('0x41')](handleError(_0x263620,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 633ce6c..c9dadbf 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 _0x31f0=['request-promise','path','../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x31a26b,_0x54081e){var _0x2d7ac1=function(_0x7510d2){while(--_0x7510d2){_0x31a26b['push'](_0x31a26b['shift']());}};_0x2d7ac1(++_0x54081e);}(_0x31f0,0xb7));var _0x031f=function(_0x4bdc34,_0x8f749){_0x4bdc34=_0x4bdc34-0x0;var _0x211486=_0x31f0[_0x4bdc34];return _0x211486;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('MailTransferReport',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['report_mail_transfer','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x038b,0x114));var _0xb038=function(_0x199eed,_0x44c636){_0x199eed=_0x199eed-0x0;var _0x4c1c84=_0x038b[_0x199eed];return _0x4c1c84;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'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 fba5170..66116ab 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 _0x070f=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5dce85,_0x1a5102){var _0xf20074=function(_0x2ed09b){while(--_0x2ed09b){_0x5dce85['push'](_0x5dce85['shift']());}};_0xf20074(++_0x1a5102);}(_0x070f,0x73));var _0xf070=function(_0x5b08ac,_0x2f2af7){_0x5b08ac=_0x5b08ac-0x0;var _0x4a8e61=_0x070f[_0x5b08ac];return _0x4a8e61;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var moment=require('moment');var BPromise=require(_0xf070('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf070('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf070('0x4'));var logger=require(_0xf070('0x5'))(_0xf070('0x6'));var config=require('../../config/environment');var jayson=require(_0xf070('0x7'));var client=jayson[_0xf070('0x8')][_0xf070('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a329e,_0x14a011,_0x23e492){return new BPromise(function(_0x490b2c,_0x179e13){return client[_0xf070('0xa')](_0x5a329e,_0x23e492)['then'](function(_0x3dfc6f){logger[_0xf070('0xb')](_0xf070('0xc'),_0x14a011,'request\x20sent');logger[_0xf070('0xd')](_0xf070('0xe'),_0x14a011,_0xf070('0xf'),JSON[_0xf070('0x10')](_0x3dfc6f));if(_0x3dfc6f['error']){if(_0x3dfc6f[_0xf070('0x11')][_0xf070('0x12')]===0x1f4){logger[_0xf070('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x14a011,_0x3dfc6f[_0xf070('0x11')][_0xf070('0x13')]);return _0x179e13(_0x3dfc6f[_0xf070('0x11')][_0xf070('0x13')]);}logger[_0xf070('0x11')](_0xf070('0xc'),_0x14a011,_0x3dfc6f[_0xf070('0x11')][_0xf070('0x13')]);return _0x490b2c(_0x3dfc6f[_0xf070('0x11')][_0xf070('0x13')]);}else{logger[_0xf070('0xb')](_0xf070('0xc'),_0x14a011,'request\x20sent');_0x490b2c(_0x3dfc6f[_0xf070('0x14')][_0xf070('0x13')]);}})[_0xf070('0x15')](function(_0x36d0f5){logger[_0xf070('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x14a011,_0x36d0f5);_0x179e13(_0x36d0f5);});});} \ No newline at end of file +var _0x107e=['http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x9c6fcf,_0x20baf4){var _0xf26b4c=function(_0x59000b){while(--_0x59000b){_0x9c6fcf['push'](_0x9c6fcf['shift']());}};_0xf26b4c(++_0x20baf4);}(_0x107e,0x1d8));var _0xe107=function(_0x1d7d59,_0x49d60d){_0x1d7d59=_0x1d7d59-0x0;var _0x565b04=_0x107e[_0x1d7d59];return _0x565b04;};'use strict';var _=require('lodash');var util=require(_0xe107('0x0'));var moment=require(_0xe107('0x1'));var BPromise=require(_0xe107('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe107('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe107('0x4'))(_0xe107('0x5'));var config=require('../../config/environment');var jayson=require(_0xe107('0x6'));var client=jayson[_0xe107('0x7')][_0xe107('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d13b3,_0x1d4e92,_0x37a7f8){return new BPromise(function(_0x5999f0,_0x5539c5){return client[_0xe107('0x9')](_0x4d13b3,_0x37a7f8)['then'](function(_0x6ac56c){logger[_0xe107('0xa')](_0xe107('0xb'),_0x1d4e92,_0xe107('0xc'));logger[_0xe107('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1d4e92,_0xe107('0xc'),JSON[_0xe107('0xe')](_0x6ac56c));if(_0x6ac56c[_0xe107('0xf')]){if(_0x6ac56c[_0xe107('0xf')][_0xe107('0x10')]===0x1f4){logger['error'](_0xe107('0xb'),_0x1d4e92,_0x6ac56c['error']['message']);return _0x5539c5(_0x6ac56c[_0xe107('0xf')][_0xe107('0x11')]);}logger[_0xe107('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x1d4e92,_0x6ac56c['error']['message']);return _0x5999f0(_0x6ac56c[_0xe107('0xf')][_0xe107('0x11')]);}else{logger[_0xe107('0xa')](_0xe107('0xb'),_0x1d4e92,_0xe107('0xc'));_0x5999f0(_0x6ac56c[_0xe107('0x12')]['message']);}})[_0xe107('0x13')](function(_0x1e4087){logger['error'](_0xe107('0xb'),_0x1d4e92,_0x1e4087);_0x5539c5(_0x1e4087);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 53687e3..5f08684 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 _0xf2cd=['/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','put'];(function(_0x2d8bb7,_0x569738){var _0x44e852=function(_0x527d7b){while(--_0x527d7b){_0x2d8bb7['push'](_0x2d8bb7['shift']());}};_0x44e852(++_0x569738);}(_0xf2cd,0x1bc));var _0xdf2c=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xf2cd[_0x344adc];return _0x4014b2;};'use strict';var multer=require(_0xdf2c('0x0'));var util=require(_0xdf2c('0x1'));var path=require(_0xdf2c('0x2'));var timeout=require(_0xdf2c('0x3'));var express=require(_0xdf2c('0x4'));var router=express[_0xdf2c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf2c('0x6'));var config=require(_0xdf2c('0x7'));var controller=require('./memberReport.controller');router[_0xdf2c('0x8')]('/',auth[_0xdf2c('0x9')](),controller[_0xdf2c('0xa')]);router[_0xdf2c('0x8')](_0xdf2c('0xb'),auth['isAuthenticated'](),controller[_0xdf2c('0xc')]);router[_0xdf2c('0x8')]('/:id',auth[_0xdf2c('0x9')](),controller[_0xdf2c('0xd')]);router['post']('/',auth[_0xdf2c('0x9')](),controller['create']);router[_0xdf2c('0xe')]('/:id',auth[_0xdf2c('0x9')](),controller['update']);router['delete'](_0xdf2c('0xf'),auth[_0xdf2c('0x9')](),controller['destroy']);module[_0xdf2c('0x10')]=router; \ No newline at end of file +var _0xb71a=['put','update','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./memberReport.controller','index','get','/describe','/:id','isAuthenticated','show','post','create'];(function(_0x54af4a,_0xb488d0){var _0x6017da=function(_0x2b33cf){while(--_0x2b33cf){_0x54af4a['push'](_0x54af4a['shift']());}};_0x6017da(++_0xb488d0);}(_0xb71a,0x148));var _0xab71=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xb71a[_0x411add];return _0x238242;};'use strict';var multer=require(_0xab71('0x0'));var util=require(_0xab71('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab71('0x2'));var router=express['Router']();var auth=require(_0xab71('0x3'));var interaction=require(_0xab71('0x4'));var config=require('../../config/environment');var controller=require(_0xab71('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xab71('0x6')]);router[_0xab71('0x7')](_0xab71('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xab71('0x7')](_0xab71('0x9'),auth[_0xab71('0xa')](),controller[_0xab71('0xb')]);router[_0xab71('0xc')]('/',auth[_0xab71('0xa')](),controller[_0xab71('0xd')]);router[_0xab71('0xe')](_0xab71('0x9'),auth[_0xab71('0xa')](),controller[_0xab71('0xf')]);router[_0xab71('0x10')](_0xab71('0x9'),auth[_0xab71('0xa')](),controller['destroy']);module[_0xab71('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5449170..7ddf984 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 _0x5836=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','INTEGER','enterAt','diff'];(function(_0x5445a1,_0x1ba385){var _0x3bf175=function(_0x3e999a){while(--_0x3e999a){_0x5445a1['push'](_0x5445a1['shift']());}};_0x3bf175(++_0x1ba385);}(_0x5836,0xbc));var _0x6583=function(_0x53915d,_0x1daa70){_0x53915d=_0x53915d-0x0;var _0x11e040=_0x5836[_0x53915d];return _0x11e040;};'use strict';var Sequelize=require(_0x6583('0x0'));var moment=require('moment');module[_0x6583('0x1')]={'channel':{'type':Sequelize[_0x6583('0x2')]},'membername':{'type':Sequelize[_0x6583('0x2')]},'interface':{'type':Sequelize[_0x6583('0x2')]},'type':{'type':Sequelize[_0x6583('0x2')],'defaultValue':_0x6583('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6583('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5135b4){var _0x5067ff=moment(_0x5135b4);var _0x390eb7=moment(this['getDataValue'](_0x6583('0x5')));var _0x8b2ef9=_0x5067ff[_0x6583('0x6')](_0x390eb7,_0x6583('0x7'));this[_0x6583('0x8')](_0x6583('0x9'),_0x5135b4);this[_0x6583('0x8')](_0x6583('0xa'),_0x8b2ef9||null);}},'data1':{'type':Sequelize[_0x6583('0x2')],'comment':_0x6583('0xb')},'data2':{'type':Sequelize[_0x6583('0x2')],'comment':_0x6583('0xc')},'data3':{'type':Sequelize[_0x6583('0x2')],'comment':_0x6583('0xd')},'data4':{'type':Sequelize[_0x6583('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x6583('0x2')],'comment':_0x6583('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6583('0x2')]}}; \ No newline at end of file +var _0x4cb4=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING'];(function(_0x449870,_0x555c4d){var _0x18555a=function(_0x4f7272){while(--_0x4f7272){_0x449870['push'](_0x449870['shift']());}};_0x18555a(++_0x555c4d);}(_0x4cb4,0x10d));var _0x44cb=function(_0x246890,_0x46b964){_0x246890=_0x246890-0x0;var _0x2b2a5a=_0x4cb4[_0x246890];return _0x2b2a5a;};'use strict';var Sequelize=require(_0x44cb('0x0'));var moment=require(_0x44cb('0x1'));module['exports']={'channel':{'type':Sequelize[_0x44cb('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x44cb('0x2')]},'type':{'type':Sequelize[_0x44cb('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x44cb('0x3')},'duration':{'type':Sequelize[_0x44cb('0x4')]},'enterAt':{'type':Sequelize[_0x44cb('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x271e1c){var _0x4c3f07=moment(_0x271e1c);var _0x1405e8=moment(this['getDataValue']('enterAt'));var _0x407118=_0x4c3f07[_0x44cb('0x6')](_0x1405e8,_0x44cb('0x7'));this[_0x44cb('0x8')](_0x44cb('0x9'),_0x271e1c);this[_0x44cb('0x8')](_0x44cb('0xa'),_0x407118||null);}},'data1':{'type':Sequelize[_0x44cb('0x2')],'comment':_0x44cb('0xb')},'data2':{'type':Sequelize[_0x44cb('0x2')],'comment':_0x44cb('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x44cb('0xd')},'data4':{'type':Sequelize[_0x44cb('0x2')],'comment':_0x44cb('0xe')},'data5':{'type':Sequelize[_0x44cb('0x2')],'comment':_0x44cb('0xf')},'role':{'type':Sequelize[_0x44cb('0x2')]},'internal':{'type':Sequelize[_0x44cb('0x4')]},'uniqueid':{'type':Sequelize[_0x44cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 80601d2..65cd442 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 _0xbc09=['show','params','rawAttributes','length','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','MemberReport','model','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch'];(function(_0x50aacb,_0x3a0e0a){var _0x4d142c=function(_0x46ee8b){while(--_0x46ee8b){_0x50aacb['push'](_0x50aacb['shift']());}};_0x4d142c(++_0x3a0e0a);}(_0xbc09,0x11e));var _0x9bc0=function(_0x162bf7,_0x38549b){_0x162bf7=_0x162bf7-0x0;var _0x30232d=_0xbc09[_0x162bf7];return _0x30232d;};'use strict';var pdf=require(_0x9bc0('0x0'));var emlformat=require(_0x9bc0('0x1'));var rimraf=require(_0x9bc0('0x2'));var zipdir=require(_0x9bc0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bc0('0x4'));var moment=require(_0x9bc0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9bc0('0x6'));var sox=require(_0x9bc0('0x7'));var csv=require(_0x9bc0('0x8'));var ejs=require(_0x9bc0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9bc0('0xa'));var crypto=require(_0x9bc0('0xb'));var jsforce=require(_0x9bc0('0xc'));var deskjs=require(_0x9bc0('0xd'));var toCsv=require(_0x9bc0('0x8'));var querystring=require(_0x9bc0('0xe'));var Papa=require(_0x9bc0('0xf'));var Redis=require(_0x9bc0('0x10'));var authService=require(_0x9bc0('0x11'));var qs=require(_0x9bc0('0x12'));var hardwareService=require(_0x9bc0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9bc0('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x420986,_0x5ead64){_0x5ead64=_0x5ead64||0xcc;return function(_0x2196b8){if(_0x2196b8){return _0x420986[_0x9bc0('0x15')](_0x5ead64);}return _0x420986[_0x9bc0('0x16')](_0x5ead64)[_0x9bc0('0x17')]();};}function respondWithResult(_0x5ab2ab,_0x442d62){_0x442d62=_0x442d62||0xc8;return function(_0x165c2b){if(_0x165c2b){return _0x5ab2ab['status'](_0x442d62)[_0x9bc0('0x18')](_0x165c2b);}};}function respondWithFilteredResult(_0x196e8a,_0x11abfc){return function(_0x3ad0bb){if(_0x3ad0bb){var _0x38905f=_0x3ad0bb[_0x9bc0('0x19')],_0x576cfb=_0x11abfc[_0x9bc0('0x1a')],_0x22e976=_0x11abfc[_0x9bc0('0x1a')]+_0x11abfc[_0x9bc0('0x1b')],_0x9d9623;if(_0x22e976>=_0x38905f){_0x22e976=_0x38905f;_0x9d9623=0xc8;}else{_0x9d9623=0xce;}_0x196e8a['status'](_0x9d9623);return _0x196e8a[_0x9bc0('0x1c')](_0x9bc0('0x1d'),_0x576cfb+'-'+_0x22e976+'/'+_0x38905f)[_0x9bc0('0x18')](_0x3ad0bb);}return null;};}function patchUpdates(_0x26d796){return function(_0x139cf4){try{jsonpatch[_0x9bc0('0x1e')](_0x139cf4,_0x26d796,!![]);}catch(_0x2b2c1a){return BPromise['reject'](_0x2b2c1a);}return _0x139cf4[_0x9bc0('0x1f')]();};}function saveUpdates(_0x11ee0b,_0x4fa2df){return function(_0x1c1a22){if(_0x1c1a22){return _0x1c1a22['update'](_0x11ee0b)['then'](function(_0x20fae9){return _0x20fae9;});}return null;};}function removeEntity(_0x2f888f,_0x460885){return function(_0x456839){if(_0x456839){return _0x456839[_0x9bc0('0x20')]()[_0x9bc0('0x21')](function(){_0x2f888f[_0x9bc0('0x16')](0xcc)[_0x9bc0('0x17')]();});}};}function handleEntityNotFound(_0x2079c9,_0x312e97){return function(_0xb0a8ad){if(!_0xb0a8ad){_0x2079c9[_0x9bc0('0x15')](0x194);}return _0xb0a8ad;};}function handleError(_0x4b15e0,_0x1dc87a){_0x1dc87a=_0x1dc87a||0x1f4;return function(_0x4297f4){logger['error'](_0x4297f4[_0x9bc0('0x22')]);if(_0x4297f4[_0x9bc0('0x23')]){delete _0x4297f4[_0x9bc0('0x23')];}_0x4b15e0[_0x9bc0('0x16')](_0x1dc87a)['send'](_0x4297f4);};}exports['index']=function(_0x2b63ad,_0x4c7620){var _0x25871c={},_0x5651cf={},_0x35fb35={'count':0x0,'rows':[]};var _0x2546c1=db[_0x9bc0('0x24')]['rawAttributes'];_0x5651cf[_0x9bc0('0x25')]=_['keys'](_0x2546c1);_0x5651cf[_0x9bc0('0x26')]=_[_0x9bc0('0x27')](_0x2b63ad['query']);_0x5651cf['filters']=_[_0x9bc0('0x28')](_0x5651cf['model'],_0x5651cf['query']);_0x25871c['attributes']=_[_0x9bc0('0x28')](_0x5651cf[_0x9bc0('0x25')],qs[_0x9bc0('0x29')](_0x2b63ad['query'][_0x9bc0('0x29')]));_0x25871c[_0x9bc0('0x2a')]=_0x25871c[_0x9bc0('0x2a')]['length']?_0x25871c[_0x9bc0('0x2a')]:_0x5651cf['model'];if(!_0x2b63ad[_0x9bc0('0x26')]['hasOwnProperty']('nolimit')){_0x25871c[_0x9bc0('0x1b')]=qs[_0x9bc0('0x1b')](_0x2b63ad['query']['limit']);_0x25871c['offset']=qs['offset'](_0x2b63ad[_0x9bc0('0x26')][_0x9bc0('0x1a')]);}_0x25871c[_0x9bc0('0x2b')]=qs[_0x9bc0('0x2c')](_0x2b63ad[_0x9bc0('0x26')][_0x9bc0('0x2c')]);_0x25871c[_0x9bc0('0x2d')]=qs[_0x9bc0('0x2e')](_[_0x9bc0('0x2f')](_0x2b63ad[_0x9bc0('0x26')],_0x5651cf[_0x9bc0('0x2e')]));if(_0x2b63ad[_0x9bc0('0x26')]['filter']){_0x25871c[_0x9bc0('0x2d')]=_[_0x9bc0('0x30')](_0x25871c[_0x9bc0('0x2d')],{'$or':_['map'](_0x2546c1,function(_0xb06916){if(_0xb06916[_0x9bc0('0x31')][_0x9bc0('0x32')]!==_0x9bc0('0x33')){var _0x529e8d={};_0x529e8d[_0xb06916[_0x9bc0('0x34')]]={'$like':'%'+_0x2b63ad[_0x9bc0('0x26')][_0x9bc0('0x35')]+'%'};return _0x529e8d;}})});}_0x25871c=_[_0x9bc0('0x30')]({},_0x25871c,_0x2b63ad[_0x9bc0('0x36')]);var _0x4af45e={'where':_0x25871c[_0x9bc0('0x2d')]};return db[_0x9bc0('0x24')]['count'](_0x4af45e)['then'](function(_0x5c2b5b){_0x35fb35['count']=_0x5c2b5b;if(_0x2b63ad[_0x9bc0('0x26')]['includeAll']){_0x25871c[_0x9bc0('0x37')]=[{'all':!![]}];}return db['MemberReport'][_0x9bc0('0x38')](_0x25871c);})[_0x9bc0('0x21')](function(_0x3eb407){_0x35fb35[_0x9bc0('0x39')]=_0x3eb407;return _0x35fb35;})[_0x9bc0('0x21')](respondWithFilteredResult(_0x4c7620,_0x25871c))[_0x9bc0('0x3a')](handleError(_0x4c7620,null));};exports[_0x9bc0('0x3b')]=function(_0x4fc494,_0x39381f){var _0x139ede={'raw':!![],'where':{'id':_0x4fc494[_0x9bc0('0x3c')]['id']}},_0x26b5bd={};_0x26b5bd[_0x9bc0('0x25')]=_['keys'](db[_0x9bc0('0x24')][_0x9bc0('0x3d')]);_0x26b5bd['query']=_[_0x9bc0('0x27')](_0x4fc494[_0x9bc0('0x26')]);_0x26b5bd[_0x9bc0('0x2e')]=_[_0x9bc0('0x28')](_0x26b5bd[_0x9bc0('0x25')],_0x26b5bd[_0x9bc0('0x26')]);_0x139ede[_0x9bc0('0x2a')]=_[_0x9bc0('0x28')](_0x26b5bd[_0x9bc0('0x25')],qs[_0x9bc0('0x29')](_0x4fc494[_0x9bc0('0x26')][_0x9bc0('0x29')]));_0x139ede[_0x9bc0('0x2a')]=_0x139ede[_0x9bc0('0x2a')][_0x9bc0('0x3e')]?_0x139ede[_0x9bc0('0x2a')]:_0x26b5bd[_0x9bc0('0x25')];if(_0x4fc494[_0x9bc0('0x26')][_0x9bc0('0x3f')]){_0x139ede[_0x9bc0('0x37')]=[{'all':!![]}];}_0x139ede=_[_0x9bc0('0x30')]({},_0x139ede,_0x4fc494[_0x9bc0('0x36')]);return db['MemberReport'][_0x9bc0('0x40')](_0x139ede)['then'](handleEntityNotFound(_0x39381f,null))[_0x9bc0('0x21')](respondWithResult(_0x39381f,null))['catch'](handleError(_0x39381f,null));};exports['create']=function(_0x33cc56,_0x2ad8ba){return db['MemberReport'][_0x9bc0('0x41')](_0x33cc56[_0x9bc0('0x42')],{})[_0x9bc0('0x21')](respondWithResult(_0x2ad8ba,0xc9))[_0x9bc0('0x3a')](handleError(_0x2ad8ba,null));};exports[_0x9bc0('0x43')]=function(_0x45802d,_0x456aa7){if(_0x45802d[_0x9bc0('0x42')]['id']){delete _0x45802d[_0x9bc0('0x42')]['id'];}return db[_0x9bc0('0x24')][_0x9bc0('0x40')]({'where':{'id':_0x45802d[_0x9bc0('0x3c')]['id']}})[_0x9bc0('0x21')](handleEntityNotFound(_0x456aa7,null))[_0x9bc0('0x21')](saveUpdates(_0x45802d[_0x9bc0('0x42')],null))[_0x9bc0('0x21')](respondWithResult(_0x456aa7,null))['catch'](handleError(_0x456aa7,null));};exports[_0x9bc0('0x20')]=function(_0x2f420e,_0x5b9bc0){return db[_0x9bc0('0x24')][_0x9bc0('0x40')]({'where':{'id':_0x2f420e['params']['id']}})['then'](handleEntityNotFound(_0x5b9bc0,null))['then'](removeEntity(_0x5b9bc0,null))[_0x9bc0('0x3a')](handleError(_0x5b9bc0,null));};exports[_0x9bc0('0x44')]=function(_0x215f2a,_0x4d445c){return db[_0x9bc0('0x24')]['describe']()[_0x9bc0('0x21')](respondWithResult(_0x4d445c,null))['catch'](handleError(_0x4d445c,null));}; \ No newline at end of file +var _0x4abb=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','limit','status','set','Content-Range','apply','reject','destroy','then','sendStatus','send','MemberReport','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','length','create','body','update','params','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4abb,0xc3));var _0xb4ab=function(_0x49bdae,_0x4fe431){_0x49bdae=_0x49bdae-0x0;var _0x44568b=_0x4abb[_0x49bdae];return _0x44568b;};'use strict';var pdf=require(_0xb4ab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb4ab('0x1'));var zipdir=require(_0xb4ab('0x2'));var jsonpatch=require(_0xb4ab('0x3'));var rp=require(_0xb4ab('0x4'));var moment=require(_0xb4ab('0x5'));var BPromise=require(_0xb4ab('0x6'));var Mustache=require(_0xb4ab('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb4ab('0x8'));var csv=require('to-csv');var ejs=require(_0xb4ab('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb4ab('0xa'));var crypto=require(_0xb4ab('0xb'));var jsforce=require(_0xb4ab('0xc'));var deskjs=require(_0xb4ab('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb4ab('0xe'));var Papa=require('papaparse');var Redis=require(_0xb4ab('0xf'));var authService=require(_0xb4ab('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb4ab('0x11'));var logger=require(_0xb4ab('0x12'))(_0xb4ab('0x13'));var utils=require(_0xb4ab('0x14'));var config=require(_0xb4ab('0x15'));var db=require(_0xb4ab('0x16'))['db'];function respondWithStatusCode(_0x5660c6,_0x4a27ff){_0x4a27ff=_0x4a27ff||0xcc;return function(_0x2752c3){if(_0x2752c3){return _0x5660c6['sendStatus'](_0x4a27ff);}return _0x5660c6['status'](_0x4a27ff)[_0xb4ab('0x17')]();};}function respondWithResult(_0x2a28de,_0x53a25b){_0x53a25b=_0x53a25b||0xc8;return function(_0x309f4f){if(_0x309f4f){return _0x2a28de['status'](_0x53a25b)[_0xb4ab('0x18')](_0x309f4f);}};}function respondWithFilteredResult(_0x4e0af4,_0x4dbbad){return function(_0x20185d){if(_0x20185d){var _0x291b84=_0x20185d[_0xb4ab('0x19')],_0x5c465c=_0x4dbbad['offset'],_0x32ba46=_0x4dbbad['offset']+_0x4dbbad[_0xb4ab('0x1a')],_0x6827de;if(_0x32ba46>=_0x291b84){_0x32ba46=_0x291b84;_0x6827de=0xc8;}else{_0x6827de=0xce;}_0x4e0af4[_0xb4ab('0x1b')](_0x6827de);return _0x4e0af4[_0xb4ab('0x1c')](_0xb4ab('0x1d'),_0x5c465c+'-'+_0x32ba46+'/'+_0x291b84)[_0xb4ab('0x18')](_0x20185d);}return null;};}function patchUpdates(_0x5789e4){return function(_0x14127b){try{jsonpatch[_0xb4ab('0x1e')](_0x14127b,_0x5789e4,!![]);}catch(_0x42f319){return BPromise[_0xb4ab('0x1f')](_0x42f319);}return _0x14127b['save']();};}function saveUpdates(_0x4b4712,_0x3e6bae){return function(_0x510bdc){if(_0x510bdc){return _0x510bdc['update'](_0x4b4712)['then'](function(_0xcb00a3){return _0xcb00a3;});}return null;};}function removeEntity(_0x528cd7,_0x99e38d){return function(_0x3406a9){if(_0x3406a9){return _0x3406a9[_0xb4ab('0x20')]()[_0xb4ab('0x21')](function(){_0x528cd7['status'](0xcc)[_0xb4ab('0x17')]();});}};}function handleEntityNotFound(_0x58248d,_0x5ca9dd){return function(_0x1e4971){if(!_0x1e4971){_0x58248d[_0xb4ab('0x22')](0x194);}return _0x1e4971;};}function handleError(_0x30a438,_0x54948f){_0x54948f=_0x54948f||0x1f4;return function(_0xfcc71a){logger['error'](_0xfcc71a['stack']);if(_0xfcc71a['name']){delete _0xfcc71a['name'];}_0x30a438[_0xb4ab('0x1b')](_0x54948f)[_0xb4ab('0x23')](_0xfcc71a);};}exports['index']=function(_0x3d5c81,_0xb80935){var _0x5460d8={},_0x3a0f83={},_0x1e696d={'count':0x0,'rows':[]};var _0x1017da=db[_0xb4ab('0x24')][_0xb4ab('0x25')];_0x3a0f83[_0xb4ab('0x26')]=_[_0xb4ab('0x27')](_0x1017da);_0x3a0f83[_0xb4ab('0x28')]=_[_0xb4ab('0x27')](_0x3d5c81[_0xb4ab('0x28')]);_0x3a0f83['filters']=_[_0xb4ab('0x29')](_0x3a0f83[_0xb4ab('0x26')],_0x3a0f83[_0xb4ab('0x28')]);_0x5460d8[_0xb4ab('0x2a')]=_[_0xb4ab('0x29')](_0x3a0f83['model'],qs[_0xb4ab('0x2b')](_0x3d5c81[_0xb4ab('0x28')]['fields']));_0x5460d8['attributes']=_0x5460d8[_0xb4ab('0x2a')]['length']?_0x5460d8[_0xb4ab('0x2a')]:_0x3a0f83[_0xb4ab('0x26')];if(!_0x3d5c81[_0xb4ab('0x28')]['hasOwnProperty'](_0xb4ab('0x2c'))){_0x5460d8[_0xb4ab('0x1a')]=qs[_0xb4ab('0x1a')](_0x3d5c81[_0xb4ab('0x28')][_0xb4ab('0x1a')]);_0x5460d8[_0xb4ab('0x2d')]=qs[_0xb4ab('0x2d')](_0x3d5c81[_0xb4ab('0x28')][_0xb4ab('0x2d')]);}_0x5460d8[_0xb4ab('0x2e')]=qs[_0xb4ab('0x2f')](_0x3d5c81['query'][_0xb4ab('0x2f')]);_0x5460d8[_0xb4ab('0x30')]=qs[_0xb4ab('0x31')](_[_0xb4ab('0x32')](_0x3d5c81[_0xb4ab('0x28')],_0x3a0f83['filters']));if(_0x3d5c81[_0xb4ab('0x28')][_0xb4ab('0x33')]){_0x5460d8[_0xb4ab('0x30')]=_[_0xb4ab('0x34')](_0x5460d8[_0xb4ab('0x30')],{'$or':_['map'](_0x1017da,function(_0x3038ad){if(_0x3038ad[_0xb4ab('0x35')][_0xb4ab('0x36')]!==_0xb4ab('0x37')){var _0x132312={};_0x132312[_0x3038ad[_0xb4ab('0x38')]]={'$like':'%'+_0x3d5c81[_0xb4ab('0x28')]['filter']+'%'};return _0x132312;}})});}_0x5460d8=_[_0xb4ab('0x34')]({},_0x5460d8,_0x3d5c81['options']);var _0x1781a5={'where':_0x5460d8[_0xb4ab('0x30')]};return db['MemberReport'][_0xb4ab('0x19')](_0x1781a5)['then'](function(_0x560246){_0x1e696d[_0xb4ab('0x19')]=_0x560246;if(_0x3d5c81[_0xb4ab('0x28')][_0xb4ab('0x39')]){_0x5460d8[_0xb4ab('0x3a')]=[{'all':!![]}];}return db[_0xb4ab('0x24')][_0xb4ab('0x3b')](_0x5460d8);})[_0xb4ab('0x21')](function(_0x84d9fe){_0x1e696d[_0xb4ab('0x3c')]=_0x84d9fe;return _0x1e696d;})[_0xb4ab('0x21')](respondWithFilteredResult(_0xb80935,_0x5460d8))[_0xb4ab('0x3d')](handleError(_0xb80935,null));};exports[_0xb4ab('0x3e')]=function(_0x5e2421,_0xe0f36b){var _0x1c9a38={'raw':!![],'where':{'id':_0x5e2421['params']['id']}},_0x3697d8={};_0x3697d8[_0xb4ab('0x26')]=_[_0xb4ab('0x27')](db['MemberReport'][_0xb4ab('0x25')]);_0x3697d8[_0xb4ab('0x28')]=_[_0xb4ab('0x27')](_0x5e2421[_0xb4ab('0x28')]);_0x3697d8[_0xb4ab('0x31')]=_[_0xb4ab('0x29')](_0x3697d8[_0xb4ab('0x26')],_0x3697d8[_0xb4ab('0x28')]);_0x1c9a38[_0xb4ab('0x2a')]=_[_0xb4ab('0x29')](_0x3697d8[_0xb4ab('0x26')],qs[_0xb4ab('0x2b')](_0x5e2421['query'][_0xb4ab('0x2b')]));_0x1c9a38['attributes']=_0x1c9a38[_0xb4ab('0x2a')][_0xb4ab('0x3f')]?_0x1c9a38[_0xb4ab('0x2a')]:_0x3697d8['model'];if(_0x5e2421['query'][_0xb4ab('0x39')]){_0x1c9a38[_0xb4ab('0x3a')]=[{'all':!![]}];}_0x1c9a38=_[_0xb4ab('0x34')]({},_0x1c9a38,_0x5e2421['options']);return db[_0xb4ab('0x24')]['find'](_0x1c9a38)[_0xb4ab('0x21')](handleEntityNotFound(_0xe0f36b,null))[_0xb4ab('0x21')](respondWithResult(_0xe0f36b,null))['catch'](handleError(_0xe0f36b,null));};exports[_0xb4ab('0x40')]=function(_0x3d6041,_0x507f4e){return db[_0xb4ab('0x24')]['create'](_0x3d6041[_0xb4ab('0x41')],{})['then'](respondWithResult(_0x507f4e,0xc9))[_0xb4ab('0x3d')](handleError(_0x507f4e,null));};exports[_0xb4ab('0x42')]=function(_0x8be850,_0x1c0a0a){if(_0x8be850[_0xb4ab('0x41')]['id']){delete _0x8be850[_0xb4ab('0x41')]['id'];}return db['MemberReport']['find']({'where':{'id':_0x8be850[_0xb4ab('0x43')]['id']}})[_0xb4ab('0x21')](handleEntityNotFound(_0x1c0a0a,null))[_0xb4ab('0x21')](saveUpdates(_0x8be850[_0xb4ab('0x41')],null))[_0xb4ab('0x21')](respondWithResult(_0x1c0a0a,null))[_0xb4ab('0x3d')](handleError(_0x1c0a0a,null));};exports['destroy']=function(_0x1c987a,_0x570128){return db[_0xb4ab('0x24')][_0xb4ab('0x44')]({'where':{'id':_0x1c987a[_0xb4ab('0x43')]['id']}})['then'](handleEntityNotFound(_0x570128,null))[_0xb4ab('0x21')](removeEntity(_0x570128,null))[_0xb4ab('0x3d')](handleError(_0x570128,null));};exports['describe']=function(_0x59892d,_0x17883c){return db['MemberReport'][_0xb4ab('0x45')]()[_0xb4ab('0x21')](respondWithResult(_0x17883c,null))[_0xb4ab('0x3d')](handleError(_0x17883c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index b2d2bc0..f220baa 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 _0xbde9=['exports','define','MemberReport','report_member','membername','interface','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x39a792,_0x5b6ec9){var _0x31c1af=function(_0xdbb04e){while(--_0xdbb04e){_0x39a792['push'](_0x39a792['shift']());}};_0x31c1af(++_0x5b6ec9);}(_0xbde9,0x17d));var _0x9bde=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0xbde9[_0x408b34];return _0x1182aa;};'use strict';var _=require(_0x9bde('0x0'));var util=require('util');var logger=require(_0x9bde('0x1'))(_0x9bde('0x2'));var moment=require(_0x9bde('0x3'));var BPromise=require('bluebird');var rp=require(_0x9bde('0x4'));var fs=require('fs');var path=require(_0x9bde('0x5'));var rimraf=require(_0x9bde('0x6'));var config=require(_0x9bde('0x7'));var attributes=require(_0x9bde('0x8'));module[_0x9bde('0x9')]=function(_0x373112,_0x13d97d){return _0x373112[_0x9bde('0xa')](_0x9bde('0xb'),attributes,{'tableName':_0x9bde('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x9bde('0xd'),_0x9bde('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b36=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./memberReport.attributes','exports','define','report_member','membername','interface'];(function(_0x11c2ef,_0x1d2af6){var _0x42c17c=function(_0x2016b9){while(--_0x2016b9){_0x11c2ef['push'](_0x11c2ef['shift']());}};_0x42c17c(++_0x1d2af6);}(_0x5b36,0x68));var _0x65b3=function(_0x1f451f,_0x4ad0e7){_0x1f451f=_0x1f451f-0x0;var _0x4efbfc=_0x5b36[_0x1f451f];return _0x4efbfc;};'use strict';var _=require(_0x65b3('0x0'));var util=require(_0x65b3('0x1'));var logger=require(_0x65b3('0x2'))(_0x65b3('0x3'));var moment=require(_0x65b3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x65b3('0x5'));var rimraf=require('rimraf');var config=require(_0x65b3('0x6'));var attributes=require(_0x65b3('0x7'));module[_0x65b3('0x8')]=function(_0x2e85bf,_0x3664f8){return _0x2e85bf[_0x65b3('0x9')]('MemberReport',attributes,{'tableName':_0x65b3('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x65b3('0xb'),_0x65b3('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 fbfc5b8..6efa26c 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 _0x6669=['limit','map','include','model','attributes','info','stringify','create','body','CreateMemberReport','UpdateMemberReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6669,0x1eb));var _0x9666=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x6669[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x9666('0x0'));var util=require(_0x9666('0x1'));var moment=require(_0x9666('0x2'));var BPromise=require(_0x9666('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9666('0x4'));var db=require(_0x9666('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9666('0x6'))(_0x9666('0x7'));var config=require(_0x9666('0x8'));var jayson=require(_0x9666('0x9'));var client=jayson[_0x9666('0xa')][_0x9666('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4993e6,_0x4a8dd8,_0x56d449){return new BPromise(function(_0x247606,_0x3d6132){return client[_0x9666('0xc')](_0x4993e6,_0x56d449)[_0x9666('0xd')](function(_0x2d11b2){logger['info'](_0x9666('0xe'),_0x4a8dd8,'request\x20sent');logger[_0x9666('0xf')](_0x9666('0x10'),_0x4a8dd8,_0x9666('0x11'),JSON['stringify'](_0x2d11b2));if(_0x2d11b2['error']){if(_0x2d11b2[_0x9666('0x12')][_0x9666('0x13')]===0x1f4){logger[_0x9666('0x12')]('MemberReport,\x20%s,\x20%s',_0x4a8dd8,_0x2d11b2[_0x9666('0x12')]['message']);return _0x3d6132(_0x2d11b2['error'][_0x9666('0x14')]);}logger[_0x9666('0x12')](_0x9666('0xe'),_0x4a8dd8,_0x2d11b2[_0x9666('0x12')][_0x9666('0x14')]);return _0x247606(_0x2d11b2[_0x9666('0x12')]['message']);}else{logger['info'](_0x9666('0xe'),_0x4a8dd8,_0x9666('0x11'));_0x247606(_0x2d11b2[_0x9666('0x15')][_0x9666('0x14')]);}})[_0x9666('0x16')](function(_0x2eea11){logger[_0x9666('0x12')](_0x9666('0xe'),_0x4a8dd8,_0x2eea11);_0x3d6132(_0x2eea11);});});}exports[_0x9666('0x17')]=function(_0x4737f8){var _0xe266e6=this;return new Promise(function(_0x281758,_0x13a20d){return db[_0x9666('0x18')][_0x9666('0x19')]({'raw':_0x4737f8['options']?_0x4737f8[_0x9666('0x1a')][_0x9666('0x1b')]===undefined?!![]:![]:!![],'where':_0x4737f8[_0x9666('0x1a')]?_0x4737f8[_0x9666('0x1a')][_0x9666('0x1c')]||null:null,'attributes':_0x4737f8[_0x9666('0x1a')]?_0x4737f8[_0x9666('0x1a')]['attributes']||null:null,'limit':_0x4737f8[_0x9666('0x1a')]?_0x4737f8[_0x9666('0x1a')][_0x9666('0x1d')]||null:null,'include':_0x4737f8[_0x9666('0x1a')]?_0x4737f8[_0x9666('0x1a')]['include']?_[_0x9666('0x1e')](_0x4737f8[_0x9666('0x1a')][_0x9666('0x1f')],function(_0x106b17){return{'model':db[_0x106b17[_0x9666('0x20')]],'as':_0x106b17['as'],'attributes':_0x106b17[_0x9666('0x21')],'include':_0x106b17[_0x9666('0x1f')]?_[_0x9666('0x1e')](_0x106b17['include'],function(_0x2640a7){return{'model':db[_0x2640a7[_0x9666('0x20')]],'as':_0x2640a7['as'],'attributes':_0x2640a7[_0x9666('0x21')],'include':_0x2640a7[_0x9666('0x1f')]?_[_0x9666('0x1e')](_0x2640a7[_0x9666('0x1f')],function(_0x411187){return{'model':db[_0x411187['model']],'as':_0x411187['as'],'attributes':_0x411187[_0x9666('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9666('0xd')](function(_0x4465f3){logger[_0x9666('0x22')](_0x9666('0x17'),_0x4737f8);logger['debug'](_0x9666('0x17'),_0x4737f8,JSON[_0x9666('0x23')](_0x4465f3));_0x281758(_0x4465f3);})['catch'](function(_0x6327bc){logger['error']('GetMemberReport',_0x6327bc['message'],_0x4737f8);_0x13a20d(_0xe266e6[_0x9666('0x12')](0x1f4,_0x6327bc[_0x9666('0x14')]));});});};exports['CreateMemberReport']=function(_0x53f2ac){var _0x30d84c=this;return new Promise(function(_0x30dacc,_0x262805){return db[_0x9666('0x18')][_0x9666('0x24')](_0x53f2ac[_0x9666('0x25')],{'raw':_0x53f2ac[_0x9666('0x1a')]?_0x53f2ac[_0x9666('0x1a')][_0x9666('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x14ac3b){logger[_0x9666('0x22')]('CreateMemberReport',_0x53f2ac);logger[_0x9666('0xf')](_0x9666('0x26'),_0x53f2ac,JSON[_0x9666('0x23')](_0x14ac3b));_0x30dacc(_0x14ac3b);})['catch'](function(_0x1b30ba){logger[_0x9666('0x12')](_0x9666('0x26'),_0x1b30ba[_0x9666('0x14')],_0x53f2ac);_0x262805(_0x30d84c[_0x9666('0x12')](0x1f4,_0x1b30ba['message']));});});};exports[_0x9666('0x27')]=function(_0xb66781){var _0x51f32f=this;return new Promise(function(_0x55802a,_0x2d4e41){return db[_0x9666('0x18')]['update'](_0xb66781[_0x9666('0x25')],{'raw':_0xb66781[_0x9666('0x1a')]?_0xb66781[_0x9666('0x1a')][_0x9666('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb66781['options']?_0xb66781['options']['where']||null:null,'attributes':_0xb66781[_0x9666('0x1a')]?_0xb66781[_0x9666('0x1a')][_0x9666('0x21')]||null:null,'limit':_0xb66781['options']?_0xb66781[_0x9666('0x1a')][_0x9666('0x1d')]||null:null})['then'](function(_0x5d3516){logger[_0x9666('0x22')](_0x9666('0x27'),_0xb66781);logger[_0x9666('0xf')](_0x9666('0x27'),_0xb66781,JSON[_0x9666('0x23')](_0x5d3516));_0x55802a(_0x5d3516);})['catch'](function(_0x51f558){logger['error'](_0x9666('0x27'),_0x51f558[_0x9666('0x14')],_0xb66781);_0x2d4e41(_0x51f32f[_0x9666('0x12')](0x1f4,_0x51f558[_0x9666('0x14')]));});});}; \ No newline at end of file +var _0x59ac=['../../config/logger','rpc','client','request','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model','then','GetMemberReport','CreateMemberReport','create','body','UpdateMemberReport','MemberReport','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c6f27,_0x421676){var _0x27d8e6=function(_0x3f8134){while(--_0x3f8134){_0x1c6f27['push'](_0x1c6f27['shift']());}};_0x27d8e6(++_0x421676);}(_0x59ac,0x162));var _0xc59a=function(_0x33fe93,_0x40d9c8){_0x33fe93=_0x33fe93-0x0;var _0x3f4e95=_0x59ac[_0x33fe93];return _0x3f4e95;};'use strict';var _=require('lodash');var util=require(_0xc59a('0x0'));var moment=require('moment');var BPromise=require(_0xc59a('0x1'));var rs=require(_0xc59a('0x2'));var fs=require('fs');var Redis=require(_0xc59a('0x3'));var db=require(_0xc59a('0x4'))['db'];var utils=require(_0xc59a('0x5'));var logger=require(_0xc59a('0x6'))(_0xc59a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc59a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399fe9,_0x54f30f,_0xfaf99f){return new BPromise(function(_0x35aa22,_0x1b77c6){return client[_0xc59a('0x9')](_0x399fe9,_0xfaf99f)['then'](function(_0x12b5ee){logger['info'](_0xc59a('0xa'),_0x54f30f,'request\x20sent');logger[_0xc59a('0xb')](_0xc59a('0xc'),_0x54f30f,_0xc59a('0xd'),JSON[_0xc59a('0xe')](_0x12b5ee));if(_0x12b5ee[_0xc59a('0xf')]){if(_0x12b5ee[_0xc59a('0xf')]['code']===0x1f4){logger[_0xc59a('0xf')](_0xc59a('0xa'),_0x54f30f,_0x12b5ee['error'][_0xc59a('0x10')]);return _0x1b77c6(_0x12b5ee[_0xc59a('0xf')][_0xc59a('0x10')]);}logger[_0xc59a('0xf')]('MemberReport,\x20%s,\x20%s',_0x54f30f,_0x12b5ee[_0xc59a('0xf')][_0xc59a('0x10')]);return _0x35aa22(_0x12b5ee['error'][_0xc59a('0x10')]);}else{logger[_0xc59a('0x11')](_0xc59a('0xa'),_0x54f30f,_0xc59a('0xd'));_0x35aa22(_0x12b5ee[_0xc59a('0x12')]['message']);}})[_0xc59a('0x13')](function(_0x319ce3){logger[_0xc59a('0xf')](_0xc59a('0xa'),_0x54f30f,_0x319ce3);_0x1b77c6(_0x319ce3);});});}exports['GetMemberReport']=function(_0x5d8ba0){var _0x39ce33=this;return new Promise(function(_0x364290,_0x2f369f){return db['MemberReport'][_0xc59a('0x14')]({'raw':_0x5d8ba0[_0xc59a('0x15')]?_0x5d8ba0[_0xc59a('0x15')][_0xc59a('0x16')]===undefined?!![]:![]:!![],'where':_0x5d8ba0[_0xc59a('0x15')]?_0x5d8ba0['options']['where']||null:null,'attributes':_0x5d8ba0[_0xc59a('0x15')]?_0x5d8ba0['options'][_0xc59a('0x17')]||null:null,'limit':_0x5d8ba0[_0xc59a('0x15')]?_0x5d8ba0[_0xc59a('0x15')][_0xc59a('0x18')]||null:null,'include':_0x5d8ba0['options']?_0x5d8ba0[_0xc59a('0x15')][_0xc59a('0x19')]?_[_0xc59a('0x1a')](_0x5d8ba0[_0xc59a('0x15')]['include'],function(_0x41e2aa){return{'model':db[_0x41e2aa['model']],'as':_0x41e2aa['as'],'attributes':_0x41e2aa[_0xc59a('0x17')],'include':_0x41e2aa[_0xc59a('0x19')]?_[_0xc59a('0x1a')](_0x41e2aa[_0xc59a('0x19')],function(_0x51d60a){return{'model':db[_0x51d60a['model']],'as':_0x51d60a['as'],'attributes':_0x51d60a['attributes'],'include':_0x51d60a[_0xc59a('0x19')]?_[_0xc59a('0x1a')](_0x51d60a[_0xc59a('0x19')],function(_0x1981fc){return{'model':db[_0x1981fc[_0xc59a('0x1b')]],'as':_0x1981fc['as'],'attributes':_0x1981fc[_0xc59a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc59a('0x1c')](function(_0x5ac8ec){logger[_0xc59a('0x11')](_0xc59a('0x1d'),_0x5d8ba0);logger[_0xc59a('0xb')](_0xc59a('0x1d'),_0x5d8ba0,JSON['stringify'](_0x5ac8ec));_0x364290(_0x5ac8ec);})[_0xc59a('0x13')](function(_0x4bbc12){logger['error'](_0xc59a('0x1d'),_0x4bbc12[_0xc59a('0x10')],_0x5d8ba0);_0x2f369f(_0x39ce33[_0xc59a('0xf')](0x1f4,_0x4bbc12[_0xc59a('0x10')]));});});};exports[_0xc59a('0x1e')]=function(_0x34215e){var _0x2e4e08=this;return new Promise(function(_0xaf6540,_0x157e9b){return db['MemberReport'][_0xc59a('0x1f')](_0x34215e[_0xc59a('0x20')],{'raw':_0x34215e[_0xc59a('0x15')]?_0x34215e[_0xc59a('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xc59a('0x1c')](function(_0x342086){logger[_0xc59a('0x11')]('CreateMemberReport',_0x34215e);logger[_0xc59a('0xb')](_0xc59a('0x1e'),_0x34215e,JSON[_0xc59a('0xe')](_0x342086));_0xaf6540(_0x342086);})[_0xc59a('0x13')](function(_0x4a8051){logger[_0xc59a('0xf')]('CreateMemberReport',_0x4a8051[_0xc59a('0x10')],_0x34215e);_0x157e9b(_0x2e4e08[_0xc59a('0xf')](0x1f4,_0x4a8051[_0xc59a('0x10')]));});});};exports[_0xc59a('0x21')]=function(_0x4fd2e1){var _0x51207f=this;return new Promise(function(_0x163444,_0x1c7506){return db[_0xc59a('0x22')]['update'](_0x4fd2e1[_0xc59a('0x20')],{'raw':_0x4fd2e1[_0xc59a('0x15')]?_0x4fd2e1[_0xc59a('0x15')][_0xc59a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fd2e1['options']?_0x4fd2e1[_0xc59a('0x15')][_0xc59a('0x23')]||null:null,'attributes':_0x4fd2e1['options']?_0x4fd2e1['options'][_0xc59a('0x17')]||null:null,'limit':_0x4fd2e1[_0xc59a('0x15')]?_0x4fd2e1[_0xc59a('0x15')][_0xc59a('0x18')]||null:null})[_0xc59a('0x1c')](function(_0x484aea){logger[_0xc59a('0x11')](_0xc59a('0x21'),_0x4fd2e1);logger[_0xc59a('0xb')]('UpdateMemberReport',_0x4fd2e1,JSON[_0xc59a('0xe')](_0x484aea));_0x163444(_0x484aea);})[_0xc59a('0x13')](function(_0x4b1058){logger[_0xc59a('0xf')](_0xc59a('0x21'),_0x4b1058['message'],_0x4fd2e1);_0x1c7506(_0x51207f['error'](0x1f4,_0x4b1058['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 0ff7d11..ebc27ac 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 _0xa015=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','multer','path'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0xa015,0x15e));var _0x5a01=function(_0x5185b9,_0xb4c5ed){_0x5185b9=_0x5185b9-0x0;var _0x434d12=_0xa015[_0x5185b9];return _0x434d12;};'use strict';var multer=require(_0x5a01('0x0'));var util=require('util');var path=require(_0x5a01('0x1'));var timeout=require(_0x5a01('0x2'));var express=require(_0x5a01('0x3'));var router=express[_0x5a01('0x4')]();var auth=require(_0x5a01('0x5'));var interaction=require(_0x5a01('0x6'));var config=require(_0x5a01('0x7'));var controller=require(_0x5a01('0x8'));router['get']('/',controller[_0x5a01('0x9')]);module[_0x5a01('0xa')]=router; \ No newline at end of file +var _0xb028=['get','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./migration.controller'];(function(_0x58a0d5,_0x2fa2a6){var _0x4f90a7=function(_0x58f614){while(--_0x58f614){_0x58a0d5['push'](_0x58a0d5['shift']());}};_0x4f90a7(++_0x2fa2a6);}(_0xb028,0x1cd));var _0x8b02=function(_0x27c9cc,_0x5424c7){_0x27c9cc=_0x27c9cc-0x0;var _0x38f1fc=_0xb028[_0x27c9cc];return _0x38f1fc;};'use strict';var multer=require(_0x8b02('0x0'));var util=require(_0x8b02('0x1'));var path=require('path');var timeout=require(_0x8b02('0x2'));var express=require(_0x8b02('0x3'));var router=express['Router']();var auth=require(_0x8b02('0x4'));var interaction=require(_0x8b02('0x5'));var config=require('../../config/environment');var controller=require(_0x8b02('0x6'));router[_0x8b02('0x7')]('/',controller['index']);module[_0x8b02('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1f7d503..15b6858 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 _0x867b=['exports','STRING','sequelize'];(function(_0x18ab0e,_0xbcd94d){var _0x1f6c97=function(_0x415887){while(--_0x415887){_0x18ab0e['push'](_0x18ab0e['shift']());}};_0x1f6c97(++_0xbcd94d);}(_0x867b,0x6b));var _0xb867=function(_0x179bd8,_0x1c4c33){_0x179bd8=_0x179bd8-0x0;var _0x49f1c8=_0x867b[_0x179bd8];return _0x49f1c8;};'use strict';var Sequelize=require(_0xb867('0x0'));module[_0xb867('0x1')]={'version':{'type':Sequelize[_0xb867('0x2')],'unique':'version'}}; \ No newline at end of file +var _0xc23e=['version','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc23e,0x7d));var _0xec23=function(_0x1fed12,_0x44f6e8){_0x1fed12=_0x1fed12-0x0;var _0x4105ef=_0xc23e[_0x1fed12];return _0x4105ef;};'use strict';var Sequelize=require(_0xec23('0x0'));module[_0xec23('0x1')]={'version':{'type':Sequelize[_0xec23('0x2')],'unique':_0xec23('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1bfd42a..9ae4192 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 _0x71e8=['lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','set','reject','save','then','destroy','error','stack','name','index','Migration','rawAttributes','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','field','count','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x71e8,0x1e3));var _0x871e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71e8[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x871e('0x0'));var emlformat=require(_0x871e('0x1'));var rimraf=require(_0x871e('0x2'));var zipdir=require(_0x871e('0x3'));var jsonpatch=require(_0x871e('0x4'));var rp=require(_0x871e('0x5'));var moment=require(_0x871e('0x6'));var BPromise=require(_0x871e('0x7'));var Mustache=require(_0x871e('0x8'));var util=require(_0x871e('0x9'));var path=require(_0x871e('0xa'));var sox=require('sox');var csv=require(_0x871e('0xb'));var ejs=require(_0x871e('0xc'));var fs=require('fs');var _=require(_0x871e('0xd'));var squel=require('squel');var crypto=require(_0x871e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x871e('0xb'));var querystring=require(_0x871e('0xf'));var Papa=require(_0x871e('0x10'));var Redis=require(_0x871e('0x11'));var authService=require(_0x871e('0x12'));var qs=require(_0x871e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x871e('0x14'))(_0x871e('0x15'));var utils=require(_0x871e('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bd9b2,_0x189d04){_0x189d04=_0x189d04||0xcc;return function(_0x533403){if(_0x533403){return _0x4bd9b2[_0x871e('0x17')](_0x189d04);}return _0x4bd9b2[_0x871e('0x18')](_0x189d04)[_0x871e('0x19')]();};}function respondWithResult(_0x2106db,_0xdeda0b){_0xdeda0b=_0xdeda0b||0xc8;return function(_0x6c041f){if(_0x6c041f){return _0x2106db[_0x871e('0x18')](_0xdeda0b)[_0x871e('0x1a')](_0x6c041f);}};}function respondWithFilteredResult(_0x5dc73b,_0x41d18e){return function(_0x5227cd){if(_0x5227cd){var _0x512b36=_0x5227cd['count'],_0x42efdc=_0x41d18e[_0x871e('0x1b')],_0x17e989=_0x41d18e[_0x871e('0x1b')]+_0x41d18e['limit'],_0x29d532;if(_0x17e989>=_0x512b36){_0x17e989=_0x512b36;_0x29d532=0xc8;}else{_0x29d532=0xce;}_0x5dc73b[_0x871e('0x18')](_0x29d532);return _0x5dc73b[_0x871e('0x1c')]('Content-Range',_0x42efdc+'-'+_0x17e989+'/'+_0x512b36)[_0x871e('0x1a')](_0x5227cd);}return null;};}function patchUpdates(_0x3d10a6){return function(_0x5a90d0){try{jsonpatch['apply'](_0x5a90d0,_0x3d10a6,!![]);}catch(_0x267aae){return BPromise[_0x871e('0x1d')](_0x267aae);}return _0x5a90d0[_0x871e('0x1e')]();};}function saveUpdates(_0x18c490,_0x1ab483){return function(_0x350dd1){if(_0x350dd1){return _0x350dd1['update'](_0x18c490)[_0x871e('0x1f')](function(_0xe616d){return _0xe616d;});}return null;};}function removeEntity(_0x32b4df,_0x2345ca){return function(_0x9fd2e2){if(_0x9fd2e2){return _0x9fd2e2[_0x871e('0x20')]()[_0x871e('0x1f')](function(){_0x32b4df[_0x871e('0x18')](0xcc)[_0x871e('0x19')]();});}};}function handleEntityNotFound(_0x46bbc1,_0x146276){return function(_0x205053){if(!_0x205053){_0x46bbc1[_0x871e('0x17')](0x194);}return _0x205053;};}function handleError(_0x32fa67,_0x395fc5){_0x395fc5=_0x395fc5||0x1f4;return function(_0x4d307f){logger[_0x871e('0x21')](_0x4d307f[_0x871e('0x22')]);if(_0x4d307f['name']){delete _0x4d307f[_0x871e('0x23')];}_0x32fa67[_0x871e('0x18')](_0x395fc5)['send'](_0x4d307f);};}exports[_0x871e('0x24')]=function(_0x529b51,_0x1caede){var _0x16937e={},_0x5bf42e={},_0x3f3865={'count':0x0,'rows':[]};var _0x1d961d=db[_0x871e('0x25')][_0x871e('0x26')];_0x5bf42e['model']=_[_0x871e('0x27')](_0x1d961d);_0x5bf42e['query']=_[_0x871e('0x27')](_0x529b51['query']);_0x5bf42e['filters']=_[_0x871e('0x28')](_0x5bf42e[_0x871e('0x29')],_0x5bf42e[_0x871e('0x2a')]);_0x16937e[_0x871e('0x2b')]=_[_0x871e('0x28')](_0x5bf42e['model'],qs[_0x871e('0x2c')](_0x529b51[_0x871e('0x2a')][_0x871e('0x2c')]));_0x16937e['attributes']=_0x16937e[_0x871e('0x2b')][_0x871e('0x2d')]?_0x16937e[_0x871e('0x2b')]:_0x5bf42e[_0x871e('0x29')];if(!_0x529b51[_0x871e('0x2a')][_0x871e('0x2e')]('nolimit')){_0x16937e[_0x871e('0x2f')]=qs[_0x871e('0x2f')](_0x529b51[_0x871e('0x2a')][_0x871e('0x2f')]);_0x16937e[_0x871e('0x1b')]=qs[_0x871e('0x1b')](_0x529b51[_0x871e('0x2a')]['offset']);}_0x16937e[_0x871e('0x30')]=qs[_0x871e('0x31')](_0x529b51[_0x871e('0x2a')][_0x871e('0x31')]);_0x16937e[_0x871e('0x32')]=qs[_0x871e('0x33')](_[_0x871e('0x34')](_0x529b51[_0x871e('0x2a')],_0x5bf42e[_0x871e('0x33')]));if(_0x529b51[_0x871e('0x2a')][_0x871e('0x35')]){_0x16937e[_0x871e('0x32')]=_[_0x871e('0x36')](_0x16937e['where'],{'$or':_['map'](_0x1d961d,function(_0x17ccd6){if(_0x17ccd6[_0x871e('0x37')]['key']!=='VIRTUAL'){var _0x403eb9={};_0x403eb9[_0x17ccd6[_0x871e('0x38')]]={'$like':'%'+_0x529b51['query']['filter']+'%'};return _0x403eb9;}})});}_0x16937e=_['merge']({},_0x16937e,_0x529b51['options']);var _0x5b99aa={'where':_0x16937e[_0x871e('0x32')]};return db[_0x871e('0x25')]['count'](_0x5b99aa)[_0x871e('0x1f')](function(_0x423da0){_0x3f3865[_0x871e('0x39')]=_0x423da0;if(_0x529b51['query']['includeAll']){_0x16937e[_0x871e('0x3a')]=[{'all':!![]}];}return db['Migration'][_0x871e('0x3b')](_0x16937e);})[_0x871e('0x1f')](function(_0x56a5fa){_0x3f3865[_0x871e('0x3c')]=_0x56a5fa;return _0x3f3865;})[_0x871e('0x1f')](respondWithFilteredResult(_0x1caede,_0x16937e))[_0x871e('0x3d')](handleError(_0x1caede,null));}; \ No newline at end of file +var _0x07cc=['json','reject','save','update','then','destroy','error','send','index','Migration','rawAttributes','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range'];(function(_0x40050d,_0x311abc){var _0x2bd991=function(_0x23bbf5){while(--_0x23bbf5){_0x40050d['push'](_0x40050d['shift']());}};_0x2bd991(++_0x311abc);}(_0x07cc,0x137));var _0xc07c=function(_0x212130,_0x58ccf0){_0x212130=_0x212130-0x0;var _0x386e8e=_0x07cc[_0x212130];return _0x386e8e;};'use strict';var pdf=require(_0xc07c('0x0'));var emlformat=require(_0xc07c('0x1'));var rimraf=require(_0xc07c('0x2'));var zipdir=require(_0xc07c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc07c('0x4'));var moment=require(_0xc07c('0x5'));var BPromise=require(_0xc07c('0x6'));var Mustache=require(_0xc07c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc07c('0x8'));var csv=require(_0xc07c('0x9'));var ejs=require(_0xc07c('0xa'));var fs=require('fs');var _=require(_0xc07c('0xb'));var squel=require('squel');var crypto=require(_0xc07c('0xc'));var jsforce=require(_0xc07c('0xd'));var deskjs=require(_0xc07c('0xe'));var toCsv=require(_0xc07c('0x9'));var querystring=require(_0xc07c('0xf'));var Papa=require(_0xc07c('0x10'));var Redis=require(_0xc07c('0x11'));var authService=require(_0xc07c('0x12'));var qs=require(_0xc07c('0x13'));var hardwareService=require(_0xc07c('0x14'));var logger=require(_0xc07c('0x15'))(_0xc07c('0x16'));var utils=require(_0xc07c('0x17'));var config=require(_0xc07c('0x18'));var db=require(_0xc07c('0x19'))['db'];function respondWithStatusCode(_0x324a1c,_0x3db3ed){_0x3db3ed=_0x3db3ed||0xcc;return function(_0x50b05f){if(_0x50b05f){return _0x324a1c[_0xc07c('0x1a')](_0x3db3ed);}return _0x324a1c[_0xc07c('0x1b')](_0x3db3ed)[_0xc07c('0x1c')]();};}function respondWithResult(_0x55f05c,_0x3a5418){_0x3a5418=_0x3a5418||0xc8;return function(_0x56969b){if(_0x56969b){return _0x55f05c[_0xc07c('0x1b')](_0x3a5418)['json'](_0x56969b);}};}function respondWithFilteredResult(_0x4550af,_0x28327e){return function(_0x4f4117){if(_0x4f4117){var _0x137f9b=_0x4f4117[_0xc07c('0x1d')],_0x45ed86=_0x28327e['offset'],_0x1566fc=_0x28327e[_0xc07c('0x1e')]+_0x28327e[_0xc07c('0x1f')],_0x10e4fc;if(_0x1566fc>=_0x137f9b){_0x1566fc=_0x137f9b;_0x10e4fc=0xc8;}else{_0x10e4fc=0xce;}_0x4550af['status'](_0x10e4fc);return _0x4550af[_0xc07c('0x20')](_0xc07c('0x21'),_0x45ed86+'-'+_0x1566fc+'/'+_0x137f9b)[_0xc07c('0x22')](_0x4f4117);}return null;};}function patchUpdates(_0x20df18){return function(_0x2517a1){try{jsonpatch['apply'](_0x2517a1,_0x20df18,!![]);}catch(_0x4f22dc){return BPromise[_0xc07c('0x23')](_0x4f22dc);}return _0x2517a1[_0xc07c('0x24')]();};}function saveUpdates(_0x5e0ab7,_0x5197e6){return function(_0x4ec144){if(_0x4ec144){return _0x4ec144[_0xc07c('0x25')](_0x5e0ab7)[_0xc07c('0x26')](function(_0x4d1ca7){return _0x4d1ca7;});}return null;};}function removeEntity(_0xcacb3c,_0x697581){return function(_0x21e925){if(_0x21e925){return _0x21e925[_0xc07c('0x27')]()[_0xc07c('0x26')](function(){_0xcacb3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e44bb,_0x19a24b){return function(_0x510c0f){if(!_0x510c0f){_0x1e44bb[_0xc07c('0x1a')](0x194);}return _0x510c0f;};}function handleError(_0x44ce2d,_0x2e4c14){_0x2e4c14=_0x2e4c14||0x1f4;return function(_0x5e32d4){logger[_0xc07c('0x28')](_0x5e32d4['stack']);if(_0x5e32d4['name']){delete _0x5e32d4['name'];}_0x44ce2d['status'](_0x2e4c14)[_0xc07c('0x29')](_0x5e32d4);};}exports[_0xc07c('0x2a')]=function(_0x342c35,_0x44aac1){var _0x4a7e42={},_0x1fbec0={},_0x889b0f={'count':0x0,'rows':[]};var _0x3f0c9d=db[_0xc07c('0x2b')][_0xc07c('0x2c')];_0x1fbec0['model']=_['keys'](_0x3f0c9d);_0x1fbec0['query']=_[_0xc07c('0x2d')](_0x342c35['query']);_0x1fbec0[_0xc07c('0x2e')]=_[_0xc07c('0x2f')](_0x1fbec0[_0xc07c('0x30')],_0x1fbec0[_0xc07c('0x31')]);_0x4a7e42[_0xc07c('0x32')]=_[_0xc07c('0x2f')](_0x1fbec0[_0xc07c('0x30')],qs[_0xc07c('0x33')](_0x342c35[_0xc07c('0x31')][_0xc07c('0x33')]));_0x4a7e42[_0xc07c('0x32')]=_0x4a7e42[_0xc07c('0x32')][_0xc07c('0x34')]?_0x4a7e42[_0xc07c('0x32')]:_0x1fbec0['model'];if(!_0x342c35['query']['hasOwnProperty'](_0xc07c('0x35'))){_0x4a7e42['limit']=qs[_0xc07c('0x1f')](_0x342c35['query']['limit']);_0x4a7e42[_0xc07c('0x1e')]=qs[_0xc07c('0x1e')](_0x342c35[_0xc07c('0x31')]['offset']);}_0x4a7e42[_0xc07c('0x36')]=qs[_0xc07c('0x37')](_0x342c35[_0xc07c('0x31')][_0xc07c('0x37')]);_0x4a7e42['where']=qs[_0xc07c('0x2e')](_[_0xc07c('0x38')](_0x342c35[_0xc07c('0x31')],_0x1fbec0[_0xc07c('0x2e')]));if(_0x342c35[_0xc07c('0x31')][_0xc07c('0x39')]){_0x4a7e42[_0xc07c('0x3a')]=_[_0xc07c('0x3b')](_0x4a7e42['where'],{'$or':_[_0xc07c('0x3c')](_0x3f0c9d,function(_0x10f319){if(_0x10f319[_0xc07c('0x3d')][_0xc07c('0x3e')]!=='VIRTUAL'){var _0x38846d={};_0x38846d[_0x10f319[_0xc07c('0x3f')]]={'$like':'%'+_0x342c35[_0xc07c('0x31')][_0xc07c('0x39')]+'%'};return _0x38846d;}})});}_0x4a7e42=_['merge']({},_0x4a7e42,_0x342c35[_0xc07c('0x40')]);var _0x20fd81={'where':_0x4a7e42[_0xc07c('0x3a')]};return db[_0xc07c('0x2b')]['count'](_0x20fd81)['then'](function(_0x60690a){_0x889b0f[_0xc07c('0x1d')]=_0x60690a;if(_0x342c35['query'][_0xc07c('0x41')]){_0x4a7e42['include']=[{'all':!![]}];}return db[_0xc07c('0x2b')][_0xc07c('0x42')](_0x4a7e42);})[_0xc07c('0x26')](function(_0x217c4f){_0x889b0f[_0xc07c('0x43')]=_0x217c4f;return _0x889b0f;})[_0xc07c('0x26')](respondWithFilteredResult(_0x44aac1,_0x4a7e42))[_0xc07c('0x44')](handleError(_0x44aac1,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 98eefb2..6c4197f 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 _0x062c=['../../config/logger','api','moment','request-promise','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x516615,_0x357a73){var _0x399faa=function(_0x1c73d4){while(--_0x1c73d4){_0x516615['push'](_0x516615['shift']());}};_0x399faa(++_0x357a73);}(_0x062c,0xdb));var _0xc062=function(_0x4a7440,_0x26d8a8){_0x4a7440=_0x4a7440-0x0;var _0x1d950c=_0x062c[_0x4a7440];return _0x1d950c;};'use strict';var _=require(_0xc062('0x0'));var util=require(_0xc062('0x1'));var logger=require(_0xc062('0x2'))(_0xc062('0x3'));var moment=require(_0xc062('0x4'));var BPromise=require('bluebird');var rp=require(_0xc062('0x5'));var fs=require('fs');var path=require(_0xc062('0x6'));var rimraf=require(_0xc062('0x7'));var config=require('../../config/environment');var attributes=require(_0xc062('0x8'));module[_0xc062('0x9')]=function(_0x205bf7,_0x42a7e6){return _0x205bf7[_0xc062('0xa')](_0xc062('0xb'),attributes,{'tableName':_0xc062('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac2a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash'];(function(_0x586efe,_0x27a33b){var _0x8d0bbd=function(_0x1eafe4){while(--_0x1eafe4){_0x586efe['push'](_0x586efe['shift']());}};_0x8d0bbd(++_0x27a33b);}(_0xac2a,0x1ed));var _0xaac2=function(_0xd0ebd6,_0x5c6646){_0xd0ebd6=_0xd0ebd6-0x0;var _0x6a7dcc=_0xac2a[_0xd0ebd6];return _0x6a7dcc;};'use strict';var _=require(_0xaac2('0x0'));var util=require('util');var logger=require(_0xaac2('0x1'))(_0xaac2('0x2'));var moment=require(_0xaac2('0x3'));var BPromise=require(_0xaac2('0x4'));var rp=require(_0xaac2('0x5'));var fs=require('fs');var path=require(_0xaac2('0x6'));var rimraf=require(_0xaac2('0x7'));var config=require(_0xaac2('0x8'));var attributes=require(_0xaac2('0x9'));module[_0xaac2('0xa')]=function(_0x198282,_0x37d3ee){return _0x198282[_0xaac2('0xb')]('Migration',attributes,{'tableName':_0xaac2('0xc'),'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 ac65780..0fb8710 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 _0x44e8=['Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','debug'];(function(_0x5717c8,_0x5df216){var _0x38c3ab=function(_0x4c06cc){while(--_0x4c06cc){_0x5717c8['push'](_0x5717c8['shift']());}};_0x38c3ab(++_0x5df216);}(_0x44e8,0xd7));var _0x844e=function(_0x43b892,_0x5f27f9){_0x43b892=_0x43b892-0x0;var _0x205d36=_0x44e8[_0x43b892];return _0x205d36;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x844e('0x1'));var rs=require(_0x844e('0x2'));var fs=require('fs');var Redis=require(_0x844e('0x3'));var db=require(_0x844e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x844e('0x5'))(_0x844e('0x6'));var config=require(_0x844e('0x7'));var jayson=require(_0x844e('0x8'));var client=jayson['client'][_0x844e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238796,_0x1706b3,_0x11cbd6){return new BPromise(function(_0x571b91,_0x31ab50){return client[_0x844e('0xa')](_0x238796,_0x11cbd6)[_0x844e('0xb')](function(_0x134672){logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,'request\x20sent');logger[_0x844e('0xe')](_0x844e('0xf'),_0x1706b3,_0x844e('0x10'),JSON[_0x844e('0x11')](_0x134672));if(_0x134672[_0x844e('0x12')]){if(_0x134672[_0x844e('0x12')][_0x844e('0x13')]===0x1f4){logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')]['message']);return _0x31ab50(_0x134672[_0x844e('0x12')][_0x844e('0x14')]);}logger['error'](_0x844e('0xd'),_0x1706b3,_0x134672[_0x844e('0x12')][_0x844e('0x14')]);return _0x571b91(_0x134672['error'][_0x844e('0x14')]);}else{logger[_0x844e('0xc')](_0x844e('0xd'),_0x1706b3,_0x844e('0x10'));_0x571b91(_0x134672[_0x844e('0x15')][_0x844e('0x14')]);}})[_0x844e('0x16')](function(_0x5506ef){logger['error'](_0x844e('0xd'),_0x1706b3,_0x5506ef);_0x31ab50(_0x5506ef);});});} \ No newline at end of file +var _0xc978=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rs=require(_0x8c97('0x4'));var fs=require('fs');var Redis=require(_0x8c97('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var jayson=require(_0x8c97('0xa'));var client=jayson[_0x8c97('0xb')][_0x8c97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x524196,_0x41a511,_0x1b5864){return new BPromise(function(_0x332cd1,_0x26ff40){return client[_0x8c97('0xd')](_0x524196,_0x1b5864)[_0x8c97('0xe')](function(_0x17aef0){logger['info'](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));logger[_0x8c97('0x11')](_0x8c97('0x12'),_0x41a511,_0x8c97('0x10'),JSON[_0x8c97('0x13')](_0x17aef0));if(_0x17aef0[_0x8c97('0x14')]){if(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x15')]===0x1f4){logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0[_0x8c97('0x14')]['message']);return _0x26ff40(_0x17aef0[_0x8c97('0x14')][_0x8c97('0x16')]);}logger['error'](_0x8c97('0xf'),_0x41a511,_0x17aef0['error']['message']);return _0x332cd1(_0x17aef0['error'][_0x8c97('0x16')]);}else{logger[_0x8c97('0x17')](_0x8c97('0xf'),_0x41a511,_0x8c97('0x10'));_0x332cd1(_0x17aef0[_0x8c97('0x18')][_0x8c97('0x16')]);}})[_0x8c97('0x19')](function(_0xe3be1){logger[_0x8c97('0x14')]('Migration,\x20%s,\x20%s',_0x41a511,_0xe3be1);_0x26ff40(_0xe3be1);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 5664121..93f12fb 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 _0x4daa=['post','isAuthenticated','create','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','/:id','show'];(function(_0xc3f277,_0x558de3){var _0x40f938=function(_0x3787af){while(--_0x3787af){_0xc3f277['push'](_0xc3f277['shift']());}};_0x40f938(++_0x558de3);}(_0x4daa,0x8c));var _0xa4da=function(_0x512550,_0x6a8b6f){_0x512550=_0x512550-0x0;var _0x19f661=_0x4daa[_0x512550];return _0x19f661;};'use strict';var multer=require(_0xa4da('0x0'));var util=require(_0xa4da('0x1'));var path=require(_0xa4da('0x2'));var timeout=require(_0xa4da('0x3'));var express=require('express');var router=express[_0xa4da('0x4')]();var auth=require(_0xa4da('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa4da('0x6'));var controller=require('./network.controller');router[_0xa4da('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa4da('0x7')](_0xa4da('0x8'),auth['isAuthenticated'](),controller[_0xa4da('0x9')]);router[_0xa4da('0xa')]('/',auth[_0xa4da('0xb')](),controller[_0xa4da('0xc')]);router[_0xa4da('0xd')](_0xa4da('0x8'),auth[_0xa4da('0xb')](),controller[_0xa4da('0xe')]);router['delete'](_0xa4da('0x8'),auth[_0xa4da('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7a6d=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy'];(function(_0x2999cc,_0x4b011f){var _0x2a711f=function(_0x9dd1c9){while(--_0x9dd1c9){_0x2999cc['push'](_0x2999cc['shift']());}};_0x2a711f(++_0x4b011f);}(_0x7a6d,0x99));var _0xd7a6=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x7a6d[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0xd7a6('0x0'));var util=require(_0xd7a6('0x1'));var path=require('path');var timeout=require(_0xd7a6('0x2'));var express=require(_0xd7a6('0x3'));var router=express[_0xd7a6('0x4')]();var auth=require(_0xd7a6('0x5'));var interaction=require(_0xd7a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd7a6('0x7'));router[_0xd7a6('0x8')]('/',auth[_0xd7a6('0x9')](),controller[_0xd7a6('0xa')]);router[_0xd7a6('0x8')](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0xc')]);router[_0xd7a6('0xd')]('/',auth[_0xd7a6('0x9')](),controller['create']);router[_0xd7a6('0xe')](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller['update']);router[_0xd7a6('0xf')](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0x10')]);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 d1292e2..4ba88f7 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 _0xc772=['exports','ENUM','externip','sequelize'];(function(_0x7aeae5,_0x2e8333){var _0x5aec8f=function(_0x1b81ed){while(--_0x1b81ed){_0x7aeae5['push'](_0x7aeae5['shift']());}};_0x5aec8f(++_0x2e8333);}(_0xc772,0x167));var _0x2c77=function(_0x4b1e47,_0x4f1c17){_0x4b1e47=_0x4b1e47-0x0;var _0x1f697e=_0xc772[_0x4b1e47];return _0x1f697e;};'use strict';var Sequelize=require(_0x2c77('0x0'));module[_0x2c77('0x1')]={'type':{'type':Sequelize[_0x2c77('0x2')]('localnet',_0x2c77('0x3'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x635c=['exports','ENUM','localnet'];(function(_0x3d5c19,_0x190f3d){var _0x128c21=function(_0x1101af){while(--_0x1101af){_0x3d5c19['push'](_0x3d5c19['shift']());}};_0x128c21(++_0x190f3d);}(_0x635c,0x1ef));var _0xc635=function(_0x3cfa7c,_0x268ad2){_0x3cfa7c=_0x3cfa7c-0x0;var _0x258b4f=_0x635c[_0x3cfa7c];return _0x258b4f;};'use strict';var Sequelize=require('sequelize');module[_0xc635('0x0')]={'type':{'type':Sequelize[_0xc635('0x1')](_0xc635('0x2'),'externip')},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index ca4e94b..f4a6d70 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 _0xadb5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','Network','count','includeAll','include','show','params','options','find','create','sequelize','transaction','body','findAll','readFileSync','join','server/files/templates/network.ejs','utf8','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','root','render','writeFileSync','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xadb5,0xad));var _0x5adb=function(_0x5c566f,_0x296792){_0x5c566f=_0x5c566f-0x0;var _0x269e79=_0xadb5[_0x5c566f];return _0x269e79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('Network,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['Network'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':!![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['Network']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0,_0x2b34a8){var _0xd0e5b7;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0x4f2da9){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4e')],{'raw':!![]})[_0x5adb('0x1b')](function(_0xa25ac3){_0xd0e5b7=_0xa25ac3;return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x3b4794['body'][_0x5adb('0x3f')]},'raw':!![]});})['then'](function(_0x31ae72){var _0x35df22=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config['root'],_0x5adb('0x52')),_0x5adb('0x53'));var _0x24b1f1=ejs['render'](_0x35df22,{'networks':_0x31ae72||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x3b4794[_0x5adb('0x4e')][_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x24b1f1);})[_0x5adb('0x1b')](function(){return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x4b'),{'module':_0x5adb('0x57')});})[_0x5adb('0x1b')](function(){return _0xd0e5b7;});})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))[_0x5adb('0x24')](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x2c2357,_0x511746,_0x49f4c8){var _0x3d55c2;return db[_0x5adb('0x4c')][_0x5adb('0x4d')](function(_0xdb7d8f){return db['Network'][_0x5adb('0x4a')]({'where':{'id':_0x2c2357[_0x5adb('0x48')]['id']}})['then'](handleEntityNotFound(_0x511746,null))[_0x5adb('0x1b')](saveUpdates(_0x2c2357[_0x5adb('0x4e')],null))[_0x5adb('0x1b')](function(_0x5edd60){if(_0x5edd60){_0x3d55c2=_0x5edd60;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'type':_0x3d55c2[_0x5adb('0x3f')]},'raw':!![]});}return null;})[_0x5adb('0x1b')](function(_0x330290){if(_0x330290){var _0x428019=fs['readFileSync'](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),'utf8');var _0xcd71d2=ejs[_0x5adb('0x59')](_0x428019,{'networks':_0x330290||[]});fs[_0x5adb('0x5a')](util['format'](_0x5adb('0x54'),_0x3d55c2['type'][_0x5adb('0x55')]()),_0xcd71d2);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x5adb('0x1b')](function(_0x3627d1){if(_0x3627d1){return _0x3d55c2;}return null;});})['then'](respondWithResult(_0x511746,null))[_0x5adb('0x24')](handleError(_0x511746,null));};exports[_0x5adb('0x5b')]=function(_0x248739,_0x3fcad5,_0x55cd0a){var _0x4290bb;return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x248739[_0x5adb('0x48')]['id']}})['then'](function(_0x53a4bc){_0x4290bb=_0x53a4bc;return _0x53a4bc;})[_0x5adb('0x1b')](handleEntityNotFound(_0x3fcad5,null))['then'](removeEntity(_0x3fcad5,null))['then'](function(){if(_0x4290bb){return db['Network'][_0x5adb('0x4f')]({'where':{'type':_0x4290bb[_0x5adb('0x3f')]},'raw':!![]});}})['then'](function(_0x395350){if(_0x395350){var _0x91e023=fs[_0x5adb('0x50')](path[_0x5adb('0x51')](config[_0x5adb('0x58')],_0x5adb('0x52')),_0x5adb('0x53'));var _0x1ffcd3=ejs['render'](_0x91e023,{'networks':_0x395350||[]});fs['writeFileSync'](util['format'](_0x5adb('0x54'),_0x4290bb[_0x5adb('0x3f')][_0x5adb('0x55')]()),_0x1ffcd3);return respondWithRpcPromise(_0x5adb('0x56'),_0x5adb('0x5b'),{'module':_0x5adb('0x57')});}})[_0x5adb('0x24')](handleError(_0x3fcad5,null));}; \ No newline at end of file +var _0x7a54=['jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','info','result','catch','sendStatus','json','count','offset','limit','status','Content-Range','apply','reject','save','destroy','stack','name','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','key','VIRTUAL','includeAll','include','findAll','rows','show','length','merge','options','create','sequelize','transaction','body','type','readFileSync','join','server/files/templates/network.ejs','utf8','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','update','find','params','render','root','writeFileSync','chan_sip.so','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5801d7,_0x2a4d94){var _0x363808=function(_0x5d18ab){while(--_0x5d18ab){_0x5801d7['push'](_0x5801d7['shift']());}};_0x363808(++_0x2a4d94);}(_0x7a54,0x106));var _0x47a5=function(_0x4f02ee,_0x234e9c){_0x4f02ee=_0x4f02ee-0x0;var _0x17d118=_0x7a54[_0x4f02ee];return _0x17d118;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];var jayson=require(_0x47a5('0x14'));var client=jayson[_0x47a5('0x15')][_0x47a5('0x16')]({'port':0x232a});function checkPasswordPattern(_0x1eae59,_0x5beb89,_0x44bd3e){if(_0x44bd3e){var _0x221b54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x221b54[_0x47a5('0x17')](_0x5beb89)){return _0x1eae59;}else{throw new Error(_0x47a5('0x18'));}}else{return _0x1eae59;}}function respondWithRpcPromise(_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){return new BPromise(function(_0x4e99a8,_0x362359){var _0x11faf5=_0x190faa||client;return _0x11faf5[_0x47a5('0x19')](_0x139f25,_0x3c6c46)[_0x47a5('0x1a')](function(_0x1ef44c){logger['info']('Network,\x20%s,\x20%s',_0x620ee9,_0x47a5('0x1b'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x620ee9,_0x47a5('0x1b'),JSON[_0x47a5('0x1c')](_0x1ef44c));if(_0x1ef44c[_0x47a5('0x1d')]){if(_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x1e')]===0x1f4){logger[_0x47a5('0x1d')](_0x47a5('0x1f'),_0x620ee9,_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x20')]);return _0x362359(_0x1ef44c['error'][_0x47a5('0x20')]);}logger[_0x47a5('0x1d')]('Network,\x20%s,\x20%s',_0x620ee9,_0x1ef44c[_0x47a5('0x1d')][_0x47a5('0x20')]);return _0x4e99a8(_0x1ef44c[_0x47a5('0x1d')]['message']);}else{logger[_0x47a5('0x21')](_0x47a5('0x1f'),_0x620ee9,_0x47a5('0x1b'));_0x4e99a8(_0x1ef44c[_0x47a5('0x22')]['message']);}})[_0x47a5('0x23')](function(_0x385687){logger['error'](_0x47a5('0x1f'),_0x620ee9,_0x385687);_0x362359(_0x385687);});});}function respondWithStatusCode(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0xcc;return function(_0x129ce5){if(_0x129ce5){return _0xc4cd63[_0x47a5('0x24')](_0x4437f1);}return _0xc4cd63['status'](_0x4437f1)['end']();};}function respondWithResult(_0x136745,_0x5686db){_0x5686db=_0x5686db||0xc8;return function(_0x1ea9c8){if(_0x1ea9c8){return _0x136745['status'](_0x5686db)[_0x47a5('0x25')](_0x1ea9c8);}};}function respondWithFilteredResult(_0x378208,_0x36ad34){return function(_0x1dac65){if(_0x1dac65){var _0x21f296=_0x1dac65[_0x47a5('0x26')],_0x3ba0b7=_0x36ad34[_0x47a5('0x27')],_0x24b162=_0x36ad34[_0x47a5('0x27')]+_0x36ad34[_0x47a5('0x28')],_0x136b14;if(_0x24b162>=_0x21f296){_0x24b162=_0x21f296;_0x136b14=0xc8;}else{_0x136b14=0xce;}_0x378208[_0x47a5('0x29')](_0x136b14);return _0x378208['set'](_0x47a5('0x2a'),_0x3ba0b7+'-'+_0x24b162+'/'+_0x21f296)['json'](_0x1dac65);}return null;};}function patchUpdates(_0x2ef875){return function(_0x9ac908){try{jsonpatch[_0x47a5('0x2b')](_0x9ac908,_0x2ef875,!![]);}catch(_0x4d6b57){return BPromise[_0x47a5('0x2c')](_0x4d6b57);}return _0x9ac908[_0x47a5('0x2d')]();};}function saveUpdates(_0x39b50b,_0x1f1c68){return function(_0x51cc81){if(_0x51cc81){return _0x51cc81['update'](_0x39b50b)[_0x47a5('0x1a')](function(_0xfb5ddb){return _0xfb5ddb;});}return null;};}function removeEntity(_0x5bd7eb,_0x4e1006){return function(_0x836303){if(_0x836303){return _0x836303[_0x47a5('0x2e')]()['then'](function(){_0x5bd7eb[_0x47a5('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122ed6,_0xd972c){return function(_0x5c5162){if(!_0x5c5162){_0x122ed6['sendStatus'](0x194);}return _0x5c5162;};}function handleError(_0x274e34,_0x5910bb){_0x5910bb=_0x5910bb||0x1f4;return function(_0x403028){logger[_0x47a5('0x1d')](_0x403028[_0x47a5('0x2f')]);if(_0x403028['name']){delete _0x403028[_0x47a5('0x30')];}_0x274e34['status'](_0x5910bb)['send'](_0x403028);};}exports[_0x47a5('0x31')]=function(_0x5a8a7c,_0x25cce0){var _0x5ef577={},_0x21ad34={},_0x3534cb={'count':0x0,'rows':[]};var _0x38c8d4=db[_0x47a5('0x32')][_0x47a5('0x33')];_0x21ad34[_0x47a5('0x34')]=_[_0x47a5('0x35')](_0x38c8d4);_0x21ad34[_0x47a5('0x36')]=_[_0x47a5('0x35')](_0x5a8a7c['query']);_0x21ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x21ad34['model'],_0x21ad34[_0x47a5('0x36')]);_0x5ef577[_0x47a5('0x39')]=_[_0x47a5('0x38')](_0x21ad34['model'],qs[_0x47a5('0x3a')](_0x5a8a7c[_0x47a5('0x36')]['fields']));_0x5ef577[_0x47a5('0x39')]=_0x5ef577[_0x47a5('0x39')]['length']?_0x5ef577['attributes']:_0x21ad34['model'];if(!_0x5a8a7c[_0x47a5('0x36')]['hasOwnProperty'](_0x47a5('0x3b'))){_0x5ef577[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x28')]);_0x5ef577[_0x47a5('0x27')]=qs[_0x47a5('0x27')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x27')]);}_0x5ef577[_0x47a5('0x3c')]=qs[_0x47a5('0x3d')](_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x3d')]);_0x5ef577['where']=qs[_0x47a5('0x37')](_[_0x47a5('0x3e')](_0x5a8a7c[_0x47a5('0x36')],_0x21ad34[_0x47a5('0x37')]));if(_0x5a8a7c['query'][_0x47a5('0x3f')]){_0x5ef577['where']=_['merge'](_0x5ef577['where'],{'$or':_['map'](_0x38c8d4,function(_0x27dd5d){if(_0x27dd5d['type'][_0x47a5('0x40')]!==_0x47a5('0x41')){var _0x448610={};_0x448610[_0x27dd5d['field']]={'$like':'%'+_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x3f')]+'%'};return _0x448610;}})});}_0x5ef577=_['merge']({},_0x5ef577,_0x5a8a7c['options']);var _0xbe21d9={'where':_0x5ef577['where']};return db[_0x47a5('0x32')][_0x47a5('0x26')](_0xbe21d9)[_0x47a5('0x1a')](function(_0xd75ca3){_0x3534cb[_0x47a5('0x26')]=_0xd75ca3;if(_0x5a8a7c[_0x47a5('0x36')][_0x47a5('0x42')]){_0x5ef577[_0x47a5('0x43')]=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x44')](_0x5ef577);})[_0x47a5('0x1a')](function(_0x3c3ebf){_0x3534cb[_0x47a5('0x45')]=_0x3c3ebf;return _0x3534cb;})[_0x47a5('0x1a')](respondWithFilteredResult(_0x25cce0,_0x5ef577))[_0x47a5('0x23')](handleError(_0x25cce0,null));};exports[_0x47a5('0x46')]=function(_0x512e65,_0x2d38de){var _0x23bb04={'raw':!![],'where':{'id':_0x512e65['params']['id']}},_0x49eab1={};_0x49eab1[_0x47a5('0x34')]=_['keys'](db[_0x47a5('0x32')][_0x47a5('0x33')]);_0x49eab1['query']=_['keys'](_0x512e65[_0x47a5('0x36')]);_0x49eab1['filters']=_[_0x47a5('0x38')](_0x49eab1[_0x47a5('0x34')],_0x49eab1[_0x47a5('0x36')]);_0x23bb04[_0x47a5('0x39')]=_[_0x47a5('0x38')](_0x49eab1[_0x47a5('0x34')],qs[_0x47a5('0x3a')](_0x512e65['query']['fields']));_0x23bb04[_0x47a5('0x39')]=_0x23bb04[_0x47a5('0x39')][_0x47a5('0x47')]?_0x23bb04[_0x47a5('0x39')]:_0x49eab1[_0x47a5('0x34')];if(_0x512e65[_0x47a5('0x36')][_0x47a5('0x42')]){_0x23bb04['include']=[{'all':!![]}];}_0x23bb04=_[_0x47a5('0x48')]({},_0x23bb04,_0x512e65[_0x47a5('0x49')]);return db[_0x47a5('0x32')]['find'](_0x23bb04)[_0x47a5('0x1a')](handleEntityNotFound(_0x2d38de,null))['then'](respondWithResult(_0x2d38de,null))[_0x47a5('0x23')](handleError(_0x2d38de,null));};exports[_0x47a5('0x4a')]=function(_0x46e90b,_0xf03bd5,_0x588551){var _0x3adf14;return db[_0x47a5('0x4b')][_0x47a5('0x4c')](function(_0x3a2de4){return db[_0x47a5('0x32')][_0x47a5('0x4a')](_0x46e90b[_0x47a5('0x4d')],{'raw':!![]})['then'](function(_0x2a0aa2){_0x3adf14=_0x2a0aa2;return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x46e90b[_0x47a5('0x4d')][_0x47a5('0x4e')]},'raw':!![]});})[_0x47a5('0x1a')](function(_0x572233){var _0x1ad6a9=fs[_0x47a5('0x4f')](path[_0x47a5('0x50')](config['root'],_0x47a5('0x51')),_0x47a5('0x52'));var _0x183b3c=ejs['render'](_0x1ad6a9,{'networks':_0x572233||[]});fs['writeFileSync'](util[_0x47a5('0x53')](_0x47a5('0x54'),_0x46e90b['body']['type'][_0x47a5('0x55')]()),_0x183b3c);})['then'](function(){return respondWithRpcPromise(_0x47a5('0x56'),'create',{'module':'chan_sip.so'});})[_0x47a5('0x1a')](function(){return _0x3adf14;});})[_0x47a5('0x1a')](respondWithResult(_0xf03bd5,0xc9))['catch'](handleError(_0xf03bd5,null));};exports[_0x47a5('0x57')]=function(_0x72fe,_0x4b706a,_0x5b6127){var _0x16b4fd;return db[_0x47a5('0x4b')][_0x47a5('0x4c')](function(_0x2931e4){return db['Network'][_0x47a5('0x58')]({'where':{'id':_0x72fe[_0x47a5('0x59')]['id']}})[_0x47a5('0x1a')](handleEntityNotFound(_0x4b706a,null))['then'](saveUpdates(_0x72fe[_0x47a5('0x4d')],null))['then'](function(_0x485e3c){if(_0x485e3c){_0x16b4fd=_0x485e3c;return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x16b4fd[_0x47a5('0x4e')]},'raw':!![]});}return null;})[_0x47a5('0x1a')](function(_0x4966af){if(_0x4966af){var _0x144af9=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0x47a5('0x52'));var _0x6cd4ea=ejs[_0x47a5('0x5a')](_0x144af9,{'networks':_0x4966af||[]});fs['writeFileSync'](util['format'](_0x47a5('0x54'),_0x16b4fd[_0x47a5('0x4e')][_0x47a5('0x55')]()),_0x6cd4ea);return respondWithRpcPromise(_0x47a5('0x56'),_0x47a5('0x57'),{'module':'chan_sip.so'});}return null;})[_0x47a5('0x1a')](function(_0x519e9e){if(_0x519e9e){return _0x16b4fd;}return null;});})[_0x47a5('0x1a')](respondWithResult(_0x4b706a,null))[_0x47a5('0x23')](handleError(_0x4b706a,null));};exports['destroy']=function(_0x32b4de,_0x345104,_0x132854){var _0x3e8274;return db[_0x47a5('0x32')][_0x47a5('0x58')]({'where':{'id':_0x32b4de[_0x47a5('0x59')]['id']}})[_0x47a5('0x1a')](function(_0x57ed0a){_0x3e8274=_0x57ed0a;return _0x57ed0a;})[_0x47a5('0x1a')](handleEntityNotFound(_0x345104,null))[_0x47a5('0x1a')](removeEntity(_0x345104,null))[_0x47a5('0x1a')](function(){if(_0x3e8274){return db[_0x47a5('0x32')][_0x47a5('0x44')]({'where':{'type':_0x3e8274['type']},'raw':!![]});}})[_0x47a5('0x1a')](function(_0xdfcecc){if(_0xdfcecc){var _0x1224bc=fs[_0x47a5('0x4f')](path[_0x47a5('0x50')](config[_0x47a5('0x5b')],_0x47a5('0x51')),_0x47a5('0x52'));var _0x350af8=ejs[_0x47a5('0x5a')](_0x1224bc,{'networks':_0xdfcecc||[]});fs[_0x47a5('0x5c')](util[_0x47a5('0x53')](_0x47a5('0x54'),_0x3e8274[_0x47a5('0x4e')][_0x47a5('0x55')]()),_0x350af8);return respondWithRpcPromise('Reload',_0x47a5('0x2e'),{'module':_0x47a5('0x5d')});}})[_0x47a5('0x23')](handleError(_0x345104,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d6be3cf..30ec80b 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 _0x8bb3=['util','../../config/logger','api','request-promise','path','rimraf','./network.attributes','exports','define','Network','lodash'];(function(_0x371bc2,_0x1636d4){var _0x47a744=function(_0x26bca5){while(--_0x26bca5){_0x371bc2['push'](_0x371bc2['shift']());}};_0x47a744(++_0x1636d4);}(_0x8bb3,0x180));var _0x38bb=function(_0x1f2673,_0x310af8){_0x1f2673=_0x1f2673-0x0;var _0x2f2712=_0x8bb3[_0x1f2673];return _0x2f2712;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var logger=require(_0x38bb('0x2'))(_0x38bb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38bb('0x4'));var fs=require('fs');var path=require(_0x38bb('0x5'));var rimraf=require(_0x38bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x38bb('0x7'));module[_0x38bb('0x8')]=function(_0x226401,_0x5093a8){return _0x226401[_0x38bb('0x9')](_0x38bb('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad4f=['api','moment','bluebird','request-promise','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger'];(function(_0x3692a1,_0x1b8ff3){var _0x18eafe=function(_0x5f31c0){while(--_0x5f31c0){_0x3692a1['push'](_0x3692a1['shift']());}};_0x18eafe(++_0x1b8ff3);}(_0xad4f,0x135));var _0xfad4=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xad4f[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xfad4('0x0'));var util=require(_0xfad4('0x1'));var logger=require(_0xfad4('0x2'))(_0xfad4('0x3'));var moment=require(_0xfad4('0x4'));var BPromise=require(_0xfad4('0x5'));var rp=require(_0xfad4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfad4('0x7'));var attributes=require(_0xfad4('0x8'));module[_0xfad4('0x9')]=function(_0x234ecc,_0x394487){return _0x234ecc[_0xfad4('0xa')](_0xfad4('0xb'),attributes,{'tableName':_0xfad4('0xc'),'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 6fb91c5..6bd1bb7 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 _0x1261=['then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x11be11,_0x210411){var _0x46103a=function(_0xaa613b){while(--_0xaa613b){_0x11be11['push'](_0x11be11['shift']());}};_0x46103a(++_0x210411);}(_0x1261,0x144));var _0x1126=function(_0x50ac27,_0x1306e3){_0x50ac27=_0x50ac27-0x0;var _0x45f86a=_0x1261[_0x50ac27];return _0x45f86a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Network,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xfb65=['then','info','request\x20sent','debug','stringify','error','code','Network,\x20%s,\x20%s','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0xcc712f,_0x38f0df){var _0x3b9613=function(_0xda03e2){while(--_0xda03e2){_0xcc712f['push'](_0xcc712f['shift']());}};_0x3b9613(++_0x38f0df);}(_0xfb65,0x82));var _0x5fb6=function(_0x234e7e,_0xf82c84){_0x234e7e=_0x234e7e-0x0;var _0x23319a=_0xfb65[_0x234e7e];return _0x23319a;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var moment=require(_0x5fb6('0x1'));var BPromise=require('bluebird');var rs=require(_0x5fb6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fb6('0x3'))['db'];var utils=require(_0x5fb6('0x4'));var logger=require(_0x5fb6('0x5'))(_0x5fb6('0x6'));var config=require(_0x5fb6('0x7'));var jayson=require(_0x5fb6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x238914,_0x1b586b,_0x1f99b8){return new BPromise(function(_0x840390,_0x56d6e1){return client[_0x5fb6('0x9')](_0x238914,_0x1f99b8)[_0x5fb6('0xa')](function(_0x46e061){logger[_0x5fb6('0xb')]('Network,\x20%s,\x20%s',_0x1b586b,_0x5fb6('0xc'));logger[_0x5fb6('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x1b586b,_0x5fb6('0xc'),JSON[_0x5fb6('0xe')](_0x46e061));if(_0x46e061[_0x5fb6('0xf')]){if(_0x46e061[_0x5fb6('0xf')][_0x5fb6('0x10')]===0x1f4){logger['error'](_0x5fb6('0x11'),_0x1b586b,_0x46e061[_0x5fb6('0xf')][_0x5fb6('0x12')]);return _0x56d6e1(_0x46e061[_0x5fb6('0xf')][_0x5fb6('0x12')]);}logger[_0x5fb6('0xf')](_0x5fb6('0x11'),_0x1b586b,_0x46e061[_0x5fb6('0xf')]['message']);return _0x840390(_0x46e061['error'][_0x5fb6('0x12')]);}else{logger[_0x5fb6('0xb')]('Network,\x20%s,\x20%s',_0x1b586b,_0x5fb6('0xc'));_0x840390(_0x46e061[_0x5fb6('0x13')][_0x5fb6('0x12')]);}})['catch'](function(_0x48f94d){logger[_0x5fb6('0xf')](_0x5fb6('0x11'),_0x1b586b,_0x48f94d);_0x56d6e1(_0x48f94d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2d367fc..9f7e418 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 _0x6244=['update','delete','destroy','removeAnswers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','send'];(function(_0x1b60b0,_0x477ab4){var _0x5200e8=function(_0x2d0d06){while(--_0x2d0d06){_0x1b60b0['push'](_0x1b60b0['shift']());}};_0x5200e8(++_0x477ab4);}(_0x6244,0x177));var _0x4624=function(_0x4dadc3,_0x537281){_0x4dadc3=_0x4dadc3-0x0;var _0x2dac50=_0x6244[_0x4dadc3];return _0x2dac50;};'use strict';var multer=require('multer');var util=require(_0x4624('0x0'));var path=require(_0x4624('0x1'));var timeout=require('connect-timeout');var express=require(_0x4624('0x2'));var router=express[_0x4624('0x3')]();var auth=require(_0x4624('0x4'));var interaction=require(_0x4624('0x5'));var config=require(_0x4624('0x6'));var controller=require(_0x4624('0x7'));router[_0x4624('0x8')]('/',auth[_0x4624('0x9')](),controller['index']);router[_0x4624('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x4624('0xa')]);router[_0x4624('0x8')](_0x4624('0xb'),auth['isAuthenticated'](),controller[_0x4624('0xc')]);router[_0x4624('0x8')]('/:id/dispositions',auth[_0x4624('0x9')](),controller[_0x4624('0xd')]);router['get'](_0x4624('0xe'),auth['isAuthenticated'](),controller[_0x4624('0xf')]);router[_0x4624('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x4624('0x10')]);router[_0x4624('0x8')](_0x4624('0x11'),auth[_0x4624('0x9')](),controller[_0x4624('0x12')]);router[_0x4624('0x8')](_0x4624('0x13'),auth[_0x4624('0x9')](),controller[_0x4624('0x14')]);router[_0x4624('0x15')]('/',auth[_0x4624('0x9')](),controller[_0x4624('0x16')]);router[_0x4624('0x15')](_0x4624('0x17'),auth[_0x4624('0x9')](),controller[_0x4624('0x18')]);router[_0x4624('0x15')]('/:id/canned_answers',auth[_0x4624('0x9')](),controller[_0x4624('0x19')]);router[_0x4624('0x15')](_0x4624('0x1a'),controller[_0x4624('0x1b')]);router['post'](_0x4624('0x1c'),auth[_0x4624('0x9')](),controller[_0x4624('0x1d')]);router[_0x4624('0x15')](_0x4624('0x13'),auth['isAuthenticated'](),controller[_0x4624('0x1e')]);router[_0x4624('0x15')]('/:id/send',auth[_0x4624('0x9')](),controller[_0x4624('0x1f')]);router['put']('/:id',auth[_0x4624('0x9')](),controller[_0x4624('0x20')]);router[_0x4624('0x21')](_0x4624('0xb'),auth[_0x4624('0x9')](),controller[_0x4624('0x22')]);router[_0x4624('0x21')](_0x4624('0x17'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x4624('0x21')](_0x4624('0xe'),auth[_0x4624('0x9')](),controller[_0x4624('0x23')]);router[_0x4624('0x21')](_0x4624('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4624('0x24')]=router; \ No newline at end of file +var _0x6f3a=['getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','express','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','describe','show','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x6f3a,0x1c4));var _0xa6f3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6f3a[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xa6f3('0x0'));var util=require(_0xa6f3('0x1'));var path=require(_0xa6f3('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6f3('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa6f3('0x4'));var config=require(_0xa6f3('0x5'));var controller=require(_0xa6f3('0x6'));router['get']('/',auth[_0xa6f3('0x7')](),controller['index']);router[_0xa6f3('0x8')]('/describe',auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x9')]);router[_0xa6f3('0x8')]('/:id',auth[_0xa6f3('0x7')](),controller[_0xa6f3('0xa')]);router['get'](_0xa6f3('0xb'),auth[_0xa6f3('0x7')](),controller['getDispositions']);router[_0xa6f3('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa6f3('0xc')]);router[_0xa6f3('0x8')](_0xa6f3('0xd'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0xe')]);router[_0xa6f3('0x8')](_0xa6f3('0xf'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x10')]);router[_0xa6f3('0x8')](_0xa6f3('0x11'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x12')]);router[_0xa6f3('0x13')]('/',auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x14')]);router[_0xa6f3('0x13')]('/:id/dispositions',auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x15')]);router['post'](_0xa6f3('0x16'),auth['isAuthenticated'](),controller[_0xa6f3('0x17')]);router[_0xa6f3('0x13')]('/:id/notify',controller[_0xa6f3('0x18')]);router[_0xa6f3('0x13')](_0xa6f3('0xd'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x19')]);router[_0xa6f3('0x13')](_0xa6f3('0x11'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x1a')]);router[_0xa6f3('0x13')](_0xa6f3('0x1b'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x1c')]);router[_0xa6f3('0x1d')](_0xa6f3('0x1e'),auth['isAuthenticated'](),controller[_0xa6f3('0x1f')]);router[_0xa6f3('0x20')](_0xa6f3('0x1e'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x21')]);router[_0xa6f3('0x20')](_0xa6f3('0xb'),auth[_0xa6f3('0x7')](),controller['removeDispositions']);router[_0xa6f3('0x20')](_0xa6f3('0x16'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x22')]);router['delete'](_0xa6f3('0x11'),auth[_0xa6f3('0x7')](),controller[_0xa6f3('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 92965bf..addde67 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 _0x22e8=['exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22e8,0xb0));var _0x822e=function(_0x3fec10,_0x247da6){_0x3fec10=_0x3fec10-0x0;var _0x19c398=_0x22e8[_0x3fec10];return _0x19c398;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x822e('0x0')]={'name':{'type':Sequelize[_0x822e('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x822e('0x1')]},'token':{'type':Sequelize[_0x822e('0x1')],'defaultValue':function(){return rs[_0x822e('0x2')]();}},'replyUri':{'type':Sequelize[_0x822e('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x822e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x822e('0x3')],'defaultValue':function(){return _0x822e('0x4');}},'notificationSound':{'type':Sequelize[_0x822e('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x822e('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x822e('0x1')]},'queueTransfer':{'type':Sequelize[_0x822e('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x822e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x822e('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x822e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x822e('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x822e('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x822e('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1dac8f){if(!_0x1dac8f)this[_0x822e('0x8')](_0x822e('0x9'),null);this[_0x822e('0x8')](_0x822e('0xa'),_0x1dac8f);}}}; \ No newline at end of file +var _0xfc76=['exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x25bb0a,_0x797eb7){var _0xa84494=function(_0x3fa9c9){while(--_0x3fa9c9){_0x25bb0a['push'](_0x25bb0a['shift']());}};_0xa84494(++_0x797eb7);}(_0xfc76,0xb5));var _0x6fc7=function(_0x59e4c9,_0x567be6){_0x59e4c9=_0x59e4c9-0x0;var _0x8d9ad3=_0xfc76[_0x59e4c9];return _0x8d9ad3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6fc7('0x0'));module[_0x6fc7('0x1')]={'name':{'type':Sequelize[_0x6fc7('0x2')],'unique':_0x6fc7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6fc7('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6fc7('0x4')]();}},'replyUri':{'type':Sequelize[_0x6fc7('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6fc7('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6fc7('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6fc7('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6fc7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x6fc7('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fc7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6fc7('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fc7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6fc7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6fc7('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6fc7('0x9'),'set':function(_0x61730a){if(!_0x61730a)this[_0x6fc7('0xa')](_0x6fc7('0xb'),null);this[_0x6fc7('0xa')](_0x6fc7('0xc'),_0x61730a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d940c1e..0ac0a32 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 _0x7824=['params','create','user','role','OpenchannelAccounts','find','autoAssociation','body','describe','OpnechannelAccountId','Disposition','findOne','hasOwnProperty','pick','include','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','forcedOwnership','Start','startRouting','EventManager','transaction','map','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','rows','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','limit','set','apply','reject','save','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','key','VIRTUAL','field','filter','options','count','includeAll','findAll','show'];(function(_0x335144,_0xd20c9c){var _0x38fbe7=function(_0x457415){while(--_0x457415){_0x335144['push'](_0x335144['shift']());}};_0x38fbe7(++_0xd20c9c);}(_0x7824,0x1d7));var _0x4782=function(_0x4c0561,_0x511a52){_0x4c0561=_0x4c0561-0x0;var _0x46ceb7=_0x7824[_0x4c0561];return _0x46ceb7;};'use strict';var pdf=require(_0x4782('0x0'));var emlformat=require(_0x4782('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4782('0x2'));var jsonpatch=require(_0x4782('0x3'));var rp=require('request-promise');var moment=require(_0x4782('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4782('0x5'));var util=require(_0x4782('0x6'));var path=require('path');var sox=require(_0x4782('0x7'));var csv=require(_0x4782('0x8'));var ejs=require(_0x4782('0x9'));var fs=require('fs');var _=require(_0x4782('0xa'));var squel=require(_0x4782('0xb'));var crypto=require('crypto');var jsforce=require(_0x4782('0xc'));var deskjs=require(_0x4782('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4782('0xe'));var Papa=require(_0x4782('0xf'));var Redis=require('ioredis');var authService=require(_0x4782('0x10'));var qs=require(_0x4782('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4782('0x12'))(_0x4782('0x13'));var utils=require(_0x4782('0x14'));var config=require('../../config/environment');var db=require(_0x4782('0x15'))['db'];config[_0x4782('0x16')]=_[_0x4782('0x17')](config['redis'],{'host':_0x4782('0x18'),'port':0x18eb});var socket=require(_0x4782('0x19'))(new Redis(config[_0x4782('0x16')]));require('./openchannelAccount.socket')[_0x4782('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4782('0x1b')]({'port':0x232c});var client9002=jayson[_0x4782('0x1c')][_0x4782('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x558fcf,_0x108233,_0x3cdb4c){if(_0x3cdb4c){var _0x3528a0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3528a0[_0x4782('0x1d')](_0x108233)){return _0x558fcf;}else{throw new Error(_0x4782('0x1e'));}}else{return _0x558fcf;}}function respondWithRpcPromise(_0x778bf5,_0x3fc09e,_0x2ace5a,_0x43d550){return new BPromise(function(_0x25d8ea,_0x5e4115){var _0x59944e=_0x43d550||client;return _0x59944e[_0x4782('0x1f')](_0x778bf5,_0x2ace5a)[_0x4782('0x20')](function(_0x1b4747){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3fc09e,_0x4782('0x21'));logger[_0x4782('0x22')](_0x4782('0x23'),_0x3fc09e,_0x4782('0x21'),JSON[_0x4782('0x24')](_0x1b4747));if(_0x1b4747[_0x4782('0x25')]){if(_0x1b4747[_0x4782('0x25')][_0x4782('0x26')]===0x1f4){logger[_0x4782('0x25')](_0x4782('0x27'),_0x3fc09e,_0x1b4747['error']['message']);return _0x5e4115(_0x1b4747[_0x4782('0x25')][_0x4782('0x28')]);}logger[_0x4782('0x25')](_0x4782('0x27'),_0x3fc09e,_0x1b4747['error']['message']);return _0x25d8ea(_0x1b4747[_0x4782('0x25')][_0x4782('0x28')]);}else{logger[_0x4782('0x29')](_0x4782('0x27'),_0x3fc09e,_0x4782('0x21'));_0x25d8ea(_0x1b4747[_0x4782('0x2a')][_0x4782('0x28')]);}})[_0x4782('0x2b')](function(_0x1fad8d){logger[_0x4782('0x25')](_0x4782('0x27'),_0x3fc09e,_0x1fad8d);_0x5e4115(_0x1fad8d);});});}function respondWithStatusCode(_0x5cdc86,_0x517f6a){_0x517f6a=_0x517f6a||0xcc;return function(_0x20fa37){if(_0x20fa37){return _0x5cdc86['sendStatus'](_0x517f6a);}return _0x5cdc86[_0x4782('0x2c')](_0x517f6a)[_0x4782('0x2d')]();};}function respondWithResult(_0x581fb3,_0x3a60bd){_0x3a60bd=_0x3a60bd||0xc8;return function(_0x153cae){if(_0x153cae){return _0x581fb3[_0x4782('0x2c')](_0x3a60bd)[_0x4782('0x2e')](_0x153cae);}};}function respondWithFilteredResult(_0x4d3bcb,_0x53b936){return function(_0x3c197c){if(_0x3c197c){var _0x791931=_0x3c197c['count'],_0x237eac=_0x53b936[_0x4782('0x2f')],_0x2a71f7=_0x53b936['offset']+_0x53b936[_0x4782('0x30')],_0x4da50a;if(_0x2a71f7>=_0x791931){_0x2a71f7=_0x791931;_0x4da50a=0xc8;}else{_0x4da50a=0xce;}_0x4d3bcb[_0x4782('0x2c')](_0x4da50a);return _0x4d3bcb[_0x4782('0x31')]('Content-Range',_0x237eac+'-'+_0x2a71f7+'/'+_0x791931)[_0x4782('0x2e')](_0x3c197c);}return null;};}function patchUpdates(_0x364ae2){return function(_0x59b7d9){try{jsonpatch[_0x4782('0x32')](_0x59b7d9,_0x364ae2,!![]);}catch(_0x597c72){return BPromise[_0x4782('0x33')](_0x597c72);}return _0x59b7d9[_0x4782('0x34')]();};}function saveUpdates(_0x376740,_0x15009a){return function(_0x5b2002){if(_0x5b2002){return _0x5b2002[_0x4782('0x35')](_0x376740)[_0x4782('0x20')](function(_0x471542){return _0x471542;});}return null;};}function removeEntity(_0x49505b,_0x50730b){return function(_0x3f5747){if(_0x3f5747){return _0x3f5747['destroy']()[_0x4782('0x20')](function(){var _0x2af0d2=_0x3f5747[_0x4782('0x36')]({'plain':!![]});var _0x4eefd8='OpenchannelAccounts';return db[_0x4782('0x37')][_0x4782('0x38')]({'where':{'type':_0x4eefd8,'resourceId':_0x2af0d2['id']}})[_0x4782('0x20')](function(){return _0x3f5747;});})[_0x4782('0x20')](function(){_0x49505b[_0x4782('0x2c')](0xcc)[_0x4782('0x2d')]();});}};}function handleEntityNotFound(_0x2923f9,_0x18184d){return function(_0x46556c){if(!_0x46556c){_0x2923f9[_0x4782('0x39')](0x194);}return _0x46556c;};}function handleError(_0x2ebce7,_0x28bba4){_0x28bba4=_0x28bba4||0x1f4;return function(_0x27ce82){logger['error'](_0x27ce82[_0x4782('0x3a')]);if(_0x27ce82[_0x4782('0x3b')]){delete _0x27ce82['name'];}_0x2ebce7[_0x4782('0x2c')](_0x28bba4)[_0x4782('0x3c')](_0x27ce82);};}exports['index']=function(_0x5dc629,_0x1f2e01){var _0x3678dc={'include':[{'model':db[_0x4782('0x3d')],'as':_0x4782('0x3e')}]},_0x23e62a={},_0x30e2d7={'count':0x0,'rows':[]};var _0x3febd8=db[_0x4782('0x3f')][_0x4782('0x40')];_0x23e62a[_0x4782('0x41')]=_[_0x4782('0x42')](_0x3febd8);_0x23e62a[_0x4782('0x43')]=_['keys'](_0x5dc629[_0x4782('0x43')]);_0x23e62a['filters']=_[_0x4782('0x44')](_0x23e62a[_0x4782('0x41')],_0x23e62a[_0x4782('0x43')]);_0x3678dc[_0x4782('0x45')]=_[_0x4782('0x44')](_0x23e62a[_0x4782('0x41')],qs[_0x4782('0x46')](_0x5dc629[_0x4782('0x43')][_0x4782('0x46')]));_0x3678dc[_0x4782('0x45')]=_0x3678dc[_0x4782('0x45')][_0x4782('0x47')]?_0x3678dc['attributes']:_0x23e62a[_0x4782('0x41')];if(!_0x5dc629['query']['hasOwnProperty'](_0x4782('0x48'))){_0x3678dc[_0x4782('0x30')]=qs[_0x4782('0x30')](_0x5dc629[_0x4782('0x43')][_0x4782('0x30')]);_0x3678dc[_0x4782('0x2f')]=qs[_0x4782('0x2f')](_0x5dc629[_0x4782('0x43')]['offset']);}_0x3678dc[_0x4782('0x49')]=qs[_0x4782('0x4a')](_0x5dc629['query'][_0x4782('0x4a')]);_0x3678dc[_0x4782('0x4b')]=qs[_0x4782('0x4c')](_['pick'](_0x5dc629[_0x4782('0x43')],_0x23e62a[_0x4782('0x4c')]));if(_0x5dc629[_0x4782('0x43')]['filter']){_0x3678dc['where']=_[_0x4782('0x4d')](_0x3678dc[_0x4782('0x4b')],{'$or':_['map'](_0x3febd8,function(_0x585c77){if(_0x585c77['type'][_0x4782('0x4e')]!==_0x4782('0x4f')){var _0x387d6e={};_0x387d6e[_0x585c77[_0x4782('0x50')]]={'$like':'%'+_0x5dc629[_0x4782('0x43')][_0x4782('0x51')]+'%'};return _0x387d6e;}})});}_0x3678dc=_['merge']({},_0x3678dc,_0x5dc629[_0x4782('0x52')]);var _0x17781={'where':_0x3678dc['where']};return db[_0x4782('0x3f')][_0x4782('0x53')](_0x17781)['then'](function(_0x61bbe2){_0x30e2d7[_0x4782('0x53')]=_0x61bbe2;if(_0x5dc629[_0x4782('0x43')][_0x4782('0x54')]){_0x3678dc['include']=[{'all':!![]}];}return db[_0x4782('0x3f')][_0x4782('0x55')](_0x3678dc);})[_0x4782('0x20')](function(_0x4cc80c){_0x30e2d7['rows']=_0x4cc80c;return _0x30e2d7;})[_0x4782('0x20')](respondWithFilteredResult(_0x1f2e01,_0x3678dc))[_0x4782('0x2b')](handleError(_0x1f2e01,null));};exports[_0x4782('0x56')]=function(_0x523636,_0x481288){var _0x5ac0d7={'raw':![],'where':{'id':_0x523636[_0x4782('0x57')]['id']},'include':[{'model':db[_0x4782('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3a3a94={};_0x3a3a94['model']=_[_0x4782('0x42')](db[_0x4782('0x3f')][_0x4782('0x40')]);_0x3a3a94[_0x4782('0x43')]=_[_0x4782('0x42')](_0x523636[_0x4782('0x43')]);_0x3a3a94[_0x4782('0x4c')]=_[_0x4782('0x44')](_0x3a3a94[_0x4782('0x41')],_0x3a3a94[_0x4782('0x43')]);_0x5ac0d7[_0x4782('0x45')]=_[_0x4782('0x44')](_0x3a3a94[_0x4782('0x41')],qs[_0x4782('0x46')](_0x523636[_0x4782('0x43')][_0x4782('0x46')]));_0x5ac0d7[_0x4782('0x45')]=_0x5ac0d7[_0x4782('0x45')][_0x4782('0x47')]?_0x5ac0d7[_0x4782('0x45')]:_0x3a3a94['model'];if(_0x523636['query'][_0x4782('0x54')]){_0x5ac0d7['include']=[{'all':!![]}];}_0x5ac0d7=_[_0x4782('0x4d')]({},_0x5ac0d7,_0x523636[_0x4782('0x52')]);return db[_0x4782('0x3f')]['find'](_0x5ac0d7)['then'](handleEntityNotFound(_0x481288,null))['then'](respondWithResult(_0x481288,null))[_0x4782('0x2b')](handleError(_0x481288,null));};exports['create']=function(_0x15b6dc,_0x83d721){return db['OpenchannelAccount'][_0x4782('0x58')](_0x15b6dc['body'],{})[_0x4782('0x20')](function(_0x31c43c){var _0x1b6cbd=_0x15b6dc[_0x4782('0x59')][_0x4782('0x36')]({'plain':!![]});if(!_0x1b6cbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b6cbd[_0x4782('0x5a')]==='user'){var _0x5caf3c=_0x31c43c['get']({'plain':!![]});var _0x22ebe9=_0x4782('0x5b');return db['UserProfileSection'][_0x4782('0x5c')]({'where':{'name':_0x22ebe9,'userProfileId':_0x1b6cbd['userProfileId']},'raw':!![]})[_0x4782('0x20')](function(_0x17402a){if(_0x17402a&&_0x17402a[_0x4782('0x5d')]===0x0){return db[_0x4782('0x37')][_0x4782('0x58')]({'name':_0x5caf3c[_0x4782('0x3b')],'resourceId':_0x5caf3c['id'],'type':_0x17402a[_0x4782('0x3b')],'sectionId':_0x17402a['id']},{})['then'](function(){return _0x31c43c;});}else{return _0x31c43c;}})[_0x4782('0x2b')](function(_0x387146){logger[_0x4782('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x387146);throw _0x387146;});}return _0x31c43c;})['then'](respondWithResult(_0x83d721,0xc9))[_0x4782('0x2b')](handleError(_0x83d721,null));};exports[_0x4782('0x35')]=function(_0xd1db0b,_0x598b4){if(_0xd1db0b['body']['id']){delete _0xd1db0b[_0x4782('0x5e')]['id'];}return db[_0x4782('0x3f')]['find']({'where':{'id':_0xd1db0b[_0x4782('0x57')]['id']},'include':[{'model':db[_0x4782('0x3d')],'as':_0x4782('0x3e')}]})[_0x4782('0x20')](handleEntityNotFound(_0x598b4,null))['then'](saveUpdates(_0xd1db0b[_0x4782('0x5e')],null))['then'](respondWithResult(_0x598b4,null))[_0x4782('0x2b')](handleError(_0x598b4,null));};exports[_0x4782('0x38')]=function(_0x59ca51,_0x184cfc){return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x59ca51[_0x4782('0x57')]['id']}})['then'](handleEntityNotFound(_0x184cfc,null))[_0x4782('0x20')](removeEntity(_0x184cfc,null))['catch'](handleError(_0x184cfc,null));};exports[_0x4782('0x5f')]=function(_0x2dfe6,_0x398ba2){return db[_0x4782('0x3f')]['describe']()[_0x4782('0x20')](respondWithResult(_0x398ba2,null))[_0x4782('0x2b')](handleError(_0x398ba2,null));};exports['addDisposition']=function(_0x42b1a0,_0x5ed854,_0x5d013a){if(_0x42b1a0[_0x4782('0x5e')]['id']){delete _0x42b1a0[_0x4782('0x5e')]['id'];}return db['OpenchannelAccount'][_0x4782('0x5c')]({'where':{'id':_0x42b1a0[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x5ed854,null))[_0x4782('0x20')](function(_0x325474){if(_0x325474){_0x42b1a0['body'][_0x4782('0x60')]=_0x325474['id'];return db[_0x4782('0x61')][_0x4782('0x58')](_0x42b1a0[_0x4782('0x5e')]);}})[_0x4782('0x20')](respondWithResult(_0x5ed854,null))[_0x4782('0x2b')](handleError(_0x5ed854,null));};exports['getDispositions']=function(_0xc2458d,_0x46c807,_0x44a9f8){var _0x198e0d={'raw':![],'where':{}};var _0x300cdd={};var _0x50c86c={'count':0x0,'rows':[]};return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0xc2458d[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x46c807,null))[_0x4782('0x20')](function(_0x38741b){if(_0x38741b){_0x300cdd[_0x4782('0x41')]=_[_0x4782('0x42')](db[_0x4782('0x61')][_0x4782('0x40')]);_0x300cdd[_0x4782('0x43')]=_[_0x4782('0x42')](_0xc2458d[_0x4782('0x43')]);_0x300cdd[_0x4782('0x4c')]=_['intersection'](_0x300cdd['model'],_0x300cdd['query']);_0x198e0d['attributes']=_[_0x4782('0x44')](_0x300cdd[_0x4782('0x41')],qs[_0x4782('0x46')](_0xc2458d['query'][_0x4782('0x46')]));_0x198e0d[_0x4782('0x45')]=_0x198e0d[_0x4782('0x45')][_0x4782('0x47')]?_0x198e0d[_0x4782('0x45')]:_0x300cdd[_0x4782('0x41')];if(!_0xc2458d['query'][_0x4782('0x63')](_0x4782('0x48'))){_0x198e0d[_0x4782('0x30')]=qs[_0x4782('0x30')](_0xc2458d['query']['limit']);_0x198e0d['offset']=qs[_0x4782('0x2f')](_0xc2458d[_0x4782('0x43')]['offset']);}_0x198e0d['order']=qs[_0x4782('0x4a')](_0xc2458d[_0x4782('0x43')][_0x4782('0x4a')]);_0x198e0d[_0x4782('0x4b')]=qs[_0x4782('0x4c')](_[_0x4782('0x64')](_0xc2458d[_0x4782('0x43')],_0x300cdd[_0x4782('0x4c')]));_0x198e0d[_0x4782('0x4b')]['OpenchannelAccountId']=_0x38741b['id'];if(_0xc2458d['query'][_0x4782('0x51')]){_0x198e0d[_0x4782('0x4b')]=_[_0x4782('0x4d')](_0x198e0d['where'],{'$or':_['map'](_0x198e0d[_0x4782('0x45')],function(_0x1951a5){var _0x24c0be={};_0x24c0be[_0x1951a5]={'$like':'%'+_0xc2458d[_0x4782('0x43')][_0x4782('0x51')]+'%'};return _0x24c0be;})});}_0x198e0d=_['merge']({},_0x198e0d,_0xc2458d[_0x4782('0x52')]);return db['Disposition'][_0x4782('0x53')]({'where':_0x198e0d[_0x4782('0x4b')]})[_0x4782('0x20')](function(_0xe97bf0){_0x50c86c[_0x4782('0x53')]=_0xe97bf0;if(_0xc2458d[_0x4782('0x43')][_0x4782('0x54')]){_0x198e0d[_0x4782('0x65')]=[{'all':!![]}];}return db['Disposition'][_0x4782('0x55')](_0x198e0d);})[_0x4782('0x20')](function(_0x2792b9){_0x50c86c['rows']=_0x2792b9;return _0x50c86c;});}})[_0x4782('0x20')](respondWithFilteredResult(_0x46c807,_0x198e0d))[_0x4782('0x2b')](handleError(_0x46c807,null));};exports['removeDispositions']=function(_0x54f19c,_0x207d0f,_0x3a548f){return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x54f19c[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x207d0f,null))[_0x4782('0x20')](function(_0x43b122){if(_0x43b122){return _0x43b122[_0x4782('0x66')](_0x54f19c['query']['ids']);}})[_0x4782('0x20')](respondWithStatusCode(_0x207d0f,null))[_0x4782('0x2b')](handleError(_0x207d0f,null));};exports[_0x4782('0x67')]=function(_0x50ec0a,_0x4fcf2e,_0x2129df){if(_0x50ec0a[_0x4782('0x5e')]['id']){delete _0x50ec0a[_0x4782('0x5e')]['id'];}return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x50ec0a[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x4fcf2e,null))[_0x4782('0x20')](function(_0x5ed1bd){if(_0x5ed1bd){_0x50ec0a['body'][_0x4782('0x68')]=_0x5ed1bd['id'];return db[_0x4782('0x69')][_0x4782('0x58')](_0x50ec0a[_0x4782('0x5e')]);}})[_0x4782('0x20')](respondWithResult(_0x4fcf2e,null))['catch'](handleError(_0x4fcf2e,null));};exports[_0x4782('0x6a')]=function(_0x13fc21,_0x4939ad,_0x46bcf0){var _0x8b1880={'raw':![],'where':{}};var _0x3b3cd0={};var _0x27b8f0={'count':0x0,'rows':[]};return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0x13fc21[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x4939ad,null))[_0x4782('0x20')](function(_0x5f3ceb){if(_0x5f3ceb){_0x3b3cd0[_0x4782('0x41')]=_['keys'](db['CannedAnswer'][_0x4782('0x40')]);_0x3b3cd0[_0x4782('0x43')]=_[_0x4782('0x42')](_0x13fc21['query']);_0x3b3cd0['filters']=_[_0x4782('0x44')](_0x3b3cd0[_0x4782('0x41')],_0x3b3cd0['query']);_0x8b1880[_0x4782('0x45')]=_[_0x4782('0x44')](_0x3b3cd0['model'],qs[_0x4782('0x46')](_0x13fc21['query'][_0x4782('0x46')]));_0x8b1880[_0x4782('0x45')]=_0x8b1880[_0x4782('0x45')][_0x4782('0x47')]?_0x8b1880[_0x4782('0x45')]:_0x3b3cd0['model'];if(!_0x13fc21[_0x4782('0x43')]['hasOwnProperty'](_0x4782('0x48'))){_0x8b1880[_0x4782('0x30')]=qs[_0x4782('0x30')](_0x13fc21[_0x4782('0x43')]['limit']);_0x8b1880[_0x4782('0x2f')]=qs[_0x4782('0x2f')](_0x13fc21[_0x4782('0x43')][_0x4782('0x2f')]);}_0x8b1880[_0x4782('0x49')]=qs[_0x4782('0x4a')](_0x13fc21[_0x4782('0x43')][_0x4782('0x4a')]);_0x8b1880[_0x4782('0x4b')]=qs[_0x4782('0x4c')](_[_0x4782('0x64')](_0x13fc21['query'],_0x3b3cd0[_0x4782('0x4c')]));_0x8b1880[_0x4782('0x4b')][_0x4782('0x68')]=_0x5f3ceb['id'];if(_0x13fc21[_0x4782('0x43')][_0x4782('0x51')]){_0x8b1880[_0x4782('0x4b')]=_[_0x4782('0x4d')](_0x8b1880[_0x4782('0x4b')],{'$or':_['map'](_0x8b1880[_0x4782('0x45')],function(_0x187424){var _0x244eea={};_0x244eea[_0x187424]={'$like':'%'+_0x13fc21['query']['filter']+'%'};return _0x244eea;})});}_0x8b1880=_[_0x4782('0x4d')]({},_0x8b1880,_0x13fc21['options']);return db[_0x4782('0x69')][_0x4782('0x53')]({'where':_0x8b1880[_0x4782('0x4b')]})['then'](function(_0x4fdde5){_0x27b8f0[_0x4782('0x53')]=_0x4fdde5;if(_0x13fc21[_0x4782('0x43')]['includeAll']){_0x8b1880['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4782('0x55')](_0x8b1880);})[_0x4782('0x20')](function(_0x14b599){_0x27b8f0['rows']=_0x14b599;return _0x27b8f0;});}})[_0x4782('0x20')](respondWithFilteredResult(_0x4939ad,_0x8b1880))['catch'](handleError(_0x4939ad,null));};exports['removeAnswers']=function(_0x3647fb,_0x2b4833,_0x1b16fa){return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x3647fb['params']['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x2b4833,null))[_0x4782('0x20')](function(_0x45fa59){if(_0x45fa59){return _0x45fa59[_0x4782('0x6b')](_0x3647fb[_0x4782('0x43')][_0x4782('0x6c')]);}})[_0x4782('0x20')](respondWithStatusCode(_0x2b4833,null))[_0x4782('0x2b')](handleError(_0x2b4833,null));};exports[_0x4782('0x6d')]=function(_0x341f5c,_0x27e9af,_0x8fa15e){var _0x180f06={'body':_0x341f5c[_0x4782('0x5e')],'channel':'openchannel'};var _0x25a9a7=[];var _0x11f8f3=[];var _0x301595={};var _0x1ddaaa=![];return db[_0x4782('0x6e')][_0x4782('0x5f')]()[_0x4782('0x20')](function(_0x272848){if(!_0x272848){throw new db['Sequelize'][(_0x4782('0x6f'))](_0x4782('0x70'));}_0x25a9a7=_[_0x4782('0x71')](_[_0x4782('0x42')](_0x272848),['createdAt',_0x4782('0x72')]);_0x11f8f3=_[_0x4782('0x71')](_[_0x4782('0x42')](_0x272848),[_0x4782('0x73'),_0x4782('0x72'),_0x4782('0x74'),_0x4782('0x75')]);if(_0x341f5c['body']['id']){delete _0x341f5c['body']['id'];}if(_['isNil'](_0x341f5c['body'][_0x4782('0x76')])){throw new db[(_0x4782('0x77'))]['ValidationError'](_0x4782('0x78'));}if(_[_0x4782('0x79')](_0x341f5c[_0x4782('0x5e')][_0x4782('0x5e')])||_0x341f5c['body']['body']===''){throw new db[(_0x4782('0x77'))]['ValidationError'](_0x4782('0x7a'));}if(_['isNil'](_0x341f5c[_0x4782('0x5e')][_0x4782('0x7b')])){throw new db[(_0x4782('0x77'))][(_0x4782('0x6f'))](_0x4782('0x7c')+_0x11f8f3);}if(!_[_0x4782('0x7d')](_0x11f8f3,_0x341f5c['body']['mapKey'])){throw new db[(_0x4782('0x77'))][(_0x4782('0x6f'))](_0x4782('0x7e')+_0x11f8f3);}_0x301595[_0x341f5c[_0x4782('0x5e')][_0x4782('0x7b')]]=_0x341f5c[_0x4782('0x5e')]['from'];})[_0x4782('0x20')](function(){return db[_0x4782('0x3f')]['find']({'where':{'id':_0x341f5c['params']['id']},'include':[{'model':db[_0x4782('0x7f')],'as':_0x4782('0x80'),'include':[{'model':db[_0x4782('0x6e')],'as':_0x4782('0x81'),'where':_0x301595,'limit':0x1,'order':[[_0x4782('0x72'),'DESC']]}]},{'model':db[_0x4782('0x82')],'as':_0x4782('0x83')}]});})['then'](handleEntityNotFound(_0x27e9af,null))['then'](function(_0xe05309){if(_0xe05309&&_0xe05309['List']){_0x180f06['account']=_0xe05309;_0x180f06[_0x4782('0x84')]=_0xe05309[_0x4782('0x83')];_0x180f06[_0x4782('0x85')]=_0xe05309['List'];_0x180f06[_0x4782('0x84')]=_[_0x4782('0x86')](_0x180f06[_0x4782('0x84')],[_0x4782('0x87')],[_0x4782('0x88')]);if(_0x180f06[_0x4782('0x89')][_0x4782('0x83')]){delete _0x180f06['account'][_0x4782('0x83')];}if(_0x180f06['account'][_0x4782('0x80')]&&_0x180f06[_0x4782('0x89')][_0x4782('0x80')][_0x4782('0x81')][_0x4782('0x47')]){return _0x180f06[_0x4782('0x89')]['List']['Contacts'][0x0];}var _0x2e43cf=_[_0x4782('0x17')](_0x341f5c[_0x4782('0x5e')],{'firstName':_0x341f5c['body'][_0x4782('0x76')],'ListId':_0xe05309[_0x4782('0x75')]});_0x2e43cf[_0x341f5c[_0x4782('0x5e')][_0x4782('0x7b')]]=_0x341f5c['body'][_0x4782('0x76')];return db[_0x4782('0x6e')][_0x4782('0x58')](_0x2e43cf,{'fields':_0x25a9a7,'raw':!![]});}})[_0x4782('0x20')](handleEntityNotFound(_0x27e9af,null))[_0x4782('0x20')](function(_0x4da986){_0x180f06[_0x4782('0x8a')]=_0x4da986;if(_0x4da986){var _0x3f8a3c={'ContactId':_0x4da986['id'],'OpenchannelAccountId':_0x341f5c[_0x4782('0x57')]['id'],'from':(_0x4da986['firstName']||'')+'\x20'+(_0x4da986['lastName']||'')};var _0x1215b0={'OpenchannelAccountId':_0x341f5c[_0x4782('0x57')]['id'],'closed':![]};if(_0x341f5c['body'][_0x4782('0x8b')]){_0x1215b0[_0x4782('0x8b')]=_0x341f5c[_0x4782('0x5e')]['threadId'];return db[_0x4782('0x8c')][_0x4782('0x5c')]({'where':_0x1215b0})[_0x4782('0x20')](function(_0x3ba50f){if(_0x3ba50f){return[_0x3ba50f,![]];}_0x3f8a3c['threadId']=_0x341f5c[_0x4782('0x5e')]['threadId'];_0x3f8a3c[_0x4782('0x8d')]=_0x341f5c[_0x4782('0x5e')][_0x4782('0x8d')];return db['OpenchannelInteraction'][_0x4782('0x58')](_0x3f8a3c)[_0x4782('0x20')](function(_0x29b800){return[_0x29b800,!![]];});});}else{_0x1215b0[_0x4782('0x8b')]=null;}_0x1215b0[_0x4782('0x8e')]=_0x4da986['id'];return db[_0x4782('0x8c')][_0x4782('0x5c')]({'where':_0x1215b0})['then'](function(_0x45128e){if(_0x45128e){return[_0x45128e,![]];}return db[_0x4782('0x8c')]['create'](_0x3f8a3c)[_0x4782('0x20')](function(_0x202759){return[_0x202759,!![]];});});}})[_0x4782('0x8f')](function(_0x5152b1,_0x5f4de1){if(_0x5152b1){_0x1ddaaa=_0x5f4de1;if(!_0x5f4de1){var _0x5d4449={'from':(_0x180f06[_0x4782('0x8a')]['firstName']||'')+'\x20'+(_0x180f06[_0x4782('0x8a')][_0x4782('0x90')]||'')};if(_0x341f5c[_0x4782('0x5e')][_0x4782('0x8b')]&&_0x341f5c[_0x4782('0x5e')]['messageId']&&_0x341f5c[_0x4782('0x5e')]['threadId']!=_0x341f5c[_0x4782('0x5e')][_0x4782('0x91')]){_0x5d4449['threadId']=_0x341f5c[_0x4782('0x5e')][_0x4782('0x91')];}return _0x5152b1[_0x4782('0x35')](_0x5d4449);}else{return _0x5152b1;}}})[_0x4782('0x20')](function(_0x375b09){_0x180f06[_0x4782('0x92')]=_0x375b09[_0x4782('0x36')]({'plain':!![]});_0x180f06['interaction'][_0x4782('0x93')]=_0x1ddaaa;if(_0x180f06[_0x4782('0x92')][_0x4782('0x93')]){if(_0x180f06[_0x4782('0x89')][_0x4782('0x94')]){_0x180f06[_0x4782('0x84')][_0x4782('0x95')]({'id':0x0,'priority':_0x180f06[_0x4782('0x84')][_0x4782('0x47')]+0x1,'app':_0x4782('0x96'),'appdata':_0x4782('0x97'),'interval':_0x4782('0x98')});}}return db[_0x4782('0x99')][_0x4782('0x58')]({'body':_0x341f5c[_0x4782('0x5e')][_0x4782('0x5e')],'OpenchannelAccountId':_0x341f5c[_0x4782('0x57')]['id'],'OpenchannelInteractionId':_0x375b09['id'],'direction':'in','ContactId':_0x180f06[_0x4782('0x8a')]['id'],'AttachmentId':_0x341f5c[_0x4782('0x5e')][_0x4782('0x9a')]});})[_0x4782('0x20')](function(_0x13407c){_0x180f06[_0x4782('0x28')]=_0x13407c;if(_0x180f06[_0x4782('0x92')][_0x4782('0x9b')]){return db[_0x4782('0x9c')]['find']({'attributes':['id',_0x4782('0x3b')],'where':{'id':_0x180f06[_0x4782('0x92')][_0x4782('0x9b')]}})['then'](function(_0x1176ea){if(_0x1176ea){_0x180f06[_0x4782('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4782('0x9d'),'appdata':_0x1176ea['name']+','+(_0x180f06[_0x4782('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x4782('0x98')});_0x180f06[_0x4782('0x9e')]=![];}return respondWithRpcPromise(_0x4782('0x9f'),_0x4782('0xa0'),_0x180f06);});}return respondWithRpcPromise(_0x4782('0x9f'),_0x4782('0xa0'),_0x180f06);})['then'](function(_0x4d4ec5){respondWithRpcPromise('EventManager',_0x4782('0xa1'),{'event':'notify','message':_0x4d4ec5},client9002);return _0x4d4ec5;})['then'](respondWithResult(_0x27e9af,null))[_0x4782('0x2b')](handleError(_0x27e9af,null));};exports['addApplications']=function(_0x42d13b,_0x38653a,_0xa4097e){return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0x42d13b[_0x4782('0x57')]['id']}})['then'](handleEntityNotFound(_0x38653a,null))[_0x4782('0x20')](function(_0x461c17){if(_0x461c17){return db['sequelize'][_0x4782('0xa2')](function(_0x31ccc1){return db['OpenchannelApplication'][_0x4782('0x38')]({'where':{'OpenchannelAccountId':_0x42d13b[_0x4782('0x57')]['id']},'transaction':_0x31ccc1})[_0x4782('0x20')](function(_0x48db8e){var _0x32c82b=_[_0x4782('0xa3')](_0x42d13b['body'],function(_0x4a4f17){_0x4a4f17[_0x4782('0x68')]=_0x42d13b[_0x4782('0x57')]['id'];return _0x4a4f17;});return db[_0x4782('0x82')][_0x4782('0xa4')](_0x32c82b,{'transaction':_0x31ccc1});});})[_0x4782('0x20')](function(){return db[_0x4782('0x82')][_0x4782('0xa5')]({'where':{'OpenchannelAccountId':_0x42d13b[_0x4782('0x57')]['id']},'order':_0x4782('0x87')});});}})['then'](respondWithResult(_0x38653a,null))['catch'](handleError(_0x38653a,null));};exports[_0x4782('0xa6')]=function(_0x10a1a5,_0x5729c6,_0x46e0d4){var _0x48d989={};var _0x396521={};var _0x1ae8f4;var _0x20efd0;return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0x10a1a5[_0x4782('0x57')]['id']}})['then'](handleEntityNotFound(_0x5729c6,null))[_0x4782('0x20')](function(_0x43166b){if(_0x43166b){_0x1ae8f4=_0x43166b;_0x396521[_0x4782('0x41')]=_['keys'](db[_0x4782('0x82')][_0x4782('0x40')]);_0x396521['query']=_[_0x4782('0x42')](_0x10a1a5[_0x4782('0x43')]);_0x396521[_0x4782('0x4c')]=_['intersection'](_0x396521[_0x4782('0x41')],_0x396521[_0x4782('0x43')]);_0x48d989[_0x4782('0x45')]=_[_0x4782('0x44')](_0x396521[_0x4782('0x41')],qs[_0x4782('0x46')](_0x10a1a5[_0x4782('0x43')][_0x4782('0x46')]));_0x48d989[_0x4782('0x45')]=_0x48d989[_0x4782('0x45')][_0x4782('0x47')]?_0x48d989['attributes']:_0x396521['model'];_0x48d989[_0x4782('0x49')]=qs[_0x4782('0x4a')](_0x10a1a5[_0x4782('0x43')][_0x4782('0x4a')]);_0x48d989[_0x4782('0x4b')]=qs['filters'](_['pick'](_0x10a1a5[_0x4782('0x43')],_0x396521[_0x4782('0x4c')]));if(_0x10a1a5[_0x4782('0x43')][_0x4782('0x51')]){_0x48d989[_0x4782('0x4b')]=_[_0x4782('0x4d')](_0x48d989[_0x4782('0x4b')],{'$or':_[_0x4782('0xa3')](_0x48d989[_0x4782('0x45')],function(_0x36e903){var _0x51c642={};_0x51c642[_0x36e903]={'$like':'%'+_0x10a1a5[_0x4782('0x43')]['filter']+'%'};return _0x51c642;})});}_0x48d989=_['merge']({},_0x48d989,_0x10a1a5['options']);return _0x1ae8f4[_0x4782('0xa6')](_0x48d989);}})[_0x4782('0x20')](function(_0x509b07){if(_0x509b07){_0x20efd0=_0x509b07[_0x4782('0x47')];if(!_0x10a1a5[_0x4782('0x43')][_0x4782('0x63')]('nolimit')){_0x48d989[_0x4782('0x30')]=qs[_0x4782('0x30')](_0x10a1a5[_0x4782('0x43')][_0x4782('0x30')]);_0x48d989['offset']=qs[_0x4782('0x2f')](_0x10a1a5['query'][_0x4782('0x2f')]);}return _0x1ae8f4[_0x4782('0xa6')](_0x48d989);}})['then'](function(_0x12fefd){if(_0x12fefd){return _0x12fefd?{'count':_0x20efd0,'rows':_0x12fefd}:null;}})['then'](respondWithResult(_0x5729c6,null))['catch'](handleError(_0x5729c6,null));};exports[_0x4782('0xa7')]=function(_0x5641f0,_0xb99e91,_0x3fe142){var _0x24858e={'raw':![],'where':{}};var _0x33cdd4={};var _0xd6a288={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4782('0x62')]({'where':{'id':_0x5641f0['params']['id']}})['then'](handleEntityNotFound(_0xb99e91,null))[_0x4782('0x20')](function(_0x23a939){if(_0x23a939){_0x33cdd4['model']=_[_0x4782('0x42')](db['OpenchannelInteraction'][_0x4782('0x40')]);_0x33cdd4[_0x4782('0x43')]=_[_0x4782('0x42')](_0x5641f0[_0x4782('0x43')]);_0x33cdd4[_0x4782('0x4c')]=_['intersection'](_0x33cdd4[_0x4782('0x41')],_0x33cdd4[_0x4782('0x43')]);_0x24858e[_0x4782('0x45')]=_['intersection'](_0x33cdd4[_0x4782('0x41')],qs['fields'](_0x5641f0['query'][_0x4782('0x46')]));_0x24858e[_0x4782('0x45')]=_0x24858e[_0x4782('0x45')][_0x4782('0x47')]?_0x24858e[_0x4782('0x45')]:_0x33cdd4[_0x4782('0x41')];if(!_0x5641f0['query']['hasOwnProperty'](_0x4782('0x48'))){_0x24858e[_0x4782('0x30')]=qs['limit'](_0x5641f0['query'][_0x4782('0x30')]);_0x24858e[_0x4782('0x2f')]=qs[_0x4782('0x2f')](_0x5641f0[_0x4782('0x43')]['offset']);}_0x24858e[_0x4782('0x49')]=qs[_0x4782('0x4a')](_0x5641f0[_0x4782('0x43')]['sort']);_0x24858e[_0x4782('0x4b')]=qs[_0x4782('0x4c')](_['pick'](_0x5641f0[_0x4782('0x43')],_0x33cdd4[_0x4782('0x4c')]));_0x24858e[_0x4782('0x4b')][_0x4782('0x68')]=_0x23a939['id'];if(_0x5641f0['query']['filter']){_0x24858e['where']=_[_0x4782('0x4d')](_0x24858e['where'],{'$or':_[_0x4782('0xa3')](_0x24858e['attributes'],function(_0x54d2e1){var _0x378f7e={};_0x378f7e[_0x54d2e1]={'$like':'%'+_0x5641f0['query']['filter']+'%'};return _0x378f7e;})});}_0x24858e=_[_0x4782('0x4d')]({},_0x24858e,_0x5641f0[_0x4782('0x52')]);return db['OpenchannelInteraction']['count']({'where':_0x24858e[_0x4782('0x4b')]})[_0x4782('0x20')](function(_0x29476e){_0xd6a288[_0x4782('0x53')]=_0x29476e;if(_0x5641f0[_0x4782('0x43')][_0x4782('0x54')]){_0x24858e[_0x4782('0x65')]=[{'model':db[_0x4782('0x6e')],'as':_0x4782('0xa8'),'required':![]},{'model':db[_0x4782('0x9c')],'as':'Owner','attributes':['name',_0x4782('0xa9'),_0x4782('0xaa')],'required':![]},{'model':db['Tag'],'as':_0x4782('0xab'),'attributes':['id',_0x4782('0x3b'),_0x4782('0xac')],'where':_0x5641f0[_0x4782('0x43')]['tag']?{'id':_0x5641f0['query'][_0x4782('0xad')]}:undefined,'required':_0x5641f0['query'][_0x4782('0xad')]?!![]:![]}];}return db[_0x4782('0x8c')][_0x4782('0x55')](_0x24858e);})[_0x4782('0x20')](function(_0x2ee421){_0xd6a288[_0x4782('0xae')]=_0x2ee421;return _0xd6a288;});}})[_0x4782('0x20')](respondWithFilteredResult(_0xb99e91,_0x24858e))[_0x4782('0x2b')](handleError(_0xb99e91,null));};exports[_0x4782('0xaf')]=function(_0x35d75d,_0x5cbc86,_0x59371c){return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x35d75d[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x5cbc86,null))['then'](function(_0x5bab9a){if(_0x5bab9a){return _0x5bab9a[_0x4782('0xaf')](_0x35d75d[_0x4782('0x5e')][_0x4782('0x6c')],_[_0x4782('0xb0')](_0x35d75d['body'],[_0x4782('0x6c'),'id'])||{})['spread'](function(_0x360c4c){for(var _0x140579=0x0;_0x140579<_0x35d75d[_0x4782('0x5e')][_0x4782('0x6c')]['length'];_0x140579+=0x1){socket[_0x4782('0xb1')](_0x4782('0xb2'),{'UserId':_0x35d75d[_0x4782('0x5e')][_0x4782('0x6c')][_0x140579],'OpenchannelAccountId':_0x35d75d[_0x4782('0x57')]['id']});}return _0x360c4c;});}})[_0x4782('0x20')](respondWithResult(_0x5cbc86,null))[_0x4782('0x2b')](handleError(_0x5cbc86,null));};exports['removeAgents']=function(_0x387603,_0x2c86c0,_0x5ca183){return db[_0x4782('0x3f')]['find']({'where':{'id':_0x387603[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x2c86c0,null))['then'](function(_0x2c4b76){if(_0x2c4b76){return _0x2c4b76[_0x4782('0xb3')](_0x387603[_0x4782('0x43')]['ids'])[_0x4782('0x20')](function(){if(_[_0x4782('0xb4')](_0x387603[_0x4782('0x43')][_0x4782('0x6c')])){for(var _0x2914f2=0x0;_0x2914f2<_0x387603[_0x4782('0x43')]['ids'][_0x4782('0x47')];_0x2914f2+=0x1){socket['emit'](_0x4782('0xb5'),{'UserId':Number(_0x387603['query'][_0x4782('0x6c')][_0x2914f2]),'OpenchannelAccountId':Number(_0x387603[_0x4782('0x57')]['id'])});}}else{socket[_0x4782('0xb1')](_0x4782('0xb5'),{'UserId':Number(_0x387603[_0x4782('0x43')]['ids']),'OpenchannelAccountId':Number(_0x387603[_0x4782('0x57')]['id'])});}});}})[_0x4782('0x20')](respondWithStatusCode(_0x2c86c0,null))[_0x4782('0x2b')](handleError(_0x2c86c0,null));};exports['getAgents']=function(_0x4d0650,_0x18de3d,_0xe86548){var _0x12d94c={};var _0x495a98={};var _0x555a75;var _0xa6d0c7;return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0x4d0650[_0x4782('0x57')]['id']}})['then'](handleEntityNotFound(_0x18de3d,null))[_0x4782('0x20')](function(_0x591515){if(_0x591515){_0x555a75=_0x591515;_0x495a98[_0x4782('0x41')]=_[_0x4782('0x42')](db['User'][_0x4782('0x40')]);_0x495a98[_0x4782('0x43')]=_[_0x4782('0x42')](_0x4d0650[_0x4782('0x43')]);_0x495a98[_0x4782('0x4c')]=_[_0x4782('0x44')](_0x495a98[_0x4782('0x41')],_0x495a98[_0x4782('0x43')]);_0x12d94c[_0x4782('0x45')]=_[_0x4782('0x44')](_0x495a98['model'],qs[_0x4782('0x46')](_0x4d0650[_0x4782('0x43')][_0x4782('0x46')]));_0x12d94c['attributes']=_0x12d94c[_0x4782('0x45')][_0x4782('0x47')]?_0x12d94c['attributes']:_0x495a98[_0x4782('0x41')];_0x12d94c[_0x4782('0x49')]=qs[_0x4782('0x4a')](_0x4d0650[_0x4782('0x43')][_0x4782('0x4a')]);_0x12d94c[_0x4782('0x4b')]=qs[_0x4782('0x4c')](_[_0x4782('0x64')](_0x4d0650[_0x4782('0x43')],_0x495a98[_0x4782('0x4c')]));if(_0x4d0650[_0x4782('0x43')]['filter']){_0x12d94c[_0x4782('0x4b')]=_['merge'](_0x12d94c['where'],{'$or':_[_0x4782('0xa3')](_0x12d94c[_0x4782('0x45')],function(_0x2767e7){var _0x2ce84d={};_0x2ce84d[_0x2767e7]={'$like':'%'+_0x4d0650[_0x4782('0x43')][_0x4782('0x51')]+'%'};return _0x2ce84d;})});}_0x12d94c=_['merge']({},_0x12d94c,_0x4d0650[_0x4782('0x52')]);return _0x555a75[_0x4782('0xb6')](_0x12d94c);}})[_0x4782('0x20')](function(_0x4e5c6a){if(_0x4e5c6a){_0xa6d0c7=_0x4e5c6a[_0x4782('0x47')];if(!_0x4d0650[_0x4782('0x43')]['hasOwnProperty']('nolimit')){_0x12d94c[_0x4782('0x30')]=qs[_0x4782('0x30')](_0x4d0650[_0x4782('0x43')][_0x4782('0x30')]);_0x12d94c['offset']=qs[_0x4782('0x2f')](_0x4d0650[_0x4782('0x43')][_0x4782('0x2f')]);}return _0x555a75['getAgents'](_0x12d94c);}})[_0x4782('0x20')](function(_0x3b3d62){if(_0x3b3d62){return _0x3b3d62?{'count':_0xa6d0c7,'rows':_0x3b3d62}:null;}})[_0x4782('0x20')](respondWithResult(_0x18de3d,null))[_0x4782('0x2b')](handleError(_0x18de3d,null));};exports[_0x4782('0x3c')]=function(_0x396a4e,_0x236511,_0x401028){var _0x43fcdb,_0xfea81a,_0x492393;if(_[_0x4782('0x79')](_0x396a4e['body'][_0x4782('0x5e')])||_0x396a4e[_0x4782('0x5e')][_0x4782('0x5e')]===''){throw new db[(_0x4782('0x77'))][(_0x4782('0x6f'))](_0x4782('0x7a'));}if(_['isNil'](_0x396a4e[_0x4782('0x5e')]['to'])){}_0x43fcdb=_0x396a4e[_0x4782('0x5e')]['to'];return db[_0x4782('0x3f')][_0x4782('0x62')]({'where':{'id':_0x396a4e[_0x4782('0x57')]['id']}})[_0x4782('0x20')](handleEntityNotFound(_0x236511,null))[_0x4782('0x20')](function(_0x2171df){if(_0x2171df){return db[_0x4782('0x3f')][_0x4782('0x5c')]({'where':{'id':_0x2171df['id']},'include':[{'model':db[_0x4782('0x7f')],'as':_0x4782('0x80'),'include':[{'model':db[_0x4782('0x6e')],'as':_0x4782('0x81'),'where':{[_0x2171df[_0x4782('0x7b')]]:_0x43fcdb},'limit':0x1,'order':[[_0x4782('0x72'),'DESC']]}]}]})[_0x4782('0x20')](handleEntityNotFound(_0x236511,null))[_0x4782('0x20')](function(_0x4ac2e4){if(_0x4ac2e4&&_0x4ac2e4['List']){_0xfea81a=_0x4ac2e4[_0x4782('0x36')]({'plain':!![]});if(_0xfea81a['List']&&_0xfea81a[_0x4782('0x80')]['Contacts'][_0x4782('0x47')]){return _0xfea81a[_0x4782('0x80')][_0x4782('0x81')][0x0];}return db[_0x4782('0x6e')][_0x4782('0x58')](_[_0x4782('0x17')](_0x396a4e[_0x4782('0x5e')],{'firstName':_0x43fcdb,[_0x4ac2e4[_0x4782('0x7b')]]:_0x43fcdb,'phone':_0x43fcdb,'ListId':_0xfea81a[_0x4782('0x75')]}));}})[_0x4782('0x20')](handleEntityNotFound(_0x236511,null))[_0x4782('0x20')](function(_0x2a1fba){if(_0x2a1fba){_0x492393=_0x2a1fba;return db[_0x4782('0x8c')][_0x4782('0x5c')]({'where':{'ContactId':_0x492393['id'],'closed':![],'OpenchannelAccountId':_0xfea81a['id']}})[_0x4782('0x20')](function(_0x596177){if(_0x596177){return[_0x596177,![]];}return db[_0x4782('0x8c')]['create']({'UserId':_0x396a4e[_0x4782('0x59')]['id'],'ContactId':_0x492393['id'],'OpenchannelAccountId':_0xfea81a['id'],'lastMsgDirection':_0x4782('0xb7'),'Messages':[_[_0x4782('0x4d')](_0x396a4e[_0x4782('0x5e')],{'read':![],'body':_0x396a4e['body'][_0x4782('0x5e')],'OpenchannelAccountId':_0xfea81a['id'],'UserId':_0x396a4e[_0x4782('0x59')]['id'],'ContactId':_0x492393['id']})]},{'include':[{'model':db[_0x4782('0x99')],'as':_0x4782('0xb8')}]})[_0x4782('0x20')](function(_0x2815f7){return[_0x2815f7,!![]];});});}})[_0x4782('0x8f')](function(_0xa2f6ff,_0x1fe3f2){if(_0x1fe3f2){return _0xa2f6ff;}return db[_0x4782('0x99')][_0x4782('0x58')](_[_0x4782('0x4d')](_0x396a4e[_0x4782('0x5e')],{'read':![],'body':_0x396a4e['body'][_0x4782('0x5e')],'OpenchannelAccountId':_0xfea81a['id'],'OpenchannelInteractionId':_0xa2f6ff['id'],'UserId':_0x396a4e[_0x4782('0x59')]['id'],'ContactId':_0x492393['id']}))[_0x4782('0x20')](function(_0x17b69b){_0xa2f6ff['dataValues'][_0x4782('0xb8')]=[];_0xa2f6ff[_0x4782('0xb9')][_0x4782('0xb8')][_0x4782('0x95')](_0x17b69b[_0x4782('0xb9')]);return _0xa2f6ff;});});}})[_0x4782('0x20')](respondWithResult(_0x236511,null))[_0x4782('0x2b')](handleError(_0x236511,null));}; \ No newline at end of file +var _0xc06e=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','OpenchannelAccountId','removeAnswers','notify','Sequelize','no\x20available\x20attributes','difference','createdAt','ListId','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','DESC','Applications','account','applications','list','orderBy','asc','Contacts','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','updatedAt','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','http','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','get','sendStatus','stack','name','send','index','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','find','create'];(function(_0x2e33a9,_0x334236){var _0x9d7974=function(_0x3d8b20){while(--_0x3d8b20){_0x2e33a9['push'](_0x2e33a9['shift']());}};_0x9d7974(++_0x334236);}(_0xc06e,0x1dc));var _0xec06=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xc06e[_0x5d88c0];return _0x1b40f0;};'use strict';var pdf=require(_0xec06('0x0'));var emlformat=require(_0xec06('0x1'));var rimraf=require(_0xec06('0x2'));var zipdir=require(_0xec06('0x3'));var jsonpatch=require(_0xec06('0x4'));var rp=require(_0xec06('0x5'));var moment=require(_0xec06('0x6'));var BPromise=require(_0xec06('0x7'));var Mustache=require('mustache');var util=require(_0xec06('0x8'));var path=require(_0xec06('0x9'));var sox=require(_0xec06('0xa'));var csv=require(_0xec06('0xb'));var ejs=require(_0xec06('0xc'));var fs=require('fs');var _=require(_0xec06('0xd'));var squel=require(_0xec06('0xe'));var crypto=require(_0xec06('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xec06('0xb'));var querystring=require(_0xec06('0x10'));var Papa=require(_0xec06('0x11'));var Redis=require(_0xec06('0x12'));var authService=require(_0xec06('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xec06('0x14'));var logger=require(_0xec06('0x15'))(_0xec06('0x16'));var utils=require(_0xec06('0x17'));var config=require(_0xec06('0x18'));var db=require('../../mysqldb')['db'];config[_0xec06('0x19')]=_[_0xec06('0x1a')](config[_0xec06('0x19')],{'host':_0xec06('0x1b'),'port':0x18eb});var socket=require(_0xec06('0x1c'))(new Redis(config[_0xec06('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xec06('0x1d')]({'port':0x232c});var client9002=jayson[_0xec06('0x1e')][_0xec06('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1dc14e,_0x298e44,_0x4f3718){if(_0x4f3718){var _0x4a8cb9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a8cb9['test'](_0x298e44)){return _0x1dc14e;}else{throw new Error(_0xec06('0x1f'));}}else{return _0x1dc14e;}}function respondWithRpcPromise(_0x4af1dc,_0x394f62,_0x3bda9f,_0x99f2de){return new BPromise(function(_0x540ba7,_0x1da9fc){var _0xf117dc=_0x99f2de||client;return _0xf117dc[_0xec06('0x20')](_0x4af1dc,_0x3bda9f)[_0xec06('0x21')](function(_0x24a4f0){logger['info'](_0xec06('0x22'),_0x394f62,_0xec06('0x23'));logger[_0xec06('0x24')](_0xec06('0x25'),_0x394f62,_0xec06('0x23'),JSON[_0xec06('0x26')](_0x24a4f0));if(_0x24a4f0[_0xec06('0x27')]){if(_0x24a4f0[_0xec06('0x27')][_0xec06('0x28')]===0x1f4){logger[_0xec06('0x27')](_0xec06('0x22'),_0x394f62,_0x24a4f0['error']['message']);return _0x1da9fc(_0x24a4f0[_0xec06('0x27')]['message']);}logger[_0xec06('0x27')](_0xec06('0x22'),_0x394f62,_0x24a4f0['error'][_0xec06('0x29')]);return _0x540ba7(_0x24a4f0[_0xec06('0x27')][_0xec06('0x29')]);}else{logger[_0xec06('0x2a')](_0xec06('0x22'),_0x394f62,_0xec06('0x23'));_0x540ba7(_0x24a4f0['result'][_0xec06('0x29')]);}})[_0xec06('0x2b')](function(_0x44e42b){logger[_0xec06('0x27')](_0xec06('0x22'),_0x394f62,_0x44e42b);_0x1da9fc(_0x44e42b);});});}function respondWithStatusCode(_0x1239e9,_0x15a2c4){_0x15a2c4=_0x15a2c4||0xcc;return function(_0x453096){if(_0x453096){return _0x1239e9['sendStatus'](_0x15a2c4);}return _0x1239e9[_0xec06('0x2c')](_0x15a2c4)[_0xec06('0x2d')]();};}function respondWithResult(_0xd36214,_0x180ba7){_0x180ba7=_0x180ba7||0xc8;return function(_0x1ea27f){if(_0x1ea27f){return _0xd36214['status'](_0x180ba7)['json'](_0x1ea27f);}};}function respondWithFilteredResult(_0x507f2f,_0x1280c5){return function(_0x32fa4a){if(_0x32fa4a){var _0x1ffa10=_0x32fa4a[_0xec06('0x2e')],_0x90767=_0x1280c5[_0xec06('0x2f')],_0x34cb44=_0x1280c5[_0xec06('0x2f')]+_0x1280c5[_0xec06('0x30')],_0x27f05e;if(_0x34cb44>=_0x1ffa10){_0x34cb44=_0x1ffa10;_0x27f05e=0xc8;}else{_0x27f05e=0xce;}_0x507f2f[_0xec06('0x2c')](_0x27f05e);return _0x507f2f['set'](_0xec06('0x31'),_0x90767+'-'+_0x34cb44+'/'+_0x1ffa10)[_0xec06('0x32')](_0x32fa4a);}return null;};}function patchUpdates(_0x3ab205){return function(_0xbe771b){try{jsonpatch[_0xec06('0x33')](_0xbe771b,_0x3ab205,!![]);}catch(_0x408636){return BPromise[_0xec06('0x34')](_0x408636);}return _0xbe771b[_0xec06('0x35')]();};}function saveUpdates(_0x45ce31,_0x5ad40e){return function(_0x5d08dc){if(_0x5d08dc){return _0x5d08dc[_0xec06('0x36')](_0x45ce31)['then'](function(_0xa2220e){return _0xa2220e;});}return null;};}function removeEntity(_0x38ffa4,_0x22b15c){return function(_0x311f6a){if(_0x311f6a){return _0x311f6a[_0xec06('0x37')]()[_0xec06('0x21')](function(){var _0x43800a=_0x311f6a[_0xec06('0x38')]({'plain':!![]});var _0x27e939='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x27e939,'resourceId':_0x43800a['id']}})[_0xec06('0x21')](function(){return _0x311f6a;});})[_0xec06('0x21')](function(){_0x38ffa4['status'](0xcc)[_0xec06('0x2d')]();});}};}function handleEntityNotFound(_0x4f252a,_0x55b624){return function(_0x15a9dd){if(!_0x15a9dd){_0x4f252a[_0xec06('0x39')](0x194);}return _0x15a9dd;};}function handleError(_0x1d6885,_0x26805b){_0x26805b=_0x26805b||0x1f4;return function(_0x589a0b){logger['error'](_0x589a0b[_0xec06('0x3a')]);if(_0x589a0b['name']){delete _0x589a0b[_0xec06('0x3b')];}_0x1d6885[_0xec06('0x2c')](_0x26805b)[_0xec06('0x3c')](_0x589a0b);};}exports[_0xec06('0x3d')]=function(_0x299b4b,_0x104d4b){var _0x209a81={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x156b7a={},_0x2d0a50={'count':0x0,'rows':[]};var _0x287d71=db[_0xec06('0x3e')][_0xec06('0x3f')];_0x156b7a[_0xec06('0x40')]=_[_0xec06('0x41')](_0x287d71);_0x156b7a[_0xec06('0x42')]=_['keys'](_0x299b4b[_0xec06('0x42')]);_0x156b7a[_0xec06('0x43')]=_[_0xec06('0x44')](_0x156b7a[_0xec06('0x40')],_0x156b7a[_0xec06('0x42')]);_0x209a81[_0xec06('0x45')]=_[_0xec06('0x44')](_0x156b7a[_0xec06('0x40')],qs[_0xec06('0x46')](_0x299b4b[_0xec06('0x42')]['fields']));_0x209a81[_0xec06('0x45')]=_0x209a81[_0xec06('0x45')][_0xec06('0x47')]?_0x209a81['attributes']:_0x156b7a[_0xec06('0x40')];if(!_0x299b4b[_0xec06('0x42')][_0xec06('0x48')](_0xec06('0x49'))){_0x209a81[_0xec06('0x30')]=qs[_0xec06('0x30')](_0x299b4b[_0xec06('0x42')]['limit']);_0x209a81[_0xec06('0x2f')]=qs[_0xec06('0x2f')](_0x299b4b[_0xec06('0x42')][_0xec06('0x2f')]);}_0x209a81[_0xec06('0x4a')]=qs[_0xec06('0x4b')](_0x299b4b[_0xec06('0x42')][_0xec06('0x4b')]);_0x209a81['where']=qs['filters'](_['pick'](_0x299b4b[_0xec06('0x42')],_0x156b7a[_0xec06('0x43')]));if(_0x299b4b[_0xec06('0x42')][_0xec06('0x4c')]){_0x209a81['where']=_[_0xec06('0x4d')](_0x209a81[_0xec06('0x4e')],{'$or':_[_0xec06('0x4f')](_0x287d71,function(_0x3a0970){if(_0x3a0970[_0xec06('0x50')]['key']!==_0xec06('0x51')){var _0x227f5f={};_0x227f5f[_0x3a0970[_0xec06('0x52')]]={'$like':'%'+_0x299b4b[_0xec06('0x42')]['filter']+'%'};return _0x227f5f;}})});}_0x209a81=_[_0xec06('0x4d')]({},_0x209a81,_0x299b4b[_0xec06('0x53')]);var _0x4c30ee={'where':_0x209a81[_0xec06('0x4e')]};return db[_0xec06('0x3e')][_0xec06('0x2e')](_0x4c30ee)[_0xec06('0x21')](function(_0x104a33){_0x2d0a50[_0xec06('0x2e')]=_0x104a33;if(_0x299b4b[_0xec06('0x42')][_0xec06('0x54')]){_0x209a81[_0xec06('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xec06('0x56')](_0x209a81);})['then'](function(_0x28e1fb){_0x2d0a50[_0xec06('0x57')]=_0x28e1fb;return _0x2d0a50;})[_0xec06('0x21')](respondWithFilteredResult(_0x104d4b,_0x209a81))[_0xec06('0x2b')](handleError(_0x104d4b,null));};exports[_0xec06('0x58')]=function(_0x583ed8,_0x1d4245){var _0x36e2d2={'raw':![],'where':{'id':_0x583ed8[_0xec06('0x59')]['id']},'include':[{'model':db[_0xec06('0x5a')],'as':_0xec06('0x5b')}]},_0x3c70ae={};_0x3c70ae[_0xec06('0x40')]=_[_0xec06('0x41')](db[_0xec06('0x3e')][_0xec06('0x3f')]);_0x3c70ae[_0xec06('0x42')]=_[_0xec06('0x41')](_0x583ed8[_0xec06('0x42')]);_0x3c70ae[_0xec06('0x43')]=_[_0xec06('0x44')](_0x3c70ae[_0xec06('0x40')],_0x3c70ae[_0xec06('0x42')]);_0x36e2d2['attributes']=_[_0xec06('0x44')](_0x3c70ae['model'],qs[_0xec06('0x46')](_0x583ed8['query'][_0xec06('0x46')]));_0x36e2d2[_0xec06('0x45')]=_0x36e2d2[_0xec06('0x45')][_0xec06('0x47')]?_0x36e2d2[_0xec06('0x45')]:_0x3c70ae[_0xec06('0x40')];if(_0x583ed8[_0xec06('0x42')][_0xec06('0x54')]){_0x36e2d2[_0xec06('0x55')]=[{'all':!![]}];}_0x36e2d2=_[_0xec06('0x4d')]({},_0x36e2d2,_0x583ed8[_0xec06('0x53')]);return db[_0xec06('0x3e')][_0xec06('0x5c')](_0x36e2d2)[_0xec06('0x21')](handleEntityNotFound(_0x1d4245,null))[_0xec06('0x21')](respondWithResult(_0x1d4245,null))[_0xec06('0x2b')](handleError(_0x1d4245,null));};exports[_0xec06('0x5d')]=function(_0x32a064,_0x1ea6aa){return db['OpenchannelAccount'][_0xec06('0x5d')](_0x32a064['body'],{})['then'](function(_0x124d32){var _0x105a57=_0x32a064[_0xec06('0x5e')]['get']({'plain':!![]});if(!_0x105a57)throw new Error(_0xec06('0x5f'));if(_0x105a57['role']==='user'){var _0x315f9b=_0x124d32[_0xec06('0x38')]({'plain':!![]});var _0x3b2ab6='OpenchannelAccounts';return db[_0xec06('0x60')][_0xec06('0x5c')]({'where':{'name':_0x3b2ab6,'userProfileId':_0x105a57[_0xec06('0x61')]},'raw':!![]})['then'](function(_0x4bcdcc){if(_0x4bcdcc&&_0x4bcdcc[_0xec06('0x62')]===0x0){return db[_0xec06('0x63')][_0xec06('0x5d')]({'name':_0x315f9b['name'],'resourceId':_0x315f9b['id'],'type':_0x4bcdcc[_0xec06('0x3b')],'sectionId':_0x4bcdcc['id']},{})[_0xec06('0x21')](function(){return _0x124d32;});}else{return _0x124d32;}})['catch'](function(_0x236e36){logger[_0xec06('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x236e36);throw _0x236e36;});}return _0x124d32;})[_0xec06('0x21')](respondWithResult(_0x1ea6aa,0xc9))['catch'](handleError(_0x1ea6aa,null));};exports[_0xec06('0x36')]=function(_0x3dc968,_0x3f9f22){if(_0x3dc968[_0xec06('0x64')]['id']){delete _0x3dc968[_0xec06('0x64')]['id'];}return db[_0xec06('0x3e')][_0xec06('0x5c')]({'where':{'id':_0x3dc968[_0xec06('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xec06('0x5b')}]})[_0xec06('0x21')](handleEntityNotFound(_0x3f9f22,null))[_0xec06('0x21')](saveUpdates(_0x3dc968[_0xec06('0x64')],null))[_0xec06('0x21')](respondWithResult(_0x3f9f22,null))[_0xec06('0x2b')](handleError(_0x3f9f22,null));};exports['destroy']=function(_0x265b2a,_0x33df6e){return db['OpenchannelAccount'][_0xec06('0x5c')]({'where':{'id':_0x265b2a['params']['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x33df6e,null))['then'](removeEntity(_0x33df6e,null))['catch'](handleError(_0x33df6e,null));};exports[_0xec06('0x65')]=function(_0x387733,_0x12d87e){return db[_0xec06('0x3e')][_0xec06('0x65')]()[_0xec06('0x21')](respondWithResult(_0x12d87e,null))[_0xec06('0x2b')](handleError(_0x12d87e,null));};exports[_0xec06('0x66')]=function(_0x9e42e,_0x1e5d8b,_0x25e403){if(_0x9e42e['body']['id']){delete _0x9e42e[_0xec06('0x64')]['id'];}return db[_0xec06('0x3e')][_0xec06('0x5c')]({'where':{'id':_0x9e42e[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x1e5d8b,null))[_0xec06('0x21')](function(_0x3513bd){if(_0x3513bd){_0x9e42e['body'][_0xec06('0x67')]=_0x3513bd['id'];return db[_0xec06('0x68')]['create'](_0x9e42e[_0xec06('0x64')]);}})[_0xec06('0x21')](respondWithResult(_0x1e5d8b,null))[_0xec06('0x2b')](handleError(_0x1e5d8b,null));};exports[_0xec06('0x69')]=function(_0x4c60ed,_0x145f7b,_0x18ba82){var _0x3d8823={'raw':![],'where':{}};var _0x493f86={};var _0x18dabd={'count':0x0,'rows':[]};return db[_0xec06('0x3e')][_0xec06('0x6a')]({'where':{'id':_0x4c60ed[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x145f7b,null))[_0xec06('0x21')](function(_0x7d6cf2){if(_0x7d6cf2){_0x493f86[_0xec06('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x493f86[_0xec06('0x42')]=_[_0xec06('0x41')](_0x4c60ed[_0xec06('0x42')]);_0x493f86[_0xec06('0x43')]=_[_0xec06('0x44')](_0x493f86[_0xec06('0x40')],_0x493f86[_0xec06('0x42')]);_0x3d8823[_0xec06('0x45')]=_[_0xec06('0x44')](_0x493f86[_0xec06('0x40')],qs[_0xec06('0x46')](_0x4c60ed[_0xec06('0x42')][_0xec06('0x46')]));_0x3d8823[_0xec06('0x45')]=_0x3d8823['attributes']['length']?_0x3d8823[_0xec06('0x45')]:_0x493f86[_0xec06('0x40')];if(!_0x4c60ed['query']['hasOwnProperty']('nolimit')){_0x3d8823[_0xec06('0x30')]=qs[_0xec06('0x30')](_0x4c60ed[_0xec06('0x42')][_0xec06('0x30')]);_0x3d8823['offset']=qs[_0xec06('0x2f')](_0x4c60ed[_0xec06('0x42')]['offset']);}_0x3d8823['order']=qs[_0xec06('0x4b')](_0x4c60ed[_0xec06('0x42')][_0xec06('0x4b')]);_0x3d8823[_0xec06('0x4e')]=qs[_0xec06('0x43')](_[_0xec06('0x6b')](_0x4c60ed[_0xec06('0x42')],_0x493f86[_0xec06('0x43')]));_0x3d8823[_0xec06('0x4e')]['OpenchannelAccountId']=_0x7d6cf2['id'];if(_0x4c60ed[_0xec06('0x42')][_0xec06('0x4c')]){_0x3d8823[_0xec06('0x4e')]=_[_0xec06('0x4d')](_0x3d8823['where'],{'$or':_[_0xec06('0x4f')](_0x3d8823[_0xec06('0x45')],function(_0x7e3d36){var _0x1bf60e={};_0x1bf60e[_0x7e3d36]={'$like':'%'+_0x4c60ed[_0xec06('0x42')][_0xec06('0x4c')]+'%'};return _0x1bf60e;})});}_0x3d8823=_[_0xec06('0x4d')]({},_0x3d8823,_0x4c60ed[_0xec06('0x53')]);return db[_0xec06('0x68')]['count']({'where':_0x3d8823['where']})[_0xec06('0x21')](function(_0x17c66c){_0x18dabd[_0xec06('0x2e')]=_0x17c66c;if(_0x4c60ed['query']['includeAll']){_0x3d8823[_0xec06('0x55')]=[{'all':!![]}];}return db[_0xec06('0x68')][_0xec06('0x56')](_0x3d8823);})[_0xec06('0x21')](function(_0x41bf42){_0x18dabd[_0xec06('0x57')]=_0x41bf42;return _0x18dabd;});}})[_0xec06('0x21')](respondWithFilteredResult(_0x145f7b,_0x3d8823))[_0xec06('0x2b')](handleError(_0x145f7b,null));};exports[_0xec06('0x6c')]=function(_0x3dc656,_0xef0bfd,_0x2a57ec){return db['OpenchannelAccount']['find']({'where':{'id':_0x3dc656[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0xef0bfd,null))[_0xec06('0x21')](function(_0x1f1b43){if(_0x1f1b43){return _0x1f1b43['removeDispositions'](_0x3dc656['query'][_0xec06('0x6d')]);}})[_0xec06('0x21')](respondWithStatusCode(_0xef0bfd,null))[_0xec06('0x2b')](handleError(_0xef0bfd,null));};exports[_0xec06('0x6e')]=function(_0x3c0ee9,_0x3dbbd3,_0x10ec57){if(_0x3c0ee9[_0xec06('0x64')]['id']){delete _0x3c0ee9[_0xec06('0x64')]['id'];}return db[_0xec06('0x3e')][_0xec06('0x5c')]({'where':{'id':_0x3c0ee9[_0xec06('0x59')]['id']}})['then'](handleEntityNotFound(_0x3dbbd3,null))[_0xec06('0x21')](function(_0x2428ca){if(_0x2428ca){_0x3c0ee9['body']['OpenchannelAccountId']=_0x2428ca['id'];return db[_0xec06('0x6f')][_0xec06('0x5d')](_0x3c0ee9[_0xec06('0x64')]);}})[_0xec06('0x21')](respondWithResult(_0x3dbbd3,null))[_0xec06('0x2b')](handleError(_0x3dbbd3,null));};exports[_0xec06('0x70')]=function(_0x35eee2,_0x137afe,_0x301221){var _0x3a02eb={'raw':![],'where':{}};var _0x2ebca3={};var _0x5b7fbc={'count':0x0,'rows':[]};return db[_0xec06('0x3e')]['findOne']({'where':{'id':_0x35eee2[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x137afe,null))[_0xec06('0x21')](function(_0x461e6a){if(_0x461e6a){_0x2ebca3['model']=_['keys'](db['CannedAnswer'][_0xec06('0x3f')]);_0x2ebca3[_0xec06('0x42')]=_[_0xec06('0x41')](_0x35eee2[_0xec06('0x42')]);_0x2ebca3['filters']=_[_0xec06('0x44')](_0x2ebca3[_0xec06('0x40')],_0x2ebca3[_0xec06('0x42')]);_0x3a02eb[_0xec06('0x45')]=_['intersection'](_0x2ebca3[_0xec06('0x40')],qs[_0xec06('0x46')](_0x35eee2[_0xec06('0x42')][_0xec06('0x46')]));_0x3a02eb[_0xec06('0x45')]=_0x3a02eb[_0xec06('0x45')]['length']?_0x3a02eb[_0xec06('0x45')]:_0x2ebca3[_0xec06('0x40')];if(!_0x35eee2['query']['hasOwnProperty'](_0xec06('0x49'))){_0x3a02eb[_0xec06('0x30')]=qs[_0xec06('0x30')](_0x35eee2[_0xec06('0x42')]['limit']);_0x3a02eb[_0xec06('0x2f')]=qs[_0xec06('0x2f')](_0x35eee2[_0xec06('0x42')][_0xec06('0x2f')]);}_0x3a02eb[_0xec06('0x4a')]=qs[_0xec06('0x4b')](_0x35eee2['query'][_0xec06('0x4b')]);_0x3a02eb[_0xec06('0x4e')]=qs['filters'](_[_0xec06('0x6b')](_0x35eee2[_0xec06('0x42')],_0x2ebca3[_0xec06('0x43')]));_0x3a02eb[_0xec06('0x4e')][_0xec06('0x71')]=_0x461e6a['id'];if(_0x35eee2[_0xec06('0x42')][_0xec06('0x4c')]){_0x3a02eb['where']=_['merge'](_0x3a02eb[_0xec06('0x4e')],{'$or':_[_0xec06('0x4f')](_0x3a02eb[_0xec06('0x45')],function(_0x25de7b){var _0x59bd77={};_0x59bd77[_0x25de7b]={'$like':'%'+_0x35eee2[_0xec06('0x42')]['filter']+'%'};return _0x59bd77;})});}_0x3a02eb=_['merge']({},_0x3a02eb,_0x35eee2[_0xec06('0x53')]);return db['CannedAnswer']['count']({'where':_0x3a02eb[_0xec06('0x4e')]})[_0xec06('0x21')](function(_0x25ec38){_0x5b7fbc['count']=_0x25ec38;if(_0x35eee2[_0xec06('0x42')]['includeAll']){_0x3a02eb[_0xec06('0x55')]=[{'all':!![]}];}return db[_0xec06('0x6f')][_0xec06('0x56')](_0x3a02eb);})[_0xec06('0x21')](function(_0x256614){_0x5b7fbc[_0xec06('0x57')]=_0x256614;return _0x5b7fbc;});}})['then'](respondWithFilteredResult(_0x137afe,_0x3a02eb))['catch'](handleError(_0x137afe,null));};exports['removeAnswers']=function(_0x526409,_0x2daf82,_0x4beda8){return db[_0xec06('0x3e')]['find']({'where':{'id':_0x526409[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x2daf82,null))['then'](function(_0x1711b2){if(_0x1711b2){return _0x1711b2[_0xec06('0x72')](_0x526409['query'][_0xec06('0x6d')]);}})[_0xec06('0x21')](respondWithStatusCode(_0x2daf82,null))[_0xec06('0x2b')](handleError(_0x2daf82,null));};exports[_0xec06('0x73')]=function(_0x5d15ea,_0x215331,_0x127f63){var _0x37063d={'body':_0x5d15ea['body'],'channel':'openchannel'};var _0x219497=[];var _0x55e450=[];var _0x4d585a={};var _0x3135d6=![];return db['CmContact'][_0xec06('0x65')]()[_0xec06('0x21')](function(_0x2f69cc){if(!_0x2f69cc){throw new db[(_0xec06('0x74'))]['ValidationError'](_0xec06('0x75'));}_0x219497=_[_0xec06('0x76')](_[_0xec06('0x41')](_0x2f69cc),[_0xec06('0x77'),'updatedAt']);_0x55e450=_[_0xec06('0x76')](_[_0xec06('0x41')](_0x2f69cc),[_0xec06('0x77'),'updatedAt','CompanyId',_0xec06('0x78')]);if(_0x5d15ea['body']['id']){delete _0x5d15ea[_0xec06('0x64')]['id'];}if(_[_0xec06('0x79')](_0x5d15ea[_0xec06('0x64')]['from'])){throw new db['Sequelize'][(_0xec06('0x7a'))](_0xec06('0x7b'));}if(_[_0xec06('0x79')](_0x5d15ea['body'][_0xec06('0x64')])||_0x5d15ea[_0xec06('0x64')][_0xec06('0x64')]===''){throw new db['Sequelize'][(_0xec06('0x7a'))](_0xec06('0x7c'));}if(_['isNil'](_0x5d15ea['body']['mapKey'])){throw new db[(_0xec06('0x74'))]['ValidationError'](_0xec06('0x7d')+_0x55e450);}if(!_['includes'](_0x55e450,_0x5d15ea[_0xec06('0x64')][_0xec06('0x7e')])){throw new db[(_0xec06('0x74'))][(_0xec06('0x7a'))](_0xec06('0x7f')+_0x55e450);}_0x4d585a[_0x5d15ea[_0xec06('0x64')][_0xec06('0x7e')]]=_0x5d15ea['body'][_0xec06('0x80')];})[_0xec06('0x21')](function(){return db['OpenchannelAccount'][_0xec06('0x5c')]({'where':{'id':_0x5d15ea[_0xec06('0x59')]['id']},'include':[{'model':db[_0xec06('0x81')],'as':_0xec06('0x82'),'include':[{'model':db[_0xec06('0x83')],'as':'Contacts','where':_0x4d585a,'limit':0x1,'order':[['updatedAt',_0xec06('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':_0xec06('0x85')}]});})[_0xec06('0x21')](handleEntityNotFound(_0x215331,null))[_0xec06('0x21')](function(_0x5bc0c4){if(_0x5bc0c4&&_0x5bc0c4[_0xec06('0x82')]){_0x37063d[_0xec06('0x86')]=_0x5bc0c4;_0x37063d[_0xec06('0x87')]=_0x5bc0c4[_0xec06('0x85')];_0x37063d[_0xec06('0x88')]=_0x5bc0c4[_0xec06('0x82')];_0x37063d[_0xec06('0x87')]=_[_0xec06('0x89')](_0x37063d[_0xec06('0x87')],['priority'],[_0xec06('0x8a')]);if(_0x37063d['account'][_0xec06('0x85')]){delete _0x37063d[_0xec06('0x86')]['Applications'];}if(_0x37063d[_0xec06('0x86')][_0xec06('0x82')]&&_0x37063d[_0xec06('0x86')][_0xec06('0x82')][_0xec06('0x8b')][_0xec06('0x47')]){return _0x37063d[_0xec06('0x86')][_0xec06('0x82')][_0xec06('0x8b')][0x0];}var _0x47fefc=_['defaults'](_0x5d15ea[_0xec06('0x64')],{'firstName':_0x5d15ea[_0xec06('0x64')]['from'],'ListId':_0x5bc0c4[_0xec06('0x78')]});_0x47fefc[_0x5d15ea['body'][_0xec06('0x7e')]]=_0x5d15ea[_0xec06('0x64')][_0xec06('0x80')];return db[_0xec06('0x83')][_0xec06('0x5d')](_0x47fefc,{'fields':_0x219497,'raw':!![]});}})[_0xec06('0x21')](handleEntityNotFound(_0x215331,null))[_0xec06('0x21')](function(_0x3370d9){_0x37063d[_0xec06('0x8c')]=_0x3370d9;if(_0x3370d9){var _0x14b6c1={'ContactId':_0x3370d9['id'],'OpenchannelAccountId':_0x5d15ea['params']['id'],'from':(_0x3370d9[_0xec06('0x8d')]||'')+'\x20'+(_0x3370d9[_0xec06('0x8e')]||'')};var _0x57032d={'OpenchannelAccountId':_0x5d15ea[_0xec06('0x59')]['id'],'closed':![]};if(_0x5d15ea['body'][_0xec06('0x8f')]){_0x57032d[_0xec06('0x8f')]=_0x5d15ea[_0xec06('0x64')][_0xec06('0x8f')];return db[_0xec06('0x90')]['find']({'where':_0x57032d})[_0xec06('0x21')](function(_0x4067db){if(_0x4067db){return[_0x4067db,![]];}_0x14b6c1[_0xec06('0x8f')]=_0x5d15ea[_0xec06('0x64')]['threadId'];_0x14b6c1[_0xec06('0x91')]=_0x5d15ea[_0xec06('0x64')]['externalUrl'];return db[_0xec06('0x90')][_0xec06('0x5d')](_0x14b6c1)['then'](function(_0xa8d414){return[_0xa8d414,!![]];});});}else{_0x57032d['threadId']=null;}_0x57032d[_0xec06('0x92')]=_0x3370d9['id'];return db[_0xec06('0x90')][_0xec06('0x5c')]({'where':_0x57032d})['then'](function(_0xbc43a){if(_0xbc43a){return[_0xbc43a,![]];}return db[_0xec06('0x90')][_0xec06('0x5d')](_0x14b6c1)[_0xec06('0x21')](function(_0x2f185f){return[_0x2f185f,!![]];});});}})['spread'](function(_0x40fb70,_0x594e30){if(_0x40fb70){_0x3135d6=_0x594e30;if(!_0x594e30){var _0x1a0e6b={'from':(_0x37063d[_0xec06('0x8c')][_0xec06('0x8d')]||'')+'\x20'+(_0x37063d[_0xec06('0x8c')][_0xec06('0x8e')]||'')};if(_0x5d15ea[_0xec06('0x64')]['threadId']&&_0x5d15ea[_0xec06('0x64')][_0xec06('0x93')]&&_0x5d15ea[_0xec06('0x64')][_0xec06('0x8f')]!=_0x5d15ea[_0xec06('0x64')][_0xec06('0x93')]){_0x1a0e6b[_0xec06('0x8f')]=_0x5d15ea[_0xec06('0x64')][_0xec06('0x93')];}return _0x40fb70[_0xec06('0x36')](_0x1a0e6b);}else{return _0x40fb70;}}})[_0xec06('0x21')](function(_0x4b6781){_0x37063d[_0xec06('0x94')]=_0x4b6781[_0xec06('0x38')]({'plain':!![]});_0x37063d['interaction'][_0xec06('0x95')]=_0x3135d6;if(_0x37063d[_0xec06('0x94')][_0xec06('0x95')]){if(_0x37063d['account'][_0xec06('0x96')]){_0x37063d['applications'][_0xec06('0x97')]({'id':0x0,'priority':_0x37063d[_0xec06('0x87')]['length']+0x1,'app':_0xec06('0x98'),'appdata':_0xec06('0x99'),'interval':'*,*,*,*'});}}return db[_0xec06('0x9a')][_0xec06('0x5d')]({'body':_0x5d15ea[_0xec06('0x64')][_0xec06('0x64')],'OpenchannelAccountId':_0x5d15ea[_0xec06('0x59')]['id'],'OpenchannelInteractionId':_0x4b6781['id'],'direction':'in','ContactId':_0x37063d[_0xec06('0x8c')]['id'],'AttachmentId':_0x5d15ea[_0xec06('0x64')][_0xec06('0x9b')]});})[_0xec06('0x21')](function(_0x7bfa99){_0x37063d['message']=_0x7bfa99;if(_0x37063d[_0xec06('0x94')]['UserId']){return db[_0xec06('0x9c')][_0xec06('0x5c')]({'attributes':['id',_0xec06('0x3b')],'where':{'id':_0x37063d[_0xec06('0x94')][_0xec06('0x9d')]}})[_0xec06('0x21')](function(_0x174090){if(_0x174090){_0x37063d[_0xec06('0x87')][_0xec06('0x9e')]({'id':0x0,'priority':0x0,'app':_0xec06('0x9f'),'appdata':_0x174090[_0xec06('0x3b')]+','+(_0x37063d[_0xec06('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0xec06('0xa0')});_0x37063d[_0xec06('0xa1')]=![];}return respondWithRpcPromise(_0xec06('0xa2'),_0xec06('0xa3'),_0x37063d);});}return respondWithRpcPromise('Start',_0xec06('0xa3'),_0x37063d);})[_0xec06('0x21')](function(_0x37e6d1){respondWithRpcPromise(_0xec06('0xa4'),_0xec06('0xa4'),{'event':_0xec06('0x73'),'message':_0x37e6d1},client9002);return _0x37e6d1;})[_0xec06('0x21')](respondWithResult(_0x215331,null))[_0xec06('0x2b')](handleError(_0x215331,null));};exports[_0xec06('0xa5')]=function(_0x1c3800,_0x27cd8a,_0x29b43e){return db['OpenchannelAccount'][_0xec06('0x6a')]({'where':{'id':_0x1c3800[_0xec06('0x59')]['id']}})['then'](handleEntityNotFound(_0x27cd8a,null))[_0xec06('0x21')](function(_0xb5551b){if(_0xb5551b){return db[_0xec06('0xa6')]['transaction'](function(_0x22c284){return db[_0xec06('0xa7')][_0xec06('0x37')]({'where':{'OpenchannelAccountId':_0x1c3800[_0xec06('0x59')]['id']},'transaction':_0x22c284})['then'](function(_0x289764){var _0x1f0e09=_[_0xec06('0x4f')](_0x1c3800[_0xec06('0x64')],function(_0x3acd49){_0x3acd49[_0xec06('0x71')]=_0x1c3800[_0xec06('0x59')]['id'];return _0x3acd49;});return db[_0xec06('0xa7')][_0xec06('0xa8')](_0x1f0e09,{'transaction':_0x22c284});});})[_0xec06('0x21')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1c3800['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x27cd8a,null))[_0xec06('0x2b')](handleError(_0x27cd8a,null));};exports[_0xec06('0xa9')]=function(_0x100990,_0x549351,_0x582228){var _0x35e1fe={};var _0x2d9b83={};var _0x103fd8;var _0x28e85a;return db[_0xec06('0x3e')][_0xec06('0x6a')]({'where':{'id':_0x100990[_0xec06('0x59')]['id']}})['then'](handleEntityNotFound(_0x549351,null))[_0xec06('0x21')](function(_0x25f72e){if(_0x25f72e){_0x103fd8=_0x25f72e;_0x2d9b83[_0xec06('0x40')]=_[_0xec06('0x41')](db['OpenchannelApplication']['rawAttributes']);_0x2d9b83[_0xec06('0x42')]=_[_0xec06('0x41')](_0x100990[_0xec06('0x42')]);_0x2d9b83[_0xec06('0x43')]=_[_0xec06('0x44')](_0x2d9b83[_0xec06('0x40')],_0x2d9b83[_0xec06('0x42')]);_0x35e1fe[_0xec06('0x45')]=_[_0xec06('0x44')](_0x2d9b83[_0xec06('0x40')],qs[_0xec06('0x46')](_0x100990[_0xec06('0x42')][_0xec06('0x46')]));_0x35e1fe[_0xec06('0x45')]=_0x35e1fe[_0xec06('0x45')][_0xec06('0x47')]?_0x35e1fe[_0xec06('0x45')]:_0x2d9b83['model'];_0x35e1fe['order']=qs['sort'](_0x100990[_0xec06('0x42')]['sort']);_0x35e1fe[_0xec06('0x4e')]=qs[_0xec06('0x43')](_[_0xec06('0x6b')](_0x100990[_0xec06('0x42')],_0x2d9b83[_0xec06('0x43')]));if(_0x100990[_0xec06('0x42')][_0xec06('0x4c')]){_0x35e1fe['where']=_['merge'](_0x35e1fe[_0xec06('0x4e')],{'$or':_[_0xec06('0x4f')](_0x35e1fe['attributes'],function(_0x5e0cd1){var _0x30bd35={};_0x30bd35[_0x5e0cd1]={'$like':'%'+_0x100990[_0xec06('0x42')][_0xec06('0x4c')]+'%'};return _0x30bd35;})});}_0x35e1fe=_[_0xec06('0x4d')]({},_0x35e1fe,_0x100990[_0xec06('0x53')]);return _0x103fd8['getApplications'](_0x35e1fe);}})[_0xec06('0x21')](function(_0x513b12){if(_0x513b12){_0x28e85a=_0x513b12['length'];if(!_0x100990[_0xec06('0x42')][_0xec06('0x48')](_0xec06('0x49'))){_0x35e1fe[_0xec06('0x30')]=qs[_0xec06('0x30')](_0x100990[_0xec06('0x42')][_0xec06('0x30')]);_0x35e1fe[_0xec06('0x2f')]=qs[_0xec06('0x2f')](_0x100990[_0xec06('0x42')][_0xec06('0x2f')]);}return _0x103fd8[_0xec06('0xa9')](_0x35e1fe);}})[_0xec06('0x21')](function(_0x1d5dbd){if(_0x1d5dbd){return _0x1d5dbd?{'count':_0x28e85a,'rows':_0x1d5dbd}:null;}})['then'](respondWithResult(_0x549351,null))['catch'](handleError(_0x549351,null));};exports[_0xec06('0xaa')]=function(_0x206c85,_0x485531,_0x55e465){var _0x6146bc={'raw':![],'where':{}};var _0x1a247d={};var _0x19e519={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xec06('0x6a')]({'where':{'id':_0x206c85['params']['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x485531,null))[_0xec06('0x21')](function(_0x24f7c7){if(_0x24f7c7){_0x1a247d[_0xec06('0x40')]=_[_0xec06('0x41')](db['OpenchannelInteraction']['rawAttributes']);_0x1a247d[_0xec06('0x42')]=_[_0xec06('0x41')](_0x206c85[_0xec06('0x42')]);_0x1a247d[_0xec06('0x43')]=_['intersection'](_0x1a247d[_0xec06('0x40')],_0x1a247d[_0xec06('0x42')]);_0x6146bc['attributes']=_[_0xec06('0x44')](_0x1a247d[_0xec06('0x40')],qs['fields'](_0x206c85['query'][_0xec06('0x46')]));_0x6146bc['attributes']=_0x6146bc[_0xec06('0x45')]['length']?_0x6146bc[_0xec06('0x45')]:_0x1a247d[_0xec06('0x40')];if(!_0x206c85['query'][_0xec06('0x48')](_0xec06('0x49'))){_0x6146bc[_0xec06('0x30')]=qs['limit'](_0x206c85[_0xec06('0x42')][_0xec06('0x30')]);_0x6146bc[_0xec06('0x2f')]=qs['offset'](_0x206c85[_0xec06('0x42')][_0xec06('0x2f')]);}_0x6146bc['order']=qs['sort'](_0x206c85['query'][_0xec06('0x4b')]);_0x6146bc['where']=qs[_0xec06('0x43')](_[_0xec06('0x6b')](_0x206c85['query'],_0x1a247d[_0xec06('0x43')]));_0x6146bc[_0xec06('0x4e')][_0xec06('0x71')]=_0x24f7c7['id'];if(_0x206c85['query'][_0xec06('0x4c')]){_0x6146bc[_0xec06('0x4e')]=_[_0xec06('0x4d')](_0x6146bc[_0xec06('0x4e')],{'$or':_[_0xec06('0x4f')](_0x6146bc[_0xec06('0x45')],function(_0x4d4719){var _0x53ff2c={};_0x53ff2c[_0x4d4719]={'$like':'%'+_0x206c85[_0xec06('0x42')][_0xec06('0x4c')]+'%'};return _0x53ff2c;})});}_0x6146bc=_['merge']({},_0x6146bc,_0x206c85[_0xec06('0x53')]);return db[_0xec06('0x90')][_0xec06('0x2e')]({'where':_0x6146bc[_0xec06('0x4e')]})[_0xec06('0x21')](function(_0x4c3dbd){_0x19e519[_0xec06('0x2e')]=_0x4c3dbd;if(_0x206c85['query'][_0xec06('0x54')]){_0x6146bc[_0xec06('0x55')]=[{'model':db[_0xec06('0x83')],'as':_0xec06('0xab'),'required':![]},{'model':db[_0xec06('0x9c')],'as':_0xec06('0xac'),'attributes':[_0xec06('0x3b'),_0xec06('0xad'),_0xec06('0xae')],'required':![]},{'model':db[_0xec06('0xaf')],'as':_0xec06('0xb0'),'attributes':['id',_0xec06('0x3b'),'color'],'where':_0x206c85[_0xec06('0x42')][_0xec06('0xb1')]?{'id':_0x206c85[_0xec06('0x42')][_0xec06('0xb1')]}:undefined,'required':_0x206c85[_0xec06('0x42')]['tag']?!![]:![]}];}return db[_0xec06('0x90')]['findAll'](_0x6146bc);})['then'](function(_0x421c3d){_0x19e519[_0xec06('0x57')]=_0x421c3d;return _0x19e519;});}})[_0xec06('0x21')](respondWithFilteredResult(_0x485531,_0x6146bc))['catch'](handleError(_0x485531,null));};exports['addAgents']=function(_0x5e87b3,_0x8068fa,_0x1a27e1){return db[_0xec06('0x3e')][_0xec06('0x5c')]({'where':{'id':_0x5e87b3['params']['id']}})['then'](handleEntityNotFound(_0x8068fa,null))[_0xec06('0x21')](function(_0x39da07){if(_0x39da07){return _0x39da07['addAgents'](_0x5e87b3['body'][_0xec06('0x6d')],_[_0xec06('0xb2')](_0x5e87b3[_0xec06('0x64')],['ids','id'])||{})[_0xec06('0xb3')](function(_0x420319){for(var _0x2361c5=0x0;_0x2361c5<_0x5e87b3[_0xec06('0x64')]['ids'][_0xec06('0x47')];_0x2361c5+=0x1){socket[_0xec06('0xb4')](_0xec06('0xb5'),{'UserId':_0x5e87b3[_0xec06('0x64')][_0xec06('0x6d')][_0x2361c5],'OpenchannelAccountId':_0x5e87b3[_0xec06('0x59')]['id']});}return _0x420319;});}})[_0xec06('0x21')](respondWithResult(_0x8068fa,null))[_0xec06('0x2b')](handleError(_0x8068fa,null));};exports[_0xec06('0xb6')]=function(_0x59b7ae,_0x2af83a,_0x30f743){return db['OpenchannelAccount'][_0xec06('0x5c')]({'where':{'id':_0x59b7ae[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x2af83a,null))['then'](function(_0x228bbc){if(_0x228bbc){return _0x228bbc['removeAgents'](_0x59b7ae['query'][_0xec06('0x6d')])[_0xec06('0x21')](function(){if(_[_0xec06('0xb7')](_0x59b7ae[_0xec06('0x42')][_0xec06('0x6d')])){for(var _0x3970ad=0x0;_0x3970ad<_0x59b7ae[_0xec06('0x42')][_0xec06('0x6d')][_0xec06('0x47')];_0x3970ad+=0x1){socket['emit'](_0xec06('0xb8'),{'UserId':Number(_0x59b7ae[_0xec06('0x42')]['ids'][_0x3970ad]),'OpenchannelAccountId':Number(_0x59b7ae[_0xec06('0x59')]['id'])});}}else{socket[_0xec06('0xb4')](_0xec06('0xb8'),{'UserId':Number(_0x59b7ae[_0xec06('0x42')]['ids']),'OpenchannelAccountId':Number(_0x59b7ae['params']['id'])});}});}})[_0xec06('0x21')](respondWithStatusCode(_0x2af83a,null))[_0xec06('0x2b')](handleError(_0x2af83a,null));};exports[_0xec06('0xb9')]=function(_0x14b98b,_0x2d827a,_0x5e16fb){var _0x536aba={};var _0x12b59d={};var _0x26a1d8;var _0x4a0efe;return db[_0xec06('0x3e')][_0xec06('0x6a')]({'where':{'id':_0x14b98b['params']['id']}})[_0xec06('0x21')](handleEntityNotFound(_0x2d827a,null))[_0xec06('0x21')](function(_0x5809b6){if(_0x5809b6){_0x26a1d8=_0x5809b6;_0x12b59d['model']=_[_0xec06('0x41')](db[_0xec06('0x9c')][_0xec06('0x3f')]);_0x12b59d[_0xec06('0x42')]=_[_0xec06('0x41')](_0x14b98b[_0xec06('0x42')]);_0x12b59d['filters']=_[_0xec06('0x44')](_0x12b59d['model'],_0x12b59d[_0xec06('0x42')]);_0x536aba[_0xec06('0x45')]=_[_0xec06('0x44')](_0x12b59d[_0xec06('0x40')],qs[_0xec06('0x46')](_0x14b98b[_0xec06('0x42')][_0xec06('0x46')]));_0x536aba[_0xec06('0x45')]=_0x536aba['attributes'][_0xec06('0x47')]?_0x536aba[_0xec06('0x45')]:_0x12b59d[_0xec06('0x40')];_0x536aba[_0xec06('0x4a')]=qs['sort'](_0x14b98b[_0xec06('0x42')][_0xec06('0x4b')]);_0x536aba['where']=qs[_0xec06('0x43')](_[_0xec06('0x6b')](_0x14b98b[_0xec06('0x42')],_0x12b59d['filters']));if(_0x14b98b[_0xec06('0x42')]['filter']){_0x536aba[_0xec06('0x4e')]=_[_0xec06('0x4d')](_0x536aba[_0xec06('0x4e')],{'$or':_[_0xec06('0x4f')](_0x536aba[_0xec06('0x45')],function(_0x11fb04){var _0x168a11={};_0x168a11[_0x11fb04]={'$like':'%'+_0x14b98b['query'][_0xec06('0x4c')]+'%'};return _0x168a11;})});}_0x536aba=_[_0xec06('0x4d')]({},_0x536aba,_0x14b98b[_0xec06('0x53')]);return _0x26a1d8[_0xec06('0xb9')](_0x536aba);}})[_0xec06('0x21')](function(_0x2c5f8a){if(_0x2c5f8a){_0x4a0efe=_0x2c5f8a[_0xec06('0x47')];if(!_0x14b98b['query']['hasOwnProperty'](_0xec06('0x49'))){_0x536aba[_0xec06('0x30')]=qs[_0xec06('0x30')](_0x14b98b['query'][_0xec06('0x30')]);_0x536aba['offset']=qs[_0xec06('0x2f')](_0x14b98b[_0xec06('0x42')][_0xec06('0x2f')]);}return _0x26a1d8[_0xec06('0xb9')](_0x536aba);}})[_0xec06('0x21')](function(_0x1c760e){if(_0x1c760e){return _0x1c760e?{'count':_0x4a0efe,'rows':_0x1c760e}:null;}})[_0xec06('0x21')](respondWithResult(_0x2d827a,null))['catch'](handleError(_0x2d827a,null));};exports[_0xec06('0x3c')]=function(_0x551983,_0xd0ddd9,_0x3f49e2){var _0x1bc726,_0x2d1f39,_0x51beab;if(_[_0xec06('0x79')](_0x551983[_0xec06('0x64')]['body'])||_0x551983[_0xec06('0x64')]['body']===''){throw new db[(_0xec06('0x74'))]['ValidationError'](_0xec06('0x7c'));}if(_[_0xec06('0x79')](_0x551983[_0xec06('0x64')]['to'])){}_0x1bc726=_0x551983[_0xec06('0x64')]['to'];return db[_0xec06('0x3e')][_0xec06('0x6a')]({'where':{'id':_0x551983[_0xec06('0x59')]['id']}})[_0xec06('0x21')](handleEntityNotFound(_0xd0ddd9,null))['then'](function(_0x1e778e){if(_0x1e778e){return db['OpenchannelAccount']['find']({'where':{'id':_0x1e778e['id']},'include':[{'model':db[_0xec06('0x81')],'as':_0xec06('0x82'),'include':[{'model':db['CmContact'],'as':_0xec06('0x8b'),'where':{[_0x1e778e[_0xec06('0x7e')]]:_0x1bc726},'limit':0x1,'order':[[_0xec06('0xba'),'DESC']]}]}]})[_0xec06('0x21')](handleEntityNotFound(_0xd0ddd9,null))['then'](function(_0x2a454e){if(_0x2a454e&&_0x2a454e[_0xec06('0x82')]){_0x2d1f39=_0x2a454e[_0xec06('0x38')]({'plain':!![]});if(_0x2d1f39['List']&&_0x2d1f39['List'][_0xec06('0x8b')][_0xec06('0x47')]){return _0x2d1f39[_0xec06('0x82')][_0xec06('0x8b')][0x0];}return db[_0xec06('0x83')][_0xec06('0x5d')](_[_0xec06('0x1a')](_0x551983[_0xec06('0x64')],{'firstName':_0x1bc726,[_0x2a454e['mapKey']]:_0x1bc726,'phone':_0x1bc726,'ListId':_0x2d1f39[_0xec06('0x78')]}));}})[_0xec06('0x21')](handleEntityNotFound(_0xd0ddd9,null))[_0xec06('0x21')](function(_0x9cba08){if(_0x9cba08){_0x51beab=_0x9cba08;return db[_0xec06('0x90')][_0xec06('0x5c')]({'where':{'ContactId':_0x51beab['id'],'closed':![],'OpenchannelAccountId':_0x2d1f39['id']}})[_0xec06('0x21')](function(_0x3a273e){if(_0x3a273e){return[_0x3a273e,![]];}return db[_0xec06('0x90')][_0xec06('0x5d')]({'UserId':_0x551983['user']['id'],'ContactId':_0x51beab['id'],'OpenchannelAccountId':_0x2d1f39['id'],'lastMsgDirection':_0xec06('0xbb'),'Messages':[_[_0xec06('0x4d')](_0x551983['body'],{'read':![],'body':_0x551983[_0xec06('0x64')][_0xec06('0x64')],'OpenchannelAccountId':_0x2d1f39['id'],'UserId':_0x551983[_0xec06('0x5e')]['id'],'ContactId':_0x51beab['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xec06('0xbc')}]})[_0xec06('0x21')](function(_0x41f40b){return[_0x41f40b,!![]];});});}})[_0xec06('0xb3')](function(_0x142b8f,_0x5a8061){if(_0x5a8061){return _0x142b8f;}return db['OpenchannelMessage']['create'](_['merge'](_0x551983[_0xec06('0x64')],{'read':![],'body':_0x551983[_0xec06('0x64')][_0xec06('0x64')],'OpenchannelAccountId':_0x2d1f39['id'],'OpenchannelInteractionId':_0x142b8f['id'],'UserId':_0x551983[_0xec06('0x5e')]['id'],'ContactId':_0x51beab['id']}))['then'](function(_0x1e44b7){_0x142b8f['dataValues']['Messages']=[];_0x142b8f[_0xec06('0xbd')][_0xec06('0xbc')][_0xec06('0x97')](_0x1e44b7['dataValues']);return _0x142b8f;});});}})[_0xec06('0x21')](respondWithResult(_0xd0ddd9,null))[_0xec06('0x2b')](handleError(_0xd0ddd9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 98d1088..41c6d81 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 _0x78e7=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelAccount','save'];(function(_0x5b09d6,_0x2d9bfc){var _0x40c556=function(_0x1ffc22){while(--_0x1ffc22){_0x5b09d6['push'](_0x5b09d6['shift']());}};_0x40c556(++_0x2d9bfc);}(_0x78e7,0x17d));var _0x778e=function(_0x316611,_0x4bcacb){_0x316611=_0x316611-0x0;var _0x6e396c=_0x78e7[_0x316611];return _0x6e396c;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x778e('0x0'))['db'][_0x778e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x778e('0x2'),'afterUpdate':'update','afterDestroy':_0x778e('0x3')};function emitEvent(_0x4894ea){return function(_0x45d4ff,_0x1f89ac,_0x5338cd){OpenchannelAccountEvents[_0x778e('0x4')](_0x4894ea+':'+_0x45d4ff['id'],_0x45d4ff);OpenchannelAccountEvents[_0x778e('0x4')](_0x4894ea,_0x45d4ff);_0x5338cd(null);};}for(var e in events){if(events[_0x778e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x778e('0x6')](e,emitEvent(event));}}module[_0x778e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x8de5=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x25347a,_0x3dd85f){var _0x14f824=function(_0x4d70f3){while(--_0x4d70f3){_0x25347a['push'](_0x25347a['shift']());}};_0x14f824(++_0x3dd85f);}(_0x8de5,0xd7));var _0x58de=function(_0x57660a,_0x4d4e65){_0x57660a=_0x57660a-0x0;var _0x5dc42b=_0x8de5[_0x57660a];return _0x5dc42b;};'use strict';var EventEmitter=require(_0x58de('0x0'));var OpenchannelAccount=require(_0x58de('0x1'))['db'][_0x58de('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x58de('0x3')](0x0);var events={'afterCreate':_0x58de('0x4'),'afterUpdate':_0x58de('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfa97de){return function(_0x462ce0,_0xf1b9d9,_0x5cf370){OpenchannelAccountEvents[_0x58de('0x6')](_0xfa97de+':'+_0x462ce0['id'],_0x462ce0);OpenchannelAccountEvents[_0x58de('0x6')](_0xfa97de,_0x462ce0);_0x5cf370(null);};}for(var e in events){if(events[_0x58de('0x7')](e)){var event=events[e];OpenchannelAccount[_0x58de('0x8')](e,emitEvent(event));}}module[_0x58de('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index e8738c6..8219f23 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 _0xaa46=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x19cc92,_0x4df512){var _0x4c88d4=function(_0x40bf46){while(--_0x40bf46){_0x19cc92['push'](_0x19cc92['shift']());}};_0x4c88d4(++_0x4df512);}(_0xaa46,0x1da));var _0x6aa4=function(_0x21cf80,_0x1fb0a1){_0x21cf80=_0x21cf80-0x0;var _0x5c6bed=_0xaa46[_0x21cf80];return _0x5c6bed;};'use strict';var _=require(_0x6aa4('0x0'));var util=require(_0x6aa4('0x1'));var logger=require(_0x6aa4('0x2'))('api');var moment=require(_0x6aa4('0x3'));var BPromise=require(_0x6aa4('0x4'));var rp=require(_0x6aa4('0x5'));var fs=require('fs');var path=require(_0x6aa4('0x6'));var rimraf=require(_0x6aa4('0x7'));var config=require(_0x6aa4('0x8'));var attributes=require(_0x6aa4('0x9'));module[_0x6aa4('0xa')]=function(_0x30c992,_0x2b6614){return _0x30c992[_0x6aa4('0xb')](_0x6aa4('0xc'),attributes,{'tableName':_0x6aa4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66fa=['define','OpenchannelAccount','openchannel_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x66fa,0x117));var _0xa66f=function(_0x1facaf,_0x4a3b4a){_0x1facaf=_0x1facaf-0x0;var _0x32038a=_0x66fa[_0x1facaf];return _0x32038a;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'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 4ace1bc..5dd52f1 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x5db206,_0x2402c3){var _0x241b33=function(_0x43f2cd){while(--_0x43f2cd){_0x5db206['push'](_0x5db206['shift']());}};_0x241b33(++_0x2402c3);}(_0x814b,0x1a2));var _0xb814=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x814b[_0x161ac3];return _0x3bb837;};'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});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});} \ No newline at end of file +var _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0xc8899c,_0x49df6e){_0xc8899c=_0xc8899c-0x0;var _0x4154f3=_0x7a54[_0xc8899c];return _0x4154f3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 2da5ea1..53006e0 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 _0x71ac=['length','openchannelAccount:','./openchannelAccount.events','removeListener','register'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x71ac,0x151));var _0xc71a=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x71ac[_0x11a220];return _0x20d8fe;};'use strict';var OpenchannelAccountEvents=require(_0xc71a('0x0'));var events=['save','remove','update'];function createListener(_0x5309a9,_0x5612d7){return function(_0x351ce7){_0x5612d7['emit'](_0x5309a9,_0x351ce7);};}function removeListener(_0x5e29a8,_0x33e2cc){return function(){OpenchannelAccountEvents[_0xc71a('0x1')](_0x5e29a8,_0x33e2cc);};}exports[_0xc71a('0x2')]=function(_0x3d9d36){for(var _0x12f2cf=0x0,_0xa58ddc=events[_0xc71a('0x3')];_0x12f2cf<_0xa58ddc;_0x12f2cf++){var _0x455f53=events[_0x12f2cf];var _0x469336=createListener(_0xc71a('0x4')+_0x455f53,_0x3d9d36);OpenchannelAccountEvents['on'](_0x455f53,_0x469336);}}; \ No newline at end of file +var _0x8915=['emit','removeListener','length','openchannelAccount:'];(function(_0x1ff1cb,_0x34292a){var _0x22e848=function(_0x50574e){while(--_0x50574e){_0x1ff1cb['push'](_0x1ff1cb['shift']());}};_0x22e848(++_0x34292a);}(_0x8915,0x9c));var _0x5891=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8915[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save','remove','update'];function createListener(_0x32e376,_0x2c1bca){return function(_0x38a9d0){_0x2c1bca[_0x5891('0x0')](_0x32e376,_0x38a9d0);};}function removeListener(_0x4215b7,_0x3d0b3a){return function(){OpenchannelAccountEvents[_0x5891('0x1')](_0x4215b7,_0x3d0b3a);};}exports['register']=function(_0x5d7355){for(var _0x278985=0x0,_0x1cd198=events[_0x5891('0x2')];_0x278985<_0x1cd198;_0x278985++){var _0x42638a=events[_0x278985];var _0x2549e1=createListener(_0x5891('0x3')+_0x42638a,_0x5d7355);OpenchannelAccountEvents['on'](_0x42638a,_0x2549e1);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 79bc454..4211f25 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 _0xe67d=['destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','show','post','put','/:id','update','delete'];(function(_0x4cc20c,_0x356acd){var _0x2700cb=function(_0x22ff6b){while(--_0x22ff6b){_0x4cc20c['push'](_0x4cc20c['shift']());}};_0x2700cb(++_0x356acd);}(_0xe67d,0x179));var _0xde67=function(_0x7d6eca,_0x59d54a){_0x7d6eca=_0x7d6eca-0x0;var _0x128263=_0xe67d[_0x7d6eca];return _0x128263;};'use strict';var multer=require('multer');var util=require(_0xde67('0x0'));var path=require('path');var timeout=require(_0xde67('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xde67('0x2'));var interaction=require(_0xde67('0x3'));var config=require('../../config/environment');var controller=require(_0xde67('0x4'));router[_0xde67('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xde67('0x5')]('/:id',auth[_0xde67('0x6')](),controller[_0xde67('0x7')]);router[_0xde67('0x8')]('/',auth[_0xde67('0x6')](),controller['create']);router[_0xde67('0x9')](_0xde67('0xa'),auth['isAuthenticated'](),controller[_0xde67('0xb')]);router[_0xde67('0xc')](_0xde67('0xa'),auth[_0xde67('0x6')](),controller[_0xde67('0xd')]);module[_0xde67('0xe')]=router; \ No newline at end of file +var _0xc338=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x234606,_0x38306d){var _0x565687=function(_0x287bd2){while(--_0x287bd2){_0x234606['push'](_0x234606['shift']());}};_0x565687(++_0x38306d);}(_0xc338,0x116));var _0x8c33=function(_0x5dcd36,_0x3df88e){_0x5dcd36=_0x5dcd36-0x0;var _0x42e451=_0xc338[_0x5dcd36];return _0x42e451;};'use strict';var multer=require(_0x8c33('0x0'));var util=require(_0x8c33('0x1'));var path=require(_0x8c33('0x2'));var timeout=require(_0x8c33('0x3'));var express=require(_0x8c33('0x4'));var router=express[_0x8c33('0x5')]();var auth=require(_0x8c33('0x6'));var interaction=require(_0x8c33('0x7'));var config=require(_0x8c33('0x8'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8c33('0x9')]);router['get'](_0x8c33('0xa'),auth[_0x8c33('0xb')](),controller[_0x8c33('0xc')]);router[_0x8c33('0xd')]('/',auth[_0x8c33('0xb')](),controller[_0x8c33('0xe')]);router[_0x8c33('0xf')]('/:id',auth[_0x8c33('0xb')](),controller[_0x8c33('0x10')]);router[_0x8c33('0x11')](_0x8c33('0xa'),auth[_0x8c33('0xb')](),controller[_0x8c33('0x12')]);module[_0x8c33('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e22ec0d..ecae81b 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 _0x6f75=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x5a11ac,_0x170eae){var _0x53c416=function(_0x49cc95){while(--_0x49cc95){_0x5a11ac['push'](_0x5a11ac['shift']());}};_0x53c416(++_0x170eae);}(_0x6f75,0x71));var _0x56f7=function(_0x86e678,_0x11bdd8){_0x86e678=_0x86e678-0x0;var _0xc34f63=_0x6f75[_0x86e678];return _0xc34f63;};'use strict';var Sequelize=require(_0x56f7('0x0'));module[_0x56f7('0x1')]={'priority':{'type':Sequelize[_0x56f7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x56f7('0x3')],'allowNull':![],'defaultValue':_0x56f7('0x4')},'appdata':{'type':Sequelize[_0x56f7('0x5')]()},'description':{'type':Sequelize[_0x56f7('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x56f7('0x6')}}; \ No newline at end of file +var _0xbca0=['exports','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xbca0,0x8b));var _0x0bca=function(_0x23f4aa,_0x159e3f){_0x23f4aa=_0x23f4aa-0x0;var _0x15dac2=_0xbca0[_0x23f4aa];return _0x15dac2;};'use strict';var Sequelize=require(_0x0bca('0x0'));module[_0x0bca('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0bca('0x2')]()},'description':{'type':Sequelize[_0x0bca('0x3')]},'interval':{'type':Sequelize[_0x0bca('0x3')],'defaultValue':_0x0bca('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0658c98..e733345 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 _0x9491=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','find','catch','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','OpenchannelApplication','query','filters'];(function(_0x3728c8,_0x22f76f){var _0x2ec7f0=function(_0x316e2b){while(--_0x316e2b){_0x3728c8['push'](_0x3728c8['shift']());}};_0x2ec7f0(++_0x22f76f);}(_0x9491,0xb6));var _0x1949=function(_0xc360dc,_0x2974b5){_0xc360dc=_0xc360dc-0x0;var _0x1506cc=_0x9491[_0xc360dc];return _0x1506cc;};'use strict';var pdf=require(_0x1949('0x0'));var emlformat=require(_0x1949('0x1'));var rimraf=require(_0x1949('0x2'));var zipdir=require(_0x1949('0x3'));var jsonpatch=require(_0x1949('0x4'));var rp=require(_0x1949('0x5'));var moment=require(_0x1949('0x6'));var BPromise=require(_0x1949('0x7'));var Mustache=require(_0x1949('0x8'));var util=require(_0x1949('0x9'));var path=require('path');var sox=require(_0x1949('0xa'));var csv=require('to-csv');var ejs=require(_0x1949('0xb'));var fs=require('fs');var _=require(_0x1949('0xc'));var squel=require('squel');var crypto=require(_0x1949('0xd'));var jsforce=require(_0x1949('0xe'));var deskjs=require(_0x1949('0xf'));var toCsv=require(_0x1949('0x10'));var querystring=require(_0x1949('0x11'));var Papa=require(_0x1949('0x12'));var Redis=require(_0x1949('0x13'));var authService=require(_0x1949('0x14'));var qs=require(_0x1949('0x15'));var hardwareService=require(_0x1949('0x16'));var logger=require(_0x1949('0x17'))('api');var utils=require(_0x1949('0x18'));var config=require(_0x1949('0x19'));var db=require(_0x1949('0x1a'))['db'];function respondWithStatusCode(_0x1cfff9,_0xa02415){_0xa02415=_0xa02415||0xcc;return function(_0x6d5828){if(_0x6d5828){return _0x1cfff9['sendStatus'](_0xa02415);}return _0x1cfff9[_0x1949('0x1b')](_0xa02415)['end']();};}function respondWithResult(_0x574713,_0x1716fe){_0x1716fe=_0x1716fe||0xc8;return function(_0x2b374d){if(_0x2b374d){return _0x574713[_0x1949('0x1b')](_0x1716fe)['json'](_0x2b374d);}};}function respondWithFilteredResult(_0x2726f7,_0x421e52){return function(_0xb65a56){if(_0xb65a56){var _0x5356ae=_0xb65a56[_0x1949('0x1c')],_0x55784f=_0x421e52['offset'],_0x2de909=_0x421e52[_0x1949('0x1d')]+_0x421e52[_0x1949('0x1e')],_0x376090;if(_0x2de909>=_0x5356ae){_0x2de909=_0x5356ae;_0x376090=0xc8;}else{_0x376090=0xce;}_0x2726f7['status'](_0x376090);return _0x2726f7[_0x1949('0x1f')](_0x1949('0x20'),_0x55784f+'-'+_0x2de909+'/'+_0x5356ae)[_0x1949('0x21')](_0xb65a56);}return null;};}function patchUpdates(_0x705c90){return function(_0x32b91f){try{jsonpatch[_0x1949('0x22')](_0x32b91f,_0x705c90,!![]);}catch(_0x3d0d8f){return BPromise[_0x1949('0x23')](_0x3d0d8f);}return _0x32b91f[_0x1949('0x24')]();};}function saveUpdates(_0x5702fc,_0x1e0478){return function(_0x50e662){if(_0x50e662){return _0x50e662['update'](_0x5702fc)[_0x1949('0x25')](function(_0x4a3a9d){return _0x4a3a9d;});}return null;};}function removeEntity(_0x121b44,_0x2b6ae0){return function(_0x5d58b7){if(_0x5d58b7){return _0x5d58b7[_0x1949('0x26')]()['then'](function(){_0x121b44[_0x1949('0x1b')](0xcc)[_0x1949('0x27')]();});}};}function handleEntityNotFound(_0x109c00,_0x1314ca){return function(_0x4d4d13){if(!_0x4d4d13){_0x109c00[_0x1949('0x28')](0x194);}return _0x4d4d13;};}function handleError(_0x58e225,_0x4035cc){_0x4035cc=_0x4035cc||0x1f4;return function(_0x5ae4f3){logger[_0x1949('0x29')](_0x5ae4f3[_0x1949('0x2a')]);if(_0x5ae4f3['name']){delete _0x5ae4f3[_0x1949('0x2b')];}_0x58e225['status'](_0x4035cc)[_0x1949('0x2c')](_0x5ae4f3);};}exports[_0x1949('0x2d')]=function(_0x34ac62,_0x26257e){var _0x54495e={},_0x4c6557={},_0xd585c2={'count':0x0,'rows':[]};var _0x25497f=db[_0x1949('0x2e')]['rawAttributes'];_0x4c6557['model']=_['keys'](_0x25497f);_0x4c6557[_0x1949('0x2f')]=_['keys'](_0x34ac62['query']);_0x4c6557[_0x1949('0x30')]=_[_0x1949('0x31')](_0x4c6557[_0x1949('0x32')],_0x4c6557[_0x1949('0x2f')]);_0x54495e[_0x1949('0x33')]=_[_0x1949('0x31')](_0x4c6557[_0x1949('0x32')],qs[_0x1949('0x34')](_0x34ac62['query'][_0x1949('0x34')]));_0x54495e['attributes']=_0x54495e[_0x1949('0x33')][_0x1949('0x35')]?_0x54495e['attributes']:_0x4c6557[_0x1949('0x32')];if(!_0x34ac62[_0x1949('0x2f')][_0x1949('0x36')](_0x1949('0x37'))){_0x54495e[_0x1949('0x1e')]=qs[_0x1949('0x1e')](_0x34ac62[_0x1949('0x2f')][_0x1949('0x1e')]);_0x54495e['offset']=qs[_0x1949('0x1d')](_0x34ac62['query']['offset']);}_0x54495e[_0x1949('0x38')]=qs[_0x1949('0x39')](_0x34ac62[_0x1949('0x2f')][_0x1949('0x39')]);_0x54495e[_0x1949('0x3a')]=qs[_0x1949('0x30')](_[_0x1949('0x3b')](_0x34ac62[_0x1949('0x2f')],_0x4c6557[_0x1949('0x30')]));if(_0x34ac62[_0x1949('0x2f')][_0x1949('0x3c')]){_0x54495e[_0x1949('0x3a')]=_[_0x1949('0x3d')](_0x54495e[_0x1949('0x3a')],{'$or':_['map'](_0x25497f,function(_0x901373){if(_0x901373['type'][_0x1949('0x3e')]!==_0x1949('0x3f')){var _0x23f956={};_0x23f956[_0x901373['field']]={'$like':'%'+_0x34ac62[_0x1949('0x2f')][_0x1949('0x3c')]+'%'};return _0x23f956;}})});}_0x54495e=_['merge']({},_0x54495e,_0x34ac62['options']);var _0x1a0d67={'where':_0x54495e[_0x1949('0x3a')]};return db[_0x1949('0x2e')][_0x1949('0x1c')](_0x1a0d67)[_0x1949('0x25')](function(_0x1c777a){_0xd585c2[_0x1949('0x1c')]=_0x1c777a;if(_0x34ac62[_0x1949('0x2f')][_0x1949('0x40')]){_0x54495e[_0x1949('0x41')]=[{'all':!![]}];}return db[_0x1949('0x2e')][_0x1949('0x42')](_0x54495e);})[_0x1949('0x25')](function(_0x4242d1){_0xd585c2[_0x1949('0x43')]=_0x4242d1;return _0xd585c2;})[_0x1949('0x25')](respondWithFilteredResult(_0x26257e,_0x54495e))['catch'](handleError(_0x26257e,null));};exports['show']=function(_0x1f524d,_0x4573ef){var _0xd21c26={'raw':!![],'where':{'id':_0x1f524d[_0x1949('0x44')]['id']}},_0x2ac1e9={};_0x2ac1e9[_0x1949('0x32')]=_[_0x1949('0x45')](db[_0x1949('0x2e')][_0x1949('0x46')]);_0x2ac1e9['query']=_['keys'](_0x1f524d['query']);_0x2ac1e9[_0x1949('0x30')]=_[_0x1949('0x31')](_0x2ac1e9[_0x1949('0x32')],_0x2ac1e9[_0x1949('0x2f')]);_0xd21c26[_0x1949('0x33')]=_[_0x1949('0x31')](_0x2ac1e9[_0x1949('0x32')],qs[_0x1949('0x34')](_0x1f524d[_0x1949('0x2f')]['fields']));_0xd21c26[_0x1949('0x33')]=_0xd21c26['attributes'][_0x1949('0x35')]?_0xd21c26['attributes']:_0x2ac1e9['model'];if(_0x1f524d[_0x1949('0x2f')][_0x1949('0x40')]){_0xd21c26[_0x1949('0x41')]=[{'all':!![]}];}_0xd21c26=_['merge']({},_0xd21c26,_0x1f524d[_0x1949('0x47')]);return db[_0x1949('0x2e')][_0x1949('0x48')](_0xd21c26)['then'](handleEntityNotFound(_0x4573ef,null))['then'](respondWithResult(_0x4573ef,null))[_0x1949('0x49')](handleError(_0x4573ef,null));};exports['create']=function(_0x57d01d,_0x46767e){return db[_0x1949('0x2e')][_0x1949('0x4a')](_0x57d01d[_0x1949('0x4b')],{})['then'](respondWithResult(_0x46767e,0xc9))['catch'](handleError(_0x46767e,null));};exports[_0x1949('0x4c')]=function(_0x517862,_0x2e6325){if(_0x517862['body']['id']){delete _0x517862['body']['id'];}return db[_0x1949('0x2e')][_0x1949('0x48')]({'where':{'id':_0x517862[_0x1949('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e6325,null))['then'](saveUpdates(_0x517862[_0x1949('0x4b')],null))[_0x1949('0x25')](respondWithResult(_0x2e6325,null))['catch'](handleError(_0x2e6325,null));};exports['destroy']=function(_0x141d90,_0x3e9b03){return db[_0x1949('0x2e')][_0x1949('0x48')]({'where':{'id':_0x141d90[_0x1949('0x44')]['id']}})[_0x1949('0x25')](handleEntityNotFound(_0x3e9b03,null))[_0x1949('0x25')](removeEntity(_0x3e9b03,null))[_0x1949('0x49')](handleError(_0x3e9b03,null));}; \ No newline at end of file +var _0xb43b=['key','field','includeAll','findAll','rows','catch','fields','include','options','find','create','body','params','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','limit','set','apply','save','then','sendStatus','stack','name','send','index','OpenchannelApplication','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','type'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1a85bf,_0x2503e0){_0x1a85bf=_0x1a85bf-0x0;var _0x64b696=_0xb43b[_0x1a85bf];return _0x64b696;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var hardwareService=require(_0xbb43('0x12'));var logger=require(_0xbb43('0x13'))(_0xbb43('0x14'));var utils=require(_0xbb43('0x15'));var config=require(_0xbb43('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a473,_0x2a5a4d){_0x2a5a4d=_0x2a5a4d||0xcc;return function(_0x50e2c0){if(_0x50e2c0){return _0x36a473['sendStatus'](_0x2a5a4d);}return _0x36a473[_0xbb43('0x17')](_0x2a5a4d)['end']();};}function respondWithResult(_0x593d0b,_0x438591){_0x438591=_0x438591||0xc8;return function(_0x5a509f){if(_0x5a509f){return _0x593d0b[_0xbb43('0x17')](_0x438591)[_0xbb43('0x18')](_0x5a509f);}};}function respondWithFilteredResult(_0x55926f,_0x4a6e18){return function(_0x4d5bcf){if(_0x4d5bcf){var _0x338120=_0x4d5bcf[_0xbb43('0x19')],_0x2abce0=_0x4a6e18['offset'],_0x57bd1d=_0x4a6e18['offset']+_0x4a6e18[_0xbb43('0x1a')],_0x526330;if(_0x57bd1d>=_0x338120){_0x57bd1d=_0x338120;_0x526330=0xc8;}else{_0x526330=0xce;}_0x55926f[_0xbb43('0x17')](_0x526330);return _0x55926f[_0xbb43('0x1b')]('Content-Range',_0x2abce0+'-'+_0x57bd1d+'/'+_0x338120)[_0xbb43('0x18')](_0x4d5bcf);}return null;};}function patchUpdates(_0x4f28b8){return function(_0x3bb57d){try{jsonpatch[_0xbb43('0x1c')](_0x3bb57d,_0x4f28b8,!![]);}catch(_0x4dfc54){return BPromise['reject'](_0x4dfc54);}return _0x3bb57d[_0xbb43('0x1d')]();};}function saveUpdates(_0x1b6e69,_0xdb7f2e){return function(_0x2bf2d4){if(_0x2bf2d4){return _0x2bf2d4['update'](_0x1b6e69)[_0xbb43('0x1e')](function(_0x5f4416){return _0x5f4416;});}return null;};}function removeEntity(_0x3a257d,_0x4bfaca){return function(_0x2f5e31){if(_0x2f5e31){return _0x2f5e31['destroy']()[_0xbb43('0x1e')](function(){_0x3a257d[_0xbb43('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0768,_0x4dfb7f){return function(_0xf24e60){if(!_0xf24e60){_0x1d0768[_0xbb43('0x1f')](0x194);}return _0xf24e60;};}function handleError(_0x16384e,_0x4d6d77){_0x4d6d77=_0x4d6d77||0x1f4;return function(_0x53f0d5){logger['error'](_0x53f0d5[_0xbb43('0x20')]);if(_0x53f0d5[_0xbb43('0x21')]){delete _0x53f0d5['name'];}_0x16384e[_0xbb43('0x17')](_0x4d6d77)[_0xbb43('0x22')](_0x53f0d5);};}exports[_0xbb43('0x23')]=function(_0x3874fb,_0x4ed43f){var _0x4b5342={},_0x27fd7a={},_0x42800f={'count':0x0,'rows':[]};var _0xa88db0=db[_0xbb43('0x24')][_0xbb43('0x25')];_0x27fd7a[_0xbb43('0x26')]=_[_0xbb43('0x27')](_0xa88db0);_0x27fd7a[_0xbb43('0x28')]=_['keys'](_0x3874fb[_0xbb43('0x28')]);_0x27fd7a['filters']=_[_0xbb43('0x29')](_0x27fd7a[_0xbb43('0x26')],_0x27fd7a[_0xbb43('0x28')]);_0x4b5342[_0xbb43('0x2a')]=_['intersection'](_0x27fd7a[_0xbb43('0x26')],qs['fields'](_0x3874fb['query']['fields']));_0x4b5342[_0xbb43('0x2a')]=_0x4b5342['attributes'][_0xbb43('0x2b')]?_0x4b5342[_0xbb43('0x2a')]:_0x27fd7a[_0xbb43('0x26')];if(!_0x3874fb['query'][_0xbb43('0x2c')](_0xbb43('0x2d'))){_0x4b5342[_0xbb43('0x1a')]=qs[_0xbb43('0x1a')](_0x3874fb[_0xbb43('0x28')][_0xbb43('0x1a')]);_0x4b5342[_0xbb43('0x2e')]=qs[_0xbb43('0x2e')](_0x3874fb['query'][_0xbb43('0x2e')]);}_0x4b5342[_0xbb43('0x2f')]=qs[_0xbb43('0x30')](_0x3874fb[_0xbb43('0x28')][_0xbb43('0x30')]);_0x4b5342[_0xbb43('0x31')]=qs[_0xbb43('0x32')](_[_0xbb43('0x33')](_0x3874fb[_0xbb43('0x28')],_0x27fd7a[_0xbb43('0x32')]));if(_0x3874fb[_0xbb43('0x28')][_0xbb43('0x34')]){_0x4b5342[_0xbb43('0x31')]=_[_0xbb43('0x35')](_0x4b5342[_0xbb43('0x31')],{'$or':_[_0xbb43('0x36')](_0xa88db0,function(_0x549841){if(_0x549841[_0xbb43('0x37')][_0xbb43('0x38')]!=='VIRTUAL'){var _0x285014={};_0x285014[_0x549841[_0xbb43('0x39')]]={'$like':'%'+_0x3874fb[_0xbb43('0x28')]['filter']+'%'};return _0x285014;}})});}_0x4b5342=_['merge']({},_0x4b5342,_0x3874fb['options']);var _0x40df31={'where':_0x4b5342[_0xbb43('0x31')]};return db['OpenchannelApplication']['count'](_0x40df31)[_0xbb43('0x1e')](function(_0x275425){_0x42800f[_0xbb43('0x19')]=_0x275425;if(_0x3874fb[_0xbb43('0x28')][_0xbb43('0x3a')]){_0x4b5342['include']=[{'all':!![]}];}return db[_0xbb43('0x24')][_0xbb43('0x3b')](_0x4b5342);})[_0xbb43('0x1e')](function(_0x3340aa){_0x42800f[_0xbb43('0x3c')]=_0x3340aa;return _0x42800f;})['then'](respondWithFilteredResult(_0x4ed43f,_0x4b5342))[_0xbb43('0x3d')](handleError(_0x4ed43f,null));};exports['show']=function(_0x1c076f,_0x93aa1c){var _0x56c808={'raw':!![],'where':{'id':_0x1c076f['params']['id']}},_0x4783fe={};_0x4783fe[_0xbb43('0x26')]=_[_0xbb43('0x27')](db[_0xbb43('0x24')][_0xbb43('0x25')]);_0x4783fe['query']=_[_0xbb43('0x27')](_0x1c076f[_0xbb43('0x28')]);_0x4783fe['filters']=_[_0xbb43('0x29')](_0x4783fe['model'],_0x4783fe[_0xbb43('0x28')]);_0x56c808[_0xbb43('0x2a')]=_[_0xbb43('0x29')](_0x4783fe[_0xbb43('0x26')],qs[_0xbb43('0x3e')](_0x1c076f[_0xbb43('0x28')]['fields']));_0x56c808[_0xbb43('0x2a')]=_0x56c808['attributes'][_0xbb43('0x2b')]?_0x56c808[_0xbb43('0x2a')]:_0x4783fe[_0xbb43('0x26')];if(_0x1c076f[_0xbb43('0x28')]['includeAll']){_0x56c808[_0xbb43('0x3f')]=[{'all':!![]}];}_0x56c808=_[_0xbb43('0x35')]({},_0x56c808,_0x1c076f[_0xbb43('0x40')]);return db[_0xbb43('0x24')][_0xbb43('0x41')](_0x56c808)[_0xbb43('0x1e')](handleEntityNotFound(_0x93aa1c,null))[_0xbb43('0x1e')](respondWithResult(_0x93aa1c,null))[_0xbb43('0x3d')](handleError(_0x93aa1c,null));};exports['create']=function(_0x2eaece,_0x8c57af){return db['OpenchannelApplication'][_0xbb43('0x42')](_0x2eaece['body'],{})['then'](respondWithResult(_0x8c57af,0xc9))['catch'](handleError(_0x8c57af,null));};exports['update']=function(_0x1c3482,_0x5a649b){if(_0x1c3482[_0xbb43('0x43')]['id']){delete _0x1c3482['body']['id'];}return db[_0xbb43('0x24')][_0xbb43('0x41')]({'where':{'id':_0x1c3482[_0xbb43('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a649b,null))[_0xbb43('0x1e')](saveUpdates(_0x1c3482['body'],null))[_0xbb43('0x1e')](respondWithResult(_0x5a649b,null))[_0xbb43('0x3d')](handleError(_0x5a649b,null));};exports[_0xbb43('0x45')]=function(_0x29840e,_0x417ad9){return db[_0xbb43('0x24')][_0xbb43('0x41')]({'where':{'id':_0x29840e['params']['id']}})[_0xbb43('0x1e')](handleEntityNotFound(_0x417ad9,null))[_0xbb43('0x1e')](removeEntity(_0x417ad9,null))[_0xbb43('0x3d')](handleError(_0x417ad9,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index ce9fde1..3bf2e74 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 _0xa25b=['request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','api','bluebird'];(function(_0x36bbbb,_0x3f6709){var _0x3ca0eb=function(_0x299763){while(--_0x299763){_0x36bbbb['push'](_0x36bbbb['shift']());}};_0x3ca0eb(++_0x3f6709);}(_0xa25b,0x170));var _0xba25=function(_0x443eaa,_0xa01741){_0x443eaa=_0x443eaa-0x0;var _0x3aade7=_0xa25b[_0x443eaa];return _0x3aade7;};'use strict';var _=require(_0xba25('0x0'));var util=require(_0xba25('0x1'));var logger=require('../../config/logger')(_0xba25('0x2'));var moment=require('moment');var BPromise=require(_0xba25('0x3'));var rp=require(_0xba25('0x4'));var fs=require('fs');var path=require(_0xba25('0x5'));var rimraf=require(_0xba25('0x6'));var config=require('../../config/environment');var attributes=require(_0xba25('0x7'));module[_0xba25('0x8')]=function(_0x55b5a7,_0xa2c83b){return _0x55b5a7[_0xba25('0x9')](_0xba25('0xa'),attributes,{'tableName':_0xba25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x24b3=['utf8mb4','lodash','util','../../config/logger','moment','rimraf','../../config/environment','exports','OpenchannelApplication','openchannel_applications'];(function(_0x1b28d5,_0x10c46a){var _0xe8eaa6=function(_0x235fd0){while(--_0x235fd0){_0x1b28d5['push'](_0x1b28d5['shift']());}};_0xe8eaa6(++_0x10c46a);}(_0x24b3,0xd3));var _0x324b=function(_0x1113f6,_0x360b5d){_0x1113f6=_0x1113f6-0x0;var _0xda1f2a=_0x24b3[_0x1113f6];return _0xda1f2a;};'use strict';var _=require(_0x324b('0x0'));var util=require(_0x324b('0x1'));var logger=require(_0x324b('0x2'))('api');var moment=require(_0x324b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x324b('0x4'));var config=require(_0x324b('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x324b('0x6')]=function(_0x4ff65e,_0x5a244c){return _0x4ff65e['define'](_0x324b('0x7'),attributes,{'tableName':_0x324b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x324b('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index f242436..5e57ca9 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 _0x8c21=['result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c5708,_0x34b1f9){var _0x37fa9b=function(_0x534dc4){while(--_0x534dc4){_0x4c5708['push'](_0x4c5708['shift']());}};_0x37fa9b(++_0x34b1f9);}(_0x8c21,0x18b));var _0x18c2=function(_0x21c7e4,_0x2d61be){_0x21c7e4=_0x21c7e4-0x0;var _0x310cd2=_0x8c21[_0x21c7e4];return _0x310cd2;};'use strict';var _=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var moment=require(_0x18c2('0x2'));var BPromise=require(_0x18c2('0x3'));var rs=require(_0x18c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x18c2('0x6'))(_0x18c2('0x7'));var config=require('../../config/environment');var jayson=require(_0x18c2('0x8'));var client=jayson['client'][_0x18c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a2af6,_0x3528a8,_0x127123){return new BPromise(function(_0x2c43bb,_0x4fb320){return client[_0x18c2('0xa')](_0x2a2af6,_0x127123)[_0x18c2('0xb')](function(_0x4b5d2a){logger[_0x18c2('0xc')](_0x18c2('0xd'),_0x3528a8,_0x18c2('0xe'));logger[_0x18c2('0xf')](_0x18c2('0x10'),_0x3528a8,_0x18c2('0xe'),JSON[_0x18c2('0x11')](_0x4b5d2a));if(_0x4b5d2a[_0x18c2('0x12')]){if(_0x4b5d2a[_0x18c2('0x12')][_0x18c2('0x13')]===0x1f4){logger[_0x18c2('0x12')](_0x18c2('0xd'),_0x3528a8,_0x4b5d2a['error'][_0x18c2('0x14')]);return _0x4fb320(_0x4b5d2a[_0x18c2('0x12')][_0x18c2('0x14')]);}logger['error'](_0x18c2('0xd'),_0x3528a8,_0x4b5d2a[_0x18c2('0x12')][_0x18c2('0x14')]);return _0x2c43bb(_0x4b5d2a[_0x18c2('0x12')][_0x18c2('0x14')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x3528a8,_0x18c2('0xe'));_0x2c43bb(_0x4b5d2a[_0x18c2('0x15')][_0x18c2('0x14')]);}})[_0x18c2('0x16')](function(_0x2ed9ff){logger['error'](_0x18c2('0xd'),_0x3528a8,_0x2ed9ff);_0x4fb320(_0x2ed9ff);});});}exports[_0x18c2('0x17')]=function(_0x4b3e33){var _0x423c25=this;return new Promise(function(_0x3ea63d,_0x47731c){return db[_0x18c2('0x18')][_0x18c2('0x19')](_0x4b3e33[_0x18c2('0x1a')],{'raw':_0x4b3e33[_0x18c2('0x1b')]?_0x4b3e33[_0x18c2('0x1b')][_0x18c2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3e33[_0x18c2('0x1b')]?_0x4b3e33[_0x18c2('0x1b')][_0x18c2('0x1d')]||null:null,'attributes':_0x4b3e33[_0x18c2('0x1b')]?_0x4b3e33[_0x18c2('0x1b')][_0x18c2('0x1e')]||null:null,'limit':_0x4b3e33[_0x18c2('0x1b')]?_0x4b3e33[_0x18c2('0x1b')][_0x18c2('0x1f')]||null:null})[_0x18c2('0xb')](function(_0x95a8e5){logger[_0x18c2('0xc')]('UpdateOpenchannelApplication',_0x4b3e33);logger[_0x18c2('0xf')]('UpdateOpenchannelApplication',_0x4b3e33,JSON[_0x18c2('0x11')](_0x95a8e5));_0x3ea63d(_0x95a8e5);})['catch'](function(_0x121f3f){logger[_0x18c2('0x12')](_0x18c2('0x17'),_0x121f3f[_0x18c2('0x14')],_0x4b3e33);_0x47731c(_0x423c25[_0x18c2('0x12')](0x1f4,_0x121f3f[_0x18c2('0x14')]));});});}; \ No newline at end of file +var _0x7adc=['raw','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update','body','options'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x7adc,0x123));var _0xc7ad=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x7adc[_0x21f9c2];return _0x3da17f;};'use strict';var _=require(_0xc7ad('0x0'));var util=require(_0xc7ad('0x1'));var moment=require(_0xc7ad('0x2'));var BPromise=require(_0xc7ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7ad('0x4'))['db'];var utils=require(_0xc7ad('0x5'));var logger=require(_0xc7ad('0x6'))(_0xc7ad('0x7'));var config=require(_0xc7ad('0x8'));var jayson=require(_0xc7ad('0x9'));var client=jayson[_0xc7ad('0xa')][_0xc7ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ae5ef,_0x2bb490,_0x4e0a93){return new BPromise(function(_0x17ea3a,_0x485f57){return client[_0xc7ad('0xc')](_0x4ae5ef,_0x4e0a93)[_0xc7ad('0xd')](function(_0x5b80b2){logger[_0xc7ad('0xe')](_0xc7ad('0xf'),_0x2bb490,_0xc7ad('0x10'));logger[_0xc7ad('0x11')](_0xc7ad('0x12'),_0x2bb490,'request\x20sent',JSON[_0xc7ad('0x13')](_0x5b80b2));if(_0x5b80b2[_0xc7ad('0x14')]){if(_0x5b80b2['error'][_0xc7ad('0x15')]===0x1f4){logger['error'](_0xc7ad('0xf'),_0x2bb490,_0x5b80b2[_0xc7ad('0x14')][_0xc7ad('0x16')]);return _0x485f57(_0x5b80b2[_0xc7ad('0x14')][_0xc7ad('0x16')]);}logger[_0xc7ad('0x14')](_0xc7ad('0xf'),_0x2bb490,_0x5b80b2[_0xc7ad('0x14')][_0xc7ad('0x16')]);return _0x17ea3a(_0x5b80b2[_0xc7ad('0x14')][_0xc7ad('0x16')]);}else{logger[_0xc7ad('0xe')](_0xc7ad('0xf'),_0x2bb490,'request\x20sent');_0x17ea3a(_0x5b80b2[_0xc7ad('0x17')][_0xc7ad('0x16')]);}})[_0xc7ad('0x18')](function(_0x362fa5){logger[_0xc7ad('0x14')](_0xc7ad('0xf'),_0x2bb490,_0x362fa5);_0x485f57(_0x362fa5);});});}exports['UpdateOpenchannelApplication']=function(_0x2a9031){var _0x3a55d7=this;return new Promise(function(_0x37ae74,_0x2e1b48){return db[_0xc7ad('0x19')][_0xc7ad('0x1a')](_0x2a9031[_0xc7ad('0x1b')],{'raw':_0x2a9031[_0xc7ad('0x1c')]?_0x2a9031[_0xc7ad('0x1c')][_0xc7ad('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a9031['options']?_0x2a9031[_0xc7ad('0x1c')]['where']||null:null,'attributes':_0x2a9031[_0xc7ad('0x1c')]?_0x2a9031[_0xc7ad('0x1c')]['attributes']||null:null,'limit':_0x2a9031['options']?_0x2a9031[_0xc7ad('0x1c')][_0xc7ad('0x1e')]||null:null})[_0xc7ad('0xd')](function(_0x5705df){logger[_0xc7ad('0xe')](_0xc7ad('0x1f'),_0x2a9031);logger[_0xc7ad('0x11')](_0xc7ad('0x1f'),_0x2a9031,JSON[_0xc7ad('0x13')](_0x5705df));_0x37ae74(_0x5705df);})['catch'](function(_0x6c76b1){logger['error']('UpdateOpenchannelApplication',_0x6c76b1[_0xc7ad('0x16')],_0x2a9031);_0x2e1b48(_0x3a55d7['error'](0x1f4,_0x6c76b1[_0xc7ad('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 31e7dcc..a7ab552 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 _0xefee=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','describe','get','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','/:id','openchannelinteraction:destroy','destroy','removeTags','exports'];(function(_0x1ecdc0,_0x34f114){var _0x51b18f=function(_0x3bbab6){while(--_0x3bbab6){_0x1ecdc0['push'](_0x1ecdc0['shift']());}};_0x51b18f(++_0x34f114);}(_0xefee,0x118));var _0xeefe=function(_0x4232c6,_0x174fd3){_0x4232c6=_0x4232c6-0x0;var _0x41efd0=_0xefee[_0x4232c6];return _0x41efd0;};'use strict';var multer=require(_0xeefe('0x0'));var util=require(_0xeefe('0x1'));var path=require(_0xeefe('0x2'));var timeout=require(_0xeefe('0x3'));var express=require(_0xeefe('0x4'));var router=express[_0xeefe('0x5')]();var auth=require(_0xeefe('0x6'));var interaction=require(_0xeefe('0x7'));var config=require(_0xeefe('0x8'));var controller=require(_0xeefe('0x9'));router['get']('/',auth[_0xeefe('0xa')](),controller[_0xeefe('0xb')]);router['get']('/describe',auth[_0xeefe('0xa')](),controller[_0xeefe('0xc')]);router[_0xeefe('0xd')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xeefe('0xe'),auth[_0xeefe('0xa')](),controller[_0xeefe('0xf')]);router[_0xeefe('0xd')](_0xeefe('0x10'),auth[_0xeefe('0xa')](),controller[_0xeefe('0x11')]);router[_0xeefe('0x12')]('/',auth['isAuthenticated'](),controller[_0xeefe('0x13')]);router[_0xeefe('0x12')]('/:id/messages',auth[_0xeefe('0xa')](),controller[_0xeefe('0x14')]);router[_0xeefe('0x12')](_0xeefe('0x15'),auth[_0xeefe('0xa')](),interaction['tracked'](_0xeefe('0x16'),_0xeefe('0x17')),controller[_0xeefe('0x18')]);router[_0xeefe('0x19')]('/:id',auth[_0xeefe('0xa')](),interaction[_0xeefe('0x1a')]('openchannel',_0xeefe('0x1b')),controller[_0xeefe('0x1c')]);router[_0xeefe('0x1d')](_0xeefe('0x1e'),auth['isAuthenticated'](),interaction[_0xeefe('0x1a')](_0xeefe('0x16'),_0xeefe('0x1f')),controller[_0xeefe('0x20')]);router[_0xeefe('0x1d')](_0xeefe('0x15'),auth[_0xeefe('0xa')](),controller[_0xeefe('0x21')]);module[_0xeefe('0x22')]=router; \ No newline at end of file +var _0x964d=['post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x964d,0x159));var _0xd964=function(_0x49f5e0,_0x12b7db){_0x49f5e0=_0x49f5e0-0x0;var _0x20d202=_0x964d[_0x49f5e0];return _0x20d202;};'use strict';var multer=require(_0xd964('0x0'));var util=require(_0xd964('0x1'));var path=require(_0xd964('0x2'));var timeout=require(_0xd964('0x3'));var express=require(_0xd964('0x4'));var router=express['Router']();var auth=require(_0xd964('0x5'));var interaction=require(_0xd964('0x6'));var config=require(_0xd964('0x7'));var controller=require(_0xd964('0x8'));router['get']('/',auth[_0xd964('0x9')](),controller['index']);router[_0xd964('0xa')](_0xd964('0xb'),auth[_0xd964('0x9')](),controller[_0xd964('0xc')]);router[_0xd964('0xa')](_0xd964('0xd'),auth[_0xd964('0x9')](),controller['show']);router[_0xd964('0xa')](_0xd964('0xe'),auth[_0xd964('0x9')](),controller[_0xd964('0xf')]);router['get'](_0xd964('0x10'),auth[_0xd964('0x9')](),controller[_0xd964('0x11')]);router[_0xd964('0x12')]('/',auth[_0xd964('0x9')](),controller[_0xd964('0x13')]);router[_0xd964('0x12')](_0xd964('0xe'),auth[_0xd964('0x9')](),controller[_0xd964('0x14')]);router['post'](_0xd964('0x15'),auth[_0xd964('0x9')](),interaction[_0xd964('0x16')](_0xd964('0x17'),_0xd964('0x18')),controller[_0xd964('0x19')]);router[_0xd964('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0xd964('0x16')](_0xd964('0x17'),_0xd964('0x1b')),controller[_0xd964('0x1c')]);router[_0xd964('0x1d')]('/:id',auth[_0xd964('0x9')](),interaction[_0xd964('0x16')]('openchannel',_0xd964('0x1e')),controller[_0xd964('0x1f')]);router[_0xd964('0x1d')](_0xd964('0x15'),auth[_0xd964('0x9')](),controller['removeTags']);module[_0xd964('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index c491ee1..01dc788 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 _0xcac6=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5b9095,_0x37b4ce){var _0x22daa1=function(_0x40aa57){while(--_0x40aa57){_0x5b9095['push'](_0x5b9095['shift']());}};_0x22daa1(++_0x37b4ce);}(_0xcac6,0xa3));var _0x6cac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcac6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x6cac('0x0')]={'closed':{'type':Sequelize[_0x6cac('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6cac('0x2')]},'disposition':{'type':Sequelize[_0x6cac('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x6cac('0x3')]},'externalUrl':{'type':Sequelize[_0x6cac('0x3')]},'lastMsgAt':{'type':Sequelize[_0x6cac('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6cac('0x4')]('in',_0x6cac('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6cac('0x3')]}}; \ No newline at end of file +var _0x2e3b=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x354035,_0x5ca870){var _0x379163=function(_0x2cc6dd){while(--_0x2cc6dd){_0x354035['push'](_0x354035['shift']());}};_0x379163(++_0x5ca870);}(_0x2e3b,0x81));var _0xb2e3=function(_0x3de9b6,_0x4ea1ff){_0x3de9b6=_0x3de9b6-0x0;var _0x587da8=_0x2e3b[_0x3de9b6];return _0x587da8;};'use strict';var Sequelize=require('sequelize');module[_0xb2e3('0x0')]={'closed':{'type':Sequelize[_0xb2e3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2e3('0x2')]},'disposition':{'type':Sequelize[_0xb2e3('0x3')]},'note':{'type':Sequelize[_0xb2e3('0x3')]},'read1stAt':{'type':Sequelize[_0xb2e3('0x2')]},'threadId':{'type':Sequelize[_0xb2e3('0x3')]},'externalUrl':{'type':Sequelize[_0xb2e3('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb2e3('0x4')]('in',_0xb2e3('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 323e74d..984afe0 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 _0x416d=['show','params','includeAll','options','body','find','describe','addMessage','OpenchannelMessage','omit','ids','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Owner','get','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Messages','basename','existsSync','createReadStream','pipe','out','System','direction','renderFile','views','create','toFile','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','Tags','TagIds','split','forEach','catch','OpenchannelInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.OpenchannelInteractionId','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','unreadMessages','\x20IN\x20?','map','filter','OpenchannelAccountId','parse','$lte','null','\x20IS\x20NULL','replace','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','count','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','it.OpenchannelInteractionId\x20=\x20i.id','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows'];(function(_0x37b6eb,_0x3837f1){var _0x5a8c45=function(_0x4bd225){while(--_0x4bd225){_0x37b6eb['push'](_0x37b6eb['shift']());}};_0x5a8c45(++_0x3837f1);}(_0x416d,0x120));var _0xd416=function(_0x46a634,_0x439b70){_0x46a634=_0x46a634-0x0;var _0x42007a=_0x416d[_0x46a634];return _0x42007a;};'use strict';var pdf=require(_0xd416('0x0'));var emlformat=require(_0xd416('0x1'));var rimraf=require(_0xd416('0x2'));var zipdir=require(_0xd416('0x3'));var jsonpatch=require(_0xd416('0x4'));var rp=require(_0xd416('0x5'));var moment=require(_0xd416('0x6'));var BPromise=require(_0xd416('0x7'));var Mustache=require('mustache');var util=require(_0xd416('0x8'));var path=require(_0xd416('0x9'));var sox=require(_0xd416('0xa'));var csv=require('to-csv');var ejs=require(_0xd416('0xb'));var fs=require('fs');var _=require(_0xd416('0xc'));var squel=require(_0xd416('0xd'));var crypto=require(_0xd416('0xe'));var jsforce=require(_0xd416('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd416('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd416('0x11'));var logger=require(_0xd416('0x12'))('api');var utils=require(_0xd416('0x13'));var config=require(_0xd416('0x14'));var db=require(_0xd416('0x15'))['db'];config[_0xd416('0x16')]=_[_0xd416('0x17')](config[_0xd416('0x16')],{'host':_0xd416('0x18'),'port':0x18eb});var socket=require(_0xd416('0x19'))(new Redis(config[_0xd416('0x16')]));require(_0xd416('0x1a'))['register'](socket);function respondWithStatusCode(_0x5945f0,_0x3f4926){_0x3f4926=_0x3f4926||0xcc;return function(_0x4c1469){if(_0x4c1469){return _0x5945f0[_0xd416('0x1b')](_0x3f4926);}return _0x5945f0[_0xd416('0x1c')](_0x3f4926)[_0xd416('0x1d')]();};}function respondWithResult(_0x4caffe,_0x590ff6){_0x590ff6=_0x590ff6||0xc8;return function(_0x5c076b){if(_0x5c076b){return _0x4caffe[_0xd416('0x1c')](_0x590ff6)['json'](_0x5c076b);}};}function respondWithFilteredResult(_0x1687f6,_0x2cb7b4){return function(_0x3b0ea1){if(_0x3b0ea1){var _0x5848=_0x3b0ea1['count'],_0x5b9833=_0x2cb7b4['offset'],_0x368790=_0x2cb7b4[_0xd416('0x1e')]+_0x2cb7b4[_0xd416('0x1f')],_0x3ba4d0;if(_0x368790>=_0x5848){_0x368790=_0x5848;_0x3ba4d0=0xc8;}else{_0x3ba4d0=0xce;}_0x1687f6[_0xd416('0x1c')](_0x3ba4d0);return _0x1687f6[_0xd416('0x20')](_0xd416('0x21'),_0x5b9833+'-'+_0x368790+'/'+_0x5848)[_0xd416('0x22')](_0x3b0ea1);}return null;};}function patchUpdates(_0x52b6fc){return function(_0x5312e1){try{jsonpatch['apply'](_0x5312e1,_0x52b6fc,!![]);}catch(_0x46e0de){return BPromise[_0xd416('0x23')](_0x46e0de);}return _0x5312e1[_0xd416('0x24')]();};}function saveUpdates(_0x5c09e8,_0x10f320){return function(_0x512981){if(_0x512981){return _0x512981[_0xd416('0x25')](_0x5c09e8)[_0xd416('0x26')](function(_0x47550e){return _0x47550e;});}return null;};}function removeEntity(_0x5bbda2,_0x548da5){return function(_0x2e3668){if(_0x2e3668){return _0x2e3668[_0xd416('0x27')]()['then'](function(){_0x5bbda2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb03b,_0x19a0cd){return function(_0x7087b3){if(!_0x7087b3){_0x4eb03b[_0xd416('0x1b')](0x194);}return _0x7087b3;};}function handleError(_0x28d2ad,_0x1ef056){_0x1ef056=_0x1ef056||0x1f4;return function(_0x5719b3){logger[_0xd416('0x28')](_0x5719b3['stack']);if(_0x5719b3[_0xd416('0x29')]){delete _0x5719b3[_0xd416('0x29')];}_0x28d2ad[_0xd416('0x1c')](_0x1ef056)[_0xd416('0x2a')](_0x5719b3);};}function getInteractionUsers(_0x5901f1,_0x5b17a2){return new BPromise(function(_0x2e4b8f,_0x31014b){try{if(_0x5b17a2[_0x5901f1['id']]){_0x5901f1['Users']=_['map'](_0x5b17a2[_0x5901f1['id']],function(_0x4e83b7){return{'id':_0x4e83b7['id']};});}}catch(_0x459d1c){_0x31014b(_0x459d1c);}_0x2e4b8f(_0x5901f1);});}function getInteractionTags(_0x57ff4f,_0x2f57ca){return new BPromise(function(_0x249e8c,_0x4548d2){try{if(_0x57ff4f['TagIds']){_0x57ff4f[_0xd416('0x2b')]=[];_0x57ff4f[_0xd416('0x2c')][_0xd416('0x2d')](',')[_0xd416('0x2e')](function(_0x389793){_0x57ff4f[_0xd416('0x2b')]['push'](_0x2f57ca[_0x389793]);});}delete _0x57ff4f['TagIds'];}catch(_0x2c03c0){_0x4548d2(_0x2c03c0);}_0x249e8c(_0x57ff4f);});}function updateOpenchannelInteraction(_0xb9d071,_0x234b74,_0x1e8abe){return new BPromise(function(_0x3ee3eb,_0x36c79d){return getInteractionUsers(_0xb9d071,_0x1e8abe)[_0xd416('0x26')](function(_0x299ca3){return getInteractionTags(_0x299ca3,_0x234b74);})[_0xd416('0x26')](function(_0x2f43be){_0x3ee3eb(_0x2f43be);})[_0xd416('0x2f')](function(_0x7326be){_0x36c79d(_0x7326be);});});}exports['index']=function(_0x511811,_0x16bf28){var _0x3bc610={},_0x2bc5d6={},_0x245987={'count':0x0,'rows':[]};var _0x1c9db7=db[_0xd416('0x30')][_0xd416('0x31')];_0x2bc5d6['model']=_[_0xd416('0x32')](_0x1c9db7);_0x2bc5d6['query']=_[_0xd416('0x32')](_0x511811[_0xd416('0x33')]);_0x2bc5d6[_0xd416('0x34')]=_[_0xd416('0x35')](_0x2bc5d6[_0xd416('0x36')],_0x2bc5d6[_0xd416('0x33')]);_0x3bc610[_0xd416('0x37')]=_[_0xd416('0x35')](_0x2bc5d6['model'],qs[_0xd416('0x38')](_0x511811['query'][_0xd416('0x38')]));_0x3bc610[_0xd416('0x37')]=_0x3bc610[_0xd416('0x37')][_0xd416('0x39')]?_0x3bc610[_0xd416('0x37')]:_0x2bc5d6[_0xd416('0x36')];if(!_0x511811['query'][_0xd416('0x3a')](_0xd416('0x3b'))){_0x3bc610[_0xd416('0x1f')]=qs[_0xd416('0x1f')](_0x511811[_0xd416('0x33')]['limit']);_0x3bc610[_0xd416('0x1e')]=qs['offset'](_0x511811[_0xd416('0x33')][_0xd416('0x1e')]);}_0x3bc610[_0xd416('0x3c')]=qs[_0xd416('0x3d')](_0x511811['query'][_0xd416('0x3d')]);_0x3bc610[_0xd416('0x3e')]=qs[_0xd416('0x34')](_[_0xd416('0x3f')](_0x511811[_0xd416('0x33')],_0x2bc5d6['filters']));var _0x553e31=[];var _0x46a00d=squel[_0xd416('0x40')]()[_0xd416('0x41')]('id')[_0xd416('0x41')]('name')[_0xd416('0x41')](_0xd416('0x42'))[_0xd416('0x43')](_0xd416('0x44'));var _0x2cf7f0=squel[_0xd416('0x40')]()[_0xd416('0x41')](_0xd416('0x45'))[_0xd416('0x43')](_0xd416('0x46'),'me')[_0xd416('0x3e')](_0xd416('0x47'))['where'](_0xd416('0x48'))[_0xd416('0x3e')](_0xd416('0x49'));var _0x5ce99f=squel[_0xd416('0x40')]()[_0xd416('0x41')]('u.id')['field'](_0xd416('0x4a'))[_0xd416('0x43')]('user_has_openchannel_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x41a931=squel['select']()[_0xd416('0x43')]('openchannel_interactions','i')[_0xd416('0x4b')](_0xd416('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd416('0x4b')](_0xd416('0x4d'),'o',_0xd416('0x4e'))[_0xd416('0x4b')](_0xd416('0x4f'),'a',_0xd416('0x50'))['left_join'](_0xd416('0x46'),'me',_0xd416('0x51'));var _0x24d6f4=squel[_0xd416('0x52')]();if(_0x511811[_0xd416('0x33')]['advancedFilter']){var _0x25299f=JSON['parse'](_0x511811[_0xd416('0x33')][_0xd416('0x53')]);_[_0xd416('0x32')](_0x25299f)[_0xd416('0x2e')](function(_0x1c6886){var _0x5cd003=_0x25299f[_0x1c6886];if(_0x1c6886===_0xd416('0x54')){var _0xbd0838=moment(_0x5cd003[_0xd416('0x55')][_0xd416('0x56')])[_0xd416('0x57')](_0xd416('0x58'))[_0xd416('0x59')]()[_0xd416('0x5a')]();var _0x43aba3=moment(_0x43aba3)[_0xd416('0x59')]()[_0xd416('0x5b')](_0xd416('0x58'))[_0xd416('0x5a')]();_0x24d6f4[_0xd416('0x5c')](_0xd416('0x5d'),_0xbd0838,_0x43aba3);}else{if(_[_0xd416('0x5e')](_0x5cd003[_0xd416('0x5f')])){_0x5cd003[_0xd416('0x5f')][_0xd416('0x2e')](function(_0x37299c){switch(_0x5cd003['condition'][_0xd416('0x55')]){case'IS':if(_0x1c6886!==_0xd416('0x60')&&_0x1c6886!=='unreadMessages'){if(_[_0xd416('0x5e')](_0x5cd003['value'])&&_0x5cd003['value'][_0xd416('0x39')]>0x1){_0x24d6f4['and'](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+'\x20IN\x20?',_0x5cd003['value']);}else{_0x24d6f4[_0xd416('0x5c')](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x62'),_0x5cd003[_0xd416('0x55')][0x0]);}}break;case'=':_0x24d6f4[_0xd416('0x5c')](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+_0xd416('0x62'),_0x5cd003[_0xd416('0x55')]);break;case _0xd416('0x63'):if(_0x1c6886===_0xd416('0x64')){_0x24d6f4[_0xd416('0x5c')](_0xd416('0x65')+_0xd416('0x66'),'%'+_0x5cd003[_0xd416('0x55')]+'%');_0x24d6f4['or'](_0xd416('0x67')+_0xd416('0x66'),'%'+_0x5cd003[_0xd416('0x55')]+'%');_0x24d6f4['or'](_0xd416('0x68')+_0xd416('0x66'),'%'+_0x5cd003[_0xd416('0x55')]+'%');}else{_0x24d6f4[_0xd416('0x5c')](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+'\x20LIKE\x20?','%'+_0x5cd003[_0xd416('0x55')]+'%');}break;case'>':_0x24d6f4['and'](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x69'),_0x5cd003['value']);break;case'<':_0x24d6f4[_0xd416('0x5c')](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x6a'),_0x5cd003[_0xd416('0x55')]);break;}});}else{switch(_0x5cd003[_0xd416('0x5f')][_0xd416('0x55')]){case'IS':if(_0x1c6886!==_0xd416('0x60')&&_0x1c6886!==_0xd416('0x6b')){if(_['isArray'](_0x5cd003[_0xd416('0x55')])&&_0x5cd003[_0xd416('0x55')][_0xd416('0x39')]>0x1){_0x24d6f4[_0xd416('0x5c')](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x6c'),_0x5cd003[_0xd416('0x55')]);}else{_0x24d6f4[_0xd416('0x5c')](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+_0xd416('0x62'),_0x5cd003[_0xd416('0x55')][0x0]);}}break;case'=':_0x24d6f4[_0xd416('0x5c')](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x62'),_0x5cd003['value']);break;case _0xd416('0x63'):if(_0x1c6886===_0xd416('0x64')){_0x24d6f4[_0xd416('0x5c')]('c.firstName'+'\x20LIKE\x20?','%'+_0x5cd003[_0xd416('0x55')]+'%');_0x24d6f4['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x5cd003[_0xd416('0x55')]+'%');_0x24d6f4['or'](_0xd416('0x68')+_0xd416('0x66'),'%'+_0x5cd003['value']+'%');}else{_0x24d6f4[_0xd416('0x5c')](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+'\x20LIKE\x20?','%'+_0x5cd003[_0xd416('0x55')]+'%');}break;case'>':_0x24d6f4[_0xd416('0x5c')](_0x5cd003[_0xd416('0x61')]+'.'+_0x1c6886+_0xd416('0x69'),_0x5cd003[_0xd416('0x55')]);break;case'<':_0x24d6f4[_0xd416('0x5c')](_0x5cd003['tableAlias']+'.'+_0x1c6886+_0xd416('0x6a'),_0x5cd003['value']);break;}}}});}else{var _0x3d3f81=_(Object[_0xd416('0x32')](_0x511811[_0xd416('0x33')]))[_0xd416('0x6d')](function(_0x5c71bd){return _0x1c9db7[_0xd416('0x3a')](_0x5c71bd)?_0x5c71bd:undefined;})[_0xd416('0x6e')](function(_0x359f9d){return!_['isNil'](_0x359f9d);})[_0xd416('0x55')]();if(!_['isEmpty'](_0x3d3f81)){_0x3d3f81[_0xd416('0x2e')](function(_0x15d28a){if(_0x15d28a===_0xd416('0x6f')){_0x41a931['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x511811['query'][_0x15d28a]));}else if(_0x15d28a===_0xd416('0x54')){var _0x25fc95=JSON[_0xd416('0x70')](_0x511811[_0xd416('0x33')][_0x15d28a])['$gte'];var _0x3bb4ec=JSON[_0xd416('0x70')](_0x511811[_0xd416('0x33')][_0x15d28a])[_0xd416('0x71')];_0x41a931[_0xd416('0x3e')](_0xd416('0x5d'),_0x25fc95,_0x3bb4ec);}else{if(_0x511811[_0xd416('0x33')][_0x15d28a]===_0xd416('0x72')){_0x41a931[_0xd416('0x3e')]('i.'+_0x15d28a+_0xd416('0x73'));}else{_0x41a931[_0xd416('0x3e')]('i.'+_0x15d28a+_0xd416('0x62'),_0x511811['query'][_0x15d28a]);}}});}if(_0x511811[_0xd416('0x33')]['filter']){var _0x3bc23f=_0x511811[_0xd416('0x33')][_0xd416('0x6e')][_0xd416('0x74')]('\x5c','\x5c\x5c')[_0xd416('0x74')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xd416('0x75')](_0x3bc23f)){_0x24d6f4['or'](_0xd416('0x76'),_0x3bc23f+'%');}else{var _0x1f8656=[];_0x3bc23f[_0xd416('0x2d')]('\x20')['forEach'](function(_0xfefcb7){_0x1f8656['push']('+'+_0xfefcb7[_0xd416('0x77')]());});var _0xb96b7f=_0x1f8656[_0xd416('0x78')]('\x20');_0x24d6f4['or'](_0xd416('0x79'),_0xb96b7f)['or']('i.from\x20LIKE\x20?',_0x3bc23f+'%')['or'](_0xd416('0x7a'),_0x3bc23f+'%');}}}_0x41a931[_0xd416('0x3e')](_0x24d6f4);if(_0x3bc610['order']){_0x3bc610['order'][_0xd416('0x2e')](function(_0xb87d7c){_0x41a931[_0xd416('0x3c')]('i.'+_0xb87d7c[0x0],_0xb87d7c[0x1]===_0xd416('0x7b')?![]:!![]);});}_0x41a931['group']('i.id');var _0x5d6542={'type':db['Sequelize']['QueryTypes'][_0xd416('0x7c')],'raw':!![]};var _0x221f36=_0x41a931[_0xd416('0x7d')]()[_0xd416('0x41')](_0xd416('0x45'))[_0xd416('0x41')](_0xd416('0x7e'),'unreadMessages');if(!_0x511811[_0xd416('0x33')][_0xd416('0x53')]){if(_0x511811[_0xd416('0x33')][_0xd416('0x7f')]){if(_0x511811[_0xd416('0x33')][_0xd416('0x7f')]==0x1){_0x221f36[_0xd416('0x80')](_0xd416('0x81'));_0x41a931['having'](_0xd416('0x81'));}else{_0x221f36[_0xd416('0x80')](_0xd416('0x82'));_0x41a931[_0xd416('0x80')](_0xd416('0x82'));}}if(_0x511811[_0xd416('0x33')][_0xd416('0x83')]){var _0x2cbf96=_[_0xd416('0x5e')](_0x511811[_0xd416('0x33')][_0xd416('0x83')])?_0x511811[_0xd416('0x33')][_0xd416('0x83')]:new Array(_0x511811[_0xd416('0x33')][_0xd416('0x83')]);var _0x24fd48=squel['expr']();_0x2cbf96[_0xd416('0x2e')](function(_0x5c23fe){_0x24fd48['or'](_0xd416('0x84'),'%,'+_0x5c23fe+',%');});_0x41a931[_0xd416('0x80')](_0x24fd48);_0x221f36[_0xd416('0x4b')](_0xd416('0x85'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x221f36[_0xd416('0x4b')]('tools_tags','t',_0xd416('0x86'));_0x221f36[_0xd416('0x3e')](_0xd416('0x87'),_0x2cbf96);}}else{var _0x25299f=JSON[_0xd416('0x70')](_0x511811[_0xd416('0x33')][_0xd416('0x53')]);_['keys'](_0x25299f)[_0xd416('0x2e')](function(_0x325b11){var _0x3623bc=_0x25299f[_0x325b11];if(_0x325b11==='TagId'){var _0x16a8da=_0x3623bc[_0xd416('0x55')];var _0x44a466=squel[_0xd416('0x52')]();_0x16a8da['forEach'](function(_0x119448){_0x44a466['or'](_0xd416('0x84'),'%,'+_0x119448+',%');});_0x41a931[_0xd416('0x80')](_0x44a466);_0x221f36[_0xd416('0x4b')](_0xd416('0x88'),'it',_0xd416('0x89'));_0x221f36['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x221f36[_0xd416('0x3e')](_0xd416('0x87'),_0x16a8da);}else if(_0x325b11===_0xd416('0x6b')){if(_0x3623bc['value'][_0xd416('0x39')]===0x1){if(_0x3623bc[_0xd416('0x55')][0x0]===0x1){_0x221f36['having'](_0xd416('0x81'));_0x41a931[_0xd416('0x80')](_0xd416('0x81'));}else{_0x221f36['having'](_0xd416('0x82'));_0x41a931[_0xd416('0x80')](_0xd416('0x82'));}}}});}db[_0xd416('0x8a')][_0xd416('0x33')](_0x221f36['toString'](),_0x5d6542)['then'](function(_0x539398){_0x245987[_0xd416('0x8b')]=_0x539398[_0xd416('0x39')];if(_0x245987[_0xd416('0x8b')]===0x0)return[];return db[_0xd416('0x8a')][_0xd416('0x33')](_0x46a00d[_0xd416('0x77')](),_0x5d6542)[_0xd416('0x26')](function(_0x503313){_0x553e31=_['keyBy'](_0x503313,'id');_0x5d6542=_['merge'](_0x5d6542,{'model':db[_0xd416('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x41a931[_0xd416('0x41')](_0xd416('0x7e'),_0xd416('0x6b'));_0x41a931[_0xd416('0x41')](_0xd416('0x8c'),_0xd416('0x8d'));_0x41a931[_0xd416('0x41')](_0xd416('0x8e'));_0x41a931['field'](_0xd416('0x65'),_0xd416('0x8f'));_0x41a931['field'](_0xd416('0x67'),_0xd416('0x90'));_0x41a931[_0xd416('0x41')](_0xd416('0x68'),_0xd416('0x91'));_0x41a931['field'](_0xd416('0x92'),_0xd416('0x93'));_0x41a931['field'](_0xd416('0x94'),_0xd416('0x95'));_0x41a931[_0xd416('0x41')](_0xd416('0x96'),_0xd416('0x97'));_0x41a931[_0xd416('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd416('0x2c'));_0x41a931[_0xd416('0x4b')](_0xd416('0x85'),'it',_0xd416('0x98'));_0x41a931[_0xd416('0x4b')](_0xd416('0x44'),'t',_0xd416('0x86'));_0x41a931[_0xd416('0x1f')](_0x3bc610[_0xd416('0x1f')]);_0x41a931[_0xd416('0x1e')](_0x3bc610['offset']);return db[_0xd416('0x8a')][_0xd416('0x33')](_0x41a931['toString'](),_0x5d6542);})['then'](function(_0x4e9f8d){_0x5ce99f[_0xd416('0x3e')](_0xd416('0x99'),_[_0xd416('0x6d')](_0x4e9f8d,'id'));return db[_0xd416('0x8a')][_0xd416('0x33')](_0x5ce99f[_0xd416('0x77')](),_0x5d6542)[_0xd416('0x26')](function(_0x548ebb){var _0x375329=_[_0xd416('0x9a')](_0x548ebb,_0xd416('0x9b'));var _0x446a28=[];_0x4e9f8d[_0xd416('0x2e')](function(_0x505aa4){_0x446a28['push'](updateOpenchannelInteraction(_0x505aa4,_0x553e31,_0x375329));});return BPromise[_0xd416('0x9c')](_0x446a28);});});})[_0xd416('0x26')](function(_0x3ba696){_0x245987[_0xd416('0x9d')]=_0x3ba696;return _0x245987;})[_0xd416('0x26')](respondWithFilteredResult(_0x16bf28,_0x3bc610))[_0xd416('0x2f')](handleError(_0x16bf28,null));};exports[_0xd416('0x9e')]=function(_0x575273,_0xd50152){var _0x1ac3ed={'raw':![],'where':{'id':_0x575273[_0xd416('0x9f')]['id']}},_0x358a0e={};_0x358a0e[_0xd416('0x36')]=_[_0xd416('0x32')](db['OpenchannelInteraction'][_0xd416('0x31')]);_0x358a0e['query']=_[_0xd416('0x32')](_0x575273[_0xd416('0x33')]);_0x358a0e[_0xd416('0x34')]=_[_0xd416('0x35')](_0x358a0e[_0xd416('0x36')],_0x358a0e[_0xd416('0x33')]);_0x1ac3ed[_0xd416('0x37')]=_[_0xd416('0x35')](_0x358a0e['model'],qs[_0xd416('0x38')](_0x575273[_0xd416('0x33')]['fields']));_0x1ac3ed[_0xd416('0x37')]=_0x1ac3ed[_0xd416('0x37')][_0xd416('0x39')]?_0x1ac3ed['attributes']:_0x358a0e[_0xd416('0x36')];if(_0x575273[_0xd416('0x33')][_0xd416('0xa0')]){_0x1ac3ed['include']=[{'all':!![]}];}_0x1ac3ed=_['merge']({},_0x1ac3ed,_0x575273[_0xd416('0xa1')]);return db['OpenchannelInteraction']['find'](_0x1ac3ed)[_0xd416('0x26')](handleEntityNotFound(_0xd50152,null))[_0xd416('0x26')](respondWithResult(_0xd50152,null))[_0xd416('0x2f')](handleError(_0xd50152,null));};exports['create']=function(_0x110cac,_0x186010){return db[_0xd416('0x30')]['create'](_0x110cac[_0xd416('0xa2')],{})[_0xd416('0x26')](respondWithResult(_0x186010,0xc9))[_0xd416('0x2f')](handleError(_0x186010,null));};exports[_0xd416('0x25')]=function(_0x5cdf00,_0x5e0d3a){if(_0x5cdf00['body']['id']){delete _0x5cdf00[_0xd416('0xa2')]['id'];}return db[_0xd416('0x30')][_0xd416('0xa3')]({'where':{'id':_0x5cdf00['params']['id']}})[_0xd416('0x26')](handleEntityNotFound(_0x5e0d3a,null))[_0xd416('0x26')](saveUpdates(_0x5cdf00[_0xd416('0xa2')],null))[_0xd416('0x26')](respondWithResult(_0x5e0d3a,null))[_0xd416('0x2f')](handleError(_0x5e0d3a,null));};exports[_0xd416('0x27')]=function(_0x3edcb5,_0x2847c9){return db[_0xd416('0x30')][_0xd416('0xa3')]({'where':{'id':_0x3edcb5[_0xd416('0x9f')]['id']}})[_0xd416('0x26')](handleEntityNotFound(_0x2847c9,null))[_0xd416('0x26')](removeEntity(_0x2847c9,null))[_0xd416('0x2f')](handleError(_0x2847c9,null));};exports['describe']=function(_0x42fcf1,_0x3bcb5f){return db[_0xd416('0x30')][_0xd416('0xa4')]()['then'](respondWithResult(_0x3bcb5f,null))[_0xd416('0x2f')](handleError(_0x3bcb5f,null));};exports[_0xd416('0xa5')]=function(_0x59877c,_0x4ea254,_0x95162e){return db[_0xd416('0xa6')][_0xd416('0xa3')]({'where':{'id':_0x59877c['params']['id']}})['then'](handleEntityNotFound(_0x4ea254,null))[_0xd416('0x26')](function(_0x26a16c){if(_0x26a16c){return _0x26a16c[_0xd416('0xa5')](_0x59877c['body']['ids'],_[_0xd416('0xa7')](_0x59877c[_0xd416('0xa2')],[_0xd416('0xa8'),'id'])||{});}})[_0xd416('0x26')](respondWithResult(_0x4ea254,null))[_0xd416('0x2f')](handleError(_0x4ea254,null));};exports['getMessages']=function(_0x4d29b4,_0x3d006a,_0x1051ab){var _0x2ea43d={'raw':![],'where':{}};var _0x164289={};var _0x4f5d82={'count':0x0,'rows':[]};return db[_0xd416('0x30')]['findOne']({'where':{'id':_0x4d29b4['params']['id']}})['then'](handleEntityNotFound(_0x3d006a,null))[_0xd416('0x26')](function(_0x1467e9){if(_0x1467e9){_0x164289[_0xd416('0x36')]=_['keys'](db[_0xd416('0xa6')]['rawAttributes']);_0x164289[_0xd416('0x33')]=_[_0xd416('0x32')](_0x4d29b4[_0xd416('0x33')]);_0x164289[_0xd416('0x34')]=_[_0xd416('0x35')](_0x164289[_0xd416('0x36')],_0x164289['query']);_0x2ea43d['attributes']=_[_0xd416('0x35')](_0x164289['model'],qs[_0xd416('0x38')](_0x4d29b4[_0xd416('0x33')][_0xd416('0x38')]));_0x2ea43d['attributes']=_0x2ea43d[_0xd416('0x37')]['length']?_0x2ea43d[_0xd416('0x37')]:_0x164289[_0xd416('0x36')];if(!_0x4d29b4[_0xd416('0x33')][_0xd416('0x3a')](_0xd416('0x3b'))){_0x2ea43d[_0xd416('0x1f')]=qs['limit'](_0x4d29b4[_0xd416('0x33')][_0xd416('0x1f')]);_0x2ea43d[_0xd416('0x1e')]=qs[_0xd416('0x1e')](_0x4d29b4['query'][_0xd416('0x1e')]);}_0x2ea43d[_0xd416('0x3c')]=qs['sort'](_0x4d29b4[_0xd416('0x33')][_0xd416('0x3d')]);_0x2ea43d[_0xd416('0x3e')]=qs[_0xd416('0x34')](_[_0xd416('0x3f')](_0x4d29b4[_0xd416('0x33')],_0x164289[_0xd416('0x34')]));_0x2ea43d[_0xd416('0x3e')][_0xd416('0x9b')]=_0x1467e9['id'];if(_0x4d29b4[_0xd416('0x33')][_0xd416('0x6e')]){_0x2ea43d['where']=_[_0xd416('0xa9')](_0x2ea43d[_0xd416('0x3e')],{'$or':_[_0xd416('0x6d')](_0x2ea43d['attributes'],function(_0x1a05fa){var _0x3a0b80={};_0x3a0b80[_0x1a05fa]={'$like':'%'+_0x4d29b4[_0xd416('0x33')][_0xd416('0x6e')]+'%'};return _0x3a0b80;})});}if(_0x4d29b4['query'][_0xd416('0xaa')]){var _0x289e2e=_0x4d29b4['query'][_0xd416('0xaa')]['split'](',');var _0x59a63e={};_0x59a63e[_0x289e2e[0x0]]={'$gte':moment(_0x289e2e[0x1])[_0xd416('0x5a')](_0xd416('0xab'))};_0x2ea43d[_0xd416('0x3e')]=_[_0xd416('0xa9')](_0x2ea43d[_0xd416('0x3e')],_0x59a63e);}_0x2ea43d=_['merge']({},_0x2ea43d,_0x4d29b4[_0xd416('0xa1')]);return db[_0xd416('0xa6')][_0xd416('0x8b')]({'where':_0x2ea43d[_0xd416('0x3e')]})[_0xd416('0x26')](function(_0x2039a0){_0x4f5d82[_0xd416('0x8b')]=_0x2039a0;if(_0x4d29b4[_0xd416('0x33')][_0xd416('0xa0')]){_0x2ea43d[_0xd416('0xac')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xd416('0xad')](_0x2ea43d);})[_0xd416('0x26')](function(_0x24b749){_0x4f5d82[_0xd416('0x9d')]=_0x24b749;return _0x4f5d82;});}})[_0xd416('0x26')](respondWithFilteredResult(_0x3d006a,_0x2ea43d))[_0xd416('0x2f')](handleError(_0x3d006a,null));};exports[_0xd416('0xae')]=function(_0x939421,_0x228e1c,_0x4827cf){return db[_0xd416('0x30')]['find']({'where':{'id':_0x939421[_0xd416('0x9f')]['id']}})['then'](handleEntityNotFound(_0x228e1c,null))[_0xd416('0x26')](function(_0x1f5538){if(_0x1f5538){return _0x1f5538[_0xd416('0xaf')](_0x939421[_0xd416('0xa2')][_0xd416('0xa8')],_[_0xd416('0xa7')](_0x939421[_0xd416('0xa2')],['ids','id'])||{})[_0xd416('0xb0')](function(){return db[_0xd416('0xb1')][_0xd416('0xad')]({'attributes':['id','name',_0xd416('0x42')],'where':{'id':_0x939421[_0xd416('0xa2')][_0xd416('0xa8')]}});})[_0xd416('0x26')](function(_0x2c65f8){socket[_0xd416('0xb2')](_0xd416('0xb3'),{'id':Number(_0x939421[_0xd416('0x9f')]['id']),'tags':_0x2c65f8||[]});return{'id':Number(_0x939421[_0xd416('0x9f')]['id']),'tags':_0x2c65f8||[]};});}})[_0xd416('0x26')](respondWithResult(_0x228e1c,null))[_0xd416('0x2f')](handleError(_0x228e1c,null));};exports['removeTags']=function(_0x2319ed,_0x16ed49,_0x35d49c){return db[_0xd416('0x30')]['find']({'where':{'id':_0x2319ed[_0xd416('0x9f')]['id']}})[_0xd416('0x26')](handleEntityNotFound(_0x16ed49,null))[_0xd416('0x26')](function(_0x11aa0c){if(_0x11aa0c){return _0x11aa0c[_0xd416('0xb4')](_0x2319ed['query']['ids']);}})['then'](respondWithStatusCode(_0x16ed49,null))[_0xd416('0x2f')](handleError(_0x16ed49,null));};exports[_0xd416('0xb5')]=function(_0x33e803,_0x439f13){var _0x585f59=moment()[_0xd416('0xb6')]()[_0xd416('0x77')]();var _0x3a1d3a=path['join'](config[_0xd416('0xb7')],_0xd416('0xb8'),'files',_0xd416('0xb9'));var _0x11a4c0=path['join'](config[_0xd416('0xb7')],_0xd416('0xb8'),'files','attachments');var _0x4b98ee=path['join'](_0x3a1d3a,_0x585f59);var _0x4d05dd=util['format'](_0xd416('0xba'),_0x33e803['params']['id'],_0x585f59);var _0x13b00e=path[_0xd416('0x78')](_0x3a1d3a,_0x4d05dd);var _0x1eea06=![];return db[_0xd416('0x30')][_0xd416('0xa3')]({'where':{'id':_0x33e803[_0xd416('0x9f')]['id']},'include':[{'model':db[_0xd416('0xa6')],'as':'Messages','attributes':['id',_0xd416('0xa2'),_0xd416('0x54'),'direction','secret'],'include':[{'model':db[_0xd416('0xbb')],'as':_0xd416('0xbb'),'attributes':['id',_0xd416('0xbc')],'raw':!![]},{'model':db['CmContact'],'as':_0xd416('0xbd'),'attributes':['id',_0xd416('0xbe'),_0xd416('0xbf')],'raw':!![]},{'model':db[_0xd416('0xc0')],'as':_0xd416('0xc0'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xd416('0x29')]},{'model':db[_0xd416('0xbb')],'as':_0xd416('0xc1'),'attributes':['id','fullname']}]})[_0xd416('0x26')](handleEntityNotFound(_0x439f13,null))['then'](function(_0x482171){if(_0x482171){var _0x52360c=_0x482171[_0xd416('0xc2')]({'plain':!![]});_0x1eea06=!![];var _0x18d777={'format':'A4','border':_0xd416('0xc3'),'header':{'height':_0xd416('0xc4'),'contents':{'first':_0xd416('0xc5')}},'footer':{'height':_0xd416('0xc6'),'contents':{'default':util[_0xd416('0x5a')]('\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20',util['format'](_0xd416('0xc7'),_0xd416('0xc8'),_0x52360c['id']),moment()['format'](_0xd416('0xc9'))['toString']())}}};fs[_0xd416('0xca')](_0x4b98ee);var _0x4bba2c={'channel':'Openchannel','account':_0x52360c['Account'][_0xd416('0x29')],'agent':_0x52360c[_0xd416('0xc1')]?_0x52360c[_0xd416('0xc1')][_0xd416('0xbc')]:_0xd416('0xcb'),'createdAt':moment(_0x52360c[_0xd416('0x54')])[_0xd416('0x5a')](_0xd416('0xab'))[_0xd416('0x77')](),'closedAt':_0x52360c[_0xd416('0xcc')]?moment(_0x52360c[_0xd416('0xcd')])[_0xd416('0x5a')](_0xd416('0xab'))['toString']():'','disposition':_0x52360c[_0xd416('0xce')],'visibility':_0x52360c[_0xd416('0xcf')]?'Public':'Private','messages':_(_0x52360c[_0xd416('0xd0')])[_0xd416('0x6e')]({'secret':![]})[_0xd416('0x6d')](function(_0x4aa88b){if(_0x4aa88b[_0xd416('0xc0')]){var _0x12f025=path[_0xd416('0x78')](_0x11a4c0,_0x4aa88b['Attachment'][_0xd416('0xd1')]);if(fs[_0xd416('0xd2')](_0x12f025)){fs[_0xd416('0xd3')](_0x12f025)[_0xd416('0xd4')](fs['createWriteStream'](path[_0xd416('0x78')](_0x4b98ee,_0x4aa88b[_0xd416('0xc0')][_0xd416('0xd1')])));}}return{'date':moment(_0x4aa88b['createdAt'])[_0xd416('0x5a')](_0xd416('0xab'))['toString'](),'sender':_0x4aa88b['direction']===_0xd416('0xd5')?_0x4aa88b[_0xd416('0xbb')]?_0x4aa88b['User'][_0xd416('0xbc')]:_0xd416('0xd6'):_0x4aa88b[_0xd416('0xbd')][_0xd416('0xbe')]+(_0x4aa88b[_0xd416('0xbd')][_0xd416('0xbf')]?'\x20'+_0x4aa88b[_0xd416('0xbd')][_0xd416('0xbf')]:''),'body':_0x4aa88b['Attachment']?_0x4aa88b[_0xd416('0xc0')][_0xd416('0xd1')]:_0x4aa88b[_0xd416('0xa2')],'direction':_0x4aa88b[_0xd416('0xd7')]==='out'?'A':'C','secret':_0x4aa88b['secret'],'attachment':_0x4aa88b[_0xd416('0xc0')]};})[_0xd416('0x55')]()};return ejs[_0xd416('0xd8')](path[_0xd416('0x78')](config[_0xd416('0xb7')],'server',_0xd416('0xd9'),'downloadInteraction.html'),{'interaction':_0x4bba2c})[_0xd416('0x26')](function(_0x27c323){return new BPromise(function(_0x5d4a19,_0x28ba57){pdf[_0xd416('0xda')](_0x27c323,_0x18d777)[_0xd416('0xdb')](path[_0xd416('0x78')](_0x4b98ee,'transcript-'+_0x52360c['id']+'-'+_0x585f59+'.pdf'),function(_0x6aea60,_0x460eed){if(_0x6aea60)return _0x28ba57(_0x6aea60);_0x5d4a19(_0x460eed);});});});}})[_0xd416('0x26')](function(){if(_0x1eea06){return new BPromise(function(_0x3cb29d,_0x31de5c){zipdir(_0x4b98ee,{'saveTo':_0x13b00e},function(_0xda56e6,_0x573384){if(_0xda56e6)return _0x31de5c(_0xda56e6);return _0x3cb29d(_0x573384);});})['then'](function(){return new BPromise(function(_0x5382f6,_0xb7f1d7){rimraf(_0x4b98ee,function(_0x16cce2){if(_0x16cce2)_0xb7f1d7(_0x16cce2);return _0x5382f6();});});})[_0xd416('0x26')](function(){return _0x439f13['download'](_0x13b00e,_0x4d05dd,function(_0x301a86){if(_0x301a86){console[_0xd416('0xdc')](_0xd416('0xdd'),_0x301a86);}else{fs[_0xd416('0xde')](_0x13b00e);}});});}else{return _0x439f13[_0xd416('0x1b')](0xc8);}})[_0xd416('0x2f')](handleError(_0x439f13,null));}; \ No newline at end of file +var _0xa023=['replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','QueryTypes','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','toString','merge','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','t.id\x20=\x20it.TagId','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','show','params','OpenchannelInteraction','rawAttributes','includeAll','include','options','find','catch','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','OpenchannelInteractionId','findAll','addTags','setTags','omit','spread','Tag','emit','removeTags','download','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','fullname','CmContact','Contact','firstName','Attachment','OpenchannelAccount','Account','User','Owner','get','10px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','out','System','lastName','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./openchannelInteraction.socket','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','map','Tags','TagIds','split','forEach','push','index','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','value','dateStart','startOf','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','unreadMessages','isArray','length','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.lastName','\x20LIKE\x20?','c.email','\x20<\x20?','LIKE','c.firstName','\x20>\x20?','hasOwnProperty','filter','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','$gte','$lte','null','\x20IS\x20NULL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa023,0x153));var _0x3a02=function(_0xb6cb9a,_0x5c64c9){_0xb6cb9a=_0xb6cb9a-0x0;var _0xcfbd02=_0xa023[_0xb6cb9a];return _0xcfbd02;};'use strict';var pdf=require(_0x3a02('0x0'));var emlformat=require(_0x3a02('0x1'));var rimraf=require(_0x3a02('0x2'));var zipdir=require(_0x3a02('0x3'));var jsonpatch=require(_0x3a02('0x4'));var rp=require(_0x3a02('0x5'));var moment=require(_0x3a02('0x6'));var BPromise=require(_0x3a02('0x7'));var Mustache=require(_0x3a02('0x8'));var util=require(_0x3a02('0x9'));var path=require(_0x3a02('0xa'));var sox=require(_0x3a02('0xb'));var csv=require(_0x3a02('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3a02('0xd'));var crypto=require(_0x3a02('0xe'));var jsforce=require(_0x3a02('0xf'));var deskjs=require(_0x3a02('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a02('0x11'));var authService=require(_0x3a02('0x12'));var qs=require(_0x3a02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a02('0x14'));var utils=require('../../config/utils');var config=require(_0x3a02('0x15'));var db=require(_0x3a02('0x16'))['db'];config[_0x3a02('0x17')]=_['defaults'](config[_0x3a02('0x17')],{'host':_0x3a02('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a02('0x17')]));require(_0x3a02('0x19'))['register'](socket);function respondWithStatusCode(_0x35d720,_0x25d368){_0x25d368=_0x25d368||0xcc;return function(_0x45ae74){if(_0x45ae74){return _0x35d720['sendStatus'](_0x25d368);}return _0x35d720[_0x3a02('0x1a')](_0x25d368)[_0x3a02('0x1b')]();};}function respondWithResult(_0x3eda07,_0x166292){_0x166292=_0x166292||0xc8;return function(_0x515a2e){if(_0x515a2e){return _0x3eda07['status'](_0x166292)['json'](_0x515a2e);}};}function respondWithFilteredResult(_0x576b4f,_0x137f11){return function(_0x48e42e){if(_0x48e42e){var _0x1ec6ee=_0x48e42e[_0x3a02('0x1c')],_0x5c9e5a=_0x137f11['offset'],_0x1ab7ad=_0x137f11[_0x3a02('0x1d')]+_0x137f11[_0x3a02('0x1e')],_0x45ea4d;if(_0x1ab7ad>=_0x1ec6ee){_0x1ab7ad=_0x1ec6ee;_0x45ea4d=0xc8;}else{_0x45ea4d=0xce;}_0x576b4f[_0x3a02('0x1a')](_0x45ea4d);return _0x576b4f[_0x3a02('0x1f')](_0x3a02('0x20'),_0x5c9e5a+'-'+_0x1ab7ad+'/'+_0x1ec6ee)['json'](_0x48e42e);}return null;};}function patchUpdates(_0x316ca8){return function(_0x26a179){try{jsonpatch[_0x3a02('0x21')](_0x26a179,_0x316ca8,!![]);}catch(_0x47be6e){return BPromise[_0x3a02('0x22')](_0x47be6e);}return _0x26a179[_0x3a02('0x23')]();};}function saveUpdates(_0x5f4bbe,_0x52b001){return function(_0xa0b73d){if(_0xa0b73d){return _0xa0b73d[_0x3a02('0x24')](_0x5f4bbe)[_0x3a02('0x25')](function(_0x495fc3){return _0x495fc3;});}return null;};}function removeEntity(_0x20eb0f,_0x43b655){return function(_0x51d64a){if(_0x51d64a){return _0x51d64a[_0x3a02('0x26')]()[_0x3a02('0x25')](function(){_0x20eb0f[_0x3a02('0x1a')](0xcc)[_0x3a02('0x1b')]();});}};}function handleEntityNotFound(_0x56954f,_0x2e3488){return function(_0x29d71d){if(!_0x29d71d){_0x56954f[_0x3a02('0x27')](0x194);}return _0x29d71d;};}function handleError(_0x1b2d66,_0x332aa2){_0x332aa2=_0x332aa2||0x1f4;return function(_0x1335d9){logger['error'](_0x1335d9['stack']);if(_0x1335d9[_0x3a02('0x28')]){delete _0x1335d9[_0x3a02('0x28')];}_0x1b2d66[_0x3a02('0x1a')](_0x332aa2)['send'](_0x1335d9);};}function getInteractionUsers(_0x1b22fe,_0x52a349){return new BPromise(function(_0x146fa3,_0x5c439b){try{if(_0x52a349[_0x1b22fe['id']]){_0x1b22fe['Users']=_[_0x3a02('0x29')](_0x52a349[_0x1b22fe['id']],function(_0x54af69){return{'id':_0x54af69['id']};});}}catch(_0x8ce5c9){_0x5c439b(_0x8ce5c9);}_0x146fa3(_0x1b22fe);});}function getInteractionTags(_0x109c90,_0x1b19bd){return new BPromise(function(_0x1e0446,_0x16547e){try{if(_0x109c90['TagIds']){_0x109c90[_0x3a02('0x2a')]=[];_0x109c90[_0x3a02('0x2b')][_0x3a02('0x2c')](',')[_0x3a02('0x2d')](function(_0x344456){_0x109c90[_0x3a02('0x2a')][_0x3a02('0x2e')](_0x1b19bd[_0x344456]);});}delete _0x109c90[_0x3a02('0x2b')];}catch(_0x75e4f){_0x16547e(_0x75e4f);}_0x1e0446(_0x109c90);});}function updateOpenchannelInteraction(_0x1ddfd2,_0x53a37f,_0x309eb1){return new BPromise(function(_0x198704,_0x149064){return getInteractionUsers(_0x1ddfd2,_0x309eb1)[_0x3a02('0x25')](function(_0x21bdb0){return getInteractionTags(_0x21bdb0,_0x53a37f);})[_0x3a02('0x25')](function(_0x3a6c85){_0x198704(_0x3a6c85);})['catch'](function(_0x4df04c){_0x149064(_0x4df04c);});});}exports[_0x3a02('0x2f')]=function(_0x3c495,_0x496828){var _0x9d3185={},_0x1aa84c={},_0x18de81={'count':0x0,'rows':[]};var _0x5182b0=db['OpenchannelInteraction']['rawAttributes'];_0x1aa84c[_0x3a02('0x30')]=_[_0x3a02('0x31')](_0x5182b0);_0x1aa84c[_0x3a02('0x32')]=_[_0x3a02('0x31')](_0x3c495[_0x3a02('0x32')]);_0x1aa84c[_0x3a02('0x33')]=_[_0x3a02('0x34')](_0x1aa84c[_0x3a02('0x30')],_0x1aa84c[_0x3a02('0x32')]);_0x9d3185[_0x3a02('0x35')]=_[_0x3a02('0x34')](_0x1aa84c[_0x3a02('0x30')],qs[_0x3a02('0x36')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x36')]));_0x9d3185['attributes']=_0x9d3185[_0x3a02('0x35')]['length']?_0x9d3185[_0x3a02('0x35')]:_0x1aa84c['model'];if(!_0x3c495[_0x3a02('0x32')]['hasOwnProperty'](_0x3a02('0x37'))){_0x9d3185[_0x3a02('0x1e')]=qs[_0x3a02('0x1e')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x1e')]);_0x9d3185['offset']=qs[_0x3a02('0x1d')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x1d')]);}_0x9d3185['order']=qs[_0x3a02('0x38')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x38')]);_0x9d3185[_0x3a02('0x39')]=qs[_0x3a02('0x33')](_[_0x3a02('0x3a')](_0x3c495[_0x3a02('0x32')],_0x1aa84c[_0x3a02('0x33')]));var _0x15b2de=[];var _0x21f9ab=squel[_0x3a02('0x3b')]()[_0x3a02('0x3c')]('id')[_0x3a02('0x3c')](_0x3a02('0x28'))[_0x3a02('0x3c')](_0x3a02('0x3d'))[_0x3a02('0x3e')](_0x3a02('0x3f'));var _0x257366=squel[_0x3a02('0x3b')]()[_0x3a02('0x3c')](_0x3a02('0x40'))['from']('openchannel_messages','me')[_0x3a02('0x39')](_0x3a02('0x41'))[_0x3a02('0x39')](_0x3a02('0x42'))[_0x3a02('0x39')](_0x3a02('0x43'));var _0x44d436=squel[_0x3a02('0x3b')]()['field']('u.id')[_0x3a02('0x3c')](_0x3a02('0x44'))[_0x3a02('0x3e')](_0x3a02('0x45'),'ui')[_0x3a02('0x46')]('users','u',_0x3a02('0x47'));var _0x15f621=squel[_0x3a02('0x3b')]()['from'](_0x3a02('0x48'),'i')[_0x3a02('0x46')](_0x3a02('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3a02('0x46')](_0x3a02('0x4a'),'o',_0x3a02('0x4b'))[_0x3a02('0x46')]('openchannel_accounts','a',_0x3a02('0x4c'))[_0x3a02('0x46')](_0x3a02('0x4d'),'me',_0x3a02('0x4e'));var _0x1424b4=squel[_0x3a02('0x4f')]();if(_0x3c495['query'][_0x3a02('0x50')]){var _0x26e20b=JSON[_0x3a02('0x51')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x50')]);_[_0x3a02('0x31')](_0x26e20b)['forEach'](function(_0x1c8d21){var _0x4b511d=_0x26e20b[_0x1c8d21];if(_0x1c8d21==='createdAt'){var _0xf5301f=moment(_0x4b511d[_0x3a02('0x52')][_0x3a02('0x53')])[_0x3a02('0x54')]('day')['utc']()[_0x3a02('0x55')]();var _0x4fd6a7=moment(_0x4fd6a7)[_0x3a02('0x56')]()[_0x3a02('0x57')]('day')[_0x3a02('0x55')]();_0x1424b4[_0x3a02('0x58')](_0x3a02('0x59'),_0xf5301f,_0x4fd6a7);}else{if(_['isArray'](_0x4b511d['condition'])){_0x4b511d[_0x3a02('0x5a')][_0x3a02('0x2d')](function(_0x658c8f){switch(_0x4b511d['condition']['value']){case'IS':if(_0x1c8d21!==_0x3a02('0x5b')&&_0x1c8d21!==_0x3a02('0x5c')){if(_[_0x3a02('0x5d')](_0x4b511d[_0x3a02('0x52')])&&_0x4b511d[_0x3a02('0x52')][_0x3a02('0x5e')]>0x1){_0x1424b4[_0x3a02('0x58')](_0x4b511d['tableAlias']+'.'+_0x1c8d21+_0x3a02('0x5f'),_0x4b511d[_0x3a02('0x52')]);}else{_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+_0x3a02('0x61'),_0x4b511d['value'][0x0]);}}break;case'=':_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+_0x3a02('0x61'),_0x4b511d[_0x3a02('0x52')]);break;case'LIKE':if(_0x1c8d21===_0x3a02('0x62')){_0x1424b4[_0x3a02('0x58')]('c.firstName'+'\x20LIKE\x20?','%'+_0x4b511d['value']+'%');_0x1424b4['or'](_0x3a02('0x63')+_0x3a02('0x64'),'%'+_0x4b511d['value']+'%');_0x1424b4['or'](_0x3a02('0x65')+'\x20LIKE\x20?','%'+_0x4b511d[_0x3a02('0x52')]+'%');}else{_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+_0x3a02('0x64'),'%'+_0x4b511d['value']+'%');}break;case'>':_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+'\x20>\x20?',_0x4b511d[_0x3a02('0x52')]);break;case'<':_0x1424b4['and'](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+_0x3a02('0x66'),_0x4b511d[_0x3a02('0x52')]);break;}});}else{switch(_0x4b511d[_0x3a02('0x5a')][_0x3a02('0x52')]){case'IS':if(_0x1c8d21!==_0x3a02('0x5b')&&_0x1c8d21!=='unreadMessages'){if(_[_0x3a02('0x5d')](_0x4b511d[_0x3a02('0x52')])&&_0x4b511d['value'][_0x3a02('0x5e')]>0x1){_0x1424b4[_0x3a02('0x58')](_0x4b511d['tableAlias']+'.'+_0x1c8d21+_0x3a02('0x5f'),_0x4b511d[_0x3a02('0x52')]);}else{_0x1424b4['and'](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+'\x20=\x20?',_0x4b511d['value'][0x0]);}}break;case'=':_0x1424b4[_0x3a02('0x58')](_0x4b511d['tableAlias']+'.'+_0x1c8d21+_0x3a02('0x61'),_0x4b511d['value']);break;case _0x3a02('0x67'):if(_0x1c8d21===_0x3a02('0x62')){_0x1424b4[_0x3a02('0x58')](_0x3a02('0x68')+_0x3a02('0x64'),'%'+_0x4b511d[_0x3a02('0x52')]+'%');_0x1424b4['or'](_0x3a02('0x63')+_0x3a02('0x64'),'%'+_0x4b511d[_0x3a02('0x52')]+'%');_0x1424b4['or'](_0x3a02('0x65')+_0x3a02('0x64'),'%'+_0x4b511d['value']+'%');}else{_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+'\x20LIKE\x20?','%'+_0x4b511d[_0x3a02('0x52')]+'%');}break;case'>':_0x1424b4['and'](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+_0x3a02('0x69'),_0x4b511d[_0x3a02('0x52')]);break;case'<':_0x1424b4[_0x3a02('0x58')](_0x4b511d[_0x3a02('0x60')]+'.'+_0x1c8d21+'\x20<\x20?',_0x4b511d['value']);break;}}}});}else{var _0x5801ca=_(Object[_0x3a02('0x31')](_0x3c495['query']))['map'](function(_0x4e1158){return _0x5182b0[_0x3a02('0x6a')](_0x4e1158)?_0x4e1158:undefined;})[_0x3a02('0x6b')](function(_0x3cc3a4){return!_[_0x3a02('0x6c')](_0x3cc3a4);})[_0x3a02('0x52')]();if(!_[_0x3a02('0x6d')](_0x5801ca)){_0x5801ca[_0x3a02('0x2d')](function(_0x5345ec){if(_0x5345ec==='OpenchannelAccountId'){_0x15f621[_0x3a02('0x39')](_0x3a02('0x6e'),[]['concat'](_0x3c495[_0x3a02('0x32')][_0x5345ec]));}else if(_0x5345ec==='createdAt'){var _0x2c6870=JSON[_0x3a02('0x51')](_0x3c495[_0x3a02('0x32')][_0x5345ec])[_0x3a02('0x6f')];var _0x4e9428=JSON[_0x3a02('0x51')](_0x3c495['query'][_0x5345ec])[_0x3a02('0x70')];_0x15f621[_0x3a02('0x39')](_0x3a02('0x59'),_0x2c6870,_0x4e9428);}else{if(_0x3c495[_0x3a02('0x32')][_0x5345ec]===_0x3a02('0x71')){_0x15f621[_0x3a02('0x39')]('i.'+_0x5345ec+_0x3a02('0x72'));}else{_0x15f621[_0x3a02('0x39')]('i.'+_0x5345ec+_0x3a02('0x61'),_0x3c495['query'][_0x5345ec]);}}});}if(_0x3c495[_0x3a02('0x32')][_0x3a02('0x6b')]){var _0x5cecd6=_0x3c495[_0x3a02('0x32')][_0x3a02('0x6b')][_0x3a02('0x73')]('\x5c','\x5c\x5c')[_0x3a02('0x73')]('\x27\x27',_0x3a02('0x74'));if(qs['isNumeric'](_0x5cecd6)){_0x1424b4['or'](_0x3a02('0x75'),_0x5cecd6+'%');}else{var _0x35f449=[];_0x5cecd6[_0x3a02('0x2c')]('\x20')[_0x3a02('0x2d')](function(_0xc3d368){_0x35f449[_0x3a02('0x2e')]('+'+_0xc3d368['toString']());});var _0x5ccf50=_0x35f449[_0x3a02('0x76')]('\x20');_0x1424b4['or'](_0x3a02('0x77'),_0x5ccf50)['or']('i.from\x20LIKE\x20?',_0x5cecd6+'%')['or'](_0x3a02('0x78'),_0x5cecd6+'%');}}}_0x15f621[_0x3a02('0x39')](_0x1424b4);if(_0x9d3185[_0x3a02('0x79')]){_0x9d3185[_0x3a02('0x79')][_0x3a02('0x2d')](function(_0x50c89d){_0x15f621[_0x3a02('0x79')]('i.'+_0x50c89d[0x0],_0x50c89d[0x1]===_0x3a02('0x7a')?![]:!![]);});}_0x15f621[_0x3a02('0x7b')](_0x3a02('0x7c'));var _0x22b689={'type':db[_0x3a02('0x7d')][_0x3a02('0x7e')]['SELECT'],'raw':!![]};var _0x11d58b=_0x15f621['clone']()[_0x3a02('0x3c')](_0x3a02('0x40'))['field'](_0x3a02('0x7f'),_0x3a02('0x5c'));if(!_0x3c495[_0x3a02('0x32')]['advancedFilter']){if(_0x3c495[_0x3a02('0x32')][_0x3a02('0x80')]){if(_0x3c495[_0x3a02('0x32')]['read']==0x1){_0x11d58b[_0x3a02('0x81')](_0x3a02('0x82'));_0x15f621[_0x3a02('0x81')]('`unreadMessages`\x20=\x200');}else{_0x11d58b['having'](_0x3a02('0x83'));_0x15f621[_0x3a02('0x81')](_0x3a02('0x83'));}}if(_0x3c495['query'][_0x3a02('0x84')]){var _0x455006=_['isArray'](_0x3c495['query'][_0x3a02('0x84')])?_0x3c495[_0x3a02('0x32')][_0x3a02('0x84')]:new Array(_0x3c495['query']['tag']);var _0x498e52=squel[_0x3a02('0x4f')]();_0x455006[_0x3a02('0x2d')](function(_0x2ac664){_0x498e52['or'](_0x3a02('0x85'),'%,'+_0x2ac664+',%');});_0x15f621['having'](_0x498e52);_0x11d58b['left_join'](_0x3a02('0x86'),'it',_0x3a02('0x87'));_0x11d58b[_0x3a02('0x46')](_0x3a02('0x3f'),'t','t.id\x20=\x20it.TagId');_0x11d58b[_0x3a02('0x39')](_0x3a02('0x88'),_0x455006);}}else{var _0x26e20b=JSON[_0x3a02('0x51')](_0x3c495[_0x3a02('0x32')][_0x3a02('0x50')]);_[_0x3a02('0x31')](_0x26e20b)['forEach'](function(_0x527549){var _0x443d61=_0x26e20b[_0x527549];if(_0x527549==='TagId'){var _0x1d141d=_0x443d61['value'];var _0x577529=squel['expr']();_0x1d141d[_0x3a02('0x2d')](function(_0x592904){_0x577529['or'](_0x3a02('0x85'),'%,'+_0x592904+',%');});_0x15f621[_0x3a02('0x81')](_0x577529);_0x11d58b[_0x3a02('0x46')](_0x3a02('0x89'),'it','it.MailInteractionId\x20=\x20i.id');_0x11d58b[_0x3a02('0x46')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x11d58b[_0x3a02('0x39')]('t.id\x20IN\x20?',_0x1d141d);}else if(_0x527549==='unreadMessages'){if(_0x443d61['value'][_0x3a02('0x5e')]===0x1){if(_0x443d61[_0x3a02('0x52')][0x0]===0x1){_0x11d58b['having'](_0x3a02('0x82'));_0x15f621[_0x3a02('0x81')]('`unreadMessages`\x20=\x200');}else{_0x11d58b[_0x3a02('0x81')](_0x3a02('0x83'));_0x15f621[_0x3a02('0x81')](_0x3a02('0x83'));}}}});}db[_0x3a02('0x8a')]['query'](_0x11d58b[_0x3a02('0x8b')](),_0x22b689)[_0x3a02('0x25')](function(_0x43c5a4){_0x18de81[_0x3a02('0x1c')]=_0x43c5a4['length'];if(_0x18de81[_0x3a02('0x1c')]===0x0)return[];return db['sequelize'][_0x3a02('0x32')](_0x21f9ab[_0x3a02('0x8b')](),_0x22b689)[_0x3a02('0x25')](function(_0x599a24){_0x15b2de=_['keyBy'](_0x599a24,'id');_0x22b689=_[_0x3a02('0x8c')](_0x22b689,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x15f621[_0x3a02('0x3c')](_0x3a02('0x7f'),'unreadMessages');_0x15f621[_0x3a02('0x3c')]('a.key',_0x3a02('0x8d'));_0x15f621['field'](_0x3a02('0x8e'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x68'),_0x3a02('0x8f'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x63'),_0x3a02('0x90'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x65'),_0x3a02('0x91'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x92'),_0x3a02('0x93'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x94'),_0x3a02('0x95'));_0x15f621[_0x3a02('0x3c')]('c.fax',_0x3a02('0x96'));_0x15f621[_0x3a02('0x3c')](_0x3a02('0x97'),_0x3a02('0x2b'));_0x15f621['left_join'](_0x3a02('0x86'),'it','it.OpenchannelInteractionId\x20=\x20i.id');_0x15f621['left_join'](_0x3a02('0x3f'),'t',_0x3a02('0x98'));_0x15f621[_0x3a02('0x1e')](_0x9d3185['limit']);_0x15f621[_0x3a02('0x1d')](_0x9d3185[_0x3a02('0x1d')]);return db['sequelize'][_0x3a02('0x32')](_0x15f621[_0x3a02('0x8b')](),_0x22b689);})[_0x3a02('0x25')](function(_0x2965c2){_0x44d436[_0x3a02('0x39')](_0x3a02('0x99'),_['map'](_0x2965c2,'id'));return db[_0x3a02('0x8a')][_0x3a02('0x32')](_0x44d436[_0x3a02('0x8b')](),_0x22b689)['then'](function(_0x2d56c2){var _0x5b3b98=_[_0x3a02('0x9a')](_0x2d56c2,'OpenchannelInteractionId');var _0x45c421=[];_0x2965c2[_0x3a02('0x2d')](function(_0x85ac0c){_0x45c421[_0x3a02('0x2e')](updateOpenchannelInteraction(_0x85ac0c,_0x15b2de,_0x5b3b98));});return BPromise['all'](_0x45c421);});});})['then'](function(_0x57e232){_0x18de81[_0x3a02('0x9b')]=_0x57e232;return _0x18de81;})[_0x3a02('0x25')](respondWithFilteredResult(_0x496828,_0x9d3185))['catch'](handleError(_0x496828,null));};exports[_0x3a02('0x9c')]=function(_0x3b439d,_0x2ad53e){var _0xf6e4b5={'raw':![],'where':{'id':_0x3b439d[_0x3a02('0x9d')]['id']}},_0xa3895a={};_0xa3895a[_0x3a02('0x30')]=_[_0x3a02('0x31')](db[_0x3a02('0x9e')][_0x3a02('0x9f')]);_0xa3895a[_0x3a02('0x32')]=_[_0x3a02('0x31')](_0x3b439d['query']);_0xa3895a['filters']=_['intersection'](_0xa3895a[_0x3a02('0x30')],_0xa3895a[_0x3a02('0x32')]);_0xf6e4b5[_0x3a02('0x35')]=_[_0x3a02('0x34')](_0xa3895a[_0x3a02('0x30')],qs[_0x3a02('0x36')](_0x3b439d[_0x3a02('0x32')][_0x3a02('0x36')]));_0xf6e4b5['attributes']=_0xf6e4b5[_0x3a02('0x35')][_0x3a02('0x5e')]?_0xf6e4b5[_0x3a02('0x35')]:_0xa3895a['model'];if(_0x3b439d[_0x3a02('0x32')][_0x3a02('0xa0')]){_0xf6e4b5[_0x3a02('0xa1')]=[{'all':!![]}];}_0xf6e4b5=_[_0x3a02('0x8c')]({},_0xf6e4b5,_0x3b439d[_0x3a02('0xa2')]);return db[_0x3a02('0x9e')][_0x3a02('0xa3')](_0xf6e4b5)[_0x3a02('0x25')](handleEntityNotFound(_0x2ad53e,null))[_0x3a02('0x25')](respondWithResult(_0x2ad53e,null))[_0x3a02('0xa4')](handleError(_0x2ad53e,null));};exports[_0x3a02('0xa5')]=function(_0x27ec04,_0x1bada0){return db[_0x3a02('0x9e')][_0x3a02('0xa5')](_0x27ec04['body'],{})[_0x3a02('0x25')](respondWithResult(_0x1bada0,0xc9))[_0x3a02('0xa4')](handleError(_0x1bada0,null));};exports[_0x3a02('0x24')]=function(_0xd4e6e5,_0x56bcef){if(_0xd4e6e5[_0x3a02('0xa6')]['id']){delete _0xd4e6e5['body']['id'];}return db[_0x3a02('0x9e')][_0x3a02('0xa3')]({'where':{'id':_0xd4e6e5['params']['id']}})['then'](handleEntityNotFound(_0x56bcef,null))['then'](saveUpdates(_0xd4e6e5[_0x3a02('0xa6')],null))[_0x3a02('0x25')](respondWithResult(_0x56bcef,null))['catch'](handleError(_0x56bcef,null));};exports[_0x3a02('0x26')]=function(_0x2bdb67,_0x914074){return db['OpenchannelInteraction'][_0x3a02('0xa3')]({'where':{'id':_0x2bdb67[_0x3a02('0x9d')]['id']}})[_0x3a02('0x25')](handleEntityNotFound(_0x914074,null))[_0x3a02('0x25')](removeEntity(_0x914074,null))[_0x3a02('0xa4')](handleError(_0x914074,null));};exports[_0x3a02('0xa7')]=function(_0x227084,_0x336b53){return db[_0x3a02('0x9e')][_0x3a02('0xa7')]()[_0x3a02('0x25')](respondWithResult(_0x336b53,null))[_0x3a02('0xa4')](handleError(_0x336b53,null));};exports[_0x3a02('0xa8')]=function(_0xc363b0,_0x5a3277,_0x27e7f5){return db[_0x3a02('0xa9')][_0x3a02('0xa3')]({'where':{'id':_0xc363b0[_0x3a02('0x9d')]['id']}})[_0x3a02('0x25')](handleEntityNotFound(_0x5a3277,null))[_0x3a02('0x25')](function(_0x46aee1){if(_0x46aee1){return _0x46aee1[_0x3a02('0xa8')](_0xc363b0['body']['ids'],_['omit'](_0xc363b0[_0x3a02('0xa6')],[_0x3a02('0xaa'),'id'])||{});}})['then'](respondWithResult(_0x5a3277,null))['catch'](handleError(_0x5a3277,null));};exports[_0x3a02('0xab')]=function(_0x53746a,_0xc2c6e2,_0x2b29a1){var _0x428b9d={'raw':![],'where':{}};var _0x3eef20={};var _0x1ee888={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x53746a['params']['id']}})[_0x3a02('0x25')](handleEntityNotFound(_0xc2c6e2,null))['then'](function(_0x38d75f){if(_0x38d75f){_0x3eef20['model']=_[_0x3a02('0x31')](db['OpenchannelMessage']['rawAttributes']);_0x3eef20[_0x3a02('0x32')]=_[_0x3a02('0x31')](_0x53746a[_0x3a02('0x32')]);_0x3eef20[_0x3a02('0x33')]=_[_0x3a02('0x34')](_0x3eef20[_0x3a02('0x30')],_0x3eef20[_0x3a02('0x32')]);_0x428b9d[_0x3a02('0x35')]=_[_0x3a02('0x34')](_0x3eef20[_0x3a02('0x30')],qs[_0x3a02('0x36')](_0x53746a[_0x3a02('0x32')][_0x3a02('0x36')]));_0x428b9d[_0x3a02('0x35')]=_0x428b9d['attributes'][_0x3a02('0x5e')]?_0x428b9d[_0x3a02('0x35')]:_0x3eef20[_0x3a02('0x30')];if(!_0x53746a[_0x3a02('0x32')][_0x3a02('0x6a')](_0x3a02('0x37'))){_0x428b9d['limit']=qs[_0x3a02('0x1e')](_0x53746a[_0x3a02('0x32')][_0x3a02('0x1e')]);_0x428b9d['offset']=qs[_0x3a02('0x1d')](_0x53746a[_0x3a02('0x32')][_0x3a02('0x1d')]);}_0x428b9d['order']=qs[_0x3a02('0x38')](_0x53746a[_0x3a02('0x32')]['sort']);_0x428b9d[_0x3a02('0x39')]=qs[_0x3a02('0x33')](_[_0x3a02('0x3a')](_0x53746a[_0x3a02('0x32')],_0x3eef20['filters']));_0x428b9d[_0x3a02('0x39')][_0x3a02('0xac')]=_0x38d75f['id'];if(_0x53746a[_0x3a02('0x32')][_0x3a02('0x6b')]){_0x428b9d[_0x3a02('0x39')]=_[_0x3a02('0x8c')](_0x428b9d['where'],{'$or':_['map'](_0x428b9d['attributes'],function(_0x4d74fa){var _0x36c00f={};_0x36c00f[_0x4d74fa]={'$like':'%'+_0x53746a[_0x3a02('0x32')][_0x3a02('0x6b')]+'%'};return _0x36c00f;})});}if(_0x53746a[_0x3a02('0x32')][_0x3a02('0x6f')]){var _0x45db26=_0x53746a[_0x3a02('0x32')][_0x3a02('0x6f')][_0x3a02('0x2c')](',');var _0x375b68={};_0x375b68[_0x45db26[0x0]]={'$gte':moment(_0x45db26[0x1])[_0x3a02('0x55')]('YYYY-MM-DD\x20HH:mm:ss')};_0x428b9d[_0x3a02('0x39')]=_['merge'](_0x428b9d['where'],_0x375b68);}_0x428b9d=_[_0x3a02('0x8c')]({},_0x428b9d,_0x53746a[_0x3a02('0xa2')]);return db['OpenchannelMessage'][_0x3a02('0x1c')]({'where':_0x428b9d[_0x3a02('0x39')]})[_0x3a02('0x25')](function(_0xdd6d12){_0x1ee888[_0x3a02('0x1c')]=_0xdd6d12;if(_0x53746a[_0x3a02('0x32')][_0x3a02('0xa0')]){_0x428b9d[_0x3a02('0xa1')]=[{'all':!![]}];}return db[_0x3a02('0xa9')][_0x3a02('0xad')](_0x428b9d);})['then'](function(_0x2a3686){_0x1ee888[_0x3a02('0x9b')]=_0x2a3686;return _0x1ee888;});}})[_0x3a02('0x25')](respondWithFilteredResult(_0xc2c6e2,_0x428b9d))[_0x3a02('0xa4')](handleError(_0xc2c6e2,null));};exports[_0x3a02('0xae')]=function(_0x2186f3,_0x287d53,_0xa3bb2f){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2186f3[_0x3a02('0x9d')]['id']}})[_0x3a02('0x25')](handleEntityNotFound(_0x287d53,null))['then'](function(_0x389d2e){if(_0x389d2e){return _0x389d2e[_0x3a02('0xaf')](_0x2186f3[_0x3a02('0xa6')][_0x3a02('0xaa')],_[_0x3a02('0xb0')](_0x2186f3[_0x3a02('0xa6')],[_0x3a02('0xaa'),'id'])||{})[_0x3a02('0xb1')](function(){return db[_0x3a02('0xb2')][_0x3a02('0xad')]({'attributes':['id',_0x3a02('0x28'),_0x3a02('0x3d')],'where':{'id':_0x2186f3[_0x3a02('0xa6')]['ids']}});})[_0x3a02('0x25')](function(_0x321cf9){socket[_0x3a02('0xb3')]('openchannelInteractionTags:save',{'id':Number(_0x2186f3['params']['id']),'tags':_0x321cf9||[]});return{'id':Number(_0x2186f3[_0x3a02('0x9d')]['id']),'tags':_0x321cf9||[]};});}})[_0x3a02('0x25')](respondWithResult(_0x287d53,null))[_0x3a02('0xa4')](handleError(_0x287d53,null));};exports['removeTags']=function(_0x4f9696,_0x1bfb20,_0x2d2b49){return db[_0x3a02('0x9e')][_0x3a02('0xa3')]({'where':{'id':_0x4f9696['params']['id']}})['then'](handleEntityNotFound(_0x1bfb20,null))[_0x3a02('0x25')](function(_0x259ea2){if(_0x259ea2){return _0x259ea2[_0x3a02('0xb4')](_0x4f9696[_0x3a02('0x32')][_0x3a02('0xaa')]);}})['then'](respondWithStatusCode(_0x1bfb20,null))[_0x3a02('0xa4')](handleError(_0x1bfb20,null));};exports[_0x3a02('0xb5')]=function(_0x44df81,_0x2331e6){var _0x5be148=moment()[_0x3a02('0xb6')]()[_0x3a02('0x8b')]();var _0x5e7295=path['join'](config[_0x3a02('0xb7')],_0x3a02('0xb8'),_0x3a02('0xb9'),_0x3a02('0xba'));var _0x56c1c4=path['join'](config[_0x3a02('0xb7')],_0x3a02('0xb8'),'files',_0x3a02('0xbb'));var _0x3e04b6=path[_0x3a02('0x76')](_0x5e7295,_0x5be148);var _0x5c45b0=util[_0x3a02('0x55')](_0x3a02('0xbc'),_0x44df81['params']['id'],_0x5be148);var _0x367d32=path['join'](_0x5e7295,_0x5c45b0);var _0x335a74=![];return db['OpenchannelInteraction'][_0x3a02('0xa3')]({'where':{'id':_0x44df81[_0x3a02('0x9d')]['id']},'include':[{'model':db['OpenchannelMessage'],'as':_0x3a02('0xbd'),'attributes':['id',_0x3a02('0xa6'),'createdAt',_0x3a02('0xbe'),_0x3a02('0xbf')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0x3a02('0xc0')],'raw':!![]},{'model':db[_0x3a02('0xc1')],'as':_0x3a02('0xc2'),'attributes':['id',_0x3a02('0xc3'),'lastName'],'raw':!![]},{'model':db[_0x3a02('0xc4')],'as':'Attachment','raw':!![]}]},{'model':db[_0x3a02('0xc5')],'as':_0x3a02('0xc6'),'attributes':['id',_0x3a02('0x28')]},{'model':db[_0x3a02('0xc7')],'as':_0x3a02('0xc8'),'attributes':['id','fullname']}]})[_0x3a02('0x25')](handleEntityNotFound(_0x2331e6,null))['then'](function(_0x14b53d){if(_0x14b53d){var _0x28e80f=_0x14b53d[_0x3a02('0xc9')]({'plain':!![]});_0x335a74=!![];var _0x427bb7={'format':'A4','border':_0x3a02('0xca'),'header':{'height':'40px','contents':{'first':_0x3a02('0xcb')}},'footer':{'height':'30px','contents':{'default':util[_0x3a02('0x55')]('\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20',util[_0x3a02('0x55')](_0x3a02('0xcc'),_0x3a02('0xcd'),_0x28e80f['id']),moment()[_0x3a02('0x55')](_0x3a02('0xce'))[_0x3a02('0x8b')]())}}};fs[_0x3a02('0xcf')](_0x3e04b6);var _0x17c02c={'channel':_0x3a02('0xcd'),'account':_0x28e80f[_0x3a02('0xc6')]['name'],'agent':_0x28e80f['Owner']?_0x28e80f[_0x3a02('0xc8')][_0x3a02('0xc0')]:'N.A.','createdAt':moment(_0x28e80f[_0x3a02('0xd0')])[_0x3a02('0x55')](_0x3a02('0xd1'))[_0x3a02('0x8b')](),'closedAt':_0x28e80f['closed']?moment(_0x28e80f[_0x3a02('0xd2')])['format'](_0x3a02('0xd1'))[_0x3a02('0x8b')]():'','disposition':_0x28e80f['disposition'],'visibility':_0x28e80f[_0x3a02('0xd3')]?_0x3a02('0xd4'):_0x3a02('0xd5'),'messages':_(_0x28e80f[_0x3a02('0xbd')])[_0x3a02('0x6b')]({'secret':![]})[_0x3a02('0x29')](function(_0x59d88b){if(_0x59d88b['Attachment']){var _0x8f050d=path[_0x3a02('0x76')](_0x56c1c4,_0x59d88b[_0x3a02('0xc4')][_0x3a02('0xd6')]);if(fs[_0x3a02('0xd7')](_0x8f050d)){fs[_0x3a02('0xd8')](_0x8f050d)[_0x3a02('0xd9')](fs['createWriteStream'](path[_0x3a02('0x76')](_0x3e04b6,_0x59d88b[_0x3a02('0xc4')][_0x3a02('0xd6')])));}}return{'date':moment(_0x59d88b[_0x3a02('0xd0')])[_0x3a02('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3a02('0x8b')](),'sender':_0x59d88b[_0x3a02('0xbe')]===_0x3a02('0xda')?_0x59d88b[_0x3a02('0xc7')]?_0x59d88b[_0x3a02('0xc7')][_0x3a02('0xc0')]:_0x3a02('0xdb'):_0x59d88b[_0x3a02('0xc2')][_0x3a02('0xc3')]+(_0x59d88b[_0x3a02('0xc2')]['lastName']?'\x20'+_0x59d88b[_0x3a02('0xc2')][_0x3a02('0xdc')]:''),'body':_0x59d88b['Attachment']?_0x59d88b['Attachment'][_0x3a02('0xd6')]:_0x59d88b[_0x3a02('0xa6')],'direction':_0x59d88b[_0x3a02('0xbe')]===_0x3a02('0xda')?'A':'C','secret':_0x59d88b[_0x3a02('0xbf')],'attachment':_0x59d88b['Attachment']};})[_0x3a02('0x52')]()};return ejs[_0x3a02('0xdd')](path[_0x3a02('0x76')](config['root'],'server','views',_0x3a02('0xde')),{'interaction':_0x17c02c})[_0x3a02('0x25')](function(_0x5c39ba){return new BPromise(function(_0x13708f,_0x593b7e){pdf['create'](_0x5c39ba,_0x427bb7)['toFile'](path[_0x3a02('0x76')](_0x3e04b6,_0x3a02('0xdf')+_0x28e80f['id']+'-'+_0x5be148+_0x3a02('0xe0')),function(_0x161dde,_0x401080){if(_0x161dde)return _0x593b7e(_0x161dde);_0x13708f(_0x401080);});});});}})['then'](function(){if(_0x335a74){return new BPromise(function(_0x4bb25c,_0x2971d7){zipdir(_0x3e04b6,{'saveTo':_0x367d32},function(_0x2ab424,_0x493432){if(_0x2ab424)return _0x2971d7(_0x2ab424);return _0x4bb25c(_0x493432);});})[_0x3a02('0x25')](function(){return new BPromise(function(_0x2439ee,_0x46f450){rimraf(_0x3e04b6,function(_0x125744){if(_0x125744)_0x46f450(_0x125744);return _0x2439ee();});});})[_0x3a02('0x25')](function(){return _0x2331e6['download'](_0x367d32,_0x5c45b0,function(_0x4d26d9){if(_0x4d26d9){console[_0x3a02('0xe1')](_0x3a02('0xe2'),_0x4d26d9);}else{fs['unlinkSync'](_0x367d32);}});});}else{return _0x2331e6[_0x3a02('0x27')](0xc8);}})['catch'](handleError(_0x2331e6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 650a872..2d49b7c 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 _0xec1d=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit'];(function(_0x3a84c1,_0x5d2169){var _0x3bd6aa=function(_0x13ff43){while(--_0x13ff43){_0x3a84c1['push'](_0x3a84c1['shift']());}};_0x3bd6aa(++_0x5d2169);}(_0xec1d,0xf2));var _0xdec1=function(_0x2e9767,_0x1f1a15){_0x2e9767=_0x2e9767-0x0;var _0x1b0e32=_0xec1d[_0x2e9767];return _0x1b0e32;};'use strict';var EventEmitter=require(_0xdec1('0x0'));var OpenchannelInteraction=require(_0xdec1('0x1'))['db'][_0xdec1('0x2')];var OpenchannelMessage=require(_0xdec1('0x1'))['db'][_0xdec1('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdec1('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1cb5be){return function(_0xca3728,_0x2fdc65,_0x418188){_0xca3728[_0xdec1('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x501492){_0xca3728[_0xdec1('0x6')]('Users',_0x501492[_0xdec1('0x7')](function(_0x428d43){return{'id':_0x428d43['id']};}));return OpenchannelMessage[_0xdec1('0x8')]({'where':{'OpenchannelInteractionId':_0xca3728['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdec1('0x9')](function(_0x4c0853){_0xca3728[_0xdec1('0x6')](_0xdec1('0xa'),_0x4c0853[_0xdec1('0xb')]);OpenchannelInteractionEvents[_0xdec1('0xc')](_0x1cb5be+':'+_0xca3728['id'],_0xca3728);OpenchannelInteractionEvents[_0xdec1('0xc')](_0x1cb5be,_0xca3728);_0x418188(null);})['catch'](_0x418188(null));};}for(var e in events){if(events[_0xdec1('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xdec1('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8f59=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x25b58a,_0x2da1a4){var _0x1153db=function(_0x1f1f41){while(--_0x1f1f41){_0x25b58a['push'](_0x25b58a['shift']());}};_0x1153db(++_0x2da1a4);}(_0x8f59,0x73));var _0x98f5=function(_0x3c79ae,_0x2a953b){_0x3c79ae=_0x3c79ae-0x0;var _0x2c922a=_0x8f59[_0x3c79ae];return _0x2c922a;};'use strict';var EventEmitter=require(_0x98f5('0x0'));var OpenchannelInteraction=require(_0x98f5('0x1'))['db'][_0x98f5('0x2')];var OpenchannelMessage=require(_0x98f5('0x1'))['db'][_0x98f5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x98f5('0x4')](0x0);var events={'afterCreate':_0x98f5('0x5'),'afterUpdate':_0x98f5('0x6'),'afterDestroy':_0x98f5('0x7')};function emitEvent(_0x10ec35){return function(_0x38660c,_0x40f717,_0x346701){_0x38660c[_0x98f5('0x8')]({'attributes':['id'],'raw':!![]})[_0x98f5('0x9')](function(_0x2d55a5){_0x38660c[_0x98f5('0xa')](_0x98f5('0xb'),_0x2d55a5[_0x98f5('0xc')](function(_0x3ab072){return{'id':_0x3ab072['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x38660c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x98f5('0x9')](function(_0x393cd5){_0x38660c['setDataValue']('unreadMessages',_0x393cd5['length']);OpenchannelInteractionEvents[_0x98f5('0xd')](_0x10ec35+':'+_0x38660c['id'],_0x38660c);OpenchannelInteractionEvents[_0x98f5('0xd')](_0x10ec35,_0x38660c);_0x346701(null);})['catch'](_0x346701(null));};}for(var e in events){if(events[_0x98f5('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x98f5('0xf')](e,emitEvent(event));}}module[_0x98f5('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9b7873b..7391be6 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 _0xe015=['changed','closed','format','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','openchannel_interactions'];(function(_0x40f30e,_0x4729dc){var _0x2ea85a=function(_0x5e43e6){while(--_0x5e43e6){_0x40f30e['push'](_0x40f30e['shift']());}};_0x2ea85a(++_0x4729dc);}(_0xe015,0x13b));var _0x5e01=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe015[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('OpenchannelInteraction',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aeaef,_0x1420c2,_0x40d31f){if(_0x3aeaef[_0x5e01('0x9')](_0x5e01('0xa'))){_0x3aeaef['closedAt']=moment()[_0x5e01('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x40d31f(null,_0x3aeaef);}}});}; \ No newline at end of file +var _0xed95=['OpenchannelInteraction','openchannel_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xed95,0xb9));var _0x5ed9=function(_0x1f2aa3,_0x3a1964){_0x1f2aa3=_0x1f2aa3-0x0;var _0x3b1cd6=_0xed95[_0x1f2aa3];return _0x3b1cd6;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var logger=require(_0x5ed9('0x2'))(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var rp=require(_0x5ed9('0x6'));var fs=require('fs');var path=require(_0x5ed9('0x7'));var rimraf=require(_0x5ed9('0x8'));var config=require(_0x5ed9('0x9'));var attributes=require(_0x5ed9('0xa'));module[_0x5ed9('0xb')]=function(_0x52a57d,_0x48efa8){return _0x52a57d[_0x5ed9('0xc')](_0x5ed9('0xd'),attributes,{'tableName':_0x5ed9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34688d,_0x2d5474,_0x40e8eb){if(_0x34688d['changed']('closed')){_0x34688d[_0x5ed9('0xf')]=moment()[_0x5ed9('0x10')](_0x5ed9('0x11'));}_0x40e8eb(null,_0x34688d);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 15fc391..eed1608 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 _0x7da7=['options','where','attributes','limit','info','AddTagsToOpenchannelInteraction','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body'];(function(_0x354c01,_0x28a7f1){var _0x3a8262=function(_0x2896f9){while(--_0x2896f9){_0x354c01['push'](_0x354c01['shift']());}};_0x3a8262(++_0x28a7f1);}(_0x7da7,0x10d));var _0x77da=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x7da7[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});}exports[_0x77da('0x18')]=function(_0x544104){var _0x492063=this;return new Promise(function(_0xd5a809,_0x4d1512){return db['OpenchannelInteraction'][_0x77da('0x19')](_0x544104[_0x77da('0x1a')],{'raw':_0x544104[_0x77da('0x1b')]?_0x544104['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544104[_0x77da('0x1b')]?_0x544104['options'][_0x77da('0x1c')]||null:null,'attributes':_0x544104[_0x77da('0x1b')]?_0x544104[_0x77da('0x1b')][_0x77da('0x1d')]||null:null,'limit':_0x544104[_0x77da('0x1b')]?_0x544104[_0x77da('0x1b')][_0x77da('0x1e')]||null:null})['then'](function(_0x4885ec){logger[_0x77da('0x1f')](_0x77da('0x18'),_0x544104);logger[_0x77da('0x11')](_0x77da('0x18'),_0x544104,JSON['stringify'](_0x4885ec));_0xd5a809(_0x4885ec);})[_0x77da('0x17')](function(_0x167240){logger[_0x77da('0x13')](_0x77da('0x18'),_0x167240[_0x77da('0x15')],_0x544104);_0x4d1512(_0x492063['error'](0x1f4,_0x167240[_0x77da('0x15')]));});});};exports[_0x77da('0x20')]=function(_0x1f2279){return new Promise(function(_0x2913f7,_0x496ecd){return db['OpenchannelInteraction']['find']({'where':_0x1f2279[_0x77da('0x1b')]?_0x1f2279[_0x77da('0x1b')][_0x77da('0x1c')]||null:null})[_0x77da('0xe')](function(_0x34228f){if(_0x34228f){return _0x34228f['addTags'](_0x1f2279[_0x77da('0x1a')][_0x77da('0x21')],_[_0x77da('0x22')](_0x1f2279[_0x77da('0x1a')],[_0x77da('0x21'),'id'])||{});}})[_0x77da('0x23')](function(_0x52c5be){logger[_0x77da('0x1f')](_0x77da('0x24'),_0x1f2279);logger[_0x77da('0x11')](_0x77da('0x24'),_0x1f2279,JSON[_0x77da('0x12')](_0x52c5be));_0x2913f7(_0x52c5be);})[_0x77da('0x17')](function(_0x3343b4){logger[_0x77da('0x13')]('AddTags',_0x3343b4['message'],_0x1f2279);_0x496ecd(_this[_0x77da('0x13')](0x1f4,_0x3343b4[_0x77da('0x15')]));});});}; \ No newline at end of file +var _0x2d72=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x1ada36,_0x1af61c){var _0x3f8918=function(_0x3db87c){while(--_0x3db87c){_0x1ada36['push'](_0x1ada36['shift']());}};_0x3f8918(++_0x1af61c);}(_0x2d72,0xa8));var _0x22d7=function(_0x559f37,_0x39676d){_0x559f37=_0x559f37-0x0;var _0x4b722b=_0x2d72[_0x559f37];return _0x4b722b;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});config['redis']=_[_0x22d7('0xe')](config[_0x22d7('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x22d7('0x10'))(new Redis(config[_0x22d7('0xf')]));require(_0x22d7('0x11'))[_0x22d7('0x12')](socket);function respondWithRpcPromise(_0x49f7e1,_0x5f56eb,_0x1810b8){return new BPromise(function(_0x257c85,_0x233c0b){return client[_0x22d7('0x13')](_0x49f7e1,_0x1810b8)[_0x22d7('0x14')](function(_0x4db5dd){logger['info'](_0x22d7('0x15'),_0x5f56eb,'request\x20sent');logger[_0x22d7('0x16')](_0x22d7('0x17'),_0x5f56eb,'request\x20sent',JSON[_0x22d7('0x18')](_0x4db5dd));if(_0x4db5dd[_0x22d7('0x19')]){if(_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1a')]===0x1f4){logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd[_0x22d7('0x19')][_0x22d7('0x1b')]);return _0x233c0b(_0x4db5dd['error'][_0x22d7('0x1b')]);}logger[_0x22d7('0x19')](_0x22d7('0x15'),_0x5f56eb,_0x4db5dd['error']['message']);return _0x257c85(_0x4db5dd['error'][_0x22d7('0x1b')]);}else{logger[_0x22d7('0x1c')](_0x22d7('0x15'),_0x5f56eb,_0x22d7('0x1d'));_0x257c85(_0x4db5dd[_0x22d7('0x1e')]['message']);}})[_0x22d7('0x1f')](function(_0x75affd){logger[_0x22d7('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5f56eb,_0x75affd);_0x233c0b(_0x75affd);});});}exports[_0x22d7('0x20')]=function(_0x7f2905){var _0x3574e4=this;return new Promise(function(_0xcb35a8,_0x6be49e){return db['OpenchannelInteraction']['update'](_0x7f2905[_0x22d7('0x21')],{'raw':_0x7f2905[_0x22d7('0x22')]?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7f2905['options']?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x24')]||null:null,'attributes':_0x7f2905[_0x22d7('0x22')]?_0x7f2905['options'][_0x22d7('0x25')]||null:null,'limit':_0x7f2905['options']?_0x7f2905[_0x22d7('0x22')][_0x22d7('0x26')]||null:null})[_0x22d7('0x14')](function(_0x5db3aa){logger[_0x22d7('0x1c')]('UpdateOpenchannelInteraction',_0x7f2905);logger['debug'](_0x22d7('0x20'),_0x7f2905,JSON[_0x22d7('0x18')](_0x5db3aa));_0xcb35a8(_0x5db3aa);})[_0x22d7('0x1f')](function(_0x27998a){logger[_0x22d7('0x19')]('UpdateOpenchannelInteraction',_0x27998a[_0x22d7('0x1b')],_0x7f2905);_0x6be49e(_0x3574e4[_0x22d7('0x19')](0x1f4,_0x27998a[_0x22d7('0x1b')]));});});};exports[_0x22d7('0x27')]=function(_0x45dc29){return new Promise(function(_0x49199a,_0x2606bd){return db[_0x22d7('0x28')][_0x22d7('0x29')]({'where':_0x45dc29[_0x22d7('0x22')]?_0x45dc29['options'][_0x22d7('0x24')]||null:null})[_0x22d7('0x14')](function(_0x47ef72){if(_0x47ef72){return _0x47ef72['addTags'](_0x45dc29['body'][_0x22d7('0x2a')],_[_0x22d7('0x2b')](_0x45dc29[_0x22d7('0x21')],['ids','id'])||{});}})[_0x22d7('0x2c')](function(_0x5ef395){logger[_0x22d7('0x1c')](_0x22d7('0x2d'),_0x45dc29);logger[_0x22d7('0x16')](_0x22d7('0x2d'),_0x45dc29,JSON[_0x22d7('0x18')](_0x5ef395));_0x49199a(_0x5ef395);})[_0x22d7('0x1f')](function(_0x4ac16c){logger['error'](_0x22d7('0x2d'),_0x4ac16c['message'],_0x45dc29);_0x2606bd(_this[_0x22d7('0x19')](0x1f4,_0x4ac16c[_0x22d7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5fbd8cf..ccbb418 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 _0xefef=['update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x1313a2,_0x4e7c9f){var _0x246438=function(_0x3d0a79){while(--_0x3d0a79){_0x1313a2['push'](_0x1313a2['shift']());}};_0x246438(++_0x4e7c9f);}(_0xefef,0xa6));var _0xfefe=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xefef[_0x32b993];return _0x482780;};'use strict';var OpenchannelInteractionEvents=require(_0xfefe('0x0'));var events=[_0xfefe('0x1'),'remove',_0xfefe('0x2')];function createListener(_0x4a235b,_0x14faff){return function(_0xdfbbcc){_0x14faff[_0xfefe('0x3')](_0x4a235b,_0xdfbbcc);};}function removeListener(_0x4af9f1,_0x2f4367){return function(){OpenchannelInteractionEvents[_0xfefe('0x4')](_0x4af9f1,_0x2f4367);};}exports['register']=function(_0x4c39ab){for(var _0x58dfa3=0x0,_0x3c354e=events[_0xfefe('0x5')];_0x58dfa3<_0x3c354e;_0x58dfa3++){var _0x221a65=events[_0x58dfa3];var _0x3a9731=createListener(_0xfefe('0x6')+_0x221a65,_0x4c39ab);OpenchannelInteractionEvents['on'](_0x221a65,_0x3a9731);}}; \ No newline at end of file +var _0xddff=['save','remove','update','emit','removeListener','register','openchannelInteraction:'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0xddff,0x77));var _0xfddf=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0xddff[_0x3ff2f9];return _0x3b0913;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xfddf('0x0'),_0xfddf('0x1'),_0xfddf('0x2')];function createListener(_0x35fe69,_0x5111a8){return function(_0x12511e){_0x5111a8[_0xfddf('0x3')](_0x35fe69,_0x12511e);};}function removeListener(_0x2ed49f,_0xffe4d){return function(){OpenchannelInteractionEvents[_0xfddf('0x4')](_0x2ed49f,_0xffe4d);};}exports[_0xfddf('0x5')]=function(_0x1d58ba){for(var _0x37b908=0x0,_0x786cf9=events['length'];_0x37b908<_0x786cf9;_0x37b908++){var _0x4fa5b7=events[_0x37b908];var _0x396305=createListener(_0xfddf('0x6')+_0x4fa5b7,_0x1d58ba);OpenchannelInteractionEvents['on'](_0x4fa5b7,_0x396305);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8b2edf5..82f41b6 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 _0x4a06=['accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','create','put','update'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x4a06,0x1f2));var _0x64a0=function(_0x1b4f10,_0x5440cf){_0x1b4f10=_0x1b4f10-0x0;var _0x19b8ef=_0x4a06[_0x1b4f10];return _0x19b8ef;};'use strict';var multer=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var path=require(_0x64a0('0x2'));var timeout=require(_0x64a0('0x3'));var express=require(_0x64a0('0x4'));var router=express[_0x64a0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x64a0('0x6'));var config=require(_0x64a0('0x7'));var controller=require(_0x64a0('0x8'));router[_0x64a0('0x9')]('/',auth[_0x64a0('0xa')](),controller[_0x64a0('0xb')]);router[_0x64a0('0x9')](_0x64a0('0xc'),auth[_0x64a0('0xa')](),controller[_0x64a0('0xd')]);router[_0x64a0('0x9')](_0x64a0('0xe'),auth[_0x64a0('0xa')](),controller[_0x64a0('0xf')]);router[_0x64a0('0x10')]('/',auth['isAuthenticated'](),interaction[_0x64a0('0x11')](_0x64a0('0x12'),'openchannelmessage:create'),controller[_0x64a0('0x13')]);router[_0x64a0('0x14')](_0x64a0('0xe'),auth[_0x64a0('0xa')](),controller[_0x64a0('0x15')]);router[_0x64a0('0x14')]('/:id/accept',auth[_0x64a0('0xa')](),controller[_0x64a0('0x16')]);router[_0x64a0('0x14')]('/:id/reject',auth[_0x64a0('0xa')](),controller[_0x64a0('0x17')]);router['delete'](_0x64a0('0xe'),auth[_0x64a0('0xa')](),controller[_0x64a0('0x18')]);module[_0x64a0('0x19')]=router; \ No newline at end of file +var _0x5686=['/describe','isAuthenticated','/:id','post','tracked','openchannel','openchannelmessage:create','put','accept','reject','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index'];(function(_0x418afb,_0x4ebded){var _0x1f67e4=function(_0x5cbd8b){while(--_0x5cbd8b){_0x418afb['push'](_0x418afb['shift']());}};_0x1f67e4(++_0x4ebded);}(_0x5686,0xbc));var _0x6568=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x5686[_0x291d3f];return _0x242080;};'use strict';var multer=require('multer');var util=require(_0x6568('0x0'));var path=require(_0x6568('0x1'));var timeout=require('connect-timeout');var express=require(_0x6568('0x2'));var router=express[_0x6568('0x3')]();var auth=require(_0x6568('0x4'));var interaction=require(_0x6568('0x5'));var config=require(_0x6568('0x6'));var controller=require(_0x6568('0x7'));router[_0x6568('0x8')]('/',auth['isAuthenticated'](),controller[_0x6568('0x9')]);router['get'](_0x6568('0xa'),auth[_0x6568('0xb')](),controller['describe']);router[_0x6568('0x8')](_0x6568('0xc'),auth[_0x6568('0xb')](),controller['show']);router[_0x6568('0xd')]('/',auth[_0x6568('0xb')](),interaction[_0x6568('0xe')](_0x6568('0xf'),_0x6568('0x10')),controller['create']);router[_0x6568('0x11')](_0x6568('0xc'),auth[_0x6568('0xb')](),controller['update']);router[_0x6568('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x6568('0x12')]);router['put']('/:id/reject',auth[_0x6568('0xb')](),controller[_0x6568('0x13')]);router[_0x6568('0x14')](_0x6568('0xc'),auth[_0x6568('0xb')](),controller['destroy']);module[_0x6568('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 716c92f..ee3b83f 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 _0x6677=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x2a41d5,_0x2f69d9){var _0x3e844c=function(_0x23ddce){while(--_0x23ddce){_0x2a41d5['push'](_0x2a41d5['shift']());}};_0x3e844c(++_0x2f69d9);}(_0x6677,0x171));var _0x7667=function(_0x4d3e27,_0x4032ba){_0x4d3e27=_0x4d3e27-0x0;var _0x4f67b9=_0x6677[_0x4d3e27];return _0x4f67b9;};'use strict';var Sequelize=require(_0x7667('0x0'));module[_0x7667('0x1')]={'body':{'type':Sequelize[_0x7667('0x2')](_0x7667('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7667('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7667('0x5')]('in','out'),'defaultValue':_0x7667('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7667('0x7')]}}; \ No newline at end of file +var _0x6a7b=['out','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6a7b,0x7f));var _0xb6a7=function(_0x41c552,_0x5d7667){_0x41c552=_0x41c552-0x0;var _0x4425c5=_0x6a7b[_0x41c552];return _0x4425c5;};'use strict';var Sequelize=require(_0xb6a7('0x0'));module[_0xb6a7('0x1')]={'body':{'type':Sequelize[_0xb6a7('0x2')](_0xb6a7('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xb6a7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb6a7('0x5')]('in',_0xb6a7('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 0245057..d61d80a 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 _0x8b91=['options','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','OpenchannelMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','map','key','VIRTUAL','merge'];(function(_0x1f6bcc,_0x2f7916){var _0x35c7ae=function(_0x57ac83){while(--_0x57ac83){_0x1f6bcc['push'](_0x1f6bcc['shift']());}};_0x35c7ae(++_0x2f7916);}(_0x8b91,0x19e));var _0x18b9=function(_0x3146d9,_0x5b21c0){_0x3146d9=_0x3146d9-0x0;var _0x3c043f=_0x8b91[_0x3146d9];return _0x3c043f;};'use strict';var pdf=require(_0x18b9('0x0'));var emlformat=require(_0x18b9('0x1'));var rimraf=require(_0x18b9('0x2'));var zipdir=require(_0x18b9('0x3'));var jsonpatch=require(_0x18b9('0x4'));var rp=require(_0x18b9('0x5'));var moment=require('moment');var BPromise=require(_0x18b9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x18b9('0x7'));var sox=require(_0x18b9('0x8'));var csv=require(_0x18b9('0x9'));var ejs=require(_0x18b9('0xa'));var fs=require('fs');var _=require(_0x18b9('0xb'));var squel=require(_0x18b9('0xc'));var crypto=require(_0x18b9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x18b9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x18b9('0xf'));var Papa=require('papaparse');var Redis=require(_0x18b9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18b9('0x11'));var hardwareService=require(_0x18b9('0x12'));var logger=require(_0x18b9('0x13'))(_0x18b9('0x14'));var utils=require(_0x18b9('0x15'));var config=require(_0x18b9('0x16'));var db=require(_0x18b9('0x17'))['db'];config[_0x18b9('0x18')]=_[_0x18b9('0x19')](config[_0x18b9('0x18')],{'host':_0x18b9('0x1a'),'port':0x18eb});var socket=require(_0x18b9('0x1b'))(new Redis(config[_0x18b9('0x18')]));require(_0x18b9('0x1c'))[_0x18b9('0x1d')](socket);var jayson=require(_0x18b9('0x1e'));var client=jayson['client'][_0x18b9('0x1f')]({'port':0x232c});var client9002=jayson[_0x18b9('0x20')][_0x18b9('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x14570e,_0x5d8cd8,_0x4b9b27){if(_0x4b9b27){var _0x30348f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30348f[_0x18b9('0x21')](_0x5d8cd8)){return _0x14570e;}else{throw new Error(_0x18b9('0x22'));}}else{return _0x14570e;}}function respondWithRpcPromise(_0x1835d3,_0x56d7a6,_0x5bb6a9,_0x6edee2){return new BPromise(function(_0x1b5acf,_0x56b847){var _0xb03aac=_0x6edee2||client;return _0xb03aac[_0x18b9('0x23')](_0x1835d3,_0x5bb6a9)['then'](function(_0x20b211){logger['info'](_0x18b9('0x24'),_0x56d7a6,_0x18b9('0x25'));logger['debug'](_0x18b9('0x26'),_0x56d7a6,_0x18b9('0x25'),JSON[_0x18b9('0x27')](_0x20b211));if(_0x20b211[_0x18b9('0x28')]){if(_0x20b211[_0x18b9('0x28')][_0x18b9('0x29')]===0x1f4){logger[_0x18b9('0x28')](_0x18b9('0x24'),_0x56d7a6,_0x20b211[_0x18b9('0x28')]['message']);return _0x56b847(_0x20b211[_0x18b9('0x28')][_0x18b9('0x2a')]);}logger['error'](_0x18b9('0x24'),_0x56d7a6,_0x20b211[_0x18b9('0x28')][_0x18b9('0x2a')]);return _0x1b5acf(_0x20b211[_0x18b9('0x28')][_0x18b9('0x2a')]);}else{logger[_0x18b9('0x2b')](_0x18b9('0x24'),_0x56d7a6,_0x18b9('0x25'));_0x1b5acf(_0x20b211['result'][_0x18b9('0x2a')]);}})[_0x18b9('0x2c')](function(_0x13ca80){logger['error'](_0x18b9('0x24'),_0x56d7a6,_0x13ca80);_0x56b847(_0x13ca80);});});}function respondWithStatusCode(_0x5f42f8,_0x36089e){_0x36089e=_0x36089e||0xcc;return function(_0x154f60){if(_0x154f60){return _0x5f42f8[_0x18b9('0x2d')](_0x36089e);}return _0x5f42f8[_0x18b9('0x2e')](_0x36089e)[_0x18b9('0x2f')]();};}function respondWithResult(_0x5ab965,_0x339087){_0x339087=_0x339087||0xc8;return function(_0x223bce){if(_0x223bce){return _0x5ab965[_0x18b9('0x2e')](_0x339087)[_0x18b9('0x30')](_0x223bce);}};}function respondWithFilteredResult(_0x176ac5,_0x54c81e){return function(_0x44d897){if(_0x44d897){var _0x388b13=_0x44d897[_0x18b9('0x31')],_0x914cda=_0x54c81e[_0x18b9('0x32')],_0xbd16b1=_0x54c81e[_0x18b9('0x32')]+_0x54c81e['limit'],_0x137dfb;if(_0xbd16b1>=_0x388b13){_0xbd16b1=_0x388b13;_0x137dfb=0xc8;}else{_0x137dfb=0xce;}_0x176ac5[_0x18b9('0x2e')](_0x137dfb);return _0x176ac5[_0x18b9('0x33')](_0x18b9('0x34'),_0x914cda+'-'+_0xbd16b1+'/'+_0x388b13)[_0x18b9('0x30')](_0x44d897);}return null;};}function patchUpdates(_0xbf01f3){return function(_0x26c4d7){try{jsonpatch[_0x18b9('0x35')](_0x26c4d7,_0xbf01f3,!![]);}catch(_0xd13ada){return BPromise[_0x18b9('0x36')](_0xd13ada);}return _0x26c4d7[_0x18b9('0x37')]();};}function saveUpdates(_0x439db9,_0x785934){return function(_0x3e3f54){if(_0x3e3f54){return _0x3e3f54[_0x18b9('0x38')](_0x439db9)[_0x18b9('0x39')](function(_0x579cd4){return _0x579cd4;});}return null;};}function removeEntity(_0x44389c,_0x5f56b3){return function(_0x22c978){if(_0x22c978){return _0x22c978[_0x18b9('0x3a')]()['then'](function(){_0x44389c[_0x18b9('0x2e')](0xcc)[_0x18b9('0x2f')]();});}};}function handleEntityNotFound(_0xcb3dd1,_0x27f3c7){return function(_0xa68146){if(!_0xa68146){_0xcb3dd1['sendStatus'](0x194);}return _0xa68146;};}function handleError(_0x15ee76,_0x26c477){_0x26c477=_0x26c477||0x1f4;return function(_0x29c4b){logger[_0x18b9('0x28')](_0x29c4b['stack']);if(_0x29c4b[_0x18b9('0x3b')]){delete _0x29c4b['name'];}_0x15ee76[_0x18b9('0x2e')](_0x26c477)[_0x18b9('0x3c')](_0x29c4b);};}exports[_0x18b9('0x3d')]=function(_0x1c76b8,_0x244a2e){var _0x39362d={},_0x28571b={},_0x5b442d={'count':0x0,'rows':[]};var _0x1aeb60=db[_0x18b9('0x3e')][_0x18b9('0x3f')];_0x28571b[_0x18b9('0x40')]=_[_0x18b9('0x41')](_0x1aeb60);_0x28571b[_0x18b9('0x42')]=_['keys'](_0x1c76b8[_0x18b9('0x42')]);_0x28571b[_0x18b9('0x43')]=_[_0x18b9('0x44')](_0x28571b[_0x18b9('0x40')],_0x28571b[_0x18b9('0x42')]);_0x39362d[_0x18b9('0x45')]=_[_0x18b9('0x44')](_0x28571b[_0x18b9('0x40')],qs['fields'](_0x1c76b8[_0x18b9('0x42')][_0x18b9('0x46')]));_0x39362d[_0x18b9('0x45')]=_0x39362d['attributes'][_0x18b9('0x47')]?_0x39362d[_0x18b9('0x45')]:_0x28571b[_0x18b9('0x40')];if(!_0x1c76b8[_0x18b9('0x42')]['hasOwnProperty']('nolimit')){_0x39362d[_0x18b9('0x48')]=qs[_0x18b9('0x48')](_0x1c76b8[_0x18b9('0x42')][_0x18b9('0x48')]);_0x39362d['offset']=qs[_0x18b9('0x32')](_0x1c76b8[_0x18b9('0x42')][_0x18b9('0x32')]);}_0x39362d[_0x18b9('0x49')]=qs[_0x18b9('0x4a')](_0x1c76b8['query'][_0x18b9('0x4a')]);_0x39362d[_0x18b9('0x4b')]=qs['filters'](_[_0x18b9('0x4c')](_0x1c76b8['query'],_0x28571b[_0x18b9('0x43')]));if(_0x1c76b8[_0x18b9('0x42')][_0x18b9('0x4d')]){_0x39362d[_0x18b9('0x4b')]=_['merge'](_0x39362d['where'],{'$or':_[_0x18b9('0x4e')](_0x1aeb60,function(_0x32ec1d){if(_0x32ec1d['type'][_0x18b9('0x4f')]!==_0x18b9('0x50')){var _0x30e386={};_0x30e386[_0x32ec1d['field']]={'$like':'%'+_0x1c76b8['query'][_0x18b9('0x4d')]+'%'};return _0x30e386;}})});}_0x39362d=_[_0x18b9('0x51')]({},_0x39362d,_0x1c76b8[_0x18b9('0x52')]);var _0x1ea31d={'where':_0x39362d['where']};return db[_0x18b9('0x3e')][_0x18b9('0x31')](_0x1ea31d)[_0x18b9('0x39')](function(_0x3adb30){_0x5b442d[_0x18b9('0x31')]=_0x3adb30;if(_0x1c76b8[_0x18b9('0x42')][_0x18b9('0x53')]){_0x39362d[_0x18b9('0x54')]=[{'all':!![]}];}return db[_0x18b9('0x3e')][_0x18b9('0x55')](_0x39362d);})[_0x18b9('0x39')](function(_0x568eac){_0x5b442d[_0x18b9('0x56')]=_0x568eac;return _0x5b442d;})[_0x18b9('0x39')](respondWithFilteredResult(_0x244a2e,_0x39362d))[_0x18b9('0x2c')](handleError(_0x244a2e,null));};exports[_0x18b9('0x57')]=function(_0x30f3fa,_0x3a81a0){var _0x3a9c37={'raw':!![],'where':{'id':_0x30f3fa[_0x18b9('0x58')]['id']}},_0x4d5180={};_0x4d5180[_0x18b9('0x40')]=_[_0x18b9('0x41')](db[_0x18b9('0x3e')][_0x18b9('0x3f')]);_0x4d5180['query']=_[_0x18b9('0x41')](_0x30f3fa['query']);_0x4d5180[_0x18b9('0x43')]=_[_0x18b9('0x44')](_0x4d5180[_0x18b9('0x40')],_0x4d5180[_0x18b9('0x42')]);_0x3a9c37[_0x18b9('0x45')]=_[_0x18b9('0x44')](_0x4d5180[_0x18b9('0x40')],qs[_0x18b9('0x46')](_0x30f3fa[_0x18b9('0x42')][_0x18b9('0x46')]));_0x3a9c37[_0x18b9('0x45')]=_0x3a9c37[_0x18b9('0x45')]['length']?_0x3a9c37[_0x18b9('0x45')]:_0x4d5180[_0x18b9('0x40')];if(_0x30f3fa[_0x18b9('0x42')][_0x18b9('0x53')]){_0x3a9c37[_0x18b9('0x54')]=[{'all':!![]}];}_0x3a9c37=_[_0x18b9('0x51')]({},_0x3a9c37,_0x30f3fa[_0x18b9('0x52')]);return db[_0x18b9('0x3e')][_0x18b9('0x59')](_0x3a9c37)[_0x18b9('0x39')](handleEntityNotFound(_0x3a81a0,null))[_0x18b9('0x39')](respondWithResult(_0x3a81a0,null))[_0x18b9('0x2c')](handleError(_0x3a81a0,null));};exports['create']=function(_0x50051a,_0x3c7b80){return db[_0x18b9('0x3e')][_0x18b9('0x5a')](_0x50051a[_0x18b9('0x5b')],{})[_0x18b9('0x39')](respondWithResult(_0x3c7b80,0xc9))[_0x18b9('0x2c')](handleError(_0x3c7b80,null));};exports['update']=function(_0xaef4a8,_0x2ebcd4){if(_0xaef4a8[_0x18b9('0x5b')]['id']){delete _0xaef4a8[_0x18b9('0x5b')]['id'];}return db['OpenchannelMessage'][_0x18b9('0x59')]({'where':{'id':_0xaef4a8[_0x18b9('0x58')]['id']}})[_0x18b9('0x39')](handleEntityNotFound(_0x2ebcd4,null))[_0x18b9('0x39')](saveUpdates(_0xaef4a8[_0x18b9('0x5b')],null))[_0x18b9('0x39')](respondWithResult(_0x2ebcd4,null))[_0x18b9('0x2c')](handleError(_0x2ebcd4,null));};exports[_0x18b9('0x3a')]=function(_0x2013f7,_0x5936ba){return db[_0x18b9('0x3e')][_0x18b9('0x59')]({'where':{'id':_0x2013f7[_0x18b9('0x58')]['id']}})['then'](handleEntityNotFound(_0x5936ba,null))[_0x18b9('0x39')](removeEntity(_0x5936ba,null))['catch'](handleError(_0x5936ba,null));};exports[_0x18b9('0x5c')]=function(_0x1596b8,_0x4ab46d){return db[_0x18b9('0x3e')][_0x18b9('0x5c')]()[_0x18b9('0x39')](respondWithResult(_0x4ab46d,null))[_0x18b9('0x2c')](handleError(_0x4ab46d,null));};var interaction_log=require(_0x18b9('0x13'))('openchannel-interactions');exports['accept']=function(_0x8a9c44,_0x5763c0,_0x4204f9){var _0x5abd07={'channel':_0x18b9('0x5d')};if(_0x8a9c44[_0x18b9('0x5b')]['id']){delete _0x8a9c44['body']['id'];}_0x8a9c44[_0x18b9('0x5b')][_0x18b9('0x5e')]=!![];_0x8a9c44[_0x18b9('0x5b')][_0x18b9('0x5f')]=moment()[_0x18b9('0x60')](_0x18b9('0x61'));_0x8a9c44[_0x18b9('0x5b')][_0x18b9('0x62')]=_0x8a9c44[_0x18b9('0x5b')][_0x18b9('0x62')]||_0x8a9c44[_0x18b9('0x63')]['id'];return db[_0x18b9('0x3e')][_0x18b9('0x59')]({'where':{'id':_0x8a9c44[_0x18b9('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x18b9('0x64')}]})[_0x18b9('0x39')](handleEntityNotFound(_0x5763c0,null))[_0x18b9('0x39')](saveUpdates(_0x8a9c44[_0x18b9('0x5b')],null))[_0x18b9('0x39')](function(_0x453ea7){if(_0x453ea7){_0x5abd07[_0x18b9('0x2a')]=_0x453ea7[_0x18b9('0x65')]({'plain':!![]});return db[_0x18b9('0x66')][_0x18b9('0x59')]({'where':{'id':_0x453ea7[_0x18b9('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x5763c0,null))[_0x18b9('0x39')](function(_0x574113){if(_0x574113){return _0x574113[_0x18b9('0x38')]({'UserId':_0x8a9c44['body'][_0x18b9('0x62')],'read1stAt':_[_0x18b9('0x68')](_0x574113[_0x18b9('0x69')])?moment()[_0x18b9('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x18b9('0x39')](function(_0x28bb59){if(_0x28bb59){_0x5abd07[_0x18b9('0x6a')]=_0x28bb59[_0x18b9('0x65')]({'plain':!![]});interaction_log[_0x18b9('0x2b')](_0x18b9('0x6b'),_0x8a9c44[_0x18b9('0x63')]['id'],_0x8a9c44['user'][_0x18b9('0x3b')],_0x8a9c44[_0x18b9('0x63')][_0x18b9('0x6c')],_0x5abd07[_0x18b9('0x6a')]['id'],_0x8a9c44[_0x18b9('0x5b')]?JSON[_0x18b9('0x27')](_0x8a9c44[_0x18b9('0x5b')]):'null');return respondWithRpcPromise(_0x18b9('0x6d'),_0x18b9('0x6e'),_0x5abd07);}return null;})[_0x18b9('0x39')](function(_0x36272e){if(_0x36272e){if(_0x8a9c44['body'][_0x18b9('0x6f')]){_0x5abd07[_0x18b9('0x2a')][_0x18b9('0x70')]=util['format']('SIP/%s',_0x8a9c44[_0x18b9('0x63')][_0x18b9('0x3b')]);_0x5abd07[_0x18b9('0x2a')][_0x18b9('0x71')]=_0x5abd07[_0x18b9('0x71')];_0x5abd07['message'][_0x18b9('0x72')]=_0x18b9('0x73');return respondWithRpcPromise(_0x18b9('0x74'),'EventManager',{'event':_0x18b9('0x75'),'message':_0x5abd07[_0x18b9('0x2a')]},client9002)[_0x18b9('0x39')](function(){return _0x5abd07;});}return _0x5abd07;}return null;})['then'](respondWithResult(_0x5763c0,null))[_0x18b9('0x2c')](handleError(_0x5763c0,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x18b9('0x36')]=function(_0x3298c8,_0x362c99,_0x57c53c){var _0x3bca56={'agent':{},'channel':_0x18b9('0x5d')};if(_0x3298c8[_0x18b9('0x5b')]['id']){delete _0x3298c8['body']['id'];}_0x3298c8['body']['UserId']=_0x3298c8[_0x18b9('0x5b')][_0x18b9('0x62')]||_0x3298c8[_0x18b9('0x63')]['id'];_0x3bca56['agent']['id']=_0x3298c8[_0x18b9('0x5b')]['UserId'];return db[_0x18b9('0x3e')][_0x18b9('0x59')]({'where':{'id':_0x3298c8['params']['id'],'UserId':null}})[_0x18b9('0x39')](handleEntityNotFound(_0x362c99,null))[_0x18b9('0x39')](function(_0x47c121){if(_0x47c121){_0x3bca56[_0x18b9('0x2a')]=_0x47c121['get']({'plain':!![]});return db[_0x18b9('0x66')]['find']({'where':{'id':_0x47c121['OpenchannelInteractionId']}});}return null;})[_0x18b9('0x39')](handleEntityNotFound(_0x362c99,null))[_0x18b9('0x39')](function(_0x273114){if(_0x273114){_0x3bca56[_0x18b9('0x6a')]=_0x273114[_0x18b9('0x65')]({'plain':!![]});interaction_log[_0x18b9('0x2b')](_0x18b9('0x76'),_0x3298c8['user']['id'],_0x3298c8[_0x18b9('0x63')][_0x18b9('0x3b')],_0x3298c8[_0x18b9('0x63')][_0x18b9('0x6c')],_0x3bca56[_0x18b9('0x6a')]['id'],_0x3298c8['body']?JSON[_0x18b9('0x27')](_0x3298c8['body']):_0x18b9('0x77'));return respondWithRpcPromise(_0x18b9('0x78'),_0x18b9('0x79'),_0x3bca56);}return null;})[_0x18b9('0x39')](function(_0x416bd4){if(_0x416bd4){_0x416bd4[_0x18b9('0x2a')][_0x18b9('0x70')]=util['format'](_0x18b9('0x7a'),_0x3298c8[_0x18b9('0x63')][_0x18b9('0x3b')]);_0x416bd4[_0x18b9('0x2a')][_0x18b9('0x71')]=_0x3bca56[_0x18b9('0x71')];_0x416bd4[_0x18b9('0x2a')][_0x18b9('0x72')]='reject';respondWithRpcPromise(_0x18b9('0x74'),_0x18b9('0x74'),{'event':_0x18b9('0x7b'),'message':_0x416bd4[_0x18b9('0x2a')]},client9002);return _0x3bca56;}return null;})[_0x18b9('0x39')](respondWithResult(_0x362c99,null))[_0x18b9('0x2c')](handleError(_0x362c99,null));}; \ No newline at end of file +var _0x8bef=['update','body','find','describe','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','manual','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','key','merge','options','OpenchannelMessage','includeAll','findAll','rows','params','include','create'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x8bef,0x106));var _0xf8be=function(_0x8f6fa5,_0x320980){_0x8f6fa5=_0x8f6fa5-0x0;var _0x2e1201=_0x8bef[_0x8f6fa5];return _0x2e1201;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf8be('0x0'));var zipdir=require(_0xf8be('0x1'));var jsonpatch=require(_0xf8be('0x2'));var rp=require(_0xf8be('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf8be('0x4'));var util=require(_0xf8be('0x5'));var path=require(_0xf8be('0x6'));var sox=require(_0xf8be('0x7'));var csv=require(_0xf8be('0x8'));var ejs=require(_0xf8be('0x9'));var fs=require('fs');var _=require(_0xf8be('0xa'));var squel=require(_0xf8be('0xb'));var crypto=require(_0xf8be('0xc'));var jsforce=require(_0xf8be('0xd'));var deskjs=require(_0xf8be('0xe'));var toCsv=require(_0xf8be('0x8'));var querystring=require(_0xf8be('0xf'));var Papa=require(_0xf8be('0x10'));var Redis=require(_0xf8be('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf8be('0x12'));var hardwareService=require(_0xf8be('0x13'));var logger=require(_0xf8be('0x14'))(_0xf8be('0x15'));var utils=require(_0xf8be('0x16'));var config=require('../../config/environment');var db=require(_0xf8be('0x17'))['db'];config['redis']=_[_0xf8be('0x18')](config[_0xf8be('0x19')],{'host':_0xf8be('0x1a'),'port':0x18eb});var socket=require(_0xf8be('0x1b'))(new Redis(config['redis']));require(_0xf8be('0x1c'))['register'](socket);var jayson=require(_0xf8be('0x1d'));var client=jayson[_0xf8be('0x1e')][_0xf8be('0x1f')]({'port':0x232c});var client9002=jayson[_0xf8be('0x1e')][_0xf8be('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x162500,_0x3db2d1,_0x2ea70f){if(_0x2ea70f){var _0x3ee532=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ee532['test'](_0x3db2d1)){return _0x162500;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x162500;}}function respondWithRpcPromise(_0x1512e2,_0x4debe7,_0x40dbbb,_0x305ff2){return new BPromise(function(_0x39677a,_0x95ea96){var _0x441a30=_0x305ff2||client;return _0x441a30[_0xf8be('0x20')](_0x1512e2,_0x40dbbb)[_0xf8be('0x21')](function(_0x217aae){logger['info'](_0xf8be('0x22'),_0x4debe7,_0xf8be('0x23'));logger[_0xf8be('0x24')](_0xf8be('0x25'),_0x4debe7,_0xf8be('0x23'),JSON[_0xf8be('0x26')](_0x217aae));if(_0x217aae[_0xf8be('0x27')]){if(_0x217aae['error'][_0xf8be('0x28')]===0x1f4){logger[_0xf8be('0x27')](_0xf8be('0x22'),_0x4debe7,_0x217aae[_0xf8be('0x27')]['message']);return _0x95ea96(_0x217aae[_0xf8be('0x27')][_0xf8be('0x29')]);}logger[_0xf8be('0x27')](_0xf8be('0x22'),_0x4debe7,_0x217aae['error'][_0xf8be('0x29')]);return _0x39677a(_0x217aae[_0xf8be('0x27')][_0xf8be('0x29')]);}else{logger[_0xf8be('0x2a')](_0xf8be('0x22'),_0x4debe7,_0xf8be('0x23'));_0x39677a(_0x217aae['result'][_0xf8be('0x29')]);}})[_0xf8be('0x2b')](function(_0x25b465){logger[_0xf8be('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x4debe7,_0x25b465);_0x95ea96(_0x25b465);});});}function respondWithStatusCode(_0xa845a0,_0x123c55){_0x123c55=_0x123c55||0xcc;return function(_0x4e19da){if(_0x4e19da){return _0xa845a0[_0xf8be('0x2c')](_0x123c55);}return _0xa845a0[_0xf8be('0x2d')](_0x123c55)[_0xf8be('0x2e')]();};}function respondWithResult(_0xfe45b4,_0x52da11){_0x52da11=_0x52da11||0xc8;return function(_0x2b6df3){if(_0x2b6df3){return _0xfe45b4[_0xf8be('0x2d')](_0x52da11)[_0xf8be('0x2f')](_0x2b6df3);}};}function respondWithFilteredResult(_0x2f5c0b,_0x471f47){return function(_0x306c38){if(_0x306c38){var _0x128b8b=_0x306c38[_0xf8be('0x30')],_0x385643=_0x471f47[_0xf8be('0x31')],_0x3f1e74=_0x471f47[_0xf8be('0x31')]+_0x471f47[_0xf8be('0x32')],_0x4ac056;if(_0x3f1e74>=_0x128b8b){_0x3f1e74=_0x128b8b;_0x4ac056=0xc8;}else{_0x4ac056=0xce;}_0x2f5c0b[_0xf8be('0x2d')](_0x4ac056);return _0x2f5c0b['set'](_0xf8be('0x33'),_0x385643+'-'+_0x3f1e74+'/'+_0x128b8b)[_0xf8be('0x2f')](_0x306c38);}return null;};}function patchUpdates(_0x4310e4){return function(_0x1ea888){try{jsonpatch[_0xf8be('0x34')](_0x1ea888,_0x4310e4,!![]);}catch(_0xab42c8){return BPromise[_0xf8be('0x35')](_0xab42c8);}return _0x1ea888[_0xf8be('0x36')]();};}function saveUpdates(_0x2c7a52,_0x417918){return function(_0x3846c7){if(_0x3846c7){return _0x3846c7['update'](_0x2c7a52)[_0xf8be('0x21')](function(_0xc442ec){return _0xc442ec;});}return null;};}function removeEntity(_0x203998,_0x1ae831){return function(_0x593b00){if(_0x593b00){return _0x593b00[_0xf8be('0x37')]()['then'](function(){_0x203998[_0xf8be('0x2d')](0xcc)[_0xf8be('0x2e')]();});}};}function handleEntityNotFound(_0x3f6e14,_0x105d7c){return function(_0x531fd1){if(!_0x531fd1){_0x3f6e14['sendStatus'](0x194);}return _0x531fd1;};}function handleError(_0x3264c2,_0x4db291){_0x4db291=_0x4db291||0x1f4;return function(_0x46b7fa){logger['error'](_0x46b7fa[_0xf8be('0x38')]);if(_0x46b7fa[_0xf8be('0x39')]){delete _0x46b7fa[_0xf8be('0x39')];}_0x3264c2[_0xf8be('0x2d')](_0x4db291)[_0xf8be('0x3a')](_0x46b7fa);};}exports[_0xf8be('0x3b')]=function(_0x1ea62d,_0x1bbf02){var _0x4ee358={},_0x3caf7c={},_0x448631={'count':0x0,'rows':[]};var _0x4887c7=db['OpenchannelMessage'][_0xf8be('0x3c')];_0x3caf7c['model']=_[_0xf8be('0x3d')](_0x4887c7);_0x3caf7c[_0xf8be('0x3e')]=_[_0xf8be('0x3d')](_0x1ea62d['query']);_0x3caf7c[_0xf8be('0x3f')]=_['intersection'](_0x3caf7c[_0xf8be('0x40')],_0x3caf7c[_0xf8be('0x3e')]);_0x4ee358[_0xf8be('0x41')]=_[_0xf8be('0x42')](_0x3caf7c[_0xf8be('0x40')],qs[_0xf8be('0x43')](_0x1ea62d['query'][_0xf8be('0x43')]));_0x4ee358[_0xf8be('0x41')]=_0x4ee358[_0xf8be('0x41')][_0xf8be('0x44')]?_0x4ee358[_0xf8be('0x41')]:_0x3caf7c['model'];if(!_0x1ea62d[_0xf8be('0x3e')][_0xf8be('0x45')](_0xf8be('0x46'))){_0x4ee358[_0xf8be('0x32')]=qs['limit'](_0x1ea62d[_0xf8be('0x3e')][_0xf8be('0x32')]);_0x4ee358[_0xf8be('0x31')]=qs[_0xf8be('0x31')](_0x1ea62d['query'][_0xf8be('0x31')]);}_0x4ee358[_0xf8be('0x47')]=qs[_0xf8be('0x48')](_0x1ea62d[_0xf8be('0x3e')][_0xf8be('0x48')]);_0x4ee358[_0xf8be('0x49')]=qs[_0xf8be('0x3f')](_['pick'](_0x1ea62d[_0xf8be('0x3e')],_0x3caf7c[_0xf8be('0x3f')]));if(_0x1ea62d[_0xf8be('0x3e')][_0xf8be('0x4a')]){_0x4ee358[_0xf8be('0x49')]=_['merge'](_0x4ee358[_0xf8be('0x49')],{'$or':_['map'](_0x4887c7,function(_0x43766e){if(_0x43766e[_0xf8be('0x4b')][_0xf8be('0x4c')]!=='VIRTUAL'){var _0x2fc5d2={};_0x2fc5d2[_0x43766e['field']]={'$like':'%'+_0x1ea62d['query'][_0xf8be('0x4a')]+'%'};return _0x2fc5d2;}})});}_0x4ee358=_[_0xf8be('0x4d')]({},_0x4ee358,_0x1ea62d[_0xf8be('0x4e')]);var _0x3ff970={'where':_0x4ee358[_0xf8be('0x49')]};return db[_0xf8be('0x4f')]['count'](_0x3ff970)[_0xf8be('0x21')](function(_0x448900){_0x448631[_0xf8be('0x30')]=_0x448900;if(_0x1ea62d[_0xf8be('0x3e')][_0xf8be('0x50')]){_0x4ee358['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xf8be('0x51')](_0x4ee358);})[_0xf8be('0x21')](function(_0xb72b79){_0x448631[_0xf8be('0x52')]=_0xb72b79;return _0x448631;})['then'](respondWithFilteredResult(_0x1bbf02,_0x4ee358))[_0xf8be('0x2b')](handleError(_0x1bbf02,null));};exports['show']=function(_0x508c37,_0x1bdd07){var _0x34297b={'raw':!![],'where':{'id':_0x508c37[_0xf8be('0x53')]['id']}},_0x44e253={};_0x44e253[_0xf8be('0x40')]=_['keys'](db['OpenchannelMessage'][_0xf8be('0x3c')]);_0x44e253['query']=_[_0xf8be('0x3d')](_0x508c37['query']);_0x44e253[_0xf8be('0x3f')]=_['intersection'](_0x44e253[_0xf8be('0x40')],_0x44e253[_0xf8be('0x3e')]);_0x34297b['attributes']=_[_0xf8be('0x42')](_0x44e253[_0xf8be('0x40')],qs['fields'](_0x508c37[_0xf8be('0x3e')][_0xf8be('0x43')]));_0x34297b[_0xf8be('0x41')]=_0x34297b[_0xf8be('0x41')][_0xf8be('0x44')]?_0x34297b['attributes']:_0x44e253['model'];if(_0x508c37[_0xf8be('0x3e')]['includeAll']){_0x34297b[_0xf8be('0x54')]=[{'all':!![]}];}_0x34297b=_[_0xf8be('0x4d')]({},_0x34297b,_0x508c37[_0xf8be('0x4e')]);return db['OpenchannelMessage']['find'](_0x34297b)[_0xf8be('0x21')](handleEntityNotFound(_0x1bdd07,null))['then'](respondWithResult(_0x1bdd07,null))[_0xf8be('0x2b')](handleError(_0x1bdd07,null));};exports[_0xf8be('0x55')]=function(_0x55b121,_0x553330){return db[_0xf8be('0x4f')][_0xf8be('0x55')](_0x55b121['body'],{})[_0xf8be('0x21')](respondWithResult(_0x553330,0xc9))['catch'](handleError(_0x553330,null));};exports[_0xf8be('0x56')]=function(_0x32b7b3,_0x773f3f){if(_0x32b7b3[_0xf8be('0x57')]['id']){delete _0x32b7b3['body']['id'];}return db[_0xf8be('0x4f')][_0xf8be('0x58')]({'where':{'id':_0x32b7b3[_0xf8be('0x53')]['id']}})[_0xf8be('0x21')](handleEntityNotFound(_0x773f3f,null))[_0xf8be('0x21')](saveUpdates(_0x32b7b3[_0xf8be('0x57')],null))[_0xf8be('0x21')](respondWithResult(_0x773f3f,null))['catch'](handleError(_0x773f3f,null));};exports['destroy']=function(_0x35ea9e,_0x21d229){return db[_0xf8be('0x4f')][_0xf8be('0x58')]({'where':{'id':_0x35ea9e['params']['id']}})['then'](handleEntityNotFound(_0x21d229,null))[_0xf8be('0x21')](removeEntity(_0x21d229,null))['catch'](handleError(_0x21d229,null));};exports[_0xf8be('0x59')]=function(_0x2b6095,_0x11143b){return db[_0xf8be('0x4f')][_0xf8be('0x59')]()['then'](respondWithResult(_0x11143b,null))['catch'](handleError(_0x11143b,null));};var interaction_log=require(_0xf8be('0x14'))('openchannel-interactions');exports[_0xf8be('0x5a')]=function(_0x3a9c69,_0x47f137,_0x755fa5){var _0x409236={'channel':_0xf8be('0x5b')};if(_0x3a9c69[_0xf8be('0x57')]['id']){delete _0x3a9c69[_0xf8be('0x57')]['id'];}_0x3a9c69[_0xf8be('0x57')]['read']=!![];_0x3a9c69['body']['readAt']=moment()[_0xf8be('0x5c')](_0xf8be('0x5d'));_0x3a9c69[_0xf8be('0x57')][_0xf8be('0x5e')]=_0x3a9c69['body']['UserId']||_0x3a9c69[_0xf8be('0x5f')]['id'];return db[_0xf8be('0x4f')][_0xf8be('0x58')]({'where':{'id':_0x3a9c69[_0xf8be('0x53')]['id'],'UserId':null},'include':[{'model':db[_0xf8be('0x60')],'as':'Contact'}]})[_0xf8be('0x21')](handleEntityNotFound(_0x47f137,null))[_0xf8be('0x21')](saveUpdates(_0x3a9c69[_0xf8be('0x57')],null))[_0xf8be('0x21')](function(_0x5b82dd){if(_0x5b82dd){_0x409236['message']=_0x5b82dd[_0xf8be('0x61')]({'plain':!![]});return db[_0xf8be('0x62')]['find']({'where':{'id':_0x5b82dd[_0xf8be('0x63')]}});}return null;})[_0xf8be('0x21')](handleEntityNotFound(_0x47f137,null))[_0xf8be('0x21')](function(_0x3df782){if(_0x3df782){return _0x3df782[_0xf8be('0x56')]({'UserId':_0x3a9c69[_0xf8be('0x57')][_0xf8be('0x5e')],'read1stAt':_[_0xf8be('0x64')](_0x3df782[_0xf8be('0x65')])?moment()[_0xf8be('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf8be('0x21')](function(_0x10553d){if(_0x10553d){_0x409236[_0xf8be('0x66')]=_0x10553d['get']({'plain':!![]});interaction_log[_0xf8be('0x2a')](_0xf8be('0x67'),_0x3a9c69['user']['id'],_0x3a9c69[_0xf8be('0x5f')][_0xf8be('0x39')],_0x3a9c69[_0xf8be('0x5f')][_0xf8be('0x68')],_0x409236[_0xf8be('0x66')]['id'],_0x3a9c69['body']?JSON[_0xf8be('0x26')](_0x3a9c69[_0xf8be('0x57')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x409236);}return null;})[_0xf8be('0x21')](function(_0x3a616a){if(_0x3a616a){if(_0x3a9c69[_0xf8be('0x57')][_0xf8be('0x69')]){_0x409236[_0xf8be('0x29')]['interface']=util[_0xf8be('0x5c')](_0xf8be('0x6a'),_0x3a9c69['user'][_0xf8be('0x39')]);_0x409236[_0xf8be('0x29')]['channel']=_0x409236[_0xf8be('0x6b')];_0x409236[_0xf8be('0x29')][_0xf8be('0x6c')]=_0xf8be('0x5a');return respondWithRpcPromise('EventManager',_0xf8be('0x6d'),{'event':_0xf8be('0x6e'),'message':_0x409236[_0xf8be('0x29')]},client9002)[_0xf8be('0x21')](function(){return _0x409236;});}return _0x409236;}return null;})['then'](respondWithResult(_0x47f137,null))[_0xf8be('0x2b')](handleError(_0x47f137,null));};var interaction_log=require(_0xf8be('0x14'))(_0xf8be('0x6f'));exports[_0xf8be('0x35')]=function(_0x5dce52,_0x34b582,_0x192ce5){var _0x5b0101={'agent':{},'channel':'openchannel'};if(_0x5dce52['body']['id']){delete _0x5dce52[_0xf8be('0x57')]['id'];}_0x5dce52[_0xf8be('0x57')][_0xf8be('0x5e')]=_0x5dce52[_0xf8be('0x57')][_0xf8be('0x5e')]||_0x5dce52[_0xf8be('0x5f')]['id'];_0x5b0101['agent']['id']=_0x5dce52[_0xf8be('0x57')][_0xf8be('0x5e')];return db[_0xf8be('0x4f')][_0xf8be('0x58')]({'where':{'id':_0x5dce52[_0xf8be('0x53')]['id'],'UserId':null}})[_0xf8be('0x21')](handleEntityNotFound(_0x34b582,null))[_0xf8be('0x21')](function(_0x583397){if(_0x583397){_0x5b0101[_0xf8be('0x29')]=_0x583397[_0xf8be('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf8be('0x58')]({'where':{'id':_0x583397['OpenchannelInteractionId']}});}return null;})[_0xf8be('0x21')](handleEntityNotFound(_0x34b582,null))[_0xf8be('0x21')](function(_0x21fa48){if(_0x21fa48){_0x5b0101[_0xf8be('0x66')]=_0x21fa48['get']({'plain':!![]});interaction_log['info'](_0xf8be('0x70'),_0x5dce52[_0xf8be('0x5f')]['id'],_0x5dce52[_0xf8be('0x5f')][_0xf8be('0x39')],_0x5dce52['user'][_0xf8be('0x68')],_0x5b0101['interaction']['id'],_0x5dce52['body']?JSON[_0xf8be('0x26')](_0x5dce52['body']):_0xf8be('0x71'));return respondWithRpcPromise(_0xf8be('0x72'),'rejectMessage',_0x5b0101);}return null;})[_0xf8be('0x21')](function(_0x3d4fb7){if(_0x3d4fb7){_0x3d4fb7['message']['interface']=util[_0xf8be('0x5c')](_0xf8be('0x6a'),_0x5dce52[_0xf8be('0x5f')][_0xf8be('0x39')]);_0x3d4fb7[_0xf8be('0x29')]['channel']=_0x5b0101[_0xf8be('0x6b')];_0x3d4fb7['message'][_0xf8be('0x6c')]=_0xf8be('0x35');respondWithRpcPromise('EventManager',_0xf8be('0x6d'),{'event':_0xf8be('0x73'),'message':_0x3d4fb7['message']},client9002);return _0x5b0101;}return null;})['then'](respondWithResult(_0x34b582,null))['catch'](handleError(_0x34b582,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 84e68b9..2d5a5e8 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 _0xf12e=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xf12e,0x169));var _0xef12=function(_0x1efa5c,_0x4deafb){_0x1efa5c=_0x1efa5c-0x0;var _0x4f8376=_0xf12e[_0x1efa5c];return _0x4f8376;};'use strict';var EventEmitter=require(_0xef12('0x0'));var OpenchannelMessage=require(_0xef12('0x1'))['db'][_0xef12('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xef12('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef12('0x4'),'afterDestroy':_0xef12('0x5')};function emitEvent(_0x1329c9){return function(_0x2c3a11,_0x71fdfe,_0xfd7db4){OpenchannelMessageEvents[_0xef12('0x6')](_0x1329c9+':'+_0x2c3a11['id'],_0x2c3a11);OpenchannelMessageEvents[_0xef12('0x6')](_0x1329c9,_0x2c3a11);_0xfd7db4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xef12('0x7')](e,emitEvent(event));}}module[_0xef12('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x586d=['remove','emit','hasOwnProperty','OpenchannelMessage','setMaxListeners','save'];(function(_0x47e5fb,_0x5338ba){var _0x1985f5=function(_0x32e33b){while(--_0x32e33b){_0x47e5fb['push'](_0x47e5fb['shift']());}};_0x1985f5(++_0x5338ba);}(_0x586d,0x189));var _0xd586=function(_0x56068e,_0x10dfb6){_0x56068e=_0x56068e-0x0;var _0x42ffc7=_0x586d[_0x56068e];return _0x42ffc7;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xd586('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd586('0x1')](0x0);var events={'afterCreate':_0xd586('0x2'),'afterUpdate':'update','afterDestroy':_0xd586('0x3')};function emitEvent(_0x3361a1){return function(_0x41c13b,_0x2a6fb2,_0x377753){OpenchannelMessageEvents[_0xd586('0x4')](_0x3361a1+':'+_0x41c13b['id'],_0x41c13b);OpenchannelMessageEvents[_0xd586('0x4')](_0x3361a1,_0x41c13b);_0x377753(null);};}for(var e in events){if(events[_0xd586('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e6690c6..f2e66b2 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 _0xd9bd=['UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','Interaction','afterCreate','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','models','get','direction','toLowerCase','secret','isNil'];(function(_0x1cf97e,_0x60691b){var _0x1ab316=function(_0x4067e2){while(--_0x4067e2){_0x1cf97e['push'](_0x1cf97e['shift']());}};_0x1ab316(++_0x60691b);}(_0xd9bd,0x18e));var _0xdd9b=function(_0x1f7ad9,_0x57c2d2){_0x1f7ad9=_0x1f7ad9-0x0;var _0x574696=_0xd9bd[_0x1f7ad9];return _0x574696;};'use strict';var _=require(_0xdd9b('0x0'));var util=require(_0xdd9b('0x1'));var logger=require(_0xdd9b('0x2'))('api');var moment=require(_0xdd9b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd9b('0x4'));var rimraf=require(_0xdd9b('0x5'));var config=require(_0xdd9b('0x6'));var attributes=require(_0xdd9b('0x7'));module[_0xdd9b('0x8')]=function(_0x1c8c7f,_0x2d9408){return _0x1c8c7f['define'](_0xdd9b('0x9'),attributes,{'tableName':_0xdd9b('0xa'),'paranoid':![],'indexes':[{'name':_0xdd9b('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d6ab,_0x2b25c2,_0x38ef33){var _0x1553ed=_0x1c8c7f[_0xdd9b('0xc')];var _0x2b5123=_0x47d6ab[_0xdd9b('0xd')]({'plain':!![]});if(_0x2b5123[_0xdd9b('0xe')][_0xdd9b('0xf')]()==='in'||_0x2b5123[_0xdd9b('0xe')][_0xdd9b('0xf')]()==='out'&&!_0x2b5123[_0xdd9b('0x10')]&&!_[_0xdd9b('0x11')](_0x2b5123[_0xdd9b('0x12')])){_0x1553ed[_0xdd9b('0x13')][_0xdd9b('0x14')]({'where':{'id':_0x2b5123[_0xdd9b('0x15')]}})[_0xdd9b('0x16')](function(_0x535e36){if(_0x535e36){_0x535e36[_0xdd9b('0x17')]({'lastMsgAt':_0x2b5123[_0xdd9b('0x18')],'lastMsgDirection':_0x2b5123['direction'][_0xdd9b('0xf')]()});}})[_0xdd9b('0x19')](function(_0x1b96a9){console[_0xdd9b('0x1a')](_0x1b96a9);});}if(_0x2b5123[_0xdd9b('0xe')]===_0xdd9b('0x1b')&&!_0x2b5123['secret']){var _0x3c3199;_0x1553ed[_0xdd9b('0x1c')][_0xdd9b('0x1d')]()[_0xdd9b('0x16')](function(_0x3fd7f6){return _0x1553ed[_0xdd9b('0x1e')][_0xdd9b('0x1f')]({'where':{'id':_0x2b5123[_0xdd9b('0x20')]},'include':[{'model':_0x1553ed[_0xdd9b('0x13')],'as':_0xdd9b('0x21'),'where':{'id':_0x2b5123[_0xdd9b('0x15')]},'limit':0x1,'include':[{'model':_0x1553ed[_0xdd9b('0x1c')],'as':_0xdd9b('0x22'),'attributes':_['keys'](_0x3fd7f6)}]}]});})[_0xdd9b('0x16')](function(_0x17afeb){_0x3c3199=_0x17afeb[_0xdd9b('0xd')]({'plain':!![]});if(_0x3c3199&&_0x3c3199['replyUri']){logger[_0xdd9b('0x23')](_0xdd9b('0x24'),'afterCreate',util[_0xdd9b('0x25')](_0xdd9b('0x26'),_0x2b5123['id'],_0x3c3199[_0xdd9b('0x27')]));if(_0x3c3199['Interactions']&&_0x3c3199[_0xdd9b('0x21')][_0xdd9b('0x28')]){_0x2b5123['Interaction']=_['omit'](_0x3c3199[_0xdd9b('0x21')][0x0],_0xdd9b('0x22'));_0x2b5123['Contact']=_0x3c3199[_0xdd9b('0x21')][0x0][_0xdd9b('0x22')];}var _0x2b25c2={'method':_0xdd9b('0x29'),'uri':encodeURI(_0x3c3199[_0xdd9b('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2b25c2[_0xdd9b('0x2a')]){case _0xdd9b('0x2b'):_0x2b25c2['qs']=_0x2b5123;break;case _0xdd9b('0x29'):_0x2b25c2['body']=_0x2b5123;break;}return rp(_0x2b25c2)[_0xdd9b('0x16')](function(_0x46e3f1){logger['info'](_0xdd9b('0x24'),'afterCreate',util[_0xdd9b('0x25')](_0xdd9b('0x2c'),_0x2b5123['id'],_0x3c3199['replyUri']));if(_0x46e3f1[_0xdd9b('0x2d')][_0xdd9b('0x2e')]&&_0x46e3f1[_0xdd9b('0x2d')]['threadId']!=_0x2b5123[_0xdd9b('0x2f')]['threadId']){return _0x1553ed[_0xdd9b('0x13')]['update']({'threadId':_0x46e3f1[_0xdd9b('0x2d')][_0xdd9b('0x2e')]},{'logging':!![],'where':{'id':_0x2b5123[_0xdd9b('0x2f')]['id']}});}else{return;}})['then'](function(){return _0x47d6ab[_0xdd9b('0x17')]({'read':!![]});})[_0xdd9b('0x19')](function(_0x387e79){logger[_0xdd9b('0x1a')](_0xdd9b('0x24'),_0xdd9b('0x30'),util[_0xdd9b('0x31')](_0x387e79,{'showHidden':![],'depth':null}));_0x38ef33();});}else{_0x38ef33();}})[_0xdd9b('0x32')](function(){_0x38ef33();});}else{_0x38ef33();}}},'charset':'utf8mb4','collate':_0xdd9b('0x33')});}; \ No newline at end of file +var _0x0969=['utf8mb4','lodash','api','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0969,0x166));var _0x9096=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0969[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x9096('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9096('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9096('0x2'));var rimraf=require(_0x9096('0x3'));var config=require(_0x9096('0x4'));var attributes=require(_0x9096('0x5'));module[_0x9096('0x6')]=function(_0x2bc954,_0x33f797){return _0x2bc954[_0x9096('0x7')](_0x9096('0x8'),attributes,{'tableName':_0x9096('0x9'),'paranoid':![],'indexes':[{'name':_0x9096('0xa'),'fields':[_0x9096('0xb')],'type':_0x9096('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b2be0,_0xac4d8d,_0x3e96fe){var _0x344d70=_0x2bc954[_0x9096('0xd')];var _0x5ec3e0=_0x3b2be0['get']({'plain':!![]});if(_0x5ec3e0[_0x9096('0xe')][_0x9096('0xf')]()==='in'||_0x5ec3e0[_0x9096('0xe')][_0x9096('0xf')]()===_0x9096('0x10')&&!_0x5ec3e0[_0x9096('0x11')]&&!_[_0x9096('0x12')](_0x5ec3e0[_0x9096('0x13')])){_0x344d70[_0x9096('0x14')][_0x9096('0x15')]({'where':{'id':_0x5ec3e0[_0x9096('0x16')]}})[_0x9096('0x17')](function(_0x28a56d){if(_0x28a56d){_0x28a56d[_0x9096('0x18')]({'lastMsgAt':_0x5ec3e0[_0x9096('0x19')],'lastMsgDirection':_0x5ec3e0['direction'][_0x9096('0xf')]()});}})['catch'](function(_0x504124){console[_0x9096('0x1a')](_0x504124);});}if(_0x5ec3e0[_0x9096('0xe')]===_0x9096('0x10')&&!_0x5ec3e0[_0x9096('0x11')]){var _0x1e3db2;_0x344d70[_0x9096('0x1b')][_0x9096('0x1c')]()[_0x9096('0x17')](function(_0x33d72c){return _0x344d70[_0x9096('0x1d')][_0x9096('0x1e')]({'where':{'id':_0x5ec3e0[_0x9096('0x1f')]},'include':[{'model':_0x344d70[_0x9096('0x14')],'as':_0x9096('0x20'),'where':{'id':_0x5ec3e0[_0x9096('0x16')]},'limit':0x1,'include':[{'model':_0x344d70['CmContact'],'as':_0x9096('0x21'),'attributes':_['keys'](_0x33d72c)}]}]});})[_0x9096('0x17')](function(_0x29e3c4){_0x1e3db2=_0x29e3c4[_0x9096('0x22')]({'plain':!![]});if(_0x1e3db2&&_0x1e3db2[_0x9096('0x23')]){logger[_0x9096('0x24')](_0x9096('0x25'),'afterCreate',util['format'](_0x9096('0x26'),_0x5ec3e0['id'],_0x1e3db2[_0x9096('0x23')]));if(_0x1e3db2[_0x9096('0x20')]&&_0x1e3db2['Interactions'][_0x9096('0x27')]){_0x5ec3e0[_0x9096('0x28')]=_[_0x9096('0x29')](_0x1e3db2['Interactions'][0x0],'Contact');_0x5ec3e0[_0x9096('0x21')]=_0x1e3db2['Interactions'][0x0][_0x9096('0x21')];}var _0xac4d8d={'method':_0x9096('0x2a'),'uri':encodeURI(_0x1e3db2[_0x9096('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xac4d8d[_0x9096('0x2b')]){case _0x9096('0x2c'):_0xac4d8d['qs']=_0x5ec3e0;break;case _0x9096('0x2a'):_0xac4d8d[_0x9096('0xb')]=_0x5ec3e0;break;}return rp(_0xac4d8d)[_0x9096('0x17')](function(_0x2763e2){logger[_0x9096('0x24')](_0x9096('0x25'),_0x9096('0x2d'),util['format'](_0x9096('0x2e'),_0x5ec3e0['id'],_0x1e3db2['replyUri']));if(_0x2763e2[_0x9096('0xb')][_0x9096('0x2f')]&&_0x2763e2[_0x9096('0xb')][_0x9096('0x2f')]!=_0x5ec3e0['Interaction']['threadId']){return _0x344d70[_0x9096('0x14')]['update']({'threadId':_0x2763e2[_0x9096('0xb')][_0x9096('0x2f')]},{'logging':!![],'where':{'id':_0x5ec3e0[_0x9096('0x28')]['id']}});}else{return;}})[_0x9096('0x17')](function(){return _0x3b2be0['update']({'read':!![]});})['catch'](function(_0x2a1ed1){logger[_0x9096('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0x9096('0x2d'),util[_0x9096('0x30')](_0x2a1ed1,{'showHidden':![],'depth':null}));_0x3e96fe();});}else{_0x3e96fe();}})[_0x9096('0x31')](function(){_0x3e96fe();});}else{_0x3e96fe();}}},'charset':_0x9096('0x32'),'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 24dcba5..8f8bf97 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 _0x982f=['raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','OpenchannelMessage','create','options'];(function(_0x2b7d40,_0xbe4d33){var _0x46d1ea=function(_0x1403ef){while(--_0x1403ef){_0x2b7d40['push'](_0x2b7d40['shift']());}};_0x46d1ea(++_0xbe4d33);}(_0x982f,0x1b5));var _0xf982=function(_0x25cdff,_0x3820a5){_0x25cdff=_0x25cdff-0x0;var _0x49624a=_0x982f[_0x25cdff];return _0x49624a;};'use strict';var _=require('lodash');var util=require(_0xf982('0x0'));var moment=require(_0xf982('0x1'));var BPromise=require(_0xf982('0x2'));var rs=require(_0xf982('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf982('0x4'))['db'];var utils=require(_0xf982('0x5'));var logger=require(_0xf982('0x6'))(_0xf982('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf982('0x8')]({'port':0x232a});config[_0xf982('0x9')]=_[_0xf982('0xa')](config['redis'],{'host':_0xf982('0xb'),'port':0x18eb});var socket=require(_0xf982('0xc'))(new Redis(config[_0xf982('0x9')]));require(_0xf982('0xd'))[_0xf982('0xe')](socket);function respondWithRpcPromise(_0x17997d,_0x417f2c,_0x463baf){return new BPromise(function(_0x296b05,_0x287cbc){return client[_0xf982('0xf')](_0x17997d,_0x463baf)['then'](function(_0x4cabf5){logger[_0xf982('0x10')](_0xf982('0x11'),_0x417f2c,_0xf982('0x12'));logger[_0xf982('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x417f2c,'request\x20sent',JSON[_0xf982('0x14')](_0x4cabf5));if(_0x4cabf5[_0xf982('0x15')]){if(_0x4cabf5['error']['code']===0x1f4){logger[_0xf982('0x15')](_0xf982('0x11'),_0x417f2c,_0x4cabf5[_0xf982('0x15')][_0xf982('0x16')]);return _0x287cbc(_0x4cabf5[_0xf982('0x15')][_0xf982('0x16')]);}logger[_0xf982('0x15')](_0xf982('0x11'),_0x417f2c,_0x4cabf5['error'][_0xf982('0x16')]);return _0x296b05(_0x4cabf5[_0xf982('0x15')][_0xf982('0x16')]);}else{logger[_0xf982('0x10')](_0xf982('0x11'),_0x417f2c,'request\x20sent');_0x296b05(_0x4cabf5[_0xf982('0x17')]['message']);}})[_0xf982('0x18')](function(_0x1e17bd){logger[_0xf982('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x417f2c,_0x1e17bd);_0x287cbc(_0x1e17bd);});});}exports['CreateOpenchannelMessage']=function(_0xf8832d){var _0x137b83=this;return new Promise(function(_0x1a42af,_0x3a0796){return db[_0xf982('0x19')][_0xf982('0x1a')](_0xf8832d['body'],{'raw':_0xf8832d[_0xf982('0x1b')]?_0xf8832d['options'][_0xf982('0x1c')]===undefined?!![]:![]:!![]})[_0xf982('0x1d')](function(_0x57cd34){logger[_0xf982('0x10')]('CreateOpenchannelMessage',_0xf8832d);logger[_0xf982('0x13')](_0xf982('0x1e'),_0xf8832d,JSON[_0xf982('0x14')](_0x57cd34));_0x1a42af(_0x57cd34);})[_0xf982('0x18')](function(_0x738794){logger['error'](_0xf982('0x1e'),_0x738794[_0xf982('0x16')],_0xf8832d);_0x3a0796(_0x137b83[_0xf982('0x15')](0x1f4,_0x738794[_0xf982('0x16')]));});});}; \ No newline at end of file +var _0xd6eb=['rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','then','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x5a5b6f,_0x561c3d){var _0x54c5a6=function(_0x2d7f8f){while(--_0x2d7f8f){_0x5a5b6f['push'](_0x5a5b6f['shift']());}};_0x54c5a6(++_0x561c3d);}(_0xd6eb,0x18d));var _0xbd6e=function(_0x123948,_0x33d5b7){_0x123948=_0x123948-0x0;var _0x5c971a=_0xd6eb[_0x123948];return _0x5c971a;};'use strict';var _=require(_0xbd6e('0x0'));var util=require(_0xbd6e('0x1'));var moment=require('moment');var BPromise=require(_0xbd6e('0x2'));var rs=require(_0xbd6e('0x3'));var fs=require('fs');var Redis=require(_0xbd6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbd6e('0x5'))(_0xbd6e('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd6e('0x7'));var client=jayson[_0xbd6e('0x8')]['http']({'port':0x232a});config[_0xbd6e('0x9')]=_[_0xbd6e('0xa')](config[_0xbd6e('0x9')],{'host':_0xbd6e('0xb'),'port':0x18eb});var socket=require(_0xbd6e('0xc'))(new Redis(config[_0xbd6e('0x9')]));require(_0xbd6e('0xd'))[_0xbd6e('0xe')](socket);function respondWithRpcPromise(_0x180781,_0x316b5c,_0x42677f){return new BPromise(function(_0x26729a,_0x1f7454){return client['request'](_0x180781,_0x42677f)['then'](function(_0x1f7541){logger[_0xbd6e('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x316b5c,_0xbd6e('0x10'));logger['debug'](_0xbd6e('0x11'),_0x316b5c,_0xbd6e('0x10'),JSON[_0xbd6e('0x12')](_0x1f7541));if(_0x1f7541[_0xbd6e('0x13')]){if(_0x1f7541[_0xbd6e('0x13')][_0xbd6e('0x14')]===0x1f4){logger[_0xbd6e('0x13')](_0xbd6e('0x15'),_0x316b5c,_0x1f7541[_0xbd6e('0x13')][_0xbd6e('0x16')]);return _0x1f7454(_0x1f7541[_0xbd6e('0x13')][_0xbd6e('0x16')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x316b5c,_0x1f7541[_0xbd6e('0x13')][_0xbd6e('0x16')]);return _0x26729a(_0x1f7541[_0xbd6e('0x13')][_0xbd6e('0x16')]);}else{logger[_0xbd6e('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x316b5c,_0xbd6e('0x10'));_0x26729a(_0x1f7541[_0xbd6e('0x17')][_0xbd6e('0x16')]);}})[_0xbd6e('0x18')](function(_0x1cc27a){logger[_0xbd6e('0x13')](_0xbd6e('0x15'),_0x316b5c,_0x1cc27a);_0x1f7454(_0x1cc27a);});});}exports[_0xbd6e('0x19')]=function(_0x240cef){var _0x3b2407=this;return new Promise(function(_0x2c510e,_0x529e8d){return db[_0xbd6e('0x1a')]['create'](_0x240cef[_0xbd6e('0x1b')],{'raw':_0x240cef[_0xbd6e('0x1c')]?_0x240cef[_0xbd6e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xbd6e('0x1d')](function(_0x3cd56d){logger[_0xbd6e('0xf')]('CreateOpenchannelMessage',_0x240cef);logger[_0xbd6e('0x1e')](_0xbd6e('0x19'),_0x240cef,JSON[_0xbd6e('0x12')](_0x3cd56d));_0x2c510e(_0x3cd56d);})[_0xbd6e('0x18')](function(_0x21a565){logger[_0xbd6e('0x13')](_0xbd6e('0x19'),_0x21a565[_0xbd6e('0x16')],_0x240cef);_0x529e8d(_0x3b2407['error'](0x1f4,_0x21a565['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 485eec5..3af69ce 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 _0x72b1=['register','length','./openchannelMessage.events','remove','update','emit','removeListener'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x72b1,0x16e));var _0x172b=function(_0x464245,_0x8e8237){_0x464245=_0x464245-0x0;var _0x5368a5=_0x72b1[_0x464245];return _0x5368a5;};'use strict';var OpenchannelMessageEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){OpenchannelMessageEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('openchannelMessage:'+_0x517363,_0x475fd6);OpenchannelMessageEvents['on'](_0x517363,_0x1f98e9);}}; \ No newline at end of file +var _0x85d0=['emit','register','length','openchannelMessage:'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0x85d0,0x164));var _0x085d=function(_0x2fa134,_0x54e460){_0x2fa134=_0x2fa134-0x0;var _0x5a800f=_0x85d0[_0x2fa134];return _0x5a800f;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){OpenchannelMessageEvents['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);OpenchannelMessageEvents['on'](_0x4a12b7,_0xf65d01);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 43233d2..446c423 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 _0x342f=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x144a14,_0x33d227){var _0x2ae606=function(_0x339880){while(--_0x339880){_0x144a14['push'](_0x144a14['shift']());}};_0x2ae606(++_0x33d227);}(_0x342f,0x184));var _0xf342=function(_0x35726f,_0x69be51){_0x35726f=_0x35726f-0x0;var _0x3595fc=_0x342f[_0x35726f];return _0x3595fc;};'use strict';var multer=require(_0xf342('0x0'));var util=require(_0xf342('0x1'));var path=require('path');var timeout=require(_0xf342('0x2'));var express=require(_0xf342('0x3'));var router=express[_0xf342('0x4')]();var auth=require(_0xf342('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf342('0x6'));var controller=require(_0xf342('0x7'));router[_0xf342('0x8')]('/',auth['isAuthenticated'](),controller[_0xf342('0x9')]);router[_0xf342('0x8')](_0xf342('0xa'),auth[_0xf342('0xb')](),controller[_0xf342('0xc')]);router['get'](_0xf342('0xd'),auth[_0xf342('0xb')](),controller[_0xf342('0xe')]);router[_0xf342('0x8')](_0xf342('0xf'),auth[_0xf342('0xb')](),controller[_0xf342('0x10')]);router[_0xf342('0x8')](_0xf342('0x11'),auth['isAuthenticated'](),controller[_0xf342('0x12')]);router[_0xf342('0x8')](_0xf342('0x13'),auth[_0xf342('0xb')](),controller[_0xf342('0x14')]);router[_0xf342('0x15')]('/',auth['isAuthenticated'](),controller[_0xf342('0x16')]);router[_0xf342('0x15')](_0xf342('0x11'),auth[_0xf342('0xb')](),controller[_0xf342('0x17')]);router[_0xf342('0x15')](_0xf342('0x13'),auth['isAuthenticated'](),controller[_0xf342('0x18')]);router[_0xf342('0x19')](_0xf342('0xd'),auth[_0xf342('0xb')](),controller['update']);router[_0xf342('0x1a')]('/:id',auth[_0xf342('0xb')](),controller[_0xf342('0x1b')]);router[_0xf342('0x1a')](_0xf342('0x11'),auth['isAuthenticated'](),controller[_0xf342('0x1c')]);router[_0xf342('0x1a')](_0xf342('0x13'),auth[_0xf342('0xb')](),controller[_0xf342('0x1d')]);module[_0xf342('0x1e')]=router; \ No newline at end of file +var _0x44fa=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x734fb5,_0x458d4f){var _0x405e90=function(_0x8fc981){while(--_0x8fc981){_0x734fb5['push'](_0x734fb5['shift']());}};_0x405e90(++_0x458d4f);}(_0x44fa,0x13e));var _0xa44f=function(_0x235667,_0x1abd04){_0x235667=_0x235667-0x0;var _0x44f920=_0x44fa[_0x235667];return _0x44f920;};'use strict';var multer=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var path=require(_0xa44f('0x2'));var timeout=require(_0xa44f('0x3'));var express=require(_0xa44f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa44f('0x5'));var config=require(_0xa44f('0x6'));var controller=require('./openchannelQueue.controller');router[_0xa44f('0x7')]('/',auth['isAuthenticated'](),controller[_0xa44f('0x8')]);router[_0xa44f('0x7')](_0xa44f('0x9'),auth[_0xa44f('0xa')](),controller['describe']);router[_0xa44f('0x7')](_0xa44f('0xb'),auth[_0xa44f('0xa')](),controller[_0xa44f('0xc')]);router[_0xa44f('0x7')](_0xa44f('0xd'),auth[_0xa44f('0xa')](),controller[_0xa44f('0xe')]);router[_0xa44f('0x7')](_0xa44f('0xf'),auth[_0xa44f('0xa')](),controller[_0xa44f('0x10')]);router[_0xa44f('0x7')](_0xa44f('0x11'),auth['isAuthenticated'](),controller[_0xa44f('0x12')]);router[_0xa44f('0x13')]('/',auth[_0xa44f('0xa')](),controller['create']);router[_0xa44f('0x13')]('/:id/teams',auth[_0xa44f('0xa')](),controller[_0xa44f('0x14')]);router[_0xa44f('0x13')]('/:id/users',auth[_0xa44f('0xa')](),controller[_0xa44f('0x15')]);router['put'](_0xa44f('0xb'),auth[_0xa44f('0xa')](),controller[_0xa44f('0x16')]);router[_0xa44f('0x17')](_0xa44f('0xb'),auth['isAuthenticated'](),controller[_0xa44f('0x18')]);router['delete'](_0xa44f('0xf'),auth[_0xa44f('0xa')](),controller['removeTeams']);router[_0xa44f('0x17')](_0xa44f('0x11'),auth[_0xa44f('0xa')](),controller[_0xa44f('0x19')]);module[_0xa44f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 3a237d8..3ef2626 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 _0x7163=['sequelize','exports','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x7163,0x1ab));var _0x3716=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x7163[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x3716('0x0'));module[_0x3716('0x1')]={'name':{'type':Sequelize[_0x3716('0x2')],'unique':_0x3716('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3716('0x2')]},'timeout':{'type':Sequelize[_0x3716('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3716('0x5'),'beepall',_0x3716('0x6'))}}; \ No newline at end of file +var _0x7bbd=['exports','STRING','name','beepall','roundrobin','sequelize'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x7bbd,0x11f));var _0xd7bb=function(_0x4e1d4a,_0x3c090a){_0x4e1d4a=_0x4e1d4a-0x0;var _0x1395a2=_0x7bbd[_0x4e1d4a];return _0x1395a2;};'use strict';var Sequelize=require(_0xd7bb('0x0'));module[_0xd7bb('0x1')]={'name':{'type':Sequelize[_0xd7bb('0x2')],'unique':_0xd7bb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd7bb('0x4'),_0xd7bb('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e8c3659..5b821cb 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 _0xa2e4=['localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','OpenchannelQueue','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','destroy','describe','UserOpenchannelQueue','findAndCountAll','UserId','openchannelPause','createdAt','rows','%s/%s','updatedAt','getTeams','findOne','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','union','compact','ids','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','spread','isArray','pick','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults'];(function(_0x245f1f,_0x3eaca4){var _0x561b1b=function(_0x440244){while(--_0x440244){_0x245f1f['push'](_0x245f1f['shift']());}};_0x561b1b(++_0x3eaca4);}(_0xa2e4,0xee));var _0x4a2e=function(_0x3dac2c,_0x2ad312){_0x3dac2c=_0x3dac2c-0x0;var _0x23f73a=_0xa2e4[_0x3dac2c];return _0x23f73a;};'use strict';var pdf=require(_0x4a2e('0x0'));var emlformat=require(_0x4a2e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4a2e('0x2'));var jsonpatch=require(_0x4a2e('0x3'));var rp=require(_0x4a2e('0x4'));var moment=require(_0x4a2e('0x5'));var BPromise=require(_0x4a2e('0x6'));var Mustache=require('mustache');var util=require(_0x4a2e('0x7'));var path=require(_0x4a2e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4a2e('0x9'));var fs=require('fs');var _=require(_0x4a2e('0xa'));var squel=require(_0x4a2e('0xb'));var crypto=require(_0x4a2e('0xc'));var jsforce=require(_0x4a2e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4a2e('0xe'));var querystring=require(_0x4a2e('0xf'));var Papa=require(_0x4a2e('0x10'));var Redis=require('ioredis');var authService=require(_0x4a2e('0x11'));var qs=require(_0x4a2e('0x12'));var hardwareService=require(_0x4a2e('0x13'));var logger=require(_0x4a2e('0x14'))(_0x4a2e('0x15'));var utils=require(_0x4a2e('0x16'));var config=require('../../config/environment');var db=require(_0x4a2e('0x17'))['db'];config[_0x4a2e('0x18')]=_[_0x4a2e('0x19')](config[_0x4a2e('0x18')],{'host':_0x4a2e('0x1a'),'port':0x18eb});var socket=require(_0x4a2e('0x1b'))(new Redis(config[_0x4a2e('0x18')]));require('./openchannelQueue.socket')[_0x4a2e('0x1c')](socket);function respondWithStatusCode(_0x153d3c,_0x3908c2){_0x3908c2=_0x3908c2||0xcc;return function(_0x1e2acb){if(_0x1e2acb){return _0x153d3c[_0x4a2e('0x1d')](_0x3908c2);}return _0x153d3c[_0x4a2e('0x1e')](_0x3908c2)[_0x4a2e('0x1f')]();};}function respondWithResult(_0x526b99,_0x425e9c){_0x425e9c=_0x425e9c||0xc8;return function(_0x27bc2b){if(_0x27bc2b){return _0x526b99['status'](_0x425e9c)[_0x4a2e('0x20')](_0x27bc2b);}};}function respondWithFilteredResult(_0x516ee4,_0x36dca9){return function(_0xc1ad80){if(_0xc1ad80){var _0x482d4b=_0xc1ad80['count'],_0x90b20=_0x36dca9[_0x4a2e('0x21')],_0x3a0ba2=_0x36dca9['offset']+_0x36dca9[_0x4a2e('0x22')],_0x51fe3a;if(_0x3a0ba2>=_0x482d4b){_0x3a0ba2=_0x482d4b;_0x51fe3a=0xc8;}else{_0x51fe3a=0xce;}_0x516ee4[_0x4a2e('0x1e')](_0x51fe3a);return _0x516ee4['set'](_0x4a2e('0x23'),_0x90b20+'-'+_0x3a0ba2+'/'+_0x482d4b)[_0x4a2e('0x20')](_0xc1ad80);}return null;};}function patchUpdates(_0x392ebf){return function(_0x7dd9e6){try{jsonpatch[_0x4a2e('0x24')](_0x7dd9e6,_0x392ebf,!![]);}catch(_0x47fe83){return BPromise[_0x4a2e('0x25')](_0x47fe83);}return _0x7dd9e6['save']();};}function saveUpdates(_0x40fa0d,_0x442a43){return function(_0x139e17){if(_0x139e17){return _0x139e17[_0x4a2e('0x26')](_0x40fa0d)[_0x4a2e('0x27')](function(_0x5c7fcd){return _0x5c7fcd;});}return null;};}function removeEntity(_0x556931,_0x1fdb9e){return function(_0x469859){if(_0x469859){return _0x469859['destroy']()['then'](function(){var _0x40a41c=_0x469859[_0x4a2e('0x28')]({'plain':!![]});var _0x5d85af=_0x4a2e('0x29');return db[_0x4a2e('0x2a')]['destroy']({'where':{'type':_0x5d85af,'resourceId':_0x40a41c['id']}})[_0x4a2e('0x27')](function(){return _0x469859;});})[_0x4a2e('0x27')](function(){_0x556931[_0x4a2e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45491f,_0x1ece10){return function(_0x3afff3){if(!_0x3afff3){_0x45491f[_0x4a2e('0x1d')](0x194);}return _0x3afff3;};}function handleError(_0x19cdb3,_0x3f080d){_0x3f080d=_0x3f080d||0x1f4;return function(_0x42b3e9){logger[_0x4a2e('0x2b')](_0x42b3e9[_0x4a2e('0x2c')]);if(_0x42b3e9['name']){delete _0x42b3e9[_0x4a2e('0x2d')];}_0x19cdb3['status'](_0x3f080d)[_0x4a2e('0x2e')](_0x42b3e9);};}exports['index']=function(_0x1f1dd4,_0x2ccfd0){var _0x3d6cb1={},_0x45965c={},_0x1d83d0={'count':0x0,'rows':[]};var _0x15517f=db[_0x4a2e('0x2f')][_0x4a2e('0x30')];_0x45965c[_0x4a2e('0x31')]=_[_0x4a2e('0x32')](_0x15517f);_0x45965c['query']=_[_0x4a2e('0x32')](_0x1f1dd4[_0x4a2e('0x33')]);_0x45965c[_0x4a2e('0x34')]=_['intersection'](_0x45965c['model'],_0x45965c[_0x4a2e('0x33')]);_0x3d6cb1[_0x4a2e('0x35')]=_['intersection'](_0x45965c[_0x4a2e('0x31')],qs[_0x4a2e('0x36')](_0x1f1dd4[_0x4a2e('0x33')]['fields']));_0x3d6cb1['attributes']=_0x3d6cb1[_0x4a2e('0x35')][_0x4a2e('0x37')]?_0x3d6cb1[_0x4a2e('0x35')]:_0x45965c[_0x4a2e('0x31')];if(!_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x38')](_0x4a2e('0x39'))){_0x3d6cb1[_0x4a2e('0x22')]=qs[_0x4a2e('0x22')](_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x22')]);_0x3d6cb1[_0x4a2e('0x21')]=qs[_0x4a2e('0x21')](_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x21')]);}_0x3d6cb1[_0x4a2e('0x3a')]=qs['sort'](_0x1f1dd4['query'][_0x4a2e('0x3b')]);_0x3d6cb1[_0x4a2e('0x3c')]=qs[_0x4a2e('0x34')](_['pick'](_0x1f1dd4[_0x4a2e('0x33')],_0x45965c[_0x4a2e('0x34')]));if(_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x3d')]){_0x3d6cb1[_0x4a2e('0x3c')]=_['merge'](_0x3d6cb1[_0x4a2e('0x3c')],{'$or':_[_0x4a2e('0x3e')](_0x15517f,function(_0x381a73){if(_0x381a73[_0x4a2e('0x3f')][_0x4a2e('0x40')]!==_0x4a2e('0x41')){var _0x271930={};_0x271930[_0x381a73['field']]={'$like':'%'+_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x3d')]+'%'};return _0x271930;}})});}_0x3d6cb1=_[_0x4a2e('0x42')]({},_0x3d6cb1,_0x1f1dd4[_0x4a2e('0x43')]);var _0x3370c0={'where':_0x3d6cb1[_0x4a2e('0x3c')]};return db[_0x4a2e('0x2f')][_0x4a2e('0x44')](_0x3370c0)[_0x4a2e('0x27')](function(_0x429533){_0x1d83d0[_0x4a2e('0x44')]=_0x429533;if(_0x1f1dd4[_0x4a2e('0x33')][_0x4a2e('0x45')]){_0x3d6cb1[_0x4a2e('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x4a2e('0x47')](_0x3d6cb1);})['then'](function(_0x583677){_0x1d83d0['rows']=_0x583677;return _0x1d83d0;})['then'](respondWithFilteredResult(_0x2ccfd0,_0x3d6cb1))[_0x4a2e('0x48')](handleError(_0x2ccfd0,null));};exports['show']=function(_0x2c2074,_0x1d4123){var _0x4dc111={'raw':!![],'where':{'id':_0x2c2074[_0x4a2e('0x49')]['id']}},_0x5a13a5={};_0x5a13a5[_0x4a2e('0x31')]=_['keys'](db[_0x4a2e('0x2f')]['rawAttributes']);_0x5a13a5['query']=_['keys'](_0x2c2074['query']);_0x5a13a5[_0x4a2e('0x34')]=_[_0x4a2e('0x4a')](_0x5a13a5[_0x4a2e('0x31')],_0x5a13a5[_0x4a2e('0x33')]);_0x4dc111[_0x4a2e('0x35')]=_[_0x4a2e('0x4a')](_0x5a13a5['model'],qs[_0x4a2e('0x36')](_0x2c2074['query'][_0x4a2e('0x36')]));_0x4dc111[_0x4a2e('0x35')]=_0x4dc111[_0x4a2e('0x35')][_0x4a2e('0x37')]?_0x4dc111[_0x4a2e('0x35')]:_0x5a13a5[_0x4a2e('0x31')];if(_0x2c2074[_0x4a2e('0x33')][_0x4a2e('0x45')]){_0x4dc111[_0x4a2e('0x46')]=[{'all':!![]}];}_0x4dc111=_['merge']({},_0x4dc111,_0x2c2074[_0x4a2e('0x43')]);return db[_0x4a2e('0x2f')][_0x4a2e('0x4b')](_0x4dc111)[_0x4a2e('0x27')](handleEntityNotFound(_0x1d4123,null))[_0x4a2e('0x27')](respondWithResult(_0x1d4123,null))[_0x4a2e('0x48')](handleError(_0x1d4123,null));};exports['create']=function(_0x4f2c96,_0x15483a){return db[_0x4a2e('0x2f')][_0x4a2e('0x4c')](_0x4f2c96[_0x4a2e('0x4d')],{})['then'](function(_0x33a792){var _0x1250df=_0x4f2c96[_0x4a2e('0x4e')][_0x4a2e('0x28')]({'plain':!![]});if(!_0x1250df)throw new Error(_0x4a2e('0x4f'));if(_0x1250df['role']==='user'){var _0x5af79e=_0x33a792['get']({'plain':!![]});var _0x1c0ddd=_0x4a2e('0x29');return db[_0x4a2e('0x50')][_0x4a2e('0x4b')]({'where':{'name':_0x1c0ddd,'userProfileId':_0x1250df['userProfileId']},'raw':!![]})['then'](function(_0x3e27b8){if(_0x3e27b8&&_0x3e27b8['autoAssociation']===0x0){return db[_0x4a2e('0x2a')][_0x4a2e('0x4c')]({'name':_0x5af79e[_0x4a2e('0x2d')],'resourceId':_0x5af79e['id'],'type':_0x3e27b8['name'],'sectionId':_0x3e27b8['id']},{})[_0x4a2e('0x27')](function(){return _0x33a792;});}else{return _0x33a792;}})['catch'](function(_0x3fcd51){logger[_0x4a2e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fcd51);throw _0x3fcd51;});}return _0x33a792;})[_0x4a2e('0x27')](respondWithResult(_0x15483a,0xc9))[_0x4a2e('0x48')](handleError(_0x15483a,null));};exports[_0x4a2e('0x26')]=function(_0xdef90d,_0x15c748){if(_0xdef90d['body']['id']){delete _0xdef90d[_0x4a2e('0x4d')]['id'];}return db['OpenchannelQueue'][_0x4a2e('0x4b')]({'where':{'id':_0xdef90d[_0x4a2e('0x49')]['id']}})['then'](handleEntityNotFound(_0x15c748,null))[_0x4a2e('0x27')](saveUpdates(_0xdef90d[_0x4a2e('0x4d')],null))[_0x4a2e('0x27')](respondWithResult(_0x15c748,null))[_0x4a2e('0x48')](handleError(_0x15c748,null));};exports[_0x4a2e('0x51')]=function(_0x4a64e2,_0x133344){return db[_0x4a2e('0x2f')][_0x4a2e('0x4b')]({'where':{'id':_0x4a64e2[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](handleEntityNotFound(_0x133344,null))[_0x4a2e('0x27')](removeEntity(_0x133344,null))[_0x4a2e('0x48')](handleError(_0x133344,null));};exports['describe']=function(_0x1057f1,_0x4bce67){return db['OpenchannelQueue'][_0x4a2e('0x52')]()[_0x4a2e('0x27')](respondWithResult(_0x4bce67,null))[_0x4a2e('0x48')](handleError(_0x4bce67,null));};exports['getMembers']=function(_0x4fb65f,_0x4d7040,_0x339e26){var _0x2dae91={'raw':!![],'where':{}},_0xeb282e={},_0x302c18;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4fb65f[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](handleEntityNotFound(_0x4d7040,null))['then'](function(_0x59f59a){if(_0x59f59a){_0x302c18=_0x59f59a['get']({'plain':!![]});_0xeb282e['model']=_[_0x4a2e('0x32')](db[_0x4a2e('0x53')][_0x4a2e('0x30')]);_0xeb282e['query']=_[_0x4a2e('0x32')](_0x4fb65f[_0x4a2e('0x33')]);_0xeb282e['filters']=_[_0x4a2e('0x4a')](_0xeb282e[_0x4a2e('0x31')],_0xeb282e[_0x4a2e('0x33')]);_0x2dae91[_0x4a2e('0x35')]=_['intersection'](_0xeb282e[_0x4a2e('0x31')],qs[_0x4a2e('0x36')](_0x4fb65f[_0x4a2e('0x33')][_0x4a2e('0x36')]));_0x2dae91[_0x4a2e('0x35')]=_0x2dae91[_0x4a2e('0x35')][_0x4a2e('0x37')]?_0x2dae91['attributes']:_0xeb282e[_0x4a2e('0x31')];if(!_0x4fb65f['query'][_0x4a2e('0x38')]('nolimit')){_0x2dae91['limit']=qs[_0x4a2e('0x22')](_0x4fb65f[_0x4a2e('0x33')]['limit']);_0x2dae91[_0x4a2e('0x21')]=qs['offset'](_0x4fb65f[_0x4a2e('0x33')]['offset']);}_0x2dae91[_0x4a2e('0x3a')]=qs[_0x4a2e('0x3b')](_0x4fb65f[_0x4a2e('0x33')]['sort']);_0x2dae91[_0x4a2e('0x3c')]=qs[_0x4a2e('0x34')](_['pick'](_0x4fb65f['query'],_0xeb282e[_0x4a2e('0x34')]));_0x2dae91['where']['OpenchannelQueueId']=_0x59f59a['id'];if(_0x4fb65f['query'][_0x4a2e('0x3d')]){_0x2dae91[_0x4a2e('0x3c')]=_[_0x4a2e('0x42')](_0x2dae91[_0x4a2e('0x3c')],{'$or':_[_0x4a2e('0x3e')](_0x2dae91[_0x4a2e('0x35')],function(_0x390ee8){var _0x5af023={};_0x5af023[_0x390ee8]={'$like':'%'+_0x4fb65f['query']['filter']+'%'};return _0x5af023;})});}_0x2dae91=_[_0x4a2e('0x42')]({},_0x2dae91,_0x4fb65f['options']);return db[_0x4a2e('0x53')][_0x4a2e('0x47')](_0x2dae91);}})[_0x4a2e('0x27')](function(_0x143d3e){if(_0x143d3e){return db['User'][_0x4a2e('0x54')]({'where':{'id':_['map'](_0x143d3e,_0x4a2e('0x55')),'role':'agent'},'attributes':['id',_0x4a2e('0x2d'),_0x4a2e('0x56'),'updatedAt',_0x4a2e('0x57')]});}})[_0x4a2e('0x27')](function(_0x14814a){if(_0x14814a){return{'count':_0x14814a['count'],'rows':_[_0x4a2e('0x3e')](_0x14814a[_0x4a2e('0x58')],function(_0x172216){return{'membername':_0x172216[_0x4a2e('0x2d')],'UserId':_0x172216['id'],'queue_name':_0x302c18[_0x4a2e('0x2d')],'OpenchannelQueueId':_0x302c18['id'],'interface':util['format'](_0x4a2e('0x59'),'SIP',_0x172216['name']),'penalty':0x0,'paused':_0x172216[_0x4a2e('0x56')],'createdAt':_0x172216[_0x4a2e('0x57')],'updatedAt':_0x172216[_0x4a2e('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4a2e('0x27')](respondWithFilteredResult(_0x4d7040,_0x2dae91))['catch'](handleError(_0x4d7040,null));};exports[_0x4a2e('0x5b')]=function(_0x173976,_0x2fa484,_0x413bb1){var _0x4a88b4={};var _0x45327a={};var _0x486abc;var _0x4d774d;return db[_0x4a2e('0x2f')][_0x4a2e('0x5c')]({'where':{'id':_0x173976[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](handleEntityNotFound(_0x2fa484,null))[_0x4a2e('0x27')](function(_0x520e18){if(_0x520e18){_0x486abc=_0x520e18;_0x45327a[_0x4a2e('0x31')]=_['keys'](db[_0x4a2e('0x5d')][_0x4a2e('0x30')]);_0x45327a[_0x4a2e('0x33')]=_['keys'](_0x173976['query']);_0x45327a[_0x4a2e('0x34')]=_[_0x4a2e('0x4a')](_0x45327a['model'],_0x45327a[_0x4a2e('0x33')]);_0x4a88b4[_0x4a2e('0x35')]=_[_0x4a2e('0x4a')](_0x45327a[_0x4a2e('0x31')],qs[_0x4a2e('0x36')](_0x173976[_0x4a2e('0x33')][_0x4a2e('0x36')]));_0x4a88b4[_0x4a2e('0x35')]=_0x4a88b4[_0x4a2e('0x35')][_0x4a2e('0x37')]?_0x4a88b4[_0x4a2e('0x35')]:_0x45327a[_0x4a2e('0x31')];_0x4a88b4[_0x4a2e('0x3a')]=qs[_0x4a2e('0x3b')](_0x173976[_0x4a2e('0x33')][_0x4a2e('0x3b')]);_0x4a88b4['where']=qs['filters'](_['pick'](_0x173976[_0x4a2e('0x33')],_0x45327a[_0x4a2e('0x34')]));if(_0x173976['query'][_0x4a2e('0x3d')]){_0x4a88b4[_0x4a2e('0x3c')]=_['merge'](_0x4a88b4[_0x4a2e('0x3c')],{'$or':_[_0x4a2e('0x3e')](_0x4a88b4[_0x4a2e('0x35')],function(_0x105962){var _0x4c2b34={};_0x4c2b34[_0x105962]={'$like':'%'+_0x173976[_0x4a2e('0x33')]['filter']+'%'};return _0x4c2b34;})});}_0x4a88b4=_[_0x4a2e('0x42')]({},_0x4a88b4,_0x173976['options']);return _0x486abc[_0x4a2e('0x5b')](_0x4a88b4);}})[_0x4a2e('0x27')](function(_0x676d6e){if(_0x676d6e){_0x4d774d=_0x676d6e[_0x4a2e('0x37')];if(!_0x173976[_0x4a2e('0x33')][_0x4a2e('0x38')](_0x4a2e('0x39'))){_0x4a88b4['limit']=qs[_0x4a2e('0x22')](_0x173976[_0x4a2e('0x33')][_0x4a2e('0x22')]);_0x4a88b4[_0x4a2e('0x21')]=qs[_0x4a2e('0x21')](_0x173976[_0x4a2e('0x33')][_0x4a2e('0x21')]);}return _0x486abc[_0x4a2e('0x5b')](_0x4a88b4);}})['then'](function(_0x4d48c6){if(_0x4d48c6){return _0x4d48c6?{'count':_0x4d774d,'rows':_0x4d48c6}:null;}})[_0x4a2e('0x27')](respondWithResult(_0x2fa484,null))[_0x4a2e('0x48')](handleError(_0x2fa484,null));};exports[_0x4a2e('0x5e')]=function(_0x1553bf,_0x29f4f8,_0x286d3c){var _0x2303f1=_0x1553bf[_0x4a2e('0x4d')][_0x4a2e('0x5f')];return db['Team'][_0x4a2e('0x47')]({'where':{'id':_[_0x4a2e('0x3e')](_0x2303f1,'id')},'attributes':['id'],'include':[{'model':db[_0x4a2e('0x60')],'as':_0x4a2e('0x61'),'attributes':['id','name',_0x4a2e('0x62'),_0x4a2e('0x63'),'interface'],'raw':!![]}]})[_0x4a2e('0x27')](function(_0x491a2a){if(_0x491a2a){var _0x76cd3b=_[_0x4a2e('0x64')](_0x491a2a,function(_0x41208d){var _0x586409=_0x41208d[_0x4a2e('0x28')]({'plain':!![]});return _0x586409[_0x4a2e('0x61')];});return db['OpenchannelQueue'][_0x4a2e('0x4b')]({'where':{'id':_0x1553bf[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](function(_0x56d244){return db[_0x4a2e('0x65')][_0x4a2e('0x66')](function(_0x3ab8d9){return _0x56d244[_0x4a2e('0x5e')](_[_0x4a2e('0x3e')](_0x2303f1,'id'),{'transaction':_0x3ab8d9})[_0x4a2e('0x27')](function(){return BPromise[_0x4a2e('0x67')](_0x76cd3b,function(_0x3a8ad1){return db['UserOpenchannelQueue'][_0x4a2e('0x68')]({'where':{'UserId':_0x3a8ad1['id'],'OpenchannelQueueId':_0x1553bf[_0x4a2e('0x49')]['id']},'transaction':_0x3ab8d9});});})[_0x4a2e('0x27')](function(){_0x76cd3b[_0x4a2e('0x69')](function(_0x5ccd47){socket['emit'](_0x4a2e('0x6a'),{'UserId':_0x5ccd47['id'],'OpenchannelQueueId':_0x56d244['id']});});});});});}})[_0x4a2e('0x27')](respondWithStatusCode(_0x29f4f8,null))[_0x4a2e('0x48')](handleError(_0x29f4f8,null));};exports[_0x4a2e('0x6b')]=function(_0x3eeb6e,_0x1586e0,_0x2a3e29){return db[_0x4a2e('0x5d')][_0x4a2e('0x47')]({'where':{'id':_0x3eeb6e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4a2e('0x60')],'as':_0x4a2e('0x61'),'attributes':['id'],'raw':!![]}]})[_0x4a2e('0x27')](handleEntityNotFound(_0x1586e0,null))[_0x4a2e('0x27')](function(_0x3f7afd){var _0x3170ee=_[_0x4a2e('0x3e')](_0x3f7afd,'id');var _0x303fc0=[];var _0x40bbdb=[];var _0x14025f=squel['select']();_0x14025f[_0x4a2e('0x6c')](_0x4a2e('0x6d'))[_0x4a2e('0x6e')](_0x4a2e('0x6f'),'tq')[_0x4a2e('0x70')](_0x4a2e('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4a2e('0x3c')]('OpenchannelQueueId\x20=\x20?',_0x3eeb6e[_0x4a2e('0x49')]['id']);for(var _0x51663f=0x0;_0x51663f<_0x3f7afd[_0x4a2e('0x37')];_0x51663f+=0x1){let _0x4d3b9e=_0x3f7afd[_0x51663f];for(var _0x29f05c=0x0;_0x29f05c<_0x4d3b9e[_0x4a2e('0x61')]['length'];_0x29f05c+=0x1){let _0x545a44=_0x4d3b9e[_0x4a2e('0x61')][_0x29f05c];var _0x37a55f=_0x14025f[_0x4a2e('0x72')]();_0x37a55f[_0x4a2e('0x3c')](_0x4a2e('0x73'),_0x545a44['id']);_0x40bbdb[_0x4a2e('0x74')](db[_0x4a2e('0x65')]['query'](_0x37a55f['toString'](),{'type':db[_0x4a2e('0x65')][_0x4a2e('0x75')][_0x4a2e('0x76')]})[_0x4a2e('0x27')](function(_0x183667){if(_0x183667[_0x4a2e('0x37')]===0x1){return _0x545a44['id'];}else{var _0x3c76f2=_[_0x4a2e('0x77')](_['map'](_0x183667,'TeamId'),function(_0x2f0d12){return _[_0x4a2e('0x78')](_0x3170ee,_0x2f0d12);});if(_0x3c76f2){return _0x545a44['id'];}}}));}}return BPromise['all'](_0x40bbdb)['then'](function(_0xd59af){_0x303fc0=_(_0x303fc0)[_0x4a2e('0x79')](_0xd59af)[_0x4a2e('0x7a')]()['value']();return db['OpenchannelQueue'][_0x4a2e('0x4b')]({'where':{'id':_0x3eeb6e[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](function(_0x50e828){return db[_0x4a2e('0x65')][_0x4a2e('0x66')](function(_0x35fe20){return _0x50e828[_0x4a2e('0x6b')](_0x3eeb6e[_0x4a2e('0x33')][_0x4a2e('0x7b')],{'transaction':_0x35fe20})[_0x4a2e('0x27')](function(){if(!_[_0x4a2e('0x7c')](_0x303fc0)){return _0x50e828[_0x4a2e('0x7d')](_0x303fc0,{'transaction':_0x35fe20});}})[_0x4a2e('0x27')](function(){_0x303fc0[_0x4a2e('0x69')](function(_0x84e968){socket[_0x4a2e('0x7e')](_0x4a2e('0x7f'),{'UserId':_0x84e968,'OpenchannelQueueId':_0x50e828['id']});});});});});});})['then'](respondWithStatusCode(_0x1586e0,null))[_0x4a2e('0x48')](handleError(_0x1586e0,null));};exports['addAgents']=function(_0x5b13dd,_0x542b12,_0x116c21){return db[_0x4a2e('0x2f')]['find']({'where':{'id':_0x5b13dd[_0x4a2e('0x49')]['id']}})[_0x4a2e('0x27')](handleEntityNotFound(_0x542b12,null))[_0x4a2e('0x27')](function(_0x5f1982){if(_0x5f1982){return _0x5f1982['addAgents'](_0x5b13dd[_0x4a2e('0x4d')]['ids'],_['omit'](_0x5b13dd['body'],[_0x4a2e('0x7b'),'id'])||{})[_0x4a2e('0x80')](function(_0x49ed52){for(var _0x1e7c6c=0x0;_0x1e7c6c<_0x5b13dd[_0x4a2e('0x4d')][_0x4a2e('0x7b')][_0x4a2e('0x37')];_0x1e7c6c+=0x1){socket[_0x4a2e('0x7e')](_0x4a2e('0x6a'),{'UserId':_0x5b13dd[_0x4a2e('0x4d')][_0x4a2e('0x7b')][_0x1e7c6c],'OpenchannelQueueId':_0x5b13dd[_0x4a2e('0x49')]['id']});}return _0x49ed52;});}})[_0x4a2e('0x27')](respondWithResult(_0x542b12,null))[_0x4a2e('0x48')](handleError(_0x542b12,null));};exports[_0x4a2e('0x7d')]=function(_0x1cef07,_0x3dd15d,_0x5a9ebd){return db[_0x4a2e('0x2f')][_0x4a2e('0x4b')]({'where':{'id':_0x1cef07['params']['id']}})[_0x4a2e('0x27')](handleEntityNotFound(_0x3dd15d,null))[_0x4a2e('0x27')](function(_0xda6cfb){if(_0xda6cfb){return _0xda6cfb[_0x4a2e('0x7d')](_0x1cef07[_0x4a2e('0x33')][_0x4a2e('0x7b')])[_0x4a2e('0x27')](function(){if(_[_0x4a2e('0x81')](_0x1cef07[_0x4a2e('0x33')][_0x4a2e('0x7b')])){for(var _0xfad5d0=0x0;_0xfad5d0<_0x1cef07['query'][_0x4a2e('0x7b')][_0x4a2e('0x37')];_0xfad5d0+=0x1){socket[_0x4a2e('0x7e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1cef07['query']['ids'][_0xfad5d0]),'OpenchannelQueueId':Number(_0x1cef07[_0x4a2e('0x49')]['id'])});}}else{socket[_0x4a2e('0x7e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1cef07[_0x4a2e('0x33')]['ids']),'OpenchannelQueueId':Number(_0x1cef07[_0x4a2e('0x49')]['id'])});}});}})[_0x4a2e('0x27')](respondWithStatusCode(_0x3dd15d,null))['catch'](handleError(_0x3dd15d,null));};exports['getAgents']=function(_0x22dafb,_0x4310a8,_0x1f7b5c){var _0x1f8941={};var _0x363bef={};var _0x12359a;var _0x1bb972;return db[_0x4a2e('0x2f')]['findOne']({'where':{'id':_0x22dafb['params']['id']}})['then'](handleEntityNotFound(_0x4310a8,null))['then'](function(_0x17b362){if(_0x17b362){_0x12359a=_0x17b362;_0x363bef['model']=_['keys'](db[_0x4a2e('0x60')][_0x4a2e('0x30')]);_0x363bef['query']=_[_0x4a2e('0x32')](_0x22dafb[_0x4a2e('0x33')]);_0x363bef[_0x4a2e('0x34')]=_[_0x4a2e('0x4a')](_0x363bef['model'],_0x363bef['query']);_0x1f8941[_0x4a2e('0x35')]=_['intersection'](_0x363bef[_0x4a2e('0x31')],qs[_0x4a2e('0x36')](_0x22dafb[_0x4a2e('0x33')][_0x4a2e('0x36')]));_0x1f8941[_0x4a2e('0x35')]=_0x1f8941[_0x4a2e('0x35')]['length']?_0x1f8941[_0x4a2e('0x35')]:_0x363bef[_0x4a2e('0x31')];_0x1f8941[_0x4a2e('0x3a')]=qs['sort'](_0x22dafb[_0x4a2e('0x33')][_0x4a2e('0x3b')]);_0x1f8941['where']=qs[_0x4a2e('0x34')](_[_0x4a2e('0x82')](_0x22dafb[_0x4a2e('0x33')],_0x363bef[_0x4a2e('0x34')]));if(_0x22dafb[_0x4a2e('0x33')]['filter']){_0x1f8941['where']=_[_0x4a2e('0x42')](_0x1f8941[_0x4a2e('0x3c')],{'$or':_['map'](_0x1f8941[_0x4a2e('0x35')],function(_0x1d7abe){var _0x20b483={};_0x20b483[_0x1d7abe]={'$like':'%'+_0x22dafb[_0x4a2e('0x33')][_0x4a2e('0x3d')]+'%'};return _0x20b483;})});}_0x1f8941=_['merge']({},_0x1f8941,_0x22dafb[_0x4a2e('0x43')]);return _0x12359a['getAgents'](_0x1f8941);}})['then'](function(_0x5d4ff6){if(_0x5d4ff6){_0x1bb972=_0x5d4ff6[_0x4a2e('0x37')];if(!_0x22dafb[_0x4a2e('0x33')][_0x4a2e('0x38')]('nolimit')){_0x1f8941[_0x4a2e('0x22')]=qs[_0x4a2e('0x22')](_0x22dafb[_0x4a2e('0x33')]['limit']);_0x1f8941['offset']=qs[_0x4a2e('0x21')](_0x22dafb[_0x4a2e('0x33')][_0x4a2e('0x21')]);}return _0x12359a[_0x4a2e('0x83')](_0x1f8941);}})[_0x4a2e('0x27')](function(_0x28ce5a){if(_0x28ce5a){return _0x28ce5a?{'count':_0x1bb972,'rows':_0x28ce5a}:null;}})[_0x4a2e('0x27')](respondWithResult(_0x4310a8,null))[_0x4a2e('0x48')](handleError(_0x4310a8,null));}; \ No newline at end of file +var _0x596d=['lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','map','type','key','field','merge','options','OpenchannelQueue','include','rows','catch','params','rawAttributes','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','destroy','getMembers','findOne','UserOpenchannelQueue','nolimit','pick','OpenchannelQueueId','filter','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','teams','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','ids','select','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','SELECT','every','TeamId','includes','all','union','compact','value','userOpenchannelQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x254caa,_0x36be68){var _0x110fc6=function(_0x179c45){while(--_0x179c45){_0x254caa['push'](_0x254caa['shift']());}};_0x110fc6(++_0x36be68);}(_0x596d,0x19c));var _0xd596=function(_0x23e77e,_0x458c60){_0x23e77e=_0x23e77e-0x0;var _0x4fae79=_0x596d[_0x23e77e];return _0x4fae79;};'use strict';var pdf=require(_0xd596('0x0'));var emlformat=require(_0xd596('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd596('0x2'));var jsonpatch=require(_0xd596('0x3'));var rp=require(_0xd596('0x4'));var moment=require(_0xd596('0x5'));var BPromise=require(_0xd596('0x6'));var Mustache=require(_0xd596('0x7'));var util=require('util');var path=require(_0xd596('0x8'));var sox=require(_0xd596('0x9'));var csv=require('to-csv');var ejs=require(_0xd596('0xa'));var fs=require('fs');var _=require(_0xd596('0xb'));var squel=require(_0xd596('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd596('0xd'));var toCsv=require(_0xd596('0xe'));var querystring=require(_0xd596('0xf'));var Papa=require(_0xd596('0x10'));var Redis=require(_0xd596('0x11'));var authService=require(_0xd596('0x12'));var qs=require(_0xd596('0x13'));var hardwareService=require(_0xd596('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd596('0x15'));var config=require(_0xd596('0x16'));var db=require(_0xd596('0x17'))['db'];config[_0xd596('0x18')]=_['defaults'](config[_0xd596('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd596('0x19'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xd596('0x1a')](socket);function respondWithStatusCode(_0x3e0731,_0x525ca9){_0x525ca9=_0x525ca9||0xcc;return function(_0x3232cf){if(_0x3232cf){return _0x3e0731[_0xd596('0x1b')](_0x525ca9);}return _0x3e0731[_0xd596('0x1c')](_0x525ca9)[_0xd596('0x1d')]();};}function respondWithResult(_0x1a57ee,_0x4ba619){_0x4ba619=_0x4ba619||0xc8;return function(_0x1db19c){if(_0x1db19c){return _0x1a57ee['status'](_0x4ba619)['json'](_0x1db19c);}};}function respondWithFilteredResult(_0x74bb05,_0xf4b47a){return function(_0x2fc402){if(_0x2fc402){var _0x460920=_0x2fc402[_0xd596('0x1e')],_0x25234d=_0xf4b47a[_0xd596('0x1f')],_0x5382d0=_0xf4b47a[_0xd596('0x1f')]+_0xf4b47a[_0xd596('0x20')],_0x5ce5ae;if(_0x5382d0>=_0x460920){_0x5382d0=_0x460920;_0x5ce5ae=0xc8;}else{_0x5ce5ae=0xce;}_0x74bb05['status'](_0x5ce5ae);return _0x74bb05['set'](_0xd596('0x21'),_0x25234d+'-'+_0x5382d0+'/'+_0x460920)[_0xd596('0x22')](_0x2fc402);}return null;};}function patchUpdates(_0x526c54){return function(_0x33a292){try{jsonpatch[_0xd596('0x23')](_0x33a292,_0x526c54,!![]);}catch(_0x5ac7e5){return BPromise[_0xd596('0x24')](_0x5ac7e5);}return _0x33a292[_0xd596('0x25')]();};}function saveUpdates(_0x428497,_0x13f6c1){return function(_0x263efd){if(_0x263efd){return _0x263efd[_0xd596('0x26')](_0x428497)[_0xd596('0x27')](function(_0x344a85){return _0x344a85;});}return null;};}function removeEntity(_0x1098c1,_0xcb09f2){return function(_0x1db3b2){if(_0x1db3b2){return _0x1db3b2['destroy']()[_0xd596('0x27')](function(){var _0x2aa8ec=_0x1db3b2['get']({'plain':!![]});var _0x1c63b8=_0xd596('0x28');return db[_0xd596('0x29')]['destroy']({'where':{'type':_0x1c63b8,'resourceId':_0x2aa8ec['id']}})[_0xd596('0x27')](function(){return _0x1db3b2;});})[_0xd596('0x27')](function(){_0x1098c1[_0xd596('0x1c')](0xcc)[_0xd596('0x1d')]();});}};}function handleEntityNotFound(_0x49ab79,_0xd25c00){return function(_0x35163c){if(!_0x35163c){_0x49ab79[_0xd596('0x1b')](0x194);}return _0x35163c;};}function handleError(_0x4009ad,_0x39b76b){_0x39b76b=_0x39b76b||0x1f4;return function(_0x4f2ddc){logger[_0xd596('0x2a')](_0x4f2ddc[_0xd596('0x2b')]);if(_0x4f2ddc['name']){delete _0x4f2ddc[_0xd596('0x2c')];}_0x4009ad[_0xd596('0x1c')](_0x39b76b)[_0xd596('0x2d')](_0x4f2ddc);};}exports[_0xd596('0x2e')]=function(_0x2307b8,_0x197c8e){var _0x466f29={},_0x49258e={},_0x56afe6={'count':0x0,'rows':[]};var _0xf942b6=db['OpenchannelQueue']['rawAttributes'];_0x49258e[_0xd596('0x2f')]=_[_0xd596('0x30')](_0xf942b6);_0x49258e[_0xd596('0x31')]=_[_0xd596('0x30')](_0x2307b8['query']);_0x49258e[_0xd596('0x32')]=_[_0xd596('0x33')](_0x49258e[_0xd596('0x2f')],_0x49258e[_0xd596('0x31')]);_0x466f29['attributes']=_[_0xd596('0x33')](_0x49258e['model'],qs['fields'](_0x2307b8[_0xd596('0x31')][_0xd596('0x34')]));_0x466f29[_0xd596('0x35')]=_0x466f29[_0xd596('0x35')][_0xd596('0x36')]?_0x466f29['attributes']:_0x49258e[_0xd596('0x2f')];if(!_0x2307b8[_0xd596('0x31')][_0xd596('0x37')]('nolimit')){_0x466f29[_0xd596('0x20')]=qs[_0xd596('0x20')](_0x2307b8[_0xd596('0x31')][_0xd596('0x20')]);_0x466f29['offset']=qs['offset'](_0x2307b8['query'][_0xd596('0x1f')]);}_0x466f29[_0xd596('0x38')]=qs[_0xd596('0x39')](_0x2307b8[_0xd596('0x31')][_0xd596('0x39')]);_0x466f29[_0xd596('0x3a')]=qs[_0xd596('0x32')](_['pick'](_0x2307b8['query'],_0x49258e[_0xd596('0x32')]));if(_0x2307b8[_0xd596('0x31')]['filter']){_0x466f29[_0xd596('0x3a')]=_['merge'](_0x466f29[_0xd596('0x3a')],{'$or':_[_0xd596('0x3b')](_0xf942b6,function(_0x19f17c){if(_0x19f17c[_0xd596('0x3c')][_0xd596('0x3d')]!=='VIRTUAL'){var _0x304054={};_0x304054[_0x19f17c[_0xd596('0x3e')]]={'$like':'%'+_0x2307b8[_0xd596('0x31')]['filter']+'%'};return _0x304054;}})});}_0x466f29=_[_0xd596('0x3f')]({},_0x466f29,_0x2307b8[_0xd596('0x40')]);var _0x28ed1d={'where':_0x466f29[_0xd596('0x3a')]};return db[_0xd596('0x41')][_0xd596('0x1e')](_0x28ed1d)[_0xd596('0x27')](function(_0x52a428){_0x56afe6['count']=_0x52a428;if(_0x2307b8[_0xd596('0x31')]['includeAll']){_0x466f29[_0xd596('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x466f29);})[_0xd596('0x27')](function(_0x3bd169){_0x56afe6[_0xd596('0x43')]=_0x3bd169;return _0x56afe6;})[_0xd596('0x27')](respondWithFilteredResult(_0x197c8e,_0x466f29))[_0xd596('0x44')](handleError(_0x197c8e,null));};exports['show']=function(_0xa0042f,_0x2082a1){var _0x7aa720={'raw':!![],'where':{'id':_0xa0042f[_0xd596('0x45')]['id']}},_0xf6cf23={};_0xf6cf23[_0xd596('0x2f')]=_[_0xd596('0x30')](db[_0xd596('0x41')][_0xd596('0x46')]);_0xf6cf23['query']=_['keys'](_0xa0042f[_0xd596('0x31')]);_0xf6cf23[_0xd596('0x32')]=_[_0xd596('0x33')](_0xf6cf23[_0xd596('0x2f')],_0xf6cf23[_0xd596('0x31')]);_0x7aa720['attributes']=_[_0xd596('0x33')](_0xf6cf23[_0xd596('0x2f')],qs['fields'](_0xa0042f[_0xd596('0x31')]['fields']));_0x7aa720[_0xd596('0x35')]=_0x7aa720[_0xd596('0x35')][_0xd596('0x36')]?_0x7aa720[_0xd596('0x35')]:_0xf6cf23[_0xd596('0x2f')];if(_0xa0042f[_0xd596('0x31')][_0xd596('0x47')]){_0x7aa720[_0xd596('0x42')]=[{'all':!![]}];}_0x7aa720=_[_0xd596('0x3f')]({},_0x7aa720,_0xa0042f[_0xd596('0x40')]);return db[_0xd596('0x41')]['find'](_0x7aa720)[_0xd596('0x27')](handleEntityNotFound(_0x2082a1,null))[_0xd596('0x27')](respondWithResult(_0x2082a1,null))[_0xd596('0x44')](handleError(_0x2082a1,null));};exports[_0xd596('0x48')]=function(_0x460eec,_0x52c565){return db[_0xd596('0x41')]['create'](_0x460eec[_0xd596('0x49')],{})[_0xd596('0x27')](function(_0x10da30){var _0x24180b=_0x460eec[_0xd596('0x4a')][_0xd596('0x4b')]({'plain':!![]});if(!_0x24180b)throw new Error(_0xd596('0x4c'));if(_0x24180b[_0xd596('0x4d')]==='user'){var _0x275989=_0x10da30['get']({'plain':!![]});var _0x2f9d51=_0xd596('0x28');return db[_0xd596('0x4e')][_0xd596('0x4f')]({'where':{'name':_0x2f9d51,'userProfileId':_0x24180b[_0xd596('0x50')]},'raw':!![]})[_0xd596('0x27')](function(_0x8aa9e3){if(_0x8aa9e3&&_0x8aa9e3['autoAssociation']===0x0){return db['UserProfileResource'][_0xd596('0x48')]({'name':_0x275989[_0xd596('0x2c')],'resourceId':_0x275989['id'],'type':_0x8aa9e3['name'],'sectionId':_0x8aa9e3['id']},{})[_0xd596('0x27')](function(){return _0x10da30;});}else{return _0x10da30;}})[_0xd596('0x44')](function(_0x1c1a74){logger[_0xd596('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c1a74);throw _0x1c1a74;});}return _0x10da30;})[_0xd596('0x27')](respondWithResult(_0x52c565,0xc9))[_0xd596('0x44')](handleError(_0x52c565,null));};exports[_0xd596('0x26')]=function(_0x2ffb27,_0x28d5f4){if(_0x2ffb27[_0xd596('0x49')]['id']){delete _0x2ffb27[_0xd596('0x49')]['id'];}return db[_0xd596('0x41')][_0xd596('0x4f')]({'where':{'id':_0x2ffb27['params']['id']}})['then'](handleEntityNotFound(_0x28d5f4,null))[_0xd596('0x27')](saveUpdates(_0x2ffb27[_0xd596('0x49')],null))[_0xd596('0x27')](respondWithResult(_0x28d5f4,null))[_0xd596('0x44')](handleError(_0x28d5f4,null));};exports[_0xd596('0x51')]=function(_0x29b697,_0xcb1aa9){return db['OpenchannelQueue'][_0xd596('0x4f')]({'where':{'id':_0x29b697[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0xcb1aa9,null))['then'](removeEntity(_0xcb1aa9,null))[_0xd596('0x44')](handleError(_0xcb1aa9,null));};exports['describe']=function(_0x506157,_0x12e47e){return db[_0xd596('0x41')]['describe']()[_0xd596('0x27')](respondWithResult(_0x12e47e,null))[_0xd596('0x44')](handleError(_0x12e47e,null));};exports[_0xd596('0x52')]=function(_0x19d93c,_0x17e35c,_0x167d54){var _0x182618={'raw':!![],'where':{}},_0x46649d={},_0x498946;return db[_0xd596('0x41')][_0xd596('0x53')]({'where':{'id':_0x19d93c[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0x17e35c,null))[_0xd596('0x27')](function(_0x5c1a64){if(_0x5c1a64){_0x498946=_0x5c1a64[_0xd596('0x4b')]({'plain':!![]});_0x46649d['model']=_[_0xd596('0x30')](db[_0xd596('0x54')]['rawAttributes']);_0x46649d[_0xd596('0x31')]=_['keys'](_0x19d93c[_0xd596('0x31')]);_0x46649d['filters']=_[_0xd596('0x33')](_0x46649d[_0xd596('0x2f')],_0x46649d[_0xd596('0x31')]);_0x182618[_0xd596('0x35')]=_[_0xd596('0x33')](_0x46649d[_0xd596('0x2f')],qs[_0xd596('0x34')](_0x19d93c[_0xd596('0x31')][_0xd596('0x34')]));_0x182618[_0xd596('0x35')]=_0x182618[_0xd596('0x35')][_0xd596('0x36')]?_0x182618[_0xd596('0x35')]:_0x46649d[_0xd596('0x2f')];if(!_0x19d93c[_0xd596('0x31')][_0xd596('0x37')](_0xd596('0x55'))){_0x182618[_0xd596('0x20')]=qs[_0xd596('0x20')](_0x19d93c['query'][_0xd596('0x20')]);_0x182618[_0xd596('0x1f')]=qs[_0xd596('0x1f')](_0x19d93c[_0xd596('0x31')][_0xd596('0x1f')]);}_0x182618[_0xd596('0x38')]=qs[_0xd596('0x39')](_0x19d93c['query'][_0xd596('0x39')]);_0x182618['where']=qs['filters'](_[_0xd596('0x56')](_0x19d93c[_0xd596('0x31')],_0x46649d['filters']));_0x182618[_0xd596('0x3a')][_0xd596('0x57')]=_0x5c1a64['id'];if(_0x19d93c[_0xd596('0x31')][_0xd596('0x58')]){_0x182618[_0xd596('0x3a')]=_[_0xd596('0x3f')](_0x182618['where'],{'$or':_['map'](_0x182618['attributes'],function(_0x2e2b0b){var _0x300e04={};_0x300e04[_0x2e2b0b]={'$like':'%'+_0x19d93c[_0xd596('0x31')][_0xd596('0x58')]+'%'};return _0x300e04;})});}_0x182618=_[_0xd596('0x3f')]({},_0x182618,_0x19d93c['options']);return db[_0xd596('0x54')][_0xd596('0x59')](_0x182618);}})['then'](function(_0x26a50c){if(_0x26a50c){return db[_0xd596('0x5a')][_0xd596('0x5b')]({'where':{'id':_['map'](_0x26a50c,_0xd596('0x5c')),'role':_0xd596('0x5d')},'attributes':['id',_0xd596('0x2c'),_0xd596('0x5e'),_0xd596('0x5f'),_0xd596('0x60')]});}})['then'](function(_0x137c8){if(_0x137c8){return{'count':_0x137c8[_0xd596('0x1e')],'rows':_[_0xd596('0x3b')](_0x137c8[_0xd596('0x43')],function(_0x4d419f){return{'membername':_0x4d419f['name'],'UserId':_0x4d419f['id'],'queue_name':_0x498946[_0xd596('0x2c')],'OpenchannelQueueId':_0x498946['id'],'interface':util[_0xd596('0x61')](_0xd596('0x62'),_0xd596('0x63'),_0x4d419f['name']),'penalty':0x0,'paused':_0x4d419f['openchannelPause'],'createdAt':_0x4d419f[_0xd596('0x60')],'updatedAt':_0x4d419f[_0xd596('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17e35c,_0x182618))[_0xd596('0x44')](handleError(_0x17e35c,null));};exports['getTeams']=function(_0x3c1b89,_0x4da916,_0x1e3a39){var _0x1d55d5={};var _0x37e4d8={};var _0x5b6cb1;var _0x3e4a78;return db[_0xd596('0x41')][_0xd596('0x53')]({'where':{'id':_0x3c1b89[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0x4da916,null))['then'](function(_0x14ea43){if(_0x14ea43){_0x5b6cb1=_0x14ea43;_0x37e4d8[_0xd596('0x2f')]=_[_0xd596('0x30')](db[_0xd596('0x64')][_0xd596('0x46')]);_0x37e4d8[_0xd596('0x31')]=_['keys'](_0x3c1b89['query']);_0x37e4d8[_0xd596('0x32')]=_[_0xd596('0x33')](_0x37e4d8[_0xd596('0x2f')],_0x37e4d8[_0xd596('0x31')]);_0x1d55d5[_0xd596('0x35')]=_[_0xd596('0x33')](_0x37e4d8[_0xd596('0x2f')],qs[_0xd596('0x34')](_0x3c1b89[_0xd596('0x31')][_0xd596('0x34')]));_0x1d55d5['attributes']=_0x1d55d5[_0xd596('0x35')][_0xd596('0x36')]?_0x1d55d5[_0xd596('0x35')]:_0x37e4d8[_0xd596('0x2f')];_0x1d55d5[_0xd596('0x38')]=qs['sort'](_0x3c1b89['query'][_0xd596('0x39')]);_0x1d55d5['where']=qs[_0xd596('0x32')](_[_0xd596('0x56')](_0x3c1b89['query'],_0x37e4d8[_0xd596('0x32')]));if(_0x3c1b89[_0xd596('0x31')][_0xd596('0x58')]){_0x1d55d5[_0xd596('0x3a')]=_['merge'](_0x1d55d5['where'],{'$or':_[_0xd596('0x3b')](_0x1d55d5[_0xd596('0x35')],function(_0x54947e){var _0xf0a330={};_0xf0a330[_0x54947e]={'$like':'%'+_0x3c1b89[_0xd596('0x31')][_0xd596('0x58')]+'%'};return _0xf0a330;})});}_0x1d55d5=_[_0xd596('0x3f')]({},_0x1d55d5,_0x3c1b89[_0xd596('0x40')]);return _0x5b6cb1[_0xd596('0x65')](_0x1d55d5);}})[_0xd596('0x27')](function(_0x5cb705){if(_0x5cb705){_0x3e4a78=_0x5cb705['length'];if(!_0x3c1b89[_0xd596('0x31')][_0xd596('0x37')](_0xd596('0x55'))){_0x1d55d5['limit']=qs['limit'](_0x3c1b89[_0xd596('0x31')][_0xd596('0x20')]);_0x1d55d5['offset']=qs[_0xd596('0x1f')](_0x3c1b89[_0xd596('0x31')][_0xd596('0x1f')]);}return _0x5b6cb1['getTeams'](_0x1d55d5);}})[_0xd596('0x27')](function(_0x535c0f){if(_0x535c0f){return _0x535c0f?{'count':_0x3e4a78,'rows':_0x535c0f}:null;}})['then'](respondWithResult(_0x4da916,null))[_0xd596('0x44')](handleError(_0x4da916,null));};exports[_0xd596('0x66')]=function(_0x2f4baf,_0x363f7b,_0x2874b3){var _0x58c17e=_0x2f4baf[_0xd596('0x49')][_0xd596('0x67')];return db[_0xd596('0x64')][_0xd596('0x59')]({'where':{'id':_[_0xd596('0x3b')](_0x58c17e,'id')},'attributes':['id'],'include':[{'model':db[_0xd596('0x5a')],'as':_0xd596('0x68'),'attributes':['id',_0xd596('0x2c'),'online',_0xd596('0x69'),'interface'],'raw':!![]}]})[_0xd596('0x27')](function(_0x2fe22f){if(_0x2fe22f){var _0x4c8282=_[_0xd596('0x6a')](_0x2fe22f,function(_0x158187){var _0x58aa0c=_0x158187[_0xd596('0x4b')]({'plain':!![]});return _0x58aa0c[_0xd596('0x68')];});return db[_0xd596('0x41')][_0xd596('0x4f')]({'where':{'id':_0x2f4baf[_0xd596('0x45')]['id']}})[_0xd596('0x27')](function(_0x1bb1ba){return db[_0xd596('0x6b')][_0xd596('0x6c')](function(_0x133f22){return _0x1bb1ba[_0xd596('0x66')](_[_0xd596('0x3b')](_0x58c17e,'id'),{'transaction':_0x133f22})[_0xd596('0x27')](function(){return BPromise[_0xd596('0x6d')](_0x4c8282,function(_0xfe2d0a){return db[_0xd596('0x54')][_0xd596('0x6e')]({'where':{'UserId':_0xfe2d0a['id'],'OpenchannelQueueId':_0x2f4baf['params']['id']},'transaction':_0x133f22});});})[_0xd596('0x27')](function(){_0x4c8282[_0xd596('0x6f')](function(_0x2baa6a){socket['emit'](_0xd596('0x70'),{'UserId':_0x2baa6a['id'],'OpenchannelQueueId':_0x1bb1ba['id']});});});});});}})[_0xd596('0x27')](respondWithStatusCode(_0x363f7b,null))[_0xd596('0x44')](handleError(_0x363f7b,null));};exports['removeTeams']=function(_0x320e16,_0x2a7557,_0x31d8c8){return db['Team'][_0xd596('0x59')]({'where':{'id':_0x320e16[_0xd596('0x31')][_0xd596('0x71')]},'attributes':['id'],'include':[{'model':db[_0xd596('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2a7557,null))[_0xd596('0x27')](function(_0x4b7b63){var _0x43b4c4=_['map'](_0x4b7b63,'id');var _0x546539=[];var _0x9595d2=[];var _0x1b86fd=squel[_0xd596('0x72')]();_0x1b86fd[_0xd596('0x3e')](_0xd596('0x73'))[_0xd596('0x74')](_0xd596('0x75'),'tq')[_0xd596('0x76')](_0xd596('0x77'),'ut',_0xd596('0x78'))[_0xd596('0x3a')](_0xd596('0x79'),_0x320e16[_0xd596('0x45')]['id']);for(var _0x42fd11=0x0;_0x42fd11<_0x4b7b63[_0xd596('0x36')];_0x42fd11+=0x1){let _0x153b79=_0x4b7b63[_0x42fd11];for(var _0x2def99=0x0;_0x2def99<_0x153b79['Agents'][_0xd596('0x36')];_0x2def99+=0x1){let _0x4696da=_0x153b79[_0xd596('0x68')][_0x2def99];var _0xd132f6=_0x1b86fd[_0xd596('0x7a')]();_0xd132f6['where'](_0xd596('0x7b'),_0x4696da['id']);_0x9595d2[_0xd596('0x7c')](db[_0xd596('0x6b')]['query'](_0xd132f6['toString'](),{'type':db['sequelize']['QueryTypes'][_0xd596('0x7d')]})[_0xd596('0x27')](function(_0x18efb2){if(_0x18efb2[_0xd596('0x36')]===0x1){return _0x4696da['id'];}else{var _0x234f5c=_[_0xd596('0x7e')](_[_0xd596('0x3b')](_0x18efb2,_0xd596('0x7f')),function(_0x3337ed){return _[_0xd596('0x80')](_0x43b4c4,_0x3337ed);});if(_0x234f5c){return _0x4696da['id'];}}}));}}return BPromise[_0xd596('0x81')](_0x9595d2)[_0xd596('0x27')](function(_0x6ee4e0){_0x546539=_(_0x546539)[_0xd596('0x82')](_0x6ee4e0)[_0xd596('0x83')]()[_0xd596('0x84')]();return db['OpenchannelQueue'][_0xd596('0x4f')]({'where':{'id':_0x320e16[_0xd596('0x45')]['id']}})['then'](function(_0x162a88){return db['sequelize'][_0xd596('0x6c')](function(_0x214adc){return _0x162a88['removeTeams'](_0x320e16['query'][_0xd596('0x71')],{'transaction':_0x214adc})[_0xd596('0x27')](function(){if(!_['isEmpty'](_0x546539)){return _0x162a88['removeAgents'](_0x546539,{'transaction':_0x214adc});}})['then'](function(){_0x546539['forEach'](function(_0x4d3a08){socket['emit'](_0xd596('0x85'),{'UserId':_0x4d3a08,'OpenchannelQueueId':_0x162a88['id']});});});});});});})[_0xd596('0x27')](respondWithStatusCode(_0x2a7557,null))['catch'](handleError(_0x2a7557,null));};exports[_0xd596('0x86')]=function(_0x4e6cba,_0x29f6c6,_0x4237b){return db['OpenchannelQueue']['find']({'where':{'id':_0x4e6cba[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0x29f6c6,null))[_0xd596('0x27')](function(_0x55731d){if(_0x55731d){return _0x55731d[_0xd596('0x86')](_0x4e6cba[_0xd596('0x49')]['ids'],_[_0xd596('0x87')](_0x4e6cba[_0xd596('0x49')],['ids','id'])||{})[_0xd596('0x88')](function(_0xf225d3){for(var _0x3ddf8d=0x0;_0x3ddf8d<_0x4e6cba['body']['ids'][_0xd596('0x36')];_0x3ddf8d+=0x1){socket[_0xd596('0x89')](_0xd596('0x70'),{'UserId':_0x4e6cba[_0xd596('0x49')]['ids'][_0x3ddf8d],'OpenchannelQueueId':_0x4e6cba[_0xd596('0x45')]['id']});}return _0xf225d3;});}})[_0xd596('0x27')](respondWithResult(_0x29f6c6,null))[_0xd596('0x44')](handleError(_0x29f6c6,null));};exports[_0xd596('0x8a')]=function(_0x47bf0b,_0x410be6,_0x563577){return db[_0xd596('0x41')][_0xd596('0x4f')]({'where':{'id':_0x47bf0b[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0x410be6,null))[_0xd596('0x27')](function(_0x3c15ac){if(_0x3c15ac){return _0x3c15ac['removeAgents'](_0x47bf0b[_0xd596('0x31')][_0xd596('0x71')])[_0xd596('0x27')](function(){if(_[_0xd596('0x8b')](_0x47bf0b[_0xd596('0x31')][_0xd596('0x71')])){for(var _0x55aaed=0x0;_0x55aaed<_0x47bf0b[_0xd596('0x31')][_0xd596('0x71')][_0xd596('0x36')];_0x55aaed+=0x1){socket[_0xd596('0x89')]('userOpenchannelQueue:remove',{'UserId':Number(_0x47bf0b[_0xd596('0x31')]['ids'][_0x55aaed]),'OpenchannelQueueId':Number(_0x47bf0b[_0xd596('0x45')]['id'])});}}else{socket[_0xd596('0x89')](_0xd596('0x85'),{'UserId':Number(_0x47bf0b[_0xd596('0x31')][_0xd596('0x71')]),'OpenchannelQueueId':Number(_0x47bf0b[_0xd596('0x45')]['id'])});}});}})[_0xd596('0x27')](respondWithStatusCode(_0x410be6,null))['catch'](handleError(_0x410be6,null));};exports[_0xd596('0x8c')]=function(_0x5b2318,_0x4dab34,_0x1a4890){var _0x450b1d={};var _0x4adece={};var _0x44cdb1;var _0x52e30f;return db[_0xd596('0x41')][_0xd596('0x53')]({'where':{'id':_0x5b2318[_0xd596('0x45')]['id']}})[_0xd596('0x27')](handleEntityNotFound(_0x4dab34,null))[_0xd596('0x27')](function(_0x2e0463){if(_0x2e0463){_0x44cdb1=_0x2e0463;_0x4adece['model']=_[_0xd596('0x30')](db[_0xd596('0x5a')]['rawAttributes']);_0x4adece[_0xd596('0x31')]=_[_0xd596('0x30')](_0x5b2318['query']);_0x4adece[_0xd596('0x32')]=_[_0xd596('0x33')](_0x4adece[_0xd596('0x2f')],_0x4adece[_0xd596('0x31')]);_0x450b1d['attributes']=_[_0xd596('0x33')](_0x4adece['model'],qs[_0xd596('0x34')](_0x5b2318['query'][_0xd596('0x34')]));_0x450b1d[_0xd596('0x35')]=_0x450b1d[_0xd596('0x35')][_0xd596('0x36')]?_0x450b1d[_0xd596('0x35')]:_0x4adece[_0xd596('0x2f')];_0x450b1d[_0xd596('0x38')]=qs[_0xd596('0x39')](_0x5b2318['query'][_0xd596('0x39')]);_0x450b1d[_0xd596('0x3a')]=qs[_0xd596('0x32')](_[_0xd596('0x56')](_0x5b2318[_0xd596('0x31')],_0x4adece[_0xd596('0x32')]));if(_0x5b2318['query']['filter']){_0x450b1d[_0xd596('0x3a')]=_[_0xd596('0x3f')](_0x450b1d[_0xd596('0x3a')],{'$or':_[_0xd596('0x3b')](_0x450b1d[_0xd596('0x35')],function(_0x2af4d0){var _0x1ec14f={};_0x1ec14f[_0x2af4d0]={'$like':'%'+_0x5b2318[_0xd596('0x31')]['filter']+'%'};return _0x1ec14f;})});}_0x450b1d=_[_0xd596('0x3f')]({},_0x450b1d,_0x5b2318[_0xd596('0x40')]);return _0x44cdb1['getAgents'](_0x450b1d);}})[_0xd596('0x27')](function(_0x5c19d5){if(_0x5c19d5){_0x52e30f=_0x5c19d5['length'];if(!_0x5b2318[_0xd596('0x31')][_0xd596('0x37')](_0xd596('0x55'))){_0x450b1d[_0xd596('0x20')]=qs['limit'](_0x5b2318[_0xd596('0x31')][_0xd596('0x20')]);_0x450b1d[_0xd596('0x1f')]=qs[_0xd596('0x1f')](_0x5b2318[_0xd596('0x31')][_0xd596('0x1f')]);}return _0x44cdb1[_0xd596('0x8c')](_0x450b1d);}})[_0xd596('0x27')](function(_0x40ecd9){if(_0x40ecd9){return _0x40ecd9?{'count':_0x52e30f,'rows':_0x40ecd9}:null;}})[_0xd596('0x27')](respondWithResult(_0x4dab34,null))[_0xd596('0x44')](handleError(_0x4dab34,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index be88e36..a55736f 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 _0x5a9b=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x318508,_0x2cef7c){var _0x1c2ca4=function(_0x5bca4c){while(--_0x5bca4c){_0x318508['push'](_0x318508['shift']());}};_0x1c2ca4(++_0x2cef7c);}(_0x5a9b,0x1e3));var _0xb5a9=function(_0x1361a4,_0x32c15f){_0x1361a4=_0x1361a4-0x0;var _0x266cc0=_0x5a9b[_0x1361a4];return _0x266cc0;};'use strict';var EventEmitter=require(_0xb5a9('0x0'));var OpenchannelQueue=require(_0xb5a9('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb5a9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb5a9('0x3')};function emitEvent(_0x25ed60){return function(_0x1de609,_0x2b5b6a,_0x29ae56){OpenchannelQueueEvents[_0xb5a9('0x4')](_0x25ed60+':'+_0x1de609['id'],_0x1de609);OpenchannelQueueEvents['emit'](_0x25ed60,_0x1de609);_0x29ae56(null);};}for(var e in events){if(events[_0xb5a9('0x5')](e)){var event=events[e];OpenchannelQueue[_0xb5a9('0x6')](e,emitEvent(event));}}module[_0xb5a9('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2598=['setMaxListeners','save','update','remove','hasOwnProperty','../../mysqldb'];(function(_0x3f7f75,_0x1f74b8){var _0x5a217b=function(_0x402ca9){while(--_0x402ca9){_0x3f7f75['push'](_0x3f7f75['shift']());}};_0x5a217b(++_0x1f74b8);}(_0x2598,0x101));var _0x8259=function(_0x5910f5,_0x53b4c2){_0x5910f5=_0x5910f5-0x0;var _0x401c3e=_0x2598[_0x5910f5];return _0x401c3e;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8259('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8259('0x1')](0x0);var events={'afterCreate':_0x8259('0x2'),'afterUpdate':_0x8259('0x3'),'afterDestroy':_0x8259('0x4')};function emitEvent(_0x26062d){return function(_0x560a24,_0x3c6662,_0x189d68){OpenchannelQueueEvents['emit'](_0x26062d+':'+_0x560a24['id'],_0x560a24);OpenchannelQueueEvents['emit'](_0x26062d,_0x560a24);_0x189d68(null);};}for(var e in events){if(events[_0x8259('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 73e6974..66be0bd 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 _0xa2cb=['openchannel_queues','lodash','util','../../config/logger','api','bluebird','rimraf','define','OpenchannelQueue'];(function(_0x15e0a3,_0x3da4b5){var _0x261c01=function(_0x427cff){while(--_0x427cff){_0x15e0a3['push'](_0x15e0a3['shift']());}};_0x261c01(++_0x3da4b5);}(_0xa2cb,0x106));var _0xba2c=function(_0x4ba92b,_0x35f350){_0x4ba92b=_0x4ba92b-0x0;var _0x38bf8c=_0xa2cb[_0x4ba92b];return _0x38bf8c;};'use strict';var _=require(_0xba2c('0x0'));var util=require(_0xba2c('0x1'));var logger=require(_0xba2c('0x2'))(_0xba2c('0x3'));var moment=require('moment');var BPromise=require(_0xba2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba2c('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0xe477a8,_0x35ba99){return _0xe477a8[_0xba2c('0x6')](_0xba2c('0x7'),attributes,{'tableName':_0xba2c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e10=['request-promise','path','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','util','../../config/logger','api'];(function(_0x57f99e,_0x308f2c){var _0x2e6834=function(_0x2945dc){while(--_0x2945dc){_0x57f99e['push'](_0x57f99e['shift']());}};_0x2e6834(++_0x308f2c);}(_0x8e10,0x15b));var _0x08e1=function(_0x5b5ffe,_0x1c5874){_0x5b5ffe=_0x5b5ffe-0x0;var _0x2d12bc=_0x8e10[_0x5b5ffe];return _0x2d12bc;};'use strict';var _=require(_0x08e1('0x0'));var util=require(_0x08e1('0x1'));var logger=require(_0x08e1('0x2'))(_0x08e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x08e1('0x4'));var fs=require('fs');var path=require(_0x08e1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x08e1('0x6'));module['exports']=function(_0x327125,_0x5adb75){return _0x327125[_0x08e1('0x7')](_0x08e1('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 73338d8..4253662 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 _0xf3be=['lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowOpenchannelQueue','find'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0xf3be,0x1e1));var _0xef3b=function(_0xf499ca,_0xe0e565){_0xf499ca=_0xf499ca-0x0;var _0x36e0aa=_0xf3be[_0xf499ca];return _0x36e0aa;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var moment=require(_0xef3b('0x2'));var BPromise=require(_0xef3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef3b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xef3b('0x5'));var jayson=require(_0xef3b('0x6'));var client=jayson['client'][_0xef3b('0x7')]({'port':0x232a});config[_0xef3b('0x8')]=_[_0xef3b('0x9')](config[_0xef3b('0x8')],{'host':_0xef3b('0xa'),'port':0x18eb});var socket=require(_0xef3b('0xb'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xef3b('0xc')](socket);function respondWithRpcPromise(_0x5d7b56,_0xecdace,_0x3f5562){return new BPromise(function(_0x2589d4,_0x5b7ea8){return client[_0xef3b('0xd')](_0x5d7b56,_0x3f5562)['then'](function(_0x11e926){logger[_0xef3b('0xe')](_0xef3b('0xf'),_0xecdace,_0xef3b('0x10'));logger[_0xef3b('0x11')](_0xef3b('0x12'),_0xecdace,_0xef3b('0x10'),JSON[_0xef3b('0x13')](_0x11e926));if(_0x11e926[_0xef3b('0x14')]){if(_0x11e926[_0xef3b('0x14')]['code']===0x1f4){logger['error'](_0xef3b('0xf'),_0xecdace,_0x11e926[_0xef3b('0x14')][_0xef3b('0x15')]);return _0x5b7ea8(_0x11e926[_0xef3b('0x14')][_0xef3b('0x15')]);}logger['error'](_0xef3b('0xf'),_0xecdace,_0x11e926[_0xef3b('0x14')][_0xef3b('0x15')]);return _0x2589d4(_0x11e926[_0xef3b('0x14')][_0xef3b('0x15')]);}else{logger['info'](_0xef3b('0xf'),_0xecdace,_0xef3b('0x10'));_0x2589d4(_0x11e926['result'][_0xef3b('0x15')]);}})['catch'](function(_0x30b2d8){logger['error'](_0xef3b('0xf'),_0xecdace,_0x30b2d8);_0x5b7ea8(_0x30b2d8);});});}exports[_0xef3b('0x16')]=function(_0x164b15){var _0x1a7498=this;return new Promise(function(_0x2a5145,_0x3d18ef){return db[_0xef3b('0x17')][_0xef3b('0x18')]({'raw':_0x164b15['options']?_0x164b15[_0xef3b('0x19')][_0xef3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x164b15[_0xef3b('0x19')]?_0x164b15[_0xef3b('0x19')][_0xef3b('0x1b')]||null:null,'attributes':_0x164b15[_0xef3b('0x19')]?_0x164b15['options'][_0xef3b('0x1c')]||null:null,'limit':_0x164b15['options']?_0x164b15['options'][_0xef3b('0x1d')]||null:null,'include':_0x164b15[_0xef3b('0x19')]?_0x164b15[_0xef3b('0x19')][_0xef3b('0x1e')]?_[_0xef3b('0x1f')](_0x164b15[_0xef3b('0x19')]['include'],function(_0x487ae6){return{'model':db[_0x487ae6[_0xef3b('0x20')]],'as':_0x487ae6['as'],'attributes':_0x487ae6['attributes'],'include':_0x487ae6['include']?_[_0xef3b('0x1f')](_0x487ae6[_0xef3b('0x1e')],function(_0x273fb5){return{'model':db[_0x273fb5[_0xef3b('0x20')]],'as':_0x273fb5['as'],'attributes':_0x273fb5[_0xef3b('0x1c')],'include':_0x273fb5[_0xef3b('0x1e')]?_[_0xef3b('0x1f')](_0x273fb5[_0xef3b('0x1e')],function(_0x556c5c){return{'model':db[_0x556c5c[_0xef3b('0x20')]],'as':_0x556c5c['as'],'attributes':_0x556c5c[_0xef3b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef3b('0x21')](function(_0x187d1b){logger[_0xef3b('0xe')](_0xef3b('0x16'),_0x164b15);logger[_0xef3b('0x11')]('GetOpenchannelQueue',_0x164b15,JSON['stringify'](_0x187d1b));_0x2a5145(_0x187d1b);})[_0xef3b('0x22')](function(_0x31d802){logger[_0xef3b('0x14')]('GetOpenchannelQueue',_0x31d802[_0xef3b('0x15')],_0x164b15);_0x3d18ef(_0x1a7498[_0xef3b('0x14')](0x1f4,_0x31d802[_0xef3b('0x15')]));});});};exports[_0xef3b('0x23')]=function(_0x285c52){var _0x56369e=this;return new Promise(function(_0xf5f1e6,_0x537752){return db[_0xef3b('0x17')][_0xef3b('0x24')]({'raw':_0x285c52[_0xef3b('0x19')]?_0x285c52['options'][_0xef3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x285c52[_0xef3b('0x19')]?_0x285c52[_0xef3b('0x19')]['where']||null:null,'attributes':_0x285c52[_0xef3b('0x19')]?_0x285c52['options'][_0xef3b('0x1c')]||null:null,'include':_0x285c52[_0xef3b('0x19')]?_0x285c52['options']['include']?_[_0xef3b('0x1f')](_0x285c52[_0xef3b('0x19')][_0xef3b('0x1e')],function(_0x4de915){return{'model':db[_0x4de915[_0xef3b('0x20')]],'as':_0x4de915['as'],'attributes':_0x4de915[_0xef3b('0x1c')],'include':_0x4de915[_0xef3b('0x1e')]?_[_0xef3b('0x1f')](_0x4de915[_0xef3b('0x1e')],function(_0x12fd8c){return{'model':db[_0x12fd8c['model']],'as':_0x12fd8c['as'],'attributes':_0x12fd8c['attributes'],'include':_0x12fd8c[_0xef3b('0x1e')]?_[_0xef3b('0x1f')](_0x12fd8c[_0xef3b('0x1e')],function(_0x3b6d01){return{'model':db[_0x3b6d01[_0xef3b('0x20')]],'as':_0x3b6d01['as'],'attributes':_0x3b6d01[_0xef3b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3787f4){logger[_0xef3b('0xe')](_0xef3b('0x23'),_0x285c52);logger['debug'](_0xef3b('0x23'),_0x285c52,JSON['stringify'](_0x3787f4));_0xf5f1e6(_0x3787f4);})[_0xef3b('0x22')](function(_0x5e621e){logger[_0xef3b('0x14')]('ShowOpenchannelQueue',_0x5e621e[_0xef3b('0x15')],_0x285c52);_0x537752(_0x56369e['error'](0x1f4,_0x5e621e[_0xef3b('0x15')]));});});}; \ No newline at end of file +var _0xf2cb=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','debug','find','ShowOpenchannelQueue','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','register'];(function(_0x22f61c,_0x22e691){var _0x2a0d5c=function(_0x3b2dca){while(--_0x3b2dca){_0x22f61c['push'](_0x22f61c['shift']());}};_0x2a0d5c(++_0x22e691);}(_0xf2cb,0x130));var _0xbf2c=function(_0x9012b5,_0x4eb426){_0x9012b5=_0x9012b5-0x0;var _0x4973e3=_0xf2cb[_0x9012b5];return _0x4973e3;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});config[_0xbf2c('0x8')]=_['defaults'](config[_0xbf2c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf2c('0x9'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xbf2c('0xa')](socket);function respondWithRpcPromise(_0x16c303,_0xeb0e9d,_0x5e10f4){return new BPromise(function(_0x436c9c,_0x2fe412){return client[_0xbf2c('0xb')](_0x16c303,_0x5e10f4)[_0xbf2c('0xc')](function(_0x2cf159){logger[_0xbf2c('0xd')](_0xbf2c('0xe'),_0xeb0e9d,_0xbf2c('0xf'));logger['debug'](_0xbf2c('0x10'),_0xeb0e9d,_0xbf2c('0xf'),JSON[_0xbf2c('0x11')](_0x2cf159));if(_0x2cf159[_0xbf2c('0x12')]){if(_0x2cf159['error'][_0xbf2c('0x13')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0xeb0e9d,_0x2cf159[_0xbf2c('0x12')]['message']);return _0x2fe412(_0x2cf159['error'][_0xbf2c('0x14')]);}logger[_0xbf2c('0x12')](_0xbf2c('0xe'),_0xeb0e9d,_0x2cf159[_0xbf2c('0x12')][_0xbf2c('0x14')]);return _0x436c9c(_0x2cf159['error'][_0xbf2c('0x14')]);}else{logger['info'](_0xbf2c('0xe'),_0xeb0e9d,_0xbf2c('0xf'));_0x436c9c(_0x2cf159[_0xbf2c('0x15')][_0xbf2c('0x14')]);}})[_0xbf2c('0x16')](function(_0x57e01a){logger[_0xbf2c('0x12')](_0xbf2c('0xe'),_0xeb0e9d,_0x57e01a);_0x2fe412(_0x57e01a);});});}exports[_0xbf2c('0x17')]=function(_0x5353e7){var _0x11930f=this;return new Promise(function(_0x102cef,_0x426724){return db['OpenchannelQueue'][_0xbf2c('0x18')]({'raw':_0x5353e7[_0xbf2c('0x19')]?_0x5353e7[_0xbf2c('0x19')][_0xbf2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5353e7['options']?_0x5353e7[_0xbf2c('0x19')][_0xbf2c('0x1b')]||null:null,'attributes':_0x5353e7['options']?_0x5353e7[_0xbf2c('0x19')][_0xbf2c('0x1c')]||null:null,'limit':_0x5353e7[_0xbf2c('0x19')]?_0x5353e7['options']['limit']||null:null,'include':_0x5353e7[_0xbf2c('0x19')]?_0x5353e7[_0xbf2c('0x19')][_0xbf2c('0x1d')]?_[_0xbf2c('0x1e')](_0x5353e7[_0xbf2c('0x19')][_0xbf2c('0x1d')],function(_0x11ffbe){return{'model':db[_0x11ffbe['model']],'as':_0x11ffbe['as'],'attributes':_0x11ffbe['attributes'],'include':_0x11ffbe[_0xbf2c('0x1d')]?_[_0xbf2c('0x1e')](_0x11ffbe[_0xbf2c('0x1d')],function(_0x4314d6){return{'model':db[_0x4314d6[_0xbf2c('0x1f')]],'as':_0x4314d6['as'],'attributes':_0x4314d6[_0xbf2c('0x1c')],'include':_0x4314d6[_0xbf2c('0x1d')]?_[_0xbf2c('0x1e')](_0x4314d6[_0xbf2c('0x1d')],function(_0x4f3191){return{'model':db[_0x4f3191[_0xbf2c('0x1f')]],'as':_0x4f3191['as'],'attributes':_0x4f3191['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf2c('0xc')](function(_0x3442fa){logger[_0xbf2c('0xd')](_0xbf2c('0x17'),_0x5353e7);logger[_0xbf2c('0x20')]('GetOpenchannelQueue',_0x5353e7,JSON[_0xbf2c('0x11')](_0x3442fa));_0x102cef(_0x3442fa);})[_0xbf2c('0x16')](function(_0x132365){logger[_0xbf2c('0x12')](_0xbf2c('0x17'),_0x132365[_0xbf2c('0x14')],_0x5353e7);_0x426724(_0x11930f[_0xbf2c('0x12')](0x1f4,_0x132365[_0xbf2c('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x37cf35){var _0x3dfe0e=this;return new Promise(function(_0x30f0c0,_0x5b93aa){return db['OpenchannelQueue'][_0xbf2c('0x21')]({'raw':_0x37cf35[_0xbf2c('0x19')]?_0x37cf35[_0xbf2c('0x19')][_0xbf2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x37cf35[_0xbf2c('0x19')]?_0x37cf35[_0xbf2c('0x19')][_0xbf2c('0x1b')]||null:null,'attributes':_0x37cf35[_0xbf2c('0x19')]?_0x37cf35[_0xbf2c('0x19')]['attributes']||null:null,'include':_0x37cf35[_0xbf2c('0x19')]?_0x37cf35[_0xbf2c('0x19')][_0xbf2c('0x1d')]?_[_0xbf2c('0x1e')](_0x37cf35[_0xbf2c('0x19')][_0xbf2c('0x1d')],function(_0x18ddfb){return{'model':db[_0x18ddfb[_0xbf2c('0x1f')]],'as':_0x18ddfb['as'],'attributes':_0x18ddfb['attributes'],'include':_0x18ddfb[_0xbf2c('0x1d')]?_[_0xbf2c('0x1e')](_0x18ddfb[_0xbf2c('0x1d')],function(_0x50936a){return{'model':db[_0x50936a[_0xbf2c('0x1f')]],'as':_0x50936a['as'],'attributes':_0x50936a[_0xbf2c('0x1c')],'include':_0x50936a[_0xbf2c('0x1d')]?_['map'](_0x50936a[_0xbf2c('0x1d')],function(_0x43f1ad){return{'model':db[_0x43f1ad['model']],'as':_0x43f1ad['as'],'attributes':_0x43f1ad['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x509fb0){logger['info'](_0xbf2c('0x22'),_0x37cf35);logger[_0xbf2c('0x20')](_0xbf2c('0x22'),_0x37cf35,JSON[_0xbf2c('0x11')](_0x509fb0));_0x30f0c0(_0x509fb0);})[_0xbf2c('0x16')](function(_0x16fbd5){logger[_0xbf2c('0x12')](_0xbf2c('0x22'),_0x16fbd5[_0xbf2c('0x14')],_0x37cf35);_0x5b93aa(_0x3dfe0e[_0xbf2c('0x12')](0x1f4,_0x16fbd5[_0xbf2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3b84346..5c7e9ec 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.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(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ac1778e..00bbb55 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 _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x11fd35,_0x259295){var _0x3792de=function(_0x5c099c){while(--_0x5c099c){_0x11fd35['push'](_0x11fd35['shift']());}};_0x3792de(++_0x259295);}(_0xb10b,0x12a));var _0xbb10=function(_0xc4376d,_0x2e6841){_0xc4376d=_0xc4376d-0x0;var _0x291524=_0xb10b[_0xc4376d];return _0x291524;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x13f83f,_0x44e4b6){var _0x5648f5=function(_0x2611bb){while(--_0x2611bb){_0x13f83f['push'](_0x13f83f['shift']());}};_0x5648f5(++_0x44e4b6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4003fe,_0x38c382){_0x4003fe=_0x4003fe-0x0;var _0x5af37c=_0xb10b[_0x4003fe];return _0x5af37c;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2823224..3cddbb4 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 _0x31ab=['sequelize','STRING','DATE','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31ab,0x113));var _0xb31a=function(_0x298ff5,_0xea0386){_0x298ff5=_0x298ff5-0x0;var _0x3a0224=_0x31ab[_0x298ff5];return _0x3a0224;};'use strict';var moment=require(_0xb31a('0x0'));var Sequelize=require(_0xb31a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb31a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb31a('0x2')]},'joinAt':{'type':Sequelize[_0xb31a('0x3')]},'leaveAt':{'type':Sequelize[_0xb31a('0x3')]},'acceptAt':{'type':Sequelize[_0xb31a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe463=['DATE','sequelize','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xe463,0x8e));var _0x3e46=function(_0x28f1c0,_0x2988a6){_0x28f1c0=_0x28f1c0-0x0;var _0x15632d=_0xe463[_0x28f1c0];return _0x15632d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3e46('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3e46('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3e46('0x2')]},'leaveAt':{'type':Sequelize[_0x3e46('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3e46('0x2')]},'reason':{'type':Sequelize[_0x3e46('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5cabfbe..d3cc877 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 _0xf6de=['sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','name','send','OpenchannelQueueReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','catch','rawAttributes','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xf6de,0x152));var _0xef6d=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0xf6de[_0x47568e];return _0x33815b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xef6d('0x0'));var rimraf=require(_0xef6d('0x1'));var zipdir=require(_0xef6d('0x2'));var jsonpatch=require(_0xef6d('0x3'));var rp=require('request-promise');var moment=require(_0xef6d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef6d('0x5'));var util=require('util');var path=require(_0xef6d('0x6'));var sox=require(_0xef6d('0x7'));var csv=require('to-csv');var ejs=require(_0xef6d('0x8'));var fs=require('fs');var _=require(_0xef6d('0x9'));var squel=require(_0xef6d('0xa'));var crypto=require(_0xef6d('0xb'));var jsforce=require(_0xef6d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xef6d('0xd'));var querystring=require(_0xef6d('0xe'));var Papa=require(_0xef6d('0xf'));var Redis=require(_0xef6d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xef6d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef6d('0x12'))(_0xef6d('0x13'));var utils=require(_0xef6d('0x14'));var config=require(_0xef6d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28d0b1,_0x4f0230){_0x4f0230=_0x4f0230||0xcc;return function(_0x2f2267){if(_0x2f2267){return _0x28d0b1[_0xef6d('0x16')](_0x4f0230);}return _0x28d0b1['status'](_0x4f0230)[_0xef6d('0x17')]();};}function respondWithResult(_0x1591bf,_0x2e5485){_0x2e5485=_0x2e5485||0xc8;return function(_0x375ed2){if(_0x375ed2){return _0x1591bf['status'](_0x2e5485)['json'](_0x375ed2);}};}function respondWithFilteredResult(_0x35f3a6,_0x400f2c){return function(_0x1fbf67){if(_0x1fbf67){var _0x5861f1=_0x1fbf67[_0xef6d('0x18')],_0x1c0207=_0x400f2c[_0xef6d('0x19')],_0x2a343b=_0x400f2c[_0xef6d('0x19')]+_0x400f2c[_0xef6d('0x1a')],_0x200bcf;if(_0x2a343b>=_0x5861f1){_0x2a343b=_0x5861f1;_0x200bcf=0xc8;}else{_0x200bcf=0xce;}_0x35f3a6[_0xef6d('0x1b')](_0x200bcf);return _0x35f3a6[_0xef6d('0x1c')]('Content-Range',_0x1c0207+'-'+_0x2a343b+'/'+_0x5861f1)[_0xef6d('0x1d')](_0x1fbf67);}return null;};}function patchUpdates(_0x12decd){return function(_0x28f909){try{jsonpatch[_0xef6d('0x1e')](_0x28f909,_0x12decd,!![]);}catch(_0x3698fd){return BPromise[_0xef6d('0x1f')](_0x3698fd);}return _0x28f909[_0xef6d('0x20')]();};}function saveUpdates(_0x1c6254,_0x3fdb6d){return function(_0x4f6273){if(_0x4f6273){return _0x4f6273[_0xef6d('0x21')](_0x1c6254)[_0xef6d('0x22')](function(_0x280b96){return _0x280b96;});}return null;};}function removeEntity(_0x44ff27,_0x47917a){return function(_0x349a00){if(_0x349a00){return _0x349a00[_0xef6d('0x23')]()['then'](function(){_0x44ff27[_0xef6d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3413da,_0x4784e5){return function(_0x1b8064){if(!_0x1b8064){_0x3413da[_0xef6d('0x16')](0x194);}return _0x1b8064;};}function handleError(_0x4f9429,_0x13e690){_0x13e690=_0x13e690||0x1f4;return function(_0x469848){logger['error'](_0x469848['stack']);if(_0x469848[_0xef6d('0x24')]){delete _0x469848[_0xef6d('0x24')];}_0x4f9429[_0xef6d('0x1b')](_0x13e690)[_0xef6d('0x25')](_0x469848);};}exports['index']=function(_0x262351,_0x4c2471){var _0x53f477={},_0x646f01={},_0x5c783e={'count':0x0,'rows':[]};var _0x498a57=db[_0xef6d('0x26')]['rawAttributes'];_0x646f01[_0xef6d('0x27')]=_[_0xef6d('0x28')](_0x498a57);_0x646f01[_0xef6d('0x29')]=_[_0xef6d('0x28')](_0x262351[_0xef6d('0x29')]);_0x646f01[_0xef6d('0x2a')]=_[_0xef6d('0x2b')](_0x646f01[_0xef6d('0x27')],_0x646f01[_0xef6d('0x29')]);_0x53f477[_0xef6d('0x2c')]=_[_0xef6d('0x2b')](_0x646f01[_0xef6d('0x27')],qs[_0xef6d('0x2d')](_0x262351[_0xef6d('0x29')][_0xef6d('0x2d')]));_0x53f477['attributes']=_0x53f477[_0xef6d('0x2c')][_0xef6d('0x2e')]?_0x53f477[_0xef6d('0x2c')]:_0x646f01[_0xef6d('0x27')];if(!_0x262351[_0xef6d('0x29')][_0xef6d('0x2f')](_0xef6d('0x30'))){_0x53f477[_0xef6d('0x1a')]=qs[_0xef6d('0x1a')](_0x262351[_0xef6d('0x29')]['limit']);_0x53f477[_0xef6d('0x19')]=qs[_0xef6d('0x19')](_0x262351[_0xef6d('0x29')][_0xef6d('0x19')]);}_0x53f477[_0xef6d('0x31')]=qs[_0xef6d('0x32')](_0x262351['query'][_0xef6d('0x32')]);_0x53f477[_0xef6d('0x33')]=qs[_0xef6d('0x2a')](_['pick'](_0x262351[_0xef6d('0x29')],_0x646f01[_0xef6d('0x2a')]));if(_0x262351[_0xef6d('0x29')][_0xef6d('0x34')]){_0x53f477[_0xef6d('0x33')]=_['merge'](_0x53f477['where'],{'$or':_[_0xef6d('0x35')](_0x498a57,function(_0x491ba3){if(_0x491ba3['type'][_0xef6d('0x36')]!==_0xef6d('0x37')){var _0x8d95af={};_0x8d95af[_0x491ba3[_0xef6d('0x38')]]={'$like':'%'+_0x262351[_0xef6d('0x29')]['filter']+'%'};return _0x8d95af;}})});}_0x53f477=_[_0xef6d('0x39')]({},_0x53f477,_0x262351[_0xef6d('0x3a')]);var _0x51c196={'where':_0x53f477[_0xef6d('0x33')]};return db['OpenchannelQueueReport'][_0xef6d('0x18')](_0x51c196)[_0xef6d('0x22')](function(_0x5aff89){_0x5c783e[_0xef6d('0x18')]=_0x5aff89;if(_0x262351['query'][_0xef6d('0x3b')]){_0x53f477[_0xef6d('0x3c')]=[{'all':!![]}];}return db[_0xef6d('0x26')][_0xef6d('0x3d')](_0x53f477);})[_0xef6d('0x22')](function(_0x3a7dc9){_0x5c783e['rows']=_0x3a7dc9;return _0x5c783e;})[_0xef6d('0x22')](respondWithFilteredResult(_0x4c2471,_0x53f477))[_0xef6d('0x3e')](handleError(_0x4c2471,null));};exports['show']=function(_0x4ed5d9,_0x4fb7f8){var _0x5f5301={'raw':!![],'where':{'id':_0x4ed5d9['params']['id']}},_0x31f6d9={};_0x31f6d9[_0xef6d('0x27')]=_[_0xef6d('0x28')](db[_0xef6d('0x26')][_0xef6d('0x3f')]);_0x31f6d9[_0xef6d('0x29')]=_['keys'](_0x4ed5d9[_0xef6d('0x29')]);_0x31f6d9[_0xef6d('0x2a')]=_['intersection'](_0x31f6d9[_0xef6d('0x27')],_0x31f6d9[_0xef6d('0x29')]);_0x5f5301[_0xef6d('0x2c')]=_[_0xef6d('0x2b')](_0x31f6d9[_0xef6d('0x27')],qs[_0xef6d('0x2d')](_0x4ed5d9[_0xef6d('0x29')][_0xef6d('0x2d')]));_0x5f5301['attributes']=_0x5f5301[_0xef6d('0x2c')][_0xef6d('0x2e')]?_0x5f5301['attributes']:_0x31f6d9[_0xef6d('0x27')];if(_0x4ed5d9[_0xef6d('0x29')][_0xef6d('0x3b')]){_0x5f5301[_0xef6d('0x3c')]=[{'all':!![]}];}_0x5f5301=_['merge']({},_0x5f5301,_0x4ed5d9[_0xef6d('0x3a')]);return db['OpenchannelQueueReport']['find'](_0x5f5301)[_0xef6d('0x22')](handleEntityNotFound(_0x4fb7f8,null))[_0xef6d('0x22')](respondWithResult(_0x4fb7f8,null))['catch'](handleError(_0x4fb7f8,null));};exports['create']=function(_0x24cb1d,_0x5dced1){return db['OpenchannelQueueReport'][_0xef6d('0x40')](_0x24cb1d[_0xef6d('0x41')],{})[_0xef6d('0x22')](respondWithResult(_0x5dced1,0xc9))[_0xef6d('0x3e')](handleError(_0x5dced1,null));};exports[_0xef6d('0x21')]=function(_0xe7a3d8,_0x55e7f3){if(_0xe7a3d8[_0xef6d('0x41')]['id']){delete _0xe7a3d8[_0xef6d('0x41')]['id'];}return db[_0xef6d('0x26')][_0xef6d('0x42')]({'where':{'id':_0xe7a3d8['params']['id']}})['then'](handleEntityNotFound(_0x55e7f3,null))[_0xef6d('0x22')](saveUpdates(_0xe7a3d8['body'],null))[_0xef6d('0x22')](respondWithResult(_0x55e7f3,null))[_0xef6d('0x3e')](handleError(_0x55e7f3,null));};exports[_0xef6d('0x23')]=function(_0x578d2e,_0x557d2e){return db[_0xef6d('0x26')][_0xef6d('0x42')]({'where':{'id':_0x578d2e[_0xef6d('0x43')]['id']}})[_0xef6d('0x22')](handleEntityNotFound(_0x557d2e,null))[_0xef6d('0x22')](removeEntity(_0x557d2e,null))[_0xef6d('0x3e')](handleError(_0x557d2e,null));};exports['describe']=function(_0x332eac,_0x43d837){return db[_0xef6d('0x26')][_0xef6d('0x44')]()[_0xef6d('0x22')](respondWithResult(_0x43d837,null))[_0xef6d('0x3e')](handleError(_0x43d837,null));}; \ No newline at end of file +var _0x4058=['pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','OpenchannelQueueReport','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where'];(function(_0x15d9e5,_0xc51304){var _0x2e7f4d=function(_0x28cd73){while(--_0x28cd73){_0x15d9e5['push'](_0x15d9e5['shift']());}};_0x2e7f4d(++_0xc51304);}(_0x4058,0x134));var _0x8405=function(_0x47f47c,_0x3b3476){_0x47f47c=_0x47f47c-0x0;var _0x183d8b=_0x4058[_0x47f47c];return _0x183d8b;};'use strict';var pdf=require(_0x8405('0x0'));var emlformat=require(_0x8405('0x1'));var rimraf=require(_0x8405('0x2'));var zipdir=require(_0x8405('0x3'));var jsonpatch=require(_0x8405('0x4'));var rp=require(_0x8405('0x5'));var moment=require(_0x8405('0x6'));var BPromise=require(_0x8405('0x7'));var Mustache=require(_0x8405('0x8'));var util=require(_0x8405('0x9'));var path=require(_0x8405('0xa'));var sox=require('sox');var csv=require(_0x8405('0xb'));var ejs=require(_0x8405('0xc'));var fs=require('fs');var _=require(_0x8405('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8405('0xe'));var deskjs=require(_0x8405('0xf'));var toCsv=require(_0x8405('0xb'));var querystring=require(_0x8405('0x10'));var Papa=require('papaparse');var Redis=require(_0x8405('0x11'));var authService=require(_0x8405('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8405('0x13'));var logger=require(_0x8405('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8405('0x15'))['db'];function respondWithStatusCode(_0x512e8d,_0x4040b5){_0x4040b5=_0x4040b5||0xcc;return function(_0x3860d5){if(_0x3860d5){return _0x512e8d[_0x8405('0x16')](_0x4040b5);}return _0x512e8d['status'](_0x4040b5)[_0x8405('0x17')]();};}function respondWithResult(_0x302334,_0x2f413a){_0x2f413a=_0x2f413a||0xc8;return function(_0x55c757){if(_0x55c757){return _0x302334[_0x8405('0x18')](_0x2f413a)[_0x8405('0x19')](_0x55c757);}};}function respondWithFilteredResult(_0x14b5ad,_0x1a16e8){return function(_0x2c7dd3){if(_0x2c7dd3){var _0x2ceed8=_0x2c7dd3[_0x8405('0x1a')],_0x3af16f=_0x1a16e8['offset'],_0x1a0e24=_0x1a16e8['offset']+_0x1a16e8[_0x8405('0x1b')],_0x447941;if(_0x1a0e24>=_0x2ceed8){_0x1a0e24=_0x2ceed8;_0x447941=0xc8;}else{_0x447941=0xce;}_0x14b5ad[_0x8405('0x18')](_0x447941);return _0x14b5ad[_0x8405('0x1c')](_0x8405('0x1d'),_0x3af16f+'-'+_0x1a0e24+'/'+_0x2ceed8)[_0x8405('0x19')](_0x2c7dd3);}return null;};}function patchUpdates(_0x3034c1){return function(_0x544969){try{jsonpatch[_0x8405('0x1e')](_0x544969,_0x3034c1,!![]);}catch(_0x1f0179){return BPromise[_0x8405('0x1f')](_0x1f0179);}return _0x544969[_0x8405('0x20')]();};}function saveUpdates(_0x5cae44,_0x4c41d5){return function(_0x54ccf1){if(_0x54ccf1){return _0x54ccf1['update'](_0x5cae44)['then'](function(_0x5459db){return _0x5459db;});}return null;};}function removeEntity(_0x5e6e70,_0x38f002){return function(_0x4534a6){if(_0x4534a6){return _0x4534a6[_0x8405('0x21')]()[_0x8405('0x22')](function(){_0x5e6e70[_0x8405('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2189b9,_0x2fafbc){return function(_0x57573f){if(!_0x57573f){_0x2189b9['sendStatus'](0x194);}return _0x57573f;};}function handleError(_0xf5abec,_0x26bcb1){_0x26bcb1=_0x26bcb1||0x1f4;return function(_0x4f752){logger['error'](_0x4f752[_0x8405('0x23')]);if(_0x4f752[_0x8405('0x24')]){delete _0x4f752['name'];}_0xf5abec[_0x8405('0x18')](_0x26bcb1)[_0x8405('0x25')](_0x4f752);};}exports[_0x8405('0x26')]=function(_0x40ea21,_0x2e6dca){var _0x1f40c0={},_0x523853={},_0x2b33fb={'count':0x0,'rows':[]};var _0xe25269=db[_0x8405('0x27')]['rawAttributes'];_0x523853[_0x8405('0x28')]=_['keys'](_0xe25269);_0x523853[_0x8405('0x29')]=_['keys'](_0x40ea21[_0x8405('0x29')]);_0x523853[_0x8405('0x2a')]=_[_0x8405('0x2b')](_0x523853[_0x8405('0x28')],_0x523853['query']);_0x1f40c0['attributes']=_[_0x8405('0x2b')](_0x523853['model'],qs[_0x8405('0x2c')](_0x40ea21[_0x8405('0x29')][_0x8405('0x2c')]));_0x1f40c0[_0x8405('0x2d')]=_0x1f40c0[_0x8405('0x2d')][_0x8405('0x2e')]?_0x1f40c0['attributes']:_0x523853[_0x8405('0x28')];if(!_0x40ea21[_0x8405('0x29')][_0x8405('0x2f')]('nolimit')){_0x1f40c0[_0x8405('0x1b')]=qs[_0x8405('0x1b')](_0x40ea21[_0x8405('0x29')][_0x8405('0x1b')]);_0x1f40c0[_0x8405('0x30')]=qs['offset'](_0x40ea21[_0x8405('0x29')][_0x8405('0x30')]);}_0x1f40c0[_0x8405('0x31')]=qs[_0x8405('0x32')](_0x40ea21[_0x8405('0x29')][_0x8405('0x32')]);_0x1f40c0[_0x8405('0x33')]=qs[_0x8405('0x2a')](_[_0x8405('0x34')](_0x40ea21[_0x8405('0x29')],_0x523853[_0x8405('0x2a')]));if(_0x40ea21['query'][_0x8405('0x35')]){_0x1f40c0[_0x8405('0x33')]=_[_0x8405('0x36')](_0x1f40c0[_0x8405('0x33')],{'$or':_['map'](_0xe25269,function(_0xd830ad){if(_0xd830ad['type']['key']!==_0x8405('0x37')){var _0x579c09={};_0x579c09[_0xd830ad[_0x8405('0x38')]]={'$like':'%'+_0x40ea21[_0x8405('0x29')][_0x8405('0x35')]+'%'};return _0x579c09;}})});}_0x1f40c0=_[_0x8405('0x36')]({},_0x1f40c0,_0x40ea21[_0x8405('0x39')]);var _0x3581bf={'where':_0x1f40c0[_0x8405('0x33')]};return db[_0x8405('0x27')]['count'](_0x3581bf)[_0x8405('0x22')](function(_0x594c11){_0x2b33fb[_0x8405('0x1a')]=_0x594c11;if(_0x40ea21['query'][_0x8405('0x3a')]){_0x1f40c0[_0x8405('0x3b')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x8405('0x3c')](_0x1f40c0);})[_0x8405('0x22')](function(_0x1aa0fb){_0x2b33fb[_0x8405('0x3d')]=_0x1aa0fb;return _0x2b33fb;})[_0x8405('0x22')](respondWithFilteredResult(_0x2e6dca,_0x1f40c0))[_0x8405('0x3e')](handleError(_0x2e6dca,null));};exports[_0x8405('0x3f')]=function(_0xd616dc,_0x438682){var _0xa080b5={'raw':!![],'where':{'id':_0xd616dc[_0x8405('0x40')]['id']}},_0x4c3d38={};_0x4c3d38[_0x8405('0x28')]=_[_0x8405('0x41')](db[_0x8405('0x27')][_0x8405('0x42')]);_0x4c3d38[_0x8405('0x29')]=_[_0x8405('0x41')](_0xd616dc['query']);_0x4c3d38['filters']=_[_0x8405('0x2b')](_0x4c3d38['model'],_0x4c3d38[_0x8405('0x29')]);_0xa080b5[_0x8405('0x2d')]=_[_0x8405('0x2b')](_0x4c3d38[_0x8405('0x28')],qs[_0x8405('0x2c')](_0xd616dc[_0x8405('0x29')][_0x8405('0x2c')]));_0xa080b5[_0x8405('0x2d')]=_0xa080b5['attributes']['length']?_0xa080b5['attributes']:_0x4c3d38[_0x8405('0x28')];if(_0xd616dc[_0x8405('0x29')][_0x8405('0x3a')]){_0xa080b5[_0x8405('0x3b')]=[{'all':!![]}];}_0xa080b5=_[_0x8405('0x36')]({},_0xa080b5,_0xd616dc[_0x8405('0x39')]);return db[_0x8405('0x27')]['find'](_0xa080b5)[_0x8405('0x22')](handleEntityNotFound(_0x438682,null))[_0x8405('0x22')](respondWithResult(_0x438682,null))[_0x8405('0x3e')](handleError(_0x438682,null));};exports[_0x8405('0x43')]=function(_0x522da6,_0x456768){return db['OpenchannelQueueReport'][_0x8405('0x43')](_0x522da6[_0x8405('0x44')],{})[_0x8405('0x22')](respondWithResult(_0x456768,0xc9))[_0x8405('0x3e')](handleError(_0x456768,null));};exports[_0x8405('0x45')]=function(_0x2aba7b,_0x15ec83){if(_0x2aba7b[_0x8405('0x44')]['id']){delete _0x2aba7b[_0x8405('0x44')]['id'];}return db[_0x8405('0x27')]['find']({'where':{'id':_0x2aba7b['params']['id']}})['then'](handleEntityNotFound(_0x15ec83,null))[_0x8405('0x22')](saveUpdates(_0x2aba7b[_0x8405('0x44')],null))[_0x8405('0x22')](respondWithResult(_0x15ec83,null))[_0x8405('0x3e')](handleError(_0x15ec83,null));};exports[_0x8405('0x21')]=function(_0x256239,_0x34f787){return db[_0x8405('0x27')][_0x8405('0x46')]({'where':{'id':_0x256239[_0x8405('0x40')]['id']}})[_0x8405('0x22')](handleEntityNotFound(_0x34f787,null))[_0x8405('0x22')](removeEntity(_0x34f787,null))['catch'](handleError(_0x34f787,null));};exports[_0x8405('0x47')]=function(_0x506dfc,_0x114243){return db[_0x8405('0x27')]['describe']()[_0x8405('0x22')](respondWithResult(_0x114243,null))[_0x8405('0x3e')](handleError(_0x114243,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 69e280d..a1a2480 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 _0x524a=['./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x312113,_0x15d9fa){var _0x21d246=function(_0x26b6ba){while(--_0x26b6ba){_0x312113['push'](_0x312113['shift']());}};_0x21d246(++_0x15d9fa);}(_0x524a,0xf5));var _0xa524=function(_0x2f6025,_0x2e06b8){_0x2f6025=_0x2f6025-0x0;var _0x45865c=_0x524a[_0x2f6025];return _0x45865c;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require('moment');var BPromise=require(_0xa524('0x4'));var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa524('0x7'));module[_0xa524('0x8')]=function(_0x16227b,_0x5f472f){return _0x16227b[_0xa524('0x9')]('OpenchannelQueueReport',attributes,{'tableName':_0xa524('0xa'),'paranoid':![],'indexes':[{'name':_0xa524('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x04de=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x04de,0x107));var _0xe04d=function(_0x4d5b36,_0x70b93){_0x4d5b36=_0x4d5b36-0x0;var _0xae7ebb=_0x04de[_0x4d5b36];return _0xae7ebb;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[{'name':_0xe04d('0xd'),'fields':[_0xe04d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 321cdda..136a2c6 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 _0x6d20=['OpenchannelQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateOpenchannelQueueReport','body','options','raw','then','UpdateOpenchannelQueueReport'];(function(_0x4c7061,_0x4a232c){var _0x1a119d=function(_0x476f7a){while(--_0x476f7a){_0x4c7061['push'](_0x4c7061['shift']());}};_0x1a119d(++_0x4a232c);}(_0x6d20,0x164));var _0x06d2=function(_0x3a5df2,_0x2b5517){_0x3a5df2=_0x3a5df2-0x0;var _0x3a65b6=_0x6d20[_0x3a5df2];return _0x3a65b6;};'use strict';var _=require(_0x06d2('0x0'));var util=require('util');var moment=require(_0x06d2('0x1'));var BPromise=require(_0x06d2('0x2'));var rs=require(_0x06d2('0x3'));var fs=require('fs');var Redis=require(_0x06d2('0x4'));var db=require(_0x06d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x06d2('0x6'));var config=require(_0x06d2('0x7'));var jayson=require(_0x06d2('0x8'));var client=jayson[_0x06d2('0x9')][_0x06d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5418f3,_0x2fc61e,_0x4be363){return new BPromise(function(_0x49547c,_0xd1f0e7){return client[_0x06d2('0xb')](_0x5418f3,_0x4be363)['then'](function(_0x58599b){logger[_0x06d2('0xc')](_0x06d2('0xd'),_0x2fc61e,'request\x20sent');logger[_0x06d2('0xe')](_0x06d2('0xf'),_0x2fc61e,_0x06d2('0x10'),JSON[_0x06d2('0x11')](_0x58599b));if(_0x58599b['error']){if(_0x58599b[_0x06d2('0x12')][_0x06d2('0x13')]===0x1f4){logger['error'](_0x06d2('0xd'),_0x2fc61e,_0x58599b['error'][_0x06d2('0x14')]);return _0xd1f0e7(_0x58599b['error'][_0x06d2('0x14')]);}logger[_0x06d2('0x12')](_0x06d2('0xd'),_0x2fc61e,_0x58599b[_0x06d2('0x12')]['message']);return _0x49547c(_0x58599b[_0x06d2('0x12')][_0x06d2('0x14')]);}else{logger[_0x06d2('0xc')](_0x06d2('0xd'),_0x2fc61e,_0x06d2('0x10'));_0x49547c(_0x58599b['result'][_0x06d2('0x14')]);}})[_0x06d2('0x15')](function(_0x5b5a0d){logger['error'](_0x06d2('0xd'),_0x2fc61e,_0x5b5a0d);_0xd1f0e7(_0x5b5a0d);});});}exports[_0x06d2('0x16')]=function(_0x210954){var _0x364b37=this;return new Promise(function(_0x8db351,_0x439b04){return db['OpenchannelQueueReport']['create'](_0x210954[_0x06d2('0x17')],{'raw':_0x210954[_0x06d2('0x18')]?_0x210954['options'][_0x06d2('0x19')]===undefined?!![]:![]:!![]})[_0x06d2('0x1a')](function(_0x1791b7){logger['info'](_0x06d2('0x16'),_0x210954);logger['debug']('CreateOpenchannelQueueReport',_0x210954,JSON[_0x06d2('0x11')](_0x1791b7));_0x8db351(_0x1791b7);})[_0x06d2('0x15')](function(_0x5eb0ca){logger['error'](_0x06d2('0x16'),_0x5eb0ca[_0x06d2('0x14')],_0x210954);_0x439b04(_0x364b37[_0x06d2('0x12')](0x1f4,_0x5eb0ca['message']));});});};exports[_0x06d2('0x1b')]=function(_0x3c7826){var _0x441972=this;return new Promise(function(_0xf87b37,_0x481711){return db[_0x06d2('0x1c')][_0x06d2('0x1d')](_0x3c7826[_0x06d2('0x17')],{'raw':_0x3c7826[_0x06d2('0x18')]?_0x3c7826[_0x06d2('0x18')][_0x06d2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c7826[_0x06d2('0x18')]?_0x3c7826[_0x06d2('0x18')][_0x06d2('0x1e')]||null:null,'attributes':_0x3c7826[_0x06d2('0x18')]?_0x3c7826[_0x06d2('0x18')]['attributes']||null:null,'limit':_0x3c7826['options']?_0x3c7826['options'][_0x06d2('0x1f')]||null:null})[_0x06d2('0x1a')](function(_0x754803){logger['info']('UpdateOpenchannelQueueReport',_0x3c7826);logger[_0x06d2('0xe')](_0x06d2('0x1b'),_0x3c7826,JSON[_0x06d2('0x11')](_0x754803));_0xf87b37(_0x754803);})[_0x06d2('0x15')](function(_0x252004){logger[_0x06d2('0x12')](_0x06d2('0x1b'),_0x252004[_0x06d2('0x14')],_0x3c7826);_0x481711(_0x441972['error'](0x1f4,_0x252004[_0x06d2('0x14')]));});});}; \ No newline at end of file +var _0x02eb=['info','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','create','options','raw','debug','OpenchannelQueueReport','update','body','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then'];(function(_0x481c5e,_0x5f03bf){var _0x2d3ea0=function(_0x11cf2b){while(--_0x11cf2b){_0x481c5e['push'](_0x481c5e['shift']());}};_0x2d3ea0(++_0x5f03bf);}(_0x02eb,0x1c2));var _0xb02e=function(_0x41337f,_0x5e8443){_0x41337f=_0x41337f-0x0;var _0x417d2a=_0x02eb[_0x41337f];return _0x417d2a;};'use strict';var _=require(_0xb02e('0x0'));var util=require(_0xb02e('0x1'));var moment=require(_0xb02e('0x2'));var BPromise=require(_0xb02e('0x3'));var rs=require(_0xb02e('0x4'));var fs=require('fs');var Redis=require(_0xb02e('0x5'));var db=require(_0xb02e('0x6'))['db'];var utils=require(_0xb02e('0x7'));var logger=require(_0xb02e('0x8'))(_0xb02e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb02e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5996e6,_0x468fcb,_0x258dc3){return new BPromise(function(_0x30b6d6,_0x3a663d){return client['request'](_0x5996e6,_0x258dc3)[_0xb02e('0xb')](function(_0x5529ed){logger[_0xb02e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x468fcb,'request\x20sent');logger['debug'](_0xb02e('0xd'),_0x468fcb,'request\x20sent',JSON[_0xb02e('0xe')](_0x5529ed));if(_0x5529ed[_0xb02e('0xf')]){if(_0x5529ed[_0xb02e('0xf')]['code']===0x1f4){logger[_0xb02e('0xf')](_0xb02e('0x10'),_0x468fcb,_0x5529ed[_0xb02e('0xf')][_0xb02e('0x11')]);return _0x3a663d(_0x5529ed['error'][_0xb02e('0x11')]);}logger[_0xb02e('0xf')](_0xb02e('0x10'),_0x468fcb,_0x5529ed[_0xb02e('0xf')]['message']);return _0x30b6d6(_0x5529ed['error'][_0xb02e('0x11')]);}else{logger[_0xb02e('0xc')](_0xb02e('0x10'),_0x468fcb,_0xb02e('0x12'));_0x30b6d6(_0x5529ed[_0xb02e('0x13')]['message']);}})[_0xb02e('0x14')](function(_0x3c17fb){logger['error'](_0xb02e('0x10'),_0x468fcb,_0x3c17fb);_0x3a663d(_0x3c17fb);});});}exports[_0xb02e('0x15')]=function(_0x3f0122){var _0x59264b=this;return new Promise(function(_0x1d5cca,_0x1090d4){return db['OpenchannelQueueReport'][_0xb02e('0x16')](_0x3f0122['body'],{'raw':_0x3f0122[_0xb02e('0x17')]?_0x3f0122[_0xb02e('0x17')][_0xb02e('0x18')]===undefined?!![]:![]:!![]})[_0xb02e('0xb')](function(_0x42fc58){logger[_0xb02e('0xc')](_0xb02e('0x15'),_0x3f0122);logger[_0xb02e('0x19')]('CreateOpenchannelQueueReport',_0x3f0122,JSON[_0xb02e('0xe')](_0x42fc58));_0x1d5cca(_0x42fc58);})[_0xb02e('0x14')](function(_0x3ae1f6){logger[_0xb02e('0xf')](_0xb02e('0x15'),_0x3ae1f6[_0xb02e('0x11')],_0x3f0122);_0x1090d4(_0x59264b[_0xb02e('0xf')](0x1f4,_0x3ae1f6[_0xb02e('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x418bc0){var _0x8cf0e3=this;return new Promise(function(_0x261b2b,_0x2cdd53){return db[_0xb02e('0x1a')][_0xb02e('0x1b')](_0x418bc0[_0xb02e('0x1c')],{'raw':_0x418bc0[_0xb02e('0x17')]?_0x418bc0['options'][_0xb02e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x418bc0['options']?_0x418bc0[_0xb02e('0x17')][_0xb02e('0x1d')]||null:null,'attributes':_0x418bc0['options']?_0x418bc0['options'][_0xb02e('0x1e')]||null:null,'limit':_0x418bc0[_0xb02e('0x17')]?_0x418bc0[_0xb02e('0x17')][_0xb02e('0x1f')]||null:null})['then'](function(_0x434d32){logger[_0xb02e('0xc')]('UpdateOpenchannelQueueReport',_0x418bc0);logger[_0xb02e('0x19')](_0xb02e('0x20'),_0x418bc0,JSON['stringify'](_0x434d32));_0x261b2b(_0x434d32);})[_0xb02e('0x14')](function(_0x5092c1){logger[_0xb02e('0xf')]('UpdateOpenchannelQueueReport',_0x5092c1[_0xb02e('0x11')],_0x418bc0);_0x2cdd53(_0x8cf0e3['error'](0x1f4,_0x5092c1['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index b397848..9597c33 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 _0x23d1=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x23d1,0x1e7));var _0x123d=function(_0x48b068,_0x57fd5f){_0x48b068=_0x48b068-0x0;var _0xe90c67=_0x23d1[_0x48b068];return _0xe90c67;};'use strict';var multer=require(_0x123d('0x0'));var util=require(_0x123d('0x1'));var path=require(_0x123d('0x2'));var timeout=require(_0x123d('0x3'));var express=require(_0x123d('0x4'));var router=express[_0x123d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x123d('0x6'));var config=require(_0x123d('0x7'));var controller=require(_0x123d('0x8'));router[_0x123d('0x9')]('/',auth[_0x123d('0xa')](),controller[_0x123d('0xb')]);router['get'](_0x123d('0xc'),auth[_0x123d('0xa')](),controller[_0x123d('0xd')]);router[_0x123d('0x9')](_0x123d('0xe'),auth['isAuthenticated'](),controller[_0x123d('0xf')]);router[_0x123d('0x10')]('/',auth[_0x123d('0xa')](),controller[_0x123d('0x11')]);router[_0x123d('0x12')](_0x123d('0xe'),auth['isAuthenticated'](),controller[_0x123d('0x13')]);router[_0x123d('0x14')]('/:id',auth[_0x123d('0xa')](),controller[_0x123d('0x15')]);module[_0x123d('0x16')]=router; \ No newline at end of file +var _0x9186=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x25ebe0,_0x1baacd){var _0x11187f=function(_0x576adb){while(--_0x576adb){_0x25ebe0['push'](_0x25ebe0['shift']());}};_0x11187f(++_0x1baacd);}(_0x9186,0x104));var _0x6918=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x9186[_0x4c4042];return _0xbd10dc;};'use strict';var multer=require(_0x6918('0x0'));var util=require(_0x6918('0x1'));var path=require(_0x6918('0x2'));var timeout=require(_0x6918('0x3'));var express=require('express');var router=express[_0x6918('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6918('0x5'));var config=require(_0x6918('0x6'));var controller=require(_0x6918('0x7'));router[_0x6918('0x8')]('/',auth[_0x6918('0x9')](),controller['index']);router[_0x6918('0x8')](_0x6918('0xa'),auth[_0x6918('0x9')](),controller[_0x6918('0xb')]);router['get']('/:id',auth[_0x6918('0x9')](),controller['show']);router[_0x6918('0xc')]('/',auth[_0x6918('0x9')](),controller['create']);router[_0x6918('0xd')]('/:id',auth[_0x6918('0x9')](),controller[_0x6918('0xe')]);router[_0x6918('0xf')](_0x6918('0x10'),auth[_0x6918('0x9')](),controller[_0x6918('0x11')]);module[_0x6918('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e122d20..234fb77 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 _0xb1ee=['queue','DATE','moment','sequelize','STRING','ENUM','account'];(function(_0x157120,_0x2189a6){var _0x57271f=function(_0xabc724){while(--_0xabc724){_0x157120['push'](_0x157120['shift']());}};_0x57271f(++_0x2189a6);}(_0xb1ee,0x11a));var _0xeb1e=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xb1ee[_0x13ac10];return _0x28eda2;};'use strict';var moment=require(_0xeb1e('0x0'));var Sequelize=require(_0xeb1e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xeb1e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeb1e('0x3')](_0xeb1e('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xeb1e('0x5')},'transferredAt':{'type':Sequelize[_0xeb1e('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x1719=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x1719,0xa5));var _0x9171=function(_0x4ff9a4,_0x2aa950){_0x4ff9a4=_0x4ff9a4-0x0;var _0x1619bc=_0x1719[_0x4ff9a4];return _0x1619bc;};'use strict';var moment=require('moment');var Sequelize=require(_0x9171('0x0'));module[_0x9171('0x1')]={'uniqueid':{'type':Sequelize[_0x9171('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9171('0x3')](_0x9171('0x4'),_0x9171('0x5'),'queue'),'allowNull':![],'defaultValue':_0x9171('0x6')},'transferredAt':{'type':Sequelize[_0x9171('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x9171('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 7442428..1f7f7fb 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 _0xda67=['stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','map','key','field','options','includeAll','findAll','catch','show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0xda67,0xb1));var _0x7da6=function(_0x36c5b7,_0x4a8b1b){_0x36c5b7=_0x36c5b7-0x0;var _0x4736b0=_0xda67[_0x36c5b7];return _0x4736b0;};'use strict';var pdf=require(_0x7da6('0x0'));var emlformat=require(_0x7da6('0x1'));var rimraf=require(_0x7da6('0x2'));var zipdir=require(_0x7da6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7da6('0x4'));var moment=require(_0x7da6('0x5'));var BPromise=require(_0x7da6('0x6'));var Mustache=require(_0x7da6('0x7'));var util=require(_0x7da6('0x8'));var path=require(_0x7da6('0x9'));var sox=require(_0x7da6('0xa'));var csv=require(_0x7da6('0xb'));var ejs=require(_0x7da6('0xc'));var fs=require('fs');var _=require(_0x7da6('0xd'));var squel=require(_0x7da6('0xe'));var crypto=require('crypto');var jsforce=require(_0x7da6('0xf'));var deskjs=require(_0x7da6('0x10'));var toCsv=require(_0x7da6('0xb'));var querystring=require('querystring');var Papa=require(_0x7da6('0x11'));var Redis=require(_0x7da6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7da6('0x13'));var hardwareService=require(_0x7da6('0x14'));var logger=require('../../config/logger')(_0x7da6('0x15'));var utils=require('../../config/utils');var config=require(_0x7da6('0x16'));var db=require(_0x7da6('0x17'))['db'];function respondWithStatusCode(_0x12824c,_0x3f7150){_0x3f7150=_0x3f7150||0xcc;return function(_0x2310f0){if(_0x2310f0){return _0x12824c[_0x7da6('0x18')](_0x3f7150);}return _0x12824c['status'](_0x3f7150)[_0x7da6('0x19')]();};}function respondWithResult(_0x312777,_0x2d67d1){_0x2d67d1=_0x2d67d1||0xc8;return function(_0x2a13b2){if(_0x2a13b2){return _0x312777[_0x7da6('0x1a')](_0x2d67d1)[_0x7da6('0x1b')](_0x2a13b2);}};}function respondWithFilteredResult(_0x4f048e,_0x55279d){return function(_0x29ef4a){if(_0x29ef4a){var _0x21d5e8=_0x29ef4a[_0x7da6('0x1c')],_0x271be9=_0x55279d[_0x7da6('0x1d')],_0x101e99=_0x55279d[_0x7da6('0x1d')]+_0x55279d[_0x7da6('0x1e')],_0x57c552;if(_0x101e99>=_0x21d5e8){_0x101e99=_0x21d5e8;_0x57c552=0xc8;}else{_0x57c552=0xce;}_0x4f048e[_0x7da6('0x1a')](_0x57c552);return _0x4f048e[_0x7da6('0x1f')](_0x7da6('0x20'),_0x271be9+'-'+_0x101e99+'/'+_0x21d5e8)[_0x7da6('0x1b')](_0x29ef4a);}return null;};}function patchUpdates(_0x280402){return function(_0x266085){try{jsonpatch[_0x7da6('0x21')](_0x266085,_0x280402,!![]);}catch(_0x4037a3){return BPromise[_0x7da6('0x22')](_0x4037a3);}return _0x266085[_0x7da6('0x23')]();};}function saveUpdates(_0x276a3a,_0x3ff057){return function(_0x487c1a){if(_0x487c1a){return _0x487c1a[_0x7da6('0x24')](_0x276a3a)[_0x7da6('0x25')](function(_0x417e6c){return _0x417e6c;});}return null;};}function removeEntity(_0x4344b4,_0x3224b1){return function(_0x300f78){if(_0x300f78){return _0x300f78[_0x7da6('0x26')]()['then'](function(){_0x4344b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x400b16,_0x415d89){return function(_0x593032){if(!_0x593032){_0x400b16['sendStatus'](0x194);}return _0x593032;};}function handleError(_0x305315,_0x47b3a9){_0x47b3a9=_0x47b3a9||0x1f4;return function(_0x345c0c){logger['error'](_0x345c0c[_0x7da6('0x27')]);if(_0x345c0c['name']){delete _0x345c0c[_0x7da6('0x28')];}_0x305315['status'](_0x47b3a9)[_0x7da6('0x29')](_0x345c0c);};}exports[_0x7da6('0x2a')]=function(_0x27a21e,_0x197997){var _0x506c1f={},_0x5ee33b={},_0x2455a2={'count':0x0,'rows':[]};var _0x15882d=db[_0x7da6('0x2b')][_0x7da6('0x2c')];_0x5ee33b[_0x7da6('0x2d')]=_[_0x7da6('0x2e')](_0x15882d);_0x5ee33b[_0x7da6('0x2f')]=_[_0x7da6('0x2e')](_0x27a21e[_0x7da6('0x2f')]);_0x5ee33b[_0x7da6('0x30')]=_[_0x7da6('0x31')](_0x5ee33b['model'],_0x5ee33b[_0x7da6('0x2f')]);_0x506c1f[_0x7da6('0x32')]=_[_0x7da6('0x31')](_0x5ee33b[_0x7da6('0x2d')],qs[_0x7da6('0x33')](_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x33')]));_0x506c1f[_0x7da6('0x32')]=_0x506c1f[_0x7da6('0x32')][_0x7da6('0x34')]?_0x506c1f[_0x7da6('0x32')]:_0x5ee33b[_0x7da6('0x2d')];if(!_0x27a21e[_0x7da6('0x2f')]['hasOwnProperty']('nolimit')){_0x506c1f[_0x7da6('0x1e')]=qs[_0x7da6('0x1e')](_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x1e')]);_0x506c1f[_0x7da6('0x1d')]=qs[_0x7da6('0x1d')](_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x1d')]);}_0x506c1f['order']=qs[_0x7da6('0x35')](_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x35')]);_0x506c1f[_0x7da6('0x36')]=qs['filters'](_[_0x7da6('0x37')](_0x27a21e['query'],_0x5ee33b['filters']));if(_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x38')]){_0x506c1f[_0x7da6('0x36')]=_[_0x7da6('0x39')](_0x506c1f[_0x7da6('0x36')],{'$or':_[_0x7da6('0x3a')](_0x15882d,function(_0x4b1fc3){if(_0x4b1fc3['type'][_0x7da6('0x3b')]!=='VIRTUAL'){var _0x1d544b={};_0x1d544b[_0x4b1fc3[_0x7da6('0x3c')]]={'$like':'%'+_0x27a21e['query'][_0x7da6('0x38')]+'%'};return _0x1d544b;}})});}_0x506c1f=_[_0x7da6('0x39')]({},_0x506c1f,_0x27a21e[_0x7da6('0x3d')]);var _0x3d81e0={'where':_0x506c1f[_0x7da6('0x36')]};return db[_0x7da6('0x2b')][_0x7da6('0x1c')](_0x3d81e0)[_0x7da6('0x25')](function(_0x4cbf23){_0x2455a2[_0x7da6('0x1c')]=_0x4cbf23;if(_0x27a21e[_0x7da6('0x2f')][_0x7da6('0x3e')]){_0x506c1f['include']=[{'all':!![]}];}return db[_0x7da6('0x2b')][_0x7da6('0x3f')](_0x506c1f);})[_0x7da6('0x25')](function(_0x2bddb2){_0x2455a2['rows']=_0x2bddb2;return _0x2455a2;})[_0x7da6('0x25')](respondWithFilteredResult(_0x197997,_0x506c1f))[_0x7da6('0x40')](handleError(_0x197997,null));};exports[_0x7da6('0x41')]=function(_0xc0054d,_0x1985de){var _0x56047c={'raw':!![],'where':{'id':_0xc0054d['params']['id']}},_0x2b6a0a={};_0x2b6a0a[_0x7da6('0x2d')]=_['keys'](db[_0x7da6('0x2b')]['rawAttributes']);_0x2b6a0a['query']=_[_0x7da6('0x2e')](_0xc0054d[_0x7da6('0x2f')]);_0x2b6a0a[_0x7da6('0x30')]=_[_0x7da6('0x31')](_0x2b6a0a[_0x7da6('0x2d')],_0x2b6a0a['query']);_0x56047c[_0x7da6('0x32')]=_['intersection'](_0x2b6a0a[_0x7da6('0x2d')],qs[_0x7da6('0x33')](_0xc0054d[_0x7da6('0x2f')][_0x7da6('0x33')]));_0x56047c[_0x7da6('0x32')]=_0x56047c[_0x7da6('0x32')]['length']?_0x56047c[_0x7da6('0x32')]:_0x2b6a0a[_0x7da6('0x2d')];if(_0xc0054d[_0x7da6('0x2f')][_0x7da6('0x3e')]){_0x56047c[_0x7da6('0x42')]=[{'all':!![]}];}_0x56047c=_['merge']({},_0x56047c,_0xc0054d[_0x7da6('0x3d')]);return db['OpenchannelTransferReport'][_0x7da6('0x43')](_0x56047c)[_0x7da6('0x25')](handleEntityNotFound(_0x1985de,null))[_0x7da6('0x25')](respondWithResult(_0x1985de,null))['catch'](handleError(_0x1985de,null));};exports[_0x7da6('0x44')]=function(_0x58fffd,_0x16f610){return db[_0x7da6('0x2b')][_0x7da6('0x44')](_0x58fffd[_0x7da6('0x45')],{})[_0x7da6('0x25')](respondWithResult(_0x16f610,0xc9))[_0x7da6('0x40')](handleError(_0x16f610,null));};exports[_0x7da6('0x24')]=function(_0x1ce4c5,_0x1f612c){if(_0x1ce4c5[_0x7da6('0x45')]['id']){delete _0x1ce4c5['body']['id'];}return db[_0x7da6('0x2b')]['find']({'where':{'id':_0x1ce4c5[_0x7da6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f612c,null))[_0x7da6('0x25')](saveUpdates(_0x1ce4c5[_0x7da6('0x45')],null))['then'](respondWithResult(_0x1f612c,null))[_0x7da6('0x40')](handleError(_0x1f612c,null));};exports[_0x7da6('0x26')]=function(_0x23d898,_0x2ca308){return db[_0x7da6('0x2b')][_0x7da6('0x43')]({'where':{'id':_0x23d898['params']['id']}})[_0x7da6('0x25')](handleEntityNotFound(_0x2ca308,null))[_0x7da6('0x25')](removeEntity(_0x2ca308,null))[_0x7da6('0x40')](handleError(_0x2ca308,null));};exports[_0x7da6('0x47')]=function(_0x5953ae,_0x1fa572){return db[_0x7da6('0x2b')][_0x7da6('0x47')]()[_0x7da6('0x25')](respondWithResult(_0x1fa572,null))[_0x7da6('0x40')](handleError(_0x1fa572,null));}; \ No newline at end of file +var _0xe3ac=['status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','OpenchannelTransferReport','model','keys','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','filters','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xe3ac,0x116));var _0xce3a=function(_0x4f32e2,_0x3efdf3){_0x4f32e2=_0x4f32e2-0x0;var _0x39564e=_0xe3ac[_0x4f32e2];return _0x39564e;};'use strict';var pdf=require(_0xce3a('0x0'));var emlformat=require(_0xce3a('0x1'));var rimraf=require(_0xce3a('0x2'));var zipdir=require(_0xce3a('0x3'));var jsonpatch=require(_0xce3a('0x4'));var rp=require(_0xce3a('0x5'));var moment=require(_0xce3a('0x6'));var BPromise=require(_0xce3a('0x7'));var Mustache=require(_0xce3a('0x8'));var util=require(_0xce3a('0x9'));var path=require(_0xce3a('0xa'));var sox=require(_0xce3a('0xb'));var csv=require('to-csv');var ejs=require(_0xce3a('0xc'));var fs=require('fs');var _=require(_0xce3a('0xd'));var squel=require(_0xce3a('0xe'));var crypto=require(_0xce3a('0xf'));var jsforce=require(_0xce3a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xce3a('0x11'));var querystring=require(_0xce3a('0x12'));var Papa=require('papaparse');var Redis=require(_0xce3a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xce3a('0x14'));var hardwareService=require(_0xce3a('0x15'));var logger=require(_0xce3a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xce3a('0x17'));var db=require(_0xce3a('0x18'))['db'];function respondWithStatusCode(_0x37a12c,_0x4a3bb9){_0x4a3bb9=_0x4a3bb9||0xcc;return function(_0x37d9e2){if(_0x37d9e2){return _0x37a12c[_0xce3a('0x19')](_0x4a3bb9);}return _0x37a12c[_0xce3a('0x1a')](_0x4a3bb9)['end']();};}function respondWithResult(_0x23b7ab,_0x3b6363){_0x3b6363=_0x3b6363||0xc8;return function(_0xb50a8c){if(_0xb50a8c){return _0x23b7ab['status'](_0x3b6363)[_0xce3a('0x1b')](_0xb50a8c);}};}function respondWithFilteredResult(_0x4f0c0f,_0x2deca5){return function(_0x366e17){if(_0x366e17){var _0x31ce4=_0x366e17[_0xce3a('0x1c')],_0x232bea=_0x2deca5[_0xce3a('0x1d')],_0x3bf0f3=_0x2deca5[_0xce3a('0x1d')]+_0x2deca5[_0xce3a('0x1e')],_0x350961;if(_0x3bf0f3>=_0x31ce4){_0x3bf0f3=_0x31ce4;_0x350961=0xc8;}else{_0x350961=0xce;}_0x4f0c0f[_0xce3a('0x1a')](_0x350961);return _0x4f0c0f[_0xce3a('0x1f')](_0xce3a('0x20'),_0x232bea+'-'+_0x3bf0f3+'/'+_0x31ce4)[_0xce3a('0x1b')](_0x366e17);}return null;};}function patchUpdates(_0x276bcc){return function(_0x3df83c){try{jsonpatch[_0xce3a('0x21')](_0x3df83c,_0x276bcc,!![]);}catch(_0x3fcca2){return BPromise['reject'](_0x3fcca2);}return _0x3df83c[_0xce3a('0x22')]();};}function saveUpdates(_0x32aedd,_0x20de1b){return function(_0x27a46b){if(_0x27a46b){return _0x27a46b[_0xce3a('0x23')](_0x32aedd)[_0xce3a('0x24')](function(_0x23c712){return _0x23c712;});}return null;};}function removeEntity(_0x49962e,_0x2637e7){return function(_0x184b65){if(_0x184b65){return _0x184b65[_0xce3a('0x25')]()['then'](function(){_0x49962e[_0xce3a('0x1a')](0xcc)[_0xce3a('0x26')]();});}};}function handleEntityNotFound(_0x3d36fb,_0x1ed13b){return function(_0x122260){if(!_0x122260){_0x3d36fb[_0xce3a('0x19')](0x194);}return _0x122260;};}function handleError(_0x3c7245,_0x28d534){_0x28d534=_0x28d534||0x1f4;return function(_0x381f0b){logger[_0xce3a('0x27')](_0x381f0b[_0xce3a('0x28')]);if(_0x381f0b[_0xce3a('0x29')]){delete _0x381f0b[_0xce3a('0x29')];}_0x3c7245[_0xce3a('0x1a')](_0x28d534)[_0xce3a('0x2a')](_0x381f0b);};}exports[_0xce3a('0x2b')]=function(_0x37deb1,_0x193026){var _0x86eb7a={},_0x4705e5={},_0x706f9f={'count':0x0,'rows':[]};var _0x42cba0=db[_0xce3a('0x2c')]['rawAttributes'];_0x4705e5[_0xce3a('0x2d')]=_[_0xce3a('0x2e')](_0x42cba0);_0x4705e5['query']=_[_0xce3a('0x2e')](_0x37deb1['query']);_0x4705e5['filters']=_[_0xce3a('0x2f')](_0x4705e5[_0xce3a('0x2d')],_0x4705e5['query']);_0x86eb7a[_0xce3a('0x30')]=_[_0xce3a('0x2f')](_0x4705e5[_0xce3a('0x2d')],qs[_0xce3a('0x31')](_0x37deb1[_0xce3a('0x32')]['fields']));_0x86eb7a[_0xce3a('0x30')]=_0x86eb7a['attributes'][_0xce3a('0x33')]?_0x86eb7a['attributes']:_0x4705e5[_0xce3a('0x2d')];if(!_0x37deb1[_0xce3a('0x32')]['hasOwnProperty'](_0xce3a('0x34'))){_0x86eb7a['limit']=qs['limit'](_0x37deb1[_0xce3a('0x32')][_0xce3a('0x1e')]);_0x86eb7a['offset']=qs[_0xce3a('0x1d')](_0x37deb1[_0xce3a('0x32')][_0xce3a('0x1d')]);}_0x86eb7a[_0xce3a('0x35')]=qs[_0xce3a('0x36')](_0x37deb1[_0xce3a('0x32')]['sort']);_0x86eb7a[_0xce3a('0x37')]=qs['filters'](_[_0xce3a('0x38')](_0x37deb1['query'],_0x4705e5['filters']));if(_0x37deb1[_0xce3a('0x32')][_0xce3a('0x39')]){_0x86eb7a['where']=_[_0xce3a('0x3a')](_0x86eb7a[_0xce3a('0x37')],{'$or':_[_0xce3a('0x3b')](_0x42cba0,function(_0x344788){if(_0x344788[_0xce3a('0x3c')][_0xce3a('0x3d')]!==_0xce3a('0x3e')){var _0xa72b85={};_0xa72b85[_0x344788['field']]={'$like':'%'+_0x37deb1[_0xce3a('0x32')][_0xce3a('0x39')]+'%'};return _0xa72b85;}})});}_0x86eb7a=_['merge']({},_0x86eb7a,_0x37deb1['options']);var _0x5659cc={'where':_0x86eb7a[_0xce3a('0x37')]};return db[_0xce3a('0x2c')][_0xce3a('0x1c')](_0x5659cc)[_0xce3a('0x24')](function(_0x1e1df2){_0x706f9f['count']=_0x1e1df2;if(_0x37deb1['query'][_0xce3a('0x3f')]){_0x86eb7a[_0xce3a('0x40')]=[{'all':!![]}];}return db[_0xce3a('0x2c')][_0xce3a('0x41')](_0x86eb7a);})[_0xce3a('0x24')](function(_0x5687e0){_0x706f9f[_0xce3a('0x42')]=_0x5687e0;return _0x706f9f;})[_0xce3a('0x24')](respondWithFilteredResult(_0x193026,_0x86eb7a))[_0xce3a('0x43')](handleError(_0x193026,null));};exports[_0xce3a('0x44')]=function(_0x15e1a5,_0x4dc698){var _0x53fe7d={'raw':!![],'where':{'id':_0x15e1a5[_0xce3a('0x45')]['id']}},_0x26331c={};_0x26331c[_0xce3a('0x2d')]=_[_0xce3a('0x2e')](db[_0xce3a('0x2c')]['rawAttributes']);_0x26331c['query']=_[_0xce3a('0x2e')](_0x15e1a5[_0xce3a('0x32')]);_0x26331c[_0xce3a('0x46')]=_['intersection'](_0x26331c[_0xce3a('0x2d')],_0x26331c[_0xce3a('0x32')]);_0x53fe7d['attributes']=_[_0xce3a('0x2f')](_0x26331c[_0xce3a('0x2d')],qs[_0xce3a('0x31')](_0x15e1a5[_0xce3a('0x32')]['fields']));_0x53fe7d['attributes']=_0x53fe7d[_0xce3a('0x30')][_0xce3a('0x33')]?_0x53fe7d[_0xce3a('0x30')]:_0x26331c[_0xce3a('0x2d')];if(_0x15e1a5['query']['includeAll']){_0x53fe7d[_0xce3a('0x40')]=[{'all':!![]}];}_0x53fe7d=_[_0xce3a('0x3a')]({},_0x53fe7d,_0x15e1a5[_0xce3a('0x47')]);return db[_0xce3a('0x2c')][_0xce3a('0x48')](_0x53fe7d)[_0xce3a('0x24')](handleEntityNotFound(_0x4dc698,null))['then'](respondWithResult(_0x4dc698,null))['catch'](handleError(_0x4dc698,null));};exports[_0xce3a('0x49')]=function(_0x450816,_0x440fd3){return db[_0xce3a('0x2c')][_0xce3a('0x49')](_0x450816[_0xce3a('0x4a')],{})[_0xce3a('0x24')](respondWithResult(_0x440fd3,0xc9))[_0xce3a('0x43')](handleError(_0x440fd3,null));};exports['update']=function(_0x5b9386,_0x18350e){if(_0x5b9386['body']['id']){delete _0x5b9386[_0xce3a('0x4a')]['id'];}return db[_0xce3a('0x2c')][_0xce3a('0x48')]({'where':{'id':_0x5b9386[_0xce3a('0x45')]['id']}})[_0xce3a('0x24')](handleEntityNotFound(_0x18350e,null))['then'](saveUpdates(_0x5b9386[_0xce3a('0x4a')],null))['then'](respondWithResult(_0x18350e,null))['catch'](handleError(_0x18350e,null));};exports['destroy']=function(_0x1a7e95,_0x31c8c4){return db[_0xce3a('0x2c')][_0xce3a('0x48')]({'where':{'id':_0x1a7e95[_0xce3a('0x45')]['id']}})[_0xce3a('0x24')](handleEntityNotFound(_0x31c8c4,null))[_0xce3a('0x24')](removeEntity(_0x31c8c4,null))[_0xce3a('0x43')](handleError(_0x31c8c4,null));};exports[_0xce3a('0x4b')]=function(_0x4b808c,_0x197111){return db[_0xce3a('0x2c')][_0xce3a('0x4b')]()[_0xce3a('0x24')](respondWithResult(_0x197111,null))[_0xce3a('0x43')](handleError(_0x197111,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f2cdb08..105e2fd 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 _0x6970=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x6970,0xc3));var _0x0697=function(_0x54fef2,_0x515370){_0x54fef2=_0x54fef2-0x0;var _0x4270dd=_0x6970[_0x54fef2];return _0x4270dd;};'use strict';var _=require(_0x0697('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0697('0x1'));var moment=require(_0x0697('0x2'));var BPromise=require(_0x0697('0x3'));var rp=require(_0x0697('0x4'));var fs=require('fs');var path=require(_0x0697('0x5'));var rimraf=require(_0x0697('0x6'));var config=require(_0x0697('0x7'));var attributes=require(_0x0697('0x8'));module[_0x0697('0x9')]=function(_0x2b817d,_0x5e08fe){return _0x2b817d[_0x0697('0xa')](_0x0697('0xb'),attributes,{'tableName':_0x0697('0xc'),'paranoid':![],'indexes':[{'name':_0x0697('0xd'),'fields':[_0x0697('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5205=['request-promise','path','rimraf','../../config/environment','report_openchannel_transfer','uniqueid','lodash','util','moment','bluebird'];(function(_0x4b8f51,_0x4ff1a7){var _0x51bf50=function(_0x3b6016){while(--_0x3b6016){_0x4b8f51['push'](_0x4b8f51['shift']());}};_0x51bf50(++_0x4ff1a7);}(_0x5205,0xa6));var _0x5520=function(_0x5080f8,_0x120942){_0x5080f8=_0x5080f8-0x0;var _0x49b0e0=_0x5205[_0x5080f8];return _0x49b0e0;};'use strict';var _=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5520('0x2'));var BPromise=require(_0x5520('0x3'));var rp=require(_0x5520('0x4'));var fs=require('fs');var path=require(_0x5520('0x5'));var rimraf=require(_0x5520('0x6'));var config=require(_0x5520('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x468a9e,_0x138116){return _0x468a9e['define']('OpenchannelTransferReport',attributes,{'tableName':_0x5520('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5520('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 01a3ac3..0291a62 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 _0xc012=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc012,0x97));var _0x2c01=function(_0x1168c2,_0x1ed2ce){_0x1168c2=_0x1168c2-0x0;var _0x5ab8b5=_0xc012[_0x1168c2];return _0x5ab8b5;};'use strict';var _=require(_0x2c01('0x0'));var util=require(_0x2c01('0x1'));var moment=require('moment');var BPromise=require(_0x2c01('0x2'));var rs=require(_0x2c01('0x3'));var fs=require('fs');var Redis=require(_0x2c01('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c01('0x5'));var logger=require(_0x2c01('0x6'))(_0x2c01('0x7'));var config=require(_0x2c01('0x8'));var jayson=require(_0x2c01('0x9'));var client=jayson[_0x2c01('0xa')][_0x2c01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dcb89,_0x1ae5a9,_0x281bf4){return new BPromise(function(_0x1f37ea,_0x4ddef8){return client['request'](_0x3dcb89,_0x281bf4)[_0x2c01('0xc')](function(_0x2b85cb){logger[_0x2c01('0xd')](_0x2c01('0xe'),_0x1ae5a9,_0x2c01('0xf'));logger[_0x2c01('0x10')](_0x2c01('0x11'),_0x1ae5a9,_0x2c01('0xf'),JSON[_0x2c01('0x12')](_0x2b85cb));if(_0x2b85cb[_0x2c01('0x13')]){if(_0x2b85cb[_0x2c01('0x13')][_0x2c01('0x14')]===0x1f4){logger[_0x2c01('0x13')](_0x2c01('0xe'),_0x1ae5a9,_0x2b85cb[_0x2c01('0x13')][_0x2c01('0x15')]);return _0x4ddef8(_0x2b85cb[_0x2c01('0x13')][_0x2c01('0x15')]);}logger[_0x2c01('0x13')](_0x2c01('0xe'),_0x1ae5a9,_0x2b85cb[_0x2c01('0x13')][_0x2c01('0x15')]);return _0x1f37ea(_0x2b85cb[_0x2c01('0x13')][_0x2c01('0x15')]);}else{logger['info'](_0x2c01('0xe'),_0x1ae5a9,_0x2c01('0xf'));_0x1f37ea(_0x2b85cb[_0x2c01('0x16')][_0x2c01('0x15')]);}})[_0x2c01('0x17')](function(_0x36b23a){logger[_0x2c01('0x13')](_0x2c01('0xe'),_0x1ae5a9,_0x36b23a);_0x4ddef8(_0x36b23a);});});} \ No newline at end of file +var _0xac2b=['../../config/environment','client','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x425214,_0x3191e9){var _0x299101=function(_0x7eee04){while(--_0x7eee04){_0x425214['push'](_0x425214['shift']());}};_0x299101(++_0x3191e9);}(_0xac2b,0x175));var _0xbac2=function(_0x2f85b3,_0x416a6f){_0x2f85b3=_0x2f85b3-0x0;var _0x99349d=_0xac2b[_0x2f85b3];return _0x99349d;};'use strict';var _=require(_0xbac2('0x0'));var util=require('util');var moment=require(_0xbac2('0x1'));var BPromise=require('bluebird');var rs=require(_0xbac2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbac2('0x3'))['db'];var utils=require(_0xbac2('0x4'));var logger=require(_0xbac2('0x5'))(_0xbac2('0x6'));var config=require(_0xbac2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbac2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f9ca,_0x434d94,_0x5a686b){return new BPromise(function(_0x197515,_0x4f7236){return client['request'](_0x52f9ca,_0x5a686b)['then'](function(_0x25801b){logger[_0xbac2('0x9')](_0xbac2('0xa'),_0x434d94,_0xbac2('0xb'));logger[_0xbac2('0xc')](_0xbac2('0xd'),_0x434d94,'request\x20sent',JSON[_0xbac2('0xe')](_0x25801b));if(_0x25801b['error']){if(_0x25801b[_0xbac2('0xf')]['code']===0x1f4){logger[_0xbac2('0xf')](_0xbac2('0xa'),_0x434d94,_0x25801b[_0xbac2('0xf')][_0xbac2('0x10')]);return _0x4f7236(_0x25801b[_0xbac2('0xf')][_0xbac2('0x10')]);}logger[_0xbac2('0xf')](_0xbac2('0xa'),_0x434d94,_0x25801b[_0xbac2('0xf')][_0xbac2('0x10')]);return _0x197515(_0x25801b['error']['message']);}else{logger[_0xbac2('0x9')](_0xbac2('0xa'),_0x434d94,_0xbac2('0xb'));_0x197515(_0x25801b[_0xbac2('0x11')][_0xbac2('0x10')]);}})[_0xbac2('0x12')](function(_0x2a373c){logger[_0xbac2('0xf')](_0xbac2('0xa'),_0x434d94,_0x2a373c);_0x4f7236(_0x2a373c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 4be14bc..46d181e 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 _0x50c1=['../../components/interaction/service','../../config/environment','./pause.controller','get','index','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','path','express','Router'];(function(_0x4b5ac3,_0x44ceb7){var _0x41d9c1=function(_0x429173){while(--_0x429173){_0x4b5ac3['push'](_0x4b5ac3['shift']());}};_0x41d9c1(++_0x44ceb7);}(_0x50c1,0x1b6));var _0x150c=function(_0x2d3671,_0x12939e){_0x2d3671=_0x2d3671-0x0;var _0x5b7f98=_0x50c1[_0x2d3671];return _0x5b7f98;};'use strict';var multer=require(_0x150c('0x0'));var util=require('util');var path=require(_0x150c('0x1'));var timeout=require('connect-timeout');var express=require(_0x150c('0x2'));var router=express[_0x150c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x150c('0x4'));var config=require(_0x150c('0x5'));var controller=require(_0x150c('0x6'));router[_0x150c('0x7')]('/',auth['isAuthenticated'](),controller[_0x150c('0x8')]);router[_0x150c('0x7')]('/:id',auth[_0x150c('0x9')](),controller[_0x150c('0xa')]);router[_0x150c('0xb')]('/',auth[_0x150c('0x9')](),controller['create']);router[_0x150c('0xc')](_0x150c('0xd'),auth[_0x150c('0x9')](),controller[_0x150c('0xe')]);router[_0x150c('0xf')](_0x150c('0xd'),auth[_0x150c('0x9')](),controller['destroy']);module[_0x150c('0x10')]=router; \ No newline at end of file +var _0x7eb9=['index','/:id','post','create','put','isAuthenticated','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x7eb9,0xd9));var _0x97eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7eb9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x97eb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97eb('0x1'));var express=require('express');var router=express[_0x97eb('0x2')]();var auth=require(_0x97eb('0x3'));var interaction=require(_0x97eb('0x4'));var config=require(_0x97eb('0x5'));var controller=require('./pause.controller');router[_0x97eb('0x6')]('/',auth['isAuthenticated'](),controller[_0x97eb('0x7')]);router['get'](_0x97eb('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x97eb('0x9')]('/',auth['isAuthenticated'](),controller[_0x97eb('0xa')]);router[_0x97eb('0xb')](_0x97eb('0x8'),auth[_0x97eb('0xc')](),controller[_0x97eb('0xd')]);router['delete']('/:id',auth[_0x97eb('0xc')](),controller[_0x97eb('0xe')]);module[_0x97eb('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2d97530..0217788 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 _0x18ee=['STRING','sequelize','exports'];(function(_0x2a0009,_0x1eba7c){var _0x177807=function(_0x196742){while(--_0x196742){_0x2a0009['push'](_0x2a0009['shift']());}};_0x177807(++_0x1eba7c);}(_0x18ee,0x1d2));var _0xe18e=function(_0x716a15,_0x50363a){_0x716a15=_0x716a15-0x0;var _0x1a0ea9=_0x18ee[_0x716a15];return _0x1a0ea9;};'use strict';var Sequelize=require(_0xe18e('0x0'));module[_0xe18e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe18e('0x2')]}}; \ No newline at end of file +var _0xfee6=['STRING','name'];(function(_0x149e95,_0x28ddfe){var _0x4ad4b3=function(_0x278a46){while(--_0x278a46){_0x149e95['push'](_0x149e95['shift']());}};_0x4ad4b3(++_0x28ddfe);}(_0xfee6,0xd0));var _0x6fee=function(_0x3f8c65,_0x42d2f4){_0x3f8c65=_0x3f8c65-0x0;var _0x1bd7ea=_0xfee6[_0x3f8c65];return _0x1bd7ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6fee('0x0')],'unique':_0x6fee('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x6fee('0x0')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8f2b747..e09e8df 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 _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0xf3f44a,_0x2632f7){var _0x4b576d=function(_0x16666f){while(--_0x16666f){_0xf3f44a['push'](_0xf3f44a['shift']());}};_0x4b576d(++_0x2632f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file +var _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Pause','rows','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x57534f,_0x19c1d4){var _0x30fb5c=function(_0x53b35c){while(--_0x53b35c){_0x57534f['push'](_0x57534f['shift']());}};_0x30fb5c(++_0x19c1d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Pauses';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Pause'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Pause']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':!![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Pause'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Pauses';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Pause'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index f4e485b..4520ec9 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 _0x6e2d=['../../config/logger','moment','request-promise','../../config/environment','exports','define','Pause','tools_pauses','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6e2d,0x8a));var _0xd6e2=function(_0x19157f,_0x18bb14){_0x19157f=_0x19157f-0x0;var _0x56eaf8=_0x6e2d[_0x19157f];return _0x56eaf8;};'use strict';var _=require(_0xd6e2('0x0'));var util=require(_0xd6e2('0x1'));var logger=require(_0xd6e2('0x2'))('api');var moment=require(_0xd6e2('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd6e2('0x5'));var attributes=require('./pause.attributes');module[_0xd6e2('0x6')]=function(_0x390464,_0x3f2561){return _0x390464[_0xd6e2('0x7')](_0xd6e2('0x8'),attributes,{'tableName':_0xd6e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x369c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','util'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x369c,0x192));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc369('0x0'));var logger=require('../../config/logger')(_0xc369('0x1'));var moment=require(_0xc369('0x2'));var BPromise=require(_0xc369('0x3'));var rp=require(_0xc369('0x4'));var fs=require('fs');var path=require(_0xc369('0x5'));var rimraf=require(_0xc369('0x6'));var config=require(_0xc369('0x7'));var attributes=require(_0xc369('0x8'));module[_0xc369('0x9')]=function(_0x53bed9,_0x4ecdd4){return _0x53bed9[_0xc369('0xa')](_0xc369('0xb'),attributes,{'tableName':_0xc369('0xc'),'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 66c3828..f64fad4 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 _0x0096=['debug','Pause,\x20%s,\x20%s,\x20%s','error','message','result','catch','Pause','find','options','raw','where','map','include','model','attributes','ShowPause','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Pause,\x20%s,\x20%s','request\x20sent'];(function(_0x452c08,_0x54dbd2){var _0xcffae=function(_0x497855){while(--_0x497855){_0x452c08['push'](_0x452c08['shift']());}};_0xcffae(++_0x54dbd2);}(_0x0096,0xd1));var _0x6009=function(_0x3f8743,_0x33973f){_0x3f8743=_0x3f8743-0x0;var _0x1f844c=_0x0096[_0x3f8743];return _0x1f844c;};'use strict';var _=require(_0x6009('0x0'));var util=require(_0x6009('0x1'));var moment=require(_0x6009('0x2'));var BPromise=require(_0x6009('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6009('0x4'));var db=require(_0x6009('0x5'))['db'];var utils=require(_0x6009('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6009('0x7'));var jayson=require(_0x6009('0x8'));var client=jayson[_0x6009('0x9')][_0x6009('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48aa56,_0x58b1c4,_0x50a06f){return new BPromise(function(_0x20b8a8,_0x315a11){return client['request'](_0x48aa56,_0x50a06f)[_0x6009('0xb')](function(_0x5b6f1a){logger[_0x6009('0xc')](_0x6009('0xd'),_0x58b1c4,_0x6009('0xe'));logger[_0x6009('0xf')](_0x6009('0x10'),_0x58b1c4,_0x6009('0xe'),JSON['stringify'](_0x5b6f1a));if(_0x5b6f1a[_0x6009('0x11')]){if(_0x5b6f1a[_0x6009('0x11')]['code']===0x1f4){logger[_0x6009('0x11')](_0x6009('0xd'),_0x58b1c4,_0x5b6f1a[_0x6009('0x11')][_0x6009('0x12')]);return _0x315a11(_0x5b6f1a[_0x6009('0x11')][_0x6009('0x12')]);}logger['error']('Pause,\x20%s,\x20%s',_0x58b1c4,_0x5b6f1a['error'][_0x6009('0x12')]);return _0x20b8a8(_0x5b6f1a[_0x6009('0x11')]['message']);}else{logger[_0x6009('0xc')](_0x6009('0xd'),_0x58b1c4,'request\x20sent');_0x20b8a8(_0x5b6f1a[_0x6009('0x13')][_0x6009('0x12')]);}})[_0x6009('0x14')](function(_0xc784e4){logger[_0x6009('0x11')](_0x6009('0xd'),_0x58b1c4,_0xc784e4);_0x315a11(_0xc784e4);});});}exports['ShowPause']=function(_0x5e8c8c){var _0x46abaf=this;return new Promise(function(_0x3e38ed,_0x9fa0ca){return db[_0x6009('0x15')][_0x6009('0x16')]({'raw':_0x5e8c8c[_0x6009('0x17')]?_0x5e8c8c[_0x6009('0x17')][_0x6009('0x18')]===undefined?!![]:![]:!![],'where':_0x5e8c8c[_0x6009('0x17')]?_0x5e8c8c[_0x6009('0x17')][_0x6009('0x19')]||null:null,'attributes':_0x5e8c8c['options']?_0x5e8c8c[_0x6009('0x17')]['attributes']||null:null,'include':_0x5e8c8c['options']?_0x5e8c8c['options']['include']?_[_0x6009('0x1a')](_0x5e8c8c[_0x6009('0x17')][_0x6009('0x1b')],function(_0x1e76d4){return{'model':db[_0x1e76d4['model']],'as':_0x1e76d4['as'],'attributes':_0x1e76d4['attributes'],'include':_0x1e76d4['include']?_[_0x6009('0x1a')](_0x1e76d4['include'],function(_0x5f2923){return{'model':db[_0x5f2923[_0x6009('0x1c')]],'as':_0x5f2923['as'],'attributes':_0x5f2923['attributes'],'include':_0x5f2923[_0x6009('0x1b')]?_[_0x6009('0x1a')](_0x5f2923[_0x6009('0x1b')],function(_0x2b09df){return{'model':db[_0x2b09df[_0x6009('0x1c')]],'as':_0x2b09df['as'],'attributes':_0x2b09df[_0x6009('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6009('0xb')](function(_0xc83bad){logger[_0x6009('0xc')](_0x6009('0x1e'),_0x5e8c8c);logger[_0x6009('0xf')](_0x6009('0x1e'),_0x5e8c8c,JSON[_0x6009('0x1f')](_0xc83bad));_0x3e38ed(_0xc83bad);})[_0x6009('0x14')](function(_0x21dcc5){logger['error'](_0x6009('0x1e'),_0x21dcc5[_0x6009('0x12')],_0x5e8c8c);_0x9fa0ca(_0x46abaf[_0x6009('0x11')](0x1f4,_0x21dcc5[_0x6009('0x12')]));});});}; \ No newline at end of file +var _0x1417=['request','then','info','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowPause','Pause','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2dd9b3,_0x1a705a){var _0x16db12=function(_0x5a6c64){while(--_0x5a6c64){_0x2dd9b3['push'](_0x2dd9b3['shift']());}};_0x16db12(++_0x1a705a);}(_0x1417,0x17b));var _0x7141=function(_0x51c8ca,_0x1e3d52){_0x51c8ca=_0x51c8ca-0x0;var _0x5ad1bb=_0x1417[_0x51c8ca];return _0x5ad1bb;};'use strict';var _=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var moment=require(_0x7141('0x2'));var BPromise=require(_0x7141('0x3'));var rs=require(_0x7141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7141('0x5'))(_0x7141('0x6'));var config=require(_0x7141('0x7'));var jayson=require(_0x7141('0x8'));var client=jayson[_0x7141('0x9')][_0x7141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ccc60,_0x14484e,_0x146b26){return new BPromise(function(_0x149ae2,_0x466c1f){return client[_0x7141('0xb')](_0x3ccc60,_0x146b26)[_0x7141('0xc')](function(_0x2a2fec){logger[_0x7141('0xd')](_0x7141('0xe'),_0x14484e,'request\x20sent');logger[_0x7141('0xf')](_0x7141('0x10'),_0x14484e,_0x7141('0x11'),JSON[_0x7141('0x12')](_0x2a2fec));if(_0x2a2fec[_0x7141('0x13')]){if(_0x2a2fec[_0x7141('0x13')]['code']===0x1f4){logger['error'](_0x7141('0xe'),_0x14484e,_0x2a2fec[_0x7141('0x13')]['message']);return _0x466c1f(_0x2a2fec['error']['message']);}logger[_0x7141('0x13')](_0x7141('0xe'),_0x14484e,_0x2a2fec[_0x7141('0x13')][_0x7141('0x14')]);return _0x149ae2(_0x2a2fec[_0x7141('0x13')][_0x7141('0x14')]);}else{logger[_0x7141('0xd')](_0x7141('0xe'),_0x14484e,'request\x20sent');_0x149ae2(_0x2a2fec['result']['message']);}})[_0x7141('0x15')](function(_0x49bdf0){logger[_0x7141('0x13')](_0x7141('0xe'),_0x14484e,_0x49bdf0);_0x466c1f(_0x49bdf0);});});}exports[_0x7141('0x16')]=function(_0x3f6a92){var _0x3148f2=this;return new Promise(function(_0x46e139,_0x447e6b){return db[_0x7141('0x17')]['find']({'raw':_0x3f6a92['options']?_0x3f6a92['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x19')]||null:null,'attributes':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x1a')]||null:null,'include':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x1b')]?_[_0x7141('0x1c')](_0x3f6a92[_0x7141('0x18')][_0x7141('0x1b')],function(_0x52c1cb){return{'model':db[_0x52c1cb[_0x7141('0x1d')]],'as':_0x52c1cb['as'],'attributes':_0x52c1cb[_0x7141('0x1a')],'include':_0x52c1cb[_0x7141('0x1b')]?_['map'](_0x52c1cb[_0x7141('0x1b')],function(_0x41959a){return{'model':db[_0x41959a[_0x7141('0x1d')]],'as':_0x41959a['as'],'attributes':_0x41959a['attributes'],'include':_0x41959a[_0x7141('0x1b')]?_['map'](_0x41959a['include'],function(_0x1c7781){return{'model':db[_0x1c7781[_0x7141('0x1d')]],'as':_0x1c7781['as'],'attributes':_0x1c7781[_0x7141('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7141('0xc')](function(_0x471f53){logger[_0x7141('0xd')]('ShowPause',_0x3f6a92);logger[_0x7141('0xf')](_0x7141('0x16'),_0x3f6a92,JSON['stringify'](_0x471f53));_0x46e139(_0x471f53);})[_0x7141('0x15')](function(_0x5148b1){logger['error']('ShowPause',_0x5148b1[_0x7141('0x14')],_0x3f6a92);_0x447e6b(_0x3148f2[_0x7141('0x13')](0x1f4,_0x5148b1[_0x7141('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index dd22282..7908869 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 _0x632c=['basename','extname','now','single','upload','post','/webhook','webhookPost','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s'];(function(_0x4670cb,_0x3ed3b8){var _0x2af1e6=function(_0x5376f6){while(--_0x5376f6){_0x4670cb['push'](_0x4670cb['shift']());}};_0x2af1e6(++_0x3ed3b8);}(_0x632c,0x13f));var _0xc632=function(_0x2c6b66,_0x4d126a){_0x2c6b66=_0x2c6b66-0x0;var _0x2c77f4=_0x632c[_0x2c6b66];return _0x2c77f4;};'use strict';var multer=require(_0xc632('0x0'));var util=require('util');var path=require(_0xc632('0x1'));var timeout=require(_0xc632('0x2'));var express=require(_0xc632('0x3'));var router=express[_0xc632('0x4')]();var auth=require(_0xc632('0x5'));var interaction=require(_0xc632('0x6'));var config=require(_0xc632('0x7'));var controller=require('./plugin.controller');router['get']('/',auth[_0xc632('0x8')](),controller['index']);router[_0xc632('0x9')]('/webhook',controller['webhookGet']);router[_0xc632('0x9')]('/:id',auth[_0xc632('0x8')](),controller[_0xc632('0xa')]);router[_0xc632('0x9')](_0xc632('0xb'),auth[_0xc632('0x8')](),controller[_0xc632('0xc')]);var upload=multer({'storage':multer[_0xc632('0xd')]({'destination':function(_0x14d52e,_0x178421,_0x2cb908){_0x2cb908(null,path[_0xc632('0xe')](config[_0xc632('0xf')],_0xc632('0x10')));},'filename':function(_0x9bb63e,_0x273a19,_0x429462){_0x273a19[_0xc632('0x11')]=_0x273a19[_0xc632('0x11')][_0xc632('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x429462(null,util[_0xc632('0x13')](_0xc632('0x14'),path[_0xc632('0x15')](_0x273a19[_0xc632('0x11')],path[_0xc632('0x16')](_0x273a19[_0xc632('0x11')])),Date[_0xc632('0x17')](),path['extname'](_0x273a19[_0xc632('0x11')])));}})});router['post']('/',upload[_0xc632('0x18')]('file'),controller[_0xc632('0x19')]);router[_0xc632('0x1a')](_0xc632('0x1b'),controller[_0xc632('0x1c')]);router[_0xc632('0x1d')](_0xc632('0x1e'),auth[_0xc632('0x8')](),controller[_0xc632('0x1f')]);router['delete'](_0xc632('0x1e'),auth[_0xc632('0x8')](),controller[_0xc632('0x20')]);module[_0xc632('0x21')]=router; \ No newline at end of file +var _0x4871=['basename','extname','now','post','single','file','upload','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s'];(function(_0xe67b55,_0x3c5f71){var _0x5e1fe5=function(_0x53b5bc){while(--_0x53b5bc){_0xe67b55['push'](_0xe67b55['shift']());}};_0x5e1fe5(++_0x3c5f71);}(_0x4871,0x100));var _0x1487=function(_0x15ccd8,_0x3873e3){_0x15ccd8=_0x15ccd8-0x0;var _0x484665=_0x4871[_0x15ccd8];return _0x484665;};'use strict';var multer=require('multer');var util=require(_0x1487('0x0'));var path=require(_0x1487('0x1'));var timeout=require(_0x1487('0x2'));var express=require(_0x1487('0x3'));var router=express[_0x1487('0x4')]();var auth=require(_0x1487('0x5'));var interaction=require(_0x1487('0x6'));var config=require(_0x1487('0x7'));var controller=require(_0x1487('0x8'));router[_0x1487('0x9')]('/',auth[_0x1487('0xa')](),controller[_0x1487('0xb')]);router[_0x1487('0x9')](_0x1487('0xc'),controller[_0x1487('0xd')]);router[_0x1487('0x9')](_0x1487('0xe'),auth['isAuthenticated'](),controller[_0x1487('0xf')]);router[_0x1487('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x1487('0x10')]);var upload=multer({'storage':multer[_0x1487('0x11')]({'destination':function(_0x2b61e3,_0x5839e1,_0x21a041){_0x21a041(null,path[_0x1487('0x12')](config[_0x1487('0x13')],_0x1487('0x14')));},'filename':function(_0x5563bf,_0x584a5b,_0x399a2c){_0x584a5b[_0x1487('0x15')]=_0x584a5b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x399a2c(null,util[_0x1487('0x16')](_0x1487('0x17'),path[_0x1487('0x18')](_0x584a5b[_0x1487('0x15')],path[_0x1487('0x19')](_0x584a5b[_0x1487('0x15')])),Date[_0x1487('0x1a')](),path[_0x1487('0x19')](_0x584a5b[_0x1487('0x15')])));}})});router[_0x1487('0x1b')]('/',upload[_0x1487('0x1c')](_0x1487('0x1d')),controller[_0x1487('0x1e')]);router[_0x1487('0x1b')](_0x1487('0xc'),controller['webhookPost']);router[_0x1487('0x1f')](_0x1487('0xe'),auth[_0x1487('0xa')](),controller[_0x1487('0x20')]);router[_0x1487('0x21')]('/:id',auth[_0x1487('0xa')](),controller[_0x1487('0x21')]);module[_0x1487('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b8f9037..47dbd21 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 _0x4252=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports','STRING','ENUM','html','TEXT'];(function(_0x4034f7,_0x1a5567){var _0x466788=function(_0x47db8e){while(--_0x47db8e){_0x4034f7['push'](_0x4034f7['shift']());}};_0x466788(++_0x1a5567);}(_0x4252,0x89));var _0x2425=function(_0x384aa2,_0x1513ed){_0x384aa2=_0x384aa2-0x0;var _0x2d6184=_0x4252[_0x384aa2];return _0x2d6184;};'use strict';var Sequelize=require(_0x2425('0x0'));module[_0x2425('0x1')]={'name':{'type':Sequelize[_0x2425('0x2')]},'type':{'type':Sequelize[_0x2425('0x3')](_0x2425('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2425('0x5')]},'path':{'type':Sequelize[_0x2425('0x2')],'comment':_0x2425('0x6')},'active':{'type':Sequelize[_0x2425('0x7')],'defaultValue':0x0,'comment':_0x2425('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x2425('0x9'),_0x2425('0xa'),_0x2425('0xb'),_0x2425('0xc')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x2425('0x2')]},'adminUrl':{'type':Sequelize[_0x2425('0x2')]},'agentUrl':{'type':Sequelize[_0x2425('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x2425('0x2')]}}; \ No newline at end of file +var _0x9fca=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0xcbe3cc,_0x5306c9){var _0x5b7cf4=function(_0x3de3f3){while(--_0x3de3f3){_0xcbe3cc['push'](_0xcbe3cc['shift']());}};_0x5b7cf4(++_0x5306c9);}(_0x9fca,0x7f));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xa9fc('0x0'));module[_0xa9fc('0x1')]={'name':{'type':Sequelize[_0xa9fc('0x2')]},'type':{'type':Sequelize[_0xa9fc('0x3')](_0xa9fc('0x4'),_0xa9fc('0x5'))},'description':{'type':Sequelize[_0xa9fc('0x6')]},'version':{'type':Sequelize[_0xa9fc('0x6')]},'path':{'type':Sequelize[_0xa9fc('0x2')],'comment':_0xa9fc('0x7')},'active':{'type':Sequelize[_0xa9fc('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xa9fc('0x3')](_0xa9fc('0x9'),_0xa9fc('0xa'),'always',_0xa9fc('0xb')),'defaultValue':'always','comment':_0xa9fc('0xc')},'icon':{'type':Sequelize[_0xa9fc('0x2')]},'adminUrl':{'type':Sequelize[_0xa9fc('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xa9fc('0x2')]},'scriptPath':{'type':Sequelize[_0xa9fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f90a8e1..f227191 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 _0xbc90=['filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','options','findAll','rows','catch','show','params','include','find','download','path','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','statusCode','http://localhost:','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','set','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','model','keys','query'];(function(_0x56dc69,_0x58b16b){var _0x3f7fde=function(_0x514f0b){while(--_0x514f0b){_0x56dc69['push'](_0x56dc69['shift']());}};_0x3f7fde(++_0x58b16b);}(_0xbc90,0x76));var _0x0bc9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbc90[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0bc9('0x0'));var rimraf=require(_0x0bc9('0x1'));var zipdir=require(_0x0bc9('0x2'));var jsonpatch=require(_0x0bc9('0x3'));var rp=require('request-promise');var moment=require(_0x0bc9('0x4'));var BPromise=require(_0x0bc9('0x5'));var Mustache=require(_0x0bc9('0x6'));var util=require(_0x0bc9('0x7'));var path=require('path');var sox=require(_0x0bc9('0x8'));var csv=require(_0x0bc9('0x9'));var ejs=require(_0x0bc9('0xa'));var fs=require('fs');var _=require(_0x0bc9('0xb'));var squel=require(_0x0bc9('0xc'));var crypto=require(_0x0bc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0bc9('0xe'));var toCsv=require(_0x0bc9('0x9'));var querystring=require('querystring');var Papa=require(_0x0bc9('0xf'));var extract=require(_0x0bc9('0x10'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x0bc9('0x11'));var qs=require(_0x0bc9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0bc9('0x13'));var utils=require(_0x0bc9('0x14'));var config=require(_0x0bc9('0x15'));var db=require(_0x0bc9('0x16'))['db'];config[_0x0bc9('0x17')]=_['defaults'](config[_0x0bc9('0x17')],{'host':_0x0bc9('0x18'),'port':0x18eb});var socket=require(_0x0bc9('0x19'))(new Redis(config['redis']));require(_0x0bc9('0x1a'))[_0x0bc9('0x1b')](socket);function respondWithStatusCode(_0x389eb2,_0x3304cd){_0x3304cd=_0x3304cd||0xcc;return function(_0x5c2af1){if(_0x5c2af1){return _0x389eb2[_0x0bc9('0x1c')](_0x3304cd);}return _0x389eb2[_0x0bc9('0x1d')](_0x3304cd)[_0x0bc9('0x1e')]();};}function respondWithResult(_0x4fc5e1,_0x36100a){_0x36100a=_0x36100a||0xc8;return function(_0x419ea6){if(_0x419ea6){return _0x4fc5e1[_0x0bc9('0x1d')](_0x36100a)[_0x0bc9('0x1f')](_0x419ea6);}};}function respondWithFilteredResult(_0x42dd92,_0x1a112c){return function(_0x378cbb){if(_0x378cbb){var _0x2090c4=_0x378cbb[_0x0bc9('0x20')],_0xc5b138=_0x1a112c[_0x0bc9('0x21')],_0x19842c=_0x1a112c[_0x0bc9('0x21')]+_0x1a112c['limit'],_0x12037c;if(_0x19842c>=_0x2090c4){_0x19842c=_0x2090c4;_0x12037c=0xc8;}else{_0x12037c=0xce;}_0x42dd92[_0x0bc9('0x1d')](_0x12037c);return _0x42dd92[_0x0bc9('0x22')]('Content-Range',_0xc5b138+'-'+_0x19842c+'/'+_0x2090c4)[_0x0bc9('0x1f')](_0x378cbb);}return null;};}function patchUpdates(_0x2ac7dc){return function(_0x5ad8e3){try{jsonpatch['apply'](_0x5ad8e3,_0x2ac7dc,!![]);}catch(_0x3fbf5a){return BPromise[_0x0bc9('0x23')](_0x3fbf5a);}return _0x5ad8e3['save']();};}function saveUpdates(_0x28081a,_0x3680e8){return function(_0x380151){if(_0x380151){return _0x380151[_0x0bc9('0x24')](_0x28081a)[_0x0bc9('0x25')](function(_0x3992ae){return _0x3992ae;});}return null;};}function removeEntity(_0x4a8b2a,_0x5e6257){return function(_0x2b2ca9){if(_0x2b2ca9){return _0x2b2ca9[_0x0bc9('0x26')]()[_0x0bc9('0x25')](function(){var _0x5535e7=_0x2b2ca9[_0x0bc9('0x27')]({'plain':!![]});var _0x6f415c=_0x0bc9('0x28');return db[_0x0bc9('0x29')][_0x0bc9('0x26')]({'where':{'type':_0x6f415c,'resourceId':_0x5535e7['id']}})[_0x0bc9('0x25')](function(){return _0x2b2ca9;});})[_0x0bc9('0x25')](function(){_0x4a8b2a[_0x0bc9('0x1d')](0xcc)[_0x0bc9('0x1e')]();});}};}function handleEntityNotFound(_0x24145a,_0x35622c){return function(_0x21891b){if(!_0x21891b){_0x24145a['sendStatus'](0x194);}return _0x21891b;};}function handleError(_0x2157e2,_0x49435c){_0x49435c=_0x49435c||0x1f4;return function(_0x28d978){logger[_0x0bc9('0x2a')](_0x28d978[_0x0bc9('0x2b')]);if(_0x28d978[_0x0bc9('0x2c')]){delete _0x28d978[_0x0bc9('0x2c')];}_0x2157e2[_0x0bc9('0x1d')](_0x49435c)[_0x0bc9('0x2d')](_0x28d978);};}exports[_0x0bc9('0x2e')]=function(_0x5c7285,_0x3138a6){var _0x1414bc={},_0x3ac5e9={},_0x52da38={'count':0x0,'rows':[]};var _0xc8a23d=db[_0x0bc9('0x2f')][_0x0bc9('0x30')];_0x3ac5e9[_0x0bc9('0x31')]=_[_0x0bc9('0x32')](_0xc8a23d);_0x3ac5e9[_0x0bc9('0x33')]=_['keys'](_0x5c7285[_0x0bc9('0x33')]);_0x3ac5e9[_0x0bc9('0x34')]=_[_0x0bc9('0x35')](_0x3ac5e9['model'],_0x3ac5e9[_0x0bc9('0x33')]);_0x1414bc[_0x0bc9('0x36')]=_[_0x0bc9('0x35')](_0x3ac5e9[_0x0bc9('0x31')],qs[_0x0bc9('0x37')](_0x5c7285[_0x0bc9('0x33')][_0x0bc9('0x37')]));_0x1414bc[_0x0bc9('0x36')]=_0x1414bc[_0x0bc9('0x36')][_0x0bc9('0x38')]?_0x1414bc['attributes']:_0x3ac5e9['model'];if(!_0x5c7285[_0x0bc9('0x33')][_0x0bc9('0x39')]('nolimit')){_0x1414bc[_0x0bc9('0x3a')]=qs['limit'](_0x5c7285[_0x0bc9('0x33')]['limit']);_0x1414bc[_0x0bc9('0x21')]=qs[_0x0bc9('0x21')](_0x5c7285[_0x0bc9('0x33')][_0x0bc9('0x21')]);}_0x1414bc[_0x0bc9('0x3b')]=qs[_0x0bc9('0x3c')](_0x5c7285[_0x0bc9('0x33')][_0x0bc9('0x3c')]);_0x1414bc[_0x0bc9('0x3d')]=qs[_0x0bc9('0x34')](_['pick'](_0x5c7285['query'],_0x3ac5e9[_0x0bc9('0x34')]));if(_0x5c7285[_0x0bc9('0x33')][_0x0bc9('0x3e')]){_0x1414bc[_0x0bc9('0x3d')]=_[_0x0bc9('0x3f')](_0x1414bc[_0x0bc9('0x3d')],{'$or':_[_0x0bc9('0x40')](_0xc8a23d,function(_0x536b2d){if(_0x536b2d[_0x0bc9('0x41')][_0x0bc9('0x42')]!=='VIRTUAL'){var _0x35935a={};_0x35935a[_0x536b2d['field']]={'$like':'%'+_0x5c7285[_0x0bc9('0x33')]['filter']+'%'};return _0x35935a;}})});}_0x1414bc=_['merge']({},_0x1414bc,_0x5c7285[_0x0bc9('0x43')]);var _0x5c5db8={'where':_0x1414bc['where']};return db[_0x0bc9('0x2f')][_0x0bc9('0x20')](_0x5c5db8)[_0x0bc9('0x25')](function(_0x3184b8){_0x52da38[_0x0bc9('0x20')]=_0x3184b8;if(_0x5c7285[_0x0bc9('0x33')]['includeAll']){_0x1414bc['include']=[{'all':!![]}];}return db[_0x0bc9('0x2f')][_0x0bc9('0x44')](_0x1414bc);})[_0x0bc9('0x25')](function(_0x299837){_0x52da38[_0x0bc9('0x45')]=_0x299837;return _0x52da38;})[_0x0bc9('0x25')](respondWithFilteredResult(_0x3138a6,_0x1414bc))[_0x0bc9('0x46')](handleError(_0x3138a6,null));};exports[_0x0bc9('0x47')]=function(_0x2e4801,_0x29d8b8){var _0x1fa9cb={'raw':!![],'where':{'id':_0x2e4801[_0x0bc9('0x48')]['id']}},_0xe3526a={};_0xe3526a[_0x0bc9('0x31')]=_[_0x0bc9('0x32')](db[_0x0bc9('0x2f')][_0x0bc9('0x30')]);_0xe3526a[_0x0bc9('0x33')]=_[_0x0bc9('0x32')](_0x2e4801['query']);_0xe3526a[_0x0bc9('0x34')]=_[_0x0bc9('0x35')](_0xe3526a['model'],_0xe3526a['query']);_0x1fa9cb['attributes']=_['intersection'](_0xe3526a[_0x0bc9('0x31')],qs[_0x0bc9('0x37')](_0x2e4801['query'][_0x0bc9('0x37')]));_0x1fa9cb[_0x0bc9('0x36')]=_0x1fa9cb[_0x0bc9('0x36')]['length']?_0x1fa9cb['attributes']:_0xe3526a[_0x0bc9('0x31')];if(_0x2e4801[_0x0bc9('0x33')]['includeAll']){_0x1fa9cb[_0x0bc9('0x49')]=[{'all':!![]}];}_0x1fa9cb=_[_0x0bc9('0x3f')]({},_0x1fa9cb,_0x2e4801[_0x0bc9('0x43')]);return db[_0x0bc9('0x2f')][_0x0bc9('0x4a')](_0x1fa9cb)[_0x0bc9('0x25')](handleEntityNotFound(_0x29d8b8,null))['then'](respondWithResult(_0x29d8b8,null))[_0x0bc9('0x46')](handleError(_0x29d8b8,null));};exports[_0x0bc9('0x4b')]=function(_0x31ad03,_0x17a3e6,_0x310f7a){return db['Plugin'][_0x0bc9('0x4a')]({'where':{'id':_0x31ad03[_0x0bc9('0x48')]['id']},'attributes':[_0x0bc9('0x2c'),_0x0bc9('0x4c')],'raw':!![]})[_0x0bc9('0x25')](handleEntityNotFound(_0x17a3e6,null))[_0x0bc9('0x25')](function(_0x380e46){if(_0x380e46){var _0x34b5f7=path['join'](config[_0x0bc9('0x4d')],_0x0bc9('0x4e'),util[_0x0bc9('0x4f')](_0x0bc9('0x50'),path[_0x0bc9('0x51')](_0x380e46[_0x0bc9('0x4c')])));var _0x133d81=fs[_0x0bc9('0x52')](_0x34b5f7);var _0xbf16c=archiver(_0x0bc9('0x53'),{'zlib':{'level':0x9}});_0xbf16c['on'](_0x0bc9('0x54'),function(_0x2876bd){if(_0x2876bd[_0x0bc9('0x55')]===_0x0bc9('0x56')){logger[_0x0bc9('0x2a')](_0x2876bd);}else{throw new db[(_0x0bc9('0x57'))][(_0x0bc9('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xbf16c['on'](_0x0bc9('0x2a'),function(_0x23182c){throw new db['Sequelize'][(_0x0bc9('0x58'))](_0x0bc9('0x59'));});_0xbf16c['pipe'](_0x133d81);_0xbf16c[_0x0bc9('0x5a')](_0x0bc9('0x5b'),{'cwd':path[_0x0bc9('0x5c')](config[_0x0bc9('0x4d')],_0x0bc9('0x4e'),path['dirname'](_0x380e46['path'])),'ignore':[path[_0x0bc9('0x5c')](path['basename'](_0x380e46[_0x0bc9('0x4c')]),_0x0bc9('0x5d')),path['join'](path[_0x0bc9('0x51')](_0x380e46[_0x0bc9('0x4c')]),_0x0bc9('0x5e'))],'nodir':!![]})[_0x0bc9('0x5f')]();_0x133d81['on'](_0x0bc9('0x60'),function(){if(!fs[_0x0bc9('0x61')](_0x34b5f7)){throw new db[(_0x0bc9('0x57'))][(_0x0bc9('0x58'))]('Plugin\x20not\x20found');}return _0x17a3e6[_0x0bc9('0x4b')](_0x34b5f7,util[_0x0bc9('0x4f')]('%s.zip',path[_0x0bc9('0x51')](_0x380e46['path'])),function(_0x10ac88){if(_0x10ac88){throw new db[(_0x0bc9('0x57'))][(_0x0bc9('0x58'))](_0x0bc9('0x62'));}fs['unlinkSync'](_0x34b5f7);logger[_0x0bc9('0x63')](_0x0bc9('0x64'));logger[_0x0bc9('0x63')](_0x0bc9('0x65'));});});}return null;})[_0x0bc9('0x46')](handleError(_0x17a3e6,null));};exports[_0x0bc9('0x66')]=function(_0x378d82,_0x20d01d,_0x2da209){var _0x162626=path[_0x0bc9('0x51')](_0x378d82[_0x0bc9('0x67')][_0x0bc9('0x68')],path['extname'](_0x378d82[_0x0bc9('0x67')][_0x0bc9('0x68')]));var _0x5c42c0=path['join'](config[_0x0bc9('0x4d')],_0x0bc9('0x4e'),_0x378d82['file'][_0x0bc9('0x68')]);var _0xa6af2f=path['join'](config[_0x0bc9('0x4d')],_0x0bc9('0x4e'),_0x162626);logger[_0x0bc9('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x5c42c0);logger[_0x0bc9('0x63')](_0x0bc9('0x69'),_0xa6af2f);try{fs[_0x0bc9('0x6a')](_0x5c42c0,parseInt(_0x0bc9('0x6b'),0x8));extract(_0x5c42c0,{'dir':_0xa6af2f},function(_0x350883){if(_0x350883){logger[_0x0bc9('0x2a')](_0x350883);handleError(_0x350883,!![]);};var _0x3336eb=fs['readdirSync'](_0xa6af2f);if(_0x3336eb[_0x0bc9('0x38')]>0x1){removeReferences(_0x5c42c0,_0xa6af2f);logger[_0x0bc9('0x2a')](_0x0bc9('0x6c'));return _0x2da209(new Error(_0x0bc9('0x6c')));}var _0x46adb6=fs[_0x0bc9('0x6d')](path['join'](_0xa6af2f,_0x3336eb[0x0]));if(_0x46adb6[_0x0bc9('0x6e')]()){removeReferences(_0x5c42c0,_0xa6af2f);logger[_0x0bc9('0x2a')](_0x0bc9('0x6c'));return _0x2da209(new Error(_0x0bc9('0x6c')));}if(_0x46adb6[_0x0bc9('0x6f')]()){var _0x380cc6=fs[_0x0bc9('0x70')](path['join'](_0xa6af2f,_0x3336eb[0x0]));if(_0x380cc6[_0x0bc9('0x38')]===0x0){removeReferences(_0x5c42c0,_0xa6af2f);logger['error']('Invalid\x20plugin\x20structure');return _0x2da209(new Error(_0x0bc9('0x6c')));}var _0x4dc0f1=_0x380cc6[_0x0bc9('0x71')](function(_0x3bb589){return _0x3bb589===_0x0bc9('0x72');});if(!_0x4dc0f1){return _0x2da209(new Error(_0x0bc9('0x73')));}var _0x58f083=fs[_0x0bc9('0x74')](path[_0x0bc9('0x5c')](_0xa6af2f,_0x3336eb[0x0],_0x0bc9('0x72')));var _0x27a458=JSON[_0x0bc9('0x75')](_0x58f083);if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x2c')]){return _0x2da209(new Error(_0x0bc9('0x77')));}if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x41')]){return _0x2da209(new Error(_0x0bc9('0x78')));}if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x79')]){return _0x2da209(new Error(_0x0bc9('0x7a')));}if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x7b')]){return _0x2da209(new Error(_0x0bc9('0x7c')));}if(_0x27a458[_0x0bc9('0x41')]===_0x0bc9('0x7d')){if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')]){return _0x2da209(new Error(_0x0bc9('0x7f')));}if(_0x0bc9('0x76')==typeof _0x27a458['parameters'][_0x0bc9('0x7e')]['admin']&&_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')][_0x0bc9('0x80')]){return _0x2da209(new Error(_0x0bc9('0x81')));}}else if(_0x27a458[_0x0bc9('0x41')]===_0x0bc9('0x82')){if('undefined'==typeof _0x27a458['parameters'][_0x0bc9('0x83')]){return _0x2da209(new Error(_0x0bc9('0x84')));}if(_0x0bc9('0x76')==typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x85')]){return _0x2da209(new Error(_0x0bc9('0x86')));}}else{return _0x2da209(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5a7ae0=_0x27a458['name'];var _0x1d378a=_0x27a458['description'];var _0xc27b0d=_0x27a458[_0x0bc9('0x41')];var _0x53c8c6=_0x27a458[_0x0bc9('0x87')]?_0x27a458[_0x0bc9('0x87')]:_0x0bc9('0x88');var _0x5129d2=_0x27a458[_0x0bc9('0x89')]?_0x27a458[_0x0bc9('0x89')]:'icon-apps';var _0x10fb16='';var _0x203963='';var _0x2a222f='';var _0x3d0d8d='';var _0x1552b0=_0x27a458[_0x0bc9('0x79')];if(_0xc27b0d==='html'){if(_0x0bc9('0x76')!=typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')][_0x0bc9('0x8a')]){var _0x20cac3=_0x27a458['parameters'][_0x0bc9('0x7e')][_0x0bc9('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x0bc9('0x8b')](_0x20cac3)){_0x10fb16=path[_0x0bc9('0x5c')](_0x0bc9('0x8c'),_0x162626,_0x3336eb[0x0],_0x20cac3);}else{_0x10fb16=_0x20cac3;}}else{logger[_0x0bc9('0x63')](_0x0bc9('0x8d'));}if(_0x0bc9('0x76')!=typeof _0x27a458['parameters'][_0x0bc9('0x7e')]['agent']){var _0x4ee193=_0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')][_0x0bc9('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4ee193)){_0x203963=path[_0x0bc9('0x5c')](_0x0bc9('0x8c'),_0x162626,_0x3336eb[0x0],_0x4ee193);}else{_0x203963=_0x4ee193;}}else{logger[_0x0bc9('0x63')](_0x0bc9('0x8e'));}}else if(_0xc27b0d===_0x0bc9('0x82')){_0x2a222f=_0x27a458[_0x0bc9('0x7b')]['scriptName'];_0x3d0d8d=_0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x85')];if(_0x0bc9('0x76')!=typeof _0x27a458['parameters']['views']){if(_0x0bc9('0x76')!=typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')][_0x0bc9('0x8a')]){var _0x20cac3=_0x27a458[_0x0bc9('0x7b')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x0bc9('0x8b')](_0x20cac3)){_0x10fb16=path[_0x0bc9('0x5c')]('plugins',_0x162626,_0x3336eb[0x0],_0x20cac3);}else{_0x10fb16=_0x20cac3;}}if('undefined'!=typeof _0x27a458[_0x0bc9('0x7b')][_0x0bc9('0x7e')][_0x0bc9('0x80')]){var _0x4ee193=_0x27a458['parameters'][_0x0bc9('0x7e')][_0x0bc9('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4ee193)){_0x203963=path[_0x0bc9('0x5c')]('plugins',_0x162626,_0x3336eb[0x0],_0x4ee193);}else{_0x203963=_0x4ee193;}}}}var _0x2d717e={'name':_0x5a7ae0,'description':_0x1d378a,'path':path['join'](_0x162626,_0x3336eb[0x0]),'type':_0xc27b0d,'sidebar':_0x53c8c6,'icon':_0x5129d2,'adminUrl':_0x10fb16,'agentUrl':_0x203963,'scriptName':_0x2a222f,'scriptPath':_0x3d0d8d,'version':_0x1552b0};removeReferences(_0x5c42c0,null);return db[_0x0bc9('0x2f')][_0x0bc9('0x8f')](_0x2d717e)[_0x0bc9('0x25')](function(_0x2674fd){var _0x17d226={'role':_0x378d82[_0x0bc9('0x90')][_0x0bc9('0x91')],'userProfileId':_0x378d82[_0x0bc9('0x90')][_0x0bc9('0x92')]};if(!_0x17d226)throw new Error(_0x0bc9('0x93'));if(_0x17d226[_0x0bc9('0x91')]===_0x0bc9('0x94')){var _0x563c49=_0x2674fd[_0x0bc9('0x27')]({'plain':!![]});return db[_0x0bc9('0x95')][_0x0bc9('0x4a')]({'where':{'name':_0x0bc9('0x28'),'userProfileId':_0x17d226[_0x0bc9('0x92')]},'raw':!![]})[_0x0bc9('0x25')](function(_0x2bf997){if(_0x2bf997&&_0x2bf997[_0x0bc9('0x96')]===0x0){return db[_0x0bc9('0x29')][_0x0bc9('0x8f')]({'name':_0x563c49['name'],'resourceId':_0x563c49['id'],'type':_0x2bf997['name'],'sectionId':_0x2bf997['id']},{})[_0x0bc9('0x25')](function(){return _0x2674fd;});}else{return _0x2674fd;}})[_0x0bc9('0x46')](function(_0x16632e){logger['error'](_0x0bc9('0x97'),_0x16632e);throw _0x16632e;});}return _0x2674fd;})['then'](respondWithResult(_0x20d01d,null))[_0x0bc9('0x46')](handleError(_0x20d01d,null));}});}catch(_0x5199cc){_0x20d01d['status'](0x1f4)[_0x0bc9('0x2d')](_0x5199cc);}};function removeReferences(_0x529ab2,_0x11129f){try{if(_0x529ab2){fs['unlinkSync'](_0x529ab2);logger[_0x0bc9('0x63')](_0x0bc9('0x98'));}if(_0x11129f){rimraf(_0x11129f,function(){});logger['info'](_0x0bc9('0x99'));}}catch(_0x539b29){logger['error'](_0x539b29);}}exports[_0x0bc9('0x24')]=function(_0x528161,_0x263090,_0xd14cb5){return db[_0x0bc9('0x2f')][_0x0bc9('0x4a')]({'where':{'id':_0x528161[_0x0bc9('0x48')]['id']}})[_0x0bc9('0x25')](handleEntityNotFound(_0x263090,null))['then'](saveUpdates(_0x528161['body'],null))['then'](respondWithResult(_0x263090,null))[_0x0bc9('0x46')](handleError(_0x263090,null));};exports[_0x0bc9('0x9a')]=function(_0x522b55,_0x3098b8,_0x1553d0){return db['Plugin'][_0x0bc9('0x4a')]({'where':{'id':_0x522b55['params']['id']}})[_0x0bc9('0x25')](function(_0x155509){if(_0x155509){return _0x155509['destroy']();}})['then'](function(_0x1e7267){rimraf(path['join'](config[_0x0bc9('0x4d')],'server/files/plugins',path[_0x0bc9('0x9b')](_0x1e7267[_0x0bc9('0x4c')])),function(){});return _0x1e7267;})[_0x0bc9('0x25')](handleEntityNotFound(_0x3098b8,null))[_0x0bc9('0x25')](respondWithStatusCode(_0x3098b8,null))[_0x0bc9('0x46')](handleError(_0x3098b8,null));};exports[_0x0bc9('0x9c')]=function(_0x637aac,_0x40d684,_0x1f4af2){return BPromise[_0x0bc9('0x9d')]()[_0x0bc9('0x25')](function(){if(!_0x637aac['query'][_0x0bc9('0x4c')]){throw new Error(_0x0bc9('0x9e'));}if(!_0x637aac[_0x0bc9('0x33')][_0x0bc9('0x9f')]){throw new Error(_0x0bc9('0xa0'));}var _0x25ac49=_0x637aac[_0x0bc9('0x33')][_0x0bc9('0xa1')]?_0x637aac[_0x0bc9('0x33')][_0x0bc9('0xa1')]+':'+_0x637aac[_0x0bc9('0x33')][_0x0bc9('0x9f')]:'http://localhost:'+_0x637aac[_0x0bc9('0x33')][_0x0bc9('0x9f')];var _0x3e56a3=_0x637aac['query'][_0x0bc9('0x1f')]?_0x637aac[_0x0bc9('0x33')][_0x0bc9('0x1f')]:!![];var _0x416faa=_0x637aac['query']['encoding']?_0x637aac[_0x0bc9('0x33')][_0x0bc9('0xa2')]:null;var _0x3222ef={'method':_0x637aac[_0x0bc9('0xa3')],'uri':util[_0x0bc9('0x4f')]('%s%s',_0x25ac49,_0x637aac[_0x0bc9('0x33')]['path']),'json':_0x3e56a3,'resolveWithFullResponse':!![],'encoding':_0x416faa,'qs':_0x637aac[_0x0bc9('0x33')]};if(_0x637aac[_0x0bc9('0xa4')]){_0x3222ef['headers']=_0x637aac[_0x0bc9('0xa4')];if(_0x3222ef[_0x0bc9('0xa4')][_0x0bc9('0xa5')]){delete _0x3222ef[_0x0bc9('0xa4')][_0x0bc9('0xa5')];}}if(_0x3222ef[_0x0bc9('0xa4')][_0x0bc9('0xa6')]){delete _0x3222ef[_0x0bc9('0xa4')]['content-type'];}return rp(_0x3222ef);})[_0x0bc9('0x25')](function(_0x93e388){if(_0x93e388){_0x40d684[_0x0bc9('0x22')](_0x93e388[_0x0bc9('0xa4')]);logger[_0x0bc9('0x63')](_0x93e388['body']);if(_['endsWith'](_0x637aac[_0x0bc9('0x33')][_0x0bc9('0x4c')],_0x0bc9('0x4b'))&&_0x93e388[_0x0bc9('0xa7')]==0x1f4){return _0x40d684[_0x0bc9('0x1c')](_0x93e388[_0x0bc9('0xa7')]);}else{return _0x40d684['status'](_0x93e388[_0x0bc9('0xa7')])[_0x0bc9('0x2d')](_0x93e388[_0x0bc9('0x90')]);}}else{return _0x40d684[_0x0bc9('0x1c')](0xc8);}})[_0x0bc9('0x46')](handleError(_0x40d684,null));};exports['webhookPost']=function(_0x390043,_0x11f6e3,_0x135957){return BPromise[_0x0bc9('0x9d')]()[_0x0bc9('0x25')](function(){if(!_0x390043[_0x0bc9('0x33')]['path']){throw new Error(_0x0bc9('0x9e'));}if(!_0x390043[_0x0bc9('0x33')]['port']){throw new Error(_0x0bc9('0xa0'));}var _0x2611e4=_0x390043[_0x0bc9('0x33')][_0x0bc9('0xa1')]?_0x390043[_0x0bc9('0x33')]['hostname']+':'+_0x390043['query'][_0x0bc9('0x9f')]:_0x0bc9('0xa8')+_0x390043['query'][_0x0bc9('0x9f')];var _0x925951=_0x390043[_0x0bc9('0x33')][_0x0bc9('0x1f')]?_0x390043['query']['json']:!![];var _0xc1851c=_0x390043[_0x0bc9('0x33')][_0x0bc9('0xa2')]?_0x390043['query'][_0x0bc9('0xa2')]:null;var _0x58f45a={'method':_0x390043[_0x0bc9('0xa3')],'uri':util['format'](_0x0bc9('0xa9'),_0x2611e4,_0x390043[_0x0bc9('0x33')][_0x0bc9('0x4c')]),'json':_0x925951,'resolveWithFullResponse':!![],'encoding':_0xc1851c,'body':_0x390043['body']};if(_0x390043['headers']){_0x58f45a[_0x0bc9('0xa4')]=_0x390043[_0x0bc9('0xa4')];if(_0x58f45a[_0x0bc9('0xa4')][_0x0bc9('0xa5')]){delete _0x58f45a['headers'][_0x0bc9('0xa5')];}}if(_0x58f45a['headers'][_0x0bc9('0xa6')]){delete _0x58f45a['headers'][_0x0bc9('0xa6')];}return rp(_0x58f45a);})[_0x0bc9('0x25')](function(_0x390634){if(_0x390634){_0x11f6e3['set'](_0x390634[_0x0bc9('0xa4')]);logger[_0x0bc9('0x63')](_0x390634[_0x0bc9('0x90')]);return _0x11f6e3[_0x0bc9('0x1d')](_0x390634[_0x0bc9('0xa7')])[_0x0bc9('0x2d')](_0x390634[_0x0bc9('0x90')]);}else{return _0x11f6e3[_0x0bc9('0x1c')](0xc8);}})['catch'](handleError(_0x11f6e3,null));}; \ No newline at end of file +var _0xfdc5=['chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','UserProfileSection','UserProfileResource','Zip\x20archive\x20removed','delete','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','squel','crypto','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','destroy','get','Plugins','then','error','stack','name','send','Plugin','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','catch','params','include','download','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdc5,0x190));var _0x5fdc=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0xfdc5[_0x12bcf7];return _0x2825a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fdc('0x0'));var rimraf=require(_0x5fdc('0x1'));var zipdir=require(_0x5fdc('0x2'));var jsonpatch=require(_0x5fdc('0x3'));var rp=require(_0x5fdc('0x4'));var moment=require(_0x5fdc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fdc('0x6'));var util=require(_0x5fdc('0x7'));var path=require(_0x5fdc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5fdc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5fdc('0xa'));var crypto=require(_0x5fdc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5fdc('0xc'));var querystring=require('querystring');var Papa=require(_0x5fdc('0xd'));var extract=require('extract-zip');var rimraf=require(_0x5fdc('0x1'));var archiver=require('archiver');var Redis=require(_0x5fdc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5fdc('0xf'));var logger=require(_0x5fdc('0x10'))(_0x5fdc('0x11'));var utils=require(_0x5fdc('0x12'));var config=require(_0x5fdc('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5fdc('0x14')](config[_0x5fdc('0x15')],{'host':_0x5fdc('0x16'),'port':0x18eb});var socket=require(_0x5fdc('0x17'))(new Redis(config[_0x5fdc('0x15')]));require(_0x5fdc('0x18'))[_0x5fdc('0x19')](socket);function respondWithStatusCode(_0x32d051,_0x30ab01){_0x30ab01=_0x30ab01||0xcc;return function(_0x2e54bd){if(_0x2e54bd){return _0x32d051[_0x5fdc('0x1a')](_0x30ab01);}return _0x32d051[_0x5fdc('0x1b')](_0x30ab01)[_0x5fdc('0x1c')]();};}function respondWithResult(_0x4564aa,_0x2c6ba1){_0x2c6ba1=_0x2c6ba1||0xc8;return function(_0x49d1d2){if(_0x49d1d2){return _0x4564aa[_0x5fdc('0x1b')](_0x2c6ba1)['json'](_0x49d1d2);}};}function respondWithFilteredResult(_0x527068,_0x4c4b08){return function(_0x3e0cb1){if(_0x3e0cb1){var _0x5a1e2a=_0x3e0cb1[_0x5fdc('0x1d')],_0x469cb2=_0x4c4b08[_0x5fdc('0x1e')],_0x4ee9aa=_0x4c4b08[_0x5fdc('0x1e')]+_0x4c4b08[_0x5fdc('0x1f')],_0x2f8639;if(_0x4ee9aa>=_0x5a1e2a){_0x4ee9aa=_0x5a1e2a;_0x2f8639=0xc8;}else{_0x2f8639=0xce;}_0x527068['status'](_0x2f8639);return _0x527068[_0x5fdc('0x20')]('Content-Range',_0x469cb2+'-'+_0x4ee9aa+'/'+_0x5a1e2a)[_0x5fdc('0x21')](_0x3e0cb1);}return null;};}function patchUpdates(_0x344965){return function(_0x147b5a){try{jsonpatch[_0x5fdc('0x22')](_0x147b5a,_0x344965,!![]);}catch(_0x25b259){return BPromise[_0x5fdc('0x23')](_0x25b259);}return _0x147b5a[_0x5fdc('0x24')]();};}function saveUpdates(_0x4cd846,_0x354339){return function(_0x4c6cd0){if(_0x4c6cd0){return _0x4c6cd0[_0x5fdc('0x25')](_0x4cd846)['then'](function(_0x3c0995){return _0x3c0995;});}return null;};}function removeEntity(_0x15a10c,_0x45bc16){return function(_0x3fa715){if(_0x3fa715){return _0x3fa715[_0x5fdc('0x26')]()['then'](function(){var _0x38accb=_0x3fa715[_0x5fdc('0x27')]({'plain':!![]});var _0x155ad7=_0x5fdc('0x28');return db['UserProfileResource'][_0x5fdc('0x26')]({'where':{'type':_0x155ad7,'resourceId':_0x38accb['id']}})['then'](function(){return _0x3fa715;});})[_0x5fdc('0x29')](function(){_0x15a10c[_0x5fdc('0x1b')](0xcc)[_0x5fdc('0x1c')]();});}};}function handleEntityNotFound(_0x101a4d,_0x4648d7){return function(_0x1fc98b){if(!_0x1fc98b){_0x101a4d[_0x5fdc('0x1a')](0x194);}return _0x1fc98b;};}function handleError(_0x3464d6,_0x35565f){_0x35565f=_0x35565f||0x1f4;return function(_0x332e89){logger[_0x5fdc('0x2a')](_0x332e89[_0x5fdc('0x2b')]);if(_0x332e89[_0x5fdc('0x2c')]){delete _0x332e89['name'];}_0x3464d6[_0x5fdc('0x1b')](_0x35565f)[_0x5fdc('0x2d')](_0x332e89);};}exports['index']=function(_0x318c29,_0x106fbb){var _0x66b1fd={},_0x3c721b={},_0xbd9b42={'count':0x0,'rows':[]};var _0x25c5f8=db[_0x5fdc('0x2e')][_0x5fdc('0x2f')];_0x3c721b['model']=_[_0x5fdc('0x30')](_0x25c5f8);_0x3c721b[_0x5fdc('0x31')]=_[_0x5fdc('0x30')](_0x318c29[_0x5fdc('0x31')]);_0x3c721b[_0x5fdc('0x32')]=_[_0x5fdc('0x33')](_0x3c721b[_0x5fdc('0x34')],_0x3c721b[_0x5fdc('0x31')]);_0x66b1fd[_0x5fdc('0x35')]=_[_0x5fdc('0x33')](_0x3c721b[_0x5fdc('0x34')],qs[_0x5fdc('0x36')](_0x318c29[_0x5fdc('0x31')]['fields']));_0x66b1fd['attributes']=_0x66b1fd[_0x5fdc('0x35')][_0x5fdc('0x37')]?_0x66b1fd[_0x5fdc('0x35')]:_0x3c721b[_0x5fdc('0x34')];if(!_0x318c29[_0x5fdc('0x31')]['hasOwnProperty'](_0x5fdc('0x38'))){_0x66b1fd[_0x5fdc('0x1f')]=qs[_0x5fdc('0x1f')](_0x318c29['query'][_0x5fdc('0x1f')]);_0x66b1fd[_0x5fdc('0x1e')]=qs[_0x5fdc('0x1e')](_0x318c29[_0x5fdc('0x31')][_0x5fdc('0x1e')]);}_0x66b1fd[_0x5fdc('0x39')]=qs['sort'](_0x318c29[_0x5fdc('0x31')][_0x5fdc('0x3a')]);_0x66b1fd[_0x5fdc('0x3b')]=qs['filters'](_[_0x5fdc('0x3c')](_0x318c29['query'],_0x3c721b['filters']));if(_0x318c29[_0x5fdc('0x31')]['filter']){_0x66b1fd['where']=_[_0x5fdc('0x3d')](_0x66b1fd[_0x5fdc('0x3b')],{'$or':_[_0x5fdc('0x3e')](_0x25c5f8,function(_0x4d05f2){if(_0x4d05f2[_0x5fdc('0x3f')][_0x5fdc('0x40')]!==_0x5fdc('0x41')){var _0x194cf4={};_0x194cf4[_0x4d05f2[_0x5fdc('0x42')]]={'$like':'%'+_0x318c29[_0x5fdc('0x31')][_0x5fdc('0x43')]+'%'};return _0x194cf4;}})});}_0x66b1fd=_[_0x5fdc('0x3d')]({},_0x66b1fd,_0x318c29[_0x5fdc('0x44')]);var _0x32785a={'where':_0x66b1fd[_0x5fdc('0x3b')]};return db[_0x5fdc('0x2e')][_0x5fdc('0x1d')](_0x32785a)[_0x5fdc('0x29')](function(_0x52c6dc){_0xbd9b42[_0x5fdc('0x1d')]=_0x52c6dc;if(_0x318c29[_0x5fdc('0x31')][_0x5fdc('0x45')]){_0x66b1fd['include']=[{'all':!![]}];}return db[_0x5fdc('0x2e')][_0x5fdc('0x46')](_0x66b1fd);})['then'](function(_0x29eea0){_0xbd9b42[_0x5fdc('0x47')]=_0x29eea0;return _0xbd9b42;})[_0x5fdc('0x29')](respondWithFilteredResult(_0x106fbb,_0x66b1fd))[_0x5fdc('0x48')](handleError(_0x106fbb,null));};exports['show']=function(_0x575e82,_0x24d4a1){var _0x362969={'raw':!![],'where':{'id':_0x575e82[_0x5fdc('0x49')]['id']}},_0x144a34={};_0x144a34[_0x5fdc('0x34')]=_[_0x5fdc('0x30')](db[_0x5fdc('0x2e')][_0x5fdc('0x2f')]);_0x144a34[_0x5fdc('0x31')]=_[_0x5fdc('0x30')](_0x575e82['query']);_0x144a34[_0x5fdc('0x32')]=_[_0x5fdc('0x33')](_0x144a34['model'],_0x144a34[_0x5fdc('0x31')]);_0x362969[_0x5fdc('0x35')]=_[_0x5fdc('0x33')](_0x144a34['model'],qs[_0x5fdc('0x36')](_0x575e82[_0x5fdc('0x31')][_0x5fdc('0x36')]));_0x362969[_0x5fdc('0x35')]=_0x362969['attributes'][_0x5fdc('0x37')]?_0x362969[_0x5fdc('0x35')]:_0x144a34[_0x5fdc('0x34')];if(_0x575e82[_0x5fdc('0x31')][_0x5fdc('0x45')]){_0x362969[_0x5fdc('0x4a')]=[{'all':!![]}];}_0x362969=_[_0x5fdc('0x3d')]({},_0x362969,_0x575e82[_0x5fdc('0x44')]);return db[_0x5fdc('0x2e')]['find'](_0x362969)[_0x5fdc('0x29')](handleEntityNotFound(_0x24d4a1,null))[_0x5fdc('0x29')](respondWithResult(_0x24d4a1,null))[_0x5fdc('0x48')](handleError(_0x24d4a1,null));};exports[_0x5fdc('0x4b')]=function(_0x342d7c,_0x404f76,_0x592861){return db[_0x5fdc('0x2e')][_0x5fdc('0x4c')]({'where':{'id':_0x342d7c[_0x5fdc('0x49')]['id']},'attributes':[_0x5fdc('0x2c'),'path'],'raw':!![]})[_0x5fdc('0x29')](handleEntityNotFound(_0x404f76,null))[_0x5fdc('0x29')](function(_0x54bc48){if(_0x54bc48){var _0x5ca3d9=path[_0x5fdc('0x4d')](config['root'],_0x5fdc('0x4e'),util[_0x5fdc('0x4f')](_0x5fdc('0x50'),path[_0x5fdc('0x51')](_0x54bc48[_0x5fdc('0x8')])));var _0xce0356=fs[_0x5fdc('0x52')](_0x5ca3d9);var _0x2c1578=archiver(_0x5fdc('0x53'),{'zlib':{'level':0x9}});_0x2c1578['on'](_0x5fdc('0x54'),function(_0x553e32){if(_0x553e32[_0x5fdc('0x55')]==='ENOENT'){logger[_0x5fdc('0x2a')](_0x553e32);}else{throw new db[(_0x5fdc('0x56'))][(_0x5fdc('0x57'))](_0x5fdc('0x58'));}});_0x2c1578['on'](_0x5fdc('0x2a'),function(_0x4e65ec){throw new db['Sequelize'][(_0x5fdc('0x57'))](_0x5fdc('0x58'));});_0x2c1578[_0x5fdc('0x59')](_0xce0356);_0x2c1578[_0x5fdc('0x5a')](_0x5fdc('0x5b'),{'cwd':path[_0x5fdc('0x4d')](config[_0x5fdc('0x5c')],_0x5fdc('0x4e'),path[_0x5fdc('0x5d')](_0x54bc48[_0x5fdc('0x8')])),'ignore':[path[_0x5fdc('0x4d')](path[_0x5fdc('0x51')](_0x54bc48['path']),'node_modules/**/*'),path[_0x5fdc('0x4d')](path[_0x5fdc('0x51')](_0x54bc48['path']),_0x5fdc('0x5e'))],'nodir':!![]})[_0x5fdc('0x5f')]();_0xce0356['on'](_0x5fdc('0x60'),function(){if(!fs[_0x5fdc('0x61')](_0x5ca3d9)){throw new db[(_0x5fdc('0x56'))][(_0x5fdc('0x57'))](_0x5fdc('0x62'));}return _0x404f76[_0x5fdc('0x4b')](_0x5ca3d9,util[_0x5fdc('0x4f')](_0x5fdc('0x50'),path[_0x5fdc('0x51')](_0x54bc48[_0x5fdc('0x8')])),function(_0x89be75){if(_0x89be75){throw new db[(_0x5fdc('0x56'))][(_0x5fdc('0x57'))](_0x5fdc('0x63'));}fs[_0x5fdc('0x64')](_0x5ca3d9);logger[_0x5fdc('0x65')](_0x5fdc('0x66'));logger[_0x5fdc('0x65')](_0x5fdc('0x67'));});});}return null;})['catch'](handleError(_0x404f76,null));};exports[_0x5fdc('0x68')]=function(_0x538212,_0x4a3878,_0x3af9f9){var _0x252486=path[_0x5fdc('0x51')](_0x538212[_0x5fdc('0x69')]['filename'],path[_0x5fdc('0x6a')](_0x538212[_0x5fdc('0x69')][_0x5fdc('0x6b')]));var _0x56bb46=path[_0x5fdc('0x4d')](config[_0x5fdc('0x5c')],_0x5fdc('0x4e'),_0x538212['file'][_0x5fdc('0x6b')]);var _0x24f952=path[_0x5fdc('0x4d')](config[_0x5fdc('0x5c')],'server/files/plugins',_0x252486);logger[_0x5fdc('0x65')](_0x5fdc('0x6c'),_0x56bb46);logger[_0x5fdc('0x65')](_0x5fdc('0x6d'),_0x24f952);try{fs[_0x5fdc('0x6e')](_0x56bb46,parseInt(_0x5fdc('0x6f'),0x8));extract(_0x56bb46,{'dir':_0x24f952},function(_0x474c17){if(_0x474c17){logger['error'](_0x474c17);handleError(_0x474c17,!![]);};var _0x1460ef=fs[_0x5fdc('0x70')](_0x24f952);if(_0x1460ef[_0x5fdc('0x37')]>0x1){removeReferences(_0x56bb46,_0x24f952);logger[_0x5fdc('0x2a')](_0x5fdc('0x71'));return _0x3af9f9(new Error(_0x5fdc('0x71')));}var _0xa21a0=fs[_0x5fdc('0x72')](path[_0x5fdc('0x4d')](_0x24f952,_0x1460ef[0x0]));if(_0xa21a0[_0x5fdc('0x73')]()){removeReferences(_0x56bb46,_0x24f952);logger[_0x5fdc('0x2a')](_0x5fdc('0x71'));return _0x3af9f9(new Error(_0x5fdc('0x71')));}if(_0xa21a0[_0x5fdc('0x74')]()){var _0x39ec2a=fs[_0x5fdc('0x70')](path[_0x5fdc('0x4d')](_0x24f952,_0x1460ef[0x0]));if(_0x39ec2a['length']===0x0){removeReferences(_0x56bb46,_0x24f952);logger[_0x5fdc('0x2a')](_0x5fdc('0x71'));return _0x3af9f9(new Error('Invalid\x20plugin\x20structure'));}var _0x3645f4=_0x39ec2a[_0x5fdc('0x75')](function(_0x51662a){return _0x51662a==='manifest.json';});if(!_0x3645f4){return _0x3af9f9(new Error(_0x5fdc('0x76')));}var _0x589e0a=fs[_0x5fdc('0x77')](path[_0x5fdc('0x4d')](_0x24f952,_0x1460ef[0x0],_0x5fdc('0x78')));var _0x5c43c2=JSON[_0x5fdc('0x79')](_0x589e0a);if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x2c')]){return _0x3af9f9(new Error(_0x5fdc('0x7b')));}if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x3f')]){return _0x3af9f9(new Error(_0x5fdc('0x7c')));}if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x7d')]){return _0x3af9f9(new Error(_0x5fdc('0x7e')));}if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x7f')]){return _0x3af9f9(new Error(_0x5fdc('0x80')));}if(_0x5c43c2[_0x5fdc('0x3f')]===_0x5fdc('0x81')){if(_0x5fdc('0x7a')==typeof _0x5c43c2['parameters'][_0x5fdc('0x82')]){return _0x3af9f9(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')]['admin']&&_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')]['agent']){return _0x3af9f9(new Error(_0x5fdc('0x83')));}}else if(_0x5c43c2[_0x5fdc('0x3f')]===_0x5fdc('0x84')){if(_0x5fdc('0x7a')==typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x85')]){return _0x3af9f9(new Error(_0x5fdc('0x86')));}if('undefined'==typeof _0x5c43c2['parameters']['scriptPath']){return _0x3af9f9(new Error(_0x5fdc('0x87')));}}else{return _0x3af9f9(new Error(_0x5fdc('0x88')));}var _0x4ded23=_0x5c43c2[_0x5fdc('0x2c')];var _0x3f6872=_0x5c43c2[_0x5fdc('0x89')];var _0x58ea1c=_0x5c43c2['type'];var _0x18909d=_0x5c43c2[_0x5fdc('0x8a')]?_0x5c43c2[_0x5fdc('0x8a')]:_0x5fdc('0x8b');var _0x4bcb12=_0x5c43c2[_0x5fdc('0x8c')]?_0x5c43c2['icon']:_0x5fdc('0x8d');var _0x59cd54='';var _0x538b42='';var _0x158e07='';var _0x504cc='';var _0x21271d=_0x5c43c2['version'];if(_0x58ea1c==='html'){if(_0x5fdc('0x7a')!=typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')][_0x5fdc('0x8e')]){var _0x149027=_0x5c43c2[_0x5fdc('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5fdc('0x8f')](_0x149027)){_0x59cd54=path[_0x5fdc('0x4d')](_0x5fdc('0x90'),_0x252486,_0x1460ef[0x0],_0x149027);}else{_0x59cd54=_0x149027;}}else{logger['info'](_0x5fdc('0x91'));}if(_0x5fdc('0x7a')!=typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')][_0x5fdc('0x92')]){var _0x5d9366=_0x5c43c2['parameters'][_0x5fdc('0x82')][_0x5fdc('0x92')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5d9366)){_0x538b42=path['join'](_0x5fdc('0x90'),_0x252486,_0x1460ef[0x0],_0x5d9366);}else{_0x538b42=_0x5d9366;}}else{logger[_0x5fdc('0x65')](_0x5fdc('0x93'));}}else if(_0x58ea1c===_0x5fdc('0x84')){_0x158e07=_0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x85')];_0x504cc=_0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x94')];if(_0x5fdc('0x7a')!=typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')]){if('undefined'!=typeof _0x5c43c2[_0x5fdc('0x7f')]['views'][_0x5fdc('0x8e')]){var _0x149027=_0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')][_0x5fdc('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0x5fdc('0x8f')](_0x149027)){_0x59cd54=path[_0x5fdc('0x4d')]('plugins',_0x252486,_0x1460ef[0x0],_0x149027);}else{_0x59cd54=_0x149027;}}if(_0x5fdc('0x7a')!=typeof _0x5c43c2[_0x5fdc('0x7f')][_0x5fdc('0x82')][_0x5fdc('0x92')]){var _0x5d9366=_0x5c43c2['parameters'][_0x5fdc('0x82')][_0x5fdc('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x5fdc('0x8f')](_0x5d9366)){_0x538b42=path[_0x5fdc('0x4d')](_0x5fdc('0x90'),_0x252486,_0x1460ef[0x0],_0x5d9366);}else{_0x538b42=_0x5d9366;}}}}var _0x332ed9={'name':_0x4ded23,'description':_0x3f6872,'path':path[_0x5fdc('0x4d')](_0x252486,_0x1460ef[0x0]),'type':_0x58ea1c,'sidebar':_0x18909d,'icon':_0x4bcb12,'adminUrl':_0x59cd54,'agentUrl':_0x538b42,'scriptName':_0x158e07,'scriptPath':_0x504cc,'version':_0x21271d};removeReferences(_0x56bb46,null);return db[_0x5fdc('0x2e')][_0x5fdc('0x95')](_0x332ed9)[_0x5fdc('0x29')](function(_0x425d32){var _0x5aa67c={'role':_0x538212[_0x5fdc('0x96')][_0x5fdc('0x97')],'userProfileId':_0x538212[_0x5fdc('0x96')][_0x5fdc('0x98')]};if(!_0x5aa67c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aa67c[_0x5fdc('0x97')]==='user'){var _0x1dd00d=_0x425d32['get']({'plain':!![]});return db[_0x5fdc('0x99')]['find']({'where':{'name':_0x5fdc('0x28'),'userProfileId':_0x5aa67c[_0x5fdc('0x98')]},'raw':!![]})['then'](function(_0x14617c){if(_0x14617c&&_0x14617c['autoAssociation']===0x0){return db[_0x5fdc('0x9a')][_0x5fdc('0x95')]({'name':_0x1dd00d[_0x5fdc('0x2c')],'resourceId':_0x1dd00d['id'],'type':_0x14617c['name'],'sectionId':_0x14617c['id']},{})[_0x5fdc('0x29')](function(){return _0x425d32;});}else{return _0x425d32;}})[_0x5fdc('0x48')](function(_0x138225){logger[_0x5fdc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x138225);throw _0x138225;});}return _0x425d32;})[_0x5fdc('0x29')](respondWithResult(_0x4a3878,null))[_0x5fdc('0x48')](handleError(_0x4a3878,null));}});}catch(_0x44b5d5){_0x4a3878[_0x5fdc('0x1b')](0x1f4)['send'](_0x44b5d5);}};function removeReferences(_0x294d9e,_0x3a20ce){try{if(_0x294d9e){fs[_0x5fdc('0x64')](_0x294d9e);logger['info'](_0x5fdc('0x9b'));}if(_0x3a20ce){rimraf(_0x3a20ce,function(){});logger[_0x5fdc('0x65')]('Extracted\x20folder\x20removed');}}catch(_0x4e25b9){logger['error'](_0x4e25b9);}}exports[_0x5fdc('0x25')]=function(_0x94096e,_0x50ac80,_0x2457d4){return db[_0x5fdc('0x2e')][_0x5fdc('0x4c')]({'where':{'id':_0x94096e[_0x5fdc('0x49')]['id']}})[_0x5fdc('0x29')](handleEntityNotFound(_0x50ac80,null))['then'](saveUpdates(_0x94096e[_0x5fdc('0x96')],null))[_0x5fdc('0x29')](respondWithResult(_0x50ac80,null))[_0x5fdc('0x48')](handleError(_0x50ac80,null));};exports[_0x5fdc('0x9c')]=function(_0x5aa048,_0x43cc36,_0x4d8342){return db['Plugin'][_0x5fdc('0x4c')]({'where':{'id':_0x5aa048[_0x5fdc('0x49')]['id']}})['then'](function(_0x579bce){if(_0x579bce){return _0x579bce[_0x5fdc('0x26')]();}})[_0x5fdc('0x29')](function(_0x2ac8c9){rimraf(path['join'](config[_0x5fdc('0x5c')],'server/files/plugins',path[_0x5fdc('0x5d')](_0x2ac8c9['path'])),function(){});return _0x2ac8c9;})[_0x5fdc('0x29')](handleEntityNotFound(_0x43cc36,null))[_0x5fdc('0x29')](respondWithStatusCode(_0x43cc36,null))[_0x5fdc('0x48')](handleError(_0x43cc36,null));};exports['webhookGet']=function(_0x53987e,_0x1fd5b0,_0x20adf0){return BPromise['resolve']()[_0x5fdc('0x29')](function(){if(!_0x53987e[_0x5fdc('0x31')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x53987e[_0x5fdc('0x31')]['port']){throw new Error(_0x5fdc('0x9d'));}var _0x2f1a2b=_0x53987e[_0x5fdc('0x31')]['hostname']?_0x53987e['query'][_0x5fdc('0x9e')]+':'+_0x53987e[_0x5fdc('0x31')][_0x5fdc('0x9f')]:'http://localhost:'+_0x53987e[_0x5fdc('0x31')][_0x5fdc('0x9f')];var _0x39295a=_0x53987e[_0x5fdc('0x31')]['json']?_0x53987e[_0x5fdc('0x31')][_0x5fdc('0x21')]:!![];var _0x2bb84c=_0x53987e['query'][_0x5fdc('0xa0')]?_0x53987e[_0x5fdc('0x31')][_0x5fdc('0xa0')]:null;var _0x207a0b={'method':_0x53987e[_0x5fdc('0xa1')],'uri':util['format']('%s%s',_0x2f1a2b,_0x53987e[_0x5fdc('0x31')][_0x5fdc('0x8')]),'json':_0x39295a,'resolveWithFullResponse':!![],'encoding':_0x2bb84c,'qs':_0x53987e[_0x5fdc('0x31')]};if(_0x53987e[_0x5fdc('0xa2')]){_0x207a0b[_0x5fdc('0xa2')]=_0x53987e[_0x5fdc('0xa2')];if(_0x207a0b[_0x5fdc('0xa2')]['content-length']){delete _0x207a0b['headers'][_0x5fdc('0xa3')];}}if(_0x207a0b[_0x5fdc('0xa2')][_0x5fdc('0xa4')]){delete _0x207a0b[_0x5fdc('0xa2')][_0x5fdc('0xa4')];}return rp(_0x207a0b);})['then'](function(_0x21e7a8){if(_0x21e7a8){_0x1fd5b0[_0x5fdc('0x20')](_0x21e7a8[_0x5fdc('0xa2')]);logger[_0x5fdc('0x65')](_0x21e7a8[_0x5fdc('0x96')]);if(_[_0x5fdc('0xa5')](_0x53987e[_0x5fdc('0x31')][_0x5fdc('0x8')],'download')&&_0x21e7a8[_0x5fdc('0xa6')]==0x1f4){return _0x1fd5b0[_0x5fdc('0x1a')](_0x21e7a8[_0x5fdc('0xa6')]);}else{return _0x1fd5b0[_0x5fdc('0x1b')](_0x21e7a8[_0x5fdc('0xa6')])[_0x5fdc('0x2d')](_0x21e7a8[_0x5fdc('0x96')]);}}else{return _0x1fd5b0[_0x5fdc('0x1a')](0xc8);}})[_0x5fdc('0x48')](handleError(_0x1fd5b0,null));};exports[_0x5fdc('0xa7')]=function(_0x34caee,_0x111bd4,_0x1d92a6){return BPromise['resolve']()['then'](function(){if(!_0x34caee[_0x5fdc('0x31')]['path']){throw new Error(_0x5fdc('0xa8'));}if(!_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x116089=_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x9e')]?_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x9e')]+':'+_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x9f')]:'http://localhost:'+_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x9f')];var _0x105f2d=_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x21')]?_0x34caee[_0x5fdc('0x31')]['json']:!![];var _0x1b5650=_0x34caee['query']['encoding']?_0x34caee[_0x5fdc('0x31')][_0x5fdc('0xa0')]:null;var _0x30f956={'method':_0x34caee['method'],'uri':util['format'](_0x5fdc('0xa9'),_0x116089,_0x34caee[_0x5fdc('0x31')][_0x5fdc('0x8')]),'json':_0x105f2d,'resolveWithFullResponse':!![],'encoding':_0x1b5650,'body':_0x34caee[_0x5fdc('0x96')]};if(_0x34caee[_0x5fdc('0xa2')]){_0x30f956['headers']=_0x34caee[_0x5fdc('0xa2')];if(_0x30f956['headers']['content-length']){delete _0x30f956['headers'][_0x5fdc('0xa3')];}}if(_0x30f956[_0x5fdc('0xa2')][_0x5fdc('0xa4')]){delete _0x30f956[_0x5fdc('0xa2')]['content-type'];}return rp(_0x30f956);})[_0x5fdc('0x29')](function(_0x4b39ff){if(_0x4b39ff){_0x111bd4['set'](_0x4b39ff['headers']);logger[_0x5fdc('0x65')](_0x4b39ff['body']);return _0x111bd4['status'](_0x4b39ff[_0x5fdc('0xa6')])['send'](_0x4b39ff['body']);}else{return _0x111bd4[_0x5fdc('0x1a')](0xc8);}})[_0x5fdc('0x48')](handleError(_0x111bd4,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 474c474..e3bacc7 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 _0x59da=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x3ecf3f,_0x1709c9){var _0x1c6c85=function(_0x576ff8){while(--_0x576ff8){_0x3ecf3f['push'](_0x3ecf3f['shift']());}};_0x1c6c85(++_0x1709c9);}(_0x59da,0x10f));var _0xa59d=function(_0xfbc17a,_0x2b0c35){_0xfbc17a=_0xfbc17a-0x0;var _0x21b618=_0x59da[_0xfbc17a];return _0x21b618;};'use strict';var EventEmitter=require(_0xa59d('0x0'));var Plugin=require(_0xa59d('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xa59d('0x2')](0x0);var events={'afterCreate':_0xa59d('0x3'),'afterUpdate':_0xa59d('0x4'),'afterDestroy':_0xa59d('0x5')};function emitEvent(_0x13d1f){return function(_0x597729,_0x4c3c09,_0x22f300){PluginEvents[_0xa59d('0x6')](_0x13d1f+':'+_0x597729['id'],_0x597729);PluginEvents['emit'](_0x13d1f,_0x597729);_0x22f300(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xa59d('0x7')]=PluginEvents; \ No newline at end of file +var _0xeacb=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','remove'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xeacb,0xcf));var _0xbeac=function(_0x266d40,_0x5e197f){_0x266d40=_0x266d40-0x0;var _0x53d047=_0xeacb[_0x266d40];return _0x53d047;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xbeac('0x0'))['db'][_0xbeac('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbeac('0x2')};function emitEvent(_0x484ad6){return function(_0x45860c,_0x403e9a,_0x33799b){PluginEvents['emit'](_0x484ad6+':'+_0x45860c['id'],_0x45860c);PluginEvents[_0xbeac('0x3')](_0x484ad6,_0x45860c);_0x33799b(null);};}for(var e in events){if(events[_0xbeac('0x4')](e)){var event=events[e];Plugin[_0xbeac('0x5')](e,emitEvent(event));}}module[_0xbeac('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 966cc6e..d3ff50c 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 _0xb796=['Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x49f795,_0x89dea1){var _0x5a4d7d=function(_0x547b0d){while(--_0x547b0d){_0x49f795['push'](_0x49f795['shift']());}};_0x5a4d7d(++_0x89dea1);}(_0xb796,0xd2));var _0x6b79=function(_0x35241f,_0x4889e7){_0x35241f=_0x35241f-0x0;var _0x246a08=_0xb796[_0x35241f];return _0x246a08;};'use strict';var _=require(_0x6b79('0x0'));var util=require(_0x6b79('0x1'));var logger=require(_0x6b79('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6b79('0x3'));var rp=require(_0x6b79('0x4'));var fs=require('fs');var path=require(_0x6b79('0x5'));var rimraf=require(_0x6b79('0x6'));var config=require(_0x6b79('0x7'));var attributes=require(_0x6b79('0x8'));module[_0x6b79('0x9')]=function(_0x47d07f,_0x4d4478){return _0x47d07f[_0x6b79('0xa')](_0x6b79('0xb'),attributes,{'tableName':_0x6b79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe683=['exports','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x229f5e,_0x433f0f){var _0x2d62ff=function(_0xe4d381){while(--_0xe4d381){_0x229f5e['push'](_0x229f5e['shift']());}};_0x2d62ff(++_0x433f0f);}(_0xe683,0x1d7));var _0x3e68=function(_0x35a18a,_0x2480a8){_0x35a18a=_0x35a18a-0x0;var _0x2a8066=_0xe683[_0x35a18a];return _0x2a8066;};'use strict';var _=require(_0x3e68('0x0'));var util=require(_0x3e68('0x1'));var logger=require(_0x3e68('0x2'))(_0x3e68('0x3'));var moment=require(_0x3e68('0x4'));var BPromise=require(_0x3e68('0x5'));var rp=require(_0x3e68('0x6'));var fs=require('fs');var path=require(_0x3e68('0x7'));var rimraf=require(_0x3e68('0x8'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x3e68('0x9')]=function(_0x3bc100,_0x576b3e){return _0x3bc100[_0x3e68('0xa')](_0x3e68('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c981bb6..a478a0a 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 _0x287a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Plugin','create','body','options','raw','then','CreatePlugin','util','moment','bluebird','ioredis'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x287a,0xc8));var _0xa287=function(_0x375825,_0x482175){_0x375825=_0x375825-0x0;var _0x5e664c=_0x287a[_0x375825];return _0x5e664c;};'use strict';var _=require('lodash');var util=require(_0xa287('0x0'));var moment=require(_0xa287('0x1'));var BPromise=require(_0xa287('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa287('0x3'));var db=require(_0xa287('0x4'))['db'];var utils=require(_0xa287('0x5'));var logger=require(_0xa287('0x6'))(_0xa287('0x7'));var config=require(_0xa287('0x8'));var jayson=require(_0xa287('0x9'));var client=jayson['client'][_0xa287('0xa')]({'port':0x232a});config[_0xa287('0xb')]=_[_0xa287('0xc')](config[_0xa287('0xb')],{'host':_0xa287('0xd'),'port':0x18eb});var socket=require(_0xa287('0xe'))(new Redis(config[_0xa287('0xb')]));require(_0xa287('0xf'))['register'](socket);function respondWithRpcPromise(_0x25c3fc,_0x3b0d2e,_0x367dbc){return new BPromise(function(_0x195ab6,_0x1cbbb8){return client[_0xa287('0x10')](_0x25c3fc,_0x367dbc)['then'](function(_0x389af4){logger[_0xa287('0x11')](_0xa287('0x12'),_0x3b0d2e,_0xa287('0x13'));logger[_0xa287('0x14')](_0xa287('0x15'),_0x3b0d2e,'request\x20sent',JSON[_0xa287('0x16')](_0x389af4));if(_0x389af4[_0xa287('0x17')]){if(_0x389af4[_0xa287('0x17')][_0xa287('0x18')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x3b0d2e,_0x389af4[_0xa287('0x17')][_0xa287('0x19')]);return _0x1cbbb8(_0x389af4[_0xa287('0x17')][_0xa287('0x19')]);}logger[_0xa287('0x17')](_0xa287('0x12'),_0x3b0d2e,_0x389af4['error'][_0xa287('0x19')]);return _0x195ab6(_0x389af4[_0xa287('0x17')]['message']);}else{logger['info'](_0xa287('0x12'),_0x3b0d2e,_0xa287('0x13'));_0x195ab6(_0x389af4[_0xa287('0x1a')][_0xa287('0x19')]);}})['catch'](function(_0x174327){logger['error']('Plugin,\x20%s,\x20%s',_0x3b0d2e,_0x174327);_0x1cbbb8(_0x174327);});});}exports['CreatePlugin']=function(_0x3d8927){var _0xf6d467=this;return new Promise(function(_0x525826,_0x4ac4e4){return db[_0xa287('0x1b')][_0xa287('0x1c')](_0x3d8927[_0xa287('0x1d')],{'raw':_0x3d8927[_0xa287('0x1e')]?_0x3d8927[_0xa287('0x1e')][_0xa287('0x1f')]===undefined?!![]:![]:!![]})[_0xa287('0x20')](function(_0x523cfc){logger[_0xa287('0x11')]('CreatePlugin',_0x3d8927);logger['debug']('CreatePlugin',_0x3d8927,JSON['stringify'](_0x523cfc));_0x525826(_0x523cfc);})['catch'](function(_0x54bbcb){logger[_0xa287('0x17')](_0xa287('0x21'),_0x54bbcb[_0xa287('0x19')],_0x3d8927);_0x4ac4e4(_0xf6d467[_0xa287('0x17')](0x1f4,_0x54bbcb['message']));});});}; \ No newline at end of file +var _0x7a9a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','create','options','lodash','util','randomstring','../../mysqldb'];(function(_0x38aa57,_0x30a679){var _0x70381c=function(_0x531b88){while(--_0x531b88){_0x38aa57['push'](_0x38aa57['shift']());}};_0x70381c(++_0x30a679);}(_0x7a9a,0x130));var _0xa7a9=function(_0x4f370c,_0x1541d3){_0x4f370c=_0x4f370c-0x0;var _0x15b436=_0x7a9a[_0x4f370c];return _0x15b436;};'use strict';var _=require(_0xa7a9('0x0'));var util=require(_0xa7a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7a9('0x3'))['db'];var utils=require(_0xa7a9('0x4'));var logger=require(_0xa7a9('0x5'))(_0xa7a9('0x6'));var config=require(_0xa7a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa7a9('0x8')][_0xa7a9('0x9')]({'port':0x232a});config['redis']=_[_0xa7a9('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa7a9('0xb'))[_0xa7a9('0xc')](socket);function respondWithRpcPromise(_0xa90aab,_0x1a1f4f,_0x562f44){return new BPromise(function(_0x5f13cb,_0x2a35a9){return client[_0xa7a9('0xd')](_0xa90aab,_0x562f44)[_0xa7a9('0xe')](function(_0x296622){logger[_0xa7a9('0xf')](_0xa7a9('0x10'),_0x1a1f4f,_0xa7a9('0x11'));logger[_0xa7a9('0x12')](_0xa7a9('0x13'),_0x1a1f4f,_0xa7a9('0x11'),JSON[_0xa7a9('0x14')](_0x296622));if(_0x296622['error']){if(_0x296622[_0xa7a9('0x15')]['code']===0x1f4){logger['error'](_0xa7a9('0x10'),_0x1a1f4f,_0x296622['error'][_0xa7a9('0x16')]);return _0x2a35a9(_0x296622['error'][_0xa7a9('0x16')]);}logger[_0xa7a9('0x15')](_0xa7a9('0x10'),_0x1a1f4f,_0x296622[_0xa7a9('0x15')][_0xa7a9('0x16')]);return _0x5f13cb(_0x296622[_0xa7a9('0x15')][_0xa7a9('0x16')]);}else{logger[_0xa7a9('0xf')](_0xa7a9('0x10'),_0x1a1f4f,_0xa7a9('0x11'));_0x5f13cb(_0x296622[_0xa7a9('0x17')][_0xa7a9('0x16')]);}})[_0xa7a9('0x18')](function(_0x2e15d7){logger[_0xa7a9('0x15')](_0xa7a9('0x10'),_0x1a1f4f,_0x2e15d7);_0x2a35a9(_0x2e15d7);});});}exports[_0xa7a9('0x19')]=function(_0x863f1f){var _0x48cf46=this;return new Promise(function(_0x2b0b19,_0x3200bf){return db['Plugin'][_0xa7a9('0x1a')](_0x863f1f['body'],{'raw':_0x863f1f[_0xa7a9('0x1b')]?_0x863f1f[_0xa7a9('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa7a9('0xe')](function(_0x8a0eef){logger[_0xa7a9('0xf')](_0xa7a9('0x19'),_0x863f1f);logger[_0xa7a9('0x12')](_0xa7a9('0x19'),_0x863f1f,JSON['stringify'](_0x8a0eef));_0x2b0b19(_0x8a0eef);})['catch'](function(_0xc4d178){logger[_0xa7a9('0x15')](_0xa7a9('0x19'),_0xc4d178[_0xa7a9('0x16')],_0x863f1f);_0x3200bf(_0x48cf46[_0xa7a9('0x15')](0x1f4,_0xc4d178[_0xa7a9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 536fdb1..83b8cbc 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 _0xa929=['register','plugin:','./plugin.events','remove','update'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0xa929,0x70));var _0x9a92=function(_0x2c7720,_0x4b4c66){_0x2c7720=_0x2c7720-0x0;var _0x18b6b0=_0xa929[_0x2c7720];return _0x18b6b0;};'use strict';var PluginEvents=require(_0x9a92('0x0'));var events=['save',_0x9a92('0x1'),_0x9a92('0x2')];function createListener(_0x5eac48,_0x2b8b28){return function(_0xfc230e){_0x2b8b28['emit'](_0x5eac48,_0xfc230e);};}function removeListener(_0x4d09aa,_0x2d76ed){return function(){PluginEvents['removeListener'](_0x4d09aa,_0x2d76ed);};}exports[_0x9a92('0x3')]=function(_0x578b71){for(var _0x4cbe42=0x0,_0x21865c=events['length'];_0x4cbe42<_0x21865c;_0x4cbe42++){var _0x46b70a=events[_0x4cbe42];var _0x4d174d=createListener(_0x9a92('0x4')+_0x46b70a,_0x578b71);PluginEvents['on'](_0x46b70a,_0x4d174d);}}; \ No newline at end of file +var _0x6498=['register','plugin:','./plugin.events','save','update','removeListener'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x6498,0x19a));var _0x8649=function(_0xee1593,_0x39434f){_0xee1593=_0xee1593-0x0;var _0x17e08e=_0x6498[_0xee1593];return _0x17e08e;};'use strict';var PluginEvents=require(_0x8649('0x0'));var events=[_0x8649('0x1'),'remove',_0x8649('0x2')];function createListener(_0x300761,_0x2c1895){return function(_0x41f1a7){_0x2c1895['emit'](_0x300761,_0x41f1a7);};}function removeListener(_0x6da7c2,_0x4af9c2){return function(){PluginEvents[_0x8649('0x3')](_0x6da7c2,_0x4af9c2);};}exports[_0x8649('0x4')]=function(_0xc57c18){for(var _0x20b578=0x0,_0x5f1153=events['length'];_0x20b578<_0x5f1153;_0x20b578++){var _0x460f35=events[_0x20b578];var _0x1ffa05=createListener(_0x8649('0x5')+_0x460f35,_0xc57c18);PluginEvents['on'](_0x460f35,_0x1ffa05);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index eb24703..3f57039 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(_0x3dd6cc,_0x203488){var _0x45c035=function(_0x58871e){while(--_0x58871e){_0x3dd6cc['push'](_0x3dd6cc['shift']());}};_0x45c035(++_0x203488);}(_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 +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0xa6f470,_0x54d9bf){var _0x3d4796=function(_0x422479){while(--_0x422479){_0xa6f470['push'](_0xa6f470['shift']());}};_0x3d4796(++_0x54d9bf);}(_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 diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 22e33b1..9d1b273 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 _0xfa23=['dirname','chdir','start','send','Missing\x20name\x20and/or\x20path','update','restart','stop','params','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','name','npm\x20install','info','index','reject','express','motion2','then','catch','describe','create','body','script','../../files/plugins','cwd'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xfa23,0x1d5));var _0x3fa2=function(_0x247e76,_0x404f2b){_0x247e76=_0x247e76-0x0;var _0x4aaac1=_0xfa23[_0x247e76];return _0x4aaac1;};'use strict';var _=require(_0x3fa2('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x3fa2('0x1'))(_0x3fa2('0x2'));var path=require(_0x3fa2('0x3'));var exec=require(_0x3fa2('0x4'))[_0x3fa2('0x5')];var BPromise=require(_0x3fa2('0x6'));function handleEntityNotFound(_0x2457b6,_0x586e64){return function(_0xdba7bc){if(!_0xdba7bc){_0x2457b6[_0x3fa2('0x7')](0x194);;}return _0xdba7bc;};}function respondWithResult(_0x745841,_0x45c1b1){_0x45c1b1=_0x45c1b1||0xc8;return function(_0x3b4278){if(_0x3b4278){return _0x745841[_0x3fa2('0x8')](_0x45c1b1)['json'](_0x3b4278);}return null;};}function handleError(_0x381dbe,_0x273474){_0x273474=_0x273474||0x1f4;return function(_0x5d648c){logger[_0x3fa2('0x9')](_0x5d648c['stack']);if(_0x5d648c[_0x3fa2('0xa')]){delete _0x5d648c['name'];}_0x381dbe[_0x3fa2('0x8')](_0x273474)['send'](_0x5d648c);};}function execChildProcess(){return new BPromise(function(_0x2ca97e,_0x3869b3){exec(_0x3fa2('0xb'),function(_0x293b1f,_0x44feda,_0x13b465){logger[_0x3fa2('0xc')](_0x44feda);logger[_0x3fa2('0xc')](_0x13b465);if(_0x293b1f){logger['error'](_0x293b1f);return _0x3869b3(_0x293b1f);}return _0x2ca97e(_0x44feda);});});}exports[_0x3fa2('0xd')]=function(_0x4df352,_0x181758){return pm2['list']()['then'](function(_0x579bf0){if(_0x579bf0){var _0x4a6e15=_[_0x3fa2('0xe')](_0x579bf0,function(_0x1d0a73){return _0x1d0a73['name']===_0x3fa2('0xf')||_0x1d0a73[_0x3fa2('0xa')]===_0x3fa2('0x10');});return{'rows':_0x4a6e15,'count':_0x4a6e15['length']};}return null;})[_0x3fa2('0x11')](respondWithResult(_0x181758,null))[_0x3fa2('0x12')](handleError(_0x181758,null));};exports['show']=function(_0x19fc1d,_0x40f673){return pm2[_0x3fa2('0x13')](_0x19fc1d['params']['id'])[_0x3fa2('0x11')](respondWithResult(_0x40f673,null))['then'](handleEntityNotFound(_0x40f673,null))[_0x3fa2('0x12')](handleError(_0x40f673,null));};exports[_0x3fa2('0x14')]=function(_0x33d85c,_0x43680a){if(_0x33d85c[_0x3fa2('0x15')]['name']&&_0x33d85c['body'][_0x3fa2('0x16')]){var _0x59d350=path['join'](__dirname,_0x3fa2('0x17'),_0x33d85c['body'][_0x3fa2('0x16')]);var _0x54385a=process[_0x3fa2('0x18')]();process['chdir'](path[_0x3fa2('0x19')](_0x59d350));return execChildProcess()[_0x3fa2('0x11')](function(_0x1ad56f){process[_0x3fa2('0x1a')](_0x54385a);return pm2[_0x3fa2('0x1b')]({'name':_0x33d85c[_0x3fa2('0x15')][_0x3fa2('0xa')],'script':_0x59d350});})['then'](function(_0x4f0e9e){pm2['dump']();return _0x4f0e9e[0x0];})['then'](respondWithResult(_0x43680a,0xc9))[_0x3fa2('0x12')](handleError(_0x43680a,null));}else{return _0x43680a['status'](0x1f4)[_0x3fa2('0x1c')]({'message':_0x3fa2('0x1d')});}};exports[_0x3fa2('0x1e')]=function(_0x486754,_0x401446){if(_0x486754['body']['id']){delete _0x486754[_0x3fa2('0x15')]['id'];}var _0x4b431e={'online':_0x3fa2('0x1f'),'stopped':_0x3fa2('0x20')};if(_0x4b431e['hasOwnProperty'](_0x486754[_0x3fa2('0x15')][_0x3fa2('0x8')])){return pm2[_0x4b431e[_0x486754['body'][_0x3fa2('0x8')]]](_0x486754[_0x3fa2('0x21')]['id'])[_0x3fa2('0x11')](respondWithResult(_0x401446,0xc8))[_0x3fa2('0x12')](handleError(_0x401446,null));}else{return _0x401446[_0x3fa2('0x8')](0x1f4)['send']({'message':_0x3fa2('0x22')});}};exports['destroy']=function(_0x49b744,_0x3b8ef7){if(_0x49b744[_0x3fa2('0x15')]['id']){delete _0x49b744['body']['id'];}if(_0x49b744[_0x3fa2('0x21')]['id']){return pm2[_0x3fa2('0x23')](_0x49b744[_0x3fa2('0x21')]['id'])[_0x3fa2('0x11')](function(_0x46256c){pm2[_0x3fa2('0x24')]();return _0x46256c[0x0];})[_0x3fa2('0x11')](respondWithResult(_0x3b8ef7,null))[_0x3fa2('0x12')](handleError(_0x3b8ef7,null));}else{return _0x3b8ef7['status'](0x1f4)[_0x3fa2('0x1c')]({'message':_0x3fa2('0x25')});}}; \ No newline at end of file +var _0x8c7a=['../../config/pm2','../../config/logger','api','path','sendStatus','status','json','error','stack','name','send','npm\x20install','info','list','express','motion2','then','describe','catch','create','body','join','../../files/plugins','chdir','dirname','Missing\x20name\x20and/or\x20path','update','restart','stop','destroy','params','dump','Unknown\x20id','lodash'];(function(_0x3e33d4,_0x2a5a0a){var _0x38aebc=function(_0x7ae54a){while(--_0x7ae54a){_0x3e33d4['push'](_0x3e33d4['shift']());}};_0x38aebc(++_0x2a5a0a);}(_0x8c7a,0x197));var _0xa8c7=function(_0x36759b,_0x1b2048){_0x36759b=_0x36759b-0x0;var _0x35eabb=_0x8c7a[_0x36759b];return _0x35eabb;};'use strict';var _=require(_0xa8c7('0x0'));var pm2=require(_0xa8c7('0x1'));var logger=require(_0xa8c7('0x2'))(_0xa8c7('0x3'));var path=require(_0xa8c7('0x4'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x189754,_0x44d295){return function(_0x40d483){if(!_0x40d483){_0x189754[_0xa8c7('0x5')](0x194);;}return _0x40d483;};}function respondWithResult(_0x58e038,_0x29d296){_0x29d296=_0x29d296||0xc8;return function(_0x373404){if(_0x373404){return _0x58e038[_0xa8c7('0x6')](_0x29d296)[_0xa8c7('0x7')](_0x373404);}return null;};}function handleError(_0x22a59e,_0x595a4c){_0x595a4c=_0x595a4c||0x1f4;return function(_0xa2cd18){logger[_0xa8c7('0x8')](_0xa2cd18[_0xa8c7('0x9')]);if(_0xa2cd18[_0xa8c7('0xa')]){delete _0xa2cd18[_0xa8c7('0xa')];}_0x22a59e[_0xa8c7('0x6')](_0x595a4c)[_0xa8c7('0xb')](_0xa2cd18);};}function execChildProcess(){return new BPromise(function(_0x444ba1,_0x4f8c99){exec(_0xa8c7('0xc'),function(_0x3bff36,_0x2d92ab,_0x4dd19b){logger[_0xa8c7('0xd')](_0x2d92ab);logger['info'](_0x4dd19b);if(_0x3bff36){logger[_0xa8c7('0x8')](_0x3bff36);return _0x4f8c99(_0x3bff36);}return _0x444ba1(_0x2d92ab);});});}exports['index']=function(_0xa1e712,_0x4eef96){return pm2[_0xa8c7('0xe')]()['then'](function(_0x51929f){if(_0x51929f){var _0x5eadf6=_['reject'](_0x51929f,function(_0xb8cd05){return _0xb8cd05[_0xa8c7('0xa')]===_0xa8c7('0xf')||_0xb8cd05[_0xa8c7('0xa')]===_0xa8c7('0x10');});return{'rows':_0x5eadf6,'count':_0x5eadf6['length']};}return null;})[_0xa8c7('0x11')](respondWithResult(_0x4eef96,null))['catch'](handleError(_0x4eef96,null));};exports['show']=function(_0x1b5514,_0x55bfa6){return pm2[_0xa8c7('0x12')](_0x1b5514['params']['id'])[_0xa8c7('0x11')](respondWithResult(_0x55bfa6,null))[_0xa8c7('0x11')](handleEntityNotFound(_0x55bfa6,null))[_0xa8c7('0x13')](handleError(_0x55bfa6,null));};exports[_0xa8c7('0x14')]=function(_0x19404a,_0x11a25d){if(_0x19404a[_0xa8c7('0x15')]['name']&&_0x19404a['body']['script']){var _0x21b08c=path[_0xa8c7('0x16')](__dirname,_0xa8c7('0x17'),_0x19404a['body']['script']);var _0x3ed505=process['cwd']();process[_0xa8c7('0x18')](path[_0xa8c7('0x19')](_0x21b08c));return execChildProcess()['then'](function(_0x551ddc){process[_0xa8c7('0x18')](_0x3ed505);return pm2['start']({'name':_0x19404a[_0xa8c7('0x15')][_0xa8c7('0xa')],'script':_0x21b08c});})[_0xa8c7('0x11')](function(_0x37bf0c){pm2['dump']();return _0x37bf0c[0x0];})[_0xa8c7('0x11')](respondWithResult(_0x11a25d,0xc9))[_0xa8c7('0x13')](handleError(_0x11a25d,null));}else{return _0x11a25d[_0xa8c7('0x6')](0x1f4)[_0xa8c7('0xb')]({'message':_0xa8c7('0x1a')});}};exports[_0xa8c7('0x1b')]=function(_0x1c3acf,_0x5dc2c3){if(_0x1c3acf[_0xa8c7('0x15')]['id']){delete _0x1c3acf[_0xa8c7('0x15')]['id'];}var _0x1239ea={'online':_0xa8c7('0x1c'),'stopped':_0xa8c7('0x1d')};if(_0x1239ea['hasOwnProperty'](_0x1c3acf[_0xa8c7('0x15')]['status'])){return pm2[_0x1239ea[_0x1c3acf[_0xa8c7('0x15')][_0xa8c7('0x6')]]](_0x1c3acf['params']['id'])[_0xa8c7('0x11')](respondWithResult(_0x5dc2c3,0xc8))['catch'](handleError(_0x5dc2c3,null));}else{return _0x5dc2c3[_0xa8c7('0x6')](0x1f4)[_0xa8c7('0xb')]({'message':'Unknown\x20status'});}};exports[_0xa8c7('0x1e')]=function(_0x39f51b,_0x35216d){if(_0x39f51b['body']['id']){delete _0x39f51b[_0xa8c7('0x15')]['id'];}if(_0x39f51b[_0xa8c7('0x1f')]['id']){return pm2['delete'](_0x39f51b[_0xa8c7('0x1f')]['id'])['then'](function(_0x1f9b4c){pm2[_0xa8c7('0x20')]();return _0x1f9b4c[0x0];})[_0xa8c7('0x11')](respondWithResult(_0x35216d,null))[_0xa8c7('0x13')](handleError(_0x35216d,null));}else{return _0x35216d[_0xa8c7('0x6')](0x1f4)[_0xa8c7('0xb')]({'message':_0xa8c7('0x21')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 850d32b..0639bb8 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 _0x83d0=['../../components/interaction/service','multer','util','path','connect-timeout','express','Router'];(function(_0x59b07b,_0x441915){var _0x187631=function(_0x199c30){while(--_0x199c30){_0x59b07b['push'](_0x59b07b['shift']());}};_0x187631(++_0x441915);}(_0x83d0,0xb7));var _0x083d=function(_0x3d987d,_0x522e0e){_0x3d987d=_0x3d987d-0x0;var _0x21f68a=_0x83d0[_0x3d987d];return _0x21f68a;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require(_0x083d('0x4'));var router=express[_0x083d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x083d('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x3837=['../../components/interaction/service','../../config/environment','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x133ff2,_0x5f02a1){var _0x22851d=function(_0x482b4a){while(--_0x482b4a){_0x133ff2['push'](_0x133ff2['shift']());}};_0x22851d(++_0x5f02a1);}(_0x3837,0x1d1));var _0x7383=function(_0x2c2721,_0x1b30bc){_0x2c2721=_0x2c2721-0x0;var _0x15ac56=_0x3837[_0x2c2721];return _0x15ac56;};'use strict';var multer=require('multer');var util=require(_0x7383('0x0'));var path=require('path');var timeout=require(_0x7383('0x1'));var express=require('express');var router=express[_0x7383('0x2')]();var auth=require(_0x7383('0x3'));var interaction=require(_0x7383('0x4'));var config=require(_0x7383('0x5'));module[_0x7383('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 1f2270f..38a9667 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 _0xeab4=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0x4e8947,_0x5ca04d){var _0x29abde=function(_0x4c5158){while(--_0x4c5158){_0x4e8947['push'](_0x4e8947['shift']());}};_0x29abde(++_0x5ca04d);}(_0xeab4,0x1ae));var _0x4eab=function(_0x5b4359,_0x319ac7){_0x5b4359=_0x5b4359-0x0;var _0x1ecdd7=_0xeab4[_0x5b4359];return _0x1ecdd7;};'use strict';var Sequelize=require(_0x4eab('0x0'));module[_0x4eab('0x1')]={'state':{'type':Sequelize[_0x4eab('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4eab('0x3')]},'uniqueid':{'type':Sequelize[_0x4eab('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4eab('0x3')]},'ringtime':{'type':Sequelize[_0x4eab('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4eab('0x4')]},'campaigntype':{'type':Sequelize[_0x4eab('0x4')]},'membername':{'type':Sequelize[_0x4eab('0x4')]}}; \ No newline at end of file +var _0x283c=['DATE','exports','STRING'];(function(_0x513a49,_0x1d8e56){var _0x24eb85=function(_0xce4d73){while(--_0xce4d73){_0x513a49['push'](_0x513a49['shift']());}};_0x24eb85(++_0x1d8e56);}(_0x283c,0x1ed));var _0xc283=function(_0x5a5696,_0x731ba2){_0x5a5696=_0x5a5696-0x0;var _0x538116=_0x283c[_0x5a5696];return _0x538116;};'use strict';var Sequelize=require('sequelize');module[_0xc283('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xc283('0x1')]},'scheduledat':{'type':Sequelize[_0xc283('0x2')]},'uniqueid':{'type':Sequelize[_0xc283('0x1')]},'starttime':{'type':Sequelize[_0xc283('0x2')]},'responsetime':{'type':Sequelize[_0xc283('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc283('0x1')]},'campaigntype':{'type':Sequelize[_0xc283('0x1')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 01bc9d2..f63c90e 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 _0x6aac=['../../config/environment','exports','define','ReportAgentPreview','util','../../config/logger','api','moment','bluebird'];(function(_0x53ecfa,_0x1a1a01){var _0x302607=function(_0x1435c7){while(--_0x1435c7){_0x53ecfa['push'](_0x53ecfa['shift']());}};_0x302607(++_0x1a1a01);}(_0x6aac,0x13f));var _0xc6aa=function(_0x4cc5a9,_0x198cd3){_0x4cc5a9=_0x4cc5a9-0x0;var _0x14c452=_0x6aac[_0x4cc5a9];return _0x14c452;};'use strict';var _=require('lodash');var util=require(_0xc6aa('0x0'));var logger=require(_0xc6aa('0x1'))(_0xc6aa('0x2'));var moment=require(_0xc6aa('0x3'));var BPromise=require(_0xc6aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6aa('0x5'));var attributes=require('./reportAgentPreview.attributes');module[_0xc6aa('0x6')]=function(_0x5a1149,_0x440eec){return _0x5a1149[_0xc6aa('0x7')](_0xc6aa('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e0=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xc79fa4,_0x19b199){var _0x55b3ba=function(_0x22d15c){while(--_0x22d15c){_0xc79fa4['push'](_0xc79fa4['shift']());}};_0x55b3ba(++_0x19b199);}(_0xd0e0,0x7b));var _0x0d0e=function(_0x62e92e,_0x52c90c){_0x62e92e=_0x62e92e-0x0;var _0x3efcb3=_0xd0e0[_0x62e92e];return _0x3efcb3;};'use strict';var _=require(_0x0d0e('0x0'));var util=require(_0x0d0e('0x1'));var logger=require(_0x0d0e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0d0e('0x3'));var rp=require(_0x0d0e('0x4'));var fs=require('fs');var path=require(_0x0d0e('0x5'));var rimraf=require(_0x0d0e('0x6'));var config=require(_0x0d0e('0x7'));var attributes=require(_0x0d0e('0x8'));module[_0x0d0e('0x9')]=function(_0x301222,_0x4f5e91){return _0x301222[_0x0d0e('0xa')](_0x0d0e('0xb'),attributes,{'tableName':_0x0d0e('0xc'),'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 6f30f88..f73f3f1 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 _0x93c8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a6b5,_0x4695fd){var _0x5eeead=function(_0x1df9c9){while(--_0x1df9c9){_0x20a6b5['push'](_0x20a6b5['shift']());}};_0x5eeead(++_0x4695fd);}(_0x93c8,0x119));var _0x893c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x93c8[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x893c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x893c('0x1'));var rs=require(_0x893c('0x2'));var fs=require('fs');var Redis=require(_0x893c('0x3'));var db=require(_0x893c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x893c('0x5'))(_0x893c('0x6'));var config=require(_0x893c('0x7'));var jayson=require(_0x893c('0x8'));var client=jayson[_0x893c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x949a9c,_0x53a511,_0x223a8d){return new BPromise(function(_0x11f1a5,_0x41921e){return client['request'](_0x949a9c,_0x223a8d)[_0x893c('0xa')](function(_0x4b853f){logger['info'](_0x893c('0xb'),_0x53a511,_0x893c('0xc'));logger[_0x893c('0xd')](_0x893c('0xe'),_0x53a511,_0x893c('0xc'),JSON['stringify'](_0x4b853f));if(_0x4b853f['error']){if(_0x4b853f['error']['code']===0x1f4){logger[_0x893c('0xf')](_0x893c('0xb'),_0x53a511,_0x4b853f[_0x893c('0xf')][_0x893c('0x10')]);return _0x41921e(_0x4b853f[_0x893c('0xf')]['message']);}logger[_0x893c('0xf')](_0x893c('0xb'),_0x53a511,_0x4b853f[_0x893c('0xf')][_0x893c('0x10')]);return _0x11f1a5(_0x4b853f[_0x893c('0xf')][_0x893c('0x10')]);}else{logger[_0x893c('0x11')](_0x893c('0xb'),_0x53a511,_0x893c('0xc'));_0x11f1a5(_0x4b853f[_0x893c('0x12')][_0x893c('0x10')]);}})[_0x893c('0x13')](function(_0x42ef18){logger[_0x893c('0xf')](_0x893c('0xb'),_0x53a511,_0x42ef18);_0x41921e(_0x42ef18);});});}exports[_0x893c('0x14')]=function(_0x5b316c){var _0x5079fb=this;return new Promise(function(_0x13e61c,_0x2cefe2){return db[_0x893c('0x15')][_0x893c('0x16')](_0x5b316c['body'],{'raw':_0x5b316c[_0x893c('0x17')]?_0x5b316c[_0x893c('0x17')][_0x893c('0x18')]===undefined?!![]:![]:!![]})[_0x893c('0xa')](function(_0x341e45){logger[_0x893c('0x11')]('CreateReportAgentPreview',_0x5b316c);logger[_0x893c('0xd')](_0x893c('0x14'),_0x5b316c,JSON[_0x893c('0x19')](_0x341e45));_0x13e61c(_0x341e45);})[_0x893c('0x13')](function(_0x336b0e){logger[_0x893c('0xf')]('CreateReportAgentPreview',_0x336b0e[_0x893c('0x10')],_0x5b316c);_0x2cefe2(_0x5079fb[_0x893c('0xf')](0x1f4,_0x336b0e['message']));});});}; \ No newline at end of file +var _0x7b7a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x2d554f,_0x284acd){var _0x579473=function(_0x4f155c){while(--_0x4f155c){_0x2d554f['push'](_0x2d554f['shift']());}};_0x579473(++_0x284acd);}(_0x7b7a,0x1cb));var _0xa7b7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7b7a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa7b7('0x0'));var util=require(_0xa7b7('0x1'));var moment=require(_0xa7b7('0x2'));var BPromise=require(_0xa7b7('0x3'));var rs=require(_0xa7b7('0x4'));var fs=require('fs');var Redis=require(_0xa7b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7b7('0x6'));var logger=require(_0xa7b7('0x7'))(_0xa7b7('0x8'));var config=require(_0xa7b7('0x9'));var jayson=require(_0xa7b7('0xa'));var client=jayson['client'][_0xa7b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x340d46,_0x4979c3,_0x495c1b){return new BPromise(function(_0x41b493,_0x377068){return client[_0xa7b7('0xc')](_0x340d46,_0x495c1b)[_0xa7b7('0xd')](function(_0x111aa1){logger[_0xa7b7('0xe')](_0xa7b7('0xf'),_0x4979c3,_0xa7b7('0x10'));logger[_0xa7b7('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4979c3,'request\x20sent',JSON[_0xa7b7('0x12')](_0x111aa1));if(_0x111aa1[_0xa7b7('0x13')]){if(_0x111aa1[_0xa7b7('0x13')][_0xa7b7('0x14')]===0x1f4){logger[_0xa7b7('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x4979c3,_0x111aa1[_0xa7b7('0x13')][_0xa7b7('0x15')]);return _0x377068(_0x111aa1[_0xa7b7('0x13')][_0xa7b7('0x15')]);}logger[_0xa7b7('0x13')](_0xa7b7('0xf'),_0x4979c3,_0x111aa1['error'][_0xa7b7('0x15')]);return _0x41b493(_0x111aa1[_0xa7b7('0x13')]['message']);}else{logger[_0xa7b7('0xe')](_0xa7b7('0xf'),_0x4979c3,_0xa7b7('0x10'));_0x41b493(_0x111aa1[_0xa7b7('0x16')][_0xa7b7('0x15')]);}})[_0xa7b7('0x17')](function(_0x411ba5){logger[_0xa7b7('0x13')](_0xa7b7('0xf'),_0x4979c3,_0x411ba5);_0x377068(_0x411ba5);});});}exports[_0xa7b7('0x18')]=function(_0x274522){var _0x3ce32b=this;return new Promise(function(_0x596ffb,_0x4f0474){return db[_0xa7b7('0x19')][_0xa7b7('0x1a')](_0x274522[_0xa7b7('0x1b')],{'raw':_0x274522['options']?_0x274522['options'][_0xa7b7('0x1c')]===undefined?!![]:![]:!![]})[_0xa7b7('0xd')](function(_0x12b937){logger[_0xa7b7('0xe')](_0xa7b7('0x18'),_0x274522);logger[_0xa7b7('0x11')](_0xa7b7('0x18'),_0x274522,JSON['stringify'](_0x12b937));_0x596ffb(_0x12b937);})[_0xa7b7('0x17')](function(_0x1734a1){logger[_0xa7b7('0x13')](_0xa7b7('0x18'),_0x1734a1[_0xa7b7('0x15')],_0x274522);_0x4f0474(_0x3ce32b[_0xa7b7('0x13')](0x1f4,_0x1734a1[_0xa7b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 788a540..a5c429c 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 _0x18b8=['/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions'];(function(_0x57a594,_0x4df523){var _0x34428c=function(_0x1fc32e){while(--_0x1fc32e){_0x57a594['push'](_0x57a594['shift']());}};_0x34428c(++_0x4df523);}(_0x18b8,0x1bf));var _0x818b=function(_0xcf9bae,_0x1c6852){_0xcf9bae=_0xcf9bae-0x0;var _0x5212a5=_0x18b8[_0xcf9bae];return _0x5212a5;};'use strict';var multer=require(_0x818b('0x0'));var util=require('util');var path=require(_0x818b('0x1'));var express=require(_0x818b('0x2'));var router=express[_0x818b('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x818b('0x4'));router[_0x818b('0x5')]('/voice/channels',auth[_0x818b('0x6')](),controller[_0x818b('0x7')]);router[_0x818b('0x5')](_0x818b('0x8'),auth[_0x818b('0x6')](),controller[_0x818b('0x9')]);router[_0x818b('0x5')](_0x818b('0xa'),auth[_0x818b('0x6')](),controller[_0x818b('0xb')]);router[_0x818b('0x5')](_0x818b('0xc'),auth[_0x818b('0x6')](),controller[_0x818b('0xd')]);router[_0x818b('0x5')]('/chat/queues',auth[_0x818b('0x6')](),controller[_0x818b('0xe')]);router['get']('/mail/queues',auth[_0x818b('0x6')](),controller['mailQueues']);router[_0x818b('0x5')](_0x818b('0xf'),auth[_0x818b('0x6')](),controller[_0x818b('0x10')]);router[_0x818b('0x5')]('/openchannel/queues',auth[_0x818b('0x6')](),controller['openchannelQueues']);router[_0x818b('0x5')](_0x818b('0x11'),auth[_0x818b('0x6')](),controller[_0x818b('0x12')]);router[_0x818b('0x5')](_0x818b('0x13'),auth['isAuthenticated'](),controller[_0x818b('0x14')]);router[_0x818b('0x5')](_0x818b('0x15'),auth[_0x818b('0x6')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth[_0x818b('0x6')](),controller['voiceQueuesChannels']);router[_0x818b('0x5')](_0x818b('0x16'),auth[_0x818b('0x6')](),controller[_0x818b('0x17')]);router['get'](_0x818b('0x18'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x818b('0x5')](_0x818b('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x818b('0x5')](_0x818b('0x1a'),auth['isAuthenticated'](),controller[_0x818b('0x1b')]);router[_0x818b('0x5')](_0x818b('0x1c'),auth[_0x818b('0x6')](),controller[_0x818b('0x1d')]);router[_0x818b('0x5')](_0x818b('0x1e'),auth[_0x818b('0x6')](),controller[_0x818b('0x1f')]);router[_0x818b('0x5')]('/agents',auth['isAuthenticated'](),controller[_0x818b('0x20')]);router['put']('/agents/:id/capacity',auth[_0x818b('0x6')](),controller[_0x818b('0x21')]);router['get'](_0x818b('0x22'),auth['isAuthenticated'](),controller[_0x818b('0x23')]);router[_0x818b('0x5')](_0x818b('0x24'),auth[_0x818b('0x6')](),controller[_0x818b('0x25')]);router[_0x818b('0x5')](_0x818b('0x26'),auth[_0x818b('0x6')](),controller[_0x818b('0x27')]);router[_0x818b('0x5')](_0x818b('0x28'),auth['isAuthenticated'](),controller[_0x818b('0x29')]);router[_0x818b('0x5')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x818b('0x2a')]);router[_0x818b('0x5')](_0x818b('0x2b'),auth[_0x818b('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x818b('0x5')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x818b('0x2c')]);router['get'](_0x818b('0x2d'),auth['isAuthenticated'](),controller[_0x818b('0x2e')]);router['get'](_0x818b('0x2f'),auth[_0x818b('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0x818b('0x30')](_0x818b('0x31'),auth['isAuthenticated'](),controller['queueNotify'](_0x818b('0x32')));router[_0x818b('0x5')](_0x818b('0x33'),auth[_0x818b('0x6')](),controller[_0x818b('0x34')]);router[_0x818b('0x30')](_0x818b('0x35'),auth[_0x818b('0x6')](),controller[_0x818b('0x36')](_0x818b('0x37')));router[_0x818b('0x5')](_0x818b('0x38'),auth[_0x818b('0x6')](),controller[_0x818b('0x39')]);router[_0x818b('0x30')](_0x818b('0x3a'),auth['isAuthenticated'](),controller[_0x818b('0x36')](_0x818b('0x3b')));router[_0x818b('0x5')](_0x818b('0x3c'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x818b('0x30')](_0x818b('0x3d'),auth[_0x818b('0x6')](),controller['queueNotify'](_0x818b('0x3e')));router[_0x818b('0x5')](_0x818b('0x3f'),auth[_0x818b('0x6')](),controller['showOpenchannelQueues']);router[_0x818b('0x30')](_0x818b('0x40'),auth['isAuthenticated'](),controller[_0x818b('0x36')](_0x818b('0x41')));router[_0x818b('0x5')]('/sms/queues/:id',auth[_0x818b('0x6')](),controller[_0x818b('0x42')]);router['post'](_0x818b('0x43'),auth[_0x818b('0x6')](),controller[_0x818b('0x44')]);module[_0x818b('0x45')]=router; \ No newline at end of file +var _0x6174=['smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','util','path','Router','../../components/auth/service','./rpc.controller','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','get','/chat/queues','chatQueues','/mail/queues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions'];(function(_0x2627a9,_0x1e1686){var _0x5f1fb4=function(_0x2401ee){while(--_0x2401ee){_0x2627a9['push'](_0x2627a9['shift']());}};_0x5f1fb4(++_0x1e1686);}(_0x6174,0x1af));var _0x4617=function(_0xf0b17d,_0x16943d){_0xf0b17d=_0xf0b17d-0x0;var _0x322c37=_0x6174[_0xf0b17d];return _0x322c37;};'use strict';var multer=require('multer');var util=require(_0x4617('0x0'));var path=require(_0x4617('0x1'));var express=require('express');var router=express[_0x4617('0x2')]();var auth=require(_0x4617('0x3'));var controller=require(_0x4617('0x4'));router['get']('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0x4617('0x5'),auth[_0x4617('0x6')](),controller['voiceChannelMixMonitor']);router['get'](_0x4617('0x7'),auth['isAuthenticated'](),controller[_0x4617('0x8')]);router['get']('/voice/queues',auth[_0x4617('0x6')](),controller['voiceQueues']);router[_0x4617('0x9')](_0x4617('0xa'),auth[_0x4617('0x6')](),controller[_0x4617('0xb')]);router[_0x4617('0x9')](_0x4617('0xc'),auth[_0x4617('0x6')](),controller['mailQueues']);router[_0x4617('0x9')]('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router['get'](_0x4617('0xd'),auth[_0x4617('0x6')](),controller[_0x4617('0xe')]);router[_0x4617('0x9')](_0x4617('0xf'),auth[_0x4617('0x6')](),controller[_0x4617('0x10')]);router[_0x4617('0x9')](_0x4617('0x11'),auth['isAuthenticated'](),controller[_0x4617('0x12')]);router[_0x4617('0x9')]('/voice/queues/preview/:id',auth[_0x4617('0x6')](),controller[_0x4617('0x13')]);router[_0x4617('0x9')](_0x4617('0x14'),auth[_0x4617('0x6')](),controller[_0x4617('0x15')]);router['get'](_0x4617('0x16'),auth[_0x4617('0x6')](),controller[_0x4617('0x17')]);router[_0x4617('0x9')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x4617('0x18')]);router['get'](_0x4617('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x4617('0x9')]('/voice/queues/:id',auth[_0x4617('0x6')](),controller[_0x4617('0x1a')]);router[_0x4617('0x9')](_0x4617('0x1b'),auth[_0x4617('0x6')](),controller['outbound']);router[_0x4617('0x9')](_0x4617('0x1c'),auth[_0x4617('0x6')](),controller[_0x4617('0x1d')]);router[_0x4617('0x9')]('/agents',auth['isAuthenticated'](),controller['agents']);router[_0x4617('0x1e')](_0x4617('0x1f'),auth[_0x4617('0x6')](),controller[_0x4617('0x20')]);router[_0x4617('0x9')](_0x4617('0x21'),auth[_0x4617('0x6')](),controller['telephones']);router[_0x4617('0x9')](_0x4617('0x22'),auth[_0x4617('0x6')](),controller[_0x4617('0x23')]);router[_0x4617('0x9')](_0x4617('0x24'),auth['isAuthenticated'](),controller['campaigns']);router['get'](_0x4617('0x25'),auth[_0x4617('0x6')](),controller[_0x4617('0x26')]);router[_0x4617('0x9')](_0x4617('0x27'),auth[_0x4617('0x6')](),controller[_0x4617('0x28')]);router[_0x4617('0x9')](_0x4617('0x29'),auth['isAuthenticated'](),controller[_0x4617('0x2a')]);router[_0x4617('0x9')](_0x4617('0x2b'),auth[_0x4617('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x4617('0x9')](_0x4617('0x2c'),auth[_0x4617('0x6')](),controller[_0x4617('0x2d')]);router['get'](_0x4617('0x2e'),auth[_0x4617('0x6')](),controller[_0x4617('0x2f')]);router[_0x4617('0x30')](_0x4617('0x31'),auth['isAuthenticated'](),controller[_0x4617('0x32')](_0x4617('0x33')));router['get']('/mail/queues/:id',auth[_0x4617('0x6')](),controller[_0x4617('0x34')]);router['post'](_0x4617('0x35'),auth[_0x4617('0x6')](),controller[_0x4617('0x32')]('chat'));router[_0x4617('0x9')](_0x4617('0x36'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x4617('0x37'),auth['isAuthenticated'](),controller[_0x4617('0x32')](_0x4617('0x38')));router['get'](_0x4617('0x39'),auth[_0x4617('0x6')](),controller[_0x4617('0x3a')]);router[_0x4617('0x30')](_0x4617('0x3b'),auth[_0x4617('0x6')](),controller[_0x4617('0x32')](_0x4617('0x3c')));router[_0x4617('0x9')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x4617('0x3d')]);router['post'](_0x4617('0x3e'),auth[_0x4617('0x6')](),controller[_0x4617('0x32')](_0x4617('0x3f')));router[_0x4617('0x9')](_0x4617('0x40'),auth[_0x4617('0x6')](),controller[_0x4617('0x41')]);router[_0x4617('0x30')](_0x4617('0x42'),auth[_0x4617('0x6')](),controller['agentNotify']);module[_0x4617('0x43')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 051f1ca..6a3df92 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 _0x50c4=['FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','channel','User','messageId','InteractionId','From','agent','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','client','http','request','error','status','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','then','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','hasOwnProperty','MemberReport','findAll','interaction','format','length','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','faxAccounts'];(function(_0x19d1a5,_0x58e1b2){var _0x5458be=function(_0x12c2d9){while(--_0x12c2d9){_0x19d1a5['push'](_0x19d1a5['shift']());}};_0x5458be(++_0x58e1b2);}(_0x50c4,0x109));var _0x450c=function(_0xd02923,_0x7d3515){_0xd02923=_0xd02923-0x0;var _0x10ff2f=_0x50c4[_0xd02923];return _0x10ff2f;};'use strict';var BPromise=require(_0x450c('0x0'));var moment=require(_0x450c('0x1'));var _=require(_0x450c('0x2'));var util=require(_0x450c('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x450c('0x4'))(_0x450c('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x450c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x450c('0x6')][_0x450c('0x7')]({'port':0x232b});var routingClient=jayson[_0x450c('0x6')][_0x450c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x182f5a,_0x1b04ef,_0x5dc55b){return new BPromise(function(_0x1936fe,_0xc85e2b){var _0x35305c=_0x5dc55b?_0x5dc55b:amiClient;return _0x35305c[_0x450c('0x8')](_0x182f5a,_0x1b04ef)['then'](function(_0x379f8a){if(_0x379f8a['error']){if(_0x379f8a[_0x450c('0x9')]['code']===0x1f4){return _0xc85e2b(_0x379f8a[_0x450c('0x9')]['message']);}return _0x1936fe(_0x379f8a[_0x450c('0x9')]['message']);}else{_0x1936fe(_0x379f8a['result']);}})['catch'](function(_0x181ba2){_0xc85e2b(_0x181ba2);});});}function respondWithResult(_0x490edf,_0x19b201){_0x19b201=_0x19b201||0xc8;return function(_0xc8d277){if(_0xc8d277){return _0x490edf[_0x450c('0xa')](_0x19b201)['json'](_0xc8d277);}return _0x490edf[_0x450c('0xb')](0x194);};}function handleError(_0x536483,_0x9d5d64){_0x9d5d64=_0x9d5d64||0x1f4;return function(_0x2df86d){logger[_0x450c('0x9')](_0x2df86d['stack']);if(_0x2df86d[_0x450c('0xc')]){delete _0x2df86d[_0x450c('0xc')];}_0x536483[_0x450c('0xa')](_0x9d5d64)[_0x450c('0xd')](_0x2df86d);};}function findById(_0x33944e){return function(_0x25b8fd){if(!_[_0x450c('0xe')](_0x33944e)&&!_[_0x450c('0xe')](_0x25b8fd)&&!_[_0x450c('0xe')](_0x25b8fd[_0x450c('0xf')])){return _[_0x450c('0x10')](_0x25b8fd[_0x450c('0xf')],function(_0x3a3df2){return _0x3a3df2['id']==_0x33944e;});}return null;};}exports[_0x450c('0x11')]=function(_0xfca19a,_0x579417){return respondWithRpcPromise(_0x450c('0x12'),_0xfca19a[_0x450c('0x13')])['then'](respondWithResult(_0x579417,null))[_0x450c('0x14')](handleError(_0x579417,null));};exports[_0x450c('0x15')]=function(_0x2f1383,_0x27b10c){return respondWithRpcPromise(_0x450c('0x16'),_[_0x450c('0x17')](_0x2f1383[_0x450c('0x13')],_0x2f1383[_0x450c('0x18')]))['then'](respondWithResult(_0x27b10c,null))[_0x450c('0x14')](handleError(_0x27b10c,null));};exports[_0x450c('0x19')]=function(_0x2ae10f,_0x8c7c43){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x2ae10f[_0x450c('0x13')],_0x2ae10f[_0x450c('0x18')]))[_0x450c('0x1a')](respondWithResult(_0x8c7c43,null))['catch'](handleError(_0x8c7c43,null));};exports['voiceQueues']=function(_0x13c3c2,_0x347133){return respondWithRpcPromise(_0x450c('0x1b'),_0x13c3c2[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0x347133,null))[_0x450c('0x14')](handleError(_0x347133,null));};exports[_0x450c('0x1c')]=function(_0x30a528,_0x248066){return respondWithRpcPromise(_0x450c('0x1b'),_0x30a528['query'])[_0x450c('0x1a')](findById(_0x30a528[_0x450c('0x18')]['id']))[_0x450c('0x1a')](respondWithResult(_0x248066,null))[_0x450c('0x14')](handleError(_0x248066,null));};exports[_0x450c('0x1d')]=function(_0x204692,_0x209d2a){return respondWithRpcPromise(_0x450c('0x1e'),_[_0x450c('0x17')](_0x204692[_0x450c('0x13')],_0x204692[_0x450c('0x18')]))[_0x450c('0x1a')](respondWithResult(_0x209d2a,null))[_0x450c('0x14')](handleError(_0x209d2a,null));};exports['voiceQueuesChannels']=function(_0x1ef679,_0xfe42f8){return respondWithRpcPromise(_0x450c('0x1f'),_0x1ef679[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0xfe42f8,null))[_0x450c('0x14')](handleError(_0xfe42f8,null));};exports[_0x450c('0x20')]=function(_0x4e9d9f,_0x5235a1){return respondWithRpcPromise(_0x450c('0x21'),_[_0x450c('0x17')](_0x4e9d9f[_0x450c('0x13')],_0x4e9d9f[_0x450c('0x18')]))[_0x450c('0x1a')](respondWithResult(_0x5235a1,null))[_0x450c('0x14')](handleError(_0x5235a1,null));};exports[_0x450c('0x22')]=function(_0x5940b3,_0x5b08ba){return respondWithRpcPromise(_0x450c('0x23'),_[_0x450c('0x17')](_0x5940b3['query'],_0x5940b3['params']))[_0x450c('0x1a')](respondWithResult(_0x5b08ba,null))['catch'](handleError(_0x5b08ba,null));};exports['voiceQueuesChannelRedirect']=function(_0xec06f0,_0x207bc3){return respondWithRpcPromise(_0x450c('0x24'),_['merge'](_0xec06f0[_0x450c('0x13')],_0xec06f0[_0x450c('0x18')]))[_0x450c('0x1a')](respondWithResult(_0x207bc3,null))[_0x450c('0x14')](handleError(_0x207bc3,null));};exports[_0x450c('0x25')]=function(_0x5d5fd2,_0xe0d07c){return respondWithRpcPromise(_0x450c('0x26'),_0x5d5fd2['query'])[_0x450c('0x1a')](respondWithResult(_0xe0d07c,null))[_0x450c('0x14')](handleError(_0xe0d07c,null));};exports[_0x450c('0x27')]=function(_0x1fb394,_0x18ee93){return respondWithRpcPromise(_0x450c('0x28'),_0x1fb394[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0x18ee93,null))[_0x450c('0x14')](handleError(_0x18ee93,null));};exports[_0x450c('0x29')]=function(_0x29a44e,_0x5d55e0){var _0x3564d1;return respondWithRpcPromise(_0x450c('0x2a'),_0x29a44e[_0x450c('0x13')])[_0x450c('0x1a')](function(_0x2a54ed){_0x3564d1=_0x2a54ed;return respondWithRpcPromise(_0x450c('0x2a'),_0x29a44e['query'],routingClient);})[_0x450c('0x1a')](function(_0x1b88bf){return _[_0x450c('0x17')]({},_0x1b88bf,_0x3564d1);})[_0x450c('0x1a')](respondWithResult(_0x5d55e0,null))[_0x450c('0x14')](handleError(_0x5d55e0,null));};exports[_0x450c('0x2b')]=function(_0xdccd2d,_0x1c575a){if(_0xdccd2d[_0x450c('0x2c')]&&_0xdccd2d['body']['interaction']&&_0xdccd2d[_0x450c('0x2d')]&&_0xdccd2d[_0x450c('0x2d')]['name']){for(var _0xa9f9f3 in _0xdccd2d['body']['interaction']){if(_0xdccd2d[_0x450c('0x2c')]['interaction'][_0x450c('0x2e')](_0xa9f9f3)){db[_0x450c('0x2f')][_0x450c('0x30')]({'where':{'channel':_0xa9f9f3,'membername':_0xdccd2d[_0x450c('0x2d')][_0x450c('0xc')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xdccd2d['body'][_0x450c('0x31')][_0xa9f9f3]&&_0xdccd2d[_0x450c('0x2c')][_0x450c('0x31')][_0xa9f9f3]['length']?{'$notIn':_0xdccd2d['body']['interaction'][_0xa9f9f3]}:{'$ne':null}}})['then'](function(_0x123ebc){var _0x4232e6=moment()[_0x450c('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2d4e62=0x0,_0x217eb6=_0x123ebc[_0x450c('0x33')];_0x2d4e62<_0x217eb6;_0x2d4e62+=0x1){_0x123ebc[_0x2d4e62][_0x450c('0x34')]({'exitAt':_0x4232e6});}});for(var _0x2a0794=0x0;_0x2a0794<_0xdccd2d[_0x450c('0x2c')][_0x450c('0x31')][_0xa9f9f3]['length'];_0x2a0794+=0x1){db[_0x450c('0x2f')][_0x450c('0x35')]({'where':{'channel':_0xa9f9f3,'membername':_0xdccd2d[_0x450c('0x2d')][_0x450c('0xc')],'type':_0x450c('0x36'),'uniqueid':_0xdccd2d[_0x450c('0x2c')][_0x450c('0x31')][_0xa9f9f3][_0x2a0794],'exitAt':null},'defaults':{'channel':_0xa9f9f3,'membername':_0xdccd2d[_0x450c('0x2d')][_0x450c('0xc')],'interface':_[_0x450c('0xe')](_0xdccd2d[_0x450c('0x2d')][_0x450c('0x37')])?util['format'](_0x450c('0x38'),_0xdccd2d['user'][_0x450c('0xc')]):_0xdccd2d[_0x450c('0x2d')][_0x450c('0x37')],'type':_0x450c('0x36'),'enterAt':moment()[_0x450c('0x32')](_0x450c('0x39')),'role':'agent','internal':_0xdccd2d[_0x450c('0x2d')]['internal'],'uniqueid':_0xdccd2d['body'][_0x450c('0x31')][_0xa9f9f3][_0x2a0794]}});}}}}return respondWithRpcPromise(_0x450c('0x3a'),{'id':_0xdccd2d[_0x450c('0x18')]['id'],'capacity':_0xdccd2d[_0x450c('0x2c')][_0x450c('0x3b')]},routingClient)[_0x450c('0x1a')](respondWithResult(_0x1c575a,null))[_0x450c('0x14')](handleError(_0x1c575a,null));};exports['telephones']=function(_0x390c13,_0x39b8eb){return respondWithRpcPromise(_0x450c('0x3c'),_0x390c13[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0x39b8eb,null))['catch'](handleError(_0x39b8eb,null));};exports[_0x450c('0x3d')]=function(_0x3b7ac9,_0x3dddbb){return respondWithRpcPromise(_0x450c('0x3e'),_0x3b7ac9[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0x3dddbb,null))[_0x450c('0x14')](handleError(_0x3dddbb,null));};exports[_0x450c('0x3f')]=function(_0x53a93b,_0x20c7b7){return respondWithRpcPromise(_0x450c('0x40'),_0x53a93b[_0x450c('0x13')])[_0x450c('0x1a')](respondWithResult(_0x20c7b7,null))[_0x450c('0x14')](handleError(_0x20c7b7,null));};exports[_0x450c('0x41')]=function(_0x5bff34,_0x15c909){return respondWithRpcPromise(_0x450c('0x42'),_0x5bff34['query'],routingClient)['then'](respondWithResult(_0x15c909,null))[_0x450c('0x14')](handleError(_0x15c909,null));};exports[_0x450c('0x43')]=function(_0x37b58c,_0x3bad67){return respondWithRpcPromise(_0x450c('0x42'),_0x37b58c[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](findById(_0x37b58c['params']['id']))[_0x450c('0x1a')](respondWithResult(_0x3bad67,null))['catch'](handleError(_0x3bad67,null));};exports[_0x450c('0x44')]=function(_0x3c22fe,_0x1ee085){return respondWithRpcPromise(_0x450c('0x45'),_0x3c22fe['query'],routingClient)[_0x450c('0x1a')](respondWithResult(_0x1ee085,null))[_0x450c('0x14')](handleError(_0x1ee085,null));};exports['showMailQueues']=function(_0x1343c8,_0x4ec579){return respondWithRpcPromise(_0x450c('0x45'),_0x1343c8[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](findById(_0x1343c8[_0x450c('0x18')]['id']))[_0x450c('0x1a')](respondWithResult(_0x4ec579,null))[_0x450c('0x14')](handleError(_0x4ec579,null));};exports[_0x450c('0x46')]=function(_0x36297a,_0x22cf64){return respondWithRpcPromise(_0x450c('0x47'),_0x36297a[_0x450c('0x13')],mailClient)['then'](respondWithResult(_0x22cf64,null))[_0x450c('0x14')](handleError(_0x22cf64,null));};exports[_0x450c('0x48')]=function(_0x950922,_0x11e527){return respondWithRpcPromise(_0x450c('0x49'),_0x950922['query'],routingClient)[_0x450c('0x1a')](respondWithResult(_0x11e527,null))[_0x450c('0x14')](handleError(_0x11e527,null));};exports[_0x450c('0x4a')]=function(_0x5811e9,_0x27163d){return respondWithRpcPromise(_0x450c('0x49'),_0x5811e9[_0x450c('0x13')],routingClient)['then'](findById(_0x5811e9[_0x450c('0x18')]['id']))[_0x450c('0x1a')](respondWithResult(_0x27163d,null))[_0x450c('0x14')](handleError(_0x27163d,null));};exports[_0x450c('0x4b')]=function(_0x301bea,_0x571094){return respondWithRpcPromise(_0x450c('0x4c'),_0x301bea[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](respondWithResult(_0x571094,null))[_0x450c('0x14')](handleError(_0x571094,null));};exports['showSmsQueues']=function(_0x25b29b,_0x56e08c){return respondWithRpcPromise('SmsQueues',_0x25b29b[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](findById(_0x25b29b[_0x450c('0x18')]['id']))[_0x450c('0x1a')](respondWithResult(_0x56e08c,null))['catch'](handleError(_0x56e08c,null));};exports[_0x450c('0x4d')]=function(_0x16ce3b,_0x4e6806){return respondWithRpcPromise(_0x450c('0x4e'),_0x16ce3b['query'],routingClient)[_0x450c('0x1a')](respondWithResult(_0x4e6806,null))['catch'](handleError(_0x4e6806,null));};exports['showFaxQueues']=function(_0x3828e4,_0x791f08){return respondWithRpcPromise(_0x450c('0x4e'),_0x3828e4['query'],routingClient)[_0x450c('0x1a')](findById(_0x3828e4[_0x450c('0x18')]['id']))[_0x450c('0x1a')](respondWithResult(_0x791f08,null))[_0x450c('0x14')](handleError(_0x791f08,null));};exports[_0x450c('0x4f')]=function(_0x599b52,_0x429cbe){return respondWithRpcPromise(_0x450c('0x50'),_0x599b52[_0x450c('0x13')])['then'](respondWithResult(_0x429cbe,null))[_0x450c('0x14')](handleError(_0x429cbe,null));};exports[_0x450c('0x51')]=function(_0x1fac6c,_0x24055e){return respondWithRpcPromise(_0x450c('0x52'),_0x1fac6c[_0x450c('0x13')],routingClient)['then'](respondWithResult(_0x24055e,null))[_0x450c('0x14')](handleError(_0x24055e,null));};exports[_0x450c('0x53')]=function(_0x1ada1f,_0x57a24e){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1ada1f[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](respondWithResult(_0x57a24e,null))['catch'](handleError(_0x57a24e,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x14c719,_0x48d661){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14c719[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](respondWithResult(_0x48d661,null))[_0x450c('0x14')](handleError(_0x48d661,null));};exports[_0x450c('0x54')]=function(_0x33c581,_0x3e7cbc){return respondWithRpcPromise(_0x450c('0x55'),_0x33c581[_0x450c('0x13')],routingClient)['then'](respondWithResult(_0x3e7cbc,null))[_0x450c('0x14')](handleError(_0x3e7cbc,null));};exports[_0x450c('0x56')]=function(_0x325241,_0x1f7c10){return respondWithRpcPromise(_0x450c('0x57'),_0x325241[_0x450c('0x13')],routingClient)[_0x450c('0x1a')](respondWithResult(_0x1f7c10,null))['catch'](handleError(_0x1f7c10,null));};exports[_0x450c('0x58')]=function(_0x98b454){return function(_0x2cdaf1,_0x2963d7){var _0x274991,_0x165eff;var _0x3f7ec5=_[_0x450c('0x59')](_0x98b454);var _0x143bcf=_0x98b454===_0x450c('0x5a')?_0x450c('0x5b'):'Account';return db[_0x3f7ec5+_0x450c('0x5c')][_0x450c('0x5d')]({'raw':!![],'where':{'id':_0x2cdaf1['params']['id']}})[_0x450c('0x1a')](function(_0xcfcee){if(_['isNil'](_0xcfcee)){throw new Error(_0x3f7ec5+_0x450c('0x5e'));}_0x274991=_0xcfcee;return db[_0x3f7ec5+_0x450c('0x5f')][_0x450c('0x5d')]({'where':{'id':_0x2cdaf1[_0x450c('0x2c')]['messageId']},'include':[{'model':db[_0x3f7ec5+_0x450c('0x60')],'as':_0x450c('0x60')},{'model':db[_0x3f7ec5+_0x143bcf],'as':_0x450c('0x61')}]});})['then'](function(_0x90904a){if(_['isNil'](_0x90904a)){throw new Error(_0x3f7ec5+_0x450c('0x62'));}_0x165eff=_0x90904a;return _0x90904a[_0x450c('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x450c('0x1a')](function(){var _0x4933fa={'uniqueid':_0x98b454+'.'+_0x165eff['id']+'.'+_0x165eff['Interaction']['id'],'FromUserId':_0x2cdaf1['user']['id'],'type':'queue'};_0x4933fa[_0x3f7ec5+_0x450c('0x64')]=_0x165eff['id'];_0x4933fa[_0x3f7ec5+'InteractionId']=_0x165eff[_0x450c('0x60')]['id'];_0x4933fa['From'+_0x3f7ec5+_0x143bcf+'Id']=_0x165eff[_0x450c('0x61')]['id'];_0x4933fa['To'+_0x3f7ec5+_0x450c('0x65')]=_0x274991['id'];return db[_0x3f7ec5+_0x450c('0x66')][_0x450c('0x67')](_0x4933fa);})['then'](function(){return respondWithRpcPromise(_0x450c('0x68'),{'channel':_0x98b454,'interaction':_0x165eff[_0x450c('0x60')],'message':_0x165eff,'account':_0x165eff['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x450c('0x69'),'appdata':_0x274991[_0x450c('0xc')]+','+(_0x165eff[_0x450c('0x61')][_0x450c('0x6a')]||0x12c),'interval':_0x450c('0x6b')}]},routingClient);})[_0x450c('0x1a')](respondWithResult(_0x2963d7,null))[_0x450c('0x14')](handleError(_0x2963d7,null));};};exports['agentNotify']=function(_0x16101b,_0x519df1){var _0x3fd3b7,_0x4cebb9;if(_[_0x450c('0xe')](_0x16101b[_0x450c('0x2c')][_0x450c('0x6c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x564e28=_0x16101b[_0x450c('0x2c')][_0x450c('0x6c')];var _0x23617d=_['capitalize'](_0x564e28);var _0x47eecc=_0x564e28==='chat'?_0x450c('0x5b'):'Account';return db[_0x450c('0x6d')][_0x450c('0x5d')]({'raw':!![],'where':{'id':_0x16101b['params']['id'],'role':'agent'}})['then'](function(_0x2dcf2f){if(_['isNil'](_0x2dcf2f)){throw new Error('Agent\x20not\x20found');}_0x3fd3b7=_0x2dcf2f;return db[_0x23617d+'Message']['findOne']({'where':{'id':_0x16101b[_0x450c('0x2c')][_0x450c('0x6e')]},'include':[{'model':db[_0x23617d+_0x450c('0x60')],'as':_0x450c('0x60')},{'model':db[_0x23617d+_0x47eecc],'as':_0x450c('0x61')}]});})[_0x450c('0x1a')](function(_0x5c6d77){if(_[_0x450c('0xe')](_0x5c6d77)){throw new Error(_0x23617d+_0x450c('0x62'));}_0x4cebb9=_0x5c6d77;return _0x5c6d77[_0x450c('0x63')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x242b4e={'uniqueid':_0x564e28+'.'+_0x4cebb9['id']+'.'+_0x4cebb9['Interaction']['id'],'FromUserId':_0x16101b[_0x450c('0x2d')]['id'],'type':_0x450c('0x69'),'ToUserId':_0x3fd3b7['id']};_0x242b4e[_0x23617d+_0x450c('0x64')]=_0x4cebb9['id'];_0x242b4e[_0x23617d+_0x450c('0x6f')]=_0x4cebb9[_0x450c('0x60')]['id'];_0x242b4e[_0x450c('0x70')+_0x23617d+_0x47eecc+'Id']=_0x4cebb9[_0x450c('0x61')]['id'];return db[_0x23617d+'TransferReport'][_0x450c('0x67')](_0x242b4e);})[_0x450c('0x1a')](function(){return respondWithRpcPromise(_0x450c('0x68'),{'channel':_0x564e28,'interaction':_0x4cebb9['Interaction'],'message':_0x4cebb9,'account':_0x4cebb9[_0x450c('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x450c('0x71'),'appdata':_0x3fd3b7[_0x450c('0xc')]+','+(_0x4cebb9[_0x450c('0x61')][_0x450c('0x72')]||0x12c),'interval':_0x450c('0x6b')}]},routingClient);})['then'](respondWithResult(_0x519df1,null))[_0x450c('0x14')](handleError(_0x519df1,null));}; \ No newline at end of file +var _0x3815=['VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup'];(function(_0x17f1ea,_0x5a815f){var _0x494db7=function(_0x2c6831){while(--_0x2c6831){_0x17f1ea['push'](_0x17f1ea['shift']());}};_0x494db7(++_0x5a815f);}(_0x3815,0x138));var _0x5381=function(_0x3194b2,_0x2120ef){_0x3194b2=_0x3194b2-0x0;var _0x31501d=_0x3815[_0x3194b2];return _0x31501d;};'use strict';var BPromise=require(_0x5381('0x0'));var moment=require(_0x5381('0x1'));var _=require(_0x5381('0x2'));var util=require(_0x5381('0x3'));var db=require(_0x5381('0x4'))['db'];var logger=require(_0x5381('0x5'))('api');var jayson=require(_0x5381('0x6'));var amiClient=jayson[_0x5381('0x7')][_0x5381('0x8')]({'port':0x232a});var mailClient=jayson[_0x5381('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x5381('0x7')][_0x5381('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x24d270,_0x4106ee,_0x2dbba7){return new BPromise(function(_0x50369a,_0x20b310){var _0x2217b7=_0x2dbba7?_0x2dbba7:amiClient;return _0x2217b7[_0x5381('0x9')](_0x24d270,_0x4106ee)[_0x5381('0xa')](function(_0x425896){if(_0x425896['error']){if(_0x425896[_0x5381('0xb')][_0x5381('0xc')]===0x1f4){return _0x20b310(_0x425896['error']['message']);}return _0x50369a(_0x425896[_0x5381('0xb')][_0x5381('0xd')]);}else{_0x50369a(_0x425896[_0x5381('0xe')]);}})[_0x5381('0xf')](function(_0x5f09ea){_0x20b310(_0x5f09ea);});});}function respondWithResult(_0x9b6019,_0x4e0351){_0x4e0351=_0x4e0351||0xc8;return function(_0x30bf8c){if(_0x30bf8c){return _0x9b6019['status'](_0x4e0351)[_0x5381('0x10')](_0x30bf8c);}return _0x9b6019[_0x5381('0x11')](0x194);};}function handleError(_0x116696,_0x3382f7){_0x3382f7=_0x3382f7||0x1f4;return function(_0x3ebbb9){logger['error'](_0x3ebbb9[_0x5381('0x12')]);if(_0x3ebbb9[_0x5381('0x13')]){delete _0x3ebbb9[_0x5381('0x13')];}_0x116696[_0x5381('0x14')](_0x3382f7)['send'](_0x3ebbb9);};}function findById(_0x2e27ad){return function(_0x23eccf){if(!_['isNil'](_0x2e27ad)&&!_['isNil'](_0x23eccf)&&!_[_0x5381('0x15')](_0x23eccf['rows'])){return _[_0x5381('0x16')](_0x23eccf[_0x5381('0x17')],function(_0x5adffa){return _0x5adffa['id']==_0x2e27ad;});}return null;};}exports[_0x5381('0x18')]=function(_0x52e650,_0x27b2d0){return respondWithRpcPromise(_0x5381('0x19'),_0x52e650[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0x27b2d0,null))[_0x5381('0xf')](handleError(_0x27b2d0,null));};exports[_0x5381('0x1b')]=function(_0x5c6426,_0xbc8e9d){return respondWithRpcPromise(_0x5381('0x1c'),_[_0x5381('0x1d')](_0x5c6426[_0x5381('0x1a')],_0x5c6426['params']))[_0x5381('0xa')](respondWithResult(_0xbc8e9d,null))['catch'](handleError(_0xbc8e9d,null));};exports[_0x5381('0x1e')]=function(_0x98d2ad,_0x378a7d){return respondWithRpcPromise(_0x5381('0x1f'),_[_0x5381('0x1d')](_0x98d2ad['query'],_0x98d2ad[_0x5381('0x20')]))[_0x5381('0xa')](respondWithResult(_0x378a7d,null))['catch'](handleError(_0x378a7d,null));};exports[_0x5381('0x21')]=function(_0x72c9c2,_0xfb9c08){return respondWithRpcPromise(_0x5381('0x22'),_0x72c9c2[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0xfb9c08,null))[_0x5381('0xf')](handleError(_0xfb9c08,null));};exports[_0x5381('0x23')]=function(_0x4dd4d1,_0x105bbf){return respondWithRpcPromise('VoiceQueues',_0x4dd4d1[_0x5381('0x1a')])[_0x5381('0xa')](findById(_0x4dd4d1[_0x5381('0x20')]['id']))[_0x5381('0xa')](respondWithResult(_0x105bbf,null))[_0x5381('0xf')](handleError(_0x105bbf,null));};exports[_0x5381('0x24')]=function(_0x4c92ad,_0x42adf6){return respondWithRpcPromise(_0x5381('0x25'),_[_0x5381('0x1d')](_0x4c92ad[_0x5381('0x1a')],_0x4c92ad[_0x5381('0x20')]))['then'](respondWithResult(_0x42adf6,null))['catch'](handleError(_0x42adf6,null));};exports[_0x5381('0x26')]=function(_0x4a4b92,_0xdb3d97){return respondWithRpcPromise(_0x5381('0x27'),_0x4a4b92[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0xdb3d97,null))['catch'](handleError(_0xdb3d97,null));};exports['voiceQueuesChannel']=function(_0x52ae18,_0x59d8b5){return respondWithRpcPromise(_0x5381('0x28'),_['merge'](_0x52ae18[_0x5381('0x1a')],_0x52ae18[_0x5381('0x20')]))['then'](respondWithResult(_0x59d8b5,null))['catch'](handleError(_0x59d8b5,null));};exports['voiceQueuesChannelHangup']=function(_0x574225,_0x441a2a){return respondWithRpcPromise(_0x5381('0x29'),_[_0x5381('0x1d')](_0x574225[_0x5381('0x1a')],_0x574225[_0x5381('0x20')]))[_0x5381('0xa')](respondWithResult(_0x441a2a,null))[_0x5381('0xf')](handleError(_0x441a2a,null));};exports['voiceQueuesChannelRedirect']=function(_0xfd2f8b,_0xb97a97){return respondWithRpcPromise(_0x5381('0x2a'),_[_0x5381('0x1d')](_0xfd2f8b[_0x5381('0x1a')],_0xfd2f8b[_0x5381('0x20')]))[_0x5381('0xa')](respondWithResult(_0xb97a97,null))[_0x5381('0xf')](handleError(_0xb97a97,null));};exports[_0x5381('0x2b')]=function(_0xa69b40,_0x1fc945){return respondWithRpcPromise(_0x5381('0x2c'),_0xa69b40[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0x1fc945,null))[_0x5381('0xf')](handleError(_0x1fc945,null));};exports[_0x5381('0x2d')]=function(_0x28cac,_0x426f2a){return respondWithRpcPromise(_0x5381('0x2e'),_0x28cac['query'])[_0x5381('0xa')](respondWithResult(_0x426f2a,null))[_0x5381('0xf')](handleError(_0x426f2a,null));};exports['agents']=function(_0x10a8f8,_0x4caba7){var _0xfca456;return respondWithRpcPromise('Agents',_0x10a8f8[_0x5381('0x1a')])[_0x5381('0xa')](function(_0x1e14b9){_0xfca456=_0x1e14b9;return respondWithRpcPromise(_0x5381('0x2f'),_0x10a8f8[_0x5381('0x1a')],routingClient);})[_0x5381('0xa')](function(_0x23528d){return _[_0x5381('0x1d')]({},_0x23528d,_0xfca456);})[_0x5381('0xa')](respondWithResult(_0x4caba7,null))[_0x5381('0xf')](handleError(_0x4caba7,null));};exports['agentCapacity']=function(_0x538f6b,_0x43e22a){if(_0x538f6b[_0x5381('0x30')]&&_0x538f6b[_0x5381('0x30')][_0x5381('0x31')]&&_0x538f6b['user']&&_0x538f6b[_0x5381('0x32')][_0x5381('0x13')]){for(var _0x261732 in _0x538f6b[_0x5381('0x30')]['interaction']){if(_0x538f6b['body'][_0x5381('0x31')][_0x5381('0x33')](_0x261732)){db[_0x5381('0x34')][_0x5381('0x35')]({'where':{'channel':_0x261732,'membername':_0x538f6b[_0x5381('0x32')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x538f6b[_0x5381('0x30')]['interaction'][_0x261732]&&_0x538f6b[_0x5381('0x30')][_0x5381('0x31')][_0x261732][_0x5381('0x36')]?{'$notIn':_0x538f6b[_0x5381('0x30')][_0x5381('0x31')][_0x261732]}:{'$ne':null}}})[_0x5381('0xa')](function(_0x48fdeb){var _0x5290a6=moment()[_0x5381('0x37')](_0x5381('0x38'));for(var _0x982a90=0x0,_0x3e2cc0=_0x48fdeb['length'];_0x982a90<_0x3e2cc0;_0x982a90+=0x1){_0x48fdeb[_0x982a90][_0x5381('0x39')]({'exitAt':_0x5290a6});}});for(var _0x2b2ef3=0x0;_0x2b2ef3<_0x538f6b['body'][_0x5381('0x31')][_0x261732][_0x5381('0x36')];_0x2b2ef3+=0x1){db[_0x5381('0x34')][_0x5381('0x3a')]({'where':{'channel':_0x261732,'membername':_0x538f6b['user']['name'],'type':_0x5381('0x3b'),'uniqueid':_0x538f6b[_0x5381('0x30')]['interaction'][_0x261732][_0x2b2ef3],'exitAt':null},'defaults':{'channel':_0x261732,'membername':_0x538f6b[_0x5381('0x32')][_0x5381('0x13')],'interface':_[_0x5381('0x15')](_0x538f6b[_0x5381('0x32')][_0x5381('0x3c')])?util['format'](_0x5381('0x3d'),_0x538f6b['user']['name']):_0x538f6b['user'][_0x5381('0x3c')],'type':'INTERACTION','enterAt':moment()[_0x5381('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5381('0x3e'),'internal':_0x538f6b[_0x5381('0x32')][_0x5381('0x3f')],'uniqueid':_0x538f6b['body'][_0x5381('0x31')][_0x261732][_0x2b2ef3]}});}}}}return respondWithRpcPromise(_0x5381('0x40'),{'id':_0x538f6b[_0x5381('0x20')]['id'],'capacity':_0x538f6b[_0x5381('0x30')][_0x5381('0x41')]},routingClient)[_0x5381('0xa')](respondWithResult(_0x43e22a,null))['catch'](handleError(_0x43e22a,null));};exports['telephones']=function(_0x3509b8,_0x4b34b9){return respondWithRpcPromise(_0x5381('0x42'),_0x3509b8[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0x4b34b9,null))[_0x5381('0xf')](handleError(_0x4b34b9,null));};exports[_0x5381('0x43')]=function(_0x1cadc0,_0x3ce5c2){return respondWithRpcPromise('Trunks',_0x1cadc0[_0x5381('0x1a')])[_0x5381('0xa')](respondWithResult(_0x3ce5c2,null))['catch'](handleError(_0x3ce5c2,null));};exports['campaigns']=function(_0x462938,_0xdebb6e){return respondWithRpcPromise(_0x5381('0x44'),_0x462938['query'])['then'](respondWithResult(_0xdebb6e,null))[_0x5381('0xf')](handleError(_0xdebb6e,null));};exports[_0x5381('0x45')]=function(_0x36007c,_0x3ea1b3){return respondWithRpcPromise(_0x5381('0x46'),_0x36007c['query'],routingClient)['then'](respondWithResult(_0x3ea1b3,null))[_0x5381('0xf')](handleError(_0x3ea1b3,null));};exports[_0x5381('0x47')]=function(_0x259700,_0x44efcd){return respondWithRpcPromise(_0x5381('0x46'),_0x259700[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](findById(_0x259700['params']['id']))[_0x5381('0xa')](respondWithResult(_0x44efcd,null))[_0x5381('0xf')](handleError(_0x44efcd,null));};exports[_0x5381('0x48')]=function(_0x32e698,_0x3db8bf){return respondWithRpcPromise(_0x5381('0x49'),_0x32e698[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](respondWithResult(_0x3db8bf,null))['catch'](handleError(_0x3db8bf,null));};exports[_0x5381('0x4a')]=function(_0x51fa4d,_0x350fe5){return respondWithRpcPromise(_0x5381('0x49'),_0x51fa4d[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](findById(_0x51fa4d[_0x5381('0x20')]['id']))[_0x5381('0xa')](respondWithResult(_0x350fe5,null))['catch'](handleError(_0x350fe5,null));};exports[_0x5381('0x4b')]=function(_0x26ddbd,_0x279fa3){return respondWithRpcPromise(_0x5381('0x4c'),_0x26ddbd[_0x5381('0x1a')],mailClient)[_0x5381('0xa')](respondWithResult(_0x279fa3,null))['catch'](handleError(_0x279fa3,null));};exports[_0x5381('0x4d')]=function(_0x1c2555,_0x4cd9d8){return respondWithRpcPromise(_0x5381('0x4e'),_0x1c2555[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](respondWithResult(_0x4cd9d8,null))[_0x5381('0xf')](handleError(_0x4cd9d8,null));};exports[_0x5381('0x4f')]=function(_0x5c5e84,_0x178a5c){return respondWithRpcPromise(_0x5381('0x4e'),_0x5c5e84[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](findById(_0x5c5e84['params']['id']))['then'](respondWithResult(_0x178a5c,null))[_0x5381('0xf')](handleError(_0x178a5c,null));};exports[_0x5381('0x50')]=function(_0x29a220,_0x422f50){return respondWithRpcPromise(_0x5381('0x51'),_0x29a220['query'],routingClient)[_0x5381('0xa')](respondWithResult(_0x422f50,null))[_0x5381('0xf')](handleError(_0x422f50,null));};exports['showSmsQueues']=function(_0x3284fa,_0x13727d){return respondWithRpcPromise('SmsQueues',_0x3284fa['query'],routingClient)[_0x5381('0xa')](findById(_0x3284fa[_0x5381('0x20')]['id']))[_0x5381('0xa')](respondWithResult(_0x13727d,null))['catch'](handleError(_0x13727d,null));};exports[_0x5381('0x52')]=function(_0xfa0f63,_0xee0d52){return respondWithRpcPromise(_0x5381('0x53'),_0xfa0f63[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](respondWithResult(_0xee0d52,null))[_0x5381('0xf')](handleError(_0xee0d52,null));};exports[_0x5381('0x54')]=function(_0x580d,_0xbf24c9){return respondWithRpcPromise(_0x5381('0x53'),_0x580d['query'],routingClient)[_0x5381('0xa')](findById(_0x580d[_0x5381('0x20')]['id']))['then'](respondWithResult(_0xbf24c9,null))[_0x5381('0xf')](handleError(_0xbf24c9,null));};exports[_0x5381('0x55')]=function(_0x1b5a7d,_0x4f33ca){return respondWithRpcPromise(_0x5381('0x56'),_0x1b5a7d['query'])[_0x5381('0xa')](respondWithResult(_0x4f33ca,null))[_0x5381('0xf')](handleError(_0x4f33ca,null));};exports[_0x5381('0x57')]=function(_0x3cdeed,_0x4e2f6b){return respondWithRpcPromise(_0x5381('0x58'),_0x3cdeed[_0x5381('0x1a')],routingClient)[_0x5381('0xa')](respondWithResult(_0x4e2f6b,null))[_0x5381('0xf')](handleError(_0x4e2f6b,null));};exports['mailQueuesWaitingInteractions']=function(_0x43be0d,_0x21a967){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x43be0d[_0x5381('0x1a')],routingClient)['then'](respondWithResult(_0x21a967,null))[_0x5381('0xf')](handleError(_0x21a967,null));};exports[_0x5381('0x59')]=function(_0x42634f,_0x1fc44b){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x42634f['query'],routingClient)['then'](respondWithResult(_0x1fc44b,null))[_0x5381('0xf')](handleError(_0x1fc44b,null));};exports['smsQueuesWaitingInteractions']=function(_0x59cd31,_0x18f298){return respondWithRpcPromise(_0x5381('0x5a'),_0x59cd31['query'],routingClient)['then'](respondWithResult(_0x18f298,null))['catch'](handleError(_0x18f298,null));};exports[_0x5381('0x5b')]=function(_0x532b82,_0xbc912c){return respondWithRpcPromise(_0x5381('0x5c'),_0x532b82['query'],routingClient)[_0x5381('0xa')](respondWithResult(_0xbc912c,null))[_0x5381('0xf')](handleError(_0xbc912c,null));};exports['queueNotify']=function(_0x3016ca){return function(_0x435385,_0x8b06ee){var _0x442446,_0x21c1b8;var _0x714534=_[_0x5381('0x5d')](_0x3016ca);var _0x5be744=_0x3016ca===_0x5381('0x5e')?_0x5381('0x5f'):_0x5381('0x60');return db[_0x714534+_0x5381('0x61')]['findOne']({'raw':!![],'where':{'id':_0x435385[_0x5381('0x20')]['id']}})[_0x5381('0xa')](function(_0x52c798){if(_[_0x5381('0x15')](_0x52c798)){throw new Error(_0x714534+_0x5381('0x62'));}_0x442446=_0x52c798;return db[_0x714534+_0x5381('0x63')][_0x5381('0x64')]({'where':{'id':_0x435385[_0x5381('0x30')]['messageId']},'include':[{'model':db[_0x714534+_0x5381('0x65')],'as':'Interaction'},{'model':db[_0x714534+_0x5be744],'as':_0x5381('0x60')}]});})[_0x5381('0xa')](function(_0x249141){if(_[_0x5381('0x15')](_0x249141)){throw new Error(_0x714534+_0x5381('0x66'));}_0x21c1b8=_0x249141;return _0x249141[_0x5381('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5381('0xa')](function(){var _0x2595bb={'uniqueid':_0x3016ca+'.'+_0x21c1b8['id']+'.'+_0x21c1b8[_0x5381('0x65')]['id'],'FromUserId':_0x435385[_0x5381('0x32')]['id'],'type':_0x5381('0x68')};_0x2595bb[_0x714534+_0x5381('0x69')]=_0x21c1b8['id'];_0x2595bb[_0x714534+_0x5381('0x6a')]=_0x21c1b8['Interaction']['id'];_0x2595bb[_0x5381('0x6b')+_0x714534+_0x5be744+'Id']=_0x21c1b8['Account']['id'];_0x2595bb['To'+_0x714534+_0x5381('0x6c')]=_0x442446['id'];return db[_0x714534+_0x5381('0x6d')][_0x5381('0x6e')](_0x2595bb);})[_0x5381('0xa')](function(){return respondWithRpcPromise(_0x5381('0x6f'),{'channel':_0x3016ca,'interaction':_0x21c1b8[_0x5381('0x65')],'message':_0x21c1b8,'account':_0x21c1b8['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x442446[_0x5381('0x13')]+','+(_0x21c1b8['Account']['queueTransferTimeout']||0x12c),'interval':_0x5381('0x70')}]},routingClient);})['then'](respondWithResult(_0x8b06ee,null))[_0x5381('0xf')](handleError(_0x8b06ee,null));};};exports['agentNotify']=function(_0x55ddd7,_0x325f1e){var _0xae26e9,_0x32a07c;if(_['isNil'](_0x55ddd7[_0x5381('0x30')][_0x5381('0x71')])){throw new Error(_0x5381('0x72'));}var _0x39fa47=_0x55ddd7[_0x5381('0x30')][_0x5381('0x71')];var _0x2e6b9a=_[_0x5381('0x5d')](_0x39fa47);var _0x1115b8=_0x39fa47===_0x5381('0x5e')?_0x5381('0x5f'):_0x5381('0x60');return db[_0x5381('0x73')][_0x5381('0x64')]({'raw':!![],'where':{'id':_0x55ddd7[_0x5381('0x20')]['id'],'role':_0x5381('0x3e')}})[_0x5381('0xa')](function(_0x16e565){if(_[_0x5381('0x15')](_0x16e565)){throw new Error(_0x5381('0x74'));}_0xae26e9=_0x16e565;return db[_0x2e6b9a+_0x5381('0x63')][_0x5381('0x64')]({'where':{'id':_0x55ddd7['body']['messageId']},'include':[{'model':db[_0x2e6b9a+_0x5381('0x65')],'as':_0x5381('0x65')},{'model':db[_0x2e6b9a+_0x1115b8],'as':'Account'}]});})['then'](function(_0x37bfb0){if(_['isNil'](_0x37bfb0)){throw new Error(_0x2e6b9a+'\x20Message\x20not\x20found');}_0x32a07c=_0x37bfb0;return _0x37bfb0[_0x5381('0x67')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x393582={'uniqueid':_0x39fa47+'.'+_0x32a07c['id']+'.'+_0x32a07c[_0x5381('0x65')]['id'],'FromUserId':_0x55ddd7[_0x5381('0x32')]['id'],'type':_0x5381('0x68'),'ToUserId':_0xae26e9['id']};_0x393582[_0x2e6b9a+_0x5381('0x69')]=_0x32a07c['id'];_0x393582[_0x2e6b9a+_0x5381('0x6a')]=_0x32a07c[_0x5381('0x65')]['id'];_0x393582[_0x5381('0x6b')+_0x2e6b9a+_0x1115b8+'Id']=_0x32a07c['Account']['id'];return db[_0x2e6b9a+'TransferReport'][_0x5381('0x6e')](_0x393582);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x39fa47,'interaction':_0x32a07c[_0x5381('0x65')],'message':_0x32a07c,'account':_0x32a07c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0xae26e9['name']+','+(_0x32a07c[_0x5381('0x60')][_0x5381('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5381('0xa')](respondWithResult(_0x325f1e,null))[_0x5381('0xf')](handleError(_0x325f1e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5c93d75..5f584a8 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 _0x6620=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x4cd646,_0x17d4f7){var _0x2e0ec8=function(_0x145103){while(--_0x145103){_0x4cd646['push'](_0x4cd646['shift']());}};_0x2e0ec8(++_0x17d4f7);}(_0x6620,0x1e0));var _0x0662=function(_0x55f43e,_0x52e211){_0x55f43e=_0x55f43e-0x0;var _0x337754=_0x6620[_0x55f43e];return _0x337754;};'use strict';var multer=require(_0x0662('0x0'));var util=require(_0x0662('0x1'));var path=require(_0x0662('0x2'));var timeout=require(_0x0662('0x3'));var express=require(_0x0662('0x4'));var router=express[_0x0662('0x5')]();var auth=require(_0x0662('0x6'));var interaction=require(_0x0662('0x7'));var config=require(_0x0662('0x8'));var controller=require(_0x0662('0x9'));router[_0x0662('0xa')]('/',auth[_0x0662('0xb')](),controller[_0x0662('0xc')]);router['get']('/:id',auth[_0x0662('0xb')](),controller[_0x0662('0xd')]);router[_0x0662('0xa')](_0x0662('0xe'),auth['isAuthenticated'](),controller[_0x0662('0xf')]);router[_0x0662('0x10')]('/',auth['isAuthenticated'](),controller[_0x0662('0x11')]);router[_0x0662('0x12')](_0x0662('0x13'),auth[_0x0662('0xb')](),controller[_0x0662('0x14')]);router[_0x0662('0x15')](_0x0662('0x13'),auth['isAuthenticated'](),controller[_0x0662('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3325=['index','/:id','/:id/run','run','create','put','update','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0xa79998,_0x3e3025){var _0x478289=function(_0x12ed7d){while(--_0x12ed7d){_0xa79998['push'](_0xa79998['shift']());}};_0x478289(++_0x3e3025);}(_0x3325,0x195));var _0x5332=function(_0x54e333,_0x4ba478){_0x54e333=_0x54e333-0x0;var _0x47279e=_0x3325[_0x54e333];return _0x47279e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5332('0x0'));var timeout=require(_0x5332('0x1'));var express=require('express');var router=express[_0x5332('0x2')]();var auth=require(_0x5332('0x3'));var interaction=require(_0x5332('0x4'));var config=require(_0x5332('0x5'));var controller=require(_0x5332('0x6'));router[_0x5332('0x7')]('/',auth[_0x5332('0x8')](),controller[_0x5332('0x9')]);router[_0x5332('0x7')](_0x5332('0xa'),auth[_0x5332('0x8')](),controller['show']);router[_0x5332('0x7')](_0x5332('0xb'),auth[_0x5332('0x8')](),controller[_0x5332('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5332('0xd')]);router[_0x5332('0xe')]('/:id',auth[_0x5332('0x8')](),controller[_0x5332('0xf')]);router[_0x5332('0x10')](_0x5332('0xa'),auth[_0x5332('0x8')](),controller['destroy']);module[_0x5332('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6e31262..6da13c9 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 _0xb0a2=['weeks','days','minutes','csv','pdf','custom','default','TEXT','STRING','BOOLEAN','DATE','ENUM','years','quarters','months'];(function(_0xdacb70,_0x3b7315){var _0x53fbc5=function(_0x34f645){while(--_0x34f645){_0xdacb70['push'](_0xdacb70['shift']());}};_0x53fbc5(++_0x3b7315);}(_0xb0a2,0x9e));var _0x2b0a=function(_0x4fbd7c,_0x4b42c1){_0x4fbd7c=_0x4fbd7c-0x0;var _0x5a2b63=_0xb0a2[_0x4fbd7c];return _0x5a2b63;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2b0a('0x0')]},'active':{'type':Sequelize[_0x2b0a('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2b0a('0x0')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x2b0a('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2b0a('0x3')](_0x2b0a('0x4'),_0x2b0a('0x5'),_0x2b0a('0x6'),_0x2b0a('0x7'),_0x2b0a('0x8'),'hours',_0x2b0a('0x9')),'allowNull':![],'defaultValue':_0x2b0a('0x8')},'output':{'type':Sequelize[_0x2b0a('0x3')](_0x2b0a('0xa'),_0x2b0a('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0x2b0a('0xa')},'type':{'type':Sequelize[_0x2b0a('0x3')](_0x2b0a('0xc'),_0x2b0a('0xd')),'allowNull':![],'defaultValue':_0x2b0a('0xc')},'sendMail':{'type':Sequelize[_0x2b0a('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x2b0a('0x0')]},'cc':{'type':Sequelize[_0x2b0a('0xe')]},'bcc':{'type':Sequelize[_0x2b0a('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x2b0a('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x62d9=['ENUM','years','quarters','days','minutes','csv','xlsx','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x62d9,0x171));var _0x962d=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0x62d9[_0x4dc0c8];return _0x26bf81;};'use strict';var Sequelize=require(_0x962d('0x0'));module[_0x962d('0x1')]={'name':{'type':Sequelize[_0x962d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x962d('0x2')]},'active':{'type':Sequelize[_0x962d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x962d('0x2')],'allowNull':![],'defaultValue':_0x962d('0x4')},'startAt':{'type':Sequelize[_0x962d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x962d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x962d('0x6')](_0x962d('0x7'),_0x962d('0x8'),'months','weeks',_0x962d('0x9'),'hours',_0x962d('0xa')),'allowNull':![],'defaultValue':_0x962d('0x9')},'output':{'type':Sequelize[_0x962d('0x6')](_0x962d('0xb'),'pdf',_0x962d('0xc')),'allowNull':![],'defaultValue':_0x962d('0xb')},'type':{'type':Sequelize[_0x962d('0x6')]('custom',_0x962d('0xd')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x962d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x962d('0x2')]},'cc':{'type':Sequelize[_0x962d('0xe')]},'bcc':{'type':Sequelize[_0x962d('0xe')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 661bb3d..92089f2 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 _0x6a5d=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','Schedule','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Scheduler','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x854f20,_0x253ec2){var _0x3389c0=function(_0x274715){while(--_0x274715){_0x854f20['push'](_0x854f20['shift']());}};_0x3389c0(++_0x253ec2);}(_0x6a5d,0x91));var _0xd6a5=function(_0x3583c8,_0x114e2c){_0x3583c8=_0x3583c8-0x0;var _0x29385b=_0x6a5d[_0x3583c8];return _0x29385b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd6a5('0x0'));var jsonpatch=require(_0xd6a5('0x1'));var rp=require(_0xd6a5('0x2'));var moment=require(_0xd6a5('0x3'));var BPromise=require(_0xd6a5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd6a5('0x5'));var sox=require('sox');var csv=require(_0xd6a5('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd6a5('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6a5('0x8'));var deskjs=require(_0xd6a5('0x9'));var toCsv=require(_0xd6a5('0x6'));var querystring=require('querystring');var Papa=require(_0xd6a5('0xa'));var Redis=require(_0xd6a5('0xb'));var authService=require(_0xd6a5('0xc'));var qs=require(_0xd6a5('0xd'));var hardwareService=require(_0xd6a5('0xe'));var logger=require('../../config/logger')(_0xd6a5('0xf'));var utils=require(_0xd6a5('0x10'));var config=require(_0xd6a5('0x11'));var db=require(_0xd6a5('0x12'))['db'];function respondWithStatusCode(_0x190979,_0x405ddd){_0x405ddd=_0x405ddd||0xcc;return function(_0x457ffd){if(_0x457ffd){return _0x190979[_0xd6a5('0x13')](_0x405ddd);}return _0x190979['status'](_0x405ddd)[_0xd6a5('0x14')]();};}function respondWithResult(_0x1c51e1,_0x246723){_0x246723=_0x246723||0xc8;return function(_0x54b758){if(_0x54b758){return _0x1c51e1[_0xd6a5('0x15')](_0x246723)[_0xd6a5('0x16')](_0x54b758);}};}function respondWithFilteredResult(_0x57fec5,_0x425b62){return function(_0x1f58dd){if(_0x1f58dd){var _0x4614a5=_0x1f58dd[_0xd6a5('0x17')],_0x3d0ed1=_0x425b62['offset'],_0x541fde=_0x425b62[_0xd6a5('0x18')]+_0x425b62['limit'],_0x2a5f6a;if(_0x541fde>=_0x4614a5){_0x541fde=_0x4614a5;_0x2a5f6a=0xc8;}else{_0x2a5f6a=0xce;}_0x57fec5[_0xd6a5('0x15')](_0x2a5f6a);return _0x57fec5[_0xd6a5('0x19')](_0xd6a5('0x1a'),_0x3d0ed1+'-'+_0x541fde+'/'+_0x4614a5)['json'](_0x1f58dd);}return null;};}function patchUpdates(_0x105e09){return function(_0x442c63){try{jsonpatch[_0xd6a5('0x1b')](_0x442c63,_0x105e09,!![]);}catch(_0x1004f3){return BPromise['reject'](_0x1004f3);}return _0x442c63[_0xd6a5('0x1c')]();};}function saveUpdates(_0x3bae64,_0x16d04a){return function(_0xb707b){if(_0xb707b){return _0xb707b['update'](_0x3bae64)[_0xd6a5('0x1d')](function(_0x199d98){return _0x199d98;});}return null;};}function removeEntity(_0x34d543,_0x486e08){return function(_0x215c47){if(_0x215c47){return _0x215c47[_0xd6a5('0x1e')]()[_0xd6a5('0x1d')](function(){var _0x31baa4=_0x215c47[_0xd6a5('0x1f')]({'plain':!![]});var _0x542587='Scheduler';return db[_0xd6a5('0x20')][_0xd6a5('0x1e')]({'where':{'type':_0x542587,'resourceId':_0x31baa4['id']}})[_0xd6a5('0x1d')](function(){return _0x215c47;});})[_0xd6a5('0x1d')](function(){_0x34d543[_0xd6a5('0x15')](0xcc)[_0xd6a5('0x14')]();});}};}function handleEntityNotFound(_0x243ebe,_0x3c25c7){return function(_0x5c881a){if(!_0x5c881a){_0x243ebe['sendStatus'](0x194);}return _0x5c881a;};}function handleError(_0x480387,_0x40dc50){_0x40dc50=_0x40dc50||0x1f4;return function(_0x1da94d){logger[_0xd6a5('0x21')](_0x1da94d[_0xd6a5('0x22')]);if(_0x1da94d[_0xd6a5('0x23')]){delete _0x1da94d['name'];}_0x480387[_0xd6a5('0x15')](_0x40dc50)[_0xd6a5('0x24')](_0x1da94d);};}exports[_0xd6a5('0x25')]=function(_0x4c0ab1,_0x5d7fe1){var _0xdc5ac5={},_0xb89087={},_0x47c9b3={'count':0x0,'rows':[]};var _0x4011be=db['Schedule'][_0xd6a5('0x26')];_0xb89087[_0xd6a5('0x27')]=_[_0xd6a5('0x28')](_0x4011be);_0xb89087[_0xd6a5('0x29')]=_[_0xd6a5('0x28')](_0x4c0ab1[_0xd6a5('0x29')]);_0xb89087[_0xd6a5('0x2a')]=_[_0xd6a5('0x2b')](_0xb89087['model'],_0xb89087[_0xd6a5('0x29')]);_0xdc5ac5['attributes']=_[_0xd6a5('0x2b')](_0xb89087['model'],qs[_0xd6a5('0x2c')](_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x2c')]));_0xdc5ac5[_0xd6a5('0x2d')]=_0xdc5ac5[_0xd6a5('0x2d')][_0xd6a5('0x2e')]?_0xdc5ac5[_0xd6a5('0x2d')]:_0xb89087[_0xd6a5('0x27')];if(!_0x4c0ab1['query'][_0xd6a5('0x2f')](_0xd6a5('0x30'))){_0xdc5ac5[_0xd6a5('0x31')]=qs[_0xd6a5('0x31')](_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x31')]);_0xdc5ac5[_0xd6a5('0x18')]=qs['offset'](_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x18')]);}_0xdc5ac5['order']=qs[_0xd6a5('0x32')](_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x32')]);_0xdc5ac5[_0xd6a5('0x33')]=qs[_0xd6a5('0x2a')](_['pick'](_0x4c0ab1[_0xd6a5('0x29')],_0xb89087[_0xd6a5('0x2a')]));if(_0x4c0ab1['query'][_0xd6a5('0x34')]){_0xdc5ac5[_0xd6a5('0x33')]=_[_0xd6a5('0x35')](_0xdc5ac5[_0xd6a5('0x33')],{'$or':_[_0xd6a5('0x36')](_0x4011be,function(_0x2c15dd){if(_0x2c15dd[_0xd6a5('0x37')][_0xd6a5('0x38')]!==_0xd6a5('0x39')){var _0x5f1004={};_0x5f1004[_0x2c15dd[_0xd6a5('0x3a')]]={'$like':'%'+_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x34')]+'%'};return _0x5f1004;}})});}_0xdc5ac5=_[_0xd6a5('0x35')]({},_0xdc5ac5,_0x4c0ab1[_0xd6a5('0x3b')]);var _0x41d00b={'where':_0xdc5ac5[_0xd6a5('0x33')]};return db[_0xd6a5('0x3c')][_0xd6a5('0x17')](_0x41d00b)[_0xd6a5('0x1d')](function(_0x229ab0){_0x47c9b3['count']=_0x229ab0;if(_0x4c0ab1[_0xd6a5('0x29')][_0xd6a5('0x3d')]){_0xdc5ac5[_0xd6a5('0x3e')]=[{'all':!![]}];}return db[_0xd6a5('0x3c')][_0xd6a5('0x3f')](_0xdc5ac5);})[_0xd6a5('0x1d')](function(_0x1db4d8){_0x47c9b3[_0xd6a5('0x40')]=_0x1db4d8;return _0x47c9b3;})['then'](respondWithFilteredResult(_0x5d7fe1,_0xdc5ac5))[_0xd6a5('0x41')](handleError(_0x5d7fe1,null));};exports[_0xd6a5('0x42')]=function(_0x56babe,_0x540f28){var _0x3768f4={'raw':![],'where':{'id':_0x56babe[_0xd6a5('0x43')]['id']}},_0x373238={};_0x373238[_0xd6a5('0x27')]=_[_0xd6a5('0x28')](db[_0xd6a5('0x3c')][_0xd6a5('0x26')]);_0x373238['query']=_[_0xd6a5('0x28')](_0x56babe[_0xd6a5('0x29')]);_0x373238['filters']=_[_0xd6a5('0x2b')](_0x373238[_0xd6a5('0x27')],_0x373238[_0xd6a5('0x29')]);_0x3768f4[_0xd6a5('0x2d')]=_[_0xd6a5('0x2b')](_0x373238['model'],qs['fields'](_0x56babe[_0xd6a5('0x29')]['fields']));_0x3768f4[_0xd6a5('0x2d')]=_0x3768f4['attributes'][_0xd6a5('0x2e')]?_0x3768f4[_0xd6a5('0x2d')]:_0x373238[_0xd6a5('0x27')];if(_0x56babe[_0xd6a5('0x29')][_0xd6a5('0x3d')]){_0x3768f4[_0xd6a5('0x3e')]=[{'all':!![]}];}_0x3768f4=_[_0xd6a5('0x35')]({},_0x3768f4,_0x56babe[_0xd6a5('0x3b')]);return db[_0xd6a5('0x3c')][_0xd6a5('0x44')](_0x3768f4)[_0xd6a5('0x1d')](handleEntityNotFound(_0x540f28,null))[_0xd6a5('0x1d')](respondWithResult(_0x540f28,null))[_0xd6a5('0x41')](handleError(_0x540f28,null));};exports[_0xd6a5('0x45')]=function(_0x2d16fc,_0x3b9b3f){return db[_0xd6a5('0x3c')]['create'](_0x2d16fc[_0xd6a5('0x46')],{})['then'](function(_0x2ac99c){var _0x50a3bf=_0x2d16fc[_0xd6a5('0x47')]['get']({'plain':!![]});if(!_0x50a3bf)throw new Error(_0xd6a5('0x48'));if(_0x50a3bf['role']===_0xd6a5('0x47')){var _0x34b661=_0x2ac99c[_0xd6a5('0x1f')]({'plain':!![]});var _0x1afc06=_0xd6a5('0x49');return db[_0xd6a5('0x4a')][_0xd6a5('0x44')]({'where':{'name':_0x1afc06,'userProfileId':_0x50a3bf[_0xd6a5('0x4b')]},'raw':!![]})[_0xd6a5('0x1d')](function(_0x2ea2f8){if(_0x2ea2f8&&_0x2ea2f8['autoAssociation']===0x0){return db[_0xd6a5('0x20')][_0xd6a5('0x45')]({'name':_0x34b661[_0xd6a5('0x23')],'resourceId':_0x34b661['id'],'type':_0x2ea2f8[_0xd6a5('0x23')],'sectionId':_0x2ea2f8['id']},{})[_0xd6a5('0x1d')](function(){return _0x2ac99c;});}else{return _0x2ac99c;}})[_0xd6a5('0x41')](function(_0x4952d5){logger[_0xd6a5('0x21')](_0xd6a5('0x4c'),_0x4952d5);throw _0x4952d5;});}return _0x2ac99c;})[_0xd6a5('0x1d')](respondWithResult(_0x3b9b3f,0xc9))[_0xd6a5('0x41')](handleError(_0x3b9b3f,null));};exports[_0xd6a5('0x4d')]=function(_0x540e8c,_0x27a8b2){if(_0x540e8c['body']['id']){delete _0x540e8c[_0xd6a5('0x46')]['id'];}return db[_0xd6a5('0x3c')][_0xd6a5('0x44')]({'where':{'id':_0x540e8c[_0xd6a5('0x43')]['id']}})[_0xd6a5('0x1d')](handleEntityNotFound(_0x27a8b2,null))[_0xd6a5('0x1d')](saveUpdates(_0x540e8c['body'],null))[_0xd6a5('0x1d')](respondWithResult(_0x27a8b2,null))[_0xd6a5('0x41')](handleError(_0x27a8b2,null));};exports[_0xd6a5('0x1e')]=function(_0x3923ba,_0x6bd7dd){return db[_0xd6a5('0x3c')][_0xd6a5('0x44')]({'where':{'id':_0x3923ba[_0xd6a5('0x43')]['id']}})[_0xd6a5('0x1d')](handleEntityNotFound(_0x6bd7dd,null))[_0xd6a5('0x1d')](removeEntity(_0x6bd7dd,null))['catch'](handleError(_0x6bd7dd,null));};exports[_0xd6a5('0x4e')]=function(_0x12cd69,_0x2f89d3,_0x46f74c){var _0x30ecbb=require(_0xd6a5('0x4f'));return db[_0xd6a5('0x3c')][_0xd6a5('0x44')]({'where':{'id':_0x12cd69[_0xd6a5('0x43')]['id']},'raw':!![]})[_0xd6a5('0x1d')](handleEntityNotFound(_0x2f89d3,null))['then'](function(){_0x30ecbb['run'](_0x12cd69[_0xd6a5('0x43')]['id']);})[_0xd6a5('0x1d')](respondWithStatusCode(_0x2f89d3,null))[_0xd6a5('0x41')](handleError(_0x2f89d3,null));}; \ No newline at end of file +var _0x3e85=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Scheduler','UserProfileResource','destroy','error','name','send','index','Schedule','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x45e32c,_0x259a3f){var _0x464dab=function(_0x5b0237){while(--_0x5b0237){_0x45e32c['push'](_0x45e32c['shift']());}};_0x464dab(++_0x259a3f);}(_0x3e85,0x12d));var _0x53e8=function(_0x392aea,_0x47d79a){_0x392aea=_0x392aea-0x0;var _0x237810=_0x3e85[_0x392aea];return _0x237810;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x53e8('0x0'));var zipdir=require(_0x53e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x53e8('0x2'));var BPromise=require(_0x53e8('0x3'));var Mustache=require(_0x53e8('0x4'));var util=require('util');var path=require(_0x53e8('0x5'));var sox=require(_0x53e8('0x6'));var csv=require(_0x53e8('0x7'));var ejs=require(_0x53e8('0x8'));var fs=require('fs');var _=require(_0x53e8('0x9'));var squel=require('squel');var crypto=require(_0x53e8('0xa'));var jsforce=require(_0x53e8('0xb'));var deskjs=require(_0x53e8('0xc'));var toCsv=require(_0x53e8('0x7'));var querystring=require(_0x53e8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53e8('0xe'));var qs=require(_0x53e8('0xf'));var hardwareService=require(_0x53e8('0x10'));var logger=require(_0x53e8('0x11'))(_0x53e8('0x12'));var utils=require(_0x53e8('0x13'));var config=require(_0x53e8('0x14'));var db=require(_0x53e8('0x15'))['db'];function respondWithStatusCode(_0x25fe80,_0x18ec95){_0x18ec95=_0x18ec95||0xcc;return function(_0x5adb1d){if(_0x5adb1d){return _0x25fe80[_0x53e8('0x16')](_0x18ec95);}return _0x25fe80[_0x53e8('0x17')](_0x18ec95)[_0x53e8('0x18')]();};}function respondWithResult(_0x1a839b,_0x215fb9){_0x215fb9=_0x215fb9||0xc8;return function(_0x105543){if(_0x105543){return _0x1a839b['status'](_0x215fb9)[_0x53e8('0x19')](_0x105543);}};}function respondWithFilteredResult(_0x39e136,_0x1081c9){return function(_0x38ff27){if(_0x38ff27){var _0x2867a6=_0x38ff27[_0x53e8('0x1a')],_0x254eb6=_0x1081c9[_0x53e8('0x1b')],_0x56073d=_0x1081c9[_0x53e8('0x1b')]+_0x1081c9[_0x53e8('0x1c')],_0x15db53;if(_0x56073d>=_0x2867a6){_0x56073d=_0x2867a6;_0x15db53=0xc8;}else{_0x15db53=0xce;}_0x39e136['status'](_0x15db53);return _0x39e136[_0x53e8('0x1d')](_0x53e8('0x1e'),_0x254eb6+'-'+_0x56073d+'/'+_0x2867a6)[_0x53e8('0x19')](_0x38ff27);}return null;};}function patchUpdates(_0x717e4c){return function(_0x302740){try{jsonpatch[_0x53e8('0x1f')](_0x302740,_0x717e4c,!![]);}catch(_0x4f2c05){return BPromise[_0x53e8('0x20')](_0x4f2c05);}return _0x302740['save']();};}function saveUpdates(_0x3f54f4,_0x4d2524){return function(_0x4f1d69){if(_0x4f1d69){return _0x4f1d69[_0x53e8('0x21')](_0x3f54f4)['then'](function(_0x1a73c8){return _0x1a73c8;});}return null;};}function removeEntity(_0x21fe7f,_0x3ee1d6){return function(_0x5523ac){if(_0x5523ac){return _0x5523ac['destroy']()[_0x53e8('0x22')](function(){var _0x34d887=_0x5523ac[_0x53e8('0x23')]({'plain':!![]});var _0x55a696=_0x53e8('0x24');return db[_0x53e8('0x25')][_0x53e8('0x26')]({'where':{'type':_0x55a696,'resourceId':_0x34d887['id']}})[_0x53e8('0x22')](function(){return _0x5523ac;});})[_0x53e8('0x22')](function(){_0x21fe7f[_0x53e8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22baf0,_0x4631f5){return function(_0x491e72){if(!_0x491e72){_0x22baf0[_0x53e8('0x16')](0x194);}return _0x491e72;};}function handleError(_0x210037,_0x16ffc2){_0x16ffc2=_0x16ffc2||0x1f4;return function(_0x36c8f4){logger[_0x53e8('0x27')](_0x36c8f4['stack']);if(_0x36c8f4[_0x53e8('0x28')]){delete _0x36c8f4[_0x53e8('0x28')];}_0x210037[_0x53e8('0x17')](_0x16ffc2)[_0x53e8('0x29')](_0x36c8f4);};}exports[_0x53e8('0x2a')]=function(_0x37d4dc,_0x5a25d0){var _0x5b2150={},_0x20f49b={},_0x4ef691={'count':0x0,'rows':[]};var _0x26cf6e=db[_0x53e8('0x2b')]['rawAttributes'];_0x20f49b[_0x53e8('0x2c')]=_[_0x53e8('0x2d')](_0x26cf6e);_0x20f49b[_0x53e8('0x2e')]=_[_0x53e8('0x2d')](_0x37d4dc[_0x53e8('0x2e')]);_0x20f49b[_0x53e8('0x2f')]=_['intersection'](_0x20f49b[_0x53e8('0x2c')],_0x20f49b[_0x53e8('0x2e')]);_0x5b2150[_0x53e8('0x30')]=_[_0x53e8('0x31')](_0x20f49b[_0x53e8('0x2c')],qs[_0x53e8('0x32')](_0x37d4dc[_0x53e8('0x2e')][_0x53e8('0x32')]));_0x5b2150[_0x53e8('0x30')]=_0x5b2150['attributes'][_0x53e8('0x33')]?_0x5b2150[_0x53e8('0x30')]:_0x20f49b[_0x53e8('0x2c')];if(!_0x37d4dc['query'][_0x53e8('0x34')](_0x53e8('0x35'))){_0x5b2150['limit']=qs[_0x53e8('0x1c')](_0x37d4dc['query'][_0x53e8('0x1c')]);_0x5b2150[_0x53e8('0x1b')]=qs['offset'](_0x37d4dc['query'][_0x53e8('0x1b')]);}_0x5b2150[_0x53e8('0x36')]=qs[_0x53e8('0x37')](_0x37d4dc['query'][_0x53e8('0x37')]);_0x5b2150[_0x53e8('0x38')]=qs[_0x53e8('0x2f')](_[_0x53e8('0x39')](_0x37d4dc['query'],_0x20f49b['filters']));if(_0x37d4dc[_0x53e8('0x2e')][_0x53e8('0x3a')]){_0x5b2150[_0x53e8('0x38')]=_[_0x53e8('0x3b')](_0x5b2150[_0x53e8('0x38')],{'$or':_['map'](_0x26cf6e,function(_0xce8c40){if(_0xce8c40[_0x53e8('0x3c')][_0x53e8('0x3d')]!==_0x53e8('0x3e')){var _0x3d02b6={};_0x3d02b6[_0xce8c40[_0x53e8('0x3f')]]={'$like':'%'+_0x37d4dc['query']['filter']+'%'};return _0x3d02b6;}})});}_0x5b2150=_[_0x53e8('0x3b')]({},_0x5b2150,_0x37d4dc['options']);var _0x3cfc73={'where':_0x5b2150[_0x53e8('0x38')]};return db[_0x53e8('0x2b')]['count'](_0x3cfc73)[_0x53e8('0x22')](function(_0x474025){_0x4ef691[_0x53e8('0x1a')]=_0x474025;if(_0x37d4dc[_0x53e8('0x2e')][_0x53e8('0x40')]){_0x5b2150[_0x53e8('0x41')]=[{'all':!![]}];}return db[_0x53e8('0x2b')]['findAll'](_0x5b2150);})[_0x53e8('0x22')](function(_0x4a9e69){_0x4ef691[_0x53e8('0x42')]=_0x4a9e69;return _0x4ef691;})['then'](respondWithFilteredResult(_0x5a25d0,_0x5b2150))[_0x53e8('0x43')](handleError(_0x5a25d0,null));};exports[_0x53e8('0x44')]=function(_0x1b29c2,_0x49c918){var _0x50b5a5={'raw':![],'where':{'id':_0x1b29c2[_0x53e8('0x45')]['id']}},_0x468bd7={};_0x468bd7['model']=_[_0x53e8('0x2d')](db[_0x53e8('0x2b')][_0x53e8('0x46')]);_0x468bd7[_0x53e8('0x2e')]=_[_0x53e8('0x2d')](_0x1b29c2[_0x53e8('0x2e')]);_0x468bd7['filters']=_[_0x53e8('0x31')](_0x468bd7[_0x53e8('0x2c')],_0x468bd7['query']);_0x50b5a5['attributes']=_[_0x53e8('0x31')](_0x468bd7[_0x53e8('0x2c')],qs['fields'](_0x1b29c2[_0x53e8('0x2e')][_0x53e8('0x32')]));_0x50b5a5['attributes']=_0x50b5a5[_0x53e8('0x30')][_0x53e8('0x33')]?_0x50b5a5[_0x53e8('0x30')]:_0x468bd7[_0x53e8('0x2c')];if(_0x1b29c2[_0x53e8('0x2e')]['includeAll']){_0x50b5a5['include']=[{'all':!![]}];}_0x50b5a5=_[_0x53e8('0x3b')]({},_0x50b5a5,_0x1b29c2[_0x53e8('0x47')]);return db[_0x53e8('0x2b')]['find'](_0x50b5a5)['then'](handleEntityNotFound(_0x49c918,null))[_0x53e8('0x22')](respondWithResult(_0x49c918,null))[_0x53e8('0x43')](handleError(_0x49c918,null));};exports['create']=function(_0x29c13c,_0x52a8cf){return db[_0x53e8('0x2b')][_0x53e8('0x48')](_0x29c13c['body'],{})[_0x53e8('0x22')](function(_0x8997f){var _0x46ba7e=_0x29c13c[_0x53e8('0x49')][_0x53e8('0x23')]({'plain':!![]});if(!_0x46ba7e)throw new Error(_0x53e8('0x4a'));if(_0x46ba7e['role']===_0x53e8('0x49')){var _0x565ff8=_0x8997f[_0x53e8('0x23')]({'plain':!![]});var _0x41b6dc=_0x53e8('0x24');return db['UserProfileSection'][_0x53e8('0x4b')]({'where':{'name':_0x41b6dc,'userProfileId':_0x46ba7e['userProfileId']},'raw':!![]})[_0x53e8('0x22')](function(_0x16f57f){if(_0x16f57f&&_0x16f57f[_0x53e8('0x4c')]===0x0){return db['UserProfileResource'][_0x53e8('0x48')]({'name':_0x565ff8[_0x53e8('0x28')],'resourceId':_0x565ff8['id'],'type':_0x16f57f[_0x53e8('0x28')],'sectionId':_0x16f57f['id']},{})[_0x53e8('0x22')](function(){return _0x8997f;});}else{return _0x8997f;}})[_0x53e8('0x43')](function(_0x2f95a3){logger[_0x53e8('0x27')](_0x53e8('0x4d'),_0x2f95a3);throw _0x2f95a3;});}return _0x8997f;})['then'](respondWithResult(_0x52a8cf,0xc9))[_0x53e8('0x43')](handleError(_0x52a8cf,null));};exports[_0x53e8('0x21')]=function(_0x49a2a8,_0x8b2a5a){if(_0x49a2a8['body']['id']){delete _0x49a2a8['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x49a2a8[_0x53e8('0x45')]['id']}})[_0x53e8('0x22')](handleEntityNotFound(_0x8b2a5a,null))[_0x53e8('0x22')](saveUpdates(_0x49a2a8[_0x53e8('0x4e')],null))[_0x53e8('0x22')](respondWithResult(_0x8b2a5a,null))['catch'](handleError(_0x8b2a5a,null));};exports[_0x53e8('0x26')]=function(_0x1c9568,_0x4eef81){return db['Schedule']['find']({'where':{'id':_0x1c9568[_0x53e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4eef81,null))[_0x53e8('0x22')](removeEntity(_0x4eef81,null))['catch'](handleError(_0x4eef81,null));};exports[_0x53e8('0x4f')]=function(_0x5058f8,_0x418f60,_0x5220b4){var _0x1b8225=require('../../config/schedule');return db['Schedule'][_0x53e8('0x4b')]({'where':{'id':_0x5058f8[_0x53e8('0x45')]['id']},'raw':!![]})[_0x53e8('0x22')](handleEntityNotFound(_0x418f60,null))[_0x53e8('0x22')](function(){_0x1b8225[_0x53e8('0x4f')](_0x5058f8[_0x53e8('0x45')]['id']);})['then'](respondWithStatusCode(_0x418f60,null))[_0x53e8('0x43')](handleError(_0x418f60,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 174f303..0b68e6c 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 _0x24f0=['define','Schedule','lodash','../../config/logger','api','request-promise','path','../../config/environment','exports'];(function(_0x50fd8a,_0x26ca95){var _0x1f8176=function(_0x48eb0c){while(--_0x48eb0c){_0x50fd8a['push'](_0x50fd8a['shift']());}};_0x1f8176(++_0x26ca95);}(_0x24f0,0x77));var _0x024f=function(_0x56470b,_0x4cc236){_0x56470b=_0x56470b-0x0;var _0x3decd4=_0x24f0[_0x56470b];return _0x3decd4;};'use strict';var _=require(_0x024f('0x0'));var util=require('util');var logger=require(_0x024f('0x1'))(_0x024f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x024f('0x3'));var fs=require('fs');var path=require(_0x024f('0x4'));var rimraf=require('rimraf');var config=require(_0x024f('0x5'));var attributes=require('./schedule.attributes');module[_0x024f('0x6')]=function(_0x4fa0f8,_0x4c3211){return _0x4fa0f8[_0x024f('0x7')](_0x024f('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8990=['Schedule','tools_schedules','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./schedule.attributes','define'];(function(_0x579ff3,_0x1f5f13){var _0x233efd=function(_0x555b8d){while(--_0x555b8d){_0x579ff3['push'](_0x579ff3['shift']());}};_0x233efd(++_0x1f5f13);}(_0x8990,0x1ec));var _0x0899=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x8990[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x0899('0x0'));var util=require(_0x0899('0x1'));var logger=require(_0x0899('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0899('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0899('0x4'));var config=require(_0x0899('0x5'));var attributes=require(_0x0899('0x6'));module['exports']=function(_0x4092ee,_0x1e2ba1){return _0x4092ee[_0x0899('0x7')](_0x0899('0x8'),attributes,{'tableName':_0x0899('0x9'),'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 ee360ff..1cbfe01 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 _0x710c=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0xdbe5e8,_0x4fd94a){var _0x3e2a79=function(_0x45cd35){while(--_0x45cd35){_0xdbe5e8['push'](_0xdbe5e8['shift']());}};_0x3e2a79(++_0x4fd94a);}(_0x710c,0x190));var _0xc710=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x710c[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0xc710('0x0'));var util=require(_0xc710('0x1'));var moment=require('moment');var BPromise=require(_0xc710('0x2'));var rs=require(_0xc710('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc710('0x4'))['db'];var utils=require(_0xc710('0x5'));var logger=require('../../config/logger')(_0xc710('0x6'));var config=require(_0xc710('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc710('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3efef9,_0x1dad5e,_0x40cc88){return new BPromise(function(_0x232c5f,_0xb5fab0){return client[_0xc710('0x9')](_0x3efef9,_0x40cc88)[_0xc710('0xa')](function(_0x57b5cf){logger[_0xc710('0xb')](_0xc710('0xc'),_0x1dad5e,'request\x20sent');logger['debug'](_0xc710('0xd'),_0x1dad5e,_0xc710('0xe'),JSON[_0xc710('0xf')](_0x57b5cf));if(_0x57b5cf[_0xc710('0x10')]){if(_0x57b5cf[_0xc710('0x10')][_0xc710('0x11')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x1dad5e,_0x57b5cf[_0xc710('0x10')][_0xc710('0x12')]);return _0xb5fab0(_0x57b5cf[_0xc710('0x10')]['message']);}logger[_0xc710('0x10')](_0xc710('0xc'),_0x1dad5e,_0x57b5cf[_0xc710('0x10')][_0xc710('0x12')]);return _0x232c5f(_0x57b5cf[_0xc710('0x10')][_0xc710('0x12')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x1dad5e,'request\x20sent');_0x232c5f(_0x57b5cf[_0xc710('0x13')]['message']);}})[_0xc710('0x14')](function(_0x23d628){logger[_0xc710('0x10')](_0xc710('0xc'),_0x1dad5e,_0x23d628);_0xb5fab0(_0x23d628);});});} \ No newline at end of file +var _0x8bae=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','Schedule,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x313b8f,_0x845e2d){var _0x5bc1fa=function(_0x1e685a){while(--_0x1e685a){_0x313b8f['push'](_0x313b8f['shift']());}};_0x5bc1fa(++_0x845e2d);}(_0x8bae,0x16f));var _0xe8ba=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x8bae[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xe8ba('0x0'));var util=require(_0xe8ba('0x1'));var moment=require(_0xe8ba('0x2'));var BPromise=require(_0xe8ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8ba('0x4'));var db=require(_0xe8ba('0x5'))['db'];var utils=require(_0xe8ba('0x6'));var logger=require(_0xe8ba('0x7'))(_0xe8ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xe8ba('0x9'));var client=jayson[_0xe8ba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51bdd5,_0x6f6716,_0x1e86f5){return new BPromise(function(_0x20531c,_0xd456f3){return client[_0xe8ba('0xb')](_0x51bdd5,_0x1e86f5)[_0xe8ba('0xc')](function(_0x4588b1){logger['info']('Schedule,\x20%s,\x20%s',_0x6f6716,_0xe8ba('0xd'));logger[_0xe8ba('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x6f6716,_0xe8ba('0xd'),JSON[_0xe8ba('0xf')](_0x4588b1));if(_0x4588b1[_0xe8ba('0x10')]){if(_0x4588b1[_0xe8ba('0x10')][_0xe8ba('0x11')]===0x1f4){logger['error'](_0xe8ba('0x12'),_0x6f6716,_0x4588b1[_0xe8ba('0x10')][_0xe8ba('0x13')]);return _0xd456f3(_0x4588b1['error']['message']);}logger['error'](_0xe8ba('0x12'),_0x6f6716,_0x4588b1['error'][_0xe8ba('0x13')]);return _0x20531c(_0x4588b1['error'][_0xe8ba('0x13')]);}else{logger[_0xe8ba('0x14')](_0xe8ba('0x12'),_0x6f6716,_0xe8ba('0xd'));_0x20531c(_0x4588b1[_0xe8ba('0x15')][_0xe8ba('0x13')]);}})[_0xe8ba('0x16')](function(_0x29c1a0){logger['error'](_0xe8ba('0x12'),_0x6f6716,_0x29c1a0);_0xd456f3(_0x29c1a0);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ee10db7..15bd645 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 _0x51f2=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','create'];(function(_0x8bb935,_0x2eb788){var _0x17696c=function(_0x6ad288){while(--_0x6ad288){_0x8bb935['push'](_0x8bb935['shift']());}};_0x17696c(++_0x2eb788);}(_0x51f2,0xeb));var _0x251f=function(_0x348e92,_0x17ddd5){_0x348e92=_0x348e92-0x0;var _0x140b2c=_0x51f2[_0x348e92];return _0x140b2c;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require(_0x251f('0x4'));var router=express[_0x251f('0x5')]();var auth=require(_0x251f('0x6'));var interaction=require(_0x251f('0x7'));var config=require(_0x251f('0x8'));var controller=require('./screenRecording.controller');router[_0x251f('0x9')]('/',auth[_0x251f('0xa')](),controller[_0x251f('0xb')]);router[_0x251f('0x9')](_0x251f('0xc'),auth['isAuthenticated'](),controller[_0x251f('0xd')]);router[_0x251f('0x9')](_0x251f('0xe'),auth[_0x251f('0xa')](),controller['show']);router[_0x251f('0x9')](_0x251f('0xf'),auth[_0x251f('0xa')](),controller[_0x251f('0x10')]);router['post']('/',auth[_0x251f('0xa')](),controller[_0x251f('0x11')]);router[_0x251f('0x12')](_0x251f('0xe'),auth['isAuthenticated'](),controller[_0x251f('0x13')]);router[_0x251f('0x14')](_0x251f('0xe'),auth[_0x251f('0xa')](),controller[_0x251f('0x15')]);module[_0x251f('0x16')]=router; \ No newline at end of file +var _0xc07b=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','create','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc07b,0x1a3));var _0xbc07=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xc07b[_0xe39824];return _0x4bc31e;};'use strict';var multer=require('multer');var util=require(_0xbc07('0x0'));var path=require(_0xbc07('0x1'));var timeout=require(_0xbc07('0x2'));var express=require(_0xbc07('0x3'));var router=express[_0xbc07('0x4')]();var auth=require(_0xbc07('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc07('0x6'));var controller=require(_0xbc07('0x7'));router[_0xbc07('0x8')]('/',auth[_0xbc07('0x9')](),controller[_0xbc07('0xa')]);router['get'](_0xbc07('0xb'),auth[_0xbc07('0x9')](),controller[_0xbc07('0xc')]);router[_0xbc07('0x8')](_0xbc07('0xd'),auth[_0xbc07('0x9')](),controller[_0xbc07('0xe')]);router[_0xbc07('0x8')](_0xbc07('0xf'),auth[_0xbc07('0x9')](),controller[_0xbc07('0x10')]);router['post']('/',auth[_0xbc07('0x9')](),controller[_0xbc07('0x11')]);router['put'](_0xbc07('0xd'),auth[_0xbc07('0x9')](),controller[_0xbc07('0x12')]);router[_0xbc07('0x13')](_0xbc07('0xd'),auth['isAuthenticated'](),controller[_0xbc07('0x14')]);module[_0xbc07('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index a5cae4f..e2cdb6e 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 _0x0e12=['startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','setDataValue','INTEGER'];(function(_0x53b7c2,_0x4b8b49){var _0x2a682a=function(_0x3a1a80){while(--_0x3a1a80){_0x53b7c2['push'](_0x53b7c2['shift']());}};_0x2a682a(++_0x4b8b49);}(_0x0e12,0x180));var _0x20e1=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x0e12[_0x3f88bc];return _0x4df1c4;};'use strict';var Sequelize=require(_0x20e1('0x0'));var moment=require(_0x20e1('0x1'));var path=require(_0x20e1('0x2'));var config=require(_0x20e1('0x3'));module[_0x20e1('0x4')]={'format':{'type':Sequelize[_0x20e1('0x5')],'get':function(){return this[_0x20e1('0x6')]('value')?path[_0x20e1('0x7')](this[_0x20e1('0x6')](_0x20e1('0x8'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x20e1('0x9')]},'value':{'type':Sequelize[_0x20e1('0x9')],'set':function(_0x51499b){var _0x33efe6=_0x51499b['replace'](/\\/g,'/');this[_0x20e1('0xa')]('value',_0x33efe6);}},'rating':{'type':Sequelize[_0x20e1('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x20e1('0xb')],'set':function(_0x4e9e99){this[_0x20e1('0xa')](_0x20e1('0xc'),moment()[_0x20e1('0xd')](_0x4e9e99,'ms'));this[_0x20e1('0xa')](_0x20e1('0xe'),moment());this[_0x20e1('0xa')](_0x20e1('0xf'),_0x4e9e99);}},'startedAt':{'type':Sequelize[_0x20e1('0x10')],'get':function(){return moment(this[_0x20e1('0x6')]('startedAt'))[_0x20e1('0x11')](_0x20e1('0x12'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x20e1('0x6')](_0x20e1('0xe')))[_0x20e1('0x11')](_0x20e1('0x12'))[_0x20e1('0x13')]();}},'createdAt':{'type':Sequelize[_0x20e1('0x10')],'get':function(){return moment(this[_0x20e1('0x6')](_0x20e1('0x14')))['format'](_0x20e1('0x12'))[_0x20e1('0x13')]();}},'updatedAt':{'type':Sequelize[_0x20e1('0x10')],'get':function(){return moment(this[_0x20e1('0x6')](_0x20e1('0x15')))['format'](_0x20e1('0x12'))['toString']();}}}; \ No newline at end of file +var _0x5227=['toString','format','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x5227,0x1d1));var _0x7522=function(_0x2170e3,_0x39d8c4){_0x2170e3=_0x2170e3-0x0;var _0x4b1363=_0x5227[_0x2170e3];return _0x4b1363;};'use strict';var Sequelize=require(_0x7522('0x0'));var moment=require(_0x7522('0x1'));var path=require(_0x7522('0x2'));var config=require(_0x7522('0x3'));module[_0x7522('0x4')]={'format':{'type':Sequelize[_0x7522('0x5')],'get':function(){return this['getDataValue'](_0x7522('0x6'))?path[_0x7522('0x7')](this[_0x7522('0x8')](_0x7522('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7522('0x9')]},'value':{'type':Sequelize[_0x7522('0x9')],'set':function(_0x26767c){var _0xcdd5cd=_0x26767c[_0x7522('0xa')](/\\/g,'/');this[_0x7522('0xb')](_0x7522('0x6'),_0xcdd5cd);}},'rating':{'type':Sequelize[_0x7522('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7522('0xc')],'set':function(_0x2c5e56){this[_0x7522('0xb')](_0x7522('0xd'),moment()[_0x7522('0xe')](_0x2c5e56,'ms'));this['setDataValue'](_0x7522('0xf'),moment());this[_0x7522('0xb')](_0x7522('0x10'),_0x2c5e56);}},'startedAt':{'type':Sequelize[_0x7522('0x11')],'get':function(){return moment(this[_0x7522('0x8')](_0x7522('0xd')))['format'](_0x7522('0x12'))[_0x7522('0x13')]();}},'closedAt':{'type':Sequelize[_0x7522('0x11')],'get':function(){return moment(this[_0x7522('0x8')](_0x7522('0xf')))[_0x7522('0x14')](_0x7522('0x12'))[_0x7522('0x13')]();}},'createdAt':{'type':Sequelize[_0x7522('0x11')],'get':function(){return moment(this[_0x7522('0x8')]('createdAt'))['format'](_0x7522('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x7522('0x11')],'get':function(){return moment(this[_0x7522('0x8')](_0x7522('0x15')))[_0x7522('0x14')](_0x7522('0x12'))[_0x7522('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 625ad48..85ae9f4 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 _0xdc1e=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','destroy','error','name','send','ScreenRecording','rawAttributes','model','differenceBy','format','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','length','body','update','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x543a4f,_0x2c629f){var _0x8a1aaf=function(_0xe38c40){while(--_0xe38c40){_0x543a4f['push'](_0x543a4f['shift']());}};_0x8a1aaf(++_0x2c629f);}(_0xdc1e,0x1bd));var _0xedc1=function(_0x17d497,_0x28f378){_0x17d497=_0x17d497-0x0;var _0x210de8=_0xdc1e[_0x17d497];return _0x210de8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xedc1('0x0'));var rimraf=require(_0xedc1('0x1'));var zipdir=require(_0xedc1('0x2'));var jsonpatch=require(_0xedc1('0x3'));var rp=require(_0xedc1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xedc1('0x5'));var path=require(_0xedc1('0x6'));var sox=require(_0xedc1('0x7'));var csv=require(_0xedc1('0x8'));var ejs=require(_0xedc1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xedc1('0xa'));var crypto=require('crypto');var jsforce=require(_0xedc1('0xb'));var deskjs=require(_0xedc1('0xc'));var toCsv=require(_0xedc1('0x8'));var querystring=require(_0xedc1('0xd'));var Papa=require(_0xedc1('0xe'));var Redis=require(_0xedc1('0xf'));var authService=require(_0xedc1('0x10'));var qs=require(_0xedc1('0x11'));var hardwareService=require(_0xedc1('0x12'));var logger=require('../../config/logger')(_0xedc1('0x13'));var utils=require(_0xedc1('0x14'));var config=require(_0xedc1('0x15'));var db=require(_0xedc1('0x16'))['db'];function respondWithStatusCode(_0x35679a,_0x5ea687){_0x5ea687=_0x5ea687||0xcc;return function(_0x2fbd68){if(_0x2fbd68){return _0x35679a[_0xedc1('0x17')](_0x5ea687);}return _0x35679a['status'](_0x5ea687)[_0xedc1('0x18')]();};}function respondWithResult(_0x972216,_0x38c94d){_0x38c94d=_0x38c94d||0xc8;return function(_0x641629){if(_0x641629){return _0x972216[_0xedc1('0x19')](_0x38c94d)[_0xedc1('0x1a')](_0x641629);}};}function respondWithFilteredResult(_0x63adef,_0x390eca){return function(_0x16af00){if(_0x16af00){var _0x5ae9ad=_0x16af00[_0xedc1('0x1b')],_0x1b0a3a=_0x390eca[_0xedc1('0x1c')],_0x2a4ce4=_0x390eca['offset']+_0x390eca[_0xedc1('0x1d')],_0x38d4ce;if(_0x2a4ce4>=_0x5ae9ad){_0x2a4ce4=_0x5ae9ad;_0x38d4ce=0xc8;}else{_0x38d4ce=0xce;}_0x63adef[_0xedc1('0x19')](_0x38d4ce);return _0x63adef[_0xedc1('0x1e')]('Content-Range',_0x1b0a3a+'-'+_0x2a4ce4+'/'+_0x5ae9ad)[_0xedc1('0x1a')](_0x16af00);}return null;};}function patchUpdates(_0x20a14b){return function(_0x531671){try{jsonpatch[_0xedc1('0x1f')](_0x531671,_0x20a14b,!![]);}catch(_0x394658){return BPromise[_0xedc1('0x20')](_0x394658);}return _0x531671[_0xedc1('0x21')]();};}function saveUpdates(_0x54cd95,_0x54832d){return function(_0x1981f8){if(_0x1981f8){return _0x1981f8['update'](_0x54cd95)[_0xedc1('0x22')](function(_0x298d22){return _0x298d22;});}return null;};}function removeEntity(_0x3e1501,_0x4b8878){return function(_0x2cafbd){if(_0x2cafbd){return _0x2cafbd[_0xedc1('0x23')]()[_0xedc1('0x22')](function(){_0x3e1501[_0xedc1('0x19')](0xcc)[_0xedc1('0x18')]();});}};}function handleEntityNotFound(_0x1e6c8b,_0x15c5aa){return function(_0x3019f6){if(!_0x3019f6){_0x1e6c8b[_0xedc1('0x17')](0x194);}return _0x3019f6;};}function handleError(_0x6e66ee,_0x47d87a){_0x47d87a=_0x47d87a||0x1f4;return function(_0x478dc1){logger[_0xedc1('0x24')](_0x478dc1['stack']);if(_0x478dc1[_0xedc1('0x25')]){delete _0x478dc1[_0xedc1('0x25')];}_0x6e66ee[_0xedc1('0x19')](_0x47d87a)[_0xedc1('0x26')](_0x478dc1);};}exports['index']=function(_0x141ffc,_0x7dab1e){var _0x5972ec={},_0x154e1c={},_0x384bab={'count':0x0,'rows':[]};var _0x79d2f8=db[_0xedc1('0x27')][_0xedc1('0x28')];_0x154e1c[_0xedc1('0x29')]=_[_0xedc1('0x2a')](_['keys'](_0x79d2f8),[_0xedc1('0x2b')]);_0x154e1c[_0xedc1('0x2c')]=_['keys'](_0x141ffc[_0xedc1('0x2c')]);_0x154e1c[_0xedc1('0x2d')]=_[_0xedc1('0x2e')](_0x154e1c['model'],_0x154e1c[_0xedc1('0x2c')]);_0x5972ec[_0xedc1('0x2f')]=_[_0xedc1('0x2e')](_0x154e1c[_0xedc1('0x29')],qs[_0xedc1('0x30')](_0x141ffc[_0xedc1('0x2c')]['fields']));_0x5972ec[_0xedc1('0x2f')]=_0x5972ec['attributes']['length']?_0x5972ec[_0xedc1('0x2f')]:_0x154e1c[_0xedc1('0x29')];if(!_0x141ffc[_0xedc1('0x2c')]['hasOwnProperty']('nolimit')){_0x5972ec['limit']=qs[_0xedc1('0x1d')](_0x141ffc[_0xedc1('0x2c')][_0xedc1('0x1d')]);_0x5972ec[_0xedc1('0x1c')]=qs[_0xedc1('0x1c')](_0x141ffc['query'][_0xedc1('0x1c')]);}_0x5972ec[_0xedc1('0x31')]=qs[_0xedc1('0x32')](_0x141ffc['query'][_0xedc1('0x32')]);_0x5972ec[_0xedc1('0x33')]=qs[_0xedc1('0x2d')](_[_0xedc1('0x34')](_0x141ffc[_0xedc1('0x2c')],_0x154e1c[_0xedc1('0x2d')]));if(_0x141ffc[_0xedc1('0x2c')][_0xedc1('0x35')]){_0x5972ec[_0xedc1('0x33')]=_['merge'](_0x5972ec[_0xedc1('0x33')],{'$or':_[_0xedc1('0x36')](_0x79d2f8,function(_0x25af5e){if(_0x25af5e[_0xedc1('0x37')]['key']!==_0xedc1('0x38')){var _0x4c273c={};_0x4c273c[_0x25af5e[_0xedc1('0x39')]]={'$like':'%'+_0x141ffc[_0xedc1('0x2c')]['filter']+'%'};return _0x4c273c;}})});}_0x5972ec=_[_0xedc1('0x3a')]({},_0x5972ec,_0x141ffc[_0xedc1('0x3b')]);var _0x39b825={'where':_0x5972ec['where']};return db[_0xedc1('0x27')][_0xedc1('0x1b')](_0x39b825)[_0xedc1('0x22')](function(_0x3156a4){_0x384bab[_0xedc1('0x1b')]=_0x3156a4;if(_0x141ffc[_0xedc1('0x2c')][_0xedc1('0x3c')]){_0x5972ec[_0xedc1('0x3d')]=[{'all':!![]}];}return db[_0xedc1('0x27')][_0xedc1('0x3e')](_0x5972ec);})[_0xedc1('0x22')](function(_0x2e1af0){_0x384bab[_0xedc1('0x3f')]=_0x2e1af0;return _0x384bab;})[_0xedc1('0x22')](respondWithFilteredResult(_0x7dab1e,_0x5972ec))[_0xedc1('0x40')](handleError(_0x7dab1e,null));};exports[_0xedc1('0x41')]=function(_0x341728,_0x2d2252){var _0xc4c42a={'raw':![],'where':{'id':_0x341728[_0xedc1('0x42')]['id']}},_0x2c5298={};_0x2c5298[_0xedc1('0x29')]=_['keys'](db[_0xedc1('0x27')][_0xedc1('0x28')]);_0x2c5298[_0xedc1('0x2c')]=_['keys'](_0x341728['query']);_0x2c5298[_0xedc1('0x2d')]=_[_0xedc1('0x2e')](_0x2c5298[_0xedc1('0x29')],_0x2c5298['query']);_0xc4c42a[_0xedc1('0x2f')]=_['intersection'](_0x2c5298[_0xedc1('0x29')],qs[_0xedc1('0x30')](_0x341728[_0xedc1('0x2c')][_0xedc1('0x30')]));_0xc4c42a[_0xedc1('0x2f')]=_0xc4c42a[_0xedc1('0x2f')][_0xedc1('0x43')]?_0xc4c42a[_0xedc1('0x2f')]:_0x2c5298[_0xedc1('0x29')];if(_0x341728['query']['includeAll']){_0xc4c42a['include']=[{'all':!![]}];}_0xc4c42a=_['merge']({},_0xc4c42a,_0x341728['options']);return db['ScreenRecording']['find'](_0xc4c42a)[_0xedc1('0x22')](handleEntityNotFound(_0x2d2252,null))[_0xedc1('0x22')](respondWithResult(_0x2d2252,null))[_0xedc1('0x40')](handleError(_0x2d2252,null));};exports['create']=function(_0x42373e,_0x2aa339){return db['ScreenRecording']['create'](_0x42373e[_0xedc1('0x44')],{})[_0xedc1('0x22')](respondWithResult(_0x2aa339,0xc9))[_0xedc1('0x40')](handleError(_0x2aa339,null));};exports[_0xedc1('0x45')]=function(_0x2b8742,_0x4dc42e){if(_0x2b8742[_0xedc1('0x44')]['id']){delete _0x2b8742['body']['id'];}delete _0x2b8742[_0xedc1('0x44')]['duration'];delete _0x2b8742[_0xedc1('0x44')][_0xedc1('0x46')];delete _0x2b8742[_0xedc1('0x44')][_0xedc1('0x47')];delete _0x2b8742[_0xedc1('0x44')][_0xedc1('0x48')];return db['ScreenRecording']['find']({'where':{'id':_0x2b8742[_0xedc1('0x42')]['id']}})[_0xedc1('0x22')](handleEntityNotFound(_0x4dc42e,null))[_0xedc1('0x22')](saveUpdates(_0x2b8742[_0xedc1('0x44')],null))[_0xedc1('0x22')](respondWithResult(_0x4dc42e,null))['catch'](handleError(_0x4dc42e,null));};exports[_0xedc1('0x23')]=function(_0x21b1a9,_0x361069){return db[_0xedc1('0x27')][_0xedc1('0x49')]({'where':{'id':_0x21b1a9['params']['id']}})['then'](handleEntityNotFound(_0x361069,null))[_0xedc1('0x22')](removeEntity(_0x361069,null))[_0xedc1('0x40')](handleError(_0x361069,null));};exports[_0xedc1('0x4a')]=function(_0x193a23,_0x56f0ab){return db['ScreenRecording'][_0xedc1('0x4a')]()[_0xedc1('0x22')](respondWithResult(_0x56f0ab,null))[_0xedc1('0x40')](handleError(_0x56f0ab,null));};exports[_0xedc1('0x4b')]=function(_0x23c9e4,_0x131750,_0x2b143f){var _0x4e83c7=require(_0xedc1('0x4c'));var _0x4efd3f=![];var _0x413ebe={};if(_0x23c9e4['query']['type']&&_0x23c9e4[_0xedc1('0x2c')]['type']==='uniqueid'){_0x413ebe[_0xedc1('0x4d')]=_0x23c9e4[_0xedc1('0x42')]['id'];}else{_0x413ebe['id']=_0x23c9e4[_0xedc1('0x42')]['id'];}return db[_0xedc1('0x27')][_0xedc1('0x49')]({'where':_0x413ebe,'attributes':['id',_0xedc1('0x48')],'raw':!![]})[_0xedc1('0x22')](handleEntityNotFound(_0x131750,null))[_0xedc1('0x22')](function(_0x46eef3){if(_0x46eef3){var _0x27d807=path[_0xedc1('0x4e')](config[_0xedc1('0x4f')],_0xedc1('0x50'),_0x46eef3[_0xedc1('0x48')]);var _0x444db7=util[_0xedc1('0x2b')](_0xedc1('0x51'),_0x27d807);if(fs[_0xedc1('0x52')](_0x444db7)){_0x4efd3f=!![];return _0x4e83c7['decryptFile'](_0x444db7,_0x27d807,config[_0xedc1('0x53')]['recording'])[_0xedc1('0x22')](function(){return _0x46eef3;});}return _0x46eef3;}})[_0xedc1('0x22')](function(_0x338074){if(_0x338074){var _0x3cad78=path[_0xedc1('0x4e')](config['root'],_0xedc1('0x50'),_0x338074['value']);if(!fs[_0xedc1('0x52')](_0x3cad78)){throw new db[(_0xedc1('0x54'))]['ValidationError'](_0xedc1('0x55'));}if(_0x338074[_0xedc1('0x56')]){return _0x131750['download'](_0x3cad78,_0x338074[_0xedc1('0x56')]+path[_0xedc1('0x57')](_0x3cad78),function(){if(_0x4efd3f){fs[_0xedc1('0x58')](_0x3cad78);}});}else{return _0x131750[_0xedc1('0x4b')](_0x3cad78,function(_0x1ee33f){if(_0x4efd3f){fs[_0xedc1('0x58')](_0x3cad78);}});}}})[_0xedc1('0x40')](function(_0x3df9e6){if(_0x3df9e6[_0xedc1('0x59')]==='ScreenRecording\x20not\x20found'){_0x131750['status'](0x194)[_0xedc1('0x26')](_0xedc1('0x5a'));}else{return handleError(_0x131750,null);}});}; \ No newline at end of file +var _0xb3c5=['uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','save','update','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','differenceBy','keys','format','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','closedAt','value','download','../../components/encryptor'];(function(_0x29d87d,_0x23dc31){var _0x1fd84b=function(_0x4e2aa1){while(--_0x4e2aa1){_0x29d87d['push'](_0x29d87d['shift']());}};_0x1fd84b(++_0x23dc31);}(_0xb3c5,0x120));var _0x5b3c=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xb3c5[_0x1c0991];return _0x5034de;};'use strict';var pdf=require(_0x5b3c('0x0'));var emlformat=require(_0x5b3c('0x1'));var rimraf=require(_0x5b3c('0x2'));var zipdir=require(_0x5b3c('0x3'));var jsonpatch=require(_0x5b3c('0x4'));var rp=require(_0x5b3c('0x5'));var moment=require(_0x5b3c('0x6'));var BPromise=require(_0x5b3c('0x7'));var Mustache=require('mustache');var util=require(_0x5b3c('0x8'));var path=require(_0x5b3c('0x9'));var sox=require(_0x5b3c('0xa'));var csv=require(_0x5b3c('0xb'));var ejs=require(_0x5b3c('0xc'));var fs=require('fs');var _=require(_0x5b3c('0xd'));var squel=require(_0x5b3c('0xe'));var crypto=require(_0x5b3c('0xf'));var jsforce=require(_0x5b3c('0x10'));var deskjs=require(_0x5b3c('0x11'));var toCsv=require(_0x5b3c('0xb'));var querystring=require('querystring');var Papa=require(_0x5b3c('0x12'));var Redis=require('ioredis');var authService=require(_0x5b3c('0x13'));var qs=require(_0x5b3c('0x14'));var hardwareService=require(_0x5b3c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5b3c('0x16'));var config=require(_0x5b3c('0x17'));var db=require(_0x5b3c('0x18'))['db'];function respondWithStatusCode(_0x41f905,_0x157c15){_0x157c15=_0x157c15||0xcc;return function(_0x392275){if(_0x392275){return _0x41f905['sendStatus'](_0x157c15);}return _0x41f905[_0x5b3c('0x19')](_0x157c15)[_0x5b3c('0x1a')]();};}function respondWithResult(_0x5e86be,_0x314987){_0x314987=_0x314987||0xc8;return function(_0x2501d6){if(_0x2501d6){return _0x5e86be[_0x5b3c('0x19')](_0x314987)['json'](_0x2501d6);}};}function respondWithFilteredResult(_0x2a88f5,_0x277135){return function(_0x5480af){if(_0x5480af){var _0x12ee53=_0x5480af[_0x5b3c('0x1b')],_0x130f96=_0x277135[_0x5b3c('0x1c')],_0x553252=_0x277135[_0x5b3c('0x1c')]+_0x277135[_0x5b3c('0x1d')],_0xb107b;if(_0x553252>=_0x12ee53){_0x553252=_0x12ee53;_0xb107b=0xc8;}else{_0xb107b=0xce;}_0x2a88f5[_0x5b3c('0x19')](_0xb107b);return _0x2a88f5[_0x5b3c('0x1e')]('Content-Range',_0x130f96+'-'+_0x553252+'/'+_0x12ee53)[_0x5b3c('0x1f')](_0x5480af);}return null;};}function patchUpdates(_0x54d477){return function(_0x10e915){try{jsonpatch[_0x5b3c('0x20')](_0x10e915,_0x54d477,!![]);}catch(_0x115a75){return BPromise['reject'](_0x115a75);}return _0x10e915[_0x5b3c('0x21')]();};}function saveUpdates(_0x4e37ce,_0x13f2b6){return function(_0x190fde){if(_0x190fde){return _0x190fde[_0x5b3c('0x22')](_0x4e37ce)[_0x5b3c('0x23')](function(_0x3e0411){return _0x3e0411;});}return null;};}function removeEntity(_0x4b9d13,_0x51a4d1){return function(_0x23abd5){if(_0x23abd5){return _0x23abd5[_0x5b3c('0x24')]()[_0x5b3c('0x23')](function(){_0x4b9d13[_0x5b3c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548313,_0x47cda6){return function(_0x8f87f5){if(!_0x8f87f5){_0x548313['sendStatus'](0x194);}return _0x8f87f5;};}function handleError(_0x40feba,_0x40bf40){_0x40bf40=_0x40bf40||0x1f4;return function(_0x15deb5){logger[_0x5b3c('0x25')](_0x15deb5[_0x5b3c('0x26')]);if(_0x15deb5[_0x5b3c('0x27')]){delete _0x15deb5[_0x5b3c('0x27')];}_0x40feba[_0x5b3c('0x19')](_0x40bf40)[_0x5b3c('0x28')](_0x15deb5);};}exports[_0x5b3c('0x29')]=function(_0x9e1a7,_0x1f7f5d){var _0x5a575f={},_0x513c68={},_0x412698={'count':0x0,'rows':[]};var _0x382c7c=db[_0x5b3c('0x2a')][_0x5b3c('0x2b')];_0x513c68['model']=_[_0x5b3c('0x2c')](_[_0x5b3c('0x2d')](_0x382c7c),[_0x5b3c('0x2e')]);_0x513c68['query']=_[_0x5b3c('0x2d')](_0x9e1a7['query']);_0x513c68[_0x5b3c('0x2f')]=_[_0x5b3c('0x30')](_0x513c68[_0x5b3c('0x31')],_0x513c68['query']);_0x5a575f[_0x5b3c('0x32')]=_[_0x5b3c('0x30')](_0x513c68[_0x5b3c('0x31')],qs[_0x5b3c('0x33')](_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x33')]));_0x5a575f[_0x5b3c('0x32')]=_0x5a575f[_0x5b3c('0x32')][_0x5b3c('0x35')]?_0x5a575f[_0x5b3c('0x32')]:_0x513c68[_0x5b3c('0x31')];if(!_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x36')](_0x5b3c('0x37'))){_0x5a575f[_0x5b3c('0x1d')]=qs['limit'](_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x1d')]);_0x5a575f[_0x5b3c('0x1c')]=qs['offset'](_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x1c')]);}_0x5a575f['order']=qs[_0x5b3c('0x38')](_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x38')]);_0x5a575f[_0x5b3c('0x39')]=qs[_0x5b3c('0x2f')](_[_0x5b3c('0x3a')](_0x9e1a7[_0x5b3c('0x34')],_0x513c68['filters']));if(_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x3b')]){_0x5a575f['where']=_[_0x5b3c('0x3c')](_0x5a575f[_0x5b3c('0x39')],{'$or':_[_0x5b3c('0x3d')](_0x382c7c,function(_0x3597bf){if(_0x3597bf[_0x5b3c('0x3e')]['key']!==_0x5b3c('0x3f')){var _0x1033e7={};_0x1033e7[_0x3597bf[_0x5b3c('0x40')]]={'$like':'%'+_0x9e1a7['query'][_0x5b3c('0x3b')]+'%'};return _0x1033e7;}})});}_0x5a575f=_[_0x5b3c('0x3c')]({},_0x5a575f,_0x9e1a7['options']);var _0x15ec29={'where':_0x5a575f[_0x5b3c('0x39')]};return db[_0x5b3c('0x2a')]['count'](_0x15ec29)[_0x5b3c('0x23')](function(_0x2109d7){_0x412698[_0x5b3c('0x1b')]=_0x2109d7;if(_0x9e1a7[_0x5b3c('0x34')][_0x5b3c('0x41')]){_0x5a575f['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x5b3c('0x42')](_0x5a575f);})[_0x5b3c('0x23')](function(_0x564ed5){_0x412698[_0x5b3c('0x43')]=_0x564ed5;return _0x412698;})[_0x5b3c('0x23')](respondWithFilteredResult(_0x1f7f5d,_0x5a575f))[_0x5b3c('0x44')](handleError(_0x1f7f5d,null));};exports[_0x5b3c('0x45')]=function(_0x486ded,_0x308551){var _0x45ad55={'raw':![],'where':{'id':_0x486ded[_0x5b3c('0x46')]['id']}},_0x5a7629={};_0x5a7629[_0x5b3c('0x31')]=_[_0x5b3c('0x2d')](db[_0x5b3c('0x2a')][_0x5b3c('0x2b')]);_0x5a7629[_0x5b3c('0x34')]=_[_0x5b3c('0x2d')](_0x486ded['query']);_0x5a7629[_0x5b3c('0x2f')]=_['intersection'](_0x5a7629[_0x5b3c('0x31')],_0x5a7629[_0x5b3c('0x34')]);_0x45ad55[_0x5b3c('0x32')]=_[_0x5b3c('0x30')](_0x5a7629['model'],qs[_0x5b3c('0x33')](_0x486ded[_0x5b3c('0x34')][_0x5b3c('0x33')]));_0x45ad55[_0x5b3c('0x32')]=_0x45ad55[_0x5b3c('0x32')][_0x5b3c('0x35')]?_0x45ad55[_0x5b3c('0x32')]:_0x5a7629['model'];if(_0x486ded['query'][_0x5b3c('0x41')]){_0x45ad55[_0x5b3c('0x47')]=[{'all':!![]}];}_0x45ad55=_[_0x5b3c('0x3c')]({},_0x45ad55,_0x486ded['options']);return db[_0x5b3c('0x2a')][_0x5b3c('0x48')](_0x45ad55)[_0x5b3c('0x23')](handleEntityNotFound(_0x308551,null))[_0x5b3c('0x23')](respondWithResult(_0x308551,null))[_0x5b3c('0x44')](handleError(_0x308551,null));};exports[_0x5b3c('0x49')]=function(_0x37adcf,_0x4d980e){return db[_0x5b3c('0x2a')][_0x5b3c('0x49')](_0x37adcf[_0x5b3c('0x4a')],{})[_0x5b3c('0x23')](respondWithResult(_0x4d980e,0xc9))[_0x5b3c('0x44')](handleError(_0x4d980e,null));};exports[_0x5b3c('0x22')]=function(_0x3658b4,_0xd199b9){if(_0x3658b4['body']['id']){delete _0x3658b4[_0x5b3c('0x4a')]['id'];}delete _0x3658b4[_0x5b3c('0x4a')][_0x5b3c('0x4b')];delete _0x3658b4[_0x5b3c('0x4a')]['createdAt'];delete _0x3658b4[_0x5b3c('0x4a')][_0x5b3c('0x4c')];delete _0x3658b4[_0x5b3c('0x4a')][_0x5b3c('0x4d')];return db[_0x5b3c('0x2a')]['find']({'where':{'id':_0x3658b4[_0x5b3c('0x46')]['id']}})['then'](handleEntityNotFound(_0xd199b9,null))[_0x5b3c('0x23')](saveUpdates(_0x3658b4[_0x5b3c('0x4a')],null))[_0x5b3c('0x23')](respondWithResult(_0xd199b9,null))[_0x5b3c('0x44')](handleError(_0xd199b9,null));};exports[_0x5b3c('0x24')]=function(_0x14bdbf,_0x4af50d){return db[_0x5b3c('0x2a')][_0x5b3c('0x48')]({'where':{'id':_0x14bdbf[_0x5b3c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4af50d,null))[_0x5b3c('0x23')](removeEntity(_0x4af50d,null))[_0x5b3c('0x44')](handleError(_0x4af50d,null));};exports['describe']=function(_0x5d85e8,_0x328769){return db['ScreenRecording']['describe']()[_0x5b3c('0x23')](respondWithResult(_0x328769,null))[_0x5b3c('0x44')](handleError(_0x328769,null));};exports[_0x5b3c('0x4e')]=function(_0x320aa4,_0x24a4a3,_0x221311){var _0x359c55=require(_0x5b3c('0x4f'));var _0x2aeb7f=![];var _0x1ba2fc={};if(_0x320aa4[_0x5b3c('0x34')]['type']&&_0x320aa4['query'][_0x5b3c('0x3e')]===_0x5b3c('0x50')){_0x1ba2fc[_0x5b3c('0x50')]=_0x320aa4[_0x5b3c('0x46')]['id'];}else{_0x1ba2fc['id']=_0x320aa4['params']['id'];}return db[_0x5b3c('0x2a')]['find']({'where':_0x1ba2fc,'attributes':['id','value'],'raw':!![]})[_0x5b3c('0x23')](handleEntityNotFound(_0x24a4a3,null))[_0x5b3c('0x23')](function(_0x331df1){if(_0x331df1){var _0x5c644d=path[_0x5b3c('0x51')](config['root'],_0x5b3c('0x52'),_0x331df1[_0x5b3c('0x4d')]);var _0x5c5fe7=util[_0x5b3c('0x2e')](_0x5b3c('0x53'),_0x5c644d);if(fs[_0x5b3c('0x54')](_0x5c5fe7)){_0x2aeb7f=!![];return _0x359c55[_0x5b3c('0x55')](_0x5c5fe7,_0x5c644d,config['secrets'][_0x5b3c('0x56')])[_0x5b3c('0x23')](function(){return _0x331df1;});}return _0x331df1;}})[_0x5b3c('0x23')](function(_0x25e4dd){if(_0x25e4dd){var _0xa48649=path[_0x5b3c('0x51')](config['root'],_0x5b3c('0x52'),_0x25e4dd[_0x5b3c('0x4d')]);if(!fs[_0x5b3c('0x54')](_0xa48649)){throw new db['Sequelize'][(_0x5b3c('0x57'))](_0x5b3c('0x58'));}if(_0x25e4dd['filename']){return _0x24a4a3[_0x5b3c('0x4e')](_0xa48649,_0x25e4dd[_0x5b3c('0x59')]+path['extname'](_0xa48649),function(){if(_0x2aeb7f){fs[_0x5b3c('0x5a')](_0xa48649);}});}else{return _0x24a4a3[_0x5b3c('0x4e')](_0xa48649,function(_0x172f21){if(_0x2aeb7f){fs['unlink'](_0xa48649);}});}}})[_0x5b3c('0x44')](function(_0x288391){if(_0x288391[_0x5b3c('0x5b')]===_0x5b3c('0x58')){_0x24a4a3['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x24a4a3,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index b781c50..0b41071 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 _0xe245=['isNil','value','join','root','server','files','existsSync','log','catch','resolve','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','screen_recordings','interactionid'];(function(_0xe33206,_0x403068){var _0x10b8b5=function(_0x7108c2){while(--_0x7108c2){_0xe33206['push'](_0xe33206['shift']());}};_0x10b8b5(++_0x403068);}(_0xe245,0x78));var _0x5e24=function(_0x111a7b,_0x26fa89){_0x111a7b=_0x111a7b-0x0;var _0x255ffe=_0xe245[_0x111a7b];return _0x255ffe;};'use strict';var _=require(_0x5e24('0x0'));var util=require(_0x5e24('0x1'));var logger=require(_0x5e24('0x2'))(_0x5e24('0x3'));var moment=require(_0x5e24('0x4'));var BPromise=require(_0x5e24('0x5'));var rp=require(_0x5e24('0x6'));var fs=require('fs');var path=require(_0x5e24('0x7'));var rimraf=require('rimraf');var config=require(_0x5e24('0x8'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x13da80,_0x4fefe5){return _0x13da80[_0x5e24('0x9')]('ScreenRecording',attributes,{'tableName':_0x5e24('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x5e24('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x4a58e0,_0x3ed866,_0x1af901){return new BPromise(function(_0x1c4181,_0x17a761){if(!_[_0x5e24('0xc')](_0x4a58e0[_0x5e24('0xd')])){var _0x5d5f1f=path[_0x5e24('0xe')](config[_0x5e24('0xf')],_0x5e24('0x10'),_0x5e24('0x11'),_0x5e24('0xa'),_0x4a58e0[_0x5e24('0xd')]);if(fs[_0x5e24('0x12')](_0x5d5f1f)){rimraf(_0x5d5f1f,function(_0x424a64){if(_0x424a64){console[_0x5e24('0x13')](_0x424a64);}});}}_0x1c4181();})[_0x5e24('0x14')](function(_0xc7b572){BPromise[_0x5e24('0x15')]();})['finally'](function(){_0x1af901();});}}});}; \ No newline at end of file +var _0xf4e6=['catch','resolve','finally','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','isNil','value','root','server','files','existsSync'];(function(_0x56f7db,_0x2e935f){var _0x4380f3=function(_0x23c227){while(--_0x23c227){_0x56f7db['push'](_0x56f7db['shift']());}};_0x4380f3(++_0x2e935f);}(_0xf4e6,0xd5));var _0x6f4e=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xf4e6[_0x149ca0];return _0x56b6b9;};'use strict';var _=require('lodash');var util=require(_0x6f4e('0x0'));var logger=require(_0x6f4e('0x1'))(_0x6f4e('0x2'));var moment=require('moment');var BPromise=require(_0x6f4e('0x3'));var rp=require(_0x6f4e('0x4'));var fs=require('fs');var path=require(_0x6f4e('0x5'));var rimraf=require('rimraf');var config=require(_0x6f4e('0x6'));var attributes=require(_0x6f4e('0x7'));module[_0x6f4e('0x8')]=function(_0x1c5aaa,_0x39b9b2){return _0x1c5aaa[_0x6f4e('0x9')](_0x6f4e('0xa'),attributes,{'tableName':_0x6f4e('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0xeb8489,_0x47bcd4,_0xc66765){return new BPromise(function(_0x4e5d98,_0x208549){if(!_[_0x6f4e('0xc')](_0xeb8489[_0x6f4e('0xd')])){var _0x33c650=path['join'](config[_0x6f4e('0xe')],_0x6f4e('0xf'),_0x6f4e('0x10'),_0x6f4e('0xb'),_0xeb8489['value']);if(fs[_0x6f4e('0x11')](_0x33c650)){rimraf(_0x33c650,function(_0x42c22c){if(_0x42c22c){console['log'](_0x42c22c);}});}}_0x4e5d98();})[_0x6f4e('0x12')](function(_0x1e3ea1){BPromise[_0x6f4e('0x13')]();})[_0x6f4e('0x14')](function(){_0xc66765();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 04a3a30..6684449 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 _0x8958=['client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x8958,0x93));var _0x8895=function(_0x1082b1,_0x25400d){_0x1082b1=_0x1082b1-0x0;var _0x1bd9ea=_0x8958[_0x1082b1];return _0x1bd9ea;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x124e1e,_0x40cec6,_0x33013a){return new BPromise(function(_0x51376b,_0xe018b8){return client[_0x8895('0x7')](_0x124e1e,_0x33013a)[_0x8895('0x8')](function(_0x24fe49){logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));logger[_0x8895('0xc')](_0x8895('0xd'),_0x40cec6,_0x8895('0xb'),JSON['stringify'](_0x24fe49));if(_0x24fe49[_0x8895('0xe')]){if(_0x24fe49[_0x8895('0xe')][_0x8895('0xf')]===0x1f4){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x24fe49[_0x8895('0xe')]['message']);return _0xe018b8(_0x24fe49[_0x8895('0xe')][_0x8895('0x10')]);}logger[_0x8895('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x40cec6,_0x24fe49['error'][_0x8895('0x10')]);return _0x51376b(_0x24fe49['error'][_0x8895('0x10')]);}else{logger[_0x8895('0x9')](_0x8895('0xa'),_0x40cec6,_0x8895('0xb'));_0x51376b(_0x24fe49[_0x8895('0x11')]['message']);}})[_0x8895('0x12')](function(_0x100fc8){logger[_0x8895('0xe')](_0x8895('0xa'),_0x40cec6,_0x100fc8);_0xe018b8(_0x100fc8);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x008c,0x188));var _0xc008=function(_0x22a333,_0xb6f8){_0x22a333=_0x22a333-0x0;var _0x109061=_0x008c[_0x22a333];return _0x109061;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d563a4d..5c90240 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 _0xce0a=['format','logo','extname','originalname','post','/:id/logo','single','file','addLogo','%s%s','logologin','/:id/logo_login','addLogoLogin','preferred','/:id/preferred','addPreferred','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','getLogo','getLogoLogin','/:id/gdpr','diskStorage','join','root','server/files/images/logos/'];(function(_0x5d738f,_0x1531ee){var _0x57e0fd=function(_0x3bcc08){while(--_0x3bcc08){_0x5d738f['push'](_0x5d738f['shift']());}};_0x57e0fd(++_0x1531ee);}(_0xce0a,0xf7));var _0xace0=function(_0x2986fb,_0x9482a0){_0x2986fb=_0x2986fb-0x0;var _0xb3c156=_0xce0a[_0x2986fb];return _0xb3c156;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xace0('0x0'));var timeout=require(_0xace0('0x1'));var express=require(_0xace0('0x2'));var router=express[_0xace0('0x3')]();var auth=require(_0xace0('0x4'));var interaction=require(_0xace0('0x5'));var config=require(_0xace0('0x6'));var controller=require(_0xace0('0x7'));router[_0xace0('0x8')]('/',auth[_0xace0('0x9')](),controller[_0xace0('0xa')]);router[_0xace0('0x8')]('/:id',controller[_0xace0('0xb')]);router[_0xace0('0x8')]('/:id/logo',controller[_0xace0('0xc')]);router[_0xace0('0x8')]('/:id/logo_login',controller[_0xace0('0xd')]);router[_0xace0('0x8')](_0xace0('0xe'),controller['gdpr']);router['get']('/:id/preferred',controller['getPreferred']);var upload=multer({'storage':multer[_0xace0('0xf')]({'destination':function(_0x3f2d52,_0x250034,_0x17673b){_0x17673b(null,path[_0xace0('0x10')](config[_0xace0('0x11')],_0xace0('0x12')));},'filename':function(_0x4786c8,_0x24de45,_0x325f5d){_0x325f5d(null,util[_0xace0('0x13')]('%s%s',_0xace0('0x14'),path[_0xace0('0x15')](_0x24de45[_0xace0('0x16')])));}})});router[_0xace0('0x17')](_0xace0('0x18'),upload[_0xace0('0x19')](_0xace0('0x1a')),controller[_0xace0('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e1c35,_0x8f0c37,_0x4df7dd){_0x4df7dd(null,path[_0xace0('0x10')](config[_0xace0('0x11')],'server/files/images/logos/'));},'filename':function(_0xb1c1ab,_0x26dce,_0x307a0e){_0x307a0e(null,util['format'](_0xace0('0x1c'),_0xace0('0x1d'),path['extname'](_0x26dce['originalname'])));}})});router[_0xace0('0x17')](_0xace0('0x1e'),upload['single'](_0xace0('0x1a')),controller[_0xace0('0x1f')]);var upload=multer({'storage':multer[_0xace0('0xf')]({'destination':function(_0x41768e,_0x5cd2d1,_0x51eaa){_0x51eaa(null,path['join'](config['root'],_0xace0('0x12')));},'filename':function(_0x1b6af6,_0x49f93a,_0xf3d1d){_0xf3d1d(null,util[_0xace0('0x13')]('%s%s',_0xace0('0x20'),path[_0xace0('0x15')](_0x49f93a[_0xace0('0x16')])));}})});router[_0xace0('0x17')](_0xace0('0x21'),upload[_0xace0('0x19')](_0xace0('0x1a')),controller[_0xace0('0x22')]);router[_0xace0('0x23')]('/:id',auth[_0xace0('0x9')](),controller[_0xace0('0x24')]);module[_0xace0('0x25')]=router; \ No newline at end of file +var _0xe5c7=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','file','addLogo','logologin','single','addLogoLogin','preferred','addPreferred','put','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo'];(function(_0x465b20,_0x3b611b){var _0x3481e9=function(_0x5a5867){while(--_0x5a5867){_0x465b20['push'](_0x465b20['shift']());}};_0x3481e9(++_0x3b611b);}(_0xe5c7,0x12a));var _0x7e5c=function(_0x5df2d0,_0x5198e3){_0x5df2d0=_0x5df2d0-0x0;var _0x395ddd=_0xe5c7[_0x5df2d0];return _0x395ddd;};'use strict';var multer=require(_0x7e5c('0x0'));var util=require(_0x7e5c('0x1'));var path=require('path');var timeout=require(_0x7e5c('0x2'));var express=require('express');var router=express[_0x7e5c('0x3')]();var auth=require(_0x7e5c('0x4'));var interaction=require(_0x7e5c('0x5'));var config=require(_0x7e5c('0x6'));var controller=require(_0x7e5c('0x7'));router[_0x7e5c('0x8')]('/',auth[_0x7e5c('0x9')](),controller[_0x7e5c('0xa')]);router[_0x7e5c('0x8')](_0x7e5c('0xb'),controller[_0x7e5c('0xc')]);router['get'](_0x7e5c('0xd'),controller['getLogo']);router[_0x7e5c('0x8')](_0x7e5c('0xe'),controller[_0x7e5c('0xf')]);router['get'](_0x7e5c('0x10'),controller[_0x7e5c('0x11')]);router[_0x7e5c('0x8')](_0x7e5c('0x12'),controller[_0x7e5c('0x13')]);var upload=multer({'storage':multer[_0x7e5c('0x14')]({'destination':function(_0x32bfd6,_0x547517,_0x7480a7){_0x7480a7(null,path[_0x7e5c('0x15')](config[_0x7e5c('0x16')],_0x7e5c('0x17')));},'filename':function(_0x119c4b,_0xffc5eb,_0x4d795f){_0x4d795f(null,util[_0x7e5c('0x18')](_0x7e5c('0x19'),'logo',path[_0x7e5c('0x1a')](_0xffc5eb[_0x7e5c('0x1b')])));}})});router[_0x7e5c('0x1c')](_0x7e5c('0xd'),upload['single'](_0x7e5c('0x1d')),controller[_0x7e5c('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52de83,_0x961fbd,_0x4f955f){_0x4f955f(null,path[_0x7e5c('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1a7a84,_0x528980,_0x4c647e){_0x4c647e(null,util[_0x7e5c('0x18')](_0x7e5c('0x19'),_0x7e5c('0x1f'),path[_0x7e5c('0x1a')](_0x528980[_0x7e5c('0x1b')])));}})});router[_0x7e5c('0x1c')](_0x7e5c('0xe'),upload[_0x7e5c('0x20')](_0x7e5c('0x1d')),controller[_0x7e5c('0x21')]);var upload=multer({'storage':multer[_0x7e5c('0x14')]({'destination':function(_0x3aa0ab,_0x2f2def,_0x379aa7){_0x379aa7(null,path[_0x7e5c('0x15')](config['root'],_0x7e5c('0x17')));},'filename':function(_0x1c9daa,_0x2c4cc7,_0x247a58){_0x247a58(null,util[_0x7e5c('0x18')](_0x7e5c('0x19'),_0x7e5c('0x22'),path[_0x7e5c('0x1a')](_0x2c4cc7[_0x7e5c('0x1b')])));}})});router[_0x7e5c('0x1c')](_0x7e5c('0x12'),upload[_0x7e5c('0x20')](_0x7e5c('0x1d')),controller[_0x7e5c('0x23')]);router[_0x7e5c('0x24')](_0x7e5c('0xb'),auth['isAuthenticated'](),controller[_0x7e5c('0x25')]);module[_0x7e5c('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ba769bc..16ad489 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 _0x152f=['sequelize','exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x5d3985,_0x495d9e){var _0x329bfe=function(_0x1f7ddc){while(--_0x1f7ddc){_0x5d3985['push'](_0x5d3985['shift']());}};_0x329bfe(++_0x495d9e);}(_0x152f,0x144));var _0xf152=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x152f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'min_internal':{'type':Sequelize[_0xf152('0x2')](0xb),'unique':_0xf152('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf152('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf152('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf152('0x4')],'defaultValue':_0xf152('0x5')},'logo':{'type':Sequelize[_0xf152('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf152('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf152('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf152('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xf152('0x4')]},'turnusername':{'type':Sequelize[_0xf152('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf152('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xf152('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xf152('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf152('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xf152('0x4')],'defaultValue':_0xf152('0x7')},'enableEmailPreview':{'type':Sequelize[_0xf152('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf152('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xf152('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf152('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf152('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf152('0x4')],'defaultValue':_0xf152('0x8')},'chatTimeout':{'type':Sequelize[_0xf152('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf152('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xf152('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf152('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf152('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf152('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd691=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_mailbox'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xd691,0xe6));var _0x1d69=function(_0x1eaf5e,_0x333d16){_0x1eaf5e=_0x1eaf5e-0x0;var _0x409fa2=_0xd691[_0x1eaf5e];return _0x409fa2;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'min_internal':{'type':Sequelize[_0x1d69('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1d69('0x2')](0xb),'unique':_0x1d69('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1d69('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1d69('0x4')],'defaultValue':_0x1d69('0x5')},'logo':{'type':Sequelize[_0x1d69('0x4')]},'defaultLogo':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x1d69('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1d69('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x1d69('0x4')]},'turnusername':{'type':Sequelize[_0x1d69('0x4')]},'turnpassword':{'type':Sequelize[_0x1d69('0x4')]},'pageTitle':{'type':Sequelize[_0x1d69('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1d69('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1d69('0x4')],'defaultValue':_0x1d69('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1d69('0x4')],'defaultValue':_0x1d69('0x8')},'chatTimeout':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1d69('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1d69('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1d69('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1d69('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 2ff0f79..85ac80a 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 _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x2db473,_0x5a2489){var _0x12a803=function(_0x5884bd){while(--_0x5884bd){_0x2db473['push'](_0x2db473['shift']());}};_0x12a803(++_0x5a2489);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file +var _0xa9e0=['find','params','body','readFileSync','join','server/files/templates/stun.ejs','utf8','root','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','logo','filename','catch','addLogoLogin','loginLogo','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.png','default','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','Setting','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','keys','length'];(function(_0x492498,_0x38ea4f){var _0x33957e=function(_0x10eb16){while(--_0x10eb16){_0x492498['push'](_0x492498['shift']());}};_0x33957e(++_0x38ea4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0a9e('0x13'));var client=jayson[_0x0a9e('0x14')][_0x0a9e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x26d672,_0x32d742,_0x69aeb7){if(_0x69aeb7){var _0x5db4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5db4b0[_0x0a9e('0x16')](_0x32d742)){return _0x26d672;}else{throw new Error(_0x0a9e('0x17'));}}else{return _0x26d672;}}function respondWithRpcPromise(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){return new BPromise(function(_0x52a03d,_0x22dccb){var _0x5d0880=_0x4d5611||client;return _0x5d0880[_0x0a9e('0x18')](_0x2b4227,_0x44dcfd)['then'](function(_0x16033c){logger[_0x0a9e('0x19')]('Setting,\x20%s,\x20%s',_0x281129,_0x0a9e('0x1a'));logger['debug'](_0x0a9e('0x1b'),_0x281129,_0x0a9e('0x1a'),JSON[_0x0a9e('0x1c')](_0x16033c));if(_0x16033c[_0x0a9e('0x1d')]){if(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x1e')]===0x1f4){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);return _0x22dccb(_0x16033c[_0x0a9e('0x1d')][_0x0a9e('0x20')]);}logger['error'](_0x0a9e('0x1f'),_0x281129,_0x16033c[_0x0a9e('0x1d')]['message']);return _0x52a03d(_0x16033c[_0x0a9e('0x1d')]['message']);}else{logger['info'](_0x0a9e('0x1f'),_0x281129,_0x0a9e('0x1a'));_0x52a03d(_0x16033c[_0x0a9e('0x21')][_0x0a9e('0x20')]);}})['catch'](function(_0xfb6e48){logger[_0x0a9e('0x1d')](_0x0a9e('0x1f'),_0x281129,_0xfb6e48);_0x22dccb(_0xfb6e48);});});}function respondWithStatusCode(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0xcc;return function(_0x42ac8f){if(_0x42ac8f){return _0x4d00e6[_0x0a9e('0x22')](_0x370d86);}return _0x4d00e6['status'](_0x370d86)['end']();};}function respondWithResult(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xc8;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x23')](_0x3a8e58)['json'](_0x40c424);}};}function respondWithFilteredResult(_0x384319,_0x479bc4){return function(_0x45a1e7){if(_0x45a1e7){var _0x5bfb33=_0x45a1e7[_0x0a9e('0x24')],_0x1dc186=_0x479bc4[_0x0a9e('0x25')],_0x34dc65=_0x479bc4[_0x0a9e('0x25')]+_0x479bc4[_0x0a9e('0x26')],_0x25fba9;if(_0x34dc65>=_0x5bfb33){_0x34dc65=_0x5bfb33;_0x25fba9=0xc8;}else{_0x25fba9=0xce;}_0x384319[_0x0a9e('0x23')](_0x25fba9);return _0x384319['set'](_0x0a9e('0x27'),_0x1dc186+'-'+_0x34dc65+'/'+_0x5bfb33)[_0x0a9e('0x28')](_0x45a1e7);}return null;};}function patchUpdates(_0x2b1f27){return function(_0x2ec755){try{jsonpatch['apply'](_0x2ec755,_0x2b1f27,!![]);}catch(_0x15b200){return BPromise[_0x0a9e('0x29')](_0x15b200);}return _0x2ec755[_0x0a9e('0x2a')]();};}function saveUpdates(_0x824a4f,_0x58b06f){return function(_0x563b45){if(_0x563b45){return _0x563b45[_0x0a9e('0x2b')](_0x824a4f)[_0x0a9e('0x2c')](function(_0x1dbde2){return _0x1dbde2;});}return null;};}function removeEntity(_0x540530,_0x426950){return function(_0x5d1e0e){if(_0x5d1e0e){return _0x5d1e0e[_0x0a9e('0x2d')]()[_0x0a9e('0x2c')](function(){_0x540530[_0x0a9e('0x23')](0xcc)[_0x0a9e('0x2e')]();});}};}function handleEntityNotFound(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(!_0x66c1d2){_0x25ce3a[_0x0a9e('0x22')](0x194);}return _0x66c1d2;};}function handleError(_0x40cb85,_0x2da5c0){_0x2da5c0=_0x2da5c0||0x1f4;return function(_0x2b45ea){logger[_0x0a9e('0x1d')](_0x2b45ea[_0x0a9e('0x2f')]);if(_0x2b45ea[_0x0a9e('0x30')]){delete _0x2b45ea['name'];}_0x40cb85[_0x0a9e('0x23')](_0x2da5c0)['send'](_0x2b45ea);};}exports[_0x0a9e('0x31')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41={},_0x567193={},_0x191e91={'count':0x0,'rows':[]};var _0xd1836d=db[_0x0a9e('0x32')][_0x0a9e('0x33')];_0x567193['model']=_['keys'](_0xd1836d);_0x567193[_0x0a9e('0x34')]=_['keys'](_0x14b13f[_0x0a9e('0x34')]);_0x567193[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],_0x567193['query']);_0x3f3d41[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x567193[_0x0a9e('0x37')],qs['fields'](_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x3f3d41[_0x0a9e('0x38')]=_0x3f3d41['attributes']['length']?_0x3f3d41[_0x0a9e('0x38')]:_0x567193[_0x0a9e('0x37')];if(!_0x14b13f['query'][_0x0a9e('0x3a')](_0x0a9e('0x3b'))){_0x3f3d41[_0x0a9e('0x26')]=qs[_0x0a9e('0x26')](_0x14b13f['query']['limit']);_0x3f3d41[_0x0a9e('0x25')]=qs[_0x0a9e('0x25')](_0x14b13f['query'][_0x0a9e('0x25')]);}_0x3f3d41[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x14b13f['query'][_0x0a9e('0x3d')]);_0x3f3d41[_0x0a9e('0x3e')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3f')](_0x14b13f[_0x0a9e('0x34')],_0x567193[_0x0a9e('0x35')]));if(_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]){_0x3f3d41[_0x0a9e('0x3e')]=_[_0x0a9e('0x41')](_0x3f3d41[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x42')](_0xd1836d,function(_0x1a7bce){if(_0x1a7bce[_0x0a9e('0x43')][_0x0a9e('0x44')]!=='VIRTUAL'){var _0x52628e={};_0x52628e[_0x1a7bce[_0x0a9e('0x45')]]={'$like':'%'+_0x14b13f[_0x0a9e('0x34')][_0x0a9e('0x40')]+'%'};return _0x52628e;}})});}_0x3f3d41=_[_0x0a9e('0x41')]({},_0x3f3d41,_0x14b13f[_0x0a9e('0x46')]);var _0xc9a702={'where':_0x3f3d41[_0x0a9e('0x3e')]};return db[_0x0a9e('0x32')][_0x0a9e('0x24')](_0xc9a702)[_0x0a9e('0x2c')](function(_0x2c2cb0){_0x191e91[_0x0a9e('0x24')]=_0x2c2cb0;if(_0x14b13f['query'][_0x0a9e('0x47')]){_0x3f3d41[_0x0a9e('0x48')]=[{'all':!![]}];}return db[_0x0a9e('0x32')][_0x0a9e('0x49')](_0x3f3d41);})[_0x0a9e('0x2c')](function(_0xbe9d19){_0x191e91[_0x0a9e('0x4a')]=_0xbe9d19;return _0x191e91;})[_0x0a9e('0x2c')](respondWithFilteredResult(_0x2b7e7f,_0x3f3d41))['catch'](handleError(_0x2b7e7f,null));};exports[_0x0a9e('0x4b')]=function(_0x48fd45,_0x473dc8){var _0x476688={'raw':![],'where':{'id':_0x48fd45['params']['id']}},_0x8d6dd1={};_0x8d6dd1[_0x0a9e('0x37')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x32')][_0x0a9e('0x33')]);_0x8d6dd1[_0x0a9e('0x34')]=_[_0x0a9e('0x4c')](_0x48fd45[_0x0a9e('0x34')]);_0x8d6dd1['filters']=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],_0x8d6dd1[_0x0a9e('0x34')]);_0x476688[_0x0a9e('0x38')]=_[_0x0a9e('0x36')](_0x8d6dd1[_0x0a9e('0x37')],qs[_0x0a9e('0x39')](_0x48fd45[_0x0a9e('0x34')][_0x0a9e('0x39')]));_0x476688['attributes']=_0x476688[_0x0a9e('0x38')][_0x0a9e('0x4d')]?_0x476688['attributes']:_0x8d6dd1['model'];if(_0x48fd45['query'][_0x0a9e('0x47')]){_0x476688[_0x0a9e('0x48')]=[{'all':!![]}];}_0x476688=_[_0x0a9e('0x41')]({},_0x476688,_0x48fd45[_0x0a9e('0x46')]);return db[_0x0a9e('0x32')][_0x0a9e('0x4e')](_0x476688)[_0x0a9e('0x2c')](handleEntityNotFound(_0x473dc8,null))[_0x0a9e('0x2c')](respondWithResult(_0x473dc8,null))['catch'](handleError(_0x473dc8,null));};exports['update']=function(_0x53975a,_0x39d77d,_0x204173){var _0x14d602;return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x50')],null))['then'](function(_0x443e72){if(_0x443e72){_0x14d602=_0x443e72['get']({'plain':!![]});var _0x2e5e62=fs[_0x0a9e('0x51')](path[_0x0a9e('0x52')](config['root'],_0x0a9e('0x53')),_0x0a9e('0x54'));var _0x508b47=ejs['render'](_0x2e5e62,_0x14d602);var _0x128aa6=fs[_0x0a9e('0x51')](path['join'](config[_0x0a9e('0x55')],'server/files/templates/turn.ejs'),_0x0a9e('0x54'));var _0x523cd2=ejs[_0x0a9e('0x56')](_0x128aa6,_0x14d602);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x508b47);fs['writeFileSync'](_0x0a9e('0x57'),_0x523cd2);return respondWithRpcPromise('Reload',_0x0a9e('0x2b'),{'module':_0x0a9e('0x58')});}})[_0x0a9e('0x2c')](function(){return respondWithRpcPromise(_0x0a9e('0x59'),_0x0a9e('0x2b'),{'module':_0x0a9e('0x5a')});})[_0x0a9e('0x2c')](function(){return _0x14d602||null;})[_0x0a9e('0x2c')](respondWithResult(_0x39d77d,null))['catch'](handleError(_0x39d77d,null));};exports[_0x0a9e('0x5b')]=function(_0x121cef,_0x2642bb,_0x30c491){if(_0x121cef[_0x0a9e('0x5c')]&&_0x121cef[_0x0a9e('0x5c')]['filename']){_0x121cef[_0x0a9e('0x50')][_0x0a9e('0x5d')]=_0x121cef['file'][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x121cef['params']['id']}})['then'](handleEntityNotFound(_0x2642bb,null))['then'](saveUpdates(_0x121cef[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x2642bb,null))[_0x0a9e('0x5f')](handleError(_0x2642bb,null));};exports[_0x0a9e('0x60')]=function(_0x261adb,_0x7be420,_0x1cca9f){if(_0x261adb[_0x0a9e('0x5c')]&&_0x261adb['file'][_0x0a9e('0x5e')]){_0x261adb['body'][_0x0a9e('0x61')]=_0x261adb[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x261adb[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x2c')](handleEntityNotFound(_0x7be420,null))[_0x0a9e('0x2c')](saveUpdates(_0x261adb['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x7be420,null))[_0x0a9e('0x5f')](handleError(_0x7be420,null));};var utilLicense=require('../../config/license/util');exports[_0x0a9e('0x62')]=function(_0x17e88c,_0x88dcbf,_0x409b29){var _0x401837='server/files/images/logos';var _0x176840={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x47bb43){if(_0x47bb43){_0x176840=_0x47bb43;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x17e88c['params']['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x2c')](function(_0x2d7205){if(_0x2d7205){var _0x1cc4f3=_0x2d7205[_0x0a9e('0x5d')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_[_0x0a9e('0x69')](_0x2d7205[_0x0a9e('0x5d')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x2d7205[_0x0a9e('0x5d')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower'](_0x0a9e('0x6a')));var _0x30944e='default'+_[_0x0a9e('0x6b')](_0x0a9e('0x5d'));if(_0x2d7205[_0x30944e]||!_0x176840[_0x0a9e('0x6c')]){_0x1cc4f3=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x401837,_['toLower']('default_logo.png'));}if(!fs['existsSync'](_0x1cc4f3)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x88dcbf[_0x0a9e('0x70')](_0x1cc4f3);}})[_0x0a9e('0x5f')](handleError(_0x88dcbf,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x72')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2=_0x0a9e('0x73');var _0x4a4fc7={'custom':![]};return utilLicense[_0x0a9e('0x63')]()['then'](function(_0x4437ff){if(_0x4437ff){_0x4a4fc7=_0x4437ff;}return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x1a0677[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x5d'),_0x0a9e('0x61'),_0x0a9e('0x64'),'defaultLogo',_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x2c')](function(_0x5b7fc3){if(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[_0x0a9e('0x61')]&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config['root'],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x5b7fc3[_0x0a9e('0x61')])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')](_0x0a9e('0x74')));var _0xc4c230=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x61'));if(_0x5b7fc3[_0xc4c230]||!_0x4a4fc7['custom']){_0x109ccb=path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0xcbc8b2,_[_0x0a9e('0x69')]('default_loginLogo.png'));}if(!fs[_0x0a9e('0x68')](_0x109ccb)){throw new db[(_0x0a9e('0x6d'))][(_0x0a9e('0x6e'))](_0x0a9e('0x6f'));}return _0x5512d1['download'](_0x109ccb);}})['catch'](handleError(_0x5512d1,null));};exports[_0x0a9e('0x76')]=function(_0x2bbdb5,_0x4c54fa){return db[_0x0a9e('0x32')]['find']({'where':{'id':_0x2bbdb5[_0x0a9e('0x4f')]['id']},'attributes':[_0x0a9e('0x77')]})['then'](respondWithResult(_0x4c54fa,null))[_0x0a9e('0x5f')](handleError(_0x4c54fa,null));};exports[_0x0a9e('0x78')]=function(_0x2d2286,_0x42b959,_0x3755fe){if(_0x2d2286[_0x0a9e('0x5c')]&&_0x2d2286[_0x0a9e('0x5c')]['filename']){_0x2d2286[_0x0a9e('0x50')][_0x0a9e('0x64')]=_0x2d2286[_0x0a9e('0x5c')][_0x0a9e('0x5e')];}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x2d2286[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42b959,null))[_0x0a9e('0x2c')](saveUpdates(_0x2d2286['body'],null))[_0x0a9e('0x2c')](respondWithResult(_0x42b959,null))[_0x0a9e('0x5f')](handleError(_0x42b959,null));};var utilLicense=require(_0x0a9e('0x71'));exports[_0x0a9e('0x79')]=function(_0x5af453,_0x51ccd7,_0x353384){var _0x2b9c01=_0x0a9e('0x73');var _0x5ac73d={'custom':![]};return utilLicense[_0x0a9e('0x63')]()[_0x0a9e('0x2c')](function(_0x524e38){if(_0x524e38){_0x5ac73d=_0x524e38;}return db['Setting'][_0x0a9e('0x4e')]({'where':{'id':_0x5af453['params']['id']},'attributes':['logo','loginLogo',_0x0a9e('0x64'),_0x0a9e('0x65'),_0x0a9e('0x66'),_0x0a9e('0x67')],'raw':!![]});})[_0x0a9e('0x2c')](handleEntityNotFound(_0x51ccd7,null))[_0x0a9e('0x2c')](function(_0x5a8854){if(_0x5a8854){var _0x5fd5db=_0x5a8854['preferred']&&fs[_0x0a9e('0x68')](path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])))?path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x5a8854['preferred'])):path[_0x0a9e('0x52')](config[_0x0a9e('0x55')],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));var _0x255e49=_0x0a9e('0x75')+_[_0x0a9e('0x6b')](_0x0a9e('0x64'));if(_0x5a8854[_0x255e49]||!_0x5ac73d['custom']||!_0x5ac73d[_0x0a9e('0x64')]){_0x5fd5db=path[_0x0a9e('0x52')](config['root'],_0x2b9c01,_[_0x0a9e('0x69')](_0x0a9e('0x7a')));}if(!fs[_0x0a9e('0x68')](_0x5fd5db)){throw new db['Sequelize'][(_0x0a9e('0x6e'))]('Logo\x20not\x20found');}return _0x51ccd7[_0x0a9e('0x70')](_0x5fd5db);}})[_0x0a9e('0x5f')](handleError(_0x51ccd7,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 581b01a..2fcf14a 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 _0x3f98=['settings','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./setting.attributes','exports','define'];(function(_0x4c4d06,_0x20636a){var _0x2d0df3=function(_0xc844f9){while(--_0xc844f9){_0x4c4d06['push'](_0x4c4d06['shift']());}};_0x2d0df3(++_0x20636a);}(_0x3f98,0x1bd));var _0x83f9=function(_0x28c931,_0x671902){_0x28c931=_0x28c931-0x0;var _0x422faf=_0x3f98[_0x28c931];return _0x422faf;};'use strict';var _=require('lodash');var util=require(_0x83f9('0x0'));var logger=require(_0x83f9('0x1'))(_0x83f9('0x2'));var moment=require(_0x83f9('0x3'));var BPromise=require(_0x83f9('0x4'));var rp=require(_0x83f9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83f9('0x6'));var config=require(_0x83f9('0x7'));var attributes=require(_0x83f9('0x8'));module[_0x83f9('0x9')]=function(_0x3bc358,_0x47160c){return _0x3bc358[_0x83f9('0xa')]('Setting',attributes,{'tableName':_0x83f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb51f=['../../config/logger','moment','path','rimraf','./setting.attributes','exports','Setting','settings','lodash','util'];(function(_0x15281c,_0x51ce08){var _0x462928=function(_0x3c56a4){while(--_0x3c56a4){_0x15281c['push'](_0x15281c['shift']());}};_0x462928(++_0x51ce08);}(_0xb51f,0x1b6));var _0xfb51=function(_0x4f5226,_0x518f6c){_0x4f5226=_0x4f5226-0x0;var _0x42fdd5=_0xb51f[_0x4f5226];return _0x42fdd5;};'use strict';var _=require(_0xfb51('0x0'));var util=require(_0xfb51('0x1'));var logger=require(_0xfb51('0x2'))('api');var moment=require(_0xfb51('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb51('0x4'));var rimraf=require(_0xfb51('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb51('0x6'));module[_0xfb51('0x7')]=function(_0x2273fc,_0x31d4ec){return _0x2273fc['define'](_0xfb51('0x8'),attributes,{'tableName':_0xfb51('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 358bd2e..b4f467b 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 _0xbcb7=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbcb7,0x1ab));var _0x7bcb=function(_0x4fecf3,_0x17fdb0){_0x4fecf3=_0x4fecf3-0x0;var _0x50161f=_0xbcb7[_0x4fecf3];return _0x50161f;};'use strict';var _=require(_0x7bcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7bcb('0x1'));var rs=require(_0x7bcb('0x2'));var fs=require('fs');var Redis=require(_0x7bcb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bcb('0x4'));var logger=require(_0x7bcb('0x5'))(_0x7bcb('0x6'));var config=require(_0x7bcb('0x7'));var jayson=require(_0x7bcb('0x8'));var client=jayson[_0x7bcb('0x9')][_0x7bcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33fe81,_0xd0f34e,_0x6f610d){return new BPromise(function(_0xc701de,_0x20fc87){return client[_0x7bcb('0xb')](_0x33fe81,_0x6f610d)[_0x7bcb('0xc')](function(_0x5070b5){logger[_0x7bcb('0xd')](_0x7bcb('0xe'),_0xd0f34e,_0x7bcb('0xf'));logger[_0x7bcb('0x10')](_0x7bcb('0x11'),_0xd0f34e,_0x7bcb('0xf'),JSON['stringify'](_0x5070b5));if(_0x5070b5[_0x7bcb('0x12')]){if(_0x5070b5[_0x7bcb('0x12')][_0x7bcb('0x13')]===0x1f4){logger[_0x7bcb('0x12')]('Setting,\x20%s,\x20%s',_0xd0f34e,_0x5070b5[_0x7bcb('0x12')]['message']);return _0x20fc87(_0x5070b5[_0x7bcb('0x12')][_0x7bcb('0x14')]);}logger[_0x7bcb('0x12')](_0x7bcb('0xe'),_0xd0f34e,_0x5070b5[_0x7bcb('0x12')]['message']);return _0xc701de(_0x5070b5['error'][_0x7bcb('0x14')]);}else{logger[_0x7bcb('0xd')](_0x7bcb('0xe'),_0xd0f34e,_0x7bcb('0xf'));_0xc701de(_0x5070b5[_0x7bcb('0x15')]['message']);}})[_0x7bcb('0x16')](function(_0x4b4298){logger['error'](_0x7bcb('0xe'),_0xd0f34e,_0x4b4298);_0x20fc87(_0x4b4298);});});} \ No newline at end of file +var _0x6ed3=['then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b8a36,_0x5153e3){var _0x232f57=function(_0x4f9c38){while(--_0x4f9c38){_0x5b8a36['push'](_0x5b8a36['shift']());}};_0x232f57(++_0x5153e3);}(_0x6ed3,0xf1));var _0x36ed=function(_0x40ff79,_0x578a04){_0x40ff79=_0x40ff79-0x0;var _0x32234c=_0x6ed3[_0x40ff79];return _0x32234c;};'use strict';var _=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var moment=require(_0x36ed('0x2'));var BPromise=require(_0x36ed('0x3'));var rs=require(_0x36ed('0x4'));var fs=require('fs');var Redis=require(_0x36ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36ed('0x6'));var logger=require('../../config/logger')(_0x36ed('0x7'));var config=require(_0x36ed('0x8'));var jayson=require(_0x36ed('0x9'));var client=jayson[_0x36ed('0xa')][_0x36ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19bc2e,_0x4577aa,_0x848ff2){return new BPromise(function(_0x5e1131,_0xbbb00b){return client['request'](_0x19bc2e,_0x848ff2)[_0x36ed('0xc')](function(_0x3e07d9){logger['info'](_0x36ed('0xd'),_0x4577aa,_0x36ed('0xe'));logger['debug'](_0x36ed('0xf'),_0x4577aa,'request\x20sent',JSON[_0x36ed('0x10')](_0x3e07d9));if(_0x3e07d9[_0x36ed('0x11')]){if(_0x3e07d9['error'][_0x36ed('0x12')]===0x1f4){logger[_0x36ed('0x11')](_0x36ed('0xd'),_0x4577aa,_0x3e07d9[_0x36ed('0x11')]['message']);return _0xbbb00b(_0x3e07d9[_0x36ed('0x11')][_0x36ed('0x13')]);}logger[_0x36ed('0x11')](_0x36ed('0xd'),_0x4577aa,_0x3e07d9['error'][_0x36ed('0x13')]);return _0x5e1131(_0x3e07d9['error'][_0x36ed('0x13')]);}else{logger[_0x36ed('0x14')]('Setting,\x20%s,\x20%s',_0x4577aa,_0x36ed('0xe'));_0x5e1131(_0x3e07d9[_0x36ed('0x15')][_0x36ed('0x13')]);}})[_0x36ed('0x16')](function(_0x1fc732){logger[_0x36ed('0x11')](_0x36ed('0xd'),_0x4577aa,_0x1fc732);_0xbbb00b(_0x1fc732);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 92512eb..51ffebd 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 _0xfbdd=['update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','describe','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','statusGet','/:id/users','post','addAnswer','/:id/notify','notify','addApplications','send'];(function(_0x282b8c,_0x31287f){var _0x510585=function(_0x4fad87){while(--_0x4fad87){_0x282b8c['push'](_0x282b8c['shift']());}};_0x510585(++_0x31287f);}(_0xfbdd,0x17c));var _0xdfbd=function(_0x2eeae8,_0x36a615){_0x2eeae8=_0x2eeae8-0x0;var _0x36a303=_0xfbdd[_0x2eeae8];return _0x36a303;};'use strict';var multer=require(_0xdfbd('0x0'));var util=require('util');var path=require(_0xdfbd('0x1'));var timeout=require(_0xdfbd('0x2'));var express=require(_0xdfbd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdfbd('0x4'));var config=require(_0xdfbd('0x5'));var controller=require(_0xdfbd('0x6'));router[_0xdfbd('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfbd('0x8')]);router[_0xdfbd('0x7')](_0xdfbd('0x9'),auth['isAuthenticated'](),controller[_0xdfbd('0xa')]);router[_0xdfbd('0x7')]('/:id',auth[_0xdfbd('0xb')](),controller['show']);router[_0xdfbd('0x7')](_0xdfbd('0xc'),auth[_0xdfbd('0xb')](),controller[_0xdfbd('0xd')]);router[_0xdfbd('0x7')](_0xdfbd('0xe'),auth[_0xdfbd('0xb')](),controller[_0xdfbd('0xf')]);router['get'](_0xdfbd('0x10'),auth['isAuthenticated'](),controller[_0xdfbd('0x11')]);router['get'](_0xdfbd('0x12'),auth[_0xdfbd('0xb')](),controller[_0xdfbd('0x13')]);router[_0xdfbd('0x7')]('/:id/status',controller[_0xdfbd('0x14')]);router[_0xdfbd('0x7')](_0xdfbd('0x15'),auth[_0xdfbd('0xb')](),controller['getAgents']);router['post']('/',auth[_0xdfbd('0xb')](),controller['create']);router[_0xdfbd('0x16')](_0xdfbd('0xc'),auth[_0xdfbd('0xb')](),controller['addDisposition']);router['post'](_0xdfbd('0xe'),auth['isAuthenticated'](),controller[_0xdfbd('0x17')]);router['post'](_0xdfbd('0x18'),controller[_0xdfbd('0x19')]);router[_0xdfbd('0x16')](_0xdfbd('0x10'),auth[_0xdfbd('0xb')](),controller[_0xdfbd('0x1a')]);router[_0xdfbd('0x16')]('/:id/send',auth['isAuthenticated'](),controller[_0xdfbd('0x1b')]);router[_0xdfbd('0x16')]('/:id/status',controller['status']);router[_0xdfbd('0x16')](_0xdfbd('0x15'),auth[_0xdfbd('0xb')](),controller['addAgents']);router['put']('/:id',auth[_0xdfbd('0xb')](),controller[_0xdfbd('0x1c')]);router[_0xdfbd('0x1d')]('/:id',auth[_0xdfbd('0xb')](),controller[_0xdfbd('0x1e')]);router[_0xdfbd('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdfbd('0x1f')]);router[_0xdfbd('0x1d')](_0xdfbd('0xe'),auth[_0xdfbd('0xb')](),controller['removeAnswers']);router[_0xdfbd('0x1d')](_0xdfbd('0x15'),auth[_0xdfbd('0xb')](),controller[_0xdfbd('0x20')]);module[_0xdfbd('0x21')]=router; \ No newline at end of file +var _0x6422=['getInteractions','/:id/users','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','/:id/status','status','put','update','/:id','removeDispositions','delete','removeAnswers','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6422,0xcf));var _0x2642=function(_0x4299db,_0x24050c){_0x4299db=_0x4299db-0x0;var _0x3c8104=_0x6422[_0x4299db];return _0x3c8104;};'use strict';var multer=require(_0x2642('0x0'));var util=require(_0x2642('0x1'));var path=require('path');var timeout=require(_0x2642('0x2'));var express=require(_0x2642('0x3'));var router=express[_0x2642('0x4')]();var auth=require(_0x2642('0x5'));var interaction=require(_0x2642('0x6'));var config=require(_0x2642('0x7'));var controller=require(_0x2642('0x8'));router[_0x2642('0x9')]('/',auth[_0x2642('0xa')](),controller['index']);router[_0x2642('0x9')](_0x2642('0xb'),auth[_0x2642('0xa')](),controller[_0x2642('0xc')]);router[_0x2642('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2642('0xd')]);router[_0x2642('0x9')](_0x2642('0xe'),auth[_0x2642('0xa')](),controller[_0x2642('0xf')]);router[_0x2642('0x9')](_0x2642('0x10'),auth[_0x2642('0xa')](),controller[_0x2642('0x11')]);router[_0x2642('0x9')](_0x2642('0x12'),auth[_0x2642('0xa')](),controller[_0x2642('0x13')]);router['get'](_0x2642('0x14'),auth[_0x2642('0xa')](),controller[_0x2642('0x15')]);router[_0x2642('0x9')]('/:id/status',controller['statusGet']);router[_0x2642('0x9')](_0x2642('0x16'),auth[_0x2642('0xa')](),controller['getAgents']);router[_0x2642('0x17')]('/',auth[_0x2642('0xa')](),controller['create']);router[_0x2642('0x17')](_0x2642('0xe'),auth[_0x2642('0xa')](),controller[_0x2642('0x18')]);router[_0x2642('0x17')]('/:id/canned_answers',auth[_0x2642('0xa')](),controller[_0x2642('0x19')]);router[_0x2642('0x17')](_0x2642('0x1a'),controller[_0x2642('0x1b')]);router[_0x2642('0x17')](_0x2642('0x12'),auth[_0x2642('0xa')](),controller[_0x2642('0x1c')]);router[_0x2642('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0x2642('0x1d')]);router[_0x2642('0x17')](_0x2642('0x1e'),controller[_0x2642('0x1f')]);router['post'](_0x2642('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2642('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x2642('0x21')]);router['delete'](_0x2642('0x22'),auth[_0x2642('0xa')](),controller['destroy']);router['delete'](_0x2642('0xe'),auth[_0x2642('0xa')](),controller[_0x2642('0x23')]);router[_0x2642('0x24')](_0x2642('0x10'),auth[_0x2642('0xa')](),controller[_0x2642('0x25')]);router['delete'](_0x2642('0x16'),auth[_0x2642('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 2cea1da..424aba3 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 _0xc31a=['sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x1c695f,_0x300782){var _0x174067=function(_0x17c9fa){while(--_0x17c9fa){_0x1c695f['push'](_0x1c695f['shift']());}};_0x174067(++_0x300782);}(_0xc31a,0x154));var _0xac31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc31a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xac31('0x0'));var rs=require(_0xac31('0x1'));module[_0xac31('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xac31('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xac31('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xac31('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xac31('0x5')]();}},'phone':{'type':Sequelize[_0xac31('0x4')]},'type':{'type':Sequelize[_0xac31('0x6')](_0xac31('0x7'),_0xac31('0x8'),'connectel',_0xac31('0x9'),_0xac31('0xa'),_0xac31('0xb'),'csc','infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xac31('0x4')]},'authId':{'type':Sequelize[_0xac31('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xac31('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xac31('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xac31('0x4')]},'senderString':{'type':Sequelize[_0xac31('0x4')]},'deliveryReport':{'type':Sequelize[_0xac31('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xac31('0x4')]},'notificationTemplate':{'type':Sequelize[_0xac31('0xd')],'defaultValue':function(){return _0xac31('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac31('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xac31('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xac31('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xac31('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xac31('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xac31('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xac31('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xac31('0xc')],'defaultValue':![],'comment':_0xac31('0x11'),'set':function(_0x444a8c){if(!_0x444a8c)this[_0xac31('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xac31('0x13'),_0x444a8c);}}}; \ No newline at end of file +var _0x662a=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','intelepeer','BOOLEAN','TEXT'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x662a,0x196));var _0xa662=function(_0x329d2b,_0x5f0555){_0x329d2b=_0x329d2b-0x0;var _0x1032a9=_0x662a[_0x329d2b];return _0x1032a9;};'use strict';var Sequelize=require(_0xa662('0x0'));var rs=require(_0xa662('0x1'));module[_0xa662('0x2')]={'name':{'type':Sequelize[_0xa662('0x3')],'unique':_0xa662('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa662('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa662('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa662('0x3')],'defaultValue':function(){return rs[_0xa662('0x5')]();}},'phone':{'type':Sequelize[_0xa662('0x3')]},'type':{'type':Sequelize[_0xa662('0x6')](_0xa662('0x7'),_0xa662('0x8'),_0xa662('0x9'),_0xa662('0xa'),'plivo','clickatell','csc','infobip',_0xa662('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa662('0x3')]},'authToken':{'type':Sequelize[_0xa662('0x3')]},'smsMethod':{'type':Sequelize[_0xa662('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa662('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xa662('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xa662('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa662('0xd')],'defaultValue':function(){return _0xa662('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa662('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa662('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa662('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa662('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa662('0xf')],'comment':_0xa662('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa662('0x11'),'set':function(_0x11373b){if(!_0x11373b)this[_0xa662('0x12')](_0xa662('0x13'),null);this[_0xa662('0x12')](_0xa662('0x14'),_0x11373b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 164b96d..80f6fd9 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 _0xfb83=['statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','reject','update','destroy','get','SmsAccounts','UserProfileResource','end','name','index','mandatoryDispositionPause','SmsAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','Pause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','SmsAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sms','Applications','account','applications','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','ListId','mobile','twilio','From','Body','messageId','skebby','from','sender','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD'];(function(_0xc12103,_0x2ab16b){var _0x2d2db6=function(_0x50032a){while(--_0x50032a){_0xc12103['push'](_0xc12103['shift']());}};_0x2d2db6(++_0x2ab16b);}(_0xfb83,0xe9));var _0x3fb8=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xfb83[_0x506172];return _0x2723c0;};'use strict';var pdf=require(_0x3fb8('0x0'));var emlformat=require(_0x3fb8('0x1'));var rimraf=require(_0x3fb8('0x2'));var zipdir=require(_0x3fb8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fb8('0x4'));var moment=require(_0x3fb8('0x5'));var BPromise=require(_0x3fb8('0x6'));var Mustache=require(_0x3fb8('0x7'));var util=require(_0x3fb8('0x8'));var path=require('path');var sox=require(_0x3fb8('0x9'));var csv=require('to-csv');var ejs=require(_0x3fb8('0xa'));var fs=require('fs');var _=require(_0x3fb8('0xb'));var squel=require(_0x3fb8('0xc'));var crypto=require(_0x3fb8('0xd'));var jsforce=require(_0x3fb8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3fb8('0xf'));var Papa=require(_0x3fb8('0x10'));var Redis=require(_0x3fb8('0x11'));var authService=require(_0x3fb8('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3fb8('0x13'));var logger=require(_0x3fb8('0x14'))(_0x3fb8('0x15'));var utils=require(_0x3fb8('0x16'));var config=require(_0x3fb8('0x17'));var db=require('../../mysqldb')['db'];config[_0x3fb8('0x18')]=_[_0x3fb8('0x19')](config[_0x3fb8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fb8('0x1a'))(new Redis(config[_0x3fb8('0x18')]));require(_0x3fb8('0x1b'))[_0x3fb8('0x1c')](socket);var jayson=require(_0x3fb8('0x1d'));var client=jayson[_0x3fb8('0x1e')]['http']({'port':0x232c});function checkPasswordPattern(_0x59a5e5,_0x3a3baa,_0x1e2371){if(_0x1e2371){var _0x556b88=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x556b88['test'](_0x3a3baa)){return _0x59a5e5;}else{throw new Error(_0x3fb8('0x1f'));}}else{return _0x59a5e5;}}function respondWithRpcPromise(_0x8129a8,_0x3bb9f5,_0x2b57cd,_0x1c06f9){return new BPromise(function(_0x5499a7,_0x438585){var _0xba7b90=_0x1c06f9||client;return _0xba7b90['request'](_0x8129a8,_0x2b57cd)[_0x3fb8('0x20')](function(_0x43003f){logger['info'](_0x3fb8('0x21'),_0x3bb9f5,'request\x20sent');logger[_0x3fb8('0x22')](_0x3fb8('0x23'),_0x3bb9f5,_0x3fb8('0x24'),JSON[_0x3fb8('0x25')](_0x43003f));if(_0x43003f[_0x3fb8('0x26')]){if(_0x43003f[_0x3fb8('0x26')][_0x3fb8('0x27')]===0x1f4){logger[_0x3fb8('0x26')](_0x3fb8('0x21'),_0x3bb9f5,_0x43003f[_0x3fb8('0x26')]['message']);return _0x438585(_0x43003f['error']['message']);}logger[_0x3fb8('0x26')](_0x3fb8('0x21'),_0x3bb9f5,_0x43003f['error']['message']);return _0x5499a7(_0x43003f['error'][_0x3fb8('0x28')]);}else{logger[_0x3fb8('0x29')](_0x3fb8('0x21'),_0x3bb9f5,_0x3fb8('0x24'));_0x5499a7(_0x43003f[_0x3fb8('0x2a')][_0x3fb8('0x28')]);}})[_0x3fb8('0x2b')](function(_0x3f2403){logger[_0x3fb8('0x26')](_0x3fb8('0x21'),_0x3bb9f5,_0x3f2403);_0x438585(_0x3f2403);});});}function respondWithStatusCode(_0x4d1905,_0x2cb9f2){_0x2cb9f2=_0x2cb9f2||0xcc;return function(_0x5b2901){if(_0x5b2901){return _0x4d1905[_0x3fb8('0x2c')](_0x2cb9f2);}return _0x4d1905[_0x3fb8('0x2d')](_0x2cb9f2)['end']();};}function respondWithResult(_0x18eda7,_0x2cd5a8){_0x2cd5a8=_0x2cd5a8||0xc8;return function(_0x336e85){if(_0x336e85){return _0x18eda7['status'](_0x2cd5a8)[_0x3fb8('0x2e')](_0x336e85);}};}function respondWithFilteredResult(_0x480184,_0xbc2875){return function(_0x1fbc36){if(_0x1fbc36){var _0x22b235=_0x1fbc36[_0x3fb8('0x2f')],_0x36dc1c=_0xbc2875[_0x3fb8('0x30')],_0x505511=_0xbc2875[_0x3fb8('0x30')]+_0xbc2875[_0x3fb8('0x31')],_0x2093da;if(_0x505511>=_0x22b235){_0x505511=_0x22b235;_0x2093da=0xc8;}else{_0x2093da=0xce;}_0x480184[_0x3fb8('0x2d')](_0x2093da);return _0x480184[_0x3fb8('0x32')]('Content-Range',_0x36dc1c+'-'+_0x505511+'/'+_0x22b235)[_0x3fb8('0x2e')](_0x1fbc36);}return null;};}function patchUpdates(_0x5743fd){return function(_0x559c44){try{jsonpatch['apply'](_0x559c44,_0x5743fd,!![]);}catch(_0x91ed9b){return BPromise[_0x3fb8('0x33')](_0x91ed9b);}return _0x559c44['save']();};}function saveUpdates(_0x45f3ce,_0x15f3cd){return function(_0x4b894f){if(_0x4b894f){return _0x4b894f[_0x3fb8('0x34')](_0x45f3ce)[_0x3fb8('0x20')](function(_0x40b4a1){return _0x40b4a1;});}return null;};}function removeEntity(_0xcc9972,_0x258727){return function(_0x2403f3){if(_0x2403f3){return _0x2403f3[_0x3fb8('0x35')]()[_0x3fb8('0x20')](function(){var _0x6e8a6d=_0x2403f3[_0x3fb8('0x36')]({'plain':!![]});var _0xf8b054=_0x3fb8('0x37');return db[_0x3fb8('0x38')]['destroy']({'where':{'type':_0xf8b054,'resourceId':_0x6e8a6d['id']}})[_0x3fb8('0x20')](function(){return _0x2403f3;});})['then'](function(){_0xcc9972[_0x3fb8('0x2d')](0xcc)[_0x3fb8('0x39')]();});}};}function handleEntityNotFound(_0x2dde2a,_0x3ab186){return function(_0x378e73){if(!_0x378e73){_0x2dde2a[_0x3fb8('0x2c')](0x194);}return _0x378e73;};}function handleError(_0x598298,_0x47bb2b){_0x47bb2b=_0x47bb2b||0x1f4;return function(_0x2c6776){logger[_0x3fb8('0x26')](_0x2c6776['stack']);if(_0x2c6776[_0x3fb8('0x3a')]){delete _0x2c6776[_0x3fb8('0x3a')];}_0x598298[_0x3fb8('0x2d')](_0x47bb2b)['send'](_0x2c6776);};}exports[_0x3fb8('0x3b')]=function(_0x4bba91,_0x5db3c5){var _0x20566d={'include':[{'model':db['Pause'],'as':_0x3fb8('0x3c')}]},_0x5d162e={},_0x282132={'count':0x0,'rows':[]};var _0x1aec80=db[_0x3fb8('0x3d')][_0x3fb8('0x3e')];_0x5d162e[_0x3fb8('0x3f')]=_[_0x3fb8('0x40')](_0x1aec80);_0x5d162e[_0x3fb8('0x41')]=_[_0x3fb8('0x40')](_0x4bba91[_0x3fb8('0x41')]);_0x5d162e['filters']=_[_0x3fb8('0x42')](_0x5d162e[_0x3fb8('0x3f')],_0x5d162e[_0x3fb8('0x41')]);_0x20566d[_0x3fb8('0x43')]=_[_0x3fb8('0x42')](_0x5d162e[_0x3fb8('0x3f')],qs[_0x3fb8('0x44')](_0x4bba91[_0x3fb8('0x41')]['fields']));_0x20566d[_0x3fb8('0x43')]=_0x20566d[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x20566d[_0x3fb8('0x43')]:_0x5d162e[_0x3fb8('0x3f')];if(!_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x46')](_0x3fb8('0x47'))){_0x20566d[_0x3fb8('0x31')]=qs['limit'](_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x31')]);_0x20566d[_0x3fb8('0x30')]=qs[_0x3fb8('0x30')](_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x30')]);}_0x20566d[_0x3fb8('0x48')]=qs[_0x3fb8('0x49')](_0x4bba91[_0x3fb8('0x41')]['sort']);_0x20566d[_0x3fb8('0x4a')]=qs[_0x3fb8('0x4b')](_['pick'](_0x4bba91['query'],_0x5d162e[_0x3fb8('0x4b')]));if(_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x4c')]){_0x20566d[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x20566d[_0x3fb8('0x4a')],{'$or':_[_0x3fb8('0x4e')](_0x1aec80,function(_0x12cae5){if(_0x12cae5[_0x3fb8('0x4f')][_0x3fb8('0x50')]!==_0x3fb8('0x51')){var _0x546e8f={};_0x546e8f[_0x12cae5[_0x3fb8('0x52')]]={'$like':'%'+_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x4c')]+'%'};return _0x546e8f;}})});}_0x20566d=_['merge']({},_0x20566d,_0x4bba91['options']);var _0x31936d={'where':_0x20566d['where']};return db['SmsAccount'][_0x3fb8('0x2f')](_0x31936d)[_0x3fb8('0x20')](function(_0x607ea7){_0x282132[_0x3fb8('0x2f')]=_0x607ea7;if(_0x4bba91[_0x3fb8('0x41')][_0x3fb8('0x53')]){_0x20566d[_0x3fb8('0x54')]=[{'all':!![]}];}return db[_0x3fb8('0x3d')][_0x3fb8('0x55')](_0x20566d);})[_0x3fb8('0x20')](function(_0x4c8bd0){_0x282132[_0x3fb8('0x56')]=_0x4c8bd0;return _0x282132;})[_0x3fb8('0x20')](respondWithFilteredResult(_0x5db3c5,_0x20566d))[_0x3fb8('0x2b')](handleError(_0x5db3c5,null));};exports['show']=function(_0x19d874,_0x585418){var _0x3058ca={'raw':![],'where':{'id':_0x19d874['params']['id']},'include':[{'model':db[_0x3fb8('0x57')],'as':_0x3fb8('0x3c')}]},_0x2cb547={};_0x2cb547['model']=_[_0x3fb8('0x40')](db[_0x3fb8('0x3d')][_0x3fb8('0x3e')]);_0x2cb547[_0x3fb8('0x41')]=_['keys'](_0x19d874[_0x3fb8('0x41')]);_0x2cb547['filters']=_['intersection'](_0x2cb547[_0x3fb8('0x3f')],_0x2cb547[_0x3fb8('0x41')]);_0x3058ca[_0x3fb8('0x43')]=_[_0x3fb8('0x42')](_0x2cb547[_0x3fb8('0x3f')],qs[_0x3fb8('0x44')](_0x19d874['query']['fields']));_0x3058ca['attributes']=_0x3058ca[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x3058ca['attributes']:_0x2cb547[_0x3fb8('0x3f')];if(_0x19d874['query'][_0x3fb8('0x53')]){_0x3058ca['include']=[{'all':!![]}];}_0x3058ca=_[_0x3fb8('0x4d')]({},_0x3058ca,_0x19d874[_0x3fb8('0x58')]);return db['SmsAccount'][_0x3fb8('0x59')](_0x3058ca)['then'](handleEntityNotFound(_0x585418,null))['then'](respondWithResult(_0x585418,null))[_0x3fb8('0x2b')](handleError(_0x585418,null));};exports[_0x3fb8('0x5a')]=function(_0xc64252,_0xd97228){return db[_0x3fb8('0x3d')][_0x3fb8('0x5a')](_0xc64252[_0x3fb8('0x5b')],{})[_0x3fb8('0x20')](function(_0xb7a22d){var _0x47b73b=_0xc64252[_0x3fb8('0x5c')]['get']({'plain':!![]});if(!_0x47b73b)throw new Error(_0x3fb8('0x5d'));if(_0x47b73b[_0x3fb8('0x5e')]===_0x3fb8('0x5c')){var _0x5dcf31=_0xb7a22d['get']({'plain':!![]});var _0x2752fb='SmsAccounts';return db[_0x3fb8('0x5f')]['find']({'where':{'name':_0x2752fb,'userProfileId':_0x47b73b[_0x3fb8('0x60')]},'raw':!![]})['then'](function(_0x2e11e8){if(_0x2e11e8&&_0x2e11e8[_0x3fb8('0x61')]===0x0){return db[_0x3fb8('0x38')][_0x3fb8('0x5a')]({'name':_0x5dcf31[_0x3fb8('0x3a')],'resourceId':_0x5dcf31['id'],'type':_0x2e11e8[_0x3fb8('0x3a')],'sectionId':_0x2e11e8['id']},{})['then'](function(){return _0xb7a22d;});}else{return _0xb7a22d;}})[_0x3fb8('0x2b')](function(_0x4f76c6){logger[_0x3fb8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f76c6);throw _0x4f76c6;});}return _0xb7a22d;})['then'](respondWithResult(_0xd97228,0xc9))[_0x3fb8('0x2b')](handleError(_0xd97228,null));};exports[_0x3fb8('0x34')]=function(_0x1b2ae3,_0x1bfe46){if(_0x1b2ae3[_0x3fb8('0x5b')]['id']){delete _0x1b2ae3[_0x3fb8('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1b2ae3[_0x3fb8('0x62')]['id']},'include':[{'model':db[_0x3fb8('0x57')],'as':_0x3fb8('0x3c')}]})['then'](handleEntityNotFound(_0x1bfe46,null))[_0x3fb8('0x20')](saveUpdates(_0x1b2ae3[_0x3fb8('0x5b')],null))[_0x3fb8('0x20')](respondWithResult(_0x1bfe46,null))[_0x3fb8('0x2b')](handleError(_0x1bfe46,null));};exports[_0x3fb8('0x35')]=function(_0x1363dd,_0x1754b3){return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x1363dd[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x1754b3,null))['then'](removeEntity(_0x1754b3,null))[_0x3fb8('0x2b')](handleError(_0x1754b3,null));};exports[_0x3fb8('0x63')]=function(_0x4fb142,_0xaac140){return db['SmsAccount'][_0x3fb8('0x63')]()['then'](respondWithResult(_0xaac140,null))[_0x3fb8('0x2b')](handleError(_0xaac140,null));};exports['addDisposition']=function(_0x199f21,_0xf44b9a,_0xb87413){if(_0x199f21[_0x3fb8('0x5b')]['id']){delete _0x199f21[_0x3fb8('0x5b')]['id'];}return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x199f21[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0xf44b9a,null))[_0x3fb8('0x20')](function(_0x28c8d5){if(_0x28c8d5){_0x199f21[_0x3fb8('0x5b')][_0x3fb8('0x64')]=_0x28c8d5['id'];return db[_0x3fb8('0x65')][_0x3fb8('0x5a')](_0x199f21[_0x3fb8('0x5b')]);}})['then'](respondWithResult(_0xf44b9a,null))[_0x3fb8('0x2b')](handleError(_0xf44b9a,null));};exports[_0x3fb8('0x66')]=function(_0x233114,_0x1ada7b,_0x42dd0d){var _0x557d7c={'raw':![],'where':{}};var _0x3a22f2={};var _0x1b4870={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3fb8('0x67')]({'where':{'id':_0x233114[_0x3fb8('0x62')]['id']}})['then'](handleEntityNotFound(_0x1ada7b,null))['then'](function(_0x1f1c1a){if(_0x1f1c1a){_0x3a22f2[_0x3fb8('0x3f')]=_[_0x3fb8('0x40')](db[_0x3fb8('0x65')][_0x3fb8('0x3e')]);_0x3a22f2['query']=_[_0x3fb8('0x40')](_0x233114[_0x3fb8('0x41')]);_0x3a22f2[_0x3fb8('0x4b')]=_['intersection'](_0x3a22f2[_0x3fb8('0x3f')],_0x3a22f2[_0x3fb8('0x41')]);_0x557d7c[_0x3fb8('0x43')]=_[_0x3fb8('0x42')](_0x3a22f2[_0x3fb8('0x3f')],qs[_0x3fb8('0x44')](_0x233114[_0x3fb8('0x41')]['fields']));_0x557d7c[_0x3fb8('0x43')]=_0x557d7c[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x557d7c['attributes']:_0x3a22f2[_0x3fb8('0x3f')];if(!_0x233114[_0x3fb8('0x41')][_0x3fb8('0x46')](_0x3fb8('0x47'))){_0x557d7c[_0x3fb8('0x31')]=qs[_0x3fb8('0x31')](_0x233114[_0x3fb8('0x41')]['limit']);_0x557d7c[_0x3fb8('0x30')]=qs[_0x3fb8('0x30')](_0x233114[_0x3fb8('0x41')][_0x3fb8('0x30')]);}_0x557d7c[_0x3fb8('0x48')]=qs[_0x3fb8('0x49')](_0x233114['query'][_0x3fb8('0x49')]);_0x557d7c['where']=qs['filters'](_[_0x3fb8('0x68')](_0x233114[_0x3fb8('0x41')],_0x3a22f2[_0x3fb8('0x4b')]));_0x557d7c[_0x3fb8('0x4a')][_0x3fb8('0x64')]=_0x1f1c1a['id'];if(_0x233114[_0x3fb8('0x41')][_0x3fb8('0x4c')]){_0x557d7c[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x557d7c[_0x3fb8('0x4a')],{'$or':_[_0x3fb8('0x4e')](_0x557d7c[_0x3fb8('0x43')],function(_0x24fb4e){var _0x1ace9b={};_0x1ace9b[_0x24fb4e]={'$like':'%'+_0x233114[_0x3fb8('0x41')][_0x3fb8('0x4c')]+'%'};return _0x1ace9b;})});}_0x557d7c=_[_0x3fb8('0x4d')]({},_0x557d7c,_0x233114[_0x3fb8('0x58')]);return db[_0x3fb8('0x65')][_0x3fb8('0x2f')]({'where':_0x557d7c[_0x3fb8('0x4a')]})[_0x3fb8('0x20')](function(_0x373c5c){_0x1b4870[_0x3fb8('0x2f')]=_0x373c5c;if(_0x233114[_0x3fb8('0x41')][_0x3fb8('0x53')]){_0x557d7c[_0x3fb8('0x54')]=[{'all':!![]}];}return db[_0x3fb8('0x65')][_0x3fb8('0x55')](_0x557d7c);})[_0x3fb8('0x20')](function(_0x23a63c){_0x1b4870[_0x3fb8('0x56')]=_0x23a63c;return _0x1b4870;});}})['then'](respondWithFilteredResult(_0x1ada7b,_0x557d7c))[_0x3fb8('0x2b')](handleError(_0x1ada7b,null));};exports[_0x3fb8('0x69')]=function(_0x3b9eec,_0x5a6f36,_0x881d09){return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x3b9eec['params']['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x5a6f36,null))[_0x3fb8('0x20')](function(_0x30f7f0){if(_0x30f7f0){return _0x30f7f0[_0x3fb8('0x69')](_0x3b9eec[_0x3fb8('0x41')][_0x3fb8('0x6a')]);}})[_0x3fb8('0x20')](respondWithStatusCode(_0x5a6f36,null))[_0x3fb8('0x2b')](handleError(_0x5a6f36,null));};exports[_0x3fb8('0x6b')]=function(_0x4bfdc0,_0x4bf6f1,_0x29bade){if(_0x4bfdc0[_0x3fb8('0x5b')]['id']){delete _0x4bfdc0['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4bfdc0[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x4bf6f1,null))[_0x3fb8('0x20')](function(_0x466fbd){if(_0x466fbd){_0x4bfdc0[_0x3fb8('0x5b')][_0x3fb8('0x64')]=_0x466fbd['id'];return db[_0x3fb8('0x6c')]['create'](_0x4bfdc0['body']);}})[_0x3fb8('0x20')](respondWithResult(_0x4bf6f1,null))['catch'](handleError(_0x4bf6f1,null));};exports['getAnswers']=function(_0xf578d2,_0x533f90,_0x377eea){var _0x29221b={'raw':![],'where':{}};var _0x30837f={};var _0x550c8d={'count':0x0,'rows':[]};return db[_0x3fb8('0x3d')]['findOne']({'where':{'id':_0xf578d2[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x533f90,null))[_0x3fb8('0x20')](function(_0xcd4fa0){if(_0xcd4fa0){_0x30837f[_0x3fb8('0x3f')]=_['keys'](db[_0x3fb8('0x6c')][_0x3fb8('0x3e')]);_0x30837f[_0x3fb8('0x41')]=_[_0x3fb8('0x40')](_0xf578d2[_0x3fb8('0x41')]);_0x30837f[_0x3fb8('0x4b')]=_[_0x3fb8('0x42')](_0x30837f[_0x3fb8('0x3f')],_0x30837f[_0x3fb8('0x41')]);_0x29221b[_0x3fb8('0x43')]=_['intersection'](_0x30837f[_0x3fb8('0x3f')],qs['fields'](_0xf578d2[_0x3fb8('0x41')][_0x3fb8('0x44')]));_0x29221b['attributes']=_0x29221b[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x29221b[_0x3fb8('0x43')]:_0x30837f['model'];if(!_0xf578d2[_0x3fb8('0x41')]['hasOwnProperty'](_0x3fb8('0x47'))){_0x29221b[_0x3fb8('0x31')]=qs[_0x3fb8('0x31')](_0xf578d2[_0x3fb8('0x41')][_0x3fb8('0x31')]);_0x29221b[_0x3fb8('0x30')]=qs[_0x3fb8('0x30')](_0xf578d2['query'][_0x3fb8('0x30')]);}_0x29221b[_0x3fb8('0x48')]=qs['sort'](_0xf578d2[_0x3fb8('0x41')]['sort']);_0x29221b[_0x3fb8('0x4a')]=qs[_0x3fb8('0x4b')](_[_0x3fb8('0x68')](_0xf578d2['query'],_0x30837f[_0x3fb8('0x4b')]));_0x29221b['where'][_0x3fb8('0x64')]=_0xcd4fa0['id'];if(_0xf578d2[_0x3fb8('0x41')]['filter']){_0x29221b[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x29221b[_0x3fb8('0x4a')],{'$or':_['map'](_0x29221b[_0x3fb8('0x43')],function(_0x2b8b40){var _0x5a86e5={};_0x5a86e5[_0x2b8b40]={'$like':'%'+_0xf578d2['query']['filter']+'%'};return _0x5a86e5;})});}_0x29221b=_[_0x3fb8('0x4d')]({},_0x29221b,_0xf578d2[_0x3fb8('0x58')]);return db['CannedAnswer']['count']({'where':_0x29221b[_0x3fb8('0x4a')]})[_0x3fb8('0x20')](function(_0x39ba33){_0x550c8d[_0x3fb8('0x2f')]=_0x39ba33;if(_0xf578d2['query'][_0x3fb8('0x53')]){_0x29221b['include']=[{'all':!![]}];}return db[_0x3fb8('0x6c')][_0x3fb8('0x55')](_0x29221b);})[_0x3fb8('0x20')](function(_0x4132c7){_0x550c8d['rows']=_0x4132c7;return _0x550c8d;});}})[_0x3fb8('0x20')](respondWithFilteredResult(_0x533f90,_0x29221b))[_0x3fb8('0x2b')](handleError(_0x533f90,null));};exports['removeAnswers']=function(_0x583610,_0x53005a,_0x2bc845){return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x583610[_0x3fb8('0x62')]['id']}})['then'](handleEntityNotFound(_0x53005a,null))[_0x3fb8('0x20')](function(_0x174b2a){if(_0x174b2a){return _0x174b2a[_0x3fb8('0x6d')](_0x583610[_0x3fb8('0x41')][_0x3fb8('0x6a')]);}})['then'](respondWithStatusCode(_0x53005a,null))[_0x3fb8('0x2b')](handleError(_0x53005a,null));};exports['notify']=function(_0x536494,_0x58367e,_0x55df38){var _0x575d59={'channel':_0x3fb8('0x6e')};var _0x3c55f1=[];var _0x349e70=[];var _0x2524c8={};return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x536494[_0x3fb8('0x62')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x3fb8('0x6f')}]})[_0x3fb8('0x20')](handleEntityNotFound(_0x58367e,null))['then'](function(_0x44f063){_0x575d59[_0x3fb8('0x70')]=_0x44f063;_0x575d59[_0x3fb8('0x71')]=_['orderBy'](_0x44f063['Applications'],['priority'],['asc']);if(_0x575d59['account'][_0x3fb8('0x6f')]){delete _0x575d59[_0x3fb8('0x70')]['Applications'];}return db[_0x3fb8('0x72')][_0x3fb8('0x63')]();})[_0x3fb8('0x20')](function(_0x507496){if(!_0x507496){throw new db[(_0x3fb8('0x73'))]['ValidationError'](_0x3fb8('0x74'));}_0x3c55f1=_[_0x3fb8('0x75')](_[_0x3fb8('0x40')](_0x507496),['createdAt',_0x3fb8('0x76')]);_0x349e70=_[_0x3fb8('0x75')](_[_0x3fb8('0x40')](_0x507496),['createdAt','updatedAt','CompanyId',_0x3fb8('0x77')]);_0x575d59['body']={'mapKey':_0x3fb8('0x78')};if(_0x575d59['account'][_0x3fb8('0x4f')]){switch(_0x575d59[_0x3fb8('0x70')]['type']){case _0x3fb8('0x79'):_0x575d59[_0x3fb8('0x5b')]['from']=_0x536494['body'][_0x3fb8('0x7a')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7b')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7c')]=_0x536494[_0x3fb8('0x5b')]['MessageSid'];break;case _0x3fb8('0x7d'):_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]='+'+_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7f')];_0x575d59['body'][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x80')];break;case _0x3fb8('0x81'):_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7e')];_0x575d59[_0x3fb8('0x5b')]['body']=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x28')];break;case'clicksend':_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7e')];_0x575d59[_0x3fb8('0x5b')]['body']=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x5b')];_0x575d59[_0x3fb8('0x5b')]['messageId']=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x82')];break;case _0x3fb8('0x83'):_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7a')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]=_0x536494['body'][_0x3fb8('0x84')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7c')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x85')];break;case _0x3fb8('0x86'):_0x575d59[_0x3fb8('0x5b')]['from']='+'+_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x87')][0x0]['from'];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x87')][0x0][_0x3fb8('0x80')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7c')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x87')][0x0]['messageId'];break;case _0x3fb8('0x88'):_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x89')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x8a')][_0x3fb8('0x28')];break;case _0x3fb8('0x8b'):_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')]=_0x536494['body'][_0x3fb8('0x8c')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')]['text'];_0x575d59['body'][_0x3fb8('0x7c')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x8d')];break;case'intelepeer':_0x575d59['body'][_0x3fb8('0x7e')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x7e')];_0x575d59['body'][_0x3fb8('0x5b')]=_0x536494[_0x3fb8('0x5b')][_0x3fb8('0x28')];_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7c')]=_0x536494[_0x3fb8('0x5b')]['refid'];break;}}if(_0x575d59[_0x3fb8('0x5b')]['id']){delete _0x575d59[_0x3fb8('0x5b')]['id'];}if(_[_0x3fb8('0x8e')](_0x575d59[_0x3fb8('0x5b')]['from'])){throw new db[(_0x3fb8('0x73'))][(_0x3fb8('0x8f'))]('from\x20is\x20mandatory');}if(_[_0x3fb8('0x8e')](_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')])||_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x5b')]===''){throw new db[(_0x3fb8('0x73'))]['ValidationError'](_0x3fb8('0x90'));}if(_[_0x3fb8('0x8e')](_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x91')])){throw new db[(_0x3fb8('0x73'))][(_0x3fb8('0x8f'))](_0x3fb8('0x92')+_0x349e70);}if(!_[_0x3fb8('0x93')](_0x349e70,_0x575d59['body'][_0x3fb8('0x91')])){throw new db[(_0x3fb8('0x73'))][(_0x3fb8('0x8f'))](_0x3fb8('0x94')+_0x349e70);}_0x2524c8[_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x91')]]=_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')];return db[_0x3fb8('0x95')][_0x3fb8('0x59')]({'where':{'id':_0x575d59[_0x3fb8('0x70')][_0x3fb8('0x77')]},'include':[{'model':db[_0x3fb8('0x72')],'as':_0x3fb8('0x96'),'where':_0x2524c8,'limit':0x1,'order':[[_0x3fb8('0x76'),_0x3fb8('0x97')]]}]});})[_0x3fb8('0x20')](handleEntityNotFound(_0x58367e,null))['then'](function(_0x37525b){if(_0x37525b){_0x575d59[_0x3fb8('0x98')]=_['omit'](_0x37525b,[_0x3fb8('0x96')]);if(_0x37525b[_0x3fb8('0x96')][_0x3fb8('0x45')]){return _0x37525b[_0x3fb8('0x96')][0x0];}var _0x27503b=_[_0x3fb8('0x19')](_0x575d59[_0x3fb8('0x5b')],{'firstName':_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')],'ListId':_0x37525b['id']});_0x27503b[_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x91')]]=_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')];return db[_0x3fb8('0x72')][_0x3fb8('0x5a')](_0x27503b,{'fields':_0x3c55f1,'raw':!![]});}})[_0x3fb8('0x20')](handleEntityNotFound(_0x58367e,null))['then'](function(_0x59c979){if(_0x59c979){_0x575d59['contact']=_0x59c979;var _0x581140={'ContactId':_0x59c979['id'],'phone':_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')],'SmsAccountId':_0x536494[_0x3fb8('0x62')]['id']};var _0x297b49={'ContactId':_0x59c979['id'],'SmsAccountId':_0x536494['params']['id'],'closed':![]};return db[_0x3fb8('0x99')][_0x3fb8('0x59')]({'where':_0x297b49})[_0x3fb8('0x20')](function(_0x732bd8){if(_0x732bd8){return[_0x732bd8,![]];}return db[_0x3fb8('0x99')][_0x3fb8('0x5a')](_0x581140)[_0x3fb8('0x20')](function(_0x5a8f22){return[_0x5a8f22,!![]];});});}})[_0x3fb8('0x9a')](function(_0x5270c8,_0x14457d){_0x575d59[_0x3fb8('0x9b')]=_0x5270c8['get']({'plain':!![]});_0x575d59[_0x3fb8('0x9b')][_0x3fb8('0x9c')]=![];if(_0x14457d){if(_0x575d59[_0x3fb8('0x70')][_0x3fb8('0x9d')]){_0x575d59[_0x3fb8('0x71')][_0x3fb8('0x9e')]({'id':0x0,'priority':_0x575d59[_0x3fb8('0x71')][_0x3fb8('0x45')]+0x1,'app':_0x3fb8('0x9f'),'appdata':'unmanaged','interval':_0x3fb8('0xa0')});}_0x575d59[_0x3fb8('0x9b')][_0x3fb8('0x9c')]=!![];}return db[_0x3fb8('0xa1')][_0x3fb8('0x5a')]({'phone':_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0x7e')],'messageId':_0x575d59[_0x3fb8('0x5b')]['messageId'],'body':_0x575d59['body'][_0x3fb8('0x5b')],'SmsAccountId':_0x536494['params']['id'],'SmsInteractionId':_0x5270c8['id'],'direction':'in','ContactId':_0x5270c8[_0x3fb8('0xa2')],'AttachmentId':_0x575d59[_0x3fb8('0x5b')][_0x3fb8('0xa3')]});})['then'](function(_0x4c0baf){_0x575d59[_0x3fb8('0x28')]=_0x4c0baf;if(_0x575d59['interaction'][_0x3fb8('0xa4')]){return db[_0x3fb8('0xa5')][_0x3fb8('0x59')]({'attributes':['id','name'],'where':{'id':_0x575d59[_0x3fb8('0x9b')][_0x3fb8('0xa4')]}})[_0x3fb8('0x20')](function(_0x1980bb){if(_0x1980bb){_0x575d59['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3fb8('0xa6'),'appdata':_0x1980bb['name']+','+(_0x575d59[_0x3fb8('0x70')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3fb8('0xa7'),_0x3fb8('0xa8'),_0x575d59);});}return respondWithRpcPromise(_0x3fb8('0xa7'),_0x3fb8('0xa8'),_0x575d59);})[_0x3fb8('0x20')](function(_0x1ed648){if(_0x1ed648){var _0x237f71=0xc8;var _0x22c988=_0x3fb8('0xa9');logger[_0x3fb8('0x29')](_0x3fb8('0x23'),_0x22c988,_0x237f71,_0x3fb8('0xaa'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x22c988,_0x237f71,_0x3fb8('0xaa'),JSON[_0x3fb8('0x25')](_0x1ed648));if(_0x575d59[_0x3fb8('0x70')][_0x3fb8('0x4f')]===_0x3fb8('0x79')){return _0x58367e['status'](_0x237f71)[_0x3fb8('0x32')](_0x3fb8('0xab'),_0x3fb8('0xac'))[_0x3fb8('0xad')](_0x3fb8('0xae'));}else{return _0x58367e['status'](_0x237f71)[_0x3fb8('0x2e')](_0x1ed648);}}})['catch'](handleError(_0x58367e,null));};exports[_0x3fb8('0xaf')]=function(_0x4e3e96,_0x260aa0,_0x4c3b91){return db[_0x3fb8('0x3d')]['findOne']({'where':{'id':_0x4e3e96[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x260aa0,null))[_0x3fb8('0x20')](function(_0x1a72d6){if(_0x1a72d6){return db[_0x3fb8('0xb0')][_0x3fb8('0xb1')](function(_0x3a8a96){return db[_0x3fb8('0xb2')][_0x3fb8('0x35')]({'where':{'SmsAccountId':_0x4e3e96[_0x3fb8('0x62')]['id']},'transaction':_0x3a8a96})[_0x3fb8('0x20')](function(_0x13ce76){var _0x2cf14f=_[_0x3fb8('0x4e')](_0x4e3e96['body'],function(_0x4101b1){_0x4101b1[_0x3fb8('0x64')]=_0x4e3e96['params']['id'];return _0x4101b1;});return db['SmsApplication'][_0x3fb8('0xb3')](_0x2cf14f,{'transaction':_0x3a8a96});});})['then'](function(){return db[_0x3fb8('0xb2')][_0x3fb8('0xb4')]({'where':{'SmsAccountId':_0x4e3e96[_0x3fb8('0x62')]['id']},'order':_0x3fb8('0xb5')});});}})[_0x3fb8('0x20')](respondWithResult(_0x260aa0,null))['catch'](handleError(_0x260aa0,null));};exports['getApplications']=function(_0x5ba202,_0x467227,_0x16110a){var _0x31c7de={};var _0x2b5b73={};var _0x36b1f9;var _0x583b61;return db[_0x3fb8('0x3d')][_0x3fb8('0x67')]({'where':{'id':_0x5ba202[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x467227,null))[_0x3fb8('0x20')](function(_0x1abe30){if(_0x1abe30){_0x36b1f9=_0x1abe30;_0x2b5b73[_0x3fb8('0x3f')]=_[_0x3fb8('0x40')](db[_0x3fb8('0xb2')]['rawAttributes']);_0x2b5b73[_0x3fb8('0x41')]=_['keys'](_0x5ba202['query']);_0x2b5b73['filters']=_[_0x3fb8('0x42')](_0x2b5b73['model'],_0x2b5b73['query']);_0x31c7de[_0x3fb8('0x43')]=_[_0x3fb8('0x42')](_0x2b5b73[_0x3fb8('0x3f')],qs['fields'](_0x5ba202[_0x3fb8('0x41')][_0x3fb8('0x44')]));_0x31c7de[_0x3fb8('0x43')]=_0x31c7de[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x31c7de[_0x3fb8('0x43')]:_0x2b5b73[_0x3fb8('0x3f')];_0x31c7de[_0x3fb8('0x48')]=qs[_0x3fb8('0x49')](_0x5ba202['query'][_0x3fb8('0x49')]);_0x31c7de[_0x3fb8('0x4a')]=qs['filters'](_[_0x3fb8('0x68')](_0x5ba202[_0x3fb8('0x41')],_0x2b5b73[_0x3fb8('0x4b')]));if(_0x5ba202[_0x3fb8('0x41')][_0x3fb8('0x4c')]){_0x31c7de[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x31c7de[_0x3fb8('0x4a')],{'$or':_[_0x3fb8('0x4e')](_0x31c7de[_0x3fb8('0x43')],function(_0x19087b){var _0x5774e5={};_0x5774e5[_0x19087b]={'$like':'%'+_0x5ba202[_0x3fb8('0x41')]['filter']+'%'};return _0x5774e5;})});}_0x31c7de=_[_0x3fb8('0x4d')]({},_0x31c7de,_0x5ba202[_0x3fb8('0x58')]);return _0x36b1f9[_0x3fb8('0xb6')](_0x31c7de);}})[_0x3fb8('0x20')](function(_0x421059){if(_0x421059){_0x583b61=_0x421059[_0x3fb8('0x45')];if(!_0x5ba202[_0x3fb8('0x41')][_0x3fb8('0x46')](_0x3fb8('0x47'))){_0x31c7de[_0x3fb8('0x31')]=qs[_0x3fb8('0x31')](_0x5ba202[_0x3fb8('0x41')][_0x3fb8('0x31')]);_0x31c7de[_0x3fb8('0x30')]=qs['offset'](_0x5ba202['query'][_0x3fb8('0x30')]);}return _0x36b1f9[_0x3fb8('0xb6')](_0x31c7de);}})[_0x3fb8('0x20')](function(_0x45da84){if(_0x45da84){return _0x45da84?{'count':_0x583b61,'rows':_0x45da84}:null;}})[_0x3fb8('0x20')](respondWithResult(_0x467227,null))[_0x3fb8('0x2b')](handleError(_0x467227,null));};exports[_0x3fb8('0xb7')]=function(_0x1975e9,_0x38f124,_0x4785b0){var _0x338195={'raw':![],'where':{}};var _0x3a809b={};var _0x45a9d4={'count':0x0,'rows':[]};return db[_0x3fb8('0x3d')][_0x3fb8('0x67')]({'where':{'id':_0x1975e9[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x38f124,null))['then'](function(_0x3a39b1){if(_0x3a39b1){_0x3a809b[_0x3fb8('0x3f')]=_[_0x3fb8('0x40')](db['SmsInteraction'][_0x3fb8('0x3e')]);_0x3a809b[_0x3fb8('0x41')]=_[_0x3fb8('0x40')](_0x1975e9[_0x3fb8('0x41')]);_0x3a809b['filters']=_[_0x3fb8('0x42')](_0x3a809b[_0x3fb8('0x3f')],_0x3a809b[_0x3fb8('0x41')]);_0x338195['attributes']=_[_0x3fb8('0x42')](_0x3a809b['model'],qs[_0x3fb8('0x44')](_0x1975e9[_0x3fb8('0x41')]['fields']));_0x338195[_0x3fb8('0x43')]=_0x338195[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x338195[_0x3fb8('0x43')]:_0x3a809b[_0x3fb8('0x3f')];if(!_0x1975e9[_0x3fb8('0x41')]['hasOwnProperty']('nolimit')){_0x338195[_0x3fb8('0x31')]=qs['limit'](_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0x31')]);_0x338195[_0x3fb8('0x30')]=qs[_0x3fb8('0x30')](_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0x30')]);}_0x338195[_0x3fb8('0x48')]=qs[_0x3fb8('0x49')](_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0x49')]);_0x338195[_0x3fb8('0x4a')]=qs['filters'](_['pick'](_0x1975e9[_0x3fb8('0x41')],_0x3a809b[_0x3fb8('0x4b')]));_0x338195['where'][_0x3fb8('0x64')]=_0x3a39b1['id'];if(_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0x4c')]){_0x338195[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x338195[_0x3fb8('0x4a')],{'$or':_['map'](_0x338195[_0x3fb8('0x43')],function(_0x398d29){var _0x15cd51={};_0x15cd51[_0x398d29]={'$like':'%'+_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0x4c')]+'%'};return _0x15cd51;})});}_0x338195=_['merge']({},_0x338195,_0x1975e9[_0x3fb8('0x58')]);return db[_0x3fb8('0x99')]['count']({'where':_0x338195[_0x3fb8('0x4a')]})['then'](function(_0x5d4776){_0x45a9d4['count']=_0x5d4776;if(_0x1975e9[_0x3fb8('0x41')]['includeAll']){_0x338195[_0x3fb8('0x54')]=[{'model':db[_0x3fb8('0x72')],'as':_0x3fb8('0xb8'),'required':![]},{'model':db[_0x3fb8('0xa5')],'as':_0x3fb8('0xb9'),'attributes':['name',_0x3fb8('0xba'),_0x3fb8('0xbb')],'required':![]},{'model':db[_0x3fb8('0xbc')],'as':_0x3fb8('0xbd'),'attributes':['id',_0x3fb8('0x3a'),_0x3fb8('0xbe')],'where':_0x1975e9[_0x3fb8('0x41')][_0x3fb8('0xbf')]?{'id':_0x1975e9['query']['tag']}:undefined,'required':_0x1975e9['query'][_0x3fb8('0xbf')]?!![]:![]}];}return db['SmsInteraction'][_0x3fb8('0x55')](_0x338195);})[_0x3fb8('0x20')](function(_0xefb2b3){_0x45a9d4[_0x3fb8('0x56')]=_0xefb2b3;return _0x45a9d4;});}})['then'](respondWithFilteredResult(_0x38f124,_0x338195))[_0x3fb8('0x2b')](handleError(_0x38f124,null));};exports['send']=function(_0x4181ed,_0x365825,_0x516b3c){var _0x232cc4,_0x242643,_0xa6e748;if(_[_0x3fb8('0x8e')](_0x4181ed['body'][_0x3fb8('0x5b')])||_0x4181ed[_0x3fb8('0x5b')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x3fb8('0x90'));}if(_['isNil'](_0x4181ed[_0x3fb8('0x5b')]['to'])){throw new db['Sequelize'][(_0x3fb8('0x8f'))](_0x3fb8('0xc0'));}_0x232cc4=_0x4181ed['body']['to'];return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x4181ed[_0x3fb8('0x62')]['id']},'include':[{'model':db[_0x3fb8('0x95')],'as':_0x3fb8('0xc1'),'include':[{'model':db[_0x3fb8('0x72')],'as':_0x3fb8('0x96'),'where':{'mobile':_0x232cc4},'limit':0x1,'order':[[_0x3fb8('0x76'),'DESC']]}]}]})[_0x3fb8('0x20')](handleEntityNotFound(_0x365825,null))[_0x3fb8('0x20')](function(_0x9773de){if(_0x9773de&&_0x9773de[_0x3fb8('0xc1')]){_0x242643=_0x9773de[_0x3fb8('0x36')]({'plain':!![]});if(_0x242643[_0x3fb8('0xc1')]&&_0x242643[_0x3fb8('0xc1')][_0x3fb8('0x96')][_0x3fb8('0x45')]){return _0x242643['List']['Contacts'][0x0];}return db[_0x3fb8('0x72')][_0x3fb8('0x5a')](_[_0x3fb8('0x19')](_0x4181ed[_0x3fb8('0x5b')],{'firstName':_0x232cc4,'mobile':_0x232cc4,'phone':_0x232cc4,'ListId':_0x242643['ListId']}));}})[_0x3fb8('0x20')](handleEntityNotFound(_0x365825,null))[_0x3fb8('0x20')](function(_0x2c3dbf){if(_0x2c3dbf){_0xa6e748=_0x2c3dbf;return db[_0x3fb8('0x99')][_0x3fb8('0x59')]({'where':{'ContactId':_0xa6e748['id'],'closed':![],'SmsAccountId':_0x242643['id']}})[_0x3fb8('0x20')](function(_0x7712f2){if(_0x7712f2){return[_0x7712f2,![]];}return db[_0x3fb8('0x99')][_0x3fb8('0x5a')]({'UserId':_0x4181ed[_0x3fb8('0x5c')]['id'],'ContactId':_0xa6e748['id'],'SmsAccountId':_0x242643['id'],'phone':_0x232cc4,'firstMsgDirection':_0x3fb8('0xc2'),'Messages':[_[_0x3fb8('0x4d')](_0x4181ed[_0x3fb8('0x5b')],{'read':![],'body':_0x4181ed[_0x3fb8('0x5b')]['body'],'phone':_0x232cc4,'SmsAccountId':_0x242643['id'],'UserId':_0x4181ed['user']['id'],'ContactId':_0xa6e748['id']})]},{'include':[{'model':db[_0x3fb8('0xa1')],'as':'Messages'}]})['then'](function(_0x37a358){return[_0x37a358,!![]];});});}})[_0x3fb8('0x9a')](function(_0x4eded2,_0x19cc75){if(_0x19cc75){return _0x4eded2;}return db[_0x3fb8('0xa1')][_0x3fb8('0x5a')](_['merge'](_0x4181ed['body'],{'read':![],'body':_0x4181ed[_0x3fb8('0x5b')][_0x3fb8('0x5b')],'phone':_0x232cc4,'SmsAccountId':_0x242643['id'],'SmsInteractionId':_0x4eded2['id'],'UserId':_0x4181ed[_0x3fb8('0x5c')]['id'],'ContactId':_0xa6e748['id']}))['then'](function(_0x356d6e){_0x4eded2[_0x3fb8('0xc3')][_0x3fb8('0xc4')]=[];_0x4eded2[_0x3fb8('0xc3')][_0x3fb8('0xc4')][_0x3fb8('0x9e')](_0x356d6e[_0x3fb8('0xc3')]);return _0x4eded2;});})['then'](respondWithResult(_0x365825,null))[_0x3fb8('0x2b')](handleError(_0x365825,null));};exports[_0x3fb8('0x2d')]=function(_0x363a76,_0x39c6df,_0x515ca5){if(_0x363a76['body']['id']){delete _0x363a76['body']['id'];}console[_0x3fb8('0xc5')](_0x3fb8('0xc6'),_0x363a76[_0x3fb8('0x5b')]);var _0x53a508,_0x14775d,_0x2fa748;return db[_0x3fb8('0x3d')]['find']({'where':{'id':_0x363a76[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x39c6df,null))[_0x3fb8('0x20')](function(_0x375fe2){if(_0x375fe2){_0x2fa748=_0x375fe2;logger[_0x3fb8('0x22')](_0x3fb8('0x23'),_0x3fb8('0x2d'),_0x3fb8('0xc7'),_0x375fe2['type'],util[_0x3fb8('0xc8')](_0x363a76[_0x3fb8('0x5b')],{'showHidden':![],'depth':null}));switch(_0x375fe2['type']){case _0x3fb8('0x7d'):if(_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0xc9')]&&_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x2d')]){_0x14775d=_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x2d')];return db[_0x3fb8('0xa1')][_0x3fb8('0x59')]({'where':{'messageId':_0x363a76[_0x3fb8('0x5b')]['skebby_dispatch_id']}});}break;case _0x3fb8('0x81'):if(_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0xca')]&&_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0xcb')]){_0x14775d=_0x363a76['body']['statusInt'];return db[_0x3fb8('0xa1')]['find']({'where':{'messageId':_0x363a76[_0x3fb8('0x5b')]['requestid']}});}break;case _0x3fb8('0xcc'):if(_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x82')]&&_0x363a76['body'][_0x3fb8('0xcd')]){_0x14775d=_0x363a76['body'][_0x3fb8('0xcd')];return db['SmsMessage'][_0x3fb8('0x59')]({'where':{'messageId':_0x363a76[_0x3fb8('0x5b')]['message_id']}});}break;case _0x3fb8('0x86'):var _0x3c1b0e=_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x87')][0x0];if(_0x3c1b0e[_0x3fb8('0x7c')]&&_0x3c1b0e[_0x3fb8('0x2d')][_0x3fb8('0xce')]==='DELIVERED'){_0x14775d=_0x3c1b0e[_0x3fb8('0x2d')][_0x3fb8('0xce')];return db[_0x3fb8('0xa1')][_0x3fb8('0x59')]({'where':{'messageId':_0x3c1b0e[_0x3fb8('0x7c')]}});}break;case _0x3fb8('0x8b'):if(_0x363a76['body'][_0x3fb8('0x7c')]&&_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x2d')]){_0x14775d=_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x2d')];return db[_0x3fb8('0xa1')][_0x3fb8('0x59')]({'where':{'messageId':_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x7c')]}});}break;case _0x3fb8('0xcf'):if(_0x363a76['body']['redif']&&_0x363a76['body'][_0x3fb8('0x2d')]){_0x14775d=_0x363a76[_0x3fb8('0x5b')]['status'];return db[_0x3fb8('0xa1')][_0x3fb8('0x59')]({'where':{'messageId':_0x363a76['body'][_0x3fb8('0xd0')]}});}break;}}})[_0x3fb8('0x20')](handleEntityNotFound(_0x39c6df,null))[_0x3fb8('0x20')](function(_0x3a2583){if(_0x3a2583){_0x53a508=_0x3a2583;switch(_0x2fa748[_0x3fb8('0x4f')]){case _0x3fb8('0x7d'):if(_0x14775d==='DELIVERED'){return _0x53a508[_0x3fb8('0x34')]({'read':!![]});}else{logger[_0x3fb8('0x26')](_0x3fb8('0x23'),_0x3fb8('0x2d'),_0x3fb8('0x7d'),util['inspect'](_0x363a76['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x14775d==='1'){return _0x53a508[_0x3fb8('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb8('0x2d'),_0x3fb8('0x7d'),util[_0x3fb8('0xc8')](_0x363a76[_0x3fb8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x3fb8('0xcc'):if(!_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0xd1')]&&_0x14775d>=0xc8&&_0x14775d<=0xce){return _0x53a508['update']({'read':!![]});}else{logger['error'](_0x3fb8('0x23'),_0x3fb8('0x2d'),_0x3fb8('0xcc'),util[_0x3fb8('0xc8')](_0x363a76[_0x3fb8('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4e354e=_0x363a76[_0x3fb8('0x5b')][_0x3fb8('0x87')][0x0];if(_0x4e354e[_0x3fb8('0x2d')]['groupName']==='DELIVERED'){return _0x53a508[_0x3fb8('0x34')]({'read':!![]});}else{logger[_0x3fb8('0x26')](_0x3fb8('0x23'),_0x3fb8('0x2d'),_0x3fb8('0x86'),util[_0x3fb8('0xc8')](_0x363a76[_0x3fb8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x3fb8('0x8b'):if(_0x14775d==_0x3fb8('0xd2')||_0x14775d==_0x3fb8('0xd3')){return _0x53a508[_0x3fb8('0x34')]({'read':!![]});}else{logger[_0x3fb8('0x26')](_0x3fb8('0x23'),_0x3fb8('0x2d'),_0x3fb8('0x8b'),util[_0x3fb8('0xc8')](_0x363a76[_0x3fb8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x3fb8('0xcf'):if(_0x14775d===_0x3fb8('0xd4')||_0x14775d==='ACCEPTD'){return _0x53a508[_0x3fb8('0x34')]({'read':!![]});}else{logger[_0x3fb8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb8('0x2d'),'intelepeer',util[_0x3fb8('0xc8')](_0x363a76['body'],{'showHidden':![],'depth':null}));}break;}return _0x53a508;}})[_0x3fb8('0x20')](respondWithResult(_0x39c6df,null))[_0x3fb8('0x2b')](handleError(_0x39c6df,null));};exports[_0x3fb8('0xd5')]=function(_0x3e2216,_0x2f1d7e,_0x1d18da){var _0x5d4445,_0x10d11b,_0x31f369;return db[_0x3fb8('0x3d')]['find']({'where':{'id':_0x3e2216[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x2f1d7e,null))['then'](function(_0x5b9445){if(_0x5b9445){_0x31f369=_0x5b9445;logger[_0x3fb8('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb8('0x2d'),'received\x20delivery\x20report\x20from',_0x5b9445[_0x3fb8('0x4f')],util[_0x3fb8('0xc8')](_0x3e2216[_0x3fb8('0x41')],{'showHidden':![],'depth':null}));switch(_0x5b9445[_0x3fb8('0x4f')]){case _0x3fb8('0x88'):if(_0x3e2216[_0x3fb8('0x41')][_0x3fb8('0xd6')]&&_0x3e2216[_0x3fb8('0x41')][_0x3fb8('0xd7')]){_0x10d11b=_0x3e2216[_0x3fb8('0x41')][_0x3fb8('0xd7')];return db['SmsMessage'][_0x3fb8('0x59')]({'where':{'messageId':_0x3e2216[_0x3fb8('0x41')][_0x3fb8('0xd6')]}});}break;}}})[_0x3fb8('0x20')](handleEntityNotFound(_0x2f1d7e,null))['then'](function(_0x119985){if(_0x119985){_0x5d4445=_0x119985;switch(_0x31f369[_0x3fb8('0x4f')]){case _0x3fb8('0x88'):if(_0x10d11b==='2'||_0x10d11b==='6'){return _0x5d4445[_0x3fb8('0x34')]({'read':!![]});}else{logger[_0x3fb8('0x26')](_0x3fb8('0x23'),'status','csc',util[_0x3fb8('0xc8')](_0x3e2216['query'],{'showHidden':![],'depth':null}));};break;}return _0x5d4445;}})[_0x3fb8('0x20')](respondWithResult(_0x2f1d7e,null))['catch'](handleError(_0x2f1d7e,null));};exports[_0x3fb8('0xd8')]=function(_0x4b9742,_0x4d3f4d,_0x449a8c){return db[_0x3fb8('0x3d')]['find']({'where':{'id':_0x4b9742['params']['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x4d3f4d,null))[_0x3fb8('0x20')](function(_0x5cfb0f){if(_0x5cfb0f){return _0x5cfb0f['addAgents'](_0x4b9742['body']['ids'],_[_0x3fb8('0xd9')](_0x4b9742['body'],[_0x3fb8('0x6a'),'id'])||{})[_0x3fb8('0x9a')](function(_0x787906){for(var _0xfdc05d=0x0;_0xfdc05d<_0x4b9742[_0x3fb8('0x5b')]['ids']['length'];_0xfdc05d+=0x1){socket[_0x3fb8('0xda')](_0x3fb8('0xdb'),{'UserId':_0x4b9742[_0x3fb8('0x5b')][_0x3fb8('0x6a')][_0xfdc05d],'SmsAccountId':_0x4b9742[_0x3fb8('0x62')]['id']});}return _0x787906;});}})['then'](respondWithResult(_0x4d3f4d,null))[_0x3fb8('0x2b')](handleError(_0x4d3f4d,null));};exports[_0x3fb8('0xdc')]=function(_0x23a3a0,_0x491be7,_0xec0e4b){return db[_0x3fb8('0x3d')][_0x3fb8('0x59')]({'where':{'id':_0x23a3a0[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x491be7,null))[_0x3fb8('0x20')](function(_0x37f032){if(_0x37f032){return _0x37f032[_0x3fb8('0xdc')](_0x23a3a0[_0x3fb8('0x41')]['ids'])[_0x3fb8('0x20')](function(){if(_['isArray'](_0x23a3a0['query'][_0x3fb8('0x6a')])){for(var _0xfddcad=0x0;_0xfddcad<_0x23a3a0[_0x3fb8('0x41')]['ids'][_0x3fb8('0x45')];_0xfddcad+=0x1){socket[_0x3fb8('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x23a3a0[_0x3fb8('0x41')][_0x3fb8('0x6a')][_0xfddcad]),'SmsAccountId':Number(_0x23a3a0['params']['id'])});}}else{socket[_0x3fb8('0xda')](_0x3fb8('0xdd'),{'UserId':Number(_0x23a3a0[_0x3fb8('0x41')][_0x3fb8('0x6a')]),'SmsAccountId':Number(_0x23a3a0[_0x3fb8('0x62')]['id'])});}});}})[_0x3fb8('0x20')](respondWithStatusCode(_0x491be7,null))[_0x3fb8('0x2b')](handleError(_0x491be7,null));};exports['getAgents']=function(_0x503128,_0x509121,_0x50bf00){var _0x5ca5c6={};var _0x28b62a={};var _0x31eb31;var _0x2c31ba;return db[_0x3fb8('0x3d')][_0x3fb8('0x67')]({'where':{'id':_0x503128[_0x3fb8('0x62')]['id']}})[_0x3fb8('0x20')](handleEntityNotFound(_0x509121,null))['then'](function(_0x1f5576){if(_0x1f5576){_0x31eb31=_0x1f5576;_0x28b62a[_0x3fb8('0x3f')]=_[_0x3fb8('0x40')](db[_0x3fb8('0xa5')][_0x3fb8('0x3e')]);_0x28b62a['query']=_[_0x3fb8('0x40')](_0x503128[_0x3fb8('0x41')]);_0x28b62a[_0x3fb8('0x4b')]=_['intersection'](_0x28b62a['model'],_0x28b62a['query']);_0x5ca5c6[_0x3fb8('0x43')]=_[_0x3fb8('0x42')](_0x28b62a['model'],qs[_0x3fb8('0x44')](_0x503128[_0x3fb8('0x41')][_0x3fb8('0x44')]));_0x5ca5c6[_0x3fb8('0x43')]=_0x5ca5c6[_0x3fb8('0x43')][_0x3fb8('0x45')]?_0x5ca5c6[_0x3fb8('0x43')]:_0x28b62a[_0x3fb8('0x3f')];_0x5ca5c6['order']=qs[_0x3fb8('0x49')](_0x503128[_0x3fb8('0x41')][_0x3fb8('0x49')]);_0x5ca5c6[_0x3fb8('0x4a')]=qs[_0x3fb8('0x4b')](_[_0x3fb8('0x68')](_0x503128[_0x3fb8('0x41')],_0x28b62a['filters']));if(_0x503128[_0x3fb8('0x41')][_0x3fb8('0x4c')]){_0x5ca5c6[_0x3fb8('0x4a')]=_[_0x3fb8('0x4d')](_0x5ca5c6['where'],{'$or':_[_0x3fb8('0x4e')](_0x5ca5c6[_0x3fb8('0x43')],function(_0x5e916c){var _0x45c13c={};_0x45c13c[_0x5e916c]={'$like':'%'+_0x503128['query'][_0x3fb8('0x4c')]+'%'};return _0x45c13c;})});}_0x5ca5c6=_['merge']({},_0x5ca5c6,_0x503128[_0x3fb8('0x58')]);return _0x31eb31[_0x3fb8('0xde')](_0x5ca5c6);}})['then'](function(_0x39fd0d){if(_0x39fd0d){_0x2c31ba=_0x39fd0d['length'];if(!_0x503128[_0x3fb8('0x41')]['hasOwnProperty']('nolimit')){_0x5ca5c6[_0x3fb8('0x31')]=qs['limit'](_0x503128['query'][_0x3fb8('0x31')]);_0x5ca5c6['offset']=qs['offset'](_0x503128[_0x3fb8('0x41')]['offset']);}return _0x31eb31['getAgents'](_0x5ca5c6);}})[_0x3fb8('0x20')](function(_0x59f58d){if(_0x59f58d){return _0x59f58d?{'count':_0x2c31ba,'rows':_0x59f58d}:null;}})[_0x3fb8('0x20')](respondWithResult(_0x509121,null))[_0x3fb8('0x2b')](handleError(_0x509121,null));}; \ No newline at end of file +var _0x7c7b=['html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','end','status','json','offset','limit','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','SmsAccount','keys','query','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','rows','Pause','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','Disposition','getDispositions','rawAttributes','nolimit','order','removeDispositions','SmsAccountId','CannedAnswer','findOne','findAll','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','omit','contact','SmsInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','requestid','clicksend','status_code','groupName','clickatell','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','state','addAgents','ids','spread','emit','removeAgents','isArray','userSmsAccount:remove','getAgents'];(function(_0x1a9f82,_0x1305dc){var _0x1c397c=function(_0x51c125){while(--_0x51c125){_0x1a9f82['push'](_0x1a9f82['shift']());}};_0x1c397c(++_0x1305dc);}(_0x7c7b,0xe1));var _0xb7c7=function(_0x44dca7,_0x1aec74){_0x44dca7=_0x44dca7-0x0;var _0x56b40f=_0x7c7b[_0x44dca7];return _0x56b40f;};'use strict';var pdf=require(_0xb7c7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb7c7('0x1'));var jsonpatch=require(_0xb7c7('0x2'));var rp=require(_0xb7c7('0x3'));var moment=require(_0xb7c7('0x4'));var BPromise=require(_0xb7c7('0x5'));var Mustache=require(_0xb7c7('0x6'));var util=require(_0xb7c7('0x7'));var path=require(_0xb7c7('0x8'));var sox=require(_0xb7c7('0x9'));var csv=require(_0xb7c7('0xa'));var ejs=require(_0xb7c7('0xb'));var fs=require('fs');var _=require(_0xb7c7('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb7c7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb7c7('0xe'));var Papa=require(_0xb7c7('0xf'));var Redis=require(_0xb7c7('0x10'));var authService=require(_0xb7c7('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb7c7('0x12'));var logger=require(_0xb7c7('0x13'))(_0xb7c7('0x14'));var utils=require(_0xb7c7('0x15'));var config=require(_0xb7c7('0x16'));var db=require(_0xb7c7('0x17'))['db'];config[_0xb7c7('0x18')]=_[_0xb7c7('0x19')](config['redis'],{'host':_0xb7c7('0x1a'),'port':0x18eb});var socket=require(_0xb7c7('0x1b'))(new Redis(config[_0xb7c7('0x18')]));require(_0xb7c7('0x1c'))[_0xb7c7('0x1d')](socket);var jayson=require(_0xb7c7('0x1e'));var client=jayson['client'][_0xb7c7('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x3eb78a,_0x34cec7,_0x4c6fe4){if(_0x4c6fe4){var _0xdedfbb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdedfbb[_0xb7c7('0x20')](_0x34cec7)){return _0x3eb78a;}else{throw new Error(_0xb7c7('0x21'));}}else{return _0x3eb78a;}}function respondWithRpcPromise(_0x4a0370,_0x46b3f6,_0x2e150e,_0x3bb3b2){return new BPromise(function(_0x32f5a6,_0x2684f0){var _0x556686=_0x3bb3b2||client;return _0x556686[_0xb7c7('0x22')](_0x4a0370,_0x2e150e)[_0xb7c7('0x23')](function(_0x3b174e){logger[_0xb7c7('0x24')]('SmsAccount,\x20%s,\x20%s',_0x46b3f6,_0xb7c7('0x25'));logger[_0xb7c7('0x26')](_0xb7c7('0x27'),_0x46b3f6,_0xb7c7('0x25'),JSON[_0xb7c7('0x28')](_0x3b174e));if(_0x3b174e['error']){if(_0x3b174e[_0xb7c7('0x29')][_0xb7c7('0x2a')]===0x1f4){logger[_0xb7c7('0x29')](_0xb7c7('0x2b'),_0x46b3f6,_0x3b174e[_0xb7c7('0x29')]['message']);return _0x2684f0(_0x3b174e[_0xb7c7('0x29')][_0xb7c7('0x2c')]);}logger[_0xb7c7('0x29')]('SmsAccount,\x20%s,\x20%s',_0x46b3f6,_0x3b174e[_0xb7c7('0x29')][_0xb7c7('0x2c')]);return _0x32f5a6(_0x3b174e[_0xb7c7('0x29')][_0xb7c7('0x2c')]);}else{logger['info'](_0xb7c7('0x2b'),_0x46b3f6,_0xb7c7('0x25'));_0x32f5a6(_0x3b174e['result'][_0xb7c7('0x2c')]);}})[_0xb7c7('0x2d')](function(_0x558f28){logger[_0xb7c7('0x29')](_0xb7c7('0x2b'),_0x46b3f6,_0x558f28);_0x2684f0(_0x558f28);});});}function respondWithStatusCode(_0x303d22,_0x37d36f){_0x37d36f=_0x37d36f||0xcc;return function(_0x30d1e0){if(_0x30d1e0){return _0x303d22['sendStatus'](_0x37d36f);}return _0x303d22['status'](_0x37d36f)[_0xb7c7('0x2e')]();};}function respondWithResult(_0x1f827c,_0x1708fa){_0x1708fa=_0x1708fa||0xc8;return function(_0x12ac3a){if(_0x12ac3a){return _0x1f827c[_0xb7c7('0x2f')](_0x1708fa)[_0xb7c7('0x30')](_0x12ac3a);}};}function respondWithFilteredResult(_0x5f1430,_0x51c7ac){return function(_0x3a5d5b){if(_0x3a5d5b){var _0x44bde3=_0x3a5d5b['count'],_0x4a39e8=_0x51c7ac[_0xb7c7('0x31')],_0x16d01f=_0x51c7ac[_0xb7c7('0x31')]+_0x51c7ac[_0xb7c7('0x32')],_0x119d0f;if(_0x16d01f>=_0x44bde3){_0x16d01f=_0x44bde3;_0x119d0f=0xc8;}else{_0x119d0f=0xce;}_0x5f1430[_0xb7c7('0x2f')](_0x119d0f);return _0x5f1430[_0xb7c7('0x33')]('Content-Range',_0x4a39e8+'-'+_0x16d01f+'/'+_0x44bde3)['json'](_0x3a5d5b);}return null;};}function patchUpdates(_0xfbf11c){return function(_0x4eea91){try{jsonpatch[_0xb7c7('0x34')](_0x4eea91,_0xfbf11c,!![]);}catch(_0x5a7dc4){return BPromise['reject'](_0x5a7dc4);}return _0x4eea91[_0xb7c7('0x35')]();};}function saveUpdates(_0x2ff357,_0x443d96){return function(_0x30b8b0){if(_0x30b8b0){return _0x30b8b0['update'](_0x2ff357)[_0xb7c7('0x23')](function(_0x5bb7ec){return _0x5bb7ec;});}return null;};}function removeEntity(_0x11dc6c,_0x526552){return function(_0x57b932){if(_0x57b932){return _0x57b932[_0xb7c7('0x36')]()['then'](function(){var _0x4ab37a=_0x57b932[_0xb7c7('0x37')]({'plain':!![]});var _0x4062ca=_0xb7c7('0x38');return db[_0xb7c7('0x39')][_0xb7c7('0x36')]({'where':{'type':_0x4062ca,'resourceId':_0x4ab37a['id']}})[_0xb7c7('0x23')](function(){return _0x57b932;});})[_0xb7c7('0x23')](function(){_0x11dc6c[_0xb7c7('0x2f')](0xcc)[_0xb7c7('0x2e')]();});}};}function handleEntityNotFound(_0x41b2d7,_0x34ca1c){return function(_0x18b615){if(!_0x18b615){_0x41b2d7[_0xb7c7('0x3a')](0x194);}return _0x18b615;};}function handleError(_0x9ec0d9,_0x4bcdea){_0x4bcdea=_0x4bcdea||0x1f4;return function(_0x3fe4ed){logger[_0xb7c7('0x29')](_0x3fe4ed['stack']);if(_0x3fe4ed[_0xb7c7('0x3b')]){delete _0x3fe4ed['name'];}_0x9ec0d9[_0xb7c7('0x2f')](_0x4bcdea)[_0xb7c7('0x3c')](_0x3fe4ed);};}exports[_0xb7c7('0x3d')]=function(_0x3fd5da,_0x3719d4){var _0x77dec0={'include':[{'model':db['Pause'],'as':_0xb7c7('0x3e')}]},_0x2e54a7={},_0x9d5763={'count':0x0,'rows':[]};var _0x1197c5=db[_0xb7c7('0x3f')]['rawAttributes'];_0x2e54a7['model']=_[_0xb7c7('0x40')](_0x1197c5);_0x2e54a7['query']=_[_0xb7c7('0x40')](_0x3fd5da[_0xb7c7('0x41')]);_0x2e54a7[_0xb7c7('0x42')]=_['intersection'](_0x2e54a7[_0xb7c7('0x43')],_0x2e54a7[_0xb7c7('0x41')]);_0x77dec0[_0xb7c7('0x44')]=_['intersection'](_0x2e54a7[_0xb7c7('0x43')],qs[_0xb7c7('0x45')](_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x77dec0[_0xb7c7('0x44')]=_0x77dec0[_0xb7c7('0x44')][_0xb7c7('0x46')]?_0x77dec0[_0xb7c7('0x44')]:_0x2e54a7[_0xb7c7('0x43')];if(!_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x47')]('nolimit')){_0x77dec0[_0xb7c7('0x32')]=qs['limit'](_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x32')]);_0x77dec0[_0xb7c7('0x31')]=qs[_0xb7c7('0x31')](_0x3fd5da['query'][_0xb7c7('0x31')]);}_0x77dec0['order']=qs['sort'](_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x48')]);_0x77dec0[_0xb7c7('0x49')]=qs['filters'](_[_0xb7c7('0x4a')](_0x3fd5da[_0xb7c7('0x41')],_0x2e54a7[_0xb7c7('0x42')]));if(_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x4b')]){_0x77dec0['where']=_[_0xb7c7('0x4c')](_0x77dec0['where'],{'$or':_[_0xb7c7('0x4d')](_0x1197c5,function(_0x13d8f6){if(_0x13d8f6[_0xb7c7('0x4e')][_0xb7c7('0x4f')]!==_0xb7c7('0x50')){var _0x59f293={};_0x59f293[_0x13d8f6['field']]={'$like':'%'+_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x4b')]+'%'};return _0x59f293;}})});}_0x77dec0=_[_0xb7c7('0x4c')]({},_0x77dec0,_0x3fd5da[_0xb7c7('0x51')]);var _0x1a471b={'where':_0x77dec0[_0xb7c7('0x49')]};return db[_0xb7c7('0x3f')][_0xb7c7('0x52')](_0x1a471b)['then'](function(_0x4fa034){_0x9d5763[_0xb7c7('0x52')]=_0x4fa034;if(_0x3fd5da[_0xb7c7('0x41')][_0xb7c7('0x53')]){_0x77dec0[_0xb7c7('0x54')]=[{'all':!![]}];}return db[_0xb7c7('0x3f')]['findAll'](_0x77dec0);})[_0xb7c7('0x23')](function(_0x472bbd){_0x9d5763[_0xb7c7('0x55')]=_0x472bbd;return _0x9d5763;})[_0xb7c7('0x23')](respondWithFilteredResult(_0x3719d4,_0x77dec0))[_0xb7c7('0x2d')](handleError(_0x3719d4,null));};exports['show']=function(_0x34984e,_0x134342){var _0x25f8a4={'raw':![],'where':{'id':_0x34984e['params']['id']},'include':[{'model':db[_0xb7c7('0x56')],'as':_0xb7c7('0x3e')}]},_0x52018c={};_0x52018c['model']=_[_0xb7c7('0x40')](db['SmsAccount']['rawAttributes']);_0x52018c[_0xb7c7('0x41')]=_[_0xb7c7('0x40')](_0x34984e[_0xb7c7('0x41')]);_0x52018c[_0xb7c7('0x42')]=_[_0xb7c7('0x57')](_0x52018c[_0xb7c7('0x43')],_0x52018c[_0xb7c7('0x41')]);_0x25f8a4[_0xb7c7('0x44')]=_[_0xb7c7('0x57')](_0x52018c[_0xb7c7('0x43')],qs[_0xb7c7('0x45')](_0x34984e['query'][_0xb7c7('0x45')]));_0x25f8a4[_0xb7c7('0x44')]=_0x25f8a4[_0xb7c7('0x44')][_0xb7c7('0x46')]?_0x25f8a4[_0xb7c7('0x44')]:_0x52018c['model'];if(_0x34984e[_0xb7c7('0x41')]['includeAll']){_0x25f8a4[_0xb7c7('0x54')]=[{'all':!![]}];}_0x25f8a4=_['merge']({},_0x25f8a4,_0x34984e[_0xb7c7('0x51')]);return db[_0xb7c7('0x3f')][_0xb7c7('0x58')](_0x25f8a4)['then'](handleEntityNotFound(_0x134342,null))[_0xb7c7('0x23')](respondWithResult(_0x134342,null))[_0xb7c7('0x2d')](handleError(_0x134342,null));};exports[_0xb7c7('0x59')]=function(_0x14f3ab,_0x51afa2){return db[_0xb7c7('0x3f')]['create'](_0x14f3ab['body'],{})['then'](function(_0x1114da){var _0x4d8129=_0x14f3ab[_0xb7c7('0x5a')]['get']({'plain':!![]});if(!_0x4d8129)throw new Error(_0xb7c7('0x5b'));if(_0x4d8129[_0xb7c7('0x5c')]==='user'){var _0x314875=_0x1114da[_0xb7c7('0x37')]({'plain':!![]});var _0xd61fa3=_0xb7c7('0x38');return db[_0xb7c7('0x5d')]['find']({'where':{'name':_0xd61fa3,'userProfileId':_0x4d8129['userProfileId']},'raw':!![]})[_0xb7c7('0x23')](function(_0x4ec761){if(_0x4ec761&&_0x4ec761['autoAssociation']===0x0){return db['UserProfileResource'][_0xb7c7('0x59')]({'name':_0x314875['name'],'resourceId':_0x314875['id'],'type':_0x4ec761['name'],'sectionId':_0x4ec761['id']},{})[_0xb7c7('0x23')](function(){return _0x1114da;});}else{return _0x1114da;}})[_0xb7c7('0x2d')](function(_0x15db97){logger[_0xb7c7('0x29')](_0xb7c7('0x5e'),_0x15db97);throw _0x15db97;});}return _0x1114da;})[_0xb7c7('0x23')](respondWithResult(_0x51afa2,0xc9))[_0xb7c7('0x2d')](handleError(_0x51afa2,null));};exports[_0xb7c7('0x5f')]=function(_0x4b245b,_0x3ff4c3){if(_0x4b245b[_0xb7c7('0x60')]['id']){delete _0x4b245b[_0xb7c7('0x60')]['id'];}return db[_0xb7c7('0x3f')][_0xb7c7('0x58')]({'where':{'id':_0x4b245b[_0xb7c7('0x61')]['id']},'include':[{'model':db[_0xb7c7('0x56')],'as':_0xb7c7('0x3e')}]})[_0xb7c7('0x23')](handleEntityNotFound(_0x3ff4c3,null))[_0xb7c7('0x23')](saveUpdates(_0x4b245b['body'],null))[_0xb7c7('0x23')](respondWithResult(_0x3ff4c3,null))['catch'](handleError(_0x3ff4c3,null));};exports[_0xb7c7('0x36')]=function(_0x5caa3c,_0xf7ff69){return db['SmsAccount']['find']({'where':{'id':_0x5caa3c['params']['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0xf7ff69,null))[_0xb7c7('0x23')](removeEntity(_0xf7ff69,null))['catch'](handleError(_0xf7ff69,null));};exports['describe']=function(_0x4778c1,_0x2a26f0){return db[_0xb7c7('0x3f')][_0xb7c7('0x62')]()[_0xb7c7('0x23')](respondWithResult(_0x2a26f0,null))[_0xb7c7('0x2d')](handleError(_0x2a26f0,null));};exports[_0xb7c7('0x63')]=function(_0x2ba4ad,_0x54e3c9,_0x47838d){if(_0x2ba4ad[_0xb7c7('0x60')]['id']){delete _0x2ba4ad[_0xb7c7('0x60')]['id'];}return db[_0xb7c7('0x3f')][_0xb7c7('0x58')]({'where':{'id':_0x2ba4ad[_0xb7c7('0x61')]['id']}})['then'](handleEntityNotFound(_0x54e3c9,null))['then'](function(_0x393422){if(_0x393422){_0x2ba4ad['body']['SmsAccountId']=_0x393422['id'];return db[_0xb7c7('0x64')]['create'](_0x2ba4ad[_0xb7c7('0x60')]);}})['then'](respondWithResult(_0x54e3c9,null))['catch'](handleError(_0x54e3c9,null));};exports[_0xb7c7('0x65')]=function(_0x1ddf38,_0x1f0a3e,_0x50dad1){var _0x18a966={'raw':![],'where':{}};var _0x3edb68={};var _0x31bec4={'count':0x0,'rows':[]};return db[_0xb7c7('0x3f')]['findOne']({'where':{'id':_0x1ddf38[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x1f0a3e,null))[_0xb7c7('0x23')](function(_0x17f7b5){if(_0x17f7b5){_0x3edb68['model']=_[_0xb7c7('0x40')](db[_0xb7c7('0x64')][_0xb7c7('0x66')]);_0x3edb68[_0xb7c7('0x41')]=_[_0xb7c7('0x40')](_0x1ddf38[_0xb7c7('0x41')]);_0x3edb68[_0xb7c7('0x42')]=_[_0xb7c7('0x57')](_0x3edb68[_0xb7c7('0x43')],_0x3edb68['query']);_0x18a966[_0xb7c7('0x44')]=_[_0xb7c7('0x57')](_0x3edb68[_0xb7c7('0x43')],qs[_0xb7c7('0x45')](_0x1ddf38[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x18a966[_0xb7c7('0x44')]=_0x18a966['attributes'][_0xb7c7('0x46')]?_0x18a966['attributes']:_0x3edb68['model'];if(!_0x1ddf38[_0xb7c7('0x41')][_0xb7c7('0x47')](_0xb7c7('0x67'))){_0x18a966[_0xb7c7('0x32')]=qs[_0xb7c7('0x32')](_0x1ddf38[_0xb7c7('0x41')][_0xb7c7('0x32')]);_0x18a966[_0xb7c7('0x31')]=qs['offset'](_0x1ddf38[_0xb7c7('0x41')][_0xb7c7('0x31')]);}_0x18a966[_0xb7c7('0x68')]=qs[_0xb7c7('0x48')](_0x1ddf38['query'][_0xb7c7('0x48')]);_0x18a966[_0xb7c7('0x49')]=qs[_0xb7c7('0x42')](_[_0xb7c7('0x4a')](_0x1ddf38[_0xb7c7('0x41')],_0x3edb68[_0xb7c7('0x42')]));_0x18a966['where']['SmsAccountId']=_0x17f7b5['id'];if(_0x1ddf38['query']['filter']){_0x18a966[_0xb7c7('0x49')]=_['merge'](_0x18a966[_0xb7c7('0x49')],{'$or':_[_0xb7c7('0x4d')](_0x18a966[_0xb7c7('0x44')],function(_0x30857c){var _0x5bd3fd={};_0x5bd3fd[_0x30857c]={'$like':'%'+_0x1ddf38[_0xb7c7('0x41')][_0xb7c7('0x4b')]+'%'};return _0x5bd3fd;})});}_0x18a966=_[_0xb7c7('0x4c')]({},_0x18a966,_0x1ddf38[_0xb7c7('0x51')]);return db[_0xb7c7('0x64')]['count']({'where':_0x18a966['where']})[_0xb7c7('0x23')](function(_0x42c744){_0x31bec4[_0xb7c7('0x52')]=_0x42c744;if(_0x1ddf38[_0xb7c7('0x41')]['includeAll']){_0x18a966['include']=[{'all':!![]}];}return db[_0xb7c7('0x64')]['findAll'](_0x18a966);})['then'](function(_0xc8df48){_0x31bec4[_0xb7c7('0x55')]=_0xc8df48;return _0x31bec4;});}})['then'](respondWithFilteredResult(_0x1f0a3e,_0x18a966))[_0xb7c7('0x2d')](handleError(_0x1f0a3e,null));};exports[_0xb7c7('0x69')]=function(_0x56e5eb,_0x2f7a74,_0xdc5ebe){return db[_0xb7c7('0x3f')][_0xb7c7('0x58')]({'where':{'id':_0x56e5eb[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x2f7a74,null))[_0xb7c7('0x23')](function(_0x368c71){if(_0x368c71){return _0x368c71[_0xb7c7('0x69')](_0x56e5eb[_0xb7c7('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x2f7a74,null))[_0xb7c7('0x2d')](handleError(_0x2f7a74,null));};exports['addAnswer']=function(_0x356c97,_0x16fb0b,_0x4bf45f){if(_0x356c97[_0xb7c7('0x60')]['id']){delete _0x356c97[_0xb7c7('0x60')]['id'];}return db[_0xb7c7('0x3f')][_0xb7c7('0x58')]({'where':{'id':_0x356c97[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x16fb0b,null))[_0xb7c7('0x23')](function(_0x5870ed){if(_0x5870ed){_0x356c97[_0xb7c7('0x60')][_0xb7c7('0x6a')]=_0x5870ed['id'];return db[_0xb7c7('0x6b')][_0xb7c7('0x59')](_0x356c97['body']);}})['then'](respondWithResult(_0x16fb0b,null))[_0xb7c7('0x2d')](handleError(_0x16fb0b,null));};exports['getAnswers']=function(_0x2150ec,_0x262b0e,_0x24de48){var _0x2d6abc={'raw':![],'where':{}};var _0xe3b3b8={};var _0x276046={'count':0x0,'rows':[]};return db[_0xb7c7('0x3f')][_0xb7c7('0x6c')]({'where':{'id':_0x2150ec[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x262b0e,null))[_0xb7c7('0x23')](function(_0xe8d4a2){if(_0xe8d4a2){_0xe3b3b8['model']=_['keys'](db[_0xb7c7('0x6b')][_0xb7c7('0x66')]);_0xe3b3b8[_0xb7c7('0x41')]=_[_0xb7c7('0x40')](_0x2150ec[_0xb7c7('0x41')]);_0xe3b3b8[_0xb7c7('0x42')]=_['intersection'](_0xe3b3b8[_0xb7c7('0x43')],_0xe3b3b8[_0xb7c7('0x41')]);_0x2d6abc[_0xb7c7('0x44')]=_[_0xb7c7('0x57')](_0xe3b3b8['model'],qs[_0xb7c7('0x45')](_0x2150ec[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x2d6abc[_0xb7c7('0x44')]=_0x2d6abc[_0xb7c7('0x44')]['length']?_0x2d6abc[_0xb7c7('0x44')]:_0xe3b3b8['model'];if(!_0x2150ec[_0xb7c7('0x41')][_0xb7c7('0x47')](_0xb7c7('0x67'))){_0x2d6abc[_0xb7c7('0x32')]=qs['limit'](_0x2150ec['query'][_0xb7c7('0x32')]);_0x2d6abc[_0xb7c7('0x31')]=qs[_0xb7c7('0x31')](_0x2150ec['query'][_0xb7c7('0x31')]);}_0x2d6abc[_0xb7c7('0x68')]=qs[_0xb7c7('0x48')](_0x2150ec['query'][_0xb7c7('0x48')]);_0x2d6abc[_0xb7c7('0x49')]=qs['filters'](_[_0xb7c7('0x4a')](_0x2150ec[_0xb7c7('0x41')],_0xe3b3b8['filters']));_0x2d6abc['where'][_0xb7c7('0x6a')]=_0xe8d4a2['id'];if(_0x2150ec[_0xb7c7('0x41')]['filter']){_0x2d6abc[_0xb7c7('0x49')]=_[_0xb7c7('0x4c')](_0x2d6abc[_0xb7c7('0x49')],{'$or':_[_0xb7c7('0x4d')](_0x2d6abc[_0xb7c7('0x44')],function(_0x59d39e){var _0x511fc2={};_0x511fc2[_0x59d39e]={'$like':'%'+_0x2150ec['query'][_0xb7c7('0x4b')]+'%'};return _0x511fc2;})});}_0x2d6abc=_[_0xb7c7('0x4c')]({},_0x2d6abc,_0x2150ec[_0xb7c7('0x51')]);return db[_0xb7c7('0x6b')][_0xb7c7('0x52')]({'where':_0x2d6abc[_0xb7c7('0x49')]})[_0xb7c7('0x23')](function(_0x450880){_0x276046[_0xb7c7('0x52')]=_0x450880;if(_0x2150ec[_0xb7c7('0x41')][_0xb7c7('0x53')]){_0x2d6abc[_0xb7c7('0x54')]=[{'all':!![]}];}return db[_0xb7c7('0x6b')][_0xb7c7('0x6d')](_0x2d6abc);})[_0xb7c7('0x23')](function(_0x50a451){_0x276046['rows']=_0x50a451;return _0x276046;});}})['then'](respondWithFilteredResult(_0x262b0e,_0x2d6abc))[_0xb7c7('0x2d')](handleError(_0x262b0e,null));};exports[_0xb7c7('0x6e')]=function(_0x29580c,_0x42ab0c,_0x3956be){return db[_0xb7c7('0x3f')]['find']({'where':{'id':_0x29580c[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x42ab0c,null))[_0xb7c7('0x23')](function(_0x3cadf1){if(_0x3cadf1){return _0x3cadf1[_0xb7c7('0x6e')](_0x29580c[_0xb7c7('0x41')]['ids']);}})[_0xb7c7('0x23')](respondWithStatusCode(_0x42ab0c,null))['catch'](handleError(_0x42ab0c,null));};exports[_0xb7c7('0x6f')]=function(_0x56a660,_0x316846,_0x562d34){var _0x15ab41={'channel':_0xb7c7('0x70')};var _0x2415b8=[];var _0x39d21b=[];var _0x3640e9={};return db['SmsAccount'][_0xb7c7('0x58')]({'where':{'id':_0x56a660[_0xb7c7('0x61')]['id']},'include':[{'model':db[_0xb7c7('0x71')],'as':_0xb7c7('0x72')}]})[_0xb7c7('0x23')](handleEntityNotFound(_0x316846,null))[_0xb7c7('0x23')](function(_0x159444){_0x15ab41[_0xb7c7('0x73')]=_0x159444;_0x15ab41['applications']=_[_0xb7c7('0x74')](_0x159444[_0xb7c7('0x72')],[_0xb7c7('0x75')],['asc']);if(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0x72')]){delete _0x15ab41[_0xb7c7('0x73')][_0xb7c7('0x72')];}return db['CmContact']['describe']();})[_0xb7c7('0x23')](function(_0x4c679f){if(!_0x4c679f){throw new db[(_0xb7c7('0x76'))][(_0xb7c7('0x77'))](_0xb7c7('0x78'));}_0x2415b8=_[_0xb7c7('0x79')](_[_0xb7c7('0x40')](_0x4c679f),[_0xb7c7('0x7a'),'updatedAt']);_0x39d21b=_[_0xb7c7('0x79')](_[_0xb7c7('0x40')](_0x4c679f),[_0xb7c7('0x7a'),_0xb7c7('0x7b'),'CompanyId',_0xb7c7('0x7c')]);_0x15ab41['body']={'mapKey':_0xb7c7('0x7d')};if(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0x4e')]){switch(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0x4e')]){case _0xb7c7('0x7e'):_0x15ab41[_0xb7c7('0x60')]['from']=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x7f')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660['body'][_0xb7c7('0x80')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x81')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x82')];break;case _0xb7c7('0x83'):_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]='+'+_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x85')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x86')];break;case'connectel':_0x15ab41['body'][_0xb7c7('0x84')]=_0x56a660[_0xb7c7('0x60')]['from'];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x2c')];break;case'clicksend':_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]=_0x56a660[_0xb7c7('0x60')]['from'];_0x15ab41[_0xb7c7('0x60')]['body']=_0x56a660[_0xb7c7('0x60')]['body'];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x81')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x87')];break;case _0xb7c7('0x88'):_0x15ab41[_0xb7c7('0x60')]['from']=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x7f')];_0x15ab41[_0xb7c7('0x60')]['body']=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x89')];_0x15ab41['body'][_0xb7c7('0x81')]=_0x56a660['body'][_0xb7c7('0x8a')];break;case _0xb7c7('0x8b'):_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]='+'+_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x8c')][0x0][_0xb7c7('0x84')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x8c')][0x0][_0xb7c7('0x86')];_0x15ab41[_0xb7c7('0x60')]['messageId']=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x8c')][0x0][_0xb7c7('0x81')];break;case _0xb7c7('0x8d'):_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x8e')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x8f')]['message'];break;case'clickatell':_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x90')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]=_0x56a660['body']['text'];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x81')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x91')];break;case _0xb7c7('0x92'):_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')]=_0x56a660[_0xb7c7('0x60')]['from'];_0x15ab41['body'][_0xb7c7('0x60')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x2c')];_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x81')]=_0x56a660[_0xb7c7('0x60')][_0xb7c7('0x93')];break;}}if(_0x15ab41[_0xb7c7('0x60')]['id']){delete _0x15ab41[_0xb7c7('0x60')]['id'];}if(_[_0xb7c7('0x94')](_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')])){throw new db[(_0xb7c7('0x76'))][(_0xb7c7('0x77'))](_0xb7c7('0x95'));}if(_[_0xb7c7('0x94')](_0x15ab41[_0xb7c7('0x60')]['body'])||_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')]===''){throw new db['Sequelize'][(_0xb7c7('0x77'))](_0xb7c7('0x96'));}if(_[_0xb7c7('0x94')](_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x97')])){throw new db[(_0xb7c7('0x76'))][(_0xb7c7('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39d21b);}if(!_[_0xb7c7('0x98')](_0x39d21b,_0x15ab41['body'][_0xb7c7('0x97')])){throw new db['Sequelize'][(_0xb7c7('0x77'))](_0xb7c7('0x99')+_0x39d21b);}_0x3640e9[_0x15ab41[_0xb7c7('0x60')]['mapKey']]=_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')];return db[_0xb7c7('0x9a')][_0xb7c7('0x58')]({'where':{'id':_0x15ab41['account'][_0xb7c7('0x7c')]},'include':[{'model':db[_0xb7c7('0x9b')],'as':_0xb7c7('0x9c'),'where':_0x3640e9,'limit':0x1,'order':[[_0xb7c7('0x7b'),_0xb7c7('0x9d')]]}]});})[_0xb7c7('0x23')](handleEntityNotFound(_0x316846,null))['then'](function(_0x512da1){if(_0x512da1){_0x15ab41['list']=_[_0xb7c7('0x9e')](_0x512da1,['Contacts']);if(_0x512da1[_0xb7c7('0x9c')][_0xb7c7('0x46')]){return _0x512da1[_0xb7c7('0x9c')][0x0];}var _0x504ff3=_['defaults'](_0x15ab41[_0xb7c7('0x60')],{'firstName':_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x84')],'ListId':_0x512da1['id']});_0x504ff3[_0x15ab41['body']['mapKey']]=_0x15ab41[_0xb7c7('0x60')]['from'];return db['CmContact']['create'](_0x504ff3,{'fields':_0x2415b8,'raw':!![]});}})[_0xb7c7('0x23')](handleEntityNotFound(_0x316846,null))['then'](function(_0x4c2fa2){if(_0x4c2fa2){_0x15ab41[_0xb7c7('0x9f')]=_0x4c2fa2;var _0x1e856c={'ContactId':_0x4c2fa2['id'],'phone':_0x15ab41['body']['from'],'SmsAccountId':_0x56a660['params']['id']};var _0x4417dd={'ContactId':_0x4c2fa2['id'],'SmsAccountId':_0x56a660[_0xb7c7('0x61')]['id'],'closed':![]};return db[_0xb7c7('0xa0')][_0xb7c7('0x58')]({'where':_0x4417dd})[_0xb7c7('0x23')](function(_0x25e581){if(_0x25e581){return[_0x25e581,![]];}return db[_0xb7c7('0xa0')][_0xb7c7('0x59')](_0x1e856c)[_0xb7c7('0x23')](function(_0x5e97b5){return[_0x5e97b5,!![]];});});}})['spread'](function(_0x4c7857,_0x598771){_0x15ab41[_0xb7c7('0xa1')]=_0x4c7857[_0xb7c7('0x37')]({'plain':!![]});_0x15ab41[_0xb7c7('0xa1')][_0xb7c7('0xa2')]=![];if(_0x598771){if(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0xa3')]){_0x15ab41[_0xb7c7('0xa4')][_0xb7c7('0xa5')]({'id':0x0,'priority':_0x15ab41[_0xb7c7('0xa4')][_0xb7c7('0x46')]+0x1,'app':_0xb7c7('0xa6'),'appdata':_0xb7c7('0xa7'),'interval':_0xb7c7('0xa8')});}_0x15ab41[_0xb7c7('0xa1')]['created']=!![];}return db[_0xb7c7('0xa9')][_0xb7c7('0x59')]({'phone':_0x15ab41[_0xb7c7('0x60')]['from'],'messageId':_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x81')],'body':_0x15ab41[_0xb7c7('0x60')][_0xb7c7('0x60')],'SmsAccountId':_0x56a660[_0xb7c7('0x61')]['id'],'SmsInteractionId':_0x4c7857['id'],'direction':'in','ContactId':_0x4c7857['ContactId'],'AttachmentId':_0x15ab41['body'][_0xb7c7('0xaa')]});})['then'](function(_0x3bdd83){_0x15ab41[_0xb7c7('0x2c')]=_0x3bdd83;if(_0x15ab41[_0xb7c7('0xa1')][_0xb7c7('0xab')]){return db[_0xb7c7('0xac')][_0xb7c7('0x58')]({'attributes':['id','name'],'where':{'id':_0x15ab41[_0xb7c7('0xa1')][_0xb7c7('0xab')]}})['then'](function(_0x53cf2d){if(_0x53cf2d){_0x15ab41[_0xb7c7('0xa4')][_0xb7c7('0xad')]({'id':0x0,'priority':0x0,'app':_0xb7c7('0xae'),'appdata':_0x53cf2d[_0xb7c7('0x3b')]+','+(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0xaf')]||0xa),'interval':_0xb7c7('0xa8')});}return respondWithRpcPromise(_0xb7c7('0xb0'),_0xb7c7('0xb1'),_0x15ab41);});}return respondWithRpcPromise(_0xb7c7('0xb0'),_0xb7c7('0xb1'),_0x15ab41);})[_0xb7c7('0x23')](function(_0x42ac4e){if(_0x42ac4e){var _0x170329=0xc8;var _0x59fa7a=_0xb7c7('0xb2');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x59fa7a,_0x170329,_0xb7c7('0xb3'));logger[_0xb7c7('0x26')](_0xb7c7('0xb4'),_0x59fa7a,_0x170329,_0xb7c7('0xb3'),JSON[_0xb7c7('0x28')](_0x42ac4e));if(_0x15ab41[_0xb7c7('0x73')][_0xb7c7('0x4e')]===_0xb7c7('0x7e')){return _0x316846[_0xb7c7('0x2f')](_0x170329)[_0xb7c7('0x33')](_0xb7c7('0xb5'),'text/xml')[_0xb7c7('0x3c')](_0xb7c7('0xb6'));}else{return _0x316846[_0xb7c7('0x2f')](_0x170329)[_0xb7c7('0x30')](_0x42ac4e);}}})[_0xb7c7('0x2d')](handleError(_0x316846,null));};exports[_0xb7c7('0xb7')]=function(_0x121b97,_0x5c789b,_0xe70e1f){return db[_0xb7c7('0x3f')][_0xb7c7('0x6c')]({'where':{'id':_0x121b97[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x5c789b,null))[_0xb7c7('0x23')](function(_0x32cf7){if(_0x32cf7){return db[_0xb7c7('0xb8')][_0xb7c7('0xb9')](function(_0x4bc029){return db[_0xb7c7('0x71')][_0xb7c7('0x36')]({'where':{'SmsAccountId':_0x121b97[_0xb7c7('0x61')]['id']},'transaction':_0x4bc029})['then'](function(_0x1676a4){var _0x5ce2df=_[_0xb7c7('0x4d')](_0x121b97[_0xb7c7('0x60')],function(_0x4a0062){_0x4a0062['SmsAccountId']=_0x121b97[_0xb7c7('0x61')]['id'];return _0x4a0062;});return db[_0xb7c7('0x71')][_0xb7c7('0xba')](_0x5ce2df,{'transaction':_0x4bc029});});})['then'](function(){return db[_0xb7c7('0x71')]['findAndCountAll']({'where':{'SmsAccountId':_0x121b97['params']['id']},'order':_0xb7c7('0x75')});});}})[_0xb7c7('0x23')](respondWithResult(_0x5c789b,null))[_0xb7c7('0x2d')](handleError(_0x5c789b,null));};exports[_0xb7c7('0xbb')]=function(_0x3b85d5,_0x454f5b,_0x14d894){var _0x332b6f={};var _0x4b9b8c={};var _0x51e6c3;var _0x34f1a4;return db[_0xb7c7('0x3f')][_0xb7c7('0x6c')]({'where':{'id':_0x3b85d5[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x454f5b,null))['then'](function(_0x5223a5){if(_0x5223a5){_0x51e6c3=_0x5223a5;_0x4b9b8c[_0xb7c7('0x43')]=_[_0xb7c7('0x40')](db[_0xb7c7('0x71')]['rawAttributes']);_0x4b9b8c[_0xb7c7('0x41')]=_[_0xb7c7('0x40')](_0x3b85d5['query']);_0x4b9b8c['filters']=_['intersection'](_0x4b9b8c[_0xb7c7('0x43')],_0x4b9b8c[_0xb7c7('0x41')]);_0x332b6f[_0xb7c7('0x44')]=_['intersection'](_0x4b9b8c[_0xb7c7('0x43')],qs[_0xb7c7('0x45')](_0x3b85d5[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x332b6f[_0xb7c7('0x44')]=_0x332b6f[_0xb7c7('0x44')][_0xb7c7('0x46')]?_0x332b6f['attributes']:_0x4b9b8c[_0xb7c7('0x43')];_0x332b6f[_0xb7c7('0x68')]=qs[_0xb7c7('0x48')](_0x3b85d5[_0xb7c7('0x41')][_0xb7c7('0x48')]);_0x332b6f[_0xb7c7('0x49')]=qs[_0xb7c7('0x42')](_[_0xb7c7('0x4a')](_0x3b85d5[_0xb7c7('0x41')],_0x4b9b8c['filters']));if(_0x3b85d5[_0xb7c7('0x41')]['filter']){_0x332b6f[_0xb7c7('0x49')]=_['merge'](_0x332b6f[_0xb7c7('0x49')],{'$or':_[_0xb7c7('0x4d')](_0x332b6f['attributes'],function(_0x36743f){var _0xe1fbfd={};_0xe1fbfd[_0x36743f]={'$like':'%'+_0x3b85d5[_0xb7c7('0x41')][_0xb7c7('0x4b')]+'%'};return _0xe1fbfd;})});}_0x332b6f=_['merge']({},_0x332b6f,_0x3b85d5['options']);return _0x51e6c3[_0xb7c7('0xbb')](_0x332b6f);}})[_0xb7c7('0x23')](function(_0x21e068){if(_0x21e068){_0x34f1a4=_0x21e068[_0xb7c7('0x46')];if(!_0x3b85d5[_0xb7c7('0x41')]['hasOwnProperty'](_0xb7c7('0x67'))){_0x332b6f[_0xb7c7('0x32')]=qs[_0xb7c7('0x32')](_0x3b85d5['query'][_0xb7c7('0x32')]);_0x332b6f[_0xb7c7('0x31')]=qs[_0xb7c7('0x31')](_0x3b85d5[_0xb7c7('0x41')][_0xb7c7('0x31')]);}return _0x51e6c3['getApplications'](_0x332b6f);}})[_0xb7c7('0x23')](function(_0x2d33ba){if(_0x2d33ba){return _0x2d33ba?{'count':_0x34f1a4,'rows':_0x2d33ba}:null;}})[_0xb7c7('0x23')](respondWithResult(_0x454f5b,null))['catch'](handleError(_0x454f5b,null));};exports[_0xb7c7('0xbc')]=function(_0x292d3b,_0x280ac5,_0x48abd2){var _0x1d4428={'raw':![],'where':{}};var _0x2f2f87={};var _0x204369={'count':0x0,'rows':[]};return db[_0xb7c7('0x3f')][_0xb7c7('0x6c')]({'where':{'id':_0x292d3b[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x280ac5,null))[_0xb7c7('0x23')](function(_0x182490){if(_0x182490){_0x2f2f87[_0xb7c7('0x43')]=_[_0xb7c7('0x40')](db[_0xb7c7('0xa0')][_0xb7c7('0x66')]);_0x2f2f87[_0xb7c7('0x41')]=_[_0xb7c7('0x40')](_0x292d3b[_0xb7c7('0x41')]);_0x2f2f87[_0xb7c7('0x42')]=_[_0xb7c7('0x57')](_0x2f2f87[_0xb7c7('0x43')],_0x2f2f87['query']);_0x1d4428[_0xb7c7('0x44')]=_[_0xb7c7('0x57')](_0x2f2f87[_0xb7c7('0x43')],qs[_0xb7c7('0x45')](_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x1d4428[_0xb7c7('0x44')]=_0x1d4428[_0xb7c7('0x44')][_0xb7c7('0x46')]?_0x1d4428[_0xb7c7('0x44')]:_0x2f2f87[_0xb7c7('0x43')];if(!_0x292d3b['query'][_0xb7c7('0x47')]('nolimit')){_0x1d4428['limit']=qs[_0xb7c7('0x32')](_0x292d3b['query'][_0xb7c7('0x32')]);_0x1d4428[_0xb7c7('0x31')]=qs[_0xb7c7('0x31')](_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0x31')]);}_0x1d4428['order']=qs[_0xb7c7('0x48')](_0x292d3b['query'][_0xb7c7('0x48')]);_0x1d4428['where']=qs['filters'](_[_0xb7c7('0x4a')](_0x292d3b[_0xb7c7('0x41')],_0x2f2f87[_0xb7c7('0x42')]));_0x1d4428[_0xb7c7('0x49')][_0xb7c7('0x6a')]=_0x182490['id'];if(_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0x4b')]){_0x1d4428[_0xb7c7('0x49')]=_[_0xb7c7('0x4c')](_0x1d4428[_0xb7c7('0x49')],{'$or':_[_0xb7c7('0x4d')](_0x1d4428[_0xb7c7('0x44')],function(_0x2c141f){var _0x48e78a={};_0x48e78a[_0x2c141f]={'$like':'%'+_0x292d3b['query']['filter']+'%'};return _0x48e78a;})});}_0x1d4428=_['merge']({},_0x1d4428,_0x292d3b[_0xb7c7('0x51')]);return db['SmsInteraction']['count']({'where':_0x1d4428[_0xb7c7('0x49')]})[_0xb7c7('0x23')](function(_0x42282f){_0x204369[_0xb7c7('0x52')]=_0x42282f;if(_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0x53')]){_0x1d4428[_0xb7c7('0x54')]=[{'model':db[_0xb7c7('0x9b')],'as':_0xb7c7('0xbd'),'required':![]},{'model':db[_0xb7c7('0xac')],'as':_0xb7c7('0xbe'),'attributes':[_0xb7c7('0x3b'),'fullname',_0xb7c7('0xbf')],'required':![]},{'model':db[_0xb7c7('0xc0')],'as':_0xb7c7('0xc1'),'attributes':['id',_0xb7c7('0x3b'),_0xb7c7('0xc2')],'where':_0x292d3b['query'][_0xb7c7('0xc3')]?{'id':_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0xc3')]}:undefined,'required':_0x292d3b[_0xb7c7('0x41')][_0xb7c7('0xc3')]?!![]:![]}];}return db[_0xb7c7('0xa0')][_0xb7c7('0x6d')](_0x1d4428);})[_0xb7c7('0x23')](function(_0x259a6c){_0x204369[_0xb7c7('0x55')]=_0x259a6c;return _0x204369;});}})['then'](respondWithFilteredResult(_0x280ac5,_0x1d4428))['catch'](handleError(_0x280ac5,null));};exports['send']=function(_0x432730,_0x4bc228,_0x3f5f9c){var _0x492d8a,_0x2ca42a,_0x17604b;if(_[_0xb7c7('0x94')](_0x432730[_0xb7c7('0x60')][_0xb7c7('0x60')])||_0x432730['body']['body']===''){throw new db[(_0xb7c7('0x76'))][(_0xb7c7('0x77'))](_0xb7c7('0x96'));}if(_[_0xb7c7('0x94')](_0x432730['body']['to'])){throw new db[(_0xb7c7('0x76'))][(_0xb7c7('0x77'))]('to\x20is\x20mandatory');}_0x492d8a=_0x432730[_0xb7c7('0x60')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x432730[_0xb7c7('0x61')]['id']},'include':[{'model':db[_0xb7c7('0x9a')],'as':'List','include':[{'model':db[_0xb7c7('0x9b')],'as':_0xb7c7('0x9c'),'where':{'mobile':_0x492d8a},'limit':0x1,'order':[[_0xb7c7('0x7b'),_0xb7c7('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x4bc228,null))[_0xb7c7('0x23')](function(_0x1ec641){if(_0x1ec641&&_0x1ec641[_0xb7c7('0xc4')]){_0x2ca42a=_0x1ec641[_0xb7c7('0x37')]({'plain':!![]});if(_0x2ca42a[_0xb7c7('0xc4')]&&_0x2ca42a[_0xb7c7('0xc4')][_0xb7c7('0x9c')][_0xb7c7('0x46')]){return _0x2ca42a[_0xb7c7('0xc4')][_0xb7c7('0x9c')][0x0];}return db['CmContact'][_0xb7c7('0x59')](_[_0xb7c7('0x19')](_0x432730[_0xb7c7('0x60')],{'firstName':_0x492d8a,'mobile':_0x492d8a,'phone':_0x492d8a,'ListId':_0x2ca42a[_0xb7c7('0x7c')]}));}})[_0xb7c7('0x23')](handleEntityNotFound(_0x4bc228,null))[_0xb7c7('0x23')](function(_0x111756){if(_0x111756){_0x17604b=_0x111756;return db[_0xb7c7('0xa0')][_0xb7c7('0x58')]({'where':{'ContactId':_0x17604b['id'],'closed':![],'SmsAccountId':_0x2ca42a['id']}})[_0xb7c7('0x23')](function(_0x2c2a36){if(_0x2c2a36){return[_0x2c2a36,![]];}return db['SmsInteraction']['create']({'UserId':_0x432730[_0xb7c7('0x5a')]['id'],'ContactId':_0x17604b['id'],'SmsAccountId':_0x2ca42a['id'],'phone':_0x492d8a,'firstMsgDirection':_0xb7c7('0xc5'),'Messages':[_[_0xb7c7('0x4c')](_0x432730['body'],{'read':![],'body':_0x432730[_0xb7c7('0x60')][_0xb7c7('0x60')],'phone':_0x492d8a,'SmsAccountId':_0x2ca42a['id'],'UserId':_0x432730[_0xb7c7('0x5a')]['id'],'ContactId':_0x17604b['id']})]},{'include':[{'model':db[_0xb7c7('0xa9')],'as':'Messages'}]})['then'](function(_0x5259e2){return[_0x5259e2,!![]];});});}})['spread'](function(_0xed3b88,_0xa87293){if(_0xa87293){return _0xed3b88;}return db['SmsMessage'][_0xb7c7('0x59')](_[_0xb7c7('0x4c')](_0x432730[_0xb7c7('0x60')],{'read':![],'body':_0x432730[_0xb7c7('0x60')]['body'],'phone':_0x492d8a,'SmsAccountId':_0x2ca42a['id'],'SmsInteractionId':_0xed3b88['id'],'UserId':_0x432730[_0xb7c7('0x5a')]['id'],'ContactId':_0x17604b['id']}))[_0xb7c7('0x23')](function(_0x42e138){_0xed3b88[_0xb7c7('0xc6')][_0xb7c7('0xc7')]=[];_0xed3b88[_0xb7c7('0xc6')][_0xb7c7('0xc7')][_0xb7c7('0xa5')](_0x42e138['dataValues']);return _0xed3b88;});})[_0xb7c7('0x23')](respondWithResult(_0x4bc228,null))[_0xb7c7('0x2d')](handleError(_0x4bc228,null));};exports[_0xb7c7('0x2f')]=function(_0x2c1773,_0x441807,_0x4e9af0){if(_0x2c1773[_0xb7c7('0x60')]['id']){delete _0x2c1773[_0xb7c7('0x60')]['id'];}console['log']('endpoint\x20/status\x20POST\x20/',_0x2c1773[_0xb7c7('0x60')]);var _0x56313c,_0x511e10,_0x5050e4;return db['SmsAccount'][_0xb7c7('0x58')]({'where':{'id':_0x2c1773[_0xb7c7('0x61')]['id']}})['then'](handleEntityNotFound(_0x441807,null))[_0xb7c7('0x23')](function(_0x494a24){if(_0x494a24){_0x5050e4=_0x494a24;logger[_0xb7c7('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb7c7('0x2f'),_0xb7c7('0xc8'),_0x494a24['type'],util[_0xb7c7('0xc9')](_0x2c1773['body'],{'showHidden':![],'depth':null}));switch(_0x494a24[_0xb7c7('0x4e')]){case _0xb7c7('0x83'):if(_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xca')]&&_0x2c1773['body'][_0xb7c7('0x2f')]){_0x511e10=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x2f')];return db['SmsMessage'][_0xb7c7('0x58')]({'where':{'messageId':_0x2c1773['body'][_0xb7c7('0xca')]}});}break;case _0xb7c7('0xcb'):if(_0x2c1773[_0xb7c7('0x60')]['requestid']&&_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xcc')]){_0x511e10=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xcc')];return db[_0xb7c7('0xa9')]['find']({'where':{'messageId':_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xcd')]}});}break;case _0xb7c7('0xce'):if(_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x87')]&&_0x2c1773[_0xb7c7('0x60')]['status_code']){_0x511e10=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xcf')];return db['SmsMessage'][_0xb7c7('0x58')]({'where':{'messageId':_0x2c1773['body'][_0xb7c7('0x87')]}});}break;case _0xb7c7('0x8b'):var _0x37315e=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x8c')][0x0];if(_0x37315e['messageId']&&_0x37315e['status']['groupName']==='DELIVERED'){_0x511e10=_0x37315e[_0xb7c7('0x2f')][_0xb7c7('0xd0')];return db[_0xb7c7('0xa9')][_0xb7c7('0x58')]({'where':{'messageId':_0x37315e['messageId']}});}break;case _0xb7c7('0xd1'):if(_0x2c1773[_0xb7c7('0x60')]['messageId']&&_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x2f')]){_0x511e10=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x2f')];return db[_0xb7c7('0xa9')][_0xb7c7('0x58')]({'where':{'messageId':_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x81')]}});}break;case _0xb7c7('0x92'):if(_0x2c1773['body'][_0xb7c7('0xd2')]&&_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x2f')]){_0x511e10=_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0x2f')];return db[_0xb7c7('0xa9')][_0xb7c7('0x58')]({'where':{'messageId':_0x2c1773[_0xb7c7('0x60')][_0xb7c7('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x441807,null))[_0xb7c7('0x23')](function(_0x1331b2){if(_0x1331b2){_0x56313c=_0x1331b2;switch(_0x5050e4['type']){case'skebby':if(_0x511e10===_0xb7c7('0xd3')){return _0x56313c[_0xb7c7('0x5f')]({'read':!![]});}else{logger[_0xb7c7('0x29')](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0x83'),util['inspect'](_0x2c1773['body'],{'showHidden':![],'depth':null}));}break;case _0xb7c7('0xcb'):if(_0x511e10==='1'){return _0x56313c[_0xb7c7('0x5f')]({'read':!![]});}else{logger['error'](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0x83'),util[_0xb7c7('0xc9')](_0x2c1773[_0xb7c7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xb7c7('0xce'):if(!_0x2c1773[_0xb7c7('0x60')]['error_code']&&_0x511e10>=0xc8&&_0x511e10<=0xce){return _0x56313c['update']({'read':!![]});}else{logger[_0xb7c7('0x29')](_0xb7c7('0x27'),_0xb7c7('0x2f'),'clicksend',util['inspect'](_0x2c1773['body'],{'showHidden':![],'depth':null}));}break;case _0xb7c7('0x8b'):var _0x676802=_0x2c1773[_0xb7c7('0x60')]['results'][0x0];if(_0x676802['status'][_0xb7c7('0xd0')]===_0xb7c7('0xd3')){return _0x56313c[_0xb7c7('0x5f')]({'read':!![]});}else{logger['error'](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0x8b'),util[_0xb7c7('0xc9')](_0x2c1773['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x511e10==_0xb7c7('0xd4')||_0x511e10==_0xb7c7('0xd5')){return _0x56313c[_0xb7c7('0x5f')]({'read':!![]});}else{logger[_0xb7c7('0x29')](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0xd1'),util['inspect'](_0x2c1773[_0xb7c7('0x60')],{'showHidden':![],'depth':null}));}break;case _0xb7c7('0x92'):if(_0x511e10===_0xb7c7('0xd6')||_0x511e10===_0xb7c7('0xd7')){return _0x56313c[_0xb7c7('0x5f')]({'read':!![]});}else{logger[_0xb7c7('0x29')](_0xb7c7('0x27'),'status','intelepeer',util[_0xb7c7('0xc9')](_0x2c1773[_0xb7c7('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x56313c;}})[_0xb7c7('0x23')](respondWithResult(_0x441807,null))[_0xb7c7('0x2d')](handleError(_0x441807,null));};exports['statusGet']=function(_0x2e4cf2,_0x47da9a,_0x41838c){var _0x341e7b,_0x470961,_0x21312a;return db[_0xb7c7('0x3f')]['find']({'where':{'id':_0x2e4cf2[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x47da9a,null))[_0xb7c7('0x23')](function(_0x386b9c){if(_0x386b9c){_0x21312a=_0x386b9c;logger[_0xb7c7('0x26')](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0xc8'),_0x386b9c[_0xb7c7('0x4e')],util[_0xb7c7('0xc9')](_0x2e4cf2['query'],{'showHidden':![],'depth':null}));switch(_0x386b9c[_0xb7c7('0x4e')]){case _0xb7c7('0x8d'):if(_0x2e4cf2[_0xb7c7('0x41')]['message-id']&&_0x2e4cf2[_0xb7c7('0x41')]['state']){_0x470961=_0x2e4cf2[_0xb7c7('0x41')][_0xb7c7('0xd8')];return db[_0xb7c7('0xa9')][_0xb7c7('0x58')]({'where':{'messageId':_0x2e4cf2[_0xb7c7('0x41')]['message-id']}});}break;}}})[_0xb7c7('0x23')](handleEntityNotFound(_0x47da9a,null))[_0xb7c7('0x23')](function(_0x1f63e1){if(_0x1f63e1){_0x341e7b=_0x1f63e1;switch(_0x21312a[_0xb7c7('0x4e')]){case _0xb7c7('0x8d'):if(_0x470961==='2'||_0x470961==='6'){return _0x341e7b[_0xb7c7('0x5f')]({'read':!![]});}else{logger['error'](_0xb7c7('0x27'),_0xb7c7('0x2f'),_0xb7c7('0x8d'),util[_0xb7c7('0xc9')](_0x2e4cf2['query'],{'showHidden':![],'depth':null}));};break;}return _0x341e7b;}})[_0xb7c7('0x23')](respondWithResult(_0x47da9a,null))[_0xb7c7('0x2d')](handleError(_0x47da9a,null));};exports[_0xb7c7('0xd9')]=function(_0x5d6ef5,_0x151564,_0x2e7fb7){return db['SmsAccount'][_0xb7c7('0x58')]({'where':{'id':_0x5d6ef5[_0xb7c7('0x61')]['id']}})[_0xb7c7('0x23')](handleEntityNotFound(_0x151564,null))[_0xb7c7('0x23')](function(_0x33049f){if(_0x33049f){return _0x33049f[_0xb7c7('0xd9')](_0x5d6ef5[_0xb7c7('0x60')]['ids'],_[_0xb7c7('0x9e')](_0x5d6ef5[_0xb7c7('0x60')],[_0xb7c7('0xda'),'id'])||{})[_0xb7c7('0xdb')](function(_0x37165f){for(var _0x3e67e7=0x0;_0x3e67e7<_0x5d6ef5[_0xb7c7('0x60')]['ids'][_0xb7c7('0x46')];_0x3e67e7+=0x1){socket[_0xb7c7('0xdc')]('userSmsAccount:save',{'UserId':_0x5d6ef5['body'][_0xb7c7('0xda')][_0x3e67e7],'SmsAccountId':_0x5d6ef5[_0xb7c7('0x61')]['id']});}return _0x37165f;});}})['then'](respondWithResult(_0x151564,null))[_0xb7c7('0x2d')](handleError(_0x151564,null));};exports[_0xb7c7('0xdd')]=function(_0x533445,_0x1472dd,_0x44b7c2){return db[_0xb7c7('0x3f')][_0xb7c7('0x58')]({'where':{'id':_0x533445[_0xb7c7('0x61')]['id']}})['then'](handleEntityNotFound(_0x1472dd,null))[_0xb7c7('0x23')](function(_0x1f11f2){if(_0x1f11f2){return _0x1f11f2['removeAgents'](_0x533445['query']['ids'])['then'](function(){if(_[_0xb7c7('0xde')](_0x533445[_0xb7c7('0x41')][_0xb7c7('0xda')])){for(var _0x222e54=0x0;_0x222e54<_0x533445[_0xb7c7('0x41')][_0xb7c7('0xda')][_0xb7c7('0x46')];_0x222e54+=0x1){socket[_0xb7c7('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x533445[_0xb7c7('0x41')]['ids'][_0x222e54]),'SmsAccountId':Number(_0x533445[_0xb7c7('0x61')]['id'])});}}else{socket['emit'](_0xb7c7('0xdf'),{'UserId':Number(_0x533445[_0xb7c7('0x41')]['ids']),'SmsAccountId':Number(_0x533445[_0xb7c7('0x61')]['id'])});}});}})[_0xb7c7('0x23')](respondWithStatusCode(_0x1472dd,null))[_0xb7c7('0x2d')](handleError(_0x1472dd,null));};exports[_0xb7c7('0xe0')]=function(_0x30c208,_0x417786,_0x5844d7){var _0x3c3116={};var _0x24f6cb={};var _0x2ac80c;var _0x1065b1;return db[_0xb7c7('0x3f')][_0xb7c7('0x6c')]({'where':{'id':_0x30c208[_0xb7c7('0x61')]['id']}})['then'](handleEntityNotFound(_0x417786,null))[_0xb7c7('0x23')](function(_0x2f28ea){if(_0x2f28ea){_0x2ac80c=_0x2f28ea;_0x24f6cb['model']=_[_0xb7c7('0x40')](db[_0xb7c7('0xac')][_0xb7c7('0x66')]);_0x24f6cb['query']=_[_0xb7c7('0x40')](_0x30c208[_0xb7c7('0x41')]);_0x24f6cb['filters']=_[_0xb7c7('0x57')](_0x24f6cb[_0xb7c7('0x43')],_0x24f6cb[_0xb7c7('0x41')]);_0x3c3116[_0xb7c7('0x44')]=_[_0xb7c7('0x57')](_0x24f6cb[_0xb7c7('0x43')],qs['fields'](_0x30c208[_0xb7c7('0x41')][_0xb7c7('0x45')]));_0x3c3116[_0xb7c7('0x44')]=_0x3c3116[_0xb7c7('0x44')][_0xb7c7('0x46')]?_0x3c3116[_0xb7c7('0x44')]:_0x24f6cb['model'];_0x3c3116[_0xb7c7('0x68')]=qs['sort'](_0x30c208['query'][_0xb7c7('0x48')]);_0x3c3116[_0xb7c7('0x49')]=qs['filters'](_[_0xb7c7('0x4a')](_0x30c208['query'],_0x24f6cb[_0xb7c7('0x42')]));if(_0x30c208[_0xb7c7('0x41')][_0xb7c7('0x4b')]){_0x3c3116[_0xb7c7('0x49')]=_[_0xb7c7('0x4c')](_0x3c3116[_0xb7c7('0x49')],{'$or':_['map'](_0x3c3116[_0xb7c7('0x44')],function(_0x1856b5){var _0x49cb28={};_0x49cb28[_0x1856b5]={'$like':'%'+_0x30c208['query']['filter']+'%'};return _0x49cb28;})});}_0x3c3116=_[_0xb7c7('0x4c')]({},_0x3c3116,_0x30c208[_0xb7c7('0x51')]);return _0x2ac80c['getAgents'](_0x3c3116);}})[_0xb7c7('0x23')](function(_0x4e195a){if(_0x4e195a){_0x1065b1=_0x4e195a[_0xb7c7('0x46')];if(!_0x30c208[_0xb7c7('0x41')]['hasOwnProperty'](_0xb7c7('0x67'))){_0x3c3116[_0xb7c7('0x32')]=qs['limit'](_0x30c208['query'][_0xb7c7('0x32')]);_0x3c3116[_0xb7c7('0x31')]=qs['offset'](_0x30c208[_0xb7c7('0x41')][_0xb7c7('0x31')]);}return _0x2ac80c[_0xb7c7('0xe0')](_0x3c3116);}})[_0xb7c7('0x23')](function(_0x4abc9c){if(_0x4abc9c){return _0x4abc9c?{'count':_0x1065b1,'rows':_0x4abc9c}:null;}})[_0xb7c7('0x23')](respondWithResult(_0x417786,null))[_0xb7c7('0x2d')](handleError(_0x417786,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 8843e76..cd0e589 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 _0x44e8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x275fa3,_0x47511f){var _0x30ec99=function(_0x179d4e){while(--_0x179d4e){_0x275fa3['push'](_0x275fa3['shift']());}};_0x30ec99(++_0x47511f);}(_0x44e8,0xd7));var _0x844e=function(_0x1fee50,_0x526624){_0x1fee50=_0x1fee50-0x0;var _0x5bb3e4=_0x44e8[_0x1fee50];return _0x5bb3e4;};'use strict';var EventEmitter=require(_0x844e('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x844e('0x1')](0x0);var events={'afterCreate':_0x844e('0x2'),'afterUpdate':_0x844e('0x3'),'afterDestroy':_0x844e('0x4')};function emitEvent(_0x49ce1b){return function(_0x3a8b3c,_0x167368,_0x2c8b9e){SmsAccountEvents[_0x844e('0x5')](_0x49ce1b+':'+_0x3a8b3c['id'],_0x3a8b3c);SmsAccountEvents['emit'](_0x49ce1b,_0x3a8b3c);_0x2c8b9e(null);};}for(var e in events){if(events[_0x844e('0x6')](e)){var event=events[e];SmsAccount[_0x844e('0x7')](e,emitEvent(event));}}module[_0x844e('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x4a9c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x2be769,_0x5299b4){var _0x204f52=function(_0x24ff6b){while(--_0x24ff6b){_0x2be769['push'](_0x2be769['shift']());}};_0x204f52(++_0x5299b4);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x2e9a1f,_0x20dff2){_0x2e9a1f=_0x2e9a1f-0x0;var _0x4b86fe=_0x4a9c[_0x2e9a1f];return _0x4b86fe;};'use strict';var EventEmitter=require(_0xc4a9('0x0'));var SmsAccount=require(_0xc4a9('0x1'))['db'][_0xc4a9('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc4a9('0x3')](0x0);var events={'afterCreate':_0xc4a9('0x4'),'afterUpdate':_0xc4a9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x282978){return function(_0x935998,_0x129b6f,_0x5e8057){SmsAccountEvents['emit'](_0x282978+':'+_0x935998['id'],_0x935998);SmsAccountEvents[_0xc4a9('0x6')](_0x282978,_0x935998);_0x5e8057(null);};}for(var e in events){if(events[_0xc4a9('0x7')](e)){var event=events[e];SmsAccount[_0xc4a9('0x8')](e,emitEvent(event));}}module[_0xc4a9('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 614b9be..2f1a9fd 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 _0xf5bf=['rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1130bc,_0x38b6db){var _0x1488d6=function(_0x3c14f1){while(--_0x3c14f1){_0x1130bc['push'](_0x1130bc['shift']());}};_0x1488d6(++_0x38b6db);}(_0xf5bf,0x173));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xff5b('0x0'));var logger=require(_0xff5b('0x1'))(_0xff5b('0x2'));var moment=require(_0xff5b('0x3'));var BPromise=require(_0xff5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff5b('0x5'));var rimraf=require(_0xff5b('0x6'));var config=require(_0xff5b('0x7'));var attributes=require(_0xff5b('0x8'));module[_0xff5b('0x9')]=function(_0x13ae69,_0x24659a){return _0x13ae69[_0xff5b('0xa')](_0xff5b('0xb'),attributes,{'tableName':_0xff5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x154a=['moment','bluebird','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','../../config/logger','api'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x154a,0x6b));var _0xa154=function(_0x3505fc,_0xb9ce25){_0x3505fc=_0x3505fc-0x0;var _0x3ab8bf=_0x154a[_0x3505fc];return _0x3ab8bf;};'use strict';var _=require(_0xa154('0x0'));var util=require('util');var logger=require(_0xa154('0x1'))(_0xa154('0x2'));var moment=require(_0xa154('0x3'));var BPromise=require(_0xa154('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa154('0x5'));var attributes=require(_0xa154('0x6'));module[_0xa154('0x7')]=function(_0x99c183,_0x2ef1e9){return _0x99c183[_0xa154('0x8')](_0xa154('0x9'),attributes,{'tableName':'sms_accounts','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 c2cdad1..ebf5158 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 _0xe470=['find','options','raw','where','attributes','map','model','include','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ShowSmsAccount','SmsAccount'];(function(_0x1fca80,_0x527187){var _0x5ab676=function(_0x1af7c6){while(--_0x1af7c6){_0x1fca80['push'](_0x1fca80['shift']());}};_0x5ab676(++_0x527187);}(_0xe470,0x149));var _0x0e47=function(_0x2a975a,_0x168282){_0x2a975a=_0x2a975a-0x0;var _0xc2fa09=_0xe470[_0x2a975a];return _0xc2fa09;};'use strict';var _=require(_0x0e47('0x0'));var util=require(_0x0e47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e47('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e47('0x3'))['db'];var utils=require(_0x0e47('0x4'));var logger=require('../../config/logger')(_0x0e47('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e47('0x6'));var client=jayson[_0x0e47('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x0e47('0x8')],{'host':_0x0e47('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0e47('0xa'))[_0x0e47('0xb')](socket);function respondWithRpcPromise(_0x429f05,_0x4413e9,_0x9bfd59){return new BPromise(function(_0x5dfe7c,_0x2ea675){return client['request'](_0x429f05,_0x9bfd59)['then'](function(_0x46acae){logger[_0x0e47('0xc')](_0x0e47('0xd'),_0x4413e9,'request\x20sent');logger[_0x0e47('0xe')](_0x0e47('0xf'),_0x4413e9,_0x0e47('0x10'),JSON[_0x0e47('0x11')](_0x46acae));if(_0x46acae[_0x0e47('0x12')]){if(_0x46acae[_0x0e47('0x12')][_0x0e47('0x13')]===0x1f4){logger[_0x0e47('0x12')](_0x0e47('0xd'),_0x4413e9,_0x46acae[_0x0e47('0x12')][_0x0e47('0x14')]);return _0x2ea675(_0x46acae[_0x0e47('0x12')][_0x0e47('0x14')]);}logger['error'](_0x0e47('0xd'),_0x4413e9,_0x46acae[_0x0e47('0x12')][_0x0e47('0x14')]);return _0x5dfe7c(_0x46acae[_0x0e47('0x12')][_0x0e47('0x14')]);}else{logger[_0x0e47('0xc')](_0x0e47('0xd'),_0x4413e9,_0x0e47('0x10'));_0x5dfe7c(_0x46acae['result'][_0x0e47('0x14')]);}})['catch'](function(_0x196d57){logger[_0x0e47('0x12')](_0x0e47('0xd'),_0x4413e9,_0x196d57);_0x2ea675(_0x196d57);});});}exports[_0x0e47('0x15')]=function(_0xcb065b){var _0x17db8f=this;return new Promise(function(_0x3f7936,_0x3a48d4){return db[_0x0e47('0x16')][_0x0e47('0x17')]({'raw':_0xcb065b[_0x0e47('0x18')]?_0xcb065b[_0x0e47('0x18')][_0x0e47('0x19')]===undefined?!![]:![]:!![],'where':_0xcb065b['options']?_0xcb065b[_0x0e47('0x18')][_0x0e47('0x1a')]||null:null,'attributes':_0xcb065b[_0x0e47('0x18')]?_0xcb065b[_0x0e47('0x18')][_0x0e47('0x1b')]||null:null,'include':_0xcb065b['options']?_0xcb065b['options']['include']?_[_0x0e47('0x1c')](_0xcb065b[_0x0e47('0x18')]['include'],function(_0x5742e7){return{'model':db[_0x5742e7[_0x0e47('0x1d')]],'as':_0x5742e7['as'],'attributes':_0x5742e7[_0x0e47('0x1b')],'include':_0x5742e7['include']?_['map'](_0x5742e7[_0x0e47('0x1e')],function(_0x3c2ae6){return{'model':db[_0x3c2ae6[_0x0e47('0x1d')]],'as':_0x3c2ae6['as'],'attributes':_0x3c2ae6[_0x0e47('0x1b')],'include':_0x3c2ae6[_0x0e47('0x1e')]?_[_0x0e47('0x1c')](_0x3c2ae6['include'],function(_0x1f1a8e){return{'model':db[_0x1f1a8e[_0x0e47('0x1d')]],'as':_0x1f1a8e['as'],'attributes':_0x1f1a8e[_0x0e47('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42563b){logger['info'](_0x0e47('0x15'),_0xcb065b);logger[_0x0e47('0xe')](_0x0e47('0x15'),_0xcb065b,JSON['stringify'](_0x42563b));_0x3f7936(_0x42563b);})[_0x0e47('0x1f')](function(_0x35991d){logger[_0x0e47('0x12')]('ShowSmsAccount',_0x35991d[_0x0e47('0x14')],_0xcb065b);_0x3a48d4(_0x17db8f[_0x0e47('0x12')](0x1f4,_0x35991d[_0x0e47('0x14')]));});});}; \ No newline at end of file +var _0x6fa3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','ioredis','../../config/utils'];(function(_0x1b4a3d,_0x302427){var _0xc0d752=function(_0x529eb0){while(--_0x529eb0){_0x1b4a3d['push'](_0x1b4a3d['shift']());}};_0xc0d752(++_0x302427);}(_0x6fa3,0x1cf));var _0x36fa=function(_0x4d504f,_0x34477c){_0x4d504f=_0x4d504f-0x0;var _0x2a56c7=_0x6fa3[_0x4d504f];return _0x2a56c7;};'use strict';var _=require(_0x36fa('0x0'));var util=require(_0x36fa('0x1'));var moment=require(_0x36fa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36fa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x36fa('0x4'));var logger=require(_0x36fa('0x5'))(_0x36fa('0x6'));var config=require(_0x36fa('0x7'));var jayson=require(_0x36fa('0x8'));var client=jayson[_0x36fa('0x9')][_0x36fa('0xa')]({'port':0x232a});config['redis']=_[_0x36fa('0xb')](config[_0x36fa('0xc')],{'host':_0x36fa('0xd'),'port':0x18eb});var socket=require(_0x36fa('0xe'))(new Redis(config[_0x36fa('0xc')]));require(_0x36fa('0xf'))[_0x36fa('0x10')](socket);function respondWithRpcPromise(_0x2303f6,_0x4755f1,_0x988063){return new BPromise(function(_0x18df7b,_0x1c4b47){return client[_0x36fa('0x11')](_0x2303f6,_0x988063)[_0x36fa('0x12')](function(_0x10af68){logger[_0x36fa('0x13')](_0x36fa('0x14'),_0x4755f1,_0x36fa('0x15'));logger['debug'](_0x36fa('0x16'),_0x4755f1,'request\x20sent',JSON[_0x36fa('0x17')](_0x10af68));if(_0x10af68[_0x36fa('0x18')]){if(_0x10af68[_0x36fa('0x18')][_0x36fa('0x19')]===0x1f4){logger[_0x36fa('0x18')]('SmsAccount,\x20%s,\x20%s',_0x4755f1,_0x10af68[_0x36fa('0x18')]['message']);return _0x1c4b47(_0x10af68[_0x36fa('0x18')][_0x36fa('0x1a')]);}logger[_0x36fa('0x18')](_0x36fa('0x14'),_0x4755f1,_0x10af68[_0x36fa('0x18')][_0x36fa('0x1a')]);return _0x18df7b(_0x10af68[_0x36fa('0x18')][_0x36fa('0x1a')]);}else{logger[_0x36fa('0x13')](_0x36fa('0x14'),_0x4755f1,_0x36fa('0x15'));_0x18df7b(_0x10af68[_0x36fa('0x1b')][_0x36fa('0x1a')]);}})[_0x36fa('0x1c')](function(_0x5e335f){logger[_0x36fa('0x18')]('SmsAccount,\x20%s,\x20%s',_0x4755f1,_0x5e335f);_0x1c4b47(_0x5e335f);});});}exports[_0x36fa('0x1d')]=function(_0x33e6ae){var _0x469272=this;return new Promise(function(_0x54471e,_0x3c9fca){return db[_0x36fa('0x1e')]['find']({'raw':_0x33e6ae['options']?_0x33e6ae[_0x36fa('0x1f')][_0x36fa('0x20')]===undefined?!![]:![]:!![],'where':_0x33e6ae[_0x36fa('0x1f')]?_0x33e6ae[_0x36fa('0x1f')][_0x36fa('0x21')]||null:null,'attributes':_0x33e6ae['options']?_0x33e6ae['options'][_0x36fa('0x22')]||null:null,'include':_0x33e6ae[_0x36fa('0x1f')]?_0x33e6ae[_0x36fa('0x1f')]['include']?_[_0x36fa('0x23')](_0x33e6ae[_0x36fa('0x1f')][_0x36fa('0x24')],function(_0x439f4a){return{'model':db[_0x439f4a[_0x36fa('0x25')]],'as':_0x439f4a['as'],'attributes':_0x439f4a['attributes'],'include':_0x439f4a['include']?_[_0x36fa('0x23')](_0x439f4a['include'],function(_0x3205ae){return{'model':db[_0x3205ae[_0x36fa('0x25')]],'as':_0x3205ae['as'],'attributes':_0x3205ae['attributes'],'include':_0x3205ae[_0x36fa('0x24')]?_[_0x36fa('0x23')](_0x3205ae[_0x36fa('0x24')],function(_0x5e8943){return{'model':db[_0x5e8943[_0x36fa('0x25')]],'as':_0x5e8943['as'],'attributes':_0x5e8943[_0x36fa('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xee8466){logger[_0x36fa('0x13')](_0x36fa('0x1d'),_0x33e6ae);logger[_0x36fa('0x26')]('ShowSmsAccount',_0x33e6ae,JSON[_0x36fa('0x17')](_0xee8466));_0x54471e(_0xee8466);})['catch'](function(_0x23bccc){logger[_0x36fa('0x18')](_0x36fa('0x1d'),_0x23bccc['message'],_0x33e6ae);_0x3c9fca(_0x469272['error'](0x1f4,_0x23bccc[_0x36fa('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e880453..fe0a851 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 _0x7b4a=['./smsAccount.events','save','remove','update','emit','removeListener','length','smsAccount:'];(function(_0x48bd95,_0x294e92){var _0x5e5b16=function(_0x3a69d5){while(--_0x3a69d5){_0x48bd95['push'](_0x48bd95['shift']());}};_0x5e5b16(++_0x294e92);}(_0x7b4a,0x68));var _0xa7b4=function(_0x14eb24,_0x592e97){_0x14eb24=_0x14eb24-0x0;var _0x30aa1e=_0x7b4a[_0x14eb24];return _0x30aa1e;};'use strict';var SmsAccountEvents=require(_0xa7b4('0x0'));var events=[_0xa7b4('0x1'),_0xa7b4('0x2'),_0xa7b4('0x3')];function createListener(_0x38e4eb,_0x43189b){return function(_0x5bfab9){_0x43189b[_0xa7b4('0x4')](_0x38e4eb,_0x5bfab9);};}function removeListener(_0x508edc,_0x315000){return function(){SmsAccountEvents[_0xa7b4('0x5')](_0x508edc,_0x315000);};}exports['register']=function(_0x43da65){for(var _0x26f1a1=0x0,_0x501f6e=events[_0xa7b4('0x6')];_0x26f1a1<_0x501f6e;_0x26f1a1++){var _0x3cd9c7=events[_0x26f1a1];var _0x478f57=createListener(_0xa7b4('0x7')+_0x3cd9c7,_0x43da65);SmsAccountEvents['on'](_0x3cd9c7,_0x478f57);}}; \ No newline at end of file +var _0x4d94=['save','remove','update','emit','removeListener','register','length','smsAccount:','./smsAccount.events'];(function(_0x4062d7,_0x27516d){var _0x9d9d6d=function(_0x4e9072){while(--_0x4e9072){_0x4062d7['push'](_0x4062d7['shift']());}};_0x9d9d6d(++_0x27516d);}(_0x4d94,0xc5));var _0x44d9=function(_0x567490,_0x279ea6){_0x567490=_0x567490-0x0;var _0x35af34=_0x4d94[_0x567490];return _0x35af34;};'use strict';var SmsAccountEvents=require(_0x44d9('0x0'));var events=[_0x44d9('0x1'),_0x44d9('0x2'),_0x44d9('0x3')];function createListener(_0x5c7d18,_0x58dd39){return function(_0xc5e422){_0x58dd39[_0x44d9('0x4')](_0x5c7d18,_0xc5e422);};}function removeListener(_0x35fcef,_0x7af2d2){return function(){SmsAccountEvents[_0x44d9('0x5')](_0x35fcef,_0x7af2d2);};}exports[_0x44d9('0x6')]=function(_0x27edf1){for(var _0x32b89d=0x0,_0x518b42=events[_0x44d9('0x7')];_0x32b89d<_0x518b42;_0x32b89d++){var _0x38fa63=events[_0x32b89d];var _0x26d55f=createListener(_0x44d9('0x8')+_0x38fa63,_0x27edf1);SmsAccountEvents['on'](_0x38fa63,_0x26d55f);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index b4b6123..21d53dc 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 _0x1ccd=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer'];(function(_0x447982,_0xa8e73a){var _0x3838e7=function(_0x59a77e){while(--_0x59a77e){_0x447982['push'](_0x447982['shift']());}};_0x3838e7(++_0xa8e73a);}(_0x1ccd,0xd1));var _0xd1cc=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x1ccd[_0x2f5a22];return _0x326b70;};'use strict';var multer=require(_0xd1cc('0x0'));var util=require(_0xd1cc('0x1'));var path=require(_0xd1cc('0x2'));var timeout=require(_0xd1cc('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd1cc('0x4'));var config=require(_0xd1cc('0x5'));var controller=require('./smsApplication.controller');router[_0xd1cc('0x6')]('/',auth[_0xd1cc('0x7')](),controller[_0xd1cc('0x8')]);router[_0xd1cc('0x6')](_0xd1cc('0x9'),auth[_0xd1cc('0x7')](),controller['show']);router[_0xd1cc('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd1cc('0xb')](_0xd1cc('0x9'),auth[_0xd1cc('0x7')](),controller[_0xd1cc('0xc')]);router['delete']('/:id',auth[_0xd1cc('0x7')](),controller[_0xd1cc('0xd')]);module[_0xd1cc('0xe')]=router; \ No newline at end of file +var _0x3918=['express','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout'];(function(_0x57019e,_0x2306d6){var _0x19f902=function(_0x1b16ec){while(--_0x1b16ec){_0x57019e['push'](_0x57019e['shift']());}};_0x19f902(++_0x2306d6);}(_0x3918,0x10d));var _0x8391=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3918[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8391('0x0'));var util=require('util');var path=require(_0x8391('0x1'));var timeout=require(_0x8391('0x2'));var express=require(_0x8391('0x3'));var router=express['Router']();var auth=require(_0x8391('0x4'));var interaction=require(_0x8391('0x5'));var config=require('../../config/environment');var controller=require(_0x8391('0x6'));router[_0x8391('0x7')]('/',auth[_0x8391('0x8')](),controller[_0x8391('0x9')]);router[_0x8391('0x7')](_0x8391('0xa'),auth[_0x8391('0x8')](),controller[_0x8391('0xb')]);router[_0x8391('0xc')]('/',auth['isAuthenticated'](),controller[_0x8391('0xd')]);router[_0x8391('0xe')](_0x8391('0xa'),auth[_0x8391('0x8')](),controller['update']);router[_0x8391('0xf')](_0x8391('0xa'),auth[_0x8391('0x8')](),controller['destroy']);module[_0x8391('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 ad014f2..951a76f 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 _0x3cae=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x40f53f,_0x59032d){var _0x56b219=function(_0x423eba){while(--_0x423eba){_0x40f53f['push'](_0x40f53f['shift']());}};_0x56b219(++_0x59032d);}(_0x3cae,0x117));var _0xe3ca=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3cae[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'priority':{'type':Sequelize[_0xe3ca('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe3ca('0x3')],'allowNull':![],'defaultValue':_0xe3ca('0x4')},'appdata':{'type':Sequelize[_0xe3ca('0x5')]()},'description':{'type':Sequelize[_0xe3ca('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe3ca('0x6')}}; \ No newline at end of file +var _0xb923=['INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x2089fe,_0x1a95c6){var _0x5eb20b=function(_0x506810){while(--_0x506810){_0x2089fe['push'](_0x2089fe['shift']());}};_0x5eb20b(++_0x1a95c6);}(_0xb923,0x80));var _0x3b92=function(_0xee4ce,_0x4a97e3){_0xee4ce=_0xee4ce-0x0;var _0x3c5fcb=_0xb923[_0xee4ce];return _0x3c5fcb;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3b92('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3b92('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3b92('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3b92('0x1')],'defaultValue':_0x3b92('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index fa8f062..92a4f7f 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 _0xa7c0=['filter','type','key','field','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','SmsApplication','rawAttributes','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa7c0,0xe6));var _0x0a7c=function(_0x23305f,_0xf2ef72){_0x23305f=_0x23305f-0x0;var _0x5a5e26=_0xa7c0[_0x23305f];return _0x5a5e26;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0a7c('0x0'));var rimraf=require(_0x0a7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a7c('0x2'));var rp=require(_0x0a7c('0x3'));var moment=require('moment');var BPromise=require(_0x0a7c('0x4'));var Mustache=require(_0x0a7c('0x5'));var util=require('util');var path=require(_0x0a7c('0x6'));var sox=require(_0x0a7c('0x7'));var csv=require('to-csv');var ejs=require(_0x0a7c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0a7c('0x9'));var crypto=require(_0x0a7c('0xa'));var jsforce=require(_0x0a7c('0xb'));var deskjs=require(_0x0a7c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0a7c('0xd'));var Papa=require(_0x0a7c('0xe'));var Redis=require(_0x0a7c('0xf'));var authService=require(_0x0a7c('0x10'));var qs=require(_0x0a7c('0x11'));var hardwareService=require(_0x0a7c('0x12'));var logger=require('../../config/logger')(_0x0a7c('0x13'));var utils=require('../../config/utils');var config=require(_0x0a7c('0x14'));var db=require(_0x0a7c('0x15'))['db'];function respondWithStatusCode(_0x485a8f,_0x2bacce){_0x2bacce=_0x2bacce||0xcc;return function(_0x172166){if(_0x172166){return _0x485a8f[_0x0a7c('0x16')](_0x2bacce);}return _0x485a8f[_0x0a7c('0x17')](_0x2bacce)[_0x0a7c('0x18')]();};}function respondWithResult(_0x725565,_0x401d57){_0x401d57=_0x401d57||0xc8;return function(_0x474fca){if(_0x474fca){return _0x725565[_0x0a7c('0x17')](_0x401d57)['json'](_0x474fca);}};}function respondWithFilteredResult(_0x1daba9,_0x23eb70){return function(_0x314c8f){if(_0x314c8f){var _0x2dfbb6=_0x314c8f[_0x0a7c('0x19')],_0x50494a=_0x23eb70[_0x0a7c('0x1a')],_0x50eb53=_0x23eb70['offset']+_0x23eb70['limit'],_0x13f9e2;if(_0x50eb53>=_0x2dfbb6){_0x50eb53=_0x2dfbb6;_0x13f9e2=0xc8;}else{_0x13f9e2=0xce;}_0x1daba9[_0x0a7c('0x17')](_0x13f9e2);return _0x1daba9['set'](_0x0a7c('0x1b'),_0x50494a+'-'+_0x50eb53+'/'+_0x2dfbb6)[_0x0a7c('0x1c')](_0x314c8f);}return null;};}function patchUpdates(_0x4e7021){return function(_0x88bdc3){try{jsonpatch[_0x0a7c('0x1d')](_0x88bdc3,_0x4e7021,!![]);}catch(_0xe475bc){return BPromise['reject'](_0xe475bc);}return _0x88bdc3[_0x0a7c('0x1e')]();};}function saveUpdates(_0x1ac2c2,_0x404ac1){return function(_0x5ee862){if(_0x5ee862){return _0x5ee862[_0x0a7c('0x1f')](_0x1ac2c2)['then'](function(_0x570d9d){return _0x570d9d;});}return null;};}function removeEntity(_0x316fd6,_0x227935){return function(_0xac3065){if(_0xac3065){return _0xac3065[_0x0a7c('0x20')]()[_0x0a7c('0x21')](function(){_0x316fd6[_0x0a7c('0x17')](0xcc)[_0x0a7c('0x18')]();});}};}function handleEntityNotFound(_0x78d54d,_0x55f33d){return function(_0x459e1c){if(!_0x459e1c){_0x78d54d[_0x0a7c('0x16')](0x194);}return _0x459e1c;};}function handleError(_0x52adff,_0x53d127){_0x53d127=_0x53d127||0x1f4;return function(_0x2c61c5){logger[_0x0a7c('0x22')](_0x2c61c5[_0x0a7c('0x23')]);if(_0x2c61c5[_0x0a7c('0x24')]){delete _0x2c61c5[_0x0a7c('0x24')];}_0x52adff[_0x0a7c('0x17')](_0x53d127)[_0x0a7c('0x25')](_0x2c61c5);};}exports[_0x0a7c('0x26')]=function(_0x493416,_0x3e93ed){var _0x50244f={},_0x2f77b6={},_0x5341e={'count':0x0,'rows':[]};var _0x545b5b=db[_0x0a7c('0x27')][_0x0a7c('0x28')];_0x2f77b6[_0x0a7c('0x29')]=_['keys'](_0x545b5b);_0x2f77b6[_0x0a7c('0x2a')]=_['keys'](_0x493416[_0x0a7c('0x2a')]);_0x2f77b6[_0x0a7c('0x2b')]=_[_0x0a7c('0x2c')](_0x2f77b6[_0x0a7c('0x29')],_0x2f77b6[_0x0a7c('0x2a')]);_0x50244f['attributes']=_[_0x0a7c('0x2c')](_0x2f77b6['model'],qs[_0x0a7c('0x2d')](_0x493416['query'][_0x0a7c('0x2d')]));_0x50244f['attributes']=_0x50244f['attributes'][_0x0a7c('0x2e')]?_0x50244f[_0x0a7c('0x2f')]:_0x2f77b6['model'];if(!_0x493416['query'][_0x0a7c('0x30')](_0x0a7c('0x31'))){_0x50244f['limit']=qs['limit'](_0x493416[_0x0a7c('0x2a')]['limit']);_0x50244f[_0x0a7c('0x1a')]=qs['offset'](_0x493416['query'][_0x0a7c('0x1a')]);}_0x50244f[_0x0a7c('0x32')]=qs[_0x0a7c('0x33')](_0x493416[_0x0a7c('0x2a')][_0x0a7c('0x33')]);_0x50244f[_0x0a7c('0x34')]=qs[_0x0a7c('0x2b')](_[_0x0a7c('0x35')](_0x493416[_0x0a7c('0x2a')],_0x2f77b6['filters']));if(_0x493416[_0x0a7c('0x2a')][_0x0a7c('0x36')]){_0x50244f[_0x0a7c('0x34')]=_['merge'](_0x50244f[_0x0a7c('0x34')],{'$or':_['map'](_0x545b5b,function(_0x47d317){if(_0x47d317[_0x0a7c('0x37')][_0x0a7c('0x38')]!=='VIRTUAL'){var _0x55dbd7={};_0x55dbd7[_0x47d317[_0x0a7c('0x39')]]={'$like':'%'+_0x493416['query']['filter']+'%'};return _0x55dbd7;}})});}_0x50244f=_[_0x0a7c('0x3a')]({},_0x50244f,_0x493416[_0x0a7c('0x3b')]);var _0x1c7b93={'where':_0x50244f['where']};return db[_0x0a7c('0x27')][_0x0a7c('0x19')](_0x1c7b93)[_0x0a7c('0x21')](function(_0x578acb){_0x5341e['count']=_0x578acb;if(_0x493416[_0x0a7c('0x2a')][_0x0a7c('0x3c')]){_0x50244f[_0x0a7c('0x3d')]=[{'all':!![]}];}return db[_0x0a7c('0x27')][_0x0a7c('0x3e')](_0x50244f);})[_0x0a7c('0x21')](function(_0x17de30){_0x5341e[_0x0a7c('0x3f')]=_0x17de30;return _0x5341e;})[_0x0a7c('0x21')](respondWithFilteredResult(_0x3e93ed,_0x50244f))['catch'](handleError(_0x3e93ed,null));};exports[_0x0a7c('0x40')]=function(_0x8f8d31,_0x3cb447){var _0x2f55ea={'raw':!![],'where':{'id':_0x8f8d31[_0x0a7c('0x41')]['id']}},_0x58bdf0={};_0x58bdf0[_0x0a7c('0x29')]=_[_0x0a7c('0x42')](db[_0x0a7c('0x27')][_0x0a7c('0x28')]);_0x58bdf0[_0x0a7c('0x2a')]=_[_0x0a7c('0x42')](_0x8f8d31['query']);_0x58bdf0['filters']=_['intersection'](_0x58bdf0['model'],_0x58bdf0[_0x0a7c('0x2a')]);_0x2f55ea['attributes']=_[_0x0a7c('0x2c')](_0x58bdf0['model'],qs[_0x0a7c('0x2d')](_0x8f8d31[_0x0a7c('0x2a')]['fields']));_0x2f55ea[_0x0a7c('0x2f')]=_0x2f55ea[_0x0a7c('0x2f')]['length']?_0x2f55ea['attributes']:_0x58bdf0[_0x0a7c('0x29')];if(_0x8f8d31[_0x0a7c('0x2a')][_0x0a7c('0x3c')]){_0x2f55ea[_0x0a7c('0x3d')]=[{'all':!![]}];}_0x2f55ea=_['merge']({},_0x2f55ea,_0x8f8d31[_0x0a7c('0x3b')]);return db[_0x0a7c('0x27')][_0x0a7c('0x43')](_0x2f55ea)[_0x0a7c('0x21')](handleEntityNotFound(_0x3cb447,null))[_0x0a7c('0x21')](respondWithResult(_0x3cb447,null))[_0x0a7c('0x44')](handleError(_0x3cb447,null));};exports[_0x0a7c('0x45')]=function(_0x538a1b,_0x22b67f){return db[_0x0a7c('0x27')][_0x0a7c('0x45')](_0x538a1b['body'],{})[_0x0a7c('0x21')](respondWithResult(_0x22b67f,0xc9))[_0x0a7c('0x44')](handleError(_0x22b67f,null));};exports[_0x0a7c('0x1f')]=function(_0x3af800,_0x55bc9a){if(_0x3af800[_0x0a7c('0x46')]['id']){delete _0x3af800[_0x0a7c('0x46')]['id'];}return db[_0x0a7c('0x27')][_0x0a7c('0x43')]({'where':{'id':_0x3af800[_0x0a7c('0x41')]['id']}})[_0x0a7c('0x21')](handleEntityNotFound(_0x55bc9a,null))[_0x0a7c('0x21')](saveUpdates(_0x3af800['body'],null))[_0x0a7c('0x21')](respondWithResult(_0x55bc9a,null))['catch'](handleError(_0x55bc9a,null));};exports[_0x0a7c('0x20')]=function(_0x46adcd,_0x10ee33){return db[_0x0a7c('0x27')]['find']({'where':{'id':_0x46adcd[_0x0a7c('0x41')]['id']}})[_0x0a7c('0x21')](handleEntityNotFound(_0x10ee33,null))[_0x0a7c('0x21')](removeEntity(_0x10ee33,null))[_0x0a7c('0x44')](handleError(_0x10ee33,null));}; \ No newline at end of file +var _0x7993=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','end','sendStatus','name','send','index','SmsApplication','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','params','keys','rawAttributes','fields','includeAll','merge','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x212ae0,_0x3754fd){var _0x4028d7=function(_0x2a545d){while(--_0x2a545d){_0x212ae0['push'](_0x212ae0['shift']());}};_0x4028d7(++_0x3754fd);}(_0x7993,0x11e));var _0x3799=function(_0x1d6da1,_0x4ad243){_0x1d6da1=_0x1d6da1-0x0;var _0x561a1b=_0x7993[_0x1d6da1];return _0x561a1b;};'use strict';var pdf=require(_0x3799('0x0'));var emlformat=require(_0x3799('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3799('0x2'));var jsonpatch=require(_0x3799('0x3'));var rp=require(_0x3799('0x4'));var moment=require('moment');var BPromise=require(_0x3799('0x5'));var Mustache=require(_0x3799('0x6'));var util=require(_0x3799('0x7'));var path=require(_0x3799('0x8'));var sox=require(_0x3799('0x9'));var csv=require(_0x3799('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3799('0xb'));var squel=require(_0x3799('0xc'));var crypto=require(_0x3799('0xd'));var jsforce=require(_0x3799('0xe'));var deskjs=require(_0x3799('0xf'));var toCsv=require(_0x3799('0xa'));var querystring=require(_0x3799('0x10'));var Papa=require(_0x3799('0x11'));var Redis=require(_0x3799('0x12'));var authService=require(_0x3799('0x13'));var qs=require(_0x3799('0x14'));var hardwareService=require(_0x3799('0x15'));var logger=require(_0x3799('0x16'))(_0x3799('0x17'));var utils=require(_0x3799('0x18'));var config=require(_0x3799('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f654,_0x1de67c){_0x1de67c=_0x1de67c||0xcc;return function(_0xfc5489){if(_0xfc5489){return _0x26f654['sendStatus'](_0x1de67c);}return _0x26f654[_0x3799('0x1a')](_0x1de67c)['end']();};}function respondWithResult(_0x3e7ca9,_0x44b10c){_0x44b10c=_0x44b10c||0xc8;return function(_0x233495){if(_0x233495){return _0x3e7ca9[_0x3799('0x1a')](_0x44b10c)[_0x3799('0x1b')](_0x233495);}};}function respondWithFilteredResult(_0x24c9ca,_0x712534){return function(_0x1b6550){if(_0x1b6550){var _0x2ae8ff=_0x1b6550[_0x3799('0x1c')],_0x1a2cdd=_0x712534[_0x3799('0x1d')],_0x1a7963=_0x712534[_0x3799('0x1d')]+_0x712534[_0x3799('0x1e')],_0x180fee;if(_0x1a7963>=_0x2ae8ff){_0x1a7963=_0x2ae8ff;_0x180fee=0xc8;}else{_0x180fee=0xce;}_0x24c9ca[_0x3799('0x1a')](_0x180fee);return _0x24c9ca[_0x3799('0x1f')](_0x3799('0x20'),_0x1a2cdd+'-'+_0x1a7963+'/'+_0x2ae8ff)['json'](_0x1b6550);}return null;};}function patchUpdates(_0x27d5e9){return function(_0x20c78e){try{jsonpatch[_0x3799('0x21')](_0x20c78e,_0x27d5e9,!![]);}catch(_0x50eb0e){return BPromise['reject'](_0x50eb0e);}return _0x20c78e[_0x3799('0x22')]();};}function saveUpdates(_0x4f09ab,_0x261cd4){return function(_0x4733a2){if(_0x4733a2){return _0x4733a2['update'](_0x4f09ab)['then'](function(_0x193bae){return _0x193bae;});}return null;};}function removeEntity(_0x4535dd,_0x13d74f){return function(_0x812b11){if(_0x812b11){return _0x812b11[_0x3799('0x23')]()[_0x3799('0x24')](function(){_0x4535dd[_0x3799('0x1a')](0xcc)[_0x3799('0x25')]();});}};}function handleEntityNotFound(_0x4c8506,_0x1e5a6e){return function(_0x41abc0){if(!_0x41abc0){_0x4c8506[_0x3799('0x26')](0x194);}return _0x41abc0;};}function handleError(_0x5e0fd4,_0x1868d2){_0x1868d2=_0x1868d2||0x1f4;return function(_0x58aab7){logger['error'](_0x58aab7['stack']);if(_0x58aab7[_0x3799('0x27')]){delete _0x58aab7[_0x3799('0x27')];}_0x5e0fd4['status'](_0x1868d2)[_0x3799('0x28')](_0x58aab7);};}exports[_0x3799('0x29')]=function(_0x2a0cfc,_0x4f5cc0){var _0xab11e0={},_0x39597b={},_0x39ab9a={'count':0x0,'rows':[]};var _0x9d8c1a=db[_0x3799('0x2a')]['rawAttributes'];_0x39597b[_0x3799('0x2b')]=_['keys'](_0x9d8c1a);_0x39597b[_0x3799('0x2c')]=_['keys'](_0x2a0cfc[_0x3799('0x2c')]);_0x39597b[_0x3799('0x2d')]=_[_0x3799('0x2e')](_0x39597b['model'],_0x39597b[_0x3799('0x2c')]);_0xab11e0[_0x3799('0x2f')]=_['intersection'](_0x39597b[_0x3799('0x2b')],qs['fields'](_0x2a0cfc[_0x3799('0x2c')]['fields']));_0xab11e0['attributes']=_0xab11e0['attributes'][_0x3799('0x30')]?_0xab11e0[_0x3799('0x2f')]:_0x39597b[_0x3799('0x2b')];if(!_0x2a0cfc[_0x3799('0x2c')][_0x3799('0x31')](_0x3799('0x32'))){_0xab11e0[_0x3799('0x1e')]=qs[_0x3799('0x1e')](_0x2a0cfc['query'][_0x3799('0x1e')]);_0xab11e0[_0x3799('0x1d')]=qs[_0x3799('0x1d')](_0x2a0cfc[_0x3799('0x2c')][_0x3799('0x1d')]);}_0xab11e0[_0x3799('0x33')]=qs[_0x3799('0x34')](_0x2a0cfc['query'][_0x3799('0x34')]);_0xab11e0['where']=qs['filters'](_[_0x3799('0x35')](_0x2a0cfc[_0x3799('0x2c')],_0x39597b[_0x3799('0x2d')]));if(_0x2a0cfc[_0x3799('0x2c')][_0x3799('0x36')]){_0xab11e0[_0x3799('0x37')]=_['merge'](_0xab11e0[_0x3799('0x37')],{'$or':_[_0x3799('0x38')](_0x9d8c1a,function(_0x26edee){if(_0x26edee[_0x3799('0x39')][_0x3799('0x3a')]!==_0x3799('0x3b')){var _0x74e6c9={};_0x74e6c9[_0x26edee[_0x3799('0x3c')]]={'$like':'%'+_0x2a0cfc[_0x3799('0x2c')][_0x3799('0x36')]+'%'};return _0x74e6c9;}})});}_0xab11e0=_['merge']({},_0xab11e0,_0x2a0cfc[_0x3799('0x3d')]);var _0x5e6594={'where':_0xab11e0[_0x3799('0x37')]};return db['SmsApplication'][_0x3799('0x1c')](_0x5e6594)['then'](function(_0x20dc9c){_0x39ab9a[_0x3799('0x1c')]=_0x20dc9c;if(_0x2a0cfc['query']['includeAll']){_0xab11e0[_0x3799('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0x3799('0x3f')](_0xab11e0);})[_0x3799('0x24')](function(_0xfeb66b){_0x39ab9a[_0x3799('0x40')]=_0xfeb66b;return _0x39ab9a;})[_0x3799('0x24')](respondWithFilteredResult(_0x4f5cc0,_0xab11e0))[_0x3799('0x41')](handleError(_0x4f5cc0,null));};exports['show']=function(_0x464c59,_0x3e1d69){var _0x3d7bd4={'raw':!![],'where':{'id':_0x464c59[_0x3799('0x42')]['id']}},_0x585957={};_0x585957[_0x3799('0x2b')]=_[_0x3799('0x43')](db[_0x3799('0x2a')][_0x3799('0x44')]);_0x585957[_0x3799('0x2c')]=_[_0x3799('0x43')](_0x464c59[_0x3799('0x2c')]);_0x585957[_0x3799('0x2d')]=_[_0x3799('0x2e')](_0x585957[_0x3799('0x2b')],_0x585957[_0x3799('0x2c')]);_0x3d7bd4[_0x3799('0x2f')]=_[_0x3799('0x2e')](_0x585957[_0x3799('0x2b')],qs['fields'](_0x464c59[_0x3799('0x2c')][_0x3799('0x45')]));_0x3d7bd4['attributes']=_0x3d7bd4[_0x3799('0x2f')][_0x3799('0x30')]?_0x3d7bd4[_0x3799('0x2f')]:_0x585957[_0x3799('0x2b')];if(_0x464c59['query'][_0x3799('0x46')]){_0x3d7bd4[_0x3799('0x3e')]=[{'all':!![]}];}_0x3d7bd4=_[_0x3799('0x47')]({},_0x3d7bd4,_0x464c59[_0x3799('0x3d')]);return db[_0x3799('0x2a')][_0x3799('0x48')](_0x3d7bd4)['then'](handleEntityNotFound(_0x3e1d69,null))['then'](respondWithResult(_0x3e1d69,null))[_0x3799('0x41')](handleError(_0x3e1d69,null));};exports[_0x3799('0x49')]=function(_0x5a9a7e,_0x2c7005){return db[_0x3799('0x2a')][_0x3799('0x49')](_0x5a9a7e[_0x3799('0x4a')],{})['then'](respondWithResult(_0x2c7005,0xc9))[_0x3799('0x41')](handleError(_0x2c7005,null));};exports[_0x3799('0x4b')]=function(_0x4109c3,_0x3f9829){if(_0x4109c3[_0x3799('0x4a')]['id']){delete _0x4109c3[_0x3799('0x4a')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x4109c3[_0x3799('0x42')]['id']}})[_0x3799('0x24')](handleEntityNotFound(_0x3f9829,null))['then'](saveUpdates(_0x4109c3[_0x3799('0x4a')],null))[_0x3799('0x24')](respondWithResult(_0x3f9829,null))['catch'](handleError(_0x3f9829,null));};exports[_0x3799('0x23')]=function(_0x522b7c,_0x4676b6){return db[_0x3799('0x2a')][_0x3799('0x48')]({'where':{'id':_0x522b7c[_0x3799('0x42')]['id']}})[_0x3799('0x24')](handleEntityNotFound(_0x4676b6,null))[_0x3799('0x24')](removeEntity(_0x4676b6,null))[_0x3799('0x41')](handleError(_0x4676b6,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 393c13a..cd5b219 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','lodash','util','api'];(function(_0x17b37d,_0x2f5796){var _0x4772d1=function(_0x2acd0d){while(--_0x2acd0d){_0x17b37d['push'](_0x17b37d['shift']());}};_0x4772d1(++_0x2f5796);}(_0x5fab,0x177));var _0xb5fa=function(_0x46c1f5,_0x505b91){_0x46c1f5=_0x46c1f5-0x0;var _0x1a044d=_0x5fab[_0x46c1f5];return _0x1a044d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb5fa('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','moment'];(function(_0x5c7ebc,_0xc873be){var _0x4263e3=function(_0x5aa163){while(--_0x5aa163){_0x5c7ebc['push'](_0x5c7ebc['shift']());}};_0x4263e3(++_0xc873be);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 380489d..385001f 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 _0xd2f3=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c5064,_0x4cebe9){var _0x34740f=function(_0x4f7090){while(--_0x4f7090){_0x1c5064['push'](_0x1c5064['shift']());}};_0x34740f(++_0x4cebe9);}(_0xd2f3,0x103));var _0x3d2f=function(_0x341573,_0x442f1a){_0x341573=_0x341573-0x0;var _0x9ba59=_0xd2f3[_0x341573];return _0x9ba59;};'use strict';var _=require(_0x3d2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d2f('0x1'));var rs=require(_0x3d2f('0x2'));var fs=require('fs');var Redis=require(_0x3d2f('0x3'));var db=require(_0x3d2f('0x4'))['db'];var utils=require(_0x3d2f('0x5'));var logger=require(_0x3d2f('0x6'))(_0x3d2f('0x7'));var config=require(_0x3d2f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3d2f('0x9')][_0x3d2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25e090,_0x398267,_0x1f3f80){return new BPromise(function(_0x1b5749,_0x1c73ac){return client[_0x3d2f('0xb')](_0x25e090,_0x1f3f80)['then'](function(_0x2c2e25){logger[_0x3d2f('0xc')](_0x3d2f('0xd'),_0x398267,_0x3d2f('0xe'));logger[_0x3d2f('0xf')](_0x3d2f('0x10'),_0x398267,_0x3d2f('0xe'),JSON[_0x3d2f('0x11')](_0x2c2e25));if(_0x2c2e25[_0x3d2f('0x12')]){if(_0x2c2e25[_0x3d2f('0x12')]['code']===0x1f4){logger['error'](_0x3d2f('0xd'),_0x398267,_0x2c2e25[_0x3d2f('0x12')][_0x3d2f('0x13')]);return _0x1c73ac(_0x2c2e25[_0x3d2f('0x12')][_0x3d2f('0x13')]);}logger['error'](_0x3d2f('0xd'),_0x398267,_0x2c2e25[_0x3d2f('0x12')]['message']);return _0x1b5749(_0x2c2e25['error']['message']);}else{logger[_0x3d2f('0xc')]('SmsApplication,\x20%s,\x20%s',_0x398267,_0x3d2f('0xe'));_0x1b5749(_0x2c2e25[_0x3d2f('0x14')][_0x3d2f('0x13')]);}})[_0x3d2f('0x15')](function(_0xb35535){logger[_0x3d2f('0x12')](_0x3d2f('0xd'),_0x398267,_0xb35535);_0x1c73ac(_0xb35535);});});} \ No newline at end of file +var _0xa51f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xa51f,0x14b));var _0xfa51=function(_0xd5fd5c,_0x3e2a66){_0xd5fd5c=_0xd5fd5c-0x0;var _0x3b0663=_0xa51f[_0xd5fd5c];return _0x3b0663;};'use strict';var _=require(_0xfa51('0x0'));var util=require(_0xfa51('0x1'));var moment=require(_0xfa51('0x2'));var BPromise=require(_0xfa51('0x3'));var rs=require(_0xfa51('0x4'));var fs=require('fs');var Redis=require(_0xfa51('0x5'));var db=require(_0xfa51('0x6'))['db'];var utils=require(_0xfa51('0x7'));var logger=require(_0xfa51('0x8'))(_0xfa51('0x9'));var config=require(_0xfa51('0xa'));var jayson=require(_0xfa51('0xb'));var client=jayson['client'][_0xfa51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x372185,_0x395a65,_0x4a4f9c){return new BPromise(function(_0x8f2a88,_0x4632f0){return client['request'](_0x372185,_0x4a4f9c)[_0xfa51('0xd')](function(_0x24075f){logger[_0xfa51('0xe')](_0xfa51('0xf'),_0x395a65,'request\x20sent');logger[_0xfa51('0x10')](_0xfa51('0x11'),_0x395a65,_0xfa51('0x12'),JSON['stringify'](_0x24075f));if(_0x24075f[_0xfa51('0x13')]){if(_0x24075f[_0xfa51('0x13')][_0xfa51('0x14')]===0x1f4){logger[_0xfa51('0x13')]('SmsApplication,\x20%s,\x20%s',_0x395a65,_0x24075f[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x4632f0(_0x24075f[_0xfa51('0x13')][_0xfa51('0x15')]);}logger[_0xfa51('0x13')](_0xfa51('0xf'),_0x395a65,_0x24075f[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x8f2a88(_0x24075f['error'][_0xfa51('0x15')]);}else{logger['info'](_0xfa51('0xf'),_0x395a65,'request\x20sent');_0x8f2a88(_0x24075f[_0xfa51('0x16')]['message']);}})[_0xfa51('0x17')](function(_0x2534cf){logger[_0xfa51('0x13')](_0xfa51('0xf'),_0x395a65,_0x2534cf);_0x4632f0(_0x2534cf);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 3623ec3..7a0aa14 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 _0x76cc=['isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','sms','smsinteraction:addtags','put','tracked','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get'];(function(_0x1db5e3,_0x520aff){var _0x54cd75=function(_0x38a844){while(--_0x38a844){_0x1db5e3['push'](_0x1db5e3['shift']());}};_0x54cd75(++_0x520aff);}(_0x76cc,0x1b9));var _0xc76c=function(_0x535645,_0x475c49){_0x535645=_0x535645-0x0;var _0x3e2f1e=_0x76cc[_0x535645];return _0x3e2f1e;};'use strict';var multer=require('multer');var util=require(_0xc76c('0x0'));var path=require(_0xc76c('0x1'));var timeout=require(_0xc76c('0x2'));var express=require(_0xc76c('0x3'));var router=express[_0xc76c('0x4')]();var auth=require(_0xc76c('0x5'));var interaction=require(_0xc76c('0x6'));var config=require('../../config/environment');var controller=require(_0xc76c('0x7'));router[_0xc76c('0x8')]('/',auth[_0xc76c('0x9')](),controller[_0xc76c('0xa')]);router[_0xc76c('0x8')](_0xc76c('0xb'),auth[_0xc76c('0x9')](),controller['describe']);router[_0xc76c('0x8')](_0xc76c('0xc'),auth['isAuthenticated'](),controller[_0xc76c('0xd')]);router[_0xc76c('0x8')](_0xc76c('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0xc76c('0x8')](_0xc76c('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xc76c('0x10')]('/',auth[_0xc76c('0x9')](),controller[_0xc76c('0x11')]);router['post'](_0xc76c('0xe'),auth[_0xc76c('0x9')](),controller[_0xc76c('0x12')]);router[_0xc76c('0x10')](_0xc76c('0x13'),auth[_0xc76c('0x9')](),interaction['tracked'](_0xc76c('0x14'),_0xc76c('0x15')),controller['addTags']);router[_0xc76c('0x16')](_0xc76c('0xc'),auth[_0xc76c('0x9')](),interaction[_0xc76c('0x17')]('sms',_0xc76c('0x18')),controller[_0xc76c('0x19')]);router[_0xc76c('0x1a')](_0xc76c('0xc'),auth[_0xc76c('0x9')](),interaction[_0xc76c('0x17')](_0xc76c('0x14'),_0xc76c('0x1b')),controller[_0xc76c('0x1c')]);router[_0xc76c('0x1a')]('/:id/tags',auth[_0xc76c('0x9')](),controller[_0xc76c('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x208f=['tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','express','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage'];(function(_0x1c2ec3,_0x3dbbd2){var _0x50cb00=function(_0x3ea0f7){while(--_0x3ea0f7){_0x1c2ec3['push'](_0x1c2ec3['shift']());}};_0x50cb00(++_0x3dbbd2);}(_0x208f,0x167));var _0xf208=function(_0x35fd79,_0x28f0ba){_0x35fd79=_0x35fd79-0x0;var _0x54331d=_0x208f[_0x35fd79];return _0x54331d;};'use strict';var multer=require(_0xf208('0x0'));var util=require(_0xf208('0x1'));var path=require(_0xf208('0x2'));var timeout=require('connect-timeout');var express=require(_0xf208('0x3'));var router=express['Router']();var auth=require(_0xf208('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf208('0x5'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0xf208('0x6')](),controller[_0xf208('0x7')]);router[_0xf208('0x8')](_0xf208('0x9'),auth[_0xf208('0x6')](),controller['describe']);router[_0xf208('0x8')](_0xf208('0xa'),auth[_0xf208('0x6')](),controller[_0xf208('0xb')]);router[_0xf208('0x8')](_0xf208('0xc'),auth[_0xf208('0x6')](),controller['getMessages']);router[_0xf208('0x8')](_0xf208('0xd'),auth[_0xf208('0x6')](),controller[_0xf208('0xe')]);router['post']('/',auth[_0xf208('0x6')](),controller[_0xf208('0xf')]);router[_0xf208('0x10')](_0xf208('0xc'),auth[_0xf208('0x6')](),controller[_0xf208('0x11')]);router[_0xf208('0x10')]('/:id/tags',auth[_0xf208('0x6')](),interaction[_0xf208('0x12')](_0xf208('0x13'),_0xf208('0x14')),controller[_0xf208('0x15')]);router[_0xf208('0x16')](_0xf208('0xa'),auth[_0xf208('0x6')](),interaction['tracked'](_0xf208('0x13'),'smsinteraction:update'),controller[_0xf208('0x17')]);router[_0xf208('0x18')](_0xf208('0xa'),auth[_0xf208('0x6')](),interaction['tracked'](_0xf208('0x13'),_0xf208('0x19')),controller[_0xf208('0x1a')]);router[_0xf208('0x18')](_0xf208('0x1b'),auth['isAuthenticated'](),controller[_0xf208('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 386ed4e..f401575 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 _0xf6ec=['ENUM','out','sequelize','moment','exports','BOOLEAN','STRING','DATE'];(function(_0x29445e,_0x38cdab){var _0x4e3d1e=function(_0x42c513){while(--_0x42c513){_0x29445e['push'](_0x29445e['shift']());}};_0x4e3d1e(++_0x38cdab);}(_0xf6ec,0x1da));var _0xcf6e=function(_0x35d29f,_0x41813e){_0x35d29f=_0x35d29f-0x0;var _0x1bae4a=_0xf6ec[_0x35d29f];return _0x1bae4a;};'use strict';var Sequelize=require(_0xcf6e('0x0'));var moment=require(_0xcf6e('0x1'));module[_0xcf6e('0x2')]={'closed':{'type':Sequelize[_0xcf6e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcf6e('0x4')]},'note':{'type':Sequelize[_0xcf6e('0x4')]},'phone':{'type':Sequelize[_0xcf6e('0x4')]},'read1stAt':{'type':Sequelize[_0xcf6e('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xcf6e('0x6')]('in',_0xcf6e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcf6e('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xcf6e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8aee=['STRING','ENUM','out','exports','BOOLEAN','DATE'];(function(_0x47a66c,_0x20069f){var _0x24e987=function(_0x131641){while(--_0x131641){_0x47a66c['push'](_0x47a66c['shift']());}};_0x24e987(++_0x20069f);}(_0x8aee,0xe1));var _0xe8ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xe8ae('0x0')]={'closed':{'type':Sequelize[_0xe8ae('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe8ae('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe8ae('0x3')]},'phone':{'type':Sequelize[_0xe8ae('0x3')]},'read1stAt':{'type':Sequelize[_0xe8ae('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xe8ae('0x4')]('in',_0xe8ae('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe8ae('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ad4e03c..43d06c3 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 _0x5926=['rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','destroy','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','expr','advancedFilter','createdAt','value','dateStart','startOf','utc','format','endOf','day','isArray','condition','TagId','unreadMessages','length','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','and','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','LIKE','filter','isNil','concat','parse','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','Sequelize','QueryTypes','clone','COUNT(*)','COUNT(me.id)','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','mail_interaction_has_tags','t.id\x20IN\x20?','sequelize','count','keyBy','merge','SmsInteraction','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','options','find','create','body','describe','addMessage','ids','getMessages','SmsMessage','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','addTags','Tag','findAll','emit','smsInteractionTags:save','unix','root','server','files','tmp','attachments','direction','secret','User','fullname','CmContact','Contact','lastName','SmsAccount','Account','Owner','10px','40px','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','Sms','N.A.','closed','closedAt','disposition','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','download','log','unlinkSync','html-pdf','eml-format'];(function(_0x4bb976,_0x321b34){var _0x27eb4d=function(_0xdbdff9){while(--_0xdbdff9){_0x4bb976['push'](_0x4bb976['shift']());}};_0x27eb4d(++_0x321b34);}(_0x5926,0xdb));var _0x6592=function(_0x5b9e11,_0x11c5bf){_0x5b9e11=_0x5b9e11-0x0;var _0x532573=_0x5926[_0x5b9e11];return _0x532573;};'use strict';var pdf=require(_0x6592('0x0'));var emlformat=require(_0x6592('0x1'));var rimraf=require(_0x6592('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6592('0x3'));var rp=require(_0x6592('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6592('0x5'));var path=require(_0x6592('0x6'));var sox=require(_0x6592('0x7'));var csv=require(_0x6592('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6592('0x9'));var squel=require('squel');var crypto=require(_0x6592('0xa'));var jsforce=require(_0x6592('0xb'));var deskjs=require(_0x6592('0xc'));var toCsv=require(_0x6592('0x8'));var querystring=require(_0x6592('0xd'));var Papa=require('papaparse');var Redis=require(_0x6592('0xe'));var authService=require(_0x6592('0xf'));var qs=require(_0x6592('0x10'));var hardwareService=require(_0x6592('0x11'));var logger=require('../../config/logger')(_0x6592('0x12'));var utils=require(_0x6592('0x13'));var config=require('../../config/environment');var db=require(_0x6592('0x14'))['db'];config['redis']=_['defaults'](config[_0x6592('0x15')],{'host':_0x6592('0x16'),'port':0x18eb});var socket=require(_0x6592('0x17'))(new Redis(config[_0x6592('0x15')]));require(_0x6592('0x18'))[_0x6592('0x19')](socket);function respondWithStatusCode(_0x22386d,_0x449216){_0x449216=_0x449216||0xcc;return function(_0x167d5a){if(_0x167d5a){return _0x22386d[_0x6592('0x1a')](_0x449216);}return _0x22386d[_0x6592('0x1b')](_0x449216)[_0x6592('0x1c')]();};}function respondWithResult(_0x19854d,_0x534f8d){_0x534f8d=_0x534f8d||0xc8;return function(_0x1610c7){if(_0x1610c7){return _0x19854d[_0x6592('0x1b')](_0x534f8d)[_0x6592('0x1d')](_0x1610c7);}};}function respondWithFilteredResult(_0x35ae11,_0xb1ef94){return function(_0x2eedb9){if(_0x2eedb9){var _0x713e86=_0x2eedb9['count'],_0x2b0029=_0xb1ef94['offset'],_0x3d3b96=_0xb1ef94[_0x6592('0x1e')]+_0xb1ef94[_0x6592('0x1f')],_0x5e742c;if(_0x3d3b96>=_0x713e86){_0x3d3b96=_0x713e86;_0x5e742c=0xc8;}else{_0x5e742c=0xce;}_0x35ae11[_0x6592('0x1b')](_0x5e742c);return _0x35ae11[_0x6592('0x20')]('Content-Range',_0x2b0029+'-'+_0x3d3b96+'/'+_0x713e86)[_0x6592('0x1d')](_0x2eedb9);}return null;};}function patchUpdates(_0x4484e9){return function(_0x554cfd){try{jsonpatch[_0x6592('0x21')](_0x554cfd,_0x4484e9,!![]);}catch(_0x4b3e97){return BPromise[_0x6592('0x22')](_0x4b3e97);}return _0x554cfd['save']();};}function saveUpdates(_0xb9935e,_0x3bc8de){return function(_0x2f2970){if(_0x2f2970){return _0x2f2970[_0x6592('0x23')](_0xb9935e)[_0x6592('0x24')](function(_0x9442e9){return _0x9442e9;});}return null;};}function removeEntity(_0x3a8c55,_0x1849b7){return function(_0x5967c3){if(_0x5967c3){return _0x5967c3[_0x6592('0x25')]()[_0x6592('0x24')](function(){_0x3a8c55[_0x6592('0x1b')](0xcc)[_0x6592('0x1c')]();});}};}function handleEntityNotFound(_0x29758c,_0x4efdb4){return function(_0x234b12){if(!_0x234b12){_0x29758c['sendStatus'](0x194);}return _0x234b12;};}function handleError(_0x182d48,_0x44a9af){_0x44a9af=_0x44a9af||0x1f4;return function(_0x1c1122){logger['error'](_0x1c1122[_0x6592('0x26')]);if(_0x1c1122[_0x6592('0x27')]){delete _0x1c1122[_0x6592('0x27')];}_0x182d48['status'](_0x44a9af)[_0x6592('0x28')](_0x1c1122);};}function getInteractionUsers(_0xbce25a,_0x23e480){return new BPromise(function(_0x376411,_0x4be9ae){try{if(_0x23e480[_0xbce25a['id']]){_0xbce25a[_0x6592('0x29')]=_[_0x6592('0x2a')](_0x23e480[_0xbce25a['id']],function(_0x2b9e79){return{'id':_0x2b9e79['id']};});}}catch(_0x40f7f7){_0x4be9ae(_0x40f7f7);}_0x376411(_0xbce25a);});}function getInteractionTags(_0x3c91bc,_0x217882){return new BPromise(function(_0x543f49,_0x28e1d6){try{if(_0x3c91bc['TagIds']){_0x3c91bc[_0x6592('0x2b')]=[];_0x3c91bc[_0x6592('0x2c')][_0x6592('0x2d')](',')[_0x6592('0x2e')](function(_0xddbe93){_0x3c91bc[_0x6592('0x2b')][_0x6592('0x2f')](_0x217882[_0xddbe93]);});}delete _0x3c91bc[_0x6592('0x2c')];}catch(_0x8aef78){_0x28e1d6(_0x8aef78);}_0x543f49(_0x3c91bc);});}function updateSmsInteraction(_0x4a9ade,_0x548aaa,_0xe39ecc){return new BPromise(function(_0x1c2898,_0xffd491){return getInteractionUsers(_0x4a9ade,_0xe39ecc)[_0x6592('0x24')](function(_0x1b46d9){return getInteractionTags(_0x1b46d9,_0x548aaa);})['then'](function(_0x588cdb){_0x1c2898(_0x588cdb);})[_0x6592('0x30')](function(_0x10f970){_0xffd491(_0x10f970);});});}exports[_0x6592('0x31')]=function(_0x21cf0e,_0x4fc20c){var _0x42ad64={},_0x28fe77={},_0x52119c={'count':0x0,'rows':[]};var _0x39ee28=db['SmsInteraction'][_0x6592('0x32')];_0x28fe77[_0x6592('0x33')]=_[_0x6592('0x34')](_0x39ee28);_0x28fe77[_0x6592('0x35')]=_[_0x6592('0x34')](_0x21cf0e['query']);_0x28fe77[_0x6592('0x36')]=_['intersection'](_0x28fe77[_0x6592('0x33')],_0x28fe77[_0x6592('0x35')]);_0x42ad64[_0x6592('0x37')]=_[_0x6592('0x38')](_0x28fe77[_0x6592('0x33')],qs[_0x6592('0x39')](_0x21cf0e['query'][_0x6592('0x39')]));_0x42ad64[_0x6592('0x37')]=_0x42ad64[_0x6592('0x37')]['length']?_0x42ad64[_0x6592('0x37')]:_0x28fe77[_0x6592('0x33')];if(!_0x21cf0e[_0x6592('0x35')][_0x6592('0x3a')]('nolimit')){_0x42ad64[_0x6592('0x1f')]=qs['limit'](_0x21cf0e[_0x6592('0x35')][_0x6592('0x1f')]);_0x42ad64[_0x6592('0x1e')]=qs['offset'](_0x21cf0e['query'][_0x6592('0x1e')]);}_0x42ad64[_0x6592('0x3b')]=qs[_0x6592('0x3c')](_0x21cf0e[_0x6592('0x35')][_0x6592('0x3c')]);_0x42ad64[_0x6592('0x3d')]=qs['filters'](_[_0x6592('0x3e')](_0x21cf0e[_0x6592('0x35')],_0x28fe77[_0x6592('0x36')]));var _0xd7f4c0=[];var _0x500bd1=squel[_0x6592('0x3f')]()['field']('id')[_0x6592('0x40')](_0x6592('0x27'))['field'](_0x6592('0x41'))[_0x6592('0x42')](_0x6592('0x43'));var _0x81027d=squel[_0x6592('0x3f')]()[_0x6592('0x40')]('COUNT(*)')[_0x6592('0x42')](_0x6592('0x44'),'me')[_0x6592('0x3d')](_0x6592('0x45'))['where']('me.direction\x20=\x20\x27in\x27')[_0x6592('0x3d')](_0x6592('0x46'));var _0x418851=squel['select']()['field'](_0x6592('0x47'))['field'](_0x6592('0x48'))[_0x6592('0x42')](_0x6592('0x49'),'ui')['left_join'](_0x6592('0x4a'),'u',_0x6592('0x4b'));var _0x44ec5e=squel['select']()[_0x6592('0x42')](_0x6592('0x4c'),'i')[_0x6592('0x4d')]('cm_contacts','c',_0x6592('0x4e'))[_0x6592('0x4d')](_0x6592('0x4a'),'o',_0x6592('0x4f'))[_0x6592('0x4d')](_0x6592('0x50'),'a','a.id\x20=\x20i.SmsAccountId')[_0x6592('0x4d')](_0x6592('0x44'),'me','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0x2862a1=squel[_0x6592('0x51')]();if(_0x21cf0e[_0x6592('0x35')][_0x6592('0x52')]){var _0x3a1414=JSON['parse'](_0x21cf0e[_0x6592('0x35')][_0x6592('0x52')]);_[_0x6592('0x34')](_0x3a1414)[_0x6592('0x2e')](function(_0x4d8414){var _0x2ff90a=_0x3a1414[_0x4d8414];if(_0x4d8414===_0x6592('0x53')){var _0xc45f92=moment(_0x2ff90a[_0x6592('0x54')][_0x6592('0x55')])[_0x6592('0x56')]('day')[_0x6592('0x57')]()[_0x6592('0x58')]();var _0x394795=moment(_0x394795)[_0x6592('0x57')]()[_0x6592('0x59')](_0x6592('0x5a'))[_0x6592('0x58')]();_0x2862a1['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc45f92,_0x394795);}else{if(_[_0x6592('0x5b')](_0x2ff90a[_0x6592('0x5c')])){_0x2ff90a[_0x6592('0x5c')][_0x6592('0x2e')](function(_0x5cf1ba){switch(_0x2ff90a['condition'][_0x6592('0x54')]){case'IS':if(_0x4d8414!==_0x6592('0x5d')&&_0x4d8414!==_0x6592('0x5e')){if(_[_0x6592('0x5b')](_0x2ff90a[_0x6592('0x54')])&&_0x2ff90a['value'][_0x6592('0x5f')]>0x1){_0x2862a1['and'](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x61'),_0x2ff90a[_0x6592('0x54')]);}else{_0x2862a1['and'](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+'\x20=\x20?',_0x2ff90a[_0x6592('0x54')][0x0]);}}break;case'=':_0x2862a1['and'](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x62'),_0x2ff90a['value']);break;case'LIKE':if(_0x4d8414===_0x6592('0x63')){_0x2862a1[_0x6592('0x64')](_0x6592('0x65')+_0x6592('0x66'),'%'+_0x2ff90a['value']+'%');_0x2862a1['or'](_0x6592('0x67')+'\x20LIKE\x20?','%'+_0x2ff90a[_0x6592('0x54')]+'%');_0x2862a1['or'](_0x6592('0x68')+_0x6592('0x66'),'%'+_0x2ff90a[_0x6592('0x54')]+'%');}else{_0x2862a1['and'](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x66'),'%'+_0x2ff90a['value']+'%');}break;case'>':_0x2862a1[_0x6592('0x64')](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x69'),_0x2ff90a['value']);break;case'<':_0x2862a1[_0x6592('0x64')](_0x2ff90a['tableAlias']+'.'+_0x4d8414+_0x6592('0x6a'),_0x2ff90a[_0x6592('0x54')]);break;}});}else{switch(_0x2ff90a[_0x6592('0x5c')][_0x6592('0x54')]){case'IS':if(_0x4d8414!==_0x6592('0x5d')&&_0x4d8414!==_0x6592('0x5e')){if(_[_0x6592('0x5b')](_0x2ff90a['value'])&&_0x2ff90a['value'][_0x6592('0x5f')]>0x1){_0x2862a1[_0x6592('0x64')](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x61'),_0x2ff90a[_0x6592('0x54')]);}else{_0x2862a1[_0x6592('0x64')](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x62'),_0x2ff90a[_0x6592('0x54')][0x0]);}}break;case'=':_0x2862a1[_0x6592('0x64')](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x62'),_0x2ff90a[_0x6592('0x54')]);break;case _0x6592('0x6b'):if(_0x4d8414===_0x6592('0x63')){_0x2862a1[_0x6592('0x64')](_0x6592('0x65')+_0x6592('0x66'),'%'+_0x2ff90a['value']+'%');_0x2862a1['or'](_0x6592('0x67')+'\x20LIKE\x20?','%'+_0x2ff90a[_0x6592('0x54')]+'%');_0x2862a1['or'](_0x6592('0x68')+_0x6592('0x66'),'%'+_0x2ff90a[_0x6592('0x54')]+'%');}else{_0x2862a1['and'](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x66'),'%'+_0x2ff90a[_0x6592('0x54')]+'%');}break;case'>':_0x2862a1['and'](_0x2ff90a['tableAlias']+'.'+_0x4d8414+_0x6592('0x69'),_0x2ff90a[_0x6592('0x54')]);break;case'<':_0x2862a1[_0x6592('0x64')](_0x2ff90a[_0x6592('0x60')]+'.'+_0x4d8414+_0x6592('0x6a'),_0x2ff90a['value']);break;}}}});}else{var _0x299bbb=_(Object[_0x6592('0x34')](_0x21cf0e[_0x6592('0x35')]))[_0x6592('0x2a')](function(_0x45ba4f){return _0x39ee28[_0x6592('0x3a')](_0x45ba4f)?_0x45ba4f:undefined;})[_0x6592('0x6c')](function(_0x533df4){return!_[_0x6592('0x6d')](_0x533df4);})['value']();if(!_['isEmpty'](_0x299bbb)){_0x299bbb[_0x6592('0x2e')](function(_0x54fd2e){if(_0x54fd2e==='SmsAccountId'){_0x44ec5e[_0x6592('0x3d')]('i.SmsAccountId\x20IN\x20?',[][_0x6592('0x6e')](_0x21cf0e[_0x6592('0x35')][_0x54fd2e]));}else if(_0x54fd2e===_0x6592('0x53')){var _0x20e252=JSON[_0x6592('0x6f')](_0x21cf0e[_0x6592('0x35')][_0x54fd2e])[_0x6592('0x70')];var _0x27a83b=JSON[_0x6592('0x6f')](_0x21cf0e[_0x6592('0x35')][_0x54fd2e])[_0x6592('0x71')];_0x44ec5e[_0x6592('0x3d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x20e252,_0x27a83b);}else{if(_0x21cf0e['query'][_0x54fd2e]===_0x6592('0x72')){_0x44ec5e[_0x6592('0x3d')]('i.'+_0x54fd2e+_0x6592('0x73'));}else{_0x44ec5e[_0x6592('0x3d')]('i.'+_0x54fd2e+_0x6592('0x62'),_0x21cf0e[_0x6592('0x35')][_0x54fd2e]);}}});}if(_0x21cf0e['query'][_0x6592('0x6c')]){var _0x5a6927=_0x21cf0e[_0x6592('0x35')]['filter'][_0x6592('0x74')]('\x5c','\x5c\x5c')[_0x6592('0x74')]('\x27\x27',_0x6592('0x75'));if(qs[_0x6592('0x76')](_0x5a6927)){_0x2862a1['or'](_0x6592('0x77'),_0x5a6927+'%')['or']('i.phone\x20LIKE\x20?',_0x5a6927+'%');}else{var _0x24eb44=[];_0x5a6927[_0x6592('0x2d')]('\x20')[_0x6592('0x2e')](function(_0x48c1fc){_0x24eb44[_0x6592('0x2f')]('+'+_0x48c1fc[_0x6592('0x78')]());});var _0x4acdeb=_0x24eb44[_0x6592('0x79')]('\x20');_0x2862a1['or'](_0x6592('0x7a'),_0x4acdeb)['or'](_0x6592('0x7b'),_0x5a6927+'%');}}}_0x44ec5e[_0x6592('0x3d')](_0x2862a1);if(_0x42ad64[_0x6592('0x3b')]){_0x42ad64[_0x6592('0x3b')]['forEach'](function(_0x131f66){_0x44ec5e['order']('i.'+_0x131f66[0x0],_0x131f66[0x1]===_0x6592('0x7c')?![]:!![]);});}_0x44ec5e[_0x6592('0x7d')]('i.id');var _0x482f4f={'type':db[_0x6592('0x7e')][_0x6592('0x7f')]['SELECT'],'raw':!![]};var _0x3aa81b=_0x44ec5e[_0x6592('0x80')]()[_0x6592('0x40')](_0x6592('0x81'))[_0x6592('0x40')](_0x6592('0x82'),_0x6592('0x5e'));if(!_0x21cf0e[_0x6592('0x35')][_0x6592('0x52')]){if(_0x21cf0e[_0x6592('0x35')][_0x6592('0x83')]){if(_0x21cf0e[_0x6592('0x35')][_0x6592('0x83')]==0x1){_0x3aa81b['having'](_0x6592('0x84'));_0x44ec5e[_0x6592('0x85')](_0x6592('0x84'));}else{_0x3aa81b[_0x6592('0x85')](_0x6592('0x86'));_0x44ec5e[_0x6592('0x85')]('`unreadMessages`\x20>\x200');}}if(_0x21cf0e[_0x6592('0x35')][_0x6592('0x87')]){var _0x2315c4=_[_0x6592('0x5b')](_0x21cf0e[_0x6592('0x35')][_0x6592('0x87')])?_0x21cf0e[_0x6592('0x35')]['tag']:new Array(_0x21cf0e[_0x6592('0x35')][_0x6592('0x87')]);var _0x317a15=squel[_0x6592('0x51')]();_0x2315c4[_0x6592('0x2e')](function(_0x3105b5){_0x317a15['or'](_0x6592('0x88'),'%,'+_0x3105b5+',%');});_0x44ec5e[_0x6592('0x85')](_0x317a15);_0x3aa81b[_0x6592('0x4d')](_0x6592('0x89'),'it',_0x6592('0x8a'));_0x3aa81b[_0x6592('0x4d')](_0x6592('0x43'),'t',_0x6592('0x8b'));_0x3aa81b[_0x6592('0x3d')]('t.id\x20IN\x20?',_0x2315c4);}}else{var _0x3a1414=JSON[_0x6592('0x6f')](_0x21cf0e['query']['advancedFilter']);_[_0x6592('0x34')](_0x3a1414)[_0x6592('0x2e')](function(_0x40d83f){var _0x4d36ff=_0x3a1414[_0x40d83f];if(_0x40d83f===_0x6592('0x5d')){var _0x28aebb=_0x4d36ff[_0x6592('0x54')];var _0x36356d=squel[_0x6592('0x51')]();_0x28aebb[_0x6592('0x2e')](function(_0x477b89){_0x36356d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x477b89+',%');});_0x44ec5e[_0x6592('0x85')](_0x36356d);_0x3aa81b[_0x6592('0x4d')](_0x6592('0x8c'),'it','it.MailInteractionId\x20=\x20i.id');_0x3aa81b['left_join'](_0x6592('0x43'),'t','t.id\x20=\x20it.TagId');_0x3aa81b[_0x6592('0x3d')](_0x6592('0x8d'),_0x28aebb);}else if(_0x40d83f==='unreadMessages'){if(_0x4d36ff['value']['length']===0x1){if(_0x4d36ff[_0x6592('0x54')][0x0]===0x1){_0x3aa81b[_0x6592('0x85')](_0x6592('0x84'));_0x44ec5e[_0x6592('0x85')](_0x6592('0x84'));}else{_0x3aa81b[_0x6592('0x85')](_0x6592('0x86'));_0x44ec5e['having']('`unreadMessages`\x20>\x200');}}}});}db[_0x6592('0x8e')][_0x6592('0x35')](_0x3aa81b[_0x6592('0x78')](),_0x482f4f)[_0x6592('0x24')](function(_0xe3d8cb){_0x52119c[_0x6592('0x8f')]=_0xe3d8cb[_0x6592('0x5f')];if(_0x52119c['count']===0x0)return[];return db[_0x6592('0x8e')]['query'](_0x500bd1[_0x6592('0x78')](),_0x482f4f)['then'](function(_0x397b66){_0xd7f4c0=_[_0x6592('0x90')](_0x397b66,'id');_0x482f4f=_[_0x6592('0x91')](_0x482f4f,{'model':db[_0x6592('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x44ec5e[_0x6592('0x40')](_0x6592('0x82'),'unreadMessages');_0x44ec5e[_0x6592('0x40')](_0x6592('0x93'),_0x6592('0x94'));_0x44ec5e[_0x6592('0x40')](_0x6592('0x95'));_0x44ec5e[_0x6592('0x40')](_0x6592('0x65'),_0x6592('0x96'));_0x44ec5e[_0x6592('0x40')](_0x6592('0x67'),_0x6592('0x97'));_0x44ec5e[_0x6592('0x40')](_0x6592('0x68'),_0x6592('0x98'));_0x44ec5e[_0x6592('0x40')]('c.phone',_0x6592('0x99'));_0x44ec5e[_0x6592('0x40')](_0x6592('0x9a'),_0x6592('0x9b'));_0x44ec5e['field'](_0x6592('0x9c'),'Contact.fax');_0x44ec5e['field'](_0x6592('0x9d'),_0x6592('0x2c'));_0x44ec5e[_0x6592('0x4d')](_0x6592('0x89'),'it',_0x6592('0x8a'));_0x44ec5e[_0x6592('0x4d')](_0x6592('0x43'),'t',_0x6592('0x8b'));_0x44ec5e[_0x6592('0x1f')](_0x42ad64['limit']);_0x44ec5e[_0x6592('0x1e')](_0x42ad64[_0x6592('0x1e')]);return db[_0x6592('0x8e')]['query'](_0x44ec5e[_0x6592('0x78')](),_0x482f4f);})['then'](function(_0x31b98e){_0x418851[_0x6592('0x3d')](_0x6592('0x9e'),_[_0x6592('0x2a')](_0x31b98e,'id'));return db[_0x6592('0x8e')][_0x6592('0x35')](_0x418851['toString'](),_0x482f4f)['then'](function(_0x41fe37){var _0x262bec=_[_0x6592('0x9f')](_0x41fe37,_0x6592('0xa0'));var _0x1f51c3=[];_0x31b98e[_0x6592('0x2e')](function(_0x5435c6){_0x1f51c3[_0x6592('0x2f')](updateSmsInteraction(_0x5435c6,_0xd7f4c0,_0x262bec));});return BPromise[_0x6592('0xa1')](_0x1f51c3);});});})[_0x6592('0x24')](function(_0x196ff7){_0x52119c[_0x6592('0xa2')]=_0x196ff7;return _0x52119c;})[_0x6592('0x24')](respondWithFilteredResult(_0x4fc20c,_0x42ad64))[_0x6592('0x30')](handleError(_0x4fc20c,null));};exports[_0x6592('0xa3')]=function(_0x2b8aec,_0x477040){var _0x4f7b29={'raw':![],'where':{'id':_0x2b8aec[_0x6592('0xa4')]['id']}},_0x2df9bd={};_0x2df9bd[_0x6592('0x33')]=_[_0x6592('0x34')](db['SmsInteraction'][_0x6592('0x32')]);_0x2df9bd[_0x6592('0x35')]=_[_0x6592('0x34')](_0x2b8aec[_0x6592('0x35')]);_0x2df9bd[_0x6592('0x36')]=_[_0x6592('0x38')](_0x2df9bd[_0x6592('0x33')],_0x2df9bd[_0x6592('0x35')]);_0x4f7b29[_0x6592('0x37')]=_[_0x6592('0x38')](_0x2df9bd[_0x6592('0x33')],qs[_0x6592('0x39')](_0x2b8aec[_0x6592('0x35')][_0x6592('0x39')]));_0x4f7b29['attributes']=_0x4f7b29[_0x6592('0x37')][_0x6592('0x5f')]?_0x4f7b29['attributes']:_0x2df9bd[_0x6592('0x33')];if(_0x2b8aec['query']['includeAll']){_0x4f7b29['include']=[{'all':!![]}];}_0x4f7b29=_[_0x6592('0x91')]({},_0x4f7b29,_0x2b8aec[_0x6592('0xa5')]);return db['SmsInteraction'][_0x6592('0xa6')](_0x4f7b29)[_0x6592('0x24')](handleEntityNotFound(_0x477040,null))['then'](respondWithResult(_0x477040,null))['catch'](handleError(_0x477040,null));};exports['create']=function(_0x52f5a9,_0x444bdf){return db[_0x6592('0x92')][_0x6592('0xa7')](_0x52f5a9[_0x6592('0xa8')],{})['then'](respondWithResult(_0x444bdf,0xc9))[_0x6592('0x30')](handleError(_0x444bdf,null));};exports[_0x6592('0x23')]=function(_0x9285ca,_0x3e79c7){if(_0x9285ca[_0x6592('0xa8')]['id']){delete _0x9285ca['body']['id'];}return db[_0x6592('0x92')][_0x6592('0xa6')]({'where':{'id':_0x9285ca[_0x6592('0xa4')]['id']}})[_0x6592('0x24')](handleEntityNotFound(_0x3e79c7,null))[_0x6592('0x24')](saveUpdates(_0x9285ca[_0x6592('0xa8')],null))[_0x6592('0x24')](respondWithResult(_0x3e79c7,null))['catch'](handleError(_0x3e79c7,null));};exports['destroy']=function(_0xe1297f,_0x29da56){return db[_0x6592('0x92')][_0x6592('0xa6')]({'where':{'id':_0xe1297f['params']['id']}})['then'](handleEntityNotFound(_0x29da56,null))[_0x6592('0x24')](removeEntity(_0x29da56,null))[_0x6592('0x30')](handleError(_0x29da56,null));};exports['describe']=function(_0x52fbfd,_0x2033f4){return db[_0x6592('0x92')][_0x6592('0xa9')]()['then'](respondWithResult(_0x2033f4,null))['catch'](handleError(_0x2033f4,null));};exports[_0x6592('0xaa')]=function(_0x460b3f,_0x55d065,_0x70c7f7){return db['SmsMessage'][_0x6592('0xa6')]({'where':{'id':_0x460b3f[_0x6592('0xa4')]['id']}})['then'](handleEntityNotFound(_0x55d065,null))[_0x6592('0x24')](function(_0x17b627){if(_0x17b627){return _0x17b627[_0x6592('0xaa')](_0x460b3f[_0x6592('0xa8')][_0x6592('0xab')],_['omit'](_0x460b3f['body'],[_0x6592('0xab'),'id'])||{});}})[_0x6592('0x24')](respondWithResult(_0x55d065,null))[_0x6592('0x30')](handleError(_0x55d065,null));};exports[_0x6592('0xac')]=function(_0x50b172,_0x5cef50,_0x92a893){var _0x389a09={'raw':![],'where':{}};var _0x533582={};var _0x5224d8={'count':0x0,'rows':[]};return db[_0x6592('0x92')]['findOne']({'where':{'id':_0x50b172[_0x6592('0xa4')]['id']}})[_0x6592('0x24')](handleEntityNotFound(_0x5cef50,null))['then'](function(_0x2c184b){if(_0x2c184b){_0x533582[_0x6592('0x33')]=_[_0x6592('0x34')](db[_0x6592('0xad')][_0x6592('0x32')]);_0x533582[_0x6592('0x35')]=_[_0x6592('0x34')](_0x50b172['query']);_0x533582['filters']=_[_0x6592('0x38')](_0x533582[_0x6592('0x33')],_0x533582[_0x6592('0x35')]);_0x389a09['attributes']=_['intersection'](_0x533582[_0x6592('0x33')],qs['fields'](_0x50b172[_0x6592('0x35')]['fields']));_0x389a09[_0x6592('0x37')]=_0x389a09[_0x6592('0x37')][_0x6592('0x5f')]?_0x389a09[_0x6592('0x37')]:_0x533582['model'];if(!_0x50b172[_0x6592('0x35')][_0x6592('0x3a')](_0x6592('0xae'))){_0x389a09[_0x6592('0x1f')]=qs[_0x6592('0x1f')](_0x50b172[_0x6592('0x35')][_0x6592('0x1f')]);_0x389a09[_0x6592('0x1e')]=qs[_0x6592('0x1e')](_0x50b172[_0x6592('0x35')][_0x6592('0x1e')]);}_0x389a09[_0x6592('0x3b')]=qs['sort'](_0x50b172[_0x6592('0x35')][_0x6592('0x3c')]);_0x389a09[_0x6592('0x3d')]=qs[_0x6592('0x36')](_[_0x6592('0x3e')](_0x50b172[_0x6592('0x35')],_0x533582[_0x6592('0x36')]));_0x389a09['where'][_0x6592('0xa0')]=_0x2c184b['id'];if(_0x50b172[_0x6592('0x35')][_0x6592('0x6c')]){_0x389a09['where']=_[_0x6592('0x91')](_0x389a09[_0x6592('0x3d')],{'$or':_['map'](_0x389a09[_0x6592('0x37')],function(_0x35baaf){var _0x2be1f1={};_0x2be1f1[_0x35baaf]={'$like':'%'+_0x50b172[_0x6592('0x35')][_0x6592('0x6c')]+'%'};return _0x2be1f1;})});}if(_0x50b172[_0x6592('0x35')][_0x6592('0x70')]){var _0x4a9436=_0x50b172['query'][_0x6592('0x70')][_0x6592('0x2d')](',');var _0x328728={};_0x328728[_0x4a9436[0x0]]={'$gte':moment(_0x4a9436[0x1])[_0x6592('0x58')](_0x6592('0xaf'))};_0x389a09['where']=_[_0x6592('0x91')](_0x389a09[_0x6592('0x3d')],_0x328728);}_0x389a09=_[_0x6592('0x91')]({},_0x389a09,_0x50b172[_0x6592('0xa5')]);return db[_0x6592('0xad')][_0x6592('0x8f')]({'where':_0x389a09[_0x6592('0x3d')]})[_0x6592('0x24')](function(_0x28d6ee){_0x5224d8[_0x6592('0x8f')]=_0x28d6ee;if(_0x50b172[_0x6592('0x35')][_0x6592('0xb0')]){_0x389a09[_0x6592('0xb1')]=[{'all':!![]}];}return db[_0x6592('0xad')]['findAll'](_0x389a09);})['then'](function(_0x5de773){_0x5224d8[_0x6592('0xa2')]=_0x5de773;return _0x5224d8;});}})[_0x6592('0x24')](respondWithFilteredResult(_0x5cef50,_0x389a09))[_0x6592('0x30')](handleError(_0x5cef50,null));};exports[_0x6592('0xb2')]=function(_0x45c999,_0x1a99d7,_0x5edb39){return db[_0x6592('0x92')][_0x6592('0xa6')]({'where':{'id':_0x45c999[_0x6592('0xa4')]['id']}})[_0x6592('0x24')](handleEntityNotFound(_0x1a99d7,null))[_0x6592('0x24')](function(_0x511ef9){if(_0x511ef9){return _0x511ef9['setTags'](_0x45c999[_0x6592('0xa8')][_0x6592('0xab')],_['omit'](_0x45c999[_0x6592('0xa8')],[_0x6592('0xab'),'id'])||{})['spread'](function(){return db[_0x6592('0xb3')][_0x6592('0xb4')]({'attributes':['id','name',_0x6592('0x41')],'where':{'id':_0x45c999[_0x6592('0xa8')][_0x6592('0xab')]}});})[_0x6592('0x24')](function(_0x46ed60){socket[_0x6592('0xb5')](_0x6592('0xb6'),{'id':Number(_0x45c999[_0x6592('0xa4')]['id']),'tags':_0x46ed60||[]});return{'id':Number(_0x45c999[_0x6592('0xa4')]['id']),'tags':_0x46ed60||[]};});}})['then'](respondWithResult(_0x1a99d7,null))[_0x6592('0x30')](handleError(_0x1a99d7,null));};exports['removeTags']=function(_0x31a47b,_0x47e23a,_0xe82b1d){return db[_0x6592('0x92')]['find']({'where':{'id':_0x31a47b[_0x6592('0xa4')]['id']}})[_0x6592('0x24')](handleEntityNotFound(_0x47e23a,null))[_0x6592('0x24')](function(_0x3a8f7a){if(_0x3a8f7a){return _0x3a8f7a['removeTags'](_0x31a47b[_0x6592('0x35')][_0x6592('0xab')]);}})[_0x6592('0x24')](respondWithStatusCode(_0x47e23a,null))[_0x6592('0x30')](handleError(_0x47e23a,null));};exports['download']=function(_0x3e307c,_0x241131){var _0x1a49a9=moment()[_0x6592('0xb7')]()[_0x6592('0x78')]();var _0x5ad584=path['join'](config[_0x6592('0xb8')],_0x6592('0xb9'),_0x6592('0xba'),_0x6592('0xbb'));var _0x207a45=path['join'](config[_0x6592('0xb8')],_0x6592('0xb9'),_0x6592('0xba'),_0x6592('0xbc'));var _0x3029f4=path[_0x6592('0x79')](_0x5ad584,_0x1a49a9);var _0x23b36d=util[_0x6592('0x58')]('transcript-%d-%s.zip',_0x3e307c[_0x6592('0xa4')]['id'],_0x1a49a9);var _0x4e5be9=path[_0x6592('0x79')](_0x5ad584,_0x23b36d);var _0x4086a9=![];return db[_0x6592('0x92')][_0x6592('0xa6')]({'where':{'id':_0x3e307c[_0x6592('0xa4')]['id']},'include':[{'model':db[_0x6592('0xad')],'as':'Messages','attributes':['id','body',_0x6592('0x53'),_0x6592('0xbd'),_0x6592('0xbe')],'include':[{'model':db['User'],'as':_0x6592('0xbf'),'attributes':['id',_0x6592('0xc0')],'raw':!![]},{'model':db[_0x6592('0xc1')],'as':_0x6592('0xc2'),'attributes':['id','firstName',_0x6592('0xc3')],'raw':!![]}]},{'model':db[_0x6592('0xc4')],'as':_0x6592('0xc5'),'attributes':['id',_0x6592('0x27')]},{'model':db[_0x6592('0xbf')],'as':_0x6592('0xc6'),'attributes':['id',_0x6592('0xc0')]}]})[_0x6592('0x24')](handleEntityNotFound(_0x241131,null))['then'](function(_0x569342){if(_0x569342){var _0x50b954=_0x569342['get']({'plain':!![]});_0x4086a9=!![];var _0x428c02={'format':'A4','border':_0x6592('0xc7'),'header':{'height':_0x6592('0xc8'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x6592('0xc9'),'contents':{'default':util[_0x6592('0x58')](_0x6592('0xca'),util[_0x6592('0x58')](_0x6592('0xcb'),'Sms',_0x50b954['id']),moment()[_0x6592('0x58')](_0x6592('0xcc'))[_0x6592('0x78')]())}}};fs[_0x6592('0xcd')](_0x3029f4);var _0x1ad1a2={'channel':_0x6592('0xce'),'account':_0x50b954[_0x6592('0xc5')][_0x6592('0x27')],'agent':_0x50b954[_0x6592('0xc6')]?_0x50b954[_0x6592('0xc6')]['fullname']:_0x6592('0xcf'),'createdAt':moment(_0x50b954[_0x6592('0x53')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6592('0x78')](),'closedAt':_0x50b954[_0x6592('0xd0')]?moment(_0x50b954[_0x6592('0xd1')])[_0x6592('0x58')](_0x6592('0xaf'))[_0x6592('0x78')]():'','disposition':_0x50b954[_0x6592('0xd2')],'messages':_(_0x50b954['Messages'])['filter']({'secret':![]})[_0x6592('0x2a')](function(_0x44ae51){return{'date':moment(_0x44ae51[_0x6592('0x53')])[_0x6592('0x58')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x44ae51[_0x6592('0xbd')]===_0x6592('0xd3')?_0x44ae51['User']?_0x44ae51[_0x6592('0xbf')]['fullname']:_0x6592('0xd4'):_0x44ae51['Contact']['firstName']+(_0x44ae51[_0x6592('0xc2')]['lastName']?'\x20'+_0x44ae51[_0x6592('0xc2')][_0x6592('0xc3')]:''),'body':_0x44ae51[_0x6592('0xa8')],'direction':_0x44ae51[_0x6592('0xbd')]===_0x6592('0xd3')?'A':'C','secret':_0x44ae51[_0x6592('0xbe')]};})[_0x6592('0x54')]()};return ejs[_0x6592('0xd5')](path[_0x6592('0x79')](config[_0x6592('0xb8')],_0x6592('0xb9'),'views',_0x6592('0xd6')),{'interaction':_0x1ad1a2})['then'](function(_0x56164a){return new BPromise(function(_0x27fc77,_0xbf1670){pdf[_0x6592('0xa7')](_0x56164a,_0x428c02)[_0x6592('0xd7')](path[_0x6592('0x79')](_0x3029f4,_0x6592('0xd8')+_0x50b954['id']+'-'+_0x1a49a9+_0x6592('0xd9')),function(_0x274b5c,_0x273466){if(_0x274b5c)return _0xbf1670(_0x274b5c);_0x27fc77(_0x273466);});});});}})['then'](function(){if(_0x4086a9){return new BPromise(function(_0x53df64,_0x3df60a){zipdir(_0x3029f4,{'saveTo':_0x4e5be9},function(_0x2e4d7f,_0x413933){if(_0x2e4d7f)return _0x3df60a(_0x2e4d7f);return _0x53df64(_0x413933);});})[_0x6592('0x24')](function(){return new BPromise(function(_0x3f3f54,_0x1cf74a){rimraf(_0x3029f4,function(_0x54b35d){if(_0x54b35d)_0x1cf74a(_0x54b35d);return _0x3f3f54();});});})[_0x6592('0x24')](function(){return _0x241131[_0x6592('0xda')](_0x4e5be9,_0x23b36d,function(_0xf807b2){if(_0xf807b2){console[_0x6592('0xdb')]('err',_0xf807b2);}else{fs[_0x6592('0xdc')](_0x4e5be9);}});});}else{return _0x241131[_0x6592('0x1a')](0xc8);}})[_0x6592('0x30')](handleError(_0x241131,null));}; \ No newline at end of file +var _0x4d86=['Content-Range','apply','reject','save','update','then','destroy','error','name','Users','map','TagIds','Tags','split','push','catch','SmsInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','parse','dateStart','startOf','utc','format','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','unreadMessages','value','tableAlias','\x20=\x20?','LIKE','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20IN\x20?','ContactId','c.firstName','\x20<\x20?','hasOwnProperty','filter','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','toString','count','keyBy','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.SmsInteractionId\x20=\x20i.id','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','create','body','find','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','secret','User','Contact','firstName','lastName','SmsAccount','Account','Owner','fullname','get','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','YYYY-MM-DD','Sms','closedAt','direction','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','end','status','json','offset','set'];(function(_0x4236ea,_0x13c72e){var _0x203118=function(_0x3d6c3a){while(--_0x3d6c3a){_0x4236ea['push'](_0x4236ea['shift']());}};_0x203118(++_0x13c72e);}(_0x4d86,0x1a5));var _0x64d8=function(_0x12926f,_0x5f13fd){_0x12926f=_0x12926f-0x0;var _0x120af7=_0x4d86[_0x12926f];return _0x120af7;};'use strict';var pdf=require(_0x64d8('0x0'));var emlformat=require(_0x64d8('0x1'));var rimraf=require(_0x64d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64d8('0x3'));var rp=require('request-promise');var moment=require(_0x64d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x64d8('0x5'));var util=require(_0x64d8('0x6'));var path=require(_0x64d8('0x7'));var sox=require(_0x64d8('0x8'));var csv=require(_0x64d8('0x9'));var ejs=require(_0x64d8('0xa'));var fs=require('fs');var _=require(_0x64d8('0xb'));var squel=require('squel');var crypto=require(_0x64d8('0xc'));var jsforce=require(_0x64d8('0xd'));var deskjs=require(_0x64d8('0xe'));var toCsv=require(_0x64d8('0x9'));var querystring=require(_0x64d8('0xf'));var Papa=require(_0x64d8('0x10'));var Redis=require(_0x64d8('0x11'));var authService=require(_0x64d8('0x12'));var qs=require(_0x64d8('0x13'));var hardwareService=require(_0x64d8('0x14'));var logger=require(_0x64d8('0x15'))(_0x64d8('0x16'));var utils=require(_0x64d8('0x17'));var config=require(_0x64d8('0x18'));var db=require(_0x64d8('0x19'))['db'];config[_0x64d8('0x1a')]=_[_0x64d8('0x1b')](config['redis'],{'host':_0x64d8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64d8('0x1a')]));require(_0x64d8('0x1d'))[_0x64d8('0x1e')](socket);function respondWithStatusCode(_0x10635c,_0x4faad0){_0x4faad0=_0x4faad0||0xcc;return function(_0x36b63d){if(_0x36b63d){return _0x10635c[_0x64d8('0x1f')](_0x4faad0);}return _0x10635c['status'](_0x4faad0)[_0x64d8('0x20')]();};}function respondWithResult(_0x5be8fb,_0x240b35){_0x240b35=_0x240b35||0xc8;return function(_0x283bb8){if(_0x283bb8){return _0x5be8fb[_0x64d8('0x21')](_0x240b35)[_0x64d8('0x22')](_0x283bb8);}};}function respondWithFilteredResult(_0x370c1e,_0x56a7fa){return function(_0x4b4694){if(_0x4b4694){var _0x2f7a0b=_0x4b4694['count'],_0x4d98fa=_0x56a7fa[_0x64d8('0x23')],_0xe4119d=_0x56a7fa[_0x64d8('0x23')]+_0x56a7fa['limit'],_0x440f55;if(_0xe4119d>=_0x2f7a0b){_0xe4119d=_0x2f7a0b;_0x440f55=0xc8;}else{_0x440f55=0xce;}_0x370c1e['status'](_0x440f55);return _0x370c1e[_0x64d8('0x24')](_0x64d8('0x25'),_0x4d98fa+'-'+_0xe4119d+'/'+_0x2f7a0b)[_0x64d8('0x22')](_0x4b4694);}return null;};}function patchUpdates(_0x392492){return function(_0x18ea40){try{jsonpatch[_0x64d8('0x26')](_0x18ea40,_0x392492,!![]);}catch(_0x152266){return BPromise[_0x64d8('0x27')](_0x152266);}return _0x18ea40[_0x64d8('0x28')]();};}function saveUpdates(_0x3c32fd,_0x6961b5){return function(_0x35d752){if(_0x35d752){return _0x35d752[_0x64d8('0x29')](_0x3c32fd)[_0x64d8('0x2a')](function(_0x3b396e){return _0x3b396e;});}return null;};}function removeEntity(_0x54cda1,_0xc60ac3){return function(_0x560cfb){if(_0x560cfb){return _0x560cfb[_0x64d8('0x2b')]()[_0x64d8('0x2a')](function(){_0x54cda1[_0x64d8('0x21')](0xcc)[_0x64d8('0x20')]();});}};}function handleEntityNotFound(_0x1fb60d,_0x172393){return function(_0x1329f8){if(!_0x1329f8){_0x1fb60d[_0x64d8('0x1f')](0x194);}return _0x1329f8;};}function handleError(_0x243346,_0x7cecd0){_0x7cecd0=_0x7cecd0||0x1f4;return function(_0x3a8548){logger[_0x64d8('0x2c')](_0x3a8548['stack']);if(_0x3a8548[_0x64d8('0x2d')]){delete _0x3a8548[_0x64d8('0x2d')];}_0x243346[_0x64d8('0x21')](_0x7cecd0)['send'](_0x3a8548);};}function getInteractionUsers(_0x24d1d1,_0x3e7a82){return new BPromise(function(_0x371bba,_0x2e86e3){try{if(_0x3e7a82[_0x24d1d1['id']]){_0x24d1d1[_0x64d8('0x2e')]=_[_0x64d8('0x2f')](_0x3e7a82[_0x24d1d1['id']],function(_0x449602){return{'id':_0x449602['id']};});}}catch(_0x4c5b80){_0x2e86e3(_0x4c5b80);}_0x371bba(_0x24d1d1);});}function getInteractionTags(_0x538ef3,_0x462898){return new BPromise(function(_0x3c79d5,_0x3c8cd4){try{if(_0x538ef3[_0x64d8('0x30')]){_0x538ef3[_0x64d8('0x31')]=[];_0x538ef3[_0x64d8('0x30')][_0x64d8('0x32')](',')['forEach'](function(_0x1926d8){_0x538ef3['Tags'][_0x64d8('0x33')](_0x462898[_0x1926d8]);});}delete _0x538ef3[_0x64d8('0x30')];}catch(_0xaf2228){_0x3c8cd4(_0xaf2228);}_0x3c79d5(_0x538ef3);});}function updateSmsInteraction(_0x42c2de,_0x292ceb,_0x427a49){return new BPromise(function(_0x9a5cf4,_0x5760b4){return getInteractionUsers(_0x42c2de,_0x427a49)['then'](function(_0x230d64){return getInteractionTags(_0x230d64,_0x292ceb);})[_0x64d8('0x2a')](function(_0x54afe3){_0x9a5cf4(_0x54afe3);})[_0x64d8('0x34')](function(_0x2e714a){_0x5760b4(_0x2e714a);});});}exports['index']=function(_0x4c68d3,_0x1eb577){var _0x40e63b={},_0x5bee62={},_0x59195e={'count':0x0,'rows':[]};var _0x72367a=db[_0x64d8('0x35')][_0x64d8('0x36')];_0x5bee62[_0x64d8('0x37')]=_[_0x64d8('0x38')](_0x72367a);_0x5bee62[_0x64d8('0x39')]=_[_0x64d8('0x38')](_0x4c68d3['query']);_0x5bee62[_0x64d8('0x3a')]=_['intersection'](_0x5bee62[_0x64d8('0x37')],_0x5bee62[_0x64d8('0x39')]);_0x40e63b['attributes']=_[_0x64d8('0x3b')](_0x5bee62['model'],qs[_0x64d8('0x3c')](_0x4c68d3['query'][_0x64d8('0x3c')]));_0x40e63b[_0x64d8('0x3d')]=_0x40e63b[_0x64d8('0x3d')][_0x64d8('0x3e')]?_0x40e63b[_0x64d8('0x3d')]:_0x5bee62[_0x64d8('0x37')];if(!_0x4c68d3[_0x64d8('0x39')]['hasOwnProperty'](_0x64d8('0x3f'))){_0x40e63b['limit']=qs[_0x64d8('0x40')](_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x40')]);_0x40e63b[_0x64d8('0x23')]=qs[_0x64d8('0x23')](_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x23')]);}_0x40e63b[_0x64d8('0x41')]=qs[_0x64d8('0x42')](_0x4c68d3['query'][_0x64d8('0x42')]);_0x40e63b[_0x64d8('0x43')]=qs['filters'](_[_0x64d8('0x44')](_0x4c68d3[_0x64d8('0x39')],_0x5bee62[_0x64d8('0x3a')]));var _0x2ad5f8=[];var _0x4ca8a7=squel[_0x64d8('0x45')]()['field']('id')[_0x64d8('0x46')]('name')[_0x64d8('0x46')](_0x64d8('0x47'))[_0x64d8('0x48')](_0x64d8('0x49'));var _0x25a994=squel[_0x64d8('0x45')]()[_0x64d8('0x46')](_0x64d8('0x4a'))['from'](_0x64d8('0x4b'),'me')[_0x64d8('0x43')](_0x64d8('0x4c'))[_0x64d8('0x43')](_0x64d8('0x4d'))[_0x64d8('0x43')]('me.read\x20=\x20false');var _0x39948e=squel[_0x64d8('0x45')]()[_0x64d8('0x46')]('u.id')[_0x64d8('0x46')](_0x64d8('0x4e'))[_0x64d8('0x48')](_0x64d8('0x4f'),'ui')['left_join'](_0x64d8('0x50'),'u',_0x64d8('0x51'));var _0x17c617=squel[_0x64d8('0x45')]()[_0x64d8('0x48')](_0x64d8('0x52'),'i')[_0x64d8('0x53')](_0x64d8('0x54'),'c',_0x64d8('0x55'))[_0x64d8('0x53')]('users','o',_0x64d8('0x56'))[_0x64d8('0x53')](_0x64d8('0x57'),'a',_0x64d8('0x58'))['left_join'](_0x64d8('0x4b'),'me',_0x64d8('0x59'));var _0x428e4e=squel['expr']();if(_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x5a')]){var _0x4aa3d5=JSON[_0x64d8('0x5b')](_0x4c68d3['query'][_0x64d8('0x5a')]);_[_0x64d8('0x38')](_0x4aa3d5)['forEach'](function(_0x2820a6){var _0x2f4567=_0x4aa3d5[_0x2820a6];if(_0x2820a6==='createdAt'){var _0x1bf40e=moment(_0x2f4567['value'][_0x64d8('0x5c')])[_0x64d8('0x5d')]('day')[_0x64d8('0x5e')]()[_0x64d8('0x5f')]();var _0x25cf68=moment(_0x25cf68)[_0x64d8('0x5e')]()['endOf'](_0x64d8('0x60'))[_0x64d8('0x5f')]();_0x428e4e[_0x64d8('0x61')](_0x64d8('0x62'),_0x1bf40e,_0x25cf68);}else{if(_[_0x64d8('0x63')](_0x2f4567['condition'])){_0x2f4567[_0x64d8('0x64')][_0x64d8('0x65')](function(_0x2fb19e){switch(_0x2f4567['condition']['value']){case'IS':if(_0x2820a6!==_0x64d8('0x66')&&_0x2820a6!==_0x64d8('0x67')){if(_[_0x64d8('0x63')](_0x2f4567[_0x64d8('0x68')])&&_0x2f4567[_0x64d8('0x68')][_0x64d8('0x3e')]>0x1){_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+'\x20IN\x20?',_0x2f4567[_0x64d8('0x68')]);}else{_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x6a'),_0x2f4567['value'][0x0]);}}break;case'=':_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x6a'),_0x2f4567[_0x64d8('0x68')]);break;case _0x64d8('0x6b'):if(_0x2820a6==='ContactId'){_0x428e4e[_0x64d8('0x61')]('c.firstName'+_0x64d8('0x6c'),'%'+_0x2f4567['value']+'%');_0x428e4e['or'](_0x64d8('0x6d')+_0x64d8('0x6c'),'%'+_0x2f4567['value']+'%');_0x428e4e['or'](_0x64d8('0x6e')+_0x64d8('0x6c'),'%'+_0x2f4567['value']+'%');}else{_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x6c'),'%'+_0x2f4567[_0x64d8('0x68')]+'%');}break;case'>':_0x428e4e['and'](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x6f'),_0x2f4567['value']);break;case'<':_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+'\x20<\x20?',_0x2f4567[_0x64d8('0x68')]);break;}});}else{switch(_0x2f4567[_0x64d8('0x64')][_0x64d8('0x68')]){case'IS':if(_0x2820a6!=='TagId'&&_0x2820a6!=='unreadMessages'){if(_[_0x64d8('0x63')](_0x2f4567[_0x64d8('0x68')])&&_0x2f4567[_0x64d8('0x68')][_0x64d8('0x3e')]>0x1){_0x428e4e['and'](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x70'),_0x2f4567['value']);}else{_0x428e4e[_0x64d8('0x61')](_0x2f4567['tableAlias']+'.'+_0x2820a6+_0x64d8('0x6a'),_0x2f4567[_0x64d8('0x68')][0x0]);}}break;case'=':_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+'\x20=\x20?',_0x2f4567[_0x64d8('0x68')]);break;case _0x64d8('0x6b'):if(_0x2820a6===_0x64d8('0x71')){_0x428e4e['and'](_0x64d8('0x72')+_0x64d8('0x6c'),'%'+_0x2f4567[_0x64d8('0x68')]+'%');_0x428e4e['or'](_0x64d8('0x6d')+'\x20LIKE\x20?','%'+_0x2f4567['value']+'%');_0x428e4e['or'](_0x64d8('0x6e')+'\x20LIKE\x20?','%'+_0x2f4567[_0x64d8('0x68')]+'%');}else{_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x6c'),'%'+_0x2f4567[_0x64d8('0x68')]+'%');}break;case'>':_0x428e4e[_0x64d8('0x61')](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+'\x20>\x20?',_0x2f4567['value']);break;case'<':_0x428e4e['and'](_0x2f4567[_0x64d8('0x69')]+'.'+_0x2820a6+_0x64d8('0x73'),_0x2f4567['value']);break;}}}});}else{var _0x5e1aaa=_(Object[_0x64d8('0x38')](_0x4c68d3[_0x64d8('0x39')]))[_0x64d8('0x2f')](function(_0x148f90){return _0x72367a[_0x64d8('0x74')](_0x148f90)?_0x148f90:undefined;})[_0x64d8('0x75')](function(_0x1b3eaa){return!_[_0x64d8('0x76')](_0x1b3eaa);})[_0x64d8('0x68')]();if(!_[_0x64d8('0x77')](_0x5e1aaa)){_0x5e1aaa[_0x64d8('0x65')](function(_0x3ef5ca){if(_0x3ef5ca==='SmsAccountId'){_0x17c617[_0x64d8('0x43')](_0x64d8('0x78'),[][_0x64d8('0x79')](_0x4c68d3[_0x64d8('0x39')][_0x3ef5ca]));}else if(_0x3ef5ca===_0x64d8('0x7a')){var _0x299f30=JSON[_0x64d8('0x5b')](_0x4c68d3[_0x64d8('0x39')][_0x3ef5ca])[_0x64d8('0x7b')];var _0x4c65f5=JSON[_0x64d8('0x5b')](_0x4c68d3['query'][_0x3ef5ca])[_0x64d8('0x7c')];_0x17c617[_0x64d8('0x43')](_0x64d8('0x62'),_0x299f30,_0x4c65f5);}else{if(_0x4c68d3['query'][_0x3ef5ca]===_0x64d8('0x7d')){_0x17c617['where']('i.'+_0x3ef5ca+'\x20IS\x20NULL');}else{_0x17c617['where']('i.'+_0x3ef5ca+'\x20=\x20?',_0x4c68d3[_0x64d8('0x39')][_0x3ef5ca]);}}});}if(_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x75')]){var _0x5013ce=_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x75')][_0x64d8('0x7e')]('\x5c','\x5c\x5c')[_0x64d8('0x7e')]('\x27\x27',_0x64d8('0x7f'));if(qs[_0x64d8('0x80')](_0x5013ce)){_0x428e4e['or'](_0x64d8('0x81'),_0x5013ce+'%')['or'](_0x64d8('0x82'),_0x5013ce+'%');}else{var _0xeed8d1=[];_0x5013ce[_0x64d8('0x32')]('\x20')[_0x64d8('0x65')](function(_0xcfed1b){_0xeed8d1[_0x64d8('0x33')]('+'+_0xcfed1b['toString']());});var _0x430176=_0xeed8d1[_0x64d8('0x83')]('\x20');_0x428e4e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x430176)['or'](_0x64d8('0x84'),_0x5013ce+'%');}}}_0x17c617['where'](_0x428e4e);if(_0x40e63b[_0x64d8('0x41')]){_0x40e63b[_0x64d8('0x41')]['forEach'](function(_0x46c8f5){_0x17c617[_0x64d8('0x41')]('i.'+_0x46c8f5[0x0],_0x46c8f5[0x1]==='DESC'?![]:!![]);});}_0x17c617[_0x64d8('0x85')](_0x64d8('0x86'));var _0x11610c={'type':db['Sequelize']['QueryTypes'][_0x64d8('0x87')],'raw':!![]};var _0x105b5d=_0x17c617[_0x64d8('0x88')]()['field'](_0x64d8('0x4a'))['field'](_0x64d8('0x89'),_0x64d8('0x67'));if(!_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x5a')]){if(_0x4c68d3['query'][_0x64d8('0x8a')]){if(_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x8a')]==0x1){_0x105b5d[_0x64d8('0x8b')](_0x64d8('0x8c'));_0x17c617['having'](_0x64d8('0x8c'));}else{_0x105b5d[_0x64d8('0x8b')](_0x64d8('0x8d'));_0x17c617[_0x64d8('0x8b')](_0x64d8('0x8d'));}}if(_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x8e')]){var _0x403b2c=_[_0x64d8('0x63')](_0x4c68d3['query']['tag'])?_0x4c68d3[_0x64d8('0x39')][_0x64d8('0x8e')]:new Array(_0x4c68d3['query'][_0x64d8('0x8e')]);var _0x416c58=squel[_0x64d8('0x8f')]();_0x403b2c[_0x64d8('0x65')](function(_0xf9a7e8){_0x416c58['or'](_0x64d8('0x90'),'%,'+_0xf9a7e8+',%');});_0x17c617[_0x64d8('0x8b')](_0x416c58);_0x105b5d['left_join'](_0x64d8('0x91'),'it','it.SmsInteractionId\x20=\x20i.id');_0x105b5d['left_join'](_0x64d8('0x49'),'t',_0x64d8('0x92'));_0x105b5d[_0x64d8('0x43')](_0x64d8('0x93'),_0x403b2c);}}else{var _0x4aa3d5=JSON[_0x64d8('0x5b')](_0x4c68d3[_0x64d8('0x39')]['advancedFilter']);_[_0x64d8('0x38')](_0x4aa3d5)[_0x64d8('0x65')](function(_0x2e141f){var _0x1232e0=_0x4aa3d5[_0x2e141f];if(_0x2e141f==='TagId'){var _0x20dfdd=_0x1232e0[_0x64d8('0x68')];var _0x16cd6d=squel[_0x64d8('0x8f')]();_0x20dfdd[_0x64d8('0x65')](function(_0x182108){_0x16cd6d['or'](_0x64d8('0x90'),'%,'+_0x182108+',%');});_0x17c617[_0x64d8('0x8b')](_0x16cd6d);_0x105b5d[_0x64d8('0x53')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x105b5d['left_join'](_0x64d8('0x49'),'t','t.id\x20=\x20it.TagId');_0x105b5d['where']('t.id\x20IN\x20?',_0x20dfdd);}else if(_0x2e141f===_0x64d8('0x67')){if(_0x1232e0[_0x64d8('0x68')][_0x64d8('0x3e')]===0x1){if(_0x1232e0['value'][0x0]===0x1){_0x105b5d[_0x64d8('0x8b')](_0x64d8('0x8c'));_0x17c617[_0x64d8('0x8b')](_0x64d8('0x8c'));}else{_0x105b5d[_0x64d8('0x8b')](_0x64d8('0x8d'));_0x17c617[_0x64d8('0x8b')](_0x64d8('0x8d'));}}}});}db[_0x64d8('0x94')][_0x64d8('0x39')](_0x105b5d[_0x64d8('0x95')](),_0x11610c)['then'](function(_0x52c003){_0x59195e[_0x64d8('0x96')]=_0x52c003[_0x64d8('0x3e')];if(_0x59195e[_0x64d8('0x96')]===0x0)return[];return db[_0x64d8('0x94')][_0x64d8('0x39')](_0x4ca8a7[_0x64d8('0x95')](),_0x11610c)[_0x64d8('0x2a')](function(_0xf92678){_0x2ad5f8=_[_0x64d8('0x97')](_0xf92678,'id');_0x11610c=_[_0x64d8('0x98')](_0x11610c,{'model':db[_0x64d8('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x17c617[_0x64d8('0x46')]('COUNT(me.id)',_0x64d8('0x67'));_0x17c617[_0x64d8('0x46')](_0x64d8('0x99'),_0x64d8('0x9a'));_0x17c617[_0x64d8('0x46')](_0x64d8('0x9b'));_0x17c617[_0x64d8('0x46')](_0x64d8('0x72'),_0x64d8('0x9c'));_0x17c617[_0x64d8('0x46')]('c.lastName',_0x64d8('0x9d'));_0x17c617[_0x64d8('0x46')](_0x64d8('0x6e'),_0x64d8('0x9e'));_0x17c617[_0x64d8('0x46')](_0x64d8('0x9f'),'Contact.phone');_0x17c617[_0x64d8('0x46')](_0x64d8('0xa0'),'Contact.mobile');_0x17c617['field'](_0x64d8('0xa1'),_0x64d8('0xa2'));_0x17c617[_0x64d8('0x46')](_0x64d8('0xa3'),'TagIds');_0x17c617['left_join']('sms_interaction_has_tags','it',_0x64d8('0xa4'));_0x17c617[_0x64d8('0x53')](_0x64d8('0x49'),'t',_0x64d8('0x92'));_0x17c617[_0x64d8('0x40')](_0x40e63b[_0x64d8('0x40')]);_0x17c617[_0x64d8('0x23')](_0x40e63b['offset']);return db[_0x64d8('0x94')][_0x64d8('0x39')](_0x17c617[_0x64d8('0x95')](),_0x11610c);})[_0x64d8('0x2a')](function(_0x121ef5){_0x39948e[_0x64d8('0x43')](_0x64d8('0xa5'),_[_0x64d8('0x2f')](_0x121ef5,'id'));return db['sequelize']['query'](_0x39948e[_0x64d8('0x95')](),_0x11610c)[_0x64d8('0x2a')](function(_0xff823c){var _0x551f68=_[_0x64d8('0xa6')](_0xff823c,_0x64d8('0xa7'));var _0x17e940=[];_0x121ef5[_0x64d8('0x65')](function(_0x258312){_0x17e940[_0x64d8('0x33')](updateSmsInteraction(_0x258312,_0x2ad5f8,_0x551f68));});return BPromise[_0x64d8('0xa8')](_0x17e940);});});})[_0x64d8('0x2a')](function(_0x59283c){_0x59195e[_0x64d8('0xa9')]=_0x59283c;return _0x59195e;})[_0x64d8('0x2a')](respondWithFilteredResult(_0x1eb577,_0x40e63b))[_0x64d8('0x34')](handleError(_0x1eb577,null));};exports[_0x64d8('0xaa')]=function(_0xdcbea2,_0x589e53){var _0x1bc611={'raw':![],'where':{'id':_0xdcbea2[_0x64d8('0xab')]['id']}},_0x54d7bb={};_0x54d7bb[_0x64d8('0x37')]=_[_0x64d8('0x38')](db[_0x64d8('0x35')]['rawAttributes']);_0x54d7bb['query']=_[_0x64d8('0x38')](_0xdcbea2['query']);_0x54d7bb[_0x64d8('0x3a')]=_['intersection'](_0x54d7bb[_0x64d8('0x37')],_0x54d7bb[_0x64d8('0x39')]);_0x1bc611['attributes']=_[_0x64d8('0x3b')](_0x54d7bb[_0x64d8('0x37')],qs[_0x64d8('0x3c')](_0xdcbea2['query']['fields']));_0x1bc611[_0x64d8('0x3d')]=_0x1bc611[_0x64d8('0x3d')]['length']?_0x1bc611[_0x64d8('0x3d')]:_0x54d7bb[_0x64d8('0x37')];if(_0xdcbea2[_0x64d8('0x39')][_0x64d8('0xac')]){_0x1bc611[_0x64d8('0xad')]=[{'all':!![]}];}_0x1bc611=_[_0x64d8('0x98')]({},_0x1bc611,_0xdcbea2['options']);return db[_0x64d8('0x35')]['find'](_0x1bc611)[_0x64d8('0x2a')](handleEntityNotFound(_0x589e53,null))[_0x64d8('0x2a')](respondWithResult(_0x589e53,null))[_0x64d8('0x34')](handleError(_0x589e53,null));};exports[_0x64d8('0xae')]=function(_0x2cb649,_0x4933f0){return db[_0x64d8('0x35')][_0x64d8('0xae')](_0x2cb649[_0x64d8('0xaf')],{})[_0x64d8('0x2a')](respondWithResult(_0x4933f0,0xc9))[_0x64d8('0x34')](handleError(_0x4933f0,null));};exports[_0x64d8('0x29')]=function(_0x58a48f,_0x44c4a3){if(_0x58a48f['body']['id']){delete _0x58a48f['body']['id'];}return db[_0x64d8('0x35')][_0x64d8('0xb0')]({'where':{'id':_0x58a48f[_0x64d8('0xab')]['id']}})['then'](handleEntityNotFound(_0x44c4a3,null))['then'](saveUpdates(_0x58a48f[_0x64d8('0xaf')],null))[_0x64d8('0x2a')](respondWithResult(_0x44c4a3,null))[_0x64d8('0x34')](handleError(_0x44c4a3,null));};exports[_0x64d8('0x2b')]=function(_0x1593b6,_0x2fdcdf){return db[_0x64d8('0x35')][_0x64d8('0xb0')]({'where':{'id':_0x1593b6['params']['id']}})[_0x64d8('0x2a')](handleEntityNotFound(_0x2fdcdf,null))['then'](removeEntity(_0x2fdcdf,null))[_0x64d8('0x34')](handleError(_0x2fdcdf,null));};exports[_0x64d8('0xb1')]=function(_0x4a6893,_0x4040ff){return db[_0x64d8('0x35')][_0x64d8('0xb1')]()['then'](respondWithResult(_0x4040ff,null))[_0x64d8('0x34')](handleError(_0x4040ff,null));};exports[_0x64d8('0xb2')]=function(_0x36e60f,_0x1b358e,_0x240e9e){return db[_0x64d8('0xb3')][_0x64d8('0xb0')]({'where':{'id':_0x36e60f[_0x64d8('0xab')]['id']}})[_0x64d8('0x2a')](handleEntityNotFound(_0x1b358e,null))[_0x64d8('0x2a')](function(_0x3125d1){if(_0x3125d1){return _0x3125d1[_0x64d8('0xb2')](_0x36e60f[_0x64d8('0xaf')]['ids'],_[_0x64d8('0xb4')](_0x36e60f[_0x64d8('0xaf')],[_0x64d8('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x1b358e,null))[_0x64d8('0x34')](handleError(_0x1b358e,null));};exports[_0x64d8('0xb6')]=function(_0x1f45a0,_0x1a39f7,_0x22c6cf){var _0x5076c8={'raw':![],'where':{}};var _0x150a17={};var _0x59f6f1={'count':0x0,'rows':[]};return db[_0x64d8('0x35')][_0x64d8('0xb7')]({'where':{'id':_0x1f45a0[_0x64d8('0xab')]['id']}})[_0x64d8('0x2a')](handleEntityNotFound(_0x1a39f7,null))[_0x64d8('0x2a')](function(_0xb468a9){if(_0xb468a9){_0x150a17[_0x64d8('0x37')]=_[_0x64d8('0x38')](db[_0x64d8('0xb3')][_0x64d8('0x36')]);_0x150a17[_0x64d8('0x39')]=_[_0x64d8('0x38')](_0x1f45a0[_0x64d8('0x39')]);_0x150a17[_0x64d8('0x3a')]=_[_0x64d8('0x3b')](_0x150a17[_0x64d8('0x37')],_0x150a17[_0x64d8('0x39')]);_0x5076c8[_0x64d8('0x3d')]=_['intersection'](_0x150a17[_0x64d8('0x37')],qs[_0x64d8('0x3c')](_0x1f45a0['query']['fields']));_0x5076c8[_0x64d8('0x3d')]=_0x5076c8[_0x64d8('0x3d')][_0x64d8('0x3e')]?_0x5076c8['attributes']:_0x150a17[_0x64d8('0x37')];if(!_0x1f45a0[_0x64d8('0x39')]['hasOwnProperty']('nolimit')){_0x5076c8[_0x64d8('0x40')]=qs[_0x64d8('0x40')](_0x1f45a0[_0x64d8('0x39')][_0x64d8('0x40')]);_0x5076c8[_0x64d8('0x23')]=qs['offset'](_0x1f45a0[_0x64d8('0x39')][_0x64d8('0x23')]);}_0x5076c8[_0x64d8('0x41')]=qs[_0x64d8('0x42')](_0x1f45a0[_0x64d8('0x39')][_0x64d8('0x42')]);_0x5076c8[_0x64d8('0x43')]=qs[_0x64d8('0x3a')](_[_0x64d8('0x44')](_0x1f45a0[_0x64d8('0x39')],_0x150a17['filters']));_0x5076c8[_0x64d8('0x43')][_0x64d8('0xa7')]=_0xb468a9['id'];if(_0x1f45a0['query'][_0x64d8('0x75')]){_0x5076c8[_0x64d8('0x43')]=_['merge'](_0x5076c8[_0x64d8('0x43')],{'$or':_[_0x64d8('0x2f')](_0x5076c8['attributes'],function(_0x5d450b){var _0x2c8eed={};_0x2c8eed[_0x5d450b]={'$like':'%'+_0x1f45a0[_0x64d8('0x39')]['filter']+'%'};return _0x2c8eed;})});}if(_0x1f45a0[_0x64d8('0x39')]['$gte']){var _0x464705=_0x1f45a0[_0x64d8('0x39')][_0x64d8('0x7b')][_0x64d8('0x32')](',');var _0x16ee63={};_0x16ee63[_0x464705[0x0]]={'$gte':moment(_0x464705[0x1])[_0x64d8('0x5f')](_0x64d8('0xb8'))};_0x5076c8['where']=_['merge'](_0x5076c8[_0x64d8('0x43')],_0x16ee63);}_0x5076c8=_['merge']({},_0x5076c8,_0x1f45a0[_0x64d8('0xb9')]);return db['SmsMessage'][_0x64d8('0x96')]({'where':_0x5076c8[_0x64d8('0x43')]})['then'](function(_0x40df98){_0x59f6f1[_0x64d8('0x96')]=_0x40df98;if(_0x1f45a0[_0x64d8('0x39')][_0x64d8('0xac')]){_0x5076c8[_0x64d8('0xad')]=[{'all':!![]}];}return db[_0x64d8('0xb3')][_0x64d8('0xba')](_0x5076c8);})[_0x64d8('0x2a')](function(_0x3c3da8){_0x59f6f1[_0x64d8('0xa9')]=_0x3c3da8;return _0x59f6f1;});}})[_0x64d8('0x2a')](respondWithFilteredResult(_0x1a39f7,_0x5076c8))[_0x64d8('0x34')](handleError(_0x1a39f7,null));};exports[_0x64d8('0xbb')]=function(_0x39cf4f,_0xbe6552,_0x559bd3){return db[_0x64d8('0x35')]['find']({'where':{'id':_0x39cf4f[_0x64d8('0xab')]['id']}})[_0x64d8('0x2a')](handleEntityNotFound(_0xbe6552,null))[_0x64d8('0x2a')](function(_0x3e7bfd){if(_0x3e7bfd){return _0x3e7bfd['setTags'](_0x39cf4f[_0x64d8('0xaf')]['ids'],_[_0x64d8('0xb4')](_0x39cf4f[_0x64d8('0xaf')],[_0x64d8('0xb5'),'id'])||{})[_0x64d8('0xbc')](function(){return db[_0x64d8('0xbd')][_0x64d8('0xba')]({'attributes':['id','name',_0x64d8('0x47')],'where':{'id':_0x39cf4f['body'][_0x64d8('0xb5')]}});})[_0x64d8('0x2a')](function(_0x4f54b1){socket[_0x64d8('0xbe')](_0x64d8('0xbf'),{'id':Number(_0x39cf4f[_0x64d8('0xab')]['id']),'tags':_0x4f54b1||[]});return{'id':Number(_0x39cf4f[_0x64d8('0xab')]['id']),'tags':_0x4f54b1||[]};});}})[_0x64d8('0x2a')](respondWithResult(_0xbe6552,null))['catch'](handleError(_0xbe6552,null));};exports['removeTags']=function(_0x2df433,_0x482807,_0x4835dc){return db[_0x64d8('0x35')]['find']({'where':{'id':_0x2df433[_0x64d8('0xab')]['id']}})['then'](handleEntityNotFound(_0x482807,null))[_0x64d8('0x2a')](function(_0x2e3b80){if(_0x2e3b80){return _0x2e3b80[_0x64d8('0xc0')](_0x2df433['query'][_0x64d8('0xb5')]);}})[_0x64d8('0x2a')](respondWithStatusCode(_0x482807,null))[_0x64d8('0x34')](handleError(_0x482807,null));};exports[_0x64d8('0xc1')]=function(_0x25abc0,_0x360189){var _0x57593f=moment()[_0x64d8('0xc2')]()['toString']();var _0x531c52=path[_0x64d8('0x83')](config[_0x64d8('0xc3')],_0x64d8('0xc4'),_0x64d8('0xc5'),_0x64d8('0xc6'));var _0x3fb8a4=path[_0x64d8('0x83')](config[_0x64d8('0xc3')],_0x64d8('0xc4'),_0x64d8('0xc5'),_0x64d8('0xc7'));var _0x523de7=path[_0x64d8('0x83')](_0x531c52,_0x57593f);var _0x10935c=util[_0x64d8('0x5f')](_0x64d8('0xc8'),_0x25abc0[_0x64d8('0xab')]['id'],_0x57593f);var _0x1e3919=path[_0x64d8('0x83')](_0x531c52,_0x10935c);var _0x35f006=![];return db[_0x64d8('0x35')]['find']({'where':{'id':_0x25abc0[_0x64d8('0xab')]['id']},'include':[{'model':db[_0x64d8('0xb3')],'as':_0x64d8('0xc9'),'attributes':['id',_0x64d8('0xaf'),_0x64d8('0x7a'),'direction',_0x64d8('0xca')],'include':[{'model':db['User'],'as':_0x64d8('0xcb'),'attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x64d8('0xcc'),'attributes':['id',_0x64d8('0xcd'),_0x64d8('0xce')],'raw':!![]}]},{'model':db[_0x64d8('0xcf')],'as':_0x64d8('0xd0'),'attributes':['id',_0x64d8('0x2d')]},{'model':db[_0x64d8('0xcb')],'as':_0x64d8('0xd1'),'attributes':['id',_0x64d8('0xd2')]}]})['then'](handleEntityNotFound(_0x360189,null))['then'](function(_0x212fac){if(_0x212fac){var _0x57063c=_0x212fac[_0x64d8('0xd3')]({'plain':!![]});_0x35f006=!![];var _0x2e3aa1={'format':'A4','border':_0x64d8('0xd4'),'header':{'height':_0x64d8('0xd5'),'contents':{'first':_0x64d8('0xd6')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x64d8('0xd7'),util[_0x64d8('0x5f')]('%s\x20#%d','Sms',_0x57063c['id']),moment()[_0x64d8('0x5f')](_0x64d8('0xd8'))[_0x64d8('0x95')]())}}};fs['mkdirSync'](_0x523de7);var _0xfc186d={'channel':_0x64d8('0xd9'),'account':_0x57063c[_0x64d8('0xd0')][_0x64d8('0x2d')],'agent':_0x57063c[_0x64d8('0xd1')]?_0x57063c[_0x64d8('0xd1')][_0x64d8('0xd2')]:'N.A.','createdAt':moment(_0x57063c[_0x64d8('0x7a')])[_0x64d8('0x5f')](_0x64d8('0xb8'))['toString'](),'closedAt':_0x57063c['closed']?moment(_0x57063c[_0x64d8('0xda')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x64d8('0x95')]():'','disposition':_0x57063c['disposition'],'messages':_(_0x57063c[_0x64d8('0xc9')])['filter']({'secret':![]})[_0x64d8('0x2f')](function(_0x5e7a99){return{'date':moment(_0x5e7a99['createdAt'])[_0x64d8('0x5f')](_0x64d8('0xb8'))[_0x64d8('0x95')](),'sender':_0x5e7a99[_0x64d8('0xdb')]===_0x64d8('0xdc')?_0x5e7a99['User']?_0x5e7a99[_0x64d8('0xcb')][_0x64d8('0xd2')]:_0x64d8('0xdd'):_0x5e7a99[_0x64d8('0xcc')]['firstName']+(_0x5e7a99[_0x64d8('0xcc')][_0x64d8('0xce')]?'\x20'+_0x5e7a99['Contact'][_0x64d8('0xce')]:''),'body':_0x5e7a99[_0x64d8('0xaf')],'direction':_0x5e7a99['direction']===_0x64d8('0xdc')?'A':'C','secret':_0x5e7a99['secret']};})['value']()};return ejs[_0x64d8('0xde')](path[_0x64d8('0x83')](config[_0x64d8('0xc3')],_0x64d8('0xc4'),_0x64d8('0xdf'),_0x64d8('0xe0')),{'interaction':_0xfc186d})[_0x64d8('0x2a')](function(_0x1fd267){return new BPromise(function(_0x218559,_0x1775dc){pdf[_0x64d8('0xae')](_0x1fd267,_0x2e3aa1)[_0x64d8('0xe1')](path[_0x64d8('0x83')](_0x523de7,_0x64d8('0xe2')+_0x57063c['id']+'-'+_0x57593f+_0x64d8('0xe3')),function(_0x5198bb,_0x4103a6){if(_0x5198bb)return _0x1775dc(_0x5198bb);_0x218559(_0x4103a6);});});});}})[_0x64d8('0x2a')](function(){if(_0x35f006){return new BPromise(function(_0x3e885b,_0x865d37){zipdir(_0x523de7,{'saveTo':_0x1e3919},function(_0x4d8704,_0x50a465){if(_0x4d8704)return _0x865d37(_0x4d8704);return _0x3e885b(_0x50a465);});})[_0x64d8('0x2a')](function(){return new BPromise(function(_0x7eac52,_0x21e549){rimraf(_0x523de7,function(_0x4b576a){if(_0x4b576a)_0x21e549(_0x4b576a);return _0x7eac52();});});})[_0x64d8('0x2a')](function(){return _0x360189['download'](_0x1e3919,_0x10935c,function(_0x497fc7){if(_0x497fc7){console[_0x64d8('0xe4')]('err',_0x497fc7);}else{fs['unlinkSync'](_0x1e3919);}});});}else{return _0x360189['sendStatus'](0xc8);}})[_0x64d8('0x34')](handleError(_0x360189,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index fc71ae5..fbe703d 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 _0xa022=['unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xa022,0xf0));var _0x2a02=function(_0x16bf90,_0x2082c2){_0x16bf90=_0x16bf90-0x0;var _0x46dcf8=_0xa022[_0x16bf90];return _0x46dcf8;};'use strict';var EventEmitter=require(_0x2a02('0x0'));var SmsInteraction=require(_0x2a02('0x1'))['db'][_0x2a02('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2a02('0x3')](0x0);var events={'afterCreate':_0x2a02('0x4'),'afterUpdate':'update','afterDestroy':_0x2a02('0x5')};function emitEvent(_0x24ddd2){return function(_0x2ad029,_0x35f972,_0x18eed5){_0x2ad029[_0x2a02('0x6')]({'attributes':['id'],'raw':!![]})[_0x2a02('0x7')](function(_0x522e19){_0x2ad029[_0x2a02('0x8')](_0x2a02('0x9'),_0x522e19[_0x2a02('0xa')](function(_0x5020cd){return{'id':_0x5020cd['id']};}));return SmsMessage[_0x2a02('0xb')]({'where':{'SmsInteractionId':_0x2ad029['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a02('0x7')](function(_0x867f3){_0x2ad029[_0x2a02('0x8')](_0x2a02('0xc'),_0x867f3[_0x2a02('0xd')]);SmsInteractionEvents[_0x2a02('0xe')](_0x24ddd2+':'+_0x2ad029['id'],_0x2ad029);SmsInteractionEvents[_0x2a02('0xe')](_0x24ddd2,_0x2ad029);_0x18eed5(null);})[_0x2a02('0xf')](_0x18eed5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2a02('0x10')](e,emitEvent(event));}}module[_0x2a02('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x36e7=['update','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','save'];(function(_0x3774d5,_0x26180d){var _0x1f95d2=function(_0x1a3017){while(--_0x1a3017){_0x3774d5['push'](_0x3774d5['shift']());}};_0x1f95d2(++_0x26180d);}(_0x36e7,0xdd));var _0x736e=function(_0x4a87a9,_0x487128){_0x4a87a9=_0x4a87a9-0x0;var _0x5920da=_0x36e7[_0x4a87a9];return _0x5920da;};'use strict';var EventEmitter=require(_0x736e('0x0'));var SmsInteraction=require(_0x736e('0x1'))['db'][_0x736e('0x2')];var SmsMessage=require(_0x736e('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x736e('0x3'),'afterUpdate':_0x736e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x557f5c){return function(_0x269fad,_0x5e58dc,_0x43ad03){_0x269fad['getUsers']({'attributes':['id'],'raw':!![]})[_0x736e('0x5')](function(_0x131ad3){_0x269fad['setDataValue'](_0x736e('0x6'),_0x131ad3[_0x736e('0x7')](function(_0x258a26){return{'id':_0x258a26['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x269fad['id'],'direction':'in','read':![]},'raw':!![]});})[_0x736e('0x5')](function(_0x36f11e){_0x269fad[_0x736e('0x8')](_0x736e('0x9'),_0x36f11e[_0x736e('0xa')]);SmsInteractionEvents[_0x736e('0xb')](_0x557f5c+':'+_0x269fad['id'],_0x269fad);SmsInteractionEvents[_0x736e('0xb')](_0x557f5c,_0x269fad);_0x43ad03(null);})[_0x736e('0xc')](_0x43ad03(null));};}for(var e in events){if(events[_0x736e('0xd')](e)){var event=events[e];SmsInteraction[_0x736e('0xe')](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 deca7d3..16f55f2 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 _0xeb4d=['api','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes','exports','define','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x94220c,_0x29f3fd){var _0x119684=function(_0x300335){while(--_0x300335){_0x94220c['push'](_0x94220c['shift']());}};_0x119684(++_0x29f3fd);}(_0xeb4d,0x185));var _0xdeb4=function(_0x2eca11,_0x183953){_0x2eca11=_0x2eca11-0x0;var _0x51821f=_0xeb4d[_0x2eca11];return _0x51821f;};'use strict';var _=require(_0xdeb4('0x0'));var util=require(_0xdeb4('0x1'));var logger=require(_0xdeb4('0x2'))(_0xdeb4('0x3'));var moment=require(_0xdeb4('0x4'));var BPromise=require(_0xdeb4('0x5'));var rp=require(_0xdeb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb4('0x7'));var config=require('../../config/environment');var attributes=require(_0xdeb4('0x8'));module[_0xdeb4('0x9')]=function(_0x55fdd7,_0x4f810f){return _0x55fdd7[_0xdeb4('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4924de,_0xc0c81,_0x40eebf){if(_0x4924de['changed'](_0xdeb4('0xb'))){_0x4924de['closedAt']=moment()[_0xdeb4('0xc')](_0xdeb4('0xd'));}_0x40eebf(null,_0x4924de);}}});}; \ No newline at end of file +var _0x481b=['rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','closed','closedAt','format','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5315e4,_0x379ac8){var _0x136d7c=function(_0x1f530b){while(--_0x1f530b){_0x5315e4['push'](_0x5315e4['shift']());}};_0x136d7c(++_0x379ac8);}(_0x481b,0xbe));var _0xb481=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x481b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xb481('0x0'));var logger=require(_0xb481('0x1'))(_0xb481('0x2'));var moment=require(_0xb481('0x3'));var BPromise=require('bluebird');var rp=require(_0xb481('0x4'));var fs=require('fs');var path=require(_0xb481('0x5'));var rimraf=require(_0xb481('0x6'));var config=require(_0xb481('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xb481('0x8')]=function(_0x2995d5,_0xf35f9c){return _0x2995d5['define'](_0xb481('0x9'),attributes,{'tableName':_0xb481('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c7392,_0x3f3939,_0x507f41){if(_0x3c7392['changed'](_0xb481('0xb'))){_0x3c7392[_0xb481('0xc')]=moment()[_0xb481('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x507f41(null,_0x3c7392);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index cbaedd5..d99612b 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 _0xd290=['spread','AddTags','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','request','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','then','find','addTags','ids'];(function(_0x1e3645,_0x41bdd9){var _0x17674a=function(_0x1dc19a){while(--_0x1dc19a){_0x1e3645['push'](_0x1e3645['shift']());}};_0x17674a(++_0x41bdd9);}(_0xd290,0x13b));var _0x0d29=function(_0x54bc4b,_0x47747a){_0x54bc4b=_0x54bc4b-0x0;var _0x1a9163=_0xd290[_0x54bc4b];return _0x1a9163;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require('moment');var BPromise=require(_0x0d29('0x2'));var rs=require(_0x0d29('0x3'));var fs=require('fs');var Redis=require(_0x0d29('0x4'));var db=require(_0x0d29('0x5'))['db'];var utils=require(_0x0d29('0x6'));var logger=require(_0x0d29('0x7'))(_0x0d29('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0d29('0x9')]({'port':0x232a});config[_0x0d29('0xa')]=_[_0x0d29('0xb')](config[_0x0d29('0xa')],{'host':_0x0d29('0xc'),'port':0x18eb});var socket=require(_0x0d29('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1c1f74,_0x26ddc4,_0x3beb4d){return new BPromise(function(_0x1ce506,_0x3b6a68){return client[_0x0d29('0xe')](_0x1c1f74,_0x3beb4d)['then'](function(_0x554524){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x26ddc4,_0x0d29('0xf'));logger[_0x0d29('0x10')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x26ddc4,_0x0d29('0xf'),JSON[_0x0d29('0x11')](_0x554524));if(_0x554524[_0x0d29('0x12')]){if(_0x554524[_0x0d29('0x12')][_0x0d29('0x13')]===0x1f4){logger[_0x0d29('0x12')](_0x0d29('0x14'),_0x26ddc4,_0x554524[_0x0d29('0x12')][_0x0d29('0x15')]);return _0x3b6a68(_0x554524[_0x0d29('0x12')][_0x0d29('0x15')]);}logger[_0x0d29('0x12')](_0x0d29('0x14'),_0x26ddc4,_0x554524[_0x0d29('0x12')][_0x0d29('0x15')]);return _0x1ce506(_0x554524[_0x0d29('0x12')][_0x0d29('0x15')]);}else{logger[_0x0d29('0x16')](_0x0d29('0x14'),_0x26ddc4,'request\x20sent');_0x1ce506(_0x554524[_0x0d29('0x17')][_0x0d29('0x15')]);}})['catch'](function(_0x484afd){logger['error'](_0x0d29('0x14'),_0x26ddc4,_0x484afd);_0x3b6a68(_0x484afd);});});}exports[_0x0d29('0x18')]=function(_0x5e6cb7){var _0x4f9810=this;return new Promise(function(_0x512c34,_0x2af302){return db[_0x0d29('0x19')][_0x0d29('0x1a')](_0x5e6cb7[_0x0d29('0x1b')],{'raw':_0x5e6cb7[_0x0d29('0x1c')]?_0x5e6cb7[_0x0d29('0x1c')][_0x0d29('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6cb7[_0x0d29('0x1c')]?_0x5e6cb7[_0x0d29('0x1c')][_0x0d29('0x1e')]||null:null,'attributes':_0x5e6cb7[_0x0d29('0x1c')]?_0x5e6cb7[_0x0d29('0x1c')]['attributes']||null:null,'limit':_0x5e6cb7[_0x0d29('0x1c')]?_0x5e6cb7[_0x0d29('0x1c')][_0x0d29('0x1f')]||null:null})[_0x0d29('0x20')](function(_0x163a87){logger[_0x0d29('0x16')](_0x0d29('0x18'),_0x5e6cb7);logger[_0x0d29('0x10')]('UpdateSmsInteraction',_0x5e6cb7,JSON['stringify'](_0x163a87));_0x512c34(_0x163a87);})['catch'](function(_0x1d60a9){logger['error'](_0x0d29('0x18'),_0x1d60a9['message'],_0x5e6cb7);_0x2af302(_0x4f9810['error'](0x1f4,_0x1d60a9['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x27ad01){return new Promise(function(_0x55cee9,_0x57aad4){return db[_0x0d29('0x19')][_0x0d29('0x21')]({'where':_0x27ad01['options']?_0x27ad01[_0x0d29('0x1c')][_0x0d29('0x1e')]||null:null})[_0x0d29('0x20')](function(_0x19d2b3){if(_0x19d2b3){return _0x19d2b3[_0x0d29('0x22')](_0x27ad01[_0x0d29('0x1b')]['ids'],_['omit'](_0x27ad01[_0x0d29('0x1b')],[_0x0d29('0x23'),'id'])||{});}})[_0x0d29('0x24')](function(_0x33ebe2){logger[_0x0d29('0x16')](_0x0d29('0x25'),_0x27ad01);logger[_0x0d29('0x10')]('AddTags',_0x27ad01,JSON[_0x0d29('0x11')](_0x33ebe2));_0x55cee9(_0x33ebe2);})[_0x0d29('0x26')](function(_0x22a316){logger[_0x0d29('0x12')]('AddTags',_0x22a316['message'],_0x27ad01);_0x57aad4(_this[_0x0d29('0x12')](0x1f4,_0x22a316[_0x0d29('0x15')]));});});}; \ No newline at end of file +var _0xb9d7=['catch','AddTagsToSmsInteraction','find','addTags','ids','omit','body','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction'];(function(_0x8a17d6,_0x8b548){var _0x28bebb=function(_0x202ce4){while(--_0x202ce4){_0x8a17d6['push'](_0x8a17d6['shift']());}};_0x28bebb(++_0x8b548);}(_0xb9d7,0xa4));var _0x7b9d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb9d7[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7b9d('0x0'));var util=require(_0x7b9d('0x1'));var moment=require(_0x7b9d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9d('0x4'));var logger=require(_0x7b9d('0x5'))('rpc');var config=require(_0x7b9d('0x6'));var jayson=require(_0x7b9d('0x7'));var client=jayson[_0x7b9d('0x8')][_0x7b9d('0x9')]({'port':0x232a});config[_0x7b9d('0xa')]=_['defaults'](config[_0x7b9d('0xa')],{'host':_0x7b9d('0xb'),'port':0x18eb});var socket=require(_0x7b9d('0xc'))(new Redis(config[_0x7b9d('0xa')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xda4511,_0xaa4d01,_0x5cdf8f){return new BPromise(function(_0x4703ed,_0x52a892){return client[_0x7b9d('0xd')](_0xda4511,_0x5cdf8f)[_0x7b9d('0xe')](function(_0x298323){logger[_0x7b9d('0xf')](_0x7b9d('0x10'),_0xaa4d01,'request\x20sent');logger[_0x7b9d('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xaa4d01,_0x7b9d('0x12'),JSON[_0x7b9d('0x13')](_0x298323));if(_0x298323[_0x7b9d('0x14')]){if(_0x298323['error'][_0x7b9d('0x15')]===0x1f4){logger[_0x7b9d('0x14')](_0x7b9d('0x10'),_0xaa4d01,_0x298323[_0x7b9d('0x14')]['message']);return _0x52a892(_0x298323[_0x7b9d('0x14')][_0x7b9d('0x16')]);}logger['error'](_0x7b9d('0x10'),_0xaa4d01,_0x298323['error'][_0x7b9d('0x16')]);return _0x4703ed(_0x298323['error'][_0x7b9d('0x16')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0xaa4d01,'request\x20sent');_0x4703ed(_0x298323['result'][_0x7b9d('0x16')]);}})['catch'](function(_0xee7ce5){logger['error']('SmsInteraction,\x20%s,\x20%s',_0xaa4d01,_0xee7ce5);_0x52a892(_0xee7ce5);});});}exports['UpdateSmsInteraction']=function(_0x548be3){var _0x398bac=this;return new Promise(function(_0x296193,_0x3747a0){return db[_0x7b9d('0x17')][_0x7b9d('0x18')](_0x548be3['body'],{'raw':_0x548be3[_0x7b9d('0x19')]?_0x548be3['options'][_0x7b9d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548be3[_0x7b9d('0x19')]?_0x548be3[_0x7b9d('0x19')][_0x7b9d('0x1b')]||null:null,'attributes':_0x548be3[_0x7b9d('0x19')]?_0x548be3['options'][_0x7b9d('0x1c')]||null:null,'limit':_0x548be3[_0x7b9d('0x19')]?_0x548be3[_0x7b9d('0x19')][_0x7b9d('0x1d')]||null:null})[_0x7b9d('0xe')](function(_0x26c2c8){logger['info'](_0x7b9d('0x1e'),_0x548be3);logger['debug']('UpdateSmsInteraction',_0x548be3,JSON[_0x7b9d('0x13')](_0x26c2c8));_0x296193(_0x26c2c8);})[_0x7b9d('0x1f')](function(_0x4cf236){logger[_0x7b9d('0x14')]('UpdateSmsInteraction',_0x4cf236[_0x7b9d('0x16')],_0x548be3);_0x3747a0(_0x398bac['error'](0x1f4,_0x4cf236['message']));});});};exports[_0x7b9d('0x20')]=function(_0x237d37){return new Promise(function(_0x3c8290,_0x12242d){return db[_0x7b9d('0x17')][_0x7b9d('0x21')]({'where':_0x237d37['options']?_0x237d37[_0x7b9d('0x19')][_0x7b9d('0x1b')]||null:null})[_0x7b9d('0xe')](function(_0x5be0b0){if(_0x5be0b0){return _0x5be0b0[_0x7b9d('0x22')](_0x237d37['body'][_0x7b9d('0x23')],_[_0x7b9d('0x24')](_0x237d37[_0x7b9d('0x25')],[_0x7b9d('0x23'),'id'])||{});}})['spread'](function(_0x31a3e0){logger[_0x7b9d('0xf')](_0x7b9d('0x26'),_0x237d37);logger['debug'](_0x7b9d('0x26'),_0x237d37,JSON['stringify'](_0x31a3e0));_0x3c8290(_0x31a3e0);})[_0x7b9d('0x1f')](function(_0x30cee3){logger['error']('AddTags',_0x30cee3[_0x7b9d('0x16')],_0x237d37);_0x12242d(_this[_0x7b9d('0x14')](0x1f4,_0x30cee3[_0x7b9d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6b5f3d4..f2ec16a 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 _0x56fe=['removeListener','length','smsInteraction:','save','update'];(function(_0x1cfbf3,_0x6ac301){var _0x1cae79=function(_0x220119){while(--_0x220119){_0x1cfbf3['push'](_0x1cfbf3['shift']());}};_0x1cae79(++_0x6ac301);}(_0x56fe,0xfd));var _0xe56f=function(_0xa4d20,_0x5cf2bc){_0xa4d20=_0xa4d20-0x0;var _0x4d3d28=_0x56fe[_0xa4d20];return _0x4d3d28;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xe56f('0x0'),'remove',_0xe56f('0x1')];function createListener(_0xef16ed,_0x483b34){return function(_0x414024){_0x483b34['emit'](_0xef16ed,_0x414024);};}function removeListener(_0x3772ed,_0x1d8f6f){return function(){SmsInteractionEvents[_0xe56f('0x2')](_0x3772ed,_0x1d8f6f);};}exports['register']=function(_0x4d1973){for(var _0x2a4a7d=0x0,_0xb34d6c=events[_0xe56f('0x3')];_0x2a4a7d<_0xb34d6c;_0x2a4a7d++){var _0x1f293a=events[_0x2a4a7d];var _0x59ee67=createListener(_0xe56f('0x4')+_0x1f293a,_0x4d1973);SmsInteractionEvents['on'](_0x1f293a,_0x59ee67);}}; \ No newline at end of file +var _0xf872=['length','./smsInteraction.events','save','update','removeListener'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xf872,0x1eb));var _0x2f87=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0xf872[_0x348652];return _0x18a9ea;};'use strict';var SmsInteractionEvents=require(_0x2f87('0x0'));var events=[_0x2f87('0x1'),'remove',_0x2f87('0x2')];function createListener(_0x218b69,_0x59bbb4){return function(_0x159e55){_0x59bbb4['emit'](_0x218b69,_0x159e55);};}function removeListener(_0x59f0e8,_0x2425c2){return function(){SmsInteractionEvents[_0x2f87('0x3')](_0x59f0e8,_0x2425c2);};}exports['register']=function(_0x4b2ffd){for(var _0x2d20fd=0x0,_0x34810e=events[_0x2f87('0x4')];_0x2d20fd<_0x34810e;_0x2d20fd++){var _0x124864=events[_0x2d20fd];var _0x3ea8e1=createListener('smsInteraction:'+_0x124864,_0x4b2ffd);SmsInteractionEvents['on'](_0x124864,_0x3ea8e1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f5e55a0..5653b17 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 _0x61e0=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','tracked','sms','smsmessage:create','create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61e0,0xc2));var _0x061e=function(_0x1a9621,_0x10c63c){_0x1a9621=_0x1a9621-0x0;var _0x1a6385=_0x61e0[_0x1a9621];return _0x1a6385;};'use strict';var multer=require(_0x061e('0x0'));var util=require(_0x061e('0x1'));var path=require(_0x061e('0x2'));var timeout=require(_0x061e('0x3'));var express=require('express');var router=express[_0x061e('0x4')]();var auth=require(_0x061e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x061e('0x6'));var controller=require(_0x061e('0x7'));router[_0x061e('0x8')]('/',auth['isAuthenticated'](),controller[_0x061e('0x9')]);router[_0x061e('0x8')](_0x061e('0xa'),auth[_0x061e('0xb')](),controller[_0x061e('0xc')]);router[_0x061e('0x8')](_0x061e('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x061e('0xb')](),interaction[_0x061e('0xe')](_0x061e('0xf'),_0x061e('0x10')),controller[_0x061e('0x11')]);router[_0x061e('0x12')](_0x061e('0x13'),controller['status']);router[_0x061e('0x14')](_0x061e('0xd'),auth[_0x061e('0xb')](),controller[_0x061e('0x15')]);router['put'](_0x061e('0x16'),auth['isAuthenticated'](),controller[_0x061e('0x17')]);router['put'](_0x061e('0x18'),auth[_0x061e('0xb')](),controller['reject']);router[_0x061e('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x061e('0x1a')]);module[_0x061e('0x1b')]=router; \ No newline at end of file +var _0x6aa4=['Router','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','sms','smsmessage:create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5dabb3,_0x9c082d){var _0x524010=function(_0x3e63bc){while(--_0x3e63bc){_0x5dabb3['push'](_0x5dabb3['shift']());}};_0x524010(++_0x9c082d);}(_0x6aa4,0x1f0));var _0x46aa=function(_0x4f413a,_0x43b67e){_0x4f413a=_0x4f413a-0x0;var _0x2322e7=_0x6aa4[_0x4f413a];return _0x2322e7;};'use strict';var multer=require(_0x46aa('0x0'));var util=require(_0x46aa('0x1'));var path=require(_0x46aa('0x2'));var timeout=require(_0x46aa('0x3'));var express=require('express');var router=express[_0x46aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x46aa('0x5'));var config=require('../../config/environment');var controller=require(_0x46aa('0x6'));router[_0x46aa('0x7')]('/',auth[_0x46aa('0x8')](),controller[_0x46aa('0x9')]);router[_0x46aa('0x7')](_0x46aa('0xa'),auth['isAuthenticated'](),controller[_0x46aa('0xb')]);router[_0x46aa('0x7')](_0x46aa('0xc'),auth[_0x46aa('0x8')](),controller['show']);router['post']('/',auth[_0x46aa('0x8')](),interaction['tracked'](_0x46aa('0xd'),_0x46aa('0xe')),controller['create']);router['post'](_0x46aa('0xf'),controller['status']);router[_0x46aa('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x46aa('0x11')]);router[_0x46aa('0x10')](_0x46aa('0x12'),auth[_0x46aa('0x8')](),controller[_0x46aa('0x13')]);router['put'](_0x46aa('0x14'),auth[_0x46aa('0x8')](),controller[_0x46aa('0x15')]);router[_0x46aa('0x16')](_0x46aa('0xc'),auth[_0x46aa('0x8')](),controller[_0x46aa('0x17')]);module[_0x46aa('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d09a453..310555a 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 _0x04e7=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x20216f,_0x47796c){var _0x37db3e=function(_0x40df38){while(--_0x40df38){_0x20216f['push'](_0x20216f['shift']());}};_0x37db3e(++_0x47796c);}(_0x04e7,0x121));var _0x704e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x04e7[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x704e('0x0'));module[_0x704e('0x1')]={'body':{'type':Sequelize[_0x704e('0x2')](_0x704e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x704e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x704e('0x5')]('in',_0x704e('0x6')),'defaultValue':_0x704e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x704e('0x7')](0xbe)},'phone':{'type':Sequelize[_0x704e('0x7')]},'readAt':{'type':Sequelize[_0x704e('0x8')]},'secret':{'type':Sequelize[_0x704e('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xbea5=['BOOLEAN','ENUM','out','DATE','sequelize','exports','medium'];(function(_0x3e157a,_0xd17b76){var _0x15fabe=function(_0x545282){while(--_0x545282){_0x3e157a['push'](_0x3e157a['shift']());}};_0x15fabe(++_0xd17b76);}(_0xbea5,0x177));var _0x5bea=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xbea5[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x5bea('0x0'));module[_0x5bea('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5bea('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5bea('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5bea('0x4')]('in',_0x5bea('0x5')),'defaultValue':_0x5bea('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x5bea('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 03ff519..b8de215 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 _0x5fa1=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','interface','event','rejectmessage','debug','received\x20delivery\x20report\x20from','type','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','sent','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','stack','name','send','SmsMessage','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','map','key','VIRTUAL','field','includeAll','include','findAll','show','params','rawAttributes','merge','options','find','create','destroy','describe','sms-interactions','accept','sms','body'];(function(_0x152fc9,_0x31fb02){var _0x397259=function(_0x453b06){while(--_0x453b06){_0x152fc9['push'](_0x152fc9['shift']());}};_0x397259(++_0x31fb02);}(_0x5fa1,0x1d1));var _0x15fa=function(_0x2d5017,_0x4f963b){_0x2d5017=_0x2d5017-0x0;var _0x20283d=_0x5fa1[_0x2d5017];return _0x20283d;};'use strict';var pdf=require(_0x15fa('0x0'));var emlformat=require(_0x15fa('0x1'));var rimraf=require(_0x15fa('0x2'));var zipdir=require(_0x15fa('0x3'));var jsonpatch=require(_0x15fa('0x4'));var rp=require(_0x15fa('0x5'));var moment=require('moment');var BPromise=require(_0x15fa('0x6'));var Mustache=require(_0x15fa('0x7'));var util=require(_0x15fa('0x8'));var path=require(_0x15fa('0x9'));var sox=require('sox');var csv=require(_0x15fa('0xa'));var ejs=require(_0x15fa('0xb'));var fs=require('fs');var _=require(_0x15fa('0xc'));var squel=require(_0x15fa('0xd'));var crypto=require(_0x15fa('0xe'));var jsforce=require(_0x15fa('0xf'));var deskjs=require(_0x15fa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x15fa('0x11'));var Papa=require(_0x15fa('0x12'));var Redis=require('ioredis');var authService=require(_0x15fa('0x13'));var qs=require(_0x15fa('0x14'));var hardwareService=require(_0x15fa('0x15'));var logger=require(_0x15fa('0x16'))('api');var utils=require(_0x15fa('0x17'));var config=require('../../config/environment');var db=require(_0x15fa('0x18'))['db'];config[_0x15fa('0x19')]=_[_0x15fa('0x1a')](config['redis'],{'host':_0x15fa('0x1b'),'port':0x18eb});var socket=require(_0x15fa('0x1c'))(new Redis(config[_0x15fa('0x19')]));require('./smsMessage.socket')[_0x15fa('0x1d')](socket);var jayson=require(_0x15fa('0x1e'));var client=jayson[_0x15fa('0x1f')][_0x15fa('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x15fa('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3e715d,_0x1d5187,_0x187703){if(_0x187703){var _0x5469a0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5469a0[_0x15fa('0x21')](_0x1d5187)){return _0x3e715d;}else{throw new Error(_0x15fa('0x22'));}}else{return _0x3e715d;}}function respondWithRpcPromise(_0x39ff58,_0x47ea94,_0xdc4a64,_0x4bc3af){return new BPromise(function(_0x460f8f,_0x3c2422){var _0x5927ea=_0x4bc3af||client;return _0x5927ea['request'](_0x39ff58,_0xdc4a64)[_0x15fa('0x23')](function(_0x6d9b4c){logger[_0x15fa('0x24')](_0x15fa('0x25'),_0x47ea94,_0x15fa('0x26'));logger['debug'](_0x15fa('0x27'),_0x47ea94,'request\x20sent',JSON[_0x15fa('0x28')](_0x6d9b4c));if(_0x6d9b4c[_0x15fa('0x29')]){if(_0x6d9b4c['error'][_0x15fa('0x2a')]===0x1f4){logger[_0x15fa('0x29')](_0x15fa('0x25'),_0x47ea94,_0x6d9b4c[_0x15fa('0x29')][_0x15fa('0x2b')]);return _0x3c2422(_0x6d9b4c[_0x15fa('0x29')][_0x15fa('0x2b')]);}logger[_0x15fa('0x29')]('SmsMessage,\x20%s,\x20%s',_0x47ea94,_0x6d9b4c['error'][_0x15fa('0x2b')]);return _0x460f8f(_0x6d9b4c[_0x15fa('0x29')][_0x15fa('0x2b')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x47ea94,_0x15fa('0x26'));_0x460f8f(_0x6d9b4c[_0x15fa('0x2c')][_0x15fa('0x2b')]);}})[_0x15fa('0x2d')](function(_0x21ae56){logger[_0x15fa('0x29')](_0x15fa('0x25'),_0x47ea94,_0x21ae56);_0x3c2422(_0x21ae56);});});}function respondWithStatusCode(_0x373ab6,_0x557a07){_0x557a07=_0x557a07||0xcc;return function(_0x105a07){if(_0x105a07){return _0x373ab6[_0x15fa('0x2e')](_0x557a07);}return _0x373ab6[_0x15fa('0x2f')](_0x557a07)[_0x15fa('0x30')]();};}function respondWithResult(_0xaa5e5,_0x3b84c2){_0x3b84c2=_0x3b84c2||0xc8;return function(_0x136b51){if(_0x136b51){return _0xaa5e5['status'](_0x3b84c2)[_0x15fa('0x31')](_0x136b51);}};}function respondWithFilteredResult(_0x18ca41,_0x854af){return function(_0x45618b){if(_0x45618b){var _0x3ecd73=_0x45618b[_0x15fa('0x32')],_0xe63b62=_0x854af[_0x15fa('0x33')],_0x285a81=_0x854af['offset']+_0x854af['limit'],_0x2e2c48;if(_0x285a81>=_0x3ecd73){_0x285a81=_0x3ecd73;_0x2e2c48=0xc8;}else{_0x2e2c48=0xce;}_0x18ca41[_0x15fa('0x2f')](_0x2e2c48);return _0x18ca41[_0x15fa('0x34')](_0x15fa('0x35'),_0xe63b62+'-'+_0x285a81+'/'+_0x3ecd73)[_0x15fa('0x31')](_0x45618b);}return null;};}function patchUpdates(_0x37eabe){return function(_0x28aae3){try{jsonpatch['apply'](_0x28aae3,_0x37eabe,!![]);}catch(_0x40b841){return BPromise['reject'](_0x40b841);}return _0x28aae3[_0x15fa('0x36')]();};}function saveUpdates(_0x21537f,_0x2e9526){return function(_0x533b4b){if(_0x533b4b){return _0x533b4b[_0x15fa('0x37')](_0x21537f)['then'](function(_0x229b68){return _0x229b68;});}return null;};}function removeEntity(_0x2d3b2e,_0x2e6cbc){return function(_0x3403a6){if(_0x3403a6){return _0x3403a6['destroy']()[_0x15fa('0x23')](function(){_0x2d3b2e[_0x15fa('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203bec,_0x1e18f9){return function(_0x2c88e3){if(!_0x2c88e3){_0x203bec[_0x15fa('0x2e')](0x194);}return _0x2c88e3;};}function handleError(_0xab8a76,_0x352425){_0x352425=_0x352425||0x1f4;return function(_0x302d61){logger[_0x15fa('0x29')](_0x302d61[_0x15fa('0x38')]);if(_0x302d61[_0x15fa('0x39')]){delete _0x302d61[_0x15fa('0x39')];}_0xab8a76[_0x15fa('0x2f')](_0x352425)[_0x15fa('0x3a')](_0x302d61);};}exports['index']=function(_0x17dd0b,_0x2038bd){var _0x10980e={},_0x424fbe={},_0x195d6a={'count':0x0,'rows':[]};var _0x57bf80=db[_0x15fa('0x3b')]['rawAttributes'];_0x424fbe[_0x15fa('0x3c')]=_['keys'](_0x57bf80);_0x424fbe[_0x15fa('0x3d')]=_[_0x15fa('0x3e')](_0x17dd0b['query']);_0x424fbe['filters']=_['intersection'](_0x424fbe[_0x15fa('0x3c')],_0x424fbe['query']);_0x10980e['attributes']=_[_0x15fa('0x3f')](_0x424fbe[_0x15fa('0x3c')],qs[_0x15fa('0x40')](_0x17dd0b['query'][_0x15fa('0x40')]));_0x10980e[_0x15fa('0x41')]=_0x10980e['attributes'][_0x15fa('0x42')]?_0x10980e['attributes']:_0x424fbe['model'];if(!_0x17dd0b['query'][_0x15fa('0x43')](_0x15fa('0x44'))){_0x10980e[_0x15fa('0x45')]=qs[_0x15fa('0x45')](_0x17dd0b[_0x15fa('0x3d')]['limit']);_0x10980e[_0x15fa('0x33')]=qs[_0x15fa('0x33')](_0x17dd0b['query'][_0x15fa('0x33')]);}_0x10980e[_0x15fa('0x46')]=qs[_0x15fa('0x47')](_0x17dd0b[_0x15fa('0x3d')][_0x15fa('0x47')]);_0x10980e[_0x15fa('0x48')]=qs[_0x15fa('0x49')](_['pick'](_0x17dd0b[_0x15fa('0x3d')],_0x424fbe[_0x15fa('0x49')]));if(_0x17dd0b[_0x15fa('0x3d')][_0x15fa('0x4a')]){_0x10980e['where']=_['merge'](_0x10980e['where'],{'$or':_[_0x15fa('0x4b')](_0x57bf80,function(_0x4ef3c9){if(_0x4ef3c9['type'][_0x15fa('0x4c')]!==_0x15fa('0x4d')){var _0x54acc4={};_0x54acc4[_0x4ef3c9[_0x15fa('0x4e')]]={'$like':'%'+_0x17dd0b[_0x15fa('0x3d')][_0x15fa('0x4a')]+'%'};return _0x54acc4;}})});}_0x10980e=_['merge']({},_0x10980e,_0x17dd0b['options']);var _0x18f0bc={'where':_0x10980e[_0x15fa('0x48')]};return db[_0x15fa('0x3b')][_0x15fa('0x32')](_0x18f0bc)[_0x15fa('0x23')](function(_0x192333){_0x195d6a[_0x15fa('0x32')]=_0x192333;if(_0x17dd0b[_0x15fa('0x3d')][_0x15fa('0x4f')]){_0x10980e[_0x15fa('0x50')]=[{'all':!![]}];}return db[_0x15fa('0x3b')][_0x15fa('0x51')](_0x10980e);})[_0x15fa('0x23')](function(_0x4f0bd5){_0x195d6a['rows']=_0x4f0bd5;return _0x195d6a;})[_0x15fa('0x23')](respondWithFilteredResult(_0x2038bd,_0x10980e))[_0x15fa('0x2d')](handleError(_0x2038bd,null));};exports[_0x15fa('0x52')]=function(_0x3aa5af,_0x58e237){var _0x205a7b={'raw':!![],'where':{'id':_0x3aa5af[_0x15fa('0x53')]['id']}},_0x1c14d4={};_0x1c14d4[_0x15fa('0x3c')]=_[_0x15fa('0x3e')](db['SmsMessage'][_0x15fa('0x54')]);_0x1c14d4[_0x15fa('0x3d')]=_[_0x15fa('0x3e')](_0x3aa5af[_0x15fa('0x3d')]);_0x1c14d4['filters']=_['intersection'](_0x1c14d4[_0x15fa('0x3c')],_0x1c14d4[_0x15fa('0x3d')]);_0x205a7b[_0x15fa('0x41')]=_[_0x15fa('0x3f')](_0x1c14d4[_0x15fa('0x3c')],qs[_0x15fa('0x40')](_0x3aa5af[_0x15fa('0x3d')][_0x15fa('0x40')]));_0x205a7b[_0x15fa('0x41')]=_0x205a7b['attributes'][_0x15fa('0x42')]?_0x205a7b[_0x15fa('0x41')]:_0x1c14d4[_0x15fa('0x3c')];if(_0x3aa5af[_0x15fa('0x3d')][_0x15fa('0x4f')]){_0x205a7b[_0x15fa('0x50')]=[{'all':!![]}];}_0x205a7b=_[_0x15fa('0x55')]({},_0x205a7b,_0x3aa5af[_0x15fa('0x56')]);return db['SmsMessage'][_0x15fa('0x57')](_0x205a7b)[_0x15fa('0x23')](handleEntityNotFound(_0x58e237,null))[_0x15fa('0x23')](respondWithResult(_0x58e237,null))['catch'](handleError(_0x58e237,null));};exports[_0x15fa('0x58')]=function(_0x43bf94,_0xe265f8){return db[_0x15fa('0x3b')][_0x15fa('0x58')](_0x43bf94['body'],{})[_0x15fa('0x23')](respondWithResult(_0xe265f8,0xc9))[_0x15fa('0x2d')](handleError(_0xe265f8,null));};exports[_0x15fa('0x37')]=function(_0x3d1fa3,_0x2a7222){if(_0x3d1fa3['body']['id']){delete _0x3d1fa3['body']['id'];}return db[_0x15fa('0x3b')]['find']({'where':{'id':_0x3d1fa3[_0x15fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x2a7222,null))['then'](saveUpdates(_0x3d1fa3['body'],null))['then'](respondWithResult(_0x2a7222,null))['catch'](handleError(_0x2a7222,null));};exports[_0x15fa('0x59')]=function(_0x4ecdce,_0x5b3137){return db[_0x15fa('0x3b')][_0x15fa('0x57')]({'where':{'id':_0x4ecdce[_0x15fa('0x53')]['id']}})[_0x15fa('0x23')](handleEntityNotFound(_0x5b3137,null))[_0x15fa('0x23')](removeEntity(_0x5b3137,null))['catch'](handleError(_0x5b3137,null));};exports[_0x15fa('0x5a')]=function(_0x339724,_0x578c34){return db[_0x15fa('0x3b')][_0x15fa('0x5a')]()[_0x15fa('0x23')](respondWithResult(_0x578c34,null))['catch'](handleError(_0x578c34,null));};var interaction_log=require(_0x15fa('0x16'))(_0x15fa('0x5b'));exports[_0x15fa('0x5c')]=function(_0x382770,_0x2fe050,_0x173d57){var _0xe9661d={'channel':_0x15fa('0x5d')};if(_0x382770['body']['id']){delete _0x382770[_0x15fa('0x5e')]['id'];}_0x382770[_0x15fa('0x5e')][_0x15fa('0x5f')]=!![];_0x382770[_0x15fa('0x5e')][_0x15fa('0x60')]=moment()[_0x15fa('0x61')](_0x15fa('0x62'));_0x382770[_0x15fa('0x5e')][_0x15fa('0x63')]=_0x382770['body'][_0x15fa('0x63')]||_0x382770[_0x15fa('0x64')]['id'];return db['SmsMessage'][_0x15fa('0x57')]({'where':{'id':_0x382770[_0x15fa('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x15fa('0x65')],'as':_0x15fa('0x66')}]})[_0x15fa('0x23')](handleEntityNotFound(_0x2fe050,null))[_0x15fa('0x23')](saveUpdates(_0x382770['body'],null))['then'](function(_0x2f73f2){if(_0x2f73f2){_0xe9661d['message']=_0x2f73f2[_0x15fa('0x67')]({'plain':!![]});return db[_0x15fa('0x68')][_0x15fa('0x57')]({'where':{'id':_0x2f73f2[_0x15fa('0x69')]}});}return null;})[_0x15fa('0x23')](handleEntityNotFound(_0x2fe050,null))[_0x15fa('0x23')](function(_0x2a13db){if(_0x2a13db){return _0x2a13db[_0x15fa('0x37')]({'UserId':_0x382770[_0x15fa('0x5e')]['UserId'],'read1stAt':_[_0x15fa('0x6a')](_0x2a13db['read1stAt'])?moment()[_0x15fa('0x61')](_0x15fa('0x62')):undefined});}return null;})['then'](function(_0x2dfc37){if(_0x2dfc37){_0xe9661d[_0x15fa('0x6b')]=_0x2dfc37['get']({'plain':!![]});interaction_log[_0x15fa('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x382770['user']['id'],_0x382770[_0x15fa('0x64')][_0x15fa('0x39')],_0x382770['user']['role'],_0xe9661d['interaction']['id'],_0x382770[_0x15fa('0x5e')]?JSON[_0x15fa('0x28')](_0x382770[_0x15fa('0x5e')]):_0x15fa('0x6c'));return respondWithRpcPromise(_0x15fa('0x6d'),_0x15fa('0x6e'),_0xe9661d);}return null;})[_0x15fa('0x23')](function(_0x219a61){if(_0x219a61){if(_0x382770[_0x15fa('0x5e')][_0x15fa('0x6f')]){_0xe9661d[_0x15fa('0x2b')]['interface']=util[_0x15fa('0x61')](_0x15fa('0x70'),_0x382770[_0x15fa('0x64')][_0x15fa('0x39')]);_0xe9661d[_0x15fa('0x2b')][_0x15fa('0x71')]=_0xe9661d['channel'];_0xe9661d[_0x15fa('0x2b')]['event']='accept';return respondWithRpcPromise(_0x15fa('0x72'),_0x15fa('0x72'),{'event':'acceptmessage','message':_0xe9661d[_0x15fa('0x2b')]},client9002)['then'](function(){return _0xe9661d;});}return _0xe9661d;}return null;})['then'](respondWithResult(_0x2fe050,null))[_0x15fa('0x2d')](handleError(_0x2fe050,null));};var interaction_log=require(_0x15fa('0x16'))(_0x15fa('0x5b'));exports[_0x15fa('0x73')]=function(_0x3f01b1,_0x4564a5,_0x3a0a7d){var _0x273934={'agent':{},'channel':_0x15fa('0x5d')};if(_0x3f01b1[_0x15fa('0x5e')]['id']){delete _0x3f01b1[_0x15fa('0x5e')]['id'];}_0x3f01b1[_0x15fa('0x5e')][_0x15fa('0x63')]=_0x3f01b1['body'][_0x15fa('0x63')]||_0x3f01b1[_0x15fa('0x64')]['id'];_0x273934[_0x15fa('0x74')]['id']=_0x3f01b1['body'][_0x15fa('0x63')];return db[_0x15fa('0x3b')][_0x15fa('0x57')]({'where':{'id':_0x3f01b1[_0x15fa('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4564a5,null))[_0x15fa('0x23')](function(_0x2952c0){if(_0x2952c0){_0x273934[_0x15fa('0x2b')]=_0x2952c0['get']({'plain':!![]});return db['SmsInteraction'][_0x15fa('0x57')]({'where':{'id':_0x2952c0[_0x15fa('0x69')]}});}return null;})[_0x15fa('0x23')](handleEntityNotFound(_0x4564a5,null))[_0x15fa('0x23')](function(_0xe114cc){if(_0xe114cc){_0x273934[_0x15fa('0x6b')]=_0xe114cc[_0x15fa('0x67')]({'plain':!![]});interaction_log[_0x15fa('0x24')](_0x15fa('0x75'),_0x3f01b1['user']['id'],_0x3f01b1[_0x15fa('0x64')][_0x15fa('0x39')],_0x3f01b1[_0x15fa('0x64')][_0x15fa('0x76')],_0x273934[_0x15fa('0x6b')]['id'],_0x3f01b1['body']?JSON[_0x15fa('0x28')](_0x3f01b1[_0x15fa('0x5e')]):_0x15fa('0x6c'));return respondWithRpcPromise(_0x15fa('0x77'),'rejectMessage',_0x273934);}return null;})[_0x15fa('0x23')](function(_0x329112){if(_0x329112){_0x329112[_0x15fa('0x2b')][_0x15fa('0x78')]=util[_0x15fa('0x61')]('SIP/%s',_0x3f01b1[_0x15fa('0x64')][_0x15fa('0x39')]);_0x329112[_0x15fa('0x2b')][_0x15fa('0x71')]=_0x273934['channel'];_0x329112[_0x15fa('0x2b')][_0x15fa('0x79')]=_0x15fa('0x73');respondWithRpcPromise(_0x15fa('0x72'),'EventManager',{'event':_0x15fa('0x7a'),'message':_0x329112[_0x15fa('0x2b')]},client9002);return _0x273934;}return null;})['then'](respondWithResult(_0x4564a5,null))['catch'](handleError(_0x4564a5,null));};exports['status']=function(_0x3d193d,_0x4ef50a,_0xe28f22){if(_0x3d193d['body']['id']){delete _0x3d193d['body']['id'];}var _0x1db403;return db['SmsMessage'][_0x15fa('0x57')]({'where':{'id':_0x3d193d[_0x15fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ef50a,null))[_0x15fa('0x23')](function(_0x1db637){if(_0x1db637){_0x1db403=_0x1db637;return db['SmsAccount'][_0x15fa('0x57')]({'where':{'id':_0x1db637['SmsAccountId']}});}})[_0x15fa('0x23')](handleEntityNotFound(_0x4ef50a,null))[_0x15fa('0x23')](function(_0x429d53){if(_0x429d53){logger[_0x15fa('0x7b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x15fa('0x2f'),_0x15fa('0x7c'),_0x429d53[_0x15fa('0x7d')],util[_0x15fa('0x7e')](_0x3d193d['body'],{'showHidden':![],'depth':null}));switch(_0x429d53[_0x15fa('0x7d')]){case'twilio':if(_0x3d193d['body']['MessageSid']&&_0x3d193d[_0x15fa('0x5e')][_0x15fa('0x7f')]===_0x1db403['messageId']){return _0x1db403['update']({'read':!![]});}else{logger[_0x15fa('0x29')](_0x15fa('0x80'),'status',_0x15fa('0x81'),util[_0x15fa('0x7e')](_0x3d193d[_0x15fa('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x15fa('0x82'):if(_0x3d193d['body'][_0x15fa('0x83')]&&_0x3d193d[_0x15fa('0x5e')]['MessageUUID']===_0x1db403[_0x15fa('0x84')]&&_[_0x15fa('0x85')]([_0x15fa('0x86'),'delivered'],_0x3d193d['body']['Status'])>=0x0){return _0x1db403[_0x15fa('0x37')]({'read':!![]});}else{logger['error'](_0x15fa('0x80'),_0x15fa('0x2f'),_0x15fa('0x87'),util['inspect'](_0x3d193d[_0x15fa('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x15fa('0x88'):var _0x4d5206=_0x3d193d[_0x15fa('0x5e')][_0x15fa('0x89')][0x0];if(_0x4d5206[_0x15fa('0x2f')][_0x15fa('0x8a')]===_0x15fa('0x8b')){return _0x1db403[_0x15fa('0x37')]({'read':!![]});}else{logger['error'](_0x15fa('0x80'),_0x15fa('0x2f'),_0x15fa('0x88'),util[_0x15fa('0x7e')](_0x3d193d[_0x15fa('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1db403;}})['then'](respondWithResult(_0x4ef50a,null))[_0x15fa('0x2d')](handleError(_0x4ef50a,null));}; \ No newline at end of file +var _0x2ef4=['null','RejectMessage','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','infobip','results','groupName','DELIVERED','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','test','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','destroy','stack','name','send','SmsMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','field','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x2ef4,0x1ac));var _0x42ef=function(_0x30f2c2,_0x7d0f84){_0x30f2c2=_0x30f2c2-0x0;var _0x65c684=_0x2ef4[_0x30f2c2];return _0x65c684;};'use strict';var pdf=require(_0x42ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x42ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42ef('0x2'));var rp=require(_0x42ef('0x3'));var moment=require(_0x42ef('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x42ef('0x5'));var path=require(_0x42ef('0x6'));var sox=require(_0x42ef('0x7'));var csv=require(_0x42ef('0x8'));var ejs=require(_0x42ef('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42ef('0xa'));var crypto=require('crypto');var jsforce=require(_0x42ef('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x42ef('0x8'));var querystring=require(_0x42ef('0xc'));var Papa=require(_0x42ef('0xd'));var Redis=require(_0x42ef('0xe'));var authService=require(_0x42ef('0xf'));var qs=require(_0x42ef('0x10'));var hardwareService=require(_0x42ef('0x11'));var logger=require(_0x42ef('0x12'))(_0x42ef('0x13'));var utils=require('../../config/utils');var config=require(_0x42ef('0x14'));var db=require(_0x42ef('0x15'))['db'];config[_0x42ef('0x16')]=_[_0x42ef('0x17')](config[_0x42ef('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x42ef('0x18'))(new Redis(config[_0x42ef('0x16')]));require(_0x42ef('0x19'))[_0x42ef('0x1a')](socket);var jayson=require(_0x42ef('0x1b'));var client=jayson[_0x42ef('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x42ef('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x377696,_0x1111e9,_0x4a8ab5){if(_0x4a8ab5){var _0x360f38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x360f38[_0x42ef('0x1d')](_0x1111e9)){return _0x377696;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x377696;}}function respondWithRpcPromise(_0x63594e,_0x37faff,_0x1ff95b,_0x354981){return new BPromise(function(_0x158934,_0x5edd40){var _0x466822=_0x354981||client;return _0x466822[_0x42ef('0x1e')](_0x63594e,_0x1ff95b)[_0x42ef('0x1f')](function(_0x27d007){logger[_0x42ef('0x20')](_0x42ef('0x21'),_0x37faff,'request\x20sent');logger[_0x42ef('0x22')](_0x42ef('0x23'),_0x37faff,'request\x20sent',JSON[_0x42ef('0x24')](_0x27d007));if(_0x27d007[_0x42ef('0x25')]){if(_0x27d007['error'][_0x42ef('0x26')]===0x1f4){logger['error'](_0x42ef('0x21'),_0x37faff,_0x27d007['error'][_0x42ef('0x27')]);return _0x5edd40(_0x27d007['error'][_0x42ef('0x27')]);}logger[_0x42ef('0x25')]('SmsMessage,\x20%s,\x20%s',_0x37faff,_0x27d007[_0x42ef('0x25')][_0x42ef('0x27')]);return _0x158934(_0x27d007[_0x42ef('0x25')]['message']);}else{logger['info'](_0x42ef('0x21'),_0x37faff,_0x42ef('0x28'));_0x158934(_0x27d007['result'][_0x42ef('0x27')]);}})[_0x42ef('0x29')](function(_0x3f8bd6){logger[_0x42ef('0x25')](_0x42ef('0x21'),_0x37faff,_0x3f8bd6);_0x5edd40(_0x3f8bd6);});});}function respondWithStatusCode(_0x1ce184,_0x3ed632){_0x3ed632=_0x3ed632||0xcc;return function(_0x5d9c68){if(_0x5d9c68){return _0x1ce184[_0x42ef('0x2a')](_0x3ed632);}return _0x1ce184[_0x42ef('0x2b')](_0x3ed632)[_0x42ef('0x2c')]();};}function respondWithResult(_0x472da3,_0x448dc1){_0x448dc1=_0x448dc1||0xc8;return function(_0x1c4a3d){if(_0x1c4a3d){return _0x472da3[_0x42ef('0x2b')](_0x448dc1)['json'](_0x1c4a3d);}};}function respondWithFilteredResult(_0x435479,_0x4a84b0){return function(_0x2a4370){if(_0x2a4370){var _0x5b9105=_0x2a4370[_0x42ef('0x2d')],_0x139200=_0x4a84b0['offset'],_0x4e789d=_0x4a84b0[_0x42ef('0x2e')]+_0x4a84b0[_0x42ef('0x2f')],_0x38501c;if(_0x4e789d>=_0x5b9105){_0x4e789d=_0x5b9105;_0x38501c=0xc8;}else{_0x38501c=0xce;}_0x435479[_0x42ef('0x2b')](_0x38501c);return _0x435479[_0x42ef('0x30')]('Content-Range',_0x139200+'-'+_0x4e789d+'/'+_0x5b9105)[_0x42ef('0x31')](_0x2a4370);}return null;};}function patchUpdates(_0x3c5ac0){return function(_0x19039e){try{jsonpatch['apply'](_0x19039e,_0x3c5ac0,!![]);}catch(_0xbf40de){return BPromise[_0x42ef('0x32')](_0xbf40de);}return _0x19039e[_0x42ef('0x33')]();};}function saveUpdates(_0x25a7fc,_0x2530cf){return function(_0x35f6e7){if(_0x35f6e7){return _0x35f6e7[_0x42ef('0x34')](_0x25a7fc)[_0x42ef('0x1f')](function(_0x13a62b){return _0x13a62b;});}return null;};}function removeEntity(_0x923f5b,_0x5dab8f){return function(_0xdfcc72){if(_0xdfcc72){return _0xdfcc72[_0x42ef('0x35')]()[_0x42ef('0x1f')](function(){_0x923f5b[_0x42ef('0x2b')](0xcc)[_0x42ef('0x2c')]();});}};}function handleEntityNotFound(_0x578686,_0x1f9a26){return function(_0x32e419){if(!_0x32e419){_0x578686[_0x42ef('0x2a')](0x194);}return _0x32e419;};}function handleError(_0x4c9014,_0x449d1a){_0x449d1a=_0x449d1a||0x1f4;return function(_0x1ee749){logger[_0x42ef('0x25')](_0x1ee749[_0x42ef('0x36')]);if(_0x1ee749[_0x42ef('0x37')]){delete _0x1ee749[_0x42ef('0x37')];}_0x4c9014[_0x42ef('0x2b')](_0x449d1a)[_0x42ef('0x38')](_0x1ee749);};}exports['index']=function(_0x484f5d,_0x2229ef){var _0xef264a={},_0x4cca14={},_0x20e278={'count':0x0,'rows':[]};var _0x197f07=db[_0x42ef('0x39')][_0x42ef('0x3a')];_0x4cca14[_0x42ef('0x3b')]=_[_0x42ef('0x3c')](_0x197f07);_0x4cca14[_0x42ef('0x3d')]=_['keys'](_0x484f5d[_0x42ef('0x3d')]);_0x4cca14[_0x42ef('0x3e')]=_['intersection'](_0x4cca14[_0x42ef('0x3b')],_0x4cca14['query']);_0xef264a[_0x42ef('0x3f')]=_[_0x42ef('0x40')](_0x4cca14['model'],qs[_0x42ef('0x41')](_0x484f5d['query'][_0x42ef('0x41')]));_0xef264a[_0x42ef('0x3f')]=_0xef264a['attributes'][_0x42ef('0x42')]?_0xef264a['attributes']:_0x4cca14[_0x42ef('0x3b')];if(!_0x484f5d[_0x42ef('0x3d')][_0x42ef('0x43')]('nolimit')){_0xef264a[_0x42ef('0x2f')]=qs[_0x42ef('0x2f')](_0x484f5d[_0x42ef('0x3d')][_0x42ef('0x2f')]);_0xef264a[_0x42ef('0x2e')]=qs[_0x42ef('0x2e')](_0x484f5d[_0x42ef('0x3d')]['offset']);}_0xef264a[_0x42ef('0x44')]=qs[_0x42ef('0x45')](_0x484f5d[_0x42ef('0x3d')][_0x42ef('0x45')]);_0xef264a[_0x42ef('0x46')]=qs['filters'](_[_0x42ef('0x47')](_0x484f5d[_0x42ef('0x3d')],_0x4cca14[_0x42ef('0x3e')]));if(_0x484f5d[_0x42ef('0x3d')][_0x42ef('0x48')]){_0xef264a[_0x42ef('0x46')]=_[_0x42ef('0x49')](_0xef264a[_0x42ef('0x46')],{'$or':_['map'](_0x197f07,function(_0x24fe3e){if(_0x24fe3e['type'][_0x42ef('0x4a')]!=='VIRTUAL'){var _0x2ed2f4={};_0x2ed2f4[_0x24fe3e[_0x42ef('0x4b')]]={'$like':'%'+_0x484f5d['query'][_0x42ef('0x48')]+'%'};return _0x2ed2f4;}})});}_0xef264a=_[_0x42ef('0x49')]({},_0xef264a,_0x484f5d['options']);var _0x2b651d={'where':_0xef264a[_0x42ef('0x46')]};return db[_0x42ef('0x39')][_0x42ef('0x2d')](_0x2b651d)[_0x42ef('0x1f')](function(_0x25ec31){_0x20e278[_0x42ef('0x2d')]=_0x25ec31;if(_0x484f5d[_0x42ef('0x3d')][_0x42ef('0x4c')]){_0xef264a[_0x42ef('0x4d')]=[{'all':!![]}];}return db[_0x42ef('0x39')][_0x42ef('0x4e')](_0xef264a);})[_0x42ef('0x1f')](function(_0xbe2a0f){_0x20e278[_0x42ef('0x4f')]=_0xbe2a0f;return _0x20e278;})[_0x42ef('0x1f')](respondWithFilteredResult(_0x2229ef,_0xef264a))[_0x42ef('0x29')](handleError(_0x2229ef,null));};exports[_0x42ef('0x50')]=function(_0x389d17,_0x5a46af){var _0x554199={'raw':!![],'where':{'id':_0x389d17[_0x42ef('0x51')]['id']}},_0x3505e0={};_0x3505e0[_0x42ef('0x3b')]=_[_0x42ef('0x3c')](db[_0x42ef('0x39')][_0x42ef('0x3a')]);_0x3505e0[_0x42ef('0x3d')]=_[_0x42ef('0x3c')](_0x389d17[_0x42ef('0x3d')]);_0x3505e0['filters']=_[_0x42ef('0x40')](_0x3505e0[_0x42ef('0x3b')],_0x3505e0[_0x42ef('0x3d')]);_0x554199[_0x42ef('0x3f')]=_['intersection'](_0x3505e0[_0x42ef('0x3b')],qs[_0x42ef('0x41')](_0x389d17[_0x42ef('0x3d')][_0x42ef('0x41')]));_0x554199[_0x42ef('0x3f')]=_0x554199[_0x42ef('0x3f')][_0x42ef('0x42')]?_0x554199[_0x42ef('0x3f')]:_0x3505e0[_0x42ef('0x3b')];if(_0x389d17[_0x42ef('0x3d')]['includeAll']){_0x554199[_0x42ef('0x4d')]=[{'all':!![]}];}_0x554199=_[_0x42ef('0x49')]({},_0x554199,_0x389d17[_0x42ef('0x52')]);return db['SmsMessage'][_0x42ef('0x53')](_0x554199)[_0x42ef('0x1f')](handleEntityNotFound(_0x5a46af,null))[_0x42ef('0x1f')](respondWithResult(_0x5a46af,null))[_0x42ef('0x29')](handleError(_0x5a46af,null));};exports['create']=function(_0x142fcb,_0x54dff8){return db[_0x42ef('0x39')][_0x42ef('0x54')](_0x142fcb[_0x42ef('0x55')],{})['then'](respondWithResult(_0x54dff8,0xc9))['catch'](handleError(_0x54dff8,null));};exports[_0x42ef('0x34')]=function(_0x3a0e2f,_0x426c85){if(_0x3a0e2f[_0x42ef('0x55')]['id']){delete _0x3a0e2f[_0x42ef('0x55')]['id'];}return db[_0x42ef('0x39')][_0x42ef('0x53')]({'where':{'id':_0x3a0e2f[_0x42ef('0x51')]['id']}})[_0x42ef('0x1f')](handleEntityNotFound(_0x426c85,null))[_0x42ef('0x1f')](saveUpdates(_0x3a0e2f['body'],null))[_0x42ef('0x1f')](respondWithResult(_0x426c85,null))['catch'](handleError(_0x426c85,null));};exports[_0x42ef('0x35')]=function(_0x2d2e46,_0x34ab6f){return db[_0x42ef('0x39')][_0x42ef('0x53')]({'where':{'id':_0x2d2e46[_0x42ef('0x51')]['id']}})[_0x42ef('0x1f')](handleEntityNotFound(_0x34ab6f,null))['then'](removeEntity(_0x34ab6f,null))[_0x42ef('0x29')](handleError(_0x34ab6f,null));};exports[_0x42ef('0x56')]=function(_0x5f2be6,_0x18f8a2){return db['SmsMessage']['describe']()[_0x42ef('0x1f')](respondWithResult(_0x18f8a2,null))[_0x42ef('0x29')](handleError(_0x18f8a2,null));};var interaction_log=require(_0x42ef('0x12'))(_0x42ef('0x57'));exports[_0x42ef('0x58')]=function(_0x165e89,_0x5ab7af,_0x437028){var _0x42e261={'channel':_0x42ef('0x59')};if(_0x165e89[_0x42ef('0x55')]['id']){delete _0x165e89[_0x42ef('0x55')]['id'];}_0x165e89['body']['read']=!![];_0x165e89['body'][_0x42ef('0x5a')]=moment()[_0x42ef('0x5b')](_0x42ef('0x5c'));_0x165e89[_0x42ef('0x55')][_0x42ef('0x5d')]=_0x165e89['body'][_0x42ef('0x5d')]||_0x165e89[_0x42ef('0x5e')]['id'];return db[_0x42ef('0x39')][_0x42ef('0x53')]({'where':{'id':_0x165e89[_0x42ef('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x42ef('0x5f')],'as':_0x42ef('0x60')}]})['then'](handleEntityNotFound(_0x5ab7af,null))['then'](saveUpdates(_0x165e89['body'],null))[_0x42ef('0x1f')](function(_0x36e391){if(_0x36e391){_0x42e261[_0x42ef('0x27')]=_0x36e391['get']({'plain':!![]});return db[_0x42ef('0x61')][_0x42ef('0x53')]({'where':{'id':_0x36e391[_0x42ef('0x62')]}});}return null;})[_0x42ef('0x1f')](handleEntityNotFound(_0x5ab7af,null))[_0x42ef('0x1f')](function(_0x21938b){if(_0x21938b){return _0x21938b['update']({'UserId':_0x165e89[_0x42ef('0x55')][_0x42ef('0x5d')],'read1stAt':_[_0x42ef('0x63')](_0x21938b[_0x42ef('0x64')])?moment()[_0x42ef('0x5b')](_0x42ef('0x5c')):undefined});}return null;})['then'](function(_0x42bcce){if(_0x42bcce){_0x42e261[_0x42ef('0x65')]=_0x42bcce[_0x42ef('0x66')]({'plain':!![]});interaction_log[_0x42ef('0x20')](_0x42ef('0x67'),_0x165e89['user']['id'],_0x165e89[_0x42ef('0x5e')][_0x42ef('0x37')],_0x165e89['user']['role'],_0x42e261[_0x42ef('0x65')]['id'],_0x165e89[_0x42ef('0x55')]?JSON['stringify'](_0x165e89[_0x42ef('0x55')]):'null');return respondWithRpcPromise(_0x42ef('0x68'),_0x42ef('0x69'),_0x42e261);}return null;})[_0x42ef('0x1f')](function(_0x32bc26){if(_0x32bc26){if(_0x165e89[_0x42ef('0x55')][_0x42ef('0x6a')]){_0x42e261[_0x42ef('0x27')][_0x42ef('0x6b')]=util[_0x42ef('0x5b')](_0x42ef('0x6c'),_0x165e89[_0x42ef('0x5e')]['name']);_0x42e261[_0x42ef('0x27')]['channel']=_0x42e261[_0x42ef('0x6d')];_0x42e261['message'][_0x42ef('0x6e')]=_0x42ef('0x58');return respondWithRpcPromise(_0x42ef('0x6f'),_0x42ef('0x6f'),{'event':_0x42ef('0x70'),'message':_0x42e261['message']},client9002)[_0x42ef('0x1f')](function(){return _0x42e261;});}return _0x42e261;}return null;})[_0x42ef('0x1f')](respondWithResult(_0x5ab7af,null))['catch'](handleError(_0x5ab7af,null));};var interaction_log=require(_0x42ef('0x12'))(_0x42ef('0x57'));exports['reject']=function(_0x28363b,_0x4af66a,_0x37fa18){var _0x20d0e3={'agent':{},'channel':'sms'};if(_0x28363b[_0x42ef('0x55')]['id']){delete _0x28363b[_0x42ef('0x55')]['id'];}_0x28363b[_0x42ef('0x55')][_0x42ef('0x5d')]=_0x28363b[_0x42ef('0x55')][_0x42ef('0x5d')]||_0x28363b[_0x42ef('0x5e')]['id'];_0x20d0e3[_0x42ef('0x71')]['id']=_0x28363b[_0x42ef('0x55')][_0x42ef('0x5d')];return db[_0x42ef('0x39')]['find']({'where':{'id':_0x28363b['params']['id'],'UserId':null}})[_0x42ef('0x1f')](handleEntityNotFound(_0x4af66a,null))[_0x42ef('0x1f')](function(_0x54686b){if(_0x54686b){_0x20d0e3[_0x42ef('0x27')]=_0x54686b[_0x42ef('0x66')]({'plain':!![]});return db[_0x42ef('0x61')][_0x42ef('0x53')]({'where':{'id':_0x54686b[_0x42ef('0x62')]}});}return null;})[_0x42ef('0x1f')](handleEntityNotFound(_0x4af66a,null))['then'](function(_0x3010f7){if(_0x3010f7){_0x20d0e3['interaction']=_0x3010f7[_0x42ef('0x66')]({'plain':!![]});interaction_log[_0x42ef('0x20')](_0x42ef('0x72'),_0x28363b[_0x42ef('0x5e')]['id'],_0x28363b['user'][_0x42ef('0x37')],_0x28363b['user'][_0x42ef('0x73')],_0x20d0e3[_0x42ef('0x65')]['id'],_0x28363b[_0x42ef('0x55')]?JSON[_0x42ef('0x24')](_0x28363b['body']):_0x42ef('0x74'));return respondWithRpcPromise(_0x42ef('0x75'),_0x42ef('0x76'),_0x20d0e3);}return null;})[_0x42ef('0x1f')](function(_0x949b9c){if(_0x949b9c){_0x949b9c['message'][_0x42ef('0x6b')]=util[_0x42ef('0x5b')](_0x42ef('0x6c'),_0x28363b['user'][_0x42ef('0x37')]);_0x949b9c['message']['channel']=_0x20d0e3[_0x42ef('0x6d')];_0x949b9c[_0x42ef('0x27')][_0x42ef('0x6e')]=_0x42ef('0x32');respondWithRpcPromise(_0x42ef('0x6f'),_0x42ef('0x6f'),{'event':_0x42ef('0x77'),'message':_0x949b9c[_0x42ef('0x27')]},client9002);return _0x20d0e3;}return null;})['then'](respondWithResult(_0x4af66a,null))['catch'](handleError(_0x4af66a,null));};exports[_0x42ef('0x2b')]=function(_0x1fcf18,_0x9b5f7a,_0x441fd7){if(_0x1fcf18[_0x42ef('0x55')]['id']){delete _0x1fcf18[_0x42ef('0x55')]['id'];}var _0x1320f3;return db[_0x42ef('0x39')][_0x42ef('0x53')]({'where':{'id':_0x1fcf18[_0x42ef('0x51')]['id']}})[_0x42ef('0x1f')](handleEntityNotFound(_0x9b5f7a,null))[_0x42ef('0x1f')](function(_0xf5834c){if(_0xf5834c){_0x1320f3=_0xf5834c;return db[_0x42ef('0x78')][_0x42ef('0x53')]({'where':{'id':_0xf5834c[_0x42ef('0x79')]}});}})['then'](handleEntityNotFound(_0x9b5f7a,null))[_0x42ef('0x1f')](function(_0x1a6cec){if(_0x1a6cec){logger[_0x42ef('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42ef('0x2b'),'received\x20delivery\x20report\x20from',_0x1a6cec[_0x42ef('0x7a')],util[_0x42ef('0x7b')](_0x1fcf18[_0x42ef('0x55')],{'showHidden':![],'depth':null}));switch(_0x1a6cec['type']){case'twilio':if(_0x1fcf18[_0x42ef('0x55')][_0x42ef('0x7c')]&&_0x1fcf18[_0x42ef('0x55')]['MessageSid']===_0x1320f3[_0x42ef('0x7d')]){return _0x1320f3['update']({'read':!![]});}else{logger[_0x42ef('0x25')](_0x42ef('0x7e'),_0x42ef('0x2b'),_0x42ef('0x7f'),util[_0x42ef('0x7b')](_0x1fcf18[_0x42ef('0x55')],{'showHidden':![],'depth':null}));}break;case _0x42ef('0x80'):if(_0x1fcf18[_0x42ef('0x55')][_0x42ef('0x81')]&&_0x1fcf18[_0x42ef('0x55')][_0x42ef('0x81')]===_0x1320f3[_0x42ef('0x7d')]&&_[_0x42ef('0x82')](['sent',_0x42ef('0x83')],_0x1fcf18['body']['Status'])>=0x0){return _0x1320f3[_0x42ef('0x34')]({'read':!![]});}else{logger[_0x42ef('0x25')](_0x42ef('0x7e'),_0x42ef('0x2b'),'plivio',util[_0x42ef('0x7b')](_0x1fcf18[_0x42ef('0x55')],{'showHidden':![],'depth':null}));}break;case _0x42ef('0x84'):var _0x399308=_0x1fcf18[_0x42ef('0x55')][_0x42ef('0x85')][0x0];if(_0x399308[_0x42ef('0x2b')][_0x42ef('0x86')]===_0x42ef('0x87')){return _0x1320f3[_0x42ef('0x34')]({'read':!![]});}else{logger[_0x42ef('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x42ef('0x2b'),_0x42ef('0x84'),util[_0x42ef('0x7b')](_0x1fcf18[_0x42ef('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x1320f3;}})[_0x42ef('0x1f')](respondWithResult(_0x9b5f7a,null))[_0x42ef('0x29')](handleError(_0x9b5f7a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2288340..7285379 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 _0x0427=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','SmsMessage'];(function(_0x2cd10f,_0x4cd9d9){var _0x554d04=function(_0xa85f52){while(--_0xa85f52){_0x2cd10f['push'](_0x2cd10f['shift']());}};_0x554d04(++_0x4cd9d9);}(_0x0427,0x137));var _0x7042=function(_0x3c8aae,_0x2406ce){_0x3c8aae=_0x3c8aae-0x0;var _0x1e4e40=_0x0427[_0x3c8aae];return _0x1e4e40;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x7042('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7042('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7042('0x2'),'afterDestroy':_0x7042('0x3')};function emitEvent(_0xae8bc2){return function(_0x1db1f3,_0xa72963,_0x343a69){SmsMessageEvents[_0x7042('0x4')](_0xae8bc2+':'+_0x1db1f3['id'],_0x1db1f3);SmsMessageEvents['emit'](_0xae8bc2,_0x1db1f3);_0x343a69(null);};}for(var e in events){if(events[_0x7042('0x5')](e)){var event=events[e];SmsMessage[_0x7042('0x6')](e,emitEvent(event));}}module[_0x7042('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x087b=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x49aeb5,_0x3ae701){var _0x1d4a41=function(_0x177c5d){while(--_0x177c5d){_0x49aeb5['push'](_0x49aeb5['shift']());}};_0x1d4a41(++_0x3ae701);}(_0x087b,0x11a));var _0xb087=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x087b[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xb087('0x0'));var SmsMessage=require(_0xb087('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb087('0x2'),'afterUpdate':'update','afterDestroy':_0xb087('0x3')};function emitEvent(_0x2020b7){return function(_0x1d3299,_0xf1cf84,_0x183efd){SmsMessageEvents[_0xb087('0x4')](_0x2020b7+':'+_0x1d3299['id'],_0x1d3299);SmsMessageEvents[_0xb087('0x4')](_0x2020b7,_0x1d3299);_0x183efd(null);};}for(var e in events){if(events[_0xb087('0x5')](e)){var event=events[e];SmsMessage[_0xb087('0x6')](e,emitEvent(event));}}module[_0xb087('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 152cb26..97d023d 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 _0x7034=['senderString','https://smsapi.connectel.se/api/send/','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','md5','hex','https://sms.csc.lv/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','body','FULLTEXT','models','toLowerCase','direction','out','secret','UserId','SmsInteraction','findOne','then','update','catch','error','SmsAccount','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password'];(function(_0x1d3b2e,_0x3d03f8){var _0x3a6a83=function(_0x19dac2){while(--_0x19dac2){_0x1d3b2e['push'](_0x1d3b2e['shift']());}};_0x3a6a83(++_0x3d03f8);}(_0x7034,0xa8));var _0x4703=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7034[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x4703('0x0'));var util=require('util');var logger=require(_0x4703('0x1'))(_0x4703('0x2'));var moment=require(_0x4703('0x3'));var BPromise=require(_0x4703('0x4'));var rp=require(_0x4703('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4703('0x6'));var config=require(_0x4703('0x7'));var attributes=require(_0x4703('0x8'));module['exports']=function(_0x546e6e,_0x49624a){return _0x546e6e[_0x4703('0x9')](_0x4703('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x4703('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x4703('0xc')],'type':_0x4703('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22fec6,_0x598efa,_0xba966a){var _0x59f346=_0x546e6e[_0x4703('0xe')];var _0x490f0e=_0x22fec6['get']({'plain':!![]});if(_0x490f0e['direction'][_0x4703('0xf')]()==='in'||_0x490f0e[_0x4703('0x10')][_0x4703('0xf')]()===_0x4703('0x11')&&!_0x490f0e[_0x4703('0x12')]&&!_['isNil'](_0x490f0e[_0x4703('0x13')])){_0x59f346[_0x4703('0x14')][_0x4703('0x15')]({'where':{'id':_0x490f0e['SmsInteractionId']}})[_0x4703('0x16')](function(_0x3ae02f){if(_0x3ae02f){_0x3ae02f[_0x4703('0x17')]({'lastMsgAt':_0x490f0e['createdAt'],'lastMsgDirection':_0x490f0e[_0x4703('0x10')][_0x4703('0xf')]()});}})[_0x4703('0x18')](function(_0x20dc99){console[_0x4703('0x19')](_0x20dc99);});}if(_0x490f0e['direction']==='out'&&!_0x490f0e[_0x4703('0x12')]){var _0x29ddee;_0x59f346[_0x4703('0x1a')]['find']({'where':{'id':_0x490f0e['SmsAccountId']},'raw':!![]})[_0x4703('0x16')](function(_0x135403){_0x29ddee=_0x135403;if(_0x29ddee&&_0x29ddee[_0x4703('0x1b')]){switch(_0x29ddee[_0x4703('0x1b')]){case _0x4703('0x1c'):var _0x10393f=require(_0x4703('0x1c'));if(_0x29ddee[_0x4703('0x1d')]&&_0x29ddee[_0x4703('0x1e')]&&_0x29ddee[_0x4703('0x1f')]){var _0x4edc06=new _0x10393f(_0x29ddee[_0x4703('0x1d')],_0x29ddee['authToken']);_0x4edc06[_0x4703('0x20')]['create']({'body':_0x490f0e[_0x4703('0xc')],'to':_0x490f0e[_0x4703('0x1f')],'from':_0x29ddee['phone'],'statusCallback':_0x29ddee[_0x4703('0x21')]+_0x4703('0x22')+_0x490f0e['id']+_0x4703('0x23')+_0x29ddee[_0x4703('0x24')]})['then'](function(_0x52e67c){if(_0x52e67c[_0x4703('0x25')]){return _0x22fec6[_0x4703('0x17')]({'messageId':_0x52e67c['sid']});}})[_0x4703('0x18')](function(_0x2ded69){logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),'twilio',util[_0x4703('0x27')](_0x2ded69,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),_0x4703('0x1c'),_0x4703('0x28'));}break;case _0x4703('0x29'):var _0x44a4fa=_0x4703('0x2a');if(_0x29ddee[_0x4703('0x2b')]&&_0x29ddee[_0x4703('0x2c')]){var _0x3078d6={'recipient':[_0x490f0e[_0x4703('0x1f')]],'message':_0x490f0e[_0x4703('0xc')],'message_type':_0x29ddee['smsMethod']};if(_0x29ddee[_0x4703('0x2d')]&&_0x29ddee[_0x4703('0x2d')]!=='SI'){_0x3078d6['sender']=_0x29ddee[_0x4703('0x1f')];}var _0x2b7de2={'url':_0x44a4fa+_0x4703('0x2e')+_0x29ddee[_0x4703('0x2b')]+_0x4703('0x2f')+_0x29ddee[_0x4703('0x2c')],'method':_0x4703('0x30')};rp(_0x2b7de2)[_0x4703('0x16')](function(_0x4629b0){var _0x1611ae=_0x4629b0[_0x4703('0x31')](';');var _0xa9c13c={'user_key':_0x1611ae[0x0],'session_key':_0x1611ae[0x1]};_0x2b7de2={'url':_0x44a4fa+_0x4703('0x32'),'method':_0x4703('0x33'),'headers':{'user_key':_0xa9c13c[_0x4703('0x34')],'Session_key':_0xa9c13c['session_key']},'json':!![],'body':_0x3078d6};return rp(_0x2b7de2);})[_0x4703('0x16')](function(_0x9217a3){if(_0x9217a3[_0x4703('0x35')]>=0x1){var _0x2950ff={'messageId':_0x9217a3[_0x4703('0x36')]};if(_0x29ddee[_0x4703('0x2d')]!=='GP'||!_0x29ddee['deliveryReport']){_0x2950ff[_0x4703('0x37')]=!![];}return _0x22fec6[_0x4703('0x17')](_0x2950ff);}else{return logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),'skebby',util[_0x4703('0x27')](_0x9217a3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2882c6){return logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),_0x4703('0x29'),util[_0x4703('0x27')](_0x2882c6,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x29'),_0x4703('0x39'));}break;case'connectel':if(_0x29ddee[_0x4703('0x1e')]){var _0x4a5bda={'recipient':_0x490f0e[_0x4703('0x1f')],'message':_0x490f0e[_0x4703('0xc')],'sender':_0x29ddee[_0x4703('0x3a')]||_0x29ddee[_0x4703('0x1f')],'authorization':_0x29ddee[_0x4703('0x1e')]};var _0x598efa={'method':_0x4703('0x33'),'uri':_0x4703('0x3b'),'body':_0x4a5bda,'json':!![]};rp(_0x598efa)['then'](function(_0x8563aa){var _0x497907={'messageId':_0x8563aa['requestid']};if(!_0x29ddee[_0x4703('0x3c')]){_0x497907[_0x4703('0x37')]=!![];}return _0x22fec6['update'](_0x497907);})['catch'](function(_0x40a684){logger[_0x4703('0x19')](_0x4703('0x38'),'afterCreate',_0x4703('0x3d'),util[_0x4703('0x27')](_0x40a684,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),_0x4703('0x3d'),_0x4703('0x3e'));}break;case _0x4703('0x3f'):if(_0x29ddee[_0x4703('0x2b')]&&_0x29ddee[_0x4703('0x2c')]){var _0x4a5bda={'messages':[{'source':'xCALLY\x20Motion','to':_0x490f0e['phone'],'body':_0x490f0e[_0x4703('0xc')],'from':_0x29ddee[_0x4703('0x3a')]||_0x29ddee[_0x4703('0x1f')]}]};var _0x2fdfff=util[_0x4703('0x40')](_0x4703('0x41'),_0x29ddee[_0x4703('0x2b')],_0x29ddee[_0x4703('0x2c')]);var _0x598efa={'method':_0x4703('0x33'),'uri':_0x4703('0x42'),'body':_0x4a5bda,'headers':{'Authorization':util[_0x4703('0x40')]('Basic\x20%s',new Buffer(_0x2fdfff)['toString'](_0x4703('0x43')))},'json':!![]};rp(_0x598efa)[_0x4703('0x16')](function(_0x42b86b){if(_0x42b86b[_0x4703('0x44')]>=0xc8&&_0x42b86b[_0x4703('0x44')]<=0xce){if(_0x42b86b['data']&&_0x42b86b[_0x4703('0x45')]['queued_count']>0x0){var _0x5e4359=_[_0x4703('0x46')](_0x42b86b[_0x4703('0x45')][_0x4703('0x20')]);var _0x2f2436={'messageId':_0x5e4359[_0x4703('0x47')]};if(!_0x29ddee[_0x4703('0x3c')]){_0x2f2436[_0x4703('0x37')]=!![];}return _0x22fec6[_0x4703('0x17')](_0x2f2436);}else{logger[_0x4703('0x19')](_0x4703('0x38'),'afterCreate',_0x4703('0x48'),util[_0x4703('0x27')](_0x42b86b,{'showHidden':![],'depth':null}));}}else{logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),'clickSend',util[_0x4703('0x27')](_0x42b86b,{'showHidden':![],'depth':null}));}})[_0x4703('0x18')](function(_0x1b7044){logger['error'](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x48'),util[_0x4703('0x27')](_0x1b7044,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4703('0x26'),'clickSend',_0x4703('0x39'));}break;case _0x4703('0x49'):if(_0x29ddee[_0x4703('0x4a')]&&_0x29ddee[_0x4703('0x1e')]){var _0x4a5bda={'dst':_0x490f0e[_0x4703('0x1f')],'text':_0x490f0e[_0x4703('0xc')],'src':_0x29ddee[_0x4703('0x3a')]||_0x29ddee[_0x4703('0x1f')],'url':_0x29ddee['remote']+_0x4703('0x22')+_0x490f0e['id']+_0x4703('0x23')+_0x29ddee[_0x4703('0x24')]};var _0x2fdfff=util[_0x4703('0x40')](_0x4703('0x41'),_0x29ddee[_0x4703('0x4a')],_0x29ddee['authToken']);var _0x598efa={'method':_0x4703('0x33'),'uri':util['format'](_0x4703('0x4b'),_0x29ddee[_0x4703('0x4a')]),'body':_0x4a5bda,'headers':{'Authorization':util['format'](_0x4703('0x4c'),new Buffer(_0x2fdfff)[_0x4703('0x4d')](_0x4703('0x43')))},'json':!![]};rp(_0x598efa)[_0x4703('0x16')](function(_0x3cfb36){var _0x216eab={'messageId':_0x3cfb36[_0x4703('0x4e')][0x0]};return _0x22fec6[_0x4703('0x17')](_0x216eab);})[_0x4703('0x18')](function(_0x57e57c){logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x49'),util[_0x4703('0x27')](_0x57e57c,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x49'),_0x4703('0x4f'));}break;case _0x4703('0x50'):if(_0x29ddee[_0x4703('0x2b')]&&_0x29ddee[_0x4703('0x2c')]){if(_0x29ddee['baseUrl']){var _0x477a60={'method':_0x4703('0x33'),'uri':_0x29ddee[_0x4703('0x51')]+_0x4703('0x52'),'body':{'username':_0x29ddee[_0x4703('0x2b')],'password':_0x29ddee[_0x4703('0x2c')]},'json':!![]};return rp(_0x477a60)[_0x4703('0x16')](function(_0x44dbc6){var _0x502dd3={'method':_0x4703('0x33'),'uri':_0x29ddee[_0x4703('0x51')]+_0x4703('0x53'),'body':{'messages':[{'from':_0x29ddee[_0x4703('0x1f')],'destinations':[{'to':_0x490f0e[_0x4703('0x1f')]}],'text':_0x490f0e[_0x4703('0xc')],'notifyUrl':_0x29ddee[_0x4703('0x21')]+_0x4703('0x22')+_0x490f0e['id']+'/status?token='+_0x29ddee['token'],'notifyContentType':'application/json','callbackData':_0x29ddee[_0x4703('0x1f')]+';'+_0x490f0e['body']}]},'headers':{'Authorization':_0x4703('0x54')+_0x44dbc6[_0x4703('0x24')]},'json':!![]};return rp(_0x502dd3)['then'](function(_0x51891e){if(_0x51891e[_0x4703('0x20')]){var _0x1748df={'messageId':_0x51891e[_0x4703('0x20')][0x0]['messageId']};if(!_0x29ddee[_0x4703('0x3c')]){_0x1748df[_0x4703('0x37')]=!![];}return _0x22fec6['update'](_0x1748df);}else{return logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4703('0x50'),util[_0x4703('0x27')](_0x51891e,{'showHidden':![],'depth':null}));}});})[_0x4703('0x18')](function(_0x2f9b91){return logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x50'),util['inspect'](_0x2f9b91,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x50'),_0x4703('0x39'));}break;case _0x4703('0x55'):var _0x1cfc61=require(_0x4703('0x56'));if(_0x29ddee[_0x4703('0x57')]){var _0x30de4c={};_0x30de4c[_0x4703('0x58')]=_0x29ddee[_0x4703('0x2b')];_0x30de4c[_0x4703('0x1f')]=_0x490f0e[_0x4703('0x1f')];_0x30de4c['sender']=_0x29ddee[_0x4703('0x1f')];_0x30de4c[_0x4703('0x59')]=_0x490f0e[_0x4703('0xc')];_0x30de4c[_0x4703('0x5a')]=+new Date();var _0xc68d4a='';var _0x399859='';var _0x2d3dc3=Object['keys'](_0x30de4c);_0x2d3dc3[_0x4703('0x5b')]();for(var _0xecc63e=0x0;_0xecc63e<_0x2d3dc3[_0x4703('0x5c')];_0xecc63e++){if(_0xc68d4a!=''){_0xc68d4a+='&';}_0xc68d4a+=_0x2d3dc3[_0xecc63e]+'='+encodeURIComponent(_0x30de4c[_0x2d3dc3[_0xecc63e]]);_0x399859+=_0x30de4c[_0x2d3dc3[_0xecc63e]];}_0x399859+=_0x29ddee['apiKey'];_0x399859=_0x1cfc61[_0x4703('0x5d')](_0x4703('0x5e'))['update'](_0x399859)['digest'](_0x4703('0x5f'));if(_0xc68d4a!==''){_0xc68d4a+='&';}_0xc68d4a+='signature='+_0x399859;var _0x2b7de2={'method':_0x4703('0x30'),'uri':_0x4703('0x60')+_0xc68d4a,'json':!![]};return rp(_0x2b7de2)[_0x4703('0x16')](function(_0x5e8fde){var _0x58bf4f=Object[_0x4703('0x61')](_0x5e8fde);if(_0x5e8fde[_0x58bf4f[0x0]][_0x4703('0x19')]&&parseInt(_0x5e8fde[_0x58bf4f[0x0]][_0x4703('0x19')])===0x0){var _0x5042dd={'messageId':_0x5e8fde[_0x58bf4f[0x0]]['id_sms']};if(!_0x29ddee[_0x4703('0x3c')]){_0x5042dd[_0x4703('0x37')]=!![];}return _0x22fec6[_0x4703('0x17')](_0x5042dd);}else{return logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4703('0x55'),util[_0x4703('0x27')](_0x5e8fde[_0x4703('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1f4260){return logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x55'),util[_0x4703('0x27')](_0x1f4260,{'showHidden':![],'depth':null}));});}else{logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x55'),_0x4703('0x62'));}break;case _0x4703('0x63'):if(_0x29ddee[_0x4703('0x57')]){var _0x36ced6={'method':'POST','uri':_0x4703('0x64'),'headers':{'Authorization':_0x29ddee[_0x4703('0x57')]},'body':{'content':_0x490f0e[_0x4703('0xc')],'to':[_0x490f0e[_0x4703('0x1f')]],'from':_0x29ddee['phone'],'binary':![],'clientMessageId':_0x4703('0x65'),'charset':_0x4703('0x66')},'json':!![]};rp(_0x36ced6)['then'](function(_0x758681){if(!_0x758681[_0x4703('0x19')]){var _0xa85699={'messageId':_0x758681[_0x4703('0x20')][0x0]['apiMessageId']};if(!_0x29ddee['deliveryReport']){_0xa85699[_0x4703('0x37')]=!![];}return _0x22fec6[_0x4703('0x17')](_0xa85699);}else{return logger[_0x4703('0x19')](_0x4703('0x38'),'afterCreate',_0x4703('0x63'),util[_0x4703('0x27')](_0x758681[_0x4703('0x19')],{'showHidden':![],'depth':null}));}})[_0x4703('0x18')](function(_0x220487){return logger[_0x4703('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4703('0x63'),util[_0x4703('0x27')](_0x220487,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4703('0x63'),_0x4703('0x62'));}break;case _0x4703('0x67'):if(_0x29ddee['apiKey']){var _0x14b6ce={};var _0x2b7de2={'method':_0x4703('0x33'),'uri':_0x4703('0x68'),'headers':{'Authorization':_0x4703('0x69')+_0x29ddee[_0x4703('0x57')],'Content-Type':_0x4703('0x6a')},'body':{'from':_0x29ddee[_0x4703('0x1f')],'to':_0x490f0e[_0x4703('0x1f')],'text':_0x490f0e[_0x4703('0xc')]},'json':!![]};return rp(_0x2b7de2)[_0x4703('0x16')](function(_0x11da37){if(_0x11da37[_0x4703('0x6b')]==0xca){_0x14b6ce[_0x4703('0x6c')]=_0x11da37;var _0x370546={'method':'POST','uri':_0x4703('0x6d'),'headers':{'Authorization':_0x4703('0x69')+_0x29ddee['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x14b6ce[_0x4703('0x6c')][_0x4703('0x6e')]},'json':!![]};return rp(_0x370546)['then'](function(_0x117762){_0x14b6ce['status']=_0x117762;var _0x1415dd={'messageId':_0x14b6ce[_0x4703('0x6c')][_0x4703('0x6e')],'read':!![]};return _0x22fec6['update'](_0x1415dd);});}else{return logger['error'](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x67'),util[_0x4703('0x27')](_0x11da37,{'showHidden':![],'depth':null}));}})[_0x4703('0x18')](function(_0x40bac1){return logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x67'),util[_0x4703('0x27')](_0x40bac1,{'showHidden':![],'depth':null}));});}else{return logger[_0x4703('0x19')](_0x4703('0x38'),_0x4703('0x26'),_0x4703('0x67'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0xba966a();});}else{_0xba966a();}}},'charset':_0x4703('0x6f'),'collate':_0x4703('0x70')});}; \ No newline at end of file +var _0x3d0c=['error','out','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','https://api.plivo.com/v1/Account/%s/Message/','authId','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','crypto','apiKey','login','text','timestamp','keys','sort','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','csc','https://platform.clickatell.com/messages','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x3d0c,0xcd));var _0xc3d0=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x3d0c[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0xc3d0('0x0'));var util=require(_0xc3d0('0x1'));var logger=require(_0xc3d0('0x2'))('api');var moment=require(_0xc3d0('0x3'));var BPromise=require(_0xc3d0('0x4'));var rp=require(_0xc3d0('0x5'));var fs=require('fs');var path=require(_0xc3d0('0x6'));var rimraf=require('rimraf');var config=require(_0xc3d0('0x7'));var attributes=require(_0xc3d0('0x8'));module[_0xc3d0('0x9')]=function(_0x3fae1a,_0x4b6382){return _0x3fae1a['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc3d0('0xa'),'fields':['messageId']},{'name':_0xc3d0('0xb'),'fields':[_0xc3d0('0xc')],'type':_0xc3d0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1743af,_0x1e01a7,_0x3f5e96){var _0x7b52d4=_0x3fae1a[_0xc3d0('0xe')];var _0x742b3=_0x1743af['get']({'plain':!![]});if(_0x742b3[_0xc3d0('0xf')][_0xc3d0('0x10')]()==='in'||_0x742b3[_0xc3d0('0xf')]['toLowerCase']()==='out'&&!_0x742b3[_0xc3d0('0x11')]&&!_['isNil'](_0x742b3[_0xc3d0('0x12')])){_0x7b52d4[_0xc3d0('0x13')][_0xc3d0('0x14')]({'where':{'id':_0x742b3[_0xc3d0('0x15')]}})[_0xc3d0('0x16')](function(_0x2965d6){if(_0x2965d6){_0x2965d6[_0xc3d0('0x17')]({'lastMsgAt':_0x742b3[_0xc3d0('0x18')],'lastMsgDirection':_0x742b3[_0xc3d0('0xf')][_0xc3d0('0x10')]()});}})['catch'](function(_0x69c1d4){console[_0xc3d0('0x19')](_0x69c1d4);});}if(_0x742b3['direction']===_0xc3d0('0x1a')&&!_0x742b3[_0xc3d0('0x11')]){var _0x9b7331;_0x7b52d4['SmsAccount'][_0xc3d0('0x1b')]({'where':{'id':_0x742b3[_0xc3d0('0x1c')]},'raw':!![]})['then'](function(_0x55de93){_0x9b7331=_0x55de93;if(_0x9b7331&&_0x9b7331[_0xc3d0('0x1d')]){switch(_0x9b7331['type']){case _0xc3d0('0x1e'):var _0x375997=require('twilio');if(_0x9b7331[_0xc3d0('0x1f')]&&_0x9b7331[_0xc3d0('0x20')]&&_0x9b7331[_0xc3d0('0x21')]){var _0x17fe77=new _0x375997(_0x9b7331['accountSid'],_0x9b7331[_0xc3d0('0x20')]);_0x17fe77[_0xc3d0('0x22')][_0xc3d0('0x23')]({'body':_0x742b3[_0xc3d0('0xc')],'to':_0x742b3[_0xc3d0('0x21')],'from':_0x9b7331[_0xc3d0('0x21')],'statusCallback':_0x9b7331[_0xc3d0('0x24')]+_0xc3d0('0x25')+_0x742b3['id']+_0xc3d0('0x26')+_0x9b7331[_0xc3d0('0x27')]})[_0xc3d0('0x16')](function(_0x3deeb4){if(_0x3deeb4[_0xc3d0('0x28')]){return _0x1743af[_0xc3d0('0x17')]({'messageId':_0x3deeb4[_0xc3d0('0x28')]});}})[_0xc3d0('0x29')](function(_0x458376){logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x1e'),util[_0xc3d0('0x2c')](_0x458376,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3d0('0x2b'),_0xc3d0('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x154cff=_0xc3d0('0x2d');if(_0x9b7331[_0xc3d0('0x2e')]&&_0x9b7331[_0xc3d0('0x2f')]){var _0xe68d1b={'recipient':[_0x742b3[_0xc3d0('0x21')]],'message':_0x742b3['body'],'message_type':_0x9b7331[_0xc3d0('0x30')]};if(_0x9b7331[_0xc3d0('0x30')]&&_0x9b7331['smsMethod']!=='SI'){_0xe68d1b[_0xc3d0('0x31')]=_0x9b7331[_0xc3d0('0x21')];}var _0x4d1c92={'url':_0x154cff+_0xc3d0('0x32')+_0x9b7331[_0xc3d0('0x2e')]+_0xc3d0('0x33')+_0x9b7331['password'],'method':_0xc3d0('0x34')};rp(_0x4d1c92)[_0xc3d0('0x16')](function(_0x2fe83e){var _0x3c55fb=_0x2fe83e[_0xc3d0('0x35')](';');var _0x207487={'user_key':_0x3c55fb[0x0],'session_key':_0x3c55fb[0x1]};_0x4d1c92={'url':_0x154cff+_0xc3d0('0x36'),'method':'POST','headers':{'user_key':_0x207487[_0xc3d0('0x37')],'Session_key':_0x207487['session_key']},'json':!![],'body':_0xe68d1b};return rp(_0x4d1c92);})['then'](function(_0x2b1179){if(_0x2b1179['total_sent']>=0x1){var _0x52c141={'messageId':_0x2b1179[_0xc3d0('0x38')]};if(_0x9b7331[_0xc3d0('0x30')]!=='GP'||!_0x9b7331[_0xc3d0('0x39')]){_0x52c141[_0xc3d0('0x3a')]=!![];}return _0x1743af[_0xc3d0('0x17')](_0x52c141);}else{return logger['error'](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x3b'),util[_0xc3d0('0x2c')](_0x2b1179,{'showHidden':![],'depth':null}));}})['catch'](function(_0x70a7e3){return logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x3b'),util['inspect'](_0x70a7e3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x3b'),_0xc3d0('0x3c'));}break;case _0xc3d0('0x3d'):if(_0x9b7331[_0xc3d0('0x20')]){var _0x219890={'recipient':_0x742b3[_0xc3d0('0x21')],'message':_0x742b3[_0xc3d0('0xc')],'sender':_0x9b7331[_0xc3d0('0x3e')]||_0x9b7331[_0xc3d0('0x21')],'authorization':_0x9b7331['authToken']};var _0x1e01a7={'method':_0xc3d0('0x3f'),'uri':_0xc3d0('0x40'),'body':_0x219890,'json':!![]};rp(_0x1e01a7)[_0xc3d0('0x16')](function(_0x2e66e0){var _0x4634c4={'messageId':_0x2e66e0[_0xc3d0('0x41')]};if(!_0x9b7331[_0xc3d0('0x39')]){_0x4634c4[_0xc3d0('0x3a')]=!![];}return _0x1743af['update'](_0x4634c4);})['catch'](function(_0x177717){logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x3d'),util[_0xc3d0('0x2c')](_0x177717,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3d0('0x2b'),_0xc3d0('0x3d'),_0xc3d0('0x42'));}break;case _0xc3d0('0x43'):if(_0x9b7331[_0xc3d0('0x2e')]&&_0x9b7331[_0xc3d0('0x2f')]){var _0x219890={'messages':[{'source':_0xc3d0('0x44'),'to':_0x742b3[_0xc3d0('0x21')],'body':_0x742b3[_0xc3d0('0xc')],'from':_0x9b7331[_0xc3d0('0x3e')]||_0x9b7331[_0xc3d0('0x21')]}]};var _0x28dafd=util[_0xc3d0('0x45')](_0xc3d0('0x46'),_0x9b7331['username'],_0x9b7331[_0xc3d0('0x2f')]);var _0x1e01a7={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x219890,'headers':{'Authorization':util[_0xc3d0('0x45')](_0xc3d0('0x47'),new Buffer(_0x28dafd)[_0xc3d0('0x48')](_0xc3d0('0x49')))},'json':!![]};rp(_0x1e01a7)[_0xc3d0('0x16')](function(_0x56cf61){if(_0x56cf61[_0xc3d0('0x4a')]>=0xc8&&_0x56cf61[_0xc3d0('0x4a')]<=0xce){if(_0x56cf61['data']&&_0x56cf61[_0xc3d0('0x4b')][_0xc3d0('0x4c')]>0x0){var _0x4af876=_[_0xc3d0('0x4d')](_0x56cf61[_0xc3d0('0x4b')]['messages']);var _0x4e2b34={'messageId':_0x4af876[_0xc3d0('0x4e')]};if(!_0x9b7331['deliveryReport']){_0x4e2b34['read']=!![];}return _0x1743af[_0xc3d0('0x17')](_0x4e2b34);}else{logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x4f'),util[_0xc3d0('0x2c')](_0x56cf61,{'showHidden':![],'depth':null}));}}else{logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x4f'),util[_0xc3d0('0x2c')](_0x56cf61,{'showHidden':![],'depth':null}));}})[_0xc3d0('0x29')](function(_0x2d38fa){logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x4f'),util['inspect'](_0x2d38fa,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc3d0('0x50'):if(_0x9b7331['authId']&&_0x9b7331[_0xc3d0('0x20')]){var _0x219890={'dst':_0x742b3[_0xc3d0('0x21')],'text':_0x742b3[_0xc3d0('0xc')],'src':_0x9b7331[_0xc3d0('0x3e')]||_0x9b7331[_0xc3d0('0x21')],'url':_0x9b7331['remote']+_0xc3d0('0x25')+_0x742b3['id']+'/status?token='+_0x9b7331['token']};var _0x28dafd=util['format'](_0xc3d0('0x46'),_0x9b7331['authId'],_0x9b7331[_0xc3d0('0x20')]);var _0x1e01a7={'method':_0xc3d0('0x3f'),'uri':util[_0xc3d0('0x45')](_0xc3d0('0x51'),_0x9b7331[_0xc3d0('0x52')]),'body':_0x219890,'headers':{'Authorization':util[_0xc3d0('0x45')]('Basic\x20%s',new Buffer(_0x28dafd)[_0xc3d0('0x48')](_0xc3d0('0x49')))},'json':!![]};rp(_0x1e01a7)[_0xc3d0('0x16')](function(_0x107381){var _0x6526e8={'messageId':_0x107381['message_uuid'][0x0]};return _0x1743af[_0xc3d0('0x17')](_0x6526e8);})[_0xc3d0('0x29')](function(_0x1a3cd3){logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x50'),util[_0xc3d0('0x2c')](_0x1a3cd3,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3d0('0x50'),_0xc3d0('0x53'));}break;case _0xc3d0('0x54'):if(_0x9b7331[_0xc3d0('0x2e')]&&_0x9b7331[_0xc3d0('0x2f')]){if(_0x9b7331[_0xc3d0('0x55')]){var _0x375b8b={'method':_0xc3d0('0x3f'),'uri':_0x9b7331[_0xc3d0('0x55')]+'/auth/1/session','body':{'username':_0x9b7331[_0xc3d0('0x2e')],'password':_0x9b7331['password']},'json':!![]};return rp(_0x375b8b)[_0xc3d0('0x16')](function(_0x55e2dd){var _0x14e69b={'method':'POST','uri':_0x9b7331[_0xc3d0('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x9b7331['phone'],'destinations':[{'to':_0x742b3[_0xc3d0('0x21')]}],'text':_0x742b3[_0xc3d0('0xc')],'notifyUrl':_0x9b7331['remote']+_0xc3d0('0x25')+_0x742b3['id']+_0xc3d0('0x26')+_0x9b7331['token'],'notifyContentType':'application/json','callbackData':_0x9b7331[_0xc3d0('0x21')]+';'+_0x742b3['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x55e2dd['token']},'json':!![]};return rp(_0x14e69b)[_0xc3d0('0x16')](function(_0x33e265){if(_0x33e265[_0xc3d0('0x22')]){var _0x8742de={'messageId':_0x33e265[_0xc3d0('0x22')][0x0][_0xc3d0('0xa')]};if(!_0x9b7331[_0xc3d0('0x39')]){_0x8742de[_0xc3d0('0x3a')]=!![];}return _0x1743af[_0xc3d0('0x17')](_0x8742de);}else{return logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x54'),util['inspect'](_0x33e265,{'showHidden':![],'depth':null}));}});})[_0xc3d0('0x29')](function(_0x479f74){return logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),'infobip',util[_0xc3d0('0x2c')](_0x479f74,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3d0('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x54'),_0xc3d0('0x3c'));}break;case'csc':var _0x4c67f0=require(_0xc3d0('0x56'));if(_0x9b7331[_0xc3d0('0x57')]){var _0x33a765={};_0x33a765[_0xc3d0('0x58')]=_0x9b7331[_0xc3d0('0x2e')];_0x33a765['phone']=_0x742b3[_0xc3d0('0x21')];_0x33a765[_0xc3d0('0x31')]=_0x9b7331[_0xc3d0('0x21')];_0x33a765[_0xc3d0('0x59')]=_0x742b3['body'];_0x33a765[_0xc3d0('0x5a')]=+new Date();var _0x2a0d9e='';var _0x390f34='';var _0x2cf4cf=Object[_0xc3d0('0x5b')](_0x33a765);_0x2cf4cf[_0xc3d0('0x5c')]();for(var _0x4c8d93=0x0;_0x4c8d93<_0x2cf4cf['length'];_0x4c8d93++){if(_0x2a0d9e!=''){_0x2a0d9e+='&';}_0x2a0d9e+=_0x2cf4cf[_0x4c8d93]+'='+encodeURIComponent(_0x33a765[_0x2cf4cf[_0x4c8d93]]);_0x390f34+=_0x33a765[_0x2cf4cf[_0x4c8d93]];}_0x390f34+=_0x9b7331[_0xc3d0('0x57')];_0x390f34=_0x4c67f0[_0xc3d0('0x5d')](_0xc3d0('0x5e'))[_0xc3d0('0x17')](_0x390f34)[_0xc3d0('0x5f')](_0xc3d0('0x60'));if(_0x2a0d9e!==''){_0x2a0d9e+='&';}_0x2a0d9e+=_0xc3d0('0x61')+_0x390f34;var _0x4d1c92={'method':'GET','uri':_0xc3d0('0x62')+_0x2a0d9e,'json':!![]};return rp(_0x4d1c92)[_0xc3d0('0x16')](function(_0xd3f7dd){var _0x48b3dc=Object['keys'](_0xd3f7dd);if(_0xd3f7dd[_0x48b3dc[0x0]]['error']&&parseInt(_0xd3f7dd[_0x48b3dc[0x0]][_0xc3d0('0x19')])===0x0){var _0x3ba590={'messageId':_0xd3f7dd[_0x48b3dc[0x0]]['id_sms']};if(!_0x9b7331[_0xc3d0('0x39')]){_0x3ba590[_0xc3d0('0x3a')]=!![];}return _0x1743af['update'](_0x3ba590);}else{return logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),'csc',util[_0xc3d0('0x2c')](_0xd3f7dd[_0xc3d0('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x124d25){return logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc3d0('0x63'),util[_0xc3d0('0x2c')](_0x124d25,{'showHidden':![],'depth':null}));});}else{logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x63'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x9b7331[_0xc3d0('0x57')]){var _0x1bdcf1={'method':'POST','uri':_0xc3d0('0x64'),'headers':{'Authorization':_0x9b7331[_0xc3d0('0x57')]},'body':{'content':_0x742b3['body'],'to':[_0x742b3[_0xc3d0('0x21')]],'from':_0x9b7331[_0xc3d0('0x21')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x1bdcf1)['then'](function(_0x2c3cab){if(!_0x2c3cab[_0xc3d0('0x19')]){var _0x2e1318={'messageId':_0x2c3cab[_0xc3d0('0x22')][0x0][_0xc3d0('0x65')]};if(!_0x9b7331[_0xc3d0('0x39')]){_0x2e1318['read']=!![];}return _0x1743af[_0xc3d0('0x17')](_0x2e1318);}else{return logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),'afterCreate',_0xc3d0('0x66'),util['inspect'](_0x2c3cab[_0xc3d0('0x19')],{'showHidden':![],'depth':null}));}})[_0xc3d0('0x29')](function(_0x384ea5){return logger[_0xc3d0('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc3d0('0x2b'),_0xc3d0('0x66'),util[_0xc3d0('0x2c')](_0x384ea5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0xc3d0('0x67'):if(_0x9b7331['apiKey']){var _0x1471cd={};var _0x4d1c92={'method':_0xc3d0('0x3f'),'uri':_0xc3d0('0x68'),'headers':{'Authorization':_0xc3d0('0x69')+_0x9b7331[_0xc3d0('0x57')],'Content-Type':_0xc3d0('0x6a')},'body':{'from':_0x9b7331['phone'],'to':_0x742b3['phone'],'text':_0x742b3['body']},'json':!![]};return rp(_0x4d1c92)[_0xc3d0('0x16')](function(_0x446fd2){if(_0x446fd2[_0xc3d0('0x6b')]==0xca){_0x1471cd[_0xc3d0('0x6c')]=_0x446fd2;var _0x2c4d58={'method':'POST','uri':_0xc3d0('0x6d'),'headers':{'Authorization':_0xc3d0('0x69')+_0x9b7331['apiKey'],'Content-Type':_0xc3d0('0x6a')},'body':{'refid':_0x1471cd[_0xc3d0('0x6c')][_0xc3d0('0x6e')]},'json':!![]};return rp(_0x2c4d58)['then'](function(_0x25fb91){_0x1471cd[_0xc3d0('0x6f')]=_0x25fb91;var _0x54973c={'messageId':_0x1471cd[_0xc3d0('0x6c')][_0xc3d0('0x6e')],'read':!![]};return _0x1743af[_0xc3d0('0x17')](_0x54973c);});}else{return logger[_0xc3d0('0x19')](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x67'),util[_0xc3d0('0x2c')](_0x446fd2,{'showHidden':![],'depth':null}));}})[_0xc3d0('0x29')](function(_0x409b7e){return logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x67'),util[_0xc3d0('0x2c')](_0x409b7e,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xc3d0('0x2a'),_0xc3d0('0x2b'),_0xc3d0('0x67'),'Token\x20not\x20received');}break;}}})[_0xc3d0('0x70')](function(){_0x3f5e96();});}else{_0x3f5e96();}}},'charset':_0xc3d0('0x71'),'collate':_0xc3d0('0x72')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 3a2a0c5..44ad35c 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 _0xdc77=['defaults','./smsMessage.socket','request','then','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','catch','SmsMessage','options','raw','debug','CreateSmsMessage','lodash','moment','../../config/logger','../../config/environment','jayson/promise'];(function(_0x313d59,_0x4e3579){var _0x48f6e2=function(_0x2f69c4){while(--_0x2f69c4){_0x313d59['push'](_0x313d59['shift']());}};_0x48f6e2(++_0x4e3579);}(_0xdc77,0xab));var _0x7dc7=function(_0x5f50bb,_0x1ef4ce){_0x5f50bb=_0x5f50bb-0x0;var _0xe38d4f=_0xdc77[_0x5f50bb];return _0xe38d4f;};'use strict';var _=require(_0x7dc7('0x0'));var util=require('util');var moment=require(_0x7dc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7dc7('0x2'))('rpc');var config=require(_0x7dc7('0x3'));var jayson=require(_0x7dc7('0x4'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7dc7('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7dc7('0x6'))['register'](socket);function respondWithRpcPromise(_0x541238,_0x571440,_0x451a07){return new BPromise(function(_0x59ae60,_0x324a44){return client[_0x7dc7('0x7')](_0x541238,_0x451a07)[_0x7dc7('0x8')](function(_0x3efd26){logger['info']('SmsMessage,\x20%s,\x20%s',_0x571440,_0x7dc7('0x9'));logger['debug'](_0x7dc7('0xa'),_0x571440,_0x7dc7('0x9'),JSON[_0x7dc7('0xb')](_0x3efd26));if(_0x3efd26['error']){if(_0x3efd26[_0x7dc7('0xc')]['code']===0x1f4){logger[_0x7dc7('0xc')](_0x7dc7('0xd'),_0x571440,_0x3efd26[_0x7dc7('0xc')][_0x7dc7('0xe')]);return _0x324a44(_0x3efd26[_0x7dc7('0xc')][_0x7dc7('0xe')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x571440,_0x3efd26[_0x7dc7('0xc')]['message']);return _0x59ae60(_0x3efd26[_0x7dc7('0xc')][_0x7dc7('0xe')]);}else{logger[_0x7dc7('0xf')](_0x7dc7('0xd'),_0x571440,'request\x20sent');_0x59ae60(_0x3efd26['result'][_0x7dc7('0xe')]);}})[_0x7dc7('0x10')](function(_0x49276a){logger[_0x7dc7('0xc')](_0x7dc7('0xd'),_0x571440,_0x49276a);_0x324a44(_0x49276a);});});}exports['CreateSmsMessage']=function(_0x968262){var _0x354f5b=this;return new Promise(function(_0x4e9c2f,_0x34179c){return db[_0x7dc7('0x11')]['create'](_0x968262['body'],{'raw':_0x968262[_0x7dc7('0x12')]?_0x968262[_0x7dc7('0x12')][_0x7dc7('0x13')]===undefined?!![]:![]:!![]})[_0x7dc7('0x8')](function(_0xd9c3){logger[_0x7dc7('0xf')]('CreateSmsMessage',_0x968262);logger[_0x7dc7('0x14')]('CreateSmsMessage',_0x968262,JSON[_0x7dc7('0xb')](_0xd9c3));_0x4e9c2f(_0xd9c3);})[_0x7dc7('0x10')](function(_0x25a903){logger['error'](_0x7dc7('0x15'),_0x25a903['message'],_0x968262);_0x34179c(_0x354f5b[_0x7dc7('0xc')](0x1f4,_0x25a903[_0x7dc7('0xe')]));});});}; \ No newline at end of file +var _0xb11e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsMessage.socket','register','then','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateSmsMessage','SmsMessage','create','body','options','debug','catch','lodash','bluebird'];(function(_0x4c2133,_0x427394){var _0x20145b=function(_0x82522b){while(--_0x82522b){_0x4c2133['push'](_0x4c2133['shift']());}};_0x20145b(++_0x427394);}(_0xb11e,0x17e));var _0xeb11=function(_0x6c8256,_0x36e3ac){_0x6c8256=_0x6c8256-0x0;var _0x36662a=_0xb11e[_0x6c8256];return _0x36662a;};'use strict';var _=require(_0xeb11('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeb11('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb11('0x2'));var db=require(_0xeb11('0x3'))['db'];var utils=require(_0xeb11('0x4'));var logger=require(_0xeb11('0x5'))(_0xeb11('0x6'));var config=require(_0xeb11('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb11('0x8')][_0xeb11('0x9')]({'port':0x232a});config[_0xeb11('0xa')]=_[_0xeb11('0xb')](config[_0xeb11('0xa')],{'host':_0xeb11('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb11('0xa')]));require(_0xeb11('0xd'))[_0xeb11('0xe')](socket);function respondWithRpcPromise(_0x470993,_0x4a4e6e,_0x19553a){return new BPromise(function(_0x900b1e,_0x1c8205){return client['request'](_0x470993,_0x19553a)[_0xeb11('0xf')](function(_0x5b9abb){logger['info'](_0xeb11('0x10'),_0x4a4e6e,'request\x20sent');logger['debug'](_0xeb11('0x11'),_0x4a4e6e,_0xeb11('0x12'),JSON[_0xeb11('0x13')](_0x5b9abb));if(_0x5b9abb['error']){if(_0x5b9abb[_0xeb11('0x14')][_0xeb11('0x15')]===0x1f4){logger['error'](_0xeb11('0x10'),_0x4a4e6e,_0x5b9abb[_0xeb11('0x14')][_0xeb11('0x16')]);return _0x1c8205(_0x5b9abb[_0xeb11('0x14')][_0xeb11('0x16')]);}logger[_0xeb11('0x14')](_0xeb11('0x10'),_0x4a4e6e,_0x5b9abb[_0xeb11('0x14')]['message']);return _0x900b1e(_0x5b9abb[_0xeb11('0x14')]['message']);}else{logger[_0xeb11('0x17')](_0xeb11('0x10'),_0x4a4e6e,_0xeb11('0x12'));_0x900b1e(_0x5b9abb[_0xeb11('0x18')]['message']);}})['catch'](function(_0x4d6ac0){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4a4e6e,_0x4d6ac0);_0x1c8205(_0x4d6ac0);});});}exports[_0xeb11('0x19')]=function(_0x5bf89a){var _0x51c9f1=this;return new Promise(function(_0x5c0ce9,_0x1db677){return db[_0xeb11('0x1a')][_0xeb11('0x1b')](_0x5bf89a[_0xeb11('0x1c')],{'raw':_0x5bf89a['options']?_0x5bf89a[_0xeb11('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xeb11('0xf')](function(_0x1fb136){logger[_0xeb11('0x17')](_0xeb11('0x19'),_0x5bf89a);logger[_0xeb11('0x1e')](_0xeb11('0x19'),_0x5bf89a,JSON[_0xeb11('0x13')](_0x1fb136));_0x5c0ce9(_0x1fb136);})[_0xeb11('0x1f')](function(_0x126272){logger['error'](_0xeb11('0x19'),_0x126272['message'],_0x5bf89a);_0x1db677(_0x51c9f1[_0xeb11('0x14')](0x1f4,_0x126272[_0xeb11('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d731b7c..a7e71af 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 _0x66cb=['./smsMessage.events','save','remove','emit','removeListener','smsMessage:'];(function(_0x1d0fe1,_0x452dbb){var _0x228558=function(_0x356baf){while(--_0x356baf){_0x1d0fe1['push'](_0x1d0fe1['shift']());}};_0x228558(++_0x452dbb);}(_0x66cb,0x120));var _0xb66c=function(_0x2bd332,_0xbbe585){_0x2bd332=_0x2bd332-0x0;var _0x27c0be=_0x66cb[_0x2bd332];return _0x27c0be;};'use strict';var SmsMessageEvents=require(_0xb66c('0x0'));var events=[_0xb66c('0x1'),_0xb66c('0x2'),'update'];function createListener(_0xd1582f,_0x345754){return function(_0x176e80){_0x345754[_0xb66c('0x3')](_0xd1582f,_0x176e80);};}function removeListener(_0x3e3c5e,_0x31bbee){return function(){SmsMessageEvents[_0xb66c('0x4')](_0x3e3c5e,_0x31bbee);};}exports['register']=function(_0x393109){for(var _0x382057=0x0,_0x3ef223=events['length'];_0x382057<_0x3ef223;_0x382057++){var _0x1ed2fe=events[_0x382057];var _0x27dbed=createListener(_0xb66c('0x5')+_0x1ed2fe,_0x393109);SmsMessageEvents['on'](_0x1ed2fe,_0x27dbed);}}; \ No newline at end of file +var _0x2b72=['./smsMessage.events','remove','update','removeListener','register','length'];(function(_0x299cde,_0x13b449){var _0x54981b=function(_0x3d52bd){while(--_0x3d52bd){_0x299cde['push'](_0x299cde['shift']());}};_0x54981b(++_0x13b449);}(_0x2b72,0x168));var _0x22b7=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x2b72[_0x383356];return _0x32ee5a;};'use strict';var SmsMessageEvents=require(_0x22b7('0x0'));var events=['save',_0x22b7('0x1'),_0x22b7('0x2')];function createListener(_0x102b61,_0x290d15){return function(_0x4506be){_0x290d15['emit'](_0x102b61,_0x4506be);};}function removeListener(_0x651f92,_0x511d39){return function(){SmsMessageEvents[_0x22b7('0x3')](_0x651f92,_0x511d39);};}exports[_0x22b7('0x4')]=function(_0x1b7f48){for(var _0x17aee2=0x0,_0x2f114c=events[_0x22b7('0x5')];_0x17aee2<_0x2f114c;_0x17aee2++){var _0x1b8528=events[_0x17aee2];var _0x5ca65f=createListener('smsMessage:'+_0x1b8528,_0x1b7f48);SmsMessageEvents['on'](_0x1b8528,_0x5ca65f);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 5f9bc8f..0484b61 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 _0xb92c=['getTeams','/:id/users','post','addTeams','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsQueue.controller','get','index','/describe','/:id','isAuthenticated','/:id/teams'];(function(_0x3341f7,_0x8faa15){var _0x2b25cd=function(_0x3c70fa){while(--_0x3c70fa){_0x3341f7['push'](_0x3341f7['shift']());}};_0x2b25cd(++_0x8faa15);}(_0xb92c,0x1ea));var _0xcb92=function(_0x20c942,_0x1d2f4d){_0x20c942=_0x20c942-0x0;var _0x49b605=_0xb92c[_0x20c942];return _0x49b605;};'use strict';var multer=require(_0xcb92('0x0'));var util=require(_0xcb92('0x1'));var path=require(_0xcb92('0x2'));var timeout=require(_0xcb92('0x3'));var express=require(_0xcb92('0x4'));var router=express[_0xcb92('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb92('0x6'));var config=require('../../config/environment');var controller=require(_0xcb92('0x7'));router[_0xcb92('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb92('0x9')]);router[_0xcb92('0x8')](_0xcb92('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xcb92('0x8')](_0xcb92('0xb'),auth[_0xcb92('0xc')](),controller['show']);router[_0xcb92('0x8')]('/:id/members',auth[_0xcb92('0xc')](),controller['getMembers']);router[_0xcb92('0x8')](_0xcb92('0xd'),auth['isAuthenticated'](),controller[_0xcb92('0xe')]);router[_0xcb92('0x8')](_0xcb92('0xf'),auth[_0xcb92('0xc')](),controller['getAgents']);router[_0xcb92('0x10')]('/',auth[_0xcb92('0xc')](),controller['create']);router[_0xcb92('0x10')](_0xcb92('0xd'),auth[_0xcb92('0xc')](),controller[_0xcb92('0x11')]);router[_0xcb92('0x10')](_0xcb92('0xf'),auth[_0xcb92('0xc')](),controller['addAgents']);router[_0xcb92('0x12')](_0xcb92('0xb'),auth[_0xcb92('0xc')](),controller[_0xcb92('0x13')]);router[_0xcb92('0x14')](_0xcb92('0xb'),auth[_0xcb92('0xc')](),controller['destroy']);router[_0xcb92('0x14')](_0xcb92('0xd'),auth[_0xcb92('0xc')](),controller[_0xcb92('0x15')]);router[_0xcb92('0x14')](_0xcb92('0xf'),auth[_0xcb92('0xc')](),controller[_0xcb92('0x16')]);module[_0xcb92('0x17')]=router; \ No newline at end of file +var _0xe23a=['../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0xe23a,0xad));var _0xae23=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xe23a[_0x32b993];return _0x482780;};'use strict';var multer=require('multer');var util=require(_0xae23('0x0'));var path=require(_0xae23('0x1'));var timeout=require(_0xae23('0x2'));var express=require(_0xae23('0x3'));var router=express[_0xae23('0x4')]();var auth=require(_0xae23('0x5'));var interaction=require(_0xae23('0x6'));var config=require(_0xae23('0x7'));var controller=require(_0xae23('0x8'));router[_0xae23('0x9')]('/',auth[_0xae23('0xa')](),controller[_0xae23('0xb')]);router[_0xae23('0x9')](_0xae23('0xc'),auth[_0xae23('0xa')](),controller[_0xae23('0xd')]);router[_0xae23('0x9')](_0xae23('0xe'),auth['isAuthenticated'](),controller[_0xae23('0xf')]);router[_0xae23('0x9')](_0xae23('0x10'),auth[_0xae23('0xa')](),controller[_0xae23('0x11')]);router[_0xae23('0x9')](_0xae23('0x12'),auth[_0xae23('0xa')](),controller['getTeams']);router[_0xae23('0x9')](_0xae23('0x13'),auth[_0xae23('0xa')](),controller[_0xae23('0x14')]);router[_0xae23('0x15')]('/',auth[_0xae23('0xa')](),controller[_0xae23('0x16')]);router['post']('/:id/teams',auth[_0xae23('0xa')](),controller[_0xae23('0x17')]);router[_0xae23('0x15')](_0xae23('0x13'),auth[_0xae23('0xa')](),controller[_0xae23('0x18')]);router[_0xae23('0x19')]('/:id',auth[_0xae23('0xa')](),controller['update']);router[_0xae23('0x1a')]('/:id',auth[_0xae23('0xa')](),controller[_0xae23('0x1b')]);router[_0xae23('0x1a')](_0xae23('0x12'),auth[_0xae23('0xa')](),controller[_0xae23('0x1c')]);router[_0xae23('0x1a')](_0xae23('0x13'),auth[_0xae23('0xa')](),controller['removeAgents']);module[_0xae23('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c9ac449..cdb2b25 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 _0x4b0a=['INTEGER','rrmemory','beepall','exports','STRING'];(function(_0xc0111c,_0x19f112){var _0x72c416=function(_0x4154a0){while(--_0x4154a0){_0xc0111c['push'](_0xc0111c['shift']());}};_0x72c416(++_0x19f112);}(_0x4b0a,0xad));var _0xa4b0=function(_0x44e6ab,_0x412922){_0x44e6ab=_0x44e6ab-0x0;var _0x4b9d9c=_0x4b0a[_0x44e6ab];return _0x4b9d9c;};'use strict';var Sequelize=require('sequelize');module[_0xa4b0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa4b0('0x1')]},'timeout':{'type':Sequelize[_0xa4b0('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa4b0('0x3'),_0xa4b0('0x4'),'roundrobin')}}; \ No newline at end of file +var _0xc594=['beepall','roundrobin','exports','STRING','name','ENUM','rrmemory'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc594,0x198));var _0x4c59=function(_0x5753f4,_0x4f9c46){_0x5753f4=_0x5753f4-0x0;var _0x24687c=_0xc594[_0x5753f4];return _0x24687c;};'use strict';var Sequelize=require('sequelize');module[_0x4c59('0x0')]={'name':{'type':Sequelize[_0x4c59('0x1')],'unique':_0x4c59('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c59('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c59('0x3')](_0x4c59('0x4'),_0x4c59('0x5'),_0x4c59('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 06cd753..8920730 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 _0xb140=['union','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','getAgents','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','get','UserProfileResource','name','index','SmsQueue','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','key','field','merge','options','includeAll','include','findAll','show','keys','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserSmsQueue','sort','map','User','UserId','agent','smsPause','updatedAt','rows','%s/%s','createdAt','getTeams','findOne','Team','addTeams','teams','Agents','voicePause','interface','flatMap','transaction','findOrCreate','emit','removeTeams','ids','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','includes','all'];(function(_0x258e85,_0x4b77e5){var _0x5dc74a=function(_0x213ede){while(--_0x213ede){_0x258e85['push'](_0x258e85['shift']());}};_0x5dc74a(++_0x4b77e5);}(_0xb140,0x187));var _0x0b14=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0xb140[_0x42f3a5];return _0x1a7d74;};'use strict';var pdf=require(_0x0b14('0x0'));var emlformat=require(_0x0b14('0x1'));var rimraf=require(_0x0b14('0x2'));var zipdir=require(_0x0b14('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b14('0x4'));var Mustache=require(_0x0b14('0x5'));var util=require(_0x0b14('0x6'));var path=require('path');var sox=require(_0x0b14('0x7'));var csv=require(_0x0b14('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b14('0x9'));var squel=require('squel');var crypto=require(_0x0b14('0xa'));var jsforce=require(_0x0b14('0xb'));var deskjs=require(_0x0b14('0xc'));var toCsv=require(_0x0b14('0x8'));var querystring=require(_0x0b14('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b14('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b14('0xf'))(_0x0b14('0x10'));var utils=require(_0x0b14('0x11'));var config=require(_0x0b14('0x12'));var db=require('../../mysqldb')['db'];config[_0x0b14('0x13')]=_['defaults'](config[_0x0b14('0x13')],{'host':_0x0b14('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b14('0x13')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x1d2a65,_0x5789df){_0x5789df=_0x5789df||0xcc;return function(_0x48933c){if(_0x48933c){return _0x1d2a65[_0x0b14('0x15')](_0x5789df);}return _0x1d2a65['status'](_0x5789df)[_0x0b14('0x16')]();};}function respondWithResult(_0x4ae249,_0x29f814){_0x29f814=_0x29f814||0xc8;return function(_0x34f1f9){if(_0x34f1f9){return _0x4ae249[_0x0b14('0x17')](_0x29f814)['json'](_0x34f1f9);}};}function respondWithFilteredResult(_0x4285a3,_0x104fc6){return function(_0x49aa88){if(_0x49aa88){var _0x5a4f64=_0x49aa88[_0x0b14('0x18')],_0x1004db=_0x104fc6['offset'],_0x2efd87=_0x104fc6[_0x0b14('0x19')]+_0x104fc6[_0x0b14('0x1a')],_0x1205ea;if(_0x2efd87>=_0x5a4f64){_0x2efd87=_0x5a4f64;_0x1205ea=0xc8;}else{_0x1205ea=0xce;}_0x4285a3['status'](_0x1205ea);return _0x4285a3[_0x0b14('0x1b')](_0x0b14('0x1c'),_0x1004db+'-'+_0x2efd87+'/'+_0x5a4f64)[_0x0b14('0x1d')](_0x49aa88);}return null;};}function patchUpdates(_0x2efc05){return function(_0xfb7c3b){try{jsonpatch['apply'](_0xfb7c3b,_0x2efc05,!![]);}catch(_0x5764b2){return BPromise[_0x0b14('0x1e')](_0x5764b2);}return _0xfb7c3b[_0x0b14('0x1f')]();};}function saveUpdates(_0xdf0c04,_0x428823){return function(_0xaaad06){if(_0xaaad06){return _0xaaad06[_0x0b14('0x20')](_0xdf0c04)['then'](function(_0x5baf18){return _0x5baf18;});}return null;};}function removeEntity(_0x1ab4fc,_0xf98d13){return function(_0x5dc67b){if(_0x5dc67b){return _0x5dc67b[_0x0b14('0x21')]()[_0x0b14('0x22')](function(){var _0x26a737=_0x5dc67b[_0x0b14('0x23')]({'plain':!![]});var _0x37485b='SmsQueues';return db[_0x0b14('0x24')][_0x0b14('0x21')]({'where':{'type':_0x37485b,'resourceId':_0x26a737['id']}})[_0x0b14('0x22')](function(){return _0x5dc67b;});})[_0x0b14('0x22')](function(){_0x1ab4fc['status'](0xcc)[_0x0b14('0x16')]();});}};}function handleEntityNotFound(_0x224977,_0x23c18d){return function(_0x4f601d){if(!_0x4f601d){_0x224977[_0x0b14('0x15')](0x194);}return _0x4f601d;};}function handleError(_0xdce501,_0x5c3e3e){_0x5c3e3e=_0x5c3e3e||0x1f4;return function(_0x20b3a8){logger['error'](_0x20b3a8['stack']);if(_0x20b3a8[_0x0b14('0x25')]){delete _0x20b3a8[_0x0b14('0x25')];}_0xdce501['status'](_0x5c3e3e)['send'](_0x20b3a8);};}exports[_0x0b14('0x26')]=function(_0x2564cd,_0x55e01d){var _0x194745={},_0x495e5c={},_0x29839c={'count':0x0,'rows':[]};var _0x3104cd=db[_0x0b14('0x27')][_0x0b14('0x28')];_0x495e5c[_0x0b14('0x29')]=_['keys'](_0x3104cd);_0x495e5c[_0x0b14('0x2a')]=_['keys'](_0x2564cd[_0x0b14('0x2a')]);_0x495e5c['filters']=_['intersection'](_0x495e5c[_0x0b14('0x29')],_0x495e5c['query']);_0x194745[_0x0b14('0x2b')]=_[_0x0b14('0x2c')](_0x495e5c[_0x0b14('0x29')],qs[_0x0b14('0x2d')](_0x2564cd['query'][_0x0b14('0x2d')]));_0x194745['attributes']=_0x194745['attributes'][_0x0b14('0x2e')]?_0x194745[_0x0b14('0x2b')]:_0x495e5c[_0x0b14('0x29')];if(!_0x2564cd['query'][_0x0b14('0x2f')](_0x0b14('0x30'))){_0x194745[_0x0b14('0x1a')]=qs[_0x0b14('0x1a')](_0x2564cd[_0x0b14('0x2a')][_0x0b14('0x1a')]);_0x194745[_0x0b14('0x19')]=qs[_0x0b14('0x19')](_0x2564cd[_0x0b14('0x2a')][_0x0b14('0x19')]);}_0x194745[_0x0b14('0x31')]=qs['sort'](_0x2564cd['query']['sort']);_0x194745[_0x0b14('0x32')]=qs[_0x0b14('0x33')](_[_0x0b14('0x34')](_0x2564cd[_0x0b14('0x2a')],_0x495e5c[_0x0b14('0x33')]));if(_0x2564cd[_0x0b14('0x2a')][_0x0b14('0x35')]){_0x194745[_0x0b14('0x32')]=_['merge'](_0x194745['where'],{'$or':_['map'](_0x3104cd,function(_0x436c45){if(_0x436c45[_0x0b14('0x36')][_0x0b14('0x37')]!=='VIRTUAL'){var _0x2501a9={};_0x2501a9[_0x436c45[_0x0b14('0x38')]]={'$like':'%'+_0x2564cd[_0x0b14('0x2a')][_0x0b14('0x35')]+'%'};return _0x2501a9;}})});}_0x194745=_[_0x0b14('0x39')]({},_0x194745,_0x2564cd[_0x0b14('0x3a')]);var _0x2e14de={'where':_0x194745[_0x0b14('0x32')]};return db[_0x0b14('0x27')]['count'](_0x2e14de)[_0x0b14('0x22')](function(_0x17192e){_0x29839c['count']=_0x17192e;if(_0x2564cd[_0x0b14('0x2a')][_0x0b14('0x3b')]){_0x194745[_0x0b14('0x3c')]=[{'all':!![]}];}return db[_0x0b14('0x27')][_0x0b14('0x3d')](_0x194745);})[_0x0b14('0x22')](function(_0x3330da){_0x29839c['rows']=_0x3330da;return _0x29839c;})[_0x0b14('0x22')](respondWithFilteredResult(_0x55e01d,_0x194745))['catch'](handleError(_0x55e01d,null));};exports[_0x0b14('0x3e')]=function(_0x3ca9aa,_0x1b5846){var _0x3edfeb={'raw':!![],'where':{'id':_0x3ca9aa['params']['id']}},_0x9d2612={};_0x9d2612[_0x0b14('0x29')]=_[_0x0b14('0x3f')](db[_0x0b14('0x27')][_0x0b14('0x28')]);_0x9d2612['query']=_[_0x0b14('0x3f')](_0x3ca9aa[_0x0b14('0x2a')]);_0x9d2612['filters']=_[_0x0b14('0x2c')](_0x9d2612[_0x0b14('0x29')],_0x9d2612[_0x0b14('0x2a')]);_0x3edfeb[_0x0b14('0x2b')]=_[_0x0b14('0x2c')](_0x9d2612['model'],qs[_0x0b14('0x2d')](_0x3ca9aa[_0x0b14('0x2a')][_0x0b14('0x2d')]));_0x3edfeb[_0x0b14('0x2b')]=_0x3edfeb['attributes'][_0x0b14('0x2e')]?_0x3edfeb[_0x0b14('0x2b')]:_0x9d2612[_0x0b14('0x29')];if(_0x3ca9aa[_0x0b14('0x2a')][_0x0b14('0x3b')]){_0x3edfeb[_0x0b14('0x3c')]=[{'all':!![]}];}_0x3edfeb=_[_0x0b14('0x39')]({},_0x3edfeb,_0x3ca9aa[_0x0b14('0x3a')]);return db[_0x0b14('0x27')][_0x0b14('0x40')](_0x3edfeb)['then'](handleEntityNotFound(_0x1b5846,null))['then'](respondWithResult(_0x1b5846,null))[_0x0b14('0x41')](handleError(_0x1b5846,null));};exports[_0x0b14('0x42')]=function(_0x306e00,_0x5450f6){return db['SmsQueue']['create'](_0x306e00['body'],{})[_0x0b14('0x22')](function(_0x5750a4){var _0x12bc1e=_0x306e00['user'][_0x0b14('0x23')]({'plain':!![]});if(!_0x12bc1e)throw new Error(_0x0b14('0x43'));if(_0x12bc1e[_0x0b14('0x44')]===_0x0b14('0x45')){var _0x41c69b=_0x5750a4[_0x0b14('0x23')]({'plain':!![]});var _0xae0d9c=_0x0b14('0x46');return db[_0x0b14('0x47')][_0x0b14('0x40')]({'where':{'name':_0xae0d9c,'userProfileId':_0x12bc1e[_0x0b14('0x48')]},'raw':!![]})[_0x0b14('0x22')](function(_0x25f585){if(_0x25f585&&_0x25f585[_0x0b14('0x49')]===0x0){return db[_0x0b14('0x24')][_0x0b14('0x42')]({'name':_0x41c69b[_0x0b14('0x25')],'resourceId':_0x41c69b['id'],'type':_0x25f585['name'],'sectionId':_0x25f585['id']},{})['then'](function(){return _0x5750a4;});}else{return _0x5750a4;}})['catch'](function(_0x564227){logger['error'](_0x0b14('0x4a'),_0x564227);throw _0x564227;});}return _0x5750a4;})['then'](respondWithResult(_0x5450f6,0xc9))[_0x0b14('0x41')](handleError(_0x5450f6,null));};exports[_0x0b14('0x20')]=function(_0x44ed10,_0x40a1df){if(_0x44ed10[_0x0b14('0x4b')]['id']){delete _0x44ed10[_0x0b14('0x4b')]['id'];}return db[_0x0b14('0x27')]['find']({'where':{'id':_0x44ed10[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x40a1df,null))['then'](saveUpdates(_0x44ed10[_0x0b14('0x4b')],null))[_0x0b14('0x22')](respondWithResult(_0x40a1df,null))[_0x0b14('0x41')](handleError(_0x40a1df,null));};exports[_0x0b14('0x21')]=function(_0x4caae9,_0x493929){return db['SmsQueue'][_0x0b14('0x40')]({'where':{'id':_0x4caae9[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x493929,null))[_0x0b14('0x22')](removeEntity(_0x493929,null))[_0x0b14('0x41')](handleError(_0x493929,null));};exports[_0x0b14('0x4d')]=function(_0x34742a,_0x46b173){return db[_0x0b14('0x27')][_0x0b14('0x4d')]()[_0x0b14('0x22')](respondWithResult(_0x46b173,null))[_0x0b14('0x41')](handleError(_0x46b173,null));};exports[_0x0b14('0x4e')]=function(_0xf623ee,_0x4d61c5,_0x205dd0){var _0x6319c8={'raw':!![],'where':{}},_0x5bf8d8={},_0x39d465;return db['SmsQueue']['findOne']({'where':{'id':_0xf623ee['params']['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x4d61c5,null))[_0x0b14('0x22')](function(_0x24d48f){if(_0x24d48f){_0x39d465=_0x24d48f[_0x0b14('0x23')]({'plain':!![]});_0x5bf8d8[_0x0b14('0x29')]=_['keys'](db[_0x0b14('0x4f')][_0x0b14('0x28')]);_0x5bf8d8[_0x0b14('0x2a')]=_[_0x0b14('0x3f')](_0xf623ee[_0x0b14('0x2a')]);_0x5bf8d8['filters']=_[_0x0b14('0x2c')](_0x5bf8d8[_0x0b14('0x29')],_0x5bf8d8[_0x0b14('0x2a')]);_0x6319c8[_0x0b14('0x2b')]=_[_0x0b14('0x2c')](_0x5bf8d8['model'],qs['fields'](_0xf623ee['query'][_0x0b14('0x2d')]));_0x6319c8['attributes']=_0x6319c8[_0x0b14('0x2b')]['length']?_0x6319c8[_0x0b14('0x2b')]:_0x5bf8d8[_0x0b14('0x29')];if(!_0xf623ee[_0x0b14('0x2a')][_0x0b14('0x2f')](_0x0b14('0x30'))){_0x6319c8[_0x0b14('0x1a')]=qs[_0x0b14('0x1a')](_0xf623ee[_0x0b14('0x2a')][_0x0b14('0x1a')]);_0x6319c8[_0x0b14('0x19')]=qs[_0x0b14('0x19')](_0xf623ee[_0x0b14('0x2a')]['offset']);}_0x6319c8[_0x0b14('0x31')]=qs['sort'](_0xf623ee[_0x0b14('0x2a')][_0x0b14('0x50')]);_0x6319c8['where']=qs[_0x0b14('0x33')](_[_0x0b14('0x34')](_0xf623ee[_0x0b14('0x2a')],_0x5bf8d8[_0x0b14('0x33')]));_0x6319c8[_0x0b14('0x32')]['SmsQueueId']=_0x24d48f['id'];if(_0xf623ee[_0x0b14('0x2a')][_0x0b14('0x35')]){_0x6319c8[_0x0b14('0x32')]=_[_0x0b14('0x39')](_0x6319c8['where'],{'$or':_[_0x0b14('0x51')](_0x6319c8[_0x0b14('0x2b')],function(_0x4eff6a){var _0x129fb2={};_0x129fb2[_0x4eff6a]={'$like':'%'+_0xf623ee['query'][_0x0b14('0x35')]+'%'};return _0x129fb2;})});}_0x6319c8=_[_0x0b14('0x39')]({},_0x6319c8,_0xf623ee['options']);return db[_0x0b14('0x4f')]['findAll'](_0x6319c8);}})[_0x0b14('0x22')](function(_0x1b12d6){if(_0x1b12d6){return db[_0x0b14('0x52')]['findAndCountAll']({'where':{'id':_[_0x0b14('0x51')](_0x1b12d6,_0x0b14('0x53')),'role':_0x0b14('0x54')},'attributes':['id',_0x0b14('0x25'),_0x0b14('0x55'),_0x0b14('0x56'),'createdAt']});}})['then'](function(_0x1be23c){if(_0x1be23c){return{'count':_0x1be23c['count'],'rows':_[_0x0b14('0x51')](_0x1be23c[_0x0b14('0x57')],function(_0x151cf2){return{'membername':_0x151cf2[_0x0b14('0x25')],'UserId':_0x151cf2['id'],'queue_name':_0x39d465['name'],'SmsQueueId':_0x39d465['id'],'interface':util['format'](_0x0b14('0x58'),'SIP',_0x151cf2[_0x0b14('0x25')]),'penalty':0x0,'paused':_0x151cf2[_0x0b14('0x55')],'createdAt':_0x151cf2[_0x0b14('0x59')],'updatedAt':_0x151cf2[_0x0b14('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b14('0x22')](respondWithFilteredResult(_0x4d61c5,_0x6319c8))[_0x0b14('0x41')](handleError(_0x4d61c5,null));};exports[_0x0b14('0x5a')]=function(_0x6c784d,_0x59d165,_0x21e025){var _0x43a307={};var _0x40d662={};var _0x9532b3;var _0x2e7477;return db[_0x0b14('0x27')][_0x0b14('0x5b')]({'where':{'id':_0x6c784d['params']['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x59d165,null))[_0x0b14('0x22')](function(_0x1bc70c){if(_0x1bc70c){_0x9532b3=_0x1bc70c;_0x40d662[_0x0b14('0x29')]=_[_0x0b14('0x3f')](db[_0x0b14('0x5c')][_0x0b14('0x28')]);_0x40d662['query']=_[_0x0b14('0x3f')](_0x6c784d[_0x0b14('0x2a')]);_0x40d662[_0x0b14('0x33')]=_[_0x0b14('0x2c')](_0x40d662[_0x0b14('0x29')],_0x40d662[_0x0b14('0x2a')]);_0x43a307['attributes']=_[_0x0b14('0x2c')](_0x40d662[_0x0b14('0x29')],qs[_0x0b14('0x2d')](_0x6c784d[_0x0b14('0x2a')]['fields']));_0x43a307[_0x0b14('0x2b')]=_0x43a307[_0x0b14('0x2b')]['length']?_0x43a307[_0x0b14('0x2b')]:_0x40d662[_0x0b14('0x29')];_0x43a307[_0x0b14('0x31')]=qs['sort'](_0x6c784d[_0x0b14('0x2a')][_0x0b14('0x50')]);_0x43a307['where']=qs[_0x0b14('0x33')](_['pick'](_0x6c784d[_0x0b14('0x2a')],_0x40d662[_0x0b14('0x33')]));if(_0x6c784d[_0x0b14('0x2a')]['filter']){_0x43a307['where']=_[_0x0b14('0x39')](_0x43a307[_0x0b14('0x32')],{'$or':_[_0x0b14('0x51')](_0x43a307[_0x0b14('0x2b')],function(_0x2490a4){var _0xcea155={};_0xcea155[_0x2490a4]={'$like':'%'+_0x6c784d['query'][_0x0b14('0x35')]+'%'};return _0xcea155;})});}_0x43a307=_[_0x0b14('0x39')]({},_0x43a307,_0x6c784d['options']);return _0x9532b3[_0x0b14('0x5a')](_0x43a307);}})[_0x0b14('0x22')](function(_0xa69f4d){if(_0xa69f4d){_0x2e7477=_0xa69f4d[_0x0b14('0x2e')];if(!_0x6c784d[_0x0b14('0x2a')]['hasOwnProperty']('nolimit')){_0x43a307[_0x0b14('0x1a')]=qs[_0x0b14('0x1a')](_0x6c784d[_0x0b14('0x2a')][_0x0b14('0x1a')]);_0x43a307[_0x0b14('0x19')]=qs['offset'](_0x6c784d[_0x0b14('0x2a')][_0x0b14('0x19')]);}return _0x9532b3[_0x0b14('0x5a')](_0x43a307);}})['then'](function(_0xc59489){if(_0xc59489){return _0xc59489?{'count':_0x2e7477,'rows':_0xc59489}:null;}})[_0x0b14('0x22')](respondWithResult(_0x59d165,null))[_0x0b14('0x41')](handleError(_0x59d165,null));};exports[_0x0b14('0x5d')]=function(_0x3d8060,_0x20287a,_0xd7365c){var _0xa8b013=_0x3d8060[_0x0b14('0x4b')][_0x0b14('0x5e')];return db[_0x0b14('0x5c')][_0x0b14('0x3d')]({'where':{'id':_[_0x0b14('0x51')](_0xa8b013,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0b14('0x5f'),'attributes':['id','name','online',_0x0b14('0x60'),_0x0b14('0x61')],'raw':!![]}]})[_0x0b14('0x22')](function(_0x319c0a){if(_0x319c0a){var _0x488c69=_[_0x0b14('0x62')](_0x319c0a,function(_0x485688){var _0x4bab90=_0x485688[_0x0b14('0x23')]({'plain':!![]});return _0x4bab90[_0x0b14('0x5f')];});return db['SmsQueue'][_0x0b14('0x40')]({'where':{'id':_0x3d8060[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](function(_0x3e36f2){return db['sequelize'][_0x0b14('0x63')](function(_0x25ce23){return _0x3e36f2[_0x0b14('0x5d')](_[_0x0b14('0x51')](_0xa8b013,'id'),{'transaction':_0x25ce23})[_0x0b14('0x22')](function(){return BPromise['each'](_0x488c69,function(_0x176799){return db[_0x0b14('0x4f')][_0x0b14('0x64')]({'where':{'UserId':_0x176799['id'],'SmsQueueId':_0x3d8060['params']['id']},'transaction':_0x25ce23});});})[_0x0b14('0x22')](function(){_0x488c69['forEach'](function(_0x1669af){socket[_0x0b14('0x65')]('userSmsQueue:save',{'UserId':_0x1669af['id'],'SmsQueueId':_0x3e36f2['id']});});});});});}})[_0x0b14('0x22')](respondWithStatusCode(_0x20287a,null))[_0x0b14('0x41')](handleError(_0x20287a,null));};exports[_0x0b14('0x66')]=function(_0x2128c9,_0x3eb63e,_0x3b9976){return db[_0x0b14('0x5c')][_0x0b14('0x3d')]({'where':{'id':_0x2128c9[_0x0b14('0x2a')][_0x0b14('0x67')]},'attributes':['id'],'include':[{'model':db[_0x0b14('0x52')],'as':_0x0b14('0x5f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3eb63e,null))[_0x0b14('0x22')](function(_0x3acaa9){var _0x5588f7=_[_0x0b14('0x51')](_0x3acaa9,'id');var _0x5460e1=[];var _0x18ab40=[];var _0x3d4b93=squel[_0x0b14('0x68')]();_0x3d4b93[_0x0b14('0x38')](_0x0b14('0x69'))[_0x0b14('0x6a')](_0x0b14('0x6b'),'tq')[_0x0b14('0x6c')](_0x0b14('0x6d'),'ut',_0x0b14('0x6e'))[_0x0b14('0x32')](_0x0b14('0x6f'),_0x2128c9['params']['id']);for(var _0x3cbb93=0x0;_0x3cbb93<_0x3acaa9[_0x0b14('0x2e')];_0x3cbb93+=0x1){let _0x3fdcce=_0x3acaa9[_0x3cbb93];for(var _0x152d88=0x0;_0x152d88<_0x3fdcce[_0x0b14('0x5f')][_0x0b14('0x2e')];_0x152d88+=0x1){let _0x418bcb=_0x3fdcce[_0x0b14('0x5f')][_0x152d88];var _0x413963=_0x3d4b93[_0x0b14('0x70')]();_0x413963[_0x0b14('0x32')](_0x0b14('0x71'),_0x418bcb['id']);_0x18ab40['push'](db[_0x0b14('0x72')]['query'](_0x413963[_0x0b14('0x73')](),{'type':db[_0x0b14('0x72')][_0x0b14('0x74')]['SELECT']})['then'](function(_0x2efdc0){if(_0x2efdc0[_0x0b14('0x2e')]===0x1){return _0x418bcb['id'];}else{var _0xefbaa6=_[_0x0b14('0x75')](_[_0x0b14('0x51')](_0x2efdc0,_0x0b14('0x76')),function(_0x431d26){return _[_0x0b14('0x77')](_0x5588f7,_0x431d26);});if(_0xefbaa6){return _0x418bcb['id'];}}}));}}return BPromise[_0x0b14('0x78')](_0x18ab40)[_0x0b14('0x22')](function(_0x595d20){_0x5460e1=_(_0x5460e1)[_0x0b14('0x79')](_0x595d20)['compact']()['value']();return db[_0x0b14('0x27')]['find']({'where':{'id':_0x2128c9[_0x0b14('0x4c')]['id']}})['then'](function(_0x41d062){return db[_0x0b14('0x72')][_0x0b14('0x63')](function(_0x28289c){return _0x41d062['removeTeams'](_0x2128c9[_0x0b14('0x2a')][_0x0b14('0x67')],{'transaction':_0x28289c})['then'](function(){if(!_['isEmpty'](_0x5460e1)){return _0x41d062[_0x0b14('0x7a')](_0x5460e1,{'transaction':_0x28289c});}})[_0x0b14('0x22')](function(){_0x5460e1['forEach'](function(_0x5601ca){socket['emit'](_0x0b14('0x7b'),{'UserId':_0x5601ca,'SmsQueueId':_0x41d062['id']});});});});});});})[_0x0b14('0x22')](respondWithStatusCode(_0x3eb63e,null))[_0x0b14('0x41')](handleError(_0x3eb63e,null));};exports['addAgents']=function(_0x530163,_0x409a39,_0x51671d){return db[_0x0b14('0x27')][_0x0b14('0x40')]({'where':{'id':_0x530163[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x409a39,null))[_0x0b14('0x22')](function(_0x5c5182){if(_0x5c5182){return _0x5c5182[_0x0b14('0x7c')](_0x530163[_0x0b14('0x4b')][_0x0b14('0x67')],_['omit'](_0x530163[_0x0b14('0x4b')],[_0x0b14('0x67'),'id'])||{})[_0x0b14('0x7d')](function(_0x4ff5fc){for(var _0x16b8e6=0x0;_0x16b8e6<_0x530163[_0x0b14('0x4b')][_0x0b14('0x67')][_0x0b14('0x2e')];_0x16b8e6+=0x1){socket[_0x0b14('0x65')](_0x0b14('0x7e'),{'UserId':_0x530163[_0x0b14('0x4b')][_0x0b14('0x67')][_0x16b8e6],'SmsQueueId':_0x530163[_0x0b14('0x4c')]['id']});}return _0x4ff5fc;});}})[_0x0b14('0x22')](respondWithResult(_0x409a39,null))[_0x0b14('0x41')](handleError(_0x409a39,null));};exports['removeAgents']=function(_0x8045d4,_0x4a98a7,_0x4be9f2){return db['SmsQueue'][_0x0b14('0x40')]({'where':{'id':_0x8045d4[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x4a98a7,null))[_0x0b14('0x22')](function(_0x8d50df){if(_0x8d50df){return _0x8d50df[_0x0b14('0x7a')](_0x8045d4[_0x0b14('0x2a')][_0x0b14('0x67')])[_0x0b14('0x22')](function(){if(_['isArray'](_0x8045d4[_0x0b14('0x2a')][_0x0b14('0x67')])){for(var _0x4e1a17=0x0;_0x4e1a17<_0x8045d4[_0x0b14('0x2a')]['ids']['length'];_0x4e1a17+=0x1){socket[_0x0b14('0x65')]('userSmsQueue:remove',{'UserId':Number(_0x8045d4[_0x0b14('0x2a')]['ids'][_0x4e1a17]),'SmsQueueId':Number(_0x8045d4[_0x0b14('0x4c')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x8045d4[_0x0b14('0x2a')]['ids']),'SmsQueueId':Number(_0x8045d4['params']['id'])});}});}})[_0x0b14('0x22')](respondWithStatusCode(_0x4a98a7,null))[_0x0b14('0x41')](handleError(_0x4a98a7,null));};exports['getAgents']=function(_0x4f4154,_0x4982f7,_0x2c78ca){var _0x2014c3={};var _0x2186f6={};var _0x1abd58;var _0x1c2709;return db[_0x0b14('0x27')][_0x0b14('0x5b')]({'where':{'id':_0x4f4154[_0x0b14('0x4c')]['id']}})[_0x0b14('0x22')](handleEntityNotFound(_0x4982f7,null))['then'](function(_0x14836e){if(_0x14836e){_0x1abd58=_0x14836e;_0x2186f6['model']=_[_0x0b14('0x3f')](db['User'][_0x0b14('0x28')]);_0x2186f6[_0x0b14('0x2a')]=_['keys'](_0x4f4154[_0x0b14('0x2a')]);_0x2186f6[_0x0b14('0x33')]=_['intersection'](_0x2186f6[_0x0b14('0x29')],_0x2186f6['query']);_0x2014c3[_0x0b14('0x2b')]=_['intersection'](_0x2186f6[_0x0b14('0x29')],qs[_0x0b14('0x2d')](_0x4f4154[_0x0b14('0x2a')][_0x0b14('0x2d')]));_0x2014c3['attributes']=_0x2014c3[_0x0b14('0x2b')][_0x0b14('0x2e')]?_0x2014c3[_0x0b14('0x2b')]:_0x2186f6['model'];_0x2014c3[_0x0b14('0x31')]=qs[_0x0b14('0x50')](_0x4f4154[_0x0b14('0x2a')]['sort']);_0x2014c3[_0x0b14('0x32')]=qs[_0x0b14('0x33')](_[_0x0b14('0x34')](_0x4f4154[_0x0b14('0x2a')],_0x2186f6['filters']));if(_0x4f4154[_0x0b14('0x2a')][_0x0b14('0x35')]){_0x2014c3[_0x0b14('0x32')]=_[_0x0b14('0x39')](_0x2014c3[_0x0b14('0x32')],{'$or':_[_0x0b14('0x51')](_0x2014c3[_0x0b14('0x2b')],function(_0x3d40c5){var _0x4b0f2c={};_0x4b0f2c[_0x3d40c5]={'$like':'%'+_0x4f4154['query'][_0x0b14('0x35')]+'%'};return _0x4b0f2c;})});}_0x2014c3=_[_0x0b14('0x39')]({},_0x2014c3,_0x4f4154[_0x0b14('0x3a')]);return _0x1abd58[_0x0b14('0x7f')](_0x2014c3);}})[_0x0b14('0x22')](function(_0x57d5ef){if(_0x57d5ef){_0x1c2709=_0x57d5ef[_0x0b14('0x2e')];if(!_0x4f4154[_0x0b14('0x2a')][_0x0b14('0x2f')]('nolimit')){_0x2014c3['limit']=qs['limit'](_0x4f4154[_0x0b14('0x2a')][_0x0b14('0x1a')]);_0x2014c3['offset']=qs[_0x0b14('0x19')](_0x4f4154[_0x0b14('0x2a')][_0x0b14('0x19')]);}return _0x1abd58[_0x0b14('0x7f')](_0x2014c3);}})['then'](function(_0x53beca){if(_0x53beca){return _0x53beca?{'count':_0x1c2709,'rows':_0x53beca}:null;}})['then'](respondWithResult(_0x4982f7,null))[_0x0b14('0x41')](handleError(_0x4982f7,null));}; \ No newline at end of file +var _0x6e43=['UserId','smsPause','format','createdAt','updatedAt','Team','getTeams','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','ids','isEmpty','removeAgents','addAgents','omit','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','query','keys','filters','intersection','model','attributes','length','sort','where','filter','merge','map','type','key','VIRTUAL','options','count','include','findAll','rows','catch','show','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','nolimit','order','pick','User','findAndCountAll'];(function(_0x31d50d,_0x2ee649){var _0x76c534=function(_0x727a47){while(--_0x727a47){_0x31d50d['push'](_0x31d50d['shift']());}};_0x76c534(++_0x2ee649);}(_0x6e43,0xbb));var _0x36e4=function(_0x26fae0,_0x21cb0e){_0x26fae0=_0x26fae0-0x0;var _0x41ed79=_0x6e43[_0x26fae0];return _0x41ed79;};'use strict';var pdf=require(_0x36e4('0x0'));var emlformat=require(_0x36e4('0x1'));var rimraf=require(_0x36e4('0x2'));var zipdir=require(_0x36e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36e4('0x4'));var moment=require(_0x36e4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36e4('0x6'));var util=require(_0x36e4('0x7'));var path=require(_0x36e4('0x8'));var sox=require(_0x36e4('0x9'));var csv=require(_0x36e4('0xa'));var ejs=require(_0x36e4('0xb'));var fs=require('fs');var _=require(_0x36e4('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x36e4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x36e4('0xa'));var querystring=require(_0x36e4('0xe'));var Papa=require(_0x36e4('0xf'));var Redis=require(_0x36e4('0x10'));var authService=require(_0x36e4('0x11'));var qs=require(_0x36e4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36e4('0x13'))(_0x36e4('0x14'));var utils=require(_0x36e4('0x15'));var config=require(_0x36e4('0x16'));var db=require(_0x36e4('0x17'))['db'];config[_0x36e4('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x36e4('0x19'))(new Redis(config[_0x36e4('0x18')]));require(_0x36e4('0x1a'))[_0x36e4('0x1b')](socket);function respondWithStatusCode(_0x158506,_0x31de1f){_0x31de1f=_0x31de1f||0xcc;return function(_0x5b3e87){if(_0x5b3e87){return _0x158506[_0x36e4('0x1c')](_0x31de1f);}return _0x158506['status'](_0x31de1f)[_0x36e4('0x1d')]();};}function respondWithResult(_0x5bf7e4,_0x2d4f0f){_0x2d4f0f=_0x2d4f0f||0xc8;return function(_0x22838b){if(_0x22838b){return _0x5bf7e4[_0x36e4('0x1e')](_0x2d4f0f)[_0x36e4('0x1f')](_0x22838b);}};}function respondWithFilteredResult(_0x2c9d4e,_0x538da0){return function(_0xfcc1e2){if(_0xfcc1e2){var _0x3d8736=_0xfcc1e2['count'],_0x3c671f=_0x538da0[_0x36e4('0x20')],_0x558a99=_0x538da0[_0x36e4('0x20')]+_0x538da0[_0x36e4('0x21')],_0x2fb154;if(_0x558a99>=_0x3d8736){_0x558a99=_0x3d8736;_0x2fb154=0xc8;}else{_0x2fb154=0xce;}_0x2c9d4e[_0x36e4('0x1e')](_0x2fb154);return _0x2c9d4e[_0x36e4('0x22')](_0x36e4('0x23'),_0x3c671f+'-'+_0x558a99+'/'+_0x3d8736)['json'](_0xfcc1e2);}return null;};}function patchUpdates(_0x1adba1){return function(_0x390693){try{jsonpatch['apply'](_0x390693,_0x1adba1,!![]);}catch(_0x583526){return BPromise[_0x36e4('0x24')](_0x583526);}return _0x390693[_0x36e4('0x25')]();};}function saveUpdates(_0x4dd4f5,_0x42a136){return function(_0xcd507e){if(_0xcd507e){return _0xcd507e[_0x36e4('0x26')](_0x4dd4f5)['then'](function(_0x3ffca3){return _0x3ffca3;});}return null;};}function removeEntity(_0x5b716d,_0x4f223a){return function(_0x10a88c){if(_0x10a88c){return _0x10a88c[_0x36e4('0x27')]()[_0x36e4('0x28')](function(){var _0x25058e=_0x10a88c[_0x36e4('0x29')]({'plain':!![]});var _0x4e2d56=_0x36e4('0x2a');return db[_0x36e4('0x2b')][_0x36e4('0x27')]({'where':{'type':_0x4e2d56,'resourceId':_0x25058e['id']}})[_0x36e4('0x28')](function(){return _0x10a88c;});})[_0x36e4('0x28')](function(){_0x5b716d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e58d8,_0x9e7590){return function(_0x1e0e38){if(!_0x1e0e38){_0x3e58d8[_0x36e4('0x1c')](0x194);}return _0x1e0e38;};}function handleError(_0x24a4e7,_0x37ecf9){_0x37ecf9=_0x37ecf9||0x1f4;return function(_0x491be3){logger[_0x36e4('0x2c')](_0x491be3[_0x36e4('0x2d')]);if(_0x491be3[_0x36e4('0x2e')]){delete _0x491be3[_0x36e4('0x2e')];}_0x24a4e7[_0x36e4('0x1e')](_0x37ecf9)[_0x36e4('0x2f')](_0x491be3);};}exports[_0x36e4('0x30')]=function(_0x1caedf,_0x501811){var _0xd414ba={},_0x21cde7={},_0x228f76={'count':0x0,'rows':[]};var _0x3e7735=db[_0x36e4('0x31')][_0x36e4('0x32')];_0x21cde7['model']=_['keys'](_0x3e7735);_0x21cde7[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0x1caedf[_0x36e4('0x33')]);_0x21cde7[_0x36e4('0x35')]=_[_0x36e4('0x36')](_0x21cde7[_0x36e4('0x37')],_0x21cde7[_0x36e4('0x33')]);_0xd414ba[_0x36e4('0x38')]=_[_0x36e4('0x36')](_0x21cde7[_0x36e4('0x37')],qs['fields'](_0x1caedf[_0x36e4('0x33')]['fields']));_0xd414ba['attributes']=_0xd414ba[_0x36e4('0x38')][_0x36e4('0x39')]?_0xd414ba[_0x36e4('0x38')]:_0x21cde7[_0x36e4('0x37')];if(!_0x1caedf[_0x36e4('0x33')]['hasOwnProperty']('nolimit')){_0xd414ba['limit']=qs['limit'](_0x1caedf[_0x36e4('0x33')][_0x36e4('0x21')]);_0xd414ba[_0x36e4('0x20')]=qs[_0x36e4('0x20')](_0x1caedf[_0x36e4('0x33')]['offset']);}_0xd414ba['order']=qs[_0x36e4('0x3a')](_0x1caedf[_0x36e4('0x33')][_0x36e4('0x3a')]);_0xd414ba[_0x36e4('0x3b')]=qs[_0x36e4('0x35')](_['pick'](_0x1caedf[_0x36e4('0x33')],_0x21cde7[_0x36e4('0x35')]));if(_0x1caedf['query'][_0x36e4('0x3c')]){_0xd414ba[_0x36e4('0x3b')]=_[_0x36e4('0x3d')](_0xd414ba[_0x36e4('0x3b')],{'$or':_[_0x36e4('0x3e')](_0x3e7735,function(_0x3c1cab){if(_0x3c1cab[_0x36e4('0x3f')][_0x36e4('0x40')]!==_0x36e4('0x41')){var _0x3f5ba1={};_0x3f5ba1[_0x3c1cab['field']]={'$like':'%'+_0x1caedf[_0x36e4('0x33')][_0x36e4('0x3c')]+'%'};return _0x3f5ba1;}})});}_0xd414ba=_[_0x36e4('0x3d')]({},_0xd414ba,_0x1caedf[_0x36e4('0x42')]);var _0x8108ac={'where':_0xd414ba[_0x36e4('0x3b')]};return db[_0x36e4('0x31')][_0x36e4('0x43')](_0x8108ac)[_0x36e4('0x28')](function(_0x3c37d1){_0x228f76[_0x36e4('0x43')]=_0x3c37d1;if(_0x1caedf[_0x36e4('0x33')]['includeAll']){_0xd414ba[_0x36e4('0x44')]=[{'all':!![]}];}return db[_0x36e4('0x31')][_0x36e4('0x45')](_0xd414ba);})['then'](function(_0x5e399e){_0x228f76[_0x36e4('0x46')]=_0x5e399e;return _0x228f76;})[_0x36e4('0x28')](respondWithFilteredResult(_0x501811,_0xd414ba))[_0x36e4('0x47')](handleError(_0x501811,null));};exports[_0x36e4('0x48')]=function(_0x188ee7,_0x521aef){var _0x388da2={'raw':!![],'where':{'id':_0x188ee7['params']['id']}},_0x5eaab7={};_0x5eaab7[_0x36e4('0x37')]=_[_0x36e4('0x34')](db[_0x36e4('0x31')]['rawAttributes']);_0x5eaab7[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0x188ee7[_0x36e4('0x33')]);_0x5eaab7[_0x36e4('0x35')]=_[_0x36e4('0x36')](_0x5eaab7['model'],_0x5eaab7[_0x36e4('0x33')]);_0x388da2[_0x36e4('0x38')]=_[_0x36e4('0x36')](_0x5eaab7['model'],qs[_0x36e4('0x49')](_0x188ee7[_0x36e4('0x33')][_0x36e4('0x49')]));_0x388da2['attributes']=_0x388da2[_0x36e4('0x38')][_0x36e4('0x39')]?_0x388da2[_0x36e4('0x38')]:_0x5eaab7[_0x36e4('0x37')];if(_0x188ee7[_0x36e4('0x33')][_0x36e4('0x4a')]){_0x388da2['include']=[{'all':!![]}];}_0x388da2=_[_0x36e4('0x3d')]({},_0x388da2,_0x188ee7[_0x36e4('0x42')]);return db['SmsQueue'][_0x36e4('0x4b')](_0x388da2)[_0x36e4('0x28')](handleEntityNotFound(_0x521aef,null))[_0x36e4('0x28')](respondWithResult(_0x521aef,null))[_0x36e4('0x47')](handleError(_0x521aef,null));};exports['create']=function(_0x4e9fc1,_0x1a382b){return db[_0x36e4('0x31')][_0x36e4('0x4c')](_0x4e9fc1[_0x36e4('0x4d')],{})[_0x36e4('0x28')](function(_0x9ac2c3){var _0x45b38a=_0x4e9fc1[_0x36e4('0x4e')][_0x36e4('0x29')]({'plain':!![]});if(!_0x45b38a)throw new Error(_0x36e4('0x4f'));if(_0x45b38a[_0x36e4('0x50')]===_0x36e4('0x4e')){var _0xcf6a6a=_0x9ac2c3[_0x36e4('0x29')]({'plain':!![]});var _0x8b1887=_0x36e4('0x2a');return db[_0x36e4('0x51')][_0x36e4('0x4b')]({'where':{'name':_0x8b1887,'userProfileId':_0x45b38a[_0x36e4('0x52')]},'raw':!![]})[_0x36e4('0x28')](function(_0x35f8b4){if(_0x35f8b4&&_0x35f8b4[_0x36e4('0x53')]===0x0){return db[_0x36e4('0x2b')][_0x36e4('0x4c')]({'name':_0xcf6a6a[_0x36e4('0x2e')],'resourceId':_0xcf6a6a['id'],'type':_0x35f8b4['name'],'sectionId':_0x35f8b4['id']},{})['then'](function(){return _0x9ac2c3;});}else{return _0x9ac2c3;}})[_0x36e4('0x47')](function(_0xd5c62f){logger[_0x36e4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd5c62f);throw _0xd5c62f;});}return _0x9ac2c3;})['then'](respondWithResult(_0x1a382b,0xc9))[_0x36e4('0x47')](handleError(_0x1a382b,null));};exports[_0x36e4('0x26')]=function(_0x830dd2,_0x13e256){if(_0x830dd2[_0x36e4('0x4d')]['id']){delete _0x830dd2[_0x36e4('0x4d')]['id'];}return db[_0x36e4('0x31')][_0x36e4('0x4b')]({'where':{'id':_0x830dd2[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](handleEntityNotFound(_0x13e256,null))[_0x36e4('0x28')](saveUpdates(_0x830dd2[_0x36e4('0x4d')],null))[_0x36e4('0x28')](respondWithResult(_0x13e256,null))[_0x36e4('0x47')](handleError(_0x13e256,null));};exports['destroy']=function(_0x3eaa40,_0x5b994b){return db[_0x36e4('0x31')][_0x36e4('0x4b')]({'where':{'id':_0x3eaa40[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](handleEntityNotFound(_0x5b994b,null))['then'](removeEntity(_0x5b994b,null))[_0x36e4('0x47')](handleError(_0x5b994b,null));};exports['describe']=function(_0x27c795,_0x540a14){return db['SmsQueue'][_0x36e4('0x55')]()[_0x36e4('0x28')](respondWithResult(_0x540a14,null))[_0x36e4('0x47')](handleError(_0x540a14,null));};exports[_0x36e4('0x56')]=function(_0x1c1d67,_0x123111,_0x217253){var _0x339583={'raw':!![],'where':{}},_0x15d01f={},_0x310ed1;return db[_0x36e4('0x31')][_0x36e4('0x57')]({'where':{'id':_0x1c1d67[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](handleEntityNotFound(_0x123111,null))[_0x36e4('0x28')](function(_0x21bbe5){if(_0x21bbe5){_0x310ed1=_0x21bbe5['get']({'plain':!![]});_0x15d01f['model']=_['keys'](db[_0x36e4('0x58')][_0x36e4('0x32')]);_0x15d01f[_0x36e4('0x33')]=_['keys'](_0x1c1d67['query']);_0x15d01f[_0x36e4('0x35')]=_['intersection'](_0x15d01f[_0x36e4('0x37')],_0x15d01f[_0x36e4('0x33')]);_0x339583[_0x36e4('0x38')]=_[_0x36e4('0x36')](_0x15d01f[_0x36e4('0x37')],qs[_0x36e4('0x49')](_0x1c1d67[_0x36e4('0x33')][_0x36e4('0x49')]));_0x339583['attributes']=_0x339583[_0x36e4('0x38')][_0x36e4('0x39')]?_0x339583[_0x36e4('0x38')]:_0x15d01f[_0x36e4('0x37')];if(!_0x1c1d67['query'][_0x36e4('0x59')](_0x36e4('0x5a'))){_0x339583[_0x36e4('0x21')]=qs[_0x36e4('0x21')](_0x1c1d67[_0x36e4('0x33')][_0x36e4('0x21')]);_0x339583[_0x36e4('0x20')]=qs[_0x36e4('0x20')](_0x1c1d67[_0x36e4('0x33')][_0x36e4('0x20')]);}_0x339583[_0x36e4('0x5b')]=qs['sort'](_0x1c1d67[_0x36e4('0x33')]['sort']);_0x339583[_0x36e4('0x3b')]=qs[_0x36e4('0x35')](_[_0x36e4('0x5c')](_0x1c1d67[_0x36e4('0x33')],_0x15d01f[_0x36e4('0x35')]));_0x339583[_0x36e4('0x3b')]['SmsQueueId']=_0x21bbe5['id'];if(_0x1c1d67['query']['filter']){_0x339583[_0x36e4('0x3b')]=_[_0x36e4('0x3d')](_0x339583[_0x36e4('0x3b')],{'$or':_[_0x36e4('0x3e')](_0x339583[_0x36e4('0x38')],function(_0x1461d0){var _0xd62d50={};_0xd62d50[_0x1461d0]={'$like':'%'+_0x1c1d67[_0x36e4('0x33')][_0x36e4('0x3c')]+'%'};return _0xd62d50;})});}_0x339583=_['merge']({},_0x339583,_0x1c1d67[_0x36e4('0x42')]);return db[_0x36e4('0x58')]['findAll'](_0x339583);}})[_0x36e4('0x28')](function(_0x13549){if(_0x13549){return db[_0x36e4('0x5d')][_0x36e4('0x5e')]({'where':{'id':_['map'](_0x13549,_0x36e4('0x5f')),'role':'agent'},'attributes':['id',_0x36e4('0x2e'),_0x36e4('0x60'),'updatedAt','createdAt']});}})[_0x36e4('0x28')](function(_0x2e7489){if(_0x2e7489){return{'count':_0x2e7489[_0x36e4('0x43')],'rows':_[_0x36e4('0x3e')](_0x2e7489[_0x36e4('0x46')],function(_0x2023ec){return{'membername':_0x2023ec[_0x36e4('0x2e')],'UserId':_0x2023ec['id'],'queue_name':_0x310ed1[_0x36e4('0x2e')],'SmsQueueId':_0x310ed1['id'],'interface':util[_0x36e4('0x61')]('%s/%s','SIP',_0x2023ec[_0x36e4('0x2e')]),'penalty':0x0,'paused':_0x2023ec[_0x36e4('0x60')],'createdAt':_0x2023ec[_0x36e4('0x62')],'updatedAt':_0x2023ec[_0x36e4('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x36e4('0x28')](respondWithFilteredResult(_0x123111,_0x339583))[_0x36e4('0x47')](handleError(_0x123111,null));};exports['getTeams']=function(_0x28c6b0,_0x23a660,_0x3e2d97){var _0x520fb6={};var _0x458cb3={};var _0x3981ad;var _0x5b3b23;return db[_0x36e4('0x31')][_0x36e4('0x57')]({'where':{'id':_0x28c6b0[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](handleEntityNotFound(_0x23a660,null))[_0x36e4('0x28')](function(_0x4eb4b7){if(_0x4eb4b7){_0x3981ad=_0x4eb4b7;_0x458cb3[_0x36e4('0x37')]=_['keys'](db[_0x36e4('0x64')][_0x36e4('0x32')]);_0x458cb3[_0x36e4('0x33')]=_['keys'](_0x28c6b0['query']);_0x458cb3[_0x36e4('0x35')]=_['intersection'](_0x458cb3['model'],_0x458cb3[_0x36e4('0x33')]);_0x520fb6['attributes']=_[_0x36e4('0x36')](_0x458cb3[_0x36e4('0x37')],qs['fields'](_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x49')]));_0x520fb6['attributes']=_0x520fb6['attributes']['length']?_0x520fb6['attributes']:_0x458cb3[_0x36e4('0x37')];_0x520fb6['order']=qs[_0x36e4('0x3a')](_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x3a')]);_0x520fb6[_0x36e4('0x3b')]=qs[_0x36e4('0x35')](_[_0x36e4('0x5c')](_0x28c6b0['query'],_0x458cb3[_0x36e4('0x35')]));if(_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x3c')]){_0x520fb6['where']=_[_0x36e4('0x3d')](_0x520fb6[_0x36e4('0x3b')],{'$or':_[_0x36e4('0x3e')](_0x520fb6[_0x36e4('0x38')],function(_0x49c221){var _0x59e3e1={};_0x59e3e1[_0x49c221]={'$like':'%'+_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x3c')]+'%'};return _0x59e3e1;})});}_0x520fb6=_[_0x36e4('0x3d')]({},_0x520fb6,_0x28c6b0[_0x36e4('0x42')]);return _0x3981ad[_0x36e4('0x65')](_0x520fb6);}})[_0x36e4('0x28')](function(_0x6c1160){if(_0x6c1160){_0x5b3b23=_0x6c1160[_0x36e4('0x39')];if(!_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x59')](_0x36e4('0x5a'))){_0x520fb6[_0x36e4('0x21')]=qs[_0x36e4('0x21')](_0x28c6b0['query'][_0x36e4('0x21')]);_0x520fb6['offset']=qs['offset'](_0x28c6b0[_0x36e4('0x33')][_0x36e4('0x20')]);}return _0x3981ad[_0x36e4('0x65')](_0x520fb6);}})[_0x36e4('0x28')](function(_0x3dc602){if(_0x3dc602){return _0x3dc602?{'count':_0x5b3b23,'rows':_0x3dc602}:null;}})[_0x36e4('0x28')](respondWithResult(_0x23a660,null))['catch'](handleError(_0x23a660,null));};exports['addTeams']=function(_0x15b954,_0x45f555,_0x51124b){var _0x9d8f0d=_0x15b954[_0x36e4('0x4d')][_0x36e4('0x66')];return db[_0x36e4('0x64')][_0x36e4('0x45')]({'where':{'id':_[_0x36e4('0x3e')](_0x9d8f0d,'id')},'attributes':['id'],'include':[{'model':db[_0x36e4('0x5d')],'as':_0x36e4('0x67'),'attributes':['id',_0x36e4('0x2e'),_0x36e4('0x68'),_0x36e4('0x69'),_0x36e4('0x6a')],'raw':!![]}]})[_0x36e4('0x28')](function(_0x12b3ac){if(_0x12b3ac){var _0x8456a3=_[_0x36e4('0x6b')](_0x12b3ac,function(_0x4b6e1b){var _0x46bc08=_0x4b6e1b[_0x36e4('0x29')]({'plain':!![]});return _0x46bc08[_0x36e4('0x67')];});return db['SmsQueue'][_0x36e4('0x4b')]({'where':{'id':_0x15b954[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](function(_0x42c3cd){return db[_0x36e4('0x6c')][_0x36e4('0x6d')](function(_0x2797f6){return _0x42c3cd[_0x36e4('0x6e')](_['map'](_0x9d8f0d,'id'),{'transaction':_0x2797f6})['then'](function(){return BPromise[_0x36e4('0x6f')](_0x8456a3,function(_0x35ecdb){return db[_0x36e4('0x58')]['findOrCreate']({'where':{'UserId':_0x35ecdb['id'],'SmsQueueId':_0x15b954[_0x36e4('0x54')]['id']},'transaction':_0x2797f6});});})[_0x36e4('0x28')](function(){_0x8456a3[_0x36e4('0x70')](function(_0x2c7467){socket[_0x36e4('0x71')]('userSmsQueue:save',{'UserId':_0x2c7467['id'],'SmsQueueId':_0x42c3cd['id']});});});});});}})[_0x36e4('0x28')](respondWithStatusCode(_0x45f555,null))['catch'](handleError(_0x45f555,null));};exports[_0x36e4('0x72')]=function(_0x597ae9,_0x396dae,_0x3d9c93){return db[_0x36e4('0x64')][_0x36e4('0x45')]({'where':{'id':_0x597ae9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x36e4('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x36e4('0x28')](handleEntityNotFound(_0x396dae,null))[_0x36e4('0x28')](function(_0x2c90c4){var _0x2d1378=_[_0x36e4('0x3e')](_0x2c90c4,'id');var _0xa598e1=[];var _0xbaa5ec=[];var _0x52fd86=squel['select']();_0x52fd86[_0x36e4('0x73')](_0x36e4('0x74'))[_0x36e4('0x75')]('team_has_sms_queues','tq')[_0x36e4('0x76')](_0x36e4('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x36e4('0x3b')](_0x36e4('0x78'),_0x597ae9[_0x36e4('0x54')]['id']);for(var _0x4a5e21=0x0;_0x4a5e21<_0x2c90c4[_0x36e4('0x39')];_0x4a5e21+=0x1){let _0x48b46e=_0x2c90c4[_0x4a5e21];for(var _0xf44b29=0x0;_0xf44b29<_0x48b46e['Agents']['length'];_0xf44b29+=0x1){let _0x365df9=_0x48b46e[_0x36e4('0x67')][_0xf44b29];var _0x176110=_0x52fd86[_0x36e4('0x79')]();_0x176110['where'](_0x36e4('0x7a'),_0x365df9['id']);_0xbaa5ec[_0x36e4('0x7b')](db[_0x36e4('0x6c')]['query'](_0x176110[_0x36e4('0x7c')](),{'type':db[_0x36e4('0x6c')][_0x36e4('0x7d')][_0x36e4('0x7e')]})[_0x36e4('0x28')](function(_0x1d438c){if(_0x1d438c[_0x36e4('0x39')]===0x1){return _0x365df9['id'];}else{var _0x10a6b9=_[_0x36e4('0x7f')](_[_0x36e4('0x3e')](_0x1d438c,_0x36e4('0x80')),function(_0x2065d0){return _[_0x36e4('0x81')](_0x2d1378,_0x2065d0);});if(_0x10a6b9){return _0x365df9['id'];}}}));}}return BPromise['all'](_0xbaa5ec)[_0x36e4('0x28')](function(_0x2336ce){_0xa598e1=_(_0xa598e1)['union'](_0x2336ce)[_0x36e4('0x82')]()[_0x36e4('0x83')]();return db['SmsQueue'][_0x36e4('0x4b')]({'where':{'id':_0x597ae9[_0x36e4('0x54')]['id']}})['then'](function(_0x5ab13e){return db['sequelize'][_0x36e4('0x6d')](function(_0x398f64){return _0x5ab13e['removeTeams'](_0x597ae9[_0x36e4('0x33')][_0x36e4('0x84')],{'transaction':_0x398f64})[_0x36e4('0x28')](function(){if(!_[_0x36e4('0x85')](_0xa598e1)){return _0x5ab13e[_0x36e4('0x86')](_0xa598e1,{'transaction':_0x398f64});}})['then'](function(){_0xa598e1[_0x36e4('0x70')](function(_0xbd7fa2){socket[_0x36e4('0x71')]('userSmsQueue:remove',{'UserId':_0xbd7fa2,'SmsQueueId':_0x5ab13e['id']});});});});});});})[_0x36e4('0x28')](respondWithStatusCode(_0x396dae,null))[_0x36e4('0x47')](handleError(_0x396dae,null));};exports[_0x36e4('0x87')]=function(_0x174cd9,_0x5f8d5e,_0x565eb6){return db['SmsQueue']['find']({'where':{'id':_0x174cd9[_0x36e4('0x54')]['id']}})[_0x36e4('0x28')](handleEntityNotFound(_0x5f8d5e,null))[_0x36e4('0x28')](function(_0x3739f8){if(_0x3739f8){return _0x3739f8['addAgents'](_0x174cd9['body'][_0x36e4('0x84')],_[_0x36e4('0x88')](_0x174cd9[_0x36e4('0x4d')],['ids','id'])||{})['spread'](function(_0x405793){for(var _0x42a97a=0x0;_0x42a97a<_0x174cd9[_0x36e4('0x4d')]['ids'][_0x36e4('0x39')];_0x42a97a+=0x1){socket['emit'](_0x36e4('0x89'),{'UserId':_0x174cd9[_0x36e4('0x4d')][_0x36e4('0x84')][_0x42a97a],'SmsQueueId':_0x174cd9['params']['id']});}return _0x405793;});}})[_0x36e4('0x28')](respondWithResult(_0x5f8d5e,null))['catch'](handleError(_0x5f8d5e,null));};exports['removeAgents']=function(_0x7f46cb,_0x3a21f9,_0x404563){return db[_0x36e4('0x31')][_0x36e4('0x4b')]({'where':{'id':_0x7f46cb['params']['id']}})['then'](handleEntityNotFound(_0x3a21f9,null))[_0x36e4('0x28')](function(_0x4faaf9){if(_0x4faaf9){return _0x4faaf9[_0x36e4('0x86')](_0x7f46cb[_0x36e4('0x33')]['ids'])[_0x36e4('0x28')](function(){if(_[_0x36e4('0x8a')](_0x7f46cb['query'][_0x36e4('0x84')])){for(var _0x1d18b6=0x0;_0x1d18b6<_0x7f46cb[_0x36e4('0x33')][_0x36e4('0x84')]['length'];_0x1d18b6+=0x1){socket['emit'](_0x36e4('0x8b'),{'UserId':Number(_0x7f46cb['query']['ids'][_0x1d18b6]),'SmsQueueId':Number(_0x7f46cb[_0x36e4('0x54')]['id'])});}}else{socket[_0x36e4('0x71')]('userSmsQueue:remove',{'UserId':Number(_0x7f46cb[_0x36e4('0x33')][_0x36e4('0x84')]),'SmsQueueId':Number(_0x7f46cb[_0x36e4('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a21f9,null))[_0x36e4('0x47')](handleError(_0x3a21f9,null));};exports[_0x36e4('0x8c')]=function(_0x4987da,_0x1df168,_0x15030d){var _0x161a15={};var _0xe1ef0d={};var _0x254fe9;var _0x255814;return db[_0x36e4('0x31')]['findOne']({'where':{'id':_0x4987da[_0x36e4('0x54')]['id']}})['then'](handleEntityNotFound(_0x1df168,null))['then'](function(_0x18765a){if(_0x18765a){_0x254fe9=_0x18765a;_0xe1ef0d['model']=_[_0x36e4('0x34')](db[_0x36e4('0x5d')]['rawAttributes']);_0xe1ef0d[_0x36e4('0x33')]=_[_0x36e4('0x34')](_0x4987da['query']);_0xe1ef0d[_0x36e4('0x35')]=_[_0x36e4('0x36')](_0xe1ef0d[_0x36e4('0x37')],_0xe1ef0d[_0x36e4('0x33')]);_0x161a15[_0x36e4('0x38')]=_[_0x36e4('0x36')](_0xe1ef0d[_0x36e4('0x37')],qs[_0x36e4('0x49')](_0x4987da[_0x36e4('0x33')]['fields']));_0x161a15[_0x36e4('0x38')]=_0x161a15[_0x36e4('0x38')][_0x36e4('0x39')]?_0x161a15[_0x36e4('0x38')]:_0xe1ef0d[_0x36e4('0x37')];_0x161a15[_0x36e4('0x5b')]=qs[_0x36e4('0x3a')](_0x4987da['query'][_0x36e4('0x3a')]);_0x161a15[_0x36e4('0x3b')]=qs['filters'](_[_0x36e4('0x5c')](_0x4987da[_0x36e4('0x33')],_0xe1ef0d[_0x36e4('0x35')]));if(_0x4987da['query']['filter']){_0x161a15[_0x36e4('0x3b')]=_[_0x36e4('0x3d')](_0x161a15[_0x36e4('0x3b')],{'$or':_[_0x36e4('0x3e')](_0x161a15['attributes'],function(_0x38c49f){var _0x39a0a0={};_0x39a0a0[_0x38c49f]={'$like':'%'+_0x4987da[_0x36e4('0x33')][_0x36e4('0x3c')]+'%'};return _0x39a0a0;})});}_0x161a15=_[_0x36e4('0x3d')]({},_0x161a15,_0x4987da['options']);return _0x254fe9[_0x36e4('0x8c')](_0x161a15);}})[_0x36e4('0x28')](function(_0x3cb0ed){if(_0x3cb0ed){_0x255814=_0x3cb0ed[_0x36e4('0x39')];if(!_0x4987da['query'][_0x36e4('0x59')](_0x36e4('0x5a'))){_0x161a15[_0x36e4('0x21')]=qs[_0x36e4('0x21')](_0x4987da[_0x36e4('0x33')][_0x36e4('0x21')]);_0x161a15[_0x36e4('0x20')]=qs[_0x36e4('0x20')](_0x4987da['query'][_0x36e4('0x20')]);}return _0x254fe9[_0x36e4('0x8c')](_0x161a15);}})[_0x36e4('0x28')](function(_0x4ca49e){if(_0x4ca49e){return _0x4ca49e?{'count':_0x255814,'rows':_0x4ca49e}:null;}})[_0x36e4('0x28')](respondWithResult(_0x1df168,null))['catch'](handleError(_0x1df168,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index eefd972..f586d7b 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 _0x83ac=['save','update','remove','emit','hasOwnProperty','hook','events','SmsQueue','setMaxListeners'];(function(_0x25d777,_0x25902d){var _0x4e2005=function(_0x269eb1){while(--_0x269eb1){_0x25d777['push'](_0x25d777['shift']());}};_0x4e2005(++_0x25902d);}(_0x83ac,0x14a));var _0xc83a=function(_0x361e69,_0x53399e){_0x361e69=_0x361e69-0x0;var _0x1e50bd=_0x83ac[_0x361e69];return _0x1e50bd;};'use strict';var EventEmitter=require(_0xc83a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xc83a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc83a('0x2')](0x0);var events={'afterCreate':_0xc83a('0x3'),'afterUpdate':_0xc83a('0x4'),'afterDestroy':_0xc83a('0x5')};function emitEvent(_0x5aea38){return function(_0x2505ec,_0xac6730,_0x26bacf){SmsQueueEvents[_0xc83a('0x6')](_0x5aea38+':'+_0x2505ec['id'],_0x2505ec);SmsQueueEvents['emit'](_0x5aea38,_0x2505ec);_0x26bacf(null);};}for(var e in events){if(events[_0xc83a('0x7')](e)){var event=events[e];SmsQueue[_0xc83a('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xdbb5=['save','update','remove','emit','hasOwnProperty','hook','exports','SmsQueue','setMaxListeners'];(function(_0x4d8b95,_0x17cc98){var _0x51dc96=function(_0x17547a){while(--_0x17547a){_0x4d8b95['push'](_0x4d8b95['shift']());}};_0x51dc96(++_0x17cc98);}(_0xdbb5,0xb2));var _0x5dbb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdbb5[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x5dbb('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5dbb('0x1')](0x0);var events={'afterCreate':_0x5dbb('0x2'),'afterUpdate':_0x5dbb('0x3'),'afterDestroy':_0x5dbb('0x4')};function emitEvent(_0x291337){return function(_0x3a1956,_0x1eb9fd,_0x16a13a){SmsQueueEvents[_0x5dbb('0x5')](_0x291337+':'+_0x3a1956['id'],_0x3a1956);SmsQueueEvents[_0x5dbb('0x5')](_0x291337,_0x3a1956);_0x16a13a(null);};}for(var e in events){if(events[_0x5dbb('0x6')](e)){var event=events[e];SmsQueue[_0x5dbb('0x7')](e,emitEvent(event));}}module[_0x5dbb('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 6d97ca9..9dcbe4a 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 _0x31c2=['api','moment','bluebird','request-promise','path','./smsQueue.attributes','exports','SmsQueue','lodash','util','../../config/logger'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x31c2,0x1e1));var _0x231c=function(_0x7943de,_0x5d9d60){_0x7943de=_0x7943de-0x0;var _0x11e4dc=_0x31c2[_0x7943de];return _0x11e4dc;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var logger=require(_0x231c('0x2'))(_0x231c('0x3'));var moment=require(_0x231c('0x4'));var BPromise=require(_0x231c('0x5'));var rp=require(_0x231c('0x6'));var fs=require('fs');var path=require(_0x231c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x231c('0x8'));module[_0x231c('0x9')]=function(_0x1f3f7d,_0x219c3f){return _0x1f3f7d['define'](_0x231c('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6363=['define','SmsQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x2ce249,_0x16a7bd){var _0x498420=function(_0x40e9bd){while(--_0x40e9bd){_0x2ce249['push'](_0x2ce249['shift']());}};_0x498420(++_0x16a7bd);}(_0x6363,0x13a));var _0x3636=function(_0x527121,_0x1bcca9){_0x527121=_0x527121-0x0;var _0x5619c7=_0x6363[_0x527121];return _0x5619c7;};'use strict';var _=require(_0x3636('0x0'));var util=require('util');var logger=require(_0x3636('0x1'))(_0x3636('0x2'));var moment=require(_0x3636('0x3'));var BPromise=require(_0x3636('0x4'));var rp=require(_0x3636('0x5'));var fs=require('fs');var path=require(_0x3636('0x6'));var rimraf=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var attributes=require(_0x3636('0x9'));module[_0x3636('0xa')]=function(_0x15728f,_0x1f94ef){return _0x15728f[_0x3636('0xb')](_0x3636('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 94c9cc8..6606ba2 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 _0x436b=['map','model','attributes','GetSmsQueue','ShowSmsQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','SmsQueue','options','raw','where','limit','include'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x436b,0x9a));var _0xb436=function(_0x4ffa12,_0x5d6ba2){_0x4ffa12=_0x4ffa12-0x0;var _0x41a832=_0x436b[_0x4ffa12];return _0x41a832;};'use strict';var _=require('lodash');var util=require(_0xb436('0x0'));var moment=require(_0xb436('0x1'));var BPromise=require(_0xb436('0x2'));var rs=require(_0xb436('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb436('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb436('0x5'))(_0xb436('0x6'));var config=require(_0xb436('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb436('0x8')]=_[_0xb436('0x9')](config[_0xb436('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb436('0xa'))(new Redis(config['redis']));require(_0xb436('0xb'))[_0xb436('0xc')](socket);function respondWithRpcPromise(_0x2ef940,_0x392ef3,_0x24c3d3){return new BPromise(function(_0x57911e,_0x7081e3){return client[_0xb436('0xd')](_0x2ef940,_0x24c3d3)[_0xb436('0xe')](function(_0x1fbe10){logger['info']('SmsQueue,\x20%s,\x20%s',_0x392ef3,_0xb436('0xf'));logger[_0xb436('0x10')](_0xb436('0x11'),_0x392ef3,'request\x20sent',JSON[_0xb436('0x12')](_0x1fbe10));if(_0x1fbe10[_0xb436('0x13')]){if(_0x1fbe10[_0xb436('0x13')][_0xb436('0x14')]===0x1f4){logger['error'](_0xb436('0x15'),_0x392ef3,_0x1fbe10[_0xb436('0x13')]['message']);return _0x7081e3(_0x1fbe10[_0xb436('0x13')][_0xb436('0x16')]);}logger[_0xb436('0x13')](_0xb436('0x15'),_0x392ef3,_0x1fbe10[_0xb436('0x13')][_0xb436('0x16')]);return _0x57911e(_0x1fbe10[_0xb436('0x13')][_0xb436('0x16')]);}else{logger[_0xb436('0x17')](_0xb436('0x15'),_0x392ef3,_0xb436('0xf'));_0x57911e(_0x1fbe10['result'][_0xb436('0x16')]);}})[_0xb436('0x18')](function(_0x5d4a31){logger[_0xb436('0x13')](_0xb436('0x15'),_0x392ef3,_0x5d4a31);_0x7081e3(_0x5d4a31);});});}exports['GetSmsQueue']=function(_0xbee1ee){var _0x18b999=this;return new Promise(function(_0x225506,_0x30fe5f){return db[_0xb436('0x19')]['findAll']({'raw':_0xbee1ee['options']?_0xbee1ee[_0xb436('0x1a')][_0xb436('0x1b')]===undefined?!![]:![]:!![],'where':_0xbee1ee[_0xb436('0x1a')]?_0xbee1ee['options'][_0xb436('0x1c')]||null:null,'attributes':_0xbee1ee[_0xb436('0x1a')]?_0xbee1ee[_0xb436('0x1a')]['attributes']||null:null,'limit':_0xbee1ee[_0xb436('0x1a')]?_0xbee1ee[_0xb436('0x1a')][_0xb436('0x1d')]||null:null,'include':_0xbee1ee[_0xb436('0x1a')]?_0xbee1ee[_0xb436('0x1a')][_0xb436('0x1e')]?_[_0xb436('0x1f')](_0xbee1ee['options']['include'],function(_0x3a9cd7){return{'model':db[_0x3a9cd7[_0xb436('0x20')]],'as':_0x3a9cd7['as'],'attributes':_0x3a9cd7['attributes'],'include':_0x3a9cd7[_0xb436('0x1e')]?_[_0xb436('0x1f')](_0x3a9cd7[_0xb436('0x1e')],function(_0x5f4592){return{'model':db[_0x5f4592[_0xb436('0x20')]],'as':_0x5f4592['as'],'attributes':_0x5f4592[_0xb436('0x21')],'include':_0x5f4592['include']?_[_0xb436('0x1f')](_0x5f4592[_0xb436('0x1e')],function(_0x1de4d3){return{'model':db[_0x1de4d3[_0xb436('0x20')]],'as':_0x1de4d3['as'],'attributes':_0x1de4d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xb436('0xe')](function(_0x17ec73){logger[_0xb436('0x17')](_0xb436('0x22'),_0xbee1ee);logger[_0xb436('0x10')](_0xb436('0x22'),_0xbee1ee,JSON[_0xb436('0x12')](_0x17ec73));_0x225506(_0x17ec73);})[_0xb436('0x18')](function(_0xcfc634){logger[_0xb436('0x13')](_0xb436('0x22'),_0xcfc634[_0xb436('0x16')],_0xbee1ee);_0x30fe5f(_0x18b999[_0xb436('0x13')](0x1f4,_0xcfc634['message']));});});};exports[_0xb436('0x23')]=function(_0x1d6afd){var _0xc25f75=this;return new Promise(function(_0x5da5dc,_0xf724ef){return db['SmsQueue'][_0xb436('0x24')]({'raw':_0x1d6afd[_0xb436('0x1a')]?_0x1d6afd[_0xb436('0x1a')][_0xb436('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d6afd[_0xb436('0x1a')]?_0x1d6afd[_0xb436('0x1a')][_0xb436('0x1c')]||null:null,'attributes':_0x1d6afd[_0xb436('0x1a')]?_0x1d6afd[_0xb436('0x1a')]['attributes']||null:null,'include':_0x1d6afd[_0xb436('0x1a')]?_0x1d6afd[_0xb436('0x1a')][_0xb436('0x1e')]?_['map'](_0x1d6afd[_0xb436('0x1a')][_0xb436('0x1e')],function(_0x5835b3){return{'model':db[_0x5835b3['model']],'as':_0x5835b3['as'],'attributes':_0x5835b3[_0xb436('0x21')],'include':_0x5835b3[_0xb436('0x1e')]?_[_0xb436('0x1f')](_0x5835b3[_0xb436('0x1e')],function(_0x3ed646){return{'model':db[_0x3ed646[_0xb436('0x20')]],'as':_0x3ed646['as'],'attributes':_0x3ed646[_0xb436('0x21')],'include':_0x3ed646[_0xb436('0x1e')]?_[_0xb436('0x1f')](_0x3ed646[_0xb436('0x1e')],function(_0x4bf53d){return{'model':db[_0x4bf53d[_0xb436('0x20')]],'as':_0x4bf53d['as'],'attributes':_0x4bf53d[_0xb436('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb436('0xe')](function(_0x4c822e){logger['info'](_0xb436('0x23'),_0x1d6afd);logger['debug'](_0xb436('0x23'),_0x1d6afd,JSON[_0xb436('0x12')](_0x4c822e));_0x5da5dc(_0x4c822e);})[_0xb436('0x18')](function(_0x338349){logger[_0xb436('0x13')](_0xb436('0x23'),_0x338349['message'],_0x1d6afd);_0xf724ef(_0xc25f75[_0xb436('0x13')](0x1f4,_0x338349[_0xb436('0x16')]));});});}; \ No newline at end of file +var _0x51cd=['socket.io-emitter','register','request','then','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SmsQueue,\x20%s,\x20%s','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','model','include','map','attributes','debug','ShowSmsQueue','find','info','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x47962e,_0x1a3ddb){var _0x592a8c=function(_0x5d25e0){while(--_0x5d25e0){_0x47962e['push'](_0x47962e['shift']());}};_0x592a8c(++_0x1a3ddb);}(_0x51cd,0x141));var _0xd51c=function(_0x15605c,_0x3cd2cb){_0x15605c=_0x15605c-0x0;var _0x3fd1b0=_0x51cd[_0x15605c];return _0x3fd1b0;};'use strict';var _=require(_0xd51c('0x0'));var util=require(_0xd51c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd51c('0x2'));var fs=require('fs');var Redis=require(_0xd51c('0x3'));var db=require(_0xd51c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd51c('0x5'));var config=require('../../config/environment');var jayson=require(_0xd51c('0x6'));var client=jayson[_0xd51c('0x7')][_0xd51c('0x8')]({'port':0x232a});config[_0xd51c('0x9')]=_[_0xd51c('0xa')](config[_0xd51c('0x9')],{'host':_0xd51c('0xb'),'port':0x18eb});var socket=require(_0xd51c('0xc'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xd51c('0xd')](socket);function respondWithRpcPromise(_0x9d6073,_0x1f816a,_0x251d44){return new BPromise(function(_0xa8de7a,_0x48e316){return client[_0xd51c('0xe')](_0x9d6073,_0x251d44)[_0xd51c('0xf')](function(_0x403866){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1f816a,'request\x20sent');logger['debug'](_0xd51c('0x10'),_0x1f816a,_0xd51c('0x11'),JSON[_0xd51c('0x12')](_0x403866));if(_0x403866[_0xd51c('0x13')]){if(_0x403866[_0xd51c('0x13')]['code']===0x1f4){logger[_0xd51c('0x13')]('SmsQueue,\x20%s,\x20%s',_0x1f816a,_0x403866['error'][_0xd51c('0x14')]);return _0x48e316(_0x403866[_0xd51c('0x13')]['message']);}logger[_0xd51c('0x13')](_0xd51c('0x15'),_0x1f816a,_0x403866['error'][_0xd51c('0x14')]);return _0xa8de7a(_0x403866[_0xd51c('0x13')][_0xd51c('0x14')]);}else{logger['info'](_0xd51c('0x15'),_0x1f816a,_0xd51c('0x11'));_0xa8de7a(_0x403866['result'][_0xd51c('0x14')]);}})[_0xd51c('0x16')](function(_0x36063e){logger[_0xd51c('0x13')]('SmsQueue,\x20%s,\x20%s',_0x1f816a,_0x36063e);_0x48e316(_0x36063e);});});}exports[_0xd51c('0x17')]=function(_0x18ed0a){var _0x7b2c48=this;return new Promise(function(_0x4878f8,_0x3ab6bb){return db[_0xd51c('0x18')][_0xd51c('0x19')]({'raw':_0x18ed0a[_0xd51c('0x1a')]?_0x18ed0a['options'][_0xd51c('0x1b')]===undefined?!![]:![]:!![],'where':_0x18ed0a[_0xd51c('0x1a')]?_0x18ed0a[_0xd51c('0x1a')][_0xd51c('0x1c')]||null:null,'attributes':_0x18ed0a[_0xd51c('0x1a')]?_0x18ed0a[_0xd51c('0x1a')]['attributes']||null:null,'limit':_0x18ed0a['options']?_0x18ed0a[_0xd51c('0x1a')]['limit']||null:null,'include':_0x18ed0a[_0xd51c('0x1a')]?_0x18ed0a[_0xd51c('0x1a')]['include']?_['map'](_0x18ed0a['options']['include'],function(_0x4178bc){return{'model':db[_0x4178bc[_0xd51c('0x1d')]],'as':_0x4178bc['as'],'attributes':_0x4178bc['attributes'],'include':_0x4178bc[_0xd51c('0x1e')]?_[_0xd51c('0x1f')](_0x4178bc[_0xd51c('0x1e')],function(_0x49fe24){return{'model':db[_0x49fe24[_0xd51c('0x1d')]],'as':_0x49fe24['as'],'attributes':_0x49fe24[_0xd51c('0x20')],'include':_0x49fe24[_0xd51c('0x1e')]?_[_0xd51c('0x1f')](_0x49fe24['include'],function(_0x12e597){return{'model':db[_0x12e597[_0xd51c('0x1d')]],'as':_0x12e597['as'],'attributes':_0x12e597[_0xd51c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd51c('0xf')](function(_0x1b68a3){logger['info'](_0xd51c('0x17'),_0x18ed0a);logger[_0xd51c('0x21')](_0xd51c('0x17'),_0x18ed0a,JSON[_0xd51c('0x12')](_0x1b68a3));_0x4878f8(_0x1b68a3);})[_0xd51c('0x16')](function(_0x27cbd9){logger[_0xd51c('0x13')]('GetSmsQueue',_0x27cbd9[_0xd51c('0x14')],_0x18ed0a);_0x3ab6bb(_0x7b2c48[_0xd51c('0x13')](0x1f4,_0x27cbd9[_0xd51c('0x14')]));});});};exports[_0xd51c('0x22')]=function(_0x24bbb3){var _0xfeeff=this;return new Promise(function(_0x145d4d,_0x2c8b12){return db[_0xd51c('0x18')][_0xd51c('0x23')]({'raw':_0x24bbb3[_0xd51c('0x1a')]?_0x24bbb3[_0xd51c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24bbb3[_0xd51c('0x1a')]?_0x24bbb3[_0xd51c('0x1a')][_0xd51c('0x1c')]||null:null,'attributes':_0x24bbb3['options']?_0x24bbb3[_0xd51c('0x1a')][_0xd51c('0x20')]||null:null,'include':_0x24bbb3[_0xd51c('0x1a')]?_0x24bbb3['options'][_0xd51c('0x1e')]?_[_0xd51c('0x1f')](_0x24bbb3[_0xd51c('0x1a')][_0xd51c('0x1e')],function(_0x1db111){return{'model':db[_0x1db111[_0xd51c('0x1d')]],'as':_0x1db111['as'],'attributes':_0x1db111[_0xd51c('0x20')],'include':_0x1db111['include']?_[_0xd51c('0x1f')](_0x1db111[_0xd51c('0x1e')],function(_0x461b8e){return{'model':db[_0x461b8e[_0xd51c('0x1d')]],'as':_0x461b8e['as'],'attributes':_0x461b8e['attributes'],'include':_0x461b8e[_0xd51c('0x1e')]?_['map'](_0x461b8e['include'],function(_0x5e638f){return{'model':db[_0x5e638f[_0xd51c('0x1d')]],'as':_0x5e638f['as'],'attributes':_0x5e638f[_0xd51c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd51c('0xf')](function(_0x2b4dd8){logger[_0xd51c('0x24')](_0xd51c('0x22'),_0x24bbb3);logger[_0xd51c('0x21')]('ShowSmsQueue',_0x24bbb3,JSON[_0xd51c('0x12')](_0x2b4dd8));_0x145d4d(_0x2b4dd8);})[_0xd51c('0x16')](function(_0x1c33fc){logger[_0xd51c('0x13')](_0xd51c('0x22'),_0x1c33fc[_0xd51c('0x14')],_0x24bbb3);_0x2c8b12(_0xfeeff[_0xd51c('0x13')](0x1f4,_0x1c33fc[_0xd51c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 16ac579..ce32b5c 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 _0x4d07=['remove','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x520e16,_0x545cb6){var _0x4771b5=function(_0x5e3a50){while(--_0x5e3a50){_0x520e16['push'](_0x520e16['shift']());}};_0x4771b5(++_0x545cb6);}(_0x4d07,0x18e));var _0x74d0=function(_0x5de133,_0x575ae4){_0x5de133=_0x5de133-0x0;var _0x5d4684=_0x4d07[_0x5de133];return _0x5d4684;};'use strict';var SmsQueueEvents=require(_0x74d0('0x0'));var events=['save',_0x74d0('0x1'),'update'];function createListener(_0x553c84,_0x4ee27c){return function(_0x5d6bc0){_0x4ee27c[_0x74d0('0x2')](_0x553c84,_0x5d6bc0);};}function removeListener(_0x464dbf,_0x28dc64){return function(){SmsQueueEvents[_0x74d0('0x3')](_0x464dbf,_0x28dc64);};}exports[_0x74d0('0x4')]=function(_0x32e893){for(var _0x2d3541=0x0,_0x2dd3a4=events[_0x74d0('0x5')];_0x2d3541<_0x2dd3a4;_0x2d3541++){var _0x42e083=events[_0x2d3541];var _0x2b1067=createListener(_0x74d0('0x6')+_0x42e083,_0x32e893);SmsQueueEvents['on'](_0x42e083,_0x2b1067);}}; \ No newline at end of file +var _0x174d=['length','smsQueue:','remove','update','removeListener','register'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x174d,0x1ca));var _0xd174=function(_0x2a3e5f,_0x24c745){_0x2a3e5f=_0x2a3e5f-0x0;var _0xfdbebc=_0x174d[_0x2a3e5f];return _0xfdbebc;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xd174('0x0'),_0xd174('0x1')];function createListener(_0x3b2536,_0x4a2ce7){return function(_0x3aeb54){_0x4a2ce7['emit'](_0x3b2536,_0x3aeb54);};}function removeListener(_0x37a850,_0x529a43){return function(){SmsQueueEvents[_0xd174('0x2')](_0x37a850,_0x529a43);};}exports[_0xd174('0x3')]=function(_0x35ae3f){for(var _0x53e2fa=0x0,_0x12bd0e=events[_0xd174('0x4')];_0x53e2fa<_0x12bd0e;_0x53e2fa++){var _0x457e93=events[_0x53e2fa];var _0x58448c=createListener(_0xd174('0x5')+_0x457e93,_0x35ae3f);SmsQueueEvents['on'](_0x457e93,_0x58448c);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 6d84b81..5866e73 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 _0x36bb=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var path=require(_0xb36b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb36b('0x3'));var router=express[_0xb36b('0x4')]();var auth=require(_0xb36b('0x5'));var interaction=require(_0xb36b('0x6'));var config=require(_0xb36b('0x7'));var controller=require(_0xb36b('0x8'));router[_0xb36b('0x9')]('/',auth[_0xb36b('0xa')](),controller[_0xb36b('0xb')]);router[_0xb36b('0x9')](_0xb36b('0xc'),auth[_0xb36b('0xa')](),controller[_0xb36b('0xd')]);router[_0xb36b('0x9')](_0xb36b('0xe'),auth[_0xb36b('0xa')](),controller[_0xb36b('0xf')]);router[_0xb36b('0x10')]('/',auth[_0xb36b('0xa')](),controller['create']);router[_0xb36b('0x11')](_0xb36b('0xe'),auth[_0xb36b('0xa')](),controller['update']);router[_0xb36b('0x12')](_0xb36b('0xe'),auth[_0xb36b('0xa')](),controller[_0xb36b('0x13')]);module[_0xb36b('0x14')]=router; \ No newline at end of file +var _0xbe3b=['get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','express','../../components/interaction/service'];(function(_0x38e223,_0x292d2a){var _0x213a80=function(_0x5099dd){while(--_0x5099dd){_0x38e223['push'](_0x38e223['shift']());}};_0x213a80(++_0x292d2a);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x91f539,_0x442a0c){_0x91f539=_0x91f539-0x0;var _0x2e3bdd=_0xbe3b[_0x91f539];return _0x2e3bdd;};'use strict';var multer=require('multer');var util=require(_0xbbe3('0x0'));var path=require(_0xbbe3('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbe3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbbe3('0x3'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xbbe3('0x4')]('/',auth[_0xbbe3('0x5')](),controller[_0xbbe3('0x6')]);router[_0xbbe3('0x4')]('/describe',auth[_0xbbe3('0x5')](),controller[_0xbbe3('0x7')]);router[_0xbbe3('0x4')](_0xbbe3('0x8'),auth[_0xbbe3('0x5')](),controller['show']);router[_0xbbe3('0x9')]('/',auth[_0xbbe3('0x5')](),controller[_0xbbe3('0xa')]);router[_0xbbe3('0xb')](_0xbbe3('0x8'),auth[_0xbbe3('0x5')](),controller[_0xbbe3('0xc')]);router[_0xbbe3('0xd')]('/:id',auth[_0xbbe3('0x5')](),controller[_0xbbe3('0xe')]);module[_0xbbe3('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 5f16e69..152f7a3 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 _0xc92a=['STRING','DATE','sequelize','exports'];(function(_0x48a4e4,_0x3fd072){var _0x581e47=function(_0xde31f7){while(--_0xde31f7){_0x48a4e4['push'](_0x48a4e4['shift']());}};_0x581e47(++_0x3fd072);}(_0xc92a,0xc6));var _0xac92=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc92a[_0x397e5f];return _0x5302b8;};'use strict';var moment=require('moment');var Sequelize=require(_0xac92('0x0'));module[_0xac92('0x1')]={'uniqueid':{'type':Sequelize[_0xac92('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xac92('0x2')]},'joinAt':{'type':Sequelize[_0xac92('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xac92('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xac92('0x2')]}}; \ No newline at end of file +var _0x23ca=['sequelize','STRING','DATE','moment'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x23ca,0x97));var _0xa23c=function(_0x1ae67a,_0x3b8912){_0x1ae67a=_0x1ae67a-0x0;var _0x5e7b06=_0x23ca[_0x1ae67a];return _0x5e7b06;};'use strict';var moment=require(_0xa23c('0x0'));var Sequelize=require(_0xa23c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa23c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa23c('0x2')]},'joinAt':{'type':Sequelize[_0xa23c('0x3')]},'leaveAt':{'type':Sequelize[_0xa23c('0x3')]},'acceptAt':{'type':Sequelize[_0xa23c('0x3')]},'exitAt':{'type':Sequelize[_0xa23c('0x3')]},'reason':{'type':Sequelize[_0xa23c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 91c11c6..32b9632 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 _0x2a03=['SmsQueueReport','model','keys','query','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','create','body','find','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x14ad6f,_0x434da8){var _0x1245ad=function(_0x297db5){while(--_0x297db5){_0x14ad6f['push'](_0x14ad6f['shift']());}};_0x1245ad(++_0x434da8);}(_0x2a03,0x6c));var _0x32a0=function(_0x3776b4,_0x19a1e3){_0x3776b4=_0x3776b4-0x0;var _0x1636d9=_0x2a03[_0x3776b4];return _0x1636d9;};'use strict';var pdf=require(_0x32a0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x32a0('0x1'));var zipdir=require(_0x32a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32a0('0x3'));var moment=require(_0x32a0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x32a0('0x5'));var util=require(_0x32a0('0x6'));var path=require(_0x32a0('0x7'));var sox=require('sox');var csv=require(_0x32a0('0x8'));var ejs=require(_0x32a0('0x9'));var fs=require('fs');var _=require(_0x32a0('0xa'));var squel=require(_0x32a0('0xb'));var crypto=require(_0x32a0('0xc'));var jsforce=require(_0x32a0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x32a0('0x8'));var querystring=require('querystring');var Papa=require(_0x32a0('0xe'));var Redis=require(_0x32a0('0xf'));var authService=require(_0x32a0('0x10'));var qs=require(_0x32a0('0x11'));var hardwareService=require(_0x32a0('0x12'));var logger=require(_0x32a0('0x13'))(_0x32a0('0x14'));var utils=require(_0x32a0('0x15'));var config=require(_0x32a0('0x16'));var db=require(_0x32a0('0x17'))['db'];function respondWithStatusCode(_0x38997c,_0x5a619c){_0x5a619c=_0x5a619c||0xcc;return function(_0x3c07a4){if(_0x3c07a4){return _0x38997c[_0x32a0('0x18')](_0x5a619c);}return _0x38997c[_0x32a0('0x19')](_0x5a619c)[_0x32a0('0x1a')]();};}function respondWithResult(_0x48c733,_0xf81288){_0xf81288=_0xf81288||0xc8;return function(_0x5bca4f){if(_0x5bca4f){return _0x48c733[_0x32a0('0x19')](_0xf81288)[_0x32a0('0x1b')](_0x5bca4f);}};}function respondWithFilteredResult(_0x49c7f9,_0x323fc7){return function(_0x797301){if(_0x797301){var _0x136f3c=_0x797301[_0x32a0('0x1c')],_0x2fc163=_0x323fc7[_0x32a0('0x1d')],_0x42c01c=_0x323fc7['offset']+_0x323fc7[_0x32a0('0x1e')],_0x5727e0;if(_0x42c01c>=_0x136f3c){_0x42c01c=_0x136f3c;_0x5727e0=0xc8;}else{_0x5727e0=0xce;}_0x49c7f9[_0x32a0('0x19')](_0x5727e0);return _0x49c7f9['set'](_0x32a0('0x1f'),_0x2fc163+'-'+_0x42c01c+'/'+_0x136f3c)['json'](_0x797301);}return null;};}function patchUpdates(_0x143f3b){return function(_0x29b4cb){try{jsonpatch[_0x32a0('0x20')](_0x29b4cb,_0x143f3b,!![]);}catch(_0x3ca06b){return BPromise[_0x32a0('0x21')](_0x3ca06b);}return _0x29b4cb[_0x32a0('0x22')]();};}function saveUpdates(_0x5dfbb4,_0x46d417){return function(_0x4af175){if(_0x4af175){return _0x4af175[_0x32a0('0x23')](_0x5dfbb4)[_0x32a0('0x24')](function(_0x57fd7c){return _0x57fd7c;});}return null;};}function removeEntity(_0x3fb94a,_0x3a4289){return function(_0x671857){if(_0x671857){return _0x671857['destroy']()[_0x32a0('0x24')](function(){_0x3fb94a[_0x32a0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb678,_0x6d348f){return function(_0x63655a){if(!_0x63655a){_0x1fb678[_0x32a0('0x18')](0x194);}return _0x63655a;};}function handleError(_0x3f0846,_0x3734e9){_0x3734e9=_0x3734e9||0x1f4;return function(_0x194799){logger[_0x32a0('0x25')](_0x194799[_0x32a0('0x26')]);if(_0x194799['name']){delete _0x194799[_0x32a0('0x27')];}_0x3f0846[_0x32a0('0x19')](_0x3734e9)[_0x32a0('0x28')](_0x194799);};}exports[_0x32a0('0x29')]=function(_0xf36f79,_0x1bb5e9){var _0x4d858d={},_0x51c721={},_0x1f344c={'count':0x0,'rows':[]};var _0x50d94d=db[_0x32a0('0x2a')]['rawAttributes'];_0x51c721[_0x32a0('0x2b')]=_[_0x32a0('0x2c')](_0x50d94d);_0x51c721[_0x32a0('0x2d')]=_[_0x32a0('0x2c')](_0xf36f79['query']);_0x51c721[_0x32a0('0x2e')]=_[_0x32a0('0x2f')](_0x51c721[_0x32a0('0x2b')],_0x51c721[_0x32a0('0x2d')]);_0x4d858d[_0x32a0('0x30')]=_[_0x32a0('0x2f')](_0x51c721[_0x32a0('0x2b')],qs['fields'](_0xf36f79[_0x32a0('0x2d')]['fields']));_0x4d858d['attributes']=_0x4d858d[_0x32a0('0x30')]['length']?_0x4d858d[_0x32a0('0x30')]:_0x51c721[_0x32a0('0x2b')];if(!_0xf36f79[_0x32a0('0x2d')]['hasOwnProperty'](_0x32a0('0x31'))){_0x4d858d[_0x32a0('0x1e')]=qs[_0x32a0('0x1e')](_0xf36f79['query'][_0x32a0('0x1e')]);_0x4d858d[_0x32a0('0x1d')]=qs[_0x32a0('0x1d')](_0xf36f79[_0x32a0('0x2d')][_0x32a0('0x1d')]);}_0x4d858d['order']=qs[_0x32a0('0x32')](_0xf36f79[_0x32a0('0x2d')][_0x32a0('0x32')]);_0x4d858d[_0x32a0('0x33')]=qs['filters'](_[_0x32a0('0x34')](_0xf36f79[_0x32a0('0x2d')],_0x51c721[_0x32a0('0x2e')]));if(_0xf36f79[_0x32a0('0x2d')][_0x32a0('0x35')]){_0x4d858d[_0x32a0('0x33')]=_[_0x32a0('0x36')](_0x4d858d[_0x32a0('0x33')],{'$or':_[_0x32a0('0x37')](_0x50d94d,function(_0x45c21d){if(_0x45c21d[_0x32a0('0x38')][_0x32a0('0x39')]!==_0x32a0('0x3a')){var _0x58d525={};_0x58d525[_0x45c21d[_0x32a0('0x3b')]]={'$like':'%'+_0xf36f79[_0x32a0('0x2d')][_0x32a0('0x35')]+'%'};return _0x58d525;}})});}_0x4d858d=_[_0x32a0('0x36')]({},_0x4d858d,_0xf36f79[_0x32a0('0x3c')]);var _0x514e02={'where':_0x4d858d[_0x32a0('0x33')]};return db['SmsQueueReport']['count'](_0x514e02)['then'](function(_0x29bce7){_0x1f344c[_0x32a0('0x1c')]=_0x29bce7;if(_0xf36f79[_0x32a0('0x2d')]['includeAll']){_0x4d858d[_0x32a0('0x3d')]=[{'all':!![]}];}return db[_0x32a0('0x2a')][_0x32a0('0x3e')](_0x4d858d);})[_0x32a0('0x24')](function(_0x4326b8){_0x1f344c[_0x32a0('0x3f')]=_0x4326b8;return _0x1f344c;})[_0x32a0('0x24')](respondWithFilteredResult(_0x1bb5e9,_0x4d858d))[_0x32a0('0x40')](handleError(_0x1bb5e9,null));};exports[_0x32a0('0x41')]=function(_0x648f38,_0x32361c){var _0x120fa4={'raw':!![],'where':{'id':_0x648f38[_0x32a0('0x42')]['id']}},_0xdf5ef7={};_0xdf5ef7[_0x32a0('0x2b')]=_[_0x32a0('0x2c')](db['SmsQueueReport'][_0x32a0('0x43')]);_0xdf5ef7[_0x32a0('0x2d')]=_[_0x32a0('0x2c')](_0x648f38['query']);_0xdf5ef7[_0x32a0('0x2e')]=_[_0x32a0('0x2f')](_0xdf5ef7['model'],_0xdf5ef7[_0x32a0('0x2d')]);_0x120fa4[_0x32a0('0x30')]=_[_0x32a0('0x2f')](_0xdf5ef7[_0x32a0('0x2b')],qs[_0x32a0('0x44')](_0x648f38[_0x32a0('0x2d')][_0x32a0('0x44')]));_0x120fa4['attributes']=_0x120fa4['attributes']['length']?_0x120fa4[_0x32a0('0x30')]:_0xdf5ef7[_0x32a0('0x2b')];if(_0x648f38[_0x32a0('0x2d')][_0x32a0('0x45')]){_0x120fa4[_0x32a0('0x3d')]=[{'all':!![]}];}_0x120fa4=_[_0x32a0('0x36')]({},_0x120fa4,_0x648f38[_0x32a0('0x3c')]);return db['SmsQueueReport']['find'](_0x120fa4)[_0x32a0('0x24')](handleEntityNotFound(_0x32361c,null))[_0x32a0('0x24')](respondWithResult(_0x32361c,null))[_0x32a0('0x40')](handleError(_0x32361c,null));};exports['create']=function(_0x5a5254,_0x41ef43){return db['SmsQueueReport'][_0x32a0('0x46')](_0x5a5254[_0x32a0('0x47')],{})[_0x32a0('0x24')](respondWithResult(_0x41ef43,0xc9))[_0x32a0('0x40')](handleError(_0x41ef43,null));};exports['update']=function(_0x1de45e,_0x4aaa60){if(_0x1de45e['body']['id']){delete _0x1de45e[_0x32a0('0x47')]['id'];}return db[_0x32a0('0x2a')][_0x32a0('0x48')]({'where':{'id':_0x1de45e['params']['id']}})[_0x32a0('0x24')](handleEntityNotFound(_0x4aaa60,null))[_0x32a0('0x24')](saveUpdates(_0x1de45e[_0x32a0('0x47')],null))[_0x32a0('0x24')](respondWithResult(_0x4aaa60,null))['catch'](handleError(_0x4aaa60,null));};exports[_0x32a0('0x49')]=function(_0x4f0a53,_0x364374){return db['SmsQueueReport']['find']({'where':{'id':_0x4f0a53[_0x32a0('0x42')]['id']}})['then'](handleEntityNotFound(_0x364374,null))[_0x32a0('0x24')](removeEntity(_0x364374,null))['catch'](handleError(_0x364374,null));};exports[_0x32a0('0x4a')]=function(_0xfd0234,_0x500f08){return db[_0x32a0('0x2a')][_0x32a0('0x4a')]()['then'](respondWithResult(_0x500f08,null))[_0x32a0('0x40')](handleError(_0x500f08,null));}; \ No newline at end of file +var _0x1adb=['name','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','SmsQueueReport','findAll','catch','params','filters','create','body','find','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack'];(function(_0x1a209a,_0x27b9ba){var _0x3cc784=function(_0x113dcf){while(--_0x113dcf){_0x1a209a['push'](_0x1a209a['shift']());}};_0x3cc784(++_0x27b9ba);}(_0x1adb,0x1ea));var _0xb1ad=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1adb[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb1ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1ad('0x1'));var rp=require(_0xb1ad('0x2'));var moment=require('moment');var BPromise=require(_0xb1ad('0x3'));var Mustache=require(_0xb1ad('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb1ad('0x5'));var fs=require('fs');var _=require(_0xb1ad('0x6'));var squel=require(_0xb1ad('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1ad('0x8'));var querystring=require(_0xb1ad('0x9'));var Papa=require(_0xb1ad('0xa'));var Redis=require(_0xb1ad('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb1ad('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1ad('0xd'))('api');var utils=require(_0xb1ad('0xe'));var config=require('../../config/environment');var db=require(_0xb1ad('0xf'))['db'];function respondWithStatusCode(_0x134349,_0x5c6ba9){_0x5c6ba9=_0x5c6ba9||0xcc;return function(_0x3d2373){if(_0x3d2373){return _0x134349['sendStatus'](_0x5c6ba9);}return _0x134349[_0xb1ad('0x10')](_0x5c6ba9)[_0xb1ad('0x11')]();};}function respondWithResult(_0x8cde7b,_0x40ab6f){_0x40ab6f=_0x40ab6f||0xc8;return function(_0x393abf){if(_0x393abf){return _0x8cde7b[_0xb1ad('0x10')](_0x40ab6f)[_0xb1ad('0x12')](_0x393abf);}};}function respondWithFilteredResult(_0x309679,_0x45371c){return function(_0x4e7fd7){if(_0x4e7fd7){var _0xa9c863=_0x4e7fd7[_0xb1ad('0x13')],_0x1c59f8=_0x45371c[_0xb1ad('0x14')],_0x3ea8d4=_0x45371c[_0xb1ad('0x14')]+_0x45371c['limit'],_0x391bca;if(_0x3ea8d4>=_0xa9c863){_0x3ea8d4=_0xa9c863;_0x391bca=0xc8;}else{_0x391bca=0xce;}_0x309679[_0xb1ad('0x10')](_0x391bca);return _0x309679[_0xb1ad('0x15')](_0xb1ad('0x16'),_0x1c59f8+'-'+_0x3ea8d4+'/'+_0xa9c863)['json'](_0x4e7fd7);}return null;};}function patchUpdates(_0x343374){return function(_0x448aba){try{jsonpatch[_0xb1ad('0x17')](_0x448aba,_0x343374,!![]);}catch(_0xaeb0c1){return BPromise['reject'](_0xaeb0c1);}return _0x448aba[_0xb1ad('0x18')]();};}function saveUpdates(_0x89f90d,_0x57442a){return function(_0x1bfe06){if(_0x1bfe06){return _0x1bfe06[_0xb1ad('0x19')](_0x89f90d)[_0xb1ad('0x1a')](function(_0x464fcf){return _0x464fcf;});}return null;};}function removeEntity(_0x3a8d4e,_0x2ee247){return function(_0xc22ff8){if(_0xc22ff8){return _0xc22ff8[_0xb1ad('0x1b')]()[_0xb1ad('0x1a')](function(){_0x3a8d4e[_0xb1ad('0x10')](0xcc)[_0xb1ad('0x11')]();});}};}function handleEntityNotFound(_0x4dad2e,_0x45a85d){return function(_0x16d5d0){if(!_0x16d5d0){_0x4dad2e[_0xb1ad('0x1c')](0x194);}return _0x16d5d0;};}function handleError(_0x113282,_0x57e4fe){_0x57e4fe=_0x57e4fe||0x1f4;return function(_0x2a29f3){logger['error'](_0x2a29f3[_0xb1ad('0x1d')]);if(_0x2a29f3[_0xb1ad('0x1e')]){delete _0x2a29f3['name'];}_0x113282[_0xb1ad('0x10')](_0x57e4fe)['send'](_0x2a29f3);};}exports[_0xb1ad('0x1f')]=function(_0x26a381,_0x4d69b6){var _0x5efbd8={},_0x51ea34={},_0x20da97={'count':0x0,'rows':[]};var _0x548c4f=db['SmsQueueReport'][_0xb1ad('0x20')];_0x51ea34[_0xb1ad('0x21')]=_['keys'](_0x548c4f);_0x51ea34[_0xb1ad('0x22')]=_[_0xb1ad('0x23')](_0x26a381['query']);_0x51ea34['filters']=_[_0xb1ad('0x24')](_0x51ea34[_0xb1ad('0x21')],_0x51ea34[_0xb1ad('0x22')]);_0x5efbd8[_0xb1ad('0x25')]=_[_0xb1ad('0x24')](_0x51ea34[_0xb1ad('0x21')],qs[_0xb1ad('0x26')](_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x26')]));_0x5efbd8[_0xb1ad('0x25')]=_0x5efbd8[_0xb1ad('0x25')][_0xb1ad('0x27')]?_0x5efbd8[_0xb1ad('0x25')]:_0x51ea34[_0xb1ad('0x21')];if(!_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x28')](_0xb1ad('0x29'))){_0x5efbd8[_0xb1ad('0x2a')]=qs['limit'](_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x2a')]);_0x5efbd8[_0xb1ad('0x14')]=qs[_0xb1ad('0x14')](_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x14')]);}_0x5efbd8[_0xb1ad('0x2b')]=qs[_0xb1ad('0x2c')](_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x2c')]);_0x5efbd8['where']=qs['filters'](_['pick'](_0x26a381[_0xb1ad('0x22')],_0x51ea34['filters']));if(_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x2d')]){_0x5efbd8['where']=_[_0xb1ad('0x2e')](_0x5efbd8[_0xb1ad('0x2f')],{'$or':_[_0xb1ad('0x30')](_0x548c4f,function(_0xe10524){if(_0xe10524[_0xb1ad('0x31')][_0xb1ad('0x32')]!==_0xb1ad('0x33')){var _0x13736a={};_0x13736a[_0xe10524[_0xb1ad('0x34')]]={'$like':'%'+_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x2d')]+'%'};return _0x13736a;}})});}_0x5efbd8=_['merge']({},_0x5efbd8,_0x26a381[_0xb1ad('0x35')]);var _0x1f7a69={'where':_0x5efbd8[_0xb1ad('0x2f')]};return db['SmsQueueReport'][_0xb1ad('0x13')](_0x1f7a69)[_0xb1ad('0x1a')](function(_0xdc6916){_0x20da97['count']=_0xdc6916;if(_0x26a381[_0xb1ad('0x22')][_0xb1ad('0x36')]){_0x5efbd8[_0xb1ad('0x37')]=[{'all':!![]}];}return db[_0xb1ad('0x38')][_0xb1ad('0x39')](_0x5efbd8);})[_0xb1ad('0x1a')](function(_0x204322){_0x20da97['rows']=_0x204322;return _0x20da97;})[_0xb1ad('0x1a')](respondWithFilteredResult(_0x4d69b6,_0x5efbd8))[_0xb1ad('0x3a')](handleError(_0x4d69b6,null));};exports['show']=function(_0x59e332,_0x5ddfa3){var _0x271873={'raw':!![],'where':{'id':_0x59e332[_0xb1ad('0x3b')]['id']}},_0x1ada6f={};_0x1ada6f[_0xb1ad('0x21')]=_[_0xb1ad('0x23')](db[_0xb1ad('0x38')][_0xb1ad('0x20')]);_0x1ada6f[_0xb1ad('0x22')]=_[_0xb1ad('0x23')](_0x59e332[_0xb1ad('0x22')]);_0x1ada6f[_0xb1ad('0x3c')]=_['intersection'](_0x1ada6f[_0xb1ad('0x21')],_0x1ada6f[_0xb1ad('0x22')]);_0x271873[_0xb1ad('0x25')]=_[_0xb1ad('0x24')](_0x1ada6f[_0xb1ad('0x21')],qs['fields'](_0x59e332['query'][_0xb1ad('0x26')]));_0x271873[_0xb1ad('0x25')]=_0x271873[_0xb1ad('0x25')][_0xb1ad('0x27')]?_0x271873[_0xb1ad('0x25')]:_0x1ada6f['model'];if(_0x59e332[_0xb1ad('0x22')][_0xb1ad('0x36')]){_0x271873[_0xb1ad('0x37')]=[{'all':!![]}];}_0x271873=_['merge']({},_0x271873,_0x59e332[_0xb1ad('0x35')]);return db['SmsQueueReport']['find'](_0x271873)[_0xb1ad('0x1a')](handleEntityNotFound(_0x5ddfa3,null))[_0xb1ad('0x1a')](respondWithResult(_0x5ddfa3,null))[_0xb1ad('0x3a')](handleError(_0x5ddfa3,null));};exports[_0xb1ad('0x3d')]=function(_0x28b62e,_0x3b7b92){return db[_0xb1ad('0x38')][_0xb1ad('0x3d')](_0x28b62e['body'],{})[_0xb1ad('0x1a')](respondWithResult(_0x3b7b92,0xc9))[_0xb1ad('0x3a')](handleError(_0x3b7b92,null));};exports[_0xb1ad('0x19')]=function(_0xbe0472,_0xcdb35b){if(_0xbe0472[_0xb1ad('0x3e')]['id']){delete _0xbe0472[_0xb1ad('0x3e')]['id'];}return db[_0xb1ad('0x38')]['find']({'where':{'id':_0xbe0472[_0xb1ad('0x3b')]['id']}})[_0xb1ad('0x1a')](handleEntityNotFound(_0xcdb35b,null))[_0xb1ad('0x1a')](saveUpdates(_0xbe0472[_0xb1ad('0x3e')],null))[_0xb1ad('0x1a')](respondWithResult(_0xcdb35b,null))[_0xb1ad('0x3a')](handleError(_0xcdb35b,null));};exports[_0xb1ad('0x1b')]=function(_0x580f17,_0x564ac8){return db[_0xb1ad('0x38')][_0xb1ad('0x3f')]({'where':{'id':_0x580f17['params']['id']}})[_0xb1ad('0x1a')](handleEntityNotFound(_0x564ac8,null))['then'](removeEntity(_0x564ac8,null))['catch'](handleError(_0x564ac8,null));};exports['describe']=function(_0x2129fa,_0x2fdd91){return db[_0xb1ad('0x38')][_0xb1ad('0x40')]()[_0xb1ad('0x1a')](respondWithResult(_0x2fdd91,null))[_0xb1ad('0x3a')](handleError(_0x2fdd91,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3dbf2f6..d7d25ba 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 _0x5c5d=['./smsQueueReport.attributes','SmsQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x38b45e,_0x513671){var _0x5a1eb9=function(_0x900920){while(--_0x900920){_0x38b45e['push'](_0x38b45e['shift']());}};_0x5a1eb9(++_0x513671);}(_0x5c5d,0xb7));var _0xd5c5=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5c5d[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xd5c5('0x0'));var util=require(_0xd5c5('0x1'));var logger=require(_0xd5c5('0x2'))(_0xd5c5('0x3'));var moment=require(_0xd5c5('0x4'));var BPromise=require('bluebird');var rp=require(_0xd5c5('0x5'));var fs=require('fs');var path=require(_0xd5c5('0x6'));var rimraf=require(_0xd5c5('0x7'));var config=require(_0xd5c5('0x8'));var attributes=require(_0xd5c5('0x9'));module['exports']=function(_0x485566,_0x5694fa){return _0x485566['define'](_0xd5c5('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0xd5c5('0xb'),'fields':[_0xd5c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x645f=['request-promise','../../config/environment','./smsQueueReport.attributes','exports','SmsQueueReport','report_sms_queue','uniqueid','util','api','moment'];(function(_0x35fdd3,_0x44b3f7){var _0x1a5d99=function(_0xe2e1c2){while(--_0xe2e1c2){_0x35fdd3['push'](_0x35fdd3['shift']());}};_0x1a5d99(++_0x44b3f7);}(_0x645f,0xcf));var _0xf645=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x645f[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xf645('0x0'));var logger=require('../../config/logger')(_0xf645('0x1'));var moment=require(_0xf645('0x2'));var BPromise=require('bluebird');var rp=require(_0xf645('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf645('0x4'));var attributes=require(_0xf645('0x5'));module[_0xf645('0x6')]=function(_0xd2ab8d,_0x2ab281){return _0xd2ab8d['define'](_0xf645('0x7'),attributes,{'tableName':_0xf645('0x8'),'paranoid':![],'indexes':[{'name':_0xf645('0x9'),'fields':[_0xf645('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 96ef4d2..6298cf6 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 _0x9c07=['catch','UpdateSmsQueueReport','update','options','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x2a6147,_0x28c1ac){var _0xbc97a7=function(_0x4f4f1b){while(--_0x4f4f1b){_0x2a6147['push'](_0x2a6147['shift']());}};_0xbc97a7(++_0x28c1ac);}(_0x9c07,0x8b));var _0x79c0=function(_0x5263f2,_0x38a8d5){_0x5263f2=_0x5263f2-0x0;var _0x51c392=_0x9c07[_0x5263f2];return _0x51c392;};'use strict';var _=require(_0x79c0('0x0'));var util=require(_0x79c0('0x1'));var moment=require(_0x79c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x79c0('0x3'));var fs=require('fs');var Redis=require(_0x79c0('0x4'));var db=require(_0x79c0('0x5'))['db'];var utils=require(_0x79c0('0x6'));var logger=require(_0x79c0('0x7'))(_0x79c0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x79c0('0x9')][_0x79c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24bc41,_0x5261b2,_0x4b9795){return new BPromise(function(_0x123ebe,_0x25c8b5){return client[_0x79c0('0xb')](_0x24bc41,_0x4b9795)[_0x79c0('0xc')](function(_0x9febc4){logger[_0x79c0('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x5261b2,_0x79c0('0xe'));logger[_0x79c0('0xf')](_0x79c0('0x10'),_0x5261b2,_0x79c0('0xe'),JSON[_0x79c0('0x11')](_0x9febc4));if(_0x9febc4[_0x79c0('0x12')]){if(_0x9febc4[_0x79c0('0x12')][_0x79c0('0x13')]===0x1f4){logger[_0x79c0('0x12')](_0x79c0('0x14'),_0x5261b2,_0x9febc4[_0x79c0('0x12')][_0x79c0('0x15')]);return _0x25c8b5(_0x9febc4[_0x79c0('0x12')][_0x79c0('0x15')]);}logger[_0x79c0('0x12')](_0x79c0('0x14'),_0x5261b2,_0x9febc4['error']['message']);return _0x123ebe(_0x9febc4[_0x79c0('0x12')][_0x79c0('0x15')]);}else{logger[_0x79c0('0xd')](_0x79c0('0x14'),_0x5261b2,'request\x20sent');_0x123ebe(_0x9febc4['result']['message']);}})['catch'](function(_0x49e001){logger[_0x79c0('0x12')](_0x79c0('0x14'),_0x5261b2,_0x49e001);_0x25c8b5(_0x49e001);});});}exports[_0x79c0('0x16')]=function(_0xb3dc9e){var _0x2aae1a=this;return new Promise(function(_0x200279,_0x4a8cdc){return db[_0x79c0('0x17')][_0x79c0('0x18')](_0xb3dc9e[_0x79c0('0x19')],{'raw':_0xb3dc9e['options']?_0xb3dc9e['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xeebeda){logger[_0x79c0('0xd')](_0x79c0('0x16'),_0xb3dc9e);logger[_0x79c0('0xf')](_0x79c0('0x16'),_0xb3dc9e,JSON[_0x79c0('0x11')](_0xeebeda));_0x200279(_0xeebeda);})[_0x79c0('0x1a')](function(_0x48c57d){logger['error'](_0x79c0('0x16'),_0x48c57d[_0x79c0('0x15')],_0xb3dc9e);_0x4a8cdc(_0x2aae1a[_0x79c0('0x12')](0x1f4,_0x48c57d[_0x79c0('0x15')]));});});};exports[_0x79c0('0x1b')]=function(_0x36c1b4){var _0x37449f=this;return new Promise(function(_0x411630,_0x3dbaf6){return db['SmsQueueReport'][_0x79c0('0x1c')](_0x36c1b4[_0x79c0('0x19')],{'raw':_0x36c1b4[_0x79c0('0x1d')]?_0x36c1b4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36c1b4['options']?_0x36c1b4['options'][_0x79c0('0x1e')]||null:null,'attributes':_0x36c1b4[_0x79c0('0x1d')]?_0x36c1b4['options'][_0x79c0('0x1f')]||null:null,'limit':_0x36c1b4[_0x79c0('0x1d')]?_0x36c1b4[_0x79c0('0x1d')][_0x79c0('0x20')]||null:null})[_0x79c0('0xc')](function(_0x5f50a1){logger[_0x79c0('0xd')](_0x79c0('0x1b'),_0x36c1b4);logger[_0x79c0('0xf')]('UpdateSmsQueueReport',_0x36c1b4,JSON['stringify'](_0x5f50a1));_0x411630(_0x5f50a1);})[_0x79c0('0x1a')](function(_0x55691d){logger[_0x79c0('0x12')](_0x79c0('0x1b'),_0x55691d[_0x79c0('0x15')],_0x36c1b4);_0x3dbaf6(_0x37449f[_0x79c0('0x12')](0x1f4,_0x55691d[_0x79c0('0x15')]));});});}; \ No newline at end of file +var _0x1293=['raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','body','options','CreateSmsQueueReport','debug','UpdateSmsQueueReport','update'];(function(_0x232c43,_0x4df129){var _0xce6edd=function(_0x3f3f1a){while(--_0x3f3f1a){_0x232c43['push'](_0x232c43['shift']());}};_0xce6edd(++_0x4df129);}(_0x1293,0x1f3));var _0x3129=function(_0x1a120f,_0x3cdb84){_0x1a120f=_0x1a120f-0x0;var _0x41c79a=_0x1293[_0x1a120f];return _0x41c79a;};'use strict';var _=require(_0x3129('0x0'));var util=require(_0x3129('0x1'));var moment=require(_0x3129('0x2'));var BPromise=require(_0x3129('0x3'));var rs=require(_0x3129('0x4'));var fs=require('fs');var Redis=require(_0x3129('0x5'));var db=require(_0x3129('0x6'))['db'];var utils=require(_0x3129('0x7'));var logger=require(_0x3129('0x8'))(_0x3129('0x9'));var config=require('../../config/environment');var jayson=require(_0x3129('0xa'));var client=jayson['client'][_0x3129('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ad65a,_0x2f0f72,_0x4579b5){return new BPromise(function(_0x81ecef,_0x4c6afe){return client['request'](_0x2ad65a,_0x4579b5)[_0x3129('0xc')](function(_0x33612a){logger[_0x3129('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2f0f72,_0x3129('0xe'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2f0f72,_0x3129('0xe'),JSON[_0x3129('0xf')](_0x33612a));if(_0x33612a['error']){if(_0x33612a[_0x3129('0x10')]['code']===0x1f4){logger[_0x3129('0x10')](_0x3129('0x11'),_0x2f0f72,_0x33612a[_0x3129('0x10')][_0x3129('0x12')]);return _0x4c6afe(_0x33612a[_0x3129('0x10')][_0x3129('0x12')]);}logger[_0x3129('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x2f0f72,_0x33612a[_0x3129('0x10')][_0x3129('0x12')]);return _0x81ecef(_0x33612a[_0x3129('0x10')][_0x3129('0x12')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x2f0f72,_0x3129('0xe'));_0x81ecef(_0x33612a[_0x3129('0x13')][_0x3129('0x12')]);}})[_0x3129('0x14')](function(_0x4c95d1){logger[_0x3129('0x10')](_0x3129('0x11'),_0x2f0f72,_0x4c95d1);_0x4c6afe(_0x4c95d1);});});}exports['CreateSmsQueueReport']=function(_0x5546fb){var _0x1b73dd=this;return new Promise(function(_0x548b63,_0x2e13df){return db[_0x3129('0x15')]['create'](_0x5546fb[_0x3129('0x16')],{'raw':_0x5546fb['options']?_0x5546fb[_0x3129('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3129('0xc')](function(_0x35ea8f){logger[_0x3129('0xd')](_0x3129('0x18'),_0x5546fb);logger[_0x3129('0x19')](_0x3129('0x18'),_0x5546fb,JSON[_0x3129('0xf')](_0x35ea8f));_0x548b63(_0x35ea8f);})[_0x3129('0x14')](function(_0xbdeefb){logger[_0x3129('0x10')](_0x3129('0x18'),_0xbdeefb['message'],_0x5546fb);_0x2e13df(_0x1b73dd[_0x3129('0x10')](0x1f4,_0xbdeefb['message']));});});};exports[_0x3129('0x1a')]=function(_0x25e623){var _0x59b449=this;return new Promise(function(_0x243bec,_0x3fb504){return db[_0x3129('0x15')][_0x3129('0x1b')](_0x25e623['body'],{'raw':_0x25e623[_0x3129('0x17')]?_0x25e623[_0x3129('0x17')][_0x3129('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e623[_0x3129('0x17')]?_0x25e623[_0x3129('0x17')][_0x3129('0x1d')]||null:null,'attributes':_0x25e623[_0x3129('0x17')]?_0x25e623[_0x3129('0x17')]['attributes']||null:null,'limit':_0x25e623[_0x3129('0x17')]?_0x25e623[_0x3129('0x17')][_0x3129('0x1e')]||null:null})[_0x3129('0xc')](function(_0x23a708){logger[_0x3129('0xd')](_0x3129('0x1a'),_0x25e623);logger['debug'](_0x3129('0x1a'),_0x25e623,JSON[_0x3129('0xf')](_0x23a708));_0x243bec(_0x23a708);})[_0x3129('0x14')](function(_0x1e166f){logger[_0x3129('0x10')](_0x3129('0x1a'),_0x1e166f[_0x3129('0x12')],_0x25e623);_0x3fb504(_0x59b449['error'](0x1f4,_0x1e166f[_0x3129('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index aec71ec..0127e64 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 _0x5a71=['update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id'];(function(_0x2153fa,_0x183920){var _0x53ce89=function(_0x4a3eb0){while(--_0x4a3eb0){_0x2153fa['push'](_0x2153fa['shift']());}};_0x53ce89(++_0x183920);}(_0x5a71,0x8e));var _0x15a7=function(_0x565eae,_0x176003){_0x565eae=_0x565eae-0x0;var _0x38744d=_0x5a71[_0x565eae];return _0x38744d;};'use strict';var multer=require(_0x15a7('0x0'));var util=require(_0x15a7('0x1'));var path=require(_0x15a7('0x2'));var timeout=require(_0x15a7('0x3'));var express=require(_0x15a7('0x4'));var router=express[_0x15a7('0x5')]();var auth=require(_0x15a7('0x6'));var interaction=require(_0x15a7('0x7'));var config=require(_0x15a7('0x8'));var controller=require('./smsTransferReport.controller');router[_0x15a7('0x9')]('/',auth[_0x15a7('0xa')](),controller[_0x15a7('0xb')]);router['get'](_0x15a7('0xc'),auth[_0x15a7('0xa')](),controller[_0x15a7('0xd')]);router[_0x15a7('0x9')]('/:id',auth[_0x15a7('0xa')](),controller[_0x15a7('0xe')]);router['post']('/',auth[_0x15a7('0xa')](),controller[_0x15a7('0xf')]);router[_0x15a7('0x10')](_0x15a7('0x11'),auth[_0x15a7('0xa')](),controller[_0x15a7('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x15a7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0e99=['get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/describe','describe'];(function(_0x10b6ae,_0x56a559){var _0x1321e9=function(_0x9b0eb2){while(--_0x9b0eb2){_0x10b6ae['push'](_0x10b6ae['shift']());}};_0x1321e9(++_0x56a559);}(_0x0e99,0x172));var _0x90e9=function(_0x59bd3b,_0x53eff9){_0x59bd3b=_0x59bd3b-0x0;var _0x586c53=_0x0e99[_0x59bd3b];return _0x586c53;};'use strict';var multer=require(_0x90e9('0x0'));var util=require(_0x90e9('0x1'));var path=require(_0x90e9('0x2'));var timeout=require('connect-timeout');var express=require(_0x90e9('0x3'));var router=express[_0x90e9('0x4')]();var auth=require(_0x90e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x90e9('0x6'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x90e9('0x7')](),controller['index']);router['get'](_0x90e9('0x8'),auth['isAuthenticated'](),controller[_0x90e9('0x9')]);router[_0x90e9('0xa')](_0x90e9('0xb'),auth[_0x90e9('0x7')](),controller[_0x90e9('0xc')]);router[_0x90e9('0xd')]('/',auth[_0x90e9('0x7')](),controller[_0x90e9('0xe')]);router[_0x90e9('0xf')](_0x90e9('0xb'),auth[_0x90e9('0x7')](),controller[_0x90e9('0x10')]);router['delete']('/:id',auth[_0x90e9('0x7')](),controller[_0x90e9('0x11')]);module[_0x90e9('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 840bf6a..550275b 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 _0xfd3e=['account','queue','DATE','NOW','moment','STRING','ENUM'];(function(_0x5ac42d,_0x32e66d){var _0x382d90=function(_0x37b22d){while(--_0x37b22d){_0x5ac42d['push'](_0x5ac42d['shift']());}};_0x382d90(++_0x32e66d);}(_0xfd3e,0x11c));var _0xefd3=function(_0x52bcdd,_0x4b218e){_0x52bcdd=_0x52bcdd-0x0;var _0x5a1985=_0xfd3e[_0x52bcdd];return _0x5a1985;};'use strict';var moment=require(_0xefd3('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xefd3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xefd3('0x2')](_0xefd3('0x3'),'agent',_0xefd3('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xefd3('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xefd3('0x6')]}}; \ No newline at end of file +var _0x221d=['queue','DATE','NOW','moment','sequelize','exports','ENUM','account','agent'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x221d,0xe4));var _0xd221=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x221d[_0x2cde0a];return _0x260610;};'use strict';var moment=require(_0xd221('0x0'));var Sequelize=require(_0xd221('0x1'));module[_0xd221('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd221('0x3')](_0xd221('0x4'),_0xd221('0x5'),_0xd221('0x6')),'allowNull':![],'defaultValue':_0xd221('0x6')},'transferredAt':{'type':Sequelize[_0xd221('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xd221('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 19a0bdf..3cfb558 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 _0x24ca=['bluebird','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','zip-dir','request-promise','moment'];(function(_0x3b567d,_0xbb094a){var _0xa0382=function(_0x3b2fbd){while(--_0x3b2fbd){_0x3b567d['push'](_0x3b567d['shift']());}};_0xa0382(++_0xbb094a);}(_0x24ca,0x8c));var _0xa24c=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x24ca[_0x118653];return _0xc11fa6;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require(_0xa24c('0x4'));var Mustache=require('mustache');var util=require(_0xa24c('0x5'));var path=require(_0xa24c('0x6'));var sox=require(_0xa24c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0xc'));var querystring=require(_0xa24c('0xd'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xe'));var authService=require(_0xa24c('0xf'));var qs=require(_0xa24c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var db=require(_0xa24c('0x14'))['db'];function respondWithStatusCode(_0xbaf0be,_0x1d06da){_0x1d06da=_0x1d06da||0xcc;return function(_0x566313){if(_0x566313){return _0xbaf0be['sendStatus'](_0x1d06da);}return _0xbaf0be['status'](_0x1d06da)[_0xa24c('0x15')]();};}function respondWithResult(_0x23bd58,_0x337c8a){_0x337c8a=_0x337c8a||0xc8;return function(_0x9fe9e3){if(_0x9fe9e3){return _0x23bd58[_0xa24c('0x16')](_0x337c8a)['json'](_0x9fe9e3);}};}function respondWithFilteredResult(_0x13076d,_0x488a78){return function(_0x493bcb){if(_0x493bcb){var _0x588acf=_0x493bcb[_0xa24c('0x17')],_0x2e8dc9=_0x488a78[_0xa24c('0x18')],_0x2a4270=_0x488a78[_0xa24c('0x18')]+_0x488a78[_0xa24c('0x19')],_0x3f762e;if(_0x2a4270>=_0x588acf){_0x2a4270=_0x588acf;_0x3f762e=0xc8;}else{_0x3f762e=0xce;}_0x13076d[_0xa24c('0x16')](_0x3f762e);return _0x13076d[_0xa24c('0x1a')](_0xa24c('0x1b'),_0x2e8dc9+'-'+_0x2a4270+'/'+_0x588acf)[_0xa24c('0x1c')](_0x493bcb);}return null;};}function patchUpdates(_0x1a667b){return function(_0x278cce){try{jsonpatch[_0xa24c('0x1d')](_0x278cce,_0x1a667b,!![]);}catch(_0x5276b6){return BPromise[_0xa24c('0x1e')](_0x5276b6);}return _0x278cce['save']();};}function saveUpdates(_0x98802d,_0xf9f8bd){return function(_0x8c3949){if(_0x8c3949){return _0x8c3949[_0xa24c('0x1f')](_0x98802d)[_0xa24c('0x20')](function(_0x416dea){return _0x416dea;});}return null;};}function removeEntity(_0x38dfdc,_0x432c15){return function(_0xba710){if(_0xba710){return _0xba710[_0xa24c('0x21')]()[_0xa24c('0x20')](function(){_0x38dfdc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fa25,_0xdd32a8){return function(_0x316a68){if(!_0x316a68){_0x10fa25[_0xa24c('0x22')](0x194);}return _0x316a68;};}function handleError(_0x375c83,_0xfb13c0){_0xfb13c0=_0xfb13c0||0x1f4;return function(_0x16bd20){logger[_0xa24c('0x23')](_0x16bd20[_0xa24c('0x24')]);if(_0x16bd20['name']){delete _0x16bd20[_0xa24c('0x25')];}_0x375c83['status'](_0xfb13c0)[_0xa24c('0x26')](_0x16bd20);};}exports[_0xa24c('0x27')]=function(_0x471421,_0x1a0769){var _0x54b8a6={},_0x58ff62={},_0x4c86c6={'count':0x0,'rows':[]};var _0x4e5d2c=db[_0xa24c('0x28')][_0xa24c('0x29')];_0x58ff62[_0xa24c('0x2a')]=_[_0xa24c('0x2b')](_0x4e5d2c);_0x58ff62[_0xa24c('0x2c')]=_['keys'](_0x471421['query']);_0x58ff62[_0xa24c('0x2d')]=_[_0xa24c('0x2e')](_0x58ff62[_0xa24c('0x2a')],_0x58ff62[_0xa24c('0x2c')]);_0x54b8a6[_0xa24c('0x2f')]=_[_0xa24c('0x2e')](_0x58ff62[_0xa24c('0x2a')],qs[_0xa24c('0x30')](_0x471421[_0xa24c('0x2c')][_0xa24c('0x30')]));_0x54b8a6['attributes']=_0x54b8a6[_0xa24c('0x2f')][_0xa24c('0x31')]?_0x54b8a6['attributes']:_0x58ff62[_0xa24c('0x2a')];if(!_0x471421[_0xa24c('0x2c')][_0xa24c('0x32')](_0xa24c('0x33'))){_0x54b8a6[_0xa24c('0x19')]=qs[_0xa24c('0x19')](_0x471421[_0xa24c('0x2c')][_0xa24c('0x19')]);_0x54b8a6[_0xa24c('0x18')]=qs[_0xa24c('0x18')](_0x471421['query']['offset']);}_0x54b8a6['order']=qs[_0xa24c('0x34')](_0x471421['query'][_0xa24c('0x34')]);_0x54b8a6[_0xa24c('0x35')]=qs[_0xa24c('0x2d')](_['pick'](_0x471421[_0xa24c('0x2c')],_0x58ff62[_0xa24c('0x2d')]));if(_0x471421[_0xa24c('0x2c')]['filter']){_0x54b8a6[_0xa24c('0x35')]=_[_0xa24c('0x36')](_0x54b8a6['where'],{'$or':_[_0xa24c('0x37')](_0x4e5d2c,function(_0x22fd0f){if(_0x22fd0f[_0xa24c('0x38')]['key']!==_0xa24c('0x39')){var _0x2c63da={};_0x2c63da[_0x22fd0f[_0xa24c('0x3a')]]={'$like':'%'+_0x471421[_0xa24c('0x2c')][_0xa24c('0x3b')]+'%'};return _0x2c63da;}})});}_0x54b8a6=_['merge']({},_0x54b8a6,_0x471421[_0xa24c('0x3c')]);var _0x29d1d0={'where':_0x54b8a6['where']};return db[_0xa24c('0x28')][_0xa24c('0x17')](_0x29d1d0)[_0xa24c('0x20')](function(_0x56fc29){_0x4c86c6['count']=_0x56fc29;if(_0x471421[_0xa24c('0x2c')][_0xa24c('0x3d')]){_0x54b8a6[_0xa24c('0x3e')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x3f')](_0x54b8a6);})[_0xa24c('0x20')](function(_0x54ea40){_0x4c86c6[_0xa24c('0x40')]=_0x54ea40;return _0x4c86c6;})[_0xa24c('0x20')](respondWithFilteredResult(_0x1a0769,_0x54b8a6))[_0xa24c('0x41')](handleError(_0x1a0769,null));};exports[_0xa24c('0x42')]=function(_0x5f3cd4,_0x34026c){var _0x190dfc={'raw':!![],'where':{'id':_0x5f3cd4[_0xa24c('0x43')]['id']}},_0x20390c={};_0x20390c[_0xa24c('0x2a')]=_[_0xa24c('0x2b')](db[_0xa24c('0x28')]['rawAttributes']);_0x20390c['query']=_[_0xa24c('0x2b')](_0x5f3cd4['query']);_0x20390c[_0xa24c('0x2d')]=_['intersection'](_0x20390c[_0xa24c('0x2a')],_0x20390c[_0xa24c('0x2c')]);_0x190dfc[_0xa24c('0x2f')]=_[_0xa24c('0x2e')](_0x20390c[_0xa24c('0x2a')],qs[_0xa24c('0x30')](_0x5f3cd4[_0xa24c('0x2c')][_0xa24c('0x30')]));_0x190dfc[_0xa24c('0x2f')]=_0x190dfc[_0xa24c('0x2f')][_0xa24c('0x31')]?_0x190dfc[_0xa24c('0x2f')]:_0x20390c[_0xa24c('0x2a')];if(_0x5f3cd4[_0xa24c('0x2c')][_0xa24c('0x3d')]){_0x190dfc[_0xa24c('0x3e')]=[{'all':!![]}];}_0x190dfc=_['merge']({},_0x190dfc,_0x5f3cd4[_0xa24c('0x3c')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x190dfc)['then'](handleEntityNotFound(_0x34026c,null))[_0xa24c('0x20')](respondWithResult(_0x34026c,null))[_0xa24c('0x41')](handleError(_0x34026c,null));};exports[_0xa24c('0x45')]=function(_0x3bba45,_0x4d8b8e){return db[_0xa24c('0x28')][_0xa24c('0x45')](_0x3bba45[_0xa24c('0x46')],{})[_0xa24c('0x20')](respondWithResult(_0x4d8b8e,0xc9))[_0xa24c('0x41')](handleError(_0x4d8b8e,null));};exports[_0xa24c('0x1f')]=function(_0x3a72ea,_0x11580f){if(_0x3a72ea[_0xa24c('0x46')]['id']){delete _0x3a72ea[_0xa24c('0x46')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x3a72ea[_0xa24c('0x43')]['id']}})['then'](handleEntityNotFound(_0x11580f,null))[_0xa24c('0x20')](saveUpdates(_0x3a72ea['body'],null))[_0xa24c('0x20')](respondWithResult(_0x11580f,null))[_0xa24c('0x41')](handleError(_0x11580f,null));};exports[_0xa24c('0x21')]=function(_0x1641b8,_0xd4761e){return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x43')]['id']}})[_0xa24c('0x20')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x20')](removeEntity(_0xd4761e,null))[_0xa24c('0x41')](handleError(_0xd4761e,null));};exports[_0xa24c('0x47')]=function(_0x14c813,_0x5974b3){return db[_0xa24c('0x28')][_0xa24c('0x47')]()[_0xa24c('0x20')](respondWithResult(_0x5974b3,null))[_0xa24c('0x41')](handleError(_0x5974b3,null));}; \ No newline at end of file +var _0xcca7=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','attributes','intersection','fields','length','nolimit','sort','filters','pick','filter','where','map','type','VIRTUAL','field','options','SmsTransferReport','count','findAll','rows','catch','show','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache'];(function(_0x2f77d6,_0x815a1d){var _0x5bf9eb=function(_0xb05bb5){while(--_0xb05bb5){_0x2f77d6['push'](_0x2f77d6['shift']());}};_0x5bf9eb(++_0x815a1d);}(_0xcca7,0x1aa));var _0x7cca=function(_0x2a853b,_0x5042d3){_0x2a853b=_0x2a853b-0x0;var _0x351187=_0xcca7[_0x2a853b];return _0x351187;};'use strict';var pdf=require(_0x7cca('0x0'));var emlformat=require(_0x7cca('0x1'));var rimraf=require(_0x7cca('0x2'));var zipdir=require(_0x7cca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7cca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7cca('0x5'));var util=require(_0x7cca('0x6'));var path=require(_0x7cca('0x7'));var sox=require(_0x7cca('0x8'));var csv=require(_0x7cca('0x9'));var ejs=require(_0x7cca('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cca('0xb'));var jsforce=require(_0x7cca('0xc'));var deskjs=require(_0x7cca('0xd'));var toCsv=require(_0x7cca('0x9'));var querystring=require(_0x7cca('0xe'));var Papa=require(_0x7cca('0xf'));var Redis=require(_0x7cca('0x10'));var authService=require(_0x7cca('0x11'));var qs=require(_0x7cca('0x12'));var hardwareService=require(_0x7cca('0x13'));var logger=require('../../config/logger')(_0x7cca('0x14'));var utils=require(_0x7cca('0x15'));var config=require(_0x7cca('0x16'));var db=require(_0x7cca('0x17'))['db'];function respondWithStatusCode(_0x25a65a,_0x4b7b66){_0x4b7b66=_0x4b7b66||0xcc;return function(_0x2a14cc){if(_0x2a14cc){return _0x25a65a[_0x7cca('0x18')](_0x4b7b66);}return _0x25a65a[_0x7cca('0x19')](_0x4b7b66)['end']();};}function respondWithResult(_0x54e492,_0x8ea157){_0x8ea157=_0x8ea157||0xc8;return function(_0x20c1b2){if(_0x20c1b2){return _0x54e492[_0x7cca('0x19')](_0x8ea157)[_0x7cca('0x1a')](_0x20c1b2);}};}function respondWithFilteredResult(_0x444465,_0x3d3141){return function(_0x45143d){if(_0x45143d){var _0x5a357d=_0x45143d['count'],_0x216d4b=_0x3d3141[_0x7cca('0x1b')],_0x533608=_0x3d3141[_0x7cca('0x1b')]+_0x3d3141[_0x7cca('0x1c')],_0x5cd551;if(_0x533608>=_0x5a357d){_0x533608=_0x5a357d;_0x5cd551=0xc8;}else{_0x5cd551=0xce;}_0x444465[_0x7cca('0x19')](_0x5cd551);return _0x444465[_0x7cca('0x1d')]('Content-Range',_0x216d4b+'-'+_0x533608+'/'+_0x5a357d)[_0x7cca('0x1a')](_0x45143d);}return null;};}function patchUpdates(_0x4fba9e){return function(_0x5d47f8){try{jsonpatch['apply'](_0x5d47f8,_0x4fba9e,!![]);}catch(_0x370469){return BPromise[_0x7cca('0x1e')](_0x370469);}return _0x5d47f8[_0x7cca('0x1f')]();};}function saveUpdates(_0x1a20be,_0x36ba41){return function(_0x45db2f){if(_0x45db2f){return _0x45db2f[_0x7cca('0x20')](_0x1a20be)[_0x7cca('0x21')](function(_0x4d7804){return _0x4d7804;});}return null;};}function removeEntity(_0x31baf4,_0x3154b0){return function(_0x165d13){if(_0x165d13){return _0x165d13[_0x7cca('0x22')]()['then'](function(){_0x31baf4[_0x7cca('0x19')](0xcc)[_0x7cca('0x23')]();});}};}function handleEntityNotFound(_0x4367f9,_0x119d76){return function(_0x823d7d){if(!_0x823d7d){_0x4367f9[_0x7cca('0x18')](0x194);}return _0x823d7d;};}function handleError(_0x1bf169,_0xaf9264){_0xaf9264=_0xaf9264||0x1f4;return function(_0x4b99b6){logger[_0x7cca('0x24')](_0x4b99b6[_0x7cca('0x25')]);if(_0x4b99b6[_0x7cca('0x26')]){delete _0x4b99b6[_0x7cca('0x26')];}_0x1bf169[_0x7cca('0x19')](_0xaf9264)[_0x7cca('0x27')](_0x4b99b6);};}exports[_0x7cca('0x28')]=function(_0x40ac86,_0x583846){var _0x2cafe1={},_0x5c8410={},_0xc86c1b={'count':0x0,'rows':[]};var _0x201fbb=db['SmsTransferReport'][_0x7cca('0x29')];_0x5c8410[_0x7cca('0x2a')]=_['keys'](_0x201fbb);_0x5c8410[_0x7cca('0x2b')]=_[_0x7cca('0x2c')](_0x40ac86[_0x7cca('0x2b')]);_0x5c8410['filters']=_['intersection'](_0x5c8410[_0x7cca('0x2a')],_0x5c8410[_0x7cca('0x2b')]);_0x2cafe1[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0x5c8410[_0x7cca('0x2a')],qs[_0x7cca('0x2f')](_0x40ac86[_0x7cca('0x2b')]['fields']));_0x2cafe1['attributes']=_0x2cafe1[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x2cafe1[_0x7cca('0x2d')]:_0x5c8410['model'];if(!_0x40ac86[_0x7cca('0x2b')]['hasOwnProperty'](_0x7cca('0x31'))){_0x2cafe1[_0x7cca('0x1c')]=qs[_0x7cca('0x1c')](_0x40ac86[_0x7cca('0x2b')]['limit']);_0x2cafe1[_0x7cca('0x1b')]=qs[_0x7cca('0x1b')](_0x40ac86[_0x7cca('0x2b')]['offset']);}_0x2cafe1['order']=qs['sort'](_0x40ac86[_0x7cca('0x2b')][_0x7cca('0x32')]);_0x2cafe1['where']=qs[_0x7cca('0x33')](_[_0x7cca('0x34')](_0x40ac86[_0x7cca('0x2b')],_0x5c8410[_0x7cca('0x33')]));if(_0x40ac86[_0x7cca('0x2b')][_0x7cca('0x35')]){_0x2cafe1[_0x7cca('0x36')]=_['merge'](_0x2cafe1[_0x7cca('0x36')],{'$or':_[_0x7cca('0x37')](_0x201fbb,function(_0x4128e5){if(_0x4128e5[_0x7cca('0x38')]['key']!==_0x7cca('0x39')){var _0x387287={};_0x387287[_0x4128e5[_0x7cca('0x3a')]]={'$like':'%'+_0x40ac86['query'][_0x7cca('0x35')]+'%'};return _0x387287;}})});}_0x2cafe1=_['merge']({},_0x2cafe1,_0x40ac86[_0x7cca('0x3b')]);var _0x2d8884={'where':_0x2cafe1[_0x7cca('0x36')]};return db[_0x7cca('0x3c')][_0x7cca('0x3d')](_0x2d8884)[_0x7cca('0x21')](function(_0x18076e){_0xc86c1b[_0x7cca('0x3d')]=_0x18076e;if(_0x40ac86[_0x7cca('0x2b')]['includeAll']){_0x2cafe1['include']=[{'all':!![]}];}return db[_0x7cca('0x3c')][_0x7cca('0x3e')](_0x2cafe1);})['then'](function(_0x48d87f){_0xc86c1b[_0x7cca('0x3f')]=_0x48d87f;return _0xc86c1b;})[_0x7cca('0x21')](respondWithFilteredResult(_0x583846,_0x2cafe1))[_0x7cca('0x40')](handleError(_0x583846,null));};exports[_0x7cca('0x41')]=function(_0x371c67,_0x4cd159){var _0x117bd7={'raw':!![],'where':{'id':_0x371c67['params']['id']}},_0x5ee9e7={};_0x5ee9e7[_0x7cca('0x2a')]=_[_0x7cca('0x2c')](db['SmsTransferReport'][_0x7cca('0x29')]);_0x5ee9e7['query']=_[_0x7cca('0x2c')](_0x371c67[_0x7cca('0x2b')]);_0x5ee9e7[_0x7cca('0x33')]=_['intersection'](_0x5ee9e7[_0x7cca('0x2a')],_0x5ee9e7[_0x7cca('0x2b')]);_0x117bd7[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0x5ee9e7['model'],qs[_0x7cca('0x2f')](_0x371c67[_0x7cca('0x2b')][_0x7cca('0x2f')]));_0x117bd7[_0x7cca('0x2d')]=_0x117bd7[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x117bd7['attributes']:_0x5ee9e7['model'];if(_0x371c67['query']['includeAll']){_0x117bd7[_0x7cca('0x42')]=[{'all':!![]}];}_0x117bd7=_['merge']({},_0x117bd7,_0x371c67['options']);return db[_0x7cca('0x3c')][_0x7cca('0x43')](_0x117bd7)[_0x7cca('0x21')](handleEntityNotFound(_0x4cd159,null))[_0x7cca('0x21')](respondWithResult(_0x4cd159,null))[_0x7cca('0x40')](handleError(_0x4cd159,null));};exports['create']=function(_0x2439b1,_0x345182){return db[_0x7cca('0x3c')][_0x7cca('0x44')](_0x2439b1[_0x7cca('0x45')],{})[_0x7cca('0x21')](respondWithResult(_0x345182,0xc9))[_0x7cca('0x40')](handleError(_0x345182,null));};exports[_0x7cca('0x20')]=function(_0x20458d,_0x1e9a9a){if(_0x20458d[_0x7cca('0x45')]['id']){delete _0x20458d['body']['id'];}return db['SmsTransferReport'][_0x7cca('0x43')]({'where':{'id':_0x20458d[_0x7cca('0x46')]['id']}})[_0x7cca('0x21')](handleEntityNotFound(_0x1e9a9a,null))[_0x7cca('0x21')](saveUpdates(_0x20458d[_0x7cca('0x45')],null))[_0x7cca('0x21')](respondWithResult(_0x1e9a9a,null))[_0x7cca('0x40')](handleError(_0x1e9a9a,null));};exports[_0x7cca('0x22')]=function(_0x184b56,_0xe0059e){return db[_0x7cca('0x3c')][_0x7cca('0x43')]({'where':{'id':_0x184b56['params']['id']}})[_0x7cca('0x21')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x21')](removeEntity(_0xe0059e,null))[_0x7cca('0x40')](handleError(_0xe0059e,null));};exports[_0x7cca('0x47')]=function(_0x182ee5,_0x41b932){return db[_0x7cca('0x3c')][_0x7cca('0x47')]()[_0x7cca('0x21')](respondWithResult(_0x41b932,null))[_0x7cca('0x40')](handleError(_0x41b932,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 65ddabb..5f32d23 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 _0xd124=['../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x23a673,_0x31e4bc){var _0x2213b7=function(_0x3c5dcc){while(--_0x3c5dcc){_0x23a673['push'](_0x23a673['shift']());}};_0x2213b7(++_0x31e4bc);}(_0xd124,0x126));var _0x4d12=function(_0x1cc0a9,_0x42e77b){_0x1cc0a9=_0x1cc0a9-0x0;var _0x32e4f0=_0xd124[_0x1cc0a9];return _0x32e4f0;};'use strict';var _=require(_0x4d12('0x0'));var util=require(_0x4d12('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4d12('0x2'));var rp=require(_0x4d12('0x3'));var fs=require('fs');var path=require(_0x4d12('0x4'));var rimraf=require(_0x4d12('0x5'));var config=require(_0x4d12('0x6'));var attributes=require(_0x4d12('0x7'));module['exports']=function(_0x4cd9fc,_0x44a0b2){return _0x4cd9fc[_0x4d12('0x8')](_0x4d12('0x9'),attributes,{'tableName':_0x4d12('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4d12('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac6d=['uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x2f9a0b,_0x507dad){var _0x49c803=function(_0x3a03a0){while(--_0x3a03a0){_0x2f9a0b['push'](_0x2f9a0b['shift']());}};_0x49c803(++_0x507dad);}(_0xac6d,0x11f));var _0xdac6=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xac6d[_0x5cc8];return _0x450661;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdac6('0x0'))(_0xdac6('0x1'));var moment=require('moment');var BPromise=require(_0xdac6('0x2'));var rp=require(_0xdac6('0x3'));var fs=require('fs');var path=require(_0xdac6('0x4'));var rimraf=require(_0xdac6('0x5'));var config=require(_0xdac6('0x6'));var attributes=require(_0xdac6('0x7'));module[_0xdac6('0x8')]=function(_0x375cc7,_0x422f99){return _0x375cc7[_0xdac6('0x9')](_0xdac6('0xa'),attributes,{'tableName':_0xdac6('0xb'),'paranoid':![],'indexes':[{'name':_0xdac6('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f13bf2f..4251ca4 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 _0x5ed9=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5ed9[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require('moment');var BPromise=require(_0x95ed('0x2'));var rs=require(_0x95ed('0x3'));var fs=require('fs');var Redis=require(_0x95ed('0x4'));var db=require(_0x95ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x6'))(_0x95ed('0x7'));var config=require(_0x95ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf25,_0xaa1eb1,_0x3753b5){return new BPromise(function(_0x1df51f,_0x46ed43){return client[_0x95ed('0xa')](_0x32bf25,_0x3753b5)['then'](function(_0x2b59f5){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,'request\x20sent');logger[_0x95ed('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0xaa1eb1,_0x95ed('0xe'),JSON[_0x95ed('0xf')](_0x2b59f5));if(_0x2b59f5[_0x95ed('0x10')]){if(_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x11')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x46ed43(_0x2b59f5['error']['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x1df51f(_0x2b59f5['error'][_0x95ed('0x12')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,_0x95ed('0xe'));_0x1df51f(_0x2b59f5[_0x95ed('0x13')]['message']);}})[_0x95ed('0x14')](function(_0x54ad78){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xaa1eb1,_0x54ad78);_0x46ed43(_0x54ad78);});});} \ No newline at end of file +var _0xc6a2=['info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x469852,_0x532e8c){var _0xa844b9=function(_0x511046){while(--_0x511046){_0x469852['push'](_0x469852['shift']());}};_0xa844b9(++_0x532e8c);}(_0xc6a2,0x69));var _0x2c6a=function(_0x32c833,_0x101fa0){_0x32c833=_0x32c833-0x0;var _0x561947=_0xc6a2[_0x32c833];return _0x561947;};'use strict';var _=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var moment=require('moment');var BPromise=require(_0x2c6a('0x2'));var rs=require(_0x2c6a('0x3'));var fs=require('fs');var Redis=require(_0x2c6a('0x4'));var db=require(_0x2c6a('0x5'))['db'];var utils=require(_0x2c6a('0x6'));var logger=require(_0x2c6a('0x7'))(_0x2c6a('0x8'));var config=require(_0x2c6a('0x9'));var jayson=require(_0x2c6a('0xa'));var client=jayson[_0x2c6a('0xb')][_0x2c6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33cdf9,_0x9c5133,_0x2b006a){return new BPromise(function(_0x4e45fa,_0x36f800){return client[_0x2c6a('0xd')](_0x33cdf9,_0x2b006a)[_0x2c6a('0xe')](function(_0x2290ed){logger[_0x2c6a('0xf')](_0x2c6a('0x10'),_0x9c5133,_0x2c6a('0x11'));logger[_0x2c6a('0x12')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x9c5133,'request\x20sent',JSON[_0x2c6a('0x13')](_0x2290ed));if(_0x2290ed[_0x2c6a('0x14')]){if(_0x2290ed[_0x2c6a('0x14')][_0x2c6a('0x15')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x9c5133,_0x2290ed[_0x2c6a('0x14')][_0x2c6a('0x16')]);return _0x36f800(_0x2290ed[_0x2c6a('0x14')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x9c5133,_0x2290ed[_0x2c6a('0x14')][_0x2c6a('0x16')]);return _0x4e45fa(_0x2290ed[_0x2c6a('0x14')][_0x2c6a('0x16')]);}else{logger[_0x2c6a('0xf')](_0x2c6a('0x10'),_0x9c5133,_0x2c6a('0x11'));_0x4e45fa(_0x2290ed[_0x2c6a('0x17')][_0x2c6a('0x16')]);}})['catch'](function(_0x41f830){logger[_0x2c6a('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x9c5133,_0x41f830);_0x36f800(_0x41f830);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 47c00be..2834aee 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 _0xe775=['./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','basename','extname','now','post','single','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x335f5d,_0x1bc893){var _0x43c9e4=function(_0x160903){while(--_0x160903){_0x335f5d['push'](_0x335f5d['shift']());}};_0x43c9e4(++_0x1bc893);}(_0xe775,0xff));var _0x5e77=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xe775[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require('multer');var util=require(_0x5e77('0x0'));var path=require(_0x5e77('0x1'));var timeout=require(_0x5e77('0x2'));var express=require(_0x5e77('0x3'));var router=express[_0x5e77('0x4')]();var auth=require(_0x5e77('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5e77('0x6'));router['get']('/',auth[_0x5e77('0x7')](),controller[_0x5e77('0x8')]);router[_0x5e77('0x9')](_0x5e77('0xa'),auth[_0x5e77('0x7')](),controller[_0x5e77('0xb')]);router[_0x5e77('0x9')](_0x5e77('0xc'),auth[_0x5e77('0x7')](),controller[_0x5e77('0xd')]);var upload=multer({'storage':multer[_0x5e77('0xe')]({'destination':function(_0x3f4a08,_0x5f5cb7,_0x37e139){_0x37e139(null,path[_0x5e77('0xf')](config[_0x5e77('0x10')],_0x5e77('0x11')));},'filename':function(_0x3eed6e,_0x4a4193,_0x3cef84){_0x4a4193[_0x5e77('0x12')]=_0x4a4193[_0x5e77('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3cef84(null,util[_0x5e77('0x13')]('%s-%s%s',path[_0x5e77('0x14')](_0x4a4193[_0x5e77('0x12')],path[_0x5e77('0x15')](_0x4a4193[_0x5e77('0x12')])),Date[_0x5e77('0x16')](),path[_0x5e77('0x15')](_0x4a4193[_0x5e77('0x12')])));}})});router[_0x5e77('0x17')]('/',upload[_0x5e77('0x18')]('file'),controller[_0x5e77('0x19')]);router[_0x5e77('0x1a')](_0x5e77('0xa'),auth[_0x5e77('0x7')](),controller[_0x5e77('0x1b')]);router[_0x5e77('0x1c')](_0x5e77('0xa'),auth[_0x5e77('0x7')](),controller[_0x5e77('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4d1b=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','originalname','format','%s-%s%s','now','extname','post','file','create','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5afa26,_0x39529e){var _0xacd8d7=function(_0x163d0b){while(--_0x163d0b){_0x5afa26['push'](_0x5afa26['shift']());}};_0xacd8d7(++_0x39529e);}(_0x4d1b,0xb0));var _0xb4d1=function(_0x5c6272,_0xd82df5){_0x5c6272=_0x5c6272-0x0;var _0x19c236=_0x4d1b[_0x5c6272];return _0x19c236;};'use strict';var multer=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var path=require('path');var timeout=require(_0xb4d1('0x2'));var express=require('express');var router=express[_0xb4d1('0x3')]();var auth=require(_0xb4d1('0x4'));var interaction=require(_0xb4d1('0x5'));var config=require(_0xb4d1('0x6'));var controller=require('./sound.controller');router[_0xb4d1('0x7')]('/',auth[_0xb4d1('0x8')](),controller[_0xb4d1('0x9')]);router[_0xb4d1('0x7')](_0xb4d1('0xa'),auth[_0xb4d1('0x8')](),controller[_0xb4d1('0xb')]);router[_0xb4d1('0x7')](_0xb4d1('0xc'),auth[_0xb4d1('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xb4d1('0xd')]({'destination':function(_0x5dc47e,_0x27ecd2,_0x32f5fb){_0x32f5fb(null,path[_0xb4d1('0xe')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x5e16ba,_0x30978b,_0x552d44){_0x30978b[_0xb4d1('0xf')]=_0x30978b[_0xb4d1('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x552d44(null,util[_0xb4d1('0x10')](_0xb4d1('0x11'),path['basename'](_0x30978b[_0xb4d1('0xf')],path['extname'](_0x30978b['originalname'])),Date[_0xb4d1('0x12')](),path[_0xb4d1('0x13')](_0x30978b[_0xb4d1('0xf')])));}})});router[_0xb4d1('0x14')]('/',upload['single'](_0xb4d1('0x15')),controller[_0xb4d1('0x16')]);router['put'](_0xb4d1('0xa'),auth[_0xb4d1('0x8')](),controller[_0xb4d1('0x17')]);router[_0xb4d1('0x18')](_0xb4d1('0xa'),auth[_0xb4d1('0x8')](),controller['delete']);module[_0xb4d1('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 99bb3e9..c2becf4 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 _0x0f06=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x0f06,0x172));var _0x60f0=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x0f06[_0x31b5b2];return _0x364f13;};'use strict';var Sequelize=require(_0x60f0('0x0'));module[_0x60f0('0x1')]={'name':{'type':Sequelize[_0x60f0('0x2')],'unique':_0x60f0('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x60f0('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x60f0('0x2')]},'original_format':{'type':Sequelize[_0x60f0('0x2')]},'original_duration':{'type':Sequelize[_0x60f0('0x4')]},'original_sampleCount':{'type':Sequelize[_0x60f0('0x5')]},'original_channelCount':{'type':Sequelize[_0x60f0('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x60f0('0x6')]},'converted_format':{'type':Sequelize[_0x60f0('0x2')]},'converted_duration':{'type':Sequelize[_0x60f0('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x60f0('0x5')]},'converted_channelCount':{'type':Sequelize[_0x60f0('0x6')]},'converted_bitRate':{'type':Sequelize[_0x60f0('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x60f0('0x6')]}}; \ No newline at end of file +var _0xb254=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0xb20614,_0x472c5e){var _0x79727d=function(_0xac3eae){while(--_0xac3eae){_0xb20614['push'](_0xb20614['shift']());}};_0x79727d(++_0x472c5e);}(_0xb254,0x1f1));var _0x4b25=function(_0x17b86b,_0x295a0d){_0x17b86b=_0x17b86b-0x0;var _0x13754d=_0xb254[_0x17b86b];return _0x13754d;};'use strict';var Sequelize=require(_0x4b25('0x0'));module[_0x4b25('0x1')]={'name':{'type':Sequelize[_0x4b25('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x4b25('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x4b25('0x2')]},'original_duration':{'type':Sequelize[_0x4b25('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4b25('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x4b25('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4b25('0x5')]},'converted_format':{'type':Sequelize[_0x4b25('0x2')]},'converted_duration':{'type':Sequelize[_0x4b25('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x4b25('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4b25('0x4')]},'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 94cdfac..7591af2 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 _0x3e42=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','index','Sound','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','show','params','include','catch','download','find','name','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','%s.%s','format','create','file','extname','originalname','basename','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','wav','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','description','delete','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x3e42,0x6a));var _0x23e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e42[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x23e4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x23e4('0x1'));var jsonpatch=require(_0x23e4('0x2'));var rp=require('request-promise');var moment=require(_0x23e4('0x3'));var BPromise=require(_0x23e4('0x4'));var Mustache=require(_0x23e4('0x5'));var util=require(_0x23e4('0x6'));var path=require(_0x23e4('0x7'));var sox=require('sox');var csv=require(_0x23e4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x23e4('0x9'));var crypto=require(_0x23e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x23e4('0xb'));var toCsv=require(_0x23e4('0x8'));var querystring=require('querystring');var Papa=require(_0x23e4('0xc'));var Redis=require(_0x23e4('0xd'));var authService=require(_0x23e4('0xe'));var qs=require(_0x23e4('0xf'));var hardwareService=require(_0x23e4('0x10'));var logger=require(_0x23e4('0x11'))('api');var utils=require(_0x23e4('0x12'));var config=require(_0x23e4('0x13'));var db=require(_0x23e4('0x14'))['db'];function respondWithStatusCode(_0x85e1df,_0x1bcc81){_0x1bcc81=_0x1bcc81||0xcc;return function(_0x25e5d7){if(_0x25e5d7){return _0x85e1df['sendStatus'](_0x1bcc81);}return _0x85e1df[_0x23e4('0x15')](_0x1bcc81)[_0x23e4('0x16')]();};}function respondWithResult(_0xa2d41a,_0x268894){_0x268894=_0x268894||0xc8;return function(_0x3b1090){if(_0x3b1090){return _0xa2d41a[_0x23e4('0x15')](_0x268894)[_0x23e4('0x17')](_0x3b1090);}};}function respondWithFilteredResult(_0x54d849,_0x26286f){return function(_0x4e0b13){if(_0x4e0b13){var _0x11130b=_0x4e0b13['count'],_0x4d9cd1=_0x26286f[_0x23e4('0x18')],_0x50c35f=_0x26286f[_0x23e4('0x18')]+_0x26286f[_0x23e4('0x19')],_0x1b500b;if(_0x50c35f>=_0x11130b){_0x50c35f=_0x11130b;_0x1b500b=0xc8;}else{_0x1b500b=0xce;}_0x54d849['status'](_0x1b500b);return _0x54d849[_0x23e4('0x1a')]('Content-Range',_0x4d9cd1+'-'+_0x50c35f+'/'+_0x11130b)[_0x23e4('0x17')](_0x4e0b13);}return null;};}function patchUpdates(_0x1a5f1f){return function(_0x37900d){try{jsonpatch[_0x23e4('0x1b')](_0x37900d,_0x1a5f1f,!![]);}catch(_0x10c6fd){return BPromise[_0x23e4('0x1c')](_0x10c6fd);}return _0x37900d[_0x23e4('0x1d')]();};}function saveUpdates(_0xc3aec7,_0x281acd){return function(_0x1560a6){if(_0x1560a6){return _0x1560a6[_0x23e4('0x1e')](_0xc3aec7)[_0x23e4('0x1f')](function(_0x59bd70){return _0x59bd70;});}return null;};}function removeEntity(_0x23b0e0,_0x4b6dbe){return function(_0x3532d7){if(_0x3532d7){return _0x3532d7[_0x23e4('0x20')]()[_0x23e4('0x1f')](function(){var _0x555d27=_0x3532d7[_0x23e4('0x21')]({'plain':!![]});var _0x53ff84='Sounds';return db[_0x23e4('0x22')]['destroy']({'where':{'type':_0x53ff84,'resourceId':_0x555d27['id']}})[_0x23e4('0x1f')](function(){return _0x3532d7;});})[_0x23e4('0x1f')](function(){_0x23b0e0[_0x23e4('0x15')](0xcc)[_0x23e4('0x16')]();});}};}function handleEntityNotFound(_0x447d72,_0x462e7d){return function(_0x448c6a){if(!_0x448c6a){_0x447d72['sendStatus'](0x194);}return _0x448c6a;};}function handleError(_0x5d995a,_0x2cf291){_0x2cf291=_0x2cf291||0x1f4;return function(_0x2eb5c8){logger['error'](_0x2eb5c8[_0x23e4('0x23')]);if(_0x2eb5c8['name']){delete _0x2eb5c8['name'];}_0x5d995a[_0x23e4('0x15')](_0x2cf291)['send'](_0x2eb5c8);};}exports[_0x23e4('0x24')]=function(_0x5804be,_0x375a7c){var _0x3a355a={},_0x297803={},_0x1afffa={'count':0x0,'rows':[]};var _0x38f1fe=db[_0x23e4('0x25')][_0x23e4('0x26')];_0x297803['model']=_['keys'](_0x38f1fe);_0x297803[_0x23e4('0x27')]=_[_0x23e4('0x28')](_0x5804be[_0x23e4('0x27')]);_0x297803[_0x23e4('0x29')]=_[_0x23e4('0x2a')](_0x297803[_0x23e4('0x2b')],_0x297803['query']);_0x3a355a[_0x23e4('0x2c')]=_[_0x23e4('0x2a')](_0x297803[_0x23e4('0x2b')],qs['fields'](_0x5804be[_0x23e4('0x27')][_0x23e4('0x2d')]));_0x3a355a[_0x23e4('0x2c')]=_0x3a355a[_0x23e4('0x2c')][_0x23e4('0x2e')]?_0x3a355a['attributes']:_0x297803['model'];if(!_0x5804be[_0x23e4('0x27')][_0x23e4('0x2f')]('nolimit')){_0x3a355a['limit']=qs['limit'](_0x5804be[_0x23e4('0x27')][_0x23e4('0x19')]);_0x3a355a[_0x23e4('0x18')]=qs[_0x23e4('0x18')](_0x5804be[_0x23e4('0x27')][_0x23e4('0x18')]);}_0x3a355a['order']=qs['sort'](_0x5804be['query'][_0x23e4('0x30')]);_0x3a355a[_0x23e4('0x31')]=qs[_0x23e4('0x29')](_[_0x23e4('0x32')](_0x5804be['query'],_0x297803['filters']));if(_0x5804be[_0x23e4('0x27')]['filter']){_0x3a355a['where']=_[_0x23e4('0x33')](_0x3a355a[_0x23e4('0x31')],{'$or':_[_0x23e4('0x34')](_0x38f1fe,function(_0x11706c){if(_0x11706c[_0x23e4('0x35')][_0x23e4('0x36')]!==_0x23e4('0x37')){var _0x338b78={};_0x338b78[_0x11706c[_0x23e4('0x38')]]={'$like':'%'+_0x5804be[_0x23e4('0x27')][_0x23e4('0x39')]+'%'};return _0x338b78;}})});}_0x3a355a=_['merge']({},_0x3a355a,_0x5804be[_0x23e4('0x3a')]);var _0x231778={'where':_0x3a355a[_0x23e4('0x31')]};return db['Sound'][_0x23e4('0x3b')](_0x231778)[_0x23e4('0x1f')](function(_0x3572a5){_0x1afffa[_0x23e4('0x3b')]=_0x3572a5;if(_0x5804be['query'][_0x23e4('0x3c')]){_0x3a355a['include']=[{'all':!![]}];}return db[_0x23e4('0x25')][_0x23e4('0x3d')](_0x3a355a);})[_0x23e4('0x1f')](function(_0x50f8b7){_0x1afffa[_0x23e4('0x3e')]=_0x50f8b7;return _0x1afffa;})[_0x23e4('0x1f')](respondWithFilteredResult(_0x375a7c,_0x3a355a))['catch'](handleError(_0x375a7c,null));};exports[_0x23e4('0x3f')]=function(_0x2dbf39,_0x336d3d){var _0x562898={'raw':!![],'where':{'id':_0x2dbf39[_0x23e4('0x40')]['id']}},_0x34a5ec={};_0x34a5ec[_0x23e4('0x2b')]=_[_0x23e4('0x28')](db[_0x23e4('0x25')]['rawAttributes']);_0x34a5ec[_0x23e4('0x27')]=_[_0x23e4('0x28')](_0x2dbf39[_0x23e4('0x27')]);_0x34a5ec[_0x23e4('0x29')]=_[_0x23e4('0x2a')](_0x34a5ec[_0x23e4('0x2b')],_0x34a5ec[_0x23e4('0x27')]);_0x562898['attributes']=_[_0x23e4('0x2a')](_0x34a5ec[_0x23e4('0x2b')],qs['fields'](_0x2dbf39[_0x23e4('0x27')][_0x23e4('0x2d')]));_0x562898[_0x23e4('0x2c')]=_0x562898[_0x23e4('0x2c')][_0x23e4('0x2e')]?_0x562898['attributes']:_0x34a5ec[_0x23e4('0x2b')];if(_0x2dbf39[_0x23e4('0x27')]['includeAll']){_0x562898[_0x23e4('0x41')]=[{'all':!![]}];}_0x562898=_['merge']({},_0x562898,_0x2dbf39[_0x23e4('0x3a')]);return db['Sound']['find'](_0x562898)[_0x23e4('0x1f')](handleEntityNotFound(_0x336d3d,null))[_0x23e4('0x1f')](respondWithResult(_0x336d3d,null))[_0x23e4('0x42')](handleError(_0x336d3d,null));};exports[_0x23e4('0x43')]=function(_0x21b289,_0x17b6c9,_0x16d443){return db[_0x23e4('0x25')][_0x23e4('0x44')]({'where':{'id':_0x21b289[_0x23e4('0x40')]['id']},'attributes':[_0x23e4('0x45'),_0x23e4('0x46'),_0x23e4('0x47')],'raw':!![]})[_0x23e4('0x1f')](handleEntityNotFound(_0x17b6c9,null))[_0x23e4('0x1f')](function(_0x2be2cc){if(_0x2be2cc){if(!fs[_0x23e4('0x48')](path[_0x23e4('0x49')](config[_0x23e4('0x4a')],'server/files/sounds/converted',_0x2be2cc[_0x23e4('0x46')]+'.'+_0x2be2cc[_0x23e4('0x47')]))){throw new db[(_0x23e4('0x4b'))][(_0x23e4('0x4c'))](_0x23e4('0x4d'));}return _0x17b6c9[_0x23e4('0x43')](path[_0x23e4('0x49')](config[_0x23e4('0x4a')],_0x23e4('0x4e'),util['format'](_0x23e4('0x4f'),_0x2be2cc[_0x23e4('0x46')],_0x2be2cc[_0x23e4('0x47')])),util[_0x23e4('0x50')]('%s.%s',_0x2be2cc[_0x23e4('0x45')],_0x2be2cc[_0x23e4('0x47')]));}return null;})[_0x23e4('0x42')](handleError(_0x17b6c9,null));};exports[_0x23e4('0x51')]=function(_0x2cd353,_0x561417,_0x4cf676){var _0x3b707e={'name':path['basename'](_0x2cd353[_0x23e4('0x52')]['originalname'],path[_0x23e4('0x53')](_0x2cd353['file'][_0x23e4('0x54')])),'save_name':path[_0x23e4('0x55')](_0x2cd353['file']['filename'],path[_0x23e4('0x53')](_0x2cd353[_0x23e4('0x52')][_0x23e4('0x56')])),'original_format':path['extname'](_0x2cd353['file'][_0x23e4('0x54')])['substring'](0x1),'converted_format':'wav'};var _0x431a16=path['join'](config[_0x23e4('0x4a')],_0x23e4('0x57'),_0x2cd353['file']['filename']);var _0x3144ba=path[_0x23e4('0x49')](config[_0x23e4('0x4a')],'server/files/sounds/converted',util[_0x23e4('0x50')](_0x23e4('0x4f'),path[_0x23e4('0x55')](_0x2cd353['file']['filename'],path[_0x23e4('0x53')](_0x2cd353[_0x23e4('0x52')][_0x23e4('0x56')])),_0x3b707e[_0x23e4('0x47')]));logger[_0x23e4('0x58')](_0x23e4('0x59'),_0x431a16);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x3144ba);try{fs[_0x23e4('0x5a')](_0x431a16,parseInt(_0x23e4('0x5b'),0x8));var _0xa54789=sox['transcode'](_0x431a16,_0x3144ba,{'sampleRate':0x1f40,'format':_0x23e4('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xa54789['on'](_0x23e4('0x5d'),function(_0x48dd73){fs[_0x23e4('0x5e')](_0x431a16);_0x561417['status'](0x1f4)['send'](_0x48dd73);});_0xa54789['on'](_0x23e4('0x5f'),function(_0x2dd211){_0x3b707e[_0x23e4('0x60')]=isNaN(_0x2dd211[_0x23e4('0x61')])?null:_0x2dd211['duration']*0x3e8;_0x3b707e[_0x23e4('0x62')]=isNaN(_0x2dd211[_0x23e4('0x63')])?null:_0x2dd211[_0x23e4('0x63')];_0x3b707e[_0x23e4('0x64')]=isNaN(_0x2dd211['channelCount'])?null:_0x2dd211[_0x23e4('0x65')];_0x3b707e[_0x23e4('0x66')]=isNaN(_0x2dd211[_0x23e4('0x67')])?null:_0x2dd211['bitRate'];_0x3b707e['original_sampleRate']=isNaN(_0x2dd211['sampleRate'])?null:_0x2dd211['sampleRate'];});_0xa54789['on'](_0x23e4('0x68'),function(_0x37418e){_0x3b707e[_0x23e4('0x69')]=isNaN(_0x37418e[_0x23e4('0x61')])?null:_0x37418e[_0x23e4('0x61')]*0x3e8;_0x3b707e[_0x23e4('0x6a')]=isNaN(_0x37418e[_0x23e4('0x63')])?null:_0x37418e[_0x23e4('0x63')];_0x3b707e[_0x23e4('0x6b')]=isNaN(_0x37418e[_0x23e4('0x65')])?null:_0x37418e[_0x23e4('0x65')];_0x3b707e[_0x23e4('0x6c')]=isNaN(_0x37418e[_0x23e4('0x67')])?null:_0x37418e['bitRate'];_0x3b707e[_0x23e4('0x6d')]=isNaN(_0x37418e['sampleRate'])?null:_0x37418e[_0x23e4('0x6e')];});_0xa54789['on'](_0x23e4('0x16'),function(){fs[_0x23e4('0x5a')](_0x3144ba,parseInt('0777',0x8));return db[_0x23e4('0x25')][_0x23e4('0x51')](_0x3b707e)[_0x23e4('0x1f')](function(_0xb52f87){var _0x3a97a3={'role':_0x2cd353[_0x23e4('0x6f')][_0x23e4('0x70')],'userProfileId':_0x2cd353['body'][_0x23e4('0x71')]};if(!_0x3a97a3)throw new Error(_0x23e4('0x72'));if(_0x3a97a3[_0x23e4('0x70')]===_0x23e4('0x73')){var _0x32c3c7=_0xb52f87['get']({'plain':!![]});return db[_0x23e4('0x74')]['find']({'where':{'name':_0x23e4('0x75'),'userProfileId':_0x3a97a3[_0x23e4('0x71')]},'raw':!![]})['then'](function(_0xfbc799){if(_0xfbc799&&_0xfbc799[_0x23e4('0x76')]===0x0){return db[_0x23e4('0x22')][_0x23e4('0x51')]({'name':_0x32c3c7[_0x23e4('0x45')],'resourceId':_0x32c3c7['id'],'type':_0xfbc799[_0x23e4('0x45')],'sectionId':_0xfbc799['id']},{})[_0x23e4('0x1f')](function(){return _0xb52f87;});}else{return _0xb52f87;}})['catch'](function(_0xa281d8){logger['error'](_0x23e4('0x77'),_0xa281d8);throw _0xa281d8;});}return _0xb52f87;})[_0x23e4('0x1f')](respondWithResult(_0x561417,null))['catch'](handleError(_0x561417,null));});_0xa54789['start']();}catch(_0x28d020){_0x561417[_0x23e4('0x15')](0x1f4)[_0x23e4('0x78')](_0x28d020);}};exports[_0x23e4('0x1e')]=function(_0x14f54f,_0x4574ac,_0x2274c0){return db[_0x23e4('0x25')][_0x23e4('0x44')]({'where':{'id':_0x14f54f[_0x23e4('0x40')]['id']}})['then'](handleEntityNotFound(_0x4574ac,null))[_0x23e4('0x1f')](saveUpdates(_['pick'](_0x14f54f[_0x23e4('0x6f')],[_0x23e4('0x45'),_0x23e4('0x79')]),null))[_0x23e4('0x1f')](respondWithResult(_0x4574ac,null))[_0x23e4('0x42')](handleError(_0x4574ac,null));};exports[_0x23e4('0x7a')]=function(_0x578eab,_0x1cc888,_0x300d99){return db[_0x23e4('0x25')][_0x23e4('0x44')]({'where':{'id':_0x578eab[_0x23e4('0x40')]['id']}})[_0x23e4('0x1f')](function(_0x135920){if(_0x135920){return _0x135920[_0x23e4('0x20')]();}})['then'](function(_0x3a31fd){var _0x23266b=path[_0x23e4('0x49')](config[_0x23e4('0x4a')],_0x23e4('0x57'),util[_0x23e4('0x50')](_0x23e4('0x4f'),_0x3a31fd[_0x23e4('0x46')],_0x3a31fd['original_format']));var _0x31db22=path[_0x23e4('0x49')](config['root'],'server/files/sounds/converted',util[_0x23e4('0x50')](_0x23e4('0x4f'),_0x3a31fd['save_name'],_0x3a31fd[_0x23e4('0x47')]));fs['unlinkSync'](_0x23266b);fs['unlinkSync'](_0x31db22);return _0x3a31fd;})['then'](function(_0x533f5a){if(_0x533f5a){return _0x1cc888[_0x23e4('0x15')](0xcc)[_0x23e4('0x16')]();}})['then'](handleEntityNotFound(_0x1cc888,null))['catch'](handleError(_0x1cc888,null));}; \ No newline at end of file +var _0xc174=['converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','update','params','description','delete','original_format','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','get','Sounds','error','stack','name','index','Sound','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','count','include','findAll','rows','catch','includeAll','options','find','download','save_name','converted_format','existsSync','join','ValidationError','Sound\x20not\x20found','root','server/files/sounds/converted','format','%s.%s','create','basename','originalname','extname','file','filename','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest'];(function(_0x40052f,_0x12baee){var _0x12c8f7=function(_0x3e4d25){while(--_0x3e4d25){_0x40052f['push'](_0x40052f['shift']());}};_0x12c8f7(++_0x12baee);}(_0xc174,0x10f));var _0x4c17=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0xc174[_0x151381];return _0x2afab6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4c17('0x0'));var rimraf=require(_0x4c17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c17('0x2'));var rp=require('request-promise');var moment=require(_0x4c17('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c17('0x4'));var util=require(_0x4c17('0x5'));var path=require(_0x4c17('0x6'));var sox=require(_0x4c17('0x7'));var csv=require(_0x4c17('0x8'));var ejs=require(_0x4c17('0x9'));var fs=require('fs');var _=require(_0x4c17('0xa'));var squel=require(_0x4c17('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c17('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c17('0xd'));var authService=require(_0x4c17('0xe'));var qs=require(_0x4c17('0xf'));var hardwareService=require(_0x4c17('0x10'));var logger=require(_0x4c17('0x11'))(_0x4c17('0x12'));var utils=require('../../config/utils');var config=require(_0x4c17('0x13'));var db=require(_0x4c17('0x14'))['db'];function respondWithStatusCode(_0x5d41df,_0x158c07){_0x158c07=_0x158c07||0xcc;return function(_0x4c90b8){if(_0x4c90b8){return _0x5d41df[_0x4c17('0x15')](_0x158c07);}return _0x5d41df[_0x4c17('0x16')](_0x158c07)[_0x4c17('0x17')]();};}function respondWithResult(_0x2f466d,_0x1c9868){_0x1c9868=_0x1c9868||0xc8;return function(_0x160515){if(_0x160515){return _0x2f466d[_0x4c17('0x16')](_0x1c9868)[_0x4c17('0x18')](_0x160515);}};}function respondWithFilteredResult(_0x228ae5,_0x5a2712){return function(_0x14b48d){if(_0x14b48d){var _0x5c1ef6=_0x14b48d['count'],_0x43d6a4=_0x5a2712[_0x4c17('0x19')],_0xed2eca=_0x5a2712[_0x4c17('0x19')]+_0x5a2712['limit'],_0x1c9bd4;if(_0xed2eca>=_0x5c1ef6){_0xed2eca=_0x5c1ef6;_0x1c9bd4=0xc8;}else{_0x1c9bd4=0xce;}_0x228ae5[_0x4c17('0x16')](_0x1c9bd4);return _0x228ae5[_0x4c17('0x1a')](_0x4c17('0x1b'),_0x43d6a4+'-'+_0xed2eca+'/'+_0x5c1ef6)[_0x4c17('0x18')](_0x14b48d);}return null;};}function patchUpdates(_0x2aa2d5){return function(_0x49e206){try{jsonpatch[_0x4c17('0x1c')](_0x49e206,_0x2aa2d5,!![]);}catch(_0x1a9004){return BPromise[_0x4c17('0x1d')](_0x1a9004);}return _0x49e206[_0x4c17('0x1e')]();};}function saveUpdates(_0x10c935,_0xef54e){return function(_0x27f2c3){if(_0x27f2c3){return _0x27f2c3['update'](_0x10c935)[_0x4c17('0x1f')](function(_0x233b74){return _0x233b74;});}return null;};}function removeEntity(_0x33e96d,_0x840b5b){return function(_0x528259){if(_0x528259){return _0x528259[_0x4c17('0x20')]()[_0x4c17('0x1f')](function(){var _0x438bbc=_0x528259[_0x4c17('0x21')]({'plain':!![]});var _0x4c6707=_0x4c17('0x22');return db['UserProfileResource'][_0x4c17('0x20')]({'where':{'type':_0x4c6707,'resourceId':_0x438bbc['id']}})['then'](function(){return _0x528259;});})[_0x4c17('0x1f')](function(){_0x33e96d[_0x4c17('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45550d,_0x2c7738){return function(_0x232fa6){if(!_0x232fa6){_0x45550d['sendStatus'](0x194);}return _0x232fa6;};}function handleError(_0x52b402,_0x282434){_0x282434=_0x282434||0x1f4;return function(_0x3e2de0){logger[_0x4c17('0x23')](_0x3e2de0[_0x4c17('0x24')]);if(_0x3e2de0['name']){delete _0x3e2de0[_0x4c17('0x25')];}_0x52b402[_0x4c17('0x16')](_0x282434)['send'](_0x3e2de0);};}exports[_0x4c17('0x26')]=function(_0x5c7022,_0x80cd6){var _0x368b5e={},_0x4e9abd={},_0xb590e4={'count':0x0,'rows':[]};var _0x175345=db[_0x4c17('0x27')][_0x4c17('0x28')];_0x4e9abd['model']=_['keys'](_0x175345);_0x4e9abd[_0x4c17('0x29')]=_[_0x4c17('0x2a')](_0x5c7022[_0x4c17('0x29')]);_0x4e9abd[_0x4c17('0x2b')]=_[_0x4c17('0x2c')](_0x4e9abd[_0x4c17('0x2d')],_0x4e9abd['query']);_0x368b5e[_0x4c17('0x2e')]=_['intersection'](_0x4e9abd[_0x4c17('0x2d')],qs['fields'](_0x5c7022[_0x4c17('0x29')][_0x4c17('0x2f')]));_0x368b5e[_0x4c17('0x2e')]=_0x368b5e[_0x4c17('0x2e')][_0x4c17('0x30')]?_0x368b5e[_0x4c17('0x2e')]:_0x4e9abd[_0x4c17('0x2d')];if(!_0x5c7022['query'][_0x4c17('0x31')]('nolimit')){_0x368b5e[_0x4c17('0x32')]=qs['limit'](_0x5c7022[_0x4c17('0x29')]['limit']);_0x368b5e[_0x4c17('0x19')]=qs[_0x4c17('0x19')](_0x5c7022['query'][_0x4c17('0x19')]);}_0x368b5e[_0x4c17('0x33')]=qs[_0x4c17('0x34')](_0x5c7022[_0x4c17('0x29')][_0x4c17('0x34')]);_0x368b5e[_0x4c17('0x35')]=qs['filters'](_[_0x4c17('0x36')](_0x5c7022[_0x4c17('0x29')],_0x4e9abd['filters']));if(_0x5c7022[_0x4c17('0x29')][_0x4c17('0x37')]){_0x368b5e[_0x4c17('0x35')]=_[_0x4c17('0x38')](_0x368b5e['where'],{'$or':_[_0x4c17('0x39')](_0x175345,function(_0x373844){if(_0x373844[_0x4c17('0x3a')]['key']!==_0x4c17('0x3b')){var _0x43a50d={};_0x43a50d[_0x373844[_0x4c17('0x3c')]]={'$like':'%'+_0x5c7022[_0x4c17('0x29')][_0x4c17('0x37')]+'%'};return _0x43a50d;}})});}_0x368b5e=_['merge']({},_0x368b5e,_0x5c7022['options']);var _0x46eea9={'where':_0x368b5e[_0x4c17('0x35')]};return db['Sound']['count'](_0x46eea9)[_0x4c17('0x1f')](function(_0x2d6189){_0xb590e4[_0x4c17('0x3d')]=_0x2d6189;if(_0x5c7022[_0x4c17('0x29')]['includeAll']){_0x368b5e[_0x4c17('0x3e')]=[{'all':!![]}];}return db[_0x4c17('0x27')][_0x4c17('0x3f')](_0x368b5e);})[_0x4c17('0x1f')](function(_0x55d9ae){_0xb590e4[_0x4c17('0x40')]=_0x55d9ae;return _0xb590e4;})[_0x4c17('0x1f')](respondWithFilteredResult(_0x80cd6,_0x368b5e))[_0x4c17('0x41')](handleError(_0x80cd6,null));};exports['show']=function(_0x2fd353,_0x56bbd0){var _0x1f4dd6={'raw':!![],'where':{'id':_0x2fd353['params']['id']}},_0x22d71b={};_0x22d71b['model']=_[_0x4c17('0x2a')](db['Sound'][_0x4c17('0x28')]);_0x22d71b[_0x4c17('0x29')]=_[_0x4c17('0x2a')](_0x2fd353[_0x4c17('0x29')]);_0x22d71b[_0x4c17('0x2b')]=_[_0x4c17('0x2c')](_0x22d71b[_0x4c17('0x2d')],_0x22d71b['query']);_0x1f4dd6[_0x4c17('0x2e')]=_[_0x4c17('0x2c')](_0x22d71b[_0x4c17('0x2d')],qs['fields'](_0x2fd353[_0x4c17('0x29')]['fields']));_0x1f4dd6[_0x4c17('0x2e')]=_0x1f4dd6['attributes'][_0x4c17('0x30')]?_0x1f4dd6['attributes']:_0x22d71b['model'];if(_0x2fd353[_0x4c17('0x29')][_0x4c17('0x42')]){_0x1f4dd6['include']=[{'all':!![]}];}_0x1f4dd6=_[_0x4c17('0x38')]({},_0x1f4dd6,_0x2fd353[_0x4c17('0x43')]);return db['Sound'][_0x4c17('0x44')](_0x1f4dd6)[_0x4c17('0x1f')](handleEntityNotFound(_0x56bbd0,null))['then'](respondWithResult(_0x56bbd0,null))['catch'](handleError(_0x56bbd0,null));};exports[_0x4c17('0x45')]=function(_0x14f51a,_0x4c3a1f,_0xe6a9b6){return db[_0x4c17('0x27')][_0x4c17('0x44')]({'where':{'id':_0x14f51a['params']['id']},'attributes':['name',_0x4c17('0x46'),_0x4c17('0x47')],'raw':!![]})[_0x4c17('0x1f')](handleEntityNotFound(_0x4c3a1f,null))[_0x4c17('0x1f')](function(_0x49df56){if(_0x49df56){if(!fs[_0x4c17('0x48')](path[_0x4c17('0x49')](config['root'],'server/files/sounds/converted',_0x49df56[_0x4c17('0x46')]+'.'+_0x49df56[_0x4c17('0x47')]))){throw new db['Sequelize'][(_0x4c17('0x4a'))](_0x4c17('0x4b'));}return _0x4c3a1f[_0x4c17('0x45')](path[_0x4c17('0x49')](config[_0x4c17('0x4c')],_0x4c17('0x4d'),util[_0x4c17('0x4e')](_0x4c17('0x4f'),_0x49df56['save_name'],_0x49df56['converted_format'])),util[_0x4c17('0x4e')](_0x4c17('0x4f'),_0x49df56['name'],_0x49df56[_0x4c17('0x47')]));}return null;})[_0x4c17('0x41')](handleError(_0x4c3a1f,null));};exports[_0x4c17('0x50')]=function(_0x3c43cc,_0x6b74b6,_0x308fe8){var _0x4c4a3e={'name':path[_0x4c17('0x51')](_0x3c43cc['file'][_0x4c17('0x52')],path[_0x4c17('0x53')](_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x52')])),'save_name':path['basename'](_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x55')],path[_0x4c17('0x53')](_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x55')])),'original_format':path[_0x4c17('0x53')](_0x3c43cc['file'][_0x4c17('0x52')])[_0x4c17('0x56')](0x1),'converted_format':'wav'};var _0xa9bac=path['join'](config[_0x4c17('0x4c')],_0x4c17('0x57'),_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x55')]);var _0x4ad26d=path[_0x4c17('0x49')](config[_0x4c17('0x4c')],'server/files/sounds/converted',util[_0x4c17('0x4e')](_0x4c17('0x4f'),path[_0x4c17('0x51')](_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x55')],path['extname'](_0x3c43cc[_0x4c17('0x54')][_0x4c17('0x55')])),_0x4c4a3e['converted_format']));logger['info'](_0x4c17('0x58'),_0xa9bac);logger[_0x4c17('0x59')](_0x4c17('0x5a'),_0x4ad26d);try{fs[_0x4c17('0x5b')](_0xa9bac,parseInt(_0x4c17('0x5c'),0x8));var _0x170692=sox['transcode'](_0xa9bac,_0x4ad26d,{'sampleRate':0x1f40,'format':_0x4c17('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x170692['on']('error',function(_0x43d1e9){fs[_0x4c17('0x5e')](_0xa9bac);_0x6b74b6[_0x4c17('0x16')](0x1f4)['send'](_0x43d1e9);});_0x170692['on'](_0x4c17('0x5f'),function(_0x66deff){_0x4c4a3e[_0x4c17('0x60')]=isNaN(_0x66deff[_0x4c17('0x61')])?null:_0x66deff[_0x4c17('0x61')]*0x3e8;_0x4c4a3e[_0x4c17('0x62')]=isNaN(_0x66deff[_0x4c17('0x63')])?null:_0x66deff[_0x4c17('0x63')];_0x4c4a3e[_0x4c17('0x64')]=isNaN(_0x66deff[_0x4c17('0x65')])?null:_0x66deff['channelCount'];_0x4c4a3e[_0x4c17('0x66')]=isNaN(_0x66deff[_0x4c17('0x67')])?null:_0x66deff[_0x4c17('0x67')];_0x4c4a3e[_0x4c17('0x68')]=isNaN(_0x66deff[_0x4c17('0x69')])?null:_0x66deff[_0x4c17('0x69')];});_0x170692['on'](_0x4c17('0x6a'),function(_0x15c97d){_0x4c4a3e['converted_duration']=isNaN(_0x15c97d[_0x4c17('0x61')])?null:_0x15c97d[_0x4c17('0x61')]*0x3e8;_0x4c4a3e[_0x4c17('0x6b')]=isNaN(_0x15c97d['sampleCount'])?null:_0x15c97d[_0x4c17('0x63')];_0x4c4a3e[_0x4c17('0x6c')]=isNaN(_0x15c97d['channelCount'])?null:_0x15c97d[_0x4c17('0x65')];_0x4c4a3e[_0x4c17('0x6d')]=isNaN(_0x15c97d[_0x4c17('0x67')])?null:_0x15c97d[_0x4c17('0x67')];_0x4c4a3e[_0x4c17('0x6e')]=isNaN(_0x15c97d[_0x4c17('0x69')])?null:_0x15c97d[_0x4c17('0x69')];});_0x170692['on'](_0x4c17('0x17'),function(){fs[_0x4c17('0x5b')](_0x4ad26d,parseInt(_0x4c17('0x5c'),0x8));return db[_0x4c17('0x27')]['create'](_0x4c4a3e)[_0x4c17('0x1f')](function(_0x8a96f){var _0x2c9241={'role':_0x3c43cc[_0x4c17('0x6f')]['role'],'userProfileId':_0x3c43cc['body'][_0x4c17('0x70')]};if(!_0x2c9241)throw new Error(_0x4c17('0x71'));if(_0x2c9241[_0x4c17('0x72')]===_0x4c17('0x73')){var _0x149cbf=_0x8a96f[_0x4c17('0x21')]({'plain':!![]});return db[_0x4c17('0x74')][_0x4c17('0x44')]({'where':{'name':_0x4c17('0x22'),'userProfileId':_0x2c9241[_0x4c17('0x70')]},'raw':!![]})[_0x4c17('0x1f')](function(_0x371016){if(_0x371016&&_0x371016[_0x4c17('0x75')]===0x0){return db['UserProfileResource'][_0x4c17('0x50')]({'name':_0x149cbf[_0x4c17('0x25')],'resourceId':_0x149cbf['id'],'type':_0x371016['name'],'sectionId':_0x371016['id']},{})[_0x4c17('0x1f')](function(){return _0x8a96f;});}else{return _0x8a96f;}})[_0x4c17('0x41')](function(_0x96bfcd){logger[_0x4c17('0x23')](_0x4c17('0x76'),_0x96bfcd);throw _0x96bfcd;});}return _0x8a96f;})[_0x4c17('0x1f')](respondWithResult(_0x6b74b6,null))[_0x4c17('0x41')](handleError(_0x6b74b6,null));});_0x170692[_0x4c17('0x77')]();}catch(_0x38a2b3){_0x6b74b6[_0x4c17('0x16')](0x1f4)[_0x4c17('0x78')](_0x38a2b3);}};exports[_0x4c17('0x79')]=function(_0x38f9ab,_0x550752,_0x3b4b2a){return db[_0x4c17('0x27')][_0x4c17('0x44')]({'where':{'id':_0x38f9ab[_0x4c17('0x7a')]['id']}})[_0x4c17('0x1f')](handleEntityNotFound(_0x550752,null))[_0x4c17('0x1f')](saveUpdates(_[_0x4c17('0x36')](_0x38f9ab['body'],[_0x4c17('0x25'),_0x4c17('0x7b')]),null))[_0x4c17('0x1f')](respondWithResult(_0x550752,null))[_0x4c17('0x41')](handleError(_0x550752,null));};exports[_0x4c17('0x7c')]=function(_0x48f5dd,_0x1dbd2e,_0x55d032){return db[_0x4c17('0x27')][_0x4c17('0x44')]({'where':{'id':_0x48f5dd[_0x4c17('0x7a')]['id']}})['then'](function(_0x2d0b1f){if(_0x2d0b1f){return _0x2d0b1f['destroy']();}})['then'](function(_0x3eb638){var _0x4ca2cd=path['join'](config[_0x4c17('0x4c')],_0x4c17('0x57'),util[_0x4c17('0x4e')](_0x4c17('0x4f'),_0x3eb638[_0x4c17('0x46')],_0x3eb638[_0x4c17('0x7d')]));var _0x21c2f2=path[_0x4c17('0x49')](config[_0x4c17('0x4c')],_0x4c17('0x4d'),util[_0x4c17('0x4e')](_0x4c17('0x4f'),_0x3eb638[_0x4c17('0x46')],_0x3eb638['converted_format']));fs[_0x4c17('0x5e')](_0x4ca2cd);fs['unlinkSync'](_0x21c2f2);return _0x3eb638;})[_0x4c17('0x1f')](function(_0x4e5457){if(_0x4e5457){return _0x1dbd2e[_0x4c17('0x16')](0xcc)[_0x4c17('0x17')]();}})[_0x4c17('0x1f')](handleEntityNotFound(_0x1dbd2e,null))[_0x4c17('0x41')](handleError(_0x1dbd2e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c4eb751..da9f3f3 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 _0x3824=['api','moment','request-promise','path','rimraf','define','Sound','tools_sounds','util'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x3824,0xfb));var _0x4382=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x3824[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0x4382('0x0'));var logger=require('../../config/logger')(_0x4382('0x1'));var moment=require(_0x4382('0x2'));var BPromise=require('bluebird');var rp=require(_0x4382('0x3'));var fs=require('fs');var path=require(_0x4382('0x4'));var rimraf=require(_0x4382('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module['exports']=function(_0x4b2066,_0x5337cf){return _0x4b2066[_0x4382('0x6')](_0x4382('0x7'),attributes,{'tableName':_0x4382('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2262=['path','rimraf','../../config/environment','./sound.attributes','define','Sound','lodash','util','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2262,0x156));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2226('0x0'));var util=require(_0x2226('0x1'));var logger=require('../../config/logger')(_0x2226('0x2'));var moment=require(_0x2226('0x3'));var BPromise=require(_0x2226('0x4'));var rp=require(_0x2226('0x5'));var fs=require('fs');var path=require(_0x2226('0x6'));var rimraf=require(_0x2226('0x7'));var config=require(_0x2226('0x8'));var attributes=require(_0x2226('0x9'));module['exports']=function(_0x5b8016,_0x485e24){return _0x5b8016[_0x2226('0xa')](_0x2226('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 16baeb8..2294738 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 _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0xed4f27,_0x52ec52){var _0xc00718=function(_0x43d1ca){while(--_0x43d1ca){_0xed4f27['push'](_0xed4f27['shift']());}};_0xc00718(++_0x52ec52);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x24ef45,_0x2d88cb){var _0x39084c=function(_0x7cd9aa){while(--_0x7cd9aa){_0x24ef45['push'](_0x24ef45['shift']());}};_0x39084c(++_0x2d88cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index fdd1bc6..dbf79d6 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 _0x2d6d=['../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x2d6d,0x66));var _0xd2d6=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x2d6d[_0x559a80];return _0x42f555;};'use strict';var multer=require(_0xd2d6('0x0'));var util=require(_0xd2d6('0x1'));var path=require(_0xd2d6('0x2'));var timeout=require(_0xd2d6('0x3'));var express=require(_0xd2d6('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd2d6('0x5'));var config=require(_0xd2d6('0x6'));var controller=require(_0xd2d6('0x7'));router[_0xd2d6('0x8')]('/',auth[_0xd2d6('0x9')](),controller[_0xd2d6('0xa')]);router[_0xd2d6('0x8')](_0xd2d6('0xb'),auth[_0xd2d6('0x9')](),controller['show']);router[_0xd2d6('0xc')]('/',auth['isAuthenticated'](),controller[_0xd2d6('0xd')]);router['put']('/:id',auth[_0xd2d6('0x9')](),controller[_0xd2d6('0xe')]);router[_0xd2d6('0xf')](_0xd2d6('0xb'),auth[_0xd2d6('0x9')](),controller[_0xd2d6('0x10')]);module[_0xd2d6('0x11')]=router; \ No newline at end of file +var _0xa596=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','/:id','isAuthenticated','show','post','create','delete','exports','multer','util','connect-timeout'];(function(_0x108260,_0x219171){var _0x4e8924=function(_0x5f41a9){while(--_0x5f41a9){_0x108260['push'](_0x108260['shift']());}};_0x4e8924(++_0x219171);}(_0xa596,0x7b));var _0x6a59=function(_0xe0549,_0x39664e){_0xe0549=_0xe0549-0x0;var _0x32a561=_0xa596[_0xe0549];return _0x32a561;};'use strict';var multer=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var path=require('path');var timeout=require(_0x6a59('0x2'));var express=require(_0x6a59('0x3'));var router=express[_0x6a59('0x4')]();var auth=require(_0x6a59('0x5'));var interaction=require(_0x6a59('0x6'));var config=require(_0x6a59('0x7'));var controller=require(_0x6a59('0x8'));router[_0x6a59('0x9')]('/',auth['isAuthenticated'](),controller[_0x6a59('0xa')]);router[_0x6a59('0x9')](_0x6a59('0xb'),auth[_0x6a59('0xc')](),controller[_0x6a59('0xd')]);router[_0x6a59('0xe')]('/',auth['isAuthenticated'](),controller[_0x6a59('0xf')]);router['put'](_0x6a59('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6a59('0x10')](_0x6a59('0xb'),auth[_0x6a59('0xc')](),controller['destroy']);module[_0x6a59('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1ca5633..622959e 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 _0x7cdd=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x59ef81,_0x5d95b8){var _0x3b0f6b=function(_0xaccf47){while(--_0xaccf47){_0x59ef81['push'](_0x59ef81['shift']());}};_0x3b0f6b(++_0x5d95b8);}(_0x7cdd,0x188));var _0xd7cd=function(_0x3917da,_0x4d8bb8){_0x3917da=_0x3917da-0x0;var _0x4d891a=_0x7cdd[_0x3917da];return _0x4d891a;};'use strict';var Sequelize=require(_0xd7cd('0x0'));module[_0xd7cd('0x1')]={'uniqueid':{'type':Sequelize[_0xd7cd('0x2')]},'body':{'type':Sequelize[_0xd7cd('0x3')](_0xd7cd('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xd7cd('0x5')]('in',_0xd7cd('0x6')),'defaultValue':_0xd7cd('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x7ac6=['exports','STRING','TEXT','medium','ENUM','out'];(function(_0xf1bd18,_0x10f241){var _0x2ae9ea=function(_0x34d9d5){while(--_0x34d9d5){_0xf1bd18['push'](_0xf1bd18['shift']());}};_0x2ae9ea(++_0x10f241);}(_0x7ac6,0xb4));var _0x67ac=function(_0x38cdf5,_0x5983b2){_0x38cdf5=_0x38cdf5-0x0;var _0x1b2ef9=_0x7ac6[_0x38cdf5];return _0x1b2ef9;};'use strict';var Sequelize=require('sequelize');module[_0x67ac('0x0')]={'uniqueid':{'type':Sequelize[_0x67ac('0x1')]},'body':{'type':Sequelize[_0x67ac('0x2')](_0x67ac('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x67ac('0x4')]('in',_0x67ac('0x5')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b389f43..a5fdd8c 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 _0x29ea=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','include','SquareMessage','findAll','rows','catch','show','params','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x797438,_0x48db3e){var _0x272b18=function(_0x4c407d){while(--_0x4c407d){_0x797438['push'](_0x797438['shift']());}};_0x272b18(++_0x48db3e);}(_0x29ea,0xf6));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xa29e('0x0'));var emlformat=require(_0xa29e('0x1'));var rimraf=require(_0xa29e('0x2'));var zipdir=require(_0xa29e('0x3'));var jsonpatch=require(_0xa29e('0x4'));var rp=require('request-promise');var moment=require(_0xa29e('0x5'));var BPromise=require(_0xa29e('0x6'));var Mustache=require(_0xa29e('0x7'));var util=require(_0xa29e('0x8'));var path=require(_0xa29e('0x9'));var sox=require(_0xa29e('0xa'));var csv=require(_0xa29e('0xb'));var ejs=require(_0xa29e('0xc'));var fs=require('fs');var _=require(_0xa29e('0xd'));var squel=require(_0xa29e('0xe'));var crypto=require(_0xa29e('0xf'));var jsforce=require(_0xa29e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa29e('0xb'));var querystring=require(_0xa29e('0x11'));var Papa=require(_0xa29e('0x12'));var Redis=require(_0xa29e('0x13'));var authService=require(_0xa29e('0x14'));var qs=require(_0xa29e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa29e('0x16'));var utils=require(_0xa29e('0x17'));var config=require(_0xa29e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a88c0,_0x182ebd){_0x182ebd=_0x182ebd||0xcc;return function(_0xcb6379){if(_0xcb6379){return _0x2a88c0[_0xa29e('0x19')](_0x182ebd);}return _0x2a88c0[_0xa29e('0x1a')](_0x182ebd)[_0xa29e('0x1b')]();};}function respondWithResult(_0x44509e,_0x3ec15b){_0x3ec15b=_0x3ec15b||0xc8;return function(_0x122db5){if(_0x122db5){return _0x44509e[_0xa29e('0x1a')](_0x3ec15b)[_0xa29e('0x1c')](_0x122db5);}};}function respondWithFilteredResult(_0x2a1e9d,_0x49b4b9){return function(_0x35bed0){if(_0x35bed0){var _0x35084f=_0x35bed0[_0xa29e('0x1d')],_0x413f12=_0x49b4b9[_0xa29e('0x1e')],_0x444228=_0x49b4b9[_0xa29e('0x1e')]+_0x49b4b9[_0xa29e('0x1f')],_0x38f442;if(_0x444228>=_0x35084f){_0x444228=_0x35084f;_0x38f442=0xc8;}else{_0x38f442=0xce;}_0x2a1e9d[_0xa29e('0x1a')](_0x38f442);return _0x2a1e9d['set']('Content-Range',_0x413f12+'-'+_0x444228+'/'+_0x35084f)[_0xa29e('0x1c')](_0x35bed0);}return null;};}function patchUpdates(_0x45442d){return function(_0x264ade){try{jsonpatch[_0xa29e('0x20')](_0x264ade,_0x45442d,!![]);}catch(_0x20369b){return BPromise[_0xa29e('0x21')](_0x20369b);}return _0x264ade[_0xa29e('0x22')]();};}function saveUpdates(_0x493e61,_0x4efad9){return function(_0x2c772b){if(_0x2c772b){return _0x2c772b[_0xa29e('0x23')](_0x493e61)['then'](function(_0x3a43fc){return _0x3a43fc;});}return null;};}function removeEntity(_0x3672a6,_0x427dca){return function(_0x43b52e){if(_0x43b52e){return _0x43b52e[_0xa29e('0x24')]()[_0xa29e('0x25')](function(){_0x3672a6[_0xa29e('0x1a')](0xcc)[_0xa29e('0x1b')]();});}};}function handleEntityNotFound(_0xee32db,_0x3df4a1){return function(_0x262cac){if(!_0x262cac){_0xee32db['sendStatus'](0x194);}return _0x262cac;};}function handleError(_0x174347,_0x382306){_0x382306=_0x382306||0x1f4;return function(_0x4911df){logger[_0xa29e('0x26')](_0x4911df[_0xa29e('0x27')]);if(_0x4911df[_0xa29e('0x28')]){delete _0x4911df['name'];}_0x174347[_0xa29e('0x1a')](_0x382306)[_0xa29e('0x29')](_0x4911df);};}exports[_0xa29e('0x2a')]=function(_0x191fb7,_0x2f8185){var _0x196938={},_0x22ef97={},_0x3c5700={'count':0x0,'rows':[]};var _0x21b012=db['SquareMessage'][_0xa29e('0x2b')];_0x22ef97[_0xa29e('0x2c')]=_[_0xa29e('0x2d')](_0x21b012);_0x22ef97[_0xa29e('0x2e')]=_[_0xa29e('0x2d')](_0x191fb7[_0xa29e('0x2e')]);_0x22ef97[_0xa29e('0x2f')]=_[_0xa29e('0x30')](_0x22ef97[_0xa29e('0x2c')],_0x22ef97['query']);_0x196938[_0xa29e('0x31')]=_['intersection'](_0x22ef97['model'],qs['fields'](_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x32')]));_0x196938[_0xa29e('0x31')]=_0x196938['attributes'][_0xa29e('0x33')]?_0x196938[_0xa29e('0x31')]:_0x22ef97[_0xa29e('0x2c')];if(!_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x34')]('nolimit')){_0x196938[_0xa29e('0x1f')]=qs[_0xa29e('0x1f')](_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x1f')]);_0x196938[_0xa29e('0x1e')]=qs[_0xa29e('0x1e')](_0x191fb7[_0xa29e('0x2e')]['offset']);}_0x196938[_0xa29e('0x35')]=qs[_0xa29e('0x36')](_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x36')]);_0x196938[_0xa29e('0x37')]=qs[_0xa29e('0x2f')](_[_0xa29e('0x38')](_0x191fb7['query'],_0x22ef97[_0xa29e('0x2f')]));if(_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x39')]){_0x196938[_0xa29e('0x37')]=_[_0xa29e('0x3a')](_0x196938['where'],{'$or':_[_0xa29e('0x3b')](_0x21b012,function(_0x2008bc){if(_0x2008bc[_0xa29e('0x3c')][_0xa29e('0x3d')]!==_0xa29e('0x3e')){var _0x78f8e6={};_0x78f8e6[_0x2008bc['field']]={'$like':'%'+_0x191fb7[_0xa29e('0x2e')][_0xa29e('0x39')]+'%'};return _0x78f8e6;}})});}_0x196938=_[_0xa29e('0x3a')]({},_0x196938,_0x191fb7['options']);var _0x6463d8={'where':_0x196938['where']};return db['SquareMessage'][_0xa29e('0x1d')](_0x6463d8)['then'](function(_0x5527ca){_0x3c5700[_0xa29e('0x1d')]=_0x5527ca;if(_0x191fb7['query'][_0xa29e('0x3f')]){_0x196938[_0xa29e('0x40')]=[{'all':!![]}];}return db[_0xa29e('0x41')][_0xa29e('0x42')](_0x196938);})[_0xa29e('0x25')](function(_0x420965){_0x3c5700[_0xa29e('0x43')]=_0x420965;return _0x3c5700;})[_0xa29e('0x25')](respondWithFilteredResult(_0x2f8185,_0x196938))[_0xa29e('0x44')](handleError(_0x2f8185,null));};exports[_0xa29e('0x45')]=function(_0x26acb6,_0x458469){var _0x1e08ae={'raw':!![],'where':{'id':_0x26acb6[_0xa29e('0x46')]['id']}},_0x3d6d56={};_0x3d6d56['model']=_[_0xa29e('0x2d')](db[_0xa29e('0x41')][_0xa29e('0x2b')]);_0x3d6d56[_0xa29e('0x2e')]=_['keys'](_0x26acb6[_0xa29e('0x2e')]);_0x3d6d56[_0xa29e('0x2f')]=_['intersection'](_0x3d6d56['model'],_0x3d6d56['query']);_0x1e08ae['attributes']=_[_0xa29e('0x30')](_0x3d6d56[_0xa29e('0x2c')],qs[_0xa29e('0x32')](_0x26acb6[_0xa29e('0x2e')][_0xa29e('0x32')]));_0x1e08ae['attributes']=_0x1e08ae[_0xa29e('0x31')]['length']?_0x1e08ae[_0xa29e('0x31')]:_0x3d6d56[_0xa29e('0x2c')];if(_0x26acb6[_0xa29e('0x2e')]['includeAll']){_0x1e08ae['include']=[{'all':!![]}];}_0x1e08ae=_[_0xa29e('0x3a')]({},_0x1e08ae,_0x26acb6[_0xa29e('0x47')]);return db[_0xa29e('0x41')]['find'](_0x1e08ae)[_0xa29e('0x25')](handleEntityNotFound(_0x458469,null))[_0xa29e('0x25')](respondWithResult(_0x458469,null))[_0xa29e('0x44')](handleError(_0x458469,null));};exports['create']=function(_0x254f7f,_0xd143da){return db[_0xa29e('0x41')][_0xa29e('0x48')](_0x254f7f[_0xa29e('0x49')],{})[_0xa29e('0x25')](respondWithResult(_0xd143da,0xc9))[_0xa29e('0x44')](handleError(_0xd143da,null));};exports[_0xa29e('0x23')]=function(_0x179cb9,_0x56049e){if(_0x179cb9['body']['id']){delete _0x179cb9[_0xa29e('0x49')]['id'];}return db[_0xa29e('0x41')]['find']({'where':{'id':_0x179cb9['params']['id']}})['then'](handleEntityNotFound(_0x56049e,null))[_0xa29e('0x25')](saveUpdates(_0x179cb9[_0xa29e('0x49')],null))['then'](respondWithResult(_0x56049e,null))['catch'](handleError(_0x56049e,null));};exports[_0xa29e('0x24')]=function(_0x563dba,_0x12e642){return db[_0xa29e('0x41')][_0xa29e('0x4a')]({'where':{'id':_0x563dba[_0xa29e('0x46')]['id']}})[_0xa29e('0x25')](handleEntityNotFound(_0x12e642,null))['then'](removeEntity(_0x12e642,null))['catch'](handleError(_0x12e642,null));}; \ No newline at end of file +var _0x8c16=['../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','reject','update','destroy','error','name','send','index','SquareMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','map','VIRTUAL','field','then','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x23f01d,_0x1bdf58){var _0x46ffe2=function(_0x5284bb){while(--_0x5284bb){_0x23f01d['push'](_0x23f01d['shift']());}};_0x46ffe2(++_0x1bdf58);}(_0x8c16,0xb3));var _0x68c1=function(_0x41a315,_0xb612b){_0x41a315=_0x41a315-0x0;var _0x206e41=_0x8c16[_0x41a315];return _0x206e41;};'use strict';var pdf=require(_0x68c1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x68c1('0x1'));var jsonpatch=require(_0x68c1('0x2'));var rp=require(_0x68c1('0x3'));var moment=require(_0x68c1('0x4'));var BPromise=require(_0x68c1('0x5'));var Mustache=require(_0x68c1('0x6'));var util=require(_0x68c1('0x7'));var path=require(_0x68c1('0x8'));var sox=require('sox');var csv=require(_0x68c1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x68c1('0xa'));var squel=require(_0x68c1('0xb'));var crypto=require(_0x68c1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x68c1('0xd'));var toCsv=require(_0x68c1('0x9'));var querystring=require(_0x68c1('0xe'));var Papa=require(_0x68c1('0xf'));var Redis=require(_0x68c1('0x10'));var authService=require(_0x68c1('0x11'));var qs=require(_0x68c1('0x12'));var hardwareService=require(_0x68c1('0x13'));var logger=require(_0x68c1('0x14'))(_0x68c1('0x15'));var utils=require(_0x68c1('0x16'));var config=require(_0x68c1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x185be2,_0x4df41c){_0x4df41c=_0x4df41c||0xcc;return function(_0x345cc8){if(_0x345cc8){return _0x185be2[_0x68c1('0x18')](_0x4df41c);}return _0x185be2['status'](_0x4df41c)[_0x68c1('0x19')]();};}function respondWithResult(_0x9e6eeb,_0x2e6d7d){_0x2e6d7d=_0x2e6d7d||0xc8;return function(_0x335bce){if(_0x335bce){return _0x9e6eeb[_0x68c1('0x1a')](_0x2e6d7d)[_0x68c1('0x1b')](_0x335bce);}};}function respondWithFilteredResult(_0x1eef30,_0x1c5fed){return function(_0x4248c5){if(_0x4248c5){var _0x540ae4=_0x4248c5[_0x68c1('0x1c')],_0x4300ba=_0x1c5fed[_0x68c1('0x1d')],_0x3dc6ba=_0x1c5fed[_0x68c1('0x1d')]+_0x1c5fed[_0x68c1('0x1e')],_0x2cab27;if(_0x3dc6ba>=_0x540ae4){_0x3dc6ba=_0x540ae4;_0x2cab27=0xc8;}else{_0x2cab27=0xce;}_0x1eef30['status'](_0x2cab27);return _0x1eef30[_0x68c1('0x1f')]('Content-Range',_0x4300ba+'-'+_0x3dc6ba+'/'+_0x540ae4)[_0x68c1('0x1b')](_0x4248c5);}return null;};}function patchUpdates(_0x307f4f){return function(_0x390de9){try{jsonpatch['apply'](_0x390de9,_0x307f4f,!![]);}catch(_0x3abc0a){return BPromise[_0x68c1('0x20')](_0x3abc0a);}return _0x390de9['save']();};}function saveUpdates(_0x3a1a3f,_0x292957){return function(_0x2df308){if(_0x2df308){return _0x2df308[_0x68c1('0x21')](_0x3a1a3f)['then'](function(_0x109489){return _0x109489;});}return null;};}function removeEntity(_0x28ba68,_0x30e026){return function(_0xd8409e){if(_0xd8409e){return _0xd8409e[_0x68c1('0x22')]()['then'](function(){_0x28ba68['status'](0xcc)[_0x68c1('0x19')]();});}};}function handleEntityNotFound(_0x21e2ad,_0x21a3fb){return function(_0x429d0c){if(!_0x429d0c){_0x21e2ad['sendStatus'](0x194);}return _0x429d0c;};}function handleError(_0x5393f6,_0x38f9a5){_0x38f9a5=_0x38f9a5||0x1f4;return function(_0x159357){logger[_0x68c1('0x23')](_0x159357['stack']);if(_0x159357[_0x68c1('0x24')]){delete _0x159357[_0x68c1('0x24')];}_0x5393f6['status'](_0x38f9a5)[_0x68c1('0x25')](_0x159357);};}exports[_0x68c1('0x26')]=function(_0x29ceb6,_0x3f8efd){var _0x5aaadb={},_0x4852c2={},_0x182180={'count':0x0,'rows':[]};var _0xfd6bd4=db[_0x68c1('0x27')][_0x68c1('0x28')];_0x4852c2[_0x68c1('0x29')]=_[_0x68c1('0x2a')](_0xfd6bd4);_0x4852c2[_0x68c1('0x2b')]=_[_0x68c1('0x2a')](_0x29ceb6[_0x68c1('0x2b')]);_0x4852c2[_0x68c1('0x2c')]=_[_0x68c1('0x2d')](_0x4852c2['model'],_0x4852c2[_0x68c1('0x2b')]);_0x5aaadb[_0x68c1('0x2e')]=_['intersection'](_0x4852c2[_0x68c1('0x29')],qs[_0x68c1('0x2f')](_0x29ceb6[_0x68c1('0x2b')][_0x68c1('0x2f')]));_0x5aaadb[_0x68c1('0x2e')]=_0x5aaadb[_0x68c1('0x2e')][_0x68c1('0x30')]?_0x5aaadb[_0x68c1('0x2e')]:_0x4852c2[_0x68c1('0x29')];if(!_0x29ceb6[_0x68c1('0x2b')]['hasOwnProperty']('nolimit')){_0x5aaadb[_0x68c1('0x1e')]=qs[_0x68c1('0x1e')](_0x29ceb6[_0x68c1('0x2b')][_0x68c1('0x1e')]);_0x5aaadb[_0x68c1('0x1d')]=qs[_0x68c1('0x1d')](_0x29ceb6[_0x68c1('0x2b')]['offset']);}_0x5aaadb[_0x68c1('0x31')]=qs[_0x68c1('0x32')](_0x29ceb6[_0x68c1('0x2b')]['sort']);_0x5aaadb[_0x68c1('0x33')]=qs[_0x68c1('0x2c')](_['pick'](_0x29ceb6['query'],_0x4852c2[_0x68c1('0x2c')]));if(_0x29ceb6[_0x68c1('0x2b')][_0x68c1('0x34')]){_0x5aaadb[_0x68c1('0x33')]=_[_0x68c1('0x35')](_0x5aaadb['where'],{'$or':_[_0x68c1('0x36')](_0xfd6bd4,function(_0x167e63){if(_0x167e63['type']['key']!==_0x68c1('0x37')){var _0x5ac179={};_0x5ac179[_0x167e63[_0x68c1('0x38')]]={'$like':'%'+_0x29ceb6['query'][_0x68c1('0x34')]+'%'};return _0x5ac179;}})});}_0x5aaadb=_['merge']({},_0x5aaadb,_0x29ceb6['options']);var _0x1fcb72={'where':_0x5aaadb[_0x68c1('0x33')]};return db[_0x68c1('0x27')][_0x68c1('0x1c')](_0x1fcb72)[_0x68c1('0x39')](function(_0x1dfa49){_0x182180['count']=_0x1dfa49;if(_0x29ceb6[_0x68c1('0x2b')][_0x68c1('0x3a')]){_0x5aaadb[_0x68c1('0x3b')]=[{'all':!![]}];}return db[_0x68c1('0x27')]['findAll'](_0x5aaadb);})['then'](function(_0x54ed26){_0x182180[_0x68c1('0x3c')]=_0x54ed26;return _0x182180;})[_0x68c1('0x39')](respondWithFilteredResult(_0x3f8efd,_0x5aaadb))[_0x68c1('0x3d')](handleError(_0x3f8efd,null));};exports[_0x68c1('0x3e')]=function(_0x177bbd,_0x410baa){var _0x456429={'raw':!![],'where':{'id':_0x177bbd[_0x68c1('0x3f')]['id']}},_0x5586cd={};_0x5586cd[_0x68c1('0x29')]=_['keys'](db[_0x68c1('0x27')][_0x68c1('0x28')]);_0x5586cd[_0x68c1('0x2b')]=_[_0x68c1('0x2a')](_0x177bbd['query']);_0x5586cd['filters']=_[_0x68c1('0x2d')](_0x5586cd[_0x68c1('0x29')],_0x5586cd['query']);_0x456429[_0x68c1('0x2e')]=_[_0x68c1('0x2d')](_0x5586cd[_0x68c1('0x29')],qs[_0x68c1('0x2f')](_0x177bbd[_0x68c1('0x2b')][_0x68c1('0x2f')]));_0x456429[_0x68c1('0x2e')]=_0x456429['attributes'][_0x68c1('0x30')]?_0x456429[_0x68c1('0x2e')]:_0x5586cd[_0x68c1('0x29')];if(_0x177bbd[_0x68c1('0x2b')][_0x68c1('0x3a')]){_0x456429['include']=[{'all':!![]}];}_0x456429=_[_0x68c1('0x35')]({},_0x456429,_0x177bbd['options']);return db[_0x68c1('0x27')][_0x68c1('0x40')](_0x456429)[_0x68c1('0x39')](handleEntityNotFound(_0x410baa,null))[_0x68c1('0x39')](respondWithResult(_0x410baa,null))[_0x68c1('0x3d')](handleError(_0x410baa,null));};exports[_0x68c1('0x41')]=function(_0x56ffd6,_0x297090){return db[_0x68c1('0x27')][_0x68c1('0x41')](_0x56ffd6['body'],{})[_0x68c1('0x39')](respondWithResult(_0x297090,0xc9))['catch'](handleError(_0x297090,null));};exports[_0x68c1('0x21')]=function(_0x1b19bd,_0x14543d){if(_0x1b19bd[_0x68c1('0x42')]['id']){delete _0x1b19bd['body']['id'];}return db['SquareMessage'][_0x68c1('0x40')]({'where':{'id':_0x1b19bd[_0x68c1('0x3f')]['id']}})[_0x68c1('0x39')](handleEntityNotFound(_0x14543d,null))[_0x68c1('0x39')](saveUpdates(_0x1b19bd['body'],null))[_0x68c1('0x39')](respondWithResult(_0x14543d,null))['catch'](handleError(_0x14543d,null));};exports['destroy']=function(_0x5e9fd0,_0x195bcc){return db['SquareMessage'][_0x68c1('0x40')]({'where':{'id':_0x5e9fd0[_0x68c1('0x3f')]['id']}})[_0x68c1('0x39')](handleEntityNotFound(_0x195bcc,null))[_0x68c1('0x39')](removeEntity(_0x195bcc,null))[_0x68c1('0x3d')](handleError(_0x195bcc,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 20bea71..88eca77 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 _0xdad7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareMessage','square_messages','lodash'];(function(_0x56cbb4,_0x4adb66){var _0x13ae49=function(_0x599e68){while(--_0x599e68){_0x56cbb4['push'](_0x56cbb4['shift']());}};_0x13ae49(++_0x4adb66);}(_0xdad7,0x1e0));var _0x7dad=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xdad7[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x7dad('0x0'));var util=require(_0x7dad('0x1'));var logger=require(_0x7dad('0x2'))(_0x7dad('0x3'));var moment=require(_0x7dad('0x4'));var BPromise=require(_0x7dad('0x5'));var rp=require(_0x7dad('0x6'));var fs=require('fs');var path=require(_0x7dad('0x7'));var rimraf=require(_0x7dad('0x8'));var config=require(_0x7dad('0x9'));var attributes=require('./squareMessage.attributes');module[_0x7dad('0xa')]=function(_0x26420c,_0x24dc7c){return _0x26420c['define'](_0x7dad('0xb'),attributes,{'tableName':_0x7dad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd962=['SquareMessage','square_messages','lodash','util','../../config/logger','bluebird','rimraf','./squareMessage.attributes','exports'];(function(_0x368efb,_0xf4dcb1){var _0xe1bd52=function(_0x2135c7){while(--_0x2135c7){_0x368efb['push'](_0x368efb['shift']());}};_0xe1bd52(++_0xf4dcb1);}(_0xd962,0x1c4));var _0x2d96=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd962[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x2d96('0x0'));var util=require(_0x2d96('0x1'));var logger=require(_0x2d96('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2d96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2d96('0x4'));var config=require('../../config/environment');var attributes=require(_0x2d96('0x5'));module[_0x2d96('0x6')]=function(_0x57322a,_0x447a63){return _0x57322a['define'](_0x2d96('0x7'),attributes,{'tableName':_0x2d96('0x8'),'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 2a0b090..07e9f64 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 _0x2a21=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSquareMessage','SquareMessage','options','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xe1f1d4,_0x1d6e42){var _0x5af46f=function(_0x4ac0a6){while(--_0x4ac0a6){_0xe1f1d4['push'](_0xe1f1d4['shift']());}};_0x5af46f(++_0x1d6e42);}(_0x2a21,0x78));var _0x12a2=function(_0x312e52,_0x7b6a6e){_0x312e52=_0x312e52-0x0;var _0x245994=_0x2a21[_0x312e52];return _0x245994;};'use strict';var _=require(_0x12a2('0x0'));var util=require('util');var moment=require(_0x12a2('0x1'));var BPromise=require(_0x12a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12a2('0x3'));var db=require(_0x12a2('0x4'))['db'];var utils=require(_0x12a2('0x5'));var logger=require(_0x12a2('0x6'))(_0x12a2('0x7'));var config=require(_0x12a2('0x8'));var jayson=require(_0x12a2('0x9'));var client=jayson[_0x12a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52c0c8,_0x5134b9,_0x2691a8){return new BPromise(function(_0x4981a2,_0x209274){return client[_0x12a2('0xb')](_0x52c0c8,_0x2691a8)[_0x12a2('0xc')](function(_0x590322){logger[_0x12a2('0xd')](_0x12a2('0xe'),_0x5134b9,'request\x20sent');logger[_0x12a2('0xf')](_0x12a2('0x10'),_0x5134b9,_0x12a2('0x11'),JSON[_0x12a2('0x12')](_0x590322));if(_0x590322[_0x12a2('0x13')]){if(_0x590322[_0x12a2('0x13')]['code']===0x1f4){logger[_0x12a2('0x13')](_0x12a2('0xe'),_0x5134b9,_0x590322[_0x12a2('0x13')][_0x12a2('0x14')]);return _0x209274(_0x590322[_0x12a2('0x13')][_0x12a2('0x14')]);}logger[_0x12a2('0x13')](_0x12a2('0xe'),_0x5134b9,_0x590322[_0x12a2('0x13')][_0x12a2('0x14')]);return _0x4981a2(_0x590322['error'][_0x12a2('0x14')]);}else{logger[_0x12a2('0xd')](_0x12a2('0xe'),_0x5134b9,_0x12a2('0x11'));_0x4981a2(_0x590322['result'][_0x12a2('0x14')]);}})[_0x12a2('0x15')](function(_0x1bad16){logger[_0x12a2('0x13')]('SquareMessage,\x20%s,\x20%s',_0x5134b9,_0x1bad16);_0x209274(_0x1bad16);});});}exports[_0x12a2('0x16')]=function(_0x14e0a1){var _0x2cee1f=this;return new Promise(function(_0x24bd35,_0x5d9e6f){return db[_0x12a2('0x17')]['create'](_0x14e0a1['body'],{'raw':_0x14e0a1[_0x12a2('0x18')]?_0x14e0a1[_0x12a2('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1fd7d3){logger['info']('CreateSquareMessage',_0x14e0a1);logger[_0x12a2('0xf')]('CreateSquareMessage',_0x14e0a1,JSON[_0x12a2('0x12')](_0x1fd7d3));_0x24bd35(_0x1fd7d3);})[_0x12a2('0x15')](function(_0x5763c7){logger['error'](_0x12a2('0x16'),_0x5763c7[_0x12a2('0x14')],_0x14e0a1);_0x5d9e6f(_0x2cee1f[_0x12a2('0x13')](0x1f4,_0x5763c7['message']));});});}; \ No newline at end of file +var _0x43de=['info','CreateSquareMessage','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','catch','create','body','options','raw','then'];(function(_0x379517,_0x21ffb1){var _0x1ffc51=function(_0x517e5c){while(--_0x517e5c){_0x379517['push'](_0x379517['shift']());}};_0x1ffc51(++_0x21ffb1);}(_0x43de,0x1d2));var _0xe43d=function(_0x3642fe,_0x1ace75){_0x3642fe=_0x3642fe-0x0;var _0x13ff46=_0x43de[_0x3642fe];return _0x13ff46;};'use strict';var _=require(_0xe43d('0x0'));var util=require(_0xe43d('0x1'));var moment=require('moment');var BPromise=require(_0xe43d('0x2'));var rs=require(_0xe43d('0x3'));var fs=require('fs');var Redis=require(_0xe43d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe43d('0x5'));var logger=require(_0xe43d('0x6'))(_0xe43d('0x7'));var config=require(_0xe43d('0x8'));var jayson=require(_0xe43d('0x9'));var client=jayson[_0xe43d('0xa')][_0xe43d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44b215,_0x114f20,_0x28e3fc){return new BPromise(function(_0x468cbf,_0x5c71d3){return client[_0xe43d('0xc')](_0x44b215,_0x28e3fc)['then'](function(_0x1e5e35){logger['info']('SquareMessage,\x20%s,\x20%s',_0x114f20,_0xe43d('0xd'));logger[_0xe43d('0xe')](_0xe43d('0xf'),_0x114f20,_0xe43d('0xd'),JSON[_0xe43d('0x10')](_0x1e5e35));if(_0x1e5e35[_0xe43d('0x11')]){if(_0x1e5e35[_0xe43d('0x11')]['code']===0x1f4){logger[_0xe43d('0x11')](_0xe43d('0x12'),_0x114f20,_0x1e5e35[_0xe43d('0x11')][_0xe43d('0x13')]);return _0x5c71d3(_0x1e5e35[_0xe43d('0x11')][_0xe43d('0x13')]);}logger[_0xe43d('0x11')]('SquareMessage,\x20%s,\x20%s',_0x114f20,_0x1e5e35['error'][_0xe43d('0x13')]);return _0x468cbf(_0x1e5e35[_0xe43d('0x11')][_0xe43d('0x13')]);}else{logger['info'](_0xe43d('0x12'),_0x114f20,_0xe43d('0xd'));_0x468cbf(_0x1e5e35[_0xe43d('0x14')][_0xe43d('0x13')]);}})[_0xe43d('0x15')](function(_0x244ae7){logger[_0xe43d('0x11')]('SquareMessage,\x20%s,\x20%s',_0x114f20,_0x244ae7);_0x5c71d3(_0x244ae7);});});}exports['CreateSquareMessage']=function(_0x4aed85){var _0x560950=this;return new Promise(function(_0x38e341,_0x394459){return db['SquareMessage'][_0xe43d('0x16')](_0x4aed85[_0xe43d('0x17')],{'raw':_0x4aed85[_0xe43d('0x18')]?_0x4aed85[_0xe43d('0x18')][_0xe43d('0x19')]===undefined?!![]:![]:!![]})[_0xe43d('0x1a')](function(_0x1b0140){logger[_0xe43d('0x1b')](_0xe43d('0x1c'),_0x4aed85);logger[_0xe43d('0xe')](_0xe43d('0x1c'),_0x4aed85,JSON['stringify'](_0x1b0140));_0x38e341(_0x1b0140);})[_0xe43d('0x15')](function(_0x362d56){logger[_0xe43d('0x11')](_0xe43d('0x1c'),_0x362d56[_0xe43d('0x13')],_0x4aed85);_0x394459(_0x560950[_0xe43d('0x11')](0x1f4,_0x362d56[_0xe43d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1b25abd..16f5e45 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 _0xd353=['/:id/test','15s','test','post','create','put','update','multer','util','connect-timeout','express','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x53f800,_0x1e96c4){var _0x12eba4=function(_0x2737ee){while(--_0x2737ee){_0x53f800['push'](_0x53f800['shift']());}};_0x12eba4(++_0x1e96c4);}(_0xd353,0x7e));var _0x3d35=function(_0x3ea961,_0x6b803b){_0x3ea961=_0x3ea961-0x0;var _0xda6a39=_0xd353[_0x3ea961];return _0xda6a39;};'use strict';var multer=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var path=require('path');var timeout=require(_0x3d35('0x2'));var express=require(_0x3d35('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3d35('0x4'));var config=require('../../config/environment');var controller=require(_0x3d35('0x5'));router[_0x3d35('0x6')]('/',auth[_0x3d35('0x7')](),controller[_0x3d35('0x8')]);router[_0x3d35('0x6')](_0x3d35('0x9'),auth[_0x3d35('0x7')](),controller['show']);router[_0x3d35('0x6')](_0x3d35('0xa'),auth[_0x3d35('0x7')](),timeout(_0x3d35('0xb')),controller[_0x3d35('0xc')]);router[_0x3d35('0xd')]('/',auth[_0x3d35('0x7')](),controller[_0x3d35('0xe')]);router[_0x3d35('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3d35('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x98b8=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put','update'];(function(_0x1388b3,_0x468172){var _0xe3b71b=function(_0x5c803f){while(--_0x5c803f){_0x1388b3['push'](_0x1388b3['shift']());}};_0xe3b71b(++_0x468172);}(_0x98b8,0x93));var _0x898b=function(_0x262240,_0x2bac29){_0x262240=_0x262240-0x0;var _0x149ff9=_0x98b8[_0x262240];return _0x149ff9;};'use strict';var multer=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var path=require(_0x898b('0x2'));var timeout=require(_0x898b('0x3'));var express=require(_0x898b('0x4'));var router=express[_0x898b('0x5')]();var auth=require(_0x898b('0x6'));var interaction=require(_0x898b('0x7'));var config=require(_0x898b('0x8'));var controller=require(_0x898b('0x9'));router[_0x898b('0xa')]('/',auth[_0x898b('0xb')](),controller[_0x898b('0xc')]);router[_0x898b('0xa')](_0x898b('0xd'),auth['isAuthenticated'](),controller[_0x898b('0xe')]);router[_0x898b('0xa')](_0x898b('0xf'),auth[_0x898b('0xb')](),timeout(_0x898b('0x10')),controller[_0x898b('0x11')]);router[_0x898b('0x12')]('/',auth[_0x898b('0xb')](),controller['create']);router[_0x898b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x898b('0x14')]);router[_0x898b('0x15')](_0x898b('0xd'),auth[_0x898b('0xb')](),controller[_0x898b('0x16')]);module[_0x898b('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 7e51a15..b7b817a 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 _0xacce=['STRING','name','exports'];(function(_0x14a516,_0x5dee29){var _0x51a308=function(_0x326394){while(--_0x326394){_0x14a516['push'](_0x14a516['shift']());}};_0x51a308(++_0x5dee29);}(_0xacce,0x71));var _0xeacc=function(_0x77add,_0x2016b8){_0x77add=_0x77add-0x0;var _0xa1b62d=_0xacce[_0x77add];return _0xa1b62d;};'use strict';var Sequelize=require('sequelize');module[_0xeacc('0x0')]={'name':{'type':Sequelize[_0xeacc('0x1')],'unique':_0xeacc('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xeacc('0x1')]},'description':{'type':Sequelize[_0xeacc('0x1')]}}; \ No newline at end of file +var _0x1884=['exports','STRING','sequelize'];(function(_0x593f03,_0x4af84a){var _0x178299=function(_0x284500){while(--_0x284500){_0x593f03['push'](_0x593f03['shift']());}};_0x178299(++_0x4af84a);}(_0x1884,0xc8));var _0x4188=function(_0x4a95f7,_0x3de75c){_0x4a95f7=_0x4a95f7-0x0;var _0x54f350=_0x1884[_0x4a95f7];return _0x54f350;};'use strict';var Sequelize=require(_0x4188('0x0'));module[_0x4188('0x1')]={'name':{'type':Sequelize[_0x4188('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x4188('0x2')]},'description':{'type':Sequelize[_0x4188('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 499c8c0..e2ca52d 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 _0x986e=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','SquareOdbc','includeAll','findAll','show','params','length','include','find','catch','create','get','user','ODBC','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3feb27,_0x11b912){var _0x5e4cd4=function(_0x2d4698){while(--_0x2d4698){_0x3feb27['push'](_0x3feb27['shift']());}};_0x5e4cd4(++_0x11b912);}(_0x986e,0xfb));var _0xe986=function(_0x37c981,_0x22a780){_0x37c981=_0x37c981-0x0;var _0x4deca9=_0x986e[_0x37c981];return _0x4deca9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe986('0x0'));var zipdir=require(_0xe986('0x1'));var jsonpatch=require(_0xe986('0x2'));var rp=require(_0xe986('0x3'));var moment=require(_0xe986('0x4'));var BPromise=require(_0xe986('0x5'));var Mustache=require(_0xe986('0x6'));var util=require(_0xe986('0x7'));var path=require('path');var sox=require(_0xe986('0x8'));var csv=require(_0xe986('0x9'));var ejs=require(_0xe986('0xa'));var fs=require('fs');var _=require(_0xe986('0xb'));var squel=require(_0xe986('0xc'));var crypto=require(_0xe986('0xd'));var jsforce=require(_0xe986('0xe'));var deskjs=require(_0xe986('0xf'));var toCsv=require(_0xe986('0x9'));var querystring=require(_0xe986('0x10'));var Papa=require(_0xe986('0x11'));var Redis=require(_0xe986('0x12'));var authService=require(_0xe986('0x13'));var qs=require(_0xe986('0x14'));var hardwareService=require(_0xe986('0x15'));var logger=require(_0xe986('0x16'))(_0xe986('0x17'));var utils=require(_0xe986('0x18'));var config=require(_0xe986('0x19'));var db=require(_0xe986('0x1a'))['db'];function respondWithStatusCode(_0x40a5cd,_0xfa56e2){_0xfa56e2=_0xfa56e2||0xcc;return function(_0x492a87){if(_0x492a87){return _0x40a5cd['sendStatus'](_0xfa56e2);}return _0x40a5cd[_0xe986('0x1b')](_0xfa56e2)[_0xe986('0x1c')]();};}function respondWithResult(_0x5c3468,_0x56ae18){_0x56ae18=_0x56ae18||0xc8;return function(_0x3af9bf){if(_0x3af9bf){return _0x5c3468[_0xe986('0x1b')](_0x56ae18)[_0xe986('0x1d')](_0x3af9bf);}};}function respondWithFilteredResult(_0x381ebf,_0x1a5435){return function(_0x553154){if(_0x553154){var _0x261265=_0x553154[_0xe986('0x1e')],_0xde6bf5=_0x1a5435[_0xe986('0x1f')],_0x4e7f0b=_0x1a5435[_0xe986('0x1f')]+_0x1a5435[_0xe986('0x20')],_0x25747d;if(_0x4e7f0b>=_0x261265){_0x4e7f0b=_0x261265;_0x25747d=0xc8;}else{_0x25747d=0xce;}_0x381ebf[_0xe986('0x1b')](_0x25747d);return _0x381ebf[_0xe986('0x21')]('Content-Range',_0xde6bf5+'-'+_0x4e7f0b+'/'+_0x261265)[_0xe986('0x1d')](_0x553154);}return null;};}function patchUpdates(_0x219a00){return function(_0x1c9d94){try{jsonpatch['apply'](_0x1c9d94,_0x219a00,!![]);}catch(_0x1fc31c){return BPromise['reject'](_0x1fc31c);}return _0x1c9d94[_0xe986('0x22')]();};}function saveUpdates(_0x4bc61d,_0x5df8bb){return function(_0x548cdb){if(_0x548cdb){return _0x548cdb[_0xe986('0x23')](_0x4bc61d)[_0xe986('0x24')](function(_0x5a45ae){return _0x5a45ae;});}return null;};}function removeEntity(_0x162474,_0x4f83aa){return function(_0x25d475){if(_0x25d475){return _0x25d475[_0xe986('0x25')]()[_0xe986('0x24')](function(){var _0x1303a7=_0x25d475['get']({'plain':!![]});var _0x5c8af6='ODBC';return db[_0xe986('0x26')][_0xe986('0x25')]({'where':{'type':_0x5c8af6,'resourceId':_0x1303a7['id']}})[_0xe986('0x24')](function(){return _0x25d475;});})[_0xe986('0x24')](function(){_0x162474['status'](0xcc)[_0xe986('0x1c')]();});}};}function handleEntityNotFound(_0x19ed80,_0x450513){return function(_0x2d4e0b){if(!_0x2d4e0b){_0x19ed80['sendStatus'](0x194);}return _0x2d4e0b;};}function handleError(_0x437077,_0x11b6d7){_0x11b6d7=_0x11b6d7||0x1f4;return function(_0xe5906a){logger[_0xe986('0x27')](_0xe5906a[_0xe986('0x28')]);if(_0xe5906a[_0xe986('0x29')]){delete _0xe5906a[_0xe986('0x29')];}_0x437077[_0xe986('0x1b')](_0x11b6d7)[_0xe986('0x2a')](_0xe5906a);};}exports[_0xe986('0x2b')]=function(_0x7b5a8c,_0xa1e8e3){var _0x2e17d9={},_0x486f0d={},_0x4a1dcd={'count':0x0,'rows':[]};var _0x5c8899=db['SquareOdbc'][_0xe986('0x2c')];_0x486f0d[_0xe986('0x2d')]=_[_0xe986('0x2e')](_0x5c8899);_0x486f0d[_0xe986('0x2f')]=_[_0xe986('0x2e')](_0x7b5a8c[_0xe986('0x2f')]);_0x486f0d[_0xe986('0x30')]=_[_0xe986('0x31')](_0x486f0d[_0xe986('0x2d')],_0x486f0d['query']);_0x2e17d9['attributes']=_[_0xe986('0x31')](_0x486f0d['model'],qs[_0xe986('0x32')](_0x7b5a8c[_0xe986('0x2f')]['fields']));_0x2e17d9['attributes']=_0x2e17d9[_0xe986('0x33')]['length']?_0x2e17d9[_0xe986('0x33')]:_0x486f0d[_0xe986('0x2d')];if(!_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x34')]('nolimit')){_0x2e17d9[_0xe986('0x20')]=qs[_0xe986('0x20')](_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x20')]);_0x2e17d9['offset']=qs[_0xe986('0x1f')](_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x1f')]);}_0x2e17d9[_0xe986('0x35')]=qs['sort'](_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x36')]);_0x2e17d9[_0xe986('0x37')]=qs['filters'](_['pick'](_0x7b5a8c[_0xe986('0x2f')],_0x486f0d[_0xe986('0x30')]));if(_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x38')]){_0x2e17d9[_0xe986('0x37')]=_[_0xe986('0x39')](_0x2e17d9[_0xe986('0x37')],{'$or':_[_0xe986('0x3a')](_0x5c8899,function(_0x59c3b1){if(_0x59c3b1[_0xe986('0x3b')][_0xe986('0x3c')]!==_0xe986('0x3d')){var _0x2cd416={};_0x2cd416[_0x59c3b1[_0xe986('0x3e')]]={'$like':'%'+_0x7b5a8c['query']['filter']+'%'};return _0x2cd416;}})});}_0x2e17d9=_[_0xe986('0x39')]({},_0x2e17d9,_0x7b5a8c[_0xe986('0x3f')]);var _0x446c85={'where':_0x2e17d9[_0xe986('0x37')]};return db[_0xe986('0x40')]['count'](_0x446c85)[_0xe986('0x24')](function(_0x126ac7){_0x4a1dcd[_0xe986('0x1e')]=_0x126ac7;if(_0x7b5a8c[_0xe986('0x2f')][_0xe986('0x41')]){_0x2e17d9['include']=[{'all':!![]}];}return db[_0xe986('0x40')][_0xe986('0x42')](_0x2e17d9);})[_0xe986('0x24')](function(_0x1ba0f2){_0x4a1dcd['rows']=_0x1ba0f2;return _0x4a1dcd;})[_0xe986('0x24')](respondWithFilteredResult(_0xa1e8e3,_0x2e17d9))['catch'](handleError(_0xa1e8e3,null));};exports[_0xe986('0x43')]=function(_0x21368b,_0x390e5e){var _0x4bdf55={'raw':!![],'where':{'id':_0x21368b[_0xe986('0x44')]['id']}},_0x4d1562={};_0x4d1562[_0xe986('0x2d')]=_[_0xe986('0x2e')](db[_0xe986('0x40')][_0xe986('0x2c')]);_0x4d1562[_0xe986('0x2f')]=_[_0xe986('0x2e')](_0x21368b['query']);_0x4d1562['filters']=_[_0xe986('0x31')](_0x4d1562[_0xe986('0x2d')],_0x4d1562['query']);_0x4bdf55[_0xe986('0x33')]=_[_0xe986('0x31')](_0x4d1562[_0xe986('0x2d')],qs[_0xe986('0x32')](_0x21368b[_0xe986('0x2f')][_0xe986('0x32')]));_0x4bdf55[_0xe986('0x33')]=_0x4bdf55[_0xe986('0x33')][_0xe986('0x45')]?_0x4bdf55[_0xe986('0x33')]:_0x4d1562[_0xe986('0x2d')];if(_0x21368b['query'][_0xe986('0x41')]){_0x4bdf55[_0xe986('0x46')]=[{'all':!![]}];}_0x4bdf55=_['merge']({},_0x4bdf55,_0x21368b[_0xe986('0x3f')]);return db['SquareOdbc'][_0xe986('0x47')](_0x4bdf55)['then'](handleEntityNotFound(_0x390e5e,null))['then'](respondWithResult(_0x390e5e,null))[_0xe986('0x48')](handleError(_0x390e5e,null));};exports['create']=function(_0x1a6bc3,_0x5ede67){return db[_0xe986('0x40')][_0xe986('0x49')](_0x1a6bc3['body'],{})[_0xe986('0x24')](function(_0x19355f){var _0x1afa44=_0x1a6bc3['user'][_0xe986('0x4a')]({'plain':!![]});if(!_0x1afa44)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1afa44['role']===_0xe986('0x4b')){var _0x573de1=_0x19355f['get']({'plain':!![]});var _0x1cb69a=_0xe986('0x4c');return db[_0xe986('0x4d')][_0xe986('0x47')]({'where':{'name':_0x1cb69a,'userProfileId':_0x1afa44['userProfileId']},'raw':!![]})[_0xe986('0x24')](function(_0x30d55e){if(_0x30d55e&&_0x30d55e[_0xe986('0x4e')]===0x0){return db[_0xe986('0x26')][_0xe986('0x49')]({'name':_0x573de1[_0xe986('0x29')],'resourceId':_0x573de1['id'],'type':_0x30d55e['name'],'sectionId':_0x30d55e['id']},{})[_0xe986('0x24')](function(){return _0x19355f;});}else{return _0x19355f;}})[_0xe986('0x48')](function(_0x1b709c){logger[_0xe986('0x27')](_0xe986('0x4f'),_0x1b709c);throw _0x1b709c;});}return _0x19355f;})[_0xe986('0x24')](respondWithResult(_0x5ede67,0xc9))[_0xe986('0x48')](handleError(_0x5ede67,null));};exports[_0xe986('0x23')]=function(_0x120831,_0x459863){if(_0x120831[_0xe986('0x50')]['id']){delete _0x120831[_0xe986('0x50')]['id'];}return db['SquareOdbc'][_0xe986('0x47')]({'where':{'id':_0x120831['params']['id']}})[_0xe986('0x24')](handleEntityNotFound(_0x459863,null))[_0xe986('0x24')](saveUpdates(_0x120831[_0xe986('0x50')],null))[_0xe986('0x24')](respondWithResult(_0x459863,null))['catch'](handleError(_0x459863,null));};exports[_0xe986('0x25')]=function(_0x5ce756,_0x2ec386){return db[_0xe986('0x40')][_0xe986('0x47')]({'where':{'id':_0x5ce756['params']['id']}})[_0xe986('0x24')](handleEntityNotFound(_0x2ec386,null))[_0xe986('0x24')](removeEntity(_0x2ec386,null))['catch'](handleError(_0x2ec386,null));};exports[_0xe986('0x51')]=function(_0x3da90a,_0xf9df50,_0x20d695){var _0x1b79f5;return db[_0xe986('0x40')]['find']({'where':{'id':_0x3da90a['params']['id']},'attributes':['id','dsn']})[_0xe986('0x24')](handleEntityNotFound(_0xf9df50,null))['then'](function(_0x3243b3){if(_0x3243b3){var _0x295608=require(_0xe986('0x52'))();_0x295608['openSync'](_0x3243b3[_0xe986('0x53')]);_0x295608[_0xe986('0x54')]();return _0x3243b3;}})['then'](respondWithResult(_0xf9df50,null))['catch'](handleError(_0xf9df50,null));}; \ No newline at end of file +var _0x99ca=['params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','body','test','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ODBC','end','error','name','send','index','rawAttributes','model','keys','filters','attributes','intersection','fields','query','limit','order','sort','where','pick','filter','map','key','field','merge','SquareOdbc','includeAll','include','findAll','rows','catch','show'];(function(_0xb6d7c7,_0x2791ce){var _0x1b3603=function(_0x48aae9){while(--_0x48aae9){_0xb6d7c7['push'](_0xb6d7c7['shift']());}};_0x1b3603(++_0x2791ce);}(_0x99ca,0xf5));var _0xa99c=function(_0xeb437b,_0x23b3fc){_0xeb437b=_0xeb437b-0x0;var _0x31bd40=_0x99ca[_0xeb437b];return _0x31bd40;};'use strict';var pdf=require(_0xa99c('0x0'));var emlformat=require(_0xa99c('0x1'));var rimraf=require(_0xa99c('0x2'));var zipdir=require(_0xa99c('0x3'));var jsonpatch=require(_0xa99c('0x4'));var rp=require('request-promise');var moment=require(_0xa99c('0x5'));var BPromise=require(_0xa99c('0x6'));var Mustache=require('mustache');var util=require(_0xa99c('0x7'));var path=require('path');var sox=require(_0xa99c('0x8'));var csv=require(_0xa99c('0x9'));var ejs=require(_0xa99c('0xa'));var fs=require('fs');var _=require(_0xa99c('0xb'));var squel=require(_0xa99c('0xc'));var crypto=require('crypto');var jsforce=require(_0xa99c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa99c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa99c('0xe'));var authService=require(_0xa99c('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa99c('0x10'));var logger=require(_0xa99c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xa99c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c47a7,_0x23c0f3){_0x23c0f3=_0x23c0f3||0xcc;return function(_0x35183f){if(_0x35183f){return _0x2c47a7['sendStatus'](_0x23c0f3);}return _0x2c47a7[_0xa99c('0x13')](_0x23c0f3)['end']();};}function respondWithResult(_0x2df776,_0x44a4fe){_0x44a4fe=_0x44a4fe||0xc8;return function(_0x18e827){if(_0x18e827){return _0x2df776[_0xa99c('0x13')](_0x44a4fe)['json'](_0x18e827);}};}function respondWithFilteredResult(_0x4b0913,_0x30318c){return function(_0x460221){if(_0x460221){var _0x31be96=_0x460221[_0xa99c('0x14')],_0x4c5db1=_0x30318c[_0xa99c('0x15')],_0x5618d3=_0x30318c[_0xa99c('0x15')]+_0x30318c['limit'],_0xb3b3fc;if(_0x5618d3>=_0x31be96){_0x5618d3=_0x31be96;_0xb3b3fc=0xc8;}else{_0xb3b3fc=0xce;}_0x4b0913['status'](_0xb3b3fc);return _0x4b0913[_0xa99c('0x16')](_0xa99c('0x17'),_0x4c5db1+'-'+_0x5618d3+'/'+_0x31be96)[_0xa99c('0x18')](_0x460221);}return null;};}function patchUpdates(_0x359930){return function(_0x450e52){try{jsonpatch[_0xa99c('0x19')](_0x450e52,_0x359930,!![]);}catch(_0x12cdf4){return BPromise[_0xa99c('0x1a')](_0x12cdf4);}return _0x450e52[_0xa99c('0x1b')]();};}function saveUpdates(_0x1ae19a,_0x32500c){return function(_0xec0c57){if(_0xec0c57){return _0xec0c57[_0xa99c('0x1c')](_0x1ae19a)[_0xa99c('0x1d')](function(_0x72692f){return _0x72692f;});}return null;};}function removeEntity(_0x320ef9,_0x34b848){return function(_0xef7fd9){if(_0xef7fd9){return _0xef7fd9[_0xa99c('0x1e')]()[_0xa99c('0x1d')](function(){var _0x44bf08=_0xef7fd9[_0xa99c('0x1f')]({'plain':!![]});var _0x594dcb=_0xa99c('0x20');return db['UserProfileResource'][_0xa99c('0x1e')]({'where':{'type':_0x594dcb,'resourceId':_0x44bf08['id']}})['then'](function(){return _0xef7fd9;});})[_0xa99c('0x1d')](function(){_0x320ef9[_0xa99c('0x13')](0xcc)[_0xa99c('0x21')]();});}};}function handleEntityNotFound(_0x580ee4,_0x52dc91){return function(_0x49aa38){if(!_0x49aa38){_0x580ee4['sendStatus'](0x194);}return _0x49aa38;};}function handleError(_0x4298a5,_0x14405a){_0x14405a=_0x14405a||0x1f4;return function(_0x4c9093){logger[_0xa99c('0x22')](_0x4c9093['stack']);if(_0x4c9093[_0xa99c('0x23')]){delete _0x4c9093[_0xa99c('0x23')];}_0x4298a5['status'](_0x14405a)[_0xa99c('0x24')](_0x4c9093);};}exports[_0xa99c('0x25')]=function(_0x1dd225,_0x2c462a){var _0x428b50={},_0x3a9325={},_0x23d393={'count':0x0,'rows':[]};var _0x14d663=db['SquareOdbc'][_0xa99c('0x26')];_0x3a9325[_0xa99c('0x27')]=_['keys'](_0x14d663);_0x3a9325['query']=_[_0xa99c('0x28')](_0x1dd225['query']);_0x3a9325[_0xa99c('0x29')]=_['intersection'](_0x3a9325[_0xa99c('0x27')],_0x3a9325['query']);_0x428b50[_0xa99c('0x2a')]=_[_0xa99c('0x2b')](_0x3a9325[_0xa99c('0x27')],qs[_0xa99c('0x2c')](_0x1dd225[_0xa99c('0x2d')]['fields']));_0x428b50[_0xa99c('0x2a')]=_0x428b50[_0xa99c('0x2a')]['length']?_0x428b50[_0xa99c('0x2a')]:_0x3a9325['model'];if(!_0x1dd225['query']['hasOwnProperty']('nolimit')){_0x428b50[_0xa99c('0x2e')]=qs[_0xa99c('0x2e')](_0x1dd225[_0xa99c('0x2d')]['limit']);_0x428b50[_0xa99c('0x15')]=qs[_0xa99c('0x15')](_0x1dd225[_0xa99c('0x2d')][_0xa99c('0x15')]);}_0x428b50[_0xa99c('0x2f')]=qs[_0xa99c('0x30')](_0x1dd225[_0xa99c('0x2d')][_0xa99c('0x30')]);_0x428b50[_0xa99c('0x31')]=qs[_0xa99c('0x29')](_[_0xa99c('0x32')](_0x1dd225[_0xa99c('0x2d')],_0x3a9325['filters']));if(_0x1dd225[_0xa99c('0x2d')][_0xa99c('0x33')]){_0x428b50['where']=_['merge'](_0x428b50['where'],{'$or':_[_0xa99c('0x34')](_0x14d663,function(_0x3b94ce){if(_0x3b94ce['type'][_0xa99c('0x35')]!=='VIRTUAL'){var _0x134345={};_0x134345[_0x3b94ce[_0xa99c('0x36')]]={'$like':'%'+_0x1dd225[_0xa99c('0x2d')][_0xa99c('0x33')]+'%'};return _0x134345;}})});}_0x428b50=_[_0xa99c('0x37')]({},_0x428b50,_0x1dd225['options']);var _0x3183b1={'where':_0x428b50[_0xa99c('0x31')]};return db[_0xa99c('0x38')][_0xa99c('0x14')](_0x3183b1)['then'](function(_0x54278c){_0x23d393['count']=_0x54278c;if(_0x1dd225[_0xa99c('0x2d')][_0xa99c('0x39')]){_0x428b50[_0xa99c('0x3a')]=[{'all':!![]}];}return db[_0xa99c('0x38')][_0xa99c('0x3b')](_0x428b50);})[_0xa99c('0x1d')](function(_0x2ecee0){_0x23d393[_0xa99c('0x3c')]=_0x2ecee0;return _0x23d393;})[_0xa99c('0x1d')](respondWithFilteredResult(_0x2c462a,_0x428b50))[_0xa99c('0x3d')](handleError(_0x2c462a,null));};exports[_0xa99c('0x3e')]=function(_0xcf0b25,_0x17cf91){var _0xfdbcfb={'raw':!![],'where':{'id':_0xcf0b25[_0xa99c('0x3f')]['id']}},_0x4a082b={};_0x4a082b[_0xa99c('0x27')]=_[_0xa99c('0x28')](db[_0xa99c('0x38')][_0xa99c('0x26')]);_0x4a082b[_0xa99c('0x2d')]=_[_0xa99c('0x28')](_0xcf0b25[_0xa99c('0x2d')]);_0x4a082b['filters']=_[_0xa99c('0x2b')](_0x4a082b[_0xa99c('0x27')],_0x4a082b[_0xa99c('0x2d')]);_0xfdbcfb[_0xa99c('0x2a')]=_[_0xa99c('0x2b')](_0x4a082b[_0xa99c('0x27')],qs[_0xa99c('0x2c')](_0xcf0b25[_0xa99c('0x2d')][_0xa99c('0x2c')]));_0xfdbcfb['attributes']=_0xfdbcfb[_0xa99c('0x2a')]['length']?_0xfdbcfb[_0xa99c('0x2a')]:_0x4a082b[_0xa99c('0x27')];if(_0xcf0b25[_0xa99c('0x2d')]['includeAll']){_0xfdbcfb[_0xa99c('0x3a')]=[{'all':!![]}];}_0xfdbcfb=_[_0xa99c('0x37')]({},_0xfdbcfb,_0xcf0b25[_0xa99c('0x40')]);return db[_0xa99c('0x38')]['find'](_0xfdbcfb)[_0xa99c('0x1d')](handleEntityNotFound(_0x17cf91,null))[_0xa99c('0x1d')](respondWithResult(_0x17cf91,null))['catch'](handleError(_0x17cf91,null));};exports[_0xa99c('0x41')]=function(_0x35379c,_0x2dbfc9){return db[_0xa99c('0x38')]['create'](_0x35379c['body'],{})[_0xa99c('0x1d')](function(_0x5c89d0){var _0x3bbfd8=_0x35379c[_0xa99c('0x42')][_0xa99c('0x1f')]({'plain':!![]});if(!_0x3bbfd8)throw new Error(_0xa99c('0x43'));if(_0x3bbfd8['role']==='user'){var _0xff2d2a=_0x5c89d0[_0xa99c('0x1f')]({'plain':!![]});var _0xa27391=_0xa99c('0x20');return db[_0xa99c('0x44')][_0xa99c('0x45')]({'where':{'name':_0xa27391,'userProfileId':_0x3bbfd8[_0xa99c('0x46')]},'raw':!![]})[_0xa99c('0x1d')](function(_0x1776c1){if(_0x1776c1&&_0x1776c1[_0xa99c('0x47')]===0x0){return db[_0xa99c('0x48')][_0xa99c('0x41')]({'name':_0xff2d2a['name'],'resourceId':_0xff2d2a['id'],'type':_0x1776c1[_0xa99c('0x23')],'sectionId':_0x1776c1['id']},{})['then'](function(){return _0x5c89d0;});}else{return _0x5c89d0;}})[_0xa99c('0x3d')](function(_0x45237e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45237e);throw _0x45237e;});}return _0x5c89d0;})[_0xa99c('0x1d')](respondWithResult(_0x2dbfc9,0xc9))[_0xa99c('0x3d')](handleError(_0x2dbfc9,null));};exports[_0xa99c('0x1c')]=function(_0x39bbca,_0x8f070e){if(_0x39bbca['body']['id']){delete _0x39bbca[_0xa99c('0x49')]['id'];}return db[_0xa99c('0x38')][_0xa99c('0x45')]({'where':{'id':_0x39bbca[_0xa99c('0x3f')]['id']}})[_0xa99c('0x1d')](handleEntityNotFound(_0x8f070e,null))[_0xa99c('0x1d')](saveUpdates(_0x39bbca[_0xa99c('0x49')],null))[_0xa99c('0x1d')](respondWithResult(_0x8f070e,null))[_0xa99c('0x3d')](handleError(_0x8f070e,null));};exports['destroy']=function(_0x4e10f9,_0x4d5eb6){return db[_0xa99c('0x38')][_0xa99c('0x45')]({'where':{'id':_0x4e10f9[_0xa99c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d5eb6,null))['then'](removeEntity(_0x4d5eb6,null))['catch'](handleError(_0x4d5eb6,null));};exports[_0xa99c('0x4a')]=function(_0x163cd5,_0x20aba5,_0x2bae90){var _0x51830d;return db['SquareOdbc']['find']({'where':{'id':_0x163cd5[_0xa99c('0x3f')]['id']},'attributes':['id',_0xa99c('0x4b')]})[_0xa99c('0x1d')](handleEntityNotFound(_0x20aba5,null))[_0xa99c('0x1d')](function(_0x3596ae){if(_0x3596ae){var _0x2e58a2=require('odbc')();_0x2e58a2['openSync'](_0x3596ae[_0xa99c('0x4b')]);_0x2e58a2[_0xa99c('0x4c')]();return _0x3596ae;}})[_0xa99c('0x1d')](respondWithResult(_0x20aba5,null))[_0xa99c('0x3d')](handleError(_0x20aba5,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e9307fb..135a680 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 _0x8849=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','util','../../config/logger','api','moment'];(function(_0x476dde,_0x2a5929){var _0x633179=function(_0x5524fc){while(--_0x5524fc){_0x476dde['push'](_0x476dde['shift']());}};_0x633179(++_0x2a5929);}(_0x8849,0x96));var _0x9884=function(_0x31487e,_0x37a977){_0x31487e=_0x31487e-0x0;var _0x307bcb=_0x8849[_0x31487e];return _0x307bcb;};'use strict';var _=require('lodash');var util=require(_0x9884('0x0'));var logger=require(_0x9884('0x1'))(_0x9884('0x2'));var moment=require(_0x9884('0x3'));var BPromise=require('bluebird');var rp=require(_0x9884('0x4'));var fs=require('fs');var path=require(_0x9884('0x5'));var rimraf=require(_0x9884('0x6'));var config=require(_0x9884('0x7'));var attributes=require(_0x9884('0x8'));module['exports']=function(_0x3266fd,_0x561a5c){return _0x3266fd['define'](_0x9884('0x9'),attributes,{'tableName':_0x9884('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ea1=['lodash','../../config/logger','api','request-promise','path','rimraf','./squareOdbc.attributes','SquareOdbc','square_odbc'];(function(_0x3bad26,_0x1cf013){var _0x42e1ff=function(_0xb53d84){while(--_0xb53d84){_0x3bad26['push'](_0x3bad26['shift']());}};_0x42e1ff(++_0x1cf013);}(_0x1ea1,0x1b9));var _0x11ea=function(_0x209136,_0x39f191){_0x209136=_0x209136-0x0;var _0x3f6169=_0x1ea1[_0x209136];return _0x3f6169;};'use strict';var _=require(_0x11ea('0x0'));var util=require('util');var logger=require(_0x11ea('0x1'))(_0x11ea('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x11ea('0x3'));var fs=require('fs');var path=require(_0x11ea('0x4'));var rimraf=require(_0x11ea('0x5'));var config=require('../../config/environment');var attributes=require(_0x11ea('0x6'));module['exports']=function(_0x1a0b57,_0x4dd7d8){return _0x1a0b57['define'](_0x11ea('0x7'),attributes,{'tableName':_0x11ea('0x8'),'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 7c25e45..3895f04 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 _0xc663=['options','raw','attributes','include','model','map','ShowSquareOdbc','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','SquareOdbc','find'];(function(_0x237d52,_0x17a8af){var _0xbeda6e=function(_0x773dc8){while(--_0x773dc8){_0x237d52['push'](_0x237d52['shift']());}};_0xbeda6e(++_0x17a8af);}(_0xc663,0x17b));var _0x3c66=function(_0x382868,_0xb5acfd){_0x382868=_0x382868-0x0;var _0x43e191=_0xc663[_0x382868];return _0x43e191;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c66('0x0'));var BPromise=require(_0x3c66('0x1'));var rs=require(_0x3c66('0x2'));var fs=require('fs');var Redis=require(_0x3c66('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c66('0x4'));var logger=require(_0x3c66('0x5'))('rpc');var config=require(_0x3c66('0x6'));var jayson=require(_0x3c66('0x7'));var client=jayson[_0x3c66('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2b3b,_0x5bde22,_0x33a983){return new BPromise(function(_0x17a36f,_0x25efc0){return client[_0x3c66('0x9')](_0x2d2b3b,_0x33a983)[_0x3c66('0xa')](function(_0x4c864d){logger[_0x3c66('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x5bde22,_0x3c66('0xc'));logger[_0x3c66('0xd')](_0x3c66('0xe'),_0x5bde22,_0x3c66('0xc'),JSON[_0x3c66('0xf')](_0x4c864d));if(_0x4c864d[_0x3c66('0x10')]){if(_0x4c864d[_0x3c66('0x10')][_0x3c66('0x11')]===0x1f4){logger[_0x3c66('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x5bde22,_0x4c864d['error']['message']);return _0x25efc0(_0x4c864d[_0x3c66('0x10')][_0x3c66('0x12')]);}logger['error'](_0x3c66('0x13'),_0x5bde22,_0x4c864d[_0x3c66('0x10')]['message']);return _0x17a36f(_0x4c864d[_0x3c66('0x10')]['message']);}else{logger[_0x3c66('0xb')](_0x3c66('0x13'),_0x5bde22,'request\x20sent');_0x17a36f(_0x4c864d[_0x3c66('0x14')][_0x3c66('0x12')]);}})[_0x3c66('0x15')](function(_0x172774){logger[_0x3c66('0x10')](_0x3c66('0x13'),_0x5bde22,_0x172774);_0x25efc0(_0x172774);});});}exports['ShowSquareOdbc']=function(_0x27d793){var _0x4e6c82=this;return new Promise(function(_0x38b35a,_0x16321a){return db[_0x3c66('0x16')][_0x3c66('0x17')]({'raw':_0x27d793[_0x3c66('0x18')]?_0x27d793[_0x3c66('0x18')][_0x3c66('0x19')]===undefined?!![]:![]:!![],'where':_0x27d793[_0x3c66('0x18')]?_0x27d793['options']['where']||null:null,'attributes':_0x27d793['options']?_0x27d793[_0x3c66('0x18')][_0x3c66('0x1a')]||null:null,'include':_0x27d793[_0x3c66('0x18')]?_0x27d793['options'][_0x3c66('0x1b')]?_['map'](_0x27d793['options'][_0x3c66('0x1b')],function(_0x3ffcde){return{'model':db[_0x3ffcde[_0x3c66('0x1c')]],'as':_0x3ffcde['as'],'attributes':_0x3ffcde[_0x3c66('0x1a')],'include':_0x3ffcde['include']?_[_0x3c66('0x1d')](_0x3ffcde[_0x3c66('0x1b')],function(_0x2e9163){return{'model':db[_0x2e9163[_0x3c66('0x1c')]],'as':_0x2e9163['as'],'attributes':_0x2e9163[_0x3c66('0x1a')],'include':_0x2e9163[_0x3c66('0x1b')]?_[_0x3c66('0x1d')](_0x2e9163[_0x3c66('0x1b')],function(_0x380c82){return{'model':db[_0x380c82[_0x3c66('0x1c')]],'as':_0x380c82['as'],'attributes':_0x380c82['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c66('0xa')](function(_0x314d6b){logger[_0x3c66('0xb')](_0x3c66('0x1e'),_0x27d793);logger[_0x3c66('0xd')](_0x3c66('0x1e'),_0x27d793,JSON['stringify'](_0x314d6b));_0x38b35a(_0x314d6b);})[_0x3c66('0x15')](function(_0x17f4de){logger[_0x3c66('0x10')](_0x3c66('0x1e'),_0x17f4de[_0x3c66('0x12')],_0x27d793);_0x16321a(_0x4e6c82['error'](0x1f4,_0x17f4de[_0x3c66('0x12')]));});});}; \ No newline at end of file +var _0x812b=['http','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','find','options','where','include','map','model','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x812b,0x16a));var _0xb812=function(_0x4a6cb7,_0x48a3d5){_0x4a6cb7=_0x4a6cb7-0x0;var _0x3cc689=_0x812b[_0x4a6cb7];return _0x3cc689;};'use strict';var _=require(_0xb812('0x0'));var util=require('util');var moment=require(_0xb812('0x1'));var BPromise=require(_0xb812('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb812('0x3'));var db=require(_0xb812('0x4'))['db'];var utils=require(_0xb812('0x5'));var logger=require(_0xb812('0x6'))(_0xb812('0x7'));var config=require('../../config/environment');var jayson=require(_0xb812('0x8'));var client=jayson[_0xb812('0x9')][_0xb812('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6253,_0x348c6f,_0x645249){return new BPromise(function(_0x803548,_0x152e6f){return client['request'](_0x4f6253,_0x645249)[_0xb812('0xb')](function(_0x59e945){logger['info'](_0xb812('0xc'),_0x348c6f,_0xb812('0xd'));logger[_0xb812('0xe')](_0xb812('0xf'),_0x348c6f,_0xb812('0xd'),JSON[_0xb812('0x10')](_0x59e945));if(_0x59e945[_0xb812('0x11')]){if(_0x59e945[_0xb812('0x11')][_0xb812('0x12')]===0x1f4){logger[_0xb812('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x348c6f,_0x59e945['error'][_0xb812('0x13')]);return _0x152e6f(_0x59e945['error']['message']);}logger[_0xb812('0x11')](_0xb812('0xc'),_0x348c6f,_0x59e945[_0xb812('0x11')][_0xb812('0x13')]);return _0x803548(_0x59e945['error']['message']);}else{logger[_0xb812('0x14')](_0xb812('0xc'),_0x348c6f,_0xb812('0xd'));_0x803548(_0x59e945[_0xb812('0x15')]['message']);}})[_0xb812('0x16')](function(_0xe33b3c){logger[_0xb812('0x11')](_0xb812('0xc'),_0x348c6f,_0xe33b3c);_0x152e6f(_0xe33b3c);});});}exports[_0xb812('0x17')]=function(_0x4f097a){var _0x4943a8=this;return new Promise(function(_0x4f54fa,_0xef0db0){return db['SquareOdbc'][_0xb812('0x18')]({'raw':_0x4f097a[_0xb812('0x19')]?_0x4f097a[_0xb812('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f097a[_0xb812('0x19')]?_0x4f097a[_0xb812('0x19')][_0xb812('0x1a')]||null:null,'attributes':_0x4f097a[_0xb812('0x19')]?_0x4f097a[_0xb812('0x19')]['attributes']||null:null,'include':_0x4f097a[_0xb812('0x19')]?_0x4f097a[_0xb812('0x19')][_0xb812('0x1b')]?_[_0xb812('0x1c')](_0x4f097a[_0xb812('0x19')][_0xb812('0x1b')],function(_0x5a3630){return{'model':db[_0x5a3630['model']],'as':_0x5a3630['as'],'attributes':_0x5a3630['attributes'],'include':_0x5a3630['include']?_[_0xb812('0x1c')](_0x5a3630[_0xb812('0x1b')],function(_0x4ba245){return{'model':db[_0x4ba245[_0xb812('0x1d')]],'as':_0x4ba245['as'],'attributes':_0x4ba245[_0xb812('0x1e')],'include':_0x4ba245[_0xb812('0x1b')]?_[_0xb812('0x1c')](_0x4ba245[_0xb812('0x1b')],function(_0x2cad15){return{'model':db[_0x2cad15[_0xb812('0x1d')]],'as':_0x2cad15['as'],'attributes':_0x2cad15['attributes']};}):[]};}):[]};}):[]:[]})[_0xb812('0xb')](function(_0x576604){logger[_0xb812('0x14')](_0xb812('0x17'),_0x4f097a);logger[_0xb812('0xe')](_0xb812('0x17'),_0x4f097a,JSON[_0xb812('0x10')](_0x576604));_0x4f54fa(_0x576604);})[_0xb812('0x16')](function(_0x30d8cf){logger[_0xb812('0x11')]('ShowSquareOdbc',_0x30d8cf['message'],_0x4f097a);_0xef0db0(_0x4943a8[_0xb812('0x11')](0x1f4,_0x30d8cf[_0xb812('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 98c3ade..977f2ac 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 _0xd17f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','post','addUsers','put','update','delete','destroy','removeUsers','exports','path','express','Router','../../components/auth/service'];(function(_0x55d842,_0xea4a4e){var _0x29d837=function(_0x5722d6){while(--_0x5722d6){_0x55d842['push'](_0x55d842['shift']());}};_0x29d837(++_0xea4a4e);}(_0xd17f,0x13c));var _0xfd17=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd17f[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd17('0x0'));var timeout=require('connect-timeout');var express=require(_0xfd17('0x1'));var router=express[_0xfd17('0x2')]();var auth=require(_0xfd17('0x3'));var interaction=require(_0xfd17('0x4'));var config=require(_0xfd17('0x5'));var controller=require('./squareProject.controller');router[_0xfd17('0x6')]('/',auth[_0xfd17('0x7')](),controller[_0xfd17('0x8')]);router['get'](_0xfd17('0x9'),auth[_0xfd17('0x7')](),controller[_0xfd17('0xa')]);router[_0xfd17('0x6')](_0xfd17('0xb'),auth[_0xfd17('0x7')](),controller['getUsers']);router[_0xfd17('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfd17('0xb'),auth[_0xfd17('0x7')](),controller[_0xfd17('0xd')]);router[_0xfd17('0xe')](_0xfd17('0x9'),auth[_0xfd17('0x7')](),controller[_0xfd17('0xf')]);router[_0xfd17('0x10')](_0xfd17('0x9'),auth[_0xfd17('0x7')](),controller[_0xfd17('0x11')]);router[_0xfd17('0x10')](_0xfd17('0xb'),auth[_0xfd17('0x7')](),controller[_0xfd17('0x12')]);module[_0xfd17('0x13')]=router; \ No newline at end of file +var _0xa0a1=['destroy','removeUsers','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','create','post','put','update','delete'];(function(_0x1e7045,_0x5a8ed7){var _0x15e003=function(_0xc1b988){while(--_0xc1b988){_0x1e7045['push'](_0x1e7045['shift']());}};_0x15e003(++_0x5a8ed7);}(_0xa0a1,0xd4));var _0x1a0a=function(_0x2e4412,_0x57cc23){_0x2e4412=_0x2e4412-0x0;var _0x2c8f10=_0xa0a1[_0x2e4412];return _0x2c8f10;};'use strict';var multer=require(_0x1a0a('0x0'));var util=require(_0x1a0a('0x1'));var path=require(_0x1a0a('0x2'));var timeout=require(_0x1a0a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x1a0a('0x4'));var interaction=require(_0x1a0a('0x5'));var config=require('../../config/environment');var controller=require(_0x1a0a('0x6'));router['get']('/',auth[_0x1a0a('0x7')](),controller[_0x1a0a('0x8')]);router[_0x1a0a('0x9')](_0x1a0a('0xa'),auth[_0x1a0a('0x7')](),controller[_0x1a0a('0xb')]);router[_0x1a0a('0x9')](_0x1a0a('0xc'),auth[_0x1a0a('0x7')](),controller[_0x1a0a('0xd')]);router['post']('/',auth[_0x1a0a('0x7')](),controller[_0x1a0a('0xe')]);router[_0x1a0a('0xf')](_0x1a0a('0xc'),auth[_0x1a0a('0x7')](),controller['addUsers']);router[_0x1a0a('0x10')](_0x1a0a('0xa'),auth[_0x1a0a('0x7')](),controller[_0x1a0a('0x11')]);router[_0x1a0a('0x12')]('/:id',auth[_0x1a0a('0x7')](),controller[_0x1a0a('0x13')]);router['delete'](_0x1a0a('0xc'),auth[_0x1a0a('0x7')](),controller[_0x1a0a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index faf573e..69eabc8 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 _0x482d=['preproduction','getDataValue','utf8','production','STRING','name','TEXT','BLOB','long'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x482d,0x16c));var _0xd482=function(_0x44647f,_0x273ba0){_0x44647f=_0x44647f-0x0;var _0x461701=_0x482d[_0x44647f];return _0x461701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd482('0x0')],'unique':_0xd482('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xd482('0x0')]},'notes':{'type':Sequelize[_0xd482('0x2')]},'preproduction':{'type':Sequelize[_0xd482('0x3')](_0xd482('0x4')),'get':function(){if(this['getDataValue'](_0xd482('0x5'))){return this[_0xd482('0x6')](_0xd482('0x5'))['toString'](_0xd482('0x7'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0xd482('0x8'))){return this[_0xd482('0x6')](_0xd482('0x8'))['toString'](_0xd482('0x7'));}}}}; \ No newline at end of file +var _0x6050=['exports','STRING','name','TEXT','long','getDataValue','preproduction','utf8','production','toString','sequelize'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x6050,0x196));var _0x0605=function(_0x39fb04,_0x1f32ab){_0x39fb04=_0x39fb04-0x0;var _0x89075a=_0x6050[_0x39fb04];return _0x89075a;};'use strict';var Sequelize=require(_0x0605('0x0'));module[_0x0605('0x1')]={'name':{'type':Sequelize[_0x0605('0x2')],'unique':_0x0605('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0605('0x2')]},'notes':{'type':Sequelize[_0x0605('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x0605('0x5')),'get':function(){if(this[_0x0605('0x6')](_0x0605('0x7'))){return this['getDataValue']('preproduction')['toString'](_0x0605('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0x0605('0x9'))){return this[_0x0605('0x6')](_0x0605('0x9'))[_0x0605('0xa')](_0x0605('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d2b7b2a..9f05f38 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 _0x1a85=['mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','SquareProjects','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','pick','getUsers','nolimit','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x12d05a,_0x553c3a){var _0x5d2a2c=function(_0x210c1a){while(--_0x210c1a){_0x12d05a['push'](_0x12d05a['shift']());}};_0x5d2a2c(++_0x553c3a);}(_0x1a85,0x178));var _0x51a8=function(_0x4a6e77,_0x4a677c){_0x4a6e77=_0x4a6e77-0x0;var _0x1c137e=_0x1a85[_0x4a6e77];return _0x1c137e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var hardwareService=require(_0x51a8('0xf'));var logger=require(_0x51a8('0x10'))(_0x51a8('0x11'));var utils=require(_0x51a8('0x12'));var config=require(_0x51a8('0x13'));var db=require(_0x51a8('0x14'))['db'];config[_0x51a8('0x15')]=_[_0x51a8('0x16')](config[_0x51a8('0x15')],{'host':_0x51a8('0x17'),'port':0x18eb});var socket=require(_0x51a8('0x18'))(new Redis(config[_0x51a8('0x15')]));require(_0x51a8('0x19'))['register'](socket);function respondWithStatusCode(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xcc;return function(_0xaec066){if(_0xaec066){return _0x461f5c['sendStatus'](_0x7a4c36);}return _0x461f5c[_0x51a8('0x1a')](_0x7a4c36)['end']();};}function respondWithResult(_0x10584b,_0x2b8d37){_0x2b8d37=_0x2b8d37||0xc8;return function(_0x39cd45){if(_0x39cd45){return _0x10584b[_0x51a8('0x1a')](_0x2b8d37)[_0x51a8('0x1b')](_0x39cd45);}};}function respondWithFilteredResult(_0x3e0603,_0x1f49ee){return function(_0x516abc){if(_0x516abc){var _0x1c2f25=_0x516abc[_0x51a8('0x1c')],_0x45a433=_0x1f49ee[_0x51a8('0x1d')],_0xd52230=_0x1f49ee['offset']+_0x1f49ee[_0x51a8('0x1e')],_0x23539e;if(_0xd52230>=_0x1c2f25){_0xd52230=_0x1c2f25;_0x23539e=0xc8;}else{_0x23539e=0xce;}_0x3e0603[_0x51a8('0x1a')](_0x23539e);return _0x3e0603[_0x51a8('0x1f')](_0x51a8('0x20'),_0x45a433+'-'+_0xd52230+'/'+_0x1c2f25)[_0x51a8('0x1b')](_0x516abc);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x21')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x22')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x23')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x24')](function(){var _0x78d3d6=_0x23d26a[_0x51a8('0x25')]({'plain':!![]});var _0x18e2f3=_0x51a8('0x26');return db[_0x51a8('0x27')][_0x51a8('0x28')]({'where':{'type':_0x18e2f3,'resourceId':_0x78d3d6['id']}})[_0x51a8('0x24')](function(){return _0x23d26a;});})['then'](function(){_0x4b9cdd[_0x51a8('0x1a')](0xcc)[_0x51a8('0x29')]();});}};}function handleEntityNotFound(_0xca5746,_0x3da187){return function(_0x1c150d){if(!_0x1c150d){_0xca5746[_0x51a8('0x2a')](0x194);}return _0x1c150d;};}function handleError(_0x1a886f,_0x2742f5){_0x2742f5=_0x2742f5||0x1f4;return function(_0xec08ae){logger[_0x51a8('0x2b')](_0xec08ae[_0x51a8('0x2c')]);if(_0xec08ae[_0x51a8('0x2d')]){delete _0xec08ae['name'];}_0x1a886f[_0x51a8('0x1a')](_0x2742f5)['send'](_0xec08ae);};}exports[_0x51a8('0x2e')]=function(_0x3bc19a,_0x143f46){var _0x41df56={},_0x2136b4={},_0x4ea271={'count':0x0,'rows':[]};var _0x10c19b=db['SquareProject'][_0x51a8('0x2f')];_0x2136b4[_0x51a8('0x30')]=_[_0x51a8('0x31')](_0x10c19b);_0x2136b4['query']=_[_0x51a8('0x31')](_0x3bc19a['query']);_0x2136b4[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x2136b4[_0x51a8('0x30')],_0x2136b4[_0x51a8('0x34')]);_0x41df56[_0x51a8('0x35')]=_['intersection'](_0x2136b4[_0x51a8('0x30')],qs['fields'](_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x36')]));_0x41df56[_0x51a8('0x35')]=_0x41df56['attributes'][_0x51a8('0x37')]?_0x41df56[_0x51a8('0x35')]:_0x2136b4[_0x51a8('0x30')];if(!_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x38')]('nolimit')){_0x41df56['limit']=qs['limit'](_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x1e')]);_0x41df56['offset']=qs[_0x51a8('0x1d')](_0x3bc19a['query'][_0x51a8('0x1d')]);}_0x41df56[_0x51a8('0x39')]=qs[_0x51a8('0x3a')](_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x3a')]);_0x41df56[_0x51a8('0x3b')]=qs['filters'](_['pick'](_0x3bc19a[_0x51a8('0x34')],_0x2136b4['filters']));if(_0x3bc19a['query']['filter']){_0x41df56[_0x51a8('0x3b')]=_[_0x51a8('0x3c')](_0x41df56[_0x51a8('0x3b')],{'$or':_['map'](_0x10c19b,function(_0x728638){if(_0x728638[_0x51a8('0x3d')][_0x51a8('0x3e')]!==_0x51a8('0x3f')){var _0x5d3983={};_0x5d3983[_0x728638[_0x51a8('0x40')]]={'$like':'%'+_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x41')]+'%'};return _0x5d3983;}})});}_0x41df56=_['merge']({},_0x41df56,_0x3bc19a[_0x51a8('0x42')]);var _0x51d7bd={'where':_0x41df56[_0x51a8('0x3b')]};return db[_0x51a8('0x43')][_0x51a8('0x1c')](_0x51d7bd)[_0x51a8('0x24')](function(_0x5c44a9){_0x4ea271[_0x51a8('0x1c')]=_0x5c44a9;if(_0x3bc19a[_0x51a8('0x34')][_0x51a8('0x44')]){_0x41df56[_0x51a8('0x45')]=[{'all':!![]}];}return db[_0x51a8('0x43')][_0x51a8('0x46')](_0x41df56);})[_0x51a8('0x24')](function(_0x1cdec6){_0x4ea271[_0x51a8('0x47')]=_0x1cdec6;return _0x4ea271;})['then'](respondWithFilteredResult(_0x143f46,_0x41df56))[_0x51a8('0x48')](handleError(_0x143f46,null));};exports[_0x51a8('0x49')]=function(_0x4c7c67,_0x53409d){var _0x2173af={'raw':![],'where':{'id':_0x4c7c67[_0x51a8('0x4a')]['id']}},_0x19a57c={};_0x19a57c[_0x51a8('0x30')]=_[_0x51a8('0x31')](db[_0x51a8('0x43')][_0x51a8('0x2f')]);_0x19a57c[_0x51a8('0x34')]=_[_0x51a8('0x31')](_0x4c7c67[_0x51a8('0x34')]);_0x19a57c['filters']=_[_0x51a8('0x33')](_0x19a57c[_0x51a8('0x30')],_0x19a57c[_0x51a8('0x34')]);_0x2173af[_0x51a8('0x35')]=_[_0x51a8('0x33')](_0x19a57c[_0x51a8('0x30')],qs['fields'](_0x4c7c67[_0x51a8('0x34')]['fields']));_0x2173af[_0x51a8('0x35')]=_0x2173af[_0x51a8('0x35')][_0x51a8('0x37')]?_0x2173af[_0x51a8('0x35')]:_0x19a57c[_0x51a8('0x30')];if(_0x4c7c67['query']['includeAll']){_0x2173af[_0x51a8('0x45')]=[{'all':!![]}];}_0x2173af=_[_0x51a8('0x3c')]({},_0x2173af,_0x4c7c67[_0x51a8('0x42')]);return db[_0x51a8('0x43')][_0x51a8('0x4b')](_0x2173af)['then'](handleEntityNotFound(_0x53409d,null))['then'](respondWithResult(_0x53409d,null))[_0x51a8('0x48')](handleError(_0x53409d,null));};exports[_0x51a8('0x4c')]=function(_0x24b205,_0x419863){return db[_0x51a8('0x43')][_0x51a8('0x4c')](_0x24b205[_0x51a8('0x4d')],{})[_0x51a8('0x24')](function(_0x301578){var _0x4d29ab=_0x24b205['user']['get']({'plain':!![]});if(!_0x4d29ab)throw new Error(_0x51a8('0x4e'));if(_0x4d29ab[_0x51a8('0x4f')]===_0x51a8('0x50')){var _0x5259f3=_0x301578[_0x51a8('0x25')]({'plain':!![]});var _0x3d6cd7='SquareProjects';return db[_0x51a8('0x51')]['find']({'where':{'name':_0x3d6cd7,'userProfileId':_0x4d29ab['userProfileId']},'raw':!![]})[_0x51a8('0x24')](function(_0x4393c9){if(_0x4393c9&&_0x4393c9[_0x51a8('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x5259f3[_0x51a8('0x2d')],'resourceId':_0x5259f3['id'],'type':_0x4393c9['name'],'sectionId':_0x4393c9['id']},{})[_0x51a8('0x24')](function(){return _0x301578;});}else{return _0x301578;}})[_0x51a8('0x48')](function(_0x3623d4){logger[_0x51a8('0x2b')](_0x51a8('0x53'),_0x3623d4);throw _0x3623d4;});}return _0x301578;})[_0x51a8('0x24')](respondWithResult(_0x419863,0xc9))[_0x51a8('0x48')](handleError(_0x419863,null));};exports[_0x51a8('0x23')]=function(_0x29d31e,_0x530ad0){if(_0x29d31e[_0x51a8('0x4d')]['id']){delete _0x29d31e[_0x51a8('0x4d')]['id'];}return db[_0x51a8('0x43')][_0x51a8('0x4b')]({'where':{'id':_0x29d31e['params']['id']}})[_0x51a8('0x24')](handleEntityNotFound(_0x530ad0,null))['then'](saveUpdates(_0x29d31e[_0x51a8('0x4d')],null))[_0x51a8('0x24')](respondWithResult(_0x530ad0,null))['catch'](handleError(_0x530ad0,null));};exports['destroy']=function(_0x2628d4,_0x16f124){return db[_0x51a8('0x43')][_0x51a8('0x4b')]({'where':{'id':_0x2628d4[_0x51a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16f124,null))[_0x51a8('0x24')](removeEntity(_0x16f124,null))[_0x51a8('0x48')](handleError(_0x16f124,null));};exports[_0x51a8('0x54')]=function(_0x308d40,_0x531bc2,_0x5d44fe){return db[_0x51a8('0x43')][_0x51a8('0x4b')]({'where':{'id':_0x308d40[_0x51a8('0x4a')]['id']}})[_0x51a8('0x24')](handleEntityNotFound(_0x531bc2,null))[_0x51a8('0x24')](function(_0x352af8){if(_0x352af8){return _0x352af8['addUsers'](_0x308d40['body']['ids'],_['omit'](_0x308d40[_0x51a8('0x4d')],[_0x51a8('0x55'),'id'])||{});}})['then'](respondWithResult(_0x531bc2,null))[_0x51a8('0x48')](handleError(_0x531bc2,null));};exports['removeUsers']=function(_0x41cc00,_0x54f626,_0x3947e1){return db[_0x51a8('0x43')]['find']({'where':{'id':_0x41cc00['params']['id']}})['then'](handleEntityNotFound(_0x54f626,null))[_0x51a8('0x24')](function(_0x1ead77){if(_0x1ead77){return _0x1ead77[_0x51a8('0x56')](_0x41cc00[_0x51a8('0x34')][_0x51a8('0x55')])[_0x51a8('0x24')](function(){if(_[_0x51a8('0x57')](_0x41cc00[_0x51a8('0x34')]['ids'])){for(var _0x43c2ad=0x0;_0x43c2ad<_0x41cc00[_0x51a8('0x34')]['ids'][_0x51a8('0x37')];_0x43c2ad+=0x1){socket[_0x51a8('0x58')](_0x51a8('0x59'),{'UserId':Number(_0x41cc00[_0x51a8('0x34')][_0x51a8('0x55')][_0x43c2ad]),'SquareProjectId':Number(_0x41cc00[_0x51a8('0x4a')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x41cc00[_0x51a8('0x34')]['ids']),'SquareProjectId':Number(_0x41cc00['params']['id'])});}});}})['then'](respondWithStatusCode(_0x54f626,null))['catch'](handleError(_0x54f626,null));};exports['getUsers']=function(_0x426aec,_0x529b2f,_0x1477af){var _0x4772cd={};var _0x1e7135={};var _0x2d3d37;var _0xf05c1a;return db[_0x51a8('0x43')][_0x51a8('0x5a')]({'where':{'id':_0x426aec[_0x51a8('0x4a')]['id']}})[_0x51a8('0x24')](handleEntityNotFound(_0x529b2f,null))[_0x51a8('0x24')](function(_0x48affc){if(_0x48affc){_0x2d3d37=_0x48affc;_0x1e7135[_0x51a8('0x30')]=_[_0x51a8('0x31')](db[_0x51a8('0x5b')]['rawAttributes']);_0x1e7135['query']=_['keys'](_0x426aec[_0x51a8('0x34')]);_0x1e7135[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x1e7135[_0x51a8('0x30')],_0x1e7135[_0x51a8('0x34')]);_0x4772cd[_0x51a8('0x35')]=_[_0x51a8('0x33')](_0x1e7135[_0x51a8('0x30')],qs[_0x51a8('0x36')](_0x426aec[_0x51a8('0x34')][_0x51a8('0x36')]));_0x4772cd[_0x51a8('0x35')]=_0x4772cd[_0x51a8('0x35')]['length']?_0x4772cd[_0x51a8('0x35')]:_0x1e7135[_0x51a8('0x30')];_0x4772cd['order']=qs[_0x51a8('0x3a')](_0x426aec['query']['sort']);_0x4772cd['where']=qs[_0x51a8('0x32')](_[_0x51a8('0x5c')](_0x426aec[_0x51a8('0x34')],_0x1e7135[_0x51a8('0x32')]));if(_0x426aec[_0x51a8('0x34')][_0x51a8('0x41')]){_0x4772cd[_0x51a8('0x3b')]=_['merge'](_0x4772cd['where'],{'$or':_['map'](_0x4772cd[_0x51a8('0x35')],function(_0x1fed32){var _0x238074={};_0x238074[_0x1fed32]={'$like':'%'+_0x426aec[_0x51a8('0x34')][_0x51a8('0x41')]+'%'};return _0x238074;})});}_0x4772cd=_[_0x51a8('0x3c')]({},_0x4772cd,_0x426aec['options']);return _0x2d3d37[_0x51a8('0x5d')](_0x4772cd);}})['then'](function(_0x1c11d5){if(_0x1c11d5){_0xf05c1a=_0x1c11d5[_0x51a8('0x37')];if(!_0x426aec[_0x51a8('0x34')][_0x51a8('0x38')](_0x51a8('0x5e'))){_0x4772cd[_0x51a8('0x1e')]=qs[_0x51a8('0x1e')](_0x426aec[_0x51a8('0x34')][_0x51a8('0x1e')]);_0x4772cd[_0x51a8('0x1d')]=qs[_0x51a8('0x1d')](_0x426aec['query']['offset']);}return _0x2d3d37[_0x51a8('0x5d')](_0x4772cd);}})[_0x51a8('0x24')](function(_0x156b0c){if(_0x156b0c){return _0x156b0c?{'count':_0xf05c1a,'rows':_0x156b0c}:null;}})[_0x51a8('0x24')](respondWithResult(_0x529b2f,null))['catch'](handleError(_0x529b2f,null));}; \ No newline at end of file +var _0x1623=['querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','stack','name','send','SquareProject','rawAttributes','model','keys','query','intersection','fields','length','attributes','nolimit','order','sort','where','filters','filter','key','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','pick','map','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x1e20f5,_0x31ee1f){var _0x43ecd1=function(_0x376f7f){while(--_0x376f7f){_0x1e20f5['push'](_0x1e20f5['shift']());}};_0x43ecd1(++_0x31ee1f);}(_0x1623,0xab));var _0x3162=function(_0x83ea89,_0x975f53){_0x83ea89=_0x83ea89-0x0;var _0x37ab21=_0x1623[_0x83ea89];return _0x37ab21;};'use strict';var pdf=require(_0x3162('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3162('0x6'));var sox=require('sox');var csv=require(_0x3162('0x7'));var ejs=require(_0x3162('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0x7'));var querystring=require(_0x3162('0xd'));var Papa=require(_0x3162('0xe'));var Redis=require(_0x3162('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3162('0x10'));var logger=require(_0x3162('0x11'))(_0x3162('0x12'));var utils=require(_0x3162('0x13'));var config=require(_0x3162('0x14'));var db=require(_0x3162('0x15'))['db'];config[_0x3162('0x16')]=_[_0x3162('0x17')](config[_0x3162('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x3162('0x18'))(new Redis(config['redis']));require(_0x3162('0x19'))[_0x3162('0x1a')](socket);function respondWithStatusCode(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xcc;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x1b')](_0x4a393a);}return _0x49d1ad[_0x3162('0x1c')](_0x4a393a)['end']();};}function respondWithResult(_0x15e348,_0x3d0bea){_0x3d0bea=_0x3d0bea||0xc8;return function(_0x2705d1){if(_0x2705d1){return _0x15e348['status'](_0x3d0bea)[_0x3162('0x1d')](_0x2705d1);}};}function respondWithFilteredResult(_0x42cf7d,_0x46864e){return function(_0xc3ee06){if(_0xc3ee06){var _0x930415=_0xc3ee06[_0x3162('0x1e')],_0x1eed46=_0x46864e[_0x3162('0x1f')],_0x391d97=_0x46864e[_0x3162('0x1f')]+_0x46864e[_0x3162('0x20')],_0x4b2bf3;if(_0x391d97>=_0x930415){_0x391d97=_0x930415;_0x4b2bf3=0xc8;}else{_0x4b2bf3=0xce;}_0x42cf7d['status'](_0x4b2bf3);return _0x42cf7d[_0x3162('0x21')]('Content-Range',_0x1eed46+'-'+_0x391d97+'/'+_0x930415)['json'](_0xc3ee06);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x22')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x23')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x24')](_0x396372)[_0x3162('0x25')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x26')]()[_0x3162('0x25')](function(){var _0x1fd76f=_0xd283d6[_0x3162('0x27')]({'plain':!![]});var _0x3c543e=_0x3162('0x28');return db[_0x3162('0x29')][_0x3162('0x26')]({'where':{'type':_0x3c543e,'resourceId':_0x1fd76f['id']}})[_0x3162('0x25')](function(){return _0xd283d6;});})[_0x3162('0x25')](function(){_0x1b2713[_0x3162('0x1c')](0xcc)[_0x3162('0x2a')]();});}};}function handleEntityNotFound(_0x48de45,_0x4025c3){return function(_0x552469){if(!_0x552469){_0x48de45[_0x3162('0x1b')](0x194);}return _0x552469;};}function handleError(_0x31f7fd,_0x10c90b){_0x10c90b=_0x10c90b||0x1f4;return function(_0x57f567){logger['error'](_0x57f567[_0x3162('0x2b')]);if(_0x57f567[_0x3162('0x2c')]){delete _0x57f567[_0x3162('0x2c')];}_0x31f7fd[_0x3162('0x1c')](_0x10c90b)[_0x3162('0x2d')](_0x57f567);};}exports['index']=function(_0x8a7bce,_0x4e3cc2){var _0xf11765={},_0x3a188e={},_0x41e933={'count':0x0,'rows':[]};var _0x221b38=db[_0x3162('0x2e')][_0x3162('0x2f')];_0x3a188e[_0x3162('0x30')]=_[_0x3162('0x31')](_0x221b38);_0x3a188e['query']=_[_0x3162('0x31')](_0x8a7bce[_0x3162('0x32')]);_0x3a188e['filters']=_[_0x3162('0x33')](_0x3a188e[_0x3162('0x30')],_0x3a188e['query']);_0xf11765['attributes']=_[_0x3162('0x33')](_0x3a188e['model'],qs[_0x3162('0x34')](_0x8a7bce[_0x3162('0x32')][_0x3162('0x34')]));_0xf11765['attributes']=_0xf11765['attributes'][_0x3162('0x35')]?_0xf11765[_0x3162('0x36')]:_0x3a188e['model'];if(!_0x8a7bce[_0x3162('0x32')]['hasOwnProperty'](_0x3162('0x37'))){_0xf11765[_0x3162('0x20')]=qs[_0x3162('0x20')](_0x8a7bce[_0x3162('0x32')][_0x3162('0x20')]);_0xf11765[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x8a7bce[_0x3162('0x32')][_0x3162('0x1f')]);}_0xf11765[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x8a7bce['query'][_0x3162('0x39')]);_0xf11765[_0x3162('0x3a')]=qs[_0x3162('0x3b')](_['pick'](_0x8a7bce['query'],_0x3a188e[_0x3162('0x3b')]));if(_0x8a7bce[_0x3162('0x32')][_0x3162('0x3c')]){_0xf11765[_0x3162('0x3a')]=_['merge'](_0xf11765[_0x3162('0x3a')],{'$or':_['map'](_0x221b38,function(_0x59e049){if(_0x59e049['type'][_0x3162('0x3d')]!==_0x3162('0x3e')){var _0x315fdb={};_0x315fdb[_0x59e049['field']]={'$like':'%'+_0x8a7bce[_0x3162('0x32')][_0x3162('0x3c')]+'%'};return _0x315fdb;}})});}_0xf11765=_[_0x3162('0x3f')]({},_0xf11765,_0x8a7bce[_0x3162('0x40')]);var _0x1e8d5e={'where':_0xf11765['where']};return db['SquareProject'][_0x3162('0x1e')](_0x1e8d5e)[_0x3162('0x25')](function(_0x5ae385){_0x41e933['count']=_0x5ae385;if(_0x8a7bce[_0x3162('0x32')][_0x3162('0x41')]){_0xf11765[_0x3162('0x42')]=[{'all':!![]}];}return db['SquareProject'][_0x3162('0x43')](_0xf11765);})[_0x3162('0x25')](function(_0x1831f5){_0x41e933[_0x3162('0x44')]=_0x1831f5;return _0x41e933;})['then'](respondWithFilteredResult(_0x4e3cc2,_0xf11765))[_0x3162('0x45')](handleError(_0x4e3cc2,null));};exports[_0x3162('0x46')]=function(_0x522cce,_0x1d78de){var _0x337352={'raw':![],'where':{'id':_0x522cce[_0x3162('0x47')]['id']}},_0x500e6b={};_0x500e6b[_0x3162('0x30')]=_['keys'](db[_0x3162('0x2e')]['rawAttributes']);_0x500e6b[_0x3162('0x32')]=_[_0x3162('0x31')](_0x522cce[_0x3162('0x32')]);_0x500e6b[_0x3162('0x3b')]=_[_0x3162('0x33')](_0x500e6b[_0x3162('0x30')],_0x500e6b['query']);_0x337352[_0x3162('0x36')]=_[_0x3162('0x33')](_0x500e6b[_0x3162('0x30')],qs['fields'](_0x522cce[_0x3162('0x32')][_0x3162('0x34')]));_0x337352['attributes']=_0x337352[_0x3162('0x36')]['length']?_0x337352['attributes']:_0x500e6b['model'];if(_0x522cce[_0x3162('0x32')][_0x3162('0x41')]){_0x337352[_0x3162('0x42')]=[{'all':!![]}];}_0x337352=_[_0x3162('0x3f')]({},_0x337352,_0x522cce[_0x3162('0x40')]);return db[_0x3162('0x2e')][_0x3162('0x48')](_0x337352)[_0x3162('0x25')](handleEntityNotFound(_0x1d78de,null))[_0x3162('0x25')](respondWithResult(_0x1d78de,null))[_0x3162('0x45')](handleError(_0x1d78de,null));};exports[_0x3162('0x49')]=function(_0x3a167f,_0x209383){return db['SquareProject'][_0x3162('0x49')](_0x3a167f['body'],{})['then'](function(_0x12d791){var _0x19f641=_0x3a167f[_0x3162('0x4a')][_0x3162('0x27')]({'plain':!![]});if(!_0x19f641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19f641[_0x3162('0x4b')]==='user'){var _0xa11c6e=_0x12d791[_0x3162('0x27')]({'plain':!![]});var _0x4b23e8=_0x3162('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4b23e8,'userProfileId':_0x19f641[_0x3162('0x4c')]},'raw':!![]})[_0x3162('0x25')](function(_0x160364){if(_0x160364&&_0x160364[_0x3162('0x4d')]===0x0){return db[_0x3162('0x29')][_0x3162('0x49')]({'name':_0xa11c6e[_0x3162('0x2c')],'resourceId':_0xa11c6e['id'],'type':_0x160364[_0x3162('0x2c')],'sectionId':_0x160364['id']},{})['then'](function(){return _0x12d791;});}else{return _0x12d791;}})['catch'](function(_0x5a42d7){logger[_0x3162('0x4e')](_0x3162('0x4f'),_0x5a42d7);throw _0x5a42d7;});}return _0x12d791;})[_0x3162('0x25')](respondWithResult(_0x209383,0xc9))[_0x3162('0x45')](handleError(_0x209383,null));};exports[_0x3162('0x24')]=function(_0x45b6c5,_0x1af653){if(_0x45b6c5['body']['id']){delete _0x45b6c5[_0x3162('0x50')]['id'];}return db['SquareProject'][_0x3162('0x48')]({'where':{'id':_0x45b6c5['params']['id']}})[_0x3162('0x25')](handleEntityNotFound(_0x1af653,null))['then'](saveUpdates(_0x45b6c5[_0x3162('0x50')],null))[_0x3162('0x25')](respondWithResult(_0x1af653,null))['catch'](handleError(_0x1af653,null));};exports['destroy']=function(_0x2377c5,_0x348a4b){return db['SquareProject'][_0x3162('0x48')]({'where':{'id':_0x2377c5[_0x3162('0x47')]['id']}})[_0x3162('0x25')](handleEntityNotFound(_0x348a4b,null))[_0x3162('0x25')](removeEntity(_0x348a4b,null))[_0x3162('0x45')](handleError(_0x348a4b,null));};exports['addUsers']=function(_0x35483f,_0x3d5cd8,_0x4d86b5){return db['SquareProject'][_0x3162('0x48')]({'where':{'id':_0x35483f[_0x3162('0x47')]['id']}})[_0x3162('0x25')](handleEntityNotFound(_0x3d5cd8,null))['then'](function(_0xf7d3e1){if(_0xf7d3e1){return _0xf7d3e1[_0x3162('0x51')](_0x35483f[_0x3162('0x50')][_0x3162('0x52')],_['omit'](_0x35483f[_0x3162('0x50')],[_0x3162('0x52'),'id'])||{});}})['then'](respondWithResult(_0x3d5cd8,null))[_0x3162('0x45')](handleError(_0x3d5cd8,null));};exports['removeUsers']=function(_0x208df4,_0x1b0f2b,_0x22e170){return db['SquareProject'][_0x3162('0x48')]({'where':{'id':_0x208df4[_0x3162('0x47')]['id']}})[_0x3162('0x25')](handleEntityNotFound(_0x1b0f2b,null))[_0x3162('0x25')](function(_0x3df468){if(_0x3df468){return _0x3df468[_0x3162('0x53')](_0x208df4['query']['ids'])['then'](function(){if(_[_0x3162('0x54')](_0x208df4['query'][_0x3162('0x52')])){for(var _0x24b511=0x0;_0x24b511<_0x208df4[_0x3162('0x32')][_0x3162('0x52')][_0x3162('0x35')];_0x24b511+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x208df4[_0x3162('0x32')][_0x3162('0x52')][_0x24b511]),'SquareProjectId':Number(_0x208df4['params']['id'])});}}else{socket[_0x3162('0x55')](_0x3162('0x56'),{'UserId':Number(_0x208df4[_0x3162('0x32')][_0x3162('0x52')]),'SquareProjectId':Number(_0x208df4[_0x3162('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b0f2b,null))[_0x3162('0x45')](handleError(_0x1b0f2b,null));};exports[_0x3162('0x57')]=function(_0x3afaab,_0x28f891,_0x1f0ab9){var _0x5c8cef={};var _0x35fcf5={};var _0x401b4e;var _0xc8fcaf;return db[_0x3162('0x2e')]['findOne']({'where':{'id':_0x3afaab[_0x3162('0x47')]['id']}})[_0x3162('0x25')](handleEntityNotFound(_0x28f891,null))[_0x3162('0x25')](function(_0x45b05d){if(_0x45b05d){_0x401b4e=_0x45b05d;_0x35fcf5[_0x3162('0x30')]=_[_0x3162('0x31')](db[_0x3162('0x58')][_0x3162('0x2f')]);_0x35fcf5[_0x3162('0x32')]=_[_0x3162('0x31')](_0x3afaab['query']);_0x35fcf5[_0x3162('0x3b')]=_[_0x3162('0x33')](_0x35fcf5['model'],_0x35fcf5[_0x3162('0x32')]);_0x5c8cef['attributes']=_[_0x3162('0x33')](_0x35fcf5[_0x3162('0x30')],qs[_0x3162('0x34')](_0x3afaab[_0x3162('0x32')][_0x3162('0x34')]));_0x5c8cef[_0x3162('0x36')]=_0x5c8cef['attributes'][_0x3162('0x35')]?_0x5c8cef[_0x3162('0x36')]:_0x35fcf5[_0x3162('0x30')];_0x5c8cef[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x3afaab[_0x3162('0x32')]['sort']);_0x5c8cef[_0x3162('0x3a')]=qs[_0x3162('0x3b')](_[_0x3162('0x59')](_0x3afaab[_0x3162('0x32')],_0x35fcf5[_0x3162('0x3b')]));if(_0x3afaab[_0x3162('0x32')][_0x3162('0x3c')]){_0x5c8cef['where']=_['merge'](_0x5c8cef['where'],{'$or':_[_0x3162('0x5a')](_0x5c8cef[_0x3162('0x36')],function(_0x59b3f7){var _0x129005={};_0x129005[_0x59b3f7]={'$like':'%'+_0x3afaab[_0x3162('0x32')][_0x3162('0x3c')]+'%'};return _0x129005;})});}_0x5c8cef=_[_0x3162('0x3f')]({},_0x5c8cef,_0x3afaab['options']);return _0x401b4e[_0x3162('0x57')](_0x5c8cef);}})[_0x3162('0x25')](function(_0x533140){if(_0x533140){_0xc8fcaf=_0x533140[_0x3162('0x35')];if(!_0x3afaab['query'][_0x3162('0x5b')]('nolimit')){_0x5c8cef[_0x3162('0x20')]=qs['limit'](_0x3afaab[_0x3162('0x32')][_0x3162('0x20')]);_0x5c8cef[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x3afaab[_0x3162('0x32')][_0x3162('0x1f')]);}return _0x401b4e['getUsers'](_0x5c8cef);}})[_0x3162('0x25')](function(_0x63f6c2){if(_0x63f6c2){return _0x63f6c2?{'count':_0xc8fcaf,'rows':_0x63f6c2}:null;}})[_0x3162('0x25')](respondWithResult(_0x28f891,null))['catch'](handleError(_0x28f891,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a8ef5d9..c3ddf43 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 _0xd140=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd140,0x18c));var _0x0d14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd140[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x0d14('0x0'));var SquareProject=require(_0x0d14('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0d14('0x2')](0x0);var events={'afterCreate':_0x0d14('0x3'),'afterUpdate':_0x0d14('0x4'),'afterDestroy':_0x0d14('0x5')};function emitEvent(_0x2522e8){return function(_0x335e19,_0x5cb8bc,_0x24a48f){SquareProjectEvents['emit'](_0x2522e8+':'+_0x335e19['id'],_0x335e19);SquareProjectEvents[_0x0d14('0x6')](_0x2522e8,_0x335e19);_0x24a48f(null);};}for(var e in events){if(events[_0x0d14('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x0d14('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x43c3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x2a8899,_0x1d8dc1){var _0x3bf8da=function(_0x6eeb8a){while(--_0x6eeb8a){_0x2a8899['push'](_0x2a8899['shift']());}};_0x3bf8da(++_0x1d8dc1);}(_0x43c3,0x92));var _0x343c=function(_0x4a1fd4,_0x198d02){_0x4a1fd4=_0x4a1fd4-0x0;var _0x25b2e6=_0x43c3[_0x4a1fd4];return _0x25b2e6;};'use strict';var EventEmitter=require(_0x343c('0x0'));var SquareProject=require(_0x343c('0x1'))['db'][_0x343c('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x343c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x343c('0x4'),'afterDestroy':_0x343c('0x5')};function emitEvent(_0xdb3ce4){return function(_0x47ccd4,_0xbfd415,_0x5b8b42){SquareProjectEvents[_0x343c('0x6')](_0xdb3ce4+':'+_0x47ccd4['id'],_0x47ccd4);SquareProjectEvents[_0x343c('0x6')](_0xdb3ce4,_0x47ccd4);_0x5b8b42(null);};}for(var e in events){if(events[_0x343c('0x7')](e)){var event=events[e];SquareProject[_0x343c('0x8')](e,emitEvent(event));}}module[_0x343c('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 224c5b1..95a0cbc 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 _0xf449=['bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareProject','square_projects','../../config/logger'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf449,0x86));var _0x9f44=function(_0x2ae014,_0x63650){_0x2ae014=_0x2ae014-0x0;var _0x2c73d3=_0xf449[_0x2ae014];return _0x2c73d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f44('0x0'))('api');var moment=require('moment');var BPromise=require(_0x9f44('0x1'));var rp=require(_0x9f44('0x2'));var fs=require('fs');var path=require(_0x9f44('0x3'));var rimraf=require(_0x9f44('0x4'));var config=require(_0x9f44('0x5'));var attributes=require('./squareProject.attributes');module[_0x9f44('0x6')]=function(_0x4f82ac,_0x3dfd08){return _0x4f82ac['define'](_0x9f44('0x7'),attributes,{'tableName':_0x9f44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd190=['define','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd190,0x1c3));var _0x0d19=function(_0x5315f4,_0x2de36d){_0x5315f4=_0x5315f4-0x0;var _0x44dba8=_0xd190[_0x5315f4];return _0x44dba8;};'use strict';var _=require(_0x0d19('0x0'));var util=require(_0x0d19('0x1'));var logger=require(_0x0d19('0x2'))(_0x0d19('0x3'));var moment=require(_0x0d19('0x4'));var BPromise=require(_0x0d19('0x5'));var rp=require(_0x0d19('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d19('0x7'));var config=require(_0x0d19('0x8'));var attributes=require(_0x0d19('0x9'));module[_0x0d19('0xa')]=function(_0x21177a,_0x2cb7bf){return _0x21177a[_0x0d19('0xb')](_0x0d19('0xc'),attributes,{'tableName':_0x0d19('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 8e3a2ed..ea4bbc0 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x33cb0a,_0x8201cc){var _0x23c94d=function(_0x8f293b){while(--_0x8f293b){_0x33cb0a['push'](_0x33cb0a['shift']());}};_0x23c94d(++_0x8201cc);}(_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 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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xb2d4cf,_0x575e9b){var _0x50a730=function(_0x351ca5){while(--_0x351ca5){_0xb2d4cf['push'](_0xb2d4cf['shift']());}};_0x50a730(++_0x575e9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 579bd19..08cdb76 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 _0x8fed=['remove','update','removeListener','register','length'];(function(_0x208947,_0x505f4d){var _0x52ccb5=function(_0x2286f6){while(--_0x2286f6){_0x208947['push'](_0x208947['shift']());}};_0x52ccb5(++_0x505f4d);}(_0x8fed,0xf5));var _0xd8fe=function(_0x58b6e7,_0x39d960){_0x58b6e7=_0x58b6e7-0x0;var _0x20b4e8=_0x8fed[_0x58b6e7];return _0x20b4e8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xd8fe('0x0'),_0xd8fe('0x1')];function createListener(_0xc37b78,_0x1d0781){return function(_0x25ebcb){_0x1d0781['emit'](_0xc37b78,_0x25ebcb);};}function removeListener(_0x2af646,_0x3e93f3){return function(){SquareProjectEvents[_0xd8fe('0x2')](_0x2af646,_0x3e93f3);};}exports[_0xd8fe('0x3')]=function(_0x2b4285){for(var _0x54b0c9=0x0,_0x7e3b94=events[_0xd8fe('0x4')];_0x54b0c9<_0x7e3b94;_0x54b0c9++){var _0xa33e22=events[_0x54b0c9];var _0x26d33d=createListener('squareProject:'+_0xa33e22,_0x2b4285);SquareProjectEvents['on'](_0xa33e22,_0x26d33d);}}; \ No newline at end of file +var _0x86f5=['update','emit','register','length','./squareProject.events','remove'];(function(_0x540231,_0x117b98){var _0x31334b=function(_0xd90d86){while(--_0xd90d86){_0x540231['push'](_0x540231['shift']());}};_0x31334b(++_0x117b98);}(_0x86f5,0x178));var _0x586f=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x86f5[_0x4191bc];return _0x1ffd4e;};'use strict';var SquareProjectEvents=require(_0x586f('0x0'));var events=['save',_0x586f('0x1'),_0x586f('0x2')];function createListener(_0x49a4fd,_0x9bb313){return function(_0x2ce1db){_0x9bb313[_0x586f('0x3')](_0x49a4fd,_0x2ce1db);};}function removeListener(_0x160aa1,_0x52eeff){return function(){SquareProjectEvents['removeListener'](_0x160aa1,_0x52eeff);};}exports[_0x586f('0x4')]=function(_0x2155f1){for(var _0x18f144=0x0,_0x5d8d74=events[_0x586f('0x5')];_0x18f144<_0x5d8d74;_0x18f144++){var _0x15b372=events[_0x18f144];var _0x315fd9=createListener('squareProject:'+_0x15b372,_0x2155f1);SquareProjectEvents['on'](_0x15b372,_0x315fd9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index cbfb6b2..09385f2 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 _0x975f=['get','index','/:id','isAuthenticated','/:id/download','post','put','update','delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x3e2ea8,_0x521abc){var _0x478e55=function(_0x96279){while(--_0x96279){_0x3e2ea8['push'](_0x3e2ea8['shift']());}};_0x478e55(++_0x521abc);}(_0x975f,0x109));var _0xf975=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0x975f[_0x435fa1];return _0x845f9f;};'use strict';var multer=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf975('0x4'));var config=require(_0xf975('0x5'));var controller=require(_0xf975('0x6'));router[_0xf975('0x7')]('/',auth['isAuthenticated'](),controller[_0xf975('0x8')]);router[_0xf975('0x7')](_0xf975('0x9'),auth[_0xf975('0xa')](),controller['show']);router[_0xf975('0x7')](_0xf975('0xb'),auth[_0xf975('0xa')](),controller['download']);router[_0xf975('0xc')]('/',auth[_0xf975('0xa')](),controller['create']);router[_0xf975('0xd')](_0xf975('0x9'),auth[_0xf975('0xa')](),controller[_0xf975('0xe')]);router[_0xf975('0xf')](_0xf975('0x9'),auth[_0xf975('0xa')](),controller['destroy']);module[_0xf975('0x10')]=router; \ No newline at end of file +var _0xb898=['update','multer','path','connect-timeout','express','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/download','download','create','put'];(function(_0x10a99e,_0x100e80){var _0x1c6a86=function(_0xf1e701){while(--_0xf1e701){_0x10a99e['push'](_0x10a99e['shift']());}};_0x1c6a86(++_0x100e80);}(_0xb898,0xa9));var _0x8b89=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb898[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x8b89('0x0'));var util=require('util');var path=require(_0x8b89('0x1'));var timeout=require(_0x8b89('0x2'));var express=require(_0x8b89('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8b89('0x4'));var config=require('../../config/environment');var controller=require('./squareRecording.controller');router['get']('/',auth[_0x8b89('0x5')](),controller['index']);router[_0x8b89('0x6')](_0x8b89('0x7'),auth['isAuthenticated'](),controller[_0x8b89('0x8')]);router[_0x8b89('0x6')](_0x8b89('0x9'),auth[_0x8b89('0x5')](),controller[_0x8b89('0xa')]);router['post']('/',auth[_0x8b89('0x5')](),controller[_0x8b89('0xb')]);router[_0x8b89('0xc')](_0x8b89('0x7'),auth[_0x8b89('0x5')](),controller[_0x8b89('0xd')]);router['delete'](_0x8b89('0x7'),auth[_0x8b89('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 7149edc..b996614 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 _0x98a2=['sequelize','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x98a2,0x17c));var _0x298a=function(_0x1abddc,_0x2ef766){_0x1abddc=_0x1abddc-0x0;var _0x45c02a=_0x98a2[_0x1abddc];return _0x45c02a;};'use strict';var Sequelize=require(_0x298a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x298a('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x298a('0x1')]},'context':{'type':Sequelize[_0x298a('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x298a('0x1')]},'accountcode':{'type':Sequelize[_0x298a('0x1')]},'dnid':{'type':Sequelize[_0x298a('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x298a('0x1')]},'savePath':{'type':Sequelize[_0x298a('0x1')]}}; \ No newline at end of file +var _0xffb1=['sequelize','STRING'];(function(_0x5f490a,_0x15cfae){var _0x4a1be8=function(_0x368ab7){while(--_0x368ab7){_0x5f490a['push'](_0x5f490a['shift']());}};_0x4a1be8(++_0x15cfae);}(_0xffb1,0xb8));var _0x1ffb=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0xffb1[_0x15f3c0];return _0x1adfe0;};'use strict';var Sequelize=require(_0x1ffb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1ffb('0x1')]},'callerid':{'type':Sequelize[_0x1ffb('0x1')]},'calleridname':{'type':Sequelize[_0x1ffb('0x1')]},'context':{'type':Sequelize[_0x1ffb('0x1')]},'extension':{'type':Sequelize[_0x1ffb('0x1')]},'priority':{'type':Sequelize[_0x1ffb('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x1ffb('0x1')]},'projectName':{'type':Sequelize[_0x1ffb('0x1')]},'saveName':{'type':Sequelize[_0x1ffb('0x1')]},'filename':{'type':Sequelize[_0x1ffb('0x1')]},'savePath':{'type':Sequelize[_0x1ffb('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 5c6d5c4..76f5e47 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 _0x1eb0=['status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','SquareRecording','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','includeAll','find','body','download','type','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x1eb0,0x1b1));var _0x01eb=function(_0x2ac53c,_0x4a1647){_0x2ac53c=_0x2ac53c-0x0;var _0x4175b7=_0x1eb0[_0x2ac53c];return _0x4175b7;};'use strict';var pdf=require(_0x01eb('0x0'));var emlformat=require(_0x01eb('0x1'));var rimraf=require(_0x01eb('0x2'));var zipdir=require(_0x01eb('0x3'));var jsonpatch=require(_0x01eb('0x4'));var rp=require(_0x01eb('0x5'));var moment=require(_0x01eb('0x6'));var BPromise=require(_0x01eb('0x7'));var Mustache=require(_0x01eb('0x8'));var util=require(_0x01eb('0x9'));var path=require(_0x01eb('0xa'));var sox=require(_0x01eb('0xb'));var csv=require(_0x01eb('0xc'));var ejs=require(_0x01eb('0xd'));var fs=require('fs');var _=require(_0x01eb('0xe'));var squel=require('squel');var crypto=require(_0x01eb('0xf'));var jsforce=require(_0x01eb('0x10'));var deskjs=require(_0x01eb('0x11'));var toCsv=require(_0x01eb('0xc'));var querystring=require(_0x01eb('0x12'));var Papa=require(_0x01eb('0x13'));var Redis=require(_0x01eb('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x01eb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01eb('0x16'))(_0x01eb('0x17'));var utils=require(_0x01eb('0x18'));var config=require(_0x01eb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8a5596,_0x2a2233){_0x2a2233=_0x2a2233||0xcc;return function(_0x2d3a85){if(_0x2d3a85){return _0x8a5596[_0x01eb('0x1a')](_0x2a2233);}return _0x8a5596[_0x01eb('0x1b')](_0x2a2233)['end']();};}function respondWithResult(_0xa5abc2,_0xfc2669){_0xfc2669=_0xfc2669||0xc8;return function(_0x10c7ed){if(_0x10c7ed){return _0xa5abc2['status'](_0xfc2669)[_0x01eb('0x1c')](_0x10c7ed);}};}function respondWithFilteredResult(_0x4e5e0d,_0x135ff){return function(_0x2dd85e){if(_0x2dd85e){var _0x38c260=_0x2dd85e['count'],_0x2fb518=_0x135ff[_0x01eb('0x1d')],_0x221217=_0x135ff[_0x01eb('0x1d')]+_0x135ff[_0x01eb('0x1e')],_0x36e592;if(_0x221217>=_0x38c260){_0x221217=_0x38c260;_0x36e592=0xc8;}else{_0x36e592=0xce;}_0x4e5e0d['status'](_0x36e592);return _0x4e5e0d[_0x01eb('0x1f')](_0x01eb('0x20'),_0x2fb518+'-'+_0x221217+'/'+_0x38c260)[_0x01eb('0x1c')](_0x2dd85e);}return null;};}function patchUpdates(_0x34d801){return function(_0x4134c3){try{jsonpatch[_0x01eb('0x21')](_0x4134c3,_0x34d801,!![]);}catch(_0x3c0668){return BPromise[_0x01eb('0x22')](_0x3c0668);}return _0x4134c3[_0x01eb('0x23')]();};}function saveUpdates(_0x47cf99,_0x56115e){return function(_0x14fa91){if(_0x14fa91){return _0x14fa91[_0x01eb('0x24')](_0x47cf99)['then'](function(_0x375182){return _0x375182;});}return null;};}function removeEntity(_0x364e97,_0x46e35e){return function(_0x3e66ea){if(_0x3e66ea){return _0x3e66ea[_0x01eb('0x25')]()[_0x01eb('0x26')](function(){_0x364e97['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ad904,_0x4a6283){return function(_0x1ff490){if(!_0x1ff490){_0x5ad904['sendStatus'](0x194);}return _0x1ff490;};}function handleError(_0x14123b,_0x3464ac){_0x3464ac=_0x3464ac||0x1f4;return function(_0x503063){logger[_0x01eb('0x27')](_0x503063[_0x01eb('0x28')]);if(_0x503063[_0x01eb('0x29')]){delete _0x503063['name'];}_0x14123b[_0x01eb('0x1b')](_0x3464ac)[_0x01eb('0x2a')](_0x503063);};}exports[_0x01eb('0x2b')]=function(_0x1c518d,_0x5e5415){var _0x4e0382={},_0x33dbb5={},_0x118462={'count':0x0,'rows':[]};var _0xe69ea8=db[_0x01eb('0x2c')][_0x01eb('0x2d')];_0x33dbb5['model']=_[_0x01eb('0x2e')](_0xe69ea8);_0x33dbb5[_0x01eb('0x2f')]=_['keys'](_0x1c518d[_0x01eb('0x2f')]);_0x33dbb5[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x33dbb5[_0x01eb('0x32')],_0x33dbb5['query']);_0x4e0382[_0x01eb('0x33')]=_[_0x01eb('0x31')](_0x33dbb5[_0x01eb('0x32')],qs[_0x01eb('0x34')](_0x1c518d['query'][_0x01eb('0x34')]));_0x4e0382[_0x01eb('0x33')]=_0x4e0382['attributes'][_0x01eb('0x35')]?_0x4e0382[_0x01eb('0x33')]:_0x33dbb5['model'];if(!_0x1c518d[_0x01eb('0x2f')][_0x01eb('0x36')](_0x01eb('0x37'))){_0x4e0382['limit']=qs[_0x01eb('0x1e')](_0x1c518d[_0x01eb('0x2f')][_0x01eb('0x1e')]);_0x4e0382[_0x01eb('0x1d')]=qs[_0x01eb('0x1d')](_0x1c518d[_0x01eb('0x2f')][_0x01eb('0x1d')]);}_0x4e0382[_0x01eb('0x38')]=qs['sort'](_0x1c518d[_0x01eb('0x2f')][_0x01eb('0x39')]);_0x4e0382[_0x01eb('0x3a')]=qs['filters'](_[_0x01eb('0x3b')](_0x1c518d['query'],_0x33dbb5[_0x01eb('0x30')]));if(_0x1c518d['query'][_0x01eb('0x3c')]){_0x4e0382[_0x01eb('0x3a')]=_[_0x01eb('0x3d')](_0x4e0382[_0x01eb('0x3a')],{'$or':_[_0x01eb('0x3e')](_0xe69ea8,function(_0x304202){if(_0x304202['type']['key']!==_0x01eb('0x3f')){var _0x13833c={};_0x13833c[_0x304202[_0x01eb('0x40')]]={'$like':'%'+_0x1c518d[_0x01eb('0x2f')][_0x01eb('0x3c')]+'%'};return _0x13833c;}})});}_0x4e0382=_['merge']({},_0x4e0382,_0x1c518d[_0x01eb('0x41')]);var _0xaec7c1={'where':_0x4e0382[_0x01eb('0x3a')]};return db[_0x01eb('0x2c')][_0x01eb('0x42')](_0xaec7c1)[_0x01eb('0x26')](function(_0x13b489){_0x118462['count']=_0x13b489;if(_0x1c518d[_0x01eb('0x2f')]['includeAll']){_0x4e0382[_0x01eb('0x43')]=[{'all':!![]}];}return db[_0x01eb('0x2c')][_0x01eb('0x44')](_0x4e0382);})[_0x01eb('0x26')](function(_0x438f4b){_0x118462[_0x01eb('0x45')]=_0x438f4b;return _0x118462;})[_0x01eb('0x26')](respondWithFilteredResult(_0x5e5415,_0x4e0382))[_0x01eb('0x46')](handleError(_0x5e5415,null));};exports[_0x01eb('0x47')]=function(_0x335e5f,_0x33e229){var _0x9d1dbd={'raw':!![],'where':{'id':_0x335e5f[_0x01eb('0x48')]['id']}},_0x5377ab={};_0x5377ab[_0x01eb('0x32')]=_['keys'](db[_0x01eb('0x2c')][_0x01eb('0x2d')]);_0x5377ab[_0x01eb('0x2f')]=_['keys'](_0x335e5f[_0x01eb('0x2f')]);_0x5377ab[_0x01eb('0x30')]=_[_0x01eb('0x31')](_0x5377ab[_0x01eb('0x32')],_0x5377ab['query']);_0x9d1dbd[_0x01eb('0x33')]=_[_0x01eb('0x31')](_0x5377ab[_0x01eb('0x32')],qs[_0x01eb('0x34')](_0x335e5f[_0x01eb('0x2f')]['fields']));_0x9d1dbd['attributes']=_0x9d1dbd['attributes'][_0x01eb('0x35')]?_0x9d1dbd['attributes']:_0x5377ab['model'];if(_0x335e5f[_0x01eb('0x2f')][_0x01eb('0x49')]){_0x9d1dbd[_0x01eb('0x43')]=[{'all':!![]}];}_0x9d1dbd=_[_0x01eb('0x3d')]({},_0x9d1dbd,_0x335e5f['options']);return db['SquareRecording'][_0x01eb('0x4a')](_0x9d1dbd)[_0x01eb('0x26')](handleEntityNotFound(_0x33e229,null))['then'](respondWithResult(_0x33e229,null))[_0x01eb('0x46')](handleError(_0x33e229,null));};exports['create']=function(_0x17ab7d,_0x31ee72){return db[_0x01eb('0x2c')]['create'](_0x17ab7d[_0x01eb('0x4b')],{})['then'](respondWithResult(_0x31ee72,0xc9))[_0x01eb('0x46')](handleError(_0x31ee72,null));};exports[_0x01eb('0x24')]=function(_0x26a18f,_0x43317a){if(_0x26a18f[_0x01eb('0x4b')]['id']){delete _0x26a18f[_0x01eb('0x4b')]['id'];}return db['SquareRecording'][_0x01eb('0x4a')]({'where':{'id':_0x26a18f[_0x01eb('0x48')]['id']}})[_0x01eb('0x26')](handleEntityNotFound(_0x43317a,null))['then'](saveUpdates(_0x26a18f['body'],null))[_0x01eb('0x26')](respondWithResult(_0x43317a,null))[_0x01eb('0x46')](handleError(_0x43317a,null));};exports['destroy']=function(_0x4f406e,_0x3b4ce1){return db[_0x01eb('0x2c')][_0x01eb('0x4a')]({'where':{'id':_0x4f406e[_0x01eb('0x48')]['id']}})[_0x01eb('0x26')](handleEntityNotFound(_0x3b4ce1,null))[_0x01eb('0x26')](removeEntity(_0x3b4ce1,null))['catch'](handleError(_0x3b4ce1,null));};exports[_0x01eb('0x4c')]=function(_0x1e3cf2,_0x177202,_0x126aab){var _0x5cc96d=require('../../components/encryptor');var _0x2fae0a=![];var _0x2ecb07={};if(_0x1e3cf2[_0x01eb('0x2f')][_0x01eb('0x4d')]&&_0x1e3cf2[_0x01eb('0x2f')]['type']===_0x01eb('0x4e')){_0x2ecb07[_0x01eb('0x4e')]=_0x1e3cf2['params']['id'];}else{_0x2ecb07['id']=_0x1e3cf2[_0x01eb('0x48')]['id'];}return db[_0x01eb('0x2c')][_0x01eb('0x4a')]({'where':_0x2ecb07,'attributes':['id','savePath',_0x01eb('0x4f')],'raw':!![]})[_0x01eb('0x26')](handleEntityNotFound(_0x177202,null))[_0x01eb('0x26')](function(_0x54970f){if(_0x54970f){var _0xa23b95=_0x54970f[_0x01eb('0x50')];var _0x1fb71b=util['format'](_0x01eb('0x51'),_0xa23b95);if(fs[_0x01eb('0x52')](_0x1fb71b)){_0x2fae0a=!![];return _0x5cc96d[_0x01eb('0x53')](_0x1fb71b,_0xa23b95,config[_0x01eb('0x54')][_0x01eb('0x55')])[_0x01eb('0x26')](function(){return _0x54970f;});}return _0x54970f;}})[_0x01eb('0x26')](function(_0x2a033a){if(_0x2a033a){var _0x4c5182=_0x2a033a['savePath'];if(!fs[_0x01eb('0x52')](_0x4c5182)){throw new db[(_0x01eb('0x56'))]['ValidationError'](_0x01eb('0x57'));}if(_0x2a033a['filename']){return _0x177202[_0x01eb('0x4c')](_0x4c5182,_0x2a033a['filename']+path[_0x01eb('0x58')](_0x4c5182),function(){if(_0x2fae0a){fs[_0x01eb('0x59')](_0x4c5182);}});}else{return _0x177202[_0x01eb('0x4c')](_0x4c5182,function(_0x2ae02d){if(_0x2fae0a){fs['unlink'](_0x4c5182);}});}}})[_0x01eb('0x46')](function(_0x16d9d0){if(_0x16d9d0[_0x01eb('0x5a')]==='SquareRecording\x20not\x20found'){_0x177202[_0x01eb('0x1b')](0x194)[_0x01eb('0x2a')](_0x01eb('0x5b'));}else{return handleError(_0x177202,null);}});}; \ No newline at end of file +var _0xd555=['order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','download','../../components/encryptor','type','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','unlink','SquareRecording\x20not\x20found','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','offset','limit','Content-Range','reject','save','then','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x465f12,_0x9e637b){var _0x3bf1da=function(_0x4d00a5){while(--_0x4d00a5){_0x465f12['push'](_0x465f12['shift']());}};_0x3bf1da(++_0x9e637b);}(_0xd555,0x129));var _0x5d55=function(_0x1c852c,_0x113e2d){_0x1c852c=_0x1c852c-0x0;var _0x5037f4=_0xd555[_0x1c852c];return _0x5037f4;};'use strict';var pdf=require(_0x5d55('0x0'));var emlformat=require(_0x5d55('0x1'));var rimraf=require(_0x5d55('0x2'));var zipdir=require(_0x5d55('0x3'));var jsonpatch=require(_0x5d55('0x4'));var rp=require(_0x5d55('0x5'));var moment=require(_0x5d55('0x6'));var BPromise=require(_0x5d55('0x7'));var Mustache=require(_0x5d55('0x8'));var util=require(_0x5d55('0x9'));var path=require(_0x5d55('0xa'));var sox=require('sox');var csv=require(_0x5d55('0xb'));var ejs=require(_0x5d55('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5d55('0xd'));var jsforce=require(_0x5d55('0xe'));var deskjs=require(_0x5d55('0xf'));var toCsv=require(_0x5d55('0xb'));var querystring=require('querystring');var Papa=require(_0x5d55('0x10'));var Redis=require('ioredis');var authService=require(_0x5d55('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5d55('0x12'));var logger=require(_0x5d55('0x13'))('api');var utils=require(_0x5d55('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b8b6c,_0x76a78e){_0x76a78e=_0x76a78e||0xcc;return function(_0x37c574){if(_0x37c574){return _0x4b8b6c[_0x5d55('0x15')](_0x76a78e);}return _0x4b8b6c[_0x5d55('0x16')](_0x76a78e)[_0x5d55('0x17')]();};}function respondWithResult(_0x100af1,_0x318e60){_0x318e60=_0x318e60||0xc8;return function(_0x5da458){if(_0x5da458){return _0x100af1['status'](_0x318e60)['json'](_0x5da458);}};}function respondWithFilteredResult(_0x5ad746,_0x1ce2ef){return function(_0x1a368a){if(_0x1a368a){var _0x273506=_0x1a368a['count'],_0x229029=_0x1ce2ef[_0x5d55('0x18')],_0xcf4131=_0x1ce2ef[_0x5d55('0x18')]+_0x1ce2ef[_0x5d55('0x19')],_0x59a5fa;if(_0xcf4131>=_0x273506){_0xcf4131=_0x273506;_0x59a5fa=0xc8;}else{_0x59a5fa=0xce;}_0x5ad746[_0x5d55('0x16')](_0x59a5fa);return _0x5ad746['set'](_0x5d55('0x1a'),_0x229029+'-'+_0xcf4131+'/'+_0x273506)['json'](_0x1a368a);}return null;};}function patchUpdates(_0x33d23c){return function(_0x19e68c){try{jsonpatch['apply'](_0x19e68c,_0x33d23c,!![]);}catch(_0x125c7e){return BPromise[_0x5d55('0x1b')](_0x125c7e);}return _0x19e68c[_0x5d55('0x1c')]();};}function saveUpdates(_0x38fecb,_0x3c762a){return function(_0x2e167b){if(_0x2e167b){return _0x2e167b['update'](_0x38fecb)[_0x5d55('0x1d')](function(_0x1dfc77){return _0x1dfc77;});}return null;};}function removeEntity(_0x380650,_0x3d536a){return function(_0x1932d1){if(_0x1932d1){return _0x1932d1['destroy']()['then'](function(){_0x380650[_0x5d55('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x698cf3,_0x50fbf5){return function(_0x5b2a8c){if(!_0x5b2a8c){_0x698cf3[_0x5d55('0x15')](0x194);}return _0x5b2a8c;};}function handleError(_0xa92c28,_0x2564c4){_0x2564c4=_0x2564c4||0x1f4;return function(_0x3e5134){logger[_0x5d55('0x1e')](_0x3e5134[_0x5d55('0x1f')]);if(_0x3e5134[_0x5d55('0x20')]){delete _0x3e5134['name'];}_0xa92c28[_0x5d55('0x16')](_0x2564c4)[_0x5d55('0x21')](_0x3e5134);};}exports[_0x5d55('0x22')]=function(_0x153007,_0xb48b50){var _0x253662={},_0x1e917b={},_0x521873={'count':0x0,'rows':[]};var _0x2684d4=db[_0x5d55('0x23')][_0x5d55('0x24')];_0x1e917b[_0x5d55('0x25')]=_[_0x5d55('0x26')](_0x2684d4);_0x1e917b[_0x5d55('0x27')]=_[_0x5d55('0x26')](_0x153007[_0x5d55('0x27')]);_0x1e917b[_0x5d55('0x28')]=_[_0x5d55('0x29')](_0x1e917b[_0x5d55('0x25')],_0x1e917b['query']);_0x253662[_0x5d55('0x2a')]=_['intersection'](_0x1e917b[_0x5d55('0x25')],qs[_0x5d55('0x2b')](_0x153007['query'][_0x5d55('0x2b')]));_0x253662['attributes']=_0x253662[_0x5d55('0x2a')][_0x5d55('0x2c')]?_0x253662[_0x5d55('0x2a')]:_0x1e917b[_0x5d55('0x25')];if(!_0x153007['query'][_0x5d55('0x2d')](_0x5d55('0x2e'))){_0x253662['limit']=qs[_0x5d55('0x19')](_0x153007[_0x5d55('0x27')][_0x5d55('0x19')]);_0x253662['offset']=qs[_0x5d55('0x18')](_0x153007['query'][_0x5d55('0x18')]);}_0x253662[_0x5d55('0x2f')]=qs['sort'](_0x153007['query'][_0x5d55('0x30')]);_0x253662[_0x5d55('0x31')]=qs['filters'](_[_0x5d55('0x32')](_0x153007[_0x5d55('0x27')],_0x1e917b['filters']));if(_0x153007['query'][_0x5d55('0x33')]){_0x253662[_0x5d55('0x31')]=_[_0x5d55('0x34')](_0x253662[_0x5d55('0x31')],{'$or':_[_0x5d55('0x35')](_0x2684d4,function(_0x2b14b3){if(_0x2b14b3['type'][_0x5d55('0x36')]!==_0x5d55('0x37')){var _0x110980={};_0x110980[_0x2b14b3['field']]={'$like':'%'+_0x153007[_0x5d55('0x27')][_0x5d55('0x33')]+'%'};return _0x110980;}})});}_0x253662=_[_0x5d55('0x34')]({},_0x253662,_0x153007[_0x5d55('0x38')]);var _0x41b85={'where':_0x253662[_0x5d55('0x31')]};return db[_0x5d55('0x23')][_0x5d55('0x39')](_0x41b85)['then'](function(_0x1cb19e){_0x521873[_0x5d55('0x39')]=_0x1cb19e;if(_0x153007[_0x5d55('0x27')][_0x5d55('0x3a')]){_0x253662[_0x5d55('0x3b')]=[{'all':!![]}];}return db[_0x5d55('0x23')][_0x5d55('0x3c')](_0x253662);})[_0x5d55('0x1d')](function(_0x1a74a3){_0x521873[_0x5d55('0x3d')]=_0x1a74a3;return _0x521873;})['then'](respondWithFilteredResult(_0xb48b50,_0x253662))[_0x5d55('0x3e')](handleError(_0xb48b50,null));};exports[_0x5d55('0x3f')]=function(_0x2ac904,_0x2a2ec7){var _0x162343={'raw':!![],'where':{'id':_0x2ac904[_0x5d55('0x40')]['id']}},_0x2d11ff={};_0x2d11ff[_0x5d55('0x25')]=_[_0x5d55('0x26')](db[_0x5d55('0x23')][_0x5d55('0x24')]);_0x2d11ff['query']=_[_0x5d55('0x26')](_0x2ac904[_0x5d55('0x27')]);_0x2d11ff['filters']=_[_0x5d55('0x29')](_0x2d11ff[_0x5d55('0x25')],_0x2d11ff['query']);_0x162343[_0x5d55('0x2a')]=_['intersection'](_0x2d11ff[_0x5d55('0x25')],qs[_0x5d55('0x2b')](_0x2ac904[_0x5d55('0x27')][_0x5d55('0x2b')]));_0x162343[_0x5d55('0x2a')]=_0x162343[_0x5d55('0x2a')][_0x5d55('0x2c')]?_0x162343[_0x5d55('0x2a')]:_0x2d11ff['model'];if(_0x2ac904[_0x5d55('0x27')][_0x5d55('0x3a')]){_0x162343[_0x5d55('0x3b')]=[{'all':!![]}];}_0x162343=_['merge']({},_0x162343,_0x2ac904[_0x5d55('0x38')]);return db['SquareRecording'][_0x5d55('0x41')](_0x162343)[_0x5d55('0x1d')](handleEntityNotFound(_0x2a2ec7,null))[_0x5d55('0x1d')](respondWithResult(_0x2a2ec7,null))[_0x5d55('0x3e')](handleError(_0x2a2ec7,null));};exports[_0x5d55('0x42')]=function(_0x36a0e7,_0xca81af){return db[_0x5d55('0x23')][_0x5d55('0x42')](_0x36a0e7['body'],{})[_0x5d55('0x1d')](respondWithResult(_0xca81af,0xc9))[_0x5d55('0x3e')](handleError(_0xca81af,null));};exports[_0x5d55('0x43')]=function(_0x2057c1,_0x589629){if(_0x2057c1[_0x5d55('0x44')]['id']){delete _0x2057c1['body']['id'];}return db[_0x5d55('0x23')][_0x5d55('0x41')]({'where':{'id':_0x2057c1[_0x5d55('0x40')]['id']}})[_0x5d55('0x1d')](handleEntityNotFound(_0x589629,null))['then'](saveUpdates(_0x2057c1['body'],null))[_0x5d55('0x1d')](respondWithResult(_0x589629,null))[_0x5d55('0x3e')](handleError(_0x589629,null));};exports[_0x5d55('0x45')]=function(_0x3aa702,_0x563d1f){return db[_0x5d55('0x23')][_0x5d55('0x41')]({'where':{'id':_0x3aa702['params']['id']}})[_0x5d55('0x1d')](handleEntityNotFound(_0x563d1f,null))['then'](removeEntity(_0x563d1f,null))[_0x5d55('0x3e')](handleError(_0x563d1f,null));};exports[_0x5d55('0x46')]=function(_0x4af426,_0x1b2142,_0x1a0f97){var _0xca2e47=require(_0x5d55('0x47'));var _0x18af77=![];var _0x59e7bc={};if(_0x4af426['query'][_0x5d55('0x48')]&&_0x4af426[_0x5d55('0x27')][_0x5d55('0x48')]===_0x5d55('0x49')){_0x59e7bc[_0x5d55('0x49')]=_0x4af426[_0x5d55('0x40')]['id'];}else{_0x59e7bc['id']=_0x4af426[_0x5d55('0x40')]['id'];}return db[_0x5d55('0x23')][_0x5d55('0x41')]({'where':_0x59e7bc,'attributes':['id',_0x5d55('0x4a'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x1b2142,null))[_0x5d55('0x1d')](function(_0x883512){if(_0x883512){var _0x1f9ae1=_0x883512[_0x5d55('0x4a')];var _0x35cc4a=util[_0x5d55('0x4b')](_0x5d55('0x4c'),_0x1f9ae1);if(fs[_0x5d55('0x4d')](_0x35cc4a)){_0x18af77=!![];return _0xca2e47[_0x5d55('0x4e')](_0x35cc4a,_0x1f9ae1,config[_0x5d55('0x4f')][_0x5d55('0x50')])['then'](function(){return _0x883512;});}return _0x883512;}})[_0x5d55('0x1d')](function(_0x150fff){if(_0x150fff){var _0x4ee7df=_0x150fff[_0x5d55('0x4a')];if(!fs['existsSync'](_0x4ee7df)){throw new db[(_0x5d55('0x51'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x150fff[_0x5d55('0x52')]){return _0x1b2142['download'](_0x4ee7df,_0x150fff[_0x5d55('0x52')]+path['extname'](_0x4ee7df),function(){if(_0x18af77){fs[_0x5d55('0x53')](_0x4ee7df);}});}else{return _0x1b2142[_0x5d55('0x46')](_0x4ee7df,function(_0x1db56e){if(_0x18af77){fs[_0x5d55('0x53')](_0x4ee7df);}});}}})['catch'](function(_0x11fc49){if(_0x11fc49['message']===_0x5d55('0x54')){_0x1b2142[_0x5d55('0x16')](0x194)['send'](_0x5d55('0x55'));}else{return handleError(_0x1b2142,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1342bdc..f70ec13 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 _0xcd34=['api','moment','bluebird','request-promise','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xcd34,0x1d8));var _0x4cd3=function(_0x27f647,_0x15afa6){_0x27f647=_0x27f647-0x0;var _0x1048e1=_0xcd34[_0x27f647];return _0x1048e1;};'use strict';var _=require(_0x4cd3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4cd3('0x1'));var moment=require(_0x4cd3('0x2'));var BPromise=require(_0x4cd3('0x3'));var rp=require(_0x4cd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4cd3('0x5'));var attributes=require(_0x4cd3('0x6'));module[_0x4cd3('0x7')]=function(_0x279bb7,_0x179b5d){return _0x279bb7[_0x4cd3('0x8')](_0x4cd3('0x9'),attributes,{'tableName':_0x4cd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcb8=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x45fd58,_0x5ee594){var _0x233aa9=function(_0x1fe269){while(--_0x1fe269){_0x45fd58['push'](_0x45fd58['shift']());}};_0x233aa9(++_0x5ee594);}(_0xdcb8,0x159));var _0x8dcb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdcb8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8dcb('0x0'));var util=require(_0x8dcb('0x1'));var logger=require(_0x8dcb('0x2'))(_0x8dcb('0x3'));var moment=require(_0x8dcb('0x4'));var BPromise=require(_0x8dcb('0x5'));var rp=require(_0x8dcb('0x6'));var fs=require('fs');var path=require(_0x8dcb('0x7'));var rimraf=require(_0x8dcb('0x8'));var config=require(_0x8dcb('0x9'));var attributes=require(_0x8dcb('0xa'));module['exports']=function(_0xa500a7,_0x3d7e25){return _0xa500a7[_0x8dcb('0xb')](_0x8dcb('0xc'),attributes,{'tableName':_0x8dcb('0xd'),'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 cc5e950..8d7b8a6 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 _0x5e8d=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x33b86c,_0x260f65){var _0x7c0ba=function(_0x345962){while(--_0x345962){_0x33b86c['push'](_0x33b86c['shift']());}};_0x7c0ba(++_0x260f65);}(_0x5e8d,0xc6));var _0xd5e8=function(_0xa19618,_0x35ef65){_0xa19618=_0xa19618-0x0;var _0x2d45ee=_0x5e8d[_0xa19618];return _0x2d45ee;};'use strict';var _=require('lodash');var util=require(_0xd5e8('0x0'));var moment=require('moment');var BPromise=require(_0xd5e8('0x1'));var rs=require(_0xd5e8('0x2'));var fs=require('fs');var Redis=require(_0xd5e8('0x3'));var db=require(_0xd5e8('0x4'))['db'];var utils=require(_0xd5e8('0x5'));var logger=require(_0xd5e8('0x6'))(_0xd5e8('0x7'));var config=require('../../config/environment');var jayson=require(_0xd5e8('0x8'));var client=jayson['client'][_0xd5e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b677d,_0x5e9312,_0x4e8231){return new BPromise(function(_0x300530,_0xa53126){return client[_0xd5e8('0xa')](_0x1b677d,_0x4e8231)[_0xd5e8('0xb')](function(_0x550120){logger[_0xd5e8('0xc')](_0xd5e8('0xd'),_0x5e9312,_0xd5e8('0xe'));logger[_0xd5e8('0xf')](_0xd5e8('0x10'),_0x5e9312,_0xd5e8('0xe'),JSON[_0xd5e8('0x11')](_0x550120));if(_0x550120[_0xd5e8('0x12')]){if(_0x550120[_0xd5e8('0x12')][_0xd5e8('0x13')]===0x1f4){logger[_0xd5e8('0x12')]('SquareRecording,\x20%s,\x20%s',_0x5e9312,_0x550120[_0xd5e8('0x12')][_0xd5e8('0x14')]);return _0xa53126(_0x550120['error'][_0xd5e8('0x14')]);}logger[_0xd5e8('0x12')](_0xd5e8('0xd'),_0x5e9312,_0x550120['error'][_0xd5e8('0x14')]);return _0x300530(_0x550120[_0xd5e8('0x12')][_0xd5e8('0x14')]);}else{logger[_0xd5e8('0xc')]('SquareRecording,\x20%s,\x20%s',_0x5e9312,_0xd5e8('0xe'));_0x300530(_0x550120[_0xd5e8('0x15')][_0xd5e8('0x14')]);}})['catch'](function(_0x30e9c8){logger['error'](_0xd5e8('0xd'),_0x5e9312,_0x30e9c8);_0xa53126(_0x30e9c8);});});}exports[_0xd5e8('0x16')]=function(_0x37fddf){var _0x5fc89b=this;return new Promise(function(_0x3737e9,_0x9de0d4){return db[_0xd5e8('0x17')][_0xd5e8('0x18')](_0x37fddf[_0xd5e8('0x19')],{'raw':_0x37fddf[_0xd5e8('0x1a')]?_0x37fddf['options'][_0xd5e8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5ec3cc){logger[_0xd5e8('0xc')](_0xd5e8('0x16'),_0x37fddf);logger['debug']('CreateSquareRecording',_0x37fddf,JSON['stringify'](_0x5ec3cc));_0x3737e9(_0x5ec3cc);})[_0xd5e8('0x1c')](function(_0x2614f8){logger['error'](_0xd5e8('0x16'),_0x2614f8[_0xd5e8('0x14')],_0x37fddf);_0x9de0d4(_0x5fc89b[_0xd5e8('0x12')](0x1f4,_0x2614f8[_0xd5e8('0x14')]));});});}; \ No newline at end of file +var _0xc170=['util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareRecording','create','body','options','then','CreateSquareRecording','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc170,0x10e));var _0x0c17=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc170[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0c17('0x0'));var moment=require(_0x0c17('0x1'));var BPromise=require(_0x0c17('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c17('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c17('0x4'));var logger=require('../../config/logger')(_0x0c17('0x5'));var config=require('../../config/environment');var jayson=require(_0x0c17('0x6'));var client=jayson[_0x0c17('0x7')][_0x0c17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27d181,_0x18fa06,_0x5b3d9a){return new BPromise(function(_0x200a20,_0x385a5e){return client[_0x0c17('0x9')](_0x27d181,_0x5b3d9a)['then'](function(_0x6b29af){logger[_0x0c17('0xa')](_0x0c17('0xb'),_0x18fa06,_0x0c17('0xc'));logger[_0x0c17('0xd')](_0x0c17('0xe'),_0x18fa06,_0x0c17('0xc'),JSON[_0x0c17('0xf')](_0x6b29af));if(_0x6b29af[_0x0c17('0x10')]){if(_0x6b29af[_0x0c17('0x10')][_0x0c17('0x11')]===0x1f4){logger[_0x0c17('0x10')](_0x0c17('0xb'),_0x18fa06,_0x6b29af[_0x0c17('0x10')][_0x0c17('0x12')]);return _0x385a5e(_0x6b29af[_0x0c17('0x10')][_0x0c17('0x12')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x18fa06,_0x6b29af[_0x0c17('0x10')][_0x0c17('0x12')]);return _0x200a20(_0x6b29af[_0x0c17('0x10')]['message']);}else{logger[_0x0c17('0xa')]('SquareRecording,\x20%s,\x20%s',_0x18fa06,'request\x20sent');_0x200a20(_0x6b29af[_0x0c17('0x13')][_0x0c17('0x12')]);}})['catch'](function(_0x2f7db0){logger[_0x0c17('0x10')]('SquareRecording,\x20%s,\x20%s',_0x18fa06,_0x2f7db0);_0x385a5e(_0x2f7db0);});});}exports['CreateSquareRecording']=function(_0x1505d3){var _0xd5177e=this;return new Promise(function(_0x2e4723,_0x5c7c6b){return db[_0x0c17('0x14')][_0x0c17('0x15')](_0x1505d3[_0x0c17('0x16')],{'raw':_0x1505d3[_0x0c17('0x17')]?_0x1505d3[_0x0c17('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0c17('0x18')](function(_0x1b354a){logger['info'](_0x0c17('0x19'),_0x1505d3);logger['debug']('CreateSquareRecording',_0x1505d3,JSON[_0x0c17('0xf')](_0x1b354a));_0x2e4723(_0x1b354a);})[_0x0c17('0x1a')](function(_0x190b78){logger[_0x0c17('0x10')](_0x0c17('0x19'),_0x190b78[_0x0c17('0x12')],_0x1505d3);_0x5c7c6b(_0xd5177e[_0x0c17('0x10')](0x1f4,_0x190b78[_0x0c17('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b7ceefc..0d98015 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 _0x4534=['post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x5b45dc,_0x5ef090){var _0x211e70=function(_0x4200b3){while(--_0x4200b3){_0x5b45dc['push'](_0x5b45dc['shift']());}};_0x211e70(++_0x5ef090);}(_0x4534,0xbb));var _0x4453=function(_0x47ae29,_0x1e78e1){_0x47ae29=_0x47ae29-0x0;var _0x339cb4=_0x4534[_0x47ae29];return _0x339cb4;};'use strict';var multer=require('multer');var util=require(_0x4453('0x0'));var path=require('path');var timeout=require(_0x4453('0x1'));var express=require(_0x4453('0x2'));var router=express[_0x4453('0x3')]();var auth=require(_0x4453('0x4'));var interaction=require(_0x4453('0x5'));var config=require('../../config/environment');var controller=require(_0x4453('0x6'));router[_0x4453('0x7')]('/',auth[_0x4453('0x8')](),controller['index']);router[_0x4453('0x7')]('/describe',auth[_0x4453('0x8')](),controller[_0x4453('0x9')]);router[_0x4453('0x7')](_0x4453('0xa'),auth[_0x4453('0x8')](),controller['show']);router[_0x4453('0xb')]('/',auth['isAuthenticated'](),controller[_0x4453('0xc')]);router[_0x4453('0xd')]('/:id',auth[_0x4453('0x8')](),controller[_0x4453('0xe')]);router[_0x4453('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4453('0x10')]);module[_0x4453('0x11')]=router; \ No newline at end of file +var _0x07c8=['../../components/interaction/service','../../config/environment','./squareReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x41c0cf,_0x1a2c6a){var _0x320636=function(_0x1c70db){while(--_0x1c70db){_0x41c0cf['push'](_0x41c0cf['shift']());}};_0x320636(++_0x1a2c6a);}(_0x07c8,0xc3));var _0x807c=function(_0x445d65,_0x174c5f){_0x445d65=_0x445d65-0x0;var _0x42b3d2=_0x07c8[_0x445d65];return _0x42b3d2;};'use strict';var multer=require(_0x807c('0x0'));var util=require(_0x807c('0x1'));var path=require(_0x807c('0x2'));var timeout=require(_0x807c('0x3'));var express=require(_0x807c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x807c('0x5'));var config=require(_0x807c('0x6'));var controller=require(_0x807c('0x7'));router['get']('/',auth[_0x807c('0x8')](),controller['index']);router[_0x807c('0x9')](_0x807c('0xa'),auth[_0x807c('0x8')](),controller[_0x807c('0xb')]);router[_0x807c('0x9')](_0x807c('0xc'),auth[_0x807c('0x8')](),controller[_0x807c('0xd')]);router[_0x807c('0xe')]('/',auth[_0x807c('0x8')](),controller[_0x807c('0xf')]);router[_0x807c('0x10')](_0x807c('0xc'),auth[_0x807c('0x8')](),controller[_0x807c('0x11')]);router[_0x807c('0x12')](_0x807c('0xc'),auth['isAuthenticated'](),controller[_0x807c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index df6445d..fe9dba2 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 _0xe3c5=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x4f1540,_0x105a46){var _0x43a728=function(_0x5c436a){while(--_0x5c436a){_0x4f1540['push'](_0x4f1540['shift']());}};_0x43a728(++_0x105a46);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x252ef1,_0x2e0041){_0x252ef1=_0x252ef1-0x0;var _0x25817c=_0xe3c5[_0x252ef1];return _0x25817c;};'use strict';var Sequelize=require(_0x5e3c('0x0'));module[_0x5e3c('0x1')]={'network':{'type':Sequelize[_0x5e3c('0x2')]},'network_script':{'type':Sequelize[_0x5e3c('0x2')]},'request':{'type':Sequelize[_0x5e3c('0x2')]},'channel':{'type':Sequelize[_0x5e3c('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5e3c('0x2')]},'uniqueid':{'type':Sequelize[_0x5e3c('0x2')]},'version':{'type':Sequelize[_0x5e3c('0x2')]},'callerid':{'type':Sequelize[_0x5e3c('0x2')]},'calleridname':{'type':Sequelize[_0x5e3c('0x2')]},'callingpres':{'type':Sequelize[_0x5e3c('0x2')]},'callingani2':{'type':Sequelize[_0x5e3c('0x2')]},'callington':{'type':Sequelize[_0x5e3c('0x2')]},'callingtns':{'type':Sequelize[_0x5e3c('0x2')]},'dnid':{'type':Sequelize[_0x5e3c('0x2')]},'rdnis':{'type':Sequelize[_0x5e3c('0x2')]},'context':{'type':Sequelize[_0x5e3c('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x5e3c('0x2')]},'accountcode':{'type':Sequelize[_0x5e3c('0x2')]},'threadid':{'type':Sequelize[_0x5e3c('0x2')]},'project_name':{'type':Sequelize[_0x5e3c('0x2')]},'joinAt':{'type':Sequelize[_0x5e3c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x5e3c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3f59=['sequelize','exports','STRING','DATE'];(function(_0x37a73c,_0xc0df48){var _0x434901=function(_0x4bbbf4){while(--_0x4bbbf4){_0x37a73c['push'](_0x37a73c['shift']());}};_0x434901(++_0xc0df48);}(_0x3f59,0x1b0));var _0x93f5=function(_0x47080e,_0x3354c6){_0x47080e=_0x47080e-0x0;var _0x3a5e75=_0x3f59[_0x47080e];return _0x3a5e75;};'use strict';var Sequelize=require(_0x93f5('0x0'));module[_0x93f5('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x93f5('0x2')]},'request':{'type':Sequelize[_0x93f5('0x2')]},'channel':{'type':Sequelize[_0x93f5('0x2')]},'language':{'type':Sequelize[_0x93f5('0x2')]},'type':{'type':Sequelize[_0x93f5('0x2')]},'uniqueid':{'type':Sequelize[_0x93f5('0x2')]},'version':{'type':Sequelize[_0x93f5('0x2')]},'callerid':{'type':Sequelize[_0x93f5('0x2')]},'calleridname':{'type':Sequelize[_0x93f5('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x93f5('0x2')]},'callingtns':{'type':Sequelize[_0x93f5('0x2')]},'dnid':{'type':Sequelize[_0x93f5('0x2')]},'rdnis':{'type':Sequelize[_0x93f5('0x2')]},'context':{'type':Sequelize[_0x93f5('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x93f5('0x2')]},'project_name':{'type':Sequelize[_0x93f5('0x2')]},'joinAt':{'type':Sequelize[_0x93f5('0x3')]},'leaveAt':{'type':Sequelize[_0x93f5('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d59b735..f78e4ce 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 _0x9901=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','then','destroy','error','name','send','index','SquareReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','field','options','findAll','catch','show','params','length','includeAll','merge','create','body','find','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x2f1816,_0x3943d3){var _0x1601b9=function(_0x10c303){while(--_0x10c303){_0x2f1816['push'](_0x2f1816['shift']());}};_0x1601b9(++_0x3943d3);}(_0x9901,0x17d));var _0x1990=function(_0x19d920,_0x4300b4){_0x19d920=_0x19d920-0x0;var _0x7ad1d5=_0x9901[_0x19d920];return _0x7ad1d5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1990('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1990('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1990('0x2'));var Mustache=require(_0x1990('0x3'));var util=require(_0x1990('0x4'));var path=require(_0x1990('0x5'));var sox=require(_0x1990('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1990('0x7'));var jsforce=require(_0x1990('0x8'));var deskjs=require(_0x1990('0x9'));var toCsv=require('to-csv');var querystring=require(_0x1990('0xa'));var Papa=require(_0x1990('0xb'));var Redis=require(_0x1990('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x1990('0xd'));var logger=require(_0x1990('0xe'))('api');var utils=require(_0x1990('0xf'));var config=require(_0x1990('0x10'));var db=require(_0x1990('0x11'))['db'];function respondWithStatusCode(_0x13f0b7,_0xe1e395){_0xe1e395=_0xe1e395||0xcc;return function(_0x24bc7){if(_0x24bc7){return _0x13f0b7[_0x1990('0x12')](_0xe1e395);}return _0x13f0b7['status'](_0xe1e395)[_0x1990('0x13')]();};}function respondWithResult(_0x317eed,_0x27da88){_0x27da88=_0x27da88||0xc8;return function(_0x52357a){if(_0x52357a){return _0x317eed['status'](_0x27da88)[_0x1990('0x14')](_0x52357a);}};}function respondWithFilteredResult(_0x577160,_0x46b322){return function(_0x17fa2d){if(_0x17fa2d){var _0x4fd45c=_0x17fa2d[_0x1990('0x15')],_0x2c6627=_0x46b322[_0x1990('0x16')],_0x181c97=_0x46b322['offset']+_0x46b322[_0x1990('0x17')],_0xed2581;if(_0x181c97>=_0x4fd45c){_0x181c97=_0x4fd45c;_0xed2581=0xc8;}else{_0xed2581=0xce;}_0x577160[_0x1990('0x18')](_0xed2581);return _0x577160[_0x1990('0x19')](_0x1990('0x1a'),_0x2c6627+'-'+_0x181c97+'/'+_0x4fd45c)[_0x1990('0x14')](_0x17fa2d);}return null;};}function patchUpdates(_0x4f46b9){return function(_0x24620a){try{jsonpatch[_0x1990('0x1b')](_0x24620a,_0x4f46b9,!![]);}catch(_0x3e4fe2){return BPromise[_0x1990('0x1c')](_0x3e4fe2);}return _0x24620a['save']();};}function saveUpdates(_0xf2d652,_0x43ec11){return function(_0x2db879){if(_0x2db879){return _0x2db879['update'](_0xf2d652)[_0x1990('0x1d')](function(_0x1a5425){return _0x1a5425;});}return null;};}function removeEntity(_0x6fc096,_0x4daba6){return function(_0x2b4fc8){if(_0x2b4fc8){return _0x2b4fc8[_0x1990('0x1e')]()[_0x1990('0x1d')](function(){_0x6fc096[_0x1990('0x18')](0xcc)[_0x1990('0x13')]();});}};}function handleEntityNotFound(_0x1cd261,_0x14993e){return function(_0x246dcd){if(!_0x246dcd){_0x1cd261[_0x1990('0x12')](0x194);}return _0x246dcd;};}function handleError(_0x409659,_0x31b0f0){_0x31b0f0=_0x31b0f0||0x1f4;return function(_0x4cb48e){logger[_0x1990('0x1f')](_0x4cb48e['stack']);if(_0x4cb48e[_0x1990('0x20')]){delete _0x4cb48e[_0x1990('0x20')];}_0x409659[_0x1990('0x18')](_0x31b0f0)[_0x1990('0x21')](_0x4cb48e);};}exports[_0x1990('0x22')]=function(_0x2ae55a,_0x4cbc52){var _0x11c317={},_0xf06f53={},_0x2319df={'count':0x0,'rows':[]};var _0x35c63f=db[_0x1990('0x23')][_0x1990('0x24')];_0xf06f53[_0x1990('0x25')]=_['keys'](_0x35c63f);_0xf06f53[_0x1990('0x26')]=_[_0x1990('0x27')](_0x2ae55a[_0x1990('0x26')]);_0xf06f53[_0x1990('0x28')]=_[_0x1990('0x29')](_0xf06f53['model'],_0xf06f53['query']);_0x11c317[_0x1990('0x2a')]=_[_0x1990('0x29')](_0xf06f53[_0x1990('0x25')],qs['fields'](_0x2ae55a[_0x1990('0x26')][_0x1990('0x2b')]));_0x11c317[_0x1990('0x2a')]=_0x11c317[_0x1990('0x2a')]['length']?_0x11c317[_0x1990('0x2a')]:_0xf06f53[_0x1990('0x25')];if(!_0x2ae55a[_0x1990('0x26')][_0x1990('0x2c')](_0x1990('0x2d'))){_0x11c317[_0x1990('0x17')]=qs[_0x1990('0x17')](_0x2ae55a[_0x1990('0x26')]['limit']);_0x11c317[_0x1990('0x16')]=qs[_0x1990('0x16')](_0x2ae55a[_0x1990('0x26')]['offset']);}_0x11c317[_0x1990('0x2e')]=qs['sort'](_0x2ae55a[_0x1990('0x26')][_0x1990('0x2f')]);_0x11c317[_0x1990('0x30')]=qs['filters'](_[_0x1990('0x31')](_0x2ae55a[_0x1990('0x26')],_0xf06f53['filters']));if(_0x2ae55a[_0x1990('0x26')][_0x1990('0x32')]){_0x11c317[_0x1990('0x30')]=_['merge'](_0x11c317[_0x1990('0x30')],{'$or':_['map'](_0x35c63f,function(_0x10f93b){if(_0x10f93b[_0x1990('0x33')][_0x1990('0x34')]!=='VIRTUAL'){var _0x327799={};_0x327799[_0x10f93b[_0x1990('0x35')]]={'$like':'%'+_0x2ae55a[_0x1990('0x26')][_0x1990('0x32')]+'%'};return _0x327799;}})});}_0x11c317=_['merge']({},_0x11c317,_0x2ae55a[_0x1990('0x36')]);var _0x5dd69d={'where':_0x11c317[_0x1990('0x30')]};return db[_0x1990('0x23')][_0x1990('0x15')](_0x5dd69d)[_0x1990('0x1d')](function(_0x31e693){_0x2319df[_0x1990('0x15')]=_0x31e693;if(_0x2ae55a[_0x1990('0x26')]['includeAll']){_0x11c317['include']=[{'all':!![]}];}return db['SquareReport'][_0x1990('0x37')](_0x11c317);})[_0x1990('0x1d')](function(_0x3be91f){_0x2319df['rows']=_0x3be91f;return _0x2319df;})[_0x1990('0x1d')](respondWithFilteredResult(_0x4cbc52,_0x11c317))[_0x1990('0x38')](handleError(_0x4cbc52,null));};exports[_0x1990('0x39')]=function(_0x53acf4,_0x403b53){var _0x4fde97={'raw':!![],'where':{'id':_0x53acf4[_0x1990('0x3a')]['id']}},_0x1f45fc={};_0x1f45fc[_0x1990('0x25')]=_[_0x1990('0x27')](db[_0x1990('0x23')][_0x1990('0x24')]);_0x1f45fc['query']=_[_0x1990('0x27')](_0x53acf4[_0x1990('0x26')]);_0x1f45fc['filters']=_[_0x1990('0x29')](_0x1f45fc[_0x1990('0x25')],_0x1f45fc[_0x1990('0x26')]);_0x4fde97[_0x1990('0x2a')]=_[_0x1990('0x29')](_0x1f45fc['model'],qs[_0x1990('0x2b')](_0x53acf4[_0x1990('0x26')][_0x1990('0x2b')]));_0x4fde97[_0x1990('0x2a')]=_0x4fde97[_0x1990('0x2a')][_0x1990('0x3b')]?_0x4fde97[_0x1990('0x2a')]:_0x1f45fc[_0x1990('0x25')];if(_0x53acf4[_0x1990('0x26')][_0x1990('0x3c')]){_0x4fde97['include']=[{'all':!![]}];}_0x4fde97=_[_0x1990('0x3d')]({},_0x4fde97,_0x53acf4[_0x1990('0x36')]);return db[_0x1990('0x23')]['find'](_0x4fde97)[_0x1990('0x1d')](handleEntityNotFound(_0x403b53,null))['then'](respondWithResult(_0x403b53,null))[_0x1990('0x38')](handleError(_0x403b53,null));};exports['create']=function(_0x2d8c54,_0x26da99){return db[_0x1990('0x23')][_0x1990('0x3e')](_0x2d8c54[_0x1990('0x3f')],{})['then'](respondWithResult(_0x26da99,0xc9))[_0x1990('0x38')](handleError(_0x26da99,null));};exports['update']=function(_0x57aa17,_0xe5a2d1){if(_0x57aa17['body']['id']){delete _0x57aa17[_0x1990('0x3f')]['id'];}return db['SquareReport'][_0x1990('0x40')]({'where':{'id':_0x57aa17[_0x1990('0x3a')]['id']}})['then'](handleEntityNotFound(_0xe5a2d1,null))['then'](saveUpdates(_0x57aa17[_0x1990('0x3f')],null))[_0x1990('0x1d')](respondWithResult(_0xe5a2d1,null))[_0x1990('0x38')](handleError(_0xe5a2d1,null));};exports[_0x1990('0x1e')]=function(_0x177310,_0x3c3a2b){return db[_0x1990('0x23')][_0x1990('0x40')]({'where':{'id':_0x177310[_0x1990('0x3a')]['id']}})[_0x1990('0x1d')](handleEntityNotFound(_0x3c3a2b,null))[_0x1990('0x1d')](removeEntity(_0x3c3a2b,null))[_0x1990('0x38')](handleError(_0x3c3a2b,null));};exports[_0x1990('0x41')]=function(_0x6b78c3,_0x4c644b){return db[_0x1990('0x23')]['describe']()['then'](respondWithResult(_0x4c644b,null))['catch'](handleError(_0x4c644b,null));}; \ No newline at end of file +var _0xc88d=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','reject','save','update','destroy','then','stack','name','status','send','index','SquareReport','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','map','type','key','field','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2df40d,_0x247edb){var _0x234d44=function(_0x117913){while(--_0x117913){_0x2df40d['push'](_0x2df40d['shift']());}};_0x234d44(++_0x247edb);}(_0xc88d,0x150));var _0xdc88=function(_0x436011,_0x5c4f59){_0x436011=_0x436011-0x0;var _0x2f1d9a=_0xc88d[_0x436011];return _0x2f1d9a;};'use strict';var pdf=require(_0xdc88('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdc88('0x1'));var zipdir=require(_0xdc88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc88('0x3'));var BPromise=require(_0xdc88('0x4'));var Mustache=require(_0xdc88('0x5'));var util=require(_0xdc88('0x6'));var path=require(_0xdc88('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdc88('0x8'));var fs=require('fs');var _=require(_0xdc88('0x9'));var squel=require('squel');var crypto=require(_0xdc88('0xa'));var jsforce=require(_0xdc88('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdc88('0xc'));var querystring=require('querystring');var Papa=require(_0xdc88('0xd'));var Redis=require(_0xdc88('0xe'));var authService=require(_0xdc88('0xf'));var qs=require(_0xdc88('0x10'));var hardwareService=require(_0xdc88('0x11'));var logger=require(_0xdc88('0x12'))(_0xdc88('0x13'));var utils=require(_0xdc88('0x14'));var config=require(_0xdc88('0x15'));var db=require(_0xdc88('0x16'))['db'];function respondWithStatusCode(_0x76890e,_0x6a88d9){_0x6a88d9=_0x6a88d9||0xcc;return function(_0x8ec123){if(_0x8ec123){return _0x76890e[_0xdc88('0x17')](_0x6a88d9);}return _0x76890e['status'](_0x6a88d9)[_0xdc88('0x18')]();};}function respondWithResult(_0x59758a,_0x2322f4){_0x2322f4=_0x2322f4||0xc8;return function(_0x3bd031){if(_0x3bd031){return _0x59758a['status'](_0x2322f4)[_0xdc88('0x19')](_0x3bd031);}};}function respondWithFilteredResult(_0x1c7b48,_0x287580){return function(_0x219d3a){if(_0x219d3a){var _0x1ad8df=_0x219d3a[_0xdc88('0x1a')],_0x22fad8=_0x287580[_0xdc88('0x1b')],_0x452ce5=_0x287580['offset']+_0x287580[_0xdc88('0x1c')],_0x5ad736;if(_0x452ce5>=_0x1ad8df){_0x452ce5=_0x1ad8df;_0x5ad736=0xc8;}else{_0x5ad736=0xce;}_0x1c7b48['status'](_0x5ad736);return _0x1c7b48['set']('Content-Range',_0x22fad8+'-'+_0x452ce5+'/'+_0x1ad8df)[_0xdc88('0x19')](_0x219d3a);}return null;};}function patchUpdates(_0x22887d){return function(_0x4211bc){try{jsonpatch['apply'](_0x4211bc,_0x22887d,!![]);}catch(_0x86bc96){return BPromise[_0xdc88('0x1d')](_0x86bc96);}return _0x4211bc[_0xdc88('0x1e')]();};}function saveUpdates(_0x3946fd,_0x4466af){return function(_0x51f10b){if(_0x51f10b){return _0x51f10b[_0xdc88('0x1f')](_0x3946fd)['then'](function(_0xb7f294){return _0xb7f294;});}return null;};}function removeEntity(_0x3ee421,_0x59c851){return function(_0x30a8c5){if(_0x30a8c5){return _0x30a8c5[_0xdc88('0x20')]()[_0xdc88('0x21')](function(){_0x3ee421['status'](0xcc)[_0xdc88('0x18')]();});}};}function handleEntityNotFound(_0x4b3397,_0x16141e){return function(_0x17ee15){if(!_0x17ee15){_0x4b3397['sendStatus'](0x194);}return _0x17ee15;};}function handleError(_0x10e334,_0xc88b99){_0xc88b99=_0xc88b99||0x1f4;return function(_0x4ed345){logger['error'](_0x4ed345[_0xdc88('0x22')]);if(_0x4ed345[_0xdc88('0x23')]){delete _0x4ed345['name'];}_0x10e334[_0xdc88('0x24')](_0xc88b99)[_0xdc88('0x25')](_0x4ed345);};}exports[_0xdc88('0x26')]=function(_0x40ce0a,_0x3e07ee){var _0xe28dac={},_0x3c2d96={},_0x9de4cb={'count':0x0,'rows':[]};var _0x14915a=db[_0xdc88('0x27')]['rawAttributes'];_0x3c2d96['model']=_[_0xdc88('0x28')](_0x14915a);_0x3c2d96[_0xdc88('0x29')]=_[_0xdc88('0x28')](_0x40ce0a[_0xdc88('0x29')]);_0x3c2d96[_0xdc88('0x2a')]=_[_0xdc88('0x2b')](_0x3c2d96[_0xdc88('0x2c')],_0x3c2d96[_0xdc88('0x29')]);_0xe28dac['attributes']=_[_0xdc88('0x2b')](_0x3c2d96[_0xdc88('0x2c')],qs['fields'](_0x40ce0a[_0xdc88('0x29')][_0xdc88('0x2d')]));_0xe28dac[_0xdc88('0x2e')]=_0xe28dac[_0xdc88('0x2e')]['length']?_0xe28dac[_0xdc88('0x2e')]:_0x3c2d96[_0xdc88('0x2c')];if(!_0x40ce0a[_0xdc88('0x29')][_0xdc88('0x2f')](_0xdc88('0x30'))){_0xe28dac[_0xdc88('0x1c')]=qs[_0xdc88('0x1c')](_0x40ce0a[_0xdc88('0x29')]['limit']);_0xe28dac[_0xdc88('0x1b')]=qs[_0xdc88('0x1b')](_0x40ce0a[_0xdc88('0x29')][_0xdc88('0x1b')]);}_0xe28dac[_0xdc88('0x31')]=qs['sort'](_0x40ce0a[_0xdc88('0x29')]['sort']);_0xe28dac[_0xdc88('0x32')]=qs['filters'](_[_0xdc88('0x33')](_0x40ce0a[_0xdc88('0x29')],_0x3c2d96[_0xdc88('0x2a')]));if(_0x40ce0a['query'][_0xdc88('0x34')]){_0xe28dac[_0xdc88('0x32')]=_['merge'](_0xe28dac[_0xdc88('0x32')],{'$or':_[_0xdc88('0x35')](_0x14915a,function(_0x44166c){if(_0x44166c[_0xdc88('0x36')][_0xdc88('0x37')]!=='VIRTUAL'){var _0x40fba1={};_0x40fba1[_0x44166c[_0xdc88('0x38')]]={'$like':'%'+_0x40ce0a['query'][_0xdc88('0x34')]+'%'};return _0x40fba1;}})});}_0xe28dac=_[_0xdc88('0x39')]({},_0xe28dac,_0x40ce0a[_0xdc88('0x3a')]);var _0x1d2d65={'where':_0xe28dac[_0xdc88('0x32')]};return db['SquareReport']['count'](_0x1d2d65)[_0xdc88('0x21')](function(_0x4cda6b){_0x9de4cb[_0xdc88('0x1a')]=_0x4cda6b;if(_0x40ce0a['query'][_0xdc88('0x3b')]){_0xe28dac[_0xdc88('0x3c')]=[{'all':!![]}];}return db[_0xdc88('0x27')][_0xdc88('0x3d')](_0xe28dac);})['then'](function(_0x2a8d32){_0x9de4cb['rows']=_0x2a8d32;return _0x9de4cb;})[_0xdc88('0x21')](respondWithFilteredResult(_0x3e07ee,_0xe28dac))[_0xdc88('0x3e')](handleError(_0x3e07ee,null));};exports[_0xdc88('0x3f')]=function(_0x3827b,_0x30f997){var _0x1dba34={'raw':!![],'where':{'id':_0x3827b[_0xdc88('0x40')]['id']}},_0x272b38={};_0x272b38[_0xdc88('0x2c')]=_[_0xdc88('0x28')](db['SquareReport'][_0xdc88('0x41')]);_0x272b38[_0xdc88('0x29')]=_[_0xdc88('0x28')](_0x3827b[_0xdc88('0x29')]);_0x272b38['filters']=_['intersection'](_0x272b38[_0xdc88('0x2c')],_0x272b38[_0xdc88('0x29')]);_0x1dba34[_0xdc88('0x2e')]=_[_0xdc88('0x2b')](_0x272b38[_0xdc88('0x2c')],qs[_0xdc88('0x2d')](_0x3827b['query'][_0xdc88('0x2d')]));_0x1dba34['attributes']=_0x1dba34[_0xdc88('0x2e')][_0xdc88('0x42')]?_0x1dba34['attributes']:_0x272b38[_0xdc88('0x2c')];if(_0x3827b[_0xdc88('0x29')]['includeAll']){_0x1dba34['include']=[{'all':!![]}];}_0x1dba34=_[_0xdc88('0x39')]({},_0x1dba34,_0x3827b[_0xdc88('0x3a')]);return db['SquareReport'][_0xdc88('0x43')](_0x1dba34)[_0xdc88('0x21')](handleEntityNotFound(_0x30f997,null))[_0xdc88('0x21')](respondWithResult(_0x30f997,null))['catch'](handleError(_0x30f997,null));};exports[_0xdc88('0x44')]=function(_0x169cc4,_0x2ea918){return db[_0xdc88('0x27')]['create'](_0x169cc4[_0xdc88('0x45')],{})[_0xdc88('0x21')](respondWithResult(_0x2ea918,0xc9))[_0xdc88('0x3e')](handleError(_0x2ea918,null));};exports[_0xdc88('0x1f')]=function(_0x3729b7,_0x644a4e){if(_0x3729b7[_0xdc88('0x45')]['id']){delete _0x3729b7[_0xdc88('0x45')]['id'];}return db[_0xdc88('0x27')][_0xdc88('0x43')]({'where':{'id':_0x3729b7['params']['id']}})[_0xdc88('0x21')](handleEntityNotFound(_0x644a4e,null))[_0xdc88('0x21')](saveUpdates(_0x3729b7['body'],null))[_0xdc88('0x21')](respondWithResult(_0x644a4e,null))['catch'](handleError(_0x644a4e,null));};exports[_0xdc88('0x20')]=function(_0x1425c3,_0x2971ee){return db[_0xdc88('0x27')]['find']({'where':{'id':_0x1425c3[_0xdc88('0x40')]['id']}})[_0xdc88('0x21')](handleEntityNotFound(_0x2971ee,null))[_0xdc88('0x21')](removeEntity(_0x2971ee,null))[_0xdc88('0x3e')](handleError(_0x2971ee,null));};exports[_0xdc88('0x46')]=function(_0x24d267,_0x3a06db){return db[_0xdc88('0x27')][_0xdc88('0x46')]()[_0xdc88('0x21')](respondWithResult(_0x3a06db,null))[_0xdc88('0x3e')](handleError(_0x3a06db,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index bea78f7..0be32e6 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 _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x2ae71f,_0x455162){var _0x2e0d9b=function(_0x143753){while(--_0x143753){_0x2ae71f['push'](_0x2ae71f['shift']());}};_0x2e0d9b(++_0x455162);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0xdf60fe,_0x36b875){var _0x34a69d=function(_0x3b09b1){while(--_0x3b09b1){_0xdf60fe['push'](_0xdf60fe['shift']());}};_0x34a69d(++_0x36b875);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('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 af0f970..27a252c 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 _0x0ee6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','options','catch','UpdateSquareReport','body','raw','where','attributes','limit','lodash','util'];(function(_0x34784d,_0x4524d2){var _0xeb40ea=function(_0x534537){while(--_0x534537){_0x34784d['push'](_0x34784d['shift']());}};_0xeb40ea(++_0x4524d2);}(_0x0ee6,0x106));var _0x60ee=function(_0xa6d636,_0x25ba07){_0xa6d636=_0xa6d636-0x0;var _0x21cf4f=_0x0ee6[_0xa6d636];return _0x21cf4f;};'use strict';var _=require(_0x60ee('0x0'));var util=require(_0x60ee('0x1'));var moment=require('moment');var BPromise=require(_0x60ee('0x2'));var rs=require(_0x60ee('0x3'));var fs=require('fs');var Redis=require(_0x60ee('0x4'));var db=require(_0x60ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x60ee('0x6'))(_0x60ee('0x7'));var config=require(_0x60ee('0x8'));var jayson=require(_0x60ee('0x9'));var client=jayson[_0x60ee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568e89,_0x2a4312,_0x234bd9){return new BPromise(function(_0x46c6e4,_0x2c76b0){return client[_0x60ee('0xb')](_0x568e89,_0x234bd9)[_0x60ee('0xc')](function(_0x2d5610){logger[_0x60ee('0xd')](_0x60ee('0xe'),_0x2a4312,_0x60ee('0xf'));logger[_0x60ee('0x10')](_0x60ee('0x11'),_0x2a4312,_0x60ee('0xf'),JSON[_0x60ee('0x12')](_0x2d5610));if(_0x2d5610['error']){if(_0x2d5610[_0x60ee('0x13')][_0x60ee('0x14')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x2a4312,_0x2d5610[_0x60ee('0x13')][_0x60ee('0x15')]);return _0x2c76b0(_0x2d5610[_0x60ee('0x13')]['message']);}logger['error'](_0x60ee('0xe'),_0x2a4312,_0x2d5610[_0x60ee('0x13')][_0x60ee('0x15')]);return _0x46c6e4(_0x2d5610[_0x60ee('0x13')][_0x60ee('0x15')]);}else{logger[_0x60ee('0xd')](_0x60ee('0xe'),_0x2a4312,'request\x20sent');_0x46c6e4(_0x2d5610['result'][_0x60ee('0x15')]);}})['catch'](function(_0x56c047){logger['error'](_0x60ee('0xe'),_0x2a4312,_0x56c047);_0x2c76b0(_0x56c047);});});}exports[_0x60ee('0x16')]=function(_0x1ce021){var _0x1d5688=this;return new Promise(function(_0x2ca858,_0x4c6cb9){return db[_0x60ee('0x17')][_0x60ee('0x18')](_0x1ce021['body'],{'raw':_0x1ce021[_0x60ee('0x19')]?_0x1ce021[_0x60ee('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1787a4){logger[_0x60ee('0xd')](_0x60ee('0x16'),_0x1ce021);logger[_0x60ee('0x10')](_0x60ee('0x16'),_0x1ce021,JSON[_0x60ee('0x12')](_0x1787a4));_0x2ca858(_0x1787a4);})[_0x60ee('0x1a')](function(_0x5191f7){logger[_0x60ee('0x13')]('CreateSquareReport',_0x5191f7[_0x60ee('0x15')],_0x1ce021);_0x4c6cb9(_0x1d5688['error'](0x1f4,_0x5191f7['message']));});});};exports[_0x60ee('0x1b')]=function(_0x2d55ab){var _0x137aa4=this;return new Promise(function(_0x18d1c1,_0x54d8ad){return db[_0x60ee('0x17')]['update'](_0x2d55ab[_0x60ee('0x1c')],{'raw':_0x2d55ab[_0x60ee('0x19')]?_0x2d55ab[_0x60ee('0x19')][_0x60ee('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d55ab[_0x60ee('0x19')]?_0x2d55ab[_0x60ee('0x19')][_0x60ee('0x1e')]||null:null,'attributes':_0x2d55ab[_0x60ee('0x19')]?_0x2d55ab['options'][_0x60ee('0x1f')]||null:null,'limit':_0x2d55ab[_0x60ee('0x19')]?_0x2d55ab['options'][_0x60ee('0x20')]||null:null})[_0x60ee('0xc')](function(_0x3d719e){logger[_0x60ee('0xd')](_0x60ee('0x1b'),_0x2d55ab);logger['debug'](_0x60ee('0x1b'),_0x2d55ab,JSON['stringify'](_0x3d719e));_0x18d1c1(_0x3d719e);})[_0x60ee('0x1a')](function(_0x3c3658){logger['error'](_0x60ee('0x1b'),_0x3c3658[_0x60ee('0x15')],_0x2d55ab);_0x54d8ad(_0x137aa4[_0x60ee('0x13')](0x1f4,_0x3c3658[_0x60ee('0x15')]));});});}; \ No newline at end of file +var _0x675e=['SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareReport','create','body','raw','debug','UpdateSquareReport','SquareReport','update','options','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x50121c,_0x44f069){var _0x3138b9=function(_0x18ac4f){while(--_0x18ac4f){_0x50121c['push'](_0x50121c['shift']());}};_0x3138b9(++_0x44f069);}(_0x675e,0x18a));var _0xe675=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0x675e[_0x1d2bc8];return _0x1857e1;};'use strict';var _=require('lodash');var util=require(_0xe675('0x0'));var moment=require(_0xe675('0x1'));var BPromise=require(_0xe675('0x2'));var rs=require(_0xe675('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe675('0x4'))['db'];var utils=require(_0xe675('0x5'));var logger=require(_0xe675('0x6'))(_0xe675('0x7'));var config=require(_0xe675('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe675('0x9')][_0xe675('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d2ac0,_0x514842,_0x518f7b){return new BPromise(function(_0x1f7204,_0x36181f){return client[_0xe675('0xb')](_0x1d2ac0,_0x518f7b)[_0xe675('0xc')](function(_0x1b5ef1){logger[_0xe675('0xd')](_0xe675('0xe'),_0x514842,_0xe675('0xf'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x514842,_0xe675('0xf'),JSON[_0xe675('0x10')](_0x1b5ef1));if(_0x1b5ef1[_0xe675('0x11')]){if(_0x1b5ef1[_0xe675('0x11')][_0xe675('0x12')]===0x1f4){logger[_0xe675('0x11')]('SquareReport,\x20%s,\x20%s',_0x514842,_0x1b5ef1[_0xe675('0x11')][_0xe675('0x13')]);return _0x36181f(_0x1b5ef1[_0xe675('0x11')]['message']);}logger[_0xe675('0x11')](_0xe675('0xe'),_0x514842,_0x1b5ef1[_0xe675('0x11')][_0xe675('0x13')]);return _0x1f7204(_0x1b5ef1['error'][_0xe675('0x13')]);}else{logger[_0xe675('0xd')](_0xe675('0xe'),_0x514842,_0xe675('0xf'));_0x1f7204(_0x1b5ef1[_0xe675('0x14')]['message']);}})[_0xe675('0x15')](function(_0x1e02eb){logger[_0xe675('0x11')](_0xe675('0xe'),_0x514842,_0x1e02eb);_0x36181f(_0x1e02eb);});});}exports[_0xe675('0x16')]=function(_0xbcdeec){var _0x5e27ec=this;return new Promise(function(_0x4ffd73,_0xc77dd6){return db['SquareReport'][_0xe675('0x17')](_0xbcdeec[_0xe675('0x18')],{'raw':_0xbcdeec['options']?_0xbcdeec['options'][_0xe675('0x19')]===undefined?!![]:![]:!![]})[_0xe675('0xc')](function(_0x4b4ca9){logger[_0xe675('0xd')]('CreateSquareReport',_0xbcdeec);logger[_0xe675('0x1a')](_0xe675('0x16'),_0xbcdeec,JSON['stringify'](_0x4b4ca9));_0x4ffd73(_0x4b4ca9);})['catch'](function(_0x8c7a24){logger['error'](_0xe675('0x16'),_0x8c7a24['message'],_0xbcdeec);_0xc77dd6(_0x5e27ec['error'](0x1f4,_0x8c7a24[_0xe675('0x13')]));});});};exports[_0xe675('0x1b')]=function(_0x2a5de3){var _0x2a60f3=this;return new Promise(function(_0x164c6a,_0x4bf846){return db[_0xe675('0x1c')][_0xe675('0x1d')](_0x2a5de3[_0xe675('0x18')],{'raw':_0x2a5de3[_0xe675('0x1e')]?_0x2a5de3[_0xe675('0x1e')][_0xe675('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a5de3[_0xe675('0x1e')]?_0x2a5de3[_0xe675('0x1e')][_0xe675('0x1f')]||null:null,'attributes':_0x2a5de3[_0xe675('0x1e')]?_0x2a5de3['options'][_0xe675('0x20')]||null:null,'limit':_0x2a5de3['options']?_0x2a5de3['options'][_0xe675('0x21')]||null:null})[_0xe675('0xc')](function(_0x3809ef){logger[_0xe675('0xd')](_0xe675('0x1b'),_0x2a5de3);logger[_0xe675('0x1a')]('UpdateSquareReport',_0x2a5de3,JSON[_0xe675('0x10')](_0x3809ef));_0x164c6a(_0x3809ef);})[_0xe675('0x15')](function(_0x597281){logger[_0xe675('0x11')](_0xe675('0x1b'),_0x597281['message'],_0x2a5de3);_0x4bf846(_0x2a60f3[_0xe675('0x11')](0x1f4,_0x597281[_0xe675('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b80d861..b0a2c58 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 _0x7ad2=['update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7ad2,0x153));var _0x27ad=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7ad2[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x27ad('0x0'));var util=require('util');var path=require(_0x27ad('0x1'));var timeout=require(_0x27ad('0x2'));var express=require(_0x27ad('0x3'));var router=express[_0x27ad('0x4')]();var auth=require(_0x27ad('0x5'));var interaction=require(_0x27ad('0x6'));var config=require('../../config/environment');var controller=require(_0x27ad('0x7'));router[_0x27ad('0x8')]('/',auth[_0x27ad('0x9')](),controller[_0x27ad('0xa')]);router['get'](_0x27ad('0xb'),auth['isAuthenticated'](),controller[_0x27ad('0xc')]);router['get'](_0x27ad('0xd'),auth[_0x27ad('0x9')](),controller[_0x27ad('0xe')]);router[_0x27ad('0xf')]('/',auth[_0x27ad('0x9')](),controller[_0x27ad('0x10')]);router[_0x27ad('0x11')](_0x27ad('0xd'),auth[_0x27ad('0x9')](),controller[_0x27ad('0x12')]);router[_0x27ad('0x13')](_0x27ad('0xd'),auth[_0x27ad('0x9')](),controller[_0x27ad('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5d3e=['show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3d7fd4,_0x10f3aa){var _0x265928=function(_0x2c711a){while(--_0x2c711a){_0x3d7fd4['push'](_0x3d7fd4['shift']());}};_0x265928(++_0x10f3aa);}(_0x5d3e,0x12e));var _0xe5d3=function(_0x2da187,_0x2b098a){_0x2da187=_0x2da187-0x0;var _0x1c5366=_0x5d3e[_0x2da187];return _0x1c5366;};'use strict';var multer=require(_0xe5d3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe5d3('0x1'));var express=require('express');var router=express[_0xe5d3('0x2')]();var auth=require(_0xe5d3('0x3'));var interaction=require(_0xe5d3('0x4'));var config=require(_0xe5d3('0x5'));var controller=require(_0xe5d3('0x6'));router[_0xe5d3('0x7')]('/',auth[_0xe5d3('0x8')](),controller[_0xe5d3('0x9')]);router[_0xe5d3('0x7')](_0xe5d3('0xa'),auth[_0xe5d3('0x8')](),controller[_0xe5d3('0xb')]);router[_0xe5d3('0x7')](_0xe5d3('0xc'),auth[_0xe5d3('0x8')](),controller[_0xe5d3('0xd')]);router[_0xe5d3('0xe')]('/',auth[_0xe5d3('0x8')](),controller[_0xe5d3('0xf')]);router[_0xe5d3('0x10')](_0xe5d3('0xc'),auth['isAuthenticated'](),controller[_0xe5d3('0x11')]);router[_0xe5d3('0x12')](_0xe5d3('0xc'),auth['isAuthenticated'](),controller[_0xe5d3('0x13')]);module[_0xe5d3('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2a19b21..3ed7539 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 _0xe50b=['STRING','sequelize','exports'];(function(_0x1cbd2e,_0x218a03){var _0x11e5b9=function(_0xca2061){while(--_0xca2061){_0x1cbd2e['push'](_0x1cbd2e['shift']());}};_0x11e5b9(++_0x218a03);}(_0xe50b,0x169));var _0xbe50=function(_0x161934,_0x25376f){_0x161934=_0x161934-0x0;var _0x22c8d5=_0xe50b[_0x161934];return _0x22c8d5;};'use strict';var Sequelize=require(_0xbe50('0x0'));module[_0xbe50('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xbe50('0x2')]},'application':{'type':Sequelize[_0xbe50('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xbe50('0x2')]},'callerid':{'type':Sequelize[_0xbe50('0x2')]}}; \ No newline at end of file +var _0x02fd=['sequelize','exports','STRING'];(function(_0x4be6a6,_0x184f2a){var _0x12100f=function(_0xc19615){while(--_0xc19615){_0x4be6a6['push'](_0x4be6a6['shift']());}};_0x12100f(++_0x184f2a);}(_0x02fd,0x1ad));var _0xd02f=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x02fd[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0xd02f('0x0'));module[_0xd02f('0x1')]={'uniqueid':{'type':Sequelize[_0xd02f('0x2')]},'node':{'type':Sequelize[_0xd02f('0x2')]},'application':{'type':Sequelize[_0xd02f('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xd02f('0x2')]},'callerid':{'type':Sequelize[_0xd02f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 219e6a0..108d168 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 _0x9018=['merge','options','include','findAll','catch','show','params','intersection','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','send','index','SquareDetailsReport','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','key','field'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9018,0x129));var _0x8901=function(_0xda91c9,_0x2c912f){_0xda91c9=_0xda91c9-0x0;var _0x628cc4=_0x9018[_0xda91c9];return _0x628cc4;};'use strict';var pdf=require(_0x8901('0x0'));var emlformat=require(_0x8901('0x1'));var rimraf=require(_0x8901('0x2'));var zipdir=require(_0x8901('0x3'));var jsonpatch=require(_0x8901('0x4'));var rp=require('request-promise');var moment=require(_0x8901('0x5'));var BPromise=require(_0x8901('0x6'));var Mustache=require(_0x8901('0x7'));var util=require(_0x8901('0x8'));var path=require(_0x8901('0x9'));var sox=require('sox');var csv=require(_0x8901('0xa'));var ejs=require(_0x8901('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8901('0xc'));var crypto=require(_0x8901('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8901('0xe'));var toCsv=require(_0x8901('0xa'));var querystring=require(_0x8901('0xf'));var Papa=require(_0x8901('0x10'));var Redis=require(_0x8901('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8901('0x12'));var hardwareService=require(_0x8901('0x13'));var logger=require(_0x8901('0x14'))(_0x8901('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8901('0x16'))['db'];function respondWithStatusCode(_0x290b64,_0x4228fc){_0x4228fc=_0x4228fc||0xcc;return function(_0x29a140){if(_0x29a140){return _0x290b64[_0x8901('0x17')](_0x4228fc);}return _0x290b64[_0x8901('0x18')](_0x4228fc)[_0x8901('0x19')]();};}function respondWithResult(_0x22335e,_0x2c371b){_0x2c371b=_0x2c371b||0xc8;return function(_0x55201e){if(_0x55201e){return _0x22335e[_0x8901('0x18')](_0x2c371b)[_0x8901('0x1a')](_0x55201e);}};}function respondWithFilteredResult(_0xa576f,_0x243d06){return function(_0x3148a5){if(_0x3148a5){var _0xf13cae=_0x3148a5[_0x8901('0x1b')],_0x11c5ac=_0x243d06[_0x8901('0x1c')],_0x2cc9c9=_0x243d06[_0x8901('0x1c')]+_0x243d06[_0x8901('0x1d')],_0x3ab14c;if(_0x2cc9c9>=_0xf13cae){_0x2cc9c9=_0xf13cae;_0x3ab14c=0xc8;}else{_0x3ab14c=0xce;}_0xa576f['status'](_0x3ab14c);return _0xa576f['set'](_0x8901('0x1e'),_0x11c5ac+'-'+_0x2cc9c9+'/'+_0xf13cae)['json'](_0x3148a5);}return null;};}function patchUpdates(_0x5645e1){return function(_0x14a890){try{jsonpatch[_0x8901('0x1f')](_0x14a890,_0x5645e1,!![]);}catch(_0x5affb1){return BPromise[_0x8901('0x20')](_0x5affb1);}return _0x14a890[_0x8901('0x21')]();};}function saveUpdates(_0x2a03fb,_0x22cbcb){return function(_0x27e0db){if(_0x27e0db){return _0x27e0db[_0x8901('0x22')](_0x2a03fb)['then'](function(_0x3e78d2){return _0x3e78d2;});}return null;};}function removeEntity(_0x3fad9e,_0xc62910){return function(_0x3d0d07){if(_0x3d0d07){return _0x3d0d07[_0x8901('0x23')]()[_0x8901('0x24')](function(){_0x3fad9e[_0x8901('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7a79,_0x11fdce){return function(_0x1c167f){if(!_0x1c167f){_0x2b7a79['sendStatus'](0x194);}return _0x1c167f;};}function handleError(_0x5a640b,_0x184299){_0x184299=_0x184299||0x1f4;return function(_0x4aeb60){logger[_0x8901('0x25')](_0x4aeb60['stack']);if(_0x4aeb60['name']){delete _0x4aeb60['name'];}_0x5a640b[_0x8901('0x18')](_0x184299)[_0x8901('0x26')](_0x4aeb60);};}exports[_0x8901('0x27')]=function(_0x1998ea,_0xa420bf){var _0x24cbe2={},_0x579ccb={},_0x4337ee={'count':0x0,'rows':[]};var _0x3e1a22=db[_0x8901('0x28')][_0x8901('0x29')];_0x579ccb[_0x8901('0x2a')]=_[_0x8901('0x2b')](_0x3e1a22);_0x579ccb[_0x8901('0x2c')]=_[_0x8901('0x2b')](_0x1998ea[_0x8901('0x2c')]);_0x579ccb['filters']=_['intersection'](_0x579ccb['model'],_0x579ccb[_0x8901('0x2c')]);_0x24cbe2['attributes']=_['intersection'](_0x579ccb[_0x8901('0x2a')],qs['fields'](_0x1998ea['query'][_0x8901('0x2d')]));_0x24cbe2[_0x8901('0x2e')]=_0x24cbe2[_0x8901('0x2e')][_0x8901('0x2f')]?_0x24cbe2['attributes']:_0x579ccb['model'];if(!_0x1998ea[_0x8901('0x2c')][_0x8901('0x30')](_0x8901('0x31'))){_0x24cbe2['limit']=qs[_0x8901('0x1d')](_0x1998ea[_0x8901('0x2c')]['limit']);_0x24cbe2[_0x8901('0x1c')]=qs[_0x8901('0x1c')](_0x1998ea[_0x8901('0x2c')][_0x8901('0x1c')]);}_0x24cbe2[_0x8901('0x32')]=qs['sort'](_0x1998ea[_0x8901('0x2c')][_0x8901('0x33')]);_0x24cbe2[_0x8901('0x34')]=qs[_0x8901('0x35')](_['pick'](_0x1998ea[_0x8901('0x2c')],_0x579ccb[_0x8901('0x35')]));if(_0x1998ea[_0x8901('0x2c')][_0x8901('0x36')]){_0x24cbe2[_0x8901('0x34')]=_['merge'](_0x24cbe2[_0x8901('0x34')],{'$or':_['map'](_0x3e1a22,function(_0x14d9e6){if(_0x14d9e6[_0x8901('0x37')][_0x8901('0x38')]!=='VIRTUAL'){var _0x4d165c={};_0x4d165c[_0x14d9e6[_0x8901('0x39')]]={'$like':'%'+_0x1998ea[_0x8901('0x2c')]['filter']+'%'};return _0x4d165c;}})});}_0x24cbe2=_[_0x8901('0x3a')]({},_0x24cbe2,_0x1998ea[_0x8901('0x3b')]);var _0x2a6cfa={'where':_0x24cbe2['where']};return db[_0x8901('0x28')][_0x8901('0x1b')](_0x2a6cfa)['then'](function(_0x36b6b8){_0x4337ee['count']=_0x36b6b8;if(_0x1998ea[_0x8901('0x2c')]['includeAll']){_0x24cbe2[_0x8901('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x8901('0x3d')](_0x24cbe2);})[_0x8901('0x24')](function(_0x18b785){_0x4337ee['rows']=_0x18b785;return _0x4337ee;})[_0x8901('0x24')](respondWithFilteredResult(_0xa420bf,_0x24cbe2))[_0x8901('0x3e')](handleError(_0xa420bf,null));};exports[_0x8901('0x3f')]=function(_0x110846,_0x213eb9){var _0x13752b={'raw':!![],'where':{'id':_0x110846[_0x8901('0x40')]['id']}},_0x49788f={};_0x49788f[_0x8901('0x2a')]=_[_0x8901('0x2b')](db['SquareDetailsReport'][_0x8901('0x29')]);_0x49788f[_0x8901('0x2c')]=_[_0x8901('0x2b')](_0x110846[_0x8901('0x2c')]);_0x49788f[_0x8901('0x35')]=_[_0x8901('0x41')](_0x49788f[_0x8901('0x2a')],_0x49788f['query']);_0x13752b['attributes']=_[_0x8901('0x41')](_0x49788f['model'],qs[_0x8901('0x2d')](_0x110846[_0x8901('0x2c')][_0x8901('0x2d')]));_0x13752b[_0x8901('0x2e')]=_0x13752b[_0x8901('0x2e')][_0x8901('0x2f')]?_0x13752b[_0x8901('0x2e')]:_0x49788f['model'];if(_0x110846['query'][_0x8901('0x42')]){_0x13752b[_0x8901('0x3c')]=[{'all':!![]}];}_0x13752b=_[_0x8901('0x3a')]({},_0x13752b,_0x110846[_0x8901('0x3b')]);return db['SquareDetailsReport']['find'](_0x13752b)[_0x8901('0x24')](handleEntityNotFound(_0x213eb9,null))['then'](respondWithResult(_0x213eb9,null))[_0x8901('0x3e')](handleError(_0x213eb9,null));};exports[_0x8901('0x43')]=function(_0x35a56f,_0x43cfb9){return db['SquareDetailsReport'][_0x8901('0x43')](_0x35a56f[_0x8901('0x44')],{})[_0x8901('0x24')](respondWithResult(_0x43cfb9,0xc9))[_0x8901('0x3e')](handleError(_0x43cfb9,null));};exports[_0x8901('0x22')]=function(_0x153435,_0x1c660f){if(_0x153435[_0x8901('0x44')]['id']){delete _0x153435[_0x8901('0x44')]['id'];}return db[_0x8901('0x28')][_0x8901('0x45')]({'where':{'id':_0x153435[_0x8901('0x40')]['id']}})['then'](handleEntityNotFound(_0x1c660f,null))['then'](saveUpdates(_0x153435[_0x8901('0x44')],null))[_0x8901('0x24')](respondWithResult(_0x1c660f,null))[_0x8901('0x3e')](handleError(_0x1c660f,null));};exports[_0x8901('0x23')]=function(_0x25ada3,_0xaa3eae){return db[_0x8901('0x28')][_0x8901('0x45')]({'where':{'id':_0x25ada3[_0x8901('0x40')]['id']}})[_0x8901('0x24')](handleEntityNotFound(_0xaa3eae,null))[_0x8901('0x24')](removeEntity(_0xaa3eae,null))[_0x8901('0x3e')](handleError(_0xaa3eae,null));};exports['describe']=function(_0x48ae61,_0x4ceacc){return db[_0x8901('0x28')][_0x8901('0x46')]()[_0x8901('0x24')](respondWithResult(_0x4ceacc,null))[_0x8901('0x3e')](handleError(_0x4ceacc,null));}; \ No newline at end of file +var _0x799b=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','SquareDetailsReport','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x490233,_0x28e717){var _0x130b01=function(_0x4c4326){while(--_0x4c4326){_0x490233['push'](_0x490233['shift']());}};_0x130b01(++_0x28e717);}(_0x799b,0x116));var _0xb799=function(_0x58417c,_0x46cbd8){_0x58417c=_0x58417c-0x0;var _0x2a5c79=_0x799b[_0x58417c];return _0x2a5c79;};'use strict';var pdf=require(_0xb799('0x0'));var emlformat=require(_0xb799('0x1'));var rimraf=require(_0xb799('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb799('0x3'));var rp=require('request-promise');var moment=require(_0xb799('0x4'));var BPromise=require(_0xb799('0x5'));var Mustache=require(_0xb799('0x6'));var util=require(_0xb799('0x7'));var path=require(_0xb799('0x8'));var sox=require(_0xb799('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb799('0xa'));var squel=require(_0xb799('0xb'));var crypto=require(_0xb799('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb799('0xd'));var toCsv=require(_0xb799('0xe'));var querystring=require(_0xb799('0xf'));var Papa=require(_0xb799('0x10'));var Redis=require('ioredis');var authService=require(_0xb799('0x11'));var qs=require(_0xb799('0x12'));var hardwareService=require(_0xb799('0x13'));var logger=require(_0xb799('0x14'))(_0xb799('0x15'));var utils=require('../../config/utils');var config=require(_0xb799('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bde6a,_0x592185){_0x592185=_0x592185||0xcc;return function(_0x2c3890){if(_0x2c3890){return _0x5bde6a[_0xb799('0x17')](_0x592185);}return _0x5bde6a[_0xb799('0x18')](_0x592185)['end']();};}function respondWithResult(_0x3e97ab,_0x17cdec){_0x17cdec=_0x17cdec||0xc8;return function(_0x10a7a9){if(_0x10a7a9){return _0x3e97ab[_0xb799('0x18')](_0x17cdec)[_0xb799('0x19')](_0x10a7a9);}};}function respondWithFilteredResult(_0x280e34,_0x54693b){return function(_0x1079dc){if(_0x1079dc){var _0x147222=_0x1079dc[_0xb799('0x1a')],_0x23a018=_0x54693b[_0xb799('0x1b')],_0xd559cd=_0x54693b[_0xb799('0x1b')]+_0x54693b[_0xb799('0x1c')],_0x317fdc;if(_0xd559cd>=_0x147222){_0xd559cd=_0x147222;_0x317fdc=0xc8;}else{_0x317fdc=0xce;}_0x280e34[_0xb799('0x18')](_0x317fdc);return _0x280e34[_0xb799('0x1d')](_0xb799('0x1e'),_0x23a018+'-'+_0xd559cd+'/'+_0x147222)['json'](_0x1079dc);}return null;};}function patchUpdates(_0x25374b){return function(_0x2f31dd){try{jsonpatch['apply'](_0x2f31dd,_0x25374b,!![]);}catch(_0x52b3bc){return BPromise[_0xb799('0x1f')](_0x52b3bc);}return _0x2f31dd[_0xb799('0x20')]();};}function saveUpdates(_0x57bbea,_0x1bbf28){return function(_0x53c33a){if(_0x53c33a){return _0x53c33a[_0xb799('0x21')](_0x57bbea)[_0xb799('0x22')](function(_0x3fda9d){return _0x3fda9d;});}return null;};}function removeEntity(_0x39e856,_0x213a2d){return function(_0x5cf98e){if(_0x5cf98e){return _0x5cf98e[_0xb799('0x23')]()[_0xb799('0x22')](function(){_0x39e856[_0xb799('0x18')](0xcc)[_0xb799('0x24')]();});}};}function handleEntityNotFound(_0x2ef927,_0x2efbf3){return function(_0x28aeeb){if(!_0x28aeeb){_0x2ef927['sendStatus'](0x194);}return _0x28aeeb;};}function handleError(_0x34ed77,_0x38deec){_0x38deec=_0x38deec||0x1f4;return function(_0x554a33){logger[_0xb799('0x25')](_0x554a33[_0xb799('0x26')]);if(_0x554a33[_0xb799('0x27')]){delete _0x554a33['name'];}_0x34ed77[_0xb799('0x18')](_0x38deec)[_0xb799('0x28')](_0x554a33);};}exports[_0xb799('0x29')]=function(_0x43cbea,_0x512af6){var _0x29a3eb={},_0x37ca68={},_0x8c569b={'count':0x0,'rows':[]};var _0x178292=db[_0xb799('0x2a')]['rawAttributes'];_0x37ca68[_0xb799('0x2b')]=_[_0xb799('0x2c')](_0x178292);_0x37ca68['query']=_[_0xb799('0x2c')](_0x43cbea['query']);_0x37ca68[_0xb799('0x2d')]=_[_0xb799('0x2e')](_0x37ca68[_0xb799('0x2b')],_0x37ca68[_0xb799('0x2f')]);_0x29a3eb[_0xb799('0x30')]=_['intersection'](_0x37ca68['model'],qs['fields'](_0x43cbea[_0xb799('0x2f')][_0xb799('0x31')]));_0x29a3eb[_0xb799('0x30')]=_0x29a3eb[_0xb799('0x30')]['length']?_0x29a3eb['attributes']:_0x37ca68[_0xb799('0x2b')];if(!_0x43cbea[_0xb799('0x2f')][_0xb799('0x32')]('nolimit')){_0x29a3eb[_0xb799('0x1c')]=qs[_0xb799('0x1c')](_0x43cbea[_0xb799('0x2f')][_0xb799('0x1c')]);_0x29a3eb['offset']=qs['offset'](_0x43cbea[_0xb799('0x2f')][_0xb799('0x1b')]);}_0x29a3eb[_0xb799('0x33')]=qs[_0xb799('0x34')](_0x43cbea['query'][_0xb799('0x34')]);_0x29a3eb['where']=qs[_0xb799('0x2d')](_[_0xb799('0x35')](_0x43cbea[_0xb799('0x2f')],_0x37ca68[_0xb799('0x2d')]));if(_0x43cbea[_0xb799('0x2f')][_0xb799('0x36')]){_0x29a3eb[_0xb799('0x37')]=_['merge'](_0x29a3eb[_0xb799('0x37')],{'$or':_[_0xb799('0x38')](_0x178292,function(_0x5f3c72){if(_0x5f3c72[_0xb799('0x39')][_0xb799('0x3a')]!==_0xb799('0x3b')){var _0x346828={};_0x346828[_0x5f3c72[_0xb799('0x3c')]]={'$like':'%'+_0x43cbea[_0xb799('0x2f')]['filter']+'%'};return _0x346828;}})});}_0x29a3eb=_['merge']({},_0x29a3eb,_0x43cbea[_0xb799('0x3d')]);var _0x310a69={'where':_0x29a3eb[_0xb799('0x37')]};return db['SquareDetailsReport']['count'](_0x310a69)[_0xb799('0x22')](function(_0x1f8272){_0x8c569b['count']=_0x1f8272;if(_0x43cbea[_0xb799('0x2f')][_0xb799('0x3e')]){_0x29a3eb[_0xb799('0x3f')]=[{'all':!![]}];}return db[_0xb799('0x2a')][_0xb799('0x40')](_0x29a3eb);})[_0xb799('0x22')](function(_0x23bcab){_0x8c569b[_0xb799('0x41')]=_0x23bcab;return _0x8c569b;})[_0xb799('0x22')](respondWithFilteredResult(_0x512af6,_0x29a3eb))[_0xb799('0x42')](handleError(_0x512af6,null));};exports[_0xb799('0x43')]=function(_0x57e2b6,_0x48b111){var _0x1a1782={'raw':!![],'where':{'id':_0x57e2b6['params']['id']}},_0x4afd06={};_0x4afd06[_0xb799('0x2b')]=_[_0xb799('0x2c')](db['SquareDetailsReport']['rawAttributes']);_0x4afd06[_0xb799('0x2f')]=_[_0xb799('0x2c')](_0x57e2b6['query']);_0x4afd06['filters']=_[_0xb799('0x2e')](_0x4afd06[_0xb799('0x2b')],_0x4afd06[_0xb799('0x2f')]);_0x1a1782[_0xb799('0x30')]=_[_0xb799('0x2e')](_0x4afd06[_0xb799('0x2b')],qs[_0xb799('0x31')](_0x57e2b6[_0xb799('0x2f')][_0xb799('0x31')]));_0x1a1782[_0xb799('0x30')]=_0x1a1782['attributes'][_0xb799('0x44')]?_0x1a1782[_0xb799('0x30')]:_0x4afd06[_0xb799('0x2b')];if(_0x57e2b6[_0xb799('0x2f')][_0xb799('0x3e')]){_0x1a1782[_0xb799('0x3f')]=[{'all':!![]}];}_0x1a1782=_['merge']({},_0x1a1782,_0x57e2b6[_0xb799('0x3d')]);return db['SquareDetailsReport'][_0xb799('0x45')](_0x1a1782)[_0xb799('0x22')](handleEntityNotFound(_0x48b111,null))[_0xb799('0x22')](respondWithResult(_0x48b111,null))[_0xb799('0x42')](handleError(_0x48b111,null));};exports['create']=function(_0x4f4945,_0x52bc15){return db[_0xb799('0x2a')][_0xb799('0x46')](_0x4f4945[_0xb799('0x47')],{})['then'](respondWithResult(_0x52bc15,0xc9))['catch'](handleError(_0x52bc15,null));};exports[_0xb799('0x21')]=function(_0x2e0319,_0xcceccb){if(_0x2e0319[_0xb799('0x47')]['id']){delete _0x2e0319[_0xb799('0x47')]['id'];}return db[_0xb799('0x2a')]['find']({'where':{'id':_0x2e0319[_0xb799('0x48')]['id']}})['then'](handleEntityNotFound(_0xcceccb,null))[_0xb799('0x22')](saveUpdates(_0x2e0319[_0xb799('0x47')],null))['then'](respondWithResult(_0xcceccb,null))['catch'](handleError(_0xcceccb,null));};exports['destroy']=function(_0x3d9b32,_0x5c86bd){return db[_0xb799('0x2a')][_0xb799('0x45')]({'where':{'id':_0x3d9b32[_0xb799('0x48')]['id']}})[_0xb799('0x22')](handleEntityNotFound(_0x5c86bd,null))['then'](removeEntity(_0x5c86bd,null))[_0xb799('0x42')](handleError(_0x5c86bd,null));};exports[_0xb799('0x49')]=function(_0xcdeb74,_0x2baab7){return db[_0xb799('0x2a')][_0xb799('0x49')]()[_0xb799('0x22')](respondWithResult(_0x2baab7,null))['catch'](handleError(_0x2baab7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 2c00bc0..3b196c0 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 _0xda19=['exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x36af63,_0x451edb){var _0x1d4656=function(_0xd72d9a){while(--_0xd72d9a){_0x36af63['push'](_0x36af63['shift']());}};_0x1d4656(++_0x451edb);}(_0xda19,0xd5));var _0x9da1=function(_0x43a737,_0x449230){_0x43a737=_0x43a737-0x0;var _0x2257cc=_0xda19[_0x43a737];return _0x2257cc;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7374=['SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3d4c09,_0x30ba2d){var _0x4779f8=function(_0x44b4b3){while(--_0x44b4b3){_0x3d4c09['push'](_0x3d4c09['shift']());}};_0x4779f8(++_0x30ba2d);}(_0x7374,0x1b9));var _0x4737=function(_0x5b664b,_0x1eba3b){_0x5b664b=_0x5b664b-0x0;var _0x2f2b53=_0x7374[_0x5b664b];return _0x2f2b53;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('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 a163a77..0c8afba 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 _0x1d25=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','util','moment'];(function(_0x3559c4,_0x47580b){var _0x124053=function(_0x2edf1){while(--_0x2edf1){_0x3559c4['push'](_0x3559c4['shift']());}};_0x124053(++_0x47580b);}(_0x1d25,0xba));var _0x51d2=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x1d25[_0x50a004];return _0x5e9992;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var moment=require(_0x51d2('0x2'));var BPromise=require(_0x51d2('0x3'));var rs=require(_0x51d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51d2('0x5'))['db'];var utils=require(_0x51d2('0x6'));var logger=require('../../config/logger')(_0x51d2('0x7'));var config=require(_0x51d2('0x8'));var jayson=require(_0x51d2('0x9'));var client=jayson[_0x51d2('0xa')][_0x51d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6956,_0x56edda,_0x18e8a9){return new BPromise(function(_0x5a6b5f,_0x419156){return client['request'](_0x2e6956,_0x18e8a9)['then'](function(_0x30d7d0){logger[_0x51d2('0xc')](_0x51d2('0xd'),_0x56edda,_0x51d2('0xe'));logger['debug'](_0x51d2('0xf'),_0x56edda,_0x51d2('0xe'),JSON[_0x51d2('0x10')](_0x30d7d0));if(_0x30d7d0[_0x51d2('0x11')]){if(_0x30d7d0[_0x51d2('0x11')]['code']===0x1f4){logger[_0x51d2('0x11')](_0x51d2('0xd'),_0x56edda,_0x30d7d0['error']['message']);return _0x419156(_0x30d7d0[_0x51d2('0x11')][_0x51d2('0x12')]);}logger[_0x51d2('0x11')](_0x51d2('0xd'),_0x56edda,_0x30d7d0[_0x51d2('0x11')]['message']);return _0x5a6b5f(_0x30d7d0[_0x51d2('0x11')]['message']);}else{logger[_0x51d2('0xc')](_0x51d2('0xd'),_0x56edda,_0x51d2('0xe'));_0x5a6b5f(_0x30d7d0['result'][_0x51d2('0x12')]);}})[_0x51d2('0x13')](function(_0x14a682){logger[_0x51d2('0x11')](_0x51d2('0xd'),_0x56edda,_0x14a682);_0x419156(_0x14a682);});});}exports[_0x51d2('0x14')]=function(_0x131528){var _0x2349df=this;return new Promise(function(_0x48437e,_0x2d40ed){return db[_0x51d2('0x15')][_0x51d2('0x16')](_0x131528[_0x51d2('0x17')],{'raw':_0x131528[_0x51d2('0x18')]?_0x131528[_0x51d2('0x18')][_0x51d2('0x19')]===undefined?!![]:![]:!![]})[_0x51d2('0x1a')](function(_0x2413fe){logger['info'](_0x51d2('0x14'),_0x131528);logger['debug'](_0x51d2('0x14'),_0x131528,JSON[_0x51d2('0x10')](_0x2413fe));_0x48437e(_0x2413fe);})[_0x51d2('0x13')](function(_0x28b889){logger[_0x51d2('0x11')](_0x51d2('0x14'),_0x28b889[_0x51d2('0x12')],_0x131528);_0x2d40ed(_0x2349df[_0x51d2('0x11')](0x1f4,_0x28b889['message']));});});}; \ No newline at end of file +var _0xfd0f=['http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x302fed,_0x4bd23e){var _0x49ed1d=function(_0x1e25b3){while(--_0x1e25b3){_0x302fed['push'](_0x302fed['shift']());}};_0x49ed1d(++_0x4bd23e);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x383367,_0x4ca0f2){_0x383367=_0x383367-0x0;var _0x14888f=_0xfd0f[_0x383367];return _0x14888f;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var moment=require('moment');var BPromise=require(_0xffd0('0x2'));var rs=require(_0xffd0('0x3'));var fs=require('fs');var Redis=require(_0xffd0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffd0('0x5'));var logger=require('../../config/logger')(_0xffd0('0x6'));var config=require(_0xffd0('0x7'));var jayson=require(_0xffd0('0x8'));var client=jayson[_0xffd0('0x9')][_0xffd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b64a5,_0x2aaee6,_0x3fcf31){return new BPromise(function(_0x55488d,_0x4e2d54){return client[_0xffd0('0xb')](_0x1b64a5,_0x3fcf31)[_0xffd0('0xc')](function(_0x1b3842){logger[_0xffd0('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x2aaee6,'request\x20sent');logger[_0xffd0('0xe')](_0xffd0('0xf'),_0x2aaee6,_0xffd0('0x10'),JSON['stringify'](_0x1b3842));if(_0x1b3842['error']){if(_0x1b3842[_0xffd0('0x11')][_0xffd0('0x12')]===0x1f4){logger['error'](_0xffd0('0x13'),_0x2aaee6,_0x1b3842[_0xffd0('0x11')][_0xffd0('0x14')]);return _0x4e2d54(_0x1b3842['error'][_0xffd0('0x14')]);}logger[_0xffd0('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x2aaee6,_0x1b3842[_0xffd0('0x11')]['message']);return _0x55488d(_0x1b3842['error'][_0xffd0('0x14')]);}else{logger['info'](_0xffd0('0x13'),_0x2aaee6,_0xffd0('0x10'));_0x55488d(_0x1b3842[_0xffd0('0x15')][_0xffd0('0x14')]);}})[_0xffd0('0x16')](function(_0x5582df){logger['error'](_0xffd0('0x13'),_0x2aaee6,_0x5582df);_0x4e2d54(_0x5582df);});});}exports[_0xffd0('0x17')]=function(_0x2e9463){var _0x760b5b=this;return new Promise(function(_0x409b90,_0x322906){return db[_0xffd0('0x18')][_0xffd0('0x19')](_0x2e9463[_0xffd0('0x1a')],{'raw':_0x2e9463[_0xffd0('0x1b')]?_0x2e9463[_0xffd0('0x1b')][_0xffd0('0x1c')]===undefined?!![]:![]:!![]})[_0xffd0('0xc')](function(_0x19c523){logger[_0xffd0('0xd')](_0xffd0('0x17'),_0x2e9463);logger['debug']('CreateSquareDetailsReport',_0x2e9463,JSON[_0xffd0('0x1d')](_0x19c523));_0x409b90(_0x19c523);})[_0xffd0('0x16')](function(_0x4fbb72){logger['error'](_0xffd0('0x17'),_0x4fbb72['message'],_0x2e9463);_0x322906(_0x760b5b[_0xffd0('0x11')](0x1f4,_0x4fbb72[_0xffd0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e22b996..3b30640 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 _0x8bf3=['../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','exports','express','Router'];(function(_0x4cef58,_0x531aa7){var _0x5326ed=function(_0x3ad509){while(--_0x3ad509){_0x4cef58['push'](_0x4cef58['shift']());}};_0x5326ed(++_0x531aa7);}(_0x8bf3,0x1e6));var _0x38bf=function(_0x45aeb1,_0x5a8907){_0x45aeb1=_0x45aeb1-0x0;var _0x17d4ca=_0x8bf3[_0x45aeb1];return _0x17d4ca;};'use strict';var express=require(_0x38bf('0x0'));var router=express[_0x38bf('0x1')]();var auth=require(_0x38bf('0x2'));var controller=require('./system.controller');router[_0x38bf('0x3')]('/',auth[_0x38bf('0x4')](),controller[_0x38bf('0x5')]);router[_0x38bf('0x3')](_0x38bf('0x6'),auth[_0x38bf('0x4')](),controller['killProcess']);module[_0x38bf('0x7')]=router; \ No newline at end of file +var _0xa88d=['Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express'];(function(_0x20d06a,_0x16b092){var _0x1c48ef=function(_0x2da6d5){while(--_0x2da6d5){_0x20d06a['push'](_0x20d06a['shift']());}};_0x1c48ef(++_0x16b092);}(_0xa88d,0xa1));var _0xda88=function(_0x33f265,_0x12cecd){_0x33f265=_0x33f265-0x0;var _0x1d1124=_0xa88d[_0x33f265];return _0x1d1124;};'use strict';var express=require(_0xda88('0x0'));var router=express[_0xda88('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xda88('0x2'));router[_0xda88('0x3')]('/',auth['isAuthenticated'](),controller[_0xda88('0x4')]);router['get'](_0xda88('0x5'),auth[_0xda88('0x6')](),controller[_0xda88('0x7')]);module[_0xda88('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 209fb6b..b42a695 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 _0xf6e9=['child_process','exec','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation'];(function(_0x12c076,_0x5bef17){var _0x2ddd18=function(_0x436336){while(--_0x436336){_0x12c076['push'](_0x12c076['shift']());}};_0x2ddd18(++_0x5bef17);}(_0xf6e9,0x151));var _0x9f6e=function(_0x302f3f,_0x1e34a3){_0x302f3f=_0x302f3f-0x0;var _0x3c591d=_0xf6e9[_0x302f3f];return _0x3c591d;};'use strict';var info=require(_0x9f6e('0x0'));var exec=require(_0x9f6e('0x1'))[_0x9f6e('0x2')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0x9f6e('0x3'));var _=require(_0x9f6e('0x4'));function handleError(_0x1677b4,_0x1f8a29,_0x2536e2){_0x1f8a29=_0x1f8a29||0x1f4;return function(_0x4da534){logger[_0x9f6e('0x5')](_0x9f6e('0x6'),_0x2536e2,_0x1f8a29,util['inspect'](_0x4da534,{'showHidden':![],'depth':null}));delete _0x4da534[_0x9f6e('0x7')];_0x1677b4[_0x9f6e('0x8')](_0x1f8a29)[_0x9f6e('0x9')](_0x4da534);};}exports[_0x9f6e('0xa')]=function(_0x2d510a,_0x45c7b4){return info[_0x9f6e('0xb')]()[_0x9f6e('0xc')](function(_0x4f9a6f){return _0x45c7b4[_0x9f6e('0x8')](0xc8)[_0x9f6e('0xd')](_0x4f9a6f);})['catch'](function(_0x133895){return _0x45c7b4[_0x9f6e('0x8')](0x1f4)['json'](_0x133895);});};exports[_0x9f6e('0xe')]=function(_0x1eb707,_0x128321){var _0xa79619=[_0x9f6e('0xf')];return new BPromise(function(_0x57ce85,_0xb616f0){return exec(util[_0x9f6e('0x10')](_0x9f6e('0x11'),_0x1eb707[_0x9f6e('0x12')]['pid']),function(_0x51eab0,_0x17c173,_0x554314){if(_0x51eab0){return _0xb616f0(_0x51eab0);}return _0x57ce85(_0x17c173);});})[_0x9f6e('0xc')](function(_0x4b5a49){var _0x46d6ed=![];var _0x18deac=_0x4b5a49['split'](/\n/);for(var _0x11d1e3=0x0,_0x340149=_0xa79619[_0x9f6e('0x13')];_0x11d1e3<_0x340149,_0x46d6ed===![];_0x11d1e3+=0x1){if(_0x4b5a49[_0x9f6e('0x14')](_0xa79619[_0x11d1e3])>=0x0){_0x46d6ed=!![];}}if(!_0x46d6ed){throw new Error(util[_0x9f6e('0x10')](_0x9f6e('0x15'),_0x1eb707['params'][_0x9f6e('0x16')]));}process['kill'](_0x1eb707[_0x9f6e('0x12')]['pid'],_0x9f6e('0x17'));return _0x128321['status'](0xc8)[_0x9f6e('0xd')]({'message':util[_0x9f6e('0x10')](_0x9f6e('0x18'),_0x1eb707['params'][_0x9f6e('0x16')])});})[_0x9f6e('0x19')](handleError(_0x128321,null,_0x9f6e('0xe')));}; \ No newline at end of file +var _0x5e2e=['SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','kill'];(function(_0x59e1ee,_0x17d2c3){var _0x4543f9=function(_0x26c732){while(--_0x26c732){_0x59e1ee['push'](_0x59e1ee['shift']());}};_0x4543f9(++_0x17d2c3);}(_0x5e2e,0x93));var _0xe5e2=function(_0x3d567e,_0x33b526){_0x3d567e=_0x3d567e-0x0;var _0x455fb9=_0x5e2e[_0x3d567e];return _0x455fb9;};'use strict';var info=require(_0xe5e2('0x0'));var exec=require(_0xe5e2('0x1'))[_0xe5e2('0x2')];var logger=require('../../config/logger')(_0xe5e2('0x3'));var util=require(_0xe5e2('0x4'));var BPromise=require(_0xe5e2('0x5'));var _=require('lodash');function handleError(_0x4cb5ec,_0x14050d,_0x2bdb54){_0x14050d=_0x14050d||0x1f4;return function(_0x2509a7){logger[_0xe5e2('0x6')](_0xe5e2('0x7'),_0x2bdb54,_0x14050d,util[_0xe5e2('0x8')](_0x2509a7,{'showHidden':![],'depth':null}));delete _0x2509a7[_0xe5e2('0x9')];_0x4cb5ec[_0xe5e2('0xa')](_0x14050d)[_0xe5e2('0xb')](_0x2509a7);};}exports['index']=function(_0x3d9cfe,_0x2ed063){return info['getAllData']()['then'](function(_0x34d363){return _0x2ed063[_0xe5e2('0xa')](0xc8)[_0xe5e2('0xc')](_0x34d363);})[_0xe5e2('0xd')](function(_0x339d1d){return _0x2ed063[_0xe5e2('0xa')](0x1f4)[_0xe5e2('0xc')](_0x339d1d);});};exports[_0xe5e2('0xe')]=function(_0x3af20e,_0xedfa24){var _0x4f1ebe=['components/import/cm'];return new BPromise(function(_0x1f25e9,_0x276009){return exec(util['format'](_0xe5e2('0xf'),_0x3af20e[_0xe5e2('0x10')][_0xe5e2('0x11')]),function(_0x5edb05,_0x908ac2,_0x3a65af){if(_0x5edb05){return _0x276009(_0x5edb05);}return _0x1f25e9(_0x908ac2);});})['then'](function(_0x430f75){var _0x90f770=![];var _0x37d7d7=_0x430f75[_0xe5e2('0x12')](/\n/);for(var _0xe3ff7d=0x0,_0x1f1928=_0x4f1ebe[_0xe5e2('0x13')];_0xe3ff7d<_0x1f1928,_0x90f770===![];_0xe3ff7d+=0x1){if(_0x430f75['indexOf'](_0x4f1ebe[_0xe3ff7d])>=0x0){_0x90f770=!![];}}if(!_0x90f770){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3af20e[_0xe5e2('0x10')]['pid']));}process[_0xe5e2('0x14')](_0x3af20e[_0xe5e2('0x10')][_0xe5e2('0x11')],_0xe5e2('0x15'));return _0xedfa24['status'](0xc8)[_0xe5e2('0xc')]({'message':util[_0xe5e2('0x16')](_0xe5e2('0x17'),_0x3af20e[_0xe5e2('0x10')][_0xe5e2('0x11')])});})[_0xe5e2('0xd')](handleError(_0xedfa24,null,_0xe5e2('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c4a6233..7f1a630 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 _0xda2d=['delete','destroy','exports','util','path','connect-timeout','express','Router','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x5328d9,_0x57e50d){var _0x52ac30=function(_0x3c873c){while(--_0x3c873c){_0x5328d9['push'](_0x5328d9['shift']());}};_0x52ac30(++_0x57e50d);}(_0xda2d,0x102));var _0xdda2=function(_0x391946,_0x1820a9){_0x391946=_0x391946-0x0;var _0x588f99=_0xda2d[_0x391946];return _0x588f99;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdda2('0x5'));router[_0xdda2('0x6')]('/',auth[_0xdda2('0x7')](),controller[_0xdda2('0x8')]);router[_0xdda2('0x6')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xa')]);router[_0xdda2('0xb')]('/',auth[_0xdda2('0x7')](),controller['create']);router[_0xdda2('0xc')](_0xdda2('0x9'),auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xf')]);module[_0xdda2('0x10')]=router; \ No newline at end of file +var _0x2032=['get','isAuthenticated','index','/:id','show','post','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./tag.controller'];(function(_0x56983a,_0x5e90f1){var _0x50230e=function(_0x3b78dd){while(--_0x3b78dd){_0x56983a['push'](_0x56983a['shift']());}};_0x50230e(++_0x5e90f1);}(_0x2032,0xd9));var _0x2203=function(_0x187a74,_0x23c495){_0x187a74=_0x187a74-0x0;var _0x45cb60=_0x2032[_0x187a74];return _0x45cb60;};'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 auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0xc')]('/',auth[_0x2203('0x8')](),controller['create']);router['put'](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0xd')]);router[_0x2203('0xe')](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0xf')]);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 f339738..4e44461 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 _0xff94=['sequelize','exports','STRING','name','#0091EA'];(function(_0x5bfea1,_0x494abb){var _0x42d2fa=function(_0x33261d){while(--_0x33261d){_0x5bfea1['push'](_0x5bfea1['shift']());}};_0x42d2fa(++_0x494abb);}(_0xff94,0xaa));var _0x4ff9=function(_0x34dbb8,_0x36b823){_0x34dbb8=_0x34dbb8-0x0;var _0x40274f=_0xff94[_0x34dbb8];return _0x40274f;};'use strict';var Sequelize=require(_0x4ff9('0x0'));module[_0x4ff9('0x1')]={'name':{'type':Sequelize[_0x4ff9('0x2')],'unique':_0x4ff9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4ff9('0x2')],'defaultValue':_0x4ff9('0x4')},'description':{'type':Sequelize[_0x4ff9('0x2')]}}; \ No newline at end of file +var _0x26ad=['exports','STRING','sequelize'];(function(_0x413f87,_0x12c5c0){var _0xb4ae8c=function(_0x3a4910){while(--_0x3a4910){_0x413f87['push'](_0x413f87['shift']());}};_0xb4ae8c(++_0x12c5c0);}(_0x26ad,0xd1));var _0xd26a=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0x26ad[_0x6c59fc];return _0x17c96f;};'use strict';var Sequelize=require(_0xd26a('0x0'));module[_0xd26a('0x1')]={'name':{'type':Sequelize[_0xd26a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd26a('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xd26a('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index af8edd8..3fd414d 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 _0x7c09=['where','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x3a020c,_0x5928ee){var _0x555c76=function(_0x13be9e){while(--_0x13be9e){_0x3a020c['push'](_0x3a020c['shift']());}};_0x555c76(++_0x5928ee);}(_0x7c09,0x102));var _0x97c0=function(_0xb4733d,_0x2a3e20){_0xb4733d=_0xb4733d-0x0;var _0x537c77=_0x7c09[_0xb4733d];return _0x537c77;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x97c0('0x0'));var rimraf=require(_0x97c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97c0('0x2'));var rp=require(_0x97c0('0x3'));var moment=require(_0x97c0('0x4'));var BPromise=require(_0x97c0('0x5'));var Mustache=require(_0x97c0('0x6'));var util=require(_0x97c0('0x7'));var path=require(_0x97c0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x97c0('0x11'))(_0x97c0('0x12'));var utils=require(_0x97c0('0x13'));var config=require(_0x97c0('0x14'));var db=require(_0x97c0('0x15'))['db'];function respondWithStatusCode(_0x3811c5,_0x7fc93){_0x7fc93=_0x7fc93||0xcc;return function(_0x39a3b4){if(_0x39a3b4){return _0x3811c5[_0x97c0('0x16')](_0x7fc93);}return _0x3811c5[_0x97c0('0x17')](_0x7fc93)[_0x97c0('0x18')]();};}function respondWithResult(_0x132865,_0x20acfa){_0x20acfa=_0x20acfa||0xc8;return function(_0x514782){if(_0x514782){return _0x132865[_0x97c0('0x17')](_0x20acfa)[_0x97c0('0x19')](_0x514782);}};}function respondWithFilteredResult(_0xcac10b,_0x496017){return function(_0x42027d){if(_0x42027d){var _0x9ca6a8=_0x42027d[_0x97c0('0x1a')],_0x379951=_0x496017['offset'],_0x21e5f7=_0x496017[_0x97c0('0x1b')]+_0x496017[_0x97c0('0x1c')],_0x482be5;if(_0x21e5f7>=_0x9ca6a8){_0x21e5f7=_0x9ca6a8;_0x482be5=0xc8;}else{_0x482be5=0xce;}_0xcac10b['status'](_0x482be5);return _0xcac10b[_0x97c0('0x1d')](_0x97c0('0x1e'),_0x379951+'-'+_0x21e5f7+'/'+_0x9ca6a8)[_0x97c0('0x19')](_0x42027d);}return null;};}function patchUpdates(_0xe81408){return function(_0x183e2e){try{jsonpatch[_0x97c0('0x1f')](_0x183e2e,_0xe81408,!![]);}catch(_0x4fed42){return BPromise[_0x97c0('0x20')](_0x4fed42);}return _0x183e2e[_0x97c0('0x21')]();};}function saveUpdates(_0x323863,_0x4ca20a){return function(_0x554122){if(_0x554122){return _0x554122[_0x97c0('0x22')](_0x323863)[_0x97c0('0x23')](function(_0x169f19){return _0x169f19;});}return null;};}function removeEntity(_0x561d24,_0x13a6c9){return function(_0x20bc4c){if(_0x20bc4c){return _0x20bc4c[_0x97c0('0x24')]()[_0x97c0('0x23')](function(){var _0x30fba2=_0x20bc4c[_0x97c0('0x25')]({'plain':!![]});var _0x9dff60='Tags';return db[_0x97c0('0x26')][_0x97c0('0x24')]({'where':{'type':_0x9dff60,'resourceId':_0x30fba2['id']}})[_0x97c0('0x23')](function(){return _0x20bc4c;});})[_0x97c0('0x23')](function(){_0x561d24['status'](0xcc)[_0x97c0('0x18')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x16')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x27')]);if(_0x4f11ba[_0x97c0('0x28')]){delete _0x4f11ba[_0x97c0('0x28')];}_0x447316[_0x97c0('0x17')](_0x4af5a5)[_0x97c0('0x29')](_0x4f11ba);};}exports[_0x97c0('0x2a')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=db[_0x97c0('0x2b')][_0x97c0('0x2c')];_0x325090[_0x97c0('0x2d')]=_[_0x97c0('0x2e')](_0x14617c);_0x325090['query']=_['keys'](_0x4a3645[_0x97c0('0x2f')]);_0x325090[_0x97c0('0x30')]=_[_0x97c0('0x31')](_0x325090['model'],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x32')]=_['intersection'](_0x325090[_0x97c0('0x2d')],qs[_0x97c0('0x33')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x33')]));_0x1c183f[_0x97c0('0x32')]=_0x1c183f[_0x97c0('0x32')][_0x97c0('0x34')]?_0x1c183f[_0x97c0('0x32')]:_0x325090[_0x97c0('0x2d')];if(!_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x35')](_0x97c0('0x36'))){_0x1c183f[_0x97c0('0x1c')]=qs[_0x97c0('0x1c')](_0x4a3645[_0x97c0('0x2f')]['limit']);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1b')]);}_0x1c183f[_0x97c0('0x37')]=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f['where']=qs[_0x97c0('0x30')](_['pick'](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x30')]));if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x39')]){_0x1c183f[_0x97c0('0x3a')]=_[_0x97c0('0x3b')](_0x1c183f[_0x97c0('0x3a')],{'$or':_[_0x97c0('0x3c')](_0x14617c,function(_0x38f37a){if(_0x38f37a[_0x97c0('0x3d')][_0x97c0('0x3e')]!=='VIRTUAL'){var _0x3368d0={};_0x3368d0[_0x38f37a[_0x97c0('0x3f')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x39')]+'%'};return _0x3368d0;}})});}_0x1c183f=_[_0x97c0('0x3b')]({},_0x1c183f,_0x4a3645[_0x97c0('0x40')]);var _0x44dbe6={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')]['count'](_0x44dbe6)[_0x97c0('0x23')](function(_0x64cfcd){_0x4ad645['count']=_0x64cfcd;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x41')]){_0x1c183f[_0x97c0('0x42')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x43')](_0x1c183f);})[_0x97c0('0x23')](function(_0x36b3d0){_0x4ad645[_0x97c0('0x44')]=_0x36b3d0;return _0x4ad645;})[_0x97c0('0x23')](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x45')](handleError(_0x10e47e,null));};exports[_0x97c0('0x46')]=function(_0x2cca4c,_0x1351d2){var _0x5da697={'raw':!![],'where':{'id':_0x2cca4c[_0x97c0('0x47')]['id']}},_0x1abfa7={};_0x1abfa7[_0x97c0('0x2d')]=_[_0x97c0('0x2e')](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x1abfa7[_0x97c0('0x2f')]=_['keys'](_0x2cca4c['query']);_0x1abfa7[_0x97c0('0x30')]=_[_0x97c0('0x31')](_0x1abfa7[_0x97c0('0x2d')],_0x1abfa7[_0x97c0('0x2f')]);_0x5da697[_0x97c0('0x32')]=_['intersection'](_0x1abfa7['model'],qs['fields'](_0x2cca4c[_0x97c0('0x2f')]['fields']));_0x5da697['attributes']=_0x5da697[_0x97c0('0x32')][_0x97c0('0x34')]?_0x5da697[_0x97c0('0x32')]:_0x1abfa7[_0x97c0('0x2d')];if(_0x2cca4c[_0x97c0('0x2f')]['includeAll']){_0x5da697[_0x97c0('0x42')]=[{'all':!![]}];}_0x5da697=_[_0x97c0('0x3b')]({},_0x5da697,_0x2cca4c[_0x97c0('0x40')]);return db[_0x97c0('0x2b')][_0x97c0('0x48')](_0x5da697)[_0x97c0('0x23')](handleEntityNotFound(_0x1351d2,null))[_0x97c0('0x23')](respondWithResult(_0x1351d2,null))[_0x97c0('0x45')](handleError(_0x1351d2,null));};exports[_0x97c0('0x49')]=function(_0x8a952c,_0x4b1a6e){return db[_0x97c0('0x2b')][_0x97c0('0x49')](_0x8a952c[_0x97c0('0x4a')],{})[_0x97c0('0x23')](function(_0x4ff0a5){var _0x597a0f=_0x8a952c[_0x97c0('0x4b')][_0x97c0('0x25')]({'plain':!![]});if(!_0x597a0f)throw new Error(_0x97c0('0x4c'));if(_0x597a0f['role']===_0x97c0('0x4b')){var _0xac56ac=_0x4ff0a5[_0x97c0('0x25')]({'plain':!![]});var _0x2fc02f=_0x97c0('0x4d');return db['UserProfileSection'][_0x97c0('0x48')]({'where':{'name':_0x2fc02f,'userProfileId':_0x597a0f[_0x97c0('0x4e')]},'raw':!![]})[_0x97c0('0x23')](function(_0x5651c5){if(_0x5651c5&&_0x5651c5['autoAssociation']===0x0){return db[_0x97c0('0x26')]['create']({'name':_0xac56ac['name'],'resourceId':_0xac56ac['id'],'type':_0x5651c5[_0x97c0('0x28')],'sectionId':_0x5651c5['id']},{})[_0x97c0('0x23')](function(){return _0x4ff0a5;});}else{return _0x4ff0a5;}})[_0x97c0('0x45')](function(_0x53a255){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53a255);throw _0x53a255;});}return _0x4ff0a5;})[_0x97c0('0x23')](respondWithResult(_0x4b1a6e,0xc9))[_0x97c0('0x45')](handleError(_0x4b1a6e,null));};exports[_0x97c0('0x22')]=function(_0xdb2767,_0x397065){if(_0xdb2767[_0x97c0('0x4a')]['id']){delete _0xdb2767[_0x97c0('0x4a')]['id'];}return db['Tag'][_0x97c0('0x48')]({'where':{'id':_0xdb2767[_0x97c0('0x47')]['id']}})[_0x97c0('0x23')](handleEntityNotFound(_0x397065,null))[_0x97c0('0x23')](saveUpdates(_0xdb2767[_0x97c0('0x4a')],null))[_0x97c0('0x23')](respondWithResult(_0x397065,null))['catch'](handleError(_0x397065,null));};exports[_0x97c0('0x24')]=function(_0x86a497,_0x4fbc1e){return db[_0x97c0('0x2b')][_0x97c0('0x48')]({'where':{'id':_0x86a497[_0x97c0('0x47')]['id']}})[_0x97c0('0x23')](handleEntityNotFound(_0x4fbc1e,null))[_0x97c0('0x23')](removeEntity(_0x4fbc1e,null))[_0x97c0('0x45')](handleError(_0x4fbc1e,null));}; \ No newline at end of file +var _0x01d9=['key','VIRTUAL','field','options','includeAll','include','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','get','Tags','UserProfileResource','destroy','sendStatus','error','name','send','index','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type'];(function(_0x562391,_0x50877b){var _0x1b91e3=function(_0x487256){while(--_0x487256){_0x562391['push'](_0x562391['shift']());}};_0x1b91e3(++_0x50877b);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x901d('0x0'));var emlformat=require(_0x901d('0x1'));var rimraf=require(_0x901d('0x2'));var zipdir=require(_0x901d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x901d('0x4'));var moment=require(_0x901d('0x5'));var BPromise=require(_0x901d('0x6'));var Mustache=require(_0x901d('0x7'));var util=require(_0x901d('0x8'));var path=require(_0x901d('0x9'));var sox=require(_0x901d('0xa'));var csv=require('to-csv');var ejs=require(_0x901d('0xb'));var fs=require('fs');var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0x11'));var querystring=require(_0x901d('0x12'));var Papa=require(_0x901d('0x13'));var Redis=require(_0x901d('0x14'));var authService=require(_0x901d('0x15'));var qs=require(_0x901d('0x16'));var hardwareService=require(_0x901d('0x17'));var logger=require('../../config/logger')(_0x901d('0x18'));var utils=require('../../config/utils');var config=require(_0x901d('0x19'));var db=require(_0x901d('0x1a'))['db'];function respondWithStatusCode(_0x3f2a0a,_0x42ce79){_0x42ce79=_0x42ce79||0xcc;return function(_0x15ebaf){if(_0x15ebaf){return _0x3f2a0a['sendStatus'](_0x42ce79);}return _0x3f2a0a[_0x901d('0x1b')](_0x42ce79)[_0x901d('0x1c')]();};}function respondWithResult(_0x3d00e4,_0x1618a8){_0x1618a8=_0x1618a8||0xc8;return function(_0xb8869a){if(_0xb8869a){return _0x3d00e4[_0x901d('0x1b')](_0x1618a8)['json'](_0xb8869a);}};}function respondWithFilteredResult(_0x991ee2,_0x13903c){return function(_0x11b0cc){if(_0x11b0cc){var _0x17d451=_0x11b0cc[_0x901d('0x1d')],_0x1aba97=_0x13903c[_0x901d('0x1e')],_0x7dd5f4=_0x13903c[_0x901d('0x1e')]+_0x13903c[_0x901d('0x1f')],_0x477cd4;if(_0x7dd5f4>=_0x17d451){_0x7dd5f4=_0x17d451;_0x477cd4=0xc8;}else{_0x477cd4=0xce;}_0x991ee2[_0x901d('0x1b')](_0x477cd4);return _0x991ee2[_0x901d('0x20')](_0x901d('0x21'),_0x1aba97+'-'+_0x7dd5f4+'/'+_0x17d451)[_0x901d('0x22')](_0x11b0cc);}return null;};}function patchUpdates(_0x414171){return function(_0xf3c66a){try{jsonpatch[_0x901d('0x23')](_0xf3c66a,_0x414171,!![]);}catch(_0x57d518){return BPromise[_0x901d('0x24')](_0x57d518);}return _0xf3c66a[_0x901d('0x25')]();};}function saveUpdates(_0x4d27db,_0x5bdff4){return function(_0x496a06){if(_0x496a06){return _0x496a06['update'](_0x4d27db)[_0x901d('0x26')](function(_0x44ea6f){return _0x44ea6f;});}return null;};}function removeEntity(_0x59289e,_0xd2e0ac){return function(_0x3ea3f6){if(_0x3ea3f6){return _0x3ea3f6['destroy']()[_0x901d('0x26')](function(){var _0x53ee69=_0x3ea3f6[_0x901d('0x27')]({'plain':!![]});var _0x3f80b9=_0x901d('0x28');return db[_0x901d('0x29')][_0x901d('0x2a')]({'where':{'type':_0x3f80b9,'resourceId':_0x53ee69['id']}})[_0x901d('0x26')](function(){return _0x3ea3f6;});})['then'](function(){_0x59289e[_0x901d('0x1b')](0xcc)[_0x901d('0x1c')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x2b')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2c')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2d')]){delete _0x3cbe43[_0x901d('0x2d')];}_0x23fd43[_0x901d('0x1b')](_0x27f4ca)[_0x901d('0x2e')](_0x3cbe43);};}exports[_0x901d('0x2f')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=db[_0x901d('0x30')][_0x901d('0x31')];_0x533038[_0x901d('0x32')]=_[_0x901d('0x33')](_0x389fd9);_0x533038[_0x901d('0x34')]=_[_0x901d('0x33')](_0x3de9b9[_0x901d('0x34')]);_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x533038[_0x901d('0x32')],_0x533038[_0x901d('0x34')]);_0xae6dfe[_0x901d('0x37')]=_[_0x901d('0x36')](_0x533038['model'],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x34')][_0x901d('0x38')]));_0xae6dfe['attributes']=_0xae6dfe[_0x901d('0x37')][_0x901d('0x39')]?_0xae6dfe[_0x901d('0x37')]:_0x533038[_0x901d('0x32')];if(!_0x3de9b9[_0x901d('0x34')][_0x901d('0x3a')](_0x901d('0x3b'))){_0xae6dfe[_0x901d('0x1f')]=qs[_0x901d('0x1f')](_0x3de9b9[_0x901d('0x34')]['limit']);_0xae6dfe['offset']=qs[_0x901d('0x1e')](_0x3de9b9['query'][_0x901d('0x1e')]);}_0xae6dfe[_0x901d('0x3c')]=qs['sort'](_0x3de9b9[_0x901d('0x34')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs['filters'](_[_0x901d('0x3f')](_0x3de9b9[_0x901d('0x34')],_0x533038[_0x901d('0x35')]));if(_0x3de9b9[_0x901d('0x34')][_0x901d('0x40')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x41')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x42')](_0x389fd9,function(_0x384d82){if(_0x384d82[_0x901d('0x43')][_0x901d('0x44')]!==_0x901d('0x45')){var _0x3a6b5f={};_0x3a6b5f[_0x384d82[_0x901d('0x46')]]={'$like':'%'+_0x3de9b9[_0x901d('0x34')]['filter']+'%'};return _0x3a6b5f;}})});}_0xae6dfe=_[_0x901d('0x41')]({},_0xae6dfe,_0x3de9b9[_0x901d('0x47')]);var _0x5abca2={'where':_0xae6dfe['where']};return db[_0x901d('0x30')]['count'](_0x5abca2)[_0x901d('0x26')](function(_0x3d0556){_0x128830[_0x901d('0x1d')]=_0x3d0556;if(_0x3de9b9[_0x901d('0x34')][_0x901d('0x48')]){_0xae6dfe[_0x901d('0x49')]=[{'all':!![]}];}return db['Tag']['findAll'](_0xae6dfe);})['then'](function(_0x4c4fd0){_0x128830[_0x901d('0x4a')]=_0x4c4fd0;return _0x128830;})[_0x901d('0x26')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))['catch'](handleError(_0x48e86e,null));};exports[_0x901d('0x4b')]=function(_0x22fc44,_0x52092b){var _0x1e8f53={'raw':!![],'where':{'id':_0x22fc44[_0x901d('0x4c')]['id']}},_0x4f9377={};_0x4f9377[_0x901d('0x32')]=_['keys'](db['Tag'][_0x901d('0x31')]);_0x4f9377[_0x901d('0x34')]=_[_0x901d('0x33')](_0x22fc44[_0x901d('0x34')]);_0x4f9377[_0x901d('0x35')]=_[_0x901d('0x36')](_0x4f9377[_0x901d('0x32')],_0x4f9377[_0x901d('0x34')]);_0x1e8f53[_0x901d('0x37')]=_[_0x901d('0x36')](_0x4f9377[_0x901d('0x32')],qs['fields'](_0x22fc44[_0x901d('0x34')]['fields']));_0x1e8f53[_0x901d('0x37')]=_0x1e8f53['attributes'][_0x901d('0x39')]?_0x1e8f53['attributes']:_0x4f9377[_0x901d('0x32')];if(_0x22fc44[_0x901d('0x34')][_0x901d('0x48')]){_0x1e8f53[_0x901d('0x49')]=[{'all':!![]}];}_0x1e8f53=_[_0x901d('0x41')]({},_0x1e8f53,_0x22fc44[_0x901d('0x47')]);return db[_0x901d('0x30')][_0x901d('0x4d')](_0x1e8f53)[_0x901d('0x26')](handleEntityNotFound(_0x52092b,null))[_0x901d('0x26')](respondWithResult(_0x52092b,null))[_0x901d('0x4e')](handleError(_0x52092b,null));};exports['create']=function(_0x3cf4b2,_0x20f78a){return db[_0x901d('0x30')][_0x901d('0x4f')](_0x3cf4b2[_0x901d('0x50')],{})[_0x901d('0x26')](function(_0x27459b){var _0x43135c=_0x3cf4b2[_0x901d('0x51')][_0x901d('0x27')]({'plain':!![]});if(!_0x43135c)throw new Error(_0x901d('0x52'));if(_0x43135c[_0x901d('0x53')]===_0x901d('0x51')){var _0x23f2a9=_0x27459b['get']({'plain':!![]});var _0x505965=_0x901d('0x28');return db[_0x901d('0x54')][_0x901d('0x4d')]({'where':{'name':_0x505965,'userProfileId':_0x43135c[_0x901d('0x55')]},'raw':!![]})[_0x901d('0x26')](function(_0x5cbc90){if(_0x5cbc90&&_0x5cbc90['autoAssociation']===0x0){return db[_0x901d('0x29')][_0x901d('0x4f')]({'name':_0x23f2a9['name'],'resourceId':_0x23f2a9['id'],'type':_0x5cbc90[_0x901d('0x2d')],'sectionId':_0x5cbc90['id']},{})[_0x901d('0x26')](function(){return _0x27459b;});}else{return _0x27459b;}})['catch'](function(_0x4512e5){logger['error'](_0x901d('0x56'),_0x4512e5);throw _0x4512e5;});}return _0x27459b;})[_0x901d('0x26')](respondWithResult(_0x20f78a,0xc9))[_0x901d('0x4e')](handleError(_0x20f78a,null));};exports[_0x901d('0x57')]=function(_0x52aa2d,_0x3a3ea6){if(_0x52aa2d[_0x901d('0x50')]['id']){delete _0x52aa2d[_0x901d('0x50')]['id'];}return db[_0x901d('0x30')][_0x901d('0x4d')]({'where':{'id':_0x52aa2d[_0x901d('0x4c')]['id']}})[_0x901d('0x26')](handleEntityNotFound(_0x3a3ea6,null))[_0x901d('0x26')](saveUpdates(_0x52aa2d[_0x901d('0x50')],null))[_0x901d('0x26')](respondWithResult(_0x3a3ea6,null))['catch'](handleError(_0x3a3ea6,null));};exports[_0x901d('0x2a')]=function(_0x4afe28,_0xd7fbb3){return db[_0x901d('0x30')][_0x901d('0x4d')]({'where':{'id':_0x4afe28[_0x901d('0x4c')]['id']}})[_0x901d('0x26')](handleEntityNotFound(_0xd7fbb3,null))[_0x901d('0x26')](removeEntity(_0xd7fbb3,null))[_0x901d('0x4e')](handleError(_0xd7fbb3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a5f0db6..2a5d115 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 _0x8a45=['rimraf','./tag.attributes','Tag','util','../../config/logger','api','moment','request-promise','path'];(function(_0x17d646,_0x127003){var _0x487241=function(_0x277049){while(--_0x277049){_0x17d646['push'](_0x17d646['shift']());}};_0x487241(++_0x127003);}(_0x8a45,0x1e9));var _0x58a4=function(_0x42e780,_0x4c2322){_0x42e780=_0x42e780-0x0;var _0x14d877=_0x8a45[_0x42e780];return _0x14d877;};'use strict';var _=require('lodash');var util=require(_0x58a4('0x0'));var logger=require(_0x58a4('0x1'))(_0x58a4('0x2'));var moment=require(_0x58a4('0x3'));var BPromise=require('bluebird');var rp=require(_0x58a4('0x4'));var fs=require('fs');var path=require(_0x58a4('0x5'));var rimraf=require(_0x58a4('0x6'));var config=require('../../config/environment');var attributes=require(_0x58a4('0x7'));module['exports']=function(_0xcfb29,_0x13d966){return _0xcfb29['define'](_0x58a4('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa46=['exports','define','Tag','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xb39caa,_0x3d3c05){var _0xac71b2=function(_0x2bc22d){while(--_0x2bc22d){_0xb39caa['push'](_0xb39caa['shift']());}};_0xac71b2(++_0x3d3c05);}(_0xaa46,0x71));var _0x6aa4=function(_0x31335c,_0x53e6b5){_0x31335c=_0x31335c-0x0;var _0x60cf5d=_0xaa46[_0x31335c];return _0x60cf5d;};'use strict';var _=require('lodash');var util=require(_0x6aa4('0x0'));var logger=require(_0x6aa4('0x1'))(_0x6aa4('0x2'));var moment=require(_0x6aa4('0x3'));var BPromise=require(_0x6aa4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6aa4('0x5'));var config=require(_0x6aa4('0x6'));var attributes=require('./tag.attributes');module[_0x6aa4('0x7')]=function(_0x512925,_0x643de8){return _0x512925[_0x6aa4('0x8')](_0x6aa4('0x9'),attributes,{'tableName':'tools_tags','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 a243acd..8f49958 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 _0x10f8=['../../config/environment','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4853de,_0x4e8f52){var _0x388efb=function(_0x3a7040){while(--_0x3a7040){_0x4853de['push'](_0x4853de['shift']());}};_0x388efb(++_0x4e8f52);}(_0x10f8,0x1c6));var _0x810f=function(_0x2390e5,_0x369025){_0x2390e5=_0x2390e5-0x0;var _0xa6038f=_0x10f8[_0x2390e5];return _0xa6038f;};'use strict';var _=require(_0x810f('0x0'));var util=require(_0x810f('0x1'));var moment=require(_0x810f('0x2'));var BPromise=require('bluebird');var rs=require(_0x810f('0x3'));var fs=require('fs');var Redis=require(_0x810f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x810f('0x5'));var logger=require(_0x810f('0x6'))(_0x810f('0x7'));var config=require(_0x810f('0x8'));var jayson=require(_0x810f('0x9'));var client=jayson[_0x810f('0xa')][_0x810f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x586c25,_0x1c1a23,_0x4d7a1c){return new BPromise(function(_0x282b79,_0x542b9f){return client[_0x810f('0xc')](_0x586c25,_0x4d7a1c)['then'](function(_0x3f9cda){logger['info'](_0x810f('0xd'),_0x1c1a23,_0x810f('0xe'));logger[_0x810f('0xf')](_0x810f('0x10'),_0x1c1a23,_0x810f('0xe'),JSON[_0x810f('0x11')](_0x3f9cda));if(_0x3f9cda['error']){if(_0x3f9cda[_0x810f('0x12')]['code']===0x1f4){logger[_0x810f('0x12')](_0x810f('0xd'),_0x1c1a23,_0x3f9cda[_0x810f('0x12')][_0x810f('0x13')]);return _0x542b9f(_0x3f9cda[_0x810f('0x12')][_0x810f('0x13')]);}logger[_0x810f('0x12')](_0x810f('0xd'),_0x1c1a23,_0x3f9cda[_0x810f('0x12')][_0x810f('0x13')]);return _0x282b79(_0x3f9cda['error'][_0x810f('0x13')]);}else{logger[_0x810f('0x14')]('Tag,\x20%s,\x20%s',_0x1c1a23,_0x810f('0xe'));_0x282b79(_0x3f9cda[_0x810f('0x15')][_0x810f('0x13')]);}})['catch'](function(_0x4a4d72){logger[_0x810f('0x12')](_0x810f('0xd'),_0x1c1a23,_0x4a4d72);_0x542b9f(_0x4a4d72);});});} \ No newline at end of file +var _0x3ecc=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xfb8382,_0x220eed){var _0x2ef55a=function(_0x3e50c1){while(--_0x3e50c1){_0xfb8382['push'](_0xfb8382['shift']());}};_0x2ef55a(++_0x220eed);}(_0x3ecc,0x1cb));var _0xc3ec=function(_0xba1bf6,_0x24e0a9){_0xba1bf6=_0xba1bf6-0x0;var _0x58f066=_0x3ecc[_0xba1bf6];return _0x58f066;};'use strict';var _=require('lodash');var util=require(_0xc3ec('0x0'));var moment=require(_0xc3ec('0x1'));var BPromise=require(_0xc3ec('0x2'));var rs=require(_0xc3ec('0x3'));var fs=require('fs');var Redis=require(_0xc3ec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3ec('0x5'));var logger=require(_0xc3ec('0x6'))(_0xc3ec('0x7'));var config=require('../../config/environment');var jayson=require(_0xc3ec('0x8'));var client=jayson[_0xc3ec('0x9')][_0xc3ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d5e91,_0x5e25a5,_0x104bde){return new BPromise(function(_0x1c7111,_0x764057){return client[_0xc3ec('0xb')](_0x4d5e91,_0x104bde)[_0xc3ec('0xc')](function(_0x430bb8){logger[_0xc3ec('0xd')](_0xc3ec('0xe'),_0x5e25a5,'request\x20sent');logger[_0xc3ec('0xf')](_0xc3ec('0x10'),_0x5e25a5,_0xc3ec('0x11'),JSON[_0xc3ec('0x12')](_0x430bb8));if(_0x430bb8[_0xc3ec('0x13')]){if(_0x430bb8[_0xc3ec('0x13')][_0xc3ec('0x14')]===0x1f4){logger[_0xc3ec('0x13')]('Tag,\x20%s,\x20%s',_0x5e25a5,_0x430bb8[_0xc3ec('0x13')][_0xc3ec('0x15')]);return _0x764057(_0x430bb8[_0xc3ec('0x13')][_0xc3ec('0x15')]);}logger['error']('Tag,\x20%s,\x20%s',_0x5e25a5,_0x430bb8[_0xc3ec('0x13')][_0xc3ec('0x15')]);return _0x1c7111(_0x430bb8[_0xc3ec('0x13')][_0xc3ec('0x15')]);}else{logger[_0xc3ec('0xd')](_0xc3ec('0xe'),_0x5e25a5,_0xc3ec('0x11'));_0x1c7111(_0x430bb8[_0xc3ec('0x16')]['message']);}})[_0xc3ec('0x17')](function(_0x335290){logger[_0xc3ec('0x13')](_0xc3ec('0xe'),_0x5e25a5,_0x335290);_0x764057(_0x335290);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c2be344..433c5cf 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 _0x22a1=['/:id/queues','getQueues','getAgents','create','post','addQueues','/:id/users','put','update','delete','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4f21bc,_0x52bd4c){var _0x137ac4=function(_0x46bdab){while(--_0x46bdab){_0x4f21bc['push'](_0x4f21bc['shift']());}};_0x137ac4(++_0x52bd4c);}(_0x22a1,0x152));var _0x122a=function(_0x47321a,_0x41c43a){_0x47321a=_0x47321a-0x0;var _0x176573=_0x22a1[_0x47321a];return _0x176573;};'use strict';var multer=require(_0x122a('0x0'));var util=require(_0x122a('0x1'));var path=require(_0x122a('0x2'));var timeout=require(_0x122a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x122a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x122a('0x5'));var controller=require(_0x122a('0x6'));router[_0x122a('0x7')]('/',auth[_0x122a('0x8')](),controller[_0x122a('0x9')]);router[_0x122a('0x7')](_0x122a('0xa'),auth[_0x122a('0x8')](),controller[_0x122a('0xb')]);router['get'](_0x122a('0xc'),auth[_0x122a('0x8')](),controller[_0x122a('0xd')]);router[_0x122a('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x122a('0xe')]);router['post']('/',auth[_0x122a('0x8')](),controller[_0x122a('0xf')]);router[_0x122a('0x10')](_0x122a('0xc'),auth['isAuthenticated'](),controller[_0x122a('0x11')]);router['post'](_0x122a('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x122a('0x13')](_0x122a('0xa'),auth['isAuthenticated'](),controller[_0x122a('0x14')]);router[_0x122a('0x15')](_0x122a('0xa'),auth[_0x122a('0x8')](),controller['destroy']);router['delete'](_0x122a('0xc'),auth[_0x122a('0x8')](),controller[_0x122a('0x16')]);router[_0x122a('0x15')](_0x122a('0x12'),auth['isAuthenticated'](),controller[_0x122a('0x17')]);module[_0x122a('0x18')]=router; \ No newline at end of file +var _0x7be8=['isAuthenticated','index','/:id','show','/:id/queues','getQueues','getAgents','post','addQueues','/:id/users','addAgents','update','delete','destroy','removeQueues','removeAgents','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./team.controller','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7be8,0x10d));var _0x87be=function(_0x397671,_0x4842ba){_0x397671=_0x397671-0x0;var _0x4a7af5=_0x7be8[_0x397671];return _0x4a7af5;};'use strict';var multer=require(_0x87be('0x0'));var util=require(_0x87be('0x1'));var path=require('path');var timeout=require(_0x87be('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x87be('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x87be('0x4'));var controller=require(_0x87be('0x5'));router[_0x87be('0x6')]('/',auth[_0x87be('0x7')](),controller[_0x87be('0x8')]);router['get'](_0x87be('0x9'),auth['isAuthenticated'](),controller[_0x87be('0xa')]);router[_0x87be('0x6')](_0x87be('0xb'),auth[_0x87be('0x7')](),controller[_0x87be('0xc')]);router[_0x87be('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x87be('0xd')]);router['post']('/',auth[_0x87be('0x7')](),controller['create']);router[_0x87be('0xe')]('/:id/queues',auth[_0x87be('0x7')](),controller[_0x87be('0xf')]);router[_0x87be('0xe')](_0x87be('0x10'),auth['isAuthenticated'](),controller[_0x87be('0x11')]);router['put']('/:id',auth[_0x87be('0x7')](),controller[_0x87be('0x12')]);router[_0x87be('0x13')](_0x87be('0x9'),auth[_0x87be('0x7')](),controller[_0x87be('0x14')]);router['delete'](_0x87be('0xb'),auth[_0x87be('0x7')](),controller[_0x87be('0x15')]);router[_0x87be('0x13')](_0x87be('0x10'),auth['isAuthenticated'](),controller[_0x87be('0x16')]);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 0859dd9..367b81a 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 _0xc0ff=['name','STRING'];(function(_0x2090eb,_0x10815c){var _0x57c188=function(_0x3f025e){while(--_0x3f025e){_0x2090eb['push'](_0x2090eb['shift']());}};_0x57c188(++_0x10815c);}(_0xc0ff,0x1e9));var _0xfc0f=function(_0x30d74b,_0x4e619f){_0x30d74b=_0x30d74b-0x0;var _0x5c13e5=_0xc0ff[_0x30d74b];return _0x5c13e5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfc0f('0x0')],'allowNull':![],'unique':_0xfc0f('0x1')},'description':{'type':Sequelize[_0xfc0f('0x0')]}}; \ No newline at end of file +var _0x2ef1=['exports','STRING','name'];(function(_0x24fe22,_0x967d91){var _0x3ff259=function(_0x563158){while(--_0x563158){_0x24fe22['push'](_0x24fe22['shift']());}};_0x3ff259(++_0x967d91);}(_0x2ef1,0x114));var _0x12ef=function(_0x96191a,_0x58eeca){_0x96191a=_0x96191a-0x0;var _0x1cafd0=_0x2ef1[_0x96191a];return _0x1cafd0;};'use strict';var Sequelize=require('sequelize');module[_0x12ef('0x0')]={'name':{'type':Sequelize[_0x12ef('0x1')],'allowNull':![],'unique':_0x12ef('0x2')},'description':{'type':Sequelize[_0x12ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 5ffeea5..e84d59b 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 _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x18bc00,_0x47ec22){var _0x43078c=function(_0x2844f9){while(--_0x2844f9){_0x18bc00['push'](_0x18bc00['shift']());}};_0x43078c(++_0x47ec22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file +var _0xa9e0=['addQueues','findOne','add','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','voice','chat','mail','sms','openchannel','removeAgents','isArray','emit','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x227f5e,_0x49f72a){var _0xc96f10=function(_0xafd594){while(--_0xafd594){_0x227f5e['push'](_0x227f5e['shift']());}};_0xc96f10(++_0x49f72a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){var _0x4abc8f=[_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')];return BPromise[_0x0a9e('0x66')](_0x4abc8f,function(_0x3df0e3){return _0x361b21[_0x0a9e('0x25')+_0x3df0e3+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x3df0e3===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]})[_0x0a9e('0x23')](function(_0x53a6a1){return BPromise[_0x0a9e('0x66')](_[_0x0a9e('0x37')](_0x53a6a1,{'online':0x1}),function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x81d748,null))['then'](function(_0x5fd5db){if(_0x5fd5db){return BPromise['each']([_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),'fax',_0x0a9e('0x78')],function(_0x32f761){return _0x5fd5db[_0x0a9e('0x25')+_['capitalize'](_0x32f761)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x22063c){return BPromise[_0x0a9e('0x66')](_0x22063c,function(_0x1910bf){return _0x1910bf[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')]['ids'])[_0x0a9e('0x23')](function(){if(_0x32f761===_0x0a9e('0x74')){return db['UserVoiceQueueRt'][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x1910bf['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]}});}});});})['then'](function(){return _0x5fd5db;});})[_0x0a9e('0x23')](function(){return _0x5fd5db;});}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){return _0x8c8fbe[_0x0a9e('0x79')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x7a')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])){for(var _0x501050=0x0;_0x501050<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x501050+=0x1){socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x501050]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}}else{socket[_0x0a9e('0x7b')](_0x0a9e('0x7c'),{'UserId':Number(_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')]),'TeamId':Number(_0x4dc6b3[_0x0a9e('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x7d')]=function(_0x12843d,_0x2ed526,_0xb0599a){var _0x5d9ddb={};var _0x3afc8c={};var _0x1756c7;var _0x5ce99d;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x12843d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2ed526,null))[_0x0a9e('0x23')](function(_0xf8c6c4){if(_0xf8c6c4){_0x1756c7=_0xf8c6c4;_0x3afc8c['model']=_[_0x0a9e('0x2d')](db['User'][_0x0a9e('0x2b')]);_0x3afc8c[_0x0a9e('0x2e')]=_['keys'](_0x12843d[_0x0a9e('0x2e')]);_0x3afc8c[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3afc8c['model'],_0x3afc8c['query']);_0x5d9ddb[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3afc8c[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5d9ddb[_0x0a9e('0x30')]=_0x5d9ddb[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5d9ddb['attributes']:_0x3afc8c[_0x0a9e('0x2c')];_0x5d9ddb['order']=qs[_0x0a9e('0x35')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x5d9ddb[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_['pick'](_0x12843d[_0x0a9e('0x2e')],_0x3afc8c[_0x0a9e('0x36')]));if(_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x5d9ddb[_0x0a9e('0x39')]=_['merge'](_0x5d9ddb['where'],{'$or':_[_0x0a9e('0x3a')](_0x5d9ddb['attributes'],function(_0x25eae0){var _0x4658df={};_0x4658df[_0x25eae0]={'$like':'%'+_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4658df;})});}_0x5d9ddb=_[_0x0a9e('0x38')]({},_0x5d9ddb,_0x12843d[_0x0a9e('0x3e')]);return _0x1756c7['getAgents'](_0x5d9ddb);}})['then'](function(_0x1889ed){if(_0x1889ed){_0x5ce99d=_0x1889ed['length'];if(!_0x12843d[_0x0a9e('0x2e')]['hasOwnProperty'](_0x0a9e('0x7e'))){_0x5d9ddb['limit']=qs['limit'](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5d9ddb['offset']=qs[_0x0a9e('0x1c')](_0x12843d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x1756c7[_0x0a9e('0x7d')](_0x5d9ddb);}})[_0x0a9e('0x23')](function(_0x5ab0bc){if(_0x5ab0bc){return _0x5ab0bc?{'count':_0x5ce99d,'rows':_0x5ab0bc}:null;}})['then'](respondWithResult(_0x2ed526,null))[_0x0a9e('0x42')](handleError(_0x2ed526,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e2f5d8b..52279d9 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 _0x57ca=['hasOwnProperty','hook','exports','../../mysqldb','Team','save','update','remove','emit'];(function(_0x4d72a6,_0x2279a0){var _0x34997b=function(_0x17adbe){while(--_0x17adbe){_0x4d72a6['push'](_0x4d72a6['shift']());}};_0x34997b(++_0x2279a0);}(_0x57ca,0x108));var _0xa57c=function(_0x463744,_0x30b9b6){_0x463744=_0x463744-0x0;var _0x5e9772=_0x57ca[_0x463744];return _0x5e9772;};'use strict';var EventEmitter=require('events');var Team=require(_0xa57c('0x0'))['db'][_0xa57c('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa57c('0x2'),'afterUpdate':_0xa57c('0x3'),'afterDestroy':_0xa57c('0x4')};function emitEvent(_0x15e330){return function(_0x1da469,_0x48be2d,_0x40ba22){TeamEvents[_0xa57c('0x5')](_0x15e330+':'+_0x1da469['id'],_0x1da469);TeamEvents[_0xa57c('0x5')](_0x15e330,_0x1da469);_0x40ba22(null);};}for(var e in events){if(events[_0xa57c('0x6')](e)){var event=events[e];Team[_0xa57c('0x7')](e,emitEvent(event));}}module[_0xa57c('0x8')]=TeamEvents; \ No newline at end of file +var _0xa9fc=['../../mysqldb','Team','setMaxListeners','save','remove','hasOwnProperty','exports','events'];(function(_0x207176,_0x2b714c){var _0x31ea92=function(_0x580c25){while(--_0x580c25){_0x207176['push'](_0x207176['shift']());}};_0x31ea92(++_0x2b714c);}(_0xa9fc,0x19f));var _0xca9f=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0xa9fc[_0x4dd479];return _0x1b6807;};'use strict';var EventEmitter=require(_0xca9f('0x0'));var Team=require(_0xca9f('0x1'))['db'][_0xca9f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xca9f('0x3')](0x0);var events={'afterCreate':_0xca9f('0x4'),'afterUpdate':'update','afterDestroy':_0xca9f('0x5')};function emitEvent(_0x4dc099){return function(_0xe81cd,_0x32709b,_0x5d2ddf){TeamEvents['emit'](_0x4dc099+':'+_0xe81cd['id'],_0xe81cd);TeamEvents['emit'](_0x4dc099,_0xe81cd);_0x5d2ddf(null);};}for(var e in events){if(events[_0xca9f('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xca9f('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 ca11ab8..6b931ec 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 _0x018c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','../../config/logger'];(function(_0x2a1dd1,_0x3794df){var _0x132c45=function(_0x42b666){while(--_0x42b666){_0x2a1dd1['push'](_0x2a1dd1['shift']());}};_0x132c45(++_0x3794df);}(_0x018c,0xaf));var _0xc018=function(_0x8f01df,_0x51a8b0){_0x8f01df=_0x8f01df-0x0;var _0x312783=_0x018c[_0x8f01df];return _0x312783;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc018('0x0'))('api');var moment=require(_0xc018('0x1'));var BPromise=require(_0xc018('0x2'));var rp=require(_0xc018('0x3'));var fs=require('fs');var path=require(_0xc018('0x4'));var rimraf=require(_0xc018('0x5'));var config=require(_0xc018('0x6'));var attributes=require(_0xc018('0x7'));module[_0xc018('0x8')]=function(_0x23eaaa,_0x812afd){return _0x23eaaa['define'](_0xc018('0x9'),attributes,{'tableName':_0xc018('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc5=['api','bluebird','request-promise','path','../../config/environment','define','Team','lodash','../../config/logger'];(function(_0x113253,_0x1b0f88){var _0x33f4d3=function(_0x64e1d1){while(--_0x64e1d1){_0x113253['push'](_0x113253['shift']());}};_0x33f4d3(++_0x1b0f88);}(_0x5cc5,0x7c));var _0x55cc=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x5cc5[_0x5ac1e5];return _0x1bccc6;};'use strict';var _=require(_0x55cc('0x0'));var util=require('util');var logger=require(_0x55cc('0x1'))(_0x55cc('0x2'));var moment=require('moment');var BPromise=require(_0x55cc('0x3'));var rp=require(_0x55cc('0x4'));var fs=require('fs');var path=require(_0x55cc('0x5'));var rimraf=require('rimraf');var config=require(_0x55cc('0x6'));var attributes=require('./team.attributes');module['exports']=function(_0x6db4a,_0x478f68){return _0x6db4a[_0x55cc('0x7')](_0x55cc('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9fff7ba..c54559d 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 _0x58af=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','localhost','socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','Team,\x20%s,\x20%s','message','result','catch'];(function(_0x5bfda7,_0x1692e4){var _0x1e4757=function(_0x58ad24){while(--_0x58ad24){_0x5bfda7['push'](_0x5bfda7['shift']());}};_0x1e4757(++_0x1692e4);}(_0x58af,0x12b));var _0xf58a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x58af[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf58a('0x0'));var util=require(_0xf58a('0x1'));var moment=require(_0xf58a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf58a('0x3'));var fs=require('fs');var Redis=require(_0xf58a('0x4'));var db=require(_0xf58a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf58a('0x6'))(_0xf58a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf58a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xf58a('0x9'),'port':0x18eb});var socket=require(_0xf58a('0xa'))(new Redis(config['redis']));require(_0xf58a('0xb'))[_0xf58a('0xc')](socket);function respondWithRpcPromise(_0x2a33e8,_0x114020,_0x33cb44){return new BPromise(function(_0x589193,_0xfbb3c9){return client['request'](_0x2a33e8,_0x33cb44)[_0xf58a('0xd')](function(_0x451b52){logger[_0xf58a('0xe')]('Team,\x20%s,\x20%s',_0x114020,_0xf58a('0xf'));logger[_0xf58a('0x10')](_0xf58a('0x11'),_0x114020,'request\x20sent',JSON['stringify'](_0x451b52));if(_0x451b52[_0xf58a('0x12')]){if(_0x451b52[_0xf58a('0x12')]['code']===0x1f4){logger[_0xf58a('0x12')](_0xf58a('0x13'),_0x114020,_0x451b52[_0xf58a('0x12')][_0xf58a('0x14')]);return _0xfbb3c9(_0x451b52[_0xf58a('0x12')][_0xf58a('0x14')]);}logger['error'](_0xf58a('0x13'),_0x114020,_0x451b52[_0xf58a('0x12')][_0xf58a('0x14')]);return _0x589193(_0x451b52['error'][_0xf58a('0x14')]);}else{logger['info'](_0xf58a('0x13'),_0x114020,_0xf58a('0xf'));_0x589193(_0x451b52[_0xf58a('0x15')][_0xf58a('0x14')]);}})[_0xf58a('0x16')](function(_0x217399){logger[_0xf58a('0x12')]('Team,\x20%s,\x20%s',_0x114020,_0x217399);_0xfbb3c9(_0x217399);});});} \ No newline at end of file +var _0x5fae=['localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis'];(function(_0x1ea50c,_0x3dd2e7){var _0x37e769=function(_0x2dcb20){while(--_0x2dcb20){_0x1ea50c['push'](_0x1ea50c['shift']());}};_0x37e769(++_0x3dd2e7);}(_0x5fae,0x128));var _0xe5fa=function(_0x302025,_0x478c21){_0x302025=_0x302025-0x0;var _0x5cc773=_0x5fae[_0x302025];return _0x5cc773;};'use strict';var _=require('lodash');var util=require(_0xe5fa('0x0'));var moment=require(_0xe5fa('0x1'));var BPromise=require(_0xe5fa('0x2'));var rs=require(_0xe5fa('0x3'));var fs=require('fs');var Redis=require(_0xe5fa('0x4'));var db=require(_0xe5fa('0x5'))['db'];var utils=require(_0xe5fa('0x6'));var logger=require(_0xe5fa('0x7'))('rpc');var config=require(_0xe5fa('0x8'));var jayson=require(_0xe5fa('0x9'));var client=jayson['client'][_0xe5fa('0xa')]({'port':0x232a});config[_0xe5fa('0xb')]=_['defaults'](config[_0xe5fa('0xb')],{'host':_0xe5fa('0xc'),'port':0x18eb});var socket=require(_0xe5fa('0xd'))(new Redis(config[_0xe5fa('0xb')]));require(_0xe5fa('0xe'))['register'](socket);function respondWithRpcPromise(_0x1d1f20,_0x4fcd90,_0x305545){return new BPromise(function(_0x3745ab,_0x570c6f){return client[_0xe5fa('0xf')](_0x1d1f20,_0x305545)[_0xe5fa('0x10')](function(_0x1dd1d1){logger[_0xe5fa('0x11')](_0xe5fa('0x12'),_0x4fcd90,'request\x20sent');logger[_0xe5fa('0x13')](_0xe5fa('0x14'),_0x4fcd90,_0xe5fa('0x15'),JSON[_0xe5fa('0x16')](_0x1dd1d1));if(_0x1dd1d1[_0xe5fa('0x17')]){if(_0x1dd1d1[_0xe5fa('0x17')][_0xe5fa('0x18')]===0x1f4){logger[_0xe5fa('0x17')]('Team,\x20%s,\x20%s',_0x4fcd90,_0x1dd1d1['error'][_0xe5fa('0x19')]);return _0x570c6f(_0x1dd1d1[_0xe5fa('0x17')][_0xe5fa('0x19')]);}logger['error'](_0xe5fa('0x12'),_0x4fcd90,_0x1dd1d1['error'][_0xe5fa('0x19')]);return _0x3745ab(_0x1dd1d1[_0xe5fa('0x17')][_0xe5fa('0x19')]);}else{logger[_0xe5fa('0x11')](_0xe5fa('0x12'),_0x4fcd90,_0xe5fa('0x15'));_0x3745ab(_0x1dd1d1[_0xe5fa('0x1a')][_0xe5fa('0x19')]);}})[_0xe5fa('0x1b')](function(_0x3e7e4a){logger[_0xe5fa('0x17')]('Team,\x20%s,\x20%s',_0x4fcd90,_0x3e7e4a);_0x570c6f(_0x3e7e4a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 11b9f9a..637907a 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 _0x4fd3=['team:','./team.events','save','update','emit','removeListener','register'];(function(_0x4ae77f,_0x3f1f6f){var _0x28e9a2=function(_0x3a0b64){while(--_0x3a0b64){_0x4ae77f['push'](_0x4ae77f['shift']());}};_0x28e9a2(++_0x3f1f6f);}(_0x4fd3,0x8d));var _0x34fd=function(_0x1e9763,_0x1b53fd){_0x1e9763=_0x1e9763-0x0;var _0x3397c0=_0x4fd3[_0x1e9763];return _0x3397c0;};'use strict';var TeamEvents=require(_0x34fd('0x0'));var events=[_0x34fd('0x1'),'remove',_0x34fd('0x2')];function createListener(_0x17ec47,_0x277424){return function(_0xe98b3){_0x277424[_0x34fd('0x3')](_0x17ec47,_0xe98b3);};}function removeListener(_0x41ba0d,_0x5dba5a){return function(){TeamEvents[_0x34fd('0x4')](_0x41ba0d,_0x5dba5a);};}exports[_0x34fd('0x5')]=function(_0x127efa){for(var _0x558e71=0x0,_0x2a3c7e=events['length'];_0x558e71<_0x2a3c7e;_0x558e71++){var _0x3675f9=events[_0x558e71];var _0x5461b6=createListener(_0x34fd('0x6')+_0x3675f9,_0x127efa);TeamEvents['on'](_0x3675f9,_0x5461b6);}}; \ No newline at end of file +var _0x6b15=['update','emit','removeListener','register','team:'];(function(_0x4df268,_0xb994c7){var _0x5e8419=function(_0x590596){while(--_0x590596){_0x4df268['push'](_0x4df268['shift']());}};_0x5e8419(++_0xb994c7);}(_0x6b15,0xff));var _0x56b1=function(_0x35528d,_0x5a7416){_0x35528d=_0x35528d-0x0;var _0x167c65=_0x6b15[_0x35528d];return _0x167c65;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0x56b1('0x0')];function createListener(_0x2469f2,_0x2d8307){return function(_0x2ff5b3){_0x2d8307[_0x56b1('0x1')](_0x2469f2,_0x2ff5b3);};}function removeListener(_0x36656e,_0x1bb7be){return function(){TeamEvents[_0x56b1('0x2')](_0x36656e,_0x1bb7be);};}exports[_0x56b1('0x3')]=function(_0x4e6193){for(var _0x384153=0x0,_0x380f9b=events['length'];_0x384153<_0x380f9b;_0x384153++){var _0x56f32a=events[_0x384153];var _0x148dee=createListener(_0x56b1('0x4')+_0x56f32a,_0x4e6193);TeamEvents['on'](_0x56f32a,_0x148dee);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 8b00ffc..becf928 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 _0x6e3f=['put','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./template.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x190417,_0x54dc0d){var _0x110e9c=function(_0x517b86){while(--_0x517b86){_0x190417['push'](_0x190417['shift']());}};_0x110e9c(++_0x54dc0d);}(_0x6e3f,0x101));var _0xf6e3=function(_0x44c1d3,_0x200b50){_0x44c1d3=_0x44c1d3-0x0;var _0x34ef1e=_0x6e3f[_0x44c1d3];return _0x34ef1e;};'use strict';var multer=require('multer');var util=require(_0xf6e3('0x0'));var path=require(_0xf6e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6e3('0x2'));var router=express[_0xf6e3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf6e3('0x4'));var config=require(_0xf6e3('0x5'));var controller=require(_0xf6e3('0x6'));router[_0xf6e3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6e3('0x7')](_0xf6e3('0x8'),auth[_0xf6e3('0x9')](),controller[_0xf6e3('0xa')]);router[_0xf6e3('0xb')]('/',auth[_0xf6e3('0x9')](),controller[_0xf6e3('0xc')]);router[_0xf6e3('0xd')]('/:id',auth[_0xf6e3('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf6e3('0xe')]=router; \ No newline at end of file +var _0xf3c2=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3c2,0xd6));var _0x2f3c=function(_0x2b3914,_0x114404){_0x2b3914=_0x2b3914-0x0;var _0x4ea10b=_0xf3c2[_0x2b3914];return _0x4ea10b;};'use strict';var multer=require(_0x2f3c('0x0'));var util=require(_0x2f3c('0x1'));var path=require(_0x2f3c('0x2'));var timeout=require(_0x2f3c('0x3'));var express=require(_0x2f3c('0x4'));var router=express[_0x2f3c('0x5')]();var auth=require(_0x2f3c('0x6'));var interaction=require(_0x2f3c('0x7'));var config=require('../../config/environment');var controller=require(_0x2f3c('0x8'));router[_0x2f3c('0x9')]('/',auth[_0x2f3c('0xa')](),controller[_0x2f3c('0xb')]);router[_0x2f3c('0x9')]('/:id',auth[_0x2f3c('0xa')](),controller[_0x2f3c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f3c('0xd')]);router['put'](_0x2f3c('0xe'),auth[_0x2f3c('0xa')](),controller[_0x2f3c('0xf')]);router[_0x2f3c('0x10')](_0x2f3c('0xe'),auth[_0x2f3c('0xa')](),controller[_0x2f3c('0x11')]);module[_0x2f3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0769cc7..f15ab2c 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 _0x7ec3=['TEXT','exports','STRING'];(function(_0x1ceb73,_0x41baf4){var _0x13fdae=function(_0x4d6611){while(--_0x4d6611){_0x1ceb73['push'](_0x1ceb73['shift']());}};_0x13fdae(++_0x41baf4);}(_0x7ec3,0x184));var _0x37ec=function(_0x28bf07,_0x28cd61){_0x28bf07=_0x28bf07-0x0;var _0x53dfe7=_0x7ec3[_0x28bf07];return _0x53dfe7;};'use strict';var Sequelize=require('sequelize');module[_0x37ec('0x0')]={'name':{'type':Sequelize[_0x37ec('0x1')]},'description':{'type':Sequelize[_0x37ec('0x1')]},'html':{'type':Sequelize[_0x37ec('0x2')]}}; \ No newline at end of file +var _0x4458=['exports','STRING','TEXT','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4458,0xbf));var _0x8445=function(_0x5e930c,_0x531c7b){_0x5e930c=_0x5e930c-0x0;var _0x506605=_0x4458[_0x5e930c];return _0x506605;};'use strict';var Sequelize=require(_0x8445('0x0'));module[_0x8445('0x1')]={'name':{'type':Sequelize[_0x8445('0x2')]},'description':{'type':Sequelize[_0x8445('0x2')]},'html':{'type':Sequelize[_0x8445('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6867bfd..6464fd7 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 _0x2b21=['reject','save','update','destroy','then','Templates','UserProfileResource','end','error','stack','name','send','index','Template','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','show','params','rawAttributes','includeAll','find','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range'];(function(_0x6f0933,_0x296c8b){var _0x42f786=function(_0x41f53b){while(--_0x41f53b){_0x6f0933['push'](_0x6f0933['shift']());}};_0x42f786(++_0x296c8b);}(_0x2b21,0x17b));var _0x12b2=function(_0x17ebae,_0x7da3){_0x17ebae=_0x17ebae-0x0;var _0x8cbe7d=_0x2b21[_0x17ebae];return _0x8cbe7d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x12b2('0x0'));var rimraf=require(_0x12b2('0x1'));var zipdir=require(_0x12b2('0x2'));var jsonpatch=require(_0x12b2('0x3'));var rp=require('request-promise');var moment=require(_0x12b2('0x4'));var BPromise=require(_0x12b2('0x5'));var Mustache=require('mustache');var util=require(_0x12b2('0x6'));var path=require(_0x12b2('0x7'));var sox=require(_0x12b2('0x8'));var csv=require(_0x12b2('0x9'));var ejs=require(_0x12b2('0xa'));var fs=require('fs');var _=require(_0x12b2('0xb'));var squel=require(_0x12b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x12b2('0xd'));var deskjs=require(_0x12b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x12b2('0xf'));var Papa=require(_0x12b2('0x10'));var Redis=require(_0x12b2('0x11'));var authService=require(_0x12b2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x12b2('0x13'));var logger=require(_0x12b2('0x14'))(_0x12b2('0x15'));var utils=require('../../config/utils');var config=require(_0x12b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x594e0c,_0x45b95d){_0x45b95d=_0x45b95d||0xcc;return function(_0x5550d2){if(_0x5550d2){return _0x594e0c[_0x12b2('0x17')](_0x45b95d);}return _0x594e0c[_0x12b2('0x18')](_0x45b95d)['end']();};}function respondWithResult(_0x266459,_0x3e92d0){_0x3e92d0=_0x3e92d0||0xc8;return function(_0x5c0d07){if(_0x5c0d07){return _0x266459[_0x12b2('0x18')](_0x3e92d0)[_0x12b2('0x19')](_0x5c0d07);}};}function respondWithFilteredResult(_0x53f7cf,_0x178ea9){return function(_0x587df9){if(_0x587df9){var _0x14bc46=_0x587df9[_0x12b2('0x1a')],_0x259050=_0x178ea9[_0x12b2('0x1b')],_0x5e25cc=_0x178ea9[_0x12b2('0x1b')]+_0x178ea9[_0x12b2('0x1c')],_0xcf5d60;if(_0x5e25cc>=_0x14bc46){_0x5e25cc=_0x14bc46;_0xcf5d60=0xc8;}else{_0xcf5d60=0xce;}_0x53f7cf['status'](_0xcf5d60);return _0x53f7cf[_0x12b2('0x1d')](_0x12b2('0x1e'),_0x259050+'-'+_0x5e25cc+'/'+_0x14bc46)[_0x12b2('0x19')](_0x587df9);}return null;};}function patchUpdates(_0x405e55){return function(_0x34c366){try{jsonpatch['apply'](_0x34c366,_0x405e55,!![]);}catch(_0x54cbac){return BPromise[_0x12b2('0x1f')](_0x54cbac);}return _0x34c366[_0x12b2('0x20')]();};}function saveUpdates(_0x3acdc2,_0x52d48f){return function(_0x4358d2){if(_0x4358d2){return _0x4358d2[_0x12b2('0x21')](_0x3acdc2)['then'](function(_0x1e49bb){return _0x1e49bb;});}return null;};}function removeEntity(_0xc0af0e,_0x2f67cc){return function(_0x479c2a){if(_0x479c2a){return _0x479c2a[_0x12b2('0x22')]()[_0x12b2('0x23')](function(){var _0xa6fad7=_0x479c2a['get']({'plain':!![]});var _0x2b115d=_0x12b2('0x24');return db[_0x12b2('0x25')]['destroy']({'where':{'type':_0x2b115d,'resourceId':_0xa6fad7['id']}})[_0x12b2('0x23')](function(){return _0x479c2a;});})['then'](function(){_0xc0af0e[_0x12b2('0x18')](0xcc)[_0x12b2('0x26')]();});}};}function handleEntityNotFound(_0x1501a3,_0x47e95f){return function(_0x7d450b){if(!_0x7d450b){_0x1501a3[_0x12b2('0x17')](0x194);}return _0x7d450b;};}function handleError(_0x5a32ef,_0x23c5b0){_0x23c5b0=_0x23c5b0||0x1f4;return function(_0x30793a){logger[_0x12b2('0x27')](_0x30793a[_0x12b2('0x28')]);if(_0x30793a['name']){delete _0x30793a[_0x12b2('0x29')];}_0x5a32ef[_0x12b2('0x18')](_0x23c5b0)[_0x12b2('0x2a')](_0x30793a);};}exports[_0x12b2('0x2b')]=function(_0x5e0c99,_0xa0f8fd){var _0x355bca={},_0x4236b8={},_0x4e8d83={'count':0x0,'rows':[]};var _0x5d8b7f=db[_0x12b2('0x2c')]['rawAttributes'];_0x4236b8[_0x12b2('0x2d')]=_[_0x12b2('0x2e')](_0x5d8b7f);_0x4236b8[_0x12b2('0x2f')]=_[_0x12b2('0x2e')](_0x5e0c99[_0x12b2('0x2f')]);_0x4236b8[_0x12b2('0x30')]=_[_0x12b2('0x31')](_0x4236b8[_0x12b2('0x2d')],_0x4236b8[_0x12b2('0x2f')]);_0x355bca[_0x12b2('0x32')]=_[_0x12b2('0x31')](_0x4236b8[_0x12b2('0x2d')],qs['fields'](_0x5e0c99['query'][_0x12b2('0x33')]));_0x355bca[_0x12b2('0x32')]=_0x355bca[_0x12b2('0x32')][_0x12b2('0x34')]?_0x355bca[_0x12b2('0x32')]:_0x4236b8['model'];if(!_0x5e0c99[_0x12b2('0x2f')][_0x12b2('0x35')](_0x12b2('0x36'))){_0x355bca[_0x12b2('0x1c')]=qs['limit'](_0x5e0c99[_0x12b2('0x2f')]['limit']);_0x355bca[_0x12b2('0x1b')]=qs['offset'](_0x5e0c99['query'][_0x12b2('0x1b')]);}_0x355bca['order']=qs[_0x12b2('0x37')](_0x5e0c99[_0x12b2('0x2f')][_0x12b2('0x37')]);_0x355bca[_0x12b2('0x38')]=qs[_0x12b2('0x30')](_[_0x12b2('0x39')](_0x5e0c99['query'],_0x4236b8[_0x12b2('0x30')]));if(_0x5e0c99[_0x12b2('0x2f')][_0x12b2('0x3a')]){_0x355bca['where']=_[_0x12b2('0x3b')](_0x355bca['where'],{'$or':_[_0x12b2('0x3c')](_0x5d8b7f,function(_0x11ebd5){if(_0x11ebd5[_0x12b2('0x3d')]['key']!==_0x12b2('0x3e')){var _0x3324cd={};_0x3324cd[_0x11ebd5[_0x12b2('0x3f')]]={'$like':'%'+_0x5e0c99['query'][_0x12b2('0x3a')]+'%'};return _0x3324cd;}})});}_0x355bca=_[_0x12b2('0x3b')]({},_0x355bca,_0x5e0c99[_0x12b2('0x40')]);var _0x443fe0={'where':_0x355bca[_0x12b2('0x38')]};return db[_0x12b2('0x2c')][_0x12b2('0x1a')](_0x443fe0)[_0x12b2('0x23')](function(_0x18de38){_0x4e8d83[_0x12b2('0x1a')]=_0x18de38;if(_0x5e0c99[_0x12b2('0x2f')]['includeAll']){_0x355bca[_0x12b2('0x41')]=[{'all':!![]}];}return db[_0x12b2('0x2c')][_0x12b2('0x42')](_0x355bca);})[_0x12b2('0x23')](function(_0x33ace5){_0x4e8d83['rows']=_0x33ace5;return _0x4e8d83;})['then'](respondWithFilteredResult(_0xa0f8fd,_0x355bca))['catch'](handleError(_0xa0f8fd,null));};exports[_0x12b2('0x43')]=function(_0x43a2e1,_0x21d773){var _0x5946a4={'raw':!![],'where':{'id':_0x43a2e1[_0x12b2('0x44')]['id']}},_0x36adb6={};_0x36adb6[_0x12b2('0x2d')]=_[_0x12b2('0x2e')](db['Template'][_0x12b2('0x45')]);_0x36adb6['query']=_['keys'](_0x43a2e1[_0x12b2('0x2f')]);_0x36adb6[_0x12b2('0x30')]=_['intersection'](_0x36adb6['model'],_0x36adb6['query']);_0x5946a4['attributes']=_[_0x12b2('0x31')](_0x36adb6[_0x12b2('0x2d')],qs[_0x12b2('0x33')](_0x43a2e1['query'][_0x12b2('0x33')]));_0x5946a4[_0x12b2('0x32')]=_0x5946a4['attributes'][_0x12b2('0x34')]?_0x5946a4[_0x12b2('0x32')]:_0x36adb6[_0x12b2('0x2d')];if(_0x43a2e1['query'][_0x12b2('0x46')]){_0x5946a4[_0x12b2('0x41')]=[{'all':!![]}];}_0x5946a4=_[_0x12b2('0x3b')]({},_0x5946a4,_0x43a2e1[_0x12b2('0x40')]);return db[_0x12b2('0x2c')][_0x12b2('0x47')](_0x5946a4)['then'](handleEntityNotFound(_0x21d773,null))[_0x12b2('0x23')](respondWithResult(_0x21d773,null))['catch'](handleError(_0x21d773,null));};exports['create']=function(_0x4e7d43,_0x1ba19c){return db[_0x12b2('0x2c')]['create'](_0x4e7d43[_0x12b2('0x48')],{})[_0x12b2('0x23')](function(_0x345bd3){var _0x55e0c1=_0x4e7d43[_0x12b2('0x49')][_0x12b2('0x4a')]({'plain':!![]});if(!_0x55e0c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55e0c1[_0x12b2('0x4b')]===_0x12b2('0x49')){var _0x569115=_0x345bd3['get']({'plain':!![]});var _0x3f9fe7=_0x12b2('0x24');return db[_0x12b2('0x4c')][_0x12b2('0x47')]({'where':{'name':_0x3f9fe7,'userProfileId':_0x55e0c1[_0x12b2('0x4d')]},'raw':!![]})[_0x12b2('0x23')](function(_0x4bf6be){if(_0x4bf6be&&_0x4bf6be[_0x12b2('0x4e')]===0x0){return db[_0x12b2('0x25')][_0x12b2('0x4f')]({'name':_0x569115[_0x12b2('0x29')],'resourceId':_0x569115['id'],'type':_0x4bf6be[_0x12b2('0x29')],'sectionId':_0x4bf6be['id']},{})['then'](function(){return _0x345bd3;});}else{return _0x345bd3;}})[_0x12b2('0x50')](function(_0x214d47){logger[_0x12b2('0x27')](_0x12b2('0x51'),_0x214d47);throw _0x214d47;});}return _0x345bd3;})[_0x12b2('0x23')](respondWithResult(_0x1ba19c,0xc9))[_0x12b2('0x50')](handleError(_0x1ba19c,null));};exports[_0x12b2('0x21')]=function(_0xea2d40,_0x418c69){if(_0xea2d40['body']['id']){delete _0xea2d40['body']['id'];}return db[_0x12b2('0x2c')]['find']({'where':{'id':_0xea2d40[_0x12b2('0x44')]['id']}})[_0x12b2('0x23')](handleEntityNotFound(_0x418c69,null))['then'](saveUpdates(_0xea2d40[_0x12b2('0x48')],null))['then'](respondWithResult(_0x418c69,null))[_0x12b2('0x50')](handleError(_0x418c69,null));};exports['destroy']=function(_0x3210aa,_0x4fdda0){return db[_0x12b2('0x2c')][_0x12b2('0x47')]({'where':{'id':_0x3210aa[_0x12b2('0x44')]['id']}})[_0x12b2('0x23')](handleEntityNotFound(_0x4fdda0,null))[_0x12b2('0x23')](removeEntity(_0x4fdda0,null))[_0x12b2('0x50')](handleError(_0x4fdda0,null));}; \ No newline at end of file +var _0x55d3=['pick','filter','where','merge','type','key','field','options','Template','include','rows','catch','show','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','Content-Range','apply','reject','save','then','destroy','Templates','UserProfileResource','end','error','name','send','rawAttributes','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort'];(function(_0x4ca199,_0x1d252f){var _0x6494c7=function(_0x4a0106){while(--_0x4a0106){_0x4ca199['push'](_0x4ca199['shift']());}};_0x6494c7(++_0x1d252f);}(_0x55d3,0x68));var _0x355d=function(_0x359c08,_0x23f0f0){_0x359c08=_0x359c08-0x0;var _0x2e073c=_0x55d3[_0x359c08];return _0x2e073c;};'use strict';var pdf=require(_0x355d('0x0'));var emlformat=require(_0x355d('0x1'));var rimraf=require(_0x355d('0x2'));var zipdir=require(_0x355d('0x3'));var jsonpatch=require(_0x355d('0x4'));var rp=require(_0x355d('0x5'));var moment=require(_0x355d('0x6'));var BPromise=require(_0x355d('0x7'));var Mustache=require(_0x355d('0x8'));var util=require(_0x355d('0x9'));var path=require('path');var sox=require(_0x355d('0xa'));var csv=require(_0x355d('0xb'));var ejs=require(_0x355d('0xc'));var fs=require('fs');var _=require(_0x355d('0xd'));var squel=require(_0x355d('0xe'));var crypto=require(_0x355d('0xf'));var jsforce=require(_0x355d('0x10'));var deskjs=require(_0x355d('0x11'));var toCsv=require(_0x355d('0xb'));var querystring=require(_0x355d('0x12'));var Papa=require('papaparse');var Redis=require(_0x355d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x355d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x355d('0x15'));var db=require(_0x355d('0x16'))['db'];function respondWithStatusCode(_0x22da98,_0xf3827f){_0xf3827f=_0xf3827f||0xcc;return function(_0x9c612e){if(_0x9c612e){return _0x22da98[_0x355d('0x17')](_0xf3827f);}return _0x22da98[_0x355d('0x18')](_0xf3827f)['end']();};}function respondWithResult(_0x28d2ae,_0x5d53c2){_0x5d53c2=_0x5d53c2||0xc8;return function(_0x4a006d){if(_0x4a006d){return _0x28d2ae[_0x355d('0x18')](_0x5d53c2)[_0x355d('0x19')](_0x4a006d);}};}function respondWithFilteredResult(_0x1578c0,_0x41a595){return function(_0x74f313){if(_0x74f313){var _0x5aa3d5=_0x74f313[_0x355d('0x1a')],_0x533b44=_0x41a595['offset'],_0x4997e8=_0x41a595['offset']+_0x41a595[_0x355d('0x1b')],_0x290b29;if(_0x4997e8>=_0x5aa3d5){_0x4997e8=_0x5aa3d5;_0x290b29=0xc8;}else{_0x290b29=0xce;}_0x1578c0['status'](_0x290b29);return _0x1578c0['set'](_0x355d('0x1c'),_0x533b44+'-'+_0x4997e8+'/'+_0x5aa3d5)[_0x355d('0x19')](_0x74f313);}return null;};}function patchUpdates(_0x2b9a47){return function(_0x9d6359){try{jsonpatch[_0x355d('0x1d')](_0x9d6359,_0x2b9a47,!![]);}catch(_0xa80fdb){return BPromise[_0x355d('0x1e')](_0xa80fdb);}return _0x9d6359[_0x355d('0x1f')]();};}function saveUpdates(_0x398ce6,_0x387625){return function(_0x3d6b1e){if(_0x3d6b1e){return _0x3d6b1e['update'](_0x398ce6)[_0x355d('0x20')](function(_0x530c4c){return _0x530c4c;});}return null;};}function removeEntity(_0x39410e,_0x571d88){return function(_0x1f8b53){if(_0x1f8b53){return _0x1f8b53[_0x355d('0x21')]()[_0x355d('0x20')](function(){var _0x150b71=_0x1f8b53['get']({'plain':!![]});var _0x25ec6c=_0x355d('0x22');return db[_0x355d('0x23')]['destroy']({'where':{'type':_0x25ec6c,'resourceId':_0x150b71['id']}})[_0x355d('0x20')](function(){return _0x1f8b53;});})['then'](function(){_0x39410e['status'](0xcc)[_0x355d('0x24')]();});}};}function handleEntityNotFound(_0x4d035c,_0x4d17e0){return function(_0x40f2b9){if(!_0x40f2b9){_0x4d035c[_0x355d('0x17')](0x194);}return _0x40f2b9;};}function handleError(_0x4d88d7,_0x52fb37){_0x52fb37=_0x52fb37||0x1f4;return function(_0x436d6d){logger[_0x355d('0x25')](_0x436d6d['stack']);if(_0x436d6d[_0x355d('0x26')]){delete _0x436d6d[_0x355d('0x26')];}_0x4d88d7[_0x355d('0x18')](_0x52fb37)[_0x355d('0x27')](_0x436d6d);};}exports['index']=function(_0x380df8,_0x49eb04){var _0x5234da={},_0x3124ed={},_0x15cb98={'count':0x0,'rows':[]};var _0xbbe6e7=db['Template'][_0x355d('0x28')];_0x3124ed['model']=_['keys'](_0xbbe6e7);_0x3124ed[_0x355d('0x29')]=_['keys'](_0x380df8[_0x355d('0x29')]);_0x3124ed[_0x355d('0x2a')]=_[_0x355d('0x2b')](_0x3124ed[_0x355d('0x2c')],_0x3124ed[_0x355d('0x29')]);_0x5234da['attributes']=_[_0x355d('0x2b')](_0x3124ed[_0x355d('0x2c')],qs['fields'](_0x380df8[_0x355d('0x29')]['fields']));_0x5234da['attributes']=_0x5234da[_0x355d('0x2d')][_0x355d('0x2e')]?_0x5234da[_0x355d('0x2d')]:_0x3124ed[_0x355d('0x2c')];if(!_0x380df8[_0x355d('0x29')][_0x355d('0x2f')](_0x355d('0x30'))){_0x5234da['limit']=qs[_0x355d('0x1b')](_0x380df8[_0x355d('0x29')][_0x355d('0x1b')]);_0x5234da[_0x355d('0x31')]=qs[_0x355d('0x31')](_0x380df8[_0x355d('0x29')][_0x355d('0x31')]);}_0x5234da[_0x355d('0x32')]=qs[_0x355d('0x33')](_0x380df8[_0x355d('0x29')][_0x355d('0x33')]);_0x5234da['where']=qs[_0x355d('0x2a')](_[_0x355d('0x34')](_0x380df8['query'],_0x3124ed[_0x355d('0x2a')]));if(_0x380df8[_0x355d('0x29')][_0x355d('0x35')]){_0x5234da[_0x355d('0x36')]=_[_0x355d('0x37')](_0x5234da[_0x355d('0x36')],{'$or':_['map'](_0xbbe6e7,function(_0x2719e1){if(_0x2719e1[_0x355d('0x38')][_0x355d('0x39')]!=='VIRTUAL'){var _0x1f2654={};_0x1f2654[_0x2719e1[_0x355d('0x3a')]]={'$like':'%'+_0x380df8['query'][_0x355d('0x35')]+'%'};return _0x1f2654;}})});}_0x5234da=_[_0x355d('0x37')]({},_0x5234da,_0x380df8[_0x355d('0x3b')]);var _0x3bab32={'where':_0x5234da[_0x355d('0x36')]};return db[_0x355d('0x3c')][_0x355d('0x1a')](_0x3bab32)[_0x355d('0x20')](function(_0x58db03){_0x15cb98[_0x355d('0x1a')]=_0x58db03;if(_0x380df8['query']['includeAll']){_0x5234da[_0x355d('0x3d')]=[{'all':!![]}];}return db[_0x355d('0x3c')]['findAll'](_0x5234da);})[_0x355d('0x20')](function(_0xdf361c){_0x15cb98[_0x355d('0x3e')]=_0xdf361c;return _0x15cb98;})[_0x355d('0x20')](respondWithFilteredResult(_0x49eb04,_0x5234da))[_0x355d('0x3f')](handleError(_0x49eb04,null));};exports[_0x355d('0x40')]=function(_0x1e4338,_0x2f7d6b){var _0x183f93={'raw':!![],'where':{'id':_0x1e4338[_0x355d('0x41')]['id']}},_0x4286fb={};_0x4286fb[_0x355d('0x2c')]=_['keys'](db[_0x355d('0x3c')]['rawAttributes']);_0x4286fb[_0x355d('0x29')]=_['keys'](_0x1e4338[_0x355d('0x29')]);_0x4286fb[_0x355d('0x2a')]=_[_0x355d('0x2b')](_0x4286fb[_0x355d('0x2c')],_0x4286fb[_0x355d('0x29')]);_0x183f93[_0x355d('0x2d')]=_[_0x355d('0x2b')](_0x4286fb[_0x355d('0x2c')],qs[_0x355d('0x42')](_0x1e4338[_0x355d('0x29')]['fields']));_0x183f93[_0x355d('0x2d')]=_0x183f93[_0x355d('0x2d')][_0x355d('0x2e')]?_0x183f93[_0x355d('0x2d')]:_0x4286fb[_0x355d('0x2c')];if(_0x1e4338[_0x355d('0x29')]['includeAll']){_0x183f93[_0x355d('0x3d')]=[{'all':!![]}];}_0x183f93=_['merge']({},_0x183f93,_0x1e4338['options']);return db[_0x355d('0x3c')][_0x355d('0x43')](_0x183f93)['then'](handleEntityNotFound(_0x2f7d6b,null))[_0x355d('0x20')](respondWithResult(_0x2f7d6b,null))[_0x355d('0x3f')](handleError(_0x2f7d6b,null));};exports['create']=function(_0x2bbe5c,_0xe1d529){return db[_0x355d('0x3c')][_0x355d('0x44')](_0x2bbe5c[_0x355d('0x45')],{})[_0x355d('0x20')](function(_0xb35fed){var _0xe66be8=_0x2bbe5c[_0x355d('0x46')][_0x355d('0x47')]({'plain':!![]});if(!_0xe66be8)throw new Error(_0x355d('0x48'));if(_0xe66be8[_0x355d('0x49')]===_0x355d('0x46')){var _0x2c1600=_0xb35fed[_0x355d('0x47')]({'plain':!![]});var _0x443eff=_0x355d('0x22');return db[_0x355d('0x4a')]['find']({'where':{'name':_0x443eff,'userProfileId':_0xe66be8['userProfileId']},'raw':!![]})[_0x355d('0x20')](function(_0x422ae9){if(_0x422ae9&&_0x422ae9[_0x355d('0x4b')]===0x0){return db[_0x355d('0x23')][_0x355d('0x44')]({'name':_0x2c1600[_0x355d('0x26')],'resourceId':_0x2c1600['id'],'type':_0x422ae9[_0x355d('0x26')],'sectionId':_0x422ae9['id']},{})[_0x355d('0x20')](function(){return _0xb35fed;});}else{return _0xb35fed;}})[_0x355d('0x3f')](function(_0x2274b6){logger[_0x355d('0x25')](_0x355d('0x4c'),_0x2274b6);throw _0x2274b6;});}return _0xb35fed;})['then'](respondWithResult(_0xe1d529,0xc9))[_0x355d('0x3f')](handleError(_0xe1d529,null));};exports[_0x355d('0x4d')]=function(_0x50f3ab,_0x4a57d7){if(_0x50f3ab[_0x355d('0x45')]['id']){delete _0x50f3ab[_0x355d('0x45')]['id'];}return db[_0x355d('0x3c')][_0x355d('0x43')]({'where':{'id':_0x50f3ab['params']['id']}})[_0x355d('0x20')](handleEntityNotFound(_0x4a57d7,null))[_0x355d('0x20')](saveUpdates(_0x50f3ab[_0x355d('0x45')],null))[_0x355d('0x20')](respondWithResult(_0x4a57d7,null))[_0x355d('0x3f')](handleError(_0x4a57d7,null));};exports[_0x355d('0x21')]=function(_0x3b2db3,_0x143668){return db[_0x355d('0x3c')][_0x355d('0x43')]({'where':{'id':_0x3b2db3[_0x355d('0x41')]['id']}})[_0x355d('0x20')](handleEntityNotFound(_0x143668,null))[_0x355d('0x20')](removeEntity(_0x143668,null))[_0x355d('0x3f')](handleError(_0x143668,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 066e6c7..1825831 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 _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./template.attributes','exports','lodash'];(function(_0xe03ef4,_0x380f64){var _0x2b2bc2=function(_0xaaa556){while(--_0xaaa556){_0xe03ef4['push'](_0xe03ef4['shift']());}};_0x2b2bc2(++_0x380f64);}(_0xed3c,0x1a6));var _0xced3=function(_0x4544d3,_0x149a72){_0x4544d3=_0x4544d3-0x0;var _0x36aeca=_0xed3c[_0x4544d3];return _0x36aeca;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda2d=['./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x68c690,_0xc53d07){var _0x5a68b9=function(_0x550358){while(--_0x550358){_0x68c690['push'](_0x68c690['shift']());}};_0x5a68b9(++_0xc53d07);}(_0xda2d,0x102));var _0xdda2=function(_0x110f71,_0x22ad80){_0x110f71=_0x110f71-0x0;var _0x2b6068=_0xda2d[_0x110f71];return _0x2b6068;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'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 e58acac..8b31794 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 _0x923d=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetTemplate','Template','findAll','options','raw','limit','include','map','model','attributes','catch','lodash','util'];(function(_0x47a88a,_0x47e7ab){var _0x36fdb0=function(_0x3d30ca){while(--_0x3d30ca){_0x47a88a['push'](_0x47a88a['shift']());}};_0x36fdb0(++_0x47e7ab);}(_0x923d,0x9e));var _0xd923=function(_0x1dcbcc,_0x53ca16){_0x1dcbcc=_0x1dcbcc-0x0;var _0x25bd6c=_0x923d[_0x1dcbcc];return _0x25bd6c;};'use strict';var _=require(_0xd923('0x0'));var util=require(_0xd923('0x1'));var moment=require(_0xd923('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd923('0x3'));var db=require(_0xd923('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd923('0x5'))(_0xd923('0x6'));var config=require(_0xd923('0x7'));var jayson=require(_0xd923('0x8'));var client=jayson[_0xd923('0x9')][_0xd923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265c8c,_0x47f6cd,_0x439744){return new BPromise(function(_0x37696d,_0x3e7f0e){return client['request'](_0x265c8c,_0x439744)[_0xd923('0xb')](function(_0xc8e12f){logger[_0xd923('0xc')](_0xd923('0xd'),_0x47f6cd,'request\x20sent');logger[_0xd923('0xe')](_0xd923('0xf'),_0x47f6cd,_0xd923('0x10'),JSON[_0xd923('0x11')](_0xc8e12f));if(_0xc8e12f['error']){if(_0xc8e12f[_0xd923('0x12')]['code']===0x1f4){logger[_0xd923('0x12')]('Template,\x20%s,\x20%s',_0x47f6cd,_0xc8e12f[_0xd923('0x12')][_0xd923('0x13')]);return _0x3e7f0e(_0xc8e12f[_0xd923('0x12')][_0xd923('0x13')]);}logger[_0xd923('0x12')]('Template,\x20%s,\x20%s',_0x47f6cd,_0xc8e12f['error'][_0xd923('0x13')]);return _0x37696d(_0xc8e12f[_0xd923('0x12')][_0xd923('0x13')]);}else{logger[_0xd923('0xc')](_0xd923('0xd'),_0x47f6cd,_0xd923('0x10'));_0x37696d(_0xc8e12f[_0xd923('0x14')]['message']);}})['catch'](function(_0x5c3530){logger[_0xd923('0x12')](_0xd923('0xd'),_0x47f6cd,_0x5c3530);_0x3e7f0e(_0x5c3530);});});}exports[_0xd923('0x15')]=function(_0x5b1fe6){var _0xe991a5=this;return new Promise(function(_0x119386,_0x12ed06){return db[_0xd923('0x16')][_0xd923('0x17')]({'raw':_0x5b1fe6[_0xd923('0x18')]?_0x5b1fe6[_0xd923('0x18')][_0xd923('0x19')]===undefined?!![]:![]:!![],'where':_0x5b1fe6[_0xd923('0x18')]?_0x5b1fe6['options']['where']||null:null,'attributes':_0x5b1fe6[_0xd923('0x18')]?_0x5b1fe6[_0xd923('0x18')]['attributes']||null:null,'limit':_0x5b1fe6['options']?_0x5b1fe6['options'][_0xd923('0x1a')]||null:null,'include':_0x5b1fe6[_0xd923('0x18')]?_0x5b1fe6[_0xd923('0x18')][_0xd923('0x1b')]?_[_0xd923('0x1c')](_0x5b1fe6[_0xd923('0x18')][_0xd923('0x1b')],function(_0x12535b){return{'model':db[_0x12535b[_0xd923('0x1d')]],'as':_0x12535b['as'],'attributes':_0x12535b[_0xd923('0x1e')],'include':_0x12535b[_0xd923('0x1b')]?_[_0xd923('0x1c')](_0x12535b['include'],function(_0x2287f5){return{'model':db[_0x2287f5[_0xd923('0x1d')]],'as':_0x2287f5['as'],'attributes':_0x2287f5[_0xd923('0x1e')],'include':_0x2287f5['include']?_[_0xd923('0x1c')](_0x2287f5[_0xd923('0x1b')],function(_0x4bbb4f){return{'model':db[_0x4bbb4f['model']],'as':_0x4bbb4f['as'],'attributes':_0x4bbb4f[_0xd923('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f08a0){logger[_0xd923('0xc')]('GetTemplate',_0x5b1fe6);logger[_0xd923('0xe')](_0xd923('0x15'),_0x5b1fe6,JSON['stringify'](_0x1f08a0));_0x119386(_0x1f08a0);})[_0xd923('0x1f')](function(_0x463af2){logger[_0xd923('0x12')]('GetTemplate',_0x463af2[_0xd923('0x13')],_0x5b1fe6);_0x12ed06(_0xe991a5[_0xd923('0x12')](0x1f4,_0x463af2[_0xd923('0x13')]));});});}; \ No newline at end of file +var _0xb1eb=['http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','limit','include','map','model','attributes','info','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14e1d6,_0x2524ec){var _0xc9f17a=function(_0x20f883){while(--_0x20f883){_0x14e1d6['push'](_0x14e1d6['shift']());}};_0xc9f17a(++_0x2524ec);}(_0xb1eb,0xb0));var _0xbb1e=function(_0x1980c3,_0x305661){_0x1980c3=_0x1980c3-0x0;var _0x1b3eaa=_0xb1eb[_0x1980c3];return _0x1b3eaa;};'use strict';var _=require('lodash');var util=require(_0xbb1e('0x0'));var moment=require(_0xbb1e('0x1'));var BPromise=require(_0xbb1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb1e('0x3'))['db'];var utils=require(_0xbb1e('0x4'));var logger=require(_0xbb1e('0x5'))(_0xbb1e('0x6'));var config=require(_0xbb1e('0x7'));var jayson=require(_0xbb1e('0x8'));var client=jayson[_0xbb1e('0x9')][_0xbb1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d1eb,_0x33b7f5,_0x11b479){return new BPromise(function(_0x48767c,_0x1a6578){return client[_0xbb1e('0xb')](_0x14d1eb,_0x11b479)[_0xbb1e('0xc')](function(_0x3c6689){logger['info'](_0xbb1e('0xd'),_0x33b7f5,_0xbb1e('0xe'));logger[_0xbb1e('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x33b7f5,'request\x20sent',JSON[_0xbb1e('0x10')](_0x3c6689));if(_0x3c6689['error']){if(_0x3c6689[_0xbb1e('0x11')][_0xbb1e('0x12')]===0x1f4){logger[_0xbb1e('0x11')](_0xbb1e('0xd'),_0x33b7f5,_0x3c6689[_0xbb1e('0x11')][_0xbb1e('0x13')]);return _0x1a6578(_0x3c6689[_0xbb1e('0x11')][_0xbb1e('0x13')]);}logger[_0xbb1e('0x11')](_0xbb1e('0xd'),_0x33b7f5,_0x3c6689[_0xbb1e('0x11')][_0xbb1e('0x13')]);return _0x48767c(_0x3c6689[_0xbb1e('0x11')][_0xbb1e('0x13')]);}else{logger['info'](_0xbb1e('0xd'),_0x33b7f5,_0xbb1e('0xe'));_0x48767c(_0x3c6689['result'][_0xbb1e('0x13')]);}})[_0xbb1e('0x14')](function(_0x4f39b7){logger[_0xbb1e('0x11')](_0xbb1e('0xd'),_0x33b7f5,_0x4f39b7);_0x1a6578(_0x4f39b7);});});}exports[_0xbb1e('0x15')]=function(_0x19e526){var _0x89c4bb=this;return new Promise(function(_0xc80b58,_0x5106fd){return db[_0xbb1e('0x16')][_0xbb1e('0x17')]({'raw':_0x19e526[_0xbb1e('0x18')]?_0x19e526['options']['raw']===undefined?!![]:![]:!![],'where':_0x19e526[_0xbb1e('0x18')]?_0x19e526[_0xbb1e('0x18')]['where']||null:null,'attributes':_0x19e526[_0xbb1e('0x18')]?_0x19e526[_0xbb1e('0x18')]['attributes']||null:null,'limit':_0x19e526['options']?_0x19e526['options'][_0xbb1e('0x19')]||null:null,'include':_0x19e526[_0xbb1e('0x18')]?_0x19e526[_0xbb1e('0x18')][_0xbb1e('0x1a')]?_[_0xbb1e('0x1b')](_0x19e526[_0xbb1e('0x18')]['include'],function(_0x15e796){return{'model':db[_0x15e796[_0xbb1e('0x1c')]],'as':_0x15e796['as'],'attributes':_0x15e796['attributes'],'include':_0x15e796[_0xbb1e('0x1a')]?_[_0xbb1e('0x1b')](_0x15e796[_0xbb1e('0x1a')],function(_0x33e325){return{'model':db[_0x33e325['model']],'as':_0x33e325['as'],'attributes':_0x33e325[_0xbb1e('0x1d')],'include':_0x33e325[_0xbb1e('0x1a')]?_[_0xbb1e('0x1b')](_0x33e325[_0xbb1e('0x1a')],function(_0x22b93b){return{'model':db[_0x22b93b[_0xbb1e('0x1c')]],'as':_0x22b93b['as'],'attributes':_0x22b93b[_0xbb1e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb1e('0xc')](function(_0x7eca91){logger[_0xbb1e('0x1e')](_0xbb1e('0x15'),_0x19e526);logger[_0xbb1e('0xf')](_0xbb1e('0x15'),_0x19e526,JSON[_0xbb1e('0x10')](_0x7eca91));_0xc80b58(_0x7eca91);})['catch'](function(_0x2694d5){logger[_0xbb1e('0x11')](_0xbb1e('0x15'),_0x2694d5[_0xbb1e('0x13')],_0x19e526);_0x5106fd(_0x89c4bb[_0xbb1e('0x11')](0x1f4,_0x2694d5[_0xbb1e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index f7bb35c..f1ef709 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x5823a4,_0x430d17){var _0x50bc3c=function(_0x5a69a2){while(--_0x5a69a2){_0x5823a4['push'](_0x5823a4['shift']());}};_0x50bc3c(++_0x430d17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x537633,_0x51364f){var _0x2184b1=function(_0x4af4af){while(--_0x4af4af){_0x537633['push'](_0x537633['shift']());}};_0x2184b1(++_0x51364f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 0d9fa4b..0223207 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 _0xedfa=['STRING','BOOLEAN','sequelize','exports'];(function(_0x44d902,_0x376b4e){var _0x27aa72=function(_0x5059fd){while(--_0x5059fd){_0x44d902['push'](_0x44d902['shift']());}};_0x27aa72(++_0x376b4e);}(_0xedfa,0x9a));var _0xaedf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xedfa[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xaedf('0x0'));module[_0xaedf('0x1')]={'name':{'type':Sequelize[_0xaedf('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaedf('0x2')]},'status':{'type':Sequelize[_0xaedf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x74a3=['BOOLEAN','sequelize','exports','STRING'];(function(_0x195b22,_0x4921af){var _0x8880f9=function(_0x15c663){while(--_0x15c663){_0x195b22['push'](_0x195b22['shift']());}};_0x8880f9(++_0x4921af);}(_0x74a3,0x13d));var _0x374a=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x74a3[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x374a('0x0'));module[_0x374a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x374a('0x2')]},'description':{'type':Sequelize[_0x374a('0x2')]},'status':{'type':Sequelize[_0x374a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index d18d49a..7858294 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 _0x39aa=['TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','destroy','end','error','stack','name','send','index','Trigger','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','rows','rawAttributes','find','catch','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x39aa,0x11b));var _0xa39a=function(_0x3e9030,_0x16c384){_0x3e9030=_0x3e9030-0x0;var _0x526b49=_0x39aa[_0x3e9030];return _0x526b49;};'use strict';var pdf=require(_0xa39a('0x0'));var emlformat=require(_0xa39a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa39a('0x2'));var jsonpatch=require(_0xa39a('0x3'));var rp=require(_0xa39a('0x4'));var moment=require(_0xa39a('0x5'));var BPromise=require(_0xa39a('0x6'));var Mustache=require(_0xa39a('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa39a('0x8'));var ejs=require(_0xa39a('0x9'));var fs=require('fs');var _=require(_0xa39a('0xa'));var squel=require(_0xa39a('0xb'));var crypto=require(_0xa39a('0xc'));var jsforce=require(_0xa39a('0xd'));var deskjs=require(_0xa39a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa39a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa39a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa39a('0x11'))(_0xa39a('0x12'));var utils=require(_0xa39a('0x13'));var config=require(_0xa39a('0x14'));var db=require(_0xa39a('0x15'))['db'];function respondWithStatusCode(_0x1f72f7,_0x2f7468){_0x2f7468=_0x2f7468||0xcc;return function(_0x322920){if(_0x322920){return _0x1f72f7[_0xa39a('0x16')](_0x2f7468);}return _0x1f72f7['status'](_0x2f7468)['end']();};}function respondWithResult(_0x917676,_0x23262d){_0x23262d=_0x23262d||0xc8;return function(_0x5dae72){if(_0x5dae72){return _0x917676[_0xa39a('0x17')](_0x23262d)['json'](_0x5dae72);}};}function respondWithFilteredResult(_0x3d858f,_0x4fd8dd){return function(_0x901e2a){if(_0x901e2a){var _0x4a94d2=_0x901e2a[_0xa39a('0x18')],_0x1e1015=_0x4fd8dd[_0xa39a('0x19')],_0x13c972=_0x4fd8dd[_0xa39a('0x19')]+_0x4fd8dd['limit'],_0x441222;if(_0x13c972>=_0x4a94d2){_0x13c972=_0x4a94d2;_0x441222=0xc8;}else{_0x441222=0xce;}_0x3d858f[_0xa39a('0x17')](_0x441222);return _0x3d858f[_0xa39a('0x1a')](_0xa39a('0x1b'),_0x1e1015+'-'+_0x13c972+'/'+_0x4a94d2)[_0xa39a('0x1c')](_0x901e2a);}return null;};}function patchUpdates(_0x2a8658){return function(_0x461657){try{jsonpatch[_0xa39a('0x1d')](_0x461657,_0x2a8658,!![]);}catch(_0x38a7e9){return BPromise[_0xa39a('0x1e')](_0x38a7e9);}return _0x461657[_0xa39a('0x1f')]();};}function saveUpdates(_0x12681b,_0x4638a2){return function(_0x5ac99f){if(_0x5ac99f){return _0x5ac99f[_0xa39a('0x20')](_0x12681b)[_0xa39a('0x21')](function(_0x562316){return _0x562316;});}return null;};}function removeEntity(_0x1b1976,_0x1ef8e8){return function(_0x549967){if(_0x549967){return _0x549967['destroy']()[_0xa39a('0x21')](function(){var _0x988b40=_0x549967[_0xa39a('0x22')]({'plain':!![]});var _0x58cf77=_0xa39a('0x23');return db['UserProfileResource'][_0xa39a('0x24')]({'where':{'type':_0x58cf77,'resourceId':_0x988b40['id']}})[_0xa39a('0x21')](function(){return _0x549967;});})[_0xa39a('0x21')](function(){_0x1b1976[_0xa39a('0x17')](0xcc)[_0xa39a('0x25')]();});}};}function handleEntityNotFound(_0x4e2117,_0x3cd3ca){return function(_0x17bcbe){if(!_0x17bcbe){_0x4e2117[_0xa39a('0x16')](0x194);}return _0x17bcbe;};}function handleError(_0xebd768,_0x4dd3ca){_0x4dd3ca=_0x4dd3ca||0x1f4;return function(_0x528cba){logger[_0xa39a('0x26')](_0x528cba[_0xa39a('0x27')]);if(_0x528cba['name']){delete _0x528cba[_0xa39a('0x28')];}_0xebd768['status'](_0x4dd3ca)[_0xa39a('0x29')](_0x528cba);};}exports[_0xa39a('0x2a')]=function(_0x4ad695,_0x7d8d01){var _0x1a9efb={},_0x3d7733={},_0x15189d={'count':0x0,'rows':[]};var _0x521cf1=db[_0xa39a('0x2b')]['rawAttributes'];_0x3d7733[_0xa39a('0x2c')]=_[_0xa39a('0x2d')](_0x521cf1);_0x3d7733[_0xa39a('0x2e')]=_[_0xa39a('0x2d')](_0x4ad695['query']);_0x3d7733[_0xa39a('0x2f')]=_[_0xa39a('0x30')](_0x3d7733['model'],_0x3d7733[_0xa39a('0x2e')]);_0x1a9efb[_0xa39a('0x31')]=_['intersection'](_0x3d7733['model'],qs[_0xa39a('0x32')](_0x4ad695['query'][_0xa39a('0x32')]));_0x1a9efb[_0xa39a('0x31')]=_0x1a9efb['attributes'][_0xa39a('0x33')]?_0x1a9efb[_0xa39a('0x31')]:_0x3d7733[_0xa39a('0x2c')];if(!_0x4ad695[_0xa39a('0x2e')][_0xa39a('0x34')](_0xa39a('0x35'))){_0x1a9efb[_0xa39a('0x36')]=qs[_0xa39a('0x36')](_0x4ad695[_0xa39a('0x2e')][_0xa39a('0x36')]);_0x1a9efb[_0xa39a('0x19')]=qs[_0xa39a('0x19')](_0x4ad695[_0xa39a('0x2e')][_0xa39a('0x19')]);}_0x1a9efb[_0xa39a('0x37')]=qs['sort'](_0x4ad695['query'][_0xa39a('0x38')]);_0x1a9efb['where']=qs[_0xa39a('0x2f')](_[_0xa39a('0x39')](_0x4ad695['query'],_0x3d7733[_0xa39a('0x2f')]));if(_0x4ad695[_0xa39a('0x2e')]['filter']){_0x1a9efb[_0xa39a('0x3a')]=_[_0xa39a('0x3b')](_0x1a9efb[_0xa39a('0x3a')],{'$or':_[_0xa39a('0x3c')](_0x521cf1,function(_0x736134){if(_0x736134[_0xa39a('0x3d')]['key']!==_0xa39a('0x3e')){var _0x55b4dc={};_0x55b4dc[_0x736134[_0xa39a('0x3f')]]={'$like':'%'+_0x4ad695['query'][_0xa39a('0x40')]+'%'};return _0x55b4dc;}})});}_0x1a9efb=_[_0xa39a('0x3b')]({},_0x1a9efb,_0x4ad695[_0xa39a('0x41')]);var _0x102075={'where':_0x1a9efb['where']};return db[_0xa39a('0x2b')]['count'](_0x102075)['then'](function(_0x63c09a){_0x15189d[_0xa39a('0x18')]=_0x63c09a;if(_0x4ad695[_0xa39a('0x2e')][_0xa39a('0x42')]){_0x1a9efb[_0xa39a('0x43')]=[{'all':!![]}];}return db[_0xa39a('0x2b')]['findAll'](_0x1a9efb);})[_0xa39a('0x21')](function(_0x4677a4){_0x15189d[_0xa39a('0x44')]=_0x4677a4;return _0x15189d;})[_0xa39a('0x21')](respondWithFilteredResult(_0x7d8d01,_0x1a9efb))['catch'](handleError(_0x7d8d01,null));};exports['show']=function(_0x132f8e,_0xc6db1d){var _0x3911ad={'raw':![],'where':{'id':_0x132f8e['params']['id']}},_0x4e1311={};_0x4e1311[_0xa39a('0x2c')]=_[_0xa39a('0x2d')](db[_0xa39a('0x2b')][_0xa39a('0x45')]);_0x4e1311[_0xa39a('0x2e')]=_[_0xa39a('0x2d')](_0x132f8e[_0xa39a('0x2e')]);_0x4e1311[_0xa39a('0x2f')]=_[_0xa39a('0x30')](_0x4e1311[_0xa39a('0x2c')],_0x4e1311[_0xa39a('0x2e')]);_0x3911ad[_0xa39a('0x31')]=_[_0xa39a('0x30')](_0x4e1311[_0xa39a('0x2c')],qs[_0xa39a('0x32')](_0x132f8e[_0xa39a('0x2e')]['fields']));_0x3911ad[_0xa39a('0x31')]=_0x3911ad['attributes'][_0xa39a('0x33')]?_0x3911ad['attributes']:_0x4e1311['model'];if(_0x132f8e['query'][_0xa39a('0x42')]){_0x3911ad[_0xa39a('0x43')]=[{'all':!![]}];}_0x3911ad=_[_0xa39a('0x3b')]({},_0x3911ad,_0x132f8e[_0xa39a('0x41')]);return db[_0xa39a('0x2b')][_0xa39a('0x46')](_0x3911ad)['then'](handleEntityNotFound(_0xc6db1d,null))[_0xa39a('0x21')](respondWithResult(_0xc6db1d,null))[_0xa39a('0x47')](handleError(_0xc6db1d,null));};exports[_0xa39a('0x48')]=function(_0x395786,_0x40172d){return db[_0xa39a('0x2b')]['create'](_0x395786[_0xa39a('0x49')],{})[_0xa39a('0x21')](function(_0x50fe66){var _0x3ba31e=_0x395786[_0xa39a('0x4a')][_0xa39a('0x22')]({'plain':!![]});if(!_0x3ba31e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ba31e[_0xa39a('0x4b')]===_0xa39a('0x4a')){var _0xd77c77=_0x50fe66[_0xa39a('0x22')]({'plain':!![]});var _0x221e8c=_0xa39a('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x221e8c,'userProfileId':_0x3ba31e[_0xa39a('0x4c')]},'raw':!![]})[_0xa39a('0x21')](function(_0x1b5c0b){if(_0x1b5c0b&&_0x1b5c0b[_0xa39a('0x4d')]===0x0){return db[_0xa39a('0x4e')][_0xa39a('0x48')]({'name':_0xd77c77['name'],'resourceId':_0xd77c77['id'],'type':_0x1b5c0b[_0xa39a('0x28')],'sectionId':_0x1b5c0b['id']},{})[_0xa39a('0x21')](function(){return _0x50fe66;});}else{return _0x50fe66;}})['catch'](function(_0x1a8a78){logger[_0xa39a('0x26')](_0xa39a('0x4f'),_0x1a8a78);throw _0x1a8a78;});}return _0x50fe66;})[_0xa39a('0x21')](respondWithResult(_0x40172d,0xc9))[_0xa39a('0x47')](handleError(_0x40172d,null));};exports[_0xa39a('0x20')]=function(_0x3b7960,_0x243c7c){if(_0x3b7960[_0xa39a('0x49')]['id']){delete _0x3b7960['body']['id'];}return db[_0xa39a('0x2b')][_0xa39a('0x46')]({'where':{'id':_0x3b7960['params']['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x243c7c,null))[_0xa39a('0x21')](saveUpdates(_0x3b7960[_0xa39a('0x49')],null))[_0xa39a('0x21')](respondWithResult(_0x243c7c,null))[_0xa39a('0x47')](handleError(_0x243c7c,null));};exports[_0xa39a('0x24')]=function(_0x3ed777,_0x2afbd0){return db[_0xa39a('0x2b')][_0xa39a('0x46')]({'where':{'id':_0x3ed777[_0xa39a('0x50')]['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x2afbd0,null))[_0xa39a('0x21')](removeEntity(_0x2afbd0,null))[_0xa39a('0x47')](handleError(_0x2afbd0,null));};exports['addAllCondition']=function(_0x482b6a,_0x54a827,_0x1b3f56){if(_0x482b6a[_0xa39a('0x49')]['id']){delete _0x482b6a[_0xa39a('0x49')]['id'];}return db[_0xa39a('0x2b')]['find']({'where':{'id':_0x482b6a[_0xa39a('0x50')]['id']}})['then'](handleEntityNotFound(_0x54a827,null))[_0xa39a('0x21')](function(_0xb58911){if(_0xb58911){_0x482b6a[_0xa39a('0x49')][_0xa39a('0x51')]=_0xb58911['id'];return db[_0xa39a('0x52')][_0xa39a('0x48')](_0x482b6a[_0xa39a('0x49')]);}})[_0xa39a('0x21')](respondWithResult(_0x54a827,null))[_0xa39a('0x47')](handleError(_0x54a827,null));};exports[_0xa39a('0x53')]=function(_0x31dcb4,_0x5d99de,_0x43cced){if(_0x31dcb4[_0xa39a('0x49')]['id']){delete _0x31dcb4[_0xa39a('0x49')]['id'];}return db[_0xa39a('0x2b')]['find']({'where':{'id':_0x31dcb4[_0xa39a('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d99de,null))[_0xa39a('0x21')](function(_0x16f952){if(_0x16f952){_0x31dcb4[_0xa39a('0x49')][_0xa39a('0x54')]=_0x16f952['id'];return db['Condition'][_0xa39a('0x48')](_0x31dcb4[_0xa39a('0x49')]);}})[_0xa39a('0x21')](respondWithResult(_0x5d99de,null))[_0xa39a('0x47')](handleError(_0x5d99de,null));};exports[_0xa39a('0x55')]=function(_0x2a207d,_0x3ad002,_0xeaaebb){var _0x1340f1={};var _0x140cd1={};var _0x3f2a06;var _0x3af15f;return db[_0xa39a('0x2b')][_0xa39a('0x56')]({'where':{'id':_0x2a207d[_0xa39a('0x50')]['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x3ad002,null))[_0xa39a('0x21')](function(_0x46ec7b){if(_0x46ec7b){_0x3f2a06=_0x46ec7b;_0x140cd1[_0xa39a('0x2c')]=_[_0xa39a('0x2d')](db[_0xa39a('0x52')][_0xa39a('0x45')]);_0x140cd1[_0xa39a('0x2e')]=_[_0xa39a('0x2d')](_0x2a207d[_0xa39a('0x2e')]);_0x140cd1[_0xa39a('0x2f')]=_[_0xa39a('0x30')](_0x140cd1[_0xa39a('0x2c')],_0x140cd1[_0xa39a('0x2e')]);_0x1340f1[_0xa39a('0x31')]=_[_0xa39a('0x30')](_0x140cd1['model'],qs[_0xa39a('0x32')](_0x2a207d[_0xa39a('0x2e')][_0xa39a('0x32')]));_0x1340f1[_0xa39a('0x31')]=_0x1340f1[_0xa39a('0x31')]['length']?_0x1340f1['attributes']:_0x140cd1['model'];_0x1340f1[_0xa39a('0x37')]=qs[_0xa39a('0x38')](_0x2a207d[_0xa39a('0x2e')][_0xa39a('0x38')]);_0x1340f1['where']=qs['filters'](_[_0xa39a('0x39')](_0x2a207d[_0xa39a('0x2e')],_0x140cd1[_0xa39a('0x2f')]));if(_0x2a207d['query'][_0xa39a('0x40')]){_0x1340f1[_0xa39a('0x3a')]=_['merge'](_0x1340f1['where'],{'$or':_[_0xa39a('0x3c')](_0x1340f1[_0xa39a('0x31')],function(_0x4ef0ef){var _0x383cde={};_0x383cde[_0x4ef0ef]={'$like':'%'+_0x2a207d[_0xa39a('0x2e')][_0xa39a('0x40')]+'%'};return _0x383cde;})});}_0x1340f1=_[_0xa39a('0x3b')]({},_0x1340f1,_0x2a207d[_0xa39a('0x41')]);return _0x3f2a06[_0xa39a('0x55')](_0x1340f1);}})[_0xa39a('0x21')](function(_0x3e468f){if(_0x3e468f){_0x3af15f=_0x3e468f[_0xa39a('0x33')];if(!_0x2a207d[_0xa39a('0x2e')]['hasOwnProperty'](_0xa39a('0x35'))){_0x1340f1[_0xa39a('0x36')]=qs[_0xa39a('0x36')](_0x2a207d[_0xa39a('0x2e')][_0xa39a('0x36')]);_0x1340f1['offset']=qs[_0xa39a('0x19')](_0x2a207d[_0xa39a('0x2e')]['offset']);}return _0x3f2a06[_0xa39a('0x55')](_0x1340f1);}})[_0xa39a('0x21')](function(_0x1798cb){if(_0x1798cb){return _0x1798cb?{'count':_0x3af15f,'rows':_0x1798cb}:null;}})['then'](respondWithResult(_0x3ad002,null))[_0xa39a('0x47')](handleError(_0x3ad002,null));};exports[_0xa39a('0x57')]=function(_0x1640c1,_0x1701dd,_0x29b464){var _0x262206={};var _0x49a366={};var _0x516a44;var _0x44e6f5;return db[_0xa39a('0x2b')]['findOne']({'where':{'id':_0x1640c1[_0xa39a('0x50')]['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x1701dd,null))[_0xa39a('0x21')](function(_0x4a2858){if(_0x4a2858){_0x516a44=_0x4a2858;_0x49a366['model']=_[_0xa39a('0x2d')](db[_0xa39a('0x52')][_0xa39a('0x45')]);_0x49a366[_0xa39a('0x2e')]=_[_0xa39a('0x2d')](_0x1640c1[_0xa39a('0x2e')]);_0x49a366[_0xa39a('0x2f')]=_[_0xa39a('0x30')](_0x49a366[_0xa39a('0x2c')],_0x49a366[_0xa39a('0x2e')]);_0x262206[_0xa39a('0x31')]=_[_0xa39a('0x30')](_0x49a366[_0xa39a('0x2c')],qs[_0xa39a('0x32')](_0x1640c1['query'][_0xa39a('0x32')]));_0x262206[_0xa39a('0x31')]=_0x262206['attributes'][_0xa39a('0x33')]?_0x262206[_0xa39a('0x31')]:_0x49a366[_0xa39a('0x2c')];_0x262206[_0xa39a('0x37')]=qs[_0xa39a('0x38')](_0x1640c1[_0xa39a('0x2e')][_0xa39a('0x38')]);_0x262206[_0xa39a('0x3a')]=qs[_0xa39a('0x2f')](_[_0xa39a('0x39')](_0x1640c1[_0xa39a('0x2e')],_0x49a366[_0xa39a('0x2f')]));if(_0x1640c1[_0xa39a('0x2e')][_0xa39a('0x40')]){_0x262206[_0xa39a('0x3a')]=_[_0xa39a('0x3b')](_0x262206[_0xa39a('0x3a')],{'$or':_['map'](_0x262206[_0xa39a('0x31')],function(_0x2b5ef1){var _0x3c6aad={};_0x3c6aad[_0x2b5ef1]={'$like':'%'+_0x1640c1['query'][_0xa39a('0x40')]+'%'};return _0x3c6aad;})});}_0x262206=_['merge']({},_0x262206,_0x1640c1[_0xa39a('0x41')]);return _0x516a44['getAnyConditions'](_0x262206);}})[_0xa39a('0x21')](function(_0x5626ea){if(_0x5626ea){_0x44e6f5=_0x5626ea['length'];if(!_0x1640c1[_0xa39a('0x2e')]['hasOwnProperty'](_0xa39a('0x35'))){_0x262206[_0xa39a('0x36')]=qs[_0xa39a('0x36')](_0x1640c1['query'][_0xa39a('0x36')]);_0x262206[_0xa39a('0x19')]=qs[_0xa39a('0x19')](_0x1640c1['query'][_0xa39a('0x19')]);}return _0x516a44[_0xa39a('0x57')](_0x262206);}})[_0xa39a('0x21')](function(_0x265f70){if(_0x265f70){return _0x265f70?{'count':_0x44e6f5,'rows':_0x265f70}:null;}})[_0xa39a('0x21')](respondWithResult(_0x1701dd,null))[_0xa39a('0x47')](handleError(_0x1701dd,null));};exports[_0xa39a('0x58')]=function(_0x19afb2,_0x2b40b6,_0x160c8f){if(_0x19afb2[_0xa39a('0x49')]['id']){delete _0x19afb2[_0xa39a('0x49')]['id'];}return db['Trigger'][_0xa39a('0x46')]({'where':{'id':_0x19afb2[_0xa39a('0x50')]['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x2b40b6,null))['then'](function(_0x398564){if(_0x398564){_0x19afb2[_0xa39a('0x49')]['TriggerId']=_0x398564['id'];return db[_0xa39a('0x59')]['create'](_0x19afb2[_0xa39a('0x49')]);}})['then'](respondWithResult(_0x2b40b6,null))[_0xa39a('0x47')](handleError(_0x2b40b6,null));};exports['getActions']=function(_0x1fbb84,_0x3f0b08,_0x314dc1){var _0x138d82={};var _0x3f4fcf={};var _0xd682b4;var _0x109242;return db['Trigger'][_0xa39a('0x56')]({'where':{'id':_0x1fbb84[_0xa39a('0x50')]['id']}})[_0xa39a('0x21')](handleEntityNotFound(_0x3f0b08,null))[_0xa39a('0x21')](function(_0x10fa4e){if(_0x10fa4e){_0xd682b4=_0x10fa4e;_0x3f4fcf[_0xa39a('0x2c')]=_[_0xa39a('0x2d')](db[_0xa39a('0x59')][_0xa39a('0x45')]);_0x3f4fcf['query']=_[_0xa39a('0x2d')](_0x1fbb84['query']);_0x3f4fcf[_0xa39a('0x2f')]=_['intersection'](_0x3f4fcf[_0xa39a('0x2c')],_0x3f4fcf[_0xa39a('0x2e')]);_0x138d82[_0xa39a('0x31')]=_['intersection'](_0x3f4fcf[_0xa39a('0x2c')],qs[_0xa39a('0x32')](_0x1fbb84[_0xa39a('0x2e')]['fields']));_0x138d82[_0xa39a('0x31')]=_0x138d82[_0xa39a('0x31')]['length']?_0x138d82[_0xa39a('0x31')]:_0x3f4fcf[_0xa39a('0x2c')];_0x138d82['order']=qs[_0xa39a('0x38')](_0x1fbb84['query'][_0xa39a('0x38')]);_0x138d82[_0xa39a('0x3a')]=qs['filters'](_['pick'](_0x1fbb84[_0xa39a('0x2e')],_0x3f4fcf[_0xa39a('0x2f')]));if(_0x1fbb84[_0xa39a('0x2e')]['filter']){_0x138d82['where']=_[_0xa39a('0x3b')](_0x138d82[_0xa39a('0x3a')],{'$or':_[_0xa39a('0x3c')](_0x138d82[_0xa39a('0x31')],function(_0x284fc7){var _0x2b21e1={};_0x2b21e1[_0x284fc7]={'$like':'%'+_0x1fbb84[_0xa39a('0x2e')][_0xa39a('0x40')]+'%'};return _0x2b21e1;})});}_0x138d82=_[_0xa39a('0x3b')]({},_0x138d82,_0x1fbb84['options']);return _0xd682b4[_0xa39a('0x5a')](_0x138d82);}})[_0xa39a('0x21')](function(_0x22d2cb){if(_0x22d2cb){_0x109242=_0x22d2cb[_0xa39a('0x33')];if(!_0x1fbb84[_0xa39a('0x2e')][_0xa39a('0x34')](_0xa39a('0x35'))){_0x138d82[_0xa39a('0x36')]=qs['limit'](_0x1fbb84[_0xa39a('0x2e')][_0xa39a('0x36')]);_0x138d82[_0xa39a('0x19')]=qs[_0xa39a('0x19')](_0x1fbb84[_0xa39a('0x2e')][_0xa39a('0x19')]);}return _0xd682b4[_0xa39a('0x5a')](_0x138d82);}})[_0xa39a('0x21')](function(_0x4221a9){if(_0x4221a9){return _0x4221a9?{'count':_0x109242,'rows':_0x4221a9}:null;}})['then'](respondWithResult(_0x3f0b08,null))[_0xa39a('0x47')](handleError(_0x3f0b08,null));}; \ No newline at end of file +var _0x280f=['pick','filter','merge','map','key','VIRTUAL','field','options','Trigger','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','name','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','order','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','limit','set','json','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','sendStatus','error','stack','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','sort','where'];(function(_0x2cb495,_0x3b5cdd){var _0x5ed37a=function(_0x4072c4){while(--_0x4072c4){_0x2cb495['push'](_0x2cb495['shift']());}};_0x5ed37a(++_0x3b5cdd);}(_0x280f,0xe2));var _0xf280=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x280f[_0x3a8dc1];return _0x4b3595;};'use strict';var pdf=require(_0xf280('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf280('0x1'));var zipdir=require(_0xf280('0x2'));var jsonpatch=require(_0xf280('0x3'));var rp=require(_0xf280('0x4'));var moment=require(_0xf280('0x5'));var BPromise=require(_0xf280('0x6'));var Mustache=require(_0xf280('0x7'));var util=require('util');var path=require(_0xf280('0x8'));var sox=require(_0xf280('0x9'));var csv=require(_0xf280('0xa'));var ejs=require(_0xf280('0xb'));var fs=require('fs');var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0xa'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var hardwareService=require(_0xf280('0x14'));var logger=require(_0xf280('0x15'))(_0xf280('0x16'));var utils=require(_0xf280('0x17'));var config=require(_0xf280('0x18'));var db=require(_0xf280('0x19'))['db'];function respondWithStatusCode(_0x230977,_0x22a384){_0x22a384=_0x22a384||0xcc;return function(_0x148d24){if(_0x148d24){return _0x230977['sendStatus'](_0x22a384);}return _0x230977[_0xf280('0x1a')](_0x22a384)[_0xf280('0x1b')]();};}function respondWithResult(_0x261ccb,_0x41a62b){_0x41a62b=_0x41a62b||0xc8;return function(_0x1d7175){if(_0x1d7175){return _0x261ccb[_0xf280('0x1a')](_0x41a62b)['json'](_0x1d7175);}};}function respondWithFilteredResult(_0xb49bec,_0x2c8c45){return function(_0x34cadb){if(_0x34cadb){var _0x224162=_0x34cadb['count'],_0x1e8f4d=_0x2c8c45['offset'],_0x462177=_0x2c8c45['offset']+_0x2c8c45[_0xf280('0x1c')],_0x1d8dbd;if(_0x462177>=_0x224162){_0x462177=_0x224162;_0x1d8dbd=0xc8;}else{_0x1d8dbd=0xce;}_0xb49bec['status'](_0x1d8dbd);return _0xb49bec[_0xf280('0x1d')]('Content-Range',_0x1e8f4d+'-'+_0x462177+'/'+_0x224162)[_0xf280('0x1e')](_0x34cadb);}return null;};}function patchUpdates(_0x464a5f){return function(_0x5328ae){try{jsonpatch[_0xf280('0x1f')](_0x5328ae,_0x464a5f,!![]);}catch(_0x59b8af){return BPromise[_0xf280('0x20')](_0x59b8af);}return _0x5328ae[_0xf280('0x21')]();};}function saveUpdates(_0x114364,_0x21e99b){return function(_0x11db7d){if(_0x11db7d){return _0x11db7d[_0xf280('0x22')](_0x114364)[_0xf280('0x23')](function(_0x469bdf){return _0x469bdf;});}return null;};}function removeEntity(_0xd90a7b,_0x5d807a){return function(_0x1ad62a){if(_0x1ad62a){return _0x1ad62a[_0xf280('0x24')]()[_0xf280('0x23')](function(){var _0x4422a8=_0x1ad62a[_0xf280('0x25')]({'plain':!![]});var _0x32039f=_0xf280('0x26');return db[_0xf280('0x27')]['destroy']({'where':{'type':_0x32039f,'resourceId':_0x4422a8['id']}})[_0xf280('0x23')](function(){return _0x1ad62a;});})[_0xf280('0x23')](function(){_0xd90a7b[_0xf280('0x1a')](0xcc)[_0xf280('0x1b')]();});}};}function handleEntityNotFound(_0x35cd2d,_0x302132){return function(_0x4509c1){if(!_0x4509c1){_0x35cd2d[_0xf280('0x28')](0x194);}return _0x4509c1;};}function handleError(_0x485788,_0x368b24){_0x368b24=_0x368b24||0x1f4;return function(_0x1b21fb){logger[_0xf280('0x29')](_0x1b21fb[_0xf280('0x2a')]);if(_0x1b21fb['name']){delete _0x1b21fb['name'];}_0x485788['status'](_0x368b24)['send'](_0x1b21fb);};}exports['index']=function(_0x3da40e,_0x2409f4){var _0xa1fbb7={},_0x34edaf={},_0x545ccf={'count':0x0,'rows':[]};var _0x1cdf05=db['Trigger'][_0xf280('0x2b')];_0x34edaf[_0xf280('0x2c')]=_['keys'](_0x1cdf05);_0x34edaf[_0xf280('0x2d')]=_[_0xf280('0x2e')](_0x3da40e[_0xf280('0x2d')]);_0x34edaf[_0xf280('0x2f')]=_['intersection'](_0x34edaf[_0xf280('0x2c')],_0x34edaf[_0xf280('0x2d')]);_0xa1fbb7[_0xf280('0x30')]=_[_0xf280('0x31')](_0x34edaf[_0xf280('0x2c')],qs[_0xf280('0x32')](_0x3da40e[_0xf280('0x2d')][_0xf280('0x32')]));_0xa1fbb7['attributes']=_0xa1fbb7[_0xf280('0x30')][_0xf280('0x33')]?_0xa1fbb7[_0xf280('0x30')]:_0x34edaf[_0xf280('0x2c')];if(!_0x3da40e['query']['hasOwnProperty'](_0xf280('0x34'))){_0xa1fbb7['limit']=qs[_0xf280('0x1c')](_0x3da40e[_0xf280('0x2d')][_0xf280('0x1c')]);_0xa1fbb7[_0xf280('0x35')]=qs[_0xf280('0x35')](_0x3da40e['query']['offset']);}_0xa1fbb7['order']=qs[_0xf280('0x36')](_0x3da40e['query'][_0xf280('0x36')]);_0xa1fbb7[_0xf280('0x37')]=qs['filters'](_[_0xf280('0x38')](_0x3da40e[_0xf280('0x2d')],_0x34edaf[_0xf280('0x2f')]));if(_0x3da40e[_0xf280('0x2d')][_0xf280('0x39')]){_0xa1fbb7[_0xf280('0x37')]=_[_0xf280('0x3a')](_0xa1fbb7[_0xf280('0x37')],{'$or':_[_0xf280('0x3b')](_0x1cdf05,function(_0x1a0e55){if(_0x1a0e55['type'][_0xf280('0x3c')]!==_0xf280('0x3d')){var _0x3146b2={};_0x3146b2[_0x1a0e55[_0xf280('0x3e')]]={'$like':'%'+_0x3da40e[_0xf280('0x2d')]['filter']+'%'};return _0x3146b2;}})});}_0xa1fbb7=_[_0xf280('0x3a')]({},_0xa1fbb7,_0x3da40e[_0xf280('0x3f')]);var _0x4f8929={'where':_0xa1fbb7[_0xf280('0x37')]};return db[_0xf280('0x40')][_0xf280('0x41')](_0x4f8929)['then'](function(_0x1ff055){_0x545ccf[_0xf280('0x41')]=_0x1ff055;if(_0x3da40e['query'][_0xf280('0x42')]){_0xa1fbb7[_0xf280('0x43')]=[{'all':!![]}];}return db[_0xf280('0x40')][_0xf280('0x44')](_0xa1fbb7);})[_0xf280('0x23')](function(_0xddbcf1){_0x545ccf[_0xf280('0x45')]=_0xddbcf1;return _0x545ccf;})[_0xf280('0x23')](respondWithFilteredResult(_0x2409f4,_0xa1fbb7))[_0xf280('0x46')](handleError(_0x2409f4,null));};exports[_0xf280('0x47')]=function(_0x22822e,_0x55f575){var _0x21bf42={'raw':![],'where':{'id':_0x22822e[_0xf280('0x48')]['id']}},_0x3a4118={};_0x3a4118[_0xf280('0x2c')]=_['keys'](db[_0xf280('0x40')][_0xf280('0x2b')]);_0x3a4118[_0xf280('0x2d')]=_[_0xf280('0x2e')](_0x22822e[_0xf280('0x2d')]);_0x3a4118['filters']=_[_0xf280('0x31')](_0x3a4118['model'],_0x3a4118[_0xf280('0x2d')]);_0x21bf42['attributes']=_[_0xf280('0x31')](_0x3a4118[_0xf280('0x2c')],qs[_0xf280('0x32')](_0x22822e['query']['fields']));_0x21bf42[_0xf280('0x30')]=_0x21bf42[_0xf280('0x30')]['length']?_0x21bf42[_0xf280('0x30')]:_0x3a4118[_0xf280('0x2c')];if(_0x22822e[_0xf280('0x2d')][_0xf280('0x42')]){_0x21bf42[_0xf280('0x43')]=[{'all':!![]}];}_0x21bf42=_['merge']({},_0x21bf42,_0x22822e[_0xf280('0x3f')]);return db[_0xf280('0x40')][_0xf280('0x49')](_0x21bf42)[_0xf280('0x23')](handleEntityNotFound(_0x55f575,null))[_0xf280('0x23')](respondWithResult(_0x55f575,null))[_0xf280('0x46')](handleError(_0x55f575,null));};exports[_0xf280('0x4a')]=function(_0x4c3e00,_0x46ebad){return db[_0xf280('0x40')][_0xf280('0x4a')](_0x4c3e00[_0xf280('0x4b')],{})['then'](function(_0x29c7f0){var _0x14f4a6=_0x4c3e00['user'][_0xf280('0x25')]({'plain':!![]});if(!_0x14f4a6)throw new Error(_0xf280('0x4c'));if(_0x14f4a6['role']===_0xf280('0x4d')){var _0x4991d9=_0x29c7f0['get']({'plain':!![]});var _0x51ad69=_0xf280('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x51ad69,'userProfileId':_0x14f4a6[_0xf280('0x4e')]},'raw':!![]})['then'](function(_0x346285){if(_0x346285&&_0x346285[_0xf280('0x4f')]===0x0){return db[_0xf280('0x27')][_0xf280('0x4a')]({'name':_0x4991d9[_0xf280('0x50')],'resourceId':_0x4991d9['id'],'type':_0x346285[_0xf280('0x50')],'sectionId':_0x346285['id']},{})[_0xf280('0x23')](function(){return _0x29c7f0;});}else{return _0x29c7f0;}})['catch'](function(_0xb2860d){logger[_0xf280('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb2860d);throw _0xb2860d;});}return _0x29c7f0;})['then'](respondWithResult(_0x46ebad,0xc9))['catch'](handleError(_0x46ebad,null));};exports['update']=function(_0x5a8325,_0x1ed725){if(_0x5a8325[_0xf280('0x4b')]['id']){delete _0x5a8325['body']['id'];}return db[_0xf280('0x40')][_0xf280('0x49')]({'where':{'id':_0x5a8325['params']['id']}})[_0xf280('0x23')](handleEntityNotFound(_0x1ed725,null))['then'](saveUpdates(_0x5a8325[_0xf280('0x4b')],null))['then'](respondWithResult(_0x1ed725,null))[_0xf280('0x46')](handleError(_0x1ed725,null));};exports[_0xf280('0x24')]=function(_0x85ec5a,_0x33ee4f){return db[_0xf280('0x40')]['find']({'where':{'id':_0x85ec5a[_0xf280('0x48')]['id']}})[_0xf280('0x23')](handleEntityNotFound(_0x33ee4f,null))[_0xf280('0x23')](removeEntity(_0x33ee4f,null))[_0xf280('0x46')](handleError(_0x33ee4f,null));};exports[_0xf280('0x51')]=function(_0xa393c6,_0x2de275,_0x382541){if(_0xa393c6[_0xf280('0x4b')]['id']){delete _0xa393c6[_0xf280('0x4b')]['id'];}return db[_0xf280('0x40')][_0xf280('0x49')]({'where':{'id':_0xa393c6['params']['id']}})['then'](handleEntityNotFound(_0x2de275,null))['then'](function(_0x4abea4){if(_0x4abea4){_0xa393c6[_0xf280('0x4b')][_0xf280('0x52')]=_0x4abea4['id'];return db[_0xf280('0x53')]['create'](_0xa393c6[_0xf280('0x4b')]);}})[_0xf280('0x23')](respondWithResult(_0x2de275,null))[_0xf280('0x46')](handleError(_0x2de275,null));};exports[_0xf280('0x54')]=function(_0x176324,_0x38d6f9,_0x34130f){if(_0x176324[_0xf280('0x4b')]['id']){delete _0x176324[_0xf280('0x4b')]['id'];}return db[_0xf280('0x40')][_0xf280('0x49')]({'where':{'id':_0x176324['params']['id']}})['then'](handleEntityNotFound(_0x38d6f9,null))[_0xf280('0x23')](function(_0x30a2ed){if(_0x30a2ed){_0x176324[_0xf280('0x4b')]['TriggerAnyId']=_0x30a2ed['id'];return db[_0xf280('0x53')][_0xf280('0x4a')](_0x176324[_0xf280('0x4b')]);}})[_0xf280('0x23')](respondWithResult(_0x38d6f9,null))[_0xf280('0x46')](handleError(_0x38d6f9,null));};exports[_0xf280('0x55')]=function(_0x5110fe,_0x4ec8c6,_0x47adef){var _0x22666c={};var _0x431362={};var _0x197506;var _0x36daf8;return db['Trigger'][_0xf280('0x56')]({'where':{'id':_0x5110fe[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ec8c6,null))[_0xf280('0x23')](function(_0x4ec498){if(_0x4ec498){_0x197506=_0x4ec498;_0x431362[_0xf280('0x2c')]=_[_0xf280('0x2e')](db[_0xf280('0x53')][_0xf280('0x2b')]);_0x431362[_0xf280('0x2d')]=_[_0xf280('0x2e')](_0x5110fe[_0xf280('0x2d')]);_0x431362['filters']=_['intersection'](_0x431362[_0xf280('0x2c')],_0x431362[_0xf280('0x2d')]);_0x22666c[_0xf280('0x30')]=_[_0xf280('0x31')](_0x431362[_0xf280('0x2c')],qs[_0xf280('0x32')](_0x5110fe[_0xf280('0x2d')]['fields']));_0x22666c[_0xf280('0x30')]=_0x22666c[_0xf280('0x30')][_0xf280('0x33')]?_0x22666c[_0xf280('0x30')]:_0x431362[_0xf280('0x2c')];_0x22666c[_0xf280('0x57')]=qs[_0xf280('0x36')](_0x5110fe[_0xf280('0x2d')][_0xf280('0x36')]);_0x22666c[_0xf280('0x37')]=qs[_0xf280('0x2f')](_[_0xf280('0x38')](_0x5110fe['query'],_0x431362[_0xf280('0x2f')]));if(_0x5110fe['query'][_0xf280('0x39')]){_0x22666c['where']=_[_0xf280('0x3a')](_0x22666c[_0xf280('0x37')],{'$or':_[_0xf280('0x3b')](_0x22666c[_0xf280('0x30')],function(_0x1e0b4a){var _0x3a7cc2={};_0x3a7cc2[_0x1e0b4a]={'$like':'%'+_0x5110fe['query'][_0xf280('0x39')]+'%'};return _0x3a7cc2;})});}_0x22666c=_[_0xf280('0x3a')]({},_0x22666c,_0x5110fe[_0xf280('0x3f')]);return _0x197506[_0xf280('0x55')](_0x22666c);}})['then'](function(_0x3acddf){if(_0x3acddf){_0x36daf8=_0x3acddf[_0xf280('0x33')];if(!_0x5110fe[_0xf280('0x2d')][_0xf280('0x58')](_0xf280('0x34'))){_0x22666c[_0xf280('0x1c')]=qs['limit'](_0x5110fe[_0xf280('0x2d')][_0xf280('0x1c')]);_0x22666c['offset']=qs[_0xf280('0x35')](_0x5110fe[_0xf280('0x2d')][_0xf280('0x35')]);}return _0x197506['getAllConditions'](_0x22666c);}})['then'](function(_0x3ef059){if(_0x3ef059){return _0x3ef059?{'count':_0x36daf8,'rows':_0x3ef059}:null;}})[_0xf280('0x23')](respondWithResult(_0x4ec8c6,null))[_0xf280('0x46')](handleError(_0x4ec8c6,null));};exports['getAnyConditions']=function(_0x1454ab,_0x8d8ab,_0x38af45){var _0x23296d={};var _0x343166={};var _0x40cba8;var _0xadd906;return db[_0xf280('0x40')][_0xf280('0x56')]({'where':{'id':_0x1454ab[_0xf280('0x48')]['id']}})['then'](handleEntityNotFound(_0x8d8ab,null))[_0xf280('0x23')](function(_0x272d80){if(_0x272d80){_0x40cba8=_0x272d80;_0x343166[_0xf280('0x2c')]=_[_0xf280('0x2e')](db['Condition']['rawAttributes']);_0x343166[_0xf280('0x2d')]=_[_0xf280('0x2e')](_0x1454ab[_0xf280('0x2d')]);_0x343166[_0xf280('0x2f')]=_[_0xf280('0x31')](_0x343166['model'],_0x343166[_0xf280('0x2d')]);_0x23296d[_0xf280('0x30')]=_[_0xf280('0x31')](_0x343166[_0xf280('0x2c')],qs[_0xf280('0x32')](_0x1454ab['query'][_0xf280('0x32')]));_0x23296d[_0xf280('0x30')]=_0x23296d[_0xf280('0x30')][_0xf280('0x33')]?_0x23296d['attributes']:_0x343166['model'];_0x23296d[_0xf280('0x57')]=qs['sort'](_0x1454ab[_0xf280('0x2d')][_0xf280('0x36')]);_0x23296d[_0xf280('0x37')]=qs['filters'](_[_0xf280('0x38')](_0x1454ab[_0xf280('0x2d')],_0x343166[_0xf280('0x2f')]));if(_0x1454ab[_0xf280('0x2d')][_0xf280('0x39')]){_0x23296d[_0xf280('0x37')]=_['merge'](_0x23296d[_0xf280('0x37')],{'$or':_[_0xf280('0x3b')](_0x23296d[_0xf280('0x30')],function(_0x128692){var _0xa307e1={};_0xa307e1[_0x128692]={'$like':'%'+_0x1454ab[_0xf280('0x2d')][_0xf280('0x39')]+'%'};return _0xa307e1;})});}_0x23296d=_[_0xf280('0x3a')]({},_0x23296d,_0x1454ab[_0xf280('0x3f')]);return _0x40cba8[_0xf280('0x59')](_0x23296d);}})[_0xf280('0x23')](function(_0x2ccbe2){if(_0x2ccbe2){_0xadd906=_0x2ccbe2[_0xf280('0x33')];if(!_0x1454ab[_0xf280('0x2d')][_0xf280('0x58')]('nolimit')){_0x23296d[_0xf280('0x1c')]=qs[_0xf280('0x1c')](_0x1454ab[_0xf280('0x2d')][_0xf280('0x1c')]);_0x23296d[_0xf280('0x35')]=qs[_0xf280('0x35')](_0x1454ab[_0xf280('0x2d')][_0xf280('0x35')]);}return _0x40cba8[_0xf280('0x59')](_0x23296d);}})[_0xf280('0x23')](function(_0xc6803a){if(_0xc6803a){return _0xc6803a?{'count':_0xadd906,'rows':_0xc6803a}:null;}})[_0xf280('0x23')](respondWithResult(_0x8d8ab,null))[_0xf280('0x46')](handleError(_0x8d8ab,null));};exports[_0xf280('0x5a')]=function(_0xf4fa8e,_0x3f5c70,_0x2fb0fe){if(_0xf4fa8e[_0xf280('0x4b')]['id']){delete _0xf4fa8e[_0xf280('0x4b')]['id'];}return db[_0xf280('0x40')][_0xf280('0x49')]({'where':{'id':_0xf4fa8e[_0xf280('0x48')]['id']}})[_0xf280('0x23')](handleEntityNotFound(_0x3f5c70,null))[_0xf280('0x23')](function(_0x3ecbdb){if(_0x3ecbdb){_0xf4fa8e['body'][_0xf280('0x5b')]=_0x3ecbdb['id'];return db[_0xf280('0x5c')]['create'](_0xf4fa8e[_0xf280('0x4b')]);}})[_0xf280('0x23')](respondWithResult(_0x3f5c70,null))['catch'](handleError(_0x3f5c70,null));};exports[_0xf280('0x5d')]=function(_0x26e7df,_0x284881,_0x35c4c6){var _0x346f16={};var _0x1b5ab2={};var _0x2eeb4b;var _0x49a2d3;return db['Trigger'][_0xf280('0x56')]({'where':{'id':_0x26e7df[_0xf280('0x48')]['id']}})[_0xf280('0x23')](handleEntityNotFound(_0x284881,null))[_0xf280('0x23')](function(_0x1fa448){if(_0x1fa448){_0x2eeb4b=_0x1fa448;_0x1b5ab2['model']=_['keys'](db[_0xf280('0x5c')]['rawAttributes']);_0x1b5ab2['query']=_['keys'](_0x26e7df[_0xf280('0x2d')]);_0x1b5ab2[_0xf280('0x2f')]=_['intersection'](_0x1b5ab2[_0xf280('0x2c')],_0x1b5ab2[_0xf280('0x2d')]);_0x346f16[_0xf280('0x30')]=_['intersection'](_0x1b5ab2[_0xf280('0x2c')],qs['fields'](_0x26e7df[_0xf280('0x2d')]['fields']));_0x346f16[_0xf280('0x30')]=_0x346f16[_0xf280('0x30')][_0xf280('0x33')]?_0x346f16['attributes']:_0x1b5ab2[_0xf280('0x2c')];_0x346f16[_0xf280('0x57')]=qs[_0xf280('0x36')](_0x26e7df[_0xf280('0x2d')][_0xf280('0x36')]);_0x346f16[_0xf280('0x37')]=qs[_0xf280('0x2f')](_['pick'](_0x26e7df[_0xf280('0x2d')],_0x1b5ab2[_0xf280('0x2f')]));if(_0x26e7df['query'][_0xf280('0x39')]){_0x346f16[_0xf280('0x37')]=_[_0xf280('0x3a')](_0x346f16['where'],{'$or':_[_0xf280('0x3b')](_0x346f16['attributes'],function(_0x5d1b9b){var _0x3441ef={};_0x3441ef[_0x5d1b9b]={'$like':'%'+_0x26e7df[_0xf280('0x2d')][_0xf280('0x39')]+'%'};return _0x3441ef;})});}_0x346f16=_[_0xf280('0x3a')]({},_0x346f16,_0x26e7df[_0xf280('0x3f')]);return _0x2eeb4b[_0xf280('0x5d')](_0x346f16);}})[_0xf280('0x23')](function(_0x381a31){if(_0x381a31){_0x49a2d3=_0x381a31[_0xf280('0x33')];if(!_0x26e7df[_0xf280('0x2d')][_0xf280('0x58')](_0xf280('0x34'))){_0x346f16['limit']=qs[_0xf280('0x1c')](_0x26e7df[_0xf280('0x2d')]['limit']);_0x346f16[_0xf280('0x35')]=qs[_0xf280('0x35')](_0x26e7df[_0xf280('0x2d')][_0xf280('0x35')]);}return _0x2eeb4b[_0xf280('0x5d')](_0x346f16);}})[_0xf280('0x23')](function(_0x3791a9){if(_0x3791a9){return _0x3791a9?{'count':_0x49a2d3,'rows':_0x3791a9}:null;}})['then'](respondWithResult(_0x284881,null))[_0xf280('0x46')](handleError(_0x284881,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 572bd19..1ec257e 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 _0xb7e7=['Trigger','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./trigger.attributes','define'];(function(_0x21c001,_0xb01b9c){var _0x2ee97b=function(_0xb26016){while(--_0xb26016){_0x21c001['push'](_0x21c001['shift']());}};_0x2ee97b(++_0xb01b9c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb7e7[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['request-promise','path','rimraf','./trigger.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x353313,_0x5c3686){_0x353313=_0x353313-0x0;var _0x4cb750=_0xbdb7[_0x353313];return _0x4cb750;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('Trigger',attributes,{'tableName':'tools_triggers','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 3e5b636..57c9479 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 _0xc3fb=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','result','message','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','Trigger','find','ShowTrigger','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2ffc7d,_0x36d425){var _0x456b3f=function(_0x26e237){while(--_0x26e237){_0x2ffc7d['push'](_0x2ffc7d['shift']());}};_0x456b3f(++_0x36d425);}(_0xc3fb,0x1d3));var _0xbc3f=function(_0x1481a0,_0x56fda4){_0x1481a0=_0x1481a0-0x0;var _0x1f9e39=_0xc3fb[_0x1481a0];return _0x1f9e39;};'use strict';var _=require(_0xbc3f('0x0'));var util=require(_0xbc3f('0x1'));var moment=require(_0xbc3f('0x2'));var BPromise=require(_0xbc3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc3f('0x4'));var db=require(_0xbc3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc3f('0x6'))('rpc');var config=require(_0xbc3f('0x7'));var jayson=require(_0xbc3f('0x8'));var client=jayson[_0xbc3f('0x9')][_0xbc3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52a09c,_0x5782a6,_0x2955c3){return new BPromise(function(_0x4fe98d,_0x57b223){return client[_0xbc3f('0xb')](_0x52a09c,_0x2955c3)[_0xbc3f('0xc')](function(_0x249fbe){logger[_0xbc3f('0xd')]('Trigger,\x20%s,\x20%s',_0x5782a6,_0xbc3f('0xe'));logger[_0xbc3f('0xf')](_0xbc3f('0x10'),_0x5782a6,_0xbc3f('0xe'),JSON[_0xbc3f('0x11')](_0x249fbe));if(_0x249fbe[_0xbc3f('0x12')]){if(_0x249fbe[_0xbc3f('0x12')][_0xbc3f('0x13')]===0x1f4){logger[_0xbc3f('0x12')]('Trigger,\x20%s,\x20%s',_0x5782a6,_0x249fbe[_0xbc3f('0x12')]['message']);return _0x57b223(_0x249fbe[_0xbc3f('0x12')]['message']);}logger[_0xbc3f('0x12')](_0xbc3f('0x14'),_0x5782a6,_0x249fbe[_0xbc3f('0x12')]['message']);return _0x4fe98d(_0x249fbe['error']['message']);}else{logger[_0xbc3f('0xd')](_0xbc3f('0x14'),_0x5782a6,'request\x20sent');_0x4fe98d(_0x249fbe[_0xbc3f('0x15')][_0xbc3f('0x16')]);}})[_0xbc3f('0x17')](function(_0x4b5368){logger[_0xbc3f('0x12')](_0xbc3f('0x14'),_0x5782a6,_0x4b5368);_0x57b223(_0x4b5368);});});}exports[_0xbc3f('0x18')]=function(_0x5b0594){var _0x5ee8e5=this;return new Promise(function(_0x3b24df,_0x5f2865){return db['Trigger'][_0xbc3f('0x19')]({'raw':_0x5b0594['options']?_0x5b0594[_0xbc3f('0x1a')][_0xbc3f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b0594[_0xbc3f('0x1a')]?_0x5b0594[_0xbc3f('0x1a')][_0xbc3f('0x1c')]||null:null,'attributes':_0x5b0594['options']?_0x5b0594[_0xbc3f('0x1a')][_0xbc3f('0x1d')]||null:null,'limit':_0x5b0594[_0xbc3f('0x1a')]?_0x5b0594[_0xbc3f('0x1a')][_0xbc3f('0x1e')]||null:null,'include':_0x5b0594[_0xbc3f('0x1a')]?_0x5b0594['options'][_0xbc3f('0x1f')]?_[_0xbc3f('0x20')](_0x5b0594[_0xbc3f('0x1a')]['include'],function(_0xaada57){return{'model':db[_0xaada57['model']],'as':_0xaada57['as'],'attributes':_0xaada57['attributes'],'include':_0xaada57['include']?_[_0xbc3f('0x20')](_0xaada57[_0xbc3f('0x1f')],function(_0x2f78b8){return{'model':db[_0x2f78b8[_0xbc3f('0x21')]],'as':_0x2f78b8['as'],'attributes':_0x2f78b8['attributes'],'include':_0x2f78b8[_0xbc3f('0x1f')]?_[_0xbc3f('0x20')](_0x2f78b8[_0xbc3f('0x1f')],function(_0x146907){return{'model':db[_0x146907['model']],'as':_0x146907['as'],'attributes':_0x146907[_0xbc3f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbc3f('0xc')](function(_0x3f992b){logger[_0xbc3f('0xd')](_0xbc3f('0x18'),_0x5b0594);logger[_0xbc3f('0xf')]('GetTrigger',_0x5b0594,JSON[_0xbc3f('0x11')](_0x3f992b));_0x3b24df(_0x3f992b);})[_0xbc3f('0x17')](function(_0x424480){logger[_0xbc3f('0x12')](_0xbc3f('0x18'),_0x424480[_0xbc3f('0x16')],_0x5b0594);_0x5f2865(_0x5ee8e5[_0xbc3f('0x12')](0x1f4,_0x424480[_0xbc3f('0x16')]));});});};exports['ShowTrigger']=function(_0x4f5ebd){var _0x31cb70=this;return new Promise(function(_0x525f21,_0x4f8b5b){return db[_0xbc3f('0x22')][_0xbc3f('0x23')]({'raw':_0x4f5ebd[_0xbc3f('0x1a')]?_0x4f5ebd['options'][_0xbc3f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f5ebd[_0xbc3f('0x1a')]?_0x4f5ebd['options']['where']||null:null,'attributes':_0x4f5ebd['options']?_0x4f5ebd[_0xbc3f('0x1a')]['attributes']||null:null,'include':_0x4f5ebd[_0xbc3f('0x1a')]?_0x4f5ebd[_0xbc3f('0x1a')][_0xbc3f('0x1f')]?_[_0xbc3f('0x20')](_0x4f5ebd[_0xbc3f('0x1a')][_0xbc3f('0x1f')],function(_0x1a306d){return{'model':db[_0x1a306d[_0xbc3f('0x21')]],'as':_0x1a306d['as'],'attributes':_0x1a306d[_0xbc3f('0x1d')],'include':_0x1a306d[_0xbc3f('0x1f')]?_[_0xbc3f('0x20')](_0x1a306d['include'],function(_0x2d3f6f){return{'model':db[_0x2d3f6f['model']],'as':_0x2d3f6f['as'],'attributes':_0x2d3f6f['attributes'],'include':_0x2d3f6f[_0xbc3f('0x1f')]?_[_0xbc3f('0x20')](_0x2d3f6f[_0xbc3f('0x1f')],function(_0x1142d2){return{'model':db[_0x1142d2[_0xbc3f('0x21')]],'as':_0x1142d2['as'],'attributes':_0x1142d2[_0xbc3f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbc3f('0xc')](function(_0x3d48bd){logger['info'](_0xbc3f('0x24'),_0x4f5ebd);logger[_0xbc3f('0xf')](_0xbc3f('0x24'),_0x4f5ebd,JSON[_0xbc3f('0x11')](_0x3d48bd));_0x525f21(_0x3d48bd);})['catch'](function(_0x45c573){logger[_0xbc3f('0x12')](_0xbc3f('0x24'),_0x45c573['message'],_0x4f5ebd);_0x4f8b5b(_0x31cb70[_0xbc3f('0x12')](0x1f4,_0x45c573[_0xbc3f('0x16')]));});});}; \ No newline at end of file +var _0xfa0b=['../../config/logger','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowTrigger','Trigger','lodash','util','moment','ioredis','../../config/utils'];(function(_0x36e5b6,_0x37dcd5){var _0x5a6399=function(_0x1b0ac2){while(--_0x1b0ac2){_0x36e5b6['push'](_0x36e5b6['shift']());}};_0x5a6399(++_0x37dcd5);}(_0xfa0b,0x187));var _0xbfa0=function(_0x36cb22,_0x340b23){_0x36cb22=_0x36cb22-0x0;var _0x5f8af7=_0xfa0b[_0x36cb22];return _0x5f8af7;};'use strict';var _=require(_0xbfa0('0x0'));var util=require(_0xbfa0('0x1'));var moment=require(_0xbfa0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfa0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfa0('0x4'));var logger=require(_0xbfa0('0x5'))('rpc');var config=require(_0xbfa0('0x6'));var jayson=require(_0xbfa0('0x7'));var client=jayson[_0xbfa0('0x8')][_0xbfa0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56903b,_0x2d8cd9,_0x3810bd){return new BPromise(function(_0x2bbf47,_0x2523d8){return client[_0xbfa0('0xa')](_0x56903b,_0x3810bd)['then'](function(_0x29e370){logger['info'](_0xbfa0('0xb'),_0x2d8cd9,_0xbfa0('0xc'));logger[_0xbfa0('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2d8cd9,'request\x20sent',JSON[_0xbfa0('0xe')](_0x29e370));if(_0x29e370[_0xbfa0('0xf')]){if(_0x29e370['error'][_0xbfa0('0x10')]===0x1f4){logger[_0xbfa0('0xf')](_0xbfa0('0xb'),_0x2d8cd9,_0x29e370[_0xbfa0('0xf')][_0xbfa0('0x11')]);return _0x2523d8(_0x29e370['error']['message']);}logger[_0xbfa0('0xf')](_0xbfa0('0xb'),_0x2d8cd9,_0x29e370[_0xbfa0('0xf')]['message']);return _0x2bbf47(_0x29e370[_0xbfa0('0xf')][_0xbfa0('0x11')]);}else{logger[_0xbfa0('0x12')](_0xbfa0('0xb'),_0x2d8cd9,_0xbfa0('0xc'));_0x2bbf47(_0x29e370['result']['message']);}})['catch'](function(_0x544b09){logger['error'](_0xbfa0('0xb'),_0x2d8cd9,_0x544b09);_0x2523d8(_0x544b09);});});}exports[_0xbfa0('0x13')]=function(_0xee2447){var _0x49def3=this;return new Promise(function(_0x36e41d,_0x49228b){return db['Trigger'][_0xbfa0('0x14')]({'raw':_0xee2447[_0xbfa0('0x15')]?_0xee2447['options'][_0xbfa0('0x16')]===undefined?!![]:![]:!![],'where':_0xee2447[_0xbfa0('0x15')]?_0xee2447[_0xbfa0('0x15')][_0xbfa0('0x17')]||null:null,'attributes':_0xee2447[_0xbfa0('0x15')]?_0xee2447[_0xbfa0('0x15')][_0xbfa0('0x18')]||null:null,'limit':_0xee2447['options']?_0xee2447[_0xbfa0('0x15')][_0xbfa0('0x19')]||null:null,'include':_0xee2447['options']?_0xee2447[_0xbfa0('0x15')][_0xbfa0('0x1a')]?_[_0xbfa0('0x1b')](_0xee2447['options'][_0xbfa0('0x1a')],function(_0x114fd1){return{'model':db[_0x114fd1[_0xbfa0('0x1c')]],'as':_0x114fd1['as'],'attributes':_0x114fd1['attributes'],'include':_0x114fd1[_0xbfa0('0x1a')]?_['map'](_0x114fd1['include'],function(_0x397484){return{'model':db[_0x397484['model']],'as':_0x397484['as'],'attributes':_0x397484[_0xbfa0('0x18')],'include':_0x397484['include']?_[_0xbfa0('0x1b')](_0x397484[_0xbfa0('0x1a')],function(_0x11ed3a){return{'model':db[_0x11ed3a[_0xbfa0('0x1c')]],'as':_0x11ed3a['as'],'attributes':_0x11ed3a[_0xbfa0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbfa0('0x1d')](function(_0x441305){logger[_0xbfa0('0x12')](_0xbfa0('0x13'),_0xee2447);logger[_0xbfa0('0xd')](_0xbfa0('0x13'),_0xee2447,JSON[_0xbfa0('0xe')](_0x441305));_0x36e41d(_0x441305);})[_0xbfa0('0x1e')](function(_0x1d68aa){logger[_0xbfa0('0xf')](_0xbfa0('0x13'),_0x1d68aa['message'],_0xee2447);_0x49228b(_0x49def3[_0xbfa0('0xf')](0x1f4,_0x1d68aa[_0xbfa0('0x11')]));});});};exports[_0xbfa0('0x1f')]=function(_0x572dbe){var _0x4d0115=this;return new Promise(function(_0x595536,_0x109cfa){return db[_0xbfa0('0x20')]['find']({'raw':_0x572dbe[_0xbfa0('0x15')]?_0x572dbe[_0xbfa0('0x15')][_0xbfa0('0x16')]===undefined?!![]:![]:!![],'where':_0x572dbe['options']?_0x572dbe[_0xbfa0('0x15')][_0xbfa0('0x17')]||null:null,'attributes':_0x572dbe['options']?_0x572dbe[_0xbfa0('0x15')][_0xbfa0('0x18')]||null:null,'include':_0x572dbe[_0xbfa0('0x15')]?_0x572dbe[_0xbfa0('0x15')][_0xbfa0('0x1a')]?_[_0xbfa0('0x1b')](_0x572dbe[_0xbfa0('0x15')][_0xbfa0('0x1a')],function(_0x50cded){return{'model':db[_0x50cded['model']],'as':_0x50cded['as'],'attributes':_0x50cded[_0xbfa0('0x18')],'include':_0x50cded['include']?_[_0xbfa0('0x1b')](_0x50cded['include'],function(_0x4c7a26){return{'model':db[_0x4c7a26[_0xbfa0('0x1c')]],'as':_0x4c7a26['as'],'attributes':_0x4c7a26[_0xbfa0('0x18')],'include':_0x4c7a26['include']?_[_0xbfa0('0x1b')](_0x4c7a26[_0xbfa0('0x1a')],function(_0x143b13){return{'model':db[_0x143b13[_0xbfa0('0x1c')]],'as':_0x143b13['as'],'attributes':_0x143b13['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfa0('0x1d')](function(_0x1297e0){logger[_0xbfa0('0x12')](_0xbfa0('0x1f'),_0x572dbe);logger['debug'](_0xbfa0('0x1f'),_0x572dbe,JSON[_0xbfa0('0xe')](_0x1297e0));_0x595536(_0x1297e0);})[_0xbfa0('0x1e')](function(_0x4fce34){logger[_0xbfa0('0xf')](_0xbfa0('0x1f'),_0x4fce34[_0xbfa0('0x11')],_0x572dbe);_0x109cfa(_0x4d0115[_0xbfa0('0xf')](0x1f4,_0x4fce34[_0xbfa0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ea3e658..056fc6f 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 _0x2d86=['path','connect-timeout','Router','../../components/interaction/service','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','update','destroy','multer','util'];(function(_0x15781b,_0x4db9bb){var _0x20f955=function(_0x636ad0){while(--_0x636ad0){_0x15781b['push'](_0x15781b['shift']());}};_0x20f955(++_0x4db9bb);}(_0x2d86,0x196));var _0x62d8=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0x2d86[_0x4dd479];return _0x1b6807;};'use strict';var multer=require(_0x62d8('0x0'));var util=require(_0x62d8('0x1'));var path=require(_0x62d8('0x2'));var timeout=require(_0x62d8('0x3'));var express=require('express');var router=express[_0x62d8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x62d8('0x5'));var config=require('../../config/environment');var controller=require(_0x62d8('0x6'));router[_0x62d8('0x7')]('/',auth['isAuthenticated'](),controller[_0x62d8('0x8')]);router['get'](_0x62d8('0x9'),auth[_0x62d8('0xa')](),controller[_0x62d8('0xb')]);router[_0x62d8('0xc')](_0x62d8('0xd'),auth[_0x62d8('0xa')](),controller[_0x62d8('0xe')]);router['post']('/',auth[_0x62d8('0xa')](),controller['create']);router['put'](_0x62d8('0x9'),auth[_0x62d8('0xa')](),controller[_0x62d8('0xf')]);router['delete'](_0x62d8('0x9'),auth['isAuthenticated'](),controller[_0x62d8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbca2=['create','put','update','destroy','exports','multer','path','express','Router','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','clone'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbca2,0x71));var _0x2bca=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xbca2[_0x34bc6c];return _0x168820;};'use strict';var multer=require(_0x2bca('0x0'));var util=require('util');var path=require(_0x2bca('0x1'));var timeout=require('connect-timeout');var express=require(_0x2bca('0x2'));var router=express[_0x2bca('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2bca('0x4'));var controller=require(_0x2bca('0x5'));router['get']('/',auth[_0x2bca('0x6')](),controller[_0x2bca('0x7')]);router[_0x2bca('0x8')](_0x2bca('0x9'),auth[_0x2bca('0x6')](),controller[_0x2bca('0xa')]);router[_0x2bca('0xb')]('/:id/clone',auth['isAuthenticated'](),controller[_0x2bca('0xc')]);router['post']('/',auth[_0x2bca('0x6')](),controller[_0x2bca('0xd')]);router[_0x2bca('0xe')](_0x2bca('0x9'),auth['isAuthenticated'](),controller[_0x2bca('0xf')]);router['delete'](_0x2bca('0x9'),auth[_0x2bca('0x6')](),controller[_0x2bca('0x10')]);module[_0x2bca('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 9a5160f..2aa5679 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 _0xb7e7=['always','accept','refuse','originate','uac','uas','fingerprint','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER'];(function(_0x4b1b3a,_0x239438){var _0x203002=function(_0x2de54f){while(--_0x2de54f){_0x4b1b3a['push'](_0x4b1b3a['shift']());}};_0x203002(++_0x239438);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7b7e('0x2')]('friend',_0x7b7e('0x3'),'peer'),'allowNull':![],'defaultValue':_0x7b7e('0x4')},'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x5')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8'),'PROHIB_NOT_SCREENED',_0x7b7e('0x9'),_0x7b7e('0xa'),_0x7b7e('0xb'))},'deny':{'type':Sequelize[_0x7b7e('0x1')]},'permit':{'type':Sequelize[_0x7b7e('0x1')]},'secret':{'type':Sequelize[_0x7b7e('0x1')]},'md5secret':{'type':Sequelize[_0x7b7e('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc'),'set':function(_0x10a666){this[_0x7b7e('0xd')](_0x7b7e('0xe'),_0x10a666?_0x10a666[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0xe'))?this[_0x7b7e('0x10')]('transport')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x7b7e('0x13'),'info','shortinfo',_0x7b7e('0x14'),_0x7b7e('0x15')),'defaultValue':_0x7b7e('0x13')},'directmedia':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','nonat','update',_0x7b7e('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7b7e('0x1')]},'directmediadeny':{'type':Sequelize[_0x7b7e('0x1')]},'nat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x18'),'set':function(_0x200ef7){this[_0x7b7e('0xd')](_0x7b7e('0x19'),_0x200ef7?_0x200ef7[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')](_0x7b7e('0x19'))?this[_0x7b7e('0x10')](_0x7b7e('0x19'))[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x7b7e('0x1')]},'pickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7b7e('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1b')},'allow':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x1c'),'set':function(_0x303d8c){this[_0x7b7e('0xd')](_0x7b7e('0x1d'),_0x303d8c?_0x303d8c['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x7b7e('0x1d'))?this[_0x7b7e('0x10')](_0x7b7e('0x1d'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'insecure':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x1e'),'set':function(_0x7aa71){this[_0x7b7e('0xd')]('insecure',_0x7aa71?_0x7aa71[_0x7b7e('0xf')](','):null);},'get':function(){return this[_0x7b7e('0x10')]('insecure')?this['getDataValue']('insecure')[_0x7b7e('0x11')](','):null;},'comment':_0x7b7e('0x1f')},'trustrpid':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'accountcode':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7b7e('0x1')]},'callcounter':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'busylevel':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x7b7e('0x1')]},'template':{'type':Sequelize[_0x7b7e('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no',_0x7b7e('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'session_timers':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x22'),_0x7b7e('0x23'),_0x7b7e('0x24'))},'session_expires':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x25'),_0x7b7e('0x26')),'defaultValue':_0x7b7e('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x7b7e('0x1')]},'fromdomain':{'type':Sequelize[_0x7b7e('0x1')]},'fromuser':{'type':Sequelize[_0x7b7e('0x1')]},'port':{'type':Sequelize[_0x7b7e('0x20')](0x5)},'qualify':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':_0x7b7e('0x16')},'keepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x7b7e('0x1')]},'defaultuser':{'type':Sequelize[_0x7b7e('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7b7e('0x1')]},'callbackextension':{'type':Sequelize[_0x7b7e('0x1')]},'timert1':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x7b7e('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x7b7e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7b7e('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x7b7e('0x20')](0xb)},'encryption':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'force_avp':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'icesupport':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x7b7e('0x2')]('yes','no',_0x7b7e('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7b7e('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x7b7e('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7b7e('0x1')]},'dtlssetup':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x28'),_0x7b7e('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7b7e('0x1')]},'usereqphone':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7b7e('0x1')]},'recordofffeature':{'type':Sequelize[_0x7b7e('0x1')]},'call_limit':{'type':Sequelize[_0x7b7e('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7b7e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x7b7e('0x1')]},'mohinterpret':{'type':Sequelize[_0x7b7e('0x1')]},'mohsuggest':{'type':Sequelize[_0x7b7e('0x1')]},'parkinglot':{'type':Sequelize[_0x7b7e('0x1')]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x7b7e('0x2a')},'canreinvite':{'type':Sequelize[_0x7b7e('0x2')]('yes','no','nonat',_0x7b7e('0x2b'),_0x7b7e('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7b7e('0x1')]},'otherFields':{'type':Sequelize[_0x7b7e('0x1')]},'active':{'type':Sequelize[_0x7b7e('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0b0e=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','insecure','yes','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','active','passive','dynamic','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x40750d,_0x593094){var _0x42d026=function(_0x1168bb){while(--_0x1168bb){_0x40750d['push'](_0x40750d['shift']());}};_0x42d026(++_0x593094);}(_0x0b0e,0x187));var _0xe0b0=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x0b0e[_0x243217];return _0x478029;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5')),'allowNull':![],'defaultValue':_0xe0b0('0x3')},'context':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':_0xe0b0('0x6')},'callingpres':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'))},'deny':{'type':Sequelize[_0xe0b0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe0b0('0x1')]},'md5secret':{'type':Sequelize[_0xe0b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0xd'),'set':function(_0x574d96){this[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x574d96?_0x574d96[_0xe0b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xe0b0('0xf'))?this[_0xe0b0('0x11')](_0xe0b0('0xf'))[_0xe0b0('0x12')](','):null;},'comment':_0xe0b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe0b0('0x14'),_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),_0xe0b0('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe0b0('0x2')]('yes','no',_0xe0b0('0x19'),_0xe0b0('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe0b0('0x1')]},'directmediadeny':{'type':Sequelize[_0xe0b0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x46bb44){this['setDataValue']('nat',_0x46bb44?_0x46bb44['join'](','):null);},'get':function(){return this[_0xe0b0('0x11')]('nat')?this['getDataValue'](_0xe0b0('0x1b'))['split'](','):null;},'comment':_0xe0b0('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe0b0('0x1')]},'pickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'language':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12b260){this[_0xe0b0('0xe')]('allow',_0x12b260?_0x12b260[_0xe0b0('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe0b0('0x11')]('allow')?this[_0xe0b0('0x11')]('allow')[_0xe0b0('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'port,invite','set':function(_0x362aba){this[_0xe0b0('0xe')](_0xe0b0('0x1d'),_0x362aba?_0x362aba[_0xe0b0('0x10')](','):null);},'get':function(){return this[_0xe0b0('0x11')](_0xe0b0('0x1d'))?this['getDataValue'](_0xe0b0('0x1d'))[_0xe0b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no')},'useclientcode':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe0b0('0x1')]},'callerid':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x20')},'amaflags':{'type':Sequelize[_0xe0b0('0x1')]},'callcounter':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':_0xe0b0('0x1e')},'busylevel':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xe0b0('0x1')]},'template':{'type':Sequelize[_0xe0b0('0x1')]},'videosupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'session_timers':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x23'),'refuse',_0xe0b0('0x24'))},'session_expires':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x25'),_0xe0b0('0x26')),'defaultValue':_0xe0b0('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe0b0('0x21')](0x5)},'qualify':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xe0b0('0x1')]},'defaultuser':{'type':Sequelize[_0xe0b0('0x1')]},'rtptimeout':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe0b0('0x1')]},'callbackextension':{'type':Sequelize[_0xe0b0('0x1')]},'timert1':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'timerb':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe0b0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe0b0('0x1')]},'maxforwards':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'encryption':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'force_avp':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscapath':{'type':Sequelize[_0xe0b0('0x1')]},'dtlssetup':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x29'),_0xe0b0('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe0b0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe0b0('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe0b0('0x1')]},'parkinglot':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize[_0xe0b0('0x1')]},'host':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe0b0('0x1')]},'active':{'type':Sequelize[_0xe0b0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe0b0('0x1')],'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 c91105f..741059d 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 _0xf29f=['end','stack','name','send','index','Trunk','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','key','filter','options','includeAll','include','rows','show','params','find','clone','length','omit','createdAt','updatedAt','body','create','user','UserProfileSection','autoAssociation','findAll','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','UserProfileResource'];(function(_0x4564f1,_0x34af52){var _0x27f9b9=function(_0x15bcb9){while(--_0x15bcb9){_0x4564f1['push'](_0x4564f1['shift']());}};_0x27f9b9(++_0x34af52);}(_0xf29f,0x18d));var _0xff29=function(_0x5722f3,_0x5e0d0d){_0x5722f3=_0x5722f3-0x0;var _0x1bca9f=_0xf29f[_0x5722f3];return _0x1bca9f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xff29('0x0'));var rimraf=require(_0xff29('0x1'));var zipdir=require(_0xff29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff29('0x3'));var moment=require(_0xff29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff29('0x5'));var util=require(_0xff29('0x6'));var path=require('path');var sox=require(_0xff29('0x7'));var csv=require(_0xff29('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xff29('0x9'));var crypto=require('crypto');var jsforce=require(_0xff29('0xa'));var deskjs=require(_0xff29('0xb'));var toCsv=require(_0xff29('0x8'));var querystring=require(_0xff29('0xc'));var Papa=require(_0xff29('0xd'));var Redis=require(_0xff29('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xff29('0xf'));var logger=require(_0xff29('0x10'))(_0xff29('0x11'));var utils=require(_0xff29('0x12'));var config=require(_0xff29('0x13'));var db=require(_0xff29('0x14'))['db'];var jayson=require(_0xff29('0x15'));var client=jayson[_0xff29('0x16')][_0xff29('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1f4a9c,_0xf67040,_0x425fe9){if(_0x425fe9){var _0xd453c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd453c3[_0xff29('0x18')](_0xf67040)){return _0x1f4a9c;}else{throw new Error(_0xff29('0x19'));}}else{return _0x1f4a9c;}}function respondWithRpcPromise(_0x518c75,_0x1ff15e,_0x270f36,_0x4c458c){return new BPromise(function(_0x2228fb,_0xbd98f5){var _0x24567d=_0x4c458c||client;return _0x24567d[_0xff29('0x1a')](_0x518c75,_0x270f36)[_0xff29('0x1b')](function(_0x438518){logger[_0xff29('0x1c')](_0xff29('0x1d'),_0x1ff15e,_0xff29('0x1e'));logger[_0xff29('0x1f')](_0xff29('0x20'),_0x1ff15e,'request\x20sent',JSON[_0xff29('0x21')](_0x438518));if(_0x438518[_0xff29('0x22')]){if(_0x438518[_0xff29('0x22')][_0xff29('0x23')]===0x1f4){logger[_0xff29('0x22')](_0xff29('0x1d'),_0x1ff15e,_0x438518['error'][_0xff29('0x24')]);return _0xbd98f5(_0x438518[_0xff29('0x22')][_0xff29('0x24')]);}logger[_0xff29('0x22')](_0xff29('0x1d'),_0x1ff15e,_0x438518[_0xff29('0x22')][_0xff29('0x24')]);return _0x2228fb(_0x438518[_0xff29('0x22')][_0xff29('0x24')]);}else{logger[_0xff29('0x1c')](_0xff29('0x1d'),_0x1ff15e,_0xff29('0x1e'));_0x2228fb(_0x438518[_0xff29('0x25')][_0xff29('0x24')]);}})[_0xff29('0x26')](function(_0x331de6){logger[_0xff29('0x22')]('Trunk,\x20%s,\x20%s',_0x1ff15e,_0x331de6);_0xbd98f5(_0x331de6);});});}function respondWithStatusCode(_0x21b7f3,_0x15cd08){_0x15cd08=_0x15cd08||0xcc;return function(_0x597ebb){if(_0x597ebb){return _0x21b7f3[_0xff29('0x27')](_0x15cd08);}return _0x21b7f3['status'](_0x15cd08)['end']();};}function respondWithResult(_0x54cc3a,_0x51fbc9){_0x51fbc9=_0x51fbc9||0xc8;return function(_0x13b237){if(_0x13b237){return _0x54cc3a[_0xff29('0x28')](_0x51fbc9)[_0xff29('0x29')](_0x13b237);}};}function respondWithFilteredResult(_0xdbe40b,_0x15d626){return function(_0x50570a){if(_0x50570a){var _0x81ddb9=_0x50570a[_0xff29('0x2a')],_0x27c9bf=_0x15d626[_0xff29('0x2b')],_0x1dc67e=_0x15d626[_0xff29('0x2b')]+_0x15d626[_0xff29('0x2c')],_0x132682;if(_0x1dc67e>=_0x81ddb9){_0x1dc67e=_0x81ddb9;_0x132682=0xc8;}else{_0x132682=0xce;}_0xdbe40b[_0xff29('0x28')](_0x132682);return _0xdbe40b[_0xff29('0x2d')](_0xff29('0x2e'),_0x27c9bf+'-'+_0x1dc67e+'/'+_0x81ddb9)[_0xff29('0x29')](_0x50570a);}return null;};}function patchUpdates(_0xafccf2){return function(_0x4d3732){try{jsonpatch[_0xff29('0x2f')](_0x4d3732,_0xafccf2,!![]);}catch(_0x2c2a7d){return BPromise[_0xff29('0x30')](_0x2c2a7d);}return _0x4d3732[_0xff29('0x31')]();};}function saveUpdates(_0x4b0586,_0x4783f0){return function(_0x28175e){if(_0x28175e){return _0x28175e[_0xff29('0x32')](_0x4b0586)['then'](function(_0x1673ca){return _0x1673ca;});}return null;};}function removeEntity(_0x4f87f6,_0x5bafa2){return function(_0x5b359e){if(_0x5b359e){return _0x5b359e[_0xff29('0x33')]()[_0xff29('0x1b')](function(){var _0x1b3c43=_0x5b359e[_0xff29('0x34')]({'plain':!![]});var _0x17c254=_0xff29('0x35');return db[_0xff29('0x36')][_0xff29('0x33')]({'where':{'type':_0x17c254,'resourceId':_0x1b3c43['id']}})[_0xff29('0x1b')](function(){return _0x5b359e;});})[_0xff29('0x1b')](function(){_0x4f87f6[_0xff29('0x28')](0xcc)[_0xff29('0x37')]();});}};}function handleEntityNotFound(_0x1fada6,_0x29f1cf){return function(_0x2832bc){if(!_0x2832bc){_0x1fada6[_0xff29('0x27')](0x194);}return _0x2832bc;};}function handleError(_0x49ff59,_0x13ff3d){_0x13ff3d=_0x13ff3d||0x1f4;return function(_0xfc48ce){logger['error'](_0xfc48ce[_0xff29('0x38')]);if(_0xfc48ce[_0xff29('0x39')]){delete _0xfc48ce[_0xff29('0x39')];}_0x49ff59[_0xff29('0x28')](_0x13ff3d)[_0xff29('0x3a')](_0xfc48ce);};}exports[_0xff29('0x3b')]=function(_0x1768b6,_0xf11b20){var _0x4a2d57={},_0x1fd4e6={},_0xed2929={'count':0x0,'rows':[]};var _0x43d561=db[_0xff29('0x3c')][_0xff29('0x3d')];_0x1fd4e6[_0xff29('0x3e')]=_[_0xff29('0x3f')](_0x43d561);_0x1fd4e6[_0xff29('0x40')]=_[_0xff29('0x3f')](_0x1768b6[_0xff29('0x40')]);_0x1fd4e6[_0xff29('0x41')]=_[_0xff29('0x42')](_0x1fd4e6[_0xff29('0x3e')],_0x1fd4e6[_0xff29('0x40')]);_0x4a2d57['attributes']=_[_0xff29('0x42')](_0x1fd4e6[_0xff29('0x3e')],qs['fields'](_0x1768b6[_0xff29('0x40')][_0xff29('0x43')]));_0x4a2d57[_0xff29('0x44')]=_0x4a2d57['attributes']['length']?_0x4a2d57[_0xff29('0x44')]:_0x1fd4e6[_0xff29('0x3e')];if(!_0x1768b6[_0xff29('0x40')][_0xff29('0x45')](_0xff29('0x46'))){_0x4a2d57[_0xff29('0x2c')]=qs[_0xff29('0x2c')](_0x1768b6['query']['limit']);_0x4a2d57['offset']=qs[_0xff29('0x2b')](_0x1768b6[_0xff29('0x40')][_0xff29('0x2b')]);}_0x4a2d57[_0xff29('0x47')]=qs[_0xff29('0x48')](_0x1768b6[_0xff29('0x40')][_0xff29('0x48')]);_0x4a2d57[_0xff29('0x49')]=qs[_0xff29('0x41')](_['pick'](_0x1768b6[_0xff29('0x40')],_0x1fd4e6[_0xff29('0x41')]));if(_0x1768b6[_0xff29('0x40')]['filter']){_0x4a2d57['where']=_[_0xff29('0x4a')](_0x4a2d57['where'],{'$or':_['map'](_0x43d561,function(_0x3d32e0){if(_0x3d32e0[_0xff29('0x4b')][_0xff29('0x4c')]!=='VIRTUAL'){var _0x325601={};_0x325601[_0x3d32e0['field']]={'$like':'%'+_0x1768b6[_0xff29('0x40')][_0xff29('0x4d')]+'%'};return _0x325601;}})});}_0x4a2d57=_[_0xff29('0x4a')]({},_0x4a2d57,_0x1768b6[_0xff29('0x4e')]);var _0x47bdb7={'where':_0x4a2d57[_0xff29('0x49')]};return db[_0xff29('0x3c')][_0xff29('0x2a')](_0x47bdb7)[_0xff29('0x1b')](function(_0x478870){_0xed2929[_0xff29('0x2a')]=_0x478870;if(_0x1768b6[_0xff29('0x40')][_0xff29('0x4f')]){_0x4a2d57[_0xff29('0x50')]=[{'all':!![]}];}return db['Trunk']['findAll'](_0x4a2d57);})[_0xff29('0x1b')](function(_0x2596e4){_0xed2929[_0xff29('0x51')]=_0x2596e4;return _0xed2929;})[_0xff29('0x1b')](respondWithFilteredResult(_0xf11b20,_0x4a2d57))[_0xff29('0x26')](handleError(_0xf11b20,null));};exports[_0xff29('0x52')]=function(_0xd52016,_0x45bdcd){var _0xeae254={'raw':![],'where':{'id':_0xd52016[_0xff29('0x53')]['id']}},_0x573a50={};_0x573a50[_0xff29('0x3e')]=_[_0xff29('0x3f')](db[_0xff29('0x3c')][_0xff29('0x3d')]);_0x573a50['query']=_[_0xff29('0x3f')](_0xd52016[_0xff29('0x40')]);_0x573a50[_0xff29('0x41')]=_[_0xff29('0x42')](_0x573a50['model'],_0x573a50['query']);_0xeae254[_0xff29('0x44')]=_[_0xff29('0x42')](_0x573a50[_0xff29('0x3e')],qs['fields'](_0xd52016[_0xff29('0x40')]['fields']));_0xeae254['attributes']=_0xeae254['attributes']['length']?_0xeae254[_0xff29('0x44')]:_0x573a50[_0xff29('0x3e')];if(_0xd52016[_0xff29('0x40')][_0xff29('0x4f')]){_0xeae254[_0xff29('0x50')]=[{'all':!![]}];}_0xeae254=_['merge']({},_0xeae254,_0xd52016['options']);return db[_0xff29('0x3c')][_0xff29('0x54')](_0xeae254)[_0xff29('0x1b')](handleEntityNotFound(_0x45bdcd,null))[_0xff29('0x1b')](respondWithResult(_0x45bdcd,null))[_0xff29('0x26')](handleError(_0x45bdcd,null));};exports[_0xff29('0x55')]=function(_0x2da4a6,_0xd6e904){var _0x3ccbec={'raw':![],'where':{'id':_0x2da4a6[_0xff29('0x53')]['id']}},_0x516944={};_0x516944['model']=_[_0xff29('0x3f')](db[_0xff29('0x3c')]['rawAttributes']);_0x3ccbec['attributes']=_['intersection'](_0x516944[_0xff29('0x3e')],qs['fields'](_0x2da4a6[_0xff29('0x40')][_0xff29('0x43')]));_0x3ccbec[_0xff29('0x44')]=_0x3ccbec[_0xff29('0x44')][_0xff29('0x56')]?_0x3ccbec[_0xff29('0x44')]:_0x516944[_0xff29('0x3e')];if(_0x2da4a6['query'][_0xff29('0x4f')]){_0x3ccbec[_0xff29('0x50')]=[{'all':!![]}];}_0x3ccbec=_[_0xff29('0x4a')]({},_0x3ccbec,_0x2da4a6[_0xff29('0x4e')]);return db['Trunk']['find'](_0x3ccbec)[_0xff29('0x1b')](handleEntityNotFound(_0xd6e904,null))['then'](function(_0x5264ca){if(_0x5264ca){var _0xca515b=_0x5264ca[_0xff29('0x34')]({'plain':!![]});_0xca515b=qs[_0xff29('0x57')](_0xca515b,['id',_0xff29('0x58'),_0xff29('0x59')]);_0x2da4a6[_0xff29('0x5a')]=_[_0xff29('0x57')](_0x2da4a6[_0xff29('0x5a')],['id','createdAt',_0xff29('0x59')]);return db[_0xff29('0x3c')][_0xff29('0x5b')](_[_0xff29('0x4a')](_0xca515b,_0x2da4a6[_0xff29('0x5a')]),{'include':_0x2da4a6[_0xff29('0x40')][_0xff29('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x29e145){var _0x2e8f93=_0x2da4a6[_0xff29('0x5c')][_0xff29('0x34')]({'plain':!![]});if(!_0x2e8f93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e8f93['role']==='user'){var _0x1c0632=_0x29e145['get']({'plain':!![]});var _0x609a6a=_0xff29('0x35');return db[_0xff29('0x5d')][_0xff29('0x54')]({'where':{'name':_0x609a6a,'userProfileId':_0x2e8f93['userProfileId']},'raw':!![]})['then'](function(_0x20ca4f){if(_0x20ca4f&&_0x20ca4f[_0xff29('0x5e')]===0x0){return db[_0xff29('0x36')][_0xff29('0x5b')]({'name':_0x1c0632[_0xff29('0x39')],'resourceId':_0x1c0632['id'],'type':_0x20ca4f[_0xff29('0x39')],'sectionId':_0x20ca4f['id']},{})['then'](function(){return _0x29e145;});}else{return _0x29e145;}})[_0xff29('0x26')](function(_0x4a5abc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5abc);throw _0x4a5abc;});}return _0x29e145;});}})[_0xff29('0x1b')](respondWithResult(_0xd6e904,0xc9))[_0xff29('0x26')](handleError(_0xd6e904,null));};exports['create']=function(_0x58d5fe,_0x188b5d,_0x320fd1){var _0x11a462;return db[_0xff29('0x3c')][_0xff29('0x5b')](_0x58d5fe[_0xff29('0x5a')],{'raw':!![]})['then'](function(_0x45ad6a){_0x11a462=_0x45ad6a;return db[_0xff29('0x3c')][_0xff29('0x5f')]({'raw':!![]});})[_0xff29('0x1b')](function(_0x20ca18){var _0x1135fe=fs['readFileSync'](path[_0xff29('0x60')](config[_0xff29('0x61')],_0xff29('0x62')),'utf8');var _0x29b5dc=fs[_0xff29('0x63')](path[_0xff29('0x60')](config[_0xff29('0x61')],_0xff29('0x64')),_0xff29('0x65'));var _0x562b09=ejs[_0xff29('0x66')](_0x1135fe,{'trunks':_0x20ca18||[]});fs[_0xff29('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x562b09);if(_0x11a462[_0xff29('0x68')]){var _0x184734=ejs[_0xff29('0x66')](_0x29b5dc,{'trunks':_0x20ca18||[]});fs[_0xff29('0x67')](_0xff29('0x69'),_0x184734);}})['then'](function(){return respondWithRpcPromise(_0xff29('0x6a'),_0xff29('0x5b'),{'module':_0xff29('0x6b')});})[_0xff29('0x1b')](function(){var _0x52615c=_0x58d5fe['user'][_0xff29('0x34')]({'plain':!![]});if(!_0x52615c)throw new Error(_0xff29('0x6c'));if(_0x52615c[_0xff29('0x6d')]===_0xff29('0x5c')){var _0x3aeb3b=_0x11a462['get']({'plain':!![]});return db['UserProfileSection'][_0xff29('0x54')]({'where':{'name':_0xff29('0x35'),'userProfileId':_0x52615c[_0xff29('0x6e')]},'raw':!![]})[_0xff29('0x1b')](function(_0xe00b1a){if(_0xe00b1a&&_0xe00b1a['autoAssociation']===0x0){return db[_0xff29('0x36')]['create']({'name':_0x3aeb3b[_0xff29('0x39')],'resourceId':_0x3aeb3b['id'],'type':_0xe00b1a[_0xff29('0x39')],'sectionId':_0xe00b1a['id']},{})[_0xff29('0x1b')](function(){return _0x11a462;});}else{return _0x11a462;}})[_0xff29('0x26')](function(_0x5bc0df){logger[_0xff29('0x22')](_0xff29('0x6f'),_0x5bc0df);throw _0x5bc0df;});}return _0x11a462;})['then'](respondWithResult(_0x188b5d,0xc9))[_0xff29('0x26')](handleError(_0x188b5d,null));};exports['update']=function(_0x3c64c9,_0x4f37cb,_0x31b3c3){var _0x21df6f;return db[_0xff29('0x3c')][_0xff29('0x54')]({'where':{'id':_0x3c64c9[_0xff29('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f37cb,null))[_0xff29('0x1b')](saveUpdates(_0x3c64c9['body'],null))['then'](function(_0x6db8b){if(_0x6db8b){_0x21df6f=_0x6db8b;return db['Trunk'][_0xff29('0x5f')]({'raw':!![]});}})[_0xff29('0x1b')](function(_0x44a0f7){if(_0x44a0f7){var _0x38465b=fs['readFileSync'](path[_0xff29('0x60')](config['root'],_0xff29('0x62')),_0xff29('0x65'));var _0x276b98=fs[_0xff29('0x63')](path['join'](config[_0xff29('0x61')],_0xff29('0x64')),_0xff29('0x65'));var _0x313498=ejs[_0xff29('0x66')](_0x38465b,{'trunks':_0x44a0f7||[]});fs[_0xff29('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x313498);var _0x5271c7=ejs[_0xff29('0x66')](_0x276b98,{'trunks':_0x44a0f7||[]});fs[_0xff29('0x67')](_0xff29('0x69'),_0x5271c7);return respondWithRpcPromise('Reload','update',{'module':_0xff29('0x6b')});}return null;})['then'](function(_0x392ae4){if(_0x392ae4){return _0x21df6f;}})['then'](respondWithResult(_0x4f37cb,null))[_0xff29('0x26')](handleError(_0x4f37cb,null));};exports[_0xff29('0x33')]=function(_0x1be9d1,_0x28ac21,_0x32a38d){var _0x4ee521;return db[_0xff29('0x3c')][_0xff29('0x54')]({'where':{'id':_0x1be9d1[_0xff29('0x53')]['id']}})[_0xff29('0x1b')](handleEntityNotFound(_0x28ac21,null))[_0xff29('0x1b')](removeEntity(_0x28ac21,null))['then'](function(){return db['Trunk'][_0xff29('0x5f')]({'raw':!![]});})[_0xff29('0x1b')](function(_0x2764cd){var _0x384ad4=fs[_0xff29('0x63')](path[_0xff29('0x60')](config[_0xff29('0x61')],_0xff29('0x62')),_0xff29('0x65'));var _0x3b15dc=fs[_0xff29('0x63')](path['join'](config[_0xff29('0x61')],_0xff29('0x64')),_0xff29('0x65'));var _0x208962=ejs[_0xff29('0x66')](_0x384ad4,{'trunks':_0x2764cd});var _0x3e69f0=ejs['render'](_0x3b15dc,{'trunks':_0x2764cd});fs['writeFileSync'](_0xff29('0x70'),_0x208962);fs['writeFileSync'](_0xff29('0x69'),_0x3e69f0);return respondWithRpcPromise('Reload',_0xff29('0x33'),{'module':_0xff29('0x6b')});})[_0xff29('0x26')](handleError(_0x28ac21,null));}; \ No newline at end of file +var _0xa164=['request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','set','apply','reject','destroy','get','Trunks','UserProfileResource','stack','name','send','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Trunk','includeAll','include','findAll','rows','params','rawAttributes','find','clone','createdAt','updatedAt','omit','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','role','readFileSync','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','update','chan_sip.so','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa164,0x19e));var _0x4a16=function(_0x5c86f8,_0x584d10){_0x5c86f8=_0x5c86f8-0x0;var _0x161119=_0xa164[_0x5c86f8];return _0x161119;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4a16('0x0'));var rimraf=require(_0x4a16('0x1'));var zipdir=require(_0x4a16('0x2'));var jsonpatch=require(_0x4a16('0x3'));var rp=require(_0x4a16('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4a16('0x5'));var util=require(_0x4a16('0x6'));var path=require(_0x4a16('0x7'));var sox=require(_0x4a16('0x8'));var csv=require(_0x4a16('0x9'));var ejs=require(_0x4a16('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a16('0xb'));var crypto=require(_0x4a16('0xc'));var jsforce=require(_0x4a16('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4a16('0x9'));var querystring=require(_0x4a16('0xe'));var Papa=require(_0x4a16('0xf'));var Redis=require(_0x4a16('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4a16('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a16('0x12'))(_0x4a16('0x13'));var utils=require(_0x4a16('0x14'));var config=require(_0x4a16('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4a16('0x16')][_0x4a16('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1326c2,_0x10e26a,_0x3db461){if(_0x3db461){var _0x379c72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x379c72[_0x4a16('0x18')](_0x10e26a)){return _0x1326c2;}else{throw new Error(_0x4a16('0x19'));}}else{return _0x1326c2;}}function respondWithRpcPromise(_0x4040dd,_0x36d352,_0x25f7aa,_0x3fcd66){return new BPromise(function(_0x3edd2e,_0x4c8a1a){var _0x25f306=_0x3fcd66||client;return _0x25f306[_0x4a16('0x1a')](_0x4040dd,_0x25f7aa)[_0x4a16('0x1b')](function(_0x4b46d2){logger[_0x4a16('0x1c')](_0x4a16('0x1d'),_0x36d352,_0x4a16('0x1e'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x36d352,_0x4a16('0x1e'),JSON[_0x4a16('0x1f')](_0x4b46d2));if(_0x4b46d2[_0x4a16('0x20')]){if(_0x4b46d2['error'][_0x4a16('0x21')]===0x1f4){logger[_0x4a16('0x20')](_0x4a16('0x1d'),_0x36d352,_0x4b46d2['error'][_0x4a16('0x22')]);return _0x4c8a1a(_0x4b46d2[_0x4a16('0x20')]['message']);}logger[_0x4a16('0x20')](_0x4a16('0x1d'),_0x36d352,_0x4b46d2[_0x4a16('0x20')]['message']);return _0x3edd2e(_0x4b46d2['error']['message']);}else{logger[_0x4a16('0x1c')](_0x4a16('0x1d'),_0x36d352,_0x4a16('0x1e'));_0x3edd2e(_0x4b46d2[_0x4a16('0x23')]['message']);}})[_0x4a16('0x24')](function(_0x3e3653){logger['error']('Trunk,\x20%s,\x20%s',_0x36d352,_0x3e3653);_0x4c8a1a(_0x3e3653);});});}function respondWithStatusCode(_0x533808,_0x7de596){_0x7de596=_0x7de596||0xcc;return function(_0x499d80){if(_0x499d80){return _0x533808[_0x4a16('0x25')](_0x7de596);}return _0x533808['status'](_0x7de596)[_0x4a16('0x26')]();};}function respondWithResult(_0x3f1e9c,_0x30f3fd){_0x30f3fd=_0x30f3fd||0xc8;return function(_0x50af9b){if(_0x50af9b){return _0x3f1e9c[_0x4a16('0x27')](_0x30f3fd)['json'](_0x50af9b);}};}function respondWithFilteredResult(_0x1b0740,_0x5a7ee0){return function(_0x5e8342){if(_0x5e8342){var _0x4efbf0=_0x5e8342[_0x4a16('0x28')],_0x14a4a5=_0x5a7ee0[_0x4a16('0x29')],_0xb79155=_0x5a7ee0['offset']+_0x5a7ee0['limit'],_0x287a7f;if(_0xb79155>=_0x4efbf0){_0xb79155=_0x4efbf0;_0x287a7f=0xc8;}else{_0x287a7f=0xce;}_0x1b0740['status'](_0x287a7f);return _0x1b0740[_0x4a16('0x2a')]('Content-Range',_0x14a4a5+'-'+_0xb79155+'/'+_0x4efbf0)['json'](_0x5e8342);}return null;};}function patchUpdates(_0x52a6b9){return function(_0x4f5ba2){try{jsonpatch[_0x4a16('0x2b')](_0x4f5ba2,_0x52a6b9,!![]);}catch(_0x2f300b){return BPromise[_0x4a16('0x2c')](_0x2f300b);}return _0x4f5ba2['save']();};}function saveUpdates(_0x34fd28,_0x4df26b){return function(_0x16222d){if(_0x16222d){return _0x16222d['update'](_0x34fd28)[_0x4a16('0x1b')](function(_0x5a890c){return _0x5a890c;});}return null;};}function removeEntity(_0x2a14c6,_0x5272a2){return function(_0x4f6c49){if(_0x4f6c49){return _0x4f6c49[_0x4a16('0x2d')]()[_0x4a16('0x1b')](function(){var _0xdfcd20=_0x4f6c49[_0x4a16('0x2e')]({'plain':!![]});var _0xe97072=_0x4a16('0x2f');return db[_0x4a16('0x30')]['destroy']({'where':{'type':_0xe97072,'resourceId':_0xdfcd20['id']}})[_0x4a16('0x1b')](function(){return _0x4f6c49;});})[_0x4a16('0x1b')](function(){_0x2a14c6[_0x4a16('0x27')](0xcc)[_0x4a16('0x26')]();});}};}function handleEntityNotFound(_0x523d55,_0x3c3b71){return function(_0x54bc58){if(!_0x54bc58){_0x523d55['sendStatus'](0x194);}return _0x54bc58;};}function handleError(_0x2975bd,_0x2143ae){_0x2143ae=_0x2143ae||0x1f4;return function(_0x4dd582){logger[_0x4a16('0x20')](_0x4dd582[_0x4a16('0x31')]);if(_0x4dd582[_0x4a16('0x32')]){delete _0x4dd582[_0x4a16('0x32')];}_0x2975bd[_0x4a16('0x27')](_0x2143ae)[_0x4a16('0x33')](_0x4dd582);};}exports['index']=function(_0x419f9d,_0x477a90){var _0x34063f={},_0x150acc={},_0x28855b={'count':0x0,'rows':[]};var _0x259236=db['Trunk']['rawAttributes'];_0x150acc[_0x4a16('0x34')]=_['keys'](_0x259236);_0x150acc[_0x4a16('0x35')]=_[_0x4a16('0x36')](_0x419f9d[_0x4a16('0x35')]);_0x150acc[_0x4a16('0x37')]=_[_0x4a16('0x38')](_0x150acc[_0x4a16('0x34')],_0x150acc[_0x4a16('0x35')]);_0x34063f[_0x4a16('0x39')]=_[_0x4a16('0x38')](_0x150acc[_0x4a16('0x34')],qs['fields'](_0x419f9d[_0x4a16('0x35')][_0x4a16('0x3a')]));_0x34063f['attributes']=_0x34063f[_0x4a16('0x39')][_0x4a16('0x3b')]?_0x34063f[_0x4a16('0x39')]:_0x150acc['model'];if(!_0x419f9d[_0x4a16('0x35')][_0x4a16('0x3c')](_0x4a16('0x3d'))){_0x34063f[_0x4a16('0x3e')]=qs['limit'](_0x419f9d['query'][_0x4a16('0x3e')]);_0x34063f['offset']=qs['offset'](_0x419f9d[_0x4a16('0x35')][_0x4a16('0x29')]);}_0x34063f[_0x4a16('0x3f')]=qs[_0x4a16('0x40')](_0x419f9d[_0x4a16('0x35')][_0x4a16('0x40')]);_0x34063f[_0x4a16('0x41')]=qs['filters'](_[_0x4a16('0x42')](_0x419f9d['query'],_0x150acc['filters']));if(_0x419f9d[_0x4a16('0x35')][_0x4a16('0x43')]){_0x34063f[_0x4a16('0x41')]=_[_0x4a16('0x44')](_0x34063f['where'],{'$or':_[_0x4a16('0x45')](_0x259236,function(_0x57734d){if(_0x57734d[_0x4a16('0x46')][_0x4a16('0x47')]!==_0x4a16('0x48')){var _0x4cf6cb={};_0x4cf6cb[_0x57734d[_0x4a16('0x49')]]={'$like':'%'+_0x419f9d[_0x4a16('0x35')]['filter']+'%'};return _0x4cf6cb;}})});}_0x34063f=_[_0x4a16('0x44')]({},_0x34063f,_0x419f9d[_0x4a16('0x4a')]);var _0x51129a={'where':_0x34063f[_0x4a16('0x41')]};return db[_0x4a16('0x4b')][_0x4a16('0x28')](_0x51129a)[_0x4a16('0x1b')](function(_0x228c43){_0x28855b['count']=_0x228c43;if(_0x419f9d['query'][_0x4a16('0x4c')]){_0x34063f[_0x4a16('0x4d')]=[{'all':!![]}];}return db['Trunk'][_0x4a16('0x4e')](_0x34063f);})[_0x4a16('0x1b')](function(_0x23065f){_0x28855b[_0x4a16('0x4f')]=_0x23065f;return _0x28855b;})[_0x4a16('0x1b')](respondWithFilteredResult(_0x477a90,_0x34063f))['catch'](handleError(_0x477a90,null));};exports['show']=function(_0x87ee89,_0x1b22b6){var _0x5b198f={'raw':![],'where':{'id':_0x87ee89[_0x4a16('0x50')]['id']}},_0x343317={};_0x343317[_0x4a16('0x34')]=_[_0x4a16('0x36')](db['Trunk'][_0x4a16('0x51')]);_0x343317['query']=_[_0x4a16('0x36')](_0x87ee89[_0x4a16('0x35')]);_0x343317[_0x4a16('0x37')]=_[_0x4a16('0x38')](_0x343317[_0x4a16('0x34')],_0x343317[_0x4a16('0x35')]);_0x5b198f[_0x4a16('0x39')]=_[_0x4a16('0x38')](_0x343317['model'],qs[_0x4a16('0x3a')](_0x87ee89[_0x4a16('0x35')][_0x4a16('0x3a')]));_0x5b198f[_0x4a16('0x39')]=_0x5b198f[_0x4a16('0x39')][_0x4a16('0x3b')]?_0x5b198f[_0x4a16('0x39')]:_0x343317[_0x4a16('0x34')];if(_0x87ee89[_0x4a16('0x35')][_0x4a16('0x4c')]){_0x5b198f[_0x4a16('0x4d')]=[{'all':!![]}];}_0x5b198f=_[_0x4a16('0x44')]({},_0x5b198f,_0x87ee89[_0x4a16('0x4a')]);return db['Trunk'][_0x4a16('0x52')](_0x5b198f)[_0x4a16('0x1b')](handleEntityNotFound(_0x1b22b6,null))[_0x4a16('0x1b')](respondWithResult(_0x1b22b6,null))[_0x4a16('0x24')](handleError(_0x1b22b6,null));};exports[_0x4a16('0x53')]=function(_0x9cd7a9,_0x5954ef){var _0x2106e4={'raw':![],'where':{'id':_0x9cd7a9[_0x4a16('0x50')]['id']}},_0x362270={};_0x362270['model']=_[_0x4a16('0x36')](db[_0x4a16('0x4b')]['rawAttributes']);_0x2106e4[_0x4a16('0x39')]=_[_0x4a16('0x38')](_0x362270[_0x4a16('0x34')],qs[_0x4a16('0x3a')](_0x9cd7a9[_0x4a16('0x35')][_0x4a16('0x3a')]));_0x2106e4['attributes']=_0x2106e4[_0x4a16('0x39')]['length']?_0x2106e4[_0x4a16('0x39')]:_0x362270[_0x4a16('0x34')];if(_0x9cd7a9[_0x4a16('0x35')]['includeAll']){_0x2106e4['include']=[{'all':!![]}];}_0x2106e4=_[_0x4a16('0x44')]({},_0x2106e4,_0x9cd7a9[_0x4a16('0x4a')]);return db[_0x4a16('0x4b')][_0x4a16('0x52')](_0x2106e4)[_0x4a16('0x1b')](handleEntityNotFound(_0x5954ef,null))[_0x4a16('0x1b')](function(_0x27e0f5){if(_0x27e0f5){var _0x22dece=_0x27e0f5['get']({'plain':!![]});_0x22dece=qs['omit'](_0x22dece,['id',_0x4a16('0x54'),_0x4a16('0x55')]);_0x9cd7a9['body']=_[_0x4a16('0x56')](_0x9cd7a9[_0x4a16('0x57')],['id',_0x4a16('0x54'),_0x4a16('0x55')]);return db['Trunk']['create'](_[_0x4a16('0x44')](_0x22dece,_0x9cd7a9['body']),{'include':_0x9cd7a9['query'][_0x4a16('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x3f9898){var _0x5b7021=_0x9cd7a9[_0x4a16('0x58')][_0x4a16('0x2e')]({'plain':!![]});if(!_0x5b7021)throw new Error(_0x4a16('0x59'));if(_0x5b7021['role']===_0x4a16('0x58')){var _0x445b3a=_0x3f9898[_0x4a16('0x2e')]({'plain':!![]});var _0xb6779a=_0x4a16('0x2f');return db[_0x4a16('0x5a')][_0x4a16('0x52')]({'where':{'name':_0xb6779a,'userProfileId':_0x5b7021[_0x4a16('0x5b')]},'raw':!![]})[_0x4a16('0x1b')](function(_0xfee474){if(_0xfee474&&_0xfee474[_0x4a16('0x5c')]===0x0){return db['UserProfileResource'][_0x4a16('0x5d')]({'name':_0x445b3a[_0x4a16('0x32')],'resourceId':_0x445b3a['id'],'type':_0xfee474['name'],'sectionId':_0xfee474['id']},{})['then'](function(){return _0x3f9898;});}else{return _0x3f9898;}})[_0x4a16('0x24')](function(_0x472482){logger['error'](_0x4a16('0x5e'),_0x472482);throw _0x472482;});}return _0x3f9898;});}})[_0x4a16('0x1b')](respondWithResult(_0x5954ef,0xc9))['catch'](handleError(_0x5954ef,null));};exports[_0x4a16('0x5d')]=function(_0x390697,_0x20322b,_0x4efd37){var _0x1e3033;return db['Trunk'][_0x4a16('0x5d')](_0x390697[_0x4a16('0x57')],{'raw':!![]})[_0x4a16('0x1b')](function(_0x7cbf57){_0x1e3033=_0x7cbf57;return db[_0x4a16('0x4b')][_0x4a16('0x4e')]({'raw':!![]});})[_0x4a16('0x1b')](function(_0x512575){var _0x5986b8=fs['readFileSync'](path[_0x4a16('0x5f')](config[_0x4a16('0x60')],'server/files/templates/trunk.ejs'),'utf8');var _0x2bd537=fs['readFileSync'](path[_0x4a16('0x5f')](config[_0x4a16('0x60')],'server/files/templates/registry.ejs'),_0x4a16('0x61'));var _0x420cca=ejs[_0x4a16('0x62')](_0x5986b8,{'trunks':_0x512575||[]});fs[_0x4a16('0x63')](_0x4a16('0x64'),_0x420cca);if(_0x1e3033[_0x4a16('0x65')]){var _0x163a81=ejs[_0x4a16('0x62')](_0x2bd537,{'trunks':_0x512575||[]});fs[_0x4a16('0x63')](_0x4a16('0x66'),_0x163a81);}})[_0x4a16('0x1b')](function(){return respondWithRpcPromise('Reload',_0x4a16('0x5d'),{'module':'chan_sip.so'});})[_0x4a16('0x1b')](function(){var _0x5bb267=_0x390697[_0x4a16('0x58')]['get']({'plain':!![]});if(!_0x5bb267)throw new Error(_0x4a16('0x59'));if(_0x5bb267[_0x4a16('0x67')]===_0x4a16('0x58')){var _0x2a063e=_0x1e3033[_0x4a16('0x2e')]({'plain':!![]});return db[_0x4a16('0x5a')]['find']({'where':{'name':_0x4a16('0x2f'),'userProfileId':_0x5bb267['userProfileId']},'raw':!![]})[_0x4a16('0x1b')](function(_0x4d4a16){if(_0x4d4a16&&_0x4d4a16['autoAssociation']===0x0){return db[_0x4a16('0x30')][_0x4a16('0x5d')]({'name':_0x2a063e[_0x4a16('0x32')],'resourceId':_0x2a063e['id'],'type':_0x4d4a16['name'],'sectionId':_0x4d4a16['id']},{})[_0x4a16('0x1b')](function(){return _0x1e3033;});}else{return _0x1e3033;}})[_0x4a16('0x24')](function(_0x486937){logger[_0x4a16('0x20')](_0x4a16('0x5e'),_0x486937);throw _0x486937;});}return _0x1e3033;})['then'](respondWithResult(_0x20322b,0xc9))[_0x4a16('0x24')](handleError(_0x20322b,null));};exports['update']=function(_0x581cbe,_0x3cbc42,_0x6d3ba){var _0xa97806;return db[_0x4a16('0x4b')][_0x4a16('0x52')]({'where':{'id':_0x581cbe[_0x4a16('0x50')]['id']}})[_0x4a16('0x1b')](handleEntityNotFound(_0x3cbc42,null))['then'](saveUpdates(_0x581cbe[_0x4a16('0x57')],null))[_0x4a16('0x1b')](function(_0x53b448){if(_0x53b448){_0xa97806=_0x53b448;return db[_0x4a16('0x4b')][_0x4a16('0x4e')]({'raw':!![]});}})[_0x4a16('0x1b')](function(_0x2e99a5){if(_0x2e99a5){var _0x53af65=fs[_0x4a16('0x68')](path[_0x4a16('0x5f')](config[_0x4a16('0x60')],_0x4a16('0x69')),'utf8');var _0x4d6afb=fs[_0x4a16('0x68')](path[_0x4a16('0x5f')](config[_0x4a16('0x60')],_0x4a16('0x6a')),_0x4a16('0x61'));var _0x5cd22c=ejs[_0x4a16('0x62')](_0x53af65,{'trunks':_0x2e99a5||[]});fs[_0x4a16('0x63')](_0x4a16('0x64'),_0x5cd22c);var _0x2c55ca=ejs[_0x4a16('0x62')](_0x4d6afb,{'trunks':_0x2e99a5||[]});fs[_0x4a16('0x63')](_0x4a16('0x66'),_0x2c55ca);return respondWithRpcPromise('Reload',_0x4a16('0x6b'),{'module':_0x4a16('0x6c')});}return null;})[_0x4a16('0x1b')](function(_0x389719){if(_0x389719){return _0xa97806;}})['then'](respondWithResult(_0x3cbc42,null))['catch'](handleError(_0x3cbc42,null));};exports[_0x4a16('0x2d')]=function(_0x202eba,_0x2ac20b,_0x321e4c){var _0x59e0f0;return db[_0x4a16('0x4b')][_0x4a16('0x52')]({'where':{'id':_0x202eba[_0x4a16('0x50')]['id']}})[_0x4a16('0x1b')](handleEntityNotFound(_0x2ac20b,null))[_0x4a16('0x1b')](removeEntity(_0x2ac20b,null))[_0x4a16('0x1b')](function(){return db[_0x4a16('0x4b')][_0x4a16('0x4e')]({'raw':!![]});})[_0x4a16('0x1b')](function(_0x30bd34){var _0x7fedd5=fs[_0x4a16('0x68')](path[_0x4a16('0x5f')](config[_0x4a16('0x60')],_0x4a16('0x69')),_0x4a16('0x61'));var _0x24221d=fs[_0x4a16('0x68')](path[_0x4a16('0x5f')](config['root'],_0x4a16('0x6a')),_0x4a16('0x61'));var _0x58888a=ejs[_0x4a16('0x62')](_0x7fedd5,{'trunks':_0x30bd34});var _0x119104=ejs[_0x4a16('0x62')](_0x24221d,{'trunks':_0x30bd34});fs['writeFileSync'](_0x4a16('0x64'),_0x58888a);fs[_0x4a16('0x63')](_0x4a16('0x66'),_0x119104);return respondWithRpcPromise(_0x4a16('0x6d'),_0x4a16('0x2d'),{'module':_0x4a16('0x6c')});})[_0x4a16('0x24')](handleError(_0x2ac20b,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 00de8db..8561483 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 _0x3561=['../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x10f95f,_0xe0a31b){var _0x191874=function(_0x50b95a){while(--_0x50b95a){_0x10f95f['push'](_0x10f95f['shift']());}};_0x191874(++_0xe0a31b);}(_0x3561,0x94));var _0x1356=function(_0x3ee9b6,_0x47db19){_0x3ee9b6=_0x3ee9b6-0x0;var _0xcc8440=_0x3561[_0x3ee9b6];return _0xcc8440;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var logger=require(_0x1356('0x1'))(_0x1356('0x2'));var moment=require(_0x1356('0x3'));var BPromise=require(_0x1356('0x4'));var rp=require(_0x1356('0x5'));var fs=require('fs');var path=require(_0x1356('0x6'));var rimraf=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var attributes=require(_0x1356('0x9'));module[_0x1356('0xa')]=function(_0x417d11,_0x36e81f){return _0x417d11[_0x1356('0xb')]('Trunk',attributes,{'tableName':_0x1356('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e6=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','tools_trunks'];(function(_0x216f7d,_0x496249){var _0xc49d7f=function(_0x27be52){while(--_0x27be52){_0x216f7d['push'](_0x216f7d['shift']());}};_0xc49d7f(++_0x496249);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x40abe0,_0x44642b){_0x40abe0=_0x40abe0-0x0;var _0x2637be=_0xa3e6[_0x40abe0];return _0x2637be;};'use strict';var _=require(_0x6a3e('0x0'));var util=require('util');var logger=require(_0x6a3e('0x1'))('api');var moment=require(_0x6a3e('0x2'));var BPromise=require(_0x6a3e('0x3'));var rp=require(_0x6a3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a3e('0x5'));var config=require('../../config/environment');var attributes=require(_0x6a3e('0x6'));module[_0x6a3e('0x7')]=function(_0x1c7709,_0x315ed8){return _0x1c7709[_0x6a3e('0x8')]('Trunk',attributes,{'tableName':_0x6a3e('0x9'),'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 3633966..ffdcee5 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 _0x74b7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','options','raw','limit','include','map','model','attributes','ShowTrunk','find','lodash','util','moment','bluebird','randomstring'];(function(_0x2016bb,_0x1ea54d){var _0x78113b=function(_0x70ae0b){while(--_0x70ae0b){_0x2016bb['push'](_0x2016bb['shift']());}};_0x78113b(++_0x1ea54d);}(_0x74b7,0x12d));var _0x774b=function(_0x1d6014,_0x41b4ed){_0x1d6014=_0x1d6014-0x0;var _0x56d86d=_0x74b7[_0x1d6014];return _0x56d86d;};'use strict';var _=require(_0x774b('0x0'));var util=require(_0x774b('0x1'));var moment=require(_0x774b('0x2'));var BPromise=require(_0x774b('0x3'));var rs=require(_0x774b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x774b('0x5'))['db'];var utils=require(_0x774b('0x6'));var logger=require(_0x774b('0x7'))('rpc');var config=require(_0x774b('0x8'));var jayson=require(_0x774b('0x9'));var client=jayson[_0x774b('0xa')][_0x774b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c95f,_0x1bfe50,_0x565e88){return new BPromise(function(_0xebd772,_0x4597e1){return client[_0x774b('0xc')](_0x29c95f,_0x565e88)[_0x774b('0xd')](function(_0x8a385){logger['info'](_0x774b('0xe'),_0x1bfe50,_0x774b('0xf'));logger[_0x774b('0x10')](_0x774b('0x11'),_0x1bfe50,_0x774b('0xf'),JSON[_0x774b('0x12')](_0x8a385));if(_0x8a385[_0x774b('0x13')]){if(_0x8a385[_0x774b('0x13')]['code']===0x1f4){logger['error'](_0x774b('0xe'),_0x1bfe50,_0x8a385[_0x774b('0x13')][_0x774b('0x14')]);return _0x4597e1(_0x8a385[_0x774b('0x13')]['message']);}logger[_0x774b('0x13')](_0x774b('0xe'),_0x1bfe50,_0x8a385[_0x774b('0x13')][_0x774b('0x14')]);return _0xebd772(_0x8a385[_0x774b('0x13')]['message']);}else{logger['info'](_0x774b('0xe'),_0x1bfe50,_0x774b('0xf'));_0xebd772(_0x8a385[_0x774b('0x15')][_0x774b('0x14')]);}})[_0x774b('0x16')](function(_0x20dc82){logger[_0x774b('0x13')]('Trunk,\x20%s,\x20%s',_0x1bfe50,_0x20dc82);_0x4597e1(_0x20dc82);});});}exports[_0x774b('0x17')]=function(_0x136e88){var _0x2ca34b=this;return new Promise(function(_0x356e38,_0x27f7b7){return db[_0x774b('0x18')]['findAll']({'raw':_0x136e88[_0x774b('0x19')]?_0x136e88[_0x774b('0x19')][_0x774b('0x1a')]===undefined?!![]:![]:!![],'where':_0x136e88[_0x774b('0x19')]?_0x136e88[_0x774b('0x19')]['where']||null:null,'attributes':_0x136e88['options']?_0x136e88['options']['attributes']||null:null,'limit':_0x136e88[_0x774b('0x19')]?_0x136e88[_0x774b('0x19')][_0x774b('0x1b')]||null:null,'include':_0x136e88['options']?_0x136e88['options'][_0x774b('0x1c')]?_[_0x774b('0x1d')](_0x136e88[_0x774b('0x19')]['include'],function(_0x4fe258){return{'model':db[_0x4fe258[_0x774b('0x1e')]],'as':_0x4fe258['as'],'attributes':_0x4fe258[_0x774b('0x1f')],'include':_0x4fe258['include']?_['map'](_0x4fe258[_0x774b('0x1c')],function(_0x2d06ab){return{'model':db[_0x2d06ab['model']],'as':_0x2d06ab['as'],'attributes':_0x2d06ab[_0x774b('0x1f')],'include':_0x2d06ab[_0x774b('0x1c')]?_[_0x774b('0x1d')](_0x2d06ab[_0x774b('0x1c')],function(_0x5e5819){return{'model':db[_0x5e5819[_0x774b('0x1e')]],'as':_0x5e5819['as'],'attributes':_0x5e5819['attributes']};}):[]};}):[]};}):[]:[]})[_0x774b('0xd')](function(_0x297858){logger['info'](_0x774b('0x17'),_0x136e88);logger[_0x774b('0x10')](_0x774b('0x17'),_0x136e88,JSON[_0x774b('0x12')](_0x297858));_0x356e38(_0x297858);})[_0x774b('0x16')](function(_0x449aa8){logger[_0x774b('0x13')](_0x774b('0x17'),_0x449aa8[_0x774b('0x14')],_0x136e88);_0x27f7b7(_0x2ca34b[_0x774b('0x13')](0x1f4,_0x449aa8['message']));});});};exports[_0x774b('0x20')]=function(_0x3293fe){var _0x33762d=this;return new Promise(function(_0x441c88,_0x137ffe){return db[_0x774b('0x18')][_0x774b('0x21')]({'raw':_0x3293fe[_0x774b('0x19')]?_0x3293fe[_0x774b('0x19')][_0x774b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3293fe['options']?_0x3293fe[_0x774b('0x19')]['where']||null:null,'attributes':_0x3293fe['options']?_0x3293fe[_0x774b('0x19')][_0x774b('0x1f')]||null:null,'include':_0x3293fe[_0x774b('0x19')]?_0x3293fe['options'][_0x774b('0x1c')]?_['map'](_0x3293fe[_0x774b('0x19')]['include'],function(_0x3e8039){return{'model':db[_0x3e8039[_0x774b('0x1e')]],'as':_0x3e8039['as'],'attributes':_0x3e8039['attributes'],'include':_0x3e8039[_0x774b('0x1c')]?_[_0x774b('0x1d')](_0x3e8039[_0x774b('0x1c')],function(_0x580b7c){return{'model':db[_0x580b7c['model']],'as':_0x580b7c['as'],'attributes':_0x580b7c[_0x774b('0x1f')],'include':_0x580b7c[_0x774b('0x1c')]?_['map'](_0x580b7c[_0x774b('0x1c')],function(_0x413153){return{'model':db[_0x413153[_0x774b('0x1e')]],'as':_0x413153['as'],'attributes':_0x413153[_0x774b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x774b('0xd')](function(_0x80db3){logger['info']('ShowTrunk',_0x3293fe);logger[_0x774b('0x10')](_0x774b('0x20'),_0x3293fe,JSON['stringify'](_0x80db3));_0x441c88(_0x80db3);})[_0x774b('0x16')](function(_0x78bdd5){logger[_0x774b('0x13')](_0x774b('0x20'),_0x78bdd5[_0x774b('0x14')],_0x3293fe);_0x137ffe(_0x33762d[_0x774b('0x13')](0x1f4,_0x78bdd5['message']));});});}; \ No newline at end of file +var _0x28d3=['findAll','options','raw','where','limit','include','map','model','attributes','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetTrunk','Trunk'];(function(_0x118c2f,_0x3b13f0){var _0x5c1edc=function(_0x5ed127){while(--_0x5ed127){_0x118c2f['push'](_0x118c2f['shift']());}};_0x5c1edc(++_0x3b13f0);}(_0x28d3,0xbf));var _0x328d=function(_0x1d4a8,_0x5d6cf6){_0x1d4a8=_0x1d4a8-0x0;var _0x17a945=_0x28d3[_0x1d4a8];return _0x17a945;};'use strict';var _=require(_0x328d('0x0'));var util=require(_0x328d('0x1'));var moment=require(_0x328d('0x2'));var BPromise=require(_0x328d('0x3'));var rs=require(_0x328d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x328d('0x5'))['db'];var utils=require(_0x328d('0x6'));var logger=require('../../config/logger')(_0x328d('0x7'));var config=require(_0x328d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x328d('0x9')][_0x328d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528e26,_0x2d85ef,_0x59989e){return new BPromise(function(_0x36b80e,_0x2aa7b1){return client[_0x328d('0xb')](_0x528e26,_0x59989e)[_0x328d('0xc')](function(_0x3085b5){logger['info'](_0x328d('0xd'),_0x2d85ef,_0x328d('0xe'));logger[_0x328d('0xf')](_0x328d('0x10'),_0x2d85ef,_0x328d('0xe'),JSON[_0x328d('0x11')](_0x3085b5));if(_0x3085b5[_0x328d('0x12')]){if(_0x3085b5[_0x328d('0x12')][_0x328d('0x13')]===0x1f4){logger[_0x328d('0x12')](_0x328d('0xd'),_0x2d85ef,_0x3085b5[_0x328d('0x12')][_0x328d('0x14')]);return _0x2aa7b1(_0x3085b5['error']['message']);}logger[_0x328d('0x12')]('Trunk,\x20%s,\x20%s',_0x2d85ef,_0x3085b5[_0x328d('0x12')]['message']);return _0x36b80e(_0x3085b5[_0x328d('0x12')][_0x328d('0x14')]);}else{logger[_0x328d('0x15')](_0x328d('0xd'),_0x2d85ef,_0x328d('0xe'));_0x36b80e(_0x3085b5['result'][_0x328d('0x14')]);}})[_0x328d('0x16')](function(_0x3c0940){logger[_0x328d('0x12')](_0x328d('0xd'),_0x2d85ef,_0x3c0940);_0x2aa7b1(_0x3c0940);});});}exports[_0x328d('0x17')]=function(_0xf0bf79){var _0x1c2533=this;return new Promise(function(_0xb034a5,_0x15a4ae){return db[_0x328d('0x18')][_0x328d('0x19')]({'raw':_0xf0bf79[_0x328d('0x1a')]?_0xf0bf79['options'][_0x328d('0x1b')]===undefined?!![]:![]:!![],'where':_0xf0bf79[_0x328d('0x1a')]?_0xf0bf79[_0x328d('0x1a')][_0x328d('0x1c')]||null:null,'attributes':_0xf0bf79[_0x328d('0x1a')]?_0xf0bf79[_0x328d('0x1a')]['attributes']||null:null,'limit':_0xf0bf79[_0x328d('0x1a')]?_0xf0bf79[_0x328d('0x1a')][_0x328d('0x1d')]||null:null,'include':_0xf0bf79[_0x328d('0x1a')]?_0xf0bf79['options'][_0x328d('0x1e')]?_[_0x328d('0x1f')](_0xf0bf79[_0x328d('0x1a')][_0x328d('0x1e')],function(_0x46e939){return{'model':db[_0x46e939[_0x328d('0x20')]],'as':_0x46e939['as'],'attributes':_0x46e939[_0x328d('0x21')],'include':_0x46e939[_0x328d('0x1e')]?_[_0x328d('0x1f')](_0x46e939[_0x328d('0x1e')],function(_0x3c2b1f){return{'model':db[_0x3c2b1f[_0x328d('0x20')]],'as':_0x3c2b1f['as'],'attributes':_0x3c2b1f['attributes'],'include':_0x3c2b1f[_0x328d('0x1e')]?_[_0x328d('0x1f')](_0x3c2b1f['include'],function(_0x3fa2a2){return{'model':db[_0x3fa2a2['model']],'as':_0x3fa2a2['as'],'attributes':_0x3fa2a2['attributes']};}):[]};}):[]};}):[]:[]})[_0x328d('0xc')](function(_0x2929e9){logger[_0x328d('0x15')](_0x328d('0x17'),_0xf0bf79);logger[_0x328d('0xf')](_0x328d('0x17'),_0xf0bf79,JSON['stringify'](_0x2929e9));_0xb034a5(_0x2929e9);})[_0x328d('0x16')](function(_0x17abfb){logger[_0x328d('0x12')](_0x328d('0x17'),_0x17abfb[_0x328d('0x14')],_0xf0bf79);_0x15a4ae(_0x1c2533[_0x328d('0x12')](0x1f4,_0x17abfb['message']));});});};exports[_0x328d('0x22')]=function(_0x5228ba){var _0x1efbbd=this;return new Promise(function(_0x3a8b96,_0x384cf5){return db['Trunk'][_0x328d('0x23')]({'raw':_0x5228ba[_0x328d('0x1a')]?_0x5228ba['options']['raw']===undefined?!![]:![]:!![],'where':_0x5228ba[_0x328d('0x1a')]?_0x5228ba[_0x328d('0x1a')][_0x328d('0x1c')]||null:null,'attributes':_0x5228ba[_0x328d('0x1a')]?_0x5228ba[_0x328d('0x1a')][_0x328d('0x21')]||null:null,'include':_0x5228ba[_0x328d('0x1a')]?_0x5228ba['options'][_0x328d('0x1e')]?_[_0x328d('0x1f')](_0x5228ba[_0x328d('0x1a')][_0x328d('0x1e')],function(_0x48dae0){return{'model':db[_0x48dae0['model']],'as':_0x48dae0['as'],'attributes':_0x48dae0[_0x328d('0x21')],'include':_0x48dae0[_0x328d('0x1e')]?_[_0x328d('0x1f')](_0x48dae0[_0x328d('0x1e')],function(_0x32655b){return{'model':db[_0x32655b[_0x328d('0x20')]],'as':_0x32655b['as'],'attributes':_0x32655b[_0x328d('0x21')],'include':_0x32655b[_0x328d('0x1e')]?_[_0x328d('0x1f')](_0x32655b[_0x328d('0x1e')],function(_0x350866){return{'model':db[_0x350866[_0x328d('0x20')]],'as':_0x350866['as'],'attributes':_0x350866[_0x328d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x328d('0xc')](function(_0x21e1b9){logger[_0x328d('0x15')](_0x328d('0x22'),_0x5228ba);logger[_0x328d('0xf')](_0x328d('0x22'),_0x5228ba,JSON[_0x328d('0x11')](_0x21e1b9));_0x3a8b96(_0x21e1b9);})[_0x328d('0x16')](function(_0x17bfaa){logger['error'](_0x328d('0x22'),_0x17bfaa['message'],_0x5228ba);_0x384cf5(_0x1efbbd[_0x328d('0x12')](0x1f4,_0x17bfaa[_0x328d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 2cf6975..1ed2939 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 _0xc15c=['/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','/create_many','bulkCreate','post','create','addQueues','diskStorage','join','server/files/images/','format','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addSquareProjects','createApiKey','put','update','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','/:id/mail_accounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','path','connect-timeout','express','../../components/auth/service','./user.controller','index','get','describe','/:id','isAuthenticated','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','/:id/recordings','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions'];(function(_0xa1b538,_0x4528bc){var _0x1384b3=function(_0x4a4c96){while(--_0x4a4c96){_0xa1b538['push'](_0xa1b538['shift']());}};_0x1384b3(++_0x4528bc);}(_0xc15c,0xae));var _0xcc15=function(_0x55ad2c,_0x630df5){_0x55ad2c=_0x55ad2c-0x0;var _0x54b4b9=_0xc15c[_0x55ad2c];return _0x54b4b9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcc15('0x0'));var timeout=require(_0xcc15('0x1'));var express=require(_0xcc15('0x2'));var router=express['Router']();var auth=require(_0xcc15('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcc15('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xcc15('0x5')]);router[_0xcc15('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xcc15('0x7')]);router[_0xcc15('0x6')](_0xcc15('0x8'),auth[_0xcc15('0x9')](),controller[_0xcc15('0xa')]);router['get'](_0xcc15('0xb'),controller[_0xcc15('0xc')]);router[_0xcc15('0x6')](_0xcc15('0xd'),auth['isAuthenticated'](),controller[_0xcc15('0xe')]);router[_0xcc15('0x6')](_0xcc15('0xf'),auth['isAuthenticated'](),controller['getQueues']);router[_0xcc15('0x6')]('/:id/queues_rt',auth[_0xcc15('0x9')](),controller['getVoiceQueuesRt']);router[_0xcc15('0x6')]('/:id/groups',auth[_0xcc15('0x9')](),controller['getGroups']);router[_0xcc15('0x6')](_0xcc15('0x10'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x11')]);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xcc15('0x6')](_0xcc15('0x12'),auth[_0xcc15('0x9')](),controller['getChatInteractions']);router['get'](_0xcc15('0x13'),auth['isAuthenticated'](),controller[_0xcc15('0x14')]);router[_0xcc15('0x6')](_0xcc15('0x15'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xcc15('0x6')](_0xcc15('0x16'),auth['isAuthenticated'](),controller[_0xcc15('0x17')]);router[_0xcc15('0x6')](_0xcc15('0x18'),auth['isAuthenticated'](),controller[_0xcc15('0x19')]);router['get'](_0xcc15('0x1a'),auth['isAuthenticated'](),controller[_0xcc15('0x1b')]);router[_0xcc15('0x6')](_0xcc15('0x1c'),auth[_0xcc15('0x9')](),controller['getLists']);router[_0xcc15('0x6')](_0xcc15('0x1d'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x1e')]);router['get'](_0xcc15('0x1f'),auth[_0xcc15('0x9')](),controller['getVoicePrefixes']);router['get'](_0xcc15('0x20'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x21')]);router[_0xcc15('0x6')]('/:id/mail_accounts',auth[_0xcc15('0x9')](),controller[_0xcc15('0x22')]);router['get'](_0xcc15('0x23'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xcc15('0x6')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xcc15('0x24')]);router[_0xcc15('0x6')](_0xcc15('0x25'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x26')]);router['get'](_0xcc15('0x27'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x28')]);router[_0xcc15('0x6')](_0xcc15('0x29'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x2a')]);router[_0xcc15('0x6')](_0xcc15('0x2b'),auth[_0xcc15('0x9')](),controller['getApiKey']);router['post'](_0xcc15('0x2c'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x2d')]);router[_0xcc15('0x2e')](_0xcc15('0xd'),auth[_0xcc15('0x9')](),controller['addContacts']);router[_0xcc15('0x2e')]('/',auth['isAuthenticated'](),controller[_0xcc15('0x2f')]);router[_0xcc15('0x2e')](_0xcc15('0xf'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x30')]);var upload=multer({'storage':multer[_0xcc15('0x31')]({'destination':function(_0x422b97,_0x1ac2aa,_0x2926f4){_0x2926f4(null,path[_0xcc15('0x32')](config['root'],_0xcc15('0x33')));},'filename':function(_0x2b6702,_0x36a190,_0x1494f1){_0x1494f1(null,util[_0xcc15('0x34')]('%s-%s',Date[_0xcc15('0x35')](),_0x36a190[_0xcc15('0x36')]));}})});router[_0xcc15('0x2e')]('/:id/avatar',upload['single'](_0xcc15('0x37')),controller[_0xcc15('0x38')]);router['post'](_0xcc15('0x39'),auth['isAuthenticated'](),controller[_0xcc15('0x3a')]);router[_0xcc15('0x2e')](_0xcc15('0x3b'),auth[_0xcc15('0x9')](),controller['logout']);router[_0xcc15('0x2e')](_0xcc15('0x3c'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x3d')]);router[_0xcc15('0x2e')](_0xcc15('0x3e'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x3f')]);router[_0xcc15('0x2e')](_0xcc15('0x1a'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x40')]);router[_0xcc15('0x2e')](_0xcc15('0x41'),auth[_0xcc15('0x9')](),controller['addChatInteractions']);router[_0xcc15('0x2e')](_0xcc15('0x42'),auth['isAuthenticated'](),controller[_0xcc15('0x43')]);router[_0xcc15('0x2e')](_0xcc15('0x44'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x45')]);router[_0xcc15('0x2e')](_0xcc15('0x46'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x47')]);router[_0xcc15('0x2e')](_0xcc15('0x48'),auth[_0xcc15('0x9')](),controller['addOpenchannelInteractions']);router['post'](_0xcc15('0x20'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x49')]);router[_0xcc15('0x2e')]('/:id/mail_accounts',auth[_0xcc15('0x9')](),controller[_0xcc15('0x4a')]);router['post']('/:id/openchannel_accounts',auth[_0xcc15('0x9')](),controller[_0xcc15('0x4b')]);router[_0xcc15('0x2e')](_0xcc15('0x4c'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x4d')]);router['post'](_0xcc15('0x25'),auth[_0xcc15('0x9')](),controller['addChatWebsites']);router[_0xcc15('0x2e')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xcc15('0x4e')]);router['post'](_0xcc15('0x2b'),auth['isAuthenticated'](),controller[_0xcc15('0x4f')]);router[_0xcc15('0x50')](_0xcc15('0x8'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x51')]);router[_0xcc15('0x50')]('/:id/password',auth[_0xcc15('0x9')](),controller[_0xcc15('0x52')]);router['delete'](_0xcc15('0xf'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x53')]);router[_0xcc15('0x54')]('/:id/teams',auth[_0xcc15('0x9')](),controller[_0xcc15('0x55')]);router[_0xcc15('0x54')](_0xcc15('0x8'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x56')]);router[_0xcc15('0x54')](_0xcc15('0x41'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x57')]);router[_0xcc15('0x54')](_0xcc15('0x42'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x58')]);router[_0xcc15('0x54')](_0xcc15('0x44'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router['delete']('/:id/sms_interactions',auth[_0xcc15('0x9')](),controller[_0xcc15('0x59')]);router[_0xcc15('0x54')](_0xcc15('0x48'),auth['isAuthenticated'](),controller[_0xcc15('0x5a')]);router[_0xcc15('0x54')](_0xcc15('0x20'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x5b')]);router[_0xcc15('0x54')](_0xcc15('0x5c'),auth['isAuthenticated'](),controller[_0xcc15('0x5d')]);router[_0xcc15('0x54')](_0xcc15('0x23'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x5e')]);router['delete'](_0xcc15('0x4c'),auth[_0xcc15('0x9')](),controller['removeSmsAccounts']);router[_0xcc15('0x54')]('/:id/chat_websites',auth[_0xcc15('0x9')](),controller[_0xcc15('0x5f')]);router[_0xcc15('0x54')](_0xcc15('0x27'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x60')]);router[_0xcc15('0x54')](_0xcc15('0x2b'),auth[_0xcc15('0x9')](),controller[_0xcc15('0x61')]);module[_0xcc15('0x62')]=router; \ No newline at end of file +var _0xb235=['getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','bulkCreate','/:id/contacts','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','/:id/password','changePassword','removeQueues','delete','/:id/teams','removeTeams','destroy','removeMailInteractions','/:id/sms_interactions','removeFaxAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/avatar','getAvatar','/:id/queues'];(function(_0xaba894,_0x429065){var _0x5a7d47=function(_0x676948){while(--_0x676948){_0xaba894['push'](_0xaba894['shift']());}};_0x5a7d47(++_0x429065);}(_0xb235,0xb5));var _0x5b23=function(_0x341c44,_0x2e1057){_0x341c44=_0x341c44-0x0;var _0x2bda72=_0xb235[_0x341c44];return _0x2bda72;};'use strict';var multer=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var path=require('path');var timeout=require(_0x5b23('0x2'));var express=require(_0x5b23('0x3'));var router=express['Router']();var auth=require(_0x5b23('0x4'));var interaction=require(_0x5b23('0x5'));var config=require(_0x5b23('0x6'));var controller=require('./user.controller');router[_0x5b23('0x7')]('/',auth[_0x5b23('0x8')](),controller[_0x5b23('0x9')]);router[_0x5b23('0x7')](_0x5b23('0xa'),auth[_0x5b23('0x8')](),controller['describe']);router[_0x5b23('0x7')](_0x5b23('0xb'),auth[_0x5b23('0x8')](),controller['show']);router['get'](_0x5b23('0xc'),controller[_0x5b23('0xd')]);router[_0x5b23('0x7')]('/:id/contacts',auth[_0x5b23('0x8')](),controller['getContacts']);router[_0x5b23('0x7')](_0x5b23('0xe'),auth[_0x5b23('0x8')](),controller[_0x5b23('0xf')]);router[_0x5b23('0x7')]('/:id/queues_rt',auth[_0x5b23('0x8')](),controller[_0x5b23('0x10')]);router[_0x5b23('0x7')](_0x5b23('0x11'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x12')]);router[_0x5b23('0x7')]('/:id/recordings',auth[_0x5b23('0x8')](),controller[_0x5b23('0x13')]);router['get'](_0x5b23('0x14'),auth[_0x5b23('0x8')](),controller['getScreenRecordings']);router['get'](_0x5b23('0x15'),auth['isAuthenticated'](),controller[_0x5b23('0x16')]);router[_0x5b23('0x7')](_0x5b23('0x17'),auth[_0x5b23('0x8')](),controller['getOpenchannelInteractions']);router['get'](_0x5b23('0x18'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x19')]);router[_0x5b23('0x7')](_0x5b23('0x1a'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x1b')]);router[_0x5b23('0x7')](_0x5b23('0x1c'),auth[_0x5b23('0x8')](),controller['getFaxInteractions']);router[_0x5b23('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5b23('0x1d')]);router[_0x5b23('0x7')](_0x5b23('0x1e'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x1f')]);router[_0x5b23('0x7')](_0x5b23('0x20'),auth[_0x5b23('0x8')](),controller['getAgents']);router[_0x5b23('0x7')](_0x5b23('0x21'),auth[_0x5b23('0x8')](),controller['getVoicePrefixes']);router['get'](_0x5b23('0x22'),auth['isAuthenticated'](),controller['getFaxAccounts']);router['get']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x5b23('0x23')]);router[_0x5b23('0x7')](_0x5b23('0x24'),auth[_0x5b23('0x8')](),controller['getOpenchannelAccounts']);router[_0x5b23('0x7')]('/:id/sms_accounts',auth[_0x5b23('0x8')](),controller[_0x5b23('0x25')]);router['get'](_0x5b23('0x26'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x27')]);router['get'](_0x5b23('0x28'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x29')]);router[_0x5b23('0x7')]('/:id/scheduled_calls',auth[_0x5b23('0x8')](),controller[_0x5b23('0x2a')]);router[_0x5b23('0x7')](_0x5b23('0x2b'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x2c')]);router[_0x5b23('0x2d')]('/create_many',auth[_0x5b23('0x8')](),controller[_0x5b23('0x2e')]);router[_0x5b23('0x2d')](_0x5b23('0x2f'),auth[_0x5b23('0x8')](),controller['addContacts']);router[_0x5b23('0x2d')]('/',auth[_0x5b23('0x8')](),controller[_0x5b23('0x30')]);router[_0x5b23('0x2d')](_0x5b23('0xe'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x31')]);var upload=multer({'storage':multer[_0x5b23('0x32')]({'destination':function(_0x5e0216,_0x45011e,_0x328c03){_0x328c03(null,path[_0x5b23('0x33')](config[_0x5b23('0x34')],_0x5b23('0x35')));},'filename':function(_0x29784b,_0x2f1387,_0x24078b){_0x24078b(null,util[_0x5b23('0x36')](_0x5b23('0x37'),Date[_0x5b23('0x38')](),_0x2f1387[_0x5b23('0x39')]));}})});router['post'](_0x5b23('0xc'),upload[_0x5b23('0x3a')](_0x5b23('0x3b')),controller['addAvatar']);router[_0x5b23('0x2d')](_0x5b23('0x3c'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x3d')]);router[_0x5b23('0x2d')]('/:id/logout',auth[_0x5b23('0x8')](),controller['logout']);router[_0x5b23('0x2d')](_0x5b23('0x3e'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x3f')]);router[_0x5b23('0x2d')](_0x5b23('0x40'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x41')]);router['post']('/:id/teams',auth[_0x5b23('0x8')](),controller[_0x5b23('0x42')]);router['post'](_0x5b23('0x43'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x5b23('0x2d')]('/:id/mail_interactions',auth[_0x5b23('0x8')](),controller[_0x5b23('0x44')]);router[_0x5b23('0x2d')](_0x5b23('0x45'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x46')]);router[_0x5b23('0x2d')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x5b23('0x47')]);router[_0x5b23('0x2d')](_0x5b23('0x48'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x49')]);router['post'](_0x5b23('0x22'),auth['isAuthenticated'](),controller[_0x5b23('0x4a')]);router[_0x5b23('0x2d')](_0x5b23('0x4b'),auth[_0x5b23('0x8')](),controller['addMailAccounts']);router[_0x5b23('0x2d')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x5b23('0x4c')]);router['post']('/:id/sms_accounts',auth[_0x5b23('0x8')](),controller[_0x5b23('0x4d')]);router[_0x5b23('0x2d')]('/:id/chat_websites',auth[_0x5b23('0x8')](),controller[_0x5b23('0x4e')]);router[_0x5b23('0x2d')](_0x5b23('0x28'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x4f')]);router['post']('/:id/api_key',auth['isAuthenticated'](),controller[_0x5b23('0x50')]);router[_0x5b23('0x51')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5b23('0x51')](_0x5b23('0x52'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x53')]);router['delete'](_0x5b23('0xe'),auth['isAuthenticated'](),controller[_0x5b23('0x54')]);router[_0x5b23('0x55')](_0x5b23('0x56'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x57')]);router['delete']('/:id',auth[_0x5b23('0x8')](),controller[_0x5b23('0x58')]);router[_0x5b23('0x55')](_0x5b23('0x43'),auth[_0x5b23('0x8')](),controller['removeChatInteractions']);router[_0x5b23('0x55')]('/:id/mail_interactions',auth[_0x5b23('0x8')](),controller[_0x5b23('0x59')]);router[_0x5b23('0x55')](_0x5b23('0x45'),auth[_0x5b23('0x8')](),controller['removeFaxInteractions']);router[_0x5b23('0x55')](_0x5b23('0x5a'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0x5b23('0x55')](_0x5b23('0x48'),auth[_0x5b23('0x8')](),controller['removeOpenchannelInteractions']);router[_0x5b23('0x55')](_0x5b23('0x22'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x5b')]);router[_0x5b23('0x55')](_0x5b23('0x4b'),auth[_0x5b23('0x8')](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x5b23('0x8')](),controller[_0x5b23('0x5c')]);router[_0x5b23('0x55')](_0x5b23('0x5d'),auth[_0x5b23('0x8')](),controller['removeSmsAccounts']);router[_0x5b23('0x55')](_0x5b23('0x26'),auth['isAuthenticated'](),controller[_0x5b23('0x5e')]);router[_0x5b23('0x55')]('/:id/square_projects',auth[_0x5b23('0x8')](),controller[_0x5b23('0x5f')]);router[_0x5b23('0x55')](_0x5b23('0x2b'),auth[_0x5b23('0x8')](),controller[_0x5b23('0x60')]);module[_0x5b23('0x61')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c9c6cea..d524515 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 _0xd8b0=['map','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blockedAt','loginAttempts','sequelize','moment','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','INTEGER','callerid','DATE','BOOLEAN','friend','peer','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','actpass','update,nonat','showWebBar','isArray','udp','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'unique':_0x0d8b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x43bca1){this[_0x0d8b('0x4')](_0x0d8b('0x3'),_0x43bca1);this['setDataValue']('defaultuser',_0x43bca1);},'comment':_0x0d8b('0x5')},'fullname':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'set':function(_0x39f43a){this['setDataValue'](_0x0d8b('0x6'),_0x39f43a);this[_0x0d8b('0x4')]('callerid',util[_0x0d8b('0x7')](_0x0d8b('0x8'),_0x39f43a,this[_0x0d8b('0x9')](_0x0d8b('0xa'))));}},'alias':{'type':Sequelize[_0x0d8b('0x2')]},'email':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'unique':_0x0d8b('0xb'),'validate':{'isEmail':!![]},'set':function(_0x28f87c){if(_0x28f87c){this['setDataValue'](_0x0d8b('0xb'),_0x28f87c['toLowerCase']());}}},'role':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0xd'),_0x0d8b('0xe'),_0x0d8b('0xf'),_0x0d8b('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0d8b('0x2')],'defaultValue':_0x0d8b('0x11')},'internal':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':![],'unique':_0x0d8b('0xa'),'set':function(_0x5ad086){this[_0x0d8b('0x4')](_0x0d8b('0xa'),_0x5ad086);this[_0x0d8b('0x4')]('accountcode',_0x5ad086);this[_0x0d8b('0x4')](_0x0d8b('0x13'),util[_0x0d8b('0x7')](_0x0d8b('0x8'),this[_0x0d8b('0x9')]('fullname'),_0x5ad086));}},'salt':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'mobile':{'type':Sequelize[_0x0d8b('0x2')]},'address':{'type':Sequelize[_0x0d8b('0x2')]},'zipcode':{'type':Sequelize[_0x0d8b('0x2')]},'userpic':{'type':Sequelize[_0x0d8b('0x2')]},'city':{'type':Sequelize[_0x0d8b('0x2')]},'country':{'type':Sequelize[_0x0d8b('0x2')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0d8b('0x14')]},'voicePause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0d8b('0x2')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0d8b('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0d8b('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x16'),'user',_0x0d8b('0x17')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0d8b('0xc')]('ALLOWED_NOT_SCREENED',_0x0d8b('0x18'),'ALLOWED_FAILED_SCREEN',_0x0d8b('0x19'),'PROHIB_NOT_SCREENED',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![],'defaultValue':'udp','set':function(_0x5d05fc){this[_0x0d8b('0x4')](_0x0d8b('0x1d'),_0x5d05fc?_0x5d05fc[_0x0d8b('0x1e')](','):null);},'get':function(){return this[_0x0d8b('0x9')](_0x0d8b('0x1d'))?this[_0x0d8b('0x9')](_0x0d8b('0x1d'))[_0x0d8b('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x20'),'info',_0x0d8b('0x21'),_0x0d8b('0x22'),_0x0d8b('0x23')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no',_0x0d8b('0x25'),_0x0d8b('0x26'),_0x0d8b('0x27')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![],'defaultValue':_0x0d8b('0x28'),'set':function(_0x188af2){this[_0x0d8b('0x4')](_0x0d8b('0x29'),_0x188af2?_0x188af2['join'](','):null);},'get':function(){return this['getDataValue'](_0x0d8b('0x29'))?this['getDataValue']('nat')[_0x0d8b('0x1f')](','):null;},'comment':_0x0d8b('0x2a')},'callgroup':{'type':Sequelize[_0x0d8b('0x2')]},'namedcallgroup':{'type':Sequelize[_0x0d8b('0x2')]},'pickupgroup':{'type':Sequelize[_0x0d8b('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x0d8b('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0d8b('0x2')]},'disallow':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'defaultValue':_0x0d8b('0x2b')},'allow':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':![],'defaultValue':_0x0d8b('0x2c'),'set':function(_0x1a39ad){this[_0x0d8b('0x4')]('allow',_0x1a39ad?_0x1a39ad[_0x0d8b('0x1e')](';'):_0x0d8b('0x2c'));},'get':function(){return this[_0x0d8b('0x9')](_0x0d8b('0x2d'))?this['getDataValue'](_0x0d8b('0x2d'))['split'](';'):null;},'comment':_0x0d8b('0x2e')},'autoframing':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![],'set':function(_0x35fa7e){this[_0x0d8b('0x4')](_0x0d8b('0x2f'),_0x35fa7e?_0x35fa7e[_0x0d8b('0x1e')](','):null);},'get':function(){return this[_0x0d8b('0x9')](_0x0d8b('0x2f'))?this['getDataValue']('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x0d8b('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0d8b('0x31')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0d8b('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0d8b('0xc')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no',_0x0d8b('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x33'),_0x0d8b('0x34'),_0x0d8b('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x36'),_0x0d8b('0x37')),'allowNull':!![],'defaultValue':_0x0d8b('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':_0x0d8b('0x24')},'keepalive':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0d8b('0xc')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0d8b('0x24'),'no',_0x0d8b('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0d8b('0xc')]('active','passive',_0x0d8b('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0d8b('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no',_0x0d8b('0x25'),_0x0d8b('0x26'),_0x0d8b('0x3a')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0d8b('0x2')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0,'set':function(_0x451940){this[_0x0d8b('0x4')](_0x0d8b('0x3b'),_0x451940);var _0x43ad22=this['get']({'plain':!![]});switch(_0x451940){case 0x0:case 0x1:var _0x1e1dce=_0x43ad22[_0x0d8b('0x1d')]?_[_0x0d8b('0x3c')](_0x43ad22[_0x0d8b('0x1d')])?_0x43ad22[_0x0d8b('0x1d')]['join']():_0x43ad22['transport']:_0x0d8b('0x3d');if(_0x1e1dce===_0x0d8b('0x3e')){_0x1e1dce=_0x0d8b('0x3d');}this[_0x0d8b('0x4')]('transport',_0x1e1dce);this[_0x0d8b('0x4')](_0x0d8b('0x3f'),'no');this[_0x0d8b('0x4')]('avpf',null);this[_0x0d8b('0x4')]('force_avp',null);this[_0x0d8b('0x4')](_0x0d8b('0x40'),null);this[_0x0d8b('0x4')](_0x0d8b('0x41'),null);this[_0x0d8b('0x4')](_0x0d8b('0x42'),null);this['setDataValue'](_0x0d8b('0x43'),null);this['setDataValue'](_0x0d8b('0x44'),null);this[_0x0d8b('0x4')](_0x0d8b('0x45'),null);this[_0x0d8b('0x4')]('rtcp_mux','no');break;case 0x2:this[_0x0d8b('0x4')](_0x0d8b('0x1d'),_0x0d8b('0x3e'));this[_0x0d8b('0x4')](_0x0d8b('0x3f'),_0x0d8b('0x24'));this[_0x0d8b('0x4')](_0x0d8b('0x46'),_0x0d8b('0x24'));this[_0x0d8b('0x4')]('force_avp','yes');this[_0x0d8b('0x4')](_0x0d8b('0x40'),'yes');this[_0x0d8b('0x4')]('dtlsenable','yes');this[_0x0d8b('0x4')](_0x0d8b('0x42'),'no');this['setDataValue']('dtlssetup',_0x0d8b('0x39'));this[_0x0d8b('0x4')](_0x0d8b('0x44'),_0x43ad22[_0x0d8b('0x44')]||_0x0d8b('0x47'));this[_0x0d8b('0x4')](_0x0d8b('0x45'),_0x43ad22['dtlsprivatekey']||_0x0d8b('0x48'));this['setDataValue'](_0x0d8b('0x49'),_0x0d8b('0x24'));break;default:}}},'permissions':{'type':Sequelize[_0x0d8b('0x4a')],'set':function(_0x14a34b){this['setDataValue'](_0x0d8b('0x4b'),_0x14a34b?_0x14a34b['join'](','):[]);},'get':function(){return this[_0x0d8b('0x9')](_0x0d8b('0x4b'))?_[_0x0d8b('0x4c')](this[_0x0d8b('0x9')](_0x0d8b('0x4b'))[_0x0d8b('0x1f')](','),function(_0x3e927c){return parseInt(_0x3e927c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0d8b('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0d8b('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0d8b('0x2')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0d8b('0xc')](_0x0d8b('0x24'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0d8b('0x2')]},'passwordResetAt':{'type':Sequelize[_0x0d8b('0x14')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0d8b('0x9')](_0x0d8b('0x4d'))?this['getDataValue'](_0x0d8b('0x4d')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0d8b('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0d8b('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![],'set':function(_0x5007c0){if(typeof _0x5007c0===_0x0d8b('0x4e')){var _0x16df83=_0x5007c0==='1'?!![]:_0x5007c0==='0'?![]:_0x5007c0==='true'?!![]:_0x5007c0===_0x0d8b('0x4f')?![]:![];this[_0x0d8b('0x4')](_0x0d8b('0x50'),_0x16df83);}else{this['setDataValue']('screenrecording',_0x5007c0);}}},'blocked':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![],'set':function(_0x3aeb45){this[_0x0d8b('0x4')]('blocked',_0x3aeb45);if(_0x3aeb45===!![]){this['setDataValue'](_0x0d8b('0x51'),moment());this[_0x0d8b('0x4')](_0x0d8b('0x52'),0x0);}else{this[_0x0d8b('0x4')](_0x0d8b('0x51'),null);}}},'blockedAt':{'type':Sequelize[_0x0d8b('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0d8b('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0d8b('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0xbaf0=['wss','encryption','avpf','icesupport','dtlsenable','rtcp_mux','force_avp','dtlsverify','dtlssetup','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','user','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update,nonat','showWebBar','get'];(function(_0x2e9620,_0x3cacda){var _0x4dad51=function(_0x1ecda4){while(--_0x1ecda4){_0x2e9620['push'](_0x2e9620['shift']());}};_0x4dad51(++_0x3cacda);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var _=require(_0x0baf('0x2'));module[_0x0baf('0x3')]={'name':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5a3e42){this[_0x0baf('0x6')](_0x0baf('0x5'),_0x5a3e42);this[_0x0baf('0x6')](_0x0baf('0x7'),_0x5a3e42);},'comment':_0x0baf('0x8')},'fullname':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'set':function(_0x1a10b1){this[_0x0baf('0x6')](_0x0baf('0x9'),_0x1a10b1);this['setDataValue'](_0x0baf('0xa'),util['format'](_0x0baf('0xb'),_0x1a10b1,this[_0x0baf('0xc')](_0x0baf('0xd'))));}},'alias':{'type':Sequelize[_0x0baf('0x4')]},'email':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'unique':_0x0baf('0xe'),'validate':{'isEmail':!![]},'set':function(_0x41cead){if(_0x41cead){this[_0x0baf('0x6')](_0x0baf('0xe'),_0x41cead[_0x0baf('0xf')]());}}},'role':{'type':Sequelize[_0x0baf('0x10')]('admin','user',_0x0baf('0x11'),_0x0baf('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x1c76a8){this[_0x0baf('0x6')](_0x0baf('0xd'),_0x1c76a8);this[_0x0baf('0x6')](_0x0baf('0x14'),_0x1c76a8);this[_0x0baf('0x6')]('callerid',util['format'](_0x0baf('0xb'),this[_0x0baf('0xc')](_0x0baf('0x9')),_0x1c76a8));}},'salt':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize[_0x0baf('0x4')]},'mobile':{'type':Sequelize[_0x0baf('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x0baf('0x4')]},'userpic':{'type':Sequelize[_0x0baf('0x4')]},'city':{'type':Sequelize[_0x0baf('0x4')]},'country':{'type':Sequelize[_0x0baf('0x4')]},'online':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0baf('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':_0x0baf('0x17')},'lastPauseAt':{'type':Sequelize[_0x0baf('0x16')]},'chatCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0baf('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0baf('0x10')]('friend',_0x0baf('0x19'),_0x0baf('0x1a')),'allowNull':!![],'defaultValue':_0x0baf('0x1b')},'context':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x1c'),'ALLOWED_PASSED_SCREEN',_0x0baf('0x1d'),_0x0baf('0x1e'),_0x0baf('0x1f'),_0x0baf('0x20'),_0x0baf('0x21'),_0x0baf('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x23'),'set':function(_0x275ea1){this[_0x0baf('0x6')](_0x0baf('0x24'),_0x275ea1?_0x275ea1[_0x0baf('0x25')](','):null);},'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x24'))?this[_0x0baf('0xc')](_0x0baf('0x24'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0baf('0x10')]('rfc2833',_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'),_0x0baf('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no','nonat',_0x0baf('0x2c'),_0x0baf('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x2e'),'set':function(_0x4aa6ed){this[_0x0baf('0x6')](_0x0baf('0x2f'),_0x4aa6ed?_0x4aa6ed['join'](','):null);},'get':function(){return this[_0x0baf('0xc')]('nat')?this['getDataValue'](_0x0baf('0x2f'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0baf('0x4')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x4')]},'language':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x4')]},'disallow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x30')},'allow':{'type':Sequelize[_0x0baf('0x4')],'allowNull':![],'defaultValue':_0x0baf('0x31'),'set':function(_0x36c6d2){this[_0x0baf('0x6')](_0x0baf('0x32'),_0x36c6d2?_0x36c6d2[_0x0baf('0x25')](';'):_0x0baf('0x31'));},'get':function(){return this['getDataValue'](_0x0baf('0x32'))?this[_0x0baf('0xc')]('allow')[_0x0baf('0x26')](';'):null;},'comment':_0x0baf('0x33')},'autoframing':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'set':function(_0x456d0b){this['setDataValue'](_0x0baf('0x34'),_0x456d0b?_0x456d0b[_0x0baf('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x0baf('0x34'))?this[_0x0baf('0xc')](_0x0baf('0x34'))[_0x0baf('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![],'defaultValue':_0x0baf('0x36')},'amaflags':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'busylevel':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no',_0x0baf('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3b'),_0x0baf('0x3c')),'allowNull':!![],'defaultValue':_0x0baf('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x0baf('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0baf('0x10')]('yes','no',_0x0baf('0x3d'),_0x0baf('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x3f'),_0x0baf('0x40'),_0x0baf('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0baf('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0baf('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0baf('0x10')](_0x0baf('0x2b'),'no',_0x0baf('0x42'),_0x0baf('0x2c'),_0x0baf('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0baf('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0,'set':function(_0x27f580){this[_0x0baf('0x6')](_0x0baf('0x44'),_0x27f580);var _0x1c7d88=this[_0x0baf('0x45')]({'plain':!![]});switch(_0x27f580){case 0x0:case 0x1:var _0x14e6d0=_0x1c7d88[_0x0baf('0x24')]?_['isArray'](_0x1c7d88[_0x0baf('0x24')])?_0x1c7d88['transport'][_0x0baf('0x25')]():_0x1c7d88['transport']:'udp';if(_0x14e6d0===_0x0baf('0x46')){_0x14e6d0='udp';}this[_0x0baf('0x6')](_0x0baf('0x24'),_0x14e6d0);this['setDataValue'](_0x0baf('0x47'),'no');this[_0x0baf('0x6')](_0x0baf('0x48'),null);this['setDataValue']('force_avp',null);this[_0x0baf('0x6')](_0x0baf('0x49'),null);this[_0x0baf('0x6')](_0x0baf('0x4a'),null);this[_0x0baf('0x6')]('dtlsverify',null);this[_0x0baf('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x0baf('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x0baf('0x4b'),'no');break;case 0x2:this[_0x0baf('0x6')](_0x0baf('0x24'),_0x0baf('0x46'));this[_0x0baf('0x6')](_0x0baf('0x47'),'yes');this[_0x0baf('0x6')](_0x0baf('0x48'),_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4c'),_0x0baf('0x2b'));this['setDataValue'](_0x0baf('0x49'),_0x0baf('0x2b'));this[_0x0baf('0x6')]('dtlsenable',_0x0baf('0x2b'));this[_0x0baf('0x6')](_0x0baf('0x4d'),'no');this[_0x0baf('0x6')](_0x0baf('0x4e'),_0x0baf('0x41'));this[_0x0baf('0x6')]('dtlscertfile',_0x1c7d88['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x0baf('0x6')](_0x0baf('0x4f'),_0x1c7d88[_0x0baf('0x4f')]||_0x0baf('0x50'));this[_0x0baf('0x6')](_0x0baf('0x4b'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x34c1f4){this['setDataValue'](_0x0baf('0x51'),_0x34c1f4?_0x34c1f4[_0x0baf('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x0baf('0x51'))?_[_0x0baf('0x52')](this[_0x0baf('0xc')](_0x0baf('0x51'))[_0x0baf('0x26')](','),function(_0x33a5af){return parseInt(_0x33a5af,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0baf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0baf('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0baf('0x53')],'get':function(){return this[_0x0baf('0xc')](_0x0baf('0x54'))?this[_0x0baf('0xc')](_0x0baf('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0baf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0baf('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x97d385){if(typeof _0x97d385===_0x0baf('0x55')){var _0x421ca0=_0x97d385==='1'?!![]:_0x97d385==='0'?![]:_0x97d385===_0x0baf('0x56')?!![]:_0x97d385===_0x0baf('0x57')?![]:![];this['setDataValue']('screenrecording',_0x421ca0);}else{this[_0x0baf('0x6')](_0x0baf('0x58'),_0x97d385);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x28bc1c){this[_0x0baf('0x6')](_0x0baf('0x59'),_0x28bc1c);if(_0x28bc1c===!![]){this['setDataValue'](_0x0baf('0x5a'),moment());this[_0x0baf('0x6')](_0x0baf('0x5b'),0x0);}else{this['setDataValue'](_0x0baf('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0baf('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0baf('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 2fb035f..c72b5ec 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 _0x3a06=['removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','omit','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$notLike','$iLike','$notILike','$like','$any','lastName','CmContact','Contact','dialActive','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','apiKeyIat','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','set','Content-Range','reject','save','destroy','Users','user','Agents','Telephones','telephone','filter','map','value','includes','find','role','name','UserProfileResource','send','User','rawAttributes','model','differenceBy','keys','password','query','filters','fields','attributes','hasOwnProperty','nolimit','limit','sort','pick','where','merge','type','key','VIRTUAL','sequelize','lower','options','count','includeAll','include','params','salt','intersection','length','bulkCreate','update','body','describe','addContacts','ids','agent','agent\x20role','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','internal','Setting','findById','securePassword','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','110','104','106','107','108','109','100','111','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','changePassword','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','addQueues','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','penalty','spread','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','online','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queue:remove','addAvatar','userpic','file','getAvatar','join','download','existsSync','server/files/images/','root','order','CmList','List','Tag','Tags','tag','getContacts','Queue','findAll','Queues','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','rows','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','phone','LOCAL/%s@from-sip/n','intrf','SIP/%s','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','push','UserVoiceQueue.penalty','each','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','QueuePause','pause','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','lastPauseAt','manual','openchannel','%s%s','getTeams','Team','addTeams','removeTeams','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save'];(function(_0x291c6c,_0x5553ee){var _0x33d148=function(_0xc363b5){while(--_0xc363b5){_0x291c6c['push'](_0x291c6c['shift']());}};_0x33d148(++_0x5553ee);}(_0x3a06,0x193));var _0x63a0=function(_0x5e26ed,_0x4542a2){_0x5e26ed=_0x5e26ed-0x0;var _0x3968ee=_0x3a06[_0x5e26ed];return _0x3968ee;};'use strict';var pdf=require(_0x63a0('0x0'));var emlformat=require(_0x63a0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x63a0('0x2'));var jsonpatch=require(_0x63a0('0x3'));var rp=require(_0x63a0('0x4'));var moment=require(_0x63a0('0x5'));var BPromise=require(_0x63a0('0x6'));var Mustache=require('mustache');var util=require(_0x63a0('0x7'));var path=require(_0x63a0('0x8'));var sox=require(_0x63a0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x63a0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63a0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x63a0('0xc'));var Papa=require(_0x63a0('0xd'));var Redis=require(_0x63a0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x63a0('0xf'));var hardwareService=require(_0x63a0('0x10'));var logger=require(_0x63a0('0x11'))(_0x63a0('0x12'));var utils=require('../../config/utils');var config=require(_0x63a0('0x13'));var db=require('../../mysqldb')['db'];config[_0x63a0('0x14')]=_[_0x63a0('0x15')](config[_0x63a0('0x14')],{'host':_0x63a0('0x16'),'port':0x18eb});var socket=require(_0x63a0('0x17'))(new Redis(config['redis']));require(_0x63a0('0x18'))['register'](socket);var jayson=require(_0x63a0('0x19'));var client=jayson[_0x63a0('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0xf44297,_0x3d57d5,_0x4bece7){if(_0x4bece7){var _0x201ce3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x201ce3['test'](_0x3d57d5)){return _0xf44297;}else{throw new Error(_0x63a0('0x1b'));}}else{return _0xf44297;}}function respondWithRpcPromise(_0x4f0061,_0x58ed37,_0x5ec02c,_0x1d36e8){return new BPromise(function(_0x4d0a01,_0x2d23e9){var _0x558703=_0x1d36e8||client;return _0x558703[_0x63a0('0x1c')](_0x4f0061,_0x5ec02c)[_0x63a0('0x1d')](function(_0x5370a8){logger[_0x63a0('0x1e')](_0x63a0('0x1f'),_0x58ed37,_0x63a0('0x20'));logger[_0x63a0('0x21')]('User,\x20%s,\x20%s,\x20%s',_0x58ed37,'request\x20sent',JSON[_0x63a0('0x22')](_0x5370a8));if(_0x5370a8[_0x63a0('0x23')]){if(_0x5370a8[_0x63a0('0x23')][_0x63a0('0x24')]===0x1f4){logger[_0x63a0('0x23')](_0x63a0('0x1f'),_0x58ed37,_0x5370a8[_0x63a0('0x23')]['message']);return _0x2d23e9(_0x5370a8[_0x63a0('0x23')][_0x63a0('0x25')]);}logger[_0x63a0('0x23')](_0x63a0('0x1f'),_0x58ed37,_0x5370a8[_0x63a0('0x23')][_0x63a0('0x25')]);return _0x4d0a01(_0x5370a8[_0x63a0('0x23')][_0x63a0('0x25')]);}else{logger['info'](_0x63a0('0x1f'),_0x58ed37,_0x63a0('0x20'));_0x4d0a01(_0x5370a8['result'][_0x63a0('0x25')]);}})[_0x63a0('0x26')](function(_0x586c8e){logger[_0x63a0('0x23')]('User,\x20%s,\x20%s',_0x58ed37,_0x586c8e);_0x2d23e9(_0x586c8e);});});}function respondWithStatusCode(_0x28c6e7,_0x143232){_0x143232=_0x143232||0xcc;return function(_0x4992ac){if(_0x4992ac){return _0x28c6e7[_0x63a0('0x27')](_0x143232);}return _0x28c6e7[_0x63a0('0x28')](_0x143232)[_0x63a0('0x29')]();};}function respondWithResult(_0x3bd65b,_0x155e28){_0x155e28=_0x155e28||0xc8;return function(_0x5708ec){if(_0x5708ec){return _0x3bd65b['status'](_0x155e28)[_0x63a0('0x2a')](_0x5708ec);}};}function respondWithFilteredResult(_0x485f27,_0x19bd81){return function(_0x5945f3){if(_0x5945f3){var _0x49c4f4=_0x5945f3['count'],_0x34e5e1=_0x19bd81[_0x63a0('0x2b')],_0x34b28a=_0x19bd81[_0x63a0('0x2b')]+_0x19bd81['limit'],_0xa611eb;if(_0x34b28a>=_0x49c4f4){_0x34b28a=_0x49c4f4;_0xa611eb=0xc8;}else{_0xa611eb=0xce;}_0x485f27['status'](_0xa611eb);return _0x485f27[_0x63a0('0x2c')](_0x63a0('0x2d'),_0x34e5e1+'-'+_0x34b28a+'/'+_0x49c4f4)[_0x63a0('0x2a')](_0x5945f3);}return null;};}function patchUpdates(_0x4e1f98){return function(_0x34f2fc){try{jsonpatch['apply'](_0x34f2fc,_0x4e1f98,!![]);}catch(_0x25509c){return BPromise[_0x63a0('0x2e')](_0x25509c);}return _0x34f2fc[_0x63a0('0x2f')]();};}function saveUpdates(_0x380519,_0x760f0){return function(_0x35875c){if(_0x35875c){return _0x35875c['update'](_0x380519)[_0x63a0('0x1d')](function(_0x1648a3){return _0x1648a3;});}return null;};}function removeEntity(_0x4eb51d,_0x107dff){return function(_0x619c81){if(_0x619c81){return _0x619c81[_0x63a0('0x30')]()[_0x63a0('0x1d')](function(){var _0x1ce381=_0x619c81['get']({'plain':!![]});var _0x4c4d7d=[{'name':_0x63a0('0x31'),'value':_0x63a0('0x32'),'ignore':!![]},{'name':_0x63a0('0x33'),'value':'agent','ignore':![]},{'name':_0x63a0('0x34'),'value':_0x63a0('0x35'),'ignore':![]}];var _0xeab736=_(_0x4c4d7d)[_0x63a0('0x36')]('ignore')[_0x63a0('0x37')](_0x63a0('0x38'))['value']();if(_[_0x63a0('0x39')](_0xeab736,_0x1ce381['role'])){return;}var _0x199d6d=_[_0x63a0('0x3a')](_0x4c4d7d,[_0x63a0('0x38'),_0x1ce381[_0x63a0('0x3b')]])[_0x63a0('0x3c')];return db[_0x63a0('0x3d')]['destroy']({'where':{'type':_0x199d6d,'resourceId':_0x1ce381['id']}})[_0x63a0('0x1d')](function(){return _0x619c81;});})[_0x63a0('0x1d')](function(){_0x4eb51d[_0x63a0('0x28')](0xcc)[_0x63a0('0x29')]();});}};}function handleEntityNotFound(_0x1dd07c,_0x8343c8){return function(_0x11ed7b){if(!_0x11ed7b){_0x1dd07c[_0x63a0('0x27')](0x194);}return _0x11ed7b;};}function handleError(_0x5cf51e,_0x44c860){_0x44c860=_0x44c860||0x1f4;return function(_0x43fad2){logger[_0x63a0('0x23')](_0x43fad2['stack']);if(_0x43fad2['name']){delete _0x43fad2[_0x63a0('0x3c')];}_0x5cf51e[_0x63a0('0x28')](_0x44c860)[_0x63a0('0x3e')](_0x43fad2);};}exports['index']=function(_0xeeb8dd,_0x5425c4){var _0x4d84ef={},_0x3388a6={},_0x527185={'count':0x0,'rows':[]};var _0x20ea60=db[_0x63a0('0x3f')][_0x63a0('0x40')];_0x3388a6[_0x63a0('0x41')]=_[_0x63a0('0x42')](_[_0x63a0('0x43')](_0x20ea60),[_0x63a0('0x44'),'salt']);_0x3388a6[_0x63a0('0x45')]=_['keys'](_0xeeb8dd[_0x63a0('0x45')]);_0x3388a6[_0x63a0('0x46')]=_['intersection'](_0x3388a6[_0x63a0('0x41')],_0x3388a6[_0x63a0('0x45')]);_0x4d84ef['attributes']=_['intersection'](_0x3388a6[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0xeeb8dd[_0x63a0('0x45')]['fields']));_0x4d84ef[_0x63a0('0x48')]=_0x4d84ef[_0x63a0('0x48')]['length']?_0x4d84ef[_0x63a0('0x48')]:_0x3388a6[_0x63a0('0x41')];if(!_0xeeb8dd[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x4d84ef[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0xeeb8dd['query'][_0x63a0('0x4b')]);_0x4d84ef['offset']=qs[_0x63a0('0x2b')](_0xeeb8dd['query']['offset']);}_0x4d84ef['order']=qs['sort'](_0xeeb8dd[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x4d84ef['where']=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0xeeb8dd[_0x63a0('0x45')],_0x3388a6['filters']));if(_0xeeb8dd[_0x63a0('0x45')][_0x63a0('0x36')]){_0x4d84ef[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x4d84ef[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x20ea60,function(_0x725ed2){if(_0x725ed2[_0x63a0('0x50')][_0x63a0('0x51')]!==_0x63a0('0x52')){return db[_0x63a0('0x53')]['where'](db[_0x63a0('0x53')]['fn']('lower',db[_0x63a0('0x53')]['col'](_0x725ed2['field'])),{'$like':db[_0x63a0('0x53')]['fn'](_0x63a0('0x54'),'%'+_0xeeb8dd[_0x63a0('0x45')][_0x63a0('0x36')]+'%')});}})});}_0x4d84ef=_['merge']({},_0x4d84ef,_0xeeb8dd[_0x63a0('0x55')]);var _0x34d1f0={'where':_0x4d84ef[_0x63a0('0x4e')]};return db[_0x63a0('0x3f')][_0x63a0('0x56')](_0x34d1f0)[_0x63a0('0x1d')](function(_0x3d042f){_0x527185[_0x63a0('0x56')]=_0x3d042f;if(_0xeeb8dd[_0x63a0('0x45')][_0x63a0('0x57')]){_0x4d84ef[_0x63a0('0x58')]=[{'all':!![]}];}return db['User']['findAll'](_0x4d84ef);})[_0x63a0('0x1d')](function(_0x3e93e5){_0x527185['rows']=_0x3e93e5;return _0x527185;})[_0x63a0('0x1d')](respondWithFilteredResult(_0x5425c4,_0x4d84ef))[_0x63a0('0x26')](handleError(_0x5425c4,null));};exports['show']=function(_0x309aa1,_0x2b2ad3){var _0x130316={'raw':![],'where':{'id':_0x309aa1[_0x63a0('0x59')]['id']}},_0x413c01={};_0x413c01[_0x63a0('0x41')]=_[_0x63a0('0x42')](_[_0x63a0('0x43')](db[_0x63a0('0x3f')][_0x63a0('0x40')]),['password',_0x63a0('0x5a')]);_0x413c01[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x309aa1[_0x63a0('0x45')]);_0x413c01[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x413c01[_0x63a0('0x41')],_0x413c01[_0x63a0('0x45')]);_0x130316[_0x63a0('0x48')]=_['intersection'](_0x413c01['model'],qs[_0x63a0('0x47')](_0x309aa1[_0x63a0('0x45')]['fields']));_0x130316[_0x63a0('0x48')]=_0x130316[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x130316[_0x63a0('0x48')]:_0x413c01['model'];if(_0x309aa1[_0x63a0('0x45')]['includeAll']){_0x130316[_0x63a0('0x58')]=[{'all':!![]}];}_0x130316=_[_0x63a0('0x4f')]({},_0x130316,_0x309aa1[_0x63a0('0x55')]);return db['User'][_0x63a0('0x3a')](_0x130316)[_0x63a0('0x1d')](handleEntityNotFound(_0x2b2ad3,null))[_0x63a0('0x1d')](respondWithResult(_0x2b2ad3,null))[_0x63a0('0x26')](handleError(_0x2b2ad3,null));};exports[_0x63a0('0x5d')]=function(_0x3e4b42,_0x513d5f){return db['User'][_0x63a0('0x5d')](_0x3e4b42['body'],{'raw':![],'individualHooks':!![]})[_0x63a0('0x1d')](respondWithResult(_0x513d5f,0xc9))[_0x63a0('0x26')](handleError(_0x513d5f,null));};exports[_0x63a0('0x5e')]=function(_0x10cd65,_0x42e0c4){if(_0x10cd65[_0x63a0('0x5f')]['id']){delete _0x10cd65[_0x63a0('0x5f')]['id'];}delete _0x10cd65['body'][_0x63a0('0x3b')];return db[_0x63a0('0x3f')]['find']({'where':{'id':_0x10cd65[_0x63a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x42e0c4,null))[_0x63a0('0x1d')](saveUpdates(_0x10cd65['body'],null))[_0x63a0('0x1d')](respondWithResult(_0x42e0c4,null))[_0x63a0('0x26')](handleError(_0x42e0c4,null));};exports[_0x63a0('0x60')]=function(_0x2f5d65,_0x4f4570){return db['User'][_0x63a0('0x60')]()[_0x63a0('0x1d')](respondWithResult(_0x4f4570,null))[_0x63a0('0x26')](handleError(_0x4f4570,null));};exports[_0x63a0('0x61')]=function(_0x4f2fa3,_0x373c76,_0x325fa2){return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x4f2fa3[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x373c76,null))[_0x63a0('0x1d')](function(_0x3f9f6a){if(_0x3f9f6a){return _0x3f9f6a[_0x63a0('0x61')](_0x4f2fa3[_0x63a0('0x5f')][_0x63a0('0x62')],_['omit'](_0x4f2fa3['body'],[_0x63a0('0x62'),'id'])||{});}})['then'](respondWithResult(_0x373c76,null))[_0x63a0('0x26')](handleError(_0x373c76,null));};var getLicense=function(_0x13b093){return new BPromise(function(_0x38542e,_0xfee512){var _0x806a56=0x0;_0x13b093[_0x63a0('0x5f')]['role']===_0x63a0('0x63')&&_0x38542e(_0x63a0('0x64'));return db[_0x63a0('0x3f')][_0x63a0('0x56')]({'where':{'$or':[{'role':_0x13b093['body']['role']===_0x63a0('0x35')?'telephone':['admin',_0x63a0('0x32')]}]}})['then'](function(_0x5126c9){_0x806a56=_0x5126c9;return require(_0x63a0('0x65'))[_0x63a0('0x66')]();})[_0x63a0('0x1d')](function(_0xb6449d){var _0x2ff3c6=_0x13b093[_0x63a0('0x5f')][_0x63a0('0x3b')]===_0x63a0('0x35')?_0x63a0('0x67'):_0x63a0('0x68');if(!_[_0x63a0('0x69')](_0xb6449d[_0x2ff3c6])&&_0x806a56>=_0xb6449d[_0x2ff3c6]){return _0xfee512({'message':_0x63a0('0x6a')});}return _0x38542e(util[_0x63a0('0x6b')](_0x63a0('0x6c'),_0x2ff3c6,_0x806a56));})['catch'](function(_0x438f12){return _0xfee512(_0x438f12);});});};exports['create']=function(_0x4bfa04,_0x1e5ea3){return getLicense(_0x4bfa04)['then'](function(_0x4d4d92){if(!_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x6d')]){var _0x5824e0;return db[_0x63a0('0x6e')][_0x63a0('0x6f')](0x1)[_0x63a0('0x1d')](function(_0x128595){_0x128595[_0x63a0('0x70')]=!![];return checkPasswordPattern(_0x128595,_0x4bfa04[_0x63a0('0x5f')]['password'],_0x128595['securePassword']);})[_0x63a0('0x1d')](function(_0x2f41c3){_0x5824e0=_0x2f41c3[_0x63a0('0x71')];return db[_0x63a0('0x3f')]['max'](_0x63a0('0x6d'));})[_0x63a0('0x1d')](function(_0x53f822){if(_[_0x63a0('0x69')](_0x53f822)){if(_0x5824e0){_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x6d')]=_0x5824e0;}else{_0x4bfa04['body']['internal']=0x1;}}else{if(_[_0x63a0('0x69')](_0x5824e0)||_0x5824e0==_0x53f822){_0x4bfa04['body'][_0x63a0('0x6d')]=_0x53f822+0x1;}else if(_0x5824e0>_0x53f822){_0x4bfa04[_0x63a0('0x5f')]['internal']=_0x5824e0;}else{return db[_0x63a0('0x53')][_0x63a0('0x45')](_0x63a0('0x72'),{'type':db['sequelize'][_0x63a0('0x73')][_0x63a0('0x74')]})['then'](function(_0x956c67){if(_0x956c67&&_0x956c67[_0x63a0('0x5c')]){for(var _0x4885a6=0x0,_0x1c4ae9=_0x956c67[_0x63a0('0x5c')];_0x4885a6<_0x1c4ae9&&_[_0x63a0('0x69')](_0x4bfa04['body']['internal']);_0x4885a6++){if(_0x5824e0<=_0x956c67[_0x4885a6][_0x63a0('0x75')]){_0x4bfa04['body']['internal']=_0x956c67[_0x4885a6][_0x63a0('0x75')];}else if(_0x5824e0>_0x956c67[_0x4885a6][_0x63a0('0x75')]&&_0x5824e0<=_0x956c67[_0x4885a6]['to']){_0x4bfa04['body']['internal']=_0x5824e0;}}}if(_[_0x63a0('0x69')](_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x6d')])){_0x4bfa04['body'][_0x63a0('0x6d')]=_0x53f822+0x1;}});}}});}})['then'](function(){if(_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x76')]){_0x4bfa04['body'][_0x63a0('0x77')]=_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x6d')];_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x78')]={'mailbox':_0x4bfa04['body'][_0x63a0('0x6d')],'password':_0x4bfa04[_0x63a0('0x5f')]['password'],'fullname':_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x79')],'email':_0x4bfa04['body'][_0x63a0('0x7a')]};}if(_0x4bfa04[_0x63a0('0x5f')]&&_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x3b')]===_0x63a0('0x63')){_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x7b')]=[_0x63a0('0x7c'),_0x63a0('0x7d'),_0x63a0('0x7e'),_0x63a0('0x7f'),_0x63a0('0x80'),'105',_0x63a0('0x81'),_0x63a0('0x82'),_0x63a0('0x83'),_0x63a0('0x84'),_0x63a0('0x85'),_0x63a0('0x86')];}return db[_0x63a0('0x3f')]['create'](_0x4bfa04[_0x63a0('0x5f')],{'include':[{'model':db[_0x63a0('0x78')],'as':_0x63a0('0x78')}]});})[_0x63a0('0x1d')](function(_0x1e8315){if(_0x4bfa04[_0x63a0('0x5f')][_0x63a0('0x3b')]===_0x63a0('0x32'))return _0x1e8315;var _0xa92092=_0x4bfa04[_0x63a0('0x32')][_0x63a0('0x87')]({'plain':!![]});if(!_0xa92092)throw new Error(_0x63a0('0x88'));if(_0xa92092[_0x63a0('0x3b')]===_0x63a0('0x32')){var _0x562389=_0x1e8315[_0x63a0('0x87')]({'plain':!![]});var _0x2fa036=[{'name':_0x63a0('0x33'),'value':'agent'},{'name':_0x63a0('0x34'),'value':_0x63a0('0x35')}];var _0x1d585b=_[_0x63a0('0x3a')](_0x2fa036,[_0x63a0('0x38'),_0x562389[_0x63a0('0x3b')]])['name'];return db[_0x63a0('0x89')][_0x63a0('0x3a')]({'where':{'name':_0x1d585b,'userProfileId':_0xa92092[_0x63a0('0x8a')]},'raw':!![]})['then'](function(_0x7f146e){if(_0x7f146e&&_0x7f146e[_0x63a0('0x8b')]===0x0){return db[_0x63a0('0x3d')][_0x63a0('0x8c')]({'name':_0x562389['name'],'resourceId':_0x562389['id'],'type':_0x7f146e['name'],'sectionId':_0x7f146e['id']},{})[_0x63a0('0x1d')](function(){return _0x1e8315;});}else{return _0x1e8315;}})[_0x63a0('0x26')](function(_0x5ea9f9){logger[_0x63a0('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ea9f9);throw _0x5ea9f9;});}return _0x1e8315;})['then'](respondWithResult(_0x1e5ea3,0xc9))[_0x63a0('0x26')](handleError(_0x1e5ea3,null));};exports[_0x63a0('0x8d')]=function(_0x3534f4,_0x3000df,_0x587cdc){var _0xbe414c=![];if(_0x3534f4['body']['id']){delete _0x3534f4['body']['id'];}if(!_[_0x63a0('0x69')](_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8e')])){if(_0x3534f4[_0x63a0('0x5f')]['oldPassword']===_0x3534f4['body'][_0x63a0('0x8f')]){throw new Error(_0x63a0('0x90'));}}return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x3534f4[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](function(_0x23cf98){if(_0x23cf98){if(_0x23cf98['id']==_0x3534f4[_0x63a0('0x32')]['id']){if(!_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8e')]||!_0x3534f4['body'][_0x63a0('0x8f')]){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0x93'));}if(!_0x23cf98[_0x63a0('0x94')](_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8e')])){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0x95'));}if(_0x3534f4['body'][_0x63a0('0x8e')]==_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8f')]){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0x96'));}return _0x23cf98;}else if(_0x3534f4['user']['role']==_0x63a0('0x97')){if(!_0x3534f4['body']['newPassword']){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0x98'));}return _0x23cf98;}else if(_0x3534f4[_0x63a0('0x32')][_0x63a0('0x3b')]=='user'){if(!_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8f')]){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0x98'));}if(_0x23cf98['role']!=_0x63a0('0x63')){throw new db['Sequelize'][(_0x63a0('0x92'))]('Unauthorized');}return _0x23cf98;}else{throw new db['Sequelize'][(_0x63a0('0x92'))](_0x63a0('0x99'));}}return null;})[_0x63a0('0x1d')](handleEntityNotFound(_0x3000df,null))['then'](function(_0x97044a){return db['Setting'][_0x63a0('0x9a')]({'attributes':['id','securePassword']})[_0x63a0('0x1d')](function(_0xc04a0f){_0xbe414c=_0xc04a0f[_0x63a0('0x70')];return checkPasswordPattern(_0x97044a,_0x3534f4[_0x63a0('0x5f')][_0x63a0('0x8f')],_0xbe414c);});})[_0x63a0('0x1d')](saveUpdates({'password':_0x3534f4['body'][_0x63a0('0x8f')],'passwordResetAt':_0x3534f4[_0x63a0('0x32')]['id']==_0x3534f4[_0x63a0('0x59')]['id']?moment():null},null))[_0x63a0('0x1d')](respondWithResult(_0x3000df,null))[_0x63a0('0x26')](handleError(_0x3000df,null));};exports[_0x63a0('0x9b')]=function(_0x57a1a4,_0x3e0940,_0x34505d){var _0x3f1dce=_0x57a1a4[_0x63a0('0x5f')]['channel'];return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x57a1a4[_0x63a0('0x59')]['id']},'attributes':['id',_0x63a0('0x3c'),_0x63a0('0x3b'),'online',_0x63a0('0x9c'),_0x63a0('0x9d'),_0x63a0('0x9e')]})[_0x63a0('0x1d')](handleEntityNotFound(_0x3e0940,null))['then'](function(_0x3efa95){if(_0x3efa95){if(!utils[_0x63a0('0x9f')](_0x3f1dce)){throw new db[(_0x63a0('0x91'))]['ValidationError'](_0x63a0('0xa0'));}return _0x3efa95[_0x63a0('0xa1')+_[_0x63a0('0xa2')](_0x3f1dce['toLowerCase']())+'Queues'](_0x57a1a4[_0x63a0('0x5f')][_0x63a0('0x62')],{'penalty':_0x57a1a4[_0x63a0('0x5f')][_0x63a0('0xa3')]||0x0})[_0x63a0('0xa4')](function(_0x10943e){for(var _0x2ef427=0x0;_0x2ef427<_0x57a1a4[_0x63a0('0x5f')][_0x63a0('0x62')][_0x63a0('0x5c')];_0x2ef427+=0x1){var _0x5975cc={'UserId':_0x57a1a4[_0x63a0('0x59')]['id']};_0x5975cc[_[_0x63a0('0xa2')](_0x3f1dce[_0x63a0('0xa5')]())+_0x63a0('0xa6')]=_0x57a1a4[_0x63a0('0x5f')][_0x63a0('0x62')][_0x2ef427];socket[_0x63a0('0xa7')](_0x63a0('0x32')+_['capitalize'](_0x3f1dce[_0x63a0('0xa5')]())+_0x63a0('0xa8'),_0x5975cc);}return _0x10943e;})[_0x63a0('0x1d')](function(){if(_0x3f1dce===_0x63a0('0xa9')){return db[_0x63a0('0xaa')]['findAll']({'where':{'id':_0x57a1a4['body'][_0x63a0('0x62')]||[]},'raw':!![],'attributes':['id',_0x63a0('0x3c')]});}})[_0x63a0('0x1d')](function(_0x2daddf){var _0x9baf56=_0x3efa95[_0x63a0('0x87')]({'plain':!![]});var _0x455b93=[];if(_0x3f1dce===_0x63a0('0xa9')&&_0x9baf56['role']==='agent'&&_0x9baf56[_0x63a0('0xab')]){for(var _0x158f1d=0x0;_0x158f1d<_0x2daddf[_0x63a0('0x5c')];_0x158f1d+=0x1){_0x455b93['push']({'membername':_0x9baf56[_0x63a0('0x3c')],'UserId':_0x9baf56['id'],'queue_name':_0x2daddf[_0x158f1d][_0x63a0('0x3c')],'VoiceQueueId':_0x2daddf[_0x158f1d]['id'],'interface':_[_0x63a0('0x69')](_0x9baf56[_0x63a0('0x9e')])?util[_0x63a0('0x6b')]('SIP/%s',_0x9baf56[_0x63a0('0x3c')]):_0x9baf56[_0x63a0('0x9e')],'paused':_0x9baf56[_0x63a0('0x9d')]||![],'penalty':_0x57a1a4[_0x63a0('0x5f')][_0x63a0('0xa3')]||0x0});}return BPromise['each'](_0x455b93,function(_0x35af40){return db[_0x63a0('0xac')][_0x63a0('0xad')](_0x35af40);});}return _0x3efa95;});}})[_0x63a0('0x1d')](respondWithStatusCode(_0x3e0940,null))[_0x63a0('0x26')](handleError(_0x3e0940,null));};exports[_0x63a0('0xae')]=function(_0x2d8dea,_0x4d9663,_0x57a64f){var _0x1abcbe;return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x2d8dea['params']['id']},'attributes':['id',_0x63a0('0x3c'),'role']})['then'](handleEntityNotFound(_0x4d9663,null))[_0x63a0('0x1d')](function(_0x1e333c){if(_0x1e333c){_0x1abcbe=_0x1e333c;if(!_0x2d8dea[_0x63a0('0x45')][_0x63a0('0xaf')]||!utils[_0x63a0('0x9f')](_0x2d8dea[_0x63a0('0x45')][_0x63a0('0xaf')])){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))]('Unknown\x20channel');}return _0x1e333c[_0x63a0('0xb0')+_['capitalize'](_0x2d8dea['query']['channel'][_0x63a0('0xa5')]())+'Queues'](_0x2d8dea[_0x63a0('0x45')][_0x63a0('0x62')]);}})[_0x63a0('0x1d')](function(_0x4af8f8){for(var _0x53962a=0x0;_0x53962a<_0x2d8dea[_0x63a0('0x45')]['ids'][_0x63a0('0x5c')];_0x53962a+=0x1){var _0x1b7599={'UserId':_0x2d8dea[_0x63a0('0x59')]['id']};_0x1b7599[_['capitalize'](_0x2d8dea[_0x63a0('0x45')][_0x63a0('0xaf')][_0x63a0('0xa5')]())+'QueueId']=_0x2d8dea[_0x63a0('0x45')]['ids'][_0x53962a];socket['emit'](_0x63a0('0x32')+_['capitalize'](_0x2d8dea[_0x63a0('0x45')][_0x63a0('0xaf')][_0x63a0('0xa5')]())+_0x63a0('0xb1'),_0x1b7599);}return _0x4af8f8;})[_0x63a0('0x1d')](function(){if(_0x2d8dea['query'][_0x63a0('0xaf')]===_0x63a0('0xa9')){return db['UserVoiceQueueRt'][_0x63a0('0x30')]({'where':{'UserId':_0x2d8dea[_0x63a0('0x59')]['id'],'VoiceQueueId':_0x2d8dea[_0x63a0('0x45')][_0x63a0('0x62')]},'individualHooks':!![]})['then'](function(){return _0x1abcbe;});}return _0x1abcbe;})['then'](respondWithStatusCode(_0x4d9663,null))[_0x63a0('0x26')](handleError(_0x4d9663,null));};exports[_0x63a0('0xb2')]=function(_0x4974d8,_0x95795c,_0x2e9394){_0x4974d8[_0x63a0('0x5f')][_0x63a0('0xb3')]=_0x4974d8[_0x63a0('0xb4')]['filename'];return db[_0x63a0('0x3f')]['find']({'where':{'id':_0x4974d8[_0x63a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x95795c,null))['then'](saveUpdates(_0x4974d8[_0x63a0('0x5f')],null))[_0x63a0('0x1d')](respondWithResult(_0x95795c,null))[_0x63a0('0x26')](handleError(_0x95795c,null));};exports[_0x63a0('0xb5')]=function(_0xb4f418,_0x52256b,_0x3bda0e){var _0x1a4fe4=path[_0x63a0('0xb6')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0xb4f418[_0x63a0('0x59')]['id']},'attributes':['id',_0x63a0('0xb3')],'raw':!![]})[_0x63a0('0x1d')](handleEntityNotFound(_0x52256b,null))['then'](function(_0x15d6c1){if(_0x15d6c1){if(_[_0x63a0('0x69')](_0x15d6c1[_0x63a0('0xb3')])){return _0x52256b[_0x63a0('0xb7')](_0x1a4fe4);}else{if(!fs[_0x63a0('0xb8')](path[_0x63a0('0xb6')](config['root'],_0x63a0('0xb9'),_0x15d6c1[_0x63a0('0xb3')]))){return _0x52256b[_0x63a0('0xb7')](_0x1a4fe4);}return _0x52256b[_0x63a0('0xb7')](path[_0x63a0('0xb6')](config[_0x63a0('0xba')],_0x63a0('0xb9'),_0x15d6c1[_0x63a0('0xb3')]));}}})[_0x63a0('0x26')](handleError(_0x52256b,null));};exports['getContacts']=function(_0x28e6f4,_0x2b2efe,_0x5465ef){var _0x1baeae={};var _0x4e434b={};var _0x485fef;var _0x55d2a3;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x28e6f4[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x2b2efe,null))['then'](function(_0x45cbc1){if(_0x45cbc1){_0x485fef=_0x45cbc1;_0x4e434b['model']=_[_0x63a0('0x43')](db['CmContact'][_0x63a0('0x40')]);_0x4e434b[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x28e6f4[_0x63a0('0x45')]);_0x4e434b[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x4e434b[_0x63a0('0x41')],_0x4e434b['query']);_0x1baeae['attributes']=_[_0x63a0('0x5b')](_0x4e434b[_0x63a0('0x41')],qs['fields'](_0x28e6f4[_0x63a0('0x45')]['fields']));_0x1baeae[_0x63a0('0x48')]=_0x1baeae[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x1baeae[_0x63a0('0x48')]:_0x4e434b[_0x63a0('0x41')];_0x1baeae[_0x63a0('0xbb')]=qs[_0x63a0('0x4c')](_0x28e6f4[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x1baeae[_0x63a0('0x4e')]=qs['filters'](_[_0x63a0('0x4d')](_0x28e6f4['query'],_0x4e434b[_0x63a0('0x46')]));if(_0x28e6f4[_0x63a0('0x45')]['filter']){_0x1baeae['where']=_['merge'](_0x1baeae[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x1baeae[_0x63a0('0x48')],function(_0x422568){var _0x41630c={};_0x41630c[_0x422568]={'$like':'%'+_0x28e6f4['query'][_0x63a0('0x36')]+'%'};return _0x41630c;})});}_0x1baeae=_['merge']({},_0x1baeae,_0x28e6f4['options']);return _0x485fef['getContacts'](_0x1baeae);}})[_0x63a0('0x1d')](function(_0x5f2bac){if(_0x5f2bac){_0x55d2a3=_0x5f2bac[_0x63a0('0x5c')];if(_0x28e6f4['query'][_0x63a0('0x49')](_0x63a0('0x57'))){_0x1baeae[_0x63a0('0x58')]=[{'model':db[_0x63a0('0xbc')],'as':_0x63a0('0xbd'),'required':![]},{'model':db[_0x63a0('0xbe')],'as':_0x63a0('0xbf'),'attributes':['id',_0x63a0('0x3c'),'color'],'where':_0x28e6f4['query'][_0x63a0('0xc0')]?{'id':_0x28e6f4[_0x63a0('0x45')]['tag']}:undefined,'required':_0x28e6f4[_0x63a0('0x45')][_0x63a0('0xc0')]?!![]:![]}];}if(!_0x28e6f4[_0x63a0('0x45')]['hasOwnProperty']('nolimit')){_0x1baeae[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x28e6f4['query'][_0x63a0('0x4b')]);_0x1baeae[_0x63a0('0x2b')]=qs['offset'](_0x28e6f4[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x485fef[_0x63a0('0xc1')](_0x1baeae);}})['then'](function(_0x297ffe){if(_0x297ffe){return _0x297ffe?{'count':_0x55d2a3,'rows':_0x297ffe}:null;}})[_0x63a0('0x1d')](respondWithResult(_0x2b2efe,null))['catch'](handleError(_0x2b2efe,null));};exports['getQueues']=function(_0x37136d,_0x224a93,_0x1470d2){var _0x387cdd;var _0x26b108;var _0x39b1f6={};var _0x415db6;return db['User'][_0x63a0('0x9a')]({'where':{'id':_0x37136d[_0x63a0('0x59')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x224a93,null))['then'](function(_0x30407a){if(!utils[_0x63a0('0x9f')](_0x37136d[_0x63a0('0x45')]['channel'])){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0xa0'));}_0x387cdd=_0x30407a;var _0x4d1601={};_0x4d1601[_0x63a0('0x41')]=_['keys'](db[_[_0x63a0('0xa2')](_0x37136d[_0x63a0('0x45')][_0x63a0('0xaf')])+_0x63a0('0xc2')][_0x63a0('0x40')]);_0x4d1601['query']=_[_0x63a0('0x43')](_0x37136d['query']);_0x4d1601[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x4d1601[_0x63a0('0x41')],_0x4d1601['query']);_0x39b1f6[_0x63a0('0x48')]=_['intersection'](_0x4d1601[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x37136d[_0x63a0('0x45')][_0x63a0('0x47')]));_0x39b1f6[_0x63a0('0x48')]=_0x39b1f6[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x39b1f6['attributes']:_0x4d1601[_0x63a0('0x41')];_0x39b1f6['order']=qs[_0x63a0('0x4c')](_0x37136d[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x39b1f6[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x37136d[_0x63a0('0x45')],_0x4d1601[_0x63a0('0x46')]));if(_0x37136d[_0x63a0('0x45')][_0x63a0('0x36')]){_0x39b1f6[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x39b1f6[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x39b1f6['attributes'],function(_0x439ca3){var _0x2d274f={};_0x2d274f[_0x439ca3]={'$like':'%'+_0x37136d[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x2d274f;})});}_0x39b1f6=_[_0x63a0('0x4f')]({},_0x39b1f6,_0x37136d[_0x63a0('0x55')]);switch(_0x387cdd[_0x63a0('0x3b')]){case _0x63a0('0x97'):return db[_[_0x63a0('0xa2')](_0x37136d[_0x63a0('0x45')]['channel'])+_0x63a0('0xc2')][_0x63a0('0xc3')](_0x39b1f6);case _0x63a0('0x32'):case _0x63a0('0x63'):return _0x387cdd[_0x63a0('0x87')+_[_0x63a0('0xa2')](_0x37136d[_0x63a0('0x45')][_0x63a0('0xaf')])+_0x63a0('0xc4')](_0x39b1f6);default:throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))]('Unknown\x20role');}})[_0x63a0('0x1d')](function(_0x572dc4){_0x415db6=_0x572dc4[_0x63a0('0x5c')];if(!_0x37136d['query'][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x39b1f6[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x37136d[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x39b1f6[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x37136d[_0x63a0('0x45')][_0x63a0('0x2b')]);}switch(_0x387cdd['role']){case _0x63a0('0x97'):return db[_['capitalize'](_0x37136d[_0x63a0('0x45')][_0x63a0('0xaf')])+'Queue'][_0x63a0('0xc3')](_0x39b1f6);case _0x63a0('0x32'):case'agent':return _0x387cdd['get'+_[_0x63a0('0xa2')](_0x37136d['query']['channel'])+'Queues'](_0x39b1f6);}})[_0x63a0('0x1d')](function(_0x17de5e){return{'count':_0x415db6,'rows':_0x17de5e};})[_0x63a0('0x1d')](respondWithResult(_0x224a93,null))[_0x63a0('0x26')](handleError(_0x224a93,null));};exports[_0x63a0('0xc5')]=function(_0x133ba4,_0x18fe27,_0x3df42d){var _0x2e4172={};var _0x2c9b57={};var _0x286e73;var _0x3f05e4;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x133ba4[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x18fe27,null))['then'](function(_0x26bdbe){if(_0x26bdbe){_0x286e73=_0x26bdbe;_0x2c9b57[_0x63a0('0x41')]=_[_0x63a0('0x43')](db[_0x63a0('0xac')]['rawAttributes']);_0x2c9b57[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x133ba4[_0x63a0('0x45')]);_0x2c9b57['filters']=_[_0x63a0('0x5b')](_0x2c9b57[_0x63a0('0x41')],_0x2c9b57[_0x63a0('0x45')]);_0x2e4172[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x2c9b57[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x133ba4[_0x63a0('0x45')][_0x63a0('0x47')]));_0x2e4172['attributes']=_0x2e4172['attributes'][_0x63a0('0x5c')]?_0x2e4172[_0x63a0('0x48')]:_0x2c9b57['model'];_0x2e4172['order']=qs[_0x63a0('0x4c')](_0x133ba4[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x2e4172[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x133ba4[_0x63a0('0x45')],_0x2c9b57[_0x63a0('0x46')]));if(_0x133ba4[_0x63a0('0x45')][_0x63a0('0x36')]){_0x2e4172[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x2e4172[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x2e4172[_0x63a0('0x48')],function(_0x4d6158){var _0x518d67={};_0x518d67[_0x4d6158]={'$like':'%'+_0x133ba4['query']['filter']+'%'};return _0x518d67;})});}_0x2e4172=_[_0x63a0('0x4f')]({},_0x2e4172,_0x133ba4[_0x63a0('0x55')]);return _0x286e73['getVoiceQueuesRt'](_0x2e4172);}})[_0x63a0('0x1d')](function(_0x51f7cd){if(_0x51f7cd){_0x3f05e4=_0x51f7cd[_0x63a0('0x5c')];if(!_0x133ba4[_0x63a0('0x45')][_0x63a0('0x49')]('nolimit')){_0x2e4172[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x133ba4[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x2e4172[_0x63a0('0x2b')]=qs['offset'](_0x133ba4[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x286e73[_0x63a0('0xc5')](_0x2e4172);}})[_0x63a0('0x1d')](function(_0x1f0078){if(_0x1f0078){return _0x1f0078?{'count':_0x3f05e4,'rows':_0x1f0078}:null;}})[_0x63a0('0x1d')](respondWithResult(_0x18fe27,null))[_0x63a0('0x26')](handleError(_0x18fe27,null));};exports['getGroups']=function(_0xdc047f,_0x5accb3,_0x2cf6bc){var _0x2bc464={};var _0x6739a5={};var _0x2f5b91;var _0x1aec99;return db['User'][_0x63a0('0x9a')]({'where':{'id':_0xdc047f[_0x63a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x5accb3,null))[_0x63a0('0x1d')](function(_0x2b4fa4){if(_0x2b4fa4){_0x2f5b91=_0x2b4fa4;_0x6739a5[_0x63a0('0x41')]=_['keys'](db[_0x63a0('0xc6')][_0x63a0('0x40')]);_0x6739a5['query']=_['keys'](_0xdc047f[_0x63a0('0x45')]);_0x6739a5['filters']=_[_0x63a0('0x5b')](_0x6739a5['model'],_0x6739a5[_0x63a0('0x45')]);_0x2bc464[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x6739a5[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0xdc047f['query'][_0x63a0('0x47')]));_0x2bc464[_0x63a0('0x48')]=_0x2bc464['attributes'][_0x63a0('0x5c')]?_0x2bc464[_0x63a0('0x48')]:_0x6739a5['model'];_0x2bc464[_0x63a0('0xbb')]=qs['sort'](_0xdc047f[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x2bc464[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0xdc047f[_0x63a0('0x45')],_0x6739a5[_0x63a0('0x46')]));if(_0xdc047f[_0x63a0('0x45')][_0x63a0('0x36')]){_0x2bc464[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x2bc464[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x2bc464['attributes'],function(_0x1e42da){var _0x484106={};_0x484106[_0x1e42da]={'$like':'%'+_0xdc047f[_0x63a0('0x45')]['filter']+'%'};return _0x484106;})});}_0x2bc464=_[_0x63a0('0x4f')]({},_0x2bc464,_0xdc047f['options']);return _0x2f5b91['getGroups'](_0x2bc464);}})[_0x63a0('0x1d')](function(_0x3f25bf){if(_0x3f25bf){_0x1aec99=_0x3f25bf['length'];if(!_0xdc047f[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x2bc464[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0xdc047f[_0x63a0('0x45')]['limit']);_0x2bc464[_0x63a0('0x2b')]=qs['offset'](_0xdc047f[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x2f5b91[_0x63a0('0xc7')](_0x2bc464);}})[_0x63a0('0x1d')](function(_0x2230c6){if(_0x2230c6){return _0x2230c6?{'count':_0x1aec99,'rows':_0x2230c6}:null;}})['then'](respondWithResult(_0x5accb3,null))[_0x63a0('0x26')](handleError(_0x5accb3,null));};exports['getRecordings']=function(_0x444232,_0x4bb00f,_0x3f2112){var _0x1f482a={'raw':!![],'where':{}};var _0x516e42={};var _0x3b0d5e={'count':0x0,'rows':[]};return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x444232[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x4bb00f,null))[_0x63a0('0x1d')](function(_0x4f810a){if(_0x4f810a){_0x516e42[_0x63a0('0x41')]=_['keys'](db[_0x63a0('0xc8')][_0x63a0('0x40')]);_0x516e42[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x444232[_0x63a0('0x45')]);_0x516e42['filters']=_[_0x63a0('0x5b')](_0x516e42[_0x63a0('0x41')],_0x516e42['query']);_0x1f482a[_0x63a0('0x48')]=_['intersection'](_0x516e42['model'],qs['fields'](_0x444232[_0x63a0('0x45')][_0x63a0('0x47')]));_0x1f482a[_0x63a0('0x48')]=_0x1f482a[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x1f482a['attributes']:_0x516e42['model'];if(!_0x444232[_0x63a0('0x45')][_0x63a0('0x49')]('nolimit')){_0x1f482a[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x444232['query'][_0x63a0('0x4b')]);_0x1f482a[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x444232[_0x63a0('0x45')][_0x63a0('0x2b')]);}_0x1f482a['order']=qs[_0x63a0('0x4c')](_0x444232['query'][_0x63a0('0x4c')]);_0x1f482a['where']=qs[_0x63a0('0x46')](_['pick'](_0x444232[_0x63a0('0x45')],_0x516e42[_0x63a0('0x46')]));_0x1f482a[_0x63a0('0x4e')]['UserId']=_0x4f810a['id'];if(_0x444232['query']['filter']){_0x1f482a[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x1f482a[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x1f482a['attributes'],function(_0x275ae5){var _0x4b7ba8={};_0x4b7ba8[_0x275ae5]={'$like':'%'+_0x444232[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x4b7ba8;})});}_0x1f482a=_['merge']({},_0x1f482a,_0x444232[_0x63a0('0x55')]);return db[_0x63a0('0xc8')][_0x63a0('0x56')]({'where':_0x1f482a[_0x63a0('0x4e')]})[_0x63a0('0x1d')](function(_0xea8180){_0x3b0d5e['count']=_0xea8180;if(_0x444232[_0x63a0('0x45')][_0x63a0('0x57')]){_0x1f482a[_0x63a0('0x58')]=[{'all':!![]}];}return db[_0x63a0('0xc8')][_0x63a0('0xc3')](_0x1f482a);})['then'](function(_0x559a9b){_0x3b0d5e[_0x63a0('0xc9')]=_0x559a9b;return _0x3b0d5e;});}})[_0x63a0('0x1d')](respondWithFilteredResult(_0x4bb00f,_0x1f482a))[_0x63a0('0x26')](handleError(_0x4bb00f,null));};exports[_0x63a0('0xca')]=function(_0x558992,_0x7dc6a3,_0x8b1cfc){var _0x555dd5={'raw':!![],'where':{}};var _0x177b46={};var _0x51d551={'count':0x0,'rows':[]};return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x558992[_0x63a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x7dc6a3,null))[_0x63a0('0x1d')](function(_0xc725c4){if(_0xc725c4){_0x177b46[_0x63a0('0x41')]=_[_0x63a0('0x43')](db[_0x63a0('0xcb')][_0x63a0('0x40')]);_0x177b46['query']=_['keys'](_0x558992[_0x63a0('0x45')]);_0x177b46[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x177b46[_0x63a0('0x41')],_0x177b46[_0x63a0('0x45')]);_0x555dd5[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x177b46[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x558992[_0x63a0('0x45')]['fields']));_0x555dd5[_0x63a0('0x48')]=_0x555dd5[_0x63a0('0x48')]['length']?_0x555dd5['attributes']:_0x177b46[_0x63a0('0x41')];if(!_0x558992[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x555dd5[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x558992[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x555dd5[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x558992[_0x63a0('0x45')][_0x63a0('0x2b')]);}_0x555dd5[_0x63a0('0xbb')]=qs['sort'](_0x558992[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x555dd5[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x558992[_0x63a0('0x45')],_0x177b46['filters']));_0x555dd5['where'][_0x63a0('0xcc')]=_0xc725c4['id'];if(_0x558992[_0x63a0('0x45')]['filter']){_0x555dd5[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x555dd5[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x555dd5[_0x63a0('0x48')],function(_0xa76261){var _0x35b5bd={};_0x35b5bd[_0xa76261]={'$like':'%'+_0x558992[_0x63a0('0x45')]['filter']+'%'};return _0x35b5bd;})});}_0x555dd5=_['merge']({},_0x555dd5,_0x558992[_0x63a0('0x55')]);return db[_0x63a0('0xcb')][_0x63a0('0x56')]({'where':_0x555dd5['where']})['then'](function(_0x563faa){_0x51d551[_0x63a0('0x56')]=_0x563faa;if(_0x558992['query'][_0x63a0('0x57')]){_0x555dd5[_0x63a0('0x58')]=[{'all':!![]}];}return db[_0x63a0('0xcb')][_0x63a0('0xc3')](_0x555dd5);})[_0x63a0('0x1d')](function(_0x2210f8){_0x51d551[_0x63a0('0xc9')]=_0x2210f8;return _0x51d551;});}})[_0x63a0('0x1d')](respondWithFilteredResult(_0x7dc6a3,_0x555dd5))[_0x63a0('0x26')](handleError(_0x7dc6a3,null));};exports[_0x63a0('0xcd')]=function(_0x49153d,_0x156afa,_0x12605f){var _0x3ed1b9={};var _0x5682f1={};var _0x4ea671;var _0x3bd755;return db[_0x63a0('0x3f')]['findOne']({'where':{'id':_0x49153d[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x156afa,null))[_0x63a0('0x1d')](function(_0x150a12){if(_0x150a12){_0x4ea671=_0x150a12;_0x5682f1['model']=_[_0x63a0('0x43')](db[_0x63a0('0xce')][_0x63a0('0x40')]);_0x5682f1['query']=_[_0x63a0('0x43')](_0x49153d['query']);_0x5682f1[_0x63a0('0x46')]=_['intersection'](_0x5682f1[_0x63a0('0x41')],_0x5682f1['query']);_0x3ed1b9['attributes']=_['intersection'](_0x5682f1[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x49153d[_0x63a0('0x45')][_0x63a0('0x47')]));_0x3ed1b9[_0x63a0('0x48')]=_0x3ed1b9['attributes'][_0x63a0('0x5c')]?_0x3ed1b9[_0x63a0('0x48')]:_0x5682f1[_0x63a0('0x41')];_0x3ed1b9['order']=qs[_0x63a0('0x4c')](_0x49153d['query'][_0x63a0('0x4c')]);_0x3ed1b9[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x49153d[_0x63a0('0x45')],_0x5682f1[_0x63a0('0x46')]));if(_0x49153d[_0x63a0('0x45')]['filter']){_0x3ed1b9[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x3ed1b9['where'],{'$or':_[_0x63a0('0x37')](_0x3ed1b9[_0x63a0('0x48')],function(_0x1eed40){var _0xa272a8={};_0xa272a8[_0x1eed40]={'$like':'%'+_0x49153d[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0xa272a8;})});}_0x3ed1b9=_[_0x63a0('0x4f')]({},_0x3ed1b9,_0x49153d['options']);return _0x4ea671['getChatInteractions'](_0x3ed1b9);}})[_0x63a0('0x1d')](function(_0x1ca676){if(_0x1ca676){_0x3bd755=_0x1ca676[_0x63a0('0x5c')];if(!_0x49153d[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x3ed1b9[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x49153d['query']['limit']);_0x3ed1b9[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x49153d['query'][_0x63a0('0x2b')]);}return _0x4ea671['getChatInteractions'](_0x3ed1b9);}})[_0x63a0('0x1d')](function(_0x412715){if(_0x412715){return _0x412715?{'count':_0x3bd755,'rows':_0x412715}:null;}})[_0x63a0('0x1d')](respondWithResult(_0x156afa,null))[_0x63a0('0x26')](handleError(_0x156afa,null));};exports[_0x63a0('0xcf')]=function(_0x157bf2,_0x5bdb49,_0x5663c9){var _0x51f16d={};var _0x1c3d8a={};var _0x3490d3;var _0x7f0683;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x157bf2[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x5bdb49,null))[_0x63a0('0x1d')](function(_0x39e5e5){if(_0x39e5e5){_0x3490d3=_0x39e5e5;_0x1c3d8a['model']=_[_0x63a0('0x43')](db['OpenchannelInteraction'][_0x63a0('0x40')]);_0x1c3d8a[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x157bf2[_0x63a0('0x45')]);_0x1c3d8a[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x1c3d8a[_0x63a0('0x41')],_0x1c3d8a[_0x63a0('0x45')]);_0x51f16d[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x1c3d8a[_0x63a0('0x41')],qs['fields'](_0x157bf2[_0x63a0('0x45')]['fields']));_0x51f16d['attributes']=_0x51f16d[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x51f16d[_0x63a0('0x48')]:_0x1c3d8a['model'];_0x51f16d[_0x63a0('0xbb')]=qs[_0x63a0('0x4c')](_0x157bf2['query'][_0x63a0('0x4c')]);_0x51f16d[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x157bf2['query'],_0x1c3d8a[_0x63a0('0x46')]));if(_0x157bf2[_0x63a0('0x45')][_0x63a0('0x36')]){_0x51f16d[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x51f16d[_0x63a0('0x4e')],{'$or':_['map'](_0x51f16d[_0x63a0('0x48')],function(_0x2c00da){var _0x5e0247={};_0x5e0247[_0x2c00da]={'$like':'%'+_0x157bf2[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x5e0247;})});}_0x51f16d=_[_0x63a0('0x4f')]({},_0x51f16d,_0x157bf2[_0x63a0('0x55')]);return _0x3490d3[_0x63a0('0xcf')](_0x51f16d);}})[_0x63a0('0x1d')](function(_0x26461d){if(_0x26461d){_0x7f0683=_0x26461d[_0x63a0('0x5c')];if(!_0x157bf2[_0x63a0('0x45')]['hasOwnProperty'](_0x63a0('0x4a'))){_0x51f16d[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x157bf2[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x51f16d[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x157bf2[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x3490d3[_0x63a0('0xcf')](_0x51f16d);}})[_0x63a0('0x1d')](function(_0x2fa082){if(_0x2fa082){return _0x2fa082?{'count':_0x7f0683,'rows':_0x2fa082}:null;}})['then'](respondWithResult(_0x5bdb49,null))['catch'](handleError(_0x5bdb49,null));};exports['getMailInteractions']=function(_0x48dc6d,_0x5eed36,_0xe77346){var _0x35c2f9={'raw':!![],'where':{}};var _0x54b112={};var _0x239651={'count':0x0,'rows':[]};return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x48dc6d['params']['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x5eed36,null))['then'](function(_0x2d90df){if(_0x2d90df){_0x54b112[_0x63a0('0x41')]=_[_0x63a0('0x43')](db[_0x63a0('0xd0')][_0x63a0('0x40')]);_0x54b112[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x48dc6d[_0x63a0('0x45')]);_0x54b112[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x54b112['model'],_0x54b112['query']);_0x35c2f9[_0x63a0('0x48')]=_['intersection'](_0x54b112[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x48dc6d[_0x63a0('0x45')][_0x63a0('0x47')]));_0x35c2f9[_0x63a0('0x48')]=_0x35c2f9['attributes'][_0x63a0('0x5c')]?_0x35c2f9['attributes']:_0x54b112[_0x63a0('0x41')];if(!_0x48dc6d[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x35c2f9[_0x63a0('0x4b')]=qs['limit'](_0x48dc6d[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x35c2f9[_0x63a0('0x2b')]=qs['offset'](_0x48dc6d['query'][_0x63a0('0x2b')]);}_0x35c2f9[_0x63a0('0xbb')]=qs[_0x63a0('0x4c')](_0x48dc6d[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x35c2f9[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x48dc6d[_0x63a0('0x45')],_0x54b112[_0x63a0('0x46')]));_0x35c2f9[_0x63a0('0x4e')]['UserId']=_0x2d90df['id'];if(_0x48dc6d['query'][_0x63a0('0x36')]){_0x35c2f9[_0x63a0('0x4e')]=_['merge'](_0x35c2f9[_0x63a0('0x4e')],{'$or':_['map'](_0x35c2f9[_0x63a0('0x48')],function(_0x475487){var _0x448414={};_0x448414[_0x475487]={'$like':'%'+_0x48dc6d['query']['filter']+'%'};return _0x448414;})});}_0x35c2f9=_[_0x63a0('0x4f')]({},_0x35c2f9,_0x48dc6d[_0x63a0('0x55')]);return db['MailInteraction']['count']({'where':_0x35c2f9['where']})['then'](function(_0x56f275){_0x239651['count']=_0x56f275;if(_0x48dc6d[_0x63a0('0x45')][_0x63a0('0x57')]){_0x35c2f9[_0x63a0('0x58')]=[{'all':!![]}];}return db[_0x63a0('0xd0')][_0x63a0('0xc3')](_0x35c2f9);})['then'](function(_0x861019){_0x239651[_0x63a0('0xc9')]=_0x861019;return _0x239651;});}})[_0x63a0('0x1d')](respondWithFilteredResult(_0x5eed36,_0x35c2f9))['catch'](handleError(_0x5eed36,null));};exports['getSmsInteractions']=function(_0x4cd73f,_0x1be5d9,_0x18a905){var _0x2e2fa7={};var _0x9e1221={};var _0x22e1fd;var _0x31e3b1;return db['User'][_0x63a0('0x9a')]({'where':{'id':_0x4cd73f[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x1be5d9,null))[_0x63a0('0x1d')](function(_0x1bae38){if(_0x1bae38){_0x22e1fd=_0x1bae38;_0x9e1221['model']=_[_0x63a0('0x43')](db[_0x63a0('0xd1')][_0x63a0('0x40')]);_0x9e1221[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x4cd73f[_0x63a0('0x45')]);_0x9e1221[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x9e1221[_0x63a0('0x41')],_0x9e1221[_0x63a0('0x45')]);_0x2e2fa7[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x9e1221[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x4cd73f[_0x63a0('0x45')][_0x63a0('0x47')]));_0x2e2fa7[_0x63a0('0x48')]=_0x2e2fa7[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x2e2fa7[_0x63a0('0x48')]:_0x9e1221[_0x63a0('0x41')];_0x2e2fa7['order']=qs[_0x63a0('0x4c')](_0x4cd73f[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x2e2fa7[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_['pick'](_0x4cd73f[_0x63a0('0x45')],_0x9e1221[_0x63a0('0x46')]));if(_0x4cd73f[_0x63a0('0x45')][_0x63a0('0x36')]){_0x2e2fa7[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x2e2fa7[_0x63a0('0x4e')],{'$or':_['map'](_0x2e2fa7[_0x63a0('0x48')],function(_0x11848a){var _0x423253={};_0x423253[_0x11848a]={'$like':'%'+_0x4cd73f[_0x63a0('0x45')]['filter']+'%'};return _0x423253;})});}_0x2e2fa7=_[_0x63a0('0x4f')]({},_0x2e2fa7,_0x4cd73f[_0x63a0('0x55')]);return _0x22e1fd[_0x63a0('0xd2')](_0x2e2fa7);}})[_0x63a0('0x1d')](function(_0xebb5ee){if(_0xebb5ee){_0x31e3b1=_0xebb5ee[_0x63a0('0x5c')];if(!_0x4cd73f['query']['hasOwnProperty'](_0x63a0('0x4a'))){_0x2e2fa7[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x4cd73f['query']['limit']);_0x2e2fa7[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x4cd73f[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x22e1fd['getSmsInteractions'](_0x2e2fa7);}})['then'](function(_0x4ceebc){if(_0x4ceebc){return _0x4ceebc?{'count':_0x31e3b1,'rows':_0x4ceebc}:null;}})['then'](respondWithResult(_0x1be5d9,null))[_0x63a0('0x26')](handleError(_0x1be5d9,null));};exports[_0x63a0('0xd3')]=function(_0x49ce5e,_0x4ff094,_0x3ed4b1){var _0x2a0e27={};var _0x10e53e={};var _0x2db1ac;var _0x433efe;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x49ce5e[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x4ff094,null))[_0x63a0('0x1d')](function(_0x10fc09){if(_0x10fc09){_0x2db1ac=_0x10fc09;_0x10e53e[_0x63a0('0x41')]=_['keys'](db[_0x63a0('0xd4')]['rawAttributes']);_0x10e53e[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x49ce5e[_0x63a0('0x45')]);_0x10e53e[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x10e53e[_0x63a0('0x41')],_0x10e53e[_0x63a0('0x45')]);_0x2a0e27['attributes']=_[_0x63a0('0x5b')](_0x10e53e[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x49ce5e['query'][_0x63a0('0x47')]));_0x2a0e27[_0x63a0('0x48')]=_0x2a0e27[_0x63a0('0x48')][_0x63a0('0x5c')]?_0x2a0e27[_0x63a0('0x48')]:_0x10e53e[_0x63a0('0x41')];_0x2a0e27['order']=qs['sort'](_0x49ce5e[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x2a0e27[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x49ce5e[_0x63a0('0x45')],_0x10e53e[_0x63a0('0x46')]));if(_0x49ce5e[_0x63a0('0x45')][_0x63a0('0x36')]){_0x2a0e27[_0x63a0('0x4e')]=_['merge'](_0x2a0e27['where'],{'$or':_[_0x63a0('0x37')](_0x2a0e27[_0x63a0('0x48')],function(_0x481229){var _0x2d2fac={};_0x2d2fac[_0x481229]={'$like':'%'+_0x49ce5e['query'][_0x63a0('0x36')]+'%'};return _0x2d2fac;})});}_0x2a0e27=_[_0x63a0('0x4f')]({},_0x2a0e27,_0x49ce5e[_0x63a0('0x55')]);return _0x2db1ac['getFaxInteractions'](_0x2a0e27);}})['then'](function(_0x480a77){if(_0x480a77){_0x433efe=_0x480a77[_0x63a0('0x5c')];if(!_0x49ce5e[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x2a0e27['limit']=qs[_0x63a0('0x4b')](_0x49ce5e[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x2a0e27['offset']=qs['offset'](_0x49ce5e[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x2db1ac[_0x63a0('0xd3')](_0x2a0e27);}})['then'](function(_0x1fc625){if(_0x1fc625){return _0x1fc625?{'count':_0x433efe,'rows':_0x1fc625}:null;}})['then'](respondWithResult(_0x4ff094,null))['catch'](handleError(_0x4ff094,null));};exports['login']=function(_0x1d3ef7,_0x30cec4,_0x3278df){var _0x16811e;var _0x38d1cf;var _0xc5d65e;var _0x1b5be6=!_[_0x63a0('0x69')](_0x1d3ef7['params']['id'])?_0x1d3ef7['params']['id']:!_['isNil'](_0x1d3ef7[_0x63a0('0x32')]['id'])?_0x1d3ef7[_0x63a0('0x32')]['id']:null;return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x1b5be6,'role':'agent'},'attributes':['id',_0x63a0('0x3c'),_0x63a0('0xd5'),'mobile',_0x63a0('0x3b'),_0x63a0('0x6d'),'loginInPause']})[_0x63a0('0x1d')](handleEntityNotFound(_0x30cec4,null))[_0x63a0('0x1d')](function(_0x5179e8){if(_0x5179e8){_0x16811e=_0x5179e8;if(_0x1d3ef7[_0x63a0('0x5f')][_0x63a0('0x9e')]){_0xc5d65e=util['format'](_0x63a0('0xd6'),_0x16811e[_0x1d3ef7[_0x63a0('0x5f')][_0x63a0('0x9e')]]);}else if(_0x1d3ef7[_0x63a0('0x5f')][_0x63a0('0xd7')]){_0xc5d65e=util[_0x63a0('0x6b')](_0x63a0('0xd8'),_0x1d3ef7[_0x63a0('0x5f')]['intrf']);}else{_0xc5d65e=util[_0x63a0('0x6b')]('SIP/%s',_0x16811e['name']);}socket['to'](util[_0x63a0('0x6b')]('user:%s',_0x16811e[_0x63a0('0x3c')]))[_0x63a0('0xa7')]('user:forcelogout',{'ip':_0x1d3ef7[_0x63a0('0xd9')][_0x63a0('0xda')]||_0x1d3ef7[_0x63a0('0xdb')][_0x63a0('0xdc')]||_0x1d3ef7[_0x63a0('0xdd')][_0x63a0('0xdc')]||_0x1d3ef7[_0x63a0('0xdb')][_0x63a0('0xdd')][_0x63a0('0xdc')]});return db[_0x63a0('0xac')][_0x63a0('0x30')]({'where':{'membername':_0x16811e['name']},'individualHooks':!![]});}})[_0x63a0('0x1d')](function(_0x48dd7e){if(_0x16811e){return _0x16811e[_0x63a0('0xde')]({'raw':!![]});}})[_0x63a0('0x1d')](function(_0x54300a){var _0x21f34e=[];if(_0x54300a){_0x38d1cf=_0x54300a;if(_0x38d1cf[_0x63a0('0x5c')]){for(var _0xf33626=0x0;_0xf33626<_0x38d1cf[_0x63a0('0x5c')];_0xf33626++){_0x21f34e[_0x63a0('0xdf')]({'membername':_0x16811e['name'],'UserId':_0x16811e['id'],'queue_name':_0x38d1cf[_0xf33626][_0x63a0('0x3c')],'VoiceQueueId':_0x38d1cf[_0xf33626]['id'],'interface':_0xc5d65e,'paused':_0x16811e[_0x63a0('0x9c')]||![],'penalty':_0x38d1cf[_0xf33626][_0x63a0('0xe0')]||0x0});}return BPromise[_0x63a0('0xe1')](_0x21f34e,function(_0x2686c3){return db[_0x63a0('0xac')][_0x63a0('0xad')](_0x2686c3);});}}})[_0x63a0('0x1d')](function(){return db[_0x63a0('0xe2')][_0x63a0('0xc3')]({'where':{'membername':_0x16811e[_0x63a0('0x3c')],'exitAt':null}});})['then'](function(_0x2c2139){var _0x478575=[];_0x2c2139[_0x63a0('0xe3')](function(_0x2a4c05){_0x478575[_0x63a0('0xdf')](_0x2a4c05['update']({'exitAt':moment()['format'](_0x63a0('0xe4'))}));});return BPromise[_0x63a0('0xe5')](_0x478575);})[_0x63a0('0x1d')](function(){var _0x51579c=[];var _0x25be68=[];var _0x35bd06=utils['getChannels']();var _0x5ca211={'membername':_0x16811e[_0x63a0('0x3c')],'interface':_0xc5d65e,'enterAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4')),'role':_0x16811e[_0x63a0('0x3b')],'internal':_0x16811e[_0x63a0('0x6d')]};_0x35bd06[_0x63a0('0xe3')](function(_0x3a75c9){_0x51579c[_0x63a0('0xdf')](_[_0x63a0('0x4f')]({'channel':_0x3a75c9,'type':'LOGIN','data1':_0x1d3ef7[_0x63a0('0x5f')][_0x63a0('0xe6')],'data2':_0xc5d65e},_0x5ca211));if(_0x16811e[_0x63a0('0x9c')]){_0x25be68[_0x63a0('0xdf')](_[_0x63a0('0x4f')]({'channel':_0x3a75c9,'type':_0x63a0('0xe7'),'data1':_0x63a0('0xe8')},_0x5ca211));}});return db[_0x63a0('0xe2')][_0x63a0('0x5d')](_0x51579c['concat'](_0x25be68),{'individualHooks':!![]});})[_0x63a0('0x1d')](function(){return _0x16811e[_0x63a0('0x5e')]({'online':!![],'lastLoginAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4')),'voicePause':_0x16811e[_0x63a0('0x9c')]||![],'mailPause':_0x16811e[_0x63a0('0x9c')]||![],'chatPause':_0x16811e[_0x63a0('0x9c')]||![],'faxPause':_0x16811e[_0x63a0('0x9c')]||![],'smsPause':_0x16811e[_0x63a0('0x9c')]||![],'openchannelPause':_0x16811e['loginInPause']||![],'pauseType':_0x16811e[_0x63a0('0x9c')]?_0x63a0('0xe8'):null,'interface':_0xc5d65e,'lastPauseAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4'))});})[_0x63a0('0x1d')](function(_0x2579f0){if(_0x1d3ef7[_0x63a0('0xe9')]){return _0x3278df();}else{return BPromise[_0x63a0('0xea')](_0x2579f0)[_0x63a0('0x1d')](respondWithResult(_0x30cec4,null));}})['catch'](handleError(_0x30cec4,null));};exports[_0x63a0('0xeb')]=function(_0x468fe7,_0x3869d8,_0x356ac3){var _0x4c6ecb;return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x468fe7['params']['id'],'role':_0x63a0('0x63')},'attributes':['id',_0x63a0('0x3c'),'role']})[_0x63a0('0x1d')](handleEntityNotFound(_0x3869d8,null))[_0x63a0('0x1d')](function(_0x13eace){if(_0x13eace){_0x4c6ecb=_0x13eace;return db[_0x63a0('0xac')][_0x63a0('0x30')]({'where':{'membername':_0x4c6ecb[_0x63a0('0x3c')]},'individualHooks':!![]});}})[_0x63a0('0x1d')](function(){return db[_0x63a0('0xe2')][_0x63a0('0xc3')]({'where':{'membername':_0x4c6ecb['name'],'exitAt':null}});})[_0x63a0('0x1d')](function(_0xba497a){var _0x4ce7f6=[];_0xba497a[_0x63a0('0xe3')](function(_0x1e1c0a){_0x4ce7f6['push'](_0x1e1c0a[_0x63a0('0x5e')]({'exitAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4'))}));});return BPromise[_0x63a0('0xe5')](_0x4ce7f6);})['then'](function(){return _0x4c6ecb[_0x63a0('0x5e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x63a0('0x1d')](respondWithResult(_0x3869d8,null))['catch'](handleError(_0x3869d8,null));};exports['pause']=function(_0x5d9acb,_0x50e595,_0x32a138){var _0x45b5e4;return db['UserVoiceQueueRt'][_0x63a0('0x5e')]({'paused':0x1},{'where':{'UserId':_0x5d9acb['params']['id']},'individualHooks':!![]})[_0x63a0('0x1d')](function(){return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x5d9acb['params']['id'],'role':'agent'},'attributes':['id',_0x63a0('0x3c'),_0x63a0('0x3b'),'internal',_0x63a0('0x9e')]});})['then'](handleEntityNotFound(_0x50e595,null))[_0x63a0('0x1d')](function(_0x12090f){if(_0x12090f){_0x45b5e4=_0x12090f;return respondWithRpcPromise(_0x63a0('0xec'),_0x63a0('0xed'),{'id':_0x45b5e4['id'],'name':_0x45b5e4[_0x63a0('0x3c')],'pause':!![]});}})[_0x63a0('0x1d')](function(){if(_0x45b5e4){return db[_0x63a0('0xe2')][_0x63a0('0xc3')]({'where':{'membername':_0x45b5e4['name'],'type':_0x63a0('0xe7'),'exitAt':null}});}})['then'](function(_0x4f2775){if(_0x4f2775['length']){var _0x423776=moment()[_0x63a0('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2bebc0=0x0,_0x2ba18d=_0x4f2775[_0x63a0('0x5c')];_0x2bebc0<_0x2ba18d;_0x2bebc0++){_0x4f2775[_0x2bebc0]['updateAttributes']({'exitAt':_0x423776});}}})['then'](function(){var _0x3f699e=[];var _0x3a0f9e=utils[_0x63a0('0xee')]();_0x3a0f9e[_0x63a0('0xe3')](function(_0x495f0b){_0x3f699e[_0x63a0('0xdf')]({'channel':_0x495f0b,'membername':_0x45b5e4[_0x63a0('0x3c')],'interface':_[_0x63a0('0x69')](_0x45b5e4['interface'])?util[_0x63a0('0x6b')](_0x63a0('0xd8'),_0x45b5e4[_0x63a0('0x3c')]):_0x45b5e4[_0x63a0('0x9e')],'type':_0x63a0('0xe7'),'enterAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4')),'data1':_0x5d9acb[_0x63a0('0x5f')][_0x63a0('0x50')]||'DEFAULT\x20PAUSE','role':_0x45b5e4[_0x63a0('0x3b')],'internal':_0x45b5e4[_0x63a0('0x6d')]});});return db[_0x63a0('0xe2')][_0x63a0('0x5d')](_0x3f699e,{'individualHooks':!![]});})[_0x63a0('0x1d')](function(){return _0x45b5e4['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5d9acb[_0x63a0('0x5f')]['type']||_0x63a0('0xef'),'lastPauseAt':moment()[_0x63a0('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x50e595,null))[_0x63a0('0x26')](handleError(_0x50e595,null));};exports[_0x63a0('0xf0')]=function(_0x18a6b5,_0x46af70,_0x54b4ae){var _0x8a5627;return db[_0x63a0('0x3f')]['find']({'where':{'id':_0x18a6b5[_0x63a0('0x59')]['id']},'attributes':['id','name',_0x63a0('0x3b'),_0x63a0('0x9d'),_0x63a0('0xf1'),_0x63a0('0xf2'),_0x63a0('0xf3'),'openchannelPause',_0x63a0('0xf4'),'pauseType',_0x63a0('0xf5')]})['then'](handleEntityNotFound(_0x46af70,null))['then'](function(_0x4ef0e5){if(_0x4ef0e5){_0x8a5627=_0x4ef0e5;if(_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')]&&!utils['isValidChannel'](_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')])){throw new db[(_0x63a0('0x91'))][(_0x63a0('0x92'))](_0x63a0('0xa0'));}switch(_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')]){case _0x63a0('0xa9'):return respondWithRpcPromise(_0x63a0('0xec'),_0x63a0('0xf0'),{'id':_0x8a5627['id'],'name':_0x8a5627[_0x63a0('0x3c')],'pause':![]})[_0x63a0('0x1d')](function(){return db[_0x63a0('0xac')][_0x63a0('0x5e')]({'paused':0x0},{'where':{'UserId':_0x8a5627['id']},'individualHooks':!![]});})['then'](function(){return db[_0x63a0('0xe2')][_0x63a0('0x3a')]({'where':{'channel':_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')],'membername':_0x8a5627[_0x63a0('0x3c')],'type':'PAUSE','exitAt':null}});})[_0x63a0('0x1d')](function(_0x191b7a){if(_0x191b7a){return _0x191b7a[_0x63a0('0x5e')]({'exitAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4')),'data2':_0x63a0('0xf6')},{'individualHooks':!![]});}return null;})[_0x63a0('0x1d')](function(){return _0x8a5627[_0x63a0('0x5e')]({'voicePause':![]});});case'mail':case'chat':case'fax':case'sms':case _0x63a0('0xf7'):return db[_0x63a0('0xe2')]['find']({'where':{'channel':_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')],'membername':_0x8a5627[_0x63a0('0x3c')],'type':'PAUSE','exitAt':null}})[_0x63a0('0x1d')](function(_0xa4d606){if(_0xa4d606){return _0xa4d606['update']({'exitAt':moment()[_0x63a0('0x6b')](_0x63a0('0xe4')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x546530={};_['set'](_0x546530,util[_0x63a0('0x6b')](_0x63a0('0xf8'),_0x18a6b5[_0x63a0('0x5f')][_0x63a0('0xaf')],'Pause'),![]);return _0x8a5627['update'](_0x546530);});default:return respondWithRpcPromise(_0x63a0('0xec'),_0x63a0('0xf0'),{'id':_0x8a5627['id'],'name':_0x8a5627[_0x63a0('0x3c')],'pause':![]})[_0x63a0('0x1d')](function(){return db[_0x63a0('0xac')][_0x63a0('0x5e')]({'paused':0x0},{'where':{'UserId':_0x8a5627['id']}});})['then'](function(){return db[_0x63a0('0xe2')][_0x63a0('0xc3')]({'where':{'membername':_0x8a5627['name'],'type':_0x63a0('0xe7'),'exitAt':null}});})[_0x63a0('0x1d')](function(_0x359ab0){var _0x56412a=[];_0x359ab0[_0x63a0('0xe3')](function(_0x868b9b){_0x56412a['push'](_0x868b9b['update']({'exitAt':moment()[_0x63a0('0x6b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x63a0('0xf6')}));});return BPromise[_0x63a0('0xe5')](_0x56412a);})['then'](function(){return _0x8a5627[_0x63a0('0x5e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x63a0('0x1d')](respondWithResult(_0x46af70,null))[_0x63a0('0x26')](handleError(_0x46af70,null));};exports[_0x63a0('0xf9')]=function(_0x4b3a42,_0x3c768f,_0x4b16d7){var _0x2e2227={};var _0x139d60={};var _0x313fd3;var _0x2c00b5;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x4b3a42[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x3c768f,null))[_0x63a0('0x1d')](function(_0x57d63c){if(_0x57d63c){_0x313fd3=_0x57d63c;_0x139d60[_0x63a0('0x41')]=_[_0x63a0('0x43')](db[_0x63a0('0xfa')][_0x63a0('0x40')]);_0x139d60[_0x63a0('0x45')]=_['keys'](_0x4b3a42[_0x63a0('0x45')]);_0x139d60[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x139d60[_0x63a0('0x41')],_0x139d60[_0x63a0('0x45')]);_0x2e2227['attributes']=_[_0x63a0('0x5b')](_0x139d60['model'],qs[_0x63a0('0x47')](_0x4b3a42[_0x63a0('0x45')][_0x63a0('0x47')]));_0x2e2227[_0x63a0('0x48')]=_0x2e2227['attributes'][_0x63a0('0x5c')]?_0x2e2227[_0x63a0('0x48')]:_0x139d60[_0x63a0('0x41')];_0x2e2227[_0x63a0('0xbb')]=qs['sort'](_0x4b3a42[_0x63a0('0x45')][_0x63a0('0x4c')]);_0x2e2227[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x4b3a42[_0x63a0('0x45')],_0x139d60[_0x63a0('0x46')]));if(_0x4b3a42[_0x63a0('0x45')]['filter']){_0x2e2227[_0x63a0('0x4e')]=_[_0x63a0('0x4f')](_0x2e2227[_0x63a0('0x4e')],{'$or':_['map'](_0x2e2227['attributes'],function(_0x159eae){var _0x9d1bc8={};_0x9d1bc8[_0x159eae]={'$like':'%'+_0x4b3a42[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x9d1bc8;})});}_0x2e2227=_[_0x63a0('0x4f')]({},_0x2e2227,_0x4b3a42[_0x63a0('0x55')]);return _0x313fd3[_0x63a0('0xf9')](_0x2e2227);}})['then'](function(_0x391214){if(_0x391214){_0x2c00b5=_0x391214[_0x63a0('0x5c')];if(!_0x4b3a42['query'][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x2e2227[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x4b3a42[_0x63a0('0x45')][_0x63a0('0x4b')]);_0x2e2227[_0x63a0('0x2b')]=qs[_0x63a0('0x2b')](_0x4b3a42[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x313fd3[_0x63a0('0xf9')](_0x2e2227);}})[_0x63a0('0x1d')](function(_0x68c0f2){if(_0x68c0f2){return _0x68c0f2?{'count':_0x2c00b5,'rows':_0x68c0f2}:null;}})[_0x63a0('0x1d')](respondWithResult(_0x3c768f,null))[_0x63a0('0x26')](handleError(_0x3c768f,null));};exports[_0x63a0('0xfb')]=function(_0x28172e,_0x3b638e,_0x3229bd){return db['User'][_0x63a0('0x3a')]({'where':{'id':_0x28172e['params']['id']}})['then'](handleEntityNotFound(_0x3b638e,null))['then'](function(_0xc160e){if(_0xc160e){return _0xc160e[_0x63a0('0xfb')](_0x28172e[_0x63a0('0x5f')][_0x63a0('0x62')],_['omit'](_0x28172e[_0x63a0('0x5f')],[_0x63a0('0x62'),'id'])||{});}})['then'](respondWithResult(_0x3b638e,null))[_0x63a0('0x26')](handleError(_0x3b638e,null));};exports['removeTeams']=function(_0x22f13a,_0x4b837b,_0x1aae1f){return db[_0x63a0('0x3f')][_0x63a0('0x3a')]({'where':{'id':_0x22f13a[_0x63a0('0x59')]['id']}})['then'](handleEntityNotFound(_0x4b837b,null))[_0x63a0('0x1d')](function(_0x5c513d){if(_0x5c513d){return _0x5c513d[_0x63a0('0xfc')](_0x22f13a[_0x63a0('0x45')]['ids']);}})[_0x63a0('0x1d')](respondWithStatusCode(_0x4b837b,null))[_0x63a0('0x26')](handleError(_0x4b837b,null));};exports['getLists']=function(_0x1e6a6d,_0x4f667e,_0x424a1e){var _0x2014e6={};var _0x16dadc={};var _0x247ec1;var _0x3ba2d7;return db['User'][_0x63a0('0x9a')]({'where':{'id':_0x1e6a6d[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x4f667e,null))[_0x63a0('0x1d')](function(_0x5e9615){if(_0x5e9615){_0x247ec1=_0x5e9615;_0x16dadc[_0x63a0('0x41')]=_[_0x63a0('0x43')](db[_0x63a0('0xbc')][_0x63a0('0x40')]);_0x16dadc[_0x63a0('0x45')]=_[_0x63a0('0x43')](_0x1e6a6d[_0x63a0('0x45')]);_0x16dadc['filters']=_[_0x63a0('0x5b')](_0x16dadc[_0x63a0('0x41')],_0x16dadc[_0x63a0('0x45')]);_0x2014e6[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x16dadc[_0x63a0('0x41')],qs[_0x63a0('0x47')](_0x1e6a6d['query']['fields']));_0x2014e6[_0x63a0('0x48')]=_0x2014e6['attributes']['length']?_0x2014e6['attributes']:_0x16dadc[_0x63a0('0x41')];_0x2014e6[_0x63a0('0xbb')]=qs[_0x63a0('0x4c')](_0x1e6a6d['query']['sort']);_0x2014e6[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_['pick'](_0x1e6a6d[_0x63a0('0x45')],_0x16dadc[_0x63a0('0x46')]));if(_0x1e6a6d['query'][_0x63a0('0x36')]){_0x2014e6[_0x63a0('0x4e')]=_['merge'](_0x2014e6['where'],{'$or':_[_0x63a0('0x37')](_0x2014e6[_0x63a0('0x48')],function(_0x24ed71){var _0x425d80={};_0x425d80[_0x24ed71]={'$like':'%'+_0x1e6a6d[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x425d80;})});}_0x2014e6=_[_0x63a0('0x4f')]({},_0x2014e6,_0x1e6a6d[_0x63a0('0x55')]);return _0x247ec1[_0x63a0('0xfd')](_0x2014e6);}})[_0x63a0('0x1d')](function(_0x3598bd){if(_0x3598bd){_0x3ba2d7=_0x3598bd['length'];if(!_0x1e6a6d[_0x63a0('0x45')][_0x63a0('0x49')](_0x63a0('0x4a'))){_0x2014e6[_0x63a0('0x4b')]=qs[_0x63a0('0x4b')](_0x1e6a6d['query'][_0x63a0('0x4b')]);_0x2014e6['offset']=qs[_0x63a0('0x2b')](_0x1e6a6d[_0x63a0('0x45')][_0x63a0('0x2b')]);}return _0x247ec1[_0x63a0('0xfd')](_0x2014e6);}})['then'](function(_0x1b0645){if(_0x1b0645){return _0x1b0645?{'count':_0x3ba2d7,'rows':_0x1b0645}:null;}})['then'](respondWithResult(_0x4f667e,null))[_0x63a0('0x26')](handleError(_0x4f667e,null));};exports[_0x63a0('0xfe')]=function(_0x4b5460,_0x51f866,_0x5c2d84){var _0x59d3f7={};var _0x174bf6={};var _0x3a24c9;var _0x393374;return db[_0x63a0('0x3f')][_0x63a0('0x9a')]({'where':{'id':_0x4b5460[_0x63a0('0x59')]['id']}})[_0x63a0('0x1d')](handleEntityNotFound(_0x51f866,null))[_0x63a0('0x1d')](function(_0x2b937c){if(_0x2b937c){_0x3a24c9=_0x2b937c;_0x174bf6[_0x63a0('0x41')]=_[_0x63a0('0x43')](db['User'][_0x63a0('0x40')]);_0x174bf6['query']=_[_0x63a0('0x43')](_0x4b5460['query']);_0x174bf6[_0x63a0('0x46')]=_[_0x63a0('0x5b')](_0x174bf6['model'],_0x174bf6[_0x63a0('0x45')]);_0x59d3f7[_0x63a0('0x48')]=_[_0x63a0('0x5b')](_0x174bf6[_0x63a0('0x41')],qs['fields'](_0x4b5460[_0x63a0('0x45')]['fields']));_0x59d3f7[_0x63a0('0x48')]=_0x59d3f7[_0x63a0('0x48')]['length']?_0x59d3f7['attributes']:_0x174bf6[_0x63a0('0x41')];_0x59d3f7[_0x63a0('0xbb')]=qs[_0x63a0('0x4c')](_0x4b5460[_0x63a0('0x45')]['sort']);_0x59d3f7[_0x63a0('0x4e')]=qs[_0x63a0('0x46')](_[_0x63a0('0x4d')](_0x4b5460[_0x63a0('0x45')],_0x174bf6[_0x63a0('0x46')]));if(_0x4b5460[_0x63a0('0x45')]['filter']){_0x59d3f7[_0x63a0('0x4e')]=_['merge'](_0x59d3f7[_0x63a0('0x4e')],{'$or':_[_0x63a0('0x37')](_0x59d3f7[_0x63a0('0x48')],function(_0x71147b){var _0x5819f9={};_0x5819f9[_0x71147b]={'$like':'%'+_0x4b5460[_0x63a0('0x45')][_0x63a0('0x36')]+'%'};return _0x5819f9;})});}_0x59d3f7['model']=db[_0x63a0('0x3f')];_0x59d3f7['as']=_0x63a0('0x33');_0x59d3f7=_[_0x63a0('0x4f')]({},_0x59d3f7,_0x4b5460[_0x63a0('0x55')]);return _0x3a24c9[_0x63a0('0xde')]({'include':[_0x59d3f7]});}})[_0x63a0('0x1d')](function(_0x1e0a4a){if(_0x1e0a4a){var _0x2fc769={},_0x5a1def=[],_0x200e80=0x0;for(var _0x13a44f=0x0;_0x13a44f<_0x1e0a4a[_0x63a0('0x5c')];_0x13a44f+=0x1){for(var _0x3d41fe=0x0,_0x20a64a;_0x3d41fe<_0x1e0a4a[_0x13a44f][_0x63a0('0x33')]['length'];_0x3d41fe+=0x1){_0x20a64a=_0x1e0a4a[_0x13a44f][_0x63a0('0x33')][_0x3d41fe]['get']({'plain':!![]});_0x2fc769[_0x20a64a['id']]=_0x20a64a;}}_0x2fc769=_[_0x63a0('0xff')](_0x2fc769);for(var _0x2a7f32=qs['offset'](_0x4b5460[_0x63a0('0x45')][_0x63a0('0x2b')]);_0x2a7f32<_0x2fc769[_0x63a0('0x5c')]&&_0x5a1def[_0x63a0('0x5c')]=_0x4a3d7e){_0x158c33=_0x4a3d7e;_0x2a1dc9=0xc8;}else{_0x2a1dc9=0xce;}_0x40c48d[_0xc318('0x29')](_0x2a1dc9);return _0x40c48d[_0xc318('0x2f')](_0xc318('0x30'),_0x58234f+'-'+_0x158c33+'/'+_0x4a3d7e)[_0xc318('0x2b')](_0x3946eb);}return null;};}function patchUpdates(_0x4f01f6){return function(_0x2ea07e){try{jsonpatch[_0xc318('0x31')](_0x2ea07e,_0x4f01f6,!![]);}catch(_0x1de056){return BPromise[_0xc318('0x32')](_0x1de056);}return _0x2ea07e[_0xc318('0x33')]();};}function saveUpdates(_0x2ac40c,_0x35cc95){return function(_0x20997e){if(_0x20997e){return _0x20997e[_0xc318('0x34')](_0x2ac40c)['then'](function(_0xb0deb7){return _0xb0deb7;});}return null;};}function removeEntity(_0x89549f,_0x35f337){return function(_0x1d18eb){if(_0x1d18eb){return _0x1d18eb[_0xc318('0x35')]()[_0xc318('0x36')](function(){var _0x1f96e6=_0x1d18eb[_0xc318('0x37')]({'plain':!![]});var _0x49538b=[{'name':_0xc318('0x38'),'value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0xc318('0x39'),'value':_0xc318('0x3a'),'ignore':![]}];var _0x3a4a31=_(_0x49538b)[_0xc318('0x3b')](_0xc318('0x3c'))[_0xc318('0x3d')](_0xc318('0x3e'))[_0xc318('0x3e')]();if(_['includes'](_0x3a4a31,_0x1f96e6[_0xc318('0x3f')])){return;}var _0x7a43cb=_['find'](_0x49538b,['value',_0x1f96e6[_0xc318('0x3f')]])[_0xc318('0x40')];return db[_0xc318('0x41')]['destroy']({'where':{'type':_0x7a43cb,'resourceId':_0x1f96e6['id']}})[_0xc318('0x36')](function(){return _0x1d18eb;});})[_0xc318('0x36')](function(){_0x89549f[_0xc318('0x29')](0xcc)[_0xc318('0x2a')]();});}};}function handleEntityNotFound(_0x345c19,_0x232a05){return function(_0x12a539){if(!_0x12a539){_0x345c19[_0xc318('0x42')](0x194);}return _0x12a539;};}function handleError(_0x355d49,_0x5c8be7){_0x5c8be7=_0x5c8be7||0x1f4;return function(_0x2fc135){logger[_0xc318('0x26')](_0x2fc135[_0xc318('0x43')]);if(_0x2fc135['name']){delete _0x2fc135[_0xc318('0x40')];}_0x355d49['status'](_0x5c8be7)[_0xc318('0x44')](_0x2fc135);};}exports[_0xc318('0x45')]=function(_0x437d3b,_0x28332a){var _0xd25f6c={},_0x5b6e44={},_0x4dc08a={'count':0x0,'rows':[]};var _0x1457b9=db[_0xc318('0x46')][_0xc318('0x47')];_0x5b6e44[_0xc318('0x48')]=_[_0xc318('0x49')](_['keys'](_0x1457b9),[_0xc318('0x4a'),'salt']);_0x5b6e44['query']=_[_0xc318('0x4b')](_0x437d3b[_0xc318('0x4c')]);_0x5b6e44[_0xc318('0x4d')]=_['intersection'](_0x5b6e44[_0xc318('0x48')],_0x5b6e44[_0xc318('0x4c')]);_0xd25f6c[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x5b6e44[_0xc318('0x48')],qs[_0xc318('0x50')](_0x437d3b[_0xc318('0x4c')][_0xc318('0x50')]));_0xd25f6c[_0xc318('0x4e')]=_0xd25f6c['attributes'][_0xc318('0x51')]?_0xd25f6c[_0xc318('0x4e')]:_0x5b6e44['model'];if(!_0x437d3b[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0xd25f6c[_0xc318('0x2e')]=qs['limit'](_0x437d3b[_0xc318('0x4c')][_0xc318('0x2e')]);_0xd25f6c[_0xc318('0x2d')]=qs[_0xc318('0x2d')](_0x437d3b[_0xc318('0x4c')][_0xc318('0x2d')]);}_0xd25f6c[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x437d3b[_0xc318('0x4c')][_0xc318('0x55')]);_0xd25f6c[_0xc318('0x56')]=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x437d3b[_0xc318('0x4c')],_0x5b6e44[_0xc318('0x4d')]));if(_0x437d3b['query']['filter']){_0xd25f6c['where']=_['merge'](_0xd25f6c['where'],{'$or':_[_0xc318('0x3d')](_0x1457b9,function(_0x351953){if(_0x351953[_0xc318('0x58')]['key']!==_0xc318('0x59')){return db['sequelize'][_0xc318('0x56')](db[_0xc318('0x5a')]['fn'](_0xc318('0x5b'),db[_0xc318('0x5a')]['col'](_0x351953[_0xc318('0x5c')])),{'$like':db[_0xc318('0x5a')]['fn']('lower','%'+_0x437d3b['query'][_0xc318('0x3b')]+'%')});}})});}_0xd25f6c=_['merge']({},_0xd25f6c,_0x437d3b[_0xc318('0x5d')]);var _0x37c9a3={'where':_0xd25f6c[_0xc318('0x56')]};return db[_0xc318('0x46')][_0xc318('0x2c')](_0x37c9a3)[_0xc318('0x36')](function(_0x1e9304){_0x4dc08a[_0xc318('0x2c')]=_0x1e9304;if(_0x437d3b[_0xc318('0x4c')][_0xc318('0x5e')]){_0xd25f6c[_0xc318('0x5f')]=[{'all':!![]}];}return db[_0xc318('0x46')][_0xc318('0x60')](_0xd25f6c);})[_0xc318('0x36')](function(_0x2e1e49){_0x4dc08a[_0xc318('0x61')]=_0x2e1e49;return _0x4dc08a;})['then'](respondWithFilteredResult(_0x28332a,_0xd25f6c))[_0xc318('0x62')](handleError(_0x28332a,null));};exports[_0xc318('0x63')]=function(_0x56d703,_0x4bd1e1){var _0x2b30e8={'raw':![],'where':{'id':_0x56d703['params']['id']}},_0xc9b235={};_0xc9b235[_0xc318('0x48')]=_[_0xc318('0x49')](_[_0xc318('0x4b')](db[_0xc318('0x46')]['rawAttributes']),[_0xc318('0x4a'),'salt']);_0xc9b235['query']=_[_0xc318('0x4b')](_0x56d703[_0xc318('0x4c')]);_0xc9b235[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0xc9b235[_0xc318('0x48')],_0xc9b235['query']);_0x2b30e8['attributes']=_['intersection'](_0xc9b235[_0xc318('0x48')],qs['fields'](_0x56d703[_0xc318('0x4c')][_0xc318('0x50')]));_0x2b30e8['attributes']=_0x2b30e8[_0xc318('0x4e')]['length']?_0x2b30e8[_0xc318('0x4e')]:_0xc9b235[_0xc318('0x48')];if(_0x56d703[_0xc318('0x4c')][_0xc318('0x5e')]){_0x2b30e8[_0xc318('0x5f')]=[{'all':!![]}];}_0x2b30e8=_[_0xc318('0x64')]({},_0x2b30e8,_0x56d703[_0xc318('0x5d')]);return db['User'][_0xc318('0x65')](_0x2b30e8)['then'](handleEntityNotFound(_0x4bd1e1,null))[_0xc318('0x36')](respondWithResult(_0x4bd1e1,null))[_0xc318('0x62')](handleError(_0x4bd1e1,null));};exports[_0xc318('0x66')]=function(_0x4b8e0f,_0x4f3d13){return db[_0xc318('0x46')][_0xc318('0x66')](_0x4b8e0f[_0xc318('0x67')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4f3d13,0xc9))[_0xc318('0x62')](handleError(_0x4f3d13,null));};exports[_0xc318('0x34')]=function(_0x435d05,_0x22579e){if(_0x435d05['body']['id']){delete _0x435d05[_0xc318('0x67')]['id'];}delete _0x435d05[_0xc318('0x67')][_0xc318('0x3f')];return db['User']['find']({'where':{'id':_0x435d05[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x22579e,null))[_0xc318('0x36')](saveUpdates(_0x435d05['body'],null))[_0xc318('0x36')](respondWithResult(_0x22579e,null))['catch'](handleError(_0x22579e,null));};exports['describe']=function(_0x37cbd1,_0x3377b2){return db['User'][_0xc318('0x69')]()[_0xc318('0x36')](respondWithResult(_0x3377b2,null))['catch'](handleError(_0x3377b2,null));};exports['addContacts']=function(_0xa75c8a,_0x4bcf11,_0x4537c2){return db['User'][_0xc318('0x65')]({'where':{'id':_0xa75c8a[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x4bcf11,null))[_0xc318('0x36')](function(_0x192c05){if(_0x192c05){return _0x192c05[_0xc318('0x6a')](_0xa75c8a[_0xc318('0x67')]['ids'],_[_0xc318('0x6b')](_0xa75c8a[_0xc318('0x67')],[_0xc318('0x6c'),'id'])||{});}})[_0xc318('0x36')](respondWithResult(_0x4bcf11,null))[_0xc318('0x62')](handleError(_0x4bcf11,null));};var getLicense=function(_0x8467){return new BPromise(function(_0x307503,_0x3d8f5b){var _0x589476=0x0;_0x8467['body'][_0xc318('0x3f')]===_0xc318('0x6d')&&_0x307503(_0xc318('0x6e'));return db[_0xc318('0x46')]['count']({'where':{'$or':[{'role':_0x8467[_0xc318('0x67')][_0xc318('0x3f')]===_0xc318('0x3a')?_0xc318('0x3a'):[_0xc318('0x6f'),_0xc318('0x70')]}]}})[_0xc318('0x36')](function(_0x477ae1){_0x589476=_0x477ae1;return require(_0xc318('0x71'))['getLicense']();})['then'](function(_0x31aecf){var _0x561f56=_0x8467[_0xc318('0x67')][_0xc318('0x3f')]===_0xc318('0x3a')?_0xc318('0x72'):_0xc318('0x73');if(!_[_0xc318('0x74')](_0x31aecf[_0x561f56])&&_0x589476>=_0x31aecf[_0x561f56]){return _0x3d8f5b({'message':_0xc318('0x75')});}return _0x307503(util['format'](_0xc318('0x76'),_0x561f56,_0x589476));})['catch'](function(_0x4828de){return _0x3d8f5b(_0x4828de);});});};exports[_0xc318('0x77')]=function(_0x31f0f4,_0x31293c){return getLicense(_0x31f0f4)[_0xc318('0x36')](function(_0x5236f0){if(!_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]){var _0x490548;return db['Setting'][_0xc318('0x79')](0x1)[_0xc318('0x36')](function(_0x37a840){_0x37a840[_0xc318('0x7a')]=!![];return checkPasswordPattern(_0x37a840,_0x31f0f4['body'][_0xc318('0x4a')],_0x37a840[_0xc318('0x7a')]);})[_0xc318('0x36')](function(_0x2a8df8){_0x490548=_0x2a8df8['min_internal'];return db[_0xc318('0x46')][_0xc318('0x7b')](_0xc318('0x78'));})[_0xc318('0x36')](function(_0x1f77e5){if(_[_0xc318('0x74')](_0x1f77e5)){if(_0x490548){_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]=_0x490548;}else{_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]=0x1;}}else{if(_[_0xc318('0x74')](_0x490548)||_0x490548==_0x1f77e5){_0x31f0f4['body'][_0xc318('0x78')]=_0x1f77e5+0x1;}else if(_0x490548>_0x1f77e5){_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]=_0x490548;}else{return db['sequelize'][_0xc318('0x4c')](_0xc318('0x7c'),{'type':db[_0xc318('0x5a')][_0xc318('0x7d')][_0xc318('0x7e')]})[_0xc318('0x36')](function(_0x4119f5){if(_0x4119f5&&_0x4119f5[_0xc318('0x51')]){for(var _0x4d1388=0x0,_0x2d9e3f=_0x4119f5[_0xc318('0x51')];_0x4d1388<_0x2d9e3f&&_[_0xc318('0x74')](_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]);_0x4d1388++){if(_0x490548<=_0x4119f5[_0x4d1388][_0xc318('0x7f')]){_0x31f0f4[_0xc318('0x67')]['internal']=_0x4119f5[_0x4d1388][_0xc318('0x7f')];}else if(_0x490548>_0x4119f5[_0x4d1388][_0xc318('0x7f')]&&_0x490548<=_0x4119f5[_0x4d1388]['to']){_0x31f0f4[_0xc318('0x67')]['internal']=_0x490548;}}}if(_[_0xc318('0x74')](_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')])){_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')]=_0x1f77e5+0x1;}});}}});}})['then'](function(){if(_0x31f0f4['body'][_0xc318('0x80')]){_0x31f0f4[_0xc318('0x67')][_0xc318('0x81')]=_0x31f0f4['body'][_0xc318('0x78')];_0x31f0f4[_0xc318('0x67')][_0xc318('0x82')]={'mailbox':_0x31f0f4[_0xc318('0x67')][_0xc318('0x78')],'password':_0x31f0f4[_0xc318('0x67')][_0xc318('0x4a')],'fullname':_0x31f0f4[_0xc318('0x67')][_0xc318('0x83')],'email':_0x31f0f4[_0xc318('0x67')]['email']};}if(_0x31f0f4[_0xc318('0x67')]&&_0x31f0f4[_0xc318('0x67')][_0xc318('0x3f')]===_0xc318('0x6d')){_0x31f0f4[_0xc318('0x67')][_0xc318('0x84')]=[_0xc318('0x85'),_0xc318('0x86'),_0xc318('0x87'),_0xc318('0x88'),_0xc318('0x89'),'105',_0xc318('0x8a'),_0xc318('0x8b'),_0xc318('0x8c'),'109',_0xc318('0x8d'),'111'];}return db[_0xc318('0x46')][_0xc318('0x77')](_0x31f0f4[_0xc318('0x67')],{'include':[{'model':db[_0xc318('0x82')],'as':_0xc318('0x82')}]});})[_0xc318('0x36')](function(_0x3f28e1){if(_0x31f0f4[_0xc318('0x67')][_0xc318('0x3f')]===_0xc318('0x70'))return _0x3f28e1;var _0xdf014d=_0x31f0f4[_0xc318('0x70')][_0xc318('0x37')]({'plain':!![]});if(!_0xdf014d)throw new Error(_0xc318('0x8e'));if(_0xdf014d[_0xc318('0x3f')]===_0xc318('0x70')){var _0x475d2a=_0x3f28e1[_0xc318('0x37')]({'plain':!![]});var _0x5127b8=[{'name':_0xc318('0x8f'),'value':'agent'},{'name':_0xc318('0x39'),'value':'telephone'}];var _0x6ec02a=_[_0xc318('0x65')](_0x5127b8,[_0xc318('0x3e'),_0x475d2a[_0xc318('0x3f')]])[_0xc318('0x40')];return db[_0xc318('0x90')][_0xc318('0x65')]({'where':{'name':_0x6ec02a,'userProfileId':_0xdf014d[_0xc318('0x91')]},'raw':!![]})['then'](function(_0x597669){if(_0x597669&&_0x597669['autoAssociation']===0x0){return db[_0xc318('0x41')]['create']({'name':_0x475d2a[_0xc318('0x40')],'resourceId':_0x475d2a['id'],'type':_0x597669['name'],'sectionId':_0x597669['id']},{})[_0xc318('0x36')](function(){return _0x3f28e1;});}else{return _0x3f28e1;}})[_0xc318('0x62')](function(_0x1d708b){logger[_0xc318('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d708b);throw _0x1d708b;});}return _0x3f28e1;})['then'](respondWithResult(_0x31293c,0xc9))[_0xc318('0x62')](handleError(_0x31293c,null));};exports['changePassword']=function(_0x277e4b,_0x39f959,_0xaeaa1d){var _0x456fd7=![];if(_0x277e4b[_0xc318('0x67')]['id']){delete _0x277e4b[_0xc318('0x67')]['id'];}if(!_['isNil'](_0x277e4b['body']['oldPassword'])){if(_0x277e4b[_0xc318('0x67')][_0xc318('0x92')]===_0x277e4b['body']['newPassword']){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db['User'][_0xc318('0x65')]({'where':{'id':_0x277e4b['params']['id']}})[_0xc318('0x36')](function(_0x5215f6){if(_0x5215f6){if(_0x5215f6['id']==_0x277e4b[_0xc318('0x70')]['id']){if(!_0x277e4b[_0xc318('0x67')]['oldPassword']||!_0x277e4b[_0xc318('0x67')]['newPassword']){throw new db[(_0xc318('0x93'))]['ValidationError'](_0xc318('0x94'));}if(!_0x5215f6['authenticate'](_0x277e4b[_0xc318('0x67')]['oldPassword'])){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0x96'));}if(_0x277e4b[_0xc318('0x67')][_0xc318('0x92')]==_0x277e4b['body']['newPassword']){throw new db[(_0xc318('0x93'))]['ValidationError'](_0xc318('0x97'));}return _0x5215f6;}else if(_0x277e4b[_0xc318('0x70')]['role']==_0xc318('0x6f')){if(!_0x277e4b['body'][_0xc318('0x98')]){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x5215f6;}else if(_0x277e4b[_0xc318('0x70')]['role']==_0xc318('0x70')){if(!_0x277e4b[_0xc318('0x67')]['newPassword']){throw new db[(_0xc318('0x93'))]['ValidationError'](_0xc318('0x99'));}if(_0x5215f6['role']!='agent'){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0x9a'));}return _0x5215f6;}else{throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0x9a'));}}return null;})[_0xc318('0x36')](handleEntityNotFound(_0x39f959,null))[_0xc318('0x36')](function(_0x58a326){return db[_0xc318('0x9b')][_0xc318('0x9c')]({'attributes':['id','securePassword']})['then'](function(_0x21f673){_0x456fd7=_0x21f673[_0xc318('0x7a')];return checkPasswordPattern(_0x58a326,_0x277e4b['body']['newPassword'],_0x456fd7);});})[_0xc318('0x36')](saveUpdates({'password':_0x277e4b[_0xc318('0x67')][_0xc318('0x98')],'passwordResetAt':_0x277e4b[_0xc318('0x70')]['id']==_0x277e4b[_0xc318('0x68')]['id']?moment():null},null))[_0xc318('0x36')](respondWithResult(_0x39f959,null))[_0xc318('0x62')](handleError(_0x39f959,null));};exports[_0xc318('0x9d')]=function(_0x24146a,_0x3544a9,_0x23e4b4){var _0x3c8e83=_0x24146a[_0xc318('0x67')][_0xc318('0x9e')];return db[_0xc318('0x46')][_0xc318('0x65')]({'where':{'id':_0x24146a['params']['id']},'attributes':['id',_0xc318('0x40'),_0xc318('0x3f'),_0xc318('0x9f'),_0xc318('0xa0'),_0xc318('0xa1'),'interface']})[_0xc318('0x36')](handleEntityNotFound(_0x3544a9,null))[_0xc318('0x36')](function(_0x295b9b){if(_0x295b9b){if(!utils[_0xc318('0xa2')](_0x3c8e83)){throw new db['Sequelize'][(_0xc318('0x95'))]('Unknown\x20channel');}return _0x295b9b[_0xc318('0xa3')+_['capitalize'](_0x3c8e83[_0xc318('0xa4')]())+_0xc318('0xa5')](_0x24146a[_0xc318('0x67')][_0xc318('0x6c')],{'penalty':_0x24146a[_0xc318('0x67')]['penalty']||0x0})[_0xc318('0xa6')](function(_0x25ba62){for(var _0x5cf5ed=0x0;_0x5cf5ed<_0x24146a[_0xc318('0x67')]['ids'][_0xc318('0x51')];_0x5cf5ed+=0x1){var _0x52227a={'UserId':_0x24146a[_0xc318('0x68')]['id']};_0x52227a[_[_0xc318('0xa7')](_0x3c8e83[_0xc318('0xa4')]())+_0xc318('0xa8')]=_0x24146a['body']['ids'][_0x5cf5ed];socket[_0xc318('0xa9')](_0xc318('0x70')+_[_0xc318('0xa7')](_0x3c8e83['toLowerCase']())+_0xc318('0xaa'),_0x52227a);}return _0x25ba62;})['then'](function(){if(_0x3c8e83==='voice'){return db['VoiceQueue'][_0xc318('0x60')]({'where':{'id':_0x24146a[_0xc318('0x67')][_0xc318('0x6c')]||[]},'raw':!![],'attributes':['id',_0xc318('0x40')]});}})['then'](function(_0x488602){var _0x1eaf84=_0x295b9b['get']({'plain':!![]});var _0x9f3b37=[];if(_0x3c8e83===_0xc318('0xab')&&_0x1eaf84[_0xc318('0x3f')]===_0xc318('0x6d')&&_0x1eaf84['online']){for(var _0x39cc47=0x0;_0x39cc47<_0x488602[_0xc318('0x51')];_0x39cc47+=0x1){_0x9f3b37[_0xc318('0xac')]({'membername':_0x1eaf84[_0xc318('0x40')],'UserId':_0x1eaf84['id'],'queue_name':_0x488602[_0x39cc47][_0xc318('0x40')],'VoiceQueueId':_0x488602[_0x39cc47]['id'],'interface':_[_0xc318('0x74')](_0x1eaf84[_0xc318('0xad')])?util['format']('SIP/%s',_0x1eaf84[_0xc318('0x40')]):_0x1eaf84[_0xc318('0xad')],'paused':_0x1eaf84[_0xc318('0xa1')]||![],'penalty':_0x24146a[_0xc318('0x67')]['penalty']||0x0});}return BPromise[_0xc318('0xae')](_0x9f3b37,function(_0x588aaa){return db['UserVoiceQueueRt'][_0xc318('0xaf')](_0x588aaa);});}return _0x295b9b;});}})[_0xc318('0x36')](respondWithStatusCode(_0x3544a9,null))['catch'](handleError(_0x3544a9,null));};exports['removeQueues']=function(_0x37163e,_0x5129e5,_0x2e7f5d){var _0x5ebcd2;return db[_0xc318('0x46')]['find']({'where':{'id':_0x37163e['params']['id']},'attributes':['id','name',_0xc318('0x3f')]})['then'](handleEntityNotFound(_0x5129e5,null))[_0xc318('0x36')](function(_0x324b25){if(_0x324b25){_0x5ebcd2=_0x324b25;if(!_0x37163e['query'][_0xc318('0x9e')]||!utils[_0xc318('0xa2')](_0x37163e[_0xc318('0x4c')]['channel'])){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0xb0'));}return _0x324b25[_0xc318('0xb1')+_[_0xc318('0xa7')](_0x37163e['query'][_0xc318('0x9e')]['toLowerCase']())+'Queues'](_0x37163e['query']['ids']);}})[_0xc318('0x36')](function(_0x173d7b){for(var _0x4c2000=0x0;_0x4c2000<_0x37163e[_0xc318('0x4c')][_0xc318('0x6c')][_0xc318('0x51')];_0x4c2000+=0x1){var _0x2ea07b={'UserId':_0x37163e['params']['id']};_0x2ea07b[_['capitalize'](_0x37163e[_0xc318('0x4c')][_0xc318('0x9e')][_0xc318('0xa4')]())+_0xc318('0xa8')]=_0x37163e['query'][_0xc318('0x6c')][_0x4c2000];socket[_0xc318('0xa9')](_0xc318('0x70')+_['capitalize'](_0x37163e['query']['channel'][_0xc318('0xa4')]())+_0xc318('0xb2'),_0x2ea07b);}return _0x173d7b;})['then'](function(){if(_0x37163e[_0xc318('0x4c')]['channel']===_0xc318('0xab')){return db[_0xc318('0xb3')]['destroy']({'where':{'UserId':_0x37163e[_0xc318('0x68')]['id'],'VoiceQueueId':_0x37163e[_0xc318('0x4c')][_0xc318('0x6c')]},'individualHooks':!![]})[_0xc318('0x36')](function(){return _0x5ebcd2;});}return _0x5ebcd2;})[_0xc318('0x36')](respondWithStatusCode(_0x5129e5,null))[_0xc318('0x62')](handleError(_0x5129e5,null));};exports['addAvatar']=function(_0x162a0d,_0x166e0d,_0x3d23f4){_0x162a0d[_0xc318('0x67')]['userpic']=_0x162a0d[_0xc318('0xb4')][_0xc318('0xb5')];return db[_0xc318('0x46')][_0xc318('0x65')]({'where':{'id':_0x162a0d['params']['id']}})['then'](handleEntityNotFound(_0x166e0d,null))['then'](saveUpdates(_0x162a0d[_0xc318('0x67')],null))[_0xc318('0x36')](respondWithResult(_0x166e0d,null))['catch'](handleError(_0x166e0d,null));};exports[_0xc318('0xb6')]=function(_0x2c5019,_0x3346a3,_0x3e5087){var _0x1fb1af=path[_0xc318('0xb7')](config['root'],'server/files/images/logos/default_profile.png');return db['User'][_0xc318('0x65')]({'where':{'id':_0x2c5019[_0xc318('0x68')]['id']},'attributes':['id',_0xc318('0xb8')],'raw':!![]})[_0xc318('0x36')](handleEntityNotFound(_0x3346a3,null))[_0xc318('0x36')](function(_0x1899c6){if(_0x1899c6){if(_[_0xc318('0x74')](_0x1899c6[_0xc318('0xb8')])){return _0x3346a3[_0xc318('0xb9')](_0x1fb1af);}else{if(!fs[_0xc318('0xba')](path[_0xc318('0xb7')](config[_0xc318('0xbb')],_0xc318('0xbc'),_0x1899c6[_0xc318('0xb8')]))){return _0x3346a3[_0xc318('0xb9')](_0x1fb1af);}return _0x3346a3[_0xc318('0xb9')](path[_0xc318('0xb7')](config[_0xc318('0xbb')],'server/files/images/',_0x1899c6[_0xc318('0xb8')]));}}})['catch'](handleError(_0x3346a3,null));};exports[_0xc318('0xbd')]=function(_0x16b1b6,_0x17e605,_0x58cc5f){var _0x20295b={};var _0x3ffded={};var _0x18b3b1;var _0x58236f;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x16b1b6[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x17e605,null))[_0xc318('0x36')](function(_0x118f8f){if(_0x118f8f){_0x18b3b1=_0x118f8f;_0x3ffded[_0xc318('0x48')]=_['keys'](db[_0xc318('0xbe')][_0xc318('0x47')]);_0x3ffded[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x16b1b6[_0xc318('0x4c')]);_0x3ffded[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x3ffded[_0xc318('0x48')],_0x3ffded[_0xc318('0x4c')]);_0x20295b[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x3ffded[_0xc318('0x48')],qs['fields'](_0x16b1b6[_0xc318('0x4c')][_0xc318('0x50')]));_0x20295b[_0xc318('0x4e')]=_0x20295b[_0xc318('0x4e')][_0xc318('0x51')]?_0x20295b[_0xc318('0x4e')]:_0x3ffded[_0xc318('0x48')];_0x20295b[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x16b1b6['query'][_0xc318('0x55')]);_0x20295b[_0xc318('0x56')]=qs['filters'](_[_0xc318('0x57')](_0x16b1b6[_0xc318('0x4c')],_0x3ffded['filters']));if(_0x16b1b6[_0xc318('0x4c')][_0xc318('0x3b')]){_0x20295b[_0xc318('0x56')]=_['merge'](_0x20295b[_0xc318('0x56')],{'$or':_['map'](_0x20295b[_0xc318('0x4e')],function(_0x22c146){var _0x316fb3={};_0x316fb3[_0x22c146]={'$like':'%'+_0x16b1b6[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x316fb3;})});}_0x20295b=_[_0xc318('0x64')]({},_0x20295b,_0x16b1b6['options']);return _0x18b3b1[_0xc318('0xbd')](_0x20295b);}})[_0xc318('0x36')](function(_0x3b1975){if(_0x3b1975){_0x58236f=_0x3b1975[_0xc318('0x51')];if(_0x16b1b6[_0xc318('0x4c')]['hasOwnProperty'](_0xc318('0x5e'))){_0x20295b[_0xc318('0x5f')]=[{'model':db[_0xc318('0xbf')],'as':'List','required':![]},{'model':db[_0xc318('0xc0')],'as':_0xc318('0xc1'),'attributes':['id','name',_0xc318('0xc2')],'where':_0x16b1b6[_0xc318('0x4c')][_0xc318('0xc3')]?{'id':_0x16b1b6[_0xc318('0x4c')][_0xc318('0xc3')]}:undefined,'required':_0x16b1b6[_0xc318('0x4c')][_0xc318('0xc3')]?!![]:![]}];}if(!_0x16b1b6[_0xc318('0x4c')][_0xc318('0x52')]('nolimit')){_0x20295b[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x16b1b6['query'][_0xc318('0x2e')]);_0x20295b[_0xc318('0x2d')]=qs[_0xc318('0x2d')](_0x16b1b6['query'][_0xc318('0x2d')]);}return _0x18b3b1[_0xc318('0xbd')](_0x20295b);}})[_0xc318('0x36')](function(_0xd97e59){if(_0xd97e59){return _0xd97e59?{'count':_0x58236f,'rows':_0xd97e59}:null;}})[_0xc318('0x36')](respondWithResult(_0x17e605,null))[_0xc318('0x62')](handleError(_0x17e605,null));};exports['getQueues']=function(_0x4182ca,_0x502625,_0x597024){var _0x4bb187;var _0x5ebe3d;var _0x27bfe8={};var _0x1c84e8;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x4182ca[_0xc318('0x68')]['id']},'attributes':['id',_0xc318('0x40'),_0xc318('0x3f')]})[_0xc318('0x36')](handleEntityNotFound(_0x502625,null))[_0xc318('0x36')](function(_0x178a69){if(!utils[_0xc318('0xa2')](_0x4182ca[_0xc318('0x4c')]['channel'])){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0xb0'));}_0x4bb187=_0x178a69;var _0x4cfbd3={};_0x4cfbd3[_0xc318('0x48')]=_['keys'](db[_[_0xc318('0xa7')](_0x4182ca['query'][_0xc318('0x9e')])+_0xc318('0xc4')][_0xc318('0x47')]);_0x4cfbd3['query']=_[_0xc318('0x4b')](_0x4182ca[_0xc318('0x4c')]);_0x4cfbd3[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x4cfbd3[_0xc318('0x48')],_0x4cfbd3[_0xc318('0x4c')]);_0x27bfe8[_0xc318('0x4e')]=_['intersection'](_0x4cfbd3[_0xc318('0x48')],qs[_0xc318('0x50')](_0x4182ca[_0xc318('0x4c')][_0xc318('0x50')]));_0x27bfe8['attributes']=_0x27bfe8[_0xc318('0x4e')]['length']?_0x27bfe8['attributes']:_0x4cfbd3['model'];_0x27bfe8['order']=qs[_0xc318('0x55')](_0x4182ca[_0xc318('0x4c')]['sort']);_0x27bfe8[_0xc318('0x56')]=qs[_0xc318('0x4d')](_['pick'](_0x4182ca[_0xc318('0x4c')],_0x4cfbd3[_0xc318('0x4d')]));if(_0x4182ca['query']['filter']){_0x27bfe8[_0xc318('0x56')]=_[_0xc318('0x64')](_0x27bfe8[_0xc318('0x56')],{'$or':_[_0xc318('0x3d')](_0x27bfe8['attributes'],function(_0x127947){var _0x498be4={};_0x498be4[_0x127947]={'$like':'%'+_0x4182ca[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x498be4;})});}_0x27bfe8=_[_0xc318('0x64')]({},_0x27bfe8,_0x4182ca[_0xc318('0x5d')]);switch(_0x4bb187[_0xc318('0x3f')]){case _0xc318('0x6f'):return db[_[_0xc318('0xa7')](_0x4182ca[_0xc318('0x4c')]['channel'])+_0xc318('0xc4')][_0xc318('0x60')](_0x27bfe8);case _0xc318('0x70'):case _0xc318('0x6d'):return _0x4bb187[_0xc318('0x37')+_[_0xc318('0xa7')](_0x4182ca['query'][_0xc318('0x9e')])+'Queues'](_0x27bfe8);default:throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0xc5'));}})[_0xc318('0x36')](function(_0x5959be){_0x1c84e8=_0x5959be[_0xc318('0x51')];if(!_0x4182ca[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0x27bfe8[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x4182ca[_0xc318('0x4c')]['limit']);_0x27bfe8[_0xc318('0x2d')]=qs[_0xc318('0x2d')](_0x4182ca['query'][_0xc318('0x2d')]);}switch(_0x4bb187[_0xc318('0x3f')]){case _0xc318('0x6f'):return db[_[_0xc318('0xa7')](_0x4182ca[_0xc318('0x4c')][_0xc318('0x9e')])+_0xc318('0xc4')][_0xc318('0x60')](_0x27bfe8);case _0xc318('0x70'):case _0xc318('0x6d'):return _0x4bb187[_0xc318('0x37')+_['capitalize'](_0x4182ca[_0xc318('0x4c')][_0xc318('0x9e')])+_0xc318('0xa5')](_0x27bfe8);}})[_0xc318('0x36')](function(_0x4e8a9b){return{'count':_0x1c84e8,'rows':_0x4e8a9b};})['then'](respondWithResult(_0x502625,null))[_0xc318('0x62')](handleError(_0x502625,null));};exports[_0xc318('0xc6')]=function(_0x468883,_0x47acc3,_0x34a46d){var _0x40cead={};var _0x5c73c6={};var _0x210517;var _0x3c3fe1;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x468883[_0xc318('0x68')]['id']}})['then'](handleEntityNotFound(_0x47acc3,null))[_0xc318('0x36')](function(_0x25b72a){if(_0x25b72a){_0x210517=_0x25b72a;_0x5c73c6['model']=_['keys'](db[_0xc318('0xb3')][_0xc318('0x47')]);_0x5c73c6[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x468883[_0xc318('0x4c')]);_0x5c73c6['filters']=_[_0xc318('0x4f')](_0x5c73c6[_0xc318('0x48')],_0x5c73c6[_0xc318('0x4c')]);_0x40cead[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x5c73c6[_0xc318('0x48')],qs[_0xc318('0x50')](_0x468883[_0xc318('0x4c')][_0xc318('0x50')]));_0x40cead[_0xc318('0x4e')]=_0x40cead[_0xc318('0x4e')][_0xc318('0x51')]?_0x40cead[_0xc318('0x4e')]:_0x5c73c6[_0xc318('0x48')];_0x40cead[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x468883[_0xc318('0x4c')][_0xc318('0x55')]);_0x40cead[_0xc318('0x56')]=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x468883['query'],_0x5c73c6['filters']));if(_0x468883['query'][_0xc318('0x3b')]){_0x40cead[_0xc318('0x56')]=_[_0xc318('0x64')](_0x40cead[_0xc318('0x56')],{'$or':_['map'](_0x40cead['attributes'],function(_0x5ce92a){var _0x4d8c90={};_0x4d8c90[_0x5ce92a]={'$like':'%'+_0x468883[_0xc318('0x4c')]['filter']+'%'};return _0x4d8c90;})});}_0x40cead=_[_0xc318('0x64')]({},_0x40cead,_0x468883[_0xc318('0x5d')]);return _0x210517[_0xc318('0xc6')](_0x40cead);}})['then'](function(_0x14817c){if(_0x14817c){_0x3c3fe1=_0x14817c[_0xc318('0x51')];if(!_0x468883[_0xc318('0x4c')]['hasOwnProperty'](_0xc318('0x53'))){_0x40cead['limit']=qs[_0xc318('0x2e')](_0x468883[_0xc318('0x4c')][_0xc318('0x2e')]);_0x40cead['offset']=qs[_0xc318('0x2d')](_0x468883[_0xc318('0x4c')]['offset']);}return _0x210517[_0xc318('0xc6')](_0x40cead);}})['then'](function(_0x1075e3){if(_0x1075e3){return _0x1075e3?{'count':_0x3c3fe1,'rows':_0x1075e3}:null;}})[_0xc318('0x36')](respondWithResult(_0x47acc3,null))['catch'](handleError(_0x47acc3,null));};exports[_0xc318('0xc7')]=function(_0x3a808f,_0xd34089,_0x1d4175){var _0x1427ed={};var _0x4f3566={};var _0x1eff33;var _0x10197c;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x3a808f['params']['id']}})['then'](handleEntityNotFound(_0xd34089,null))[_0xc318('0x36')](function(_0x9fa13c){if(_0x9fa13c){_0x1eff33=_0x9fa13c;_0x4f3566['model']=_[_0xc318('0x4b')](db[_0xc318('0xc8')][_0xc318('0x47')]);_0x4f3566[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x3a808f[_0xc318('0x4c')]);_0x4f3566[_0xc318('0x4d')]=_['intersection'](_0x4f3566[_0xc318('0x48')],_0x4f3566[_0xc318('0x4c')]);_0x1427ed['attributes']=_[_0xc318('0x4f')](_0x4f3566[_0xc318('0x48')],qs[_0xc318('0x50')](_0x3a808f[_0xc318('0x4c')]['fields']));_0x1427ed[_0xc318('0x4e')]=_0x1427ed[_0xc318('0x4e')][_0xc318('0x51')]?_0x1427ed[_0xc318('0x4e')]:_0x4f3566[_0xc318('0x48')];_0x1427ed[_0xc318('0x54')]=qs['sort'](_0x3a808f[_0xc318('0x4c')][_0xc318('0x55')]);_0x1427ed[_0xc318('0x56')]=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x3a808f['query'],_0x4f3566[_0xc318('0x4d')]));if(_0x3a808f[_0xc318('0x4c')][_0xc318('0x3b')]){_0x1427ed[_0xc318('0x56')]=_['merge'](_0x1427ed[_0xc318('0x56')],{'$or':_[_0xc318('0x3d')](_0x1427ed[_0xc318('0x4e')],function(_0x229dde){var _0x3c83da={};_0x3c83da[_0x229dde]={'$like':'%'+_0x3a808f[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x3c83da;})});}_0x1427ed=_[_0xc318('0x64')]({},_0x1427ed,_0x3a808f['options']);return _0x1eff33[_0xc318('0xc7')](_0x1427ed);}})[_0xc318('0x36')](function(_0x52ca3d){if(_0x52ca3d){_0x10197c=_0x52ca3d[_0xc318('0x51')];if(!_0x3a808f[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0x1427ed[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x3a808f['query'][_0xc318('0x2e')]);_0x1427ed['offset']=qs['offset'](_0x3a808f[_0xc318('0x4c')]['offset']);}return _0x1eff33[_0xc318('0xc7')](_0x1427ed);}})[_0xc318('0x36')](function(_0x49a53e){if(_0x49a53e){return _0x49a53e?{'count':_0x10197c,'rows':_0x49a53e}:null;}})[_0xc318('0x36')](respondWithResult(_0xd34089,null))['catch'](handleError(_0xd34089,null));};exports[_0xc318('0xc9')]=function(_0x3d03c0,_0x319f18,_0x3f94c2){var _0x2b1b0c={'raw':!![],'where':{}};var _0x12332a={};var _0x4543a5={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3d03c0['params']['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x319f18,null))[_0xc318('0x36')](function(_0x226150){if(_0x226150){_0x12332a[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0xca')]['rawAttributes']);_0x12332a[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x3d03c0[_0xc318('0x4c')]);_0x12332a[_0xc318('0x4d')]=_['intersection'](_0x12332a[_0xc318('0x48')],_0x12332a[_0xc318('0x4c')]);_0x2b1b0c[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x12332a['model'],qs[_0xc318('0x50')](_0x3d03c0['query'][_0xc318('0x50')]));_0x2b1b0c[_0xc318('0x4e')]=_0x2b1b0c['attributes'][_0xc318('0x51')]?_0x2b1b0c[_0xc318('0x4e')]:_0x12332a[_0xc318('0x48')];if(!_0x3d03c0[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0x2b1b0c[_0xc318('0x2e')]=qs['limit'](_0x3d03c0['query']['limit']);_0x2b1b0c[_0xc318('0x2d')]=qs[_0xc318('0x2d')](_0x3d03c0['query'][_0xc318('0x2d')]);}_0x2b1b0c[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x3d03c0[_0xc318('0x4c')][_0xc318('0x55')]);_0x2b1b0c['where']=qs[_0xc318('0x4d')](_['pick'](_0x3d03c0[_0xc318('0x4c')],_0x12332a[_0xc318('0x4d')]));_0x2b1b0c[_0xc318('0x56')][_0xc318('0xcb')]=_0x226150['id'];if(_0x3d03c0[_0xc318('0x4c')][_0xc318('0x3b')]){_0x2b1b0c[_0xc318('0x56')]=_[_0xc318('0x64')](_0x2b1b0c[_0xc318('0x56')],{'$or':_[_0xc318('0x3d')](_0x2b1b0c[_0xc318('0x4e')],function(_0x124bcd){var _0x618f5a={};_0x618f5a[_0x124bcd]={'$like':'%'+_0x3d03c0[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x618f5a;})});}_0x2b1b0c=_[_0xc318('0x64')]({},_0x2b1b0c,_0x3d03c0['options']);return db[_0xc318('0xca')][_0xc318('0x2c')]({'where':_0x2b1b0c[_0xc318('0x56')]})[_0xc318('0x36')](function(_0x172fd3){_0x4543a5[_0xc318('0x2c')]=_0x172fd3;if(_0x3d03c0[_0xc318('0x4c')][_0xc318('0x5e')]){_0x2b1b0c['include']=[{'all':!![]}];}return db[_0xc318('0xca')]['findAll'](_0x2b1b0c);})['then'](function(_0x4d10e5){_0x4543a5[_0xc318('0x61')]=_0x4d10e5;return _0x4543a5;});}})[_0xc318('0x36')](respondWithFilteredResult(_0x319f18,_0x2b1b0c))['catch'](handleError(_0x319f18,null));};exports[_0xc318('0xcc')]=function(_0x296dc7,_0x5ec097,_0x5716df){var _0x3eddb2={'raw':!![],'where':{}};var _0x51b3e9={};var _0x633b12={'count':0x0,'rows':[]};return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x296dc7[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x5ec097,null))['then'](function(_0x4f5cc2){if(_0x4f5cc2){_0x51b3e9[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0xcd')][_0xc318('0x47')]);_0x51b3e9[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x296dc7[_0xc318('0x4c')]);_0x51b3e9['filters']=_[_0xc318('0x4f')](_0x51b3e9[_0xc318('0x48')],_0x51b3e9[_0xc318('0x4c')]);_0x3eddb2[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x51b3e9[_0xc318('0x48')],qs[_0xc318('0x50')](_0x296dc7[_0xc318('0x4c')][_0xc318('0x50')]));_0x3eddb2[_0xc318('0x4e')]=_0x3eddb2['attributes']['length']?_0x3eddb2[_0xc318('0x4e')]:_0x51b3e9[_0xc318('0x48')];if(!_0x296dc7['query']['hasOwnProperty'](_0xc318('0x53'))){_0x3eddb2[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x296dc7[_0xc318('0x4c')][_0xc318('0x2e')]);_0x3eddb2['offset']=qs[_0xc318('0x2d')](_0x296dc7[_0xc318('0x4c')][_0xc318('0x2d')]);}_0x3eddb2[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x296dc7[_0xc318('0x4c')][_0xc318('0x55')]);_0x3eddb2[_0xc318('0x56')]=qs['filters'](_[_0xc318('0x57')](_0x296dc7[_0xc318('0x4c')],_0x51b3e9[_0xc318('0x4d')]));_0x3eddb2['where'][_0xc318('0xcb')]=_0x4f5cc2['id'];if(_0x296dc7[_0xc318('0x4c')][_0xc318('0x3b')]){_0x3eddb2['where']=_[_0xc318('0x64')](_0x3eddb2['where'],{'$or':_['map'](_0x3eddb2['attributes'],function(_0x3ebca2){var _0x341774={};_0x341774[_0x3ebca2]={'$like':'%'+_0x296dc7['query'][_0xc318('0x3b')]+'%'};return _0x341774;})});}_0x3eddb2=_['merge']({},_0x3eddb2,_0x296dc7[_0xc318('0x5d')]);return db[_0xc318('0xcd')][_0xc318('0x2c')]({'where':_0x3eddb2['where']})[_0xc318('0x36')](function(_0x1dadc5){_0x633b12[_0xc318('0x2c')]=_0x1dadc5;if(_0x296dc7[_0xc318('0x4c')][_0xc318('0x5e')]){_0x3eddb2[_0xc318('0x5f')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc318('0x60')](_0x3eddb2);})[_0xc318('0x36')](function(_0x13cd67){_0x633b12[_0xc318('0x61')]=_0x13cd67;return _0x633b12;});}})['then'](respondWithFilteredResult(_0x5ec097,_0x3eddb2))[_0xc318('0x62')](handleError(_0x5ec097,null));};exports[_0xc318('0xce')]=function(_0x233efb,_0x15594f,_0x21dddb){var _0x41cf74={};var _0x1148b8={};var _0x1afc6c;var _0x420d28;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x233efb[_0xc318('0x68')]['id']}})['then'](handleEntityNotFound(_0x15594f,null))[_0xc318('0x36')](function(_0x372820){if(_0x372820){_0x1afc6c=_0x372820;_0x1148b8['model']=_[_0xc318('0x4b')](db[_0xc318('0xcf')]['rawAttributes']);_0x1148b8[_0xc318('0x4c')]=_['keys'](_0x233efb[_0xc318('0x4c')]);_0x1148b8[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x1148b8[_0xc318('0x48')],_0x1148b8[_0xc318('0x4c')]);_0x41cf74[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x1148b8[_0xc318('0x48')],qs['fields'](_0x233efb[_0xc318('0x4c')][_0xc318('0x50')]));_0x41cf74['attributes']=_0x41cf74['attributes']['length']?_0x41cf74[_0xc318('0x4e')]:_0x1148b8['model'];_0x41cf74[_0xc318('0x54')]=qs['sort'](_0x233efb[_0xc318('0x4c')][_0xc318('0x55')]);_0x41cf74['where']=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x233efb['query'],_0x1148b8['filters']));if(_0x233efb['query'][_0xc318('0x3b')]){_0x41cf74[_0xc318('0x56')]=_[_0xc318('0x64')](_0x41cf74['where'],{'$or':_[_0xc318('0x3d')](_0x41cf74[_0xc318('0x4e')],function(_0x27cd15){var _0x183639={};_0x183639[_0x27cd15]={'$like':'%'+_0x233efb['query']['filter']+'%'};return _0x183639;})});}_0x41cf74=_[_0xc318('0x64')]({},_0x41cf74,_0x233efb[_0xc318('0x5d')]);return _0x1afc6c[_0xc318('0xce')](_0x41cf74);}})[_0xc318('0x36')](function(_0x503e79){if(_0x503e79){_0x420d28=_0x503e79[_0xc318('0x51')];if(!_0x233efb[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0x41cf74[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x233efb['query'][_0xc318('0x2e')]);_0x41cf74[_0xc318('0x2d')]=qs[_0xc318('0x2d')](_0x233efb[_0xc318('0x4c')][_0xc318('0x2d')]);}return _0x1afc6c[_0xc318('0xce')](_0x41cf74);}})[_0xc318('0x36')](function(_0x2e904c){if(_0x2e904c){return _0x2e904c?{'count':_0x420d28,'rows':_0x2e904c}:null;}})[_0xc318('0x36')](respondWithResult(_0x15594f,null))['catch'](handleError(_0x15594f,null));};exports['getOpenchannelInteractions']=function(_0x27f1a8,_0x43d88c,_0x4d74ed){var _0x192f16={};var _0x5db841={};var _0x2bcdf0;var _0x3f65dd;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x27f1a8[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x43d88c,null))['then'](function(_0x3cf463){if(_0x3cf463){_0x2bcdf0=_0x3cf463;_0x5db841['model']=_[_0xc318('0x4b')](db[_0xc318('0xd0')][_0xc318('0x47')]);_0x5db841[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x27f1a8[_0xc318('0x4c')]);_0x5db841[_0xc318('0x4d')]=_['intersection'](_0x5db841['model'],_0x5db841[_0xc318('0x4c')]);_0x192f16[_0xc318('0x4e')]=_['intersection'](_0x5db841[_0xc318('0x48')],qs['fields'](_0x27f1a8['query'][_0xc318('0x50')]));_0x192f16[_0xc318('0x4e')]=_0x192f16[_0xc318('0x4e')][_0xc318('0x51')]?_0x192f16[_0xc318('0x4e')]:_0x5db841[_0xc318('0x48')];_0x192f16['order']=qs[_0xc318('0x55')](_0x27f1a8[_0xc318('0x4c')]['sort']);_0x192f16['where']=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x27f1a8['query'],_0x5db841[_0xc318('0x4d')]));if(_0x27f1a8['query']['filter']){_0x192f16[_0xc318('0x56')]=_[_0xc318('0x64')](_0x192f16['where'],{'$or':_[_0xc318('0x3d')](_0x192f16[_0xc318('0x4e')],function(_0x46b11b){var _0x3024e3={};_0x3024e3[_0x46b11b]={'$like':'%'+_0x27f1a8[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x3024e3;})});}_0x192f16=_['merge']({},_0x192f16,_0x27f1a8['options']);return _0x2bcdf0['getOpenchannelInteractions'](_0x192f16);}})['then'](function(_0x9869c2){if(_0x9869c2){_0x3f65dd=_0x9869c2[_0xc318('0x51')];if(!_0x27f1a8['query']['hasOwnProperty'](_0xc318('0x53'))){_0x192f16[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x27f1a8[_0xc318('0x4c')][_0xc318('0x2e')]);_0x192f16['offset']=qs[_0xc318('0x2d')](_0x27f1a8[_0xc318('0x4c')]['offset']);}return _0x2bcdf0[_0xc318('0xd1')](_0x192f16);}})['then'](function(_0x108413){if(_0x108413){return _0x108413?{'count':_0x3f65dd,'rows':_0x108413}:null;}})[_0xc318('0x36')](respondWithResult(_0x43d88c,null))[_0xc318('0x62')](handleError(_0x43d88c,null));};exports[_0xc318('0xd2')]=function(_0x3f3e20,_0x33f155,_0x2ffd10){var _0x37de08={'raw':!![],'where':{}};var _0x5d6388={};var _0x39c6b9={'count':0x0,'rows':[]};return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x3f3e20[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x33f155,null))[_0xc318('0x36')](function(_0x354c1b){if(_0x354c1b){_0x5d6388[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0xd3')][_0xc318('0x47')]);_0x5d6388[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x3f3e20[_0xc318('0x4c')]);_0x5d6388['filters']=_[_0xc318('0x4f')](_0x5d6388[_0xc318('0x48')],_0x5d6388[_0xc318('0x4c')]);_0x37de08[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x5d6388[_0xc318('0x48')],qs[_0xc318('0x50')](_0x3f3e20['query']['fields']));_0x37de08[_0xc318('0x4e')]=_0x37de08[_0xc318('0x4e')]['length']?_0x37de08[_0xc318('0x4e')]:_0x5d6388['model'];if(!_0x3f3e20[_0xc318('0x4c')][_0xc318('0x52')](_0xc318('0x53'))){_0x37de08['limit']=qs[_0xc318('0x2e')](_0x3f3e20[_0xc318('0x4c')]['limit']);_0x37de08['offset']=qs[_0xc318('0x2d')](_0x3f3e20[_0xc318('0x4c')][_0xc318('0x2d')]);}_0x37de08[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x3f3e20['query']['sort']);_0x37de08['where']=qs['filters'](_[_0xc318('0x57')](_0x3f3e20['query'],_0x5d6388[_0xc318('0x4d')]));_0x37de08[_0xc318('0x56')]['UserId']=_0x354c1b['id'];if(_0x3f3e20[_0xc318('0x4c')]['filter']){_0x37de08['where']=_['merge'](_0x37de08['where'],{'$or':_['map'](_0x37de08[_0xc318('0x4e')],function(_0x510dbb){var _0xb3fa95={};_0xb3fa95[_0x510dbb]={'$like':'%'+_0x3f3e20[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0xb3fa95;})});}_0x37de08=_[_0xc318('0x64')]({},_0x37de08,_0x3f3e20[_0xc318('0x5d')]);return db[_0xc318('0xd3')][_0xc318('0x2c')]({'where':_0x37de08['where']})[_0xc318('0x36')](function(_0x5de811){_0x39c6b9[_0xc318('0x2c')]=_0x5de811;if(_0x3f3e20[_0xc318('0x4c')][_0xc318('0x5e')]){_0x37de08[_0xc318('0x5f')]=[{'all':!![]}];}return db[_0xc318('0xd3')]['findAll'](_0x37de08);})[_0xc318('0x36')](function(_0x4de84c){_0x39c6b9[_0xc318('0x61')]=_0x4de84c;return _0x39c6b9;});}})[_0xc318('0x36')](respondWithFilteredResult(_0x33f155,_0x37de08))[_0xc318('0x62')](handleError(_0x33f155,null));};exports[_0xc318('0xd4')]=function(_0x2965f6,_0x4652e3,_0x7c9948){var _0xf395cb={};var _0x53c82d={};var _0x5214f0;var _0x34d93b;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x2965f6[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x4652e3,null))['then'](function(_0x6886b5){if(_0x6886b5){_0x5214f0=_0x6886b5;_0x53c82d[_0xc318('0x48')]=_[_0xc318('0x4b')](db['SmsInteraction'][_0xc318('0x47')]);_0x53c82d['query']=_[_0xc318('0x4b')](_0x2965f6[_0xc318('0x4c')]);_0x53c82d[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x53c82d['model'],_0x53c82d[_0xc318('0x4c')]);_0xf395cb[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x53c82d[_0xc318('0x48')],qs[_0xc318('0x50')](_0x2965f6[_0xc318('0x4c')][_0xc318('0x50')]));_0xf395cb[_0xc318('0x4e')]=_0xf395cb[_0xc318('0x4e')][_0xc318('0x51')]?_0xf395cb[_0xc318('0x4e')]:_0x53c82d[_0xc318('0x48')];_0xf395cb[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x2965f6[_0xc318('0x4c')][_0xc318('0x55')]);_0xf395cb['where']=qs[_0xc318('0x4d')](_['pick'](_0x2965f6[_0xc318('0x4c')],_0x53c82d[_0xc318('0x4d')]));if(_0x2965f6[_0xc318('0x4c')][_0xc318('0x3b')]){_0xf395cb[_0xc318('0x56')]=_['merge'](_0xf395cb[_0xc318('0x56')],{'$or':_['map'](_0xf395cb[_0xc318('0x4e')],function(_0x2870e5){var _0x1ba155={};_0x1ba155[_0x2870e5]={'$like':'%'+_0x2965f6[_0xc318('0x4c')][_0xc318('0x3b')]+'%'};return _0x1ba155;})});}_0xf395cb=_[_0xc318('0x64')]({},_0xf395cb,_0x2965f6[_0xc318('0x5d')]);return _0x5214f0['getSmsInteractions'](_0xf395cb);}})[_0xc318('0x36')](function(_0x1ccbcc){if(_0x1ccbcc){_0x34d93b=_0x1ccbcc['length'];if(!_0x2965f6['query']['hasOwnProperty'](_0xc318('0x53'))){_0xf395cb[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x2965f6[_0xc318('0x4c')]['limit']);_0xf395cb[_0xc318('0x2d')]=qs['offset'](_0x2965f6[_0xc318('0x4c')][_0xc318('0x2d')]);}return _0x5214f0[_0xc318('0xd4')](_0xf395cb);}})['then'](function(_0x583b96){if(_0x583b96){return _0x583b96?{'count':_0x34d93b,'rows':_0x583b96}:null;}})[_0xc318('0x36')](respondWithResult(_0x4652e3,null))[_0xc318('0x62')](handleError(_0x4652e3,null));};exports[_0xc318('0xd5')]=function(_0x3638f6,_0x168c26,_0x42f8db){var _0x329bd9={};var _0x59dce1={};var _0x1cf83f;var _0x25a3d1;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x3638f6['params']['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x168c26,null))['then'](function(_0x2e294a){if(_0x2e294a){_0x1cf83f=_0x2e294a;_0x59dce1[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0xd6')][_0xc318('0x47')]);_0x59dce1[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x3638f6[_0xc318('0x4c')]);_0x59dce1[_0xc318('0x4d')]=_['intersection'](_0x59dce1[_0xc318('0x48')],_0x59dce1[_0xc318('0x4c')]);_0x329bd9[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x59dce1[_0xc318('0x48')],qs[_0xc318('0x50')](_0x3638f6[_0xc318('0x4c')][_0xc318('0x50')]));_0x329bd9['attributes']=_0x329bd9[_0xc318('0x4e')][_0xc318('0x51')]?_0x329bd9[_0xc318('0x4e')]:_0x59dce1[_0xc318('0x48')];_0x329bd9['order']=qs[_0xc318('0x55')](_0x3638f6['query'][_0xc318('0x55')]);_0x329bd9[_0xc318('0x56')]=qs[_0xc318('0x4d')](_['pick'](_0x3638f6[_0xc318('0x4c')],_0x59dce1[_0xc318('0x4d')]));if(_0x3638f6[_0xc318('0x4c')][_0xc318('0x3b')]){_0x329bd9[_0xc318('0x56')]=_['merge'](_0x329bd9['where'],{'$or':_[_0xc318('0x3d')](_0x329bd9[_0xc318('0x4e')],function(_0x25fa56){var _0x5e377d={};_0x5e377d[_0x25fa56]={'$like':'%'+_0x3638f6[_0xc318('0x4c')]['filter']+'%'};return _0x5e377d;})});}_0x329bd9=_[_0xc318('0x64')]({},_0x329bd9,_0x3638f6['options']);return _0x1cf83f[_0xc318('0xd5')](_0x329bd9);}})[_0xc318('0x36')](function(_0x4cea4c){if(_0x4cea4c){_0x25a3d1=_0x4cea4c[_0xc318('0x51')];if(!_0x3638f6['query'][_0xc318('0x52')](_0xc318('0x53'))){_0x329bd9[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x3638f6[_0xc318('0x4c')][_0xc318('0x2e')]);_0x329bd9['offset']=qs[_0xc318('0x2d')](_0x3638f6['query'][_0xc318('0x2d')]);}return _0x1cf83f[_0xc318('0xd5')](_0x329bd9);}})['then'](function(_0x5a2c4a){if(_0x5a2c4a){return _0x5a2c4a?{'count':_0x25a3d1,'rows':_0x5a2c4a}:null;}})[_0xc318('0x36')](respondWithResult(_0x168c26,null))[_0xc318('0x62')](handleError(_0x168c26,null));};exports[_0xc318('0xd7')]=function(_0x2b8d95,_0x2a8b51,_0x16719f){var _0x6ea010;var _0x54c34f;var _0x485f8e;var _0x3891cf=!_[_0xc318('0x74')](_0x2b8d95[_0xc318('0x68')]['id'])?_0x2b8d95[_0xc318('0x68')]['id']:!_[_0xc318('0x74')](_0x2b8d95['user']['id'])?_0x2b8d95[_0xc318('0x70')]['id']:null;return db[_0xc318('0x46')][_0xc318('0x65')]({'where':{'id':_0x3891cf,'role':'agent'},'attributes':['id','name',_0xc318('0xd8'),_0xc318('0xd9'),'role',_0xc318('0x78'),_0xc318('0xa0')]})[_0xc318('0x36')](handleEntityNotFound(_0x2a8b51,null))[_0xc318('0x36')](function(_0x6ca527){if(_0x6ca527){_0x6ea010=_0x6ca527;if(_0x2b8d95[_0xc318('0x67')][_0xc318('0xad')]){_0x485f8e=util[_0xc318('0xda')](_0xc318('0xdb'),_0x6ea010[_0x2b8d95[_0xc318('0x67')][_0xc318('0xad')]]);}else if(_0x2b8d95[_0xc318('0x67')][_0xc318('0xdc')]){_0x485f8e=util['format'](_0xc318('0xdd'),_0x2b8d95[_0xc318('0x67')][_0xc318('0xdc')]);}else{_0x485f8e=util[_0xc318('0xda')](_0xc318('0xdd'),_0x6ea010['name']);}socket['to'](util['format'](_0xc318('0xde'),_0x6ea010['name']))[_0xc318('0xa9')](_0xc318('0xdf'),{'ip':_0x2b8d95[_0xc318('0xe0')][_0xc318('0xe1')]||_0x2b8d95[_0xc318('0xe2')][_0xc318('0xe3')]||_0x2b8d95['socket'][_0xc318('0xe3')]||_0x2b8d95[_0xc318('0xe2')][_0xc318('0xe4')][_0xc318('0xe3')]});return db['UserVoiceQueueRt'][_0xc318('0x35')]({'where':{'membername':_0x6ea010['name']},'individualHooks':!![]});}})[_0xc318('0x36')](function(_0x56a660){if(_0x6ea010){return _0x6ea010['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x5372ef){var _0x33d3bc=[];if(_0x5372ef){_0x54c34f=_0x5372ef;if(_0x54c34f[_0xc318('0x51')]){for(var _0x40b3e6=0x0;_0x40b3e6<_0x54c34f['length'];_0x40b3e6++){_0x33d3bc[_0xc318('0xac')]({'membername':_0x6ea010[_0xc318('0x40')],'UserId':_0x6ea010['id'],'queue_name':_0x54c34f[_0x40b3e6]['name'],'VoiceQueueId':_0x54c34f[_0x40b3e6]['id'],'interface':_0x485f8e,'paused':_0x6ea010[_0xc318('0xa0')]||![],'penalty':_0x54c34f[_0x40b3e6]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xc318('0xae')](_0x33d3bc,function(_0x4ce7b4){return db[_0xc318('0xb3')][_0xc318('0xaf')](_0x4ce7b4);});}}})['then'](function(){return db[_0xc318('0xe5')][_0xc318('0x60')]({'where':{'membername':_0x6ea010[_0xc318('0x40')],'exitAt':null}});})[_0xc318('0x36')](function(_0x33e3a3){var _0x30b486=[];_0x33e3a3[_0xc318('0xe6')](function(_0xe2d69d){_0x30b486['push'](_0xe2d69d[_0xc318('0x34')]({'exitAt':moment()['format'](_0xc318('0xe7'))}));});return BPromise['all'](_0x30b486);})[_0xc318('0x36')](function(){var _0x5f191c=[];var _0x37ea04=[];var _0x235f32=utils[_0xc318('0xe8')]();var _0x276d23={'membername':_0x6ea010[_0xc318('0x40')],'interface':_0x485f8e,'enterAt':moment()['format'](_0xc318('0xe7')),'role':_0x6ea010[_0xc318('0x3f')],'internal':_0x6ea010[_0xc318('0x78')]};_0x235f32[_0xc318('0xe6')](function(_0x5d80d5){_0x5f191c[_0xc318('0xac')](_[_0xc318('0x64')]({'channel':_0x5d80d5,'type':'LOGIN','data1':_0x2b8d95[_0xc318('0x67')][_0xc318('0xe9')],'data2':_0x485f8e},_0x276d23));if(_0x6ea010[_0xc318('0xa0')]){_0x37ea04[_0xc318('0xac')](_[_0xc318('0x64')]({'channel':_0x5d80d5,'type':_0xc318('0xea'),'data1':'LOGININPAUSE'},_0x276d23));}});return db[_0xc318('0xe5')]['bulkCreate'](_0x5f191c[_0xc318('0xeb')](_0x37ea04),{'individualHooks':!![]});})['then'](function(){return _0x6ea010[_0xc318('0x34')]({'online':!![],'lastLoginAt':moment()[_0xc318('0xda')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x6ea010['loginInPause']||![],'mailPause':_0x6ea010[_0xc318('0xa0')]||![],'chatPause':_0x6ea010[_0xc318('0xa0')]||![],'faxPause':_0x6ea010[_0xc318('0xa0')]||![],'smsPause':_0x6ea010[_0xc318('0xa0')]||![],'openchannelPause':_0x6ea010['loginInPause']||![],'pauseType':_0x6ea010[_0xc318('0xa0')]?_0xc318('0xec'):null,'interface':_0x485f8e,'lastPauseAt':moment()['format'](_0xc318('0xe7'))});})[_0xc318('0x36')](function(_0x4dc070){if(_0x2b8d95[_0xc318('0xed')]){return _0x16719f();}else{return BPromise[_0xc318('0xee')](_0x4dc070)[_0xc318('0x36')](respondWithResult(_0x2a8b51,null));}})['catch'](handleError(_0x2a8b51,null));};exports[_0xc318('0xef')]=function(_0xd58e61,_0x2f9708,_0xedaedf){var _0x345af9;return db[_0xc318('0x46')]['find']({'where':{'id':_0xd58e61[_0xc318('0x68')]['id'],'role':'agent'},'attributes':['id',_0xc318('0x40'),'role']})[_0xc318('0x36')](handleEntityNotFound(_0x2f9708,null))[_0xc318('0x36')](function(_0x593ca6){if(_0x593ca6){_0x345af9=_0x593ca6;return db[_0xc318('0xb3')]['destroy']({'where':{'membername':_0x345af9[_0xc318('0x40')]},'individualHooks':!![]});}})[_0xc318('0x36')](function(){return db[_0xc318('0xe5')]['findAll']({'where':{'membername':_0x345af9[_0xc318('0x40')],'exitAt':null}});})[_0xc318('0x36')](function(_0x1ffa30){var _0x49e6a4=[];_0x1ffa30[_0xc318('0xe6')](function(_0x4bbecc){_0x49e6a4[_0xc318('0xac')](_0x4bbecc[_0xc318('0x34')]({'exitAt':moment()[_0xc318('0xda')](_0xc318('0xe7'))}));});return BPromise[_0xc318('0xf0')](_0x49e6a4);})[_0xc318('0x36')](function(){return _0x345af9[_0xc318('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xc318('0x36')](respondWithResult(_0x2f9708,null))[_0xc318('0x62')](handleError(_0x2f9708,null));};exports[_0xc318('0xf1')]=function(_0x46546c,_0x352d3b,_0x42a86c){var _0x407f3e;return db[_0xc318('0xb3')][_0xc318('0x34')]({'paused':0x1},{'where':{'UserId':_0x46546c[_0xc318('0x68')]['id']},'individualHooks':!![]})[_0xc318('0x36')](function(){return db[_0xc318('0x46')][_0xc318('0x65')]({'where':{'id':_0x46546c[_0xc318('0x68')]['id'],'role':_0xc318('0x6d')},'attributes':['id','name',_0xc318('0x3f'),_0xc318('0x78'),_0xc318('0xad')]});})[_0xc318('0x36')](handleEntityNotFound(_0x352d3b,null))[_0xc318('0x36')](function(_0x412a30){if(_0x412a30){_0x407f3e=_0x412a30;return respondWithRpcPromise('QueuePause',_0xc318('0xf1'),{'id':_0x407f3e['id'],'name':_0x407f3e[_0xc318('0x40')],'pause':!![]});}})[_0xc318('0x36')](function(){if(_0x407f3e){return db[_0xc318('0xe5')][_0xc318('0x60')]({'where':{'membername':_0x407f3e[_0xc318('0x40')],'type':_0xc318('0xea'),'exitAt':null}});}})[_0xc318('0x36')](function(_0x5f4324){if(_0x5f4324[_0xc318('0x51')]){var _0x40080e=moment()['format'](_0xc318('0xe7'));for(var _0x6e62d7=0x0,_0x44204f=_0x5f4324[_0xc318('0x51')];_0x6e62d7<_0x44204f;_0x6e62d7++){_0x5f4324[_0x6e62d7][_0xc318('0xf2')]({'exitAt':_0x40080e});}}})[_0xc318('0x36')](function(){var _0xd52cd2=[];var _0x259db9=utils[_0xc318('0xe8')]();_0x259db9['forEach'](function(_0x2bb6fa){_0xd52cd2[_0xc318('0xac')]({'channel':_0x2bb6fa,'membername':_0x407f3e[_0xc318('0x40')],'interface':_[_0xc318('0x74')](_0x407f3e[_0xc318('0xad')])?util[_0xc318('0xda')](_0xc318('0xdd'),_0x407f3e[_0xc318('0x40')]):_0x407f3e[_0xc318('0xad')],'type':_0xc318('0xea'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x46546c[_0xc318('0x67')][_0xc318('0x58')]||_0xc318('0xf3'),'role':_0x407f3e[_0xc318('0x3f')],'internal':_0x407f3e[_0xc318('0x78')]});});return db[_0xc318('0xe5')][_0xc318('0x66')](_0xd52cd2,{'individualHooks':!![]});})['then'](function(){return _0x407f3e['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x46546c['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xc318('0xe7'))});})[_0xc318('0x36')](respondWithResult(_0x352d3b,null))[_0xc318('0x62')](handleError(_0x352d3b,null));};exports[_0xc318('0xf4')]=function(_0x19e4e7,_0x6877b4,_0x5a6b8a){var _0x723c9c;return db[_0xc318('0x46')][_0xc318('0x65')]({'where':{'id':_0x19e4e7[_0xc318('0x68')]['id']},'attributes':['id','name','role',_0xc318('0xa1'),_0xc318('0xf5'),_0xc318('0xf6'),_0xc318('0xf7'),_0xc318('0xf8'),_0xc318('0xf9'),_0xc318('0xfa'),_0xc318('0xfb')]})[_0xc318('0x36')](handleEntityNotFound(_0x6877b4,null))[_0xc318('0x36')](function(_0x4b7208){if(_0x4b7208){_0x723c9c=_0x4b7208;if(_0x19e4e7['body']['channel']&&!utils[_0xc318('0xa2')](_0x19e4e7[_0xc318('0x67')][_0xc318('0x9e')])){throw new db[(_0xc318('0x93'))][(_0xc318('0x95'))](_0xc318('0xb0'));}switch(_0x19e4e7[_0xc318('0x67')][_0xc318('0x9e')]){case _0xc318('0xab'):return respondWithRpcPromise(_0xc318('0xfc'),_0xc318('0xf4'),{'id':_0x723c9c['id'],'name':_0x723c9c[_0xc318('0x40')],'pause':![]})[_0xc318('0x36')](function(){return db[_0xc318('0xb3')][_0xc318('0x34')]({'paused':0x0},{'where':{'UserId':_0x723c9c['id']},'individualHooks':!![]});})[_0xc318('0x36')](function(){return db[_0xc318('0xe5')]['find']({'where':{'channel':_0x19e4e7[_0xc318('0x67')][_0xc318('0x9e')],'membername':_0x723c9c[_0xc318('0x40')],'type':_0xc318('0xea'),'exitAt':null}});})['then'](function(_0xa2ef3e){if(_0xa2ef3e){return _0xa2ef3e[_0xc318('0x34')]({'exitAt':moment()[_0xc318('0xda')](_0xc318('0xe7')),'data2':_0xc318('0xfd')},{'individualHooks':!![]});}return null;})[_0xc318('0x36')](function(){return _0x723c9c[_0xc318('0x34')]({'voicePause':![]});});case'mail':case _0xc318('0xfe'):case _0xc318('0xff'):case _0xc318('0x100'):case _0xc318('0x101'):return db[_0xc318('0xe5')][_0xc318('0x65')]({'where':{'channel':_0x19e4e7[_0xc318('0x67')]['channel'],'membername':_0x723c9c[_0xc318('0x40')],'type':'PAUSE','exitAt':null}})[_0xc318('0x36')](function(_0x4eb538){if(_0x4eb538){return _0x4eb538[_0xc318('0x34')]({'exitAt':moment()[_0xc318('0xda')](_0xc318('0xe7')),'data2':_0xc318('0xfd')},{'individualHooks':!![]});}return null;})[_0xc318('0x36')](function(){var _0x2db2fb={};_[_0xc318('0x2f')](_0x2db2fb,util[_0xc318('0xda')](_0xc318('0x102'),_0x19e4e7[_0xc318('0x67')]['channel'],_0xc318('0x103')),![]);return _0x723c9c[_0xc318('0x34')](_0x2db2fb);});default:return respondWithRpcPromise(_0xc318('0xfc'),_0xc318('0xf4'),{'id':_0x723c9c['id'],'name':_0x723c9c[_0xc318('0x40')],'pause':![]})[_0xc318('0x36')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x723c9c['id']}});})[_0xc318('0x36')](function(){return db[_0xc318('0xe5')][_0xc318('0x60')]({'where':{'membername':_0x723c9c[_0xc318('0x40')],'type':_0xc318('0xea'),'exitAt':null}});})[_0xc318('0x36')](function(_0x4144bc){var _0x515621=[];_0x4144bc[_0xc318('0xe6')](function(_0x550ab0){_0x515621['push'](_0x550ab0[_0xc318('0x34')]({'exitAt':moment()[_0xc318('0xda')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xc318('0xfd')}));});return BPromise[_0xc318('0xf0')](_0x515621);})[_0xc318('0x36')](function(){return _0x723c9c['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xc318('0x36')](respondWithResult(_0x6877b4,null))[_0xc318('0x62')](handleError(_0x6877b4,null));};exports[_0xc318('0x104')]=function(_0x128c5a,_0x5e4ca4,_0x35b388){var _0x21fe57={};var _0x209a38={};var _0x476161;var _0x4dd313;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x128c5a[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x5e4ca4,null))[_0xc318('0x36')](function(_0x36d018){if(_0x36d018){_0x476161=_0x36d018;_0x209a38['model']=_['keys'](db['Team']['rawAttributes']);_0x209a38[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x128c5a['query']);_0x209a38['filters']=_['intersection'](_0x209a38[_0xc318('0x48')],_0x209a38[_0xc318('0x4c')]);_0x21fe57[_0xc318('0x4e')]=_['intersection'](_0x209a38['model'],qs[_0xc318('0x50')](_0x128c5a['query'][_0xc318('0x50')]));_0x21fe57[_0xc318('0x4e')]=_0x21fe57['attributes'][_0xc318('0x51')]?_0x21fe57[_0xc318('0x4e')]:_0x209a38[_0xc318('0x48')];_0x21fe57[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x128c5a['query'][_0xc318('0x55')]);_0x21fe57[_0xc318('0x56')]=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x128c5a[_0xc318('0x4c')],_0x209a38['filters']));if(_0x128c5a[_0xc318('0x4c')]['filter']){_0x21fe57[_0xc318('0x56')]=_[_0xc318('0x64')](_0x21fe57['where'],{'$or':_[_0xc318('0x3d')](_0x21fe57['attributes'],function(_0x49b3c9){var _0x73f57f={};_0x73f57f[_0x49b3c9]={'$like':'%'+_0x128c5a['query'][_0xc318('0x3b')]+'%'};return _0x73f57f;})});}_0x21fe57=_[_0xc318('0x64')]({},_0x21fe57,_0x128c5a['options']);return _0x476161['getTeams'](_0x21fe57);}})[_0xc318('0x36')](function(_0x56b07d){if(_0x56b07d){_0x4dd313=_0x56b07d[_0xc318('0x51')];if(!_0x128c5a['query'][_0xc318('0x52')](_0xc318('0x53'))){_0x21fe57[_0xc318('0x2e')]=qs['limit'](_0x128c5a['query'][_0xc318('0x2e')]);_0x21fe57['offset']=qs[_0xc318('0x2d')](_0x128c5a[_0xc318('0x4c')][_0xc318('0x2d')]);}return _0x476161[_0xc318('0x104')](_0x21fe57);}})[_0xc318('0x36')](function(_0x41ef7a){if(_0x41ef7a){return _0x41ef7a?{'count':_0x4dd313,'rows':_0x41ef7a}:null;}})[_0xc318('0x36')](respondWithResult(_0x5e4ca4,null))[_0xc318('0x62')](handleError(_0x5e4ca4,null));};exports['addTeams']=function(_0x1601f0,_0x449ad1,_0xe5423){return db['User']['find']({'where':{'id':_0x1601f0[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x449ad1,null))[_0xc318('0x36')](function(_0x18c226){if(_0x18c226){return _0x18c226[_0xc318('0x105')](_0x1601f0[_0xc318('0x67')]['ids'],_[_0xc318('0x6b')](_0x1601f0[_0xc318('0x67')],['ids','id'])||{});}})[_0xc318('0x36')](respondWithResult(_0x449ad1,null))[_0xc318('0x62')](handleError(_0x449ad1,null));};exports[_0xc318('0x106')]=function(_0x2f6398,_0x4d9e97,_0x144abe){return db[_0xc318('0x46')]['find']({'where':{'id':_0x2f6398[_0xc318('0x68')]['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x4d9e97,null))['then'](function(_0x17b046){if(_0x17b046){return _0x17b046[_0xc318('0x106')](_0x2f6398[_0xc318('0x4c')][_0xc318('0x6c')]);}})[_0xc318('0x36')](respondWithStatusCode(_0x4d9e97,null))['catch'](handleError(_0x4d9e97,null));};exports[_0xc318('0x107')]=function(_0x269892,_0x5be6ae,_0x5319c2){var _0x352b23={};var _0x2f0b2b={};var _0x3119b4;var _0x5ba09d;return db[_0xc318('0x46')][_0xc318('0x9c')]({'where':{'id':_0x269892['params']['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x5be6ae,null))['then'](function(_0x4e1459){if(_0x4e1459){_0x3119b4=_0x4e1459;_0x2f0b2b[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0xbf')]['rawAttributes']);_0x2f0b2b['query']=_[_0xc318('0x4b')](_0x269892['query']);_0x2f0b2b[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x2f0b2b[_0xc318('0x48')],_0x2f0b2b[_0xc318('0x4c')]);_0x352b23[_0xc318('0x4e')]=_[_0xc318('0x4f')](_0x2f0b2b[_0xc318('0x48')],qs[_0xc318('0x50')](_0x269892['query'][_0xc318('0x50')]));_0x352b23['attributes']=_0x352b23[_0xc318('0x4e')][_0xc318('0x51')]?_0x352b23[_0xc318('0x4e')]:_0x2f0b2b[_0xc318('0x48')];_0x352b23[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x269892['query'][_0xc318('0x55')]);_0x352b23[_0xc318('0x56')]=qs['filters'](_[_0xc318('0x57')](_0x269892[_0xc318('0x4c')],_0x2f0b2b[_0xc318('0x4d')]));if(_0x269892['query'][_0xc318('0x3b')]){_0x352b23[_0xc318('0x56')]=_['merge'](_0x352b23[_0xc318('0x56')],{'$or':_[_0xc318('0x3d')](_0x352b23[_0xc318('0x4e')],function(_0x247e6c){var _0x4a451a={};_0x4a451a[_0x247e6c]={'$like':'%'+_0x269892[_0xc318('0x4c')]['filter']+'%'};return _0x4a451a;})});}_0x352b23=_[_0xc318('0x64')]({},_0x352b23,_0x269892[_0xc318('0x5d')]);return _0x3119b4[_0xc318('0x107')](_0x352b23);}})[_0xc318('0x36')](function(_0x3ddc92){if(_0x3ddc92){_0x5ba09d=_0x3ddc92[_0xc318('0x51')];if(!_0x269892['query']['hasOwnProperty'](_0xc318('0x53'))){_0x352b23[_0xc318('0x2e')]=qs[_0xc318('0x2e')](_0x269892[_0xc318('0x4c')][_0xc318('0x2e')]);_0x352b23['offset']=qs['offset'](_0x269892['query'][_0xc318('0x2d')]);}return _0x3119b4[_0xc318('0x107')](_0x352b23);}})[_0xc318('0x36')](function(_0x2c8c57){if(_0x2c8c57){return _0x2c8c57?{'count':_0x5ba09d,'rows':_0x2c8c57}:null;}})[_0xc318('0x36')](respondWithResult(_0x5be6ae,null))[_0xc318('0x62')](handleError(_0x5be6ae,null));};exports['getAgents']=function(_0x18d7bb,_0x11b785,_0x5aa53d){var _0x4e6fc2={};var _0x1bb49d={};var _0xb50eec;var _0x884c1a;return db[_0xc318('0x46')]['findOne']({'where':{'id':_0x18d7bb['params']['id']}})[_0xc318('0x36')](handleEntityNotFound(_0x11b785,null))['then'](function(_0x20aa32){if(_0x20aa32){_0xb50eec=_0x20aa32;_0x1bb49d[_0xc318('0x48')]=_[_0xc318('0x4b')](db[_0xc318('0x46')][_0xc318('0x47')]);_0x1bb49d[_0xc318('0x4c')]=_[_0xc318('0x4b')](_0x18d7bb[_0xc318('0x4c')]);_0x1bb49d[_0xc318('0x4d')]=_[_0xc318('0x4f')](_0x1bb49d['model'],_0x1bb49d[_0xc318('0x4c')]);_0x4e6fc2['attributes']=_[_0xc318('0x4f')](_0x1bb49d[_0xc318('0x48')],qs[_0xc318('0x50')](_0x18d7bb[_0xc318('0x4c')][_0xc318('0x50')]));_0x4e6fc2[_0xc318('0x4e')]=_0x4e6fc2['attributes'][_0xc318('0x51')]?_0x4e6fc2[_0xc318('0x4e')]:_0x1bb49d['model'];_0x4e6fc2[_0xc318('0x54')]=qs[_0xc318('0x55')](_0x18d7bb['query'][_0xc318('0x55')]);_0x4e6fc2[_0xc318('0x56')]=qs[_0xc318('0x4d')](_[_0xc318('0x57')](_0x18d7bb[_0xc318('0x4c')],_0x1bb49d[_0xc318('0x4d')]));if(_0x18d7bb['query'][_0xc318('0x3b')]){_0x4e6fc2[_0xc318('0x56')]=_[_0xc318('0x64')](_0x4e6fc2['where'],{'$or':_[_0xc318('0x3d')](_0x4e6fc2[_0xc318('0x4e')],function(_0x2c1f34){var _0x544908={};_0x544908[_0x2c1f34]={'$like':'%'+_0x18d7bb['query'][_0xc318('0x3b')]+'%'};return _0x544908;})});}_0x4e6fc2['model']=db['User'];_0x4e6fc2['as']=_0xc318('0x8f');_0x4e6fc2=_['merge']({},_0x4e6fc2,_0x18d7bb['options']);return _0xb50eec['getVoiceQueues']({'include':[_0x4e6fc2]});}})[_0xc318('0x36')](function(_0x2e995f){if(_0x2e995f){var _0x4aea2d={},_0x52a953=[],_0x160deb=0x0;for(var _0x1c8610=0x0;_0x1c8610<_0x2e995f['length'];_0x1c8610+=0x1){for(var _0x5e6314=0x0,_0x415c8c;_0x5e6314<_0x2e995f[_0x1c8610][_0xc318('0x8f')]['length'];_0x5e6314+=0x1){_0x415c8c=_0x2e995f[_0x1c8610][_0xc318('0x8f')][_0x5e6314][_0xc318('0x37')]({'plain':!![]});_0x4aea2d[_0x415c8c['id']]=_0x415c8c;}}_0x4aea2d=_['values'](_0x4aea2d);for(var _0xf033e=qs[_0xc318('0x2d')](_0x18d7bb['query'][_0xc318('0x2d')]);_0xf033e<_0x4aea2d[_0xc318('0x51')]&&_0x52a953['length']=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x4c3e4e,_0xb36320){var _0x260bd1=function(_0xe24272){while(--_0xe24272){_0x4c3e4e['push'](_0x4c3e4e['shift']());}};_0x260bd1(++_0xb36320);}(_0xb10b,0x12a));var _0xbb10=function(_0x19a2eb,_0x2df439){_0x19a2eb=_0x19a2eb-0x0;var _0x3c8514=_0xb10b[_0x19a2eb];return _0x3c8514;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 89adf11..0e5e2e1 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 _0x53e7=['./user.events','save','remove','update','emit','removeListener','register'];(function(_0x41420c,_0x37374e){var _0x359cbd=function(_0x27f818){while(--_0x27f818){_0x41420c['push'](_0x41420c['shift']());}};_0x359cbd(++_0x37374e);}(_0x53e7,0xfc));var _0x753e=function(_0x41b06b,_0x34d7bb){_0x41b06b=_0x41b06b-0x0;var _0x52fce1=_0x53e7[_0x41b06b];return _0x52fce1;};'use strict';var UserEvents=require(_0x753e('0x0'));var events=[_0x753e('0x1'),_0x753e('0x2'),_0x753e('0x3')];function createListener(_0x24586c,_0x52cff6){return function(_0x32fe00){_0x52cff6[_0x753e('0x4')](_0x24586c,_0x32fe00);};}function removeListener(_0x5519b8,_0x18bb2a){return function(){UserEvents[_0x753e('0x5')](_0x5519b8,_0x18bb2a);};}exports[_0x753e('0x6')]=function(_0x30b540){for(var _0x161ed0=0x0,_0x47142b=events['length'];_0x161ed0<_0x47142b;_0x161ed0++){var _0x390694=events[_0x161ed0];var _0x4575d0=createListener('user:'+_0x390694,_0x30b540);UserEvents['on'](_0x390694,_0x4575d0);}}; \ No newline at end of file +var _0x0b9e=['save','remove','removeListener','register','length','user:','./user.events'];(function(_0x1287b9,_0x114fbb){var _0x2ef626=function(_0x34c93d){while(--_0x34c93d){_0x1287b9['push'](_0x1287b9['shift']());}};_0x2ef626(++_0x114fbb);}(_0x0b9e,0x12c));var _0xe0b9=function(_0x4c1f9b,_0x3a280d){_0x4c1f9b=_0x4c1f9b-0x0;var _0x339a1d=_0x0b9e[_0x4c1f9b];return _0x339a1d;};'use strict';var UserEvents=require(_0xe0b9('0x0'));var events=[_0xe0b9('0x1'),_0xe0b9('0x2'),'update'];function createListener(_0x1e354b,_0x78163b){return function(_0x117e4e){_0x78163b['emit'](_0x1e354b,_0x117e4e);};}function removeListener(_0x54b759,_0x596efa){return function(){UserEvents[_0xe0b9('0x3')](_0x54b759,_0x596efa);};}exports[_0xe0b9('0x4')]=function(_0x1904cc){for(var _0x1e9ee8=0x0,_0x26cc21=events[_0xe0b9('0x5')];_0x1e9ee8<_0x26cc21;_0x1e9ee8++){var _0x4d504e=events[_0x1e9ee8];var _0x4d5831=createListener(_0xe0b9('0x6')+_0x4d504e,_0x1904cc);UserEvents['on'](_0x4d504e,_0x4d5831);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 61bea16..36ee744 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 _0x4279=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2bb423,_0x43a634){var _0x39cf58=function(_0x4d7607){while(--_0x4d7607){_0x2bb423['push'](_0x2bb423['shift']());}};_0x39cf58(++_0x43a634);}(_0x4279,0x8d));var _0x9427=function(_0x32aec8,_0x3bd6a9){_0x32aec8=_0x32aec8-0x0;var _0x3b8c88=_0x4279[_0x32aec8];return _0x3b8c88;};'use strict';var multer=require('multer');var util=require(_0x9427('0x0'));var path=require(_0x9427('0x1'));var timeout=require('connect-timeout');var express=require(_0x9427('0x2'));var router=express[_0x9427('0x3')]();var auth=require(_0x9427('0x4'));var interaction=require(_0x9427('0x5'));var config=require('../../config/environment');module[_0x9427('0x6')]=router; \ No newline at end of file +var _0x9e2e=['express','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x2ef5d8,_0x3d9b35){var _0x1a06a6=function(_0x1bedbe){while(--_0x1bedbe){_0x2ef5d8['push'](_0x2ef5d8['shift']());}};_0x1a06a6(++_0x3d9b35);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x24ba5f,_0x2e3ea4){_0x24ba5f=_0x24ba5f-0x0;var _0x2bd111=_0x9e2e[_0x24ba5f];return _0x2bd111;};'use strict';var multer=require(_0xe9e2('0x0'));var util=require(_0xe9e2('0x1'));var path=require(_0xe9e2('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9e2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe9e2('0x4'));var config=require(_0xe9e2('0x5'));module[_0xe9e2('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 cd54a42..e95cb19 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 _0x4db9=['sequelize'];(function(_0x314f8f,_0x515793){var _0x2f6690=function(_0x372e70){while(--_0x372e70){_0x314f8f['push'](_0x314f8f['shift']());}};_0x2f6690(++_0x515793);}(_0x4db9,0x1c8));var _0x94db=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0x4db9[_0x51bb38];return _0x51c09b;};'use strict';var Sequelize=require(_0x94db('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e4c=['sequelize','exports','INTEGER'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x1e4c,0xc0));var _0xc1e4=function(_0x2bf248,_0x2e46a8){_0x2bf248=_0x2bf248-0x0;var _0x2f8149=_0x1e4c[_0x2bf248];return _0x2f8149;};'use strict';var Sequelize=require(_0xc1e4('0x0'));module[_0xc1e4('0x1')]={'penalty':{'type':Sequelize[_0xc1e4('0x2')],'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 dcb726b..b859adb 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 _0x6b64=['../../config/logger','api','path','../../config/environment','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x4b3674,_0x3bb811){var _0x1cc7e4=function(_0x3eec90){while(--_0x3eec90){_0x4b3674['push'](_0x4b3674['shift']());}};_0x1cc7e4(++_0x3bb811);}(_0x6b64,0x97));var _0x46b6=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x6b64[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0x46b6('0x0'));var util=require(_0x46b6('0x1'));var logger=require(_0x46b6('0x2'))(_0x46b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46b6('0x4'));var rimraf=require('rimraf');var config=require(_0x46b6('0x5'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x514ef5,_0x482e51){return _0x514ef5[_0x46b6('0x6')](_0x46b6('0x7'),attributes,{'tableName':_0x46b6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c55=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x9c55,0x1e4));var _0x59c5=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0x9c55[_0x17fea7];return _0x3150c3;};'use strict';var _=require(_0x59c5('0x0'));var util=require(_0x59c5('0x1'));var logger=require(_0x59c5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x59c5('0x3'));var fs=require('fs');var path=require(_0x59c5('0x4'));var rimraf=require(_0x59c5('0x5'));var config=require(_0x59c5('0x6'));var attributes=require(_0x59c5('0x7'));module[_0x59c5('0x8')]=function(_0x4c9950,_0x183c39){return _0x4c9950[_0x59c5('0x9')](_0x59c5('0xa'),attributes,{'tableName':'user_has_chat_queues','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 7fef4bd..65ae868 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 _0x8e2b=['ioredis','../../mysqldb','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0x8e2b,0x19a));var _0xb8e2=function(_0x48afd5,_0x4b1267){_0x48afd5=_0x48afd5-0x0;var _0x17cdad=_0x8e2b[_0x48afd5];return _0x17cdad;};'use strict';var _=require(_0xb8e2('0x0'));var util=require(_0xb8e2('0x1'));var moment=require('moment');var BPromise=require(_0xb8e2('0x2'));var rs=require(_0xb8e2('0x3'));var fs=require('fs');var Redis=require(_0xb8e2('0x4'));var db=require(_0xb8e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb8e2('0x6'));var client=jayson['client'][_0xb8e2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6af358,_0x21e2fc,_0x108147){return new BPromise(function(_0x4d059b,_0x314d51){return client['request'](_0x6af358,_0x108147)[_0xb8e2('0x8')](function(_0x2f3ca0){logger[_0xb8e2('0x9')](_0xb8e2('0xa'),_0x21e2fc,_0xb8e2('0xb'));logger[_0xb8e2('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x21e2fc,_0xb8e2('0xb'),JSON['stringify'](_0x2f3ca0));if(_0x2f3ca0[_0xb8e2('0xd')]){if(_0x2f3ca0[_0xb8e2('0xd')][_0xb8e2('0xe')]===0x1f4){logger[_0xb8e2('0xd')](_0xb8e2('0xa'),_0x21e2fc,_0x2f3ca0[_0xb8e2('0xd')][_0xb8e2('0xf')]);return _0x314d51(_0x2f3ca0[_0xb8e2('0xd')]['message']);}logger['error'](_0xb8e2('0xa'),_0x21e2fc,_0x2f3ca0[_0xb8e2('0xd')]['message']);return _0x4d059b(_0x2f3ca0[_0xb8e2('0xd')][_0xb8e2('0xf')]);}else{logger[_0xb8e2('0x9')](_0xb8e2('0xa'),_0x21e2fc,_0xb8e2('0xb'));_0x4d059b(_0x2f3ca0[_0xb8e2('0x10')][_0xb8e2('0xf')]);}})[_0xb8e2('0x11')](function(_0x3d37df){logger[_0xb8e2('0xd')](_0xb8e2('0xa'),_0x21e2fc,_0x3d37df);_0x314d51(_0x3d37df);});});} \ No newline at end of file +var _0xc0af=['info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message'];(function(_0x27606d,_0x2ec567){var _0x5d72cf=function(_0x36b23f){while(--_0x36b23f){_0x27606d['push'](_0x27606d['shift']());}};_0x5d72cf(++_0x2ec567);}(_0xc0af,0xff));var _0xfc0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0af[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc0a('0x0'));var util=require(_0xfc0a('0x1'));var moment=require('moment');var BPromise=require(_0xfc0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc0a('0x4'));var logger=require(_0xfc0a('0x5'))(_0xfc0a('0x6'));var config=require(_0xfc0a('0x7'));var jayson=require(_0xfc0a('0x8'));var client=jayson[_0xfc0a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15aac7,_0x4e802d,_0x591eac){return new BPromise(function(_0x3809ca,_0x51bc3d){return client[_0xfc0a('0xa')](_0x15aac7,_0x591eac)['then'](function(_0x494f77){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4e802d,_0xfc0a('0xb'));logger[_0xfc0a('0xc')](_0xfc0a('0xd'),_0x4e802d,_0xfc0a('0xb'),JSON['stringify'](_0x494f77));if(_0x494f77[_0xfc0a('0xe')]){if(_0x494f77[_0xfc0a('0xe')][_0xfc0a('0xf')]===0x1f4){logger[_0xfc0a('0xe')](_0xfc0a('0x10'),_0x4e802d,_0x494f77[_0xfc0a('0xe')]['message']);return _0x51bc3d(_0x494f77[_0xfc0a('0xe')][_0xfc0a('0x11')]);}logger['error'](_0xfc0a('0x10'),_0x4e802d,_0x494f77[_0xfc0a('0xe')][_0xfc0a('0x11')]);return _0x3809ca(_0x494f77[_0xfc0a('0xe')][_0xfc0a('0x11')]);}else{logger[_0xfc0a('0x12')](_0xfc0a('0x10'),_0x4e802d,_0xfc0a('0xb'));_0x3809ca(_0x494f77[_0xfc0a('0x13')][_0xfc0a('0x11')]);}})[_0xfc0a('0x14')](function(_0x52957d){logger[_0xfc0a('0xe')](_0xfc0a('0x10'),_0x4e802d,_0x52957d);_0x51bc3d(_0x52957d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index bb0e2e2..2a0907d 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 _0x6003=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x13a10e,_0x215f40){var _0x29ca7d=function(_0x49bfa4){while(--_0x49bfa4){_0x13a10e['push'](_0x13a10e['shift']());}};_0x29ca7d(++_0x215f40);}(_0x6003,0xae));var _0x3600=function(_0x515209,_0x4fb89d){_0x515209=_0x515209-0x0;var _0x10e90b=_0x6003[_0x515209];return _0x10e90b;};'use strict';var multer=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var path=require(_0x3600('0x2'));var timeout=require(_0x3600('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3600('0x4'));var interaction=require(_0x3600('0x5'));var config=require(_0x3600('0x6'));module['exports']=router; \ No newline at end of file +var _0x4975=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x1bc762,_0x523eb3){var _0x40f70c=function(_0x3c206e){while(--_0x3c206e){_0x1bc762['push'](_0x1bc762['shift']());}};_0x40f70c(++_0x523eb3);}(_0x4975,0x86));var _0x5497=function(_0x4b1c79,_0x5c9f78){_0x4b1c79=_0x4b1c79-0x0;var _0x414b56=_0x4975[_0x4b1c79];return _0x414b56;};'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 auth=require(_0x5497('0x5'));var interaction=require(_0x5497('0x6'));var config=require(_0x5497('0x7'));module[_0x5497('0x8')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f5153b5..568958b 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 _0xd369=['exports'];(function(_0x27d37a,_0x4a0441){var _0x1c9d32=function(_0xd20ed1){while(--_0xd20ed1){_0x27d37a['push'](_0x27d37a['shift']());}};_0x1c9d32(++_0x4a0441);}(_0xd369,0xe7));var _0x9d36=function(_0x4c6ac0,_0x24d947){_0x4c6ac0=_0x4c6ac0-0x0;var _0x18e992=_0xd369[_0x4c6ac0];return _0x18e992;};'use strict';var Sequelize=require('sequelize');module[_0x9d36('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0b5d=['STRING','exports','INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0b5d,0x136));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd0b5('0x0')]={'penalty':{'type':Sequelize[_0xd0b5('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd0b5('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd0b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2562b64..1ef2e98 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 _0xee51=['moment','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','util','../../config/logger'];(function(_0x16dab3,_0x17dff3){var _0x459cb6=function(_0x4316ec){while(--_0x4316ec){_0x16dab3['push'](_0x16dab3['shift']());}};_0x459cb6(++_0x17dff3);}(_0xee51,0x166));var _0x1ee5=function(_0x383cc2,_0x395986){_0x383cc2=_0x383cc2-0x0;var _0x432d6a=_0xee51[_0x383cc2];return _0x432d6a;};'use strict';var _=require('lodash');var util=require(_0x1ee5('0x0'));var logger=require(_0x1ee5('0x1'))('api');var moment=require(_0x1ee5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee5('0x3'));var rimraf=require(_0x1ee5('0x4'));var config=require('../../config/environment');var attributes=require(_0x1ee5('0x5'));module[_0x1ee5('0x6')]=function(_0x38cd63,_0x34b971){return _0x38cd63[_0x1ee5('0x7')](_0x1ee5('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2894=['bluebird','request-promise','rimraf','../../config/environment','exports','UserFaxQueue','user_has_fax_queues','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2894,0x11f));var _0x4289=function(_0x2f485e,_0x1ce4ff){_0x2f485e=_0x2f485e-0x0;var _0x1ca654=_0x2894[_0x2f485e];return _0x1ca654;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4289('0x0'))(_0x4289('0x1'));var moment=require(_0x4289('0x2'));var BPromise=require(_0x4289('0x3'));var rp=require(_0x4289('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4289('0x5'));var config=require(_0x4289('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x4289('0x7')]=function(_0x4db229,_0x5818c0){return _0x4db229['define'](_0x4289('0x8'),attributes,{'tableName':_0x4289('0x9'),'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 ebad280..8168fc1 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 _0xcf4f=['error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f71a1,_0x1a76f3){var _0xf72ea1=function(_0x624d07){while(--_0x624d07){_0x1f71a1['push'](_0x1f71a1['shift']());}};_0xf72ea1(++_0x1a76f3);}(_0xcf4f,0x1a7));var _0xfcf4=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xcf4f[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xfcf4('0x0'));var util=require(_0xfcf4('0x1'));var moment=require('moment');var BPromise=require(_0xfcf4('0x2'));var rs=require(_0xfcf4('0x3'));var fs=require('fs');var Redis=require(_0xfcf4('0x4'));var db=require(_0xfcf4('0x5'))['db'];var utils=require(_0xfcf4('0x6'));var logger=require(_0xfcf4('0x7'))(_0xfcf4('0x8'));var config=require(_0xfcf4('0x9'));var jayson=require(_0xfcf4('0xa'));var client=jayson[_0xfcf4('0xb')][_0xfcf4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47054e,_0x2cc7f0,_0x52210a){return new BPromise(function(_0x474058,_0x476a23){return client['request'](_0x47054e,_0x52210a)['then'](function(_0x11ee70){logger[_0xfcf4('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x2cc7f0,_0xfcf4('0xe'));logger['debug'](_0xfcf4('0xf'),_0x2cc7f0,_0xfcf4('0xe'),JSON[_0xfcf4('0x10')](_0x11ee70));if(_0x11ee70[_0xfcf4('0x11')]){if(_0x11ee70[_0xfcf4('0x11')][_0xfcf4('0x12')]===0x1f4){logger['error'](_0xfcf4('0x13'),_0x2cc7f0,_0x11ee70[_0xfcf4('0x11')][_0xfcf4('0x14')]);return _0x476a23(_0x11ee70['error'][_0xfcf4('0x14')]);}logger[_0xfcf4('0x11')](_0xfcf4('0x13'),_0x2cc7f0,_0x11ee70['error'][_0xfcf4('0x14')]);return _0x474058(_0x11ee70[_0xfcf4('0x11')][_0xfcf4('0x14')]);}else{logger[_0xfcf4('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x2cc7f0,_0xfcf4('0xe'));_0x474058(_0x11ee70['result']['message']);}})[_0xfcf4('0x15')](function(_0x390084){logger['error'](_0xfcf4('0x13'),_0x2cc7f0,_0x390084);_0x476a23(_0x390084);});});} \ No newline at end of file +var _0x79ec=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e984a,_0x53a6b6){var _0x582fd7=function(_0x3d26ef){while(--_0x3d26ef){_0x3e984a['push'](_0x3e984a['shift']());}};_0x582fd7(++_0x53a6b6);}(_0x79ec,0x120));var _0xc79e=function(_0x597eb2,_0x165f5c){_0x597eb2=_0x597eb2-0x0;var _0x56875f=_0x79ec[_0x597eb2];return _0x56875f;};'use strict';var _=require(_0xc79e('0x0'));var util=require(_0xc79e('0x1'));var moment=require(_0xc79e('0x2'));var BPromise=require(_0xc79e('0x3'));var rs=require(_0xc79e('0x4'));var fs=require('fs');var Redis=require(_0xc79e('0x5'));var db=require(_0xc79e('0x6'))['db'];var utils=require(_0xc79e('0x7'));var logger=require(_0xc79e('0x8'))(_0xc79e('0x9'));var config=require(_0xc79e('0xa'));var jayson=require(_0xc79e('0xb'));var client=jayson[_0xc79e('0xc')][_0xc79e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f5532,_0x50693a,_0x13b146){return new BPromise(function(_0x296785,_0xaaff2){return client[_0xc79e('0xe')](_0x5f5532,_0x13b146)[_0xc79e('0xf')](function(_0x565ce5){logger[_0xc79e('0x10')](_0xc79e('0x11'),_0x50693a,_0xc79e('0x12'));logger['debug'](_0xc79e('0x13'),_0x50693a,_0xc79e('0x12'),JSON[_0xc79e('0x14')](_0x565ce5));if(_0x565ce5['error']){if(_0x565ce5[_0xc79e('0x15')][_0xc79e('0x16')]===0x1f4){logger['error'](_0xc79e('0x11'),_0x50693a,_0x565ce5[_0xc79e('0x15')][_0xc79e('0x17')]);return _0xaaff2(_0x565ce5[_0xc79e('0x15')]['message']);}logger[_0xc79e('0x15')](_0xc79e('0x11'),_0x50693a,_0x565ce5[_0xc79e('0x15')][_0xc79e('0x17')]);return _0x296785(_0x565ce5[_0xc79e('0x15')]['message']);}else{logger[_0xc79e('0x10')](_0xc79e('0x11'),_0x50693a,_0xc79e('0x12'));_0x296785(_0x565ce5['result'][_0xc79e('0x17')]);}})['catch'](function(_0x5a35ae){logger[_0xc79e('0x15')](_0xc79e('0x11'),_0x50693a,_0x5a35ae);_0xaaff2(_0x5a35ae);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 350fef6..41dae2b 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 _0xc6c0=['../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x22dd2d,_0x388098){var _0x539d01=function(_0x31758b){while(--_0x31758b){_0x22dd2d['push'](_0x22dd2d['shift']());}};_0x539d01(++_0x388098);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xc6c0[_0x59c301];return _0x3866b9;};'use strict';var multer=require(_0x0c6c('0x0'));var util=require('util');var path=require(_0x0c6c('0x1'));var timeout=require(_0x0c6c('0x2'));var express=require(_0x0c6c('0x3'));var router=express[_0x0c6c('0x4')]();var auth=require(_0x0c6c('0x5'));var interaction=require(_0x0c6c('0x6'));var config=require(_0x0c6c('0x7'));module[_0x0c6c('0x8')]=router; \ No newline at end of file +var _0x2a07=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0xa2c6c9,_0x383b47){var _0x10ba06=function(_0x371127){while(--_0x371127){_0xa2c6c9['push'](_0xa2c6c9['shift']());}};_0x10ba06(++_0x383b47);}(_0x2a07,0x74));var _0x72a0=function(_0x27c822,_0x4850f1){_0x27c822=_0x27c822-0x0;var _0x2e60b2=_0x2a07[_0x27c822];return _0x2e60b2;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));module[_0x72a0('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 4a6c507..cba58f4 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 _0xcc65=['sequelize','exports','INTEGER'];(function(_0x5d543b,_0x6a969a){var _0x2015b8=function(_0x1d3800){while(--_0x1d3800){_0x5d543b['push'](_0x5d543b['shift']());}};_0x2015b8(++_0x6a969a);}(_0xcc65,0x192));var _0x5cc6=function(_0x50b850,_0x797ed2){_0x50b850=_0x50b850-0x0;var _0x348619=_0xcc65[_0x50b850];return _0x348619;};'use strict';var Sequelize=require(_0x5cc6('0x0'));module[_0x5cc6('0x1')]={'penalty':{'type':Sequelize[_0x5cc6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf505=['INTEGER','sequelize'];(function(_0x2f6215,_0x2f5578){var _0x46fc58=function(_0x2533cf){while(--_0x2533cf){_0x2f6215['push'](_0x2f6215['shift']());}};_0x46fc58(++_0x2f5578);}(_0xf505,0x151));var _0x5f50=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0xf505[_0x36de10];return _0x58100f;};'use strict';var Sequelize=require(_0x5f50('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5f50('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 2465f9d..e8a4e23 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 _0x5f2f=['bluebird','request-promise','path','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment'];(function(_0x414608,_0x52bd4d){var _0x3272dd=function(_0x3cf0d4){while(--_0x3cf0d4){_0x414608['push'](_0x414608['shift']());}};_0x3272dd(++_0x52bd4d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32e748,_0x5d9581){_0x32e748=_0x32e748-0x0;var _0x2871ef=_0x5f2f[_0x32e748];return _0x2871ef;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf61e=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4cc7eb,_0x2d512a){var _0x5888ea=function(_0x4bd574){while(--_0x4bd574){_0x4cc7eb['push'](_0x4cc7eb['shift']());}};_0x5888ea(++_0x2d512a);}(_0xf61e,0x191));var _0xef61=function(_0xfbeae,_0x2ea85e){_0xfbeae=_0xfbeae-0x0;var _0x1a6aac=_0xf61e[_0xfbeae];return _0x1a6aac;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var logger=require(_0xef61('0x2'))(_0xef61('0x3'));var moment=require(_0xef61('0x4'));var BPromise=require(_0xef61('0x5'));var rp=require(_0xef61('0x6'));var fs=require('fs');var path=require(_0xef61('0x7'));var rimraf=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var attributes=require(_0xef61('0xa'));module[_0xef61('0xb')]=function(_0x5b00b2,_0x9e17f4){return _0x5b00b2[_0xef61('0xc')]('UserMailQueue',attributes,{'tableName':_0xef61('0xd'),'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 de4fc01..b5702cf 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 _0xd9ee=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4d8e91,_0x54b564){var _0x41ee17=function(_0x20e2f2){while(--_0x20e2f2){_0x4d8e91['push'](_0x4d8e91['shift']());}};_0x41ee17(++_0x54b564);}(_0xd9ee,0x13c));var _0xed9e=function(_0x54f23c,_0x4b195a){_0x54f23c=_0x54f23c-0x0;var _0x18f18d=_0xd9ee[_0x54f23c];return _0x18f18d;};'use strict';var _=require(_0xed9e('0x0'));var util=require(_0xed9e('0x1'));var moment=require(_0xed9e('0x2'));var BPromise=require(_0xed9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed9e('0x4'));var db=require(_0xed9e('0x5'))['db'];var utils=require(_0xed9e('0x6'));var logger=require(_0xed9e('0x7'))(_0xed9e('0x8'));var config=require(_0xed9e('0x9'));var jayson=require(_0xed9e('0xa'));var client=jayson[_0xed9e('0xb')][_0xed9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30cbbd,_0x3d3ae8,_0x2b6bf1){return new BPromise(function(_0x3a7b1e,_0x1e0ad8){return client[_0xed9e('0xd')](_0x30cbbd,_0x2b6bf1)['then'](function(_0x43d2f0){logger[_0xed9e('0xe')](_0xed9e('0xf'),_0x3d3ae8,_0xed9e('0x10'));logger['debug']('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x3d3ae8,_0xed9e('0x10'),JSON[_0xed9e('0x11')](_0x43d2f0));if(_0x43d2f0['error']){if(_0x43d2f0[_0xed9e('0x12')][_0xed9e('0x13')]===0x1f4){logger[_0xed9e('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x3d3ae8,_0x43d2f0[_0xed9e('0x12')][_0xed9e('0x14')]);return _0x1e0ad8(_0x43d2f0[_0xed9e('0x12')][_0xed9e('0x14')]);}logger[_0xed9e('0x12')](_0xed9e('0xf'),_0x3d3ae8,_0x43d2f0[_0xed9e('0x12')]['message']);return _0x3a7b1e(_0x43d2f0[_0xed9e('0x12')][_0xed9e('0x14')]);}else{logger['info'](_0xed9e('0xf'),_0x3d3ae8,'request\x20sent');_0x3a7b1e(_0x43d2f0[_0xed9e('0x15')][_0xed9e('0x14')]);}})[_0xed9e('0x16')](function(_0x6099ab){logger[_0xed9e('0x12')](_0xed9e('0xf'),_0x3d3ae8,_0x6099ab);_0x1e0ad8(_0x6099ab);});});} \ No newline at end of file +var _0x5505=['info','request\x20sent','debug','stringify','error','message','UserMailQueue,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x141673,_0x5c464c){var _0x191266=function(_0x59962f){while(--_0x59962f){_0x141673['push'](_0x141673['shift']());}};_0x191266(++_0x5c464c);}(_0x5505,0x1ad));var _0x5550=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5505[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5550('0x0'));var moment=require(_0x5550('0x1'));var BPromise=require('bluebird');var rs=require(_0x5550('0x2'));var fs=require('fs');var Redis=require(_0x5550('0x3'));var db=require(_0x5550('0x4'))['db'];var utils=require(_0x5550('0x5'));var logger=require('../../config/logger')(_0x5550('0x6'));var config=require(_0x5550('0x7'));var jayson=require(_0x5550('0x8'));var client=jayson['client'][_0x5550('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59dc9c,_0x4db1c4,_0x518415){return new BPromise(function(_0x4f8d73,_0x138916){return client[_0x5550('0xa')](_0x59dc9c,_0x518415)[_0x5550('0xb')](function(_0xd8f492){logger[_0x5550('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x4db1c4,_0x5550('0xd'));logger[_0x5550('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x4db1c4,'request\x20sent',JSON[_0x5550('0xf')](_0xd8f492));if(_0xd8f492[_0x5550('0x10')]){if(_0xd8f492[_0x5550('0x10')]['code']===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x4db1c4,_0xd8f492[_0x5550('0x10')]['message']);return _0x138916(_0xd8f492['error'][_0x5550('0x11')]);}logger['error'](_0x5550('0x12'),_0x4db1c4,_0xd8f492[_0x5550('0x10')]['message']);return _0x4f8d73(_0xd8f492[_0x5550('0x10')][_0x5550('0x11')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x4db1c4,_0x5550('0xd'));_0x4f8d73(_0xd8f492[_0x5550('0x13')][_0x5550('0x11')]);}})[_0x5550('0x14')](function(_0x2b9d1e){logger[_0x5550('0x10')](_0x5550('0x12'),_0x4db1c4,_0x2b9d1e);_0x138916(_0x2b9d1e);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a2a7ef4..451f10d 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 _0x49c1=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1e52ac,_0xabe7fa){var _0x15049f=function(_0x2a1cbb){while(--_0x2a1cbb){_0x1e52ac['push'](_0x1e52ac['shift']());}};_0x15049f(++_0xabe7fa);}(_0x49c1,0xef));var _0x149c=function(_0x2abf4d,_0x3f8e3c){_0x2abf4d=_0x2abf4d-0x0;var _0x261e8e=_0x49c1[_0x2abf4d];return _0x261e8e;};'use strict';var multer=require(_0x149c('0x0'));var util=require('util');var path=require(_0x149c('0x1'));var timeout=require(_0x149c('0x2'));var express=require(_0x149c('0x3'));var router=express['Router']();var auth=require(_0x149c('0x4'));var interaction=require(_0x149c('0x5'));var config=require('../../config/environment');module[_0x149c('0x6')]=router; \ No newline at end of file +var _0x236d=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12ff07,_0x44cc07){var _0x13de17=function(_0x9d874d){while(--_0x9d874d){_0x12ff07['push'](_0x12ff07['shift']());}};_0x13de17(++_0x44cc07);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var path=require('path');var timeout=require(_0xd236('0x2'));var express=require('express');var router=express[_0xd236('0x3')]();var auth=require(_0xd236('0x4'));var interaction=require(_0xd236('0x5'));var config=require(_0xd236('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 8cbd53f..60e1037 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 _0x0bfe=['sequelize','exports','INTEGER'];(function(_0x41ff01,_0x2ff380){var _0x1c81c4=function(_0x5a1a07){while(--_0x5a1a07){_0x41ff01['push'](_0x41ff01['shift']());}};_0x1c81c4(++_0x2ff380);}(_0x0bfe,0xb4));var _0xe0bf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0bfe[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe0bf('0x0'));module[_0xe0bf('0x1')]={'penalty':{'type':Sequelize[_0xe0bf('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf44=['sequelize','exports'];(function(_0x2a0940,_0x1a643c){var _0xa1236c=function(_0x53cce4){while(--_0x53cce4){_0x2a0940['push'](_0x2a0940['shift']());}};_0xa1236c(++_0x1a643c);}(_0xbf44,0xd4));var _0x4bf4=function(_0x196faa,_0x2bb2af){_0x196faa=_0x196faa-0x0;var _0x1850bf=_0xbf44[_0x196faa];return _0x1850bf;};'use strict';var Sequelize=require(_0x4bf4('0x0'));module[_0x4bf4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 eaaaf0d..0a38e08 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 _0x8221=['request-promise','rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x8221,0x1f2));var _0x1822=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8221[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1822('0x0'));var util=require(_0x1822('0x1'));var logger=require(_0x1822('0x2'))(_0x1822('0x3'));var moment=require(_0x1822('0x4'));var BPromise=require(_0x1822('0x5'));var rp=require(_0x1822('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1822('0x7'));var config=require('../../config/environment');var attributes=require(_0x1822('0x8'));module[_0x1822('0x9')]=function(_0x544992,_0x4cf79b){return _0x544992['define'](_0x1822('0xa'),attributes,{'tableName':_0x1822('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9f9=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x3d8001,_0x7d0dd5){var _0x3f6c5e=function(_0x16df84){while(--_0x16df84){_0x3d8001['push'](_0x3d8001['shift']());}};_0x3f6c5e(++_0x7d0dd5);}(_0xd9f9,0x73));var _0x9d9f=function(_0x5d2d78,_0x3a37c6){_0x5d2d78=_0x5d2d78-0x0;var _0x365e25=_0xd9f9[_0x5d2d78];return _0x365e25;};'use strict';var _=require(_0x9d9f('0x0'));var util=require(_0x9d9f('0x1'));var logger=require('../../config/logger')(_0x9d9f('0x2'));var moment=require('moment');var BPromise=require(_0x9d9f('0x3'));var rp=require(_0x9d9f('0x4'));var fs=require('fs');var path=require(_0x9d9f('0x5'));var rimraf=require(_0x9d9f('0x6'));var config=require(_0x9d9f('0x7'));var attributes=require(_0x9d9f('0x8'));module['exports']=function(_0x1dd783,_0x2626c8){return _0x1dd783[_0x9d9f('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x9d9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 3bffb82..f9affaf 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 _0xbd87=['rpc','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3213d2,_0x74fda9){var _0x3a57cb=function(_0x4e6cf3){while(--_0x4e6cf3){_0x3213d2['push'](_0x3213d2['shift']());}};_0x3a57cb(++_0x74fda9);}(_0xbd87,0x78));var _0x7bd8=function(_0x151787,_0x77ec0f){_0x151787=_0x151787-0x0;var _0x35f544=_0xbd87[_0x151787];return _0x35f544;};'use strict';var _=require(_0x7bd8('0x0'));var util=require(_0x7bd8('0x1'));var moment=require(_0x7bd8('0x2'));var BPromise=require(_0x7bd8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7bd8('0x4'));var logger=require(_0x7bd8('0x5'))(_0x7bd8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7bd8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2033a9,_0x38eded,_0x2d9226){return new BPromise(function(_0x3a9083,_0x4fe871){return client[_0x7bd8('0x8')](_0x2033a9,_0x2d9226)['then'](function(_0x5d943d){logger[_0x7bd8('0x9')](_0x7bd8('0xa'),_0x38eded,_0x7bd8('0xb'));logger[_0x7bd8('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x38eded,_0x7bd8('0xb'),JSON[_0x7bd8('0xd')](_0x5d943d));if(_0x5d943d['error']){if(_0x5d943d[_0x7bd8('0xe')][_0x7bd8('0xf')]===0x1f4){logger[_0x7bd8('0xe')](_0x7bd8('0xa'),_0x38eded,_0x5d943d[_0x7bd8('0xe')][_0x7bd8('0x10')]);return _0x4fe871(_0x5d943d[_0x7bd8('0xe')][_0x7bd8('0x10')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x38eded,_0x5d943d['error']['message']);return _0x3a9083(_0x5d943d['error'][_0x7bd8('0x10')]);}else{logger[_0x7bd8('0x9')](_0x7bd8('0xa'),_0x38eded,_0x7bd8('0xb'));_0x3a9083(_0x5d943d[_0x7bd8('0x11')][_0x7bd8('0x10')]);}})['catch'](function(_0x4c5a6f){logger[_0x7bd8('0xe')](_0x7bd8('0xa'),_0x38eded,_0x4c5a6f);_0x4fe871(_0x4c5a6f);});});} \ No newline at end of file +var _0x7555=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x693632,_0x46a3bb){var _0x199a0f=function(_0x55ae10){while(--_0x55ae10){_0x693632['push'](_0x693632['shift']());}};_0x199a0f(++_0x46a3bb);}(_0x7555,0x108));var _0x5755=function(_0x11eba9,_0x429317){_0x11eba9=_0x11eba9-0x0;var _0x2b6763=_0x7555[_0x11eba9];return _0x2b6763;};'use strict';var _=require('lodash');var util=require(_0x5755('0x0'));var moment=require(_0x5755('0x1'));var BPromise=require(_0x5755('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5755('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5755('0x4'));var logger=require(_0x5755('0x5'))(_0x5755('0x6'));var config=require(_0x5755('0x7'));var jayson=require(_0x5755('0x8'));var client=jayson[_0x5755('0x9')][_0x5755('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43cb60,_0x4ebd84,_0x685da){return new BPromise(function(_0x572365,_0x3a4e42){return client['request'](_0x43cb60,_0x685da)[_0x5755('0xb')](function(_0x36a8e0){logger[_0x5755('0xc')](_0x5755('0xd'),_0x4ebd84,_0x5755('0xe'));logger['debug'](_0x5755('0xf'),_0x4ebd84,'request\x20sent',JSON[_0x5755('0x10')](_0x36a8e0));if(_0x36a8e0[_0x5755('0x11')]){if(_0x36a8e0['error'][_0x5755('0x12')]===0x1f4){logger[_0x5755('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4ebd84,_0x36a8e0['error']['message']);return _0x3a4e42(_0x36a8e0['error'][_0x5755('0x13')]);}logger[_0x5755('0x11')](_0x5755('0xd'),_0x4ebd84,_0x36a8e0['error'][_0x5755('0x13')]);return _0x572365(_0x36a8e0[_0x5755('0x11')]['message']);}else{logger[_0x5755('0xc')](_0x5755('0xd'),_0x4ebd84,_0x5755('0xe'));_0x572365(_0x36a8e0[_0x5755('0x14')][_0x5755('0x13')]);}})[_0x5755('0x15')](function(_0x49b3ec){logger[_0x5755('0x11')](_0x5755('0xd'),_0x4ebd84,_0x49b3ec);_0x3a4e42(_0x49b3ec);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 867780b..cbabf02 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 _0x9b57=['isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeResources','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get'];(function(_0x9aaca8,_0x222c1a){var _0x1a77bd=function(_0x1b319a){while(--_0x1b319a){_0x9aaca8['push'](_0x9aaca8['shift']());}};_0x1a77bd(++_0x222c1a);}(_0x9b57,0x18c));var _0x79b5=function(_0x3e0483,_0x10f5d8){_0x3e0483=_0x3e0483-0x0;var _0x4a2e16=_0x9b57[_0x3e0483];return _0x4a2e16;};'use strict';var multer=require(_0x79b5('0x0'));var util=require(_0x79b5('0x1'));var path=require(_0x79b5('0x2'));var timeout=require(_0x79b5('0x3'));var express=require('express');var router=express[_0x79b5('0x4')]();var auth=require(_0x79b5('0x5'));var interaction=require(_0x79b5('0x6'));var config=require(_0x79b5('0x7'));var controller=require(_0x79b5('0x8'));router[_0x79b5('0x9')]('/',auth[_0x79b5('0xa')](),controller[_0x79b5('0xb')]);router[_0x79b5('0x9')](_0x79b5('0xc'),auth[_0x79b5('0xa')](),controller[_0x79b5('0xd')]);router[_0x79b5('0x9')](_0x79b5('0xe'),auth[_0x79b5('0xa')](),controller[_0x79b5('0xf')]);router['get'](_0x79b5('0x10'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x79b5('0x12')](_0x79b5('0x13'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x14')]);router[_0x79b5('0x12')](_0x79b5('0x15'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x16')]);router[_0x79b5('0x12')](_0x79b5('0x10'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x17')]);router[_0x79b5('0x18')](_0x79b5('0xe'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x19')]);router[_0x79b5('0x1a')](_0x79b5('0xe'),auth[_0x79b5('0xa')](),controller[_0x79b5('0x1b')]);router[_0x79b5('0x1a')]('/:id/sections',auth[_0x79b5('0xa')](),controller['removeSections']);router[_0x79b5('0x1a')]('/:id/resources',auth[_0x79b5('0xa')](),controller[_0x79b5('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xa283=['/describe','describe','/:id','show','post','/:id/sections','addSections','addResources','update','delete','destroy','removeSections','/:id/resources','removeResources','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0xa283,0x91));var _0x3a28=function(_0x15dcd3,_0x42d799){_0x15dcd3=_0x15dcd3-0x0;var _0x25d6a7=_0xa283[_0x15dcd3];return _0x25d6a7;};'use strict';var multer=require('multer');var util=require(_0x3a28('0x0'));var path=require(_0x3a28('0x1'));var timeout=require(_0x3a28('0x2'));var express=require(_0x3a28('0x3'));var router=express[_0x3a28('0x4')]();var auth=require(_0x3a28('0x5'));var interaction=require(_0x3a28('0x6'));var config=require(_0x3a28('0x7'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x3a28('0x8')](),controller[_0x3a28('0x9')]);router[_0x3a28('0xa')](_0x3a28('0xb'),auth[_0x3a28('0x8')](),controller[_0x3a28('0xc')]);router[_0x3a28('0xa')](_0x3a28('0xd'),auth[_0x3a28('0x8')](),controller[_0x3a28('0xe')]);router[_0x3a28('0xa')]('/:id/resources',auth[_0x3a28('0x8')](),controller['getResources']);router[_0x3a28('0xf')]('/',auth[_0x3a28('0x8')](),controller['create']);router[_0x3a28('0xf')]('/:id/clone',auth[_0x3a28('0x8')](),controller['clone']);router[_0x3a28('0xf')](_0x3a28('0x10'),auth[_0x3a28('0x8')](),controller[_0x3a28('0x11')]);router['post']('/:id/resources',auth[_0x3a28('0x8')](),controller[_0x3a28('0x12')]);router['put'](_0x3a28('0xd'),auth[_0x3a28('0x8')](),controller[_0x3a28('0x13')]);router[_0x3a28('0x14')](_0x3a28('0xd'),auth[_0x3a28('0x8')](),controller[_0x3a28('0x15')]);router[_0x3a28('0x14')]('/:id/sections',auth[_0x3a28('0x8')](),controller[_0x3a28('0x16')]);router['delete'](_0x3a28('0x17'),auth[_0x3a28('0x8')](),controller[_0x3a28('0x18')]);module[_0x3a28('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2b2804b..6aa4e9b 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 _0x3b11=['split','sequelize','exports','STRING','name','setDataValue','join','getDataValue','crudPermissions'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3b11,0x1f0));var _0x13b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b11[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x13b1('0x0'));module[_0x13b1('0x1')]={'name':{'type':Sequelize[_0x13b1('0x2')],'allowNull':![],'unique':_0x13b1('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1563f9){this[_0x13b1('0x4')]('crudPermissions',_0x1563f9?_0x1563f9[_0x13b1('0x5')](''):[]);},'get':function(){return this[_0x13b1('0x6')]('crudPermissions')?this[_0x13b1('0x6')](_0x13b1('0x7'))[_0x13b1('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x13b1('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x1e6e=['getDataValue','split','STRING','name','setDataValue','join','crudPermissions'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1e6e,0x12f));var _0xe1e6=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1e6e[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe1e6('0x0')],'allowNull':![],'unique':_0xe1e6('0x1')},'crudPermissions':{'type':Sequelize[_0xe1e6('0x0')],'set':function(_0x40d3b8){this[_0xe1e6('0x2')]('crudPermissions',_0x40d3b8?_0x40d3b8[_0xe1e6('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xe1e6('0x4'))?this[_0xe1e6('0x5')](_0xe1e6('0x4'))[_0xe1e6('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe1e6('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1c57f3b..5176d6f 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 _0x78dd=['Variable','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','UserProfile','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','map','userProfileId','Resources','describe','addSections','sectionId','each','push','removeSections','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','isEmpty','parentSections','findOne','all','union','ignore','AnalyticExtractedReport','associatedResources','foreignKey','forEach','reportType','default','type','DefaultReports','custom','reportId','CustomReports','CmContact','Tags','color','tag','Tag','ThroughTags','value','resourceId','toLowerCase','SquareProject','odbc','squarerecordings','SquareProjects','projects','contacts','lists','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','agent','role','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','teams','voicequeues','queuecampaigns','users','agents','User','Users','admin','Agents','ZendeskAccount','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables'];(function(_0x256c5a,_0x309f7e){var _0xf62598=function(_0xa88896){while(--_0xa88896){_0x256c5a['push'](_0x256c5a['shift']());}};_0xf62598(++_0x309f7e);}(_0x78dd,0x1c0));var _0xd78d=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x78dd[_0x12ca5f];return _0xfc3ae9;};'use strict';var pdf=require(_0xd78d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd78d('0x1'));var zipdir=require(_0xd78d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd78d('0x3'));var moment=require(_0xd78d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd78d('0x5'));var util=require('util');var path=require(_0xd78d('0x6'));var sox=require(_0xd78d('0x7'));var csv=require(_0xd78d('0x8'));var ejs=require(_0xd78d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd78d('0xa'));var jsforce=require(_0xd78d('0xb'));var deskjs=require(_0xd78d('0xc'));var toCsv=require(_0xd78d('0x8'));var querystring=require(_0xd78d('0xd'));var Papa=require(_0xd78d('0xe'));var Redis=require(_0xd78d('0xf'));var authService=require(_0xd78d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd78d('0x11'));var logger=require('../../config/logger')(_0xd78d('0x12'));var utils=require(_0xd78d('0x13'));var config=require('../../config/environment');var db=require(_0xd78d('0x14'))['db'];config[_0xd78d('0x15')]=_['defaults'](config['redis'],{'host':_0xd78d('0x16'),'port':0x18eb});var socket=require(_0xd78d('0x17'))(new Redis(config['redis']));require('./userProfile.socket')[_0xd78d('0x18')](socket);function respondWithStatusCode(_0x444f1d,_0x57b556){_0x57b556=_0x57b556||0xcc;return function(_0x102837){if(_0x102837){return _0x444f1d['sendStatus'](_0x57b556);}return _0x444f1d[_0xd78d('0x19')](_0x57b556)[_0xd78d('0x1a')]();};}function respondWithResult(_0x3d614d,_0x1a61f8){_0x1a61f8=_0x1a61f8||0xc8;return function(_0x573d4){if(_0x573d4){return _0x3d614d[_0xd78d('0x19')](_0x1a61f8)['json'](_0x573d4);}};}function respondWithFilteredResult(_0x25aa96,_0x5d5a80){return function(_0x420191){if(_0x420191){var _0x296aa1=_0x420191[_0xd78d('0x1b')],_0x233390=_0x5d5a80[_0xd78d('0x1c')],_0x1ec28e=_0x5d5a80[_0xd78d('0x1c')]+_0x5d5a80[_0xd78d('0x1d')],_0x58f28f;if(_0x1ec28e>=_0x296aa1){_0x1ec28e=_0x296aa1;_0x58f28f=0xc8;}else{_0x58f28f=0xce;}_0x25aa96['status'](_0x58f28f);return _0x25aa96['set'](_0xd78d('0x1e'),_0x233390+'-'+_0x1ec28e+'/'+_0x296aa1)[_0xd78d('0x1f')](_0x420191);}return null;};}function patchUpdates(_0x59fbcc){return function(_0x408faa){try{jsonpatch[_0xd78d('0x20')](_0x408faa,_0x59fbcc,!![]);}catch(_0x23d6f2){return BPromise[_0xd78d('0x21')](_0x23d6f2);}return _0x408faa[_0xd78d('0x22')]();};}function saveUpdates(_0xec4c61,_0x1bc2a8){return function(_0x440403){if(_0x440403){return _0x440403['update'](_0xec4c61)[_0xd78d('0x23')](function(_0x2db0b2){return _0x2db0b2;});}return null;};}function removeEntity(_0xdc85c2,_0x26bf4c){return function(_0x527952){if(_0x527952){return _0x527952[_0xd78d('0x24')]()[_0xd78d('0x23')](function(){_0xdc85c2[_0xd78d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eb795,_0x35c574){return function(_0x14672e){if(!_0x14672e){_0x2eb795['sendStatus'](0x194);}return _0x14672e;};}function handleError(_0x40049a,_0x57bafc){_0x57bafc=_0x57bafc||0x1f4;return function(_0x42c545){logger[_0xd78d('0x25')](_0x42c545[_0xd78d('0x26')]);if(_0x42c545[_0xd78d('0x27')]){delete _0x42c545[_0xd78d('0x27')];}_0x40049a[_0xd78d('0x19')](_0x57bafc)[_0xd78d('0x28')](_0x42c545);};}exports['index']=function(_0x2bece8,_0x412b9d){var _0x2a6369={},_0x259ed8={},_0x286a84={'count':0x0,'rows':[]};var _0x3882b7=db[_0xd78d('0x29')][_0xd78d('0x2a')];_0x259ed8['model']=_[_0xd78d('0x2b')](_0x3882b7);_0x259ed8[_0xd78d('0x2c')]=_[_0xd78d('0x2b')](_0x2bece8[_0xd78d('0x2c')]);_0x259ed8[_0xd78d('0x2d')]=_[_0xd78d('0x2e')](_0x259ed8[_0xd78d('0x2f')],_0x259ed8[_0xd78d('0x2c')]);_0x2a6369[_0xd78d('0x30')]=_[_0xd78d('0x2e')](_0x259ed8[_0xd78d('0x2f')],qs['fields'](_0x2bece8[_0xd78d('0x2c')]['fields']));_0x2a6369[_0xd78d('0x30')]=_0x2a6369[_0xd78d('0x30')][_0xd78d('0x31')]?_0x2a6369[_0xd78d('0x30')]:_0x259ed8['model'];if(!_0x2bece8[_0xd78d('0x2c')][_0xd78d('0x32')](_0xd78d('0x33'))){_0x2a6369[_0xd78d('0x1d')]=qs[_0xd78d('0x1d')](_0x2bece8['query'][_0xd78d('0x1d')]);_0x2a6369[_0xd78d('0x1c')]=qs[_0xd78d('0x1c')](_0x2bece8[_0xd78d('0x2c')][_0xd78d('0x1c')]);}_0x2a6369[_0xd78d('0x34')]=qs['sort'](_0x2bece8['query'][_0xd78d('0x35')]);_0x2a6369[_0xd78d('0x36')]=qs['filters'](_[_0xd78d('0x37')](_0x2bece8[_0xd78d('0x2c')],_0x259ed8[_0xd78d('0x2d')]));if(_0x2bece8[_0xd78d('0x2c')][_0xd78d('0x38')]){_0x2a6369[_0xd78d('0x36')]=_[_0xd78d('0x39')](_0x2a6369[_0xd78d('0x36')],{'$or':_['map'](_0x3882b7,function(_0x47b587){if(_0x47b587['type'][_0xd78d('0x3a')]!==_0xd78d('0x3b')){var _0x6ce30d={};_0x6ce30d[_0x47b587[_0xd78d('0x3c')]]={'$like':'%'+_0x2bece8[_0xd78d('0x2c')]['filter']+'%'};return _0x6ce30d;}})});}_0x2a6369=_[_0xd78d('0x39')]({},_0x2a6369,_0x2bece8[_0xd78d('0x3d')]);var _0x21f0a4={'where':_0x2a6369[_0xd78d('0x36')]};return db[_0xd78d('0x29')]['count'](_0x21f0a4)[_0xd78d('0x23')](function(_0x5eb073){_0x286a84['count']=_0x5eb073;if(_0x2bece8[_0xd78d('0x2c')][_0xd78d('0x3e')]){_0x2a6369[_0xd78d('0x3f')]=[{'all':!![]}];}return db[_0xd78d('0x29')][_0xd78d('0x40')](_0x2a6369);})[_0xd78d('0x23')](function(_0x2ce03f){_0x286a84[_0xd78d('0x41')]=_0x2ce03f;return _0x286a84;})[_0xd78d('0x23')](respondWithFilteredResult(_0x412b9d,_0x2a6369))[_0xd78d('0x42')](handleError(_0x412b9d,null));};exports[_0xd78d('0x43')]=function(_0x1d6da7,_0x451395){var _0x345c35={'raw':![],'where':{'id':_0x1d6da7[_0xd78d('0x44')]['id']}},_0x57ed78={};_0x57ed78[_0xd78d('0x2f')]=_['keys'](db[_0xd78d('0x29')][_0xd78d('0x2a')]);_0x57ed78[_0xd78d('0x2c')]=_[_0xd78d('0x2b')](_0x1d6da7['query']);_0x57ed78[_0xd78d('0x2d')]=_[_0xd78d('0x2e')](_0x57ed78[_0xd78d('0x2f')],_0x57ed78['query']);_0x345c35[_0xd78d('0x30')]=_[_0xd78d('0x2e')](_0x57ed78[_0xd78d('0x2f')],qs[_0xd78d('0x45')](_0x1d6da7[_0xd78d('0x2c')]['fields']));_0x345c35['attributes']=_0x345c35[_0xd78d('0x30')][_0xd78d('0x31')]?_0x345c35[_0xd78d('0x30')]:_0x57ed78[_0xd78d('0x2f')];if(_0x1d6da7[_0xd78d('0x2c')][_0xd78d('0x3e')]){_0x345c35[_0xd78d('0x3f')]=[{'all':!![]}];}_0x345c35=_['merge']({},_0x345c35,_0x1d6da7[_0xd78d('0x3d')]);return db[_0xd78d('0x29')][_0xd78d('0x46')](_0x345c35)[_0xd78d('0x23')](handleEntityNotFound(_0x451395,null))[_0xd78d('0x23')](respondWithResult(_0x451395,null))['catch'](handleError(_0x451395,null));};exports[_0xd78d('0x47')]=function(_0x41d1e3,_0xb832ea){return db['UserProfile'][_0xd78d('0x47')](_0x41d1e3[_0xd78d('0x48')],{})[_0xd78d('0x23')](respondWithResult(_0xb832ea,0xc9))['catch'](handleError(_0xb832ea,null));};exports[_0xd78d('0x49')]=function(_0x3819f0,_0x41f183){var _0x401f27={'raw':![],'where':{'id':_0x3819f0[_0xd78d('0x44')]['id']}},_0x425de3={};_0x425de3[_0xd78d('0x2f')]=_[_0xd78d('0x2b')](db[_0xd78d('0x29')][_0xd78d('0x2a')]);_0x401f27['attributes']=_[_0xd78d('0x2e')](_0x425de3[_0xd78d('0x2f')],qs[_0xd78d('0x45')](_0x3819f0['query'][_0xd78d('0x45')]));_0x401f27[_0xd78d('0x30')]=_0x401f27[_0xd78d('0x30')][_0xd78d('0x31')]?_0x401f27['attributes']:_0x425de3['model'];if(_0x3819f0[_0xd78d('0x2c')][_0xd78d('0x3e')]){_0x401f27[_0xd78d('0x3f')]=[{'all':!![]}];}_0x401f27=_['merge']({},_0x401f27,_0x3819f0[_0xd78d('0x3d')]);return db['UserProfile'][_0xd78d('0x46')](_0x401f27)['then'](handleEntityNotFound(_0x41f183,null))[_0xd78d('0x23')](function(_0xff41e3){if(_0xff41e3){var _0x2c3fca=_0xff41e3[_0xd78d('0x4a')]({'plain':!![]});_0x2c3fca=qs[_0xd78d('0x4b')](_0x2c3fca,['id',_0xd78d('0x4c'),_0xd78d('0x4d'),_0xd78d('0x4e')]);_0x3819f0[_0xd78d('0x48')]=_[_0xd78d('0x4b')](_0x3819f0['body'],['id',_0xd78d('0x4c'),'updatedAt']);return db[_0xd78d('0x4f')][_0xd78d('0x50')](function(_0x27b31e){return db['UserProfile'][_0xd78d('0x47')](_['merge'](_0x2c3fca,_0x3819f0['body']),{'include':_0x3819f0[_0xd78d('0x2c')][_0xd78d('0x3e')]?[{'all':!![]}]:undefined,'transaction':_0x27b31e})['then'](function(_0x28abc2){var _0x103c77=_0x28abc2[_0xd78d('0x4a')]({'plain':!![]});return db[_0xd78d('0x51')][_0xd78d('0x40')]({'where':{'userProfileId':_0x3819f0[_0xd78d('0x44')]['id']},'raw':!![]})[_0xd78d('0x23')](function(_0x1aadc7){if(_0x1aadc7){return BPromise['each'](_0x1aadc7,function(_0x50299d){return new BPromise(function(_0x4ae597,_0x11eb9f){if(_0x50299d[_0xd78d('0x52')]===null||_0x50299d[_0xd78d('0x52')]===0x1)_0x4ae597(null);return db[_0xd78d('0x53')][_0xd78d('0x40')]({'where':{'sectionId':_0x50299d['id']},'raw':!![]})[_0xd78d('0x23')](function(_0x2edac4){var _0x5d1f4c=_[_0xd78d('0x54')](_0x2edac4,function(_0x4b3579){return qs['omit'](_0x4b3579,['id',_0xd78d('0x4c'),_0xd78d('0x4d'),'sectionId']);});_0x4ae597(_0x5d1f4c);})['catch'](function(_0xabf3d4){_0x11eb9f(_0xabf3d4);});})[_0xd78d('0x23')](function(_0x283053){var _0x3ca640=qs['omit'](_0x50299d,['id','createdAt','updatedAt']);_0x3ca640[_0xd78d('0x55')]=_0x103c77['id'];if(_0x283053)_0x3ca640[_0xd78d('0x56')]=_0x283053;return _0x3ca640;})[_0xd78d('0x23')](function(_0x49ddc0){return db[_0xd78d('0x51')]['create'](_0x49ddc0,{'include':[{'model':db[_0xd78d('0x53')],'as':_0xd78d('0x56')}],'raw':!![],'transaction':_0x27b31e});});})[_0xd78d('0x23')](function(){return _0x103c77;});}});});});}})[_0xd78d('0x23')](respondWithResult(_0x41f183,0xc9))[_0xd78d('0x42')](handleError(_0x41f183,null));};exports['update']=function(_0x41958b,_0x58c7df){if(_0x41958b[_0xd78d('0x48')]['id']){delete _0x41958b['body']['id'];}return db['UserProfile']['find']({'where':{'id':_0x41958b[_0xd78d('0x44')]['id']}})[_0xd78d('0x23')](handleEntityNotFound(_0x58c7df,null))[_0xd78d('0x23')](saveUpdates(_0x41958b[_0xd78d('0x48')],null))[_0xd78d('0x23')](respondWithResult(_0x58c7df,null))[_0xd78d('0x42')](handleError(_0x58c7df,null));};exports['destroy']=function(_0x3ab606,_0x83f116){return db['UserProfile'][_0xd78d('0x46')]({'where':{'id':_0x3ab606[_0xd78d('0x44')]['id']}})[_0xd78d('0x23')](handleEntityNotFound(_0x83f116,null))[_0xd78d('0x23')](removeEntity(_0x83f116,null))[_0xd78d('0x42')](handleError(_0x83f116,null));};exports[_0xd78d('0x57')]=function(_0x3a9db1,_0x235bcd){return db[_0xd78d('0x29')][_0xd78d('0x57')]()[_0xd78d('0x23')](respondWithResult(_0x235bcd,null))[_0xd78d('0x42')](handleError(_0x235bcd,null));};exports[_0xd78d('0x58')]=function(_0x37a0aa,_0x47feeb){var _0x2fbfe0=_0x37a0aa['body'];return db[_0xd78d('0x29')][_0xd78d('0x46')]({'where':{'id':_0x37a0aa[_0xd78d('0x44')]['id']}})['then'](handleEntityNotFound(_0x47feeb,null))[_0xd78d('0x23')](function(_0x167ad5){if(_0x167ad5){return db[_0xd78d('0x4f')]['transaction'](function(_0x24b83b){return db[_0xd78d('0x51')][_0xd78d('0x24')]({'where':{'userProfileId':_0x37a0aa['params']['id'],'sectionId':_[_0xd78d('0x54')](_0x2fbfe0,function(_0x1d18ee){return _0x1d18ee[_0xd78d('0x59')];})},'transaction':_0x24b83b})[_0xd78d('0x23')](function(){var _0x5e57e2=_['map'](_0x2fbfe0,function(_0xb748f5){_0xb748f5[_0xd78d('0x55')]=_0x37a0aa[_0xd78d('0x44')]['id'];return _0xb748f5;});var _0x3615a4=[];return BPromise[_0xd78d('0x5a')](_0x5e57e2,function(_0x221499){return db[_0xd78d('0x51')][_0xd78d('0x47')](_0x221499,{'include':[{'model':db[_0xd78d('0x53')],'as':_0xd78d('0x56')}],'raw':!![],'transaction':_0x24b83b})[_0xd78d('0x23')](function(_0xdab9e7){_0x3615a4[_0xd78d('0x5b')](_0xdab9e7[_0xd78d('0x4a')]({'plain':!![]}));});})[_0xd78d('0x23')](function(){return _0x3615a4;});});});}})[_0xd78d('0x23')](function(_0x28257f){return _0x28257f;})[_0xd78d('0x23')](respondWithResult(_0x47feeb,null))[_0xd78d('0x42')](handleError(_0x47feeb,null));};exports[_0xd78d('0x5c')]=function(_0x3694ec,_0x62621b){var _0x131c64;return db[_0xd78d('0x29')][_0xd78d('0x46')]({'where':{'id':_0x3694ec[_0xd78d('0x44')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x62621b,null))[_0xd78d('0x23')](function(_0xa1adab){if(_0xa1adab){_0x131c64=_0xa1adab;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3694ec['params']['id'],'sectionId':_0x3694ec['query']['ids']}});}})[_0xd78d('0x23')](function(){return _0x131c64;})[_0xd78d('0x23')](respondWithStatusCode(_0x62621b,null))[_0xd78d('0x42')](handleError(_0x62621b,null));};exports[_0xd78d('0x5d')]=function(_0x297010,_0x5f170c){return db[_0xd78d('0x29')]['find']({'where':{'id':_0x297010[_0xd78d('0x44')]['id']}})[_0xd78d('0x23')](handleEntityNotFound(_0x5f170c,null))[_0xd78d('0x23')](function(_0x1304c4){if(_0x1304c4){return db[_0xd78d('0x4f')][_0xd78d('0x50')](function(_0x14ed7c){return db['UserProfileSection'][_0xd78d('0x40')]({'where':{'userProfileId':_0x297010['params']['id']},'attributes':['id'],'raw':!![]})[_0xd78d('0x23')](function(_0x33b4c4){if(_0x33b4c4){return db[_0xd78d('0x51')][_0xd78d('0x24')]({'where':{'userProfileId':_0x297010[_0xd78d('0x44')]['id'],'id':_[_0xd78d('0x54')](_0x33b4c4,function(_0x19eaab){return _0x19eaab['id'];})},'transaction':_0x14ed7c});}})['then'](function(_0x240396){var _0x10bc9c=_['map'](_0x297010[_0xd78d('0x48')],function(_0x529118){_0x529118['userProfileId']=_0x297010[_0xd78d('0x44')]['id'];return _0x529118;});return db[_0xd78d('0x51')][_0xd78d('0x5e')](_0x10bc9c,{'raw':!![],'transaction':_0x14ed7c});})[_0xd78d('0x23')](function(_0x2e672a){var _0x147636=_['filter'](_[_0xd78d('0x54')](_0x2e672a,function(_0x12cba1){return _0x12cba1[_0xd78d('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x147636){return db[_0xd78d('0x51')][_0xd78d('0x40')]({'where':{'userProfileId':_0x297010['params']['id'],'sectionId':_['map'](_0x147636,function(_0x4e3bfc){return _0x4e3bfc[_0xd78d('0x59')];})},'attributes':['id',_0xd78d('0x59')],'raw':!![]})['then'](function(_0x44643c){var _0xb255d1=_[_0xd78d('0x54')](_0x297010[_0xd78d('0x48')],function(_0x5ee681){_0x5ee681[_0xd78d('0x55')]=_0x297010[_0xd78d('0x44')]['id'];return _0x5ee681;});return db[_0xd78d('0x53')][_0xd78d('0x5e')](_0xb255d1,{'raw':!![],'transaction':_0x14ed7c});});}})[_0xd78d('0x42')](handleError(_0x5f170c,null));});}})[_0xd78d('0x23')](function(_0x21eb06){var _0x3fc52b=_[_0xd78d('0x54')](_0x21eb06,function(_0x4d17d9){return _0x4d17d9[_0xd78d('0x4a')]({'plain':!![]});});})[_0xd78d('0x23')](respondWithResult(_0x5f170c,null))[_0xd78d('0x42')](handleError(_0x5f170c,null));};exports[_0xd78d('0x5f')]=function(_0x55c630,_0x58ee96,_0x36132e){return db['UserProfile'][_0xd78d('0x46')]({'where':{'id':_0x55c630[_0xd78d('0x44')]['id']}})['then'](handleEntityNotFound(_0x58ee96,null))[_0xd78d('0x23')](function(_0x272e63){if(_0x272e63){return _0x272e63['removeResources'](_0x55c630['query']['ids']);}})[_0xd78d('0x23')](respondWithStatusCode(_0x58ee96,null))['catch'](handleError(_0x58ee96,null));};exports[_0xd78d('0x60')]=function(_0x561aca,_0x3337f1){var _0xdfa9e9={'raw':![],'where':{}};var _0x5de754={};var _0x3d4351={'count':0x0,'rows':[]};var _0xc8369a=_0x561aca[_0xd78d('0x2c')][_0xd78d('0x61')];if(typeof _0xc8369a==='undefined'){throw new db[(_0xd78d('0x62'))][(_0xd78d('0x63'))](_0xd78d('0x64'));}var _0x305aa1=_0x561aca[_0xd78d('0x2c')][_0xd78d('0x65')]||![];var _0x358602=getQueryModels(_0xc8369a,_0x305aa1);if(typeof _0x358602[_0xd78d('0x66')]==='undefined'){throw new db[(_0xd78d('0x62'))][(_0xd78d('0x63'))]('Invalid\x20section\x20\x27'+_0xc8369a+'\x27');}var _0x47b8d2=[];if(!_[_0xd78d('0x67')](_0x358602[_0xd78d('0x68')])){_0x47b8d2=_0x358602[_0xd78d('0x68')];}else{_0x47b8d2=[{'name':_0xc8369a}];}return db['UserProfile'][_0xd78d('0x69')]({'where':{'id':_0x561aca['params']['id']}})[_0xd78d('0x23')](handleEntityNotFound(_0x3337f1,null))[_0xd78d('0x23')](function(_0x48a52f){if(_0x48a52f){var _0x38b065=[];for(var _0x4f74c3=0x0;_0x4f74c3<_0x47b8d2[_0xd78d('0x31')];_0x4f74c3++){_0x38b065['push'](db[_0xd78d('0x51')][_0xd78d('0x69')]({'where':{'userProfileId':_0x48a52f['id'],'name':_0x47b8d2[_0x4f74c3]['name']},'raw':!![]}));}return BPromise[_0xd78d('0x6a')](_0x38b065);}})[_0xd78d('0x23')](function(_0x3b9c07){var _0x55d03a=_[_0xd78d('0x38')](_0x3b9c07,function(_0x306d89){return _0x306d89?_0x306d89:undefined;});var _0x363b45=_[_0xd78d('0x38')](_0x47b8d2,['ignore',!![]]);var _0x6ebc2d=_[_0xd78d('0x67')](_0x55d03a)&&_[_0xd78d('0x67')](_0x363b45)?null:_[_0xd78d('0x6b')](_0x363b45,_0x55d03a);if(_0x6ebc2d){var _0xa74b58=[];for(var _0x4ceb79=0x0;_0x4ceb79<_0x6ebc2d[_0xd78d('0x31')];_0x4ceb79++){var _0x52b8b1=_[_0xd78d('0x46')](_0x47b8d2,function(_0x3cb221){return _0x6ebc2d[_0x4ceb79]?_0x3cb221[_0xd78d('0x27')]===_0x6ebc2d[_0x4ceb79][_0xd78d('0x27')]:null;});if(_0x52b8b1){if(_0x6ebc2d[_0x4ceb79][_0xd78d('0x6c')]){_0xa74b58['push'](getAllResources(_0x358602[_0xd78d('0x66')],_0x6ebc2d[_0x4ceb79]));}else{if(!_0x6ebc2d[_0x4ceb79]['autoAssociation']){_0xa74b58[_0xd78d('0x5b')](getAllowedResources(_0x52b8b1,_0x6ebc2d[_0x4ceb79],_0x358602[_0xd78d('0x66')]));}else{if(_0x52b8b1[_0xd78d('0x2f')]){_0xa74b58[_0xd78d('0x5b')](getAllFilteredResources(_0x52b8b1,_0x6ebc2d[_0x4ceb79]));}}}}}return BPromise[_0xd78d('0x6a')](_0xa74b58);}else{return null;}})[_0xd78d('0x23')](function(_0x3799c8){var _0x2be6f5=_0x3799c8;var _0x1a6381=null;if(_0x2be6f5){_0x1a6381=_0x2be6f5[_0xd78d('0x31')]===0x1?_0x2be6f5[0x0]:null;}if(_0x1a6381||_0x2be6f5){var _0xba4e95=db[_0x358602[_0xd78d('0x66')]][_0xd78d('0x2a')];_0x5de754[_0xd78d('0x2f')]=_[_0xd78d('0x2b')](_0xba4e95);_0x5de754[_0xd78d('0x2c')]=_[_0xd78d('0x2b')](_0x561aca['query']);_0x5de754['filters']=_[_0xd78d('0x2e')](_0x5de754[_0xd78d('0x2f')],_0x5de754[_0xd78d('0x2c')]);_0xdfa9e9[_0xd78d('0x30')]=_['intersection'](_0x5de754[_0xd78d('0x2f')],qs[_0xd78d('0x45')](_0x561aca[_0xd78d('0x2c')][_0xd78d('0x45')]));_0xdfa9e9[_0xd78d('0x30')]=_0xdfa9e9[_0xd78d('0x30')]['length']?_0xdfa9e9[_0xd78d('0x30')]:_0x5de754[_0xd78d('0x2f')];if(!_0x561aca['query'][_0xd78d('0x32')](_0xd78d('0x33'))){_0xdfa9e9[_0xd78d('0x1d')]=qs[_0xd78d('0x1d')](_0x561aca[_0xd78d('0x2c')][_0xd78d('0x1d')]);_0xdfa9e9[_0xd78d('0x1c')]=qs[_0xd78d('0x1c')](_0x561aca['query'][_0xd78d('0x1c')]);}_0xdfa9e9['order']=qs[_0xd78d('0x35')](_0x561aca[_0xd78d('0x2c')]['sort']);_0xdfa9e9['where']=qs[_0xd78d('0x2d')](_[_0xd78d('0x37')](_0x561aca[_0xd78d('0x2c')],_0x5de754[_0xd78d('0x2d')]));if(_0x561aca[_0xd78d('0x2c')][_0xd78d('0x38')]){_0xdfa9e9['where']=_['merge'](_0xdfa9e9[_0xd78d('0x36')],{'$or':_['map'](_0xba4e95,function(_0x4610ec){if(_0x4610ec['type'][_0xd78d('0x3a')]!==_0xd78d('0x3b')){var _0x297300={};_0x297300[_0x4610ec[_0xd78d('0x3c')]]={'$like':'%'+_0x561aca['query'][_0xd78d('0x38')]+'%'};return _0x297300;}})});}var _0x4df8aa=[];if(_0x1a6381){var _0x56544d=_['find'](_0x47b8d2,['name',_0x1a6381[_0xd78d('0x27')]]);if(_0x56544d[_0xd78d('0x3c')]){var _0x3e8c01={};if(_0x358602[_0xd78d('0x66')]===_0xd78d('0x6d')){_0x3e8c01[_0x56544d['foreignKey']]=_[_0xd78d('0x54')](_0x1a6381[_0xd78d('0x6e')],'id');}else{_0x3e8c01[_0x56544d[_0xd78d('0x6f')]]=_0x1a6381[_0xd78d('0x6e')];}_0x4df8aa[_0xd78d('0x5b')](_0x3e8c01);}else{_0xdfa9e9[_0xd78d('0x36')]['id']=_0x1a6381[_0xd78d('0x6e')];}}else{for(var _0x52ec04=0x0;_0x52ec04<_0x2be6f5['length'];_0x52ec04++){var _0x56544d=_[_0xd78d('0x46')](_0x47b8d2,[_0xd78d('0x27'),_0x2be6f5[_0x52ec04][_0xd78d('0x27')]]);if(_0x56544d['field']){var _0x3e8c01={};_0x3e8c01[_0x56544d[_0xd78d('0x6f')]]=_0x2be6f5[_0x52ec04]['associatedResources'];_0x4df8aa[_0xd78d('0x5b')](_0x3e8c01);}else{if(!_0xdfa9e9[_0xd78d('0x36')]['id'])_0xdfa9e9[_0xd78d('0x36')]['id']=[];_0x2be6f5[_0x52ec04][_0xd78d('0x6e')]['forEach'](function(_0x6840aa){_0xdfa9e9[_0xd78d('0x36')]['id']['push'](_0x6840aa);});}}}if(!_[_0xd78d('0x67')](_0x4df8aa)){_0xdfa9e9[_0xd78d('0x36')]=_[_0xd78d('0x39')](_0xdfa9e9[_0xd78d('0x36')],{'$and':{'$or':_0x4df8aa}});}_0xdfa9e9=_[_0xd78d('0x39')]({},_0xdfa9e9,_0x561aca[_0xd78d('0x3d')]);if(_0x1a6381&&!_0x1a6381[_0xd78d('0x52')]&&_0x358602[_0xd78d('0x66')]===_0xd78d('0x6d')){if(_0x561aca[_0xd78d('0x2c')][_0xd78d('0x3e')]){_0xdfa9e9[_0xd78d('0x3f')]=[{'all':!![]}];}return db[_0x358602[_0xd78d('0x66')]][_0xd78d('0x40')](_0xdfa9e9)['then'](function(_0x5e453f){var _0x2cc283=[];_0x5e453f[_0xd78d('0x70')](function(_0x2ca81b){var _0xff742c;switch(_0x2ca81b[_0xd78d('0x71')]){case _0xd78d('0x72'):_0xff742c=_[_0xd78d('0x46')](_0x1a6381['associatedResources'],function(_0x1cb515){return _0x1cb515['id']===_0x2ca81b['reportId']&&_0x1cb515[_0xd78d('0x73')]===_0xd78d('0x74');});break;case _0xd78d('0x75'):_0xff742c=_[_0xd78d('0x46')](_0x1a6381[_0xd78d('0x6e')],function(_0x1b33d5){return _0x1b33d5['id']===_0x2ca81b[_0xd78d('0x76')]&&_0x1b33d5['type']===_0xd78d('0x77');});break;}if(_0xff742c)_0x2cc283['push'](_0x2ca81b);});_0x3d4351[_0xd78d('0x1b')]=_0x2cc283[_0xd78d('0x31')];_0x3d4351['rows']=_0x2cc283;return _0x3d4351;});}else{return db[_0x358602[_0xd78d('0x66')]]['count']({'where':_0xdfa9e9['where']})[_0xd78d('0x23')](function(_0x2881ac){_0x3d4351[_0xd78d('0x1b')]=_0x2881ac;if(_0x561aca['query'][_0xd78d('0x3e')]){if(_0x358602['childModel']===_0xd78d('0x78')){_0xdfa9e9['include']=[{'model':db['Tag'],'as':_0xd78d('0x79'),'attributes':['id',_0xd78d('0x27'),_0xd78d('0x7a')],'required':_0x561aca[_0xd78d('0x2c')][_0xd78d('0x7b')]?!![]:![]},{'model':db[_0xd78d('0x7c')],'as':_0xd78d('0x7d'),'attributes':['id',_0xd78d('0x27'),_0xd78d('0x7a')],'through':_0x561aca[_0xd78d('0x2c')][_0xd78d('0x7b')]?{'attributes':[],'where':{'TagId':_0x561aca[_0xd78d('0x2c')][_0xd78d('0x7b')]||undefined}}:{},'required':_0x561aca[_0xd78d('0x2c')]['tag']?!![]:![]}];}else{_0xdfa9e9[_0xd78d('0x3f')]=[{'all':!![]}];}}return db[_0x358602[_0xd78d('0x66')]][_0xd78d('0x40')](_0xdfa9e9);})[_0xd78d('0x23')](function(_0x5da79b){_0x3d4351[_0xd78d('0x41')]=_0x5da79b;return _0x3d4351;});}}else{return _0x3d4351;}})[_0xd78d('0x23')](respondWithFilteredResult(_0x3337f1,_0xdfa9e9))[_0xd78d('0x42')](handleError(_0x3337f1,null));};function getAllResources(_0x16df4b,_0x53ea7f){return new BPromise(function(_0x4e751f,_0x18d3b4){if(_0x53ea7f){var _0x1eb915=_0x53ea7f['filter']?{[_0x53ea7f[_0xd78d('0x38')][_0xd78d('0x3c')]]:_0x53ea7f[_0xd78d('0x38')][_0xd78d('0x7e')]}:undefined;return db[_0x16df4b][_0xd78d('0x40')]({'where':_0x1eb915,'raw':!![]})[_0xd78d('0x23')](function(_0x630119){_0x53ea7f['associatedResources']=_['map'](_0x630119,'id');_0x4e751f(_0x53ea7f);})[_0xd78d('0x42')](function(_0x4e0308){_0x18d3b4(_0x4e0308);});}else{_0x4e751f(null);}});}function getAllFilteredResources(_0x1894b8,_0x399e47){return new BPromise(function(_0x7b24e7,_0x532ca){var _0x1b0c45=_0x1894b8[_0xd78d('0x38')]?{[_0x1894b8['filter'][_0xd78d('0x3c')]]:_0x1894b8[_0xd78d('0x38')]['value']}:undefined;return db[_0x1894b8[_0xd78d('0x2f')]][_0xd78d('0x40')]({'where':_0x1b0c45,'raw':!![]})[_0xd78d('0x23')](function(_0xf9f161){_0x399e47[_0xd78d('0x6e')]=_[_0xd78d('0x54')](_0xf9f161,function(_0x1d7125){return _0x1d7125['name'];});_0x7b24e7(_0x399e47);})[_0xd78d('0x42')](function(_0x2b94ab){_0x532ca(_0x2b94ab);});});}function getAllowedResources(_0x42202f,_0x1cbb9e,_0x1a22be){return new BPromise(function(_0x8f5b2e,_0x2bb236){if(_0x1cbb9e){return db['UserProfileResource'][_0xd78d('0x40')]({'where':{'sectionId':_0x1cbb9e['id']},'raw':!![]})[_0xd78d('0x23')](function(_0x11a5f2){if(_0x42202f['field']&&_0x42202f[_0xd78d('0x3c')]!=='id'){_0x1cbb9e[_0xd78d('0x6e')]=_[_0xd78d('0x54')](_0x11a5f2,function(_0x21c160){return _0x21c160[_0x42202f['field']];});}else{if(_0x1a22be===_0xd78d('0x6d')){_0x1cbb9e['associatedResources']=_[_0xd78d('0x54')](_0x11a5f2,function(_0x4027a9){return{'id':_0x4027a9['resourceId'],'type':_0x4027a9[_0xd78d('0x73')]};});}else{_0x1cbb9e['associatedResources']=_[_0xd78d('0x54')](_0x11a5f2,function(_0x113645){return _0x113645[_0xd78d('0x7f')];});}}_0x8f5b2e(_0x1cbb9e);})['catch'](function(_0x207422){_0x2bb236(_0x207422);});}else{_0x8f5b2e(null);}});}function getQueryModels(_0xbfc36a,_0x33f126){var _0x28c138=_0xbfc36a[_0xd78d('0x80')]();var _0x205528={'childModel':undefined,'parentSections':[]};switch(_0x28c138){case'squareprojects':_0x205528[_0xd78d('0x66')]=_0xd78d('0x81');break;case _0xd78d('0x82'):_0x205528[_0xd78d('0x66')]='SquareOdbc';break;case _0xd78d('0x83'):_0x205528[_0xd78d('0x66')]='SquareRecording';_0x205528[_0xd78d('0x68')]=[{'name':_0xd78d('0x84'),'field':_0xd78d('0x27'),'foreignKey':'projectName'}];break;case _0xd78d('0x85'):_0x205528['childModel']='JscriptyProject';break;case _0xd78d('0x86'):_0x205528[_0xd78d('0x66')]=_0xd78d('0x78');_0x205528[_0xd78d('0x68')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xd78d('0x87'):_0x205528[_0xd78d('0x66')]='CmList';break;case'companies':_0x205528['childModel']='CmCompany';break;case _0xd78d('0x88'):_0x205528['childModel']=_0xd78d('0x89');break;case _0xd78d('0x8a'):_0x205528[_0xd78d('0x66')]=_0xd78d('0x8b');break;case _0xd78d('0x8c'):_0x205528[_0xd78d('0x66')]=_0xd78d('0x8d');break;case _0xd78d('0x8e'):_0x205528[_0xd78d('0x66')]=_0xd78d('0x8f');break;case _0xd78d('0x90'):_0x205528[_0xd78d('0x66')]='FaxAccount';break;case _0xd78d('0x91'):case _0xd78d('0x92'):case'outboundroutes':_0x205528['childModel']=_0xd78d('0x93');break;case'contexts':_0x205528['childModel']=_0xd78d('0x94');break;case _0xd78d('0x95'):_0x205528[_0xd78d('0x66')]=_0xd78d('0x96');break;case _0xd78d('0x97'):_0x205528[_0xd78d('0x66')]='VoiceRecording';_0x205528['parentSections']=[{'name':'Agents','field':_0xd78d('0x27'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xd78d('0x98')]}},{'name':'Telephones','field':_0xd78d('0x27'),'foreignKey':'membername','model':'User','filter':{'field':_0xd78d('0x99'),'value':[_0xd78d('0x9a')]}},{'name':_0xd78d('0x9b'),'field':_0xd78d('0x27'),'foreignKey':_0xd78d('0x9c'),'model':'VoiceQueue','filter':{'field':_0xd78d('0x73'),'value':[_0xd78d('0x9d')]}},{'name':_0xd78d('0x9e'),'field':'name','foreignKey':_0xd78d('0x9c'),'model':_0xd78d('0x9f'),'filter':{'field':_0xd78d('0x73'),'value':[_0xd78d('0xa0')]}}];break;case _0xd78d('0xa1'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xa2');break;case _0xd78d('0xa3'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xa4');break;case'voiceprefixes':_0x205528['childModel']=_0xd78d('0xa5');break;case _0xd78d('0xa6'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xa7');break;case _0xd78d('0xa8'):_0x205528['childModel']='MailQueue';break;case _0xd78d('0xa9'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xaa');break;case _0xd78d('0xab'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xac');break;case'openchannelqueues':_0x205528[_0xd78d('0x66')]=_0xd78d('0xad');break;case _0xd78d('0xae'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xaf');break;case _0xd78d('0xb0'):_0x205528['childModel']='SmsQueue';break;case _0xd78d('0xb1'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xb2');break;case _0xd78d('0xb3'):_0x205528[_0xd78d('0x66')]='Team';break;case _0xd78d('0xb4'):case _0xd78d('0xb5'):_0x205528['childModel']=_0xd78d('0x9f');if(_0x33f126){_0x205528[_0xd78d('0x68')]=[{'name':_0xd78d('0x9b')},{'name':_0xd78d('0x9e')}];}break;case _0xd78d('0xb6'):case _0xd78d('0xb7'):case'telephones':_0x205528['childModel']=_0xd78d('0xb8');if(_0x33f126){_0x205528[_0xd78d('0x68')]=[{'name':_0xd78d('0xb9'),'filter':{'field':'role','value':[_0xd78d('0xba'),'user']},'ignore':!![]},{'name':_0xd78d('0xbb')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x205528['childModel']=_0xd78d('0xbc');break;case _0xd78d('0xbd'):_0x205528[_0xd78d('0x66')]='SalesforceAccount';break;case _0xd78d('0xbe'):_0x205528[_0xd78d('0x66')]='FreshdeskAccount';break;case _0xd78d('0xbf'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xc0');break;case _0xd78d('0xc1'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xc2');break;case'zohoaccounts':_0x205528[_0xd78d('0x66')]='ZohoAccount';break;case _0xd78d('0xc3'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xb8');break;case _0xd78d('0xc4'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xc5');break;case'dispositions':_0x205528[_0xd78d('0x66')]=_0xd78d('0xc6');break;case _0xd78d('0xc7'):_0x205528['childModel']='Dashboard';break;case _0xd78d('0xc8'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xc9');break;case _0xd78d('0xca'):_0x205528['childModel']=_0xd78d('0xcb');break;case _0xd78d('0xcc'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xcd');break;case _0xd78d('0xce'):_0x205528[_0xd78d('0x66')]='Sound';break;case _0xd78d('0xcf'):_0x205528[_0xd78d('0x66')]='Tag';break;case _0xd78d('0xd0'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xd1');break;case _0xd78d('0xd2'):_0x205528['childModel']=_0xd78d('0xd3');break;case _0xd78d('0xd4'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xd5');break;case _0xd78d('0xd6'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xd7');break;case'plugins':_0x205528['childModel']=_0xd78d('0xd8');break;case _0xd78d('0xd9'):_0x205528['childModel']='AnalyticExtractedReport';_0x205528['parentSections']=[{'name':_0xd78d('0xda'),'field':'id','foreignKey':'reportId'}];break;case _0xd78d('0xdb'):_0x205528[_0xd78d('0x66')]=_0xd78d('0xdc');break;default:return _0x205528;}return _0x205528;} \ No newline at end of file +var _0x8a0a=['resourceId','toLowerCase','squareprojects','odbc','squarerecordings','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','role','agent','Telephones','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','Sound','tags','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','count','offset','limit','apply','reject','save','destroy','then','error','stack','name','index','UserProfile','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','show','params','length','includeAll','merge','find','create','body','catch','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','Resources','UserProfileSection','describe','addSections','sectionId','push','ids','addResources','bulkCreate','userProfileId','removeResources','section','undefined','Sequelize','ValidationError','mergeResources','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','childModel','pick','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','custom','CmContact','Tag','Tags','color','tag','ThroughTags'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8a0a,0x150));var _0xa8a0=function(_0x44f545,_0x4d20dc){_0x44f545=_0x44f545-0x0;var _0x5429b2=_0x8a0a[_0x44f545];return _0x5429b2;};'use strict';var pdf=require(_0xa8a0('0x0'));var emlformat=require(_0xa8a0('0x1'));var rimraf=require(_0xa8a0('0x2'));var zipdir=require(_0xa8a0('0x3'));var jsonpatch=require(_0xa8a0('0x4'));var rp=require(_0xa8a0('0x5'));var moment=require(_0xa8a0('0x6'));var BPromise=require(_0xa8a0('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa8a0('0x8'));var csv=require(_0xa8a0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa8a0('0xa'));var squel=require(_0xa8a0('0xb'));var crypto=require(_0xa8a0('0xc'));var jsforce=require(_0xa8a0('0xd'));var deskjs=require(_0xa8a0('0xe'));var toCsv=require(_0xa8a0('0x9'));var querystring=require(_0xa8a0('0xf'));var Papa=require('papaparse');var Redis=require(_0xa8a0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa8a0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a0('0x12'))(_0xa8a0('0x13'));var utils=require(_0xa8a0('0x14'));var config=require(_0xa8a0('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa8a0('0x16')](config[_0xa8a0('0x17')],{'host':_0xa8a0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa8a0('0x19'))[_0xa8a0('0x1a')](socket);function respondWithStatusCode(_0x8353dc,_0x16e9e2){_0x16e9e2=_0x16e9e2||0xcc;return function(_0x266768){if(_0x266768){return _0x8353dc[_0xa8a0('0x1b')](_0x16e9e2);}return _0x8353dc[_0xa8a0('0x1c')](_0x16e9e2)[_0xa8a0('0x1d')]();};}function respondWithResult(_0x80edcd,_0x205b2f){_0x205b2f=_0x205b2f||0xc8;return function(_0x4ebd6c){if(_0x4ebd6c){return _0x80edcd[_0xa8a0('0x1c')](_0x205b2f)[_0xa8a0('0x1e')](_0x4ebd6c);}};}function respondWithFilteredResult(_0x38f3c7,_0x4af762){return function(_0x32cb0a){if(_0x32cb0a){var _0x1db900=_0x32cb0a[_0xa8a0('0x1f')],_0x135b19=_0x4af762[_0xa8a0('0x20')],_0x25ae3a=_0x4af762[_0xa8a0('0x20')]+_0x4af762[_0xa8a0('0x21')],_0x4662ae;if(_0x25ae3a>=_0x1db900){_0x25ae3a=_0x1db900;_0x4662ae=0xc8;}else{_0x4662ae=0xce;}_0x38f3c7[_0xa8a0('0x1c')](_0x4662ae);return _0x38f3c7['set']('Content-Range',_0x135b19+'-'+_0x25ae3a+'/'+_0x1db900)['json'](_0x32cb0a);}return null;};}function patchUpdates(_0x75c368){return function(_0x2a2390){try{jsonpatch[_0xa8a0('0x22')](_0x2a2390,_0x75c368,!![]);}catch(_0x44ceeb){return BPromise[_0xa8a0('0x23')](_0x44ceeb);}return _0x2a2390[_0xa8a0('0x24')]();};}function saveUpdates(_0x12c6f0,_0x3811ec){return function(_0xd6678d){if(_0xd6678d){return _0xd6678d['update'](_0x12c6f0)['then'](function(_0x148de7){return _0x148de7;});}return null;};}function removeEntity(_0xe7ae05,_0x2e464a){return function(_0xe040bb){if(_0xe040bb){return _0xe040bb[_0xa8a0('0x25')]()[_0xa8a0('0x26')](function(){_0xe7ae05['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7fb5,_0x16f9e7){return function(_0x58ff8c){if(!_0x58ff8c){_0x3e7fb5[_0xa8a0('0x1b')](0x194);}return _0x58ff8c;};}function handleError(_0x409b4c,_0x3e4542){_0x3e4542=_0x3e4542||0x1f4;return function(_0x4650b0){logger[_0xa8a0('0x27')](_0x4650b0[_0xa8a0('0x28')]);if(_0x4650b0[_0xa8a0('0x29')]){delete _0x4650b0[_0xa8a0('0x29')];}_0x409b4c['status'](_0x3e4542)['send'](_0x4650b0);};}exports[_0xa8a0('0x2a')]=function(_0x2cb4a9,_0x4683d6){var _0x1851b9={},_0x543327={},_0xa0c1d9={'count':0x0,'rows':[]};var _0x5c85ff=db[_0xa8a0('0x2b')][_0xa8a0('0x2c')];_0x543327['model']=_[_0xa8a0('0x2d')](_0x5c85ff);_0x543327[_0xa8a0('0x2e')]=_['keys'](_0x2cb4a9[_0xa8a0('0x2e')]);_0x543327[_0xa8a0('0x2f')]=_[_0xa8a0('0x30')](_0x543327['model'],_0x543327[_0xa8a0('0x2e')]);_0x1851b9['attributes']=_[_0xa8a0('0x30')](_0x543327[_0xa8a0('0x31')],qs[_0xa8a0('0x32')](_0x2cb4a9['query'][_0xa8a0('0x32')]));_0x1851b9[_0xa8a0('0x33')]=_0x1851b9[_0xa8a0('0x33')]['length']?_0x1851b9[_0xa8a0('0x33')]:_0x543327[_0xa8a0('0x31')];if(!_0x2cb4a9[_0xa8a0('0x2e')][_0xa8a0('0x34')](_0xa8a0('0x35'))){_0x1851b9[_0xa8a0('0x21')]=qs[_0xa8a0('0x21')](_0x2cb4a9[_0xa8a0('0x2e')]['limit']);_0x1851b9[_0xa8a0('0x20')]=qs['offset'](_0x2cb4a9[_0xa8a0('0x2e')][_0xa8a0('0x20')]);}_0x1851b9[_0xa8a0('0x36')]=qs[_0xa8a0('0x37')](_0x2cb4a9[_0xa8a0('0x2e')][_0xa8a0('0x37')]);_0x1851b9[_0xa8a0('0x38')]=qs[_0xa8a0('0x2f')](_['pick'](_0x2cb4a9['query'],_0x543327[_0xa8a0('0x2f')]));if(_0x2cb4a9[_0xa8a0('0x2e')]['filter']){_0x1851b9[_0xa8a0('0x38')]=_['merge'](_0x1851b9[_0xa8a0('0x38')],{'$or':_[_0xa8a0('0x39')](_0x5c85ff,function(_0x2882fa){if(_0x2882fa[_0xa8a0('0x3a')][_0xa8a0('0x3b')]!==_0xa8a0('0x3c')){var _0x231cab={};_0x231cab[_0x2882fa[_0xa8a0('0x3d')]]={'$like':'%'+_0x2cb4a9[_0xa8a0('0x2e')][_0xa8a0('0x3e')]+'%'};return _0x231cab;}})});}_0x1851b9=_['merge']({},_0x1851b9,_0x2cb4a9[_0xa8a0('0x3f')]);var _0x57bb65={'where':_0x1851b9[_0xa8a0('0x38')]};return db[_0xa8a0('0x2b')][_0xa8a0('0x1f')](_0x57bb65)['then'](function(_0x10ca2d){_0xa0c1d9[_0xa8a0('0x1f')]=_0x10ca2d;if(_0x2cb4a9['query']['includeAll']){_0x1851b9[_0xa8a0('0x40')]=[{'all':!![]}];}return db[_0xa8a0('0x2b')][_0xa8a0('0x41')](_0x1851b9);})['then'](function(_0x1e53f2){_0xa0c1d9[_0xa8a0('0x42')]=_0x1e53f2;return _0xa0c1d9;})[_0xa8a0('0x26')](respondWithFilteredResult(_0x4683d6,_0x1851b9))['catch'](handleError(_0x4683d6,null));};exports[_0xa8a0('0x43')]=function(_0x46e546,_0x186f8e){var _0x36fb15={'raw':![],'where':{'id':_0x46e546[_0xa8a0('0x44')]['id']}},_0x406f67={};_0x406f67['model']=_['keys'](db[_0xa8a0('0x2b')]['rawAttributes']);_0x406f67[_0xa8a0('0x2e')]=_[_0xa8a0('0x2d')](_0x46e546[_0xa8a0('0x2e')]);_0x406f67[_0xa8a0('0x2f')]=_[_0xa8a0('0x30')](_0x406f67['model'],_0x406f67[_0xa8a0('0x2e')]);_0x36fb15[_0xa8a0('0x33')]=_[_0xa8a0('0x30')](_0x406f67[_0xa8a0('0x31')],qs[_0xa8a0('0x32')](_0x46e546[_0xa8a0('0x2e')][_0xa8a0('0x32')]));_0x36fb15[_0xa8a0('0x33')]=_0x36fb15[_0xa8a0('0x33')][_0xa8a0('0x45')]?_0x36fb15[_0xa8a0('0x33')]:_0x406f67[_0xa8a0('0x31')];if(_0x46e546[_0xa8a0('0x2e')][_0xa8a0('0x46')]){_0x36fb15[_0xa8a0('0x40')]=[{'all':!![]}];}_0x36fb15=_[_0xa8a0('0x47')]({},_0x36fb15,_0x46e546[_0xa8a0('0x3f')]);return db['UserProfile'][_0xa8a0('0x48')](_0x36fb15)['then'](handleEntityNotFound(_0x186f8e,null))[_0xa8a0('0x26')](respondWithResult(_0x186f8e,null))['catch'](handleError(_0x186f8e,null));};exports[_0xa8a0('0x49')]=function(_0x487c72,_0x5eea60){return db['UserProfile']['create'](_0x487c72[_0xa8a0('0x4a')],{})[_0xa8a0('0x26')](respondWithResult(_0x5eea60,0xc9))[_0xa8a0('0x4b')](handleError(_0x5eea60,null));};exports[_0xa8a0('0x4c')]=function(_0x590c41,_0x30056a){var _0x2354dc={'raw':![],'where':{'id':_0x590c41[_0xa8a0('0x44')]['id']}},_0x150cdb={};_0x150cdb[_0xa8a0('0x31')]=_[_0xa8a0('0x2d')](db[_0xa8a0('0x2b')][_0xa8a0('0x2c')]);_0x2354dc[_0xa8a0('0x33')]=_['intersection'](_0x150cdb[_0xa8a0('0x31')],qs[_0xa8a0('0x32')](_0x590c41[_0xa8a0('0x2e')][_0xa8a0('0x32')]));_0x2354dc[_0xa8a0('0x33')]=_0x2354dc[_0xa8a0('0x33')][_0xa8a0('0x45')]?_0x2354dc[_0xa8a0('0x33')]:_0x150cdb[_0xa8a0('0x31')];if(_0x590c41[_0xa8a0('0x2e')][_0xa8a0('0x46')]){_0x2354dc[_0xa8a0('0x40')]=[{'all':!![]}];}_0x2354dc=_[_0xa8a0('0x47')]({},_0x2354dc,_0x590c41[_0xa8a0('0x3f')]);return db[_0xa8a0('0x2b')]['find'](_0x2354dc)[_0xa8a0('0x26')](handleEntityNotFound(_0x30056a,null))[_0xa8a0('0x26')](function(_0x5205cf){if(_0x5205cf){var _0xa9cd9a=_0x5205cf[_0xa8a0('0x4d')]({'plain':!![]});_0xa9cd9a=qs[_0xa8a0('0x4e')](_0xa9cd9a,['id',_0xa8a0('0x4f'),_0xa8a0('0x50'),_0xa8a0('0x51')]);_0x590c41[_0xa8a0('0x4a')]=_[_0xa8a0('0x4e')](_0x590c41[_0xa8a0('0x4a')],['id',_0xa8a0('0x4f'),'updatedAt']);return db[_0xa8a0('0x52')][_0xa8a0('0x53')](function(_0x5d502f){return db[_0xa8a0('0x2b')][_0xa8a0('0x49')](_['merge'](_0xa9cd9a,_0x590c41['body']),{'include':_0x590c41['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5d502f})[_0xa8a0('0x26')](function(_0x3bd9e9){var _0x59a34d=_0x3bd9e9['get']({'plain':!![]});return db['UserProfileSection'][_0xa8a0('0x41')]({'where':{'userProfileId':_0x590c41[_0xa8a0('0x44')]['id']},'raw':!![]})[_0xa8a0('0x26')](function(_0x1b8802){if(_0x1b8802){return BPromise[_0xa8a0('0x54')](_0x1b8802,function(_0x3c4498){return new BPromise(function(_0x3b8e08,_0x52241a){if(_0x3c4498[_0xa8a0('0x55')]===null||_0x3c4498[_0xa8a0('0x55')]===0x1)_0x3b8e08(null);return db[_0xa8a0('0x56')][_0xa8a0('0x41')]({'where':{'sectionId':_0x3c4498['id']},'raw':!![]})[_0xa8a0('0x26')](function(_0x46e600){var _0x4f9159=_['map'](_0x46e600,function(_0x11d8f4){return qs[_0xa8a0('0x4e')](_0x11d8f4,['id',_0xa8a0('0x4f'),'updatedAt','sectionId']);});_0x3b8e08(_0x4f9159);})[_0xa8a0('0x4b')](function(_0x1bc9e9){_0x52241a(_0x1bc9e9);});})[_0xa8a0('0x26')](function(_0x16eece){var _0x17e45a=qs[_0xa8a0('0x4e')](_0x3c4498,['id',_0xa8a0('0x4f'),'updatedAt']);_0x17e45a['userProfileId']=_0x59a34d['id'];if(_0x16eece)_0x17e45a[_0xa8a0('0x57')]=_0x16eece;return _0x17e45a;})['then'](function(_0x10c203){return db[_0xa8a0('0x58')]['create'](_0x10c203,{'include':[{'model':db[_0xa8a0('0x56')],'as':_0xa8a0('0x57')}],'raw':!![],'transaction':_0x5d502f});});})['then'](function(){return _0x59a34d;});}});});});}})['then'](respondWithResult(_0x30056a,0xc9))[_0xa8a0('0x4b')](handleError(_0x30056a,null));};exports['update']=function(_0x3c9ac5,_0xb83969){if(_0x3c9ac5[_0xa8a0('0x4a')]['id']){delete _0x3c9ac5[_0xa8a0('0x4a')]['id'];}return db[_0xa8a0('0x2b')][_0xa8a0('0x48')]({'where':{'id':_0x3c9ac5[_0xa8a0('0x44')]['id']}})[_0xa8a0('0x26')](handleEntityNotFound(_0xb83969,null))[_0xa8a0('0x26')](saveUpdates(_0x3c9ac5[_0xa8a0('0x4a')],null))['then'](respondWithResult(_0xb83969,null))[_0xa8a0('0x4b')](handleError(_0xb83969,null));};exports[_0xa8a0('0x25')]=function(_0x513288,_0x11d01f){return db[_0xa8a0('0x2b')]['find']({'where':{'id':_0x513288[_0xa8a0('0x44')]['id']}})['then'](handleEntityNotFound(_0x11d01f,null))[_0xa8a0('0x26')](removeEntity(_0x11d01f,null))[_0xa8a0('0x4b')](handleError(_0x11d01f,null));};exports[_0xa8a0('0x59')]=function(_0x4e7dd1,_0x4b1686){return db[_0xa8a0('0x2b')]['describe']()['then'](respondWithResult(_0x4b1686,null))[_0xa8a0('0x4b')](handleError(_0x4b1686,null));};exports[_0xa8a0('0x5a')]=function(_0x415a09,_0x2d5fb6){var _0x11ccde=_0x415a09['body'];return db['UserProfile'][_0xa8a0('0x48')]({'where':{'id':_0x415a09[_0xa8a0('0x44')]['id']}})[_0xa8a0('0x26')](handleEntityNotFound(_0x2d5fb6,null))[_0xa8a0('0x26')](function(_0x1e8419){if(_0x1e8419){return db[_0xa8a0('0x52')]['transaction'](function(_0x68765){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x415a09[_0xa8a0('0x44')]['id'],'sectionId':_[_0xa8a0('0x39')](_0x11ccde,function(_0x2820b8){return _0x2820b8[_0xa8a0('0x5b')];})},'transaction':_0x68765})[_0xa8a0('0x26')](function(){var _0x23b09a=_[_0xa8a0('0x39')](_0x11ccde,function(_0x1db242){_0x1db242['userProfileId']=_0x415a09[_0xa8a0('0x44')]['id'];return _0x1db242;});var _0x55c1b4=[];return BPromise[_0xa8a0('0x54')](_0x23b09a,function(_0x3cdfd){return db['UserProfileSection'][_0xa8a0('0x49')](_0x3cdfd,{'include':[{'model':db[_0xa8a0('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x68765})[_0xa8a0('0x26')](function(_0x329124){_0x55c1b4[_0xa8a0('0x5c')](_0x329124[_0xa8a0('0x4d')]({'plain':!![]}));});})[_0xa8a0('0x26')](function(){return _0x55c1b4;});});});}})[_0xa8a0('0x26')](function(_0x3f6af1){return _0x3f6af1;})[_0xa8a0('0x26')](respondWithResult(_0x2d5fb6,null))[_0xa8a0('0x4b')](handleError(_0x2d5fb6,null));};exports['removeSections']=function(_0x4088c5,_0x24db15){var _0x3e948a;return db[_0xa8a0('0x2b')]['find']({'where':{'id':_0x4088c5['params']['id']},'attributes':['id',_0xa8a0('0x29')]})['then'](handleEntityNotFound(_0x24db15,null))[_0xa8a0('0x26')](function(_0x387ef6){if(_0x387ef6){_0x3e948a=_0x387ef6;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4088c5[_0xa8a0('0x44')]['id'],'sectionId':_0x4088c5[_0xa8a0('0x2e')][_0xa8a0('0x5d')]}});}})[_0xa8a0('0x26')](function(){return _0x3e948a;})['then'](respondWithStatusCode(_0x24db15,null))[_0xa8a0('0x4b')](handleError(_0x24db15,null));};exports[_0xa8a0('0x5e')]=function(_0x5a7b49,_0x2b2f85){return db[_0xa8a0('0x2b')][_0xa8a0('0x48')]({'where':{'id':_0x5a7b49[_0xa8a0('0x44')]['id']}})[_0xa8a0('0x26')](handleEntityNotFound(_0x2b2f85,null))[_0xa8a0('0x26')](function(_0x4217a1){if(_0x4217a1){return db[_0xa8a0('0x52')][_0xa8a0('0x53')](function(_0x3bb25b){return db[_0xa8a0('0x58')]['findAll']({'where':{'userProfileId':_0x5a7b49[_0xa8a0('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0xa8a0('0x26')](function(_0x1d7492){if(_0x1d7492){return db[_0xa8a0('0x58')][_0xa8a0('0x25')]({'where':{'userProfileId':_0x5a7b49[_0xa8a0('0x44')]['id'],'id':_[_0xa8a0('0x39')](_0x1d7492,function(_0xf9f112){return _0xf9f112['id'];})},'transaction':_0x3bb25b});}})[_0xa8a0('0x26')](function(_0x2e78ab){var _0x3fb77f=_[_0xa8a0('0x39')](_0x5a7b49[_0xa8a0('0x4a')],function(_0x54fa57){_0x54fa57['userProfileId']=_0x5a7b49['params']['id'];return _0x54fa57;});return db['UserProfileSection'][_0xa8a0('0x5f')](_0x3fb77f,{'raw':!![],'transaction':_0x3bb25b});})[_0xa8a0('0x26')](function(_0xd18bfe){var _0x1103af=_[_0xa8a0('0x3e')](_[_0xa8a0('0x39')](_0xd18bfe,function(_0x3cdd50){return _0x3cdd50['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1103af){return db[_0xa8a0('0x58')][_0xa8a0('0x41')]({'where':{'userProfileId':_0x5a7b49[_0xa8a0('0x44')]['id'],'sectionId':_[_0xa8a0('0x39')](_0x1103af,function(_0x3e0a43){return _0x3e0a43[_0xa8a0('0x5b')];})},'attributes':['id',_0xa8a0('0x5b')],'raw':!![]})[_0xa8a0('0x26')](function(_0x2417dd){var _0x4b4e1d=_['map'](_0x5a7b49[_0xa8a0('0x4a')],function(_0x5cb272){_0x5cb272[_0xa8a0('0x60')]=_0x5a7b49[_0xa8a0('0x44')]['id'];return _0x5cb272;});return db[_0xa8a0('0x56')][_0xa8a0('0x5f')](_0x4b4e1d,{'raw':!![],'transaction':_0x3bb25b});});}})[_0xa8a0('0x4b')](handleError(_0x2b2f85,null));});}})[_0xa8a0('0x26')](function(_0x36035f){var _0x22aef9=_['map'](_0x36035f,function(_0x4c041d){return _0x4c041d['get']({'plain':!![]});});})[_0xa8a0('0x26')](respondWithResult(_0x2b2f85,null))[_0xa8a0('0x4b')](handleError(_0x2b2f85,null));};exports[_0xa8a0('0x61')]=function(_0x34697a,_0x293de6,_0x428500){return db[_0xa8a0('0x2b')]['find']({'where':{'id':_0x34697a['params']['id']}})['then'](handleEntityNotFound(_0x293de6,null))[_0xa8a0('0x26')](function(_0x37422c){if(_0x37422c){return _0x37422c[_0xa8a0('0x61')](_0x34697a['query'][_0xa8a0('0x5d')]);}})[_0xa8a0('0x26')](respondWithStatusCode(_0x293de6,null))['catch'](handleError(_0x293de6,null));};exports['getResources']=function(_0x25ff11,_0x191717){var _0x370db9={'raw':![],'where':{}};var _0x1682e5={};var _0x36643b={'count':0x0,'rows':[]};var _0x37ffab=_0x25ff11['query'][_0xa8a0('0x62')];if(typeof _0x37ffab===_0xa8a0('0x63')){throw new db[(_0xa8a0('0x64'))][(_0xa8a0('0x65'))]('Unknown\x20section');}var _0x3511a1=_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x66')]||![];var _0x2a0660=getQueryModels(_0x37ffab,_0x3511a1);if(typeof _0x2a0660['childModel']==='undefined'){throw new db[(_0xa8a0('0x64'))][(_0xa8a0('0x65'))](_0xa8a0('0x67')+_0x37ffab+'\x27');}var _0x312256=[];if(!_[_0xa8a0('0x68')](_0x2a0660[_0xa8a0('0x69')])){_0x312256=_0x2a0660[_0xa8a0('0x69')];}else{_0x312256=[{'name':_0x37ffab}];}return db['UserProfile'][_0xa8a0('0x6a')]({'where':{'id':_0x25ff11[_0xa8a0('0x44')]['id']}})[_0xa8a0('0x26')](handleEntityNotFound(_0x191717,null))[_0xa8a0('0x26')](function(_0x42e564){if(_0x42e564){var _0x57aa8c=[];for(var _0x3fa682=0x0;_0x3fa682<_0x312256[_0xa8a0('0x45')];_0x3fa682++){_0x57aa8c[_0xa8a0('0x5c')](db[_0xa8a0('0x58')][_0xa8a0('0x6a')]({'where':{'userProfileId':_0x42e564['id'],'name':_0x312256[_0x3fa682][_0xa8a0('0x29')]},'raw':!![]}));}return BPromise[_0xa8a0('0x6b')](_0x57aa8c);}})[_0xa8a0('0x26')](function(_0x57eacd){var _0x3acf4c=_[_0xa8a0('0x3e')](_0x57eacd,function(_0x106ae9){return _0x106ae9?_0x106ae9:undefined;});var _0x60bd43=_[_0xa8a0('0x3e')](_0x312256,[_0xa8a0('0x6c'),!![]]);var _0x5d2e25=_[_0xa8a0('0x68')](_0x3acf4c)&&_['isEmpty'](_0x60bd43)?null:_['union'](_0x60bd43,_0x3acf4c);if(_0x5d2e25){var _0x254a16=[];for(var _0x38d3d4=0x0;_0x38d3d4<_0x5d2e25[_0xa8a0('0x45')];_0x38d3d4++){var _0x4bada8=_['find'](_0x312256,function(_0x527ff5){return _0x5d2e25[_0x38d3d4]?_0x527ff5[_0xa8a0('0x29')]===_0x5d2e25[_0x38d3d4][_0xa8a0('0x29')]:null;});if(_0x4bada8){if(_0x5d2e25[_0x38d3d4][_0xa8a0('0x6c')]){_0x254a16[_0xa8a0('0x5c')](getAllResources(_0x2a0660[_0xa8a0('0x6d')],_0x5d2e25[_0x38d3d4]));}else{if(!_0x5d2e25[_0x38d3d4][_0xa8a0('0x55')]){_0x254a16[_0xa8a0('0x5c')](getAllowedResources(_0x4bada8,_0x5d2e25[_0x38d3d4],_0x2a0660[_0xa8a0('0x6d')]));}else{if(_0x4bada8['model']){_0x254a16[_0xa8a0('0x5c')](getAllFilteredResources(_0x4bada8,_0x5d2e25[_0x38d3d4]));}}}}}return BPromise[_0xa8a0('0x6b')](_0x254a16);}else{return null;}})['then'](function(_0x579aee){var _0x42e01c=_0x579aee;var _0x5563f1=null;if(_0x42e01c){_0x5563f1=_0x42e01c[_0xa8a0('0x45')]===0x1?_0x42e01c[0x0]:null;}if(_0x5563f1||_0x42e01c){var _0x23532f=db[_0x2a0660[_0xa8a0('0x6d')]][_0xa8a0('0x2c')];_0x1682e5[_0xa8a0('0x31')]=_['keys'](_0x23532f);_0x1682e5[_0xa8a0('0x2e')]=_['keys'](_0x25ff11[_0xa8a0('0x2e')]);_0x1682e5[_0xa8a0('0x2f')]=_[_0xa8a0('0x30')](_0x1682e5['model'],_0x1682e5['query']);_0x370db9[_0xa8a0('0x33')]=_['intersection'](_0x1682e5['model'],qs[_0xa8a0('0x32')](_0x25ff11['query'][_0xa8a0('0x32')]));_0x370db9[_0xa8a0('0x33')]=_0x370db9[_0xa8a0('0x33')]['length']?_0x370db9['attributes']:_0x1682e5[_0xa8a0('0x31')];if(!_0x25ff11[_0xa8a0('0x2e')]['hasOwnProperty'](_0xa8a0('0x35'))){_0x370db9['limit']=qs[_0xa8a0('0x21')](_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x21')]);_0x370db9[_0xa8a0('0x20')]=qs[_0xa8a0('0x20')](_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x20')]);}_0x370db9[_0xa8a0('0x36')]=qs['sort'](_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x37')]);_0x370db9[_0xa8a0('0x38')]=qs['filters'](_[_0xa8a0('0x6e')](_0x25ff11['query'],_0x1682e5[_0xa8a0('0x2f')]));if(_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x3e')]){_0x370db9['where']=_[_0xa8a0('0x47')](_0x370db9[_0xa8a0('0x38')],{'$or':_['map'](_0x23532f,function(_0x53dff0){if(_0x53dff0[_0xa8a0('0x3a')]['key']!==_0xa8a0('0x3c')){var _0x22f548={};_0x22f548[_0x53dff0[_0xa8a0('0x3d')]]={'$like':'%'+_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x3e')]+'%'};return _0x22f548;}})});}var _0xea2ab4=[];if(_0x5563f1){var _0x4c2f04=_[_0xa8a0('0x48')](_0x312256,['name',_0x5563f1['name']]);if(_0x4c2f04[_0xa8a0('0x3d')]){var _0x157819={};if(_0x2a0660[_0xa8a0('0x6d')]===_0xa8a0('0x6f')){_0x157819[_0x4c2f04[_0xa8a0('0x70')]]=_[_0xa8a0('0x39')](_0x5563f1[_0xa8a0('0x71')],'id');}else{_0x157819[_0x4c2f04[_0xa8a0('0x70')]]=_0x5563f1[_0xa8a0('0x71')];}_0xea2ab4[_0xa8a0('0x5c')](_0x157819);}else{_0x370db9[_0xa8a0('0x38')]['id']=_0x5563f1[_0xa8a0('0x71')];}}else{for(var _0x312ed1=0x0;_0x312ed1<_0x42e01c[_0xa8a0('0x45')];_0x312ed1++){var _0x4c2f04=_['find'](_0x312256,[_0xa8a0('0x29'),_0x42e01c[_0x312ed1][_0xa8a0('0x29')]]);if(_0x4c2f04[_0xa8a0('0x3d')]){var _0x157819={};_0x157819[_0x4c2f04[_0xa8a0('0x70')]]=_0x42e01c[_0x312ed1][_0xa8a0('0x71')];_0xea2ab4[_0xa8a0('0x5c')](_0x157819);}else{if(!_0x370db9[_0xa8a0('0x38')]['id'])_0x370db9[_0xa8a0('0x38')]['id']=[];_0x42e01c[_0x312ed1]['associatedResources'][_0xa8a0('0x72')](function(_0x4f9a33){_0x370db9[_0xa8a0('0x38')]['id'][_0xa8a0('0x5c')](_0x4f9a33);});}}}if(!_['isEmpty'](_0xea2ab4)){_0x370db9[_0xa8a0('0x38')]=_['merge'](_0x370db9['where'],{'$and':{'$or':_0xea2ab4}});}_0x370db9=_[_0xa8a0('0x47')]({},_0x370db9,_0x25ff11['options']);if(_0x5563f1&&!_0x5563f1[_0xa8a0('0x55')]&&_0x2a0660[_0xa8a0('0x6d')]===_0xa8a0('0x6f')){if(_0x25ff11['query'][_0xa8a0('0x46')]){_0x370db9[_0xa8a0('0x40')]=[{'all':!![]}];}return db[_0x2a0660[_0xa8a0('0x6d')]][_0xa8a0('0x41')](_0x370db9)[_0xa8a0('0x26')](function(_0x470385){var _0x5f2d27=[];_0x470385[_0xa8a0('0x72')](function(_0x2d7633){var _0x5a5e00;switch(_0x2d7633[_0xa8a0('0x73')]){case _0xa8a0('0x74'):_0x5a5e00=_['find'](_0x5563f1[_0xa8a0('0x71')],function(_0x2782fc){return _0x2782fc['id']===_0x2d7633[_0xa8a0('0x75')]&&_0x2782fc[_0xa8a0('0x3a')]===_0xa8a0('0x76');});break;case _0xa8a0('0x77'):_0x5a5e00=_[_0xa8a0('0x48')](_0x5563f1[_0xa8a0('0x71')],function(_0x5cf5eb){return _0x5cf5eb['id']===_0x2d7633[_0xa8a0('0x75')]&&_0x5cf5eb[_0xa8a0('0x3a')]==='CustomReports';});break;}if(_0x5a5e00)_0x5f2d27[_0xa8a0('0x5c')](_0x2d7633);});_0x36643b[_0xa8a0('0x1f')]=_0x5f2d27['length'];_0x36643b[_0xa8a0('0x42')]=_0x5f2d27;return _0x36643b;});}else{return db[_0x2a0660[_0xa8a0('0x6d')]][_0xa8a0('0x1f')]({'where':_0x370db9[_0xa8a0('0x38')]})[_0xa8a0('0x26')](function(_0x49e3ef){_0x36643b[_0xa8a0('0x1f')]=_0x49e3ef;if(_0x25ff11['query'][_0xa8a0('0x46')]){if(_0x2a0660[_0xa8a0('0x6d')]===_0xa8a0('0x78')){_0x370db9[_0xa8a0('0x40')]=[{'model':db[_0xa8a0('0x79')],'as':_0xa8a0('0x7a'),'attributes':['id',_0xa8a0('0x29'),_0xa8a0('0x7b')],'required':_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x7c')]?!![]:![]},{'model':db['Tag'],'as':_0xa8a0('0x7d'),'attributes':['id',_0xa8a0('0x29'),'color'],'through':_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x7c')]?{'attributes':[],'where':{'TagId':_0x25ff11[_0xa8a0('0x2e')]['tag']||undefined}}:{},'required':_0x25ff11[_0xa8a0('0x2e')][_0xa8a0('0x7c')]?!![]:![]}];}else{_0x370db9[_0xa8a0('0x40')]=[{'all':!![]}];}}return db[_0x2a0660['childModel']][_0xa8a0('0x41')](_0x370db9);})[_0xa8a0('0x26')](function(_0x1ac03d){_0x36643b[_0xa8a0('0x42')]=_0x1ac03d;return _0x36643b;});}}else{return _0x36643b;}})['then'](respondWithFilteredResult(_0x191717,_0x370db9))[_0xa8a0('0x4b')](handleError(_0x191717,null));};function getAllResources(_0x138c79,_0x9f6e7e){return new BPromise(function(_0x583cde,_0x43d892){if(_0x9f6e7e){var _0x18facb=_0x9f6e7e[_0xa8a0('0x3e')]?{[_0x9f6e7e['filter'][_0xa8a0('0x3d')]]:_0x9f6e7e[_0xa8a0('0x3e')]['value']}:undefined;return db[_0x138c79][_0xa8a0('0x41')]({'where':_0x18facb,'raw':!![]})[_0xa8a0('0x26')](function(_0xb81e24){_0x9f6e7e[_0xa8a0('0x71')]=_[_0xa8a0('0x39')](_0xb81e24,'id');_0x583cde(_0x9f6e7e);})[_0xa8a0('0x4b')](function(_0xac871a){_0x43d892(_0xac871a);});}else{_0x583cde(null);}});}function getAllFilteredResources(_0x5f2c35,_0x37ecbd){return new BPromise(function(_0x2e9e84,_0x56de8f){var _0xda132e=_0x5f2c35[_0xa8a0('0x3e')]?{[_0x5f2c35[_0xa8a0('0x3e')][_0xa8a0('0x3d')]]:_0x5f2c35['filter']['value']}:undefined;return db[_0x5f2c35['model']][_0xa8a0('0x41')]({'where':_0xda132e,'raw':!![]})[_0xa8a0('0x26')](function(_0xd92a25){_0x37ecbd[_0xa8a0('0x71')]=_[_0xa8a0('0x39')](_0xd92a25,function(_0x3f1a14){return _0x3f1a14[_0xa8a0('0x29')];});_0x2e9e84(_0x37ecbd);})[_0xa8a0('0x4b')](function(_0x276bda){_0x56de8f(_0x276bda);});});}function getAllowedResources(_0x281fc3,_0x3538d4,_0x3791c8){return new BPromise(function(_0x529958,_0x133b2a){if(_0x3538d4){return db['UserProfileResource'][_0xa8a0('0x41')]({'where':{'sectionId':_0x3538d4['id']},'raw':!![]})['then'](function(_0x52e754){if(_0x281fc3[_0xa8a0('0x3d')]&&_0x281fc3[_0xa8a0('0x3d')]!=='id'){_0x3538d4[_0xa8a0('0x71')]=_[_0xa8a0('0x39')](_0x52e754,function(_0x1d7c2b){return _0x1d7c2b[_0x281fc3['field']];});}else{if(_0x3791c8===_0xa8a0('0x6f')){_0x3538d4[_0xa8a0('0x71')]=_['map'](_0x52e754,function(_0x2c7d56){return{'id':_0x2c7d56[_0xa8a0('0x7e')],'type':_0x2c7d56['type']};});}else{_0x3538d4[_0xa8a0('0x71')]=_[_0xa8a0('0x39')](_0x52e754,function(_0x13e143){return _0x13e143['resourceId'];});}}_0x529958(_0x3538d4);})['catch'](function(_0x5a3475){_0x133b2a(_0x5a3475);});}else{_0x529958(null);}});}function getQueryModels(_0x4d2f7c,_0x410f4a){var _0x3c2441=_0x4d2f7c[_0xa8a0('0x7f')]();var _0x26bfe6={'childModel':undefined,'parentSections':[]};switch(_0x3c2441){case _0xa8a0('0x80'):_0x26bfe6['childModel']='SquareProject';break;case _0xa8a0('0x81'):_0x26bfe6[_0xa8a0('0x6d')]='SquareOdbc';break;case _0xa8a0('0x82'):_0x26bfe6[_0xa8a0('0x6d')]='SquareRecording';_0x26bfe6[_0xa8a0('0x69')]=[{'name':'SquareProjects','field':_0xa8a0('0x29'),'foreignKey':'projectName'}];break;case _0xa8a0('0x83'):_0x26bfe6['childModel']=_0xa8a0('0x84');break;case _0xa8a0('0x85'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x78');_0x26bfe6['parentSections']=[{'name':_0xa8a0('0x86'),'field':'id','foreignKey':_0xa8a0('0x87')}];break;case _0xa8a0('0x88'):_0x26bfe6['childModel']=_0xa8a0('0x89');break;case _0xa8a0('0x8a'):_0x26bfe6['childModel']=_0xa8a0('0x8b');break;case _0xa8a0('0x8c'):_0x26bfe6['childModel']=_0xa8a0('0x8d');break;case _0xa8a0('0x8e'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x8f');break;case'chatwebsites':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x90');break;case _0xa8a0('0x91'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x92');break;case _0xa8a0('0x93'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x94');break;case _0xa8a0('0x95'):case _0xa8a0('0x96'):case'outboundroutes':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x97');break;case _0xa8a0('0x98'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x99');break;case _0xa8a0('0x9a'):_0x26bfe6['childModel']=_0xa8a0('0x9b');break;case _0xa8a0('0x9c'):_0x26bfe6[_0xa8a0('0x6d')]='VoiceRecording';_0x26bfe6[_0xa8a0('0x69')]=[{'name':_0xa8a0('0x9d'),'field':_0xa8a0('0x29'),'foreignKey':'membername','model':'User','filter':{'field':_0xa8a0('0x9e'),'value':[_0xa8a0('0x9f')]}},{'name':_0xa8a0('0xa0'),'field':'name','foreignKey':'membername','model':_0xa8a0('0xa1'),'filter':{'field':_0xa8a0('0x9e'),'value':['telephone']}},{'name':_0xa8a0('0xa2'),'field':'name','foreignKey':_0xa8a0('0xa3'),'model':_0xa8a0('0xa4'),'filter':{'field':_0xa8a0('0x3a'),'value':[_0xa8a0('0xa5')]}},{'name':_0xa8a0('0xa6'),'field':_0xa8a0('0x29'),'foreignKey':'queue','model':_0xa8a0('0xa4'),'filter':{'field':_0xa8a0('0x3a'),'value':[_0xa8a0('0xa7')]}}];break;case _0xa8a0('0xa8'):_0x26bfe6['childModel']=_0xa8a0('0xa9');break;case _0xa8a0('0xaa'):_0x26bfe6[_0xa8a0('0x6d')]='VoiceChanSpy';break;case _0xa8a0('0xab'):_0x26bfe6['childModel']=_0xa8a0('0xac');break;case _0xa8a0('0xad'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xae');break;case _0xa8a0('0xaf'):_0x26bfe6['childModel']=_0xa8a0('0xb0');break;case _0xa8a0('0xb1'):_0x26bfe6['childModel']=_0xa8a0('0xb2');break;case _0xa8a0('0xb3'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xb4');break;case _0xa8a0('0xb5'):_0x26bfe6['childModel']=_0xa8a0('0xb6');break;case _0xa8a0('0xb7'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xb8');break;case _0xa8a0('0xb9'):_0x26bfe6['childModel']=_0xa8a0('0xba');break;case _0xa8a0('0xbb'):_0x26bfe6[_0xa8a0('0x6d')]='SmsAccount';break;case _0xa8a0('0xbc'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xbd');break;case _0xa8a0('0xbe'):case _0xa8a0('0xbf'):_0x26bfe6['childModel']=_0xa8a0('0xa4');if(_0x410f4a){_0x26bfe6[_0xa8a0('0x69')]=[{'name':_0xa8a0('0xa2')},{'name':_0xa8a0('0xa6')}];}break;case _0xa8a0('0xc0'):case'agents':case _0xa8a0('0xc1'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xa1');if(_0x410f4a){_0x26bfe6[_0xa8a0('0x69')]=[{'name':_0xa8a0('0xc2'),'filter':{'field':_0xa8a0('0x9e'),'value':[_0xa8a0('0xc3'),_0xa8a0('0xc4')]},'ignore':!![]},{'name':_0xa8a0('0x9d')},{'name':'Telephones'}];}break;case _0xa8a0('0xc5'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xc6');break;case _0xa8a0('0xc7'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xc8');break;case _0xa8a0('0xc9'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xca');break;case _0xa8a0('0xcb'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xcc');break;case _0xa8a0('0xcd'):_0x26bfe6[_0xa8a0('0x6d')]='DeskAccount';break;case _0xa8a0('0xce'):_0x26bfe6['childModel']=_0xa8a0('0xcf');break;case'vtigeraccounts':_0x26bfe6[_0xa8a0('0x6d')]='User';break;case'cannedanswers':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd0');break;case _0xa8a0('0xd1'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd2');break;case _0xa8a0('0xd3'):_0x26bfe6[_0xa8a0('0x6d')]='Dashboard';break;case _0xa8a0('0xd4'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd5');break;case'pauses':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd6');break;case _0xa8a0('0xd7'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd8');break;case'sounds':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xd9');break;case _0xa8a0('0xda'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0x79');break;case'templates':_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xdb');break;case _0xa8a0('0xdc'):_0x26bfe6['childModel']='Trigger';break;case _0xa8a0('0xdd'):_0x26bfe6['childModel']=_0xa8a0('0xde');break;case _0xa8a0('0xdf'):_0x26bfe6['childModel']=_0xa8a0('0xe0');break;case _0xa8a0('0xe1'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xe2');break;case _0xa8a0('0xe3'):_0x26bfe6['childModel']='AnalyticExtractedReport';_0x26bfe6[_0xa8a0('0x69')]=[{'name':_0xa8a0('0xe4'),'field':'id','foreignKey':_0xa8a0('0x75')}];break;case _0xa8a0('0xe5'):_0x26bfe6[_0xa8a0('0x6d')]=_0xa8a0('0xe6');break;default:return _0x26bfe6;}return _0x26bfe6;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 348245c..e73582a 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 _0x9dc4=['events','../../mysqldb','UserProfile','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x2be437,_0x3388a1){var _0x40825c=function(_0x1125f8){while(--_0x1125f8){_0x2be437['push'](_0x2be437['shift']());}};_0x40825c(++_0x3388a1);}(_0x9dc4,0x6c));var _0x49dc=function(_0x13b092,_0x20829c){_0x13b092=_0x13b092-0x0;var _0xf4a988=_0x9dc4[_0x13b092];return _0xf4a988;};'use strict';var EventEmitter=require(_0x49dc('0x0'));var UserProfile=require(_0x49dc('0x1'))['db'][_0x49dc('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x49dc('0x3')](0x0);var events={'afterCreate':_0x49dc('0x4'),'afterUpdate':'update','afterDestroy':_0x49dc('0x5')};function emitEvent(_0x42324d){return function(_0x1f7f59,_0x8a7e9,_0x2b5365){UserProfileEvents[_0x49dc('0x6')](_0x42324d+':'+_0x1f7f59['id'],_0x1f7f59);UserProfileEvents[_0x49dc('0x6')](_0x42324d,_0x1f7f59);_0x2b5365(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x49dc('0x7')](e,emitEvent(event));}}module[_0x49dc('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xbaa8=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x1b0a2d,_0x3b908d){var _0x2a2639=function(_0x660930){while(--_0x660930){_0x1b0a2d['push'](_0x1b0a2d['shift']());}};_0x2a2639(++_0x3b908d);}(_0xbaa8,0x1d2));var _0x8baa=function(_0x2110a5,_0x143833){_0x2110a5=_0x2110a5-0x0;var _0x13af19=_0xbaa8[_0x2110a5];return _0x13af19;};'use strict';var EventEmitter=require(_0x8baa('0x0'));var UserProfile=require(_0x8baa('0x1'))['db'][_0x8baa('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8baa('0x3')](0x0);var events={'afterCreate':_0x8baa('0x4'),'afterUpdate':_0x8baa('0x5'),'afterDestroy':_0x8baa('0x6')};function emitEvent(_0x5015f0){return function(_0x5006ca,_0x12c104,_0x510895){UserProfileEvents[_0x8baa('0x7')](_0x5015f0+':'+_0x5006ca['id'],_0x5006ca);UserProfileEvents['emit'](_0x5015f0,_0x5006ca);_0x510895(null);};}for(var e in events){if(events[_0x8baa('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index e89721b..0b94523 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 _0xae0d=['../../config/environment','exports','define','user_profiles','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xae0d,0x14e));var _0xdae0=function(_0x5b4a57,_0x47ba1f){_0x5b4a57=_0x5b4a57-0x0;var _0x59cc6e=_0xae0d[_0x5b4a57];return _0x59cc6e;};'use strict';var _=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var logger=require(_0xdae0('0x2'))(_0xdae0('0x3'));var moment=require('moment');var BPromise=require(_0xdae0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdae0('0x5'));var rimraf=require(_0xdae0('0x6'));var config=require(_0xdae0('0x7'));var attributes=require('./userProfile.attributes');module[_0xdae0('0x8')]=function(_0xb31ed9,_0x2aceff){return _0xb31ed9[_0xdae0('0x9')]('UserProfile',attributes,{'tableName':_0xdae0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3345=['../../config/environment','./userProfile.attributes','exports','define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x3345,0x1bc));var _0x5334=function(_0x3b91e6,_0x515cce){_0x3b91e6=_0x3b91e6-0x0;var _0x2f8e86=_0x3345[_0x3b91e6];return _0x2f8e86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5334('0x0'))(_0x5334('0x1'));var moment=require(_0x5334('0x2'));var BPromise=require(_0x5334('0x3'));var rp=require(_0x5334('0x4'));var fs=require('fs');var path=require(_0x5334('0x5'));var rimraf=require(_0x5334('0x6'));var config=require(_0x5334('0x7'));var attributes=require(_0x5334('0x8'));module[_0x5334('0x9')]=function(_0x15900c,_0x343686){return _0x15900c[_0x5334('0xa')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 846e75d..cb9a789 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 _0xaa72=['request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s'];(function(_0x4f25da,_0x2d2fb8){var _0x3caf8e=function(_0x4d6e20){while(--_0x4d6e20){_0x4f25da['push'](_0x4f25da['shift']());}};_0x3caf8e(++_0x2d2fb8);}(_0xaa72,0xe0));var _0x2aa7=function(_0x5404ed,_0x1a7581){_0x5404ed=_0x5404ed-0x0;var _0x480cf1=_0xaa72[_0x5404ed];return _0x480cf1;};'use strict';var _=require('lodash');var util=require(_0x2aa7('0x0'));var moment=require(_0x2aa7('0x1'));var BPromise=require(_0x2aa7('0x2'));var rs=require(_0x2aa7('0x3'));var fs=require('fs');var Redis=require(_0x2aa7('0x4'));var db=require(_0x2aa7('0x5'))['db'];var utils=require(_0x2aa7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2aa7('0x7'));var jayson=require(_0x2aa7('0x8'));var client=jayson[_0x2aa7('0x9')][_0x2aa7('0xa')]({'port':0x232a});config[_0x2aa7('0xb')]=_[_0x2aa7('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2aa7('0xd'))(new Redis(config[_0x2aa7('0xb')]));require(_0x2aa7('0xe'))[_0x2aa7('0xf')](socket);function respondWithRpcPromise(_0x39de12,_0x32f007,_0x5e432c){return new BPromise(function(_0x54269c,_0x1b858b){return client[_0x2aa7('0x10')](_0x39de12,_0x5e432c)['then'](function(_0x10569f){logger[_0x2aa7('0x11')](_0x2aa7('0x12'),_0x32f007,_0x2aa7('0x13'));logger[_0x2aa7('0x14')](_0x2aa7('0x15'),_0x32f007,_0x2aa7('0x13'),JSON[_0x2aa7('0x16')](_0x10569f));if(_0x10569f[_0x2aa7('0x17')]){if(_0x10569f[_0x2aa7('0x17')][_0x2aa7('0x18')]===0x1f4){logger[_0x2aa7('0x17')]('UserProfile,\x20%s,\x20%s',_0x32f007,_0x10569f[_0x2aa7('0x17')][_0x2aa7('0x19')]);return _0x1b858b(_0x10569f[_0x2aa7('0x17')][_0x2aa7('0x19')]);}logger['error'](_0x2aa7('0x12'),_0x32f007,_0x10569f[_0x2aa7('0x17')][_0x2aa7('0x19')]);return _0x54269c(_0x10569f['error'][_0x2aa7('0x19')]);}else{logger[_0x2aa7('0x11')]('UserProfile,\x20%s,\x20%s',_0x32f007,'request\x20sent');_0x54269c(_0x10569f['result']['message']);}})[_0x2aa7('0x1a')](function(_0x3ad7b7){logger['error'](_0x2aa7('0x12'),_0x32f007,_0x3ad7b7);_0x1b858b(_0x3ad7b7);});});} \ No newline at end of file +var _0x3609=['catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x450559,_0x1f4d1d){var _0x5bb245=function(_0x21cfb1){while(--_0x21cfb1){_0x450559['push'](_0x450559['shift']());}};_0x5bb245(++_0x1f4d1d);}(_0x3609,0x9d));var _0x9360=function(_0x400cd2,_0x3a2372){_0x400cd2=_0x400cd2-0x0;var _0x168ced=_0x3609[_0x400cd2];return _0x168ced;};'use strict';var _=require(_0x9360('0x0'));var util=require(_0x9360('0x1'));var moment=require('moment');var BPromise=require(_0x9360('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9360('0x3'));var db=require(_0x9360('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9360('0x5'));var config=require(_0x9360('0x6'));var jayson=require(_0x9360('0x7'));var client=jayson['client'][_0x9360('0x8')]({'port':0x232a});config[_0x9360('0x9')]=_[_0x9360('0xa')](config['redis'],{'host':_0x9360('0xb'),'port':0x18eb});var socket=require(_0x9360('0xc'))(new Redis(config['redis']));require(_0x9360('0xd'))['register'](socket);function respondWithRpcPromise(_0x4b3064,_0x1c80fe,_0x143543){return new BPromise(function(_0x190fe1,_0x487aff){return client[_0x9360('0xe')](_0x4b3064,_0x143543)['then'](function(_0x2838d9){logger[_0x9360('0xf')](_0x9360('0x10'),_0x1c80fe,_0x9360('0x11'));logger[_0x9360('0x12')](_0x9360('0x13'),_0x1c80fe,_0x9360('0x11'),JSON[_0x9360('0x14')](_0x2838d9));if(_0x2838d9['error']){if(_0x2838d9['error'][_0x9360('0x15')]===0x1f4){logger[_0x9360('0x16')](_0x9360('0x10'),_0x1c80fe,_0x2838d9[_0x9360('0x16')]['message']);return _0x487aff(_0x2838d9[_0x9360('0x16')][_0x9360('0x17')]);}logger[_0x9360('0x16')](_0x9360('0x10'),_0x1c80fe,_0x2838d9[_0x9360('0x16')][_0x9360('0x17')]);return _0x190fe1(_0x2838d9[_0x9360('0x16')][_0x9360('0x17')]);}else{logger[_0x9360('0xf')](_0x9360('0x10'),_0x1c80fe,'request\x20sent');_0x190fe1(_0x2838d9[_0x9360('0x18')][_0x9360('0x17')]);}})[_0x9360('0x19')](function(_0x4883c7){logger[_0x9360('0x16')](_0x9360('0x10'),_0x1c80fe,_0x4883c7);_0x487aff(_0x4883c7);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 508aab7..b9a7004 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 _0x5aaa=['./userProfile.events','emit','removeListener','register','length'];(function(_0x5d9180,_0x7e0aea){var _0x353ba4=function(_0x5f5448){while(--_0x5f5448){_0x5d9180['push'](_0x5d9180['shift']());}};_0x353ba4(++_0x7e0aea);}(_0x5aaa,0xff));var _0xa5aa=function(_0xfe077,_0x21b70d){_0xfe077=_0xfe077-0x0;var _0x1ceb7b=_0x5aaa[_0xfe077];return _0x1ceb7b;};'use strict';var UserProfileEvents=require(_0xa5aa('0x0'));var events=['save','remove','update'];function createListener(_0x59ccda,_0x4926c9){return function(_0x128d2a){_0x4926c9[_0xa5aa('0x1')](_0x59ccda,_0x128d2a);};}function removeListener(_0x473061,_0x54ca19){return function(){UserProfileEvents[_0xa5aa('0x2')](_0x473061,_0x54ca19);};}exports[_0xa5aa('0x3')]=function(_0x5e1865){for(var _0x21d216=0x0,_0x143817=events[_0xa5aa('0x4')];_0x21d216<_0x143817;_0x21d216++){var _0x2c0b72=events[_0x21d216];var _0x5574aa=createListener('userProfile:'+_0x2c0b72,_0x5e1865);UserProfileEvents['on'](_0x2c0b72,_0x5574aa);}}; \ No newline at end of file +var _0x9ff4=['userProfile:','update','removeListener','register','length'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x9ff4,0x196));var _0x49ff=function(_0x4fe2c2,_0x1979ae){_0x4fe2c2=_0x4fe2c2-0x0;var _0x189850=_0x9ff4[_0x4fe2c2];return _0x189850;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save','remove',_0x49ff('0x0')];function createListener(_0xb086eb,_0x17152f){return function(_0x2e5cba){_0x17152f['emit'](_0xb086eb,_0x2e5cba);};}function removeListener(_0x9207f0,_0x44482a){return function(){UserProfileEvents[_0x49ff('0x1')](_0x9207f0,_0x44482a);};}exports[_0x49ff('0x2')]=function(_0x153755){for(var _0x22febd=0x0,_0xe967d3=events[_0x49ff('0x3')];_0x22febd<_0xe967d3;_0x22febd++){var _0x50f784=events[_0x22febd];var _0x5478a6=createListener(_0x49ff('0x4')+_0x50f784,_0x153755);UserProfileEvents['on'](_0x50f784,_0x5478a6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5e754ad..19da743 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 _0xa1c5=['Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','exports','multer','util','path'];(function(_0x3f1e00,_0x25c7dd){var _0x583400=function(_0x880949){while(--_0x880949){_0x3f1e00['push'](_0x3f1e00['shift']());}};_0x583400(++_0x25c7dd);}(_0xa1c5,0x96));var _0x5a1c=function(_0x4f764c,_0x4e42c1){_0x4f764c=_0x4f764c-0x0;var _0x2f16f2=_0xa1c5[_0x4f764c];return _0x2f16f2;};'use strict';var multer=require(_0x5a1c('0x0'));var util=require(_0x5a1c('0x1'));var path=require(_0x5a1c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a1c('0x3')]();var auth=require(_0x5a1c('0x4'));var interaction=require(_0x5a1c('0x5'));var config=require('../../config/environment');var controller=require(_0x5a1c('0x6'));router[_0x5a1c('0x7')]('/',auth[_0x5a1c('0x8')](),controller['index']);router[_0x5a1c('0x7')](_0x5a1c('0x9'),auth['isAuthenticated'](),controller[_0x5a1c('0xa')]);router['get'](_0x5a1c('0xb'),auth[_0x5a1c('0x8')](),controller[_0x5a1c('0xc')]);router[_0x5a1c('0xd')]('/',auth[_0x5a1c('0x8')](),controller['create']);router[_0x5a1c('0xe')]('/:id',auth[_0x5a1c('0x8')](),controller[_0x5a1c('0xf')]);router['delete'](_0x5a1c('0xb'),auth[_0x5a1c('0x8')](),controller['destroy']);module[_0x5a1c('0x10')]=router; \ No newline at end of file +var _0xefe2=['express','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefe2,0xd9));var _0x2efe=function(_0x3c1928,_0x35b748){_0x3c1928=_0x3c1928-0x0;var _0x465e03=_0xefe2[_0x3c1928];return _0x465e03;};'use strict';var multer=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var path=require('path');var timeout=require(_0x2efe('0x2'));var express=require(_0x2efe('0x3'));var router=express['Router']();var auth=require(_0x2efe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2efe('0x5'));var controller=require(_0x2efe('0x6'));router[_0x2efe('0x7')]('/',auth[_0x2efe('0x8')](),controller[_0x2efe('0x9')]);router['get'](_0x2efe('0xa'),auth[_0x2efe('0x8')](),controller[_0x2efe('0xb')]);router[_0x2efe('0x7')]('/:id',auth[_0x2efe('0x8')](),controller[_0x2efe('0xc')]);router[_0x2efe('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2efe('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2efe('0xf')]);router[_0x2efe('0x10')](_0x2efe('0x11'),auth[_0x2efe('0x8')](),controller[_0x2efe('0x12')]);module[_0x2efe('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index ced2611..d3eb2cb 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 _0x66f3=['sequelize','exports'];(function(_0x36fb6b,_0x38b608){var _0x2c7a36=function(_0xf183d5){while(--_0xf183d5){_0x36fb6b['push'](_0x36fb6b['shift']());}};_0x2c7a36(++_0x38b608);}(_0x66f3,0x190));var _0x366f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x66f3[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x366f('0x0'));module[_0x366f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc4b7=['INTEGER','STRING'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0xc4b7,0xdf));var _0x7c4b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc4b7[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7c4b('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7c4b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7c4b('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3900537..af1eb3d 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x49d199,_0x2e0a79){var _0x1c49b1=function(_0x5bea24){while(--_0x5bea24){_0x49d199['push'](_0x49d199['shift']());}};_0x1c49b1(++_0x2e0a79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['UserProfileResource'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['UserProfileResource'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file +var _0x9bde=['includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','save','update','then','error','stack','name','send','UserProfileResource','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5860b0,_0x53a9d4){_0x5860b0=_0x5860b0-0x0;var _0xa02036=_0x9bde[_0x5860b0];return _0xa02036;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var BPromise=require(_0xe9bd('0x4'));var Mustache=require(_0xe9bd('0x5'));var util=require(_0xe9bd('0x6'));var path=require(_0xe9bd('0x7'));var sox=require(_0xe9bd('0x8'));var csv=require('to-csv');var ejs=require(_0xe9bd('0x9'));var fs=require('fs');var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0xf'));var querystring=require(_0xe9bd('0x10'));var Papa=require(_0xe9bd('0x11'));var Redis=require(_0xe9bd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))(_0xe9bd('0x15'));var utils=require('../../config/utils');var config=require(_0xe9bd('0x16'));var db=require(_0xe9bd('0x17'))['db'];function respondWithStatusCode(_0x3339f9,_0x141587){_0x141587=_0x141587||0xcc;return function(_0x5e022a){if(_0x5e022a){return _0x3339f9[_0xe9bd('0x18')](_0x141587);}return _0x3339f9['status'](_0x141587)[_0xe9bd('0x19')]();};}function respondWithResult(_0x429e88,_0x3435b4){_0x3435b4=_0x3435b4||0xc8;return function(_0x51109f){if(_0x51109f){return _0x429e88['status'](_0x3435b4)[_0xe9bd('0x1a')](_0x51109f);}};}function respondWithFilteredResult(_0x248818,_0x3a9e5f){return function(_0x46a59b){if(_0x46a59b){var _0x3360bd=_0x46a59b[_0xe9bd('0x1b')],_0x389e7b=_0x3a9e5f[_0xe9bd('0x1c')],_0x45a9f2=_0x3a9e5f[_0xe9bd('0x1c')]+_0x3a9e5f['limit'],_0x573350;if(_0x45a9f2>=_0x3360bd){_0x45a9f2=_0x3360bd;_0x573350=0xc8;}else{_0x573350=0xce;}_0x248818[_0xe9bd('0x1d')](_0x573350);return _0x248818[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x389e7b+'-'+_0x45a9f2+'/'+_0x3360bd)[_0xe9bd('0x1a')](_0x46a59b);}return null;};}function patchUpdates(_0x5cf674){return function(_0x20ec32){try{jsonpatch['apply'](_0x20ec32,_0x5cf674,!![]);}catch(_0xc6b661){return BPromise['reject'](_0xc6b661);}return _0x20ec32[_0xe9bd('0x20')]();};}function saveUpdates(_0x417113,_0x134c4e){return function(_0x3dda13){if(_0x3dda13){return _0x3dda13[_0xe9bd('0x21')](_0x417113)[_0xe9bd('0x22')](function(_0x6593ce){return _0x6593ce;});}return null;};}function removeEntity(_0x49165b,_0x133318){return function(_0x28cd17){if(_0x28cd17){return _0x28cd17['destroy']()[_0xe9bd('0x22')](function(){_0x49165b['status'](0xcc)[_0xe9bd('0x19')]();});}};}function handleEntityNotFound(_0x1b9cc9,_0x36f8c0){return function(_0xf02209){if(!_0xf02209){_0x1b9cc9['sendStatus'](0x194);}return _0xf02209;};}function handleError(_0x24cf25,_0x1e3cbb){_0x1e3cbb=_0x1e3cbb||0x1f4;return function(_0x2c9a57){logger[_0xe9bd('0x23')](_0x2c9a57[_0xe9bd('0x24')]);if(_0x2c9a57[_0xe9bd('0x25')]){delete _0x2c9a57[_0xe9bd('0x25')];}_0x24cf25[_0xe9bd('0x1d')](_0x1e3cbb)[_0xe9bd('0x26')](_0x2c9a57);};}exports['index']=function(_0x3c211a,_0x38fdfa){var _0x5ba1d6={},_0x3b13b7={},_0xc25248={'count':0x0,'rows':[]};var _0x119672=db[_0xe9bd('0x27')][_0xe9bd('0x28')];_0x3b13b7[_0xe9bd('0x29')]=_['keys'](_0x119672);_0x3b13b7['query']=_[_0xe9bd('0x2a')](_0x3c211a['query']);_0x3b13b7[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](_0x3b13b7[_0xe9bd('0x29')],_0x3b13b7[_0xe9bd('0x2d')]);_0x5ba1d6[_0xe9bd('0x2e')]=_['intersection'](_0x3b13b7['model'],qs[_0xe9bd('0x2f')](_0x3c211a[_0xe9bd('0x2d')][_0xe9bd('0x2f')]));_0x5ba1d6[_0xe9bd('0x2e')]=_0x5ba1d6[_0xe9bd('0x2e')][_0xe9bd('0x30')]?_0x5ba1d6[_0xe9bd('0x2e')]:_0x3b13b7[_0xe9bd('0x29')];if(!_0x3c211a[_0xe9bd('0x2d')]['hasOwnProperty'](_0xe9bd('0x31'))){_0x5ba1d6[_0xe9bd('0x32')]=qs[_0xe9bd('0x32')](_0x3c211a['query']['limit']);_0x5ba1d6[_0xe9bd('0x1c')]=qs[_0xe9bd('0x1c')](_0x3c211a[_0xe9bd('0x2d')][_0xe9bd('0x1c')]);}_0x5ba1d6[_0xe9bd('0x33')]=qs[_0xe9bd('0x34')](_0x3c211a[_0xe9bd('0x2d')][_0xe9bd('0x34')]);_0x5ba1d6[_0xe9bd('0x35')]=qs[_0xe9bd('0x2b')](_[_0xe9bd('0x36')](_0x3c211a[_0xe9bd('0x2d')],_0x3b13b7[_0xe9bd('0x2b')]));if(_0x3c211a[_0xe9bd('0x2d')][_0xe9bd('0x37')]){_0x5ba1d6[_0xe9bd('0x35')]=_[_0xe9bd('0x38')](_0x5ba1d6[_0xe9bd('0x35')],{'$or':_['map'](_0x119672,function(_0x3f3cf5){if(_0x3f3cf5[_0xe9bd('0x39')]['key']!==_0xe9bd('0x3a')){var _0x264c87={};_0x264c87[_0x3f3cf5['field']]={'$like':'%'+_0x3c211a['query'][_0xe9bd('0x37')]+'%'};return _0x264c87;}})});}_0x5ba1d6=_[_0xe9bd('0x38')]({},_0x5ba1d6,_0x3c211a['options']);var _0x2d1289={'where':_0x5ba1d6[_0xe9bd('0x35')]};return db[_0xe9bd('0x27')]['count'](_0x2d1289)[_0xe9bd('0x22')](function(_0x4d1945){_0xc25248[_0xe9bd('0x1b')]=_0x4d1945;if(_0x3c211a[_0xe9bd('0x2d')][_0xe9bd('0x3b')]){_0x5ba1d6[_0xe9bd('0x3c')]=[{'all':!![]}];}return db['UserProfileResource'][_0xe9bd('0x3d')](_0x5ba1d6);})[_0xe9bd('0x22')](function(_0x327e1a){_0xc25248[_0xe9bd('0x3e')]=_0x327e1a;return _0xc25248;})[_0xe9bd('0x22')](respondWithFilteredResult(_0x38fdfa,_0x5ba1d6))[_0xe9bd('0x3f')](handleError(_0x38fdfa,null));};exports[_0xe9bd('0x40')]=function(_0xacfd19,_0x2b5a71){var _0x1d5d93={'raw':![],'where':{'id':_0xacfd19['params']['id']}},_0x4e8565={};_0x4e8565[_0xe9bd('0x29')]=_['keys'](db[_0xe9bd('0x27')][_0xe9bd('0x28')]);_0x4e8565[_0xe9bd('0x2d')]=_['keys'](_0xacfd19[_0xe9bd('0x2d')]);_0x4e8565[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](_0x4e8565['model'],_0x4e8565[_0xe9bd('0x2d')]);_0x1d5d93[_0xe9bd('0x2e')]=_[_0xe9bd('0x2c')](_0x4e8565[_0xe9bd('0x29')],qs[_0xe9bd('0x2f')](_0xacfd19[_0xe9bd('0x2d')][_0xe9bd('0x2f')]));_0x1d5d93[_0xe9bd('0x2e')]=_0x1d5d93[_0xe9bd('0x2e')][_0xe9bd('0x30')]?_0x1d5d93[_0xe9bd('0x2e')]:_0x4e8565[_0xe9bd('0x29')];if(_0xacfd19[_0xe9bd('0x2d')][_0xe9bd('0x3b')]){_0x1d5d93[_0xe9bd('0x3c')]=[{'all':!![]}];}_0x1d5d93=_['merge']({},_0x1d5d93,_0xacfd19['options']);return db[_0xe9bd('0x27')][_0xe9bd('0x41')](_0x1d5d93)[_0xe9bd('0x22')](handleEntityNotFound(_0x2b5a71,null))['then'](respondWithResult(_0x2b5a71,null))['catch'](handleError(_0x2b5a71,null));};exports[_0xe9bd('0x42')]=function(_0x3f6f22,_0x165942){return db[_0xe9bd('0x27')][_0xe9bd('0x42')](_0x3f6f22[_0xe9bd('0x43')],{})[_0xe9bd('0x22')](respondWithResult(_0x165942,0xc9))['catch'](handleError(_0x165942,null));};exports[_0xe9bd('0x21')]=function(_0x4cc146,_0x36726e){if(_0x4cc146[_0xe9bd('0x43')]['id']){delete _0x4cc146[_0xe9bd('0x43')]['id'];}return db[_0xe9bd('0x27')][_0xe9bd('0x41')]({'where':{'id':_0x4cc146['params']['id']}})[_0xe9bd('0x22')](handleEntityNotFound(_0x36726e,null))[_0xe9bd('0x22')](saveUpdates(_0x4cc146[_0xe9bd('0x43')],null))['then'](respondWithResult(_0x36726e,null))[_0xe9bd('0x3f')](handleError(_0x36726e,null));};exports[_0xe9bd('0x44')]=function(_0x34f787,_0x5a466b){return db[_0xe9bd('0x27')][_0xe9bd('0x41')]({'where':{'id':_0x34f787[_0xe9bd('0x45')]['id']}})[_0xe9bd('0x22')](handleEntityNotFound(_0x5a466b,null))[_0xe9bd('0x22')](removeEntity(_0x5a466b,null))['catch'](handleError(_0x5a466b,null));};exports[_0xe9bd('0x46')]=function(_0x4b8ff9,_0x835697){return db[_0xe9bd('0x27')][_0xe9bd('0x46')]()[_0xe9bd('0x22')](respondWithResult(_0x835697,null))[_0xe9bd('0x3f')](handleError(_0x835697,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 3441b13..fe99766 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 _0x5478=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api'];(function(_0xac2317,_0x4dfffe){var _0x351997=function(_0x18cddc){while(--_0x18cddc){_0xac2317['push'](_0xac2317['shift']());}};_0x351997(++_0x4dfffe);}(_0x5478,0x7c));var _0x8547=function(_0x3108d9,_0xf08d6){_0x3108d9=_0x3108d9-0x0;var _0x1455e6=_0x5478[_0x3108d9];return _0x1455e6;};'use strict';var _=require(_0x8547('0x0'));var util=require(_0x8547('0x1'));var logger=require(_0x8547('0x2'))(_0x8547('0x3'));var moment=require(_0x8547('0x4'));var BPromise=require(_0x8547('0x5'));var rp=require(_0x8547('0x6'));var fs=require('fs');var path=require(_0x8547('0x7'));var rimraf=require(_0x8547('0x8'));var config=require(_0x8547('0x9'));var attributes=require(_0x8547('0xa'));module[_0x8547('0xb')]=function(_0x3eca1b,_0x27cf38){return _0x3eca1b[_0x8547('0xc')]('UserProfileResource',attributes,{'tableName':_0x8547('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8547('0xe'),_0x8547('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd225=['./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','api','bluebird','path'];(function(_0x26165c,_0x5c5757){var _0x280091=function(_0x181f09){while(--_0x181f09){_0x26165c['push'](_0x26165c['shift']());}};_0x280091(++_0x5c5757);}(_0xd225,0x11d));var _0x5d22=function(_0x1a22c2,_0x1306d6){_0x1a22c2=_0x1a22c2-0x0;var _0x38dd1c=_0xd225[_0x1a22c2];return _0x38dd1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5d22('0x0'));var moment=require('moment');var BPromise=require(_0x5d22('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d22('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d22('0x3'));module['exports']=function(_0xa30114,_0x20e7af){return _0xa30114[_0x5d22('0x4')]('UserProfileResource',attributes,{'tableName':_0x5d22('0x5'),'paranoid':![],'indexes':[{'name':_0x5d22('0x6'),'fields':[_0x5d22('0x7'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 815cd01..fc352e6 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 _0x46ed=['UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});} \ No newline at end of file +var _0x627e=['request','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x5ed537,_0x55e79e){var _0x163bba=function(_0x216edc){while(--_0x216edc){_0x5ed537['push'](_0x5ed537['shift']());}};_0x163bba(++_0x55e79e);}(_0x627e,0x14a));var _0xe627=function(_0x2dd39f,_0x4fe912){_0x2dd39f=_0x2dd39f-0x0;var _0xe6f844=_0x627e[_0x2dd39f];return _0xe6f844;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 2fd2da4..dcf3ce8 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 _0x24ab=['delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','describe','/:id','post','create','update'];(function(_0x46df85,_0x52f339){var _0x1411b8=function(_0x400d69){while(--_0x400d69){_0x46df85['push'](_0x46df85['shift']());}};_0x1411b8(++_0x52f339);}(_0x24ab,0x80));var _0xb24a=function(_0x14d93b,_0x571573){_0x14d93b=_0x14d93b-0x0;var _0x2869a4=_0x24ab[_0x14d93b];return _0x2869a4;};'use strict';var multer=require(_0xb24a('0x0'));var util=require('util');var path=require(_0xb24a('0x1'));var timeout=require(_0xb24a('0x2'));var express=require(_0xb24a('0x3'));var router=express[_0xb24a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb24a('0x5'));var config=require(_0xb24a('0x6'));var controller=require(_0xb24a('0x7'));router['get']('/',auth[_0xb24a('0x8')](),controller[_0xb24a('0x9')]);router[_0xb24a('0xa')]('/describe',auth[_0xb24a('0x8')](),controller[_0xb24a('0xb')]);router[_0xb24a('0xa')](_0xb24a('0xc'),auth[_0xb24a('0x8')](),controller['show']);router[_0xb24a('0xd')]('/',auth[_0xb24a('0x8')](),controller[_0xb24a('0xe')]);router['put']('/:id',auth[_0xb24a('0x8')](),controller[_0xb24a('0xf')]);router[_0xb24a('0x10')](_0xb24a('0xc'),auth[_0xb24a('0x8')](),controller[_0xb24a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x81a5=['/describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x81a5,0xcf));var _0x581a=function(_0x31597e,_0x44ae11){_0x31597e=_0x31597e-0x0;var _0x29b1fa=_0x81a5[_0x31597e];return _0x29b1fa;};'use strict';var multer=require(_0x581a('0x0'));var util=require('util');var path=require(_0x581a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x581a('0x2')]();var auth=require(_0x581a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x581a('0x4'));var controller=require(_0x581a('0x5'));router[_0x581a('0x6')]('/',auth[_0x581a('0x7')](),controller[_0x581a('0x8')]);router['get'](_0x581a('0x9'),auth[_0x581a('0x7')](),controller['describe']);router['get'](_0x581a('0xa'),auth[_0x581a('0x7')](),controller[_0x581a('0xb')]);router[_0x581a('0xc')]('/',auth[_0x581a('0x7')](),controller[_0x581a('0xd')]);router['put'](_0x581a('0xa'),auth[_0x581a('0x7')](),controller[_0x581a('0xe')]);router[_0x581a('0xf')](_0x581a('0xa'),auth[_0x581a('0x7')](),controller[_0x581a('0x10')]);module[_0x581a('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 ec73fb8..1890e5a 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 _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x52d919,_0x5f2e36){var _0x446dad=function(_0x513aea){while(--_0x513aea){_0x52d919['push'](_0x52d919['shift']());}};_0x446dad(++_0x5f2e36);}(_0xedd9,0xfc));var _0x9edd=function(_0x54401b,_0x480134){_0x54401b=_0x54401b-0x0;var _0x7cb698=_0xedd9[_0x54401b];return _0x7cb698;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x26d012,_0x1d5a65){var _0x3a4e61=function(_0x41da39){while(--_0x41da39){_0x26d012['push'](_0x26d012['shift']());}};_0x3a4e61(++_0x1d5a65);}(_0xedd9,0xfc));var _0x9edd=function(_0xbafba6,_0x1a3363){_0xbafba6=_0xbafba6-0x0;var _0x51e95a=_0xedd9[_0xbafba6];return _0x51e95a;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d444775..376ec25 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 _0x7c71=['type','key','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','save','update','then','destroy','error','stack','name','index','UserProfileSection','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0x7c71,0x177));var _0x17c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7c71[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x17c7('0x0'));var emlformat=require(_0x17c7('0x1'));var rimraf=require(_0x17c7('0x2'));var zipdir=require(_0x17c7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17c7('0x4'));var moment=require(_0x17c7('0x5'));var BPromise=require(_0x17c7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x17c7('0x7'));var sox=require(_0x17c7('0x8'));var csv=require(_0x17c7('0x9'));var ejs=require(_0x17c7('0xa'));var fs=require('fs');var _=require(_0x17c7('0xb'));var squel=require(_0x17c7('0xc'));var crypto=require(_0x17c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x17c7('0xe'));var toCsv=require(_0x17c7('0x9'));var querystring=require(_0x17c7('0xf'));var Papa=require(_0x17c7('0x10'));var Redis=require(_0x17c7('0x11'));var authService=require(_0x17c7('0x12'));var qs=require(_0x17c7('0x13'));var hardwareService=require(_0x17c7('0x14'));var logger=require(_0x17c7('0x15'))(_0x17c7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x17c7('0x17'))['db'];function respondWithStatusCode(_0x15b780,_0x501d58){_0x501d58=_0x501d58||0xcc;return function(_0x430506){if(_0x430506){return _0x15b780[_0x17c7('0x18')](_0x501d58);}return _0x15b780['status'](_0x501d58)[_0x17c7('0x19')]();};}function respondWithResult(_0x3c9d93,_0x48be80){_0x48be80=_0x48be80||0xc8;return function(_0x56ef3b){if(_0x56ef3b){return _0x3c9d93[_0x17c7('0x1a')](_0x48be80)[_0x17c7('0x1b')](_0x56ef3b);}};}function respondWithFilteredResult(_0x257c43,_0x19e219){return function(_0x3d0fb2){if(_0x3d0fb2){var _0x2851=_0x3d0fb2[_0x17c7('0x1c')],_0x2c992f=_0x19e219[_0x17c7('0x1d')],_0x295168=_0x19e219[_0x17c7('0x1d')]+_0x19e219['limit'],_0xa06e65;if(_0x295168>=_0x2851){_0x295168=_0x2851;_0xa06e65=0xc8;}else{_0xa06e65=0xce;}_0x257c43[_0x17c7('0x1a')](_0xa06e65);return _0x257c43[_0x17c7('0x1e')]('Content-Range',_0x2c992f+'-'+_0x295168+'/'+_0x2851)[_0x17c7('0x1b')](_0x3d0fb2);}return null;};}function patchUpdates(_0x34da57){return function(_0x2c652c){try{jsonpatch[_0x17c7('0x1f')](_0x2c652c,_0x34da57,!![]);}catch(_0x5b9e72){return BPromise['reject'](_0x5b9e72);}return _0x2c652c[_0x17c7('0x20')]();};}function saveUpdates(_0x175b56,_0x13b756){return function(_0x86956b){if(_0x86956b){return _0x86956b[_0x17c7('0x21')](_0x175b56)[_0x17c7('0x22')](function(_0x357c27){return _0x357c27;});}return null;};}function removeEntity(_0x5d324c,_0x1e511e){return function(_0x3885c8){if(_0x3885c8){return _0x3885c8[_0x17c7('0x23')]()[_0x17c7('0x22')](function(){_0x5d324c[_0x17c7('0x1a')](0xcc)[_0x17c7('0x19')]();});}};}function handleEntityNotFound(_0x29a4ac,_0x196e0e){return function(_0x512c3c){if(!_0x512c3c){_0x29a4ac[_0x17c7('0x18')](0x194);}return _0x512c3c;};}function handleError(_0x11bcf0,_0x26e280){_0x26e280=_0x26e280||0x1f4;return function(_0x4e1316){logger[_0x17c7('0x24')](_0x4e1316[_0x17c7('0x25')]);if(_0x4e1316['name']){delete _0x4e1316[_0x17c7('0x26')];}_0x11bcf0[_0x17c7('0x1a')](_0x26e280)['send'](_0x4e1316);};}exports[_0x17c7('0x27')]=function(_0x4d2460,_0x463ff2){var _0x2e2c7a={},_0x4a61f4={},_0x42b7f2={'count':0x0,'rows':[]};var _0x7ecd2b=db[_0x17c7('0x28')][_0x17c7('0x29')];_0x4a61f4[_0x17c7('0x2a')]=_[_0x17c7('0x2b')](_0x7ecd2b);_0x4a61f4[_0x17c7('0x2c')]=_[_0x17c7('0x2b')](_0x4d2460[_0x17c7('0x2c')]);_0x4a61f4[_0x17c7('0x2d')]=_[_0x17c7('0x2e')](_0x4a61f4[_0x17c7('0x2a')],_0x4a61f4[_0x17c7('0x2c')]);_0x2e2c7a[_0x17c7('0x2f')]=_['intersection'](_0x4a61f4[_0x17c7('0x2a')],qs['fields'](_0x4d2460[_0x17c7('0x2c')][_0x17c7('0x30')]));_0x2e2c7a[_0x17c7('0x2f')]=_0x2e2c7a[_0x17c7('0x2f')][_0x17c7('0x31')]?_0x2e2c7a['attributes']:_0x4a61f4['model'];if(!_0x4d2460[_0x17c7('0x2c')][_0x17c7('0x32')](_0x17c7('0x33'))){_0x2e2c7a[_0x17c7('0x34')]=qs[_0x17c7('0x34')](_0x4d2460[_0x17c7('0x2c')][_0x17c7('0x34')]);_0x2e2c7a[_0x17c7('0x1d')]=qs[_0x17c7('0x1d')](_0x4d2460['query'][_0x17c7('0x1d')]);}_0x2e2c7a[_0x17c7('0x35')]=qs[_0x17c7('0x36')](_0x4d2460['query'][_0x17c7('0x36')]);_0x2e2c7a[_0x17c7('0x37')]=qs[_0x17c7('0x2d')](_[_0x17c7('0x38')](_0x4d2460[_0x17c7('0x2c')],_0x4a61f4[_0x17c7('0x2d')]));if(_0x4d2460[_0x17c7('0x2c')]['filter']){_0x2e2c7a['where']=_['merge'](_0x2e2c7a[_0x17c7('0x37')],{'$or':_['map'](_0x7ecd2b,function(_0x1747a7){if(_0x1747a7[_0x17c7('0x39')][_0x17c7('0x3a')]!=='VIRTUAL'){var _0x265927={};_0x265927[_0x1747a7['field']]={'$like':'%'+_0x4d2460['query'][_0x17c7('0x3b')]+'%'};return _0x265927;}})});}_0x2e2c7a=_[_0x17c7('0x3c')]({},_0x2e2c7a,_0x4d2460[_0x17c7('0x3d')]);var _0x2b8023={'where':_0x2e2c7a[_0x17c7('0x37')]};return db[_0x17c7('0x28')][_0x17c7('0x1c')](_0x2b8023)[_0x17c7('0x22')](function(_0x395ca5){_0x42b7f2[_0x17c7('0x1c')]=_0x395ca5;if(_0x4d2460['query'][_0x17c7('0x3e')]){_0x2e2c7a[_0x17c7('0x3f')]=[{'all':!![]}];}return db[_0x17c7('0x28')][_0x17c7('0x40')](_0x2e2c7a);})[_0x17c7('0x22')](function(_0xbd845c){_0x42b7f2['rows']=_0xbd845c;return _0x42b7f2;})[_0x17c7('0x22')](respondWithFilteredResult(_0x463ff2,_0x2e2c7a))[_0x17c7('0x41')](handleError(_0x463ff2,null));};exports[_0x17c7('0x42')]=function(_0x21f15d,_0x227441){var _0x21917c={'raw':![],'where':{'id':_0x21f15d['params']['id']}},_0x2c0f92={};_0x2c0f92['model']=_[_0x17c7('0x2b')](db[_0x17c7('0x28')][_0x17c7('0x29')]);_0x2c0f92[_0x17c7('0x2c')]=_[_0x17c7('0x2b')](_0x21f15d['query']);_0x2c0f92[_0x17c7('0x2d')]=_[_0x17c7('0x2e')](_0x2c0f92['model'],_0x2c0f92[_0x17c7('0x2c')]);_0x21917c[_0x17c7('0x2f')]=_['intersection'](_0x2c0f92[_0x17c7('0x2a')],qs[_0x17c7('0x30')](_0x21f15d[_0x17c7('0x2c')]['fields']));_0x21917c['attributes']=_0x21917c[_0x17c7('0x2f')][_0x17c7('0x31')]?_0x21917c[_0x17c7('0x2f')]:_0x2c0f92['model'];if(_0x21f15d[_0x17c7('0x2c')]['includeAll']){_0x21917c[_0x17c7('0x3f')]=[{'all':!![]}];}_0x21917c=_['merge']({},_0x21917c,_0x21f15d[_0x17c7('0x3d')]);return db[_0x17c7('0x28')][_0x17c7('0x43')](_0x21917c)['then'](handleEntityNotFound(_0x227441,null))[_0x17c7('0x22')](respondWithResult(_0x227441,null))[_0x17c7('0x41')](handleError(_0x227441,null));};exports[_0x17c7('0x44')]=function(_0xd80635,_0x4538f3){return db[_0x17c7('0x28')][_0x17c7('0x44')](_0xd80635[_0x17c7('0x45')],{})[_0x17c7('0x22')](respondWithResult(_0x4538f3,0xc9))[_0x17c7('0x41')](handleError(_0x4538f3,null));};exports['update']=function(_0xd8de4c,_0x4a37e5){if(_0xd8de4c[_0x17c7('0x45')]['id']){delete _0xd8de4c['body']['id'];}return db[_0x17c7('0x28')]['find']({'where':{'id':_0xd8de4c[_0x17c7('0x46')]['id']}})[_0x17c7('0x22')](handleEntityNotFound(_0x4a37e5,null))['then'](saveUpdates(_0xd8de4c['body'],null))[_0x17c7('0x22')](respondWithResult(_0x4a37e5,null))[_0x17c7('0x41')](handleError(_0x4a37e5,null));};exports[_0x17c7('0x23')]=function(_0x32d007,_0x2f1136){return db[_0x17c7('0x28')][_0x17c7('0x43')]({'where':{'id':_0x32d007[_0x17c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f1136,null))[_0x17c7('0x22')](removeEntity(_0x2f1136,null))[_0x17c7('0x41')](handleError(_0x2f1136,null));};exports[_0x17c7('0x47')]=function(_0x4821b0,_0x1c7ed9){return db[_0x17c7('0x28')][_0x17c7('0x47')]()['then'](respondWithResult(_0x1c7ed9,null))[_0x17c7('0x41')](handleError(_0x1c7ed9,null));}; \ No newline at end of file +var _0x28cd=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','UserProfileSection','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x28cd,0x177));var _0xd28c=function(_0x97f854,_0x33ef37){_0x97f854=_0x97f854-0x0;var _0x3300da=_0x28cd[_0x97f854];return _0x3300da;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd28c('0x0'));var zipdir=require(_0xd28c('0x1'));var jsonpatch=require(_0xd28c('0x2'));var rp=require(_0xd28c('0x3'));var moment=require(_0xd28c('0x4'));var BPromise=require(_0xd28c('0x5'));var Mustache=require(_0xd28c('0x6'));var util=require(_0xd28c('0x7'));var path=require(_0xd28c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd28c('0x9'));var squel=require(_0xd28c('0xa'));var crypto=require(_0xd28c('0xb'));var jsforce=require(_0xd28c('0xc'));var deskjs=require(_0xd28c('0xd'));var toCsv=require(_0xd28c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd28c('0xf'));var authService=require(_0xd28c('0x10'));var qs=require(_0xd28c('0x11'));var hardwareService=require(_0xd28c('0x12'));var logger=require('../../config/logger')(_0xd28c('0x13'));var utils=require(_0xd28c('0x14'));var config=require(_0xd28c('0x15'));var db=require(_0xd28c('0x16'))['db'];function respondWithStatusCode(_0x392a8d,_0x40456e){_0x40456e=_0x40456e||0xcc;return function(_0x5f0638){if(_0x5f0638){return _0x392a8d[_0xd28c('0x17')](_0x40456e);}return _0x392a8d[_0xd28c('0x18')](_0x40456e)['end']();};}function respondWithResult(_0x5d01f1,_0x358a24){_0x358a24=_0x358a24||0xc8;return function(_0x5c1a6f){if(_0x5c1a6f){return _0x5d01f1[_0xd28c('0x18')](_0x358a24)[_0xd28c('0x19')](_0x5c1a6f);}};}function respondWithFilteredResult(_0x164cdf,_0xdd6dd5){return function(_0x3bd1de){if(_0x3bd1de){var _0x48529a=_0x3bd1de[_0xd28c('0x1a')],_0x41565=_0xdd6dd5[_0xd28c('0x1b')],_0x6cf0cf=_0xdd6dd5[_0xd28c('0x1b')]+_0xdd6dd5[_0xd28c('0x1c')],_0xdf604d;if(_0x6cf0cf>=_0x48529a){_0x6cf0cf=_0x48529a;_0xdf604d=0xc8;}else{_0xdf604d=0xce;}_0x164cdf[_0xd28c('0x18')](_0xdf604d);return _0x164cdf[_0xd28c('0x1d')](_0xd28c('0x1e'),_0x41565+'-'+_0x6cf0cf+'/'+_0x48529a)[_0xd28c('0x19')](_0x3bd1de);}return null;};}function patchUpdates(_0x19bcfc){return function(_0x36c603){try{jsonpatch[_0xd28c('0x1f')](_0x36c603,_0x19bcfc,!![]);}catch(_0x23a673){return BPromise[_0xd28c('0x20')](_0x23a673);}return _0x36c603[_0xd28c('0x21')]();};}function saveUpdates(_0x4dd364,_0x1a6793){return function(_0x3b6c19){if(_0x3b6c19){return _0x3b6c19['update'](_0x4dd364)[_0xd28c('0x22')](function(_0x149d7c){return _0x149d7c;});}return null;};}function removeEntity(_0x9fd1cd,_0x2c4ce4){return function(_0x368248){if(_0x368248){return _0x368248[_0xd28c('0x23')]()[_0xd28c('0x22')](function(){_0x9fd1cd[_0xd28c('0x18')](0xcc)[_0xd28c('0x24')]();});}};}function handleEntityNotFound(_0x5b56c2,_0x2b9dae){return function(_0x42d3c7){if(!_0x42d3c7){_0x5b56c2[_0xd28c('0x17')](0x194);}return _0x42d3c7;};}function handleError(_0xbd8f6f,_0x537195){_0x537195=_0x537195||0x1f4;return function(_0x5a9fbb){logger['error'](_0x5a9fbb[_0xd28c('0x25')]);if(_0x5a9fbb[_0xd28c('0x26')]){delete _0x5a9fbb[_0xd28c('0x26')];}_0xbd8f6f['status'](_0x537195)[_0xd28c('0x27')](_0x5a9fbb);};}exports['index']=function(_0x3955ed,_0x5c19a7){var _0x417f32={},_0x40f907={},_0x29f764={'count':0x0,'rows':[]};var _0x49e545=db[_0xd28c('0x28')][_0xd28c('0x29')];_0x40f907['model']=_[_0xd28c('0x2a')](_0x49e545);_0x40f907[_0xd28c('0x2b')]=_[_0xd28c('0x2a')](_0x3955ed[_0xd28c('0x2b')]);_0x40f907[_0xd28c('0x2c')]=_[_0xd28c('0x2d')](_0x40f907[_0xd28c('0x2e')],_0x40f907[_0xd28c('0x2b')]);_0x417f32[_0xd28c('0x2f')]=_[_0xd28c('0x2d')](_0x40f907[_0xd28c('0x2e')],qs[_0xd28c('0x30')](_0x3955ed['query'][_0xd28c('0x30')]));_0x417f32['attributes']=_0x417f32[_0xd28c('0x2f')][_0xd28c('0x31')]?_0x417f32['attributes']:_0x40f907[_0xd28c('0x2e')];if(!_0x3955ed[_0xd28c('0x2b')][_0xd28c('0x32')](_0xd28c('0x33'))){_0x417f32[_0xd28c('0x1c')]=qs[_0xd28c('0x1c')](_0x3955ed[_0xd28c('0x2b')]['limit']);_0x417f32[_0xd28c('0x1b')]=qs[_0xd28c('0x1b')](_0x3955ed['query'][_0xd28c('0x1b')]);}_0x417f32[_0xd28c('0x34')]=qs[_0xd28c('0x35')](_0x3955ed[_0xd28c('0x2b')]['sort']);_0x417f32[_0xd28c('0x36')]=qs[_0xd28c('0x2c')](_[_0xd28c('0x37')](_0x3955ed['query'],_0x40f907[_0xd28c('0x2c')]));if(_0x3955ed[_0xd28c('0x2b')][_0xd28c('0x38')]){_0x417f32[_0xd28c('0x36')]=_[_0xd28c('0x39')](_0x417f32[_0xd28c('0x36')],{'$or':_[_0xd28c('0x3a')](_0x49e545,function(_0x2c3ff){if(_0x2c3ff[_0xd28c('0x3b')][_0xd28c('0x3c')]!==_0xd28c('0x3d')){var _0x39c11b={};_0x39c11b[_0x2c3ff[_0xd28c('0x3e')]]={'$like':'%'+_0x3955ed['query']['filter']+'%'};return _0x39c11b;}})});}_0x417f32=_['merge']({},_0x417f32,_0x3955ed[_0xd28c('0x3f')]);var _0x29b17b={'where':_0x417f32['where']};return db[_0xd28c('0x28')]['count'](_0x29b17b)[_0xd28c('0x22')](function(_0x4fde48){_0x29f764[_0xd28c('0x1a')]=_0x4fde48;if(_0x3955ed[_0xd28c('0x2b')]['includeAll']){_0x417f32[_0xd28c('0x40')]=[{'all':!![]}];}return db[_0xd28c('0x28')][_0xd28c('0x41')](_0x417f32);})[_0xd28c('0x22')](function(_0xf7ccb8){_0x29f764[_0xd28c('0x42')]=_0xf7ccb8;return _0x29f764;})[_0xd28c('0x22')](respondWithFilteredResult(_0x5c19a7,_0x417f32))[_0xd28c('0x43')](handleError(_0x5c19a7,null));};exports[_0xd28c('0x44')]=function(_0x284437,_0x2c18e1){var _0x36c888={'raw':![],'where':{'id':_0x284437[_0xd28c('0x45')]['id']}},_0x340946={};_0x340946[_0xd28c('0x2e')]=_['keys'](db[_0xd28c('0x28')][_0xd28c('0x29')]);_0x340946[_0xd28c('0x2b')]=_[_0xd28c('0x2a')](_0x284437[_0xd28c('0x2b')]);_0x340946['filters']=_[_0xd28c('0x2d')](_0x340946['model'],_0x340946[_0xd28c('0x2b')]);_0x36c888[_0xd28c('0x2f')]=_[_0xd28c('0x2d')](_0x340946[_0xd28c('0x2e')],qs[_0xd28c('0x30')](_0x284437['query'][_0xd28c('0x30')]));_0x36c888[_0xd28c('0x2f')]=_0x36c888[_0xd28c('0x2f')]['length']?_0x36c888[_0xd28c('0x2f')]:_0x340946[_0xd28c('0x2e')];if(_0x284437['query'][_0xd28c('0x46')]){_0x36c888[_0xd28c('0x40')]=[{'all':!![]}];}_0x36c888=_[_0xd28c('0x39')]({},_0x36c888,_0x284437['options']);return db['UserProfileSection'][_0xd28c('0x47')](_0x36c888)['then'](handleEntityNotFound(_0x2c18e1,null))[_0xd28c('0x22')](respondWithResult(_0x2c18e1,null))['catch'](handleError(_0x2c18e1,null));};exports[_0xd28c('0x48')]=function(_0x3c3a93,_0x43a139){return db[_0xd28c('0x28')][_0xd28c('0x48')](_0x3c3a93[_0xd28c('0x49')],{})[_0xd28c('0x22')](respondWithResult(_0x43a139,0xc9))['catch'](handleError(_0x43a139,null));};exports['update']=function(_0x3f1134,_0x559a7e){if(_0x3f1134['body']['id']){delete _0x3f1134[_0xd28c('0x49')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x3f1134['params']['id']}})[_0xd28c('0x22')](handleEntityNotFound(_0x559a7e,null))[_0xd28c('0x22')](saveUpdates(_0x3f1134[_0xd28c('0x49')],null))['then'](respondWithResult(_0x559a7e,null))['catch'](handleError(_0x559a7e,null));};exports[_0xd28c('0x23')]=function(_0x27d2c1,_0x315a79){return db[_0xd28c('0x28')][_0xd28c('0x47')]({'where':{'id':_0x27d2c1[_0xd28c('0x45')]['id']}})['then'](handleEntityNotFound(_0x315a79,null))[_0xd28c('0x22')](removeEntity(_0x315a79,null))['catch'](handleError(_0x315a79,null));};exports[_0xd28c('0x4a')]=function(_0x3b9372,_0x3ebd20){return db[_0xd28c('0x28')][_0xd28c('0x4a')]()[_0xd28c('0x22')](respondWithResult(_0x3ebd20,null))[_0xd28c('0x43')](handleError(_0x3ebd20,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 6b542c3..ade3892 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 _0xd29e=['define','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4fc77b,_0x528185){var _0x3e1583=function(_0x4d5f27){while(--_0x4d5f27){_0x4fc77b['push'](_0x4fc77b['shift']());}};_0x3e1583(++_0x528185);}(_0xd29e,0x1a7));var _0xed29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd29e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xed29('0x0'));var logger=require(_0xed29('0x1'))(_0xed29('0x2'));var moment=require(_0xed29('0x3'));var BPromise=require(_0xed29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed29('0x5'));var rimraf=require(_0xed29('0x6'));var config=require(_0xed29('0x7'));var attributes=require('./userProfileSection.attributes');module[_0xed29('0x8')]=function(_0x1cd7de,_0x3b1660){return _0x1cd7de[_0xed29('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xed29('0xa'),_0xed29('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3b4=['bluebird','request-promise','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','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(_0x1273b3,_0x493394){_0x1273b3=_0x1273b3-0x0;var _0x693d01=_0xa3b4[_0x1273b3];return _0x693d01;};'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'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6e5b210..ee42395 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 _0xe773=['UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x272ea6,_0x3f0673){var _0x43ef03=function(_0x2307e2){while(--_0x2307e2){_0x272ea6['push'](_0x272ea6['shift']());}};_0x43ef03(++_0x3f0673);}(_0xe773,0x117));var _0x3e77=function(_0x25a96f,_0x436f51){_0x25a96f=_0x25a96f-0x0;var _0x482775=_0xe773[_0x25a96f];return _0x482775;};'use strict';var _=require('lodash');var util=require(_0x3e77('0x0'));var moment=require(_0x3e77('0x1'));var BPromise=require(_0x3e77('0x2'));var rs=require(_0x3e77('0x3'));var fs=require('fs');var Redis=require(_0x3e77('0x4'));var db=require(_0x3e77('0x5'))['db'];var utils=require(_0x3e77('0x6'));var logger=require(_0x3e77('0x7'))(_0x3e77('0x8'));var config=require(_0x3e77('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3e77('0xa')][_0x3e77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294ceb,_0x40db17,_0x586e5f){return new BPromise(function(_0x1eb80a,_0x5304d6){return client[_0x3e77('0xc')](_0x294ceb,_0x586e5f)[_0x3e77('0xd')](function(_0xe54002){logger[_0x3e77('0xe')](_0x3e77('0xf'),_0x40db17,_0x3e77('0x10'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x40db17,'request\x20sent',JSON[_0x3e77('0x11')](_0xe54002));if(_0xe54002[_0x3e77('0x12')]){if(_0xe54002[_0x3e77('0x12')]['code']===0x1f4){logger[_0x3e77('0x12')](_0x3e77('0xf'),_0x40db17,_0xe54002['error']['message']);return _0x5304d6(_0xe54002[_0x3e77('0x12')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x40db17,_0xe54002[_0x3e77('0x12')][_0x3e77('0x13')]);return _0x1eb80a(_0xe54002[_0x3e77('0x12')]['message']);}else{logger[_0x3e77('0xe')](_0x3e77('0xf'),_0x40db17,'request\x20sent');_0x1eb80a(_0xe54002['result'][_0x3e77('0x13')]);}})[_0x3e77('0x14')](function(_0x42b7c7){logger[_0x3e77('0x12')](_0x3e77('0xf'),_0x40db17,_0x42b7c7);_0x5304d6(_0x42b7c7);});});} \ No newline at end of file +var _0xc48d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ba2c9,_0x5ba33b){var _0x4aaaa1=function(_0x740a87){while(--_0x740a87){_0x3ba2c9['push'](_0x3ba2c9['shift']());}};_0x4aaaa1(++_0x5ba33b);}(_0xc48d,0x11a));var _0xdc48=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc48d[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc48('0x2'));var fs=require('fs');var Redis=require(_0xdc48('0x3'));var db=require(_0xdc48('0x4'))['db'];var utils=require(_0xdc48('0x5'));var logger=require(_0xdc48('0x6'))(_0xdc48('0x7'));var config=require(_0xdc48('0x8'));var jayson=require(_0xdc48('0x9'));var client=jayson[_0xdc48('0xa')][_0xdc48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x517796,_0x1487ca,_0x44e5c1){return new BPromise(function(_0x33c834,_0x4d025a){return client[_0xdc48('0xc')](_0x517796,_0x44e5c1)[_0xdc48('0xd')](function(_0x44d7b8){logger[_0xdc48('0xe')](_0xdc48('0xf'),_0x1487ca,_0xdc48('0x10'));logger[_0xdc48('0x11')](_0xdc48('0x12'),_0x1487ca,_0xdc48('0x10'),JSON[_0xdc48('0x13')](_0x44d7b8));if(_0x44d7b8[_0xdc48('0x14')]){if(_0x44d7b8[_0xdc48('0x14')]['code']===0x1f4){logger[_0xdc48('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x1487ca,_0x44d7b8[_0xdc48('0x14')]['message']);return _0x4d025a(_0x44d7b8[_0xdc48('0x14')][_0xdc48('0x15')]);}logger[_0xdc48('0x14')](_0xdc48('0xf'),_0x1487ca,_0x44d7b8['error'][_0xdc48('0x15')]);return _0x33c834(_0x44d7b8[_0xdc48('0x14')][_0xdc48('0x15')]);}else{logger[_0xdc48('0xe')](_0xdc48('0xf'),_0x1487ca,_0xdc48('0x10'));_0x33c834(_0x44d7b8[_0xdc48('0x16')][_0xdc48('0x15')]);}})[_0xdc48('0x17')](function(_0x3914bb){logger[_0xdc48('0x14')](_0xdc48('0xf'),_0x1487ca,_0x3914bb);_0x4d025a(_0x3914bb);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bb18e8d..17c5715 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 _0x5ae0=['../../components/interaction/service','../../config/environment','util','path','express','Router'];(function(_0x4dc960,_0x30b525){var _0x3a77c3=function(_0x2f51c6){while(--_0x2f51c6){_0x4dc960['push'](_0x4dc960['shift']());}};_0x3a77c3(++_0x30b525);}(_0x5ae0,0xf8));var _0x05ae=function(_0x213978,_0x45d81b){_0x213978=_0x213978-0x0;var _0x10c1f0=_0x5ae0[_0x213978];return _0x10c1f0;};'use strict';var multer=require('multer');var util=require(_0x05ae('0x0'));var path=require(_0x05ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x05ae('0x2'));var router=express[_0x05ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x05ae('0x4'));var config=require(_0x05ae('0x5'));module['exports']=router; \ No newline at end of file +var _0x7ea9=['Router','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7ea9,0xec));var _0x97ea=function(_0x2dff94,_0x1ffe5f){_0x2dff94=_0x2dff94-0x0;var _0x558a3d=_0x7ea9[_0x2dff94];return _0x558a3d;};'use strict';var multer=require('multer');var util=require(_0x97ea('0x0'));var path=require(_0x97ea('0x1'));var timeout=require(_0x97ea('0x2'));var express=require(_0x97ea('0x3'));var router=express[_0x97ea('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x97ea('0x5'));var config=require(_0x97ea('0x6'));module[_0x97ea('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 40ffa7b..0c8ec06 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 _0x0f38=['INTEGER','sequelize','exports'];(function(_0x107f4d,_0x100ea1){var _0x2bda6c=function(_0x1d9afc){while(--_0x1d9afc){_0x107f4d['push'](_0x107f4d['shift']());}};_0x2bda6c(++_0x100ea1);}(_0x0f38,0x11e));var _0x80f3=function(_0x1efb2b,_0x1e56c7){_0x1efb2b=_0x1efb2b-0x0;var _0x2b5a4e=_0x0f38[_0x1efb2b];return _0x2b5a4e;};'use strict';var Sequelize=require(_0x80f3('0x0'));module[_0x80f3('0x1')]={'penalty':{'type':Sequelize[_0x80f3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x725b=['sequelize','INTEGER'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x725b,0x14a));var _0xb725=function(_0x56a7b3,_0x20c6e6){_0x56a7b3=_0x56a7b3-0x0;var _0x4c1ce6=_0x725b[_0x56a7b3];return _0x4c1ce6;};'use strict';var Sequelize=require(_0xb725('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb725('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 ab801c2..4a74ef2 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 _0x7524=['../../config/logger','moment','bluebird','rimraf','./userSmsQueue.attributes','exports','define','user_has_sms_queues','util'];(function(_0x217278,_0xddaee5){var _0x42ee83=function(_0x5e4118){while(--_0x5e4118){_0x217278['push'](_0x217278['shift']());}};_0x42ee83(++_0xddaee5);}(_0x7524,0xce));var _0x4752=function(_0x1aa79d,_0x22e255){_0x1aa79d=_0x1aa79d-0x0;var _0x112c9e=_0x7524[_0x1aa79d];return _0x112c9e;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var logger=require(_0x4752('0x1'))('api');var moment=require(_0x4752('0x2'));var BPromise=require(_0x4752('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4752('0x4'));var config=require('../../config/environment');var attributes=require(_0x4752('0x5'));module[_0x4752('0x6')]=function(_0x66a421,_0x55b411){return _0x66a421[_0x4752('0x7')]('UserSmsQueue',attributes,{'tableName':_0x4752('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf96b=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x54b2fc,_0x43ca61){var _0x48443f=function(_0x484923){while(--_0x484923){_0x54b2fc['push'](_0x54b2fc['shift']());}};_0x48443f(++_0x43ca61);}(_0xf96b,0x109));var _0xbf96=function(_0x13a31a,_0x148a71){_0x13a31a=_0x13a31a-0x0;var _0x14bdf4=_0xf96b[_0x13a31a];return _0x14bdf4;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var logger=require(_0xbf96('0x2'))(_0xbf96('0x3'));var moment=require(_0xbf96('0x4'));var BPromise=require(_0xbf96('0x5'));var rp=require(_0xbf96('0x6'));var fs=require('fs');var path=require(_0xbf96('0x7'));var rimraf=require(_0xbf96('0x8'));var config=require(_0xbf96('0x9'));var attributes=require(_0xbf96('0xa'));module[_0xbf96('0xb')]=function(_0x162c19,_0x4de1c3){return _0x162c19[_0xbf96('0xc')](_0xbf96('0xd'),attributes,{'tableName':_0xbf96('0xe'),'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 7e3ca3c..0a646b9 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 _0xc4fe=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util'];(function(_0x518741,_0x24fc94){var _0x549ad3=function(_0x41e765){while(--_0x41e765){_0x518741['push'](_0x518741['shift']());}};_0x549ad3(++_0x24fc94);}(_0xc4fe,0x18e));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xec4f('0x0'));var moment=require('moment');var BPromise=require(_0xec4f('0x1'));var rs=require(_0xec4f('0x2'));var fs=require('fs');var Redis=require(_0xec4f('0x3'));var db=require(_0xec4f('0x4'))['db'];var utils=require(_0xec4f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xec4f('0x6'));var client=jayson[_0xec4f('0x7')][_0xec4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x528576,_0x4dc64f,_0x226fdf){return new BPromise(function(_0x3446d0,_0x51b1eb){return client[_0xec4f('0x9')](_0x528576,_0x226fdf)['then'](function(_0x5d9525){logger[_0xec4f('0xa')](_0xec4f('0xb'),_0x4dc64f,'request\x20sent');logger[_0xec4f('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4dc64f,_0xec4f('0xd'),JSON[_0xec4f('0xe')](_0x5d9525));if(_0x5d9525[_0xec4f('0xf')]){if(_0x5d9525['error'][_0xec4f('0x10')]===0x1f4){logger[_0xec4f('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x4dc64f,_0x5d9525[_0xec4f('0xf')][_0xec4f('0x11')]);return _0x51b1eb(_0x5d9525['error'][_0xec4f('0x11')]);}logger[_0xec4f('0xf')](_0xec4f('0xb'),_0x4dc64f,_0x5d9525['error'][_0xec4f('0x11')]);return _0x3446d0(_0x5d9525[_0xec4f('0xf')][_0xec4f('0x11')]);}else{logger[_0xec4f('0xa')](_0xec4f('0xb'),_0x4dc64f,'request\x20sent');_0x3446d0(_0x5d9525[_0xec4f('0x12')][_0xec4f('0x11')]);}})['catch'](function(_0x5e1e36){logger[_0xec4f('0xf')](_0xec4f('0xb'),_0x4dc64f,_0x5e1e36);_0x51b1eb(_0x5e1e36);});});} \ No newline at end of file +var _0x05ef=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x54277c,_0x574ff8){var _0x1d1ccd=function(_0x21f712){while(--_0x21f712){_0x54277c['push'](_0x54277c['shift']());}};_0x1d1ccd(++_0x574ff8);}(_0x05ef,0xe3));var _0xf05e=function(_0x3b3331,_0x420c2f){_0x3b3331=_0x3b3331-0x0;var _0x214e10=_0x05ef[_0x3b3331];return _0x214e10;};'use strict';var _=require(_0xf05e('0x0'));var util=require(_0xf05e('0x1'));var moment=require(_0xf05e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf05e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf05e('0x4'));var logger=require(_0xf05e('0x5'))(_0xf05e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf05e('0x7'));var client=jayson[_0xf05e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb2a626,_0xc675f8,_0x11fe11){return new BPromise(function(_0x230047,_0x48c513){return client[_0xf05e('0x9')](_0xb2a626,_0x11fe11)[_0xf05e('0xa')](function(_0x3197fc){logger[_0xf05e('0xb')](_0xf05e('0xc'),_0xc675f8,'request\x20sent');logger[_0xf05e('0xd')](_0xf05e('0xe'),_0xc675f8,_0xf05e('0xf'),JSON[_0xf05e('0x10')](_0x3197fc));if(_0x3197fc[_0xf05e('0x11')]){if(_0x3197fc[_0xf05e('0x11')][_0xf05e('0x12')]===0x1f4){logger[_0xf05e('0x11')](_0xf05e('0xc'),_0xc675f8,_0x3197fc[_0xf05e('0x11')][_0xf05e('0x13')]);return _0x48c513(_0x3197fc['error'][_0xf05e('0x13')]);}logger[_0xf05e('0x11')](_0xf05e('0xc'),_0xc675f8,_0x3197fc[_0xf05e('0x11')]['message']);return _0x230047(_0x3197fc[_0xf05e('0x11')]['message']);}else{logger[_0xf05e('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0xc675f8,_0xf05e('0xf'));_0x230047(_0x3197fc[_0xf05e('0x14')][_0xf05e('0x13')]);}})[_0xf05e('0x15')](function(_0x44abeb){logger[_0xf05e('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xc675f8,_0x44abeb);_0x48c513(_0x44abeb);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 992e690..486dd3e 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 _0xa6b0=['multer','util','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x1d9481,_0x4a4793){var _0x5f31d7=function(_0x348469){while(--_0x348469){_0x1d9481['push'](_0x1d9481['shift']());}};_0x5f31d7(++_0x4a4793);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x51efa5,_0x3e3803){_0x51efa5=_0x51efa5-0x0;var _0x4fcfa0=_0xa6b0[_0x51efa5];return _0x4fcfa0;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var auth=require(_0x0a6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a6b('0x5'));module[_0x0a6b('0x6')]=router; \ No newline at end of file +var _0x975b=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer','util'];(function(_0x385b46,_0x59434b){var _0x2e2c7d=function(_0x3f1572){while(--_0x3f1572){_0x385b46['push'](_0x385b46['shift']());}};_0x2e2c7d(++_0x59434b);}(_0x975b,0x1c9));var _0xb975=function(_0x503ace,_0x2531b5){_0x503ace=_0x503ace-0x0;var _0x3a3649=_0x975b[_0x503ace];return _0x3a3649;};'use strict';var multer=require(_0xb975('0x0'));var util=require(_0xb975('0x1'));var path=require(_0xb975('0x2'));var timeout=require(_0xb975('0x3'));var express=require(_0xb975('0x4'));var router=express[_0xb975('0x5')]();var auth=require(_0xb975('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb975('0x7'));module[_0xb975('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a0d2d1f..47c7a12 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 _0x95f3=['exports','sequelize'];(function(_0x13b2cb,_0x5bbcbd){var _0x25679d=function(_0xf2b294){while(--_0xf2b294){_0x13b2cb['push'](_0x13b2cb['shift']());}};_0x25679d(++_0x5bbcbd);}(_0x95f3,0x177));var _0x395f=function(_0x2142ea,_0x5a8f39){_0x2142ea=_0x2142ea-0x0;var _0x53e2a9=_0x95f3[_0x2142ea];return _0x53e2a9;};'use strict';var Sequelize=require(_0x395f('0x0'));module[_0x395f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ede=['INTEGER','sequelize','exports'];(function(_0x1951e9,_0x445dc6){var _0x2b3cd5=function(_0x3f0346){while(--_0x3f0346){_0x1951e9['push'](_0x1951e9['shift']());}};_0x2b3cd5(++_0x445dc6);}(_0x4ede,0x1cf));var _0xe4ed=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4ede[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xe4ed('0x0'));module[_0xe4ed('0x1')]={'penalty':{'type':Sequelize[_0xe4ed('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index d119052..5ca56f8 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 _0x005c=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x5e3b74,_0x47be8d){var _0x3b162b=function(_0x3ab751){while(--_0x3ab751){_0x5e3b74['push'](_0x5e3b74['shift']());}};_0x3b162b(++_0x47be8d);}(_0x005c,0x178));var _0xc005=function(_0x35e0eb,_0x5bf0d6){_0x35e0eb=_0x35e0eb-0x0;var _0x17b180=_0x005c[_0x35e0eb];return _0x17b180;};'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(_0xc005('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc005('0x7'));var config=require(_0xc005('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xc005('0x9')]=function(_0x152333,_0x323eb6){return _0x152333[_0xc005('0xa')](_0xc005('0xb'),attributes,{'tableName':_0xc005('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fee=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3fee,0xe3));var _0xe3fe=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3fee[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xe3fe('0x0'));var util=require(_0xe3fe('0x1'));var logger=require(_0xe3fe('0x2'))('api');var moment=require(_0xe3fe('0x3'));var BPromise=require(_0xe3fe('0x4'));var rp=require(_0xe3fe('0x5'));var fs=require('fs');var path=require(_0xe3fe('0x6'));var rimraf=require(_0xe3fe('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3fe('0x8'));module[_0xe3fe('0x9')]=function(_0x3862ed,_0xd7705e){return _0x3862ed[_0xe3fe('0xa')](_0xe3fe('0xb'),attributes,{'tableName':'user_has_voice_queues','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 9ef0c24..d338739 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 _0x67c7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird'];(function(_0x39649f,_0x4e0e87){var _0x4edf8a=function(_0x502901){while(--_0x502901){_0x39649f['push'](_0x39649f['shift']());}};_0x4edf8a(++_0x4e0e87);}(_0x67c7,0x1a0));var _0x767c=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0x67c7[_0x3d18af];return _0x2ef919;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x767c('0x0'));var BPromise=require(_0x767c('0x1'));var rs=require(_0x767c('0x2'));var fs=require('fs');var Redis=require(_0x767c('0x3'));var db=require(_0x767c('0x4'))['db'];var utils=require(_0x767c('0x5'));var logger=require(_0x767c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x767c('0x7'));var client=jayson[_0x767c('0x8')][_0x767c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x397b61,_0x45cd42,_0x1cbf72){return new BPromise(function(_0x263509,_0x555656){return client[_0x767c('0xa')](_0x397b61,_0x1cbf72)['then'](function(_0x5cfd3f){logger['info'](_0x767c('0xb'),_0x45cd42,'request\x20sent');logger[_0x767c('0xc')](_0x767c('0xd'),_0x45cd42,'request\x20sent',JSON[_0x767c('0xe')](_0x5cfd3f));if(_0x5cfd3f[_0x767c('0xf')]){if(_0x5cfd3f[_0x767c('0xf')][_0x767c('0x10')]===0x1f4){logger[_0x767c('0xf')](_0x767c('0xb'),_0x45cd42,_0x5cfd3f[_0x767c('0xf')]['message']);return _0x555656(_0x5cfd3f[_0x767c('0xf')]['message']);}logger['error'](_0x767c('0xb'),_0x45cd42,_0x5cfd3f[_0x767c('0xf')][_0x767c('0x11')]);return _0x263509(_0x5cfd3f[_0x767c('0xf')]['message']);}else{logger['info'](_0x767c('0xb'),_0x45cd42,'request\x20sent');_0x263509(_0x5cfd3f['result'][_0x767c('0x11')]);}})[_0x767c('0x12')](function(_0x97072f){logger[_0x767c('0xf')](_0x767c('0xb'),_0x45cd42,_0x97072f);_0x555656(_0x97072f);});});} \ No newline at end of file +var _0x84e1=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x2097fa,_0xc58152){var _0x4e87c5=function(_0x441f0c){while(--_0x441f0c){_0x2097fa['push'](_0x2097fa['shift']());}};_0x4e87c5(++_0xc58152);}(_0x84e1,0x1dc));var _0x184e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x84e1[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var moment=require(_0x184e('0x2'));var BPromise=require(_0x184e('0x3'));var rs=require(_0x184e('0x4'));var fs=require('fs');var Redis=require(_0x184e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x184e('0x6'));var logger=require(_0x184e('0x7'))(_0x184e('0x8'));var config=require(_0x184e('0x9'));var jayson=require(_0x184e('0xa'));var client=jayson[_0x184e('0xb')][_0x184e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ad2c3,_0x3f24d3,_0xa32654){return new BPromise(function(_0x1e79b2,_0x4b6204){return client[_0x184e('0xd')](_0x4ad2c3,_0xa32654)[_0x184e('0xe')](function(_0x22af83){logger[_0x184e('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x3f24d3,_0x184e('0x10'));logger[_0x184e('0x11')](_0x184e('0x12'),_0x3f24d3,_0x184e('0x10'),JSON[_0x184e('0x13')](_0x22af83));if(_0x22af83[_0x184e('0x14')]){if(_0x22af83[_0x184e('0x14')][_0x184e('0x15')]===0x1f4){logger[_0x184e('0x14')](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x4b6204(_0x22af83['error'][_0x184e('0x17')]);}logger['error'](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x1e79b2(_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);}else{logger[_0x184e('0xf')](_0x184e('0x16'),_0x3f24d3,_0x184e('0x10'));_0x1e79b2(_0x22af83[_0x184e('0x18')]['message']);}})[_0x184e('0x19')](function(_0x5d3a36){logger[_0x184e('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x3f24d3,_0x5d3a36);_0x4b6204(_0x5d3a36);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 98fc707..957b8d5 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 _0x3f8a=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x57cd2e,_0x5f1566){_0x57cd2e=_0x57cd2e-0x0;var _0x5d50bd=_0x3f8a[_0x57cd2e];return _0x5d50bd;};'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 auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));module[_0xa3f8('0x8')]=router; \ No newline at end of file +var _0x0f80=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x401b3e,_0xed8de5){var _0x4f290f=function(_0xa45f77){while(--_0xa45f77){_0x401b3e['push'](_0x401b3e['shift']());}};_0x4f290f(++_0xed8de5);}(_0x0f80,0x108));var _0x00f8=function(_0x2fab84,_0x8e020e){_0x2fab84=_0x2fab84-0x0;var _0x45a672=_0x0f80[_0x2fab84];return _0x45a672;};'use strict';var multer=require('multer');var util=require(_0x00f8('0x0'));var path=require(_0x00f8('0x1'));var timeout=require(_0x00f8('0x2'));var express=require(_0x00f8('0x3'));var router=express[_0x00f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x00f8('0x5'));var config=require(_0x00f8('0x6'));module[_0x00f8('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 d2cd592..d241b60 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 _0x6895=['Required\x20by\x20Asterisk','queue_interface','STRING','sequelize','exports','INTEGER'];(function(_0x5700e0,_0x4cf173){var _0x4d7ded=function(_0x3b5bc4){while(--_0x3b5bc4){_0x5700e0['push'](_0x5700e0['shift']());}};_0x4d7ded(++_0x4cf173);}(_0x6895,0x15f));var _0x5689=function(_0x24ae72,_0x23174c){_0x24ae72=_0x24ae72-0x0;var _0x33c538=_0x6895[_0x24ae72];return _0x33c538;};'use strict';var Sequelize=require(_0x5689('0x0'));module[_0x5689('0x1')]={'uniqueid':{'type':Sequelize[_0x5689('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5689('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x5689('0x3')},'UserId':{'type':Sequelize[_0x5689('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5689('0x4'),'comment':_0x5689('0x3')},'VoiceQueueId':{'type':Sequelize[_0x5689('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x5689('0x5')],'allowNull':![],'unique':'queue_interface','comment':_0x5689('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x5689('0x3')},'paused':{'type':Sequelize[_0x5689('0x2')](0xb),'defaultValue':0x0,'comment':_0x5689('0x3')}}; \ No newline at end of file +var _0xccbc=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x2bf19b,_0x406e7a){var _0x513bad=function(_0x243fc9){while(--_0x243fc9){_0x2bf19b['push'](_0x2bf19b['shift']());}};_0x513bad(++_0x406e7a);}(_0xccbc,0x1d6));var _0xcccb=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xccbc[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xcccb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcccb('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xcccb('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xcccb('0x2')},'UserId':{'type':Sequelize[_0xcccb('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcccb('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xcccb('0x2')},'VoiceQueueId':{'type':Sequelize[_0xcccb('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xcccb('0x3')],'allowNull':![],'unique':_0xcccb('0x4'),'comment':_0xcccb('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcccb('0x2')},'paused':{'type':Sequelize[_0xcccb('0x1')](0xb),'defaultValue':0x0,'comment':_0xcccb('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 307dc43..1f44327 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 _0x9ffd=['events','../../mysqldb','UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x998751,_0x5b0e95){var _0x170104=function(_0x31e888){while(--_0x31e888){_0x998751['push'](_0x998751['shift']());}};_0x170104(++_0x5b0e95);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b088f,_0x458037){_0x5b088f=_0x5b088f-0x0;var _0x40743a=_0x9ffd[_0x5b088f];return _0x40743a;};'use strict';var EventEmitter=require(_0xd9ff('0x0'));var UserVoiceQueueRt=require(_0xd9ff('0x1'))['db'][_0xd9ff('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ff('0x3'),'afterUpdate':_0xd9ff('0x4'),'afterDestroy':_0xd9ff('0x5')};function emitEvent(_0x5493ae){return function(_0x53e962,_0x1c9460,_0x111697){UserVoiceQueueRtEvents['emit'](_0x5493ae+':'+_0x53e962['id'],_0x53e962);UserVoiceQueueRtEvents[_0xd9ff('0x6')](_0x5493ae,_0x53e962);_0x111697(null);};}for(var e in events){if(events[_0xd9ff('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xd9ff('0x8')](e,emitEvent(event));}}module[_0xd9ff('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3423=['remove','emit','hasOwnProperty','hook','exports','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x3342('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3342('0x1')](0x0);var events={'afterCreate':_0x3342('0x2'),'afterUpdate':_0x3342('0x3'),'afterDestroy':_0x3342('0x4')};function emitEvent(_0x28aad1){return function(_0x2207ce,_0x3c5d8d,_0x3075f8){UserVoiceQueueRtEvents[_0x3342('0x5')](_0x28aad1+':'+_0x2207ce['id'],_0x2207ce);UserVoiceQueueRtEvents[_0x3342('0x5')](_0x28aad1,_0x2207ce);_0x3075f8(null);};}for(var e in events){if(events[_0x3342('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x3342('0x7')](e,emitEvent(event));}}module[_0x3342('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b238214..e507779 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 _0xf6a3=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','lodash','util'];(function(_0xf52c2f,_0xf15ecf){var _0x32e985=function(_0x5e3085){while(--_0x5e3085){_0xf52c2f['push'](_0xf52c2f['shift']());}};_0x32e985(++_0xf15ecf);}(_0xf6a3,0x1de));var _0x3f6a=function(_0x4c3c1f,_0x1f9a7e){_0x4c3c1f=_0x4c3c1f-0x0;var _0x1883f1=_0xf6a3[_0x4c3c1f];return _0x1883f1;};'use strict';var _=require(_0x3f6a('0x0'));var util=require(_0x3f6a('0x1'));var logger=require(_0x3f6a('0x2'))('api');var moment=require(_0x3f6a('0x3'));var BPromise=require(_0x3f6a('0x4'));var rp=require(_0x3f6a('0x5'));var fs=require('fs');var path=require(_0x3f6a('0x6'));var rimraf=require(_0x3f6a('0x7'));var config=require(_0x3f6a('0x8'));var attributes=require(_0x3f6a('0x9'));module['exports']=function(_0x127e85,_0x298b10){return _0x127e85[_0x3f6a('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x3f6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89d0=['api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x196d9a,_0xd56296){var _0x5ca3c0=function(_0x28a26f){while(--_0x28a26f){_0x196d9a['push'](_0x196d9a['shift']());}};_0x5ca3c0(++_0xd56296);}(_0x89d0,0x1ae));var _0x089d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x89d0[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x089d('0x0'));var moment=require(_0x089d('0x1'));var BPromise=require(_0x089d('0x2'));var rp=require(_0x089d('0x3'));var fs=require('fs');var path=require(_0x089d('0x4'));var rimraf=require('rimraf');var config=require(_0x089d('0x5'));var attributes=require(_0x089d('0x6'));module['exports']=function(_0x449f89,_0x58ea41){return _0x449f89[_0x089d('0x7')](_0x089d('0x8'),attributes,{'tableName':_0x089d('0x9'),'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 4abf0af..47426a9 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 _0xcdf2=['literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','UserVoiceQueueRt','options','raw','where','COUNT','sequelize'];(function(_0x434b9c,_0x1a460a){var _0x39c455=function(_0x206b3b){while(--_0x206b3b){_0x434b9c['push'](_0x434b9c['shift']());}};_0x39c455(++_0x1a460a);}(_0xcdf2,0x15b));var _0x2cdf=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xcdf2[_0x4f6d08];return _0x53a9c6;};'use strict';var _=require('lodash');var util=require(_0x2cdf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2cdf('0x1'));var fs=require('fs');var Redis=require(_0x2cdf('0x2'));var db=require(_0x2cdf('0x3'))['db'];var utils=require(_0x2cdf('0x4'));var logger=require(_0x2cdf('0x5'))(_0x2cdf('0x6'));var config=require(_0x2cdf('0x7'));var jayson=require(_0x2cdf('0x8'));var client=jayson[_0x2cdf('0x9')][_0x2cdf('0xa')]({'port':0x232a});config[_0x2cdf('0xb')]=_[_0x2cdf('0xc')](config['redis'],{'host':_0x2cdf('0xd'),'port':0x18eb});var socket=require(_0x2cdf('0xe'))(new Redis(config[_0x2cdf('0xb')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x406f14,_0x446a7b,_0x23ac6d){return new BPromise(function(_0x245cd6,_0x1f3e86){return client[_0x2cdf('0xf')](_0x406f14,_0x23ac6d)[_0x2cdf('0x10')](function(_0xf7b7d2){logger[_0x2cdf('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x446a7b,_0x2cdf('0x12'));logger[_0x2cdf('0x13')](_0x2cdf('0x14'),_0x446a7b,'request\x20sent',JSON[_0x2cdf('0x15')](_0xf7b7d2));if(_0xf7b7d2[_0x2cdf('0x16')]){if(_0xf7b7d2[_0x2cdf('0x16')][_0x2cdf('0x17')]===0x1f4){logger[_0x2cdf('0x16')](_0x2cdf('0x18'),_0x446a7b,_0xf7b7d2['error'][_0x2cdf('0x19')]);return _0x1f3e86(_0xf7b7d2[_0x2cdf('0x16')][_0x2cdf('0x19')]);}logger[_0x2cdf('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x446a7b,_0xf7b7d2[_0x2cdf('0x16')]['message']);return _0x245cd6(_0xf7b7d2[_0x2cdf('0x16')][_0x2cdf('0x19')]);}else{logger[_0x2cdf('0x11')](_0x2cdf('0x18'),_0x446a7b,'request\x20sent');_0x245cd6(_0xf7b7d2[_0x2cdf('0x1a')][_0x2cdf('0x19')]);}})['catch'](function(_0x2d140f){logger[_0x2cdf('0x16')](_0x2cdf('0x18'),_0x446a7b,_0x2d140f);_0x1f3e86(_0x2d140f);});});}exports['GetVoiceQueueRtPauses']=function(_0x1638d5){var _0x4ef3c3=this;return new Promise(function(_0x51e9b2,_0x5ec1b3){return db[_0x2cdf('0x1b')]['findAll']({'raw':_0x1638d5[_0x2cdf('0x1c')]?_0x1638d5['options'][_0x2cdf('0x1d')]===undefined?!![]:![]:!![],'where':_0x1638d5['options']?_0x1638d5[_0x2cdf('0x1c')][_0x2cdf('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2cdf('0x1f'),db[_0x2cdf('0x20')]['fn']('IF',db[_0x2cdf('0x20')][_0x2cdf('0x21')](_0x2cdf('0x22')))),_0x2cdf('0x23')]]})[_0x2cdf('0x10')](function(_0x5886ca){logger[_0x2cdf('0x11')]('GetVoiceQueueRtPauses',_0x1638d5);logger[_0x2cdf('0x13')](_0x2cdf('0x24'),_0x1638d5,JSON['stringify'](_0x5886ca));_0x51e9b2(_0x5886ca);})[_0x2cdf('0x25')](function(_0x46c29f){logger[_0x2cdf('0x16')](_0x2cdf('0x24'),_0x46c29f[_0x2cdf('0x19')],_0x1638d5);_0x5ec1b3(_0x4ef3c3[_0x2cdf('0x16')](0x1f4,_0x46c29f[_0x2cdf('0x19')]));});});}; \ No newline at end of file +var _0xcd75=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x10f7e3,_0x3002a4){var _0x1b76f6=function(_0x2c0252){while(--_0x2c0252){_0x10f7e3['push'](_0x10f7e3['shift']());}};_0x1b76f6(++_0x3002a4);}(_0xcd75,0x112));var _0x5cd7=function(_0x57fe50,_0x56c1c0){_0x57fe50=_0x57fe50-0x0;var _0x428fef=_0xcd75[_0x57fe50];return _0x428fef;};'use strict';var _=require(_0x5cd7('0x0'));var util=require(_0x5cd7('0x1'));var moment=require('moment');var BPromise=require(_0x5cd7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cd7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5cd7('0x4'));var logger=require(_0x5cd7('0x5'))('rpc');var config=require(_0x5cd7('0x6'));var jayson=require(_0x5cd7('0x7'));var client=jayson[_0x5cd7('0x8')][_0x5cd7('0x9')]({'port':0x232a});config['redis']=_[_0x5cd7('0xa')](config[_0x5cd7('0xb')],{'host':_0x5cd7('0xc'),'port':0x18eb});var socket=require(_0x5cd7('0xd'))(new Redis(config[_0x5cd7('0xb')]));require('./userVoiceQueueRt.socket')[_0x5cd7('0xe')](socket);function respondWithRpcPromise(_0x218929,_0x2afffc,_0x4f0089){return new BPromise(function(_0x17cb1b,_0x4f9ad0){return client[_0x5cd7('0xf')](_0x218929,_0x4f0089)[_0x5cd7('0x10')](function(_0x3e7c18){logger[_0x5cd7('0x11')](_0x5cd7('0x12'),_0x2afffc,_0x5cd7('0x13'));logger[_0x5cd7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2afffc,'request\x20sent',JSON[_0x5cd7('0x15')](_0x3e7c18));if(_0x3e7c18[_0x5cd7('0x16')]){if(_0x3e7c18[_0x5cd7('0x16')]['code']===0x1f4){logger[_0x5cd7('0x16')](_0x5cd7('0x12'),_0x2afffc,_0x3e7c18['error'][_0x5cd7('0x17')]);return _0x4f9ad0(_0x3e7c18['error']['message']);}logger['error'](_0x5cd7('0x12'),_0x2afffc,_0x3e7c18[_0x5cd7('0x16')]['message']);return _0x17cb1b(_0x3e7c18['error'][_0x5cd7('0x17')]);}else{logger[_0x5cd7('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2afffc,_0x5cd7('0x13'));_0x17cb1b(_0x3e7c18['result'][_0x5cd7('0x17')]);}})['catch'](function(_0x4c25be){logger[_0x5cd7('0x16')](_0x5cd7('0x12'),_0x2afffc,_0x4c25be);_0x4f9ad0(_0x4c25be);});});}exports[_0x5cd7('0x18')]=function(_0x17a4e6){var _0xa7676a=this;return new Promise(function(_0x1d476f,_0x2397b2){return db['UserVoiceQueueRt'][_0x5cd7('0x19')]({'raw':_0x17a4e6[_0x5cd7('0x1a')]?_0x17a4e6[_0x5cd7('0x1a')][_0x5cd7('0x1b')]===undefined?!![]:![]:!![],'where':_0x17a4e6[_0x5cd7('0x1a')]?_0x17a4e6[_0x5cd7('0x1a')][_0x5cd7('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x5cd7('0x1d'),db[_0x5cd7('0x1e')]['fn']('IF',db[_0x5cd7('0x1e')][_0x5cd7('0x1f')](_0x5cd7('0x20')))),_0x5cd7('0x21')]]})[_0x5cd7('0x10')](function(_0x3868b5){logger[_0x5cd7('0x11')](_0x5cd7('0x18'),_0x17a4e6);logger[_0x5cd7('0x14')]('GetVoiceQueueRtPauses',_0x17a4e6,JSON[_0x5cd7('0x15')](_0x3868b5));_0x1d476f(_0x3868b5);})[_0x5cd7('0x22')](function(_0x253783){logger[_0x5cd7('0x16')](_0x5cd7('0x18'),_0x253783[_0x5cd7('0x17')],_0x17a4e6);_0x2397b2(_0xa7676a['error'](0x1f4,_0x253783[_0x5cd7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5e7db0f..755436d 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 _0xf494=['save','remove','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x2eb1b1,_0x13beeb){var _0x11c99e=function(_0x3117eb){while(--_0x3117eb){_0x2eb1b1['push'](_0x2eb1b1['shift']());}};_0x11c99e(++_0x13beeb);}(_0xf494,0x1c6));var _0x4f49=function(_0x1118aa,_0x53ce81){_0x1118aa=_0x1118aa-0x0;var _0x3153b2=_0xf494[_0x1118aa];return _0x3153b2;};'use strict';var UserVoiceQueueRtEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){UserVoiceQueueRtEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);UserVoiceQueueRtEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0x7dfd=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x25b198,_0x569f21){var _0x5ec13a=function(_0x565583){while(--_0x565583){_0x25b198['push'](_0x25b198['shift']());}};_0x5ec13a(++_0x569f21);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd7df('0x0'));var events=[_0xd7df('0x1'),_0xd7df('0x2'),_0xd7df('0x3')];function createListener(_0x346f5f,_0x28c3c9){return function(_0x176418){_0x28c3c9[_0xd7df('0x4')](_0x346f5f,_0x176418);};}function removeListener(_0x3ef231,_0x3d8c5a){return function(){UserVoiceQueueRtEvents[_0xd7df('0x5')](_0x3ef231,_0x3d8c5a);};}exports[_0xd7df('0x6')]=function(_0x36cf0f){for(var _0x39ce98=0x0,_0x354ea7=events[_0xd7df('0x7')];_0x39ce98<_0x354ea7;_0x39ce98++){var _0x2c48a4=events[_0x39ce98];var _0x5c220a=createListener(_0xd7df('0x8')+_0x2c48a4,_0x36cf0f);UserVoiceQueueRtEvents['on'](_0x2c48a4,_0x5c220a);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 6e9caad..1319d69 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 _0xbdb7=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','post','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2dd0f1,_0x207d6e){var _0x28a3e5=function(_0x2cb49b){while(--_0x2cb49b){_0x2dd0f1['push'](_0x2dd0f1['shift']());}};_0x28a3e5(++_0x207d6e);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x381606,_0x53382c){_0x381606=_0x381606-0x0;var _0x31c4ca=_0xbdb7[_0x381606];return _0x31c4ca;};'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 auth=require(_0x7bdb('0x6'));var interaction=require(_0x7bdb('0x7'));var config=require(_0x7bdb('0x8'));var controller=require('./variable.controller');router[_0x7bdb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7bdb('0x9')](_0x7bdb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7bdb('0xb')]('/',auth[_0x7bdb('0xc')](),controller['create']);router['put'](_0x7bdb('0xa'),auth[_0x7bdb('0xc')](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')](_0x7bdb('0xa'),auth[_0x7bdb('0xc')](),controller[_0x7bdb('0xf')]);module[_0x7bdb('0x10')]=router; \ No newline at end of file +var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x662cbc,_0x3c749e){var _0x507f0e=function(_0x36fe15){while(--_0x36fe15){_0x662cbc['push'](_0x662cbc['shift']());}};_0x507f0e(++_0x3c749e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x59912d,_0x4784c7){_0x59912d=_0x59912d-0x0;var _0x539fd9=_0xec56[_0x59912d];return _0x539fd9;};'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 auth=require(_0x6ec5('0x4'));var interaction=require(_0x6ec5('0x5'));var config=require(_0x6ec5('0x6'));var controller=require(_0x6ec5('0x7'));router[_0x6ec5('0x8')]('/',auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xa')]);router[_0x6ec5('0x8')](_0x6ec5('0xb'),auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xc')]);router[_0x6ec5('0xd')]('/',auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xe')]);router[_0x6ec5('0xf')](_0x6ec5('0xb'),auth['isAuthenticated'](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xb'),auth[_0x6ec5('0x9')](),controller[_0x6ec5('0x12')]);module[_0x6ec5('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 9e2de4f..ccab579 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 _0x3e0c=['exports','STRING','sequelize'];(function(_0x2d2052,_0x218946){var _0x45d390=function(_0x52c631){while(--_0x52c631){_0x2d2052['push'](_0x2d2052['shift']());}};_0x45d390(++_0x218946);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0x3e0c[_0x599c94];return _0x34e215;};'use strict';var Sequelize=require(_0xc3e0('0x0'));module[_0xc3e0('0x1')]={'name':{'type':Sequelize[_0xc3e0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc3e0('0x2')]}}; \ No newline at end of file +var _0xd2ca=['sequelize','STRING'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xd2ca,0x15a));var _0xad2c=function(_0x31f0c6,_0x2bc9aa){_0x31f0c6=_0x31f0c6-0x0;var _0x37fcd5=_0xd2ca[_0x31f0c6];return _0x37fcd5;};'use strict';var Sequelize=require(_0xad2c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xad2c('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index fdee57f..20f2ece 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 _0xd25a=['show','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','apply','update','then','destroy','Variables','UserProfileResource','error','name','index','Variable','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','field','count','includeAll','include','findAll','rows','catch'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0xd25a,0x1d4));var _0xad25=function(_0x352b56,_0x13936b){_0x352b56=_0x352b56-0x0;var _0x12456d=_0xd25a[_0x352b56];return _0x12456d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xad25('0x0'));var rimraf=require(_0xad25('0x1'));var zipdir=require(_0xad25('0x2'));var jsonpatch=require(_0xad25('0x3'));var rp=require(_0xad25('0x4'));var moment=require('moment');var BPromise=require(_0xad25('0x5'));var Mustache=require(_0xad25('0x6'));var util=require(_0xad25('0x7'));var path=require('path');var sox=require(_0xad25('0x8'));var csv=require(_0xad25('0x9'));var ejs=require(_0xad25('0xa'));var fs=require('fs');var _=require(_0xad25('0xb'));var squel=require(_0xad25('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xad25('0xd'));var toCsv=require(_0xad25('0x9'));var querystring=require(_0xad25('0xe'));var Papa=require(_0xad25('0xf'));var Redis=require(_0xad25('0x10'));var authService=require(_0xad25('0x11'));var qs=require(_0xad25('0x12'));var hardwareService=require(_0xad25('0x13'));var logger=require(_0xad25('0x14'))(_0xad25('0x15'));var utils=require(_0xad25('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31e683,_0x10925d){_0x10925d=_0x10925d||0xcc;return function(_0x1c166a){if(_0x1c166a){return _0x31e683[_0xad25('0x17')](_0x10925d);}return _0x31e683['status'](_0x10925d)[_0xad25('0x18')]();};}function respondWithResult(_0x21f737,_0x2238b0){_0x2238b0=_0x2238b0||0xc8;return function(_0x50801c){if(_0x50801c){return _0x21f737[_0xad25('0x19')](_0x2238b0)[_0xad25('0x1a')](_0x50801c);}};}function respondWithFilteredResult(_0x41eed2,_0x41dc9b){return function(_0x5e5785){if(_0x5e5785){var _0x5c1d4f=_0x5e5785['count'],_0x3f2589=_0x41dc9b[_0xad25('0x1b')],_0x301e31=_0x41dc9b['offset']+_0x41dc9b[_0xad25('0x1c')],_0x3aba62;if(_0x301e31>=_0x5c1d4f){_0x301e31=_0x5c1d4f;_0x3aba62=0xc8;}else{_0x3aba62=0xce;}_0x41eed2[_0xad25('0x19')](_0x3aba62);return _0x41eed2['set']('Content-Range',_0x3f2589+'-'+_0x301e31+'/'+_0x5c1d4f)['json'](_0x5e5785);}return null;};}function patchUpdates(_0x5e75f4){return function(_0x53de54){try{jsonpatch[_0xad25('0x1d')](_0x53de54,_0x5e75f4,!![]);}catch(_0x3cf4ec){return BPromise['reject'](_0x3cf4ec);}return _0x53de54['save']();};}function saveUpdates(_0x27cac4,_0x55ec63){return function(_0x26035b){if(_0x26035b){return _0x26035b[_0xad25('0x1e')](_0x27cac4)[_0xad25('0x1f')](function(_0x1fb7b6){return _0x1fb7b6;});}return null;};}function removeEntity(_0x1ce5e9,_0x3bc0a3){return function(_0xb9e9ce){if(_0xb9e9ce){return _0xb9e9ce[_0xad25('0x20')]()['then'](function(){var _0x38950a=_0xb9e9ce['get']({'plain':!![]});var _0x21d6a3=_0xad25('0x21');return db[_0xad25('0x22')][_0xad25('0x20')]({'where':{'type':_0x21d6a3,'resourceId':_0x38950a['id']}})[_0xad25('0x1f')](function(){return _0xb9e9ce;});})[_0xad25('0x1f')](function(){_0x1ce5e9[_0xad25('0x19')](0xcc)[_0xad25('0x18')]();});}};}function handleEntityNotFound(_0x5661a3,_0x51a1ca){return function(_0x5e3580){if(!_0x5e3580){_0x5661a3[_0xad25('0x17')](0x194);}return _0x5e3580;};}function handleError(_0x518eb2,_0x2e05bc){_0x2e05bc=_0x2e05bc||0x1f4;return function(_0x19b225){logger[_0xad25('0x23')](_0x19b225['stack']);if(_0x19b225[_0xad25('0x24')]){delete _0x19b225['name'];}_0x518eb2['status'](_0x2e05bc)['send'](_0x19b225);};}exports[_0xad25('0x25')]=function(_0x27d366,_0x346ab5){var _0x45d2cd={},_0x5849f5={},_0x490c29={'count':0x0,'rows':[]};var _0x57da35=db[_0xad25('0x26')][_0xad25('0x27')];_0x5849f5[_0xad25('0x28')]=_[_0xad25('0x29')](_0x57da35);_0x5849f5['query']=_[_0xad25('0x29')](_0x27d366[_0xad25('0x2a')]);_0x5849f5[_0xad25('0x2b')]=_['intersection'](_0x5849f5[_0xad25('0x28')],_0x5849f5['query']);_0x45d2cd['attributes']=_[_0xad25('0x2c')](_0x5849f5[_0xad25('0x28')],qs[_0xad25('0x2d')](_0x27d366[_0xad25('0x2a')][_0xad25('0x2d')]));_0x45d2cd[_0xad25('0x2e')]=_0x45d2cd[_0xad25('0x2e')][_0xad25('0x2f')]?_0x45d2cd['attributes']:_0x5849f5[_0xad25('0x28')];if(!_0x27d366[_0xad25('0x2a')][_0xad25('0x30')](_0xad25('0x31'))){_0x45d2cd[_0xad25('0x1c')]=qs[_0xad25('0x1c')](_0x27d366[_0xad25('0x2a')]['limit']);_0x45d2cd[_0xad25('0x1b')]=qs[_0xad25('0x1b')](_0x27d366[_0xad25('0x2a')][_0xad25('0x1b')]);}_0x45d2cd['order']=qs[_0xad25('0x32')](_0x27d366[_0xad25('0x2a')][_0xad25('0x32')]);_0x45d2cd[_0xad25('0x33')]=qs[_0xad25('0x2b')](_[_0xad25('0x34')](_0x27d366['query'],_0x5849f5[_0xad25('0x2b')]));if(_0x27d366['query'][_0xad25('0x35')]){_0x45d2cd[_0xad25('0x33')]=_[_0xad25('0x36')](_0x45d2cd['where'],{'$or':_['map'](_0x57da35,function(_0x39af15){if(_0x39af15[_0xad25('0x37')][_0xad25('0x38')]!=='VIRTUAL'){var _0x19100c={};_0x19100c[_0x39af15[_0xad25('0x39')]]={'$like':'%'+_0x27d366[_0xad25('0x2a')]['filter']+'%'};return _0x19100c;}})});}_0x45d2cd=_['merge']({},_0x45d2cd,_0x27d366['options']);var _0x39375e={'where':_0x45d2cd[_0xad25('0x33')]};return db['Variable'][_0xad25('0x3a')](_0x39375e)['then'](function(_0x2ac2fd){_0x490c29['count']=_0x2ac2fd;if(_0x27d366['query'][_0xad25('0x3b')]){_0x45d2cd[_0xad25('0x3c')]=[{'all':!![]}];}return db[_0xad25('0x26')][_0xad25('0x3d')](_0x45d2cd);})[_0xad25('0x1f')](function(_0x2fe113){_0x490c29[_0xad25('0x3e')]=_0x2fe113;return _0x490c29;})[_0xad25('0x1f')](respondWithFilteredResult(_0x346ab5,_0x45d2cd))[_0xad25('0x3f')](handleError(_0x346ab5,null));};exports[_0xad25('0x40')]=function(_0x49545d,_0x662b06){var _0x152e5c={'raw':!![],'where':{'id':_0x49545d['params']['id']}},_0x54e8cd={};_0x54e8cd['model']=_[_0xad25('0x29')](db[_0xad25('0x26')][_0xad25('0x27')]);_0x54e8cd['query']=_[_0xad25('0x29')](_0x49545d[_0xad25('0x2a')]);_0x54e8cd[_0xad25('0x2b')]=_[_0xad25('0x2c')](_0x54e8cd[_0xad25('0x28')],_0x54e8cd['query']);_0x152e5c['attributes']=_[_0xad25('0x2c')](_0x54e8cd['model'],qs[_0xad25('0x2d')](_0x49545d[_0xad25('0x2a')][_0xad25('0x2d')]));_0x152e5c[_0xad25('0x2e')]=_0x152e5c[_0xad25('0x2e')][_0xad25('0x2f')]?_0x152e5c[_0xad25('0x2e')]:_0x54e8cd['model'];if(_0x49545d[_0xad25('0x2a')]['includeAll']){_0x152e5c[_0xad25('0x3c')]=[{'all':!![]}];}_0x152e5c=_[_0xad25('0x36')]({},_0x152e5c,_0x49545d[_0xad25('0x41')]);return db[_0xad25('0x26')][_0xad25('0x42')](_0x152e5c)[_0xad25('0x1f')](handleEntityNotFound(_0x662b06,null))[_0xad25('0x1f')](respondWithResult(_0x662b06,null))[_0xad25('0x3f')](handleError(_0x662b06,null));};exports[_0xad25('0x43')]=function(_0x9f79eb,_0x258828){return db['Variable'][_0xad25('0x43')](_0x9f79eb[_0xad25('0x44')],{})[_0xad25('0x1f')](function(_0x16e4ba){var _0x1e9c13=_0x9f79eb[_0xad25('0x45')][_0xad25('0x46')]({'plain':!![]});if(!_0x1e9c13)throw new Error(_0xad25('0x47'));if(_0x1e9c13['role']===_0xad25('0x45')){var _0x13e275=_0x16e4ba[_0xad25('0x46')]({'plain':!![]});var _0x59a51b=_0xad25('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x59a51b,'userProfileId':_0x1e9c13[_0xad25('0x48')]},'raw':!![]})[_0xad25('0x1f')](function(_0x132d0b){if(_0x132d0b&&_0x132d0b[_0xad25('0x49')]===0x0){return db['UserProfileResource'][_0xad25('0x43')]({'name':_0x13e275[_0xad25('0x24')],'resourceId':_0x13e275['id'],'type':_0x132d0b[_0xad25('0x24')],'sectionId':_0x132d0b['id']},{})[_0xad25('0x1f')](function(){return _0x16e4ba;});}else{return _0x16e4ba;}})[_0xad25('0x3f')](function(_0x5d52ae){logger['error'](_0xad25('0x4a'),_0x5d52ae);throw _0x5d52ae;});}return _0x16e4ba;})['then'](respondWithResult(_0x258828,0xc9))[_0xad25('0x3f')](handleError(_0x258828,null));};exports[_0xad25('0x1e')]=function(_0x5a32d4,_0x4c67b4){if(_0x5a32d4[_0xad25('0x44')]['id']){delete _0x5a32d4[_0xad25('0x44')]['id'];}return db['Variable'][_0xad25('0x42')]({'where':{'id':_0x5a32d4[_0xad25('0x4b')]['id']}})[_0xad25('0x1f')](handleEntityNotFound(_0x4c67b4,null))[_0xad25('0x1f')](saveUpdates(_0x5a32d4[_0xad25('0x44')],null))[_0xad25('0x1f')](respondWithResult(_0x4c67b4,null))[_0xad25('0x3f')](handleError(_0x4c67b4,null));};exports[_0xad25('0x20')]=function(_0x16bfdf,_0x2d751e){return db[_0xad25('0x26')][_0xad25('0x42')]({'where':{'id':_0x16bfdf[_0xad25('0x4b')]['id']}})[_0xad25('0x1f')](handleEntityNotFound(_0x2d751e,null))[_0xad25('0x1f')](removeEntity(_0x2d751e,null))[_0xad25('0x3f')](handleError(_0x2d751e,null));}; \ No newline at end of file +var _0xc41b=['set','Content-Range','apply','reject','then','destroy','get','Variables','error','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','map','key','field','filter','merge','Variable','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x99542a,_0x122256){var _0x4e13b5=function(_0x4f9e1a){while(--_0x4f9e1a){_0x99542a['push'](_0x99542a['shift']());}};_0x4e13b5(++_0x122256);}(_0xc41b,0x1af));var _0xbc41=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc41b[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbc41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc41('0x1'));var rp=require(_0xbc41('0x2'));var moment=require(_0xbc41('0x3'));var BPromise=require(_0xbc41('0x4'));var Mustache=require(_0xbc41('0x5'));var util=require(_0xbc41('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbc41('0x7'));var ejs=require(_0xbc41('0x8'));var fs=require('fs');var _=require(_0xbc41('0x9'));var squel=require(_0xbc41('0xa'));var crypto=require(_0xbc41('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbc41('0x7'));var querystring=require('querystring');var Papa=require(_0xbc41('0xc'));var Redis=require('ioredis');var authService=require(_0xbc41('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc41('0xe'))(_0xbc41('0xf'));var utils=require(_0xbc41('0x10'));var config=require(_0xbc41('0x11'));var db=require(_0xbc41('0x12'))['db'];function respondWithStatusCode(_0x596c77,_0x533318){_0x533318=_0x533318||0xcc;return function(_0x32d931){if(_0x32d931){return _0x596c77[_0xbc41('0x13')](_0x533318);}return _0x596c77[_0xbc41('0x14')](_0x533318)[_0xbc41('0x15')]();};}function respondWithResult(_0x42d208,_0x5f1d28){_0x5f1d28=_0x5f1d28||0xc8;return function(_0x57a367){if(_0x57a367){return _0x42d208[_0xbc41('0x14')](_0x5f1d28)[_0xbc41('0x16')](_0x57a367);}};}function respondWithFilteredResult(_0x4224d0,_0x32a011){return function(_0xd445e3){if(_0xd445e3){var _0x2e0d61=_0xd445e3[_0xbc41('0x17')],_0x4cc392=_0x32a011['offset'],_0x2a2dcd=_0x32a011[_0xbc41('0x18')]+_0x32a011['limit'],_0x174325;if(_0x2a2dcd>=_0x2e0d61){_0x2a2dcd=_0x2e0d61;_0x174325=0xc8;}else{_0x174325=0xce;}_0x4224d0[_0xbc41('0x14')](_0x174325);return _0x4224d0[_0xbc41('0x19')](_0xbc41('0x1a'),_0x4cc392+'-'+_0x2a2dcd+'/'+_0x2e0d61)[_0xbc41('0x16')](_0xd445e3);}return null;};}function patchUpdates(_0x1f36dd){return function(_0x38fb93){try{jsonpatch[_0xbc41('0x1b')](_0x38fb93,_0x1f36dd,!![]);}catch(_0x583955){return BPromise[_0xbc41('0x1c')](_0x583955);}return _0x38fb93['save']();};}function saveUpdates(_0x519dd4,_0x184ca5){return function(_0x2e0f90){if(_0x2e0f90){return _0x2e0f90['update'](_0x519dd4)[_0xbc41('0x1d')](function(_0x1d5c79){return _0x1d5c79;});}return null;};}function removeEntity(_0x36c1f8,_0xdf971a){return function(_0x46c6d9){if(_0x46c6d9){return _0x46c6d9[_0xbc41('0x1e')]()[_0xbc41('0x1d')](function(){var _0x2c904e=_0x46c6d9[_0xbc41('0x1f')]({'plain':!![]});var _0x15c7de=_0xbc41('0x20');return db['UserProfileResource'][_0xbc41('0x1e')]({'where':{'type':_0x15c7de,'resourceId':_0x2c904e['id']}})[_0xbc41('0x1d')](function(){return _0x46c6d9;});})[_0xbc41('0x1d')](function(){_0x36c1f8[_0xbc41('0x14')](0xcc)[_0xbc41('0x15')]();});}};}function handleEntityNotFound(_0x222d61,_0x194441){return function(_0x3d66c2){if(!_0x3d66c2){_0x222d61[_0xbc41('0x13')](0x194);}return _0x3d66c2;};}function handleError(_0x17a366,_0xe3296a){_0xe3296a=_0xe3296a||0x1f4;return function(_0x5cb0d1){logger[_0xbc41('0x21')](_0x5cb0d1[_0xbc41('0x22')]);if(_0x5cb0d1[_0xbc41('0x23')]){delete _0x5cb0d1[_0xbc41('0x23')];}_0x17a366[_0xbc41('0x14')](_0xe3296a)[_0xbc41('0x24')](_0x5cb0d1);};}exports['index']=function(_0x1b920c,_0xa36e5d){var _0x37fc09={},_0x1b8266={},_0x1cc6d2={'count':0x0,'rows':[]};var _0x1da117=db['Variable'][_0xbc41('0x25')];_0x1b8266[_0xbc41('0x26')]=_[_0xbc41('0x27')](_0x1da117);_0x1b8266[_0xbc41('0x28')]=_[_0xbc41('0x27')](_0x1b920c[_0xbc41('0x28')]);_0x1b8266['filters']=_[_0xbc41('0x29')](_0x1b8266[_0xbc41('0x26')],_0x1b8266[_0xbc41('0x28')]);_0x37fc09['attributes']=_[_0xbc41('0x29')](_0x1b8266[_0xbc41('0x26')],qs[_0xbc41('0x2a')](_0x1b920c[_0xbc41('0x28')][_0xbc41('0x2a')]));_0x37fc09[_0xbc41('0x2b')]=_0x37fc09[_0xbc41('0x2b')][_0xbc41('0x2c')]?_0x37fc09['attributes']:_0x1b8266[_0xbc41('0x26')];if(!_0x1b920c['query']['hasOwnProperty'](_0xbc41('0x2d'))){_0x37fc09[_0xbc41('0x2e')]=qs[_0xbc41('0x2e')](_0x1b920c[_0xbc41('0x28')][_0xbc41('0x2e')]);_0x37fc09[_0xbc41('0x18')]=qs[_0xbc41('0x18')](_0x1b920c[_0xbc41('0x28')][_0xbc41('0x18')]);}_0x37fc09[_0xbc41('0x2f')]=qs[_0xbc41('0x30')](_0x1b920c[_0xbc41('0x28')][_0xbc41('0x30')]);_0x37fc09[_0xbc41('0x31')]=qs['filters'](_['pick'](_0x1b920c['query'],_0x1b8266[_0xbc41('0x32')]));if(_0x1b920c[_0xbc41('0x28')]['filter']){_0x37fc09[_0xbc41('0x31')]=_['merge'](_0x37fc09[_0xbc41('0x31')],{'$or':_[_0xbc41('0x33')](_0x1da117,function(_0x3973ee){if(_0x3973ee['type'][_0xbc41('0x34')]!=='VIRTUAL'){var _0x23d8fc={};_0x23d8fc[_0x3973ee[_0xbc41('0x35')]]={'$like':'%'+_0x1b920c[_0xbc41('0x28')][_0xbc41('0x36')]+'%'};return _0x23d8fc;}})});}_0x37fc09=_[_0xbc41('0x37')]({},_0x37fc09,_0x1b920c['options']);var _0x59041a={'where':_0x37fc09[_0xbc41('0x31')]};return db[_0xbc41('0x38')][_0xbc41('0x17')](_0x59041a)[_0xbc41('0x1d')](function(_0x4fd78d){_0x1cc6d2[_0xbc41('0x17')]=_0x4fd78d;if(_0x1b920c[_0xbc41('0x28')]['includeAll']){_0x37fc09[_0xbc41('0x39')]=[{'all':!![]}];}return db[_0xbc41('0x38')][_0xbc41('0x3a')](_0x37fc09);})['then'](function(_0x5a02ea){_0x1cc6d2[_0xbc41('0x3b')]=_0x5a02ea;return _0x1cc6d2;})['then'](respondWithFilteredResult(_0xa36e5d,_0x37fc09))[_0xbc41('0x3c')](handleError(_0xa36e5d,null));};exports[_0xbc41('0x3d')]=function(_0x492c54,_0x5b75e7){var _0x3e5d77={'raw':!![],'where':{'id':_0x492c54[_0xbc41('0x3e')]['id']}},_0x128179={};_0x128179[_0xbc41('0x26')]=_[_0xbc41('0x27')](db['Variable'][_0xbc41('0x25')]);_0x128179[_0xbc41('0x28')]=_[_0xbc41('0x27')](_0x492c54[_0xbc41('0x28')]);_0x128179[_0xbc41('0x32')]=_[_0xbc41('0x29')](_0x128179[_0xbc41('0x26')],_0x128179['query']);_0x3e5d77[_0xbc41('0x2b')]=_[_0xbc41('0x29')](_0x128179[_0xbc41('0x26')],qs[_0xbc41('0x2a')](_0x492c54['query'][_0xbc41('0x2a')]));_0x3e5d77[_0xbc41('0x2b')]=_0x3e5d77[_0xbc41('0x2b')][_0xbc41('0x2c')]?_0x3e5d77[_0xbc41('0x2b')]:_0x128179[_0xbc41('0x26')];if(_0x492c54['query'][_0xbc41('0x3f')]){_0x3e5d77[_0xbc41('0x39')]=[{'all':!![]}];}_0x3e5d77=_['merge']({},_0x3e5d77,_0x492c54[_0xbc41('0x40')]);return db[_0xbc41('0x38')]['find'](_0x3e5d77)[_0xbc41('0x1d')](handleEntityNotFound(_0x5b75e7,null))['then'](respondWithResult(_0x5b75e7,null))['catch'](handleError(_0x5b75e7,null));};exports[_0xbc41('0x41')]=function(_0x4f79a4,_0xf5f0f0){return db[_0xbc41('0x38')][_0xbc41('0x41')](_0x4f79a4[_0xbc41('0x42')],{})[_0xbc41('0x1d')](function(_0x3993b7){var _0x51c4be=_0x4f79a4[_0xbc41('0x43')]['get']({'plain':!![]});if(!_0x51c4be)throw new Error(_0xbc41('0x44'));if(_0x51c4be[_0xbc41('0x45')]===_0xbc41('0x43')){var _0x3f1479=_0x3993b7[_0xbc41('0x1f')]({'plain':!![]});var _0x1475e9=_0xbc41('0x20');return db[_0xbc41('0x46')]['find']({'where':{'name':_0x1475e9,'userProfileId':_0x51c4be['userProfileId']},'raw':!![]})[_0xbc41('0x1d')](function(_0x16ce94){if(_0x16ce94&&_0x16ce94[_0xbc41('0x47')]===0x0){return db[_0xbc41('0x48')][_0xbc41('0x41')]({'name':_0x3f1479[_0xbc41('0x23')],'resourceId':_0x3f1479['id'],'type':_0x16ce94['name'],'sectionId':_0x16ce94['id']},{})[_0xbc41('0x1d')](function(){return _0x3993b7;});}else{return _0x3993b7;}})['catch'](function(_0x3058b3){logger[_0xbc41('0x21')](_0xbc41('0x49'),_0x3058b3);throw _0x3058b3;});}return _0x3993b7;})['then'](respondWithResult(_0xf5f0f0,0xc9))[_0xbc41('0x3c')](handleError(_0xf5f0f0,null));};exports[_0xbc41('0x4a')]=function(_0xe223ec,_0x48331c){if(_0xe223ec['body']['id']){delete _0xe223ec[_0xbc41('0x42')]['id'];}return db[_0xbc41('0x38')][_0xbc41('0x4b')]({'where':{'id':_0xe223ec['params']['id']}})[_0xbc41('0x1d')](handleEntityNotFound(_0x48331c,null))[_0xbc41('0x1d')](saveUpdates(_0xe223ec[_0xbc41('0x42')],null))['then'](respondWithResult(_0x48331c,null))[_0xbc41('0x3c')](handleError(_0x48331c,null));};exports[_0xbc41('0x1e')]=function(_0xf1c694,_0x49c8d0){return db['Variable'][_0xbc41('0x4b')]({'where':{'id':_0xf1c694[_0xbc41('0x3e')]['id']}})[_0xbc41('0x1d')](handleEntityNotFound(_0x49c8d0,null))[_0xbc41('0x1d')](removeEntity(_0x49c8d0,null))[_0xbc41('0x3c')](handleError(_0x49c8d0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4863f89..e2d5d18 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 _0x0954=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','../../config/logger','api'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x0954,0x135));var _0x4095=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x0954[_0x238671];return _0x474844;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var logger=require(_0x4095('0x1'))(_0x4095('0x2'));var moment=require('moment');var BPromise=require(_0x4095('0x3'));var rp=require(_0x4095('0x4'));var fs=require('fs');var path=require(_0x4095('0x5'));var rimraf=require(_0x4095('0x6'));var config=require(_0x4095('0x7'));var attributes=require(_0x4095('0x8'));module['exports']=function(_0x543154,_0x57ad9c){return _0x543154[_0x4095('0x9')](_0x4095('0xa'),attributes,{'tableName':_0x4095('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb67=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger'];(function(_0x3c719d,_0xdd2b4b){var _0x449810=function(_0xa8690e){while(--_0xa8690e){_0x3c719d['push'](_0x3c719d['shift']());}};_0x449810(++_0xdd2b4b);}(_0xfb67,0xdd));var _0x7fb6=function(_0x2f40b5,_0x4612fe){_0x2f40b5=_0x2f40b5-0x0;var _0x28baa8=_0xfb67[_0x2f40b5];return _0x28baa8;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var logger=require(_0x7fb6('0x2'))(_0x7fb6('0x3'));var moment=require(_0x7fb6('0x4'));var BPromise=require(_0x7fb6('0x5'));var rp=require(_0x7fb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var attributes=require(_0x7fb6('0x9'));module[_0x7fb6('0xa')]=function(_0x3e7393,_0x59b2e2){return _0x3e7393[_0x7fb6('0xb')](_0x7fb6('0xc'),attributes,{'tableName':_0x7fb6('0xd'),'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 454a129..c3b6b1b 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 _0x46ee=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','ShowVariable','options','raw','where','include','map','model','attributes','debug','lodash','util'];(function(_0x44c29b,_0x3a29e2){var _0x244960=function(_0x2a7708){while(--_0x2a7708){_0x44c29b['push'](_0x44c29b['shift']());}};_0x244960(++_0x3a29e2);}(_0x46ee,0x8f));var _0xe46e=function(_0x195285,_0x2620ee){_0x195285=_0x195285-0x0;var _0x3ff601=_0x46ee[_0x195285];return _0x3ff601;};'use strict';var _=require(_0xe46e('0x0'));var util=require(_0xe46e('0x1'));var moment=require('moment');var BPromise=require(_0xe46e('0x2'));var rs=require(_0xe46e('0x3'));var fs=require('fs');var Redis=require(_0xe46e('0x4'));var db=require(_0xe46e('0x5'))['db'];var utils=require(_0xe46e('0x6'));var logger=require(_0xe46e('0x7'))('rpc');var config=require(_0xe46e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe46e('0x9')][_0xe46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aade7,_0x4aa88b,_0x1e1117){return new BPromise(function(_0x5ec204,_0x203760){return client[_0xe46e('0xb')](_0x4aade7,_0x1e1117)[_0xe46e('0xc')](function(_0x289210){logger['info'](_0xe46e('0xd'),_0x4aa88b,'request\x20sent');logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x4aa88b,_0xe46e('0xe'),JSON[_0xe46e('0xf')](_0x289210));if(_0x289210[_0xe46e('0x10')]){if(_0x289210[_0xe46e('0x10')]['code']===0x1f4){logger[_0xe46e('0x10')](_0xe46e('0xd'),_0x4aa88b,_0x289210[_0xe46e('0x10')][_0xe46e('0x11')]);return _0x203760(_0x289210[_0xe46e('0x10')][_0xe46e('0x11')]);}logger[_0xe46e('0x10')](_0xe46e('0xd'),_0x4aa88b,_0x289210[_0xe46e('0x10')][_0xe46e('0x11')]);return _0x5ec204(_0x289210[_0xe46e('0x10')][_0xe46e('0x11')]);}else{logger[_0xe46e('0x12')](_0xe46e('0xd'),_0x4aa88b,_0xe46e('0xe'));_0x5ec204(_0x289210['result']['message']);}})[_0xe46e('0x13')](function(_0x18fddc){logger[_0xe46e('0x10')](_0xe46e('0xd'),_0x4aa88b,_0x18fddc);_0x203760(_0x18fddc);});});}exports[_0xe46e('0x14')]=function(_0x18b424){var _0x5f3280=this;return new Promise(function(_0x596e27,_0x522e4b){return db['Variable']['find']({'raw':_0x18b424[_0xe46e('0x15')]?_0x18b424[_0xe46e('0x15')][_0xe46e('0x16')]===undefined?!![]:![]:!![],'where':_0x18b424['options']?_0x18b424['options'][_0xe46e('0x17')]||null:null,'attributes':_0x18b424['options']?_0x18b424[_0xe46e('0x15')]['attributes']||null:null,'include':_0x18b424[_0xe46e('0x15')]?_0x18b424[_0xe46e('0x15')][_0xe46e('0x18')]?_[_0xe46e('0x19')](_0x18b424['options'][_0xe46e('0x18')],function(_0x30cf7d){return{'model':db[_0x30cf7d[_0xe46e('0x1a')]],'as':_0x30cf7d['as'],'attributes':_0x30cf7d[_0xe46e('0x1b')],'include':_0x30cf7d[_0xe46e('0x18')]?_['map'](_0x30cf7d[_0xe46e('0x18')],function(_0x280242){return{'model':db[_0x280242[_0xe46e('0x1a')]],'as':_0x280242['as'],'attributes':_0x280242['attributes'],'include':_0x280242[_0xe46e('0x18')]?_[_0xe46e('0x19')](_0x280242['include'],function(_0x143c38){return{'model':db[_0x143c38['model']],'as':_0x143c38['as'],'attributes':_0x143c38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b2494){logger[_0xe46e('0x12')](_0xe46e('0x14'),_0x18b424);logger[_0xe46e('0x1c')]('ShowVariable',_0x18b424,JSON[_0xe46e('0xf')](_0x2b2494));_0x596e27(_0x2b2494);})[_0xe46e('0x13')](function(_0x307f94){logger[_0xe46e('0x10')](_0xe46e('0x14'),_0x307f94[_0xe46e('0x11')],_0x18b424);_0x522e4b(_0x5f3280[_0xe46e('0x10')](0x1f4,_0x307f94[_0xe46e('0x11')]));});});}; \ No newline at end of file +var _0x83b5=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowVariable','find','options','raw','where','map','attributes','include','model','lodash','moment','bluebird'];(function(_0x5771e5,_0x3a5eea){var _0x1916fa=function(_0x279e70){while(--_0x279e70){_0x5771e5['push'](_0x5771e5['shift']());}};_0x1916fa(++_0x3a5eea);}(_0x83b5,0x129));var _0x583b=function(_0x3d89ce,_0x5d5e4b){_0x3d89ce=_0x3d89ce-0x0;var _0x494a2e=_0x83b5[_0x3d89ce];return _0x494a2e;};'use strict';var _=require(_0x583b('0x0'));var util=require('util');var moment=require(_0x583b('0x1'));var BPromise=require(_0x583b('0x2'));var rs=require(_0x583b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x583b('0x4'));var logger=require('../../config/logger')(_0x583b('0x5'));var config=require(_0x583b('0x6'));var jayson=require(_0x583b('0x7'));var client=jayson[_0x583b('0x8')][_0x583b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x243736,_0x35e20c,_0x22cf04){return new BPromise(function(_0x24b3eb,_0x18160d){return client[_0x583b('0xa')](_0x243736,_0x22cf04)['then'](function(_0x4b4218){logger[_0x583b('0xb')](_0x583b('0xc'),_0x35e20c,_0x583b('0xd'));logger[_0x583b('0xe')](_0x583b('0xf'),_0x35e20c,_0x583b('0xd'),JSON[_0x583b('0x10')](_0x4b4218));if(_0x4b4218[_0x583b('0x11')]){if(_0x4b4218[_0x583b('0x11')][_0x583b('0x12')]===0x1f4){logger[_0x583b('0x11')]('Variable,\x20%s,\x20%s',_0x35e20c,_0x4b4218[_0x583b('0x11')][_0x583b('0x13')]);return _0x18160d(_0x4b4218['error'][_0x583b('0x13')]);}logger['error'](_0x583b('0xc'),_0x35e20c,_0x4b4218['error'][_0x583b('0x13')]);return _0x24b3eb(_0x4b4218[_0x583b('0x11')][_0x583b('0x13')]);}else{logger['info'](_0x583b('0xc'),_0x35e20c,'request\x20sent');_0x24b3eb(_0x4b4218['result'][_0x583b('0x13')]);}})[_0x583b('0x14')](function(_0x8ad36){logger[_0x583b('0x11')](_0x583b('0xc'),_0x35e20c,_0x8ad36);_0x18160d(_0x8ad36);});});}exports[_0x583b('0x15')]=function(_0x54c574){var _0x35fac5=this;return new Promise(function(_0x36630a,_0x31794a){return db['Variable'][_0x583b('0x16')]({'raw':_0x54c574[_0x583b('0x17')]?_0x54c574[_0x583b('0x17')][_0x583b('0x18')]===undefined?!![]:![]:!![],'where':_0x54c574['options']?_0x54c574[_0x583b('0x17')][_0x583b('0x19')]||null:null,'attributes':_0x54c574[_0x583b('0x17')]?_0x54c574[_0x583b('0x17')]['attributes']||null:null,'include':_0x54c574[_0x583b('0x17')]?_0x54c574['options']['include']?_[_0x583b('0x1a')](_0x54c574[_0x583b('0x17')]['include'],function(_0x4d7f15){return{'model':db[_0x4d7f15['model']],'as':_0x4d7f15['as'],'attributes':_0x4d7f15[_0x583b('0x1b')],'include':_0x4d7f15[_0x583b('0x1c')]?_[_0x583b('0x1a')](_0x4d7f15[_0x583b('0x1c')],function(_0x2cb3f7){return{'model':db[_0x2cb3f7['model']],'as':_0x2cb3f7['as'],'attributes':_0x2cb3f7[_0x583b('0x1b')],'include':_0x2cb3f7['include']?_[_0x583b('0x1a')](_0x2cb3f7['include'],function(_0x24fdf6){return{'model':db[_0x24fdf6[_0x583b('0x1d')]],'as':_0x24fdf6['as'],'attributes':_0x24fdf6[_0x583b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x311523){logger[_0x583b('0xb')](_0x583b('0x15'),_0x54c574);logger[_0x583b('0xe')](_0x583b('0x15'),_0x54c574,JSON['stringify'](_0x311523));_0x36630a(_0x311523);})['catch'](function(_0x1e7685){logger[_0x583b('0x11')]('ShowVariable',_0x1e7685[_0x583b('0x13')],_0x54c574);_0x31794a(_0x35fac5[_0x583b('0x11')](0x1f4,_0x1e7685['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a6a159c..ae43c05 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 _0x72dd=['/reset','isAuthenticated','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x72dd,0x1ac));var _0xd72d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x72dd[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0xd72d('0x0'));var router=express[_0xd72d('0x1')]();var auth=require(_0xd72d('0x2'));var controller=require(_0xd72d('0x3'));router[_0xd72d('0x4')]('/',controller[_0xd72d('0x5')]);router[_0xd72d('0x4')](_0xd72d('0x6'),auth['isAuthenticated'](),auth[_0xd72d('0x7')](),controller[_0xd72d('0x8')]);router['get'](_0xd72d('0x9'),auth[_0xd72d('0xa')](),auth['canUpdate'](),controller[_0xd72d('0xb')]);router[_0xd72d('0x4')](_0xd72d('0xc'),auth['isAuthenticated'](),auth[_0xd72d('0x7')](),controller[_0xd72d('0xd')]);router[_0xd72d('0x4')](_0xd72d('0xe'),auth[_0xd72d('0xa')](),controller[_0xd72d('0xf')]);router[_0xd72d('0x4')](_0xd72d('0x10'),controller[_0xd72d('0x11')]);module[_0xd72d('0x12')]=router; \ No newline at end of file +var _0xb249=['exports','express','./version.controller','get','index','/fetch','canUpdate','fetch','isAuthenticated','reset','pull','/restart','restart','/migrations','migrations'];(function(_0x595e6c,_0x5ca9e6){var _0x3eeea3=function(_0x4b3634){while(--_0x4b3634){_0x595e6c['push'](_0x595e6c['shift']());}};_0x3eeea3(++_0x5ca9e6);}(_0xb249,0x10f));var _0x9b24=function(_0x2d259b,_0x14c428){_0x2d259b=_0x2d259b-0x0;var _0x378287=_0xb249[_0x2d259b];return _0x378287;};'use strict';var express=require(_0x9b24('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x9b24('0x1'));router[_0x9b24('0x2')]('/',controller[_0x9b24('0x3')]);router[_0x9b24('0x2')](_0x9b24('0x4'),auth['isAuthenticated'](),auth[_0x9b24('0x5')](),controller[_0x9b24('0x6')]);router[_0x9b24('0x2')]('/reset',auth[_0x9b24('0x7')](),auth[_0x9b24('0x5')](),controller[_0x9b24('0x8')]);router['get']('/pull',auth[_0x9b24('0x7')](),auth['canUpdate'](),controller[_0x9b24('0x9')]);router[_0x9b24('0x2')](_0x9b24('0xa'),auth[_0x9b24('0x7')](),controller[_0x9b24('0xb')]);router[_0x9b24('0x2')](_0x9b24('0xc'),controller[_0x9b24('0xd')]);module[_0x9b24('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 34558e3..5834e8a 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 _0xc641=['.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','query','latest','2.0.0','status','json','fetch','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','server','length'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0xc641,0xea));var _0x1c64=function(_0x466c91,_0x31ae1d){_0x466c91=_0x466c91-0x0;var _0x4b0d3a=_0xc641[_0x466c91];return _0x4b0d3a;};'use strict';var Umzug=require(_0x1c64('0x0'));var path=require(_0x1c64('0x1'));var fs=require('fs');var _=require(_0x1c64('0x2'));var pkginfo=require(_0x1c64('0x3'))(module,_0x1c64('0x4'));var compareVersions=require(_0x1c64('0x5'));var exec=require(_0x1c64('0x6'))[_0x1c64('0x7')];var db=require(_0x1c64('0x8'))['db'];var config=require(_0x1c64('0x9'));var pm2=require(_0x1c64('0xa'));var logger=require('../../config/logger')(_0x1c64('0xb'));var git=require(_0x1c64('0xc'))(config[_0x1c64('0xd')]);exports['index']=function(_0x2a15ac,_0x5a5b06){var _0x36a9e6={'current':module[_0x1c64('0xe')][_0x1c64('0x4')],'phonebar':0x2};if(_0x2a15ac[_0x1c64('0xf')]&&_0x2a15ac[_0x1c64('0xf')][_0x1c64('0x10')]){return git['fetch']()['tags'](function(_0x2a5ff5,_0xc9762a){_0x36a9e6[_0x1c64('0x10')]=(_0x2a5ff5?module[_0x1c64('0xe')][_0x1c64('0x4')]:_0xc9762a['latest'])||_0x1c64('0x11');return _0x5a5b06[_0x1c64('0x12')](0xc8)[_0x1c64('0x13')](_0x36a9e6);});}else{return _0x5a5b06['status'](0xc8)[_0x1c64('0x13')](_0x36a9e6);}};exports[_0x1c64('0x14')]=function(_0x37982e,_0x22a73a){return git[_0x1c64('0x14')]([_0x1c64('0x15'),_0x1c64('0x16')],function(_0x265d63){if(_0x265d63){logger['error'](_0x265d63);return _0x22a73a[_0x1c64('0x12')](0x1f4)[_0x1c64('0x13')](_0x265d63);}logger[_0x1c64('0x17')](_0x1c64('0x18'));return _0x22a73a['status'](0xc8)['json']({'output':_0x1c64('0x19')});});};exports[_0x1c64('0x1a')]=function(_0xab14bd,_0x512af5){return git['reset']([_0x1c64('0x1b'),_0x1c64('0x1c')],function(_0x497eb6){if(_0x497eb6){logger[_0x1c64('0x1d')](_0x497eb6);return _0x512af5[_0x1c64('0x12')](0x1f4)[_0x1c64('0x13')](_0x497eb6);}logger['info'](_0x1c64('0x1e'));return _0x512af5[_0x1c64('0x12')](0xc8)[_0x1c64('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0x1c64('0x1f')]=function(_0x619533,_0x5bc05c){exec(_0x1c64('0x20'),function(_0x51dfa9,_0xb65ce7,_0x150c84){logger[_0x1c64('0x17')](_0xb65ce7);logger[_0x1c64('0x17')](_0x150c84);if(_0x51dfa9){logger[_0x1c64('0x1d')](_0x51dfa9);return _0x5bc05c['status'](0x1f4)[_0x1c64('0x13')](_0x51dfa9);}return _0x5bc05c[_0x1c64('0x12')](0xc8)[_0x1c64('0x13')]({'output':_0xb65ce7});});};exports[_0x1c64('0x21')]=function(_0x50486b,_0x23a798){return pm2['restart'](_0x1c64('0x22'))['then'](function(_0x5bfd28){logger[_0x1c64('0x17')](_0x1c64('0x23'),_0x5bfd28);return _0x23a798['status'](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x1c64('0x24')](function(_0x64e8ae){logger['error'](_0x64e8ae);return _0x23a798[_0x1c64('0x12')](0x1f4)[_0x1c64('0x13')](_0x64e8ae);});};exports[_0x1c64('0x25')]=function(_0x2596ca,_0x1bb3f4){var _0x42bafe=fs[_0x1c64('0x26')](path['join'](config[_0x1c64('0xd')],_0x1c64('0x27'),'migrations'));var _0xcfeb3d=[];for(var _0x57841d=0x0;_0x57841d<_0x42bafe[_0x1c64('0x28')];_0x57841d++){var _0x4946af=_0x42bafe[_0x57841d]['replace'](_0x1c64('0x29'),'');if(compareVersions(module[_0x1c64('0xe')][_0x1c64('0x4')],_0x4946af)===-0x1){_0xcfeb3d[_0x1c64('0x2a')](_0x4946af);}}if(_0xcfeb3d[_0x1c64('0x28')]){var _0x23ce0f=_0xcfeb3d['sort'](compareVersions);var _0x192a51=new Umzug({'storage':_0x1c64('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x1c64('0x2c'),'columnName':_0x1c64('0x4')},'migrations':{'params':[db[_0x1c64('0x2b')][_0x1c64('0x2d')](),db['sequelize'][_0x1c64('0x2e')],function(){throw new Error(_0x1c64('0x2f'));}],'path':path[_0x1c64('0x30')](config[_0x1c64('0xd')],_0x1c64('0x27'),'migrations'),'pattern':/\.js$/}});_0x192a51['up']({'migrations':_[_0x1c64('0x31')](_0x23ce0f,function(_0x17f825){return _0x17f825+_0x1c64('0x29');})})[_0x1c64('0x32')](function(){return _0x1bb3f4['status'](0xc8)[_0x1c64('0x13')]({'output':_0x1c64('0x33')+module[_0x1c64('0xe')][_0x1c64('0x4')]+_0x1c64('0x34')+_['last'](_0x23ce0f),'migrations':_['join'](_0x23ce0f)});})[_0x1c64('0x24')](function(_0x64c91b){if(_0x64c91b instanceof db[_0x1c64('0x2b')][_0x1c64('0x35')]){return _0x1bb3f4[_0x1c64('0x12')](0xc8)[_0x1c64('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1bb3f4['status'](0x1f4)[_0x1c64('0x13')](_0x64c91b);}});}else{return _0x1bb3f4[_0x1c64('0x12')](0xc8)[_0x1c64('0x13')]({'output':_0x1c64('0x36')});}}; \ No newline at end of file +var _0x672c=['2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','replace','.js','sequelize','Migration','getQueryInterface','constructor','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x672c,0x11b));var _0xc672=function(_0x35274a,_0x30ce24){_0x35274a=_0x35274a-0x0;var _0x4954ce=_0x672c[_0x35274a];return _0x4954ce;};'use strict';var Umzug=require(_0xc672('0x0'));var path=require(_0xc672('0x1'));var fs=require('fs');var _=require(_0xc672('0x2'));var pkginfo=require(_0xc672('0x3'))(module,_0xc672('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xc672('0x5'))[_0xc672('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xc672('0x7'));var logger=require(_0xc672('0x8'))('update');var git=require(_0xc672('0x9'))(config[_0xc672('0xa')]);exports[_0xc672('0xb')]=function(_0x2c35f1,_0x248553){var _0x7bf908={'current':module[_0xc672('0xc')][_0xc672('0x4')],'phonebar':0x2};if(_0x2c35f1[_0xc672('0xd')]&&_0x2c35f1[_0xc672('0xd')][_0xc672('0xe')]){return git[_0xc672('0xf')]()[_0xc672('0x10')](function(_0x4106a2,_0x57bc51){_0x7bf908['latest']=(_0x4106a2?module[_0xc672('0xc')][_0xc672('0x4')]:_0x57bc51[_0xc672('0xe')])||_0xc672('0x11');return _0x248553[_0xc672('0x12')](0xc8)[_0xc672('0x13')](_0x7bf908);});}else{return _0x248553[_0xc672('0x12')](0xc8)[_0xc672('0x13')](_0x7bf908);}};exports[_0xc672('0xf')]=function(_0x2fb68a,_0x502a35){return git[_0xc672('0xf')]([_0xc672('0x14'),_0xc672('0x15')],function(_0x11b2ad){if(_0x11b2ad){logger[_0xc672('0x16')](_0x11b2ad);return _0x502a35['status'](0x1f4)[_0xc672('0x13')](_0x11b2ad);}logger[_0xc672('0x17')](_0xc672('0x18'));return _0x502a35[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc672('0x19')]=function(_0x1d48f6,_0x2d21b1){return git['reset']([_0xc672('0x1a'),_0xc672('0x1b')],function(_0x32dc49){if(_0x32dc49){logger[_0xc672('0x16')](_0x32dc49);return _0x2d21b1[_0xc672('0x12')](0x1f4)[_0xc672('0x13')](_0x32dc49);}logger[_0xc672('0x17')](_0xc672('0x1c'));return _0x2d21b1[_0xc672('0x12')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xc672('0x1d')]=function(_0x334dfe,_0x3aefac){exec('npm\x20install\x20--production',function(_0x45ba0e,_0x91e370,_0x4e92fe){logger[_0xc672('0x17')](_0x91e370);logger['info'](_0x4e92fe);if(_0x45ba0e){logger[_0xc672('0x16')](_0x45ba0e);return _0x3aefac[_0xc672('0x12')](0x1f4)[_0xc672('0x13')](_0x45ba0e);}return _0x3aefac[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':_0x91e370});});};exports[_0xc672('0x1e')]=function(_0x591955,_0x2a1215){return pm2['restart'](_0xc672('0x1f'))[_0xc672('0x20')](function(_0x5a6151){logger[_0xc672('0x17')](_0xc672('0x21'),_0x5a6151);return _0x2a1215[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':_0xc672('0x22')});})[_0xc672('0x23')](function(_0x161a38){logger[_0xc672('0x16')](_0x161a38);return _0x2a1215[_0xc672('0x12')](0x1f4)[_0xc672('0x13')](_0x161a38);});};exports[_0xc672('0x24')]=function(_0x26ba60,_0x541a84){var _0x5601a7=fs[_0xc672('0x25')](path[_0xc672('0x26')](config[_0xc672('0xa')],_0xc672('0x27'),_0xc672('0x24')));var _0xb2d058=[];for(var _0x34ae06=0x0;_0x34ae06<_0x5601a7['length'];_0x34ae06++){var _0x23f428=_0x5601a7[_0x34ae06][_0xc672('0x28')](_0xc672('0x29'),'');if(compareVersions(module[_0xc672('0xc')][_0xc672('0x4')],_0x23f428)===-0x1){_0xb2d058['push'](_0x23f428);}}if(_0xb2d058['length']){var _0x22b01b=_0xb2d058['sort'](compareVersions);var _0x756007=new Umzug({'storage':_0xc672('0x2a'),'storageOptions':{'model':db[_0xc672('0x2b')],'modelName':_0xc672('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0xc672('0x2a')][_0xc672('0x2c')](),db[_0xc672('0x2a')][_0xc672('0x2d')],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[_0xc672('0x26')](config['root'],'server',_0xc672('0x24')),'pattern':/\.js$/}});_0x756007['up']({'migrations':_[_0xc672('0x2e')](_0x22b01b,function(_0x1fce74){return _0x1fce74+_0xc672('0x29');})})[_0xc672('0x20')](function(){return _0x541a84[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xc672('0xc')][_0xc672('0x4')]+_0xc672('0x2f')+_['last'](_0x22b01b),'migrations':_[_0xc672('0x26')](_0x22b01b)});})[_0xc672('0x23')](function(_0x4be300){if(_0x4be300 instanceof db[_0xc672('0x2a')][_0xc672('0x30')]){return _0x541a84[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':_0xc672('0x31')});}else{return _0x541a84[_0xc672('0x12')](0x1f4)[_0xc672('0x13')](_0x4be300);}});}else{return _0x541a84[_0xc672('0x12')](0xc8)[_0xc672('0x13')]({'output':_0xc672('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4b5d209..d4a233c 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 _0x6050=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/:id','isAuthenticated','show','post'];(function(_0x38aa21,_0x399577){var _0x1b2ecc=function(_0x1395e3){while(--_0x1395e3){_0x38aa21['push'](_0x38aa21['shift']());}};_0x1b2ecc(++_0x399577);}(_0x6050,0x196));var _0x0605=function(_0x30cdca,_0x259c1d){_0x30cdca=_0x30cdca-0x0;var _0x3a4824=_0x6050[_0x30cdca];return _0x3a4824;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0605('0x6'));var config=require(_0x0605('0x7'));var controller=require(_0x0605('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0605('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0605('0x9')](_0x0605('0xa'),auth[_0x0605('0xb')](),controller[_0x0605('0xc')]);router[_0x0605('0xd')]('/',auth['isAuthenticated'](),controller[_0x0605('0xe')]);router[_0x0605('0xf')](_0x0605('0xa'),auth[_0x0605('0xb')](),controller[_0x0605('0x10')]);router[_0x0605('0x11')](_0x0605('0xa'),auth[_0x0605('0xb')](),controller[_0x0605('0x12')]);module[_0x0605('0x13')]=router; \ No newline at end of file +var _0x5d17=['/describe','describe','/:id','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x30fc90,_0xe1735c){var _0x5b8cd0=function(_0x503f3){while(--_0x503f3){_0x30fc90['push'](_0x30fc90['shift']());}};_0x5b8cd0(++_0xe1735c);}(_0x5d17,0x114));var _0x75d1=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x5d17[_0x4f0e62];return _0x117ab8;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var auth=require(_0x75d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x75d1('0x5'));var controller=require(_0x75d1('0x6'));router[_0x75d1('0x7')]('/',auth[_0x75d1('0x8')](),controller['index']);router[_0x75d1('0x7')](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller[_0x75d1('0xa')]);router[_0x75d1('0x7')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller['show']);router['post']('/',auth[_0x75d1('0x8')](),controller['create']);router['put'](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller['update']);router[_0x75d1('0xc')](_0x75d1('0xb'),auth[_0x75d1('0x8')](),controller[_0x75d1('0xd')]);module[_0x75d1('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index b3410c4..bd5f5f8 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 _0x1974=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1974,0xb1));var _0x4197=function(_0x1def67,_0x2715ef){_0x1def67=_0x1def67-0x0;var _0x4947fa=_0x1974[_0x1def67];return _0x4947fa;};'use strict';var Sequelize=require('sequelize');module[_0x4197('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4197('0x1')]},'calleridnum':{'type':Sequelize[_0x4197('0x1')]},'calleridname':{'type':Sequelize[_0x4197('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4197('0x1')]},'membername':{'type':Sequelize[_0x4197('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4197('0x2')]},'agentconnectAt':{'type':Sequelize[_0x4197('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x4197('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4197('0x2')]},'holdtime':{'type':Sequelize[_0x4197('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4197('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4197('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4197('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4197('0x3')]},'reason':{'type':Sequelize[_0x4197('0x1')]},'lastevent':{'type':Sequelize[_0x4197('0x1')]},'channel':{'type':Sequelize[_0x4197('0x1')]},'channelstate':{'type':Sequelize[_0x4197('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4197('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4197('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4197('0x1')]},'priority':{'type':Sequelize[_0x4197('0x1')]},'destchannel':{'type':Sequelize[_0x4197('0x1')]},'destchannelstate':{'type':Sequelize[_0x4197('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4197('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4197('0x1')]},'destcalleridname':{'type':Sequelize[_0x4197('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4197('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4197('0x1')]},'destlanguage':{'type':Sequelize[_0x4197('0x1')]},'destaccountcode':{'type':Sequelize[_0x4197('0x1')]},'destcontext':{'type':Sequelize[_0x4197('0x1')]},'destexten':{'type':Sequelize[_0x4197('0x1')]},'destpriority':{'type':Sequelize[_0x4197('0x1')]},'destuniqueid':{'type':Sequelize[_0x4197('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4197('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x4197('0x1')]},'transfer':{'type':Sequelize[_0x4197('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4197('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4197('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4197('0x1')]},'agententerreason':{'type':Sequelize[_0x4197('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa979=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x4a3a89,_0x53ff54){var _0x7cb071=function(_0x538c0b){while(--_0x538c0b){_0x4a3a89['push'](_0x4a3a89['shift']());}};_0x7cb071(++_0x53ff54);}(_0xa979,0x106));var _0x9a97=function(_0x4830db,_0x2c3aa9){_0x4830db=_0x4830db-0x0;var _0x49970e=_0xa979[_0x4830db];return _0x49970e;};'use strict';var Sequelize=require(_0x9a97('0x0'));module[_0x9a97('0x1')]={'type':{'type':Sequelize[_0x9a97('0x2')]},'uniqueid':{'type':Sequelize[_0x9a97('0x2')]},'calleridnum':{'type':Sequelize[_0x9a97('0x2')]},'calleridname':{'type':Sequelize[_0x9a97('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9a97('0x2')]},'membername':{'type':Sequelize[_0x9a97('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x9a97('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9a97('0x3')]},'agentdumpAt':{'type':Sequelize[_0x9a97('0x3')]},'holdtime':{'type':Sequelize[_0x9a97('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9a97('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9a97('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9a97('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9a97('0x4')]},'reason':{'type':Sequelize[_0x9a97('0x2')]},'lastevent':{'type':Sequelize[_0x9a97('0x2')]},'channel':{'type':Sequelize[_0x9a97('0x2')]},'channelstate':{'type':Sequelize[_0x9a97('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9a97('0x2')]},'language':{'type':Sequelize[_0x9a97('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9a97('0x2')]},'exten':{'type':Sequelize[_0x9a97('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9a97('0x2')]},'destchannelstate':{'type':Sequelize[_0x9a97('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9a97('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9a97('0x2')]},'destcalleridname':{'type':Sequelize[_0x9a97('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9a97('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9a97('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9a97('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x9a97('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9a97('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9a97('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9a97('0x2')],'comment':_0x9a97('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x9a97('0x2')]},'agententerreason':{'type':Sequelize[_0x9a97('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index af526df..979e452 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 _0x5387=['params','keys','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceAgentReport','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','field','options','includeAll','findAll','catch','show'];(function(_0x1c883d,_0x579de9){var _0x1a2780=function(_0x451600){while(--_0x451600){_0x1c883d['push'](_0x1c883d['shift']());}};_0x1a2780(++_0x579de9);}(_0x5387,0xd9));var _0x7538=function(_0x58a96c,_0x4110dc){_0x58a96c=_0x58a96c-0x0;var _0x11f025=_0x5387[_0x58a96c];return _0x11f025;};'use strict';var pdf=require(_0x7538('0x0'));var emlformat=require(_0x7538('0x1'));var rimraf=require(_0x7538('0x2'));var zipdir=require(_0x7538('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7538('0x4'));var BPromise=require(_0x7538('0x5'));var Mustache=require(_0x7538('0x6'));var util=require(_0x7538('0x7'));var path=require(_0x7538('0x8'));var sox=require('sox');var csv=require(_0x7538('0x9'));var ejs=require(_0x7538('0xa'));var fs=require('fs');var _=require(_0x7538('0xb'));var squel=require(_0x7538('0xc'));var crypto=require('crypto');var jsforce=require(_0x7538('0xd'));var deskjs=require(_0x7538('0xe'));var toCsv=require(_0x7538('0x9'));var querystring=require('querystring');var Papa=require(_0x7538('0xf'));var Redis=require('ioredis');var authService=require(_0x7538('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7538('0x11'));var logger=require(_0x7538('0x12'))(_0x7538('0x13'));var utils=require(_0x7538('0x14'));var config=require(_0x7538('0x15'));var db=require(_0x7538('0x16'))['db'];function respondWithStatusCode(_0xa0ae76,_0x136b88){_0x136b88=_0x136b88||0xcc;return function(_0x650947){if(_0x650947){return _0xa0ae76['sendStatus'](_0x136b88);}return _0xa0ae76['status'](_0x136b88)[_0x7538('0x17')]();};}function respondWithResult(_0x4482d3,_0x4aaf94){_0x4aaf94=_0x4aaf94||0xc8;return function(_0x26e0d9){if(_0x26e0d9){return _0x4482d3[_0x7538('0x18')](_0x4aaf94)[_0x7538('0x19')](_0x26e0d9);}};}function respondWithFilteredResult(_0x366143,_0x408376){return function(_0x5368eb){if(_0x5368eb){var _0x1c864e=_0x5368eb[_0x7538('0x1a')],_0x22237f=_0x408376[_0x7538('0x1b')],_0x2e8ee1=_0x408376[_0x7538('0x1b')]+_0x408376[_0x7538('0x1c')],_0x31e28f;if(_0x2e8ee1>=_0x1c864e){_0x2e8ee1=_0x1c864e;_0x31e28f=0xc8;}else{_0x31e28f=0xce;}_0x366143['status'](_0x31e28f);return _0x366143['set'](_0x7538('0x1d'),_0x22237f+'-'+_0x2e8ee1+'/'+_0x1c864e)[_0x7538('0x19')](_0x5368eb);}return null;};}function patchUpdates(_0xfa8277){return function(_0x34a938){try{jsonpatch['apply'](_0x34a938,_0xfa8277,!![]);}catch(_0x1f70b0){return BPromise[_0x7538('0x1e')](_0x1f70b0);}return _0x34a938['save']();};}function saveUpdates(_0x543526,_0x1fadcb){return function(_0x2d0065){if(_0x2d0065){return _0x2d0065[_0x7538('0x1f')](_0x543526)[_0x7538('0x20')](function(_0x1bbd83){return _0x1bbd83;});}return null;};}function removeEntity(_0x39c4ee,_0x37fb6a){return function(_0x3302c6){if(_0x3302c6){return _0x3302c6[_0x7538('0x21')]()[_0x7538('0x20')](function(){_0x39c4ee[_0x7538('0x18')](0xcc)[_0x7538('0x17')]();});}};}function handleEntityNotFound(_0x21246b,_0x25b351){return function(_0xec5515){if(!_0xec5515){_0x21246b[_0x7538('0x22')](0x194);}return _0xec5515;};}function handleError(_0x2dbb7d,_0x19d82f){_0x19d82f=_0x19d82f||0x1f4;return function(_0x3b2967){logger[_0x7538('0x23')](_0x3b2967[_0x7538('0x24')]);if(_0x3b2967[_0x7538('0x25')]){delete _0x3b2967['name'];}_0x2dbb7d['status'](_0x19d82f)[_0x7538('0x26')](_0x3b2967);};}exports[_0x7538('0x27')]=function(_0xe09d4b,_0x3e3f1d){var _0x5bb504={},_0x5e909b={},_0x2622b1={'count':0x0,'rows':[]};var _0x350b4f=db[_0x7538('0x28')]['rawAttributes'];_0x5e909b['model']=_['keys'](_0x350b4f);_0x5e909b[_0x7538('0x29')]=_['keys'](_0xe09d4b[_0x7538('0x29')]);_0x5e909b[_0x7538('0x2a')]=_[_0x7538('0x2b')](_0x5e909b[_0x7538('0x2c')],_0x5e909b[_0x7538('0x29')]);_0x5bb504[_0x7538('0x2d')]=_['intersection'](_0x5e909b[_0x7538('0x2c')],qs[_0x7538('0x2e')](_0xe09d4b[_0x7538('0x29')][_0x7538('0x2e')]));_0x5bb504[_0x7538('0x2d')]=_0x5bb504['attributes'][_0x7538('0x2f')]?_0x5bb504[_0x7538('0x2d')]:_0x5e909b[_0x7538('0x2c')];if(!_0xe09d4b[_0x7538('0x29')][_0x7538('0x30')]('nolimit')){_0x5bb504[_0x7538('0x1c')]=qs[_0x7538('0x1c')](_0xe09d4b[_0x7538('0x29')][_0x7538('0x1c')]);_0x5bb504[_0x7538('0x1b')]=qs[_0x7538('0x1b')](_0xe09d4b[_0x7538('0x29')]['offset']);}_0x5bb504[_0x7538('0x31')]=qs['sort'](_0xe09d4b['query'][_0x7538('0x32')]);_0x5bb504[_0x7538('0x33')]=qs[_0x7538('0x2a')](_[_0x7538('0x34')](_0xe09d4b[_0x7538('0x29')],_0x5e909b[_0x7538('0x2a')]));if(_0xe09d4b[_0x7538('0x29')]['filter']){_0x5bb504[_0x7538('0x33')]=_[_0x7538('0x35')](_0x5bb504['where'],{'$or':_[_0x7538('0x36')](_0x350b4f,function(_0x5b2587){if(_0x5b2587[_0x7538('0x37')][_0x7538('0x38')]!=='VIRTUAL'){var _0x13e728={};_0x13e728[_0x5b2587[_0x7538('0x39')]]={'$like':'%'+_0xe09d4b[_0x7538('0x29')]['filter']+'%'};return _0x13e728;}})});}_0x5bb504=_[_0x7538('0x35')]({},_0x5bb504,_0xe09d4b[_0x7538('0x3a')]);var _0x4ea76c={'where':_0x5bb504[_0x7538('0x33')]};return db[_0x7538('0x28')][_0x7538('0x1a')](_0x4ea76c)['then'](function(_0x25e37a){_0x2622b1[_0x7538('0x1a')]=_0x25e37a;if(_0xe09d4b[_0x7538('0x29')][_0x7538('0x3b')]){_0x5bb504['include']=[{'all':!![]}];}return db[_0x7538('0x28')][_0x7538('0x3c')](_0x5bb504);})[_0x7538('0x20')](function(_0x259241){_0x2622b1['rows']=_0x259241;return _0x2622b1;})[_0x7538('0x20')](respondWithFilteredResult(_0x3e3f1d,_0x5bb504))[_0x7538('0x3d')](handleError(_0x3e3f1d,null));};exports[_0x7538('0x3e')]=function(_0x20269d,_0xdc1d1f){var _0x3d9300={'raw':![],'where':{'id':_0x20269d[_0x7538('0x3f')]['id']}},_0x2ff098={};_0x2ff098[_0x7538('0x2c')]=_[_0x7538('0x40')](db[_0x7538('0x28')]['rawAttributes']);_0x2ff098[_0x7538('0x29')]=_[_0x7538('0x40')](_0x20269d[_0x7538('0x29')]);_0x2ff098[_0x7538('0x2a')]=_['intersection'](_0x2ff098[_0x7538('0x2c')],_0x2ff098[_0x7538('0x29')]);_0x3d9300['attributes']=_[_0x7538('0x2b')](_0x2ff098[_0x7538('0x2c')],qs[_0x7538('0x2e')](_0x20269d['query'][_0x7538('0x2e')]));_0x3d9300[_0x7538('0x2d')]=_0x3d9300['attributes'][_0x7538('0x2f')]?_0x3d9300[_0x7538('0x2d')]:_0x2ff098[_0x7538('0x2c')];if(_0x20269d['query'][_0x7538('0x3b')]){_0x3d9300[_0x7538('0x41')]=[{'all':!![]}];}_0x3d9300=_[_0x7538('0x35')]({},_0x3d9300,_0x20269d[_0x7538('0x3a')]);return db[_0x7538('0x28')][_0x7538('0x42')](_0x3d9300)[_0x7538('0x20')](handleEntityNotFound(_0xdc1d1f,null))[_0x7538('0x20')](respondWithResult(_0xdc1d1f,null))[_0x7538('0x3d')](handleError(_0xdc1d1f,null));};exports['create']=function(_0x4f4233,_0x4e1855){return db[_0x7538('0x28')][_0x7538('0x43')](_0x4f4233['body'],{})['then'](respondWithResult(_0x4e1855,0xc9))[_0x7538('0x3d')](handleError(_0x4e1855,null));};exports[_0x7538('0x1f')]=function(_0x532c75,_0x163d47){if(_0x532c75[_0x7538('0x44')]['id']){delete _0x532c75['body']['id'];}return db['VoiceAgentReport'][_0x7538('0x42')]({'where':{'id':_0x532c75[_0x7538('0x3f')]['id']}})['then'](handleEntityNotFound(_0x163d47,null))[_0x7538('0x20')](saveUpdates(_0x532c75[_0x7538('0x44')],null))[_0x7538('0x20')](respondWithResult(_0x163d47,null))[_0x7538('0x3d')](handleError(_0x163d47,null));};exports['destroy']=function(_0x4a7b4c,_0x5cf10f){return db[_0x7538('0x28')][_0x7538('0x42')]({'where':{'id':_0x4a7b4c['params']['id']}})['then'](handleEntityNotFound(_0x5cf10f,null))['then'](removeEntity(_0x5cf10f,null))['catch'](handleError(_0x5cf10f,null));};exports[_0x7538('0x45')]=function(_0x4861bb,_0x5c1e52){return db[_0x7538('0x28')]['describe']()[_0x7538('0x20')](respondWithResult(_0x5c1e52,null))[_0x7538('0x3d')](handleError(_0x5c1e52,null));}; \ No newline at end of file +var _0x66b5=['count','offset','limit','set','json','apply','reject','update','destroy','then','error','name','send','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','fields','create','body','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end'];(function(_0x50012d,_0x33ff0c){var _0x4b61aa=function(_0x5eb2a6){while(--_0x5eb2a6){_0x50012d['push'](_0x50012d['shift']());}};_0x4b61aa(++_0x33ff0c);}(_0x66b5,0x72));var _0x566b=function(_0x2202e2,_0x203b2e){_0x2202e2=_0x2202e2-0x0;var _0x24e8b6=_0x66b5[_0x2202e2];return _0x24e8b6;};'use strict';var pdf=require(_0x566b('0x0'));var emlformat=require(_0x566b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x566b('0x2'));var rp=require(_0x566b('0x3'));var moment=require(_0x566b('0x4'));var BPromise=require(_0x566b('0x5'));var Mustache=require(_0x566b('0x6'));var util=require(_0x566b('0x7'));var path=require('path');var sox=require(_0x566b('0x8'));var csv=require(_0x566b('0x9'));var ejs=require(_0x566b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x566b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x566b('0xc'));var toCsv=require(_0x566b('0x9'));var querystring=require(_0x566b('0xd'));var Papa=require(_0x566b('0xe'));var Redis=require(_0x566b('0xf'));var authService=require(_0x566b('0x10'));var qs=require(_0x566b('0x11'));var hardwareService=require(_0x566b('0x12'));var logger=require(_0x566b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x566b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee402,_0x53947d){_0x53947d=_0x53947d||0xcc;return function(_0x559cfb){if(_0x559cfb){return _0x2ee402[_0x566b('0x15')](_0x53947d);}return _0x2ee402[_0x566b('0x16')](_0x53947d)[_0x566b('0x17')]();};}function respondWithResult(_0x5e15c4,_0x50b8b7){_0x50b8b7=_0x50b8b7||0xc8;return function(_0x3dd56e){if(_0x3dd56e){return _0x5e15c4[_0x566b('0x16')](_0x50b8b7)['json'](_0x3dd56e);}};}function respondWithFilteredResult(_0x4bb07f,_0x2067c3){return function(_0x2a382f){if(_0x2a382f){var _0x152ba5=_0x2a382f[_0x566b('0x18')],_0x596c75=_0x2067c3[_0x566b('0x19')],_0x16a32f=_0x2067c3[_0x566b('0x19')]+_0x2067c3[_0x566b('0x1a')],_0x31626a;if(_0x16a32f>=_0x152ba5){_0x16a32f=_0x152ba5;_0x31626a=0xc8;}else{_0x31626a=0xce;}_0x4bb07f['status'](_0x31626a);return _0x4bb07f[_0x566b('0x1b')]('Content-Range',_0x596c75+'-'+_0x16a32f+'/'+_0x152ba5)[_0x566b('0x1c')](_0x2a382f);}return null;};}function patchUpdates(_0x31589a){return function(_0x5028a0){try{jsonpatch[_0x566b('0x1d')](_0x5028a0,_0x31589a,!![]);}catch(_0x41a681){return BPromise[_0x566b('0x1e')](_0x41a681);}return _0x5028a0['save']();};}function saveUpdates(_0x17d61b,_0x5c8786){return function(_0x5915b9){if(_0x5915b9){return _0x5915b9[_0x566b('0x1f')](_0x17d61b)['then'](function(_0x3d1926){return _0x3d1926;});}return null;};}function removeEntity(_0x551d32,_0x130d43){return function(_0x5f477c){if(_0x5f477c){return _0x5f477c[_0x566b('0x20')]()[_0x566b('0x21')](function(){_0x551d32[_0x566b('0x16')](0xcc)[_0x566b('0x17')]();});}};}function handleEntityNotFound(_0x16cb4c,_0x49ac16){return function(_0x2c3693){if(!_0x2c3693){_0x16cb4c[_0x566b('0x15')](0x194);}return _0x2c3693;};}function handleError(_0x5c75bf,_0x2e3a9f){_0x2e3a9f=_0x2e3a9f||0x1f4;return function(_0x520f5f){logger[_0x566b('0x22')](_0x520f5f['stack']);if(_0x520f5f[_0x566b('0x23')]){delete _0x520f5f[_0x566b('0x23')];}_0x5c75bf['status'](_0x2e3a9f)[_0x566b('0x24')](_0x520f5f);};}exports['index']=function(_0xb1c38c,_0xdd9b52){var _0x4719b4={},_0x2d0484={},_0x45c5c5={'count':0x0,'rows':[]};var _0x4f44f3=db[_0x566b('0x25')][_0x566b('0x26')];_0x2d0484[_0x566b('0x27')]=_[_0x566b('0x28')](_0x4f44f3);_0x2d0484[_0x566b('0x29')]=_[_0x566b('0x28')](_0xb1c38c['query']);_0x2d0484[_0x566b('0x2a')]=_[_0x566b('0x2b')](_0x2d0484[_0x566b('0x27')],_0x2d0484['query']);_0x4719b4[_0x566b('0x2c')]=_[_0x566b('0x2b')](_0x2d0484['model'],qs['fields'](_0xb1c38c['query']['fields']));_0x4719b4[_0x566b('0x2c')]=_0x4719b4['attributes'][_0x566b('0x2d')]?_0x4719b4[_0x566b('0x2c')]:_0x2d0484['model'];if(!_0xb1c38c[_0x566b('0x29')][_0x566b('0x2e')](_0x566b('0x2f'))){_0x4719b4['limit']=qs['limit'](_0xb1c38c[_0x566b('0x29')][_0x566b('0x1a')]);_0x4719b4['offset']=qs[_0x566b('0x19')](_0xb1c38c[_0x566b('0x29')]['offset']);}_0x4719b4['order']=qs[_0x566b('0x30')](_0xb1c38c[_0x566b('0x29')][_0x566b('0x30')]);_0x4719b4[_0x566b('0x31')]=qs[_0x566b('0x2a')](_[_0x566b('0x32')](_0xb1c38c['query'],_0x2d0484[_0x566b('0x2a')]));if(_0xb1c38c[_0x566b('0x29')][_0x566b('0x33')]){_0x4719b4[_0x566b('0x31')]=_['merge'](_0x4719b4[_0x566b('0x31')],{'$or':_['map'](_0x4f44f3,function(_0x24f312){if(_0x24f312[_0x566b('0x34')][_0x566b('0x35')]!==_0x566b('0x36')){var _0x3b2e4c={};_0x3b2e4c[_0x24f312[_0x566b('0x37')]]={'$like':'%'+_0xb1c38c[_0x566b('0x29')][_0x566b('0x33')]+'%'};return _0x3b2e4c;}})});}_0x4719b4=_[_0x566b('0x38')]({},_0x4719b4,_0xb1c38c[_0x566b('0x39')]);var _0x3050a4={'where':_0x4719b4[_0x566b('0x31')]};return db[_0x566b('0x25')]['count'](_0x3050a4)[_0x566b('0x21')](function(_0x4bbda7){_0x45c5c5['count']=_0x4bbda7;if(_0xb1c38c['query'][_0x566b('0x3a')]){_0x4719b4[_0x566b('0x3b')]=[{'all':!![]}];}return db[_0x566b('0x25')][_0x566b('0x3c')](_0x4719b4);})[_0x566b('0x21')](function(_0x56cb50){_0x45c5c5[_0x566b('0x3d')]=_0x56cb50;return _0x45c5c5;})[_0x566b('0x21')](respondWithFilteredResult(_0xdd9b52,_0x4719b4))[_0x566b('0x3e')](handleError(_0xdd9b52,null));};exports['show']=function(_0x511e0d,_0x184272){var _0x1c8143={'raw':![],'where':{'id':_0x511e0d[_0x566b('0x3f')]['id']}},_0x1238e1={};_0x1238e1[_0x566b('0x27')]=_[_0x566b('0x28')](db[_0x566b('0x25')]['rawAttributes']);_0x1238e1[_0x566b('0x29')]=_['keys'](_0x511e0d[_0x566b('0x29')]);_0x1238e1[_0x566b('0x2a')]=_[_0x566b('0x2b')](_0x1238e1[_0x566b('0x27')],_0x1238e1[_0x566b('0x29')]);_0x1c8143[_0x566b('0x2c')]=_[_0x566b('0x2b')](_0x1238e1[_0x566b('0x27')],qs[_0x566b('0x40')](_0x511e0d[_0x566b('0x29')]['fields']));_0x1c8143[_0x566b('0x2c')]=_0x1c8143[_0x566b('0x2c')][_0x566b('0x2d')]?_0x1c8143[_0x566b('0x2c')]:_0x1238e1[_0x566b('0x27')];if(_0x511e0d[_0x566b('0x29')][_0x566b('0x3a')]){_0x1c8143[_0x566b('0x3b')]=[{'all':!![]}];}_0x1c8143=_[_0x566b('0x38')]({},_0x1c8143,_0x511e0d['options']);return db[_0x566b('0x25')]['find'](_0x1c8143)[_0x566b('0x21')](handleEntityNotFound(_0x184272,null))[_0x566b('0x21')](respondWithResult(_0x184272,null))['catch'](handleError(_0x184272,null));};exports[_0x566b('0x41')]=function(_0x25d74a,_0x9bc528){return db[_0x566b('0x25')]['create'](_0x25d74a[_0x566b('0x42')],{})[_0x566b('0x21')](respondWithResult(_0x9bc528,0xc9))['catch'](handleError(_0x9bc528,null));};exports[_0x566b('0x1f')]=function(_0x314cd8,_0x366b3a){if(_0x314cd8[_0x566b('0x42')]['id']){delete _0x314cd8[_0x566b('0x42')]['id'];}return db[_0x566b('0x25')][_0x566b('0x43')]({'where':{'id':_0x314cd8['params']['id']}})['then'](handleEntityNotFound(_0x366b3a,null))[_0x566b('0x21')](saveUpdates(_0x314cd8[_0x566b('0x42')],null))[_0x566b('0x21')](respondWithResult(_0x366b3a,null))['catch'](handleError(_0x366b3a,null));};exports['destroy']=function(_0x3799e8,_0x2c612b){return db['VoiceAgentReport'][_0x566b('0x43')]({'where':{'id':_0x3799e8['params']['id']}})[_0x566b('0x21')](handleEntityNotFound(_0x2c612b,null))[_0x566b('0x21')](removeEntity(_0x2c612b,null))['catch'](handleError(_0x2c612b,null));};exports[_0x566b('0x44')]=function(_0x1e8d2b,_0x1aabea){return db[_0x566b('0x25')]['describe']()['then'](respondWithResult(_0x1aabea,null))[_0x566b('0x3e')](handleError(_0x1aabea,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index b0ad9ce..f7cfc3f 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 _0x62fc=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','exports','VoiceAgentReport'];(function(_0x52c1e1,_0x2994af){var _0xc95a16=function(_0x51751c){while(--_0x51751c){_0x52c1e1['push'](_0x52c1e1['shift']());}};_0xc95a16(++_0x2994af);}(_0x62fc,0x1c6));var _0xc62f=function(_0x5ae575,_0x3d46fa){_0x5ae575=_0x5ae575-0x0;var _0x8398a0=_0x62fc[_0x5ae575];return _0x8398a0;};'use strict';var _=require(_0xc62f('0x0'));var util=require(_0xc62f('0x1'));var logger=require(_0xc62f('0x2'))('api');var moment=require(_0xc62f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc62f('0x4'));var rimraf=require('rimraf');var config=require(_0xc62f('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0xc62f('0x6')]=function(_0x3fc9a0,_0x394c7a){return _0x3fc9a0['define'](_0xc62f('0x7'),attributes,{'tableName':_0xc62f('0x8'),'paranoid':![],'indexes':[{'fields':[_0xc62f('0x9'),_0xc62f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1965=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4bfd41,_0x1bced0){var _0x2d39cc=function(_0x2ce4c2){while(--_0x2ce4c2){_0x4bfd41['push'](_0x4bfd41['shift']());}};_0x2d39cc(++_0x1bced0);}(_0x1965,0x7b));var _0x5196=function(_0x231af5,_0x5dde3d){_0x231af5=_0x231af5-0x0;var _0x1dd7cd=_0x1965[_0x231af5];return _0x1dd7cd;};'use strict';var _=require(_0x5196('0x0'));var util=require(_0x5196('0x1'));var logger=require(_0x5196('0x2'))(_0x5196('0x3'));var moment=require('moment');var BPromise=require(_0x5196('0x4'));var rp=require(_0x5196('0x5'));var fs=require('fs');var path=require(_0x5196('0x6'));var rimraf=require(_0x5196('0x7'));var config=require(_0x5196('0x8'));var attributes=require(_0x5196('0x9'));module[_0x5196('0xa')]=function(_0x4c139e,_0x2a2288){return _0x4c139e['define']('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5196('0xb'),_0x5196('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 70df9a1..400492c 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x514867,_0xbc5f43){var _0x3a1b64=function(_0x4d66c4){while(--_0x4d66c4){_0x514867['push'](_0x514867['shift']());}};_0x3a1b64(++_0xbc5f43);}(_0x814b,0x1a2));var _0xb814=function(_0xc864d,_0x3443f2){_0xc864d=_0xc864d-0x0;var _0x4a1305=_0x814b[_0xc864d];return _0x4a1305;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0xc6d89e,_0x20e99c){var _0x3d5476=function(_0x268ec1){while(--_0x268ec1){_0xc6d89e['push'](_0xc6d89e['shift']());}};_0x3d5476(++_0x20e99c);}(_0x814b,0x1a2));var _0xb814=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x814b[_0x680821];return _0x3f132c;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 8cbd726..84389ae 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 _0x0b16=['delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x5d9d68,_0x15fa55){var _0x3d65ff=function(_0x31acbf){while(--_0x31acbf){_0x5d9d68['push'](_0x5d9d68['shift']());}};_0x3d65ff(++_0x15fa55);}(_0x0b16,0x111));var _0x60b1=function(_0x197e7a,_0x331a50){_0x197e7a=_0x197e7a-0x0;var _0x4d8143=_0x0b16[_0x197e7a];return _0x4d8143;};'use strict';var multer=require(_0x60b1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x60b1('0x1'));var express=require(_0x60b1('0x2'));var router=express[_0x60b1('0x3')]();var auth=require(_0x60b1('0x4'));var interaction=require(_0x60b1('0x5'));var config=require(_0x60b1('0x6'));var controller=require(_0x60b1('0x7'));router[_0x60b1('0x8')]('/',auth[_0x60b1('0x9')](),controller['index']);router[_0x60b1('0x8')]('/describe',auth[_0x60b1('0x9')](),controller['describe']);router[_0x60b1('0x8')](_0x60b1('0xa'),auth['isAuthenticated'](),controller[_0x60b1('0xb')]);router[_0x60b1('0xc')]('/',auth['isAuthenticated'](),controller[_0x60b1('0xd')]);router['put'](_0x60b1('0xa'),auth[_0x60b1('0x9')](),controller[_0x60b1('0xe')]);router[_0x60b1('0xf')](_0x60b1('0xa'),auth[_0x60b1('0x9')](),controller[_0x60b1('0x10')]);module[_0x60b1('0x11')]=router; \ No newline at end of file +var _0x414e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','express','Router'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x414e,0xdb));var _0xe414=function(_0x3ddff2,_0x1a62ea){_0x3ddff2=_0x3ddff2-0x0;var _0x31bfd7=_0x414e[_0x3ddff2];return _0x31bfd7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe414('0x0'));var router=express[_0xe414('0x1')]();var auth=require(_0xe414('0x2'));var interaction=require(_0xe414('0x3'));var config=require(_0xe414('0x4'));var controller=require(_0xe414('0x5'));router[_0xe414('0x6')]('/',auth[_0xe414('0x7')](),controller[_0xe414('0x8')]);router[_0xe414('0x6')](_0xe414('0x9'),auth[_0xe414('0x7')](),controller[_0xe414('0xa')]);router[_0xe414('0x6')](_0xe414('0xb'),auth['isAuthenticated'](),controller[_0xe414('0xc')]);router[_0xe414('0xd')]('/',auth[_0xe414('0x7')](),controller['create']);router[_0xe414('0xe')]('/:id',auth[_0xe414('0x7')](),controller[_0xe414('0xf')]);router['delete']('/:id',auth[_0xe414('0x7')](),controller['destroy']);module[_0xe414('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 6f88adc..ea72842 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 _0x78e0=['ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x4b5099,_0x511de5){var _0x95f4e5=function(_0x32ef51){while(--_0x32ef51){_0x4b5099['push'](_0x4b5099['shift']());}};_0x95f4e5(++_0x511de5);}(_0x78e0,0xa6));var _0x078e=function(_0x540fad,_0x5874e5){_0x540fad=_0x540fad-0x0;var _0x8508a2=_0x78e0[_0x540fad];return _0x8508a2;};'use strict';var Sequelize=require(_0x078e('0x0'));module[_0x078e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x078e('0x2')](_0x078e('0x3'),_0x078e('0x4'),'outbound',_0x078e('0x5'),_0x078e('0x6'),_0x078e('0x7'))},'tag':{'type':Sequelize[_0x078e('0x8')]},'accountcode':{'type':Sequelize[_0x078e('0x8')]},'source':{'type':Sequelize[_0x078e('0x8')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x078e('0x8')]},'callerid':{'type':Sequelize[_0x078e('0x8')]},'channel':{'type':Sequelize[_0x078e('0x8')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x078e('0x8')]},'lastdata':{'type':Sequelize[_0x078e('0x9')]},'starttime':{'type':Sequelize[_0x078e('0xa')]},'systemanswertime':{'type':Sequelize[_0x078e('0xa')]},'answertime':{'type':Sequelize[_0x078e('0xa')]},'endtime':{'type':Sequelize[_0x078e('0xa')]},'duration':{'type':Sequelize[_0x078e('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x078e('0x8')]},'amaflags':{'type':Sequelize[_0x078e('0x8')]},'userfield':{'type':Sequelize[_0x078e('0x8')]},'userDisposition':{'type':Sequelize[_0x078e('0x8')]},'note':{'type':Sequelize[_0x078e('0x8')]},'prefix':{'type':Sequelize[_0x078e('0x8')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x078e('0x8')]}}; \ No newline at end of file +var _0x9c8c=['INTEGER','sequelize','exports','STRING','inbound','internal','outbound','dialer','DATE'];(function(_0xafd565,_0x574cfd){var _0x45933a=function(_0x9ba0ee){while(--_0x9ba0ee){_0xafd565['push'](_0xafd565['shift']());}};_0x45933a(++_0x574cfd);}(_0x9c8c,0x12a));var _0xc9c8=function(_0x1db6f2,_0xab6ef){_0x1db6f2=_0x1db6f2-0x0;var _0x112bfc=_0x9c8c[_0x1db6f2];return _0x112bfc;};'use strict';var Sequelize=require(_0xc9c8('0x0'));module[_0xc9c8('0x1')]={'uniqueid':{'type':Sequelize[_0xc9c8('0x2')]},'type':{'type':Sequelize['ENUM'](_0xc9c8('0x3'),_0xc9c8('0x4'),_0xc9c8('0x5'),'inbound-fax','outbound-fax',_0xc9c8('0x6'))},'tag':{'type':Sequelize[_0xc9c8('0x2')]},'accountcode':{'type':Sequelize[_0xc9c8('0x2')]},'source':{'type':Sequelize[_0xc9c8('0x2')]},'destination':{'type':Sequelize[_0xc9c8('0x2')]},'destinationcontext':{'type':Sequelize[_0xc9c8('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc9c8('0x2')]},'destinationchannel':{'type':Sequelize[_0xc9c8('0x2')]},'lastapplication':{'type':Sequelize[_0xc9c8('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xc9c8('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc9c8('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc9c8('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc9c8('0x2')]},'amaflags':{'type':Sequelize[_0xc9c8('0x2')]},'userfield':{'type':Sequelize[_0xc9c8('0x2')]},'userDisposition':{'type':Sequelize[_0xc9c8('0x2')]},'note':{'type':Sequelize[_0xc9c8('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 231daf0..9fc566e 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 _0x9c44=['order','sort','where','filter','merge','map','key','field','options','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','fields','find','create','body','destroy','describe','user','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','save','update','then','error','stack','name','send','index','VoiceCallReport','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');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('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){_0x46e475[_0x49c4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x592bb8,_0x2263ae){return function(_0x15581b){if(!_0x15581b){_0x592bb8[_0x49c4('0x13')](0x194);}return _0x15581b;};}function handleError(_0xd335e4,_0x4811c4){_0x4811c4=_0x4811c4||0x1f4;return function(_0x5850f2){logger[_0x49c4('0x1c')](_0x5850f2[_0x49c4('0x1d')]);if(_0x5850f2['name']){delete _0x5850f2[_0x49c4('0x1e')];}_0xd335e4[_0x49c4('0x14')](_0x4811c4)[_0x49c4('0x1f')](_0x5850f2);};}exports[_0x49c4('0x20')]=function(_0x531d92,_0x543ea2){var _0x449960={},_0x53c199={},_0x3800b7={'count':0x0,'rows':[]};var _0x3852b2=db[_0x49c4('0x21')][_0x49c4('0x22')];_0x53c199['model']=_[_0x49c4('0x23')](_0x3852b2);_0x53c199[_0x49c4('0x24')]=_[_0x49c4('0x23')](_0x531d92[_0x49c4('0x24')]);_0x53c199[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],_0x53c199[_0x49c4('0x24')]);_0x449960[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],qs['fields'](_0x531d92['query']['fields']));_0x449960[_0x49c4('0x28')]=_0x449960[_0x49c4('0x28')][_0x49c4('0x29')]?_0x449960[_0x49c4('0x28')]:_0x53c199[_0x49c4('0x27')];if(!_0x531d92['query'][_0x49c4('0x2a')](_0x49c4('0x2b'))){_0x449960[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x531d92['query']['limit']);_0x449960[_0x49c4('0x17')]=qs[_0x49c4('0x17')](_0x531d92[_0x49c4('0x24')][_0x49c4('0x17')]);}_0x449960[_0x49c4('0x2c')]=qs['sort'](_0x531d92[_0x49c4('0x24')][_0x49c4('0x2d')]);_0x449960[_0x49c4('0x2e')]=qs['filters'](_['pick'](_0x531d92[_0x49c4('0x24')],_0x53c199[_0x49c4('0x25')]));if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]){_0x449960[_0x49c4('0x2e')]=_[_0x49c4('0x30')](_0x449960[_0x49c4('0x2e')],{'$or':_[_0x49c4('0x31')](_0x3852b2,function(_0x3209cd){if(_0x3209cd['type'][_0x49c4('0x32')]!=='VIRTUAL'){var _0xdda586={};_0xdda586[_0x3209cd[_0x49c4('0x33')]]={'$like':'%'+_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]+'%'};return _0xdda586;}})});}_0x449960=_['merge']({},_0x449960,_0x531d92[_0x49c4('0x34')]);var _0x31f3ff={'where':_0x449960[_0x49c4('0x2e')]};return db['VoiceCallReport'][_0x49c4('0x16')](_0x31f3ff)[_0x49c4('0x1b')](function(_0x178987){_0x3800b7[_0x49c4('0x16')]=_0x178987;if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x35')]){_0x449960[_0x49c4('0x36')]=[{'attributes':['id',_0x49c4('0x1e'),_0x49c4('0x37'),_0x49c4('0x38')],'model':db[_0x49c4('0x39')],'as':'User'}];}return db[_0x49c4('0x21')][_0x49c4('0x3a')](_0x449960);})[_0x49c4('0x1b')](function(_0x23aa32){_0x3800b7[_0x49c4('0x3b')]=_0x23aa32;return _0x3800b7;})[_0x49c4('0x1b')](respondWithFilteredResult(_0x543ea2,_0x449960))[_0x49c4('0x3c')](handleError(_0x543ea2,null));};exports[_0x49c4('0x3d')]=function(_0x248c0a,_0x2668ed){var _0x2dffb4={'raw':!![],'where':{'id':_0x248c0a[_0x49c4('0x3e')]['id']}},_0xa3d59e={};_0xa3d59e['model']=_[_0x49c4('0x23')](db['VoiceCallReport'][_0x49c4('0x22')]);_0xa3d59e[_0x49c4('0x24')]=_[_0x49c4('0x23')](_0x248c0a[_0x49c4('0x24')]);_0xa3d59e[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0xa3d59e['model'],_0xa3d59e['query']);_0x2dffb4[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0xa3d59e[_0x49c4('0x27')],qs[_0x49c4('0x3f')](_0x248c0a['query'][_0x49c4('0x3f')]));_0x2dffb4[_0x49c4('0x28')]=_0x2dffb4[_0x49c4('0x28')][_0x49c4('0x29')]?_0x2dffb4[_0x49c4('0x28')]:_0xa3d59e[_0x49c4('0x27')];if(_0x248c0a[_0x49c4('0x24')][_0x49c4('0x35')]){_0x2dffb4[_0x49c4('0x36')]=[{'all':!![]}];}_0x2dffb4=_['merge']({},_0x2dffb4,_0x248c0a[_0x49c4('0x34')]);return db['VoiceCallReport'][_0x49c4('0x40')](_0x2dffb4)[_0x49c4('0x1b')](handleEntityNotFound(_0x2668ed,null))[_0x49c4('0x1b')](respondWithResult(_0x2668ed,null))[_0x49c4('0x3c')](handleError(_0x2668ed,null));};exports[_0x49c4('0x41')]=function(_0x5b296d,_0x592e8e){return db[_0x49c4('0x21')][_0x49c4('0x41')](_0x5b296d[_0x49c4('0x42')],{})[_0x49c4('0x1b')](respondWithResult(_0x592e8e,0xc9))[_0x49c4('0x3c')](handleError(_0x592e8e,null));};exports[_0x49c4('0x43')]=function(_0x4d89e0,_0x3bac1b){return db['VoiceCallReport'][_0x49c4('0x40')]({'where':{'id':_0x4d89e0[_0x49c4('0x3e')]['id']}})[_0x49c4('0x1b')](handleEntityNotFound(_0x3bac1b,null))[_0x49c4('0x1b')](removeEntity(_0x3bac1b,null))[_0x49c4('0x3c')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x44')]=function(_0x2c6be1,_0x506c71){return db[_0x49c4('0x21')][_0x49c4('0x44')]()['then'](respondWithResult(_0x506c71,null))[_0x49c4('0x3c')](handleError(_0x506c71,null));};exports[_0x49c4('0x1a')]=function(_0xfbe179,_0x242afc){if(_0xfbe179['body']['uniqueid']){delete _0xfbe179[_0x49c4('0x42')]['uniqueid'];}return db[_0x49c4('0x21')][_0x49c4('0x40')]({'where':{'uniqueid':_0xfbe179[_0x49c4('0x3e')]['id'],'UserId':{'$or':[null,_0xfbe179[_0x49c4('0x45')]['id']]}}})[_0x49c4('0x1b')](handleEntityNotFound(_0x242afc,null))[_0x49c4('0x1b')](saveUpdates(_0xfbe179[_0x49c4('0x42')],null))['then'](respondWithResult(_0x242afc,null))[_0x49c4('0x3c')](handleError(_0x242afc,null));}; \ No newline at end of file +var _0xe706=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceCallReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','fullname','alias','User','findAll','rows','catch','params','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0xe706,0xa3));var _0x6e70=function(_0x22dbd1,_0x47e0bb){_0x22dbd1=_0x22dbd1-0x0;var _0x50a4fd=_0xe706[_0x22dbd1];return _0x50a4fd;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var hardwareService=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'attributes':['id',_0x6e70('0x29'),_0x6e70('0x46'),_0x6e70('0x47')],'model':db[_0x6e70('0x48')],'as':'User'}];}return db[_0x6e70('0x2c')][_0x6e70('0x49')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x31cad2){_0x3af17f[_0x6e70('0x4a')]=_0x31cad2;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x4b')](handleError(_0x4a67ac,null));};exports['show']=function(_0x56ea6e,_0x5ae898){var _0x154e0c={'raw':!![],'where':{'id':_0x56ea6e[_0x6e70('0x4c')]['id']}},_0x2b63cc={};_0x2b63cc[_0x6e70('0x32')]=_[_0x6e70('0x2e')](db['VoiceCallReport'][_0x6e70('0x2d')]);_0x2b63cc[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x56ea6e['query']);_0x2b63cc['filters']=_['intersection'](_0x2b63cc[_0x6e70('0x32')],_0x2b63cc['query']);_0x154e0c[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2b63cc[_0x6e70('0x32')],qs[_0x6e70('0x34')](_0x56ea6e['query'][_0x6e70('0x34')]));_0x154e0c['attributes']=_0x154e0c[_0x6e70('0x33')][_0x6e70('0x35')]?_0x154e0c[_0x6e70('0x33')]:_0x2b63cc[_0x6e70('0x32')];if(_0x56ea6e['query'][_0x6e70('0x44')]){_0x154e0c[_0x6e70('0x45')]=[{'all':!![]}];}_0x154e0c=_[_0x6e70('0x3d')]({},_0x154e0c,_0x56ea6e[_0x6e70('0x43')]);return db[_0x6e70('0x2c')][_0x6e70('0x4d')](_0x154e0c)[_0x6e70('0x26')](handleEntityNotFound(_0x5ae898,null))['then'](respondWithResult(_0x5ae898,null))[_0x6e70('0x4b')](handleError(_0x5ae898,null));};exports[_0x6e70('0x4e')]=function(_0x10de2a,_0x2f99cb){return db[_0x6e70('0x2c')][_0x6e70('0x4e')](_0x10de2a[_0x6e70('0x4f')],{})['then'](respondWithResult(_0x2f99cb,0xc9))[_0x6e70('0x4b')](handleError(_0x2f99cb,null));};exports['destroy']=function(_0x11794e,_0x3836e4){return db['VoiceCallReport']['find']({'where':{'id':_0x11794e[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x3836e4,null))[_0x6e70('0x26')](removeEntity(_0x3836e4,null))['catch'](handleError(_0x3836e4,null));};exports['describe']=function(_0x238ebb,_0x11ac3d){return db[_0x6e70('0x2c')][_0x6e70('0x50')]()[_0x6e70('0x26')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['update']=function(_0x756a5b,_0x3aa1a6){if(_0x756a5b[_0x6e70('0x4f')][_0x6e70('0x51')]){delete _0x756a5b[_0x6e70('0x4f')]['uniqueid'];}return db['VoiceCallReport'][_0x6e70('0x4d')]({'where':{'uniqueid':_0x756a5b[_0x6e70('0x4c')]['id'],'UserId':{'$or':[null,_0x756a5b[_0x6e70('0x52')]['id']]}}})[_0x6e70('0x26')](handleEntityNotFound(_0x3aa1a6,null))[_0x6e70('0x26')](saveUpdates(_0x756a5b['body'],null))[_0x6e70('0x26')](respondWithResult(_0x3aa1a6,null))[_0x6e70('0x4b')](handleError(_0x3aa1a6,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 8df7412..335218f 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 _0x16c9=['request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4f4eae,_0x14d90f){var _0x1c6476=function(_0x42d365){while(--_0x42d365){_0x4f4eae['push'](_0x4f4eae['shift']());}};_0x1c6476(++_0x14d90f);}(_0x16c9,0xa0));var _0x916c=function(_0x5df2be,_0x1207fc){_0x5df2be=_0x5df2be-0x0;var _0x14badf=_0x16c9[_0x5df2be];return _0x14badf;};'use strict';var _=require(_0x916c('0x0'));var util=require(_0x916c('0x1'));var logger=require(_0x916c('0x2'))('api');var moment=require(_0x916c('0x3'));var BPromise=require(_0x916c('0x4'));var rp=require(_0x916c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x916c('0x6'));var config=require(_0x916c('0x7'));var attributes=require(_0x916c('0x8'));module['exports']=function(_0x226b8d,_0x288b50){return _0x226b8d[_0x916c('0x9')](_0x916c('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a38=['VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x159297,_0xfe7f38){var _0xbb4314=function(_0x68a1b7){while(--_0x68a1b7){_0x159297['push'](_0x159297['shift']());}};_0xbb4314(++_0xfe7f38);}(_0x7a38,0x1c3));var _0x87a3=function(_0x377508,_0x5dfce9){_0x377508=_0x377508-0x0;var _0x530f92=_0x7a38[_0x377508];return _0x530f92;};'use strict';var _=require(_0x87a3('0x0'));var util=require(_0x87a3('0x1'));var logger=require(_0x87a3('0x2'))(_0x87a3('0x3'));var moment=require(_0x87a3('0x4'));var BPromise=require(_0x87a3('0x5'));var rp=require(_0x87a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x87a3('0x7'));var attributes=require(_0x87a3('0x8'));module[_0x87a3('0x9')]=function(_0x46481d,_0x241172){return _0x46481d[_0x87a3('0xa')](_0x87a3('0xb'),attributes,{'tableName':_0x87a3('0xc'),'paranoid':![],'indexes':[{'fields':[_0x87a3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 0950858..53b449f 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 _0x598e=['VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_0x598e,0xcd));var _0xe598=function(_0x863c21,_0x16689a){_0x863c21=_0x863c21-0x0;var _0x261dd9=_0x598e[_0x863c21];return _0x261dd9;};'use strict';var _=require('lodash');var util=require(_0xe598('0x0'));var moment=require(_0xe598('0x1'));var BPromise=require(_0xe598('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe598('0x3'));var db=require(_0xe598('0x4'))['db'];var utils=require(_0xe598('0x5'));var logger=require(_0xe598('0x6'))(_0xe598('0x7'));var config=require('../../config/environment');var jayson=require(_0xe598('0x8'));var client=jayson[_0xe598('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14c776,_0x46c5fa,_0x7c6f60){return new BPromise(function(_0x48f135,_0x499d24){return client['request'](_0x14c776,_0x7c6f60)[_0xe598('0xa')](function(_0x39043a){logger[_0xe598('0xb')](_0xe598('0xc'),_0x46c5fa,_0xe598('0xd'));logger[_0xe598('0xe')](_0xe598('0xf'),_0x46c5fa,_0xe598('0xd'),JSON[_0xe598('0x10')](_0x39043a));if(_0x39043a[_0xe598('0x11')]){if(_0x39043a['error'][_0xe598('0x12')]===0x1f4){logger[_0xe598('0x11')](_0xe598('0xc'),_0x46c5fa,_0x39043a['error'][_0xe598('0x13')]);return _0x499d24(_0x39043a[_0xe598('0x11')]['message']);}logger['error'](_0xe598('0xc'),_0x46c5fa,_0x39043a[_0xe598('0x11')][_0xe598('0x13')]);return _0x48f135(_0x39043a[_0xe598('0x11')][_0xe598('0x13')]);}else{logger[_0xe598('0xb')](_0xe598('0xc'),_0x46c5fa,_0xe598('0xd'));_0x48f135(_0x39043a[_0xe598('0x14')][_0xe598('0x13')]);}})[_0xe598('0x15')](function(_0x40cb5f){logger[_0xe598('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x46c5fa,_0x40cb5f);_0x499d24(_0x40cb5f);});});}exports[_0xe598('0x16')]=function(_0x26d383){var _0x2df5c8=this;return new Promise(function(_0x128edc,_0x5cf981){return db[_0xe598('0x17')][_0xe598('0x18')]({'raw':_0x26d383[_0xe598('0x19')]?_0x26d383[_0xe598('0x19')][_0xe598('0x1a')]===undefined?!![]:![]:!![],'where':_0x26d383[_0xe598('0x19')]?_0x26d383[_0xe598('0x19')][_0xe598('0x1b')]||null:null,'attributes':_0x26d383[_0xe598('0x19')]?_0x26d383[_0xe598('0x19')]['attributes']||null:null,'limit':_0x26d383[_0xe598('0x19')]?_0x26d383[_0xe598('0x19')][_0xe598('0x1c')]||null:null,'include':_0x26d383[_0xe598('0x19')]?_0x26d383[_0xe598('0x19')][_0xe598('0x1d')]?_[_0xe598('0x1e')](_0x26d383[_0xe598('0x19')][_0xe598('0x1d')],function(_0x45aff4){return{'model':db[_0x45aff4[_0xe598('0x1f')]],'as':_0x45aff4['as'],'attributes':_0x45aff4[_0xe598('0x20')],'include':_0x45aff4['include']?_[_0xe598('0x1e')](_0x45aff4['include'],function(_0x4ef853){return{'model':db[_0x4ef853['model']],'as':_0x4ef853['as'],'attributes':_0x4ef853[_0xe598('0x20')],'include':_0x4ef853[_0xe598('0x1d')]?_['map'](_0x4ef853[_0xe598('0x1d')],function(_0x2ee8ac){return{'model':db[_0x2ee8ac['model']],'as':_0x2ee8ac['as'],'attributes':_0x2ee8ac[_0xe598('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x153218){logger['info'](_0xe598('0x16'),_0x26d383);logger[_0xe598('0xe')]('GetVoiceCallReport',_0x26d383,JSON[_0xe598('0x10')](_0x153218));_0x128edc(_0x153218);})[_0xe598('0x15')](function(_0xe39d08){logger['error']('GetVoiceCallReport',_0xe39d08['message'],_0x26d383);_0x5cf981(_0x2df5c8['error'](0x1f4,_0xe39d08['message']));});});};exports[_0xe598('0x21')]=function(_0x2e67ee){var _0x3fd8f9=this;return new Promise(function(_0x3aea8e,_0x31e333){return db[_0xe598('0x17')][_0xe598('0x22')](_0x2e67ee[_0xe598('0x23')],{'raw':_0x2e67ee[_0xe598('0x19')]?_0x2e67ee[_0xe598('0x19')][_0xe598('0x1a')]===undefined?!![]:![]:!![]})[_0xe598('0xa')](function(_0x50ff25){logger[_0xe598('0xb')](_0xe598('0x21'),_0x2e67ee);logger[_0xe598('0xe')](_0xe598('0x21'),_0x2e67ee,JSON['stringify'](_0x50ff25));_0x3aea8e(_0x50ff25);})[_0xe598('0x15')](function(_0x5aafdc){logger[_0xe598('0x11')](_0xe598('0x21'),_0x5aafdc['message'],_0x2e67ee);_0x31e333(_0x3fd8f9['error'](0x1f4,_0x5aafdc['message']));});});};exports['UpdateVoiceCallReport']=function(_0x25ecd6){var _0x4dc3ed=this;return new Promise(function(_0xe84421,_0x9c501d){return db[_0xe598('0x17')][_0xe598('0x24')](_0x25ecd6[_0xe598('0x23')],{'raw':_0x25ecd6[_0xe598('0x19')]?_0x25ecd6[_0xe598('0x19')][_0xe598('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25ecd6[_0xe598('0x19')]?_0x25ecd6[_0xe598('0x19')][_0xe598('0x1b')]||null:null,'attributes':_0x25ecd6['options']?_0x25ecd6['options'][_0xe598('0x20')]||null:null,'limit':_0x25ecd6[_0xe598('0x19')]?_0x25ecd6[_0xe598('0x19')][_0xe598('0x1c')]||null:null})[_0xe598('0xa')](function(_0x476d90){logger[_0xe598('0xb')](_0xe598('0x25'),_0x25ecd6);logger[_0xe598('0xe')](_0xe598('0x25'),_0x25ecd6,JSON[_0xe598('0x10')](_0x476d90));_0xe84421(_0x476d90);})[_0xe598('0x15')](function(_0x504bd4){logger[_0xe598('0x11')](_0xe598('0x25'),_0x504bd4[_0xe598('0x13')],_0x25ecd6);_0x9c501d(_0x4dc3ed[_0xe598('0x11')](0x1f4,_0x504bd4['message']));});});}; \ No newline at end of file +var _0xcea5=['result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x245de4,_0x32030c){var _0x2401be=function(_0xc1d6e7){while(--_0xc1d6e7){_0x245de4['push'](_0x245de4['shift']());}};_0x2401be(++_0x32030c);}(_0xcea5,0x198));var _0x5cea=function(_0x53bcf2,_0x35f8e9){_0x53bcf2=_0x53bcf2-0x0;var _0x17766c=_0xcea5[_0x53bcf2];return _0x17766c;};'use strict';var _=require('lodash');var util=require(_0x5cea('0x0'));var moment=require('moment');var BPromise=require(_0x5cea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cea('0x2'));var db=require(_0x5cea('0x3'))['db'];var utils=require(_0x5cea('0x4'));var logger=require(_0x5cea('0x5'))(_0x5cea('0x6'));var config=require('../../config/environment');var jayson=require(_0x5cea('0x7'));var client=jayson[_0x5cea('0x8')][_0x5cea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47f54c,_0x1bb514,_0x10ecec){return new BPromise(function(_0x5a40c9,_0x3ee61b){return client[_0x5cea('0xa')](_0x47f54c,_0x10ecec)[_0x5cea('0xb')](function(_0x522c0c){logger[_0x5cea('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x1bb514,'request\x20sent');logger[_0x5cea('0xd')](_0x5cea('0xe'),_0x1bb514,_0x5cea('0xf'),JSON[_0x5cea('0x10')](_0x522c0c));if(_0x522c0c[_0x5cea('0x11')]){if(_0x522c0c[_0x5cea('0x11')][_0x5cea('0x12')]===0x1f4){logger[_0x5cea('0x11')](_0x5cea('0x13'),_0x1bb514,_0x522c0c[_0x5cea('0x11')]['message']);return _0x3ee61b(_0x522c0c['error'][_0x5cea('0x14')]);}logger[_0x5cea('0x11')](_0x5cea('0x13'),_0x1bb514,_0x522c0c[_0x5cea('0x11')]['message']);return _0x5a40c9(_0x522c0c[_0x5cea('0x11')][_0x5cea('0x14')]);}else{logger['info'](_0x5cea('0x13'),_0x1bb514,_0x5cea('0xf'));_0x5a40c9(_0x522c0c[_0x5cea('0x15')][_0x5cea('0x14')]);}})[_0x5cea('0x16')](function(_0x3f0b1c){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1bb514,_0x3f0b1c);_0x3ee61b(_0x3f0b1c);});});}exports[_0x5cea('0x17')]=function(_0x25d3ac){var _0x28dd94=this;return new Promise(function(_0x579ac7,_0x3bb9f7){return db[_0x5cea('0x18')][_0x5cea('0x19')]({'raw':_0x25d3ac[_0x5cea('0x1a')]?_0x25d3ac[_0x5cea('0x1a')][_0x5cea('0x1b')]===undefined?!![]:![]:!![],'where':_0x25d3ac['options']?_0x25d3ac[_0x5cea('0x1a')][_0x5cea('0x1c')]||null:null,'attributes':_0x25d3ac[_0x5cea('0x1a')]?_0x25d3ac[_0x5cea('0x1a')]['attributes']||null:null,'limit':_0x25d3ac[_0x5cea('0x1a')]?_0x25d3ac[_0x5cea('0x1a')][_0x5cea('0x1d')]||null:null,'include':_0x25d3ac[_0x5cea('0x1a')]?_0x25d3ac['options'][_0x5cea('0x1e')]?_[_0x5cea('0x1f')](_0x25d3ac[_0x5cea('0x1a')]['include'],function(_0x4ff0f7){return{'model':db[_0x4ff0f7[_0x5cea('0x20')]],'as':_0x4ff0f7['as'],'attributes':_0x4ff0f7[_0x5cea('0x21')],'include':_0x4ff0f7[_0x5cea('0x1e')]?_[_0x5cea('0x1f')](_0x4ff0f7['include'],function(_0x5da068){return{'model':db[_0x5da068['model']],'as':_0x5da068['as'],'attributes':_0x5da068[_0x5cea('0x21')],'include':_0x5da068[_0x5cea('0x1e')]?_['map'](_0x5da068[_0x5cea('0x1e')],function(_0x2a62b7){return{'model':db[_0x2a62b7[_0x5cea('0x20')]],'as':_0x2a62b7['as'],'attributes':_0x2a62b7[_0x5cea('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da154){logger[_0x5cea('0xc')](_0x5cea('0x17'),_0x25d3ac);logger['debug'](_0x5cea('0x17'),_0x25d3ac,JSON[_0x5cea('0x10')](_0x3da154));_0x579ac7(_0x3da154);})[_0x5cea('0x16')](function(_0x268116){logger[_0x5cea('0x11')](_0x5cea('0x17'),_0x268116[_0x5cea('0x14')],_0x25d3ac);_0x3bb9f7(_0x28dd94['error'](0x1f4,_0x268116['message']));});});};exports[_0x5cea('0x22')]=function(_0x19b498){var _0x3536c3=this;return new Promise(function(_0x41be13,_0x19b64e){return db['VoiceCallReport'][_0x5cea('0x23')](_0x19b498[_0x5cea('0x24')],{'raw':_0x19b498[_0x5cea('0x1a')]?_0x19b498[_0x5cea('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x5cea('0xb')](function(_0x2bd528){logger[_0x5cea('0xc')](_0x5cea('0x22'),_0x19b498);logger['debug']('CreateVoiceCallReport',_0x19b498,JSON[_0x5cea('0x10')](_0x2bd528));_0x41be13(_0x2bd528);})[_0x5cea('0x16')](function(_0x1dfaf8){logger[_0x5cea('0x11')](_0x5cea('0x22'),_0x1dfaf8[_0x5cea('0x14')],_0x19b498);_0x19b64e(_0x3536c3[_0x5cea('0x11')](0x1f4,_0x1dfaf8[_0x5cea('0x14')]));});});};exports[_0x5cea('0x25')]=function(_0xe67ceb){var _0x4ea304=this;return new Promise(function(_0x289aa4,_0x3f5bdf){return db[_0x5cea('0x18')][_0x5cea('0x26')](_0xe67ceb['body'],{'raw':_0xe67ceb[_0x5cea('0x1a')]?_0xe67ceb[_0x5cea('0x1a')][_0x5cea('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe67ceb['options']?_0xe67ceb[_0x5cea('0x1a')][_0x5cea('0x1c')]||null:null,'attributes':_0xe67ceb[_0x5cea('0x1a')]?_0xe67ceb[_0x5cea('0x1a')][_0x5cea('0x21')]||null:null,'limit':_0xe67ceb[_0x5cea('0x1a')]?_0xe67ceb[_0x5cea('0x1a')][_0x5cea('0x1d')]||null:null})[_0x5cea('0xb')](function(_0x4a36ec){logger[_0x5cea('0xc')]('UpdateVoiceCallReport',_0xe67ceb);logger[_0x5cea('0xd')]('UpdateVoiceCallReport',_0xe67ceb,JSON[_0x5cea('0x10')](_0x4a36ec));_0x289aa4(_0x4a36ec);})[_0x5cea('0x16')](function(_0x4430df){logger[_0x5cea('0x11')](_0x5cea('0x25'),_0x4430df[_0x5cea('0x14')],_0xe67ceb);_0x3f5bdf(_0x4ea304[_0x5cea('0x11')](0x1f4,_0x4430df['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c7931d5..10d0bfa 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 _0x4bb4=['get','isAuthenticated','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x21d0b8,_0x3bba51){var _0x4de4b1=function(_0x3e8b8f){while(--_0x3e8b8f){_0x21d0b8['push'](_0x21d0b8['shift']());}};_0x4de4b1(++_0x3bba51);}(_0x4bb4,0x13a));var _0x44bb=function(_0x160790,_0x2c237f){_0x160790=_0x160790-0x0;var _0x149050=_0x4bb4[_0x160790];return _0x149050;};'use strict';var multer=require(_0x44bb('0x0'));var util=require('util');var path=require(_0x44bb('0x1'));var timeout=require(_0x44bb('0x2'));var express=require(_0x44bb('0x3'));var router=express[_0x44bb('0x4')]();var auth=require(_0x44bb('0x5'));var interaction=require(_0x44bb('0x6'));var config=require(_0x44bb('0x7'));var controller=require(_0x44bb('0x8'));router[_0x44bb('0x9')]('/',auth[_0x44bb('0xa')](),controller['index']);router[_0x44bb('0x9')](_0x44bb('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x44bb('0xa')](),controller[_0x44bb('0xc')]);router['put'](_0x44bb('0xb'),auth[_0x44bb('0xa')](),controller[_0x44bb('0xd')]);router[_0x44bb('0xe')]('/:id',auth[_0x44bb('0xa')](),controller[_0x44bb('0xf')]);module[_0x44bb('0x10')]=router; \ No newline at end of file +var _0x3dd5=['/:id','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3dd5,0x73));var _0x53dd=function(_0x282933,_0x587b59){_0x282933=_0x282933-0x0;var _0x4585e3=_0x3dd5[_0x282933];return _0x4585e3;};'use strict';var multer=require(_0x53dd('0x0'));var util=require('util');var path=require(_0x53dd('0x1'));var timeout=require(_0x53dd('0x2'));var express=require(_0x53dd('0x3'));var router=express[_0x53dd('0x4')]();var auth=require(_0x53dd('0x5'));var interaction=require(_0x53dd('0x6'));var config=require(_0x53dd('0x7'));var controller=require(_0x53dd('0x8'));router[_0x53dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x53dd('0xa')]);router[_0x53dd('0x9')](_0x53dd('0xb'),auth[_0x53dd('0xc')](),controller['show']);router['post']('/',auth[_0x53dd('0xc')](),controller['create']);router[_0x53dd('0xd')](_0x53dd('0xb'),auth[_0x53dd('0xc')](),controller[_0x53dd('0xe')]);router[_0x53dd('0xf')]('/:id',auth[_0x53dd('0xc')](),controller[_0x53dd('0x10')]);module[_0x53dd('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 87ba20f..788b695 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 _0xbf53=['exports','STRING','setDataValue','join','getDataValue','options','BOOLEAN','sequelize'];(function(_0x3c86e8,_0x42e6ac){var _0x16fd4f=function(_0x2647b9){while(--_0x2647b9){_0x3c86e8['push'](_0x3c86e8['shift']());}};_0x16fd4f(++_0x42e6ac);}(_0xbf53,0xcf));var _0x3bf5=function(_0x52a92e,_0x338e7a){_0x52a92e=_0x52a92e-0x0;var _0xd4ee84=_0xbf53[_0x52a92e];return _0xd4ee84;};'use strict';var Sequelize=require(_0x3bf5('0x0'));module[_0x3bf5('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3bf5('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x3bf5('0x2')],'set':function(_0x59f688){this[_0x3bf5('0x3')]('options',_0x59f688?_0x59f688[_0x3bf5('0x4')](''):[]);},'get':function(){return this[_0x3bf5('0x5')](_0x3bf5('0x6'))?this[_0x3bf5('0x5')](_0x3bf5('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0x3bf5('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x3bf5('0x2')]},'record':{'type':Sequelize[_0x3bf5('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3bf5('0x2')]}}; \ No newline at end of file +var _0x0a5e=['join','getDataValue','split','BOOLEAN','sequelize','STRING','options'];(function(_0x6fa9ae,_0x2aecce){var _0x2c0821=function(_0x20911a){while(--_0x20911a){_0x6fa9ae['push'](_0x6fa9ae['shift']());}};_0x2c0821(++_0x2aecce);}(_0x0a5e,0x1e7));var _0xe0a5=function(_0x7f3892,_0x28ba0b){_0x7f3892=_0x7f3892-0x0;var _0xf029a9=_0x0a5e[_0x7f3892];return _0xf029a9;};'use strict';var Sequelize=require(_0xe0a5('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0a5('0x1')]},'prefix':{'type':Sequelize[_0xe0a5('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xe0a5('0x1')],'set':function(_0x403f3a){this['setDataValue'](_0xe0a5('0x2'),_0x403f3a?_0x403f3a[_0xe0a5('0x3')](''):[]);},'get':function(){return this[_0xe0a5('0x4')](_0xe0a5('0x2'))?this[_0xe0a5('0x4')]('options')[_0xe0a5('0x5')](''):[];}},'auth':{'type':Sequelize[_0xe0a5('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xe0a5('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe0a5('0x1')]},'description':{'type':Sequelize[_0xe0a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index ce0363a..a023f24 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 _0xec9a=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','rawAttributes','include','find','catch','create','body','user','get','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','keys','query','filters','model'];(function(_0x310b01,_0x2465b6){var _0x35fe04=function(_0x10c142){while(--_0x10c142){_0x310b01['push'](_0x310b01['shift']());}};_0x35fe04(++_0x2465b6);}(_0xec9a,0xb0));var _0xaec9=function(_0x3955eb,_0x5b43f1){_0x3955eb=_0x3955eb-0x0;var _0x268cdd=_0xec9a[_0x3955eb];return _0x268cdd;};'use strict';var pdf=require(_0xaec9('0x0'));var emlformat=require(_0xaec9('0x1'));var rimraf=require(_0xaec9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaec9('0x3'));var rp=require(_0xaec9('0x4'));var moment=require('moment');var BPromise=require(_0xaec9('0x5'));var Mustache=require('mustache');var util=require(_0xaec9('0x6'));var path=require(_0xaec9('0x7'));var sox=require(_0xaec9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xaec9('0x9'));var squel=require('squel');var crypto=require(_0xaec9('0xa'));var jsforce=require(_0xaec9('0xb'));var deskjs=require(_0xaec9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaec9('0xd'));var Papa=require(_0xaec9('0xe'));var Redis=require(_0xaec9('0xf'));var authService=require(_0xaec9('0x10'));var qs=require(_0xaec9('0x11'));var hardwareService=require(_0xaec9('0x12'));var logger=require(_0xaec9('0x13'))(_0xaec9('0x14'));var utils=require('../../config/utils');var config=require(_0xaec9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34a1cd,_0x20236c){_0x20236c=_0x20236c||0xcc;return function(_0xd6dc8){if(_0xd6dc8){return _0x34a1cd[_0xaec9('0x16')](_0x20236c);}return _0x34a1cd[_0xaec9('0x17')](_0x20236c)[_0xaec9('0x18')]();};}function respondWithResult(_0x4fa27c,_0x43517d){_0x43517d=_0x43517d||0xc8;return function(_0x399c70){if(_0x399c70){return _0x4fa27c[_0xaec9('0x17')](_0x43517d)[_0xaec9('0x19')](_0x399c70);}};}function respondWithFilteredResult(_0x526d01,_0x57675d){return function(_0x13ab87){if(_0x13ab87){var _0x144120=_0x13ab87[_0xaec9('0x1a')],_0x26637a=_0x57675d[_0xaec9('0x1b')],_0x11081d=_0x57675d[_0xaec9('0x1b')]+_0x57675d[_0xaec9('0x1c')],_0x5c7b35;if(_0x11081d>=_0x144120){_0x11081d=_0x144120;_0x5c7b35=0xc8;}else{_0x5c7b35=0xce;}_0x526d01[_0xaec9('0x17')](_0x5c7b35);return _0x526d01[_0xaec9('0x1d')]('Content-Range',_0x26637a+'-'+_0x11081d+'/'+_0x144120)['json'](_0x13ab87);}return null;};}function patchUpdates(_0x14c73f){return function(_0xdf3e7){try{jsonpatch['apply'](_0xdf3e7,_0x14c73f,!![]);}catch(_0xb8173d){return BPromise[_0xaec9('0x1e')](_0xb8173d);}return _0xdf3e7[_0xaec9('0x1f')]();};}function saveUpdates(_0x1b183b,_0x18e8f3){return function(_0x5c9bc7){if(_0x5c9bc7){return _0x5c9bc7[_0xaec9('0x20')](_0x1b183b)[_0xaec9('0x21')](function(_0x527640){return _0x527640;});}return null;};}function removeEntity(_0x155336,_0x36c94c){return function(_0x434e40){if(_0x434e40){return _0x434e40[_0xaec9('0x22')]()['then'](function(){var _0x364ebe=_0x434e40['get']({'plain':!![]});var _0x13e8a9=_0xaec9('0x23');return db[_0xaec9('0x24')][_0xaec9('0x22')]({'where':{'type':_0x13e8a9,'resourceId':_0x364ebe['id']}})[_0xaec9('0x21')](function(){return _0x434e40;});})[_0xaec9('0x21')](function(){_0x155336[_0xaec9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4e67,_0x4f2a99){return function(_0x3aeeed){if(!_0x3aeeed){_0x5e4e67[_0xaec9('0x16')](0x194);}return _0x3aeeed;};}function handleError(_0x16475c,_0x4ee50a){_0x4ee50a=_0x4ee50a||0x1f4;return function(_0x1be8f5){logger[_0xaec9('0x25')](_0x1be8f5[_0xaec9('0x26')]);if(_0x1be8f5[_0xaec9('0x27')]){delete _0x1be8f5['name'];}_0x16475c[_0xaec9('0x17')](_0x4ee50a)['send'](_0x1be8f5);};}exports[_0xaec9('0x28')]=function(_0x41fee5,_0x4cc74c){var _0x917929={},_0x5704d7={},_0x4563db={'count':0x0,'rows':[]};var _0x46896e=db[_0xaec9('0x29')]['rawAttributes'];_0x5704d7['model']=_[_0xaec9('0x2a')](_0x46896e);_0x5704d7[_0xaec9('0x2b')]=_['keys'](_0x41fee5['query']);_0x5704d7[_0xaec9('0x2c')]=_['intersection'](_0x5704d7[_0xaec9('0x2d')],_0x5704d7[_0xaec9('0x2b')]);_0x917929[_0xaec9('0x2e')]=_[_0xaec9('0x2f')](_0x5704d7['model'],qs[_0xaec9('0x30')](_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x30')]));_0x917929[_0xaec9('0x2e')]=_0x917929[_0xaec9('0x2e')][_0xaec9('0x31')]?_0x917929[_0xaec9('0x2e')]:_0x5704d7['model'];if(!_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x32')](_0xaec9('0x33'))){_0x917929['limit']=qs[_0xaec9('0x1c')](_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x1c')]);_0x917929[_0xaec9('0x1b')]=qs[_0xaec9('0x1b')](_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x1b')]);}_0x917929['order']=qs[_0xaec9('0x34')](_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x34')]);_0x917929['where']=qs['filters'](_['pick'](_0x41fee5['query'],_0x5704d7['filters']));if(_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x35')]){_0x917929[_0xaec9('0x36')]=_['merge'](_0x917929[_0xaec9('0x36')],{'$or':_['map'](_0x46896e,function(_0x1b4b2a){if(_0x1b4b2a['type'][_0xaec9('0x37')]!==_0xaec9('0x38')){var _0xb753a5={};_0xb753a5[_0x1b4b2a[_0xaec9('0x39')]]={'$like':'%'+_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x35')]+'%'};return _0xb753a5;}})});}_0x917929=_[_0xaec9('0x3a')]({},_0x917929,_0x41fee5[_0xaec9('0x3b')]);var _0x26feab={'where':_0x917929[_0xaec9('0x36')]};return db[_0xaec9('0x29')]['count'](_0x26feab)[_0xaec9('0x21')](function(_0xb88e8c){_0x4563db[_0xaec9('0x1a')]=_0xb88e8c;if(_0x41fee5[_0xaec9('0x2b')][_0xaec9('0x3c')]){_0x917929['include']=[{'all':!![]}];}return db[_0xaec9('0x29')][_0xaec9('0x3d')](_0x917929);})[_0xaec9('0x21')](function(_0x49f23d){_0x4563db[_0xaec9('0x3e')]=_0x49f23d;return _0x4563db;})[_0xaec9('0x21')](respondWithFilteredResult(_0x4cc74c,_0x917929))['catch'](handleError(_0x4cc74c,null));};exports['show']=function(_0x1bd1e3,_0x2e479d){var _0x2f9acb={'raw':![],'where':{'id':_0x1bd1e3['params']['id']}},_0x25748c={};_0x25748c[_0xaec9('0x2d')]=_[_0xaec9('0x2a')](db[_0xaec9('0x29')][_0xaec9('0x3f')]);_0x25748c[_0xaec9('0x2b')]=_[_0xaec9('0x2a')](_0x1bd1e3[_0xaec9('0x2b')]);_0x25748c['filters']=_[_0xaec9('0x2f')](_0x25748c[_0xaec9('0x2d')],_0x25748c[_0xaec9('0x2b')]);_0x2f9acb[_0xaec9('0x2e')]=_[_0xaec9('0x2f')](_0x25748c['model'],qs[_0xaec9('0x30')](_0x1bd1e3[_0xaec9('0x2b')][_0xaec9('0x30')]));_0x2f9acb[_0xaec9('0x2e')]=_0x2f9acb[_0xaec9('0x2e')]['length']?_0x2f9acb['attributes']:_0x25748c[_0xaec9('0x2d')];if(_0x1bd1e3[_0xaec9('0x2b')][_0xaec9('0x3c')]){_0x2f9acb[_0xaec9('0x40')]=[{'all':!![]}];}_0x2f9acb=_[_0xaec9('0x3a')]({},_0x2f9acb,_0x1bd1e3[_0xaec9('0x3b')]);return db[_0xaec9('0x29')][_0xaec9('0x41')](_0x2f9acb)[_0xaec9('0x21')](handleEntityNotFound(_0x2e479d,null))[_0xaec9('0x21')](respondWithResult(_0x2e479d,null))[_0xaec9('0x42')](handleError(_0x2e479d,null));};exports[_0xaec9('0x43')]=function(_0x36cbfe,_0x96980a){return db[_0xaec9('0x29')][_0xaec9('0x43')](_0x36cbfe[_0xaec9('0x44')],{})[_0xaec9('0x21')](function(_0x40f10a){var _0x4d819a=_0x36cbfe[_0xaec9('0x45')][_0xaec9('0x46')]({'plain':!![]});if(!_0x4d819a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d819a[_0xaec9('0x47')]==='user'){var _0x1005b1=_0x40f10a[_0xaec9('0x46')]({'plain':!![]});var _0x1c9ce2=_0xaec9('0x23');return db['UserProfileSection'][_0xaec9('0x41')]({'where':{'name':_0x1c9ce2,'userProfileId':_0x4d819a['userProfileId']},'raw':!![]})[_0xaec9('0x21')](function(_0x2733b4){if(_0x2733b4&&_0x2733b4['autoAssociation']===0x0){return db['UserProfileResource'][_0xaec9('0x43')]({'name':_0x1005b1[_0xaec9('0x27')],'resourceId':_0x1005b1['id'],'type':_0x2733b4['name'],'sectionId':_0x2733b4['id']},{})[_0xaec9('0x21')](function(){return _0x40f10a;});}else{return _0x40f10a;}})[_0xaec9('0x42')](function(_0x2995eb){logger['error'](_0xaec9('0x48'),_0x2995eb);throw _0x2995eb;});}return _0x40f10a;})['then'](respondWithResult(_0x96980a,0xc9))[_0xaec9('0x42')](handleError(_0x96980a,null));};exports['update']=function(_0x1eeb1a,_0x3cf2cb){if(_0x1eeb1a[_0xaec9('0x44')]['id']){delete _0x1eeb1a[_0xaec9('0x44')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x1eeb1a[_0xaec9('0x49')]['id']}})[_0xaec9('0x21')](handleEntityNotFound(_0x3cf2cb,null))[_0xaec9('0x21')](saveUpdates(_0x1eeb1a[_0xaec9('0x44')],null))[_0xaec9('0x21')](respondWithResult(_0x3cf2cb,null))[_0xaec9('0x42')](handleError(_0x3cf2cb,null));};exports[_0xaec9('0x22')]=function(_0x2f8611,_0x366773){return db[_0xaec9('0x29')][_0xaec9('0x41')]({'where':{'id':_0x2f8611[_0xaec9('0x49')]['id']}})[_0xaec9('0x21')](handleEntityNotFound(_0x366773,null))['then'](removeEntity(_0x366773,null))[_0xaec9('0x42')](handleError(_0x366773,null));}; \ No newline at end of file +var _0x0d65=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','set','apply','reject','save','update','then','destroy','get','ChanSpies','end','error','name','send','index','VoiceChanSpy','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x0d65,0xe0));var _0x50d6=function(_0x27557e,_0x1e0ab0){_0x27557e=_0x27557e-0x0;var _0x4bdb4d=_0x0d65[_0x27557e];return _0x4bdb4d;};'use strict';var pdf=require(_0x50d6('0x0'));var emlformat=require(_0x50d6('0x1'));var rimraf=require(_0x50d6('0x2'));var zipdir=require(_0x50d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50d6('0x4'));var moment=require(_0x50d6('0x5'));var BPromise=require(_0x50d6('0x6'));var Mustache=require('mustache');var util=require(_0x50d6('0x7'));var path=require(_0x50d6('0x8'));var sox=require(_0x50d6('0x9'));var csv=require(_0x50d6('0xa'));var ejs=require(_0x50d6('0xb'));var fs=require('fs');var _=require(_0x50d6('0xc'));var squel=require(_0x50d6('0xd'));var crypto=require(_0x50d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x50d6('0xf'));var toCsv=require(_0x50d6('0xa'));var querystring=require(_0x50d6('0x10'));var Papa=require(_0x50d6('0x11'));var Redis=require(_0x50d6('0x12'));var authService=require(_0x50d6('0x13'));var qs=require(_0x50d6('0x14'));var hardwareService=require(_0x50d6('0x15'));var logger=require('../../config/logger')(_0x50d6('0x16'));var utils=require(_0x50d6('0x17'));var config=require('../../config/environment');var db=require(_0x50d6('0x18'))['db'];function respondWithStatusCode(_0x1a13ba,_0x5e8672){_0x5e8672=_0x5e8672||0xcc;return function(_0x229cfa){if(_0x229cfa){return _0x1a13ba[_0x50d6('0x19')](_0x5e8672);}return _0x1a13ba[_0x50d6('0x1a')](_0x5e8672)['end']();};}function respondWithResult(_0x5a5ce2,_0x187156){_0x187156=_0x187156||0xc8;return function(_0x55bba8){if(_0x55bba8){return _0x5a5ce2['status'](_0x187156)['json'](_0x55bba8);}};}function respondWithFilteredResult(_0x23d755,_0xe40685){return function(_0x55541c){if(_0x55541c){var _0x45ea32=_0x55541c['count'],_0x377528=_0xe40685[_0x50d6('0x1b')],_0x3e7ca5=_0xe40685['offset']+_0xe40685[_0x50d6('0x1c')],_0x18e24b;if(_0x3e7ca5>=_0x45ea32){_0x3e7ca5=_0x45ea32;_0x18e24b=0xc8;}else{_0x18e24b=0xce;}_0x23d755[_0x50d6('0x1a')](_0x18e24b);return _0x23d755[_0x50d6('0x1d')]('Content-Range',_0x377528+'-'+_0x3e7ca5+'/'+_0x45ea32)['json'](_0x55541c);}return null;};}function patchUpdates(_0x129069){return function(_0xd97ca3){try{jsonpatch[_0x50d6('0x1e')](_0xd97ca3,_0x129069,!![]);}catch(_0x359261){return BPromise[_0x50d6('0x1f')](_0x359261);}return _0xd97ca3[_0x50d6('0x20')]();};}function saveUpdates(_0x4b8fcd,_0x1b7e05){return function(_0x4efe74){if(_0x4efe74){return _0x4efe74[_0x50d6('0x21')](_0x4b8fcd)[_0x50d6('0x22')](function(_0x5ce3f0){return _0x5ce3f0;});}return null;};}function removeEntity(_0xd67c7c,_0x18cef0){return function(_0x4c0923){if(_0x4c0923){return _0x4c0923[_0x50d6('0x23')]()[_0x50d6('0x22')](function(){var _0x15d0b3=_0x4c0923[_0x50d6('0x24')]({'plain':!![]});var _0x34a29e=_0x50d6('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x34a29e,'resourceId':_0x15d0b3['id']}})[_0x50d6('0x22')](function(){return _0x4c0923;});})[_0x50d6('0x22')](function(){_0xd67c7c[_0x50d6('0x1a')](0xcc)[_0x50d6('0x26')]();});}};}function handleEntityNotFound(_0x2e7b12,_0x3c22f1){return function(_0x111300){if(!_0x111300){_0x2e7b12[_0x50d6('0x19')](0x194);}return _0x111300;};}function handleError(_0x27d876,_0xc311f0){_0xc311f0=_0xc311f0||0x1f4;return function(_0x291ad8){logger[_0x50d6('0x27')](_0x291ad8['stack']);if(_0x291ad8['name']){delete _0x291ad8[_0x50d6('0x28')];}_0x27d876['status'](_0xc311f0)[_0x50d6('0x29')](_0x291ad8);};}exports[_0x50d6('0x2a')]=function(_0x3128b7,_0x36ffc6){var _0x47a4f6={},_0x4ac5b3={},_0x403c8a={'count':0x0,'rows':[]};var _0x49caf8=db[_0x50d6('0x2b')]['rawAttributes'];_0x4ac5b3[_0x50d6('0x2c')]=_[_0x50d6('0x2d')](_0x49caf8);_0x4ac5b3['query']=_[_0x50d6('0x2d')](_0x3128b7[_0x50d6('0x2e')]);_0x4ac5b3[_0x50d6('0x2f')]=_[_0x50d6('0x30')](_0x4ac5b3[_0x50d6('0x2c')],_0x4ac5b3['query']);_0x47a4f6[_0x50d6('0x31')]=_['intersection'](_0x4ac5b3[_0x50d6('0x2c')],qs[_0x50d6('0x32')](_0x3128b7[_0x50d6('0x2e')][_0x50d6('0x32')]));_0x47a4f6[_0x50d6('0x31')]=_0x47a4f6[_0x50d6('0x31')]['length']?_0x47a4f6[_0x50d6('0x31')]:_0x4ac5b3['model'];if(!_0x3128b7['query']['hasOwnProperty'](_0x50d6('0x33'))){_0x47a4f6[_0x50d6('0x1c')]=qs[_0x50d6('0x1c')](_0x3128b7[_0x50d6('0x2e')][_0x50d6('0x1c')]);_0x47a4f6[_0x50d6('0x1b')]=qs[_0x50d6('0x1b')](_0x3128b7[_0x50d6('0x2e')]['offset']);}_0x47a4f6['order']=qs[_0x50d6('0x34')](_0x3128b7[_0x50d6('0x2e')][_0x50d6('0x34')]);_0x47a4f6[_0x50d6('0x35')]=qs['filters'](_['pick'](_0x3128b7['query'],_0x4ac5b3[_0x50d6('0x2f')]));if(_0x3128b7[_0x50d6('0x2e')][_0x50d6('0x36')]){_0x47a4f6['where']=_['merge'](_0x47a4f6['where'],{'$or':_[_0x50d6('0x37')](_0x49caf8,function(_0x247c66){if(_0x247c66[_0x50d6('0x38')][_0x50d6('0x39')]!==_0x50d6('0x3a')){var _0x4c6c5a={};_0x4c6c5a[_0x247c66[_0x50d6('0x3b')]]={'$like':'%'+_0x3128b7['query'][_0x50d6('0x36')]+'%'};return _0x4c6c5a;}})});}_0x47a4f6=_[_0x50d6('0x3c')]({},_0x47a4f6,_0x3128b7[_0x50d6('0x3d')]);var _0x440d3b={'where':_0x47a4f6[_0x50d6('0x35')]};return db[_0x50d6('0x2b')]['count'](_0x440d3b)[_0x50d6('0x22')](function(_0x55cf95){_0x403c8a[_0x50d6('0x3e')]=_0x55cf95;if(_0x3128b7[_0x50d6('0x2e')][_0x50d6('0x3f')]){_0x47a4f6[_0x50d6('0x40')]=[{'all':!![]}];}return db[_0x50d6('0x2b')][_0x50d6('0x41')](_0x47a4f6);})[_0x50d6('0x22')](function(_0x5aa9e3){_0x403c8a[_0x50d6('0x42')]=_0x5aa9e3;return _0x403c8a;})[_0x50d6('0x22')](respondWithFilteredResult(_0x36ffc6,_0x47a4f6))[_0x50d6('0x43')](handleError(_0x36ffc6,null));};exports[_0x50d6('0x44')]=function(_0x153eb2,_0x3594d9){var _0x1a482c={'raw':![],'where':{'id':_0x153eb2[_0x50d6('0x45')]['id']}},_0x5e31ba={};_0x5e31ba[_0x50d6('0x2c')]=_[_0x50d6('0x2d')](db[_0x50d6('0x2b')]['rawAttributes']);_0x5e31ba[_0x50d6('0x2e')]=_['keys'](_0x153eb2[_0x50d6('0x2e')]);_0x5e31ba['filters']=_[_0x50d6('0x30')](_0x5e31ba['model'],_0x5e31ba[_0x50d6('0x2e')]);_0x1a482c[_0x50d6('0x31')]=_['intersection'](_0x5e31ba[_0x50d6('0x2c')],qs['fields'](_0x153eb2[_0x50d6('0x2e')][_0x50d6('0x32')]));_0x1a482c['attributes']=_0x1a482c[_0x50d6('0x31')][_0x50d6('0x46')]?_0x1a482c[_0x50d6('0x31')]:_0x5e31ba[_0x50d6('0x2c')];if(_0x153eb2['query'][_0x50d6('0x3f')]){_0x1a482c[_0x50d6('0x40')]=[{'all':!![]}];}_0x1a482c=_[_0x50d6('0x3c')]({},_0x1a482c,_0x153eb2['options']);return db[_0x50d6('0x2b')][_0x50d6('0x47')](_0x1a482c)[_0x50d6('0x22')](handleEntityNotFound(_0x3594d9,null))[_0x50d6('0x22')](respondWithResult(_0x3594d9,null))[_0x50d6('0x43')](handleError(_0x3594d9,null));};exports[_0x50d6('0x48')]=function(_0x1a3d80,_0xd0c4f5){return db[_0x50d6('0x2b')]['create'](_0x1a3d80['body'],{})[_0x50d6('0x22')](function(_0x72dd2a){var _0x4a343b=_0x1a3d80[_0x50d6('0x49')]['get']({'plain':!![]});if(!_0x4a343b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a343b[_0x50d6('0x4a')]===_0x50d6('0x49')){var _0x1214a1=_0x72dd2a['get']({'plain':!![]});var _0x5cb70f=_0x50d6('0x25');return db[_0x50d6('0x4b')][_0x50d6('0x47')]({'where':{'name':_0x5cb70f,'userProfileId':_0x4a343b[_0x50d6('0x4c')]},'raw':!![]})[_0x50d6('0x22')](function(_0x485c82){if(_0x485c82&&_0x485c82[_0x50d6('0x4d')]===0x0){return db[_0x50d6('0x4e')][_0x50d6('0x48')]({'name':_0x1214a1[_0x50d6('0x28')],'resourceId':_0x1214a1['id'],'type':_0x485c82[_0x50d6('0x28')],'sectionId':_0x485c82['id']},{})[_0x50d6('0x22')](function(){return _0x72dd2a;});}else{return _0x72dd2a;}})[_0x50d6('0x43')](function(_0x41ae5e){logger[_0x50d6('0x27')](_0x50d6('0x4f'),_0x41ae5e);throw _0x41ae5e;});}return _0x72dd2a;})[_0x50d6('0x22')](respondWithResult(_0xd0c4f5,0xc9))[_0x50d6('0x43')](handleError(_0xd0c4f5,null));};exports[_0x50d6('0x21')]=function(_0x38ddf0,_0x41e5f1){if(_0x38ddf0[_0x50d6('0x50')]['id']){delete _0x38ddf0[_0x50d6('0x50')]['id'];}return db[_0x50d6('0x2b')][_0x50d6('0x47')]({'where':{'id':_0x38ddf0[_0x50d6('0x45')]['id']}})['then'](handleEntityNotFound(_0x41e5f1,null))['then'](saveUpdates(_0x38ddf0[_0x50d6('0x50')],null))[_0x50d6('0x22')](respondWithResult(_0x41e5f1,null))['catch'](handleError(_0x41e5f1,null));};exports[_0x50d6('0x23')]=function(_0x3d5457,_0x2e8cb7){return db[_0x50d6('0x2b')][_0x50d6('0x47')]({'where':{'id':_0x3d5457[_0x50d6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e8cb7,null))[_0x50d6('0x22')](removeEntity(_0x2e8cb7,null))['catch'](handleError(_0x2e8cb7,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 365ac05..f1b059b 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 _0x6623=['lodash','util','bluebird','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','push','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','findAll','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy'];(function(_0xefd9e3,_0x173978){var _0x4896bf=function(_0x42c66b){while(--_0x42c66b){_0xefd9e3['push'](_0xefd9e3['shift']());}};_0x4896bf(++_0x173978);}(_0x6623,0xa5));var _0x3662=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x6623[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x3662('0x0'));var util=require(_0x3662('0x1'));var BPromise=require(_0x3662('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5adcb6,_0x82d3f3,_0x42211a){var _0x3aac8b=0x1;var _0x195d55=[];var _0x30b3bf={'context':_0x82d3f3['context']||'from-sip','exten':util[_0x3662('0x3')](_0x3662('0x4'),_0x5adcb6[_0x3662('0x5')],_0x42211a),'type':_0x3662('0x6'),'isApp':![],'ChanSpyId':_0x5adcb6['id'],'UserId':_0x82d3f3['id']};_0x195d55['push'](_[_0x3662('0x7')]({'app':_0x3662('0x8'),'appdata':util['format'](_0x3662('0x9'),_0x3662('0xa')),'priority':_0x3aac8b++},_0x30b3bf));if(_0x5adcb6[_0x3662('0xb')]){_0x195d55[_0x3662('0xc')](_[_0x3662('0x7')]({'app':'MixMonitor','appdata':util[_0x3662('0x3')]('${UNIQUEID}.%s,ab',_0x5adcb6['recordingFormat']),'priority':_0x3aac8b++},_0x30b3bf));}if(_0x5adcb6[_0x3662('0xd')]){_0x195d55['push'](_[_0x3662('0x7')]({'app':_0x3662('0xe'),'appdata':_0x5adcb6[_0x3662('0xf')],'priority':_0x3aac8b++},_0x30b3bf));}_0x195d55[_0x3662('0xc')](_[_0x3662('0x7')]({'app':_0x3662('0x10'),'appdata':util[_0x3662('0x3')](_0x3662('0x11'),_0x82d3f3[_0x3662('0x12')],_0x5adcb6['options']?_0x5adcb6[_0x3662('0x13')]['join'](''):''),'priority':_0x3aac8b++},_0x30b3bf));if(_0x5adcb6[_0x3662('0xb')]){_0x195d55[_0x3662('0xc')](_[_0x3662('0x7')]({'app':_0x3662('0x14'),'priority':_0x3aac8b++},_0x30b3bf));}return _0x195d55;};var getChanSpyApplications=function(_0x33c553,_0x3ab61a){var _0x38a758=[];for(var _0x3ab951=0x0,_0x327be4=0x1;_0x3ab951<_0x3ab61a[_0x3662('0x15')];_0x3ab951++,_0x327be4=0x1){_0x38a758=_0x38a758[_0x3662('0x16')](getUserApplications(_0x33c553,_0x3ab61a[_0x3ab951],_0x3ab61a[_0x3ab951]['internal']));if(_0x3ab61a[_0x3ab951][_0x3662('0x17')]!=_0x3ab61a[_0x3ab951][_0x3662('0x12')]){_0x38a758=_0x38a758['concat'](getUserApplications(_0x33c553,_0x3ab61a[_0x3ab951],_0x3ab61a[_0x3ab951][_0x3662('0x12')]));}}return _0x38a758;};var getChanSpyPromise=function(_0x2ecb5d,_0x88da9d){return new BPromise(function(_0x1ae2d7,_0x189c5a){return _0x2ecb5d['User'][_0x3662('0x18')]({'attributes':['id','name',_0x3662('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x3662('0x19')](function(_0x512a53){if(_0x512a53){return _0x1ae2d7(getChanSpyApplications(_0x88da9d,_0x512a53));}return _0x1ae2d7([]);})[_0x3662('0x1a')](function(_0x45629a){_0x189c5a(_0x45629a);});});};module[_0x3662('0x1b')]=function(_0x3f9c7e,_0x1a087c){var _0x49c91f=_0x3f9c7e['models'];return _0x3f9c7e['define'](_0x3662('0x1c'),attributes,{'tableName':_0x3662('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4de63a,_0x3765ee,_0x2f0d72){return getChanSpyPromise(_0x49c91f,_0x4de63a)[_0x3662('0x19')](function(_0x516fb0){if(_0x516fb0&&_0x516fb0[_0x3662('0x15')]){return _0x49c91f[_0x3662('0x1e')][_0x3662('0x1f')](_0x516fb0);}})['then'](function(){_0x2f0d72();})[_0x3662('0x1a')](function(_0x1ccde6){_0x2f0d72(_0x1ccde6);});},'afterUpdate':function(_0x5c1f2c,_0x40058f,_0x35a603){return _0x49c91f[_0x3662('0x1e')][_0x3662('0x20')]({'where':{'ChanSpyId':_0x5c1f2c['id']}})[_0x3662('0x19')](function(){return getChanSpyPromise(_0x49c91f,_0x5c1f2c);})[_0x3662('0x19')](function(_0xd0cb7c){if(_0xd0cb7c&&_0xd0cb7c[_0x3662('0x15')]){return _0x49c91f['VoiceExtension'][_0x3662('0x1f')](_0xd0cb7c);}})[_0x3662('0x19')](function(){_0x35a603();})[_0x3662('0x1a')](function(_0x36db97){_0x35a603(_0x36db97);});},'afterDestroy':function(_0xa89803,_0xebd5b9,_0x525322){return _0x49c91f[_0x3662('0x1e')][_0x3662('0x20')]({'where':{'ChanSpyId':_0xa89803['id']}})[_0x3662('0x19')](function(){_0x525322();})[_0x3662('0x1a')](function(_0x3fe4c1){_0x525322(_0x3fe4c1);});}}});}; \ No newline at end of file +var _0x9bdf=['auth','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','internal','name','concat','User','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','context','from-sip','format','%s%s','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','recordingFormat'];(function(_0x1a8302,_0x214a89){var _0x328f32=function(_0x3ed559){while(--_0x3ed559){_0x1a8302['push'](_0x1a8302['shift']());}};_0x328f32(++_0x214a89);}(_0x9bdf,0x1dd));var _0xf9bd=function(_0x52de80,_0x522f5b){_0x52de80=_0x52de80-0x0;var _0x18c05a=_0x9bdf[_0x52de80];return _0x18c05a;};'use strict';var _=require(_0xf9bd('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2279c7,_0x4a69db,_0x2c7cd2){var _0x3261e6=0x1;var _0x4dd9ab=[];var _0x5bc3f1={'context':_0x4a69db[_0xf9bd('0x1')]||_0xf9bd('0x2'),'exten':util[_0xf9bd('0x3')](_0xf9bd('0x4'),_0x2279c7['prefix'],_0x2c7cd2),'type':_0xf9bd('0x5'),'isApp':![],'ChanSpyId':_0x2279c7['id'],'UserId':_0x4a69db['id']};_0x4dd9ab[_0xf9bd('0x6')](_[_0xf9bd('0x7')]({'app':_0xf9bd('0x8'),'appdata':util['format'](_0xf9bd('0x9'),'chanspy'),'priority':_0x3261e6++},_0x5bc3f1));if(_0x2279c7[_0xf9bd('0xa')]){_0x4dd9ab[_0xf9bd('0x6')](_['merge']({'app':_0xf9bd('0xb'),'appdata':util[_0xf9bd('0x3')]('${UNIQUEID}.%s,ab',_0x2279c7[_0xf9bd('0xc')]),'priority':_0x3261e6++},_0x5bc3f1));}if(_0x2279c7[_0xf9bd('0xd')]){_0x4dd9ab[_0xf9bd('0x6')](_[_0xf9bd('0x7')]({'app':'Authenticate','appdata':_0x2279c7[_0xf9bd('0xe')],'priority':_0x3261e6++},_0x5bc3f1));}_0x4dd9ab[_0xf9bd('0x6')](_[_0xf9bd('0x7')]({'app':_0xf9bd('0xf'),'appdata':util[_0xf9bd('0x3')](_0xf9bd('0x10'),_0x4a69db['name'],_0x2279c7['options']?_0x2279c7[_0xf9bd('0x11')][_0xf9bd('0x12')](''):''),'priority':_0x3261e6++},_0x5bc3f1));if(_0x2279c7[_0xf9bd('0xa')]){_0x4dd9ab[_0xf9bd('0x6')](_[_0xf9bd('0x7')]({'app':_0xf9bd('0x13'),'priority':_0x3261e6++},_0x5bc3f1));}return _0x4dd9ab;};var getChanSpyApplications=function(_0x521075,_0xae647e){var _0x51649e=[];for(var _0x13594d=0x0,_0x1d4246=0x1;_0x13594d<_0xae647e['length'];_0x13594d++,_0x1d4246=0x1){_0x51649e=_0x51649e['concat'](getUserApplications(_0x521075,_0xae647e[_0x13594d],_0xae647e[_0x13594d][_0xf9bd('0x14')]));if(_0xae647e[_0x13594d][_0xf9bd('0x14')]!=_0xae647e[_0x13594d][_0xf9bd('0x15')]){_0x51649e=_0x51649e[_0xf9bd('0x16')](getUserApplications(_0x521075,_0xae647e[_0x13594d],_0xae647e[_0x13594d][_0xf9bd('0x15')]));}}return _0x51649e;};var getChanSpyPromise=function(_0x78c946,_0x526dee){return new BPromise(function(_0x427f31,_0x805e70){return _0x78c946[_0xf9bd('0x17')]['findAll']({'attributes':['id',_0xf9bd('0x15'),_0xf9bd('0x14')],'where':{'role':_0xf9bd('0x18'),'chanspy':!![]},'raw':!![]})[_0xf9bd('0x19')](function(_0x275333){if(_0x275333){return _0x427f31(getChanSpyApplications(_0x526dee,_0x275333));}return _0x427f31([]);})['catch'](function(_0x415f3c){_0x805e70(_0x415f3c);});});};module[_0xf9bd('0x1a')]=function(_0x4af235,_0x4edbde){var _0x7ed5f5=_0x4af235[_0xf9bd('0x1b')];return _0x4af235[_0xf9bd('0x1c')](_0xf9bd('0x1d'),attributes,{'tableName':_0xf9bd('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d30a8,_0x18b02e,_0xf1e4a3){return getChanSpyPromise(_0x7ed5f5,_0x3d30a8)['then'](function(_0x20b81f){if(_0x20b81f&&_0x20b81f['length']){return _0x7ed5f5[_0xf9bd('0x1f')][_0xf9bd('0x20')](_0x20b81f);}})[_0xf9bd('0x19')](function(){_0xf1e4a3();})['catch'](function(_0x4a2ce9){_0xf1e4a3(_0x4a2ce9);});},'afterUpdate':function(_0x5ea686,_0x2540e8,_0x176305){return _0x7ed5f5[_0xf9bd('0x1f')]['destroy']({'where':{'ChanSpyId':_0x5ea686['id']}})[_0xf9bd('0x19')](function(){return getChanSpyPromise(_0x7ed5f5,_0x5ea686);})[_0xf9bd('0x19')](function(_0x30425c){if(_0x30425c&&_0x30425c['length']){return _0x7ed5f5[_0xf9bd('0x1f')][_0xf9bd('0x20')](_0x30425c);}})['then'](function(){_0x176305();})[_0xf9bd('0x21')](function(_0x53124b){_0x176305(_0x53124b);});},'afterDestroy':function(_0x41de9a,_0x2acaec,_0x634b74){return _0x7ed5f5[_0xf9bd('0x1f')][_0xf9bd('0x22')]({'where':{'ChanSpyId':_0x41de9a['id']}})['then'](function(){_0x634b74();})[_0xf9bd('0x21')](function(_0x4dc0db){_0x634b74(_0x4dc0db);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index adb8a38..cec4906 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 _0x0d27=['../../config/utils','rpc','jayson/promise','client','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45b5fe,_0x4bcd6e){var _0x470b1c=function(_0x126ae){while(--_0x126ae){_0x45b5fe['push'](_0x45b5fe['shift']());}};_0x470b1c(++_0x4bcd6e);}(_0x0d27,0x112));var _0x70d2=function(_0x5141e6,_0x40fdbd){_0x5141e6=_0x5141e6-0x0;var _0x2fbf1c=_0x0d27[_0x5141e6];return _0x2fbf1c;};'use strict';var _=require(_0x70d2('0x0'));var util=require(_0x70d2('0x1'));var moment=require(_0x70d2('0x2'));var BPromise=require(_0x70d2('0x3'));var rs=require(_0x70d2('0x4'));var fs=require('fs');var Redis=require(_0x70d2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d2('0x6'));var logger=require('../../config/logger')(_0x70d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x70d2('0x8'));var client=jayson[_0x70d2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209ce3,_0x23a9e6,_0x529a84){return new BPromise(function(_0xe953be,_0xab9a6f){return client[_0x70d2('0xa')](_0x209ce3,_0x529a84)['then'](function(_0xeceab4){logger[_0x70d2('0xb')](_0x70d2('0xc'),_0x23a9e6,_0x70d2('0xd'));logger[_0x70d2('0xe')](_0x70d2('0xf'),_0x23a9e6,_0x70d2('0xd'),JSON[_0x70d2('0x10')](_0xeceab4));if(_0xeceab4[_0x70d2('0x11')]){if(_0xeceab4['error'][_0x70d2('0x12')]===0x1f4){logger['error'](_0x70d2('0xc'),_0x23a9e6,_0xeceab4[_0x70d2('0x11')][_0x70d2('0x13')]);return _0xab9a6f(_0xeceab4['error'][_0x70d2('0x13')]);}logger[_0x70d2('0x11')](_0x70d2('0xc'),_0x23a9e6,_0xeceab4['error'][_0x70d2('0x13')]);return _0xe953be(_0xeceab4[_0x70d2('0x11')][_0x70d2('0x13')]);}else{logger[_0x70d2('0xb')](_0x70d2('0xc'),_0x23a9e6,_0x70d2('0xd'));_0xe953be(_0xeceab4['result'][_0x70d2('0x13')]);}})['catch'](function(_0x10df14){logger[_0x70d2('0x11')](_0x70d2('0xc'),_0x23a9e6,_0x10df14);_0xab9a6f(_0x10df14);});});} \ No newline at end of file +var _0x76a3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceChanSpy,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x76a3,0xf8));var _0x376a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x76a3[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var moment=require(_0x376a('0x2'));var BPromise=require(_0x376a('0x3'));var rs=require(_0x376a('0x4'));var fs=require('fs');var Redis=require(_0x376a('0x5'));var db=require(_0x376a('0x6'))['db'];var utils=require(_0x376a('0x7'));var logger=require(_0x376a('0x8'))(_0x376a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x376a('0xa')][_0x376a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139dbc,_0x3cb57e,_0x548516){return new BPromise(function(_0x3e2261,_0x409960){return client[_0x376a('0xc')](_0x139dbc,_0x548516)[_0x376a('0xd')](function(_0x347b32){logger[_0x376a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x3cb57e,'request\x20sent');logger['debug'](_0x376a('0xf'),_0x3cb57e,_0x376a('0x10'),JSON['stringify'](_0x347b32));if(_0x347b32[_0x376a('0x11')]){if(_0x347b32['error'][_0x376a('0x12')]===0x1f4){logger[_0x376a('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x409960(_0x347b32[_0x376a('0x11')]['message']);}logger[_0x376a('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x3e2261(_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);}else{logger[_0x376a('0xe')](_0x376a('0x14'),_0x3cb57e,_0x376a('0x10'));_0x3e2261(_0x347b32[_0x376a('0x15')]['message']);}})[_0x376a('0x16')](function(_0xe3c5fc){logger['error'](_0x376a('0x14'),_0x3cb57e,_0xe3c5fc);_0x409960(_0xe3c5fc);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 66f1a2d..0c9e58a 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 _0x8383=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8383,0x98));var _0x3838=function(_0x2e65c3,_0x442c9e){_0x2e65c3=_0x2e65c3-0x0;var _0x428358=_0x8383[_0x2e65c3];return _0x428358;};'use strict';var multer=require(_0x3838('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3838('0x1'));var express=require(_0x3838('0x2'));var router=express[_0x3838('0x3')]();var auth=require(_0x3838('0x4'));var interaction=require(_0x3838('0x5'));var config=require(_0x3838('0x6'));var controller=require(_0x3838('0x7'));router[_0x3838('0x8')]('/',auth[_0x3838('0x9')](),controller[_0x3838('0xa')]);router['get'](_0x3838('0xb'),auth[_0x3838('0x9')](),controller['show']);router[_0x3838('0xc')]('/',auth['isAuthenticated'](),controller[_0x3838('0xd')]);router[_0x3838('0xe')](_0x3838('0xb'),auth['isAuthenticated'](),controller[_0x3838('0xf')]);router[_0x3838('0x10')](_0x3838('0xb'),auth['isAuthenticated'](),controller[_0x3838('0x11')]);module[_0x3838('0x12')]=router; \ No newline at end of file +var _0xb4f4=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x2bd1c9,_0xc33c20){var _0x1a8596=function(_0x18654f){while(--_0x18654f){_0x2bd1c9['push'](_0x2bd1c9['shift']());}};_0x1a8596(++_0xc33c20);}(_0xb4f4,0xda));var _0x4b4f=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xb4f4[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var path=require('path');var timeout=require(_0x4b4f('0x2'));var express=require(_0x4b4f('0x3'));var router=express[_0x4b4f('0x4')]();var auth=require(_0x4b4f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b4f('0x6'));var controller=require(_0x4b4f('0x7'));router[_0x4b4f('0x8')]('/',auth[_0x4b4f('0x9')](),controller[_0x4b4f('0xa')]);router[_0x4b4f('0x8')](_0x4b4f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4b4f('0xc')]('/',auth[_0x4b4f('0x9')](),controller[_0x4b4f('0xd')]);router[_0x4b4f('0xe')](_0x4b4f('0xb'),auth['isAuthenticated'](),controller[_0x4b4f('0xf')]);router[_0x4b4f('0x10')](_0x4b4f('0xb'),auth['isAuthenticated'](),controller[_0x4b4f('0x11')]);module[_0x4b4f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 19c3d9e..fa12b89 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 _0x6c91=['exports','BOOLEAN','sequelize'];(function(_0x5c04ad,_0x31402f){var _0x314561=function(_0x1c605b){while(--_0x1c605b){_0x5c04ad['push'](_0x5c04ad['shift']());}};_0x314561(++_0x31402f);}(_0x6c91,0x8c));var _0x16c9=function(_0xddb966,_0x465e33){_0xddb966=_0xddb966-0x0;var _0x5e66e0=_0x6c91[_0xddb966];return _0x5e66e0;};'use strict';var Sequelize=require(_0x16c9('0x0'));module[_0x16c9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x16c9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x417d=['exports','STRING','name','BOOLEAN'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x417d,0x104));var _0xd417=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x417d[_0x44c768];return _0x55daf5;};'use strict';var Sequelize=require('sequelize');module[_0xd417('0x0')]={'name':{'type':Sequelize[_0xd417('0x1')],'unique':_0xd417('0x2')},'description':{'type':Sequelize[_0xd417('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd417('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c35c2a4..2a504e9 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 _0x863d=['attributes','length','nolimit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','field','options','includeAll','rows','show','params','intersection','merge','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','chan_sip.so','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','name','VoiceContext','rawAttributes','model','keys','query','fields'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x863d,0x157));var _0xd863=function(_0x51a7d9,_0x491943){_0x51a7d9=_0x51a7d9-0x0;var _0x348796=_0x863d[_0x51a7d9];return _0x348796;};'use strict';var pdf=require(_0xd863('0x0'));var emlformat=require(_0xd863('0x1'));var rimraf=require(_0xd863('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd863('0x3'));var rp=require(_0xd863('0x4'));var moment=require(_0xd863('0x5'));var BPromise=require(_0xd863('0x6'));var Mustache=require(_0xd863('0x7'));var util=require(_0xd863('0x8'));var path=require('path');var sox=require(_0xd863('0x9'));var csv=require('to-csv');var ejs=require(_0xd863('0xa'));var fs=require('fs');var _=require(_0xd863('0xb'));var squel=require('squel');var crypto=require(_0xd863('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd863('0xd'));var toCsv=require(_0xd863('0xe'));var querystring=require(_0xd863('0xf'));var Papa=require(_0xd863('0x10'));var Redis=require(_0xd863('0x11'));var authService=require(_0xd863('0x12'));var qs=require(_0xd863('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd863('0x14'));var utils=require(_0xd863('0x15'));var config=require(_0xd863('0x16'));var db=require(_0xd863('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd863('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x17e346,_0x1d5174,_0x2a93e0){if(_0x2a93e0){var _0x531f1c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x531f1c[_0xd863('0x19')](_0x1d5174)){return _0x17e346;}else{throw new Error(_0xd863('0x1a'));}}else{return _0x17e346;}}function respondWithRpcPromise(_0x5005ec,_0x281fc2,_0x5e1f20,_0x32b2d7){return new BPromise(function(_0x279bb6,_0x301d22){var _0x1fb57a=_0x32b2d7||client;return _0x1fb57a['request'](_0x5005ec,_0x5e1f20)['then'](function(_0x197b78){logger['info']('VoiceContext,\x20%s,\x20%s',_0x281fc2,_0xd863('0x1b'));logger[_0xd863('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x281fc2,_0xd863('0x1b'),JSON[_0xd863('0x1d')](_0x197b78));if(_0x197b78['error']){if(_0x197b78[_0xd863('0x1e')][_0xd863('0x1f')]===0x1f4){logger[_0xd863('0x1e')](_0xd863('0x20'),_0x281fc2,_0x197b78[_0xd863('0x1e')][_0xd863('0x21')]);return _0x301d22(_0x197b78[_0xd863('0x1e')][_0xd863('0x21')]);}logger[_0xd863('0x1e')](_0xd863('0x20'),_0x281fc2,_0x197b78[_0xd863('0x1e')]['message']);return _0x279bb6(_0x197b78[_0xd863('0x1e')][_0xd863('0x21')]);}else{logger['info'](_0xd863('0x20'),_0x281fc2,_0xd863('0x1b'));_0x279bb6(_0x197b78[_0xd863('0x22')]['message']);}})[_0xd863('0x23')](function(_0x2b3a38){logger[_0xd863('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x281fc2,_0x2b3a38);_0x301d22(_0x2b3a38);});});}function respondWithStatusCode(_0x58cafe,_0x4e8276){_0x4e8276=_0x4e8276||0xcc;return function(_0x187265){if(_0x187265){return _0x58cafe[_0xd863('0x24')](_0x4e8276);}return _0x58cafe[_0xd863('0x25')](_0x4e8276)[_0xd863('0x26')]();};}function respondWithResult(_0x1b3992,_0x49f792){_0x49f792=_0x49f792||0xc8;return function(_0x563001){if(_0x563001){return _0x1b3992['status'](_0x49f792)[_0xd863('0x27')](_0x563001);}};}function respondWithFilteredResult(_0xab0f71,_0x43804f){return function(_0x4442d5){if(_0x4442d5){var _0xa15dee=_0x4442d5[_0xd863('0x28')],_0x5d9905=_0x43804f[_0xd863('0x29')],_0x1ac552=_0x43804f[_0xd863('0x29')]+_0x43804f[_0xd863('0x2a')],_0x344f21;if(_0x1ac552>=_0xa15dee){_0x1ac552=_0xa15dee;_0x344f21=0xc8;}else{_0x344f21=0xce;}_0xab0f71[_0xd863('0x25')](_0x344f21);return _0xab0f71[_0xd863('0x2b')](_0xd863('0x2c'),_0x5d9905+'-'+_0x1ac552+'/'+_0xa15dee)[_0xd863('0x27')](_0x4442d5);}return null;};}function patchUpdates(_0x397756){return function(_0x34bb84){try{jsonpatch[_0xd863('0x2d')](_0x34bb84,_0x397756,!![]);}catch(_0xd0a491){return BPromise[_0xd863('0x2e')](_0xd0a491);}return _0x34bb84[_0xd863('0x2f')]();};}function saveUpdates(_0x394565,_0x295f5b){return function(_0x1b3de9){if(_0x1b3de9){return _0x1b3de9[_0xd863('0x30')](_0x394565)[_0xd863('0x31')](function(_0x9fc635){return _0x9fc635;});}return null;};}function removeEntity(_0x458bda,_0x52534f){return function(_0x87e778){if(_0x87e778){return _0x87e778['destroy']()['then'](function(){var _0x2d1c20=_0x87e778[_0xd863('0x32')]({'plain':!![]});var _0x1eda8f=_0xd863('0x33');return db[_0xd863('0x34')][_0xd863('0x35')]({'where':{'type':_0x1eda8f,'resourceId':_0x2d1c20['id']}})[_0xd863('0x31')](function(){return _0x87e778;});})['then'](function(){_0x458bda[_0xd863('0x25')](0xcc)[_0xd863('0x26')]();});}};}function handleEntityNotFound(_0x13ed7d,_0xcb806e){return function(_0x90736d){if(!_0x90736d){_0x13ed7d[_0xd863('0x24')](0x194);}return _0x90736d;};}function handleError(_0x4006ed,_0x34a725){_0x34a725=_0x34a725||0x1f4;return function(_0x5216ac){logger['error'](_0x5216ac['stack']);if(_0x5216ac[_0xd863('0x36')]){delete _0x5216ac[_0xd863('0x36')];}_0x4006ed[_0xd863('0x25')](_0x34a725)['send'](_0x5216ac);};}exports['index']=function(_0x1de3f3,_0x49fab5){var _0x558b71={},_0x10a3e2={},_0x3edc77={'count':0x0,'rows':[]};var _0x4177ca=db[_0xd863('0x37')][_0xd863('0x38')];_0x10a3e2[_0xd863('0x39')]=_[_0xd863('0x3a')](_0x4177ca);_0x10a3e2[_0xd863('0x3b')]=_[_0xd863('0x3a')](_0x1de3f3[_0xd863('0x3b')]);_0x10a3e2['filters']=_['intersection'](_0x10a3e2['model'],_0x10a3e2[_0xd863('0x3b')]);_0x558b71['attributes']=_['intersection'](_0x10a3e2['model'],qs[_0xd863('0x3c')](_0x1de3f3['query'][_0xd863('0x3c')]));_0x558b71[_0xd863('0x3d')]=_0x558b71['attributes'][_0xd863('0x3e')]?_0x558b71[_0xd863('0x3d')]:_0x10a3e2['model'];if(!_0x1de3f3['query']['hasOwnProperty'](_0xd863('0x3f'))){_0x558b71[_0xd863('0x2a')]=qs['limit'](_0x1de3f3['query']['limit']);_0x558b71[_0xd863('0x29')]=qs[_0xd863('0x29')](_0x1de3f3[_0xd863('0x3b')][_0xd863('0x29')]);}_0x558b71[_0xd863('0x40')]=qs[_0xd863('0x41')](_0x1de3f3[_0xd863('0x3b')]['sort']);_0x558b71[_0xd863('0x42')]=qs[_0xd863('0x43')](_[_0xd863('0x44')](_0x1de3f3[_0xd863('0x3b')],_0x10a3e2[_0xd863('0x43')]));if(_0x1de3f3['query'][_0xd863('0x45')]){_0x558b71[_0xd863('0x42')]=_['merge'](_0x558b71[_0xd863('0x42')],{'$or':_[_0xd863('0x46')](_0x4177ca,function(_0x28bfb4){if(_0x28bfb4['type'][_0xd863('0x47')]!==_0xd863('0x48')){var _0x4914b2={};_0x4914b2[_0x28bfb4[_0xd863('0x49')]]={'$like':'%'+_0x1de3f3[_0xd863('0x3b')][_0xd863('0x45')]+'%'};return _0x4914b2;}})});}_0x558b71=_['merge']({},_0x558b71,_0x1de3f3[_0xd863('0x4a')]);var _0x1c25ef={'where':_0x558b71[_0xd863('0x42')]};return db['VoiceContext']['count'](_0x1c25ef)['then'](function(_0x1fc619){_0x3edc77[_0xd863('0x28')]=_0x1fc619;if(_0x1de3f3['query'][_0xd863('0x4b')]){_0x558b71['include']=[{'all':!![]}];}return db[_0xd863('0x37')]['findAll'](_0x558b71);})[_0xd863('0x31')](function(_0x3b27fe){_0x3edc77[_0xd863('0x4c')]=_0x3b27fe;return _0x3edc77;})[_0xd863('0x31')](respondWithFilteredResult(_0x49fab5,_0x558b71))['catch'](handleError(_0x49fab5,null));};exports[_0xd863('0x4d')]=function(_0x40a7ad,_0x323e22){var _0x1e64c2={'raw':![],'where':{'id':_0x40a7ad[_0xd863('0x4e')]['id']}},_0x5231cb={};_0x5231cb['model']=_[_0xd863('0x3a')](db[_0xd863('0x37')][_0xd863('0x38')]);_0x5231cb['query']=_['keys'](_0x40a7ad[_0xd863('0x3b')]);_0x5231cb[_0xd863('0x43')]=_['intersection'](_0x5231cb[_0xd863('0x39')],_0x5231cb[_0xd863('0x3b')]);_0x1e64c2[_0xd863('0x3d')]=_[_0xd863('0x4f')](_0x5231cb[_0xd863('0x39')],qs[_0xd863('0x3c')](_0x40a7ad[_0xd863('0x3b')][_0xd863('0x3c')]));_0x1e64c2[_0xd863('0x3d')]=_0x1e64c2[_0xd863('0x3d')][_0xd863('0x3e')]?_0x1e64c2[_0xd863('0x3d')]:_0x5231cb[_0xd863('0x39')];if(_0x40a7ad[_0xd863('0x3b')][_0xd863('0x4b')]){_0x1e64c2['include']=[{'all':!![]}];}_0x1e64c2=_[_0xd863('0x50')]({},_0x1e64c2,_0x40a7ad['options']);return db[_0xd863('0x37')][_0xd863('0x51')](_0x1e64c2)[_0xd863('0x31')](handleEntityNotFound(_0x323e22,null))[_0xd863('0x31')](respondWithResult(_0x323e22,null))[_0xd863('0x23')](handleError(_0x323e22,null));};exports['create']=function(_0x314596,_0x1a1857,_0x5f529c){var _0x1ba2e9;return db[_0xd863('0x37')][_0xd863('0x52')](_0x314596[_0xd863('0x53')],{'raw':!![]})[_0xd863('0x31')](function(_0x4e8432){_0x1ba2e9=_0x4e8432;return db['VoiceContext'][_0xd863('0x54')]({'raw':!![]});})[_0xd863('0x31')](function(_0x1def89){var _0x2aca97=fs[_0xd863('0x55')](path[_0xd863('0x56')](config[_0xd863('0x57')],_0xd863('0x58')),'utf8');var _0x49e54a=ejs[_0xd863('0x59')](_0x2aca97,{'contexts':_0x1def89||[]});fs[_0xd863('0x5a')](_0xd863('0x5b'),_0x49e54a);})[_0xd863('0x31')](function(){return respondWithRpcPromise(_0xd863('0x5c'),'create',{'module':'chan_sip.so'});})[_0xd863('0x31')](function(){var _0x6732d9=_0x314596[_0xd863('0x5d')]['get']({'plain':!![]});if(!_0x6732d9)throw new Error(_0xd863('0x5e'));if(_0x6732d9['role']==='user'){var _0x125b5a=_0x1ba2e9['get']({'plain':!![]});return db[_0xd863('0x5f')][_0xd863('0x51')]({'where':{'name':_0xd863('0x33'),'userProfileId':_0x6732d9[_0xd863('0x60')]},'raw':!![]})[_0xd863('0x31')](function(_0x2ef71f){if(_0x2ef71f&&_0x2ef71f[_0xd863('0x61')]===0x0){return db['UserProfileResource'][_0xd863('0x52')]({'name':_0x125b5a['name'],'resourceId':_0x125b5a['id'],'type':_0x2ef71f[_0xd863('0x36')],'sectionId':_0x2ef71f['id']},{})['then'](function(){return _0x1ba2e9;});}else{return _0x1ba2e9;}})[_0xd863('0x23')](function(_0x234e1d){logger[_0xd863('0x1e')](_0xd863('0x62'),_0x234e1d);throw _0x234e1d;});}return _0x1ba2e9;})[_0xd863('0x31')](respondWithResult(_0x1a1857,0xc9))[_0xd863('0x23')](handleError(_0x1a1857,null));};exports['update']=function(_0x467c96,_0x4f3ddf,_0xf25558){var _0x2fd8ac;return db[_0xd863('0x37')][_0xd863('0x51')]({'where':{'id':_0x467c96[_0xd863('0x4e')]['id']}})[_0xd863('0x31')](handleEntityNotFound(_0x4f3ddf,null))[_0xd863('0x31')](saveUpdates(_0x467c96[_0xd863('0x53')],null))[_0xd863('0x31')](function(_0x27dc3a){if(_0x27dc3a){_0x2fd8ac=_0x27dc3a;return db[_0xd863('0x37')]['findAll']({'raw':!![]});}})[_0xd863('0x31')](function(_0x72b8d1){var _0x153eec=fs[_0xd863('0x55')](path[_0xd863('0x56')](config[_0xd863('0x57')],_0xd863('0x58')),'utf8');var _0x2e69c1=ejs[_0xd863('0x59')](_0x153eec,{'contexts':_0x72b8d1||[]});fs[_0xd863('0x5a')](_0xd863('0x5b'),_0x2e69c1);})[_0xd863('0x31')](function(){return respondWithRpcPromise('Reload',_0xd863('0x30'),{'module':'chan_sip.so'});})[_0xd863('0x31')](function(){return _0x2fd8ac;})[_0xd863('0x31')](respondWithResult(_0x4f3ddf,null))[_0xd863('0x23')](handleError(_0x4f3ddf,null));};exports['destroy']=function(_0x37ab0e,_0x586bd8,_0x466a2b){var _0x5048a0;return db[_0xd863('0x37')]['find']({'where':{'id':_0x37ab0e[_0xd863('0x4e')]['id']}})['then'](handleEntityNotFound(_0x586bd8,null))[_0xd863('0x31')](removeEntity(_0x586bd8,null))[_0xd863('0x31')](function(){return db[_0xd863('0x37')]['findAll']({'raw':!![]});})[_0xd863('0x31')](function(_0x42f97f){var _0x43c27d=fs[_0xd863('0x55')](path['join'](config[_0xd863('0x57')],'server/files/templates/context.ejs'),_0xd863('0x63'));var _0x4679f4=ejs[_0xd863('0x59')](_0x43c27d,{'contexts':_0x42f97f});fs[_0xd863('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4679f4);return respondWithRpcPromise(_0xd863('0x5c'),_0xd863('0x35'),{'module':_0xd863('0x64')});})[_0xd863('0x23')](handleError(_0x586bd8,null));}; \ No newline at end of file +var _0xd415=['fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','status','offset','limit','json','reject','update','destroy','get','Contexts','UserProfileResource','end','sendStatus','stack','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','chan_sip.so','writeFileSync','eml-format','rimraf','zip-dir'];(function(_0x433079,_0x6e4e59){var _0x225ead=function(_0x560513){while(--_0x560513){_0x433079['push'](_0x433079['shift']());}};_0x225ead(++_0x6e4e59);}(_0xd415,0x1e2));var _0x5d41=function(_0x3ebff4,_0x5efe9a){_0x3ebff4=_0x3ebff4-0x0;var _0x6331b7=_0xd415[_0x3ebff4];return _0x6331b7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5d41('0x0'));var rimraf=require(_0x5d41('0x1'));var zipdir=require(_0x5d41('0x2'));var jsonpatch=require(_0x5d41('0x3'));var rp=require(_0x5d41('0x4'));var moment=require(_0x5d41('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d41('0x6'));var path=require(_0x5d41('0x7'));var sox=require('sox');var csv=require(_0x5d41('0x8'));var ejs=require(_0x5d41('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5d41('0xa'));var crypto=require('crypto');var jsforce=require(_0x5d41('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5d41('0x8'));var querystring=require(_0x5d41('0xc'));var Papa=require(_0x5d41('0xd'));var Redis=require(_0x5d41('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5d41('0xf'));var hardwareService=require(_0x5d41('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x5d41('0x11'));var config=require(_0x5d41('0x12'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5d41('0x13')]({'port':0x232a});function checkPasswordPattern(_0x3f8644,_0x4857de,_0x2cd7fc){if(_0x2cd7fc){var _0x35496d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35496d[_0x5d41('0x14')](_0x4857de)){return _0x3f8644;}else{throw new Error(_0x5d41('0x15'));}}else{return _0x3f8644;}}function respondWithRpcPromise(_0x87e3da,_0x59c80b,_0x1ae685,_0x2a590f){return new BPromise(function(_0x2a9bc4,_0x135e54){var _0x65e9d5=_0x2a590f||client;return _0x65e9d5[_0x5d41('0x16')](_0x87e3da,_0x1ae685)[_0x5d41('0x17')](function(_0x51f5d6){logger[_0x5d41('0x18')](_0x5d41('0x19'),_0x59c80b,_0x5d41('0x1a'));logger[_0x5d41('0x1b')](_0x5d41('0x1c'),_0x59c80b,_0x5d41('0x1a'),JSON[_0x5d41('0x1d')](_0x51f5d6));if(_0x51f5d6[_0x5d41('0x1e')]){if(_0x51f5d6[_0x5d41('0x1e')]['code']===0x1f4){logger[_0x5d41('0x1e')](_0x5d41('0x19'),_0x59c80b,_0x51f5d6['error'][_0x5d41('0x1f')]);return _0x135e54(_0x51f5d6[_0x5d41('0x1e')][_0x5d41('0x1f')]);}logger[_0x5d41('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x59c80b,_0x51f5d6[_0x5d41('0x1e')]['message']);return _0x2a9bc4(_0x51f5d6[_0x5d41('0x1e')][_0x5d41('0x1f')]);}else{logger[_0x5d41('0x18')](_0x5d41('0x19'),_0x59c80b,_0x5d41('0x1a'));_0x2a9bc4(_0x51f5d6['result'][_0x5d41('0x1f')]);}})['catch'](function(_0x26dfaa){logger[_0x5d41('0x1e')](_0x5d41('0x19'),_0x59c80b,_0x26dfaa);_0x135e54(_0x26dfaa);});});}function respondWithStatusCode(_0x32f754,_0x119012){_0x119012=_0x119012||0xcc;return function(_0x280328){if(_0x280328){return _0x32f754['sendStatus'](_0x119012);}return _0x32f754[_0x5d41('0x20')](_0x119012)['end']();};}function respondWithResult(_0x541ebb,_0x16a438){_0x16a438=_0x16a438||0xc8;return function(_0xf00033){if(_0xf00033){return _0x541ebb[_0x5d41('0x20')](_0x16a438)['json'](_0xf00033);}};}function respondWithFilteredResult(_0x1b18a7,_0x453d13){return function(_0x3e321b){if(_0x3e321b){var _0x5cc024=_0x3e321b['count'],_0x7f3bf=_0x453d13['offset'],_0x527741=_0x453d13[_0x5d41('0x21')]+_0x453d13[_0x5d41('0x22')],_0xcc21a3;if(_0x527741>=_0x5cc024){_0x527741=_0x5cc024;_0xcc21a3=0xc8;}else{_0xcc21a3=0xce;}_0x1b18a7[_0x5d41('0x20')](_0xcc21a3);return _0x1b18a7['set']('Content-Range',_0x7f3bf+'-'+_0x527741+'/'+_0x5cc024)[_0x5d41('0x23')](_0x3e321b);}return null;};}function patchUpdates(_0x27c5fa){return function(_0x842a6){try{jsonpatch['apply'](_0x842a6,_0x27c5fa,!![]);}catch(_0x136568){return BPromise[_0x5d41('0x24')](_0x136568);}return _0x842a6['save']();};}function saveUpdates(_0x22e283,_0x45c02c){return function(_0x113802){if(_0x113802){return _0x113802[_0x5d41('0x25')](_0x22e283)[_0x5d41('0x17')](function(_0x4b99a7){return _0x4b99a7;});}return null;};}function removeEntity(_0x156155,_0x2a4c47){return function(_0x90c8ee){if(_0x90c8ee){return _0x90c8ee[_0x5d41('0x26')]()[_0x5d41('0x17')](function(){var _0xe9dcad=_0x90c8ee[_0x5d41('0x27')]({'plain':!![]});var _0x153535=_0x5d41('0x28');return db[_0x5d41('0x29')][_0x5d41('0x26')]({'where':{'type':_0x153535,'resourceId':_0xe9dcad['id']}})['then'](function(){return _0x90c8ee;});})[_0x5d41('0x17')](function(){_0x156155[_0x5d41('0x20')](0xcc)[_0x5d41('0x2a')]();});}};}function handleEntityNotFound(_0x4f7d7a,_0x489b79){return function(_0x4659a4){if(!_0x4659a4){_0x4f7d7a[_0x5d41('0x2b')](0x194);}return _0x4659a4;};}function handleError(_0x425dd3,_0x5d957e){_0x5d957e=_0x5d957e||0x1f4;return function(_0x39bea7){logger['error'](_0x39bea7[_0x5d41('0x2c')]);if(_0x39bea7[_0x5d41('0x2d')]){delete _0x39bea7[_0x5d41('0x2d')];}_0x425dd3[_0x5d41('0x20')](_0x5d957e)[_0x5d41('0x2e')](_0x39bea7);};}exports[_0x5d41('0x2f')]=function(_0x41d11d,_0x1b6dd8){var _0x2c7aa4={},_0x49d695={},_0x21d2ed={'count':0x0,'rows':[]};var _0x1d49b5=db[_0x5d41('0x30')][_0x5d41('0x31')];_0x49d695[_0x5d41('0x32')]=_['keys'](_0x1d49b5);_0x49d695['query']=_[_0x5d41('0x33')](_0x41d11d[_0x5d41('0x34')]);_0x49d695[_0x5d41('0x35')]=_[_0x5d41('0x36')](_0x49d695[_0x5d41('0x32')],_0x49d695[_0x5d41('0x34')]);_0x2c7aa4[_0x5d41('0x37')]=_[_0x5d41('0x36')](_0x49d695[_0x5d41('0x32')],qs[_0x5d41('0x38')](_0x41d11d[_0x5d41('0x34')][_0x5d41('0x38')]));_0x2c7aa4[_0x5d41('0x37')]=_0x2c7aa4[_0x5d41('0x37')][_0x5d41('0x39')]?_0x2c7aa4[_0x5d41('0x37')]:_0x49d695['model'];if(!_0x41d11d['query'][_0x5d41('0x3a')](_0x5d41('0x3b'))){_0x2c7aa4[_0x5d41('0x22')]=qs[_0x5d41('0x22')](_0x41d11d[_0x5d41('0x34')][_0x5d41('0x22')]);_0x2c7aa4[_0x5d41('0x21')]=qs['offset'](_0x41d11d[_0x5d41('0x34')]['offset']);}_0x2c7aa4[_0x5d41('0x3c')]=qs[_0x5d41('0x3d')](_0x41d11d['query'][_0x5d41('0x3d')]);_0x2c7aa4[_0x5d41('0x3e')]=qs[_0x5d41('0x35')](_[_0x5d41('0x3f')](_0x41d11d[_0x5d41('0x34')],_0x49d695[_0x5d41('0x35')]));if(_0x41d11d[_0x5d41('0x34')]['filter']){_0x2c7aa4['where']=_[_0x5d41('0x40')](_0x2c7aa4[_0x5d41('0x3e')],{'$or':_[_0x5d41('0x41')](_0x1d49b5,function(_0x1946a0){if(_0x1946a0[_0x5d41('0x42')]['key']!=='VIRTUAL'){var _0x50974e={};_0x50974e[_0x1946a0[_0x5d41('0x43')]]={'$like':'%'+_0x41d11d[_0x5d41('0x34')][_0x5d41('0x44')]+'%'};return _0x50974e;}})});}_0x2c7aa4=_[_0x5d41('0x40')]({},_0x2c7aa4,_0x41d11d[_0x5d41('0x45')]);var _0x220160={'where':_0x2c7aa4[_0x5d41('0x3e')]};return db['VoiceContext'][_0x5d41('0x46')](_0x220160)[_0x5d41('0x17')](function(_0x38d8f2){_0x21d2ed[_0x5d41('0x46')]=_0x38d8f2;if(_0x41d11d['query'][_0x5d41('0x47')]){_0x2c7aa4[_0x5d41('0x48')]=[{'all':!![]}];}return db[_0x5d41('0x30')][_0x5d41('0x49')](_0x2c7aa4);})[_0x5d41('0x17')](function(_0x38823b){_0x21d2ed[_0x5d41('0x4a')]=_0x38823b;return _0x21d2ed;})['then'](respondWithFilteredResult(_0x1b6dd8,_0x2c7aa4))[_0x5d41('0x4b')](handleError(_0x1b6dd8,null));};exports[_0x5d41('0x4c')]=function(_0x389fa1,_0x5cc6b0){var _0x24e54b={'raw':![],'where':{'id':_0x389fa1[_0x5d41('0x4d')]['id']}},_0x5f45d6={};_0x5f45d6[_0x5d41('0x32')]=_[_0x5d41('0x33')](db[_0x5d41('0x30')][_0x5d41('0x31')]);_0x5f45d6[_0x5d41('0x34')]=_[_0x5d41('0x33')](_0x389fa1[_0x5d41('0x34')]);_0x5f45d6['filters']=_[_0x5d41('0x36')](_0x5f45d6['model'],_0x5f45d6[_0x5d41('0x34')]);_0x24e54b[_0x5d41('0x37')]=_[_0x5d41('0x36')](_0x5f45d6[_0x5d41('0x32')],qs[_0x5d41('0x38')](_0x389fa1[_0x5d41('0x34')]['fields']));_0x24e54b[_0x5d41('0x37')]=_0x24e54b[_0x5d41('0x37')][_0x5d41('0x39')]?_0x24e54b['attributes']:_0x5f45d6[_0x5d41('0x32')];if(_0x389fa1[_0x5d41('0x34')][_0x5d41('0x47')]){_0x24e54b[_0x5d41('0x48')]=[{'all':!![]}];}_0x24e54b=_[_0x5d41('0x40')]({},_0x24e54b,_0x389fa1[_0x5d41('0x45')]);return db[_0x5d41('0x30')][_0x5d41('0x4e')](_0x24e54b)[_0x5d41('0x17')](handleEntityNotFound(_0x5cc6b0,null))['then'](respondWithResult(_0x5cc6b0,null))[_0x5d41('0x4b')](handleError(_0x5cc6b0,null));};exports[_0x5d41('0x4f')]=function(_0x3bf36e,_0x192294,_0x33c262){var _0x2dcdf1;return db[_0x5d41('0x30')][_0x5d41('0x4f')](_0x3bf36e[_0x5d41('0x50')],{'raw':!![]})[_0x5d41('0x17')](function(_0x2642f7){_0x2dcdf1=_0x2642f7;return db[_0x5d41('0x30')]['findAll']({'raw':!![]});})[_0x5d41('0x17')](function(_0x511df2){var _0x56fa4a=fs[_0x5d41('0x51')](path[_0x5d41('0x52')](config[_0x5d41('0x53')],_0x5d41('0x54')),'utf8');var _0x2ef7d7=ejs[_0x5d41('0x55')](_0x56fa4a,{'contexts':_0x511df2||[]});fs['writeFileSync'](_0x5d41('0x56'),_0x2ef7d7);})[_0x5d41('0x17')](function(){return respondWithRpcPromise(_0x5d41('0x57'),_0x5d41('0x4f'),{'module':'chan_sip.so'});})[_0x5d41('0x17')](function(){var _0x5eb591=_0x3bf36e[_0x5d41('0x58')][_0x5d41('0x27')]({'plain':!![]});if(!_0x5eb591)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5eb591[_0x5d41('0x59')]===_0x5d41('0x58')){var _0x2b408c=_0x2dcdf1[_0x5d41('0x27')]({'plain':!![]});return db[_0x5d41('0x5a')][_0x5d41('0x4e')]({'where':{'name':_0x5d41('0x28'),'userProfileId':_0x5eb591[_0x5d41('0x5b')]},'raw':!![]})[_0x5d41('0x17')](function(_0x37f320){if(_0x37f320&&_0x37f320[_0x5d41('0x5c')]===0x0){return db[_0x5d41('0x29')][_0x5d41('0x4f')]({'name':_0x2b408c[_0x5d41('0x2d')],'resourceId':_0x2b408c['id'],'type':_0x37f320[_0x5d41('0x2d')],'sectionId':_0x37f320['id']},{})['then'](function(){return _0x2dcdf1;});}else{return _0x2dcdf1;}})[_0x5d41('0x4b')](function(_0x1ad113){logger['error'](_0x5d41('0x5d'),_0x1ad113);throw _0x1ad113;});}return _0x2dcdf1;})[_0x5d41('0x17')](respondWithResult(_0x192294,0xc9))[_0x5d41('0x4b')](handleError(_0x192294,null));};exports[_0x5d41('0x25')]=function(_0x588f86,_0x10f157,_0x50868a){var _0x4896bc;return db[_0x5d41('0x30')][_0x5d41('0x4e')]({'where':{'id':_0x588f86[_0x5d41('0x4d')]['id']}})[_0x5d41('0x17')](handleEntityNotFound(_0x10f157,null))[_0x5d41('0x17')](saveUpdates(_0x588f86[_0x5d41('0x50')],null))['then'](function(_0xbaeb22){if(_0xbaeb22){_0x4896bc=_0xbaeb22;return db[_0x5d41('0x30')][_0x5d41('0x49')]({'raw':!![]});}})['then'](function(_0x6ec8a4){var _0xfa7bed=fs['readFileSync'](path[_0x5d41('0x52')](config[_0x5d41('0x53')],'server/files/templates/context.ejs'),_0x5d41('0x5e'));var _0x2e62d3=ejs[_0x5d41('0x55')](_0xfa7bed,{'contexts':_0x6ec8a4||[]});fs['writeFileSync'](_0x5d41('0x56'),_0x2e62d3);})['then'](function(){return respondWithRpcPromise(_0x5d41('0x57'),_0x5d41('0x25'),{'module':_0x5d41('0x5f')});})['then'](function(){return _0x4896bc;})['then'](respondWithResult(_0x10f157,null))[_0x5d41('0x4b')](handleError(_0x10f157,null));};exports[_0x5d41('0x26')]=function(_0x3bb31e,_0x3b773d,_0x3b13d6){var _0x2075cd;return db['VoiceContext'][_0x5d41('0x4e')]({'where':{'id':_0x3bb31e[_0x5d41('0x4d')]['id']}})[_0x5d41('0x17')](handleEntityNotFound(_0x3b773d,null))[_0x5d41('0x17')](removeEntity(_0x3b773d,null))['then'](function(){return db[_0x5d41('0x30')][_0x5d41('0x49')]({'raw':!![]});})[_0x5d41('0x17')](function(_0x865d9e){var _0x319107=fs[_0x5d41('0x51')](path[_0x5d41('0x52')](config[_0x5d41('0x53')],_0x5d41('0x54')),'utf8');var _0x1e89bd=ejs[_0x5d41('0x55')](_0x319107,{'contexts':_0x865d9e});fs[_0x5d41('0x60')](_0x5d41('0x56'),_0x1e89bd);return respondWithRpcPromise(_0x5d41('0x57'),_0x5d41('0x26'),{'module':_0x5d41('0x5f')});})[_0x5d41('0x4b')](handleError(_0x3b773d,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index ff5bcd8..318e98b 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 _0xd6f6=['lodash','../../config/logger','api','path','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd6f6,0x14d));var _0x6d6f=function(_0x186316,_0x49762b){_0x186316=_0x186316-0x0;var _0xedc3d4=_0xd6f6[_0x186316];return _0xedc3d4;};'use strict';var _=require(_0x6d6f('0x0'));var util=require('util');var logger=require(_0x6d6f('0x1'))(_0x6d6f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d6f('0x3'));var rimraf=require('rimraf');var config=require(_0x6d6f('0x4'));var attributes=require(_0x6d6f('0x5'));module[_0x6d6f('0x6')]=function(_0x180e5c,_0x1614c4){return _0x180e5c[_0x6d6f('0x7')]('VoiceContext',attributes,{'tableName':_0x6d6f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb09c=['moment','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','api'];(function(_0x394609,_0x55c57f){var _0xf56d3c=function(_0x404472){while(--_0x404472){_0x394609['push'](_0x394609['shift']());}};_0xf56d3c(++_0x55c57f);}(_0xb09c,0x96));var _0xcb09=function(_0x241cf1,_0x5c6159){_0x241cf1=_0x241cf1-0x0;var _0x4454c6=_0xb09c[_0x241cf1];return _0x4454c6;};'use strict';var _=require(_0xcb09('0x0'));var util=require(_0xcb09('0x1'));var logger=require('../../config/logger')(_0xcb09('0x2'));var moment=require(_0xcb09('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(_0xcb09('0x4'));var attributes=require('./voiceContext.attributes');module[_0xcb09('0x5')]=function(_0x38efee,_0x783ed0){return _0x38efee[_0xcb09('0x6')](_0xcb09('0x7'),attributes,{'tableName':_0xcb09('0x8'),'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 106d7b3..3757335 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 _0x65ec=['util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3f477c,_0x52b7ff){var _0x4c36b3=function(_0x3b47bb){while(--_0x3b47bb){_0x3f477c['push'](_0x3f477c['shift']());}};_0x4c36b3(++_0x52b7ff);}(_0x65ec,0x18e));var _0xc65e=function(_0x14077e,_0x48ae2f){_0x14077e=_0x14077e-0x0;var _0x212ebe=_0x65ec[_0x14077e];return _0x212ebe;};'use strict';var _=require(_0xc65e('0x0'));var util=require(_0xc65e('0x1'));var moment=require(_0xc65e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc65e('0x3'));var fs=require('fs');var Redis=require(_0xc65e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc65e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc65e('0x6'));var client=jayson[_0xc65e('0x7')][_0xc65e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4482bf,_0x440d73,_0x3504a0){return new BPromise(function(_0x54ef1b,_0x5026f8){return client[_0xc65e('0x9')](_0x4482bf,_0x3504a0)['then'](function(_0x13faa7){logger[_0xc65e('0xa')]('VoiceContext,\x20%s,\x20%s',_0x440d73,_0xc65e('0xb'));logger[_0xc65e('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x440d73,_0xc65e('0xb'),JSON[_0xc65e('0xd')](_0x13faa7));if(_0x13faa7[_0xc65e('0xe')]){if(_0x13faa7['error']['code']===0x1f4){logger[_0xc65e('0xe')](_0xc65e('0xf'),_0x440d73,_0x13faa7[_0xc65e('0xe')]['message']);return _0x5026f8(_0x13faa7[_0xc65e('0xe')][_0xc65e('0x10')]);}logger[_0xc65e('0xe')](_0xc65e('0xf'),_0x440d73,_0x13faa7[_0xc65e('0xe')][_0xc65e('0x10')]);return _0x54ef1b(_0x13faa7[_0xc65e('0xe')][_0xc65e('0x10')]);}else{logger['info'](_0xc65e('0xf'),_0x440d73,_0xc65e('0xb'));_0x54ef1b(_0x13faa7[_0xc65e('0x11')][_0xc65e('0x10')]);}})[_0xc65e('0x12')](function(_0x2b0b3c){logger['error'](_0xc65e('0xf'),_0x440d73,_0x2b0b3c);_0x5026f8(_0x2b0b3c);});});} \ No newline at end of file +var _0x7343=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7343,0x10e));var _0x3734=function(_0x3d63c6,_0x4a5ea2){_0x3d63c6=_0x3d63c6-0x0;var _0x2cc916=_0x7343[_0x3d63c6];return _0x2cc916;};'use strict';var _=require(_0x3734('0x0'));var util=require('util');var moment=require(_0x3734('0x1'));var BPromise=require(_0x3734('0x2'));var rs=require(_0x3734('0x3'));var fs=require('fs');var Redis=require(_0x3734('0x4'));var db=require(_0x3734('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3734('0x6'))(_0x3734('0x7'));var config=require(_0x3734('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3734('0x9')][_0x3734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58b50a,_0x22517f,_0x540e1f){return new BPromise(function(_0x453d5b,_0x5eb036){return client[_0x3734('0xb')](_0x58b50a,_0x540e1f)[_0x3734('0xc')](function(_0x42128a){logger['info'](_0x3734('0xd'),_0x22517f,_0x3734('0xe'));logger[_0x3734('0xf')](_0x3734('0x10'),_0x22517f,'request\x20sent',JSON[_0x3734('0x11')](_0x42128a));if(_0x42128a[_0x3734('0x12')]){if(_0x42128a[_0x3734('0x12')][_0x3734('0x13')]===0x1f4){logger['error'](_0x3734('0xd'),_0x22517f,_0x42128a[_0x3734('0x12')][_0x3734('0x14')]);return _0x5eb036(_0x42128a['error'][_0x3734('0x14')]);}logger[_0x3734('0x12')](_0x3734('0xd'),_0x22517f,_0x42128a[_0x3734('0x12')][_0x3734('0x14')]);return _0x453d5b(_0x42128a[_0x3734('0x12')][_0x3734('0x14')]);}else{logger[_0x3734('0x15')](_0x3734('0xd'),_0x22517f,_0x3734('0xe'));_0x453d5b(_0x42128a[_0x3734('0x16')][_0x3734('0x14')]);}})[_0x3734('0x17')](function(_0x1ddfb3){logger[_0x3734('0x12')](_0x3734('0xd'),_0x22517f,_0x1ddfb3);_0x5eb036(_0x1ddfb3);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 48d486b..04b3c39 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 _0xd953=['delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd953,0xfa));var _0x3d95=function(_0x177b98,_0x1ef3ae){_0x177b98=_0x177b98-0x0;var _0x2ff540=_0xd953[_0x177b98];return _0x2ff540;};'use strict';var multer=require('multer');var util=require(_0x3d95('0x0'));var path=require(_0x3d95('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d95('0x2'));var router=express[_0x3d95('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3d95('0x4'));var config=require(_0x3d95('0x5'));var controller=require(_0x3d95('0x6'));router[_0x3d95('0x7')]('/',auth[_0x3d95('0x8')](),controller[_0x3d95('0x9')]);router['get'](_0x3d95('0xa'),auth[_0x3d95('0x8')](),controller[_0x3d95('0xb')]);router[_0x3d95('0x7')]('/:id',auth[_0x3d95('0x8')](),controller['show']);router[_0x3d95('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d95('0xd')](_0x3d95('0xe'),auth[_0x3d95('0x8')](),controller[_0x3d95('0xf')]);router[_0x3d95('0x10')]('/:id',auth[_0x3d95('0x8')](),controller[_0x3d95('0x11')]);module[_0x3d95('0x12')]=router; \ No newline at end of file +var _0x8b5d=['show','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','describe'];(function(_0x3f7be5,_0x9a9711){var _0xa1e1c1=function(_0x3869b0){while(--_0x3869b0){_0x3f7be5['push'](_0x3f7be5['shift']());}};_0xa1e1c1(++_0x9a9711);}(_0x8b5d,0xc5));var _0xd8b5=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0x8b5d[_0x54b458];return _0x18d704;};'use strict';var multer=require(_0xd8b5('0x0'));var util=require('util');var path=require(_0xd8b5('0x1'));var timeout=require(_0xd8b5('0x2'));var express=require(_0xd8b5('0x3'));var router=express[_0xd8b5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8b5('0x5'));var config=require('../../config/environment');var controller=require(_0xd8b5('0x6'));router['get']('/',auth[_0xd8b5('0x7')](),controller[_0xd8b5('0x8')]);router[_0xd8b5('0x9')]('/describe',auth[_0xd8b5('0x7')](),controller[_0xd8b5('0xa')]);router[_0xd8b5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd8b5('0xb')]);router['post']('/',auth[_0xd8b5('0x7')](),controller['create']);router['put']('/:id',auth[_0xd8b5('0x7')](),controller['update']);router[_0xd8b5('0xc')](_0xd8b5('0xd'),auth[_0xd8b5('0x7')](),controller[_0xd8b5('0xe')]);module[_0xd8b5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f5220aa..c818af1 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 _0x54b2=['sequelize','STRING','INTEGER','DATE','called,connect,complete'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x54b2,0x6e));var _0x254b=function(_0x295369,_0x350ebf){_0x295369=_0x295369-0x0;var _0x3c86d9=_0x54b2[_0x295369];return _0x3c86d9;};'use strict';var Sequelize=require(_0x254b('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x254b('0x1')]},'channel':{'type':Sequelize[_0x254b('0x1')]},'channelstate':{'type':Sequelize[_0x254b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x254b('0x1')]},'calleridnum':{'type':Sequelize[_0x254b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x254b('0x1')]},'connectedlinename':{'type':Sequelize[_0x254b('0x1')]},'language':{'type':Sequelize[_0x254b('0x1')]},'accountcode':{'type':Sequelize[_0x254b('0x1')]},'context':{'type':Sequelize[_0x254b('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x254b('0x2')]},'uniqueid':{'type':Sequelize[_0x254b('0x1')]},'linkedid':{'type':Sequelize[_0x254b('0x1')]},'destchannel':{'type':Sequelize[_0x254b('0x1')]},'destchannelstate':{'type':Sequelize[_0x254b('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x254b('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x254b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x254b('0x1')]},'destlanguage':{'type':Sequelize[_0x254b('0x1')]},'destaccountcode':{'type':Sequelize[_0x254b('0x1')]},'destcontext':{'type':Sequelize[_0x254b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x254b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x254b('0x1')]},'dialstring':{'type':Sequelize[_0x254b('0x1')]},'dialstatus':{'type':Sequelize[_0x254b('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x254b('0x3')]},'endtime':{'type':Sequelize[_0x254b('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x254b('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x254b('0x2')]},'billableseconds':{'type':Sequelize[_0x254b('0x2')]}}; \ No newline at end of file +var _0xc522=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xc522,0xa3));var _0x2c52=function(_0x52e149,_0x41ff3a){_0x52e149=_0x52e149-0x0;var _0x43a55a=_0xc522[_0x52e149];return _0x43a55a;};'use strict';var Sequelize=require(_0x2c52('0x0'));module[_0x2c52('0x1')]={'privilege':{'type':Sequelize[_0x2c52('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x2c52('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2c52('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2c52('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2c52('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2c52('0x2')]},'context':{'type':Sequelize[_0x2c52('0x2')]},'exten':{'type':Sequelize[_0x2c52('0x2')]},'priority':{'type':Sequelize[_0x2c52('0x3')]},'uniqueid':{'type':Sequelize[_0x2c52('0x2')]},'linkedid':{'type':Sequelize[_0x2c52('0x2')]},'destchannel':{'type':Sequelize[_0x2c52('0x2')]},'destchannelstate':{'type':Sequelize[_0x2c52('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2c52('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2c52('0x2')]},'destcalleridname':{'type':Sequelize[_0x2c52('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2c52('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2c52('0x2')]},'destlanguage':{'type':Sequelize[_0x2c52('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2c52('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2c52('0x3')]},'destuniqueid':{'type':Sequelize[_0x2c52('0x2')]},'destlinkedid':{'type':Sequelize[_0x2c52('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2c52('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2c52('0x4')]},'lastevent':{'type':Sequelize[_0x2c52('0x2')],'comment':_0x2c52('0x5')},'routeId':{'type':Sequelize[_0x2c52('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x2c52('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 824b158..067a566 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 _0x255f=['offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','VoiceDialReport','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x255f,0x185));var _0xf255=function(_0x44f1f1,_0x4be4e4){_0x44f1f1=_0x44f1f1-0x0;var _0x1fae61=_0x255f[_0x44f1f1];return _0x1fae61;};'use strict';var pdf=require(_0xf255('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf255('0x1'));var zipdir=require(_0xf255('0x2'));var jsonpatch=require(_0xf255('0x3'));var rp=require('request-promise');var moment=require(_0xf255('0x4'));var BPromise=require(_0xf255('0x5'));var Mustache=require(_0xf255('0x6'));var util=require(_0xf255('0x7'));var path=require(_0xf255('0x8'));var sox=require(_0xf255('0x9'));var csv=require(_0xf255('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf255('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf255('0xc'));var deskjs=require(_0xf255('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf255('0xe'));var Papa=require(_0xf255('0xf'));var Redis=require('ioredis');var authService=require(_0xf255('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf255('0x11'));var logger=require(_0xf255('0x12'))(_0xf255('0x13'));var utils=require(_0xf255('0x14'));var config=require(_0xf255('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x853ad2,_0xab71ec){_0xab71ec=_0xab71ec||0xcc;return function(_0x35fe1b){if(_0x35fe1b){return _0x853ad2['sendStatus'](_0xab71ec);}return _0x853ad2[_0xf255('0x16')](_0xab71ec)[_0xf255('0x17')]();};}function respondWithResult(_0x52a804,_0x17b028){_0x17b028=_0x17b028||0xc8;return function(_0x266b73){if(_0x266b73){return _0x52a804[_0xf255('0x16')](_0x17b028)['json'](_0x266b73);}};}function respondWithFilteredResult(_0x393d1d,_0xc5b6a4){return function(_0x4b8c8){if(_0x4b8c8){var _0x750c8a=_0x4b8c8[_0xf255('0x18')],_0x194e28=_0xc5b6a4['offset'],_0x4d9a07=_0xc5b6a4[_0xf255('0x19')]+_0xc5b6a4['limit'],_0x4edad2;if(_0x4d9a07>=_0x750c8a){_0x4d9a07=_0x750c8a;_0x4edad2=0xc8;}else{_0x4edad2=0xce;}_0x393d1d[_0xf255('0x16')](_0x4edad2);return _0x393d1d[_0xf255('0x1a')](_0xf255('0x1b'),_0x194e28+'-'+_0x4d9a07+'/'+_0x750c8a)[_0xf255('0x1c')](_0x4b8c8);}return null;};}function patchUpdates(_0x186558){return function(_0x2490d9){try{jsonpatch[_0xf255('0x1d')](_0x2490d9,_0x186558,!![]);}catch(_0x422a19){return BPromise[_0xf255('0x1e')](_0x422a19);}return _0x2490d9[_0xf255('0x1f')]();};}function saveUpdates(_0x3a930d,_0x4e05e3){return function(_0x2fe87d){if(_0x2fe87d){return _0x2fe87d[_0xf255('0x20')](_0x3a930d)[_0xf255('0x21')](function(_0x2c5fbc){return _0x2c5fbc;});}return null;};}function removeEntity(_0x1e3109,_0x11fbe9){return function(_0x31bde5){if(_0x31bde5){return _0x31bde5['destroy']()[_0xf255('0x21')](function(){_0x1e3109[_0xf255('0x16')](0xcc)[_0xf255('0x17')]();});}};}function handleEntityNotFound(_0x1dad1e,_0x325ee8){return function(_0x1b3b1a){if(!_0x1b3b1a){_0x1dad1e[_0xf255('0x22')](0x194);}return _0x1b3b1a;};}function handleError(_0x4b1bef,_0x28cb07){_0x28cb07=_0x28cb07||0x1f4;return function(_0x4c1664){logger['error'](_0x4c1664[_0xf255('0x23')]);if(_0x4c1664[_0xf255('0x24')]){delete _0x4c1664[_0xf255('0x24')];}_0x4b1bef[_0xf255('0x16')](_0x28cb07)[_0xf255('0x25')](_0x4c1664);};}exports['index']=function(_0x1c3a8e,_0x157397){var _0xdeaf7e={},_0x551da1={},_0x1b1980={'count':0x0,'rows':[]};var _0x3527fb=db[_0xf255('0x26')]['rawAttributes'];_0x551da1[_0xf255('0x27')]=_[_0xf255('0x28')](_0x3527fb);_0x551da1[_0xf255('0x29')]=_[_0xf255('0x28')](_0x1c3a8e[_0xf255('0x29')]);_0x551da1[_0xf255('0x2a')]=_[_0xf255('0x2b')](_0x551da1[_0xf255('0x27')],_0x551da1[_0xf255('0x29')]);_0xdeaf7e[_0xf255('0x2c')]=_['intersection'](_0x551da1[_0xf255('0x27')],qs[_0xf255('0x2d')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x2d')]));_0xdeaf7e[_0xf255('0x2c')]=_0xdeaf7e[_0xf255('0x2c')][_0xf255('0x2e')]?_0xdeaf7e[_0xf255('0x2c')]:_0x551da1['model'];if(!_0x1c3a8e[_0xf255('0x29')]['hasOwnProperty']('nolimit')){_0xdeaf7e[_0xf255('0x2f')]=qs[_0xf255('0x2f')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x2f')]);_0xdeaf7e[_0xf255('0x19')]=qs[_0xf255('0x19')](_0x1c3a8e[_0xf255('0x29')]['offset']);}_0xdeaf7e[_0xf255('0x30')]=qs[_0xf255('0x31')](_0x1c3a8e[_0xf255('0x29')][_0xf255('0x31')]);_0xdeaf7e[_0xf255('0x32')]=qs[_0xf255('0x2a')](_['pick'](_0x1c3a8e[_0xf255('0x29')],_0x551da1[_0xf255('0x2a')]));if(_0x1c3a8e[_0xf255('0x29')][_0xf255('0x33')]){_0xdeaf7e[_0xf255('0x32')]=_['merge'](_0xdeaf7e[_0xf255('0x32')],{'$or':_[_0xf255('0x34')](_0x3527fb,function(_0x6f9156){if(_0x6f9156[_0xf255('0x35')][_0xf255('0x36')]!==_0xf255('0x37')){var _0x4ad7c7={};_0x4ad7c7[_0x6f9156[_0xf255('0x38')]]={'$like':'%'+_0x1c3a8e[_0xf255('0x29')][_0xf255('0x33')]+'%'};return _0x4ad7c7;}})});}_0xdeaf7e=_[_0xf255('0x39')]({},_0xdeaf7e,_0x1c3a8e[_0xf255('0x3a')]);var _0x4fb2b3={'where':_0xdeaf7e[_0xf255('0x32')]};return db[_0xf255('0x26')][_0xf255('0x18')](_0x4fb2b3)[_0xf255('0x21')](function(_0x19b901){_0x1b1980[_0xf255('0x18')]=_0x19b901;if(_0x1c3a8e[_0xf255('0x29')]['includeAll']){_0xdeaf7e[_0xf255('0x3b')]=[{'all':!![]}];}return db[_0xf255('0x26')][_0xf255('0x3c')](_0xdeaf7e);})['then'](function(_0x1aef9c){_0x1b1980['rows']=_0x1aef9c;return _0x1b1980;})[_0xf255('0x21')](respondWithFilteredResult(_0x157397,_0xdeaf7e))[_0xf255('0x3d')](handleError(_0x157397,null));};exports[_0xf255('0x3e')]=function(_0x4516c5,_0x2edc1a){var _0x34dcb8={'raw':!![],'where':{'id':_0x4516c5[_0xf255('0x3f')]['id']}},_0x3d7358={};_0x3d7358[_0xf255('0x27')]=_[_0xf255('0x28')](db[_0xf255('0x26')][_0xf255('0x40')]);_0x3d7358[_0xf255('0x29')]=_[_0xf255('0x28')](_0x4516c5[_0xf255('0x29')]);_0x3d7358[_0xf255('0x2a')]=_[_0xf255('0x2b')](_0x3d7358['model'],_0x3d7358[_0xf255('0x29')]);_0x34dcb8['attributes']=_[_0xf255('0x2b')](_0x3d7358[_0xf255('0x27')],qs['fields'](_0x4516c5[_0xf255('0x29')]['fields']));_0x34dcb8[_0xf255('0x2c')]=_0x34dcb8[_0xf255('0x2c')]['length']?_0x34dcb8[_0xf255('0x2c')]:_0x3d7358['model'];if(_0x4516c5['query']['includeAll']){_0x34dcb8[_0xf255('0x3b')]=[{'all':!![]}];}_0x34dcb8=_[_0xf255('0x39')]({},_0x34dcb8,_0x4516c5[_0xf255('0x3a')]);return db[_0xf255('0x26')]['find'](_0x34dcb8)[_0xf255('0x21')](handleEntityNotFound(_0x2edc1a,null))[_0xf255('0x21')](respondWithResult(_0x2edc1a,null))[_0xf255('0x3d')](handleError(_0x2edc1a,null));};exports[_0xf255('0x41')]=function(_0x2426e7,_0x5ef308){return db[_0xf255('0x26')][_0xf255('0x41')](_0x2426e7[_0xf255('0x42')],{})[_0xf255('0x21')](respondWithResult(_0x5ef308,0xc9))[_0xf255('0x3d')](handleError(_0x5ef308,null));};exports[_0xf255('0x20')]=function(_0x21ef06,_0xb37dd6){if(_0x21ef06['body']['id']){delete _0x21ef06['body']['id'];}return db['VoiceDialReport'][_0xf255('0x43')]({'where':{'id':_0x21ef06['params']['id']}})['then'](handleEntityNotFound(_0xb37dd6,null))[_0xf255('0x21')](saveUpdates(_0x21ef06[_0xf255('0x42')],null))[_0xf255('0x21')](respondWithResult(_0xb37dd6,null))[_0xf255('0x3d')](handleError(_0xb37dd6,null));};exports['destroy']=function(_0x5bf6e7,_0x1a893c){return db['VoiceDialReport']['find']({'where':{'id':_0x5bf6e7[_0xf255('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1a893c,null))[_0xf255('0x21')](removeEntity(_0x1a893c,null))[_0xf255('0x3d')](handleError(_0x1a893c,null));};exports[_0xf255('0x44')]=function(_0x3bbb62,_0x37b687){return db[_0xf255('0x26')][_0xf255('0x44')]()[_0xf255('0x21')](respondWithResult(_0x37b687,null))[_0xf255('0x3d')](handleError(_0x37b687,null));}; \ No newline at end of file +var _0x702d=['Content-Range','apply','reject','save','then','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','count','includeAll','include','rows','catch','show','options','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','limit'];(function(_0xdc4c47,_0x1bb1e7){var _0x408277=function(_0x544075){while(--_0x544075){_0xdc4c47['push'](_0xdc4c47['shift']());}};_0x408277(++_0x1bb1e7);}(_0x702d,0x147));var _0xd702=function(_0x4b9729,_0x21f240){_0x4b9729=_0x4b9729-0x0;var _0x5be0c4=_0x702d[_0x4b9729];return _0x5be0c4;};'use strict';var pdf=require(_0xd702('0x0'));var emlformat=require(_0xd702('0x1'));var rimraf=require(_0xd702('0x2'));var zipdir=require(_0xd702('0x3'));var jsonpatch=require(_0xd702('0x4'));var rp=require('request-promise');var moment=require(_0xd702('0x5'));var BPromise=require(_0xd702('0x6'));var Mustache=require(_0xd702('0x7'));var util=require(_0xd702('0x8'));var path=require('path');var sox=require(_0xd702('0x9'));var csv=require('to-csv');var ejs=require(_0xd702('0xa'));var fs=require('fs');var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0xe'));var querystring=require(_0xd702('0xf'));var Papa=require(_0xd702('0x10'));var Redis=require(_0xd702('0x11'));var authService=require(_0xd702('0x12'));var qs=require(_0xd702('0x13'));var hardwareService=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require(_0xd702('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e9439,_0x42e1ad){_0x42e1ad=_0x42e1ad||0xcc;return function(_0x273577){if(_0x273577){return _0x3e9439['sendStatus'](_0x42e1ad);}return _0x3e9439[_0xd702('0x18')](_0x42e1ad)[_0xd702('0x19')]();};}function respondWithResult(_0x1ed8a3,_0x2735db){_0x2735db=_0x2735db||0xc8;return function(_0x3948f8){if(_0x3948f8){return _0x1ed8a3[_0xd702('0x18')](_0x2735db)['json'](_0x3948f8);}};}function respondWithFilteredResult(_0x2f26b9,_0x3ea0ab){return function(_0x5d7978){if(_0x5d7978){var _0x707b9=_0x5d7978['count'],_0x4922f8=_0x3ea0ab[_0xd702('0x1a')],_0x268c66=_0x3ea0ab[_0xd702('0x1a')]+_0x3ea0ab[_0xd702('0x1b')],_0x210c32;if(_0x268c66>=_0x707b9){_0x268c66=_0x707b9;_0x210c32=0xc8;}else{_0x210c32=0xce;}_0x2f26b9['status'](_0x210c32);return _0x2f26b9['set'](_0xd702('0x1c'),_0x4922f8+'-'+_0x268c66+'/'+_0x707b9)['json'](_0x5d7978);}return null;};}function patchUpdates(_0x3fbcec){return function(_0x2a871e){try{jsonpatch[_0xd702('0x1d')](_0x2a871e,_0x3fbcec,!![]);}catch(_0x265b1b){return BPromise[_0xd702('0x1e')](_0x265b1b);}return _0x2a871e[_0xd702('0x1f')]();};}function saveUpdates(_0x612da0,_0x5937f3){return function(_0x4be140){if(_0x4be140){return _0x4be140['update'](_0x612da0)[_0xd702('0x20')](function(_0x109284){return _0x109284;});}return null;};}function removeEntity(_0x5cbff4,_0x211200){return function(_0x5d91fd){if(_0x5d91fd){return _0x5d91fd[_0xd702('0x21')]()['then'](function(){_0x5cbff4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c00e,_0xeec2e4){return function(_0x459184){if(!_0x459184){_0x21c00e['sendStatus'](0x194);}return _0x459184;};}function handleError(_0x1f0c44,_0x17cd14){_0x17cd14=_0x17cd14||0x1f4;return function(_0x10599a){logger[_0xd702('0x22')](_0x10599a[_0xd702('0x23')]);if(_0x10599a[_0xd702('0x24')]){delete _0x10599a[_0xd702('0x24')];}_0x1f0c44[_0xd702('0x18')](_0x17cd14)[_0xd702('0x25')](_0x10599a);};}exports['index']=function(_0x116b2f,_0x322cb8){var _0x25e96a={},_0x335202={},_0xbe4518={'count':0x0,'rows':[]};var _0x38505d=db[_0xd702('0x26')][_0xd702('0x27')];_0x335202['model']=_['keys'](_0x38505d);_0x335202[_0xd702('0x28')]=_[_0xd702('0x29')](_0x116b2f['query']);_0x335202[_0xd702('0x2a')]=_[_0xd702('0x2b')](_0x335202[_0xd702('0x2c')],_0x335202[_0xd702('0x28')]);_0x25e96a['attributes']=_[_0xd702('0x2b')](_0x335202[_0xd702('0x2c')],qs[_0xd702('0x2d')](_0x116b2f[_0xd702('0x28')][_0xd702('0x2d')]));_0x25e96a['attributes']=_0x25e96a[_0xd702('0x2e')][_0xd702('0x2f')]?_0x25e96a[_0xd702('0x2e')]:_0x335202['model'];if(!_0x116b2f[_0xd702('0x28')]['hasOwnProperty']('nolimit')){_0x25e96a[_0xd702('0x1b')]=qs[_0xd702('0x1b')](_0x116b2f[_0xd702('0x28')]['limit']);_0x25e96a[_0xd702('0x1a')]=qs[_0xd702('0x1a')](_0x116b2f['query'][_0xd702('0x1a')]);}_0x25e96a[_0xd702('0x30')]=qs[_0xd702('0x31')](_0x116b2f[_0xd702('0x28')][_0xd702('0x31')]);_0x25e96a[_0xd702('0x32')]=qs[_0xd702('0x2a')](_[_0xd702('0x33')](_0x116b2f[_0xd702('0x28')],_0x335202[_0xd702('0x2a')]));if(_0x116b2f[_0xd702('0x28')][_0xd702('0x34')]){_0x25e96a[_0xd702('0x32')]=_['merge'](_0x25e96a[_0xd702('0x32')],{'$or':_[_0xd702('0x35')](_0x38505d,function(_0xa2b16f){if(_0xa2b16f[_0xd702('0x36')][_0xd702('0x37')]!==_0xd702('0x38')){var _0x26ea2d={};_0x26ea2d[_0xa2b16f['field']]={'$like':'%'+_0x116b2f['query'][_0xd702('0x34')]+'%'};return _0x26ea2d;}})});}_0x25e96a=_[_0xd702('0x39')]({},_0x25e96a,_0x116b2f['options']);var _0x4f3f1c={'where':_0x25e96a[_0xd702('0x32')]};return db[_0xd702('0x26')]['count'](_0x4f3f1c)[_0xd702('0x20')](function(_0x2d810b){_0xbe4518[_0xd702('0x3a')]=_0x2d810b;if(_0x116b2f['query'][_0xd702('0x3b')]){_0x25e96a[_0xd702('0x3c')]=[{'all':!![]}];}return db[_0xd702('0x26')]['findAll'](_0x25e96a);})[_0xd702('0x20')](function(_0x512854){_0xbe4518[_0xd702('0x3d')]=_0x512854;return _0xbe4518;})[_0xd702('0x20')](respondWithFilteredResult(_0x322cb8,_0x25e96a))[_0xd702('0x3e')](handleError(_0x322cb8,null));};exports[_0xd702('0x3f')]=function(_0x6af8d6,_0x1635a3){var _0x45e414={'raw':!![],'where':{'id':_0x6af8d6['params']['id']}},_0x388efa={};_0x388efa[_0xd702('0x2c')]=_[_0xd702('0x29')](db[_0xd702('0x26')][_0xd702('0x27')]);_0x388efa[_0xd702('0x28')]=_['keys'](_0x6af8d6[_0xd702('0x28')]);_0x388efa[_0xd702('0x2a')]=_[_0xd702('0x2b')](_0x388efa['model'],_0x388efa[_0xd702('0x28')]);_0x45e414[_0xd702('0x2e')]=_[_0xd702('0x2b')](_0x388efa[_0xd702('0x2c')],qs['fields'](_0x6af8d6[_0xd702('0x28')][_0xd702('0x2d')]));_0x45e414[_0xd702('0x2e')]=_0x45e414[_0xd702('0x2e')][_0xd702('0x2f')]?_0x45e414['attributes']:_0x388efa[_0xd702('0x2c')];if(_0x6af8d6[_0xd702('0x28')]['includeAll']){_0x45e414['include']=[{'all':!![]}];}_0x45e414=_[_0xd702('0x39')]({},_0x45e414,_0x6af8d6[_0xd702('0x40')]);return db[_0xd702('0x26')][_0xd702('0x41')](_0x45e414)[_0xd702('0x20')](handleEntityNotFound(_0x1635a3,null))[_0xd702('0x20')](respondWithResult(_0x1635a3,null))[_0xd702('0x3e')](handleError(_0x1635a3,null));};exports[_0xd702('0x42')]=function(_0x101515,_0x48f05f){return db['VoiceDialReport'][_0xd702('0x42')](_0x101515['body'],{})[_0xd702('0x20')](respondWithResult(_0x48f05f,0xc9))['catch'](handleError(_0x48f05f,null));};exports[_0xd702('0x43')]=function(_0x58a56f,_0x1f795b){if(_0x58a56f['body']['id']){delete _0x58a56f[_0xd702('0x44')]['id'];}return db[_0xd702('0x26')]['find']({'where':{'id':_0x58a56f[_0xd702('0x45')]['id']}})[_0xd702('0x20')](handleEntityNotFound(_0x1f795b,null))[_0xd702('0x20')](saveUpdates(_0x58a56f[_0xd702('0x44')],null))[_0xd702('0x20')](respondWithResult(_0x1f795b,null))['catch'](handleError(_0x1f795b,null));};exports[_0xd702('0x21')]=function(_0x14c1db,_0x2d09be){return db['VoiceDialReport'][_0xd702('0x41')]({'where':{'id':_0x14c1db['params']['id']}})[_0xd702('0x20')](handleEntityNotFound(_0x2d09be,null))[_0xd702('0x20')](removeEntity(_0x2d09be,null))[_0xd702('0x3e')](handleError(_0x2d09be,null));};exports['describe']=function(_0x5a900d,_0x2e5a91){return db[_0xd702('0x26')][_0xd702('0x46')]()[_0xd702('0x20')](respondWithResult(_0x2e5a91,null))[_0xd702('0x3e')](handleError(_0x2e5a91,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index a95570c..1bf8988 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 _0x97e7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger'];(function(_0x253b50,_0xb58f1a){var _0x16a21b=function(_0x164733){while(--_0x164733){_0x253b50['push'](_0x253b50['shift']());}};_0x16a21b(++_0xb58f1a);}(_0x97e7,0x1a1));var _0x797e=function(_0x1578cf,_0x212769){_0x1578cf=_0x1578cf-0x0;var _0x1f8147=_0x97e7[_0x1578cf];return _0x1f8147;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var logger=require(_0x797e('0x2'))('api');var moment=require(_0x797e('0x3'));var BPromise=require(_0x797e('0x4'));var rp=require(_0x797e('0x5'));var fs=require('fs');var path=require(_0x797e('0x6'));var rimraf=require(_0x797e('0x7'));var config=require(_0x797e('0x8'));var attributes=require(_0x797e('0x9'));module[_0x797e('0xa')]=function(_0x445e60,_0x204c83){return _0x445e60[_0x797e('0xb')](_0x797e('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x797e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdca3=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x4cb69e,_0x229b5f){var _0x1f16e2=function(_0x4c51f5){while(--_0x4c51f5){_0x4cb69e['push'](_0x4cb69e['shift']());}};_0x1f16e2(++_0x229b5f);}(_0xdca3,0x64));var _0x3dca=function(_0x41576b,_0x432155){_0x41576b=_0x41576b-0x0;var _0x1addf0=_0xdca3[_0x41576b];return _0x1addf0;};'use strict';var _=require(_0x3dca('0x0'));var util=require('util');var logger=require(_0x3dca('0x1'))(_0x3dca('0x2'));var moment=require(_0x3dca('0x3'));var BPromise=require(_0x3dca('0x4'));var rp=require(_0x3dca('0x5'));var fs=require('fs');var path=require(_0x3dca('0x6'));var rimraf=require(_0x3dca('0x7'));var config=require(_0x3dca('0x8'));var attributes=require(_0x3dca('0x9'));module[_0x3dca('0xa')]=function(_0x3e2811,_0x5cfa9a){return _0x3e2811[_0x3dca('0xb')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x3dca('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index f1e59cb..421242d 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 _0x7868=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','VoiceDialReport','create','body','options','then','CreateVoiceDialReport','debug','stringify','update','where','attributes','limit','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x542219,_0x89d392){var _0x55ca42=function(_0x192764){while(--_0x192764){_0x542219['push'](_0x542219['shift']());}};_0x55ca42(++_0x89d392);}(_0x7868,0x1c0));var _0x8786=function(_0x472919,_0x20ef40){_0x472919=_0x472919-0x0;var _0x81cccb=_0x7868[_0x472919];return _0x81cccb;};'use strict';var _=require(_0x8786('0x0'));var util=require('util');var moment=require(_0x8786('0x1'));var BPromise=require(_0x8786('0x2'));var rs=require(_0x8786('0x3'));var fs=require('fs');var Redis=require(_0x8786('0x4'));var db=require(_0x8786('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8786('0x6'))(_0x8786('0x7'));var config=require(_0x8786('0x8'));var jayson=require(_0x8786('0x9'));var client=jayson[_0x8786('0xa')][_0x8786('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x251045,_0x3b65c3,_0xe4d300){return new BPromise(function(_0xe9a88d,_0x20b3ed){return client[_0x8786('0xc')](_0x251045,_0xe4d300)['then'](function(_0x5b241a){logger[_0x8786('0xd')](_0x8786('0xe'),_0x3b65c3,_0x8786('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3b65c3,_0x8786('0xf'),JSON['stringify'](_0x5b241a));if(_0x5b241a[_0x8786('0x10')]){if(_0x5b241a[_0x8786('0x10')][_0x8786('0x11')]===0x1f4){logger[_0x8786('0x10')](_0x8786('0xe'),_0x3b65c3,_0x5b241a[_0x8786('0x10')]['message']);return _0x20b3ed(_0x5b241a[_0x8786('0x10')][_0x8786('0x12')]);}logger['error'](_0x8786('0xe'),_0x3b65c3,_0x5b241a[_0x8786('0x10')]['message']);return _0xe9a88d(_0x5b241a[_0x8786('0x10')][_0x8786('0x12')]);}else{logger[_0x8786('0xd')](_0x8786('0xe'),_0x3b65c3,'request\x20sent');_0xe9a88d(_0x5b241a['result']['message']);}})[_0x8786('0x13')](function(_0x450606){logger[_0x8786('0x10')](_0x8786('0xe'),_0x3b65c3,_0x450606);_0x20b3ed(_0x450606);});});}exports['CreateVoiceDialReport']=function(_0x1b410a){var _0x3b9ff1=this;return new Promise(function(_0x316bf7,_0x359f68){return db[_0x8786('0x14')][_0x8786('0x15')](_0x1b410a[_0x8786('0x16')],{'raw':_0x1b410a[_0x8786('0x17')]?_0x1b410a[_0x8786('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8786('0x18')](function(_0x790c9a){logger[_0x8786('0xd')](_0x8786('0x19'),_0x1b410a);logger[_0x8786('0x1a')]('CreateVoiceDialReport',_0x1b410a,JSON[_0x8786('0x1b')](_0x790c9a));_0x316bf7(_0x790c9a);})[_0x8786('0x13')](function(_0x5de3ef){logger[_0x8786('0x10')](_0x8786('0x19'),_0x5de3ef[_0x8786('0x12')],_0x1b410a);_0x359f68(_0x3b9ff1['error'](0x1f4,_0x5de3ef['message']));});});};exports['UpdateVoiceDialReport']=function(_0x27f85e){var _0x33346d=this;return new Promise(function(_0x1bb259,_0x53c884){return db[_0x8786('0x14')][_0x8786('0x1c')](_0x27f85e[_0x8786('0x16')],{'raw':_0x27f85e[_0x8786('0x17')]?_0x27f85e[_0x8786('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f85e['options']?_0x27f85e[_0x8786('0x17')][_0x8786('0x1d')]||null:null,'attributes':_0x27f85e[_0x8786('0x17')]?_0x27f85e[_0x8786('0x17')][_0x8786('0x1e')]||null:null,'limit':_0x27f85e[_0x8786('0x17')]?_0x27f85e[_0x8786('0x17')][_0x8786('0x1f')]||null:null})[_0x8786('0x18')](function(_0xd796e7){logger['info']('UpdateVoiceDialReport',_0x27f85e);logger['debug'](_0x8786('0x20'),_0x27f85e,JSON['stringify'](_0xd796e7));_0x1bb259(_0xd796e7);})[_0x8786('0x13')](function(_0xdf4c00){logger['error'](_0x8786('0x20'),_0xdf4c00['message'],_0x27f85e);_0x53c884(_0x33346d[_0x8786('0x10')](0x1f4,_0xdf4c00[_0x8786('0x12')]));});});}; \ No newline at end of file +var _0x94b1=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','update','body','where','attributes','limit','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94b1,0x102));var _0x194b=function(_0x28e334,_0x419adf){_0x28e334=_0x28e334-0x0;var _0x5d65fa=_0x94b1[_0x28e334];return _0x5d65fa;};'use strict';var _=require('lodash');var util=require(_0x194b('0x0'));var moment=require('moment');var BPromise=require(_0x194b('0x1'));var rs=require(_0x194b('0x2'));var fs=require('fs');var Redis=require(_0x194b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x194b('0x4'));var logger=require(_0x194b('0x5'))(_0x194b('0x6'));var config=require(_0x194b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x194b('0x8')][_0x194b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5213ad,_0x3ec8c2,_0x4e82ac){return new BPromise(function(_0x24b450,_0x4759c0){return client[_0x194b('0xa')](_0x5213ad,_0x4e82ac)[_0x194b('0xb')](function(_0x2f5bb3){logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,'request\x20sent');logger[_0x194b('0xe')](_0x194b('0xf'),_0x3ec8c2,_0x194b('0x10'),JSON['stringify'](_0x2f5bb3));if(_0x2f5bb3[_0x194b('0x11')]){if(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x12')]===0x1f4){logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x4759c0(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x24b450(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}else{logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,_0x194b('0x10'));_0x24b450(_0x2f5bb3[_0x194b('0x14')][_0x194b('0x13')]);}})[_0x194b('0x15')](function(_0x4a115a){logger['error'](_0x194b('0xd'),_0x3ec8c2,_0x4a115a);_0x4759c0(_0x4a115a);});});}exports[_0x194b('0x16')]=function(_0x417b96){var _0x4521e6=this;return new Promise(function(_0xc38e3f,_0x290d40){return db[_0x194b('0x17')][_0x194b('0x18')](_0x417b96['body'],{'raw':_0x417b96[_0x194b('0x19')]?_0x417b96['options'][_0x194b('0x1a')]===undefined?!![]:![]:!![]})[_0x194b('0xb')](function(_0x476168){logger[_0x194b('0xc')](_0x194b('0x16'),_0x417b96);logger[_0x194b('0xe')](_0x194b('0x16'),_0x417b96,JSON['stringify'](_0x476168));_0xc38e3f(_0x476168);})[_0x194b('0x15')](function(_0x4d31fd){logger[_0x194b('0x11')](_0x194b('0x16'),_0x4d31fd[_0x194b('0x13')],_0x417b96);_0x290d40(_0x4521e6[_0x194b('0x11')](0x1f4,_0x4d31fd[_0x194b('0x13')]));});});};exports[_0x194b('0x1b')]=function(_0x3f3aeb){var _0x4942a1=this;return new Promise(function(_0xb704de,_0x25eed2){return db[_0x194b('0x17')][_0x194b('0x1c')](_0x3f3aeb[_0x194b('0x1d')],{'raw':_0x3f3aeb[_0x194b('0x19')]?_0x3f3aeb[_0x194b('0x19')][_0x194b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f3aeb[_0x194b('0x19')]?_0x3f3aeb[_0x194b('0x19')][_0x194b('0x1e')]||null:null,'attributes':_0x3f3aeb[_0x194b('0x19')]?_0x3f3aeb[_0x194b('0x19')][_0x194b('0x1f')]||null:null,'limit':_0x3f3aeb[_0x194b('0x19')]?_0x3f3aeb[_0x194b('0x19')][_0x194b('0x20')]||null:null})[_0x194b('0xb')](function(_0x26137a){logger[_0x194b('0xc')](_0x194b('0x1b'),_0x3f3aeb);logger['debug'](_0x194b('0x1b'),_0x3f3aeb,JSON[_0x194b('0x21')](_0x26137a));_0xb704de(_0x26137a);})[_0x194b('0x15')](function(_0x59b589){logger['error'](_0x194b('0x1b'),_0x59b589[_0x194b('0x13')],_0x3f3aeb);_0x25eed2(_0x4942a1[_0x194b('0x11')](0x1f4,_0x59b589[_0x194b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 812975a..54b176c 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 _0x32b6=['/:id','show','create','post','/:id/applications','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x32b6,0x1d1));var _0x632b=function(_0x230f7a,_0x3e535d){_0x230f7a=_0x230f7a-0x0;var _0x560dbc=_0x32b6[_0x230f7a];return _0x560dbc;};'use strict';var multer=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var path=require('path');var timeout=require(_0x632b('0x2'));var express=require(_0x632b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x632b('0x4'));var config=require(_0x632b('0x5'));var controller=require(_0x632b('0x6'));router[_0x632b('0x7')]('/',auth[_0x632b('0x8')](),controller[_0x632b('0x9')]);router[_0x632b('0x7')](_0x632b('0xa'),auth[_0x632b('0x8')](),controller[_0x632b('0xb')]);router['post']('/',auth[_0x632b('0x8')](),controller[_0x632b('0xc')]);router[_0x632b('0xd')](_0x632b('0xe'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x632b('0xa'),auth['isAuthenticated'](),controller[_0x632b('0xf')]);router[_0x632b('0x10')](_0x632b('0xa'),auth[_0x632b('0x8')](),controller[_0x632b('0x11')]);module[_0x632b('0x12')]=router; \ No newline at end of file +var _0x8a5c=['isAuthenticated','/:id','show','create','post','/:id/applications','addApplications','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x362d03,_0x321ac8){var _0x5ab61d=function(_0x3c3ee3){while(--_0x3c3ee3){_0x362d03['push'](_0x362d03['shift']());}};_0x5ab61d(++_0x321ac8);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5c81ab,_0x4c42e7){_0x5c81ab=_0x5c81ab-0x0;var _0x4d34f4=_0x8a5c[_0x5c81ab];return _0x4d34f4;};'use strict';var multer=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var path=require(_0xc8a5('0x2'));var timeout=require(_0xc8a5('0x3'));var express=require(_0xc8a5('0x4'));var router=express[_0xc8a5('0x5')]();var auth=require(_0xc8a5('0x6'));var interaction=require(_0xc8a5('0x7'));var config=require(_0xc8a5('0x8'));var controller=require('./voiceExtension.controller');router[_0xc8a5('0x9')]('/',auth[_0xc8a5('0xa')](),controller['index']);router[_0xc8a5('0x9')](_0xc8a5('0xb'),auth[_0xc8a5('0xa')](),controller[_0xc8a5('0xc')]);router['post']('/',auth[_0xc8a5('0xa')](),controller[_0xc8a5('0xd')]);router[_0xc8a5('0xe')](_0xc8a5('0xf'),auth[_0xc8a5('0xa')](),controller[_0xc8a5('0x10')]);router[_0xc8a5('0x11')](_0xc8a5('0xb'),auth[_0xc8a5('0xa')](),controller['update']);router['delete'](_0xc8a5('0xb'),auth['isAuthenticated'](),controller[_0xc8a5('0x12')]);module[_0xc8a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5381528..ba4502b 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 _0xbf6e=['inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x26be79,_0x574083){var _0x320182=function(_0x4c1f34){while(--_0x4c1f34){_0x26be79['push'](_0x26be79['shift']());}};_0x320182(++_0x574083);}(_0xbf6e,0x149));var _0xebf6=function(_0x542cb1,_0xf79f5d){_0x542cb1=_0x542cb1-0x0;var _0x51efcb=_0xbf6e[_0x542cb1];return _0x51efcb;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xebf6('0x0')],'allowNull':![],'unique':_0xebf6('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xebf6('0x0')],'allowNull':![],'unique':_0xebf6('0x1')},'priority':{'type':Sequelize[_0xebf6('0x0')],'allowNull':![],'defaultValue':'1','unique':_0xebf6('0x1')},'tag':{'type':Sequelize[_0xebf6('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xebf6('0x2')},'appdata':{'type':Sequelize[_0xebf6('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xebf6('0x3')](_0xebf6('0x4'),_0xebf6('0x5'),_0xebf6('0x6'),_0xebf6('0x7'),'outbound-fax',_0xebf6('0x8'),_0xebf6('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xebf6('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xebf6('0xa')},'IntervalId':{'type':Sequelize[_0xebf6('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xebf6('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xebf6('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xebf6('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xebf6('0xb')]},'recordingFormat':{'type':Sequelize[_0xebf6('0x0')],'defaultValue':_0xebf6('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xebf6('0xe')],'get':function(_0xedc361){return this['getDataValue'](_0xebf6('0xf'));}}}; \ No newline at end of file +var _0x9c00=['system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','internal','inbound-fax','outbound-fax'];(function(_0x425b19,_0x2dcf14){var _0x15ecab=function(_0x317d46){while(--_0x317d46){_0x425b19['push'](_0x425b19['shift']());}};_0x15ecab(++_0x2dcf14);}(_0x9c00,0x1a0));var _0x09c0=function(_0x296db4,_0x3244dc){_0x296db4=_0x296db4-0x0;var _0x44e41c=_0x9c00[_0x296db4];return _0x44e41c;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'unique':_0x09c0('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x09c0('0x3')},'tag':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':_0x09c0('0x4')},'appdata':{'type':Sequelize[_0x09c0('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x09c0('0x5'),_0x09c0('0x6'),_0x09c0('0x7'),_0x09c0('0x8'),_0x09c0('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x09c0('0x2')]},'interval':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![],'defaultValue':_0x09c0('0xa')},'IntervalId':{'type':Sequelize[_0x09c0('0xb')]},'isApp':{'type':Sequelize[_0x09c0('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x09c0('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x09c0('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x09c0('0xb')]},'recordingFormat':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':_0x09c0('0xd')},'answer':{'type':Sequelize[_0x09c0('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x09c0('0xe')],'get':function(_0x144271){return this[_0x09c0('0xf')](_0x09c0('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8e855cf..72a9fb2 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 _0xa44c=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','startsWith','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','inbound','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x26245d,_0x578ecb){var _0x2ca839=function(_0x218bb9){while(--_0x218bb9){_0x26245d['push'](_0x26245d['shift']());}};_0x2ca839(++_0x578ecb);}(_0xa44c,0xc8));var _0xca44=function(_0x16e59e,_0x586ded){_0x16e59e=_0x16e59e-0x0;var _0xb4b3ac=_0xa44c[_0x16e59e];return _0xb4b3ac;};'use strict';var pdf=require(_0xca44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xca44('0x1'));var zipdir=require(_0xca44('0x2'));var jsonpatch=require(_0xca44('0x3'));var rp=require('request-promise');var moment=require(_0xca44('0x4'));var BPromise=require(_0xca44('0x5'));var Mustache=require(_0xca44('0x6'));var util=require(_0xca44('0x7'));var path=require(_0xca44('0x8'));var sox=require('sox');var csv=require(_0xca44('0x9'));var ejs=require(_0xca44('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca44('0xb'));var crypto=require(_0xca44('0xc'));var jsforce=require(_0xca44('0xd'));var deskjs=require(_0xca44('0xe'));var toCsv=require(_0xca44('0x9'));var querystring=require(_0xca44('0xf'));var Papa=require(_0xca44('0x10'));var Redis=require(_0xca44('0x11'));var authService=require(_0xca44('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xca44('0x13'));var logger=require(_0xca44('0x14'))('api');var utils=require(_0xca44('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xca44('0x16')](config[_0xca44('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xca44('0x18'))(new Redis(config[_0xca44('0x17')]));require(_0xca44('0x19'))[_0xca44('0x1a')](socket);function respondWithStatusCode(_0x4fd003,_0x334fb9){_0x334fb9=_0x334fb9||0xcc;return function(_0x4399c3){if(_0x4399c3){return _0x4fd003[_0xca44('0x1b')](_0x334fb9);}return _0x4fd003[_0xca44('0x1c')](_0x334fb9)[_0xca44('0x1d')]();};}function respondWithResult(_0x45c7d9,_0x4c6d37){_0x4c6d37=_0x4c6d37||0xc8;return function(_0xcc7809){if(_0xcc7809){return _0x45c7d9[_0xca44('0x1c')](_0x4c6d37)['json'](_0xcc7809);}};}function respondWithFilteredResult(_0x1c3d27,_0x27868b){return function(_0x2e1b65){if(_0x2e1b65){var _0x470e65=_0x2e1b65[_0xca44('0x1e')],_0x5efd59=_0x27868b[_0xca44('0x1f')],_0x4c89cd=_0x27868b['offset']+_0x27868b[_0xca44('0x20')],_0xb7f80;if(_0x4c89cd>=_0x470e65){_0x4c89cd=_0x470e65;_0xb7f80=0xc8;}else{_0xb7f80=0xce;}_0x1c3d27[_0xca44('0x1c')](_0xb7f80);return _0x1c3d27[_0xca44('0x21')]('Content-Range',_0x5efd59+'-'+_0x4c89cd+'/'+_0x470e65)[_0xca44('0x22')](_0x2e1b65);}return null;};}function patchUpdates(_0x5ebaa2){return function(_0x5554db){try{jsonpatch[_0xca44('0x23')](_0x5554db,_0x5ebaa2,!![]);}catch(_0x2cbd0f){return BPromise[_0xca44('0x24')](_0x2cbd0f);}return _0x5554db[_0xca44('0x25')]();};}function saveUpdates(_0x382780,_0x1f098c){return function(_0x486b1b){if(_0x486b1b){return _0x486b1b[_0xca44('0x26')](_0x382780)[_0xca44('0x27')](function(_0x2ff999){return _0x2ff999;});}return null;};}function removeEntity(_0x19bc19,_0x5410f1){return function(_0x59af0c){if(_0x59af0c){return _0x59af0c[_0xca44('0x28')]()['then'](function(){var _0x22c646=_0x59af0c['get']({'plain':!![]});var _0x8a52b2=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xca44('0x29'),'value':_0xca44('0x2a'),'ignore':![]},{'name':_0xca44('0x2b'),'value':_0xca44('0x2c'),'ignore':![]}];var _0x12ec89=_(_0x8a52b2)[_0xca44('0x2d')]('ignore')[_0xca44('0x2e')](_0xca44('0x2f'))[_0xca44('0x2f')]();if(_[_0xca44('0x30')](_0x12ec89,_0x22c646[_0xca44('0x31')])){return;}var _0x47c36e=_[_0xca44('0x32')](_0x8a52b2,[_0xca44('0x2f'),_0x22c646[_0xca44('0x31')]])[_0xca44('0x33')];return db[_0xca44('0x34')][_0xca44('0x28')]({'where':{'type':_0x47c36e,'resourceId':_0x22c646['id']}})['then'](function(){return _0x59af0c;});})[_0xca44('0x27')](function(){_0x19bc19[_0xca44('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3335d9,_0x16dd30){return function(_0x40e62d){if(!_0x40e62d){_0x3335d9['sendStatus'](0x194);}return _0x40e62d;};}function handleError(_0x236667,_0x10297d){_0x10297d=_0x10297d||0x1f4;return function(_0x222e20){logger[_0xca44('0x35')](_0x222e20[_0xca44('0x36')]);if(_0x222e20[_0xca44('0x33')]){delete _0x222e20['name'];}_0x236667[_0xca44('0x1c')](_0x10297d)[_0xca44('0x37')](_0x222e20);};}exports[_0xca44('0x38')]=function(_0x674768,_0x5a4359){var _0x88a900={},_0x2c21b9={},_0xf468a4={'count':0x0,'rows':[]};var _0x2282c0=db[_0xca44('0x39')]['rawAttributes'];_0x2c21b9[_0xca44('0x3a')]=_['keys'](_0x2282c0);_0x2c21b9[_0xca44('0x3b')]=_[_0xca44('0x3c')](_0x674768[_0xca44('0x3b')]);_0x2c21b9[_0xca44('0x3d')]=_[_0xca44('0x3e')](_0x2c21b9[_0xca44('0x3a')],_0x2c21b9['query']);_0x88a900['attributes']=_[_0xca44('0x3e')](_0x2c21b9[_0xca44('0x3a')],qs[_0xca44('0x3f')](_0x674768[_0xca44('0x3b')]['fields']));_0x88a900[_0xca44('0x40')]=_0x88a900[_0xca44('0x40')][_0xca44('0x41')]?_0x88a900[_0xca44('0x40')]:_0x2c21b9[_0xca44('0x3a')];if(!_0x674768[_0xca44('0x3b')][_0xca44('0x42')](_0xca44('0x43'))){_0x88a900[_0xca44('0x20')]=qs[_0xca44('0x20')](_0x674768[_0xca44('0x3b')]['limit']);_0x88a900['offset']=qs[_0xca44('0x1f')](_0x674768[_0xca44('0x3b')][_0xca44('0x1f')]);}_0x88a900[_0xca44('0x44')]=qs[_0xca44('0x45')](_0x674768['query']['sort']);_0x88a900['where']=qs[_0xca44('0x3d')](_[_0xca44('0x46')](_0x674768[_0xca44('0x3b')],_0x2c21b9[_0xca44('0x3d')]));if(_0x674768['query'][_0xca44('0x2d')]){_0x88a900[_0xca44('0x47')]=_[_0xca44('0x48')](_0x88a900[_0xca44('0x47')],{'$or':_[_0xca44('0x2e')](_0x2282c0,function(_0x48ffd4){if(_0x48ffd4[_0xca44('0x31')][_0xca44('0x49')]!==_0xca44('0x4a')){var _0x4dca6e={};_0x4dca6e[_0x48ffd4[_0xca44('0x4b')]]={'$like':'%'+_0x674768[_0xca44('0x3b')][_0xca44('0x2d')]+'%'};return _0x4dca6e;}})});}_0x88a900=_['merge']({},_0x88a900,_0x674768[_0xca44('0x4c')]);var _0x2a3777={'where':_0x88a900[_0xca44('0x47')]};return db['VoiceExtension'][_0xca44('0x1e')](_0x2a3777)[_0xca44('0x27')](function(_0x2590ee){_0xf468a4[_0xca44('0x1e')]=_0x2590ee;if(_0x674768['query']['includeAll']){_0x88a900[_0xca44('0x4d')]=[{'all':!![]}];}return db[_0xca44('0x39')][_0xca44('0x4e')](_0x88a900);})['then'](function(_0x3cfa30){_0xf468a4[_0xca44('0x4f')]=_0x3cfa30;return _0xf468a4;})[_0xca44('0x27')](respondWithFilteredResult(_0x5a4359,_0x88a900))[_0xca44('0x50')](handleError(_0x5a4359,null));};exports[_0xca44('0x51')]=function(_0x31e58e,_0x22338f){var _0x4f13c8={'raw':![],'where':{'id':_0x31e58e[_0xca44('0x52')]['id']}},_0x3d1dc4={};_0x3d1dc4[_0xca44('0x3a')]=_['keys'](db[_0xca44('0x39')][_0xca44('0x53')]);_0x3d1dc4[_0xca44('0x3b')]=_['keys'](_0x31e58e[_0xca44('0x3b')]);_0x3d1dc4['filters']=_[_0xca44('0x3e')](_0x3d1dc4['model'],_0x3d1dc4['query']);_0x4f13c8[_0xca44('0x40')]=_[_0xca44('0x3e')](_0x3d1dc4[_0xca44('0x3a')],qs[_0xca44('0x3f')](_0x31e58e[_0xca44('0x3b')][_0xca44('0x3f')]));_0x4f13c8[_0xca44('0x40')]=_0x4f13c8['attributes'][_0xca44('0x41')]?_0x4f13c8[_0xca44('0x40')]:_0x3d1dc4['model'];if(_0x31e58e[_0xca44('0x3b')][_0xca44('0x54')]){_0x4f13c8[_0xca44('0x4d')]=[{'all':!![]}];}_0x4f13c8=_[_0xca44('0x48')]({},_0x4f13c8,_0x31e58e[_0xca44('0x4c')]);return db[_0xca44('0x39')][_0xca44('0x32')](_0x4f13c8)[_0xca44('0x27')](handleEntityNotFound(_0x22338f,null))[_0xca44('0x27')](respondWithResult(_0x22338f,null))[_0xca44('0x50')](handleError(_0x22338f,null));};exports['destroy']=function(_0x584df2,_0x2fbd52){return db['VoiceExtension'][_0xca44('0x32')]({'where':{'id':_0x584df2[_0xca44('0x52')]['id']}})[_0xca44('0x27')](handleEntityNotFound(_0x2fbd52,null))[_0xca44('0x27')](removeEntity(_0x2fbd52,null))[_0xca44('0x50')](handleError(_0x2fbd52,null));};exports['create']=function(_0xf8c4a3,_0x599433){if(_0xf8c4a3['body'][_0xca44('0x31')]===_0xca44('0x2a')&&!_[_0xca44('0x55')](_0xf8c4a3[_0xca44('0x56')][_0xca44('0x57')],'_')){_0xf8c4a3[_0xca44('0x56')]['exten']='_'[_0xca44('0x58')](_0xf8c4a3[_0xca44('0x56')][_0xca44('0x57')]);}return db[_0xca44('0x39')]['create'](_0xf8c4a3['body'],{'raw':![]})[_0xca44('0x27')](function(_0x2269ef){var _0x1bf518=_0xf8c4a3[_0xca44('0x59')][_0xca44('0x5a')]({'plain':!![]});if(!_0x1bf518)throw new Error(_0xca44('0x5b'));if(_0x1bf518['role']===_0xca44('0x59')){var _0x5e7fa9=_0x2269ef[_0xca44('0x5a')]({'plain':!![]});var _0x34a569=[{'name':_0xca44('0x5c'),'value':_0xca44('0x5d')},{'name':_0xca44('0x29'),'value':_0xca44('0x2a')},{'name':'InternalRoutes','value':'internal'}];var _0xf496fd=_[_0xca44('0x32')](_0x34a569,[_0xca44('0x2f'),_0x5e7fa9[_0xca44('0x31')]])[_0xca44('0x33')];return db[_0xca44('0x5e')][_0xca44('0x32')]({'where':{'name':_0xf496fd,'userProfileId':_0x1bf518[_0xca44('0x5f')]},'raw':!![]})[_0xca44('0x27')](function(_0x38d5df){if(_0x38d5df&&_0x38d5df['autoAssociation']===0x0){return db[_0xca44('0x34')][_0xca44('0x60')]({'name':_0x5e7fa9[_0xca44('0x33')],'resourceId':_0x5e7fa9['id'],'type':_0x38d5df[_0xca44('0x33')],'sectionId':_0x38d5df['id']},{})[_0xca44('0x27')](function(){return _0x2269ef;});}else{return _0x2269ef;}})['catch'](function(_0x1dc930){logger['error'](_0xca44('0x61'),_0x1dc930);throw _0x1dc930;});}return _0x2269ef;})[_0xca44('0x27')](respondWithResult(_0x599433,0xc9))[_0xca44('0x50')](handleError(_0x599433,null));};exports[_0xca44('0x26')]=function(_0x583916,_0xfb6520){if(_0x583916[_0xca44('0x56')]['id']){delete _0x583916[_0xca44('0x56')]['id'];}return db[_0xca44('0x39')][_0xca44('0x32')]({'where':{'id':_0x583916[_0xca44('0x52')]['id']}})['then'](handleEntityNotFound(_0xfb6520,null))['then'](function(_0xe9e19b){if(_0xe9e19b){return db[_0xca44('0x39')][_0xca44('0x26')](_[_0xca44('0x46')](_0x583916[_0xca44('0x56')],[_0xca44('0x57'),_0xca44('0x62'),_0xca44('0x63'),'recordingFormat','cutdigits','mandatoryDisposition']),{'where':{'context':_0xe9e19b['context'],'exten':_0xe9e19b['exten']},'individualHooks':!![]})[_0xca44('0x27')](function(_0x31f870){return _0x31f870;});}return null;})[_0xca44('0x27')](respondWithStatusCode(_0xfb6520,null))[_0xca44('0x50')](handleError(_0xfb6520,null));};exports['addApplications']=function(_0xc920c5,_0x3bcabe,_0x4e2889){return db[_0xca44('0x39')][_0xca44('0x64')]({'where':{'id':_0xc920c5[_0xca44('0x52')]['id']}})[_0xca44('0x27')](handleEntityNotFound(_0x3bcabe,null))[_0xca44('0x27')](function(_0x18571d){if(_0x18571d){return db[_0xca44('0x65')][_0xca44('0x66')](function(_0x26d4df){return db[_0xca44('0x39')][_0xca44('0x28')]({'where':{'VoiceExtensionId':_0xc920c5[_0xca44('0x52')]['id']},'transaction':_0x26d4df})[_0xca44('0x27')](function(_0x1e7d9c){var _0x3227f8=_['map'](_0xc920c5[_0xca44('0x56')],function(_0xc7f22f){_0xc7f22f[_0xca44('0x67')]=_0xc920c5['params']['id'];return _0xc7f22f;});return db[_0xca44('0x39')][_0xca44('0x68')](_0x3227f8,{'transaction':_0x26d4df});});})[_0xca44('0x27')](function(){return db[_0xca44('0x39')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xc920c5[_0xca44('0x52')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xca44('0x27')](respondWithResult(_0x3bcabe,null))[_0xca44('0x50')](handleError(_0x3bcabe,null));}; \ No newline at end of file +var _0xce55=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','transaction','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','count','offset','set','json','apply','update','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','filter','value','includes','type','find','end','sendStatus','stack','name','send','index','VoiceExtension','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','catch','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x33d270,_0x212bcf){var _0xee3770=function(_0xe22c32){while(--_0xe22c32){_0x33d270['push'](_0x33d270['shift']());}};_0xee3770(++_0x212bcf);}(_0xce55,0xcb));var _0x5ce5=function(_0x21e68a,_0x374179){_0x21e68a=_0x21e68a-0x0;var _0x1389e0=_0xce55[_0x21e68a];return _0x1389e0;};'use strict';var pdf=require(_0x5ce5('0x0'));var emlformat=require(_0x5ce5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5ce5('0x2'));var jsonpatch=require(_0x5ce5('0x3'));var rp=require(_0x5ce5('0x4'));var moment=require(_0x5ce5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5ce5('0x6'));var util=require(_0x5ce5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5ce5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ce5('0x9'));var squel=require(_0x5ce5('0xa'));var crypto=require('crypto');var jsforce=require(_0x5ce5('0xb'));var deskjs=require(_0x5ce5('0xc'));var toCsv=require(_0x5ce5('0x8'));var querystring=require('querystring');var Papa=require(_0x5ce5('0xd'));var Redis=require('ioredis');var authService=require(_0x5ce5('0xe'));var qs=require(_0x5ce5('0xf'));var hardwareService=require(_0x5ce5('0x10'));var logger=require(_0x5ce5('0x11'))('api');var utils=require(_0x5ce5('0x12'));var config=require(_0x5ce5('0x13'));var db=require('../../mysqldb')['db'];config[_0x5ce5('0x14')]=_[_0x5ce5('0x15')](config[_0x5ce5('0x14')],{'host':_0x5ce5('0x16'),'port':0x18eb});var socket=require(_0x5ce5('0x17'))(new Redis(config[_0x5ce5('0x14')]));require('./voiceExtension.socket')[_0x5ce5('0x18')](socket);function respondWithStatusCode(_0x3a6e02,_0x23ad29){_0x23ad29=_0x23ad29||0xcc;return function(_0x1db19d){if(_0x1db19d){return _0x3a6e02['sendStatus'](_0x23ad29);}return _0x3a6e02['status'](_0x23ad29)['end']();};}function respondWithResult(_0x3f2655,_0x43751e){_0x43751e=_0x43751e||0xc8;return function(_0x14b052){if(_0x14b052){return _0x3f2655[_0x5ce5('0x19')](_0x43751e)['json'](_0x14b052);}};}function respondWithFilteredResult(_0x1a0e97,_0x27acd8){return function(_0x3db94d){if(_0x3db94d){var _0x13fabd=_0x3db94d[_0x5ce5('0x1a')],_0xb9571f=_0x27acd8[_0x5ce5('0x1b')],_0x583032=_0x27acd8[_0x5ce5('0x1b')]+_0x27acd8['limit'],_0x5ea8de;if(_0x583032>=_0x13fabd){_0x583032=_0x13fabd;_0x5ea8de=0xc8;}else{_0x5ea8de=0xce;}_0x1a0e97[_0x5ce5('0x19')](_0x5ea8de);return _0x1a0e97[_0x5ce5('0x1c')]('Content-Range',_0xb9571f+'-'+_0x583032+'/'+_0x13fabd)[_0x5ce5('0x1d')](_0x3db94d);}return null;};}function patchUpdates(_0xfea0f1){return function(_0xd81103){try{jsonpatch[_0x5ce5('0x1e')](_0xd81103,_0xfea0f1,!![]);}catch(_0x139bc8){return BPromise['reject'](_0x139bc8);}return _0xd81103['save']();};}function saveUpdates(_0xf72ecf,_0x38749a){return function(_0x190a9c){if(_0x190a9c){return _0x190a9c[_0x5ce5('0x1f')](_0xf72ecf)[_0x5ce5('0x20')](function(_0x2e6627){return _0x2e6627;});}return null;};}function removeEntity(_0x27abfd,_0x27d48e){return function(_0x2b6dcb){if(_0x2b6dcb){return _0x2b6dcb[_0x5ce5('0x21')]()[_0x5ce5('0x20')](function(){var _0x35b1da=_0x2b6dcb[_0x5ce5('0x22')]({'plain':!![]});var _0x3ceeb9=[{'name':_0x5ce5('0x23'),'value':'inbound','ignore':![]},{'name':_0x5ce5('0x24'),'value':_0x5ce5('0x25'),'ignore':![]},{'name':_0x5ce5('0x26'),'value':'internal','ignore':![]}];var _0x5bd3e0=_(_0x3ceeb9)[_0x5ce5('0x27')]('ignore')['map'](_0x5ce5('0x28'))[_0x5ce5('0x28')]();if(_[_0x5ce5('0x29')](_0x5bd3e0,_0x35b1da[_0x5ce5('0x2a')])){return;}var _0x28ac83=_[_0x5ce5('0x2b')](_0x3ceeb9,[_0x5ce5('0x28'),_0x35b1da[_0x5ce5('0x2a')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x28ac83,'resourceId':_0x35b1da['id']}})['then'](function(){return _0x2b6dcb;});})[_0x5ce5('0x20')](function(){_0x27abfd['status'](0xcc)[_0x5ce5('0x2c')]();});}};}function handleEntityNotFound(_0xb8f769,_0xaa072a){return function(_0x40d0ae){if(!_0x40d0ae){_0xb8f769[_0x5ce5('0x2d')](0x194);}return _0x40d0ae;};}function handleError(_0x15bcb7,_0x3eba75){_0x3eba75=_0x3eba75||0x1f4;return function(_0xa0df2f){logger['error'](_0xa0df2f[_0x5ce5('0x2e')]);if(_0xa0df2f[_0x5ce5('0x2f')]){delete _0xa0df2f[_0x5ce5('0x2f')];}_0x15bcb7['status'](_0x3eba75)[_0x5ce5('0x30')](_0xa0df2f);};}exports[_0x5ce5('0x31')]=function(_0x4e3db4,_0x3a28f6){var _0x1b4dab={},_0x4e6895={},_0x341e69={'count':0x0,'rows':[]};var _0x27c5a5=db[_0x5ce5('0x32')][_0x5ce5('0x33')];_0x4e6895['model']=_[_0x5ce5('0x34')](_0x27c5a5);_0x4e6895[_0x5ce5('0x35')]=_['keys'](_0x4e3db4[_0x5ce5('0x35')]);_0x4e6895[_0x5ce5('0x36')]=_[_0x5ce5('0x37')](_0x4e6895[_0x5ce5('0x38')],_0x4e6895['query']);_0x1b4dab[_0x5ce5('0x39')]=_[_0x5ce5('0x37')](_0x4e6895[_0x5ce5('0x38')],qs[_0x5ce5('0x3a')](_0x4e3db4['query']['fields']));_0x1b4dab['attributes']=_0x1b4dab[_0x5ce5('0x39')][_0x5ce5('0x3b')]?_0x1b4dab['attributes']:_0x4e6895['model'];if(!_0x4e3db4[_0x5ce5('0x35')][_0x5ce5('0x3c')]('nolimit')){_0x1b4dab[_0x5ce5('0x3d')]=qs[_0x5ce5('0x3d')](_0x4e3db4['query'][_0x5ce5('0x3d')]);_0x1b4dab['offset']=qs[_0x5ce5('0x1b')](_0x4e3db4[_0x5ce5('0x35')][_0x5ce5('0x1b')]);}_0x1b4dab['order']=qs[_0x5ce5('0x3e')](_0x4e3db4[_0x5ce5('0x35')][_0x5ce5('0x3e')]);_0x1b4dab[_0x5ce5('0x3f')]=qs['filters'](_[_0x5ce5('0x40')](_0x4e3db4[_0x5ce5('0x35')],_0x4e6895[_0x5ce5('0x36')]));if(_0x4e3db4[_0x5ce5('0x35')][_0x5ce5('0x27')]){_0x1b4dab[_0x5ce5('0x3f')]=_[_0x5ce5('0x41')](_0x1b4dab[_0x5ce5('0x3f')],{'$or':_[_0x5ce5('0x42')](_0x27c5a5,function(_0x38e81b){if(_0x38e81b['type']['key']!==_0x5ce5('0x43')){var _0x39715d={};_0x39715d[_0x38e81b['field']]={'$like':'%'+_0x4e3db4[_0x5ce5('0x35')]['filter']+'%'};return _0x39715d;}})});}_0x1b4dab=_[_0x5ce5('0x41')]({},_0x1b4dab,_0x4e3db4[_0x5ce5('0x44')]);var _0x134749={'where':_0x1b4dab['where']};return db['VoiceExtension']['count'](_0x134749)[_0x5ce5('0x20')](function(_0x3e620f){_0x341e69[_0x5ce5('0x1a')]=_0x3e620f;if(_0x4e3db4[_0x5ce5('0x35')][_0x5ce5('0x45')]){_0x1b4dab[_0x5ce5('0x46')]=[{'all':!![]}];}return db[_0x5ce5('0x32')]['findAll'](_0x1b4dab);})['then'](function(_0x1fdad1){_0x341e69['rows']=_0x1fdad1;return _0x341e69;})[_0x5ce5('0x20')](respondWithFilteredResult(_0x3a28f6,_0x1b4dab))[_0x5ce5('0x47')](handleError(_0x3a28f6,null));};exports['show']=function(_0x191b68,_0xb4a0ec){var _0x13469f={'raw':![],'where':{'id':_0x191b68[_0x5ce5('0x48')]['id']}},_0xc1aa1d={};_0xc1aa1d[_0x5ce5('0x38')]=_[_0x5ce5('0x34')](db[_0x5ce5('0x32')][_0x5ce5('0x33')]);_0xc1aa1d[_0x5ce5('0x35')]=_[_0x5ce5('0x34')](_0x191b68[_0x5ce5('0x35')]);_0xc1aa1d[_0x5ce5('0x36')]=_['intersection'](_0xc1aa1d['model'],_0xc1aa1d[_0x5ce5('0x35')]);_0x13469f[_0x5ce5('0x39')]=_[_0x5ce5('0x37')](_0xc1aa1d[_0x5ce5('0x38')],qs[_0x5ce5('0x3a')](_0x191b68[_0x5ce5('0x35')][_0x5ce5('0x3a')]));_0x13469f[_0x5ce5('0x39')]=_0x13469f[_0x5ce5('0x39')][_0x5ce5('0x3b')]?_0x13469f['attributes']:_0xc1aa1d[_0x5ce5('0x38')];if(_0x191b68[_0x5ce5('0x35')][_0x5ce5('0x45')]){_0x13469f['include']=[{'all':!![]}];}_0x13469f=_['merge']({},_0x13469f,_0x191b68['options']);return db[_0x5ce5('0x32')][_0x5ce5('0x2b')](_0x13469f)[_0x5ce5('0x20')](handleEntityNotFound(_0xb4a0ec,null))['then'](respondWithResult(_0xb4a0ec,null))[_0x5ce5('0x47')](handleError(_0xb4a0ec,null));};exports[_0x5ce5('0x21')]=function(_0x2a26f2,_0x5e2e8c){return db[_0x5ce5('0x32')]['find']({'where':{'id':_0x2a26f2['params']['id']}})[_0x5ce5('0x20')](handleEntityNotFound(_0x5e2e8c,null))['then'](removeEntity(_0x5e2e8c,null))[_0x5ce5('0x47')](handleError(_0x5e2e8c,null));};exports[_0x5ce5('0x49')]=function(_0x5bed1f,_0x12ba8f){if(_0x5bed1f[_0x5ce5('0x4a')]['type']===_0x5ce5('0x25')&&!_[_0x5ce5('0x4b')](_0x5bed1f[_0x5ce5('0x4a')][_0x5ce5('0x4c')],'_')){_0x5bed1f['body'][_0x5ce5('0x4c')]='_'[_0x5ce5('0x4d')](_0x5bed1f[_0x5ce5('0x4a')][_0x5ce5('0x4c')]);}return db[_0x5ce5('0x32')]['create'](_0x5bed1f[_0x5ce5('0x4a')],{'raw':![]})['then'](function(_0x571a03){var _0x2e0218=_0x5bed1f[_0x5ce5('0x4e')][_0x5ce5('0x22')]({'plain':!![]});if(!_0x2e0218)throw new Error(_0x5ce5('0x4f'));if(_0x2e0218['role']===_0x5ce5('0x4e')){var _0x335820=_0x571a03[_0x5ce5('0x22')]({'plain':!![]});var _0x9046d5=[{'name':'InboundRoutes','value':_0x5ce5('0x50')},{'name':_0x5ce5('0x24'),'value':'outbound'},{'name':_0x5ce5('0x26'),'value':'internal'}];var _0xb5505a=_[_0x5ce5('0x2b')](_0x9046d5,[_0x5ce5('0x28'),_0x335820[_0x5ce5('0x2a')]])['name'];return db[_0x5ce5('0x51')][_0x5ce5('0x2b')]({'where':{'name':_0xb5505a,'userProfileId':_0x2e0218[_0x5ce5('0x52')]},'raw':!![]})[_0x5ce5('0x20')](function(_0x50a321){if(_0x50a321&&_0x50a321[_0x5ce5('0x53')]===0x0){return db['UserProfileResource'][_0x5ce5('0x49')]({'name':_0x335820[_0x5ce5('0x2f')],'resourceId':_0x335820['id'],'type':_0x50a321['name'],'sectionId':_0x50a321['id']},{})[_0x5ce5('0x20')](function(){return _0x571a03;});}else{return _0x571a03;}})['catch'](function(_0x3a0f01){logger[_0x5ce5('0x54')](_0x5ce5('0x55'),_0x3a0f01);throw _0x3a0f01;});}return _0x571a03;})['then'](respondWithResult(_0x12ba8f,0xc9))[_0x5ce5('0x47')](handleError(_0x12ba8f,null));};exports[_0x5ce5('0x1f')]=function(_0x45fc73,_0x12669c){if(_0x45fc73[_0x5ce5('0x4a')]['id']){delete _0x45fc73[_0x5ce5('0x4a')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x45fc73[_0x5ce5('0x48')]['id']}})[_0x5ce5('0x20')](handleEntityNotFound(_0x12669c,null))[_0x5ce5('0x20')](function(_0x155972){if(_0x155972){return db[_0x5ce5('0x32')][_0x5ce5('0x1f')](_[_0x5ce5('0x40')](_0x45fc73[_0x5ce5('0x4a')],[_0x5ce5('0x4c'),'context',_0x5ce5('0x56'),_0x5ce5('0x57'),_0x5ce5('0x58'),_0x5ce5('0x59')]),{'where':{'context':_0x155972[_0x5ce5('0x5a')],'exten':_0x155972[_0x5ce5('0x4c')]},'individualHooks':!![]})[_0x5ce5('0x20')](function(_0x1d60e6){return _0x1d60e6;});}return null;})[_0x5ce5('0x20')](respondWithStatusCode(_0x12669c,null))[_0x5ce5('0x47')](handleError(_0x12669c,null));};exports[_0x5ce5('0x5b')]=function(_0x5803e1,_0x4e63bc,_0x351b1c){return db['VoiceExtension'][_0x5ce5('0x5c')]({'where':{'id':_0x5803e1[_0x5ce5('0x48')]['id']}})[_0x5ce5('0x20')](handleEntityNotFound(_0x4e63bc,null))[_0x5ce5('0x20')](function(_0x3cd3fd){if(_0x3cd3fd){return db['sequelize'][_0x5ce5('0x5d')](function(_0x5421da){return db[_0x5ce5('0x32')][_0x5ce5('0x21')]({'where':{'VoiceExtensionId':_0x5803e1[_0x5ce5('0x48')]['id']},'transaction':_0x5421da})[_0x5ce5('0x20')](function(_0xe86b43){var _0x52a902=_[_0x5ce5('0x42')](_0x5803e1['body'],function(_0x40cba7){_0x40cba7['VoiceExtensionId']=_0x5803e1[_0x5ce5('0x48')]['id'];return _0x40cba7;});return db[_0x5ce5('0x32')][_0x5ce5('0x5e')](_0x52a902,{'transaction':_0x5421da});});})[_0x5ce5('0x20')](function(){return db[_0x5ce5('0x32')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5803e1[_0x5ce5('0x48')]['id']},'order':_0x5ce5('0x5f')});});}})['then'](respondWithResult(_0x4e63bc,null))['catch'](handleError(_0x4e63bc,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d9e7be8..e90290f 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 _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','save','update'];(function(_0x7eb2c0,_0x5dd4d3){var _0x39cd69=function(_0x52aeaa){while(--_0x52aeaa){_0x7eb2c0['push'](_0x7eb2c0['shift']());}};_0x39cd69(++_0x5dd4d3);}(_0x54ef,0x112));var _0xf54e=function(_0x26f796,_0x51a825){_0x26f796=_0x26f796-0x0;var _0x54b335=_0x54ef[_0x26f796];return _0x54b335;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var VoiceExtension=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){VoiceExtensionEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);VoiceExtensionEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];VoiceExtension[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x34e8,0x12c));var _0x834e=function(_0xd04c6c,_0x532b8c){_0xd04c6c=_0xd04c6c-0x0;var _0x162667=_0x34e8[_0xd04c6c];return _0x162667;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoiceExtension=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoiceExtensionEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoiceExtensionEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index e55e085..ad4c845 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 _0xef24=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions'];(function(_0x4fca3a,_0x164caa){var _0x437132=function(_0x12c6e8){while(--_0x12c6e8){_0x4fca3a['push'](_0x4fca3a['shift']());}};_0x437132(++_0x164caa);}(_0xef24,0xf0));var _0x4ef2=function(_0x2fc98c,_0x15db6d){_0x2fc98c=_0x2fc98c-0x0;var _0x22877b=_0xef24[_0x2fc98c];return _0x22877b;};'use strict';var _=require(_0x4ef2('0x0'));var util=require(_0x4ef2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4ef2('0x2'));var BPromise=require(_0x4ef2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ef2('0x4'));var rimraf=require(_0x4ef2('0x5'));var config=require(_0x4ef2('0x6'));var attributes=require(_0x4ef2('0x7'));module[_0x4ef2('0x8')]=function(_0x211d42,_0x529152){return _0x211d42[_0x4ef2('0x9')](_0x4ef2('0xa'),attributes,{'tableName':_0x4ef2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x021f=['../../config/environment','./voiceExtension.attributes','define','voice_extensions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2063de,_0x55c839){var _0x2833a8=function(_0x208ddb){while(--_0x208ddb){_0x2063de['push'](_0x2063de['shift']());}};_0x2833a8(++_0x55c839);}(_0x021f,0x64));var _0xf021=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x021f[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xf021('0x0'));var util=require(_0xf021('0x1'));var logger=require(_0xf021('0x2'))(_0xf021('0x3'));var moment=require('moment');var BPromise=require(_0xf021('0x4'));var rp=require(_0xf021('0x5'));var fs=require('fs');var path=require(_0xf021('0x6'));var rimraf=require(_0xf021('0x7'));var config=require(_0xf021('0x8'));var attributes=require(_0xf021('0x9'));module['exports']=function(_0x325a9f,_0x2d700d){return _0x325a9f[_0xf021('0xa')]('VoiceExtension',attributes,{'tableName':_0xf021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 23ba658..1c7d69f 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 _0x153f=['VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x172851,_0x360328){var _0x339a22=function(_0x37e2f9){while(--_0x37e2f9){_0x172851['push'](_0x172851['shift']());}};_0x339a22(++_0x360328);}(_0x153f,0x15b));var _0xf153=function(_0x5767e3,_0x2eb66f){_0x5767e3=_0x5767e3-0x0;var _0x80737c=_0x153f[_0x5767e3];return _0x80737c;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});config[_0xf153('0xc')]=_['defaults'](config[_0xf153('0xc')],{'host':_0xf153('0xd'),'port':0x18eb});var socket=require(_0xf153('0xe'))(new Redis(config[_0xf153('0xc')]));require(_0xf153('0xf'))[_0xf153('0x10')](socket);function respondWithRpcPromise(_0x44845c,_0x15a18b,_0x4f84b){return new BPromise(function(_0xeaccb0,_0x5c8ae9){return client[_0xf153('0x11')](_0x44845c,_0x4f84b)[_0xf153('0x12')](function(_0x2bea70){logger['info'](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));logger[_0xf153('0x15')](_0xf153('0x16'),_0x15a18b,_0xf153('0x14'),JSON[_0xf153('0x17')](_0x2bea70));if(_0x2bea70[_0xf153('0x18')]){if(_0x2bea70[_0xf153('0x18')][_0xf153('0x19')]===0x1f4){logger['error'](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);return _0x5c8ae9(_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);}logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')]['message']);return _0xeaccb0(_0x2bea70[_0xf153('0x18')]['message']);}else{logger[_0xf153('0x1b')](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));_0xeaccb0(_0x2bea70[_0xf153('0x1c')]['message']);}})[_0xf153('0x1d')](function(_0x19122e){logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x19122e);_0x5c8ae9(_0x19122e);});});}exports[_0xf153('0x1e')]=function(_0x2f290f){var _0x37952f=this;return new Promise(function(_0x2db2c7,_0x3735a7){return db[_0xf153('0x1f')][_0xf153('0x20')]({'raw':_0x2f290f[_0xf153('0x21')]?_0x2f290f['options'][_0xf153('0x22')]===undefined?!![]:![]:!![],'where':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x23')]||null:null,'attributes':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x24')]||null:null,'limit':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x25')]||null:null,'include':_0x2f290f[_0xf153('0x21')]?_0x2f290f[_0xf153('0x21')][_0xf153('0x26')]?_[_0xf153('0x27')](_0x2f290f[_0xf153('0x21')][_0xf153('0x26')],function(_0x141ef4){return{'model':db[_0x141ef4[_0xf153('0x28')]],'as':_0x141ef4['as'],'attributes':_0x141ef4[_0xf153('0x24')],'include':_0x141ef4[_0xf153('0x26')]?_['map'](_0x141ef4[_0xf153('0x26')],function(_0x3f1c6f){return{'model':db[_0x3f1c6f['model']],'as':_0x3f1c6f['as'],'attributes':_0x3f1c6f[_0xf153('0x24')],'include':_0x3f1c6f[_0xf153('0x26')]?_['map'](_0x3f1c6f[_0xf153('0x26')],function(_0x10295e){return{'model':db[_0x10295e[_0xf153('0x28')]],'as':_0x10295e['as'],'attributes':_0x10295e[_0xf153('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf153('0x12')](function(_0x258976){logger[_0xf153('0x1b')](_0xf153('0x1e'),_0x2f290f);logger[_0xf153('0x15')](_0xf153('0x1e'),_0x2f290f,JSON[_0xf153('0x17')](_0x258976));_0x2db2c7(_0x258976);})[_0xf153('0x1d')](function(_0x5b5237){logger[_0xf153('0x18')](_0xf153('0x1e'),_0x5b5237[_0xf153('0x1a')],_0x2f290f);_0x3735a7(_0x37952f[_0xf153('0x18')](0x1f4,_0x5b5237['message']));});});}; \ No newline at end of file +var _0xa571=['include','map','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','raw','options','where','attributes','limit'];(function(_0x107398,_0x2d46c9){var _0x1a7912=function(_0x3d9eec){while(--_0x3d9eec){_0x107398['push'](_0x107398['shift']());}};_0x1a7912(++_0x2d46c9);}(_0xa571,0x107));var _0x1a57=function(_0x9ea06f,_0x521972){_0x9ea06f=_0x9ea06f-0x0;var _0x34b05f=_0xa571[_0x9ea06f];return _0x34b05f;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});config[_0x1a57('0xa')]=_[_0x1a57('0xb')](config[_0x1a57('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a57('0xc'))(new Redis(config[_0x1a57('0xa')]));require(_0x1a57('0xd'))['register'](socket);function respondWithRpcPromise(_0x3c8182,_0x1f7086,_0x4740ef){return new BPromise(function(_0x289dc0,_0x831937){return client[_0x1a57('0xe')](_0x3c8182,_0x4740ef)[_0x1a57('0xf')](function(_0x22c683){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x1f7086,_0x1a57('0x10'));logger[_0x1a57('0x11')](_0x1a57('0x12'),_0x1f7086,'request\x20sent',JSON[_0x1a57('0x13')](_0x22c683));if(_0x22c683[_0x1a57('0x14')]){if(_0x22c683['error'][_0x1a57('0x15')]===0x1f4){logger['error'](_0x1a57('0x16'),_0x1f7086,_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);return _0x831937(_0x22c683[_0x1a57('0x14')]['message']);}logger[_0x1a57('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x1f7086,_0x22c683['error'][_0x1a57('0x17')]);return _0x289dc0(_0x22c683[_0x1a57('0x14')][_0x1a57('0x17')]);}else{logger['info'](_0x1a57('0x16'),_0x1f7086,_0x1a57('0x10'));_0x289dc0(_0x22c683[_0x1a57('0x18')]['message']);}})[_0x1a57('0x19')](function(_0x4262c8){logger[_0x1a57('0x14')](_0x1a57('0x16'),_0x1f7086,_0x4262c8);_0x831937(_0x4262c8);});});}exports[_0x1a57('0x1a')]=function(_0x52bc9e){var _0x53df95=this;return new Promise(function(_0x439844,_0x21e811){return db[_0x1a57('0x1b')]['findAll']({'raw':_0x52bc9e['options']?_0x52bc9e['options'][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x52bc9e[_0x1a57('0x1d')]?_0x52bc9e[_0x1a57('0x1d')][_0x1a57('0x1e')]||null:null,'attributes':_0x52bc9e[_0x1a57('0x1d')]?_0x52bc9e[_0x1a57('0x1d')][_0x1a57('0x1f')]||null:null,'limit':_0x52bc9e[_0x1a57('0x1d')]?_0x52bc9e[_0x1a57('0x1d')][_0x1a57('0x20')]||null:null,'include':_0x52bc9e[_0x1a57('0x1d')]?_0x52bc9e[_0x1a57('0x1d')][_0x1a57('0x21')]?_[_0x1a57('0x22')](_0x52bc9e[_0x1a57('0x1d')][_0x1a57('0x21')],function(_0x25c1e9){return{'model':db[_0x25c1e9[_0x1a57('0x23')]],'as':_0x25c1e9['as'],'attributes':_0x25c1e9[_0x1a57('0x1f')],'include':_0x25c1e9[_0x1a57('0x21')]?_[_0x1a57('0x22')](_0x25c1e9[_0x1a57('0x21')],function(_0x5a53c8){return{'model':db[_0x5a53c8['model']],'as':_0x5a53c8['as'],'attributes':_0x5a53c8[_0x1a57('0x1f')],'include':_0x5a53c8[_0x1a57('0x21')]?_['map'](_0x5a53c8[_0x1a57('0x21')],function(_0x54f6a5){return{'model':db[_0x54f6a5[_0x1a57('0x23')]],'as':_0x54f6a5['as'],'attributes':_0x54f6a5[_0x1a57('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8179a4){logger[_0x1a57('0x24')](_0x1a57('0x1a'),_0x52bc9e);logger[_0x1a57('0x11')]('GetVoiceExtension',_0x52bc9e,JSON[_0x1a57('0x13')](_0x8179a4));_0x439844(_0x8179a4);})[_0x1a57('0x19')](function(_0x4374f0){logger[_0x1a57('0x14')]('GetVoiceExtension',_0x4374f0[_0x1a57('0x17')],_0x52bc9e);_0x21e811(_0x53df95[_0x1a57('0x14')](0x1f4,_0x4374f0[_0x1a57('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 5c0d236..18ad9ce 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 _0x1312=['save','remove','update','voiceExtension:'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x1312,0x148));var _0x2131=function(_0x53bf11,_0x3acb5e){_0x53bf11=_0x53bf11-0x0;var _0x3a4f47=_0x1312[_0x53bf11];return _0x3a4f47;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x2131('0x0'),_0x2131('0x1'),_0x2131('0x2')];function createListener(_0x53773,_0xa345de){return function(_0x53463a){_0xa345de['emit'](_0x53773,_0x53463a);};}function removeListener(_0xf0f6aa,_0x3857d9){return function(){VoiceExtensionEvents['removeListener'](_0xf0f6aa,_0x3857d9);};}exports['register']=function(_0xfcccc){for(var _0x3e3253=0x0,_0x2a01ae=events['length'];_0x3e3253<_0x2a01ae;_0x3e3253++){var _0x23ac53=events[_0x3e3253];var _0x283d54=createListener(_0x2131('0x3')+_0x23ac53,_0xfcccc);VoiceExtensionEvents['on'](_0x23ac53,_0x283d54);}}; \ No newline at end of file +var _0x54a5=['voiceExtension:','remove','update','removeListener','register','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x54a5,0xa3));var _0x554a=function(_0x424956,_0xd057a8){_0x424956=_0x424956-0x0;var _0x4ba412=_0x54a5[_0x424956];return _0x4ba412;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0x554a('0x0'),_0x554a('0x1')];function createListener(_0x5a1d23,_0xa90004){return function(_0x4b2326){_0xa90004['emit'](_0x5a1d23,_0x4b2326);};}function removeListener(_0x31353f,_0x52025f){return function(){VoiceExtensionEvents[_0x554a('0x2')](_0x31353f,_0x52025f);};}exports[_0x554a('0x3')]=function(_0x9f9742){for(var _0x250605=0x0,_0x282db7=events[_0x554a('0x4')];_0x250605<_0x282db7;_0x250605++){var _0x121282=events[_0x250605];var _0x46aa98=createListener(_0x554a('0x5')+_0x121282,_0x9f9742);VoiceExtensionEvents['on'](_0x121282,_0x46aa98);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 22236ad..a069afd 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 _0x765f=['exports','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','post','put','update','destroy'];(function(_0x1f270f,_0x1f91e9){var _0x3a8a32=function(_0x362edb){while(--_0x362edb){_0x1f270f['push'](_0x1f270f['shift']());}};_0x3a8a32(++_0x1f91e9);}(_0x765f,0x166));var _0xf765=function(_0x228515,_0x47238b){_0x228515=_0x228515-0x0;var _0x214199=_0x765f[_0x228515];return _0x214199;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf765('0x0'));var timeout=require(_0xf765('0x1'));var express=require('express');var router=express[_0xf765('0x2')]();var auth=require(_0xf765('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf765('0x4'));var controller=require(_0xf765('0x5'));router[_0xf765('0x6')]('/',auth[_0xf765('0x7')](),controller[_0xf765('0x8')]);router[_0xf765('0x6')](_0xf765('0x9'),auth[_0xf765('0x7')](),controller[_0xf765('0xa')]);router['get'](_0xf765('0xb'),auth[_0xf765('0x7')](),controller['getMessages']);router[_0xf765('0xc')]('/',auth[_0xf765('0x7')](),controller['create']);router[_0xf765('0xd')](_0xf765('0x9'),auth['isAuthenticated'](),controller[_0xf765('0xe')]);router['delete'](_0xf765('0x9'),auth[_0xf765('0x7')](),controller[_0xf765('0xf')]);module[_0xf765('0x10')]=router; \ No newline at end of file +var _0x0a42=['getMessages','post','create','put','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x4d77fa,_0x5ae771){var _0x1d7ffc=function(_0x24172e){while(--_0x24172e){_0x4d77fa['push'](_0x4d77fa['shift']());}};_0x1d7ffc(++_0x5ae771);}(_0x0a42,0xc6));var _0x20a4=function(_0x37a184,_0x437929){_0x37a184=_0x37a184-0x0;var _0x2add8f=_0x0a42[_0x37a184];return _0x2add8f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x20a4('0x0'));var timeout=require(_0x20a4('0x1'));var express=require(_0x20a4('0x2'));var router=express[_0x20a4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x20a4('0x4'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x20a4('0x5')]('/',auth[_0x20a4('0x6')](),controller[_0x20a4('0x7')]);router[_0x20a4('0x5')](_0x20a4('0x8'),auth[_0x20a4('0x6')](),controller[_0x20a4('0x9')]);router[_0x20a4('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x20a4('0xa')]);router[_0x20a4('0xb')]('/',auth[_0x20a4('0x6')](),controller[_0x20a4('0xc')]);router[_0x20a4('0xd')]('/:id',auth[_0x20a4('0x6')](),controller['update']);router[_0x20a4('0xe')]('/:id',auth[_0x20a4('0x6')](),controller['destroy']);module[_0x20a4('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 2eea391..e2166d7 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 _0x71d5=['VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x71d5,0xef));var _0x571d=function(_0x5a2de6,_0x160e3c){_0x5a2de6=_0x5a2de6-0x0;var _0x95affb=_0x71d5[_0x5a2de6];return _0x95affb;};'use strict';var Sequelize=require('sequelize');module[_0x571d('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x571d('0x1')],'defaultValue':'from-voicemail','unique':_0x571d('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x571d('0x2')},'password':{'type':Sequelize[_0x571d('0x1')]},'fullname':{'type':Sequelize[_0x571d('0x1')]},'email':{'type':Sequelize[_0x571d('0x1')],'validate':{'isEmail':!![]},'set':function(_0x13c551){this[_0x571d('0x3')](_0x571d('0x4'),typeof _0x13c551===_0x571d('0x5')&&_0x13c551[_0x571d('0x6')]()?_0x13c551[_0x571d('0x6')]():null);}},'pager':{'type':Sequelize[_0x571d('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x571d('0x7')},'attach':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':_0x571d('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x571d('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x571d('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x571d('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x571d('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x571d('0x8')]('yes','no'),'defaultValue':_0x571d('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x571d('0x8')](_0x571d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x571d('0x9'),'no'),'defaultValue':_0x571d('0x9'),'allowNull':![]},'stamp':{'type':_0x571d('0xb')},'emailsubject':{'type':Sequelize[_0x571d('0x1')]},'emailbody':{'type':Sequelize[_0x571d('0x1')]},'maxsecs':{'type':Sequelize[_0x571d('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x571d('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x571d('0xd')],'get':function(){return this['getDataValue'](_0x571d('0xe'))+_0x571d('0xf')+this[_0x571d('0x10')](_0x571d('0x11'));}}}; \ No newline at end of file +var _0xe620=['INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP'];(function(_0x1a0c6c,_0x6a85b3){var _0x2c3172=function(_0x387824){while(--_0x387824){_0x1a0c6c['push'](_0x1a0c6c['shift']());}};_0x2c3172(++_0x6a85b3);}(_0xe620,0xa4));var _0x0e62=function(_0x1b4bdc,_0x11f92c){_0x1b4bdc=_0x1b4bdc-0x0;var _0x246255=_0xe620[_0x1b4bdc];return _0x246255;};'use strict';var Sequelize=require(_0x0e62('0x0'));module[_0x0e62('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0e62('0x2')],'defaultValue':'from-voicemail','unique':_0x0e62('0x3')},'mailbox':{'type':Sequelize[_0x0e62('0x2')],'defaultValue':'','allowNull':![],'unique':_0x0e62('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x0e62('0x2')]},'email':{'type':Sequelize[_0x0e62('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2f48b6){this[_0x0e62('0x4')](_0x0e62('0x5'),typeof _0x2f48b6===_0x0e62('0x6')&&_0x2f48b6[_0x0e62('0x7')]()?_0x2f48b6[_0x0e62('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x0e62('0x2')],'defaultValue':_0x0e62('0x8')},'attach':{'type':Sequelize[_0x0e62('0x9')](_0x0e62('0xa'),'no'),'defaultValue':_0x0e62('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0e62('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x0e62('0x2')]},'review':{'type':Sequelize[_0x0e62('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0e62('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x0e62('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0e62('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0e62('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0e62('0x9')](_0x0e62('0xa'),'no'),'defaultValue':_0x0e62('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0e62('0x9')](_0x0e62('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0e62('0x9')](_0x0e62('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0e62('0x9')](_0x0e62('0xa'),'no'),'defaultValue':_0x0e62('0xa'),'allowNull':![]},'stamp':{'type':_0x0e62('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0e62('0x2')]},'maxsecs':{'type':Sequelize[_0x0e62('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0e62('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0e62('0xd')](_0x0e62('0xe'))+_0x0e62('0xf')+this[_0x0e62('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index fb698b8..6323bc6 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 _0x2b5e=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','map','type','VIRTUAL','field','options','VoiceMail','count'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x2b5e,0x128));var _0xe2b5=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x2b5e[_0x2fd69d];return _0x5d5ef3;};'use strict';var pdf=require(_0xe2b5('0x0'));var emlformat=require(_0xe2b5('0x1'));var rimraf=require(_0xe2b5('0x2'));var zipdir=require(_0xe2b5('0x3'));var jsonpatch=require(_0xe2b5('0x4'));var rp=require(_0xe2b5('0x5'));var moment=require(_0xe2b5('0x6'));var BPromise=require(_0xe2b5('0x7'));var Mustache=require(_0xe2b5('0x8'));var util=require(_0xe2b5('0x9'));var path=require('path');var sox=require(_0xe2b5('0xa'));var csv=require(_0xe2b5('0xb'));var ejs=require(_0xe2b5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe2b5('0xd'));var crypto=require('crypto');var jsforce=require(_0xe2b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe2b5('0xf'));var Papa=require('papaparse');var Redis=require(_0xe2b5('0x10'));var authService=require(_0xe2b5('0x11'));var qs=require(_0xe2b5('0x12'));var hardwareService=require(_0xe2b5('0x13'));var logger=require(_0xe2b5('0x14'))(_0xe2b5('0x15'));var utils=require(_0xe2b5('0x16'));var config=require(_0xe2b5('0x17'));var db=require(_0xe2b5('0x18'))['db'];function respondWithStatusCode(_0x50dd12,_0x5b7c45){_0x5b7c45=_0x5b7c45||0xcc;return function(_0x49d594){if(_0x49d594){return _0x50dd12[_0xe2b5('0x19')](_0x5b7c45);}return _0x50dd12[_0xe2b5('0x1a')](_0x5b7c45)[_0xe2b5('0x1b')]();};}function respondWithResult(_0xe5396b,_0x576618){_0x576618=_0x576618||0xc8;return function(_0x2e4716){if(_0x2e4716){return _0xe5396b['status'](_0x576618)[_0xe2b5('0x1c')](_0x2e4716);}};}function respondWithFilteredResult(_0x23bc7c,_0xa65405){return function(_0x4bb124){if(_0x4bb124){var _0x12898e=_0x4bb124['count'],_0x6d7f2a=_0xa65405['offset'],_0x5ba785=_0xa65405[_0xe2b5('0x1d')]+_0xa65405['limit'],_0xc64ef5;if(_0x5ba785>=_0x12898e){_0x5ba785=_0x12898e;_0xc64ef5=0xc8;}else{_0xc64ef5=0xce;}_0x23bc7c[_0xe2b5('0x1a')](_0xc64ef5);return _0x23bc7c[_0xe2b5('0x1e')](_0xe2b5('0x1f'),_0x6d7f2a+'-'+_0x5ba785+'/'+_0x12898e)['json'](_0x4bb124);}return null;};}function patchUpdates(_0x4656c1){return function(_0x3af1da){try{jsonpatch[_0xe2b5('0x20')](_0x3af1da,_0x4656c1,!![]);}catch(_0x444a22){return BPromise[_0xe2b5('0x21')](_0x444a22);}return _0x3af1da[_0xe2b5('0x22')]();};}function saveUpdates(_0x2fd3b4,_0x4c2661){return function(_0x3e8208){if(_0x3e8208){return _0x3e8208[_0xe2b5('0x23')](_0x2fd3b4)[_0xe2b5('0x24')](function(_0x168eab){return _0x168eab;});}return null;};}function removeEntity(_0x341edb,_0x4a2b32){return function(_0x308aa0){if(_0x308aa0){return _0x308aa0[_0xe2b5('0x25')]()[_0xe2b5('0x24')](function(){var _0x39e0e5=_0x308aa0[_0xe2b5('0x26')]({'plain':!![]});var _0x535f6d='Voicemails';return db[_0xe2b5('0x27')][_0xe2b5('0x25')]({'where':{'type':_0x535f6d,'resourceId':_0x39e0e5['id']}})[_0xe2b5('0x24')](function(){return _0x308aa0;});})['then'](function(){_0x341edb[_0xe2b5('0x1a')](0xcc)[_0xe2b5('0x1b')]();});}};}function handleEntityNotFound(_0x458d1f,_0x594a28){return function(_0x67b00){if(!_0x67b00){_0x458d1f[_0xe2b5('0x19')](0x194);}return _0x67b00;};}function handleError(_0x200208,_0x4ab411){_0x4ab411=_0x4ab411||0x1f4;return function(_0x4779e7){logger[_0xe2b5('0x28')](_0x4779e7[_0xe2b5('0x29')]);if(_0x4779e7[_0xe2b5('0x2a')]){delete _0x4779e7[_0xe2b5('0x2a')];}_0x200208[_0xe2b5('0x1a')](_0x4ab411)[_0xe2b5('0x2b')](_0x4779e7);};}exports[_0xe2b5('0x2c')]=function(_0xde482b,_0x4f9e6e){var _0x1caf28={},_0x19f34e={},_0x31cde9={'count':0x0,'rows':[]};var _0x463acd=db['VoiceMail']['rawAttributes'];_0x19f34e[_0xe2b5('0x2d')]=_[_0xe2b5('0x2e')](_0x463acd);_0x19f34e[_0xe2b5('0x2f')]=_[_0xe2b5('0x2e')](_0xde482b[_0xe2b5('0x2f')]);_0x19f34e['filters']=_[_0xe2b5('0x30')](_0x19f34e[_0xe2b5('0x2d')],_0x19f34e[_0xe2b5('0x2f')]);_0x1caf28['attributes']=_[_0xe2b5('0x30')](_0x19f34e[_0xe2b5('0x2d')],qs[_0xe2b5('0x31')](_0xde482b[_0xe2b5('0x2f')]['fields']));_0x1caf28[_0xe2b5('0x32')]=_0x1caf28[_0xe2b5('0x32')][_0xe2b5('0x33')]?_0x1caf28[_0xe2b5('0x32')]:_0x19f34e['model'];if(!_0xde482b['query'][_0xe2b5('0x34')](_0xe2b5('0x35'))){_0x1caf28['limit']=qs['limit'](_0xde482b[_0xe2b5('0x2f')][_0xe2b5('0x36')]);_0x1caf28[_0xe2b5('0x1d')]=qs[_0xe2b5('0x1d')](_0xde482b[_0xe2b5('0x2f')][_0xe2b5('0x1d')]);}_0x1caf28[_0xe2b5('0x37')]=qs[_0xe2b5('0x38')](_0xde482b['query'][_0xe2b5('0x38')]);_0x1caf28['where']=qs[_0xe2b5('0x39')](_['pick'](_0xde482b[_0xe2b5('0x2f')],_0x19f34e['filters']));if(_0xde482b[_0xe2b5('0x2f')][_0xe2b5('0x3a')]){_0x1caf28[_0xe2b5('0x3b')]=_[_0xe2b5('0x3c')](_0x1caf28[_0xe2b5('0x3b')],{'$or':_[_0xe2b5('0x3d')](_0x463acd,function(_0x22a1de){if(_0x22a1de[_0xe2b5('0x3e')]['key']!==_0xe2b5('0x3f')){var _0x362820={};_0x362820[_0x22a1de[_0xe2b5('0x40')]]={'$like':'%'+_0xde482b[_0xe2b5('0x2f')]['filter']+'%'};return _0x362820;}})});}_0x1caf28=_['merge']({},_0x1caf28,_0xde482b[_0xe2b5('0x41')]);var _0x1c4331={'where':_0x1caf28[_0xe2b5('0x3b')]};return db[_0xe2b5('0x42')][_0xe2b5('0x43')](_0x1c4331)[_0xe2b5('0x24')](function(_0x57e5a9){_0x31cde9[_0xe2b5('0x43')]=_0x57e5a9;if(_0xde482b['query'][_0xe2b5('0x44')]){_0x1caf28[_0xe2b5('0x45')]=[{'all':!![]}];}return db[_0xe2b5('0x42')][_0xe2b5('0x46')](_0x1caf28);})[_0xe2b5('0x24')](function(_0x2f4e38){_0x31cde9[_0xe2b5('0x47')]=_0x2f4e38;return _0x31cde9;})['then'](respondWithFilteredResult(_0x4f9e6e,_0x1caf28))[_0xe2b5('0x48')](handleError(_0x4f9e6e,null));};exports[_0xe2b5('0x49')]=function(_0x36ce01,_0x58c275){var _0xb7b5c3={'raw':!![],'where':{'id':_0x36ce01[_0xe2b5('0x4a')]['id']}},_0x123b1e={};_0x123b1e[_0xe2b5('0x2d')]=_[_0xe2b5('0x2e')](db[_0xe2b5('0x42')][_0xe2b5('0x4b')]);_0x123b1e['query']=_[_0xe2b5('0x2e')](_0x36ce01['query']);_0x123b1e[_0xe2b5('0x39')]=_['intersection'](_0x123b1e[_0xe2b5('0x2d')],_0x123b1e['query']);_0xb7b5c3[_0xe2b5('0x32')]=_['intersection'](_0x123b1e[_0xe2b5('0x2d')],qs['fields'](_0x36ce01[_0xe2b5('0x2f')]['fields']));_0xb7b5c3[_0xe2b5('0x32')]=_0xb7b5c3[_0xe2b5('0x32')]['length']?_0xb7b5c3[_0xe2b5('0x32')]:_0x123b1e['model'];if(_0x36ce01[_0xe2b5('0x2f')]['includeAll']){_0xb7b5c3[_0xe2b5('0x45')]=[{'all':!![]}];}_0xb7b5c3=_[_0xe2b5('0x3c')]({},_0xb7b5c3,_0x36ce01[_0xe2b5('0x41')]);return db[_0xe2b5('0x42')][_0xe2b5('0x4c')](_0xb7b5c3)[_0xe2b5('0x24')](handleEntityNotFound(_0x58c275,null))[_0xe2b5('0x24')](respondWithResult(_0x58c275,null))[_0xe2b5('0x48')](handleError(_0x58c275,null));};exports[_0xe2b5('0x4d')]=function(_0x53cc3a,_0x28e5d3){return db[_0xe2b5('0x42')][_0xe2b5('0x4d')](_0x53cc3a[_0xe2b5('0x4e')],{})[_0xe2b5('0x24')](function(_0x4cdd99){var _0x1bb530=_0x53cc3a[_0xe2b5('0x4f')][_0xe2b5('0x26')]({'plain':!![]});if(!_0x1bb530)throw new Error(_0xe2b5('0x50'));if(_0x1bb530[_0xe2b5('0x51')]===_0xe2b5('0x4f')){var _0x279b10=_0x4cdd99['get']({'plain':!![]});var _0x1c9acf='Voicemails';return db[_0xe2b5('0x52')][_0xe2b5('0x4c')]({'where':{'name':_0x1c9acf,'userProfileId':_0x1bb530[_0xe2b5('0x53')]},'raw':!![]})[_0xe2b5('0x24')](function(_0x1b3c58){if(_0x1b3c58&&_0x1b3c58['autoAssociation']===0x0){return db[_0xe2b5('0x27')]['create']({'name':_0x279b10[_0xe2b5('0x2a')],'resourceId':_0x279b10['id'],'type':_0x1b3c58[_0xe2b5('0x2a')],'sectionId':_0x1b3c58['id']},{})['then'](function(){return _0x4cdd99;});}else{return _0x4cdd99;}})[_0xe2b5('0x48')](function(_0x3c15f0){logger[_0xe2b5('0x28')](_0xe2b5('0x54'),_0x3c15f0);throw _0x3c15f0;});}return _0x4cdd99;})[_0xe2b5('0x24')](respondWithResult(_0x28e5d3,0xc9))['catch'](handleError(_0x28e5d3,null));};exports['update']=function(_0x1a4c67,_0x317458){if(_0x1a4c67['body']['id']){delete _0x1a4c67[_0xe2b5('0x4e')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x1a4c67[_0xe2b5('0x4a')]['id']}})[_0xe2b5('0x24')](handleEntityNotFound(_0x317458,null))[_0xe2b5('0x24')](saveUpdates(_0x1a4c67[_0xe2b5('0x4e')],null))[_0xe2b5('0x24')](respondWithResult(_0x317458,null))['catch'](handleError(_0x317458,null));};exports[_0xe2b5('0x25')]=function(_0x14264f,_0x383160){return db[_0xe2b5('0x42')][_0xe2b5('0x4c')]({'where':{'id':_0x14264f[_0xe2b5('0x4a')]['id']}})[_0xe2b5('0x24')](handleEntityNotFound(_0x383160,null))[_0xe2b5('0x24')](removeEntity(_0x383160,null))[_0xe2b5('0x48')](handleError(_0x383160,null));};exports[_0xe2b5('0x55')]=function(_0x15340b,_0x324cce,_0x57c3f3){return db['VoiceMail'][_0xe2b5('0x56')]({'where':{'id':_0x15340b['params']['id']}})['then'](handleEntityNotFound(_0x324cce,null))[_0xe2b5('0x24')](function(_0x21ae94){var _0x5e6b47;var _0x1bc912={},_0x871e3a={};_0x871e3a['model']=_['keys'](db[_0xe2b5('0x57')]['rawAttributes']);_0x871e3a[_0xe2b5('0x2f')]=_[_0xe2b5('0x2e')](_0x15340b[_0xe2b5('0x2f')]);_0x871e3a[_0xe2b5('0x39')]=_[_0xe2b5('0x30')](_0x871e3a['model'],_0x871e3a[_0xe2b5('0x2f')]);_0x1bc912[_0xe2b5('0x32')]=_[_0xe2b5('0x30')](_0x871e3a[_0xe2b5('0x2d')],qs[_0xe2b5('0x31')](_0x15340b[_0xe2b5('0x2f')]['fields']));_0x1bc912[_0xe2b5('0x32')]=_0x1bc912[_0xe2b5('0x32')][_0xe2b5('0x33')]?_0x1bc912['attributes']:_0x871e3a[_0xe2b5('0x2d')];if(!_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x34')](_0xe2b5('0x35'))){_0x1bc912['limit']=qs[_0xe2b5('0x36')](_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x36')]);_0x1bc912[_0xe2b5('0x1d')]=qs['offset'](_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x1d')]);}_0x1bc912[_0xe2b5('0x37')]=qs[_0xe2b5('0x38')](_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x38')]);_0x1bc912['where']=qs[_0xe2b5('0x39')](_[_0xe2b5('0x58')](_0x15340b['query'],_0x871e3a[_0xe2b5('0x39')]));if(_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x3a')]){_0x1bc912[_0xe2b5('0x3b')]=_['merge'](_0x1bc912[_0xe2b5('0x3b')],{'$or':_['map'](_0x1bc912[_0xe2b5('0x32')],function(_0x48aab4){var _0x1c1f43={};_0x1c1f43[_0x48aab4]={'$like':'%'+_0x15340b[_0xe2b5('0x2f')][_0xe2b5('0x3a')]+'%'};return _0x1c1f43;})});}_0x1bc912[_0xe2b5('0x3b')]=_[_0xe2b5('0x3c')](_0x1bc912[_0xe2b5('0x3b')],{'mailboxuser':_0x21ae94[_0xe2b5('0x59')]});_0x1bc912=_[_0xe2b5('0x3c')]({},_0x1bc912,_0x15340b['options']);return db[_0xe2b5('0x57')][_0xe2b5('0x5a')](_0x1bc912)['then'](respondWithFilteredResult(_0x324cce,_0x1bc912));})['catch'](handleError(_0x324cce,null));}; \ No newline at end of file +var _0x4bc3=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','map','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','destroy','Voicemails','UserProfileResource','then','end','error','stack','send','index','VoiceMail','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','key','VIRTUAL','field','filter','merge','includeAll','include','rows','show','options','find','catch'];(function(_0x56b2f5,_0x14743c){var _0x5532b8=function(_0x332ce4){while(--_0x332ce4){_0x56b2f5['push'](_0x56b2f5['shift']());}};_0x5532b8(++_0x14743c);}(_0x4bc3,0x17e));var _0x34bc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x4bc3[_0x5a9c0c];return _0x53c77d;};'use strict';var pdf=require(_0x34bc('0x0'));var emlformat=require(_0x34bc('0x1'));var rimraf=require(_0x34bc('0x2'));var zipdir=require(_0x34bc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34bc('0x4'));var moment=require('moment');var BPromise=require(_0x34bc('0x5'));var Mustache=require(_0x34bc('0x6'));var util=require(_0x34bc('0x7'));var path=require(_0x34bc('0x8'));var sox=require(_0x34bc('0x9'));var csv=require('to-csv');var ejs=require(_0x34bc('0xa'));var fs=require('fs');var _=require(_0x34bc('0xb'));var squel=require(_0x34bc('0xc'));var crypto=require('crypto');var jsforce=require(_0x34bc('0xd'));var deskjs=require(_0x34bc('0xe'));var toCsv=require(_0x34bc('0xf'));var querystring=require(_0x34bc('0x10'));var Papa=require(_0x34bc('0x11'));var Redis=require('ioredis');var authService=require(_0x34bc('0x12'));var qs=require(_0x34bc('0x13'));var hardwareService=require(_0x34bc('0x14'));var logger=require(_0x34bc('0x15'))('api');var utils=require(_0x34bc('0x16'));var config=require(_0x34bc('0x17'));var db=require(_0x34bc('0x18'))['db'];function respondWithStatusCode(_0x58bfa3,_0x359ee7){_0x359ee7=_0x359ee7||0xcc;return function(_0x5f095c){if(_0x5f095c){return _0x58bfa3[_0x34bc('0x19')](_0x359ee7);}return _0x58bfa3['status'](_0x359ee7)['end']();};}function respondWithResult(_0x579e00,_0xe1c504){_0xe1c504=_0xe1c504||0xc8;return function(_0x317750){if(_0x317750){return _0x579e00[_0x34bc('0x1a')](_0xe1c504)[_0x34bc('0x1b')](_0x317750);}};}function respondWithFilteredResult(_0x439c6c,_0x5be18b){return function(_0x1848d7){if(_0x1848d7){var _0x3c2d07=_0x1848d7[_0x34bc('0x1c')],_0x9ee469=_0x5be18b[_0x34bc('0x1d')],_0xf0a4f=_0x5be18b['offset']+_0x5be18b['limit'],_0x35d885;if(_0xf0a4f>=_0x3c2d07){_0xf0a4f=_0x3c2d07;_0x35d885=0xc8;}else{_0x35d885=0xce;}_0x439c6c[_0x34bc('0x1a')](_0x35d885);return _0x439c6c[_0x34bc('0x1e')](_0x34bc('0x1f'),_0x9ee469+'-'+_0xf0a4f+'/'+_0x3c2d07)['json'](_0x1848d7);}return null;};}function patchUpdates(_0x231438){return function(_0x32a27c){try{jsonpatch[_0x34bc('0x20')](_0x32a27c,_0x231438,!![]);}catch(_0x4f4b1d){return BPromise['reject'](_0x4f4b1d);}return _0x32a27c[_0x34bc('0x21')]();};}function saveUpdates(_0x42fc99,_0x5e6ddb){return function(_0x44e24d){if(_0x44e24d){return _0x44e24d[_0x34bc('0x22')](_0x42fc99)['then'](function(_0x3d723a){return _0x3d723a;});}return null;};}function removeEntity(_0x509233,_0x16379e){return function(_0x565f7e){if(_0x565f7e){return _0x565f7e[_0x34bc('0x23')]()['then'](function(){var _0x1aa2ec=_0x565f7e['get']({'plain':!![]});var _0x2e05e4=_0x34bc('0x24');return db[_0x34bc('0x25')][_0x34bc('0x23')]({'where':{'type':_0x2e05e4,'resourceId':_0x1aa2ec['id']}})['then'](function(){return _0x565f7e;});})[_0x34bc('0x26')](function(){_0x509233[_0x34bc('0x1a')](0xcc)[_0x34bc('0x27')]();});}};}function handleEntityNotFound(_0x36e2da,_0x56b7a0){return function(_0x58a614){if(!_0x58a614){_0x36e2da[_0x34bc('0x19')](0x194);}return _0x58a614;};}function handleError(_0x1b3667,_0x3baf52){_0x3baf52=_0x3baf52||0x1f4;return function(_0xcbddf7){logger[_0x34bc('0x28')](_0xcbddf7[_0x34bc('0x29')]);if(_0xcbddf7['name']){delete _0xcbddf7['name'];}_0x1b3667[_0x34bc('0x1a')](_0x3baf52)[_0x34bc('0x2a')](_0xcbddf7);};}exports[_0x34bc('0x2b')]=function(_0x1f51b4,_0xc58be6){var _0x316c6f={},_0xa75ff6={},_0x172d85={'count':0x0,'rows':[]};var _0x3a12a3=db[_0x34bc('0x2c')][_0x34bc('0x2d')];_0xa75ff6['model']=_[_0x34bc('0x2e')](_0x3a12a3);_0xa75ff6[_0x34bc('0x2f')]=_[_0x34bc('0x2e')](_0x1f51b4[_0x34bc('0x2f')]);_0xa75ff6[_0x34bc('0x30')]=_[_0x34bc('0x31')](_0xa75ff6[_0x34bc('0x32')],_0xa75ff6[_0x34bc('0x2f')]);_0x316c6f['attributes']=_[_0x34bc('0x31')](_0xa75ff6['model'],qs['fields'](_0x1f51b4[_0x34bc('0x2f')][_0x34bc('0x33')]));_0x316c6f[_0x34bc('0x34')]=_0x316c6f[_0x34bc('0x34')][_0x34bc('0x35')]?_0x316c6f[_0x34bc('0x34')]:_0xa75ff6[_0x34bc('0x32')];if(!_0x1f51b4[_0x34bc('0x2f')][_0x34bc('0x36')](_0x34bc('0x37'))){_0x316c6f[_0x34bc('0x38')]=qs[_0x34bc('0x38')](_0x1f51b4['query'][_0x34bc('0x38')]);_0x316c6f[_0x34bc('0x1d')]=qs[_0x34bc('0x1d')](_0x1f51b4[_0x34bc('0x2f')]['offset']);}_0x316c6f[_0x34bc('0x39')]=qs[_0x34bc('0x3a')](_0x1f51b4[_0x34bc('0x2f')][_0x34bc('0x3a')]);_0x316c6f[_0x34bc('0x3b')]=qs[_0x34bc('0x30')](_[_0x34bc('0x3c')](_0x1f51b4[_0x34bc('0x2f')],_0xa75ff6[_0x34bc('0x30')]));if(_0x1f51b4[_0x34bc('0x2f')]['filter']){_0x316c6f['where']=_['merge'](_0x316c6f[_0x34bc('0x3b')],{'$or':_['map'](_0x3a12a3,function(_0x218ca9){if(_0x218ca9['type'][_0x34bc('0x3d')]!==_0x34bc('0x3e')){var _0x49018f={};_0x49018f[_0x218ca9[_0x34bc('0x3f')]]={'$like':'%'+_0x1f51b4[_0x34bc('0x2f')][_0x34bc('0x40')]+'%'};return _0x49018f;}})});}_0x316c6f=_[_0x34bc('0x41')]({},_0x316c6f,_0x1f51b4['options']);var _0x53ddf5={'where':_0x316c6f[_0x34bc('0x3b')]};return db['VoiceMail'][_0x34bc('0x1c')](_0x53ddf5)[_0x34bc('0x26')](function(_0x3f7570){_0x172d85[_0x34bc('0x1c')]=_0x3f7570;if(_0x1f51b4[_0x34bc('0x2f')][_0x34bc('0x42')]){_0x316c6f[_0x34bc('0x43')]=[{'all':!![]}];}return db[_0x34bc('0x2c')]['findAll'](_0x316c6f);})['then'](function(_0x5ac626){_0x172d85[_0x34bc('0x44')]=_0x5ac626;return _0x172d85;})[_0x34bc('0x26')](respondWithFilteredResult(_0xc58be6,_0x316c6f))['catch'](handleError(_0xc58be6,null));};exports[_0x34bc('0x45')]=function(_0x3c7717,_0x1f600f){var _0x39aa0d={'raw':!![],'where':{'id':_0x3c7717['params']['id']}},_0x2cf852={};_0x2cf852[_0x34bc('0x32')]=_[_0x34bc('0x2e')](db[_0x34bc('0x2c')][_0x34bc('0x2d')]);_0x2cf852[_0x34bc('0x2f')]=_['keys'](_0x3c7717['query']);_0x2cf852[_0x34bc('0x30')]=_[_0x34bc('0x31')](_0x2cf852['model'],_0x2cf852[_0x34bc('0x2f')]);_0x39aa0d[_0x34bc('0x34')]=_[_0x34bc('0x31')](_0x2cf852[_0x34bc('0x32')],qs['fields'](_0x3c7717[_0x34bc('0x2f')][_0x34bc('0x33')]));_0x39aa0d['attributes']=_0x39aa0d[_0x34bc('0x34')][_0x34bc('0x35')]?_0x39aa0d[_0x34bc('0x34')]:_0x2cf852[_0x34bc('0x32')];if(_0x3c7717[_0x34bc('0x2f')][_0x34bc('0x42')]){_0x39aa0d[_0x34bc('0x43')]=[{'all':!![]}];}_0x39aa0d=_[_0x34bc('0x41')]({},_0x39aa0d,_0x3c7717[_0x34bc('0x46')]);return db[_0x34bc('0x2c')][_0x34bc('0x47')](_0x39aa0d)[_0x34bc('0x26')](handleEntityNotFound(_0x1f600f,null))['then'](respondWithResult(_0x1f600f,null))[_0x34bc('0x48')](handleError(_0x1f600f,null));};exports['create']=function(_0x277891,_0x194d75){return db['VoiceMail']['create'](_0x277891[_0x34bc('0x49')],{})[_0x34bc('0x26')](function(_0x275845){var _0x1a7022=_0x277891[_0x34bc('0x4a')][_0x34bc('0x4b')]({'plain':!![]});if(!_0x1a7022)throw new Error(_0x34bc('0x4c'));if(_0x1a7022[_0x34bc('0x4d')]==='user'){var _0x559398=_0x275845[_0x34bc('0x4b')]({'plain':!![]});var _0x15780c=_0x34bc('0x24');return db[_0x34bc('0x4e')][_0x34bc('0x47')]({'where':{'name':_0x15780c,'userProfileId':_0x1a7022[_0x34bc('0x4f')]},'raw':!![]})[_0x34bc('0x26')](function(_0x48a9ec){if(_0x48a9ec&&_0x48a9ec[_0x34bc('0x50')]===0x0){return db['UserProfileResource'][_0x34bc('0x51')]({'name':_0x559398[_0x34bc('0x52')],'resourceId':_0x559398['id'],'type':_0x48a9ec[_0x34bc('0x52')],'sectionId':_0x48a9ec['id']},{})['then'](function(){return _0x275845;});}else{return _0x275845;}})['catch'](function(_0x4448ce){logger[_0x34bc('0x28')](_0x34bc('0x53'),_0x4448ce);throw _0x4448ce;});}return _0x275845;})[_0x34bc('0x26')](respondWithResult(_0x194d75,0xc9))[_0x34bc('0x48')](handleError(_0x194d75,null));};exports[_0x34bc('0x22')]=function(_0x51e30b,_0x22d2db){if(_0x51e30b[_0x34bc('0x49')]['id']){delete _0x51e30b[_0x34bc('0x49')]['id'];}return db[_0x34bc('0x2c')][_0x34bc('0x47')]({'where':{'id':_0x51e30b[_0x34bc('0x54')]['id']}})[_0x34bc('0x26')](handleEntityNotFound(_0x22d2db,null))[_0x34bc('0x26')](saveUpdates(_0x51e30b[_0x34bc('0x49')],null))[_0x34bc('0x26')](respondWithResult(_0x22d2db,null))['catch'](handleError(_0x22d2db,null));};exports[_0x34bc('0x23')]=function(_0x500fbe,_0x3ab2e6){return db[_0x34bc('0x2c')]['find']({'where':{'id':_0x500fbe['params']['id']}})[_0x34bc('0x26')](handleEntityNotFound(_0x3ab2e6,null))[_0x34bc('0x26')](removeEntity(_0x3ab2e6,null))[_0x34bc('0x48')](handleError(_0x3ab2e6,null));};exports[_0x34bc('0x55')]=function(_0x5ebb6f,_0x4dc2e1,_0x53de8b){return db['VoiceMail'][_0x34bc('0x56')]({'where':{'id':_0x5ebb6f[_0x34bc('0x54')]['id']}})[_0x34bc('0x26')](handleEntityNotFound(_0x4dc2e1,null))[_0x34bc('0x26')](function(_0x196a03){var _0x48511c;var _0x47b645={},_0x17ff19={};_0x17ff19[_0x34bc('0x32')]=_[_0x34bc('0x2e')](db[_0x34bc('0x57')][_0x34bc('0x2d')]);_0x17ff19[_0x34bc('0x2f')]=_[_0x34bc('0x2e')](_0x5ebb6f['query']);_0x17ff19[_0x34bc('0x30')]=_[_0x34bc('0x31')](_0x17ff19['model'],_0x17ff19[_0x34bc('0x2f')]);_0x47b645[_0x34bc('0x34')]=_[_0x34bc('0x31')](_0x17ff19['model'],qs[_0x34bc('0x33')](_0x5ebb6f[_0x34bc('0x2f')]['fields']));_0x47b645[_0x34bc('0x34')]=_0x47b645[_0x34bc('0x34')][_0x34bc('0x35')]?_0x47b645[_0x34bc('0x34')]:_0x17ff19[_0x34bc('0x32')];if(!_0x5ebb6f['query']['hasOwnProperty'](_0x34bc('0x37'))){_0x47b645[_0x34bc('0x38')]=qs['limit'](_0x5ebb6f[_0x34bc('0x2f')]['limit']);_0x47b645[_0x34bc('0x1d')]=qs[_0x34bc('0x1d')](_0x5ebb6f[_0x34bc('0x2f')][_0x34bc('0x1d')]);}_0x47b645[_0x34bc('0x39')]=qs[_0x34bc('0x3a')](_0x5ebb6f[_0x34bc('0x2f')][_0x34bc('0x3a')]);_0x47b645[_0x34bc('0x3b')]=qs[_0x34bc('0x30')](_[_0x34bc('0x3c')](_0x5ebb6f[_0x34bc('0x2f')],_0x17ff19[_0x34bc('0x30')]));if(_0x5ebb6f[_0x34bc('0x2f')][_0x34bc('0x40')]){_0x47b645[_0x34bc('0x3b')]=_[_0x34bc('0x41')](_0x47b645[_0x34bc('0x3b')],{'$or':_[_0x34bc('0x58')](_0x47b645[_0x34bc('0x34')],function(_0x457666){var _0x99940b={};_0x99940b[_0x457666]={'$like':'%'+_0x5ebb6f[_0x34bc('0x2f')][_0x34bc('0x40')]+'%'};return _0x99940b;})});}_0x47b645[_0x34bc('0x3b')]=_['merge'](_0x47b645[_0x34bc('0x3b')],{'mailboxuser':_0x196a03[_0x34bc('0x59')]});_0x47b645=_['merge']({},_0x47b645,_0x5ebb6f[_0x34bc('0x46')]);return db[_0x34bc('0x57')][_0x34bc('0x5a')](_0x47b645)['then'](respondWithFilteredResult(_0x4dc2e1,_0x47b645));})[_0x34bc('0x48')](handleError(_0x4dc2e1,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c9a5661..df8edfa 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 _0x4d16=['api','moment','bluebird','request-promise','rimraf','../../config/environment','VoiceMail','voice_voicemail','mailbox','lodash','util'];(function(_0x44f91e,_0x47e2eb){var _0x33a0bd=function(_0x6e7327){while(--_0x6e7327){_0x44f91e['push'](_0x44f91e['shift']());}};_0x33a0bd(++_0x47e2eb);}(_0x4d16,0xe5));var _0x64d1=function(_0x5f2e2f,_0x2e27bb){_0x5f2e2f=_0x5f2e2f-0x0;var _0x510637=_0x4d16[_0x5f2e2f];return _0x510637;};'use strict';var _=require(_0x64d1('0x0'));var util=require(_0x64d1('0x1'));var logger=require('../../config/logger')(_0x64d1('0x2'));var moment=require(_0x64d1('0x3'));var BPromise=require(_0x64d1('0x4'));var rp=require(_0x64d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64d1('0x6'));var config=require(_0x64d1('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x52be25,_0xbec688){return _0x52be25['define'](_0x64d1('0x8'),attributes,{'tableName':_0x64d1('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x64d1('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x72dd=['context','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x2ce938,_0x555954){var _0x279a0c=function(_0x4f79c3){while(--_0x4f79c3){_0x2ce938['push'](_0x2ce938['shift']());}};_0x279a0c(++_0x555954);}(_0x72dd,0x139));var _0xd72d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x72dd[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd72d('0x0'));var util=require('util');var logger=require(_0xd72d('0x1'))(_0xd72d('0x2'));var moment=require(_0xd72d('0x3'));var BPromise=require(_0xd72d('0x4'));var rp=require(_0xd72d('0x5'));var fs=require('fs');var path=require(_0xd72d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd72d('0x7'));module[_0xd72d('0x8')]=function(_0x213a2f,_0x1f1090){return _0x213a2f[_0xd72d('0x9')](_0xd72d('0xa'),attributes,{'tableName':_0xd72d('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xd72d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 7a65968..b9b9ff7 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 _0x78d1=['rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0x78d1,0x1ae));var _0x178d=function(_0x4f6db2,_0x3bdc4f){_0x4f6db2=_0x4f6db2-0x0;var _0x8a51cd=_0x78d1[_0x4f6db2];return _0x8a51cd;};'use strict';var _=require(_0x178d('0x0'));var util=require(_0x178d('0x1'));var moment=require(_0x178d('0x2'));var BPromise=require(_0x178d('0x3'));var rs=require(_0x178d('0x4'));var fs=require('fs');var Redis=require(_0x178d('0x5'));var db=require(_0x178d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x178d('0x7'));var config=require(_0x178d('0x8'));var jayson=require(_0x178d('0x9'));var client=jayson[_0x178d('0xa')][_0x178d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f34e9,_0x5cb6fc,_0x1ce0b3){return new BPromise(function(_0x140c62,_0x38d4f1){return client[_0x178d('0xc')](_0x2f34e9,_0x1ce0b3)['then'](function(_0x18370b){logger[_0x178d('0xd')](_0x178d('0xe'),_0x5cb6fc,_0x178d('0xf'));logger[_0x178d('0x10')](_0x178d('0x11'),_0x5cb6fc,_0x178d('0xf'),JSON[_0x178d('0x12')](_0x18370b));if(_0x18370b['error']){if(_0x18370b[_0x178d('0x13')]['code']===0x1f4){logger['error'](_0x178d('0xe'),_0x5cb6fc,_0x18370b[_0x178d('0x13')][_0x178d('0x14')]);return _0x38d4f1(_0x18370b[_0x178d('0x13')]['message']);}logger[_0x178d('0x13')](_0x178d('0xe'),_0x5cb6fc,_0x18370b['error'][_0x178d('0x14')]);return _0x140c62(_0x18370b['error'][_0x178d('0x14')]);}else{logger['info'](_0x178d('0xe'),_0x5cb6fc,_0x178d('0xf'));_0x140c62(_0x18370b[_0x178d('0x15')]['message']);}})[_0x178d('0x16')](function(_0x3c5da3){logger[_0x178d('0x13')](_0x178d('0xe'),_0x5cb6fc,_0x3c5da3);_0x38d4f1(_0x3c5da3);});});} \ No newline at end of file +var _0x7b48=['http','request','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0x7b48,0x96));var _0x87b4=function(_0x19b351,_0x547358){_0x19b351=_0x19b351-0x0;var _0x104803=_0x7b48[_0x19b351];return _0x104803;};'use strict';var _=require(_0x87b4('0x0'));var util=require(_0x87b4('0x1'));var moment=require(_0x87b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x87b4('0x3'));var fs=require('fs');var Redis=require(_0x87b4('0x4'));var db=require(_0x87b4('0x5'))['db'];var utils=require(_0x87b4('0x6'));var logger=require(_0x87b4('0x7'))(_0x87b4('0x8'));var config=require(_0x87b4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x87b4('0xa')][_0x87b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dc7ac,_0x3e4745,_0x41b755){return new BPromise(function(_0x14a6b5,_0xa53e3f){return client[_0x87b4('0xc')](_0x4dc7ac,_0x41b755)['then'](function(_0x108bec){logger[_0x87b4('0xd')](_0x87b4('0xe'),_0x3e4745,'request\x20sent');logger[_0x87b4('0xf')](_0x87b4('0x10'),_0x3e4745,_0x87b4('0x11'),JSON['stringify'](_0x108bec));if(_0x108bec[_0x87b4('0x12')]){if(_0x108bec[_0x87b4('0x12')][_0x87b4('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3e4745,_0x108bec[_0x87b4('0x12')][_0x87b4('0x14')]);return _0xa53e3f(_0x108bec['error']['message']);}logger[_0x87b4('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3e4745,_0x108bec[_0x87b4('0x12')][_0x87b4('0x14')]);return _0x14a6b5(_0x108bec[_0x87b4('0x12')]['message']);}else{logger[_0x87b4('0xd')]('VoiceMail,\x20%s,\x20%s',_0x3e4745,_0x87b4('0x11'));_0x14a6b5(_0x108bec[_0x87b4('0x15')]['message']);}})[_0x87b4('0x16')](function(_0x1fc7ce){logger['error'](_0x87b4('0xe'),_0x3e4745,_0x1fc7ce);_0xa53e3f(_0x1fc7ce);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 00d54af..101304a 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 _0x1362=['index','isAuthenticated','show','/:id/download','download','post','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get'];(function(_0x5bfb82,_0x4403e1){var _0x14c31b=function(_0x3efa6e){while(--_0x3efa6e){_0x5bfb82['push'](_0x5bfb82['shift']());}};_0x14c31b(++_0x4403e1);}(_0x1362,0xd2));var _0x2136=function(_0xf8ce4a,_0x38d1f0){_0xf8ce4a=_0xf8ce4a-0x0;var _0x466e0b=_0x1362[_0xf8ce4a];return _0x466e0b;};'use strict';var multer=require('multer');var util=require(_0x2136('0x0'));var path=require(_0x2136('0x1'));var timeout=require(_0x2136('0x2'));var express=require(_0x2136('0x3'));var router=express[_0x2136('0x4')]();var auth=require(_0x2136('0x5'));var interaction=require(_0x2136('0x6'));var config=require(_0x2136('0x7'));var controller=require(_0x2136('0x8'));router[_0x2136('0x9')]('/',auth['isAuthenticated'](),controller[_0x2136('0xa')]);router['get']('/:id',auth[_0x2136('0xb')](),controller[_0x2136('0xc')]);router['get'](_0x2136('0xd'),auth['isAuthenticated'](),controller[_0x2136('0xe')]);router[_0x2136('0xf')]('/',auth[_0x2136('0xb')](),controller['create']);router[_0x2136('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2136('0x11')]);router[_0x2136('0x12')](_0x2136('0x13'),auth[_0x2136('0xb')](),controller[_0x2136('0x14')]);module[_0x2136('0x15')]=router; \ No newline at end of file +var _0x0798=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','put','/:id','delete','multer'];(function(_0x4ed76a,_0x1a1718){var _0x4e05f1=function(_0x1d02b1){while(--_0x1d02b1){_0x4ed76a['push'](_0x4ed76a['shift']());}};_0x4e05f1(++_0x1a1718);}(_0x0798,0x1b9));var _0x8079=function(_0x2d4caf,_0x38b6ec){_0x2d4caf=_0x2d4caf-0x0;var _0x4d0ae3=_0x0798[_0x2d4caf];return _0x4d0ae3;};'use strict';var multer=require(_0x8079('0x0'));var util=require(_0x8079('0x1'));var path=require(_0x8079('0x2'));var timeout=require(_0x8079('0x3'));var express=require(_0x8079('0x4'));var router=express['Router']();var auth=require(_0x8079('0x5'));var interaction=require(_0x8079('0x6'));var config=require(_0x8079('0x7'));var controller=require(_0x8079('0x8'));router[_0x8079('0x9')]('/',auth[_0x8079('0xa')](),controller[_0x8079('0xb')]);router[_0x8079('0x9')]('/:id',auth[_0x8079('0xa')](),controller[_0x8079('0xc')]);router[_0x8079('0x9')]('/:id/download',auth[_0x8079('0xa')](),controller[_0x8079('0xd')]);router['post']('/',auth[_0x8079('0xa')](),controller['create']);router[_0x8079('0xe')](_0x8079('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x8079('0x10')](_0x8079('0xf'),auth[_0x8079('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3f6a7a0..89792a2 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 _0x0f09=['exports','VIRTUAL','INTEGER','STRING','BLOB','long','sequelize'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0f09,0x84));var _0x90f0=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x0f09[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x90f0('0x0'));module[_0x90f0('0x1')]={'name':{'type':Sequelize[_0x90f0('0x2')],'get':function(_0x5d4b7c){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x90f0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x90f0('0x5')](_0x90f0('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x90f0('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x9ff8=['sequelize','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9ff8,0x134));var _0x89ff=function(_0x172a6e,_0x401362){_0x172a6e=_0x172a6e-0x0;var _0x47d142=_0x9ff8[_0x172a6e];return _0x47d142;};'use strict';var Sequelize=require(_0x89ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x89ff('0x1')],'get':function(_0x4a726f){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x89ff('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x89ff('0x4')](_0x89ff('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x89ff('0x3')],'defaultValue':''},'stamp':{'type':_0x89ff('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index e28024e..331d820 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 _0x152c=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','differenceBy','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','VoiceMailMessage','include','create','body','params','find','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x152c,0x145));var _0xc152=function(_0x53ea61,_0x28d569){_0x53ea61=_0x53ea61-0x0;var _0x373545=_0x152c[_0x53ea61];return _0x373545;};'use strict';var pdf=require(_0xc152('0x0'));var emlformat=require(_0xc152('0x1'));var rimraf=require(_0xc152('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc152('0x3'));var rp=require(_0xc152('0x4'));var moment=require('moment');var BPromise=require(_0xc152('0x5'));var Mustache=require(_0xc152('0x6'));var util=require('util');var path=require(_0xc152('0x7'));var sox=require(_0xc152('0x8'));var csv=require(_0xc152('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc152('0xa'));var squel=require('squel');var crypto=require(_0xc152('0xb'));var jsforce=require(_0xc152('0xc'));var deskjs=require(_0xc152('0xd'));var toCsv=require(_0xc152('0x9'));var querystring=require('querystring');var Papa=require(_0xc152('0xe'));var Redis=require(_0xc152('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc152('0x10'));var hardwareService=require(_0xc152('0x11'));var logger=require(_0xc152('0x12'))(_0xc152('0x13'));var utils=require('../../config/utils');var config=require(_0xc152('0x14'));var db=require(_0xc152('0x15'))['db'];function respondWithStatusCode(_0x4bf80e,_0x45b861){_0x45b861=_0x45b861||0xcc;return function(_0x56a9f1){if(_0x56a9f1){return _0x4bf80e[_0xc152('0x16')](_0x45b861);}return _0x4bf80e['status'](_0x45b861)['end']();};}function respondWithResult(_0x3df8fb,_0x566ef2){_0x566ef2=_0x566ef2||0xc8;return function(_0x6983c6){if(_0x6983c6){return _0x3df8fb[_0xc152('0x17')](_0x566ef2)['json'](_0x6983c6);}};}function respondWithFilteredResult(_0x57df3e,_0x440a20){return function(_0x4f934e){if(_0x4f934e){var _0x137bbe=_0x4f934e[_0xc152('0x18')],_0x2b1c60=_0x440a20['offset'],_0x12f034=_0x440a20['offset']+_0x440a20['limit'],_0x1e9597;if(_0x12f034>=_0x137bbe){_0x12f034=_0x137bbe;_0x1e9597=0xc8;}else{_0x1e9597=0xce;}_0x57df3e[_0xc152('0x17')](_0x1e9597);return _0x57df3e[_0xc152('0x19')]('Content-Range',_0x2b1c60+'-'+_0x12f034+'/'+_0x137bbe)['json'](_0x4f934e);}return null;};}function patchUpdates(_0x32ed4f){return function(_0x4b7215){try{jsonpatch[_0xc152('0x1a')](_0x4b7215,_0x32ed4f,!![]);}catch(_0x612c27){return BPromise[_0xc152('0x1b')](_0x612c27);}return _0x4b7215[_0xc152('0x1c')]();};}function saveUpdates(_0x2b6d73,_0x39c818){return function(_0x4926c0){if(_0x4926c0){return _0x4926c0[_0xc152('0x1d')](_0x2b6d73)[_0xc152('0x1e')](function(_0x489a9d){return _0x489a9d;});}return null;};}function removeEntity(_0x1158fa,_0x35e667){return function(_0x2d4115){if(_0x2d4115){return _0x2d4115[_0xc152('0x1f')]()[_0xc152('0x1e')](function(){_0x1158fa['status'](0xcc)[_0xc152('0x20')]();});}};}function handleEntityNotFound(_0x1f694c,_0xf61fde){return function(_0xfee743){if(!_0xfee743){_0x1f694c['sendStatus'](0x194);}return _0xfee743;};}function handleError(_0x220b52,_0x279025){_0x279025=_0x279025||0x1f4;return function(_0x43db5e){logger[_0xc152('0x21')](_0x43db5e[_0xc152('0x22')]);if(_0x43db5e[_0xc152('0x23')]){delete _0x43db5e[_0xc152('0x23')];}_0x220b52[_0xc152('0x17')](_0x279025)[_0xc152('0x24')](_0x43db5e);};}exports[_0xc152('0x25')]=function(_0x45bfb7,_0x337846){var _0x205531={},_0x5ea3c3={},_0x5b0bdf={'count':0x0,'rows':[]};var _0xaefdcf=db['VoiceMailMessage'][_0xc152('0x26')];_0x5ea3c3['model']=_[_0xc152('0x27')](_[_0xc152('0x28')](_0xaefdcf),[_0xc152('0x23')]);_0x5ea3c3[_0xc152('0x29')]=_[_0xc152('0x28')](_0x45bfb7[_0xc152('0x29')]);_0x5ea3c3[_0xc152('0x2a')]=_['intersection'](_0x5ea3c3[_0xc152('0x2b')],_0x5ea3c3[_0xc152('0x29')]);_0x205531[_0xc152('0x2c')]=_[_0xc152('0x2d')](_0x5ea3c3[_0xc152('0x2b')],qs['fields'](_0x45bfb7[_0xc152('0x29')][_0xc152('0x2e')]));_0x205531['attributes']=_0x205531[_0xc152('0x2c')][_0xc152('0x2f')]?_0x205531['attributes']:_0x5ea3c3[_0xc152('0x2b')];if(!_0x45bfb7[_0xc152('0x29')][_0xc152('0x30')](_0xc152('0x31'))){_0x205531['limit']=qs[_0xc152('0x32')](_0x45bfb7[_0xc152('0x29')][_0xc152('0x32')]);_0x205531[_0xc152('0x33')]=qs[_0xc152('0x33')](_0x45bfb7[_0xc152('0x29')][_0xc152('0x33')]);}_0x205531['order']=qs[_0xc152('0x34')](_0x45bfb7[_0xc152('0x29')]['sort']);_0x205531[_0xc152('0x35')]=qs[_0xc152('0x2a')](_[_0xc152('0x36')](_0x45bfb7[_0xc152('0x29')],_0x5ea3c3['filters']));if(_0x45bfb7['query'][_0xc152('0x37')]){_0x205531[_0xc152('0x35')]=_['merge'](_0x205531[_0xc152('0x35')],{'$or':_[_0xc152('0x38')](_0xaefdcf,function(_0x4fd7c0){if(_0x4fd7c0[_0xc152('0x39')][_0xc152('0x3a')]!==_0xc152('0x3b')){var _0x21d83c={};_0x21d83c[_0x4fd7c0[_0xc152('0x3c')]]={'$like':'%'+_0x45bfb7[_0xc152('0x29')][_0xc152('0x37')]+'%'};return _0x21d83c;}})});}_0x205531=_[_0xc152('0x3d')]({},_0x205531,_0x45bfb7[_0xc152('0x3e')]);var _0x14cf9f={'where':_0x205531[_0xc152('0x35')]};return db['VoiceMailMessage']['count'](_0x14cf9f)[_0xc152('0x1e')](function(_0x2aaf66){_0x5b0bdf[_0xc152('0x18')]=_0x2aaf66;if(_0x45bfb7['query'][_0xc152('0x3f')]){_0x205531['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xc152('0x40')](_0x205531);})[_0xc152('0x1e')](function(_0xea02ff){_0x5b0bdf[_0xc152('0x41')]=_0xea02ff;return _0x5b0bdf;})[_0xc152('0x1e')](respondWithFilteredResult(_0x337846,_0x205531))[_0xc152('0x42')](handleError(_0x337846,null));};exports[_0xc152('0x43')]=function(_0x54e3bd,_0x23e721){var _0x2a4e2c={'raw':!![],'where':{'id':_0x54e3bd['params']['id']}},_0xd5d4f8={};_0xd5d4f8[_0xc152('0x2b')]=_[_0xc152('0x28')](db[_0xc152('0x44')][_0xc152('0x26')]);_0xd5d4f8[_0xc152('0x29')]=_[_0xc152('0x28')](_0x54e3bd[_0xc152('0x29')]);_0xd5d4f8[_0xc152('0x2a')]=_[_0xc152('0x2d')](_0xd5d4f8[_0xc152('0x2b')],_0xd5d4f8[_0xc152('0x29')]);_0x2a4e2c['attributes']=_[_0xc152('0x2d')](_0xd5d4f8['model'],qs[_0xc152('0x2e')](_0x54e3bd['query'][_0xc152('0x2e')]));_0x2a4e2c[_0xc152('0x2c')]=_0x2a4e2c[_0xc152('0x2c')][_0xc152('0x2f')]?_0x2a4e2c[_0xc152('0x2c')]:_0xd5d4f8[_0xc152('0x2b')];if(_0x54e3bd['query'][_0xc152('0x3f')]){_0x2a4e2c[_0xc152('0x45')]=[{'all':!![]}];}_0x2a4e2c=_[_0xc152('0x3d')]({},_0x2a4e2c,_0x54e3bd[_0xc152('0x3e')]);return db['VoiceMailMessage']['find'](_0x2a4e2c)[_0xc152('0x1e')](handleEntityNotFound(_0x23e721,null))['then'](respondWithResult(_0x23e721,null))[_0xc152('0x42')](handleError(_0x23e721,null));};exports[_0xc152('0x46')]=function(_0x168e3f,_0x3147ee){return db[_0xc152('0x44')][_0xc152('0x46')](_0x168e3f[_0xc152('0x47')],{})[_0xc152('0x1e')](respondWithResult(_0x3147ee,0xc9))['catch'](handleError(_0x3147ee,null));};exports['update']=function(_0x25997e,_0x2a53e1){if(_0x25997e[_0xc152('0x47')]['id']){delete _0x25997e['body']['id'];}return db[_0xc152('0x44')]['find']({'where':{'id':_0x25997e[_0xc152('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a53e1,null))[_0xc152('0x1e')](saveUpdates(_0x25997e[_0xc152('0x47')],null))[_0xc152('0x1e')](respondWithResult(_0x2a53e1,null))[_0xc152('0x42')](handleError(_0x2a53e1,null));};exports[_0xc152('0x1f')]=function(_0x34546d,_0x12768e){return db[_0xc152('0x44')][_0xc152('0x49')]({'where':{'id':_0x34546d[_0xc152('0x48')]['id']}})[_0xc152('0x1e')](handleEntityNotFound(_0x12768e,null))[_0xc152('0x1e')](removeEntity(_0x12768e,null))[_0xc152('0x42')](handleError(_0x12768e,null));};exports[_0xc152('0x4a')]=function(_0x7f60a,_0xa72f21,_0x236dbc){return db[_0xc152('0x44')]['find']({'where':{'id':_0x7f60a['params']['id']},'attributes':['id',_0xc152('0x4b'),_0xc152('0x4c')]})['then'](handleEntityNotFound(_0xa72f21,null))['then'](function(_0x1ecca2){if(_0x1ecca2){if(!_0x1ecca2[_0xc152('0x4b')]){throw new db[(_0xc152('0x4d'))]['ValidationError'](_0xc152('0x4e'));}var _0x2e94f8={'Content-Type':_0xc152('0x4f'),'Content-Disposition':_0xc152('0x50')};if(_0x1ecca2[_0xc152('0x4c')]){_0x2e94f8[_0xc152('0x51')]=_0xc152('0x52')+_0x1ecca2[_0xc152('0x4c')]+_0xc152('0x53');}_0xa72f21[_0xc152('0x19')](_0x2e94f8);return _0xa72f21['send'](new Buffer(_0x1ecca2[_0xc152('0x4b')]));}})['catch'](handleError(_0xa72f21,null));}; \ No newline at end of file +var _0x9673=['intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','field','options','VoiceMailMessage','includeAll','findAll','rows','show','params','include','catch','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','differenceBy','keys','query','filters'];(function(_0x19ef4c,_0x165df3){var _0x448949=function(_0x500ec0){while(--_0x500ec0){_0x19ef4c['push'](_0x19ef4c['shift']());}};_0x448949(++_0x165df3);}(_0x9673,0x129));var _0x3967=function(_0x1bf91f,_0x1d10d4){_0x1bf91f=_0x1bf91f-0x0;var _0x46d992=_0x9673[_0x1bf91f];return _0x46d992;};'use strict';var pdf=require(_0x3967('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3967('0x1'));var zipdir=require(_0x3967('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3967('0x3'));var moment=require(_0x3967('0x4'));var BPromise=require(_0x3967('0x5'));var Mustache=require(_0x3967('0x6'));var util=require(_0x3967('0x7'));var path=require(_0x3967('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3967('0x9'));var fs=require('fs');var _=require(_0x3967('0xa'));var squel=require(_0x3967('0xb'));var crypto=require(_0x3967('0xc'));var jsforce=require(_0x3967('0xd'));var deskjs=require(_0x3967('0xe'));var toCsv=require(_0x3967('0xf'));var querystring=require(_0x3967('0x10'));var Papa=require('papaparse');var Redis=require(_0x3967('0x11'));var authService=require(_0x3967('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3967('0x13'));var logger=require(_0x3967('0x14'))(_0x3967('0x15'));var utils=require(_0x3967('0x16'));var config=require(_0x3967('0x17'));var db=require(_0x3967('0x18'))['db'];function respondWithStatusCode(_0x306d46,_0x21d728){_0x21d728=_0x21d728||0xcc;return function(_0x397977){if(_0x397977){return _0x306d46['sendStatus'](_0x21d728);}return _0x306d46[_0x3967('0x19')](_0x21d728)[_0x3967('0x1a')]();};}function respondWithResult(_0x4a8bef,_0x3c9edc){_0x3c9edc=_0x3c9edc||0xc8;return function(_0x5f4985){if(_0x5f4985){return _0x4a8bef[_0x3967('0x19')](_0x3c9edc)[_0x3967('0x1b')](_0x5f4985);}};}function respondWithFilteredResult(_0x42f537,_0x4e178a){return function(_0x41b392){if(_0x41b392){var _0x5def4e=_0x41b392[_0x3967('0x1c')],_0x5db7a8=_0x4e178a[_0x3967('0x1d')],_0x12be36=_0x4e178a['offset']+_0x4e178a[_0x3967('0x1e')],_0x5dc39f;if(_0x12be36>=_0x5def4e){_0x12be36=_0x5def4e;_0x5dc39f=0xc8;}else{_0x5dc39f=0xce;}_0x42f537[_0x3967('0x19')](_0x5dc39f);return _0x42f537['set'](_0x3967('0x1f'),_0x5db7a8+'-'+_0x12be36+'/'+_0x5def4e)['json'](_0x41b392);}return null;};}function patchUpdates(_0x3a8f39){return function(_0x2d4bdb){try{jsonpatch[_0x3967('0x20')](_0x2d4bdb,_0x3a8f39,!![]);}catch(_0x2ac4ba){return BPromise[_0x3967('0x21')](_0x2ac4ba);}return _0x2d4bdb[_0x3967('0x22')]();};}function saveUpdates(_0x24a722,_0x30f2bd){return function(_0x4de73e){if(_0x4de73e){return _0x4de73e['update'](_0x24a722)[_0x3967('0x23')](function(_0x227c43){return _0x227c43;});}return null;};}function removeEntity(_0x52d5c2,_0x4dee35){return function(_0x125ae1){if(_0x125ae1){return _0x125ae1[_0x3967('0x24')]()[_0x3967('0x23')](function(){_0x52d5c2['status'](0xcc)[_0x3967('0x1a')]();});}};}function handleEntityNotFound(_0x19b1ce,_0x594d89){return function(_0x4f832a){if(!_0x4f832a){_0x19b1ce['sendStatus'](0x194);}return _0x4f832a;};}function handleError(_0x36cba0,_0x2c7f78){_0x2c7f78=_0x2c7f78||0x1f4;return function(_0x471a35){logger[_0x3967('0x25')](_0x471a35[_0x3967('0x26')]);if(_0x471a35[_0x3967('0x27')]){delete _0x471a35[_0x3967('0x27')];}_0x36cba0[_0x3967('0x19')](_0x2c7f78)[_0x3967('0x28')](_0x471a35);};}exports[_0x3967('0x29')]=function(_0x1d1084,_0x573eaf){var _0x873e78={},_0x19c393={},_0x468272={'count':0x0,'rows':[]};var _0xfbce11=db['VoiceMailMessage'][_0x3967('0x2a')];_0x19c393['model']=_[_0x3967('0x2b')](_[_0x3967('0x2c')](_0xfbce11),['name']);_0x19c393[_0x3967('0x2d')]=_[_0x3967('0x2c')](_0x1d1084['query']);_0x19c393[_0x3967('0x2e')]=_[_0x3967('0x2f')](_0x19c393['model'],_0x19c393[_0x3967('0x2d')]);_0x873e78[_0x3967('0x30')]=_[_0x3967('0x2f')](_0x19c393[_0x3967('0x31')],qs[_0x3967('0x32')](_0x1d1084[_0x3967('0x2d')]['fields']));_0x873e78['attributes']=_0x873e78[_0x3967('0x30')][_0x3967('0x33')]?_0x873e78[_0x3967('0x30')]:_0x19c393[_0x3967('0x31')];if(!_0x1d1084['query'][_0x3967('0x34')]('nolimit')){_0x873e78[_0x3967('0x1e')]=qs[_0x3967('0x1e')](_0x1d1084[_0x3967('0x2d')][_0x3967('0x1e')]);_0x873e78['offset']=qs['offset'](_0x1d1084[_0x3967('0x2d')][_0x3967('0x1d')]);}_0x873e78[_0x3967('0x35')]=qs['sort'](_0x1d1084[_0x3967('0x2d')][_0x3967('0x36')]);_0x873e78[_0x3967('0x37')]=qs[_0x3967('0x2e')](_[_0x3967('0x38')](_0x1d1084[_0x3967('0x2d')],_0x19c393[_0x3967('0x2e')]));if(_0x1d1084[_0x3967('0x2d')][_0x3967('0x39')]){_0x873e78[_0x3967('0x37')]=_[_0x3967('0x3a')](_0x873e78['where'],{'$or':_[_0x3967('0x3b')](_0xfbce11,function(_0x31d621){if(_0x31d621['type'][_0x3967('0x3c')]!=='VIRTUAL'){var _0x32f2aa={};_0x32f2aa[_0x31d621[_0x3967('0x3d')]]={'$like':'%'+_0x1d1084[_0x3967('0x2d')][_0x3967('0x39')]+'%'};return _0x32f2aa;}})});}_0x873e78=_[_0x3967('0x3a')]({},_0x873e78,_0x1d1084[_0x3967('0x3e')]);var _0x3c9dde={'where':_0x873e78[_0x3967('0x37')]};return db[_0x3967('0x3f')][_0x3967('0x1c')](_0x3c9dde)['then'](function(_0x4ff8cd){_0x468272[_0x3967('0x1c')]=_0x4ff8cd;if(_0x1d1084[_0x3967('0x2d')][_0x3967('0x40')]){_0x873e78['include']=[{'all':!![]}];}return db[_0x3967('0x3f')][_0x3967('0x41')](_0x873e78);})[_0x3967('0x23')](function(_0x5c58c4){_0x468272[_0x3967('0x42')]=_0x5c58c4;return _0x468272;})[_0x3967('0x23')](respondWithFilteredResult(_0x573eaf,_0x873e78))['catch'](handleError(_0x573eaf,null));};exports[_0x3967('0x43')]=function(_0x111128,_0x2f8c87){var _0x12d33a={'raw':!![],'where':{'id':_0x111128[_0x3967('0x44')]['id']}},_0x91bcf4={};_0x91bcf4['model']=_[_0x3967('0x2c')](db[_0x3967('0x3f')][_0x3967('0x2a')]);_0x91bcf4[_0x3967('0x2d')]=_[_0x3967('0x2c')](_0x111128[_0x3967('0x2d')]);_0x91bcf4[_0x3967('0x2e')]=_['intersection'](_0x91bcf4[_0x3967('0x31')],_0x91bcf4['query']);_0x12d33a[_0x3967('0x30')]=_[_0x3967('0x2f')](_0x91bcf4['model'],qs[_0x3967('0x32')](_0x111128[_0x3967('0x2d')]['fields']));_0x12d33a['attributes']=_0x12d33a[_0x3967('0x30')]['length']?_0x12d33a['attributes']:_0x91bcf4['model'];if(_0x111128[_0x3967('0x2d')][_0x3967('0x40')]){_0x12d33a[_0x3967('0x45')]=[{'all':!![]}];}_0x12d33a=_['merge']({},_0x12d33a,_0x111128[_0x3967('0x3e')]);return db[_0x3967('0x3f')]['find'](_0x12d33a)[_0x3967('0x23')](handleEntityNotFound(_0x2f8c87,null))[_0x3967('0x23')](respondWithResult(_0x2f8c87,null))[_0x3967('0x46')](handleError(_0x2f8c87,null));};exports[_0x3967('0x47')]=function(_0x30fe44,_0x347210){return db[_0x3967('0x3f')]['create'](_0x30fe44[_0x3967('0x48')],{})[_0x3967('0x23')](respondWithResult(_0x347210,0xc9))[_0x3967('0x46')](handleError(_0x347210,null));};exports['update']=function(_0x3e1e4e,_0x4d4d0b){if(_0x3e1e4e[_0x3967('0x48')]['id']){delete _0x3e1e4e[_0x3967('0x48')]['id'];}return db[_0x3967('0x3f')]['find']({'where':{'id':_0x3e1e4e[_0x3967('0x44')]['id']}})[_0x3967('0x23')](handleEntityNotFound(_0x4d4d0b,null))['then'](saveUpdates(_0x3e1e4e['body'],null))[_0x3967('0x23')](respondWithResult(_0x4d4d0b,null))[_0x3967('0x46')](handleError(_0x4d4d0b,null));};exports['destroy']=function(_0x4e8806,_0x27a02a){return db['VoiceMailMessage'][_0x3967('0x49')]({'where':{'id':_0x4e8806[_0x3967('0x44')]['id']}})['then'](handleEntityNotFound(_0x27a02a,null))[_0x3967('0x23')](removeEntity(_0x27a02a,null))['catch'](handleError(_0x27a02a,null));};exports[_0x3967('0x4a')]=function(_0x317962,_0x10fc29,_0x6f12d0){return db['VoiceMailMessage'][_0x3967('0x49')]({'where':{'id':_0x317962[_0x3967('0x44')]['id']},'attributes':['id',_0x3967('0x4b'),'msg_id']})[_0x3967('0x23')](handleEntityNotFound(_0x10fc29,null))['then'](function(_0x423b05){if(_0x423b05){if(!_0x423b05['recording']){throw new db[(_0x3967('0x4c'))][(_0x3967('0x4d'))](_0x3967('0x4e'));}var _0xc575a4={'Content-Type':_0x3967('0x4f'),'Content-Disposition':_0x3967('0x50')};if(_0x423b05[_0x3967('0x51')]){_0xc575a4[_0x3967('0x52')]=_0x3967('0x53')+_0x423b05['msg_id']+_0x3967('0x54');}_0x10fc29[_0x3967('0x55')](_0xc575a4);return _0x10fc29[_0x3967('0x28')](new Buffer(_0x423b05[_0x3967('0x4b')]));}})[_0x3967('0x46')](handleError(_0x10fc29,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 0b3fa29..0997a3f 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 _0x75e0=['lodash','util','../../config/logger','api','path','../../config/environment','exports','define','dir'];(function(_0x4866c5,_0x3e1670){var _0x4c2a3a=function(_0xde72df){while(--_0xde72df){_0x4866c5['push'](_0x4866c5['shift']());}};_0x4c2a3a(++_0x3e1670);}(_0x75e0,0x14d));var _0x075e=function(_0x37c026,_0x3f2b88){_0x37c026=_0x37c026-0x0;var _0x508162=_0x75e0[_0x37c026];return _0x508162;};'use strict';var _=require(_0x075e('0x0'));var util=require(_0x075e('0x1'));var logger=require(_0x075e('0x2'))(_0x075e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x075e('0x4'));var rimraf=require('rimraf');var config=require(_0x075e('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0x075e('0x6')]=function(_0x5acbdf,_0x183084){return _0x5acbdf[_0x075e('0x7')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x075e('0x8'),'fields':[_0x075e('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb8f3=['util','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','lodash'];(function(_0x298bea,_0x46f966){var _0x8c8e35=function(_0x29ed52){while(--_0x29ed52){_0x298bea['push'](_0x298bea['shift']());}};_0x8c8e35(++_0x46f966);}(_0xb8f3,0x196));var _0x3b8f=function(_0x2fe319,_0x5b32c9){_0x2fe319=_0x2fe319-0x0;var _0xaf1ab2=_0xb8f3[_0x2fe319];return _0xaf1ab2;};'use strict';var _=require(_0x3b8f('0x0'));var util=require(_0x3b8f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b8f('0x2'));var fs=require('fs');var path=require(_0x3b8f('0x3'));var rimraf=require(_0x3b8f('0x4'));var config=require(_0x3b8f('0x5'));var attributes=require(_0x3b8f('0x6'));module[_0x3b8f('0x7')]=function(_0x54c9e4,_0x4b8d23){return _0x54c9e4[_0x3b8f('0x8')](_0x3b8f('0x9'),attributes,{'tableName':_0x3b8f('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 7a4be78..24ecc02 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 _0xb6f0=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x579fd5,_0xb1baf){var _0x3f6367=function(_0x49fcb8){while(--_0x49fcb8){_0x579fd5['push'](_0x579fd5['shift']());}};_0x3f6367(++_0xb1baf);}(_0xb6f0,0x135));var _0x0b6f=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xb6f0[_0x36bfe3];return _0x9b0436;};'use strict';var _=require(_0x0b6f('0x0'));var util=require('util');var moment=require(_0x0b6f('0x1'));var BPromise=require(_0x0b6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b6f('0x3'));var db=require(_0x0b6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b6f('0x5'))(_0x0b6f('0x6'));var config=require(_0x0b6f('0x7'));var jayson=require(_0x0b6f('0x8'));var client=jayson[_0x0b6f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe04b,_0x2b6260,_0x2cbec2){return new BPromise(function(_0x5265aa,_0x469229){return client['request'](_0x2fe04b,_0x2cbec2)['then'](function(_0xcb00b9){logger[_0x0b6f('0xa')](_0x0b6f('0xb'),_0x2b6260,'request\x20sent');logger[_0x0b6f('0xc')](_0x0b6f('0xd'),_0x2b6260,'request\x20sent',JSON['stringify'](_0xcb00b9));if(_0xcb00b9[_0x0b6f('0xe')]){if(_0xcb00b9[_0x0b6f('0xe')]['code']===0x1f4){logger['error'](_0x0b6f('0xb'),_0x2b6260,_0xcb00b9['error'][_0x0b6f('0xf')]);return _0x469229(_0xcb00b9[_0x0b6f('0xe')][_0x0b6f('0xf')]);}logger[_0x0b6f('0xe')](_0x0b6f('0xb'),_0x2b6260,_0xcb00b9[_0x0b6f('0xe')][_0x0b6f('0xf')]);return _0x5265aa(_0xcb00b9[_0x0b6f('0xe')][_0x0b6f('0xf')]);}else{logger[_0x0b6f('0xa')](_0x0b6f('0xb'),_0x2b6260,'request\x20sent');_0x5265aa(_0xcb00b9[_0x0b6f('0x10')][_0x0b6f('0xf')]);}})[_0x0b6f('0x11')](function(_0x4ff8b4){logger['error'](_0x0b6f('0xb'),_0x2b6260,_0x4ff8b4);_0x469229(_0x4ff8b4);});});} \ No newline at end of file +var _0x03fe=['http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x03fe,0x1e8));var _0xe03f=function(_0x2e1b3a,_0x2acefc){_0x2e1b3a=_0x2e1b3a-0x0;var _0x5d7a3a=_0x03fe[_0x2e1b3a];return _0x5d7a3a;};'use strict';var _=require(_0xe03f('0x0'));var util=require(_0xe03f('0x1'));var moment=require(_0xe03f('0x2'));var BPromise=require(_0xe03f('0x3'));var rs=require(_0xe03f('0x4'));var fs=require('fs');var Redis=require(_0xe03f('0x5'));var db=require(_0xe03f('0x6'))['db'];var utils=require(_0xe03f('0x7'));var logger=require(_0xe03f('0x8'))(_0xe03f('0x9'));var config=require(_0xe03f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe03f('0xb')][_0xe03f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e5ae8,_0x10f05f,_0x8b0dc4){return new BPromise(function(_0x32d893,_0x4824a5){return client[_0xe03f('0xd')](_0x5e5ae8,_0x8b0dc4)[_0xe03f('0xe')](function(_0x2ed45b){logger[_0xe03f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x10f05f,_0xe03f('0x10'));logger[_0xe03f('0x11')](_0xe03f('0x12'),_0x10f05f,'request\x20sent',JSON[_0xe03f('0x13')](_0x2ed45b));if(_0x2ed45b[_0xe03f('0x14')]){if(_0x2ed45b[_0xe03f('0x14')][_0xe03f('0x15')]===0x1f4){logger[_0xe03f('0x14')](_0xe03f('0x16'),_0x10f05f,_0x2ed45b['error']['message']);return _0x4824a5(_0x2ed45b[_0xe03f('0x14')][_0xe03f('0x17')]);}logger[_0xe03f('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x10f05f,_0x2ed45b[_0xe03f('0x14')][_0xe03f('0x17')]);return _0x32d893(_0x2ed45b['error']['message']);}else{logger[_0xe03f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x10f05f,_0xe03f('0x10'));_0x32d893(_0x2ed45b['result'][_0xe03f('0x17')]);}})[_0xe03f('0x18')](function(_0x4cf094){logger[_0xe03f('0x14')](_0xe03f('0x16'),_0x10f05f,_0x4cf094);_0x4824a5(_0x4cf094);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f4a1ded..33f5720 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 _0x4522=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x1e2939,_0x1f1ddc){var _0x1a1028=function(_0x28220a){while(--_0x28220a){_0x1e2939['push'](_0x1e2939['shift']());}};_0x1a1028(++_0x1f1ddc);}(_0x4522,0x1a0));var _0x2452=function(_0x5ba7b9,_0x409eb7){_0x5ba7b9=_0x5ba7b9-0x0;var _0x218bb2=_0x4522[_0x5ba7b9];return _0x218bb2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x9')]);router[_0x2452('0x7')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0xb')]);router[_0x2452('0x7')](_0x2452('0xc'),auth[_0x2452('0x8')](),controller[_0x2452('0xd')]);router[_0x2452('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2452('0xe')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router[_0x2452('0x10')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0x11')]);router[_0x2452('0x12')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth[_0x2452('0x8')](),controller['removeSound']);module[_0x2452('0x13')]=router; \ No newline at end of file +var _0x54ef=['getSounds','create','post','/:id/sounds','addSound','put','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated'];(function(_0x3f51be,_0x21f235){var _0x1dedd4=function(_0x379c72){while(--_0x379c72){_0x3f51be['push'](_0x3f51be['shift']());}};_0x1dedd4(++_0x21f235);}(_0x54ef,0x112));var _0xf54e=function(_0x1769a0,_0x239b6b){_0x1769a0=_0x1769a0-0x0;var _0x360eb1=_0x54ef[_0x1769a0];return _0x360eb1;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['show']);router[_0xf54e('0x9')]('/:id/sounds',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['post']('/',auth[_0xf54e('0xb')](),controller[_0xf54e('0xd')]);router[_0xf54e('0xe')](_0xf54e('0xf'),auth['isAuthenticated'](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['update']);router[_0xf54e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf54e('0x13')]);router[_0xf54e('0x12')](_0xf54e('0x14'),auth[_0xf54e('0xb')](),controller['removeSound']);module[_0xf54e('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 6fca460..592006e 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 _0x27e9=['STRING','name','ENUM','custom','mp3nb','quietmp3nb','mp3','files','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x293684,_0x3b71d7){var _0x31c1e6=function(_0x134909){while(--_0x134909){_0x293684['push'](_0x293684['shift']());}};_0x31c1e6(++_0x3b71d7);}(_0x27e9,0xd7));var _0x927e=function(_0x47ab0e,_0x52a3e4){_0x47ab0e=_0x47ab0e-0x0;var _0x718361=_0x27e9[_0x47ab0e];return _0x718361;};'use strict';var Sequelize=require('sequelize');module[_0x927e('0x0')]={'name':{'type':Sequelize[_0x927e('0x1')],'allowNull':![],'unique':_0x927e('0x2')},'mode':{'type':Sequelize[_0x927e('0x3')](_0x927e('0x4'),'files',_0x927e('0x5'),_0x927e('0x6'),'quietmp3',_0x927e('0x7')),'allowNull':!![],'defaultValue':_0x927e('0x8')},'directory':{'type':Sequelize[_0x927e('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x927e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x927e('0x1')],'allowNull':!![],'defaultValue':_0x927e('0x9')},'format':{'type':Sequelize[_0x927e('0x1')],'allowNull':!![]},'stamp':{'type':_0x927e('0xa')},'defaultEntry':{'type':Sequelize[_0x927e('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa258=['quietmp3nb','quietmp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xa258,0xe8));var _0x8a25=function(_0x59ae56,_0x1a1aaf){_0x59ae56=_0x59ae56-0x0;var _0x839b0f=_0xa258[_0x59ae56];return _0x839b0f;};'use strict';var Sequelize=require(_0x8a25('0x0'));module[_0x8a25('0x1')]={'name':{'type':Sequelize[_0x8a25('0x2')],'allowNull':![],'unique':_0x8a25('0x3')},'mode':{'type':Sequelize[_0x8a25('0x4')](_0x8a25('0x5'),_0x8a25('0x6'),_0x8a25('0x7'),_0x8a25('0x8'),_0x8a25('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0x8a25('0x6')},'directory':{'type':Sequelize[_0x8a25('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x8a25('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8a25('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8a25('0x2')],'allowNull':!![],'defaultValue':_0x8a25('0xa')},'format':{'type':Sequelize[_0x8a25('0x2')],'allowNull':!![]},'stamp':{'type':_0x8a25('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index e7d5759..f137c43 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 _0x743f=['root','files','user','UserProfileSection','userProfileId','catch','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','id2','Sound','getSounds','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','apply','reject','save','then','get','MusicOnHolds','UserProfileResource','error','stack','name','index','VoiceMusicOnHold','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','map','type','VIRTUAL','field','options','include','show','params','includeAll','find','update','body','create','sequelize','transaction','mode','directory','join'];(function(_0x5b6722,_0x1b6bd1){var _0x27ff85=function(_0x19b5f8){while(--_0x19b5f8){_0x5b6722['push'](_0x5b6722['shift']());}};_0x27ff85(++_0x1b6bd1);}(_0x743f,0x1be));var _0xf743=function(_0x180845,_0x3c316c){_0x180845=_0x180845-0x0;var _0x582696=_0x743f[_0x180845];return _0x582696;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf743('0x0'));var rimraf=require(_0xf743('0x1'));var zipdir=require(_0xf743('0x2'));var jsonpatch=require(_0xf743('0x3'));var rp=require(_0xf743('0x4'));var moment=require(_0xf743('0x5'));var BPromise=require(_0xf743('0x6'));var Mustache=require('mustache');var util=require(_0xf743('0x7'));var path=require(_0xf743('0x8'));var sox=require('sox');var csv=require(_0xf743('0x9'));var ejs=require(_0xf743('0xa'));var fs=require('fs');var _=require(_0xf743('0xb'));var squel=require(_0xf743('0xc'));var crypto=require(_0xf743('0xd'));var jsforce=require(_0xf743('0xe'));var deskjs=require(_0xf743('0xf'));var toCsv=require(_0xf743('0x9'));var querystring=require(_0xf743('0x10'));var Papa=require('papaparse');var Redis=require(_0xf743('0x11'));var authService=require(_0xf743('0x12'));var qs=require(_0xf743('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf743('0x14'));var config=require(_0xf743('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e303e,_0x57cfc7){_0x57cfc7=_0x57cfc7||0xcc;return function(_0x1ea6e6){if(_0x1ea6e6){return _0x4e303e[_0xf743('0x16')](_0x57cfc7);}return _0x4e303e['status'](_0x57cfc7)[_0xf743('0x17')]();};}function respondWithResult(_0x249b76,_0x4365a3){_0x4365a3=_0x4365a3||0xc8;return function(_0x178a27){if(_0x178a27){return _0x249b76[_0xf743('0x18')](_0x4365a3)[_0xf743('0x19')](_0x178a27);}};}function respondWithFilteredResult(_0x334788,_0x56db9e){return function(_0x5ae0b3){if(_0x5ae0b3){var _0x3815f9=_0x5ae0b3[_0xf743('0x1a')],_0x5546fa=_0x56db9e[_0xf743('0x1b')],_0x4a22a9=_0x56db9e[_0xf743('0x1b')]+_0x56db9e['limit'],_0x1e2e05;if(_0x4a22a9>=_0x3815f9){_0x4a22a9=_0x3815f9;_0x1e2e05=0xc8;}else{_0x1e2e05=0xce;}_0x334788[_0xf743('0x18')](_0x1e2e05);return _0x334788[_0xf743('0x1c')]('Content-Range',_0x5546fa+'-'+_0x4a22a9+'/'+_0x3815f9)[_0xf743('0x19')](_0x5ae0b3);}return null;};}function patchUpdates(_0x51ee3c){return function(_0x5e5973){try{jsonpatch[_0xf743('0x1d')](_0x5e5973,_0x51ee3c,!![]);}catch(_0x41a740){return BPromise[_0xf743('0x1e')](_0x41a740);}return _0x5e5973[_0xf743('0x1f')]();};}function saveUpdates(_0x18b7fa,_0x52df54){return function(_0x3d6c08){if(_0x3d6c08){return _0x3d6c08['update'](_0x18b7fa)['then'](function(_0x1297ff){return _0x1297ff;});}return null;};}function removeEntity(_0x584ad9,_0x1e4f5d){return function(_0x2231e7){if(_0x2231e7){return _0x2231e7['destroy']()[_0xf743('0x20')](function(){var _0x57ced3=_0x2231e7[_0xf743('0x21')]({'plain':!![]});var _0x29cccc=_0xf743('0x22');return db[_0xf743('0x23')]['destroy']({'where':{'type':_0x29cccc,'resourceId':_0x57ced3['id']}})[_0xf743('0x20')](function(){return _0x2231e7;});})['then'](function(){_0x584ad9['status'](0xcc)[_0xf743('0x17')]();});}};}function handleEntityNotFound(_0x46691b,_0x150e10){return function(_0x20c666){if(!_0x20c666){_0x46691b[_0xf743('0x16')](0x194);}return _0x20c666;};}function handleError(_0x328604,_0x4c4163){_0x4c4163=_0x4c4163||0x1f4;return function(_0xc3a2f9){logger[_0xf743('0x24')](_0xc3a2f9[_0xf743('0x25')]);if(_0xc3a2f9[_0xf743('0x26')]){delete _0xc3a2f9[_0xf743('0x26')];}_0x328604['status'](_0x4c4163)['send'](_0xc3a2f9);};}exports[_0xf743('0x27')]=function(_0xa7d482,_0x3f819e){var _0x1d152d={},_0x357f51={},_0x578b80={'count':0x0,'rows':[]};var _0x294ec9=db[_0xf743('0x28')][_0xf743('0x29')];_0x357f51['model']=_['keys'](_0x294ec9);_0x357f51['query']=_[_0xf743('0x2a')](_0xa7d482[_0xf743('0x2b')]);_0x357f51[_0xf743('0x2c')]=_[_0xf743('0x2d')](_0x357f51[_0xf743('0x2e')],_0x357f51[_0xf743('0x2b')]);_0x1d152d[_0xf743('0x2f')]=_[_0xf743('0x2d')](_0x357f51[_0xf743('0x2e')],qs[_0xf743('0x30')](_0xa7d482['query'][_0xf743('0x30')]));_0x1d152d[_0xf743('0x2f')]=_0x1d152d[_0xf743('0x2f')][_0xf743('0x31')]?_0x1d152d[_0xf743('0x2f')]:_0x357f51[_0xf743('0x2e')];if(!_0xa7d482[_0xf743('0x2b')][_0xf743('0x32')]('nolimit')){_0x1d152d[_0xf743('0x33')]=qs[_0xf743('0x33')](_0xa7d482[_0xf743('0x2b')][_0xf743('0x33')]);_0x1d152d[_0xf743('0x1b')]=qs[_0xf743('0x1b')](_0xa7d482[_0xf743('0x2b')][_0xf743('0x1b')]);}_0x1d152d['order']=qs['sort'](_0xa7d482[_0xf743('0x2b')][_0xf743('0x34')]);_0x1d152d[_0xf743('0x35')]=qs[_0xf743('0x2c')](_['pick'](_0xa7d482['query'],_0x357f51['filters']));if(_0xa7d482[_0xf743('0x2b')][_0xf743('0x36')]){_0x1d152d[_0xf743('0x35')]=_[_0xf743('0x37')](_0x1d152d[_0xf743('0x35')],{'$or':_[_0xf743('0x38')](_0x294ec9,function(_0x4ac563){if(_0x4ac563[_0xf743('0x39')]['key']!==_0xf743('0x3a')){var _0x52db96={};_0x52db96[_0x4ac563[_0xf743('0x3b')]]={'$like':'%'+_0xa7d482[_0xf743('0x2b')][_0xf743('0x36')]+'%'};return _0x52db96;}})});}_0x1d152d=_[_0xf743('0x37')]({},_0x1d152d,_0xa7d482[_0xf743('0x3c')]);var _0x2a34d4={'where':_0x1d152d[_0xf743('0x35')]};return db[_0xf743('0x28')][_0xf743('0x1a')](_0x2a34d4)[_0xf743('0x20')](function(_0x1f4f4e){_0x578b80[_0xf743('0x1a')]=_0x1f4f4e;if(_0xa7d482[_0xf743('0x2b')]['includeAll']){_0x1d152d[_0xf743('0x3d')]=[{'all':!![]}];}return db[_0xf743('0x28')]['findAll'](_0x1d152d);})[_0xf743('0x20')](function(_0x56730d){_0x578b80['rows']=_0x56730d;return _0x578b80;})['then'](respondWithFilteredResult(_0x3f819e,_0x1d152d))['catch'](handleError(_0x3f819e,null));};exports[_0xf743('0x3e')]=function(_0x329333,_0x4abfdc){var _0x12379f={'raw':![],'where':{'id':_0x329333[_0xf743('0x3f')]['id']}},_0xfaf275={};_0xfaf275[_0xf743('0x2e')]=_[_0xf743('0x2a')](db[_0xf743('0x28')][_0xf743('0x29')]);_0xfaf275[_0xf743('0x2b')]=_[_0xf743('0x2a')](_0x329333[_0xf743('0x2b')]);_0xfaf275['filters']=_[_0xf743('0x2d')](_0xfaf275[_0xf743('0x2e')],_0xfaf275[_0xf743('0x2b')]);_0x12379f['attributes']=_['intersection'](_0xfaf275[_0xf743('0x2e')],qs[_0xf743('0x30')](_0x329333[_0xf743('0x2b')]['fields']));_0x12379f[_0xf743('0x2f')]=_0x12379f['attributes'][_0xf743('0x31')]?_0x12379f['attributes']:_0xfaf275[_0xf743('0x2e')];if(_0x329333[_0xf743('0x2b')][_0xf743('0x40')]){_0x12379f['include']=[{'all':!![]}];}_0x12379f=_[_0xf743('0x37')]({},_0x12379f,_0x329333[_0xf743('0x3c')]);return db[_0xf743('0x28')][_0xf743('0x41')](_0x12379f)[_0xf743('0x20')](handleEntityNotFound(_0x4abfdc,null))[_0xf743('0x20')](respondWithResult(_0x4abfdc,null))['catch'](handleError(_0x4abfdc,null));};exports[_0xf743('0x42')]=function(_0x31547,_0x2f19e3){if(_0x31547[_0xf743('0x43')]['id']){delete _0x31547[_0xf743('0x43')]['id'];}return db[_0xf743('0x28')]['find']({'where':{'id':_0x31547[_0xf743('0x3f')]['id']}})[_0xf743('0x20')](handleEntityNotFound(_0x2f19e3,null))[_0xf743('0x20')](saveUpdates(_0x31547['body'],null))['then'](respondWithResult(_0x2f19e3,null))['catch'](handleError(_0x2f19e3,null));};exports[_0xf743('0x44')]=function(_0x144ab5,_0x3aaaa3,_0x10e49b){return db[_0xf743('0x45')][_0xf743('0x46')](function(_0x218b4d){if(_0x144ab5['body'][_0xf743('0x47')]==='files'){_0x144ab5[_0xf743('0x43')][_0xf743('0x48')]=path[_0xf743('0x49')](config[_0xf743('0x4a')],'server/files/moh',_0x144ab5[_0xf743('0x43')][_0xf743('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x144ab5['body'],{'transaction':_0x218b4d})['then'](function(_0x2eca8b){if(_0x144ab5[_0xf743('0x43')][_0xf743('0x47')]===_0xf743('0x4b')){fs['mkdirSync'](_0x2eca8b[_0xf743('0x48')],parseInt('0777',0x8));}var _0x223b41=_0x144ab5[_0xf743('0x4c')]['get']({'plain':!![]});if(!_0x223b41)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x223b41['role']==='user'){var _0x26fec3=_0x2eca8b[_0xf743('0x21')]({'plain':!![]});return db[_0xf743('0x4d')][_0xf743('0x41')]({'where':{'name':'MusicOnHolds','userProfileId':_0x223b41[_0xf743('0x4e')]},'raw':!![]})['then'](function(_0x5938cd){if(_0x5938cd&&_0x5938cd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x26fec3[_0xf743('0x26')],'resourceId':_0x26fec3['id'],'type':_0x5938cd[_0xf743('0x26')],'sectionId':_0x5938cd['id']},{})['then'](function(){return _0x2eca8b;});}else{return _0x2eca8b;}})[_0xf743('0x4f')](function(_0x32d36b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d36b);});}return _0x2eca8b;});})[_0xf743('0x20')](respondWithResult(_0x3aaaa3,0xc9))['catch'](handleError(_0x3aaaa3,null));};exports['destroy']=function(_0x41680f,_0x7c7f,_0x12e8f2){var _0x4268ab;return db[_0xf743('0x28')]['find']({'where':{'id':_0x41680f[_0xf743('0x3f')]['id']}})[_0xf743('0x20')](function(_0x1c5774){if(_0x1c5774){return db[_0xf743('0x45')][_0xf743('0x46')](function(_0x35b86d){return _0x1c5774['destroy']({'transaction':_0x35b86d,'raw':!![]})[_0xf743('0x20')](function(_0x5c8f41){if(_0x5c8f41[_0xf743('0x48')]){fs[_0xf743('0x50')](_0x5c8f41[_0xf743('0x48')])[_0xf743('0x51')](function(_0x31ba0b){fs[_0xf743('0x52')](path[_0xf743('0x49')](_0x5c8f41[_0xf743('0x48')],_0x31ba0b));});fs['rmdirSync'](_0x5c8f41[_0xf743('0x48')]);}return _0x5c8f41;});})[_0xf743('0x4f')](function(_0x28f2df){throw new db[(_0xf743('0x53'))][(_0xf743('0x54'))](_0x28f2df[_0xf743('0x55')]);});}})[_0xf743('0x20')](handleEntityNotFound(_0x7c7f,null))['then'](removeEntity(_0x7c7f,null))[_0xf743('0x4f')](handleError(_0x7c7f,null));};exports[_0xf743('0x56')]=function(_0x1b94c8,_0x5b8deb,_0x6d9ba3){return db['sequelize'][_0xf743('0x46')](function(_0xc91595){var _0x341b55;return db[_0xf743('0x28')][_0xf743('0x41')]({'where':{'id':_0x1b94c8['params']['id']}})[_0xf743('0x20')](function(_0x2a01ca){if(_0x2a01ca){_0x341b55=_0x2a01ca;return _0x2a01ca['addSound'](_0x1b94c8['body']['id'],{'transaction':_0xc91595});}})[_0xf743('0x20')](function(_0x8721de){if(_0x8721de){return db['Sound'][_0xf743('0x57')]({'where':{'id':_0x1b94c8['body']['id']},'attributes':['id',_0xf743('0x26'),_0xf743('0x58'),_0xf743('0x59'),_0xf743('0x5a')],'raw':!![]});}})[_0xf743('0x20')](function(_0x3a3e13){if(_0x3a3e13){var _0x41f231=path[_0xf743('0x49')](config[_0xf743('0x4a')],_0xf743('0x5b'),util[_0xf743('0x5c')](_0xf743('0x5d'),path[_0xf743('0x5e')](_0x3a3e13[_0xf743('0x58')],path[_0xf743('0x5f')](_0x3a3e13['save_name'])),_0x3a3e13[_0xf743('0x59')]));var _0x25c3e8=path[_0xf743('0x49')](config[_0xf743('0x4a')],_0xf743('0x60'),_0x341b55[_0xf743('0x26')],util['format'](_0xf743('0x5d'),_0x3a3e13[_0xf743('0x26')],_0x3a3e13['converted_format']));fs[_0xf743('0x61')](_0x41f231,_0x25c3e8);return _0x3a3e13;}})[_0xf743('0x4f')](function(_0x41fce2){throw new db[(_0xf743('0x53'))]['ValidationError'](_0x41fce2['message']);});})[_0xf743('0x20')](handleEntityNotFound(_0x5b8deb,null))[_0xf743('0x20')](respondWithResult(_0x5b8deb,0xc9))[_0xf743('0x4f')](handleError(_0x5b8deb,null));};exports[_0xf743('0x62')]=function(_0x1379ef,_0x42501c,_0x352637){return db['sequelize'][_0xf743('0x46')](function(_0x23ab9d){var _0x45eee3;return db[_0xf743('0x28')]['findOne']({'where':{'id':_0x1379ef['params']['id']}})[_0xf743('0x20')](handleEntityNotFound(_0x42501c,null))['then'](function(_0x6d31e5){if(_0x6d31e5){_0x45eee3=_0x6d31e5;return _0x6d31e5['removeSound'](_0x1379ef['params'][_0xf743('0x63')]);}})[_0xf743('0x20')](function(_0x374911){if(_0x374911){return db[_0xf743('0x64')]['findOne']({'where':{'id':_0x1379ef[_0xf743('0x3f')][_0xf743('0x63')]},'attributes':['id',_0xf743('0x26'),_0xf743('0x58'),_0xf743('0x59'),_0xf743('0x5a')],'raw':!![]});}})[_0xf743('0x20')](function(_0xa32749){if(_0xa32749){fs[_0xf743('0x52')](path[_0xf743('0x49')](_0x45eee3['directory'],util[_0xf743('0x5c')](_0xf743('0x5d'),_0xa32749[_0xf743('0x26')],_0xa32749[_0xf743('0x59')])));return _0xa32749;}})[_0xf743('0x4f')](function(_0x109262){throw new db[(_0xf743('0x53'))][(_0xf743('0x54'))](_0x109262[_0xf743('0x55')]);});})[_0xf743('0x20')](handleEntityNotFound(_0x42501c,null))[_0xf743('0x20')](respondWithStatusCode(_0x42501c,0xcc))[_0xf743('0x4f')](handleError(_0x42501c,null));};exports[_0xf743('0x65')]=function(_0x2581f3,_0x25921c,_0x367e9a){var _0x4a0b6d={};var _0x4e636f={};var _0x522b37;var _0x2933c7;return db[_0xf743('0x28')][_0xf743('0x57')]({'where':{'id':_0x2581f3['params']['id']}})[_0xf743('0x20')](handleEntityNotFound(_0x25921c,null))[_0xf743('0x20')](function(_0x3bccda){if(_0x3bccda){_0x522b37=_0x3bccda;_0x4e636f['model']=_[_0xf743('0x2a')](db[_0xf743('0x64')][_0xf743('0x29')]);_0x4e636f[_0xf743('0x2b')]=_['keys'](_0x2581f3[_0xf743('0x2b')]);_0x4e636f[_0xf743('0x2c')]=_[_0xf743('0x2d')](_0x4e636f[_0xf743('0x2e')],_0x4e636f[_0xf743('0x2b')]);_0x4a0b6d[_0xf743('0x2f')]=_[_0xf743('0x2d')](_0x4e636f[_0xf743('0x2e')],qs[_0xf743('0x30')](_0x2581f3[_0xf743('0x2b')][_0xf743('0x30')]));_0x4a0b6d[_0xf743('0x2f')]=_0x4a0b6d[_0xf743('0x2f')][_0xf743('0x31')]?_0x4a0b6d[_0xf743('0x2f')]:_0x4e636f['model'];_0x4a0b6d['order']=qs[_0xf743('0x34')](_0x2581f3[_0xf743('0x2b')]['sort']);_0x4a0b6d[_0xf743('0x35')]=qs['filters'](_[_0xf743('0x66')](_0x2581f3[_0xf743('0x2b')],_0x4e636f[_0xf743('0x2c')]));if(_0x2581f3[_0xf743('0x2b')][_0xf743('0x36')]){_0x4a0b6d[_0xf743('0x35')]=_['merge'](_0x4a0b6d[_0xf743('0x35')],{'$or':_[_0xf743('0x38')](_0x4a0b6d[_0xf743('0x2f')],function(_0x29106a){var _0x4c7143={};_0x4c7143[_0x29106a]={'$like':'%'+_0x2581f3[_0xf743('0x2b')][_0xf743('0x36')]+'%'};return _0x4c7143;})});}_0x4a0b6d=_[_0xf743('0x37')]({},_0x4a0b6d,_0x2581f3[_0xf743('0x3c')]);return _0x522b37['getSounds'](_0x4a0b6d);}})['then'](function(_0x253e55){if(_0x253e55){_0x2933c7=_0x253e55['length'];if(!_0x2581f3[_0xf743('0x2b')][_0xf743('0x32')](_0xf743('0x67'))){_0x4a0b6d['limit']=qs[_0xf743('0x33')](_0x2581f3['query'][_0xf743('0x33')]);_0x4a0b6d[_0xf743('0x1b')]=qs['offset'](_0x2581f3[_0xf743('0x2b')][_0xf743('0x1b')]);}return _0x522b37['getSounds'](_0x4a0b6d);}})[_0xf743('0x20')](function(_0x2ed72b){if(_0x2ed72b){return _0x2ed72b?{'count':_0x2933c7,'rows':_0x2ed72b}:null;}})[_0xf743('0x20')](respondWithResult(_0x25921c,null))[_0xf743('0x4f')](handleError(_0x25921c,null));}; \ No newline at end of file +var _0x24c2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','symlinkSync','removeSound','id2','Sound','getSounds','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','VoiceMusicOnHold','findAll','catch','show','params','body','find','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','get'];(function(_0x19aa40,_0xb3e1d6){var _0x25ab09=function(_0x2cf914){while(--_0x2cf914){_0x19aa40['push'](_0x19aa40['shift']());}};_0x25ab09(++_0xb3e1d6);}(_0x24c2,0x16f));var _0x224c=function(_0x47165e,_0x55dd13){_0x47165e=_0x47165e-0x0;var _0x266f19=_0x24c2[_0x47165e];return _0x266f19;};'use strict';var pdf=require(_0x224c('0x0'));var emlformat=require(_0x224c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x224c('0x2'));var jsonpatch=require(_0x224c('0x3'));var rp=require(_0x224c('0x4'));var moment=require(_0x224c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x224c('0x6'));var util=require(_0x224c('0x7'));var path=require(_0x224c('0x8'));var sox=require(_0x224c('0x9'));var csv=require(_0x224c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x224c('0xb'));var squel=require(_0x224c('0xc'));var crypto=require(_0x224c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x224c('0xe'));var toCsv=require(_0x224c('0xa'));var querystring=require(_0x224c('0xf'));var Papa=require(_0x224c('0x10'));var Redis=require('ioredis');var authService=require(_0x224c('0x11'));var qs=require(_0x224c('0x12'));var hardwareService=require(_0x224c('0x13'));var logger=require('../../config/logger')(_0x224c('0x14'));var utils=require(_0x224c('0x15'));var config=require('../../config/environment');var db=require(_0x224c('0x16'))['db'];function respondWithStatusCode(_0xc05745,_0x832348){_0x832348=_0x832348||0xcc;return function(_0x5e48c6){if(_0x5e48c6){return _0xc05745[_0x224c('0x17')](_0x832348);}return _0xc05745['status'](_0x832348)[_0x224c('0x18')]();};}function respondWithResult(_0x35b870,_0x398ae1){_0x398ae1=_0x398ae1||0xc8;return function(_0x26c819){if(_0x26c819){return _0x35b870[_0x224c('0x19')](_0x398ae1)['json'](_0x26c819);}};}function respondWithFilteredResult(_0x1a5001,_0x402c41){return function(_0x29ac42){if(_0x29ac42){var _0x26aa71=_0x29ac42[_0x224c('0x1a')],_0x504b20=_0x402c41['offset'],_0x581c56=_0x402c41[_0x224c('0x1b')]+_0x402c41[_0x224c('0x1c')],_0x47b3da;if(_0x581c56>=_0x26aa71){_0x581c56=_0x26aa71;_0x47b3da=0xc8;}else{_0x47b3da=0xce;}_0x1a5001[_0x224c('0x19')](_0x47b3da);return _0x1a5001[_0x224c('0x1d')](_0x224c('0x1e'),_0x504b20+'-'+_0x581c56+'/'+_0x26aa71)['json'](_0x29ac42);}return null;};}function patchUpdates(_0x13db81){return function(_0x1dc6f8){try{jsonpatch['apply'](_0x1dc6f8,_0x13db81,!![]);}catch(_0x10f6e0){return BPromise[_0x224c('0x1f')](_0x10f6e0);}return _0x1dc6f8[_0x224c('0x20')]();};}function saveUpdates(_0x41a447,_0x1c762a){return function(_0x56ae9e){if(_0x56ae9e){return _0x56ae9e[_0x224c('0x21')](_0x41a447)[_0x224c('0x22')](function(_0x2c6589){return _0x2c6589;});}return null;};}function removeEntity(_0x2a422b,_0x861ceb){return function(_0x4ae61e){if(_0x4ae61e){return _0x4ae61e[_0x224c('0x23')]()[_0x224c('0x22')](function(){var _0x4e5708=_0x4ae61e['get']({'plain':!![]});var _0x6aa65c=_0x224c('0x24');return db[_0x224c('0x25')][_0x224c('0x23')]({'where':{'type':_0x6aa65c,'resourceId':_0x4e5708['id']}})[_0x224c('0x22')](function(){return _0x4ae61e;});})['then'](function(){_0x2a422b[_0x224c('0x19')](0xcc)[_0x224c('0x18')]();});}};}function handleEntityNotFound(_0x24419e,_0x3414b2){return function(_0x48db78){if(!_0x48db78){_0x24419e[_0x224c('0x17')](0x194);}return _0x48db78;};}function handleError(_0x444f74,_0x3278d7){_0x3278d7=_0x3278d7||0x1f4;return function(_0x5c5777){logger[_0x224c('0x26')](_0x5c5777[_0x224c('0x27')]);if(_0x5c5777[_0x224c('0x28')]){delete _0x5c5777[_0x224c('0x28')];}_0x444f74[_0x224c('0x19')](_0x3278d7)[_0x224c('0x29')](_0x5c5777);};}exports['index']=function(_0x43e65d,_0x1a71c1){var _0x1d19db={},_0x161555={},_0xd74fe6={'count':0x0,'rows':[]};var _0x411fe5=db['VoiceMusicOnHold'][_0x224c('0x2a')];_0x161555[_0x224c('0x2b')]=_[_0x224c('0x2c')](_0x411fe5);_0x161555['query']=_['keys'](_0x43e65d[_0x224c('0x2d')]);_0x161555[_0x224c('0x2e')]=_[_0x224c('0x2f')](_0x161555[_0x224c('0x2b')],_0x161555['query']);_0x1d19db['attributes']=_[_0x224c('0x2f')](_0x161555[_0x224c('0x2b')],qs[_0x224c('0x30')](_0x43e65d[_0x224c('0x2d')][_0x224c('0x30')]));_0x1d19db['attributes']=_0x1d19db[_0x224c('0x31')][_0x224c('0x32')]?_0x1d19db[_0x224c('0x31')]:_0x161555[_0x224c('0x2b')];if(!_0x43e65d[_0x224c('0x2d')][_0x224c('0x33')](_0x224c('0x34'))){_0x1d19db[_0x224c('0x1c')]=qs[_0x224c('0x1c')](_0x43e65d[_0x224c('0x2d')][_0x224c('0x1c')]);_0x1d19db[_0x224c('0x1b')]=qs[_0x224c('0x1b')](_0x43e65d[_0x224c('0x2d')][_0x224c('0x1b')]);}_0x1d19db[_0x224c('0x35')]=qs[_0x224c('0x36')](_0x43e65d[_0x224c('0x2d')][_0x224c('0x36')]);_0x1d19db['where']=qs[_0x224c('0x2e')](_[_0x224c('0x37')](_0x43e65d[_0x224c('0x2d')],_0x161555[_0x224c('0x2e')]));if(_0x43e65d[_0x224c('0x2d')][_0x224c('0x38')]){_0x1d19db[_0x224c('0x39')]=_[_0x224c('0x3a')](_0x1d19db['where'],{'$or':_[_0x224c('0x3b')](_0x411fe5,function(_0x51f0f1){if(_0x51f0f1[_0x224c('0x3c')][_0x224c('0x3d')]!==_0x224c('0x3e')){var _0x1beb77={};_0x1beb77[_0x51f0f1[_0x224c('0x3f')]]={'$like':'%'+_0x43e65d['query']['filter']+'%'};return _0x1beb77;}})});}_0x1d19db=_[_0x224c('0x3a')]({},_0x1d19db,_0x43e65d[_0x224c('0x40')]);var _0x618147={'where':_0x1d19db['where']};return db['VoiceMusicOnHold']['count'](_0x618147)['then'](function(_0x492643){_0xd74fe6['count']=_0x492643;if(_0x43e65d['query'][_0x224c('0x41')]){_0x1d19db[_0x224c('0x42')]=[{'all':!![]}];}return db[_0x224c('0x43')][_0x224c('0x44')](_0x1d19db);})[_0x224c('0x22')](function(_0xaa5928){_0xd74fe6['rows']=_0xaa5928;return _0xd74fe6;})['then'](respondWithFilteredResult(_0x1a71c1,_0x1d19db))[_0x224c('0x45')](handleError(_0x1a71c1,null));};exports[_0x224c('0x46')]=function(_0x9bfbe5,_0x55a459){var _0x2d182a={'raw':![],'where':{'id':_0x9bfbe5[_0x224c('0x47')]['id']}},_0x214b87={};_0x214b87['model']=_[_0x224c('0x2c')](db['VoiceMusicOnHold']['rawAttributes']);_0x214b87[_0x224c('0x2d')]=_[_0x224c('0x2c')](_0x9bfbe5[_0x224c('0x2d')]);_0x214b87[_0x224c('0x2e')]=_[_0x224c('0x2f')](_0x214b87['model'],_0x214b87[_0x224c('0x2d')]);_0x2d182a['attributes']=_[_0x224c('0x2f')](_0x214b87[_0x224c('0x2b')],qs[_0x224c('0x30')](_0x9bfbe5[_0x224c('0x2d')]['fields']));_0x2d182a[_0x224c('0x31')]=_0x2d182a['attributes']['length']?_0x2d182a[_0x224c('0x31')]:_0x214b87['model'];if(_0x9bfbe5[_0x224c('0x2d')][_0x224c('0x41')]){_0x2d182a['include']=[{'all':!![]}];}_0x2d182a=_['merge']({},_0x2d182a,_0x9bfbe5[_0x224c('0x40')]);return db['VoiceMusicOnHold']['find'](_0x2d182a)[_0x224c('0x22')](handleEntityNotFound(_0x55a459,null))['then'](respondWithResult(_0x55a459,null))[_0x224c('0x45')](handleError(_0x55a459,null));};exports[_0x224c('0x21')]=function(_0x2bc5d9,_0x1ddf6a){if(_0x2bc5d9[_0x224c('0x48')]['id']){delete _0x2bc5d9['body']['id'];}return db[_0x224c('0x43')][_0x224c('0x49')]({'where':{'id':_0x2bc5d9[_0x224c('0x47')]['id']}})[_0x224c('0x22')](handleEntityNotFound(_0x1ddf6a,null))[_0x224c('0x22')](saveUpdates(_0x2bc5d9[_0x224c('0x48')],null))[_0x224c('0x22')](respondWithResult(_0x1ddf6a,null))[_0x224c('0x45')](handleError(_0x1ddf6a,null));};exports[_0x224c('0x4a')]=function(_0xd8e17f,_0x48988a,_0x407694){return db['sequelize'][_0x224c('0x4b')](function(_0x8bf658){if(_0xd8e17f[_0x224c('0x48')][_0x224c('0x4c')]===_0x224c('0x4d')){_0xd8e17f[_0x224c('0x48')][_0x224c('0x4e')]=path[_0x224c('0x4f')](config[_0x224c('0x50')],_0x224c('0x51'),_0xd8e17f[_0x224c('0x48')][_0x224c('0x28')]);}return db['VoiceMusicOnHold']['create'](_0xd8e17f[_0x224c('0x48')],{'transaction':_0x8bf658})[_0x224c('0x22')](function(_0x57801a){if(_0xd8e17f[_0x224c('0x48')][_0x224c('0x4c')]===_0x224c('0x4d')){fs[_0x224c('0x52')](_0x57801a[_0x224c('0x4e')],parseInt(_0x224c('0x53'),0x8));}var _0xe44f58=_0xd8e17f['user'][_0x224c('0x54')]({'plain':!![]});if(!_0xe44f58)throw new Error(_0x224c('0x55'));if(_0xe44f58[_0x224c('0x56')]===_0x224c('0x57')){var _0x1a6798=_0x57801a[_0x224c('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x224c('0x49')]({'where':{'name':_0x224c('0x24'),'userProfileId':_0xe44f58[_0x224c('0x58')]},'raw':!![]})[_0x224c('0x22')](function(_0x42d767){if(_0x42d767&&_0x42d767[_0x224c('0x59')]===0x0){return db[_0x224c('0x25')][_0x224c('0x4a')]({'name':_0x1a6798['name'],'resourceId':_0x1a6798['id'],'type':_0x42d767['name'],'sectionId':_0x42d767['id']},{})[_0x224c('0x22')](function(){return _0x57801a;});}else{return _0x57801a;}})['catch'](function(_0x3094a8){logger[_0x224c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3094a8);});}return _0x57801a;});})['then'](respondWithResult(_0x48988a,0xc9))[_0x224c('0x45')](handleError(_0x48988a,null));};exports[_0x224c('0x23')]=function(_0x1ad750,_0x48f1ff,_0x58d5db){var _0xedae2;return db['VoiceMusicOnHold'][_0x224c('0x49')]({'where':{'id':_0x1ad750['params']['id']}})[_0x224c('0x22')](function(_0x2a7810){if(_0x2a7810){return db[_0x224c('0x5a')][_0x224c('0x4b')](function(_0x16bba2){return _0x2a7810[_0x224c('0x23')]({'transaction':_0x16bba2,'raw':!![]})[_0x224c('0x22')](function(_0x136f77){if(_0x136f77[_0x224c('0x4e')]){fs[_0x224c('0x5b')](_0x136f77['directory'])[_0x224c('0x5c')](function(_0x47ef51){fs[_0x224c('0x5d')](path[_0x224c('0x4f')](_0x136f77[_0x224c('0x4e')],_0x47ef51));});fs[_0x224c('0x5e')](_0x136f77[_0x224c('0x4e')]);}return _0x136f77;});})['catch'](function(_0x40c7dd){throw new db[(_0x224c('0x5f'))][(_0x224c('0x60'))](_0x40c7dd[_0x224c('0x61')]);});}})[_0x224c('0x22')](handleEntityNotFound(_0x48f1ff,null))[_0x224c('0x22')](removeEntity(_0x48f1ff,null))[_0x224c('0x45')](handleError(_0x48f1ff,null));};exports[_0x224c('0x62')]=function(_0xd72318,_0x123903,_0xe4e1b6){return db[_0x224c('0x5a')][_0x224c('0x4b')](function(_0x4f5d61){var _0x3e510c;return db['VoiceMusicOnHold'][_0x224c('0x49')]({'where':{'id':_0xd72318[_0x224c('0x47')]['id']}})[_0x224c('0x22')](function(_0x51b838){if(_0x51b838){_0x3e510c=_0x51b838;return _0x51b838[_0x224c('0x62')](_0xd72318['body']['id'],{'transaction':_0x4f5d61});}})[_0x224c('0x22')](function(_0x35bdab){if(_0x35bdab){return db['Sound'][_0x224c('0x63')]({'where':{'id':_0xd72318['body']['id']},'attributes':['id','name','save_name',_0x224c('0x64'),_0x224c('0x65')],'raw':!![]});}})['then'](function(_0x36ffc7){if(_0x36ffc7){var _0x3b9f93=path[_0x224c('0x4f')](config[_0x224c('0x50')],_0x224c('0x66'),util[_0x224c('0x67')](_0x224c('0x68'),path[_0x224c('0x69')](_0x36ffc7[_0x224c('0x6a')],path[_0x224c('0x6b')](_0x36ffc7[_0x224c('0x6a')])),_0x36ffc7[_0x224c('0x64')]));var _0x31f701=path[_0x224c('0x4f')](config[_0x224c('0x50')],_0x224c('0x51'),_0x3e510c[_0x224c('0x28')],util['format'](_0x224c('0x68'),_0x36ffc7['name'],_0x36ffc7[_0x224c('0x64')]));fs[_0x224c('0x6c')](_0x3b9f93,_0x31f701);return _0x36ffc7;}})[_0x224c('0x45')](function(_0x3e741d){throw new db[(_0x224c('0x5f'))]['ValidationError'](_0x3e741d['message']);});})[_0x224c('0x22')](handleEntityNotFound(_0x123903,null))['then'](respondWithResult(_0x123903,0xc9))[_0x224c('0x45')](handleError(_0x123903,null));};exports[_0x224c('0x6d')]=function(_0x16e9ff,_0x3bb907,_0x18deb8){return db[_0x224c('0x5a')][_0x224c('0x4b')](function(_0xec84c8){var _0x485f00;return db['VoiceMusicOnHold'][_0x224c('0x63')]({'where':{'id':_0x16e9ff[_0x224c('0x47')]['id']}})[_0x224c('0x22')](handleEntityNotFound(_0x3bb907,null))[_0x224c('0x22')](function(_0x518d85){if(_0x518d85){_0x485f00=_0x518d85;return _0x518d85[_0x224c('0x6d')](_0x16e9ff['params'][_0x224c('0x6e')]);}})['then'](function(_0x3e1296){if(_0x3e1296){return db[_0x224c('0x6f')][_0x224c('0x63')]({'where':{'id':_0x16e9ff[_0x224c('0x47')][_0x224c('0x6e')]},'attributes':['id',_0x224c('0x28'),_0x224c('0x6a'),'converted_format',_0x224c('0x65')],'raw':!![]});}})[_0x224c('0x22')](function(_0x47c966){if(_0x47c966){fs['unlinkSync'](path['join'](_0x485f00['directory'],util[_0x224c('0x67')](_0x224c('0x68'),_0x47c966[_0x224c('0x28')],_0x47c966['converted_format'])));return _0x47c966;}})['catch'](function(_0xbab719){throw new db[(_0x224c('0x5f'))][(_0x224c('0x60'))](_0xbab719['message']);});})['then'](handleEntityNotFound(_0x3bb907,null))[_0x224c('0x22')](respondWithStatusCode(_0x3bb907,0xcc))[_0x224c('0x45')](handleError(_0x3bb907,null));};exports[_0x224c('0x70')]=function(_0x29b8a6,_0x5d13a3,_0xe9dd3a){var _0x37c6fb={};var _0x52ae35={};var _0xb0c5bb;var _0x25da1b;return db[_0x224c('0x43')]['findOne']({'where':{'id':_0x29b8a6['params']['id']}})[_0x224c('0x22')](handleEntityNotFound(_0x5d13a3,null))['then'](function(_0x408017){if(_0x408017){_0xb0c5bb=_0x408017;_0x52ae35['model']=_[_0x224c('0x2c')](db[_0x224c('0x6f')]['rawAttributes']);_0x52ae35[_0x224c('0x2d')]=_[_0x224c('0x2c')](_0x29b8a6[_0x224c('0x2d')]);_0x52ae35['filters']=_[_0x224c('0x2f')](_0x52ae35[_0x224c('0x2b')],_0x52ae35['query']);_0x37c6fb[_0x224c('0x31')]=_[_0x224c('0x2f')](_0x52ae35['model'],qs[_0x224c('0x30')](_0x29b8a6[_0x224c('0x2d')]['fields']));_0x37c6fb[_0x224c('0x31')]=_0x37c6fb[_0x224c('0x31')]['length']?_0x37c6fb[_0x224c('0x31')]:_0x52ae35['model'];_0x37c6fb[_0x224c('0x35')]=qs[_0x224c('0x36')](_0x29b8a6['query'][_0x224c('0x36')]);_0x37c6fb['where']=qs[_0x224c('0x2e')](_[_0x224c('0x37')](_0x29b8a6[_0x224c('0x2d')],_0x52ae35['filters']));if(_0x29b8a6[_0x224c('0x2d')][_0x224c('0x38')]){_0x37c6fb['where']=_['merge'](_0x37c6fb['where'],{'$or':_[_0x224c('0x3b')](_0x37c6fb['attributes'],function(_0x17e52e){var _0x5edb29={};_0x5edb29[_0x17e52e]={'$like':'%'+_0x29b8a6['query']['filter']+'%'};return _0x5edb29;})});}_0x37c6fb=_['merge']({},_0x37c6fb,_0x29b8a6[_0x224c('0x40')]);return _0xb0c5bb[_0x224c('0x70')](_0x37c6fb);}})[_0x224c('0x22')](function(_0xb64c1a){if(_0xb64c1a){_0x25da1b=_0xb64c1a['length'];if(!_0x29b8a6['query'][_0x224c('0x33')](_0x224c('0x34'))){_0x37c6fb['limit']=qs['limit'](_0x29b8a6[_0x224c('0x2d')]['limit']);_0x37c6fb[_0x224c('0x1b')]=qs['offset'](_0x29b8a6[_0x224c('0x2d')]['offset']);}return _0xb0c5bb[_0x224c('0x70')](_0x37c6fb);}})[_0x224c('0x22')](function(_0xc047bd){if(_0xc047bd){return _0xc047bd?{'count':_0x25da1b,'rows':_0xc047bd}:null;}})['then'](respondWithResult(_0x5d13a3,null))[_0x224c('0x45')](handleError(_0x5d13a3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9654b38..bd03656 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 _0x85b2=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b754a,_0xd7e0a4){var _0x424fde=function(_0x29ff22){while(--_0x29ff22){_0x4b754a['push'](_0x4b754a['shift']());}};_0x424fde(++_0xd7e0a4);}(_0x85b2,0xd8));var _0x285b=function(_0x60434d,_0x52bcdc){_0x60434d=_0x60434d-0x0;var _0x1fbd30=_0x85b2[_0x60434d];return _0x1fbd30;};'use strict';var _=require(_0x285b('0x0'));var util=require(_0x285b('0x1'));var logger=require(_0x285b('0x2'))(_0x285b('0x3'));var moment=require(_0x285b('0x4'));var BPromise=require(_0x285b('0x5'));var rp=require(_0x285b('0x6'));var fs=require('fs');var path=require(_0x285b('0x7'));var rimraf=require(_0x285b('0x8'));var config=require(_0x285b('0x9'));var attributes=require(_0x285b('0xa'));module[_0x285b('0xb')]=function(_0x2dda0d,_0xc19f46){return _0x2dda0d[_0x285b('0xc')](_0x285b('0xd'),attributes,{'tableName':_0x285b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x040a=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','lodash','util'];(function(_0x2f01a0,_0x1c30e5){var _0x5d0257=function(_0x5cfc31){while(--_0x5cfc31){_0x2f01a0['push'](_0x2f01a0['shift']());}};_0x5d0257(++_0x1c30e5);}(_0x040a,0x13d));var _0xa040=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x040a[_0x31b31b];return _0x2c8fc2;};'use strict';var _=require(_0xa040('0x0'));var util=require(_0xa040('0x1'));var logger=require('../../config/logger')(_0xa040('0x2'));var moment=require(_0xa040('0x3'));var BPromise=require(_0xa040('0x4'));var rp=require(_0xa040('0x5'));var fs=require('fs');var path=require(_0xa040('0x6'));var rimraf=require('rimraf');var config=require(_0xa040('0x7'));var attributes=require(_0xa040('0x8'));module[_0xa040('0x9')]=function(_0x482588,_0x16996b){return _0x482588['define']('VoiceMusicOnHold',attributes,{'tableName':_0xa040('0xa'),'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 1ffdb72..8047dd5 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 _0xf8c7=['VoiceMusicOnHold,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x418b68,_0x5d3f24){var _0x1ebc60=function(_0x1a0c79){while(--_0x1a0c79){_0x418b68['push'](_0x418b68['shift']());}};_0x1ebc60(++_0x5d3f24);}(_0xf8c7,0x110));var _0x7f8c=function(_0x305875,_0x49ba22){_0x305875=_0x305875-0x0;var _0x2e3c1f=_0xf8c7[_0x305875];return _0x2e3c1f;};'use strict';var _=require(_0x7f8c('0x0'));var util=require(_0x7f8c('0x1'));var moment=require(_0x7f8c('0x2'));var BPromise=require(_0x7f8c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f8c('0x4'));var db=require(_0x7f8c('0x5'))['db'];var utils=require(_0x7f8c('0x6'));var logger=require(_0x7f8c('0x7'))('rpc');var config=require(_0x7f8c('0x8'));var jayson=require(_0x7f8c('0x9'));var client=jayson[_0x7f8c('0xa')][_0x7f8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32f454,_0x467c6d,_0x985d90){return new BPromise(function(_0x20ea9f,_0x308778){return client['request'](_0x32f454,_0x985d90)[_0x7f8c('0xc')](function(_0x602217){logger[_0x7f8c('0xd')](_0x7f8c('0xe'),_0x467c6d,'request\x20sent');logger[_0x7f8c('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x467c6d,_0x7f8c('0x10'),JSON[_0x7f8c('0x11')](_0x602217));if(_0x602217[_0x7f8c('0x12')]){if(_0x602217['error']['code']===0x1f4){logger[_0x7f8c('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x467c6d,_0x602217[_0x7f8c('0x12')]['message']);return _0x308778(_0x602217[_0x7f8c('0x12')][_0x7f8c('0x13')]);}logger['error'](_0x7f8c('0xe'),_0x467c6d,_0x602217[_0x7f8c('0x12')][_0x7f8c('0x13')]);return _0x20ea9f(_0x602217[_0x7f8c('0x12')][_0x7f8c('0x13')]);}else{logger[_0x7f8c('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x467c6d,_0x7f8c('0x10'));_0x20ea9f(_0x602217[_0x7f8c('0x14')]['message']);}})[_0x7f8c('0x15')](function(_0x211d8c){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x467c6d,_0x211d8c);_0x308778(_0x211d8c);});});} \ No newline at end of file +var _0xc426=['client','http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc426,0xfe));var _0x6c42=function(_0xc6f553,_0x532be0){_0xc6f553=_0xc6f553-0x0;var _0x497ea8=_0xc426[_0xc6f553];return _0x497ea8;};'use strict';var _=require(_0x6c42('0x0'));var util=require('util');var moment=require(_0x6c42('0x1'));var BPromise=require(_0x6c42('0x2'));var rs=require(_0x6c42('0x3'));var fs=require('fs');var Redis=require(_0x6c42('0x4'));var db=require(_0x6c42('0x5'))['db'];var utils=require(_0x6c42('0x6'));var logger=require(_0x6c42('0x7'))(_0x6c42('0x8'));var config=require(_0x6c42('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c42('0xa')][_0x6c42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f7c6c,_0x559423,_0x3e7849){return new BPromise(function(_0x59e7b1,_0x52fdbd){return client['request'](_0x1f7c6c,_0x3e7849)['then'](function(_0x1ab13f){logger[_0x6c42('0xc')](_0x6c42('0xd'),_0x559423,_0x6c42('0xe'));logger['debug'](_0x6c42('0xf'),_0x559423,'request\x20sent',JSON[_0x6c42('0x10')](_0x1ab13f));if(_0x1ab13f[_0x6c42('0x11')]){if(_0x1ab13f[_0x6c42('0x11')][_0x6c42('0x12')]===0x1f4){logger[_0x6c42('0x11')](_0x6c42('0xd'),_0x559423,_0x1ab13f[_0x6c42('0x11')][_0x6c42('0x13')]);return _0x52fdbd(_0x1ab13f['error'][_0x6c42('0x13')]);}logger[_0x6c42('0x11')](_0x6c42('0xd'),_0x559423,_0x1ab13f[_0x6c42('0x11')][_0x6c42('0x13')]);return _0x59e7b1(_0x1ab13f[_0x6c42('0x11')][_0x6c42('0x13')]);}else{logger[_0x6c42('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x559423,_0x6c42('0xe'));_0x59e7b1(_0x1ab13f[_0x6c42('0x14')]['message']);}})[_0x6c42('0x15')](function(_0x15b6b8){logger[_0x6c42('0x11')](_0x6c42('0xd'),_0x559423,_0x15b6b8);_0x52fdbd(_0x15b6b8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e0986a3..50f94c0 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 _0xada2=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeAgents','exports'];(function(_0x43706f,_0x236d00){var _0x48041c=function(_0x22a049){while(--_0x22a049){_0x43706f['push'](_0x43706f['shift']());}};_0x48041c(++_0x236d00);}(_0xada2,0xfd));var _0x2ada=function(_0x3dbffe,_0x4c0475){_0x3dbffe=_0x3dbffe-0x0;var _0x326bab=_0xada2[_0x3dbffe];return _0x326bab;};'use strict';var multer=require(_0x2ada('0x0'));var util=require(_0x2ada('0x1'));var path=require(_0x2ada('0x2'));var timeout=require(_0x2ada('0x3'));var express=require('express');var router=express[_0x2ada('0x4')]();var auth=require(_0x2ada('0x5'));var interaction=require(_0x2ada('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x2ada('0x7')]('/',auth[_0x2ada('0x8')](),controller[_0x2ada('0x9')]);router[_0x2ada('0x7')](_0x2ada('0xa'),auth[_0x2ada('0x8')](),controller[_0x2ada('0xb')]);router[_0x2ada('0x7')](_0x2ada('0xc'),auth[_0x2ada('0x8')](),controller['show']);router['get'](_0x2ada('0xd'),auth[_0x2ada('0x8')](),controller[_0x2ada('0xe')]);router[_0x2ada('0xf')]('/',auth[_0x2ada('0x8')](),controller[_0x2ada('0x10')]);router['post'](_0x2ada('0xd'),auth[_0x2ada('0x8')](),controller[_0x2ada('0x11')]);router[_0x2ada('0x12')]('/:id',auth[_0x2ada('0x8')](),controller['update']);router[_0x2ada('0x13')](_0x2ada('0xc'),auth[_0x2ada('0x8')](),controller[_0x2ada('0x14')]);router[_0x2ada('0x13')](_0x2ada('0xd'),auth[_0x2ada('0x8')](),controller[_0x2ada('0x15')]);module[_0x2ada('0x16')]=router; \ No newline at end of file +var _0x2242=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','delete'];(function(_0x302857,_0x3b97c3){var _0x5588d4=function(_0x165524){while(--_0x165524){_0x302857['push'](_0x302857['shift']());}};_0x5588d4(++_0x3b97c3);}(_0x2242,0x1a3));var _0x2224=function(_0x3aba00,_0x5f483e){_0x3aba00=_0x3aba00-0x0;var _0xa37871=_0x2242[_0x3aba00];return _0xa37871;};'use strict';var multer=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var path=require(_0x2224('0x2'));var timeout=require('connect-timeout');var express=require(_0x2224('0x3'));var router=express[_0x2224('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2224('0x5'));var config=require(_0x2224('0x6'));var controller=require('./voicePrefix.controller');router[_0x2224('0x7')]('/',auth[_0x2224('0x8')](),controller[_0x2224('0x9')]);router['get'](_0x2224('0xa'),auth[_0x2224('0x8')](),controller[_0x2224('0xb')]);router[_0x2224('0x7')](_0x2224('0xc'),auth[_0x2224('0x8')](),controller[_0x2224('0xd')]);router[_0x2224('0x7')](_0x2224('0xe'),auth[_0x2224('0x8')](),controller[_0x2224('0xf')]);router[_0x2224('0x10')]('/',auth[_0x2224('0x8')](),controller[_0x2224('0x11')]);router[_0x2224('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x2224('0x12')]);router[_0x2224('0x13')](_0x2224('0xc'),auth[_0x2224('0x8')](),controller['update']);router[_0x2224('0x14')](_0x2224('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2224('0x14')](_0x2224('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2224('0x15')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 78c41b4..1782aae 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 _0x5bd3=['INTEGER','exports','STRING','name','VIRTUAL'];(function(_0x38ab95,_0x51e4db){var _0x1af220=function(_0x130e41){while(--_0x130e41){_0x38ab95['push'](_0x38ab95['shift']());}};_0x1af220(++_0x51e4db);}(_0x5bd3,0x18c));var _0x35bd=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5bd3[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require('sequelize');module[_0x35bd('0x0')]={'name':{'type':Sequelize[_0x35bd('0x1')],'allowNull':![],'unique':_0x35bd('0x2')},'prefix':{'type':Sequelize[_0x35bd('0x3')],'get':function(_0x34947a){return'system-'+this['getDataValue'](_0x35bd('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x35bd('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x35bd('0x4')]}}; \ No newline at end of file +var _0x39cd=['STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x39cd,0xa0));var _0xd39c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x39cd[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0xd39c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd39c('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xd39c('0x2')],'get':function(_0xadac73){return _0xd39c('0x3')+this[_0xd39c('0x4')](_0xd39c('0x5'))+'-';}},'description':{'type':Sequelize[_0xd39c('0x1')]},'callerIdAll':{'type':Sequelize[_0xd39c('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xd39c('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index a860f1e..79df63a 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 _0xe14b=['push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','end','json','count','offset','limit','status','set','apply','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','find','describe','create','sequelize','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed'];(function(_0x1ba441,_0x5f0413){var _0x571bf8=function(_0x4cd08a){while(--_0x4cd08a){_0x1ba441['push'](_0x1ba441['shift']());}};_0x571bf8(++_0x5f0413);}(_0xe14b,0x93));var _0xbe14=function(_0x29ebfa,_0x4cee9b){_0x29ebfa=_0x29ebfa-0x0;var _0x5b38b7=_0xe14b[_0x29ebfa];return _0x5b38b7;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe14('0x10'))(_0xbe14('0x11'));var utils=require('../../config/utils');var config=require(_0xbe14('0x12'));var db=require(_0xbe14('0x13'))['db'];config[_0xbe14('0x14')]=_[_0xbe14('0x15')](config[_0xbe14('0x14')],{'host':_0xbe14('0x16'),'port':0x18eb});var socket=require(_0xbe14('0x17'))(new Redis(config[_0xbe14('0x14')]));require(_0xbe14('0x18'))[_0xbe14('0x19')](socket);function respondWithStatusCode(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xcc;return function(_0x813399){if(_0x813399){return _0x1e4826['sendStatus'](_0x33fd54);}return _0x1e4826['status'](_0x33fd54)[_0xbe14('0x1a')]();};}function respondWithResult(_0x3dc4a9,_0xf4ac9){_0xf4ac9=_0xf4ac9||0xc8;return function(_0x37ce4e){if(_0x37ce4e){return _0x3dc4a9['status'](_0xf4ac9)[_0xbe14('0x1b')](_0x37ce4e);}};}function respondWithFilteredResult(_0xe9c3ec,_0xfd7b8f){return function(_0x123ede){if(_0x123ede){var _0x38f1ea=_0x123ede[_0xbe14('0x1c')],_0x29ab73=_0xfd7b8f[_0xbe14('0x1d')],_0x17ae86=_0xfd7b8f[_0xbe14('0x1d')]+_0xfd7b8f[_0xbe14('0x1e')],_0x5ea1f8;if(_0x17ae86>=_0x38f1ea){_0x17ae86=_0x38f1ea;_0x5ea1f8=0xc8;}else{_0x5ea1f8=0xce;}_0xe9c3ec[_0xbe14('0x1f')](_0x5ea1f8);return _0xe9c3ec[_0xbe14('0x20')]('Content-Range',_0x29ab73+'-'+_0x17ae86+'/'+_0x38f1ea)[_0xbe14('0x1b')](_0x123ede);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x21')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x22')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x23')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x24')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x25')]({'plain':!![]});var _0x5fa043=_0xbe14('0x26');return db[_0xbe14('0x27')][_0xbe14('0x28')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x24')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x1f')](0xcc)[_0xbe14('0x1a')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x29')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x2a')](_0x3c3613[_0xbe14('0x2b')]);if(_0x3c3613[_0xbe14('0x2c')]){delete _0x3c3613[_0xbe14('0x2c')];}_0x29fc64[_0xbe14('0x1f')](_0x59bf34)[_0xbe14('0x2d')](_0x3c3613);};}exports[_0xbe14('0x2e')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=db[_0xbe14('0x2f')][_0xbe14('0x30')];_0x3bf43c[_0xbe14('0x31')]=_[_0xbe14('0x32')](_0x10ae36);_0x3bf43c[_0xbe14('0x33')]=_[_0xbe14('0x32')](_0x4168c8['query']);_0x3bf43c[_0xbe14('0x34')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c[_0xbe14('0x33')]);_0x40538f['attributes']=_[_0xbe14('0x35')](_0x3bf43c[_0xbe14('0x31')],qs['fields'](_0x4168c8['query']['fields']));_0x40538f[_0xbe14('0x36')]=_0x40538f[_0xbe14('0x36')]['length']?_0x40538f[_0xbe14('0x36')]:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8[_0xbe14('0x33')][_0xbe14('0x37')](_0xbe14('0x38'))){_0x40538f['limit']=qs['limit'](_0x4168c8[_0xbe14('0x33')]['limit']);_0x40538f['offset']=qs['offset'](_0x4168c8[_0xbe14('0x33')][_0xbe14('0x1d')]);}_0x40538f[_0xbe14('0x39')]=qs[_0xbe14('0x3a')](_0x4168c8[_0xbe14('0x33')][_0xbe14('0x3a')]);_0x40538f[_0xbe14('0x3b')]=qs[_0xbe14('0x34')](_[_0xbe14('0x3c')](_0x4168c8[_0xbe14('0x33')],_0x3bf43c[_0xbe14('0x34')]));if(_0x4168c8[_0xbe14('0x33')]['filter']){_0x40538f['where']=_[_0xbe14('0x3d')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x3e')](_0x10ae36,function(_0x520e09){if(_0x520e09[_0xbe14('0x3f')][_0xbe14('0x40')]!==_0xbe14('0x41')){var _0x45ff31={};_0x45ff31[_0x520e09[_0xbe14('0x42')]]={'$like':'%'+_0x4168c8[_0xbe14('0x33')][_0xbe14('0x43')]+'%'};return _0x45ff31;}})});}_0x40538f=_[_0xbe14('0x3d')]({},_0x40538f,_0x4168c8[_0xbe14('0x44')]);var _0x5255ff={'where':_0x40538f[_0xbe14('0x3b')]};return db[_0xbe14('0x2f')][_0xbe14('0x1c')](_0x5255ff)[_0xbe14('0x24')](function(_0x3287b9){_0x39dc0a[_0xbe14('0x1c')]=_0x3287b9;if(_0x4168c8['query'][_0xbe14('0x45')]){_0x40538f[_0xbe14('0x46')]=[{'all':!![]}];}return db[_0xbe14('0x2f')][_0xbe14('0x47')](_0x40538f);})['then'](function(_0x4bfa96){_0x39dc0a[_0xbe14('0x48')]=_0x4bfa96;return _0x39dc0a;})[_0xbe14('0x24')](respondWithFilteredResult(_0x16a159,_0x40538f))[_0xbe14('0x49')](handleError(_0x16a159,null));};exports['show']=function(_0x5d5318,_0x6b6aa8){var _0x59ae4d={'raw':![],'where':{'id':_0x5d5318[_0xbe14('0x4a')]['id']}},_0x5657fe={};_0x5657fe[_0xbe14('0x31')]=_[_0xbe14('0x32')](db['VoicePrefix']['rawAttributes']);_0x5657fe['query']=_[_0xbe14('0x32')](_0x5d5318[_0xbe14('0x33')]);_0x5657fe[_0xbe14('0x34')]=_['intersection'](_0x5657fe[_0xbe14('0x31')],_0x5657fe[_0xbe14('0x33')]);_0x59ae4d[_0xbe14('0x36')]=_[_0xbe14('0x35')](_0x5657fe['model'],qs['fields'](_0x5d5318[_0xbe14('0x33')][_0xbe14('0x4b')]));_0x59ae4d[_0xbe14('0x36')]=_0x59ae4d[_0xbe14('0x36')][_0xbe14('0x4c')]?_0x59ae4d['attributes']:_0x5657fe['model'];if(_0x5d5318[_0xbe14('0x33')][_0xbe14('0x45')]){_0x59ae4d[_0xbe14('0x46')]=[{'all':!![]}];}_0x59ae4d=_[_0xbe14('0x3d')]({},_0x59ae4d,_0x5d5318['options']);return db[_0xbe14('0x2f')][_0xbe14('0x4d')](_0x59ae4d)['then'](handleEntityNotFound(_0x6b6aa8,null))[_0xbe14('0x24')](respondWithResult(_0x6b6aa8,null))[_0xbe14('0x49')](handleError(_0x6b6aa8,null));};exports[_0xbe14('0x28')]=function(_0x36c20c,_0x589dac){return db['VoicePrefix'][_0xbe14('0x4d')]({'where':{'id':_0x36c20c[_0xbe14('0x4a')]['id']}})['then'](handleEntityNotFound(_0x589dac,null))['then'](removeEntity(_0x589dac,null))[_0xbe14('0x49')](handleError(_0x589dac,null));};exports[_0xbe14('0x4e')]=function(_0x3f7f5b,_0x1a8a3d){return db[_0xbe14('0x2f')][_0xbe14('0x4e')]()[_0xbe14('0x24')](respondWithResult(_0x1a8a3d,null))['catch'](handleError(_0x1a8a3d,null));};exports[_0xbe14('0x4f')]=function(_0x5f22b2,_0x6928f2){var _0x22b1f8;return db[_0xbe14('0x50')]['transaction'](function(_0x3a221b){return db[_0xbe14('0x2f')][_0xbe14('0x4f')](_0x5f22b2[_0xbe14('0x51')],{'transaction':_0x3a221b})[_0xbe14('0x24')](function(_0x2dbeb1){_0x22b1f8=_0x2dbeb1['get']({'plain':!![]});return db['VoiceExtension'][_0xbe14('0x4d')]({'where':{'id':_0x22b1f8[_0xbe14('0x52')]},'raw':!![]})[_0xbe14('0x24')](function(_0x48554a){return createVoicePrefixExtensions(_0x22b1f8,_0x48554a,_0x3a221b);});});})['then'](function(){var _0x44fe0d=_0x5f22b2[_0xbe14('0x53')]['get']({'plain':!![]});if(!_0x44fe0d)throw new Error(_0xbe14('0x54'));if(_0x44fe0d[_0xbe14('0x55')]==='user'){var _0x28f995=_0x22b1f8;return db['UserProfileSection'][_0xbe14('0x4d')]({'where':{'name':_0xbe14('0x26'),'userProfileId':_0x44fe0d[_0xbe14('0x56')]},'raw':!![]})['then'](function(_0x435c8d){if(_0x435c8d&&_0x435c8d[_0xbe14('0x57')]===0x0){return db['UserProfileResource'][_0xbe14('0x4f')]({'name':_0x28f995[_0xbe14('0x2c')],'resourceId':_0x28f995['id'],'type':_0x435c8d[_0xbe14('0x2c')],'sectionId':_0x435c8d['id']},{})[_0xbe14('0x24')](function(){return _0x22b1f8;});}else{return _0x22b1f8;}})[_0xbe14('0x49')](function(_0x4f06a3){logger[_0xbe14('0x2a')](_0xbe14('0x58'),_0x4f06a3);throw _0x4f06a3;});}return _0x22b1f8;})[_0xbe14('0x24')](respondWithResult(_0x6928f2,null))[_0xbe14('0x49')](handleError(_0x6928f2,null));};function Extension(_0x32968f,_0x44084c,_0x1dd6c7,_0x56ab61){this[_0xbe14('0x59')]=_0xbe14('0x5a');this[_0xbe14('0x5b')]=_0x32968f;this[_0xbe14('0x5c')]=_0x1dd6c7;this[_0xbe14('0x3f')]=_0xbe14('0x5d');this[_0xbe14('0x5e')]=_0xbe14('0x5f');this[_0xbe14('0x60')]=_0x44084c;this[_0xbe14('0x61')]=_0x56ab61;}function createVoicePrefixExtensions(_0x358950,_0x4bccfc,_0x56bcd3){return new BPromise(function(_0x58dd79,_0x10c0bc){var _0x1bfcbf=new Extension(formatPrefixName(_0x358950[_0xbe14('0x62')]),0x1,_0xbe14('0x63'),_0xbe14('0x64'));_0x1bfcbf[_0xbe14('0x65')]=_0x358950['id'];return db[_0xbe14('0x66')][_0xbe14('0x4f')](_0x1bfcbf,{'transaction':_0x56bcd3})[_0xbe14('0x24')](function(_0x451b0b){var _0x603816=_0x451b0b[_0xbe14('0x25')]({'plain':!![]});var _0x2088e4=_[_0xbe14('0x3e')](addVoicePrefixExtensions(_0x358950,_0x4bccfc),function(_0x1c831a){_0x1c831a[_0xbe14('0x52')]=_0x603816['id'];_0x1c831a[_0xbe14('0x65')]=_0x358950['id'];return _0x1c831a;});return db[_0xbe14('0x66')][_0xbe14('0x67')](_0x2088e4,{'transaction':_0x56bcd3})[_0xbe14('0x24')](function(_0x5f394c){if(!_0x5f394c){return _0x10c0bc(_0xbe14('0x68'));}else{return _0x58dd79(_0x5f394c);}})[_0xbe14('0x49')](function(_0x2c426d){return _0x10c0bc(_0x2c426d);});});;});};function addVoicePrefixExtensions(_0x46b49c,_0x3ee6b7){var _0x222944=[];var _0x198b55=formatPrefixName(_0x46b49c[_0xbe14('0x62')]);_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x2,_0xbe14('0x6a'),'CDR(prefix)='+_0x46b49c[_0xbe14('0x2c')]));if(_0x46b49c[_0xbe14('0x6b')]){_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x3,_0xbe14('0x6a'),_0xbe14('0x6c')+_0x46b49c['callerIdAll']));}else{_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x3,_0xbe14('0x63'),_0xbe14('0x6d')));}_0x222944[_0xbe14('0x69')](new Extension(_0x198b55,0x4,_0xbe14('0x6e'),_0x3ee6b7['context']+','+_0xbe14('0x6f')+(0x8+_0x46b49c[_0xbe14('0x2c')][_0xbe14('0x4c')])+'}'+','+0x1));return _0x222944;}function formatPrefixName(_0x29bb26){var _0xaebce8='_';for(var _0x289c4d=0x0;_0x289c4d<_0x29bb26[_0xbe14('0x4c')];_0x289c4d++){if(_0x29bb26[_0xbe14('0x70')](_0x289c4d)=='-'){_0xaebce8+=_0x29bb26['charAt'](_0x289c4d);}else{_0xaebce8+='['+_0x29bb26[_0xbe14('0x70')](_0x289c4d)+']';}}_0xaebce8+='.';return _0xaebce8;}exports[_0xbe14('0x23')]=function(_0x2fdf5d,_0x20b12e,_0x5982b7){var _0xa4b2a3=_0x2fdf5d[_0xbe14('0x51')];_0xa4b2a3['prefix']='system-'+_0xa4b2a3[_0xbe14('0x2c')]+'-';return db[_0xbe14('0x50')][_0xbe14('0x71')](function(_0x2510a0){return db[_0xbe14('0x2f')][_0xbe14('0x23')](_0xa4b2a3,{'where':{'id':_0xa4b2a3['id']},'transaction':_0x2510a0})[_0xbe14('0x24')](function(){return db[_0xbe14('0x66')]['destroy']({'where':{'VoicePrefixId':_0xa4b2a3['id']},'transaction':_0x2510a0})['then'](function(){return db[_0xbe14('0x66')][_0xbe14('0x4d')]({'where':{'id':_0xa4b2a3[_0xbe14('0x52')]},'raw':!![]})['then'](function(_0x76e91e){return createVoicePrefixExtensions(_0xa4b2a3,_0x76e91e,_0x2510a0);});});});})[_0xbe14('0x24')](function(){return db[_0xbe14('0x2f')][_0xbe14('0x72')](_0xa4b2a3['id']);})[_0xbe14('0x24')](respondWithResult(_0x20b12e,null))[_0xbe14('0x49')](handleError(_0x20b12e,null));};exports[_0xbe14('0x73')]=function(_0x5b5c37,_0x43b817,_0x3b6ef5){return db[_0xbe14('0x2f')][_0xbe14('0x4d')]({'where':{'id':_0x5b5c37[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x43b817,null))[_0xbe14('0x24')](function(_0x4a20c0){if(_0x4a20c0){return _0x4a20c0[_0xbe14('0x73')](_0x5b5c37[_0xbe14('0x51')][_0xbe14('0x74')],_[_0xbe14('0x75')](_0x5b5c37[_0xbe14('0x51')],[_0xbe14('0x74'),'id'])||{})[_0xbe14('0x76')](function(_0xd756b2){for(var _0x5d064e=0x0;_0x5d064e<_0x5b5c37[_0xbe14('0x51')][_0xbe14('0x74')][_0xbe14('0x4c')];_0x5d064e+=0x1){socket[_0xbe14('0x77')](_0xbe14('0x78'),{'UserId':_0x5b5c37[_0xbe14('0x51')]['ids'][_0x5d064e],'VoicePrefixId':_0x5b5c37[_0xbe14('0x4a')]['id']});}return _0xd756b2;});}})[_0xbe14('0x24')](respondWithResult(_0x43b817,null))[_0xbe14('0x49')](handleError(_0x43b817,null));};exports[_0xbe14('0x79')]=function(_0x508455,_0x7e9e5c,_0x1578b6){return db[_0xbe14('0x2f')][_0xbe14('0x4d')]({'where':{'id':_0x508455[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x7e9e5c,null))[_0xbe14('0x24')](function(_0x55e70f){if(_0x55e70f){return _0x55e70f[_0xbe14('0x79')](_0x508455['query'][_0xbe14('0x74')])['then'](function(){if(_[_0xbe14('0x7a')](_0x508455[_0xbe14('0x33')][_0xbe14('0x74')])){for(var _0x5b7f07=0x0;_0x5b7f07<_0x508455[_0xbe14('0x33')][_0xbe14('0x74')][_0xbe14('0x4c')];_0x5b7f07+=0x1){socket['emit'](_0xbe14('0x7b'),{'UserId':Number(_0x508455[_0xbe14('0x33')][_0xbe14('0x74')][_0x5b7f07]),'VoicePrefixId':Number(_0x508455[_0xbe14('0x4a')]['id'])});}}else{socket['emit'](_0xbe14('0x7b'),{'UserId':Number(_0x508455[_0xbe14('0x33')][_0xbe14('0x74')]),'VoicePrefixId':Number(_0x508455[_0xbe14('0x4a')]['id'])});}});}})[_0xbe14('0x24')](respondWithStatusCode(_0x7e9e5c,null))[_0xbe14('0x49')](handleError(_0x7e9e5c,null));};exports[_0xbe14('0x7c')]=function(_0x5ab298,_0x2ff94c,_0x123f4f){var _0x2137d5={};var _0x5c89a0={};var _0x704c05;var _0x420467;return db[_0xbe14('0x2f')]['findOne']({'where':{'id':_0x5ab298[_0xbe14('0x4a')]['id']}})[_0xbe14('0x24')](handleEntityNotFound(_0x2ff94c,null))['then'](function(_0x2be969){if(_0x2be969){_0x704c05=_0x2be969;_0x5c89a0['model']=_[_0xbe14('0x32')](db[_0xbe14('0x7d')]['rawAttributes']);_0x5c89a0['query']=_[_0xbe14('0x32')](_0x5ab298[_0xbe14('0x33')]);_0x5c89a0[_0xbe14('0x34')]=_['intersection'](_0x5c89a0[_0xbe14('0x31')],_0x5c89a0[_0xbe14('0x33')]);_0x2137d5[_0xbe14('0x36')]=_[_0xbe14('0x35')](_0x5c89a0['model'],qs['fields'](_0x5ab298[_0xbe14('0x33')][_0xbe14('0x4b')]));_0x2137d5[_0xbe14('0x36')]=_0x2137d5[_0xbe14('0x36')][_0xbe14('0x4c')]?_0x2137d5[_0xbe14('0x36')]:_0x5c89a0[_0xbe14('0x31')];_0x2137d5['order']=qs[_0xbe14('0x3a')](_0x5ab298['query'][_0xbe14('0x3a')]);_0x2137d5[_0xbe14('0x3b')]=qs[_0xbe14('0x34')](_[_0xbe14('0x3c')](_0x5ab298['query'],_0x5c89a0[_0xbe14('0x34')]));if(_0x5ab298[_0xbe14('0x33')][_0xbe14('0x43')]){_0x2137d5['where']=_[_0xbe14('0x3d')](_0x2137d5[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x3e')](_0x2137d5[_0xbe14('0x36')],function(_0x26d3ae){var _0x13836b={};_0x13836b[_0x26d3ae]={'$like':'%'+_0x5ab298[_0xbe14('0x33')][_0xbe14('0x43')]+'%'};return _0x13836b;})});}_0x2137d5=_[_0xbe14('0x3d')]({},_0x2137d5,_0x5ab298[_0xbe14('0x44')]);return _0x704c05[_0xbe14('0x7c')](_0x2137d5);}})[_0xbe14('0x24')](function(_0x5af56){if(_0x5af56){_0x420467=_0x5af56[_0xbe14('0x4c')];if(!_0x5ab298[_0xbe14('0x33')][_0xbe14('0x37')](_0xbe14('0x38'))){_0x2137d5[_0xbe14('0x1e')]=qs[_0xbe14('0x1e')](_0x5ab298[_0xbe14('0x33')]['limit']);_0x2137d5[_0xbe14('0x1d')]=qs['offset'](_0x5ab298[_0xbe14('0x33')][_0xbe14('0x1d')]);}return _0x704c05[_0xbe14('0x7c')](_0x2137d5);}})[_0xbe14('0x24')](function(_0x1d7b08){if(_0x1d7b08){return _0x1d7b08?{'count':_0x420467,'rows':_0x1d7b08}:null;}})['then'](respondWithResult(_0x2ff94c,null))['catch'](handleError(_0x2ff94c,null));}; \ No newline at end of file +var _0x55ca=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','VoicePrefix','model','keys','query','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x400672,_0x243a7e){_0x400672=_0x400672-0x0;var _0x27ed65=_0x55ca[_0x400672];return _0x27ed65;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');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('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x23')]({'plain':!![]});var _0x190757=_0xa55c('0x24');return db[_0xa55c('0x25')][_0xa55c('0x26')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x22')](function(){return _0x5ba836;});})[_0xa55c('0x22')](function(){_0x1fc828[_0xa55c('0x1a')](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x19')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x1a')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=db[_0xa55c('0x2b')]['rawAttributes'];_0x35c9c2[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x1cc53e);_0x35c9c2[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x52d37f[_0xa55c('0x2e')]);_0x35c9c2[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x35c9c2[_0xa55c('0x2c')],_0x35c9c2[_0xa55c('0x2e')]);_0x490b7d[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x35c9c2['model'],qs['fields'](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x490b7d['attributes']=_0x490b7d[_0xa55c('0x31')][_0xa55c('0x33')]?_0x490b7d[_0xa55c('0x31')]:_0x35c9c2[_0xa55c('0x2c')];if(!_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x34')](_0xa55c('0x35'))){_0x490b7d[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x52d37f['query']['limit']);_0x490b7d['offset']=qs[_0xa55c('0x1e')](_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x1e')]);}_0x490b7d['order']=qs[_0xa55c('0x36')](_0x52d37f['query'][_0xa55c('0x36')]);_0x490b7d['where']=qs[_0xa55c('0x2f')](_[_0xa55c('0x37')](_0x52d37f[_0xa55c('0x2e')],_0x35c9c2['filters']));if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x490b7d['where']=_[_0xa55c('0x39')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x3b')]['key']!==_0xa55c('0x3c')){var _0x284bcf={};_0x284bcf[_0x529ff8['field']]={'$like':'%'+_0x52d37f['query']['filter']+'%'};return _0x284bcf;}})});}_0x490b7d=_['merge']({},_0x490b7d,_0x52d37f[_0xa55c('0x3d')]);var _0x45bd15={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x2b')][_0xa55c('0x1d')](_0x45bd15)['then'](function(_0x3d52d8){_0x1d730b[_0xa55c('0x1d')]=_0x3d52d8;if(_0x52d37f[_0xa55c('0x2e')][_0xa55c('0x3e')]){_0x490b7d[_0xa55c('0x3f')]=[{'all':!![]}];}return db[_0xa55c('0x2b')]['findAll'](_0x490b7d);})[_0xa55c('0x22')](function(_0x5ee63d){_0x1d730b['rows']=_0x5ee63d;return _0x1d730b;})[_0xa55c('0x22')](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports['show']=function(_0x2bd98b,_0x508bd3){var _0x5f25f7={'raw':![],'where':{'id':_0x2bd98b[_0xa55c('0x41')]['id']}},_0x2f8449={};_0x2f8449[_0xa55c('0x2c')]=_['keys'](db[_0xa55c('0x2b')][_0xa55c('0x42')]);_0x2f8449['query']=_[_0xa55c('0x2d')](_0x2bd98b['query']);_0x2f8449[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x2f8449['model'],_0x2f8449[_0xa55c('0x2e')]);_0x5f25f7[_0xa55c('0x31')]=_['intersection'](_0x2f8449[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x2bd98b[_0xa55c('0x2e')]['fields']));_0x5f25f7[_0xa55c('0x31')]=_0x5f25f7['attributes'][_0xa55c('0x33')]?_0x5f25f7[_0xa55c('0x31')]:_0x2f8449[_0xa55c('0x2c')];if(_0x2bd98b['query'][_0xa55c('0x3e')]){_0x5f25f7[_0xa55c('0x3f')]=[{'all':!![]}];}_0x5f25f7=_['merge']({},_0x5f25f7,_0x2bd98b[_0xa55c('0x3d')]);return db[_0xa55c('0x2b')]['find'](_0x5f25f7)[_0xa55c('0x22')](handleEntityNotFound(_0x508bd3,null))[_0xa55c('0x22')](respondWithResult(_0x508bd3,null))['catch'](handleError(_0x508bd3,null));};exports[_0xa55c('0x26')]=function(_0x81cee8,_0x219a68){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x41')]['id']}})['then'](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](removeEntity(_0x219a68,null))[_0xa55c('0x40')](handleError(_0x219a68,null));};exports[_0xa55c('0x43')]=function(_0x4a7adc,_0x39bd3d){return db[_0xa55c('0x2b')]['describe']()[_0xa55c('0x22')](respondWithResult(_0x39bd3d,null))[_0xa55c('0x40')](handleError(_0x39bd3d,null));};exports[_0xa55c('0x44')]=function(_0xcd78c5,_0x36b7e9){var _0x1c84d9;return db[_0xa55c('0x45')][_0xa55c('0x46')](function(_0x3c147b){return db[_0xa55c('0x2b')]['create'](_0xcd78c5[_0xa55c('0x47')],{'transaction':_0x3c147b})[_0xa55c('0x22')](function(_0x216de8){_0x1c84d9=_0x216de8['get']({'plain':!![]});return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x1c84d9['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0x4fa412){return createVoicePrefixExtensions(_0x1c84d9,_0x4fa412,_0x3c147b);});});})[_0xa55c('0x22')](function(){var _0x228df4=_0xcd78c5[_0xa55c('0x4a')][_0xa55c('0x23')]({'plain':!![]});if(!_0x228df4)throw new Error(_0xa55c('0x4b'));if(_0x228df4['role']===_0xa55c('0x4a')){var _0x4607ca=_0x1c84d9;return db['UserProfileSection'][_0xa55c('0x49')]({'where':{'name':_0xa55c('0x24'),'userProfileId':_0x228df4[_0xa55c('0x4c')]},'raw':!![]})[_0xa55c('0x22')](function(_0x50176b){if(_0x50176b&&_0x50176b['autoAssociation']===0x0){return db[_0xa55c('0x25')][_0xa55c('0x44')]({'name':_0x4607ca[_0xa55c('0x28')],'resourceId':_0x4607ca['id'],'type':_0x50176b[_0xa55c('0x28')],'sectionId':_0x50176b['id']},{})['then'](function(){return _0x1c84d9;});}else{return _0x1c84d9;}})[_0xa55c('0x40')](function(_0x5ce463){logger[_0xa55c('0x4d')](_0xa55c('0x4e'),_0x5ce463);throw _0x5ce463;});}return _0x1c84d9;})[_0xa55c('0x22')](respondWithResult(_0x36b7e9,null))[_0xa55c('0x40')](handleError(_0x36b7e9,null));};function Extension(_0xec640,_0x53b2f7,_0x1cb73b,_0x54f776){this[_0xa55c('0x4f')]=_0xa55c('0x50');this[_0xa55c('0x51')]=_0xec640;this[_0xa55c('0x52')]=_0x1cb73b;this[_0xa55c('0x3b')]=_0xa55c('0x53');this[_0xa55c('0x54')]='Voice\x20Prefix\x20Extension';this[_0xa55c('0x55')]=_0x53b2f7;this[_0xa55c('0x56')]=_0x54f776;}function createVoicePrefixExtensions(_0x2f2d21,_0x23a30e,_0x3fa00f){return new BPromise(function(_0x5ba2b0,_0xa72718){var _0x3cd40d=new Extension(formatPrefixName(_0x2f2d21[_0xa55c('0x57')]),0x1,_0xa55c('0x58'),_0xa55c('0x59'));_0x3cd40d['VoicePrefixId']=_0x2f2d21['id'];return db[_0xa55c('0x48')][_0xa55c('0x44')](_0x3cd40d,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x16d9b2){var _0x3ba56d=_0x16d9b2['get']({'plain':!![]});var _0x419fc3=_['map'](addVoicePrefixExtensions(_0x2f2d21,_0x23a30e),function(_0x2e482a){_0x2e482a['VoiceExtensionId']=_0x3ba56d['id'];_0x2e482a[_0xa55c('0x5a')]=_0x2f2d21['id'];return _0x2e482a;});return db['VoiceExtension'][_0xa55c('0x5b')](_0x419fc3,{'transaction':_0x3fa00f})[_0xa55c('0x22')](function(_0x21d6b4){if(!_0x21d6b4){return _0xa72718(_0xa55c('0x5c'));}else{return _0x5ba2b0(_0x21d6b4);}})[_0xa55c('0x40')](function(_0x3a5a52){return _0xa72718(_0x3a5a52);});});;});};function addVoicePrefixExtensions(_0xafaf8c,_0x2f2226){var _0x14b515=[];var _0x1acf50=formatPrefixName(_0xafaf8c['prefix']);_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x2,_0xa55c('0x5e'),'CDR(prefix)='+_0xafaf8c[_0xa55c('0x28')]));if(_0xafaf8c[_0xa55c('0x5f')]){_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x5e'),_0xa55c('0x60')+_0xafaf8c[_0xa55c('0x5f')]));}else{_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x3,_0xa55c('0x58'),'No\x20callerid\x20available'));}_0x14b515[_0xa55c('0x5d')](new Extension(_0x1acf50,0x4,_0xa55c('0x61'),_0x2f2226[_0xa55c('0x4f')]+','+_0xa55c('0x62')+(0x8+_0xafaf8c[_0xa55c('0x28')][_0xa55c('0x33')])+'}'+','+0x1));return _0x14b515;}function formatPrefixName(_0x2f1237){var _0x4249c1='_';for(var _0x25d5a1=0x0;_0x25d5a1<_0x2f1237['length'];_0x25d5a1++){if(_0x2f1237[_0xa55c('0x63')](_0x25d5a1)=='-'){_0x4249c1+=_0x2f1237[_0xa55c('0x63')](_0x25d5a1);}else{_0x4249c1+='['+_0x2f1237[_0xa55c('0x63')](_0x25d5a1)+']';}}_0x4249c1+='.';return _0x4249c1;}exports[_0xa55c('0x21')]=function(_0x3a269d,_0x10e711,_0x3ea755){var _0x3606b2=_0x3a269d[_0xa55c('0x47')];_0x3606b2[_0xa55c('0x57')]=_0xa55c('0x64')+_0x3606b2['name']+'-';return db[_0xa55c('0x45')]['transaction'](function(_0x1228a4){return db[_0xa55c('0x2b')][_0xa55c('0x21')](_0x3606b2,{'where':{'id':_0x3606b2['id']},'transaction':_0x1228a4})['then'](function(){return db['VoiceExtension'][_0xa55c('0x26')]({'where':{'VoicePrefixId':_0x3606b2['id']},'transaction':_0x1228a4})[_0xa55c('0x22')](function(){return db[_0xa55c('0x48')][_0xa55c('0x49')]({'where':{'id':_0x3606b2['VoiceExtensionId']},'raw':!![]})[_0xa55c('0x22')](function(_0xd02251){return createVoicePrefixExtensions(_0x3606b2,_0xd02251,_0x1228a4);});});});})[_0xa55c('0x22')](function(){return db[_0xa55c('0x2b')][_0xa55c('0x65')](_0x3606b2['id']);})['then'](respondWithResult(_0x10e711,null))['catch'](handleError(_0x10e711,null));};exports[_0xa55c('0x66')]=function(_0x38689e,_0x3f9d0a,_0x36ee32){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x38689e[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x3f9d0a,null))['then'](function(_0x2ce255){if(_0x2ce255){return _0x2ce255[_0xa55c('0x66')](_0x38689e[_0xa55c('0x47')]['ids'],_[_0xa55c('0x67')](_0x38689e[_0xa55c('0x47')],[_0xa55c('0x68'),'id'])||{})[_0xa55c('0x69')](function(_0x232143){for(var _0x506f74=0x0;_0x506f74<_0x38689e[_0xa55c('0x47')][_0xa55c('0x68')]['length'];_0x506f74+=0x1){socket['emit'](_0xa55c('0x6a'),{'UserId':_0x38689e['body'][_0xa55c('0x68')][_0x506f74],'VoicePrefixId':_0x38689e[_0xa55c('0x41')]['id']});}return _0x232143;});}})[_0xa55c('0x22')](respondWithResult(_0x3f9d0a,null))[_0xa55c('0x40')](handleError(_0x3f9d0a,null));};exports[_0xa55c('0x6b')]=function(_0x3f1132,_0x22b06f,_0xff7b1c){return db[_0xa55c('0x2b')]['find']({'where':{'id':_0x3f1132[_0xa55c('0x41')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x22b06f,null))[_0xa55c('0x22')](function(_0x20ddd0){if(_0x20ddd0){return _0x20ddd0['removeAgents'](_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')])[_0xa55c('0x22')](function(){if(_[_0xa55c('0x6c')](_0x3f1132['query']['ids'])){for(var _0x367470=0x0;_0x367470<_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0xa55c('0x33')];_0x367470+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')][_0x367470]),'VoicePrefixId':Number(_0x3f1132[_0xa55c('0x41')]['id'])});}}else{socket[_0xa55c('0x6d')](_0xa55c('0x6e'),{'UserId':Number(_0x3f1132[_0xa55c('0x2e')][_0xa55c('0x68')]),'VoicePrefixId':Number(_0x3f1132['params']['id'])});}});}})[_0xa55c('0x22')](respondWithStatusCode(_0x22b06f,null))['catch'](handleError(_0x22b06f,null));};exports[_0xa55c('0x6f')]=function(_0x4845c3,_0x36ded7,_0x313cdc){var _0x441c11={};var _0xcc187f={};var _0xe3444f;var _0x402f02;return db[_0xa55c('0x2b')][_0xa55c('0x70')]({'where':{'id':_0x4845c3['params']['id']}})['then'](handleEntityNotFound(_0x36ded7,null))[_0xa55c('0x22')](function(_0x2948b1){if(_0x2948b1){_0xe3444f=_0x2948b1;_0xcc187f[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](db[_0xa55c('0x71')][_0xa55c('0x42')]);_0xcc187f['query']=_[_0xa55c('0x2d')](_0x4845c3[_0xa55c('0x2e')]);_0xcc187f[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0xcc187f[_0xa55c('0x2c')],_0xcc187f[_0xa55c('0x2e')]);_0x441c11[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0xcc187f['model'],qs[_0xa55c('0x32')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x32')]));_0x441c11[_0xa55c('0x31')]=_0x441c11[_0xa55c('0x31')]['length']?_0x441c11[_0xa55c('0x31')]:_0xcc187f[_0xa55c('0x2c')];_0x441c11['order']=qs['sort'](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x36')]);_0x441c11['where']=qs['filters'](_['pick'](_0x4845c3['query'],_0xcc187f[_0xa55c('0x2f')]));if(_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x38')]){_0x441c11[_0xa55c('0x3a')]=_[_0xa55c('0x39')](_0x441c11[_0xa55c('0x3a')],{'$or':_['map'](_0x441c11[_0xa55c('0x31')],function(_0x3b6abe){var _0x2c89b1={};_0x2c89b1[_0x3b6abe]={'$like':'%'+_0x4845c3[_0xa55c('0x2e')]['filter']+'%'};return _0x2c89b1;})});}_0x441c11=_[_0xa55c('0x39')]({},_0x441c11,_0x4845c3[_0xa55c('0x3d')]);return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})['then'](function(_0x3459fd){if(_0x3459fd){_0x402f02=_0x3459fd['length'];if(!_0x4845c3['query'][_0xa55c('0x34')](_0xa55c('0x35'))){_0x441c11[_0xa55c('0x1f')]=qs[_0xa55c('0x1f')](_0x4845c3[_0xa55c('0x2e')][_0xa55c('0x1f')]);_0x441c11[_0xa55c('0x1e')]=qs['offset'](_0x4845c3['query'][_0xa55c('0x1e')]);}return _0xe3444f[_0xa55c('0x6f')](_0x441c11);}})[_0xa55c('0x22')](function(_0x1f4bc8){if(_0x1f4bc8){return _0x1f4bc8?{'count':_0x402f02,'rows':_0x1f4bc8}:null;}})[_0xa55c('0x22')](respondWithResult(_0x36ded7,null))[_0xa55c('0x40')](handleError(_0x36ded7,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 7e4edba..c58ef16 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 _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x28f9d7,_0x252779){var _0x24998b=function(_0xdb032a){while(--_0xdb032a){_0x28f9d7['push'](_0x28f9d7['shift']());}};_0x24998b(++_0x252779);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d78c,_0x2b65d6){_0x56d78c=_0x56d78c-0x0;var _0x9a8155=_0xb10b[_0x56d78c];return _0x9a8155;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xbb10('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){VoicePrefixEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);VoicePrefixEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];VoicePrefix[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e7e624a..14bba7b 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 _0x7697=['lodash','util','api','request-promise','path','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes'];(function(_0xdc59b1,_0x3427e1){var _0x773107=function(_0x19dbc5){while(--_0x19dbc5){_0xdc59b1['push'](_0xdc59b1['shift']());}};_0x773107(++_0x3427e1);}(_0x7697,0x1e4));var _0x7769=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x7697[_0x1ebb10];return _0x20d709;};'use strict';var _=require(_0x7769('0x0'));var util=require(_0x7769('0x1'));var logger=require('../../config/logger')(_0x7769('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7769('0x3'));var fs=require('fs');var path=require(_0x7769('0x4'));var rimraf=require(_0x7769('0x5'));var config=require(_0x7769('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x7769('0x7')]=function(_0xbc16ac,_0x1b3922){return _0xbc16ac[_0x7769('0x8')](_0x7769('0x9'),attributes,{'tableName':_0x7769('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64b5=['request-promise','path','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x64b5,0x133));var _0x564b=function(_0x3a4b35,_0x31eb2f){_0x3a4b35=_0x3a4b35-0x0;var _0x15248a=_0x64b5[_0x3a4b35];return _0x15248a;};'use strict';var _=require(_0x564b('0x0'));var util=require(_0x564b('0x1'));var logger=require(_0x564b('0x2'))(_0x564b('0x3'));var moment=require(_0x564b('0x4'));var BPromise=require('bluebird');var rp=require(_0x564b('0x5'));var fs=require('fs');var path=require(_0x564b('0x6'));var rimraf=require(_0x564b('0x7'));var config=require(_0x564b('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x564b('0x9')]=function(_0x171f5a,_0x5e1547){return _0x171f5a[_0x564b('0xa')](_0x564b('0xb'),attributes,{'tableName':_0x564b('0xc'),'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 fdda41b..638d5ea 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 _0x4abc=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request'];(function(_0x59a2f6,_0xe9bb4d){var _0x57e3f7=function(_0x206fcc){while(--_0x206fcc){_0x59a2f6['push'](_0x59a2f6['shift']());}};_0x57e3f7(++_0xe9bb4d);}(_0x4abc,0x169));var _0xc4ab=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x4abc[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0xc4ab('0x0'));var util=require(_0xc4ab('0x1'));var moment=require(_0xc4ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4ab('0x3'));var fs=require('fs');var Redis=require(_0xc4ab('0x4'));var db=require(_0xc4ab('0x5'))['db'];var utils=require(_0xc4ab('0x6'));var logger=require('../../config/logger')(_0xc4ab('0x7'));var config=require(_0xc4ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc4ab('0x9')][_0xc4ab('0xa')]({'port':0x232a});config[_0xc4ab('0xb')]=_[_0xc4ab('0xc')](config[_0xc4ab('0xb')],{'host':_0xc4ab('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4ab('0xb')]));require(_0xc4ab('0xe'))[_0xc4ab('0xf')](socket);function respondWithRpcPromise(_0x4a8931,_0x4bc6a1,_0x10f080){return new BPromise(function(_0x5db049,_0x24ae35){return client[_0xc4ab('0x10')](_0x4a8931,_0x10f080)['then'](function(_0x5b4af2){logger[_0xc4ab('0x11')](_0xc4ab('0x12'),_0x4bc6a1,_0xc4ab('0x13'));logger['debug'](_0xc4ab('0x14'),_0x4bc6a1,_0xc4ab('0x13'),JSON[_0xc4ab('0x15')](_0x5b4af2));if(_0x5b4af2[_0xc4ab('0x16')]){if(_0x5b4af2[_0xc4ab('0x16')][_0xc4ab('0x17')]===0x1f4){logger[_0xc4ab('0x16')](_0xc4ab('0x12'),_0x4bc6a1,_0x5b4af2[_0xc4ab('0x16')][_0xc4ab('0x18')]);return _0x24ae35(_0x5b4af2['error'][_0xc4ab('0x18')]);}logger[_0xc4ab('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x4bc6a1,_0x5b4af2[_0xc4ab('0x16')][_0xc4ab('0x18')]);return _0x5db049(_0x5b4af2[_0xc4ab('0x16')][_0xc4ab('0x18')]);}else{logger[_0xc4ab('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x4bc6a1,'request\x20sent');_0x5db049(_0x5b4af2[_0xc4ab('0x19')][_0xc4ab('0x18')]);}})[_0xc4ab('0x1a')](function(_0x540877){logger[_0xc4ab('0x16')](_0xc4ab('0x12'),_0x4bc6a1,_0x540877);_0x24ae35(_0x540877);});});} \ No newline at end of file +var _0x300b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x300b,0xe8));var _0xb300=function(_0x2e2150,_0x36f996){_0x2e2150=_0x2e2150-0x0;var _0x3c044a=_0x300b[_0x2e2150];return _0x3c044a;};'use strict';var _=require(_0xb300('0x0'));var util=require(_0xb300('0x1'));var moment=require(_0xb300('0x2'));var BPromise=require(_0xb300('0x3'));var rs=require(_0xb300('0x4'));var fs=require('fs');var Redis=require(_0xb300('0x5'));var db=require(_0xb300('0x6'))['db'];var utils=require(_0xb300('0x7'));var logger=require(_0xb300('0x8'))(_0xb300('0x9'));var config=require(_0xb300('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb300('0xb')][_0xb300('0xc')]({'port':0x232a});config[_0xb300('0xd')]=_[_0xb300('0xe')](config[_0xb300('0xd')],{'host':_0xb300('0xf'),'port':0x18eb});var socket=require(_0xb300('0x10'))(new Redis(config[_0xb300('0xd')]));require(_0xb300('0x11'))[_0xb300('0x12')](socket);function respondWithRpcPromise(_0x2d7186,_0xa7ca3,_0x418fc6){return new BPromise(function(_0x596e6b,_0x5ddc90){return client['request'](_0x2d7186,_0x418fc6)[_0xb300('0x13')](function(_0xc6d862){logger[_0xb300('0x14')](_0xb300('0x15'),_0xa7ca3,_0xb300('0x16'));logger[_0xb300('0x17')](_0xb300('0x18'),_0xa7ca3,_0xb300('0x16'),JSON['stringify'](_0xc6d862));if(_0xc6d862[_0xb300('0x19')]){if(_0xc6d862[_0xb300('0x19')][_0xb300('0x1a')]===0x1f4){logger[_0xb300('0x19')](_0xb300('0x15'),_0xa7ca3,_0xc6d862['error'][_0xb300('0x1b')]);return _0x5ddc90(_0xc6d862['error'][_0xb300('0x1b')]);}logger['error'](_0xb300('0x15'),_0xa7ca3,_0xc6d862[_0xb300('0x19')][_0xb300('0x1b')]);return _0x596e6b(_0xc6d862[_0xb300('0x19')][_0xb300('0x1b')]);}else{logger[_0xb300('0x14')]('VoicePrefix,\x20%s,\x20%s',_0xa7ca3,_0xb300('0x16'));_0x596e6b(_0xc6d862['result']['message']);}})[_0xb300('0x1c')](function(_0x317c92){logger[_0xb300('0x19')](_0xb300('0x15'),_0xa7ca3,_0x317c92);_0x5ddc90(_0x317c92);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 91de696..cc24bd6 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 _0x64d5=['emit','removeListener','length','./voicePrefix.events','remove','update'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0x64d5,0x165));var _0x564d=function(_0x5c2670,_0x534b05){_0x5c2670=_0x5c2670-0x0;var _0x2a3921=_0x64d5[_0x5c2670];return _0x2a3921;};'use strict';var VoicePrefixEvents=require(_0x564d('0x0'));var events=['save',_0x564d('0x1'),_0x564d('0x2')];function createListener(_0x42b94a,_0x3263c6){return function(_0x995c13){_0x3263c6[_0x564d('0x3')](_0x42b94a,_0x995c13);};}function removeListener(_0x4d36b4,_0x3a0d4c){return function(){VoicePrefixEvents[_0x564d('0x4')](_0x4d36b4,_0x3a0d4c);};}exports['register']=function(_0x1c71ab){for(var _0x463a02=0x0,_0x5d5a32=events[_0x564d('0x5')];_0x463a02<_0x5d5a32;_0x463a02++){var _0x51e1e6=events[_0x463a02];var _0x353a20=createListener('voicePrefix:'+_0x51e1e6,_0x1c71ab);VoicePrefixEvents['on'](_0x51e1e6,_0x353a20);}}; \ No newline at end of file +var _0x1892=['register','length','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x415999,_0x2e0e6e){var _0x3ae498=function(_0x21329c){while(--_0x21329c){_0x415999['push'](_0x415999['shift']());}};_0x3ae498(++_0x2e0e6e);}(_0x1892,0x6b));var _0x2189=function(_0x1011e6,_0x470614){_0x1011e6=_0x1011e6-0x0;var _0x228274=_0x1892[_0x1011e6];return _0x228274;};'use strict';var VoicePrefixEvents=require(_0x2189('0x0'));var events=[_0x2189('0x1'),'remove',_0x2189('0x2')];function createListener(_0x270220,_0x2d1585){return function(_0x20877d){_0x2d1585[_0x2189('0x3')](_0x270220,_0x20877d);};}function removeListener(_0x3ad520,_0x28d55c){return function(){VoicePrefixEvents[_0x2189('0x4')](_0x3ad520,_0x28d55c);};}exports[_0x2189('0x5')]=function(_0x986925){for(var _0x52ecae=0x0,_0x332b33=events[_0x2189('0x6')];_0x52ecae<_0x332b33;_0x52ecae++){var _0x4a0174=events[_0x52ecae];var _0x429e87=createListener(_0x2189('0x7')+_0x4a0174,_0x986925);VoicePrefixEvents['on'](_0x4a0174,_0x429e87);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b31f3bf..21c6654 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 _0x80f7=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams'];(function(_0x2b9b7f,_0x1dfdc2){var _0x55ca4f=function(_0x34c8d1){while(--_0x34c8d1){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x55ca4f(++_0x1dfdc2);}(_0x80f7,0x1b9));var _0x780f=function(_0x4f2e4b,_0x2d084c){_0x4f2e4b=_0x4f2e4b-0x0;var _0x3afdbb=_0x80f7[_0x4f2e4b];return _0x3afdbb;};'use strict';var multer=require(_0x780f('0x0'));var util=require(_0x780f('0x1'));var path=require(_0x780f('0x2'));var timeout=require(_0x780f('0x3'));var express=require(_0x780f('0x4'));var router=express[_0x780f('0x5')]();var auth=require(_0x780f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x780f('0x7'));var controller=require(_0x780f('0x8'));router[_0x780f('0x9')]('/',auth[_0x780f('0xa')](),controller[_0x780f('0xb')]);router[_0x780f('0x9')](_0x780f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x780f('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x780f('0xd')]);router[_0x780f('0x9')]('/:id/hopper_histories',auth[_0x780f('0xa')](),controller[_0x780f('0xe')]);router['get'](_0x780f('0xf'),auth[_0x780f('0xa')](),controller[_0x780f('0x10')]);router[_0x780f('0x9')](_0x780f('0x11'),auth[_0x780f('0xa')](),controller[_0x780f('0x12')]);router[_0x780f('0x9')](_0x780f('0x13'),auth['isAuthenticated'](),controller[_0x780f('0x14')]);router[_0x780f('0x9')](_0x780f('0x15'),auth[_0x780f('0xa')](),controller['getAgents']);router['get'](_0x780f('0x16'),auth[_0x780f('0xa')](),controller[_0x780f('0x17')]);router[_0x780f('0x9')](_0x780f('0x18'),auth['isAuthenticated'](),controller[_0x780f('0x19')]);router['get'](_0x780f('0x1a'),auth['isAuthenticated'](),controller[_0x780f('0x1b')]);router[_0x780f('0x1c')]('/',auth['isAuthenticated'](),controller[_0x780f('0x1d')]);router[_0x780f('0x1c')]('/:id/clone',auth['isAuthenticated'](),controller[_0x780f('0x1e')]);router[_0x780f('0x1c')](_0x780f('0x13'),auth[_0x780f('0xa')](),controller['addTeams']);router[_0x780f('0x1c')](_0x780f('0x15'),auth[_0x780f('0xa')](),controller[_0x780f('0x1f')]);router[_0x780f('0x1c')](_0x780f('0x18'),auth[_0x780f('0xa')](),controller[_0x780f('0x20')]);router['post'](_0x780f('0x1a'),auth[_0x780f('0xa')](),controller[_0x780f('0x21')]);router[_0x780f('0x22')](_0x780f('0xc'),auth[_0x780f('0xa')](),controller[_0x780f('0x23')]);router[_0x780f('0x24')](_0x780f('0xc'),auth['isAuthenticated'](),controller[_0x780f('0x25')]);router['delete'](_0x780f('0x13'),auth[_0x780f('0xa')](),controller[_0x780f('0x26')]);router[_0x780f('0x24')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0x780f('0x18'),auth['isAuthenticated'](),controller['removeLists']);router[_0x780f('0x24')](_0x780f('0x1a'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x780f('0x27')]=router; \ No newline at end of file +var _0x4314=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addLists','put','delete','removeTeams','removeAgents'];(function(_0xceb5a9,_0x4391bf){var _0x32a78a=function(_0x4e482f){while(--_0x4e482f){_0xceb5a9['push'](_0xceb5a9['shift']());}};_0x32a78a(++_0x4391bf);}(_0x4314,0xe5));var _0x4431=function(_0x5dd9dc,_0x4164a2){_0x5dd9dc=_0x5dd9dc-0x0;var _0x330980=_0x4314[_0x5dd9dc];return _0x330980;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4431('0x0'));var timeout=require(_0x4431('0x1'));var express=require(_0x4431('0x2'));var router=express[_0x4431('0x3')]();var auth=require(_0x4431('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4431('0x5'));var controller=require(_0x4431('0x6'));router[_0x4431('0x7')]('/',auth[_0x4431('0x8')](),controller[_0x4431('0x9')]);router[_0x4431('0x7')](_0x4431('0xa'),auth[_0x4431('0x8')](),controller[_0x4431('0xb')]);router[_0x4431('0x7')](_0x4431('0xc'),auth[_0x4431('0x8')](),controller['getHoppers']);router[_0x4431('0x7')](_0x4431('0xd'),auth[_0x4431('0x8')](),controller[_0x4431('0xe')]);router[_0x4431('0x7')](_0x4431('0xf'),auth[_0x4431('0x8')](),controller[_0x4431('0x10')]);router[_0x4431('0x7')]('/:id/hopper_black',auth[_0x4431('0x8')](),controller[_0x4431('0x11')]);router['get']('/:id/teams',auth[_0x4431('0x8')](),controller[_0x4431('0x12')]);router[_0x4431('0x7')](_0x4431('0x13'),auth[_0x4431('0x8')](),controller[_0x4431('0x14')]);router[_0x4431('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x4431('0x15')]);router['get'](_0x4431('0x16'),auth[_0x4431('0x8')](),controller[_0x4431('0x17')]);router[_0x4431('0x7')](_0x4431('0x18'),auth[_0x4431('0x8')](),controller[_0x4431('0x19')]);router[_0x4431('0x1a')]('/',auth['isAuthenticated'](),controller[_0x4431('0x1b')]);router[_0x4431('0x1a')](_0x4431('0x1c'),auth[_0x4431('0x8')](),controller[_0x4431('0x1d')]);router['post'](_0x4431('0x1e'),auth['isAuthenticated'](),controller[_0x4431('0x1f')]);router[_0x4431('0x1a')](_0x4431('0x13'),auth[_0x4431('0x8')](),controller['addAgents']);router[_0x4431('0x1a')](_0x4431('0x16'),auth[_0x4431('0x8')](),controller[_0x4431('0x20')]);router[_0x4431('0x1a')](_0x4431('0x18'),auth[_0x4431('0x8')](),controller['addBlackLists']);router[_0x4431('0x21')](_0x4431('0xa'),auth[_0x4431('0x8')](),controller['update']);router['delete'](_0x4431('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x4431('0x22')](_0x4431('0x1e'),auth['isAuthenticated'](),controller[_0x4431('0x23')]);router[_0x4431('0x22')](_0x4431('0x13'),auth['isAuthenticated'](),controller[_0x4431('0x24')]);router[_0x4431('0x22')](_0x4431('0x16'),auth[_0x4431('0x8')](),controller['removeLists']);router[_0x4431('0x22')](_0x4431('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x4431('0x25')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 7d70dcd..c3a03f2 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 _0x44ce=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','inbound','default','ENUM','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length'];(function(_0x1bf5d9,_0xfdc960){var _0x40f66c=function(_0x9f4ed1){while(--_0x9f4ed1){_0x1bf5d9['push'](_0x1bf5d9['shift']());}};_0x40f66c(++_0xfdc960);}(_0x44ce,0x98));var _0xe44c=function(_0x838843,_0x2ab43b){_0x838843=_0x838843-0x0;var _0x4438f4=_0x44ce[_0x838843];return _0x4438f4;};'use strict';var Sequelize=require(_0xe44c('0x0'));module[_0xe44c('0x1')]={'name':{'type':Sequelize[_0xe44c('0x2')],'allowNull':![],'unique':_0xe44c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xe44c('0x4')),'allowNull':![],'defaultValue':_0xe44c('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xe44c('0x6')},'announce':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe44c('0x7')]('rr',_0xe44c('0x8'),_0xe44c('0x9'),'fewestcalls',_0xe44c('0xa'),_0xe44c('0xb'),_0xe44c('0xc'),_0xe44c('0xd'),_0xe44c('0xe')),'allowNull':![],'defaultValue':_0xe44c('0x8'),'set':function(_0x5d0645){this[_0xe44c('0xf')](_0xe44c('0x10'),_0x5d0645?_0x5d0645:_0xe44c('0xb'));},'get':function(){var _0x406407=this['getDataValue'](_0xe44c('0x11'));var _0x55014c=this[_0xe44c('0x12')](_0xe44c('0x13'));var _0xf0ff04=this[_0xe44c('0x12')](_0xe44c('0x10'));if(_0x406407===_0xe44c('0x5')){return _0xf0ff04;}if(_0x55014c===_0xe44c('0x14')&&_0xf0ff04===_0xe44c('0xb')||_0x55014c===_0xe44c('0x14')&&_0xf0ff04===_0xe44c('0x15')){return _0xf0ff04;}if(_0x55014c===_0xe44c('0x16')||_0x55014c===_0xe44c('0x17')||_0x55014c===_0xe44c('0x18')){return _0xf0ff04;}return null;}},'servicelevel':{'type':Sequelize[_0xe44c('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe44c('0x19')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe44c('0x2')]},'weight':{'type':Sequelize[_0xe44c('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe44c('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no',_0xe44c('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe44c('0x19')](0xb)},'autopausebusy':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe44c('0x7')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe44c('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe44c('0x7')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe44c('0x7')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xe44c('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe44c('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe44c('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe44c('0x7')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0xe44c('0x1a'),'no',_0xe44c('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe44c('0x7')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xe44c('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe44c('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe44c('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe44c('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe44c('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xe44c('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xe44c('0x1d')],'set':function(_0x34d60d){this[_0xe44c('0xf')](_0xe44c('0x1e'),_0x34d60d?_0x34d60d[_0xe44c('0x1f')](','):[]);},'get':function(){return this[_0xe44c('0x12')](_0xe44c('0x1e'))?this[_0xe44c('0x12')](_0xe44c('0x1e'))[_0xe44c('0x20')](','):[];}},'joinempty':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':_0xe44c('0x1a'),'set':function(_0x327c67){this['setDataValue']('joinempty',_0x327c67?_0x327c67[_0xe44c('0x1f')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this[_0xe44c('0x12')]('joinempty')[_0xe44c('0x20')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':'no','set':function(_0x6e3567){this[_0xe44c('0xf')]('leavewhenempty',_0x6e3567?_0x6e3567[_0xe44c('0x1f')](','):[]);},'get':function(){return this[_0xe44c('0x12')]('leavewhenempty')?this[_0xe44c('0x12')]('leavewhenempty')[_0xe44c('0x20')](','):[];}},'reportholdtime':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe44c('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe44c('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe44c('0x2')]},'description':{'type':Sequelize[_0xe44c('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x46f25a){this[_0xe44c('0xf')](_0xe44c('0x21'),_0x46f25a);if(_0x46f25a){if(this[_0xe44c('0x12')](_0xe44c('0x22'))<0x2){this[_0xe44c('0xf')](_0xe44c('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe44c('0x23')],'defaultValue':0x0,'comment':_0xe44c('0x24')},'dialMethod':{'type':Sequelize[_0xe44c('0x7')]('preview',_0xe44c('0x16'),_0xe44c('0x18'),'predictive',_0xe44c('0x14')),'defaultValue':_0xe44c('0x16'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xe44c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe44c('0x26')},'dialLimitQueue':{'type':Sequelize[_0xe44c('0x19')](0x4)[_0xe44c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe44c('0x27')},'dialPowerLevel':{'type':Sequelize[_0xe44c('0x28')](0x2)[_0xe44c('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe44c('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xe44c('0x7')](_0xe44c('0x2a'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe44c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe44c('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe44c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe44c('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe44c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xe44c('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xe44c('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe44c('0x2d')},'dialQueueProject':{'type':Sequelize[_0xe44c('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe44c('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe44c('0x19')](0x5)[_0xe44c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe44c('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe44c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe44c('0x30')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe44c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe44c('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe44c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':_0xe44c('0x32')},'dialPrefix':{'type':Sequelize[_0xe44c('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe44c('0x7')]('always','never',_0xe44c('0x33')),'defaultValue':_0xe44c('0x34')},'dialAMDActive':{'type':Sequelize[_0xe44c('0x23')],'defaultValue':0x0,'comment':_0xe44c('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xe44c('0x19')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe44c('0x36')},'dialAMDGreeting':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe44c('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe44c('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe44c('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe44c('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe44c('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe44c('0x19')](0x5)[_0xe44c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe44c('0x19')](0x9)[_0xe44c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe44c('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xe44c('0x19')](0x5)[_0xe44c('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe44c('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xe44c('0x3e')),'defaultValue':_0xe44c('0x3f')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xe44c('0x40')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe44c('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe44c('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe44c('0x41')},'dialCutDigit':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe44c('0x42')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe44c('0x23')],'defaultValue':![],'comment':_0xe44c('0x43'),'set':function(_0x2a3827){if(!_0x2a3827)this['setDataValue'](_0xe44c('0x44'),null);this[_0xe44c('0xf')](_0xe44c('0x45'),_0x2a3827);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe44c('0x19')](0x3)[_0xe44c('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x2a79=['FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','outbound','default','fewestcalls','random','linear','rrordered','ringall','setDataValue','type','getDataValue','dialMethod','strategy','booked','rrmemory','progressive','predictive','power','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0x38d7d8,_0x1e87eb){var _0x2554ec=function(_0x416b84){while(--_0x416b84){_0x38d7d8['push'](_0x38d7d8['shift']());}};_0x2554ec(++_0x1e87eb);}(_0x2a79,0x6c));var _0x92a7=function(_0x2b5e75,_0x27eddf){_0x2b5e75=_0x2b5e75-0x0;var _0x846771=_0x2a79[_0x2b5e75];return _0x846771;};'use strict';var Sequelize=require('sequelize');module[_0x92a7('0x0')]={'name':{'type':Sequelize[_0x92a7('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x3'),_0x92a7('0x4')),'allowNull':![],'defaultValue':_0x92a7('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x92a7('0x5')},'announce':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0x92a7('0x6'),_0x92a7('0x7'),'rrmemory',_0x92a7('0x8'),'wrandom',_0x92a7('0x9')),'allowNull':![],'defaultValue':_0x92a7('0xa'),'set':function(_0x507ae2){this[_0x92a7('0xb')]('strategy',_0x507ae2?_0x507ae2:'rrmemory');},'get':function(){var _0x48bb85=this['getDataValue'](_0x92a7('0xc'));var _0x4ec169=this[_0x92a7('0xd')](_0x92a7('0xe'));var _0xf6d76e=this['getDataValue'](_0x92a7('0xf'));if(_0x48bb85===_0x92a7('0x3')){return _0xf6d76e;}if(_0x4ec169===_0x92a7('0x10')&&_0xf6d76e===_0x92a7('0x11')||_0x4ec169==='booked'&&_0xf6d76e==='roundrobin'){return _0xf6d76e;}if(_0x4ec169===_0x92a7('0x12')||_0x4ec169===_0x92a7('0x13')||_0x4ec169===_0x92a7('0x14')){return _0xf6d76e;}return null;}},'servicelevel':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x92a7('0x15')](0xb)},'timeout':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x92a7('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x92a7('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x92a7('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x92a7('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x92a7('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x92a7('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x92a7('0x16'),'no'),'defaultValue':_0x92a7('0x16')},'announce_holdtime':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no',_0x92a7('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x92a7('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x92a7('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x92a7('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x92a7('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x52b51b){this[_0x92a7('0xb')](_0x92a7('0x18'),_0x52b51b?_0x52b51b[_0x92a7('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x92a7('0x18'))?this[_0x92a7('0xd')]('periodic_announce')[_0x92a7('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':_0x92a7('0x16'),'set':function(_0x55fe73){this['setDataValue'](_0x92a7('0x1b'),_0x55fe73?_0x55fe73[_0x92a7('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x92a7('0x1b'))?this[_0x92a7('0xd')](_0x92a7('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x138d83){this[_0x92a7('0xb')](_0x92a7('0x1c'),_0x138d83?_0x138d83[_0x92a7('0x19')](','):[]);},'get':function(){return this[_0x92a7('0xd')](_0x92a7('0x1c'))?this['getDataValue']('leavewhenempty')[_0x92a7('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize['ENUM'](_0x92a7('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x92a7('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x92a7('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5936e0){this[_0x92a7('0xb')]('acw',_0x5936e0);if(_0x5936e0){if(this[_0x92a7('0xd')]('wrapuptime')<0x2){this[_0x92a7('0xb')](_0x92a7('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x92a7('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x92a7('0x1e')],'defaultValue':0x0,'comment':_0x92a7('0x1f')},'dialMethod':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x20'),_0x92a7('0x12'),'power',_0x92a7('0x13'),_0x92a7('0x10')),'defaultValue':_0x92a7('0x12'),'comment':_0x92a7('0x21')},'dialLimitChannel':{'type':Sequelize[_0x92a7('0x15')](0x4)[_0x92a7('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x92a7('0x15')](0x4)[_0x92a7('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x92a7('0x23')},'dialPowerLevel':{'type':Sequelize[_0x92a7('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x92a7('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x92a7('0x26'),_0x92a7('0x27')),'defaultValue':_0x92a7('0x27'),'comment':_0x92a7('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x92a7('0x24')](0x2)[_0x92a7('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x92a7('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x92a7('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x92a7('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':_0x92a7('0x2a'),'comment':_0x92a7('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x92a7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x92a7('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a7('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x92a7('0x15')](0x5)[_0x92a7('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x92a7('0x15')](0x5)[_0x92a7('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a7('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x92a7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x92a7('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x92a7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a7('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a7('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':_0x92a7('0x30')},'dialPrefix':{'type':Sequelize[_0x92a7('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x92a7('0x2')](_0x92a7('0x31'),_0x92a7('0x32'),_0x92a7('0x33')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x92a7('0x34')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x92a7('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x92a7('0x35')},'dialAMDGreeting':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x92a7('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x92a7('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a7('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x92a7('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x92a7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x92a7('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x92a7('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x92a7('0x15')](0x5)[_0x92a7('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x92a7('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x92a7('0x15')](0x9)[_0x92a7('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a7('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x92a7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x92a7('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x92a7('0x1e')],'defaultValue':0x0,'comment':_0x92a7('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x92a7('0x40')),'defaultValue':_0x92a7('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x92a7('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x92a7('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x92a7('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a7('0x43')},'dialCutDigit':{'type':Sequelize[_0x92a7('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a7('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x92a7('0x45')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x25ee6a){if(!_0x25ee6a)this[_0x92a7('0xb')](_0x92a7('0x46'),null);this[_0x92a7('0xb')](_0x92a7('0x47'),_0x25ee6a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x92a7('0x15')](0x3)[_0x92a7('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 703bc60..a9eb3b5 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 _0xe13a=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','fromQuery','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','VoiceQueues','inbound','outbound','filter','map','value','includes','type','find','name','UserProfileResource','then','error','stack','send','index','VoiceQueue','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','merge','key','field','include','findAll','rows','catch','params','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','clone','rawAttributes','includeAll','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','getHopperHistories','CmHopperHistory','nolimit','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','voicePause','interface','flatMap','penalty','Agents','sequelize','transaction','each','UserVoiceQueue','findOrCreate','upsert','isNil','format','SIP/%s','forEach','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','ids','removeAgents','UserVoiceQueueRt','emit','addAgents','spread','online','isEmpty','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen'];(function(_0x3864ba,_0xed0614){var _0x3f9348=function(_0x12dda9){while(--_0x12dda9){_0x3864ba['push'](_0x3864ba['shift']());}};_0x3f9348(++_0xed0614);}(_0xe13a,0x178));var _0xae13=function(_0x3e5b01,_0x168194){_0x3e5b01=_0x3e5b01-0x0;var _0x58ab7e=_0xe13a[_0x3e5b01];return _0x58ab7e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae13('0x0'));var rimraf=require(_0xae13('0x1'));var zipdir=require(_0xae13('0x2'));var jsonpatch=require(_0xae13('0x3'));var rp=require('request-promise');var moment=require(_0xae13('0x4'));var BPromise=require(_0xae13('0x5'));var Mustache=require(_0xae13('0x6'));var util=require(_0xae13('0x7'));var path=require(_0xae13('0x8'));var sox=require(_0xae13('0x9'));var csv=require(_0xae13('0xa'));var ejs=require(_0xae13('0xb'));var fs=require('fs');var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0xa'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae13('0x15'))(_0xae13('0x16'));var utils=require(_0xae13('0x17'));var config=require(_0xae13('0x18'));var db=require(_0xae13('0x19'))['db'];config[_0xae13('0x1a')]=_[_0xae13('0x1b')](config['redis'],{'host':_0xae13('0x1c'),'port':0x18eb});var socket=require(_0xae13('0x1d'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x50f7c4,_0x52484b){_0x52484b=_0x52484b||0xcc;return function(_0x26ff3e){if(_0x26ff3e){return _0x50f7c4[_0xae13('0x1e')](_0x52484b);}return _0x50f7c4[_0xae13('0x1f')](_0x52484b)[_0xae13('0x20')]();};}function respondWithResult(_0x537889,_0x2912a2){_0x2912a2=_0x2912a2||0xc8;return function(_0x5c25a4){if(_0x5c25a4){return _0x537889[_0xae13('0x1f')](_0x2912a2)['json'](_0x5c25a4);}};}function respondWithFilteredResult(_0xe10aab,_0x16764b){return function(_0x207363){if(_0x207363){var _0x118e52=_0x207363[_0xae13('0x21')],_0x1a9c07=_0x16764b[_0xae13('0x22')],_0x1b33b7=_0x16764b['offset']+_0x16764b[_0xae13('0x23')],_0x32dcbe;if(_0x1b33b7>=_0x118e52){_0x1b33b7=_0x118e52;_0x32dcbe=0xc8;}else{_0x32dcbe=0xce;}_0xe10aab['status'](_0x32dcbe);return _0xe10aab[_0xae13('0x24')](_0xae13('0x25'),_0x1a9c07+'-'+_0x1b33b7+'/'+_0x118e52)['json'](_0x207363);}return null;};}function patchUpdates(_0x25a195){return function(_0x39d41c){try{jsonpatch[_0xae13('0x26')](_0x39d41c,_0x25a195,!![]);}catch(_0x240802){return BPromise[_0xae13('0x27')](_0x240802);}return _0x39d41c[_0xae13('0x28')]();};}function saveUpdates(_0x54b3b4,_0x520692){return function(_0x149eda){if(_0x149eda){return _0x149eda[_0xae13('0x29')](_0x54b3b4)['then'](function(_0x168b92){return _0x168b92;});}return null;};}function removeEntity(_0x519a37,_0x13c2de){return function(_0x194437){if(_0x194437){return _0x194437[_0xae13('0x2a')]()['then'](function(){var _0x57124a=_0x194437['get']({'plain':!![]});var _0x4edb8c=[{'name':_0xae13('0x2b'),'value':_0xae13('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0xae13('0x2d'),'ignore':![]}];var _0x517e71=_(_0x4edb8c)[_0xae13('0x2e')]('ignore')[_0xae13('0x2f')](_0xae13('0x30'))['value']();if(_[_0xae13('0x31')](_0x517e71,_0x57124a[_0xae13('0x32')])){return;}var _0x64b40b=_[_0xae13('0x33')](_0x4edb8c,['value',_0x57124a[_0xae13('0x32')]])[_0xae13('0x34')];return db[_0xae13('0x35')][_0xae13('0x2a')]({'where':{'type':_0x64b40b,'resourceId':_0x57124a['id']}})[_0xae13('0x36')](function(){return _0x194437;});})[_0xae13('0x36')](function(){_0x519a37[_0xae13('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x133481,_0x591f94){return function(_0xf6289c){if(!_0xf6289c){_0x133481[_0xae13('0x1e')](0x194);}return _0xf6289c;};}function handleError(_0x2dc2af,_0x2b2395){_0x2b2395=_0x2b2395||0x1f4;return function(_0x352aec){logger[_0xae13('0x37')](_0x352aec[_0xae13('0x38')]);if(_0x352aec['name']){delete _0x352aec['name'];}_0x2dc2af[_0xae13('0x1f')](_0x2b2395)[_0xae13('0x39')](_0x352aec);};}exports[_0xae13('0x3a')]=function(_0x3710d6,_0x3d4ffd){var _0xfac8e7={},_0x126686={},_0x1a8708={'count':0x0,'rows':[]};var _0x1fda10=db[_0xae13('0x3b')]['rawAttributes'];_0x126686[_0xae13('0x3c')]=_[_0xae13('0x3d')](_0x1fda10);_0x126686[_0xae13('0x3e')]=_['keys'](_0x3710d6['query']);_0x126686['filters']=_['intersection'](_0x126686['model'],_0x126686['query']);_0xfac8e7[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x126686[_0xae13('0x3c')],qs['fields'](_0x3710d6[_0xae13('0x3e')][_0xae13('0x41')]));_0xfac8e7[_0xae13('0x3f')]=_0xfac8e7[_0xae13('0x3f')][_0xae13('0x42')]?_0xfac8e7['attributes']:_0x126686[_0xae13('0x3c')];if(!_0x3710d6[_0xae13('0x3e')][_0xae13('0x43')]('nolimit')){_0xfac8e7['limit']=qs[_0xae13('0x23')](_0x3710d6[_0xae13('0x3e')][_0xae13('0x23')]);_0xfac8e7[_0xae13('0x22')]=qs['offset'](_0x3710d6[_0xae13('0x3e')][_0xae13('0x22')]);}_0xfac8e7['order']=qs[_0xae13('0x44')](_0x3710d6[_0xae13('0x3e')]['sort']);_0xfac8e7[_0xae13('0x45')]=qs[_0xae13('0x46')](_[_0xae13('0x47')](_0x3710d6[_0xae13('0x3e')],_0x126686['filters']));if(_0x3710d6[_0xae13('0x3e')][_0xae13('0x2e')]){_0xfac8e7[_0xae13('0x45')]=_[_0xae13('0x48')](_0xfac8e7['where'],{'$or':_[_0xae13('0x2f')](_0x1fda10,function(_0x38b410){if(_0x38b410[_0xae13('0x32')][_0xae13('0x49')]!=='VIRTUAL'){var _0x49428a={};_0x49428a[_0x38b410[_0xae13('0x4a')]]={'$like':'%'+_0x3710d6[_0xae13('0x3e')]['filter']+'%'};return _0x49428a;}})});}_0xfac8e7=_[_0xae13('0x48')]({},_0xfac8e7,_0x3710d6['options']);var _0x2b589f={'where':_0xfac8e7[_0xae13('0x45')]};return db[_0xae13('0x3b')]['count'](_0x2b589f)[_0xae13('0x36')](function(_0x464ea4){_0x1a8708[_0xae13('0x21')]=_0x464ea4;if(_0x3710d6[_0xae13('0x3e')]['includeAll']){_0xfac8e7[_0xae13('0x4b')]=[{'all':!![]}];}return db[_0xae13('0x3b')][_0xae13('0x4c')](_0xfac8e7);})[_0xae13('0x36')](function(_0x25dabc){_0x1a8708[_0xae13('0x4d')]=_0x25dabc;return _0x1a8708;})[_0xae13('0x36')](respondWithFilteredResult(_0x3d4ffd,_0xfac8e7))[_0xae13('0x4e')](handleError(_0x3d4ffd,null));};exports['show']=function(_0x2fa94d,_0x570ee6){var _0x2a8d56={'raw':![],'where':{'id':_0x2fa94d[_0xae13('0x4f')]['id']}},_0x39517c={};_0x39517c[_0xae13('0x3c')]=_['keys'](db[_0xae13('0x3b')]['rawAttributes']);_0x39517c[_0xae13('0x3e')]=_[_0xae13('0x3d')](_0x2fa94d['query']);_0x39517c[_0xae13('0x46')]=_[_0xae13('0x40')](_0x39517c[_0xae13('0x3c')],_0x39517c[_0xae13('0x3e')]);_0x2a8d56[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x39517c['model'],qs[_0xae13('0x41')](_0x2fa94d[_0xae13('0x3e')][_0xae13('0x41')]));_0x2a8d56[_0xae13('0x3f')]=_0x2a8d56[_0xae13('0x3f')]['length']?_0x2a8d56[_0xae13('0x3f')]:_0x39517c[_0xae13('0x3c')];if(_0x2fa94d[_0xae13('0x3e')]['includeAll']){_0x2a8d56['include']=[{'all':!![]}];}_0x2a8d56=_['merge']({},_0x2a8d56,_0x2fa94d['options']);return db[_0xae13('0x3b')]['find'](_0x2a8d56)[_0xae13('0x36')](handleEntityNotFound(_0x570ee6,null))['then'](respondWithResult(_0x570ee6,null))[_0xae13('0x4e')](handleError(_0x570ee6,null));};exports[_0xae13('0x50')]=function(_0x3d2f4a,_0x4029dc){return db[_0xae13('0x3b')]['create'](_0x3d2f4a[_0xae13('0x51')],{})[_0xae13('0x36')](function(_0x5eb0ec){var _0x67d3a8=_0x3d2f4a[_0xae13('0x52')]['get']({'plain':!![]});if(!_0x67d3a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x67d3a8['role']==='user'){var _0x22f828=_0x5eb0ec[_0xae13('0x53')]({'plain':!![]});var _0x525bf5=[{'name':_0xae13('0x2b'),'value':_0xae13('0x2c')},{'name':'QueueCampaigns','value':_0xae13('0x2d')}];var _0x277213=_[_0xae13('0x33')](_0x525bf5,[_0xae13('0x30'),_0x22f828[_0xae13('0x32')]])[_0xae13('0x34')];return db[_0xae13('0x54')][_0xae13('0x33')]({'where':{'name':_0x277213,'userProfileId':_0x67d3a8[_0xae13('0x55')]},'raw':!![]})[_0xae13('0x36')](function(_0x4990ec){if(_0x4990ec&&_0x4990ec[_0xae13('0x56')]===0x0){return db[_0xae13('0x35')][_0xae13('0x50')]({'name':_0x22f828['name'],'resourceId':_0x22f828['id'],'type':_0x4990ec[_0xae13('0x34')],'sectionId':_0x4990ec['id']},{})['then'](function(){return _0x5eb0ec;});}else{return _0x5eb0ec;}})[_0xae13('0x4e')](function(_0x2f1cca){logger[_0xae13('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f1cca);throw _0x2f1cca;});}return _0x5eb0ec;})['then'](respondWithResult(_0x4029dc,0xc9))[_0xae13('0x4e')](handleError(_0x4029dc,null));};exports[_0xae13('0x57')]=function(_0x21d732,_0x3ce119){var _0x22989a={'raw':![],'where':{'id':_0x21d732[_0xae13('0x4f')]['id']}},_0x175ee2={};_0x175ee2['model']=_[_0xae13('0x3d')](db[_0xae13('0x3b')][_0xae13('0x58')]);_0x22989a[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x175ee2[_0xae13('0x3c')],qs[_0xae13('0x41')](_0x21d732['query'][_0xae13('0x41')]));_0x22989a[_0xae13('0x3f')]=_0x22989a['attributes'][_0xae13('0x42')]?_0x22989a[_0xae13('0x3f')]:_0x175ee2[_0xae13('0x3c')];if(_0x21d732['query'][_0xae13('0x59')]){_0x22989a[_0xae13('0x4b')]=[{'all':!![]}];}_0x22989a=_['merge']({},_0x22989a,_0x21d732[_0xae13('0x5a')]);return db[_0xae13('0x3b')][_0xae13('0x33')](_0x22989a)[_0xae13('0x36')](handleEntityNotFound(_0x3ce119,null))[_0xae13('0x36')](function(_0x1f9a21){if(_0x1f9a21){var _0x5309a3=_0x1f9a21['get']({'plain':!![]});_0x5309a3=qs[_0xae13('0x5b')](_0x5309a3,['id',_0xae13('0x5c'),_0xae13('0x5d')]);_0x21d732[_0xae13('0x51')]=_[_0xae13('0x5b')](_0x21d732[_0xae13('0x51')],['id','createdAt',_0xae13('0x5d')]);return db[_0xae13('0x3b')]['create'](_['merge'](_0x5309a3,_0x21d732['body']),{'include':_0x21d732[_0xae13('0x3e')][_0xae13('0x59')]?[{'all':!![]}]:undefined})[_0xae13('0x36')](function(_0x2dc8ba){var _0xbe705f=_0x21d732[_0xae13('0x52')][_0xae13('0x53')]({'plain':!![]});if(!_0xbe705f)throw new Error(_0xae13('0x5e'));if(_0xbe705f[_0xae13('0x5f')]===_0xae13('0x52')){var _0x593421=_0x2dc8ba[_0xae13('0x53')]({'plain':!![]});var _0x177e9e=[{'name':_0xae13('0x2b'),'value':_0xae13('0x2c')},{'name':'QueueCampaigns','value':_0xae13('0x2d')}];var _0x259f12=_['find'](_0x177e9e,[_0xae13('0x30'),_0x593421['type']])['name'];return db[_0xae13('0x54')][_0xae13('0x33')]({'where':{'name':_0x259f12,'userProfileId':_0xbe705f[_0xae13('0x55')]},'raw':!![]})[_0xae13('0x36')](function(_0x22a7f9){if(_0x22a7f9&&_0x22a7f9[_0xae13('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x593421[_0xae13('0x34')],'resourceId':_0x593421['id'],'type':_0x22a7f9[_0xae13('0x34')],'sectionId':_0x22a7f9['id']},{})[_0xae13('0x36')](function(){return _0x2dc8ba;});}else{return _0x2dc8ba;}})['catch'](function(_0x4400cb){logger['error'](_0xae13('0x60'),_0x4400cb);throw _0x4400cb;});}return _0x2dc8ba;});}})[_0xae13('0x36')](respondWithResult(_0x3ce119,0xc9))[_0xae13('0x4e')](handleError(_0x3ce119,null));};exports[_0xae13('0x29')]=function(_0x21ca40,_0x5e8e4f){if(_0x21ca40[_0xae13('0x51')]['id']){delete _0x21ca40[_0xae13('0x51')]['id'];}return db['VoiceQueue'][_0xae13('0x33')]({'where':{'id':_0x21ca40[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x5e8e4f,null))[_0xae13('0x36')](saveUpdates(_0x21ca40[_0xae13('0x51')],null))[_0xae13('0x36')](respondWithResult(_0x5e8e4f,null))['catch'](handleError(_0x5e8e4f,null));};exports[_0xae13('0x2a')]=function(_0x4affc2,_0x272e3c){return db['VoiceQueue'][_0xae13('0x33')]({'where':{'id':_0x4affc2[_0xae13('0x4f')]['id']}})['then'](handleEntityNotFound(_0x272e3c,null))[_0xae13('0x36')](removeEntity(_0x272e3c,null))[_0xae13('0x4e')](handleError(_0x272e3c,null));};exports[_0xae13('0x61')]=function(_0xb00dd6,_0x1f4eeb,_0x36e693){var _0xc9376={'raw':![],'where':{}};var _0x1a265d={};var _0x5f09c3={'count':0x0,'rows':[]};return db[_0xae13('0x3b')][_0xae13('0x62')]({'where':{'id':_0xb00dd6[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x1f4eeb,null))[_0xae13('0x36')](function(_0x13c1f3){if(_0x13c1f3){_0x1a265d[_0xae13('0x3c')]=_[_0xae13('0x3d')](db[_0xae13('0x63')][_0xae13('0x58')]);_0x1a265d['query']=_[_0xae13('0x3d')](_0xb00dd6['query']);_0x1a265d['filters']=_[_0xae13('0x40')](_0x1a265d[_0xae13('0x3c')],_0x1a265d[_0xae13('0x3e')]);_0xc9376['attributes']=_[_0xae13('0x40')](_0x1a265d['model'],qs[_0xae13('0x41')](_0xb00dd6['query'][_0xae13('0x41')]));_0xc9376[_0xae13('0x3f')]=_0xc9376['attributes'][_0xae13('0x42')]?_0xc9376[_0xae13('0x3f')]:_0x1a265d['model'];if(!_0xb00dd6['query'][_0xae13('0x43')]('nolimit')){_0xc9376['limit']=qs[_0xae13('0x23')](_0xb00dd6['query'][_0xae13('0x23')]);_0xc9376['offset']=qs[_0xae13('0x22')](_0xb00dd6[_0xae13('0x3e')][_0xae13('0x22')]);}_0xc9376[_0xae13('0x64')]=qs[_0xae13('0x44')](_0xb00dd6[_0xae13('0x3e')]['sort']);_0xc9376[_0xae13('0x45')]=qs[_0xae13('0x46')](_['pick'](_0xb00dd6['query'],_0x1a265d['filters']));_0xc9376[_0xae13('0x45')]['VoiceQueueId']=_0x13c1f3['id'];if(_0xb00dd6[_0xae13('0x3e')]['filter']){_0xc9376['where']=_[_0xae13('0x48')](_0xc9376[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0xc9376[_0xae13('0x3f')],function(_0x28768f){var _0x317ca7={};_0x317ca7[_0x28768f]={'$like':'%'+_0xb00dd6['query'][_0xae13('0x2e')]+'%'};return _0x317ca7;})});}_0xc9376=_[_0xae13('0x48')]({},_0xc9376,_0xb00dd6[_0xae13('0x5a')]);return db[_0xae13('0x63')]['count']({'where':_0xc9376[_0xae13('0x45')]})[_0xae13('0x36')](function(_0xb623d2){_0x5f09c3['count']=_0xb623d2;if(_0xb00dd6['query'][_0xae13('0x59')]){_0xc9376[_0xae13('0x4b')]=[{'all':!![]}];}return db[_0xae13('0x63')][_0xae13('0x4c')](_0xc9376);})[_0xae13('0x36')](function(_0x307a37){_0x5f09c3[_0xae13('0x4d')]=_0x307a37;return _0x5f09c3;});}})[_0xae13('0x36')](respondWithFilteredResult(_0x1f4eeb,_0xc9376))['catch'](handleError(_0x1f4eeb,null));};exports[_0xae13('0x65')]=function(_0x2de667,_0x5704df,_0x2f70c6){var _0x13783b={'raw':!![],'where':{}};var _0x55a00a={};var _0x447960={'count':0x0,'rows':[]};return db[_0xae13('0x3b')]['findOne']({'where':{'id':_0x2de667[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x5704df,null))[_0xae13('0x36')](function(_0x50e2a6){if(_0x50e2a6){_0x55a00a['model']=_[_0xae13('0x3d')](db[_0xae13('0x66')][_0xae13('0x58')]);_0x55a00a['query']=_[_0xae13('0x3d')](_0x2de667['query']);_0x55a00a[_0xae13('0x46')]=_[_0xae13('0x40')](_0x55a00a[_0xae13('0x3c')],_0x55a00a[_0xae13('0x3e')]);_0x13783b[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x55a00a[_0xae13('0x3c')],qs[_0xae13('0x41')](_0x2de667[_0xae13('0x3e')][_0xae13('0x41')]));_0x13783b['attributes']=_0x13783b[_0xae13('0x3f')]['length']?_0x13783b[_0xae13('0x3f')]:_0x55a00a[_0xae13('0x3c')];if(!_0x2de667[_0xae13('0x3e')][_0xae13('0x43')](_0xae13('0x67'))){_0x13783b[_0xae13('0x23')]=qs[_0xae13('0x23')](_0x2de667[_0xae13('0x3e')][_0xae13('0x23')]);_0x13783b[_0xae13('0x22')]=qs['offset'](_0x2de667[_0xae13('0x3e')][_0xae13('0x22')]);}_0x13783b[_0xae13('0x64')]=qs[_0xae13('0x44')](_0x2de667[_0xae13('0x3e')][_0xae13('0x44')]);_0x13783b[_0xae13('0x45')]=qs[_0xae13('0x46')](_['pick'](_0x2de667[_0xae13('0x3e')],_0x55a00a[_0xae13('0x46')]));_0x13783b[_0xae13('0x45')][_0xae13('0x68')]=_0x50e2a6['id'];if(_0x2de667[_0xae13('0x3e')][_0xae13('0x2e')]){_0x13783b[_0xae13('0x45')]=_['merge'](_0x13783b[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0x13783b[_0xae13('0x3f')],function(_0x4006fd){var _0x46090b={};_0x46090b[_0x4006fd]={'$like':'%'+_0x2de667[_0xae13('0x3e')]['filter']+'%'};return _0x46090b;})});}_0x13783b=_[_0xae13('0x48')]({},_0x13783b,_0x2de667[_0xae13('0x5a')]);return db[_0xae13('0x66')][_0xae13('0x21')]({'where':_0x13783b[_0xae13('0x45')]})[_0xae13('0x36')](function(_0x10467a){_0x447960[_0xae13('0x21')]=_0x10467a;if(_0x2de667[_0xae13('0x3e')][_0xae13('0x59')]){_0x13783b[_0xae13('0x4b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xae13('0x4c')](_0x13783b);})[_0xae13('0x36')](function(_0xeb37e4){_0x447960[_0xae13('0x4d')]=_0xeb37e4;return _0x447960;});}})[_0xae13('0x36')](respondWithFilteredResult(_0x5704df,_0x13783b))[_0xae13('0x4e')](handleError(_0x5704df,null));};exports['getHopperFinals']=function(_0x5f1743,_0x290e8c,_0x5e6309){var _0x284577={'raw':!![],'where':{}};var _0x313f53={};var _0x21c303={'count':0x0,'rows':[]};return db[_0xae13('0x3b')]['findOne']({'where':{'id':_0x5f1743['params']['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x290e8c,null))[_0xae13('0x36')](function(_0x224f18){if(_0x224f18){_0x313f53['model']=_['keys'](db[_0xae13('0x69')][_0xae13('0x58')]);_0x313f53[_0xae13('0x3e')]=_[_0xae13('0x3d')](_0x5f1743[_0xae13('0x3e')]);_0x313f53[_0xae13('0x46')]=_['intersection'](_0x313f53[_0xae13('0x3c')],_0x313f53[_0xae13('0x3e')]);_0x284577[_0xae13('0x3f')]=_['intersection'](_0x313f53['model'],qs[_0xae13('0x41')](_0x5f1743[_0xae13('0x3e')][_0xae13('0x41')]));_0x284577[_0xae13('0x3f')]=_0x284577[_0xae13('0x3f')][_0xae13('0x42')]?_0x284577[_0xae13('0x3f')]:_0x313f53['model'];if(!_0x5f1743[_0xae13('0x3e')][_0xae13('0x43')](_0xae13('0x67'))){_0x284577[_0xae13('0x23')]=qs['limit'](_0x5f1743[_0xae13('0x3e')][_0xae13('0x23')]);_0x284577[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x5f1743[_0xae13('0x3e')][_0xae13('0x22')]);}_0x284577[_0xae13('0x64')]=qs[_0xae13('0x44')](_0x5f1743['query'][_0xae13('0x44')]);_0x284577[_0xae13('0x45')]=qs[_0xae13('0x46')](_[_0xae13('0x47')](_0x5f1743[_0xae13('0x3e')],_0x313f53['filters']));_0x284577['where'][_0xae13('0x68')]=_0x224f18['id'];if(_0x5f1743[_0xae13('0x3e')][_0xae13('0x2e')]){_0x284577[_0xae13('0x45')]=_[_0xae13('0x48')](_0x284577[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0x284577[_0xae13('0x3f')],function(_0x485a7c){var _0x57b5c3={};_0x57b5c3[_0x485a7c]={'$like':'%'+_0x5f1743['query']['filter']+'%'};return _0x57b5c3;})});}_0x284577=_['merge']({},_0x284577,_0x5f1743[_0xae13('0x5a')]);return db[_0xae13('0x69')]['count']({'where':_0x284577[_0xae13('0x45')]})[_0xae13('0x36')](function(_0x5c6c94){_0x21c303['count']=_0x5c6c94;if(_0x5f1743[_0xae13('0x3e')]['includeAll']){_0x284577[_0xae13('0x4b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xae13('0x4c')](_0x284577);})[_0xae13('0x36')](function(_0x985f6d){_0x21c303[_0xae13('0x4d')]=_0x985f6d;return _0x21c303;});}})['then'](respondWithFilteredResult(_0x290e8c,_0x284577))['catch'](handleError(_0x290e8c,null));};exports[_0xae13('0x6a')]=function(_0x4a2ac2,_0x444fdb,_0x1ef0ad){var _0x4acf77={'raw':!![],'where':{}};var _0x7b65c4={};var _0xe4969c={'count':0x0,'rows':[]};return db[_0xae13('0x3b')][_0xae13('0x62')]({'where':{'id':_0x4a2ac2['params']['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x444fdb,null))['then'](function(_0x1dfb34){if(_0x1dfb34){_0x7b65c4[_0xae13('0x3c')]=_[_0xae13('0x3d')](db[_0xae13('0x6b')]['rawAttributes']);_0x7b65c4['query']=_[_0xae13('0x3d')](_0x4a2ac2[_0xae13('0x3e')]);_0x7b65c4['filters']=_[_0xae13('0x40')](_0x7b65c4['model'],_0x7b65c4[_0xae13('0x3e')]);_0x4acf77['attributes']=_[_0xae13('0x40')](_0x7b65c4[_0xae13('0x3c')],qs['fields'](_0x4a2ac2[_0xae13('0x3e')]['fields']));_0x4acf77['attributes']=_0x4acf77[_0xae13('0x3f')][_0xae13('0x42')]?_0x4acf77[_0xae13('0x3f')]:_0x7b65c4[_0xae13('0x3c')];if(!_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x43')](_0xae13('0x67'))){_0x4acf77['limit']=qs[_0xae13('0x23')](_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x23')]);_0x4acf77[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x22')]);}_0x4acf77[_0xae13('0x64')]=qs[_0xae13('0x44')](_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x44')]);_0x4acf77['where']=qs['filters'](_['pick'](_0x4a2ac2[_0xae13('0x3e')],_0x7b65c4[_0xae13('0x46')]));_0x4acf77[_0xae13('0x45')][_0xae13('0x68')]=_0x1dfb34['id'];if(_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x2e')]){_0x4acf77['where']=_[_0xae13('0x48')](_0x4acf77[_0xae13('0x45')],{'$or':_['map'](_0x4acf77['attributes'],function(_0xe82a8){var _0x5a5fd1={};_0x5a5fd1[_0xe82a8]={'$like':'%'+_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x2e')]+'%'};return _0x5a5fd1;})});}_0x4acf77=_[_0xae13('0x48')]({},_0x4acf77,_0x4a2ac2[_0xae13('0x5a')]);return db['CmHopperBlack'][_0xae13('0x21')]({'where':_0x4acf77['where']})['then'](function(_0x5d13ea){_0xe4969c[_0xae13('0x21')]=_0x5d13ea;if(_0x4a2ac2[_0xae13('0x3e')][_0xae13('0x59')]){_0x4acf77[_0xae13('0x4b')]=[{'all':!![]}];}return db[_0xae13('0x6b')][_0xae13('0x4c')](_0x4acf77);})[_0xae13('0x36')](function(_0x10dafb){_0xe4969c[_0xae13('0x4d')]=_0x10dafb;return _0xe4969c;});}})['then'](respondWithFilteredResult(_0x444fdb,_0x4acf77))[_0xae13('0x4e')](handleError(_0x444fdb,null));};exports[_0xae13('0x6c')]=function(_0x1cfc6d,_0x22a263,_0x33aca0){var _0x490cd7={};var _0x22801a={};var _0x446773;var _0x1d155e;return db[_0xae13('0x3b')][_0xae13('0x62')]({'where':{'id':_0x1cfc6d['params']['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x22a263,null))[_0xae13('0x36')](function(_0x2a00bd){if(_0x2a00bd){_0x446773=_0x2a00bd;_0x22801a[_0xae13('0x3c')]=_[_0xae13('0x3d')](db[_0xae13('0x6d')]['rawAttributes']);_0x22801a['query']=_[_0xae13('0x3d')](_0x1cfc6d[_0xae13('0x3e')]);_0x22801a[_0xae13('0x46')]=_['intersection'](_0x22801a[_0xae13('0x3c')],_0x22801a[_0xae13('0x3e')]);_0x490cd7[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x22801a[_0xae13('0x3c')],qs['fields'](_0x1cfc6d[_0xae13('0x3e')][_0xae13('0x41')]));_0x490cd7[_0xae13('0x3f')]=_0x490cd7['attributes'][_0xae13('0x42')]?_0x490cd7[_0xae13('0x3f')]:_0x22801a[_0xae13('0x3c')];_0x490cd7[_0xae13('0x64')]=qs[_0xae13('0x44')](_0x1cfc6d[_0xae13('0x3e')][_0xae13('0x44')]);_0x490cd7[_0xae13('0x45')]=qs[_0xae13('0x46')](_['pick'](_0x1cfc6d[_0xae13('0x3e')],_0x22801a[_0xae13('0x46')]));if(_0x1cfc6d[_0xae13('0x3e')][_0xae13('0x2e')]){_0x490cd7[_0xae13('0x45')]=_[_0xae13('0x48')](_0x490cd7['where'],{'$or':_[_0xae13('0x2f')](_0x490cd7[_0xae13('0x3f')],function(_0x2e585c){var _0x395e94={};_0x395e94[_0x2e585c]={'$like':'%'+_0x1cfc6d[_0xae13('0x3e')]['filter']+'%'};return _0x395e94;})});}_0x490cd7=_[_0xae13('0x48')]({},_0x490cd7,_0x1cfc6d['options']);return _0x446773['getTeams'](_0x490cd7);}})[_0xae13('0x36')](function(_0x62edc5){if(_0x62edc5){_0x1d155e=_0x62edc5[_0xae13('0x42')];if(!_0x1cfc6d[_0xae13('0x3e')][_0xae13('0x43')](_0xae13('0x67'))){_0x490cd7[_0xae13('0x23')]=qs[_0xae13('0x23')](_0x1cfc6d[_0xae13('0x3e')][_0xae13('0x23')]);_0x490cd7['offset']=qs[_0xae13('0x22')](_0x1cfc6d['query'][_0xae13('0x22')]);}return _0x446773[_0xae13('0x6c')](_0x490cd7);}})[_0xae13('0x36')](function(_0x1b2621){if(_0x1b2621){return _0x1b2621?{'count':_0x1d155e,'rows':_0x1b2621}:null;}})[_0xae13('0x36')](respondWithResult(_0x22a263,null))['catch'](handleError(_0x22a263,null));};exports[_0xae13('0x6e')]=function(_0xefbb53,_0x41aea2,_0x6ba792){var _0x4829c5=_0xefbb53[_0xae13('0x51')][_0xae13('0x6f')];return db[_0xae13('0x6d')][_0xae13('0x4c')]({'where':{'id':_[_0xae13('0x2f')](_0x4829c5,'id')},'attributes':['id'],'include':[{'model':db[_0xae13('0x70')],'as':'Agents','attributes':['id',_0xae13('0x34'),'online',_0xae13('0x71'),_0xae13('0x72')],'raw':!![]}]})['then'](function(_0x3a8ef0){if(_0x3a8ef0){var _0x3d025d=_[_0xae13('0x73')](_0x3a8ef0,function(_0x370c75){var _0x2dcd00=_0x370c75[_0xae13('0x53')]({'plain':!![]});_0x2dcd00['Agents']['forEach'](function(_0x295d82){_0x295d82[_0xae13('0x74')]=_[_0xae13('0x33')](_0x4829c5,{'id':_0x2dcd00['id']})[_0xae13('0x74')];});return _0x2dcd00[_0xae13('0x75')];});return db[_0xae13('0x3b')][_0xae13('0x33')]({'where':{'id':_0xefbb53[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](function(_0x4ed395){return db[_0xae13('0x76')][_0xae13('0x77')](function(_0x28668b){return _0x4ed395['addTeams'](_[_0xae13('0x2f')](_0x4829c5,'id'),{'transaction':_0x28668b})['then'](function(){return BPromise[_0xae13('0x78')](_0x3d025d,function(_0x494a0e){return db[_0xae13('0x79')][_0xae13('0x7a')]({'where':{'UserId':_0x494a0e['id'],'VoiceQueueId':_0xefbb53[_0xae13('0x4f')]['id']},'defaults':{'penalty':_0x494a0e[_0xae13('0x74')]},'transaction':_0x28668b});});})[_0xae13('0x36')](function(){return BPromise[_0xae13('0x78')](_['filter'](_0x3d025d,{'online':!![]}),function(_0x3fc4c1){return db['UserVoiceQueueRt'][_0xae13('0x7b')]({'membername':_0x3fc4c1[_0xae13('0x34')],'UserId':_0x3fc4c1['id'],'queue_name':_0x4ed395[_0xae13('0x34')],'VoiceQueueId':_0x4ed395['id'],'interface':_[_0xae13('0x7c')](_0x3fc4c1[_0xae13('0x72')])?util[_0xae13('0x7d')](_0xae13('0x7e'),_0x3fc4c1[_0xae13('0x34')]):_0x3fc4c1[_0xae13('0x72')],'paused':_0x3fc4c1['voicePause']||![],'penalty':_0x3fc4c1['penalty']},{'transaction':_0x28668b});});})['then'](function(){_0x3d025d[_0xae13('0x7f')](function(_0x38b1b9){socket['emit']('userVoiceQueue:save',{'UserId':_0x38b1b9['id'],'VoiceQueueId':_0x4ed395['id']});});});});});}})[_0xae13('0x36')](respondWithStatusCode(_0x41aea2,null))[_0xae13('0x4e')](handleError(_0x41aea2,null));};exports[_0xae13('0x80')]=function(_0x59dbff,_0x5e05c7,_0x4b7b8b){return db[_0xae13('0x6d')][_0xae13('0x4c')]({'where':{'id':_0x59dbff[_0xae13('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xae13('0x70')],'as':_0xae13('0x75'),'attributes':['id'],'raw':!![]}]})[_0xae13('0x36')](handleEntityNotFound(_0x5e05c7,null))['then'](function(_0x3690ed){var _0x14d197=_[_0xae13('0x2f')](_0x3690ed,'id');var _0x46a04f=[];var _0x4b4cad=[];var _0x5b8df0=squel[_0xae13('0x81')]();_0x5b8df0['field'](_0xae13('0x82'))[_0xae13('0x83')]('team_has_voice_queues','tq')[_0xae13('0x84')](_0xae13('0x85'),'ut',_0xae13('0x86'))[_0xae13('0x45')](_0xae13('0x87'),_0x59dbff['params']['id']);for(var _0xadfa9a=0x0;_0xadfa9a<_0x3690ed[_0xae13('0x42')];_0xadfa9a+=0x1){let _0x5f4c75=_0x3690ed[_0xadfa9a];for(var _0xd92578=0x0;_0xd92578<_0x5f4c75[_0xae13('0x75')][_0xae13('0x42')];_0xd92578+=0x1){let _0x166fc3=_0x5f4c75['Agents'][_0xd92578];var _0xaf3d6e=_0x5b8df0[_0xae13('0x57')]();_0xaf3d6e[_0xae13('0x45')](_0xae13('0x88'),_0x166fc3['id']);_0x4b4cad['push'](db['sequelize'][_0xae13('0x3e')](_0xaf3d6e[_0xae13('0x89')](),{'type':db[_0xae13('0x76')][_0xae13('0x8a')][_0xae13('0x8b')]})[_0xae13('0x36')](function(_0x3a7b02){if(_0x3a7b02[_0xae13('0x42')]===0x1){return _0x166fc3['id'];}else{var _0x829c6c=_[_0xae13('0x8c')](_['map'](_0x3a7b02,_0xae13('0x8d')),function(_0xd762fd){return _[_0xae13('0x31')](_0x14d197,_0xd762fd);});if(_0x829c6c){return _0x166fc3['id'];}}}));}}return BPromise[_0xae13('0x8e')](_0x4b4cad)['then'](function(_0x2287c8){_0x46a04f=_(_0x46a04f)[_0xae13('0x8f')](_0x2287c8)[_0xae13('0x90')]()[_0xae13('0x30')]();return db[_0xae13('0x3b')]['find']({'where':{'id':_0x59dbff[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](function(_0xb28977){return db[_0xae13('0x76')][_0xae13('0x77')](function(_0xbd7690){return _0xb28977[_0xae13('0x80')](_0x59dbff['query'][_0xae13('0x91')],{'transaction':_0xbd7690})[_0xae13('0x36')](function(){if(!_['isEmpty'](_0x46a04f)){return _0xb28977[_0xae13('0x92')](_0x46a04f,{'transaction':_0xbd7690})[_0xae13('0x36')](function(){return db[_0xae13('0x93')][_0xae13('0x2a')]({'where':{'VoiceQueueId':_0x59dbff[_0xae13('0x4f')]['id'],'UserId':_0x46a04f},'transaction':_0xbd7690});});}})[_0xae13('0x36')](function(){_0x46a04f[_0xae13('0x7f')](function(_0x303f96){socket[_0xae13('0x94')]('userVoiceQueue:remove',{'UserId':_0x303f96,'VoiceQueueId':_0xb28977['id']});});});});});});})[_0xae13('0x36')](respondWithStatusCode(_0x5e05c7,null))[_0xae13('0x4e')](handleError(_0x5e05c7,null));};exports[_0xae13('0x95')]=function(_0x4cd1fc,_0x4e0710,_0x5a711b){var _0x1096fe,_0xa1aa0;return db[_0xae13('0x3b')][_0xae13('0x33')]({'where':{'id':_0x4cd1fc[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x4e0710,null))[_0xae13('0x36')](function(_0x2e320d){if(_0x2e320d){_0xa1aa0=_0x2e320d;return _0x2e320d[_0xae13('0x95')](_0x4cd1fc['body'][_0xae13('0x91')],_['omit'](_0x4cd1fc['body'],[_0xae13('0x91'),'id'])||{})[_0xae13('0x96')](function(_0x59fca1){for(var _0x3e6229=0x0;_0x3e6229<_0x4cd1fc[_0xae13('0x51')][_0xae13('0x91')][_0xae13('0x42')];_0x3e6229+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x4cd1fc[_0xae13('0x51')][_0xae13('0x91')][_0x3e6229],'VoiceQueueId':_0x4cd1fc[_0xae13('0x4f')]['id']});}return _0x59fca1;});}})['then'](function(_0x5ff432){_0x1096fe=_0x5ff432||[];if(_0xa1aa0){return db[_0xae13('0x70')][_0xae13('0x4c')]({'where':{'id':_0x4cd1fc[_0xae13('0x51')][_0xae13('0x91')]},'attributes':['id',_0xae13('0x34'),_0xae13('0x97'),_0xae13('0x71'),_0xae13('0x72')],'raw':!![]});}})['then'](function(_0x1b0f48){if(!_[_0xae13('0x98')](_0x1b0f48)){var _0x1c470d=[];for(var _0x14b705=0x0;_0x14b705<_0x1b0f48[_0xae13('0x42')];_0x14b705++){if(_0x1b0f48[_0x14b705]['online']){_0x1c470d[_0xae13('0x99')](db[_0xae13('0x93')][_0xae13('0x7b')]({'membername':_0x1b0f48[_0x14b705]['name'],'UserId':_0x1b0f48[_0x14b705]['id'],'queue_name':_0xa1aa0[_0xae13('0x34')],'VoiceQueueId':_0xa1aa0['id'],'interface':_['isNil'](_0x1b0f48[_0x14b705][_0xae13('0x72')])?util[_0xae13('0x7d')](_0xae13('0x7e'),_0x1b0f48[_0x14b705]['name']):_0x1b0f48[_0x14b705][_0xae13('0x72')],'paused':_0x1b0f48[_0x14b705][_0xae13('0x71')]||![],'penalty':_0x4cd1fc[_0xae13('0x51')][_0xae13('0x74')]||0x0}));}}return BPromise[_0xae13('0x8e')](_0x1c470d);}})[_0xae13('0x36')](function(){return _0x1096fe;})['then'](respondWithResult(_0x4e0710,null))['catch'](handleError(_0x4e0710,null));};exports[_0xae13('0x92')]=function(_0x31b6fd,_0x2c0f91,_0x2607e5){return db['VoiceQueue'][_0xae13('0x33')]({'where':{'id':_0x31b6fd[_0xae13('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c0f91,null))[_0xae13('0x36')](function(_0x142405){if(_0x142405){return _0x142405[_0xae13('0x92')](_0x31b6fd[_0xae13('0x3e')][_0xae13('0x91')])[_0xae13('0x36')](function(){if(_[_0xae13('0x9a')](_0x31b6fd[_0xae13('0x3e')][_0xae13('0x91')])){for(var _0x2b6db6=0x0;_0x2b6db6<_0x31b6fd['query'][_0xae13('0x91')]['length'];_0x2b6db6+=0x1){socket[_0xae13('0x94')](_0xae13('0x9b'),{'UserId':Number(_0x31b6fd[_0xae13('0x3e')][_0xae13('0x91')][_0x2b6db6]),'VoiceQueueId':Number(_0x31b6fd[_0xae13('0x4f')]['id'])});}}else{socket[_0xae13('0x94')](_0xae13('0x9b'),{'UserId':Number(_0x31b6fd[_0xae13('0x3e')]['ids']),'VoiceQueueId':Number(_0x31b6fd['params']['id'])});}});}})[_0xae13('0x36')](function(_0x8b2855){return db[_0xae13('0x93')][_0xae13('0x2a')]({'where':{'VoiceQueueId':_0x31b6fd['params']['id'],'UserId':_0x31b6fd['query'][_0xae13('0x91')]}})[_0xae13('0x36')](function(){return _0x8b2855;});})[_0xae13('0x36')](respondWithStatusCode(_0x2c0f91,null))[_0xae13('0x4e')](handleError(_0x2c0f91,null));};exports[_0xae13('0x9c')]=function(_0x220f78,_0x54a4d8,_0x4eb7f7){var _0xb6beb7={};var _0x597784={};var _0x154cfb;var _0x4cb2bd;return db['VoiceQueue'][_0xae13('0x62')]({'where':{'id':_0x220f78['params']['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x54a4d8,null))[_0xae13('0x36')](function(_0x58a7e6){if(_0x58a7e6){_0x154cfb=_0x58a7e6;_0x597784[_0xae13('0x3c')]=_[_0xae13('0x3d')](db[_0xae13('0x70')][_0xae13('0x58')]);_0x597784[_0xae13('0x3e')]=_['keys'](_0x220f78[_0xae13('0x3e')]);_0x597784['filters']=_[_0xae13('0x40')](_0x597784[_0xae13('0x3c')],_0x597784[_0xae13('0x3e')]);_0xb6beb7[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x597784['model'],qs['fields'](_0x220f78[_0xae13('0x3e')][_0xae13('0x41')]));_0xb6beb7[_0xae13('0x3f')]=_0xb6beb7['attributes']['length']?_0xb6beb7[_0xae13('0x3f')]:_0x597784['model'];_0xb6beb7['order']=qs[_0xae13('0x44')](_0x220f78['query'][_0xae13('0x44')]);_0xb6beb7['where']=qs[_0xae13('0x46')](_[_0xae13('0x47')](_0x220f78[_0xae13('0x3e')],_0x597784[_0xae13('0x46')]));if(_0x220f78[_0xae13('0x3e')][_0xae13('0x2e')]){_0xb6beb7[_0xae13('0x45')]=_[_0xae13('0x48')](_0xb6beb7[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0xb6beb7[_0xae13('0x3f')],function(_0x316973){var _0x311f4f={};_0x311f4f[_0x316973]={'$like':'%'+_0x220f78[_0xae13('0x3e')]['filter']+'%'};return _0x311f4f;})});}_0xb6beb7=_['merge']({},_0xb6beb7,_0x220f78[_0xae13('0x5a')]);return _0x154cfb[_0xae13('0x9c')](_0xb6beb7);}})[_0xae13('0x36')](function(_0x32542d){if(_0x32542d){_0x4cb2bd=_0x32542d[_0xae13('0x42')];if(!_0x220f78[_0xae13('0x3e')]['hasOwnProperty'](_0xae13('0x67'))){_0xb6beb7[_0xae13('0x23')]=qs[_0xae13('0x23')](_0x220f78[_0xae13('0x3e')][_0xae13('0x23')]);_0xb6beb7[_0xae13('0x22')]=qs['offset'](_0x220f78['query']['offset']);}return _0x154cfb['getAgents'](_0xb6beb7);}})[_0xae13('0x36')](function(_0x283a9a){if(_0x283a9a){return _0x283a9a?{'count':_0x4cb2bd,'rows':_0x283a9a}:null;}})[_0xae13('0x36')](respondWithResult(_0x54a4d8,null))[_0xae13('0x4e')](handleError(_0x54a4d8,null));};exports['getMembers']=function(_0x457e94,_0x27e34a,_0x18c92b){var _0x20cb87={};var _0x579a29={};var _0x1694cc;var _0x10ada8;return db['VoiceQueue'][_0xae13('0x62')]({'where':{'id':_0x457e94[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x27e34a,null))[_0xae13('0x36')](function(_0x401203){if(_0x401203){_0x1694cc=_0x401203;_0x579a29[_0xae13('0x3c')]=_[_0xae13('0x3d')](db[_0xae13('0x93')]['rawAttributes']);_0x579a29[_0xae13('0x3e')]=_[_0xae13('0x3d')](_0x457e94[_0xae13('0x3e')]);_0x579a29[_0xae13('0x46')]=_[_0xae13('0x40')](_0x579a29[_0xae13('0x3c')],_0x579a29[_0xae13('0x3e')]);_0x20cb87[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x579a29['model'],qs[_0xae13('0x41')](_0x457e94[_0xae13('0x3e')][_0xae13('0x41')]));_0x20cb87[_0xae13('0x3f')]=_0x20cb87[_0xae13('0x3f')][_0xae13('0x42')]?_0x20cb87[_0xae13('0x3f')]:_0x579a29[_0xae13('0x3c')];_0x20cb87['order']=qs['sort'](_0x457e94['query'][_0xae13('0x44')]);_0x20cb87[_0xae13('0x45')]=qs[_0xae13('0x46')](_[_0xae13('0x47')](_0x457e94[_0xae13('0x3e')],_0x579a29[_0xae13('0x46')]));if(_0x457e94[_0xae13('0x3e')][_0xae13('0x2e')]){_0x20cb87[_0xae13('0x45')]=_[_0xae13('0x48')](_0x20cb87[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0x20cb87[_0xae13('0x3f')],function(_0x16eb1d){var _0x2b4f99={};_0x2b4f99[_0x16eb1d]={'$like':'%'+_0x457e94['query'][_0xae13('0x2e')]+'%'};return _0x2b4f99;})});}_0x20cb87=_[_0xae13('0x48')]({},_0x20cb87,_0x457e94[_0xae13('0x5a')]);return _0x1694cc[_0xae13('0x9d')](_0x20cb87);}})['then'](function(_0x404c14){if(_0x404c14){_0x10ada8=_0x404c14[_0xae13('0x42')];if(!_0x457e94[_0xae13('0x3e')][_0xae13('0x43')](_0xae13('0x67'))){_0x20cb87['limit']=qs['limit'](_0x457e94[_0xae13('0x3e')][_0xae13('0x23')]);_0x20cb87[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x457e94[_0xae13('0x3e')]['offset']);}return _0x1694cc[_0xae13('0x9d')](_0x20cb87);}})['then'](function(_0x1cac65){return _0x1cac65?{'count':_0x10ada8,'rows':_0x1cac65}:null;})[_0xae13('0x36')](respondWithResult(_0x27e34a,null))[_0xae13('0x4e')](handleError(_0x27e34a,null));};exports[_0xae13('0x9e')]=function(_0x53cb5d,_0x20ef03,_0x2fab18){var _0x4d21a2={};var _0x3009ed={};var _0x484fba;var _0x4efe0a;return db[_0xae13('0x3b')][_0xae13('0x62')]({'where':{'id':_0x53cb5d[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x20ef03,null))['then'](function(_0x29e2bc){if(_0x29e2bc){_0x484fba=_0x29e2bc;_0x3009ed['model']=_['keys'](db[_0xae13('0x9f')][_0xae13('0x58')]);_0x3009ed[_0xae13('0x3e')]=_[_0xae13('0x3d')](_0x53cb5d[_0xae13('0x3e')]);_0x3009ed[_0xae13('0x46')]=_[_0xae13('0x40')](_0x3009ed[_0xae13('0x3c')],_0x3009ed[_0xae13('0x3e')]);_0x4d21a2[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x3009ed[_0xae13('0x3c')],qs['fields'](_0x53cb5d['query'][_0xae13('0x41')]));_0x4d21a2[_0xae13('0x3f')]=_0x4d21a2[_0xae13('0x3f')][_0xae13('0x42')]?_0x4d21a2['attributes']:_0x3009ed['model'];_0x4d21a2['order']=qs['sort'](_0x53cb5d[_0xae13('0x3e')][_0xae13('0x44')]);_0x4d21a2['where']=qs[_0xae13('0x46')](_['pick'](_0x53cb5d[_0xae13('0x3e')],_0x3009ed[_0xae13('0x46')]));if(_0x53cb5d[_0xae13('0x3e')][_0xae13('0x2e')]){_0x4d21a2[_0xae13('0x45')]=_['merge'](_0x4d21a2[_0xae13('0x45')],{'$or':_[_0xae13('0x2f')](_0x4d21a2[_0xae13('0x3f')],function(_0x128010){var _0x56573a={};_0x56573a[_0x128010]={'$like':'%'+_0x53cb5d['query'][_0xae13('0x2e')]+'%'};return _0x56573a;})});}_0x4d21a2=_[_0xae13('0x48')]({},_0x4d21a2,_0x53cb5d['options']);return _0x484fba[_0xae13('0x9e')](_0x4d21a2);}})[_0xae13('0x36')](function(_0x7db5bf){if(_0x7db5bf){_0x4efe0a=_0x7db5bf[_0xae13('0x42')];if(!_0x53cb5d['query'][_0xae13('0x43')](_0xae13('0x67'))){_0x4d21a2[_0xae13('0x23')]=qs[_0xae13('0x23')](_0x53cb5d['query'][_0xae13('0x23')]);_0x4d21a2[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x53cb5d[_0xae13('0x3e')][_0xae13('0x22')]);}return _0x484fba[_0xae13('0x9e')](_0x4d21a2);}})[_0xae13('0x36')](function(_0x165511){if(_0x165511){return _0x165511?{'count':_0x4efe0a,'rows':_0x165511}:null;}})[_0xae13('0x36')](respondWithResult(_0x20ef03,null))['catch'](handleError(_0x20ef03,null));};exports['addLists']=function(_0x39f92e,_0x525c49,_0x3a2ce7){var _0x19e690,_0x3099cb;return db[_0xae13('0x3b')][_0xae13('0x33')]({'where':{'id':_0x39f92e[_0xae13('0x4f')]['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x525c49,null))[_0xae13('0x36')](function(_0x36b088){if(_0x36b088){_0x3099cb=_0x36b088;return _0x36b088[_0xae13('0xa0')](_0x39f92e[_0xae13('0x51')][_0xae13('0x91')],_[_0xae13('0x5b')](_0x39f92e[_0xae13('0x51')],[_0xae13('0x91'),'id'])||{});}return null;})['spread'](function(_0x206bd3){var _0xf5d8c3;_0x19e690=_0x206bd3||[];var _0x3b3f7d=[];if(_0x206bd3){for(var _0x5b9c4e=0x0;_0x5b9c4e<_0x206bd3[_0xae13('0x42')];_0x5b9c4e+=0x1){var _0x2a0fd0=_0x206bd3[_0x5b9c4e][_0xae13('0x53')]({'plain':!![]});_0x3099cb[_0xae13('0xa1')]=_0x39f92e[_0xae13('0x51')][_0xae13('0xa1')]?_0x39f92e[_0xae13('0x51')][_0xae13('0xa1')]:_0x3099cb[_0xae13('0xa1')];switch(_0x3099cb[_0xae13('0xa1')]){case'always':_0xf5d8c3=squel[_0xae13('0xa2')]()[_0xae13('0xa3')]('cm_hopper')['fromQuery']([_0xae13('0xa4'),_0xae13('0xa5'),_0xae13('0xa6'),_0xae13('0xa7'),_0xae13('0x68'),_0xae13('0x5c'),_0xae13('0x5d')],squel['select']()[_0xae13('0x4a')]('phone',_0xae13('0xa4'))[_0xae13('0x4a')]('NOW()','scheduledAt')[_0xae13('0x4a')]('id',_0xae13('0xa6'))[_0xae13('0x4a')](_0x2a0fd0[_0xae13('0xa8')]['toString'](),_0xae13('0xa7'))[_0xae13('0x4a')](_0x39f92e[_0xae13('0x4f')]['id']['toString'](),_0xae13('0x68'))[_0xae13('0x4a')](_0xae13('0xa9'),_0xae13('0x5c'))['field'](_0xae13('0xa9'),_0xae13('0x5d'))[_0xae13('0x83')](_0xae13('0xaa'))['where'](_0xae13('0xab'))[_0xae13('0x45')]('ListId\x20=\x20?',_0x2a0fd0[_0xae13('0xa8')][_0xae13('0x89')]())[_0xae13('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xae13('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xae13('0x81')]()[_0xae13('0x4a')]('COALESCE(calleridnum,\x27\x27)')[_0xae13('0x83')](_0xae13('0xac'))[_0xae13('0x45')](_0xae13('0x87'),_0x39f92e['params']['id']['toString']()))[_0xae13('0x45')](_0xae13('0xad'),squel[_0xae13('0x81')]()['field'](_0xae13('0xae'))[_0xae13('0x83')]('cm_hopper')[_0xae13('0x45')](_0xae13('0x87'),_0x39f92e[_0xae13('0x4f')]['id'][_0xae13('0x89')]())))[_0xae13('0x89')]();break;case _0xae13('0xaf'):_0xf5d8c3=squel[_0xae13('0xa2')]()[_0xae13('0xa3')]('cm_hopper')['fromQuery']([_0xae13('0xa4'),'scheduledAt','ContactId','ListId','VoiceQueueId',_0xae13('0x5c'),'updatedAt'],squel['select']()[_0xae13('0x4a')](_0xae13('0xa4'),'phone')['field'](_0xae13('0xa9'),_0xae13('0xa5'))[_0xae13('0x4a')]('id',_0xae13('0xa6'))[_0xae13('0x4a')](_0x2a0fd0[_0xae13('0xa8')][_0xae13('0x89')](),_0xae13('0xa7'))['field'](_0x39f92e[_0xae13('0x4f')]['id'][_0xae13('0x89')](),_0xae13('0x68'))['field']('NOW()',_0xae13('0x5c'))[_0xae13('0x4a')]('NOW()',_0xae13('0x5d'))[_0xae13('0x83')](_0xae13('0xaa'))['where'](_0xae13('0xab'))[_0xae13('0x45')](_0xae13('0xb0'),_0x2a0fd0[_0xae13('0xa8')][_0xae13('0x89')]())[_0xae13('0x45')](_0xae13('0xb1'))[_0xae13('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xae13('0x81')]()[_0xae13('0x4a')](_0xae13('0xae'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x39f92e[_0xae13('0x4f')]['id'][_0xae13('0x89')]())))[_0xae13('0x89')]();break;default:_0xf5d8c3=squel[_0xae13('0xa2')]()[_0xae13('0xa3')](_0xae13('0xb2'))[_0xae13('0xb3')]([_0xae13('0xa4'),'scheduledAt','ContactId','ListId',_0xae13('0x68'),_0xae13('0x5c'),_0xae13('0x5d')],squel[_0xae13('0x81')]()[_0xae13('0x4a')](_0xae13('0xa4'),_0xae13('0xa4'))[_0xae13('0x4a')]('NOW()',_0xae13('0xa5'))[_0xae13('0x4a')]('id',_0xae13('0xa6'))[_0xae13('0x4a')](_0x2a0fd0['CmListId'][_0xae13('0x89')](),_0xae13('0xa7'))[_0xae13('0x4a')](_0x39f92e[_0xae13('0x4f')]['id'][_0xae13('0x89')](),_0xae13('0x68'))[_0xae13('0x4a')](_0xae13('0xa9'),_0xae13('0x5c'))['field'](_0xae13('0xa9'),_0xae13('0x5d'))[_0xae13('0x83')](_0xae13('0xaa'))[_0xae13('0x45')](_0xae13('0xab'))[_0xae13('0x45')](_0xae13('0xb0'),_0x2a0fd0['CmListId'][_0xae13('0x89')]())[_0xae13('0x45')](_0xae13('0xb1')))[_0xae13('0x89')]();}_0x3b3f7d[_0xae13('0x99')](db[_0xae13('0x76')][_0xae13('0x3e')](_0xf5d8c3));}return BPromise[_0xae13('0x8e')](_0x3b3f7d);}})[_0xae13('0x36')](function(){return _0x19e690;})['then'](respondWithResult(_0x525c49,null))[_0xae13('0x4e')](handleError(_0x525c49,null));};exports[_0xae13('0xb4')]=function(_0x40ef98,_0x5ec3ca,_0x5954b7){return db[_0xae13('0x3b')]['find']({'where':{'id':_0x40ef98[_0xae13('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ec3ca,null))['then'](function(_0x54b82c){if(_0x54b82c){return _0x54b82c[_0xae13('0xb4')](_0x40ef98[_0xae13('0x3e')]['ids']);}})[_0xae13('0x36')](function(_0x248325){if(_0x248325){return db[_0xae13('0x63')][_0xae13('0x2a')]({'where':{'ListId':_0x40ef98[_0xae13('0x3e')][_0xae13('0x91')],'VoiceQueueId':_0x40ef98['params']['id']}})[_0xae13('0x36')](function(){return _0x248325;});}})['then'](respondWithStatusCode(_0x5ec3ca,null))[_0xae13('0x4e')](handleError(_0x5ec3ca,null));};exports[_0xae13('0xb5')]=function(_0x3d9381,_0x505e9d,_0x304739){var _0x3b892f={};var _0x10fc5c={};var _0x2c190d;var _0x5b424c;return db['VoiceQueue'][_0xae13('0x62')]({'where':{'id':_0x3d9381[_0xae13('0x4f')]['id']}})['then'](handleEntityNotFound(_0x505e9d,null))['then'](function(_0x11cdad){if(_0x11cdad){_0x2c190d=_0x11cdad;_0x10fc5c['model']=_[_0xae13('0x3d')](db[_0xae13('0x9f')][_0xae13('0x58')]);_0x10fc5c['query']=_[_0xae13('0x3d')](_0x3d9381[_0xae13('0x3e')]);_0x10fc5c[_0xae13('0x46')]=_[_0xae13('0x40')](_0x10fc5c['model'],_0x10fc5c[_0xae13('0x3e')]);_0x3b892f[_0xae13('0x3f')]=_[_0xae13('0x40')](_0x10fc5c[_0xae13('0x3c')],qs[_0xae13('0x41')](_0x3d9381[_0xae13('0x3e')]['fields']));_0x3b892f[_0xae13('0x3f')]=_0x3b892f[_0xae13('0x3f')][_0xae13('0x42')]?_0x3b892f['attributes']:_0x10fc5c[_0xae13('0x3c')];_0x3b892f[_0xae13('0x64')]=qs['sort'](_0x3d9381[_0xae13('0x3e')][_0xae13('0x44')]);_0x3b892f[_0xae13('0x45')]=qs[_0xae13('0x46')](_['pick'](_0x3d9381[_0xae13('0x3e')],_0x10fc5c[_0xae13('0x46')]));if(_0x3d9381[_0xae13('0x3e')]['filter']){_0x3b892f[_0xae13('0x45')]=_[_0xae13('0x48')](_0x3b892f['where'],{'$or':_['map'](_0x3b892f[_0xae13('0x3f')],function(_0x353bc9){var _0x31a737={};_0x31a737[_0x353bc9]={'$like':'%'+_0x3d9381['query']['filter']+'%'};return _0x31a737;})});}_0x3b892f=_[_0xae13('0x48')]({},_0x3b892f,_0x3d9381[_0xae13('0x5a')]);return _0x2c190d[_0xae13('0xb5')](_0x3b892f);}})[_0xae13('0x36')](function(_0xb94e15){if(_0xb94e15){_0x5b424c=_0xb94e15[_0xae13('0x42')];if(!_0x3d9381[_0xae13('0x3e')]['hasOwnProperty'](_0xae13('0x67'))){_0x3b892f[_0xae13('0x23')]=qs[_0xae13('0x23')](_0x3d9381[_0xae13('0x3e')][_0xae13('0x23')]);_0x3b892f[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x3d9381[_0xae13('0x3e')]['offset']);}return _0x2c190d[_0xae13('0xb5')](_0x3b892f);}})[_0xae13('0x36')](function(_0x4d4c5a){if(_0x4d4c5a){return _0x4d4c5a?{'count':_0x5b424c,'rows':_0x4d4c5a}:null;}})['then'](respondWithResult(_0x505e9d,null))[_0xae13('0x4e')](handleError(_0x505e9d,null));};exports[_0xae13('0xb6')]=function(_0x520ec9,_0x1cbd66,_0x1cb104){var _0x4bd624,_0x495d98;return db[_0xae13('0x3b')]['find']({'where':{'id':_0x520ec9['params']['id']}})[_0xae13('0x36')](handleEntityNotFound(_0x1cbd66,null))['then'](function(_0x253739){if(_0x253739){_0x495d98=_0x253739;return _0x253739[_0xae13('0xb6')](_0x520ec9[_0xae13('0x51')][_0xae13('0x91')],_['omit'](_0x520ec9[_0xae13('0x51')],['ids','id'])||{});}return null;})[_0xae13('0x96')](function(_0x3bb5bc){var _0x57f2f4;_0x4bd624=_0x3bb5bc||[];var _0x36c1fe=[];if(_0x3bb5bc){for(var _0x31bf82=0x0;_0x31bf82<_0x3bb5bc[_0xae13('0x42')];_0x31bf82+=0x1){var _0x4d6145=_0x3bb5bc[_0x31bf82][_0xae13('0x53')]({'plain':!![]});_0x57f2f4=squel[_0xae13('0xa2')]()[_0xae13('0xa3')](_0xae13('0xb7'))['fromQuery']([_0xae13('0xa4'),_0xae13('0xa6'),_0xae13('0xa7'),_0xae13('0x68'),_0xae13('0x5c'),_0xae13('0x5d')],squel['select']()[_0xae13('0x4a')]('phone',_0xae13('0xa4'))[_0xae13('0x4a')]('id',_0xae13('0xa6'))['field'](_0x4d6145[_0xae13('0xa8')][_0xae13('0x89')](),_0xae13('0xa7'))[_0xae13('0x4a')](_0x520ec9[_0xae13('0x4f')]['id'][_0xae13('0x89')](),'VoiceQueueId')[_0xae13('0x4a')]('NOW()',_0xae13('0x5c'))[_0xae13('0x4a')](_0xae13('0xa9'),_0xae13('0x5d'))[_0xae13('0x83')](_0xae13('0xaa'))[_0xae13('0x45')](_0xae13('0xab'))[_0xae13('0x45')](_0xae13('0xb0'),_0x4d6145[_0xae13('0xa8')]['toString']())[_0xae13('0x45')](_0xae13('0xb1')))[_0xae13('0x89')]();_0x36c1fe['push'](db[_0xae13('0x76')][_0xae13('0x3e')](_0x57f2f4));}return BPromise[_0xae13('0x8e')](_0x36c1fe);}})[_0xae13('0x36')](function(){return _0x4bd624;})[_0xae13('0x36')](respondWithResult(_0x1cbd66,null))[_0xae13('0x4e')](handleError(_0x1cbd66,null));};exports['removeBlackLists']=function(_0x843a8f,_0x496b17,_0x2ffde7){return db[_0xae13('0x3b')][_0xae13('0x33')]({'where':{'id':_0x843a8f[_0xae13('0x4f')]['id']}})['then'](handleEntityNotFound(_0x496b17,null))['then'](function(_0x3f41a0){if(_0x3f41a0){return _0x3f41a0['removeBlackLists'](_0x843a8f[_0xae13('0x3e')][_0xae13('0x91')]);}})[_0xae13('0x36')](function(_0xb02d5e){if(_0xb02d5e){return db[_0xae13('0x6b')]['destroy']({'where':{'ListId':_0x843a8f[_0xae13('0x3e')][_0xae13('0x91')],'VoiceQueueId':_0x843a8f['params']['id']}})[_0xae13('0x36')](function(){return _0xb02d5e;});}})[_0xae13('0x36')](respondWithStatusCode(_0x496b17,null))[_0xae13('0x4e')](handleError(_0x496b17,null));}; \ No newline at end of file +var _0x16d2=['include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','inbound','QueueCampaigns','outbound','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','role','UserProfileSection','update','params','getHoppers','nolimit','VoiceQueueId','CmHopper','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','findAll','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','forEach','sequelize','transaction','each','UserVoiceQueue','findOrCreate','penalty','UserVoiceQueueRt','upsert','format','SIP/%s','userVoiceQueue:save','User','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','removeTeams','ids','isEmpty','removeAgents','addAgents','spread','emit','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','cm_contacts','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','insert','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','status','json','offset','set','apply','reject','save','then','get','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','end','stack','index','VoiceQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','merge','where','key','VIRTUAL','field','options','count','includeAll','rows','catch','show'];(function(_0xa725c1,_0x1502c5){var _0x56fb68=function(_0x931658){while(--_0x931658){_0xa725c1['push'](_0xa725c1['shift']());}};_0x56fb68(++_0x1502c5);}(_0x16d2,0x123));var _0x216d=function(_0x354dbb,_0x86929e){_0x354dbb=_0x354dbb-0x0;var _0x41d653=_0x16d2[_0x354dbb];return _0x41d653;};'use strict';var pdf=require(_0x216d('0x0'));var emlformat=require(_0x216d('0x1'));var rimraf=require(_0x216d('0x2'));var zipdir=require(_0x216d('0x3'));var jsonpatch=require(_0x216d('0x4'));var rp=require(_0x216d('0x5'));var moment=require(_0x216d('0x6'));var BPromise=require(_0x216d('0x7'));var Mustache=require(_0x216d('0x8'));var util=require('util');var path=require(_0x216d('0x9'));var sox=require(_0x216d('0xa'));var csv=require(_0x216d('0xb'));var ejs=require(_0x216d('0xc'));var fs=require('fs');var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xb'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x216d('0x16'))('api');var utils=require(_0x216d('0x17'));var config=require(_0x216d('0x18'));var db=require(_0x216d('0x19'))['db'];config[_0x216d('0x1a')]=_[_0x216d('0x1b')](config[_0x216d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x216d('0x1c'))(new Redis(config['redis']));require(_0x216d('0x1d'))[_0x216d('0x1e')](socket);function respondWithStatusCode(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xcc;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['sendStatus'](_0x165c19);}return _0x4dc2a2[_0x216d('0x1f')](_0x165c19)['end']();};}function respondWithResult(_0x448c0d,_0xf571a4){_0xf571a4=_0xf571a4||0xc8;return function(_0x4631b0){if(_0x4631b0){return _0x448c0d[_0x216d('0x1f')](_0xf571a4)[_0x216d('0x20')](_0x4631b0);}};}function respondWithFilteredResult(_0x304dfa,_0x467cd5){return function(_0x1496fe){if(_0x1496fe){var _0x19fdac=_0x1496fe['count'],_0x53d464=_0x467cd5[_0x216d('0x21')],_0x3b60dd=_0x467cd5[_0x216d('0x21')]+_0x467cd5['limit'],_0x5124ab;if(_0x3b60dd>=_0x19fdac){_0x3b60dd=_0x19fdac;_0x5124ab=0xc8;}else{_0x5124ab=0xce;}_0x304dfa[_0x216d('0x1f')](_0x5124ab);return _0x304dfa[_0x216d('0x22')]('Content-Range',_0x53d464+'-'+_0x3b60dd+'/'+_0x19fdac)[_0x216d('0x20')](_0x1496fe);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x23')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x24')](_0x5c3e03);}return _0x430e81[_0x216d('0x25')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x26')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x26')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x27')]({'plain':!![]});var _0x5998a1=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x32f240=_(_0x5998a1)[_0x216d('0x28')](_0x216d('0x29'))[_0x216d('0x2a')](_0x216d('0x2b'))['value']();if(_['includes'](_0x32f240,_0xab672[_0x216d('0x2c')])){return;}var _0x51b2bd=_[_0x216d('0x2d')](_0x5998a1,[_0x216d('0x2b'),_0xab672[_0x216d('0x2c')]])[_0x216d('0x2e')];return db[_0x216d('0x2f')][_0x216d('0x30')]({'where':{'type':_0x51b2bd,'resourceId':_0xab672['id']}})[_0x216d('0x26')](function(){return _0x6fa4b3;});})[_0x216d('0x26')](function(){_0x188494[_0x216d('0x1f')](0xcc)[_0x216d('0x31')]();});}};}function handleEntityNotFound(_0x11be90,_0x260134){return function(_0x4537fd){if(!_0x4537fd){_0x11be90['sendStatus'](0x194);}return _0x4537fd;};}function handleError(_0x38c452,_0x39962e){_0x39962e=_0x39962e||0x1f4;return function(_0x37e8e6){logger['error'](_0x37e8e6[_0x216d('0x32')]);if(_0x37e8e6[_0x216d('0x2e')]){delete _0x37e8e6[_0x216d('0x2e')];}_0x38c452[_0x216d('0x1f')](_0x39962e)['send'](_0x37e8e6);};}exports[_0x216d('0x33')]=function(_0x13120e,_0x43275e){var _0x18ffec={},_0x14d417={},_0x208bb6={'count':0x0,'rows':[]};var _0x2a2a0a=db[_0x216d('0x34')][_0x216d('0x35')];_0x14d417[_0x216d('0x36')]=_[_0x216d('0x37')](_0x2a2a0a);_0x14d417['query']=_[_0x216d('0x37')](_0x13120e[_0x216d('0x38')]);_0x14d417[_0x216d('0x39')]=_['intersection'](_0x14d417[_0x216d('0x36')],_0x14d417[_0x216d('0x38')]);_0x18ffec['attributes']=_[_0x216d('0x3a')](_0x14d417['model'],qs['fields'](_0x13120e[_0x216d('0x38')][_0x216d('0x3b')]));_0x18ffec[_0x216d('0x3c')]=_0x18ffec[_0x216d('0x3c')]['length']?_0x18ffec['attributes']:_0x14d417['model'];if(!_0x13120e[_0x216d('0x38')][_0x216d('0x3d')]('nolimit')){_0x18ffec[_0x216d('0x3e')]=qs[_0x216d('0x3e')](_0x13120e['query'][_0x216d('0x3e')]);_0x18ffec[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x13120e[_0x216d('0x38')][_0x216d('0x21')]);}_0x18ffec[_0x216d('0x3f')]=qs[_0x216d('0x40')](_0x13120e[_0x216d('0x38')]['sort']);_0x18ffec['where']=qs[_0x216d('0x39')](_[_0x216d('0x41')](_0x13120e['query'],_0x14d417[_0x216d('0x39')]));if(_0x13120e[_0x216d('0x38')][_0x216d('0x28')]){_0x18ffec['where']=_[_0x216d('0x42')](_0x18ffec[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x2a2a0a,function(_0x1b72ee){if(_0x1b72ee['type'][_0x216d('0x44')]!==_0x216d('0x45')){var _0x5665d7={};_0x5665d7[_0x1b72ee[_0x216d('0x46')]]={'$like':'%'+_0x13120e[_0x216d('0x38')]['filter']+'%'};return _0x5665d7;}})});}_0x18ffec=_['merge']({},_0x18ffec,_0x13120e[_0x216d('0x47')]);var _0x440bc9={'where':_0x18ffec[_0x216d('0x43')]};return db['VoiceQueue'][_0x216d('0x48')](_0x440bc9)['then'](function(_0x57ca1f){_0x208bb6[_0x216d('0x48')]=_0x57ca1f;if(_0x13120e[_0x216d('0x38')][_0x216d('0x49')]){_0x18ffec['include']=[{'all':!![]}];}return db[_0x216d('0x34')]['findAll'](_0x18ffec);})[_0x216d('0x26')](function(_0x1b022b){_0x208bb6[_0x216d('0x4a')]=_0x1b022b;return _0x208bb6;})['then'](respondWithFilteredResult(_0x43275e,_0x18ffec))[_0x216d('0x4b')](handleError(_0x43275e,null));};exports[_0x216d('0x4c')]=function(_0x198828,_0x381273){var _0x4c4d1d={'raw':![],'where':{'id':_0x198828['params']['id']}},_0x54b160={};_0x54b160[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x34')][_0x216d('0x35')]);_0x54b160[_0x216d('0x38')]=_[_0x216d('0x37')](_0x198828[_0x216d('0x38')]);_0x54b160[_0x216d('0x39')]=_['intersection'](_0x54b160[_0x216d('0x36')],_0x54b160[_0x216d('0x38')]);_0x4c4d1d[_0x216d('0x3c')]=_[_0x216d('0x3a')](_0x54b160['model'],qs[_0x216d('0x3b')](_0x198828['query'][_0x216d('0x3b')]));_0x4c4d1d[_0x216d('0x3c')]=_0x4c4d1d[_0x216d('0x3c')]['length']?_0x4c4d1d['attributes']:_0x54b160[_0x216d('0x36')];if(_0x198828[_0x216d('0x38')][_0x216d('0x49')]){_0x4c4d1d[_0x216d('0x4d')]=[{'all':!![]}];}_0x4c4d1d=_[_0x216d('0x42')]({},_0x4c4d1d,_0x198828[_0x216d('0x47')]);return db['VoiceQueue']['find'](_0x4c4d1d)[_0x216d('0x26')](handleEntityNotFound(_0x381273,null))['then'](respondWithResult(_0x381273,null))[_0x216d('0x4b')](handleError(_0x381273,null));};exports[_0x216d('0x4e')]=function(_0x526388,_0x480ee8){return db['VoiceQueue']['create'](_0x526388[_0x216d('0x4f')],{})[_0x216d('0x26')](function(_0x428a31){var _0x216f44=_0x526388[_0x216d('0x50')][_0x216d('0x27')]({'plain':!![]});if(!_0x216f44)throw new Error(_0x216d('0x51'));if(_0x216f44['role']===_0x216d('0x50')){var _0x34cdb9=_0x428a31[_0x216d('0x27')]({'plain':!![]});var _0x54dd49=[{'name':_0x216d('0x52'),'value':_0x216d('0x53')},{'name':_0x216d('0x54'),'value':_0x216d('0x55')}];var _0x481754=_[_0x216d('0x2d')](_0x54dd49,[_0x216d('0x2b'),_0x34cdb9[_0x216d('0x2c')]])[_0x216d('0x2e')];return db['UserProfileSection'][_0x216d('0x2d')]({'where':{'name':_0x481754,'userProfileId':_0x216f44[_0x216d('0x56')]},'raw':!![]})['then'](function(_0x1f86e0){if(_0x1f86e0&&_0x1f86e0['autoAssociation']===0x0){return db[_0x216d('0x2f')][_0x216d('0x4e')]({'name':_0x34cdb9[_0x216d('0x2e')],'resourceId':_0x34cdb9['id'],'type':_0x1f86e0[_0x216d('0x2e')],'sectionId':_0x1f86e0['id']},{})[_0x216d('0x26')](function(){return _0x428a31;});}else{return _0x428a31;}})[_0x216d('0x4b')](function(_0x24297f){logger[_0x216d('0x57')](_0x216d('0x58'),_0x24297f);throw _0x24297f;});}return _0x428a31;})['then'](respondWithResult(_0x480ee8,0xc9))[_0x216d('0x4b')](handleError(_0x480ee8,null));};exports[_0x216d('0x59')]=function(_0x51d65f,_0x241ce4){var _0x42ce51={'raw':![],'where':{'id':_0x51d65f['params']['id']}},_0x59fa28={};_0x59fa28[_0x216d('0x36')]=_['keys'](db[_0x216d('0x34')][_0x216d('0x35')]);_0x42ce51[_0x216d('0x3c')]=_['intersection'](_0x59fa28[_0x216d('0x36')],qs['fields'](_0x51d65f['query'][_0x216d('0x3b')]));_0x42ce51[_0x216d('0x3c')]=_0x42ce51['attributes'][_0x216d('0x5a')]?_0x42ce51[_0x216d('0x3c')]:_0x59fa28[_0x216d('0x36')];if(_0x51d65f[_0x216d('0x38')][_0x216d('0x49')]){_0x42ce51[_0x216d('0x4d')]=[{'all':!![]}];}_0x42ce51=_['merge']({},_0x42ce51,_0x51d65f['options']);return db[_0x216d('0x34')][_0x216d('0x2d')](_0x42ce51)[_0x216d('0x26')](handleEntityNotFound(_0x241ce4,null))[_0x216d('0x26')](function(_0x16742c){if(_0x16742c){var _0x22eac7=_0x16742c[_0x216d('0x27')]({'plain':!![]});_0x22eac7=qs[_0x216d('0x5b')](_0x22eac7,['id',_0x216d('0x5c'),_0x216d('0x5d')]);_0x51d65f[_0x216d('0x4f')]=_[_0x216d('0x5b')](_0x51d65f['body'],['id','createdAt',_0x216d('0x5d')]);return db[_0x216d('0x34')]['create'](_[_0x216d('0x42')](_0x22eac7,_0x51d65f['body']),{'include':_0x51d65f['query'][_0x216d('0x49')]?[{'all':!![]}]:undefined})[_0x216d('0x26')](function(_0x20806e){var _0x17ce26=_0x51d65f[_0x216d('0x50')][_0x216d('0x27')]({'plain':!![]});if(!_0x17ce26)throw new Error(_0x216d('0x51'));if(_0x17ce26[_0x216d('0x5e')]===_0x216d('0x50')){var _0x358993=_0x20806e[_0x216d('0x27')]({'plain':!![]});var _0x359c8f=[{'name':_0x216d('0x52'),'value':_0x216d('0x53')},{'name':_0x216d('0x54'),'value':_0x216d('0x55')}];var _0xb398cc=_[_0x216d('0x2d')](_0x359c8f,[_0x216d('0x2b'),_0x358993[_0x216d('0x2c')]])[_0x216d('0x2e')];return db[_0x216d('0x5f')]['find']({'where':{'name':_0xb398cc,'userProfileId':_0x17ce26[_0x216d('0x56')]},'raw':!![]})['then'](function(_0x45c222){if(_0x45c222&&_0x45c222['autoAssociation']===0x0){return db[_0x216d('0x2f')][_0x216d('0x4e')]({'name':_0x358993['name'],'resourceId':_0x358993['id'],'type':_0x45c222[_0x216d('0x2e')],'sectionId':_0x45c222['id']},{})[_0x216d('0x26')](function(){return _0x20806e;});}else{return _0x20806e;}})[_0x216d('0x4b')](function(_0x1d8f1a){logger[_0x216d('0x57')](_0x216d('0x58'),_0x1d8f1a);throw _0x1d8f1a;});}return _0x20806e;});}})[_0x216d('0x26')](respondWithResult(_0x241ce4,0xc9))[_0x216d('0x4b')](handleError(_0x241ce4,null));};exports[_0x216d('0x60')]=function(_0x5acc44,_0x120f8a){if(_0x5acc44[_0x216d('0x4f')]['id']){delete _0x5acc44[_0x216d('0x4f')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x5acc44['params']['id']}})['then'](handleEntityNotFound(_0x120f8a,null))[_0x216d('0x26')](saveUpdates(_0x5acc44['body'],null))[_0x216d('0x26')](respondWithResult(_0x120f8a,null))[_0x216d('0x4b')](handleError(_0x120f8a,null));};exports[_0x216d('0x30')]=function(_0x27ce4d,_0x431014){return db[_0x216d('0x34')][_0x216d('0x2d')]({'where':{'id':_0x27ce4d[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x431014,null))['then'](removeEntity(_0x431014,null))[_0x216d('0x4b')](handleError(_0x431014,null));};exports[_0x216d('0x62')]=function(_0x48c5dc,_0x38ef4f,_0x10a4e0){var _0x3249d8={'raw':![],'where':{}};var _0x1650fd={};var _0x12ca0a={'count':0x0,'rows':[]};return db[_0x216d('0x34')]['findOne']({'where':{'id':_0x48c5dc['params']['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x38ef4f,null))['then'](function(_0x425ae1){if(_0x425ae1){_0x1650fd[_0x216d('0x36')]=_[_0x216d('0x37')](db['CmHopper']['rawAttributes']);_0x1650fd['query']=_[_0x216d('0x37')](_0x48c5dc[_0x216d('0x38')]);_0x1650fd[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x1650fd['model'],_0x1650fd[_0x216d('0x38')]);_0x3249d8[_0x216d('0x3c')]=_[_0x216d('0x3a')](_0x1650fd['model'],qs['fields'](_0x48c5dc[_0x216d('0x38')][_0x216d('0x3b')]));_0x3249d8[_0x216d('0x3c')]=_0x3249d8[_0x216d('0x3c')][_0x216d('0x5a')]?_0x3249d8['attributes']:_0x1650fd[_0x216d('0x36')];if(!_0x48c5dc[_0x216d('0x38')][_0x216d('0x3d')](_0x216d('0x63'))){_0x3249d8['limit']=qs[_0x216d('0x3e')](_0x48c5dc['query'][_0x216d('0x3e')]);_0x3249d8['offset']=qs[_0x216d('0x21')](_0x48c5dc[_0x216d('0x38')][_0x216d('0x21')]);}_0x3249d8[_0x216d('0x3f')]=qs[_0x216d('0x40')](_0x48c5dc['query'][_0x216d('0x40')]);_0x3249d8['where']=qs['filters'](_['pick'](_0x48c5dc['query'],_0x1650fd[_0x216d('0x39')]));_0x3249d8[_0x216d('0x43')][_0x216d('0x64')]=_0x425ae1['id'];if(_0x48c5dc['query']['filter']){_0x3249d8[_0x216d('0x43')]=_[_0x216d('0x42')](_0x3249d8[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x3249d8[_0x216d('0x3c')],function(_0x5b3c78){var _0x5be30c={};_0x5be30c[_0x5b3c78]={'$like':'%'+_0x48c5dc[_0x216d('0x38')]['filter']+'%'};return _0x5be30c;})});}_0x3249d8=_[_0x216d('0x42')]({},_0x3249d8,_0x48c5dc['options']);return db[_0x216d('0x65')][_0x216d('0x48')]({'where':_0x3249d8[_0x216d('0x43')]})[_0x216d('0x26')](function(_0x4899d1){_0x12ca0a['count']=_0x4899d1;if(_0x48c5dc[_0x216d('0x38')][_0x216d('0x49')]){_0x3249d8[_0x216d('0x4d')]=[{'all':!![]}];}return db[_0x216d('0x65')]['findAll'](_0x3249d8);})[_0x216d('0x26')](function(_0x3116ac){_0x12ca0a[_0x216d('0x4a')]=_0x3116ac;return _0x12ca0a;});}})['then'](respondWithFilteredResult(_0x38ef4f,_0x3249d8))['catch'](handleError(_0x38ef4f,null));};exports[_0x216d('0x66')]=function(_0x4ba146,_0xb6fc7b,_0x6681fa){var _0x4bee99={'raw':!![],'where':{}};var _0x582e7f={};var _0x3000c4={'count':0x0,'rows':[]};return db[_0x216d('0x34')][_0x216d('0x67')]({'where':{'id':_0x4ba146[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0xb6fc7b,null))[_0x216d('0x26')](function(_0x5d37df){if(_0x5d37df){_0x582e7f['model']=_[_0x216d('0x37')](db[_0x216d('0x68')][_0x216d('0x35')]);_0x582e7f[_0x216d('0x38')]=_[_0x216d('0x37')](_0x4ba146[_0x216d('0x38')]);_0x582e7f[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x582e7f[_0x216d('0x36')],_0x582e7f[_0x216d('0x38')]);_0x4bee99['attributes']=_[_0x216d('0x3a')](_0x582e7f[_0x216d('0x36')],qs[_0x216d('0x3b')](_0x4ba146[_0x216d('0x38')][_0x216d('0x3b')]));_0x4bee99['attributes']=_0x4bee99[_0x216d('0x3c')]['length']?_0x4bee99[_0x216d('0x3c')]:_0x582e7f['model'];if(!_0x4ba146[_0x216d('0x38')]['hasOwnProperty']('nolimit')){_0x4bee99[_0x216d('0x3e')]=qs['limit'](_0x4ba146['query']['limit']);_0x4bee99[_0x216d('0x21')]=qs['offset'](_0x4ba146[_0x216d('0x38')]['offset']);}_0x4bee99['order']=qs['sort'](_0x4ba146[_0x216d('0x38')][_0x216d('0x40')]);_0x4bee99[_0x216d('0x43')]=qs['filters'](_[_0x216d('0x41')](_0x4ba146[_0x216d('0x38')],_0x582e7f[_0x216d('0x39')]));_0x4bee99[_0x216d('0x43')][_0x216d('0x64')]=_0x5d37df['id'];if(_0x4ba146[_0x216d('0x38')]['filter']){_0x4bee99[_0x216d('0x43')]=_['merge'](_0x4bee99[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x4bee99[_0x216d('0x3c')],function(_0x4240bc){var _0xc7542a={};_0xc7542a[_0x4240bc]={'$like':'%'+_0x4ba146[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0xc7542a;})});}_0x4bee99=_[_0x216d('0x42')]({},_0x4bee99,_0x4ba146[_0x216d('0x47')]);return db[_0x216d('0x68')][_0x216d('0x48')]({'where':_0x4bee99[_0x216d('0x43')]})[_0x216d('0x26')](function(_0x1d7f51){_0x3000c4[_0x216d('0x48')]=_0x1d7f51;if(_0x4ba146[_0x216d('0x38')]['includeAll']){_0x4bee99[_0x216d('0x4d')]=[{'all':!![]}];}return db[_0x216d('0x68')]['findAll'](_0x4bee99);})[_0x216d('0x26')](function(_0x4e92bf){_0x3000c4[_0x216d('0x4a')]=_0x4e92bf;return _0x3000c4;});}})[_0x216d('0x26')](respondWithFilteredResult(_0xb6fc7b,_0x4bee99))[_0x216d('0x4b')](handleError(_0xb6fc7b,null));};exports['getHopperFinals']=function(_0x2f98df,_0x49b7e4,_0x3f6e78){var _0x11fa74={'raw':!![],'where':{}};var _0x3db5a7={};var _0x1e1969={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x216d('0x67')]({'where':{'id':_0x2f98df[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x49b7e4,null))[_0x216d('0x26')](function(_0x2ad076){if(_0x2ad076){_0x3db5a7[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x69')][_0x216d('0x35')]);_0x3db5a7['query']=_[_0x216d('0x37')](_0x2f98df['query']);_0x3db5a7[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x3db5a7[_0x216d('0x36')],_0x3db5a7['query']);_0x11fa74['attributes']=_[_0x216d('0x3a')](_0x3db5a7['model'],qs[_0x216d('0x3b')](_0x2f98df[_0x216d('0x38')]['fields']));_0x11fa74[_0x216d('0x3c')]=_0x11fa74[_0x216d('0x3c')][_0x216d('0x5a')]?_0x11fa74[_0x216d('0x3c')]:_0x3db5a7['model'];if(!_0x2f98df[_0x216d('0x38')]['hasOwnProperty'](_0x216d('0x63'))){_0x11fa74[_0x216d('0x3e')]=qs[_0x216d('0x3e')](_0x2f98df[_0x216d('0x38')][_0x216d('0x3e')]);_0x11fa74[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x2f98df[_0x216d('0x38')][_0x216d('0x21')]);}_0x11fa74[_0x216d('0x3f')]=qs['sort'](_0x2f98df[_0x216d('0x38')][_0x216d('0x40')]);_0x11fa74[_0x216d('0x43')]=qs[_0x216d('0x39')](_[_0x216d('0x41')](_0x2f98df[_0x216d('0x38')],_0x3db5a7[_0x216d('0x39')]));_0x11fa74[_0x216d('0x43')]['VoiceQueueId']=_0x2ad076['id'];if(_0x2f98df[_0x216d('0x38')][_0x216d('0x28')]){_0x11fa74[_0x216d('0x43')]=_[_0x216d('0x42')](_0x11fa74[_0x216d('0x43')],{'$or':_['map'](_0x11fa74[_0x216d('0x3c')],function(_0xcff3){var _0x1dbf5c={};_0x1dbf5c[_0xcff3]={'$like':'%'+_0x2f98df['query']['filter']+'%'};return _0x1dbf5c;})});}_0x11fa74=_[_0x216d('0x42')]({},_0x11fa74,_0x2f98df[_0x216d('0x47')]);return db[_0x216d('0x69')][_0x216d('0x48')]({'where':_0x11fa74[_0x216d('0x43')]})[_0x216d('0x26')](function(_0x6dbccd){_0x1e1969['count']=_0x6dbccd;if(_0x2f98df[_0x216d('0x38')][_0x216d('0x49')]){_0x11fa74[_0x216d('0x4d')]=[{'all':!![]}];}return db[_0x216d('0x69')]['findAll'](_0x11fa74);})['then'](function(_0x4f453e){_0x1e1969[_0x216d('0x4a')]=_0x4f453e;return _0x1e1969;});}})[_0x216d('0x26')](respondWithFilteredResult(_0x49b7e4,_0x11fa74))['catch'](handleError(_0x49b7e4,null));};exports['getHopperBlacks']=function(_0x4e1bd3,_0xa39a23,_0x331fdc){var _0x1e10d={'raw':!![],'where':{}};var _0xb0dad2={};var _0x510c3e={'count':0x0,'rows':[]};return db[_0x216d('0x34')]['findOne']({'where':{'id':_0x4e1bd3[_0x216d('0x61')]['id']}})['then'](handleEntityNotFound(_0xa39a23,null))[_0x216d('0x26')](function(_0xb71af9){if(_0xb71af9){_0xb0dad2[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x6a')][_0x216d('0x35')]);_0xb0dad2['query']=_[_0x216d('0x37')](_0x4e1bd3['query']);_0xb0dad2[_0x216d('0x39')]=_[_0x216d('0x3a')](_0xb0dad2[_0x216d('0x36')],_0xb0dad2[_0x216d('0x38')]);_0x1e10d[_0x216d('0x3c')]=_['intersection'](_0xb0dad2[_0x216d('0x36')],qs[_0x216d('0x3b')](_0x4e1bd3[_0x216d('0x38')][_0x216d('0x3b')]));_0x1e10d[_0x216d('0x3c')]=_0x1e10d['attributes']['length']?_0x1e10d[_0x216d('0x3c')]:_0xb0dad2[_0x216d('0x36')];if(!_0x4e1bd3['query'][_0x216d('0x3d')](_0x216d('0x63'))){_0x1e10d[_0x216d('0x3e')]=qs[_0x216d('0x3e')](_0x4e1bd3['query'][_0x216d('0x3e')]);_0x1e10d['offset']=qs[_0x216d('0x21')](_0x4e1bd3['query']['offset']);}_0x1e10d[_0x216d('0x3f')]=qs['sort'](_0x4e1bd3[_0x216d('0x38')][_0x216d('0x40')]);_0x1e10d[_0x216d('0x43')]=qs[_0x216d('0x39')](_[_0x216d('0x41')](_0x4e1bd3[_0x216d('0x38')],_0xb0dad2[_0x216d('0x39')]));_0x1e10d['where'][_0x216d('0x64')]=_0xb71af9['id'];if(_0x4e1bd3[_0x216d('0x38')]['filter']){_0x1e10d[_0x216d('0x43')]=_[_0x216d('0x42')](_0x1e10d[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x1e10d[_0x216d('0x3c')],function(_0x1e01d4){var _0x3d183b={};_0x3d183b[_0x1e01d4]={'$like':'%'+_0x4e1bd3[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0x3d183b;})});}_0x1e10d=_[_0x216d('0x42')]({},_0x1e10d,_0x4e1bd3[_0x216d('0x47')]);return db[_0x216d('0x6a')]['count']({'where':_0x1e10d[_0x216d('0x43')]})[_0x216d('0x26')](function(_0x4cdd52){_0x510c3e[_0x216d('0x48')]=_0x4cdd52;if(_0x4e1bd3[_0x216d('0x38')][_0x216d('0x49')]){_0x1e10d[_0x216d('0x4d')]=[{'all':!![]}];}return db[_0x216d('0x6a')][_0x216d('0x6b')](_0x1e10d);})[_0x216d('0x26')](function(_0x32835e){_0x510c3e[_0x216d('0x4a')]=_0x32835e;return _0x510c3e;});}})[_0x216d('0x26')](respondWithFilteredResult(_0xa39a23,_0x1e10d))[_0x216d('0x4b')](handleError(_0xa39a23,null));};exports[_0x216d('0x6c')]=function(_0x50e32c,_0x39588c,_0x1c7571){var _0x2c1a85={};var _0x37ac6e={};var _0x2fe72e;var _0x454dbe;return db[_0x216d('0x34')][_0x216d('0x67')]({'where':{'id':_0x50e32c[_0x216d('0x61')]['id']}})['then'](handleEntityNotFound(_0x39588c,null))[_0x216d('0x26')](function(_0x4497ac){if(_0x4497ac){_0x2fe72e=_0x4497ac;_0x37ac6e[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x6d')]['rawAttributes']);_0x37ac6e[_0x216d('0x38')]=_[_0x216d('0x37')](_0x50e32c[_0x216d('0x38')]);_0x37ac6e[_0x216d('0x39')]=_['intersection'](_0x37ac6e[_0x216d('0x36')],_0x37ac6e[_0x216d('0x38')]);_0x2c1a85['attributes']=_[_0x216d('0x3a')](_0x37ac6e[_0x216d('0x36')],qs[_0x216d('0x3b')](_0x50e32c[_0x216d('0x38')]['fields']));_0x2c1a85[_0x216d('0x3c')]=_0x2c1a85[_0x216d('0x3c')][_0x216d('0x5a')]?_0x2c1a85['attributes']:_0x37ac6e[_0x216d('0x36')];_0x2c1a85[_0x216d('0x3f')]=qs['sort'](_0x50e32c['query'][_0x216d('0x40')]);_0x2c1a85[_0x216d('0x43')]=qs['filters'](_[_0x216d('0x41')](_0x50e32c['query'],_0x37ac6e[_0x216d('0x39')]));if(_0x50e32c[_0x216d('0x38')]['filter']){_0x2c1a85[_0x216d('0x43')]=_[_0x216d('0x42')](_0x2c1a85[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x2c1a85[_0x216d('0x3c')],function(_0x384a7e){var _0x572e06={};_0x572e06[_0x384a7e]={'$like':'%'+_0x50e32c[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0x572e06;})});}_0x2c1a85=_['merge']({},_0x2c1a85,_0x50e32c['options']);return _0x2fe72e['getTeams'](_0x2c1a85);}})[_0x216d('0x26')](function(_0x364247){if(_0x364247){_0x454dbe=_0x364247[_0x216d('0x5a')];if(!_0x50e32c[_0x216d('0x38')]['hasOwnProperty'](_0x216d('0x63'))){_0x2c1a85['limit']=qs['limit'](_0x50e32c[_0x216d('0x38')]['limit']);_0x2c1a85[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x50e32c['query'][_0x216d('0x21')]);}return _0x2fe72e['getTeams'](_0x2c1a85);}})[_0x216d('0x26')](function(_0x3ee6fa){if(_0x3ee6fa){return _0x3ee6fa?{'count':_0x454dbe,'rows':_0x3ee6fa}:null;}})[_0x216d('0x26')](respondWithResult(_0x39588c,null))[_0x216d('0x4b')](handleError(_0x39588c,null));};exports[_0x216d('0x6e')]=function(_0x6bb264,_0x330732,_0x3a2eb3){var _0x2242e9=_0x6bb264['body'][_0x216d('0x6f')];return db[_0x216d('0x6d')]['findAll']({'where':{'id':_[_0x216d('0x2a')](_0x2242e9,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x216d('0x70'),'attributes':['id',_0x216d('0x2e'),_0x216d('0x71'),_0x216d('0x72'),_0x216d('0x73')],'raw':!![]}]})['then'](function(_0x19ceb3){if(_0x19ceb3){var _0x5e7173=_[_0x216d('0x74')](_0x19ceb3,function(_0x3ac58c){var _0x54de16=_0x3ac58c['get']({'plain':!![]});_0x54de16[_0x216d('0x70')][_0x216d('0x75')](function(_0x1cbc9a){_0x1cbc9a['penalty']=_['find'](_0x2242e9,{'id':_0x54de16['id']})['penalty'];});return _0x54de16[_0x216d('0x70')];});return db[_0x216d('0x34')][_0x216d('0x2d')]({'where':{'id':_0x6bb264[_0x216d('0x61')]['id']}})[_0x216d('0x26')](function(_0x579543){return db[_0x216d('0x76')][_0x216d('0x77')](function(_0x3b1806){return _0x579543['addTeams'](_[_0x216d('0x2a')](_0x2242e9,'id'),{'transaction':_0x3b1806})[_0x216d('0x26')](function(){return BPromise[_0x216d('0x78')](_0x5e7173,function(_0x527456){return db[_0x216d('0x79')][_0x216d('0x7a')]({'where':{'UserId':_0x527456['id'],'VoiceQueueId':_0x6bb264['params']['id']},'defaults':{'penalty':_0x527456[_0x216d('0x7b')]},'transaction':_0x3b1806});});})[_0x216d('0x26')](function(){return BPromise[_0x216d('0x78')](_[_0x216d('0x28')](_0x5e7173,{'online':!![]}),function(_0x24c7ab){return db[_0x216d('0x7c')][_0x216d('0x7d')]({'membername':_0x24c7ab[_0x216d('0x2e')],'UserId':_0x24c7ab['id'],'queue_name':_0x579543[_0x216d('0x2e')],'VoiceQueueId':_0x579543['id'],'interface':_['isNil'](_0x24c7ab['interface'])?util[_0x216d('0x7e')](_0x216d('0x7f'),_0x24c7ab[_0x216d('0x2e')]):_0x24c7ab[_0x216d('0x73')],'paused':_0x24c7ab[_0x216d('0x72')]||![],'penalty':_0x24c7ab['penalty']},{'transaction':_0x3b1806});});})[_0x216d('0x26')](function(){_0x5e7173[_0x216d('0x75')](function(_0x3beb69){socket['emit'](_0x216d('0x80'),{'UserId':_0x3beb69['id'],'VoiceQueueId':_0x579543['id']});});});});});}})[_0x216d('0x26')](respondWithStatusCode(_0x330732,null))['catch'](handleError(_0x330732,null));};exports['removeTeams']=function(_0x1111f6,_0x4b0a64,_0x95d743){return db[_0x216d('0x6d')]['findAll']({'where':{'id':_0x1111f6['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x216d('0x81')],'as':_0x216d('0x70'),'attributes':['id'],'raw':!![]}]})[_0x216d('0x26')](handleEntityNotFound(_0x4b0a64,null))[_0x216d('0x26')](function(_0x57dd8a){var _0x5920cc=_[_0x216d('0x2a')](_0x57dd8a,'id');var _0x4b37cb=[];var _0x28d7d8=[];var _0xd57985=squel[_0x216d('0x82')]();_0xd57985[_0x216d('0x46')](_0x216d('0x83'))[_0x216d('0x84')](_0x216d('0x85'),'tq')[_0x216d('0x86')]('user_has_teams','ut',_0x216d('0x87'))[_0x216d('0x43')](_0x216d('0x88'),_0x1111f6[_0x216d('0x61')]['id']);for(var _0xd5f8dc=0x0;_0xd5f8dc<_0x57dd8a['length'];_0xd5f8dc+=0x1){let _0x8150bd=_0x57dd8a[_0xd5f8dc];for(var _0x4b2ee6=0x0;_0x4b2ee6<_0x8150bd[_0x216d('0x70')][_0x216d('0x5a')];_0x4b2ee6+=0x1){let _0x52eac4=_0x8150bd[_0x216d('0x70')][_0x4b2ee6];var _0x31c3ff=_0xd57985[_0x216d('0x59')]();_0x31c3ff[_0x216d('0x43')](_0x216d('0x89'),_0x52eac4['id']);_0x28d7d8[_0x216d('0x8a')](db[_0x216d('0x76')][_0x216d('0x38')](_0x31c3ff[_0x216d('0x8b')](),{'type':db[_0x216d('0x76')][_0x216d('0x8c')]['SELECT']})[_0x216d('0x26')](function(_0x392d8f){if(_0x392d8f[_0x216d('0x5a')]===0x1){return _0x52eac4['id'];}else{var _0x3bd0e3=_[_0x216d('0x8d')](_[_0x216d('0x2a')](_0x392d8f,_0x216d('0x8e')),function(_0xc3e629){return _['includes'](_0x5920cc,_0xc3e629);});if(_0x3bd0e3){return _0x52eac4['id'];}}}));}}return BPromise[_0x216d('0x8f')](_0x28d7d8)['then'](function(_0x31ce60){_0x4b37cb=_(_0x4b37cb)[_0x216d('0x90')](_0x31ce60)[_0x216d('0x91')]()[_0x216d('0x2b')]();return db['VoiceQueue'][_0x216d('0x2d')]({'where':{'id':_0x1111f6['params']['id']}})['then'](function(_0x4bbdc1){return db[_0x216d('0x76')][_0x216d('0x77')](function(_0x10a30a){return _0x4bbdc1[_0x216d('0x92')](_0x1111f6[_0x216d('0x38')][_0x216d('0x93')],{'transaction':_0x10a30a})[_0x216d('0x26')](function(){if(!_[_0x216d('0x94')](_0x4b37cb)){return _0x4bbdc1[_0x216d('0x95')](_0x4b37cb,{'transaction':_0x10a30a})[_0x216d('0x26')](function(){return db[_0x216d('0x7c')][_0x216d('0x30')]({'where':{'VoiceQueueId':_0x1111f6['params']['id'],'UserId':_0x4b37cb},'transaction':_0x10a30a});});}})['then'](function(){_0x4b37cb[_0x216d('0x75')](function(_0x218c94){socket['emit']('userVoiceQueue:remove',{'UserId':_0x218c94,'VoiceQueueId':_0x4bbdc1['id']});});});});});});})['then'](respondWithStatusCode(_0x4b0a64,null))['catch'](handleError(_0x4b0a64,null));};exports['addAgents']=function(_0x57d1f8,_0x467ec7,_0x197690){var _0x5311e9,_0x1271cc;return db['VoiceQueue'][_0x216d('0x2d')]({'where':{'id':_0x57d1f8[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x467ec7,null))[_0x216d('0x26')](function(_0x5dd573){if(_0x5dd573){_0x1271cc=_0x5dd573;return _0x5dd573[_0x216d('0x96')](_0x57d1f8[_0x216d('0x4f')][_0x216d('0x93')],_[_0x216d('0x5b')](_0x57d1f8[_0x216d('0x4f')],[_0x216d('0x93'),'id'])||{})[_0x216d('0x97')](function(_0xb4fefa){for(var _0x64201a=0x0;_0x64201a<_0x57d1f8[_0x216d('0x4f')][_0x216d('0x93')]['length'];_0x64201a+=0x1){socket[_0x216d('0x98')](_0x216d('0x80'),{'UserId':_0x57d1f8[_0x216d('0x4f')]['ids'][_0x64201a],'VoiceQueueId':_0x57d1f8['params']['id']});}return _0xb4fefa;});}})[_0x216d('0x26')](function(_0x15e7a7){_0x5311e9=_0x15e7a7||[];if(_0x1271cc){return db['User'][_0x216d('0x6b')]({'where':{'id':_0x57d1f8['body'][_0x216d('0x93')]},'attributes':['id',_0x216d('0x2e'),_0x216d('0x71'),_0x216d('0x72'),_0x216d('0x73')],'raw':!![]});}})['then'](function(_0x230e81){if(!_[_0x216d('0x94')](_0x230e81)){var _0x3e6069=[];for(var _0x4b5c4c=0x0;_0x4b5c4c<_0x230e81[_0x216d('0x5a')];_0x4b5c4c++){if(_0x230e81[_0x4b5c4c]['online']){_0x3e6069[_0x216d('0x8a')](db['UserVoiceQueueRt'][_0x216d('0x7d')]({'membername':_0x230e81[_0x4b5c4c][_0x216d('0x2e')],'UserId':_0x230e81[_0x4b5c4c]['id'],'queue_name':_0x1271cc[_0x216d('0x2e')],'VoiceQueueId':_0x1271cc['id'],'interface':_['isNil'](_0x230e81[_0x4b5c4c][_0x216d('0x73')])?util['format']('SIP/%s',_0x230e81[_0x4b5c4c][_0x216d('0x2e')]):_0x230e81[_0x4b5c4c][_0x216d('0x73')],'paused':_0x230e81[_0x4b5c4c][_0x216d('0x72')]||![],'penalty':_0x57d1f8[_0x216d('0x4f')]['penalty']||0x0}));}}return BPromise['all'](_0x3e6069);}})['then'](function(){return _0x5311e9;})['then'](respondWithResult(_0x467ec7,null))[_0x216d('0x4b')](handleError(_0x467ec7,null));};exports[_0x216d('0x95')]=function(_0x10ed47,_0x680f91,_0x22dd06){return db['VoiceQueue'][_0x216d('0x2d')]({'where':{'id':_0x10ed47[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x680f91,null))[_0x216d('0x26')](function(_0x1f9973){if(_0x1f9973){return _0x1f9973[_0x216d('0x95')](_0x10ed47['query'][_0x216d('0x93')])[_0x216d('0x26')](function(){if(_[_0x216d('0x99')](_0x10ed47[_0x216d('0x38')][_0x216d('0x93')])){for(var _0x3cb919=0x0;_0x3cb919<_0x10ed47[_0x216d('0x38')][_0x216d('0x93')][_0x216d('0x5a')];_0x3cb919+=0x1){socket[_0x216d('0x98')](_0x216d('0x9a'),{'UserId':Number(_0x10ed47[_0x216d('0x38')][_0x216d('0x93')][_0x3cb919]),'VoiceQueueId':Number(_0x10ed47[_0x216d('0x61')]['id'])});}}else{socket['emit'](_0x216d('0x9a'),{'UserId':Number(_0x10ed47[_0x216d('0x38')][_0x216d('0x93')]),'VoiceQueueId':Number(_0x10ed47[_0x216d('0x61')]['id'])});}});}})['then'](function(_0x4ad5dc){return db[_0x216d('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x10ed47[_0x216d('0x61')]['id'],'UserId':_0x10ed47[_0x216d('0x38')][_0x216d('0x93')]}})[_0x216d('0x26')](function(){return _0x4ad5dc;});})[_0x216d('0x26')](respondWithStatusCode(_0x680f91,null))[_0x216d('0x4b')](handleError(_0x680f91,null));};exports[_0x216d('0x9b')]=function(_0x1e2052,_0x213fd0,_0x4623d7){var _0x4f4acd={};var _0x5cc798={};var _0xb808f3;var _0x6f0975;return db[_0x216d('0x34')][_0x216d('0x67')]({'where':{'id':_0x1e2052[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x213fd0,null))['then'](function(_0x4a5e4f){if(_0x4a5e4f){_0xb808f3=_0x4a5e4f;_0x5cc798[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x81')]['rawAttributes']);_0x5cc798[_0x216d('0x38')]=_[_0x216d('0x37')](_0x1e2052['query']);_0x5cc798[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x5cc798['model'],_0x5cc798[_0x216d('0x38')]);_0x4f4acd[_0x216d('0x3c')]=_[_0x216d('0x3a')](_0x5cc798['model'],qs[_0x216d('0x3b')](_0x1e2052['query']['fields']));_0x4f4acd[_0x216d('0x3c')]=_0x4f4acd['attributes']['length']?_0x4f4acd[_0x216d('0x3c')]:_0x5cc798[_0x216d('0x36')];_0x4f4acd['order']=qs[_0x216d('0x40')](_0x1e2052[_0x216d('0x38')][_0x216d('0x40')]);_0x4f4acd['where']=qs[_0x216d('0x39')](_[_0x216d('0x41')](_0x1e2052[_0x216d('0x38')],_0x5cc798['filters']));if(_0x1e2052[_0x216d('0x38')][_0x216d('0x28')]){_0x4f4acd[_0x216d('0x43')]=_[_0x216d('0x42')](_0x4f4acd[_0x216d('0x43')],{'$or':_['map'](_0x4f4acd[_0x216d('0x3c')],function(_0x38f8db){var _0x46a02c={};_0x46a02c[_0x38f8db]={'$like':'%'+_0x1e2052[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0x46a02c;})});}_0x4f4acd=_['merge']({},_0x4f4acd,_0x1e2052[_0x216d('0x47')]);return _0xb808f3[_0x216d('0x9b')](_0x4f4acd);}})[_0x216d('0x26')](function(_0x3543d6){if(_0x3543d6){_0x6f0975=_0x3543d6[_0x216d('0x5a')];if(!_0x1e2052[_0x216d('0x38')][_0x216d('0x3d')](_0x216d('0x63'))){_0x4f4acd[_0x216d('0x3e')]=qs['limit'](_0x1e2052[_0x216d('0x38')]['limit']);_0x4f4acd['offset']=qs['offset'](_0x1e2052[_0x216d('0x38')][_0x216d('0x21')]);}return _0xb808f3[_0x216d('0x9b')](_0x4f4acd);}})['then'](function(_0x36c1f1){if(_0x36c1f1){return _0x36c1f1?{'count':_0x6f0975,'rows':_0x36c1f1}:null;}})[_0x216d('0x26')](respondWithResult(_0x213fd0,null))[_0x216d('0x4b')](handleError(_0x213fd0,null));};exports['getMembers']=function(_0x5e5f0e,_0x116a80,_0x366001){var _0x394b7f={};var _0x1ffab8={};var _0x526a01;var _0x3c7f58;return db['VoiceQueue'][_0x216d('0x67')]({'where':{'id':_0x5e5f0e['params']['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x116a80,null))[_0x216d('0x26')](function(_0x3a5c25){if(_0x3a5c25){_0x526a01=_0x3a5c25;_0x1ffab8['model']=_[_0x216d('0x37')](db[_0x216d('0x7c')][_0x216d('0x35')]);_0x1ffab8[_0x216d('0x38')]=_['keys'](_0x5e5f0e[_0x216d('0x38')]);_0x1ffab8[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x1ffab8['model'],_0x1ffab8['query']);_0x394b7f[_0x216d('0x3c')]=_[_0x216d('0x3a')](_0x1ffab8[_0x216d('0x36')],qs[_0x216d('0x3b')](_0x5e5f0e[_0x216d('0x38')][_0x216d('0x3b')]));_0x394b7f[_0x216d('0x3c')]=_0x394b7f[_0x216d('0x3c')]['length']?_0x394b7f[_0x216d('0x3c')]:_0x1ffab8[_0x216d('0x36')];_0x394b7f[_0x216d('0x3f')]=qs['sort'](_0x5e5f0e['query'][_0x216d('0x40')]);_0x394b7f[_0x216d('0x43')]=qs[_0x216d('0x39')](_[_0x216d('0x41')](_0x5e5f0e['query'],_0x1ffab8[_0x216d('0x39')]));if(_0x5e5f0e[_0x216d('0x38')]['filter']){_0x394b7f['where']=_['merge'](_0x394b7f[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x394b7f[_0x216d('0x3c')],function(_0x116e3d){var _0x507619={};_0x507619[_0x116e3d]={'$like':'%'+_0x5e5f0e[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0x507619;})});}_0x394b7f=_[_0x216d('0x42')]({},_0x394b7f,_0x5e5f0e[_0x216d('0x47')]);return _0x526a01[_0x216d('0x9c')](_0x394b7f);}})[_0x216d('0x26')](function(_0x1869b6){if(_0x1869b6){_0x3c7f58=_0x1869b6[_0x216d('0x5a')];if(!_0x5e5f0e[_0x216d('0x38')][_0x216d('0x3d')](_0x216d('0x63'))){_0x394b7f[_0x216d('0x3e')]=qs['limit'](_0x5e5f0e[_0x216d('0x38')][_0x216d('0x3e')]);_0x394b7f[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x5e5f0e[_0x216d('0x38')][_0x216d('0x21')]);}return _0x526a01['getMembers'](_0x394b7f);}})[_0x216d('0x26')](function(_0x30e2b9){return _0x30e2b9?{'count':_0x3c7f58,'rows':_0x30e2b9}:null;})['then'](respondWithResult(_0x116a80,null))[_0x216d('0x4b')](handleError(_0x116a80,null));};exports['getLists']=function(_0x210ca1,_0x300086,_0x3b7ce1){var _0xfb00e5={};var _0x4673b8={};var _0x12532f;var _0x1a0b4d;return db[_0x216d('0x34')]['findOne']({'where':{'id':_0x210ca1[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x300086,null))[_0x216d('0x26')](function(_0x478287){if(_0x478287){_0x12532f=_0x478287;_0x4673b8[_0x216d('0x36')]=_[_0x216d('0x37')](db[_0x216d('0x9d')][_0x216d('0x35')]);_0x4673b8[_0x216d('0x38')]=_['keys'](_0x210ca1[_0x216d('0x38')]);_0x4673b8[_0x216d('0x39')]=_['intersection'](_0x4673b8['model'],_0x4673b8[_0x216d('0x38')]);_0xfb00e5[_0x216d('0x3c')]=_['intersection'](_0x4673b8[_0x216d('0x36')],qs[_0x216d('0x3b')](_0x210ca1['query']['fields']));_0xfb00e5[_0x216d('0x3c')]=_0xfb00e5[_0x216d('0x3c')][_0x216d('0x5a')]?_0xfb00e5['attributes']:_0x4673b8[_0x216d('0x36')];_0xfb00e5[_0x216d('0x3f')]=qs['sort'](_0x210ca1[_0x216d('0x38')][_0x216d('0x40')]);_0xfb00e5[_0x216d('0x43')]=qs['filters'](_[_0x216d('0x41')](_0x210ca1['query'],_0x4673b8[_0x216d('0x39')]));if(_0x210ca1[_0x216d('0x38')]['filter']){_0xfb00e5[_0x216d('0x43')]=_[_0x216d('0x42')](_0xfb00e5[_0x216d('0x43')],{'$or':_['map'](_0xfb00e5[_0x216d('0x3c')],function(_0x2037b9){var _0x2919b9={};_0x2919b9[_0x2037b9]={'$like':'%'+_0x210ca1[_0x216d('0x38')][_0x216d('0x28')]+'%'};return _0x2919b9;})});}_0xfb00e5=_[_0x216d('0x42')]({},_0xfb00e5,_0x210ca1[_0x216d('0x47')]);return _0x12532f['getLists'](_0xfb00e5);}})[_0x216d('0x26')](function(_0x55db33){if(_0x55db33){_0x1a0b4d=_0x55db33[_0x216d('0x5a')];if(!_0x210ca1[_0x216d('0x38')][_0x216d('0x3d')](_0x216d('0x63'))){_0xfb00e5['limit']=qs[_0x216d('0x3e')](_0x210ca1['query']['limit']);_0xfb00e5['offset']=qs['offset'](_0x210ca1[_0x216d('0x38')][_0x216d('0x21')]);}return _0x12532f['getLists'](_0xfb00e5);}})[_0x216d('0x26')](function(_0x5b7697){if(_0x5b7697){return _0x5b7697?{'count':_0x1a0b4d,'rows':_0x5b7697}:null;}})[_0x216d('0x26')](respondWithResult(_0x300086,null))[_0x216d('0x4b')](handleError(_0x300086,null));};exports['addLists']=function(_0x3b4ba5,_0x46b383,_0x90687a){var _0x14ff49,_0x476c19;return db[_0x216d('0x34')][_0x216d('0x2d')]({'where':{'id':_0x3b4ba5[_0x216d('0x61')]['id']}})['then'](handleEntityNotFound(_0x46b383,null))['then'](function(_0x1ef5cf){if(_0x1ef5cf){_0x476c19=_0x1ef5cf;return _0x1ef5cf['addLists'](_0x3b4ba5[_0x216d('0x4f')]['ids'],_[_0x216d('0x5b')](_0x3b4ba5['body'],[_0x216d('0x93'),'id'])||{});}return null;})[_0x216d('0x97')](function(_0x208f9b){var _0x19307f;_0x14ff49=_0x208f9b||[];var _0x1218e6=[];if(_0x208f9b){for(var _0x554a09=0x0;_0x554a09<_0x208f9b[_0x216d('0x5a')];_0x554a09+=0x1){var _0x3a80e2=_0x208f9b[_0x554a09][_0x216d('0x27')]({'plain':!![]});_0x476c19[_0x216d('0x9e')]=_0x3b4ba5[_0x216d('0x4f')][_0x216d('0x9e')]?_0x3b4ba5[_0x216d('0x4f')][_0x216d('0x9e')]:_0x476c19[_0x216d('0x9e')];switch(_0x476c19[_0x216d('0x9e')]){case _0x216d('0x9f'):_0x19307f=squel['insert']()['into'](_0x216d('0xa0'))[_0x216d('0xa1')](['phone',_0x216d('0xa2'),_0x216d('0xa3'),_0x216d('0xa4'),'VoiceQueueId',_0x216d('0x5c'),_0x216d('0x5d')],squel[_0x216d('0x82')]()[_0x216d('0x46')](_0x216d('0xa5'),_0x216d('0xa5'))[_0x216d('0x46')](_0x216d('0xa6'),'scheduledAt')[_0x216d('0x46')]('id',_0x216d('0xa3'))[_0x216d('0x46')](_0x3a80e2[_0x216d('0xa7')][_0x216d('0x8b')](),_0x216d('0xa4'))[_0x216d('0x46')](_0x3b4ba5[_0x216d('0x61')]['id'][_0x216d('0x8b')](),_0x216d('0x64'))[_0x216d('0x46')](_0x216d('0xa6'),_0x216d('0x5c'))[_0x216d('0x46')](_0x216d('0xa6'),_0x216d('0x5d'))[_0x216d('0x84')](_0x216d('0xa8'))[_0x216d('0x43')]('deletedAt\x20IS\x20NULL')[_0x216d('0x43')](_0x216d('0xa9'),_0x3a80e2[_0x216d('0xa7')][_0x216d('0x8b')]())['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x216d('0x46')](_0x216d('0xaa'))['from'](_0x216d('0xab'))[_0x216d('0x43')]('VoiceQueueId\x20=\x20?',_0x3b4ba5[_0x216d('0x61')]['id']['toString']()))['where'](_0x216d('0xac'),squel['select']()[_0x216d('0x46')](_0x216d('0xad'))['from'](_0x216d('0xa0'))[_0x216d('0x43')]('VoiceQueueId\x20=\x20?',_0x3b4ba5['params']['id'][_0x216d('0x8b')]())))[_0x216d('0x8b')]();break;case _0x216d('0xae'):_0x19307f=squel['insert']()[_0x216d('0xaf')]('cm_hopper')[_0x216d('0xa1')]([_0x216d('0xa5'),'scheduledAt',_0x216d('0xa3'),_0x216d('0xa4'),_0x216d('0x64'),_0x216d('0x5c'),'updatedAt'],squel[_0x216d('0x82')]()[_0x216d('0x46')](_0x216d('0xa5'),_0x216d('0xa5'))[_0x216d('0x46')](_0x216d('0xa6'),_0x216d('0xa2'))[_0x216d('0x46')]('id','ContactId')[_0x216d('0x46')](_0x3a80e2[_0x216d('0xa7')][_0x216d('0x8b')](),_0x216d('0xa4'))['field'](_0x3b4ba5[_0x216d('0x61')]['id']['toString'](),_0x216d('0x64'))[_0x216d('0x46')]('NOW()',_0x216d('0x5c'))[_0x216d('0x46')](_0x216d('0xa6'),'updatedAt')[_0x216d('0x84')]('cm_contacts')['where'](_0x216d('0xb0'))[_0x216d('0x43')](_0x216d('0xa9'),_0x3a80e2[_0x216d('0xa7')][_0x216d('0x8b')]())['where'](_0x216d('0xb1'))[_0x216d('0x43')](_0x216d('0xac'),squel[_0x216d('0x82')]()[_0x216d('0x46')](_0x216d('0xad'))[_0x216d('0x84')](_0x216d('0xa0'))[_0x216d('0x43')](_0x216d('0x88'),_0x3b4ba5[_0x216d('0x61')]['id']['toString']())))[_0x216d('0x8b')]();break;default:_0x19307f=squel[_0x216d('0xb2')]()[_0x216d('0xaf')](_0x216d('0xa0'))[_0x216d('0xa1')](['phone',_0x216d('0xa2'),_0x216d('0xa3'),'ListId',_0x216d('0x64'),_0x216d('0x5c'),'updatedAt'],squel['select']()[_0x216d('0x46')](_0x216d('0xa5'),_0x216d('0xa5'))[_0x216d('0x46')]('NOW()',_0x216d('0xa2'))['field']('id',_0x216d('0xa3'))['field'](_0x3a80e2['CmListId']['toString'](),_0x216d('0xa4'))[_0x216d('0x46')](_0x3b4ba5['params']['id'][_0x216d('0x8b')](),'VoiceQueueId')[_0x216d('0x46')]('NOW()',_0x216d('0x5c'))[_0x216d('0x46')](_0x216d('0xa6'),_0x216d('0x5d'))[_0x216d('0x84')]('cm_contacts')[_0x216d('0x43')]('deletedAt\x20IS\x20NULL')[_0x216d('0x43')](_0x216d('0xa9'),_0x3a80e2[_0x216d('0xa7')][_0x216d('0x8b')]())[_0x216d('0x43')](_0x216d('0xb1')))[_0x216d('0x8b')]();}_0x1218e6[_0x216d('0x8a')](db[_0x216d('0x76')]['query'](_0x19307f));}return BPromise[_0x216d('0x8f')](_0x1218e6);}})[_0x216d('0x26')](function(){return _0x14ff49;})['then'](respondWithResult(_0x46b383,null))[_0x216d('0x4b')](handleError(_0x46b383,null));};exports[_0x216d('0xb3')]=function(_0x131831,_0xdf5bf8,_0x2b809c){return db[_0x216d('0x34')][_0x216d('0x2d')]({'where':{'id':_0x131831[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0xdf5bf8,null))[_0x216d('0x26')](function(_0x1e6fa7){if(_0x1e6fa7){return _0x1e6fa7['removeLists'](_0x131831[_0x216d('0x38')][_0x216d('0x93')]);}})[_0x216d('0x26')](function(_0x2708d8){if(_0x2708d8){return db['CmHopper'][_0x216d('0x30')]({'where':{'ListId':_0x131831[_0x216d('0x38')]['ids'],'VoiceQueueId':_0x131831['params']['id']}})['then'](function(){return _0x2708d8;});}})[_0x216d('0x26')](respondWithStatusCode(_0xdf5bf8,null))[_0x216d('0x4b')](handleError(_0xdf5bf8,null));};exports[_0x216d('0xb4')]=function(_0x2f9cd3,_0x41a4d1,_0x6a7ef6){var _0x1dc50d={};var _0x4768ba={};var _0x5e7adc;var _0x374bc7;return db[_0x216d('0x34')][_0x216d('0x67')]({'where':{'id':_0x2f9cd3[_0x216d('0x61')]['id']}})['then'](handleEntityNotFound(_0x41a4d1,null))['then'](function(_0x4ee594){if(_0x4ee594){_0x5e7adc=_0x4ee594;_0x4768ba[_0x216d('0x36')]=_['keys'](db[_0x216d('0x9d')]['rawAttributes']);_0x4768ba[_0x216d('0x38')]=_[_0x216d('0x37')](_0x2f9cd3[_0x216d('0x38')]);_0x4768ba[_0x216d('0x39')]=_[_0x216d('0x3a')](_0x4768ba['model'],_0x4768ba[_0x216d('0x38')]);_0x1dc50d[_0x216d('0x3c')]=_[_0x216d('0x3a')](_0x4768ba[_0x216d('0x36')],qs['fields'](_0x2f9cd3['query'][_0x216d('0x3b')]));_0x1dc50d[_0x216d('0x3c')]=_0x1dc50d[_0x216d('0x3c')]['length']?_0x1dc50d[_0x216d('0x3c')]:_0x4768ba[_0x216d('0x36')];_0x1dc50d[_0x216d('0x3f')]=qs['sort'](_0x2f9cd3['query'][_0x216d('0x40')]);_0x1dc50d['where']=qs['filters'](_[_0x216d('0x41')](_0x2f9cd3[_0x216d('0x38')],_0x4768ba[_0x216d('0x39')]));if(_0x2f9cd3['query'][_0x216d('0x28')]){_0x1dc50d[_0x216d('0x43')]=_[_0x216d('0x42')](_0x1dc50d[_0x216d('0x43')],{'$or':_[_0x216d('0x2a')](_0x1dc50d['attributes'],function(_0x484c4b){var _0x1d42c4={};_0x1d42c4[_0x484c4b]={'$like':'%'+_0x2f9cd3['query']['filter']+'%'};return _0x1d42c4;})});}_0x1dc50d=_['merge']({},_0x1dc50d,_0x2f9cd3[_0x216d('0x47')]);return _0x5e7adc['getBlackLists'](_0x1dc50d);}})['then'](function(_0xfac85d){if(_0xfac85d){_0x374bc7=_0xfac85d[_0x216d('0x5a')];if(!_0x2f9cd3[_0x216d('0x38')][_0x216d('0x3d')](_0x216d('0x63'))){_0x1dc50d[_0x216d('0x3e')]=qs['limit'](_0x2f9cd3[_0x216d('0x38')][_0x216d('0x3e')]);_0x1dc50d[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x2f9cd3[_0x216d('0x38')][_0x216d('0x21')]);}return _0x5e7adc[_0x216d('0xb4')](_0x1dc50d);}})[_0x216d('0x26')](function(_0x289b24){if(_0x289b24){return _0x289b24?{'count':_0x374bc7,'rows':_0x289b24}:null;}})[_0x216d('0x26')](respondWithResult(_0x41a4d1,null))[_0x216d('0x4b')](handleError(_0x41a4d1,null));};exports[_0x216d('0xb5')]=function(_0x13422f,_0x528b36,_0x54de45){var _0x545717,_0x4233f2;return db[_0x216d('0x34')][_0x216d('0x2d')]({'where':{'id':_0x13422f['params']['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x528b36,null))[_0x216d('0x26')](function(_0xded509){if(_0xded509){_0x4233f2=_0xded509;return _0xded509[_0x216d('0xb5')](_0x13422f[_0x216d('0x4f')][_0x216d('0x93')],_[_0x216d('0x5b')](_0x13422f[_0x216d('0x4f')],['ids','id'])||{});}return null;})[_0x216d('0x97')](function(_0x13f0c6){var _0x3ff823;_0x545717=_0x13f0c6||[];var _0x3be08a=[];if(_0x13f0c6){for(var _0xa72a16=0x0;_0xa72a16<_0x13f0c6[_0x216d('0x5a')];_0xa72a16+=0x1){var _0x319a7a=_0x13f0c6[_0xa72a16][_0x216d('0x27')]({'plain':!![]});_0x3ff823=squel[_0x216d('0xb2')]()[_0x216d('0xaf')](_0x216d('0xb6'))[_0x216d('0xa1')]([_0x216d('0xa5'),_0x216d('0xa3'),_0x216d('0xa4'),'VoiceQueueId',_0x216d('0x5c'),'updatedAt'],squel[_0x216d('0x82')]()[_0x216d('0x46')]('phone','phone')[_0x216d('0x46')]('id','ContactId')[_0x216d('0x46')](_0x319a7a[_0x216d('0xa7')][_0x216d('0x8b')](),_0x216d('0xa4'))[_0x216d('0x46')](_0x13422f[_0x216d('0x61')]['id'][_0x216d('0x8b')](),_0x216d('0x64'))['field'](_0x216d('0xa6'),'createdAt')[_0x216d('0x46')](_0x216d('0xa6'),_0x216d('0x5d'))[_0x216d('0x84')](_0x216d('0xa8'))[_0x216d('0x43')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x319a7a['CmListId'][_0x216d('0x8b')]())['where'](_0x216d('0xb1')))[_0x216d('0x8b')]();_0x3be08a[_0x216d('0x8a')](db[_0x216d('0x76')][_0x216d('0x38')](_0x3ff823));}return BPromise[_0x216d('0x8f')](_0x3be08a);}})[_0x216d('0x26')](function(){return _0x545717;})[_0x216d('0x26')](respondWithResult(_0x528b36,null))[_0x216d('0x4b')](handleError(_0x528b36,null));};exports[_0x216d('0xb7')]=function(_0xdd6862,_0x4627a3,_0x4d3472){return db['VoiceQueue'][_0x216d('0x2d')]({'where':{'id':_0xdd6862[_0x216d('0x61')]['id']}})[_0x216d('0x26')](handleEntityNotFound(_0x4627a3,null))[_0x216d('0x26')](function(_0x5703c7){if(_0x5703c7){return _0x5703c7[_0x216d('0xb7')](_0xdd6862[_0x216d('0x38')][_0x216d('0x93')]);}})[_0x216d('0x26')](function(_0x3ea9cb){if(_0x3ea9cb){return db[_0x216d('0x6a')][_0x216d('0x30')]({'where':{'ListId':_0xdd6862[_0x216d('0x38')][_0x216d('0x93')],'VoiceQueueId':_0xdd6862['params']['id']}})['then'](function(){return _0x3ea9cb;});}})[_0x216d('0x26')](respondWithStatusCode(_0x4627a3,null))[_0x216d('0x4b')](handleError(_0x4627a3,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 48a6226..1313b78 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 _0x8f78=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x3808b5,_0x5907a0){var _0x352c3d=function(_0x334e63){while(--_0x334e63){_0x3808b5['push'](_0x3808b5['shift']());}};_0x352c3d(++_0x5907a0);}(_0x8f78,0x7f));var _0x88f7=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x8f78[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require(_0x88f7('0x0'));var VoiceQueue=require(_0x88f7('0x1'))['db'][_0x88f7('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x88f7('0x3')](0x0);var events={'afterCreate':_0x88f7('0x4'),'afterUpdate':_0x88f7('0x5'),'afterDestroy':_0x88f7('0x6')};function emitEvent(_0x137176){return function(_0x1e6359,_0x47d633,_0x2a6a5b){VoiceQueueEvents['emit'](_0x137176+':'+_0x1e6359['id'],_0x1e6359);VoiceQueueEvents['emit'](_0x137176,_0x1e6359);_0x2a6a5b(null);};}for(var e in events){if(events[_0x88f7('0x7')](e)){var event=events[e];VoiceQueue[_0x88f7('0x8')](e,emitEvent(event));}}module[_0x88f7('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xffa5=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4eb74b,_0x3541cb){var _0x4670f1=function(_0x475f4d){while(--_0x475f4d){_0x4eb74b['push'](_0x4eb74b['shift']());}};_0x4670f1(++_0x3541cb);}(_0xffa5,0x164));var _0x5ffa=function(_0x45a403,_0x571810){_0x45a403=_0x45a403-0x0;var _0x40646d=_0xffa5[_0x45a403];return _0x40646d;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x5ffa('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ffa('0x1'),'afterDestroy':_0x5ffa('0x2')};function emitEvent(_0x1b1582){return function(_0x2ff610,_0x3a0dcc,_0x26d3c0){VoiceQueueEvents[_0x5ffa('0x3')](_0x1b1582+':'+_0x2ff610['id'],_0x2ff610);VoiceQueueEvents['emit'](_0x1b1582,_0x2ff610);_0x26d3c0(null);};}for(var e in events){if(events[_0x5ffa('0x4')](e)){var event=events[e];VoiceQueue[_0x5ffa('0x5')](e,emitEvent(event));}}module[_0x5ffa('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5be8552..2e8eb7c 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 _0x6cb4=['bluebird','request-promise','path','rimraf','./voiceQueue.attributes','define','VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1762fb,_0x9cc278){var _0x3e2110=function(_0x345039){while(--_0x345039){_0x1762fb['push'](_0x1762fb['shift']());}};_0x3e2110(++_0x9cc278);}(_0x6cb4,0xff));var _0x46cb=function(_0x213cfc,_0x344a39){_0x213cfc=_0x213cfc-0x0;var _0x3075ed=_0x6cb4[_0x213cfc];return _0x3075ed;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','VoiceQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x47bb5a,_0x2bcacd){var _0x5d0a4c=function(_0x59bc5d){while(--_0x59bc5d){_0x47bb5a['push'](_0x47bb5a['shift']());}};_0x5d0a4c(++_0x2bcacd);}(_0x702d,0x147));var _0xd702=function(_0x3f649c,_0x58fb39){_0x3f649c=_0x3f649c-0x0;var _0x167e7c=_0x702d[_0x3f649c];return _0x167e7c;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./voiceQueue.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 2e83574..47dd0a3 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 _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x27e811,_0x1fad22){var _0x1bfe61=function(_0x2d8d02){while(--_0x2d8d02){_0x27e811['push'](_0x27e811['shift']());}};_0x1bfe61(++_0x1fad22);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0xb53d60,_0x1b735a){var _0x481a78=function(_0x20edce){while(--_0x20edce){_0xb53d60['push'](_0xb53d60['shift']());}};_0x481a78(++_0x1b735a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 4d7c8b9..363be59 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 _0x7a87=['register','length','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x123207,_0x298900){var _0x2a3b3c=function(_0x4d230a){while(--_0x4d230a){_0x123207['push'](_0x123207['shift']());}};_0x2a3b3c(++_0x298900);}(_0x7a87,0x132));var _0x77a8=function(_0x1e9658,_0x231076){_0x1e9658=_0x1e9658-0x0;var _0x2916b3=_0x7a87[_0x1e9658];return _0x2916b3;};'use strict';var VoiceQueueEvents=require(_0x77a8('0x0'));var events=[_0x77a8('0x1'),_0x77a8('0x2'),_0x77a8('0x3')];function createListener(_0x416b97,_0x249866){return function(_0x291ae5){_0x249866[_0x77a8('0x4')](_0x416b97,_0x291ae5);};}function removeListener(_0x39f961,_0x561016){return function(){VoiceQueueEvents[_0x77a8('0x5')](_0x39f961,_0x561016);};}exports[_0x77a8('0x6')]=function(_0x5916c3){for(var _0x5981cc=0x0,_0x5dd17c=events[_0x77a8('0x7')];_0x5981cc<_0x5dd17c;_0x5981cc++){var _0x3da09d=events[_0x5981cc];var _0x3256e4=createListener('voiceQueue:'+_0x3da09d,_0x5916c3);VoiceQueueEvents['on'](_0x3da09d,_0x3256e4);}}; \ No newline at end of file +var _0x2ad8=['length','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ad8,0x1b7));var _0x82ad=function(_0x1f175e,_0x25487c){_0x1f175e=_0x1f175e-0x0;var _0x4ab74c=_0x2ad8[_0x1f175e];return _0x4ab74c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x82ad('0x0'),'remove',_0x82ad('0x1')];function createListener(_0x12218c,_0x559cf8){return function(_0x5978a8){_0x559cf8['emit'](_0x12218c,_0x5978a8);};}function removeListener(_0x28d796,_0x3570d1){return function(){VoiceQueueEvents['removeListener'](_0x28d796,_0x3570d1);};}exports['register']=function(_0xad2fb7){for(var _0x50c032=0x0,_0x1be140=events[_0x82ad('0x2')];_0x50c032<_0x1be140;_0x50c032++){var _0x3768db=events[_0x50c032];var _0xf433f1=createListener('voiceQueue:'+_0x3768db,_0xad2fb7);VoiceQueueEvents['on'](_0x3768db,_0xf433f1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3584424..b797691 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 _0x29c3=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x32c86b,_0x584b12){var _0x5d1ea8=function(_0x20ab96){while(--_0x20ab96){_0x32c86b['push'](_0x32c86b['shift']());}};_0x5d1ea8(++_0x584b12);}(_0x29c3,0x11e));var _0x329c=function(_0x10c080,_0x5d921c){_0x10c080=_0x10c080-0x0;var _0x5ebd31=_0x29c3[_0x10c080];return _0x5ebd31;};'use strict';var multer=require('multer');var util=require(_0x329c('0x0'));var path=require(_0x329c('0x1'));var timeout=require(_0x329c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x329c('0x3'));var interaction=require(_0x329c('0x4'));var config=require(_0x329c('0x5'));var controller=require(_0x329c('0x6'));router['get']('/',auth[_0x329c('0x7')](),controller[_0x329c('0x8')]);router[_0x329c('0x9')](_0x329c('0xa'),auth[_0x329c('0x7')](),controller[_0x329c('0xb')]);router[_0x329c('0x9')](_0x329c('0xc'),auth[_0x329c('0x7')](),controller[_0x329c('0xd')]);router[_0x329c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x329c('0xe')]);router['post']('/',auth[_0x329c('0x7')](),controller[_0x329c('0xf')]);router[_0x329c('0x10')](_0x329c('0x11'),auth[_0x329c('0x7')](),controller[_0x329c('0x12')]);router[_0x329c('0x13')](_0x329c('0x11'),auth[_0x329c('0x7')](),controller[_0x329c('0x14')]);module[_0x329c('0x15')]=router; \ No newline at end of file +var _0x6e5e=['post','create','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x161cb1,_0x7930a){var _0x36dd92=function(_0x5efe8a){while(--_0x5efe8a){_0x161cb1['push'](_0x161cb1['shift']());}};_0x36dd92(++_0x7930a);}(_0x6e5e,0x182));var _0xe6e5=function(_0x80327a,_0x5cf28e){_0x80327a=_0x80327a-0x0;var _0x27b045=_0x6e5e[_0x80327a];return _0x27b045;};'use strict';var multer=require(_0xe6e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe6e5('0x1'));var express=require(_0xe6e5('0x2'));var router=express[_0xe6e5('0x3')]();var auth=require(_0xe6e5('0x4'));var interaction=require(_0xe6e5('0x5'));var config=require(_0xe6e5('0x6'));var controller=require('./voiceQueueReport.controller');router[_0xe6e5('0x7')]('/',auth[_0xe6e5('0x8')](),controller['index']);router[_0xe6e5('0x7')](_0xe6e5('0x9'),auth['isAuthenticated'](),controller[_0xe6e5('0xa')]);router[_0xe6e5('0x7')]('/index',auth[_0xe6e5('0x8')](),controller['getVoiceQueuesReport']);router[_0xe6e5('0x7')](_0xe6e5('0xb'),auth[_0xe6e5('0x8')](),controller[_0xe6e5('0xc')]);router[_0xe6e5('0xd')]('/',auth[_0xe6e5('0x8')](),controller[_0xe6e5('0xe')]);router[_0xe6e5('0xf')](_0xe6e5('0xb'),auth[_0xe6e5('0x8')](),controller[_0xe6e5('0x10')]);router[_0xe6e5('0x11')](_0xe6e5('0xb'),auth[_0xe6e5('0x8')](),controller['destroy']);module[_0xe6e5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index dae7c41..a8f18b3 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 _0x8398=['seconds','setDataValue','holdtime','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3eb453,_0x153261){var _0x55a8ed=function(_0x592920){while(--_0x592920){_0x3eb453['push'](_0x3eb453['shift']());}};_0x55a8ed(++_0x153261);}(_0x8398,0xc8));var _0x8839=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8398[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x8839('0x0'));var moment=require(_0x8839('0x1'));module[_0x8839('0x2')]={'type':{'type':Sequelize[_0x8839('0x3')]},'uniqueid':{'type':Sequelize[_0x8839('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8839('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x8839('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8839('0x4')],'set':function(_0x4d606a){var _0x481411=moment(_0x4d606a);var _0x271a77=moment(this['getDataValue'](_0x8839('0x5')))[_0x8839('0x6')](_0x8839('0x7'));var _0x407a06=_0x481411['diff'](_0x271a77,_0x8839('0x8'));this['setDataValue']('queuecallerleaveAt',_0x4d606a);this[_0x8839('0x9')](_0x8839('0xa'),_0x407a06||null);}},'position':{'type':Sequelize[_0x8839('0xb')]},'count':{'type':Sequelize[_0x8839('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x8839('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8839('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x8839('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8839('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8839('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8839('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x8839('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x8839('0xb')]},'channel':{'type':Sequelize[_0x8839('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8839('0x3')]},'connectedlinename':{'type':Sequelize[_0x8839('0x3')]},'accountcode':{'type':Sequelize[_0x8839('0x3')]},'context':{'type':Sequelize[_0x8839('0x3')]},'exten':{'type':Sequelize[_0x8839('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8839('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8839('0x3')]},'transfer':{'type':Sequelize[_0x8839('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8839('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x8839('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8839('0x3')]},'disposition':{'type':Sequelize[_0x8839('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xadca=['setDataValue','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0xadca,0xe7));var _0xaadc=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xadca[_0x10e983];return _0x324138;};'use strict';var Sequelize=require(_0xaadc('0x0'));var moment=require(_0xaadc('0x1'));module['exports']={'type':{'type':Sequelize[_0xaadc('0x2')]},'uniqueid':{'type':Sequelize[_0xaadc('0x2')]},'calleridnum':{'type':Sequelize[_0xaadc('0x2')]},'calleridname':{'type':Sequelize[_0xaadc('0x2')]},'queue':{'type':Sequelize[_0xaadc('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x29aace){var _0xf19789=moment(_0x29aace);var _0x27981b=moment(this[_0xaadc('0x3')](_0xaadc('0x4')))[_0xaadc('0x5')](_0xaadc('0x6'));var _0x532006=_0xf19789[_0xaadc('0x7')](_0x27981b,_0xaadc('0x8'));this['setDataValue']('queuecallerleaveAt',_0x29aace);this[_0xaadc('0x9')](_0xaadc('0xa'),_0x532006||null);}},'position':{'type':Sequelize[_0xaadc('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xaadc('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xaadc('0xd')]},'queuecallerexit':{'type':Sequelize[_0xaadc('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xaadc('0xd')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xaadc('0xe')},'originalposition':{'type':Sequelize[_0xaadc('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xaadc('0x2')]},'connectedlinename':{'type':Sequelize[_0xaadc('0x2')]},'accountcode':{'type':Sequelize[_0xaadc('0x2')]},'context':{'type':Sequelize[_0xaadc('0x2')]},'exten':{'type':Sequelize[_0xaadc('0x2')]},'priority':{'type':Sequelize[_0xaadc('0x2')]},'holdtime':{'type':Sequelize[_0xaadc('0xb')]},'mohtime':{'type':Sequelize[_0xaadc('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xaadc('0x2')]},'transfer':{'type':Sequelize[_0xaadc('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaadc('0x2')],'comment':_0xaadc('0xf')},'transferexten':{'type':Sequelize[_0xaadc('0x2')]},'transferuniqueid':{'type':Sequelize[_0xaadc('0x2')]},'disposition':{'type':Sequelize[_0xaadc('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xaadc('0xb')],'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 09e33e9..43ee17a 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 _0x97f5=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','then','rows','catch','params','create','update','body','find','destroy','describe','map','getVoiceQueuesReport','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','stack','name','send','index','VoiceQueueReport','rawAttributes','model','keys'];(function(_0x30b604,_0x3882ed){var _0x5eb82f=function(_0x544c7e){while(--_0x544c7e){_0x30b604['push'](_0x30b604['shift']());}};_0x5eb82f(++_0x3882ed);}(_0x97f5,0x72));var _0x597f=function(_0x52e6e9,_0x26864b){_0x52e6e9=_0x52e6e9-0x0;var _0x35c186=_0x97f5[_0x52e6e9];return _0x35c186;};'use strict';var pdf=require(_0x597f('0x0'));var emlformat=require(_0x597f('0x1'));var rimraf=require(_0x597f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x597f('0x3'));var moment=require(_0x597f('0x4'));var BPromise=require(_0x597f('0x5'));var Mustache=require(_0x597f('0x6'));var util=require(_0x597f('0x7'));var path=require(_0x597f('0x8'));var sox=require(_0x597f('0x9'));var csv=require(_0x597f('0xa'));var ejs=require(_0x597f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x597f('0xc'));var crypto=require(_0x597f('0xd'));var jsforce=require(_0x597f('0xe'));var deskjs=require(_0x597f('0xf'));var toCsv=require(_0x597f('0xa'));var querystring=require(_0x597f('0x10'));var Papa=require('papaparse');var Redis=require(_0x597f('0x11'));var authService=require(_0x597f('0x12'));var qs=require(_0x597f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x597f('0x14'));var utils=require('../../config/utils');var config=require(_0x597f('0x15'));var db=require(_0x597f('0x16'))['db'];config[_0x597f('0x17')]=_['defaults'](config[_0x597f('0x17')],{'host':_0x597f('0x18'),'port':0x18eb});var socket=require(_0x597f('0x19'))(new Redis(config[_0x597f('0x17')]));require(_0x597f('0x1a'))[_0x597f('0x1b')](socket);function respondWithStatusCode(_0x357efa,_0x22adab){_0x22adab=_0x22adab||0xcc;return function(_0x11ef60){if(_0x11ef60){return _0x357efa[_0x597f('0x1c')](_0x22adab);}return _0x357efa[_0x597f('0x1d')](_0x22adab)[_0x597f('0x1e')]();};}function respondWithResult(_0xf1eed0,_0x5b6349){_0x5b6349=_0x5b6349||0xc8;return function(_0x44d2f2){if(_0x44d2f2){return _0xf1eed0[_0x597f('0x1d')](_0x5b6349)[_0x597f('0x1f')](_0x44d2f2);}};}function respondWithFilteredResult(_0x55eed9,_0x85b436){return function(_0x5d64f9){if(_0x5d64f9){var _0x507c99=_0x5d64f9['count'],_0x507552=_0x85b436[_0x597f('0x20')],_0x50f89a=_0x85b436[_0x597f('0x20')]+_0x85b436['limit'],_0x49f12b;if(_0x50f89a>=_0x507c99){_0x50f89a=_0x507c99;_0x49f12b=0xc8;}else{_0x49f12b=0xce;}_0x55eed9[_0x597f('0x1d')](_0x49f12b);return _0x55eed9[_0x597f('0x21')](_0x597f('0x22'),_0x507552+'-'+_0x50f89a+'/'+_0x507c99)[_0x597f('0x1f')](_0x5d64f9);}return null;};}function patchUpdates(_0x53b85e){return function(_0x48fffd){try{jsonpatch[_0x597f('0x23')](_0x48fffd,_0x53b85e,!![]);}catch(_0x244ca5){return BPromise[_0x597f('0x24')](_0x244ca5);}return _0x48fffd[_0x597f('0x25')]();};}function saveUpdates(_0x599bed,_0x4c13ab){return function(_0x376b5f){if(_0x376b5f){return _0x376b5f['update'](_0x599bed)['then'](function(_0x4502fb){return _0x4502fb;});}return null;};}function removeEntity(_0x22f4fd,_0x20776d){return function(_0x4c44a7){if(_0x4c44a7){return _0x4c44a7['destroy']()['then'](function(){_0x22f4fd[_0x597f('0x1d')](0xcc)[_0x597f('0x1e')]();});}};}function handleEntityNotFound(_0x4afc3a,_0x1edab6){return function(_0x7bf4fe){if(!_0x7bf4fe){_0x4afc3a[_0x597f('0x1c')](0x194);}return _0x7bf4fe;};}function handleError(_0x55d7ec,_0x519abc){_0x519abc=_0x519abc||0x1f4;return function(_0xa48f45){logger['error'](_0xa48f45[_0x597f('0x26')]);if(_0xa48f45[_0x597f('0x27')]){delete _0xa48f45[_0x597f('0x27')];}_0x55d7ec[_0x597f('0x1d')](_0x519abc)[_0x597f('0x28')](_0xa48f45);};}exports[_0x597f('0x29')]=function(_0x1c5300,_0x5b4832){var _0x5cfe3a={},_0xea7872={},_0x508d4e={'count':0x0,'rows':[]};var _0x85dd1d=db[_0x597f('0x2a')][_0x597f('0x2b')];_0xea7872[_0x597f('0x2c')]=_[_0x597f('0x2d')](_0x85dd1d);_0xea7872[_0x597f('0x2e')]=_[_0x597f('0x2d')](_0x1c5300['query']);_0xea7872['filters']=_[_0x597f('0x2f')](_0xea7872['model'],_0xea7872[_0x597f('0x2e')]);_0x5cfe3a[_0x597f('0x30')]=_[_0x597f('0x2f')](_0xea7872[_0x597f('0x2c')],qs['fields'](_0x1c5300[_0x597f('0x2e')][_0x597f('0x31')]));_0x5cfe3a['attributes']=_0x5cfe3a[_0x597f('0x30')][_0x597f('0x32')]?_0x5cfe3a[_0x597f('0x30')]:_0xea7872['model'];if(!_0x1c5300['query'][_0x597f('0x33')](_0x597f('0x34'))){_0x5cfe3a[_0x597f('0x35')]=qs['limit'](_0x1c5300['query'][_0x597f('0x35')]);_0x5cfe3a[_0x597f('0x20')]=qs[_0x597f('0x20')](_0x1c5300[_0x597f('0x2e')][_0x597f('0x20')]);}_0x5cfe3a['order']=qs[_0x597f('0x36')](_0x1c5300[_0x597f('0x2e')][_0x597f('0x36')]);_0x5cfe3a[_0x597f('0x37')]=qs[_0x597f('0x38')](_[_0x597f('0x39')](_0x1c5300[_0x597f('0x2e')],_0xea7872['filters']));if(_0x1c5300[_0x597f('0x2e')]['filter']){_0x5cfe3a[_0x597f('0x37')]=_[_0x597f('0x3a')](_0x5cfe3a[_0x597f('0x37')],{'$or':_['map'](_0x85dd1d,function(_0x10de74){if(_0x10de74['type'][_0x597f('0x3b')]!==_0x597f('0x3c')){var _0x3acfe6={};_0x3acfe6[_0x10de74[_0x597f('0x3d')]]={'$like':'%'+_0x1c5300[_0x597f('0x2e')][_0x597f('0x3e')]+'%'};return _0x3acfe6;}})});}_0x5cfe3a=_[_0x597f('0x3a')]({},_0x5cfe3a,_0x1c5300[_0x597f('0x3f')]);var _0x4bd63d={'where':_0x5cfe3a[_0x597f('0x37')]};return db[_0x597f('0x2a')][_0x597f('0x40')](_0x4bd63d)['then'](function(_0x4bead9){_0x508d4e['count']=_0x4bead9;if(_0x1c5300[_0x597f('0x2e')][_0x597f('0x41')]){_0x5cfe3a[_0x597f('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x597f('0x43')](_0x5cfe3a);})[_0x597f('0x44')](function(_0x50b5a3){_0x508d4e[_0x597f('0x45')]=_0x50b5a3;return _0x508d4e;})[_0x597f('0x44')](respondWithFilteredResult(_0x5b4832,_0x5cfe3a))[_0x597f('0x46')](handleError(_0x5b4832,null));};exports['show']=function(_0x50e3df,_0x5916f6){var _0x1976f8={'raw':![],'where':{'id':_0x50e3df[_0x597f('0x47')]['id']}},_0xc62652={};_0xc62652[_0x597f('0x2c')]=_[_0x597f('0x2d')](db[_0x597f('0x2a')][_0x597f('0x2b')]);_0xc62652[_0x597f('0x2e')]=_[_0x597f('0x2d')](_0x50e3df[_0x597f('0x2e')]);_0xc62652['filters']=_['intersection'](_0xc62652[_0x597f('0x2c')],_0xc62652[_0x597f('0x2e')]);_0x1976f8[_0x597f('0x30')]=_[_0x597f('0x2f')](_0xc62652[_0x597f('0x2c')],qs[_0x597f('0x31')](_0x50e3df[_0x597f('0x2e')]['fields']));_0x1976f8[_0x597f('0x30')]=_0x1976f8[_0x597f('0x30')][_0x597f('0x32')]?_0x1976f8[_0x597f('0x30')]:_0xc62652[_0x597f('0x2c')];if(_0x50e3df[_0x597f('0x2e')]['includeAll']){_0x1976f8[_0x597f('0x42')]=[{'all':!![]}];}_0x1976f8=_[_0x597f('0x3a')]({},_0x1976f8,_0x50e3df[_0x597f('0x3f')]);return db[_0x597f('0x2a')]['find'](_0x1976f8)[_0x597f('0x44')](handleEntityNotFound(_0x5916f6,null))['then'](respondWithResult(_0x5916f6,null))['catch'](handleError(_0x5916f6,null));};exports[_0x597f('0x48')]=function(_0x3ee2a9,_0x34df0f){return db[_0x597f('0x2a')][_0x597f('0x48')](_0x3ee2a9['body'],{})[_0x597f('0x44')](respondWithResult(_0x34df0f,0xc9))[_0x597f('0x46')](handleError(_0x34df0f,null));};exports[_0x597f('0x49')]=function(_0x13a5f0,_0x2417cb){if(_0x13a5f0[_0x597f('0x4a')]['id']){delete _0x13a5f0['body']['id'];}return db[_0x597f('0x2a')][_0x597f('0x4b')]({'where':{'id':_0x13a5f0[_0x597f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2417cb,null))['then'](saveUpdates(_0x13a5f0[_0x597f('0x4a')],null))[_0x597f('0x44')](respondWithResult(_0x2417cb,null))['catch'](handleError(_0x2417cb,null));};exports[_0x597f('0x4c')]=function(_0x5db6ff,_0x1e82e9){return db[_0x597f('0x2a')][_0x597f('0x4b')]({'where':{'id':_0x5db6ff[_0x597f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e82e9,null))[_0x597f('0x44')](removeEntity(_0x1e82e9,null))[_0x597f('0x46')](handleError(_0x1e82e9,null));};exports[_0x597f('0x4d')]=function(_0x49aa96,_0x24e1b2){return db['VoiceQueueReport'][_0x597f('0x4d')]()['then'](respondWithResult(_0x24e1b2,null))[_0x597f('0x46')](handleError(_0x24e1b2,null));};exports['getVoiceQueuesReport']=function(_0xfd183e,_0x76a0bd){var _0x27c6f1={},_0x2958f1={},_0x3a67db={'count':0x0,'rows':[]};_0x2958f1[_0x597f('0x2c')]=_[_0x597f('0x2d')](db[_0x597f('0x2a')][_0x597f('0x2b')]);_0x2958f1['query']=_[_0x597f('0x2d')](_0xfd183e['query']);_0x2958f1[_0x597f('0x38')]=_[_0x597f('0x2f')](_0x2958f1['model'],_0x2958f1['query']);_0x27c6f1['attributes']=_[_0x597f('0x2f')](_0x2958f1[_0x597f('0x2c')],qs[_0x597f('0x31')](_0xfd183e[_0x597f('0x2e')]['fields']));_0x27c6f1[_0x597f('0x30')]=_0x27c6f1[_0x597f('0x30')][_0x597f('0x32')]?_0x27c6f1[_0x597f('0x30')]:_0x2958f1[_0x597f('0x2c')];if(!_0xfd183e[_0x597f('0x2e')]['hasOwnProperty'](_0x597f('0x34'))){_0x27c6f1[_0x597f('0x35')]=qs[_0x597f('0x35')](_0xfd183e[_0x597f('0x2e')][_0x597f('0x35')]);_0x27c6f1[_0x597f('0x20')]=qs[_0x597f('0x20')](_0xfd183e['query'][_0x597f('0x20')]);}_0x27c6f1['order']=qs[_0x597f('0x36')](_0xfd183e['query'][_0x597f('0x36')]);_0x27c6f1[_0x597f('0x37')]=qs[_0x597f('0x38')](_[_0x597f('0x39')](_0xfd183e[_0x597f('0x2e')],_0x2958f1['filters']));if(_0xfd183e[_0x597f('0x2e')][_0x597f('0x3e')]){_0x27c6f1['where']=_[_0x597f('0x3a')](_0x27c6f1[_0x597f('0x37')],{'$or':_[_0x597f('0x4e')](_0x27c6f1[_0x597f('0x30')],function(_0x211112){var _0xd9cff0={};_0xd9cff0[_0x211112]={'$like':'%'+_0xfd183e[_0x597f('0x2e')][_0x597f('0x3e')]+'%'};return _0xd9cff0;})});}_0x27c6f1=_['merge']({},_0x27c6f1,_0xfd183e[_0x597f('0x3f')]);var _0x5becef={'where':_0x27c6f1['where']};return db[_0x597f('0x2a')]['count'](_0x5becef)['then'](function(_0x1d94b7){_0x3a67db['count']=_0x1d94b7;if(_0xfd183e[_0x597f('0x2e')][_0x597f('0x41')]){_0x27c6f1['include']=[{'all':!![]}];}return db[_0x597f('0x2a')][_0x597f('0x43')](_0x27c6f1);})[_0x597f('0x44')](function(_0x6181db){_0x3a67db[_0x597f('0x45')]=_0x6181db;return _0x3a67db;})[_0x597f('0x44')](respondWithFilteredResult(_0x76a0bd,_0x27c6f1,_0x597f('0x4f')))[_0x597f('0x46')](handleError(_0x76a0bd,null,_0x597f('0x4f')));}; \ No newline at end of file +var _0xe0c0=['params','length','include','find','create','body','describe','getVoiceQueuesReport','hasOwnProperty','nolimit','map','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./voiceQueueReport.socket','register','status','end','json','count','set','Content-Range','save','update','destroy','then','sendStatus','error','name','send','index','VoiceQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','limit','offset','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x4a0e0b,_0x150831){_0x4a0e0b=_0x4a0e0b-0x0;var _0x1a4e94=_0xe0c0[_0x4a0e0b];return _0x1a4e94;};'use strict';var pdf=require(_0x0e0c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0e0c('0x1'));var zipdir=require(_0x0e0c('0x2'));var jsonpatch=require(_0x0e0c('0x3'));var rp=require(_0x0e0c('0x4'));var moment=require('moment');var BPromise=require(_0x0e0c('0x5'));var Mustache=require(_0x0e0c('0x6'));var util=require(_0x0e0c('0x7'));var path=require('path');var sox=require(_0x0e0c('0x8'));var csv=require(_0x0e0c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e0c('0xa'));var squel=require(_0x0e0c('0xb'));var crypto=require(_0x0e0c('0xc'));var jsforce=require(_0x0e0c('0xd'));var deskjs=require(_0x0e0c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e0c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e0c('0x10'));var hardwareService=require(_0x0e0c('0x11'));var logger=require(_0x0e0c('0x12'))(_0x0e0c('0x13'));var utils=require(_0x0e0c('0x14'));var config=require(_0x0e0c('0x15'));var db=require(_0x0e0c('0x16'))['db'];config[_0x0e0c('0x17')]=_['defaults'](config[_0x0e0c('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e0c('0x17')]));require(_0x0e0c('0x18'))[_0x0e0c('0x19')](socket);function respondWithStatusCode(_0x305042,_0x1b598b){_0x1b598b=_0x1b598b||0xcc;return function(_0x19f315){if(_0x19f315){return _0x305042['sendStatus'](_0x1b598b);}return _0x305042[_0x0e0c('0x1a')](_0x1b598b)[_0x0e0c('0x1b')]();};}function respondWithResult(_0x3b6d65,_0x4ebe33){_0x4ebe33=_0x4ebe33||0xc8;return function(_0x368ba0){if(_0x368ba0){return _0x3b6d65[_0x0e0c('0x1a')](_0x4ebe33)[_0x0e0c('0x1c')](_0x368ba0);}};}function respondWithFilteredResult(_0x20f13d,_0x240150){return function(_0x2b0cb6){if(_0x2b0cb6){var _0x2f3f4a=_0x2b0cb6[_0x0e0c('0x1d')],_0x18f3ef=_0x240150['offset'],_0x112fa0=_0x240150['offset']+_0x240150['limit'],_0x562f2c;if(_0x112fa0>=_0x2f3f4a){_0x112fa0=_0x2f3f4a;_0x562f2c=0xc8;}else{_0x562f2c=0xce;}_0x20f13d[_0x0e0c('0x1a')](_0x562f2c);return _0x20f13d[_0x0e0c('0x1e')](_0x0e0c('0x1f'),_0x18f3ef+'-'+_0x112fa0+'/'+_0x2f3f4a)[_0x0e0c('0x1c')](_0x2b0cb6);}return null;};}function patchUpdates(_0x26ad69){return function(_0x3cc1cc){try{jsonpatch['apply'](_0x3cc1cc,_0x26ad69,!![]);}catch(_0x177ec6){return BPromise['reject'](_0x177ec6);}return _0x3cc1cc[_0x0e0c('0x20')]();};}function saveUpdates(_0x4419e9,_0x58fa02){return function(_0x2d01e5){if(_0x2d01e5){return _0x2d01e5[_0x0e0c('0x21')](_0x4419e9)['then'](function(_0x3346aa){return _0x3346aa;});}return null;};}function removeEntity(_0x29ee52,_0x315b35){return function(_0x29ff87){if(_0x29ff87){return _0x29ff87[_0x0e0c('0x22')]()[_0x0e0c('0x23')](function(){_0x29ee52[_0x0e0c('0x1a')](0xcc)[_0x0e0c('0x1b')]();});}};}function handleEntityNotFound(_0x426bf1,_0x3ae1b4){return function(_0x5a7519){if(!_0x5a7519){_0x426bf1[_0x0e0c('0x24')](0x194);}return _0x5a7519;};}function handleError(_0x429f6f,_0x48a33a){_0x48a33a=_0x48a33a||0x1f4;return function(_0x59f3e8){logger[_0x0e0c('0x25')](_0x59f3e8['stack']);if(_0x59f3e8[_0x0e0c('0x26')]){delete _0x59f3e8[_0x0e0c('0x26')];}_0x429f6f[_0x0e0c('0x1a')](_0x48a33a)[_0x0e0c('0x27')](_0x59f3e8);};}exports[_0x0e0c('0x28')]=function(_0x15bb5a,_0x252143){var _0x2d1444={},_0x2c9c82={},_0x433f56={'count':0x0,'rows':[]};var _0xe5f2c5=db[_0x0e0c('0x29')][_0x0e0c('0x2a')];_0x2c9c82[_0x0e0c('0x2b')]=_[_0x0e0c('0x2c')](_0xe5f2c5);_0x2c9c82[_0x0e0c('0x2d')]=_['keys'](_0x15bb5a[_0x0e0c('0x2d')]);_0x2c9c82[_0x0e0c('0x2e')]=_[_0x0e0c('0x2f')](_0x2c9c82[_0x0e0c('0x2b')],_0x2c9c82[_0x0e0c('0x2d')]);_0x2d1444['attributes']=_[_0x0e0c('0x2f')](_0x2c9c82['model'],qs[_0x0e0c('0x30')](_0x15bb5a[_0x0e0c('0x2d')]['fields']));_0x2d1444['attributes']=_0x2d1444['attributes']['length']?_0x2d1444[_0x0e0c('0x31')]:_0x2c9c82[_0x0e0c('0x2b')];if(!_0x15bb5a[_0x0e0c('0x2d')]['hasOwnProperty']('nolimit')){_0x2d1444[_0x0e0c('0x32')]=qs[_0x0e0c('0x32')](_0x15bb5a['query']['limit']);_0x2d1444[_0x0e0c('0x33')]=qs['offset'](_0x15bb5a[_0x0e0c('0x2d')][_0x0e0c('0x33')]);}_0x2d1444[_0x0e0c('0x34')]=qs[_0x0e0c('0x35')](_0x15bb5a[_0x0e0c('0x2d')][_0x0e0c('0x35')]);_0x2d1444[_0x0e0c('0x36')]=qs['filters'](_[_0x0e0c('0x37')](_0x15bb5a[_0x0e0c('0x2d')],_0x2c9c82[_0x0e0c('0x2e')]));if(_0x15bb5a[_0x0e0c('0x2d')][_0x0e0c('0x38')]){_0x2d1444[_0x0e0c('0x36')]=_[_0x0e0c('0x39')](_0x2d1444[_0x0e0c('0x36')],{'$or':_['map'](_0xe5f2c5,function(_0x5acaa0){if(_0x5acaa0[_0x0e0c('0x3a')][_0x0e0c('0x3b')]!==_0x0e0c('0x3c')){var _0x417a0b={};_0x417a0b[_0x5acaa0['field']]={'$like':'%'+_0x15bb5a[_0x0e0c('0x2d')]['filter']+'%'};return _0x417a0b;}})});}_0x2d1444=_['merge']({},_0x2d1444,_0x15bb5a[_0x0e0c('0x3d')]);var _0x8ea711={'where':_0x2d1444[_0x0e0c('0x36')]};return db[_0x0e0c('0x29')][_0x0e0c('0x1d')](_0x8ea711)[_0x0e0c('0x23')](function(_0x2cc92a){_0x433f56[_0x0e0c('0x1d')]=_0x2cc92a;if(_0x15bb5a[_0x0e0c('0x2d')][_0x0e0c('0x3e')]){_0x2d1444['include']=[{'all':!![]}];}return db[_0x0e0c('0x29')][_0x0e0c('0x3f')](_0x2d1444);})['then'](function(_0x7f7229){_0x433f56[_0x0e0c('0x40')]=_0x7f7229;return _0x433f56;})[_0x0e0c('0x23')](respondWithFilteredResult(_0x252143,_0x2d1444))[_0x0e0c('0x41')](handleError(_0x252143,null));};exports[_0x0e0c('0x42')]=function(_0x182985,_0x4ac3f7){var _0x30c9d0={'raw':![],'where':{'id':_0x182985[_0x0e0c('0x43')]['id']}},_0x372061={};_0x372061[_0x0e0c('0x2b')]=_[_0x0e0c('0x2c')](db[_0x0e0c('0x29')][_0x0e0c('0x2a')]);_0x372061['query']=_['keys'](_0x182985[_0x0e0c('0x2d')]);_0x372061['filters']=_['intersection'](_0x372061['model'],_0x372061[_0x0e0c('0x2d')]);_0x30c9d0[_0x0e0c('0x31')]=_[_0x0e0c('0x2f')](_0x372061[_0x0e0c('0x2b')],qs[_0x0e0c('0x30')](_0x182985[_0x0e0c('0x2d')][_0x0e0c('0x30')]));_0x30c9d0[_0x0e0c('0x31')]=_0x30c9d0[_0x0e0c('0x31')][_0x0e0c('0x44')]?_0x30c9d0[_0x0e0c('0x31')]:_0x372061[_0x0e0c('0x2b')];if(_0x182985['query'][_0x0e0c('0x3e')]){_0x30c9d0[_0x0e0c('0x45')]=[{'all':!![]}];}_0x30c9d0=_[_0x0e0c('0x39')]({},_0x30c9d0,_0x182985[_0x0e0c('0x3d')]);return db['VoiceQueueReport'][_0x0e0c('0x46')](_0x30c9d0)[_0x0e0c('0x23')](handleEntityNotFound(_0x4ac3f7,null))[_0x0e0c('0x23')](respondWithResult(_0x4ac3f7,null))[_0x0e0c('0x41')](handleError(_0x4ac3f7,null));};exports[_0x0e0c('0x47')]=function(_0x4277da,_0x354048){return db[_0x0e0c('0x29')][_0x0e0c('0x47')](_0x4277da['body'],{})[_0x0e0c('0x23')](respondWithResult(_0x354048,0xc9))[_0x0e0c('0x41')](handleError(_0x354048,null));};exports['update']=function(_0x5ab3e0,_0x30d9d2){if(_0x5ab3e0[_0x0e0c('0x48')]['id']){delete _0x5ab3e0[_0x0e0c('0x48')]['id'];}return db['VoiceQueueReport'][_0x0e0c('0x46')]({'where':{'id':_0x5ab3e0[_0x0e0c('0x43')]['id']}})[_0x0e0c('0x23')](handleEntityNotFound(_0x30d9d2,null))[_0x0e0c('0x23')](saveUpdates(_0x5ab3e0['body'],null))['then'](respondWithResult(_0x30d9d2,null))[_0x0e0c('0x41')](handleError(_0x30d9d2,null));};exports[_0x0e0c('0x22')]=function(_0x471691,_0x1dac62){return db[_0x0e0c('0x29')]['find']({'where':{'id':_0x471691['params']['id']}})[_0x0e0c('0x23')](handleEntityNotFound(_0x1dac62,null))['then'](removeEntity(_0x1dac62,null))[_0x0e0c('0x41')](handleError(_0x1dac62,null));};exports[_0x0e0c('0x49')]=function(_0x21e1af,_0x41c7dc){return db['VoiceQueueReport'][_0x0e0c('0x49')]()['then'](respondWithResult(_0x41c7dc,null))[_0x0e0c('0x41')](handleError(_0x41c7dc,null));};exports[_0x0e0c('0x4a')]=function(_0xbb2d99,_0x3cd114){var _0x21e747={},_0x1f1ea8={},_0x5269af={'count':0x0,'rows':[]};_0x1f1ea8['model']=_[_0x0e0c('0x2c')](db[_0x0e0c('0x29')][_0x0e0c('0x2a')]);_0x1f1ea8[_0x0e0c('0x2d')]=_['keys'](_0xbb2d99[_0x0e0c('0x2d')]);_0x1f1ea8[_0x0e0c('0x2e')]=_['intersection'](_0x1f1ea8['model'],_0x1f1ea8[_0x0e0c('0x2d')]);_0x21e747[_0x0e0c('0x31')]=_[_0x0e0c('0x2f')](_0x1f1ea8['model'],qs[_0x0e0c('0x30')](_0xbb2d99[_0x0e0c('0x2d')][_0x0e0c('0x30')]));_0x21e747[_0x0e0c('0x31')]=_0x21e747[_0x0e0c('0x31')][_0x0e0c('0x44')]?_0x21e747[_0x0e0c('0x31')]:_0x1f1ea8['model'];if(!_0xbb2d99['query'][_0x0e0c('0x4b')](_0x0e0c('0x4c'))){_0x21e747['limit']=qs['limit'](_0xbb2d99[_0x0e0c('0x2d')][_0x0e0c('0x32')]);_0x21e747[_0x0e0c('0x33')]=qs['offset'](_0xbb2d99[_0x0e0c('0x2d')][_0x0e0c('0x33')]);}_0x21e747[_0x0e0c('0x34')]=qs['sort'](_0xbb2d99['query'][_0x0e0c('0x35')]);_0x21e747['where']=qs[_0x0e0c('0x2e')](_[_0x0e0c('0x37')](_0xbb2d99[_0x0e0c('0x2d')],_0x1f1ea8[_0x0e0c('0x2e')]));if(_0xbb2d99['query'][_0x0e0c('0x38')]){_0x21e747[_0x0e0c('0x36')]=_[_0x0e0c('0x39')](_0x21e747['where'],{'$or':_[_0x0e0c('0x4d')](_0x21e747[_0x0e0c('0x31')],function(_0x64cb52){var _0x3c3996={};_0x3c3996[_0x64cb52]={'$like':'%'+_0xbb2d99[_0x0e0c('0x2d')][_0x0e0c('0x38')]+'%'};return _0x3c3996;})});}_0x21e747=_['merge']({},_0x21e747,_0xbb2d99[_0x0e0c('0x3d')]);var _0x1b4f3b={'where':_0x21e747['where']};return db[_0x0e0c('0x29')][_0x0e0c('0x1d')](_0x1b4f3b)[_0x0e0c('0x23')](function(_0x59286f){_0x5269af[_0x0e0c('0x1d')]=_0x59286f;if(_0xbb2d99[_0x0e0c('0x2d')][_0x0e0c('0x3e')]){_0x21e747[_0x0e0c('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x0e0c('0x3f')](_0x21e747);})['then'](function(_0x1ae516){_0x5269af[_0x0e0c('0x40')]=_0x1ae516;return _0x5269af;})[_0x0e0c('0x23')](respondWithFilteredResult(_0x3cd114,_0x21e747,_0x0e0c('0x4a')))[_0x0e0c('0x41')](handleError(_0x3cd114,null,_0x0e0c('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2be28f0..1ce88eb 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 _0x46b7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport'];(function(_0x1afea5,_0x1fe8f4){var _0x4cbfb9=function(_0x5b3b67){while(--_0x5b3b67){_0x1afea5['push'](_0x1afea5['shift']());}};_0x4cbfb9(++_0x1fe8f4);}(_0x46b7,0xc5));var _0x746b=function(_0x5cc3d3,_0x5d8cee){_0x5cc3d3=_0x5cc3d3-0x0;var _0x4df114=_0x46b7[_0x5cc3d3];return _0x4df114;};'use strict';var EventEmitter=require(_0x746b('0x0'));var VoiceQueueReport=require(_0x746b('0x1'))['db'][_0x746b('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x746b('0x3')](0x0);var events={'afterCreate':_0x746b('0x4'),'afterUpdate':_0x746b('0x5'),'afterDestroy':_0x746b('0x6')};function emitEvent(_0x37799c){return function(_0x3fa5ca,_0x21d0aa,_0x1fd428){VoiceQueueReportEvents[_0x746b('0x7')](_0x37799c+':'+_0x3fa5ca['id'],_0x3fa5ca);VoiceQueueReportEvents[_0x746b('0x7')](_0x37799c,_0x3fa5ca);_0x1fd428(null);};}for(var e in events){if(events[_0x746b('0x8')](e)){var event=events[e];VoiceQueueReport[_0x746b('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xc090=['update','remove','emit','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x497d8b,_0x3dfb49){var _0x3e4a7c=function(_0x1f189f){while(--_0x1f189f){_0x497d8b['push'](_0x497d8b['shift']());}};_0x3e4a7c(++_0x3dfb49);}(_0xc090,0x112));var _0x0c09=function(_0x23194f,_0x5993e2){_0x23194f=_0x23194f-0x0;var _0x334736=_0xc090[_0x23194f];return _0x334736;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var VoiceQueueReport=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){VoiceQueueReportEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);VoiceQueueReportEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index bf85acf..ef97079 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 _0x96f5=['exports','define','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x86527a,_0x2787c6){var _0x2f14b6=function(_0x4f1613){while(--_0x4f1613){_0x86527a['push'](_0x86527a['shift']());}};_0x2f14b6(++_0x2787c6);}(_0x96f5,0xd7));var _0x596f=function(_0x5deea8,_0x58117f){_0x5deea8=_0x5deea8-0x0;var _0x1d4b0e=_0x96f5[_0x5deea8];return _0x1d4b0e;};'use strict';var _=require('lodash');var util=require(_0x596f('0x0'));var logger=require(_0x596f('0x1'))(_0x596f('0x2'));var moment=require(_0x596f('0x3'));var BPromise=require(_0x596f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x596f('0x5'));var rimraf=require(_0x596f('0x6'));var config=require(_0x596f('0x7'));var attributes=require(_0x596f('0x8'));module[_0x596f('0x9')]=function(_0x58242d,_0x54e6c0){return _0x58242d[_0x596f('0xa')](_0x596f('0xb'),attributes,{'tableName':_0x596f('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x596f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb52=['./voiceQueueReport.attributes','exports','define','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f9537,_0x344bfb){var _0x1539a0=function(_0x121219){while(--_0x121219){_0x1f9537['push'](_0x1f9537['shift']());}};_0x1539a0(++_0x344bfb);}(_0xdb52,0x1d6));var _0x2db5=function(_0x2c534d,_0x2a9042){_0x2c534d=_0x2c534d-0x0;var _0x4db57d=_0xdb52[_0x2c534d];return _0x4db57d;};'use strict';var _=require(_0x2db5('0x0'));var util=require(_0x2db5('0x1'));var logger=require(_0x2db5('0x2'))(_0x2db5('0x3'));var moment=require(_0x2db5('0x4'));var BPromise=require(_0x2db5('0x5'));var rp=require(_0x2db5('0x6'));var fs=require('fs');var path=require(_0x2db5('0x7'));var rimraf=require(_0x2db5('0x8'));var config=require(_0x2db5('0x9'));var attributes=require(_0x2db5('0xa'));module[_0x2db5('0xb')]=function(_0x4e9e87,_0x10b874){return _0x4e9e87[_0x2db5('0xc')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x2db5('0xd')]},{'fields':[_0x2db5('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 3b127fc..1d9bc2e 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 _0x1d8c=['findAll','options','raw','where','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport'];(function(_0x395dbb,_0x3c745e){var _0x432c8a=function(_0x185515){while(--_0x185515){_0x395dbb['push'](_0x395dbb['shift']());}};_0x432c8a(++_0x3c745e);}(_0x1d8c,0xe0));var _0xc1d8=function(_0x4db2ab,_0xcbc3b2){_0x4db2ab=_0x4db2ab-0x0;var _0x4cbe54=_0x1d8c[_0x4db2ab];return _0x4cbe54;};'use strict';var _=require(_0xc1d8('0x0'));var util=require(_0xc1d8('0x1'));var moment=require(_0xc1d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1d8('0x4'))['db'];var utils=require(_0xc1d8('0x5'));var logger=require(_0xc1d8('0x6'))('rpc');var config=require(_0xc1d8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc1d8('0x8')]({'port':0x232a});config[_0xc1d8('0x9')]=_[_0xc1d8('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc1d8('0xb'))(new Redis(config['redis']));require(_0xc1d8('0xc'))[_0xc1d8('0xd')](socket);function respondWithRpcPromise(_0xe23ee5,_0x28ce1a,_0x3cf1e8){return new BPromise(function(_0xbf6437,_0x5cc11c){return client[_0xc1d8('0xe')](_0xe23ee5,_0x3cf1e8)[_0xc1d8('0xf')](function(_0x54b577){logger[_0xc1d8('0x10')](_0xc1d8('0x11'),_0x28ce1a,_0xc1d8('0x12'));logger[_0xc1d8('0x13')](_0xc1d8('0x14'),_0x28ce1a,_0xc1d8('0x12'),JSON[_0xc1d8('0x15')](_0x54b577));if(_0x54b577[_0xc1d8('0x16')]){if(_0x54b577['error'][_0xc1d8('0x17')]===0x1f4){logger[_0xc1d8('0x16')](_0xc1d8('0x11'),_0x28ce1a,_0x54b577['error'][_0xc1d8('0x18')]);return _0x5cc11c(_0x54b577[_0xc1d8('0x16')][_0xc1d8('0x18')]);}logger[_0xc1d8('0x16')](_0xc1d8('0x11'),_0x28ce1a,_0x54b577[_0xc1d8('0x16')][_0xc1d8('0x18')]);return _0xbf6437(_0x54b577[_0xc1d8('0x16')][_0xc1d8('0x18')]);}else{logger['info'](_0xc1d8('0x11'),_0x28ce1a,_0xc1d8('0x12'));_0xbf6437(_0x54b577[_0xc1d8('0x19')]['message']);}})['catch'](function(_0x16cf3c){logger[_0xc1d8('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x28ce1a,_0x16cf3c);_0x5cc11c(_0x16cf3c);});});}exports[_0xc1d8('0x1a')]=function(_0x5ad61f){var _0x30c18b=this;return new Promise(function(_0x24f5da,_0x5870f3){return db[_0xc1d8('0x1b')][_0xc1d8('0x1c')]({'raw':_0x5ad61f[_0xc1d8('0x1d')]?_0x5ad61f[_0xc1d8('0x1d')][_0xc1d8('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ad61f[_0xc1d8('0x1d')]?_0x5ad61f[_0xc1d8('0x1d')][_0xc1d8('0x1f')]||null:null,'attributes':_0x5ad61f[_0xc1d8('0x1d')]?_0x5ad61f['options'][_0xc1d8('0x20')]||null:null,'limit':_0x5ad61f[_0xc1d8('0x1d')]?_0x5ad61f[_0xc1d8('0x1d')][_0xc1d8('0x21')]||null:null,'include':_0x5ad61f[_0xc1d8('0x1d')]?_0x5ad61f[_0xc1d8('0x1d')]['include']?_['map'](_0x5ad61f['options'][_0xc1d8('0x22')],function(_0x205e49){return{'model':db[_0x205e49[_0xc1d8('0x23')]],'as':_0x205e49['as'],'attributes':_0x205e49['attributes'],'include':_0x205e49['include']?_['map'](_0x205e49[_0xc1d8('0x22')],function(_0x1d89c8){return{'model':db[_0x1d89c8[_0xc1d8('0x23')]],'as':_0x1d89c8['as'],'attributes':_0x1d89c8[_0xc1d8('0x20')],'include':_0x1d89c8[_0xc1d8('0x22')]?_[_0xc1d8('0x24')](_0x1d89c8['include'],function(_0x1ca96f){return{'model':db[_0x1ca96f[_0xc1d8('0x23')]],'as':_0x1ca96f['as'],'attributes':_0x1ca96f['attributes']};}):[]};}):[]};}):[]:[]})[_0xc1d8('0xf')](function(_0x44372d){logger[_0xc1d8('0x10')]('GetVoiceQueueReport',_0x5ad61f);logger['debug'](_0xc1d8('0x1a'),_0x5ad61f,JSON[_0xc1d8('0x15')](_0x44372d));_0x24f5da(_0x44372d);})[_0xc1d8('0x25')](function(_0x11190a){logger['error']('GetVoiceQueueReport',_0x11190a[_0xc1d8('0x18')],_0x5ad61f);_0x5870f3(_0x30c18b[_0xc1d8('0x16')](0x1f4,_0x11190a[_0xc1d8('0x18')]));});});};exports[_0xc1d8('0x26')]=function(_0x2a136d){var _0xad4362=this;return new Promise(function(_0x152968,_0x4c479d){return db[_0xc1d8('0x1b')]['create'](_0x2a136d[_0xc1d8('0x27')],{'raw':_0x2a136d[_0xc1d8('0x1d')]?_0x2a136d['options'][_0xc1d8('0x1e')]===undefined?!![]:![]:!![]})[_0xc1d8('0xf')](function(_0x348c0a){logger[_0xc1d8('0x10')]('CreateVoiceQueueReport',_0x2a136d);logger[_0xc1d8('0x13')](_0xc1d8('0x26'),_0x2a136d,JSON['stringify'](_0x348c0a));_0x152968(_0x348c0a);})[_0xc1d8('0x25')](function(_0x2a2254){logger['error'](_0xc1d8('0x26'),_0x2a2254['message'],_0x2a136d);_0x4c479d(_0xad4362[_0xc1d8('0x16')](0x1f4,_0x2a2254['message']));});});};exports[_0xc1d8('0x28')]=function(_0x3be306){var _0x5e2a4b=this;return new Promise(function(_0x1f0458,_0x1c5be3){return db[_0xc1d8('0x1b')][_0xc1d8('0x29')](_0x3be306['body'],{'raw':_0x3be306[_0xc1d8('0x1d')]?_0x3be306[_0xc1d8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3be306[_0xc1d8('0x1d')]?_0x3be306[_0xc1d8('0x1d')][_0xc1d8('0x1f')]||null:null,'attributes':_0x3be306[_0xc1d8('0x1d')]?_0x3be306[_0xc1d8('0x1d')][_0xc1d8('0x20')]||null:null,'limit':_0x3be306[_0xc1d8('0x1d')]?_0x3be306['options'][_0xc1d8('0x21')]||null:null})[_0xc1d8('0xf')](function(_0x29c3f2){logger[_0xc1d8('0x10')](_0xc1d8('0x28'),_0x3be306);logger[_0xc1d8('0x13')](_0xc1d8('0x28'),_0x3be306,JSON[_0xc1d8('0x15')](_0x29c3f2));_0x1f0458(_0x29c3f2);})[_0xc1d8('0x25')](function(_0x35a4d5){logger['error'](_0xc1d8('0x28'),_0x35a4d5['message'],_0x3be306);_0x1c5be3(_0x5e2a4b[_0xc1d8('0x16')](0x1f4,_0x35a4d5[_0xc1d8('0x18')]));});});}; \ No newline at end of file +var _0x7acf=['findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport'];(function(_0x45ac0c,_0x2f8a58){var _0x4b4074=function(_0x1ddc53){while(--_0x1ddc53){_0x45ac0c['push'](_0x45ac0c['shift']());}};_0x4b4074(++_0x2f8a58);}(_0x7acf,0x1c5));var _0xf7ac=function(_0x55cfdb,_0x3b16fb){_0x55cfdb=_0x55cfdb-0x0;var _0x1ad9ce=_0x7acf[_0x55cfdb];return _0x1ad9ce;};'use strict';var _=require(_0xf7ac('0x0'));var util=require(_0xf7ac('0x1'));var moment=require(_0xf7ac('0x2'));var BPromise=require(_0xf7ac('0x3'));var rs=require(_0xf7ac('0x4'));var fs=require('fs');var Redis=require(_0xf7ac('0x5'));var db=require(_0xf7ac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7ac('0x7'))(_0xf7ac('0x8'));var config=require(_0xf7ac('0x9'));var jayson=require(_0xf7ac('0xa'));var client=jayson['client'][_0xf7ac('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf7ac('0xc')],{'host':_0xf7ac('0xd'),'port':0x18eb});var socket=require(_0xf7ac('0xe'))(new Redis(config[_0xf7ac('0xc')]));require(_0xf7ac('0xf'))[_0xf7ac('0x10')](socket);function respondWithRpcPromise(_0x542727,_0x135b67,_0x4a2beb){return new BPromise(function(_0x26fd31,_0x29afc7){return client[_0xf7ac('0x11')](_0x542727,_0x4a2beb)[_0xf7ac('0x12')](function(_0x48f9af){logger[_0xf7ac('0x13')](_0xf7ac('0x14'),_0x135b67,_0xf7ac('0x15'));logger[_0xf7ac('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x135b67,'request\x20sent',JSON[_0xf7ac('0x17')](_0x48f9af));if(_0x48f9af[_0xf7ac('0x18')]){if(_0x48f9af[_0xf7ac('0x18')][_0xf7ac('0x19')]===0x1f4){logger[_0xf7ac('0x18')](_0xf7ac('0x14'),_0x135b67,_0x48f9af[_0xf7ac('0x18')][_0xf7ac('0x1a')]);return _0x29afc7(_0x48f9af[_0xf7ac('0x18')][_0xf7ac('0x1a')]);}logger[_0xf7ac('0x18')](_0xf7ac('0x14'),_0x135b67,_0x48f9af[_0xf7ac('0x18')][_0xf7ac('0x1a')]);return _0x26fd31(_0x48f9af[_0xf7ac('0x18')][_0xf7ac('0x1a')]);}else{logger['info'](_0xf7ac('0x14'),_0x135b67,_0xf7ac('0x15'));_0x26fd31(_0x48f9af[_0xf7ac('0x1b')][_0xf7ac('0x1a')]);}})[_0xf7ac('0x1c')](function(_0x50f1ee){logger[_0xf7ac('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x135b67,_0x50f1ee);_0x29afc7(_0x50f1ee);});});}exports[_0xf7ac('0x1d')]=function(_0x42b17f){var _0x5c5b97=this;return new Promise(function(_0x3c453c,_0x2da8bc){return db[_0xf7ac('0x1e')][_0xf7ac('0x1f')]({'raw':_0x42b17f['options']?_0x42b17f[_0xf7ac('0x20')][_0xf7ac('0x21')]===undefined?!![]:![]:!![],'where':_0x42b17f['options']?_0x42b17f[_0xf7ac('0x20')][_0xf7ac('0x22')]||null:null,'attributes':_0x42b17f[_0xf7ac('0x20')]?_0x42b17f[_0xf7ac('0x20')][_0xf7ac('0x23')]||null:null,'limit':_0x42b17f[_0xf7ac('0x20')]?_0x42b17f[_0xf7ac('0x20')]['limit']||null:null,'include':_0x42b17f[_0xf7ac('0x20')]?_0x42b17f[_0xf7ac('0x20')][_0xf7ac('0x24')]?_[_0xf7ac('0x25')](_0x42b17f[_0xf7ac('0x20')][_0xf7ac('0x24')],function(_0x1b24bc){return{'model':db[_0x1b24bc[_0xf7ac('0x26')]],'as':_0x1b24bc['as'],'attributes':_0x1b24bc[_0xf7ac('0x23')],'include':_0x1b24bc[_0xf7ac('0x24')]?_[_0xf7ac('0x25')](_0x1b24bc[_0xf7ac('0x24')],function(_0x5d32cd){return{'model':db[_0x5d32cd[_0xf7ac('0x26')]],'as':_0x5d32cd['as'],'attributes':_0x5d32cd[_0xf7ac('0x23')],'include':_0x5d32cd[_0xf7ac('0x24')]?_[_0xf7ac('0x25')](_0x5d32cd['include'],function(_0x2b1efb){return{'model':db[_0x2b1efb[_0xf7ac('0x26')]],'as':_0x2b1efb['as'],'attributes':_0x2b1efb[_0xf7ac('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf7ac('0x12')](function(_0x253d06){logger['info'](_0xf7ac('0x1d'),_0x42b17f);logger[_0xf7ac('0x16')](_0xf7ac('0x1d'),_0x42b17f,JSON['stringify'](_0x253d06));_0x3c453c(_0x253d06);})[_0xf7ac('0x1c')](function(_0x2398aa){logger['error'](_0xf7ac('0x1d'),_0x2398aa[_0xf7ac('0x1a')],_0x42b17f);_0x2da8bc(_0x5c5b97[_0xf7ac('0x18')](0x1f4,_0x2398aa['message']));});});};exports[_0xf7ac('0x27')]=function(_0x249dfe){var _0x285fa9=this;return new Promise(function(_0x577cf4,_0x3b17ee){return db[_0xf7ac('0x1e')][_0xf7ac('0x28')](_0x249dfe[_0xf7ac('0x29')],{'raw':_0x249dfe[_0xf7ac('0x20')]?_0x249dfe[_0xf7ac('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xf7ac('0x12')](function(_0x1d98eb){logger[_0xf7ac('0x13')]('CreateVoiceQueueReport',_0x249dfe);logger[_0xf7ac('0x16')](_0xf7ac('0x27'),_0x249dfe,JSON[_0xf7ac('0x17')](_0x1d98eb));_0x577cf4(_0x1d98eb);})[_0xf7ac('0x1c')](function(_0x5dc50d){logger[_0xf7ac('0x18')](_0xf7ac('0x27'),_0x5dc50d[_0xf7ac('0x1a')],_0x249dfe);_0x3b17ee(_0x285fa9['error'](0x1f4,_0x5dc50d[_0xf7ac('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x28a6bd){var _0x2ded44=this;return new Promise(function(_0x208979,_0x4f8c87){return db[_0xf7ac('0x1e')]['update'](_0x28a6bd[_0xf7ac('0x29')],{'raw':_0x28a6bd[_0xf7ac('0x20')]?_0x28a6bd[_0xf7ac('0x20')][_0xf7ac('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a6bd[_0xf7ac('0x20')]?_0x28a6bd[_0xf7ac('0x20')]['where']||null:null,'attributes':_0x28a6bd['options']?_0x28a6bd['options'][_0xf7ac('0x23')]||null:null,'limit':_0x28a6bd[_0xf7ac('0x20')]?_0x28a6bd[_0xf7ac('0x20')][_0xf7ac('0x2a')]||null:null})['then'](function(_0x23e9f4){logger['info'](_0xf7ac('0x2b'),_0x28a6bd);logger['debug'](_0xf7ac('0x2b'),_0x28a6bd,JSON[_0xf7ac('0x17')](_0x23e9f4));_0x208979(_0x23e9f4);})[_0xf7ac('0x1c')](function(_0x1670ec){logger[_0xf7ac('0x18')]('UpdateVoiceQueueReport',_0x1670ec[_0xf7ac('0x1a')],_0x28a6bd);_0x4f8c87(_0x2ded44[_0xf7ac('0x18')](0x1f4,_0x1670ec[_0xf7ac('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index c02a699..c7b9722 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 _0x7309=['remove','emit','register','voiceQueueReport:','save'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0x7309,0x18f));var _0x9730=function(_0xed9f89,_0x39b226){_0xed9f89=_0xed9f89-0x0;var _0x3dc843=_0x7309[_0xed9f89];return _0x3dc843;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x9730('0x0'),_0x9730('0x1'),'update'];function createListener(_0x447c3b,_0x23df49){return function(_0x41138e){_0x23df49[_0x9730('0x2')](_0x447c3b,_0x41138e);};}function removeListener(_0x13e265,_0x357f7a){return function(){VoiceQueueReportEvents['removeListener'](_0x13e265,_0x357f7a);};}exports[_0x9730('0x3')]=function(_0x446466){for(var _0x4c8f5a=0x0,_0x1266bf=events['length'];_0x4c8f5a<_0x1266bf;_0x4c8f5a++){var _0x3163b9=events[_0x4c8f5a];var _0x37e041=createListener(_0x9730('0x4')+_0x3163b9,_0x446466);VoiceQueueReportEvents['on'](_0x3163b9,_0x37e041);}}; \ No newline at end of file +var _0x9092=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x5297a5,_0x18c90d){var _0x3646a7=function(_0x28e33f){while(--_0x28e33f){_0x5297a5['push'](_0x5297a5['shift']());}};_0x3646a7(++_0x18c90d);}(_0x9092,0x95));var _0x2909=function(_0x5362f1,_0x9a0924){_0x5362f1=_0x5362f1-0x0;var _0x5417e5=_0x9092[_0x5362f1];return _0x5417e5;};'use strict';var VoiceQueueReportEvents=require(_0x2909('0x0'));var events=[_0x2909('0x1'),_0x2909('0x2'),_0x2909('0x3')];function createListener(_0x3780d5,_0x48f7f3){return function(_0x8706f7){_0x48f7f3[_0x2909('0x4')](_0x3780d5,_0x8706f7);};}function removeListener(_0x1e9e85,_0x5b92d2){return function(){VoiceQueueReportEvents['removeListener'](_0x1e9e85,_0x5b92d2);};}exports[_0x2909('0x5')]=function(_0x5bea0a){for(var _0x122ddb=0x0,_0x4e3e01=events['length'];_0x122ddb<_0x4e3e01;_0x122ddb++){var _0x2fed8a=events[_0x122ddb];var _0x315ef4=createListener(_0x2909('0x6')+_0x2fed8a,_0x5bea0a);VoiceQueueReportEvents['on'](_0x2fed8a,_0x315ef4);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 413165a..9ed0714 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 _0x1b9b=['index','get','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2bf55a,_0x446c5c){var _0x320ee4=function(_0x5abc04){while(--_0x5abc04){_0x2bf55a['push'](_0x2bf55a['shift']());}};_0x320ee4(++_0x446c5c);}(_0x1b9b,0x89));var _0xb1b9=function(_0x1774e0,_0x2c2e03){_0x1774e0=_0x1774e0-0x0;var _0x5a01e2=_0x1b9b[_0x1774e0];return _0x5a01e2;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require('util');var path=require(_0xb1b9('0x1'));var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express[_0xb1b9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb1b9('0x5'));var config=require(_0xb1b9('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb1b9('0x7')]);router[_0xb1b9('0x8')]('/:id',auth[_0xb1b9('0x9')](),controller[_0xb1b9('0xa')]);router[_0xb1b9('0xb')]('/',auth['isAuthenticated'](),controller[_0xb1b9('0xc')]);router[_0xb1b9('0xd')](_0xb1b9('0xe'),auth['isAuthenticated'](),controller[_0xb1b9('0xf')]);router['delete'](_0xb1b9('0xe'),auth['isAuthenticated'](),controller[_0xb1b9('0x10')]);module[_0xb1b9('0x11')]=router; \ No newline at end of file +var _0xb1ad=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x11b3bf,_0xca12c){var _0x2eeb8b=function(_0x47a388){while(--_0x47a388){_0x11b3bf['push'](_0x11b3bf['shift']());}};_0x2eeb8b(++_0xca12c);}(_0xb1ad,0x184));var _0xdb1a=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xb1ad[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var path=require(_0xdb1a('0x2'));var timeout=require(_0xdb1a('0x3'));var express=require(_0xdb1a('0x4'));var router=express[_0xdb1a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb1a('0x6'));var config=require(_0xdb1a('0x7'));var controller=require(_0xdb1a('0x8'));router[_0xdb1a('0x9')]('/',auth[_0xdb1a('0xa')](),controller[_0xdb1a('0xb')]);router[_0xdb1a('0x9')](_0xdb1a('0xc'),auth[_0xdb1a('0xa')](),controller[_0xdb1a('0xd')]);router[_0xdb1a('0xe')]('/',auth[_0xdb1a('0xa')](),controller[_0xdb1a('0xf')]);router[_0xdb1a('0x10')](_0xdb1a('0xc'),auth['isAuthenticated'](),controller[_0xdb1a('0x11')]);router[_0xdb1a('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdb1a('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8df7e44..4d15af2 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 _0x5fc3=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x58a406,_0x42003c){var _0x454e7f=function(_0x3663d8){while(--_0x3663d8){_0x58a406['push'](_0x58a406['shift']());}};_0x454e7f(++_0x42003c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x5fc3[_0x462fe4];return _0x82b23a;};'use strict';var Sequelize=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));module['exports']={'time':{'type':Sequelize[_0x35fc('0x2')]},'callid':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x35fc('0x4'))}}; \ No newline at end of file +var _0xbd50=['sequelize','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3e5147,_0x33eef9){var _0x18c779=function(_0x2a143c){while(--_0x2a143c){_0x3e5147['push'](_0x3e5147['shift']());}};_0x18c779(++_0x33eef9);}(_0xbd50,0x196));var _0x0bd5=function(_0x117b32,_0x3c2f57){_0x117b32=_0x117b32-0x0;var _0x31551c=_0xbd50[_0x117b32];return _0x31551c;};'use strict';var Sequelize=require(_0x0bd5('0x0'));var moment=require(_0x0bd5('0x1'));module[_0x0bd5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0bd5('0x4')],'allowNull':![],'defaultValue':moment()[_0x0bd5('0x5')](_0x0bd5('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e40ea7d..c0d2ebb 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 _0xf0f6=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','send','index','VoiceQueuesLog','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','key','VIRTUAL','field','filter','then','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2c0543,_0x2926d7){var _0x455199=function(_0xbd0a2e){while(--_0xbd0a2e){_0x2c0543['push'](_0x2c0543['shift']());}};_0x455199(++_0x2926d7);}(_0xf0f6,0x163));var _0x6f0f=function(_0x275986,_0x1ce08e){_0x275986=_0x275986-0x0;var _0x41e82c=_0xf0f6[_0x275986];return _0x41e82c;};'use strict';var pdf=require(_0x6f0f('0x0'));var emlformat=require(_0x6f0f('0x1'));var rimraf=require(_0x6f0f('0x2'));var zipdir=require(_0x6f0f('0x3'));var jsonpatch=require(_0x6f0f('0x4'));var rp=require(_0x6f0f('0x5'));var moment=require(_0x6f0f('0x6'));var BPromise=require(_0x6f0f('0x7'));var Mustache=require(_0x6f0f('0x8'));var util=require(_0x6f0f('0x9'));var path=require(_0x6f0f('0xa'));var sox=require(_0x6f0f('0xb'));var csv=require(_0x6f0f('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f0f('0xd'));var squel=require(_0x6f0f('0xe'));var crypto=require(_0x6f0f('0xf'));var jsforce=require(_0x6f0f('0x10'));var deskjs=require(_0x6f0f('0x11'));var toCsv=require(_0x6f0f('0xc'));var querystring=require(_0x6f0f('0x12'));var Papa=require(_0x6f0f('0x13'));var Redis=require(_0x6f0f('0x14'));var authService=require(_0x6f0f('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f0f('0x16'));var logger=require(_0x6f0f('0x17'))(_0x6f0f('0x18'));var utils=require('../../config/utils');var config=require(_0x6f0f('0x19'));var db=require(_0x6f0f('0x1a'))['db'];function respondWithStatusCode(_0x255804,_0x52c8c6){_0x52c8c6=_0x52c8c6||0xcc;return function(_0x55b33a){if(_0x55b33a){return _0x255804[_0x6f0f('0x1b')](_0x52c8c6);}return _0x255804[_0x6f0f('0x1c')](_0x52c8c6)['end']();};}function respondWithResult(_0x33c6a3,_0x1cf5b0){_0x1cf5b0=_0x1cf5b0||0xc8;return function(_0x1fa919){if(_0x1fa919){return _0x33c6a3[_0x6f0f('0x1c')](_0x1cf5b0)[_0x6f0f('0x1d')](_0x1fa919);}};}function respondWithFilteredResult(_0x4fc4e9,_0x33d348){return function(_0x18e350){if(_0x18e350){var _0x104b2b=_0x18e350[_0x6f0f('0x1e')],_0x3adb19=_0x33d348['offset'],_0x56ece7=_0x33d348[_0x6f0f('0x1f')]+_0x33d348[_0x6f0f('0x20')],_0x5e0f37;if(_0x56ece7>=_0x104b2b){_0x56ece7=_0x104b2b;_0x5e0f37=0xc8;}else{_0x5e0f37=0xce;}_0x4fc4e9[_0x6f0f('0x1c')](_0x5e0f37);return _0x4fc4e9[_0x6f0f('0x21')]('Content-Range',_0x3adb19+'-'+_0x56ece7+'/'+_0x104b2b)['json'](_0x18e350);}return null;};}function patchUpdates(_0x1fa099){return function(_0x44e2f0){try{jsonpatch[_0x6f0f('0x22')](_0x44e2f0,_0x1fa099,!![]);}catch(_0x36c276){return BPromise['reject'](_0x36c276);}return _0x44e2f0[_0x6f0f('0x23')]();};}function saveUpdates(_0x651ca8,_0x14411f){return function(_0x31cd8d){if(_0x31cd8d){return _0x31cd8d[_0x6f0f('0x24')](_0x651ca8)['then'](function(_0x49f487){return _0x49f487;});}return null;};}function removeEntity(_0x134538,_0x4e06da){return function(_0x3d9ae1){if(_0x3d9ae1){return _0x3d9ae1[_0x6f0f('0x25')]()['then'](function(){_0x134538[_0x6f0f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c369a,_0x3161f8){return function(_0x5c3202){if(!_0x5c3202){_0x4c369a['sendStatus'](0x194);}return _0x5c3202;};}function handleError(_0x4c9318,_0xf3f5ff){_0xf3f5ff=_0xf3f5ff||0x1f4;return function(_0x4bb173){logger['error'](_0x4bb173['stack']);if(_0x4bb173['name']){delete _0x4bb173['name'];}_0x4c9318[_0x6f0f('0x1c')](_0xf3f5ff)[_0x6f0f('0x26')](_0x4bb173);};}exports[_0x6f0f('0x27')]=function(_0x3e0e27,_0x3a9af6){var _0x4972e1={},_0x503907={},_0x2f55f4={'count':0x0,'rows':[]};var _0x2df501=db[_0x6f0f('0x28')][_0x6f0f('0x29')];_0x503907[_0x6f0f('0x2a')]=_[_0x6f0f('0x2b')](_0x2df501);_0x503907[_0x6f0f('0x2c')]=_['keys'](_0x3e0e27['query']);_0x503907[_0x6f0f('0x2d')]=_[_0x6f0f('0x2e')](_0x503907[_0x6f0f('0x2a')],_0x503907[_0x6f0f('0x2c')]);_0x4972e1[_0x6f0f('0x2f')]=_[_0x6f0f('0x2e')](_0x503907[_0x6f0f('0x2a')],qs['fields'](_0x3e0e27[_0x6f0f('0x2c')][_0x6f0f('0x30')]));_0x4972e1[_0x6f0f('0x2f')]=_0x4972e1[_0x6f0f('0x2f')][_0x6f0f('0x31')]?_0x4972e1[_0x6f0f('0x2f')]:_0x503907['model'];if(!_0x3e0e27[_0x6f0f('0x2c')][_0x6f0f('0x32')](_0x6f0f('0x33'))){_0x4972e1[_0x6f0f('0x20')]=qs[_0x6f0f('0x20')](_0x3e0e27[_0x6f0f('0x2c')][_0x6f0f('0x20')]);_0x4972e1['offset']=qs[_0x6f0f('0x1f')](_0x3e0e27['query'][_0x6f0f('0x1f')]);}_0x4972e1[_0x6f0f('0x34')]=qs[_0x6f0f('0x35')](_0x3e0e27[_0x6f0f('0x2c')]['sort']);_0x4972e1[_0x6f0f('0x36')]=qs[_0x6f0f('0x2d')](_['pick'](_0x3e0e27[_0x6f0f('0x2c')],_0x503907[_0x6f0f('0x2d')]));if(_0x3e0e27[_0x6f0f('0x2c')]['filter']){_0x4972e1[_0x6f0f('0x36')]=_[_0x6f0f('0x37')](_0x4972e1[_0x6f0f('0x36')],{'$or':_['map'](_0x2df501,function(_0x42e8d6){if(_0x42e8d6['type'][_0x6f0f('0x38')]!==_0x6f0f('0x39')){var _0x1f46bb={};_0x1f46bb[_0x42e8d6[_0x6f0f('0x3a')]]={'$like':'%'+_0x3e0e27[_0x6f0f('0x2c')][_0x6f0f('0x3b')]+'%'};return _0x1f46bb;}})});}_0x4972e1=_['merge']({},_0x4972e1,_0x3e0e27['options']);var _0x29d6a6={'where':_0x4972e1[_0x6f0f('0x36')]};return db[_0x6f0f('0x28')][_0x6f0f('0x1e')](_0x29d6a6)[_0x6f0f('0x3c')](function(_0x968c32){_0x2f55f4[_0x6f0f('0x1e')]=_0x968c32;if(_0x3e0e27['query'][_0x6f0f('0x3d')]){_0x4972e1['include']=[{'all':!![]}];}return db[_0x6f0f('0x28')][_0x6f0f('0x3e')](_0x4972e1);})[_0x6f0f('0x3c')](function(_0x1692d7){_0x2f55f4[_0x6f0f('0x3f')]=_0x1692d7;return _0x2f55f4;})[_0x6f0f('0x3c')](respondWithFilteredResult(_0x3a9af6,_0x4972e1))[_0x6f0f('0x40')](handleError(_0x3a9af6,null));};exports[_0x6f0f('0x41')]=function(_0x1c07b1,_0x4cc833){var _0x40018d={'raw':!![],'where':{'id':_0x1c07b1[_0x6f0f('0x42')]['id']}},_0x5b480c={};_0x5b480c['model']=_[_0x6f0f('0x2b')](db[_0x6f0f('0x28')][_0x6f0f('0x29')]);_0x5b480c[_0x6f0f('0x2c')]=_[_0x6f0f('0x2b')](_0x1c07b1['query']);_0x5b480c[_0x6f0f('0x2d')]=_[_0x6f0f('0x2e')](_0x5b480c[_0x6f0f('0x2a')],_0x5b480c['query']);_0x40018d[_0x6f0f('0x2f')]=_['intersection'](_0x5b480c['model'],qs['fields'](_0x1c07b1[_0x6f0f('0x2c')][_0x6f0f('0x30')]));_0x40018d[_0x6f0f('0x2f')]=_0x40018d[_0x6f0f('0x2f')]['length']?_0x40018d[_0x6f0f('0x2f')]:_0x5b480c[_0x6f0f('0x2a')];if(_0x1c07b1['query'][_0x6f0f('0x3d')]){_0x40018d[_0x6f0f('0x43')]=[{'all':!![]}];}_0x40018d=_[_0x6f0f('0x37')]({},_0x40018d,_0x1c07b1[_0x6f0f('0x44')]);return db['VoiceQueuesLog']['find'](_0x40018d)['then'](handleEntityNotFound(_0x4cc833,null))['then'](respondWithResult(_0x4cc833,null))[_0x6f0f('0x40')](handleError(_0x4cc833,null));};exports[_0x6f0f('0x45')]=function(_0x509335,_0x223b8c){return db['VoiceQueuesLog'][_0x6f0f('0x45')](_0x509335['body'],{})[_0x6f0f('0x3c')](respondWithResult(_0x223b8c,0xc9))['catch'](handleError(_0x223b8c,null));};exports[_0x6f0f('0x24')]=function(_0x39d25e,_0x31bf71){if(_0x39d25e[_0x6f0f('0x46')]['id']){delete _0x39d25e[_0x6f0f('0x46')]['id'];}return db[_0x6f0f('0x28')][_0x6f0f('0x47')]({'where':{'id':_0x39d25e[_0x6f0f('0x42')]['id']}})[_0x6f0f('0x3c')](handleEntityNotFound(_0x31bf71,null))[_0x6f0f('0x3c')](saveUpdates(_0x39d25e[_0x6f0f('0x46')],null))[_0x6f0f('0x3c')](respondWithResult(_0x31bf71,null))[_0x6f0f('0x40')](handleError(_0x31bf71,null));};exports[_0x6f0f('0x25')]=function(_0x5da8e8,_0x5db456){return db[_0x6f0f('0x28')][_0x6f0f('0x47')]({'where':{'id':_0x5da8e8[_0x6f0f('0x42')]['id']}})[_0x6f0f('0x3c')](handleEntityNotFound(_0x5db456,null))[_0x6f0f('0x3c')](removeEntity(_0x5db456,null))[_0x6f0f('0x40')](handleError(_0x5db456,null));}; \ No newline at end of file +var _0x60e3=['destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','VoiceQueuesLog','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','keys','options','find','create','body'];(function(_0x23b19f,_0x15fff7){var _0x4f8d0e=function(_0x21e5c3){while(--_0x21e5c3){_0x23b19f['push'](_0x23b19f['shift']());}};_0x4f8d0e(++_0x15fff7);}(_0x60e3,0x132));var _0x360e=function(_0xda5717,_0x5b7a4b){_0xda5717=_0xda5717-0x0;var _0xc24e88=_0x60e3[_0xda5717];return _0xc24e88;};'use strict';var pdf=require(_0x360e('0x0'));var emlformat=require(_0x360e('0x1'));var rimraf=require(_0x360e('0x2'));var zipdir=require(_0x360e('0x3'));var jsonpatch=require(_0x360e('0x4'));var rp=require(_0x360e('0x5'));var moment=require(_0x360e('0x6'));var BPromise=require(_0x360e('0x7'));var Mustache=require('mustache');var util=require(_0x360e('0x8'));var path=require(_0x360e('0x9'));var sox=require('sox');var csv=require(_0x360e('0xa'));var ejs=require(_0x360e('0xb'));var fs=require('fs');var _=require(_0x360e('0xc'));var squel=require(_0x360e('0xd'));var crypto=require(_0x360e('0xe'));var jsforce=require(_0x360e('0xf'));var deskjs=require(_0x360e('0x10'));var toCsv=require(_0x360e('0xa'));var querystring=require('querystring');var Papa=require(_0x360e('0x11'));var Redis=require(_0x360e('0x12'));var authService=require(_0x360e('0x13'));var qs=require(_0x360e('0x14'));var hardwareService=require(_0x360e('0x15'));var logger=require(_0x360e('0x16'))(_0x360e('0x17'));var utils=require(_0x360e('0x18'));var config=require('../../config/environment');var db=require(_0x360e('0x19'))['db'];function respondWithStatusCode(_0x58243d,_0x1e56db){_0x1e56db=_0x1e56db||0xcc;return function(_0x5dec25){if(_0x5dec25){return _0x58243d[_0x360e('0x1a')](_0x1e56db);}return _0x58243d[_0x360e('0x1b')](_0x1e56db)[_0x360e('0x1c')]();};}function respondWithResult(_0x3755fd,_0x2246a5){_0x2246a5=_0x2246a5||0xc8;return function(_0x25b3cc){if(_0x25b3cc){return _0x3755fd[_0x360e('0x1b')](_0x2246a5)[_0x360e('0x1d')](_0x25b3cc);}};}function respondWithFilteredResult(_0x254916,_0x56aab7){return function(_0x590059){if(_0x590059){var _0x162267=_0x590059[_0x360e('0x1e')],_0x39cad2=_0x56aab7['offset'],_0x1efddd=_0x56aab7[_0x360e('0x1f')]+_0x56aab7[_0x360e('0x20')],_0x433155;if(_0x1efddd>=_0x162267){_0x1efddd=_0x162267;_0x433155=0xc8;}else{_0x433155=0xce;}_0x254916['status'](_0x433155);return _0x254916[_0x360e('0x21')](_0x360e('0x22'),_0x39cad2+'-'+_0x1efddd+'/'+_0x162267)[_0x360e('0x1d')](_0x590059);}return null;};}function patchUpdates(_0x543dbf){return function(_0x118376){try{jsonpatch[_0x360e('0x23')](_0x118376,_0x543dbf,!![]);}catch(_0x3607d0){return BPromise[_0x360e('0x24')](_0x3607d0);}return _0x118376[_0x360e('0x25')]();};}function saveUpdates(_0x2dfac6,_0x498f02){return function(_0x29ac13){if(_0x29ac13){return _0x29ac13[_0x360e('0x26')](_0x2dfac6)[_0x360e('0x27')](function(_0x53feb9){return _0x53feb9;});}return null;};}function removeEntity(_0x5d9edd,_0x10d483){return function(_0x3e6938){if(_0x3e6938){return _0x3e6938['destroy']()[_0x360e('0x27')](function(){_0x5d9edd[_0x360e('0x1b')](0xcc)[_0x360e('0x1c')]();});}};}function handleEntityNotFound(_0x3291db,_0x29dd65){return function(_0xe3701){if(!_0xe3701){_0x3291db[_0x360e('0x1a')](0x194);}return _0xe3701;};}function handleError(_0x5aa705,_0x648d34){_0x648d34=_0x648d34||0x1f4;return function(_0x4b21aa){logger[_0x360e('0x28')](_0x4b21aa['stack']);if(_0x4b21aa['name']){delete _0x4b21aa[_0x360e('0x29')];}_0x5aa705['status'](_0x648d34)[_0x360e('0x2a')](_0x4b21aa);};}exports['index']=function(_0x1777c6,_0x4e0841){var _0x398201={},_0x3ae0e5={},_0x1ab5ef={'count':0x0,'rows':[]};var _0x5c1172=db[_0x360e('0x2b')][_0x360e('0x2c')];_0x3ae0e5['model']=_['keys'](_0x5c1172);_0x3ae0e5['query']=_['keys'](_0x1777c6[_0x360e('0x2d')]);_0x3ae0e5['filters']=_[_0x360e('0x2e')](_0x3ae0e5[_0x360e('0x2f')],_0x3ae0e5[_0x360e('0x2d')]);_0x398201[_0x360e('0x30')]=_[_0x360e('0x2e')](_0x3ae0e5[_0x360e('0x2f')],qs[_0x360e('0x31')](_0x1777c6[_0x360e('0x2d')][_0x360e('0x31')]));_0x398201[_0x360e('0x30')]=_0x398201[_0x360e('0x30')][_0x360e('0x32')]?_0x398201[_0x360e('0x30')]:_0x3ae0e5[_0x360e('0x2f')];if(!_0x1777c6[_0x360e('0x2d')][_0x360e('0x33')]('nolimit')){_0x398201['limit']=qs[_0x360e('0x20')](_0x1777c6['query'][_0x360e('0x20')]);_0x398201[_0x360e('0x1f')]=qs[_0x360e('0x1f')](_0x1777c6['query'][_0x360e('0x1f')]);}_0x398201[_0x360e('0x34')]=qs['sort'](_0x1777c6[_0x360e('0x2d')][_0x360e('0x35')]);_0x398201['where']=qs[_0x360e('0x36')](_[_0x360e('0x37')](_0x1777c6[_0x360e('0x2d')],_0x3ae0e5['filters']));if(_0x1777c6['query'][_0x360e('0x38')]){_0x398201['where']=_[_0x360e('0x39')](_0x398201[_0x360e('0x3a')],{'$or':_[_0x360e('0x3b')](_0x5c1172,function(_0x28ad9f){if(_0x28ad9f[_0x360e('0x3c')][_0x360e('0x3d')]!==_0x360e('0x3e')){var _0x3f5a97={};_0x3f5a97[_0x28ad9f[_0x360e('0x3f')]]={'$like':'%'+_0x1777c6[_0x360e('0x2d')][_0x360e('0x38')]+'%'};return _0x3f5a97;}})});}_0x398201=_[_0x360e('0x39')]({},_0x398201,_0x1777c6['options']);var _0x6df25a={'where':_0x398201[_0x360e('0x3a')]};return db['VoiceQueuesLog'][_0x360e('0x1e')](_0x6df25a)[_0x360e('0x27')](function(_0x2be64d){_0x1ab5ef[_0x360e('0x1e')]=_0x2be64d;if(_0x1777c6['query'][_0x360e('0x40')]){_0x398201[_0x360e('0x41')]=[{'all':!![]}];}return db[_0x360e('0x2b')][_0x360e('0x42')](_0x398201);})[_0x360e('0x27')](function(_0x1c65c2){_0x1ab5ef[_0x360e('0x43')]=_0x1c65c2;return _0x1ab5ef;})[_0x360e('0x27')](respondWithFilteredResult(_0x4e0841,_0x398201))[_0x360e('0x44')](handleError(_0x4e0841,null));};exports['show']=function(_0x2e3cd9,_0x2de5ed){var _0x478c7b={'raw':!![],'where':{'id':_0x2e3cd9['params']['id']}},_0x2a7d54={};_0x2a7d54[_0x360e('0x2f')]=_[_0x360e('0x45')](db[_0x360e('0x2b')][_0x360e('0x2c')]);_0x2a7d54[_0x360e('0x2d')]=_[_0x360e('0x45')](_0x2e3cd9[_0x360e('0x2d')]);_0x2a7d54[_0x360e('0x36')]=_[_0x360e('0x2e')](_0x2a7d54['model'],_0x2a7d54[_0x360e('0x2d')]);_0x478c7b[_0x360e('0x30')]=_[_0x360e('0x2e')](_0x2a7d54[_0x360e('0x2f')],qs['fields'](_0x2e3cd9[_0x360e('0x2d')][_0x360e('0x31')]));_0x478c7b['attributes']=_0x478c7b['attributes'][_0x360e('0x32')]?_0x478c7b[_0x360e('0x30')]:_0x2a7d54[_0x360e('0x2f')];if(_0x2e3cd9[_0x360e('0x2d')][_0x360e('0x40')]){_0x478c7b[_0x360e('0x41')]=[{'all':!![]}];}_0x478c7b=_['merge']({},_0x478c7b,_0x2e3cd9[_0x360e('0x46')]);return db[_0x360e('0x2b')][_0x360e('0x47')](_0x478c7b)[_0x360e('0x27')](handleEntityNotFound(_0x2de5ed,null))[_0x360e('0x27')](respondWithResult(_0x2de5ed,null))[_0x360e('0x44')](handleError(_0x2de5ed,null));};exports[_0x360e('0x48')]=function(_0x14cade,_0x1657b4){return db[_0x360e('0x2b')][_0x360e('0x48')](_0x14cade[_0x360e('0x49')],{})[_0x360e('0x27')](respondWithResult(_0x1657b4,0xc9))[_0x360e('0x44')](handleError(_0x1657b4,null));};exports[_0x360e('0x26')]=function(_0x2f571c,_0x12e93e){if(_0x2f571c[_0x360e('0x49')]['id']){delete _0x2f571c['body']['id'];}return db[_0x360e('0x2b')][_0x360e('0x47')]({'where':{'id':_0x2f571c['params']['id']}})[_0x360e('0x27')](handleEntityNotFound(_0x12e93e,null))['then'](saveUpdates(_0x2f571c[_0x360e('0x49')],null))[_0x360e('0x27')](respondWithResult(_0x12e93e,null))[_0x360e('0x44')](handleError(_0x12e93e,null));};exports[_0x360e('0x4a')]=function(_0x33f20d,_0x3f201f){return db[_0x360e('0x2b')]['find']({'where':{'id':_0x33f20d[_0x360e('0x4b')]['id']}})[_0x360e('0x27')](handleEntityNotFound(_0x3f201f,null))[_0x360e('0x27')](removeEntity(_0x3f201f,null))[_0x360e('0x44')](handleError(_0x3f201f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c8da963..a434d92 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 _0x6de0=['util','moment','bluebird','rimraf','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm'];(function(_0x56f7f2,_0x4108a9){var _0x4d8cb6=function(_0x2e5da5){while(--_0x2e5da5){_0x56f7f2['push'](_0x56f7f2['shift']());}};_0x4d8cb6(++_0x4108a9);}(_0x6de0,0x134));var _0x06de=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x6de0[_0x35885a];return _0xe86249;};'use strict';var _=require('lodash');var util=require(_0x06de('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x06de('0x1'));var BPromise=require(_0x06de('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x06de('0x3'));var config=require('../../config/environment');var attributes=require(_0x06de('0x4'));module[_0x06de('0x5')]=function(_0x292647,_0x184fbd){return _0x292647[_0x06de('0x6')]('VoiceQueuesLog',attributes,{'tableName':_0x06de('0x7'),'paranoid':![],'indexes':[{'name':_0x06de('0x8'),'fields':[_0x06de('0x9'),_0x06de('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x01f7=['voice_queues_log','event_dtm','event','dtm','lodash','api','moment','path','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0xb6a874,_0xb7d710){var _0x3d243b=function(_0x117be9){while(--_0x117be9){_0xb6a874['push'](_0xb6a874['shift']());}};_0x3d243b(++_0xb7d710);}(_0x01f7,0x7c));var _0x701f=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0x01f7[_0x4cb095];return _0x2b565d;};'use strict';var _=require(_0x701f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x701f('0x1'));var moment=require(_0x701f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x701f('0x3'));var rimraf=require('rimraf');var config=require(_0x701f('0x4'));var attributes=require('./voiceQueuesLog.attributes');module[_0x701f('0x5')]=function(_0xa45ede,_0x25fd76){return _0xa45ede[_0x701f('0x6')](_0x701f('0x7'),attributes,{'tableName':_0x701f('0x8'),'paranoid':![],'indexes':[{'name':_0x701f('0x9'),'fields':[_0x701f('0xa'),_0x701f('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 91fefe6..daa7e90 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 _0xc90a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0xc90a,0x102));var _0xac90=function(_0x4f9252,_0x2aec6f){_0x4f9252=_0x4f9252-0x0;var _0x3cf8f9=_0xc90a[_0x4f9252];return _0x3cf8f9;};'use strict';var _=require(_0xac90('0x0'));var util=require(_0xac90('0x1'));var moment=require(_0xac90('0x2'));var BPromise=require(_0xac90('0x3'));var rs=require(_0xac90('0x4'));var fs=require('fs');var Redis=require(_0xac90('0x5'));var db=require(_0xac90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xac90('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac90('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1a04,_0x198e8f,_0x1d2640){return new BPromise(function(_0x4b4361,_0x26958d){return client[_0xac90('0x9')](_0x4e1a04,_0x1d2640)[_0xac90('0xa')](function(_0x1a1c38){logger[_0xac90('0xb')](_0xac90('0xc'),_0x198e8f,_0xac90('0xd'));logger[_0xac90('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x198e8f,_0xac90('0xd'),JSON[_0xac90('0xf')](_0x1a1c38));if(_0x1a1c38[_0xac90('0x10')]){if(_0x1a1c38['error'][_0xac90('0x11')]===0x1f4){logger[_0xac90('0x10')](_0xac90('0xc'),_0x198e8f,_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);return _0x26958d(_0x1a1c38['error'][_0xac90('0x12')]);}logger['error'](_0xac90('0xc'),_0x198e8f,_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);return _0x4b4361(_0x1a1c38[_0xac90('0x10')][_0xac90('0x12')]);}else{logger[_0xac90('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x198e8f,'request\x20sent');_0x4b4361(_0x1a1c38[_0xac90('0x13')][_0xac90('0x12')]);}})['catch'](function(_0x17f1fa){logger[_0xac90('0x10')](_0xac90('0xc'),_0x198e8f,_0x17f1fa);_0x26958d(_0x17f1fa);});});} \ No newline at end of file +var _0x8137=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2abaa9,_0x3aa6e8){var _0x39df51=function(_0xcac79f){while(--_0xcac79f){_0x2abaa9['push'](_0x2abaa9['shift']());}};_0x39df51(++_0x3aa6e8);}(_0x8137,0x180));var _0x7813=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8137[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x7813('0x0'));var util=require(_0x7813('0x1'));var moment=require(_0x7813('0x2'));var BPromise=require(_0x7813('0x3'));var rs=require(_0x7813('0x4'));var fs=require('fs');var Redis=require(_0x7813('0x5'));var db=require(_0x7813('0x6'))['db'];var utils=require(_0x7813('0x7'));var logger=require(_0x7813('0x8'))('rpc');var config=require(_0x7813('0x9'));var jayson=require(_0x7813('0xa'));var client=jayson[_0x7813('0xb')][_0x7813('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e6789,_0x4a0af3,_0x51fb3c){return new BPromise(function(_0x25a499,_0x5ae51e){return client[_0x7813('0xd')](_0x4e6789,_0x51fb3c)[_0x7813('0xe')](function(_0x3a1ee7){logger[_0x7813('0xf')](_0x7813('0x10'),_0x4a0af3,_0x7813('0x11'));logger[_0x7813('0x12')](_0x7813('0x13'),_0x4a0af3,_0x7813('0x11'),JSON[_0x7813('0x14')](_0x3a1ee7));if(_0x3a1ee7[_0x7813('0x15')]){if(_0x3a1ee7[_0x7813('0x15')][_0x7813('0x16')]===0x1f4){logger[_0x7813('0x15')](_0x7813('0x10'),_0x4a0af3,_0x3a1ee7[_0x7813('0x15')][_0x7813('0x17')]);return _0x5ae51e(_0x3a1ee7[_0x7813('0x15')]['message']);}logger[_0x7813('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a0af3,_0x3a1ee7[_0x7813('0x15')][_0x7813('0x17')]);return _0x25a499(_0x3a1ee7[_0x7813('0x15')]['message']);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4a0af3,_0x7813('0x11'));_0x25a499(_0x3a1ee7[_0x7813('0x18')][_0x7813('0x17')]);}})[_0x7813('0x19')](function(_0x24b466){logger[_0x7813('0x15')](_0x7813('0x10'),_0x4a0af3,_0x24b466);_0x5ae51e(_0x24b466);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 1e0bc68..6abd4f5 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 _0x8664=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/download','/:id/downloads','post','update','delete','/:id','destroy','multer','util','path','connect-timeout'];(function(_0x1c9a22,_0x172587){var _0x259611=function(_0x496c1e){while(--_0x496c1e){_0x1c9a22['push'](_0x1c9a22['shift']());}};_0x259611(++_0x172587);}(_0x8664,0x11a));var _0x4866=function(_0x122a19,_0x5c8c49){_0x122a19=_0x122a19-0x0;var _0x5b0a38=_0x8664[_0x122a19];return _0x5b0a38;};'use strict';var multer=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var path=require(_0x4866('0x2'));var timeout=require(_0x4866('0x3'));var express=require(_0x4866('0x4'));var router=express[_0x4866('0x5')]();var auth=require(_0x4866('0x6'));var interaction=require(_0x4866('0x7'));var config=require(_0x4866('0x8'));var controller=require('./voiceRecording.controller');router[_0x4866('0x9')]('/',auth['isAuthenticated'](),controller[_0x4866('0xa')]);router[_0x4866('0x9')](_0x4866('0xb'),auth[_0x4866('0xc')](),controller[_0x4866('0xd')]);router[_0x4866('0x9')]('/:id',auth[_0x4866('0xc')](),controller[_0x4866('0xe')]);router[_0x4866('0x9')](_0x4866('0xf'),auth[_0x4866('0xc')](),controller['download']);router[_0x4866('0x9')](_0x4866('0x10'),controller['downloads']);router[_0x4866('0x11')]('/',auth[_0x4866('0xc')](),controller['create']);router['put']('/:id',auth[_0x4866('0xc')](),controller[_0x4866('0x12')]);router[_0x4866('0x13')](_0x4866('0x14'),auth[_0x4866('0xc')](),controller[_0x4866('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1be1=['put','update','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','post','create'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0x1be1,0x192));var _0x11be=function(_0x51b5f8,_0x3b1aae){_0x51b5f8=_0x51b5f8-0x0;var _0x762cb=_0x1be1[_0x51b5f8];return _0x762cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var auth=require(_0x11be('0x3'));var interaction=require(_0x11be('0x4'));var config=require(_0x11be('0x5'));var controller=require('./voiceRecording.controller');router[_0x11be('0x6')]('/',auth[_0x11be('0x7')](),controller[_0x11be('0x8')]);router['get'](_0x11be('0x9'),auth['isAuthenticated'](),controller[_0x11be('0xa')]);router[_0x11be('0x6')](_0x11be('0xb'),auth[_0x11be('0x7')](),controller[_0x11be('0xc')]);router['get'](_0x11be('0xd'),auth[_0x11be('0x7')](),controller['download']);router[_0x11be('0x6')](_0x11be('0xe'),controller[_0x11be('0xf')]);router[_0x11be('0x10')]('/',auth['isAuthenticated'](),controller[_0x11be('0x11')]);router[_0x11be('0x12')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0x13')]);router[_0x11be('0x14')]('/:id',auth[_0x11be('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a902c94..ea4b036 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 _0xc451=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','path','value','extname','getDataValue','STRING','setDataValue','channel','membername'];(function(_0x4da5d4,_0x3861c8){var _0x26cb6b=function(_0x220ac2){while(--_0x220ac2){_0x4da5d4['push'](_0x4da5d4['shift']());}};_0x26cb6b(++_0x3861c8);}(_0xc451,0xb9));var _0x1c45=function(_0x4cf139,_0x48bdf9){_0x4cf139=_0x4cf139-0x0;var _0x5e6d86=_0xc451[_0x4cf139];return _0x5e6d86;};'use strict';var Sequelize=require(_0x1c45('0x0'));var moment=require(_0x1c45('0x1'));var path=require(_0x1c45('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x1c45('0x3'))?path[_0x1c45('0x4')](this[_0x1c45('0x5')](_0x1c45('0x3'))):undefined;}},'uniqueid':{'type':Sequelize[_0x1c45('0x6')]},'channel':{'type':Sequelize[_0x1c45('0x6')],'set':function(_0x490973){if(_0x490973){this[_0x1c45('0x7')](_0x1c45('0x8'),_0x490973);this[_0x1c45('0x7')](_0x1c45('0x9'),_0x490973['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x1c45('0x6')]},'calleridnum':{'type':Sequelize[_0x1c45('0x6')]},'calleridname':{'type':Sequelize[_0x1c45('0x6')]},'connectedlinenum':{'type':Sequelize[_0x1c45('0x6')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1c45('0x6')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1c45('0x6')]},'value':{'type':Sequelize[_0x1c45('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x1c45('0x6')]},'userDisposition':{'type':Sequelize[_0x1c45('0x6')]},'createdAt':{'type':Sequelize[_0x1c45('0xa')],'get':function(){return moment(this[_0x1c45('0x5')](_0x1c45('0xb')))[_0x1c45('0xc')](_0x1c45('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0x1c45('0xa')],'get':function(){return moment(this[_0x1c45('0x5')](_0x1c45('0xe')))[_0x1c45('0xc')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xcd66=['toString','updatedAt','moment','path','exports','VIRTUAL','getDataValue','extname','value','STRING','setDataValue','channel','split','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4fd02f,_0x37edc0){var _0x2f04af=function(_0x16acb4){while(--_0x16acb4){_0x4fd02f['push'](_0x4fd02f['shift']());}};_0x2f04af(++_0x37edc0);}(_0xcd66,0x6e));var _0x6cd6=function(_0x380610,_0x5aad5f){_0x380610=_0x380610-0x0;var _0x27d218=_0xcd66[_0x380610];return _0x27d218;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6cd6('0x0'));var path=require(_0x6cd6('0x1'));module[_0x6cd6('0x2')]={'format':{'type':Sequelize[_0x6cd6('0x3')],'get':function(){return this[_0x6cd6('0x4')]('value')?path[_0x6cd6('0x5')](this[_0x6cd6('0x4')](_0x6cd6('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x6cd6('0x7')]},'channel':{'type':Sequelize[_0x6cd6('0x7')],'set':function(_0x3b31bf){if(_0x3b31bf){this[_0x6cd6('0x8')](_0x6cd6('0x9'),_0x3b31bf);this['setDataValue']('membername',_0x3b31bf[_0x6cd6('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x6cd6('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6cd6('0x7')]},'connectedlinenum':{'type':Sequelize[_0x6cd6('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6cd6('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6cd6('0x7')]},'value':{'type':Sequelize[_0x6cd6('0x7')]},'type':{'type':Sequelize[_0x6cd6('0x7')]},'rating':{'type':Sequelize[_0x6cd6('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x6cd6('0x7')]},'userDisposition':{'type':Sequelize[_0x6cd6('0x7')]},'createdAt':{'type':Sequelize[_0x6cd6('0xc')],'get':function(){return moment(this['getDataValue'](_0x6cd6('0xd')))[_0x6cd6('0xe')](_0x6cd6('0xf'))[_0x6cd6('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6cd6('0x4')](_0x6cd6('0x11')))[_0x6cd6('0xe')](_0x6cd6('0xf'))[_0x6cd6('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index a9cdd7e..c75ccd8 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 _0x57e3=['../../config/logger','../../config/utils','sendStatus','end','status','json','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VoiceRecording','differenceBy','format','keys','filters','model','attributes','intersection','fields','query','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','destroy','describe','download','type','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','Sequelize','ValidationError','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1cc78b,_0x4e39fd){var _0x3bc4a1=function(_0x2f92fd){while(--_0x2f92fd){_0x1cc78b['push'](_0x1cc78b['shift']());}};_0x3bc4a1(++_0x4e39fd);}(_0x57e3,0x1e3));var _0x357e=function(_0x21e6d0,_0x393f54){_0x21e6d0=_0x21e6d0-0x0;var _0x36bd42=_0x57e3[_0x21e6d0];return _0x36bd42;};'use strict';var pdf=require(_0x357e('0x0'));var emlformat=require(_0x357e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x357e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x357e('0x3'));var moment=require(_0x357e('0x4'));var BPromise=require(_0x357e('0x5'));var Mustache=require(_0x357e('0x6'));var util=require(_0x357e('0x7'));var path=require(_0x357e('0x8'));var sox=require(_0x357e('0x9'));var csv=require(_0x357e('0xa'));var ejs=require(_0x357e('0xb'));var fs=require('fs');var _=require(_0x357e('0xc'));var squel=require(_0x357e('0xd'));var crypto=require(_0x357e('0xe'));var jsforce=require(_0x357e('0xf'));var deskjs=require(_0x357e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x357e('0x11'));var Papa=require(_0x357e('0x12'));var Redis=require(_0x357e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x357e('0x14'));var hardwareService=require(_0x357e('0x15'));var logger=require(_0x357e('0x16'))('api');var utils=require(_0x357e('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1100,_0x553778){_0x553778=_0x553778||0xcc;return function(_0x4400bb){if(_0x4400bb){return _0x2b1100[_0x357e('0x18')](_0x553778);}return _0x2b1100['status'](_0x553778)[_0x357e('0x19')]();};}function respondWithResult(_0x154569,_0x1e4c08){_0x1e4c08=_0x1e4c08||0xc8;return function(_0x3ac0b8){if(_0x3ac0b8){return _0x154569[_0x357e('0x1a')](_0x1e4c08)[_0x357e('0x1b')](_0x3ac0b8);}};}function respondWithFilteredResult(_0x2d5be1,_0x4566ed){return function(_0x3decd8){if(_0x3decd8){var _0x4e00e5=_0x3decd8['count'],_0xf07628=_0x4566ed[_0x357e('0x1c')],_0x289a29=_0x4566ed[_0x357e('0x1c')]+_0x4566ed['limit'],_0x9f69a9;if(_0x289a29>=_0x4e00e5){_0x289a29=_0x4e00e5;_0x9f69a9=0xc8;}else{_0x9f69a9=0xce;}_0x2d5be1[_0x357e('0x1a')](_0x9f69a9);return _0x2d5be1['set'](_0x357e('0x1d'),_0xf07628+'-'+_0x289a29+'/'+_0x4e00e5)[_0x357e('0x1b')](_0x3decd8);}return null;};}function patchUpdates(_0x361d75){return function(_0x4d8655){try{jsonpatch[_0x357e('0x1e')](_0x4d8655,_0x361d75,!![]);}catch(_0x157dba){return BPromise[_0x357e('0x1f')](_0x157dba);}return _0x4d8655[_0x357e('0x20')]();};}function saveUpdates(_0x65826e,_0xb5e5f4){return function(_0x5ea742){if(_0x5ea742){return _0x5ea742[_0x357e('0x21')](_0x65826e)[_0x357e('0x22')](function(_0x39a44d){return _0x39a44d;});}return null;};}function removeEntity(_0x2e43c4,_0x34ba22){return function(_0x5258df){if(_0x5258df){return _0x5258df['destroy']()['then'](function(){_0x2e43c4[_0x357e('0x1a')](0xcc)[_0x357e('0x19')]();});}};}function handleEntityNotFound(_0x204f0f,_0x3cfaee){return function(_0x23c123){if(!_0x23c123){_0x204f0f[_0x357e('0x18')](0x194);}return _0x23c123;};}function handleError(_0xe46dd1,_0x29fd7d){_0x29fd7d=_0x29fd7d||0x1f4;return function(_0x7a1ae5){logger[_0x357e('0x23')](_0x7a1ae5[_0x357e('0x24')]);if(_0x7a1ae5[_0x357e('0x25')]){delete _0x7a1ae5[_0x357e('0x25')];}_0xe46dd1[_0x357e('0x1a')](_0x29fd7d)[_0x357e('0x26')](_0x7a1ae5);};}exports[_0x357e('0x27')]=function(_0x5d1716,_0x553b99){var _0x3bf000={},_0x416a24={},_0x3bf18f={'count':0x0,'rows':[]};var _0x1f8058=db[_0x357e('0x28')]['rawAttributes'];_0x416a24['model']=_[_0x357e('0x29')](_['keys'](_0x1f8058),[_0x357e('0x2a')]);_0x416a24['query']=_[_0x357e('0x2b')](_0x5d1716['query']);_0x416a24[_0x357e('0x2c')]=_['intersection'](_0x416a24[_0x357e('0x2d')],_0x416a24['query']);_0x3bf000[_0x357e('0x2e')]=_[_0x357e('0x2f')](_0x416a24['model'],qs[_0x357e('0x30')](_0x5d1716['query'][_0x357e('0x30')]));_0x3bf000[_0x357e('0x2e')]=_0x3bf000[_0x357e('0x2e')]['length']?_0x3bf000['attributes']:_0x416a24[_0x357e('0x2d')];if(!_0x5d1716[_0x357e('0x31')][_0x357e('0x32')](_0x357e('0x33'))){_0x3bf000[_0x357e('0x34')]=qs['limit'](_0x5d1716[_0x357e('0x31')][_0x357e('0x34')]);_0x3bf000[_0x357e('0x1c')]=qs[_0x357e('0x1c')](_0x5d1716[_0x357e('0x31')]['offset']);}_0x3bf000['order']=qs['sort'](_0x5d1716[_0x357e('0x31')][_0x357e('0x35')]);_0x3bf000['where']=qs[_0x357e('0x2c')](_[_0x357e('0x36')](_0x5d1716[_0x357e('0x31')],_0x416a24['filters']));if(_0x5d1716[_0x357e('0x31')][_0x357e('0x37')]){_0x3bf000[_0x357e('0x38')]=_[_0x357e('0x39')](_0x3bf000[_0x357e('0x38')],{'$or':_[_0x357e('0x3a')](_0x1f8058,function(_0x423645){if(_0x423645['type'][_0x357e('0x3b')]!==_0x357e('0x3c')){var _0x447d2a={};_0x447d2a[_0x423645[_0x357e('0x3d')]]={'$like':'%'+_0x5d1716[_0x357e('0x31')][_0x357e('0x37')]+'%'};return _0x447d2a;}})});}_0x3bf000=_[_0x357e('0x39')]({},_0x3bf000,_0x5d1716[_0x357e('0x3e')]);var _0x3bf0fb={'where':_0x3bf000['where']};return db[_0x357e('0x28')]['count'](_0x3bf0fb)[_0x357e('0x22')](function(_0x9c4c29){_0x3bf18f[_0x357e('0x3f')]=_0x9c4c29;if(_0x5d1716[_0x357e('0x31')][_0x357e('0x40')]){_0x3bf000[_0x357e('0x41')]=[{'all':!![]}];}return db[_0x357e('0x28')][_0x357e('0x42')](_0x3bf000);})[_0x357e('0x22')](function(_0x2bafe9){_0x3bf18f[_0x357e('0x43')]=_0x2bafe9;return _0x3bf18f;})[_0x357e('0x22')](respondWithFilteredResult(_0x553b99,_0x3bf000))['catch'](handleError(_0x553b99,null));};exports[_0x357e('0x44')]=function(_0x552d1d,_0x13251f){var _0x9ad9ea={'raw':![],'where':{'id':_0x552d1d[_0x357e('0x45')]['id']}},_0x351be6={};_0x351be6['model']=_[_0x357e('0x2b')](db[_0x357e('0x28')][_0x357e('0x46')]);_0x351be6['query']=_[_0x357e('0x2b')](_0x552d1d[_0x357e('0x31')]);_0x351be6[_0x357e('0x2c')]=_[_0x357e('0x2f')](_0x351be6['model'],_0x351be6[_0x357e('0x31')]);_0x9ad9ea[_0x357e('0x2e')]=_['intersection'](_0x351be6[_0x357e('0x2d')],qs[_0x357e('0x30')](_0x552d1d[_0x357e('0x31')][_0x357e('0x30')]));_0x9ad9ea[_0x357e('0x2e')]=_0x9ad9ea['attributes']['length']?_0x9ad9ea[_0x357e('0x2e')]:_0x351be6[_0x357e('0x2d')];if(_0x552d1d[_0x357e('0x31')]['includeAll']){_0x9ad9ea['include']=[{'all':!![]}];}_0x9ad9ea=_['merge']({},_0x9ad9ea,_0x552d1d[_0x357e('0x3e')]);return db[_0x357e('0x28')]['find'](_0x9ad9ea)[_0x357e('0x22')](handleEntityNotFound(_0x13251f,null))['then'](respondWithResult(_0x13251f,null))[_0x357e('0x47')](handleError(_0x13251f,null));};exports['create']=function(_0x37196b,_0x2108f4){return db[_0x357e('0x28')][_0x357e('0x48')](_0x37196b['body'],{})[_0x357e('0x22')](respondWithResult(_0x2108f4,0xc9))[_0x357e('0x47')](handleError(_0x2108f4,null));};exports[_0x357e('0x21')]=function(_0x449fa1,_0x51d159){if(_0x449fa1['body']['id']){delete _0x449fa1[_0x357e('0x49')]['id'];}return db[_0x357e('0x28')][_0x357e('0x4a')]({'where':{'id':_0x449fa1[_0x357e('0x45')]['id']}})[_0x357e('0x22')](handleEntityNotFound(_0x51d159,null))[_0x357e('0x22')](saveUpdates(_0x449fa1['body'],null))[_0x357e('0x22')](respondWithResult(_0x51d159,null))[_0x357e('0x47')](handleError(_0x51d159,null));};exports[_0x357e('0x4b')]=function(_0x50ecb9,_0x36a930){return db['VoiceRecording'][_0x357e('0x4a')]({'where':{'id':_0x50ecb9[_0x357e('0x45')]['id']}})['then'](handleEntityNotFound(_0x36a930,null))[_0x357e('0x22')](removeEntity(_0x36a930,null))[_0x357e('0x47')](handleError(_0x36a930,null));};exports[_0x357e('0x4c')]=function(_0x13625e,_0x34bac6){return db[_0x357e('0x28')][_0x357e('0x4c')]()[_0x357e('0x22')](respondWithResult(_0x34bac6,null))[_0x357e('0x47')](handleError(_0x34bac6,null));};exports[_0x357e('0x4d')]=function(_0xa8b8ad,_0x348645,_0x528cab){var _0x278e51=require('../../components/encryptor');var _0x13f3b4=![];var _0x392492={};if(_0xa8b8ad[_0x357e('0x31')][_0x357e('0x4e')]&&_0xa8b8ad[_0x357e('0x31')][_0x357e('0x4e')]==='uniqueid'){_0x392492[_0x357e('0x4f')]=_0xa8b8ad[_0x357e('0x45')]['id'];}else{_0x392492['id']=_0xa8b8ad[_0x357e('0x45')]['id'];}return db[_0x357e('0x28')][_0x357e('0x4a')]({'where':_0x392492,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x348645,null))[_0x357e('0x22')](function(_0x59a7bc){if(_0x59a7bc){var _0x9ac0e3=_0x59a7bc[_0x357e('0x50')];var _0x34bf49=util[_0x357e('0x2a')](_0x357e('0x51'),_0x9ac0e3);if(fs['existsSync'](_0x34bf49)){_0x13f3b4=!![];return _0x278e51[_0x357e('0x52')](_0x34bf49,_0x9ac0e3,config[_0x357e('0x53')][_0x357e('0x54')])[_0x357e('0x22')](function(){return _0x59a7bc;});}return _0x59a7bc;}})[_0x357e('0x22')](function(_0x53dd97){if(_0x53dd97){var _0x12d321=_0x53dd97[_0x357e('0x50')];if(!fs[_0x357e('0x55')](_0x12d321)){throw new db['Sequelize']['ValidationError'](_0x357e('0x56'));}if(_0x53dd97[_0x357e('0x57')]){return _0x348645['download'](_0x12d321,_0x53dd97[_0x357e('0x57')]+path[_0x357e('0x58')](_0x12d321),function(){if(_0x13f3b4){fs[_0x357e('0x59')](_0x12d321);}});}else{return _0x348645['download'](_0x12d321,function(_0x21cf65){if(_0x13f3b4){fs[_0x357e('0x59')](_0x12d321);}});}}})[_0x357e('0x47')](function(_0x3df194){if(_0x3df194[_0x357e('0x5a')]==='VoiceRecording\x20not\x20found'){_0x348645[_0x357e('0x1a')](0x194)[_0x357e('0x26')](_0x357e('0x5b'));}else{return handleError(_0x348645,null);}});};exports[_0x357e('0x5c')]=function(_0x2d47c2,_0x5f2d31,_0x59d797){var _0x34fcdb=require(_0x357e('0x5d'));var _0x10c712=![];var _0x5ebb6d={'$and':[db['sequelize'][_0x357e('0x38')](db[_0x357e('0x5e')]['fn'](_0x357e('0x5f'),db[_0x357e('0x5e')]['col'](_0x357e('0x4f'))),_0x2d47c2['query'][_0x357e('0x60')])]};if(_0x2d47c2[_0x357e('0x31')][_0x357e('0x4e')]&&_0x2d47c2[_0x357e('0x31')][_0x357e('0x4e')]==='uniqueid'){_0x5ebb6d[_0x357e('0x61')][_0x357e('0x62')]({'uniqueid':_0x2d47c2[_0x357e('0x45')]['id']});}else{_0x5ebb6d[_0x357e('0x61')][_0x357e('0x62')]({'id':_0x2d47c2[_0x357e('0x45')]['id']});}return db[_0x357e('0x28')][_0x357e('0x4a')]({'where':_0x5ebb6d,'attributes':['id',_0x357e('0x50')],'raw':!![]})[_0x357e('0x22')](handleEntityNotFound(_0x5f2d31,null))[_0x357e('0x22')](function(_0x38b6ab){if(_0x38b6ab){var _0x408765=util[_0x357e('0x2a')](_0x357e('0x51'),_0x38b6ab['value']);if(fs[_0x357e('0x55')](_0x408765)){_0x10c712=!![];return _0x34fcdb['decryptFile'](_0x408765,_0x38b6ab[_0x357e('0x50')],config['secrets']['recording'])[_0x357e('0x22')](function(){return _0x38b6ab;});}return _0x38b6ab;}})['then'](function(_0x4063bc){if(_0x4063bc){if(!fs[_0x357e('0x55')](_0x4063bc[_0x357e('0x50')])){throw new db[(_0x357e('0x63'))][(_0x357e('0x64'))](_0x357e('0x56'));}if(_0x4063bc[_0x357e('0x57')]){return _0x5f2d31[_0x357e('0x4d')](_0x4063bc['value'],_0x4063bc[_0x357e('0x57')]+path['extname'](_0x4063bc[_0x357e('0x50')]),function(){if(_0x10c712){fs[_0x357e('0x59')](_0x4063bc[_0x357e('0x50')]);}});}else{return _0x5f2d31[_0x357e('0x4d')](_0x4063bc[_0x357e('0x50')],function(_0x202f61){if(_0x10c712){fs[_0x357e('0x59')](_0x4063bc[_0x357e('0x50')]);}});}}})['catch'](handleError(_0x5f2d31,null));}; \ No newline at end of file +var _0x4272=['body','update','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','$and','push','%s.cypher','zip-dir','request-promise','moment','bluebird','mustache','util','path','squel','desk.js','querystring','ioredis','api','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','VoiceRecording','rawAttributes','differenceBy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x4272,0xbe));var _0x2427=function(_0x304ff9,_0x51ffad){_0x304ff9=_0x304ff9-0x0;var _0x528550=_0x4272[_0x304ff9];return _0x528550;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2427('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2427('0x1'));var moment=require(_0x2427('0x2'));var BPromise=require(_0x2427('0x3'));var Mustache=require(_0x2427('0x4'));var util=require(_0x2427('0x5'));var path=require(_0x2427('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2427('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2427('0x8'));var toCsv=require('to-csv');var querystring=require(_0x2427('0x9'));var Papa=require('papaparse');var Redis=require(_0x2427('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2427('0xb'));var utils=require('../../config/utils');var config=require(_0x2427('0xc'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f4c4e,_0x2abef1){_0x2abef1=_0x2abef1||0xcc;return function(_0x45bf56){if(_0x45bf56){return _0x1f4c4e[_0x2427('0xd')](_0x2abef1);}return _0x1f4c4e['status'](_0x2abef1)[_0x2427('0xe')]();};}function respondWithResult(_0x1c4b15,_0x523ba2){_0x523ba2=_0x523ba2||0xc8;return function(_0xa90f9a){if(_0xa90f9a){return _0x1c4b15[_0x2427('0xf')](_0x523ba2)[_0x2427('0x10')](_0xa90f9a);}};}function respondWithFilteredResult(_0xf2a1e,_0x502086){return function(_0x5356b2){if(_0x5356b2){var _0x20de96=_0x5356b2[_0x2427('0x11')],_0x4b4663=_0x502086[_0x2427('0x12')],_0xaf9bc4=_0x502086[_0x2427('0x12')]+_0x502086['limit'],_0xe89494;if(_0xaf9bc4>=_0x20de96){_0xaf9bc4=_0x20de96;_0xe89494=0xc8;}else{_0xe89494=0xce;}_0xf2a1e[_0x2427('0xf')](_0xe89494);return _0xf2a1e[_0x2427('0x13')](_0x2427('0x14'),_0x4b4663+'-'+_0xaf9bc4+'/'+_0x20de96)[_0x2427('0x10')](_0x5356b2);}return null;};}function patchUpdates(_0x518372){return function(_0xff5a33){try{jsonpatch[_0x2427('0x15')](_0xff5a33,_0x518372,!![]);}catch(_0x2df901){return BPromise['reject'](_0x2df901);}return _0xff5a33[_0x2427('0x16')]();};}function saveUpdates(_0x3218ff,_0x254156){return function(_0xa44d39){if(_0xa44d39){return _0xa44d39['update'](_0x3218ff)[_0x2427('0x17')](function(_0x4fb229){return _0x4fb229;});}return null;};}function removeEntity(_0x14372e,_0x3031f5){return function(_0x386868){if(_0x386868){return _0x386868[_0x2427('0x18')]()['then'](function(){_0x14372e[_0x2427('0xf')](0xcc)[_0x2427('0xe')]();});}};}function handleEntityNotFound(_0x2452ef,_0x83b9bf){return function(_0x1babb2){if(!_0x1babb2){_0x2452ef[_0x2427('0xd')](0x194);}return _0x1babb2;};}function handleError(_0x1804f4,_0x5a588e){_0x5a588e=_0x5a588e||0x1f4;return function(_0x434a04){logger[_0x2427('0x19')](_0x434a04[_0x2427('0x1a')]);if(_0x434a04[_0x2427('0x1b')]){delete _0x434a04[_0x2427('0x1b')];}_0x1804f4[_0x2427('0xf')](_0x5a588e)[_0x2427('0x1c')](_0x434a04);};}exports['index']=function(_0x1bd8ac,_0x387084){var _0x3f5fa5={},_0x160aad={},_0x14e2b6={'count':0x0,'rows':[]};var _0x4c0b0b=db[_0x2427('0x1d')][_0x2427('0x1e')];_0x160aad['model']=_[_0x2427('0x1f')](_['keys'](_0x4c0b0b),['format']);_0x160aad['query']=_[_0x2427('0x20')](_0x1bd8ac[_0x2427('0x21')]);_0x160aad[_0x2427('0x22')]=_[_0x2427('0x23')](_0x160aad[_0x2427('0x24')],_0x160aad[_0x2427('0x21')]);_0x3f5fa5[_0x2427('0x25')]=_[_0x2427('0x23')](_0x160aad[_0x2427('0x24')],qs[_0x2427('0x26')](_0x1bd8ac['query'][_0x2427('0x26')]));_0x3f5fa5[_0x2427('0x25')]=_0x3f5fa5['attributes'][_0x2427('0x27')]?_0x3f5fa5['attributes']:_0x160aad[_0x2427('0x24')];if(!_0x1bd8ac[_0x2427('0x21')][_0x2427('0x28')](_0x2427('0x29'))){_0x3f5fa5[_0x2427('0x2a')]=qs[_0x2427('0x2a')](_0x1bd8ac[_0x2427('0x21')][_0x2427('0x2a')]);_0x3f5fa5[_0x2427('0x12')]=qs[_0x2427('0x12')](_0x1bd8ac['query'][_0x2427('0x12')]);}_0x3f5fa5[_0x2427('0x2b')]=qs[_0x2427('0x2c')](_0x1bd8ac['query'][_0x2427('0x2c')]);_0x3f5fa5[_0x2427('0x2d')]=qs['filters'](_['pick'](_0x1bd8ac['query'],_0x160aad[_0x2427('0x22')]));if(_0x1bd8ac[_0x2427('0x21')][_0x2427('0x2e')]){_0x3f5fa5[_0x2427('0x2d')]=_[_0x2427('0x2f')](_0x3f5fa5[_0x2427('0x2d')],{'$or':_['map'](_0x4c0b0b,function(_0x54cca9){if(_0x54cca9[_0x2427('0x30')]['key']!==_0x2427('0x31')){var _0x5645bc={};_0x5645bc[_0x54cca9['field']]={'$like':'%'+_0x1bd8ac[_0x2427('0x21')][_0x2427('0x2e')]+'%'};return _0x5645bc;}})});}_0x3f5fa5=_[_0x2427('0x2f')]({},_0x3f5fa5,_0x1bd8ac[_0x2427('0x32')]);var _0xd1335c={'where':_0x3f5fa5[_0x2427('0x2d')]};return db[_0x2427('0x1d')]['count'](_0xd1335c)[_0x2427('0x17')](function(_0x22072e){_0x14e2b6[_0x2427('0x11')]=_0x22072e;if(_0x1bd8ac['query'][_0x2427('0x33')]){_0x3f5fa5[_0x2427('0x34')]=[{'all':!![]}];}return db[_0x2427('0x1d')][_0x2427('0x35')](_0x3f5fa5);})[_0x2427('0x17')](function(_0xef72ef){_0x14e2b6[_0x2427('0x36')]=_0xef72ef;return _0x14e2b6;})[_0x2427('0x17')](respondWithFilteredResult(_0x387084,_0x3f5fa5))[_0x2427('0x37')](handleError(_0x387084,null));};exports['show']=function(_0x480c32,_0x44af74){var _0x37b1f7={'raw':![],'where':{'id':_0x480c32[_0x2427('0x38')]['id']}},_0xfed702={};_0xfed702['model']=_[_0x2427('0x20')](db[_0x2427('0x1d')][_0x2427('0x1e')]);_0xfed702[_0x2427('0x21')]=_['keys'](_0x480c32[_0x2427('0x21')]);_0xfed702['filters']=_[_0x2427('0x23')](_0xfed702[_0x2427('0x24')],_0xfed702['query']);_0x37b1f7['attributes']=_[_0x2427('0x23')](_0xfed702[_0x2427('0x24')],qs[_0x2427('0x26')](_0x480c32[_0x2427('0x21')][_0x2427('0x26')]));_0x37b1f7['attributes']=_0x37b1f7['attributes'][_0x2427('0x27')]?_0x37b1f7[_0x2427('0x25')]:_0xfed702[_0x2427('0x24')];if(_0x480c32[_0x2427('0x21')][_0x2427('0x33')]){_0x37b1f7['include']=[{'all':!![]}];}_0x37b1f7=_[_0x2427('0x2f')]({},_0x37b1f7,_0x480c32[_0x2427('0x32')]);return db[_0x2427('0x1d')][_0x2427('0x39')](_0x37b1f7)['then'](handleEntityNotFound(_0x44af74,null))[_0x2427('0x17')](respondWithResult(_0x44af74,null))[_0x2427('0x37')](handleError(_0x44af74,null));};exports[_0x2427('0x3a')]=function(_0x35561e,_0x3b7a51){return db[_0x2427('0x1d')][_0x2427('0x3a')](_0x35561e[_0x2427('0x3b')],{})[_0x2427('0x17')](respondWithResult(_0x3b7a51,0xc9))['catch'](handleError(_0x3b7a51,null));};exports[_0x2427('0x3c')]=function(_0x4b77dc,_0x16f61c){if(_0x4b77dc['body']['id']){delete _0x4b77dc['body']['id'];}return db['VoiceRecording'][_0x2427('0x39')]({'where':{'id':_0x4b77dc[_0x2427('0x38')]['id']}})[_0x2427('0x17')](handleEntityNotFound(_0x16f61c,null))[_0x2427('0x17')](saveUpdates(_0x4b77dc[_0x2427('0x3b')],null))[_0x2427('0x17')](respondWithResult(_0x16f61c,null))[_0x2427('0x37')](handleError(_0x16f61c,null));};exports[_0x2427('0x18')]=function(_0x7db4a2,_0xf6b834){return db['VoiceRecording'][_0x2427('0x39')]({'where':{'id':_0x7db4a2[_0x2427('0x38')]['id']}})[_0x2427('0x17')](handleEntityNotFound(_0xf6b834,null))['then'](removeEntity(_0xf6b834,null))[_0x2427('0x37')](handleError(_0xf6b834,null));};exports[_0x2427('0x3d')]=function(_0x4d7c72,_0x43fccf){return db[_0x2427('0x1d')]['describe']()['then'](respondWithResult(_0x43fccf,null))[_0x2427('0x37')](handleError(_0x43fccf,null));};exports[_0x2427('0x3e')]=function(_0x30b06e,_0x2c692d,_0x43ca6f){var _0x4c712d=require(_0x2427('0x3f'));var _0x25aa74=![];var _0x5185e0={};if(_0x30b06e[_0x2427('0x21')]['type']&&_0x30b06e[_0x2427('0x21')][_0x2427('0x30')]===_0x2427('0x40')){_0x5185e0[_0x2427('0x40')]=_0x30b06e[_0x2427('0x38')]['id'];}else{_0x5185e0['id']=_0x30b06e[_0x2427('0x38')]['id'];}return db[_0x2427('0x1d')][_0x2427('0x39')]({'where':_0x5185e0,'attributes':['id',_0x2427('0x41')],'raw':!![]})[_0x2427('0x17')](handleEntityNotFound(_0x2c692d,null))['then'](function(_0x3fe434){if(_0x3fe434){var _0x2c5196=_0x3fe434[_0x2427('0x41')];var _0x2b3f7e=util[_0x2427('0x42')]('%s.cypher',_0x2c5196);if(fs[_0x2427('0x43')](_0x2b3f7e)){_0x25aa74=!![];return _0x4c712d[_0x2427('0x44')](_0x2b3f7e,_0x2c5196,config[_0x2427('0x45')][_0x2427('0x46')])[_0x2427('0x17')](function(){return _0x3fe434;});}return _0x3fe434;}})[_0x2427('0x17')](function(_0x266553){if(_0x266553){var _0x5eb2a5=_0x266553[_0x2427('0x41')];if(!fs[_0x2427('0x43')](_0x5eb2a5)){throw new db[(_0x2427('0x47'))][(_0x2427('0x48'))](_0x2427('0x49'));}if(_0x266553[_0x2427('0x4a')]){return _0x2c692d[_0x2427('0x3e')](_0x5eb2a5,_0x266553[_0x2427('0x4a')]+path[_0x2427('0x4b')](_0x5eb2a5),function(){if(_0x25aa74){fs[_0x2427('0x4c')](_0x5eb2a5);}});}else{return _0x2c692d[_0x2427('0x3e')](_0x5eb2a5,function(_0x498e3a){if(_0x25aa74){fs['unlink'](_0x5eb2a5);}});}}})[_0x2427('0x37')](function(_0x20a9eb){if(_0x20a9eb['message']==='VoiceRecording\x20not\x20found'){_0x2c692d[_0x2427('0xf')](0x194)[_0x2427('0x1c')](_0x2427('0x4d'));}else{return handleError(_0x2c692d,null);}});};exports[_0x2427('0x4e')]=function(_0x1e979d,_0xbbacf5,_0x5f4514){var _0x1f0736=require('../../components/encryptor');var _0x40ca31=![];var _0x480350={'$and':[db[_0x2427('0x4f')]['where'](db['sequelize']['fn']('MD5',db[_0x2427('0x4f')]['col'](_0x2427('0x40'))),_0x1e979d[_0x2427('0x21')]['token'])]};if(_0x1e979d[_0x2427('0x21')][_0x2427('0x30')]&&_0x1e979d['query'][_0x2427('0x30')]===_0x2427('0x40')){_0x480350[_0x2427('0x50')][_0x2427('0x51')]({'uniqueid':_0x1e979d[_0x2427('0x38')]['id']});}else{_0x480350['$and'][_0x2427('0x51')]({'id':_0x1e979d[_0x2427('0x38')]['id']});}return db['VoiceRecording'][_0x2427('0x39')]({'where':_0x480350,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0xbbacf5,null))[_0x2427('0x17')](function(_0x1c0443){if(_0x1c0443){var _0x1cb8aa=util[_0x2427('0x42')](_0x2427('0x52'),_0x1c0443['value']);if(fs[_0x2427('0x43')](_0x1cb8aa)){_0x40ca31=!![];return _0x1f0736['decryptFile'](_0x1cb8aa,_0x1c0443[_0x2427('0x41')],config['secrets']['recording'])[_0x2427('0x17')](function(){return _0x1c0443;});}return _0x1c0443;}})[_0x2427('0x17')](function(_0xe3a343){if(_0xe3a343){if(!fs[_0x2427('0x43')](_0xe3a343['value'])){throw new db[(_0x2427('0x47'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0xe3a343['filename']){return _0xbbacf5[_0x2427('0x3e')](_0xe3a343[_0x2427('0x41')],_0xe3a343[_0x2427('0x4a')]+path['extname'](_0xe3a343[_0x2427('0x41')]),function(){if(_0x40ca31){fs[_0x2427('0x4c')](_0xe3a343['value']);}});}else{return _0xbbacf5[_0x2427('0x3e')](_0xe3a343[_0x2427('0x41')],function(_0x2e63d0){if(_0x40ca31){fs['unlink'](_0xe3a343[_0x2427('0x41')]);}});}}})[_0x2427('0x37')](handleError(_0xbbacf5,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 1eccac8..f8378b0 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 _0x5d52=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','uniqueid','api'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x5d52,0x1cd));var _0x25d5=function(_0x4f9e31,_0x19881c){_0x4f9e31=_0x4f9e31-0x0;var _0x2f9fc7=_0x5d52[_0x4f9e31];return _0x2f9fc7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x25d5('0x0'));var moment=require(_0x25d5('0x1'));var BPromise=require(_0x25d5('0x2'));var rp=require(_0x25d5('0x3'));var fs=require('fs');var path=require(_0x25d5('0x4'));var rimraf=require(_0x25d5('0x5'));var config=require(_0x25d5('0x6'));var attributes=require(_0x25d5('0x7'));module['exports']=function(_0x5481dc,_0x413b2e){return _0x5481dc[_0x25d5('0x8')](_0x25d5('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x25d5('0xa'),'fields':[_0x25d5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e35=['path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','util','../../config/logger','bluebird','request-promise'];(function(_0x122ea5,_0xbc858a){var _0x5d6953=function(_0x5d0fb8){while(--_0x5d0fb8){_0x122ea5['push'](_0x122ea5['shift']());}};_0x5d6953(++_0xbc858a);}(_0x4e35,0x80));var _0x54e3=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x4e35[_0x34a8c8];return _0x1fe6e5;};'use strict';var _=require('lodash');var util=require(_0x54e3('0x0'));var logger=require(_0x54e3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x54e3('0x2'));var rp=require(_0x54e3('0x3'));var fs=require('fs');var path=require(_0x54e3('0x4'));var rimraf=require(_0x54e3('0x5'));var config=require(_0x54e3('0x6'));var attributes=require(_0x54e3('0x7'));module[_0x54e3('0x8')]=function(_0x574ffd,_0x46b373){return _0x574ffd[_0x54e3('0x9')]('VoiceRecording',attributes,{'tableName':_0x54e3('0xa'),'paranoid':![],'indexes':[{'name':_0x54e3('0xb'),'fields':[_0x54e3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b188434..17ea2c4 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 _0xcdb9=['existsSync','value','format','%s.cypher','encryptFile','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','limit','CreateVoiceRecording','../../components/encryptor','create','callRecordingEncryption'];(function(_0x2de385,_0x234cb7){var _0x4406e6=function(_0x48bdfc){while(--_0x48bdfc){_0x2de385['push'](_0x2de385['shift']());}};_0x4406e6(++_0x234cb7);}(_0xcdb9,0x104));var _0x9cdb=function(_0x3162b4,_0x22c4a8){_0x3162b4=_0x3162b4-0x0;var _0x3c0bd8=_0xcdb9[_0x3162b4];return _0x3c0bd8;};'use strict';var _=require(_0x9cdb('0x0'));var util=require(_0x9cdb('0x1'));var moment=require(_0x9cdb('0x2'));var BPromise=require(_0x9cdb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9cdb('0x4'));var logger=require(_0x9cdb('0x5'))(_0x9cdb('0x6'));var config=require(_0x9cdb('0x7'));var jayson=require(_0x9cdb('0x8'));var client=jayson['client'][_0x9cdb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x569635,_0x2279af,_0x1f0ffa){return new BPromise(function(_0x144ecd,_0x2bf8ba){return client[_0x9cdb('0xa')](_0x569635,_0x1f0ffa)[_0x9cdb('0xb')](function(_0x3b91ec){logger['info'](_0x9cdb('0xc'),_0x2279af,'request\x20sent');logger[_0x9cdb('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2279af,_0x9cdb('0xe'),JSON[_0x9cdb('0xf')](_0x3b91ec));if(_0x3b91ec[_0x9cdb('0x10')]){if(_0x3b91ec['error'][_0x9cdb('0x11')]===0x1f4){logger['error'](_0x9cdb('0xc'),_0x2279af,_0x3b91ec[_0x9cdb('0x10')][_0x9cdb('0x12')]);return _0x2bf8ba(_0x3b91ec['error'][_0x9cdb('0x12')]);}logger[_0x9cdb('0x10')](_0x9cdb('0xc'),_0x2279af,_0x3b91ec[_0x9cdb('0x10')][_0x9cdb('0x12')]);return _0x144ecd(_0x3b91ec[_0x9cdb('0x10')]['message']);}else{logger[_0x9cdb('0x13')](_0x9cdb('0xc'),_0x2279af,_0x9cdb('0xe'));_0x144ecd(_0x3b91ec[_0x9cdb('0x14')][_0x9cdb('0x12')]);}})[_0x9cdb('0x15')](function(_0x4f42dc){logger['error'](_0x9cdb('0xc'),_0x2279af,_0x4f42dc);_0x2bf8ba(_0x4f42dc);});});}exports[_0x9cdb('0x16')]=function(_0x36d56f){var _0x3e56c4=this;return new Promise(function(_0x349dba,_0x51485b){return db[_0x9cdb('0x17')][_0x9cdb('0x18')](_0x36d56f[_0x9cdb('0x19')],{'raw':_0x36d56f['options']?_0x36d56f[_0x9cdb('0x1a')][_0x9cdb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36d56f['options']?_0x36d56f['options'][_0x9cdb('0x1c')]||null:null,'attributes':_0x36d56f[_0x9cdb('0x1a')]?_0x36d56f['options']['attributes']||null:null,'limit':_0x36d56f[_0x9cdb('0x1a')]?_0x36d56f[_0x9cdb('0x1a')][_0x9cdb('0x1d')]||null:null})['then'](function(_0x2ff1a0){logger[_0x9cdb('0x13')]('UpdateVoiceRecording',_0x36d56f);logger[_0x9cdb('0xd')](_0x9cdb('0x16'),_0x36d56f,JSON[_0x9cdb('0xf')](_0x2ff1a0));_0x349dba(_0x2ff1a0);})['catch'](function(_0x1ddbd7){logger[_0x9cdb('0x10')]('UpdateVoiceRecording',_0x1ddbd7[_0x9cdb('0x12')],_0x36d56f);_0x51485b(_0x3e56c4[_0x9cdb('0x10')](0x1f4,_0x1ddbd7[_0x9cdb('0x12')]));});});};exports[_0x9cdb('0x1e')]=function(_0x3e8469){var _0x504763=this;return new Promise(function(_0x57df0a,_0x55b65f){var _0x2a4f3e=require(_0x9cdb('0x1f'));var _0x43a961;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x9cdb('0xb')](function(_0x33a394){_0x43a961=_0x33a394;return db[_0x9cdb('0x17')][_0x9cdb('0x20')](_0x3e8469['body']);})[_0x9cdb('0xb')](function(_0x5972a6){if(_0x43a961[_0x9cdb('0x21')]&&fs[_0x9cdb('0x22')](_0x5972a6[_0x9cdb('0x23')])){var _0xa779fa=util[_0x9cdb('0x24')](_0x9cdb('0x25'),_0x5972a6[_0x9cdb('0x23')]);return _0x2a4f3e[_0x9cdb('0x26')](_0x5972a6[_0x9cdb('0x23')],_0xa779fa,config['secrets'][_0x9cdb('0x27')])[_0x9cdb('0xb')](function(){fs[_0x9cdb('0x28')](_0x5972a6['value']);logger['info'](_0x9cdb('0x29'));return _0x5972a6;});}return _0x5972a6;})[_0x9cdb('0xb')](function(_0x5ad75e){logger['info'](_0x9cdb('0x1e'),_0x3e8469);logger[_0x9cdb('0xd')](_0x9cdb('0x1e'),_0x3e8469,JSON[_0x9cdb('0xf')](_0x5ad75e));_0x57df0a(_0x5ad75e);})[_0x9cdb('0x15')](function(_0xdea74e){logger[_0x9cdb('0x10')](_0x9cdb('0x1e'),_0xdea74e[_0x9cdb('0x12')],_0x3e8469);_0x55b65f(_0x504763[_0x9cdb('0x10')](0x1f4,_0xdea74e[_0x9cdb('0x12')]));});});}; \ No newline at end of file +var _0x7acd=['stringify','error','message','result','VoiceRecording','body','options','raw','where','limit','then','UpdateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','format','value','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa1545a,_0x3d7d5c){var _0x303c36=function(_0x1255ae){while(--_0x1255ae){_0xa1545a['push'](_0xa1545a['shift']());}};_0x303c36(++_0x3d7d5c);}(_0x7acd,0x160));var _0xd7ac=function(_0x2547d7,_0x31b099){_0x2547d7=_0x2547d7-0x0;var _0x2cc821=_0x7acd[_0x2547d7];return _0x2cc821;};'use strict';var _=require(_0xd7ac('0x0'));var util=require(_0xd7ac('0x1'));var moment=require(_0xd7ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7ac('0x3'));var fs=require('fs');var Redis=require(_0xd7ac('0x4'));var db=require(_0xd7ac('0x5'))['db'];var utils=require(_0xd7ac('0x6'));var logger=require(_0xd7ac('0x7'))('rpc');var config=require(_0xd7ac('0x8'));var jayson=require(_0xd7ac('0x9'));var client=jayson[_0xd7ac('0xa')][_0xd7ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b10d3,_0x2d9d39,_0x196007){return new BPromise(function(_0x16fb12,_0x3cfebd){return client[_0xd7ac('0xc')](_0x1b10d3,_0x196007)['then'](function(_0x2a2add){logger[_0xd7ac('0xd')](_0xd7ac('0xe'),_0x2d9d39,_0xd7ac('0xf'));logger[_0xd7ac('0x10')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2d9d39,_0xd7ac('0xf'),JSON[_0xd7ac('0x11')](_0x2a2add));if(_0x2a2add[_0xd7ac('0x12')]){if(_0x2a2add[_0xd7ac('0x12')]['code']===0x1f4){logger[_0xd7ac('0x12')](_0xd7ac('0xe'),_0x2d9d39,_0x2a2add[_0xd7ac('0x12')][_0xd7ac('0x13')]);return _0x3cfebd(_0x2a2add[_0xd7ac('0x12')]['message']);}logger[_0xd7ac('0x12')](_0xd7ac('0xe'),_0x2d9d39,_0x2a2add[_0xd7ac('0x12')][_0xd7ac('0x13')]);return _0x16fb12(_0x2a2add[_0xd7ac('0x12')][_0xd7ac('0x13')]);}else{logger[_0xd7ac('0xd')](_0xd7ac('0xe'),_0x2d9d39,'request\x20sent');_0x16fb12(_0x2a2add[_0xd7ac('0x14')]['message']);}})['catch'](function(_0x4dc393){logger[_0xd7ac('0x12')](_0xd7ac('0xe'),_0x2d9d39,_0x4dc393);_0x3cfebd(_0x4dc393);});});}exports['UpdateVoiceRecording']=function(_0x27c814){var _0x3e6b77=this;return new Promise(function(_0x3a66ee,_0x4d2b96){return db[_0xd7ac('0x15')]['update'](_0x27c814[_0xd7ac('0x16')],{'raw':_0x27c814[_0xd7ac('0x17')]?_0x27c814['options'][_0xd7ac('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27c814[_0xd7ac('0x17')]?_0x27c814['options'][_0xd7ac('0x19')]||null:null,'attributes':_0x27c814[_0xd7ac('0x17')]?_0x27c814[_0xd7ac('0x17')]['attributes']||null:null,'limit':_0x27c814[_0xd7ac('0x17')]?_0x27c814[_0xd7ac('0x17')][_0xd7ac('0x1a')]||null:null})[_0xd7ac('0x1b')](function(_0x449c08){logger[_0xd7ac('0xd')](_0xd7ac('0x1c'),_0x27c814);logger[_0xd7ac('0x10')](_0xd7ac('0x1c'),_0x27c814,JSON[_0xd7ac('0x11')](_0x449c08));_0x3a66ee(_0x449c08);})['catch'](function(_0x1d64a2){logger[_0xd7ac('0x12')](_0xd7ac('0x1c'),_0x1d64a2[_0xd7ac('0x13')],_0x27c814);_0x4d2b96(_0x3e6b77[_0xd7ac('0x12')](0x1f4,_0x1d64a2[_0xd7ac('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x34307e){var _0x10234c=this;return new Promise(function(_0x2e6386,_0x489196){var _0x2c3fa1=require(_0xd7ac('0x1d'));var _0x15cef6;return db['Setting'][_0xd7ac('0x1e')]({'attributes':['id',_0xd7ac('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xd7ac('0x1b')](function(_0x1bc254){_0x15cef6=_0x1bc254;return db[_0xd7ac('0x15')][_0xd7ac('0x20')](_0x34307e[_0xd7ac('0x16')]);})[_0xd7ac('0x1b')](function(_0x593951){if(_0x15cef6[_0xd7ac('0x1f')]&&fs[_0xd7ac('0x21')](_0x593951['value'])){var _0x2139b6=util[_0xd7ac('0x22')]('%s.cypher',_0x593951[_0xd7ac('0x23')]);return _0x2c3fa1[_0xd7ac('0x24')](_0x593951[_0xd7ac('0x23')],_0x2139b6,config[_0xd7ac('0x25')]['recording'])[_0xd7ac('0x1b')](function(){fs['unlink'](_0x593951[_0xd7ac('0x23')]);logger[_0xd7ac('0xd')](_0xd7ac('0x26'));return _0x593951;});}return _0x593951;})['then'](function(_0x11337c){logger[_0xd7ac('0xd')](_0xd7ac('0x27'),_0x34307e);logger[_0xd7ac('0x10')]('CreateVoiceRecording',_0x34307e,JSON[_0xd7ac('0x11')](_0x11337c));_0x2e6386(_0x11337c);})[_0xd7ac('0x28')](function(_0x5709ee){logger['error'](_0xd7ac('0x27'),_0x5709ee[_0xd7ac('0x13')],_0x34307e);_0x489196(_0x10234c['error'](0x1f4,_0x5709ee[_0xd7ac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0181010..7177917 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 _0xf4ac=['util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x3c4958,_0x450ef9){var _0x46bd11=function(_0x232e5b){while(--_0x232e5b){_0x3c4958['push'](_0x3c4958['shift']());}};_0x46bd11(++_0x450ef9);}(_0xf4ac,0x149));var _0xcf4a=function(_0xb1392f,_0x322a12){_0xb1392f=_0xb1392f-0x0;var _0x52fc1c=_0xf4ac[_0xb1392f];return _0x52fc1c;};'use strict';var multer=require(_0xcf4a('0x0'));var util=require(_0xcf4a('0x1'));var path=require('path');var timeout=require(_0xcf4a('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xcf4a('0x3'));var interaction=require(_0xcf4a('0x4'));var config=require(_0xcf4a('0x5'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xcf4a('0x6')](),controller[_0xcf4a('0x7')]);router['get'](_0xcf4a('0x8'),auth[_0xcf4a('0x6')](),controller[_0xcf4a('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xcf4a('0xa')]('/:id',auth[_0xcf4a('0x6')](),controller[_0xcf4a('0xb')]);router[_0xcf4a('0xc')](_0xcf4a('0x8'),auth[_0xcf4a('0x6')](),controller[_0xcf4a('0xd')]);module[_0xcf4a('0xe')]=router; \ No newline at end of file +var _0xbfcd=['post','create','put','update','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','/:id','show'];(function(_0x313b82,_0x43290f){var _0x2f8aa3=function(_0x5e3a41){while(--_0x5e3a41){_0x313b82['push'](_0x313b82['shift']());}};_0x2f8aa3(++_0x43290f);}(_0xbfcd,0xc1));var _0xdbfc=function(_0x45dc6d,_0x3e156c){_0x45dc6d=_0x45dc6d-0x0;var _0x2a539c=_0xbfcd[_0x45dc6d];return _0x2a539c;};'use strict';var multer=require(_0xdbfc('0x0'));var util=require('util');var path=require(_0xdbfc('0x1'));var timeout=require('connect-timeout');var express=require(_0xdbfc('0x2'));var router=express[_0xdbfc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdbfc('0x4'));var config=require(_0xdbfc('0x5'));var controller=require(_0xdbfc('0x6'));router['get']('/',auth[_0xdbfc('0x7')](),controller[_0xdbfc('0x8')]);router['get'](_0xdbfc('0x9'),auth['isAuthenticated'](),controller[_0xdbfc('0xa')]);router[_0xdbfc('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbfc('0xc')]);router[_0xdbfc('0xd')](_0xdbfc('0x9'),auth[_0xdbfc('0x7')](),controller[_0xdbfc('0xe')]);router[_0xdbfc('0xf')](_0xdbfc('0x9'),auth[_0xdbfc('0x7')](),controller['destroy']);module[_0xdbfc('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f715c04..78d2855 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 _0xd35f=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0xd35f,0x131));var _0xfd35=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0xd35f[_0x2db667];return _0x83ff9;};'use strict';var Sequelize=require(_0xfd35('0x0'));var moment=require(_0xfd35('0x1'));module['exports']={'type':{'type':Sequelize[_0xfd35('0x2')](_0xfd35('0x3'),_0xfd35('0x4'))},'result':{'type':Sequelize[_0xfd35('0x5')]},'transfererchannel':{'type':Sequelize[_0xfd35('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xfd35('0x5')]},'transferercalleridname':{'type':Sequelize[_0xfd35('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfd35('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xfd35('0x5')]},'transferercontext':{'type':Sequelize[_0xfd35('0x5')]},'transfererexten':{'type':Sequelize[_0xfd35('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xfd35('0x5')]},'transfereechannel':{'type':Sequelize[_0xfd35('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xfd35('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xfd35('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfd35('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xfd35('0x5')]},'transfereecontext':{'type':Sequelize[_0xfd35('0x5')]},'transfereeexten':{'type':Sequelize[_0xfd35('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xfd35('0x2')](_0xfd35('0x6'),'No')},'context':{'type':Sequelize[_0xfd35('0x5')]},'extension':{'type':Sequelize[_0xfd35('0x5')]}}; \ No newline at end of file +var _0x1a4f=['Yes','sequelize','moment','exports','ENUM','attended','STRING'];(function(_0x2bd6b8,_0x4d06bf){var _0x3df212=function(_0x1f4b75){while(--_0x1f4b75){_0x2bd6b8['push'](_0x2bd6b8['shift']());}};_0x3df212(++_0x4d06bf);}(_0x1a4f,0x13c));var _0xf1a4=function(_0x1b0fae,_0x34b461){_0x1b0fae=_0x1b0fae-0x0;var _0x46b4bf=_0x1a4f[_0x1b0fae];return _0x46b4bf;};'use strict';var Sequelize=require(_0xf1a4('0x0'));var moment=require(_0xf1a4('0x1'));module[_0xf1a4('0x2')]={'type':{'type':Sequelize[_0xf1a4('0x3')]('blind',_0xf1a4('0x4'))},'result':{'type':Sequelize[_0xf1a4('0x5')]},'transfererchannel':{'type':Sequelize[_0xf1a4('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf1a4('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf1a4('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf1a4('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf1a4('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xf1a4('0x5')]},'transferercontext':{'type':Sequelize[_0xf1a4('0x5')]},'transfererexten':{'type':Sequelize[_0xf1a4('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf1a4('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf1a4('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf1a4('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xf1a4('0x5')]},'transfereecontext':{'type':Sequelize[_0xf1a4('0x5')]},'transfereeexten':{'type':Sequelize[_0xf1a4('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf1a4('0x5')]},'isexternal':{'type':Sequelize[_0xf1a4('0x3')](_0xf1a4('0x6'),'No')},'context':{'type':Sequelize[_0xf1a4('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 67a7944..8b75fcf 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 _0x9d56=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','index','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','VoiceTransferReport','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x9d56,0x122));var _0x69d5=function(_0x4c14eb,_0x4ce5ca){_0x4c14eb=_0x4c14eb-0x0;var _0x446ec9=_0x9d56[_0x4c14eb];return _0x446ec9;};'use strict';var pdf=require(_0x69d5('0x0'));var emlformat=require(_0x69d5('0x1'));var rimraf=require(_0x69d5('0x2'));var zipdir=require(_0x69d5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69d5('0x4'));var moment=require(_0x69d5('0x5'));var BPromise=require(_0x69d5('0x6'));var Mustache=require(_0x69d5('0x7'));var util=require(_0x69d5('0x8'));var path=require('path');var sox=require(_0x69d5('0x9'));var csv=require(_0x69d5('0xa'));var ejs=require(_0x69d5('0xb'));var fs=require('fs');var _=require(_0x69d5('0xc'));var squel=require(_0x69d5('0xd'));var crypto=require(_0x69d5('0xe'));var jsforce=require(_0x69d5('0xf'));var deskjs=require(_0x69d5('0x10'));var toCsv=require(_0x69d5('0xa'));var querystring=require(_0x69d5('0x11'));var Papa=require(_0x69d5('0x12'));var Redis=require(_0x69d5('0x13'));var authService=require(_0x69d5('0x14'));var qs=require(_0x69d5('0x15'));var hardwareService=require(_0x69d5('0x16'));var logger=require(_0x69d5('0x17'))(_0x69d5('0x18'));var utils=require(_0x69d5('0x19'));var config=require(_0x69d5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c3579,_0x2a09c0){_0x2a09c0=_0x2a09c0||0xcc;return function(_0x2cc733){if(_0x2cc733){return _0x2c3579[_0x69d5('0x1b')](_0x2a09c0);}return _0x2c3579[_0x69d5('0x1c')](_0x2a09c0)['end']();};}function respondWithResult(_0x24966,_0x44320f){_0x44320f=_0x44320f||0xc8;return function(_0x263954){if(_0x263954){return _0x24966[_0x69d5('0x1c')](_0x44320f)['json'](_0x263954);}};}function respondWithFilteredResult(_0x5b192f,_0x502e05){return function(_0x279ce5){if(_0x279ce5){var _0x33cf2e=_0x279ce5['count'],_0x56bbbc=_0x502e05[_0x69d5('0x1d')],_0x28492b=_0x502e05[_0x69d5('0x1d')]+_0x502e05[_0x69d5('0x1e')],_0x24c682;if(_0x28492b>=_0x33cf2e){_0x28492b=_0x33cf2e;_0x24c682=0xc8;}else{_0x24c682=0xce;}_0x5b192f[_0x69d5('0x1c')](_0x24c682);return _0x5b192f[_0x69d5('0x1f')](_0x69d5('0x20'),_0x56bbbc+'-'+_0x28492b+'/'+_0x33cf2e)[_0x69d5('0x21')](_0x279ce5);}return null;};}function patchUpdates(_0x141cb7){return function(_0x54c2a3){try{jsonpatch[_0x69d5('0x22')](_0x54c2a3,_0x141cb7,!![]);}catch(_0x16c02c){return BPromise[_0x69d5('0x23')](_0x16c02c);}return _0x54c2a3[_0x69d5('0x24')]();};}function saveUpdates(_0x24f3f7,_0x3c8901){return function(_0x1f9ed7){if(_0x1f9ed7){return _0x1f9ed7[_0x69d5('0x25')](_0x24f3f7)[_0x69d5('0x26')](function(_0x497c1a){return _0x497c1a;});}return null;};}function removeEntity(_0x4c6c1c,_0x3ae722){return function(_0x3fc1a4){if(_0x3fc1a4){return _0x3fc1a4[_0x69d5('0x27')]()[_0x69d5('0x26')](function(){_0x4c6c1c[_0x69d5('0x1c')](0xcc)[_0x69d5('0x28')]();});}};}function handleEntityNotFound(_0x1ec0d3,_0x22e984){return function(_0x23ee57){if(!_0x23ee57){_0x1ec0d3['sendStatus'](0x194);}return _0x23ee57;};}function handleError(_0x1d27d3,_0x185519){_0x185519=_0x185519||0x1f4;return function(_0x37545d){logger['error'](_0x37545d[_0x69d5('0x29')]);if(_0x37545d['name']){delete _0x37545d['name'];}_0x1d27d3[_0x69d5('0x1c')](_0x185519)['send'](_0x37545d);};}exports[_0x69d5('0x2a')]=function(_0x7636f2,_0x2c3fe8){var _0x589cee={},_0x731b0b={},_0x3b3c1a={'count':0x0,'rows':[]};var _0x459674=db['VoiceTransferReport']['rawAttributes'];_0x731b0b[_0x69d5('0x2b')]=_[_0x69d5('0x2c')](_0x459674);_0x731b0b[_0x69d5('0x2d')]=_[_0x69d5('0x2c')](_0x7636f2[_0x69d5('0x2d')]);_0x731b0b['filters']=_[_0x69d5('0x2e')](_0x731b0b[_0x69d5('0x2b')],_0x731b0b[_0x69d5('0x2d')]);_0x589cee[_0x69d5('0x2f')]=_[_0x69d5('0x2e')](_0x731b0b[_0x69d5('0x2b')],qs[_0x69d5('0x30')](_0x7636f2[_0x69d5('0x2d')]['fields']));_0x589cee[_0x69d5('0x2f')]=_0x589cee[_0x69d5('0x2f')]['length']?_0x589cee[_0x69d5('0x2f')]:_0x731b0b['model'];if(!_0x7636f2[_0x69d5('0x2d')][_0x69d5('0x31')](_0x69d5('0x32'))){_0x589cee['limit']=qs[_0x69d5('0x1e')](_0x7636f2[_0x69d5('0x2d')]['limit']);_0x589cee[_0x69d5('0x1d')]=qs[_0x69d5('0x1d')](_0x7636f2[_0x69d5('0x2d')]['offset']);}_0x589cee[_0x69d5('0x33')]=qs[_0x69d5('0x34')](_0x7636f2[_0x69d5('0x2d')][_0x69d5('0x34')]);_0x589cee[_0x69d5('0x35')]=qs[_0x69d5('0x36')](_[_0x69d5('0x37')](_0x7636f2[_0x69d5('0x2d')],_0x731b0b[_0x69d5('0x36')]));if(_0x7636f2[_0x69d5('0x2d')][_0x69d5('0x38')]){_0x589cee[_0x69d5('0x35')]=_[_0x69d5('0x39')](_0x589cee[_0x69d5('0x35')],{'$or':_[_0x69d5('0x3a')](_0x459674,function(_0x30a43e){if(_0x30a43e[_0x69d5('0x3b')]['key']!==_0x69d5('0x3c')){var _0x2f0e23={};_0x2f0e23[_0x30a43e[_0x69d5('0x3d')]]={'$like':'%'+_0x7636f2['query'][_0x69d5('0x38')]+'%'};return _0x2f0e23;}})});}_0x589cee=_[_0x69d5('0x39')]({},_0x589cee,_0x7636f2[_0x69d5('0x3e')]);var _0x5898c6={'where':_0x589cee[_0x69d5('0x35')]};return db['VoiceTransferReport'][_0x69d5('0x3f')](_0x5898c6)[_0x69d5('0x26')](function(_0x23aaf4){_0x3b3c1a['count']=_0x23aaf4;if(_0x7636f2[_0x69d5('0x2d')][_0x69d5('0x40')]){_0x589cee[_0x69d5('0x41')]=[{'all':!![]}];}return db[_0x69d5('0x42')]['findAll'](_0x589cee);})[_0x69d5('0x26')](function(_0x661bca){_0x3b3c1a[_0x69d5('0x43')]=_0x661bca;return _0x3b3c1a;})[_0x69d5('0x26')](respondWithFilteredResult(_0x2c3fe8,_0x589cee))[_0x69d5('0x44')](handleError(_0x2c3fe8,null));};exports[_0x69d5('0x45')]=function(_0x51a8f1,_0x463d7f){var _0x58f7d5={'raw':!![],'where':{'id':_0x51a8f1[_0x69d5('0x46')]['id']}},_0x5a0b78={};_0x5a0b78[_0x69d5('0x2b')]=_[_0x69d5('0x2c')](db[_0x69d5('0x42')][_0x69d5('0x47')]);_0x5a0b78[_0x69d5('0x2d')]=_[_0x69d5('0x2c')](_0x51a8f1[_0x69d5('0x2d')]);_0x5a0b78[_0x69d5('0x36')]=_[_0x69d5('0x2e')](_0x5a0b78[_0x69d5('0x2b')],_0x5a0b78['query']);_0x58f7d5['attributes']=_['intersection'](_0x5a0b78['model'],qs[_0x69d5('0x30')](_0x51a8f1[_0x69d5('0x2d')][_0x69d5('0x30')]));_0x58f7d5[_0x69d5('0x2f')]=_0x58f7d5[_0x69d5('0x2f')][_0x69d5('0x48')]?_0x58f7d5['attributes']:_0x5a0b78['model'];if(_0x51a8f1[_0x69d5('0x2d')][_0x69d5('0x40')]){_0x58f7d5[_0x69d5('0x41')]=[{'all':!![]}];}_0x58f7d5=_[_0x69d5('0x39')]({},_0x58f7d5,_0x51a8f1[_0x69d5('0x3e')]);return db[_0x69d5('0x42')][_0x69d5('0x49')](_0x58f7d5)[_0x69d5('0x26')](handleEntityNotFound(_0x463d7f,null))['then'](respondWithResult(_0x463d7f,null))['catch'](handleError(_0x463d7f,null));};exports[_0x69d5('0x4a')]=function(_0x2bbf0f,_0x28b301){return db[_0x69d5('0x42')][_0x69d5('0x4a')](_0x2bbf0f[_0x69d5('0x4b')],{})['then'](respondWithResult(_0x28b301,0xc9))['catch'](handleError(_0x28b301,null));};exports[_0x69d5('0x25')]=function(_0x29f40,_0x402f7f){if(_0x29f40[_0x69d5('0x4b')]['id']){delete _0x29f40[_0x69d5('0x4b')]['id'];}return db[_0x69d5('0x42')][_0x69d5('0x49')]({'where':{'id':_0x29f40[_0x69d5('0x46')]['id']}})[_0x69d5('0x26')](handleEntityNotFound(_0x402f7f,null))[_0x69d5('0x26')](saveUpdates(_0x29f40['body'],null))[_0x69d5('0x26')](respondWithResult(_0x402f7f,null))[_0x69d5('0x44')](handleError(_0x402f7f,null));};exports[_0x69d5('0x27')]=function(_0x4497b4,_0x1a4ed4){return db['VoiceTransferReport'][_0x69d5('0x49')]({'where':{'id':_0x4497b4['params']['id']}})[_0x69d5('0x26')](handleEntityNotFound(_0x1a4ed4,null))[_0x69d5('0x26')](removeEntity(_0x1a4ed4,null))[_0x69d5('0x44')](handleError(_0x1a4ed4,null));}; \ No newline at end of file +var _0x565f=['save','update','then','destroy','stack','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','key','merge','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','reject'];(function(_0x2132b2,_0x2d9718){var _0x18bb11=function(_0xa0edea){while(--_0xa0edea){_0x2132b2['push'](_0x2132b2['shift']());}};_0x18bb11(++_0x2d9718);}(_0x565f,0x68));var _0xf565=function(_0x4c4ae4,_0x3c0170){_0x4c4ae4=_0x4c4ae4-0x0;var _0x21522e=_0x565f[_0x4c4ae4];return _0x21522e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf565('0x0'));var rimraf=require(_0xf565('0x1'));var zipdir=require(_0xf565('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf565('0x3'));var moment=require(_0xf565('0x4'));var BPromise=require(_0xf565('0x5'));var Mustache=require(_0xf565('0x6'));var util=require(_0xf565('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf565('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf565('0x9'));var crypto=require(_0xf565('0xa'));var jsforce=require(_0xf565('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf565('0xc'));var querystring=require('querystring');var Papa=require(_0xf565('0xd'));var Redis=require('ioredis');var authService=require(_0xf565('0xe'));var qs=require(_0xf565('0xf'));var hardwareService=require(_0xf565('0x10'));var logger=require(_0xf565('0x11'))(_0xf565('0x12'));var utils=require(_0xf565('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4ef4,_0x9f915c){_0x9f915c=_0x9f915c||0xcc;return function(_0xd29dae){if(_0xd29dae){return _0x1a4ef4[_0xf565('0x14')](_0x9f915c);}return _0x1a4ef4[_0xf565('0x15')](_0x9f915c)[_0xf565('0x16')]();};}function respondWithResult(_0x5304cf,_0x3c0cff){_0x3c0cff=_0x3c0cff||0xc8;return function(_0x3b7abc){if(_0x3b7abc){return _0x5304cf[_0xf565('0x15')](_0x3c0cff)['json'](_0x3b7abc);}};}function respondWithFilteredResult(_0x25b187,_0x196b06){return function(_0x4c209f){if(_0x4c209f){var _0x394e33=_0x4c209f[_0xf565('0x17')],_0x2cd6a8=_0x196b06['offset'],_0x468d80=_0x196b06[_0xf565('0x18')]+_0x196b06['limit'],_0x46ee2e;if(_0x468d80>=_0x394e33){_0x468d80=_0x394e33;_0x46ee2e=0xc8;}else{_0x46ee2e=0xce;}_0x25b187['status'](_0x46ee2e);return _0x25b187[_0xf565('0x19')](_0xf565('0x1a'),_0x2cd6a8+'-'+_0x468d80+'/'+_0x394e33)['json'](_0x4c209f);}return null;};}function patchUpdates(_0x48fd55){return function(_0x2d2197){try{jsonpatch['apply'](_0x2d2197,_0x48fd55,!![]);}catch(_0x248111){return BPromise[_0xf565('0x1b')](_0x248111);}return _0x2d2197[_0xf565('0x1c')]();};}function saveUpdates(_0x51215d,_0x55032c){return function(_0xb7b197){if(_0xb7b197){return _0xb7b197[_0xf565('0x1d')](_0x51215d)[_0xf565('0x1e')](function(_0x4114d0){return _0x4114d0;});}return null;};}function removeEntity(_0x1ec04f,_0x4a2170){return function(_0x436a7d){if(_0x436a7d){return _0x436a7d[_0xf565('0x1f')]()[_0xf565('0x1e')](function(){_0x1ec04f[_0xf565('0x15')](0xcc)[_0xf565('0x16')]();});}};}function handleEntityNotFound(_0x2c67a6,_0xe23d61){return function(_0x139915){if(!_0x139915){_0x2c67a6[_0xf565('0x14')](0x194);}return _0x139915;};}function handleError(_0x268384,_0x5174a7){_0x5174a7=_0x5174a7||0x1f4;return function(_0x44a4aa){logger['error'](_0x44a4aa[_0xf565('0x20')]);if(_0x44a4aa[_0xf565('0x21')]){delete _0x44a4aa['name'];}_0x268384[_0xf565('0x15')](_0x5174a7)[_0xf565('0x22')](_0x44a4aa);};}exports[_0xf565('0x23')]=function(_0x33e81c,_0x10a396){var _0x1239a7={},_0x42d7ab={},_0xf05b6b={'count':0x0,'rows':[]};var _0x53d8b3=db[_0xf565('0x24')][_0xf565('0x25')];_0x42d7ab[_0xf565('0x26')]=_[_0xf565('0x27')](_0x53d8b3);_0x42d7ab[_0xf565('0x28')]=_['keys'](_0x33e81c[_0xf565('0x28')]);_0x42d7ab[_0xf565('0x29')]=_[_0xf565('0x2a')](_0x42d7ab[_0xf565('0x26')],_0x42d7ab[_0xf565('0x28')]);_0x1239a7['attributes']=_[_0xf565('0x2a')](_0x42d7ab[_0xf565('0x26')],qs[_0xf565('0x2b')](_0x33e81c[_0xf565('0x28')][_0xf565('0x2b')]));_0x1239a7[_0xf565('0x2c')]=_0x1239a7['attributes'][_0xf565('0x2d')]?_0x1239a7[_0xf565('0x2c')]:_0x42d7ab['model'];if(!_0x33e81c[_0xf565('0x28')][_0xf565('0x2e')](_0xf565('0x2f'))){_0x1239a7[_0xf565('0x30')]=qs[_0xf565('0x30')](_0x33e81c[_0xf565('0x28')][_0xf565('0x30')]);_0x1239a7[_0xf565('0x18')]=qs['offset'](_0x33e81c[_0xf565('0x28')][_0xf565('0x18')]);}_0x1239a7[_0xf565('0x31')]=qs['sort'](_0x33e81c[_0xf565('0x28')][_0xf565('0x32')]);_0x1239a7[_0xf565('0x33')]=qs[_0xf565('0x29')](_[_0xf565('0x34')](_0x33e81c['query'],_0x42d7ab[_0xf565('0x29')]));if(_0x33e81c['query'][_0xf565('0x35')]){_0x1239a7[_0xf565('0x33')]=_['merge'](_0x1239a7['where'],{'$or':_[_0xf565('0x36')](_0x53d8b3,function(_0x27fb3d){if(_0x27fb3d['type'][_0xf565('0x37')]!=='VIRTUAL'){var _0x4dce84={};_0x4dce84[_0x27fb3d['field']]={'$like':'%'+_0x33e81c['query'][_0xf565('0x35')]+'%'};return _0x4dce84;}})});}_0x1239a7=_[_0xf565('0x38')]({},_0x1239a7,_0x33e81c[_0xf565('0x39')]);var _0x4d92c4={'where':_0x1239a7[_0xf565('0x33')]};return db[_0xf565('0x24')][_0xf565('0x17')](_0x4d92c4)['then'](function(_0x2aeca4){_0xf05b6b['count']=_0x2aeca4;if(_0x33e81c[_0xf565('0x28')][_0xf565('0x3a')]){_0x1239a7[_0xf565('0x3b')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xf565('0x3c')](_0x1239a7);})['then'](function(_0x1da55c){_0xf05b6b['rows']=_0x1da55c;return _0xf05b6b;})[_0xf565('0x1e')](respondWithFilteredResult(_0x10a396,_0x1239a7))[_0xf565('0x3d')](handleError(_0x10a396,null));};exports['show']=function(_0x36d030,_0x2a42a8){var _0x159ec7={'raw':!![],'where':{'id':_0x36d030[_0xf565('0x3e')]['id']}},_0x5b8685={};_0x5b8685['model']=_[_0xf565('0x27')](db[_0xf565('0x24')][_0xf565('0x25')]);_0x5b8685[_0xf565('0x28')]=_[_0xf565('0x27')](_0x36d030[_0xf565('0x28')]);_0x5b8685['filters']=_['intersection'](_0x5b8685[_0xf565('0x26')],_0x5b8685[_0xf565('0x28')]);_0x159ec7[_0xf565('0x2c')]=_[_0xf565('0x2a')](_0x5b8685[_0xf565('0x26')],qs['fields'](_0x36d030[_0xf565('0x28')][_0xf565('0x2b')]));_0x159ec7[_0xf565('0x2c')]=_0x159ec7[_0xf565('0x2c')]['length']?_0x159ec7[_0xf565('0x2c')]:_0x5b8685['model'];if(_0x36d030['query'][_0xf565('0x3a')]){_0x159ec7[_0xf565('0x3b')]=[{'all':!![]}];}_0x159ec7=_['merge']({},_0x159ec7,_0x36d030['options']);return db['VoiceTransferReport'][_0xf565('0x3f')](_0x159ec7)[_0xf565('0x1e')](handleEntityNotFound(_0x2a42a8,null))[_0xf565('0x1e')](respondWithResult(_0x2a42a8,null))[_0xf565('0x3d')](handleError(_0x2a42a8,null));};exports[_0xf565('0x40')]=function(_0x413f6c,_0x420074){return db[_0xf565('0x24')][_0xf565('0x40')](_0x413f6c[_0xf565('0x41')],{})[_0xf565('0x1e')](respondWithResult(_0x420074,0xc9))['catch'](handleError(_0x420074,null));};exports['update']=function(_0x4c0920,_0x3fbffa){if(_0x4c0920[_0xf565('0x41')]['id']){delete _0x4c0920[_0xf565('0x41')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x4c0920[_0xf565('0x3e')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x3fbffa,null))[_0xf565('0x1e')](saveUpdates(_0x4c0920['body'],null))[_0xf565('0x1e')](respondWithResult(_0x3fbffa,null))[_0xf565('0x3d')](handleError(_0x3fbffa,null));};exports[_0xf565('0x1f')]=function(_0x483632,_0x5b6cbb){return db[_0xf565('0x24')]['find']({'where':{'id':_0x483632[_0xf565('0x3e')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x5b6cbb,null))[_0xf565('0x1e')](removeEntity(_0x5b6cbb,null))[_0xf565('0x3d')](handleError(_0x5b6cbb,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b8f03b8..1998184 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 _0x5b47=['report_call_transfer','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5b47,0xb1));var _0x75b4=function(_0x2fc2e8,_0xc8860e){_0x2fc2e8=_0x2fc2e8-0x0;var _0x434757=_0x5b47[_0x2fc2e8];return _0x434757;};'use strict';var _=require('lodash');var util=require(_0x75b4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x75b4('0x1'));var BPromise=require(_0x75b4('0x2'));var rp=require(_0x75b4('0x3'));var fs=require('fs');var path=require(_0x75b4('0x4'));var rimraf=require(_0x75b4('0x5'));var config=require(_0x75b4('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x75b4('0x7')]=function(_0x1d114c,_0x5f30d3){return _0x1d114c[_0x75b4('0x8')](_0x75b4('0x9'),attributes,{'tableName':_0x75b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedff=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x74fb3b,_0x315996){var _0x3d9e6a=function(_0x5169b9){while(--_0x5169b9){_0x74fb3b['push'](_0x74fb3b['shift']());}};_0x3d9e6a(++_0x315996);}(_0xedff,0x1ee));var _0xfedf=function(_0x2b271d,_0x883556){_0x2b271d=_0x2b271d-0x0;var _0x2ea08e=_0xedff[_0x2b271d];return _0x2ea08e;};'use strict';var _=require(_0xfedf('0x0'));var util=require(_0xfedf('0x1'));var logger=require('../../config/logger')(_0xfedf('0x2'));var moment=require(_0xfedf('0x3'));var BPromise=require(_0xfedf('0x4'));var rp=require(_0xfedf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfedf('0x6'));var config=require(_0xfedf('0x7'));var attributes=require(_0xfedf('0x8'));module[_0xfedf('0x9')]=function(_0x8b9fdc,_0x582cdf){return _0x8b9fdc[_0xfedf('0xa')](_0xfedf('0xb'),attributes,{'tableName':_0xfedf('0xc'),'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 2fcf7a6..841224b 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 _0x6f6b=['create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0xb7127b,_0x5ce879){var _0x3c8758=function(_0x3b3ed4){while(--_0x3b3ed4){_0xb7127b['push'](_0xb7127b['shift']());}};_0x3c8758(++_0x5ce879);}(_0x6f6b,0x131));var _0xb6f6=function(_0x776414,_0x10d2de){_0x776414=_0x776414-0x0;var _0x7ec5f6=_0x6f6b[_0x776414];return _0x7ec5f6;};'use strict';var _=require(_0xb6f6('0x0'));var util=require(_0xb6f6('0x1'));var moment=require(_0xb6f6('0x2'));var BPromise=require(_0xb6f6('0x3'));var rs=require(_0xb6f6('0x4'));var fs=require('fs');var Redis=require(_0xb6f6('0x5'));var db=require(_0xb6f6('0x6'))['db'];var utils=require(_0xb6f6('0x7'));var logger=require(_0xb6f6('0x8'))(_0xb6f6('0x9'));var config=require(_0xb6f6('0xa'));var jayson=require(_0xb6f6('0xb'));var client=jayson[_0xb6f6('0xc')][_0xb6f6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x355b34,_0x298933,_0x464ab7){return new BPromise(function(_0x24e554,_0x113ada){return client[_0xb6f6('0xe')](_0x355b34,_0x464ab7)[_0xb6f6('0xf')](function(_0x501a62){logger[_0xb6f6('0x10')](_0xb6f6('0x11'),_0x298933,'request\x20sent');logger['debug'](_0xb6f6('0x12'),_0x298933,_0xb6f6('0x13'),JSON['stringify'](_0x501a62));if(_0x501a62[_0xb6f6('0x14')]){if(_0x501a62['error'][_0xb6f6('0x15')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x298933,_0x501a62[_0xb6f6('0x14')][_0xb6f6('0x16')]);return _0x113ada(_0x501a62['error']['message']);}logger[_0xb6f6('0x14')](_0xb6f6('0x11'),_0x298933,_0x501a62[_0xb6f6('0x14')][_0xb6f6('0x16')]);return _0x24e554(_0x501a62['error'][_0xb6f6('0x16')]);}else{logger[_0xb6f6('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x298933,'request\x20sent');_0x24e554(_0x501a62['result'][_0xb6f6('0x16')]);}})['catch'](function(_0x49319a){logger[_0xb6f6('0x14')](_0xb6f6('0x11'),_0x298933,_0x49319a);_0x113ada(_0x49319a);});});}exports[_0xb6f6('0x17')]=function(_0x2ffc88){var _0x19e120=this;return new Promise(function(_0x182ca9,_0xc941d0){return db[_0xb6f6('0x18')][_0xb6f6('0x19')](_0x2ffc88[_0xb6f6('0x1a')],{'raw':_0x2ffc88[_0xb6f6('0x1b')]?_0x2ffc88['options'][_0xb6f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1015a4){logger['info'](_0xb6f6('0x17'),_0x2ffc88);logger['debug'](_0xb6f6('0x17'),_0x2ffc88,JSON[_0xb6f6('0x1d')](_0x1015a4));_0x182ca9(_0x1015a4);})['catch'](function(_0x1329cb){logger[_0xb6f6('0x14')](_0xb6f6('0x17'),_0x1329cb[_0xb6f6('0x16')],_0x2ffc88);_0xc941d0(_0x19e120[_0xb6f6('0x14')](0x1f4,_0x1329cb[_0xb6f6('0x16')]));});});}; \ No newline at end of file +var _0xe9f0=['raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options'];(function(_0x11ec53,_0x5ad924){var _0xb0d3c7=function(_0x3d16a0){while(--_0x3d16a0){_0x11ec53['push'](_0x11ec53['shift']());}};_0xb0d3c7(++_0x5ad924);}(_0xe9f0,0x1ef));var _0x0e9f=function(_0x39efff,_0x43ac8f){_0x39efff=_0x39efff-0x0;var _0x33cee8=_0xe9f0[_0x39efff];return _0x33cee8;};'use strict';var _=require(_0x0e9f('0x0'));var util=require(_0x0e9f('0x1'));var moment=require(_0x0e9f('0x2'));var BPromise=require(_0x0e9f('0x3'));var rs=require(_0x0e9f('0x4'));var fs=require('fs');var Redis=require(_0x0e9f('0x5'));var db=require(_0x0e9f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e9f('0x7'))(_0x0e9f('0x8'));var config=require(_0x0e9f('0x9'));var jayson=require(_0x0e9f('0xa'));var client=jayson['client'][_0x0e9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5805,_0x4a1a33,_0x1d31d0){return new BPromise(function(_0x1671ec,_0xdcf14){return client[_0x0e9f('0xc')](_0x5805,_0x1d31d0)[_0x0e9f('0xd')](function(_0x1d5200){logger['info'](_0x0e9f('0xe'),_0x4a1a33,_0x0e9f('0xf'));logger[_0x0e9f('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4a1a33,_0x0e9f('0xf'),JSON['stringify'](_0x1d5200));if(_0x1d5200['error']){if(_0x1d5200['error'][_0x0e9f('0x11')]===0x1f4){logger[_0x0e9f('0x12')](_0x0e9f('0xe'),_0x4a1a33,_0x1d5200[_0x0e9f('0x12')]['message']);return _0xdcf14(_0x1d5200[_0x0e9f('0x12')][_0x0e9f('0x13')]);}logger[_0x0e9f('0x12')](_0x0e9f('0xe'),_0x4a1a33,_0x1d5200['error']['message']);return _0x1671ec(_0x1d5200[_0x0e9f('0x12')][_0x0e9f('0x13')]);}else{logger[_0x0e9f('0x14')](_0x0e9f('0xe'),_0x4a1a33,_0x0e9f('0xf'));_0x1671ec(_0x1d5200[_0x0e9f('0x15')][_0x0e9f('0x13')]);}})[_0x0e9f('0x16')](function(_0x1ce7a5){logger[_0x0e9f('0x12')](_0x0e9f('0xe'),_0x4a1a33,_0x1ce7a5);_0xdcf14(_0x1ce7a5);});});}exports[_0x0e9f('0x17')]=function(_0x2f79b2){var _0x854876=this;return new Promise(function(_0x214f68,_0x36ed7f){return db[_0x0e9f('0x18')]['create'](_0x2f79b2[_0x0e9f('0x19')],{'raw':_0x2f79b2[_0x0e9f('0x1a')]?_0x2f79b2[_0x0e9f('0x1a')][_0x0e9f('0x1b')]===undefined?!![]:![]:!![]})[_0x0e9f('0xd')](function(_0x263964){logger['info']('CreateVoiceTransferReport',_0x2f79b2);logger[_0x0e9f('0x10')]('CreateVoiceTransferReport',_0x2f79b2,JSON[_0x0e9f('0x1c')](_0x263964));_0x214f68(_0x263964);})[_0x0e9f('0x16')](function(_0x2ad944){logger[_0x0e9f('0x12')](_0x0e9f('0x17'),_0x2ad944[_0x0e9f('0x13')],_0x2f79b2);_0x36ed7f(_0x854876['error'](0x1f4,_0x2ad944[_0x0e9f('0x13')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index bb025be..b6c5a9d 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eed=['sync','then','info','start','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','error','exit','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize'];(function(_0x5ea00d,_0x4db102){var _0x1393d6=function(_0x3442f5){while(--_0x3442f5){_0x5ea00d['push'](_0x5ea00d['shift']());}};_0x1393d6(++_0x4db102);}(_0x3eed,0x18c));var _0xd3ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3eed[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3ee('0x0'));var mysqldb=require(_0xd3ee('0x1'));var rpc=require(_0xd3ee('0x2'));var config=require('./config/environment');var logger=require(_0xd3ee('0x3'))(_0xd3ee('0x4'));var pm2=require(_0xd3ee('0x5'));var pm2Config=require(_0xd3ee('0x6'));var schedule=require(_0xd3ee('0x7'));var chat=require(_0xd3ee('0x8'));function main(){return mysqldb['db'][_0xd3ee('0x9')][_0xd3ee('0xa')]()['then'](function(){return rpc['listen']();})[_0xd3ee('0xb')](function(_0x1df389){logger[_0xd3ee('0xc')](_0x1df389);return chat['start']();})[_0xd3ee('0xb')](function(){return schedule['start']();})[_0xd3ee('0xb')](function(_0x4fb081){logger[_0xd3ee('0xc')](_0x4fb081);return pm2[_0xd3ee('0xd')](pm2Config);})[_0xd3ee('0xb')](function(_0x1dff70){logger[_0xd3ee('0xc')](_0xd3ee('0xe'),_[_0xd3ee('0xf')](_[_0xd3ee('0x10')](_0x1dff70,{'status':'online'}),_0xd3ee('0x11'))[_0xd3ee('0x12')]());logger[_0xd3ee('0xc')](_0xd3ee('0x13'),_['map'](_[_0xd3ee('0x10')](_0x1dff70,function(_0x3c5088){return _0x3c5088[_0xd3ee('0x14')]!==_0xd3ee('0x15');}),_0xd3ee('0x11'))['join']()||_0xd3ee('0x16'));config[_0xd3ee('0x17')]&&require(_0xd3ee('0x18'))[_0xd3ee('0x19')]();require(_0xd3ee('0x1a'))[_0xd3ee('0x19')]();})['catch'](function(_0xb4b4fa){logger[_0xd3ee('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xb4b4fa);process[_0xd3ee('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x229d=['./config/pm2/config','./config/schedule/chat','sequelize','sync','then','info','start','online','join','Offline\x20apps:','map','status','name','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/environment','./config/logger','./config/pm2'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x229d,0x100));var _0xd229=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x229d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0xd229('0x0'));var config=require(_0xd229('0x1'));var logger=require(_0xd229('0x2'))('app');var pm2=require(_0xd229('0x3'));var pm2Config=require(_0xd229('0x4'));var schedule=require('./config/schedule');var chat=require(_0xd229('0x5'));function main(){return mysqldb['db'][_0xd229('0x6')][_0xd229('0x7')]()[_0xd229('0x8')](function(){return rpc['listen']();})['then'](function(_0x2ccb3c){logger[_0xd229('0x9')](_0x2ccb3c);return chat[_0xd229('0xa')]();})[_0xd229('0x8')](function(){return schedule[_0xd229('0xa')]();})[_0xd229('0x8')](function(_0x291649){logger['info'](_0x291649);return pm2[_0xd229('0xa')](pm2Config);})[_0xd229('0x8')](function(_0x153685){logger['info']('Online\x20apps:',_['map'](_['filter'](_0x153685,{'status':_0xd229('0xb')}),'name')[_0xd229('0xc')]());logger[_0xd229('0x9')](_0xd229('0xd'),_[_0xd229('0xe')](_['filter'](_0x153685,function(_0x223776){return _0x223776[_0xd229('0xf')]!==_0xd229('0xb');}),_0xd229('0x10'))[_0xd229('0xc')]()||_0xd229('0x11'));config[_0xd229('0x12')]&&require(_0xd229('0x13'))[_0xd229('0x14')]();require(_0xd229('0x15'))[_0xd229('0x14')]();})[_0xd229('0x16')](function(_0x4ac841){logger[_0xd229('0x17')](_0xd229('0x18'),_0x4ac841);process[_0xd229('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 16baa92..d94b690 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 _0xe48f=['params','disposition','then','closed','unmanaged','json','Unmanaged.','Forbidden.','catch','use','startsWith','headers','authorization','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','canUpdate','sign','session','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','stringify','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','now','regenerateApiKey','verify','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','role','name','email','permissions','voicePause','chatPause','faxPause','pauseType','phoneBarRemoteControlPort','userProfileId','isChatInteractionAuthorized','user','ChatInteraction','findOne'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xe48f,0x9c));var _0xfe48=function(_0xfa847c,_0x444a8c){_0xfa847c=_0xfa847c-0x0;var _0x3b22bf=_0xe48f[_0xfa847c];return _0x3b22bf;};'use strict';var db=require(_0xfe48('0x0'))['db'];var config=require(_0xfe48('0x1'));var hardwareConf=require(_0xfe48('0x2'));var _=require(_0xfe48('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xfe48('0x4'));var compose=require(_0xfe48('0x5'));var basicAuth=require(_0xfe48('0x6'));var crypto=require(_0xfe48('0x7'));var ipaddr=require(_0xfe48('0x8'));var validateJwt=expressJwt({'secret':config[_0xfe48('0x9')]['session']});var userAttributes=['id',_0xfe48('0xa'),'fullname',_0xfe48('0xb'),'internal',_0xfe48('0xc'),'userpic',_0xfe48('0xd'),_0xfe48('0xe'),_0xfe48('0xf'),'mailPause',_0xfe48('0x10'),'smsPause','openchannelPause',_0xfe48('0x11'),'showWebBar',_0xfe48('0x12'),'phoneBarRemoteControl','interface',_0xfe48('0x13')];exports[_0xfe48('0x14')]=function(){return isAuthenticated(!![])['use'](function(_0xdae932,_0x45f5ae,_0x1fa144){if(_0xdae932[_0xfe48('0x15')]){_0x1fa144();}else{return db[_0xfe48('0x16')][_0xfe48('0x17')]({'where':{'id':_0xdae932[_0xfe48('0x18')]['id']},'attributes':['id','closed',_0xfe48('0x19')],'raw':!![]})[_0xfe48('0x1a')](function(_0x419e09){if(_0x419e09&&_0x419e09[_0xfe48('0x1b')]){return _0x45f5ae['status'](_0x419e09[_0xfe48('0x19')]===_0xfe48('0x1c')?0x195:0x193)[_0xfe48('0x1d')]({'message':_0x419e09[_0xfe48('0x19')]===_0xfe48('0x1c')?_0xfe48('0x1e'):_0xfe48('0x1f')});}else{_0x1fa144();}})[_0xfe48('0x20')](function(_0x32809d){_0x1fa144(_0x32809d);});}});};function isAuthenticated(_0x45a76e){return compose()[_0xfe48('0x21')](function(_0x1c0a10,_0x105a32,_0x41717d){if(_0x1c0a10['headers']['authorization']){if(_[_0xfe48('0x22')](_0x1c0a10[_0xfe48('0x23')][_0xfe48('0x24')],_0xfe48('0x25'))){var _0x74b23a=basicAuth(_0x1c0a10);db[_0xfe48('0x26')][_0xfe48('0x27')]({'where':{'name':_0x74b23a[_0xfe48('0xb')]}})['then'](function(_0x370306){if(!_0x370306||!_0x370306[_0xfe48('0x28')](_0x74b23a[_0xfe48('0x29')])){return _0x105a32[_0xfe48('0x2a')](0x191)['json']({'message':_0xfe48('0x2b')});}_0x1c0a10[_0xfe48('0x15')]={'id':_0x370306['id']};_0x41717d();})[_0xfe48('0x20')](function(_0x29ab69){_0x41717d(_0x29ab69);});}else if(_['startsWith'](_0x1c0a10[_0xfe48('0x23')][_0xfe48('0x24')],_0xfe48('0x2c'))){validateJwt(_0x1c0a10,_0x105a32,_0x41717d);}else{if(_0x45a76e){_0x41717d();}else{return _0x105a32['status'](0x193)[_0xfe48('0x1d')]({'message':_0xfe48('0x2d')});}}}else if(_0x1c0a10[_0xfe48('0x2e')][_0xfe48('0x2f')]){try{var _0x1d2430=jwt['verify'](_0x1c0a10[_0xfe48('0x2e')][_0xfe48('0x2f')],config[_0xfe48('0x9')]['session'],{'audience':hardwareConf[_0xfe48('0x30')](),'issuer':hardwareConf[_0xfe48('0x30')]()});db['User']['find']({'where':{'id':_0x1d2430['sub']}})['then'](function(_0x4bcd09){if(!_0x4bcd09||!_[_0xfe48('0x31')](_0x4bcd09[_0xfe48('0x32')],_0x1d2430[_0xfe48('0x33')])){return _0x105a32[_0xfe48('0x2a')](0x193)[_0xfe48('0x1d')]({'message':_0xfe48('0x34')});}_0x1c0a10[_0xfe48('0x15')]={'id':_0x4bcd09['id']};_0x41717d();})[_0xfe48('0x20')](function(_0x291cdf){_0x41717d(_0x291cdf);});}catch(_0x23656e){console['log'](_0x23656e);return _0x105a32[_0xfe48('0x2a')](0x193)[_0xfe48('0x1d')]({'message':_0xfe48('0x35')});}}else if(_0x45a76e){_0x41717d();}else{return _0x105a32[_0xfe48('0x2a')](0x193)[_0xfe48('0x1d')]({'message':_0xfe48('0x2d')});}})[_0xfe48('0x21')](function(_0x5cd4fe,_0x21898d,_0xeda082){if(_0x5cd4fe['user']){db[_0xfe48('0x26')][_0xfe48('0x27')]({'where':{'id':_0x5cd4fe[_0xfe48('0x15')]['id']},'attributes':userAttributes})[_0xfe48('0x1a')](function(_0x1e9464){if(!_0x1e9464){return _0x21898d[_0xfe48('0x2a')](0x194)[_0xfe48('0x1d')]({'message':_0xfe48('0x36')});}_0x5cd4fe['user']=_0x1e9464;_0xeda082();})['catch'](function(_0x27645f){_0xeda082(_0x27645f);});}else if(_0x45a76e){_0xeda082();}else{return _0x21898d[_0xfe48('0x2a')](0x194)[_0xfe48('0x1d')]({'message':_0xfe48('0x37')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()[_0xfe48('0x21')](function(_0x51f911,_0x13f0ba,_0x2e139a){return require(_0xfe48('0x38'))[_0xfe48('0x39')]()['then'](function(_0x434057){if(_0x434057[_0xfe48('0x3a')]){_0x2e139a();}else{return _0x13f0ba[_0xfe48('0x2a')](0x193)['json']({'message':'Forbidden'});}})[_0xfe48('0x20')](function(_0x285009){_0x2e139a(_0x285009);});});}exports[_0xfe48('0x3b')]=canUpdate;function signToken(_0x3a593b,_0x203952){return jwt[_0xfe48('0x3c')]({'id':_0x3a593b,'role':_0x203952},config[_0xfe48('0x9')][_0xfe48('0x3d')],{'expiresIn':0x15180});}exports[_0xfe48('0x3e')]=signToken;exports[_0xfe48('0x3f')]=function(_0x3d4cdf){if(!_0x3d4cdf){throw new Error(_0xfe48('0x40'));}return compose()[_0xfe48('0x21')](isAuthenticated())[_0xfe48('0x21')](function meetsRequirements(_0x4a4b41,_0x50aef6,_0xbc6c02){if(config[_0xfe48('0x41')][_0xfe48('0x42')](_0x4a4b41[_0xfe48('0x15')][_0xfe48('0xa')])>=config[_0xfe48('0x41')]['indexOf'](_0x3d4cdf)){return _0xbc6c02();}else{return _0x50aef6['status'](0x193)[_0xfe48('0x1d')]({'message':_0xfe48('0x43')});}});};exports[_0xfe48('0x44')]=function(_0x5cc0e4,_0x21ccb5,_0xcad46c){_0x5cc0e4[_0xfe48('0x44')]=!![];return _0xcad46c();};exports[_0xfe48('0x45')]=function(_0x39f987,_0x4d6d3d){if(!_0x39f987['user']){return _0x4d6d3d['status'](0x194)[_0xfe48('0x1d')]({'message':_0xfe48('0x46')});}var _0x27f33b=signToken(_0x39f987[_0xfe48('0x15')]['id'],_0x39f987[_0xfe48('0x15')][_0xfe48('0xa')]);_0x4d6d3d[_0xfe48('0x47')](_0xfe48('0x48'),_0x27f33b);_0x4d6d3d[_0xfe48('0x47')](_0xfe48('0x49'),JSON[_0xfe48('0x4a')](_[_0xfe48('0x4b')](_0x39f987['user'],userAttributes)));_0x4d6d3d[_0xfe48('0x4c')](_0xfe48('0x4d'));};exports[_0xfe48('0x4e')]=function(_0x2685f3){if(_[_0xfe48('0x4f')](_0x2685f3[_0xfe48('0x32')])||_[_0xfe48('0x4f')](_0x2685f3[_0xfe48('0x50')]))return null;else return createJwt(_0x2685f3);};exports[_0xfe48('0x51')]=function(_0x3bcb0e){_0x3bcb0e[_0xfe48('0x32')]=crypto[_0xfe48('0x52')](0x10)[_0xfe48('0x53')](_0xfe48('0x54'));_0x3bcb0e[_0xfe48('0x50')]=Math[_0xfe48('0x55')](Date[_0xfe48('0x56')]()/0x3e8)['toString']();return createJwt(_0x3bcb0e);};exports[_0xfe48('0x57')]=function(_0x3f7cac,_0x1d82cd){if(_0x3f7cac['query'][_0xfe48('0x2f')]){jwt[_0xfe48('0x58')](_0x3f7cac[_0xfe48('0x2e')][_0xfe48('0x2f')],config[_0xfe48('0x9')][_0xfe48('0x3d')],{'nonce':_0x1d82cd[_0xfe48('0x32')],'iat':_0x1d82cd[_0xfe48('0x50')],'audience':hardwareConf[_0xfe48('0x30')](),'issuer':hardwareConf[_0xfe48('0x30')]()});return generateApiKey(_0x1d82cd);}else{throw{'message':_0xfe48('0x59')};}};function createJwt(_0x4cb493){return jwt[_0xfe48('0x3c')]({'iat':_0x4cb493[_0xfe48('0x50')],'nonce':_0x4cb493['apiKeyNonce']},config[_0xfe48('0x9')][_0xfe48('0x3d')],{'algorithm':'HS512','subject':_0x4cb493['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xfe48('0x30')]()});} \ No newline at end of file +var _0x70f6=['role','fullname','name','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','then','status','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','User','find','authenticate','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','sub','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','stringify','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','randomBytes','toString','floor','now','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session'];(function(_0x37007b,_0x346042){var _0x2dd195=function(_0x3c9982){while(--_0x3c9982){_0x37007b['push'](_0x37007b['shift']());}};_0x2dd195(++_0x346042);}(_0x70f6,0xa3));var _0x670f=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x70f6[_0x2786ea];return _0x5c38e5;};'use strict';var db=require(_0x670f('0x0'))['db'];var config=require(_0x670f('0x1'));var hardwareConf=require(_0x670f('0x2'));var _=require(_0x670f('0x3'));var jwt=require(_0x670f('0x4'));var expressJwt=require(_0x670f('0x5'));var compose=require(_0x670f('0x6'));var basicAuth=require(_0x670f('0x7'));var crypto=require(_0x670f('0x8'));var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0x670f('0x9')][_0x670f('0xa')]});var userAttributes=['id',_0x670f('0xb'),_0x670f('0xc'),_0x670f('0xd'),'internal',_0x670f('0xe'),_0x670f('0xf'),_0x670f('0x10'),_0x670f('0x11'),'chatPause',_0x670f('0x12'),_0x670f('0x13'),_0x670f('0x14'),_0x670f('0x15'),_0x670f('0x16'),_0x670f('0x17'),_0x670f('0x18'),_0x670f('0x19'),_0x670f('0x1a'),_0x670f('0x1b')];exports[_0x670f('0x1c')]=function(){return isAuthenticated(!![])[_0x670f('0x1d')](function(_0x2c9e62,_0x421d42,_0x4d64f8){if(_0x2c9e62[_0x670f('0x1e')]){_0x4d64f8();}else{return db[_0x670f('0x1f')]['findOne']({'where':{'id':_0x2c9e62[_0x670f('0x20')]['id']},'attributes':['id',_0x670f('0x21'),'disposition'],'raw':!![]})[_0x670f('0x22')](function(_0xb46aa0){if(_0xb46aa0&&_0xb46aa0[_0x670f('0x21')]){return _0x421d42[_0x670f('0x23')](_0xb46aa0[_0x670f('0x24')]===_0x670f('0x25')?0x195:0x193)[_0x670f('0x26')]({'message':_0xb46aa0[_0x670f('0x24')]==='unmanaged'?'Unmanaged.':_0x670f('0x27')});}else{_0x4d64f8();}})[_0x670f('0x28')](function(_0x53eddc){_0x4d64f8(_0x53eddc);});}});};function isAuthenticated(_0xe2b53c){return compose()[_0x670f('0x1d')](function(_0x6cf197,_0x1517bb,_0x234e48){if(_0x6cf197[_0x670f('0x29')][_0x670f('0x2a')]){if(_[_0x670f('0x2b')](_0x6cf197[_0x670f('0x29')]['authorization'],'Basic')){var _0x4c275d=basicAuth(_0x6cf197);db[_0x670f('0x2c')][_0x670f('0x2d')]({'where':{'name':_0x4c275d[_0x670f('0xd')]}})[_0x670f('0x22')](function(_0x17de56){if(!_0x17de56||!_0x17de56[_0x670f('0x2e')](_0x4c275d['pass'])){return _0x1517bb['status'](0x191)[_0x670f('0x26')]({'message':_0x670f('0x2f')});}_0x6cf197['user']={'id':_0x17de56['id']};_0x234e48();})['catch'](function(_0x424316){_0x234e48(_0x424316);});}else if(_[_0x670f('0x2b')](_0x6cf197[_0x670f('0x29')][_0x670f('0x2a')],'Bearer')){validateJwt(_0x6cf197,_0x1517bb,_0x234e48);}else{if(_0xe2b53c){_0x234e48();}else{return _0x1517bb['status'](0x193)[_0x670f('0x26')]({'message':_0x670f('0x30')});}}}else if(_0x6cf197[_0x670f('0x31')][_0x670f('0x32')]){try{var _0x2622fb=jwt[_0x670f('0x33')](_0x6cf197['query'][_0x670f('0x32')],config['secrets']['session'],{'audience':hardwareConf[_0x670f('0x34')](),'issuer':hardwareConf['getUuid']()});db[_0x670f('0x2c')]['find']({'where':{'id':_0x2622fb[_0x670f('0x35')]}})['then'](function(_0x3674f7){if(!_0x3674f7||!_[_0x670f('0x36')](_0x3674f7['apiKeyNonce'],_0x2622fb['nonce'])){return _0x1517bb['status'](0x193)[_0x670f('0x26')]({'message':_0x670f('0x37')});}_0x6cf197[_0x670f('0x1e')]={'id':_0x3674f7['id']};_0x234e48();})[_0x670f('0x28')](function(_0x5e9ad5){_0x234e48(_0x5e9ad5);});}catch(_0x529ff5){console[_0x670f('0x38')](_0x529ff5);return _0x1517bb[_0x670f('0x23')](0x193)[_0x670f('0x26')]({'message':_0x670f('0x39')});}}else if(_0xe2b53c){_0x234e48();}else{return _0x1517bb[_0x670f('0x23')](0x193)['json']({'message':_0x670f('0x30')});}})[_0x670f('0x1d')](function(_0x1f1003,_0x1ba208,_0x3d2e5f){if(_0x1f1003['user']){db['User'][_0x670f('0x2d')]({'where':{'id':_0x1f1003['user']['id']},'attributes':userAttributes})['then'](function(_0x540d72){if(!_0x540d72){return _0x1ba208[_0x670f('0x23')](0x194)[_0x670f('0x26')]({'message':_0x670f('0x3a')});}_0x1f1003[_0x670f('0x1e')]=_0x540d72;_0x3d2e5f();})[_0x670f('0x28')](function(_0x2bd9ca){_0x3d2e5f(_0x2bd9ca);});}else if(_0xe2b53c){_0x3d2e5f();}else{return _0x1ba208[_0x670f('0x23')](0x194)['json']({'message':_0x670f('0x3b')});}});}exports[_0x670f('0x3c')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x4029d5,_0x2aa0f6,_0x43562a){return require(_0x670f('0x3d'))[_0x670f('0x3e')]()[_0x670f('0x22')](function(_0x55e80f){if(_0x55e80f[_0x670f('0x3f')]){_0x43562a();}else{return _0x2aa0f6[_0x670f('0x23')](0x193)['json']({'message':_0x670f('0x40')});}})[_0x670f('0x28')](function(_0x583d50){_0x43562a(_0x583d50);});});}exports[_0x670f('0x41')]=canUpdate;function signToken(_0x5eecb0,_0x2513ab){return jwt[_0x670f('0x42')]({'id':_0x5eecb0,'role':_0x2513ab},config['secrets'][_0x670f('0xa')],{'expiresIn':0x15180});}exports[_0x670f('0x43')]=signToken;exports['hasRole']=function(_0xb29ca7){if(!_0xb29ca7){throw new Error(_0x670f('0x44'));}return compose()[_0x670f('0x1d')](isAuthenticated())[_0x670f('0x1d')](function meetsRequirements(_0xeed71e,_0x164f87,_0x2d313b){if(config[_0x670f('0x45')][_0x670f('0x46')](_0xeed71e[_0x670f('0x1e')][_0x670f('0xb')])>=config['userRoles'][_0x670f('0x46')](_0xb29ca7)){return _0x2d313b();}else{return _0x164f87['status'](0x193)['json']({'message':_0x670f('0x40')});}});};exports[_0x670f('0x47')]=function(_0x2ca043,_0x116e5b,_0x870afe){_0x2ca043['isMiddleware']=!![];return _0x870afe();};exports[_0x670f('0x48')]=function(_0x5e83b3,_0xf38a13){if(!_0x5e83b3[_0x670f('0x1e')]){return _0xf38a13[_0x670f('0x23')](0x194)['json']({'message':_0x670f('0x49')});}var _0x31e700=signToken(_0x5e83b3[_0x670f('0x1e')]['id'],_0x5e83b3[_0x670f('0x1e')][_0x670f('0xb')]);_0xf38a13['cookie']('motion.token',_0x31e700);_0xf38a13['cookie']('motion.user',JSON[_0x670f('0x4a')](_[_0x670f('0x4b')](_0x5e83b3[_0x670f('0x1e')],userAttributes)));_0xf38a13['redirect'](_0x670f('0x4c'));};exports[_0x670f('0x4d')]=function(_0x13aea1){if(_[_0x670f('0x4e')](_0x13aea1[_0x670f('0x4f')])||_[_0x670f('0x4e')](_0x13aea1['apiKeyIat']))return null;else return createJwt(_0x13aea1);};exports['generateApiKey']=function(_0x1e01b1){_0x1e01b1[_0x670f('0x4f')]=crypto[_0x670f('0x50')](0x10)[_0x670f('0x51')]('hex');_0x1e01b1['apiKeyIat']=Math[_0x670f('0x52')](Date[_0x670f('0x53')]()/0x3e8)[_0x670f('0x51')]();return createJwt(_0x1e01b1);};exports[_0x670f('0x54')]=function(_0x1e029a,_0x300353){if(_0x1e029a[_0x670f('0x31')]['apikey']){jwt[_0x670f('0x33')](_0x1e029a['query'][_0x670f('0x32')],config[_0x670f('0x9')]['session'],{'nonce':_0x300353[_0x670f('0x4f')],'iat':_0x300353[_0x670f('0x55')],'audience':hardwareConf[_0x670f('0x34')](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x300353);}else{throw{'message':_0x670f('0x56')};}};function createJwt(_0x488810){return jwt[_0x670f('0x42')]({'iat':_0x488810[_0x670f('0x55')],'nonce':_0x488810['apiKeyNonce']},config[_0x670f('0x9')][_0x670f('0xa')],{'algorithm':'HS512','subject':_0x488810['id'][_0x670f('0x51')](),'issuer':hardwareConf[_0x670f('0x34')](),'audience':hardwareConf[_0x670f('0x34')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 86e2ded..2a81476 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 _0xab48=['decryptFile','createDecipher','final','close','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm','data','update','binary','write','end','unlink'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xab48,0x190));var _0x8ab4=function(_0xbd3556,_0xe38bfa){_0xbd3556=_0xbd3556-0x0;var _0x4a2e2d=_0xab48[_0xbd3556];return _0x4a2e2d;};'use strict';var crypto=require(_0x8ab4('0x0'));var fs=require('fs');var BPromise=require(_0x8ab4('0x1'));var defaultOptions={'algorithm':_0x8ab4('0x2')};function combineOptions(_0x4eacc6){var _0x4e3d78={};for(var _0x575298 in defaultOptions){if(defaultOptions[_0x8ab4('0x3')](_0x575298)){_0x4e3d78[_0x575298]=defaultOptions[_0x575298];}}if(_0x4eacc6){for(var _0x36d3e9 in _0x4eacc6){if(_0x4eacc6['hasOwnProperty'](_0x36d3e9)){_0x4e3d78[_0x36d3e9]=_0x4eacc6[_0x36d3e9];}}}return _0x4e3d78;}exports[_0x8ab4('0x4')]=function(_0x454f94,_0x14b885,_0x1747e1,_0x1fd4bd){return new BPromise(function(_0x5ec5d0,_0x1da96b){_0x1fd4bd=combineOptions(_0x1fd4bd);var _0x44e946=new Buffer(_0x1747e1);var _0x218671=fs['createReadStream'](_0x454f94);var _0x14b25d=fs[_0x8ab4('0x5')](_0x14b885);var _0x458dc5=crypto[_0x8ab4('0x6')](_0x1fd4bd[_0x8ab4('0x7')],_0x44e946);_0x218671['on'](_0x8ab4('0x8'),function(_0x2429f3){var _0x8a8984=new Buffer(_0x458dc5[_0x8ab4('0x9')](_0x2429f3),_0x8ab4('0xa'));_0x14b25d[_0x8ab4('0xb')](_0x8a8984);});_0x218671['on'](_0x8ab4('0xc'),function(){try{var _0x1b8eec=new Buffer(_0x458dc5['final'](_0x8ab4('0xa')),_0x8ab4('0xa'));_0x14b25d[_0x8ab4('0xb')](_0x1b8eec);_0x14b25d[_0x8ab4('0xc')]();_0x14b25d['on']('close',function(){return _0x5ec5d0(_0x14b885);});}catch(_0x21d8f4){fs[_0x8ab4('0xd')](_0x14b885);return _0x1da96b(_0x21d8f4);}});});};exports[_0x8ab4('0xe')]=function(_0x15b343,_0x42a1b7,_0x5e71ad,_0x34198f){return new BPromise(function(_0x452b80,_0x367181){_0x34198f=combineOptions(_0x34198f);var _0x1dd665=new Buffer(_0x5e71ad);var _0x35d66e=fs['createReadStream'](_0x15b343);var _0x5f1543=fs[_0x8ab4('0x5')](_0x42a1b7);var _0x274352=crypto[_0x8ab4('0xf')](_0x34198f[_0x8ab4('0x7')],_0x1dd665);_0x35d66e['on'](_0x8ab4('0x8'),function(_0x2d0e4d){var _0xc838e8=new Buffer(_0x274352[_0x8ab4('0x9')](_0x2d0e4d),_0x8ab4('0xa'));_0x5f1543[_0x8ab4('0xb')](_0xc838e8);});_0x35d66e['on'](_0x8ab4('0xc'),function(){try{var _0x1f6c69=new Buffer(_0x274352[_0x8ab4('0x10')](_0x8ab4('0xa')),'binary');_0x5f1543[_0x8ab4('0xb')](_0x1f6c69);_0x5f1543['end']();_0x5f1543['on'](_0x8ab4('0x11'),function(){return _0x452b80(_0x42a1b7);});}catch(_0x470743){fs[_0x8ab4('0xd')](_0x42a1b7);return _0x367181(_0x470743);}});});}; \ No newline at end of file +var _0x48ea=['algorithm','data','update','binary','write','end','final','close','decryptFile','createDecipher','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream'];(function(_0x21c37d,_0x29bb29){var _0x333fac=function(_0x488d86){while(--_0x488d86){_0x21c37d['push'](_0x21c37d['shift']());}};_0x333fac(++_0x29bb29);}(_0x48ea,0x1b4));var _0xa48e=function(_0x458897,_0x4819d8){_0x458897=_0x458897-0x0;var _0x40e14e=_0x48ea[_0x458897];return _0x40e14e;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xa48e('0x0'));var defaultOptions={'algorithm':_0xa48e('0x1')};function combineOptions(_0x5a2d12){var _0x5dcc30={};for(var _0x34f121 in defaultOptions){if(defaultOptions[_0xa48e('0x2')](_0x34f121)){_0x5dcc30[_0x34f121]=defaultOptions[_0x34f121];}}if(_0x5a2d12){for(var _0x2ae83c in _0x5a2d12){if(_0x5a2d12[_0xa48e('0x2')](_0x2ae83c)){_0x5dcc30[_0x2ae83c]=_0x5a2d12[_0x2ae83c];}}}return _0x5dcc30;}exports[_0xa48e('0x3')]=function(_0x31f467,_0x10b023,_0x25f557,_0x1bf988){return new BPromise(function(_0x5991bc,_0x2d96f0){_0x1bf988=combineOptions(_0x1bf988);var _0x2d01ca=new Buffer(_0x25f557);var _0x4de002=fs[_0xa48e('0x4')](_0x31f467);var _0x2d5b2c=fs[_0xa48e('0x5')](_0x10b023);var _0x37f4e7=crypto['createCipher'](_0x1bf988[_0xa48e('0x6')],_0x2d01ca);_0x4de002['on'](_0xa48e('0x7'),function(_0x189b32){var _0x59165b=new Buffer(_0x37f4e7[_0xa48e('0x8')](_0x189b32),_0xa48e('0x9'));_0x2d5b2c[_0xa48e('0xa')](_0x59165b);});_0x4de002['on'](_0xa48e('0xb'),function(){try{var _0x48deb4=new Buffer(_0x37f4e7[_0xa48e('0xc')](_0xa48e('0x9')),_0xa48e('0x9'));_0x2d5b2c[_0xa48e('0xa')](_0x48deb4);_0x2d5b2c[_0xa48e('0xb')]();_0x2d5b2c['on'](_0xa48e('0xd'),function(){return _0x5991bc(_0x10b023);});}catch(_0x43d2a4){fs['unlink'](_0x10b023);return _0x2d96f0(_0x43d2a4);}});});};exports[_0xa48e('0xe')]=function(_0x43f84,_0x361b5e,_0x1fb3a4,_0x5d6ddb){return new BPromise(function(_0x239b3f,_0x5669ac){_0x5d6ddb=combineOptions(_0x5d6ddb);var _0x840c62=new Buffer(_0x1fb3a4);var _0x401916=fs['createReadStream'](_0x43f84);var _0x3c480a=fs[_0xa48e('0x5')](_0x361b5e);var _0x209bed=crypto[_0xa48e('0xf')](_0x5d6ddb[_0xa48e('0x6')],_0x840c62);_0x401916['on'](_0xa48e('0x7'),function(_0x4d513f){var _0xec4ad7=new Buffer(_0x209bed[_0xa48e('0x8')](_0x4d513f),'binary');_0x3c480a['write'](_0xec4ad7);});_0x401916['on'](_0xa48e('0xb'),function(){try{var _0x2bf3ac=new Buffer(_0x209bed[_0xa48e('0xc')]('binary'),_0xa48e('0x9'));_0x3c480a[_0xa48e('0xa')](_0x2bf3ac);_0x3c480a[_0xa48e('0xb')]();_0x3c480a['on']('close',function(){return _0x239b3f(_0x361b5e);});}catch(_0x362a8b){fs[_0xa48e('0x10')](_0x361b5e);return _0x5669ac(_0x362a8b);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6ea0080..04ad2e8 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 _0x4d92=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','.csv','mkdirSync','join','%s%d.%s','csv','%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','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','length','split'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x4d92,0x100));var _0x24d9=function(_0x54daf5,_0x528643){_0x54daf5=_0x54daf5-0x0;var _0xf70158=_0x4d92[_0x54daf5];return _0xf70158;};'use strict';var util=require(_0x24d9('0x0'));var path=require(_0x24d9('0x1'));var _=require('lodash');var csv=require(_0x24d9('0x2'));var fs=require('fs');var BPromise=require(_0x24d9('0x3'));var zipdir=require(_0x24d9('0x4'));var rimraf=require(_0x24d9('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x24d9('0x6'))['dbH'];var logger=require(_0x24d9('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x24d9('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xb08d1d,_0x5c9a6d){var _0x4c17e6={'status':_0xb08d1d};var _0x60e73c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c9a6d){_0x4c17e6[_0x24d9('0x9')]=_0x5c9a6d;}return db[_0x24d9('0xa')]['update'](_0x4c17e6,_0x60e73c);}function main(){var _0xa29658=0x1388;var _0x3f2b86;logger[_0x24d9('0xb')](util[_0x24d9('0xc')](_0x24d9('0xd'),EXTRACTED_REPORT_ID,_0x24d9('0xe')));return db[_0x24d9('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x24d9('0x10')](function(_0x1a886e){if(_0x1a886e){_0x3f2b86=_0x1a886e;_0xa29658=_0x3f2b86[_0x24d9('0x11')]||0x1388;}})[_0x24d9('0x10')](function(){return dbH[_0x24d9('0x12')][_0x24d9('0x13')](util[_0x24d9('0xc')](_0x24d9('0x14'),QUERY),{'type':dbH[_0x24d9('0x12')]['QueryTypes']['SELECT']});})[_0x24d9('0x10')](function(_0x452254){if(!_0x452254[0x0][_0x24d9('0x15')]){return analyticExtractedReport('Empty');}var _0x4f4dc1=[];var _0x50cf6b=0x0;var _0x15501e=!![];if(_0x452254&&_0x452254[_0x24d9('0x16')]){var _0x26912c=_0x452254[0x0][_0x24d9('0x15')]%(_0x50cf6b+_0xa29658);if(_0x3f2b86[_0x24d9('0x17')]){for(;_0x15501e;_0x50cf6b+=_0xa29658,_0x26912c=_0x452254[0x0][_0x24d9('0x15')]%(_0x50cf6b+_0xa29658)){if(_0x26912c==0x0||_0x26912c==_0x452254[0x0][_0x24d9('0x15')]){_0x15501e=![];}_0x4f4dc1[_0x24d9('0x18')](dbH[_0x24d9('0x12')][_0x24d9('0x13')](util[_0x24d9('0xc')](_0x24d9('0x19'),QUERY,_0xa29658,_0x50cf6b),{'type':dbH[_0x24d9('0x12')]['QueryTypes'][_0x24d9('0x1a')]}));}}else{_0x4f4dc1[_0x24d9('0x18')](dbH[_0x24d9('0x12')][_0x24d9('0x13')](QUERY,{'type':dbH[_0x24d9('0x12')][_0x24d9('0x1b')][_0x24d9('0x1a')]}));}}var _0x4a12b3=path['dirname'](PATH);var _0x3f8641=path[_0x24d9('0x1c')](PATH,_0x24d9('0x1d'));var _0x2b2283=_0x3f2b86[_0x24d9('0x17')]&&_0x4f4dc1['length']>0x1;var _0x51f8de=[];if(!fs['existsSync'](path['join'](_0x4a12b3,_0x3f8641))&&_0x2b2283){fs[_0x24d9('0x1e')](path[_0x24d9('0x1f')](_0x4a12b3,_0x3f8641));}return BPromise['each'](_0x4f4dc1,function(_0x3b5f70){_0x51f8de[_0x24d9('0x18')](_0x3b5f70);})[_0x24d9('0x10')](function(){for(var _0x41b413=0x0;_0x41b413<_0x51f8de['length'];_0x41b413+=0x1){var _0x33214b;var _0xd17dee=_0x51f8de[_0x41b413];if(_0x2b2283){_0x33214b=path[_0x24d9('0x1f')](_0x4a12b3,_0x3f8641,util['format'](_0x24d9('0x20'),_0x3f8641,_0x41b413,_0x24d9('0x21')));}else{_0x33214b=path['join'](_0x4a12b3,util[_0x24d9('0xc')](_0x24d9('0x22'),_0x3f8641,_0x24d9('0x21')));}fs['writeFileSync'](_0x33214b,csv(_0xd17dee));}})[_0x24d9('0x10')](function(){if(_0x2b2283){zipdir(path[_0x24d9('0x1f')](_0x4a12b3,_0x3f8641),{'saveTo':path[_0x24d9('0x1f')](_0x4a12b3,util[_0x24d9('0xc')](_0x24d9('0x22'),_0x3f8641,_0x24d9('0x23')))},function(_0x43dd83,_0x225823){});rimraf(path[_0x24d9('0x1f')](_0x4a12b3,_0x3f8641),function(){});}})[_0x24d9('0x10')](function(){logger[_0x24d9('0xb')](util['format'](_0x24d9('0x24'),EXTRACTED_REPORT_ID,_0x24d9('0xe')));return analyticExtractedReport(_0x24d9('0x25'),_0x2b2283?util['format'](_0x24d9('0x22'),_0x3f8641,_0x2b2283?_0x24d9('0x23'):_0x24d9('0x21')):null);});})[_0x24d9('0x26')](function(_0x2a8646){logger['info'](util[_0x24d9('0xc')](_0x24d9('0x27'),EXTRACTED_REPORT_ID,_0x24d9('0xe')),util['inspect'](_0x2a8646,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x251a=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','.csv','existsSync','join','mkdirSync','each','length','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','lodash','to-csv'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0x251a,0x1c0));var _0xa251=function(_0x53c8c7,_0x348f83){_0x53c8c7=_0x53c8c7-0x0;var _0x4f9626=_0x251a[_0x53c8c7];return _0x4f9626;};'use strict';var util=require(_0xa251('0x0'));var path=require('path');var _=require(_0xa251('0x1'));var csv=require(_0xa251('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xa251('0x3'));var rimraf=require(_0xa251('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa251('0x5'))[_0xa251('0x6')];var logger=require(_0xa251('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa251('0x8')][0x2]);var QUERY=process[_0xa251('0x8')][0x3];var PATH=process[_0xa251('0x8')][0x4];function analyticExtractedReport(_0x52e2de,_0x2ad435){var _0x420df={'status':_0x52e2de};var _0x4c62e5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ad435){_0x420df[_0xa251('0x9')]=_0x2ad435;}return db[_0xa251('0xa')]['update'](_0x420df,_0x4c62e5);}function main(){var _0x65f980=0x1388;var _0xef4ea5;logger[_0xa251('0xb')](util[_0xa251('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa251('0xd')));return db[_0xa251('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa251('0xf'),_0xa251('0x10')]})[_0xa251('0x11')](function(_0x4c9ecf){if(_0x4c9ecf){_0xef4ea5=_0x4c9ecf;_0x65f980=_0xef4ea5[_0xa251('0x10')]||0x1388;}})['then'](function(){return dbH[_0xa251('0x12')]['query'](util['format'](_0xa251('0x13'),QUERY),{'type':dbH[_0xa251('0x12')][_0xa251('0x14')][_0xa251('0x15')]});})['then'](function(_0x16737d){if(!_0x16737d[0x0][_0xa251('0x16')]){return analyticExtractedReport(_0xa251('0x17'));}var _0x1408be=[];var _0x326bc1=0x0;var _0x491436=!![];if(_0x16737d&&_0x16737d['length']){var _0x1323aa=_0x16737d[0x0][_0xa251('0x16')]%(_0x326bc1+_0x65f980);if(_0xef4ea5[_0xa251('0xf')]){for(;_0x491436;_0x326bc1+=_0x65f980,_0x1323aa=_0x16737d[0x0][_0xa251('0x16')]%(_0x326bc1+_0x65f980)){if(_0x1323aa==0x0||_0x1323aa==_0x16737d[0x0]['num']){_0x491436=![];}_0x1408be[_0xa251('0x18')](dbH['sequelize']['query'](util[_0xa251('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x65f980,_0x326bc1),{'type':dbH[_0xa251('0x12')][_0xa251('0x14')][_0xa251('0x15')]}));}}else{_0x1408be[_0xa251('0x18')](dbH[_0xa251('0x12')][_0xa251('0x19')](QUERY,{'type':dbH[_0xa251('0x12')][_0xa251('0x14')]['SELECT']}));}}var _0x10ad2d=path['dirname'](PATH);var _0x282c34=path['basename'](PATH,_0xa251('0x1a'));var _0x3d9f82=_0xef4ea5[_0xa251('0xf')]&&_0x1408be['length']>0x1;var _0x35af8e=[];if(!fs[_0xa251('0x1b')](path[_0xa251('0x1c')](_0x10ad2d,_0x282c34))&&_0x3d9f82){fs[_0xa251('0x1d')](path[_0xa251('0x1c')](_0x10ad2d,_0x282c34));}return BPromise[_0xa251('0x1e')](_0x1408be,function(_0xc29f5b){_0x35af8e['push'](_0xc29f5b);})[_0xa251('0x11')](function(){for(var _0x2f66ea=0x0;_0x2f66ea<_0x35af8e[_0xa251('0x1f')];_0x2f66ea+=0x1){var _0x39a6f9;var _0x1f080b=_0x35af8e[_0x2f66ea];if(_0x3d9f82){_0x39a6f9=path[_0xa251('0x1c')](_0x10ad2d,_0x282c34,util['format']('%s%d.%s',_0x282c34,_0x2f66ea,'csv'));}else{_0x39a6f9=path['join'](_0x10ad2d,util['format'](_0xa251('0x20'),_0x282c34,'csv'));}fs[_0xa251('0x21')](_0x39a6f9,csv(_0x1f080b));}})[_0xa251('0x11')](function(){if(_0x3d9f82){zipdir(path[_0xa251('0x1c')](_0x10ad2d,_0x282c34),{'saveTo':path[_0xa251('0x1c')](_0x10ad2d,util['format'](_0xa251('0x20'),_0x282c34,_0xa251('0x22')))},function(_0xade890,_0x3cff96){});rimraf(path[_0xa251('0x1c')](_0x10ad2d,_0x282c34),function(){});}})['then'](function(){logger[_0xa251('0xb')](util['format'](_0xa251('0x23'),EXTRACTED_REPORT_ID,_0xa251('0xd')));return analyticExtractedReport(_0xa251('0x24'),_0x3d9f82?util[_0xa251('0xc')]('%s.%s',_0x282c34,_0x3d9f82?'zip':_0xa251('0x25')):null);});})[_0xa251('0x26')](function(_0x20ceec){logger[_0xa251('0xb')](util[_0xa251('0xc')](_0xa251('0x27'),EXTRACTED_REPORT_ID,_0xa251('0xd')),util[_0xa251('0x28')](_0x20ceec,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6cb59ab..323f6ac 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 _0xa90b=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','each','startDate','endDate','landscape','header','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','pdf','pipe','finish','error','err','end','%s.%s','zip','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','Setting','find','split','splitSizePdf','then','length','sequelize','query'];(function(_0xf04d6c,_0x229b53){var _0x51fe69=function(_0x12fd1f){while(--_0x12fd1f){_0xf04d6c['push'](_0xf04d6c['shift']());}};_0x51fe69(++_0x229b53);}(_0xa90b,0x16a));var _0xba90=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0xa90b[_0x3fe6df];return _0x372a0e;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0xba90('0x0'));var util=require(_0xba90('0x1'));var path=require('path');var moment=require(_0xba90('0x2'));var PdfPrinter=require(_0xba90('0x3'));var zipdir=require(_0xba90('0x4'));var rimraf=require(_0xba90('0x5'));var db=require(_0xba90('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xba90('0x7'))(_0xba90('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xba90('0x9')][0x2]);var QUERY=process[_0xba90('0x9')][0x3];var PATH=process[_0xba90('0x9')][0x4];var NAME=process[_0xba90('0x9')][0x5];var FORMAT=_0xba90('0xa');var _extractedReport;function analyticExtractedReport(_0x1a23f1,_0x4ca570){var _0x213739={'status':_0x1a23f1};var _0x99e339={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4ca570){_0x213739[_0xba90('0xb')]=_0x4ca570;}return db[_0xba90('0xc')][_0xba90('0xd')](_0x213739,_0x99e339);}function getHeader(_0x358c3c){var _0x118b6b=[];for(var _0x357bcb in _0x358c3c){if(_0x358c3c[_0xba90('0xe')](_0x357bcb)){_0x118b6b[_0xba90('0xf')]({'text':_0x357bcb,'style':_0xba90('0x10')});}}return _0x118b6b;}function extractReport(_0x2c5496){var _0x5d2011=0x1388;var _0x58e095;if(!_0x2c5496[0x0][_0xba90('0x11')]){return analyticExtractedReport(_0xba90('0x12'));}var _0x4a35ca=[];var _0x41c039=0x0;var _0x2f6217=!![];var _0x2e51cb=path[_0xba90('0x13')](PATH);var _0x1228b9=path['basename'](PATH,'.pdf');var _0x51e3b8=![];var _0x4d157a=[];return db[_0xba90('0x14')][_0xba90('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xba90('0x16'),_0xba90('0x17')]})[_0xba90('0x18')](function(_0x55c79e){if(_0x55c79e){_0x58e095=_0x55c79e;_0x5d2011=_0x58e095[_0xba90('0x17')]||0x3e8;}})['then'](function(){if(_0x2c5496&&_0x2c5496[_0xba90('0x19')]){var _0x412dcc=_0x2c5496[0x0][_0xba90('0x11')]%(_0x41c039+_0x5d2011);if(_0x58e095['split']){for(;_0x2f6217;_0x41c039+=_0x5d2011,_0x412dcc=_0x2c5496[0x0][_0xba90('0x11')]%(_0x41c039+_0x5d2011)){if(_0x412dcc==0x0||_0x412dcc==_0x2c5496[0x0][_0xba90('0x11')]){_0x2f6217=![];}_0x4a35ca[_0xba90('0xf')](dbH[_0xba90('0x1a')][_0xba90('0x1b')](util[_0xba90('0x1c')](_0xba90('0x1d'),QUERY,_0x5d2011,_0x41c039),{'type':dbH[_0xba90('0x1a')][_0xba90('0x1e')][_0xba90('0x1f')]}));}}else{_0x4a35ca[_0xba90('0xf')](dbH['sequelize'][_0xba90('0x1b')](QUERY,{'type':dbH[_0xba90('0x1a')]['QueryTypes'][_0xba90('0x1f')]}));}}_0x51e3b8=_0x58e095['split']&&_0x4a35ca[_0xba90('0x19')]>0x1;if(!fs[_0xba90('0x20')](path[_0xba90('0x21')](_0x2e51cb,_0x1228b9))&&_0x51e3b8){fs['mkdirSync'](path[_0xba90('0x21')](_0x2e51cb,_0x1228b9));}return BPromise['each'](_0x4a35ca,function(_0x14d44c){_0x4d157a[_0xba90('0xf')](_0x14d44c);});})['then'](function(){return BPromise[_0xba90('0x22')](_0x4a35ca,function(_0x2d7cc8,_0x477e00){var _0x36dfde;var _0x309140=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport['name'],moment(_extractedReport[_0xba90('0x23')])[_0xba90('0x1c')](FORMAT),moment(_extractedReport[_0xba90('0x24')])[_0xba90('0x1c')](FORMAT));var _0x245f3e={'pageSize':'A4','pageOrientation':_0xba90('0x25'),'content':[{'text':_0x309140,'style':_0xba90('0x26')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x340f55={'headerRows':0x1,'body':[]};_0x340f55[_0xba90('0x27')]['push'](getHeader(_0x2d7cc8[0x0]));var _0x4c03a5;for(var _0x8b9482=0x0;_0x8b9482<_0x2d7cc8[_0xba90('0x19')];_0x8b9482+=0x1){_0x4c03a5=[];for(var _0x359ebc in _0x2d7cc8[_0x8b9482]){if(_0x2d7cc8[_0x8b9482][_0xba90('0xe')](_0x359ebc)){_0x4c03a5[_0xba90('0xf')](_0x2d7cc8[_0x8b9482][_0x359ebc]?_[_0xba90('0x28')](_0x2d7cc8[_0x8b9482][_0x359ebc]):'');}}_0x340f55[_0xba90('0x27')][_0xba90('0xf')](_0x4c03a5);}_0x245f3e[_0xba90('0x29')]['push']({'table':_0x340f55});return new BPromise(function(_0x121645,_0x4843fc){var _0x45dda9=new PdfPrinter({'Roboto':{'normal':__dirname+_0xba90('0x2a'),'bold':__dirname+_0xba90('0x2b'),'italics':__dirname+_0xba90('0x2c'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x2323a9=_0x45dda9[_0xba90('0x2d')](_0x245f3e);if(_0x51e3b8){_0x36dfde=path['join'](_0x2e51cb,_0x1228b9,util['format']('%s%d.%s',_0x1228b9,_0x477e00,_0xba90('0x2e')));}else{_0x36dfde=path[_0xba90('0x21')](_0x2e51cb,util[_0xba90('0x1c')]('%s.%s',_0x1228b9,_0xba90('0x2e')));}var _0x3dfa74=_0x2323a9[_0xba90('0x2f')](fs['createWriteStream'](_0x36dfde));_0x3dfa74['on'](_0xba90('0x30'),function(){_0x121645();});_0x3dfa74['on'](_0xba90('0x31'),function(_0x3e0a48){console['log'](_0xba90('0x32'),_0x3e0a48);_0x4843fc(_0x3e0a48);});_0x2323a9[_0xba90('0x33')]();});});})[_0xba90('0x18')](function(){if(_0x51e3b8){return new BPromise(function(_0x38c562,_0x549497){zipdir(path[_0xba90('0x21')](_0x2e51cb,_0x1228b9),{'saveTo':path[_0xba90('0x21')](_0x2e51cb,util['format'](_0xba90('0x34'),_0x1228b9,_0xba90('0x35')))},function(_0x36c0e3){if(_0x36c0e3){_0x549497(_0x36c0e3);}else{_0x38c562();}});});}})[_0xba90('0x18')](function(){if(_0x51e3b8){rimraf(path[_0xba90('0x21')](_0x2e51cb,_0x1228b9),function(){});}})['then'](function(){logger[_0xba90('0x36')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xba90('0x37')));return analyticExtractedReport(_0xba90('0x38'),_0x51e3b8?util['format'](_0xba90('0x34'),_0x1228b9,_0x51e3b8?_0xba90('0x35'):'pdf'):null);});}function main(){logger['info'](util[_0xba90('0x1c')](_0xba90('0x39'),EXTRACTED_REPORT_ID,_0xba90('0x3a')));return db[_0xba90('0xc')][_0xba90('0x3b')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xba90('0x18')](function(_0x3a3d40){_extractedReport=_0x3a3d40;return dbH[_0xba90('0x1a')][_0xba90('0x1b')](util[_0xba90('0x1c')](_0xba90('0x3c'),QUERY),{'type':dbH['sequelize'][_0xba90('0x1e')][_0xba90('0x1f')]});})[_0xba90('0x18')](extractReport)[_0xba90('0x3d')](function(_0x5c46db){logger[_0xba90('0x36')](util[_0xba90('0x1c')](_0xba90('0x3e'),EXTRACTED_REPORT_ID,_0xba90('0x3a')),util[_0xba90('0x3f')](_0x5c46db,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xba90('0x40'));});}main(); \ No newline at end of file +var _0xde50=['finish','error','log','end','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','PDF','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../config/logger','argv','savename','update','hasOwnProperty','push','tableHeader','num','Empty','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','length','existsSync','join','each','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','landscape','header','black','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','pipe','createWriteStream'];(function(_0x5cd51b,_0x14a90b){var _0x5b26c6=function(_0xeb259f){while(--_0xeb259f){_0x5cd51b['push'](_0x5cd51b['shift']());}};_0x5b26c6(++_0x14a90b);}(_0xde50,0x14a));var _0x0de5=function(_0xcb47f0,_0x427d4f){_0xcb47f0=_0xcb47f0-0x0;var _0x3a66a0=_0xde50[_0xcb47f0];return _0x3a66a0;};'use strict';var _=require(_0x0de5('0x0'));var fs=require('fs');var BPromise=require(_0x0de5('0x1'));var util=require('util');var path=require(_0x0de5('0x2'));var moment=require(_0x0de5('0x3'));var PdfPrinter=require(_0x0de5('0x4'));var zipdir=require(_0x0de5('0x5'));var rimraf=require(_0x0de5('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x0de5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0de5('0x8')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0de5('0x8')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var _extractedReport;function analyticExtractedReport(_0x22fcd6,_0x4284c9){var _0x4883ba={'status':_0x22fcd6};var _0x130a84={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4284c9){_0x4883ba[_0x0de5('0x9')]=_0x4284c9;}return db['AnalyticExtractedReport'][_0x0de5('0xa')](_0x4883ba,_0x130a84);}function getHeader(_0x123292){var _0x203040=[];for(var _0xb88d38 in _0x123292){if(_0x123292[_0x0de5('0xb')](_0xb88d38)){_0x203040[_0x0de5('0xc')]({'text':_0xb88d38,'style':_0x0de5('0xd')});}}return _0x203040;}function extractReport(_0x51f0e5){var _0x4b0539=0x1388;var _0xce8765;if(!_0x51f0e5[0x0][_0x0de5('0xe')]){return analyticExtractedReport(_0x0de5('0xf'));}var _0x4e0307=[];var _0x17786c=0x0;var _0x4b1776=!![];var _0x2203ba=path['dirname'](PATH);var _0x5d8f61=path['basename'](PATH,'.pdf');var _0x5af77d=![];var _0x30f51b=[];return db[_0x0de5('0x10')][_0x0de5('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0de5('0x12'),_0x0de5('0x13')]})[_0x0de5('0x14')](function(_0x4b1f1e){if(_0x4b1f1e){_0xce8765=_0x4b1f1e;_0x4b0539=_0xce8765['splitSizePdf']||0x3e8;}})[_0x0de5('0x14')](function(){if(_0x51f0e5&&_0x51f0e5['length']){var _0x5d3301=_0x51f0e5[0x0][_0x0de5('0xe')]%(_0x17786c+_0x4b0539);if(_0xce8765[_0x0de5('0x12')]){for(;_0x4b1776;_0x17786c+=_0x4b0539,_0x5d3301=_0x51f0e5[0x0]['num']%(_0x17786c+_0x4b0539)){if(_0x5d3301==0x0||_0x5d3301==_0x51f0e5[0x0][_0x0de5('0xe')]){_0x4b1776=![];}_0x4e0307[_0x0de5('0xc')](dbH[_0x0de5('0x15')][_0x0de5('0x16')](util['format'](_0x0de5('0x17'),QUERY,_0x4b0539,_0x17786c),{'type':dbH[_0x0de5('0x15')][_0x0de5('0x18')]['SELECT']}));}}else{_0x4e0307[_0x0de5('0xc')](dbH[_0x0de5('0x15')][_0x0de5('0x16')](QUERY,{'type':dbH[_0x0de5('0x15')][_0x0de5('0x18')]['SELECT']}));}}_0x5af77d=_0xce8765[_0x0de5('0x12')]&&_0x4e0307[_0x0de5('0x19')]>0x1;if(!fs[_0x0de5('0x1a')](path['join'](_0x2203ba,_0x5d8f61))&&_0x5af77d){fs['mkdirSync'](path[_0x0de5('0x1b')](_0x2203ba,_0x5d8f61));}return BPromise[_0x0de5('0x1c')](_0x4e0307,function(_0x15ea9a){_0x30f51b['push'](_0x15ea9a);});})[_0x0de5('0x14')](function(){return BPromise[_0x0de5('0x1c')](_0x4e0307,function(_0x56503a,_0x22335d){var _0x507d00;var _0x1a12c3=util[_0x0de5('0x1d')](_0x0de5('0x1e'),NAME,_extractedReport['name'],moment(_extractedReport[_0x0de5('0x1f')])[_0x0de5('0x1d')](FORMAT),moment(_extractedReport['endDate'])[_0x0de5('0x1d')](FORMAT));var _0x39c820={'pageSize':'A4','pageOrientation':_0x0de5('0x20'),'content':[{'text':_0x1a12c3,'style':_0x0de5('0x21')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0de5('0x22')}}};var _0x420aaa={'headerRows':0x1,'body':[]};_0x420aaa[_0x0de5('0x23')][_0x0de5('0xc')](getHeader(_0x56503a[0x0]));var _0x5105de;for(var _0x46cd8b=0x0;_0x46cd8b<_0x56503a[_0x0de5('0x19')];_0x46cd8b+=0x1){_0x5105de=[];for(var _0x2b8ddb in _0x56503a[_0x46cd8b]){if(_0x56503a[_0x46cd8b][_0x0de5('0xb')](_0x2b8ddb)){_0x5105de[_0x0de5('0xc')](_0x56503a[_0x46cd8b][_0x2b8ddb]?_[_0x0de5('0x24')](_0x56503a[_0x46cd8b][_0x2b8ddb]):'');}}_0x420aaa[_0x0de5('0x23')][_0x0de5('0xc')](_0x5105de);}_0x39c820[_0x0de5('0x25')][_0x0de5('0xc')]({'table':_0x420aaa});return new BPromise(function(_0x49e9bc,_0x245e86){var _0x2dfd85=new PdfPrinter({'Roboto':{'normal':__dirname+_0x0de5('0x26'),'bold':__dirname+_0x0de5('0x27'),'italics':__dirname+_0x0de5('0x28'),'bolditalics':__dirname+_0x0de5('0x29')}});var _0x4b09a4=_0x2dfd85[_0x0de5('0x2a')](_0x39c820);if(_0x5af77d){_0x507d00=path['join'](_0x2203ba,_0x5d8f61,util['format'](_0x0de5('0x2b'),_0x5d8f61,_0x22335d,_0x0de5('0x2c')));}else{_0x507d00=path[_0x0de5('0x1b')](_0x2203ba,util[_0x0de5('0x1d')](_0x0de5('0x2d'),_0x5d8f61,'pdf'));}var _0x2139c9=_0x4b09a4[_0x0de5('0x2e')](fs[_0x0de5('0x2f')](_0x507d00));_0x2139c9['on'](_0x0de5('0x30'),function(){_0x49e9bc();});_0x2139c9['on'](_0x0de5('0x31'),function(_0x212637){console[_0x0de5('0x32')]('err',_0x212637);_0x245e86(_0x212637);});_0x4b09a4[_0x0de5('0x33')]();});});})[_0x0de5('0x14')](function(){if(_0x5af77d){return new BPromise(function(_0x57ee3a,_0x145759){zipdir(path[_0x0de5('0x1b')](_0x2203ba,_0x5d8f61),{'saveTo':path['join'](_0x2203ba,util[_0x0de5('0x1d')](_0x0de5('0x2d'),_0x5d8f61,'zip'))},function(_0x430c56){if(_0x430c56){_0x145759(_0x430c56);}else{_0x57ee3a();}});});}})[_0x0de5('0x14')](function(){if(_0x5af77d){rimraf(path[_0x0de5('0x1b')](_0x2203ba,_0x5d8f61),function(){});}})[_0x0de5('0x14')](function(){logger[_0x0de5('0x34')](util[_0x0de5('0x1d')](_0x0de5('0x35'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0de5('0x36'),_0x5af77d?util[_0x0de5('0x1d')](_0x0de5('0x2d'),_0x5d8f61,_0x5af77d?_0x0de5('0x37'):'pdf'):null);});}function main(){logger[_0x0de5('0x34')](util[_0x0de5('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0de5('0x38')));return db[_0x0de5('0x39')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5245d1){_extractedReport=_0x5245d1;return dbH['sequelize'][_0x0de5('0x16')](util[_0x0de5('0x1d')](_0x0de5('0x3a'),QUERY),{'type':dbH['sequelize'][_0x0de5('0x18')]['SELECT']});})[_0x0de5('0x14')](extractReport)[_0x0de5('0x3b')](function(_0x1bd3f7){logger[_0x0de5('0x34')](util[_0x0de5('0x1d')](_0x0de5('0x3c'),EXTRACTED_REPORT_ID,_0x0de5('0x38')),util[_0x0de5('0x3d')](_0x1bd3f7,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0de5('0x3e'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2f8698b..24d76e4 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 _0x06ec=['format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','info','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','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','Setting','find','split','splitSizeXlsx','then','query'];(function(_0x89e0f5,_0x5652e6){var _0x119e69=function(_0x438a08){while(--_0x438a08){_0x89e0f5['push'](_0x89e0f5['shift']());}};_0x119e69(++_0x5652e6);}(_0x06ec,0x163));var _0xc06e=function(_0x5853fc,_0x3425ed){_0x5853fc=_0x5853fc-0x0;var _0x25d6b3=_0x06ec[_0x5853fc];return _0x25d6b3;};'use strict';var util=require(_0xc06e('0x0'));var path=require(_0xc06e('0x1'));var _=require(_0xc06e('0x2'));var fs=require('fs');var json2xls=require(_0xc06e('0x3'));var BPromise=require(_0xc06e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xc06e('0x5'));var db=require(_0xc06e('0x6'))['db'];var dbH=require(_0xc06e('0x6'))[_0xc06e('0x7')];var logger=require(_0xc06e('0x8'))(_0xc06e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc06e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc06e('0xa')][0x4];function analyticExtractedReport(_0x4208bc,_0x460be5){var _0x5621cd={'status':_0x4208bc};var _0x531a0e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x460be5){_0x5621cd[_0xc06e('0xb')]=_0x460be5;}return db[_0xc06e('0xc')][_0xc06e('0xd')](_0x5621cd,_0x531a0e);}function main(){var _0x5418e2=0x1388;var _0x9c4da0;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc06e('0xe')));return db[_0xc06e('0xf')][_0xc06e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc06e('0x11'),_0xc06e('0x12')]})[_0xc06e('0x13')](function(_0x35a389){if(_0x35a389){_0x9c4da0=_0x35a389;_0x5418e2=_0x9c4da0[_0xc06e('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0xc06e('0x14')](util[_0xc06e('0x15')](_0xc06e('0x16'),QUERY),{'type':dbH[_0xc06e('0x17')][_0xc06e('0x18')][_0xc06e('0x19')]});})['then'](function(_0x3ab6dc){if(!_0x3ab6dc[0x0][_0xc06e('0x1a')]){return analyticExtractedReport(_0xc06e('0x1b'));}var _0x513782=[];var _0x3f201f=0x0;var _0x3ec942=!![];if(_0x9c4da0['split']){if(_0x3ab6dc&&_0x3ab6dc[_0xc06e('0x1c')]){var _0xde4b6a=_0x3ab6dc[0x0][_0xc06e('0x1a')]%(_0x3f201f+_0x5418e2);for(;_0x3ec942;_0x3f201f+=_0x5418e2,_0xde4b6a=_0x3ab6dc[0x0][_0xc06e('0x1a')]%(_0x3f201f+_0x5418e2)){if(_0xde4b6a==0x0||_0xde4b6a==_0x3ab6dc[0x0][_0xc06e('0x1a')]){_0x3ec942=![];}_0x513782[_0xc06e('0x1d')](dbH['sequelize'][_0xc06e('0x14')](util[_0xc06e('0x15')](_0xc06e('0x1e'),QUERY,_0x5418e2,_0x3f201f),{'type':dbH[_0xc06e('0x17')][_0xc06e('0x18')]['SELECT']}));}}}else{_0x513782[_0xc06e('0x1d')](dbH['sequelize'][_0xc06e('0x14')](QUERY,{'type':dbH[_0xc06e('0x17')]['QueryTypes'][_0xc06e('0x19')]}));}var _0x2920b0=path[_0xc06e('0x1f')](PATH);var _0x36ef6b=path[_0xc06e('0x20')](PATH,'.xlsx');var _0x4dfc9e=_0x9c4da0[_0xc06e('0x11')]&&_0x513782[_0xc06e('0x1c')]>0x1;var _0xa622e7=[];if(!fs['existsSync'](path[_0xc06e('0x21')](_0x2920b0,_0x36ef6b))&&_0x4dfc9e){fs[_0xc06e('0x22')](path[_0xc06e('0x21')](_0x2920b0,_0x36ef6b));}return BPromise[_0xc06e('0x23')](_0x513782,function(_0x398383){_0xa622e7[_0xc06e('0x1d')](_0x398383);})[_0xc06e('0x13')](function(){for(var _0x42000a=0x0;_0x42000a<_0xa622e7[_0xc06e('0x1c')];_0x42000a+=0x1){var _0x57a0bb;var _0x1b5970=_0xa622e7[_0x42000a];if(_0x4dfc9e){_0x57a0bb=path['join'](_0x2920b0,_0x36ef6b,util[_0xc06e('0x15')]('%s%d.%s',_0x36ef6b,_0x42000a,_0xc06e('0x24')));}else{_0x57a0bb=path[_0xc06e('0x21')](_0x2920b0,util[_0xc06e('0x15')](_0xc06e('0x25'),_0x36ef6b,'xlsx'));}fs[_0xc06e('0x26')](_0x57a0bb,json2xls(_0x1b5970),_0xc06e('0x27'));}})[_0xc06e('0x13')](function(){if(_0x4dfc9e){zipdir(path['join'](_0x2920b0,_0x36ef6b),{'saveTo':path[_0xc06e('0x21')](_0x2920b0,util[_0xc06e('0x15')]('%s.%s',_0x36ef6b,_0xc06e('0x28')))},function(_0x52f24e,_0x562b1b){});rimraf(path[_0xc06e('0x21')](_0x2920b0,_0x36ef6b),function(){});}})['then'](function(){logger[_0xc06e('0x29')](util['format'](_0xc06e('0x2a'),EXTRACTED_REPORT_ID,_0xc06e('0xe')));return analyticExtractedReport(_0xc06e('0x2b'),_0x4dfc9e?util[_0xc06e('0x15')]('%s.%s',_0x36ef6b,_0x4dfc9e?_0xc06e('0x28'):'xlsx'):null);});})[_0xc06e('0x2c')](function(_0x5a319b){logger[_0xc06e('0x29')](util[_0xc06e('0x15')](_0xc06e('0x2d'),EXTRACTED_REPORT_ID,_0xc06e('0xe')),util[_0xc06e('0x2e')](_0x5a319b,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x76f5=['json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','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','path'];(function(_0x15f895,_0x2354d1){var _0x200a5c=function(_0x507509){while(--_0x507509){_0x15f895['push'](_0x15f895['shift']());}};_0x200a5c(++_0x2354d1);}(_0x76f5,0x15f));var _0x576f=function(_0x1d5cb2,_0x34f3f5){_0x1d5cb2=_0x1d5cb2-0x0;var _0x29a890=_0x76f5[_0x1d5cb2];return _0x29a890;};'use strict';var util=require('util');var path=require(_0x576f('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x576f('0x1'));var BPromise=require('bluebird');var zipdir=require(_0x576f('0x2'));var rimraf=require(_0x576f('0x3'));var db=require(_0x576f('0x4'))['db'];var dbH=require(_0x576f('0x4'))[_0x576f('0x5')];var logger=require(_0x576f('0x6'))(_0x576f('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x576f('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x576f('0x8')][0x4];function analyticExtractedReport(_0x54d0a0,_0x17d5da){var _0x3cb8b3={'status':_0x54d0a0};var _0x452231={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17d5da){_0x3cb8b3[_0x576f('0x9')]=_0x17d5da;}return db['AnalyticExtractedReport'][_0x576f('0xa')](_0x3cb8b3,_0x452231);}function main(){var _0x3cf8d=0x1388;var _0x535be3;logger[_0x576f('0xb')](util[_0x576f('0xc')](_0x576f('0xd'),EXTRACTED_REPORT_ID,_0x576f('0xe')));return db[_0x576f('0xf')][_0x576f('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x576f('0x11'),_0x576f('0x12')]})[_0x576f('0x13')](function(_0x26d2aa){if(_0x26d2aa){_0x535be3=_0x26d2aa;_0x3cf8d=_0x535be3[_0x576f('0x12')]||0x1388;}})[_0x576f('0x13')](function(){return dbH[_0x576f('0x14')][_0x576f('0x15')](util[_0x576f('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x576f('0x16')][_0x576f('0x17')]});})[_0x576f('0x13')](function(_0x483962){if(!_0x483962[0x0][_0x576f('0x18')]){return analyticExtractedReport('Empty');}var _0x538b42=[];var _0x4559c2=0x0;var _0x5e6b5c=!![];if(_0x535be3[_0x576f('0x11')]){if(_0x483962&&_0x483962[_0x576f('0x19')]){var _0x1c3e8b=_0x483962[0x0][_0x576f('0x18')]%(_0x4559c2+_0x3cf8d);for(;_0x5e6b5c;_0x4559c2+=_0x3cf8d,_0x1c3e8b=_0x483962[0x0][_0x576f('0x18')]%(_0x4559c2+_0x3cf8d)){if(_0x1c3e8b==0x0||_0x1c3e8b==_0x483962[0x0][_0x576f('0x18')]){_0x5e6b5c=![];}_0x538b42[_0x576f('0x1a')](dbH[_0x576f('0x14')]['query'](util['format'](_0x576f('0x1b'),QUERY,_0x3cf8d,_0x4559c2),{'type':dbH['sequelize'][_0x576f('0x16')][_0x576f('0x17')]}));}}}else{_0x538b42['push'](dbH[_0x576f('0x14')][_0x576f('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x576f('0x17')]}));}var _0x561add=path['dirname'](PATH);var _0x193377=path[_0x576f('0x1c')](PATH,_0x576f('0x1d'));var _0x1b66b6=_0x535be3[_0x576f('0x11')]&&_0x538b42[_0x576f('0x19')]>0x1;var _0x37aca1=[];if(!fs[_0x576f('0x1e')](path[_0x576f('0x1f')](_0x561add,_0x193377))&&_0x1b66b6){fs[_0x576f('0x20')](path[_0x576f('0x1f')](_0x561add,_0x193377));}return BPromise[_0x576f('0x21')](_0x538b42,function(_0x386967){_0x37aca1['push'](_0x386967);})[_0x576f('0x13')](function(){for(var _0x58fab2=0x0;_0x58fab2<_0x37aca1[_0x576f('0x19')];_0x58fab2+=0x1){var _0x59af71;var _0x56f6ea=_0x37aca1[_0x58fab2];if(_0x1b66b6){_0x59af71=path[_0x576f('0x1f')](_0x561add,_0x193377,util['format'](_0x576f('0x22'),_0x193377,_0x58fab2,_0x576f('0x23')));}else{_0x59af71=path[_0x576f('0x1f')](_0x561add,util['format']('%s.%s',_0x193377,_0x576f('0x23')));}fs['writeFileSync'](_0x59af71,json2xls(_0x56f6ea),_0x576f('0x24'));}})[_0x576f('0x13')](function(){if(_0x1b66b6){zipdir(path['join'](_0x561add,_0x193377),{'saveTo':path['join'](_0x561add,util[_0x576f('0xc')](_0x576f('0x25'),_0x193377,_0x576f('0x26')))},function(_0x4bc2a2,_0x56d6e3){});rimraf(path['join'](_0x561add,_0x193377),function(){});}})['then'](function(){logger[_0x576f('0xb')](util[_0x576f('0xc')](_0x576f('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x576f('0x28'),_0x1b66b6?util[_0x576f('0xc')]('%s.%s',_0x193377,_0x1b66b6?_0x576f('0x26'):_0x576f('0x23')):null);});})[_0x576f('0x29')](function(_0x436016){logger[_0x576f('0xb')](util[_0x576f('0xc')](_0x576f('0x2a'),EXTRACTED_REPORT_ID,_0x576f('0xe')),util[_0x576f('0x2b')](_0x436016,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 6df0f11..da2bbb9 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 _0xbb0a=['map','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','findAll','intervals','models','VoiceExtension','IntervalId','then','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','push','type','CDR(type)=%s','context','VoiceExtensionId','outbound','extensions','Set','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*'];(function(_0x1a20f7,_0x3a24f8){var _0x387341=function(_0x5ca0e7){while(--_0x5ca0e7){_0x1a20f7['push'](_0x1a20f7['shift']());}};_0x387341(++_0x3a24f8);}(_0xbb0a,0x64));var _0xabb0=function(_0x5d286e,_0x3b6236){_0x5d286e=_0x5d286e-0x0;var _0xc1e19e=_0xbb0a[_0x5d286e];return _0xc1e19e;};'use strict';var _=require(_0xabb0('0x0'));var util=require(_0xabb0('0x1'));function rewrite(_0x4728e2,_0x7e61fe){var _0x57f702=this;return _0x4728e2['models']['Interval'][_0xabb0('0x2')]({'raw':!![]})['then'](function(_0x26fc77){_0x57f702[_0xabb0('0x3')]=_0x26fc77;return _0x4728e2[_0xabb0('0x4')][_0xabb0('0x5')][_0xabb0('0x2')]({'where':{'IntervalId':_0x7e61fe[_0xabb0('0x6')]},'raw':!![]});})[_0xabb0('0x7')](function(_0x10ef5a){return _0x4728e2[_0xabb0('0x4')][_0xabb0('0x5')][_0xabb0('0x2')]({'where':{'exten':{'$in':_[_0xabb0('0x8')](_['map'](_0x10ef5a,_0xabb0('0x9')))}},'order':[{'raw':_0xabb0('0xa')}],'raw':!![]});})[_0xabb0('0x7')](function(_0x1e8de0){var _0xb11994=_['filter'](_0x1e8de0,{'priority':'1'});var _0x2a5d9d=_[_0xabb0('0xb')](_0x1e8de0,{'isApp':0x1});var _0x15cb86=_[_0xabb0('0xc')](_0x2a5d9d,'exten');var _0x458606=[_0xabb0('0xd'),_0xabb0('0xe')];var _0x3e8b5c=[];var _0x55f083=[];for(var _0xad1c1f in _0x15cb86){if(_0x15cb86[_0xabb0('0xf')](_0xad1c1f)){_0x57f702[_0xabb0('0x10')]=0x2;_0x57f702['extensions']=[];_0x57f702[_0xabb0('0x11')]=_[_0xabb0('0x12')](_0xb11994,{'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')]});_0x57f702['extensions'][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':'Set','appdata':util['format'](_0xabb0('0x15'),_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')]),'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});if(_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')]===_0xabb0('0x18')){if(_0x57f702['extension']){_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':'CDR(destination)='+(_0x57f702[_0xabb0('0x11')][_0xabb0('0x1b')]?_0xabb0('0x1c')+_0x57f702[_0xabb0('0x11')][_0xabb0('0x1b')]+'}':_0xabb0('0x1d')),'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});}_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0]['type'],'app':_0xabb0('0x1a'),'appdata':_0xabb0('0x1e')+_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')],'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0]['exten'],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});var _0x57d2da=_0x57f702['priority']++;_0x57f702['extensions'][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':'ExecIf','appdata':_0xabb0('0x1f')+(_0x57d2da+0x2)+'):Goto('+(_0x57d2da+0x1)+')','context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57d2da,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});if(_0x57f702[_0xabb0('0x11')]){_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':_0x57f702['extension'][_0xabb0('0x1b')]?_0xabb0('0x20')+_0x57f702[_0xabb0('0x11')][_0xabb0('0x1b')]+'}':_0xabb0('0x21'),'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0]['exten'],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});}_0x57f702['extensions'][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':'outboundrouteid='+_0x15cb86[_0xad1c1f][0x0]['VoiceExtensionId'],'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});if(_0x57f702['extension']&&_0x57f702[_0xabb0('0x11')][_0xabb0('0xf')](_0xabb0('0x22'))&&_0x57f702[_0xabb0('0x11')][_0xabb0('0x22')]!==_0xabb0('0x23')){_0x57f702[_0xabb0('0x19')]['push']({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':'Set','appdata':_0xabb0('0x24'),'context':_0x15cb86[_0xad1c1f][0x0]['context'],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702['priority']++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0]['VoiceExtensionId']});_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x57f702[_0xabb0('0x11')][_0xabb0('0x22')]||'wav','context':_0x15cb86[_0xad1c1f][0x0]['context'],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});}}_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':'Set','appdata':_0xabb0('0x25'),'context':_0x15cb86[_0xad1c1f][0x0]['context'],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});_0x57f702['extensions']['push']({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':_0xabb0('0x26'),'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702[_0xabb0('0x10')]++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});_0x57f702[_0xabb0('0x19')][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':_0xabb0('0x27'),'context':_0x15cb86[_0xad1c1f][0x0]['context'],'exten':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x9')],'priority':_0x57f702['priority']++,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});for(var _0x30e38a=0x0,_0x8b5e67=0x0;_0x30e38a<_0x15cb86[_0xad1c1f][_0xabb0('0x28')];_0x30e38a+=0x1,_0x8b5e67=0x0){var _0x2101a0=_0x15cb86[_0xad1c1f][_0x30e38a];if(_0x2101a0[_0xabb0('0x14')]){_0x2101a0[_0xabb0('0x14')]=_0x2101a0[_0xabb0('0x14')]['toLowerCase']();}var _0x2e4ec3=[];var _0x529ba1=[];delete _0x2101a0['id'];delete _0x2101a0[_0xabb0('0x29')];delete _0x2101a0['updatedAt'];var _0x5cb3f3=_0x2101a0[_0xabb0('0x2a')]!==_0xabb0('0x2b')?[_0x2101a0[_0xabb0('0x2a')]]:_0x2101a0[_0xabb0('0x6')]?_[_0xabb0('0x2c')](_[_0xabb0('0xb')](_0x57f702[_0xabb0('0x3')],{'IntervalId':_0x2101a0[_0xabb0('0x6')]}),_0xabb0('0x2a')):[];if(_0x2101a0[_0xabb0('0xf')](_0xabb0('0x2d'))){if(_0x2101a0['tag']&&_0x2101a0[_0xabb0('0x2d')]!=='--'){_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0['type'],'app':'Set','appdata':'CDR(tag)='+_0x2101a0[_0xabb0('0x2d')],'context':_0x2101a0['context'],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3[_0xabb0('0x28')]+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0['VoiceExtensionId']});}}if(_0x2101a0[_0xabb0('0x14')]===_0xabb0('0x18')&&_0x2101a0[_0xabb0('0xf')](_0xabb0('0x2e'))){if(_0x2101a0[_0xabb0('0x2e')]){_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0[_0xabb0('0x14')],'app':'ExecIf','appdata':_0xabb0('0x2f')+_0x2101a0[_0xabb0('0x2e')]+')','context':_0x2101a0['context'],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3[_0xabb0('0x28')]+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0[_0xabb0('0x17')]});}else{_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0[_0xabb0('0x14')],'app':_0xabb0('0x30'),'appdata':_0xabb0('0x31'),'context':_0x2101a0[_0xabb0('0x16')],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3[_0xabb0('0x28')]+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0['VoiceExtensionId']});}}if(_0x2101a0[_0xabb0('0xf')]('answer')){if(_0x458606[_0xabb0('0x32')](_0x2101a0[_0xabb0('0x33')][_0xabb0('0x34')]())>=0x0&&_0x2101a0[_0xabb0('0x35')]!==_0xabb0('0x36')){if(_0x2101a0[_0xabb0('0x37')]){_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0[_0xabb0('0x14')],'app':'ExecIf','appdata':_0xabb0('0x38'),'context':_0x2101a0[_0xabb0('0x16')],'exten':_0x2101a0['exten'],'priority':_0x5cb3f3[_0xabb0('0x28')]+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0[_0xabb0('0x17')]});_0x2e4ec3['push']({'type':_0x2101a0[_0xabb0('0x14')],'app':'Set','appdata':_0xabb0('0x39'),'context':_0x2101a0['context'],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3['length']+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0[_0xabb0('0x17')]});}else{_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0[_0xabb0('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2101a0['context'],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3['length']+_0x57f702[_0xabb0('0x10')]+_0x8b5e67++,'VoiceExtensionId':_0x2101a0['VoiceExtensionId']});_0x2e4ec3[_0xabb0('0x13')]({'type':_0x2101a0[_0xabb0('0x14')],'app':_0xabb0('0x1a'),'appdata':_0xabb0('0x3a'),'context':_0x2101a0[_0xabb0('0x16')],'exten':_0x2101a0[_0xabb0('0x9')],'priority':_0x5cb3f3['length']+_0x57f702['priority']+_0x8b5e67++,'VoiceExtensionId':_0x2101a0[_0xabb0('0x17')]});}}}for(var _0x393b98=0x0;_0x393b98<_0x5cb3f3[_0xabb0('0x28')];_0x393b98+=0x1){var _0xbfd5cf=_0x57f702[_0xabb0('0x10')]+_0x5cb3f3[_0xabb0('0x28')];var _0x5ce744=_0x393b98===_0x5cb3f3[_0xabb0('0x28')]-0x1?_0x57f702[_0xabb0('0x10')]+_0x2e4ec3[_0xabb0('0x28')]+_0x529ba1[_0xabb0('0x28')]+0x2:_0x57f702[_0xabb0('0x10')]+_0x393b98+0x1;_0x2e4ec3[_0xabb0('0x3b')](_0x393b98,0x0,{'type':_0x2101a0['type'],'app':_0xabb0('0x3c'),'appdata':_0x5cb3f3[_0x393b98]+'?'+_0x2101a0[_0xabb0('0x16')]+',${EXTEN},'+_0xbfd5cf+':'+_0x2101a0[_0xabb0('0x16')]+_0xabb0('0x3d')+_0x5ce744,'exten':_0x2101a0[_0xabb0('0x9')],'context':_0x2101a0['context'],'priority':_0x57f702[_0xabb0('0x10')]+_0x393b98,'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});}_0x2101a0[_0xabb0('0x10')]=_0x2e4ec3[_0xabb0('0x28')]?_['last'](_0x2e4ec3)[_0xabb0('0x10')]+0x1:_0x57f702[_0xabb0('0x10')];_0x57f702['priority']=(_0x529ba1[_0xabb0('0x28')]?_[_0xabb0('0x3e')](_0x529ba1)[_0xabb0('0x10')]:_0x2101a0['priority'])+0x1;_0x57f702[_0xabb0('0x19')]=_[_0xabb0('0x3f')](_0x57f702['extensions'],_0x2e4ec3,[_0x2101a0],_0x529ba1);}_0x57f702['extensions'][_0xabb0('0x13')]({'type':_0x15cb86[_0xad1c1f][0x0]['type'],'app':_0xabb0('0x40'),'exten':_0x15cb86[_0xad1c1f][0x0]['exten'],'context':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x16')],'priority':_0x57f702[_0xabb0('0x10')],'VoiceExtensionId':_0x15cb86[_0xad1c1f][0x0][_0xabb0('0x17')]});_0x3e8b5c[_0xabb0('0x13')](_0x15cb86[_0xad1c1f][0x0]['VoiceExtensionId']);_0x55f083=_['concat'](_0x55f083,_0x57f702[_0xabb0('0x19')]);}}return _0x4728e2[_0xabb0('0x41')](function(_0x13b8ac){return _0x4728e2['models']['VoiceExtension'][_0xabb0('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3e8b5c}},'transaction':_0x13b8ac})['then'](function(_0x32a49d){return _0x4728e2[_0xabb0('0x4')][_0xabb0('0x5')][_0xabb0('0x43')](_[_0xabb0('0x44')](_0x55f083,'priority'),{'transaction':_0x13b8ac});});});})[_0xabb0('0x45')](function(_0x289034){console[_0xabb0('0x46')](_0x289034);});}exports[_0xabb0('0x47')]=rewrite; \ No newline at end of file +var _0x2797=['intervals','VoiceExtension','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','error','rewrite','util','models','Interval','then'];(function(_0x398cf8,_0xfe83c0){var _0x3b21a9=function(_0x5764da){while(--_0x5764da){_0x398cf8['push'](_0x398cf8['shift']());}};_0x3b21a9(++_0xfe83c0);}(_0x2797,0xc8));var _0x7279=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2797[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x7279('0x0'));function rewrite(_0x4affb0,_0x171ba9){var _0x2d70e8=this;return _0x4affb0[_0x7279('0x1')][_0x7279('0x2')]['findAll']({'raw':!![]})[_0x7279('0x3')](function(_0x223940){_0x2d70e8[_0x7279('0x4')]=_0x223940;return _0x4affb0[_0x7279('0x1')][_0x7279('0x5')][_0x7279('0x6')]({'where':{'IntervalId':_0x171ba9['IntervalId']},'raw':!![]});})[_0x7279('0x3')](function(_0xe84622){return _0x4affb0[_0x7279('0x1')][_0x7279('0x5')][_0x7279('0x6')]({'where':{'exten':{'$in':_[_0x7279('0x7')](_[_0x7279('0x8')](_0xe84622,_0x7279('0x9')))}},'order':[{'raw':_0x7279('0xa')}],'raw':!![]});})[_0x7279('0x3')](function(_0x40624b){var _0x56a9f5=_[_0x7279('0xb')](_0x40624b,{'priority':'1'});var _0x57f5e6=_[_0x7279('0xb')](_0x40624b,{'isApp':0x1});var _0x46d282=_[_0x7279('0xc')](_0x57f5e6,_0x7279('0x9'));var _0x5d3f7f=[_0x7279('0xd'),_0x7279('0xe')];var _0x217e77=[];var _0x1822ae=[];for(var _0x4e8139 in _0x46d282){if(_0x46d282[_0x7279('0xf')](_0x4e8139)){_0x2d70e8[_0x7279('0x10')]=0x2;_0x2d70e8['extensions']=[];_0x2d70e8['extension']=_['find'](_0x56a9f5,{'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')]});_0x2d70e8[_0x7279('0x11')][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':util['format'](_0x7279('0x15'),_0x46d282[_0x4e8139][0x0][_0x7279('0x13')]),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});if(_0x46d282[_0x4e8139][0x0][_0x7279('0x13')]===_0x7279('0x18')){if(_0x2d70e8[_0x7279('0x19')]){_0x2d70e8[_0x7279('0x11')]['push']({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x7279('0x1a')+(_0x2d70e8['extension'][_0x7279('0x1b')]?_0x7279('0x1c')+_0x2d70e8[_0x7279('0x19')][_0x7279('0x1b')]+'}':'${EXTEN}'),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});}_0x2d70e8['extensions'][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x7279('0x1d')+_0x46d282[_0x4e8139][0x0][_0x7279('0x17')],'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0]['exten'],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0]['VoiceExtensionId']});var _0xde1143=_0x2d70e8[_0x7279('0x10')]++;_0x2d70e8[_0x7279('0x11')]['push']({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xde1143+0x2)+'):Goto('+(_0xde1143+0x1)+')','context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0xde1143,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});if(_0x2d70e8['extension']){_0x2d70e8[_0x7279('0x11')]['push']({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x2d70e8[_0x7279('0x19')]['cutdigits']?_0x7279('0x1f')+_0x2d70e8[_0x7279('0x19')][_0x7279('0x1b')]+'}':_0x7279('0x20'),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0]['exten'],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});}_0x2d70e8[_0x7279('0x11')][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x7279('0x21')+_0x46d282[_0x4e8139][0x0][_0x7279('0x17')],'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0]['exten'],'priority':_0x2d70e8['priority']++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});if(_0x2d70e8[_0x7279('0x19')]&&_0x2d70e8['extension'][_0x7279('0xf')](_0x7279('0x22'))&&_0x2d70e8[_0x7279('0x19')][_0x7279('0x22')]!=='none'){_0x2d70e8[_0x7279('0x11')][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x7279('0x23'),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0x2d70e8['priority']++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});_0x2d70e8['extensions'][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':'Set','appdata':_0x7279('0x24')+_0x2d70e8[_0x7279('0x19')]['recordingFormat']||_0x7279('0x25'),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});}}_0x2d70e8[_0x7279('0x11')][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0]['exten'],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});_0x2d70e8[_0x7279('0x11')][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0]['type'],'app':_0x7279('0x14'),'appdata':_0x7279('0x26'),'context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});_0x2d70e8['extensions'][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x46d282[_0x4e8139][0x0][_0x7279('0x16')],'exten':_0x46d282[_0x4e8139][0x0]['exten'],'priority':_0x2d70e8[_0x7279('0x10')]++,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0]['VoiceExtensionId']});for(var _0x50c576=0x0,_0x1b3939=0x0;_0x50c576<_0x46d282[_0x4e8139][_0x7279('0x27')];_0x50c576+=0x1,_0x1b3939=0x0){var _0x2422e1=_0x46d282[_0x4e8139][_0x50c576];if(_0x2422e1[_0x7279('0x13')]){_0x2422e1[_0x7279('0x13')]=_0x2422e1['type'][_0x7279('0x28')]();}var _0x72e2a4=[];var _0x5f4864=[];delete _0x2422e1['id'];delete _0x2422e1['createdAt'];delete _0x2422e1[_0x7279('0x29')];var _0x1c1b4c=_0x2422e1[_0x7279('0x2a')]!==_0x7279('0x2b')?[_0x2422e1[_0x7279('0x2a')]]:_0x2422e1[_0x7279('0x2c')]?_[_0x7279('0x8')](_[_0x7279('0xb')](_0x2d70e8['intervals'],{'IntervalId':_0x2422e1[_0x7279('0x2c')]}),_0x7279('0x2a')):[];if(_0x2422e1[_0x7279('0xf')](_0x7279('0x2d'))){if(_0x2422e1['tag']&&_0x2422e1['tag']!=='--'){_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1['type'],'app':_0x7279('0x14'),'appdata':_0x7279('0x2e')+_0x2422e1[_0x7279('0x2d')],'context':_0x2422e1['context'],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c['length']+_0x2d70e8[_0x7279('0x10')]+_0x1b3939++,'VoiceExtensionId':_0x2422e1[_0x7279('0x17')]});}}if(_0x2422e1[_0x7279('0x13')]===_0x7279('0x18')&&_0x2422e1['hasOwnProperty'](_0x7279('0x2f'))){if(_0x2422e1[_0x7279('0x2f')]){_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1['type'],'app':_0x7279('0x1e'),'appdata':_0x7279('0x30')+_0x2422e1[_0x7279('0x2f')]+')','context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c['length']+_0x2d70e8[_0x7279('0x10')]+_0x1b3939++,'VoiceExtensionId':_0x2422e1[_0x7279('0x17')]});}else{_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1[_0x7279('0x13')],'app':_0x7279('0x1e'),'appdata':_0x7279('0x31'),'context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c[_0x7279('0x27')]+_0x2d70e8['priority']+_0x1b3939++,'VoiceExtensionId':_0x2422e1[_0x7279('0x17')]});}}if(_0x2422e1[_0x7279('0xf')]('answer')){if(_0x5d3f7f[_0x7279('0x32')](_0x2422e1['app'][_0x7279('0x28')]())>=0x0&&_0x2422e1[_0x7279('0x33')]!==_0x7279('0x34')){if(_0x2422e1[_0x7279('0x35')]){_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1[_0x7279('0x13')],'app':_0x7279('0x1e'),'appdata':_0x7279('0x36'),'context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c[_0x7279('0x27')]+_0x2d70e8[_0x7279('0x10')]+_0x1b3939++,'VoiceExtensionId':_0x2422e1[_0x7279('0x17')]});_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1[_0x7279('0x13')],'app':_0x7279('0x14'),'appdata':_0x7279('0x37'),'context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c[_0x7279('0x27')]+_0x2d70e8['priority']+_0x1b3939++,'VoiceExtensionId':_0x2422e1[_0x7279('0x17')]});}else{_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1['type'],'app':_0x7279('0x1e'),'appdata':_0x7279('0x38'),'context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1['exten'],'priority':_0x1c1b4c[_0x7279('0x27')]+_0x2d70e8[_0x7279('0x10')]+_0x1b3939++,'VoiceExtensionId':_0x2422e1['VoiceExtensionId']});_0x72e2a4[_0x7279('0x12')]({'type':_0x2422e1[_0x7279('0x13')],'app':'Set','appdata':_0x7279('0x39'),'context':_0x2422e1[_0x7279('0x16')],'exten':_0x2422e1[_0x7279('0x9')],'priority':_0x1c1b4c[_0x7279('0x27')]+_0x2d70e8['priority']+_0x1b3939++,'VoiceExtensionId':_0x2422e1['VoiceExtensionId']});}}}for(var _0x27b969=0x0;_0x27b969<_0x1c1b4c['length'];_0x27b969+=0x1){var _0x200bb0=_0x2d70e8['priority']+_0x1c1b4c[_0x7279('0x27')];var _0x5dd17d=_0x27b969===_0x1c1b4c[_0x7279('0x27')]-0x1?_0x2d70e8[_0x7279('0x10')]+_0x72e2a4[_0x7279('0x27')]+_0x5f4864['length']+0x2:_0x2d70e8[_0x7279('0x10')]+_0x27b969+0x1;_0x72e2a4['splice'](_0x27b969,0x0,{'type':_0x2422e1[_0x7279('0x13')],'app':_0x7279('0x3a'),'appdata':_0x1c1b4c[_0x27b969]+'?'+_0x2422e1['context']+',${EXTEN},'+_0x200bb0+':'+_0x2422e1[_0x7279('0x16')]+_0x7279('0x3b')+_0x5dd17d,'exten':_0x2422e1[_0x7279('0x9')],'context':_0x2422e1['context'],'priority':_0x2d70e8[_0x7279('0x10')]+_0x27b969,'VoiceExtensionId':_0x46d282[_0x4e8139][0x0][_0x7279('0x17')]});}_0x2422e1[_0x7279('0x10')]=_0x72e2a4['length']?_[_0x7279('0x3c')](_0x72e2a4)[_0x7279('0x10')]+0x1:_0x2d70e8['priority'];_0x2d70e8[_0x7279('0x10')]=(_0x5f4864[_0x7279('0x27')]?_[_0x7279('0x3c')](_0x5f4864)[_0x7279('0x10')]:_0x2422e1[_0x7279('0x10')])+0x1;_0x2d70e8['extensions']=_[_0x7279('0x3d')](_0x2d70e8['extensions'],_0x72e2a4,[_0x2422e1],_0x5f4864);}_0x2d70e8['extensions'][_0x7279('0x12')]({'type':_0x46d282[_0x4e8139][0x0][_0x7279('0x13')],'app':'Hangup','exten':_0x46d282[_0x4e8139][0x0][_0x7279('0x9')],'context':_0x46d282[_0x4e8139][0x0]['context'],'priority':_0x2d70e8['priority'],'VoiceExtensionId':_0x46d282[_0x4e8139][0x0]['VoiceExtensionId']});_0x217e77[_0x7279('0x12')](_0x46d282[_0x4e8139][0x0]['VoiceExtensionId']);_0x1822ae=_[_0x7279('0x3d')](_0x1822ae,_0x2d70e8[_0x7279('0x11')]);}}return _0x4affb0[_0x7279('0x3e')](function(_0x5792df){return _0x4affb0[_0x7279('0x1')]['VoiceExtension'][_0x7279('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x217e77}},'transaction':_0x5792df})[_0x7279('0x3')](function(_0x2b909a){return _0x4affb0['models']['VoiceExtension'][_0x7279('0x40')](_[_0x7279('0x41')](_0x1822ae,_0x7279('0x10')),{'transaction':_0x5792df});});});})['catch'](function(_0x457e30){console[_0x7279('0x42')](_0x457e30);});}exports[_0x7279('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 953ba11..e3d0db7 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 _0xf08c=['select','field','scheduledAt','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','createdAt','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','insert','into','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','onlyIfOpen','CampaignId','generalCheckHopper','stringify','finally','resume','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','undefined','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','email','ListId','find','CmContact','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','cm_hopper','fromQuery','ContactId','updatedAt'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xf08c,0x106));var _0xcf08=function(_0x29da81,_0x40b463){_0x29da81=_0x29da81-0x0;var _0x307a38=_0xf08c[_0x29da81];return _0x307a38;};'use strict';var BPromise=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var _=require(_0xcf08('0x2'));var fs=require('fs');var squel=require(_0xcf08('0x3'));var Papa=require(_0xcf08('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xcf08('0x5'));var logger=require(_0xcf08('0x6'))(_0xcf08('0x7'));config[_0xcf08('0x8')]=_['defaults'](config[_0xcf08('0x8')],{'host':_0xcf08('0x9'),'port':0x18eb});var socket=require(_0xcf08('0xa'))(new Redis(config[_0xcf08('0x8')]));require(_0xcf08('0xb'))[_0xcf08('0xc')](socket);try{if(!process['argv'][0x2]||process[_0xcf08('0xd')][0x2]==='undefined'||process[_0xcf08('0xd')][0x2]==='null'){throw new Error(_0xcf08('0xe'));}var FILEPATH=process[_0xcf08('0xd')][0x2];if(!process[_0xcf08('0xd')][0x3]||process[_0xcf08('0xd')][0x3]==='undefined'||process[_0xcf08('0xd')][0x3]==='null'||!process['argv'][0x4]||process[_0xcf08('0xd')][0x4]==='undefined'||process[_0xcf08('0xd')][0x4]===_0xcf08('0xf')){throw new Error(_0xcf08('0x10'));}var FIELDS=_['zipObject'](process[_0xcf08('0xd')][0x3][_0xcf08('0x11')](','),process[_0xcf08('0xd')][0x4]['split'](','));if(!process[_0xcf08('0xd')][0x5]||process[_0xcf08('0xd')][0x5]===_0xcf08('0x12')||process[_0xcf08('0xd')][0x5]===_0xcf08('0xf')){throw new Error(_0xcf08('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcf08('0xd')][0x6]&&process['argv'][0x6]!==_0xcf08('0x12')&&process[_0xcf08('0xd')][0x6]!==_0xcf08('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0xcf08('0xd')][0x7]&&process['argv'][0x7]!==_0xcf08('0x12')&&process[_0xcf08('0xd')][0x7]!==_0xcf08('0xf')?process[_0xcf08('0xd')][0x7]:null;if(!process[_0xcf08('0xd')][0x8]||process[_0xcf08('0xd')][0x8]===_0xcf08('0x12')||process[_0xcf08('0xd')][0x8]===_0xcf08('0xf')){throw new Error(_0xcf08('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c6d7a){logger[_0xcf08('0x15')](_0x2c6d7a);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(_0x3bc017,_0x137718,_0x3cc25b,_0x3e9dc3){var _0x252f2e={'message':_0x137718};_0x252f2e[_0x3bc017]=!![];if(_0x3cc25b){_0x252f2e[_0xcf08('0x16')]=_0x3cc25b;}if(_0x3e9dc3){_0x252f2e[_0xcf08('0x17')]=_0x3e9dc3;}return _0x252f2e;}function isEmail(_0x5ccf3f){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))*$/[_0xcf08('0x18')](_0x5ccf3f);}function checkRow(_0x4a73c0,_0x44fed8,_0x43e467){return new BPromise(function(_0x7f761,_0x50f0a0){if(_['isNil'](_0x4a73c0)){return _0x50f0a0(handleCheckRowError(_0xcf08('0x15'),_0xcf08('0x19'),null,_0x43e467));}if(_0x4a73c0['errors']&&_0x4a73c0[_0xcf08('0x1a')][_0xcf08('0x1b')]){var _0x8fdcbf=_[_0xcf08('0x1c')](_0x4a73c0[_0xcf08('0x1a')],_0xcf08('0x1d'))[_0xcf08('0x1e')](';');return _0x50f0a0(handleCheckRowError(_0xcf08('0x15'),_0x8fdcbf,null,_0x43e467));}var _0x57638e={};for(var _0x4a9ac6 in FIELDS){if(FIELDS[_0xcf08('0x1f')](_0x4a9ac6)&&FIELDS[_0x4a9ac6]){_0x57638e[_0x4a9ac6]=_0x4a73c0['data'][0x0][FIELDS[_0x4a9ac6]]||_0x4a73c0['data'][0x0]['\ufeff'+FIELDS[_0x4a9ac6]];}}if(!_0x57638e[_0xcf08('0x20')]){return _0x50f0a0(handleCheckRowError(_0xcf08('0x15'),_0xcf08('0x21'),null,_0x43e467));}if(!_0x57638e[_0xcf08('0x22')]){return _0x50f0a0(handleCheckRowError('error',_0xcf08('0x23'),null,_0x43e467));}if(_0x57638e[_0xcf08('0x24')]){var _0x51fed2=moment(_0x57638e['birthDate'],'YYYY-MM-DD');if(!_0x51fed2[_0xcf08('0x25')]()){return _0x50f0a0(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x43e467));}}if(_0x57638e[_0xcf08('0x26')]){if(!isEmail(_0x57638e[_0xcf08('0x26')])){return _0x50f0a0(handleCheckRowError(_0xcf08('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x43e467));}}_0x57638e[_0xcf08('0x27')]=LISTID;_0x57638e['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcf08('0x1b')]&&_0x44fed8){var _0x18fa06={};for(var _0x50cfbe=0x0,_0x27b109=DUPLICATES['length'];_0x50cfbe<_0x27b109;_0x50cfbe+=0x1){_0x18fa06[DUPLICATES[_0x50cfbe]]=_0x57638e[DUPLICATES[_0x50cfbe]];}var _0x3d4e5a=_[_0xcf08('0x28')](_0x44fed8,_0x18fa06);if(_0x3d4e5a){return _0x50f0a0(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x3d4e5a,_0x43e467));}}return db[_0xcf08('0x29')]['create'](_0x57638e,{'raw':!![],'hooks':![],'fields':_[_0xcf08('0x2a')](_0x57638e)})[_0xcf08('0x2b')](function(_0x4a5c42){if(DUPLICATES&&DUPLICATES[_0xcf08('0x1b')]&&_0x44fed8){_0x44fed8['push'](_[_0xcf08('0x2c')](_0x57638e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4a5c42['id'];return _0x7f761();})['catch'](function(_0x20e5ac){return _0x50f0a0(handleCheckRowError(_0xcf08('0x15'),_0xcf08('0x2d')+(_0x20e5ac[_0xcf08('0x1d')]||JSON['stringify'](_0x20e5ac)),null,_0x43e467));});});}function checkHopper(){function _0x3053c0(){return function(_0x9ddee0){logger[_0xcf08('0x15')]('cmContact','checkHopper',util['inspect'](_0x9ddee0,{'showHidden':![],'depth':null}));};}var _0x5b1fc5=function(_0x588748,_0x2ef02c){var _0x2807ec=squel['insert']()['into'](_0xcf08('0x2e'))[_0xcf08('0x2f')]([_0xcf08('0x22'),'scheduledAt',_0xcf08('0x30'),'ListId',_0x2ef02c,'createdAt',_0xcf08('0x31')],squel[_0xcf08('0x32')]()[_0xcf08('0x33')](_0xcf08('0x22'),_0xcf08('0x22'))['field']('NOW()',_0xcf08('0x34'))[_0xcf08('0x33')]('id',_0xcf08('0x30'))[_0xcf08('0x33')](LISTID[_0xcf08('0x35')](),'ListId')[_0xcf08('0x33')](_0x588748['id']['toString'](),_0x2ef02c)[_0xcf08('0x33')](_0xcf08('0x36'),'createdAt')['field'](_0xcf08('0x36'),_0xcf08('0x31'))[_0xcf08('0x37')](_0xcf08('0x38'))['where'](_0xcf08('0x39'))[_0xcf08('0x3a')](_0xcf08('0x3b'),LISTID[_0xcf08('0x35')]())['where'](_0xcf08('0x3c'))[_0xcf08('0x3a')](_0xcf08('0x3d'),squel[_0xcf08('0x32')]()[_0xcf08('0x33')](_0xcf08('0x22'))['from'](_0xcf08('0x2e'))[_0xcf08('0x3a')](_0x2ef02c+'\x20=\x20?',_0x588748['id'][_0xcf08('0x35')]())))[_0xcf08('0x35')]();return _0x2807ec;};var _0x46e1db=function(_0x5300ea,_0x57a6a2){var _0x56c62d=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xcf08('0x22'),_0xcf08('0x34'),_0xcf08('0x30'),_0xcf08('0x27'),_0x57a6a2,_0xcf08('0x3e'),_0xcf08('0x31')],squel['select']()[_0xcf08('0x33')](_0xcf08('0x22'),_0xcf08('0x22'))[_0xcf08('0x33')](_0xcf08('0x36'),_0xcf08('0x34'))['field']('id',_0xcf08('0x30'))[_0xcf08('0x33')](LISTID[_0xcf08('0x35')](),_0xcf08('0x27'))[_0xcf08('0x33')](_0x5300ea['id'][_0xcf08('0x35')](),_0x57a6a2)[_0xcf08('0x33')]('NOW()','createdAt')[_0xcf08('0x33')](_0xcf08('0x36'),_0xcf08('0x31'))[_0xcf08('0x37')](_0xcf08('0x38'))[_0xcf08('0x3a')](_0xcf08('0x39'))[_0xcf08('0x3a')](_0xcf08('0x3b'),LISTID[_0xcf08('0x35')]())['where'](_0xcf08('0x3f'),squel[_0xcf08('0x40')](hopperContacts))[_0xcf08('0x3a')](_0xcf08('0x3c'))['where'](_0xcf08('0x3d'),squel[_0xcf08('0x32')]()['field']('calleridnum')['from'](_0xcf08('0x41'))[_0xcf08('0x3a')](_0x57a6a2+_0xcf08('0x42'),_0x5300ea['id'][_0xcf08('0x35')]()))[_0xcf08('0x3a')](_0xcf08('0x3d'),squel[_0xcf08('0x32')]()['field']('phone')['from']('cm_hopper')['where'](_0x57a6a2+_0xcf08('0x42'),_0x5300ea['id']['toString']())))['toString']();return _0x56c62d;};function _0x398351(_0xcf5435,_0x17a041){var _0x4183dc=squel[_0xcf08('0x43')]()['into'](_0xcf08('0x2e'))['fromQuery']([_0xcf08('0x22'),_0xcf08('0x34'),_0xcf08('0x30'),_0xcf08('0x27'),_0x17a041,'createdAt',_0xcf08('0x31')],squel[_0xcf08('0x32')]()[_0xcf08('0x33')](_0xcf08('0x22'),_0xcf08('0x22'))[_0xcf08('0x33')](_0xcf08('0x36'),'scheduledAt')[_0xcf08('0x33')]('id',_0xcf08('0x30'))[_0xcf08('0x33')](LISTID['toString'](),_0xcf08('0x27'))['field'](_0xcf5435['id']['toString'](),_0x17a041)[_0xcf08('0x33')](_0xcf08('0x36'),_0xcf08('0x3e'))[_0xcf08('0x33')](_0xcf08('0x36'),'updatedAt')['from'](_0xcf08('0x38'))[_0xcf08('0x3a')]('deletedAt\x20IS\x20NULL')[_0xcf08('0x3a')](_0xcf08('0x3b'),LISTID[_0xcf08('0x35')]())[_0xcf08('0x3a')](_0xcf08('0x3f'),squel['str'](hopperContacts))[_0xcf08('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xcf08('0x35')]();return _0x4183dc;}function _0x1c1394(_0x4c08c9,_0x222b5d){var _0x39ab5c=squel[_0xcf08('0x43')]()[_0xcf08('0x44')]('cm_hopper_black')[_0xcf08('0x2f')]([_0xcf08('0x22'),_0xcf08('0x30'),_0xcf08('0x27'),_0x222b5d,_0xcf08('0x3e'),'updatedAt'],squel[_0xcf08('0x32')]()[_0xcf08('0x33')](_0xcf08('0x22'),_0xcf08('0x22'))[_0xcf08('0x33')]('id',_0xcf08('0x30'))['field'](LISTID['toString'](),_0xcf08('0x27'))['field'](_0x4c08c9['id'][_0xcf08('0x35')](),_0x222b5d)['field'](_0xcf08('0x36'),_0xcf08('0x3e'))[_0xcf08('0x33')](_0xcf08('0x36'),'updatedAt')[_0xcf08('0x37')](_0xcf08('0x38'))['where'](_0xcf08('0x39'))['where'](_0xcf08('0x3b'),LISTID[_0xcf08('0x35')]())[_0xcf08('0x3a')](_0xcf08('0x3f'),squel[_0xcf08('0x40')](hopperContacts))[_0xcf08('0x3a')](_0xcf08('0x3c')))[_0xcf08('0x35')]();return _0x39ab5c;}return db[_0xcf08('0x45')][_0xcf08('0x46')]({'where':{'type':_0xcf08('0x47')},'attributes':['id',_0xcf08('0x48')],'include':[{'model':db[_0xcf08('0x49')],'as':_0xcf08('0x4a'),'where':{'id':LISTID}}]})[_0xcf08('0x2b')](function(_0x1b316e){var _0x476274=[];if(_0x1b316e){var _0x3eea75;for(var _0x129e4b=0x0,_0xf1bd7e;_0x129e4b<_0x1b316e['length'];_0x129e4b+=0x1){_0xf1bd7e=_0x1b316e[_0x129e4b][_0xcf08('0x4b')]({'plain':!![]});switch(_0xf1bd7e[_0xcf08('0x48')]){case _0xcf08('0x4c'):_0x476274[_0xcf08('0x4d')](db[_0xcf08('0x4e')][_0xcf08('0x4f')](_0x46e1db(_0xf1bd7e,_0xcf08('0x50')))[_0xcf08('0x2b')](function(){})[_0xcf08('0x51')](_0x3053c0()));break;case'onlyIfOpen':_0x476274['push'](db[_0xcf08('0x4e')]['query'](_0x5b1fc5(_0xf1bd7e,'VoiceQueueId'))[_0xcf08('0x2b')](function(){})[_0xcf08('0x51')](_0x3053c0()));break;default:_0x476274[_0xcf08('0x4d')](db[_0xcf08('0x4e')][_0xcf08('0x4f')](_0x398351(_0xf1bd7e,_0xcf08('0x50')))[_0xcf08('0x2b')](function(){})[_0xcf08('0x51')](_0x3053c0()));}}}return _0x476274;})[_0xcf08('0x52')]()['then'](function(){return db[_0xcf08('0x45')]['findAll']({'where':{'type':_0xcf08('0x47')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xcf08('0x53'),'where':{'id':LISTID}}]})[_0xcf08('0x2b')](function(_0x41bf5a){var _0x1eb3f3=[];if(_0x41bf5a){var _0x32bfd5;for(var _0x2ac3e8=0x0,_0x1dc930;_0x2ac3e8<_0x41bf5a['length'];_0x2ac3e8+=0x1){_0x1dc930=_0x41bf5a[_0x2ac3e8]['get']({'plain':!![]});_0x1eb3f3[_0xcf08('0x4d')](db['sequelize'][_0xcf08('0x4f')](_0x1c1394(_0x1dc930,_0xcf08('0x50')))[_0xcf08('0x2b')](function(){})['catch'](_0x3053c0()));}}return _0x1eb3f3;})[_0xcf08('0x52')]();})[_0xcf08('0x2b')](function(){return db[_0xcf08('0x54')][_0xcf08('0x46')]({'attributes':['id',_0xcf08('0x48')],'include':[{'model':db['CmList'],'as':_0xcf08('0x4a'),'where':{'id':LISTID}}]})[_0xcf08('0x2b')](function(_0x4bf865){var _0x272803=[];if(_0x4bf865){for(var _0x47a9dd=0x0,_0x282954;_0x47a9dd<_0x4bf865[_0xcf08('0x1b')];_0x47a9dd+=0x1){_0x282954=_0x4bf865[_0x47a9dd][_0xcf08('0x4b')]({'plain':!![]});switch(_0x282954[_0xcf08('0x48')]){case _0xcf08('0x4c'):_0x272803[_0xcf08('0x4d')](db['sequelize'][_0xcf08('0x4f')](_0x46e1db(_0x282954,'CampaignId'))[_0xcf08('0x2b')](function(){})[_0xcf08('0x51')](_0x3053c0()));break;case _0xcf08('0x55'):_0x272803[_0xcf08('0x4d')](db[_0xcf08('0x4e')][_0xcf08('0x4f')](_0x5b1fc5(_0x282954,_0xcf08('0x56')))[_0xcf08('0x2b')](function(){})[_0xcf08('0x51')](_0x3053c0()));break;default:_0x272803[_0xcf08('0x4d')](db[_0xcf08('0x4e')][_0xcf08('0x4f')](_0x398351(_0x282954,_0xcf08('0x56')))['then'](function(){})[_0xcf08('0x51')](_0x3053c0()));}}}return _0x272803;})['all']();})[_0xcf08('0x2b')](function(){return db[_0xcf08('0x54')][_0xcf08('0x46')]({'attributes':['id'],'include':[{'model':db[_0xcf08('0x49')],'as':_0xcf08('0x53'),'where':{'id':LISTID}}]})[_0xcf08('0x2b')](function(_0x3e9dbb){var _0x1580a5=[];if(_0x3e9dbb){for(var _0x2ba86f=0x0,_0x5329a1;_0x2ba86f<_0x3e9dbb['length'];_0x2ba86f+=0x1){_0x5329a1=_0x3e9dbb[_0x2ba86f][_0xcf08('0x4b')]({'plain':!![]});_0x1580a5[_0xcf08('0x4d')](db['sequelize']['query'](_0x1c1394(_0x5329a1,_0xcf08('0x56')))['then'](function(){})[_0xcf08('0x51')](_0x3053c0()));}}return _0x1580a5;})[_0xcf08('0x52')]();})[_0xcf08('0x51')](function(_0xf559ed){logger['error']('cmContact,\x20%s,\x20%s',_0xcf08('0x57'),_0xf559ed[_0xcf08('0x1d')]);});}var processPromises=function(_0x21e00c){return BPromise[_0xcf08('0x52')](promises)[_0xcf08('0x2b')](function(_0x4411be){})[_0xcf08('0x51')](function(_0x463705){logger[_0xcf08('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0xcf08('0x58')](_0x463705));})[_0xcf08('0x59')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x21e00c){return _0x21e00c[_0xcf08('0x5a')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xcf08('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0xcf08('0x2b')](function(){socket[_0xcf08('0x5b')](_0xcf08('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcf08('0x5d')](FILEPATH);}catch(_0x251eac){logger[_0xcf08('0x15')](_0xcf08('0x5e'),JSON['stringify'](_0x251eac));}finally{process[_0xcf08('0x5f')](0x0);}});};process['on']('SIGINT',function(){logger[_0xcf08('0x60')](_0xcf08('0x61'));endCsv();});function main(){return BPromise[_0xcf08('0x62')]()[_0xcf08('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcf08('0x11')](',');return db[_0xcf08('0x29')][_0xcf08('0x46')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x3b687e){var _0x3321fb=fs[_0xcf08('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3321fb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2202f3,_0x456f67){total+=0x1;var _0xa015f8=total;promises['push'](checkRow(_0x2202f3,_0x3b687e,_0xa015f8)['then'](function(){success+=0x1;})['catch'](function(_0x488236){if(_0x488236['error']){errors+=0x1;delete _0x488236[_0xcf08('0x15')];}else if(_0x488236[_0xcf08('0x64')]){duplicates+=0x1;delete _0x488236['duplicate'];}rows['push'](_0x488236);}));if(total%0xc8===0x0){_0x456f67['pause']();return processPromises(_0x456f67);}},'complete':function(){return processPromises()[_0xcf08('0x2b')](function(){logger[_0xcf08('0x60')](_0xcf08('0x65'));endCsv();});},'error':function(_0x4f4983,_0x422325){logger['info'](_0xcf08('0x66'),JSON[_0xcf08('0x58')](_0x4f4983));endCsv();}});})[_0xcf08('0x51')](function(_0x24d9ad){logger['error'](_0xcf08('0x67'),JSON['stringify'](_0x24d9ad));});}main(); \ No newline at end of file +var _0xc83d=['updatedAt','select','field','NOW()','toString','ListId','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','fromQuery','cm_contacts','id\x20IN\x20?','calleridnum','cm_hopper_final','str','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','VoiceQueue','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','contact','index','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xc83d,0xa6));var _0xdc83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc83d[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0xdc83('0x0'));var util=require(_0xdc83('0x1'));var _=require(_0xdc83('0x2'));var fs=require('fs');var squel=require(_0xdc83('0x3'));var Papa=require(_0xdc83('0x4'));var Redis=require(_0xdc83('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xdc83('0x6'));config[_0xdc83('0x7')]=_[_0xdc83('0x8')](config[_0xdc83('0x7')],{'host':_0xdc83('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdc83('0xa'))['register'](socket);try{if(!process[_0xdc83('0xb')][0x2]||process[_0xdc83('0xb')][0x2]==='undefined'||process['argv'][0x2]===_0xdc83('0xc')){throw new Error(_0xdc83('0xd'));}var FILEPATH=process[_0xdc83('0xb')][0x2];if(!process[_0xdc83('0xb')][0x3]||process[_0xdc83('0xb')][0x3]==='undefined'||process[_0xdc83('0xb')][0x3]===_0xdc83('0xc')||!process[_0xdc83('0xb')][0x4]||process[_0xdc83('0xb')][0x4]===_0xdc83('0xe')||process[_0xdc83('0xb')][0x4]===_0xdc83('0xc')){throw new Error(_0xdc83('0xf'));}var FIELDS=_[_0xdc83('0x10')](process['argv'][0x3][_0xdc83('0x11')](','),process[_0xdc83('0xb')][0x4]['split'](','));if(!process[_0xdc83('0xb')][0x5]||process[_0xdc83('0xb')][0x5]==='undefined'||process[_0xdc83('0xb')][0x5]===_0xdc83('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xdc83('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xdc83('0xb')][0x6]!==_0xdc83('0xe')&&process['argv'][0x6]!==_0xdc83('0xc')?process[_0xdc83('0xb')][0x6]:null;var DUPLICATES=process[_0xdc83('0xb')][0x7]&&process[_0xdc83('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!=='null'?process[_0xdc83('0xb')][0x7]:null;if(!process[_0xdc83('0xb')][0x8]||process['argv'][0x8]===_0xdc83('0xe')||process[_0xdc83('0xb')][0x8]===_0xdc83('0xc')){throw new Error(_0xdc83('0x12'));}var SOCKET_TIMESTAMP=process[_0xdc83('0xb')][0x8];}catch(_0x16e08d){logger['error'](_0x16e08d);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(_0x3ef6db,_0x5c1efd,_0x4a26b7,_0x4c08d4){var _0x4e48ee={'message':_0x5c1efd};_0x4e48ee[_0x3ef6db]=!![];if(_0x4a26b7){_0x4e48ee[_0xdc83('0x13')]=_0x4a26b7;}if(_0x4c08d4){_0x4e48ee[_0xdc83('0x14')]=_0x4c08d4;}return _0x4e48ee;}function isEmail(_0x551043){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x551043);}function checkRow(_0x373ef3,_0x44f8f6,_0x47a3bd){return new BPromise(function(_0x164dde,_0x13c328){if(_[_0xdc83('0x15')](_0x373ef3)){return _0x13c328(handleCheckRowError(_0xdc83('0x16'),_0xdc83('0x17'),null,_0x47a3bd));}if(_0x373ef3[_0xdc83('0x18')]&&_0x373ef3[_0xdc83('0x18')][_0xdc83('0x19')]){var _0x392ddb=_['map'](_0x373ef3[_0xdc83('0x18')],_0xdc83('0x1a'))[_0xdc83('0x1b')](';');return _0x13c328(handleCheckRowError(_0xdc83('0x16'),_0x392ddb,null,_0x47a3bd));}var _0x13b331={};for(var _0x29e9ca in FIELDS){if(FIELDS[_0xdc83('0x1c')](_0x29e9ca)&&FIELDS[_0x29e9ca]){_0x13b331[_0x29e9ca]=_0x373ef3['data'][0x0][FIELDS[_0x29e9ca]]||_0x373ef3[_0xdc83('0x1d')][0x0]['\ufeff'+FIELDS[_0x29e9ca]];}}if(!_0x13b331[_0xdc83('0x1e')]){return _0x13c328(handleCheckRowError(_0xdc83('0x16'),_0xdc83('0x1f'),null,_0x47a3bd));}if(!_0x13b331['phone']){return _0x13c328(handleCheckRowError(_0xdc83('0x16'),_0xdc83('0x20'),null,_0x47a3bd));}if(_0x13b331[_0xdc83('0x21')]){var _0x33008c=moment(_0x13b331['birthDate'],_0xdc83('0x22'));if(!_0x33008c[_0xdc83('0x23')]()){return _0x13c328(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x47a3bd));}}if(_0x13b331[_0xdc83('0x24')]){if(!isEmail(_0x13b331[_0xdc83('0x24')])){return _0x13c328(handleCheckRowError(_0xdc83('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x47a3bd));}}_0x13b331['ListId']=LISTID;_0x13b331['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x44f8f6){var _0x5e0512={};for(var _0x3b180a=0x0,_0x1de6b=DUPLICATES['length'];_0x3b180a<_0x1de6b;_0x3b180a+=0x1){_0x5e0512[DUPLICATES[_0x3b180a]]=_0x13b331[DUPLICATES[_0x3b180a]];}var _0x3fe626=_[_0xdc83('0x25')](_0x44f8f6,_0x5e0512);if(_0x3fe626){return _0x13c328(handleCheckRowError('duplicate',_0xdc83('0x26'),_0x3fe626,_0x47a3bd));}}return db[_0xdc83('0x27')][_0xdc83('0x28')](_0x13b331,{'raw':!![],'hooks':![],'fields':_[_0xdc83('0x29')](_0x13b331)})[_0xdc83('0x2a')](function(_0x598bf7){if(DUPLICATES&&DUPLICATES['length']&&_0x44f8f6){_0x44f8f6[_0xdc83('0x2b')](_[_0xdc83('0x2c')](_0x13b331,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x598bf7['id'];return _0x164dde();})[_0xdc83('0x2d')](function(_0x1e157b){return _0x13c328(handleCheckRowError(_0xdc83('0x16'),_0xdc83('0x2e')+(_0x1e157b[_0xdc83('0x1a')]||JSON[_0xdc83('0x2f')](_0x1e157b)),null,_0x47a3bd));});});}function checkHopper(){function _0x55b3ea(){return function(_0x2f3f38){logger['error'](_0xdc83('0x30'),_0xdc83('0x31'),util[_0xdc83('0x32')](_0x2f3f38,{'showHidden':![],'depth':null}));};}var _0x47d210=function(_0x39ac6d,_0x250e54){var _0x435cef=squel[_0xdc83('0x33')]()[_0xdc83('0x34')](_0xdc83('0x35'))['fromQuery']([_0xdc83('0x36'),_0xdc83('0x37'),_0xdc83('0x38'),'ListId',_0x250e54,_0xdc83('0x39'),_0xdc83('0x3a')],squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')]('phone',_0xdc83('0x36'))['field'](_0xdc83('0x3d'),_0xdc83('0x37'))[_0xdc83('0x3c')]('id',_0xdc83('0x38'))[_0xdc83('0x3c')](LISTID[_0xdc83('0x3e')](),_0xdc83('0x3f'))[_0xdc83('0x3c')](_0x39ac6d['id'][_0xdc83('0x3e')](),_0x250e54)[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x39'))['field'](_0xdc83('0x3d'),'updatedAt')['from']('cm_contacts')['where'](_0xdc83('0x40'))[_0xdc83('0x41')](_0xdc83('0x42'),LISTID['toString']())['where'](_0xdc83('0x43'))[_0xdc83('0x41')](_0xdc83('0x44'),squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')]('phone')[_0xdc83('0x45')]('cm_hopper')[_0xdc83('0x41')](_0x250e54+_0xdc83('0x46'),_0x39ac6d['id'][_0xdc83('0x3e')]())))[_0xdc83('0x3e')]();return _0x435cef;};var _0x4c8942=function(_0x39a2f5,_0x261048){var _0x25e53d=squel[_0xdc83('0x33')]()[_0xdc83('0x34')](_0xdc83('0x35'))[_0xdc83('0x47')]([_0xdc83('0x36'),_0xdc83('0x37'),_0xdc83('0x38'),_0xdc83('0x3f'),_0x261048,_0xdc83('0x39'),'updatedAt'],squel['select']()[_0xdc83('0x3c')]('phone',_0xdc83('0x36'))[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x37'))[_0xdc83('0x3c')]('id',_0xdc83('0x38'))[_0xdc83('0x3c')](LISTID[_0xdc83('0x3e')](),_0xdc83('0x3f'))[_0xdc83('0x3c')](_0x39a2f5['id']['toString'](),_0x261048)[_0xdc83('0x3c')]('NOW()',_0xdc83('0x39'))[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x3a'))['from'](_0xdc83('0x48'))[_0xdc83('0x41')]('deletedAt\x20IS\x20NULL')[_0xdc83('0x41')](_0xdc83('0x42'),LISTID[_0xdc83('0x3e')]())[_0xdc83('0x41')](_0xdc83('0x49'),squel['str'](hopperContacts))[_0xdc83('0x41')](_0xdc83('0x43'))[_0xdc83('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')](_0xdc83('0x4a'))[_0xdc83('0x45')](_0xdc83('0x4b'))[_0xdc83('0x41')](_0x261048+'\x20=\x20?',_0x39a2f5['id']['toString']()))[_0xdc83('0x41')](_0xdc83('0x44'),squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')](_0xdc83('0x36'))[_0xdc83('0x45')](_0xdc83('0x35'))['where'](_0x261048+_0xdc83('0x46'),_0x39a2f5['id']['toString']())))[_0xdc83('0x3e')]();return _0x25e53d;};function _0x3c25e6(_0x1161bc,_0x3c64f2){var _0x514a0b=squel[_0xdc83('0x33')]()[_0xdc83('0x34')](_0xdc83('0x35'))[_0xdc83('0x47')]([_0xdc83('0x36'),'scheduledAt',_0xdc83('0x38'),_0xdc83('0x3f'),_0x3c64f2,_0xdc83('0x39'),_0xdc83('0x3a')],squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')]('phone',_0xdc83('0x36'))[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x37'))[_0xdc83('0x3c')]('id',_0xdc83('0x38'))[_0xdc83('0x3c')](LISTID[_0xdc83('0x3e')](),_0xdc83('0x3f'))[_0xdc83('0x3c')](_0x1161bc['id'][_0xdc83('0x3e')](),_0x3c64f2)['field'](_0xdc83('0x3d'),_0xdc83('0x39'))[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x3a'))[_0xdc83('0x45')](_0xdc83('0x48'))[_0xdc83('0x41')](_0xdc83('0x40'))['where']('ListId\x20=\x20?',LISTID[_0xdc83('0x3e')]())[_0xdc83('0x41')]('id\x20IN\x20?',squel[_0xdc83('0x4c')](hopperContacts))[_0xdc83('0x41')](_0xdc83('0x43')))[_0xdc83('0x3e')]();return _0x514a0b;}function _0xf6797e(_0x5c35ad,_0x39bd82){var _0x4d1775=squel[_0xdc83('0x33')]()[_0xdc83('0x34')]('cm_hopper_black')[_0xdc83('0x47')]([_0xdc83('0x36'),_0xdc83('0x38'),_0xdc83('0x3f'),_0x39bd82,_0xdc83('0x39'),'updatedAt'],squel[_0xdc83('0x3b')]()[_0xdc83('0x3c')](_0xdc83('0x36'),'phone')[_0xdc83('0x3c')]('id',_0xdc83('0x38'))[_0xdc83('0x3c')](LISTID[_0xdc83('0x3e')](),_0xdc83('0x3f'))['field'](_0x5c35ad['id'][_0xdc83('0x3e')](),_0x39bd82)['field'](_0xdc83('0x3d'),'createdAt')[_0xdc83('0x3c')](_0xdc83('0x3d'),_0xdc83('0x3a'))['from'](_0xdc83('0x48'))['where'](_0xdc83('0x40'))[_0xdc83('0x41')](_0xdc83('0x42'),LISTID[_0xdc83('0x3e')]())[_0xdc83('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xdc83('0x41')](_0xdc83('0x43')))['toString']();return _0x4d1775;}return db['VoiceQueue'][_0xdc83('0x4d')]({'where':{'type':_0xdc83('0x4e')},'attributes':['id',_0xdc83('0x4f')],'include':[{'model':db[_0xdc83('0x50')],'as':_0xdc83('0x51'),'where':{'id':LISTID}}]})[_0xdc83('0x2a')](function(_0x16162a){var _0x3c1336=[];if(_0x16162a){var _0x1006e6;for(var _0x5435a9=0x0,_0x5b8d4c;_0x5435a9<_0x16162a[_0xdc83('0x19')];_0x5435a9+=0x1){_0x5b8d4c=_0x16162a[_0x5435a9]['get']({'plain':!![]});switch(_0x5b8d4c[_0xdc83('0x4f')]){case _0xdc83('0x52'):_0x3c1336[_0xdc83('0x2b')](db[_0xdc83('0x53')][_0xdc83('0x54')](_0x4c8942(_0x5b8d4c,'VoiceQueueId'))[_0xdc83('0x2a')](function(){})[_0xdc83('0x2d')](_0x55b3ea()));break;case _0xdc83('0x55'):_0x3c1336[_0xdc83('0x2b')](db['sequelize'][_0xdc83('0x54')](_0x47d210(_0x5b8d4c,_0xdc83('0x56')))[_0xdc83('0x2a')](function(){})[_0xdc83('0x2d')](_0x55b3ea()));break;default:_0x3c1336[_0xdc83('0x2b')](db['sequelize']['query'](_0x3c25e6(_0x5b8d4c,_0xdc83('0x56')))[_0xdc83('0x2a')](function(){})[_0xdc83('0x2d')](_0x55b3ea()));}}}return _0x3c1336;})[_0xdc83('0x57')]()['then'](function(){return db[_0xdc83('0x58')][_0xdc83('0x4d')]({'where':{'type':_0xdc83('0x4e')},'attributes':['id'],'include':[{'model':db[_0xdc83('0x50')],'as':_0xdc83('0x59'),'where':{'id':LISTID}}]})[_0xdc83('0x2a')](function(_0x4aba4a){var _0x262a90=[];if(_0x4aba4a){var _0x1df7e9;for(var _0x3d1448=0x0,_0x2cdfb4;_0x3d1448<_0x4aba4a[_0xdc83('0x19')];_0x3d1448+=0x1){_0x2cdfb4=_0x4aba4a[_0x3d1448][_0xdc83('0x5a')]({'plain':!![]});_0x262a90[_0xdc83('0x2b')](db[_0xdc83('0x53')][_0xdc83('0x54')](_0xf6797e(_0x2cdfb4,_0xdc83('0x56')))[_0xdc83('0x2a')](function(){})['catch'](_0x55b3ea()));}}return _0x262a90;})[_0xdc83('0x57')]();})[_0xdc83('0x2a')](function(){return db[_0xdc83('0x5b')]['findAll']({'attributes':['id',_0xdc83('0x4f')],'include':[{'model':db['CmList'],'as':_0xdc83('0x51'),'where':{'id':LISTID}}]})[_0xdc83('0x2a')](function(_0x194db8){var _0x137599=[];if(_0x194db8){for(var _0x27ceb6=0x0,_0x45665e;_0x27ceb6<_0x194db8['length'];_0x27ceb6+=0x1){_0x45665e=_0x194db8[_0x27ceb6][_0xdc83('0x5a')]({'plain':!![]});switch(_0x45665e[_0xdc83('0x4f')]){case _0xdc83('0x52'):_0x137599[_0xdc83('0x2b')](db[_0xdc83('0x53')]['query'](_0x4c8942(_0x45665e,_0xdc83('0x5c')))[_0xdc83('0x2a')](function(){})['catch'](_0x55b3ea()));break;case _0xdc83('0x55'):_0x137599[_0xdc83('0x2b')](db[_0xdc83('0x53')][_0xdc83('0x54')](_0x47d210(_0x45665e,_0xdc83('0x5c')))[_0xdc83('0x2a')](function(){})['catch'](_0x55b3ea()));break;default:_0x137599[_0xdc83('0x2b')](db['sequelize']['query'](_0x3c25e6(_0x45665e,_0xdc83('0x5c')))[_0xdc83('0x2a')](function(){})['catch'](_0x55b3ea()));}}}return _0x137599;})[_0xdc83('0x57')]();})[_0xdc83('0x2a')](function(){return db[_0xdc83('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xdc83('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x348a92){var _0x4e158e=[];if(_0x348a92){for(var _0x1448f6=0x0,_0x3cda2b;_0x1448f6<_0x348a92['length'];_0x1448f6+=0x1){_0x3cda2b=_0x348a92[_0x1448f6]['get']({'plain':!![]});_0x4e158e[_0xdc83('0x2b')](db[_0xdc83('0x53')][_0xdc83('0x54')](_0xf6797e(_0x3cda2b,_0xdc83('0x5c')))[_0xdc83('0x2a')](function(){})[_0xdc83('0x2d')](_0x55b3ea()));}}return _0x4e158e;})[_0xdc83('0x57')]();})['catch'](function(_0x2cd817){logger['error'](_0xdc83('0x5d'),_0xdc83('0x5e'),_0x2cd817['message']);});}var processPromises=function(_0x33d1aa){return BPromise['all'](promises)[_0xdc83('0x2a')](function(_0x1cdb2b){})[_0xdc83('0x2d')](function(_0x52b444){logger[_0xdc83('0x16')](_0xdc83('0x5f'),JSON[_0xdc83('0x2f')](_0x52b444));})[_0xdc83('0x60')](function(){socket[_0xdc83('0x61')](_0xdc83('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x33d1aa){return _0x33d1aa[_0xdc83('0x63')]();}});};var endCsv=function(){return BPromise[_0xdc83('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xdc83('0x2a')](function(){socket['emit'](_0xdc83('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdc83('0x65')](FILEPATH);}catch(_0x28fb8a){logger[_0xdc83('0x16')](_0xdc83('0x66'),JSON[_0xdc83('0x2f')](_0x28fb8a));}finally{process[_0xdc83('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0xdc83('0x68')](_0xdc83('0x69'));endCsv();});function main(){return BPromise[_0xdc83('0x64')]()[_0xdc83('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xdc83('0x11')](',');return db[_0xdc83('0x27')][_0xdc83('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xdc83('0x2a')](function(_0x55caaf){var _0x33ee2a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdc83('0x6a')](_0x33ee2a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x19335a,_0x5c3bf7){total+=0x1;var _0x552b52=total;promises[_0xdc83('0x2b')](checkRow(_0x19335a,_0x55caaf,_0x552b52)['then'](function(){success+=0x1;})[_0xdc83('0x2d')](function(_0x5adae6){if(_0x5adae6['error']){errors+=0x1;delete _0x5adae6[_0xdc83('0x16')];}else if(_0x5adae6[_0xdc83('0x6b')]){duplicates+=0x1;delete _0x5adae6[_0xdc83('0x6b')];}rows['push'](_0x5adae6);}));if(total%0xc8===0x0){_0x5c3bf7[_0xdc83('0x6c')]();return processPromises(_0x5c3bf7);}},'complete':function(){return processPromises()['then'](function(){logger[_0xdc83('0x68')](_0xdc83('0x6d'));endCsv();});},'error':function(_0x3b909f,_0x7d15c){logger[_0xdc83('0x68')](_0xdc83('0x6e'),JSON[_0xdc83('0x2f')](_0x3b909f));endCsv();}});})[_0xdc83('0x2d')](function(_0x5d7e4c){logger['error'](_0xdc83('0x6f'),JSON[_0xdc83('0x2f')](_0x5d7e4c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index bf1cff6..927d9db 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 _0xea42=['cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','fromQuery','.CmListId','field','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','error','exit','push','code','sequelize','query','spread','catch','main','stringify','send','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','errors','trim','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','message','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','import','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20('];(function(_0x395a60,_0x545b3a){var _0x361b6f=function(_0x21d38a){while(--_0x21d38a){_0x395a60['push'](_0x395a60['shift']());}};_0x361b6f(++_0x545b3a);}(_0xea42,0x1e4));var _0x2ea4=function(_0x3d308c,_0x443813){_0x3d308c=_0x3d308c-0x0;var _0x166a2c=_0xea42[_0x3d308c];return _0x166a2c;};'use strict';var fs=require('fs');var path=require(_0x2ea4('0x0'));var _=require(_0x2ea4('0x1'));var Papa=require(_0x2ea4('0x2'));var util=require(_0x2ea4('0x3'));var BPromise=require(_0x2ea4('0x4'));var moment=require(_0x2ea4('0x5'));var squel=require(_0x2ea4('0x6'));var Redis=require(_0x2ea4('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x2ea4('0x8'));var logger=require('../../../config/logger')(_0x2ea4('0x9'));config['redis']=_[_0x2ea4('0xa')](config['redis'],{'host':_0x2ea4('0xb'),'port':0x18eb});var socket=require(_0x2ea4('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2ea4('0xd')](_0x2ea4('0xe'));function isEmail(_0x25294d){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))*$/[_0x2ea4('0xf')](_0x25294d);}function selectNotIn(_0x7c816d,_0x559b84,_0xbc812f,_0x507308,_0x59d1cd){return squel[_0x2ea4('0x10')]()['field'](_0x2ea4('0x11'))[_0x2ea4('0x12')](_0x507308)[_0x2ea4('0x13')](_0x559b84,null,_0x559b84+_0x2ea4('0x14')+_0x507308+'.'+_0xbc812f)[_0x2ea4('0x15')](_0x507308+'.'+_0xbc812f+_0x2ea4('0x16')+_0x7c816d+'.'+_0xbc812f)[_0x2ea4('0x15')](_0x559b84+_0x2ea4('0x17')+_0x59d1cd[_0x2ea4('0x13')]()+')');}function insertCmHopper(_0x34633c,_0x3b0418,_0x3f56e3,_0x76843a,_0x4eeebe){var _0x1b1817=[_0x2ea4('0x18'),_0x2ea4('0x19'),_0x2ea4('0x1a'),_0x2ea4('0x1b'),_0x3b0418+'.'+_0x76843a,_0x2ea4('0x1c'),_0x2ea4('0x1d'),_0x2ea4('0x1e'),'cm_contacts.UserId','\x22'+_0x4eeebe+'\x22'];return squel[_0x2ea4('0x1f')]()[_0x2ea4('0x20')](_0x2ea4('0x21'))['fromQuery']([_0x2ea4('0x11'),_0x2ea4('0x22'),_0x2ea4('0x23'),_0x2ea4('0x24'),_0x76843a,_0x2ea4('0x25'),_0x2ea4('0x26'),'priority',_0x2ea4('0x27'),_0x2ea4('0x28')],squel[_0x2ea4('0x10')]()[_0x2ea4('0x29')](_0x1b1817)[_0x2ea4('0x12')](_0x3b0418)['join'](_0x2ea4('0x2a'),null,_0x2ea4('0x2b')+_0x3b0418+'.CmListId')[_0x2ea4('0x13')](_0x3f56e3,null,_0x3f56e3+'.id\x20=\x20'+_0x3b0418+'.'+_0x76843a)[_0x2ea4('0x15')](_0x3b0418+_0x2ea4('0x2c'),_0x34633c)[_0x2ea4('0x15')](_0x2ea4('0x2d'),NOW)[_0x2ea4('0x15')](_0x2ea4('0x2e'),selectNotIn(_0x3b0418,_0x3f56e3,_0x76843a,_0x2ea4('0x21'),['\x22always\x22',_0x2ea4('0x2f')]))[_0x2ea4('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3b0418,_0x3f56e3,_0x76843a,_0x2ea4('0x21'),[_0x2ea4('0x30')])))[_0x2ea4('0x31')]();}function insertCmHopperBlack(_0x351275,_0x199fe9,_0x522352,_0x2f9ec7){var _0x2ba418=[_0x2ea4('0x18'),'cm_contacts.id','cm_contacts.ListId',_0x199fe9+'.'+_0x2f9ec7,'cm_contacts.createdAt',_0x2ea4('0x1d')];return squel[_0x2ea4('0x1f')]()[_0x2ea4('0x20')](_0x2ea4('0x32'))[_0x2ea4('0x33')]([_0x2ea4('0x11'),_0x2ea4('0x23'),_0x2ea4('0x24'),_0x2f9ec7,_0x2ea4('0x25'),_0x2ea4('0x26')],squel[_0x2ea4('0x10')]()[_0x2ea4('0x29')](_0x2ba418)[_0x2ea4('0x12')](_0x199fe9)[_0x2ea4('0x13')](_0x2ea4('0x2a'),null,'cm_contacts.ListId\x20=\x20'+_0x199fe9+_0x2ea4('0x34'))[_0x2ea4('0x13')](_0x522352,null,_0x522352+'.id\x20=\x20'+_0x199fe9+'.'+_0x2f9ec7)['where'](_0x199fe9+_0x2ea4('0x2c'),_0x351275)[_0x2ea4('0x15')](_0x2ea4('0x2d'),NOW)[_0x2ea4('0x15')](_0x2ea4('0x2e'),squel['select']()[_0x2ea4('0x35')](_0x2ea4('0x11'))['from'](_0x2ea4('0x32'))[_0x2ea4('0x15')](_0x2ea4('0x36'),_0x351275)[_0x2ea4('0x15')](_0x2f9ec7+'\x20=\x20?',_0x199fe9+'.'+_0x2f9ec7)))[_0x2ea4('0x31')]();}function insertCmContact(_0x2e224b,_0x456e06,_0x3c7f8e,_0x29e52d){var _0x5bf58f=_[_0x2ea4('0x37')](_[_0x2ea4('0x38')](_0x29e52d),['ListId',_0x2ea4('0x39'),_0x2ea4('0x25'),_0x2ea4('0x26')]);return squel[_0x2ea4('0x1f')]()[_0x2ea4('0x20')](_0x2ea4('0x2a'))[_0x2ea4('0x33')](_0x5bf58f,squel['select']()[_0x2ea4('0x29')](_0x5bf58f)['from'](_0x456e06)[_0x2ea4('0x15')]('('+_0x3c7f8e['join'](',')+_0x2ea4('0x3a'),squel['select']()[_0x2ea4('0x29')](_0x3c7f8e)['from']('cm_contacts')[_0x2ea4('0x15')](_0x2ea4('0x36'),_0x2e224b))[_0x2ea4('0x15')]('id\x20IN\x20?',squel[_0x2ea4('0x10')]()['field'](_0x2ea4('0x3b'),_0x2ea4('0x3c'))[_0x2ea4('0x12')](_0x456e06)['group'](_0x3c7f8e['join'](','))))[_0x2ea4('0x31')]();}function handleStop(){logger[_0x2ea4('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x18cd91){logger[_0x2ea4('0x3e')](_0x18cd91['message']);process[_0x2ea4('0x3f')](0x1);}function handleError(_0x382d1b,_0x5a7f38){stats['errors'][_0x2ea4('0x40')]({'name':_0x5a7f38[_0x2ea4('0x41')],'message':_0x5a7f38['message'],'row':_0x382d1b});}function handleQuery(_0x2f721a){logger[_0x2ea4('0x3d')](_0x2f721a);return db[_0x2ea4('0x42')][_0x2ea4('0x43')](_0x2f721a)[_0x2ea4('0x44')](function(_0x4c1d88){results[_0x2ea4('0x40')](_0x4c1d88);})[_0x2ea4('0x45')](function(_0x412eab){logger[_0x2ea4('0x3e')](_0x412eab['message']);});}function main(_0x51d46a,_0xaac3c1,_0x18e2f7,_0x3b1123){logger[_0x2ea4('0x3d')](_0x2ea4('0x46'),_0x51d46a,JSON[_0x2ea4('0x47')](_0xaac3c1));process[_0x2ea4('0x48')]('start');var _0x550d0f=_0xaac3c1['binding'];var _0x1c906a=_0xaac3c1[_0x2ea4('0x49')];var _0x59aa01=path['join'](config[_0x2ea4('0x4a')],_0x2ea4('0x4b'),_0x1c906a+_0x2ea4('0x4c'));var _0x4ddab6=_[_0x2ea4('0x38')](_0x550d0f)[_0x2ea4('0x13')]();logger[_0x2ea4('0x3d')](_0x2ea4('0x4d'),_0x4ddab6);fs[_0x2ea4('0x4e')](_0x59aa01,_0x4ddab6+'\x0a');Papa[_0x2ea4('0x4f')](fs[_0x2ea4('0x50')](_0x51d46a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x9032cf,_0x120105){try{for(var _0x43e45d=0x0,_0x27ab15=[];_0x43e45d<_0x9032cf[_0x2ea4('0x51')][_0x2ea4('0x52')];_0x43e45d++){stats[_0x2ea4('0x53')]+=0x1;if(_0x9032cf[_0x2ea4('0x54')][_0x43e45d]){handleError(_0x9032cf[_0x2ea4('0x51')][_0x43e45d],_0x9032cf[_0x2ea4('0x54')][_0x43e45d]);}else{var _0x9bc94=[];for(var _0x428fd8 in _0x550d0f){if(_0x550d0f['hasOwnProperty'](_0x428fd8)){if(_0x9032cf[_0x2ea4('0x51')][_0x43e45d][_0x550d0f[_0x428fd8]]){var _0x180fd3=_[_0x2ea4('0x55')](_0x9032cf[_0x2ea4('0x51')][_0x43e45d][_0x550d0f[_0x428fd8]]['replace'](/"/g,'\x27'));switch(_0x428fd8){case _0x2ea4('0x22'):var _0x59d192=moment(_0x180fd3,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x59d192[_0x2ea4('0x56')]()){_0x27ab15['push']('\x22'+_0x180fd3+'\x22');}else{_0x9bc94['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x13ea1a=parseInt(_0x180fd3);_0x180fd3=_[_0x2ea4('0x57')](_0x13ea1a)||_0x13ea1a<0x0||_0x13ea1a>0x4?_0x3b1123?0x3:0x2:_0x13ea1a;_0x27ab15[_0x2ea4('0x40')]('\x22'+_0x180fd3+'\x22');break;case _0x2ea4('0x27'):var _0x21a97a=parseInt(_0x180fd3);if(_[_0x2ea4('0x58')](_0x21a97a)&&_[_0x2ea4('0x59')](_0x18e2f7,_0x21a97a)){_0x27ab15[_0x2ea4('0x40')]('\x22'+_0x21a97a+'\x22');}else{_0x9bc94[_0x2ea4('0x40')](_0x2ea4('0x5a'));}break;case'email':if(isEmail(_0x180fd3)){_0x27ab15[_0x2ea4('0x40')]('\x22'+_0x180fd3+'\x22');}else{_0x9bc94[_0x2ea4('0x40')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0xcb67cc=moment(_0x180fd3,'YYYY-MM-DD',!![]);if(_0xcb67cc['isValid']()){_0x27ab15[_0x2ea4('0x40')]('\x22'+_0x180fd3+'\x22');}else{_0x9bc94[_0x2ea4('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x27ab15['push']('\x22'+_0x180fd3+'\x22');}}else{switch(_0x428fd8){case _0x2ea4('0x5b'):case _0x2ea4('0x11'):_0x9bc94['push'](_0x428fd8+'\x20not\x20specified');break;default:_0x27ab15[_0x2ea4('0x40')]('\x22\x22');}}}}if(_0x9bc94['length']){handleError(_0x9032cf['data'][_0x43e45d],{'code':_0x2ea4('0x5c'),'message':_0x9bc94[_0x2ea4('0x13')]()});}else{fs[_0x2ea4('0x5d')](_0x59aa01,_0x27ab15[_0x2ea4('0x13')]()+'\x0a');}_0x27ab15=[];}if(!(stats[_0x2ea4('0x53')]%0xc8)){socket[_0x2ea4('0x5e')](_0x2ea4('0x5f')+_0x1c906a,stats);stats[_0x2ea4('0x54')]=[];}}if(stopped){logger[_0x2ea4('0x3d')](_0x2ea4('0x60'));_0x120105[_0x2ea4('0x61')]();}}catch(_0x15ba0a){handleError(_0x9032cf['data'][_0x43e45d],{'code':_0x2ea4('0x62'),'message':_0x15ba0a[_0x2ea4('0x63')]});logger[_0x2ea4('0x3e')](_0x2ea4('0x64'),_0x15ba0a['message']);}},'complete':function(){try{var _0x320878=[];var _0x2a2893=_0x2ea4('0x2a');if(_0xaac3c1['duplicates']&&_0xaac3c1[_0x2ea4('0x65')][_0x2ea4('0x52')]){_0x2a2893=_0x2ea4('0x66')+_0x1c906a;_0x320878[_0x2ea4('0x40')](_0x2ea4('0x67')+_0x2a2893+_0x2ea4('0x68'));}var _0x35878a=util[_0x2ea4('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',_0x59aa01,_0x2a2893,_0x4ddab6,_0xaac3c1['ListId'],_0xaac3c1[_0x2ea4('0x39')]||null,NOW,NOW);if(_[_0x2ea4('0x69')](_0x550d0f[_0x2ea4('0x22')])){_0x35878a+=',\x20scheduledAt\x20=\x20NOW()';}_0x320878[_0x2ea4('0x40')](_0x35878a);if(_0xaac3c1[_0x2ea4('0x65')]&&_0xaac3c1[_0x2ea4('0x65')]['length']){_0x320878['push'](insertCmContact(_0xaac3c1[_0x2ea4('0x24')],_0x2a2893,_0xaac3c1[_0x2ea4('0x65')],_0x550d0f));_0x320878[_0x2ea4('0x40')](_0x2ea4('0x6a')+_0x2a2893+';');}_0x320878[_0x2ea4('0x40')](insertCmHopper(_0xaac3c1[_0x2ea4('0x24')],'voice_queues_has_cm_lists',_0x2ea4('0x6b'),'VoiceQueueId',_0x3b1123));_0x320878[_0x2ea4('0x40')](insertCmHopperBlack(_0xaac3c1[_0x2ea4('0x24')],'voice_queues_has_cm_blacklists',_0x2ea4('0x6b'),_0x2ea4('0x6c')));_0x320878[_0x2ea4('0x40')](insertCmHopper(_0xaac3c1[_0x2ea4('0x24')],_0x2ea4('0x6d'),'campaigns','CampaignId',_0x3b1123));_0x320878[_0x2ea4('0x40')](insertCmHopperBlack(_0xaac3c1[_0x2ea4('0x24')],'campaigns_has_cm_blacklists',_0x2ea4('0x6e'),_0x2ea4('0x6f')));BPromise[_0x2ea4('0x70')](_0x320878,handleQuery)['then'](function(_0x5b2941){stats[_0x2ea4('0x71')]=!![];stats[_0x2ea4('0x72')]=_0xaac3c1[_0x2ea4('0x65')]&&_0xaac3c1[_0x2ea4('0x65')][_0x2ea4('0x52')]?results[0x2][_0x2ea4('0x72')]:results[0x0][_0x2ea4('0x72')];socket[_0x2ea4('0x5e')](_0x2ea4('0x5f')+_0x1c906a,stats);fs['unlink'](_0x51d46a);fs[_0x2ea4('0x73')](_0x59aa01);process['exit'](0x0);})[_0x2ea4('0x45')](function(_0x4d28af){logger['error'](_0x4d28af[_0x2ea4('0x63')]);process[_0x2ea4('0x3f')](0x1);});}catch(_0x5cc593){logger['error'](_0x2ea4('0x74'),_0x5cc593[_0x2ea4('0x63')]);process[_0x2ea4('0x3f')](0x1);}},'error':function(_0x15478d,_0x4e1cda,_0x44873b,_0x419dbd){throw new Error(_0x419dbd);}});}function validate(){if(process[_0x2ea4('0x75')]&&process[_0x2ea4('0x75')][_0x2ea4('0x52')]<0x4){throw new Error(_0x2ea4('0x76'));}var _0x6101f3=path[_0x2ea4('0x13')](config[_0x2ea4('0x4a')],_0x2ea4('0x4b'),process[_0x2ea4('0x75')][0x2]);if(!fs['existsSync'](_0x6101f3)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3215be={};try{_0x3215be=JSON['parse'](process[_0x2ea4('0x75')][0x3]);if(!_0x3215be[_0x2ea4('0x77')]){throw new Error(_0x2ea4('0x78'));}if(!_0x3215be[_0x2ea4('0x77')][_0x2ea4('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x3215be[_0x2ea4('0x77')][_0x2ea4('0x5b')]){throw new Error(_0x2ea4('0x79'));}var _0x58ffb8=0x0;if(_0x3215be[_0x2ea4('0x77')]['UserId']){_0x58ffb8=0x1;}if(!_0x3215be[_0x2ea4('0x24')]){throw new Error(_0x2ea4('0x7a'));}}catch(_0x58af66){throw new Error(_0x2ea4('0x7b'));}var _0x2e2a99=[];try{_0x2e2a99=_[_0x2ea4('0x7c')](JSON['parse'](process[_0x2ea4('0x75')][0x4]),'id');}catch(_0x360845){logger['info'](_0x2ea4('0x7d'));}main(_0x6101f3,_0x3215be,_0x2e2a99,_0x58ffb8);}validate();process['on'](_0x2ea4('0x7e'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xcb36=['bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','select','phone','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','fields','from','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','updatedAt','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','Received\x20SIGINT','message','exit','push','code','query','catch','error','main','send','binding','root','server/files/tmp','keys','info','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','firstName','\x20not\x20specified','emit','contact:import:','errors','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','path','lodash','util'];(function(_0x50d471,_0x2d9086){var _0x214900=function(_0x413fa1){while(--_0x413fa1){_0x50d471['push'](_0x50d471['shift']());}};_0x214900(++_0x2d9086);}(_0xcb36,0x103));var _0x6cb3=function(_0x54570e,_0x2db833){_0x54570e=_0x54570e-0x0;var _0x2ad685=_0xcb36[_0x54570e];return _0x2ad685;};'use strict';var fs=require('fs');var path=require(_0x6cb3('0x0'));var _=require(_0x6cb3('0x1'));var Papa=require('papaparse');var util=require(_0x6cb3('0x2'));var BPromise=require(_0x6cb3('0x3'));var moment=require(_0x6cb3('0x4'));var squel=require('squel');var Redis=require(_0x6cb3('0x5'));var db=require(_0x6cb3('0x6'))['db'];var config=require(_0x6cb3('0x7'));var logger=require(_0x6cb3('0x8'))(_0x6cb3('0x9'));config[_0x6cb3('0xa')]=_['defaults'](config['redis'],{'host':_0x6cb3('0xb'),'port':0x18eb});var socket=require(_0x6cb3('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6cb3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1e3e6a){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1e3e6a);}function selectNotIn(_0xd840b3,_0x6b7f4c,_0x1b2783,_0x586243,_0x38b69b){return squel[_0x6cb3('0xe')]()['field'](_0x6cb3('0xf'))['from'](_0x586243)['join'](_0x6b7f4c,null,_0x6b7f4c+'.id\x20=\x20'+_0x586243+'.'+_0x1b2783)[_0x6cb3('0x10')](_0x586243+'.'+_0x1b2783+_0x6cb3('0x11')+_0xd840b3+'.'+_0x1b2783)[_0x6cb3('0x10')](_0x6b7f4c+_0x6cb3('0x12')+_0x38b69b[_0x6cb3('0x13')]()+')');}function insertCmHopper(_0xb95142,_0x1bb3e1,_0x10f3d3,_0x4d7a1f,_0x3b7118){var _0x3f770f=[_0x6cb3('0x14'),_0x6cb3('0x15'),_0x6cb3('0x16'),'cm_contacts.ListId',_0x1bb3e1+'.'+_0x4d7a1f,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x6cb3('0x17'),_0x6cb3('0x18'),'\x22'+_0x3b7118+'\x22'];return squel[_0x6cb3('0x19')]()[_0x6cb3('0x1a')](_0x6cb3('0x1b'))[_0x6cb3('0x1c')]([_0x6cb3('0xf'),_0x6cb3('0x1d'),_0x6cb3('0x1e'),_0x6cb3('0x1f'),_0x4d7a1f,_0x6cb3('0x20'),'updatedAt',_0x6cb3('0x21'),_0x6cb3('0x22'),'recallme'],squel[_0x6cb3('0xe')]()[_0x6cb3('0x23')](_0x3f770f)[_0x6cb3('0x24')](_0x1bb3e1)['join']('cm_contacts',null,_0x6cb3('0x25')+_0x1bb3e1+'.CmListId')['join'](_0x10f3d3,null,_0x10f3d3+_0x6cb3('0x26')+_0x1bb3e1+'.'+_0x4d7a1f)[_0x6cb3('0x10')](_0x1bb3e1+'.CmListId\x20=\x20?',_0xb95142)[_0x6cb3('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6cb3('0x10')](_0x6cb3('0x27'),selectNotIn(_0x1bb3e1,_0x10f3d3,_0x4d7a1f,_0x6cb3('0x1b'),[_0x6cb3('0x28'),_0x6cb3('0x29')]))[_0x6cb3('0x10')](_0x6cb3('0x27'),selectNotIn(_0x1bb3e1,_0x10f3d3,_0x4d7a1f,_0x6cb3('0x1b'),[_0x6cb3('0x28')])))[_0x6cb3('0x2a')]();}function insertCmHopperBlack(_0xc1bff,_0x3cb02b,_0x154005,_0x39267a){var _0x3826ed=['cm_contacts.phone','cm_contacts.id',_0x6cb3('0x2b'),_0x3cb02b+'.'+_0x39267a,_0x6cb3('0x2c'),'cm_contacts.updatedAt'];return squel[_0x6cb3('0x19')]()[_0x6cb3('0x1a')](_0x6cb3('0x2d'))['fromQuery']([_0x6cb3('0xf'),_0x6cb3('0x1e'),_0x6cb3('0x1f'),_0x39267a,_0x6cb3('0x20'),_0x6cb3('0x2e')],squel[_0x6cb3('0xe')]()[_0x6cb3('0x23')](_0x3826ed)[_0x6cb3('0x24')](_0x3cb02b)[_0x6cb3('0x13')](_0x6cb3('0x2f'),null,_0x6cb3('0x25')+_0x3cb02b+_0x6cb3('0x30'))[_0x6cb3('0x13')](_0x154005,null,_0x154005+'.id\x20=\x20'+_0x3cb02b+'.'+_0x39267a)['where'](_0x3cb02b+_0x6cb3('0x31'),_0xc1bff)[_0x6cb3('0x10')](_0x6cb3('0x32'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6cb3('0xe')]()[_0x6cb3('0x33')]('phone')[_0x6cb3('0x24')]('cm_hopper_black')[_0x6cb3('0x10')](_0x6cb3('0x34'),_0xc1bff)[_0x6cb3('0x10')](_0x39267a+_0x6cb3('0x35'),_0x3cb02b+'.'+_0x39267a)))[_0x6cb3('0x2a')]();}function insertCmContact(_0x28344f,_0x5cf807,_0x9354c9,_0x3b7437){var _0x21486a=_[_0x6cb3('0x36')](_['keys'](_0x3b7437),['ListId',_0x6cb3('0x37'),_0x6cb3('0x20'),_0x6cb3('0x2e')]);return squel[_0x6cb3('0x19')]()[_0x6cb3('0x1a')](_0x6cb3('0x2f'))['fromQuery'](_0x21486a,squel[_0x6cb3('0xe')]()[_0x6cb3('0x23')](_0x21486a)[_0x6cb3('0x24')](_0x5cf807)['where']('('+_0x9354c9['join'](',')+_0x6cb3('0x38'),squel['select']()['fields'](_0x9354c9)['from'](_0x6cb3('0x2f'))[_0x6cb3('0x10')](_0x6cb3('0x34'),_0x28344f))['where'](_0x6cb3('0x39'),squel[_0x6cb3('0xe')]()['field']('MIN(id)',_0x6cb3('0x3a'))[_0x6cb3('0x24')](_0x5cf807)['group'](_0x9354c9[_0x6cb3('0x13')](','))))[_0x6cb3('0x2a')]();}function handleStop(){logger['info'](_0x6cb3('0x3b'));stopped=!![];}function handleUncaughtException(_0x53a0ef){logger['error'](_0x53a0ef[_0x6cb3('0x3c')]);process[_0x6cb3('0x3d')](0x1);}function handleError(_0x649717,_0x5e28a2){stats['errors'][_0x6cb3('0x3e')]({'name':_0x5e28a2[_0x6cb3('0x3f')],'message':_0x5e28a2[_0x6cb3('0x3c')],'row':_0x649717});}function handleQuery(_0x3ff629){logger['info'](_0x3ff629);return db['sequelize'][_0x6cb3('0x40')](_0x3ff629)['spread'](function(_0x3cd17a){results[_0x6cb3('0x3e')](_0x3cd17a);})[_0x6cb3('0x41')](function(_0x2943bd){logger[_0x6cb3('0x42')](_0x2943bd[_0x6cb3('0x3c')]);});}function main(_0x3cde8c,_0x273af9,_0x25b547,_0x1f436f){logger['info'](_0x6cb3('0x43'),_0x3cde8c,JSON['stringify'](_0x273af9));process[_0x6cb3('0x44')]('start');var _0x50551e=_0x273af9[_0x6cb3('0x45')];var _0x516370=_0x273af9['socket_timestamp'];var _0x2a640b=path[_0x6cb3('0x13')](config[_0x6cb3('0x46')],_0x6cb3('0x47'),_0x516370+'.csv');var _0x5a0f52=_[_0x6cb3('0x48')](_0x50551e)[_0x6cb3('0x13')]();logger[_0x6cb3('0x49')](_0x6cb3('0x4a'),_0x5a0f52);fs[_0x6cb3('0x4b')](_0x2a640b,_0x5a0f52+'\x0a');Papa['parse'](fs[_0x6cb3('0x4c')](_0x3cde8c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x22e874,_0x58e580){try{for(var _0x4603a6=0x0,_0x55a338=[];_0x4603a6<_0x22e874[_0x6cb3('0x4d')][_0x6cb3('0x4e')];_0x4603a6++){stats[_0x6cb3('0x4f')]+=0x1;if(_0x22e874['errors'][_0x4603a6]){handleError(_0x22e874[_0x6cb3('0x4d')][_0x4603a6],_0x22e874['errors'][_0x4603a6]);}else{var _0x3a59b9=[];for(var _0x135c21 in _0x50551e){if(_0x50551e[_0x6cb3('0x50')](_0x135c21)){if(_0x22e874[_0x6cb3('0x4d')][_0x4603a6][_0x50551e[_0x135c21]]){var _0x5f29fc=_[_0x6cb3('0x51')](_0x22e874[_0x6cb3('0x4d')][_0x4603a6][_0x50551e[_0x135c21]][_0x6cb3('0x52')](/"/g,'\x27'));switch(_0x135c21){case _0x6cb3('0x1d'):var _0x2d631a=moment(_0x5f29fc,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2d631a[_0x6cb3('0x53')]()){_0x55a338[_0x6cb3('0x3e')]('\x22'+_0x5f29fc+'\x22');}else{_0x3a59b9['push'](_0x6cb3('0x54'));}break;case _0x6cb3('0x21'):var _0x432a2e=parseInt(_0x5f29fc);_0x5f29fc=_[_0x6cb3('0x55')](_0x432a2e)||_0x432a2e<0x0||_0x432a2e>0x4?_0x1f436f?0x3:0x2:_0x432a2e;_0x55a338[_0x6cb3('0x3e')]('\x22'+_0x5f29fc+'\x22');break;case _0x6cb3('0x22'):var _0x3e7dd9=parseInt(_0x5f29fc);if(_[_0x6cb3('0x56')](_0x3e7dd9)&&_[_0x6cb3('0x57')](_0x25b547,_0x3e7dd9)){_0x55a338['push']('\x22'+_0x3e7dd9+'\x22');}else{_0x3a59b9[_0x6cb3('0x3e')](_0x6cb3('0x58'));}break;case _0x6cb3('0x59'):if(isEmail(_0x5f29fc)){_0x55a338[_0x6cb3('0x3e')]('\x22'+_0x5f29fc+'\x22');}else{_0x3a59b9[_0x6cb3('0x3e')](_0x6cb3('0x5a'));}break;case'dateOfBirth':var _0x43b025=moment(_0x5f29fc,_0x6cb3('0x5b'),!![]);if(_0x43b025['isValid']()){_0x55a338[_0x6cb3('0x3e')]('\x22'+_0x5f29fc+'\x22');}else{_0x3a59b9['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x55a338[_0x6cb3('0x3e')]('\x22'+_0x5f29fc+'\x22');}}else{switch(_0x135c21){case _0x6cb3('0x5c'):case'phone':_0x3a59b9[_0x6cb3('0x3e')](_0x135c21+_0x6cb3('0x5d'));break;default:_0x55a338['push']('\x22\x22');}}}}if(_0x3a59b9[_0x6cb3('0x4e')]){handleError(_0x22e874[_0x6cb3('0x4d')][_0x4603a6],{'code':'SystemRow','message':_0x3a59b9[_0x6cb3('0x13')]()});}else{fs['appendFileSync'](_0x2a640b,_0x55a338[_0x6cb3('0x13')]()+'\x0a');}_0x55a338=[];}if(!(stats[_0x6cb3('0x4f')]%0xc8)){socket[_0x6cb3('0x5e')](_0x6cb3('0x5f')+_0x516370,stats);stats[_0x6cb3('0x60')]=[];}}if(stopped){logger[_0x6cb3('0x49')]('Abort\x20parser');_0x58e580['abort']();}}catch(_0x563c3){handleError(_0x22e874[_0x6cb3('0x4d')][_0x4603a6],{'code':_0x6cb3('0x61'),'message':_0x563c3[_0x6cb3('0x3c')]});logger[_0x6cb3('0x42')](_0x6cb3('0x62'),_0x563c3[_0x6cb3('0x3c')]);}},'complete':function(){try{var _0x1c809d=[];var _0x2d1154=_0x6cb3('0x2f');if(_0x273af9['duplicates']&&_0x273af9[_0x6cb3('0x63')]['length']){_0x2d1154=_0x6cb3('0x64')+_0x516370;_0x1c809d[_0x6cb3('0x3e')](_0x6cb3('0x65')+_0x2d1154+_0x6cb3('0x66'));}var _0x540db9=util['format'](_0x6cb3('0x67'),_0x2a640b,_0x2d1154,_0x5a0f52,_0x273af9[_0x6cb3('0x1f')],_0x273af9[_0x6cb3('0x37')]||null,NOW,NOW);if(_['isNil'](_0x50551e[_0x6cb3('0x1d')])){_0x540db9+=_0x6cb3('0x68');}_0x1c809d['push'](_0x540db9);if(_0x273af9[_0x6cb3('0x63')]&&_0x273af9[_0x6cb3('0x63')][_0x6cb3('0x4e')]){_0x1c809d[_0x6cb3('0x3e')](insertCmContact(_0x273af9['ListId'],_0x2d1154,_0x273af9[_0x6cb3('0x63')],_0x50551e));_0x1c809d['push'](_0x6cb3('0x69')+_0x2d1154+';');}_0x1c809d[_0x6cb3('0x3e')](insertCmHopper(_0x273af9[_0x6cb3('0x1f')],_0x6cb3('0x6a'),'voice_queues',_0x6cb3('0x6b'),_0x1f436f));_0x1c809d['push'](insertCmHopperBlack(_0x273af9[_0x6cb3('0x1f')],_0x6cb3('0x6c'),_0x6cb3('0x6d'),_0x6cb3('0x6b')));_0x1c809d[_0x6cb3('0x3e')](insertCmHopper(_0x273af9[_0x6cb3('0x1f')],_0x6cb3('0x6e'),'campaigns','CampaignId',_0x1f436f));_0x1c809d[_0x6cb3('0x3e')](insertCmHopperBlack(_0x273af9['ListId'],_0x6cb3('0x6f'),'campaigns',_0x6cb3('0x70')));BPromise[_0x6cb3('0x71')](_0x1c809d,handleQuery)[_0x6cb3('0x72')](function(_0x427a9f){stats[_0x6cb3('0x73')]=!![];stats[_0x6cb3('0x74')]=_0x273af9[_0x6cb3('0x63')]&&_0x273af9[_0x6cb3('0x63')][_0x6cb3('0x4e')]?results[0x2][_0x6cb3('0x74')]:results[0x0][_0x6cb3('0x74')];socket[_0x6cb3('0x5e')]('contact:import:'+_0x516370,stats);fs[_0x6cb3('0x75')](_0x3cde8c);fs['unlink'](_0x2a640b);process[_0x6cb3('0x3d')](0x0);})[_0x6cb3('0x41')](function(_0x4e4a31){logger['error'](_0x4e4a31[_0x6cb3('0x3c')]);process[_0x6cb3('0x3d')](0x1);});}catch(_0xf8acef){logger[_0x6cb3('0x42')](_0x6cb3('0x76'),_0xf8acef[_0x6cb3('0x3c')]);process['exit'](0x1);}},'error':function(_0x28fb53,_0x75b90a,_0x365002,_0x3853c9){throw new Error(_0x3853c9);}});}function validate(){if(process['argv']&&process[_0x6cb3('0x77')][_0x6cb3('0x4e')]<0x4){throw new Error(_0x6cb3('0x78'));}var _0x2d3831=path[_0x6cb3('0x13')](config[_0x6cb3('0x46')],_0x6cb3('0x47'),process[_0x6cb3('0x77')][0x2]);if(!fs['existsSync'](_0x2d3831)){throw new Error(_0x6cb3('0x79'));}var _0x1a7969={};try{_0x1a7969=JSON['parse'](process[_0x6cb3('0x77')][0x3]);if(!_0x1a7969['binding']){throw new Error(_0x6cb3('0x7a'));}if(!_0x1a7969[_0x6cb3('0x45')][_0x6cb3('0xf')]){throw new Error(_0x6cb3('0x7b'));}if(!_0x1a7969[_0x6cb3('0x45')][_0x6cb3('0x5c')]){throw new Error(_0x6cb3('0x7c'));}var _0x542062=0x0;if(_0x1a7969[_0x6cb3('0x45')][_0x6cb3('0x22')]){_0x542062=0x1;}if(!_0x1a7969['ListId']){throw new Error(_0x6cb3('0x7d'));}}catch(_0x397d7e){throw new Error(_0x6cb3('0x7e'));}var _0x31166b=[];try{_0x31166b=_[_0x6cb3('0x7f')](JSON[_0x6cb3('0x80')](process[_0x6cb3('0x77')][0x4]),'id');}catch(_0x1266f8){logger['info'](_0x6cb3('0x81'));}main(_0x2d3831,_0x1a7969,_0x31166b,_0x542062);}validate();process['on'](_0x6cb3('0x82'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 859c676..3b50999 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','starttime','***\x20Time\x20Info\x20***','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa8ec52,_0x7ed88f){_0xa8ec52=_0xa8ec52-0x0;var _0x575bcf=_0x5f2f[_0xa8ec52];return _0x575bcf;};'use strict';exports[_0xf5f2('0x0')]=function(_0x423dd9,_0x2dcf60){var _0x1a7be1=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x2'),'variableName':null}];switch(_0x423dd9[_0xf5f2('0x3')]()){case _0xf5f2('0x4'):switch(_0x2dcf60['toLowerCase']()){case'inbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x7')});_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0x8')});break;case'outbound':_0x1a7be1[_0xf5f2('0x5')]({'type':_0xf5f2('0x1'),'content':_0xf5f2('0x9'),'variableName':null});_0x1a7be1['push']({'type':_0xf5f2('0x6'),'content':'','variableName':_0xf5f2('0xa')});break;}}return _0x1a7be1;};exports[_0xf5f2('0xb')]=function(_0x4e0e6b,_0x977a59){var _0x4ebbbe=[];switch(_0x4e0e6b['toLowerCase']()){case _0xf5f2('0x4'):switch(_0x977a59[_0xf5f2('0x3')]()){case'inbound':_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':_0xf5f2('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0xe'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x8')},{'type':'keyValue','content':'','key':_0xf5f2('0xf'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x10')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x11'),'keyType':'variable','variableName':_0xf5f2('0x12')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x13'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x7')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x15')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x19'),'keyType':'variable','variableName':_0xf5f2('0x1a')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1b'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x17')},{'type':_0xf5f2('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1c')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x1d'),'keyType':_0xf5f2('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0xf5f2('0x1e'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x1f')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x20'),'keyType':_0xf5f2('0x6'),'variableName':_0xf5f2('0x21')}];break;case _0xf5f2('0x22'):_0x4ebbbe=[{'type':_0xf5f2('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x23'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0xa')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x24'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x14'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf5f2('0x16'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x25')},{'type':_0xf5f2('0x1'),'content':_0xf5f2('0x26')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xf5f2('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x27')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x28'),'keyType':_0xf5f2('0x6'),'keyContent':'','variableName':_0xf5f2('0x29')},{'type':_0xf5f2('0xd'),'content':'','key':_0xf5f2('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xf5f2('0x2b')}];break;}}return _0x4ebbbe;}; \ No newline at end of file +var _0x2032=['Agent\x20Ring','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','destcalleridnum','Member\x20Name','membername','Date','starttime','***\x20Time\x20Info\x20***','answertime','Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Name','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x3926ba,_0x237901){var _0x18756e=function(_0x5ca849){while(--_0x5ca849){_0x3926ba['push'](_0x3926ba['shift']());}};_0x18756e(++_0x237901);}(_0x2032,0xd9));var _0x2203=function(_0x3888ff,_0x2665ff){_0x3888ff=_0x3888ff-0x0;var _0x194eaa=_0x2032[_0x3888ff];return _0x194eaa;};'use strict';exports['getSubjects']=function(_0x2c2259,_0x1e103d){var _0xcd892f=[{'type':'string','content':_0x2203('0x0'),'variableName':null}];switch(_0x2c2259[_0x2203('0x1')]()){case'voice':switch(_0x1e103d[_0x2203('0x1')]()){case _0x2203('0x2'):_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x4'),'content':'','variableName':_0x2203('0x5')});_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x4'),'content':'','variableName':_0x2203('0x6')});break;case _0x2203('0x7'):_0xcd892f[_0x2203('0x3')]({'type':_0x2203('0x8'),'content':'Outbound\x20Call','variableName':null});_0xcd892f['push']({'type':_0x2203('0x4'),'content':'','variableName':'destcalleridnum'});break;}}return _0xcd892f;};exports[_0x2203('0x9')]=function(_0x2972f3,_0x6339c4){var _0x5b19df=[];switch(_0x2972f3[_0x2203('0x1')]()){case'voice':switch(_0x6339c4[_0x2203('0x1')]()){case'inbound':_0x5b19df=[{'type':_0x2203('0x8'),'content':_0x2203('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x2203('0xb'),'keyType':'variable','variableName':'calleridname'},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0xd'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0xe')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0xf'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x5')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x10'),'keyType':'variable','variableName':_0x2203('0x11')},{'type':_0x2203('0xc'),'content':'','key':'Date','keyType':_0x2203('0x4'),'variableName':_0x2203('0x12')},{'type':'string','content':_0x2203('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x2203('0x14'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x15')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x16'),'keyType':_0x2203('0x4'),'variableName':'destcalleridnum'},{'type':_0x2203('0x8'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x2203('0x17'),'keyType':'variable','variableName':_0x2203('0x12')},{'type':_0x2203('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x2203('0x4'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x2203('0x18'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x19')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x1a'),'keyType':_0x2203('0x4'),'variableName':_0x2203('0x1b')},{'type':_0x2203('0xc'),'content':'','key':'Talk\x20Time','keyType':_0x2203('0x4'),'variableName':_0x2203('0x1c')}];break;case _0x2203('0x7'):_0x5b19df=[{'type':'string','content':_0x2203('0xa'),'variableName':null},{'type':_0x2203('0xc'),'content':'','key':'Called\x20Number','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x1d')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x1e'),'keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x1f')},{'type':_0x2203('0xc'),'content':'','key':'UniqueId','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x11')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x20'),'keyType':'variable','keyContent':'','variableName':_0x2203('0x21')},{'type':_0x2203('0x8'),'content':_0x2203('0x22')},{'type':_0x2203('0xc'),'content':'','key':'Answer\x20Time','keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x23')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x2203('0x4'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x2203('0x24'),'keyType':_0x2203('0x4'),'keyContent':'','variableName':_0x2203('0x25')},{'type':_0x2203('0xc'),'content':'','key':_0x2203('0x26'),'keyType':'variable','keyContent':'','variableName':_0x2203('0x27')}];break;}}return _0x5b19df;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 02ec564..a1e6145 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15f5=['InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','update','info','catch','tracked','user','clone','body','omit','html','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','upperFirst'];(function(_0x512206,_0x39f827){var _0x2da32d=function(_0x32473c){while(--_0x32473c){_0x512206['push'](_0x512206['shift']());}};_0x2da32d(++_0x39f827);}(_0x15f5,0x77));var _0x515f=function(_0x4d61e3,_0x2e0288){_0x4d61e3=_0x4d61e3-0x0;var _0x32bc76=_0x15f5[_0x4d61e3];return _0x32bc76;};'use strict';var _=require(_0x515f('0x0'));var db=require(_0x515f('0x1'))['db'];var loggers={'openchannel':require(_0x515f('0x2'))(_0x515f('0x3')),'mail':require(_0x515f('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x515f('0x2'))(_0x515f('0x4')),'chat':require('../../config/logger')('chat-interactions')};function getInteractionId(_0x20a043,_0x5d7e67,_0x170f91){if(_0x20a043&&_0x20a043[_[_0x515f('0x5')](_0x170f91)+_0x515f('0x6')]){return _0x20a043[_[_0x515f('0x5')](_0x170f91)+_0x515f('0x6')];}else if(_0x20a043&&_0x20a043['id']){return _0x20a043['id'];}else if(_0x5d7e67&&_0x5d7e67['id']){return _0x5d7e67['id'];}else{return _0x515f('0x7');}}function log(_0x3d7c5b,_0xeadf73,_0x2a6dd8,_0x1e24aa,_0x205e6b,_0xfee4e6){loggers[_0x205e6b['toLowerCase']()][_0x3d7c5b](_0x515f('0x8'),_0xfee4e6['toUpperCase'](),_0xeadf73?_0xeadf73['id']:null,_0xeadf73?_0xeadf73[_0x515f('0x9')]:null,_0xeadf73?_0xeadf73[_0x515f('0xa')]:null,getInteractionId(_0x2a6dd8,_0x1e24aa,_0x205e6b),_0x2a6dd8?JSON[_0x515f('0xb')](_0x2a6dd8):_0x515f('0xc'));}function updateUser(_0x34a4c1,_0x38748f,_0x455cea,_0x3ccfbc,_0x4799d2){db[_['upperFirst'](_0x3ccfbc)+'Interaction'][_0x515f('0xd')]({'where':{'id':getInteractionId(_0x38748f,_0x455cea,_0x3ccfbc)}})[_0x515f('0xe')](function(_0x1b62ab){if(_0x1b62ab){return _0x1b62ab[_0x515f('0xf')]({'UserId':_0x34a4c1?_0x34a4c1['id']:null});}})['then'](function(_0x5e1fc9){if(_0x5e1fc9){log(_0x515f('0x10'),_0x34a4c1,_0x38748f,_0x455cea,_0x3ccfbc,_0x4799d2);}})[_0x515f('0x11')](function(){log('error',_0x34a4c1,_0x38748f,_0x455cea,_0x3ccfbc,_0x4799d2);});}exports[_0x515f('0x12')]=function(_0x3af8ee,_0x460a5b){return function(_0x2bb6d7,_0x4c0f9d,_0x13e76c){var _0x308674=_0x2bb6d7[_0x515f('0x13')];var _0x158b8b={};var _0x3abf6f=_0x2bb6d7['query'];if(_0x158b8b){_0x158b8b=_[_0x515f('0x14')](_0x2bb6d7[_0x515f('0x15')]);_0x158b8b=_[_0x515f('0x16')](_0x158b8b,[_0x515f('0x15'),_0x515f('0x17'),'phone',_0x515f('0x18'),'mobile']);}updateUser(_0x308674,_0x158b8b,_0x3abf6f,_0x3af8ee,_0x460a5b);_0x13e76c(null);};}; \ No newline at end of file +var _0x692e=['then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','mail-interactions','fax-interactions','sms-interactions','../../config/logger','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x692e,0x6c));var _0xe692=function(_0x368e24,_0xaf41fd){_0x368e24=_0x368e24-0x0;var _0x3cc97f=_0x692e[_0x368e24];return _0x3cc97f;};'use strict';var _=require('lodash');var db=require(_0xe692('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require('../../config/logger')(_0xe692('0x1')),'fax':require('../../config/logger')(_0xe692('0x2')),'sms':require('../../config/logger')(_0xe692('0x3')),'chat':require(_0xe692('0x4'))(_0xe692('0x5'))};function getInteractionId(_0xabc776,_0x106298,_0x346020){if(_0xabc776&&_0xabc776[_['upperFirst'](_0x346020)+_0xe692('0x6')]){return _0xabc776[_[_0xe692('0x7')](_0x346020)+_0xe692('0x6')];}else if(_0xabc776&&_0xabc776['id']){return _0xabc776['id'];}else if(_0x106298&&_0x106298['id']){return _0x106298['id'];}else{return _0xe692('0x8');}}function log(_0x30add1,_0x8ada37,_0x2fd4b1,_0x4a0a26,_0x54a1a0,_0x4abe9f){loggers[_0x54a1a0[_0xe692('0x9')]()][_0x30add1](_0xe692('0xa'),_0x4abe9f[_0xe692('0xb')](),_0x8ada37?_0x8ada37['id']:null,_0x8ada37?_0x8ada37[_0xe692('0xc')]:null,_0x8ada37?_0x8ada37[_0xe692('0xd')]:null,getInteractionId(_0x2fd4b1,_0x4a0a26,_0x54a1a0),_0x2fd4b1?JSON[_0xe692('0xe')](_0x2fd4b1):'null');}function updateUser(_0x513057,_0x3f95ec,_0x29b9b6,_0x1b3ede,_0x4c4dcf){db[_[_0xe692('0x7')](_0x1b3ede)+_0xe692('0xf')]['findOne']({'where':{'id':getInteractionId(_0x3f95ec,_0x29b9b6,_0x1b3ede)}})[_0xe692('0x10')](function(_0x731b2a){if(_0x731b2a){return _0x731b2a[_0xe692('0x11')]({'UserId':_0x513057?_0x513057['id']:null});}})[_0xe692('0x10')](function(_0x30c9f5){if(_0x30c9f5){log(_0xe692('0x12'),_0x513057,_0x3f95ec,_0x29b9b6,_0x1b3ede,_0x4c4dcf);}})[_0xe692('0x13')](function(){log(_0xe692('0x14'),_0x513057,_0x3f95ec,_0x29b9b6,_0x1b3ede,_0x4c4dcf);});}exports[_0xe692('0x15')]=function(_0x1328a4,_0x470923){return function(_0x32bb2e,_0x126221,_0x2ad3f5){var _0x5d87a8=_0x32bb2e[_0xe692('0x16')];var _0x2187ef={};var _0x58ed26=_0x32bb2e[_0xe692('0x17')];if(_0x2187ef){_0x2187ef=_[_0xe692('0x18')](_0x32bb2e[_0xe692('0x19')]);_0x2187ef=_[_0xe692('0x1a')](_0x2187ef,[_0xe692('0x19'),_0xe692('0x1b'),_0xe692('0x1c'),_0xe692('0x1d'),_0xe692('0x1e')]);}updateUser(_0x5d87a8,_0x2187ef,_0x58ed26,_0x1328a4,_0x470923);_0x2ad3f5(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index dc82a74..2e8b396 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99bd=['User','admin','user','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','catch','users'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x99bd,0x116));var _0xd99b=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x99bd[_0x31ced5];return _0x10d9e5;};'use strict';var crypto=require(_0xd99b('0x0'));var util=require('util');var compose=require(_0xd99b('0x1'));var db=require(_0xd99b('0x2'))['db'];var config=require(_0xd99b('0x3'));function getValueFromLicense(_0xf76791,_0x41b18b){if(_0xf76791&&_0x41b18b){if(_0x41b18b[_0xd99b('0x4')]&&_0x41b18b[_0xd99b('0x5')]){var _0x183ae1=_0x41b18b[_0xd99b('0x4')];var _0x568d0b=_0x41b18b['license'];var _0x3931af=_0x183ae1[_0xd99b('0x6')]('-')[0x4];var _0x2fc756=_0x183ae1[_0xd99b('0x6')]('-')[0x0];var _0x346d74=crypto[_0xd99b('0x7')]('aes-256-ctr',util[_0xd99b('0x8')]('%s:%s:%s',_0x3931af,_0x183ae1,_0x2fc756));var _0x515a37=_0x346d74[_0xd99b('0x9')](_0x568d0b,_0xd99b('0xa'),_0xd99b('0xb'));_0x515a37+=_0x346d74['final'](_0xd99b('0xb'));var _0x521cde=JSON[_0xd99b('0xc')](_0x515a37);return _0x521cde[_0xd99b('0xd')](_0xf76791)?_0x521cde[_0xf76791]:null;}}return null;}function isLimit(_0x4e56f0,_0x43a9bc,_0x17a059,_0x1a5258){var _0x4dca46=_0x43a9bc;return compose()[_0xd99b('0xe')](function(_0x1ded57,_0xb7734a,_0x5f2cc0){return db[_0xd99b('0xf')][_0xd99b('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xd99b('0x11')](function(_0x23ae20){var _0x4cfd73=getValueFromLicense(_0x4e56f0,_0x23ae20);return _0x4cfd73?_0x4cfd73:_0x4dca46;})[_0xd99b('0x11')](function(_0x14c93f){_0x4dca46=_0x14c93f;return _0x17a059[_0xd99b('0x12')](_0x1a5258);})['then'](function(_0x450528){if(_0x450528>=_0x4dca46){return _0xb7734a[_0xd99b('0x13')](0x193)['json']({'message':util[_0xd99b('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4e56f0)});}_0x5f2cc0();})[_0xd99b('0x14')](function(_0x3ee7a0){_0x5f2cc0(_0x3ee7a0);});});}function isUserLimit(){return isLimit(_0xd99b('0x15'),0x1,db[_0xd99b('0x16')],{'where':{'$or':[{'role':_0xd99b('0x17')},{'role':_0xd99b('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x56b9=['update','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x56b9,0x196));var _0x956b=function(_0x1492b2,_0x535a3e){_0x1492b2=_0x1492b2-0x0;var _0x3bde7e=_0x56b9[_0x1492b2];return _0x3bde7e;};'use strict';var crypto=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var compose=require(_0x956b('0x2'));var db=require(_0x956b('0x3'))['db'];var config=require(_0x956b('0x4'));function getValueFromLicense(_0x44eac8,_0x54972f){if(_0x44eac8&&_0x54972f){if(_0x54972f[_0x956b('0x5')]&&_0x54972f['license']){var _0x34051d=_0x54972f[_0x956b('0x5')];var _0x22615c=_0x54972f['license'];var _0x12725c=_0x34051d[_0x956b('0x6')]('-')[0x4];var _0x322012=_0x34051d[_0x956b('0x6')]('-')[0x0];var _0x222eae=crypto[_0x956b('0x7')](_0x956b('0x8'),util[_0x956b('0x9')]('%s:%s:%s',_0x12725c,_0x34051d,_0x322012));var _0x3a48c6=_0x222eae[_0x956b('0xa')](_0x22615c,'base64',_0x956b('0xb'));_0x3a48c6+=_0x222eae[_0x956b('0xc')](_0x956b('0xb'));var _0x26235e=JSON[_0x956b('0xd')](_0x3a48c6);return _0x26235e['hasOwnProperty'](_0x44eac8)?_0x26235e[_0x44eac8]:null;}}return null;}function isLimit(_0x4505fb,_0x355d36,_0x2bc65c,_0x2fcd69){var _0x3683bc=_0x355d36;return compose()[_0x956b('0xe')](function(_0x14d17d,_0x15566c,_0x4338ce){return db[_0x956b('0xf')][_0x956b('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x43655d){var _0x32a806=getValueFromLicense(_0x4505fb,_0x43655d);return _0x32a806?_0x32a806:_0x3683bc;})[_0x956b('0x11')](function(_0x4e4029){_0x3683bc=_0x4e4029;return _0x2bc65c[_0x956b('0x12')](_0x2fcd69);})[_0x956b('0x11')](function(_0x3e37f1){if(_0x3e37f1>=_0x3683bc){return _0x15566c[_0x956b('0x13')](0x193)[_0x956b('0x14')]({'message':util[_0x956b('0x9')](_0x956b('0x15'),_0x4505fb)});}_0x4338ce();})['catch'](function(_0x2db85f){_0x4338ce(_0x2db85f);});});}function isUserLimit(){return isLimit(_0x956b('0x16'),0x1,db[_0x956b('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x956b('0x18')}]}});}exports[_0x956b('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 8a1c913..1e1fca1 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 _0x2097=['hasOwnProperty','isNumeric','match','isEmail','lodash','moment','split','filters','isEmpty','isArray','parse','limit','offset','sort','map','priority','col','unsigned','DESC','cast','ASC','omit','length','isString','unset'];(function(_0xceade2,_0xc82824){var _0x240a65=function(_0x13ac6a){while(--_0x13ac6a){_0xceade2['push'](_0xceade2['shift']());}};_0x240a65(++_0xc82824);}(_0x2097,0x68));var _0x7209=function(_0x3eabcc,_0x2598f1){_0x3eabcc=_0x3eabcc-0x0;var _0x41494d=_0x2097[_0x3eabcc];return _0x41494d;};'use strict';var _=require(_0x7209('0x0'));var moment=require(_0x7209('0x1'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports['fields']=function(_0x32cc84){var _0x489156=null;if(_0x32cc84){_0x489156=_0x32cc84[_0x7209('0x2')](',');}return _0x489156;};exports[_0x7209('0x3')]=function(_0x47229d){var _0x163837={};if(!_[_0x7209('0x4')](_0x47229d)){_0x163837={};_['forOwn'](_0x47229d,function(_0x1d211b,_0x2c0989){try{_0x163837[_0x2c0989]=_[_0x7209('0x5')](_0x1d211b)?_0x1d211b:JSON[_0x7209('0x6')](_0x1d211b);}catch(_0x3ce9cf){_0x163837[_0x2c0989]=_0x1d211b[_0x7209('0x2')](',');}});}return _0x163837;};exports[_0x7209('0x7')]=function(_0x50c141){_0x50c141=parseInt(_0x50c141,0xa);if(!_0x50c141||_0x50c141<0x0){_0x50c141=LIMIT_VALUE;}return _0x50c141;};exports[_0x7209('0x8')]=function(_0x1193fd){_0x1193fd=parseInt(_0x1193fd,0xa);if(!_0x1193fd||_0x1193fd<0x0){_0x1193fd=0x0;}return _0x1193fd;};exports[_0x7209('0x9')]=function(_0x47fb4b){var _0x44e164,_0x407273=null;if(_0x47fb4b){_0x44e164=_0x47fb4b[_0x7209('0x2')](',');_0x407273=_[_0x7209('0xa')](_0x44e164,function(_0x3f2044){if(_0x3f2044['indexOf']('-')===0x0){return[_0x3f2044===_0x7209('0xb')?sequelize['cast'](sequelize[_0x7209('0xc')](_0x7209('0xb')),_0x7209('0xd')):_0x3f2044['substr'](0x1),_0x7209('0xe')];}else{return[_0x3f2044===_0x7209('0xb')?sequelize[_0x7209('0xf')](sequelize['col'](_0x7209('0xb')),_0x7209('0xd')):_0x3f2044,_0x7209('0x10')];}});}return _0x407273;};exports[_0x7209('0x11')]=function(_0x2300a3,_0x5a4bdb){if(_['isEmpty'](_0x2300a3)){return _0x2300a3;}if(_[_0x7209('0x5')](_0x2300a3)){for(var _0x6cd2e3=0x0;_0x6cd2e3<_0x2300a3[_0x7209('0x12')];_0x6cd2e3+=0x1){_0x2300a3[_0x6cd2e3]=this[_0x7209('0x11')](_0x2300a3[_0x6cd2e3],_0x5a4bdb);}return _0x2300a3;}if(!_['isObject'](_0x2300a3)){return _0x2300a3;}if(_[_0x7209('0x13')](_0x5a4bdb)){_0x5a4bdb=[_0x5a4bdb];}if(!_[_0x7209('0x5')](_0x5a4bdb)){return _0x2300a3;}for(var _0x3afd93=0x0;_0x3afd93<_0x5a4bdb[_0x7209('0x12')];_0x3afd93+=0x1){_[_0x7209('0x14')](_0x2300a3,_0x5a4bdb[_0x3afd93]);}for(var _0x323105 in _0x2300a3){if(_0x2300a3[_0x7209('0x15')](_0x323105)){_0x2300a3[_0x323105]=this['omit'](_0x2300a3[_0x323105],_0x5a4bdb);}}return _0x2300a3;};exports[_0x7209('0x16')]=function(_0x20e263){return _0x20e263[_0x7209('0x17')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x7209('0x18')]=function(_0x2b656e){return _0x2b656e[_0x7209('0x17')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x0577=['indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[0-9]*$','isEmail','lodash','moment','fields','split','isEmpty','forOwn','limit','map'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x0577,0x156));var _0x7057=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x0577[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x7057('0x0'));var moment=require(_0x7057('0x1'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x7057('0x2')]=function(_0x1062f7){var _0x2f3199=null;if(_0x1062f7){_0x2f3199=_0x1062f7[_0x7057('0x3')](',');}return _0x2f3199;};exports['filters']=function(_0xc180bd){var _0x26f902={};if(!_[_0x7057('0x4')](_0xc180bd)){_0x26f902={};_[_0x7057('0x5')](_0xc180bd,function(_0x2b2c22,_0xac13d5){try{_0x26f902[_0xac13d5]=_['isArray'](_0x2b2c22)?_0x2b2c22:JSON['parse'](_0x2b2c22);}catch(_0x13017){_0x26f902[_0xac13d5]=_0x2b2c22[_0x7057('0x3')](',');}});}return _0x26f902;};exports[_0x7057('0x6')]=function(_0x443eab){_0x443eab=parseInt(_0x443eab,0xa);if(!_0x443eab||_0x443eab<0x0){_0x443eab=LIMIT_VALUE;}return _0x443eab;};exports['offset']=function(_0x16863b){_0x16863b=parseInt(_0x16863b,0xa);if(!_0x16863b||_0x16863b<0x0){_0x16863b=0x0;}return _0x16863b;};exports['sort']=function(_0x5d7d86){var _0x33b4e2,_0xf2eec=null;if(_0x5d7d86){_0x33b4e2=_0x5d7d86[_0x7057('0x3')](',');_0xf2eec=_[_0x7057('0x7')](_0x33b4e2,function(_0x48f5fa){if(_0x48f5fa[_0x7057('0x8')]('-')===0x0){return[_0x48f5fa===_0x7057('0x9')?sequelize['cast'](sequelize[_0x7057('0xa')](_0x7057('0x9')),_0x7057('0xb')):_0x48f5fa[_0x7057('0xc')](0x1),_0x7057('0xd')];}else{return[_0x48f5fa===_0x7057('0x9')?sequelize[_0x7057('0xe')](sequelize[_0x7057('0xa')]('priority'),'unsigned'):_0x48f5fa,_0x7057('0xf')];}});}return _0xf2eec;};exports[_0x7057('0x10')]=function(_0x37ed47,_0x2fbb41){if(_['isEmpty'](_0x37ed47)){return _0x37ed47;}if(_['isArray'](_0x37ed47)){for(var _0x3efdca=0x0;_0x3efdca<_0x37ed47[_0x7057('0x11')];_0x3efdca+=0x1){_0x37ed47[_0x3efdca]=this[_0x7057('0x10')](_0x37ed47[_0x3efdca],_0x2fbb41);}return _0x37ed47;}if(!_[_0x7057('0x12')](_0x37ed47)){return _0x37ed47;}if(_[_0x7057('0x13')](_0x2fbb41)){_0x2fbb41=[_0x2fbb41];}if(!_['isArray'](_0x2fbb41)){return _0x37ed47;}for(var _0x15a2cb=0x0;_0x15a2cb<_0x2fbb41['length'];_0x15a2cb+=0x1){_[_0x7057('0x14')](_0x37ed47,_0x2fbb41[_0x15a2cb]);}for(var _0x4b6754 in _0x37ed47){if(_0x37ed47['hasOwnProperty'](_0x4b6754)){_0x37ed47[_0x4b6754]=this['omit'](_0x37ed47[_0x4b6754],_0x2fbb41);}}return _0x37ed47;};exports[_0x7057('0x15')]=function(_0x132bd3){return _0x132bd3[_0x7057('0x16')](RegExp(_0x7057('0x17')))?!![]:![];};exports[_0x7057('0x18')]=function(_0x3094c3){return _0x3094c3['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d7577e4..9f5e569 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['test','client','set','json\x20replacer','split','static','get','views','/server/views','engine','html','renderFile','view\x20engine','json','50mb','initialize','express','serve-favicon','body-parser','errorhandler','path','passport','cors','./environment','default','env','production','use','join','root','public','favicon.ico','development'];(function(_0x2d6702,_0x2e8385){var _0x172eaf=function(_0x5c138e){while(--_0x5c138e){_0x2d6702['push'](_0x2d6702['shift']());}};_0x172eaf(++_0x2e8385);}(_0x70e0,0x17b));var _0x070e=function(_0x410009,_0x48175a){_0x410009=_0x410009-0x0;var _0x3696e0=_0x70e0[_0x410009];return _0x3696e0;};'use strict';var express=require(_0x070e('0x0'));var favicon=require(_0x070e('0x1'));var bodyParser=require(_0x070e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x070e('0x3'));var path=require(_0x070e('0x4'));var passport=require(_0x070e('0x5'));var cors=require(_0x070e('0x6'));var moment=require('moment');var config=require(_0x070e('0x7'));var db=require('../mysqldb')['db'];exports[_0x070e('0x8')]=function(_0x4b041d){var _0x56e420=_0x4b041d['get'](_0x070e('0x9'));if(_0x56e420===_0x070e('0xa')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe'),_0x070e('0xf'))));_0x4b041d['set']('appPath',path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe')));}if(_0x56e420===_0x070e('0x10')||_0x56e420===_0x070e('0x11')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0x12'),_0x070e('0xf'))));_0x4b041d[_0x070e('0x13')]('appPath',path['join'](config[_0x070e('0xd')],'client'));_0x4b041d['use'](errorHandler());}_0x4b041d['set'](_0x070e('0x14'),function(_0x14c3fd,_0x51d14d){if(this[_0x14c3fd]instanceof Date){_0x51d14d=this[_0x14c3fd]['toISOString']()[_0x070e('0x15')]('.')[0x0]+'Z';}return _0x51d14d;});_0x4b041d[_0x070e('0xb')](express[_0x070e('0x16')](_0x4b041d[_0x070e('0x17')]('appPath')));_0x4b041d['set'](_0x070e('0x18'),config[_0x070e('0xd')]+_0x070e('0x19'));_0x4b041d[_0x070e('0x1a')](_0x070e('0x1b'),require('ejs')[_0x070e('0x1c')]);_0x4b041d[_0x070e('0x13')](_0x070e('0x1d'),_0x070e('0x1b'));_0x4b041d[_0x070e('0xb')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x4b041d['use'](bodyParser[_0x070e('0x1e')]({'limit':_0x070e('0x1f')}));_0x4b041d[_0x070e('0xb')](cors());_0x4b041d['use'](methodOverride());_0x4b041d[_0x070e('0xb')](cookieParser());_0x4b041d['use'](passport[_0x070e('0x20')]());}; \ No newline at end of file +var _0x9c44=['appPath','development','favicon.ico','set','client','json\x20replacer','split','static','views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','body-parser','method-override','cookie-parser','errorhandler','path','passport','./environment','default','get','env','use','join','root','public'];(function(_0x2a5155,_0x442acd){var _0x40b112=function(_0x268372){while(--_0x268372){_0x2a5155['push'](_0x2a5155['shift']());}};_0x40b112(++_0x442acd);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x49c4('0x0'));var methodOverride=require(_0x49c4('0x1'));var cookieParser=require(_0x49c4('0x2'));var errorHandler=require(_0x49c4('0x3'));var path=require(_0x49c4('0x4'));var passport=require(_0x49c4('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0x49c4('0x6'));var db=require('../mysqldb')['db'];exports[_0x49c4('0x7')]=function(_0x6030ae){var _0x69bc41=_0x6030ae[_0x49c4('0x8')](_0x49c4('0x9'));if(_0x69bc41==='production'){_0x6030ae[_0x49c4('0xa')](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0xd'),'favicon.ico')));_0x6030ae['set'](_0x49c4('0xe'),path[_0x49c4('0xb')](config['root'],_0x49c4('0xd')));}if(_0x69bc41===_0x49c4('0xf')||_0x69bc41==='test'){_0x6030ae['use'](favicon(path[_0x49c4('0xb')](config[_0x49c4('0xc')],'client',_0x49c4('0x10'))));_0x6030ae[_0x49c4('0x11')]('appPath',path[_0x49c4('0xb')](config[_0x49c4('0xc')],_0x49c4('0x12')));_0x6030ae[_0x49c4('0xa')](errorHandler());}_0x6030ae[_0x49c4('0x11')](_0x49c4('0x13'),function(_0x75ea8,_0x3de397){if(this[_0x75ea8]instanceof Date){_0x3de397=this[_0x75ea8]['toISOString']()[_0x49c4('0x14')]('.')[0x0]+'Z';}return _0x3de397;});_0x6030ae[_0x49c4('0xa')](express[_0x49c4('0x15')](_0x6030ae[_0x49c4('0x8')](_0x49c4('0xe'))));_0x6030ae['set'](_0x49c4('0x16'),config[_0x49c4('0xc')]+'/server/views');_0x6030ae['engine'](_0x49c4('0x17'),require(_0x49c4('0x18'))[_0x49c4('0x19')]);_0x6030ae['set'](_0x49c4('0x1a'),'html');_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1b')]({'limit':_0x49c4('0x1c'),'extended':!![]}));_0x6030ae[_0x49c4('0xa')](bodyParser[_0x49c4('0x1d')]({'limit':_0x49c4('0x1c')}));_0x6030ae[_0x49c4('0xa')](cors());_0x6030ae[_0x49c4('0xa')](methodOverride());_0x6030ae[_0x49c4('0xa')](cookieParser());_0x6030ae['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9ef0366..3e3f2ee 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 _0xe7f2=['internal','head','mac','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','createHash','update','digest','platform','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','md5','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','length','IPv4'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe7f2,0x10e));var _0x2e7f=function(_0x2b50ab,_0x5b279e){_0x2b50ab=_0x2b50ab-0x0;var _0x5170a8=_0xe7f2[_0x2b50ab];return _0x5170a8;};'use strict';var _=require(_0x2e7f('0x0'));var os=require('os');var crypto=require(_0x2e7f('0x1'));var machine=require(_0x2e7f('0x2'));var exec=require(_0x2e7f('0x3'))[_0x2e7f('0x4')];function getInterfaces(){var _0x30b001=[];var _0x4bb7b0=os[_0x2e7f('0x5')]();var _0x1ec8c3=_['orderBy'](_[_0x2e7f('0x6')](_0x4bb7b0));for(var _0x301954=0x0;_0x301954<_0x1ec8c3[_0x2e7f('0x7')];_0x301954++){var _0xd37a5e=_0x4bb7b0[_0x1ec8c3[_0x301954]]['filter'](function(_0x28c64c){return _0x28c64c['family']===_0x2e7f('0x8')&&_0x28c64c[_0x2e7f('0x9')]===![];});_0x30b001=_0x30b001['concat'](_0xd37a5e);}return _0x30b001;}function getFirstInterface(){var _0x4ba69e=_[_0x2e7f('0xa')](getInterfaces());return{'macAddress':_0x4ba69e&&_0x4ba69e[_0x2e7f('0xb')]?_0x4ba69e['mac']:'00:00:00:00:00:00','ipAddress':_0x4ba69e&&_0x4ba69e['address']?_0x4ba69e[_0x2e7f('0xc')]:_0x2e7f('0xd')};}exports[_0x2e7f('0xe')]=getFirstInterface;function getCPUhash(){var _0x3ec0db=_[_0x2e7f('0xf')](os[_0x2e7f('0x10')]()[_0x2e7f('0x11')](function(_0x1ff246){return _0x1ff246[_0x2e7f('0x12')];}))['join'](':');return crypto[_0x2e7f('0x13')]('md5')[_0x2e7f('0x14')](_0x3ec0db)[_0x2e7f('0x15')]('hex');}exports['getUuid']=function(){switch(os[_0x2e7f('0x16')]()){case _0x2e7f('0x17'):return exec(_0x2e7f('0x18'),{'encoding':'utf8'})[_0x2e7f('0x19')]('\x0d\x0a','');default:var _0x1e5d87=getFirstInterface();var _0xb93dab=getCPUhash();var _0x5911b3=_0xb93dab+'|'+os['hostname']()+'|'+_0x1e5d87[_0x2e7f('0x1a')]+'|'+_0x1e5d87[_0x2e7f('0x1b')];var _0x2ac380=crypto['createHash'](_0x2e7f('0x1c'))['update'](_0x5911b3)[_0x2e7f('0x15')](_0x2e7f('0x1d'));return _0x2ac380[_0x2e7f('0x1e')](0x0,0x8)+'-'+_0x2ac380['substring'](0x8,0xc)+'-'+_0x2ac380[_0x2e7f('0x1e')](0xc,0x10)+'-'+_0x2ac380[_0x2e7f('0x1e')](0x10,0x14)+'-'+_0x2ac380['substring'](0x14);}}; \ No newline at end of file +var _0x7fa0=['bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','filter','family','IPv4','concat','head','mac','address','cpus','model','join','createHash','md5','update','digest','platform','utf8','replace','macAddress','hex','substring','crypto'];(function(_0xe38764,_0x28ce79){var _0x5979cf=function(_0x1fedef){while(--_0x1fedef){_0xe38764['push'](_0xe38764['shift']());}};_0x5979cf(++_0x28ce79);}(_0x7fa0,0x6b));var _0x07fa=function(_0x265e81,_0x514eff){_0x265e81=_0x265e81-0x0;var _0x55b6b7=_0x7fa0[_0x265e81];return _0x55b6b7;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x07fa('0x0'));var machine=require(_0x07fa('0x1'));var exec=require(_0x07fa('0x2'))[_0x07fa('0x3')];function getInterfaces(){var _0x3a2399=[];var _0x5ea265=os[_0x07fa('0x4')]();var _0x5f270d=_[_0x07fa('0x5')](_[_0x07fa('0x6')](_0x5ea265));for(var _0x5b3216=0x0;_0x5b3216<_0x5f270d['length'];_0x5b3216++){var _0xb03e65=_0x5ea265[_0x5f270d[_0x5b3216]][_0x07fa('0x7')](function(_0x17ec58){return _0x17ec58[_0x07fa('0x8')]===_0x07fa('0x9')&&_0x17ec58['internal']===![];});_0x3a2399=_0x3a2399[_0x07fa('0xa')](_0xb03e65);}return _0x3a2399;}function getFirstInterface(){var _0x56fa84=_[_0x07fa('0xb')](getInterfaces());return{'macAddress':_0x56fa84&&_0x56fa84[_0x07fa('0xc')]?_0x56fa84['mac']:'00:00:00:00:00:00','ipAddress':_0x56fa84&&_0x56fa84['address']?_0x56fa84[_0x07fa('0xd')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x19935b=_[_0x07fa('0x5')](os[_0x07fa('0xe')]()['map'](function(_0xc82231){return _0xc82231[_0x07fa('0xf')];}))[_0x07fa('0x10')](':');return crypto[_0x07fa('0x11')](_0x07fa('0x12'))[_0x07fa('0x13')](_0x19935b)[_0x07fa('0x14')]('hex');}exports['getUuid']=function(){switch(os[_0x07fa('0x15')]()){case'win32':return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x07fa('0x16')})[_0x07fa('0x17')]('\x0d\x0a','');default:var _0x330875=getFirstInterface();var _0x13f5fd=getCPUhash();var _0x393e1b=_0x13f5fd+'|'+os['hostname']()+'|'+_0x330875[_0x07fa('0x18')]+'|'+_0x330875['ipAddress'];var _0x1423dd=crypto[_0x07fa('0x11')](_0x07fa('0x12'))['update'](_0x393e1b)[_0x07fa('0x14')](_0x07fa('0x19'));return _0x1423dd[_0x07fa('0x1a')](0x0,0x8)+'-'+_0x1423dd[_0x07fa('0x1a')](0x8,0xc)+'-'+_0x1423dd['substring'](0xc,0x10)+'-'+_0x1423dd[_0x07fa('0x1a')](0x10,0x14)+'-'+_0x1423dd[_0x07fa('0x1a')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4bba452..d8739f0 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 _0x8549=['spread','default','crypto','moment','bluebird','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','session','utf8','final','base64','createDecipher','update','User','findOne','admin','fullname','email','|uuid|','|machineUuid|','|name|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x8549,0x1f2));var _0x9854=function(_0x4573c2,_0x3763e9){_0x4573c2=_0x4573c2-0x0;var _0x573a59=_0x8549[_0x4573c2];return _0x573a59;};'use strict';var util=require('util');var crypto=require(_0x9854('0x0'));var moment=require(_0x9854('0x1'));var rp=require('request-promise');var BPromise=require(_0x9854('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x9854('0x3'))['db'];var config=require(_0x9854('0x4'));var hardware=require(_0x9854('0x5'));var logger=require(_0x9854('0x6'))(_0x9854('0x7'));var jira=require(_0x9854('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5745df){return new BPromise(function(_0x50ed00,_0x3dc9d4){var _0x44ce98=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x5745df,module[_0x9854('0x9')][_0x9854('0xa')]);if(oldToken){_0x44ce98=util[_0x9854('0xb')](_0x9854('0xc'),HOST,_0x5745df,module['exports']['version'],oldToken);}var _0x435b42={'uri':_0x44ce98,'method':_0x9854('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x435b42)[_0x9854('0xe')](function(_0x7d73cf){_0x50ed00(_0x7d73cf);})[_0x9854('0xf')](function(_0x461532){_0x3dc9d4(_0x461532);});});}function encryptDate(_0x34d3c4){var _0x2ba24a=crypto[_0x9854('0x10')](_0x9854('0x11'),config[_0x9854('0x12')][_0x9854('0x13')]);var _0x10772c=_0x2ba24a['update'](_0x34d3c4,_0x9854('0x14'),'base64');_0x10772c+=_0x2ba24a[_0x9854('0x15')](_0x9854('0x16'));return _0x10772c;}function decryptDate(_0x1ee0a2){var _0x34197f=crypto[_0x9854('0x17')](_0x9854('0x11'),config[_0x9854('0x12')][_0x9854('0x13')]);var _0x3eb2d6=_0x34197f[_0x9854('0x18')](_0x1ee0a2,_0x9854('0x16'),_0x9854('0x14'));_0x3eb2d6+=_0x34197f[_0x9854('0x15')](_0x9854('0x14'));return _0x3eb2d6;}function sendJiraAlert(_0x845f2e,_0x447f7d,_0x15de32){var _0x46096b='||FIELD||VALUE||\x0a';return db[_0x9854('0x19')][_0x9854('0x1a')]({'where':{'role':_0x9854('0x1b')},'attributes':[_0x9854('0x1c'),_0x9854('0x1d')],'raw':!![]})[_0x9854('0xe')](function(_0x25cc36){ADMIN=_0x25cc36;_0x46096b+='|reason|'+_0x15de32+'|\x0a';_0x46096b+=_0x9854('0x1e')+_0x845f2e+'|\x0a';_0x46096b+=_0x9854('0x1f')+_0x447f7d+'|\x0a';_0x46096b+=_0x9854('0x20')+ADMIN[_0x9854('0x1c')]+'|\x0a';_0x46096b+='|email|'+ADMIN[_0x9854('0x1d')]+'|\x0a';return _0x46096b;})[_0x9854('0xe')](function(_0x4a3680){var _0x453c4c=hardware[_0x9854('0x21')]()[_0x9854('0x22')];return jira[_0x9854('0x23')]({'key':_0x9854('0x24'),'summary':'Motion\x20License\x20Alert','description':_0x4a3680,'issuetype':'Alert','oldToken':_0x845f2e,'newToken':_0x447f7d,'email':ADMIN[_0x9854('0x1d')],'name':ADMIN[_0x9854('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0x453c4c});});}function manageLicense(_0x7579aa,_0x10195b){var _0x57ad80=_0x10195b[_0x9854('0x25')]({'plain':!![]});httpRequest(_0x7579aa)[_0x9854('0xe')](function(_0x4121d3){if(oldToken){oldToken=undefined;}if(_0x4121d3[_0x9854('0x26')]){if(!_0x57ad80[_0x9854('0x7')]&&_0x57ad80[_0x9854('0x7')]!=_0x4121d3[_0x9854('0x7')]||_0x57ad80[_0x9854('0x7')]&&_0x57ad80[_0x9854('0x27')]){logger[_0x9854('0x28')](_0x9854('0x29'));}if(_0x57ad80[_0x9854('0x7')]&&!_0x57ad80[_0x9854('0x27')]&&_0x57ad80['license']!=_0x4121d3[_0x9854('0x7')]){logger['info'](_0x9854('0x2a'));}if(_0x57ad80['license']&&!_0x57ad80[_0x9854('0x27')]&&_0x57ad80[_0x9854('0x7')]==_0x4121d3[_0x9854('0x7')]){return _0x10195b;}return _0x10195b[_0x9854('0x18')]({'data1':_0x7579aa,'data2':null,'license':_0x4121d3[_0x9854('0x7')]});}else{if(_0x4121d3['license']||_0x57ad80['license']){if(!_0x57ad80[_0x9854('0x27')]){if(_0x57ad80[_0x9854('0x2b')]==_0x7579aa){GRAY_PERIOD_REASON=_0x9854('0x2c');logger['info'](_0x9854('0x2d'));}else{GRAY_PERIOD_REASON=_0x9854('0x2e');oldToken=_0x57ad80[_0x9854('0x2b')];logger[_0x9854('0x28')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x57ad80[_0x9854('0x2b')],_0x7579aa);}sendJiraAlert(_0x57ad80[_0x9854('0x2b')],_0x4121d3[_0x9854('0x2f')],GRAY_PERIOD_REASON);logger[_0x9854('0x28')](_0x9854('0x30'),GRAY_PERIOD_REASON[_0x9854('0x31')](),moment()[_0x9854('0xb')](_0x9854('0x32')));return _0x10195b[_0x9854('0x18')]({'data2':encryptDate(moment()[_0x9854('0xb')](_0x9854('0x32')))});}else{if(moment()[_0x9854('0x33')](decryptDate(_0x57ad80[_0x9854('0x27')]),_0x9854('0x34'))>DAYS){logger[_0x9854('0x28')](_0x9854('0x35'),moment()['format'](_0x9854('0x32')));return _0x10195b[_0x9854('0x18')]({'data1':_0x7579aa,'data2':null,'license':null});}}}else{if(_0x57ad80[_0x9854('0x2b')]!=_0x7579aa){logger['info'](_0x9854('0x36'),_0x57ad80[_0x9854('0x2b')],_0x7579aa);return _0x10195b[_0x9854('0x18')]({'data1':_0x7579aa,'data2':null,'license':null});}}}return _0x10195b;})[_0x9854('0xe')](function(_0x1b21ef){_0x10195b=_0x1b21ef;})[_0x9854('0xf')](function(_0x13517a){logger[_0x9854('0x37')](_0x13517a[_0x9854('0x38')]);})[_0x9854('0x39')](function(){setTimeout(function(){manageLicense(hardware[_0x9854('0x3a')](),_0x10195b);},TIME);});}function defaultLicense(){var _0x1c2948=hardware['getUuid']();if(_0x1c2948){return db[_0x9854('0x3b')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1c2948}})[_0x9854('0x3c')](function(_0x2bb4ab,_0x2289ef){logger[_0x9854('0x28')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1c2948);manageLicense(_0x1c2948,_0x2bb4ab);})[_0x9854('0xf')](function(_0x5aea17){logger[_0x9854('0x37')](_0x5aea17[_0x9854('0x38')]);});}}exports[_0x9854('0x3d')]=defaultLicense; \ No newline at end of file +var _0x8196=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','info','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird','version','../../mysqldb','../environment','./hardware','../logger','license','%s/api/servers/%s/check?version=%s','format','exports','GET','then','catch','createCipher','aes-256-ctr','update','base64','session','utf8','final','||FIELD||VALUE||\x0a','admin','fullname','email','|uuid|','|machineUuid|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2'];(function(_0x364bd3,_0x52291e){var _0x1b85b0=function(_0x518872){while(--_0x518872){_0x364bd3['push'](_0x364bd3['shift']());}};_0x1b85b0(++_0x52291e);}(_0x8196,0x109));var _0x6819=function(_0x5bb385,_0x2c0893){_0x5bb385=_0x5bb385-0x0;var _0x1dafdf=_0x8196[_0x5bb385];return _0x1dafdf;};'use strict';var util=require(_0x6819('0x0'));var crypto=require(_0x6819('0x1'));var moment=require(_0x6819('0x2'));var rp=require(_0x6819('0x3'));var BPromise=require(_0x6819('0x4'));var pkginfo=require('pkginfo')(module,_0x6819('0x5'));var db=require(_0x6819('0x6'))['db'];var config=require(_0x6819('0x7'));var hardware=require(_0x6819('0x8'));var logger=require(_0x6819('0x9'))(_0x6819('0xa'));var jira=require('../../api/jira/jira.controller');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xdaf366){return new BPromise(function(_0x25d508,_0x1c7529){var _0xfa1bfd=util['format'](_0x6819('0xb'),HOST,_0xdaf366,module['exports'][_0x6819('0x5')]);if(oldToken){_0xfa1bfd=util[_0x6819('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0xdaf366,module[_0x6819('0xd')]['version'],oldToken);}var _0x24167b={'uri':_0xfa1bfd,'method':_0x6819('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x24167b)[_0x6819('0xf')](function(_0x1306f1){_0x25d508(_0x1306f1);})[_0x6819('0x10')](function(_0x2711a8){_0x1c7529(_0x2711a8);});});}function encryptDate(_0x3ac0c6){var _0xfccbca=crypto[_0x6819('0x11')](_0x6819('0x12'),config['secrets']['session']);var _0x514b8a=_0xfccbca[_0x6819('0x13')](_0x3ac0c6,'utf8','base64');_0x514b8a+=_0xfccbca['final'](_0x6819('0x14'));return _0x514b8a;}function decryptDate(_0x158e0f){var _0x4f3e16=crypto['createDecipher'](_0x6819('0x12'),config['secrets'][_0x6819('0x15')]);var _0x609442=_0x4f3e16['update'](_0x158e0f,'base64',_0x6819('0x16'));_0x609442+=_0x4f3e16[_0x6819('0x17')](_0x6819('0x16'));return _0x609442;}function sendJiraAlert(_0x3ea307,_0x1a7657,_0x27f6a8){var _0x13012d=_0x6819('0x18');return db['User']['findOne']({'where':{'role':_0x6819('0x19')},'attributes':[_0x6819('0x1a'),_0x6819('0x1b')],'raw':!![]})[_0x6819('0xf')](function(_0x31dfb6){ADMIN=_0x31dfb6;_0x13012d+='|reason|'+_0x27f6a8+'|\x0a';_0x13012d+=_0x6819('0x1c')+_0x3ea307+'|\x0a';_0x13012d+=_0x6819('0x1d')+_0x1a7657+'|\x0a';_0x13012d+='|name|'+ADMIN[_0x6819('0x1a')]+'|\x0a';_0x13012d+=_0x6819('0x1e')+ADMIN[_0x6819('0x1b')]+'|\x0a';return _0x13012d;})[_0x6819('0xf')](function(_0x4feb51){var _0x316f1f=hardware[_0x6819('0x1f')]()[_0x6819('0x20')];return jira[_0x6819('0x21')]({'key':_0x6819('0x22'),'summary':_0x6819('0x23'),'description':_0x4feb51,'issuetype':_0x6819('0x24'),'oldToken':_0x3ea307,'newToken':_0x1a7657,'email':ADMIN['email'],'name':ADMIN[_0x6819('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x316f1f});});}function manageLicense(_0x10a02f,_0xdadee5){var _0x59ab99=_0xdadee5[_0x6819('0x25')]({'plain':!![]});httpRequest(_0x10a02f)['then'](function(_0x123ca6){if(oldToken){oldToken=undefined;}if(_0x123ca6['active']){if(!_0x59ab99[_0x6819('0xa')]&&_0x59ab99[_0x6819('0xa')]!=_0x123ca6['license']||_0x59ab99[_0x6819('0xa')]&&_0x59ab99['data2']){logger['info'](_0x6819('0x26'));}if(_0x59ab99[_0x6819('0xa')]&&!_0x59ab99[_0x6819('0x27')]&&_0x59ab99['license']!=_0x123ca6[_0x6819('0xa')]){logger['info'](_0x6819('0x28'));}if(_0x59ab99[_0x6819('0xa')]&&!_0x59ab99[_0x6819('0x27')]&&_0x59ab99['license']==_0x123ca6[_0x6819('0xa')]){return _0xdadee5;}return _0xdadee5['update']({'data1':_0x10a02f,'data2':null,'license':_0x123ca6[_0x6819('0xa')]});}else{if(_0x123ca6['license']||_0x59ab99[_0x6819('0xa')]){if(!_0x59ab99[_0x6819('0x27')]){if(_0x59ab99['data1']==_0x10a02f){GRAY_PERIOD_REASON=_0x6819('0x29');logger[_0x6819('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x6819('0x2b');oldToken=_0x59ab99['data1'];logger[_0x6819('0x2a')](_0x6819('0x2c'),_0x59ab99[_0x6819('0x2d')],_0x10a02f);}sendJiraAlert(_0x59ab99[_0x6819('0x2d')],_0x123ca6[_0x6819('0x2e')],GRAY_PERIOD_REASON);logger[_0x6819('0x2a')](_0x6819('0x2f'),GRAY_PERIOD_REASON[_0x6819('0x30')](),moment()[_0x6819('0xc')](_0x6819('0x31')));return _0xdadee5[_0x6819('0x13')]({'data2':encryptDate(moment()[_0x6819('0xc')](_0x6819('0x31')))});}else{if(moment()[_0x6819('0x32')](decryptDate(_0x59ab99[_0x6819('0x27')]),_0x6819('0x33'))>DAYS){logger[_0x6819('0x2a')](_0x6819('0x34'),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xdadee5[_0x6819('0x13')]({'data1':_0x10a02f,'data2':null,'license':null});}}}else{if(_0x59ab99[_0x6819('0x2d')]!=_0x10a02f){logger[_0x6819('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x59ab99[_0x6819('0x2d')],_0x10a02f);return _0xdadee5[_0x6819('0x13')]({'data1':_0x10a02f,'data2':null,'license':null});}}}return _0xdadee5;})[_0x6819('0xf')](function(_0xb0119e){_0xdadee5=_0xb0119e;})['catch'](function(_0x22dfed){logger[_0x6819('0x35')](_0x22dfed[_0x6819('0x36')]);})[_0x6819('0x37')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xdadee5);},TIME);});}function defaultLicense(){var _0x368bfb=hardware[_0x6819('0x38')]();if(_0x368bfb){return db[_0x6819('0x39')][_0x6819('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x368bfb}})['spread'](function(_0x360cf9,_0x1022b3){logger[_0x6819('0x2a')](_0x6819('0x3b'),_0x368bfb);manageLicense(_0x368bfb,_0x360cf9);})[_0x6819('0x10')](function(_0x36e8e0){logger['error'](_0x36e8e0[_0x6819('0x36')]);});}}exports[_0x6819('0x3c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b59e289..cdc7ac8 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 _0xeaad=['Demo\x20license','getLicense','License','defaults','then','crypto','util','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','deadline','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message'];(function(_0x389af3,_0x30a76a){var _0x199d87=function(_0x126178){while(--_0x126178){_0x389af3['push'](_0x389af3['shift']());}};_0x199d87(++_0x30a76a);}(_0xeaad,0x1c1));var _0xdeaa=function(_0x314cfe,_0x129a31){_0x314cfe=_0x314cfe-0x0;var _0x34b0fc=_0xeaad[_0x314cfe];return _0x34b0fc;};'use strict';var crypto=require(_0xdeaa('0x0'));var util=require(_0xdeaa('0x1'));var _=require('lodash');var moment=require(_0xdeaa('0x2'));var hardware=require(_0xdeaa('0x3'));var config=require('../environment');var db=require(_0xdeaa('0x4'))['db'];function checkLicense(_0x274d14,_0x1b0455){if(_0x274d14){try{var _0x353098=_0x1b0455||_0x274d14[_0xdeaa('0x5')];if(_[_0xdeaa('0x6')](_0x353098)){throw new Error(_0xdeaa('0x7'));}var _0x549dbc=_0x274d14[_0xdeaa('0x8')];var _0x30b1c0=_0x274d14[_0xdeaa('0x9')];var _0xa3b27e=_0x549dbc[_0xdeaa('0xa')]('-')[0x4];var _0x1740e6=_0x549dbc[_0xdeaa('0xa')]('-')[0x0];var _0x4a35b1=crypto[_0xdeaa('0xb')](_0xdeaa('0xc'),util[_0xdeaa('0xd')](_0xdeaa('0xe'),_0xa3b27e,_0x549dbc,_0x1740e6));var _0x194a33=_0x4a35b1[_0xdeaa('0xf')](_0x353098,_0xdeaa('0x10'),'utf8');_0x194a33+=_0x4a35b1[_0xdeaa('0x11')]('utf8');var _0x30115f=JSON[_0xdeaa('0x12')](_0x194a33);_0x30115f[_0xdeaa('0x13')]=![];_0x30115f[_0xdeaa('0x14')]=_0x549dbc;_0x30115f[_0xdeaa('0x15')]=hardware[_0xdeaa('0x16')]();if(_0x30b1c0){var _0x336639=crypto[_0xdeaa('0xb')](_0xdeaa('0xc'),config[_0xdeaa('0x17')][_0xdeaa('0x18')]);var _0x4195cf=_0x336639[_0xdeaa('0xf')](_0x30b1c0,_0xdeaa('0x10'),'utf8');_0x4195cf+=_0x336639[_0xdeaa('0x11')]('utf8');_0x30115f[_0xdeaa('0x19')]=_0x4195cf;_0x30115f[_0xdeaa('0x1a')]=moment(_0x4195cf)['add'](0x7,'days')[_0xdeaa('0xd')]();_0x30115f['grayReason']=_0x30115f['uuid']!=_0x30115f['machineUuid']?_0xdeaa('0x1b'):_0xdeaa('0x1c');}return _0x30115f;}catch(_0x464be4){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdeaa('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdeaa('0x1e'),'uuid':_0x274d14['data1'],'machineUuid':hardware[_0xdeaa('0x16')](),'message':_0x464be4[_0xdeaa('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdeaa('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdeaa('0x20'),'uuid':_0x274d14[_0xdeaa('0x8')],'machineUuid':hardware[_0xdeaa('0x16')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xdeaa('0x21')]=function(_0x4c2559){return db[_0xdeaa('0x22')]['find'](_[_0xdeaa('0x23')](_0x4c2559,{'raw':!![],'where':{'id':0x1}}))[_0xdeaa('0x24')](function(_0x47b88e){return checkLicense(_0x47b88e,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x5030=['./hardware','../environment','../../mysqldb','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','final','utf8','parse','uuid','machineUuid','getUuid','secrets','session','deadline','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getLicense','find','defaults','checkLicense','crypto','util','lodash','moment'];(function(_0x24ed7a,_0x38a893){var _0x4c235f=function(_0x12c994){while(--_0x12c994){_0x24ed7a['push'](_0x24ed7a['shift']());}};_0x4c235f(++_0x38a893);}(_0x5030,0xea));var _0x0503=function(_0x5b7f48,_0x4d8a1d){_0x5b7f48=_0x5b7f48-0x0;var _0x2424b0=_0x5030[_0x5b7f48];return _0x2424b0;};'use strict';var crypto=require(_0x0503('0x0'));var util=require(_0x0503('0x1'));var _=require(_0x0503('0x2'));var moment=require(_0x0503('0x3'));var hardware=require(_0x0503('0x4'));var config=require(_0x0503('0x5'));var db=require(_0x0503('0x6'))['db'];function checkLicense(_0x1008be,_0x3f3fff){if(_0x1008be){try{var _0x36aac2=_0x3f3fff||_0x1008be['license'];if(_['isEmpty'](_0x36aac2)){throw new Error(_0x0503('0x7'));}var _0xe9b99b=_0x1008be[_0x0503('0x8')];var _0x4afa23=_0x1008be['data2'];var _0x5a21d6=_0xe9b99b[_0x0503('0x9')]('-')[0x4];var _0x2be97c=_0xe9b99b[_0x0503('0x9')]('-')[0x0];var _0x6e3bf9=crypto[_0x0503('0xa')](_0x0503('0xb'),util[_0x0503('0xc')](_0x0503('0xd'),_0x5a21d6,_0xe9b99b,_0x2be97c));var _0x2e095a=_0x6e3bf9['update'](_0x36aac2,_0x0503('0xe'),'utf8');_0x2e095a+=_0x6e3bf9[_0x0503('0xf')](_0x0503('0x10'));var _0x21c710=JSON[_0x0503('0x11')](_0x2e095a);_0x21c710['demo']=![];_0x21c710[_0x0503('0x12')]=_0xe9b99b;_0x21c710[_0x0503('0x13')]=hardware[_0x0503('0x14')]();if(_0x4afa23){var _0x5eba47=crypto[_0x0503('0xa')](_0x0503('0xb'),config[_0x0503('0x15')][_0x0503('0x16')]);var _0x216209=_0x5eba47['update'](_0x4afa23,_0x0503('0xe'),_0x0503('0x10'));_0x216209+=_0x5eba47[_0x0503('0xf')]('utf8');_0x21c710['gray']=_0x216209;_0x21c710[_0x0503('0x17')]=moment(_0x216209)['add'](0x7,_0x0503('0x18'))['format']();_0x21c710[_0x0503('0x19')]=_0x21c710['uuid']!=_0x21c710['machineUuid']?_0x0503('0x1a'):_0x0503('0x1b');}return _0x21c710;}catch(_0x5a1e1e){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0503('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0503('0x1d'),'uuid':_0x1008be[_0x0503('0x8')],'machineUuid':hardware[_0x0503('0x14')](),'message':_0x5a1e1e['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0503('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x1008be[_0x0503('0x8')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x0503('0x1e')]=function(_0x1d2eb0){return db['License'][_0x0503('0x1f')](_[_0x0503('0x20')](_0x1d2eb0,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xb59918){return checkLicense(_0xb59918,null);});};exports[_0x0503('0x21')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 4327fb7..5f65e2b 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 _0x98e1=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x17d18a,_0x289108){var _0x18d146=function(_0x5e0924){while(--_0x5e0924){_0x17d18a['push'](_0x17d18a['shift']());}};_0x18d146(++_0x289108);}(_0x98e1,0x160));var _0x198e=function(_0x47e4a5,_0x38d9bd){_0x47e4a5=_0x47e4a5-0x0;var _0x3040de=_0x98e1[_0x47e4a5];return _0x3040de;};'use strict';module['exports']={'DOMAIN':_0x198e('0x0'),'SESSION_SECRET':_0x198e('0x1'),'GOOGLE_ID':_0x198e('0x2'),'GOOGLE_SECRET':_0x198e('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x5d70=['secret','exports','http://localhost:9000','app-id'];(function(_0x4a77e4,_0x556f71){var _0x1c68d8=function(_0x5d8ddf){while(--_0x5d8ddf){_0x4a77e4['push'](_0x4a77e4['shift']());}};_0x1c68d8(++_0x556f71);}(_0x5d70,0x8d));var _0x05d7=function(_0x47179e,_0x5a6ac3){_0x47179e=_0x47179e-0x0;var _0x35aa82=_0x5d70[_0x47179e];return _0x35aa82;};'use strict';module[_0x05d7('0x0')]={'DOMAIN':_0x05d7('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x05d7('0x2'),'GOOGLE_SECRET':_0x05d7('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9ba6f48..86f405c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe23=['Console','env','debugLevel','moment','winston','util','path','INFO','join','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','error','File','%s-%s','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfe23,0xe9));var _0x3fe2=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xfe23[_0x3b0731];return _0x4204d7;};'use strict';var moment=require(_0x3fe2('0x0'));var winston=require(_0x3fe2('0x1'));var util=require(_0x3fe2('0x2'));var path=require(_0x3fe2('0x3'));var debugLevel=_0x3fe2('0x4');function filename(_0x4124fb,_0x399b62){return path[_0x3fe2('0x5')]('/var',_0x3fe2('0x6'),_0x3fe2('0x7'),util[_0x3fe2('0x8')](_0x3fe2('0x9'),_0x4124fb,_0x399b62));}function formatter(_0x1a28cd,_0x2e9ef1){return util[_0x3fe2('0x8')](_0x3fe2('0xa'),moment()['format'](_0x3fe2('0xb')),_0x2e9ef1[_0x3fe2('0xc')][_0x3fe2('0xd')](),_0x1a28cd,_0x2e9ef1['message']);}module['exports']=function(_0x909213){return new winston[(_0x3fe2('0xe'))]({'transports':[new winston[(_0x3fe2('0xf'))]['File']({'name':util[_0x3fe2('0x8')]('%s-%s',_0x909213,'error'),'filename':filename(_0x909213,'error'),'level':_0x3fe2('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x420925){return formatter(_0x909213,_0x420925);}}),new winston[(_0x3fe2('0xf'))][(_0x3fe2('0x11'))]({'name':util[_0x3fe2('0x8')](_0x3fe2('0x12'),_0x909213,_0x3fe2('0x13')),'filename':filename(_0x909213,_0x3fe2('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x31b5c2){return formatter(_0x909213,_0x31b5c2);}}),new winston[(_0x3fe2('0xf'))][(_0x3fe2('0x14'))]({'level':process[_0x3fe2('0x15')][_0x3fe2('0x16')]||debugLevel,'json':![],'formatter':function(_0x1141a2){return formatter(_0x909213,_0x1141a2);}})]});}; \ No newline at end of file +var _0x52ad=['error','%s-%s','info','transports','Console','debugLevel','moment','winston','util','INFO','join','/var','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','File'];(function(_0x43822a,_0x33bd7d){var _0x42bca7=function(_0x95df41){while(--_0x95df41){_0x43822a['push'](_0x43822a['shift']());}};_0x42bca7(++_0x33bd7d);}(_0x52ad,0xe2));var _0xd52a=function(_0xc21159,_0x3b1f87){_0xc21159=_0xc21159-0x0;var _0xa378ae=_0x52ad[_0xc21159];return _0xa378ae;};'use strict';var moment=require(_0xd52a('0x0'));var winston=require(_0xd52a('0x1'));var util=require(_0xd52a('0x2'));var path=require('path');var debugLevel=_0xd52a('0x3');function filename(_0x369da6,_0x43d0b1){return path[_0xd52a('0x4')](_0xd52a('0x5'),'log',_0xd52a('0x6'),util[_0xd52a('0x7')]('%s-%s.log',_0x369da6,_0x43d0b1));}function formatter(_0x15b894,_0x40de86){return util['format'](_0xd52a('0x8'),moment()[_0xd52a('0x7')](_0xd52a('0x9')),_0x40de86['level'][_0xd52a('0xa')](),_0x15b894,_0x40de86[_0xd52a('0xb')]);}module[_0xd52a('0xc')]=function(_0x5dba73){return new winston['Logger']({'transports':[new winston['transports'][(_0xd52a('0xd'))]({'name':util['format']('%s-%s',_0x5dba73,'error'),'filename':filename(_0x5dba73,_0xd52a('0xe')),'level':_0xd52a('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2d5b73){return formatter(_0x5dba73,_0x2d5b73);}}),new winston['transports'][(_0xd52a('0xd'))]({'name':util[_0xd52a('0x7')](_0xd52a('0xf'),_0x5dba73,_0xd52a('0x10')),'filename':filename(_0x5dba73,_0xd52a('0x10')),'level':_0xd52a('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x43be53){return formatter(_0x5dba73,_0x43be53);}}),new winston[(_0xd52a('0x11'))][(_0xd52a('0x12'))]({'level':process['env'][_0xd52a('0x13')]||debugLevel,'json':![],'formatter':function(_0x4caa18){return formatter(_0x5dba73,_0x4caa18);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d4a5be4..e7b9b11 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 _0x6c65=['../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x561197,_0x2d7d64){var _0x191270=function(_0x32d6e2){while(--_0x32d6e2){_0x561197['push'](_0x561197['shift']());}};_0x191270(++_0x2d7d64);}(_0x6c65,0x8f));var _0x56c6=function(_0x356596,_0x1a1a8c){_0x356596=_0x356596-0x0;var _0x231fa9=_0x6c65[_0x356596];return _0x231fa9;};'use strict';var path=require(_0x56c6('0x0'));var os=require('os');var config={'apps':[{'name':_0x56c6('0x1'),'script':path[_0x56c6('0x2')](__dirname,_0x56c6('0x3'))},{'name':_0x56c6('0x4'),'script':path['join'](__dirname,_0x56c6('0x5'))},{'name':_0x56c6('0x6'),'script':path['join'](__dirname,_0x56c6('0x7'))},{'name':_0x56c6('0x8'),'script':path[_0x56c6('0x2')](__dirname,_0x56c6('0x9'))},{'name':_0x56c6('0xa'),'script':path[_0x56c6('0x2')](__dirname,_0x56c6('0xb'))},{'name':_0x56c6('0xc'),'script':path[_0x56c6('0x2')](__dirname,_0x56c6('0xd'))}]};module['exports']=config; \ No newline at end of file +var _0x7b9d=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','../../services/routing/index.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b9d,0xa1));var _0xd7b9=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x7b9d[_0x113e32];return _0x4ff939;};'use strict';var path=require(_0xd7b9('0x0'));var os=require('os');var config={'apps':[{'name':_0xd7b9('0x1'),'script':path[_0xd7b9('0x2')](__dirname,_0xd7b9('0x3'))},{'name':_0xd7b9('0x4'),'script':path[_0xd7b9('0x2')](__dirname,_0xd7b9('0x5'))},{'name':'agi','script':path[_0xd7b9('0x2')](__dirname,_0xd7b9('0x6'))},{'name':'email','script':path[_0xd7b9('0x2')](__dirname,_0xd7b9('0x7'))},{'name':'routing','script':path['join'](__dirname,_0xd7b9('0x8'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0xd7b9('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 3f0bd0d..ddbbdb6 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 _0x3e74=['saved','pm2','./config','connected','then','start','disconnect','stop','list','describe','delete','dump'];(function(_0x466962,_0x56850a){var _0x5a2ed1=function(_0x68cd8d){while(--_0x68cd8d){_0x466962['push'](_0x466962['shift']());}};_0x5a2ed1(++_0x56850a);}(_0x3e74,0x175));var _0x43e7=function(_0xeca02,_0x59bd14){_0xeca02=_0xeca02-0x0;var _0x22f972=_0x3e74[_0xeca02];return _0x22f972;};'use strict';var pm2=require(_0x43e7('0x0'));var BPromise=require('bluebird');var config=require(_0x43e7('0x1'));function connect(){return new BPromise(function(_0x287a1d,_0x151ad2){return pm2['connect'](function(_0x490ced){if(_0x490ced){return _0x151ad2(_0x490ced);}return _0x287a1d(_0x43e7('0x2'));});});};exports['start']=function(_0x128b0f){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0xe78cb7,_0x1c503b){return pm2[_0x43e7('0x4')](_0x128b0f,function(_0x503698,_0x45a0d1){if(_0x503698){return _0x1c503b(_0x503698);}pm2[_0x43e7('0x5')]();return _0xe78cb7(_0x45a0d1);});});});};exports[_0x43e7('0x6')]=function(_0x8528fc){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x516b4d,_0x212c6c){return pm2['stop'](_0x8528fc,function(_0x54948c,_0x39c8bd){if(_0x54948c){return _0x212c6c(_0x54948c);}pm2[_0x43e7('0x5')]();return _0x516b4d(_0x39c8bd);});});});};exports['restart']=function(_0x2803d9){return connect()['then'](function(){return new BPromise(function(_0xf7c520,_0x37302c){return pm2['restart'](_0x2803d9,function(_0x3eb206,_0xc960ea){if(_0x3eb206){return _0x37302c(_0x3eb206);}pm2[_0x43e7('0x5')]();return _0xf7c520(_0xc960ea);});});});};exports[_0x43e7('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x583d85,_0x2fcb36){return pm2[_0x43e7('0x7')](function(_0x44b0bd,_0x51b974){if(_0x44b0bd){return _0x2fcb36(_0x44b0bd);}pm2['disconnect']();return _0x583d85(_0x51b974);});});});};exports[_0x43e7('0x8')]=function(_0x14c146){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x328445,_0x4de324){return pm2['describe'](_0x14c146,function(_0xdf16c,_0x264575){if(_0xdf16c){return _0x4de324(_0xdf16c);}pm2[_0x43e7('0x5')]();return _0x328445(_0x264575);});});});};exports['delete']=function(_0x4b5a6b){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0x1ca758,_0x9037d3){return pm2[_0x43e7('0x9')](_0x4b5a6b,function(_0x3776f5,_0x1f24fb){if(_0x3776f5){return _0x9037d3(_0x3776f5);}pm2[_0x43e7('0x5')]();return _0x1ca758(_0x1f24fb);});});});};exports[_0x43e7('0xa')]=function(){return connect()[_0x43e7('0x3')](function(){return new BPromise(function(_0xab63cf,_0x191dd5){return pm2[_0x43e7('0xa')](function(_0x4b5d64){if(_0x4b5d64){return _0x191dd5(_0x4b5d64);}return _0xab63cf(_0x43e7('0xb'));});});});}; \ No newline at end of file +var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x3293f2,_0x8810ba){var _0xcd1284=function(_0x10d146){while(--_0x10d146){_0x3293f2['push'](_0x3293f2['shift']());}};_0xcd1284(++_0x8810ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d664d,_0xf9d0fd){_0x4d664d=_0x4d664d-0x0;var _0x1fed9e=_0xedd9[_0x4d664d];return _0x1fed9e;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 62775fb..25320c1 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 _0x1c4d=['subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','catch','error','moment','ioredis','../../mysqldb','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll'];(function(_0x1129d5,_0x20209d){var _0x436792=function(_0x31c1a8){while(--_0x31c1a8){_0x1129d5['push'](_0x1129d5['shift']());}};_0x436792(++_0x20209d);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x3493c8,_0x3531ea){_0x3493c8=_0x3493c8-0x0;var _0x3fdb36=_0x1c4d[_0x3493c8];return _0x3fdb36;};'use strict';var _=require('lodash');var moment=require(_0xd1c4('0x0'));var Redis=require(_0xd1c4('0x1'));var db=require(_0xd1c4('0x2'))['db'];var config=require('../../config/environment');config[_0xd1c4('0x3')]=_[_0xd1c4('0x4')](config[_0xd1c4('0x3')],{'host':_0xd1c4('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd1c4('0x3')]));function closeInteractions(){var _0x5c3470=0x0;var _0x406eb6=[];return db[_0xd1c4('0x6')][_0xd1c4('0x7')]({'raw':!![],'attributes':['id',_0xd1c4('0x8')],'where':{'id':0x1}})[_0xd1c4('0x9')](function(_0xc9284c){_0x5c3470=_0xc9284c['chatTimeout'];if(_0x5c3470){return db[_0xd1c4('0xa')][_0xd1c4('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd1c4('0xc')](_0xc9284c['chatTimeout'],_0xd1c4('0xd'))}}});}else{return[];}})[_0xd1c4('0x9')](function(_0x430296){_0x406eb6=_0x430296;if(_0x5c3470){return db[_0xd1c4('0xa')][_0xd1c4('0xe')]({'closeReason':_0xd1c4('0xf'),'disposition':_0xd1c4('0x10'),'closed':!![],'closedAt':moment()[_0xd1c4('0x11')](_0xd1c4('0x12'))},{'where':{'id':_[_0xd1c4('0x13')](_0x406eb6||[],'id')}});}})[_0xd1c4('0x9')](function(_0x4f5d13){for(var _0x15792b=0x0;_0x15792b<_0x406eb6[_0xd1c4('0x14')];_0x15792b++){io['emit']('chatInteraction:update',{'id':_0x406eb6[_0x15792b]['id'],'closed':!![]});}})[_0xd1c4('0x15')](function(_0x5bec0f){console[_0xd1c4('0x16')](_0x5bec0f);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdcac=['lastMsgAt','subtract','minutes','update','system','timeout','format','map','length','chatInteraction:update','catch','error','start','moment','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0xdcac,0x139));var _0xcdca=function(_0x1ed4b8,_0x346217){_0x1ed4b8=_0x1ed4b8-0x0;var _0x15d0a3=_0xdcac[_0x1ed4b8];return _0x15d0a3;};'use strict';var _=require('lodash');var moment=require(_0xcdca('0x0'));var Redis=require('ioredis');var db=require(_0xcdca('0x1'))['db'];var config=require(_0xcdca('0x2'));config[_0xcdca('0x3')]=_[_0xcdca('0x4')](config[_0xcdca('0x3')],{'host':_0xcdca('0x5'),'port':0x18eb});var io=require(_0xcdca('0x6'))(new Redis(config[_0xcdca('0x3')]));function closeInteractions(){var _0x1a592c=0x0;var _0xc2701=[];return db[_0xcdca('0x7')]['find']({'raw':!![],'attributes':['id',_0xcdca('0x8')],'where':{'id':0x1}})[_0xcdca('0x9')](function(_0x5ad4c1){_0x1a592c=_0x5ad4c1['chatTimeout'];if(_0x1a592c){return db[_0xcdca('0xa')][_0xcdca('0xb')]({'raw':!![],'attributes':['id',_0xcdca('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcdca('0xd')](_0x5ad4c1[_0xcdca('0x8')],_0xcdca('0xe'))}}});}else{return[];}})['then'](function(_0x15b9b9){_0xc2701=_0x15b9b9;if(_0x1a592c){return db[_0xcdca('0xa')][_0xcdca('0xf')]({'closeReason':_0xcdca('0x10'),'disposition':_0xcdca('0x11'),'closed':!![],'closedAt':moment()[_0xcdca('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xcdca('0x13')](_0xc2701||[],'id')}});}})[_0xcdca('0x9')](function(_0x1429ed){for(var _0x6adba7=0x0;_0x6adba7<_0xc2701[_0xcdca('0x14')];_0x6adba7++){io['emit'](_0xcdca('0x15'),{'id':_0xc2701[_0x6adba7]['id'],'closed':!![]});}})[_0xcdca('0x16')](function(_0x1d87d6){console[_0xcdca('0x17')](_0x1d87d6);});}exports[_0xcdca('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e61e59f..8a03945 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 _0x613b=['request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','catch','CustomReportId','Schedule','findAll','keys','map','toString','keyBy','difference','length','exists','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','stop','stop\x20cron','endAt','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','user','bcc','name','join','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent'];(function(_0x410201,_0x413c7c){var _0x1ce8d6=function(_0x25cdf2){while(--_0x25cdf2){_0x410201['push'](_0x410201['shift']());}};_0x1ce8d6(++_0x413c7c);}(_0x613b,0x1a0));var _0xb613=function(_0x3f3010,_0x1ecb0d){_0x3f3010=_0x3f3010-0x0;var _0x411a93=_0x613b[_0x3f3010];return _0x411a93;};'use strict';var fs=require('fs');var util=require(_0xb613('0x0'));var path=require(_0xb613('0x1'));var _=require(_0xb613('0x2'));var moment=require(_0xb613('0x3'));var CronJobManager=require(_0xb613('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xb613('0x5'));var logger=require(_0xb613('0x6'))(_0xb613('0x7'));var db=require(_0xb613('0x8'))['db'];var analyticCustomReportController=require(_0xb613('0x9'));var analyticDefaultReportController=require(_0xb613('0xa'));var client=jayson[_0xb613('0xb')][_0xb613('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x7f7254,_0xafe04f){return function(){logger[_0xb613('0xd')](_0xb613('0xe'),_0x7f7254[_0xb613('0xf')]);var _0x457761=!![];var _0x4e50f3={'tls':{'rejectUnauthorized':![]}};if(_0x7f7254[_0xb613('0x10')][_0xb613('0x11')][_0xb613('0x12')]){_0x4e50f3['service']=_0x7f7254['MailAccount'][_0xb613('0x11')][_0xb613('0x12')];}else{_0x4e50f3[_0xb613('0x13')]=_0x7f7254[_0xb613('0x10')][_0xb613('0x11')][_0xb613('0x13')];_0x4e50f3[_0xb613('0x14')]=_0x7f7254[_0xb613('0x10')][_0xb613('0x11')]['port'];_0x4e50f3[_0xb613('0x15')]=_0x7f7254[_0xb613('0x10')][_0xb613('0x11')][_0xb613('0x15')];}if(_0x7f7254['MailAccount']['Smtp'][_0xb613('0x16')]){_0x4e50f3['auth']={'user':_0x7f7254[_0xb613('0x10')]['Smtp']['user'],'pass':_0x7f7254[_0xb613('0x10')][_0xb613('0x11')][_0xb613('0x17')]};}var _0x246969={'account':_0x4e50f3,'message':{'from':util[_0xb613('0x18')](_0xb613('0x19'),_0x7f7254[_0xb613('0x10')]['name'],_0x7f7254[_0xb613('0x10')][_0xb613('0xf')]||_0x7f7254['MailAccount'][_0xb613('0x11')][_0xb613('0x1a')]),'to':_0x7f7254['email'],'cc':_0x7f7254['cc'],'bcc':_0x7f7254[_0xb613('0x1b')],'subject':util[_0xb613('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0xafe04f[_0xb613('0x1c')],_0x7f7254['subtractNumber'],_0x7f7254['subtractUnit'])}};var _0xbc0ead=path[_0xb613('0x1d')](__dirname,'../../files/reports');var _0x43eff0=_0xafe04f[_0xb613('0x1e')];var _0x5ca485=util[_0xb613('0x18')]('%s.%s',path[_0xb613('0x1f')](_0xafe04f['savename'],path[_0xb613('0x20')](_0xafe04f['savename'])),_0xb613('0x21'));var _0x1bf41d=path[_0xb613('0x1d')](_0xbc0ead,_0x43eff0);var _0x31e21b=path[_0xb613('0x1d')](_0xbc0ead,_0x5ca485);if(fs[_0xb613('0x22')](_0x1bf41d)){_0xafe04f[_0xb613('0x23')]=_0xb613('0x24');_0x246969[_0xb613('0x25')][_0xb613('0x26')]=[{'filename':_0x43eff0,'path':_0x1bf41d}];_0x246969[_0xb613('0x25')][_0xb613('0x27')]=util[_0xb613('0x18')](_0xb613('0x28'),JSON[_0xb613('0x29')](_0xafe04f,null,0x2));}else if(fs['existsSync'](_0x31e21b)){_0xafe04f[_0xb613('0x23')]=_0xb613('0x24');_0x246969[_0xb613('0x25')]['attachments']=[{'filename':_0x5ca485,'path':_0x31e21b}];}else{_0x246969[_0xb613('0x25')]['text']=_0xb613('0x2a');if(!_0x7f7254['sendIfEmpty']){_0x457761=![];logger[_0xb613('0xd')](_0xb613('0x2b'));}}if(_0x457761){return client[_0xb613('0x2c')](_0xb613('0x2d'),_0x246969)['then'](function(_0x125183){if(_0x125183[_0xb613('0x2e')]){return logger[_0xb613('0x2e')](_0xb613('0x2f'),JSON[_0xb613('0x29')](_0x125183));}return logger['info'](_0xb613('0x30'));})['catch'](function(_0x5cf002){return logger[_0xb613('0x2e')](_0xb613('0x2f'),JSON[_0xb613('0x29')](_0x5cf002));});}};}function handleError(){return function(_0x40e921){return logger[_0xb613('0x2e')](JSON[_0xb613('0x29')](_0x40e921));};}function handleResult(_0x34d91c){return function(_0x5cd067){logger[_0xb613('0xd')](_0xb613('0x31'),JSON['stringify'](_0x5cd067));if(_0x34d91c['MailAccount']&&_0x34d91c[_0xb613('0x10')][_0xb613('0x11')]&&!_[_0xb613('0x32')](_0x34d91c[_0xb613('0xf')])){setTimeout(handleSendEmail(_0x34d91c,_0x5cd067),0x3c*0x3e8);}};}function handleJob(_0x8449d6){return function(){try{if(_['isNil'](_0x8449d6[_0xb613('0x33')])){return logger['info'](_0xb613('0x34'));}if(_[_0xb613('0x32')](_0x8449d6[_0xb613('0x35')])){return logger[_0xb613('0xd')](_0xb613('0x36'));}var _0x4d6f2a={'startDate':moment()[_0xb613('0x37')](_0x8449d6[_0xb613('0x33')],_0x8449d6['subtractUnit'])[_0xb613('0x18')](_0xb613('0x38')),'endDate':moment()[_0xb613('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb613('0x39'),'output':_0x8449d6[_0xb613('0x3a')],'name':_0x8449d6['name']};if(!_['isNil'](_0x8449d6['DefaultReportId'])){logger[_0xb613('0xd')](_0xb613('0x3b'),_0x8449d6[_0xb613('0x3c')]);return analyticDefaultReportController[_0xb613('0x3d')]({'id':_0x8449d6['DefaultReportId']},_0x4d6f2a)[_0xb613('0x3e')](handleResult(_0x8449d6))[_0xb613('0x3f')](handleError());}if(!_[_0xb613('0x32')](_0x8449d6[_0xb613('0x40')])){logger[_0xb613('0xd')]('exec\x20custom\x20report\x20id:%s',_0x8449d6['CustomReportId']);return analyticCustomReportController[_0xb613('0x3d')]({'id':_0x8449d6[_0xb613('0x40')]},_0x4d6f2a)[_0xb613('0x3e')](handleResult(_0x8449d6))[_0xb613('0x3f')](handleError());}}catch(_0x54fbe6){logger[_0xb613('0x2e')](JSON[_0xb613('0x29')](_0x54fbe6));}return logger[_0xb613('0xd')]('no\x20report\x20id');};}function getJobs(_0x2306df){var _0xe4237b={};if(_0x2306df){_0xe4237b['id']=_0x2306df;}return db[_0xb613('0x41')][_0xb613('0x42')]({'where':_0xe4237b,'include':[{'model':db[_0xb613('0x10')],'attributes':['id',_0xb613('0x1c'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0xb613('0x3e')](function(_0x314a32){var _0x42f684=_[_0xb613('0x43')](manager['jobs']);var _0x5890ae=_[_0xb613('0x44')](_0x314a32,function(_0xc6a27e){return _0xc6a27e['id'][_0xb613('0x45')]();});var _0xc731da=_[_0xb613('0x46')](_0x314a32,function(_0x5d3c80){return _0x5d3c80['id'][_0xb613('0x45')]();});var _0x5dce98=_0x2306df?_0x5890ae:_[_0xb613('0x47')](_0x5890ae,_0x42f684);var _0x29898f=_['intersection'](_0x5890ae,_0x42f684);var _0x177729=_[_0xb613('0x47')](_0x42f684,_0x5890ae);var _0x477908;var _0x33ebbc;for(_0x477908=0x0;_0x477908<_0x177729[_0xb613('0x48')]&&!_0x2306df;_0x477908+=0x1){_0x33ebbc=_0x177729[_0x477908]['toString']();if(manager[_0xb613('0x49')](_0x33ebbc)){manager['stop'](_0x33ebbc);manager[_0xb613('0x4a')](_0x33ebbc);logger[_0xb613('0xd')](_0xb613('0x4b'),_0x33ebbc);}}logger[_0xb613('0xd')](_0xb613('0x4c'),JSON['stringify'](_0x5dce98));for(_0x477908=0x0;_0x477908<_0x5dce98[_0xb613('0x48')];_0x477908+=0x1){_0x33ebbc=_0x5dce98[_0x477908][_0xb613('0x45')]();logger[_0xb613('0xd')]('index',_0x33ebbc);if(_0x2306df){logger[_0xb613('0xd')](_0xb613('0x4d'),_0x2306df);logger['info'](JSON['stringify'](_0xc731da[_0x33ebbc]));BPromise[_0xb613('0x4e')]()[_0xb613('0x3e')](handleJob(_0xc731da[_0x33ebbc]));logger[_0xb613('0xd')](_0xb613('0x4f'),_0xc731da[_0x33ebbc]['name'],_0xc731da[_0x33ebbc][_0xb613('0x50')]);}else if(_0xc731da[_0x33ebbc][_0xb613('0x50')]&&_0xc731da[_0x33ebbc][_0xb613('0x51')]&&moment()[_0xb613('0x52')](_0xc731da[_0x33ebbc][_0xb613('0x53')],_0xc731da[_0x33ebbc]['endAt'])){manager[_0xb613('0x54')](_0x33ebbc,_0xc731da[_0x33ebbc][_0xb613('0x50')],handleJob(_0xc731da[_0x33ebbc]));manager[_0xb613('0x55')](_0x33ebbc);logger[_0xb613('0xd')]('add\x20cron',_0xc731da[_0x33ebbc][_0xb613('0x1c')],_0xc731da[_0x33ebbc]['cron']);}else if(manager[_0xb613('0x49')](_0x33ebbc)){manager[_0xb613('0x56')](_0x33ebbc);manager['deleteJob'](_0x33ebbc);logger[_0xb613('0xd')](_0xb613('0x57'),_0xc731da[_0x33ebbc][_0xb613('0x1c')],_0xc731da[_0x33ebbc][_0xb613('0x50')]);}}for(_0x477908=0x0,_0x33ebbc;_0x477908<_0x29898f[_0xb613('0x48')]&&!_0x2306df;_0x477908+=0x1){_0x33ebbc=_0x29898f[_0x477908]['toString']();if(manager['exists'](_0x33ebbc)){if(_0xc731da[_0x33ebbc]['cron']&&_0xc731da[_0x33ebbc][_0xb613('0x51')]&&moment()['isBetween'](_0xc731da[_0x33ebbc][_0xb613('0x53')],_0xc731da[_0x33ebbc][_0xb613('0x58')])){manager[_0xb613('0x59')](_0x33ebbc,_0xc731da[_0x33ebbc][_0xb613('0x50')],handleJob(_0xc731da[_0x33ebbc]));logger[_0xb613('0xd')](_0xb613('0x5a'),_0xc731da[_0x33ebbc][_0xb613('0x1c')],_0xc731da[_0x33ebbc][_0xb613('0x50')]);}else{manager[_0xb613('0x56')](_0x33ebbc);manager[_0xb613('0x4a')](_0x33ebbc);logger[_0xb613('0xd')]('stop\x20cron',_0xc731da[_0x33ebbc]['name'],_0xc731da[_0x33ebbc][_0xb613('0x50')]);}}}})[_0xb613('0x3f')](function(_0x2d9dec){logger[_0xb613('0x2e')](JSON['stringify'](_0x2d9dec));});}exports[_0xb613('0x5b')]=function(_0x30cb0c){return getJobs(_0x30cb0c);};exports[_0xb613('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x30e6=['runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','keyBy','toString','difference','intersection','exists','deleteJob','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','startAt','endAt','add','start','stop','stop\x20cron','isBetween','update','update\x20cron','run','util','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','auth','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s'];(function(_0xf01bb1,_0x34dbe){var _0x5e8de0=function(_0x4691ca){while(--_0x4691ca){_0xf01bb1['push'](_0xf01bb1['shift']());}};_0x5e8de0(++_0x34dbe);}(_0x30e6,0x188));var _0x630e=function(_0x2b498e,_0xd73716){_0x2b498e=_0x2b498e-0x0;var _0x1477cd=_0x30e6[_0x2b498e];return _0x1477cd;};'use strict';var fs=require('fs');var util=require(_0x630e('0x0'));var path=require('path');var _=require(_0x630e('0x1'));var moment=require(_0x630e('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x630e('0x3'));var BPromise=require(_0x630e('0x4'));var logger=require(_0x630e('0x5'))(_0x630e('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x630e('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x630e('0x8')][_0x630e('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5f285b,_0x353c77){return function(){logger[_0x630e('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5f285b[_0x630e('0xb')]);var _0x9c6bf0=!![];var _0x48f266={'tls':{'rejectUnauthorized':![]}};if(_0x5f285b[_0x630e('0xc')][_0x630e('0xd')][_0x630e('0xe')]){_0x48f266[_0x630e('0xe')]=_0x5f285b[_0x630e('0xc')]['Smtp'][_0x630e('0xe')];}else{_0x48f266[_0x630e('0xf')]=_0x5f285b[_0x630e('0xc')]['Smtp'][_0x630e('0xf')];_0x48f266[_0x630e('0x10')]=_0x5f285b['MailAccount'][_0x630e('0xd')][_0x630e('0x10')];_0x48f266[_0x630e('0x11')]=_0x5f285b[_0x630e('0xc')][_0x630e('0xd')][_0x630e('0x11')];}if(_0x5f285b[_0x630e('0xc')]['Smtp']['authentication']){_0x48f266[_0x630e('0x12')]={'user':_0x5f285b['MailAccount'][_0x630e('0xd')][_0x630e('0x13')],'pass':_0x5f285b[_0x630e('0xc')][_0x630e('0xd')]['pass']};}var _0x67921e={'account':_0x48f266,'message':{'from':util[_0x630e('0x14')](_0x630e('0x15'),_0x5f285b[_0x630e('0xc')][_0x630e('0x16')],_0x5f285b[_0x630e('0xc')]['email']||_0x5f285b[_0x630e('0xc')][_0x630e('0xd')][_0x630e('0x13')]),'to':_0x5f285b[_0x630e('0xb')],'cc':_0x5f285b['cc'],'bcc':_0x5f285b[_0x630e('0x17')],'subject':util['format'](_0x630e('0x18'),_0x353c77[_0x630e('0x16')],_0x5f285b[_0x630e('0x19')],_0x5f285b[_0x630e('0x1a')])}};var _0x2bf161=path[_0x630e('0x1b')](__dirname,_0x630e('0x1c'));var _0x426140=_0x353c77[_0x630e('0x1d')];var _0x26cd56=util[_0x630e('0x14')](_0x630e('0x1e'),path[_0x630e('0x1f')](_0x353c77[_0x630e('0x1d')],path[_0x630e('0x20')](_0x353c77[_0x630e('0x1d')])),_0x630e('0x21'));var _0x87618c=path[_0x630e('0x1b')](_0x2bf161,_0x426140);var _0x24a8c7=path[_0x630e('0x1b')](_0x2bf161,_0x26cd56);if(fs['existsSync'](_0x87618c)){_0x353c77[_0x630e('0x22')]=_0x630e('0x23');_0x67921e[_0x630e('0x24')][_0x630e('0x25')]=[{'filename':_0x426140,'path':_0x87618c}];_0x67921e[_0x630e('0x24')]['text']=util[_0x630e('0x14')](_0x630e('0x26'),JSON['stringify'](_0x353c77,null,0x2));}else if(fs[_0x630e('0x27')](_0x24a8c7)){_0x353c77['status']=_0x630e('0x23');_0x67921e[_0x630e('0x24')]['attachments']=[{'filename':_0x26cd56,'path':_0x24a8c7}];}else{_0x67921e[_0x630e('0x24')][_0x630e('0x28')]=_0x630e('0x29');if(!_0x5f285b['sendIfEmpty']){_0x9c6bf0=![];logger[_0x630e('0xa')](_0x630e('0x2a'));}}if(_0x9c6bf0){return client[_0x630e('0x2b')](_0x630e('0x2c'),_0x67921e)[_0x630e('0x2d')](function(_0x30e9ea){if(_0x30e9ea[_0x630e('0x2e')]){return logger[_0x630e('0x2e')](_0x630e('0x2f'),JSON[_0x630e('0x30')](_0x30e9ea));}return logger['info'](_0x630e('0x31'));})[_0x630e('0x32')](function(_0x5d3f52){return logger[_0x630e('0x2e')](_0x630e('0x2f'),JSON[_0x630e('0x30')](_0x5d3f52));});}};}function handleError(){return function(_0x15de7c){return logger[_0x630e('0x2e')](JSON['stringify'](_0x15de7c));};}function handleResult(_0x3fc07a){return function(_0x38ddc5){logger[_0x630e('0xa')](_0x630e('0x33'),JSON[_0x630e('0x30')](_0x38ddc5));if(_0x3fc07a['MailAccount']&&_0x3fc07a[_0x630e('0xc')][_0x630e('0xd')]&&!_[_0x630e('0x34')](_0x3fc07a[_0x630e('0xb')])){setTimeout(handleSendEmail(_0x3fc07a,_0x38ddc5),0x3c*0x3e8);}};}function handleJob(_0x2ea9ac){return function(){try{if(_['isNil'](_0x2ea9ac[_0x630e('0x19')])){return logger[_0x630e('0xa')](_0x630e('0x35'));}if(_[_0x630e('0x34')](_0x2ea9ac[_0x630e('0x1a')])){return logger[_0x630e('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0xb5b9fc={'startDate':moment()['subtract'](_0x2ea9ac[_0x630e('0x19')],_0x2ea9ac[_0x630e('0x1a')])[_0x630e('0x14')](_0x630e('0x36')),'endDate':moment()[_0x630e('0x14')](_0x630e('0x36')),'type':'scheduled','output':_0x2ea9ac[_0x630e('0x37')],'name':_0x2ea9ac[_0x630e('0x16')]};if(!_['isNil'](_0x2ea9ac[_0x630e('0x38')])){logger[_0x630e('0xa')](_0x630e('0x39'),_0x2ea9ac[_0x630e('0x38')]);return analyticDefaultReportController[_0x630e('0x3a')]({'id':_0x2ea9ac[_0x630e('0x38')]},_0xb5b9fc)[_0x630e('0x2d')](handleResult(_0x2ea9ac))[_0x630e('0x32')](handleError());}if(!_[_0x630e('0x34')](_0x2ea9ac[_0x630e('0x3b')])){logger['info'](_0x630e('0x3c'),_0x2ea9ac[_0x630e('0x3b')]);return analyticCustomReportController[_0x630e('0x3a')]({'id':_0x2ea9ac['CustomReportId']},_0xb5b9fc)[_0x630e('0x2d')](handleResult(_0x2ea9ac))['catch'](handleError());}}catch(_0xe52224){logger[_0x630e('0x2e')](JSON[_0x630e('0x30')](_0xe52224));}return logger[_0x630e('0xa')](_0x630e('0x3d'));};}function getJobs(_0x447b06){var _0x163517={};if(_0x447b06){_0x163517['id']=_0x447b06;}return db['Schedule'][_0x630e('0x3e')]({'where':_0x163517,'include':[{'model':db[_0x630e('0xc')],'attributes':['id',_0x630e('0x16'),'email'],'include':[{'model':db[_0x630e('0x3f')],'as':_0x630e('0xd')}]}]})[_0x630e('0x2d')](function(_0x5996e3){var _0x43e6de=_[_0x630e('0x40')](manager[_0x630e('0x41')]);var _0xbf5b8=_['map'](_0x5996e3,function(_0xcf80a4){return _0xcf80a4['id']['toString']();});var _0x342319=_[_0x630e('0x42')](_0x5996e3,function(_0x5b1f5b){return _0x5b1f5b['id'][_0x630e('0x43')]();});var _0x1c1403=_0x447b06?_0xbf5b8:_[_0x630e('0x44')](_0xbf5b8,_0x43e6de);var _0x91e2f1=_[_0x630e('0x45')](_0xbf5b8,_0x43e6de);var _0x1755b2=_[_0x630e('0x44')](_0x43e6de,_0xbf5b8);var _0x26e275;var _0x2c73f5;for(_0x26e275=0x0;_0x26e275<_0x1755b2['length']&&!_0x447b06;_0x26e275+=0x1){_0x2c73f5=_0x1755b2[_0x26e275][_0x630e('0x43')]();if(manager[_0x630e('0x46')](_0x2c73f5)){manager['stop'](_0x2c73f5);manager[_0x630e('0x47')](_0x2c73f5);logger[_0x630e('0xa')](_0x630e('0x48'),_0x2c73f5);}}logger['info'](_0x630e('0x49'),JSON[_0x630e('0x30')](_0x1c1403));for(_0x26e275=0x0;_0x26e275<_0x1c1403[_0x630e('0x4a')];_0x26e275+=0x1){_0x2c73f5=_0x1c1403[_0x26e275][_0x630e('0x43')]();logger[_0x630e('0xa')](_0x630e('0x4b'),_0x2c73f5);if(_0x447b06){logger['info'](_0x630e('0x4c'),_0x447b06);logger[_0x630e('0xa')](JSON[_0x630e('0x30')](_0x342319[_0x2c73f5]));BPromise['resolve']()[_0x630e('0x2d')](handleJob(_0x342319[_0x2c73f5]));logger[_0x630e('0xa')](_0x630e('0x4d'),_0x342319[_0x2c73f5]['name'],_0x342319[_0x2c73f5][_0x630e('0x4e')]);}else if(_0x342319[_0x2c73f5][_0x630e('0x4e')]&&_0x342319[_0x2c73f5][_0x630e('0x4f')]&&moment()['isBetween'](_0x342319[_0x2c73f5][_0x630e('0x50')],_0x342319[_0x2c73f5][_0x630e('0x51')])){manager[_0x630e('0x52')](_0x2c73f5,_0x342319[_0x2c73f5]['cron'],handleJob(_0x342319[_0x2c73f5]));manager[_0x630e('0x53')](_0x2c73f5);logger[_0x630e('0xa')]('add\x20cron',_0x342319[_0x2c73f5][_0x630e('0x16')],_0x342319[_0x2c73f5][_0x630e('0x4e')]);}else if(manager['exists'](_0x2c73f5)){manager[_0x630e('0x54')](_0x2c73f5);manager[_0x630e('0x47')](_0x2c73f5);logger[_0x630e('0xa')](_0x630e('0x55'),_0x342319[_0x2c73f5][_0x630e('0x16')],_0x342319[_0x2c73f5]['cron']);}}for(_0x26e275=0x0,_0x2c73f5;_0x26e275<_0x91e2f1[_0x630e('0x4a')]&&!_0x447b06;_0x26e275+=0x1){_0x2c73f5=_0x91e2f1[_0x26e275][_0x630e('0x43')]();if(manager['exists'](_0x2c73f5)){if(_0x342319[_0x2c73f5]['cron']&&_0x342319[_0x2c73f5]['active']&&moment()[_0x630e('0x56')](_0x342319[_0x2c73f5][_0x630e('0x50')],_0x342319[_0x2c73f5][_0x630e('0x51')])){manager[_0x630e('0x57')](_0x2c73f5,_0x342319[_0x2c73f5][_0x630e('0x4e')],handleJob(_0x342319[_0x2c73f5]));logger[_0x630e('0xa')](_0x630e('0x58'),_0x342319[_0x2c73f5]['name'],_0x342319[_0x2c73f5][_0x630e('0x4e')]);}else{manager[_0x630e('0x54')](_0x2c73f5);manager[_0x630e('0x47')](_0x2c73f5);logger[_0x630e('0xa')](_0x630e('0x55'),_0x342319[_0x2c73f5][_0x630e('0x16')],_0x342319[_0x2c73f5]['cron']);}}}})[_0x630e('0x32')](function(_0x1147d0){logger[_0x630e('0x2e')](JSON[_0x630e('0x30')](_0x1147d0));});}exports[_0x630e('0x59')]=function(_0x22b9c4){return getJobs(_0x22b9c4);};exports[_0x630e('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index e8dd2e1..9df00c0 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc1e=['CmHopper','bulkCreate','log','finished\x20populating','hopper1','contacts2','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then'];(function(_0x5a368e,_0x33b365){var _0x30affd=function(_0x19905c){while(--_0x19905c){_0x5a368e['push'](_0x5a368e['shift']());}};_0x30affd(++_0x33b365);}(_0xfc1e,0x6c));var _0xefc1=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xfc1e[_0x21c2c8];return _0x4dd745;};'use strict';var util=require(_0xefc1('0x0'));var db=require(_0xefc1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xefc1('0x2')]({'id':i,'firstName':_0xefc1('0x3')+i,'lastName':_0xefc1('0x4')+i,'phone':0xf879fb460+i,'email':_0xefc1('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xefc1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xefc1('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xefc1('0x2')]({'id':i,'firstName':_0xefc1('0x3')+i,'lastName':_0xefc1('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xefc1('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xefc1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xefc1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xefc1('0x6')](),'updatedAt':Date['now']()});}db[_0xefc1('0x8')][_0xefc1('0x9')]({'where':{}})['then'](function(){return db[_0xefc1('0x8')]['bulkCreate'](contacts);})[_0xefc1('0xa')](function(){console['log']('finished\x20populating','contacts1');return db[_0xefc1('0xb')][_0xefc1('0x9')]({'where':{}});})[_0xefc1('0xa')](function(){return db['CmHopper'][_0xefc1('0xc')](hopper);})[_0xefc1('0xa')](function(){console[_0xefc1('0xd')](_0xefc1('0xe'),_0xefc1('0xf'));return db[_0xefc1('0x8')][_0xefc1('0xc')](contacts2);})[_0xefc1('0xa')](function(){console['log']('finished\x20populating',_0xefc1('0x10'));return db[_0xefc1('0xb')][_0xefc1('0xc')](hopper2);})[_0xefc1('0xa')](function(){console[_0xefc1('0xd')](_0xefc1('0xe'),'hopper2');})['catch'](function(_0x2690d){console['log'](_0x2690d);}); \ No newline at end of file +var _0x7c01=['push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','CmContact','bulkCreate','then','finished\x20populating','CmHopper','log','hopper1','contacts2','hopper2','catch','util'];(function(_0x2a6668,_0x378902){var _0x5a077e=function(_0x137115){while(--_0x137115){_0x2a6668['push'](_0x2a6668['shift']());}};_0x5a077e(++_0x378902);}(_0x7c01,0x19d));var _0x17c0=function(_0x2bf861,_0x2ff36b){_0x2bf861=_0x2bf861-0x0;var _0x244588=_0x7c01[_0x2bf861];return _0x244588;};'use strict';var util=require(_0x17c0('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x17c0('0x1')]({'id':i,'firstName':_0x17c0('0x2')+i,'lastName':_0x17c0('0x3')+i,'phone':0xf879fb460+i,'email':_0x17c0('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x17c0('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x17c0('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x17c0('0x1')]({'id':i,'firstName':_0x17c0('0x2')+i,'lastName':_0x17c0('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x17c0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x17c0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x17c0('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x17c0('0x5')](),'updatedAt':Date[_0x17c0('0x5')]()});}db['CmContact'][_0x17c0('0x7')]({'where':{}})['then'](function(){return db[_0x17c0('0x8')][_0x17c0('0x9')](contacts);})[_0x17c0('0xa')](function(){console['log'](_0x17c0('0xb'),'contacts1');return db[_0x17c0('0xc')][_0x17c0('0x7')]({'where':{}});})[_0x17c0('0xa')](function(){return db[_0x17c0('0xc')][_0x17c0('0x9')](hopper);})[_0x17c0('0xa')](function(){console[_0x17c0('0xd')]('finished\x20populating',_0x17c0('0xe'));return db[_0x17c0('0x8')][_0x17c0('0x9')](contacts2);})[_0x17c0('0xa')](function(){console[_0x17c0('0xd')](_0x17c0('0xb'),_0x17c0('0xf'));return db[_0x17c0('0xc')][_0x17c0('0x9')](hopper2);})[_0x17c0('0xa')](function(){console[_0x17c0('0xd')](_0x17c0('0xb'),_0x17c0('0x10'));})[_0x17c0('0x11')](function(_0x41414b){console['log'](_0x41414b);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0877a45..52df3f6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4777=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','yes'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x4777,0x1d8));var _0x7477=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0x4777[_0x421eeb];return _0x2c7371;};'use strict';var util=require(_0x7477('0x0'));var db=require(_0x7477('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7477('0x2')]({'name':util[_0x7477('0x3')](_0x7477('0x4'),_0x7477('0x5'),i),'fullname':util[_0x7477('0x3')](_0x7477('0x4'),'agent',i),'email':util[_0x7477('0x3')](_0x7477('0x6'),_0x7477('0x5'),i),'role':_0x7477('0x5'),'password':_0x7477('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x7477('0x8'),'ws',_0x7477('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x7477('0x3')](_0x7477('0x4'),_0x7477('0x5'),i),'encryption':_0x7477('0xa'),'avpf':_0x7477('0xa'),'force_avp':_0x7477('0xa'),'icesupport':'yes','dtlsenable':_0x7477('0xa'),'dtlsverify':'no','dtlscertfile':_0x7477('0xb'),'dtlsprivatekey':_0x7477('0xc'),'dtlssetup':_0x7477('0xd'),'callerid':util['format'](_0x7477('0xe'),util[_0x7477('0x3')](_0x7477('0x4'),_0x7477('0x5'),i),0xfa0+i)});}db[_0x7477('0xf')][_0x7477('0x10')](users)[_0x7477('0x11')](function(){console[_0x7477('0x12')](_0x7477('0x13'));})[_0x7477('0x14')](function(_0x463e81){console[_0x7477('0x12')](_0x463e81);}); \ No newline at end of file +var _0x8016=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','log','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x8016,0xd9));var _0x6801=function(_0x46ce21,_0x254327){_0x46ce21=_0x46ce21-0x0;var _0x4901ba=_0x8016[_0x46ce21];return _0x4901ba;};'use strict';var util=require('util');var db=require(_0x6801('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6801('0x1')]({'name':util[_0x6801('0x2')](_0x6801('0x3'),_0x6801('0x4'),i),'fullname':util[_0x6801('0x2')]('%s%s',_0x6801('0x4'),i),'email':util[_0x6801('0x2')](_0x6801('0x5'),_0x6801('0x4'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x6801('0x6'),'transport':[_0x6801('0x7'),'ws',_0x6801('0x8')],'disallow':[_0x6801('0x9')],'allow':[_0x6801('0xa')],'defaultuser':util[_0x6801('0x2')](_0x6801('0x3'),_0x6801('0x4'),i),'encryption':_0x6801('0xb'),'avpf':_0x6801('0xb'),'force_avp':_0x6801('0xb'),'icesupport':_0x6801('0xb'),'dtlsenable':_0x6801('0xb'),'dtlsverify':'no','dtlscertfile':_0x6801('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6801('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x6801('0x2')]('%s%s',_0x6801('0x4'),i),0xfa0+i)});}db[_0x6801('0xe')]['bulkCreate'](users)['then'](function(){console[_0x6801('0xf')]('add\x20user');})['catch'](function(_0x376f20){console[_0x6801('0xf')](_0x376f20);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index a740fc1..4fcc94f 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x856e=['../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','telephone','Campaign','where','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:inbound','ChatQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','length','voice','sms','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_openchannel_interactions:remove','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','nsp','disconnect','CONNECTED','lodash','bluebird'];(function(_0x1de164,_0x1ccf5f){var _0x5613b4=function(_0x22dca9){while(--_0x22dca9){_0x1de164['push'](_0x1de164['shift']());}};_0x5613b4(++_0x1ccf5f);}(_0x856e,0xa8));var _0xe856=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x856e[_0x4492af];return _0x216729;};'use strict';var _=require(_0xe856('0x0'));var util=require('util');var BPromise=require(_0xe856('0x1'));var db=require(_0xe856('0x2'))['db'];var config=require(_0xe856('0x3'));var queryQueues={'attributes':['id',_0xe856('0x4')],'include':[{'as':_0xe856('0x5'),'model':db[_0xe856('0x6')],'attributes':['id',_0xe856('0x4'),_0xe856('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xe856('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xe856('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xe856('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xe856('0x4'),_0xe856('0x9')],'where':{'type':_0xe856('0xa')}};function getAssociatedResources(_0x300c8f,_0x305fb1,_0x542fc6){return db['UserProfileSection'][_0xe856('0xb')]({'where':{'name':_0x300c8f,'userProfileId':_0x305fb1},'raw':!![]})[_0xe856('0xc')](function(_0x44d1b0){if(_0x44d1b0){if(_0x44d1b0[_0xe856('0xd')]){switch(_0x300c8f){case _0xe856('0xe'):case _0xe856('0xf'):case _0xe856('0x10'):case _0xe856('0x11'):case _0xe856('0x12'):case'OpenchannelQueues':return db[_0x542fc6][_0xe856('0x13')](queryQueues);case _0xe856('0x14'):return db[_0x542fc6][_0xe856('0x13')](queryTelephones);case _0xe856('0x15'):return db[_0x542fc6][_0xe856('0x13')](queryTrunks);case _0xe856('0x16'):return db[_0x542fc6][_0xe856('0x13')](queryCampaigns);}}else{return db[_0xe856('0x17')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x44d1b0['id']},'raw':!![]})[_0xe856('0xc')](function(_0x11b1ab){if(_0x11b1ab){var _0x3a417d={'where':{'id':_[_0xe856('0x18')](_0x11b1ab,_0xe856('0x19'))},'raw':!![]};switch(_0x542fc6){case _0xe856('0x6'):_0x3a417d['where'][_0xe856('0x7')]=_0xe856('0x1a');break;case _0xe856('0x1b'):_0x3a417d[_0xe856('0x1c')][_0xe856('0x9')]=_0xe856('0xa');break;}return db[_0x542fc6]['findAll'](_0x3a417d);}else{return[];}});}}else{return[];}})[_0xe856('0xc')](function(_0x76e59d){return _0x76e59d;});}function joinOrLeaveQueues(_0x15f8ea,_0x366a2b,_0x159588,_0x533ba4){_0x15f8ea[_0x366a2b](util[_0xe856('0x1d')]('%s:queue:%s',_0x159588,_0x533ba4[_0xe856('0x4')]));if(_0x533ba4['Agents']){for(var _0x36e612=0x0;_0x36e612<_0x533ba4[_0xe856('0x5')]['length'];_0x36e612+=0x1){_0x15f8ea[_0x366a2b](util[_0xe856('0x1d')](_0xe856('0x1e'),_0x533ba4['Agents'][_0x36e612][_0xe856('0x4')]));}}}function joinOrLeave(_0x2cd6d7,_0x472a80,_0x5e57ab){var _0x4bb841;if(_0x2cd6d7[_0xe856('0x1f')][_0xe856('0x20')]['id']){db[_0xe856('0x6')][_0xe856('0x21')]({'attributes':['id','name',_0xe856('0x7'),_0xe856('0x22')],'where':{'id':_0x2cd6d7[_0xe856('0x1f')][_0xe856('0x20')]['id']},'include':[{'model':db[_0xe856('0x23')],'as':_0xe856('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xe856('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xe856('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe856('0x27')],'as':_0xe856('0x28'),'attributes':['id'],'raw':!![]}]})[_0xe856('0xc')](function(_0x5a36cd){if(_0x5a36cd){_0x4bb841=_0x5a36cd;_0x2cd6d7[_0x472a80](util[_0xe856('0x1d')]('user:%s',_0x5a36cd[_0xe856('0x4')]));var _0x35688f=[];switch(_0x5a36cd[_0xe856('0x7')]){case'admin':_0x2cd6d7[_0x472a80]('voice:inbound');_0x2cd6d7[_0x472a80](_0xe856('0x29'));if(queryQueues[_0xe856('0x2a')](_0xe856('0x2b'))){delete queryQueues['include'];}_0x35688f['push'](db[_0xe856('0x2c')][_0xe856('0x13')](queryQueues));_0x35688f[_0xe856('0x2d')](db['ChatQueue'][_0xe856('0x13')](queryQueues));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x2e')]['findAll'](queryQueues));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x2f')][_0xe856('0x13')](queryQueues));_0x35688f['push'](db[_0xe856('0x30')][_0xe856('0x13')](queryQueues));_0x35688f['push'](db[_0xe856('0x31')][_0xe856('0x13')](queryQueues));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x6')][_0xe856('0x13')](queryTelephones));_0x35688f['push'](db[_0xe856('0x32')][_0xe856('0x13')](queryTrunks));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x1b')][_0xe856('0x13')](queryCampaigns));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x6')]['findAll'](queryAgents));break;case _0xe856('0x33'):_0x2cd6d7[_0x472a80](_0xe856('0x34'));_0x2cd6d7[_0x472a80](_0xe856('0x29'));_0x35688f['push'](getAssociatedResources(_0xe856('0xe'),_0x5a36cd[_0xe856('0x22')],_0xe856('0x2c')));_0x35688f[_0xe856('0x2d')](getAssociatedResources(_0xe856('0xf'),_0x5a36cd[_0xe856('0x22')],_0xe856('0x35')));_0x35688f['push'](getAssociatedResources(_0xe856('0x10'),_0x5a36cd[_0xe856('0x22')],_0xe856('0x2e')));_0x35688f['push'](getAssociatedResources(_0xe856('0x11'),_0x5a36cd[_0xe856('0x22')],_0xe856('0x2f')));_0x35688f[_0xe856('0x2d')](getAssociatedResources(_0xe856('0x12'),_0x5a36cd['userProfileId'],'MailQueue'));_0x35688f[_0xe856('0x2d')](getAssociatedResources('OpenchannelQueues',_0x5a36cd[_0xe856('0x22')],_0xe856('0x31')));_0x35688f[_0xe856('0x2d')](getAssociatedResources('Telephones',_0x5a36cd['userProfileId'],_0xe856('0x6')));_0x35688f['push'](getAssociatedResources(_0xe856('0x15'),_0x5a36cd[_0xe856('0x22')],'Trunk'));_0x35688f[_0xe856('0x2d')](getAssociatedResources(_0xe856('0x16'),_0x5a36cd['userProfileId'],'Campaign'));_0x35688f[_0xe856('0x2d')](db[_0xe856('0x6')][_0xe856('0x13')](queryAgents));break;case _0xe856('0x8'):_0x2cd6d7[_0x472a80](_0xe856('0x34'));_0x2cd6d7[_0x472a80](_0xe856('0x29'));_0x35688f['push'](_0x5a36cd[_0xe856('0x36')]({'attributes':['id',_0xe856('0x4')]}));_0x35688f['push'](_0x5a36cd[_0xe856('0x37')]({'attributes':['id',_0xe856('0x4')]}));_0x35688f[_0xe856('0x2d')](_0x5a36cd[_0xe856('0x38')]({'attributes':['id','name']}));_0x35688f[_0xe856('0x2d')](_0x5a36cd[_0xe856('0x39')]({'attributes':['id',_0xe856('0x4')]}));_0x35688f[_0xe856('0x2d')](_0x5a36cd[_0xe856('0x3a')]({'attributes':['id',_0xe856('0x4')]}));_0x35688f[_0xe856('0x2d')](_0x5a36cd['getOpenchannelQueues']({'attributes':['id',_0xe856('0x4')]}));break;}return BPromise[_0xe856('0x3b')](_0x35688f);}})[_0xe856('0xc')](function(_0x52fb33){if(_0x52fb33&&_0x52fb33['length']){for(var _0x546f7f=0x0;_0x546f7f<_0x52fb33[_0xe856('0x3c')];_0x546f7f+=0x1){for(var _0x2f4f2e=0x0;_0x2f4f2e<_0x52fb33[_0x546f7f][_0xe856('0x3c')];_0x2f4f2e+=0x1){switch(_0x546f7f){case 0x0:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,_0xe856('0x3d'),_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x1:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,'chat',_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x2:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,'fax',_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x3:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,_0xe856('0x3e'),_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x4:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,'mail',_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x5:joinOrLeaveQueues(_0x2cd6d7,_0x472a80,'openchannel',_0x52fb33[_0x546f7f][_0x2f4f2e]);break;case 0x6:_0x2cd6d7[_0x472a80](util[_0xe856('0x1d')]('telephone:%s',_0x52fb33[_0x546f7f][_0x2f4f2e][_0xe856('0x4')]));break;case 0x7:_0x2cd6d7[_0x472a80](util[_0xe856('0x1d')](_0xe856('0x3f'),_0x52fb33[_0x546f7f][_0x2f4f2e]['name']));break;case 0x8:_0x2cd6d7[_0x472a80](util['format'](_0xe856('0x40'),_0x52fb33[_0x546f7f][_0x2f4f2e][_0xe856('0x9')],_0x52fb33[_0x546f7f][_0x2f4f2e][_0xe856('0x4')]));break;case 0x9:_0x2cd6d7[_0x472a80](util['format'](_0xe856('0x1e'),_0x52fb33[_0x546f7f][_0x2f4f2e][_0xe856('0x4')]));break;}}}}})[_0xe856('0xc')](function(){if(_0x472a80===_0xe856('0x41')){var _0x289ee2=_[_0xe856('0x18')](_0x4bb841[_0xe856('0x24')],'id');return _0x4bb841[_0xe856('0x42')](_0x289ee2)[_0xe856('0xc')](function(){for(var _0x52872b=0x0;_0x52872b<_0x289ee2[_0xe856('0x3c')];_0x52872b+=0x1){_0x5e57ab[_0xe856('0x43')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x289ee2[_0x52872b]),'UserId':Number(_0x4bb841['id'])});}});}})[_0xe856('0xc')](function(){if(_0x472a80==='leave'){var _0x2df808=_[_0xe856('0x18')](_0x4bb841['MailInteractions'],'id');return _0x4bb841[_0xe856('0x44')](_0x2df808)['then'](function(){for(var _0x28546b=0x0;_0x28546b<_0x2df808[_0xe856('0x3c')];_0x28546b+=0x1){_0x5e57ab[_0xe856('0x43')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2df808[_0x28546b]),'UserId':Number(_0x4bb841['id'])});}});}})[_0xe856('0xc')](function(){if(_0x472a80===_0xe856('0x41')){var _0x4eaa94=_[_0xe856('0x18')](_0x4bb841[_0xe856('0x26')],'id');return _0x4bb841[_0xe856('0x45')](_0x4eaa94)['then'](function(){for(var _0x2e866b=0x0;_0x2e866b<_0x4eaa94['length'];_0x2e866b+=0x1){_0x5e57ab['emit'](_0xe856('0x46'),{'FaxInteractionId':Number(_0x4eaa94[_0x2e866b]),'UserId':Number(_0x4bb841['id'])});}});}})[_0xe856('0xc')](function(){if(_0x472a80===_0xe856('0x41')){var _0x22d4f7=_[_0xe856('0x18')](_0x4bb841['SmsInteractions'],'id');return _0x4bb841['removeSmsInteractions'](_0x22d4f7)['then'](function(){for(var _0x53a866=0x0;_0x53a866<_0x22d4f7[_0xe856('0x3c')];_0x53a866+=0x1){_0x5e57ab[_0xe856('0x43')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x22d4f7[_0x53a866]),'UserId':Number(_0x4bb841['id'])});}});}})['then'](function(){if(_0x472a80===_0xe856('0x41')){var _0x26c822=_[_0xe856('0x18')](_0x4bb841[_0xe856('0x28')],'id');return _0x4bb841['removeOpenchannelInteractions'](_0x26c822)[_0xe856('0xc')](function(){for(var _0x563f02=0x0;_0x563f02<_0x26c822[_0xe856('0x3c')];_0x563f02+=0x1){_0x5e57ab[_0xe856('0x43')](_0xe856('0x47'),{'OpenchannelInteractionId':Number(_0x26c822[_0x563f02]),'UserId':Number(_0x4bb841['id'])});}});}})['catch'](function(_0x42052d){_0x2cd6d7[_0xe856('0x48')](_0x42052d);});}}function onDisconnect(_0x12f1ba,_0x5209a3){joinOrLeave(_0x12f1ba,'leave',_0x5209a3);}function onConnect(_0x5c19c6){joinOrLeave(_0x5c19c6,_0xe856('0x49'));}exports[_0xe856('0x4a')]=function(_0x18c14){_0x18c14['on'](_0xe856('0x4b'),function(_0x26e4b7){_0x26e4b7[_0xe856('0x4c')](0x0);_0x26e4b7[_0xe856('0x4d')]=_0x26e4b7['request']['connection'][_0xe856('0x4e')]+':'+_0x26e4b7[_0xe856('0x4f')][_0xe856('0x4b')][_0xe856('0x50')];_0x26e4b7[_0xe856('0x51')]=new Date();_0x26e4b7[_0xe856('0x48')]=function(_0x46a6ef){console[_0xe856('0x48')]('SocketIO\x20'+_0x26e4b7[_0xe856('0x52')][_0xe856('0x4')]+'['+_0x26e4b7[_0xe856('0x4d')]+']',_0x46a6ef);};_0x26e4b7['on'](_0xe856('0x53'),function(){onDisconnect(_0x26e4b7,_0x18c14);_0x26e4b7[_0xe856('0x48')]('DISCONNECTED');});onConnect(_0x26e4b7);_0x26e4b7[_0xe856('0x48')](_0xe856('0x54'));});}; \ No newline at end of file +var _0xf369=['FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','FaxQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','fax','sms','mail','openchannel','trunk:%s','type','leave','removeChatInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','log','join','default','connection','address','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','role','agent','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','telephone','Campaign','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue'];(function(_0x1b7f95,_0x4bdec0){var _0x2b5559=function(_0x4c8446){while(--_0x4c8446){_0x1b7f95['push'](_0x1b7f95['shift']());}};_0x2b5559(++_0x4bdec0);}(_0xf369,0x13f));var _0x9f36=function(_0x4feaee,_0xb99aa4){_0x4feaee=_0x4feaee-0x0;var _0x51426e=_0xf369[_0x4feaee];return _0x51426e;};'use strict';var _=require(_0x9f36('0x0'));var util=require(_0x9f36('0x1'));var BPromise=require('bluebird');var db=require(_0x9f36('0x2'))['db'];var config=require(_0x9f36('0x3'));var queryQueues={'attributes':['id',_0x9f36('0x4')],'include':[{'as':_0x9f36('0x5'),'model':db['User'],'attributes':['id','name',_0x9f36('0x6')],'raw':!![],'where':{'role':_0x9f36('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x9f36('0x4')],'where':{'role':_0x9f36('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x9f36('0x8')}};function getAssociatedResources(_0x308901,_0x5de1fd,_0x4fdcc2){return db[_0x9f36('0x9')]['findOne']({'where':{'name':_0x308901,'userProfileId':_0x5de1fd},'raw':!![]})[_0x9f36('0xa')](function(_0x8db535){if(_0x8db535){if(_0x8db535['autoAssociation']){switch(_0x308901){case _0x9f36('0xb'):case _0x9f36('0xc'):case'FaxQueues':case _0x9f36('0xd'):case _0x9f36('0xe'):case _0x9f36('0xf'):return db[_0x4fdcc2][_0x9f36('0x10')](queryQueues);case _0x9f36('0x11'):return db[_0x4fdcc2][_0x9f36('0x10')](queryTelephones);case _0x9f36('0x12'):return db[_0x4fdcc2][_0x9f36('0x10')](queryTrunks);case _0x9f36('0x13'):return db[_0x4fdcc2][_0x9f36('0x10')](queryCampaigns);}}else{return db[_0x9f36('0x14')][_0x9f36('0x10')]({'attributes':[_0x9f36('0x15')],'where':{'sectionId':_0x8db535['id']},'raw':!![]})['then'](function(_0x27a24d){if(_0x27a24d){var _0x7dbf54={'where':{'id':_[_0x9f36('0x16')](_0x27a24d,_0x9f36('0x15'))},'raw':!![]};switch(_0x4fdcc2){case _0x9f36('0x17'):_0x7dbf54[_0x9f36('0x18')][_0x9f36('0x6')]=_0x9f36('0x19');break;case _0x9f36('0x1a'):_0x7dbf54[_0x9f36('0x18')]['type']='ivr';break;}return db[_0x4fdcc2][_0x9f36('0x10')](_0x7dbf54);}else{return[];}});}}else{return[];}})[_0x9f36('0xa')](function(_0x53cb3c){return _0x53cb3c;});}function joinOrLeaveQueues(_0x5555ca,_0xfefd4e,_0x450986,_0x412d6c){_0x5555ca[_0xfefd4e](util[_0x9f36('0x1b')](_0x9f36('0x1c'),_0x450986,_0x412d6c[_0x9f36('0x4')]));if(_0x412d6c[_0x9f36('0x5')]){for(var _0x55a2be=0x0;_0x55a2be<_0x412d6c[_0x9f36('0x5')]['length'];_0x55a2be+=0x1){_0x5555ca[_0xfefd4e](util[_0x9f36('0x1b')](_0x9f36('0x1d'),_0x412d6c[_0x9f36('0x5')][_0x55a2be]['name']));}}}function joinOrLeave(_0x7e2061,_0xa1fce6,_0x229516){var _0x372b48;if(_0x7e2061[_0x9f36('0x1e')]['query']['id']){db['User'][_0x9f36('0x1f')]({'attributes':['id',_0x9f36('0x4'),_0x9f36('0x6'),_0x9f36('0x20')],'where':{'id':_0x7e2061[_0x9f36('0x1e')][_0x9f36('0x21')]['id']},'include':[{'model':db[_0x9f36('0x22')],'as':_0x9f36('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9f36('0x24')],'as':_0x9f36('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x9f36('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9f36('0x27')],'as':_0x9f36('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9f36('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x5b01f1){if(_0x5b01f1){_0x372b48=_0x5b01f1;_0x7e2061[_0xa1fce6](util[_0x9f36('0x1b')](_0x9f36('0x1d'),_0x5b01f1['name']));var _0x22abf3=[];switch(_0x5b01f1['role']){case'admin':_0x7e2061[_0xa1fce6](_0x9f36('0x2a'));_0x7e2061[_0xa1fce6](_0x9f36('0x2b'));if(queryQueues[_0x9f36('0x2c')](_0x9f36('0x2d'))){delete queryQueues[_0x9f36('0x2d')];}_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x2f')][_0x9f36('0x10')](queryQueues));_0x22abf3['push'](db[_0x9f36('0x30')][_0x9f36('0x10')](queryQueues));_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x31')][_0x9f36('0x10')](queryQueues));_0x22abf3['push'](db[_0x9f36('0x32')][_0x9f36('0x10')](queryQueues));_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x33')][_0x9f36('0x10')](queryQueues));_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x34')][_0x9f36('0x10')](queryQueues));_0x22abf3[_0x9f36('0x2e')](db['User'][_0x9f36('0x10')](queryTelephones));_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x35')][_0x9f36('0x10')](queryTrunks));_0x22abf3[_0x9f36('0x2e')](db['Campaign'][_0x9f36('0x10')](queryCampaigns));_0x22abf3[_0x9f36('0x2e')](db[_0x9f36('0x17')][_0x9f36('0x10')](queryAgents));break;case _0x9f36('0x36'):_0x7e2061[_0xa1fce6](_0x9f36('0x2a'));_0x7e2061[_0xa1fce6](_0x9f36('0x2b'));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0xb'),_0x5b01f1['userProfileId'],_0x9f36('0x2f')));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources('ChatQueues',_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x30')));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0x37'),_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x31')));_0x22abf3['push'](getAssociatedResources('SmsQueues',_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x32')));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0xe'),_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x33')));_0x22abf3['push'](getAssociatedResources(_0x9f36('0xf'),_0x5b01f1[_0x9f36('0x20')],'OpenchannelQueue'));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0x11'),_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x17')));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0x12'),_0x5b01f1[_0x9f36('0x20')],'Trunk'));_0x22abf3[_0x9f36('0x2e')](getAssociatedResources(_0x9f36('0x13'),_0x5b01f1[_0x9f36('0x20')],_0x9f36('0x1a')));_0x22abf3['push'](db[_0x9f36('0x17')]['findAll'](queryAgents));break;case _0x9f36('0x7'):_0x7e2061[_0xa1fce6](_0x9f36('0x2a'));_0x7e2061[_0xa1fce6](_0x9f36('0x2b'));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1['getVoiceQueues']({'attributes':['id',_0x9f36('0x4')]}));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1[_0x9f36('0x38')]({'attributes':['id',_0x9f36('0x4')]}));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1[_0x9f36('0x39')]({'attributes':['id',_0x9f36('0x4')]}));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1[_0x9f36('0x3a')]({'attributes':['id','name']}));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1[_0x9f36('0x3b')]({'attributes':['id','name']}));_0x22abf3[_0x9f36('0x2e')](_0x5b01f1[_0x9f36('0x3c')]({'attributes':['id','name']}));break;}return BPromise[_0x9f36('0x3d')](_0x22abf3);}})[_0x9f36('0xa')](function(_0x5c9f5e){if(_0x5c9f5e&&_0x5c9f5e['length']){for(var _0x4cc3d4=0x0;_0x4cc3d4<_0x5c9f5e[_0x9f36('0x3e')];_0x4cc3d4+=0x1){for(var _0x884c51=0x0;_0x884c51<_0x5c9f5e[_0x4cc3d4][_0x9f36('0x3e')];_0x884c51+=0x1){switch(_0x4cc3d4){case 0x0:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,_0x9f36('0x3f'),_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x1:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,'chat',_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x2:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,_0x9f36('0x40'),_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x3:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,_0x9f36('0x41'),_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x4:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,_0x9f36('0x42'),_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x5:joinOrLeaveQueues(_0x7e2061,_0xa1fce6,_0x9f36('0x43'),_0x5c9f5e[_0x4cc3d4][_0x884c51]);break;case 0x6:_0x7e2061[_0xa1fce6](util[_0x9f36('0x1b')]('telephone:%s',_0x5c9f5e[_0x4cc3d4][_0x884c51][_0x9f36('0x4')]));break;case 0x7:_0x7e2061[_0xa1fce6](util[_0x9f36('0x1b')](_0x9f36('0x44'),_0x5c9f5e[_0x4cc3d4][_0x884c51][_0x9f36('0x4')]));break;case 0x8:_0x7e2061[_0xa1fce6](util[_0x9f36('0x1b')]('campaign:%s:%s',_0x5c9f5e[_0x4cc3d4][_0x884c51][_0x9f36('0x45')],_0x5c9f5e[_0x4cc3d4][_0x884c51][_0x9f36('0x4')]));break;case 0x9:_0x7e2061[_0xa1fce6](util[_0x9f36('0x1b')](_0x9f36('0x1d'),_0x5c9f5e[_0x4cc3d4][_0x884c51]['name']));break;}}}}})[_0x9f36('0xa')](function(){if(_0xa1fce6===_0x9f36('0x46')){var _0x55b89b=_['map'](_0x372b48[_0x9f36('0x23')],'id');return _0x372b48[_0x9f36('0x47')](_0x55b89b)[_0x9f36('0xa')](function(){for(var _0x4905af=0x0;_0x4905af<_0x55b89b[_0x9f36('0x3e')];_0x4905af+=0x1){_0x229516['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x55b89b[_0x4905af]),'UserId':Number(_0x372b48['id'])});}});}})[_0x9f36('0xa')](function(){if(_0xa1fce6===_0x9f36('0x46')){var _0x415445=_['map'](_0x372b48['MailInteractions'],'id');return _0x372b48[_0x9f36('0x48')](_0x415445)[_0x9f36('0xa')](function(){for(var _0x34ea42=0x0;_0x34ea42<_0x415445[_0x9f36('0x3e')];_0x34ea42+=0x1){_0x229516[_0x9f36('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x415445[_0x34ea42]),'UserId':Number(_0x372b48['id'])});}});}})[_0x9f36('0xa')](function(){if(_0xa1fce6===_0x9f36('0x46')){var _0x2eee70=_[_0x9f36('0x16')](_0x372b48[_0x9f36('0x26')],'id');return _0x372b48[_0x9f36('0x4a')](_0x2eee70)[_0x9f36('0xa')](function(){for(var _0x3ab1e7=0x0;_0x3ab1e7<_0x2eee70['length'];_0x3ab1e7+=0x1){_0x229516[_0x9f36('0x49')](_0x9f36('0x4b'),{'FaxInteractionId':Number(_0x2eee70[_0x3ab1e7]),'UserId':Number(_0x372b48['id'])});}});}})['then'](function(){if(_0xa1fce6===_0x9f36('0x46')){var _0x5c6d95=_[_0x9f36('0x16')](_0x372b48[_0x9f36('0x28')],'id');return _0x372b48[_0x9f36('0x4c')](_0x5c6d95)['then'](function(){for(var _0x562ae8=0x0;_0x562ae8<_0x5c6d95[_0x9f36('0x3e')];_0x562ae8+=0x1){_0x229516['emit'](_0x9f36('0x4d'),{'SmsInteractionId':Number(_0x5c6d95[_0x562ae8]),'UserId':Number(_0x372b48['id'])});}});}})[_0x9f36('0xa')](function(){if(_0xa1fce6===_0x9f36('0x46')){var _0x26d21d=_[_0x9f36('0x16')](_0x372b48[_0x9f36('0x29')],'id');return _0x372b48[_0x9f36('0x4e')](_0x26d21d)[_0x9f36('0xa')](function(){for(var _0x296db3=0x0;_0x296db3<_0x26d21d[_0x9f36('0x3e')];_0x296db3+=0x1){_0x229516['emit'](_0x9f36('0x4f'),{'OpenchannelInteractionId':Number(_0x26d21d[_0x296db3]),'UserId':Number(_0x372b48['id'])});}});}})['catch'](function(_0x33bda6){_0x7e2061[_0x9f36('0x50')](_0x33bda6);});}}function onDisconnect(_0x35934b,_0xc0768b){joinOrLeave(_0x35934b,'leave',_0xc0768b);}function onConnect(_0x22747c){joinOrLeave(_0x22747c,_0x9f36('0x51'));}exports[_0x9f36('0x52')]=function(_0x1663e3){_0x1663e3['on'](_0x9f36('0x53'),function(_0x5e05e1){_0x5e05e1['setMaxListeners'](0x0);_0x5e05e1[_0x9f36('0x54')]=_0x5e05e1['request']['connection'][_0x9f36('0x55')]+':'+_0x5e05e1['request'][_0x9f36('0x53')][_0x9f36('0x56')];_0x5e05e1['connectedAt']=new Date();_0x5e05e1['log']=function(_0xe3acd8){console[_0x9f36('0x50')](_0x9f36('0x57')+_0x5e05e1[_0x9f36('0x58')][_0x9f36('0x4')]+'['+_0x5e05e1[_0x9f36('0x54')]+']',_0xe3acd8);};_0x5e05e1['on'](_0x9f36('0x59'),function(){onDisconnect(_0x5e05e1,_0x1663e3);_0x5e05e1[_0x9f36('0x50')](_0x9f36('0x5a'));});onConnect(_0x5e05e1);_0x5e05e1['log'](_0x9f36('0x5b'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4774834..7d1607a 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 _0x07c7=['UserId','User','find','interface','format','SIP/%s','name','incomingmessage','catch','outgoingmessage','closed','default','length','hasOwnProperty','model','hook','callback','channel','toLowerCase','condition','util','../../mysqldb','../logger','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','get','event','direction'];(function(_0x617d57,_0x223238){var _0x16ddeb=function(_0x2737ea){while(--_0x2737ea){_0x617d57['push'](_0x617d57['shift']());}};_0x16ddeb(++_0x223238);}(_0x07c7,0x158));var _0x707c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x07c7[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x707c('0x0'));var db=require(_0x707c('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x707c('0x2'))('triggers');var client=jayson[_0x707c('0x3')][_0x707c('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x707c('0x5'),'event':_0x707c('0x6'),'condition':_0x707c('0x7'),'callback':afterCreate},{'channel':_0x707c('0x8'),'model':_0x707c('0x5'),'event':_0x707c('0x9'),'condition':_0x707c('0xa'),'callback':afterUpdate},{'channel':_0x707c('0x8'),'model':_0x707c('0xb'),'event':_0x707c('0x6'),'condition':_0x707c('0xc'),'callback':afterCreateMessage},{'channel':_0x707c('0xd'),'model':_0x707c('0xe'),'event':'afterCreate','condition':_0x707c('0x7'),'callback':afterCreate},{'channel':_0x707c('0xd'),'model':_0x707c('0xe'),'event':_0x707c('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x707c('0xd'),'model':_0x707c('0xf'),'event':_0x707c('0x6'),'condition':_0x707c('0xc'),'callback':afterCreateMessage},{'channel':_0x707c('0x10'),'model':_0x707c('0x11'),'event':'afterCreate','condition':_0x707c('0x7'),'callback':afterCreate},{'channel':_0x707c('0x10'),'model':_0x707c('0x11'),'event':_0x707c('0x9'),'condition':_0x707c('0xa'),'callback':afterUpdate},{'channel':_0x707c('0x10'),'model':_0x707c('0x12'),'event':'afterCreate','condition':_0x707c('0xc'),'callback':afterCreateMessage},{'channel':_0x707c('0x13'),'model':_0x707c('0x14'),'event':_0x707c('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x707c('0x13'),'model':_0x707c('0x14'),'event':_0x707c('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x707c('0x13'),'model':_0x707c('0x15'),'event':_0x707c('0x6'),'condition':_0x707c('0xc'),'callback':afterCreateMessage},{'channel':_0x707c('0x16'),'model':_0x707c('0x17'),'event':_0x707c('0x6'),'condition':_0x707c('0x7'),'callback':afterCreate},{'channel':_0x707c('0x16'),'model':_0x707c('0x17'),'event':'afterUpdate','condition':_0x707c('0xa'),'callback':afterUpdate},{'channel':_0x707c('0x16'),'model':_0x707c('0x18'),'event':_0x707c('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x20bf8f){return client['request'](_0x707c('0x19'),_0x20bf8f)[_0x707c('0x1a')](function(_0x5cfe4a){logger[_0x707c('0x1b')](_0x707c('0x1c'),_0x707c('0x19'),_0x5cfe4a);if(_0x5cfe4a[_0x707c('0x1d')]){if(_0x5cfe4a[_0x707c('0x1d')][_0x707c('0x1e')]===0x1f4){logger[_0x707c('0x1d')](_0x707c('0x1c'),_0x707c('0x19'),_0x5cfe4a['error']);}}})['catch'](function(_0x497892){logger[_0x707c('0x1d')]('Trigger,\x20%s','EventManager',_0x497892);});}function afterCreateMessage(_0x1a61d2,_0x20ddd2){return function(_0x5537db,_0x212d97){_0x5537db=_0x5537db[_0x707c('0x1f')]({'plain':!![]});_0x5537db['channel']=_0x1a61d2;_0x5537db[_0x707c('0x20')]=_0x5537db[_0x707c('0x21')];if(_0x5537db[_0x707c('0x22')]){return db[_0x707c('0x23')][_0x707c('0x24')]({'where':{'id':_0x5537db[_0x707c('0x22')]},'attributes':['id','name'],'raw':!![]})[_0x707c('0x1a')](function(_0x89ca49){_0x5537db[_0x707c('0x25')]=util[_0x707c('0x26')](_0x707c('0x27'),_0x89ca49[_0x707c('0x28')]);_0x5537db['channel']=_0x1a61d2;return request({'event':_0x707c('0x29'),'message':_0x5537db});})[_0x707c('0x2a')](function(_0x4b6cd4){console['error'](_0x4b6cd4);});}else{return request({'event':_0x707c('0x2b'),'message':_0x5537db});}};}function afterCreate(_0xd46338,_0x5b8c0e){return function(_0x2093c1,_0x227704){_0x2093c1=_0x2093c1['get']({'plain':!![]});_0x2093c1['channel']=_0xd46338;_0x2093c1[_0x707c('0x20')]='opened';return request({'event':_0x5b8c0e,'message':_0x2093c1});};}function afterUpdate(_0x33fe95,_0x146649){return function(_0x46d65c,_0x246535){if(_0x46d65c['changed'](_0x707c('0x2c'))&&_0x46d65c[_0x707c('0x2c')]){_0x46d65c=_0x46d65c['get']({'plain':!![]});_0x46d65c['channel']=_0x33fe95;_0x46d65c['event']='closed';if(_0x46d65c[_0x707c('0x22')]){return db[_0x707c('0x23')][_0x707c('0x24')]({'where':{'id':_0x46d65c[_0x707c('0x22')]},'attributes':['id',_0x707c('0x28')],'raw':!![]})['then'](function(_0x5db1f5){_0x46d65c['interface']=util['format'](_0x707c('0x27'),_0x5db1f5['name']);return request({'event':_0x146649,'message':_0x46d65c});})[_0x707c('0x2a')](function(_0x1ddf2c){console[_0x707c('0x1d')](_0x1ddf2c);});}else{return request({'event':_0x146649,'message':_0x46d65c});}}};}exports[_0x707c('0x2d')]=function(){for(var _0x43a789=0x0;_0x43a789=_0x58f6d0['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x44e6fc(_0x389ffa);})[_0x6979('0x16')](function(_0x236acc){_0x1b98be(_0x236acc);});});}; \ No newline at end of file +var _0x72db=['sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','voice','mail','chat','fax'];(function(_0x59af8e,_0x459203){var _0x487d62=function(_0x51d74b){while(--_0x51d74b){_0x59af8e['push'](_0x59af8e['shift']());}};_0x487d62(++_0x459203);}(_0x72db,0xa8));var _0xb72d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72db[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb72d('0x0'));var BPromise=require(_0xb72d('0x1'));var db=require(_0xb72d('0x2'))['db'];var util=require('./license/util');var channels=[_0xb72d('0x3'),_0xb72d('0x4'),_0xb72d('0x5'),_0xb72d('0x6'),_0xb72d('0x7'),_0xb72d('0x8')];exports[_0xb72d('0x9')]=function(){return channels;};exports[_0xb72d('0xa')]=function(_0x4f677e){_0x4f677e=_0x4f677e[_0xb72d('0xb')]();return _[_0xb72d('0xc')](channels,_0x4f677e);};exports[_0xb72d('0xd')]=function(_0x335814,_0x599f0c,_0xd58ea3,_0x3e5bac){var _0x1c22ab={'loginAttempts':_0x599f0c,'blocked':_0xd58ea3};if(!_[_0xb72d('0xe')](_0x3e5bac)){_0x1c22ab[_0xb72d('0xf')]=_0x3e5bac;}return _0x335814['updateAttributes'](_0x1c22ab);};exports[_0xb72d('0x10')]=function(_0x132706){return new BPromise(function(_0xf24569,_0x19f0de){var _0x11b771=0x0;if(_0x132706[_0xb72d('0x11')]!==_0xb72d('0x12')){_0xf24569(_0x132706);}db[_0xb72d('0x13')][_0xb72d('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x132706['id']}}})['then'](function(_0x5e0db0){_0x11b771=_0x5e0db0;return util[_0xb72d('0x10')]();})[_0xb72d('0x15')](function(_0x446a73){if(_0x446a73&&_0x446a73[_0xb72d('0x16')]&&_0x11b771>=_0x446a73[_0xb72d('0x16')]){throw Error(_0xb72d('0x17'));}_0xf24569(_0x132706);})[_0xb72d('0x18')](function(_0x17a970){_0x19f0de(_0x17a970);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 37e3fda..e81964c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9cbe=['render','json','send','exports','404','status'];(function(_0x47badc,_0x944263){var _0x88abda=function(_0xa5902f){while(--_0xa5902f){_0x47badc['push'](_0x47badc['shift']());}};_0x88abda(++_0x944263);}(_0x9cbe,0x17d));var _0xe9cb=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x9cbe[_0x176329];return _0x31997c;};'use strict';module[_0xe9cb('0x0')][0x194]=function pageNotFound(_0x5c240c,_0x1c54a7){var _0x3065b9=_0xe9cb('0x1');var _0x190583=0x194;var _0x44c8cd={'status':_0x190583};_0x1c54a7[_0xe9cb('0x2')](_0x44c8cd[_0xe9cb('0x2')]);_0x1c54a7[_0xe9cb('0x3')](_0x3065b9,{},function(_0x25fdd7,_0x6cd464){if(_0x25fdd7){return _0x1c54a7['status'](_0x44c8cd[_0xe9cb('0x2')])[_0xe9cb('0x4')](_0x44c8cd);}_0x1c54a7[_0xe9cb('0x5')](_0x6cd464);});}; \ No newline at end of file +var _0x0390=['json','exports','status','render'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x0390,0x189));var _0x0039=function(_0x1a8d0c,_0x1e04e3){_0x1a8d0c=_0x1a8d0c-0x0;var _0x296254=_0x0390[_0x1a8d0c];return _0x296254;};'use strict';module[_0x0039('0x0')][0x194]=function pageNotFound(_0x56a3d8,_0x480838){var _0x4db8c4='404';var _0xf69bb0=0x194;var _0x225191={'status':_0xf69bb0};_0x480838[_0x0039('0x1')](_0x225191[_0x0039('0x1')]);_0x480838[_0x0039('0x2')](_0x4db8c4,{},function(_0x5b2364,_0x383a93){if(_0x5b2364){return _0x480838[_0x0039('0x1')](_0x225191[_0x0039('0x1')])[_0x0039('0x3')](_0x225191);}_0x480838['send'](_0x383a93);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4eeab09..70a3141 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa809=['Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Account','Dynamics365Configuration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','VoiceQueues','team_has_chat_queues','ChatQueues','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CmCustomField','CustomFields','Queues','Resources','sectionId','../config/environment','jstz','sequelize','motion2','xcall','xC@LL1234','mysql','name','utf8','sequelizeHistory','defaultsDeep','127.0.0.1','utf8mb4','utf8_general_ci','username','password','options','database','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../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','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','Action','../api/action/action.model','CannedAnswer','../api/disposition/disposition.model','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','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','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','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','hasOne','UserId','hasMany','VoiceRecording','User','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','UserVoiceQueue','ChatQueue','FaxQueue','FaxQueues','OpenchannelQueues','VoicePrefixes','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','cascade','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','VoiceQueue','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceCallReport','QueueCalls','uniqueid','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','restrict','TagId','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueue','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','Members','HopperHistories','ChatInteractions','Company','CompanyId','cm_contact_has_tags','CampaignId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','AnalyticFieldReport','MetricId','SalesforceAccount','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Variable'];(function(_0x51cad4,_0x3917cb){var _0x32bb6a=function(_0x5712bf){while(--_0x5712bf){_0x51cad4['push'](_0x51cad4['shift']());}};_0x32bb6a(++_0x3917cb);}(_0xa809,0x1f3));var _0x9a80=function(_0x108dd,_0x29b0a1){_0x108dd=_0x108dd-0x0;var _0x527e55=_0xa809[_0x108dd];return _0x527e55;};'use strict';var path=require('path');var config=require(_0x9a80('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x9a80('0x1'));var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config[_0x9a80('0x2')],{'database':_0x9a80('0x3'),'username':_0x9a80('0x4'),'password':_0x9a80('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9a80('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9a80('0x7')](),'define':{'charset':_0x9a80('0x8'),'collate':'utf8_general_ci'}}});config[_0x9a80('0x9')]=_[_0x9a80('0xa')](config[_0x9a80('0x9')],{'database':_0x9a80('0x3'),'username':'xcall','password':_0x9a80('0x5'),'options':{'host':_0x9a80('0xb'),'port':0xcea,'dialect':_0x9a80('0x6'),'dialectOptions':{'charset':_0x9a80('0xc')},'logging':![],'timezone':timezone[_0x9a80('0x7')](),'define':{'charset':_0x9a80('0x8'),'collate':_0x9a80('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9a80('0x2')]['database'],config[_0x9a80('0x2')][_0x9a80('0xe')],config[_0x9a80('0x2')][_0x9a80('0xf')],config[_0x9a80('0x2')][_0x9a80('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9a80('0x9')][_0x9a80('0x11')],config['sequelizeHistory'][_0x9a80('0xe')],config['sequelizeHistory'][_0x9a80('0xf')],config[_0x9a80('0x9')][_0x9a80('0x10')])};db['User']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x13'));db[_0x9a80('0x14')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x15'));db['VoiceContext']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x16'));db[_0x9a80('0x17')]=db['sequelize']['import'](_0x9a80('0x18'));db[_0x9a80('0x19')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x1a'));db['VoiceQueue']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x1b'));db['VoiceRecording']=db['sequelize'][_0x9a80('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x9a80('0x1c')]=db['sequelize'][_0x9a80('0x12')]('../api/screenRecording/screenRecording.model');db[_0x9a80('0x1d')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x1e'));db[_0x9a80('0x1f')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x20'));db['VoiceCallReport']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0x9a80('0x21')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x22'));db[_0x9a80('0x23')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x24'));db[_0x9a80('0x25')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x26'));db[_0x9a80('0x27')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/memberReport/memberReport.model');db[_0x9a80('0x28')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x29'));db['VoiceTransferReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x2a'));db[_0x9a80('0x2b')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x2c'));db['UserVoiceQueue']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x2d'));db[_0x9a80('0x2e')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x2f'));db[_0x9a80('0x30')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x31'));db[_0x9a80('0x32')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x33'));db[_0x9a80('0x34')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x35'));db[_0x9a80('0x36')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x9a80('0x37')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/mailServerIn/mailServerIn.model');db[_0x9a80('0x38')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x39'));db['MailAccount']=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db[_0x9a80('0x3a')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/mailQueue/mailQueue.model');db[_0x9a80('0x3b')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x3c'));db[_0x9a80('0x3d')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x3e'));db['MailMessage']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0x9a80('0x12')]('../api/mailApplication/mailApplication.model');db[_0x9a80('0x3f')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x40'));db[_0x9a80('0x41')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x42'));db['DashboardItem']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x43'));db[_0x9a80('0x44')]=db[_0x9a80('0x2')]['import']('../api/faxAccount/faxAccount.model');db[_0x9a80('0x45')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x46'));db[_0x9a80('0x47')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x48'));db[_0x9a80('0x49')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x4a'));db['FaxQueue']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/faxQueue/faxQueue.model');db[_0x9a80('0x4b')]=db[_0x9a80('0x2')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x9a80('0x4c')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x4d'));db['SmsApplication']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x4e'));db[_0x9a80('0x4f')]=db['sequelize'][_0x9a80('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0x9a80('0x50')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x51'));db[_0x9a80('0x52')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x53'));db['OpenchannelAccount']=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x9a80('0x54')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x55'));db[_0x9a80('0x56')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x57'));db[_0x9a80('0x58')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x59'));db[_0x9a80('0x5a')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x5b'));db['OpenchannelQueueReport']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x5c'));db['ChatApplication']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x5d'));db['ChatInteraction']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x5e'));db[_0x9a80('0x5f')]=db['sequelize']['import'](_0x9a80('0x60'));db[_0x9a80('0x61')]=db['sequelize']['import'](_0x9a80('0x62'));db['ChatQueue']=db['sequelize'][_0x9a80('0x12')]('../api/chatQueue/chatQueue.model');db[_0x9a80('0x63')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/chatGroup/chatGroup.model');db[_0x9a80('0x64')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x65'));db[_0x9a80('0x66')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x67'));db[_0x9a80('0x68')]=db['sequelize']['import']('../api/cmContact/cmContact.model');db[_0x9a80('0x69')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x6a'));db[_0x9a80('0x6b')]=db['sequelize'][_0x9a80('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x9a80('0x6c')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x6d'));db[_0x9a80('0x6e')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x6f'));db[_0x9a80('0x70')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x9a80('0x71')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x72'));db['Automation']=db['sequelize'][_0x9a80('0x12')]('../api/automation/automation.model');db[_0x9a80('0x73')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x9a80('0x2')]['import'](_0x9a80('0x74'));db['Condition']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x75'));db['Interval']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/interval/interval.model');db[_0x9a80('0x76')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x77'));db[_0x9a80('0x78')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x79'));db[_0x9a80('0x7a')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x7b'));db[_0x9a80('0x7c')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x7d'));db[_0x9a80('0x7e')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x7f'));db['Tag']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x80'));db[_0x9a80('0x81')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x82'));db['Trigger']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/trigger/trigger.model');db['Variable']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x83'));db[_0x9a80('0x84')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x85'));db[_0x9a80('0x86')]=db['sequelize'][_0x9a80('0x12')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x87'));db[_0x9a80('0x88')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x89'));db[_0x9a80('0x8a')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x8b'));db[_0x9a80('0x8c')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x8d'));db['AnalyticFieldReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x8e'));db[_0x9a80('0x8f')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0x90'));db['SalesforceAccount']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x9a80('0x2')]['import'](_0x9a80('0x91'));db[_0x9a80('0x92')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x93'));db[_0x9a80('0x94')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x95'));db[_0x9a80('0x96')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x97'));db[_0x9a80('0x98')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x99'));db['DeskAccount']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x9a'));db[_0x9a80('0x9b')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x9a80('0x9c')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0x9d'));db[_0x9a80('0x9e')]=db[_0x9a80('0x2')]['import'](_0x9a80('0x9f'));db[_0x9a80('0xa0')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xa1'));db[_0x9a80('0xa2')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xa3'));db['ZendeskAccount']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xa4'));db['ZendeskConfiguration']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xa5'));db[_0x9a80('0xa6')]=db[_0x9a80('0x2')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x9a80('0xa7')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xa8'));db['FreshdeskConfiguration']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xa9'));db[_0x9a80('0xaa')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xab'));db[_0x9a80('0xac')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xad'));db['VtigerField']=db[_0x9a80('0x2')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x9a80('0xae')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xaf'));db[_0x9a80('0xb0')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xb1'));db[_0x9a80('0xb2')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xb3'));db['Dynamics365Account']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xb4'));db[_0x9a80('0xb5')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x9a80('0x84')]=db['sequelize'][_0x9a80('0x12')]('../api/integration/integration.model');db[_0x9a80('0xb6')]=db['sequelize']['import'](_0x9a80('0xb7'));db[_0x9a80('0xb8')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xb9'));db[_0x9a80('0xba')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xbb'));db[_0x9a80('0xbc')]=db['sequelize']['import'](_0x9a80('0xbd'));db[_0x9a80('0xbe')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xbf'));db[_0x9a80('0xc0')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xc1'));db['SmsQueueReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xc2'));db['SquareReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xc3'));db[_0x9a80('0xc4')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xc5'));db[_0x9a80('0xc6')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xc7'));db[_0x9a80('0xc8')]=db[_0x9a80('0x2')]['import']('../api/setting/setting.model');db[_0x9a80('0xc9')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xca'));db['SquareProject']=db[_0x9a80('0x2')]['import'](_0x9a80('0xcb'));db[_0x9a80('0xcc')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xcd'));db['SquareMessage']=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/squareMessage/squareMessage.model');db[_0x9a80('0xce')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xcf'));db['License']=db['sequelize']['import'](_0x9a80('0xd0'));db[_0x9a80('0xd1')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xd2'));db[_0x9a80('0xd3')]=db[_0x9a80('0x2')]['import']('../api/migration/migration.model');db[_0x9a80('0xd4')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/attachment/attachment.model');db['Plugin']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xd5'));db['MailTransferReport']=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xd6'));db[_0x9a80('0xd7')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xd8'));db['FaxTransferReport']=db[_0x9a80('0x2')]['import'](_0x9a80('0xd9'));db[_0x9a80('0xda')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xdb'));db[_0x9a80('0xdc')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xdd'));db[_0x9a80('0xde')]=db[_0x9a80('0x2')]['import'](_0x9a80('0xdf'));db[_0x9a80('0xe0')]=db['sequelize'][_0x9a80('0x12')](_0x9a80('0xe1'));db[_0x9a80('0xe2')]=db[_0x9a80('0x2')][_0x9a80('0x12')](_0x9a80('0xe3'));db[_0x9a80('0xe4')]=db['sequelize']['import'](_0x9a80('0xe5'));db[_0x9a80('0xe6')]=db[_0x9a80('0x2')][_0x9a80('0x12')]('../api/userProfileResource/userProfileResource.model');db['User'][_0x9a80('0xe7')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x9a80('0xe8')});db['User'][_0x9a80('0xe9')](db[_0x9a80('0xea')],{'as':'Recordings','foreignKey':_0x9a80('0xe8')});db['User'][_0x9a80('0xe9')](db[_0x9a80('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0x9a80('0xe8')});db[_0x9a80('0xeb')][_0x9a80('0xe9')](db[_0x9a80('0x17')],{'as':_0x9a80('0xec'),'onDelete':'cascade','hooks':!![]});db['User'][_0x9a80('0xe9')](db[_0x9a80('0x6c')],{'as':_0x9a80('0xed'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0xeb')]['hasMany'](db['CmHopperHistory'],{'as':_0x9a80('0xee'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0xeb')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x9a80('0xe8')});db[_0x9a80('0xeb')][_0x9a80('0xe9')](db['OpenchannelInteraction'],{'as':_0x9a80('0xef'),'foreignKey':'UserId'});db[_0x9a80('0xeb')][_0x9a80('0xe9')](db[_0x9a80('0xf0')],{'as':'ChatInteractions','foreignKey':_0x9a80('0xe8')});db['User'][_0x9a80('0xe9')](db[_0x9a80('0x4f')],{'as':_0x9a80('0xf1'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0xeb')]['hasMany'](db[_0x9a80('0x47')],{'as':_0x9a80('0xf2'),'foreignKey':'UserId'});db[_0x9a80('0xeb')][_0x9a80('0xe9')](db['MailInteraction'],{'as':_0x9a80('0xf3'),'foreignKey':'UserId'});db['User'][_0x9a80('0xf4')](db[_0x9a80('0xe2')],{'as':_0x9a80('0xe2'),'foreignKey':_0x9a80('0xf5')});db[_0x9a80('0xeb')]['belongsToMany'](db[_0x9a80('0x63')],{'as':_0x9a80('0xf6'),'through':_0x9a80('0xf7')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x68')],{'as':_0x9a80('0xf9'),'through':_0x9a80('0xfa')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0xde')],{'as':_0x9a80('0xfb'),'through':_0x9a80('0xfc')});db['User'][_0x9a80('0xf8')](db[_0x9a80('0xce')],{'through':'user_has_teams'});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x3d')],{'as':'MailInteractions','through':_0x9a80('0xfd')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x9a80('0xfe')});db['User']['belongsToMany'](db[_0x9a80('0x47')],{'as':_0x9a80('0xf2'),'through':_0x9a80('0xff')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db['SmsInteraction'],{'as':_0x9a80('0xf1'),'through':'user_has_sms_interactions'});db['User'][_0x9a80('0xf8')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x9a80('0x100')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x9a80('0x101'),'required':![]});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x3a')],{'as':'MailQueues','through':_0x9a80('0x30'),'required':![]});db[_0x9a80('0xeb')]['belongsToMany'](db[_0x9a80('0x102')],{'as':'ChatQueues','through':_0x9a80('0x2e'),'required':![],'hooks':!![]});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x103')],{'as':_0x9a80('0x104'),'through':_0x9a80('0x32'),'required':![]});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x52')],{'as':'SmsQueues','through':_0x9a80('0x34'),'required':![]});db['User'][_0x9a80('0xf8')](db['OpenchannelQueue'],{'as':_0x9a80('0x105'),'through':_0x9a80('0x36'),'required':![]});db[_0x9a80('0xeb')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0xe0')],{'as':_0x9a80('0x106'),'through':'user_has_voice_prefixes','required':![]});db['User'][_0x9a80('0xf8')](db[_0x9a80('0x5a')],{'as':'ChatWebsites','through':_0x9a80('0x107')});db['User'][_0x9a80('0xf8')](db[_0x9a80('0x44')],{'as':'FaxAccounts','through':_0x9a80('0x108')});db['User']['belongsToMany'](db[_0x9a80('0x109')],{'as':_0x9a80('0x10a'),'through':_0x9a80('0x10b')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x10c')],{'as':_0x9a80('0x10d'),'through':_0x9a80('0x10e')});db[_0x9a80('0xeb')][_0x9a80('0xf8')](db[_0x9a80('0x4c')],{'as':_0x9a80('0x10f'),'through':_0x9a80('0x110')});db[_0x9a80('0xeb')]['belongsToMany'](db[_0x9a80('0x111')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x9a80('0x14')]['hasMany'](db[_0x9a80('0x17')],{'as':'SpiedAgents','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x113')});db[_0x9a80('0x114')][_0x9a80('0xe9')](db[_0x9a80('0x17')],{'onDelete':_0x9a80('0x112')});db[_0x9a80('0x17')][_0x9a80('0xe9')](db['VoiceExtension'],{'as':_0x9a80('0x115'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x19')]['belongsToMany'](db[_0x9a80('0x7e')],{'as':_0x9a80('0x116'),'through':_0x9a80('0x117')});db[_0x9a80('0x118')][_0x9a80('0xe9')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x9a80('0x118')][_0x9a80('0xe9')](db['CmHopper'],{'as':_0x9a80('0x119'),'foreignKey':'VoiceQueueId'});db[_0x9a80('0x118')][_0x9a80('0xe9')](db[_0x9a80('0x6c')],{'as':'HopperFinals','foreignKey':_0x9a80('0x11a')});db['VoiceQueue'][_0x9a80('0xe9')](db[_0x9a80('0x6e')],{'as':'HopperHistories','foreignKey':_0x9a80('0x11a')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x9a80('0x118')][_0x9a80('0xe9')](db[_0x9a80('0x6b')],{'as':_0x9a80('0x11b'),'foreignKey':'VoiceQueueId'});db[_0x9a80('0x118')][_0x9a80('0xe9')](db[_0x9a80('0xc0')],{'as':_0x9a80('0x11c'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x9a80('0xf4')](db[_0x9a80('0x28')],{'as':_0x9a80('0x28'),'foreignKey':_0x9a80('0x11d')});db[_0x9a80('0x118')][_0x9a80('0xf4')](db[_0x9a80('0x28')],{'as':'TrunkBackup','foreignKey':_0x9a80('0x11e')});db['VoiceQueue'][_0x9a80('0xf4')](db[_0x9a80('0x11f')],{'as':_0x9a80('0x11f'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x118')][_0x9a80('0xf4')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9a80('0x121')});db[_0x9a80('0x118')][_0x9a80('0xf8')](db[_0x9a80('0xde')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue']['belongsToMany'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x101')});db[_0x9a80('0x118')][_0x9a80('0xf8')](db['Team'],{'as':_0x9a80('0x123'),'through':_0x9a80('0x124')});db[_0x9a80('0x118')][_0x9a80('0xf8')](db['CmList'],{'as':_0x9a80('0x125'),'through':_0x9a80('0x126')});db[_0x9a80('0xea')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0xeb'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x1c')][_0x9a80('0xf4')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x9a80('0x1d')][_0x9a80('0xe9')](db[_0x9a80('0x1f')],{'as':_0x9a80('0x127'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x9a80('0x128')});db[_0x9a80('0x1f')][_0x9a80('0xf4')](db[_0x9a80('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0x9a80('0x128')});db[_0x9a80('0x129')]['hasMany'](db[_0x9a80('0x25')],{'as':_0x9a80('0x12a'),'foreignKey':_0x9a80('0x12b'),'constraints':![]});db[_0x9a80('0x129')][_0x9a80('0xe9')](db[_0x9a80('0x23')],{'as':'AgentReports','foreignKey':_0x9a80('0x12b'),'constraints':![]});db[_0x9a80('0x129')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0xeb'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x129')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':'Contact','foreignKey':_0x9a80('0x12c')});db['MailServerIn']['belongsTo'](db[_0x9a80('0x109')],{'as':_0x9a80('0x109'),'foreignKey':_0x9a80('0x12d')});db[_0x9a80('0x38')]['belongsTo'](db[_0x9a80('0x109')],{'as':_0x9a80('0x109'),'foreignKey':_0x9a80('0x12d')});db['MailAccount']['hasOne'](db[_0x9a80('0x37')],{'as':_0x9a80('0x12e'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x109')][_0x9a80('0xe7')](db[_0x9a80('0x38')],{'as':_0x9a80('0x12f'),'onDelete':_0x9a80('0x112')});db['MailAccount'][_0x9a80('0xe9')](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x12d')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x9a80('0x132'),'foreignKey':_0x9a80('0x12d')});db[_0x9a80('0x109')]['hasMany'](db[_0x9a80('0x133')],{'as':_0x9a80('0x127'),'foreignKey':_0x9a80('0x12d')});db['MailAccount'][_0x9a80('0xe9')](db[_0x9a80('0x3d')],{'as':'Interactions'});db[_0x9a80('0x109')][_0x9a80('0xe9')](db[_0x9a80('0x134')],{'as':_0x9a80('0x115')});db[_0x9a80('0x109')][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0x109')][_0x9a80('0xf4')](db[_0x9a80('0x81')],{'as':'Template','foreignKey':_0x9a80('0x137')});db['MailAccount'][_0x9a80('0xf4')](db['Pause'],{'as':_0x9a80('0x138'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9a80('0x109')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x10b')});db[_0x9a80('0x3a')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':'UserMailQueue'});db[_0x9a80('0x3a')][_0x9a80('0xf8')](db[_0x9a80('0xce')],{'through':_0x9a80('0x139'),'as':'Teams'});db[_0x9a80('0x3d')][_0x9a80('0xe9')](db[_0x9a80('0x133')],{'as':'Messages','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x13a')});db[_0x9a80('0x3d')][_0x9a80('0xf4')](db['MailAccount'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x12d')});db[_0x9a80('0x3d')][_0x9a80('0xf4')](db['CmContact'],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x3d')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x13d'),'foreignKey':'UserId'});db['MailInteraction'][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x13f'),'as':_0x9a80('0x140')});db[_0x9a80('0x3d')][_0x9a80('0xf8')](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x9a80('0x3d')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'through':_0x9a80('0xfd'),'foreignKey':_0x9a80('0x13a')});db[_0x9a80('0x133')]['hasMany'](db['Attachment'],{'as':_0x9a80('0x142'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x133')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0xeb')});db[_0x9a80('0x133')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'onDelete':'cascade','as':_0x9a80('0x13c')});db[_0x9a80('0x133')][_0x9a80('0xf4')](db['MailInteraction'],{'as':_0x9a80('0x143'),'foreignKey':_0x9a80('0x13a')});db[_0x9a80('0x133')][_0x9a80('0xf4')](db[_0x9a80('0x109')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x12d')});db[_0x9a80('0x134')]['belongsTo'](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x144')});db[_0x9a80('0x134')]['belongsTo'](db[_0x9a80('0x3a')],{'onDelete':_0x9a80('0x144')});db['MailApplication']['belongsTo'](db[_0x9a80('0x109')],{'onDelete':'restrict'});db[_0x9a80('0x134')][_0x9a80('0xf4')](db['Interval'],{'onDelete':_0x9a80('0x144'),'foreignKey':'IntervalId'});db['MailApplication']['belongsTo'](db[_0x9a80('0x13e')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x145')});db[_0x9a80('0x3f')][_0x9a80('0xf4')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x9a80('0xde')],{'as':'List','foreignKey':'ListId'});db[_0x9a80('0x3f')]['belongsTo'](db['CmContact'],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x3f')]['belongsTo'](db['MailInteraction'],{});db[_0x9a80('0x3f')]['belongsTo'](db[_0x9a80('0x133')],{});db[_0x9a80('0x3f')][_0x9a80('0xf4')](db['User'],{});db[_0x9a80('0x3f')][_0x9a80('0xf4')](db['MailQueue'],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0x9a80('0x112')});db[_0x9a80('0x44')][_0x9a80('0xe9')](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x146')});db[_0x9a80('0x44')][_0x9a80('0xe9')](db[_0x9a80('0x73')],{'as':_0x9a80('0x132'),'foreignKey':'FaxAccountId'});db[_0x9a80('0x44')][_0x9a80('0xe9')](db['FaxInteraction'],{'as':_0x9a80('0x147')});db['FaxAccount']['hasMany'](db[_0x9a80('0x45')],{'as':_0x9a80('0x115')});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':_0x9a80('0x148'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x44')]['hasMany'](db[_0x9a80('0x49')],{'as':'Messages'});db[_0x9a80('0x44')][_0x9a80('0xf4')](db[_0x9a80('0x28')],{'as':_0x9a80('0x28')});db[_0x9a80('0x44')]['belongsTo'](db[_0x9a80('0xde')],{'as':'List','foreignKey':'ListId'});db[_0x9a80('0x44')][_0x9a80('0xf4')](db['Pause'],{'as':_0x9a80('0x138'),'foreignKey':_0x9a80('0x121')});db[_0x9a80('0x44')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x108')});db['FaxApplication'][_0x9a80('0xf4')](db['User'],{'onDelete':'restrict'});db['FaxApplication'][_0x9a80('0xf4')](db[_0x9a80('0x103')],{'onDelete':_0x9a80('0x144')});db[_0x9a80('0x45')][_0x9a80('0xf4')](db[_0x9a80('0x44')],{'onDelete':'restrict'});db['FaxApplication'][_0x9a80('0xf4')](db[_0x9a80('0x13e')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x145')});db[_0x9a80('0x47')][_0x9a80('0xe9')](db['FaxMessage'],{'as':'Messages','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x149')});db[_0x9a80('0x47')][_0x9a80('0xf4')](db['FaxAccount'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x146')});db[_0x9a80('0x47')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':'Contact','foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x47')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':'Owner','foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x47')][_0x9a80('0xf8')](db['Tag'],{'through':_0x9a80('0x14a'),'as':'Tags'});db[_0x9a80('0x47')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x14a'),'as':_0x9a80('0x14b')});db[_0x9a80('0x47')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'through':_0x9a80('0xff'),'foreignKey':_0x9a80('0x149')});db[_0x9a80('0x49')]['belongsTo'](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0xeb')});db[_0x9a80('0x49')][_0x9a80('0xf4')](db[_0x9a80('0x47')],{'as':_0x9a80('0x143'),'foreignKey':_0x9a80('0x149')});db[_0x9a80('0x49')]['belongsTo'](db['CmContact'],{'onDelete':_0x9a80('0x112'),'as':'Contact'});db[_0x9a80('0x49')][_0x9a80('0xf4')](db[_0x9a80('0xd4')],{'as':_0x9a80('0xd4'),'foreignKey':_0x9a80('0x14c')});db[_0x9a80('0x49')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x9a80('0x146')});db[_0x9a80('0x103')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x32')});db[_0x9a80('0x103')][_0x9a80('0xf8')](db['Team'],{'through':_0x9a80('0x14d'),'as':_0x9a80('0x123')});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0x9a80('0x4b')]['belongsTo'](db['CmList'],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0x4b')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x4b')][_0x9a80('0xf4')](db[_0x9a80('0x47')],{});db['FaxQueueReport']['belongsTo'](db[_0x9a80('0x49')],{});db[_0x9a80('0x4b')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{});db[_0x9a80('0x4b')]['belongsTo'](db[_0x9a80('0x103')],{});db[_0x9a80('0x4c')][_0x9a80('0xe9')](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x14e')});db[_0x9a80('0x4c')][_0x9a80('0xe9')](db['CannedAnswer'],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x9a80('0x4c')][_0x9a80('0xe9')](db[_0x9a80('0x50')],{'as':_0x9a80('0x127'),'foreignKey':_0x9a80('0x14e')});db[_0x9a80('0x4c')][_0x9a80('0xe9')](db[_0x9a80('0x4f')],{'as':_0x9a80('0x147')});db['SmsAccount']['hasMany'](db[_0x9a80('0x14f')],{'as':'Applications'});db[_0x9a80('0x4c')][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':'List','foreignKey':_0x9a80('0x136')});db[_0x9a80('0x4c')][_0x9a80('0xf4')](db[_0x9a80('0x76')],{'as':_0x9a80('0x138'),'foreignKey':_0x9a80('0x121')});db[_0x9a80('0x4c')]['belongsToMany'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x110')});db[_0x9a80('0x14f')][_0x9a80('0xf4')](db['User'],{'onDelete':_0x9a80('0x144')});db[_0x9a80('0x14f')][_0x9a80('0xf4')](db[_0x9a80('0x52')],{'onDelete':_0x9a80('0x144')});db[_0x9a80('0x14f')][_0x9a80('0xf4')](db['SmsAccount'],{'onDelete':_0x9a80('0x144')});db[_0x9a80('0x14f')]['belongsTo'](db[_0x9a80('0x11f')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x120')});db['SmsApplication'][_0x9a80('0xf4')](db[_0x9a80('0x13e')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0x9a80('0xe9')](db[_0x9a80('0x50')],{'as':'Messages','onDelete':_0x9a80('0x112'),'foreignKey':'SmsInteractionId'});db[_0x9a80('0x4f')][_0x9a80('0xf4')](db['SmsAccount'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x14e')});db[_0x9a80('0x4f')][_0x9a80('0xf4')](db['CmContact'],{'as':_0x9a80('0x13c'),'foreignKey':'ContactId'});db[_0x9a80('0x4f')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x13d'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x4f')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x150'),'as':_0x9a80('0x140')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x9a80('0x14b')});db['SmsInteraction'][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'through':'user_has_sms_interactions','foreignKey':_0x9a80('0x151')});db[_0x9a80('0x50')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0xeb')});db[_0x9a80('0x50')]['belongsTo'](db[_0x9a80('0x68')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0x13c')});db['SmsMessage'][_0x9a80('0xf4')](db[_0x9a80('0x4f')],{'onDelete':'cascade','as':_0x9a80('0x143'),'foreignKey':_0x9a80('0x151')});db[_0x9a80('0x50')][_0x9a80('0xf4')](db[_0x9a80('0x4c')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x14e')});db[_0x9a80('0x52')][_0x9a80('0xf8')](db['User'],{'as':_0x9a80('0x122'),'through':_0x9a80('0x34'),'foreignKey':_0x9a80('0x152')});db['SmsQueue']['belongsToMany'](db[_0x9a80('0xce')],{'through':_0x9a80('0x153'),'as':_0x9a80('0x123')});db['OpenchannelAccount'][_0x9a80('0xe9')](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x154')});db[_0x9a80('0x10c')]['hasMany'](db[_0x9a80('0x73')],{'as':'Answers','foreignKey':_0x9a80('0x154')});db[_0x9a80('0x10c')]['hasMany'](db[_0x9a80('0x56')],{'as':_0x9a80('0x147'),'foreignKey':_0x9a80('0x154')});db[_0x9a80('0x10c')][_0x9a80('0xe9')](db[_0x9a80('0x58')],{'as':_0x9a80('0x127'),'foreignKey':_0x9a80('0x154')});db['OpenchannelAccount'][_0x9a80('0xe9')](db[_0x9a80('0x54')],{'as':_0x9a80('0x115'),'foreignKey':'OpenchannelAccountId'});db[_0x9a80('0x10c')]['belongsTo'](db[_0x9a80('0xde')],{'as':'List','foreignKey':_0x9a80('0x136')});db[_0x9a80('0x10c')]['belongsTo'](db[_0x9a80('0x76')],{'as':_0x9a80('0x138'),'foreignKey':_0x9a80('0x121')});db[_0x9a80('0x10c')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':'Agents','through':_0x9a80('0x10e')});db[_0x9a80('0x54')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x144')});db['OpenchannelApplication'][_0x9a80('0xf4')](db[_0x9a80('0x155')],{'onDelete':_0x9a80('0x144'),'foreignKey':'OpenchannelQueueId'});db[_0x9a80('0x54')][_0x9a80('0xf4')](db[_0x9a80('0x10c')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x154')});db[_0x9a80('0x54')][_0x9a80('0xf4')](db[_0x9a80('0x11f')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x54')][_0x9a80('0xf4')](db[_0x9a80('0x13e')],{'onDelete':_0x9a80('0x144'),'foreignKey':_0x9a80('0x145')});db[_0x9a80('0x56')][_0x9a80('0xe9')](db[_0x9a80('0x58')],{'as':_0x9a80('0x127'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x156')});db[_0x9a80('0x56')]['belongsTo'](db[_0x9a80('0x10c')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x154')});db[_0x9a80('0x56')]['belongsTo'](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':'ContactId'});db['OpenchannelInteraction']['belongsTo'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x13d'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x56')]['belongsToMany'](db[_0x9a80('0x13e')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x9a80('0x56')]['belongsToMany'](db['Tag'],{'through':_0x9a80('0x157'),'as':_0x9a80('0x14b')});db[_0x9a80('0x56')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'through':'user_has_openchannel_interactions','foreignKey':_0x9a80('0x156')});db['OpenchannelMessage']['belongsTo'](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0xeb')});db[_0x9a80('0x58')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'onDelete':'cascade','as':_0x9a80('0x13c')});db['OpenchannelMessage'][_0x9a80('0xf4')](db[_0x9a80('0x56')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0x143'),'foreignKey':_0x9a80('0x156')});db[_0x9a80('0x58')][_0x9a80('0xf4')](db[_0x9a80('0xd4')],{'as':_0x9a80('0xd4'),'foreignKey':_0x9a80('0x14c')});db[_0x9a80('0x58')][_0x9a80('0xf4')](db[_0x9a80('0x10c')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x154')});db[_0x9a80('0x155')]['belongsToMany'](db[_0x9a80('0xeb')],{'as':'Agents','through':_0x9a80('0x36'),'foreignKey':_0x9a80('0x158')});db[_0x9a80('0x155')][_0x9a80('0xf8')](db['Team'],{'through':_0x9a80('0x159'),'as':_0x9a80('0x123')});db['ChatWebsite'][_0x9a80('0xe9')](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x15a')});db['ChatWebsite'][_0x9a80('0xe9')](db[_0x9a80('0x73')],{'as':'Answers','foreignKey':_0x9a80('0x15a')});db['ChatWebsite'][_0x9a80('0xe9')](db[_0x9a80('0x64')],{'as':'ProactiveActions'});db[_0x9a80('0x5a')]['hasMany'](db[_0x9a80('0xf0')],{'as':'Interactions'});db[_0x9a80('0x5a')][_0x9a80('0xe9')](db[_0x9a80('0x15b')],{'as':_0x9a80('0x115')});db[_0x9a80('0x5a')][_0x9a80('0xe9')](db[_0x9a80('0x5f')],{'as':_0x9a80('0x127')});db['ChatWebsite'][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0x5a')]['belongsTo'](db[_0x9a80('0x11f')],{'as':_0x9a80('0x11f'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x5a')]['belongsTo'](db[_0x9a80('0x76')],{'as':_0x9a80('0x138'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x9a80('0xf8')](db['User'],{'as':_0x9a80('0x122'),'through':_0x9a80('0x107')});db[_0x9a80('0x15c')]['belongsTo'](db[_0x9a80('0x10c')],{});db[_0x9a80('0x15c')][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0x15c')]['belongsTo'](db[_0x9a80('0x68')],{'as':'Contact','foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x15c')][_0x9a80('0xf4')](db[_0x9a80('0x56')],{});db[_0x9a80('0x15c')][_0x9a80('0xf4')](db[_0x9a80('0x58')],{});db['OpenchannelQueueReport'][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{});db[_0x9a80('0x15c')][_0x9a80('0xf4')](db[_0x9a80('0x155')],{});db[_0x9a80('0x15b')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x15d'),'foreignKey':_0x9a80('0xe8'),'onDelete':_0x9a80('0x144')});db[_0x9a80('0x15b')]['belongsTo'](db['ChatQueue'],{'as':_0x9a80('0x15e'),'foreignKey':'ChatQueueId','onDelete':_0x9a80('0x144')});db[_0x9a80('0x15b')][_0x9a80('0xf4')](db[_0x9a80('0x5a')],{'as':_0x9a80('0x15f'),'foreignKey':_0x9a80('0x15a'),'onDelete':'restrict'});db['ChatApplication'][_0x9a80('0xf4')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9a80('0x145')});db[_0x9a80('0xf0')][_0x9a80('0xe9')](db['ChatMessage'],{'as':_0x9a80('0x127'),'onDelete':'cascade','foreignKey':_0x9a80('0x160')});db['ChatInteraction']['belongsTo'](db[_0x9a80('0x5a')],{'as':_0x9a80('0x13b'),'foreignKey':'ChatWebsiteId'});db[_0x9a80('0xf0')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':'Contact','foreignKey':'ContactId'});db['ChatInteraction'][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'as':'Owner','foreignKey':_0x9a80('0xe8')});db['ChatInteraction'][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x161'),'as':_0x9a80('0x140')});db[_0x9a80('0xf0')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x161'),'as':'ThroughTags'});db[_0x9a80('0xf0')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'through':_0x9a80('0xfe'),'foreignKey':'ChatInteractionId'});db[_0x9a80('0x5f')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0xeb')});db['ChatMessage'][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0x13c'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0x9a80('0xf0')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0x143'),'foreignKey':'ChatInteractionId'});db[_0x9a80('0x5f')][_0x9a80('0xf4')](db[_0x9a80('0xd4')],{'as':_0x9a80('0xd4'),'foreignKey':_0x9a80('0x14c')});db[_0x9a80('0x5f')][_0x9a80('0xf4')](db[_0x9a80('0x5a')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x15a')});db[_0x9a80('0x61')]['belongsTo'](db[_0x9a80('0x68')],{'onDelete':_0x9a80('0x112'),'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x61')][_0x9a80('0xf4')](db[_0x9a80('0x5a')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x15a')});db[_0x9a80('0x102')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0x2e'),'hooks':!![]});db[_0x9a80('0x102')][_0x9a80('0xf8')](db[_0x9a80('0xce')],{'through':'team_has_chat_queues','as':'Teams'});db['ChatGroup'][_0x9a80('0xe9')](db['ChatInternalMessage'],{'as':_0x9a80('0x127'),'foreignKey':_0x9a80('0x162'),'onDelete':'cascade'});db[_0x9a80('0x63')]['belongsToMany'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x163'),'through':_0x9a80('0xf7')});db['ChatProactiveAction'][_0x9a80('0xf4')](db['ChatWebsite'],{'as':_0x9a80('0x15f'),'foreignKey':_0x9a80('0x15a')});db[_0x9a80('0x66')][_0x9a80('0xe9')](db[_0x9a80('0x68')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x9a80('0x68')][_0x9a80('0xe9')](db['CmHopper'],{'as':_0x9a80('0x119'),'foreignKey':'ContactId'});db[_0x9a80('0x68')][_0x9a80('0xe9')](db[_0x9a80('0x6c')],{'as':'HopperFinals','foreignKey':_0x9a80('0x12c')});db['CmContact'][_0x9a80('0xe9')](db[_0x9a80('0x6e')],{'as':_0x9a80('0x164'),'foreignKey':'ContactId'});db[_0x9a80('0x68')][_0x9a80('0xe9')](db['ReportAgentPreview'],{'as':_0x9a80('0x70'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x68')][_0x9a80('0xe9')](db[_0x9a80('0xc0')],{'as':_0x9a80('0x11c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0x68')]['hasMany'](db[_0x9a80('0x56')],{'as':_0x9a80('0xef'),'foreignKey':_0x9a80('0x12c'),'onDelete':'restrict'});db[_0x9a80('0x68')]['hasMany'](db[_0x9a80('0xf0')],{'as':_0x9a80('0x165'),'foreignKey':_0x9a80('0x12c'),'onDelete':_0x9a80('0x144')});db[_0x9a80('0x68')][_0x9a80('0xe9')](db[_0x9a80('0x4f')],{'as':_0x9a80('0xf1'),'foreignKey':_0x9a80('0x12c'),'onDelete':'restrict'});db[_0x9a80('0x68')]['hasMany'](db[_0x9a80('0x47')],{'as':_0x9a80('0xf2'),'foreignKey':_0x9a80('0x12c'),'onDelete':_0x9a80('0x144')});db[_0x9a80('0x68')][_0x9a80('0xe9')](db[_0x9a80('0x3d')],{'as':_0x9a80('0xf3'),'foreignKey':_0x9a80('0x12c'),'onDelete':'restrict'});db[_0x9a80('0x68')][_0x9a80('0xf4')](db['CmCompany'],{'as':_0x9a80('0x166'),'foreignKey':_0x9a80('0x167')});db[_0x9a80('0x68')]['belongsTo'](db['CmList'],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136'),'onDelete':'cascade'});db[_0x9a80('0x68')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':'Users','through':_0x9a80('0xfa')});db[_0x9a80('0x68')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'as':_0x9a80('0x140'),'through':_0x9a80('0x168')});db[_0x9a80('0x68')]['belongsToMany'](db[_0x9a80('0x13e')],{'through':'cm_contact_has_tags','as':_0x9a80('0x14b')});db[_0x9a80('0x69')]['belongsTo'](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x69')]['belongsTo'](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':_0x9a80('0x136'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x69')]['belongsTo'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x15d'),'foreignKey':_0x9a80('0xe8')});db[_0x9a80('0x69')]['belongsTo'](db[_0x9a80('0x118')],{'as':_0x9a80('0x15e'),'foreignKey':_0x9a80('0x11a'),'onDelete':'cascade'});db[_0x9a80('0x69')]['belongsTo'](db['Campaign'],{'as':_0x9a80('0xd1'),'foreignKey':_0x9a80('0x169'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x69')][_0x9a80('0xf4')](db['User'],{'as':_0x9a80('0x13d'),'foreignKey':'OwnerId'});db[_0x9a80('0x6b')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c'),'onDelete':_0x9a80('0x112')});db['CmHopperBlack'][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':'List','foreignKey':_0x9a80('0x136'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x6b')][_0x9a80('0xf4')](db[_0x9a80('0x118')],{'as':_0x9a80('0x15e'),'foreignKey':_0x9a80('0x11a'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x6b')][_0x9a80('0xf4')](db[_0x9a80('0xd1')],{'as':_0x9a80('0xd1'),'foreignKey':_0x9a80('0x169'),'onDelete':'cascade'});db[_0x9a80('0x16a')][_0x9a80('0xe9')](db[_0x9a80('0x16b')],{'as':{'plural':_0x9a80('0x16c'),'singular':_0x9a80('0x16d')},'foreignKey':_0x9a80('0x16e'),'onDelete':_0x9a80('0x112'),'hooks':!![]});db[_0x9a80('0x16a')][_0x9a80('0xe9')](db[_0x9a80('0x16b')],{'as':{'plural':_0x9a80('0x16f'),'singular':_0x9a80('0x170')},'foreignKey':_0x9a80('0x171'),'onDelete':_0x9a80('0x112'),'hooks':!![]});db[_0x9a80('0x16a')][_0x9a80('0xe9')](db[_0x9a80('0x71')],{'as':_0x9a80('0x172'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x9a80('0x11f')][_0x9a80('0xe9')](db[_0x9a80('0x11f')],{'as':_0x9a80('0x173'),'foreignKey':_0x9a80('0x120'),'onDelete':_0x9a80('0x112'),'hooks':!![],'required':![]});db[_0x9a80('0x11f')]['hasMany'](db[_0x9a80('0x17')],{'as':_0x9a80('0xec'),'foreignKey':_0x9a80('0x120'),'onDelete':'restrict'});db[_0x9a80('0x11f')][_0x9a80('0xe9')](db['MailApplication'],{'as':_0x9a80('0x174'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x11f')][_0x9a80('0xe9')](db[_0x9a80('0x15b')],{'as':_0x9a80('0x175'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x11f')][_0x9a80('0xe9')](db[_0x9a80('0x45')],{'as':_0x9a80('0x176'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0x11f')][_0x9a80('0xe9')](db[_0x9a80('0x14f')],{'as':'SmsApplications','foreignKey':_0x9a80('0x120')});db[_0x9a80('0x7c')][_0x9a80('0xf4')](db[_0x9a80('0x109')],{});db[_0x9a80('0x7c')][_0x9a80('0xf4')](db[_0x9a80('0x88')],{'foreignKey':_0x9a80('0x177')});db[_0x9a80('0x7c')]['belongsTo'](db[_0x9a80('0x178')],{'foreignKey':'CustomReportId'});db[_0x9a80('0x7e')][_0x9a80('0xf8')](db[_0x9a80('0x19')],{'as':'Mohs','through':_0x9a80('0x117'),'onDelete':_0x9a80('0x144')});db[_0x9a80('0x13e')][_0x9a80('0xf8')](db[_0x9a80('0x68')],{'through':_0x9a80('0x168')});db[_0x9a80('0x13e')]['belongsToMany'](db[_0x9a80('0xf0')],{'through':_0x9a80('0x161')});db[_0x9a80('0x13e')][_0x9a80('0xf8')](db[_0x9a80('0x3d')],{'through':_0x9a80('0x13f')});db['Tag'][_0x9a80('0xf8')](db[_0x9a80('0x4f')],{'through':_0x9a80('0x150')});db[_0x9a80('0x13e')]['belongsToMany'](db[_0x9a80('0x47')],{'through':_0x9a80('0x14a')});db['Tag'][_0x9a80('0xf8')](db['OpenchannelInteraction'],{'through':_0x9a80('0x157')});db[_0x9a80('0x179')][_0x9a80('0xe9')](db[_0x9a80('0x16b')],{'as':{'plural':_0x9a80('0x17a'),'singular':_0x9a80('0x17b')},'foreignKey':_0x9a80('0x17c'),'onDelete':_0x9a80('0x112'),'hooks':!![]});db[_0x9a80('0x179')]['hasMany'](db['Condition'],{'as':{'plural':_0x9a80('0x17d'),'singular':_0x9a80('0x17e')},'foreignKey':_0x9a80('0x17f'),'onDelete':_0x9a80('0x112'),'hooks':!![]});db[_0x9a80('0x179')][_0x9a80('0xe9')](db[_0x9a80('0x71')],{'as':_0x9a80('0x172'),'foreignKey':_0x9a80('0x180'),'onDelete':'cascade','hooks':!![]});db[_0x9a80('0x178')][_0x9a80('0xe9')](db['AnalyticFieldReport'],{'as':_0x9a80('0x181'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x182'),'hooks':!![]});db[_0x9a80('0x88')][_0x9a80('0xe9')](db[_0x9a80('0x183')],{'as':_0x9a80('0x181'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x177')});db['AnalyticMetric'][_0x9a80('0xe9')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x184')});db['AnalyticFieldReport']['belongsTo'](db[_0x9a80('0x8c')],{'foreignKey':'MetricId'});db[_0x9a80('0x185')][_0x9a80('0xe9')](db[_0x9a80('0x186')],{'as':_0x9a80('0x187'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db['SalesforceConfiguration'][_0x9a80('0xe9')](db['SalesforceField'],{'as':_0x9a80('0x189'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x186')][_0x9a80('0xe9')](db[_0x9a80('0x92')],{'as':_0x9a80('0x18b'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x186')][_0x9a80('0xe9')](db['SalesforceField'],{'as':_0x9a80('0x181'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x186')][_0x9a80('0xf4')](db[_0x9a80('0x185')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db['SalesforceField'][_0x9a80('0xe9')](db[_0x9a80('0x92')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db['SalesforceField'][_0x9a80('0xe9')](db[_0x9a80('0x92')],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x92')][_0x9a80('0xe9')](db[_0x9a80('0x92')],{'as':'Field','foreignKey':_0x9a80('0x18d')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':_0x9a80('0x190'),'foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9a80('0x188')});db[_0x9a80('0x96')][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':_0x9a80('0x189'),'onDelete':'cascade','foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x96')][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':_0x9a80('0x18b'),'onDelete':_0x9a80('0x112'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x96')][_0x9a80('0xf4')](db[_0x9a80('0x94')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db['SugarcrmField'][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x98')][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':_0x9a80('0x18f'),'foreignKey':'DescriptionId'});db[_0x9a80('0x98')][_0x9a80('0xe9')](db[_0x9a80('0x98')],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x98')][_0x9a80('0xf4')](db[_0x9a80('0x190')],{'as':_0x9a80('0x190'),'foreignKey':_0x9a80('0x192')});db[_0x9a80('0x193')]['hasMany'](db[_0x9a80('0x9b')],{'as':_0x9a80('0x187'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db['DeskConfiguration'][_0x9a80('0xe9')](db['DeskField'],{'as':_0x9a80('0x189'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18a')});db['DeskConfiguration'][_0x9a80('0xe9')](db[_0x9a80('0x9c')],{'as':'Descriptions','onDelete':_0x9a80('0x112'),'foreignKey':'DescriptionId'});db[_0x9a80('0x9b')][_0x9a80('0xe9')](db[_0x9a80('0x9c')],{'as':_0x9a80('0x181'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18d')});db['DeskConfiguration'][_0x9a80('0xf4')](db['DeskAccount'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0x9b')]['belongsToMany'](db[_0x9a80('0x13e')],{'through':_0x9a80('0x194')});db[_0x9a80('0x9c')][_0x9a80('0xe9')](db[_0x9a80('0x9c')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x9c')][_0x9a80('0xe9')](db[_0x9a80('0x9c')],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x9c')][_0x9a80('0xe9')](db[_0x9a80('0x9c')],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x9c')][_0x9a80('0xf4')](db[_0x9a80('0x190')],{'as':_0x9a80('0x190'),'foreignKey':_0x9a80('0x192')});db[_0x9a80('0x9e')]['hasMany'](db[_0x9a80('0xa0')],{'as':'Configurations','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db['ZohoConfiguration'][_0x9a80('0xe9')](db[_0x9a80('0xa2')],{'as':_0x9a80('0x189'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0xa0')]['hasMany'](db[_0x9a80('0xa2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x9a80('0x18c')});db['ZohoConfiguration'][_0x9a80('0xe9')](db['ZohoField'],{'as':_0x9a80('0x181'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0xa0')][_0x9a80('0xf4')](db[_0x9a80('0x9e')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0xa2')][_0x9a80('0xe9')](db[_0x9a80('0xa2')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0xa2')][_0x9a80('0xe9')](db[_0x9a80('0xa2')],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db['ZohoField'][_0x9a80('0xe9')](db[_0x9a80('0xa2')],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db['ZohoField'][_0x9a80('0xf4')](db['Variable'],{'as':_0x9a80('0x190'),'foreignKey':_0x9a80('0x192')});db[_0x9a80('0x195')][_0x9a80('0xe9')](db[_0x9a80('0x196')],{'as':'Configurations','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db['ZendeskConfiguration'][_0x9a80('0xe9')](db['ZendeskField'],{'as':_0x9a80('0x189'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x196')]['hasMany'](db[_0x9a80('0xa6')],{'as':_0x9a80('0x18b'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x196')]['hasMany'](db[_0x9a80('0xa6')],{'as':_0x9a80('0x181'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x196')][_0x9a80('0xf4')](db[_0x9a80('0x195')],{'as':_0x9a80('0x13b'),'foreignKey':'AccountId'});db[_0x9a80('0x196')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':_0x9a80('0x197')});db[_0x9a80('0xa6')][_0x9a80('0xe9')](db[_0x9a80('0xa6')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0xa6')]['hasMany'](db['ZendeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9a80('0xa6')]['hasMany'](db['ZendeskField'],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0xa6')][_0x9a80('0xf4')](db[_0x9a80('0x190')],{'as':_0x9a80('0x190'),'foreignKey':_0x9a80('0x192')});db['FreshdeskAccount'][_0x9a80('0xe9')](db[_0x9a80('0x198')],{'as':'Configurations','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0x198')][_0x9a80('0xe9')](db[_0x9a80('0xaa')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9a80('0x198')]['hasMany'](db[_0x9a80('0xaa')],{'as':_0x9a80('0x18b'),'onDelete':'cascade','foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x198')][_0x9a80('0xe9')](db['FreshdeskField'],{'as':'Fields','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18d')});db['FreshdeskConfiguration'][_0x9a80('0xf4')](db[_0x9a80('0xa7')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0x198')][_0x9a80('0xf8')](db['Tag'],{'through':_0x9a80('0x199')});db[_0x9a80('0xaa')][_0x9a80('0xe9')](db[_0x9a80('0xaa')],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db['FreshdeskField']['hasMany'](db[_0x9a80('0xaa')],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db['FreshdeskField'][_0x9a80('0xe9')](db['FreshdeskField'],{'as':'Field','foreignKey':'FieldId'});db['FreshdeskField'][_0x9a80('0xf4')](db[_0x9a80('0x190')],{'as':_0x9a80('0x190'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x9a80('0xe9')](db['VtigerConfiguration'],{'as':_0x9a80('0x187'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0x19a')]['hasMany'](db['VtigerField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9a80('0x19a')]['hasMany'](db[_0x9a80('0x19b')],{'as':_0x9a80('0x18b'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x19a')][_0x9a80('0xe9')](db['VtigerField'],{'as':_0x9a80('0x181'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x19a')][_0x9a80('0xf4')](db['VtigerAccount'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0x19a')][_0x9a80('0xf8')](db[_0x9a80('0x13e')],{'through':'int_vtiger_configuration_has_tags'});db[_0x9a80('0x19b')][_0x9a80('0xe9')](db['VtigerField'],{'as':_0x9a80('0x18e'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x19b')]['hasMany'](db['VtigerField'],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db['VtigerField'][_0x9a80('0xe9')](db[_0x9a80('0x19b')],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0x19b')][_0x9a80('0xf4')](db[_0x9a80('0x190')],{'as':'Variable','foreignKey':_0x9a80('0x192')});db['ServicenowAccount'][_0x9a80('0xe9')](db[_0x9a80('0xb0')],{'as':'Configurations','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0xb0')][_0x9a80('0xe9')](db[_0x9a80('0xb2')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9a80('0xb0')]['hasMany'](db[_0x9a80('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x9a80('0xb0')]['hasMany'](db[_0x9a80('0xb2')],{'as':_0x9a80('0x181'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0xb0')][_0x9a80('0xf4')](db[_0x9a80('0xae')],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db['ServicenowField'][_0x9a80('0xe9')](db[_0x9a80('0xb2')],{'as':_0x9a80('0x18e'),'foreignKey':'SubjectId'});db[_0x9a80('0xb2')][_0x9a80('0xe9')](db[_0x9a80('0xb2')],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0xb2')]['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':_0x9a80('0x18d')});db[_0x9a80('0xb2')]['belongsTo'](db[_0x9a80('0x190')],{'as':_0x9a80('0x190'),'foreignKey':'VariableId'});db[_0x9a80('0x19c')][_0x9a80('0xe9')](db[_0x9a80('0x19d')],{'as':_0x9a80('0x187'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x188')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18a')});db[_0x9a80('0x19d')][_0x9a80('0xe9')](db['Dynamics365Field'],{'as':_0x9a80('0x18b'),'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18c')});db[_0x9a80('0x19d')][_0x9a80('0xe9')](db[_0x9a80('0xb5')],{'as':'Fields','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x18d')});db['Dynamics365Configuration'][_0x9a80('0xf4')](db['Dynamics365Account'],{'as':_0x9a80('0x13b'),'foreignKey':_0x9a80('0x188')});db[_0x9a80('0xb5')][_0x9a80('0xe9')](db[_0x9a80('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['Dynamics365Field'][_0x9a80('0xe9')](db['Dynamics365Field'],{'as':_0x9a80('0x18f'),'foreignKey':_0x9a80('0x18c')});db['Dynamics365Field'][_0x9a80('0xe9')](db[_0x9a80('0xb5')],{'as':_0x9a80('0x191'),'foreignKey':_0x9a80('0x18d')});db[_0x9a80('0xb5')][_0x9a80('0xf4')](db['Variable'],{'as':'Variable','foreignKey':_0x9a80('0x192')});db[_0x9a80('0xb8')][_0x9a80('0xf4')](db[_0x9a80('0x5a')],{});db['ChatQueueReport'][_0x9a80('0xf4')](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':'ListId'});db[_0x9a80('0xb8')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db[_0x9a80('0xb8')][_0x9a80('0xf4')](db[_0x9a80('0xf0')],{});db[_0x9a80('0xb8')]['belongsTo'](db[_0x9a80('0x5f')],{});db['ChatQueueReport'][_0x9a80('0xf4')](db['User'],{});db[_0x9a80('0xb8')][_0x9a80('0xf4')](db['ChatQueue'],{});db[_0x9a80('0xba')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x19e')});db[_0x9a80('0xba')]['belongsTo'](db['User'],{'onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x19f')});db['JscriptySessionReport']['hasMany'](db[_0x9a80('0xbe')],{'foreignKey':_0x9a80('0x1a0'),'onDelete':_0x9a80('0x112')});db['JscriptySessionReport']['hasMany'](db[_0x9a80('0xbc')],{'foreignKey':_0x9a80('0x1a0'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0x1a1')][_0x9a80('0xf4')](db['SmsAccount'],{});db[_0x9a80('0x1a1')]['belongsTo'](db[_0x9a80('0xde')],{'as':_0x9a80('0x135'),'foreignKey':'ListId'});db[_0x9a80('0x1a1')][_0x9a80('0xf4')](db[_0x9a80('0x68')],{'as':_0x9a80('0x13c'),'foreignKey':_0x9a80('0x12c')});db['SmsQueueReport'][_0x9a80('0xf4')](db[_0x9a80('0x4f')],{});db['SmsQueueReport']['belongsTo'](db[_0x9a80('0x50')],{});db['SmsQueueReport'][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{});db[_0x9a80('0x1a1')]['belongsTo'](db['SmsQueue'],{});db['JscriptyProject'][_0x9a80('0xe9')](db[_0x9a80('0xc0')],{'foreignKey':_0x9a80('0x1a2')});db[_0x9a80('0xc6')][_0x9a80('0xe9')](db[_0x9a80('0xbe')],{'foreignKey':'ProjectId'});db[_0x9a80('0xc6')][_0x9a80('0xe9')](db['JscriptyAnswerReport'],{'foreignKey':_0x9a80('0x1a2')});db[_0x9a80('0x111')]['belongsToMany'](db['User'],{'as':_0x9a80('0x141'),'through':'user_has_square_projects'});db[_0x9a80('0xce')][_0x9a80('0xf8')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0x9a80('0xce')][_0x9a80('0xf8')](db['VoiceQueue'],{'through':'team_has_voice_queues','as':_0x9a80('0x1a3')});db[_0x9a80('0xce')][_0x9a80('0xf8')](db[_0x9a80('0x3a')],{'through':_0x9a80('0x139'),'as':'MailQueues'});db[_0x9a80('0xce')][_0x9a80('0xf8')](db[_0x9a80('0x102')],{'through':_0x9a80('0x1a4'),'as':_0x9a80('0x1a5')});db['Team'][_0x9a80('0xf8')](db[_0x9a80('0x103')],{'through':_0x9a80('0x14d'),'as':_0x9a80('0x104')});db[_0x9a80('0xce')][_0x9a80('0xf8')](db[_0x9a80('0x52')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0x9a80('0xf8')](db[_0x9a80('0x155')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Campaign']['hasMany'](db['CmHopper'],{'as':_0x9a80('0x119'),'foreignKey':_0x9a80('0x169')});db[_0x9a80('0xd1')][_0x9a80('0xe9')](db[_0x9a80('0x6c')],{'as':'HopperFinals','foreignKey':_0x9a80('0x169')});db['Campaign'][_0x9a80('0xe9')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x9a80('0x169')});db[_0x9a80('0xd1')][_0x9a80('0xe9')](db[_0x9a80('0x6b')],{'as':_0x9a80('0x11b'),'foreignKey':_0x9a80('0x169')});db[_0x9a80('0xd1')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0x9a80('0x11d')});db['Campaign'][_0x9a80('0xf4')](db[_0x9a80('0x28')],{'as':_0x9a80('0x1a6'),'foreignKey':_0x9a80('0x11e')});db['Campaign']['belongsTo'](db[_0x9a80('0x11f')],{'as':_0x9a80('0x11f'),'foreignKey':_0x9a80('0x120')});db[_0x9a80('0xd1')]['belongsTo'](db[_0x9a80('0x111')],{'as':_0x9a80('0x111'),'foreignKey':'SquareProjectId'});db[_0x9a80('0xd1')][_0x9a80('0xf8')](db[_0x9a80('0xde')],{'as':'Lists','through':_0x9a80('0x1a7')});db[_0x9a80('0xd1')]['belongsToMany'](db[_0x9a80('0xde')],{'as':_0x9a80('0x125'),'through':_0x9a80('0x1a8')});db['MailTransferReport'][_0x9a80('0xf4')](db['MailMessage'],{});db[_0x9a80('0x1a9')][_0x9a80('0xf4')](db[_0x9a80('0x3d')],{});db[_0x9a80('0x1a9')][_0x9a80('0xf4')](db[_0x9a80('0x109')],{'foreignKey':_0x9a80('0x1aa'),'as':'FromAccount'});db[_0x9a80('0x1a9')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ab'),'as':_0x9a80('0x1ac')});db['MailTransferReport'][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ad'),'as':_0x9a80('0x1ae')});db[_0x9a80('0x1a9')][_0x9a80('0xf4')](db[_0x9a80('0x3a')],{'foreignKey':_0x9a80('0x1af'),'as':_0x9a80('0x1b0')});db[_0x9a80('0x1a9')][_0x9a80('0xf4')](db[_0x9a80('0x109')],{'foreignKey':_0x9a80('0x1b1'),'as':_0x9a80('0x1b2')});db[_0x9a80('0xd7')]['belongsTo'](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db[_0x9a80('0xf0')],{});db[_0x9a80('0xd7')][_0x9a80('0xf4')](db['ChatWebsite'],{'foreignKey':_0x9a80('0x1b3'),'as':_0x9a80('0x1b4')});db[_0x9a80('0xd7')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ab'),'as':_0x9a80('0x1ac')});db[_0x9a80('0xd7')][_0x9a80('0xf4')](db['User'],{'foreignKey':_0x9a80('0x1ad'),'as':_0x9a80('0x1ae')});db[_0x9a80('0xd7')][_0x9a80('0xf4')](db[_0x9a80('0x102')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x9a80('0x1b5'),'as':'ToAccount'});db[_0x9a80('0x1b6')]['belongsTo'](db[_0x9a80('0x49')],{});db['FaxTransferReport'][_0x9a80('0xf4')](db['FaxInteraction'],{});db[_0x9a80('0x1b6')][_0x9a80('0xf4')](db[_0x9a80('0x44')],{'foreignKey':_0x9a80('0x1b7'),'as':'FromAccount'});db[_0x9a80('0x1b6')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ab'),'as':_0x9a80('0x1ac')});db[_0x9a80('0x1b6')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ad'),'as':_0x9a80('0x1ae')});db[_0x9a80('0x1b6')][_0x9a80('0xf4')](db[_0x9a80('0x103')],{'foreignKey':_0x9a80('0x1b8'),'as':_0x9a80('0x1b0')});db[_0x9a80('0x1b6')]['belongsTo'](db[_0x9a80('0x44')],{'foreignKey':_0x9a80('0x1b9'),'as':_0x9a80('0x1b2')});db[_0x9a80('0xda')]['belongsTo'](db[_0x9a80('0x58')],{});db[_0x9a80('0xda')]['belongsTo'](db[_0x9a80('0x56')],{});db[_0x9a80('0xda')]['belongsTo'](db[_0x9a80('0x10c')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db['OpenchannelTransferReport'][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ab'),'as':_0x9a80('0x1ac')});db[_0x9a80('0xda')][_0x9a80('0xf4')](db['User'],{'foreignKey':'ToUserId','as':_0x9a80('0x1ae')});db[_0x9a80('0xda')][_0x9a80('0xf4')](db[_0x9a80('0x155')],{'foreignKey':_0x9a80('0x1ba'),'as':'ToQueue'});db[_0x9a80('0xda')][_0x9a80('0xf4')](db[_0x9a80('0x10c')],{'foreignKey':_0x9a80('0x1bb'),'as':_0x9a80('0x1b2')});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db[_0x9a80('0x50')],{});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db[_0x9a80('0x4f')],{});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db[_0x9a80('0x4c')],{'foreignKey':_0x9a80('0x1bc'),'as':_0x9a80('0x1b4')});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db['User'],{'foreignKey':_0x9a80('0x1ab'),'as':_0x9a80('0x1ac')});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db[_0x9a80('0xeb')],{'foreignKey':_0x9a80('0x1ad'),'as':_0x9a80('0x1ae')});db[_0x9a80('0xdc')][_0x9a80('0xf4')](db[_0x9a80('0x52')],{'foreignKey':'ToSmsQueueId','as':_0x9a80('0x1b0')});db['SmsTransferReport'][_0x9a80('0xf4')](db[_0x9a80('0x4c')],{'foreignKey':'ToSmsAccountId','as':_0x9a80('0x1b2')});db[_0x9a80('0xde')]['hasMany'](db[_0x9a80('0x130')],{'as':_0x9a80('0x131'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0xde')]['hasMany'](db[_0x9a80('0x1bd')],{'as':_0x9a80('0x1be'),'foreignKey':'ListId'});db[_0x9a80('0xde')][_0x9a80('0xe9')](db[_0x9a80('0x68')],{'as':'Contacts','onDelete':_0x9a80('0x112'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0xde')][_0x9a80('0xe9')](db[_0x9a80('0x6c')],{'as':'HopperFinals','foreignKey':_0x9a80('0x136')});db[_0x9a80('0xde')][_0x9a80('0xe9')](db[_0x9a80('0x6e')],{'as':_0x9a80('0xee'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0xde')][_0x9a80('0xe9')](db['ReportAgentPreview'],{'as':_0x9a80('0x70'),'foreignKey':_0x9a80('0x136')});db[_0x9a80('0xde')][_0x9a80('0xf8')](db['VoiceQueue'],{'as':_0x9a80('0x1bf'),'through':'voice_queues_has_cm_lists'});db[_0x9a80('0xde')][_0x9a80('0xf8')](db[_0x9a80('0xeb')],{'as':_0x9a80('0x122'),'through':_0x9a80('0xfc')});db['VoicePrefix'][_0x9a80('0xe9')](db[_0x9a80('0x17')],{'as':_0x9a80('0xec'),'onDelete':_0x9a80('0x144')});db['VoicePrefix'][_0x9a80('0xf8')](db['User'],{'as':_0x9a80('0x122'),'through':'user_has_voice_prefixes'});db['UserProfile']['hasMany'](db[_0x9a80('0xeb')],{'as':_0x9a80('0x141'),'foreignKey':'userProfileId'});db[_0x9a80('0xe2')][_0x9a80('0xe9')](db[_0x9a80('0xe4')],{'as':'UserProfileSections','foreignKey':_0x9a80('0xf5'),'onDelete':_0x9a80('0x112')});db[_0x9a80('0xe4')][_0x9a80('0xe9')](db[_0x9a80('0xe6')],{'as':_0x9a80('0x1c0'),'foreignKey':_0x9a80('0x1c1'),'onDelete':_0x9a80('0x112')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xd9fb=['../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/integration/integration.model','Network','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserMailQueue','SmsQueues','OpenchannelQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','SpiedAgents','Applications','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','CmHopperBlack','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','MailServerOut','hasOne','Imap','Dispositions','MailAccountId','Answers','Interactions','MailApplication','List','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Account','CmContact','Contact','ContactId','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','restrict','TagId','MailQueueReport','ListId','Dashboard','DashboardItem','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','Pause','SmsInteractionId','sms_interaction_has_tags','Tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','Members','chat_group_has_users','CmCompany','HopperHistories','JscriptySessions','Company','CompanyId','cm_contact_has_tags','CampaignId','All','OneAll','Any','OneAny','AutomationId','Extensions','ChatApplications','SmsApplications','Schedule','DefaultReportId','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','AnalyticFieldReport','Fields','CustomReportId','MetricId','SalesforceAccount','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Variable','Field','VariableId','DeskConfiguration','DescriptionId','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','VtigerAccount','int_vtiger_configuration_has_tags','Dynamics365Field','FromId','ToId','SessionId','ProjectId','team_has_chat_queues','ChatQueues','FaxQueues','team_has_openchannel_queues','HopperFinals','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','determine','motion2','xC@LL1234','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','xcall','127.0.0.1','name','password','username','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xd9fb,0x189));var _0xbd9f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd9fb[_0x502c7d];return _0x30b7ed;};'use strict';var path=require(_0xbd9f('0x0'));var config=require(_0xbd9f('0x1'));var Sequelize=require(_0xbd9f('0x2'));var _=require(_0xbd9f('0x3'));var jstz=require(_0xbd9f('0x4'));var timezone=jstz[_0xbd9f('0x5')]();config[_0xbd9f('0x2')]=_['defaultsDeep'](config[_0xbd9f('0x2')],{'database':_0xbd9f('0x6'),'username':'xcall','password':_0xbd9f('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xbd9f('0x8'),'dialectOptions':{'charset':_0xbd9f('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xbd9f('0xa'),'collate':_0xbd9f('0xb')}}});config[_0xbd9f('0xc')]=_[_0xbd9f('0xd')](config['sequelizeHistory'],{'database':_0xbd9f('0x6'),'username':_0xbd9f('0xe'),'password':_0xbd9f('0x7'),'options':{'host':_0xbd9f('0xf'),'port':0xcea,'dialect':_0xbd9f('0x8'),'dialectOptions':{'charset':_0xbd9f('0x9')},'logging':![],'timezone':timezone[_0xbd9f('0x10')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0xbd9f('0x2')]['username'],config[_0xbd9f('0x2')][_0xbd9f('0x11')],config[_0xbd9f('0x2')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbd9f('0xc')]['database'],config[_0xbd9f('0xc')][_0xbd9f('0x12')],config[_0xbd9f('0xc')][_0xbd9f('0x11')],config['sequelizeHistory'][_0xbd9f('0x13')])};db[_0xbd9f('0x14')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x16'));db[_0xbd9f('0x17')]=db[_0xbd9f('0x2')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0xbd9f('0x18')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x19'));db[_0xbd9f('0x1a')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x1b'));db[_0xbd9f('0x1c')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x1d'));db[_0xbd9f('0x1e')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x1f'));db[_0xbd9f('0x20')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x21'));db[_0xbd9f('0x22')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x23'));db[_0xbd9f('0x24')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/voiceMail/voiceMail.model');db[_0xbd9f('0x25')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x26'));db[_0xbd9f('0x27')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/voiceCallReport/voiceCallReport.model');db[_0xbd9f('0x28')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x29'));db[_0xbd9f('0x2a')]=db['sequelize']['import'](_0xbd9f('0x2b'));db[_0xbd9f('0x2c')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x2d'));db[_0xbd9f('0x2e')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x2f'));db[_0xbd9f('0x30')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x31'));db[_0xbd9f('0x32')]=db[_0xbd9f('0x2')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xbd9f('0x33')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x34'));db[_0xbd9f('0x35')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x36'));db[_0xbd9f('0x37')]=db['sequelize']['import'](_0xbd9f('0x38'));db['UserMailQueue']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x39'));db[_0xbd9f('0x3a')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x3b'));db[_0xbd9f('0x3c')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x3d'));db[_0xbd9f('0x3e')]=db[_0xbd9f('0x2')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xbd9f('0x3f')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x40'));db['MailServerOut']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x41'));db[_0xbd9f('0x42')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x43'));db[_0xbd9f('0x44')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x45'));db[_0xbd9f('0x46')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x47'));db[_0xbd9f('0x48')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xbd9f('0x49')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x4a'));db['MailApplication']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x4b'));db['MailQueueReport']=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x4c'));db['Dashboard']=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x4d'));db['FaxAccount']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x4e'));db[_0xbd9f('0x4f')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x50'));db[_0xbd9f('0x51')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x52'));db['FaxMessage']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x53'));db[_0xbd9f('0x54')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x55'));db[_0xbd9f('0x56')]=db['sequelize']['import'](_0xbd9f('0x57'));db[_0xbd9f('0x58')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/smsAccount/smsAccount.model');db[_0xbd9f('0x59')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x5a'));db['SmsInteraction']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x5b'));db[_0xbd9f('0x5c')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x5d'));db[_0xbd9f('0x5e')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x5f'));db[_0xbd9f('0x60')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x61'));db[_0xbd9f('0x62')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x63'));db[_0xbd9f('0x64')]=db['sequelize'][_0xbd9f('0x15')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xbd9f('0x65')]=db[_0xbd9f('0x2')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xbd9f('0x66')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x67'));db[_0xbd9f('0x68')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x69'));db[_0xbd9f('0x6a')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x6b'));db['ChatApplication']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x6c'));db[_0xbd9f('0x6d')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x6e'));db[_0xbd9f('0x6f')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x70'));db[_0xbd9f('0x71')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x72'));db[_0xbd9f('0x73')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x74'));db[_0xbd9f('0x75')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x76'));db[_0xbd9f('0x77')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x78'));db['CmContact']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x79'));db[_0xbd9f('0x7a')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x7b'));db['CmHopperBlack']=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x7c'));db[_0xbd9f('0x7d')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x7e'));db[_0xbd9f('0x7f')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x80'));db[_0xbd9f('0x81')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x82'));db[_0xbd9f('0x83')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x84'));db[_0xbd9f('0x85')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x86'));db[_0xbd9f('0x87')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x88'));db[_0xbd9f('0x89')]=db['sequelize']['import'](_0xbd9f('0x8a'));db[_0xbd9f('0x8b')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x8c'));db[_0xbd9f('0x8d')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x8e'));db['Pause']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x8f'));db[_0xbd9f('0x90')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x91'));db[_0xbd9f('0x92')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x93'));db['Schedule']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x94'));db[_0xbd9f('0x95')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x96'));db[_0xbd9f('0x97')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x98'));db[_0xbd9f('0x99')]=db['sequelize'][_0xbd9f('0x15')]('../api/template/template.model');db[_0xbd9f('0x9a')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0x9b'));db['Variable']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0x9c'));db[_0xbd9f('0x9d')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/integration/integration.model');db[_0xbd9f('0x9e')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0x9f'));db[_0xbd9f('0xa0')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xbd9f('0xa1')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xa2'));db['AnalyticExtractedReport']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xa3'));db[_0xbd9f('0xa4')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xa5'));db['AnalyticFieldReport']=db[_0xbd9f('0x2')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xa6'));db['SalesforceAccount']=db[_0xbd9f('0x2')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xa7'));db[_0xbd9f('0xa8')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xa9'));db[_0xbd9f('0xaa')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xab'));db[_0xbd9f('0xac')]=db['sequelize'][_0xbd9f('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xbd9f('0xad')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xae'));db['DeskAccount']=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xaf'));db[_0xbd9f('0xb0')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xb1'));db[_0xbd9f('0xb2')]=db['sequelize'][_0xbd9f('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0xbd9f('0xb3')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xb4'));db['ZendeskAccount']=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xb5'));db[_0xbd9f('0xb6')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xbd9f('0xb7')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xb8'));db[_0xbd9f('0xb9')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xba'));db['FreshdeskConfiguration']=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xbd9f('0xbb')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xbc'));db['VtigerAccount']=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xbd9f('0xbd')]=db['sequelize'][_0xbd9f('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xbd9f('0xbe')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xbd9f('0xbf')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xc0'));db[_0xbd9f('0xc1')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xc2'));db[_0xbd9f('0xc3')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xc4'));db[_0xbd9f('0xc5')]=db[_0xbd9f('0x2')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xbd9f('0xc6')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xc7'));db['Dynamics365Field']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xc8'));db[_0xbd9f('0x9d')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xc9'));db[_0xbd9f('0xca')]=db[_0xbd9f('0x2')]['import']('../api/network/network.model');db[_0xbd9f('0xcb')]=db[_0xbd9f('0x2')]['import']('../api/chatQueueReport/chatQueueReport.model');db[_0xbd9f('0xcc')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xcd'));db[_0xbd9f('0xce')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xbd9f('0xcf')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xd0'));db[_0xbd9f('0xd1')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xd2'));db[_0xbd9f('0xd3')]=db['sequelize']['import'](_0xbd9f('0xd4'));db[_0xbd9f('0xd5')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xd6'));db['SquareDetailsReport']=db['sequelize']['import'](_0xbd9f('0xd7'));db[_0xbd9f('0xd8')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xd9'));db[_0xbd9f('0xda')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xdb'));db[_0xbd9f('0xdc')]=db[_0xbd9f('0x2')]['import'](_0xbd9f('0xdd'));db[_0xbd9f('0xde')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xdf'));db[_0xbd9f('0xe0')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xe1'));db[_0xbd9f('0xe2')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xe3'));db[_0xbd9f('0xe4')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xe5'));db[_0xbd9f('0xe6')]=db['sequelize'][_0xbd9f('0x15')]('../api/migration/migration.model');db[_0xbd9f('0xe7')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xe8'));db[_0xbd9f('0xe9')]=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xea'));db[_0xbd9f('0xeb')]=db[_0xbd9f('0x2')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xbd9f('0x2')][_0xbd9f('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xbd9f('0xec')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xed'));db['OpenchannelTransferReport']=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xee'));db[_0xbd9f('0xef')]=db[_0xbd9f('0x2')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0xbd9f('0xf0')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xf1'));db['VoicePrefix']=db['sequelize'][_0xbd9f('0x15')](_0xbd9f('0xf2'));db[_0xbd9f('0xf3')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xf4'));db[_0xbd9f('0xf5')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xf6'));db[_0xbd9f('0xf7')]=db[_0xbd9f('0x2')][_0xbd9f('0x15')](_0xbd9f('0xf8'));db['User']['hasOne'](db[_0xbd9f('0x24')],{'as':_0xbd9f('0x24'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')]['hasMany'](db[_0xbd9f('0x20')],{'as':_0xbd9f('0xfb'),'foreignKey':'UserId'});db[_0xbd9f('0x14')][_0xbd9f('0xfc')](db['UserVoiceQueueRt'],{'as':_0xbd9f('0xfd'),'foreignKey':_0xbd9f('0xfa')});db['User'][_0xbd9f('0xfc')](db[_0xbd9f('0x1a')],{'as':'Extensions','onDelete':_0xbd9f('0xf9'),'hooks':!![]});db[_0xbd9f('0x14')][_0xbd9f('0xfc')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')][_0xbd9f('0xfc')](db[_0xbd9f('0x7f')],{'as':_0xbd9f('0xfe'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')]['hasMany'](db[_0xbd9f('0x81')],{'as':_0xbd9f('0x81'),'foreignKey':_0xbd9f('0xfa')});db['User'][_0xbd9f('0xfc')](db[_0xbd9f('0x64')],{'as':_0xbd9f('0xff'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')]['hasMany'](db[_0xbd9f('0x6d')],{'as':_0xbd9f('0x100'),'foreignKey':_0xbd9f('0xfa')});db['User'][_0xbd9f('0xfc')](db['SmsInteraction'],{'as':_0xbd9f('0x101'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')]['hasMany'](db[_0xbd9f('0x51')],{'as':_0xbd9f('0x102'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x14')][_0xbd9f('0xfc')](db['MailInteraction'],{'as':_0xbd9f('0x103'),'foreignKey':_0xbd9f('0xfa')});db['User'][_0xbd9f('0x104')](db[_0xbd9f('0xf3')],{'as':_0xbd9f('0xf3'),'foreignKey':_0xbd9f('0x105')});db['User'][_0xbd9f('0x106')](db[_0xbd9f('0x75')],{'as':_0xbd9f('0x107'),'through':'chat_group_has_users'});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db['CmContact'],{'as':_0xbd9f('0x108'),'through':_0xbd9f('0x109')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x10a'),'through':_0xbd9f('0x10b')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0xe0')],{'through':_0xbd9f('0x10c')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x48')],{'as':_0xbd9f('0x103'),'through':_0xbd9f('0x10d')});db[_0xbd9f('0x14')]['belongsToMany'](db['ChatInteraction'],{'as':_0xbd9f('0x100'),'through':_0xbd9f('0x10e')});db[_0xbd9f('0x14')]['belongsToMany'](db[_0xbd9f('0x51')],{'as':_0xbd9f('0x102'),'through':_0xbd9f('0x10f')});db[_0xbd9f('0x14')]['belongsToMany'](db[_0xbd9f('0x110')],{'as':_0xbd9f('0x101'),'through':_0xbd9f('0x111')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x64')],{'as':_0xbd9f('0xff'),'through':_0xbd9f('0x112')});db['User']['belongsToMany'](db[_0xbd9f('0x1e')],{'as':_0xbd9f('0x113'),'through':_0xbd9f('0x35'),'required':![]});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x44')],{'as':_0xbd9f('0x114'),'through':_0xbd9f('0x115'),'required':![]});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x73')],{'as':'ChatQueues','through':_0xbd9f('0x37'),'required':![],'hooks':!![]});db[_0xbd9f('0x14')]['belongsToMany'](db[_0xbd9f('0x54')],{'as':'FaxQueues','through':_0xbd9f('0x3a'),'required':![]});db[_0xbd9f('0x14')]['belongsToMany'](db[_0xbd9f('0x5e')],{'as':_0xbd9f('0x116'),'through':_0xbd9f('0x3c'),'required':![]});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x66')],{'as':_0xbd9f('0x117'),'through':_0xbd9f('0x3e'),'required':![]});db[_0xbd9f('0x14')]['belongsToMany'](db['CmList'],{'through':_0xbd9f('0x10b')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x118')],{'as':_0xbd9f('0x119'),'through':_0xbd9f('0x11a'),'required':![]});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x11b'),'through':_0xbd9f('0x11c')});db[_0xbd9f('0x14')]['belongsToMany'](db[_0xbd9f('0x11d')],{'as':'FaxAccounts','through':_0xbd9f('0x11e')});db['User'][_0xbd9f('0x106')](db['MailAccount'],{'as':'MailAccounts','through':_0xbd9f('0x11f')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x60')],{'as':_0xbd9f('0x120'),'through':_0xbd9f('0x121')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0x58')],{'as':_0xbd9f('0x122'),'through':_0xbd9f('0x123')});db[_0xbd9f('0x14')][_0xbd9f('0x106')](db[_0xbd9f('0xdc')],{'as':_0xbd9f('0x124'),'through':'user_has_square_projects'});db[_0xbd9f('0x17')]['hasMany'](db[_0xbd9f('0x1a')],{'as':_0xbd9f('0x125'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0xbd9f('0xfc')](db['VoiceExtension'],{'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x1a')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a')],{'as':_0xbd9f('0x126'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x1c')][_0xbd9f('0x106')](db[_0xbd9f('0x95')],{'as':_0xbd9f('0x127'),'through':_0xbd9f('0x128')});db[_0xbd9f('0x1e')][_0xbd9f('0xfc')](db[_0xbd9f('0x33')],{'as':'Members','foreignKey':_0xbd9f('0x129')});db[_0xbd9f('0x1e')][_0xbd9f('0xfc')](db[_0xbd9f('0x7a')],{'as':_0xbd9f('0x12a'),'foreignKey':'VoiceQueueId'});db[_0xbd9f('0x1e')][_0xbd9f('0xfc')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xbd9f('0x129')});db[_0xbd9f('0x1e')][_0xbd9f('0xfc')](db[_0xbd9f('0x7f')],{'as':'HopperHistories','foreignKey':_0xbd9f('0x129')});db[_0xbd9f('0x1e')][_0xbd9f('0xfc')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xbd9f('0x129')});db['VoiceQueue'][_0xbd9f('0xfc')](db[_0xbd9f('0x12b')],{'as':_0xbd9f('0x12c'),'foreignKey':_0xbd9f('0x129')});db['VoiceQueue'][_0xbd9f('0xfc')](db[_0xbd9f('0xd1')],{'as':'JscriptySessions','foreignKey':_0xbd9f('0x129')});db[_0xbd9f('0x1e')][_0xbd9f('0x104')](db[_0xbd9f('0x30')],{'as':_0xbd9f('0x30'),'foreignKey':_0xbd9f('0x12d')});db[_0xbd9f('0x1e')]['belongsTo'](db[_0xbd9f('0x30')],{'as':_0xbd9f('0x12e'),'foreignKey':_0xbd9f('0x12f')});db[_0xbd9f('0x1e')]['belongsTo'](db['Interval'],{'as':_0xbd9f('0x8d'),'foreignKey':_0xbd9f('0x130')});db['VoiceQueue'][_0xbd9f('0x104')](db['Pause'],{'as':_0xbd9f('0x131'),'foreignKey':_0xbd9f('0x132')});db[_0xbd9f('0x1e')][_0xbd9f('0x106')](db['CmList'],{'as':_0xbd9f('0x10a'),'through':'voice_queues_has_cm_lists'});db[_0xbd9f('0x1e')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Agents','through':_0xbd9f('0x35')});db[_0xbd9f('0x1e')][_0xbd9f('0x106')](db[_0xbd9f('0xe0')],{'as':_0xbd9f('0x133'),'through':_0xbd9f('0x134')});db[_0xbd9f('0x1e')][_0xbd9f('0x106')](db['CmList'],{'as':_0xbd9f('0x135'),'through':_0xbd9f('0x136')});db['VoiceRecording']['belongsTo'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x14'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x22')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'as':'User','foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x24')][_0xbd9f('0xfc')](db[_0xbd9f('0x25')],{'as':_0xbd9f('0x137'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'mailboxuser','sourceKey':_0xbd9f('0x138')});db[_0xbd9f('0x25')][_0xbd9f('0x104')](db[_0xbd9f('0x24')],{'foreignKey':_0xbd9f('0x139'),'targetKey':'mailbox'});db[_0xbd9f('0x27')]['hasMany'](db['VoiceQueueReport'],{'as':_0xbd9f('0x13a'),'foreignKey':_0xbd9f('0x13b'),'constraints':![]});db[_0xbd9f('0x27')][_0xbd9f('0xfc')](db['VoiceAgentReport'],{'as':_0xbd9f('0x13c'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xbd9f('0x14')],{'as':'User','foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x27')][_0xbd9f('0x104')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xbd9f('0x3f')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xbd9f('0x13d')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'as':_0xbd9f('0x42'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xbd9f('0x13e')](db[_0xbd9f('0x3f')],{'as':_0xbd9f('0x13f'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x42')][_0xbd9f('0x13e')](db[_0xbd9f('0x13d')],{'as':'Smtp','onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x42')][_0xbd9f('0xfc')](db[_0xbd9f('0x89')],{'as':_0xbd9f('0x140'),'foreignKey':_0xbd9f('0x141')});db['MailAccount'][_0xbd9f('0xfc')](db['CannedAnswer'],{'as':_0xbd9f('0x142'),'foreignKey':_0xbd9f('0x141')});db[_0xbd9f('0x42')][_0xbd9f('0xfc')](db['MailMessage'],{'as':_0xbd9f('0x137'),'foreignKey':'MailAccountId'});db[_0xbd9f('0x42')][_0xbd9f('0xfc')](db[_0xbd9f('0x48')],{'as':_0xbd9f('0x143')});db[_0xbd9f('0x42')][_0xbd9f('0xfc')](db[_0xbd9f('0x144')],{'as':'Applications'});db[_0xbd9f('0x42')]['belongsTo'](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':'ListId'});db[_0xbd9f('0x42')][_0xbd9f('0x104')](db[_0xbd9f('0x99')],{'as':_0xbd9f('0x99'),'foreignKey':_0xbd9f('0x146')});db['MailAccount'][_0xbd9f('0x104')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbd9f('0x132')});db['MailAccount']['belongsToMany'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':_0xbd9f('0x11f')});db[_0xbd9f('0x44')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Agents','through':_0xbd9f('0x115')});db['MailQueue'][_0xbd9f('0x106')](db['Team'],{'through':_0xbd9f('0x148'),'as':_0xbd9f('0x133')});db['MailInteraction'][_0xbd9f('0xfc')](db['MailMessage'],{'as':_0xbd9f('0x137'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x149')});db[_0xbd9f('0x48')]['belongsTo'](db[_0xbd9f('0x42')],{'as':_0xbd9f('0x14a'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x48')]['belongsTo'](db[_0xbd9f('0x14')],{'as':'Owner','foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x48')]['belongsToMany'](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x14e'),'as':'Tags'});db[_0xbd9f('0x48')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x14e'),'as':_0xbd9f('0x14f')});db[_0xbd9f('0x48')]['belongsToMany'](db['User'],{'as':_0xbd9f('0x150'),'through':_0xbd9f('0x10d'),'foreignKey':'MailInteractionId'});db[_0xbd9f('0x49')][_0xbd9f('0xfc')](db[_0xbd9f('0xe7')],{'as':_0xbd9f('0x151'),'onDelete':'cascade'});db[_0xbd9f('0x49')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x14')});db[_0xbd9f('0x49')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'onDelete':'cascade','as':_0xbd9f('0x14c')});db[_0xbd9f('0x49')]['belongsTo'](db[_0xbd9f('0x48')],{'as':_0xbd9f('0x152'),'foreignKey':_0xbd9f('0x149')});db[_0xbd9f('0x49')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'as':'Account','foreignKey':'MailAccountId'});db['MailApplication'][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x144')]['belongsTo'](db[_0xbd9f('0x44')],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x144')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'onDelete':'restrict'});db[_0xbd9f('0x144')][_0xbd9f('0x104')](db[_0xbd9f('0x8d')],{'onDelete':_0xbd9f('0x153'),'foreignKey':_0xbd9f('0x130')});db[_0xbd9f('0x144')][_0xbd9f('0x104')](db['Tag'],{'onDelete':_0xbd9f('0x153'),'foreignKey':_0xbd9f('0x154')});db['MailQueueReport'][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{});db[_0xbd9f('0x155')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0x155')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db['MailQueueReport'][_0xbd9f('0x104')](db[_0xbd9f('0x48')],{});db[_0xbd9f('0x155')][_0xbd9f('0x104')](db[_0xbd9f('0x49')],{});db['MailQueueReport'][_0xbd9f('0x104')](db['User'],{});db[_0xbd9f('0x155')][_0xbd9f('0x104')](db[_0xbd9f('0x44')],{});db[_0xbd9f('0x157')][_0xbd9f('0xfc')](db[_0xbd9f('0x158')],{'as':_0xbd9f('0x159'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x11d')][_0xbd9f('0xfc')](db[_0xbd9f('0x89')],{'as':'Dispositions','foreignKey':_0xbd9f('0x15a')});db[_0xbd9f('0x11d')][_0xbd9f('0xfc')](db[_0xbd9f('0x87')],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount'][_0xbd9f('0xfc')](db[_0xbd9f('0x51')],{'as':_0xbd9f('0x143')});db[_0xbd9f('0x11d')]['hasMany'](db[_0xbd9f('0x4f')],{'as':_0xbd9f('0x126')});db[_0xbd9f('0x11d')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a')],{'as':_0xbd9f('0x15b'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x11d')][_0xbd9f('0xfc')](db[_0xbd9f('0x15c')],{'as':'Messages'});db[_0xbd9f('0x11d')]['belongsTo'](db[_0xbd9f('0x30')],{'as':_0xbd9f('0x30')});db[_0xbd9f('0x11d')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0x11d')][_0xbd9f('0x104')](db['Pause'],{'as':_0xbd9f('0x131'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbd9f('0x11d')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':_0xbd9f('0x11e')});db[_0xbd9f('0x4f')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x4f')]['belongsTo'](db[_0xbd9f('0x54')],{'onDelete':_0xbd9f('0x153')});db['FaxApplication'][_0xbd9f('0x104')](db[_0xbd9f('0x11d')],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x4f')][_0xbd9f('0x104')](db[_0xbd9f('0x97')],{'onDelete':_0xbd9f('0x153'),'foreignKey':'TagId'});db[_0xbd9f('0x51')][_0xbd9f('0xfc')](db[_0xbd9f('0x15c')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xbd9f('0x15d')});db[_0xbd9f('0x51')][_0xbd9f('0x104')](db[_0xbd9f('0x11d')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction'][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db['FaxInteraction'][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x15e'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x51')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x15f'),'as':'Tags'});db[_0xbd9f('0x51')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x15f'),'as':_0xbd9f('0x14f')});db[_0xbd9f('0x51')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x150'),'through':_0xbd9f('0x10f'),'foreignKey':_0xbd9f('0x15d')});db[_0xbd9f('0x15c')]['belongsTo'](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0xf9'),'as':'User'});db[_0xbd9f('0x15c')][_0xbd9f('0x104')](db[_0xbd9f('0x51')],{'as':_0xbd9f('0x152'),'foreignKey':_0xbd9f('0x15d')});db[_0xbd9f('0x15c')][_0xbd9f('0x104')](db['CmContact'],{'onDelete':'cascade','as':_0xbd9f('0x14c')});db['FaxMessage'][_0xbd9f('0x104')](db[_0xbd9f('0xe7')],{'as':_0xbd9f('0xe7'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0xbd9f('0x11d')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x15a')});db[_0xbd9f('0x54')]['belongsToMany'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':_0xbd9f('0x3a')});db[_0xbd9f('0x54')][_0xbd9f('0x106')](db[_0xbd9f('0xe0')],{'through':_0xbd9f('0x160'),'as':_0xbd9f('0x133')});db[_0xbd9f('0x56')][_0xbd9f('0x104')](db['FaxAccount'],{});db[_0xbd9f('0x56')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':'ListId'});db[_0xbd9f('0x56')]['belongsTo'](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db['FaxQueueReport']['belongsTo'](db[_0xbd9f('0x51')],{});db['FaxQueueReport']['belongsTo'](db[_0xbd9f('0x15c')],{});db[_0xbd9f('0x56')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{});db['FaxQueueReport'][_0xbd9f('0x104')](db['FaxQueue'],{});db['SmsAccount'][_0xbd9f('0xfc')](db['Disposition'],{'as':_0xbd9f('0x140'),'foreignKey':_0xbd9f('0x161')});db[_0xbd9f('0x58')][_0xbd9f('0xfc')](db[_0xbd9f('0x87')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xbd9f('0x58')][_0xbd9f('0xfc')](db[_0xbd9f('0x5c')],{'as':_0xbd9f('0x137'),'foreignKey':_0xbd9f('0x161')});db[_0xbd9f('0x58')][_0xbd9f('0xfc')](db['SmsInteraction'],{'as':_0xbd9f('0x143')});db[_0xbd9f('0x58')]['hasMany'](db[_0xbd9f('0x59')],{'as':_0xbd9f('0x126')});db[_0xbd9f('0x58')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db[_0xbd9f('0x162')],{'as':_0xbd9f('0x131'),'foreignKey':_0xbd9f('0x132')});db[_0xbd9f('0x58')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':_0xbd9f('0x123')});db['SmsApplication'][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x59')][_0xbd9f('0x104')](db['SmsQueue'],{'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x59')][_0xbd9f('0x104')](db[_0xbd9f('0x58')],{'onDelete':'restrict'});db[_0xbd9f('0x59')][_0xbd9f('0x104')](db['Interval'],{'onDelete':_0xbd9f('0x153'),'foreignKey':_0xbd9f('0x130')});db[_0xbd9f('0x59')][_0xbd9f('0x104')](db['Tag'],{'onDelete':_0xbd9f('0x153'),'foreignKey':'TagId'});db[_0xbd9f('0x110')][_0xbd9f('0xfc')](db['SmsMessage'],{'as':'Messages','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x163')});db[_0xbd9f('0x110')][_0xbd9f('0x104')](db['SmsAccount'],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x161')});db[_0xbd9f('0x110')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x110')]['belongsTo'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x15e'),'foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x110')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x164'),'as':_0xbd9f('0x165')});db[_0xbd9f('0x110')][_0xbd9f('0x106')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction'][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Users','through':_0xbd9f('0x111'),'foreignKey':'SmsInteractionId'});db[_0xbd9f('0x5c')]['belongsTo'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x14')});db[_0xbd9f('0x5c')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14c')});db[_0xbd9f('0x5c')][_0xbd9f('0x104')](db[_0xbd9f('0x110')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x152'),'foreignKey':_0xbd9f('0x163')});db[_0xbd9f('0x5c')]['belongsTo'](db[_0xbd9f('0x58')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x161')});db[_0xbd9f('0x5e')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Agents','through':_0xbd9f('0x3c'),'foreignKey':'SmsQueueId'});db[_0xbd9f('0x5e')][_0xbd9f('0x106')](db[_0xbd9f('0xe0')],{'through':_0xbd9f('0x166'),'as':'Teams'});db[_0xbd9f('0x60')][_0xbd9f('0xfc')](db['Disposition'],{'as':_0xbd9f('0x140'),'foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x60')][_0xbd9f('0xfc')](db[_0xbd9f('0x87')],{'as':_0xbd9f('0x142'),'foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x60')]['hasMany'](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x60')][_0xbd9f('0xfc')](db[_0xbd9f('0x65')],{'as':_0xbd9f('0x137'),'foreignKey':'OpenchannelAccountId'});db[_0xbd9f('0x60')]['hasMany'](db[_0xbd9f('0x62')],{'as':'Applications','foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x60')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db['OpenchannelAccount']['belongsTo'](db[_0xbd9f('0x162')],{'as':'mandatoryDispositionPause','foreignKey':_0xbd9f('0x132')});db[_0xbd9f('0x60')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0xbd9f('0x62')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0x153')});db['OpenchannelApplication'][_0xbd9f('0x104')](db['OpenchannelQueue'],{'onDelete':_0xbd9f('0x153'),'foreignKey':_0xbd9f('0x168')});db['OpenchannelApplication'][_0xbd9f('0x104')](db['OpenchannelAccount'],{'onDelete':_0xbd9f('0x153'),'foreignKey':'OpenchannelAccountId'});db[_0xbd9f('0x62')]['belongsTo'](db[_0xbd9f('0x8d')],{'onDelete':_0xbd9f('0x153'),'foreignKey':'IntervalId'});db[_0xbd9f('0x62')][_0xbd9f('0x104')](db[_0xbd9f('0x97')],{'onDelete':'restrict','foreignKey':_0xbd9f('0x154')});db[_0xbd9f('0x64')][_0xbd9f('0xfc')](db[_0xbd9f('0x65')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xbd9f('0x64')]['belongsTo'](db[_0xbd9f('0x60')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x64')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x64')][_0xbd9f('0x104')](db['User'],{'as':_0xbd9f('0x15e'),'foreignKey':'UserId'});db[_0xbd9f('0x64')]['belongsToMany'](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x169'),'as':_0xbd9f('0x165')});db[_0xbd9f('0x64')][_0xbd9f('0x106')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xbd9f('0x14f')});db[_0xbd9f('0x64')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x150'),'through':_0xbd9f('0x112'),'foreignKey':_0xbd9f('0x16a')});db[_0xbd9f('0x65')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14')});db['OpenchannelMessage']['belongsTo'](db[_0xbd9f('0x14b')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14c')});db[_0xbd9f('0x65')][_0xbd9f('0x104')](db[_0xbd9f('0x64')],{'onDelete':_0xbd9f('0xf9'),'as':'Interaction','foreignKey':_0xbd9f('0x16a')});db[_0xbd9f('0x65')][_0xbd9f('0x104')](db[_0xbd9f('0xe7')],{'as':_0xbd9f('0xe7'),'foreignKey':_0xbd9f('0x16b')});db[_0xbd9f('0x65')][_0xbd9f('0x104')](db[_0xbd9f('0x60')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x167')});db[_0xbd9f('0x66')]['belongsToMany'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':_0xbd9f('0x3e'),'foreignKey':_0xbd9f('0x168')});db[_0xbd9f('0x66')]['belongsToMany'](db[_0xbd9f('0xe0')],{'through':'team_has_openchannel_queues','as':_0xbd9f('0x133')});db[_0xbd9f('0x68')][_0xbd9f('0xfc')](db[_0xbd9f('0x89')],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db[_0xbd9f('0x68')][_0xbd9f('0xfc')](db['CannedAnswer'],{'as':_0xbd9f('0x142'),'foreignKey':_0xbd9f('0x16c')});db[_0xbd9f('0x68')][_0xbd9f('0xfc')](db[_0xbd9f('0x77')],{'as':_0xbd9f('0x16d')});db[_0xbd9f('0x68')][_0xbd9f('0xfc')](db[_0xbd9f('0x6d')],{'as':'Interactions'});db[_0xbd9f('0x68')]['hasMany'](db[_0xbd9f('0x16e')],{'as':_0xbd9f('0x126')});db['ChatWebsite'][_0xbd9f('0xfc')](db['ChatMessage'],{'as':_0xbd9f('0x137')});db[_0xbd9f('0x68')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':'List','foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0x68')][_0xbd9f('0x104')](db['Interval'],{'as':_0xbd9f('0x8d'),'foreignKey':_0xbd9f('0x130')});db[_0xbd9f('0x68')][_0xbd9f('0x104')](db[_0xbd9f('0x162')],{'as':_0xbd9f('0x131'),'foreignKey':_0xbd9f('0x132')});db[_0xbd9f('0x68')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':'user_has_chat_websites'});db[_0xbd9f('0x6a')]['belongsTo'](db['OpenchannelAccount'],{});db[_0xbd9f('0x6a')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db['OpenchannelQueueReport'][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':'Contact','foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x6a')][_0xbd9f('0x104')](db[_0xbd9f('0x64')],{});db[_0xbd9f('0x6a')][_0xbd9f('0x104')](db[_0xbd9f('0x65')],{});db[_0xbd9f('0x6a')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{});db[_0xbd9f('0x6a')][_0xbd9f('0x104')](db[_0xbd9f('0x66')],{});db['ChatApplication'][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x16f'),'foreignKey':_0xbd9f('0xfa'),'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x16e')][_0xbd9f('0x104')](db[_0xbd9f('0x73')],{'as':_0xbd9f('0x170'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xbd9f('0x16e')]['belongsTo'](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x171'),'foreignKey':_0xbd9f('0x16c'),'onDelete':_0xbd9f('0x153')});db['ChatApplication'][_0xbd9f('0x104')](db[_0xbd9f('0x97')],{'onDelete':_0xbd9f('0x153'),'foreignKey':_0xbd9f('0x154')});db[_0xbd9f('0x6d')][_0xbd9f('0xfc')](db[_0xbd9f('0x6f')],{'as':_0xbd9f('0x137'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x172')});db[_0xbd9f('0x6d')][_0xbd9f('0x104')](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x16c')});db[_0xbd9f('0x6d')]['belongsTo'](db[_0xbd9f('0x14b')],{'as':'Contact','foreignKey':_0xbd9f('0x14d')});db['ChatInteraction'][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x15e'),'foreignKey':'UserId'});db['ChatInteraction'][_0xbd9f('0x106')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xbd9f('0x165')});db[_0xbd9f('0x6d')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x173'),'as':'ThroughTags'});db[_0xbd9f('0x6d')][_0xbd9f('0x106')](db['User'],{'as':_0xbd9f('0x150'),'through':_0xbd9f('0x10e'),'foreignKey':_0xbd9f('0x172')});db[_0xbd9f('0x6f')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14')});db[_0xbd9f('0x6f')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db['ChatMessage']['belongsTo'](db[_0xbd9f('0x6d')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x152'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xbd9f('0x104')](db[_0xbd9f('0xe7')],{'as':_0xbd9f('0xe7'),'foreignKey':_0xbd9f('0x16b')});db[_0xbd9f('0x6f')][_0xbd9f('0x104')](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x16c')});db[_0xbd9f('0x71')]['belongsTo'](db[_0xbd9f('0x14b')],{'onDelete':_0xbd9f('0xf9'),'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x71')][_0xbd9f('0x104')](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x14a'),'foreignKey':'ChatWebsiteId'});db[_0xbd9f('0x73')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xbd9f('0x106')](db[_0xbd9f('0xe0')],{'through':'team_has_chat_queues','as':_0xbd9f('0x133')});db[_0xbd9f('0x75')]['hasMany'](db[_0xbd9f('0xcc')],{'as':_0xbd9f('0x137'),'foreignKey':_0xbd9f('0x174'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x75')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x175'),'through':_0xbd9f('0x176')});db[_0xbd9f('0x77')][_0xbd9f('0x104')](db[_0xbd9f('0x68')],{'as':_0xbd9f('0x171'),'foreignKey':_0xbd9f('0x16c')});db[_0xbd9f('0x177')][_0xbd9f('0xfc')](db[_0xbd9f('0x14b')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db[_0xbd9f('0x7a')],{'as':_0xbd9f('0x12a'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db[_0xbd9f('0x7d')],{'as':'HopperFinals','foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db['CmHopperHistory'],{'as':_0xbd9f('0x178'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x14b')]['hasMany'](db['ReportAgentPreview'],{'as':_0xbd9f('0x81'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db[_0xbd9f('0xd1')],{'as':_0xbd9f('0x179'),'foreignKey':'ContactId'});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xbd9f('0x14d'),'onDelete':'restrict'});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db[_0xbd9f('0x6d')],{'as':_0xbd9f('0x100'),'foreignKey':_0xbd9f('0x14d'),'onDelete':_0xbd9f('0x153')});db['CmContact'][_0xbd9f('0xfc')](db[_0xbd9f('0x110')],{'as':'SmsInteractions','foreignKey':_0xbd9f('0x14d'),'onDelete':'restrict'});db[_0xbd9f('0x14b')][_0xbd9f('0xfc')](db[_0xbd9f('0x51')],{'as':_0xbd9f('0x102'),'foreignKey':_0xbd9f('0x14d'),'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x14b')]['hasMany'](db[_0xbd9f('0x48')],{'as':'MailInteractions','foreignKey':_0xbd9f('0x14d'),'onDelete':_0xbd9f('0x153')});db['CmContact']['belongsTo'](db[_0xbd9f('0x177')],{'as':_0xbd9f('0x17a'),'foreignKey':_0xbd9f('0x17b')});db[_0xbd9f('0x14b')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156'),'onDelete':_0xbd9f('0xf9')});db['CmContact'][_0xbd9f('0x106')](db['User'],{'as':'Users','through':_0xbd9f('0x109')});db[_0xbd9f('0x14b')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'as':_0xbd9f('0x165'),'through':'cm_contact_has_tags'});db['CmContact'][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x17c'),'as':_0xbd9f('0x14f')});db[_0xbd9f('0x7a')][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x7a')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':'List','foreignKey':_0xbd9f('0x156'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x7a')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xbd9f('0xfa')});db[_0xbd9f('0x7a')][_0xbd9f('0x104')](db['VoiceQueue'],{'as':_0xbd9f('0x170'),'foreignKey':_0xbd9f('0x129'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x7a')][_0xbd9f('0x104')](db[_0xbd9f('0xe4')],{'as':_0xbd9f('0xe4'),'foreignKey':_0xbd9f('0x17d'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x7a')][_0xbd9f('0x104')](db['User'],{'as':_0xbd9f('0x15e'),'foreignKey':'OwnerId'});db['CmHopperBlack']['belongsTo'](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x12b')][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0xbd9f('0x1e')],{'as':_0xbd9f('0x170'),'foreignKey':'VoiceQueueId','onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x12b')]['belongsTo'](db[_0xbd9f('0xe4')],{'as':_0xbd9f('0xe4'),'foreignKey':_0xbd9f('0x17d'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0x85')]['hasMany'](db[_0xbd9f('0x8b')],{'as':{'plural':_0xbd9f('0x17e'),'singular':_0xbd9f('0x17f')},'foreignKey':'AutomationAllId','onDelete':_0xbd9f('0xf9'),'hooks':!![]});db[_0xbd9f('0x85')][_0xbd9f('0xfc')](db[_0xbd9f('0x8b')],{'as':{'plural':_0xbd9f('0x180'),'singular':_0xbd9f('0x181')},'foreignKey':'AutomationAnyId','onDelete':_0xbd9f('0xf9'),'hooks':!![]});db[_0xbd9f('0x85')]['hasMany'](db[_0xbd9f('0x83')],{'as':'Actions','foreignKey':_0xbd9f('0x182'),'onDelete':_0xbd9f('0xf9'),'hooks':!![]});db[_0xbd9f('0x8d')]['hasMany'](db[_0xbd9f('0x8d')],{'as':'Intervals','foreignKey':_0xbd9f('0x130'),'onDelete':_0xbd9f('0xf9'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xbd9f('0x1a')],{'as':_0xbd9f('0x183'),'foreignKey':_0xbd9f('0x130'),'onDelete':'restrict'});db[_0xbd9f('0x8d')]['hasMany'](db[_0xbd9f('0x144')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xbd9f('0x8d')]['hasMany'](db['ChatApplication'],{'as':_0xbd9f('0x184'),'foreignKey':_0xbd9f('0x130')});db[_0xbd9f('0x8d')]['hasMany'](db[_0xbd9f('0x4f')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0xbd9f('0x8d')]['hasMany'](db[_0xbd9f('0x59')],{'as':_0xbd9f('0x185'),'foreignKey':'IntervalId'});db[_0xbd9f('0x186')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{});db[_0xbd9f('0x186')][_0xbd9f('0x104')](db[_0xbd9f('0xa1')],{'foreignKey':_0xbd9f('0x187')});db[_0xbd9f('0x186')]['belongsTo'](db[_0xbd9f('0xa0')],{'foreignKey':'CustomReportId'});db[_0xbd9f('0x95')][_0xbd9f('0x106')](db[_0xbd9f('0x1c')],{'as':'Mohs','through':_0xbd9f('0x128'),'onDelete':_0xbd9f('0x153')});db['Tag'][_0xbd9f('0x106')](db[_0xbd9f('0x14b')],{'through':_0xbd9f('0x17c')});db[_0xbd9f('0x97')]['belongsToMany'](db[_0xbd9f('0x6d')],{'through':_0xbd9f('0x173')});db[_0xbd9f('0x97')][_0xbd9f('0x106')](db[_0xbd9f('0x48')],{'through':_0xbd9f('0x14e')});db[_0xbd9f('0x97')][_0xbd9f('0x106')](db['SmsInteraction'],{'through':_0xbd9f('0x164')});db[_0xbd9f('0x97')][_0xbd9f('0x106')](db[_0xbd9f('0x51')],{'through':_0xbd9f('0x15f')});db['Tag'][_0xbd9f('0x106')](db[_0xbd9f('0x64')],{'through':_0xbd9f('0x169')});db[_0xbd9f('0x9a')][_0xbd9f('0xfc')](db[_0xbd9f('0x8b')],{'as':{'plural':'AllConditions','singular':_0xbd9f('0x188')},'foreignKey':_0xbd9f('0x189'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xbd9f('0xfc')](db[_0xbd9f('0x8b')],{'as':{'plural':_0xbd9f('0x18a'),'singular':_0xbd9f('0x18b')},'foreignKey':_0xbd9f('0x18c'),'onDelete':_0xbd9f('0xf9'),'hooks':!![]});db['Trigger'][_0xbd9f('0xfc')](db[_0xbd9f('0x83')],{'as':_0xbd9f('0x18d'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0xbd9f('0xfc')](db[_0xbd9f('0x18e')],{'as':_0xbd9f('0x18f'),'onDelete':'cascade','foreignKey':_0xbd9f('0x190'),'hooks':!![]});db[_0xbd9f('0xa1')]['hasMany'](db[_0xbd9f('0x18e')],{'as':_0xbd9f('0x18f'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xbd9f('0xa4')]['hasMany'](db[_0xbd9f('0x18e')],{'as':_0xbd9f('0x18f'),'onDelete':'cascade','foreignKey':'MetricId'});db['AnalyticFieldReport'][_0xbd9f('0x104')](db[_0xbd9f('0xa4')],{'foreignKey':_0xbd9f('0x191')});db[_0xbd9f('0x192')][_0xbd9f('0xfc')](db[_0xbd9f('0x193')],{'as':_0xbd9f('0x194'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db['SalesforceConfiguration'][_0xbd9f('0xfc')](db[_0xbd9f('0xa8')],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x197')});db['SalesforceConfiguration'][_0xbd9f('0xfc')](db[_0xbd9f('0xa8')],{'as':_0xbd9f('0x198'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration']['hasMany'](db[_0xbd9f('0xa8')],{'as':_0xbd9f('0x18f'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0x193')][_0xbd9f('0x104')](db[_0xbd9f('0x192')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xa8')]['hasMany'](db['SalesforceField'],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xa8')][_0xbd9f('0xfc')](db[_0xbd9f('0xa8')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db[_0xbd9f('0xa8')]['hasMany'](db[_0xbd9f('0xa8')],{'as':'Field','foreignKey':_0xbd9f('0x199')});db['SalesforceField'][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':'VariableId'});db[_0xbd9f('0xaa')][_0xbd9f('0xfc')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x197')});db['SugarcrmConfiguration']['hasMany'](db[_0xbd9f('0xad')],{'as':_0xbd9f('0x198'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xbd9f('0xac')][_0xbd9f('0xfc')](db[_0xbd9f('0xad')],{'as':_0xbd9f('0x18f'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'FieldId'});db[_0xbd9f('0xac')][_0xbd9f('0x104')](db['SugarcrmAccount'],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xad')][_0xbd9f('0xfc')](db[_0xbd9f('0xad')],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db['SugarcrmField'][_0xbd9f('0xfc')](db[_0xbd9f('0xad')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0xbd9f('0xfc')](db[_0xbd9f('0xad')],{'as':_0xbd9f('0x19d'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xbd9f('0x104')](db['Variable'],{'as':'Variable','foreignKey':_0xbd9f('0x19e')});db['DeskAccount'][_0xbd9f('0xfc')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0x19f')][_0xbd9f('0xfc')](db[_0xbd9f('0xb0')],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'SubjectId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0xbd9f('0x198'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1a0')});db['DeskConfiguration'][_0xbd9f('0xfc')](db[_0xbd9f('0xb0')],{'as':_0xbd9f('0x18f'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xbd9f('0x19f')]['belongsTo'](db['DeskAccount'],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0x19f')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x1a1')});db[_0xbd9f('0xb0')][_0xbd9f('0xfc')](db[_0xbd9f('0xb0')],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xb0')][_0xbd9f('0xfc')](db[_0xbd9f('0xb0')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db[_0xbd9f('0xb0')]['hasMany'](db['DeskField'],{'as':_0xbd9f('0x19d'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0xb0')]['belongsTo'](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':_0xbd9f('0x19e')});db[_0xbd9f('0xb2')][_0xbd9f('0xfc')](db['ZohoConfiguration'],{'as':_0xbd9f('0x194'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xb3')][_0xbd9f('0xfc')](db['ZohoField'],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x197')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xbd9f('0x198'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0xb3')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a2')],{'as':_0xbd9f('0x18f'),'onDelete':'cascade','foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0xb3')][_0xbd9f('0x104')](db[_0xbd9f('0xb2')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x195')});db['ZohoField'][_0xbd9f('0xfc')](db[_0xbd9f('0x1a2')],{'as':_0xbd9f('0x19a'),'foreignKey':'SubjectId'});db[_0xbd9f('0x1a2')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a2')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db[_0xbd9f('0x1a2')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a2')],{'as':'Field','foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0x1a2')][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':'VariableId'});db[_0xbd9f('0x1a3')][_0xbd9f('0xfc')](db['ZendeskConfiguration'],{'as':_0xbd9f('0x194'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xb6')][_0xbd9f('0xfc')](db[_0xbd9f('0xb7')],{'as':_0xbd9f('0x196'),'foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xb6')][_0xbd9f('0xfc')](db[_0xbd9f('0xb7')],{'as':'Descriptions','foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0xb6')][_0xbd9f('0xfc')](db[_0xbd9f('0xb7')],{'as':_0xbd9f('0x18f'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0xb6')]['belongsTo'](db[_0xbd9f('0x1a3')],{'as':'Account','foreignKey':_0xbd9f('0x195')});db['ZendeskConfiguration']['belongsToMany'](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x1a4')});db['ZendeskField'][_0xbd9f('0xfc')](db[_0xbd9f('0xb7')],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xb7')]['hasMany'](db[_0xbd9f('0xb7')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0xbd9f('0xb7')],{'as':'Field','foreignKey':_0xbd9f('0x199')});db['ZendeskField'][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':'Variable','foreignKey':_0xbd9f('0x19e')});db['FreshdeskAccount'][_0xbd9f('0xfc')](db[_0xbd9f('0x1a5')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xbd9f('0xfc')](db['FreshdeskField'],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x197')});db['FreshdeskConfiguration'][_0xbd9f('0xfc')](db['FreshdeskField'],{'as':_0xbd9f('0x198'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0x1a5')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0x1a5')]['belongsTo'](db[_0xbd9f('0xb9')],{'as':'Account','foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0x1a5')][_0xbd9f('0x106')](db[_0xbd9f('0x97')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xbd9f('0xbb')][_0xbd9f('0xfc')](db[_0xbd9f('0xbb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xbd9f('0xbb')][_0xbd9f('0xfc')](db[_0xbd9f('0xbb')],{'as':'Description','foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0xbb')][_0xbd9f('0xfc')](db[_0xbd9f('0xbb')],{'as':_0xbd9f('0x19d'),'foreignKey':'FieldId'});db['FreshdeskField'][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':_0xbd9f('0x19e')});db[_0xbd9f('0x1a6')]['hasMany'](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db['VtigerConfiguration']['hasMany'](db[_0xbd9f('0xbe')],{'as':_0xbd9f('0x196'),'foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xbd')][_0xbd9f('0xfc')](db[_0xbd9f('0xbe')],{'as':'Descriptions','foreignKey':_0xbd9f('0x1a0')});db['VtigerConfiguration'][_0xbd9f('0xfc')](db[_0xbd9f('0xbe')],{'as':'Fields','foreignKey':'FieldId'});db[_0xbd9f('0xbd')][_0xbd9f('0x104')](db[_0xbd9f('0x1a6')],{'as':'Account','foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xbd')]['belongsToMany'](db[_0xbd9f('0x97')],{'through':_0xbd9f('0x1a7')});db[_0xbd9f('0xbe')]['hasMany'](db[_0xbd9f('0xbe')],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db['VtigerField'][_0xbd9f('0xfc')](db['VtigerField'],{'as':_0xbd9f('0x19b'),'foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0xbe')]['hasMany'](db[_0xbd9f('0xbe')],{'as':'Field','foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0xbe')][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':_0xbd9f('0x19e')});db[_0xbd9f('0xbf')][_0xbd9f('0xfc')](db[_0xbd9f('0xc1')],{'as':_0xbd9f('0x194'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xc1')][_0xbd9f('0xfc')](db['ServicenowField'],{'as':_0xbd9f('0x196'),'foreignKey':_0xbd9f('0x197')});db['ServicenowConfiguration'][_0xbd9f('0xfc')](db[_0xbd9f('0xc3')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xbd9f('0xc1')]['hasMany'](db[_0xbd9f('0xc3')],{'as':_0xbd9f('0x18f'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0xc1')][_0xbd9f('0x104')](db[_0xbd9f('0xbf')],{'as':'Account','foreignKey':'AccountId'});db[_0xbd9f('0xc3')][_0xbd9f('0xfc')](db[_0xbd9f('0xc3')],{'as':'Subject','foreignKey':_0xbd9f('0x197')});db[_0xbd9f('0xc3')][_0xbd9f('0xfc')](db[_0xbd9f('0xc3')],{'as':_0xbd9f('0x19b'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xbd9f('0xfc')](db[_0xbd9f('0xc3')],{'as':_0xbd9f('0x19d'),'foreignKey':_0xbd9f('0x199')});db['ServicenowField']['belongsTo'](db[_0xbd9f('0x19c')],{'as':'Variable','foreignKey':_0xbd9f('0x19e')});db['Dynamics365Account']['hasMany'](db[_0xbd9f('0xc6')],{'as':_0xbd9f('0x194'),'onDelete':'cascade','foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0xc6')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a8')],{'as':_0xbd9f('0x196'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'SubjectId'});db[_0xbd9f('0xc6')][_0xbd9f('0xfc')](db['Dynamics365Field'],{'as':_0xbd9f('0x198'),'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0xc6')][_0xbd9f('0xfc')](db['Dynamics365Field'],{'as':_0xbd9f('0x18f'),'onDelete':_0xbd9f('0xf9'),'foreignKey':'FieldId'});db[_0xbd9f('0xc6')][_0xbd9f('0x104')](db[_0xbd9f('0xc5')],{'as':_0xbd9f('0x14a'),'foreignKey':_0xbd9f('0x195')});db[_0xbd9f('0x1a8')][_0xbd9f('0xfc')](db[_0xbd9f('0x1a8')],{'as':_0xbd9f('0x19a'),'foreignKey':_0xbd9f('0x197')});db['Dynamics365Field'][_0xbd9f('0xfc')](db[_0xbd9f('0x1a8')],{'as':_0xbd9f('0x19b'),'foreignKey':_0xbd9f('0x1a0')});db[_0xbd9f('0x1a8')]['hasMany'](db[_0xbd9f('0x1a8')],{'as':_0xbd9f('0x19d'),'foreignKey':_0xbd9f('0x199')});db[_0xbd9f('0x1a8')][_0xbd9f('0x104')](db[_0xbd9f('0x19c')],{'as':_0xbd9f('0x19c'),'foreignKey':_0xbd9f('0x19e')});db[_0xbd9f('0xcb')]['belongsTo'](db[_0xbd9f('0x68')],{});db['ChatQueueReport'][_0xbd9f('0x104')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db['ChatQueueReport'][_0xbd9f('0x104')](db[_0xbd9f('0x14b')],{'as':_0xbd9f('0x14c'),'foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0xcb')][_0xbd9f('0x104')](db[_0xbd9f('0x6d')],{});db[_0xbd9f('0xcb')][_0xbd9f('0x104')](db[_0xbd9f('0x6f')],{});db[_0xbd9f('0xcb')][_0xbd9f('0x104')](db['User'],{});db[_0xbd9f('0xcb')][_0xbd9f('0x104')](db[_0xbd9f('0x73')],{});db[_0xbd9f('0xcc')][_0xbd9f('0x104')](db['User'],{'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1a9')});db[_0xbd9f('0xcc')]['belongsTo'](db[_0xbd9f('0x14')],{'onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x1aa')});db[_0xbd9f('0xd1')][_0xbd9f('0xfc')](db[_0xbd9f('0xcf')],{'foreignKey':_0xbd9f('0x1ab'),'onDelete':'cascade'});db['JscriptySessionReport'][_0xbd9f('0xfc')](db[_0xbd9f('0xce')],{'foreignKey':_0xbd9f('0x1ab'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0xd3')][_0xbd9f('0x104')](db[_0xbd9f('0x58')],{});db['SmsQueueReport']['belongsTo'](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x145'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0xd3')][_0xbd9f('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0xbd9f('0x14d')});db[_0xbd9f('0xd3')][_0xbd9f('0x104')](db[_0xbd9f('0x110')],{});db[_0xbd9f('0xd3')]['belongsTo'](db[_0xbd9f('0x5c')],{});db[_0xbd9f('0xd3')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{});db['SmsQueueReport']['belongsTo'](db['SmsQueue'],{});db[_0xbd9f('0xd8')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xbd9f('0x1ac')});db[_0xbd9f('0xd8')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xbd9f('0x1ac')});db['JscriptyProject'][_0xbd9f('0xfc')](db[_0xbd9f('0xce')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x150'),'through':'user_has_square_projects'});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':'Agents','through':_0xbd9f('0x10c')});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db['VoiceQueue'],{'through':_0xbd9f('0x134'),'as':_0xbd9f('0x113')});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db[_0xbd9f('0x44')],{'through':_0xbd9f('0x148'),'as':'MailQueues'});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db['ChatQueue'],{'through':_0xbd9f('0x1ad'),'as':_0xbd9f('0x1ae')});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db[_0xbd9f('0x54')],{'through':_0xbd9f('0x160'),'as':_0xbd9f('0x1af')});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db[_0xbd9f('0x5e')],{'through':'team_has_sms_queues','as':_0xbd9f('0x116')});db[_0xbd9f('0xe0')][_0xbd9f('0x106')](db[_0xbd9f('0x66')],{'through':_0xbd9f('0x1b0'),'as':_0xbd9f('0x117')});db[_0xbd9f('0xe4')]['hasMany'](db['CmHopper'],{'as':_0xbd9f('0x12a'),'foreignKey':_0xbd9f('0x17d')});db['Campaign'][_0xbd9f('0xfc')](db[_0xbd9f('0x7d')],{'as':_0xbd9f('0x1b1'),'foreignKey':_0xbd9f('0x17d')});db[_0xbd9f('0xe4')][_0xbd9f('0xfc')](db[_0xbd9f('0x7f')],{'as':_0xbd9f('0x178'),'foreignKey':'CampaignId'});db[_0xbd9f('0xe4')][_0xbd9f('0xfc')](db[_0xbd9f('0x12b')],{'as':_0xbd9f('0x12c'),'foreignKey':'CampaignId'});db[_0xbd9f('0xe4')][_0xbd9f('0x104')](db[_0xbd9f('0x30')],{'as':_0xbd9f('0x30'),'foreignKey':_0xbd9f('0x12d')});db[_0xbd9f('0xe4')]['belongsTo'](db[_0xbd9f('0x30')],{'as':_0xbd9f('0x12e'),'foreignKey':_0xbd9f('0x12f')});db[_0xbd9f('0xe4')][_0xbd9f('0x104')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0xbd9f('0xe4')][_0xbd9f('0x104')](db[_0xbd9f('0xdc')],{'as':_0xbd9f('0xdc'),'foreignKey':_0xbd9f('0x1b2')});db[_0xbd9f('0xe4')][_0xbd9f('0x106')](db['CmList'],{'as':'Lists','through':_0xbd9f('0x1b3')});db[_0xbd9f('0xe4')][_0xbd9f('0x106')](db[_0xbd9f('0xf0')],{'as':_0xbd9f('0x135'),'through':_0xbd9f('0x1b4')});db['MailTransferReport'][_0xbd9f('0x104')](db[_0xbd9f('0x49')],{});db[_0xbd9f('0xeb')][_0xbd9f('0x104')](db[_0xbd9f('0x48')],{});db['MailTransferReport'][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'foreignKey':_0xbd9f('0x1b5'),'as':_0xbd9f('0x1b6')});db[_0xbd9f('0xeb')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b7'),'as':_0xbd9f('0x1b8')});db[_0xbd9f('0xeb')][_0xbd9f('0x104')](db['User'],{'foreignKey':_0xbd9f('0x1b9'),'as':_0xbd9f('0x1ba')});db[_0xbd9f('0xeb')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xbd9f('0x1bb'),'as':_0xbd9f('0x1bc')});db[_0xbd9f('0xeb')][_0xbd9f('0x104')](db[_0xbd9f('0x42')],{'foreignKey':_0xbd9f('0x1bd'),'as':_0xbd9f('0x1be')});db[_0xbd9f('0x1bf')][_0xbd9f('0x104')](db[_0xbd9f('0x6f')],{});db[_0xbd9f('0x1bf')][_0xbd9f('0x104')](db[_0xbd9f('0x6d')],{});db[_0xbd9f('0x1bf')][_0xbd9f('0x104')](db[_0xbd9f('0x68')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0xbd9f('0x1bf')]['belongsTo'](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b7'),'as':_0xbd9f('0x1b8')});db[_0xbd9f('0x1bf')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':'ToUserId','as':_0xbd9f('0x1ba')});db['ChatTransferReport']['belongsTo'](db[_0xbd9f('0x73')],{'foreignKey':_0xbd9f('0x1c0'),'as':_0xbd9f('0x1bc')});db[_0xbd9f('0x1bf')][_0xbd9f('0x104')](db['ChatWebsite'],{'foreignKey':_0xbd9f('0x1c1'),'as':_0xbd9f('0x1be')});db[_0xbd9f('0xec')][_0xbd9f('0x104')](db[_0xbd9f('0x15c')],{});db['FaxTransferReport']['belongsTo'](db[_0xbd9f('0x51')],{});db[_0xbd9f('0xec')]['belongsTo'](db[_0xbd9f('0x11d')],{'foreignKey':'FromFaxAccountId','as':_0xbd9f('0x1b6')});db[_0xbd9f('0xec')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b7'),'as':_0xbd9f('0x1b8')});db[_0xbd9f('0xec')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':'ToUserId','as':_0xbd9f('0x1ba')});db[_0xbd9f('0xec')]['belongsTo'](db[_0xbd9f('0x54')],{'foreignKey':_0xbd9f('0x1c2'),'as':_0xbd9f('0x1bc')});db[_0xbd9f('0xec')][_0xbd9f('0x104')](db[_0xbd9f('0x11d')],{'foreignKey':_0xbd9f('0x1c3'),'as':_0xbd9f('0x1be')});db[_0xbd9f('0x1c4')][_0xbd9f('0x104')](db['OpenchannelMessage'],{});db[_0xbd9f('0x1c4')][_0xbd9f('0x104')](db[_0xbd9f('0x64')],{});db[_0xbd9f('0x1c4')][_0xbd9f('0x104')](db[_0xbd9f('0x60')],{'foreignKey':_0xbd9f('0x1c5'),'as':_0xbd9f('0x1b6')});db[_0xbd9f('0x1c4')]['belongsTo'](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b7'),'as':_0xbd9f('0x1b8')});db[_0xbd9f('0x1c4')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':'ToUserId','as':_0xbd9f('0x1ba')});db[_0xbd9f('0x1c4')]['belongsTo'](db[_0xbd9f('0x66')],{'foreignKey':'ToOpenchannelQueueId','as':_0xbd9f('0x1bc')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0xbd9f('0x1be')});db['SmsTransferReport'][_0xbd9f('0x104')](db[_0xbd9f('0x5c')],{});db[_0xbd9f('0xef')][_0xbd9f('0x104')](db[_0xbd9f('0x110')],{});db['SmsTransferReport'][_0xbd9f('0x104')](db['SmsAccount'],{'foreignKey':_0xbd9f('0x1c6'),'as':_0xbd9f('0x1b6')});db[_0xbd9f('0xef')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b7'),'as':'FromAgent'});db[_0xbd9f('0xef')][_0xbd9f('0x104')](db[_0xbd9f('0x14')],{'foreignKey':_0xbd9f('0x1b9'),'as':_0xbd9f('0x1ba')});db[_0xbd9f('0xef')][_0xbd9f('0x104')](db[_0xbd9f('0x5e')],{'foreignKey':'ToSmsQueueId','as':_0xbd9f('0x1bc')});db['SmsTransferReport'][_0xbd9f('0x104')](db[_0xbd9f('0x58')],{'foreignKey':_0xbd9f('0x1c7'),'as':_0xbd9f('0x1be')});db[_0xbd9f('0xf0')][_0xbd9f('0xfc')](db[_0xbd9f('0x89')],{'as':_0xbd9f('0x140'),'foreignKey':'ListId'});db[_0xbd9f('0xf0')][_0xbd9f('0xfc')](db[_0xbd9f('0x1c8')],{'as':_0xbd9f('0x1c9'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0xf0')][_0xbd9f('0xfc')](db['CmContact'],{'as':'Contacts','onDelete':_0xbd9f('0xf9'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0xf0')][_0xbd9f('0xfc')](db[_0xbd9f('0x7d')],{'as':_0xbd9f('0x1b1'),'foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0xf0')][_0xbd9f('0xfc')](db[_0xbd9f('0x7f')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0xbd9f('0xfc')](db[_0xbd9f('0x81')],{'as':'ReportAgentPreview','foreignKey':_0xbd9f('0x156')});db[_0xbd9f('0xf0')][_0xbd9f('0x106')](db[_0xbd9f('0x1e')],{'as':'Queues','through':_0xbd9f('0x1ca')});db[_0xbd9f('0xf0')][_0xbd9f('0x106')](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x147'),'through':'cm_user_has_lists'});db[_0xbd9f('0x118')][_0xbd9f('0xfc')](db['VoiceExtension'],{'as':_0xbd9f('0x183'),'onDelete':_0xbd9f('0x153')});db[_0xbd9f('0x118')][_0xbd9f('0x106')](db['User'],{'as':_0xbd9f('0x147'),'through':'user_has_voice_prefixes'});db[_0xbd9f('0xf3')]['hasMany'](db[_0xbd9f('0x14')],{'as':_0xbd9f('0x150'),'foreignKey':_0xbd9f('0x105')});db[_0xbd9f('0xf3')][_0xbd9f('0xfc')](db[_0xbd9f('0xf5')],{'as':'UserProfileSections','foreignKey':_0xbd9f('0x105'),'onDelete':_0xbd9f('0xf9')});db[_0xbd9f('0xf5')][_0xbd9f('0xfc')](db[_0xbd9f('0xf7')],{'as':_0xbd9f('0x1cb'),'foreignKey':_0xbd9f('0x1cc'),'onDelete':_0xbd9f('0xf9')});module[_0xbd9f('0x1cd')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index efc62c8..5ed7c0a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x515d=['remoteAddress','statusCode','responseTime','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','url','device','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./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/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/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/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','1.0.14','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','appPath','express','express-winston','util','./errors','./config/environment','./config/logger','api','default','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','x-forwarded-for','connection'];(function(_0x3c029a,_0x30fbba){var _0x619f33=function(_0x522b50){while(--_0x522b50){_0x3c029a['push'](_0x3c029a['shift']());}};_0x619f33(++_0x30fbba);}(_0x515d,0x104));var _0xd515=function(_0x373097,_0x1ced55){_0x373097=_0x373097-0x0;var _0x2172a9=_0x515d[_0x373097];return _0x2172a9;};'use strict';var path=require('path');var express=require(_0xd515('0x0'));var ewinston=require(_0xd515('0x1'));var util=require(_0xd515('0x2'));var errors=require(_0xd515('0x3'));var config=require(_0xd515('0x4'));var logger=require(_0xd515('0x5'))(_0xd515('0x6'));var authLogger=require(_0xd515('0x5'))('auth');exports[_0xd515('0x7')]=function(_0x544f53){_0x544f53['use'](ewinston[_0xd515('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1130fc,_0x43d633){return util[_0xd515('0x9')](_0xd515('0xa'),_0x1130fc['method'],_0x1130fc[_0xd515('0xb')][_0xd515('0xc')]?_0x1130fc[_0xd515('0xb')][_0xd515('0xc')]:_0x1130fc[_0xd515('0xd')][_0xd515('0xe')]||_0x1130fc['ip'],_0x1130fc['url'],_0x43d633[_0xd515('0xf')],_0x43d633[_0xd515('0x10')],_0x1130fc[_0xd515('0x11')]?_0x1130fc[_0xd515('0x11')]['id']:null,_0x1130fc['user']?_0x1130fc[_0xd515('0x11')][_0xd515('0x12')]:null,_0x1130fc[_0xd515('0x11')]?_0x1130fc[_0xd515('0x11')][_0xd515('0x13')]:null);}}));_0x544f53[_0xd515('0x14')](ewinston[_0xd515('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x467231,_0x1f23b7){var _0x43384b=_0xd515('0x15');if(_0x467231[_0xd515('0x16')]&&_0x467231[_0xd515('0x16')]['device']&&_0x467231[_0xd515('0x16')][_0xd515('0x17')]){_0x43384b=_0xd515('0x18');}return util[_0xd515('0x9')](_0x43384b,_0x467231[_0xd515('0x19')],_0x467231[_0xd515('0xb')][_0xd515('0xc')]?_0x467231[_0xd515('0xb')][_0xd515('0xc')]:_0x467231[_0xd515('0xd')]['remoteAddress']||_0x467231['ip'],_0x467231[_0xd515('0x1a')],_0x1f23b7[_0xd515('0xf')],_0x1f23b7[_0xd515('0x10')],_0x467231[_0xd515('0x11')]?_0x467231[_0xd515('0x11')]['id']:null,_0x467231[_0xd515('0x11')]?_0x467231[_0xd515('0x11')][_0xd515('0x12')]:null,_0x467231[_0xd515('0x11')]?_0x467231['user'][_0xd515('0x13')]:null,_0x467231[_0xd515('0x16')]&&_0x467231['body'][_0xd515('0x1b')]?_0x467231[_0xd515('0x16')][_0xd515('0x1b')]:'other',_0x467231[_0xd515('0x16')]&&_0x467231[_0xd515('0x16')][_0xd515('0x17')]?_0x467231[_0xd515('0x16')]['agent_id']:'',_0x467231[_0xd515('0x16')]&&_0x467231[_0xd515('0x16')][_0xd515('0x1c')]?_0x467231[_0xd515('0x16')][_0xd515('0x1c')]:'');},'ignoreRoute':function(_0x1d8919){var _0x130533=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x130533[_0xd515('0x1d')](_0x1d8919[_0xd515('0x1a')]);}}));_0x544f53['use']('/api/users',require(_0xd515('0x1e')));_0x544f53[_0xd515('0x14')](_0xd515('0x1f'),require(_0xd515('0x20')));_0x544f53[_0xd515('0x14')](_0xd515('0x21'),require(_0xd515('0x22')));_0x544f53[_0xd515('0x14')]('/api/voice/extensions',require(_0xd515('0x23')));_0x544f53[_0xd515('0x14')](_0xd515('0x24'),require(_0xd515('0x25')));_0x544f53[_0xd515('0x14')](_0xd515('0x26'),require(_0xd515('0x27')));_0x544f53['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x544f53[_0xd515('0x14')](_0xd515('0x28'),require(_0xd515('0x29')));_0x544f53['use']('/api/voice/mails',require('./api/voiceMail'));_0x544f53[_0xd515('0x14')](_0xd515('0x2a'),require(_0xd515('0x2b')));_0x544f53[_0xd515('0x14')](_0xd515('0x2c'),require('./api/voiceCallReport'));_0x544f53[_0xd515('0x14')]('/api/voice/dials/reports',require(_0xd515('0x2d')));_0x544f53[_0xd515('0x14')](_0xd515('0x2e'),require(_0xd515('0x2f')));_0x544f53[_0xd515('0x14')](_0xd515('0x30'),require(_0xd515('0x31')));_0x544f53['use'](_0xd515('0x32'),require(_0xd515('0x33')));_0x544f53[_0xd515('0x14')](_0xd515('0x34'),require(_0xd515('0x35')));_0x544f53['use'](_0xd515('0x36'),require('./api/voiceTransferReport'));_0x544f53[_0xd515('0x14')](_0xd515('0x37'),require(_0xd515('0x38')));_0x544f53[_0xd515('0x14')](_0xd515('0x39'),require(_0xd515('0x3a')));_0x544f53[_0xd515('0x14')](_0xd515('0x3b'),require(_0xd515('0x3c')));_0x544f53[_0xd515('0x14')](_0xd515('0x3d'),require(_0xd515('0x3e')));_0x544f53['use'](_0xd515('0x3f'),require(_0xd515('0x40')));_0x544f53[_0xd515('0x14')]('/api/mail/messages',require(_0xd515('0x41')));_0x544f53['use']('/api/mail/applications',require('./api/mailApplication'));_0x544f53['use'](_0xd515('0x42'),require(_0xd515('0x43')));_0x544f53['use'](_0xd515('0x44'),require('./api/dashboard'));_0x544f53['use'](_0xd515('0x45'),require('./api/dashboardItem'));_0x544f53['use'](_0xd515('0x46'),require(_0xd515('0x47')));_0x544f53[_0xd515('0x14')](_0xd515('0x48'),require(_0xd515('0x49')));_0x544f53[_0xd515('0x14')](_0xd515('0x4a'),require(_0xd515('0x4b')));_0x544f53['use'](_0xd515('0x4c'),require(_0xd515('0x4d')));_0x544f53[_0xd515('0x14')]('/api/fax/queues',require(_0xd515('0x4e')));_0x544f53[_0xd515('0x14')](_0xd515('0x4f'),require('./api/faxQueueReport'));_0x544f53['use'](_0xd515('0x50'),require(_0xd515('0x51')));_0x544f53[_0xd515('0x14')](_0xd515('0x52'),require(_0xd515('0x53')));_0x544f53[_0xd515('0x14')](_0xd515('0x54'),require('./api/smsInteraction'));_0x544f53['use']('/api/sms/messages',require(_0xd515('0x55')));_0x544f53[_0xd515('0x14')](_0xd515('0x56'),require('./api/smsQueue'));_0x544f53[_0xd515('0x14')](_0xd515('0x57'),require(_0xd515('0x58')));_0x544f53[_0xd515('0x14')](_0xd515('0x59'),require('./api/openchannelApplication'));_0x544f53[_0xd515('0x14')](_0xd515('0x5a'),require(_0xd515('0x5b')));_0x544f53[_0xd515('0x14')](_0xd515('0x5c'),require(_0xd515('0x5d')));_0x544f53['use'](_0xd515('0x5e'),require('./api/openchannelQueue'));_0x544f53[_0xd515('0x14')](_0xd515('0x5f'),require(_0xd515('0x60')));_0x544f53['use'](_0xd515('0x61'),require(_0xd515('0x62')));_0x544f53['use'](_0xd515('0x63'),require(_0xd515('0x64')));_0x544f53[_0xd515('0x14')]('/api/chat/interactions',require(_0xd515('0x65')));_0x544f53['use'](_0xd515('0x66'),require(_0xd515('0x67')));_0x544f53[_0xd515('0x14')]('/api/chat/offline_messages',require(_0xd515('0x68')));_0x544f53['use'](_0xd515('0x69'),require(_0xd515('0x6a')));_0x544f53[_0xd515('0x14')](_0xd515('0x6b'),require('./api/chatGroup'));_0x544f53['use'](_0xd515('0x6c'),require(_0xd515('0x6d')));_0x544f53[_0xd515('0x14')](_0xd515('0x6e'),require('./api/cmCompany'));_0x544f53['use'](_0xd515('0x6f'),require('./api/cmContact'));_0x544f53[_0xd515('0x14')]('/api/cm/hopper',require(_0xd515('0x70')));_0x544f53[_0xd515('0x14')](_0xd515('0x71'),require(_0xd515('0x72')));_0x544f53['use']('/api/cm/hopper_final',require(_0xd515('0x73')));_0x544f53[_0xd515('0x14')]('/api/cm/hopper_history',require(_0xd515('0x74')));_0x544f53[_0xd515('0x14')](_0xd515('0x75'),require(_0xd515('0x76')));_0x544f53[_0xd515('0x14')](_0xd515('0x77'),require('./api/action'));_0x544f53['use'](_0xd515('0x78'),require(_0xd515('0x79')));_0x544f53[_0xd515('0x14')]('/api/canned_answers',require(_0xd515('0x7a')));_0x544f53[_0xd515('0x14')]('/api/dispositions',require(_0xd515('0x7b')));_0x544f53[_0xd515('0x14')]('/api/conditions',require(_0xd515('0x7c')));_0x544f53[_0xd515('0x14')](_0xd515('0x7d'),require(_0xd515('0x7e')));_0x544f53[_0xd515('0x14')](_0xd515('0x7f'),require('./api/pause'));_0x544f53[_0xd515('0x14')]('/api/cdr',require(_0xd515('0x80')));_0x544f53[_0xd515('0x14')](_0xd515('0x81'),require('./api/voiceQueuesLog'));_0x544f53[_0xd515('0x14')](_0xd515('0x82'),require(_0xd515('0x83')));_0x544f53[_0xd515('0x14')](_0xd515('0x84'),require(_0xd515('0x85')));_0x544f53[_0xd515('0x14')](_0xd515('0x86'),require(_0xd515('0x87')));_0x544f53[_0xd515('0x14')](_0xd515('0x88'),require(_0xd515('0x89')));_0x544f53[_0xd515('0x14')](_0xd515('0x8a'),require(_0xd515('0x8b')));_0x544f53[_0xd515('0x14')](_0xd515('0x8c'),require(_0xd515('0x8d')));_0x544f53[_0xd515('0x14')](_0xd515('0x8e'),require(_0xd515('0x8f')));_0x544f53[_0xd515('0x14')](_0xd515('0x90'),require(_0xd515('0x91')));_0x544f53[_0xd515('0x14')](_0xd515('0x92'),require(_0xd515('0x93')));_0x544f53['use'](_0xd515('0x94'),require(_0xd515('0x95')));_0x544f53['use'](_0xd515('0x96'),require(_0xd515('0x97')));_0x544f53[_0xd515('0x14')](_0xd515('0x98'),require('./api/analyticMetric'));_0x544f53['use'](_0xd515('0x99'),require(_0xd515('0x9a')));_0x544f53[_0xd515('0x14')]('/api/analytics/tree_reports',require(_0xd515('0x9b')));_0x544f53[_0xd515('0x14')](_0xd515('0x9c'),require(_0xd515('0x9d')));_0x544f53[_0xd515('0x14')](_0xd515('0x9e'),require(_0xd515('0x9f')));_0x544f53['use'](_0xd515('0xa0'),require(_0xd515('0xa1')));_0x544f53[_0xd515('0x14')](_0xd515('0xa2'),require('./api/intSugarcrmAccount'));_0x544f53[_0xd515('0x14')](_0xd515('0xa3'),require(_0xd515('0xa4')));_0x544f53[_0xd515('0x14')](_0xd515('0xa5'),require(_0xd515('0xa6')));_0x544f53['use'](_0xd515('0xa7'),require(_0xd515('0xa8')));_0x544f53[_0xd515('0x14')](_0xd515('0xa9'),require(_0xd515('0xaa')));_0x544f53[_0xd515('0x14')](_0xd515('0xab'),require('./api/intDeskField'));_0x544f53['use'](_0xd515('0xac'),require(_0xd515('0xad')));_0x544f53['use'](_0xd515('0xae'),require(_0xd515('0xaf')));_0x544f53[_0xd515('0x14')](_0xd515('0xb0'),require(_0xd515('0xb1')));_0x544f53[_0xd515('0x14')](_0xd515('0xb2'),require('./api/intZendeskAccount'));_0x544f53[_0xd515('0x14')](_0xd515('0xb3'),require('./api/intZendeskConfiguration'));_0x544f53[_0xd515('0x14')](_0xd515('0xb4'),require(_0xd515('0xb5')));_0x544f53['use'](_0xd515('0xb6'),require(_0xd515('0xb7')));_0x544f53[_0xd515('0x14')]('/api/integrations/freshdesk/configurations',require(_0xd515('0xb8')));_0x544f53[_0xd515('0x14')](_0xd515('0xb9'),require(_0xd515('0xba')));_0x544f53[_0xd515('0x14')](_0xd515('0xbb'),require(_0xd515('0xbc')));_0x544f53['use'](_0xd515('0xbd'),require(_0xd515('0xbe')));_0x544f53['use'](_0xd515('0xbf'),require('./api/intVtigerField'));_0x544f53[_0xd515('0x14')](_0xd515('0xc0'),require(_0xd515('0xc1')));_0x544f53[_0xd515('0x14')](_0xd515('0xc2'),require(_0xd515('0xc3')));_0x544f53['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x544f53[_0xd515('0x14')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x544f53[_0xd515('0x14')](_0xd515('0xc4'),require(_0xd515('0xc5')));_0x544f53[_0xd515('0x14')](_0xd515('0xc6'),require(_0xd515('0xc7')));_0x544f53[_0xd515('0x14')](_0xd515('0xc8'),require(_0xd515('0xc9')));_0x544f53['use'](_0xd515('0xca'),require(_0xd515('0xcb')));_0x544f53['use'](_0xd515('0xcc'),require(_0xd515('0xcd')));_0x544f53['use'](_0xd515('0xce'),require(_0xd515('0xcf')));_0x544f53[_0xd515('0x14')](_0xd515('0xd0'),require(_0xd515('0xd1')));_0x544f53[_0xd515('0x14')](_0xd515('0xd2'),require(_0xd515('0xd3')));_0x544f53[_0xd515('0x14')]('/api/sms/reports/queue',require(_0xd515('0xd4')));_0x544f53['use'](_0xd515('0xd5'),require('./api/squareReport'));_0x544f53['use']('/api/square/details/reports',require(_0xd515('0xd6')));_0x544f53[_0xd515('0x14')](_0xd515('0xd7'),require(_0xd515('0xd8')));_0x544f53['use'](_0xd515('0xd9'),require(_0xd515('0xda')));_0x544f53[_0xd515('0x14')](_0xd515('0xdb'),require(_0xd515('0xdc')));_0x544f53[_0xd515('0x14')](_0xd515('0xdd'),require(_0xd515('0xde')));_0x544f53[_0xd515('0x14')](_0xd515('0xdf'),require('./api/squareRecording'));_0x544f53[_0xd515('0x14')](_0xd515('0xe0'),require('./api/squareMessage'));_0x544f53[_0xd515('0x14')]('/api/teams',require(_0xd515('0xe1')));_0x544f53['use'](_0xd515('0xe2'),require(_0xd515('0xe3')));_0x544f53[_0xd515('0x14')](_0xd515('0xe4'),require(_0xd515('0xe5')));_0x544f53['use'](_0xd515('0xe6'),require(_0xd515('0xe7')));_0x544f53[_0xd515('0x14')](_0xd515('0xe8'),require(_0xd515('0xe9')));_0x544f53[_0xd515('0x14')](_0xd515('0xea'),require('./api/plugin'));_0x544f53[_0xd515('0x14')](_0xd515('0xeb'),require('./api/mailTransferReport'));_0x544f53[_0xd515('0x14')](_0xd515('0xec'),require(_0xd515('0xed')));_0x544f53[_0xd515('0x14')](_0xd515('0xee'),require(_0xd515('0xef')));_0x544f53[_0xd515('0x14')](_0xd515('0xf0'),require(_0xd515('0xf1')));_0x544f53[_0xd515('0x14')]('/api/sms/reports/transfer',require(_0xd515('0xf2')));_0x544f53[_0xd515('0x14')](_0xd515('0xf3'),require(_0xd515('0xf4')));_0x544f53['use'](_0xd515('0xf5'),require(_0xd515('0xf6')));_0x544f53[_0xd515('0x14')](_0xd515('0xf7'),require(_0xd515('0xf8')));_0x544f53[_0xd515('0x14')]('/api/userProfile/sections',require(_0xd515('0xf9')));_0x544f53[_0xd515('0x14')](_0xd515('0xfa'),require('./api/userProfileResource'));_0x544f53[_0xd515('0x14')]('/api/auth/local',require(_0xd515('0xfb')));_0x544f53[_0xd515('0x14')](_0xd515('0xfc'),require(_0xd515('0xfd')));_0x544f53['use'](_0xd515('0xfe'),require(_0xd515('0xff')));_0x544f53[_0xd515('0x14')]('/api/rpc',require(_0xd515('0x100')));_0x544f53[_0xd515('0x14')](_0xd515('0x101'),require(_0xd515('0x102')));_0x544f53[_0xd515('0x14')]('/api/system',require(_0xd515('0x103')));_0x544f53[_0xd515('0x14')](_0xd515('0x104'),require('./api/pm2'));_0x544f53['use'](_0xd515('0x105'),express[_0xd515('0x106')](path[_0xd515('0x107')](config[_0xd515('0x108')],_0xd515('0x105'))));_0x544f53['use'](_0xd515('0x109'),express['static'](path[_0xd515('0x107')](config['root'],'/www')));_0x544f53['use'](_0xd515('0x10a'),express[_0xd515('0x106')](path[_0xd515('0x107')](config['root'],'/demo')));_0x544f53[_0xd515('0x14')](_0xd515('0x10b'),express[_0xd515('0x106')](path['join'](config[_0xd515('0x108')],'snippet',_0xd515('0x10c'))));_0x544f53[_0xd515('0x14')]('/plugins',express[_0xd515('0x106')](path[_0xd515('0x107')](config[_0xd515('0x108')],_0xd515('0x10d'))));_0x544f53['route'](_0xd515('0x10e'))[_0xd515('0x10f')](errors[0x194]);_0x544f53[_0xd515('0x110')]('/*')[_0xd515('0x10f')](function(_0x7e4c4e,_0x4b9acd){_0x4b9acd['sendFile'](path['resolve'](_0x544f53[_0xd515('0x10f')](_0xd515('0x111'))+'/index.html'));});}; \ No newline at end of file +var _0x34b2=['./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','static','join','root','/www','/demo','snippet','1.0.14','/plugins','/server/files/plugins','route','get','/index.html','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','logger','body','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)','role','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/templates','./api/template','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./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/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x34b2,0x11c));var _0x234b=function(_0x503357,_0x1920f3){_0x503357=_0x503357-0x0;var _0x48ba12=_0x34b2[_0x503357];return _0x48ba12;};'use strict';var path=require(_0x234b('0x0'));var express=require(_0x234b('0x1'));var ewinston=require(_0x234b('0x2'));var util=require(_0x234b('0x3'));var errors=require(_0x234b('0x4'));var config=require(_0x234b('0x5'));var logger=require(_0x234b('0x6'))(_0x234b('0x7'));var authLogger=require(_0x234b('0x6'))(_0x234b('0x8'));exports[_0x234b('0x9')]=function(_0x35a8ef){_0x35a8ef[_0x234b('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x52fac7,_0x5e71ac){return util[_0x234b('0xb')](_0x234b('0xc'),_0x52fac7[_0x234b('0xd')],_0x52fac7[_0x234b('0xe')]['x-forwarded-for']?_0x52fac7['headers'][_0x234b('0xf')]:_0x52fac7[_0x234b('0x10')][_0x234b('0x11')]||_0x52fac7['ip'],_0x52fac7[_0x234b('0x12')],_0x5e71ac[_0x234b('0x13')],_0x5e71ac[_0x234b('0x14')],_0x52fac7[_0x234b('0x15')]?_0x52fac7[_0x234b('0x15')]['id']:null,_0x52fac7[_0x234b('0x15')]?_0x52fac7[_0x234b('0x15')][_0x234b('0x16')]:null,_0x52fac7[_0x234b('0x15')]?_0x52fac7[_0x234b('0x15')]['role']:null);}}));_0x35a8ef[_0x234b('0xa')](ewinston[_0x234b('0x17')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4abf92,_0x2eb01c){var _0x836f55='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4abf92[_0x234b('0x18')]&&_0x4abf92[_0x234b('0x18')][_0x234b('0x19')]&&_0x4abf92[_0x234b('0x18')][_0x234b('0x1a')]){_0x836f55=_0x234b('0x1b');}return util[_0x234b('0xb')](_0x836f55,_0x4abf92[_0x234b('0xd')],_0x4abf92[_0x234b('0xe')]['x-forwarded-for']?_0x4abf92[_0x234b('0xe')][_0x234b('0xf')]:_0x4abf92[_0x234b('0x10')][_0x234b('0x11')]||_0x4abf92['ip'],_0x4abf92[_0x234b('0x12')],_0x2eb01c[_0x234b('0x13')],_0x2eb01c[_0x234b('0x14')],_0x4abf92[_0x234b('0x15')]?_0x4abf92[_0x234b('0x15')]['id']:null,_0x4abf92[_0x234b('0x15')]?_0x4abf92['user'][_0x234b('0x16')]:null,_0x4abf92[_0x234b('0x15')]?_0x4abf92[_0x234b('0x15')][_0x234b('0x1c')]:null,_0x4abf92[_0x234b('0x18')]&&_0x4abf92['body'][_0x234b('0x19')]?_0x4abf92[_0x234b('0x18')]['device']:_0x234b('0x1d'),_0x4abf92[_0x234b('0x18')]&&_0x4abf92[_0x234b('0x18')][_0x234b('0x1a')]?_0x4abf92[_0x234b('0x18')][_0x234b('0x1a')]:'',_0x4abf92[_0x234b('0x18')]&&_0x4abf92[_0x234b('0x18')][_0x234b('0x1e')]?_0x4abf92[_0x234b('0x18')][_0x234b('0x1e')]:'');},'ignoreRoute':function(_0x5b00f1){var _0xaaa218=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xaaa218['test'](_0x5b00f1[_0x234b('0x12')]);}}));_0x35a8ef[_0x234b('0xa')](_0x234b('0x1f'),require(_0x234b('0x20')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x21'),require(_0x234b('0x22')));_0x35a8ef['use'](_0x234b('0x23'),require(_0x234b('0x24')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x25'),require(_0x234b('0x26')));_0x35a8ef['use'](_0x234b('0x27'),require('./api/voiceMusicOnHold'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x28'),require(_0x234b('0x29')));_0x35a8ef['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x35a8ef[_0x234b('0xa')]('/api/screen/recordings',require(_0x234b('0x2a')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x2b'),require(_0x234b('0x2c')));_0x35a8ef['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x2d'),require(_0x234b('0x2e')));_0x35a8ef['use'](_0x234b('0x2f'),require(_0x234b('0x30')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x31'),require(_0x234b('0x32')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x33'),require(_0x234b('0x34')));_0x35a8ef[_0x234b('0xa')]('/api/members/reports',require(_0x234b('0x35')));_0x35a8ef[_0x234b('0xa')]('/api/trunks',require(_0x234b('0x36')));_0x35a8ef[_0x234b('0xa')]('/api/voice/transfers/reports',require(_0x234b('0x37')));_0x35a8ef[_0x234b('0xa')]('/api/mail/out_servers',require(_0x234b('0x38')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x39'),require('./api/mailAccount'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x3a'),require('./api/mailQueue'));_0x35a8ef[_0x234b('0xa')]('/api/mail/substatuses',require(_0x234b('0x3b')));_0x35a8ef['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x3c'),require(_0x234b('0x3d')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x3e'),require(_0x234b('0x3f')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x40'),require(_0x234b('0x41')));_0x35a8ef[_0x234b('0xa')]('/api/dashboards',require(_0x234b('0x42')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x43'),require('./api/dashboardItem'));_0x35a8ef[_0x234b('0xa')]('/api/fax/accounts',require('./api/faxAccount'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x44'),require('./api/faxApplication'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x45'),require(_0x234b('0x46')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x47'),require(_0x234b('0x48')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x49'),require('./api/faxQueue'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x4a'),require(_0x234b('0x4b')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x4c'),require(_0x234b('0x4d')));_0x35a8ef['use'](_0x234b('0x4e'),require(_0x234b('0x4f')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x50'),require(_0x234b('0x51')));_0x35a8ef[_0x234b('0xa')]('/api/sms/messages',require(_0x234b('0x52')));_0x35a8ef['use']('/api/sms/queues',require(_0x234b('0x53')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x54'),require(_0x234b('0x55')));_0x35a8ef['use']('/api/openchannel/applications',require(_0x234b('0x56')));_0x35a8ef['use'](_0x234b('0x57'),require(_0x234b('0x58')));_0x35a8ef[_0x234b('0xa')]('/api/openchannel/messages',require(_0x234b('0x59')));_0x35a8ef['use'](_0x234b('0x5a'),require(_0x234b('0x5b')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x5c'),require('./api/chatWebsite'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x5d'),require(_0x234b('0x5e')));_0x35a8ef[_0x234b('0xa')]('/api/chat/applications',require('./api/chatApplication'));_0x35a8ef['use']('/api/chat/interactions',require(_0x234b('0x5f')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x60'),require('./api/chatMessage'));_0x35a8ef['use'](_0x234b('0x61'),require(_0x234b('0x62')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x63'),require(_0x234b('0x64')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x65'),require(_0x234b('0x66')));_0x35a8ef['use'](_0x234b('0x67'),require('./api/chatProactiveAction'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x68'),require('./api/cmCompany'));_0x35a8ef['use'](_0x234b('0x69'),require(_0x234b('0x6a')));_0x35a8ef['use'](_0x234b('0x6b'),require('./api/cmHopper'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x6c'),require(_0x234b('0x6d')));_0x35a8ef['use']('/api/cm/hopper_final',require(_0x234b('0x6e')));_0x35a8ef[_0x234b('0xa')]('/api/cm/hopper_history',require(_0x234b('0x6f')));_0x35a8ef['use']('/api/cm/custom_fields',require(_0x234b('0x70')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x71'),require(_0x234b('0x72')));_0x35a8ef['use'](_0x234b('0x73'),require('./api/automation'));_0x35a8ef['use'](_0x234b('0x74'),require(_0x234b('0x75')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x76'),require(_0x234b('0x77')));_0x35a8ef[_0x234b('0xa')]('/api/conditions',require(_0x234b('0x78')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x79'),require(_0x234b('0x7a')));_0x35a8ef['use'](_0x234b('0x7b'),require(_0x234b('0x7c')));_0x35a8ef[_0x234b('0xa')]('/api/cdr',require(_0x234b('0x7d')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x7e'),require(_0x234b('0x7f')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x80'),require('./api/schedule'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x81'),require(_0x234b('0x82')));_0x35a8ef[_0x234b('0xa')]('/api/tags',require('./api/tag'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x83'),require(_0x234b('0x84')));_0x35a8ef[_0x234b('0xa')]('/api/triggers',require('./api/trigger'));_0x35a8ef[_0x234b('0xa')]('/api/variables',require(_0x234b('0x85')));_0x35a8ef['use'](_0x234b('0x86'),require(_0x234b('0x87')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x88'),require(_0x234b('0x89')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x8a'),require(_0x234b('0x8b')));_0x35a8ef[_0x234b('0xa')]('/api/analytics/default_reports',require(_0x234b('0x8c')));_0x35a8ef[_0x234b('0xa')]('/api/analytics/extracted_reports',require(_0x234b('0x8d')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x8e'),require(_0x234b('0x8f')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x90'),require(_0x234b('0x91')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x92'),require(_0x234b('0x93')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x94'),require(_0x234b('0x95')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x96'),require('./api/intSalesforceConfiguration'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x97'),require(_0x234b('0x98')));_0x35a8ef['use'](_0x234b('0x99'),require('./api/intSugarcrmAccount'));_0x35a8ef[_0x234b('0xa')](_0x234b('0x9a'),require(_0x234b('0x9b')));_0x35a8ef[_0x234b('0xa')](_0x234b('0x9c'),require(_0x234b('0x9d')));_0x35a8ef[_0x234b('0xa')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x35a8ef[_0x234b('0xa')]('/api/integrations/desk/configurations',require(_0x234b('0x9e')));_0x35a8ef[_0x234b('0xa')]('/api/integrations/desk/fields',require(_0x234b('0x9f')));_0x35a8ef['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xa0'),require('./api/intZohoConfiguration'));_0x35a8ef['use']('/api/integrations/zoho/fields',require(_0x234b('0xa1')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xa2'),require(_0x234b('0xa3')));_0x35a8ef['use'](_0x234b('0xa4'),require(_0x234b('0xa5')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xa6'),require('./api/intZendeskField'));_0x35a8ef[_0x234b('0xa')]('/api/integrations/freshdesk/accounts',require(_0x234b('0xa7')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xa8'),require(_0x234b('0xa9')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xaa'),require('./api/intFreshdeskField'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xab'),require(_0x234b('0xac')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xad'),require(_0x234b('0xae')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xaf'),require(_0x234b('0xb0')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xb1'),require(_0x234b('0xb2')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xb3'),require(_0x234b('0xb4')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xb5'),require(_0x234b('0xb6')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xb7'),require('./api/intDynamics365Account'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xb8'),require(_0x234b('0xb9')));_0x35a8ef[_0x234b('0xa')]('/api/integrations/dynamics365/fields',require(_0x234b('0xba')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xbb'),require(_0x234b('0xbc')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xbd'),require('./api/chatQueueReport'));_0x35a8ef['use'](_0x234b('0xbe'),require(_0x234b('0xbf')));_0x35a8ef[_0x234b('0xa')]('/api/jscripty/answers/reports',require(_0x234b('0xc0')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xc1'),require(_0x234b('0xc2')));_0x35a8ef[_0x234b('0xa')]('/api/jscripty/sessions/reports',require(_0x234b('0xc3')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xc4'),require(_0x234b('0xc5')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xc6'),require(_0x234b('0xc7')));_0x35a8ef['use'](_0x234b('0xc8'),require('./api/squareReportDetail'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xc9'),require(_0x234b('0xca')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xcb'),require(_0x234b('0xcc')));_0x35a8ef[_0x234b('0xa')]('/api/square/odbc',require(_0x234b('0xcd')));_0x35a8ef['use'](_0x234b('0xce'),require(_0x234b('0xcf')));_0x35a8ef[_0x234b('0xa')]('/api/square/recordings',require(_0x234b('0xd0')));_0x35a8ef['use']('/api/square/messages',require(_0x234b('0xd1')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xd2'),require(_0x234b('0xd3')));_0x35a8ef['use'](_0x234b('0xd4'),require(_0x234b('0xd5')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xd6'),require(_0x234b('0xd7')));_0x35a8ef['use']('/api/migrations',require('./api/migration'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xd8'),require(_0x234b('0xd9')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xda'),require(_0x234b('0xdb')));_0x35a8ef[_0x234b('0xa')]('/api/mail/reports/transfer',require(_0x234b('0xdc')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xdd'),require(_0x234b('0xde')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xdf'),require(_0x234b('0xe0')));_0x35a8ef['use'](_0x234b('0xe1'),require(_0x234b('0xe2')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xe3'),require(_0x234b('0xe4')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xe5'),require(_0x234b('0xe6')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xe7'),require(_0x234b('0xe8')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xe9'),require(_0x234b('0xea')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xeb'),require('./api/userProfileSection'));_0x35a8ef[_0x234b('0xa')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x35a8ef[_0x234b('0xa')]('/api/auth/local',require(_0x234b('0xec')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xed'),require(_0x234b('0xee')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xef'),require(_0x234b('0xf0')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xf1'),require('./api/rpc'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xf2'),require('./api/version'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xf3'),require('./api/system'));_0x35a8ef[_0x234b('0xa')](_0x234b('0xf4'),require(_0x234b('0xf5')));_0x35a8ef[_0x234b('0xa')]('/apidoc',express[_0x234b('0xf6')](path[_0x234b('0xf7')](config[_0x234b('0xf8')],'/apidoc')));_0x35a8ef[_0x234b('0xa')](_0x234b('0xf9'),express[_0x234b('0xf6')](path[_0x234b('0xf7')](config[_0x234b('0xf8')],_0x234b('0xf9'))));_0x35a8ef['use']('/demo',express[_0x234b('0xf6')](path[_0x234b('0xf7')](config['root'],_0x234b('0xfa'))));_0x35a8ef['use']('/snippet',express[_0x234b('0xf6')](path[_0x234b('0xf7')](config[_0x234b('0xf8')],_0x234b('0xfb'),_0x234b('0xfc'))));_0x35a8ef[_0x234b('0xa')](_0x234b('0xfd'),express[_0x234b('0xf6')](path[_0x234b('0xf7')](config[_0x234b('0xf8')],_0x234b('0xfe'))));_0x35a8ef['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x35a8ef[_0x234b('0xff')]('/*')['get'](function(_0x3623fd,_0x3b63be){_0x3b63be['sendFile'](path['resolve'](_0x35a8ef[_0x234b('0x100')]('appPath')+_0x234b('0x101')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 929bd80..b938ae6 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50d0=['../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.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/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.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/template/template.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x50d0,0x101));var _0x050d=function(_0x3728de,_0x4476b6){_0x3728de=_0x3728de-0x0;var _0x560741=_0x50d0[_0x3728de];return _0x560741;};'use strict';var jayson=require(_0x050d('0x0'));var BPromise=require('bluebird');var _=require(_0x050d('0x1'));var config=require(_0x050d('0x2'));exports[_0x050d('0x3')]=function(){return new BPromise(function(_0x3a26e2,_0x2d73d4){var _0x4d3877={};_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x5')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x6')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x7')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x8')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x9')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0xa')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/memberReport/memberReport.rpc'));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0xb')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0xc')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0xd')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/mailServerIn/mailServerIn.rpc'));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0xe')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0xf')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/mailInteraction/mailInteraction.rpc'));_0x4d3877=_['merge'](_0x4d3877,require('../api/mailMessage/mailMessage.rpc'));_0x4d3877=_['merge'](_0x4d3877,require('../api/mailApplication/mailApplication.rpc'));_0x4d3877=_['merge'](_0x4d3877,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x10')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x11')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x12')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x13')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x14')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x15')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/smsAccount/smsAccount.rpc'));_0x4d3877=_['merge'](_0x4d3877,require('../api/smsInteraction/smsInteraction.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x16')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x17')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4d3877=_['merge'](_0x4d3877,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x18')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x19')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x1a')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x1b')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x1c')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x1d')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/cmContact/cmContact.rpc'));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x1e')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x1f')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x20')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x21')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x22')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x23')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x24')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x25')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/trigger/trigger.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x26')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x27')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x28')));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x29')));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x2a')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x2b')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x2c')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x2d')));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x2e')));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x2f')));_0x4d3877=_['merge'](_0x4d3877,require(_0x050d('0x30')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/squareOdbc/squareOdbc.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x31')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/squareRecording/squareRecording.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x32')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require(_0x050d('0x33')));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/attachment/attachment.rpc'));_0x4d3877=_[_0x050d('0x4')](_0x4d3877,require('../api/plugin/plugin.rpc'));var _0x23bacf=jayson[_0x050d('0x34')](_0x4d3877)[_0x050d('0x35')]();var _0x2ea333=config[_0x050d('0x36')][_0x050d('0x37')]||config[_0x050d('0x37')]+0x1;var _0x336b66=config[_0x050d('0x36')]['ip']||_0x050d('0x38');_0x23bacf['on']('error',function(_0x51f75a){return _0x2d73d4(_0x51f75a);});_0x23bacf[_0x050d('0x3')](_0x2ea333,_0x336b66,function(){console[_0x050d('0x39')](_0x050d('0x3a'),_0x336b66,_0x2ea333);require('../config/triggers')[_0x050d('0x3b')]();return _0x3a26e2(_0x050d('0x3c')+_0x336b66+':'+_0x2ea333);});});}; \ No newline at end of file +var _0x8135=['../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0xa2f088,_0x17e3f0){var _0x7c9a84=function(_0x183675){while(--_0x183675){_0xa2f088['push'](_0xa2f088['shift']());}};_0x7c9a84(++_0x17e3f0);}(_0x8135,0x99));var _0x5813=function(_0x34d3ad,_0x272ba2){_0x34d3ad=_0x34d3ad-0x0;var _0x5c0772=_0x8135[_0x34d3ad];return _0x5c0772;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5813('0x0'));var _=require(_0x5813('0x1'));var config=require(_0x5813('0x2'));exports[_0x5813('0x3')]=function(){return new BPromise(function(_0x4b43a8,_0x1fced6){var _0x196ea8={};_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x5')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/voiceExtension/voiceExtension.rpc'));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x6')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x7')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x8')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x9')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0xa')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0xb')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0xc')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0xd')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0xe')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0xf')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x10')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x11')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/mailQueue/mailQueue.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x12')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x13')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x14')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x15')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/faxAccount/faxAccount.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/faxApplication/faxApplication.rpc'));_0x196ea8=_['merge'](_0x196ea8,require('../api/faxInteraction/faxInteraction.rpc'));_0x196ea8=_['merge'](_0x196ea8,require('../api/faxMessage/faxMessage.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x16')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x17')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x18')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x19')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1a')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1b')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1c')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1d')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1e')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x1f')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x20')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x21')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x22')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x23')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x24')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x25')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x26')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/interval/interval.rpc'));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x27')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/sound/sound.rpc'));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x28')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x29')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/variable/variable.rpc'));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x2a')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x2b')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x2c')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x2d')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x2e')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x2f')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x30')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x31')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x32')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x33')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x34')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x35')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x36')));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x37')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x38')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/squareRecording/squareRecording.rpc'));_0x196ea8=_['merge'](_0x196ea8,require(_0x5813('0x39')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require(_0x5813('0x3a')));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/attachment/attachment.rpc'));_0x196ea8=_[_0x5813('0x4')](_0x196ea8,require('../api/plugin/plugin.rpc'));var _0x78cc9d=jayson[_0x5813('0x3b')](_0x196ea8)[_0x5813('0x3c')]();var _0x43e83f=config[_0x5813('0x3d')][_0x5813('0x3e')]||config[_0x5813('0x3e')]+0x1;var _0x4a2b2d=config[_0x5813('0x3d')]['ip']||_0x5813('0x3f');_0x78cc9d['on']('error',function(_0x3dc488){return _0x1fced6(_0x3dc488);});_0x78cc9d[_0x5813('0x3')](_0x43e83f,_0x4a2b2d,function(){console[_0x5813('0x40')](_0x5813('0x41'),_0x4a2b2d,_0x43e83f);require(_0x5813('0x42'))[_0x5813('0x43')]();return _0x4b43a8(_0x5813('0x44')+_0x4a2b2d+':'+_0x43e83f);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 286733b..6a0ff81 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 _0x204a=['match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','answer','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','indexOf','substr','startsWith','split','length'];(function(_0x435cc6,_0x40952d){var _0xed3a54=function(_0x2ad10d){while(--_0x2ad10d){_0x435cc6['push'](_0x435cc6['shift']());}};_0xed3a54(++_0x40952d);}(_0x204a,0x7f));var _0xa204=function(_0x326d5c,_0x4ad50d){_0x326d5c=_0x326d5c-0x0;var _0x13a48a=_0x204a[_0x326d5c];return _0x13a48a;};'use strict';var util=require(_0xa204('0x0'));var _=require(_0xa204('0x1'));var EventEmitter=require(_0xa204('0x2'))[_0xa204('0x3')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x35087b){var _0x47112b=this,_0x58a275=new AGIReply(),_0x47968a=![],_0x5af359={};EventEmitter[_0xa204('0x4')](_0x47112b);_0x35087b[_0xa204('0x5')](_0xa204('0x6'));_0x35087b[_0xa204('0x7')](0x8*0x3c*0x3c*0x3e8);_0x58a275[_0xa204('0x5')]('utf8');_0x58a275['on'](_0xa204('0x8'),function(_0xce2f5){for(var _0x173a36 in _0xce2f5){_0x47112b[_0x173a36]=_0xce2f5[_0x173a36];}_0x47112b[_0xa204('0x9')](_0xa204('0xa'));});_0x58a275['on'](_0xa204('0xb'),function(_0x4e8018){if(_0x4e8018['toLowerCase']()==_0xa204('0xc')){_0x47112b['emit'](_0xa204('0xc'));return;}if(_0x4e8018[_0xa204('0xd')](0x0,0xb)=='520-Invalid'){_0x47968a=!![];}if(_0x47968a){_0x5af359['rx']+=_0x4e8018+'\x0a';if(_0x4e8018[_0xa204('0xe')](_0xa204('0xf'))!=-0x1){_0x47968a=![];}}else{_0x5af359['rx']=_0x4e8018;}if(_0x47968a){return;}if(typeof _0x5af359['cb']==_0xa204('0x10')){var _0x12d278=_0x5af359['rx'][_0xa204('0xd')](0x0,0x3),_0x4844ce=null,_0x1ebac0=null;_0x12d278=parseInt(_0x12d278);if(isNaN(_0x12d278)){_0x5af359['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa204('0x11')});return;}if(_0x12d278!=0xc8){_0x5af359['cb'](null,{'code':_0x12d278,'result':-0x1,'extra':'KO'});return;}_0x4844ce=_0x5af359['rx'][_0xa204('0xd')](0x4)['replace']('result=','');if(_0x4844ce[_0xa204('0x12')]('\x20')!=-0x1){_0x4844ce=_0x4844ce[_0xa204('0x13')](0x0,_0x4844ce[_0xa204('0x12')]('\x20'));}if(_[_0xa204('0x14')](_0x4844ce,'-1')){_0x4844ce=parseInt(_0x4844ce);}_0x1ebac0=_0x5af359['rx'][_0xa204('0x15')]('\x20');if(_0x1ebac0[_0xa204('0x16')]==0x3){_0x1ebac0=_0x1ebac0[0x2][_0xa204('0xd')](0x1,_0x1ebac0[0x2][_0xa204('0x16')]-0x1);}else if(_0x1ebac0['length']>0x3){var _0x5eae2d=/\((.+)\)/;var _0x466b30=_0x5af359['rx'][_0xa204('0x17')](_0x5eae2d);if(_0x466b30){_0x1ebac0=_0x466b30[0x1];}else{_0x1ebac0=null;}}else{_0x1ebac0=null;}_0x5af359['cb'](null,{'code':_0x12d278,'result':_0x4844ce,'extra':_0x1ebac0});}});_0x35087b['on'](_0xa204('0x18'),function(_0x5a2798){_0x47112b[_0xa204('0x9')](_0xa204('0x18'),new AGIError(_0xa204('0x19'),_0x5a2798['code']));});_0x35087b['on']('close',function(){_0x47112b['emit'](_0xa204('0x1a'),new AGIError(_0xa204('0x1b')));});_0x35087b['on'](_0xa204('0x1c'),function(){_0x47112b[_0xa204('0x9')](_0xa204('0x1c'),new AGIError(_0xa204('0x1d')));_0x35087b[_0xa204('0x1e')]();});_0x35087b[_0xa204('0x1f')](_0x58a275);this[_0xa204('0x20')]=function(_0x21a6ab,_0x3b78c3){var _0x21a6ab=_0x21a6ab||'',_0x3b78c3=typeof _0x3b78c3==_0xa204('0x10')?_0x3b78c3:new Function();_0x5af359={'tx':_0x21a6ab,'rx':'','cb':_0x3b78c3};_0x35087b[_0xa204('0x21')](_0x21a6ab+'\x0a');},this['close']=function(){_0x35087b[_0xa204('0x1e')]();};}util[_0xa204('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xa204('0x23')]=function(_0x5ec1aa){return this[_0xa204('0x20')][_0xa204('0x24')](this,_0x5ec1aa);};AGIChannel['prototype'][_0xa204('0x25')]=function(){return this[_0xa204('0x23')]('ANSWER');};AGIChannel[_0xa204('0x26')][_0xa204('0x27')]=function(_0x46ae08,_0x537484,_0x178ed9){_0x46ae08=_0x46ae08===undefined?_0xa204('0x28'):_0x46ae08;_0x537484=_0x537484===undefined?'5':_0x537484;_0x178ed9=_0x178ed9===undefined?'1':_0x178ed9;return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x2a'),_0x46ae08,_0x537484*0x3e8,_0x178ed9));};AGIChannel[_0xa204('0x26')][_0xa204('0x2b')]=function(_0x3ba08b){_0x3ba08b=_0x3ba08b||_0xa204('0x2c');return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x2d'),_0x3ba08b));};AGIChannel[_0xa204('0x26')]['exec']=function(_0x551215,_0x5817ba){if(_['isArray'](_0x5817ba)){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x2e'),_0x551215,_0x5817ba['join'](',')));}return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x2e'),_0x551215,_0x5817ba));};AGIChannel[_0xa204('0x26')]['setContext']=function(_0x3de58d){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x2f'),_0x3de58d));};AGIChannel[_0xa204('0x26')][_0xa204('0x30')]=function(_0x3dcfdc){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x31'),_0x3dcfdc));};AGIChannel['prototype'][_0xa204('0x32')]=function(_0x533dc6){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x33'),_0x533dc6));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0xa204('0x34'));};AGIChannel[_0xa204('0x26')][_0xa204('0x35')]=function(_0x324004,_0x451429){return this['sendRequest'](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x324004,_0x451429?_0x451429['toString']()[_0xa204('0x36')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xa204('0x37')]=function(_0x3b1529,_0xc096f6){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x38'),_0x3b1529,_0xc096f6));};AGIChannel['prototype'][_0xa204('0x39')]=function(_0x24eee3,_0x570882){return this[_0xa204('0x23')](util[_0xa204('0x29')](_0xa204('0x3a'),_0x24eee3,_0x570882));};AGIChannel['prototype'][_0xa204('0x3b')]=function(_0x30c06d,_0x5885b1){return this['sendRequest'](util[_0xa204('0x29')](_0xa204('0x3c'),_0x30c06d,_0x5885b1));};AGIChannel[_0xa204('0x26')][_0xa204('0x3d')]=function(_0xd15ba2,_0x2629e0,_0x39a878){_0x2629e0=_0x2629e0||this[_0xa204('0x3e')];_0x39a878=_0x39a878||0x1;this[_0xa204('0x3f')](_0xd15ba2);this[_0xa204('0x30')](_0x2629e0);this[_0xa204('0x32')](_0x39a878);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0xd15ba2,_0x2629e0,_0x39a878));};AGIChannel[_0xa204('0x26')][_0xa204('0x40')]=function(_0x1f7176){return this['sendRequest'](util[_0xa204('0x29')](_0xa204('0x41'),_0x1f7176));};AGIChannel[_0xa204('0x26')][_0xa204('0x42')]=function(_0x1bcc78,_0x55ca3d,_0x3477db,_0xebb2c,_0xf07e1f,_0x25fa0d){_0x55ca3d=_0x55ca3d||_0xa204('0x43');_0x3477db=_0x3477db||'';_0xebb2c=_0xebb2c===undefined?-0x1:_0xebb2c==='-1'?-0x1:_0xebb2c*0x3e8;_0xf07e1f=_0xf07e1f===undefined?'':'s='+_0xf07e1f;_0x25fa0d=_0x25fa0d?_0xa204('0x44'):'';return this[_0xa204('0x23')](util[_0xa204('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1bcc78,_0x55ca3d,_0x3477db,_0xebb2c,_0x25fa0d,_0xf07e1f));};AGIChannel[_0xa204('0x26')][_0xa204('0x45')]=function(_0x26bafd,_0x49aacc){_0x49aacc=_0x49aacc||'';return this[_0xa204('0x23')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x26bafd,_0x49aacc));};AGIChannel['prototype'][_0xa204('0x46')]=function(_0x4eb6f3){return this[_0xa204('0x47')](_0xa204('0x48'),_0x4eb6f3);};AGIChannel[_0xa204('0x26')][_0xa204('0x49')]=function(_0x4d7449){return this[_0xa204('0x47')]('WAIT',_0x4d7449);};AGIChannel['prototype']['error']=function(_0x352e0a,_0x424b0a){this['noop'](util[_0xa204('0x29')](_0xa204('0x4a'),_0x352e0a['id'],_0x352e0a['label'],_0x424b0a));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xd983=['inherits','sendRequest','prototype','answer','ANSWER','getData','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','startsWith','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write'];(function(_0x49f4a7,_0x5346e7){var _0x579df8=function(_0x4aa1f9){while(--_0x4aa1f9){_0x49f4a7['push'](_0x49f4a7['shift']());}};_0x579df8(++_0x5346e7);}(_0xd983,0x154));var _0x3d98=function(_0x245608,_0x2471bf){_0x245608=_0x245608-0x0;var _0x1c5148=_0xd983[_0x245608];return _0x1c5148;};'use strict';var util=require(_0x3d98('0x0'));var _=require(_0x3d98('0x1'));var EventEmitter=require(_0x3d98('0x2'))[_0x3d98('0x3')];var AGIReply=require(_0x3d98('0x4'));var AGIError=require(_0x3d98('0x5'));function AGIChannel(_0x2ded95){var _0x1eea22=this,_0x22e07c=new AGIReply(),_0x2c4b08=![],_0x1b76af={};EventEmitter[_0x3d98('0x6')](_0x1eea22);_0x2ded95[_0x3d98('0x7')](_0x3d98('0x8'));_0x2ded95[_0x3d98('0x9')](0x8*0x3c*0x3c*0x3e8);_0x22e07c[_0x3d98('0x7')]('utf8');_0x22e07c['on'](_0x3d98('0xa'),function(_0x222b21){for(var _0x2afea0 in _0x222b21){_0x1eea22[_0x2afea0]=_0x222b21[_0x2afea0];}_0x1eea22[_0x3d98('0xb')](_0x3d98('0xc'));});_0x22e07c['on'](_0x3d98('0xd'),function(_0x3c8d07){if(_0x3c8d07[_0x3d98('0xe')]()==_0x3d98('0xf')){_0x1eea22['emit']('hangup');return;}if(_0x3c8d07[_0x3d98('0x10')](0x0,0xb)=='520-Invalid'){_0x2c4b08=!![];}if(_0x2c4b08){_0x1b76af['rx']+=_0x3c8d07+'\x0a';if(_0x3c8d07[_0x3d98('0x11')](_0x3d98('0x12'))!=-0x1){_0x2c4b08=![];}}else{_0x1b76af['rx']=_0x3c8d07;}if(_0x2c4b08){return;}if(typeof _0x1b76af['cb']==_0x3d98('0x13')){var _0x583ca7=_0x1b76af['rx'][_0x3d98('0x10')](0x0,0x3),_0x55d1a7=null,_0x1dae43=null;_0x583ca7=parseInt(_0x583ca7);if(isNaN(_0x583ca7)){_0x1b76af['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3d98('0x14')});return;}if(_0x583ca7!=0xc8){_0x1b76af['cb'](null,{'code':_0x583ca7,'result':-0x1,'extra':'KO'});return;}_0x55d1a7=_0x1b76af['rx'][_0x3d98('0x10')](0x4)['replace'](_0x3d98('0x15'),'');if(_0x55d1a7[_0x3d98('0x16')]('\x20')!=-0x1){_0x55d1a7=_0x55d1a7['substr'](0x0,_0x55d1a7[_0x3d98('0x16')]('\x20'));}if(_[_0x3d98('0x17')](_0x55d1a7,'-1')){_0x55d1a7=parseInt(_0x55d1a7);}_0x1dae43=_0x1b76af['rx']['split']('\x20');if(_0x1dae43['length']==0x3){_0x1dae43=_0x1dae43[0x2][_0x3d98('0x10')](0x1,_0x1dae43[0x2]['length']-0x1);}else if(_0x1dae43['length']>0x3){var _0x43ac03=/\((.+)\)/;var _0x42e26d=_0x1b76af['rx'][_0x3d98('0x18')](_0x43ac03);if(_0x42e26d){_0x1dae43=_0x42e26d[0x1];}else{_0x1dae43=null;}}else{_0x1dae43=null;}_0x1b76af['cb'](null,{'code':_0x583ca7,'result':_0x55d1a7,'extra':_0x1dae43});}});_0x2ded95['on']('error',function(_0x48115a){_0x1eea22[_0x3d98('0xb')](_0x3d98('0x19'),new AGIError(_0x3d98('0x1a'),_0x48115a['code']));});_0x2ded95['on'](_0x3d98('0x1b'),function(){_0x1eea22[_0x3d98('0xb')](_0x3d98('0x1b'),new AGIError(_0x3d98('0x1c')));});_0x2ded95['on'](_0x3d98('0x1d'),function(){_0x1eea22[_0x3d98('0xb')](_0x3d98('0x1d'),new AGIError(_0x3d98('0x1e')));_0x2ded95[_0x3d98('0x1f')]();});_0x2ded95[_0x3d98('0x20')](_0x22e07c);this[_0x3d98('0x21')]=function(_0x575a68,_0x3fea3b){var _0x575a68=_0x575a68||'',_0x3fea3b=typeof _0x3fea3b==_0x3d98('0x13')?_0x3fea3b:new Function();_0x1b76af={'tx':_0x575a68,'rx':'','cb':_0x3fea3b};_0x2ded95[_0x3d98('0x22')](_0x575a68+'\x0a');},this[_0x3d98('0x1b')]=function(){_0x2ded95['destroy']();};}util[_0x3d98('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3d98('0x24')]=function(_0x4f8540){return this[_0x3d98('0x21')]['sync'](this,_0x4f8540);};AGIChannel[_0x3d98('0x25')][_0x3d98('0x26')]=function(){return this[_0x3d98('0x24')](_0x3d98('0x27'));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x28')]=function(_0x2896ed,_0x3f4994,_0x18c9f5){_0x2896ed=_0x2896ed===undefined?'beep':_0x2896ed;_0x3f4994=_0x3f4994===undefined?'5':_0x3f4994;_0x18c9f5=_0x18c9f5===undefined?'1':_0x18c9f5;return this['sendRequest'](util[_0x3d98('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2896ed,_0x3f4994*0x3e8,_0x18c9f5));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x2a')]=function(_0x223c79){_0x223c79=_0x223c79||_0x3d98('0x2b');return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x2c'),_0x223c79));};AGIChannel['prototype'][_0x3d98('0x2d')]=function(_0x20d55d,_0x3fd467){if(_[_0x3d98('0x2e')](_0x3fd467)){return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x2f'),_0x20d55d,_0x3fd467[_0x3d98('0x30')](',')));}return this[_0x3d98('0x24')](util['format']('EXEC\x20%s\x20%s',_0x20d55d,_0x3fd467));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x31')]=function(_0x5653a9){return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x32'),_0x5653a9));};AGIChannel['prototype'][_0x3d98('0x33')]=function(_0x5cc663){return this[_0x3d98('0x24')](util[_0x3d98('0x29')]('SET\x20EXTENSION\x20%s',_0x5cc663));};AGIChannel[_0x3d98('0x25')]['setPriority']=function(_0xab423c){return this[_0x3d98('0x24')](util['format'](_0x3d98('0x34'),_0xab423c));};AGIChannel['prototype'][_0x3d98('0xf')]=function(){return this[_0x3d98('0x24')](_0x3d98('0x35'));};AGIChannel['prototype'][_0x3d98('0x36')]=function(_0x5b59fc,_0x32f14b){return this[_0x3d98('0x24')](util['format'](_0x3d98('0x37'),_0x5b59fc,_0x32f14b?_0x32f14b[_0x3d98('0x38')]()[_0x3d98('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x3a')]=function(_0x1cc191,_0x3bbf17){return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x3b'),_0x1cc191,_0x3bbf17));};AGIChannel['prototype']['sayDigits']=function(_0x3203f2,_0x1c6335){return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x3c'),_0x3203f2,_0x1c6335));};AGIChannel['prototype']['sayPhonetic']=function(_0x312518,_0x1daee2){return this[_0x3d98('0x24')](util[_0x3d98('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x312518,_0x1daee2));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x3d')]=function(_0x2bcb96,_0x4c46bf,_0x4b7346){_0x4c46bf=_0x4c46bf||this[_0x3d98('0x3e')];_0x4b7346=_0x4b7346||0x1;this[_0x3d98('0x31')](_0x2bcb96);this['setExtension'](_0x4c46bf);this[_0x3d98('0x3f')](_0x4b7346);return this[_0x3d98('0x2a')](util[_0x3d98('0x29')](_0x3d98('0x40'),_0x2bcb96,_0x4c46bf,_0x4b7346));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x41')]=function(_0x282599){return this['sendRequest'](util[_0x3d98('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x282599));};AGIChannel['prototype'][_0x3d98('0x42')]=function(_0x269c5d,_0x9bb4d6,_0x2a0e5c,_0x1db193,_0x5347ec,_0x29a63a){_0x9bb4d6=_0x9bb4d6||_0x3d98('0x43');_0x2a0e5c=_0x2a0e5c||'';_0x1db193=_0x1db193===undefined?-0x1:_0x1db193==='-1'?-0x1:_0x1db193*0x3e8;_0x5347ec=_0x5347ec===undefined?'':'s='+_0x5347ec;_0x29a63a=_0x29a63a?_0x3d98('0x44'):'';return this[_0x3d98('0x24')](util[_0x3d98('0x29')](_0x3d98('0x45'),_0x269c5d,_0x9bb4d6,_0x2a0e5c,_0x1db193,_0x29a63a,_0x5347ec));};AGIChannel[_0x3d98('0x25')]['streamFile']=function(_0x3a5eeb,_0x53ceef){_0x53ceef=_0x53ceef||'';return this['sendRequest'](util[_0x3d98('0x29')](_0x3d98('0x46'),_0x3a5eeb,_0x53ceef));};AGIChannel[_0x3d98('0x25')][_0x3d98('0x47')]=function(_0x1952b9){return this[_0x3d98('0x2d')](_0x3d98('0x48'),_0x1952b9);};AGIChannel[_0x3d98('0x25')][_0x3d98('0x49')]=function(_0x2a82ab){return this['exec']('WAIT',_0x2a82ab);};AGIChannel[_0x3d98('0x25')][_0x3d98('0x19')]=function(_0x6799a9,_0x433172){this[_0x3d98('0x2a')](util[_0x3d98('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x6799a9['id'],_0x6799a9['label'],_0x433172));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3d98('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4972e1f..1d30c66 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 _0xb259=['format','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x5e54ab,_0x4f062d){var _0x3d04b9=function(_0x5ee53e){while(--_0x5ee53e){_0x5e54ab['push'](_0x5e54ab['shift']());}};_0x3d04b9(++_0x4f062d);}(_0xb259,0xa7));var _0x9b25=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0xb259[_0x57fa33];return _0x12e724;};'use strict';var util=require(_0x9b25('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x9b25('0x1'),'E_AGI_SERVER_ERROR':_0x9b25('0x2'),'E_AGI_SERVER_CLOSE':_0x9b25('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x9b25('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x9b25('0x5'),'E_AGI_SOCKET_ERROR':_0x9b25('0x6'),'E_AGI_SOCKET_CLOSE':_0x9b25('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x9b25('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9b25('0x9'),'E_AGI_IVR_ENTRY':_0x9b25('0xa')};function AGIError(_0xfb3c82){var _0xfb3c82=_0xfb3c82||null,_0x5ac421=_0x5ac421||[],_0x499ff0=0x1,_0x1ec7cc='';if(!error[_0xfb3c82]){_0xfb3c82=_0x9b25('0xb');}_0x5ac421[_0x9b25('0xc')](error[_0xfb3c82]);while(arguments[_0x499ff0]){_0x5ac421[_0x9b25('0xc')](arguments[_0x499ff0]);_0x499ff0++;}_0x1ec7cc=util[_0x9b25('0xd')]['apply'](util,_0x5ac421);this['message']=_0x1ec7cc;this[_0x9b25('0xe')]=_0xfb3c82;}module['exports']=AGIError; \ No newline at end of file +var _0xe7aa=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x1e7075,_0xe7915f){var _0x381ff0=function(_0x3e3567){while(--_0x3e3567){_0x1e7075['push'](_0x1e7075['shift']());}};_0x381ff0(++_0xe7915f);}(_0xe7aa,0x96));var _0xae7a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe7aa[_0x618414];return _0x21c19a;};'use strict';var util=require(_0xae7a('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xae7a('0x1'),'E_AGI_SERVER_CLOSE':_0xae7a('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xae7a('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xae7a('0x4'),'E_AGI_SOCKET_ERROR':_0xae7a('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xae7a('0x6'),'E_AGI_COMMAND_EMPTY':_0xae7a('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xae7a('0x8')};function AGIError(_0x1d8266){var _0x1d8266=_0x1d8266||null,_0x5911d5=_0x5911d5||[],_0x31e099=0x1,_0x29f125='';if(!error[_0x1d8266]){_0x1d8266=_0xae7a('0x9');}_0x5911d5[_0xae7a('0xa')](error[_0x1d8266]);while(arguments[_0x31e099]){_0x5911d5[_0xae7a('0xa')](arguments[_0x31e099]);_0x31e099++;}_0x29f125=util[_0xae7a('0xb')][_0xae7a('0xc')](util,_0x5911d5);this['message']=_0x29f125;this['name']=_0x1d8266;}module[_0xae7a('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index de3c10f..8f1eecf 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 _0xea28=['getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits'];(function(_0x982de1,_0x4bc06b){var _0x5bb68f=function(_0x2b640c){while(--_0x2b640c){_0x982de1['push'](_0x982de1['shift']());}};_0x5bb68f(++_0x4bc06b);}(_0xea28,0x13a));var _0x8ea2=function(_0x4e9d6,_0x412c5c){_0x4e9d6=_0x4e9d6-0x0;var _0x285e46=_0xea28[_0x4e9d6];return _0x285e46;};'use strict';var _=require(_0x8ea2('0x0'));var logger=require(_0x8ea2('0x1'))(_0x8ea2('0x2'));var verticesWithRetry=[_0x8ea2('0x3'),_0x8ea2('0x4'),_0x8ea2('0x5')];var Graph=function(){this[_0x8ea2('0x6')]={};this[_0x8ea2('0x7')]={};this['numberOfEdges']=0x0;};Graph[_0x8ea2('0x8')][_0x8ea2('0x9')]=function(_0x1ccf12){this['vertices'][_0x1ccf12['id']]=_0x1ccf12;this[_0x8ea2('0x7')][_0x1ccf12['id']]=[];};Graph[_0x8ea2('0x8')][_0x8ea2('0xa')]=function(_0x39b1fa,_0x28b5b8,_0x929304){this[_0x8ea2('0x7')][_0x39b1fa][_0x8ea2('0xb')]({'target':_0x28b5b8,'condition':_0x929304});this[_0x8ea2('0xc')]+=0x1;};Graph[_0x8ea2('0x8')][_0x8ea2('0xd')]=function(){return _[_0x8ea2('0xd')](this['vertices']);};Graph['prototype'][_0x8ea2('0xe')]=function(){return this[_0x8ea2('0xc')];};Graph[_0x8ea2('0x8')]['getVertex']=function(_0x32b97d){return this[_0x8ea2('0x6')][_0x32b97d];};Graph[_0x8ea2('0x8')][_0x8ea2('0xf')]=function(_0xe47c0e,_0x5e662e){if(!this[_0x8ea2('0x6')][_0xe47c0e]){return logger['info']('no\x20vertex\x20found');}var _0x772bad=_0x5e662e(this[_0x8ea2('0x6')][_0xe47c0e]);if(!_0x772bad){return logger[_0x8ea2('0x10')](_0x8ea2('0x11'));}if(this[_0x8ea2('0x7')][_0xe47c0e][_0x8ea2('0x12')]===0x0){return logger[_0x8ea2('0x10')](_0x8ea2('0x13'));}for(var _0x474873=0x0,_0x396aab=[],_0x2dfa7c=![];_0x474873\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','root','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','stack','log','port','info','format','name','message','[%s]\x20%s','error','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xee14,0x13a));var _0x4ee1=function(_0x489cb5,_0x8f811){_0x489cb5=_0x489cb5-0x0;var _0x550cd1=_0xee14[_0x489cb5];return _0x550cd1;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x4ee1('0x0'));var util=require(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var config=require(_0x4ee1('0x3'));var logger=require(_0x4ee1('0x4'))(_0x4ee1('0x5'));var utilLicense=require(_0x4ee1('0x6'));var rpc=require(_0x4ee1('0x7'));var mailRpc=require(_0x4ee1('0x8'));var Graph=require('./graph');var Vertices=require(_0x4ee1('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x4ee1('0xa')](config[_0x4ee1('0x5')],{'ip':_0x4ee1('0xb'),'port':0x11dd});function connectionHandler(_0x293d5f){process[_0x4ee1('0xc')](function(){syncho(function(){try{setChannelVariables(_0x293d5f);agiHandler(_0x293d5f);}catch(_0x1fd8c8){logger['error'](_0x1fd8c8[_0x4ee1('0xd')]);}});});}function listeningHandler(){console[_0x4ee1('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x4ee1('0x5')][_0x4ee1('0xf')]);logger[_0x4ee1('0x10')](util[_0x4ee1('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x4ee1('0x5')]['ip'],config[_0x4ee1('0x5')][_0x4ee1('0xf')]));}function errorHandler(_0x2d5d3c){if(_0x2d5d3c&&_0x2d5d3c[_0x4ee1('0x12')]&&_0x2d5d3c[_0x4ee1('0x13')]){logger['error'](util[_0x4ee1('0x11')](_0x4ee1('0x14'),_0x2d5d3c[_0x4ee1('0x12')],_0x2d5d3c[_0x4ee1('0x13')]));}else{logger[_0x4ee1('0x15')](util[_0x4ee1('0x11')](_0x4ee1('0x16'),_0x2d5d3c[_0x4ee1('0xd')]));}}function closeHandler(){logger[_0x4ee1('0x10')](util['format'](_0x4ee1('0x17'),this[_0x4ee1('0x18')],this[_0x4ee1('0x19')],this[_0x4ee1('0x1a')],this[_0x4ee1('0x1b')],this[_0x4ee1('0x1c')]));try{createSquareReport(this);}catch(_0x2eff91){logger[_0x4ee1('0x15')](_0x2eff91[_0x4ee1('0xd')]);}}function timeoutHandler(){logger[_0x4ee1('0x10')](util[_0x4ee1('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4ee1('0x18')],this[_0x4ee1('0x19')],this[_0x4ee1('0x1a')],this[_0x4ee1('0x1b')],this[_0x4ee1('0x1c')]));}function hangupHandler(){logger[_0x4ee1('0x10')](util['format'](_0x4ee1('0x1d'),this[_0x4ee1('0x18')],this[_0x4ee1('0x19')],this[_0x4ee1('0x1a')],this[_0x4ee1('0x1b')],this[_0x4ee1('0x1c')]));this[_0x4ee1('0x1e')]=!![];}function getRoot(_0x40fd98){return parser[_0x4ee1('0x1f')](_0x40fd98,{'object':!![]})[_0x4ee1('0x20')]['root'];}function addVertex(_0x53d43f,_0x14110c,_0x459e2e){_0x14110c[_0x4ee1('0x21')]=_0x459e2e;if(_0x14110c[_0x4ee1('0x22')](_0x4ee1('0x23'))){_0x14110c[_0x4ee1('0x24')]=parseInt(_0x14110c['retry'],0xa);}_0x53d43f['addVertex'](_[_0x4ee1('0x25')](_0x14110c,_0x4ee1('0x26')));}function initGraph(_0x4d39dd,_0x35900d){var _0x213db8=new Graph();for(var _0x36654c in _0x4d39dd){if(_0x4d39dd[_0x4ee1('0x22')](_0x36654c)){if(_[_0x4ee1('0x27')](_0x4d39dd[_0x36654c])){for(var _0x3c7b2a=0x0;_0x3c7b2a<_0x4d39dd[_0x36654c][_0x4ee1('0x28')];_0x3c7b2a+=0x1){addVertex(_0x213db8,_0x4d39dd[_0x36654c][_0x3c7b2a],_0x36654c);}}else{addVertex(_0x213db8,_0x4d39dd[_0x36654c],_0x36654c);}}}for(var _0x56c4d3=0x0;_0x56c4d3<_0x35900d[_0x4ee1('0x28')];_0x56c4d3+=0x1){if(_0x35900d[_0x56c4d3]['source']&&_0x35900d[_0x56c4d3][_0x4ee1('0x29')]){_0x213db8['addEdge'](_0x35900d[_0x56c4d3][_0x4ee1('0x2a')],_0x35900d[_0x56c4d3][_0x4ee1('0x29')],_0x35900d[_0x56c4d3][_0x4ee1('0x2b')]);}}return _0x213db8;}function getSquareProject(_0x13944c,_0x19ba11){rpc['getSquareProject'](_0x13944c)[_0x4ee1('0x2c')](function(_0x5b3792){_0x19ba11(null,_0x5b3792);})[_0x4ee1('0x2d')](function(_0x3d5e6c){_0x19ba11(null,_0x3d5e6c);});}function createSquareReport(_0x33fd38,_0x37bc2e){rpc[_0x4ee1('0x2e')](_0x33fd38)['then'](function(_0xf66ab2){if(_0x37bc2e){_0x37bc2e(null,_0xf66ab2);}})[_0x4ee1('0x2d')](function(_0x422ba8){if(_0x37bc2e){_0x37bc2e(null,_0x422ba8);}});}function setChannelVariables(_0x2e37a3){for(var _0x79f87c in _0x2e37a3){if(_0x2e37a3[_0x4ee1('0x22')](_0x79f87c)){if(_0x79f87c['indexOf']('agi_')===0x0){_0x2e37a3[_0x79f87c[_0x4ee1('0x2f')](0x4)]=_0x2e37a3[_0x79f87c];delete _0x2e37a3[_0x79f87c];}}}}function getLogFromObject(_0x54482b){return util[_0x4ee1('0x30')](_0x54482b,{'showHidden':![],'depth':null});}function agiHandler(_0x5a2f6f){var _0x963c2b,_0x3a57bf,_0x264aed,_0x346e87,_0x9f882d;logger[_0x4ee1('0x31')](_0x4ee1('0x32'),JSON[_0x4ee1('0x33')](_0x5a2f6f,null,0x2));logger[_0x4ee1('0x10')](util[_0x4ee1('0x11')](_0x4ee1('0x34'),_0x5a2f6f[_0x4ee1('0x18')],_0x5a2f6f[_0x4ee1('0x19')],_0x5a2f6f['callerid'],_0x5a2f6f[_0x4ee1('0x1b')],_0x5a2f6f[_0x4ee1('0x1c')]));_0x5a2f6f['on'](_0x4ee1('0x15'),errorHandler);_0x5a2f6f['on']('close',closeHandler);_0x5a2f6f['on']('timeout',timeoutHandler);_0x5a2f6f[_0x4ee1('0x1e')]=![];_0x5a2f6f['on'](_0x4ee1('0x35'),hangupHandler);var _0x74e6e2=getSquareProject[_0x4ee1('0x36')](null,_0x5a2f6f['arg_1']);if(_0x74e6e2){if(_0x74e6e2[_0x4ee1('0x37')]){_0x963c2b=getRoot(_0x74e6e2[_0x4ee1('0x37')]);if(_0x963c2b&&_0x963c2b[_0x4ee1('0x38')]){logger[_0x4ee1('0x31')](_0x4ee1('0x39'),JSON[_0x4ee1('0x33')](_0x963c2b,null,0x2));_0x5a2f6f[_0x4ee1('0x3a')]=moment()[_0x4ee1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a57bf=initGraph(_[_0x4ee1('0x25')](_0x963c2b,_0x4ee1('0x26')),_0x963c2b[_0x4ee1('0x26')]);_0x264aed=new Vertices(_0x5a2f6f,rpc,mailRpc);logger[_0x4ee1('0x10')](util[_0x4ee1('0x11')](_0x4ee1('0x3b'),_0x5a2f6f['arg_1'],_0x5a2f6f[_0x4ee1('0x19')],_0x5a2f6f[_0x4ee1('0x1a')],_0x5a2f6f[_0x4ee1('0x1b')],_0x5a2f6f[_0x4ee1('0x1c')]));_0x3a57bf[_0x4ee1('0x3c')](_0x963c2b[_0x4ee1('0x38')]['id'],function(_0x3f0d8b){try{_0x3f0d8b=_0x264aed[_0x4ee1('0x3d')](_0x3f0d8b);logger[_0x4ee1('0x31')](_0x4ee1('0x3e'),JSON[_0x4ee1('0x33')](_0x3f0d8b,null,0x2));if(_0x3f0d8b[_0x4ee1('0x21')]===_0x4ee1('0x3f')){logger['info'](_0x4ee1('0x40'));_0x5a2f6f[_0x4ee1('0x41')]=_0x3f0d8b['context']||_0x5a2f6f[_0x4ee1('0x41')];_0x5a2f6f['extension']=_0x3f0d8b[_0x4ee1('0x42')];_0x5a2f6f['priority']=_0x3f0d8b[_0x4ee1('0x43')]?_0x3f0d8b[_0x4ee1('0x43')]-0x1:0x1;return null;}else if(_0x3f0d8b&&_0x264aed[_0x3f0d8b['agicommand']]){_0x9f882d=_0x264aed[_0x3f0d8b[_0x4ee1('0x21')]](_0x3f0d8b);logger[_0x4ee1('0x10')](_0x4ee1('0x44'),JSON[_0x4ee1('0x33')](_0x9f882d,null,0x2));if(_0x9f882d&&_0x9f882d['code']===AGI_CODE_SUCCESS&&_0x9f882d[_0x4ee1('0x45')]!==AGI_RESULT_ERROR&&!_0x5a2f6f[_0x4ee1('0x1e')]){logger[_0x4ee1('0x31')]('response',getLogFromObject(_0x9f882d));return _['isUndefined'](_0x9f882d[_0x4ee1('0x45')])?null:_0x9f882d[_0x4ee1('0x45')][_0x4ee1('0x46')]();}else{logger[_0x4ee1('0x15')](_0x4ee1('0x44'),getLogFromObject(_0x9f882d));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0xaa71d5){logger[_0x4ee1('0x15')](_0xaa71d5[_0x4ee1('0xd')]);return null;}});if(_0x963c2b[_0x4ee1('0x47')]){logger['info'](util[_0x4ee1('0x11')](_0x4ee1('0x48'),_0x5a2f6f['arg_1'],_0x5a2f6f[_0x4ee1('0x19')],_0x5a2f6f[_0x4ee1('0x1a')],_0x5a2f6f[_0x4ee1('0x1b')],_0x5a2f6f[_0x4ee1('0x1c')]));_0x3a57bf[_0x4ee1('0x3c')](_0x963c2b[_0x4ee1('0x47')]['id'],function(_0x1800e7){try{_0x1800e7=_0x264aed[_0x4ee1('0x3d')](_0x1800e7);logger[_0x4ee1('0x31')]('vertex',JSON['stringify'](_0x1800e7,null,0x2));if(_0x1800e7&&_0x264aed[_0x1800e7[_0x4ee1('0x21')]]){_0x9f882d=_0x264aed[_0x1800e7[_0x4ee1('0x21')]](_0x1800e7);if(_0x9f882d){logger[_0x4ee1('0x31')](_0x4ee1('0x44'),getLogFromObject(_0x9f882d));return _['isUndefined'](_0x9f882d[_0x4ee1('0x45')])?null:_0x9f882d[_0x4ee1('0x45')][_0x4ee1('0x46')]();}else{logger[_0x4ee1('0x15')](_0x4ee1('0x44'),getLogFromObject(_0x9f882d));return null;}}else{logger['error'](_0x4ee1('0x49'));return null;}}catch(_0x4ae560){logger[_0x4ee1('0x15')](_0x4ae560['stack']);return null;}});}logger[_0x4ee1('0x10')](util['format'](_0x4ee1('0x4a'),_0x5a2f6f['arg_1'],_0x5a2f6f[_0x4ee1('0x19')],_0x5a2f6f['callerid'],_0x5a2f6f[_0x4ee1('0x1b')],_0x5a2f6f['uniqueid']));logger[_0x4ee1('0x10')](util[_0x4ee1('0x11')](_0x4ee1('0x4b'),_0x5a2f6f['context'],_0x5a2f6f[_0x4ee1('0x42')],parseInt(_0x5a2f6f[_0x4ee1('0x43')],0xa)+0x1));_0x5a2f6f[_0x4ee1('0x4c')](_0x5a2f6f[_0x4ee1('0x41')],_0x5a2f6f[_0x4ee1('0x42')],parseInt(_0x5a2f6f[_0x4ee1('0x43')],0xa)+0x1);_0x5a2f6f[_0x4ee1('0x4d')]();}}else{logger['error'](util['format'](_0x4ee1('0x4e'),_0x5a2f6f[_0x4ee1('0x18')]));_0x5a2f6f[_0x4ee1('0x4c')](_0x5a2f6f[_0x4ee1('0x41')],_0x5a2f6f[_0x4ee1('0x42')],parseInt(_0x5a2f6f[_0x4ee1('0x43')],0xa)+0x1);_0x5a2f6f[_0x4ee1('0x4d')]();}}else{logger[_0x4ee1('0x15')](util[_0x4ee1('0x11')](_0x4ee1('0x4f'),_0x5a2f6f[_0x4ee1('0x18')]));_0x5a2f6f[_0x4ee1('0x4c')](_0x5a2f6f[_0x4ee1('0x41')],_0x5a2f6f['extension'],parseInt(_0x5a2f6f[_0x4ee1('0x43')],0xa)+0x1);_0x5a2f6f['close']();}}function main(){var _0x147224;return utilLicense[_0x4ee1('0x50')]()['then'](function(_0x1e0aac){if(_0x1e0aac){if(_0x1e0aac[_0x4ee1('0x51')]){if(_0x1e0aac['callysquare']&&_0x1e0aac['callysquare']>0x0){logger[_0x4ee1('0x10')](util['format'](_0x4ee1('0x52'),_0x1e0aac[_0x4ee1('0x53')]));_0x147224=_0x1e0aac['callysquare'];}else{logger[_0x4ee1('0x10')](_0x4ee1('0x54'));}}else{logger[_0x4ee1('0x10')](_0x4ee1('0x55'));_0x147224=-0x1;}}})[_0x4ee1('0x2d')](function(_0x433b9c){logger[_0x4ee1('0x15')]('[LICENSE]',_0x433b9c['stack']);})[_0x4ee1('0x47')](function(){var _0x39f7ff=require('./server')(config[_0x4ee1('0x5')][_0x4ee1('0xf')],config[_0x4ee1('0x5')]['ip'],_0x147224);_0x39f7ff['on']('error',errorHandler);_0x39f7ff['on'](_0x4ee1('0x56'),listeningHandler);_0x39f7ff['on']('connection',connectionHandler);_0x39f7ff['on'](_0x4ee1('0x4d'),closeHandler);});}main(); \ No newline at end of file +var _0xbeea=['../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','info','[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','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','createSquareReport','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[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','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','catch','connection','xml2json','syncho','util','moment','../../config/logger'];(function(_0xbaffea,_0x1e07d5){var _0x3e2830=function(_0x1b2302){while(--_0x1b2302){_0xbaffea['push'](_0xbaffea['shift']());}};_0x3e2830(++_0x1e07d5);}(_0xbeea,0xb1));var _0xabee=function(_0x1e2e74,_0x44f15d){_0x1e2e74=_0x1e2e74-0x0;var _0x2a6034=_0xbeea[_0x1e2e74];return _0x2a6034;};'use strict';var parser=require(_0xabee('0x0'));var _=require('lodash');var syncho=require(_0xabee('0x1'));var util=require(_0xabee('0x2'));var moment=require(_0xabee('0x3'));var config=require('../../config/environment');var logger=require(_0xabee('0x4'))('agi');var utilLicense=require(_0xabee('0x5'));var rpc=require(_0xabee('0x6'));var mailRpc=require(_0xabee('0x7'));var Graph=require(_0xabee('0x8'));var Vertices=require(_0xabee('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xabee('0xa')],{'ip':_0xabee('0xb'),'port':0x11dd});function connectionHandler(_0x4a2999){process[_0xabee('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4a2999);agiHandler(_0x4a2999);}catch(_0x507deb){logger[_0xabee('0xd')](_0x507deb[_0xabee('0xe')]);}});});}function listeningHandler(){console[_0xabee('0xf')](_0xabee('0x10'),config[_0xabee('0xa')][_0xabee('0x11')]);logger['info'](util[_0xabee('0x12')](_0xabee('0x13'),config[_0xabee('0xa')]['ip'],config['agi'][_0xabee('0x11')]));}function errorHandler(_0x168202){if(_0x168202&&_0x168202[_0xabee('0x14')]&&_0x168202['message']){logger['error'](util['format']('[%s]\x20%s',_0x168202['name'],_0x168202[_0xabee('0x15')]));}else{logger[_0xabee('0xd')](util[_0xabee('0x12')](_0xabee('0x16'),_0x168202[_0xabee('0xe')]));}}function closeHandler(){logger['info'](util[_0xabee('0x12')](_0xabee('0x17'),this[_0xabee('0x18')],this[_0xabee('0x19')],this[_0xabee('0x1a')],this[_0xabee('0x1b')],this[_0xabee('0x1c')]));try{createSquareReport(this);}catch(_0x5a9562){logger[_0xabee('0xd')](_0x5a9562[_0xabee('0xe')]);}}function timeoutHandler(){logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x1e'),this[_0xabee('0x18')],this['calleridname'],this['callerid'],this[_0xabee('0x1b')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xabee('0x12')](_0xabee('0x1f'),this[_0xabee('0x18')],this[_0xabee('0x19')],this[_0xabee('0x1a')],this['dnid'],this[_0xabee('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x4f5501){return parser['toJson'](_0x4f5501,{'object':!![]})[_0xabee('0x20')]['root'];}function addVertex(_0x870569,_0x2834e3,_0x520bc){_0x2834e3[_0xabee('0x21')]=_0x520bc;if(_0x2834e3[_0xabee('0x22')](_0xabee('0x23'))){_0x2834e3[_0xabee('0x24')]=parseInt(_0x2834e3['retry'],0xa);}_0x870569[_0xabee('0x25')](_[_0xabee('0x26')](_0x2834e3,_0xabee('0x27')));}function initGraph(_0x21e4fd,_0x4ae65e){var _0x2aa470=new Graph();for(var _0x123d58 in _0x21e4fd){if(_0x21e4fd['hasOwnProperty'](_0x123d58)){if(_[_0xabee('0x28')](_0x21e4fd[_0x123d58])){for(var _0x232144=0x0;_0x232144<_0x21e4fd[_0x123d58][_0xabee('0x29')];_0x232144+=0x1){addVertex(_0x2aa470,_0x21e4fd[_0x123d58][_0x232144],_0x123d58);}}else{addVertex(_0x2aa470,_0x21e4fd[_0x123d58],_0x123d58);}}}for(var _0x26a5d1=0x0;_0x26a5d1<_0x4ae65e['length'];_0x26a5d1+=0x1){if(_0x4ae65e[_0x26a5d1][_0xabee('0x2a')]&&_0x4ae65e[_0x26a5d1][_0xabee('0x2b')]){_0x2aa470[_0xabee('0x2c')](_0x4ae65e[_0x26a5d1][_0xabee('0x2a')],_0x4ae65e[_0x26a5d1][_0xabee('0x2b')],_0x4ae65e[_0x26a5d1][_0xabee('0x2d')]);}}return _0x2aa470;}function getSquareProject(_0x3df00d,_0x42368d){rpc[_0xabee('0x2e')](_0x3df00d)['then'](function(_0x2a2441){_0x42368d(null,_0x2a2441);})['catch'](function(_0x1afe17){_0x42368d(null,_0x1afe17);});}function createSquareReport(_0x1ebc01,_0xe0b7bd){rpc[_0xabee('0x2f')](_0x1ebc01)['then'](function(_0x297180){if(_0xe0b7bd){_0xe0b7bd(null,_0x297180);}})['catch'](function(_0x4098ec){if(_0xe0b7bd){_0xe0b7bd(null,_0x4098ec);}});}function setChannelVariables(_0x525e85){for(var _0x123a34 in _0x525e85){if(_0x525e85['hasOwnProperty'](_0x123a34)){if(_0x123a34['indexOf'](_0xabee('0x30'))===0x0){_0x525e85[_0x123a34[_0xabee('0x31')](0x4)]=_0x525e85[_0x123a34];delete _0x525e85[_0x123a34];}}}}function getLogFromObject(_0x3c839e){return util[_0xabee('0x32')](_0x3c839e,{'showHidden':![],'depth':null});}function agiHandler(_0x42e434){var _0xaefbc3,_0x199929,_0x2a67fb,_0x55a27b,_0x261bfb;logger[_0xabee('0x33')](_0xabee('0x34'),JSON[_0xabee('0x35')](_0x42e434,null,0x2));logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x36'),_0x42e434[_0xabee('0x18')],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x42e434['on'](_0xabee('0xd'),errorHandler);_0x42e434['on'](_0xabee('0x37'),closeHandler);_0x42e434['on'](_0xabee('0x38'),timeoutHandler);_0x42e434[_0xabee('0x39')]=![];_0x42e434['on'](_0xabee('0x3a'),hangupHandler);var _0x491279=getSquareProject['sync'](null,_0x42e434[_0xabee('0x18')]);if(_0x491279){if(_0x491279[_0xabee('0x3b')]){_0xaefbc3=getRoot(_0x491279[_0xabee('0x3b')]);if(_0xaefbc3&&_0xaefbc3[_0xabee('0x3c')]){logger['debug'](_0xabee('0x3d'),JSON[_0xabee('0x35')](_0xaefbc3,null,0x2));_0x42e434[_0xabee('0x3e')]=moment()['format'](_0xabee('0x3f'));_0x199929=initGraph(_['omit'](_0xaefbc3,_0xabee('0x27')),_0xaefbc3[_0xabee('0x27')]);_0x2a67fb=new Vertices(_0x42e434,rpc,mailRpc);logger[_0xabee('0x1d')](util[_0xabee('0x12')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x42e434['arg_1'],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x199929[_0xabee('0x40')](_0xaefbc3['start']['id'],function(_0x229b00){try{_0x229b00=_0x2a67fb[_0xabee('0x41')](_0x229b00);logger['debug'](_0xabee('0x42'),JSON[_0xabee('0x35')](_0x229b00,null,0x2));if(_0x229b00['agicommand']===_0xabee('0x43')){logger[_0xabee('0x1d')](_0xabee('0x44'));_0x42e434[_0xabee('0x45')]=_0x229b00[_0xabee('0x45')]||_0x42e434[_0xabee('0x45')];_0x42e434[_0xabee('0x46')]=_0x229b00['extension'];_0x42e434[_0xabee('0x47')]=_0x229b00[_0xabee('0x47')]?_0x229b00[_0xabee('0x47')]-0x1:0x1;return null;}else if(_0x229b00&&_0x2a67fb[_0x229b00['agicommand']]){_0x261bfb=_0x2a67fb[_0x229b00[_0xabee('0x21')]](_0x229b00);logger[_0xabee('0x1d')]('response',JSON[_0xabee('0x35')](_0x261bfb,null,0x2));if(_0x261bfb&&_0x261bfb[_0xabee('0x48')]===AGI_CODE_SUCCESS&&_0x261bfb['result']!==AGI_RESULT_ERROR&&!_0x42e434[_0xabee('0x39')]){logger[_0xabee('0x33')](_0xabee('0x49'),getLogFromObject(_0x261bfb));return _[_0xabee('0x4a')](_0x261bfb[_0xabee('0x4b')])?null:_0x261bfb[_0xabee('0x4b')][_0xabee('0x4c')]();}else{logger['error'](_0xabee('0x49'),getLogFromObject(_0x261bfb));return null;}}else{logger[_0xabee('0xd')](_0xabee('0x4d'));return null;}}catch(_0x5e1879){logger[_0xabee('0xd')](_0x5e1879[_0xabee('0xe')]);return null;}});if(_0xaefbc3['finally']){logger['info'](util['format'](_0xabee('0x4e'),_0x42e434[_0xabee('0x18')],_0x42e434['calleridname'],_0x42e434['callerid'],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x199929[_0xabee('0x40')](_0xaefbc3[_0xabee('0x4f')]['id'],function(_0x184058){try{_0x184058=_0x2a67fb[_0xabee('0x41')](_0x184058);logger[_0xabee('0x33')](_0xabee('0x42'),JSON[_0xabee('0x35')](_0x184058,null,0x2));if(_0x184058&&_0x2a67fb[_0x184058[_0xabee('0x21')]]){_0x261bfb=_0x2a67fb[_0x184058[_0xabee('0x21')]](_0x184058);if(_0x261bfb){logger[_0xabee('0x33')](_0xabee('0x49'),getLogFromObject(_0x261bfb));return _[_0xabee('0x4a')](_0x261bfb[_0xabee('0x4b')])?null:_0x261bfb[_0xabee('0x4b')][_0xabee('0x4c')]();}else{logger[_0xabee('0xd')]('response',getLogFromObject(_0x261bfb));return null;}}else{logger[_0xabee('0xd')](_0xabee('0x4d'));return null;}}catch(_0x4bee06){logger['error'](_0x4bee06[_0xabee('0xe')]);return null;}});}logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x50'),_0x42e434[_0xabee('0x18')],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434['dnid'],_0x42e434[_0xabee('0x1c')]));logger['info'](util[_0xabee('0x12')](_0xabee('0x51'),_0x42e434['context'],_0x42e434[_0xabee('0x46')],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1));_0x42e434[_0xabee('0x52')](_0x42e434['context'],_0x42e434[_0xabee('0x46')],parseInt(_0x42e434['priority'],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}else{logger[_0xabee('0xd')](util[_0xabee('0x12')]('Project\x20%s\x20not\x20published',_0x42e434[_0xabee('0x18')]));_0x42e434[_0xabee('0x52')](_0x42e434[_0xabee('0x45')],_0x42e434['extension'],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}else{logger[_0xabee('0xd')](util[_0xabee('0x12')]('Project\x20%s\x20not\x20found',_0x42e434[_0xabee('0x18')]));_0x42e434[_0xabee('0x52')](_0x42e434[_0xabee('0x45')],_0x42e434['extension'],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}function main(){var _0x92baa3;return utilLicense[_0xabee('0x53')]()[_0xabee('0x54')](function(_0x105130){if(_0x105130){if(_0x105130[_0xabee('0x55')]){if(_0x105130[_0xabee('0x56')]&&_0x105130[_0xabee('0x56')]>0x0){logger['info'](util['format'](_0xabee('0x57'),_0x105130[_0xabee('0x56')]));_0x92baa3=_0x105130[_0xabee('0x56')];}else{logger[_0xabee('0x1d')](_0xabee('0x58'));}}else{logger[_0xabee('0x1d')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x92baa3=-0x1;}}})[_0xabee('0x59')](function(_0x269fed){logger[_0xabee('0xd')]('[LICENSE]',_0x269fed['stack']);})[_0xabee('0x4f')](function(){var _0x4b1448=require('./server')(config['agi'][_0xabee('0x11')],config['agi']['ip'],_0x92baa3);_0x4b1448['on'](_0xabee('0xd'),errorHandler);_0x4b1448['on']('listening',listeningHandler);_0x4b1448['on'](_0xabee('0x5a'),connectionHandler);_0x4b1448['on']('close',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 fc650b4..1e94bc7 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x49d282,_0x4065c7){var _0x3a323d=function(_0x562073){while(--_0x562073){_0x49d282['push'](_0x49d282['shift']());}};_0x3a323d(++_0x4065c7);}(_0x814b,0x1a2));var _0xb814=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x814b[_0x1aeda2];return _0x32dc6d;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x585e0d,_0x1ca0c0){var _0x5a0e19=function(_0x11da6b){while(--_0x11da6b){_0x585e0d['push'](_0x585e0d['shift']());}};_0x5a0e19(++_0x1ca0c0);}(_0x34e8,0x12c));var _0x834e=function(_0x3f4b54,_0x54d39b){_0x3f4b54=_0x3f4b54-0x0;var _0x5b0d9f=_0x34e8[_0x3f4b54];return _0x5b0d9f;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f785d39..ae0e571 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 _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0xb10b,0x12a));var _0xbb10=function(_0xb729d2,_0x131a0e){_0xb729d2=_0xb729d2-0x0;var _0x181500=_0xb10b[_0xb729d2];return _0x181500;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x48779a,_0x2afba6){var _0x4af39b=function(_0x3b5d26){while(--_0x3b5d26){_0x48779a['push'](_0x48779a['shift']());}};_0x4af39b(++_0x2afba6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d021f,_0x5c8765){_0x5d021f=_0x5d021f-0x0;var _0x5ae738=_0x5f2f[_0x5d021f];return _0x5ae738;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 7d5ac71..2276bce 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 _0x1c3d=['message','catch','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','client','request','then','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x5e1609,_0x1c60d1){_0x5e1609=_0x5e1609-0x0;var _0x4be0b1=_0x1c3d[_0x5e1609];return _0x4be0b1;};'use strict';var BPromise=require('bluebird');var moment=require(_0xd1c3('0x0'));var _=require(_0xd1c3('0x1'));var util=require(_0xd1c3('0x2'));var jayson=require(_0xd1c3('0x3'));var client=jayson[_0xd1c3('0x4')]['http']({'port':0x2329});function request(_0x577efa,_0xffc3d0){return new BPromise(function(_0x3cc8a4,_0x793c5c){return client[_0xd1c3('0x5')](_0x577efa,_0xffc3d0)[_0xd1c3('0x6')](function(_0x391a41){if(_0x391a41['error']){return _0x793c5c(_0x391a41[_0xd1c3('0x7')][_0xd1c3('0x8')]);}else{return _0x3cc8a4(_0x391a41['result']);}})[_0xd1c3('0x9')](function(_0x2f3c1c){return _0x793c5c(_0x2f3c1c);});});}exports[_0xd1c3('0xa')]=function(_0x18556c){return request(_0xd1c3('0xb'),{'options':{'raw':![],'where':{'name':_0x18556c},'attributes':['production']}});};exports['getMailAccountById']=function(_0x4055e8){return request(_0xd1c3('0xc'),{'options':{'raw':![],'where':{'id':_0x4055e8},'include':[{'model':_0xd1c3('0xd'),'as':_0xd1c3('0xe')}],'attributes':['id',_0xd1c3('0xf'),_0xd1c3('0x10')]}});};exports[_0xd1c3('0x11')]=function(_0x280405){return request(_0xd1c3('0xb'),{'options':{'where':{'id':_0x280405},'attributes':['name']}});};exports[_0xd1c3('0x12')]=function(_0x4f2d0b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4f2d0b},'attributes':[_0xd1c3('0xf')]}});};exports['getVariableById']=function(_0x2403c8){return request(_0xd1c3('0x13'),{'options':{'where':{'id':_0x2403c8},'attributes':[_0xd1c3('0xf')]}});};exports['getSquareOdbcById']=function(_0xaaa259){return request(_0xd1c3('0x14'),{'options':{'where':{'id':_0xaaa259},'attributes':[_0xd1c3('0x15')]}});};exports[_0xd1c3('0x16')]=function(_0x42ba11){return request(_0xd1c3('0x17'),{'options':{'where':{'id':_0x42ba11},'attributes':[_0xd1c3('0xf')]}});};exports[_0xd1c3('0x18')]=function(_0x3439dc){return request(_0xd1c3('0x19'),{'options':{'where':{'id':_0x3439dc},'attributes':['name']}});};exports['getSoundById']=function(_0x14f6cb){return request(_0xd1c3('0x1a'),{'options':{'where':{'id':_0x14f6cb},'attributes':[_0xd1c3('0x1b')]}});};exports[_0xd1c3('0x1c')]=function(_0x5b2571){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5b2571},'include':[{'model':_0xd1c3('0x1d'),'as':_0xd1c3('0x1e')}]}});};exports[_0xd1c3('0x1f')]=function(_0x588f4e){return request('ShowSmsAccount',{'options':{'where':{'id':_0x588f4e},'attributes':['id',_0xd1c3('0xf')]}});};exports[_0xd1c3('0x20')]=function(_0x4f8277){return request('CreateSmsMessage',{'body':_0x4f8277});};exports[_0xd1c3('0x21')]=function(_0xc45d5d){return request(_0xd1c3('0x22'),{'body':_0xc45d5d});};exports[_0xd1c3('0x23')]=function(_0x3d396c){return request(_0xd1c3('0x24'),{'body':_[_0xd1c3('0x25')](_0x3d396c,{'project_name':_0x3d396c[_0xd1c3('0x26')],'prev_project_name':_0x3d396c[_0xd1c3('0x27')]||'','is_subproject':_0x3d396c[_0xd1c3('0x27')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xd1c3('0x28')]=function(_0x261323){return request(_0xd1c3('0x29'),{'body':_0x261323});};exports[_0xd1c3('0x2a')]=function(_0x5d1988){return request(_0xd1c3('0x2b'),{'body':_0x5d1988});};exports[_0xd1c3('0x2c')]=function(_0x54fd33){return request(_0xd1c3('0x2d'),{'options':{'raw':![],'where':{'phone':_0x54fd33[_0xd1c3('0x2e')],'ListId':_0x54fd33[_0xd1c3('0x2f')]}}})[_0xd1c3('0x6')](function(_0x10be91){if(_0x10be91){return _0x10be91;}return request(_0xd1c3('0x30'),{'body':_0x54fd33});});};exports[_0xd1c3('0x31')]=function(_0x551add){return request('ShowPause',{'options':{'where':{'id':_0x551add},'attributes':[_0xd1c3('0xf')]}});};exports[_0xd1c3('0x32')]=function(_0x1a4448,_0x100f29){return request(_0xd1c3('0x33'),{'body':{'interface':_0x100f29},'options':{'where':_0x1a4448}});};exports['agentPause']=function(_0x331bad,_0xb778ce,_0x5ce257){return request(_0xd1c3('0x34'),{'body':{'type':_0xb778ce,'uniqueid':_0x5ce257},'options':{'where':_0x331bad}});};exports['agentUnpause']=function(_0x1eefc2){return request(_0xd1c3('0x35'),{'body':{},'options':{'where':_0x1eefc2}});};exports[_0xd1c3('0x36')]=function(_0xdf49e1){return request(_0xd1c3('0x37'),{'body':{},'options':{'where':_0xdf49e1}});}; \ No newline at end of file +var _0x5d37=['format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2'];(function(_0x3fc114,_0x26c3dc){var _0x154506=function(_0x456cd5){while(--_0x456cd5){_0x3fc114['push'](_0x3fc114['shift']());}};_0x154506(++_0x26c3dc);}(_0x5d37,0x1f2));var _0x75d3=function(_0x28b66b,_0x1ed234){_0x28b66b=_0x28b66b-0x0;var _0x56911c=_0x5d37[_0x28b66b];return _0x56911c;};'use strict';var BPromise=require(_0x75d3('0x0'));var moment=require(_0x75d3('0x1'));var _=require('lodash');var util=require(_0x75d3('0x2'));var jayson=require(_0x75d3('0x3'));var client=jayson[_0x75d3('0x4')]['http']({'port':0x2329});function request(_0x1995e0,_0x2e5b72){return new BPromise(function(_0x2673e2,_0x16d98e){return client['request'](_0x1995e0,_0x2e5b72)['then'](function(_0x1bcb8e){if(_0x1bcb8e[_0x75d3('0x5')]){return _0x16d98e(_0x1bcb8e[_0x75d3('0x5')][_0x75d3('0x6')]);}else{return _0x2673e2(_0x1bcb8e[_0x75d3('0x7')]);}})[_0x75d3('0x8')](function(_0x3fe3ee){return _0x16d98e(_0x3fe3ee);});});}exports[_0x75d3('0x9')]=function(_0x3c33ac){return request(_0x75d3('0xa'),{'options':{'raw':![],'where':{'name':_0x3c33ac},'attributes':[_0x75d3('0xb')]}});};exports[_0x75d3('0xc')]=function(_0x4f087e){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4f087e},'include':[{'model':_0x75d3('0xd'),'as':_0x75d3('0xe')}],'attributes':['id',_0x75d3('0xf'),_0x75d3('0x10')]}});};exports[_0x75d3('0x11')]=function(_0x5c7d7c){return request(_0x75d3('0xa'),{'options':{'where':{'id':_0x5c7d7c},'attributes':[_0x75d3('0xf')]}});};exports['getVoiceQueueById']=function(_0x2d5459){return request(_0x75d3('0x12'),{'options':{'where':{'id':_0x2d5459},'attributes':[_0x75d3('0xf')]}});};exports[_0x75d3('0x13')]=function(_0x36928b){return request(_0x75d3('0x14'),{'options':{'where':{'id':_0x36928b},'attributes':[_0x75d3('0xf')]}});};exports[_0x75d3('0x15')]=function(_0x394c93){return request(_0x75d3('0x16'),{'options':{'where':{'id':_0x394c93},'attributes':[_0x75d3('0x17')]}});};exports[_0x75d3('0x18')]=function(_0x239c08){return request(_0x75d3('0x19'),{'options':{'where':{'id':_0x239c08},'attributes':[_0x75d3('0xf')]}});};exports['getTrunkById']=function(_0x34a0ce){return request(_0x75d3('0x1a'),{'options':{'where':{'id':_0x34a0ce},'attributes':[_0x75d3('0xf')]}});};exports[_0x75d3('0x1b')]=function(_0x1cd3e7){return request('ShowSound',{'options':{'where':{'id':_0x1cd3e7},'attributes':['save_name']}});};exports[_0x75d3('0x1c')]=function(_0x549a0c){return request(_0x75d3('0x1d'),{'options':{'raw':![],'where':{'id':_0x549a0c},'include':[{'model':_0x75d3('0x1e'),'as':_0x75d3('0x1f')}]}});};exports[_0x75d3('0x20')]=function(_0x5c3ace){return request(_0x75d3('0x21'),{'options':{'where':{'id':_0x5c3ace},'attributes':['id',_0x75d3('0xf')]}});};exports[_0x75d3('0x22')]=function(_0x46748e){return request(_0x75d3('0x23'),{'body':_0x46748e});};exports[_0x75d3('0x24')]=function(_0x33f03d){return request(_0x75d3('0x25'),{'body':_0x33f03d});};exports[_0x75d3('0x26')]=function(_0x4f5368){return request(_0x75d3('0x27'),{'body':_['merge'](_0x4f5368,{'project_name':_0x4f5368[_0x75d3('0x28')],'prev_project_name':_0x4f5368[_0x75d3('0x29')]||'','is_subproject':_0x4f5368[_0x75d3('0x29')]?!![]:![],'leaveAt':moment()[_0x75d3('0x2a')](_0x75d3('0x2b'))})});};exports['createSquareRecording']=function(_0x2d7e56){return request(_0x75d3('0x2c'),{'body':_0x2d7e56});};exports[_0x75d3('0x2d')]=function(_0x306ca2){return request('CreateSquareMessage',{'body':_0x306ca2});};exports[_0x75d3('0x2e')]=function(_0x4f70f2){return request(_0x75d3('0x2f'),{'options':{'raw':![],'where':{'phone':_0x4f70f2[_0x75d3('0x30')],'ListId':_0x4f70f2[_0x75d3('0x31')]}}})[_0x75d3('0x32')](function(_0x5b8d1b){if(_0x5b8d1b){return _0x5b8d1b;}return request(_0x75d3('0x33'),{'body':_0x4f70f2});});};exports[_0x75d3('0x34')]=function(_0xd5a31a){return request(_0x75d3('0x35'),{'options':{'where':{'id':_0xd5a31a},'attributes':[_0x75d3('0xf')]}});};exports[_0x75d3('0x36')]=function(_0x5de444,_0x5b33d4){return request('LoginUser',{'body':{'interface':_0x5b33d4},'options':{'where':_0x5de444}});};exports['agentPause']=function(_0x15a740,_0x34930d,_0x30e3d5){return request(_0x75d3('0x37'),{'body':{'type':_0x34930d,'uniqueid':_0x30e3d5},'options':{'where':_0x15a740}});};exports[_0x75d3('0x38')]=function(_0x3089c1){return request(_0x75d3('0x39'),{'body':{},'options':{'where':_0x3089c1}});};exports[_0x75d3('0x3a')]=function(_0x9cb4){return request(_0x75d3('0x3b'),{'body':{},'options':{'where':_0x9cb4}});}; \ 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 1363cb3..2914c8b 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 _0x8068=['exports','./polly','./lex'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x8068,0xb5));var _0x8806=function(_0x268c4c,_0x5cce8d){_0x268c4c=_0x268c4c-0x0;var _0x37e96e=_0x8068[_0x268c4c];return _0x37e96e;};var polly=require(_0x8806('0x0'));var lex=require(_0x8806('0x1'));module[_0x8806('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xda9f=['./polly','./lex'];(function(_0x14d21d,_0x1bf39a){var _0x3c79a4=function(_0x41def6){while(--_0x41def6){_0x14d21d['push'](_0x14d21d['shift']());}};_0x3c79a4(++_0x1bf39a);}(_0xda9f,0x126));var _0xfda9=function(_0x1cb899,_0x389f5b){_0x1cb899=_0x1cb899-0x0;var _0x21dc89=_0xda9f[_0x1cb899];return _0x21dc89;};var polly=require(_0xfda9('0x0'));var lex=require(_0xfda9('0x1'));module['exports']={'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 45c37d0..b208120 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 _0x4746=['./lib/api','exports'];(function(_0x4c3447,_0x2fd5cf){var _0x558026=function(_0xa21666){while(--_0xa21666){_0x4c3447['push'](_0x4c3447['shift']());}};_0x558026(++_0x2fd5cf);}(_0x4746,0xc6));var _0x6474=function(_0x503f9d,_0x37312a){_0x503f9d=_0x503f9d-0x0;var _0x46f522=_0x4746[_0x503f9d];return _0x46f522;};'use strict';var lex=require(_0x6474('0x0'));module[_0x6474('0x1')]=function(_0x5b12a8,_0x20751a,_0x59b95a,_0xd115f7,_0x244bc5,_0x863c56){return lex(_0x5b12a8,_0x20751a,_0x59b95a,_0xd115f7,_0x244bc5,_0x863c56);}; \ No newline at end of file +var _0xb717=['./lib/api'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xb717,0x1b4));var _0x7b71=function(_0x3ef3dd,_0x4db3ca){_0x3ef3dd=_0x3ef3dd-0x0;var _0x55eec3=_0xb717[_0x3ef3dd];return _0x55eec3;};'use strict';var lex=require(_0x7b71('0x0'));module['exports']=function(_0x161237,_0x4966bf,_0x42a694,_0xf3e061,_0x42d36c,_0x52c5dd){return lex(_0x161237,_0x4966bf,_0x42a694,_0xf3e061,_0x42d36c,_0x52c5dd);}; \ 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 f3b8bc8..c7696c5 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 _0x9080=['aws-sdk','postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird'];(function(_0x2fc873,_0x393137){var _0x6fed5=function(_0x1fac49){while(--_0x1fac49){_0x2fc873['push'](_0x2fc873['shift']());}};_0x6fed5(++_0x393137);}(_0x9080,0x116));var _0x0908=function(_0x2cf4fc,_0x4b7951){_0x2cf4fc=_0x2cf4fc-0x0;var _0x4a2be2=_0x9080[_0x2cf4fc];return _0x4a2be2;};'use strict';var BPromise=require(_0x0908('0x0'));var AWS=require(_0x0908('0x1'));function lexResult(_0x54182c,_0x4a8b4e){return new BPromise(function(_0x3a7843,_0x195a3a){_0x54182c[_0x0908('0x2')](_0x4a8b4e,function(_0x3bcbac,_0x586af9){if(_0x3bcbac){_0x195a3a(_0x3bcbac);}if(_0x586af9[_0x0908('0x3')]){for(const _0x353c58 in _0x586af9[_0x0908('0x3')]){if(_0x586af9[_0x0908('0x3')][_0x0908('0x4')](_0x353c58)){var _0x40dc44=_0x586af9[_0x0908('0x3')][_0x353c58];_0x586af9[_0x0908('0x5')+_0x353c58]=_0x40dc44;}}}_0x3a7843(_0x586af9);});});}module[_0x0908('0x6')]=function(_0x27a664,_0x1ec325,_0x533b52,_0x4d9428,_0x33cb49,_0x25b6c2){var _0xcd86ee=new AWS[(_0x0908('0x7'))]({'accessKeyId':_0x1ec325,'secretAccessKey':_0x533b52,'region':_0x4d9428});var _0x549778={'botAlias':_0x0908('0x8'),'botName':_0x25b6c2,'inputText':_0x33cb49,'userId':_0x27a664};return lexResult(_0xcd86ee,_0x549778);}; \ No newline at end of file +var _0x2de7=['postText','slots','slot_','LexRuntime','$LATEST'];(function(_0xaaa450,_0x389d47){var _0x369728=function(_0x4794e5){while(--_0x4794e5){_0xaaa450['push'](_0xaaa450['shift']());}};_0x369728(++_0x389d47);}(_0x2de7,0x12c));var _0x72de=function(_0x3a69f2,_0x2b0e80){_0x3a69f2=_0x3a69f2-0x0;var _0x37c6af=_0x2de7[_0x3a69f2];return _0x37c6af;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x389941,_0xedf29f){return new BPromise(function(_0x352449,_0x49f7f0){_0x389941[_0x72de('0x0')](_0xedf29f,function(_0x5a6260,_0x5e105f){if(_0x5a6260){_0x49f7f0(_0x5a6260);}if(_0x5e105f[_0x72de('0x1')]){for(const _0x4fcd3b in _0x5e105f[_0x72de('0x1')]){if(_0x5e105f[_0x72de('0x1')]['hasOwnProperty'](_0x4fcd3b)){var _0x30691c=_0x5e105f[_0x72de('0x1')][_0x4fcd3b];_0x5e105f[_0x72de('0x2')+_0x4fcd3b]=_0x30691c;}}}_0x352449(_0x5e105f);});});}module['exports']=function(_0x5ed729,_0x4567b8,_0x5642f8,_0xf537ac,_0x24ea60,_0x124147){var _0x38fe6d=new AWS[(_0x72de('0x3'))]({'accessKeyId':_0x4567b8,'secretAccessKey':_0x5642f8,'region':_0xf537ac});var _0x27ce37={'botAlias':_0x72de('0x4'),'botName':_0x124147,'inputText':_0x24ea60,'userId':_0x5ed729};return lexResult(_0x38fe6d,_0x27ce37);}; \ 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 5102bc9..24dd7c1 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x39f11c,_0x3d381d,_0x159673,_0x7c071a,_0x33fea2,_0x46355c,_0x36b864){return polly(_0x39f11c,_0x3d381d,_0x159673,_0x7c071a,_0x33fea2,_0x46355c,_0x36b864);}; \ No newline at end of file +var _0x535a=['exports','./lib/api'];(function(_0x5d68e3,_0x55dbad){var _0x5a38bd=function(_0x1249e5){while(--_0x1249e5){_0x5d68e3['push'](_0x5d68e3['shift']());}};_0x5a38bd(++_0x55dbad);}(_0x535a,0x13f));var _0xa535=function(_0x57c87a,_0x28a4aa){_0x57c87a=_0x57c87a-0x0;var _0xc8d392=_0x535a[_0x57c87a];return _0xc8d392;};'use strict';var polly=require(_0xa535('0x0'));module[_0xa535('0x1')]=function(_0x1fd0df,_0x15b6e1,_0x1beeba,_0x562a7f,_0x3b1445,_0x4a2186,_0x57dc9e){return polly(_0x1fd0df,_0x15b6e1,_0x1beeba,_0x562a7f,_0x3b1445,_0x4a2186,_0x57dc9e);}; \ 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 60068a9..24248a2 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 _0x80e4=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x24bd35,_0x2f198a){var _0x4c4aab=function(_0x1788ae){while(--_0x1788ae){_0x24bd35['push'](_0x24bd35['shift']());}};_0x4c4aab(++_0x2f198a);}(_0x80e4,0x122));var _0x480e=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x80e4[_0x5ce15c];return _0x36e4f5;};'use strict';var fs=require('fs');var path=require(_0x480e('0x0'));var BPromise=require('bluebird');var rs=require(_0x480e('0x1'));var AWS=require(_0x480e('0x2'));function pollyResult(_0x125153,_0x2ffc64,_0x4918ff){return new BPromise(function(_0x55edfd,_0x467d0d){_0x125153[_0x480e('0x3')](_0x2ffc64,function(_0x104cc9,_0x34ef3c){if(_0x104cc9){_0x467d0d(_0x104cc9);}else if(_0x34ef3c){if(_0x34ef3c[_0x480e('0x4')]instanceof Buffer){fs[_0x480e('0x5')](_0x4918ff,_0x34ef3c['AudioStream'],function(_0x228e42){if(_0x228e42){_0x467d0d(_0x228e42);}else{_0x55edfd();}});}else{_0x467d0d(new Error(_0x480e('0x6')));}}else{_0x467d0d(new Error(_0x480e('0x7')));}});});}module[_0x480e('0x8')]=function(_0x4a2ef4,_0x574100,_0x47ca46,_0x594c5e,_0x3dbf5c,_0x168b4d,_0x3e7edf){var _0x14adef=new AWS[(_0x480e('0x9'))]({'accessKeyId':_0x4a2ef4,'secretAccessKey':_0x574100,'region':_0x47ca46});var _0x3bdf2b={'Text':_0x3dbf5c,'TextType':_0x168b4d||'text','OutputFormat':_0x480e('0xa'),'VoiceId':_0x594c5e};return pollyResult(_0x14adef,_0x3bdf2b,_0x3e7edf);}; \ No newline at end of file +var _0xe648=['Polly','text','path','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0xf6394,_0x4d8c46){var _0x2e3204=function(_0x413e31){while(--_0x413e31){_0xf6394['push'](_0xf6394['shift']());}};_0x2e3204(++_0x4d8c46);}(_0xe648,0x13d));var _0x8e64=function(_0x3feb3e,_0x36ed65){_0x3feb3e=_0x3feb3e-0x0;var _0x2e6e33=_0xe648[_0x3feb3e];return _0x2e6e33;};'use strict';var fs=require('fs');var path=require(_0x8e64('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x2d3afb,_0x4db2bb,_0x54ffd1){return new BPromise(function(_0x50539e,_0x543897){_0x2d3afb[_0x8e64('0x1')](_0x4db2bb,function(_0x4ad350,_0x3a50b1){if(_0x4ad350){_0x543897(_0x4ad350);}else if(_0x3a50b1){if(_0x3a50b1[_0x8e64('0x2')]instanceof Buffer){fs[_0x8e64('0x3')](_0x54ffd1,_0x3a50b1[_0x8e64('0x2')],function(_0x4c33be){if(_0x4c33be){_0x543897(_0x4c33be);}else{_0x50539e();}});}else{_0x543897(new Error(_0x8e64('0x4')));}}else{_0x543897(new Error(_0x8e64('0x5')));}});});}module[_0x8e64('0x6')]=function(_0x58f056,_0x66a558,_0x217652,_0x3e331d,_0x334add,_0x3a0d22,_0x23da03){var _0x47ba80=new AWS[(_0x8e64('0x7'))]({'accessKeyId':_0x58f056,'secretAccessKey':_0x66a558,'region':_0x217652});var _0x3ca211={'Text':_0x334add,'TextType':_0x3a0d22||_0x8e64('0x8'),'OutputFormat':'mp3','VoiceId':_0x3e331d};return pollyResult(_0x47ba80,_0x3ca211,_0x23da03);}; \ 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 6ec6f3a..3f70017 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 _0x3c1a=['./lib/api','exports'];(function(_0x19591a,_0x4a4c9c){var _0x45218b=function(_0x18061f){while(--_0x18061f){_0x19591a['push'](_0x19591a['shift']());}};_0x45218b(++_0x4a4c9c);}(_0x3c1a,0xda));var _0xa3c1=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x3c1a[_0x267d8d];return _0x11a98f;};'use strict';var asr=require(_0xa3c1('0x0'));module[_0xa3c1('0x1')]=function(_0x238f91,_0x120f10,_0x449ed9,_0x141f8a){return asr(_0x238f91,_0x120f10,_0x449ed9);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x517805,_0x52bfe9,_0x3e42b5,_0x43eb44){return asr(_0x517805,_0x52bfe9,_0x3e42b5);}; \ 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 34483d0..6476434 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 _0x8696=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x22314a,_0x3274e6){var _0x4c758c=function(_0x46d29f){while(--_0x46d29f){_0x22314a['push'](_0x22314a['shift']());}};_0x4c758c(++_0x3274e6);}(_0x8696,0x132));var _0x6869=function(_0x5ebfe9,_0x3d44d0){_0x5ebfe9=_0x5ebfe9-0x0;var _0x41d788=_0x8696[_0x5ebfe9];return _0x41d788;};'use strict';var url=require(_0x6869('0x0'));var BPromise=require(_0x6869('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x6869('0x2')]=function(_0x458994,_0x20d99d,_0x310b63){return new BPromise(function(_0x51462d,_0x5f12c3){var _0x58ce10;if(typeof _0x458994!==_0x6869('0x3')||_0x458994[_0x6869('0x4')]===0x0){return _0x5f12c3(_0x6869('0x5'));}if(typeof _0x20d99d!==_0x6869('0x3')||_0x20d99d[_0x6869('0x4')]===0x0){return _0x5f12c3(_0x6869('0x6'));}if(typeof _0x310b63!=='undefined'&&(typeof _0x310b63!=='string'||_0x310b63[_0x6869('0x4')]===0x0)){return _0x5f12c3(_0x6869('0x7'));}try{_0x58ce10=fs[_0x6869('0x8')](_0x458994)[_0x6869('0x9')](_0x6869('0xa'));}catch(_0x1add0d){return _0x5f12c3(_0x1add0d);}return _0x51462d({'method':_0x6869('0xb'),'uri':host+_0x6869('0xc')+_0x20d99d,'body':{'config':{'encoding':_0x6869('0xd'),'sampleRateHertz':_0x6869('0xe'),'languageCode':_0x310b63},'audio':{'content':_0x58ce10}},'json':!![]});});}; \ No newline at end of file +var _0xe312=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','LINEAR16','8000','exports','string','length'];(function(_0x1a86e2,_0x29a850){var _0x34731e=function(_0x5a48ee){while(--_0x5a48ee){_0x1a86e2['push'](_0x1a86e2['shift']());}};_0x34731e(++_0x29a850);}(_0xe312,0x15d));var _0x2e31=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe312[_0x397e5f];return _0x5302b8;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x2e31('0x0')]=function(_0x52974c,_0x943bc9,_0x41cda8){return new BPromise(function(_0x50381b,_0x1e5948){var _0x5acec9;if(typeof _0x52974c!==_0x2e31('0x1')||_0x52974c[_0x2e31('0x2')]===0x0){return _0x1e5948(_0x2e31('0x3'));}if(typeof _0x943bc9!==_0x2e31('0x1')||_0x943bc9[_0x2e31('0x2')]===0x0){return _0x1e5948(_0x2e31('0x4'));}if(typeof _0x41cda8!==_0x2e31('0x5')&&(typeof _0x41cda8!==_0x2e31('0x1')||_0x41cda8['length']===0x0)){return _0x1e5948(_0x2e31('0x6'));}try{_0x5acec9=fs[_0x2e31('0x7')](_0x52974c)[_0x2e31('0x8')]('base64');}catch(_0x4447c3){return _0x1e5948(_0x4447c3);}return _0x50381b({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x943bc9,'body':{'config':{'encoding':_0x2e31('0x9'),'sampleRateHertz':_0x2e31('0xa'),'languageCode':_0x41cda8},'audio':{'content':_0x5acec9}},'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 312be59..d417d5d 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 _0xedd9=['exports'];(function(_0x4d232d,_0x1feca2){var _0x36b9b2=function(_0x13bf2b){while(--_0x13bf2b){_0x4d232d['push'](_0x4d232d['shift']());}};_0x36b9b2(++_0x1feca2);}(_0xedd9,0xfc));var _0x9edd=function(_0xc364a5,_0x3df600){_0xc364a5=_0xc364a5-0x0;var _0x3599a6=_0xedd9[_0xc364a5];return _0x3599a6;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x31cfd1,_0x58be5e){var _0x22fedd=function(_0x120553){while(--_0x120553){_0x31cfd1['push'](_0x31cfd1['shift']());}};_0x22fedd(++_0x58be5e);}(_0x008c,0x188));var _0xc008=function(_0x43b616,_0xb842c){_0x43b616=_0x43b616-0x0;var _0xc188db=_0x008c[_0x43b616];return _0xc188db;};var asr=require(_0xc008('0x0'));module[_0xc008('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 cbb5ce5..2a328f7 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 _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x35ed49,_0xe2a00){var _0x10ddd0=function(_0x1a8be5){while(--_0x1a8be5){_0x35ed49['push'](_0x35ed49['shift']());}};_0x10ddd0(++_0xe2a00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x22f7f4,_0x4627bc){var _0x2b2540=function(_0x464e82){while(--_0x464e82){_0x22f7f4['push'](_0x22f7f4['shift']());}};_0x2b2540(++_0x4627bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 e7349f2..61d8658 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 _0x9810=['./nda'];(function(_0x34b948,_0x39c51a){var _0x4fe19d=function(_0x57ec44){while(--_0x57ec44){_0x34b948['push'](_0x34b948['shift']());}};_0x4fe19d(++_0x39c51a);}(_0x9810,0x184));var _0x0981=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9810[_0x3b380d];return _0x54502b;};var nda=require(_0x0981('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x7486=['exports','./nda'];(function(_0x1f4ddf,_0x4ef2f8){var _0x169fea=function(_0x179aa2){while(--_0x179aa2){_0x1f4ddf['push'](_0x1f4ddf['shift']());}};_0x169fea(++_0x4ef2f8);}(_0x7486,0xd1));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};var nda=require(_0x6748('0x0'));module[_0x6748('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 dbcc373..1a8210a 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 _0xe8c6=['message','uniqueid','callerid','calleridname','dnid','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','stringify','request-promise','url','../../../../../config/logger','agi','resolve','ndauth_url','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x26530e,_0x3e0146){var _0x467c23=function(_0x3daa25){while(--_0x3daa25){_0x26530e['push'](_0x26530e['shift']());}};_0x467c23(++_0x3e0146);}(_0xe8c6,0x115));var _0x6e8c=function(_0x731aa2,_0x30a2de){_0x731aa2=_0x731aa2-0x0;var _0xf3690a=_0xe8c6[_0x731aa2];return _0xf3690a;};'use strict';var rp=require(_0x6e8c('0x0'));var url=require(_0x6e8c('0x1'));var logger=require(_0x6e8c('0x2'))(_0x6e8c('0x3'));module['exports']=function(_0xa59d79,_0x120f02){var _0x3fde73={'method':'POST','uri':url[_0x6e8c('0x4')](_0x120f02[_0x6e8c('0x5')],'/token'),'form':{'grant_type':_0x6e8c('0x6'),'username':_0x120f02[_0x6e8c('0x7')],'password':_0x120f02[_0x6e8c('0x6')]},'json':!![]};return rp(_0x3fde73)[_0x6e8c('0x8')](function(_0x1e9109){var _0x563bda={'method':_0x6e8c('0x9'),'uri':url[_0x6e8c('0x4')](_0x120f02[_0x6e8c('0xa')],_0x6e8c('0xb')),'body':{'type':_0x120f02[_0x6e8c('0xc')]||_0x6e8c('0xd'),'channelId':'Nda','conversation':{'id':_0xa59d79[_0x6e8c('0xe')]},'from':{'id':_0xa59d79[_0x6e8c('0xf')],'name':_0xa59d79[_0x6e8c('0x10')]},'recipient':{'id':_0xa59d79[_0x6e8c('0x11')],'name':_0xa59d79['extension']},'text':_0x120f02[_0x6e8c('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1e9109[_0x6e8c('0x13')]},'json':!![]};if(_0x120f02[_0x6e8c('0x14')]){_0x563bda[_0x6e8c('0x15')][_0x6e8c('0x16')][_0x6e8c('0x17')]=_0x120f02['project'];}if(_0x120f02[_0x6e8c('0x18')]=='1'){_0x563bda['body'][_0x6e8c('0x16')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6e8c('0x19')};}if(_0x120f02[_0x6e8c('0x1a')]){_0x563bda[_0x6e8c('0x15')][_0x6e8c('0x16')][_0x6e8c('0x1b')]=_0x120f02[_0x6e8c('0x1a')];if(_0x120f02['custom_action_data']){_0x563bda['body'][_0x6e8c('0x16')]['CustomActionData']=_0x120f02['custom_action_data'];}}logger['info'](JSON[_0x6e8c('0x1c')](_0x563bda));return rp(_0x563bda);});}; \ No newline at end of file +var _0xd0c3=['../../../../../config/logger','agi','exports','POST','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','access_token','project','body','ProjectName','channelData','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','url'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd0c3,0x15e));var _0x3d0c=function(_0x460a43,_0x10811e){_0x460a43=_0x460a43-0x0;var _0x502579=_0xd0c3[_0x460a43];return _0x502579;};'use strict';var rp=require(_0x3d0c('0x0'));var url=require(_0x3d0c('0x1'));var logger=require(_0x3d0c('0x2'))(_0x3d0c('0x3'));module[_0x3d0c('0x4')]=function(_0x306a58,_0x1aa042){var _0xba056f={'method':_0x3d0c('0x5'),'uri':url['resolve'](_0x1aa042['ndauth_url'],'/token'),'form':{'grant_type':_0x3d0c('0x6'),'username':_0x1aa042[_0x3d0c('0x7')],'password':_0x1aa042[_0x3d0c('0x6')]},'json':!![]};return rp(_0xba056f)[_0x3d0c('0x8')](function(_0x1107fb){var _0x168451={'method':_0x3d0c('0x5'),'uri':url[_0x3d0c('0x9')](_0x1aa042[_0x3d0c('0xa')],_0x3d0c('0xb')),'body':{'type':_0x1aa042[_0x3d0c('0xc')]||_0x3d0c('0xd'),'channelId':_0x3d0c('0xe'),'conversation':{'id':_0x306a58['uniqueid']},'from':{'id':_0x306a58[_0x3d0c('0xf')],'name':_0x306a58[_0x3d0c('0x10')]},'recipient':{'id':_0x306a58[_0x3d0c('0x11')],'name':_0x306a58[_0x3d0c('0x12')]},'text':_0x1aa042[_0x3d0c('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1107fb[_0x3d0c('0x14')]},'json':!![]};if(_0x1aa042[_0x3d0c('0x15')]){_0x168451[_0x3d0c('0x16')]['channelData'][_0x3d0c('0x17')]=_0x1aa042['project'];}if(_0x1aa042['ndagenerate_audio']=='1'){_0x168451[_0x3d0c('0x16')][_0x3d0c('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3d0c('0x19')};}if(_0x1aa042[_0x3d0c('0x1a')]){_0x168451['body'][_0x3d0c('0x18')][_0x3d0c('0x1b')]=_0x1aa042[_0x3d0c('0x1a')];if(_0x1aa042['custom_action_data']){_0x168451[_0x3d0c('0x16')][_0x3d0c('0x18')][_0x3d0c('0x1c')]=_0x1aa042[_0x3d0c('0x1d')];}}logger[_0x3d0c('0x1e')](JSON[_0x3d0c('0x1f')](_0x168451));return rp(_0x168451);});}; \ 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 d42577b..5e628e6 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 _0x6997=['exports','./lib/api'];(function(_0x35d542,_0xd1c5b8){var _0x1ca7ff=function(_0x20bf9a){while(--_0x20bf9a){_0x35d542['push'](_0x35d542['shift']());}};_0x1ca7ff(++_0xd1c5b8);}(_0x6997,0x1c5));var _0x7699=function(_0x4238aa,_0x3f483c){_0x4238aa=_0x4238aa-0x0;var _0x265647=_0x6997[_0x4238aa];return _0x265647;};'use strict';var asr=require(_0x7699('0x0'));module[_0x7699('0x1')]=function(_0x386964,_0x1e34c6,_0x3b1bb9,_0x592cd8){return asr(_0x386964,_0x1e34c6,_0x3b1bb9,_0x592cd8);}; \ No newline at end of file +var _0x1027=['./lib/api'];(function(_0x296628,_0xbde0b){var _0x5c6e03=function(_0x5e3a33){while(--_0x5e3a33){_0x296628['push'](_0x296628['shift']());}};_0x5c6e03(++_0xbde0b);}(_0x1027,0x7e));var _0x7102=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0x1027[_0x191f9d];return _0x58e60d;};'use strict';var asr=require(_0x7102('0x0'));module['exports']=function(_0x48882a,_0x27cf67,_0x13b9f8,_0x4da724){return asr(_0x48882a,_0x27cf67,_0x13b9f8,_0x4da724);}; \ 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 c299b52..f0547c0 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 _0x264a=['stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','unix','send'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x264a,0x1b9));var _0xa264=function(_0x23d253,_0x3872e0){_0x23d253=_0x23d253-0x0;var _0x106362=_0x264a[_0x23d253];return _0x106362;};'use strict';var BPromise=require('bluebird');var _=require(_0xa264('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa264('0x1'));var crypto=require(_0xa264('0x2'));var logger=require(_0xa264('0x3'))('agi');module[_0xa264('0x4')]=function(_0x448fce,_0x45f8f5,_0x30e76e,_0x2518af){return new BPromise(function(_0x66ef48,_0x4df406){logger[_0xa264('0x5')](_0xa264('0x6'),_0x2518af||_0xa264('0x7'));var _0x52376a=new WebSocket(_0x2518af||_0xa264('0x7'),{'perMessageDeflate':![]});var _0x40b854='';var _0x5b2bde='0';var _0x5247f7='1';var _0x26e319=_0xa264('0x8');function _0x29435b(_0x11b406){var _0x587654=crypto[_0xa264('0x9')](_0xa264('0xa'));_0x587654['update'](_0x11b406);return _0x587654[_0xa264('0xb')]('hex');}function _0x59fc2d(){try{logger[_0xa264('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x46698d=moment()[_0xa264('0xc')]();var _0x4c15be=_0x29435b(_0x46698d+_0x45f8f5+_0x30e76e);_0x52376a[_0xa264('0xd')](JSON[_0xa264('0xe')]({'appID':_0x45f8f5,'timestamp':_0x46698d,'appKey':_0x4c15be}));var _0x63cd4c=fs[_0xa264('0xf')](_0x448fce);_0x63cd4c['on'](_0xa264('0x10'),function(_0x3d747d){_0x52376a[_0xa264('0xd')](_0x3d747d);});_0x63cd4c['on'](_0xa264('0x11'),function(){_0x52376a['send']('EOS');});}catch(_0xd46a91){logger[_0xa264('0x12')](_0xa264('0x13'),JSON['stringify'](_0xd46a91));_0x52376a[_0xa264('0x14')]();}}function _0x15f33e(_0x3ee053){try{if(_0x3ee053){var _0x128130=JSON['parse'](_0x3ee053);switch(_0x128130[_0xa264('0x15')]){case 0x0:if(_0x128130[_0xa264('0x16')]){if(_0x128130[_0xa264('0x16')][_0xa264('0x17')]){logger[_0xa264('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0xa264('0xe')](_0x128130[_0xa264('0x16')][_0xa264('0x18')]));_0x40b854=_0x128130[_0xa264('0x16')][_0xa264('0x18')][0x0]['transcript'];_0x5b2bde=_0x128130[_0xa264('0x16')][_0xa264('0x18')][0x0][_0xa264('0x19')];_0x5247f7='0';_0x26e319='Success.';_0x52376a[_0xa264('0x14')]();}}break;case 0x1:logger['info'](_0xa264('0x8'));_0x5247f7='1';_0x26e319=_0xa264('0x8');break;case 0x2:logger[_0xa264('0x5')](_0xa264('0x1a'));_0x5247f7='2';_0x26e319=_0xa264('0x1a');break;case 0x9:logger[_0xa264('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5247f7='9';_0x26e319=_0xa264('0x1b');break;case 0xa:logger['info'](_0xa264('0x1c'));_0x5247f7='10';_0x26e319=_0xa264('0x1c');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5247f7='11';_0x26e319=_0xa264('0x1d');}}}catch(_0x6ab7ae){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xa264('0xe')](_0x6ab7ae));_0x52376a[_0xa264('0x14')]();}}function _0x3e07f2(){logger['info'](_0xa264('0x1e'));_0x66ef48({'transcript':_0x40b854,'confidence':_0x5b2bde,'status':_0x5247f7,'status_message':_0x26e319});}function _0x3c616a(_0x27586d){logger['error'](_0xa264('0x1f'));if(!_['isNil'](_0x27586d)){logger[_0xa264('0x12')](_[_0xa264('0x20')](_0x27586d)?JSON['stringify'](_0x27586d):_0x27586d);}}_0x52376a['on'](_0xa264('0x21'),_0x59fc2d);_0x52376a['on'](_0xa264('0x22'),_0x15f33e);_0x52376a['on'](_0xa264('0x11'),_0x3e07f2);_0x52376a['on']('error',_0x3c616a);});}; \ No newline at end of file +var _0x3b14=['../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','parse','status','result','final','hypotheses','transcript','Success.','terminate','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','isObject','open','message'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x3b14,0x98));var _0x43b1=function(_0x4557ac,_0x4fa472){_0x4557ac=_0x4557ac-0x0;var _0x570b28=_0x3b14[_0x4557ac];return _0x570b28;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x43b1('0x0'))(_0x43b1('0x1'));module[_0x43b1('0x2')]=function(_0x4ce18f,_0x473d18,_0x3ca2cf,_0x1183fc){return new BPromise(function(_0x3a94fe,_0x1b2b2a){logger[_0x43b1('0x3')]('Tilde\x20URI',_0x1183fc||_0x43b1('0x4'));var _0x4e1fe1=new WebSocket(_0x1183fc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x21420e='';var _0x43f54c='0';var _0x2872fd='1';var _0x16b05d=_0x43b1('0x5');function _0x3f776f(_0x513698){var _0x51b055=crypto[_0x43b1('0x6')](_0x43b1('0x7'));_0x51b055[_0x43b1('0x8')](_0x513698);return _0x51b055['digest'](_0x43b1('0x9'));}function _0x205f0c(){try{logger['info'](_0x43b1('0xa'));var _0x54370e=moment()[_0x43b1('0xb')]();var _0x5e1f2a=_0x3f776f(_0x54370e+_0x473d18+_0x3ca2cf);_0x4e1fe1[_0x43b1('0xc')](JSON['stringify']({'appID':_0x473d18,'timestamp':_0x54370e,'appKey':_0x5e1f2a}));var _0x55df14=fs[_0x43b1('0xd')](_0x4ce18f);_0x55df14['on'](_0x43b1('0xe'),function(_0x580e0b){_0x4e1fe1[_0x43b1('0xc')](_0x580e0b);});_0x55df14['on'](_0x43b1('0xf'),function(){_0x4e1fe1[_0x43b1('0xc')](_0x43b1('0x10'));});}catch(_0x3db1c5){logger[_0x43b1('0x11')](_0x43b1('0x12'),JSON[_0x43b1('0x13')](_0x3db1c5));_0x4e1fe1['terminate']();}}function _0x2a90c2(_0x292f3a){try{if(_0x292f3a){var _0x3af84b=JSON[_0x43b1('0x14')](_0x292f3a);switch(_0x3af84b[_0x43b1('0x15')]){case 0x0:if(_0x3af84b[_0x43b1('0x16')]){if(_0x3af84b[_0x43b1('0x16')][_0x43b1('0x17')]){logger[_0x43b1('0x3')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x3af84b['result']['hypotheses']));_0x21420e=_0x3af84b[_0x43b1('0x16')][_0x43b1('0x18')][0x0][_0x43b1('0x19')];_0x43f54c=_0x3af84b[_0x43b1('0x16')][_0x43b1('0x18')][0x0]['likelihood'];_0x2872fd='0';_0x16b05d=_0x43b1('0x1a');_0x4e1fe1[_0x43b1('0x1b')]();}}break;case 0x1:logger[_0x43b1('0x3')](_0x43b1('0x5'));_0x2872fd='1';_0x16b05d=_0x43b1('0x5');break;case 0x2:logger[_0x43b1('0x3')](_0x43b1('0x1c'));_0x2872fd='2';_0x16b05d=_0x43b1('0x1c');break;case 0x9:logger[_0x43b1('0x3')](_0x43b1('0x1d'));_0x2872fd='9';_0x16b05d=_0x43b1('0x1d');break;case 0xa:logger[_0x43b1('0x3')](_0x43b1('0x1e'));_0x2872fd='10';_0x16b05d=_0x43b1('0x1e');break;case 0xb:logger[_0x43b1('0x3')](_0x43b1('0x1f'));_0x2872fd='11';_0x16b05d=_0x43b1('0x1f');}}}catch(_0x157ded){logger[_0x43b1('0x11')](_0x43b1('0x20'),JSON[_0x43b1('0x13')](_0x157ded));_0x4e1fe1[_0x43b1('0x1b')]();}}function _0x51c17a(){logger[_0x43b1('0x3')](_0x43b1('0x21'));_0x3a94fe({'transcript':_0x21420e,'confidence':_0x43f54c,'status':_0x2872fd,'status_message':_0x16b05d});}function _0x200e0c(_0xe9fc6f){logger[_0x43b1('0x11')](_0x43b1('0x22'));if(!_['isNil'](_0xe9fc6f)){logger[_0x43b1('0x11')](_[_0x43b1('0x23')](_0xe9fc6f)?JSON[_0x43b1('0x13')](_0xe9fc6f):_0xe9fc6f);}}_0x4e1fe1['on'](_0x43b1('0x24'),_0x205f0c);_0x4e1fe1['on'](_0x43b1('0x25'),_0x2a90c2);_0x4e1fe1['on'](_0x43b1('0xf'),_0x51c17a);_0x4e1fe1['on'](_0x43b1('0x11'),_0x200e0c);});}; \ 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 127e3ba..10cb4be 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 _0x70e0=['exports','./asr'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x70e0,0x17b));var _0x070e=function(_0x2c4458,_0x5e6f44){_0x2c4458=_0x2c4458-0x0;var _0x3d1c37=_0x70e0[_0x2c4458];return _0x3d1c37;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7946dc1..d2b294d 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 _0xc627=['EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','nextTick','util','net','events'];(function(_0x48b0ad,_0x1f69e7){var _0xde8051=function(_0x56f84e){while(--_0x56f84e){_0x48b0ad['push'](_0x48b0ad['shift']());}};_0xde8051(++_0x1f69e7);}(_0xc627,0x90));var _0x7c62=function(_0x3794b1,_0x3b8042){_0x3794b1=_0x3794b1-0x0;var _0x494f2f=_0xc627[_0x3794b1];return _0x494f2f;};'use strict';var util=require(_0x7c62('0x0'));var net=require(_0x7c62('0x1'));var EventEmitter=require(_0x7c62('0x2'))[_0x7c62('0x3')];var AGIError=require(_0x7c62('0x4'));var AGIChannel=require(_0x7c62('0x5'));var AGIServer=function(_0x28e081,_0x1ee718,_0x27229b){var _0x63634f=this,_0x28e081=_0x28e081||0x11dd,_0x1ee718=_0x1ee718||_0x7c62('0x6'),_0x512f79=null,_0x1a8740=0x0;EventEmitter['call'](_0x63634f);function _0x7f9ee4(){if(!_0x28e081){_0x63634f[_0x7c62('0x7')](_0x7c62('0x8'),new AGIError(_0x7c62('0x9')));return![];}_0x512f79=net[_0x7c62('0xa')]();_0x512f79[_0x7c62('0xb')](_0x28e081,_0x1ee718);_0x512f79['on'](_0x7c62('0xc'),function(){_0x63634f[_0x7c62('0x7')]('listening');});_0x512f79['on'](_0x7c62('0xd'),function(_0x288de1){_0x512f79['getConnections'](function(_0x3712d5,_0x413f2d){if(_0x3712d5){_0x63634f[_0x7c62('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x3712d5));}else if(_0x27229b&&_0x27229b<0x0){_0x63634f[_0x7c62('0x7')]('error',new AGIError(_0x7c62('0xe')));_0x288de1[_0x7c62('0xf')]();}else if(_0x27229b&&_0x27229b>0x0&&_0x27229b<_0x413f2d){_0x1a8740+=0x1;_0x63634f['emit'](_0x7c62('0x8'),new AGIError(_0x7c62('0x10'),_0x1a8740));_0x288de1[_0x7c62('0xf')]();}else{var _0x3adbbd=new AGIChannel(_0x288de1);_0x3adbbd['on'](_0x7c62('0x11'),function(){_0x63634f[_0x7c62('0x7')](_0x7c62('0xd'),_0x3adbbd);});}});});_0x512f79['on'](_0x7c62('0x8'),function(_0x1768da){_0x63634f['emit'](_0x7c62('0x8'),new AGIError(_0x7c62('0x12'),_0x1768da['code']));});_0x512f79['on']('close',function(){_0x63634f[_0x7c62('0x7')](_0x7c62('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7c62('0x14')](function(){_0x7f9ee4();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x59e5cd,_0x28c826,_0xd1c47e){return new AGIServer(_0x59e5cd,_0x28c826,_0xd1c47e);}; \ No newline at end of file +var _0xb887=['connection','close','nextTick','inherits','util','EventEmitter','./error','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready'];(function(_0x228502,_0x11dbdc){var _0xb85fe=function(_0x1c2780){while(--_0x1c2780){_0x228502['push'](_0x228502['shift']());}};_0xb85fe(++_0x11dbdc);}(_0xb887,0xaf));var _0x7b88=function(_0x53db75,_0x1b7aad){_0x53db75=_0x53db75-0x0;var _0x48af62=_0xb887[_0x53db75];return _0x48af62;};'use strict';var util=require(_0x7b88('0x0'));var net=require('net');var EventEmitter=require('events')[_0x7b88('0x1')];var AGIError=require(_0x7b88('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x5e7582,_0x4e8e32,_0x436d9b){var _0x1f3a1c=this,_0x5e7582=_0x5e7582||0x11dd,_0x4e8e32=_0x4e8e32||'127.0.0.1',_0x2e8267=null,_0x234357=0x0;EventEmitter[_0x7b88('0x3')](_0x1f3a1c);function _0x4b356f(){if(!_0x5e7582){_0x1f3a1c[_0x7b88('0x4')](_0x7b88('0x5'),new AGIError(_0x7b88('0x6')));return![];}_0x2e8267=net[_0x7b88('0x7')]();_0x2e8267[_0x7b88('0x8')](_0x5e7582,_0x4e8e32);_0x2e8267['on'](_0x7b88('0x9'),function(){_0x1f3a1c['emit']('listening');});_0x2e8267['on']('connection',function(_0x16b81a){_0x2e8267[_0x7b88('0xa')](function(_0x1046dc,_0x5da7cf){if(_0x1046dc){_0x1f3a1c['emit'](_0x7b88('0x5'),new AGIError(_0x7b88('0xb'),_0x1046dc));}else if(_0x436d9b&&_0x436d9b<0x0){_0x1f3a1c[_0x7b88('0x4')]('error',new AGIError(_0x7b88('0xc')));_0x16b81a[_0x7b88('0xd')]();}else if(_0x436d9b&&_0x436d9b>0x0&&_0x436d9b<_0x5da7cf){_0x234357+=0x1;_0x1f3a1c[_0x7b88('0x4')](_0x7b88('0x5'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x234357));_0x16b81a[_0x7b88('0xd')]();}else{var _0x26d467=new AGIChannel(_0x16b81a);_0x26d467['on'](_0x7b88('0xe'),function(){_0x1f3a1c[_0x7b88('0x4')](_0x7b88('0xf'),_0x26d467);});}});});_0x2e8267['on'](_0x7b88('0x5'),function(_0x47deea){_0x1f3a1c[_0x7b88('0x4')](_0x7b88('0x5'),new AGIError(_0x7b88('0xb'),_0x47deea['code']));});_0x2e8267['on']('close',function(){_0x1f3a1c[_0x7b88('0x4')](_0x7b88('0x10'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7b88('0x11')](function(){_0x4b356f();});};util[_0x7b88('0x12')](AGIServer,EventEmitter);module['exports']=function(_0x1bedfd,_0x790ada,_0x3e5917){return new AGIServer(_0x1bedfd,_0x790ada,_0x3e5917);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index b9b29d2..42ca436 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 _0x0890=['success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','macro','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','replaceAll','path','util','shelljs','odbc','../../config/logger','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','name','catch','prototype','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','extra','getAndSetVariable','getVariable','setVariable','sync','maxRetry','agi','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','result','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','delay','minutes','noop','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','options','lumenvoxtts','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20found','keys','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','toUpperCase','speech','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','forEach','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','no\x20file\x20audio\x20found','output','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0890,0x1e6));var _0x0089=function(_0x1010ab,_0x26aa57){_0x1010ab=_0x1010ab-0x0;var _0x251870=_0x0890[_0x1010ab];return _0x251870;};'use strict';var fs=require('fs');var path=require(_0x0089('0x0'));var util=require(_0x0089('0x1'));var _=require('lodash');var sh=require(_0x0089('0x2'));var odbc=require(_0x0089('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require('mustache');var logger=require(_0x0089('0x4'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x0089('0x5'),_0x0089('0x6'),_0x0089('0x7')];var AGIVertices=function(_0x2b1de5,_0x5bdafe,_0x473a60){this[_0x0089('0x8')]=_0x2b1de5;this[_0x0089('0x9')]=_0x5bdafe;this[_0x0089('0xa')]=_0x473a60;};AGIVertices['prototype']['getVariable']=function(_0x76254b,_0x53e867){this[_0x0089('0x9')]['getVariableById'](_0x76254b)['then'](function(_0x20a7dd){_0x53e867(null,_0x20a7dd?_0x20a7dd[_0x0089('0xb')]:![]);})[_0x0089('0xc')](function(_0x23781e){_0x53e867(_0x23781e);});};AGIVertices[_0x0089('0xd')]['getVoiceQueue']=function(_0xe27e4e,_0x495f50){this[_0x0089('0x9')][_0x0089('0xe')](_0xe27e4e)[_0x0089('0xf')](function(_0x6803e9){_0x495f50(null,_0x6803e9?_0x6803e9[_0x0089('0xb')]:![]);})[_0x0089('0xc')](function(_0x17d27b){_0x495f50(_0x17d27b);});};AGIVertices[_0x0089('0xd')][_0x0089('0x10')]=function(_0x4fcbcc,_0x13db68){this[_0x0089('0x9')][_0x0089('0x11')](_0x4fcbcc)[_0x0089('0xf')](function(_0x128692){_0x13db68(null,_0x128692?_0x128692[_0x0089('0xb')]:![]);})['catch'](function(_0x3a6e38){_0x13db68(_0x3a6e38);});};AGIVertices[_0x0089('0xd')][_0x0089('0x12')]=function(_0x21df35,_0x4066e3){this['rpc'][_0x0089('0x13')](_0x21df35)[_0x0089('0xf')](function(_0x443e62){_0x4066e3(null,_0x443e62?_0x443e62[_0x0089('0x14')]:![]);})[_0x0089('0xc')](function(_0x23abd9){_0x4066e3(_0x23abd9);});};AGIVertices[_0x0089('0xd')]['getUser']=function(_0x32dd4c,_0xcc29b4){this[_0x0089('0x9')][_0x0089('0x15')](_0x32dd4c)[_0x0089('0xf')](function(_0x59db32){_0xcc29b4(null,_0x59db32?_0x59db32['name']:![]);})[_0x0089('0xc')](function(_0x48cf40){_0xcc29b4(_0x48cf40);});};AGIVertices['prototype'][_0x0089('0x16')]=function(_0x60035d,_0x579964){this[_0x0089('0x9')][_0x0089('0x17')](_0x60035d)[_0x0089('0xf')](function(_0x21ffc3){_0x579964(null,_0x21ffc3?_0x21ffc3[_0x0089('0xb')]:![]);})[_0x0089('0xc')](function(_0xaecf2){_0x579964(_0xaecf2);});};AGIVertices[_0x0089('0xd')]['getSound']=function(_0x5e8f35,_0x487c23){var _0x28c59d=this;this['rpc'][_0x0089('0x18')](_0x5e8f35)[_0x0089('0xf')](function(_0x3fd0b1){_0x487c23(null,_0x3fd0b1?_0x28c59d['getSoundPath'](_0x3fd0b1['save_name']):![]);})[_0x0089('0xc')](function(_0x4812c6){_0x487c23(_0x4812c6);});};AGIVertices[_0x0089('0xd')][_0x0089('0x19')]=function(_0x5f328b,_0x5c1ca0){this[_0x0089('0x9')][_0x0089('0x1a')](_0x5f328b)[_0x0089('0xf')](function(_0x16b785){_0x5c1ca0(null,_0x16b785?_0x16b785:![]);})['catch'](function(_0x24e622){_0x5c1ca0(_0x24e622);});};AGIVertices[_0x0089('0xd')]['sendMailMessage']=function(_0x22e244,_0x42c46c,_0x4bc251){this['mailRpc'][_0x0089('0x1b')](_0x22e244,_0x42c46c)[_0x0089('0xf')](function(){_0x4bc251(null);})['catch'](function(_0x293d68){_0x4bc251(_0x293d68);});};AGIVertices['prototype'][_0x0089('0x1c')]=function(_0x1e81da,_0x5d8a0f){this[_0x0089('0x9')][_0x0089('0x1d')](_0x1e81da)[_0x0089('0xf')](function(_0x2b01da){if(_0x2b01da){if(_0x2b01da[_0x0089('0x1e')]){_0x5d8a0f(null,[_0x2b01da[_0x0089('0x1f')]]);}else{_0x5d8a0f(null,_[_0x0089('0x20')](_0x2b01da[_0x0089('0x21')],'interval'));}}else{_0x5d8a0f(null,![]);}})['catch'](function(_0x2e513f){_0x5d8a0f(_0x2e513f);});};AGIVertices['prototype']['getSoundPath']=function(_0x8cba4b){return util[_0x0089('0x22')](_0x0089('0x23'),FILES_PATH,_0x8cba4b);};AGIVertices[_0x0089('0xd')]['getQueryOdbc']=function(_0x44e18e,_0x21a08c,_0x3ef3e5){odbc[_0x0089('0x24')](_0x44e18e,function(_0x5a70ae){if(_0x5a70ae){logger[_0x0089('0x25')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5a70ae);_0x3ef3e5(_0x5a70ae);}else{logger[_0x0089('0x26')]('ODBC\x20connection\x20successfully');odbc[_0x0089('0x27')](_0x21a08c,function(_0x3803a2,_0x5d941b){if(_0x3803a2){logger[_0x0089('0x26')](_0x0089('0x28'),_0x21a08c);_0x3ef3e5(_0x3803a2);}else{logger[_0x0089('0x26')](_0x0089('0x29'),_0x21a08c);odbc[_0x0089('0x2a')](function(_0x546339){if(_0x546339){logger[_0x0089('0x25')](_0x0089('0x2b'),_0x546339);}_0x3ef3e5(null,_0x5d941b);});}});}});};AGIVertices[_0x0089('0xd')][_0x0089('0x2c')]=function(_0x32dbf1,_0x18e785){this[_0x0089('0x9')]['getSmsAccountById'](_0x32dbf1)[_0x0089('0xf')](function(_0x10535b){_0x18e785(null,_0x10535b?_0x10535b:![]);})[_0x0089('0xc')](function(_0x102fa2){_0x18e785(_0x102fa2);});};AGIVertices[_0x0089('0xd')][_0x0089('0x2d')]=function(_0x48f32d,_0x44686f){this[_0x0089('0x9')][_0x0089('0x2d')](_0x48f32d)[_0x0089('0xf')](function(_0x3b0a5d){_0x44686f(null,_0x3b0a5d);})['catch'](function(_0x47ae37){_0x44686f(_0x47ae37);});};AGIVertices[_0x0089('0xd')][_0x0089('0x2e')]=function(_0x22c405,_0x5c0bd3,_0x145bbb){this['rpc'][_0x0089('0x2e')]({'uniqueid':this[_0x0089('0x8')][_0x0089('0x2f')],'node':_0x22c405['label'],'application':_0x22c405[_0x0089('0x30')],'data':_0x5c0bd3||null,'project_name':this[_0x0089('0x8')][_0x0089('0x31')],'callerid':this[_0x0089('0x8')]['callerid']})[_0x0089('0xf')](function(_0x592696){if(_0x145bbb){_0x145bbb(null,_0x592696);}})[_0x0089('0xc')](function(_0x40a645){if(_0x145bbb){_0x145bbb(_0x40a645);}});};AGIVertices[_0x0089('0xd')]['createSquareRecording']=function(_0x3ac4a2,_0x19a243,_0x2b3cad,_0x560528){this['rpc'][_0x0089('0x32')]({'uniqueid':this[_0x0089('0x8')][_0x0089('0x2f')],'callerid':this[_0x0089('0x8')][_0x0089('0x33')],'calleridname':this['channel'][_0x0089('0x34')],'context':this['channel'][_0x0089('0x35')],'extension':this[_0x0089('0x8')][_0x0089('0x36')],'priority':this[_0x0089('0x8')][_0x0089('0x37')],'accountcode':this[_0x0089('0x8')]['accountcode'],'dnid':this[_0x0089('0x8')][_0x0089('0x38')],'projectName':this[_0x0089('0x8')][_0x0089('0x31')],'saveName':_0x19a243,'filename':_0x3ac4a2[_0x0089('0x39')]||_0x19a243,'savePath':_0x2b3cad})['then'](function(_0x29feff){_0x560528(null,_0x29feff);})['catch'](function(_0x5650e9){_0x560528(_0x5650e9);});};AGIVertices[_0x0089('0xd')]['createSquareMessage']=function(_0x43a1fc,_0x533cbd,_0x5b73e3){this[_0x0089('0x9')][_0x0089('0x3a')]({'uniqueid':this['channel']['uniqueid'],'body':_0x43a1fc,'direction':_0x533cbd})[_0x0089('0xf')](function(_0xbdf315){if(_0x5b73e3){_0x5b73e3(null,_0xbdf315);}})[_0x0089('0xc')](function(_0x1e1c8a){if(_0x5b73e3){_0x5b73e3(_0x1e1c8a);}});};AGIVertices[_0x0089('0xd')][_0x0089('0x3b')]=function(_0x56cbdc,_0x2f8859){this['rpc']['createCmContact']({'firstName':_[_0x0089('0x3c')](_0x56cbdc[_0x0089('0xb')])||_[_0x0089('0x3d')](_0x56cbdc[_0x0089('0xb')])?'callback_'+Math['random']():_0x56cbdc[_0x0089('0xb')],'lastName':_['isEmpty'](_0x56cbdc[_0x0089('0x3e')])||_[_0x0089('0x3d')](_0x56cbdc[_0x0089('0x3e')])?null:_0x56cbdc[_0x0089('0x3e')],'phone':_0x56cbdc['phone'],'ListId':_0x56cbdc[_0x0089('0x3f')],'scheduledAt':_0x56cbdc[_0x0089('0x40')],'callbackUniqueid':this[_0x0089('0x8')][_0x0089('0x2f')],'tags':_0x0089('0x41'),'description':_0x0089('0x42')+_0x56cbdc[_0x0089('0x40')][_0x0089('0x43')](),'priority':_0x56cbdc[_0x0089('0x44')]})['then'](function(_0x2b73ca){_0x2f8859(null,_0x2b73ca);})[_0x0089('0xc')](function(_0x52fb44){_0x2f8859(_0x52fb44);});};AGIVertices['prototype'][_0x0089('0x45')]=function(_0x3b7980,_0x263b81){this[_0x0089('0x9')][_0x0089('0x46')](_0x3b7980)[_0x0089('0xf')](function(_0x5edb39){_0x263b81(null,_0x5edb39?_0x5edb39[_0x0089('0xb')]:![]);})[_0x0089('0xc')](function(_0x53d451){_0x263b81(_0x53d451);});};AGIVertices[_0x0089('0xd')][_0x0089('0x47')]=function(_0x485fb1,_0xe0c738,_0x8581c3){var _0x53131a={'role':_0x0089('0x48')};_0x53131a[_0x485fb1]=this['channel'][_0x0089('0x33')];this[_0x0089('0x9')][_0x0089('0x47')](_0x53131a,_0xe0c738,this['channel'][_0x0089('0x2f')])[_0x0089('0xf')](function(_0x2a758d){_0x8581c3(null,_[_0x0089('0x3d')](_0x2a758d)?![]:!![]);})[_0x0089('0xc')](function(_0x30e779){logger[_0x0089('0x25')](_0x30e779);_0x8581c3(null,![]);});};AGIVertices[_0x0089('0xd')][_0x0089('0x49')]=function(_0x9158fb,_0x3f96bb){var _0x22efc8={'role':'agent'};_0x22efc8[_0x9158fb]=this[_0x0089('0x8')]['callerid'];this[_0x0089('0x9')][_0x0089('0x49')](_0x22efc8)['then'](function(_0x58a32c){_0x3f96bb(null,_[_0x0089('0x3d')](_0x58a32c)?![]:!![]);})[_0x0089('0xc')](function(_0x21022d){logger[_0x0089('0x25')](_0x21022d);_0x3f96bb(null,![]);});};AGIVertices[_0x0089('0xd')]['agentLogout']=function(_0x52cde1,_0x1d3199){var _0x20b3b4={'role':_0x0089('0x48')};_0x20b3b4[_0x52cde1]=this['channel']['callerid'];this[_0x0089('0x9')][_0x0089('0x4a')](_0x20b3b4)['then'](function(_0x26830c){_0x1d3199(null,_['isNil'](_0x26830c)?![]:!![]);})[_0x0089('0xc')](function(_0x10bd5d){logger[_0x0089('0x25')](_0x10bd5d);_0x1d3199(null,![]);});};AGIVertices[_0x0089('0xd')][_0x0089('0x4b')]=function(_0x392522,_0x332f18){var _0x4eaa71={'role':_0x0089('0x48')};_0x4eaa71[_0x392522]=this[_0x0089('0x8')][_0x0089('0x33')];var _0x64d3a=_0x392522!=_0x0089('0x4c')?util[_0x0089('0x22')](_0x0089('0x4d'),_0x0089('0x4e'),this[_0x0089('0x8')][_0x0089('0x33')]):undefined;this[_0x0089('0x9')]['agentLogin'](_0x4eaa71,_0x64d3a)[_0x0089('0xf')](function(_0x32d036){_0x332f18(null,_[_0x0089('0x3d')](_0x32d036)?![]:!![]);})['catch'](function(_0x5393dd){logger[_0x0089('0x25')](_0x5393dd);_0x332f18(null,![]);});};AGIVertices['prototype'][_0x0089('0x4f')]=function(_0x5874ac,_0x538278){sh['exec'](_['trim'](_0x5874ac),function(_0x4d9e2a,_0x3468c9){var _0x2ea711=_0x3468c9['replace'](/(\r\n|\n|\r)/gm,'');_0x538278(null,_0x2ea711);});};AGIVertices[_0x0089('0xd')][_0x0089('0x50')]=function(_0x5769e7,_0x2896e9){scripts[_0x0089('0x50')](_0x5769e7[_0x0089('0x51')],_0x5769e7[_0x0089('0x52')]||'en',0x1)[_0x0089('0xf')](function(_0x6f0c7c){_0x2896e9(null,_0x6f0c7c);})[_0x0089('0xc')](function(_0x579609){_0x2896e9(_0x579609);});};AGIVertices['prototype'][_0x0089('0x53')]=function(_0x5e1316,_0x448769){scripts[_0x0089('0x53')](this['channel'][_0x0089('0x2f')],_0x5e1316[_0x0089('0x54')],_0x5e1316[_0x0089('0x51')],_0x5e1316[_0x0089('0x55')]||'en')['then'](function(_0x52bebf){_0x448769(null,_0x52bebf);})['catch'](function(_0x97823c){_0x448769(_0x97823c);});};AGIVertices[_0x0089('0xd')][_0x0089('0x56')]=function(_0x292dd3,_0x56fe44){scripts[_0x0089('0x56')](this['channel'],_0x292dd3)[_0x0089('0xf')](function(_0x4d5ff5){_0x56fe44(null,_0x4d5ff5);})['catch'](function(_0x1466eb){_0x56fe44(_0x1466eb);});};AGIVertices[_0x0089('0xd')][_0x0089('0x57')]=function(_0xfbbede,_0x3e60c5){scripts[_0x0089('0x57')](_0xfbbede['key'],_0xfbbede[_0x0089('0x51')],_0xfbbede[_0x0089('0x58')]||_0x0089('0x59'),_0xfbbede['speed'])['then'](function(_0x11a4f1){_0x3e60c5(null,_0x11a4f1);})[_0x0089('0xc')](function(_0x27ffa3){_0x3e60c5(_0x27ffa3);});};AGIVertices[_0x0089('0xd')]['ispeechASR']=function(_0x3ca06d,_0x40beb5,_0x2e3f5a){scripts['ispeechASR'](_0x40beb5,_0x3ca06d[_0x0089('0x54')],_0x3ca06d[_0x0089('0x5a')]||_0x0089('0x59'),this[_0x0089('0x5b')](_0x3ca06d[_0x0089('0x5c')])?_0x3ca06d['model']:undefined)[_0x0089('0xf')](function(_0xdafc84){_0x2e3f5a(null,_0xdafc84);})[_0x0089('0xc')](function(_0x3ac0a6){_0x2e3f5a(_0x3ac0a6);});};AGIVertices[_0x0089('0xd')][_0x0089('0x5d')]=function(_0xefbc0f,_0x3552d0){scripts['awsPolly'](_0xefbc0f[_0x0089('0x5e')],_0xefbc0f[_0x0089('0x5f')],_0xefbc0f[_0x0089('0x60')],_0xefbc0f[_0x0089('0x61')]||_0x0089('0x62'),_0xefbc0f[_0x0089('0x51')],_0xefbc0f[_0x0089('0x63')]||_0x0089('0x51'))[_0x0089('0xf')](function(_0x228a4f){_0x3552d0(null,_0x228a4f);})[_0x0089('0xc')](function(_0x17431a){_0x3552d0(_0x17431a);});};AGIVertices['prototype']['awsLex']=function(_0x3e678f,_0x29e938){scripts[_0x0089('0x64')](this['channel'][_0x0089('0x2f')],_0x3e678f[_0x0089('0x5e')],_0x3e678f[_0x0089('0x5f')],_0x3e678f[_0x0089('0x65')],_0x3e678f[_0x0089('0x51')],_0x3e678f[_0x0089('0x66')])[_0x0089('0xf')](function(_0x8c1a6e){_0x29e938(null,_0x8c1a6e);})[_0x0089('0xc')](function(_0x5b4295){_0x29e938(_0x5b4295);});};AGIVertices[_0x0089('0xd')][_0x0089('0x67')]=function(_0x1cda0f,_0x1b4459,_0x494f50){scripts[_0x0089('0x67')](_0x1b4459,_0x1cda0f[_0x0089('0x54')],_0x1cda0f[_0x0089('0x68')]||_0x0089('0x59'))['then'](function(_0x1756fb){_0x494f50(null,_0x1756fb);})['catch'](function(_0x5ef120){_0x494f50(_0x5ef120);});};AGIVertices[_0x0089('0xd')][_0x0089('0x69')]=function(_0x330a67,_0xd1312,_0x35e062){scripts[_0x0089('0x69')](_0xd1312,_0x330a67['appid'],_0x330a67[_0x0089('0x6a')],_0x330a67['uri'])[_0x0089('0xf')](function(_0x4d0d2d){_0x35e062(null,_0x4d0d2d);})['catch'](function(_0x5ae5c4){_0x35e062(_0x5ae5c4);});};AGIVertices[_0x0089('0xd')][_0x0089('0x6b')]=function(_0x196e44){var _0x84beeb=_[_0x0089('0x6c')](verticesWithRetry,_0x196e44[_0x0089('0x30')])?_0x196e44:_[_0x0089('0x6d')](_0x196e44);for(var _0x10590f in _0x84beeb){if(_0x84beeb[_0x0089('0x6e')](_0x10590f)){if(_0x84beeb[_0x10590f]&&_[_0x0089('0x6f')](_0x84beeb[_0x10590f])){_0x84beeb[_0x10590f]=this[_0x0089('0x70')](_0x84beeb[_0x10590f]);}}}return _0x84beeb;};AGIVertices['prototype'][_0x0089('0x70')]=function(_0x2a09ea){var _0x59eef2=_0x2a09ea[_0x0089('0x71')]('{');for(var _0x306e08=0x1;_0x306e08<_0x59eef2[_0x0089('0x72')];_0x306e08+=0x1){var _0xef12d1=_0x59eef2[_0x306e08][_0x0089('0x71')]('}');if(_0xef12d1[_0x0089('0x72')]>0x1){_0x2a09ea=_0x2a09ea['replaceAll']('{'+_0xef12d1[0x0]+'}',this[_0x0089('0x8')]['getVariable'](_0xef12d1[0x0])[_0x0089('0x73')]||_0xef12d1[0x0]);}}if(_0x59eef2['length']===0x1){return _0x2a09ea[_0x0089('0x43')]();}return this[_0x0089('0x70')](_0x2a09ea);};AGIVertices['prototype'][_0x0089('0x74')]=function(_0x3286f9,_0x4848b8){var _0xd4252d=this[_0x0089('0x8')][_0x0089('0x75')](_0x3286f9);if(_0xd4252d['result']===-0x1){return _0xd4252d;}logger[_0x0089('0x26')](util[_0x0089('0x22')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4848b8,_0xd4252d[_0x0089('0x73')]));return this['channel'][_0x0089('0x76')](_0x4848b8,_0xd4252d['extra']);};AGIVertices[_0x0089('0xd')]['isConfigured']=function(_0x2ba626){return _0x2ba626&&_0x2ba626!=='0'&&_0x2ba626!=='-1'&&_0x2ba626!=='';};AGIVertices[_0x0089('0xd')]['maxRetry']=function(_0x58b7c4){this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x58b7c4,'-');_0x58b7c4['retry']=_0x58b7c4[_0x0089('0x78')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0089('0xd')][_0x0089('0x79')]=function(_0x5c7433){logger['info'](util[_0x0089('0x22')](_0x0089('0x7a'),_0x5c7433[_0x0089('0x7b')]));return this[_0x0089('0x8')]['agi']([_0x5c7433[_0x0089('0x7c')],_0x5c7433[_0x0089('0x7d')]]);};AGIVertices[_0x0089('0xd')]['answer']=function(_0x38ef1b){logger[_0x0089('0x26')](util['format'](_0x0089('0x7e'),_0x38ef1b['label']));if(this['isConfigured'](_0x38ef1b['timeout'])){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x7f'),_0x38ef1b[_0x0089('0x80')]));var _0x3b7de7=this[_0x0089('0x8')][_0x0089('0x81')](_0x38ef1b[_0x0089('0x80')]);if(_0x3b7de7[_0x0089('0x82')]===-0x1){return _0x3b7de7;}}return this[_0x0089('0x8')][_0x0089('0x83')]();};AGIVertices[_0x0089('0xd')][_0x0089('0x41')]=function(_0x1afd8b){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x84'),_0x1afd8b[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x1afd8b[_0x0089('0x3f')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1afd8b,'no\x20list\x20selected');}_0x1afd8b[_0x0089('0x40')]=moment();if(this[_0x0089('0x5b')](_0x1afd8b['delay'])){_0x1afd8b[_0x0089('0x40')]=moment()[_0x0089('0x85')](_0x1afd8b[_0x0089('0x86')],_0x0089('0x87'));}if(!this[_0x0089('0x5b')](_0x1afd8b[_0x0089('0x44')])){_0x1afd8b['callback_priority']=0x2;}this[_0x0089('0x3b')]['sync'](this,_0x1afd8b);return this['channel'][_0x0089('0x88')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x1afd8b[_0x0089('0x89')],_0x1afd8b['list_id'],_0x1afd8b[_0x0089('0x40')]));};AGIVertices[_0x0089('0xd')][_0x0089('0x8a')]=function(_0x240b76){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x8b'),_0x240b76[_0x0089('0x7b')]));var _0x1eaf01=this[_0x0089('0x8')]['exec'](_0x240b76[_0x0089('0x8c')],_0x240b76['options']);if(_0x1eaf01[_0x0089('0x82')]===-0x1){return _0x1eaf01;}return this[_0x0089('0x8')][_0x0089('0x88')](util['format'](_0x0089('0x8d'),_0x240b76[_0x0089('0x8c')],_0x240b76[_0x0089('0x8e')]));};AGIVertices[_0x0089('0xd')][_0x0089('0x8f')]=function(_0x8ac10a){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x8ac10a[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x8ac10a[_0x0089('0x51')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x90'));}var _0xdc0c7='\x22'+_0x8ac10a['text']+'\x22';if(this[_0x0089('0x5b')](_0x8ac10a['options'])){_0xdc0c7+=','+_0x8ac10a[_0x0089('0x8e')];}var _0x293e61=this[_0x0089('0x8')]['exec']('MRCPSynth',_0xdc0c7);if(_0x293e61[_0x0089('0x82')]===-0x1){return _0x293e61;}return this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x91'),_0xdc0c7));};AGIVertices[_0x0089('0xd')][_0x0089('0x92')]=function(_0x48cd38){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x93'),_0x48cd38['label']));if(!this[_0x0089('0x5b')](_0x48cd38[_0x0089('0x51')])){return this['channel'][_0x0089('0x88')]('no\x20text\x20configured');}var _0x103078='\x22'+_0x48cd38[_0x0089('0x51')]+'\x22';if(this[_0x0089('0x5b')](_0x48cd38[_0x0089('0x8e')])){_0x103078+=','+_0x48cd38[_0x0089('0x8e')];}var _0x2dbe2e=this[_0x0089('0x8')]['exec'](_0x0089('0x94'),_0x103078);if(_0x2dbe2e['result']===-0x1){return _0x2dbe2e;}return this[_0x0089('0x8')][_0x0089('0x88')](util['format'](_0x0089('0x91'),_0x103078));};AGIVertices[_0x0089('0xd')][_0x0089('0x95')]=function(_0x57b43c){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x96'),_0x57b43c['label']));if(!this[_0x0089('0x5b')](_0x57b43c[_0x0089('0x97')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x98'));}var _0x488606=_0x57b43c[_0x0089('0x97')];if(this[_0x0089('0x5b')](_0x57b43c['options'])){_0x488606+=','+_0x57b43c[_0x0089('0x8e')];}var _0x2d5911=this['channel'][_0x0089('0x99')](_0x0089('0x9a'),_0x488606);if(_0x2d5911['result']===-0x1){return _0x2d5911;}var _0x73eace=this[_0x0089('0x74')](_0x0089('0x9b'),'LUMENVOX_ASR_CONFIDENCE');if(_0x73eace[_0x0089('0x82')]===-0x1){return _0x73eace;}var _0x385f55=this[_0x0089('0x74')](_0x0089('0x9c'),_0x0089('0x9d'));if(_0x385f55[_0x0089('0x82')]===-0x1){return _0x385f55;}var _0x2c1b97=this[_0x0089('0x74')](_0x0089('0x9e'),_0x0089('0x9f'));if(_0x2c1b97['result']===-0x1){return _0x2c1b97;}return this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0xa0'),_0x488606));};AGIVertices[_0x0089('0xd')]['sestekasr']=function(_0x20dbdc){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xa1'),_0x20dbdc[_0x0089('0x7b')]));if(!this['isConfigured'](_0x20dbdc['grammar'])){return this['channel'][_0x0089('0x88')](_0x0089('0x98'));}var _0x5610e2=_0x20dbdc[_0x0089('0x97')];if(this[_0x0089('0x5b')](_0x20dbdc[_0x0089('0x8e')])){_0x5610e2+=','+_0x20dbdc[_0x0089('0x8e')];}var _0x5bce13=this['channel']['exec'](_0x0089('0x9a'),_0x5610e2);if(_0x5bce13[_0x0089('0x82')]===-0x1){return _0x5bce13;}var _0x549867=this[_0x0089('0x74')]('RECOG_CONFIDENCE()',_0x0089('0xa2'));if(_0x549867[_0x0089('0x82')]===-0x1){return _0x549867;}var _0x41b044=this['getAndSetVariable'](_0x0089('0x9c'),_0x0089('0xa3'));if(_0x41b044[_0x0089('0x82')]===-0x1){return _0x41b044;}var _0x55a520=this[_0x0089('0x74')]('RECOG_INSTANCE()',_0x0089('0xa4'));if(_0x55a520[_0x0089('0x82')]===-0x1){return _0x55a520;}return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5610e2));};AGIVertices[_0x0089('0xd')][_0x0089('0xa5')]=function(_0x4e09e8){logger[_0x0089('0x26')](util['format'](_0x0089('0xa6'),_0x4e09e8['label']));if(!this[_0x0089('0x5b')](_0x4e09e8[_0x0089('0xa7')])){return this[_0x0089('0x8')]['error'](_0x4e09e8,_0x0089('0xa8'));}var _0xe4de9d=this['getSquareOdbc'][_0x0089('0x77')](this,_0x4e09e8[_0x0089('0xa7')]);if(!_0xe4de9d){return this[_0x0089('0x8')][_0x0089('0x25')](_0x4e09e8,_0x0089('0xa9'));}if(!this[_0x0089('0x5b')](_0x4e09e8['query'])){return this['channel'][_0x0089('0x25')](_0x4e09e8,_0x0089('0xaa'));}var _0x3c52ae=_0x4e09e8[_0x0089('0x27')][_0x0089('0xab')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0089('0x8')]['noop'](util['format'](_0x0089('0xac'),_0x3c52ae));var _0x4e8d36=this[_0x0089('0xad')][_0x0089('0x77')](this,_0xe4de9d,_0x3c52ae);this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x4e09e8,_0x3c52ae);if(!this[_0x0089('0x5b')](_0x4e09e8[_0x0089('0xae')])){return this[_0x0089('0x8')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2b2b58=this['getVariable'][_0x0089('0x77')](this,_0x4e09e8[_0x0089('0xae')]);if(!_0x2b2b58){return this[_0x0089('0x8')][_0x0089('0x25')](_0x4e09e8,_0x0089('0xaf'));}var _0x2c356a=this;_0x4e8d36['forEach'](function(_0x4214fb,_0x568153){Object[_0x0089('0xb0')](_0x4214fb)['forEach'](function(_0x4aef50){_0x2c356a['channel'][_0x0089('0x76')](util[_0x0089('0x22')]('%s[%s][%s]',_0x2b2b58,_0x568153,_0x4aef50),_0x4214fb[_0x4aef50]);});});this[_0x0089('0x8')][_0x0089('0x76')](util[_0x0089('0x22')](_0x0089('0xb1'),_0x2b2b58),_0x4e8d36[_0x0089('0x72')]);return this[_0x0089('0x8')]['noop'](util['format']('variable\x20%s\x20set',_0x2b2b58));};AGIVertices['prototype'][_0x0089('0xb2')]=function(_0x1fc374){logger[_0x0089('0xb3')](util[_0x0089('0x22')](_0x0089('0xb4'),_0x1fc374['label']));if(!this['isConfigured'](_0x1fc374[_0x0089('0xb5')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1fc374,_0x0089('0xb6'));}var _0x5df291=this[_0x0089('0xb7')][_0x0089('0x77')](this,_0x1fc374[_0x0089('0xb5')]);if(!_0x5df291){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1fc374,_0x0089('0xb8'));}var _0x385d8d=this[_0x0089('0x8')][_0x0089('0x99')](_0x0089('0xb9'),[util['format'](_0x0089('0xba'),_0x5df291),_0x1fc374[_0x0089('0x80')],_0x1fc374[_0x0089('0xbb')],_0x1fc374[_0x0089('0xbc')]]);if(_0x385d8d[_0x0089('0x82')]===-0x1){return _0x385d8d;}return this['channel'][_0x0089('0x88')](util['format']('Executed\x20command\x20%s',_0x0089('0xb9')));};AGIVertices[_0x0089('0xd')][_0x0089('0xbd')]=function(_0x4a4e5d){logger['info'](util[_0x0089('0x22')](_0x0089('0xbe'),_0x4a4e5d[_0x0089('0x7b')]));if(!this['isConfigured'](_0x4a4e5d[_0x0089('0x54')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xbf'));}if(!this[_0x0089('0x5b')](_0x4a4e5d[_0x0089('0x51')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x90'));}this[_0x0089('0x8')]['bot']=!![];this[_0x0089('0x2e')](_0x4a4e5d);this[_0x0089('0x3a')](_0x4a4e5d[_0x0089('0x51')],'in');this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('Trying\x20Dialogflow:\x20%s',_0x4a4e5d['text']));var _0x1da4cd=this[_0x0089('0x53')]['sync'](this,_0x4a4e5d);if(_0x1da4cd){for(var _0x10e183 in _0x1da4cd){if(_0x1da4cd['hasOwnProperty'](_0x10e183)){this[_0x0089('0x8')]['setVariable'](util[_0x0089('0x22')](_0x0089('0xc0'),_0x10e183[_0x0089('0xc1')]()),_0x1da4cd[_0x10e183]);}}this[_0x0089('0x3a')](_0x1da4cd[_0x0089('0xc2')],'out');return this[_0x0089('0x8')][_0x0089('0x88')](util['format']('Dialogflow\x20Result\x20%s',_0x1da4cd[_0x0089('0xc2')]));}return this['channel']['error'](_0x4a4e5d,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x0089('0xd')]['sesteknda']=function(_0x536e5b){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xc3'),_0x536e5b[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x536e5b[_0x0089('0xc4')])){return this[_0x0089('0x8')][_0x0089('0x88')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x0089('0x5b')](_0x536e5b[_0x0089('0xc5')])){return this['channel'][_0x0089('0x88')](_0x0089('0xc6'));}if(!this[_0x0089('0x5b')](_0x536e5b[_0x0089('0xc7')])){return this['channel']['noop'](_0x0089('0xc8'));}if(!this[_0x0089('0x5b')](_0x536e5b[_0x0089('0xc9')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x90'));}this[_0x0089('0x8')][_0x0089('0xca')]=!![];this[_0x0089('0x2e')](_0x536e5b);this['createSquareMessage'](_0x536e5b[_0x0089('0x51')],'in');this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xcb'),_0x536e5b[_0x0089('0x51')]));var _0x5ab5a1=this[_0x0089('0x56')]['sync'](this,_0x536e5b);if(_0x5ab5a1){for(var _0xda6197 in _0x5ab5a1){if(_0x5ab5a1[_0x0089('0x6e')](_0xda6197)){this[_0x0089('0x8')]['setVariable'](util[_0x0089('0x22')](_0x0089('0xcc'),_0xda6197[_0x0089('0xc1')]()),_0x5ab5a1[_0xda6197]);}}this[_0x0089('0x3a')](_0x5ab5a1['speech'],_0x0089('0xcd'));if(_0x5ab5a1['audiofile']){this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0xce'),_0x5ab5a1[_0x0089('0xcf')]));var _0x255aa8=this[_0x0089('0x8')][_0x0089('0xd0')](_0x5ab5a1[_0x0089('0xcf')]);try{fs['unlink'](_0x5ab5a1['audiofile']+'.wav');}catch(_0x20a3fd){logger[_0x0089('0x25')](_0x20a3fd);}return _0x255aa8;}else{return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xd1'),_0x5ab5a1['speech']));}}return this[_0x0089('0x8')][_0x0089('0x25')](_0x536e5b,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x0089('0xd')][_0x0089('0xd2')]=function(_0x484551){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xd3'),_0x484551['label']));return this[_0x0089('0x8')][_0x0089('0x88')]('end');};AGIVertices[_0x0089('0xd')][_0x0089('0xd4')]=function(_0x1ff2d4){logger['info'](util[_0x0089('0x22')](_0x0089('0xd5'),_0x1ff2d4[_0x0089('0x7b')]));var _0x469122='';if(_0x1ff2d4['trunk_id']){if(!this['isConfigured'](_0x1ff2d4[_0x0089('0xd6')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1ff2d4,_0x0089('0xd7'));}else{var _0x150ed1=parseInt(_0x1ff2d4[_0x0089('0xd6')],0xa);if(isNaN(_0x150ed1)){_0x469122=_0x1ff2d4[_0x0089('0xd6')];}else{_0x469122=this[_0x0089('0x16')]['sync'](this,_0x1ff2d4['trunk_id']);if(!_0x469122){return this['channel']['error'](_0x1ff2d4,_0x0089('0xd8'));}}}}else if(_0x1ff2d4[_0x0089('0xd9')]){_0x469122=_0x1ff2d4[_0x0089('0xd9')];}else{return this['channel'][_0x0089('0x25')](_0x1ff2d4,'no\x20trunk\x20selected');}var _0x47fc72=this['channel']['exec'](_0x0089('0xb9'),[util[_0x0089('0x22')](_0x0089('0xda'),_0x469122,_0x1ff2d4[_0x0089('0x89')]),_0x1ff2d4['timeout'],_0x1ff2d4[_0x0089('0xbb')],_0x1ff2d4['url']]);if(_0x47fc72[_0x0089('0x82')]===-0x1){return _0x47fc72;}return this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xdb'),'DIAL'));};AGIVertices[_0x0089('0xd')][_0x0089('0xdc')]=function(_0xdfa063){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xdd'),_0xdfa063[_0x0089('0x7b')]));return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xdc'));};AGIVertices[_0x0089('0xd')][_0x0089('0x6')]=function(_0x494839){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x494839[_0x0089('0x7b')]));if(_0x494839['retry']===0x0){return this[_0x0089('0x78')](_0x494839);}_0x494839[_0x0089('0xde')]-=0x1;if(!this[_0x0089('0x5b')](_0x494839[_0x0089('0xdf')])){return this[_0x0089('0x8')]['error'](_0x494839,_0x0089('0xe0'));}var _0x3c707c=this['getSound'][_0x0089('0x77')](this,_0x494839[_0x0089('0xdf')]);if(!_0x3c707c){return this['channel'][_0x0089('0x25')](_0x494839,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x494839[_0x0089('0xae')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x0089('0xe1'));}var _0x235cad=this[_0x0089('0x8')][_0x0089('0xe2')](_0x3c707c,_0x494839[_0x0089('0xe3')],_0x494839[_0x0089('0xe4')]);var _0xe4569=_0x235cad[_0x0089('0x82')]?_0x235cad[_0x0089('0x82')][_0x0089('0x43')]():'';logger[_0x0089('0x26')]('test',JSON[_0x0089('0xe5')](_0x235cad));if(_0x235cad[_0x0089('0x82')]===-0x1){this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x494839,_0xe4569);return _0x235cad;}else if(_0x235cad[_0x0089('0x73')]===_0x0089('0x80')){_0x235cad[_0x0089('0x82')]=_0xe4569['length']>=parseInt(_0x494839[_0x0089('0xe6')])?'x':'i';}else{_0x235cad[_0x0089('0x82')]=_0xe4569[_0x0089('0x72')]>=parseInt(_0x494839[_0x0089('0xe6')])&&_0xe4569[_0x0089('0x72')]<=parseInt(_0x494839[_0x0089('0xe4')])?'x':'i';}var _0x1b51ea=this[_0x0089('0x75')]['sync'](this,_0x494839['variable_id']);if(!_0x1b51ea){return this[_0x0089('0x8')][_0x0089('0x25')](_0x494839,_0x0089('0xaf'));}this[_0x0089('0x8')][_0x0089('0x76')](_0x1b51ea,_0xe4569);if(this[_0x0089('0x5b')](_0x494839[_0x0089('0xe7')])){var _0x5bb20b=parseInt(_0x494839[_0x0089('0xe7')],0xa);var _0x398eff=rs[_0x0089('0xe8')]({'charset':'*','length':_0x5bb20b});var _0xc8324a=_0xe4569[_0x0089('0x72')];if(_0xc8324a>0x0){if(_0xc8324a>_0x5bb20b){this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x494839,_0x494839[_0x0089('0xe9')]==='first'?_0x398eff+_0xe4569[_0x0089('0xea')](_0x5bb20b):_0xe4569[_0x0089('0xea')](0x0,_0xc8324a-_0x5bb20b)+_0x398eff);}else{this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x494839,rs['generate']({'charset':'*','length':_0xc8324a}));}}else{this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x494839,'');}}else{this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x494839,_0xe4569);}return _0x235cad;};AGIVertices[_0x0089('0xd')][_0x0089('0x7')]=function(_0x3cd642){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xeb'),_0x3cd642[_0x0089('0x7b')]));return this[_0x0089('0x6')](_0x3cd642);};AGIVertices[_0x0089('0xd')][_0x0089('0xec')]=function(_0x20ee97){logger['info'](util[_0x0089('0x22')](_0x0089('0xed'),_0x20ee97[_0x0089('0x7b')]));this[_0x0089('0x2e')]['sync'](this,_0x20ee97,_0x20ee97[_0x0089('0xee')]);return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xef'),_0x20ee97[_0x0089('0xee')]));};AGIVertices[_0x0089('0xd')][_0x0089('0xf0')]=function(_0x1160eb){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xf1'),_0x1160eb[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x1160eb['aws_access_key_id'])||!this[_0x0089('0x5b')](_0x1160eb['aws_secret_access_key'])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xf2'));}if(!this[_0x0089('0x5b')](_0x1160eb[_0x0089('0x51')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x90'));}this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xf3'),_0x1160eb[_0x0089('0x51')]));var _0x20f8f8=this[_0x0089('0x5d')][_0x0089('0x77')](this,_0x1160eb);if(_0x20f8f8){this[_0x0089('0x8')]['noop'](util['format'](_0x0089('0xf4'),_0x20f8f8));var _0x5022f4=this[_0x0089('0x8')][_0x0089('0xd0')](_0x20f8f8);try{fs[_0x0089('0xf5')](_0x20f8f8+'.wav');}catch(_0x2de284){logger[_0x0089('0x25')](_0x2de284);}return _0x5022f4;}return this[_0x0089('0x8')][_0x0089('0x25')](_0x1160eb,_0x0089('0xf6'));};AGIVertices['prototype'][_0x0089('0xf7')]=function(_0x59efc1){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xf8'),_0x59efc1['label']));if(!this['isConfigured'](_0x59efc1[_0x0089('0x5e')])||!this[_0x0089('0x5b')](_0x59efc1['aws_secret_access_key'])){return this['channel'][_0x0089('0x88')](_0x0089('0xf2'));}if(!this[_0x0089('0x5b')](_0x59efc1[_0x0089('0x66')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xf9'));}if(!this[_0x0089('0x5b')](_0x59efc1[_0x0089('0x51')])){return this[_0x0089('0x8')]['noop'](_0x0089('0x90'));}this[_0x0089('0x8')][_0x0089('0xca')]=!![];this[_0x0089('0x2e')](_0x59efc1);this[_0x0089('0x3a')](_0x59efc1[_0x0089('0x51')],'in');this['channel'][_0x0089('0x88')](util[_0x0089('0x22')]('Trying\x20Amazon\x20Lex:\x20%s',_0x59efc1[_0x0089('0x51')]));var _0x55b5e9=this[_0x0089('0x64')][_0x0089('0x77')](this,_0x59efc1);if(_0x55b5e9){for(var _0x59a743 in _0x55b5e9){if(_0x55b5e9['hasOwnProperty'](_0x59a743)&&_[_0x0089('0x6f')](_0x55b5e9[_0x59a743])){this[_0x0089('0x8')]['setVariable'](util[_0x0089('0x22')](_0x0089('0xfa'),_0x59a743[_0x0089('0xc1')]()),_0x55b5e9[_0x59a743]);}}if(_[_0x0089('0x3d')](_0x55b5e9[_0x0089('0xfb')])){return this[_0x0089('0x8')][_0x0089('0x88')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x0089('0x3a')](_0x55b5e9[_0x0089('0xfb')],_0x0089('0xcd'));return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0xfc'),_0x55b5e9[_0x0089('0xfb')]));}}return this[_0x0089('0x8')]['error'](_0x59efc1,_0x0089('0xfd'));};AGIVertices[_0x0089('0xd')][_0x0089('0xfe')]=function(_0x43a60d){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0xff'),_0x43a60d[_0x0089('0x7b')],_0x43a60d[_0x0089('0x80')]));if(!this[_0x0089('0x5b')](_0x43a60d[_0x0089('0x54')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xbf'));}var _0xdc0429=_0x0089('0x100');var _0x1559bb=util[_0x0089('0x22')](_0x0089('0x101'),FILES_PATH,rs[_0x0089('0xe8')](0x4));var _0x36b53a=util[_0x0089('0x22')](_0x0089('0x102'),_0x1559bb,_0xdc0429);var _0x17e09d=!![];if(_0x43a60d['beep']==='NOBEEP'){_0x17e09d=![];}var _0x38c423=this[_0x0089('0x8')]['recordFile'](_0x1559bb,_0xdc0429,_0x43a60d[_0x0089('0x103')],_0x43a60d[_0x0089('0x80')],undefined,_0x17e09d);if(_0x38c423[_0x0089('0x82')]!==-0x1){this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x104'),_0x36b53a));var _0x10fb7b=this[_0x0089('0x67')]['sync'](this,_0x43a60d,_0x36b53a);if(_0x10fb7b){for(var _0x4da2b0 in _0x10fb7b){if(_0x10fb7b[_0x0089('0x6e')](_0x4da2b0)){this['channel'][_0x0089('0x76')](util[_0x0089('0x22')](_0x0089('0x105'),_0x4da2b0[_0x0089('0xc1')]()),_0x10fb7b[_0x4da2b0]);}}return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x106'),JSON['stringify'](_0x10fb7b)));}}return _0x38c423;};AGIVertices[_0x0089('0xd')][_0x0089('0x107')]=function(_0x576a4e){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x108'),_0x576a4e[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x576a4e[_0x0089('0x109')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x10a'));}if(!this[_0x0089('0x5b')](_0x576a4e[_0x0089('0x6a')])){return this['channel'][_0x0089('0x88')](_0x0089('0x10b'));}var _0x10e0be=_0x0089('0x100');var _0x4a7098=util[_0x0089('0x22')](_0x0089('0x101'),FILES_PATH,rs[_0x0089('0xe8')](0x4));var _0x3aa1bd=util[_0x0089('0x22')](_0x0089('0x102'),_0x4a7098,_0x10e0be);var _0x5ccded=!![];if(_0x576a4e[_0x0089('0x10c')]===_0x0089('0x10d')){_0x5ccded=![];}var _0x11608a=this[_0x0089('0x8')]['recordFile'](_0x4a7098,_0x10e0be,_0x576a4e[_0x0089('0x103')],_0x576a4e[_0x0089('0x80')],undefined,_0x5ccded);if(_0x11608a['result']!==-0x1){this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0x10e'),_0x3aa1bd));var _0x17918e=this['tildeASR']['sync'](this,_0x576a4e,_0x3aa1bd);if(_0x17918e){for(var _0x4dde28 in _0x17918e){if(_0x17918e[_0x0089('0x6e')](_0x4dde28)){this[_0x0089('0x8')][_0x0089('0x76')](util[_0x0089('0x22')](_0x0089('0x10f'),_0x4dde28['toUpperCase']()),_0x17918e[_0x4dde28]);}}return this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x110'),JSON['stringify'](_0x17918e)));}}return _0x11608a;};AGIVertices[_0x0089('0xd')][_0x0089('0x111')]=function(_0x39cd52){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x112'),_0x39cd52[_0x0089('0x7b')]));return this[_0x0089('0x8')][_0x0089('0x113')](_0x39cd52[_0x0089('0x35')],_0x39cd52[_0x0089('0x36')],_0x39cd52[_0x0089('0x37')]);};AGIVertices['prototype']['gotoif']=function(_0xd6471e){logger[_0x0089('0x26')](util['format'](_0x0089('0x114'),_0xd6471e[_0x0089('0x7b')]));if(!this['isConfigured'](_0xd6471e[_0x0089('0x115')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0xd6471e,_0x0089('0x116'));}try{var _0xd46322=eval(_0xd6471e[_0x0089('0x115')])?_0x0089('0x117'):_0x0089('0x118');this[_0x0089('0x8')][_0x0089('0x88')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0xd6471e['condition'],_0xd46322));return{'code':0xc8,'result':_0xd46322};}catch(_0x5f543a){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x0089('0xd')][_0x0089('0x119')]=function(_0x4a95f4){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4a95f4['label']));if(!this[_0x0089('0x5b')](_0x4a95f4['interval_id'])){return this['channel'][_0x0089('0x25')](_0x4a95f4,_0x0089('0x11a'));}var _0x115636=this[_0x0089('0x1c')][_0x0089('0x77')](this,_0x4a95f4[_0x0089('0x11b')]);if(!_0x115636){return this[_0x0089('0x8')][_0x0089('0x25')](_0x4a95f4,_0x0089('0x11c'));}for(var _0x477608=0x0;_0x477608<_0x115636[_0x0089('0x72')];_0x477608+=0x1){var _0xa847c5=this[_0x0089('0x8')][_0x0089('0x75')](util[_0x0089('0x22')](_0x0089('0x11d'),_0x115636[_0x477608]));if(_0xa847c5[_0x0089('0x82')]===-0x1){return _0xa847c5;}logger[_0x0089('0x26')](util['format']('IFTIME\x20%s\x20%s',_0x115636[_0x477608],_0xa847c5[_0x0089('0x73')]));if(_0xa847c5[_0x0089('0x73')]===_0x0089('0x117')){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x11e'),_0x115636[_0x477608],_0x0089('0x117')));this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x11e'),_0x115636[_0x477608],'true'));return{'code':0xc8,'result':_0x0089('0x117')};}else{logger[_0x0089('0x26')](util[_0x0089('0x22')]('IFTIME\x20%s\x20%s',_0x115636[_0x477608],_0x0089('0x118')));this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0x11e'),_0x115636[_0x477608],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x0089('0xd')][_0x0089('0x11f')]=function(_0x4ace66){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4ace66['label']));return this[_0x0089('0x8')][_0x0089('0x11f')]();};AGIVertices[_0x0089('0xd')]['ispeechasr']=function(_0x4600ca){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x120'),_0x4600ca['label']));if(!this[_0x0089('0x5b')](_0x4600ca[_0x0089('0x54')])){return this[_0x0089('0x8')]['noop'](_0x0089('0xbf'));}var _0xc8cfbc='wav';var _0x408b0b=util[_0x0089('0x22')](_0x0089('0x101'),FILES_PATH,rs[_0x0089('0xe8')](0x4));var _0x12d565=util['format']('%s.%s',_0x408b0b,_0xc8cfbc);var _0xa3f58e=!![];if(_0x4600ca[_0x0089('0x10c')]===_0x0089('0x10d')){_0xa3f58e=![];}var _0x414689=this[_0x0089('0x8')][_0x0089('0x121')](_0x408b0b,_0xc8cfbc,_0x4600ca[_0x0089('0x103')],_0x4600ca[_0x0089('0x80')],undefined,_0xa3f58e);if(_0x414689[_0x0089('0x82')]!==-0x1){this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x122'),_0x12d565));var _0x1aa185=this[_0x0089('0x123')][_0x0089('0x77')](this,_0x4600ca,_0x12d565);if(_0x1aa185){for(var _0x193794 in _0x1aa185){if(_0x1aa185[_0x0089('0x6e')](_0x193794)){this[_0x0089('0x8')][_0x0089('0x76')](util['format'](_0x0089('0x124'),_0x193794[_0x0089('0xc1')]()),_0x1aa185[_0x193794]);}}return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('IspeechASR\x20Result\x20%s',JSON[_0x0089('0xe5')](_0x1aa185)));}}return _0x414689;};AGIVertices[_0x0089('0xd')][_0x0089('0x125')]=function(_0x18a6a3){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x126'),_0x18a6a3[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x18a6a3[_0x0089('0x54')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0xbf'));}if(!this['isConfigured'](_0x18a6a3[_0x0089('0x51')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x90'));}this['channel']['noop'](util['format'](_0x0089('0x127'),_0x18a6a3[_0x0089('0x51')]));var _0x48af43=this['ispeechTTS']['sync'](this,_0x18a6a3);if(_0x48af43){this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x122'),_0x48af43));var _0x1745da=this[_0x0089('0x8')][_0x0089('0xd0')](_0x48af43,_0x18a6a3['intKey']);try{fs[_0x0089('0xf5')](_0x48af43+_0x0089('0x128'));}catch(_0x1cbf1e){logger[_0x0089('0x25')](_0x1cbf1e);}return _0x1745da;}return this['channel'][_0x0089('0x25')](_0x18a6a3,_0x0089('0x129'));};AGIVertices['prototype'][_0x0089('0x12a')]=function(_0x2d98c2){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x12b'),_0x2d98c2['label']));if(!this[_0x0089('0x5b')](_0x2d98c2['findBy'])){return this[_0x0089('0x8')]['error'](_0x2d98c2,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x0089('0x33')],_0x2d98c2[_0x0089('0x12c')]));var _0x4a66d5=this['agentLogin'][_0x0089('0x77')](this,_0x2d98c2[_0x0089('0x12c')]);if(_0x4a66d5){logger[_0x0089('0x26')](util[_0x0089('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0089('0x33')],_0x2d98c2['findBy']));this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x12d'),this[_0x0089('0x8')][_0x0089('0x33')],_0x2d98c2['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x12e'),this[_0x0089('0x8')][_0x0089('0x33')],_0x2d98c2[_0x0089('0x12c')]));this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x12e'),this['channel'][_0x0089('0x33')],_0x2d98c2['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0089('0xd')][_0x0089('0x12f')]=function(_0x437c9c){logger[_0x0089('0x26')](util['format'](_0x0089('0x130'),_0x437c9c[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x437c9c['findBy'])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x437c9c,_0x0089('0x131'));}logger['info'](util[_0x0089('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0089('0x8')]['callerid'],_0x437c9c['findBy']));var _0x4b5ba8=this['agentLogout']['sync'](this,_0x437c9c[_0x0089('0x12c')]);if(_0x4b5ba8){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x12d'),this[_0x0089('0x8')][_0x0089('0x33')],_0x437c9c['findBy']));this['channel'][_0x0089('0x88')](util[_0x0089('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0089('0x33')],_0x437c9c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x12e'),this[_0x0089('0x8')][_0x0089('0x33')],_0x437c9c[_0x0089('0x12c')]));this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x12e'),this['channel']['callerid'],_0x437c9c['findBy']));return{'code':0xc8,'result':_0x0089('0x132')};}};AGIVertices['prototype'][_0x0089('0x133')]=function(_0x140279){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x134'),_0x140279[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x140279[_0x0089('0x135')])){return this[_0x0089('0x8')]['error'](_0x140279,_0x0089('0x136'));}this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('math\x20%s',_0x140279[_0x0089('0x135')]));var _0x2dbfc9=eval(_0x140279[_0x0089('0x135')]);if(!this[_0x0089('0x5b')](_0x140279[_0x0089('0xae')])){return this[_0x0089('0x8')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x25aa23=this['getVariable']['sync'](this,_0x140279[_0x0089('0xae')]);if(!_0x25aa23){return this['channel']['error'](_0x140279,_0x0089('0xaf'));}if(_[_0x0089('0x137')](_0x2dbfc9)){var _0x4565d8=this;_0x2dbfc9[_0x0089('0x138')](function(_0x310da6,_0x34a669){_0x4565d8[_0x0089('0x8')]['setVariable'](util['format'](_0x0089('0x139'),_0x25aa23,_0x34a669),_0x310da6);});return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('variable\x20%s[key]\x20set',_0x25aa23));}else{return this[_0x0089('0x8')][_0x0089('0x76')](_0x25aa23,_0x2dbfc9);}};AGIVertices[_0x0089('0xd')][_0x0089('0x5')]=function(_0x11a04d){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x13a'),_0x11a04d[_0x0089('0x7b')]));if(_0x11a04d[_0x0089('0xde')]===0x0){return this[_0x0089('0x78')](_0x11a04d);}_0x11a04d[_0x0089('0xde')]-=0x1;if(!this['isConfigured'](_0x11a04d['file_id'])){return this[_0x0089('0x8')]['error'](_0x11a04d,'no\x20file\x20audio\x20selected');}var _0x2c6dd9=this[_0x0089('0x13b')][_0x0089('0x77')](this,_0x11a04d['file_id']);if(!_0x2c6dd9){return this[_0x0089('0x8')][_0x0089('0x25')](_0x11a04d,_0x0089('0x13c'));}var _0x173aa7=this[_0x0089('0x8')]['getData'](_0x2c6dd9,_0x11a04d[_0x0089('0xe3')],_0x11a04d['digit']);var _0x36046e=_0x173aa7['result'];if(_0x173aa7[_0x0089('0x82')]===-0x1){this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x11a04d,'-1');return _0x173aa7;}else if(_0x173aa7[_0x0089('0x73')]===_0x0089('0x80')){_0x173aa7[_0x0089('0x82')]=_0x173aa7[_0x0089('0x82')][_0x0089('0x72')]>0x0?_0x173aa7[_0x0089('0x82')]:'t';}else if(_[_0x0089('0x3c')](_0x173aa7[_0x0089('0x82')])){_0x173aa7[_0x0089('0x82')]='#';_0x36046e='#';}if(!this[_0x0089('0x5b')](_0x11a04d[_0x0089('0xae')])){this[_0x0089('0x8')][_0x0089('0x88')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2eb622=this[_0x0089('0x75')]['sync'](this,_0x11a04d[_0x0089('0xae')]);if(!_0x2eb622){return this[_0x0089('0x8')][_0x0089('0x25')](_0x11a04d,_0x0089('0xaf'));}this[_0x0089('0x8')][_0x0089('0x76')](_0x2eb622,_0x36046e);}this['createSquareDetailsReport']['sync'](this,_0x11a04d,_0x36046e);return _0x173aa7;};AGIVertices[_0x0089('0xd')][_0x0089('0x88')]=function(_0x106d26){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x106d26[_0x0089('0x7b')]));return this[_0x0089('0x8')]['noop'](_0x106d26[_0x0089('0x13d')]||_0x106d26['label']);};AGIVertices[_0x0089('0xd')]['pause']=function(_0x339568){logger['info'](util[_0x0089('0x22')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x339568[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x339568['findBy'])){return this[_0x0089('0x8')]['error'](_0x339568,'no\x20find\x20by\x20configured');}logger['info'](util[_0x0089('0x22')](_0x0089('0x13e'),this[_0x0089('0x8')]['callerid'],_0x339568[_0x0089('0x12c')]));var _0x5c14ba=this[_0x0089('0x45')][_0x0089('0x77')](this,_0x339568[_0x0089('0x13f')]);var _0x49af57=this[_0x0089('0x47')][_0x0089('0x77')](this,_0x339568[_0x0089('0x12c')],_0x5c14ba);if(_0x49af57){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0089('0x8')]['callerid'],_0x339568[_0x0089('0x12c')]));this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0089('0x8')][_0x0089('0x33')],_0x339568[_0x0089('0x12c')]));return{'code':0xc8,'result':_0x0089('0x140')};}else{logger[_0x0089('0x26')](util['format'](_0x0089('0x12e'),this[_0x0089('0x8')]['callerid'],_0x339568[_0x0089('0x12c')]));this[_0x0089('0x8')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0089('0x8')][_0x0089('0x33')],_0x339568['findBy']));return{'code':0xc8,'result':_0x0089('0x132')};}};AGIVertices[_0x0089('0xd')][_0x0089('0x141')]=function(_0xe72644){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x142'),_0xe72644[_0x0089('0x7b')]));if(!this['isConfigured'](_0xe72644[_0x0089('0xdf')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0xe72644,_0x0089('0xe0'));}var _0x272278=this[_0x0089('0x13b')][_0x0089('0x77')](this,_0xe72644[_0x0089('0xdf')]);if(!_0x272278){return this[_0x0089('0x8')][_0x0089('0x25')](_0xe72644,_0x0089('0x13c'));}var _0x575995=this[_0x0089('0x8')]['exec']('PLAYBACK',[_0x272278,_0xe72644[_0x0089('0xbb')]]);if(_0x575995['result']===-0x1){return _0x575995;}return this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0x8d'),_0x0089('0x143'),_0x272278));};AGIVertices['prototype'][_0x0089('0x144')]=function(_0x1bd702){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x145'),_0x1bd702[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x1bd702['queue_id'])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1bd702,_0x0089('0x146'));}var _0xb87eba='';var _0xa70ec1=parseInt(_0x1bd702['queue_id'],0xa);if(isNaN(_0xa70ec1)){_0xb87eba=_0x1bd702[_0x0089('0x147')];}else{_0xb87eba=this[_0x0089('0x148')]['sync'](this,_0x1bd702[_0x0089('0x147')]);if(!_0xb87eba){return this[_0x0089('0x8')][_0x0089('0x25')](_0x1bd702,'no\x20queue\x20found');}}var _0x2f549d='';if(this[_0x0089('0x5b')](_0x1bd702['file_id'])){var _0x347f5b=this[_0x0089('0x13b')][_0x0089('0x77')](this,_0x1bd702[_0x0089('0xdf')]);if(_0x347f5b){_0x2f549d=_0x347f5b;}}this['createSquareDetailsReport']['sync'](this,_0x1bd702,_0xb87eba);if(_0x1bd702['opts'][_0x0089('0x149')]('x')<0x0){_0x1bd702[_0x0089('0xbb')]+='x';}if(_0x1bd702[_0x0089('0xbb')]['indexOf']('X')<0x0){_0x1bd702[_0x0089('0xbb')]+='X';}this[_0x0089('0x8')][_0x0089('0x76')](_0x0089('0x14a'),_0xb87eba?_0xb87eba[_0x0089('0x14b')]():'');var _0x29fad9=this[_0x0089('0x8')]['exec']('QUEUE',[_0xb87eba,_0x1bd702[_0x0089('0xbb')],_0x1bd702['url'],_0x2f549d,_0x1bd702[_0x0089('0x80')],_0x1bd702[_0x0089('0x79')],_0x1bd702[_0x0089('0x14c')],_0x1bd702['gosub'],'',_0x1bd702[_0x0089('0x14d')]]);if(_0x29fad9[_0x0089('0x82')]===-0x1){return _0x29fad9;}return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x8d'),_0x0089('0x14e'),_0xb87eba));};AGIVertices[_0x0089('0xd')][_0x0089('0x14f')]=function(_0x5a306b){logger['info'](util[_0x0089('0x22')](_0x0089('0x150'),_0x5a306b[_0x0089('0x7b')]));var _0x328066=_0x5a306b[_0x0089('0x151')]||_0x0089('0x100');var _0x50d02f=util[_0x0089('0x22')](_0x0089('0x152'),this[_0x0089('0x8')]['uniqueid'],rs['generate'](0x5));var _0x53b5b7=util[_0x0089('0x22')](_0x0089('0x153'),FILES_PATH,_0x50d02f,_0x328066);var _0x31f131=util['format'](_0x0089('0x101'),FILES_PATH,_0x50d02f);this[_0x0089('0x32')][_0x0089('0x77')](this,_0x5a306b,_0x50d02f,_0x53b5b7);this[_0x0089('0x8')][_0x0089('0x76')](_0x0089('0x154'),_0x50d02f);logger[_0x0089('0x26')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x31f131,_0x328066,_0x5a306b[_0x0089('0x155')],_0x5a306b['timeout']);return this[_0x0089('0x8')]['recordFile'](_0x31f131,_0x328066,_0x5a306b[_0x0089('0x155')],_0x5a306b[_0x0089('0x80')],undefined,!![]);};AGIVertices[_0x0089('0xd')][_0x0089('0x156')]=function(_0x44986c){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x157'),_0x44986c[_0x0089('0x7b')]));return this[_0x0089('0x8')][_0x0089('0x158')](_0x44986c[_0x0089('0x159')][_0x0089('0xab')](/\s+/g,''),_0x44986c[_0x0089('0x155')]);};AGIVertices[_0x0089('0xd')][_0x0089('0x15a')]=function(_0x1e3eca){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x15b'),_0x1e3eca['label']));return this[_0x0089('0x8')][_0x0089('0x15c')](_0x1e3eca[_0x0089('0x15d')]['replace'](/\s+/g,''),_0x1e3eca[_0x0089('0x155')]);};AGIVertices[_0x0089('0xd')]['sayphonetic']=function(_0x42b500){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x15e'),_0x42b500[_0x0089('0x7b')]));return this[_0x0089('0x8')]['sayPhonetic'](_0x42b500['text'],_0x42b500['escape_digits']);};AGIVertices[_0x0089('0xd')][_0x0089('0x15f')]=function(_0x51729f){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x160'),_0x51729f[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x51729f[_0x0089('0x161')])){return this[_0x0089('0x8')][_0x0089('0x88')]('no\x20mail\x20account\x20configured');}var _0x2c9d52=this[_0x0089('0x19')][_0x0089('0x77')](this,_0x51729f[_0x0089('0x161')]);if(!_0x2c9d52||!_0x2c9d52['Smtp']){return this['channel'][_0x0089('0x25')](_0x51729f,_0x0089('0x162'));}var _0x2f599b={'from':util[_0x0089('0x22')]('\x22%s\x22\x20<%s>',_0x2c9d52[_0x0089('0xb')],_0x2c9d52[_0x0089('0x163')]||_0x2c9d52[_0x0089('0x164')][_0x0089('0x165')]),'to':_0x51729f['to']||'','cc':_0x51729f['cc']||'','bcc':_0x51729f[_0x0089('0x166')]||'','subject':_0x51729f[_0x0089('0x167')],'html':_0x51729f[_0x0089('0x51')],'text':_0x51729f[_0x0089('0x51')]};var _0x1bec2b={'tls':{'rejectUnauthorized':![]}};if(_0x2c9d52[_0x0089('0x164')][_0x0089('0x168')]){_0x1bec2b[_0x0089('0x168')]=_0x2c9d52[_0x0089('0x164')][_0x0089('0x168')];}else{_0x1bec2b[_0x0089('0x169')]=_0x2c9d52[_0x0089('0x164')]['host'];_0x1bec2b['port']=_0x2c9d52[_0x0089('0x164')][_0x0089('0x16a')];_0x1bec2b[_0x0089('0x16b')]=_0x2c9d52['Smtp']['secure'];}if(_0x2c9d52[_0x0089('0x164')][_0x0089('0x16c')]){_0x1bec2b[_0x0089('0x16d')]={'user':_0x2c9d52[_0x0089('0x164')][_0x0089('0x165')],'pass':_0x2c9d52[_0x0089('0x164')][_0x0089('0x16e')]};}if(this[_0x0089('0x5b')](_0x51729f['template_id'])){}logger[_0x0089('0xb3')](_0x0089('0x16f'),JSON[_0x0089('0xe5')](_0x2f599b));this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x51729f,_0x51729f['account_id']);this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x170'),_0x2c9d52[_0x0089('0xb')]));this['sendMailMessage'][_0x0089('0x77')](this,_0x1bec2b,_0x2f599b);return this[_0x0089('0x8')][_0x0089('0x88')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0089('0xd')][_0x0089('0x171')]=function(_0x2003cc){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x172'),_0x2003cc[_0x0089('0x7b')]));return this[_0x0089('0x8')][_0x0089('0x88')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x0089('0xd')][_0x0089('0x173')]=function(_0x57f903){logger['info'](util[_0x0089('0x22')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x57f903[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x57f903[_0x0089('0x174')])){return this[_0x0089('0x8')][_0x0089('0x88')](_0x0089('0x175'));}var _0x15c02d=this[_0x0089('0x2c')][_0x0089('0x77')](this,_0x57f903[_0x0089('0x174')]);if(!_0x15c02d){return this[_0x0089('0x8')]['error'](_0x57f903,_0x0089('0x176'));}var _0x48d0f5={'body':_0x57f903[_0x0089('0x177')],'phone':_0x57f903['to']||'','SmsAccountId':_0x15c02d['id']};logger[_0x0089('0xb3')]('sendSMS\x20message',JSON['stringify'](_0x48d0f5));this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x57f903,_0x57f903[_0x0089('0x174')]);this['channel']['noop'](util[_0x0089('0x22')](_0x0089('0x178'),_0x15c02d[_0x0089('0xb')]));this[_0x0089('0x2d')][_0x0089('0x77')](this,_0x48d0f5);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0089('0xd')]['set']=function(_0x4ee5a4){logger['info'](util[_0x0089('0x22')](_0x0089('0x179'),_0x4ee5a4[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x4ee5a4['variable_id'])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x4ee5a4,_0x0089('0x17a'));}var _0x4b50e5=this['getVariable'][_0x0089('0x77')](this,_0x4ee5a4[_0x0089('0xae')]);if(!_0x4b50e5){return this[_0x0089('0x8')][_0x0089('0x25')](_0x4ee5a4,_0x0089('0xaf'));}return this[_0x0089('0x8')][_0x0089('0x76')](_0x4b50e5,_0x4ee5a4[_0x0089('0x17b')]);};AGIVertices[_0x0089('0xd')][_0x0089('0x17c')]=function(_0x4369ba){logger['info'](util[_0x0089('0x22')](_0x0089('0x17d'),_0x4369ba[_0x0089('0x7b')]));this['channel'][_0x0089('0x88')](_0x0089('0x17e'));if(_0x4369ba[_0x0089('0x83')]===_0x0089('0x17f')){this[_0x0089('0x8')][_0x0089('0x88')]('Answer');return this[_0x0089('0x8')][_0x0089('0x83')]();}return this['channel'][_0x0089('0x88')]('Skipped\x20Answer');};AGIVertices[_0x0089('0xd')]['subproject']=function(_0x396950){logger[_0x0089('0x26')](util['format'](_0x0089('0x180'),_0x396950[_0x0089('0x7b')]));if(!this['isConfigured'](_0x396950['project_id'])){return this[_0x0089('0x8')]['error'](_0x396950,'no\x20subproject\x20selected');}var _0x131ca0=this[_0x0089('0x10')][_0x0089('0x77')](this,_0x396950[_0x0089('0x181')]);if(!this[_0x0089('0x5b')](_0x131ca0)){return this[_0x0089('0x8')][_0x0089('0x25')](_0x396950,util[_0x0089('0x22')](_0x0089('0x182'),_0x396950[_0x0089('0x181')]));}if(_0x131ca0===this[_0x0089('0x8')][_0x0089('0x31')]){return this[_0x0089('0x8')][_0x0089('0x25')](_0x396950,_0x0089('0x183'));}this[_0x0089('0x2e')][_0x0089('0x77')](this,_0x396950,_0x131ca0);var _0x208223=this['channel'][_0x0089('0x99')](_0x0089('0x184'),util['format'](_0x0089('0x185'),config[_0x0089('0x79')]['host']||_0x0089('0x186'),_0x131ca0,this['channel']['arg_1']));if(_0x208223['result']===-0x1){return _0x208223;}return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x8d'),'AGI',_0x131ca0));};AGIVertices[_0x0089('0xd')][_0x0089('0x187')]=function(_0x6194ad){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x188'),_0x6194ad[_0x0089('0x7b')]));var _0x225502=this[_0x0089('0x4f')]['sync'](this,_0x6194ad[_0x0089('0x7c')]);this['createSquareDetailsReport'][_0x0089('0x77')](this,_0x6194ad,_0x6194ad[_0x0089('0x7c')]);if(this[_0x0089('0x5b')](_0x6194ad[_0x0089('0xae')])){var _0x1649bc=this[_0x0089('0x75')][_0x0089('0x77')](this,_0x6194ad[_0x0089('0xae')]);if(_0x1649bc){this[_0x0089('0x8')][_0x0089('0x76')](_0x1649bc,_0x225502);return this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x189'),_0x6194ad[_0x0089('0x7c')],_0x1649bc));}}return this[_0x0089('0x8')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x6194ad['command']));};AGIVertices[_0x0089('0xd')][_0x0089('0x18a')]=function(_0x4ef34c){logger['info'](util[_0x0089('0x22')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4ef34c[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x4ef34c[_0x0089('0x51')])){return this['channel']['noop'](_0x0089('0x90'));}this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x18b'),_0x4ef34c['text']));var _0x15dc52=this['googleTTS']['sync'](this,_0x4ef34c);if(_0x15dc52){this[_0x0089('0x8')][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x18c'),_0x15dc52));var _0x1953bb=this[_0x0089('0x8')][_0x0089('0xd0')](_0x15dc52);try{fs['unlink'](_0x15dc52+'.wav');}catch(_0x5e76ce){logger[_0x0089('0x25')](_0x5e76ce);}return _0x1953bb;}return this[_0x0089('0x8')]['error'](_0x4ef34c,_0x0089('0x18d'));};AGIVertices[_0x0089('0xd')]['unpause']=function(_0x49a347){logger['info'](util[_0x0089('0x22')](_0x0089('0x18e'),_0x49a347['label']));if(!this[_0x0089('0x5b')](_0x49a347[_0x0089('0x12c')])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x49a347,'no\x20find\x20by\x20configured');}logger['info'](util[_0x0089('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0089('0x8')][_0x0089('0x33')],_0x49a347[_0x0089('0x12c')]));var _0x211754=this[_0x0089('0x49')]['sync'](this,_0x49a347[_0x0089('0x12c')]);if(_0x211754){logger['info'](util[_0x0089('0x22')](_0x0089('0x12d'),this[_0x0089('0x8')][_0x0089('0x33')],_0x49a347[_0x0089('0x12c')]));this[_0x0089('0x8')][_0x0089('0x88')](util['format'](_0x0089('0x12d'),this[_0x0089('0x8')][_0x0089('0x33')],_0x49a347['findBy']));return{'code':0xc8,'result':_0x0089('0x140')};}else{logger['info'](util[_0x0089('0x22')](_0x0089('0x12e'),this[_0x0089('0x8')][_0x0089('0x33')],_0x49a347[_0x0089('0x12c')]));this[_0x0089('0x8')]['noop'](util[_0x0089('0x22')](_0x0089('0x12e'),this[_0x0089('0x8')][_0x0089('0x33')],_0x49a347[_0x0089('0x12c')]));return{'code':0xc8,'result':_0x0089('0x132')};}};AGIVertices['prototype']['voicemail']=function(_0x14645a){logger[_0x0089('0x26')](util[_0x0089('0x22')](_0x0089('0x18f'),_0x14645a[_0x0089('0x7b')]));var _0x1d1b1b=this['channel'][_0x0089('0x99')]('VOICEMAIL',[_0x14645a['mailbox'],_0x14645a['options']]);if(_0x1d1b1b[_0x0089('0x82')]===-0x1){return _0x1d1b1b;}return this['channel'][_0x0089('0x88')](util[_0x0089('0x22')](_0x0089('0x8d'),'VOICEMAIL',_0x14645a[_0x0089('0x190')]));};AGIVertices[_0x0089('0xd')][_0x0089('0x191')]=function(_0x45582e){logger[_0x0089('0x26')](util[_0x0089('0x22')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x45582e[_0x0089('0x7b')]));if(!this[_0x0089('0x5b')](_0x45582e['variable_id'])){return this[_0x0089('0x8')][_0x0089('0x25')](_0x45582e,_0x0089('0x17a'));}var _0x5ac56a=this[_0x0089('0x75')][_0x0089('0x77')](this,_0x45582e[_0x0089('0xae')]);if(!_0x5ac56a){return this['channel'][_0x0089('0x25')](_0x45582e,_0x0089('0xaf'));}var _0x12681a=this[_0x0089('0x8')][_0x0089('0x75')](_0x5ac56a);return{'code':0xc8,'result':_0x12681a['extra']?_0x12681a['extra']:'-'};};String[_0x0089('0xd')][_0x0089('0x192')]=function(_0xaf60f9,_0xe0a1ac){return this[_0x0089('0x71')](_0xaf60f9)['join'](_0xe0a1ac);};module['exports']=AGIVertices; \ No newline at end of file +var _0x66e6=['gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','bcc','service','host','secure','authentication','auth','user','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','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','agi','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','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','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getSquareProjectById','catch','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','trim','googleTTS','googleDialogflow','key','text','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','hasOwnProperty','split','length','replaceAll','extra','replaceAllVariables','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','noop','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','options','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','toString','test','stringify','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','AWS_LEX_%s','toUpperCase','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','%s.%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt'];(function(_0x6cfbf6,_0x594cf1){var _0x537202=function(_0x1eac35){while(--_0x1eac35){_0x6cfbf6['push'](_0x6cfbf6['shift']());}};_0x537202(++_0x594cf1);}(_0x66e6,0x83));var _0x666e=function(_0x42aa5b,_0x2aa13c){_0x42aa5b=_0x42aa5b-0x0;var _0x21c277=_0x66e6[_0x42aa5b];return _0x21c277;};'use strict';var fs=require('fs');var path=require(_0x666e('0x0'));var util=require(_0x666e('0x1'));var _=require(_0x666e('0x2'));var sh=require(_0x666e('0x3'));var odbc=require(_0x666e('0x4'))();var rs=require(_0x666e('0x5'));var moment=require(_0x666e('0x6'));var Mustache=require(_0x666e('0x7'));var logger=require(_0x666e('0x8'))('agi');var config=require('../../config/environment');var scripts=require(_0x666e('0x9'));var FILES_PATH=_0x666e('0xa');var verticesWithRetry=[_0x666e('0xb'),_0x666e('0xc'),_0x666e('0xd')];var AGIVertices=function(_0x5a7a24,_0x26e39f,_0x4fb97a){this[_0x666e('0xe')]=_0x5a7a24;this[_0x666e('0xf')]=_0x26e39f;this[_0x666e('0x10')]=_0x4fb97a;};AGIVertices[_0x666e('0x11')][_0x666e('0x12')]=function(_0x1df09b,_0x4418e9){this[_0x666e('0xf')][_0x666e('0x13')](_0x1df09b)[_0x666e('0x14')](function(_0x1731b5){_0x4418e9(null,_0x1731b5?_0x1731b5[_0x666e('0x15')]:![]);})['catch'](function(_0x1487e3){_0x4418e9(_0x1487e3);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x5e52ac,_0x56c8e6){this[_0x666e('0xf')]['getVoiceQueueById'](_0x5e52ac)['then'](function(_0x220fc7){_0x56c8e6(null,_0x220fc7?_0x220fc7[_0x666e('0x15')]:![]);})['catch'](function(_0x4c3c16){_0x56c8e6(_0x4c3c16);});};AGIVertices['prototype']['getSquareProject']=function(_0x255851,_0x6b6dd){this[_0x666e('0xf')][_0x666e('0x16')](_0x255851)['then'](function(_0x196b7a){_0x6b6dd(null,_0x196b7a?_0x196b7a['name']:![]);})[_0x666e('0x17')](function(_0x198bda){_0x6b6dd(_0x198bda);});};AGIVertices['prototype'][_0x666e('0x18')]=function(_0x4f5957,_0x6478a5){this['rpc'][_0x666e('0x19')](_0x4f5957)['then'](function(_0x5dcdd5){_0x6478a5(null,_0x5dcdd5?_0x5dcdd5['dsn']:![]);})['catch'](function(_0x48c3d2){_0x6478a5(_0x48c3d2);});};AGIVertices[_0x666e('0x11')][_0x666e('0x1a')]=function(_0x105c4b,_0x5c16fb){this[_0x666e('0xf')]['getUserById'](_0x105c4b)[_0x666e('0x14')](function(_0x2fe312){_0x5c16fb(null,_0x2fe312?_0x2fe312[_0x666e('0x15')]:![]);})[_0x666e('0x17')](function(_0x372fba){_0x5c16fb(_0x372fba);});};AGIVertices['prototype'][_0x666e('0x1b')]=function(_0x1bf031,_0xe7f8ec){this[_0x666e('0xf')][_0x666e('0x1c')](_0x1bf031)['then'](function(_0x1b6411){_0xe7f8ec(null,_0x1b6411?_0x1b6411['name']:![]);})[_0x666e('0x17')](function(_0x4dbc10){_0xe7f8ec(_0x4dbc10);});};AGIVertices[_0x666e('0x11')][_0x666e('0x1d')]=function(_0x31f1eb,_0x55e6a7){var _0x2c0b05=this;this['rpc'][_0x666e('0x1e')](_0x31f1eb)[_0x666e('0x14')](function(_0x539800){_0x55e6a7(null,_0x539800?_0x2c0b05[_0x666e('0x1f')](_0x539800['save_name']):![]);})['catch'](function(_0x48ab70){_0x55e6a7(_0x48ab70);});};AGIVertices[_0x666e('0x11')][_0x666e('0x20')]=function(_0x5e3c03,_0x378917){this[_0x666e('0xf')][_0x666e('0x21')](_0x5e3c03)[_0x666e('0x14')](function(_0x204c64){_0x378917(null,_0x204c64?_0x204c64:![]);})[_0x666e('0x17')](function(_0x144c3b){_0x378917(_0x144c3b);});};AGIVertices[_0x666e('0x11')][_0x666e('0x22')]=function(_0x1a1ae7,_0xe515ee,_0x217aff){this[_0x666e('0x10')]['sendMailMessage'](_0x1a1ae7,_0xe515ee)[_0x666e('0x14')](function(){_0x217aff(null);})[_0x666e('0x17')](function(_0x3ab7b1){_0x217aff(_0x3ab7b1);});};AGIVertices['prototype'][_0x666e('0x23')]=function(_0x3099e7,_0x213465){this[_0x666e('0xf')]['getIntervalById'](_0x3099e7)[_0x666e('0x14')](function(_0x20a47f){if(_0x20a47f){if(_0x20a47f[_0x666e('0x24')]){_0x213465(null,[_0x20a47f['interval']]);}else{_0x213465(null,_['map'](_0x20a47f[_0x666e('0x25')],'interval'));}}else{_0x213465(null,![]);}})['catch'](function(_0x17e402){_0x213465(_0x17e402);});};AGIVertices[_0x666e('0x11')][_0x666e('0x1f')]=function(_0x255f18){return util[_0x666e('0x26')](_0x666e('0x27'),FILES_PATH,_0x255f18);};AGIVertices[_0x666e('0x11')][_0x666e('0x28')]=function(_0x58fed9,_0x13f244,_0x47093a){odbc[_0x666e('0x29')](_0x58fed9,function(_0x4e9118){if(_0x4e9118){logger[_0x666e('0x2a')](_0x666e('0x2b'),_0x4e9118);_0x47093a(_0x4e9118);}else{logger[_0x666e('0x2c')](_0x666e('0x2d'));odbc['query'](_0x13f244,function(_0x33b5d5,_0x4be546){if(_0x33b5d5){logger['info'](_0x666e('0x2e'),_0x13f244);_0x47093a(_0x33b5d5);}else{logger[_0x666e('0x2c')](_0x666e('0x2f'),_0x13f244);odbc[_0x666e('0x30')](function(_0x559b54){if(_0x559b54){logger[_0x666e('0x2a')](_0x666e('0x31'),_0x559b54);}_0x47093a(null,_0x4be546);});}});}});};AGIVertices[_0x666e('0x11')][_0x666e('0x32')]=function(_0x1bdd94,_0x4f88e8){this[_0x666e('0xf')][_0x666e('0x33')](_0x1bdd94)[_0x666e('0x14')](function(_0x3884b1){_0x4f88e8(null,_0x3884b1?_0x3884b1:![]);})[_0x666e('0x17')](function(_0x32b784){_0x4f88e8(_0x32b784);});};AGIVertices[_0x666e('0x11')][_0x666e('0x34')]=function(_0x17bf30,_0x1b54c0){this[_0x666e('0xf')][_0x666e('0x34')](_0x17bf30)['then'](function(_0x8aa3f4){_0x1b54c0(null,_0x8aa3f4);})[_0x666e('0x17')](function(_0x13ce57){_0x1b54c0(_0x13ce57);});};AGIVertices[_0x666e('0x11')][_0x666e('0x35')]=function(_0x1f34a4,_0x9fbc6a,_0xea3e27){this[_0x666e('0xf')][_0x666e('0x35')]({'uniqueid':this['channel'][_0x666e('0x36')],'node':_0x1f34a4[_0x666e('0x37')],'application':_0x1f34a4[_0x666e('0x38')],'data':_0x9fbc6a||null,'project_name':this[_0x666e('0xe')][_0x666e('0x39')],'callerid':this[_0x666e('0xe')][_0x666e('0x3a')]})['then'](function(_0x273b7f){if(_0xea3e27){_0xea3e27(null,_0x273b7f);}})[_0x666e('0x17')](function(_0x31dd24){if(_0xea3e27){_0xea3e27(_0x31dd24);}});};AGIVertices[_0x666e('0x11')]['createSquareRecording']=function(_0x5ab632,_0x22b090,_0x2fb94c,_0x566fc6){this[_0x666e('0xf')][_0x666e('0x3b')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x666e('0xe')][_0x666e('0x3a')],'calleridname':this[_0x666e('0xe')][_0x666e('0x3c')],'context':this[_0x666e('0xe')]['context'],'extension':this['channel'][_0x666e('0x3d')],'priority':this[_0x666e('0xe')][_0x666e('0x3e')],'accountcode':this['channel'][_0x666e('0x3f')],'dnid':this[_0x666e('0xe')][_0x666e('0x40')],'projectName':this[_0x666e('0xe')][_0x666e('0x39')],'saveName':_0x22b090,'filename':_0x5ab632[_0x666e('0x41')]||_0x22b090,'savePath':_0x2fb94c})[_0x666e('0x14')](function(_0x44f66b){_0x566fc6(null,_0x44f66b);})[_0x666e('0x17')](function(_0xefd024){_0x566fc6(_0xefd024);});};AGIVertices[_0x666e('0x11')]['createSquareMessage']=function(_0x52c46a,_0x4ba475,_0x250717){this[_0x666e('0xf')][_0x666e('0x42')]({'uniqueid':this[_0x666e('0xe')]['uniqueid'],'body':_0x52c46a,'direction':_0x4ba475})[_0x666e('0x14')](function(_0x34449b){if(_0x250717){_0x250717(null,_0x34449b);}})[_0x666e('0x17')](function(_0x3097ac){if(_0x250717){_0x250717(_0x3097ac);}});};AGIVertices[_0x666e('0x11')][_0x666e('0x43')]=function(_0x18f2d1,_0x58006c){this[_0x666e('0xf')]['createCmContact']({'firstName':_[_0x666e('0x44')](_0x18f2d1[_0x666e('0x15')])||_[_0x666e('0x45')](_0x18f2d1[_0x666e('0x15')])?_0x666e('0x46')+Math[_0x666e('0x47')]():_0x18f2d1[_0x666e('0x15')],'lastName':_[_0x666e('0x44')](_0x18f2d1['lastName'])||_[_0x666e('0x45')](_0x18f2d1['lastName'])?null:_0x18f2d1[_0x666e('0x48')],'phone':_0x18f2d1[_0x666e('0x49')],'ListId':_0x18f2d1[_0x666e('0x4a')],'scheduledAt':_0x18f2d1[_0x666e('0x4b')],'callbackUniqueid':this[_0x666e('0xe')][_0x666e('0x36')],'tags':_0x666e('0x4c'),'description':_0x666e('0x4d')+_0x18f2d1['scheduledAt']['toString'](),'priority':_0x18f2d1[_0x666e('0x4e')]})[_0x666e('0x14')](function(_0x49fee5){_0x58006c(null,_0x49fee5);})[_0x666e('0x17')](function(_0x13738d){_0x58006c(_0x13738d);});};AGIVertices['prototype'][_0x666e('0x4f')]=function(_0x49f5c8,_0x482a5b){this['rpc'][_0x666e('0x50')](_0x49f5c8)[_0x666e('0x14')](function(_0x465bf8){_0x482a5b(null,_0x465bf8?_0x465bf8[_0x666e('0x15')]:![]);})[_0x666e('0x17')](function(_0x1011a5){_0x482a5b(_0x1011a5);});};AGIVertices['prototype'][_0x666e('0x51')]=function(_0xf6fd3d,_0x5ef1cb,_0x50cd97){var _0x415462={'role':_0x666e('0x52')};_0x415462[_0xf6fd3d]=this[_0x666e('0xe')][_0x666e('0x3a')];this['rpc'][_0x666e('0x51')](_0x415462,_0x5ef1cb,this[_0x666e('0xe')][_0x666e('0x36')])['then'](function(_0x5b4be0){_0x50cd97(null,_[_0x666e('0x45')](_0x5b4be0)?![]:!![]);})[_0x666e('0x17')](function(_0x360dc3){logger['error'](_0x360dc3);_0x50cd97(null,![]);});};AGIVertices[_0x666e('0x11')][_0x666e('0x53')]=function(_0x4e3d4a,_0x2fbe91){var _0x3fb3a8={'role':_0x666e('0x52')};_0x3fb3a8[_0x4e3d4a]=this[_0x666e('0xe')][_0x666e('0x3a')];this[_0x666e('0xf')][_0x666e('0x53')](_0x3fb3a8)[_0x666e('0x14')](function(_0x2175ae){_0x2fbe91(null,_['isNil'](_0x2175ae)?![]:!![]);})['catch'](function(_0x4d53ca){logger[_0x666e('0x2a')](_0x4d53ca);_0x2fbe91(null,![]);});};AGIVertices['prototype'][_0x666e('0x54')]=function(_0x4866b3,_0x32a314){var _0x32535a={'role':_0x666e('0x52')};_0x32535a[_0x4866b3]=this[_0x666e('0xe')][_0x666e('0x3a')];this['rpc'][_0x666e('0x54')](_0x32535a)[_0x666e('0x14')](function(_0x3c50e5){_0x32a314(null,_['isNil'](_0x3c50e5)?![]:!![]);})[_0x666e('0x17')](function(_0x5a0f01){logger[_0x666e('0x2a')](_0x5a0f01);_0x32a314(null,![]);});};AGIVertices[_0x666e('0x11')][_0x666e('0x55')]=function(_0x574087,_0x3a4ef2){var _0x55ad49={'role':_0x666e('0x52')};_0x55ad49[_0x574087]=this[_0x666e('0xe')][_0x666e('0x3a')];var _0x31294a=_0x574087!='internal'?util['format']('%s/%s@from-sip/n',_0x666e('0x56'),this[_0x666e('0xe')][_0x666e('0x3a')]):undefined;this[_0x666e('0xf')][_0x666e('0x55')](_0x55ad49,_0x31294a)[_0x666e('0x14')](function(_0xeed5a2){_0x3a4ef2(null,_[_0x666e('0x45')](_0xeed5a2)?![]:!![]);})[_0x666e('0x17')](function(_0x5ccf63){logger['error'](_0x5ccf63);_0x3a4ef2(null,![]);});};AGIVertices[_0x666e('0x11')][_0x666e('0x57')]=function(_0x5379bd,_0x48ed32){sh['exec'](_[_0x666e('0x58')](_0x5379bd),function(_0x2f724f,_0x2a9f25){var _0x367f0a=_0x2a9f25['replace'](/(\r\n|\n|\r)/gm,'');_0x48ed32(null,_0x367f0a);});};AGIVertices['prototype'][_0x666e('0x59')]=function(_0xa6921e,_0x1ba1ba){scripts[_0x666e('0x59')](_0xa6921e['text'],_0xa6921e['google_tts_language']||'en',0x1)[_0x666e('0x14')](function(_0x4cf5dc){_0x1ba1ba(null,_0x4cf5dc);})['catch'](function(_0x34bfd7){_0x1ba1ba(_0x34bfd7);});};AGIVertices['prototype'][_0x666e('0x5a')]=function(_0x1a032e,_0x2bcab1){scripts[_0x666e('0x5a')](this[_0x666e('0xe')][_0x666e('0x36')],_0x1a032e[_0x666e('0x5b')],_0x1a032e[_0x666e('0x5c')],_0x1a032e['dialogflow_language']||'en')[_0x666e('0x14')](function(_0x18d969){_0x2bcab1(null,_0x18d969);})[_0x666e('0x17')](function(_0x5ecf5e){_0x2bcab1(_0x5ecf5e);});};AGIVertices['prototype'][_0x666e('0x5d')]=function(_0x13d9c6,_0x791535){scripts[_0x666e('0x5d')](this[_0x666e('0xe')],_0x13d9c6)[_0x666e('0x14')](function(_0x296c61){_0x791535(null,_0x296c61);})[_0x666e('0x17')](function(_0xfdfbe){_0x791535(_0xfdfbe);});};AGIVertices[_0x666e('0x11')]['ispeechTTS']=function(_0x25fbb7,_0x18377a){scripts[_0x666e('0x5e')](_0x25fbb7[_0x666e('0x5b')],_0x25fbb7[_0x666e('0x5c')],_0x25fbb7[_0x666e('0x5f')]||_0x666e('0x60'),_0x25fbb7[_0x666e('0x61')])['then'](function(_0x2ca598){_0x18377a(null,_0x2ca598);})['catch'](function(_0x54953a){_0x18377a(_0x54953a);});};AGIVertices['prototype']['ispeechASR']=function(_0x1138a5,_0xc98bd7,_0x389850){scripts[_0x666e('0x62')](_0xc98bd7,_0x1138a5[_0x666e('0x5b')],_0x1138a5[_0x666e('0x63')]||_0x666e('0x60'),this['isConfigured'](_0x1138a5['model'])?_0x1138a5[_0x666e('0x64')]:undefined)[_0x666e('0x14')](function(_0x236034){_0x389850(null,_0x236034);})[_0x666e('0x17')](function(_0x2610a4){_0x389850(_0x2610a4);});};AGIVertices[_0x666e('0x11')][_0x666e('0x65')]=function(_0x193dc5,_0xbe1626){scripts[_0x666e('0x65')](_0x193dc5[_0x666e('0x66')],_0x193dc5[_0x666e('0x67')],_0x193dc5[_0x666e('0x68')],_0x193dc5[_0x666e('0x69')]||_0x666e('0x6a'),_0x193dc5['text'],_0x193dc5[_0x666e('0x6b')]||_0x666e('0x5c'))[_0x666e('0x14')](function(_0x59f19c){_0xbe1626(null,_0x59f19c);})[_0x666e('0x17')](function(_0x3b858e){_0xbe1626(_0x3b858e);});};AGIVertices[_0x666e('0x11')][_0x666e('0x6c')]=function(_0x4c0f0a,_0x1fbb22){scripts[_0x666e('0x6c')](this[_0x666e('0xe')][_0x666e('0x36')],_0x4c0f0a['aws_access_key_id'],_0x4c0f0a[_0x666e('0x67')],_0x4c0f0a[_0x666e('0x6d')],_0x4c0f0a['text'],_0x4c0f0a[_0x666e('0x6e')])['then'](function(_0x35ecc4){_0x1fbb22(null,_0x35ecc4);})['catch'](function(_0x3fcccc){_0x1fbb22(_0x3fcccc);});};AGIVertices[_0x666e('0x11')][_0x666e('0x6f')]=function(_0x7fe2b8,_0x37210d,_0x2e54d4){scripts['googleASR'](_0x37210d,_0x7fe2b8[_0x666e('0x5b')],_0x7fe2b8[_0x666e('0x70')]||'en-US')[_0x666e('0x14')](function(_0x2394c0){_0x2e54d4(null,_0x2394c0);})[_0x666e('0x17')](function(_0x5417bd){_0x2e54d4(_0x5417bd);});};AGIVertices[_0x666e('0x11')][_0x666e('0x71')]=function(_0x2207ca,_0x421797,_0x45a1a5){scripts[_0x666e('0x71')](_0x421797,_0x2207ca[_0x666e('0x72')],_0x2207ca[_0x666e('0x73')],_0x2207ca[_0x666e('0x74')])[_0x666e('0x14')](function(_0x1e781a){_0x45a1a5(null,_0x1e781a);})[_0x666e('0x17')](function(_0x367dbe){_0x45a1a5(_0x367dbe);});};AGIVertices['prototype'][_0x666e('0x75')]=function(_0x267d5a){var _0x554787=_[_0x666e('0x76')](verticesWithRetry,_0x267d5a[_0x666e('0x38')])?_0x267d5a:_['clone'](_0x267d5a);for(var _0x15c324 in _0x554787){if(_0x554787[_0x666e('0x77')](_0x15c324)){if(_0x554787[_0x15c324]&&_['isString'](_0x554787[_0x15c324])){_0x554787[_0x15c324]=this['replaceAllVariables'](_0x554787[_0x15c324]);}}}return _0x554787;};AGIVertices[_0x666e('0x11')]['replaceAllVariables']=function(_0x5cfff3){var _0x1a977a=_0x5cfff3[_0x666e('0x78')]('{');for(var _0x24c400=0x1;_0x24c400<_0x1a977a['length'];_0x24c400+=0x1){var _0x5d5998=_0x1a977a[_0x24c400]['split']('}');if(_0x5d5998[_0x666e('0x79')]>0x1){_0x5cfff3=_0x5cfff3[_0x666e('0x7a')]('{'+_0x5d5998[0x0]+'}',this[_0x666e('0xe')][_0x666e('0x12')](_0x5d5998[0x0])[_0x666e('0x7b')]||_0x5d5998[0x0]);}}if(_0x1a977a[_0x666e('0x79')]===0x1){return _0x5cfff3['toString']();}return this[_0x666e('0x7c')](_0x5cfff3);};AGIVertices['prototype'][_0x666e('0x7d')]=function(_0x225569,_0x4e9d3d){var _0x5ce580=this[_0x666e('0xe')]['getVariable'](_0x225569);if(_0x5ce580[_0x666e('0x7e')]===-0x1){return _0x5ce580;}logger['info'](util[_0x666e('0x26')](_0x666e('0x7f'),_0x4e9d3d,_0x5ce580[_0x666e('0x7b')]));return this[_0x666e('0xe')][_0x666e('0x80')](_0x4e9d3d,_0x5ce580['extra']);};AGIVertices['prototype'][_0x666e('0x81')]=function(_0x3301d7){return _0x3301d7&&_0x3301d7!=='0'&&_0x3301d7!=='-1'&&_0x3301d7!=='';};AGIVertices[_0x666e('0x11')][_0x666e('0x82')]=function(_0x235a9b){this['createSquareDetailsReport'][_0x666e('0x83')](this,_0x235a9b,'-');_0x235a9b[_0x666e('0x84')]=_0x235a9b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['agi']=function(_0x4c6fac){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x85'),_0x4c6fac['label']));return this[_0x666e('0xe')]['agi']([_0x4c6fac[_0x666e('0x86')],_0x4c6fac['args']]);};AGIVertices['prototype'][_0x666e('0x87')]=function(_0x27103b){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x88'),_0x27103b[_0x666e('0x37')]));if(this['isConfigured'](_0x27103b[_0x666e('0x89')])){logger['info'](util[_0x666e('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x27103b[_0x666e('0x89')]));var _0x2a97d8=this[_0x666e('0xe')]['wait'](_0x27103b[_0x666e('0x89')]);if(_0x2a97d8['result']===-0x1){return _0x2a97d8;}}return this[_0x666e('0xe')]['answer']();};AGIVertices['prototype'][_0x666e('0x4c')]=function(_0x1f60be){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x8a'),_0x1f60be[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x1f60be['list_id'])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x1f60be,_0x666e('0x8b'));}_0x1f60be[_0x666e('0x4b')]=moment();if(this[_0x666e('0x81')](_0x1f60be[_0x666e('0x8c')])){_0x1f60be[_0x666e('0x4b')]=moment()['add'](_0x1f60be[_0x666e('0x8c')],_0x666e('0x8d'));}if(!this[_0x666e('0x81')](_0x1f60be[_0x666e('0x4e')])){_0x1f60be[_0x666e('0x4e')]=0x2;}this[_0x666e('0x43')][_0x666e('0x83')](this,_0x1f60be);return this['channel'][_0x666e('0x8e')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x1f60be['phone'],_0x1f60be[_0x666e('0x4a')],_0x1f60be[_0x666e('0x4b')]));};AGIVertices[_0x666e('0x11')][_0x666e('0x8f')]=function(_0x3c95f0){logger['info'](util[_0x666e('0x26')](_0x666e('0x90'),_0x3c95f0[_0x666e('0x37')]));var _0x50a793=this[_0x666e('0xe')]['exec'](_0x3c95f0['application'],_0x3c95f0[_0x666e('0x91')]);if(_0x50a793[_0x666e('0x7e')]===-0x1){return _0x50a793;}return this[_0x666e('0xe')][_0x666e('0x8e')](util['format']('Executed\x20command\x20%s\x20%s',_0x3c95f0[_0x666e('0x92')],_0x3c95f0[_0x666e('0x91')]));};AGIVertices[_0x666e('0x11')][_0x666e('0x93')]=function(_0xbee5c3){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x94'),_0xbee5c3[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0xbee5c3[_0x666e('0x5c')])){return this[_0x666e('0xe')]['noop']('no\x20text\x20configured');}var _0x1e2f80='\x22'+_0xbee5c3[_0x666e('0x5c')]+'\x22';if(this[_0x666e('0x81')](_0xbee5c3[_0x666e('0x91')])){_0x1e2f80+=','+_0xbee5c3['options'];}var _0xa9e307=this[_0x666e('0xe')]['exec'](_0x666e('0x95'),_0x1e2f80);if(_0xa9e307[_0x666e('0x7e')]===-0x1){return _0xa9e307;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x96'),_0x1e2f80));};AGIVertices[_0x666e('0x11')][_0x666e('0x97')]=function(_0xebf4d5){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x98'),_0xebf4d5[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0xebf4d5[_0x666e('0x5c')])){return this[_0x666e('0xe')]['noop'](_0x666e('0x99'));}var _0x3158a9='\x22'+_0xebf4d5[_0x666e('0x5c')]+'\x22';if(this[_0x666e('0x81')](_0xebf4d5[_0x666e('0x91')])){_0x3158a9+=','+_0xebf4d5[_0x666e('0x91')];}var _0x80cfc9=this['channel']['exec'](_0x666e('0x95'),_0x3158a9);if(_0x80cfc9['result']===-0x1){return _0x80cfc9;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x96'),_0x3158a9));};AGIVertices['prototype']['lumenvoxasr']=function(_0x3f2820){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x9a'),_0x3f2820['label']));if(!this[_0x666e('0x81')](_0x3f2820[_0x666e('0x9b')])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0x9c'));}var _0x4e4d07=_0x3f2820[_0x666e('0x9b')];if(this[_0x666e('0x81')](_0x3f2820[_0x666e('0x91')])){_0x4e4d07+=','+_0x3f2820[_0x666e('0x91')];}var _0xb7a94b=this[_0x666e('0xe')][_0x666e('0x9d')](_0x666e('0x9e'),_0x4e4d07);if(_0xb7a94b['result']===-0x1){return _0xb7a94b;}var _0xc2d1c5=this[_0x666e('0x7d')](_0x666e('0x9f'),_0x666e('0xa0'));if(_0xc2d1c5[_0x666e('0x7e')]===-0x1){return _0xc2d1c5;}var _0x5de7d5=this[_0x666e('0x7d')](_0x666e('0xa1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5de7d5[_0x666e('0x7e')]===-0x1){return _0x5de7d5;}var _0x18788f=this[_0x666e('0x7d')](_0x666e('0xa2'),_0x666e('0xa3'));if(_0x18788f[_0x666e('0x7e')]===-0x1){return _0x18788f;}return this['channel']['noop'](util['format'](_0x666e('0xa4'),_0x4e4d07));};AGIVertices[_0x666e('0x11')][_0x666e('0xa5')]=function(_0x31ce28){logger[_0x666e('0x2c')](util['format'](_0x666e('0xa6'),_0x31ce28[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x31ce28[_0x666e('0x9b')])){return this['channel'][_0x666e('0x8e')](_0x666e('0x9c'));}var _0x29f517=_0x31ce28['grammar'];if(this[_0x666e('0x81')](_0x31ce28[_0x666e('0x91')])){_0x29f517+=','+_0x31ce28[_0x666e('0x91')];}var _0x254518=this['channel'][_0x666e('0x9d')](_0x666e('0x9e'),_0x29f517);if(_0x254518[_0x666e('0x7e')]===-0x1){return _0x254518;}var _0x4c7908=this[_0x666e('0x7d')](_0x666e('0x9f'),'SESTEK_ASR_CONFIDENCE');if(_0x4c7908[_0x666e('0x7e')]===-0x1){return _0x4c7908;}var _0x44d7ba=this[_0x666e('0x7d')]('RECOG_INPUT()',_0x666e('0xa7'));if(_0x44d7ba[_0x666e('0x7e')]===-0x1){return _0x44d7ba;}var _0x203e42=this[_0x666e('0x7d')]('RECOG_INSTANCE()',_0x666e('0xa8'));if(_0x203e42[_0x666e('0x7e')]===-0x1){return _0x203e42;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x29f517));};AGIVertices[_0x666e('0x11')][_0x666e('0xa9')]=function(_0x2d8691){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0xaa'),_0x2d8691[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x2d8691[_0x666e('0xab')])){return this[_0x666e('0xe')]['error'](_0x2d8691,_0x666e('0xac'));}var _0x2b7520=this[_0x666e('0x18')]['sync'](this,_0x2d8691['odbc_id']);if(!_0x2b7520){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x2d8691,_0x666e('0xad'));}if(!this[_0x666e('0x81')](_0x2d8691['query'])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x2d8691,_0x666e('0xae'));}var _0x29adae=_0x2d8691[_0x666e('0xaf')][_0x666e('0xb0')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')]('query:\x20%s',_0x29adae));var _0x5a4ac6=this['getQueryOdbc']['sync'](this,_0x2b7520,_0x29adae);this[_0x666e('0x35')]['sync'](this,_0x2d8691,_0x29adae);if(!this[_0x666e('0x81')](_0x2d8691[_0x666e('0xb1')])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xb2'));}var _0x4c841d=this[_0x666e('0x12')]['sync'](this,_0x2d8691['variable_id']);if(!_0x4c841d){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x2d8691,_0x666e('0xb3'));}var _0x2504ab=this;_0x5a4ac6[_0x666e('0xb4')](function(_0xb1d2d9,_0xa371dd){Object[_0x666e('0xb5')](_0xb1d2d9)['forEach'](function(_0x50ff25){_0x2504ab[_0x666e('0xe')][_0x666e('0x80')](util['format'](_0x666e('0xb6'),_0x4c841d,_0xa371dd,_0x50ff25),_0xb1d2d9[_0x50ff25]);});});this[_0x666e('0xe')][_0x666e('0x80')](util[_0x666e('0x26')](_0x666e('0xb7'),_0x4c841d),_0x5a4ac6[_0x666e('0x79')]);return this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0xb8'),_0x4c841d));};AGIVertices[_0x666e('0x11')]['dial']=function(_0x868f48){logger[_0x666e('0xb9')](util['format'](_0x666e('0xba'),_0x868f48[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x868f48['sip_id'])){return this['channel']['error'](_0x868f48,'no\x20user\x20selected');}var _0x58da4c=this[_0x666e('0x1a')][_0x666e('0x83')](this,_0x868f48[_0x666e('0xbb')]);if(!_0x58da4c){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x868f48,'no\x20user\x20found');}var _0x21a5b4=this[_0x666e('0xe')][_0x666e('0x9d')](_0x666e('0xbc'),[util[_0x666e('0x26')](_0x666e('0xbd'),_0x58da4c),_0x868f48['timeout'],_0x868f48[_0x666e('0xbe')],_0x868f48[_0x666e('0xbf')]]);if(_0x21a5b4[_0x666e('0x7e')]===-0x1){return _0x21a5b4;}return this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0xc0'),'DIAL'));};AGIVertices['prototype'][_0x666e('0xc1')]=function(_0x4190c7){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0xc2'),_0x4190c7['label']));if(!this['isConfigured'](_0x4190c7['key'])){return this['channel']['noop'](_0x666e('0xc3'));}if(!this[_0x666e('0x81')](_0x4190c7[_0x666e('0x5c')])){return this[_0x666e('0xe')]['noop'](_0x666e('0x99'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x4190c7);this[_0x666e('0x42')](_0x4190c7[_0x666e('0x5c')],'in');this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0xc4'),_0x4190c7[_0x666e('0x5c')]));var _0xabd53f=this[_0x666e('0x5a')][_0x666e('0x83')](this,_0x4190c7);if(_0xabd53f){for(var _0x4f6f9d in _0xabd53f){if(_0xabd53f[_0x666e('0x77')](_0x4f6f9d)){this['channel'][_0x666e('0x80')](util[_0x666e('0x26')]('DIALOGFLOW_%s',_0x4f6f9d['toUpperCase']()),_0xabd53f[_0x4f6f9d]);}}this['createSquareMessage'](_0xabd53f['speech'],_0x666e('0xc5'));return this['channel'][_0x666e('0x8e')](util['format'](_0x666e('0xc6'),_0xabd53f[_0x666e('0xc7')]));}return this[_0x666e('0xe')]['error'](_0x4190c7,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x666e('0x11')]['sesteknda']=function(_0x56afd9){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0xc8'),_0x56afd9[_0x666e('0x37')]));if(!this['isConfigured'](_0x56afd9['ndauth_url'])){return this['channel'][_0x666e('0x8e')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x666e('0x81')](_0x56afd9['username'])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xc9'));}if(!this[_0x666e('0x81')](_0x56afd9[_0x666e('0xca')])){return this[_0x666e('0xe')]['noop'](_0x666e('0xcb'));}if(!this['isConfigured'](_0x56afd9[_0x666e('0xcc')])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20text\x20configured');}this[_0x666e('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x56afd9);this[_0x666e('0x42')](_0x56afd9[_0x666e('0x5c')],'in');this['channel'][_0x666e('0x8e')](util['format'](_0x666e('0xcd'),_0x56afd9['text']));var _0x387f06=this[_0x666e('0x5d')][_0x666e('0x83')](this,_0x56afd9);if(_0x387f06){for(var _0x244753 in _0x387f06){if(_0x387f06[_0x666e('0x77')](_0x244753)){this['channel']['setVariable'](util[_0x666e('0x26')]('SESTEK_NDA_%s',_0x244753['toUpperCase']()),_0x387f06[_0x244753]);}}this[_0x666e('0x42')](_0x387f06['speech'],_0x666e('0xc5'));if(_0x387f06[_0x666e('0xce')]){this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0xcf'),_0x387f06[_0x666e('0xce')]));var _0xc27c71=this[_0x666e('0xe')][_0x666e('0xd0')](_0x387f06[_0x666e('0xce')]);try{fs[_0x666e('0xd1')](_0x387f06[_0x666e('0xce')]+_0x666e('0xd2'));}catch(_0x55a96a){logger[_0x666e('0x2a')](_0x55a96a);}return _0xc27c71;}else{return this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0xd3'),_0x387f06[_0x666e('0xc7')]));}}return this[_0x666e('0xe')][_0x666e('0x2a')](_0x56afd9,_0x666e('0xd4'));};AGIVertices[_0x666e('0x11')]['end']=function(_0x4f374d){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x4f374d[_0x666e('0x37')]));return this['channel'][_0x666e('0x8e')](_0x666e('0xd5'));};AGIVertices[_0x666e('0x11')][_0x666e('0xd6')]=function(_0x362d80){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x362d80['label']));var _0x3e6e1f='';if(_0x362d80[_0x666e('0xd7')]){if(!this[_0x666e('0x81')](_0x362d80[_0x666e('0xd7')])){return this[_0x666e('0xe')]['error'](_0x362d80,'no\x20trunk\x20selected');}else{var _0x401564=parseInt(_0x362d80['trunk_id'],0xa);if(isNaN(_0x401564)){_0x3e6e1f=_0x362d80[_0x666e('0xd7')];}else{_0x3e6e1f=this[_0x666e('0x1b')][_0x666e('0x83')](this,_0x362d80[_0x666e('0xd7')]);if(!_0x3e6e1f){return this['channel'][_0x666e('0x2a')](_0x362d80,_0x666e('0xd8'));}}}}else if(_0x362d80[_0x666e('0xd9')]){_0x3e6e1f=_0x362d80[_0x666e('0xd9')];}else{return this['channel']['error'](_0x362d80,_0x666e('0xda'));}var _0x3ac520=this[_0x666e('0xe')]['exec'](_0x666e('0xbc'),[util[_0x666e('0x26')](_0x666e('0xdb'),_0x3e6e1f,_0x362d80[_0x666e('0x49')]),_0x362d80[_0x666e('0x89')],_0x362d80[_0x666e('0xbe')],_0x362d80[_0x666e('0xbf')]]);if(_0x3ac520['result']===-0x1){return _0x3ac520;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0xc0'),_0x666e('0xbc')));};AGIVertices[_0x666e('0x11')][_0x666e('0xdc')]=function(_0x20f6f2){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x20f6f2[_0x666e('0x37')]));return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xdc'));};AGIVertices['prototype'][_0x666e('0xc')]=function(_0x5bde4b){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0xdd'),_0x5bde4b[_0x666e('0x37')]));if(_0x5bde4b[_0x666e('0x84')]===0x0){return this[_0x666e('0x82')](_0x5bde4b);}_0x5bde4b['retry']-=0x1;if(!this['isConfigured'](_0x5bde4b[_0x666e('0xde')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x5bde4b,_0x666e('0xdf'));}var _0x1c0f12=this[_0x666e('0x1d')][_0x666e('0x83')](this,_0x5bde4b[_0x666e('0xde')]);if(!_0x1c0f12){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x5bde4b,_0x666e('0xe0'));}if(!this[_0x666e('0x81')](_0x5bde4b[_0x666e('0xb1')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x666e('0xb2'));}var _0x12da2f=this[_0x666e('0xe')]['getData'](_0x1c0f12,_0x5bde4b[_0x666e('0xe1')],_0x5bde4b[_0x666e('0xe2')]);var _0x5042ef=_0x12da2f[_0x666e('0x7e')]?_0x12da2f[_0x666e('0x7e')][_0x666e('0xe3')]():'';logger[_0x666e('0x2c')](_0x666e('0xe4'),JSON[_0x666e('0xe5')](_0x12da2f));if(_0x12da2f[_0x666e('0x7e')]===-0x1){this[_0x666e('0x35')][_0x666e('0x83')](this,_0x5bde4b,_0x5042ef);return _0x12da2f;}else if(_0x12da2f['extra']==='timeout'){_0x12da2f[_0x666e('0x7e')]=_0x5042ef['length']>=parseInt(_0x5bde4b[_0x666e('0xe6')])?'x':'i';}else{_0x12da2f[_0x666e('0x7e')]=_0x5042ef[_0x666e('0x79')]>=parseInt(_0x5bde4b['mindigit'])&&_0x5042ef['length']<=parseInt(_0x5bde4b[_0x666e('0xe2')])?'x':'i';}var _0x4335a2=this[_0x666e('0x12')]['sync'](this,_0x5bde4b[_0x666e('0xb1')]);if(!_0x4335a2){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x5bde4b,_0x666e('0xb3'));}this[_0x666e('0xe')]['setVariable'](_0x4335a2,_0x5042ef);if(this['isConfigured'](_0x5bde4b[_0x666e('0xe7')])){var _0x4ae540=parseInt(_0x5bde4b[_0x666e('0xe7')],0xa);var _0x2a875f=rs['generate']({'charset':'*','length':_0x4ae540});var _0x4343c6=_0x5042ef[_0x666e('0x79')];if(_0x4343c6>0x0){if(_0x4343c6>_0x4ae540){this['createSquareDetailsReport'][_0x666e('0x83')](this,_0x5bde4b,_0x5bde4b[_0x666e('0xe8')]===_0x666e('0xe9')?_0x2a875f+_0x5042ef['substr'](_0x4ae540):_0x5042ef[_0x666e('0xea')](0x0,_0x4343c6-_0x4ae540)+_0x2a875f);}else{this[_0x666e('0x35')][_0x666e('0x83')](this,_0x5bde4b,rs[_0x666e('0xeb')]({'charset':'*','length':_0x4343c6}));}}else{this[_0x666e('0x35')][_0x666e('0x83')](this,_0x5bde4b,'');}}else{this[_0x666e('0x35')]['sync'](this,_0x5bde4b,_0x5042ef);}return _0x12da2f;};AGIVertices[_0x666e('0x11')][_0x666e('0xd')]=function(_0x33df6d){logger['info'](util[_0x666e('0x26')](_0x666e('0xec'),_0x33df6d[_0x666e('0x37')]));return this[_0x666e('0xc')](_0x33df6d);};AGIVertices[_0x666e('0x11')][_0x666e('0xed')]=function(_0x5d6baf){logger['info'](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x5d6baf['label']));this[_0x666e('0x35')][_0x666e('0x83')](this,_0x5d6baf,_0x5d6baf[_0x666e('0xee')]);return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0xef'),_0x5d6baf[_0x666e('0xee')]));};AGIVertices[_0x666e('0x11')][_0x666e('0xf0')]=function(_0x790ce4){logger['info'](util[_0x666e('0x26')](_0x666e('0xf1'),_0x790ce4[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x790ce4[_0x666e('0x66')])||!this['isConfigured'](_0x790ce4['aws_secret_access_key'])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xf2'));}if(!this[_0x666e('0x81')](_0x790ce4[_0x666e('0x5c')])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0x99'));}this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0xf3'),_0x790ce4[_0x666e('0x5c')]));var _0x367da9=this[_0x666e('0x65')]['sync'](this,_0x790ce4);if(_0x367da9){this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0xf4'),_0x367da9));var _0xf15aa0=this[_0x666e('0xe')][_0x666e('0xd0')](_0x367da9);try{fs[_0x666e('0xd1')](_0x367da9+_0x666e('0xd2'));}catch(_0x10198f){logger[_0x666e('0x2a')](_0x10198f);}return _0xf15aa0;}return this[_0x666e('0xe')]['error'](_0x790ce4,_0x666e('0xf5'));};AGIVertices['prototype'][_0x666e('0xf6')]=function(_0x284d12){logger['info'](util[_0x666e('0x26')](_0x666e('0xf7'),_0x284d12[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x284d12[_0x666e('0x66')])||!this[_0x666e('0x81')](_0x284d12[_0x666e('0x67')])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xf2'));}if(!this[_0x666e('0x81')](_0x284d12[_0x666e('0x6e')])){return this[_0x666e('0xe')]['noop'](_0x666e('0xf8'));}if(!this[_0x666e('0x81')](_0x284d12[_0x666e('0x5c')])){return this['channel']['noop'](_0x666e('0x99'));}this[_0x666e('0xe')][_0x666e('0xf9')]=!![];this['createSquareDetailsReport'](_0x284d12);this['createSquareMessage'](_0x284d12[_0x666e('0x5c')],'in');this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')]('Trying\x20Amazon\x20Lex:\x20%s',_0x284d12['text']));var _0x379936=this[_0x666e('0x6c')][_0x666e('0x83')](this,_0x284d12);if(_0x379936){for(var _0x4d539d in _0x379936){if(_0x379936[_0x666e('0x77')](_0x4d539d)&&_['isString'](_0x379936[_0x4d539d])){this[_0x666e('0xe')][_0x666e('0x80')](util[_0x666e('0x26')](_0x666e('0xfa'),_0x4d539d[_0x666e('0xfb')]()),_0x379936[_0x4d539d]);}}if(_[_0x666e('0x45')](_0x379936[_0x666e('0xfc')])){return this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0xfd'));}else{this[_0x666e('0x42')](_0x379936[_0x666e('0xfc')],_0x666e('0xc5'));return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0xfe'),_0x379936[_0x666e('0xfc')]));}}return this[_0x666e('0xe')][_0x666e('0x2a')](_0x284d12,_0x666e('0xff'));};AGIVertices[_0x666e('0x11')][_0x666e('0x100')]=function(_0x397df5){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x101'),_0x397df5[_0x666e('0x37')],_0x397df5[_0x666e('0x89')]));if(!this[_0x666e('0x81')](_0x397df5[_0x666e('0x5b')])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20key\x20configured');}var _0x1982ea=_0x666e('0x102');var _0xddc6aa=util[_0x666e('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x666e('0xeb')](0x4));var _0x164d1d=util[_0x666e('0x26')]('%s.%s',_0xddc6aa,_0x1982ea);var _0x41cd49=!![];if(_0x397df5[_0x666e('0x103')]===_0x666e('0x104')){_0x41cd49=![];}var _0x2e0f80=this['channel'][_0x666e('0x105')](_0xddc6aa,_0x1982ea,_0x397df5[_0x666e('0x106')],_0x397df5[_0x666e('0x89')],undefined,_0x41cd49);if(_0x2e0f80['result']!==-0x1){this['channel']['noop'](util[_0x666e('0x26')](_0x666e('0x107'),_0x164d1d));var _0x62a4a4=this[_0x666e('0x6f')][_0x666e('0x83')](this,_0x397df5,_0x164d1d);if(_0x62a4a4){for(var _0x1194a2 in _0x62a4a4){if(_0x62a4a4[_0x666e('0x77')](_0x1194a2)){this['channel'][_0x666e('0x80')](util[_0x666e('0x26')](_0x666e('0x108'),_0x1194a2[_0x666e('0xfb')]()),_0x62a4a4[_0x1194a2]);}}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x109'),JSON[_0x666e('0xe5')](_0x62a4a4)));}}return _0x2e0f80;};AGIVertices[_0x666e('0x11')][_0x666e('0x10a')]=function(_0x393e90){logger[_0x666e('0x2c')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x393e90['label']));if(!this[_0x666e('0x81')](_0x393e90[_0x666e('0x72')])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x393e90['appsecret'])){return this['channel'][_0x666e('0x8e')](_0x666e('0x10b'));}var _0x2c7c30=_0x666e('0x102');var _0x58ef0d=util[_0x666e('0x26')](_0x666e('0x10c'),FILES_PATH,rs[_0x666e('0xeb')](0x4));var _0x28e6e4=util[_0x666e('0x26')](_0x666e('0x10d'),_0x58ef0d,_0x2c7c30);var _0x7e8de8=!![];if(_0x393e90[_0x666e('0x103')]==='NOBEEP'){_0x7e8de8=![];}var _0x357618=this['channel']['recordFile'](_0x58ef0d,_0x2c7c30,_0x393e90['intKey'],_0x393e90['timeout'],undefined,_0x7e8de8);if(_0x357618[_0x666e('0x7e')]!==-0x1){this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x10e'),_0x28e6e4));var _0x462993=this[_0x666e('0x71')][_0x666e('0x83')](this,_0x393e90,_0x28e6e4);if(_0x462993){for(var _0x37445f in _0x462993){if(_0x462993['hasOwnProperty'](_0x37445f)){this[_0x666e('0xe')][_0x666e('0x80')](util[_0x666e('0x26')](_0x666e('0x10f'),_0x37445f[_0x666e('0xfb')]()),_0x462993[_0x37445f]);}}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x110'),JSON['stringify'](_0x462993)));}}return _0x357618;};AGIVertices[_0x666e('0x11')][_0x666e('0x111')]=function(_0x3847b7){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x112'),_0x3847b7['label']));return this[_0x666e('0xe')][_0x666e('0x113')](_0x3847b7['context'],_0x3847b7[_0x666e('0x3d')],_0x3847b7[_0x666e('0x3e')]);};AGIVertices[_0x666e('0x11')][_0x666e('0x114')]=function(_0x432bb2){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x432bb2['label']));if(!this[_0x666e('0x81')](_0x432bb2[_0x666e('0x115')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x432bb2,_0x666e('0x116'));}try{var _0x340e20=eval(_0x432bb2[_0x666e('0x115')])?_0x666e('0x117'):_0x666e('0x118');this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x119'),_0x432bb2['condition'],_0x340e20));return{'code':0xc8,'result':_0x340e20};}catch(_0x3385c3){return{'code':0xc8,'result':_0x666e('0x118')};}};AGIVertices['prototype'][_0x666e('0x11a')]=function(_0x364bad){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x11b'),_0x364bad[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x364bad[_0x666e('0x11c')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x364bad,_0x666e('0x11d'));}var _0x50c9d4=this[_0x666e('0x23')][_0x666e('0x83')](this,_0x364bad['interval_id']);if(!_0x50c9d4){return this[_0x666e('0xe')]['error'](_0x364bad,_0x666e('0x11e'));}for(var _0x31957c=0x0;_0x31957c<_0x50c9d4['length'];_0x31957c+=0x1){var _0x44c61e=this['channel'][_0x666e('0x12')](util[_0x666e('0x26')](_0x666e('0x11f'),_0x50c9d4[_0x31957c]));if(_0x44c61e['result']===-0x1){return _0x44c61e;}logger[_0x666e('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x50c9d4[_0x31957c],_0x44c61e[_0x666e('0x7b')]));if(_0x44c61e[_0x666e('0x7b')]===_0x666e('0x117')){logger[_0x666e('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x50c9d4[_0x31957c],_0x666e('0x117')));this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0x120'),_0x50c9d4[_0x31957c],_0x666e('0x117')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x666e('0x26')](_0x666e('0x120'),_0x50c9d4[_0x31957c],_0x666e('0x118')));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x120'),_0x50c9d4[_0x31957c],_0x666e('0x118')));}}return{'code':0xc8,'result':_0x666e('0x118')};};AGIVertices[_0x666e('0x11')][_0x666e('0x121')]=function(_0x332919){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x332919[_0x666e('0x37')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0x666e('0x122')]=function(_0x4b0899){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x123'),_0x4b0899[_0x666e('0x37')]));if(!this['isConfigured'](_0x4b0899['key'])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20key\x20configured');}var _0x5d9e64=_0x666e('0x102');var _0x2aac5a=util[_0x666e('0x26')](_0x666e('0x10c'),FILES_PATH,rs[_0x666e('0xeb')](0x4));var _0x5eac6f=util[_0x666e('0x26')](_0x666e('0x10d'),_0x2aac5a,_0x5d9e64);var _0x58cdea=!![];if(_0x4b0899[_0x666e('0x103')]==='NOBEEP'){_0x58cdea=![];}var _0x168542=this[_0x666e('0xe')]['recordFile'](_0x2aac5a,_0x5d9e64,_0x4b0899[_0x666e('0x106')],_0x4b0899[_0x666e('0x89')],undefined,_0x58cdea);if(_0x168542['result']!==-0x1){this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0x124'),_0x5eac6f));var _0x1e9049=this['ispeechASR'][_0x666e('0x83')](this,_0x4b0899,_0x5eac6f);if(_0x1e9049){for(var _0x5864e6 in _0x1e9049){if(_0x1e9049[_0x666e('0x77')](_0x5864e6)){this[_0x666e('0xe')][_0x666e('0x80')](util[_0x666e('0x26')](_0x666e('0x125'),_0x5864e6[_0x666e('0xfb')]()),_0x1e9049[_0x5864e6]);}}return this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x126'),JSON['stringify'](_0x1e9049)));}}return _0x168542;};AGIVertices[_0x666e('0x11')][_0x666e('0x127')]=function(_0x26baa6){logger['info'](util[_0x666e('0x26')](_0x666e('0x128'),_0x26baa6[_0x666e('0x37')]));if(!this['isConfigured'](_0x26baa6[_0x666e('0x5b')])){return this[_0x666e('0xe')]['noop'](_0x666e('0xc3'));}if(!this[_0x666e('0x81')](_0x26baa6[_0x666e('0x5c')])){return this['channel'][_0x666e('0x8e')](_0x666e('0x99'));}this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0x129'),_0x26baa6['text']));var _0x547c99=this[_0x666e('0x5e')][_0x666e('0x83')](this,_0x26baa6);if(_0x547c99){this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x124'),_0x547c99));var _0x1e9234=this[_0x666e('0xe')][_0x666e('0xd0')](_0x547c99,_0x26baa6[_0x666e('0x106')]);try{fs['unlink'](_0x547c99+_0x666e('0xd2'));}catch(_0x127e01){logger[_0x666e('0x2a')](_0x127e01);}return _0x1e9234;}return this[_0x666e('0xe')][_0x666e('0x2a')](_0x26baa6,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x666e('0x12a')]=function(_0x2b2013){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12b'),_0x2b2013[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x2b2013['findBy'])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x2b2013,'no\x20find\x20by\x20configured');}logger['info'](util[_0x666e('0x26')](_0x666e('0x12c'),this[_0x666e('0xe')]['callerid'],_0x2b2013[_0x666e('0x12d')]));var _0x460b19=this[_0x666e('0x55')][_0x666e('0x83')](this,_0x2b2013[_0x666e('0x12d')]);if(_0x460b19){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12e'),this[_0x666e('0xe')]['callerid'],_0x2b2013[_0x666e('0x12d')]));this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0x12e'),this[_0x666e('0xe')]['callerid'],_0x2b2013['findBy']));return{'code':0xc8,'result':_0x666e('0x12f')};}else{logger[_0x666e('0x2c')](util['format'](_0x666e('0x130'),this[_0x666e('0xe')][_0x666e('0x3a')],_0x2b2013[_0x666e('0x12d')]));this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0x130'),this[_0x666e('0xe')][_0x666e('0x3a')],_0x2b2013[_0x666e('0x12d')]));return{'code':0xc8,'result':_0x666e('0x131')};}};AGIVertices[_0x666e('0x11')][_0x666e('0x132')]=function(_0x19dd0a){logger[_0x666e('0x2c')](util['format'](_0x666e('0x133'),_0x19dd0a[_0x666e('0x37')]));if(!this['isConfigured'](_0x19dd0a[_0x666e('0x12d')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x19dd0a,_0x666e('0x134'));}logger['info'](util[_0x666e('0x26')](_0x666e('0x12c'),this[_0x666e('0xe')][_0x666e('0x3a')],_0x19dd0a[_0x666e('0x12d')]));var _0x11b7e6=this[_0x666e('0x54')][_0x666e('0x83')](this,_0x19dd0a[_0x666e('0x12d')]);if(_0x11b7e6){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x666e('0xe')][_0x666e('0x3a')],_0x19dd0a[_0x666e('0x12d')]));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x12e'),this['channel']['callerid'],_0x19dd0a['findBy']));return{'code':0xc8,'result':_0x666e('0x12f')};}else{logger['info'](util[_0x666e('0x26')](_0x666e('0x130'),this['channel'][_0x666e('0x3a')],_0x19dd0a[_0x666e('0x12d')]));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x130'),this[_0x666e('0xe')]['callerid'],_0x19dd0a[_0x666e('0x12d')]));return{'code':0xc8,'result':_0x666e('0x131')};}};AGIVertices[_0x666e('0x11')][_0x666e('0x135')]=function(_0x46f660){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x136'),_0x46f660[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x46f660[_0x666e('0x137')])){return this['channel']['error'](_0x46f660,_0x666e('0x138'));}this['channel']['noop'](util['format']('math\x20%s',_0x46f660[_0x666e('0x137')]));var _0xfbebe4=eval(_0x46f660[_0x666e('0x137')]);if(!this[_0x666e('0x81')](_0x46f660[_0x666e('0xb1')])){return this[_0x666e('0xe')]['noop'](_0x666e('0xb2'));}var _0x3e40c9=this[_0x666e('0x12')]['sync'](this,_0x46f660['variable_id']);if(!_0x3e40c9){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x46f660,_0x666e('0xb3'));}if(_[_0x666e('0x139')](_0xfbebe4)){var _0x3b0978=this;_0xfbebe4[_0x666e('0xb4')](function(_0x53c114,_0x1e0339){_0x3b0978[_0x666e('0xe')][_0x666e('0x80')](util[_0x666e('0x26')]('%s[%s]',_0x3e40c9,_0x1e0339),_0x53c114);});return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x13a'),_0x3e40c9));}else{return this[_0x666e('0xe')][_0x666e('0x80')](_0x3e40c9,_0xfbebe4);}};AGIVertices['prototype'][_0x666e('0xb')]=function(_0xadb412){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x13b'),_0xadb412[_0x666e('0x37')]));if(_0xadb412['retry']===0x0){return this[_0x666e('0x82')](_0xadb412);}_0xadb412[_0x666e('0x84')]-=0x1;if(!this['isConfigured'](_0xadb412[_0x666e('0xde')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0xadb412,_0x666e('0xdf'));}var _0x1f6383=this['getSound']['sync'](this,_0xadb412['file_id']);if(!_0x1f6383){return this[_0x666e('0xe')][_0x666e('0x2a')](_0xadb412,_0x666e('0xe0'));}var _0x1166a4=this[_0x666e('0xe')]['getData'](_0x1f6383,_0xadb412[_0x666e('0xe1')],_0xadb412[_0x666e('0x13c')]);var _0x2ddb01=_0x1166a4[_0x666e('0x7e')];if(_0x1166a4['result']===-0x1){this[_0x666e('0x35')][_0x666e('0x83')](this,_0xadb412,'-1');return _0x1166a4;}else if(_0x1166a4[_0x666e('0x7b')]===_0x666e('0x89')){_0x1166a4[_0x666e('0x7e')]=_0x1166a4['result'][_0x666e('0x79')]>0x0?_0x1166a4[_0x666e('0x7e')]:'t';}else if(_['isEmpty'](_0x1166a4[_0x666e('0x7e')])){_0x1166a4[_0x666e('0x7e')]='#';_0x2ddb01='#';}if(!this[_0x666e('0x81')](_0xadb412[_0x666e('0xb1')])){this['channel'][_0x666e('0x8e')](_0x666e('0xb2'));}else{var _0x5d2a5b=this[_0x666e('0x12')]['sync'](this,_0xadb412[_0x666e('0xb1')]);if(!_0x5d2a5b){return this[_0x666e('0xe')][_0x666e('0x2a')](_0xadb412,_0x666e('0xb3'));}this[_0x666e('0xe')][_0x666e('0x80')](_0x5d2a5b,_0x2ddb01);}this[_0x666e('0x35')][_0x666e('0x83')](this,_0xadb412,_0x2ddb01);return _0x1166a4;};AGIVertices['prototype'][_0x666e('0x8e')]=function(_0x46ba1f){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x13d'),_0x46ba1f['label']));return this[_0x666e('0xe')][_0x666e('0x8e')](_0x46ba1f['output']||_0x46ba1f[_0x666e('0x37')]);};AGIVertices[_0x666e('0x11')][_0x666e('0x13e')]=function(_0x22dee8){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x22dee8[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x22dee8['findBy'])){return this[_0x666e('0xe')]['error'](_0x22dee8,_0x666e('0x134'));}logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12c'),this[_0x666e('0xe')]['callerid'],_0x22dee8[_0x666e('0x12d')]));var _0x1f5e0c=this[_0x666e('0x4f')][_0x666e('0x83')](this,_0x22dee8[_0x666e('0x13f')]);var _0x3b3226=this[_0x666e('0x51')]['sync'](this,_0x22dee8[_0x666e('0x12d')],_0x1f5e0c);if(_0x3b3226){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12e'),this[_0x666e('0xe')][_0x666e('0x3a')],_0x22dee8[_0x666e('0x12d')]));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x666e('0x3a')],_0x22dee8[_0x666e('0x12d')]));return{'code':0xc8,'result':_0x666e('0x12f')};}else{logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x130'),this[_0x666e('0xe')][_0x666e('0x3a')],_0x22dee8['findBy']));this['channel'][_0x666e('0x8e')](util['format'](_0x666e('0x12e'),this[_0x666e('0xe')]['callerid'],_0x22dee8[_0x666e('0x12d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x666e('0x140')]=function(_0x319b30){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x141'),_0x319b30[_0x666e('0x37')]));if(!this['isConfigured'](_0x319b30[_0x666e('0xde')])){return this[_0x666e('0xe')]['error'](_0x319b30,'no\x20file\x20audio\x20selected');}var _0x41fe19=this[_0x666e('0x1d')][_0x666e('0x83')](this,_0x319b30['file_id']);if(!_0x41fe19){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x319b30,_0x666e('0xe0'));}var _0x5d0410=this['channel'][_0x666e('0x9d')](_0x666e('0x142'),[_0x41fe19,_0x319b30['opts']]);if(_0x5d0410['result']===-0x1){return _0x5d0410;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x143'),_0x666e('0x142'),_0x41fe19));};AGIVertices[_0x666e('0x11')][_0x666e('0x144')]=function(_0x23d7a9){logger[_0x666e('0x2c')](util['format'](_0x666e('0x145'),_0x23d7a9[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x23d7a9[_0x666e('0x146')])){return this[_0x666e('0xe')]['error'](_0x23d7a9,_0x666e('0x147'));}var _0x52d870='';var _0x17491c=parseInt(_0x23d7a9['queue_id'],0xa);if(isNaN(_0x17491c)){_0x52d870=_0x23d7a9[_0x666e('0x146')];}else{_0x52d870=this[_0x666e('0x148')][_0x666e('0x83')](this,_0x23d7a9['queue_id']);if(!_0x52d870){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x23d7a9,'no\x20queue\x20found');}}var _0x409191='';if(this[_0x666e('0x81')](_0x23d7a9[_0x666e('0xde')])){var _0x529797=this[_0x666e('0x1d')][_0x666e('0x83')](this,_0x23d7a9[_0x666e('0xde')]);if(_0x529797){_0x409191=_0x529797;}}this[_0x666e('0x35')][_0x666e('0x83')](this,_0x23d7a9,_0x52d870);if(_0x23d7a9[_0x666e('0xbe')]['indexOf']('x')<0x0){_0x23d7a9[_0x666e('0xbe')]+='x';}if(_0x23d7a9[_0x666e('0xbe')][_0x666e('0x149')]('X')<0x0){_0x23d7a9[_0x666e('0xbe')]+='X';}this[_0x666e('0xe')][_0x666e('0x80')](_0x666e('0x14a'),_0x52d870?_0x52d870[_0x666e('0x14b')]():'');var _0x364cee=this[_0x666e('0xe')][_0x666e('0x9d')](_0x666e('0x14c'),[_0x52d870,_0x23d7a9[_0x666e('0xbe')],_0x23d7a9['url'],_0x409191,_0x23d7a9['timeout'],_0x23d7a9['agi'],_0x23d7a9[_0x666e('0x14d')],_0x23d7a9['gosub'],'',_0x23d7a9['position']]);if(_0x364cee[_0x666e('0x7e')]===-0x1){return _0x364cee;}return this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x143'),_0x666e('0x14c'),_0x52d870));};AGIVertices['prototype'][_0x666e('0x14e')]=function(_0xe887bf){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xe887bf[_0x666e('0x37')]));var _0x17157c=_0xe887bf[_0x666e('0x14f')]||_0x666e('0x102');var _0xc8eeff=util['format'](_0x666e('0x150'),this[_0x666e('0xe')][_0x666e('0x36')],rs['generate'](0x5));var _0x15ea92=util['format'](_0x666e('0x151'),FILES_PATH,_0xc8eeff,_0x17157c);var _0x1a3808=util['format'](_0x666e('0x10c'),FILES_PATH,_0xc8eeff);this[_0x666e('0x3b')][_0x666e('0x83')](this,_0xe887bf,_0xc8eeff,_0x15ea92);this[_0x666e('0xe')][_0x666e('0x80')](_0x666e('0x152'),_0xc8eeff);logger[_0x666e('0x2c')](_0x666e('0x153'),_0x1a3808,_0x17157c,_0xe887bf[_0x666e('0x154')],_0xe887bf['timeout']);return this[_0x666e('0xe')][_0x666e('0x105')](_0x1a3808,_0x17157c,_0xe887bf[_0x666e('0x154')],_0xe887bf[_0x666e('0x89')],undefined,!![]);};AGIVertices[_0x666e('0x11')][_0x666e('0x155')]=function(_0x38574e){logger[_0x666e('0x2c')](util['format'](_0x666e('0x156'),_0x38574e[_0x666e('0x37')]));return this['channel'][_0x666e('0x157')](_0x38574e[_0x666e('0x158')][_0x666e('0xb0')](/\s+/g,''),_0x38574e[_0x666e('0x154')]);};AGIVertices[_0x666e('0x11')][_0x666e('0x159')]=function(_0x39f86e){logger['info'](util[_0x666e('0x26')](_0x666e('0x15a'),_0x39f86e['label']));return this[_0x666e('0xe')]['sayNumber'](_0x39f86e[_0x666e('0x15b')]['replace'](/\s+/g,''),_0x39f86e[_0x666e('0x154')]);};AGIVertices[_0x666e('0x11')][_0x666e('0x15c')]=function(_0x28a759){logger['info'](util[_0x666e('0x26')](_0x666e('0x15d'),_0x28a759[_0x666e('0x37')]));return this[_0x666e('0xe')][_0x666e('0x15e')](_0x28a759['text'],_0x28a759[_0x666e('0x154')]);};AGIVertices[_0x666e('0x11')]['sendMail']=function(_0x198332){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x15f'),_0x198332['label']));if(!this[_0x666e('0x81')](_0x198332[_0x666e('0x160')])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20mail\x20account\x20configured');}var _0x38cad4=this['getMailAccount'][_0x666e('0x83')](this,_0x198332[_0x666e('0x160')]);if(!_0x38cad4||!_0x38cad4[_0x666e('0x161')]){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x198332,'no\x20mail\x20account\x20found');}var _0x1b105b={'from':util[_0x666e('0x26')](_0x666e('0x162'),_0x38cad4[_0x666e('0x15')],_0x38cad4['email']||_0x38cad4[_0x666e('0x161')]['user']),'to':_0x198332['to']||'','cc':_0x198332['cc']||'','bcc':_0x198332[_0x666e('0x163')]||'','subject':_0x198332['subject'],'html':_0x198332['text'],'text':_0x198332['text']};var _0x37c276={'tls':{'rejectUnauthorized':![]}};if(_0x38cad4[_0x666e('0x161')][_0x666e('0x164')]){_0x37c276[_0x666e('0x164')]=_0x38cad4[_0x666e('0x161')][_0x666e('0x164')];}else{_0x37c276['host']=_0x38cad4[_0x666e('0x161')][_0x666e('0x165')];_0x37c276['port']=_0x38cad4[_0x666e('0x161')]['port'];_0x37c276['secure']=_0x38cad4[_0x666e('0x161')][_0x666e('0x166')];}if(_0x38cad4[_0x666e('0x161')][_0x666e('0x167')]){_0x37c276[_0x666e('0x168')]={'user':_0x38cad4[_0x666e('0x161')][_0x666e('0x169')],'pass':_0x38cad4['Smtp']['pass']};}if(this[_0x666e('0x81')](_0x198332['template_id'])){}logger[_0x666e('0xb9')](_0x666e('0x16a'),JSON[_0x666e('0xe5')](_0x1b105b));this[_0x666e('0x35')][_0x666e('0x83')](this,_0x198332,_0x198332[_0x666e('0x160')]);this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0x16b'),_0x38cad4[_0x666e('0x15')]));this[_0x666e('0x22')][_0x666e('0x83')](this,_0x37c276,_0x1b105b);return this['channel'][_0x666e('0x8e')](_0x666e('0x16c'));};AGIVertices[_0x666e('0x11')][_0x666e('0x16d')]=function(_0x516d3e){logger[_0x666e('0x2c')](util[_0x666e('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x516d3e[_0x666e('0x37')]));return this[_0x666e('0xe')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x666e('0x11')]['sendSMS']=function(_0x339dd6){logger[_0x666e('0x2c')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x339dd6[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x339dd6[_0x666e('0x16e')])){return this[_0x666e('0xe')][_0x666e('0x8e')]('no\x20sms\x20account\x20configured');}var _0xcff26d=this[_0x666e('0x32')][_0x666e('0x83')](this,_0x339dd6['sms_account_id']);if(!_0xcff26d){return this['channel'][_0x666e('0x2a')](_0x339dd6,_0x666e('0x16f'));}var _0x1c650f={'body':_0x339dd6[_0x666e('0x170')],'phone':_0x339dd6['to']||'','SmsAccountId':_0xcff26d['id']};logger[_0x666e('0xb9')](_0x666e('0x171'),JSON[_0x666e('0xe5')](_0x1c650f));this[_0x666e('0x35')]['sync'](this,_0x339dd6,_0x339dd6[_0x666e('0x16e')]);this['channel'][_0x666e('0x8e')](util['format'](_0x666e('0x172'),_0xcff26d[_0x666e('0x15')]));this['createSmsMessage'][_0x666e('0x83')](this,_0x1c650f);return this['channel']['noop'](_0x666e('0x173'));};AGIVertices['prototype'][_0x666e('0x174')]=function(_0x49f275){logger['info'](util[_0x666e('0x26')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x49f275[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x49f275[_0x666e('0xb1')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x49f275,_0x666e('0x175'));}var _0x26d08a=this[_0x666e('0x12')][_0x666e('0x83')](this,_0x49f275[_0x666e('0xb1')]);if(!_0x26d08a){return this['channel']['error'](_0x49f275,_0x666e('0xb3'));}return this[_0x666e('0xe')][_0x666e('0x80')](_0x26d08a,_0x49f275['variable_value']);};AGIVertices['prototype'][_0x666e('0x176')]=function(_0x531bcf){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x177'),_0x531bcf['label']));this[_0x666e('0xe')]['noop']('START\x20CALLY\x20SQUARE');if(_0x531bcf[_0x666e('0x87')]===_0x666e('0x178')){this[_0x666e('0xe')][_0x666e('0x8e')](_0x666e('0x179'));return this[_0x666e('0xe')][_0x666e('0x87')]();}return this['channel'][_0x666e('0x8e')](_0x666e('0x17a'));};AGIVertices[_0x666e('0x11')][_0x666e('0x17b')]=function(_0x3bbd14){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x17c'),_0x3bbd14[_0x666e('0x37')]));if(!this['isConfigured'](_0x3bbd14[_0x666e('0x17d')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x3bbd14,_0x666e('0x17e'));}var _0x44d3d7=this[_0x666e('0x17f')]['sync'](this,_0x3bbd14['project_id']);if(!this[_0x666e('0x81')](_0x44d3d7)){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x3bbd14,util[_0x666e('0x26')](_0x666e('0x180'),_0x3bbd14[_0x666e('0x17d')]));}if(_0x44d3d7===this[_0x666e('0xe')][_0x666e('0x39')]){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x3bbd14,_0x666e('0x181'));}this[_0x666e('0x35')]['sync'](this,_0x3bbd14,_0x44d3d7);var _0x4944bc=this[_0x666e('0xe')][_0x666e('0x9d')](_0x666e('0x182'),util[_0x666e('0x26')](_0x666e('0x183'),config[_0x666e('0x184')]['host']||'127.0.0.1',_0x44d3d7,this[_0x666e('0xe')][_0x666e('0x39')]));if(_0x4944bc[_0x666e('0x7e')]===-0x1){return _0x4944bc;}return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x143'),_0x666e('0x182'),_0x44d3d7));};AGIVertices[_0x666e('0x11')][_0x666e('0x185')]=function(_0xb1d233){logger[_0x666e('0x2c')](util['format'](_0x666e('0x186'),_0xb1d233['label']));var _0x3641d0=this['shellCommand'][_0x666e('0x83')](this,_0xb1d233[_0x666e('0x86')]);this['createSquareDetailsReport'][_0x666e('0x83')](this,_0xb1d233,_0xb1d233[_0x666e('0x86')]);if(this['isConfigured'](_0xb1d233[_0x666e('0xb1')])){var _0x1f54e8=this['getVariable']['sync'](this,_0xb1d233['variable_id']);if(_0x1f54e8){this[_0x666e('0xe')]['setVariable'](_0x1f54e8,_0x3641d0);return this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x187'),_0xb1d233['command'],_0x1f54e8));}}return this[_0x666e('0xe')]['noop'](util[_0x666e('0x26')](_0x666e('0x188'),_0xb1d233[_0x666e('0x86')]));};AGIVertices[_0x666e('0x11')][_0x666e('0x189')]=function(_0x57b4ac){logger['info'](util['format'](_0x666e('0x18a'),_0x57b4ac[_0x666e('0x37')]));if(!this['isConfigured'](_0x57b4ac[_0x666e('0x5c')])){return this['channel']['noop'](_0x666e('0x99'));}this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x18b'),_0x57b4ac[_0x666e('0x5c')]));var _0x1efde1=this[_0x666e('0x59')][_0x666e('0x83')](this,_0x57b4ac);if(_0x1efde1){this[_0x666e('0xe')][_0x666e('0x8e')](util['format'](_0x666e('0x18c'),_0x1efde1));var _0x1632c5=this[_0x666e('0xe')][_0x666e('0xd0')](_0x1efde1);try{fs[_0x666e('0xd1')](_0x1efde1+_0x666e('0xd2'));}catch(_0x3780de){logger[_0x666e('0x2a')](_0x3780de);}return _0x1632c5;}return this['channel'][_0x666e('0x2a')](_0x57b4ac,_0x666e('0x18d'));};AGIVertices[_0x666e('0x11')][_0x666e('0x18e')]=function(_0xdbabe8){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x18f'),_0xdbabe8[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0xdbabe8[_0x666e('0x12d')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0xdbabe8,'no\x20find\x20by\x20configured');}logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12c'),this['channel'][_0x666e('0x3a')],_0xdbabe8['findBy']));var _0x1dee29=this[_0x666e('0x53')][_0x666e('0x83')](this,_0xdbabe8[_0x666e('0x12d')]);if(_0x1dee29){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x12e'),this[_0x666e('0xe')]['callerid'],_0xdbabe8[_0x666e('0x12d')]));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x12e'),this[_0x666e('0xe')][_0x666e('0x3a')],_0xdbabe8['findBy']));return{'code':0xc8,'result':_0x666e('0x12f')};}else{logger[_0x666e('0x2c')](util[_0x666e('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x666e('0x3a')],_0xdbabe8['findBy']));this[_0x666e('0xe')][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x130'),this[_0x666e('0xe')][_0x666e('0x3a')],_0xdbabe8[_0x666e('0x12d')]));return{'code':0xc8,'result':_0x666e('0x131')};}};AGIVertices[_0x666e('0x11')][_0x666e('0x190')]=function(_0x439f12){logger[_0x666e('0x2c')](util[_0x666e('0x26')](_0x666e('0x191'),_0x439f12['label']));var _0x401d54=this[_0x666e('0xe')][_0x666e('0x9d')]('VOICEMAIL',[_0x439f12[_0x666e('0x192')],_0x439f12[_0x666e('0x91')]]);if(_0x401d54['result']===-0x1){return _0x401d54;}return this['channel'][_0x666e('0x8e')](util[_0x666e('0x26')](_0x666e('0x143'),_0x666e('0x193'),_0x439f12[_0x666e('0x192')]));};AGIVertices[_0x666e('0x11')]['vswitch']=function(_0x3b8c5a){logger[_0x666e('0x2c')](util['format'](_0x666e('0x194'),_0x3b8c5a[_0x666e('0x37')]));if(!this[_0x666e('0x81')](_0x3b8c5a[_0x666e('0xb1')])){return this[_0x666e('0xe')][_0x666e('0x2a')](_0x3b8c5a,_0x666e('0x175'));}var _0x193083=this[_0x666e('0x12')][_0x666e('0x83')](this,_0x3b8c5a[_0x666e('0xb1')]);if(!_0x193083){return this[_0x666e('0xe')]['error'](_0x3b8c5a,_0x666e('0xb3'));}var _0x56ce93=this[_0x666e('0xe')][_0x666e('0x12')](_0x193083);return{'code':0xc8,'result':_0x56ce93[_0x666e('0x7b')]?_0x56ce93['extra']:'-'};};String[_0x666e('0x11')]['replaceAll']=function(_0x48e290,_0x4d572f){return this['split'](_0x48e290)[_0x666e('0x195')](_0x4d572f);};module[_0x666e('0x196')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 0ae0589..2be4684 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 _0x0e85=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','prototype','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','attended','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','milliseconds','diff','seconds','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','destlinkedid','savePause'];(function(_0x105b7e,_0x3eba8c){var _0x328773=function(_0xffdc01){while(--_0xffdc01){_0x105b7e['push'](_0x105b7e['shift']());}};_0x328773(++_0x3eba8c);}(_0x0e85,0x7c));var _0x50e8=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x0e85[_0x307d86];return _0x361745;};'use strict';var util=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));var moment=require('moment');var ami=require(_0x50e8('0x2'));var logger=require(_0x50e8('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x236cf3){this['voiceQueues']=_0x236cf3[_0x50e8('0x4')];this[_0x50e8('0x5')]=_0x236cf3[_0x50e8('0x5')];this[_0x50e8('0x6')]=_0x236cf3['timers'];this[_0x50e8('0x7')]={};ami['on'](_0x50e8('0x8'),this[_0x50e8('0x9')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xb'),this[_0x50e8('0xc')]['bind'](this));ami['on'](_0x50e8('0xd'),this[_0x50e8('0xe')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xf'),this[_0x50e8('0x10')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0x11'),this[_0x50e8('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x50e8('0x13')][_0x50e8('0xa')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x50e8('0xa')](this));}function getDiff(_0x2abda1){var _0x1a4c85=moment()[_0x50e8('0x14')](0x0);var _0x54efd3=moment(_0x2abda1)[_0x50e8('0x14')](0x0);return _0x1a4c85[_0x50e8('0x15')](_0x54efd3,_0x50e8('0x16'));}Acw['prototype']['startAcw']=function(_0x30a872){try{var _0xf02b48=this;var _0x40c184=this[_0x50e8('0x7')][_0x30a872][_0x50e8('0x17')];var _0x1f0338=this['channels'][_0x30a872]['queue'];var _0x441f25=this[_0x50e8('0x4')][_0x1f0338];var _0x40d060=![];var _0x45ce11=_0x50e8('0x18');if(_0x441f25[_0x50e8('0x19')]){if(_0x441f25[_0x50e8('0x1a')]['name']){_0x40d060=!![];_0x45ce11=_0x441f25[_0x50e8('0x1a')]['name'];}}ami[_0x50e8('0x1b')]({'action':_0x50e8('0x1c'),'interface':_0x40c184,'paused':!![],'reason':_0x45ce11})[_0x50e8('0x1d')](function(_0x20f835){if(_0xf02b48[_0x50e8('0x5')][_0x40c184]){return RpcUser['getAgent'](_0xf02b48[_0x50e8('0x5')][_0x40c184]['id'])[_0x50e8('0x1d')](function(_0x58110d){if(_0x58110d&&!_0x58110d[_0x50e8('0x1e')]){logger[_0x50e8('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);var _0x1ce7fc=_0xf02b48[_0x50e8('0x7')][_0x30a872]['attended']&&_0xf02b48['channels'][_0x30a872]['destlinkedid']?_0xf02b48[_0x50e8('0x7')][_0x30a872][_0x50e8('0x20')]:_0x30a872;return RpcUser[_0x50e8('0x21')](_0xf02b48[_0x50e8('0x5')][_0x40c184],_0x45ce11,_0x1ce7fc)[_0x50e8('0x1d')](function(_0x13b6e9){if(!_0x40d060){_0xf02b48['timers'][_0x40c184]={};logger[_0x50e8('0x1f')](_0x50e8('0x22'),_0x30a872,_0xf02b48['voiceQueues'][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x24')]=setTimeout(_0xf02b48[_0x50e8('0x25')]['bind'](_0xf02b48,_0x40c184),_0xf02b48[_0x50e8('0x4')][_0x1f0338]['acwTimeout']*0x3e8);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x26')]=moment()[_0x50e8('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x28')]=_0x30a872;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x29')]=_0x1f0338;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x2a')]=function(){var _0x2c6fb3=getDiff(_0xf02b48['timers'][_0x40c184][_0x50e8('0x26')]);clearTimeout(_0xf02b48[_0x50e8('0x6')][_0x40c184]['timer']);_0xf02b48['timers'][_0x40c184][_0x50e8('0x24')]=![];RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2c6fb3},_0xf02b48[_0x50e8('0x6')][_0x40c184]['uniqueid'],_0x40c184)['then'](function(_0x3e58a9){logger[_0x50e8('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x30a872,_0x2c6fb3,_0x3e58a9);})[_0x50e8('0x2c')](function(_0x17c6a5){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x30a872,_0x17c6a5);});delete _0xf02b48['timers'][_0x40c184];};}});}else{logger[_0x50e8('0x1f')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);}});}})[_0x50e8('0x2c')](function(_0x33fc5b){logger[_0x50e8('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x30a872,_0xf02b48[_0x50e8('0x4')][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);})['finally'](function(){delete _0xf02b48[_0x50e8('0x7')][_0x30a872];});}catch(_0x1c2fdb){logger[_0x50e8('0x2d')](_0x50e8('0x2f'),_0x1c2fdb['message']);}};Acw[_0x50e8('0x30')][_0x50e8('0x25')]=function(_0x24d3ea){try{var _0x4e2a37=this;if(_0x4e2a37['timers'][_0x24d3ea]){_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x24')]=![];var _0x3f01ee=_0x4e2a37['timers'][_0x24d3ea]['uniqueid'];var _0x5dff99=_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x29')];var _0x2cbee3=_0x4e2a37[_0x50e8('0x4')][_0x5dff99][_0x50e8('0x23')];logger[_0x50e8('0x1f')](_0x50e8('0x31'),_0x24d3ea);RpcUser[_0x50e8('0x32')](this[_0x50e8('0x5')][_0x24d3ea]);RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2cbee3,'agentacw':!![]},_0x3f01ee,_0x24d3ea)['then'](function(_0x3371a4){logger[_0x50e8('0x1f')](_0x50e8('0x33'),_0x3f01ee,_0x2cbee3,_0x3371a4);})[_0x50e8('0x2c')](function(_0x5dbbe1){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x3f01ee,_0x5dbbe1);});}else{logger[_0x50e8('0x2d')](_0x50e8('0x34'),_0x24d3ea);if(_0x4e2a37[_0x50e8('0x6')]){logger['info']('[ACW][TIMERS]',JSON[_0x50e8('0x35')](_0x4e2a37[_0x50e8('0x6')]));}}}catch(_0x53705e){logger[_0x50e8('0x2d')](_0x50e8('0x36'),_0x53705e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x9')]=function(_0x313e7b){try{if(this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]&&(this['voiceQueues'][_0x313e7b[_0x50e8('0x29')]][_0x50e8('0x38')]||this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]['mandatoryDisposition'])){if(this[_0x50e8('0x5')][_0x313e7b[_0x50e8('0x17')]]){this[_0x50e8('0x7')][_0x313e7b[_0x50e8('0x28')]]={'queue':_0x313e7b['queue'],'interface':_0x313e7b[_0x50e8('0x17')],'destlinkedid':_0x313e7b['destlinkedid']};}}}catch(_0x4a2619){logger['error'](_0x50e8('0x39'),_0x4a2619[_0x50e8('0x37')]);}};Acw['prototype'][_0x50e8('0x3a')]=function(_0x2007c4){try{if(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]&&(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]['acw']||this[_0x50e8('0x4')][_0x2007c4['queue']][_0x50e8('0x19')])){if(this[_0x50e8('0x5')][_0x2007c4['interface']]){this[_0x50e8('0x7')][_0x2007c4['uniqueid']]={'queue':_0x2007c4[_0x50e8('0x29')],'interface':_0x2007c4[_0x50e8('0x17')]};}}}catch(_0x2e55ed){logger[_0x50e8('0x2d')](_0x50e8('0x3b'),_0x2e55ed[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xc')]=function(_0x141bd4){try{if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]&&_['isUndefined'](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]['attended'])){logger[_0x50e8('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x141bd4[_0x50e8('0x28')]);this['startAcw'](_0x141bd4[_0x50e8('0x28')]);}else if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]]&&_[_0x50e8('0x3d')](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]][_0x50e8('0x3e')])){logger['info'](_0x50e8('0x3f'),_0x141bd4[_0x50e8('0x3c')]);this[_0x50e8('0x40')](_0x141bd4[_0x50e8('0x3c')]);}}catch(_0x3303f5){logger[_0x50e8('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x3303f5[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xe')]=function(_0x27c80a){try{if(this['channels'][_0x27c80a[_0x50e8('0x28')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x28')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x41'),_0x27c80a[_0x50e8('0x28')]);this['startAcw'](_0x27c80a['uniqueid']);}else if(this['channels'][_0x27c80a[_0x50e8('0x3c')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x3c')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x42'),_0x27c80a['linkedid']);this[_0x50e8('0x40')](_0x27c80a[_0x50e8('0x3c')]);}}catch(_0x460c8e){logger[_0x50e8('0x2d')]('[ACW][syncHangup]\x20%s',_0x460c8e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x12')]=function(_0x1cc5ba){try{if(!_[_0x50e8('0x43')](this[_0x50e8('0x7')][_0x1cc5ba['transfereeuniqueid']])){this[_0x50e8('0x40')](_0x1cc5ba['transfereeuniqueid']);if(this['channels'][_0x1cc5ba['secondtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba['secondtransfereruniqueid']][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]]=this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];delete this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];}}else if(!_['isNil'](this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]])){this[_0x50e8('0x40')](_0x1cc5ba['transfertargetuniqueid']);if(this['channels'][_0x1cc5ba['origtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x46')]][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x47')]]=this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];delete this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];}}}catch(_0x255b48){logger[_0x50e8('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x255b48['message']);}};Acw['prototype'][_0x50e8('0x13')]=function(_0x3588f0){try{if(this['channels'][_0x3588f0[_0x50e8('0x48')]]){logger[_0x50e8('0x1f')](_0x50e8('0x49'),JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x48')]));this['startAcw'](_0x3588f0[_0x50e8('0x48')]);}else if(this[_0x50e8('0x7')][_0x3588f0[_0x50e8('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x4a')]));this[_0x50e8('0x40')](_0x3588f0[_0x50e8('0x4a')]);}}catch(_0x2b59f5){logger[_0x50e8('0x2d')]('[ACW][syncBlindTransfer]\x20%s',_0x2b59f5['message']);}};Acw[_0x50e8('0x30')]['syncAgentRingNoAnswer']=function(_0x1fc530){try{if(this[_0x50e8('0x4')][_0x1fc530['queue']]&&this[_0x50e8('0x4')][_0x1fc530['queue']]['autopause']==='all'){if(this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]]){logger[_0x50e8('0x1f')](_0x50e8('0x4b'),_0x1fc530['uniqueid'],_0x1fc530['interface'],_0x1fc530[_0x50e8('0x29')]);return RpcUser[_0x50e8('0x21')](this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]],_0x50e8('0x4c'),_0x1fc530[_0x50e8('0x28')]);}}}catch(_0x42e1dd){logger[_0x50e8('0x2d')](_0x50e8('0x4d'),_0x42e1dd[_0x50e8('0x37')]);}};module[_0x50e8('0x4e')]=Acw; \ No newline at end of file +var _0xae24=['then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','format','updateAcw','lastPauseAt','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','stringify','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../../../config/logger','acw','voiceQueues','agents','timers','channels','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','startAcw','interface','queue','mandatoryDispositionPause','name','Action','QueuePause'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xae24,0x182));var _0x4ae2=function(_0x212a7b,_0x2a9cd5){_0x212a7b=_0x212a7b-0x0;var _0x5dc35=_0xae24[_0x212a7b];return _0x5dc35;};'use strict';var util=require(_0x4ae2('0x0'));var _=require('lodash');var moment=require(_0x4ae2('0x1'));var ami=require('../ami');var logger=require(_0x4ae2('0x2'))(_0x4ae2('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1afc7a){this['voiceQueues']=_0x1afc7a[_0x4ae2('0x4')];this[_0x4ae2('0x5')]=_0x1afc7a[_0x4ae2('0x5')];this[_0x4ae2('0x6')]=_0x1afc7a[_0x4ae2('0x6')];this[_0x4ae2('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x4ae2('0x8')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x4ae2('0x8')](this));ami['on'](_0x4ae2('0x9'),this['syncHangup'][_0x4ae2('0x8')](this));ami['on'](_0x4ae2('0xa'),this[_0x4ae2('0xb')][_0x4ae2('0x8')](this));ami['on']('attendedtransfer',this[_0x4ae2('0xc')][_0x4ae2('0x8')](this));ami['on'](_0x4ae2('0xd'),this['syncBlindTransfer'][_0x4ae2('0x8')](this));ami['on'](_0x4ae2('0xe'),this[_0x4ae2('0xf')][_0x4ae2('0x8')](this));}function getDiff(_0x24de98){var _0x40954f=moment()[_0x4ae2('0x10')](0x0);var _0x3cabc9=moment(_0x24de98)[_0x4ae2('0x10')](0x0);return _0x40954f['diff'](_0x3cabc9,'seconds');}Acw['prototype'][_0x4ae2('0x11')]=function(_0xf834a1){try{var _0x5f447a=this;var _0x463765=this[_0x4ae2('0x7')][_0xf834a1][_0x4ae2('0x12')];var _0x1d5a78=this[_0x4ae2('0x7')][_0xf834a1][_0x4ae2('0x13')];var _0x3d4259=this[_0x4ae2('0x4')][_0x1d5a78];var _0x41b672=![];var _0x18936a='ACW';if(_0x3d4259['mandatoryDisposition']){if(_0x3d4259[_0x4ae2('0x14')][_0x4ae2('0x15')]){_0x41b672=!![];_0x18936a=_0x3d4259['mandatoryDispositionPause'][_0x4ae2('0x15')];}}ami[_0x4ae2('0x16')]({'action':_0x4ae2('0x17'),'interface':_0x463765,'paused':!![],'reason':_0x18936a})[_0x4ae2('0x18')](function(_0x8732bb){if(_0x5f447a['agents'][_0x463765]){return RpcUser[_0x4ae2('0x19')](_0x5f447a['agents'][_0x463765]['id'])['then'](function(_0x2ceec4){if(_0x2ceec4&&!_0x2ceec4[_0x4ae2('0x1a')]){logger[_0x4ae2('0x1b')](_0x4ae2('0x1c'),_0xf834a1,_0x463765,_0x1d5a78);var _0xca16bf=_0x5f447a['channels'][_0xf834a1][_0x4ae2('0x1d')]&&_0x5f447a['channels'][_0xf834a1][_0x4ae2('0x1e')]?_0x5f447a[_0x4ae2('0x7')][_0xf834a1][_0x4ae2('0x1e')]:_0xf834a1;return RpcUser['savePause'](_0x5f447a[_0x4ae2('0x5')][_0x463765],_0x18936a,_0xca16bf)[_0x4ae2('0x18')](function(_0x2454b3){if(!_0x41b672){_0x5f447a[_0x4ae2('0x6')][_0x463765]={};logger[_0x4ae2('0x1b')](_0x4ae2('0x1f'),_0xf834a1,_0x5f447a['voiceQueues'][_0x1d5a78]['acwTimeout'],_0x463765,_0x1d5a78);_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x20')]=setTimeout(_0x5f447a[_0x4ae2('0x21')][_0x4ae2('0x8')](_0x5f447a,_0x463765),_0x5f447a[_0x4ae2('0x4')][_0x1d5a78][_0x4ae2('0x22')]*0x3e8);_0x5f447a['timers'][_0x463765]['lastPauseAt']=moment()[_0x4ae2('0x23')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f447a['timers'][_0x463765]['uniqueid']=_0xf834a1;_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x13')]=_0x1d5a78;_0x5f447a['timers'][_0x463765][_0x4ae2('0x24')]=function(){var _0x37e3e5=getDiff(_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x25')]);clearTimeout(_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x20')]);_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x20')]=![];RpcVoiceAgentReport[_0x4ae2('0x26')]({'acwtime':_0x37e3e5},_0x5f447a[_0x4ae2('0x6')][_0x463765][_0x4ae2('0x27')],_0x463765)[_0x4ae2('0x18')](function(_0x3ab303){logger[_0x4ae2('0x1b')](_0x4ae2('0x28'),_0xf834a1,_0x37e3e5,_0x3ab303);})[_0x4ae2('0x29')](function(_0x451d2a){logger['error'](_0x4ae2('0x2a'),_0xf834a1,_0x451d2a);});delete _0x5f447a['timers'][_0x463765];};}});}else{logger[_0x4ae2('0x1b')](_0x4ae2('0x2b'),_0xf834a1,_0x463765,_0x1d5a78);}});}})['catch'](function(_0x1516b8){logger[_0x4ae2('0x2c')](_0x4ae2('0x1f'),_0xf834a1,_0x5f447a[_0x4ae2('0x4')][_0x1d5a78]['acwTimeout'],_0x463765,_0x1d5a78);})[_0x4ae2('0x2d')](function(){delete _0x5f447a[_0x4ae2('0x7')][_0xf834a1];});}catch(_0x29458e){logger[_0x4ae2('0x2c')](_0x4ae2('0x2e'),_0x29458e[_0x4ae2('0x2f')]);}};Acw[_0x4ae2('0x30')][_0x4ae2('0x21')]=function(_0xe99f9d){try{var _0x5c5c7d=this;if(_0x5c5c7d[_0x4ae2('0x6')][_0xe99f9d]){_0x5c5c7d['timers'][_0xe99f9d][_0x4ae2('0x20')]=![];var _0x41b0f4=_0x5c5c7d[_0x4ae2('0x6')][_0xe99f9d][_0x4ae2('0x27')];var _0x771c14=_0x5c5c7d[_0x4ae2('0x6')][_0xe99f9d]['queue'];var _0x38f12f=_0x5c5c7d[_0x4ae2('0x4')][_0x771c14][_0x4ae2('0x22')];logger[_0x4ae2('0x1b')]('[TIMER][STOP][AGENT:%s]',_0xe99f9d);RpcUser[_0x4ae2('0x31')](this[_0x4ae2('0x5')][_0xe99f9d]);RpcVoiceAgentReport[_0x4ae2('0x26')]({'acwtime':_0x38f12f,'agentacw':!![]},_0x41b0f4,_0xe99f9d)[_0x4ae2('0x18')](function(_0x232243){logger[_0x4ae2('0x1b')](_0x4ae2('0x28'),_0x41b0f4,_0x38f12f,_0x232243);})[_0x4ae2('0x29')](function(_0x1d5888){logger[_0x4ae2('0x2c')](_0x4ae2('0x2a'),_0x41b0f4,_0x1d5888);});}else{logger['error'](_0x4ae2('0x32'),_0xe99f9d);if(_0x5c5c7d[_0x4ae2('0x6')]){logger[_0x4ae2('0x1b')](_0x4ae2('0x33'),JSON['stringify'](_0x5c5c7d['timers']));}}}catch(_0xd46eed){logger[_0x4ae2('0x2c')](_0x4ae2('0x34'),_0xd46eed[_0x4ae2('0x2f')]);}};Acw['prototype'][_0x4ae2('0x35')]=function(_0x178898){try{if(this['voiceQueues'][_0x178898[_0x4ae2('0x13')]]&&(this[_0x4ae2('0x4')][_0x178898[_0x4ae2('0x13')]]['acw']||this[_0x4ae2('0x4')][_0x178898[_0x4ae2('0x13')]][_0x4ae2('0x36')])){if(this[_0x4ae2('0x5')][_0x178898[_0x4ae2('0x12')]]){this[_0x4ae2('0x7')][_0x178898[_0x4ae2('0x27')]]={'queue':_0x178898[_0x4ae2('0x13')],'interface':_0x178898['interface'],'destlinkedid':_0x178898[_0x4ae2('0x1e')]};}}}catch(_0x1bb9e2){logger['error'](_0x4ae2('0x37'),_0x1bb9e2[_0x4ae2('0x2f')]);}};Acw['prototype'][_0x4ae2('0xf')]=function(_0x30ac85){try{if(this['voiceQueues'][_0x30ac85[_0x4ae2('0x13')]]&&(this[_0x4ae2('0x4')][_0x30ac85[_0x4ae2('0x13')]]['acw']||this['voiceQueues'][_0x30ac85[_0x4ae2('0x13')]][_0x4ae2('0x36')])){if(this[_0x4ae2('0x5')][_0x30ac85[_0x4ae2('0x12')]]){this['channels'][_0x30ac85[_0x4ae2('0x27')]]={'queue':_0x30ac85[_0x4ae2('0x13')],'interface':_0x30ac85[_0x4ae2('0x12')]};}}}catch(_0x5843d7){logger[_0x4ae2('0x2c')](_0x4ae2('0x38'),_0x5843d7[_0x4ae2('0x2f')]);}};Acw['prototype'][_0x4ae2('0x39')]=function(_0x24ec08){try{if(this[_0x4ae2('0x7')][_0x24ec08[_0x4ae2('0x27')]]&&_[_0x4ae2('0x3a')](this[_0x4ae2('0x7')][_0x24ec08[_0x4ae2('0x27')]][_0x4ae2('0x1d')])){logger[_0x4ae2('0x1b')](_0x4ae2('0x3b'),_0x24ec08['uniqueid']);this[_0x4ae2('0x11')](_0x24ec08[_0x4ae2('0x27')]);}else if(this[_0x4ae2('0x7')][_0x24ec08[_0x4ae2('0x3c')]]&&_[_0x4ae2('0x3a')](this[_0x4ae2('0x7')][_0x24ec08[_0x4ae2('0x3c')]][_0x4ae2('0x1d')])){logger['info'](_0x4ae2('0x3d'),_0x24ec08[_0x4ae2('0x3c')]);this['startAcw'](_0x24ec08[_0x4ae2('0x3c')]);}}catch(_0x3c5f8d){logger['error'](_0x4ae2('0x3e'),_0x3c5f8d['message']);}};Acw[_0x4ae2('0x30')]['syncHangup']=function(_0x1ae8bb){try{if(this[_0x4ae2('0x7')][_0x1ae8bb[_0x4ae2('0x27')]]&&this[_0x4ae2('0x7')][_0x1ae8bb[_0x4ae2('0x27')]][_0x4ae2('0x1d')]){logger[_0x4ae2('0x1b')](_0x4ae2('0x3f'),_0x1ae8bb[_0x4ae2('0x27')]);this['startAcw'](_0x1ae8bb[_0x4ae2('0x27')]);}else if(this[_0x4ae2('0x7')][_0x1ae8bb[_0x4ae2('0x3c')]]&&this[_0x4ae2('0x7')][_0x1ae8bb['linkedid']][_0x4ae2('0x1d')]){logger[_0x4ae2('0x1b')](_0x4ae2('0x40'),_0x1ae8bb['linkedid']);this['startAcw'](_0x1ae8bb[_0x4ae2('0x3c')]);}}catch(_0x1be528){logger[_0x4ae2('0x2c')](_0x4ae2('0x41'),_0x1be528[_0x4ae2('0x2f')]);}};Acw[_0x4ae2('0x30')][_0x4ae2('0xc')]=function(_0x390c1f){try{if(!_[_0x4ae2('0x42')](this['channels'][_0x390c1f[_0x4ae2('0x43')]])){this['startAcw'](_0x390c1f[_0x4ae2('0x43')]);if(this[_0x4ae2('0x7')][_0x390c1f[_0x4ae2('0x44')]]){this[_0x4ae2('0x7')][_0x390c1f[_0x4ae2('0x44')]][_0x4ae2('0x1d')]=!![];this[_0x4ae2('0x7')][_0x390c1f[_0x4ae2('0x45')]]=this['channels'][_0x390c1f['secondtransfereruniqueid']];delete this[_0x4ae2('0x7')][_0x390c1f[_0x4ae2('0x44')]];}}else if(!_[_0x4ae2('0x42')](this['channels'][_0x390c1f['transfertargetuniqueid']])){this[_0x4ae2('0x11')](_0x390c1f[_0x4ae2('0x45')]);if(this[_0x4ae2('0x7')][_0x390c1f[_0x4ae2('0x46')]]){this[_0x4ae2('0x7')][_0x390c1f['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x390c1f[_0x4ae2('0x43')]]=this['channels'][_0x390c1f['origtransfereruniqueid']];delete this[_0x4ae2('0x7')][_0x390c1f['origtransfereruniqueid']];}}}catch(_0x3efbaf){logger['error'](_0x4ae2('0x47'),_0x3efbaf['message']);}};Acw[_0x4ae2('0x30')]['syncBlindTransfer']=function(_0x3d4f11){try{if(this[_0x4ae2('0x7')][_0x3d4f11[_0x4ae2('0x48')]]){logger[_0x4ae2('0x1b')](_0x4ae2('0x49'),JSON['stringify'](_0x3d4f11['transfereruniqueid']));this[_0x4ae2('0x11')](_0x3d4f11[_0x4ae2('0x48')]);}else if(this['channels'][_0x3d4f11[_0x4ae2('0x4a')]]){logger[_0x4ae2('0x1b')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4ae2('0x4b')](_0x3d4f11[_0x4ae2('0x4a')]));this['startAcw'](_0x3d4f11['transfererlinkedid']);}}catch(_0x15a6aa){logger[_0x4ae2('0x2c')]('[ACW][syncBlindTransfer]\x20%s',_0x15a6aa[_0x4ae2('0x2f')]);}};Acw[_0x4ae2('0x30')][_0x4ae2('0xb')]=function(_0x30003b){try{if(this['voiceQueues'][_0x30003b[_0x4ae2('0x13')]]&&this[_0x4ae2('0x4')][_0x30003b['queue']][_0x4ae2('0x4c')]===_0x4ae2('0x4d')){if(this[_0x4ae2('0x5')][_0x30003b['interface']]){logger['info'](_0x4ae2('0x4e'),_0x30003b['uniqueid'],_0x30003b[_0x4ae2('0x12')],_0x30003b['queue']);return RpcUser[_0x4ae2('0x4f')](this['agents'][_0x30003b[_0x4ae2('0x12')]],'Auto-Pause',_0x30003b[_0x4ae2('0x27')]);}}}catch(_0x5e593e){logger['error'](_0x4ae2('0x50'),_0x5e593e[_0x4ae2('0x2f')]);}};module[_0x4ae2('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index b1111a3..09b3709 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 _0x40cd=['actionDeviceStateList','log','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','actionQueueSummary','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','resolve','then'];(function(_0x1f3f72,_0x20d1ed){var _0x26b19c=function(_0x21ea6d){while(--_0x21ea6d){_0x1f3f72['push'](_0x1f3f72['shift']());}};_0x26b19c(++_0x20d1ed);}(_0x40cd,0x1d7));var _0xd40c=function(_0x8c8715,_0xa2b6d1){_0x8c8715=_0x8c8715-0x0;var _0x78f54f=_0x40cd[_0x8c8715];return _0x78f54f;};'use strict';var Manager=require(_0xd40c('0x0'));var BPromise=require(_0xd40c('0x1'));var moment=require(_0xd40c('0x2'));var util=require(_0xd40c('0x3'));var _=require(_0xd40c('0x4'));var logger=require(_0xd40c('0x5'))(_0xd40c('0x6'));var config=require(_0xd40c('0x7'));var ami=new Manager(config[_0xd40c('0x8')][_0xd40c('0x9')],config[_0xd40c('0x8')]['ip'],config['asterisk']['username'],config[_0xd40c('0x8')][_0xd40c('0xa')],!![]);ami[_0xd40c('0xb')]();ami[_0xd40c('0xc')]=BPromise['promisify'](ami[_0xd40c('0xd')]);function error(_0x233f15){logger[_0xd40c('0xe')](util[_0xd40c('0xf')](_0xd40c('0x10'),config[_0xd40c('0x8')][_0xd40c('0x11')],config[_0xd40c('0x8')]['ip'],config[_0xd40c('0x8')][_0xd40c('0x9')],util[_0xd40c('0x12')](_0x233f15,![],null)));}function close(){logger['error'](util['format'](_0xd40c('0x13'),config[_0xd40c('0x8')][_0xd40c('0x11')],config['asterisk']['ip'],config[_0xd40c('0x8')][_0xd40c('0x9')]));}ami[_0xd40c('0x14')]=function(){return function(){return ami[_0xd40c('0xc')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xd40c('0xc')]({'action':_0xd40c('0x15')});};};ami[_0xd40c('0x16')]=function(){return function(){return ami[_0xd40c('0xc')]({'action':'sippeerstatus'});};};ami[_0xd40c('0x17')]=function(){return function(){return ami[_0xd40c('0xc')]({'action':_0xd40c('0x18')});};};ami[_0xd40c('0x19')]=function(){return function(){return ami[_0xd40c('0xc')]({'action':_0xd40c('0x1a')});};};function connect(_0x319d99){logger[_0xd40c('0x1b')](util['format'](_0xd40c('0x1c'),config[_0xd40c('0x8')]['username'],config[_0xd40c('0x8')]['ip'],config['asterisk']['port']));ami[_0xd40c('0x1d')]('error',error);ami['once'](_0xd40c('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0xd40c('0x1f'),function(_0x3e0dbe){logger[_0xd40c('0x1b')](util[_0xd40c('0xf')](_0xd40c('0x20'),config[_0xd40c('0x8')][_0xd40c('0x11')],config['asterisk']['ip'],config[_0xd40c('0x8')][_0xd40c('0x9')],util['inspect'](_0x3e0dbe,![],null)));});ami['on'](_0xd40c('0x21'),function(_0xe601ff){logger[_0xd40c('0x1b')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xd40c('0x8')][_0xd40c('0x11')],config['asterisk']['ip'],config['asterisk'][_0xd40c('0x9')]));return BPromise[_0xd40c('0x22')]()['then'](ami[_0xd40c('0x14')]())[_0xd40c('0x23')](ami[_0xd40c('0x24')]())[_0xd40c('0x23')](ami[_0xd40c('0x16')]())['then'](ami[_0xd40c('0x17')]())[_0xd40c('0x23')](ami['actionCoreShowChannels']())['catch'](function(_0x6133c2){console[_0xd40c('0x25')](_0x6133c2);});});ami[_0xd40c('0x1d')](_0xd40c('0xe'),error);ami[_0xd40c('0x1d')](_0xd40c('0x1e'),close);module[_0xd40c('0x26')]=ami; \ No newline at end of file +var _0xd892=['util','lodash','ami','../../config/environment','asterisk','port','keepConnected','action','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','username','once','connect','shutdown','info','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','asterisk-manager','bluebird','moment'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xd892,0x100));var _0x2d89=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd892[_0x5783f4];return _0x28e380;};'use strict';var Manager=require(_0x2d89('0x0'));var BPromise=require(_0x2d89('0x1'));var moment=require(_0x2d89('0x2'));var util=require(_0x2d89('0x3'));var _=require(_0x2d89('0x4'));var logger=require('../../config/logger')(_0x2d89('0x5'));var config=require(_0x2d89('0x6'));var ami=new Manager(config[_0x2d89('0x7')][_0x2d89('0x8')],config[_0x2d89('0x7')]['ip'],config[_0x2d89('0x7')]['username'],config['asterisk']['password'],!![]);ami[_0x2d89('0x9')]();ami['Action']=BPromise['promisify'](ami[_0x2d89('0xa')]);function error(_0xb557d0){logger[_0x2d89('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2d89('0x7')]['username'],config[_0x2d89('0x7')]['ip'],config['asterisk'][_0x2d89('0x8')],util[_0x2d89('0xc')](_0xb557d0,![],null)));}function close(){logger['error'](util[_0x2d89('0xd')](_0x2d89('0xe'),config[_0x2d89('0x7')]['username'],config[_0x2d89('0x7')]['ip'],config[_0x2d89('0x7')][_0x2d89('0x8')]));}ami[_0x2d89('0xf')]=function(){return function(){return ami[_0x2d89('0x10')]({'action':_0x2d89('0x11')});};};ami[_0x2d89('0x12')]=function(){return function(){return ami[_0x2d89('0x10')]({'action':_0x2d89('0x13')});};};ami[_0x2d89('0x14')]=function(){return function(){return ami['Action']({'action':_0x2d89('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x2d89('0x10')]({'action':_0x2d89('0x16')});};};ami[_0x2d89('0x17')]=function(){return function(){return ami[_0x2d89('0x10')]({'action':'coreshowchannels'});};};function connect(_0x4ec88a){logger['info'](util[_0x2d89('0xd')](_0x2d89('0x18'),config[_0x2d89('0x7')][_0x2d89('0x19')],config[_0x2d89('0x7')]['ip'],config[_0x2d89('0x7')]['port']));ami[_0x2d89('0x1a')](_0x2d89('0xb'),error);ami[_0x2d89('0x1a')]('close',close);}ami['on'](_0x2d89('0x1b'),connect);ami['on'](_0x2d89('0x1c'),function(_0x393437){logger[_0x2d89('0x1d')](util[_0x2d89('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0x2d89('0x7')]['ip'],config[_0x2d89('0x7')][_0x2d89('0x8')],util[_0x2d89('0xc')](_0x393437,![],null)));});ami['on'](_0x2d89('0x1e'),function(_0x2106f5){logger[_0x2d89('0x1d')](util[_0x2d89('0xd')](_0x2d89('0x1f'),config[_0x2d89('0x7')]['username'],config[_0x2d89('0x7')]['ip'],config[_0x2d89('0x7')][_0x2d89('0x8')]));return BPromise[_0x2d89('0x20')]()[_0x2d89('0x21')](ami[_0x2d89('0xf')]())[_0x2d89('0x21')](ami[_0x2d89('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x2d89('0x21')](ami[_0x2d89('0x22')]())['then'](ami[_0x2d89('0x17')]())[_0x2d89('0x23')](function(_0x2007b3){console[_0x2d89('0x24')](_0x2007b3);});});ami[_0x2d89('0x1a')](_0x2d89('0xb'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 0b44ffe..a192d24 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 _0x3114=['exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request','then','debug','rpc','error','memberReport','message','result','catch'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3114,0x9a));var _0x4311=function(_0x2a17ac,_0x5f05cd){_0x2a17ac=_0x2a17ac-0x0;var _0x2ee120=_0x3114[_0x2a17ac];return _0x2ee120;};'use strict';var jayson=require(_0x4311('0x0'));var BPromise=require(_0x4311('0x1'));var logger=require(_0x4311('0x2'))(_0x4311('0x3'));var client=jayson[_0x4311('0x4')][_0x4311('0x5')]({'port':0x2329});client[_0x4311('0x6')]=function(_0x22fba3,_0x1f718d){return new BPromise(function(_0x4d398e,_0x6020dc){return client[_0x4311('0x7')](_0x22fba3,_0x1f718d)[_0x4311('0x8')](function(_0x5e25f9){logger[_0x4311('0x9')](_0x4311('0xa'),'memberReport',_0x22fba3,_0x1f718d,_0x5e25f9);if(_0x5e25f9[_0x4311('0xb')]){logger['error'](_0x4311('0xa'),_0x4311('0xc'),_0x22fba3,_0x5e25f9['error'][_0x4311('0xd')],_0x1f718d);return _0x6020dc(_0x5e25f9[_0x4311('0xb')][_0x4311('0xd')]);}else{return _0x4d398e(_0x5e25f9[_0x4311('0xe')]);}})[_0x4311('0xf')](function(_0xf1616c){logger[_0x4311('0xb')]('rpc','memberReport',_0x22fba3,_0xf1616c,_0x1f718d);return _0x6020dc(_0xf1616c);});});};module[_0x4311('0x10')]=client; \ No newline at end of file +var _0xbb74=['catch','exports','jayson/promise','bluebird','../../config/logger','ami','http','Request','debug','rpc','memberReport','error','message','result'];(function(_0xaa4f3,_0x37be20){var _0x163cc9=function(_0x4fa98c){while(--_0x4fa98c){_0xaa4f3['push'](_0xaa4f3['shift']());}};_0x163cc9(++_0x37be20);}(_0xbb74,0xd4));var _0x4bb7=function(_0xb8fbcb,_0x10a954){_0xb8fbcb=_0xb8fbcb-0x0;var _0x2712d9=_0xbb74[_0xb8fbcb];return _0x2712d9;};'use strict';var jayson=require(_0x4bb7('0x0'));var BPromise=require(_0x4bb7('0x1'));var logger=require(_0x4bb7('0x2'))(_0x4bb7('0x3'));var client=jayson['client'][_0x4bb7('0x4')]({'port':0x2329});client[_0x4bb7('0x5')]=function(_0x27cb3a,_0x46b080){return new BPromise(function(_0x157485,_0x5d6261){return client['request'](_0x27cb3a,_0x46b080)['then'](function(_0x57b2c7){logger[_0x4bb7('0x6')](_0x4bb7('0x7'),_0x4bb7('0x8'),_0x27cb3a,_0x46b080,_0x57b2c7);if(_0x57b2c7[_0x4bb7('0x9')]){logger[_0x4bb7('0x9')](_0x4bb7('0x7'),'memberReport',_0x27cb3a,_0x57b2c7[_0x4bb7('0x9')][_0x4bb7('0xa')],_0x46b080);return _0x5d6261(_0x57b2c7[_0x4bb7('0x9')]['message']);}else{return _0x157485(_0x57b2c7[_0x4bb7('0xb')]);}})[_0x4bb7('0xc')](function(_0x1ae1e4){logger[_0x4bb7('0x9')](_0x4bb7('0x7'),'memberReport',_0x27cb3a,_0x1ae1e4,_0x46b080);return _0x5d6261(_0x1ae1e4);});});};module[_0x4bb7('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 9ae5fcd..bac18a5 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 _0xb047=['countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','queue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry'];(function(_0x58853f,_0x4bcab5){var _0x48ecc2=function(_0x22fb59){while(--_0x22fb59){_0x58853f['push'](_0x58853f['shift']());}};_0x48ecc2(++_0x4bcab5);}(_0xb047,0x193));var _0x7b04=function(_0x417b5d,_0x521fcb){_0x417b5d=_0x417b5d-0x0;var _0x342a0a=_0xb047[_0x417b5d];return _0x342a0a;};'use strict';var util=require(_0x7b04('0x0'));var _=require(_0x7b04('0x1'));var moment=require(_0x7b04('0x2'));function checkNameSurname(_0x37dbe8,_0x3b3e9a,_0x2a00f0){var _0x1fc701='';if(!_['isNil'](_0x3b3e9a)&&'string'===typeof _0x3b3e9a){_0x1fc701+=_0x3b3e9a;}if(!_[_0x7b04('0x3')](_0x2a00f0)&&_0x7b04('0x4')===typeof _0x2a00f0){_0x1fc701+='\x20'+_0x2a00f0;}if(_0x1fc701!==''){return _0x1fc701;}return _0x37dbe8;}function Action(_0x1a3b8e,_0x1848db,_0x32b658){this['voiceQueue']=_0x1a3b8e;this[_0x7b04('0x5')]=_0x32b658||undefined;this[_0x7b04('0x6')]=checkNameSurname(_0x1848db[_0x7b04('0x7')][_0x7b04('0x8')],_0x1848db[_0x7b04('0x7')][_0x7b04('0x9')],_0x1848db[_0x7b04('0x7')][_0x7b04('0xa')]);this[_0x7b04('0xb')]=_0x1848db[_0x7b04('0x7')][_0x7b04('0x8')];this['queue']=_0x1a3b8e['name'];this[_0x7b04('0xc')]=_0x1848db[_0x7b04('0xc')]||![];this[_0x7b04('0xd')]=_0x1a3b8e[_0x7b04('0xd')];this[_0x7b04('0xe')]=_0x1a3b8e['dialQueueTimeout']||0x3;this['scheduledat']=_0x1848db[_0x7b04('0xf')];this[_0x7b04('0x10')]=_0x1848db['countbusyretry'];this[_0x7b04('0x11')]=_0x1848db[_0x7b04('0x11')];this[_0x7b04('0x12')]=_0x1848db['countnoanswerretry'];this['ContactId']=_0x1848db[_0x7b04('0x13')];this[_0x7b04('0x14')]=_0x1848db[_0x7b04('0x14')];this['UserId']=_0x1848db[_0x7b04('0x15')];this[_0x7b04('0x16')]=_0x1848db[_0x7b04('0x16')];this[_0x7b04('0x17')]=_0x1848db[_0x7b04('0x17')];this[_0x7b04('0x18')]=_0x1848db['id'];this[_0x7b04('0x19')]=_0x1848db[_0x7b04('0x7')]['firstName']||'';this[_0x7b04('0x1a')]=moment()[_0x7b04('0x1b')](_0x7b04('0x1c'));this['callback']=_0x1848db[_0x7b04('0x1d')];this[_0x7b04('0x1e')]=_0x1848db[_0x7b04('0x1e')];this[_0x7b04('0x1f')]=_0x1848db[_0x7b04('0x1f')];this[_0x7b04('0x20')]=_0x1848db['recallme'];this[_0x7b04('0x21')]='';this['originatecalleridname']='';}Action[_0x7b04('0x22')][_0x7b04('0x23')]=function(){return util['format'](_0x7b04('0x24'),this[_0x7b04('0x6')],this[_0x7b04('0x25')][_0x7b04('0x26')]>0x0?this['number']['substring'](this[_0x7b04('0x25')][_0x7b04('0x26')]):this[_0x7b04('0xb')]);};Action[_0x7b04('0x22')][_0x7b04('0x27')]=function(){return this[_0x7b04('0x28')];};module[_0x7b04('0x29')]=Action; \ No newline at end of file +var _0x797a=['recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','util','lodash','moment','isNil','string','voiceQueue','Contact','firstName','lastName','number','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat'];(function(_0x5bb1c0,_0x4e4957){var _0x21a85d=function(_0x2ba249){while(--_0x2ba249){_0x5bb1c0['push'](_0x5bb1c0['shift']());}};_0x21a85d(++_0x4e4957);}(_0x797a,0x18d));var _0xa797=function(_0x4adee7,_0xf041dc){_0x4adee7=_0x4adee7-0x0;var _0x1307e5=_0x797a[_0x4adee7];return _0x1307e5;};'use strict';var util=require(_0xa797('0x0'));var _=require(_0xa797('0x1'));var moment=require(_0xa797('0x2'));function checkNameSurname(_0x4e9a17,_0x9e2ed0,_0x22ad12){var _0x33e7a6='';if(!_[_0xa797('0x3')](_0x9e2ed0)&&_0xa797('0x4')===typeof _0x9e2ed0){_0x33e7a6+=_0x9e2ed0;}if(!_[_0xa797('0x3')](_0x22ad12)&&'string'===typeof _0x22ad12){_0x33e7a6+='\x20'+_0x22ad12;}if(_0x33e7a6!==''){return _0x33e7a6;}return _0x4e9a17;}function Action(_0x5800f1,_0x162669,_0x37d84a){this[_0xa797('0x5')]=_0x5800f1;this['uniqueid']=_0x37d84a||undefined;this['name']=checkNameSurname(_0x162669[_0xa797('0x6')]['phone'],_0x162669[_0xa797('0x6')][_0xa797('0x7')],_0x162669[_0xa797('0x6')][_0xa797('0x8')]);this[_0xa797('0x9')]=_0x162669['Contact'][_0xa797('0xa')];this[_0xa797('0xb')]=_0x5800f1[_0xa797('0xc')];this[_0xa797('0xd')]=_0x162669['active']||![];this[_0xa797('0xe')]=_0x5800f1[_0xa797('0xe')];this[_0xa797('0xf')]=_0x5800f1[_0xa797('0xf')]||0x3;this[_0xa797('0x10')]=_0x162669[_0xa797('0x10')];this['countbusyretry']=_0x162669[_0xa797('0x11')];this[_0xa797('0x12')]=_0x162669[_0xa797('0x12')];this[_0xa797('0x13')]=_0x162669[_0xa797('0x13')];this[_0xa797('0x14')]=_0x162669[_0xa797('0x14')];this[_0xa797('0x15')]=_0x162669[_0xa797('0x15')];this[_0xa797('0x16')]=_0x162669[_0xa797('0x16')];this[_0xa797('0x17')]=_0x162669[_0xa797('0x17')];this['CampaignId']=_0x162669[_0xa797('0x18')];this[_0xa797('0x19')]=_0x162669['id'];this[_0xa797('0x1a')]=_0x162669['Contact'][_0xa797('0x7')]||'';this[_0xa797('0x1b')]=moment()[_0xa797('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa797('0x1d')]=_0x162669['callback'];this[_0xa797('0x1e')]=_0x162669['callbackuniqueid'];this[_0xa797('0x1f')]=_0x162669[_0xa797('0x1f')];this['recallme']=_0x162669[_0xa797('0x20')];this[_0xa797('0x21')]='';this[_0xa797('0x22')]='';}Action[_0xa797('0x23')]['getCaller']=function(){return util[_0xa797('0x1c')](_0xa797('0x24'),this[_0xa797('0xc')],this['voiceQueue'][_0xa797('0x25')]>0x0?this['number'][_0xa797('0x26')](this[_0xa797('0x5')]['dialCutDigit']):this[_0xa797('0x9')]);};Action[_0xa797('0x23')]['getQueue']=function(){return this[_0xa797('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 3bce5bc..8c9d990 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 _0xc632=['type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','scheduledat'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xc632,0x70));var _0x2c63=function(_0xef4a66,_0x10d457){_0xef4a66=_0xef4a66-0x0;var _0x1acfa5=_0xc632[_0xef4a66];return _0x1acfa5;};'use strict';var util=require(_0x2c63('0x0'));var _=require('lodash');var moment=require(_0x2c63('0x1'));function getSeconds(_0x1809e7,_0x37a8d7){var _0x334904=moment(_0x1809e7)[_0x2c63('0x2')](0x0);var _0x5625e3=moment(_0x37a8d7)['milliseconds'](0x0);return _0x334904[_0x2c63('0x3')](_0x5625e3,_0x2c63('0x4'));}function AgentComplete(_0x82a5ad,_0x5e908e){this[_0x2c63('0x5')]=0x4;this[_0x2c63('0x6')]='Answer';this[_0x2c63('0x7')]=_0x82a5ad['scheduledat'];this[_0x2c63('0x8')]=_0x82a5ad[_0x2c63('0x8')];this[_0x2c63('0x9')]=_0x82a5ad['type']===_0x2c63('0xa')?'queue':_0x82a5ad[_0x2c63('0x8')];this[_0x2c63('0xb')]=_0x82a5ad[_0x2c63('0xb')];this['countcongestionretry']=_0x82a5ad[_0x2c63('0xc')];this[_0x2c63('0xd')]=_0x82a5ad['countnoanswerretry'];this[_0x2c63('0xe')]=_0x82a5ad[_0x2c63('0xb')]+_0x82a5ad[_0x2c63('0xc')]+_0x82a5ad['countnoanswerretry'];this[_0x2c63('0xf')]=_0x5e908e[_0x2c63('0xf')];this[_0x2c63('0x10')]=_0x82a5ad[_0x2c63('0x11')];this[_0x2c63('0x12')]=_0x82a5ad[_0x2c63('0x13')];this['starttime']=_0x82a5ad[_0x2c63('0x14')];this[_0x2c63('0x15')]=_0x82a5ad[_0x2c63('0x15')];this[_0x2c63('0x16')]=_0x82a5ad['answertime'];this[_0x2c63('0x17')]=moment()['format'](_0x2c63('0x18'));this['ringtime']=getSeconds(_0x82a5ad[_0x2c63('0x15')],_0x82a5ad[_0x2c63('0x14')]);this['holdtime']=getSeconds(_0x82a5ad[_0x2c63('0x16')],_0x82a5ad[_0x2c63('0x15')]);this[_0x2c63('0x19')]=getSeconds(this[_0x2c63('0x17')],_0x82a5ad['answertime']);this['queue']=_0x5e908e[_0x2c63('0x1a')];this[_0x2c63('0x1b')]=_0x5e908e[_0x2c63('0x1b')];this['reason']=_0x5e908e[_0x2c63('0x1c')];this[_0x2c63('0x1d')]=_0x82a5ad['callback'];this['callbackuniqueid']=_0x82a5ad[_0x2c63('0x1e')];this[_0x2c63('0x1f')]=_0x82a5ad[_0x2c63('0x1f')];this['recallme']=_0x82a5ad['recallme'];this[_0x2c63('0x20')]=_0x82a5ad[_0x2c63('0x20')];this[_0x2c63('0x21')]=_0x82a5ad[_0x2c63('0x21')];this[_0x2c63('0x22')]=_0x82a5ad[_0x2c63('0x22')];this[_0x2c63('0x23')]=_0x82a5ad[_0x2c63('0x23')];this[_0x2c63('0x24')]=_0x82a5ad[_0x2c63('0x24')];this['originatecalleridnum']=_0x82a5ad[_0x2c63('0x25')]||'';this[_0x2c63('0x26')]=_0x82a5ad[_0x2c63('0x26')]||'';}module[_0x2c63('0x27')]=AgentComplete; \ No newline at end of file +var _0x0bb0=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','queue'];(function(_0x2975bb,_0x3a9181){var _0x44d2d3=function(_0x509820){while(--_0x509820){_0x2975bb['push'](_0x2975bb['shift']());}};_0x44d2d3(++_0x3a9181);}(_0x0bb0,0xe5));var _0x00bb=function(_0x327e60,_0x5d4d95){_0x327e60=_0x327e60-0x0;var _0xc63960=_0x0bb0[_0x327e60];return _0xc63960;};'use strict';var util=require(_0x00bb('0x0'));var _=require(_0x00bb('0x1'));var moment=require(_0x00bb('0x2'));function getSeconds(_0x5dc314,_0x1a7bd2){var _0xf6ce1=moment(_0x5dc314)['milliseconds'](0x0);var _0x1ccafd=moment(_0x1a7bd2)[_0x00bb('0x3')](0x0);return _0xf6ce1[_0x00bb('0x4')](_0x1ccafd,_0x00bb('0x5'));}function AgentComplete(_0x3667ab,_0x53a6b6){this['state']=0x4;this[_0x00bb('0x6')]='Answer';this[_0x00bb('0x7')]=_0x3667ab[_0x00bb('0x7')];this[_0x00bb('0x8')]=_0x3667ab[_0x00bb('0x8')];this[_0x00bb('0x9')]=_0x3667ab['type']==='outbound'?_0x00bb('0xa'):_0x3667ab[_0x00bb('0x8')];this[_0x00bb('0xb')]=_0x3667ab['countbusyretry'];this[_0x00bb('0xc')]=_0x3667ab[_0x00bb('0xc')];this[_0x00bb('0xd')]=_0x3667ab[_0x00bb('0xd')];this[_0x00bb('0xe')]=_0x3667ab['countbusyretry']+_0x3667ab[_0x00bb('0xc')]+_0x3667ab[_0x00bb('0xd')];this['uniqueid']=_0x53a6b6[_0x00bb('0xf')];this[_0x00bb('0x10')]=_0x3667ab[_0x00bb('0x11')];this['calleridnum']=_0x3667ab[_0x00bb('0x12')];this[_0x00bb('0x13')]=_0x3667ab['starttime'];this[_0x00bb('0x14')]=_0x3667ab[_0x00bb('0x14')];this[_0x00bb('0x15')]=_0x3667ab['answertime'];this[_0x00bb('0x16')]=moment()[_0x00bb('0x17')](_0x00bb('0x18'));this[_0x00bb('0x19')]=getSeconds(_0x3667ab[_0x00bb('0x14')],_0x3667ab[_0x00bb('0x13')]);this[_0x00bb('0x1a')]=getSeconds(_0x3667ab[_0x00bb('0x15')],_0x3667ab['responsetime']);this['talktime']=getSeconds(this[_0x00bb('0x16')],_0x3667ab[_0x00bb('0x15')]);this[_0x00bb('0xa')]=_0x53a6b6[_0x00bb('0xa')];this[_0x00bb('0x1b')]=_0x53a6b6[_0x00bb('0x1b')];this['reason']=_0x53a6b6[_0x00bb('0x1c')];this[_0x00bb('0x1d')]=_0x3667ab[_0x00bb('0x1d')];this[_0x00bb('0x1e')]=_0x3667ab[_0x00bb('0x1e')];this[_0x00bb('0x1f')]=_0x3667ab[_0x00bb('0x1f')];this['recallme']=_0x3667ab[_0x00bb('0x20')];this['ContactId']=_0x3667ab[_0x00bb('0x21')];this[_0x00bb('0x22')]=_0x3667ab[_0x00bb('0x22')];this[_0x00bb('0x23')]=_0x3667ab['UserId'];this[_0x00bb('0x24')]=_0x3667ab[_0x00bb('0x24')];this[_0x00bb('0x25')]=_0x3667ab[_0x00bb('0x25')];this[_0x00bb('0x26')]=_0x3667ab[_0x00bb('0x26')]||'';this['originatecalleridname']=_0x3667ab['originatecalleridname']||'';}module[_0x00bb('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 69c4cc4..1a1a234 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 _0xa613=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countcongestionretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback'];(function(_0x2c9bc4,_0x512035){var _0x2be3eb=function(_0x4ec929){while(--_0x4ec929){_0x2c9bc4['push'](_0x2c9bc4['shift']());}};_0x2be3eb(++_0x512035);}(_0xa613,0x8a));var _0x3a61=function(_0x3f9602,_0x115411){_0x3f9602=_0x3f9602-0x0;var _0xb22e48=_0xa613[_0x3f9602];return _0xb22e48;};'use strict';var util=require(_0x3a61('0x0'));var _=require('lodash');var moment=require(_0x3a61('0x1'));function getSeconds(_0x30d505,_0x30656d){var _0xd12059=moment(_0x30d505)[_0x3a61('0x2')](0x0);var _0x322b07=moment(_0x30656d)[_0x3a61('0x2')](0x0);return _0xd12059[_0x3a61('0x3')](_0x322b07,_0x3a61('0x4'));}function Final(_0x4208bf){this['uniqueid']=_0x4208bf[_0x3a61('0x5')];this[_0x3a61('0x6')]=_0x4208bf['scheduledat'];this[_0x3a61('0x7')]=_0x4208bf[_0x3a61('0x7')];this[_0x3a61('0x8')]=_0x4208bf[_0x3a61('0x7')]===_0x3a61('0x9')?'queue':_0x4208bf[_0x3a61('0x7')];this[_0x3a61('0xa')]=_0x4208bf['countbusyretry'];this['countcongestionretry']=_0x4208bf['countcongestionretry'];this[_0x3a61('0xb')]=_0x4208bf[_0x3a61('0xb')];this['countglobal']=_0x4208bf[_0x3a61('0xa')]+_0x4208bf[_0x3a61('0xc')]+_0x4208bf[_0x3a61('0xb')];this[_0x3a61('0xd')]=_0x4208bf[_0x3a61('0xd')];this[_0x3a61('0xe')]=_0x4208bf['calleridname'];this['calleridnum']=_0x4208bf[_0x3a61('0xf')];this[_0x3a61('0x10')]=_0x4208bf[_0x3a61('0x10')];this[_0x3a61('0x11')]=_0x4208bf[_0x3a61('0x11')];this['endtime']=_0x4208bf['responsetime'];this[_0x3a61('0x12')]=_0x4208bf['ringtime']||0x0;this[_0x3a61('0x13')]=_0x4208bf['holdtime']||0x0;this[_0x3a61('0x14')]=_0x4208bf[_0x3a61('0x14')]||0x0;this['callback']=_0x4208bf[_0x3a61('0x15')];this['callbackuniqueid']=_0x4208bf[_0x3a61('0x16')];this['callbackat']=_0x4208bf[_0x3a61('0x17')];this['recallme']=_0x4208bf[_0x3a61('0x18')];this[_0x3a61('0x19')]=_0x4208bf[_0x3a61('0x19')];this[_0x3a61('0x1a')]=_0x4208bf[_0x3a61('0x1a')];this[_0x3a61('0x1b')]=_0x4208bf[_0x3a61('0x1b')];this[_0x3a61('0x1c')]=_0x4208bf[_0x3a61('0x1c')];this[_0x3a61('0x1d')]=_0x4208bf[_0x3a61('0x1d')];this[_0x3a61('0x1e')]=_0x4208bf[_0x3a61('0x1e')]||'';this[_0x3a61('0x1f')]=_0x4208bf[_0x3a61('0x1f')]||'';}module['exports']=Final; \ No newline at end of file +var _0xb923=['originatecalleridname','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x16a71c,_0x1b2cd5){var _0xfb1a17=function(_0x984b28){while(--_0x984b28){_0x16a71c['push'](_0x16a71c['shift']());}};_0xfb1a17(++_0x1b2cd5);}(_0xb923,0xa2));var _0x3b92=function(_0x429758,_0x93e7fa){_0x429758=_0x429758-0x0;var _0x352eda=_0xb923[_0x429758];return _0x352eda;};'use strict';var util=require(_0x3b92('0x0'));var _=require(_0x3b92('0x1'));var moment=require(_0x3b92('0x2'));function getSeconds(_0x4d0b7b,_0x2563c4){var _0x454fee=moment(_0x4d0b7b)['milliseconds'](0x0);var _0x4d4d81=moment(_0x2563c4)['milliseconds'](0x0);return _0x454fee[_0x3b92('0x3')](_0x4d4d81,_0x3b92('0x4'));}function Final(_0x3916b4){this[_0x3b92('0x5')]=_0x3916b4[_0x3b92('0x5')];this[_0x3b92('0x6')]=_0x3916b4[_0x3b92('0x6')];this['type']=_0x3916b4['type'];this[_0x3b92('0x7')]=_0x3916b4['type']===_0x3b92('0x8')?_0x3b92('0x9'):_0x3916b4['type'];this[_0x3b92('0xa')]=_0x3916b4[_0x3b92('0xa')];this[_0x3b92('0xb')]=_0x3916b4[_0x3b92('0xb')];this[_0x3b92('0xc')]=_0x3916b4['countnoanswerretry'];this[_0x3b92('0xd')]=_0x3916b4['countbusyretry']+_0x3916b4['countcongestionretry']+_0x3916b4[_0x3b92('0xc')];this[_0x3b92('0x9')]=_0x3916b4[_0x3b92('0x9')];this[_0x3b92('0xe')]=_0x3916b4['calleridname'];this['calleridnum']=_0x3916b4[_0x3b92('0xf')];this['starttime']=_0x3916b4['starttime'];this[_0x3b92('0x10')]=_0x3916b4[_0x3b92('0x10')];this[_0x3b92('0x11')]=_0x3916b4[_0x3b92('0x10')];this[_0x3b92('0x12')]=_0x3916b4['ringtime']||0x0;this[_0x3b92('0x13')]=_0x3916b4[_0x3b92('0x13')]||0x0;this['talktime']=_0x3916b4['talktime']||0x0;this[_0x3b92('0x14')]=_0x3916b4[_0x3b92('0x14')];this[_0x3b92('0x15')]=_0x3916b4[_0x3b92('0x15')];this[_0x3b92('0x16')]=_0x3916b4[_0x3b92('0x16')];this[_0x3b92('0x17')]=_0x3916b4[_0x3b92('0x17')];this[_0x3b92('0x18')]=_0x3916b4[_0x3b92('0x18')];this[_0x3b92('0x19')]=_0x3916b4[_0x3b92('0x19')];this[_0x3b92('0x1a')]=_0x3916b4['UserId'];this[_0x3b92('0x1b')]=_0x3916b4[_0x3b92('0x1b')];this[_0x3b92('0x1c')]=_0x3916b4[_0x3b92('0x1c')];this[_0x3b92('0x1d')]=_0x3916b4[_0x3b92('0x1d')]||'';this['originatecalleridname']=_0x3916b4[_0x3b92('0x1e')]||'';}module[_0x3b92('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 02b7920..a7c2e42 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 _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x3c049f,_0xe80cbc){var _0x263d1a=function(_0x1e02ac){while(--_0x1e02ac){_0x3c049f['push'](_0x3c049f['shift']());}};_0x263d1a(++_0xe80cbc);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index d4d8dd4..1ad900d 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 _0xc142=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid'];(function(_0x2541d9,_0x51654c){var _0x564f58=function(_0x63374){while(--_0x63374){_0x2541d9['push'](_0x2541d9['shift']());}};_0x564f58(++_0x51654c);}(_0xc142,0x1ae));var _0x2c14=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0xc142[_0x102b0c];return _0x9b15ca;};'use strict';var util=require(_0x2c14('0x0'));var _=require(_0x2c14('0x1'));var moment=require('moment');function getSeconds(_0x2ab733,_0x310ddf){var _0x447d93=moment(_0x2ab733)[_0x2c14('0x2')](0x0);var _0x201509=moment(_0x310ddf)['milliseconds'](0x0);return _0x447d93[_0x2c14('0x3')](_0x201509,_0x2c14('0x4'));}function History(_0x3a9f96){this['uniqueid']=_0x3a9f96[_0x2c14('0x5')];this[_0x2c14('0x6')]=_0x3a9f96[_0x2c14('0x6')]||undefined;this[_0x2c14('0x7')]=_0x3a9f96[_0x2c14('0x7')];this[_0x2c14('0x8')]=_0x3a9f96['type']===_0x2c14('0x9')?_0x2c14('0xa'):_0x3a9f96[_0x2c14('0x7')];this[_0x2c14('0xb')]=_0x3a9f96[_0x2c14('0xb')];this[_0x2c14('0xc')]=_0x3a9f96[_0x2c14('0xc')];this[_0x2c14('0xd')]=_0x3a9f96[_0x2c14('0xd')];this[_0x2c14('0xe')]=_0x3a9f96[_0x2c14('0xb')]+_0x3a9f96[_0x2c14('0xc')]+_0x3a9f96[_0x2c14('0xd')];this['queue']=_0x3a9f96[_0x2c14('0xa')];this['calleridname']=_0x3a9f96[_0x2c14('0xf')];this[_0x2c14('0x10')]=_0x3a9f96[_0x2c14('0x11')];this[_0x2c14('0x12')]=_0x3a9f96[_0x2c14('0x12')];this['responsetime']=_0x3a9f96[_0x2c14('0x13')];this[_0x2c14('0x14')]=_0x3a9f96[_0x2c14('0x13')];this[_0x2c14('0x15')]=getSeconds(_0x3a9f96['responsetime'],_0x3a9f96[_0x2c14('0x12')]);this['holdtime']=0x0;this[_0x2c14('0x16')]=0x0;this[_0x2c14('0x17')]=_0x3a9f96[_0x2c14('0x17')];this[_0x2c14('0x18')]=_0x3a9f96['callbackuniqueid'];this[_0x2c14('0x19')]=_0x3a9f96[_0x2c14('0x19')];this[_0x2c14('0x1a')]=_0x3a9f96[_0x2c14('0x1a')];this[_0x2c14('0x1b')]=_0x3a9f96[_0x2c14('0x1b')];this[_0x2c14('0x1c')]=_0x3a9f96['ListId'];this['UserId']=_0x3a9f96[_0x2c14('0x1d')];this['VoiceQueueId']=_0x3a9f96[_0x2c14('0x1e')];this['CampaignId']=_0x3a9f96[_0x2c14('0x1f')];this[_0x2c14('0x20')]=_0x3a9f96[_0x2c14('0x20')]||'';this['originatecalleridname']=_0x3a9f96[_0x2c14('0x21')]||'';}module[_0x2c14('0x22')]=History; \ No newline at end of file +var _0x3cfd=['countglobal','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cfd,0xba));var _0xd3cf=function(_0x164c78,_0x12ae92){_0x164c78=_0x164c78-0x0;var _0x40cecd=_0x3cfd[_0x164c78];return _0x40cecd;};'use strict';var util=require(_0xd3cf('0x0'));var _=require(_0xd3cf('0x1'));var moment=require('moment');function getSeconds(_0x2f8cad,_0x3a6214){var _0x3618ef=moment(_0x2f8cad)[_0xd3cf('0x2')](0x0);var _0x16705b=moment(_0x3a6214)[_0xd3cf('0x2')](0x0);return _0x3618ef[_0xd3cf('0x3')](_0x16705b,_0xd3cf('0x4'));}function History(_0x1a297f){this['uniqueid']=_0x1a297f['uniqueid'];this[_0xd3cf('0x5')]=_0x1a297f[_0xd3cf('0x5')]||undefined;this[_0xd3cf('0x6')]=_0x1a297f['type'];this[_0xd3cf('0x7')]=_0x1a297f[_0xd3cf('0x6')]===_0xd3cf('0x8')?'queue':_0x1a297f[_0xd3cf('0x6')];this[_0xd3cf('0x9')]=_0x1a297f[_0xd3cf('0x9')];this['countcongestionretry']=_0x1a297f[_0xd3cf('0xa')];this[_0xd3cf('0xb')]=_0x1a297f[_0xd3cf('0xb')];this[_0xd3cf('0xc')]=_0x1a297f[_0xd3cf('0x9')]+_0x1a297f['countcongestionretry']+_0x1a297f[_0xd3cf('0xb')];this[_0xd3cf('0xd')]=_0x1a297f[_0xd3cf('0xd')];this[_0xd3cf('0xe')]=_0x1a297f[_0xd3cf('0xf')];this[_0xd3cf('0x10')]=_0x1a297f[_0xd3cf('0x11')];this[_0xd3cf('0x12')]=_0x1a297f[_0xd3cf('0x12')];this[_0xd3cf('0x13')]=_0x1a297f[_0xd3cf('0x13')];this[_0xd3cf('0x14')]=_0x1a297f[_0xd3cf('0x13')];this[_0xd3cf('0x15')]=getSeconds(_0x1a297f['responsetime'],_0x1a297f[_0xd3cf('0x12')]);this[_0xd3cf('0x16')]=0x0;this[_0xd3cf('0x17')]=0x0;this[_0xd3cf('0x18')]=_0x1a297f['callback'];this['callbackuniqueid']=_0x1a297f['callbackuniqueid'];this['callbackat']=_0x1a297f['callbackat'];this[_0xd3cf('0x19')]=_0x1a297f[_0xd3cf('0x19')];this[_0xd3cf('0x1a')]=_0x1a297f[_0xd3cf('0x1a')];this[_0xd3cf('0x1b')]=_0x1a297f['ListId'];this[_0xd3cf('0x1c')]=_0x1a297f[_0xd3cf('0x1c')];this[_0xd3cf('0x1d')]=_0x1a297f[_0xd3cf('0x1d')];this['CampaignId']=_0x1a297f[_0xd3cf('0x1e')];this[_0xd3cf('0x1f')]=_0x1a297f[_0xd3cf('0x1f')]||'';this[_0xd3cf('0x20')]=_0x1a297f[_0xd3cf('0x20')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cebe875..752e901 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 _0x53cb=['[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','countcongestionretry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','temp','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','reachable','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\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','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment/','booked','../../../config/logger','predictiveCalls','syncQueueSummary','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','outbound','available','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','format','voice:queue:%s','type','campaign:ivr:%s','isEmpty','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','[uniqueid]','clearZombieChannels','[actions]','sequence','enqueue','isNil','channel','updateOriginated','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','countReScheduled','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','resolve','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','status','unmonitored','saveInDb','moveContactManagedDialer','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','uniqueId','membername','[syncHangupInAMD]','dialAMDActive','value','MACHINE','AMD','amd','[syncMachine]','HangupInAMD','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','outboundDropCallsDayCallersExit','Abandoned','actionid','strategy','locked','paused','stateinterface','rrmemory','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','Action','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','handleIvr','dialActive','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','hasOwnProperty','launchHandleIvr','[syncCampaigns]','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','dialAgiAfterHangupAgent','getCaller','ACTIVE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','starttime','[originate][error]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x53cb,0x75));var _0xb53c=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x53cb[_0x3d42d8];return _0x27fc41;};'use strict';var util=require(_0xb53c('0x0'));var _=require('lodash');var BPromise=require(_0xb53c('0x1'));var uuid=require(_0xb53c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xb53c('0x3'));var Redis=require(_0xb53c('0x4'));var config=require(_0xb53c('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require('../../../config/logger')(_0xb53c('0x6'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xb53c('0x7'))(_0xb53c('0x8'));var loggerSyncQueueSummary=require(_0xb53c('0x7'))(_0xb53c('0x9'));var ami=require('../ami');config[_0xb53c('0xa')]=_['defaults'](config[_0xb53c('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xb53c('0xb'))(new Redis(config[_0xb53c('0xa')]));var cmHopper=require(_0xb53c('0xc'));var cmHopperFinal=require(_0xb53c('0xd'));var cmHopperHistory=require(_0xb53c('0xe'));var cmHopperBlack=require(_0xb53c('0xf'));var voiceQueueRt=require(_0xb53c('0x10'));var Action=require(_0xb53c('0x11'));var History=require(_0xb53c('0x12'));var Final=require(_0xb53c('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xb53c('0x14'));var ipAgi=process[_0xb53c('0x15')][_0xb53c('0x16')]||_0xb53c('0x17');var strategy={'rrmemory':'rrmemory','roundrobin':_0xb53c('0x18')};var Sequence=function(){};Sequence[_0xb53c('0x19')]['enqueue']=function(_0x3890c0){this[_0xb53c('0x1a')]=this[_0xb53c('0x1a')]?this[_0xb53c('0x1a')][_0xb53c('0x1b')](_0x3890c0):_0x3890c0();};function Dialer(_0x2ded74,_0x2615c6){this['sequence']=new Sequence();this['preview']=_0x2615c6;this[_0xb53c('0x1c')]=_0x2ded74[_0xb53c('0x1c')];this['campaigns']=_0x2ded74['campaigns'];this[_0xb53c('0x1d')]=_0x2ded74['agents'];this[_0xb53c('0x1e')]=_0x2ded74[_0xb53c('0x1e')];this[_0xb53c('0x1f')]=config['maxNumberOriginate']||0x2;this[_0xb53c('0x20')]={};this[_0xb53c('0x21')]={};this[_0xb53c('0x22')]={};this['uniqueId']={};this[_0xb53c('0x23')]={};this[_0xb53c('0x24')]={};this['startProgressive']={};this[_0xb53c('0x25')]={};this['queueBooked']={};this[_0xb53c('0x26')]={};ami['on'](_0xb53c('0x27'),this[_0xb53c('0x28')][_0xb53c('0x29')](this));ami['on'](_0xb53c('0x2a'),this[_0xb53c('0x2b')]['bind'](this));ami['on']('originateresponse',this[_0xb53c('0x2c')][_0xb53c('0x29')](this));ami['on']('agentcomplete',this[_0xb53c('0x2d')]['bind'](this));ami['on'](_0xb53c('0x2e'),this[_0xb53c('0x9')][_0xb53c('0x29')](this));ami['on']('hangup',this[_0xb53c('0x2f')][_0xb53c('0x29')](this));ami['on'](_0xb53c('0x30'),this[_0xb53c('0x31')][_0xb53c('0x29')](this));ami['on'](_0xb53c('0x32'),this[_0xb53c('0x33')]['bind'](this));ami['on']('queuemember',this[_0xb53c('0x34')][_0xb53c('0x29')](this));ami['on'](_0xb53c('0x35'),this['syncQueueStatusComplete'][_0xb53c('0x29')](this));this[_0xb53c('0x36')]();this[_0xb53c('0x37')]();}function isNotNull(_0xc7a775){return _0xc7a775!==null&&!_[_0xb53c('0x38')](_0xc7a775);}function checkIsLoggedIn(_0x4e34f1,_0xa9b2ae){return function(){if(_0xa9b2ae<=0x0){_0x4e34f1[_0xb53c('0x39')]=_0xb53c('0x3a');throw _0x4e34f1[_0xb53c('0x3b')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x13eadb){return _0x13eadb;}function checkIsActive(_0x2b4dc1,_0x1221d2){return function(){if(!isActive(_0x1221d2)){_0x2b4dc1[_0xb53c('0x39')]=_0xb53c('0x3c');throw _0x2b4dc1['name']+_0xb53c('0x3d');}};}function checkInterval(_0xe37e5e){return function(){if(!isNotNull(_0xe37e5e[_0xb53c('0x3e')])){_0xe37e5e[_0xb53c('0x39')]=_0xb53c('0x3f');throw _0xe37e5e[_0xb53c('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xe37e5e['Interval'][_0xb53c('0x40')])){_0xe37e5e[_0xb53c('0x39')]=_0xb53c('0x3f');throw _0xe37e5e['name']+_0xb53c('0x41');}if(!isNotNull(_['isEmpty'](_0xe37e5e[_0xb53c('0x3e')]['Intervals']))){_0xe37e5e['message']='INTERVAL_IS_NULL';throw _0xe37e5e[_0xb53c('0x3b')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x42f81f,_0x3e808b,_0x3d62f8){return{'action':_0x42f81f,'response':_0x3e808b,'message':_0x3d62f8,'stack':_0x3d62f8};}function myreject(_0x18116d){return function(_0x95bacc){return _0x18116d(msgResponse(_0xb53c('0x42'),_0xb53c('0x43'),JSON[_0xb53c('0x44')](_0x95bacc)));};}function getSeconds(_0x80da03,_0x50368b){var _0x2f6cdb=moment(_0x80da03)[_0xb53c('0x45')](0x0);var _0xe63fa8=moment(_0x50368b)[_0xb53c('0x45')](0x0);return _0x2f6cdb[_0xb53c('0x46')](_0xe63fa8,'seconds');}function emit(_0x47a838,_0x5d4973,_0x5ae92e){io['to'](_0x47a838)[_0xb53c('0x47')](_0x5d4973,_0x5ae92e);}function emitVoiceQueueSummary(_0x3a50d6){if(_0x3a50d6['type']===_0xb53c('0x48')){var _0x2ea1db={'id':_0x3a50d6['id'],'name':_0x3a50d6['name'],'strategy':_0x3a50d6['strategy'],'answered':_0x3a50d6['answered'],'available':_0x3a50d6[_0xb53c('0x49')],'loggedIn':_0x3a50d6['loggedIn'],'pTalking':_0x3a50d6['pTalking'],'sumBillable':_0x3a50d6['sumBillable'],'sumDuration':_0x3a50d6[_0xb53c('0x4a')],'sumHoldTime':_0x3a50d6[_0xb53c('0x4b')]||0x0,'talking':_0x3a50d6[_0xb53c('0x4c')],'total':_0x3a50d6[_0xb53c('0x4d')],'type':_0x3a50d6['type'],'unmanaged':_0x3a50d6[_0xb53c('0x4e')],'abandoned':_0x3a50d6[_0xb53c('0x4f')],'waiting':_0x3a50d6[_0xb53c('0x50')],'loggedInDb':_0x3a50d6[_0xb53c('0x51')],'dialActive':_0x3a50d6['dialActive'],'dialMethod':_0x3a50d6[_0xb53c('0x52')],'dialOriginateCallerIdName':_0x3a50d6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3a50d6[_0xb53c('0x53')],'dialOriginateTimeout':_0x3a50d6[_0xb53c('0x54')],'dialPrefix':_0x3a50d6[_0xb53c('0x55')],'outboundAnswerAgiCallsDay':_0x3a50d6[_0xb53c('0x56')],'outboundAnswerCallsDay':_0x3a50d6[_0xb53c('0x57')],'outboundBlacklistCallsDay':_0x3a50d6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3a50d6[_0xb53c('0x58')],'outboundCongestionCallsDay':_0x3a50d6[_0xb53c('0x59')],'outboundDropCallsDayACS':_0x3a50d6[_0xb53c('0x5a')],'outboundDropCallsDayCallersExit':_0x3a50d6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3a50d6['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3a50d6[_0xb53c('0x5b')],'outboundNoSuchCallsDay':_0x3a50d6[_0xb53c('0x5c')],'outboundOriginateFailureCallsDay':_0x3a50d6[_0xb53c('0x5d')],'outboundReCallsDay':_0x3a50d6[_0xb53c('0x5e')],'outboundRejectCallsDay':_0x3a50d6['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3a50d6[_0xb53c('0x5f')],'predictiveIntervalAnsweredCalls':_0x3a50d6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3a50d6[_0xb53c('0x60')],'predictiveIntervalAvgTalktime':_0x3a50d6[_0xb53c('0x61')],'predictiveIntervalDroppedCallsCallersExit':_0x3a50d6[_0xb53c('0x62')],'predictiveIntervalDroppedCallsTimeout':_0x3a50d6[_0xb53c('0x63')],'predictiveIntervalErlangCalls':_0x3a50d6[_0xb53c('0x64')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a50d6[_0xb53c('0x65')],'predictiveIntervalHitRate':_0x3a50d6[_0xb53c('0x66')],'predictiveIntervalMultiplicativeFactor':_0x3a50d6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3a50d6[_0xb53c('0x67')],'predictiveIntervalAvailable':_0x3a50d6['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3a50d6[_0xb53c('0x68')],'message':_0x3a50d6[_0xb53c('0x39')],'originated':_0x3a50d6['originated'],'erlangCalls':_0x3a50d6['erlangCalls'],'erlangCallToSecond':_0x3a50d6['erlangCallToSecond'],'erlangAbandonmentRate':_0x3a50d6[_0xb53c('0x69')],'erlangBusyFactor':_0x3a50d6[_0xb53c('0x6a')],'startPredictive':_0x3a50d6[_0xb53c('0x24')],'startProgressive':_0x3a50d6[_0xb53c('0x6b')]};if(_0x3a50d6[_0xb53c('0x6c')]){_0x2ea1db[_0xb53c('0x6c')]={'id':_0x3a50d6[_0xb53c('0x6c')]['id'],'name':_0x3a50d6[_0xb53c('0x6c')][_0xb53c('0x3b')],'active':_0x3a50d6[_0xb53c('0x6c')][_0xb53c('0x6d')],'callerid':_0x3a50d6['Trunk'][_0xb53c('0x6e')]};}if(_0x3a50d6['Interval']){_0x2ea1db[_0xb53c('0x3e')]={'id':_0x3a50d6[_0xb53c('0x3e')]['id'],'name':_0x3a50d6[_0xb53c('0x3e')][_0xb53c('0x3b')]};}var _0x2c9ac6=md5(JSON[_0xb53c('0x44')](_0x2ea1db));if(_0x3a50d6[_0xb53c('0x3')]!==_0x2c9ac6){_0x3a50d6[_0xb53c('0x3')]=_0x2c9ac6;emit(util[_0xb53c('0x6f')](_0xb53c('0x70'),_0x2ea1db[_0xb53c('0x3b')]),'voice_queue:save',_0x2ea1db);}}}function emitCampaignSummary(_0x3be8f2){if(_0x3be8f2[_0xb53c('0x71')]==='ivr'){emit(util[_0xb53c('0x6f')](_0xb53c('0x72'),_0x3be8f2[_0xb53c('0x3b')]),'campaign:save',_0x3be8f2);}}function checkGetDataPredictive(_0x4932ad){if(isNotNull(_0x4932ad)){if(!_[_0xb53c('0x73')](_0x4932ad)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xb53c('0x74'),_0x4932ad[_0xb53c('0x68')]);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x76'),_0x4932ad[_0xb53c('0x77')]);loggerPredictive[_0xb53c('0x75')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4932ad[_0xb53c('0x63')]);loggerPredictive[_0xb53c('0x75')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4932ad['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x78'),_0x4932ad[_0xb53c('0x60')]);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x79'),_0x4932ad[_0xb53c('0x61')]);loggerPredictive['info'](_0xb53c('0x7a'));if(_0x4932ad[_0xb53c('0x68')]>0x0){if(!_['isUndefined'](_0x4932ad['predictiveIntervalAvgTalktime'])&&_0x4932ad[_0xb53c('0x61')]>0x0){return!![];}else{loggerPredictive['info'](_0xb53c('0x7b'));}if(!_['isUndefined'](_0x4932ad[_0xb53c('0x60')])&&_0x4932ad[_0xb53c('0x60')]>0x0){return!![];}else{loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7c'));}}else{loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7d'));}}else{loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7e'));}}else{loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7e'));}return![];}function mergeDataErlangB(_0x3d28f0){return function(_0x1388df){loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7f'));loggerPredictive[_0xb53c('0x75')](_0xb53c('0x80'),_0x1388df[_0xb53c('0x81')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1388df[_0xb53c('0x82')]);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x83'),_0x1388df['erlangAbandonmentRate']);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x84'),_0x1388df[_0xb53c('0x6a')]);loggerPredictive[_0xb53c('0x75')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1388df['erlangAbandonmentRate']);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7a'));_[_0xb53c('0x85')](_0x3d28f0,_0x1388df);};}function getDiff(_0x3bcd72){var _0x3fdd5b=moment()[_0xb53c('0x45')](0x0);var _0x5694c9=moment(_0x3bcd72)['milliseconds'](0x0);return _0x3fdd5b[_0xb53c('0x46')](_0x5694c9,'seconds');}function ifInterval(_0x17d8fa,_0x2c0305){if(_[_0xb53c('0x38')](_0x2c0305)){return![];}if(getDiff(_0x2c0305)<_0x17d8fa*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1f4617){if(isNotNull(_0x1f4617)){if(!_[_0xb53c('0x38')](_0x1f4617[_0xb53c('0x6b')])){_0x1f4617['startProgressive']=undefined;loggerPredictive['info'](_0x1f4617['name'],_0xb53c('0x86'));}if(!_['isUndefined'](_0x1f4617[_0xb53c('0x24')])){_0x1f4617[_0xb53c('0x24')]=undefined;loggerPredictive[_0xb53c('0x75')](_0x1f4617['name'],_0xb53c('0x87'));}if(!_[_0xb53c('0x38')](_0x1f4617[_0xb53c('0x88')])){clearInterval(_0x1f4617[_0xb53c('0x88')]);_0x1f4617[_0xb53c('0x88')]=undefined;loggerPredictive[_0xb53c('0x75')](_0x1f4617[_0xb53c('0x3b')],_0xb53c('0x89'));}}}function erlangb(_0x2d53d8,_0xe0f3b3){if(_0xe0f3b3===0x0){return 0x0;}var _0x660e39=0x1;for(var _0x4eb09f=0x1;_0x4eb09f<=_0xe0f3b3;_0x4eb09f+=0x1){_0x660e39=0x1+_0x660e39*_0x4eb09f/_0x2d53d8;}return 0x1/_0x660e39;}function isVoiceQueueOutbound(_0x27a91f){return _0x27a91f===_0xb53c('0x48');}function isNotPreview(_0x8421f0){return _0x8421f0!==_0xb53c('0x8a');}function isCampaignIvr(_0x5dc666){return _0x5dc666===_0xb53c('0x8b');}function getCallerId(_0x15ea7a,_0x2069f8,_0x3f9185){if(!_[_0xb53c('0x38')](_0x3f9185)&&_0xb53c('0x8c')===typeof _0x3f9185&&!_[_0xb53c('0x73')](_0x3f9185)){if(!_[_0xb53c('0x38')](_0x2069f8)&&'string'===typeof _0x2069f8&&!_[_0xb53c('0x73')](_0x2069f8)){return util[_0xb53c('0x6f')](_0xb53c('0x8d'),_0x2069f8,_0x3f9185);}return util[_0xb53c('0x6f')](_0xb53c('0x8d'),_0x3f9185,_0x3f9185);}if(!_[_0xb53c('0x38')](_0x15ea7a)&&_0xb53c('0x8c')===typeof _0x15ea7a&&!_[_0xb53c('0x73')](_0x15ea7a)){return _0x15ea7a;}return _0xb53c('0x8e');}function loggerCatchQueueSummary(_0x3ab085,_0x406209){return function(_0x241430){freeVariablesPredictive(_0x406209);emitVoiceQueueSummary(_0x406209);emitCampaignSummary(_0x406209);loggerSyncQueueSummary['error'](_0x3ab085,util['inspect'](_0x241430,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x587a7a,_0x533006){return function(_0x44f465){loggerPredictive[_0xb53c('0x8f')](_0x533006[_0xb53c('0x3b')],_0x587a7a);loggerPredictive[_0xb53c('0x8f')](_0x44f465[_0xb53c('0x90')]);freeVariablesPredictive(_0x533006);};}function loggerCatch(_0x517c8b){return function(_0x2a28a0){logger[_0xb53c('0x8f')](_0x517c8b,util[_0xb53c('0x91')](_0x2a28a0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3bd332){return _0x3bd332&&!_[_0xb53c('0x38')](_0x3bd332)&&_0x3bd332[_0xb53c('0x92')]>0x0;}function decremetOriginate(_0x9c31bd){if(!_[_0xb53c('0x38')](_0x9c31bd)&&_0x9c31bd!==null){if(_0x9c31bd['hasOwnProperty'](_0xb53c('0x93'))){if(_0x9c31bd[_0xb53c('0x93')]>0x0){_0x9c31bd['originated']-=0x1;}else{logger[_0xb53c('0x8f')](_0xb53c('0x94'));}}}else{logger[_0xb53c('0x8f')](_0xb53c('0x95'));}}function checkContactLowerLimitOriginate(_0x35bef6,_0xd6ffcc,_0x2fbe03){if(_0xd6ffcc>_0x2fbe03){for(var _0x5c51a5=0x0;_0x5c51a5<_0xd6ffcc-_0x2fbe03;_0x5c51a5+=0x1){decremetOriginate(_0x35bef6);}}}function loggerGetContactDialer(_0x4d811d,_0x5e756c,_0x1c1277){return function(_0x25c057){checkContactLowerLimitOriginate(_0x5e756c,_0x1c1277,0x0);logger['error'](_0x4d811d,util[_0xb53c('0x91')](_0x25c057,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1f2a97){return function(_0xe8fbe4){if(isNotNull(_0xe8fbe4)&&isNotNull(_0xe8fbe4[0x0])){if(_0xe8fbe4[0x0][_0xb53c('0x96')]>0x0){_0x1f2a97[_0xb53c('0x39')]=_0xb53c('0x97');logger[_0xb53c('0x75')]('[getContactDialer2][ReScheduled]'+_0x1f2a97[_0xb53c('0x3b')],_0xe8fbe4[0x0][_0xb53c('0x96')],_0xb53c('0x98'));}else{_0x1f2a97['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xb53c('0x75')](_0xb53c('0x99')+_0x1f2a97[_0xb53c('0x3b')]);}}};}function notSendMessagesQueue(_0x120e19){if(_0x120e19[_0xb53c('0x9a')]){freeVariablesPredictive(_0x120e19);if(_0x120e19['originated']===0x0&&_0x120e19[_0xb53c('0x4c')]===0x0&&_0x120e19[_0xb53c('0x50')]===0x0&&(_0x120e19[_0xb53c('0x9b')]||0x0)===0x0){_0x120e19[_0xb53c('0x9a')]=![];_0x120e19[_0xb53c('0x49')]=0x0;_0x120e19['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xb53c('0x8f')](_0xb53c('0x9c'),_0x120e19['name'],'is\x20not\x20active');}else{_0x120e19[_0xb53c('0x39')]=_0xb53c('0x9d');loggerSyncQueueSummary[_0xb53c('0x8f')](_0xb53c('0x9c'),_0x120e19['name'],_0xb53c('0x9e'));}emitVoiceQueueSummary(_0x120e19);}}function notSendMessagesCampaign(_0x162e6c){if(_0x162e6c[_0xb53c('0x9a')]){if(_0x162e6c[_0xb53c('0x93')]===0x0){_0x162e6c[_0xb53c('0x9a')]=![];_0x162e6c['message']=_0xb53c('0x3c');loggerSyncQueueSummary[_0xb53c('0x8f')](_0xb53c('0x9f'),_0x162e6c[_0xb53c('0x3b')],'is\x20not\x20active');}else{_0x162e6c[_0xb53c('0x39')]=_0xb53c('0x9d');loggerSyncQueueSummary['error'](_0xb53c('0x9f'),_0x162e6c[_0xb53c('0x3b')],_0xb53c('0x9e'));}emitCampaignSummary(_0x162e6c);}}function createObjHistory(_0x5b43de,_0x128292,_0x18c35b,_0xf741b4,_0x576348){_0x5b43de['message']=_0x18c35b;var _0x484e5e=new Action(_0x5b43de,_0x128292);var _0x53993b=new History(_0x484e5e);_0x53993b[_0xb53c('0xa0')]=_0xf741b4;_0x53993b[_0xb53c('0xa1')]=_0x576348;_0x53993b[_0xb53c('0xa2')]=_0x484e5e['starttime'];return _0x53993b;}Dialer[_0xb53c('0x19')][_0xb53c('0x37')]=function(){var _0x220ba1=this;setInterval(function(){_0x220ba1['clearZombieChannels'](_0x220ba1['uniqueId'],_0xb53c('0xa3'));_0x220ba1[_0xb53c('0xa4')](_0x220ba1['actions'],_0xb53c('0xa5'));},0x32c8);};Dialer[_0xb53c('0x19')][_0xb53c('0xa4')]=function(_0x8cb4e0,_0x39e55d){var _0x1786c6=this;for(var _0x3d4c99 in _0x8cb4e0){if(_0x8cb4e0['hasOwnProperty'](_0x3d4c99)){this[_0xb53c('0xa6')][_0xb53c('0xa7')](function(){if(!_[_0xb53c('0xa8')](_0x8cb4e0[_0x3d4c99])){return ami['Action']({'action':'status','channel':_0x8cb4e0[_0x3d4c99][_0xb53c('0xa9')]})['catch'](function(_0x2dc89e){if(_0x2dc89e[_0xb53c('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x8cb4e0[_0x3d4c99]&&_0x8cb4e0[_0x3d4c99][_0xb53c('0x71')]!==_0xb53c('0x8b')){_0x1786c6[_0xb53c('0xaa')](_0x1786c6[_0xb53c('0x1c')][_0x8cb4e0[_0x3d4c99][_0xb53c('0xab')]]);logger[_0xb53c('0x8f')](_0xb53c('0xac'),_0x39e55d,_0x3d4c99,_0x8cb4e0[_0x3d4c99]['queue']);delete _0x8cb4e0[_0x3d4c99];}if(_0x8cb4e0[_0x3d4c99]&&_0x8cb4e0[_0x3d4c99][_0xb53c('0x71')]===_0xb53c('0x8b')){_0x1786c6[_0xb53c('0xaa')](_0x1786c6[_0xb53c('0xad')][_0x8cb4e0[_0x3d4c99][_0xb53c('0xab')]]);logger[_0xb53c('0x8f')](_0xb53c('0xae'),_0x39e55d,_0x3d4c99,_0x8cb4e0[_0x3d4c99][_0xb53c('0xab')]);delete _0x8cb4e0[_0x3d4c99];}},0x2328);}});}});}}};Dialer['prototype'][_0xb53c('0xaf')]=function(_0xb2b80){return BPromise['resolve']()[_0xb53c('0xb0')](cmHopper[_0xb53c('0xaf')](_0xb2b80))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xb2')));};Dialer[_0xb53c('0x19')][_0xb53c('0xb3')]=function(_0x5a1a0b){return BPromise['resolve']()[_0xb53c('0xb0')](cmHopperBlack[_0xb53c('0xb3')](_0x5a1a0b))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xb4')));};Dialer[_0xb53c('0x19')][_0xb53c('0xb5')]=function(_0x68f5cd){return BPromise['resolve']()['then'](cmHopperBlack[_0xb53c('0xb5')](_0x68f5cd))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xb53c('0x19')][_0xb53c('0xb6')]=function(_0x6fb009){return BPromise['resolve']()[_0xb53c('0xb0')](cmHopperHistory[_0xb53c('0xb7')](_0x6fb009))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xb8')));};Dialer[_0xb53c('0x19')][_0xb53c('0xb9')]=function(_0x1f247a){return BPromise[_0xb53c('0xba')]()[_0xb53c('0xb0')](cmHopper[_0xb53c('0xb9')](_0x1f247a))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xbb')));};Dialer['prototype']['getContactDialer']=function(_0x42fc21,_0xc26040,_0x37a4b2,_0x1c4b47){return BPromise[_0xb53c('0xba')]()['then'](cmHopper[_0xb53c('0xbc')](_0x42fc21,_0xc26040,_0x37a4b2,_0x1c4b47))[_0xb53c('0xb1')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xb53c('0x19')]['getContactDialerIvr']=function(_0x4c4141,_0x576b59,_0x49c283){return BPromise['resolve']()[_0xb53c('0xb0')](cmHopper[_0xb53c('0xbd')](_0x4c4141,_0x576b59,_0x49c283))['catch'](loggerCatch(_0xb53c('0xbe')));};Dialer['prototype'][_0xb53c('0xbf')]=function(_0x12d43e){return BPromise[_0xb53c('0xba')]()[_0xb53c('0xb0')](voiceQueueRt[_0xb53c('0xbf')](_0x12d43e))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xc0')));};Dialer[_0xb53c('0x19')]['moveContactManagedDialer']=function(_0x35297b){return BPromise['resolve']()[_0xb53c('0xb0')](cmHopper['moveContactManagedDialer'](_0x35297b))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xc1')));};Dialer[_0xb53c('0x19')][_0xb53c('0xc2')]=function(_0x194735){return BPromise[_0xb53c('0xba')]()[_0xb53c('0xb0')](cmHopperHistory[_0xb53c('0xc2')](_0x194735))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xc3')));};Dialer[_0xb53c('0x19')]['updateOriginated']=function(_0x4829ad){if(!_[_0xb53c('0x38')](_0x4829ad)&&_0x4829ad!==null){if(_0x4829ad['hasOwnProperty'](_0xb53c('0x93'))){if(_0x4829ad[_0xb53c('0x93')]>0x0){_0x4829ad[_0xb53c('0x93')]-=0x1;}else{logger[_0xb53c('0x8f')](_0xb53c('0xc4'));}}}else{logger[_0xb53c('0x8f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb53c('0x19')][_0xb53c('0xc5')]=function(_0xf85fff,_0x41f79d){var _0xb80ed3=this;return function(_0x3e94c2){_0xb80ed3[_0xb53c('0xaa')](_0x41f79d);logger[_0xb53c('0x8f')](_0xf85fff,util[_0xb53c('0x91')](_0x3e94c2,{'showHidden':![],'depth':null}));};};Dialer[_0xb53c('0x19')][_0xb53c('0xc6')]=function(_0x48724c,_0x5d5169,_0x529d05){var _0x2ee66d={'state':0x19,'statedesc':_0xb53c('0xc7')};this['updateOriginated'](_0x5d5169);this['saveInDb'](_[_0xb53c('0x85')](_0x2ee66d,_[_0xb53c('0xc8')](_0x529d05,[_0xb53c('0xc9'),_0xb53c('0xca'),_0xb53c('0xcb'),'VoiceQueueId',_0xb53c('0xcc')])),_0xb53c('0xcd'),_0xb53c('0xce'));logger[_0xb53c('0x8f')](_0x48724c);};Dialer[_0xb53c('0x19')][_0xb53c('0xcf')]=function(_0x6858bc){return _0x6858bc===_0xb53c('0xd0');};Dialer[_0xb53c('0x19')][_0xb53c('0xd1')]=function(_0x27599f){return!_[_0xb53c('0x38')](_0x27599f)&&_0x27599f&&!_[_0xb53c('0x38')](_0x27599f['name'])&&!_[_0xb53c('0x38')](_0x27599f['active'])&&_0x27599f['active']&&(this[_0xb53c('0x1e')][util[_0xb53c('0x6f')](_0xb53c('0xd2'),_0x27599f['name'])][_0xb53c('0xd3')]==='reachable'||this[_0xb53c('0x1e')][util[_0xb53c('0x6f')](_0xb53c('0xd2'),_0x27599f['name'])][_0xb53c('0xd3')]===_0xb53c('0xd4'));};Dialer['prototype'][_0xb53c('0xd5')]=function(_0x32a237,_0x345f94,_0x2e2ddc){this['createHistory'](_0x32a237)['catch'](loggerCatch(_0x345f94));this[_0xb53c('0xd6')](_0x32a237)[_0xb53c('0xb1')](loggerCatch(_0x2e2ddc));};Dialer[_0xb53c('0x19')]['syncVarSet']=function(_0x2041fd){var _0x3ef7e4=this['uniqueId'][_0x2041fd[_0xb53c('0xd7')]];var _0x2d9014;if(!_[_0xb53c('0xa8')](_0x2041fd)&&!_[_0xb53c('0xa8')](_0x2041fd[_0xb53c('0xd8')])&&!_[_0xb53c('0xa8')](_0x2041fd[_0xb53c('0xd8')][_0xb53c('0xd9')])&&_0x2041fd[_0xb53c('0xda')]===_0xb53c('0xdb')&&_0x3ef7e4){if(_0x3ef7e4[_0xb53c('0x71')]!==_0xb53c('0x8b')&&this[_0xb53c('0x1c')][_0x3ef7e4[_0xb53c('0xab')]]['dialAMDActive']&&_0x2041fd['value']===_0xb53c('0xdc')){delete this[_0xb53c('0xdd')][_0x2041fd[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this[_0xb53c('0x1c')][_0x3ef7e4[_0xb53c('0xab')]]);this[_0xb53c('0x1c')][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0x57')]+=0x1;this[_0xb53c('0x1c')][_0x3ef7e4[_0xb53c('0xab')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2d9014=new Hangup(_0x3ef7e4,_0x2041fd);_0x2d9014[_0xb53c('0xa0')]=0x12;_0x2d9014[_0xb53c('0xa1')]='HangupInAMD';_0x2d9014[_0xb53c('0xde')]='AMD';this['saveInDb'](_0x2d9014,'[syncHangupInAMD][createHistory]',_0xb53c('0xdf'));}if(_0x3ef7e4['type']!==_0xb53c('0x8b')&&this['voiceQueues'][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0xe0')]&&_0x2041fd[_0xb53c('0xe1')]===_0xb53c('0xe2')){delete this[_0xb53c('0xdd')][_0x2041fd[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this['voiceQueues'][_0x3ef7e4[_0xb53c('0xab')]]);this[_0xb53c('0x1c')][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0x57')]+=0x1;this['voiceQueues'][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0x56')]+=0x1;_0x2d9014=new Hangup(_0x3ef7e4,_0x2041fd);_0x2d9014['state']=0x13;_0x2d9014[_0xb53c('0xa1')]='Machine';_0x2d9014[_0xb53c('0xde')]=_0xb53c('0xe3');_0x2d9014[_0xb53c('0xe4')]=!![];this[_0xb53c('0xd5')](_0x2d9014,'[syncMachine][createHistory]',_0xb53c('0xe5'));}if(_0x3ef7e4['type']===_0xb53c('0x8b')&&this[_0xb53c('0xad')][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0xe0')]&&_0x2041fd[_0xb53c('0xe1')]==='HANGUP'){delete this[_0xb53c('0xdd')][_0x2041fd[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this[_0xb53c('0xad')][_0x3ef7e4[_0xb53c('0xab')]]);_0x2d9014=new Hangup(_0x3ef7e4,_0x2041fd);_0x2d9014[_0xb53c('0xa0')]=0x12;_0x2d9014[_0xb53c('0xa1')]=_0xb53c('0xe6');_0x2d9014[_0xb53c('0xde')]=_0xb53c('0xe3');this[_0xb53c('0xd5')](_0x2d9014,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x3ef7e4[_0xb53c('0x71')]==='ivr'&&this['campaigns'][_0x3ef7e4[_0xb53c('0xab')]][_0xb53c('0xe0')]&&_0x2041fd['value']===_0xb53c('0xe2')){delete this[_0xb53c('0xdd')][_0x2041fd[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this[_0xb53c('0xad')][_0x3ef7e4[_0xb53c('0xab')]]);_0x2d9014=new Hangup(_0x3ef7e4,_0x2041fd);_0x2d9014['state']=0x13;_0x2d9014['statedesc']=_0xb53c('0xe7');_0x2d9014[_0xb53c('0xde')]=_0xb53c('0xe3');_0x2d9014[_0xb53c('0xe4')]=!![];this[_0xb53c('0xd5')](_0x2d9014,_0xb53c('0xe8'),_0xb53c('0xe9'));}}};Dialer['prototype'][_0xb53c('0x2f')]=function(_0x41bfaf){var _0x4423ad=this['uniqueId'][_0x41bfaf['uniqueid']];var _0x4c64a2=this;var _0x37eed1;if(_0x4423ad&&_0x4423ad[_0xb53c('0x71')]===_0xb53c('0x8b')){delete this[_0xb53c('0xdd')][_0x41bfaf[_0xb53c('0xd7')]];this['updateOriginated'](this[_0xb53c('0xad')][_0x4423ad[_0xb53c('0xab')]]);this[_0xb53c('0xad')][_0x4423ad[_0xb53c('0xab')]][_0xb53c('0xea')]+=0x1;_0x37eed1=new Hangup(_0x4423ad,_0x41bfaf);this[_0xb53c('0xc2')](_0x37eed1)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xeb')));this[_0xb53c('0xd6')](_0x37eed1)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xec')));}if(_0x4423ad&&_0x4423ad[_0xb53c('0x71')]!==_0xb53c('0x8b')&&isNotNull(this[_0xb53c('0x1c')][_0x4423ad['queue']][_0xb53c('0xed')])){delete this[_0xb53c('0xdd')][_0x41bfaf[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this['voiceQueues'][_0x4423ad[_0xb53c('0xab')]]);this[_0xb53c('0x1c')][_0x4423ad['queue']][_0xb53c('0x57')]+=0x1;this[_0xb53c('0x1c')][_0x4423ad[_0xb53c('0xab')]][_0xb53c('0x56')]+=0x1;_0x37eed1=new Hangup(_0x4423ad,_0x41bfaf);_0x37eed1[_0xb53c('0xa0')]=0x10;_0x37eed1[_0xb53c('0xa1')]=_0xb53c('0xee');_0x37eed1[_0xb53c('0xde')]=_0xb53c('0xef');this[_0xb53c('0xc2')](_0x37eed1)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xeb')));this[_0xb53c('0xd6')](_0x37eed1)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x4423ad&&_0x4423ad[_0xb53c('0x71')]!=='ivr'&&!isNotNull(this[_0xb53c('0x1c')][_0x4423ad[_0xb53c('0xab')]][_0xb53c('0xed')])){delete this['uniqueId'][_0x41bfaf[_0xb53c('0xd7')]];this[_0xb53c('0xaa')](this[_0xb53c('0x1c')][_0x4423ad[_0xb53c('0xab')]]);this[_0xb53c('0x1c')][_0x4423ad[_0xb53c('0xab')]]['outboundUnknownCallsDay']+=0x1;_0x37eed1=new Hangup(_0x4423ad,_0x41bfaf);_0x37eed1[_0xb53c('0xa0')]=0xc;_0x37eed1[_0xb53c('0xa1')]=_0x41bfaf[_0xb53c('0xf0')];_0x37eed1['membername']=_0xb53c('0xf1');this['createHistory'](_0x37eed1)['catch'](loggerCatch(_0xb53c('0xeb')));this[_0xb53c('0xd6')](_0x37eed1)[_0xb53c('0xb1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xb53c('0x19')][_0xb53c('0x2d')]=function(_0x11f5a9){var _0x55b70e=this['uniqueId'][_0x11f5a9[_0xb53c('0xd7')]];var _0x126a3c=this;if(this['voiceQueues'][_0x11f5a9[_0xb53c('0xab')]]){if(_0x55b70e&&_0x55b70e['type']!=='ivr'){delete this[_0xb53c('0xdd')][_0x11f5a9[_0xb53c('0xd7')]];this[_0xb53c('0x1c')][_0x11f5a9['queue']]['outboundAnswerCallsDay']+=0x1;var _0x430e6f=new AgentComplete(_0x55b70e,_0x11f5a9);if(_0x11f5a9['reason']===_0xb53c('0xf2')){_0x430e6f[_0xb53c('0xf3')]=this[_0xb53c('0x1c')][_0x11f5a9[_0xb53c('0xab')]][_0xb53c('0xf4')]&&this[_0xb53c('0x1c')][_0x11f5a9[_0xb53c('0xab')]]['dialAgiAfterHangupAgent']?moment()[_0xb53c('0x6f')](_0xb53c('0xf5')):undefined;}this[_0xb53c('0xc2')](_0x430e6f)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xf6')));this[_0xb53c('0xd6')](_0x430e6f)[_0xb53c('0xb1')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xb53c('0x19')][_0xb53c('0x28')]=function(_0x397455){if(this[_0xb53c('0x1c')][_0x397455[_0xb53c('0xab')]]){if(this[_0xb53c('0xdd')][_0x397455[_0xb53c('0xd7')]]&&this[_0xb53c('0xdd')][_0x397455[_0xb53c('0xd7')]][_0xb53c('0x71')]!=='ivr'){this[_0xb53c('0xaa')](this[_0xb53c('0x1c')][_0x397455['queue']]);this[_0xb53c('0xdd')][_0x397455[_0xb53c('0xd7')]][_0xb53c('0xf7')]=moment()[_0xb53c('0x6f')](_0xb53c('0xf5'));}}};Dialer[_0xb53c('0x19')][_0xb53c('0xf8')]=function(_0x95c5ad){this[_0xb53c('0xc2')](_0x95c5ad)[_0xb53c('0xb1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb53c('0xd6')](_0x95c5ad)[_0xb53c('0xb1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0xb53c('0x2b')]=function(_0x1c1be8){var _0x173e13=this['uniqueId'][_0x1c1be8[_0xb53c('0xd7')]];var _0x3e8b4c=this;if(this['voiceQueues'][_0x1c1be8[_0xb53c('0xab')]]){if(_0x173e13&&_0x173e13[_0xb53c('0x71')]!=='ivr'){delete this['uniqueId'][_0x1c1be8['uniqueid']];this[_0xb53c('0xaa')](this['voiceQueues'][_0x1c1be8[_0xb53c('0xab')]]);_0x173e13[_0xb53c('0xf9')]=moment()[_0xb53c('0x6f')](_0xb53c('0xf5'));var _0x5e1ec3=new QueueCallerAbandon(_0x173e13,_0x1c1be8);if(getSeconds(_0x173e13['droptime'],_0x173e13['responsetime'])>=_0x173e13[_0xb53c('0xfa')]){this[_0xb53c('0x1c')][_0x1c1be8[_0xb53c('0xab')]][_0xb53c('0x63')]+=0x1;this[_0xb53c('0x1c')][_0x1c1be8[_0xb53c('0xab')]][_0xb53c('0xfb')]+=0x1;this['voiceQueues'][_0x1c1be8[_0xb53c('0xab')]][_0xb53c('0x65')]+=0x1;_0x5e1ec3[_0xb53c('0xa0')]=0xa;_0x5e1ec3[_0xb53c('0xa1')]='Drop';_0x5e1ec3[_0xb53c('0xfc')]='TIMEOUT';_0x5e1ec3[_0xb53c('0xf3')]=this[_0xb53c('0x1c')][_0x1c1be8['queue']][_0xb53c('0xf4')]?moment()[_0xb53c('0x6f')](_0xb53c('0xf5')):undefined;this[_0xb53c('0xf8')](_0x5e1ec3);}else{this[_0xb53c('0x1c')][_0x1c1be8[_0xb53c('0xab')]][_0xb53c('0x62')]+=0x1;this[_0xb53c('0x1c')][_0x1c1be8[_0xb53c('0xab')]][_0xb53c('0xfd')]+=0x1;_0x5e1ec3[_0xb53c('0xa0')]=0xb;_0x5e1ec3[_0xb53c('0xa1')]=_0xb53c('0xfe');_0x5e1ec3[_0xb53c('0xfc')]='CALLEREXIT';this[_0xb53c('0xf8')](_0x5e1ec3);}}}};Dialer[_0xb53c('0x19')][_0xb53c('0x31')]=function(_0x30e4d8){if(this[_0xb53c('0x21')][_0x30e4d8['uniqueid']]){this[_0xb53c('0x21')][_0x30e4d8[_0xb53c('0xd7')]]['channel']=_0x30e4d8[_0xb53c('0xa9')];}if(this['uniqueId'][_0x30e4d8[_0xb53c('0xd7')]]){this[_0xb53c('0xdd')][_0x30e4d8[_0xb53c('0xd7')]][_0xb53c('0xa9')]=_0x30e4d8['channel'];}};Dialer[_0xb53c('0x19')][_0xb53c('0x34')]=function(_0x572ca8){if(strategy[this['voiceQueues'][this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0xab')]][_0xb53c('0x100')]]===_0xb53c('0x18')){if(this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]]&&_[_0xb53c('0xa8')](this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0x101')])&&_0x572ca8[_0xb53c('0xd3')]==='1'&&_0x572ca8[_0xb53c('0x102')]==='0'){if(this[_0xb53c('0x1d')][_0x572ca8['stateinterface']]){if(!this[_0xb53c('0x1d')][_0x572ca8['stateinterface']][_0xb53c('0x101')]){this[_0xb53c('0x1d')][_0x572ca8[_0xb53c('0x103')]]['locked']=!![];this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0x101')]=!![];this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0x103')]=_0x572ca8[_0xb53c('0x103')];}}}}else if((strategy[this[_0xb53c('0x1c')][this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]]['queue']]['strategy']]||_0xb53c('0x104'))==='rrmemory'){if(this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]]){if(this[_0xb53c('0x1d')][_0x572ca8[_0xb53c('0x103')]]){this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]]['stateinterface']=_0x572ca8['stateinterface'];if(_['isNil'](this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x572ca8['actionid']][_0xb53c('0xab')]])){this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0xab')]]=[];}this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]][_0xb53c('0xab')]][_0xb53c('0x106')](_[_0xb53c('0x85')](_['pick'](this[_0xb53c('0x21')][_0x572ca8[_0xb53c('0xff')]],[_0xb53c('0x107'),_0xb53c('0x103')]),{'status':_0x572ca8[_0xb53c('0xd3')],'paused':_0x572ca8[_0xb53c('0x102')]}));}}}};function unlockQueueStatus(_0x3be934,_0x256da6){setTimeout(function(){if(_['isUndefined'](_0x3be934[_0xb53c('0x108')])){loggerBooked[_0xb53c('0x8f')](_0xb53c('0x109'),_0x256da6);}_0x3be934[_0xb53c('0x108')]=!![];loggerBooked[_0xb53c('0x75')](_0xb53c('0x10a'),_0x256da6,JSON[_0xb53c('0x44')](_['pick'](_0x3be934,[_0xb53c('0x3b'),_0xb53c('0x108')])));},0x1f3);}Dialer['prototype'][_0xb53c('0x10b')]=function(_0x6f5d36){var _0x34ba0f=this;var _0x9b415f=_0x34ba0f[_0xb53c('0x1c')][_0x34ba0f[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]];if(strategy[this[_0xb53c('0x1c')][this[_0xb53c('0x21')][_0x6f5d36['actionid']]['queue']][_0xb53c('0x100')]]==='roundrobin'){if(this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]&&this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0x103')]){this[_0xb53c('0x8a')][_0xb53c('0x10c')](this[_0xb53c('0x21')][_0x6f5d36['actionid']][_0xb53c('0x107')],this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]['stateinterface'])[_0xb53c('0xb1')](function(_0x5ec0af){logger[_0xb53c('0x8f')](_0xb53c('0x10d'),util[_0xb53c('0x91')](_0x5ec0af,{'showHidden':![],'depth':null}));})[_0xb53c('0x1b')](function(){_0x34ba0f['updateOriginated'](_0x34ba0f[_0xb53c('0x1c')][_0x34ba0f[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]);_0x34ba0f[_0xb53c('0x1d')][_0x34ba0f[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0x103')]][_0xb53c('0x101')]=![];delete _0x34ba0f[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]];unlockQueueStatus(_0x9b415f);});}else{this[_0xb53c('0xaa')](this[_0xb53c('0x1c')][this['actions'][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]);this[_0xb53c('0xb9')]({'active':![],'ContactId':this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]['ContactId'],'ListId':this['actions'][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xca')],'VoiceQueueId':this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0x10e')]||undefined,'CampaignId':this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xcc')]||undefined})['catch'](loggerCatch(_0xb53c('0x10f')));delete this[_0xb53c('0x21')][_0x6f5d36['actionid']];unlockQueueStatus(_0x9b415f);}}else if((strategy[this[_0xb53c('0x1c')][this['actions'][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]['strategy']]||_0xb53c('0x104'))===_0xb53c('0x104')){var _0x2ca71d;if(this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]&&!_[_0xb53c('0x73')](this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x6f5d36['actionid']][_0xb53c('0xab')]])){if(this['queueBookedRR'][_0x34ba0f[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]){this[_0xb53c('0x26')][_0x34ba0f['actions'][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]=this[_0xb53c('0x26')][this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]]?this['queueBookedRR'][this[_0xb53c('0x21')][_0x6f5d36['actionid']]['queue']]:this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]['queue']]?this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]][_0xb53c('0x110')]||0x0:0x0;}this[_0xb53c('0x105')][this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]]['queue']][_0xb53c('0x110')]=this[_0xb53c('0x26')][this[_0xb53c('0x21')][_0x6f5d36[_0xb53c('0xff')]][_0xb53c('0xab')]];for(var _0x36654e=0x0;_0x36654e=0x0?!![]:![];})[_0xb53c('0xb1')](myreject(_0x58c652)));}}else{_0x2ff6db[_0xb53c('0x106')](ami[_0xb53c('0x129')]({'action':_0xb53c('0x126'),'command':util[_0xb53c('0x6f')](_0xb53c('0x127'),_0x26f683,!_['isUndefined'](config['timezones'][_0x3e0d3d])?_0x3e0d3d:'')})[_0xb53c('0xb0')](function(_0x19d1a7){return _0x19d1a7[_0xb53c('0x12a')][_0xb53c('0x12b')](_0xb53c('0x12c'))>=0x0?!![]:![];})['catch'](myreject(_0x58c652)));}BPromise['all'](_0x2ff6db)['then'](function(_0x538dc8){var _0x26fb44=_[_0xb53c('0x12d')](_0x538dc8);if(_0x26fb44){return _0x806447(_0x26fb44);}else{_0x360423['message']=_0x5604c0?_0xb53c('0x12e'):_0xb53c('0x12f');return _0x58c652(msgResponse('[ifTime][promiseAll]',_0xb53c('0x11f'),'Global:\x20'+_0x5604c0+'\x20'+_0x1a0019+'\x20Interval\x20is\x20overtime:\x20'+util[_0xb53c('0x91')](_0x26f683,{'showHidden':![],'depth':null})+_0xb53c('0x130')+_0x3e0d3d));}})['catch'](function(_0x565d4b){return _0x58c652(msgResponse(_0xb53c('0x11e'),_0xb53c('0x11f'),JSON[_0xb53c('0x44')](_0x565d4b)));});});};Dialer[_0xb53c('0x19')][_0xb53c('0x131')]=function(_0x289bd9){var _0x18f64e=this;return function(){switch(_0x289bd9[_0xb53c('0x52')]){case _0xb53c('0x132'):freeVariablesPredictive(_0x289bd9);_0x18f64e[_0xb53c('0x133')](_0x289bd9,0x1);break;case _0xb53c('0x134'):freeVariablesPredictive(_0x289bd9);_0x18f64e[_0xb53c('0x133')](_0x289bd9,_0x289bd9[_0xb53c('0x135')]);break;case _0xb53c('0x136'):_0x18f64e[_0xb53c('0x136')](_0x289bd9);break;case _0xb53c('0x6'):freeVariablesPredictive(_0x289bd9);_0x18f64e[_0xb53c('0x133')](_0x289bd9,0x1);break;default:freeVariablesPredictive(_0x289bd9);logger[_0xb53c('0x8f')](_0xb53c('0x137'),_0x289bd9[_0xb53c('0x3b')],'method\x20not\x20recognized');}};};Dialer[_0xb53c('0x19')]['launchHandleIvr']=function(_0x15bba3){var _0x4d5e39=this;return function(){_0x4d5e39[_0xb53c('0x138')](_0x15bba3);};};Dialer[_0xb53c('0x19')][_0xb53c('0x9')]=function(_0x51588c){var _0x59cfac=this;if(isNotPreview(_0x51588c[_0xb53c('0x52')])){if(isVoiceQueueOutbound(_0x51588c[_0xb53c('0x71')])&&isActive(_0x51588c['dialActive'])){_0x51588c[_0xb53c('0x9a')]=!![];BPromise['resolve']()[_0xb53c('0xb0')](checkIsLoggedIn(_0x51588c,_0x51588c['loggedIn']))['then'](checkIsActive(_0x51588c,_0x51588c[_0xb53c('0x139')]))[_0xb53c('0xb0')](checkInterval(_0x51588c))[_0xb53c('0xb0')](_0x59cfac[_0xb53c('0x11a')](_0x51588c))[_0xb53c('0xb0')](_0x59cfac[_0xb53c('0x13a')](_0x51588c[_0xb53c('0x13b')],_0x51588c[_0xb53c('0x13c')],_0x51588c['name'],_0x51588c))['then'](_0x59cfac[_0xb53c('0x13d')](_0x51588c['Interval'],_0x51588c[_0xb53c('0x13c')],_0x51588c[_0xb53c('0x3b')],_0x51588c))[_0xb53c('0xb0')](_0x59cfac[_0xb53c('0x131')](_0x51588c))[_0xb53c('0xb1')](loggerCatchQueueSummary(_0xb53c('0x13e'),_0x51588c));}else{notSendMessagesQueue(_0x51588c);}}else{freeVariablesPredictive(_0x51588c);}};Dialer[_0xb53c('0x19')]['syncCampaigns']=function(){var _0x30ece0=this;var _0x3821f6;for(var _0x207585 in this[_0xb53c('0xad')]){if(this[_0xb53c('0xad')][_0xb53c('0x13f')](_0x207585)){_0x3821f6=this[_0xb53c('0xad')][_0x207585];if(isCampaignIvr(_0x3821f6[_0xb53c('0x71')])&&isActive(_0x3821f6['active'])){_0x3821f6[_0xb53c('0x9a')]=!![];BPromise[_0xb53c('0xba')]()[_0xb53c('0xb0')](checkIsActive(_0x3821f6,_0x3821f6[_0xb53c('0x6d')]))[_0xb53c('0xb0')](checkInterval(_0x3821f6))[_0xb53c('0xb0')](_0x30ece0['checkIsTrunkReachable'](_0x3821f6))['then'](_0x30ece0[_0xb53c('0x13a')](_0x3821f6['dialGlobalInterval'],_0x3821f6[_0xb53c('0x13c')],_0x3821f6[_0xb53c('0x3b')],_0x3821f6))['then'](_0x30ece0[_0xb53c('0x13d')](_0x3821f6[_0xb53c('0x3e')],_0x3821f6['dialTimezone'],_0x3821f6[_0xb53c('0x3b')],_0x3821f6))['then'](_0x30ece0[_0xb53c('0x140')](_0x3821f6))[_0xb53c('0xb1')](loggerCatchQueueSummary(_0xb53c('0x141'),_0x3821f6));}else{notSendMessagesCampaign(_0x3821f6);}}}};function getCallerIdRandom(_0x12c2a4,_0x31707e){var _0x510c8d,_0x8c9db3,_0x344115;if(_0x31707e<=0x0){_0x31707e=0x1;}_0x510c8d=new RegExp('\x5cw{0,'+_0x31707e+'}$');_0x8c9db3=Math['pow'](0xa,_0x31707e-0x1);_0x344115=Math['pow'](0xa,_0x31707e)-0x1;return util['format']('%s',_['replace'](_0x12c2a4,_0x510c8d,_[_0xb53c('0x142')](_0x8c9db3,_0x344115)));}function extractCalleridName(_0x3e32c2){var _0x14b2db=_0x3e32c2[_0xb53c('0x143')](/"(.*?)"/);return _0x14b2db?_0x14b2db[0x1]:_0x3e32c2;}function extractCalleridNumber(_0x46ac66){var _0x4492bb=_0x46ac66[_0xb53c('0x143')](/<(.*?)>/);return _0x4492bb?_0x4492bb[0x1]:_0x46ac66;}Dialer[_0xb53c('0x19')][_0xb53c('0x144')]=function(_0x233695,_0x5a62b7){var _0x26dec7=this;var _0x5ef692=uuid['v4']();this[_0xb53c('0x21')][_0x5ef692]=new Action(_0x233695,_0x5a62b7,_0x5ef692);return new BPromise(function(_0x55e727,_0x1661ff){if(_[_0xb53c('0x38')](_0x233695)&&_0xb53c('0x145')!==typeof _0x233695){return _0x1661ff(msgResponse(_0xb53c('0x146'),_0xb53c('0x11f'),_0xb53c('0x147')));}if(_[_0xb53c('0x38')](_0x5a62b7[_0xb53c('0x148')]['phone'])||_0x5a62b7[_0xb53c('0x148')][_0xb53c('0x149')]===null){return _0x1661ff(msgResponse(_0xb53c('0x146'),_0xb53c('0x11f'),'contact\x20is\x20undefine'));}var _0xfac56d={'XMD-CALLERID':_0x26dec7[_0xb53c('0x21')][_0x5ef692]['getCaller'](),'XMD-AGI':_0x233695['dialQueueProject']?util[_0xb53c('0x6f')](_0xb53c('0x14a'),ipAgi,_0x233695[_0xb53c('0xed')]):_0xb53c('0x14b'),'XMD-AGIAFTER':_0x233695[_0xb53c('0xf4')]?util['format'](_0xb53c('0x14a'),ipAgi,_0x233695['dialQueueProject2']):_0xb53c('0x14b'),'XMD-QUEUE':_0x233695[_0xb53c('0x71')]===_0xb53c('0x48')?util[_0xb53c('0x6f')]('\x22%s,%s%s,,,%s\x22',_0x233695[_0xb53c('0x3b')],_0x233695['dialQueueOptions']||'',_0x233695[_0xb53c('0x14c')]?'c':'',_0x233695[_0xb53c('0xfa')]||0x3):_0xb53c('0x14b'),'XMD-CONTACTID':_0x5a62b7[_0xb53c('0xc9')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x26dec7[_0xb53c('0x21')][_0x5ef692][_0xb53c('0x14d')](),'XMD-AMD':_0x233695[_0xb53c('0xe0')]?_0xb53c('0x14e'):_0xb53c('0x14b'),'XMD-DESTINATION':_0xb53c('0xdb')};if(_0x233695[_0xb53c('0xe0')]){_0xfac56d['XMD-AMDINITIALSILENCE']=_0x233695['dialAMDInitialSilence']||0x9c4;_0xfac56d[_0xb53c('0x14f')]=_0x233695[_0xb53c('0x150')]||0x5dc;_0xfac56d['XMD-AMDAFTERGREETINGSILENCE']=_0x233695[_0xb53c('0x151')]||0x320;_0xfac56d['XMD-AMDTOTALANALYSISTIME']=_0x233695['dialAMDTotalAnalysisTime']||0x1388;_0xfac56d['XMD-AMDMINWORDLENGTH']=_0x233695[_0xb53c('0x152')]||0x64;_0xfac56d[_0xb53c('0x153')]=_0x233695[_0xb53c('0x154')]||0x32;_0xfac56d['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x233695[_0xb53c('0x155')]||0x3;_0xfac56d[_0xb53c('0x156')]=_0x233695[_0xb53c('0x157')]||0x100;_0xfac56d[_0xb53c('0x158')]=_0x233695[_0xb53c('0x159')]||0x1388;}if(_0x233695[_0xb53c('0x71')]===_0xb53c('0x48')){_0xfac56d[_0xb53c('0x15a')]=_0x5a62b7['VoiceQueueId'];}else{_0xfac56d[_0xb53c('0x15b')]=_0x5a62b7[_0xb53c('0xcc')];}for(var _0x5cdca6 in _0x5a62b7['Contact']){if(_0x5a62b7[_0xb53c('0x148')][_0xb53c('0x13f')](_0x5cdca6)){if(isNotNull(_0x5a62b7['Contact'][_0x5cdca6])&&_0x5cdca6!=='id'&&_0x5cdca6!==_0xb53c('0x15c')&&_0x5cdca6!==_0xb53c('0x15d')&&_0x5cdca6!=='updatedAt'){_0xfac56d[util[_0xb53c('0x6f')]('%s%s',_0xb53c('0x15e'),_[_0xb53c('0x15f')](_0x5cdca6))]=_0x5a62b7[_0xb53c('0x148')][_0x5cdca6];}}}var _0x4e0486=_0x26dec7['isTrunkReachable'](_0x233695[_0xb53c('0x6c')])?getCallerId(_0x233695[_0xb53c('0x6c')][_0xb53c('0x6e')],_0x233695[_0xb53c('0x160')],_0x233695[_0xb53c('0x161')]>0x0?getCallerIdRandom(_0x233695[_0xb53c('0x53')],_0x233695[_0xb53c('0x161')]):_0x233695[_0xb53c('0x53')]):getCallerId(_[_0xb53c('0xa8')](_0x233695['TrunkBackup'])?_0x233695[_0xb53c('0x6c')][_0xb53c('0x6e')]:_0x233695[_0xb53c('0x11b')]['callerid'],_0x233695[_0xb53c('0x160')],_0x233695[_0xb53c('0x161')]>0x0?getCallerIdRandom(_0x233695[_0xb53c('0x53')],_0x233695[_0xb53c('0x161')]):_0x233695[_0xb53c('0x53')]);if(_0x4e0486){_0xfac56d[_0xb53c('0x162')]=_0x26dec7[_0xb53c('0x21')][_0x5ef692][_0xb53c('0x163')]=extractCalleridName(_0x4e0486);_0xfac56d[_0xb53c('0x164')]=_0x26dec7[_0xb53c('0x21')][_0x5ef692][_0xb53c('0x165')]=extractCalleridNumber(_0x4e0486);}return ami[_0xb53c('0x129')]({'actionid':_0x5ef692,'action':_0xb53c('0x146'),'channel':_0x26dec7[_0xb53c('0xd1')](_0x233695['Trunk'])?util[_0xb53c('0x6f')](_0xb53c('0x166'),_0x233695[_0xb53c('0x6c')][_0xb53c('0x3b')],isNotNull(_0x233695['dialPrefix'])?_0x233695[_0xb53c('0x55')][_0xb53c('0x167')]()||'':'',_0x233695[_0xb53c('0x168')]>0x0?_0x5a62b7[_0xb53c('0x148')]['phone'][_0xb53c('0x169')](_0x233695[_0xb53c('0x168')]):_0x5a62b7['Contact']['phone']):util[_0xb53c('0x6f')](_0xb53c('0x166'),_[_0xb53c('0xa8')](_0x233695['TrunkBackup'])?_0x233695[_0xb53c('0x6c')]['name']:_0x233695['TrunkBackup']['name'],isNotNull(_0x233695[_0xb53c('0x55')])?_0x233695[_0xb53c('0x55')]['trim']()||'':'',_0x233695[_0xb53c('0x168')]>0x0?_0x5a62b7[_0xb53c('0x148')][_0xb53c('0x149')][_0xb53c('0x169')](_0x233695['dialCutDigit']):_0x5a62b7['Contact'][_0xb53c('0x149')]),'callerid':_0x4e0486,'Exten':_0xb53c('0xdb'),'Context':_0xb53c('0x16a'),'Priority':'1','variable':_0xfac56d,'timeout':(_0x233695[_0xb53c('0x54')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5ef692})[_0xb53c('0xb0')](function(_0x342c64){return _0x55e727(_0x342c64);})[_0xb53c('0xb1')](function(_0x2a36c5){_0x233695[_0xb53c('0x5d')]+=0x1;var _0x210995=new History(_0x26dec7[_0xb53c('0x21')][_0x5ef692]);logger[_0xb53c('0x8f')](util['format'](_0xb53c('0x16b'),JSON['stringify'](_0x2a36c5)));_0x210995['state']=0xe;_0x210995[_0xb53c('0xa1')]='OriginateError';_0x210995[_0xb53c('0x16c')]=moment()[_0xb53c('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');_0x210995[_0xb53c('0xa2')]=_0x210995[_0xb53c('0x16c')];_0x26dec7[_0xb53c('0xc2')](_0x210995)[_0xb53c('0xb1')](loggerCatch('[originate][error]'));_0x26dec7[_0xb53c('0xd6')](_0x210995)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x16d')))[_0xb53c('0x1b')](function(){delete _0x26dec7[_0xb53c('0x21')][_0x5ef692];return _0x1661ff(msgResponse(_0xb53c('0x146'),_0xb53c('0x43'),'originate\x20action\x20Error'));});});});};Dialer[_0xb53c('0x19')][_0xb53c('0x2c')]=function(_0x3a39ff){var _0x16324b=this[_0xb53c('0x21')][_0x3a39ff['actionid']];var _0x42ce0b=this;if(_0x16324b){delete this['actions'][_0x3a39ff[_0xb53c('0xff')]];_0x16324b[_0xb53c('0x16e')]=moment()[_0xb53c('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x335b4e=_0x16324b[_0xb53c('0x71')]===_0xb53c('0x8b')?this['campaigns'][_0x16324b[_0xb53c('0xab')]]:this[_0xb53c('0x1c')][_0x16324b[_0xb53c('0x16f')]()];if(!this[_0xb53c('0xcf')](_0x3a39ff[_0xb53c('0x170')])){this[_0xb53c('0xaa')](_0x335b4e);return this[_0xb53c('0x171')](_0x16324b,_0x335b4e,_0x3a39ff)[_0xb53c('0xb0')](function(_0x3eef27){})[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x172')));}else{this[_0xb53c('0xdd')][_0x3a39ff[_0xb53c('0xd7')]]=_0x16324b;}}};Dialer['prototype'][_0xb53c('0x173')]=function(_0x2706ad,_0x4731c5,_0x4be9e9){var _0x1db454=new History(_0x4731c5);if(_0x1db454[_0xb53c('0x174')]+_0x1db454['countcongestionretry']+_0x1db454['countnoanswerretry']>=_0x4be9e9[_0xb53c('0x175')]-0x1){return!![];}switch(_0x2706ad){case 0x3:if(_0x1db454[_0xb53c('0x176')]>=_0x4be9e9[_0xb53c('0x177')]-0x1){return!![];}else{this[_0xb53c('0xb9')]({'active':![],'countnoanswerretry':_0x1db454[_0xb53c('0x176')]+=0x1,'scheduledat':moment()[_0xb53c('0x178')](_0x4be9e9[_0xb53c('0x179')],_0xb53c('0x17a'))[_0xb53c('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1db454[_0xb53c('0xc9')],'ListId':_0x1db454[_0xb53c('0xca')],'VoiceQueueId':_0x1db454[_0xb53c('0x10e')]||undefined,'CampaignId':_0x1db454[_0xb53c('0xcc')]||undefined})[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x17b')));}break;case 0x5:if(_0x1db454['countbusyretry']>=_0x4be9e9[_0xb53c('0x17c')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x1db454[_0xb53c('0x174')]+=0x1,'scheduledat':moment()['add'](_0x4be9e9[_0xb53c('0x17d')],_0xb53c('0x17a'))[_0xb53c('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1db454[_0xb53c('0xc9')],'ListId':_0x1db454[_0xb53c('0xca')],'VoiceQueueId':_0x1db454[_0xb53c('0x10e')]||undefined,'CampaignId':_0x1db454[_0xb53c('0xcc')]||undefined})[_0xb53c('0xb1')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x1db454[_0xb53c('0x17e')]>=_0x4be9e9['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xb53c('0xb9')]({'active':![],'countcongestionretry':_0x1db454[_0xb53c('0x17e')]+=0x1,'scheduledat':moment()['add'](_0x4be9e9[_0xb53c('0x17f')],_0xb53c('0x17a'))[_0xb53c('0x6f')](_0xb53c('0xf5')),'ContactId':_0x1db454[_0xb53c('0xc9')],'ListId':_0x1db454[_0xb53c('0xca')],'VoiceQueueId':_0x1db454['VoiceQueueId']||undefined,'CampaignId':_0x1db454['CampaignId']||undefined})[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x180')));}break;default:return!![];}};Dialer[_0xb53c('0x19')][_0xb53c('0x171')]=function(_0x243b5c,_0x345a02,_0x5f0c73){var _0x3f8ce2=this;var _0x5f4263=new History(_0x243b5c);return new BPromise(function(_0x4aca83,_0x3468a4){if(_[_0xb53c('0x38')](_0x345a02)&&_0xb53c('0x145')!==typeof _0x345a02){return _0x3468a4(msgResponse(_0xb53c('0x181'),'Failure',_0xb53c('0x182')));}if(_[_0xb53c('0x38')](_0x5f0c73)&&_0xb53c('0x145')!==typeof _0x5f0c73){return _0x3468a4(msgResponse(_0xb53c('0x181'),_0xb53c('0x11f'),_0xb53c('0x183')));}switch(_0x5f0c73[_0xb53c('0x184')]){case'0':_0x345a02[_0xb53c('0x5c')]+=0x1;_0x5f4263[_0xb53c('0xa0')]=0x0;_0x5f4263[_0xb53c('0xa1')]=_0xb53c('0x185');_0x3f8ce2['createHistory'](_0x5f4263)[_0xb53c('0xb1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3f8ce2['checkRetriveMax'](0x0,_0x243b5c,_0x345a02)){if(_0x5f4263[_0xb53c('0x174')]+_0x5f4263[_0xb53c('0x17e')]+_0x5f4263[_0xb53c('0x176')]>=_0x345a02[_0xb53c('0x175')]){_0x3f8ce2[_0xb53c('0x186')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x187'));}else{_0x3f8ce2[_0xb53c('0x188')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x187'));}}break;case'3':_0x345a02[_0xb53c('0x5b')]+=0x1;_0x5f4263[_0xb53c('0xa0')]=0x3;_0x5f4263[_0xb53c('0xa1')]=_0xb53c('0x189');_0x5f4263['countnoanswerretry']+=0x1;_0x5f4263[_0xb53c('0x18a')]+=0x1;_0x3f8ce2[_0xb53c('0xc2')](_0x5f4263)[_0xb53c('0xb1')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3f8ce2[_0xb53c('0x173')](0x3,_0x243b5c,_0x345a02)){if(_0x5f4263[_0xb53c('0x176')]>=_0x345a02['dialNoAnswerMaxRetry']){_0x3f8ce2[_0xb53c('0x188')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x18b'));}else{_0x3f8ce2[_0xb53c('0x186')](_0x5f4263,_0x4aca83,_0x3468a4,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x345a02[_0xb53c('0x58')]+=0x1;_0x5f4263['state']=0x5;_0x5f4263['statedesc']=_0xb53c('0x18c');_0x5f4263[_0xb53c('0x174')]+=0x1;_0x5f4263['countglobal']+=0x1;_0x3f8ce2['createHistory'](_0x5f4263)[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x18d')));if(_0x3f8ce2[_0xb53c('0x173')](0x5,_0x243b5c,_0x345a02)){if(_0x5f4263[_0xb53c('0x174')]>=_0x345a02[_0xb53c('0x17c')]){_0x3f8ce2['createStateFinal'](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x18e'));}else{_0x3f8ce2[_0xb53c('0x186')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x18e'));}}break;case'8':_0x345a02['outboundCongestionCallsDay']+=0x1;_0x5f4263[_0xb53c('0xa0')]=0x8;_0x5f4263[_0xb53c('0xa1')]=_0xb53c('0x18f');_0x5f4263['countcongestionretry']+=0x1;_0x5f4263[_0xb53c('0x18a')]+=0x1;_0x3f8ce2[_0xb53c('0xc2')](_0x5f4263)['catch'](loggerCatch(_0xb53c('0x190')));if(_0x3f8ce2[_0xb53c('0x173')](0x8,_0x243b5c,_0x345a02)){if(_0x5f4263[_0xb53c('0x17e')]>=_0x345a02[_0xb53c('0x191')]){_0x3f8ce2[_0xb53c('0x188')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x192'));}else{_0x3f8ce2[_0xb53c('0x186')](_0x5f4263,_0x4aca83,_0x3468a4,_0xb53c('0x192'));}}break;default:_0x345a02[_0xb53c('0x5f')]+=0x1;_0x5f4263[_0xb53c('0xa0')]=0xc;_0x5f4263[_0xb53c('0xa1')]=_0x5f0c73['reason'];_0x3f8ce2['createHistory'](_0x5f4263)['catch'](loggerCatch(_0xb53c('0x193')));if(_0x3f8ce2['checkRetriveMax'](_0x5f0c73[_0xb53c('0x184')],_0x243b5c,_0x345a02)){if(_0x5f4263[_0xb53c('0x174')]+_0x5f4263[_0xb53c('0x17e')]+_0x5f4263[_0xb53c('0x176')]>=_0x345a02['dialGlobalMaxRetry']){_0x3f8ce2[_0xb53c('0x186')](_0x5f4263,_0x4aca83,_0x3468a4,_0x5f0c73[_0xb53c('0x184')]);}else{_0x3f8ce2[_0xb53c('0x188')](_0x5f4263,_0x4aca83,_0x3468a4,_0x5f0c73[_0xb53c('0x184')]);}}}});};Dialer[_0xb53c('0x19')]['stateGlobal']=function(_0x25c054,_0x38b179,_0x602a44,_0x1a2db7){var _0x3dc67f=new Final(_0x25c054);_0x3dc67f[_0xb53c('0xa0')]=0xf;_0x3dc67f[_0xb53c('0xa1')]=_0xb53c('0x194');this[_0xb53c('0x188')](_0x3dc67f,_0x38b179,_0x602a44,_0x1a2db7);};Dialer['prototype'][_0xb53c('0x188')]=function(_0x572966,_0x4cc7d0,_0x59ffca,_0x4cd031){this[_0xb53c('0xd6')](_0x572966)[_0xb53c('0xb0')](function(_0x46b7eb){return _0x4cc7d0(msgResponse(_0xb53c('0x181'),_0xb53c('0xd0'),_0x4cd031));})[_0xb53c('0xb1')](function(_0x5f1274){return _0x59ffca(msgResponse(_0xb53c('0x195'),_0xb53c('0x11f'),_0xb53c('0x196')));});};Dialer['prototype'][_0xb53c('0x136')]=function(_0x164cef){var _0x300487=this;var _0x2e07c9=_0x164cef[_0xb53c('0x197')]/0x64;var _0x2572d1=_0x164cef[_0xb53c('0xfb')]/(_0x164cef[_0xb53c('0xfb')]+_0x164cef[_0xb53c('0x57')]);var _0x3fe615=Math['round'](_0x164cef[_0xb53c('0x198')]*(_0x164cef[_0xb53c('0x199')]/0x64));var _0x21aed1=Math[_0xb53c('0x19a')](_0x164cef[_0xb53c('0x198')]*(_0x164cef[_0xb53c('0x19b')]/0x64));var _0x393603=_0x164cef['available']+_0x164cef[_0xb53c('0x4c')];var _0x52dc9a=Math[_0xb53c('0x19c')](_0x164cef[_0xb53c('0x81')]*_0x164cef[_0xb53c('0x69')]*_0x164cef[_0xb53c('0x66')]*_0x164cef[_0xb53c('0x19d')]);if(_['isUndefined'](_0x164cef[_0xb53c('0x6b')])){if(!_[_0xb53c('0x38')](_0x164cef[_0xb53c('0x24')])){_0x164cef[_0xb53c('0x24')]=undefined;loggerPredictive[_0xb53c('0x8f')](_0xb53c('0x19e'),_0xb53c('0x19f'));}if(!_[_0xb53c('0x38')](_0x164cef['handlePredictive'])){loggerPredictive[_0xb53c('0x8f')](_0xb53c('0x19e'),_0xb53c('0x1a0'));clearInterval(_0x164cef['handlePredictive']);_0x164cef[_0xb53c('0x88')]=undefined;}_0x164cef['startProgressive']=moment()['format'](_0xb53c('0xf5'));loggerPredictive['info'](_0x164cef[_0xb53c('0x3b')],_0xb53c('0x1a1'),_0x164cef[_0xb53c('0x6b')]);this['handlePower'](_0x164cef,0x1);}else if(ifInterval(_0x164cef[_0xb53c('0x1a2')],_0x164cef[_0xb53c('0x6b')])){this[_0xb53c('0x133')](_0x164cef,0x1);loggerPredictiveCalls['info'](_0xb53c('0x1a3'),_0x164cef[_0xb53c('0x6b')],_0x164cef[_0xb53c('0x3b')]);_0x164cef[_0xb53c('0x81')]=0x0;_0x164cef[_0xb53c('0x65')]=0x0;}else if(_0x2e07c9<_0x2572d1&&_0x164cef[_0xb53c('0x1a4')]===_0xb53c('0x1a5')){freeVariablesPredictive(_0x164cef);loggerPredictive[_0xb53c('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xb53c('0x1a6'),_0x2572d1,_0xb53c('0x6b'),_0x164cef['name']);}else if(_0x52dc9a<_0x164cef['predictiveIntervalErlangCallsDroppedCalls']&&_0x164cef['dialPredictiveOptimization']===_0xb53c('0x1a5')){freeVariablesPredictive(_0x164cef);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1a7'),_0xb53c('0x1a8'),_0x52dc9a,'Drop\x20in\x20this\x20interval',_0x164cef[_0xb53c('0x65')],_0xb53c('0x6b'),_0x164cef[_0xb53c('0x3b')]);}else if(!ifInterval(_0x164cef[_0xb53c('0x1a2')],_0x164cef[_0xb53c('0x6b')])&&_['isUndefined'](_0x164cef[_0xb53c('0x24')])&&!_[_0xb53c('0x38')](_0x164cef[_0xb53c('0x6b')])){_0x164cef[_0xb53c('0x24')]=moment()['format'](_0xb53c('0xf5'));loggerPredictive[_0xb53c('0x75')](_0x164cef[_0xb53c('0x3b')],'started\x20in\x20predictive\x20at',_0x164cef[_0xb53c('0x24')]);this[_0xb53c('0xb6')](_0x164cef['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x164cef))[_0xb53c('0xb0')](mergeDataErlangB(_0x164cef))[_0xb53c('0xb0')](this['startMethodPredictive'](_0x164cef))[_0xb53c('0xb1')](loggerCatchPredictive(_0xb53c('0x1a9'),_0x164cef));}else if(!ifInterval(_0x164cef[_0xb53c('0x1a2')],_0x164cef[_0xb53c('0x24')])){_0x164cef[_0xb53c('0x65')]=0x0;_0x164cef[_0xb53c('0x24')]=moment()[_0xb53c('0x6f')](_0xb53c('0xf5'));loggerPredictive[_0xb53c('0x75')](_0x164cef['name'],_0xb53c('0x1aa'),_0x164cef[_0xb53c('0x24')]);clearInterval(_0x164cef[_0xb53c('0x88')]);_0x164cef[_0xb53c('0x88')]=undefined;this['averageHandleTime'](_0x164cef[_0xb53c('0x1a2')])[_0xb53c('0xb0')](this[_0xb53c('0x1ab')](_0x164cef))[_0xb53c('0xb0')](mergeDataErlangB(_0x164cef))[_0xb53c('0xb0')](this[_0xb53c('0x1ac')](_0x164cef))['catch'](loggerCatchPredictive(_0xb53c('0x1ad'),_0x164cef));}else if(_0x164cef[_0xb53c('0x198')]&&_0x393603<_0x164cef[_0xb53c('0x198')]-_0x21aed1){freeVariablesPredictive(_0x164cef);loggerPredictive[_0xb53c('0x75')](_0x164cef[_0xb53c('0x3b')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x393603,_0xb53c('0x1ae'),_0x164cef[_0xb53c('0x198')],'-',_0x21aed1,'=',_0x164cef[_0xb53c('0x198')]-_0x21aed1,')');}else if(_0x164cef['predictiveIntervalAvailable']&&_0x393603>_0x164cef[_0xb53c('0x198')]+_0x3fe615){freeVariablesPredictive(_0x164cef);loggerPredictive['info'](_0x164cef['name'],_0xb53c('0x1af'),_0x393603,_0xb53c('0x1b0'),_0x164cef[_0xb53c('0x198')],'+',_0x3fe615,'=',_0x164cef[_0xb53c('0x198')]+_0x3fe615,')');}};Dialer['prototype'][_0xb53c('0x1ab')]=function(_0x3bb236){var _0x5dac76=this;return function(_0x492290){return new BPromise(function(_0xec50d2,_0x414fb0){_[_0xb53c('0x85')](_0x3bb236,_0x492290[0x0]);if(checkGetDataPredictive(_0x492290[0x0])){var _0x30cfc1=_0x3bb236[_0xb53c('0x198')]=_0x3bb236[_0xb53c('0x4c')]+_0x3bb236[_0xb53c('0x49')];var _0x3d76b1=_0x3bb236[_0xb53c('0x1a2')]*0x3c;var _0x108b34=_0x492290[0x0][_0xb53c('0x61')]+_0x492290[0x0][_0xb53c('0x60')];var _0x1956f1=(_0x492290[0x0][_0xb53c('0x77')]+_0x492290[0x0][_0xb53c('0x63')]+_0x492290[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x492290[0x0][_0xb53c('0x68')];_0x3bb236[_0xb53c('0x66')]=_0x1956f1>0x0?_0x1956f1:0x1;switch(_0x3bb236[_0xb53c('0x1a4')]){case _0xb53c('0x1a5'):var _0x2d3cd3=_0x3bb236[_0xb53c('0x197')]/0x64;return _0x5dac76[_0xb53c('0x1b1')](_0x30cfc1,_0x3d76b1,_0x108b34,_0x1956f1,_0x2d3cd3)[_0xb53c('0xb0')](function(_0x37d4f2){return _0xec50d2(_0x37d4f2);});case'agentBusyFactor':var _0x12b06b=_0x3bb236['dialPredictiveOptimizationPercentage']/0x64;return _0x5dac76['busyFactor'](_0x30cfc1,_0x3d76b1,_0x108b34,_0x1956f1,_0x12b06b)[_0xb53c('0xb0')](function(_0xc70654){return _0xec50d2(_0xc70654);});default:return _0x414fb0(msgResponse('[getDataPredictive]',_0xb53c('0x11f'),'Unknown\x20Predictive'));}}else{return _0x414fb0(msgResponse(_0xb53c('0x1b2'),_0xb53c('0x11f'),_0xb53c('0x1b3')));}});};};Dialer[_0xb53c('0x19')][_0xb53c('0x1b4')]=function(_0x219846){var _0x47cf99=this;return function(_0x115e2e){return new BPromise(function(_0x31f89b,_0xcb5d8f){_['merge'](_0x219846,_0x115e2e[0x0]);if(checkGetDataPredictive(_0x115e2e[0x0])){loggerPredictive[_0xb53c('0x75')](JSON[_0xb53c('0x44')](_0x115e2e[0x0]));if(_0x219846[_0xb53c('0x1a4')]===_0xb53c('0x1a5')){return _0x47cf99[_0xb53c('0xbf')](_0x219846['id'])[_0xb53c('0xb0')](function(_0x44721a){var _0x2c7dfa=_0x219846['loggedIn']-_0x44721a[0x0][_0xb53c('0x1b5')];var _0x26cfb1=_0x219846[_0xb53c('0x1a2')]*0x3c;var _0xa7bf64=_0x115e2e[0x0]['predictiveIntervalAvgTalktime']+_0x115e2e[0x0][_0xb53c('0x60')];var _0x27215d=(_0x115e2e[0x0]['predictiveIntervalAnsweredCalls']+_0x115e2e[0x0][_0xb53c('0x63')]+_0x115e2e[0x0][_0xb53c('0x62')])/_0x115e2e[0x0]['predictiveIntervalTotalCalls'];var _0x211758=_0x219846[_0xb53c('0x197')]/0x64;_0x219846[_0xb53c('0x67')]=_0x44721a[0x0]['outboundQueuePauses']||0x0;_0x219846['predictiveIntervalHitRate']=_0x27215d>0x0?_0x27215d:0x1;return _0x47cf99[_0xb53c('0x1b1')](_0x2c7dfa,_0x26cfb1,_0xa7bf64,_0x27215d,_0x211758);})[_0xb53c('0xb0')](function(_0x58057e){return _0x31f89b(_0x58057e);})[_0xb53c('0xb1')](function(_0x5898d8){return _0xcb5d8f(msgResponse(_0xb53c('0x1b6'),_0xb53c('0x11f'),JSON[_0xb53c('0x44')](_0x5898d8)));});}if(_0x219846['dialPredictiveOptimization']==='agentBusyFactor'){return _0x47cf99[_0xb53c('0xbf')](_0x219846['id'])['then'](function(_0xb9b6bf){var _0x1396f9=_0x219846['loggedIn']-_0xb9b6bf[0x0][_0xb53c('0x1b5')];var _0x3b1f17=_0x219846[_0xb53c('0x1a2')]*0x3c;var _0x260078=_0x115e2e[0x0][_0xb53c('0x61')]+_0x115e2e[0x0][_0xb53c('0x60')];var _0x4a8808=(_0x115e2e[0x0]['predictiveIntervalAnsweredCalls']+_0x115e2e[0x0][_0xb53c('0x63')]+_0x115e2e[0x0][_0xb53c('0x62')])/_0x115e2e[0x0][_0xb53c('0x68')];var _0x237ba8=_0x219846[_0xb53c('0x197')]/0x64;_0x219846[_0xb53c('0x67')]=_0xb9b6bf[0x0][_0xb53c('0x1b5')]||0x0;_0x219846['predictiveIntervalHitRate']=_0x4a8808>0x0?_0x4a8808:0x1;return _0x47cf99[_0xb53c('0x1b7')](_0x1396f9,_0x3b1f17,_0x260078,_0x4a8808,_0x237ba8);})[_0xb53c('0xb0')](function(_0x181c36){return _0x31f89b(_0x181c36);})[_0xb53c('0xb1')](function(_0x4a2224){return _0xcb5d8f(msgResponse(_0xb53c('0x1b6'),_0xb53c('0x11f'),JSON['stringify'](_0x4a2224)));});}}else{return _0xcb5d8f(msgResponse('[getDataPredictive]',_0xb53c('0x11f'),'check\x20failure'));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x257847){var _0x5965f2=this;return function(){var _0x58c1f8=0x0;var _0x2b9839=Math[_0xb53c('0x19c')](_0x257847[_0xb53c('0x82')]*0x3e8);if(_0x2b9839>0x0){_0x2b9839=_0x2b9839<0x64?0x64:_0x2b9839;loggerPredictive[_0xb53c('0x75')](_0x257847[_0xb53c('0x3b')],_0xb53c('0x1b8'),_0x2b9839,_0xb53c('0x45'));_0x257847[_0xb53c('0x88')]=setInterval(function(){_0x5965f2[_0xb53c('0x88')](_0x257847);loggerPredictiveCalls[_0xb53c('0x75')](_0xb53c('0x1b9'),_0x58c1f8+=0x1);},_0x2b9839);}else{loggerPredictive[_0xb53c('0x75')](_0x257847[_0xb53c('0x3b')],_0xb53c('0x1ba'));}};};Dialer[_0xb53c('0x19')][_0xb53c('0x1bb')]=function(_0x29e7f0,_0x3300b4){var _0x4f5ad3=this;return function(_0x5779da){if(_[_0xb53c('0x73')](_0x5779da)){if(_[_0xb53c('0xa8')](_0x3300b4[_0xb53c('0xcb')])||!_0x3300b4[_0xb53c('0x1bc')]){if(_0x29e7f0[_0xb53c('0x52')]===_0xb53c('0x6')){_0x29e7f0[_0xb53c('0x108')]=_[_0xb53c('0x38')](_0x29e7f0[_0xb53c('0x108')])?!![]:_0x29e7f0['queueStatusComplete'];var _0x340c09=uuid['v4']();_0x4f5ad3[_0xb53c('0x21')][_0x340c09]=new Action(_0x29e7f0,_0x3300b4,_0x340c09);loggerBooked['info'](_0xb53c('0x1bd'),_0x340c09,_0xb53c('0x1be'),JSON['stringify'](_0x29e7f0[_0xb53c('0x108')]),_0xb53c('0x1bf'),_0x29e7f0[_0xb53c('0x3b')]);if(_0x29e7f0[_0xb53c('0x108')]){_0x29e7f0[_0xb53c('0x108')]=![];_0x4f5ad3[_0xb53c('0x105')][_0x4f5ad3['actions'][_0x340c09][_0xb53c('0xab')]]=[];ami['Action']({'actionid':_0x340c09,'action':_0xb53c('0x1c0'),'queue':_0x29e7f0['name']})[_0xb53c('0xb1')](function(_0xd058bd){_0x4f5ad3[_0xb53c('0xaa')](_0x29e7f0);_0x4f5ad3[_0xb53c('0xb9')]({'active':![],'ContactId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0xc9')],'ListId':_0x4f5ad3['actions'][_0x340c09][_0xb53c('0xca')],'VoiceQueueId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0x10e')]||undefined,'CampaignId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0xcc')]||undefined})[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x1c1')));delete _0x4f5ad3[_0xb53c('0x21')][_0x340c09];});}else{loggerBooked[_0xb53c('0x75')](_0xb53c('0x1c2'),JSON[_0xb53c('0x44')](_0x29e7f0['queueStatusComplete']),_0xb53c('0x1bf'),_0x29e7f0[_0xb53c('0x3b')]);_0x4f5ad3['updateOriginated'](_0x29e7f0);_0x4f5ad3[_0xb53c('0xb9')]({'active':![],'ContactId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0xc9')],'ListId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0xca')],'VoiceQueueId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0x10e')]||undefined,'CampaignId':_0x4f5ad3[_0xb53c('0x21')][_0x340c09][_0xb53c('0xcc')]||undefined})[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x1c1')));delete _0x4f5ad3['actions'][_0x340c09];}}else{return _0x4f5ad3[_0xb53c('0x144')](_0x29e7f0,_0x3300b4);}}else{if(getDiff(_0x3300b4[_0xb53c('0x1c3')])<_0x29e7f0[_0xb53c('0x1c4')]*0x3c){_0x4f5ad3['preview'][_0xb53c('0x10c')](_0x3300b4['id'])[_0xb53c('0x1b')](function(){_0x4f5ad3[_0xb53c('0xaa')](_0x29e7f0);});}else{_0x29e7f0['outboundReCallsDay']+=0x1;_0x4f5ad3[_0xb53c('0xaa')](_0x29e7f0);if(_0x29e7f0[_0xb53c('0x1c5')]){_0x4f5ad3[_0xb53c('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3300b4[_0xb53c('0xc9')],'ListId':_0x3300b4[_0xb53c('0xca')],'VoiceQueueId':_0x3300b4['VoiceQueueId']||undefined,'CampaignId':_0x3300b4['CampaignId']||undefined})['catch'](loggerCatch(_0xb53c('0x1c6')));_0x4f5ad3[_0xb53c('0xc2')](createObjHistory(_0x29e7f0,_0x3300b4,_0xb53c('0x1c7'),0x17,_0xb53c('0x1c8')))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0x1c9')));}else{_0x4f5ad3[_0xb53c('0xd5')](createObjHistory(_0x29e7f0,_0x3300b4,_0xb53c('0x1ca'),0x16,_0xb53c('0x1cb')),'[Originate][HistoryRecallClose][historyCatch]',_0xb53c('0x1cc'));}}}}else{_0x29e7f0['outboundBlacklistCallsDay']+=0x1;_0x4f5ad3[_0xb53c('0xd5')](createObjHistory(_0x29e7f0,_0x3300b4,_0xb53c('0x1cd'),0xd,'Blacklist'),_0xb53c('0x1ce'),_0xb53c('0x1cf'));throw _0xb53c('0x1d0');}};};Dialer['prototype'][_0xb53c('0x138')]=function(_0x50f5b4){var _0x16d064=this;var _0x424811=[];var _0x959679=_0x50f5b4[_0xb53c('0x1d1')]-_0x50f5b4[_0xb53c('0x93')]-_0x50f5b4['temp'];emitCampaignSummary(_0x50f5b4);if(_0x959679>0x0){if(_0x959679>this[_0xb53c('0x1f')]){_0x959679=this[_0xb53c('0x1f')];}_0x50f5b4['temp']+=_0x959679;this['getContactDialerIvr'](_0x50f5b4['id'],_0x959679,_0x50f5b4[_0xb53c('0x1d2')])[_0xb53c('0xb0')](function(_0x596a29){_0x50f5b4[_0xb53c('0x1d3')]-=_0x959679;_0x50f5b4[_0xb53c('0x1d3')]=_0x50f5b4[_0xb53c('0x1d3')]>0x0?_0x50f5b4[_0xb53c('0x1d3')]:0x0;if(!checkContactEmpty(_0x596a29)){_0x50f5b4['message']=_0xb53c('0x1d4');logger['info'](_0xb53c('0x1d5')+_0x50f5b4['name']);}else{_0x50f5b4[_0xb53c('0x93')]+=_0x596a29[_0xb53c('0x92')];_0x50f5b4[_0xb53c('0x39')]=_0xb53c('0x1d6');for(var _0x38630a=0x0;_0x38630a<_0x596a29[_0xb53c('0x92')];_0x38630a+=0x1){_0x50f5b4['ivrTotalCallsDays']+=0x1;if(_[_0xb53c('0xa8')](_0x596a29[_0x38630a])||_[_0xb53c('0xa8')](_0x596a29[_0x38630a]['Contact'])||_[_0xb53c('0xa8')](_0x596a29[_0x38630a][_0xb53c('0x148')]['phone'])){_0x16d064[_0xb53c('0xc6')](_0xb53c('0x1d7'),_0x50f5b4,_0x596a29[_0x38630a]);}else{_0x16d064[_0xb53c('0xb5')](_['pick'](_0x596a29[_0x38630a],[_0xb53c('0xcc'),_0xb53c('0x1d8')]))[_0xb53c('0xb0')](_0x16d064[_0xb53c('0x1bb')](_0x50f5b4,_0x596a29[_0x38630a]))[_0xb53c('0xb1')](_0x16d064[_0xb53c('0xc5')](_0xb53c('0x1d9'),_0x50f5b4));}}}})[_0xb53c('0xb1')](loggerGetContactDialer(_0xb53c('0x1da'),_0x50f5b4,_0x959679));}};Dialer['prototype']['handlePower']=function(_0x37c6d4,_0x49ecb5){var _0x49b55e=this;var _0x19f8d1=[];var _0x15038f=_0x49ecb5>=0x1?_0x49ecb5:0x1;var _0x46323c=[];if(_0x37c6d4['dialMethod']===_0xb53c('0x6')){_0x15038f=0x1;}var _0x2247af=Math[_0xb53c('0x19c')](_0x37c6d4['available']*_0x15038f)-_0x37c6d4[_0xb53c('0x93')]-_0x37c6d4[_0xb53c('0x1d3')];emitVoiceQueueSummary(_0x37c6d4);if(_0x37c6d4['dialLimitQueue']>0x0){var _0x3480e9=_0x37c6d4[_0xb53c('0x1db')]-_0x37c6d4[_0xb53c('0x93')]-_0x37c6d4[_0xb53c('0x4c')]-_0x37c6d4[_0xb53c('0x1d3')]-_0x37c6d4[_0xb53c('0x9b')];if(_0x2247af>_0x3480e9){_0x2247af=_0x3480e9;}}if(_0x2247af>0x0){if(_0x37c6d4[_0xb53c('0x52')]===_0xb53c('0x6')){_0x2247af=0x1;}if(_0x2247af>this[_0xb53c('0x1f')]){_0x2247af=this[_0xb53c('0x1f')];}_0x37c6d4['temp']+=_0x2247af;for(var _0x2b1778 in this['agents']){if(this[_0xb53c('0x1d')][_0xb53c('0x13f')](_0x2b1778)){if(this['agents'][_0x2b1778][_0xb53c('0xa0')]==='not_inuse'&&this[_0xb53c('0x1d')][_0x2b1778][_0xb53c('0xd3')]==='reachable'){_0x19f8d1['push'](this[_0xb53c('0x1d')][_0x2b1778]['id']);}}}this[_0xb53c('0xbc')](_0x37c6d4['id'],_0x19f8d1,_0x2247af,_0x37c6d4[_0xb53c('0x1d2')])['then'](function(_0x3d9077){_0x37c6d4[_0xb53c('0x1d3')]-=_0x2247af;_0x37c6d4['temp']=_0x37c6d4['temp']>0x0?_0x37c6d4[_0xb53c('0x1d3')]:0x0;if(!checkContactEmpty(_0x3d9077)){_0x49b55e['countReScheduled'](_0x37c6d4)[_0xb53c('0xb0')](sendMessageReschedule(_0x37c6d4))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xb2')));}else{_0x37c6d4[_0xb53c('0x93')]+=_0x3d9077['length'];_0x37c6d4[_0xb53c('0x39')]=_0x37c6d4[_0xb53c('0x52')]===_0xb53c('0x6')?'ACTIVE':_0xb53c('0x1d6');for(var _0x1fc3ed=0x0;_0x1fc3ed<_0x3d9077[_0xb53c('0x92')];_0x1fc3ed+=0x1){if(_[_0xb53c('0xa8')](_0x3d9077[_0x1fc3ed])||_['isNil'](_0x3d9077[_0x1fc3ed]['Contact'])||_['isNil'](_0x3d9077[_0x1fc3ed][_0xb53c('0x148')][_0xb53c('0x149')])){_0x49b55e[_0xb53c('0xc6')]('[actionOriginate]\x20',_0x37c6d4,_0x3d9077[_0x1fc3ed]);}else{_0x49b55e[_0xb53c('0xb3')](_['pick'](_0x3d9077[_0x1fc3ed],['VoiceQueueId','Contact.phone']))[_0xb53c('0xb0')](_0x49b55e['checkContactBlack'](_0x37c6d4,_0x3d9077[_0x1fc3ed]))[_0xb53c('0xb1')](_0x49b55e['loggerHandler'](_0xb53c('0x1d7'),_0x37c6d4));}}}})['catch'](loggerGetContactDialer(_0xb53c('0x1dc'),_0x37c6d4,_0x2247af));}};Dialer[_0xb53c('0x19')][_0xb53c('0x88')]=function(_0x5968b9){var _0x111b0a=this;if(_0x5968b9[_0xb53c('0x1db')]>0x0){var _0x2a38af=_0x5968b9[_0xb53c('0x1db')]-_0x5968b9[_0xb53c('0x93')]-_0x5968b9[_0xb53c('0x4c')];if(_0x2a38af>0x0){this['tryOriginatePredictive'](_0x5968b9);}else{loggerPredictiveCalls[_0xb53c('0x75')](_0xb53c('0x1dd'));}}else{this['tryOriginatePredictive'](_0x5968b9);}};Dialer[_0xb53c('0x19')][_0xb53c('0x1de')]=function(_0xf4691){var _0x334790=this;var _0x186e78=[];_0xf4691['originated']+=0x1;for(var _0x987502 in this['agents']){if(this[_0xb53c('0x1d')][_0xb53c('0x13f')](_0x987502)){if(this['agents'][_0x987502]['state']==='not_inuse'&&this[_0xb53c('0x1d')][_0x987502][_0xb53c('0xd3')]===_0xb53c('0x1df')){_0x186e78[_0xb53c('0x106')](this[_0xb53c('0x1d')][_0x987502]['id']);}}}this['getContactDialer'](_0xf4691['id'],_0x186e78,0x1,_0xf4691[_0xb53c('0x1d2')])['then'](function(_0x213080){if(!checkContactEmpty(_0x213080)){checkContactLowerLimitOriginate(_0xf4691,0x1,0x0);_0x334790[_0xb53c('0xaf')](_0xf4691)[_0xb53c('0xb0')](sendMessageReschedule(_0xf4691))[_0xb53c('0xb1')](loggerCatch(_0xb53c('0xb2')));}else{_0xf4691['message']=_0xb53c('0x1d6');if(_[_0xb53c('0xa8')](_0x213080[0x0])||_[_0xb53c('0xa8')](_0x213080[0x0][_0xb53c('0x148')])||_[_0xb53c('0xa8')](_0x213080[0x0][_0xb53c('0x148')][_0xb53c('0x149')])){_0x334790[_0xb53c('0xc6')](_0xb53c('0x1d7'),_0xf4691,_0x213080[0x0]);}else{_0x334790[_0xb53c('0xb3')](_[_0xb53c('0xc8')](_0x213080[0x0],[_0xb53c('0x10e'),_0xb53c('0x1d8')]))[_0xb53c('0xb0')](_0x334790[_0xb53c('0x1bb')](_0xf4691,_0x213080[0x0]))[_0xb53c('0xb1')](_0x334790['loggerHandler'](_0xb53c('0x1e0'),_0xf4691));}}})[_0xb53c('0xb1')](loggerGetContactDialer('[getContactDialerPredictive]',_0xf4691,0x1));emitVoiceQueueSummary(_0xf4691);};Dialer[_0xb53c('0x19')]['abandonmentRate']=function(_0x89170,_0x1a451c,_0x4dee10,_0xa7ad99,_0xbc7864,_0x448e6e){loggerPredictive['info'](_0xb53c('0x1e1'));loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1e2'),_0x89170);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1e3'),_0x1a451c);loggerPredictive[_0xb53c('0x75')]('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',_0x4dee10);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1e4'),_0xa7ad99);loggerPredictive['info'](_0xb53c('0x1e5'),_0xbc7864);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7a'));return new BPromise(function(_0xa85fd8,_0x2bf090){if(_0x89170<=0x0||isNaN(_0x89170)){return _0x2bf090(msgResponse(_0xb53c('0x1e6'),_0xb53c('0x43'),_0xb53c('0x1e7')+_0x89170));}if(_0x4dee10<=0x0||isNaN(_0x4dee10)){return _0x2bf090(msgResponse('[abandonmentRate]',_0xb53c('0x43'),_0xb53c('0x1e8')+_0x4dee10));}if(_0xa7ad99<=0x0||isNaN(_0xa7ad99)){return _0x2bf090(msgResponse(_0xb53c('0x1e6'),_0xb53c('0x43'),_0xb53c('0x1e9')+_0xa7ad99));}if(_0x1a451c<=0x0||isNaN(_0x1a451c)){return _0x2bf090(msgResponse(_0xb53c('0x1e6'),'Error','interval\x20=\x20'+_0x1a451c));}if(_0xbc7864<=0x0||isNaN(_0xbc7864)){return _0x2bf090(msgResponse(_0xb53c('0x1e6'),'Error',_0xb53c('0x1ea')+_0xbc7864));}_0x448e6e=_0x448e6e||0x0;var _0x1b7d0c=0x1/_0x4dee10;var _0x2935fb=0x0;var _0x764c95=0x0;var _0x58a7da=0x0;var _0x295594=0x0;for(var _0x3685dd=0x0;_0x58a7da<_0xbc7864;_0x3685dd+=0x1){_0x764c95=_0x3685dd/_0x1a451c;_0x2935fb=(_0xa7ad99*_0x764c95+_0x448e6e)/_0x1b7d0c;_0x58a7da=erlangb(_0x2935fb,_0x89170);_0x295594=_0x2935fb/_0x89170*(0x1-erlangb(_0x2935fb,_0x89170));}return _0xa85fd8({'erlangCalls':_0x3685dd,'erlangCallToSecond':_0x1a451c/_0x3685dd,'erlangAbandonmentRate':_0x58a7da,'erlangBusyFactor':_0x295594});});};Dialer[_0xb53c('0x19')][_0xb53c('0x1b7')]=function(_0x34b4b4,_0x3b818d,_0x653202,_0x523b0e,_0x247563,_0x1e5aa0){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');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',_0x34b4b4);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1e3'),_0x3b818d);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1eb'),_0x653202);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x1e4'),_0x523b0e);loggerPredictive[_0xb53c('0x75')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x247563);loggerPredictive[_0xb53c('0x75')](_0xb53c('0x7a'));return new BPromise(function(_0x2b58b6,_0x52e5cc){if(_0x34b4b4<=0x0||isNaN(_0x34b4b4)){return _0x52e5cc(msgResponse(_0xb53c('0x1ec'),_0xb53c('0x43'),_0xb53c('0x1e7')+_0x34b4b4));}if(_0x653202<=0x0||isNaN(_0x653202)){return _0x52e5cc(msgResponse(_0xb53c('0x1ec'),_0xb53c('0x43'),'Ts\x20=\x20'+_0x653202));}if(_0x523b0e<=0x0||isNaN(_0x523b0e)){return _0x52e5cc(msgResponse(_0xb53c('0x1ec'),_0xb53c('0x43'),_0xb53c('0x1e9')+_0x523b0e));}if(_0x3b818d<=0x0||isNaN(_0x3b818d)){return _0x52e5cc(msgResponse(_0xb53c('0x1ec'),_0xb53c('0x43'),_0xb53c('0x1ed')+_0x3b818d));}if(_0x247563<=0x0||isNaN(_0x247563)){return _0x52e5cc(msgResponse(_0xb53c('0x1ec'),_0xb53c('0x43'),_0xb53c('0x1ee')+_0x247563));}_0x1e5aa0=_0x1e5aa0||0x0;var _0x37679a=0x1/_0x653202;var _0x2eb341=0x0;var _0x1925b5=0x0;var _0x4be81f=0x0;var _0x5a5ea1=0x0;for(var _0x593617=0x0;_0x5a5ea1<_0x247563;_0x593617+=0x1){_0x1925b5=_0x593617/_0x3b818d;_0x2eb341=(_0x523b0e*_0x1925b5+_0x1e5aa0)/_0x37679a;_0x4be81f=erlangb(_0x2eb341,_0x34b4b4);_0x5a5ea1=_0x2eb341/_0x34b4b4*(0x1-erlangb(_0x2eb341,_0x34b4b4));}return _0x2b58b6({'erlangCalls':_0x593617,'erlangCallToSecond':_0x3b818d/_0x593617,'erlangAbandonmentRate':_0x4be81f,'erlangBusyFactor':_0x5a5ea1});});};module[_0xb53c('0x1ef')]=Dialer; \ No newline at end of file +var _0x7326=['actionid','strategy','paused','stateinterface','locked','queueBooked','push','pick','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','CampaignId','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Failure','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','NONE','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','[callProgressDetecting]\x20','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalHitRate','abandonmentRate','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','ACTIVE','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','util','bluebird','moment','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startProgressive','ivrOriginated','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','answered','available','loggedIn','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','md5','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','predictiveIntervalTotalCalls','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','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','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','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','[actions]','hasOwnProperty','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','saveInDb','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','Machine','[syncMachine][createHistory]','[syncMachine]','campaigns','[syncHangupInAMDIvr]','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','Abandoned','CALLEREXIT'];(function(_0xac4dd4,_0x41ac92){var _0x35b182=function(_0xa9a425){while(--_0xa9a425){_0xac4dd4['push'](_0xac4dd4['shift']());}};_0x35b182(++_0x41ac92);}(_0x7326,0xec));var _0x6732=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7326[_0x37c22c];return _0x119d79;};'use strict';var util=require(_0x6732('0x0'));var _=require('lodash');var BPromise=require(_0x6732('0x1'));var uuid=require('uuid');var moment=require(_0x6732('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x6732('0x3'));var config=require(_0x6732('0x4'));var logger=require('../../../config/logger')(_0x6732('0x5'));var loggerBooked=require(_0x6732('0x6'))(_0x6732('0x7'));var loggerPredictive=require(_0x6732('0x6'))(_0x6732('0x8'));var loggerPredictiveCalls=require(_0x6732('0x6'))(_0x6732('0x9'));var loggerSyncQueueSummary=require(_0x6732('0x6'))(_0x6732('0xa'));var ami=require(_0x6732('0xb'));config[_0x6732('0xc')]=_[_0x6732('0xd')](config[_0x6732('0xc')],{'host':_0x6732('0xe'),'port':0x18eb});var io=require(_0x6732('0xf'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x6732('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x6732('0x11'));var voiceQueueRt=require(_0x6732('0x12'));var Action=require('./action');var History=require('./history');var Final=require(_0x6732('0x13'));var AgentComplete=require(_0x6732('0x14'));var QueueCallerAbandon=require(_0x6732('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0x6732('0x16')][_0x6732('0x17')]||_0x6732('0x18');var strategy={'rrmemory':_0x6732('0x19'),'roundrobin':_0x6732('0x1a')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4e4d60){this['tail']=this['tail']?this[_0x6732('0x1b')][_0x6732('0x1c')](_0x4e4d60):_0x4e4d60();};function Dialer(_0x4388e0,_0x5f4bad){this[_0x6732('0x1d')]=new Sequence();this[_0x6732('0x1e')]=_0x5f4bad;this[_0x6732('0x1f')]=_0x4388e0[_0x6732('0x1f')];this['campaigns']=_0x4388e0['campaigns'];this[_0x6732('0x20')]=_0x4388e0[_0x6732('0x20')];this[_0x6732('0x21')]=_0x4388e0[_0x6732('0x21')];this[_0x6732('0x22')]=config[_0x6732('0x22')]||0x2;this[_0x6732('0x23')]={};this[_0x6732('0x24')]={};this['contactsId']={};this['uniqueId']={};this[_0x6732('0x25')]={};this['startPredictive']={};this[_0x6732('0x26')]={};this[_0x6732('0x27')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x6732('0x28')][_0x6732('0x29')](this));ami['on'](_0x6732('0x2a'),this[_0x6732('0x2b')]['bind'](this));ami['on']('originateresponse',this[_0x6732('0x2c')][_0x6732('0x29')](this));ami['on'](_0x6732('0x2d'),this[_0x6732('0x2e')][_0x6732('0x29')](this));ami['on'](_0x6732('0x2f'),this[_0x6732('0xa')][_0x6732('0x29')](this));ami['on']('hangup',this[_0x6732('0x30')]['bind'](this));ami['on'](_0x6732('0x31'),this[_0x6732('0x32')][_0x6732('0x29')](this));ami['on']('varset',this[_0x6732('0x33')][_0x6732('0x29')](this));ami['on']('queuemember',this[_0x6732('0x34')][_0x6732('0x29')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x6732('0x29')](this));this[_0x6732('0x35')]();this[_0x6732('0x36')]();}function isNotNull(_0x697f9c){return _0x697f9c!==null&&!_[_0x6732('0x37')](_0x697f9c);}function checkIsLoggedIn(_0x167f79,_0x1a5425){return function(){if(_0x1a5425<=0x0){_0x167f79['message']=_0x6732('0x38');throw _0x167f79[_0x6732('0x39')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x42e59b){return _0x42e59b;}function checkIsActive(_0x441426,_0x1f9852){return function(){if(!isActive(_0x1f9852)){_0x441426[_0x6732('0x3a')]=_0x6732('0x3b');throw _0x441426[_0x6732('0x39')]+_0x6732('0x3c');}};}function checkInterval(_0x225a6b){return function(){if(!isNotNull(_0x225a6b['Interval'])){_0x225a6b[_0x6732('0x3a')]=_0x6732('0x3d');throw _0x225a6b[_0x6732('0x39')]+_0x6732('0x3e');}if(!isNotNull(_0x225a6b[_0x6732('0x3f')][_0x6732('0x40')])){_0x225a6b[_0x6732('0x3a')]='INTERVAL_IS_NULL';throw _0x225a6b[_0x6732('0x39')]+_0x6732('0x3e');}if(!isNotNull(_[_0x6732('0x41')](_0x225a6b[_0x6732('0x3f')][_0x6732('0x40')]))){_0x225a6b[_0x6732('0x3a')]=_0x6732('0x3d');throw _0x225a6b[_0x6732('0x39')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x2e762f,_0x4cc6d8,_0x3889c6){return{'action':_0x2e762f,'response':_0x4cc6d8,'message':_0x3889c6,'stack':_0x3889c6};}function myreject(_0x1f2d0e){return function(_0xba5661){return _0x1f2d0e(msgResponse(_0x6732('0x42'),_0x6732('0x43'),JSON[_0x6732('0x44')](_0xba5661)));};}function getSeconds(_0x2a2b0d,_0x1b35f6){var _0x2b5dbb=moment(_0x2a2b0d)['milliseconds'](0x0);var _0x2e5f58=moment(_0x1b35f6)[_0x6732('0x45')](0x0);return _0x2b5dbb[_0x6732('0x46')](_0x2e5f58,_0x6732('0x47'));}function emit(_0x9a4e65,_0x55459e,_0x10df5a){io['to'](_0x9a4e65)[_0x6732('0x48')](_0x55459e,_0x10df5a);}function emitVoiceQueueSummary(_0x8f19b0){if(_0x8f19b0['type']===_0x6732('0x49')){var _0xef13b8={'id':_0x8f19b0['id'],'name':_0x8f19b0[_0x6732('0x39')],'strategy':_0x8f19b0['strategy'],'answered':_0x8f19b0[_0x6732('0x4a')],'available':_0x8f19b0[_0x6732('0x4b')],'loggedIn':_0x8f19b0[_0x6732('0x4c')],'pTalking':_0x8f19b0['pTalking'],'sumBillable':_0x8f19b0['sumBillable'],'sumDuration':_0x8f19b0[_0x6732('0x4d')],'sumHoldTime':_0x8f19b0[_0x6732('0x4e')]||0x0,'talking':_0x8f19b0['talking'],'total':_0x8f19b0[_0x6732('0x4f')],'type':_0x8f19b0[_0x6732('0x50')],'unmanaged':_0x8f19b0[_0x6732('0x51')],'abandoned':_0x8f19b0[_0x6732('0x52')],'waiting':_0x8f19b0['waiting'],'loggedInDb':_0x8f19b0[_0x6732('0x53')],'dialActive':_0x8f19b0['dialActive'],'dialMethod':_0x8f19b0['dialMethod'],'dialOriginateCallerIdName':_0x8f19b0[_0x6732('0x54')],'dialOriginateCallerIdNumber':_0x8f19b0[_0x6732('0x55')],'dialOriginateTimeout':_0x8f19b0[_0x6732('0x56')],'dialPrefix':_0x8f19b0[_0x6732('0x57')],'outboundAnswerAgiCallsDay':_0x8f19b0['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x8f19b0[_0x6732('0x58')],'outboundBlacklistCallsDay':_0x8f19b0[_0x6732('0x59')],'outboundBusyCallsDay':_0x8f19b0[_0x6732('0x5a')],'outboundCongestionCallsDay':_0x8f19b0[_0x6732('0x5b')],'outboundDropCallsDayACS':_0x8f19b0[_0x6732('0x5c')],'outboundDropCallsDayCallersExit':_0x8f19b0[_0x6732('0x5d')],'outboundDropCallsDayTimeout':_0x8f19b0['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x8f19b0[_0x6732('0x5e')],'outboundNoSuchCallsDay':_0x8f19b0['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x8f19b0[_0x6732('0x5f')],'outboundReCallsDay':_0x8f19b0['outboundReCallsDay'],'outboundRejectCallsDay':_0x8f19b0[_0x6732('0x60')],'outboundUnknownCallsDay':_0x8f19b0[_0x6732('0x61')],'predictiveIntervalAnsweredCalls':_0x8f19b0[_0x6732('0x62')],'predictiveIntervalAvgHoldtime':_0x8f19b0['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x8f19b0['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x8f19b0[_0x6732('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x8f19b0[_0x6732('0x64')],'predictiveIntervalErlangCalls':_0x8f19b0[_0x6732('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x8f19b0['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x8f19b0['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x8f19b0['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x8f19b0[_0x6732('0x66')],'predictiveIntervalAvailable':_0x8f19b0[_0x6732('0x67')],'predictiveIntervalTotalCalls':_0x8f19b0['predictiveIntervalTotalCalls'],'message':_0x8f19b0['message'],'originated':_0x8f19b0[_0x6732('0x68')],'erlangCalls':_0x8f19b0['erlangCalls'],'erlangCallToSecond':_0x8f19b0[_0x6732('0x69')],'erlangAbandonmentRate':_0x8f19b0[_0x6732('0x6a')],'erlangBusyFactor':_0x8f19b0[_0x6732('0x6b')],'startPredictive':_0x8f19b0[_0x6732('0x6c')],'startProgressive':_0x8f19b0[_0x6732('0x26')]};if(_0x8f19b0[_0x6732('0x6d')]){_0xef13b8[_0x6732('0x6d')]={'id':_0x8f19b0[_0x6732('0x6d')]['id'],'name':_0x8f19b0['Trunk'][_0x6732('0x39')],'active':_0x8f19b0[_0x6732('0x6d')][_0x6732('0x6e')],'callerid':_0x8f19b0[_0x6732('0x6d')][_0x6732('0x6f')]};}if(_0x8f19b0[_0x6732('0x3f')]){_0xef13b8['Interval']={'id':_0x8f19b0[_0x6732('0x3f')]['id'],'name':_0x8f19b0[_0x6732('0x3f')][_0x6732('0x39')]};}var _0x36dfc9=md5(JSON[_0x6732('0x44')](_0xef13b8));if(_0x8f19b0[_0x6732('0x70')]!==_0x36dfc9){_0x8f19b0[_0x6732('0x70')]=_0x36dfc9;emit(util[_0x6732('0x71')](_0x6732('0x72'),_0xef13b8[_0x6732('0x39')]),_0x6732('0x73'),_0xef13b8);}}}function emitCampaignSummary(_0x553ba6){if(_0x553ba6['type']==='ivr'){emit(util['format'](_0x6732('0x74'),_0x553ba6['name']),_0x6732('0x75'),_0x553ba6);}}function checkGetDataPredictive(_0x31bd32){if(isNotNull(_0x31bd32)){if(!_[_0x6732('0x41')](_0x31bd32)){loggerPredictive[_0x6732('0x76')](_0x6732('0x77'));loggerPredictive[_0x6732('0x76')](_0x6732('0x78'),_0x31bd32[_0x6732('0x79')]);loggerPredictive[_0x6732('0x76')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31bd32[_0x6732('0x62')]);loggerPredictive[_0x6732('0x76')](_0x6732('0x7a'),_0x31bd32[_0x6732('0x64')]);loggerPredictive[_0x6732('0x76')](_0x6732('0x7b'),_0x31bd32['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x6732('0x76')](_0x6732('0x7c'),_0x31bd32[_0x6732('0x7d')]);loggerPredictive[_0x6732('0x76')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31bd32['predictiveIntervalAvgTalktime']);loggerPredictive[_0x6732('0x76')]('---------------------------');if(_0x31bd32[_0x6732('0x79')]>0x0){if(!_[_0x6732('0x37')](_0x31bd32[_0x6732('0x7e')])&&_0x31bd32[_0x6732('0x7e')]>0x0){return!![];}else{loggerPredictive[_0x6732('0x76')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_['isUndefined'](_0x31bd32[_0x6732('0x7d')])&&_0x31bd32['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive['info'](_0x6732('0x7f'));}}else{loggerPredictive[_0x6732('0x76')](_0x6732('0x80'));}}else{loggerPredictive[_0x6732('0x76')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x6732('0x76')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3c813e){return function(_0x5470ea){loggerPredictive[_0x6732('0x76')](_0x6732('0x81'));loggerPredictive[_0x6732('0x76')](_0x6732('0x82'),_0x5470ea[_0x6732('0x83')]);loggerPredictive[_0x6732('0x76')](_0x6732('0x84'),_0x5470ea[_0x6732('0x69')]);loggerPredictive[_0x6732('0x76')](_0x6732('0x85'),_0x5470ea[_0x6732('0x6a')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5470ea[_0x6732('0x6b')]);loggerPredictive['info'](_0x6732('0x85'),_0x5470ea['erlangAbandonmentRate']);loggerPredictive[_0x6732('0x76')](_0x6732('0x86'));_[_0x6732('0x87')](_0x3c813e,_0x5470ea);};}function getDiff(_0x3c68c3){var _0x4541af=moment()[_0x6732('0x45')](0x0);var _0x1ef72b=moment(_0x3c68c3)['milliseconds'](0x0);return _0x4541af[_0x6732('0x46')](_0x1ef72b,_0x6732('0x47'));}function ifInterval(_0x2c151b,_0x4a16e9){if(_['isUndefined'](_0x4a16e9)){return![];}if(getDiff(_0x4a16e9)<_0x2c151b*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4d8bc1){if(isNotNull(_0x4d8bc1)){if(!_[_0x6732('0x37')](_0x4d8bc1[_0x6732('0x26')])){_0x4d8bc1['startProgressive']=undefined;loggerPredictive[_0x6732('0x76')](_0x4d8bc1[_0x6732('0x39')],_0x6732('0x88'));}if(!_[_0x6732('0x37')](_0x4d8bc1[_0x6732('0x6c')])){_0x4d8bc1[_0x6732('0x6c')]=undefined;loggerPredictive[_0x6732('0x76')](_0x4d8bc1[_0x6732('0x39')],_0x6732('0x89'));}if(!_[_0x6732('0x37')](_0x4d8bc1[_0x6732('0x8a')])){clearInterval(_0x4d8bc1[_0x6732('0x8a')]);_0x4d8bc1[_0x6732('0x8a')]=undefined;loggerPredictive[_0x6732('0x76')](_0x4d8bc1[_0x6732('0x39')],_0x6732('0x8b'));}}}function erlangb(_0x53694c,_0x4ca0f3){if(_0x4ca0f3===0x0){return 0x0;}var _0x419e2c=0x1;for(var _0x2c33ef=0x1;_0x2c33ef<=_0x4ca0f3;_0x2c33ef+=0x1){_0x419e2c=0x1+_0x419e2c*_0x2c33ef/_0x53694c;}return 0x1/_0x419e2c;}function isVoiceQueueOutbound(_0x46eb28){return _0x46eb28===_0x6732('0x49');}function isNotPreview(_0x1e2bda){return _0x1e2bda!==_0x6732('0x1e');}function isCampaignIvr(_0xc140cb){return _0xc140cb===_0x6732('0x8c');}function getCallerId(_0x5aba03,_0x56c5ca,_0x431ef4){if(!_['isUndefined'](_0x431ef4)&&_0x6732('0x8d')===typeof _0x431ef4&&!_[_0x6732('0x41')](_0x431ef4)){if(!_[_0x6732('0x37')](_0x56c5ca)&&'string'===typeof _0x56c5ca&&!_[_0x6732('0x41')](_0x56c5ca)){return util[_0x6732('0x71')]('\x22%s\x22\x20<%s>',_0x56c5ca,_0x431ef4);}return util['format'](_0x6732('0x8e'),_0x431ef4,_0x431ef4);}if(!_[_0x6732('0x37')](_0x5aba03)&&_0x6732('0x8d')===typeof _0x5aba03&&!_[_0x6732('0x41')](_0x5aba03)){return _0x5aba03;}return _0x6732('0x8f');}function loggerCatchQueueSummary(_0x37ad88,_0x27022c){return function(_0x301f3c){freeVariablesPredictive(_0x27022c);emitVoiceQueueSummary(_0x27022c);emitCampaignSummary(_0x27022c);loggerSyncQueueSummary[_0x6732('0x90')](_0x37ad88,util[_0x6732('0x91')](_0x301f3c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x32ca9a,_0x2f32ec){return function(_0x5c7a81){loggerPredictive[_0x6732('0x90')](_0x2f32ec[_0x6732('0x39')],_0x32ca9a);loggerPredictive[_0x6732('0x90')](_0x5c7a81[_0x6732('0x92')]);freeVariablesPredictive(_0x2f32ec);};}function loggerCatch(_0x1affcf){return function(_0x2dd6de){logger[_0x6732('0x90')](_0x1affcf,util['inspect'](_0x2dd6de,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5d3e99){return _0x5d3e99&&!_[_0x6732('0x37')](_0x5d3e99)&&_0x5d3e99[_0x6732('0x93')]>0x0;}function decremetOriginate(_0x13b671){if(!_[_0x6732('0x37')](_0x13b671)&&_0x13b671!==null){if(_0x13b671['hasOwnProperty'](_0x6732('0x68'))){if(_0x13b671['originated']>0x0){_0x13b671[_0x6732('0x68')]-=0x1;}else{logger[_0x6732('0x90')](_0x6732('0x94'));}}}else{logger[_0x6732('0x90')](_0x6732('0x95'));}}function checkContactLowerLimitOriginate(_0x271154,_0x9fd19,_0x20a0b0){if(_0x9fd19>_0x20a0b0){for(var _0x24cd12=0x0;_0x24cd12<_0x9fd19-_0x20a0b0;_0x24cd12+=0x1){decremetOriginate(_0x271154);}}}function loggerGetContactDialer(_0x136dd5,_0x3bfb43,_0x241ea4){return function(_0x4a5b33){checkContactLowerLimitOriginate(_0x3bfb43,_0x241ea4,0x0);logger['error'](_0x136dd5,util['inspect'](_0x4a5b33,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x417ba1){return function(_0x33712c){if(isNotNull(_0x33712c)&&isNotNull(_0x33712c[0x0])){if(_0x33712c[0x0][_0x6732('0x96')]>0x0){_0x417ba1[_0x6732('0x3a')]=_0x6732('0x97');logger[_0x6732('0x76')](_0x6732('0x98')+_0x417ba1['name'],_0x33712c[0x0][_0x6732('0x96')],_0x6732('0x99'));}else{_0x417ba1[_0x6732('0x3a')]=_0x6732('0x9a');logger['info'](_0x6732('0x9b')+_0x417ba1['name']);}}};}function notSendMessagesQueue(_0x3de6cd){if(_0x3de6cd[_0x6732('0x9c')]){freeVariablesPredictive(_0x3de6cd);if(_0x3de6cd[_0x6732('0x68')]===0x0&&_0x3de6cd[_0x6732('0x9d')]===0x0&&_0x3de6cd[_0x6732('0x9e')]===0x0&&(_0x3de6cd[_0x6732('0x9f')]||0x0)===0x0){_0x3de6cd[_0x6732('0x9c')]=![];_0x3de6cd[_0x6732('0x4b')]=0x0;_0x3de6cd[_0x6732('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x6732('0xa0'),_0x3de6cd[_0x6732('0x39')],'is\x20not\x20active');}else{_0x3de6cd[_0x6732('0x3a')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x6732('0xa0'),_0x3de6cd[_0x6732('0x39')],'is\x20disactive');}emitVoiceQueueSummary(_0x3de6cd);}}function notSendMessagesCampaign(_0x452880){if(_0x452880[_0x6732('0x9c')]){if(_0x452880[_0x6732('0x68')]===0x0){_0x452880[_0x6732('0x9c')]=![];_0x452880[_0x6732('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x6732('0x90')](_0x6732('0xa1'),_0x452880[_0x6732('0x39')],_0x6732('0xa2'));}else{_0x452880[_0x6732('0x3a')]=_0x6732('0xa3');loggerSyncQueueSummary[_0x6732('0x90')](_0x6732('0xa1'),_0x452880[_0x6732('0x39')],_0x6732('0xa4'));}emitCampaignSummary(_0x452880);}}function createObjHistory(_0x20e692,_0x1c085d,_0x236119,_0xbdda80,_0x1aa685){_0x20e692[_0x6732('0x3a')]=_0x236119;var _0x5d3b68=new Action(_0x20e692,_0x1c085d);var _0x5a92fc=new History(_0x5d3b68);_0x5a92fc[_0x6732('0xa5')]=_0xbdda80;_0x5a92fc[_0x6732('0xa6')]=_0x1aa685;_0x5a92fc[_0x6732('0xa7')]=_0x5d3b68[_0x6732('0xa8')];return _0x5a92fc;}Dialer[_0x6732('0xa9')][_0x6732('0x36')]=function(){var _0x31173b=this;setInterval(function(){_0x31173b[_0x6732('0xaa')](_0x31173b[_0x6732('0xab')],_0x6732('0xac'));_0x31173b[_0x6732('0xaa')](_0x31173b[_0x6732('0x24')],_0x6732('0xad'));},0x32c8);};Dialer[_0x6732('0xa9')][_0x6732('0xaa')]=function(_0x957568,_0x486c8e){var _0x38fe68=this;for(var _0x5ba077 in _0x957568){if(_0x957568[_0x6732('0xae')](_0x5ba077)){this[_0x6732('0x1d')]['enqueue'](function(){if(!_[_0x6732('0xaf')](_0x957568[_0x5ba077])){return ami[_0x6732('0xb0')]({'action':_0x6732('0xb1'),'channel':_0x957568[_0x5ba077][_0x6732('0xb2')]})['catch'](function(_0x5cbc5d){if(_0x5cbc5d['message']===_0x6732('0xb3')){setTimeout(function(){if(_0x957568[_0x5ba077]&&_0x957568[_0x5ba077]['type']!==_0x6732('0x8c')){_0x38fe68[_0x6732('0xb4')](_0x38fe68['voiceQueues'][_0x957568[_0x5ba077]['queue']]);logger[_0x6732('0x90')](_0x6732('0xb5'),_0x486c8e,_0x5ba077,_0x957568[_0x5ba077][_0x6732('0xb6')]);delete _0x957568[_0x5ba077];}if(_0x957568[_0x5ba077]&&_0x957568[_0x5ba077][_0x6732('0x50')]===_0x6732('0x8c')){_0x38fe68[_0x6732('0xb4')](_0x38fe68['campaigns'][_0x957568[_0x5ba077]['queue']]);logger['error'](_0x6732('0xb7'),_0x486c8e,_0x5ba077,_0x957568[_0x5ba077]['queue']);delete _0x957568[_0x5ba077];}},0x2328);}});}});}}};Dialer[_0x6732('0xa9')][_0x6732('0xb8')]=function(_0x1f5185){return BPromise[_0x6732('0xb9')]()['then'](cmHopper[_0x6732('0xb8')](_0x1f5185))[_0x6732('0xba')](loggerCatch(_0x6732('0xbb')));};Dialer[_0x6732('0xa9')][_0x6732('0xbc')]=function(_0x43b0d7){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopperBlack[_0x6732('0xbc')](_0x43b0d7))[_0x6732('0xba')](loggerCatch(_0x6732('0xbe')));};Dialer['prototype'][_0x6732('0xbf')]=function(_0x5b434b){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopperBlack[_0x6732('0xbf')](_0x5b434b))[_0x6732('0xba')](loggerCatch(_0x6732('0xc0')));};Dialer['prototype'][_0x6732('0xc1')]=function(_0x40b48c){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopperHistory[_0x6732('0xc2')](_0x40b48c))['catch'](loggerCatch(_0x6732('0xc3')));};Dialer[_0x6732('0xa9')]['rescheduleContact']=function(_0x453eef){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopper[_0x6732('0xc4')](_0x453eef))[_0x6732('0xba')](loggerCatch(_0x6732('0xc5')));};Dialer[_0x6732('0xa9')][_0x6732('0xc6')]=function(_0x21854d,_0x5641db,_0x1788ac,_0x45761a){return BPromise[_0x6732('0xb9')]()['then'](cmHopper[_0x6732('0xc6')](_0x21854d,_0x5641db,_0x1788ac,_0x45761a))[_0x6732('0xba')](loggerCatch(_0x6732('0xc7')));};Dialer[_0x6732('0xa9')][_0x6732('0xc8')]=function(_0x1395dd,_0x44e498,_0x58bb16){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopper[_0x6732('0xc8')](_0x1395dd,_0x44e498,_0x58bb16))[_0x6732('0xba')](loggerCatch(_0x6732('0xc7')));};Dialer['prototype'][_0x6732('0xc9')]=function(_0x2a9855){return BPromise[_0x6732('0xb9')]()['then'](voiceQueueRt[_0x6732('0xc9')](_0x2a9855))['catch'](loggerCatch(_0x6732('0xca')));};Dialer[_0x6732('0xa9')][_0x6732('0xcb')]=function(_0x47b62b){return BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](cmHopper['moveContactManagedDialer'](_0x47b62b))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x6732('0xa9')][_0x6732('0xcc')]=function(_0xf36c7){return BPromise['resolve']()[_0x6732('0xbd')](cmHopperHistory[_0x6732('0xcc')](_0xf36c7))[_0x6732('0xba')](loggerCatch(_0x6732('0xcd')));};Dialer[_0x6732('0xa9')][_0x6732('0xb4')]=function(_0x47f0c3){if(!_[_0x6732('0x37')](_0x47f0c3)&&_0x47f0c3!==null){if(_0x47f0c3[_0x6732('0xae')](_0x6732('0x68'))){if(_0x47f0c3[_0x6732('0x68')]>0x0){_0x47f0c3[_0x6732('0x68')]-=0x1;}else{logger[_0x6732('0x90')](_0x6732('0xce'));}}}else{logger[_0x6732('0x90')](_0x6732('0xcf'));}};Dialer[_0x6732('0xa9')]['loggerHandler']=function(_0x5157c1,_0x425a7e){var _0x4cbbbc=this;return function(_0x2eeaba){_0x4cbbbc[_0x6732('0xb4')](_0x425a7e);logger[_0x6732('0x90')](_0x5157c1,util[_0x6732('0x91')](_0x2eeaba,{'showHidden':![],'depth':null}));};};Dialer[_0x6732('0xa9')][_0x6732('0xd0')]=function(_0x52de34,_0x41a6b1,_0x4581f0){var _0x972505={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x41a6b1);this['saveInDb'](_[_0x6732('0x87')](_0x972505,_['pick'](_0x4581f0,[_0x6732('0xd1'),_0x6732('0xd2'),_0x6732('0xd3'),_0x6732('0xd4'),'CampaignId'])),_0x6732('0xd5'),_0x6732('0xd6'));logger[_0x6732('0x90')](_0x52de34);};Dialer[_0x6732('0xa9')][_0x6732('0xd7')]=function(_0x50d157){return _0x50d157===_0x6732('0xd8');};Dialer[_0x6732('0xa9')][_0x6732('0xd9')]=function(_0x49454e){return!_['isUndefined'](_0x49454e)&&_0x49454e&&!_[_0x6732('0x37')](_0x49454e[_0x6732('0x39')])&&!_[_0x6732('0x37')](_0x49454e[_0x6732('0x6e')])&&_0x49454e[_0x6732('0x6e')]&&(this[_0x6732('0x21')][util[_0x6732('0x71')](_0x6732('0xda'),_0x49454e[_0x6732('0x39')])][_0x6732('0xb1')]===_0x6732('0xdb')||this[_0x6732('0x21')][util['format'](_0x6732('0xda'),_0x49454e[_0x6732('0x39')])]['status']==='unmonitored');};Dialer['prototype'][_0x6732('0xdc')]=function(_0x448334,_0xa3ae40,_0x19b796){this['createHistory'](_0x448334)[_0x6732('0xba')](loggerCatch(_0xa3ae40));this['moveContactManagedDialer'](_0x448334)[_0x6732('0xba')](loggerCatch(_0x19b796));};Dialer['prototype'][_0x6732('0x33')]=function(_0x4bb6c2){var _0x1d612e=this['uniqueId'][_0x4bb6c2[_0x6732('0xdd')]];var _0x1d2fea;if(!_[_0x6732('0xaf')](_0x4bb6c2)&&!_[_0x6732('0xaf')](_0x4bb6c2[_0x6732('0xde')])&&!_[_0x6732('0xaf')](_0x4bb6c2['variable']['amdstatus'])&&_0x4bb6c2[_0x6732('0xdf')]===_0x6732('0xe0')&&_0x1d612e){if(_0x1d612e[_0x6732('0x50')]!=='ivr'&&this['voiceQueues'][_0x1d612e[_0x6732('0xb6')]][_0x6732('0xe1')]&&_0x4bb6c2['value']===_0x6732('0xe2')){delete this[_0x6732('0xab')][_0x4bb6c2[_0x6732('0xdd')]];this[_0x6732('0xb4')](this[_0x6732('0x1f')][_0x1d612e[_0x6732('0xb6')]]);this['voiceQueues'][_0x1d612e[_0x6732('0xb6')]][_0x6732('0x58')]+=0x1;this[_0x6732('0x1f')][_0x1d612e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x1d2fea=new Hangup(_0x1d612e,_0x4bb6c2);_0x1d2fea[_0x6732('0xa5')]=0x12;_0x1d2fea[_0x6732('0xa6')]=_0x6732('0xe3');_0x1d2fea[_0x6732('0xe4')]=_0x6732('0xe5');this[_0x6732('0xdc')](_0x1d2fea,_0x6732('0xe6'),_0x6732('0xe7'));}if(_0x1d612e['type']!==_0x6732('0x8c')&&this[_0x6732('0x1f')][_0x1d612e[_0x6732('0xb6')]][_0x6732('0xe1')]&&_0x4bb6c2[_0x6732('0xe8')]===_0x6732('0xe9')){delete this[_0x6732('0xab')][_0x4bb6c2[_0x6732('0xdd')]];this[_0x6732('0xb4')](this[_0x6732('0x1f')][_0x1d612e['queue']]);this[_0x6732('0x1f')][_0x1d612e[_0x6732('0xb6')]][_0x6732('0x58')]+=0x1;this['voiceQueues'][_0x1d612e[_0x6732('0xb6')]][_0x6732('0xea')]+=0x1;_0x1d2fea=new Hangup(_0x1d612e,_0x4bb6c2);_0x1d2fea[_0x6732('0xa5')]=0x13;_0x1d2fea[_0x6732('0xa6')]=_0x6732('0xeb');_0x1d2fea[_0x6732('0xe4')]=_0x6732('0xe5');_0x1d2fea['amd']=!![];this[_0x6732('0xdc')](_0x1d2fea,_0x6732('0xec'),_0x6732('0xed'));}if(_0x1d612e[_0x6732('0x50')]==='ivr'&&this[_0x6732('0xee')][_0x1d612e[_0x6732('0xb6')]]['dialAMDActive']&&_0x4bb6c2[_0x6732('0xe8')]==='HANGUP'){delete this[_0x6732('0xab')][_0x4bb6c2[_0x6732('0xdd')]];this['updateOriginated'](this['campaigns'][_0x1d612e['queue']]);_0x1d2fea=new Hangup(_0x1d612e,_0x4bb6c2);_0x1d2fea[_0x6732('0xa5')]=0x12;_0x1d2fea[_0x6732('0xa6')]=_0x6732('0xe3');_0x1d2fea[_0x6732('0xe4')]=_0x6732('0xe5');this['saveInDb'](_0x1d2fea,'[syncHangupInAMDIvr][createHistory]',_0x6732('0xef'));}if(_0x1d612e['type']===_0x6732('0x8c')&&this[_0x6732('0xee')][_0x1d612e['queue']][_0x6732('0xe1')]&&_0x4bb6c2[_0x6732('0xe8')]===_0x6732('0xe9')){delete this['uniqueId'][_0x4bb6c2['uniqueid']];this[_0x6732('0xb4')](this[_0x6732('0xee')][_0x1d612e[_0x6732('0xb6')]]);_0x1d2fea=new Hangup(_0x1d612e,_0x4bb6c2);_0x1d2fea[_0x6732('0xa5')]=0x13;_0x1d2fea[_0x6732('0xa6')]=_0x6732('0xeb');_0x1d2fea[_0x6732('0xe4')]=_0x6732('0xe5');_0x1d2fea[_0x6732('0xf0')]=!![];this[_0x6732('0xdc')](_0x1d2fea,_0x6732('0xf1'),_0x6732('0xf2'));}}};Dialer['prototype']['syncHangup']=function(_0x475f6e){var _0x367c22=this['uniqueId'][_0x475f6e[_0x6732('0xdd')]];var _0x1e299f=this;var _0x333e81;if(_0x367c22&&_0x367c22[_0x6732('0x50')]===_0x6732('0x8c')){delete this[_0x6732('0xab')][_0x475f6e[_0x6732('0xdd')]];this['updateOriginated'](this[_0x6732('0xee')][_0x367c22[_0x6732('0xb6')]]);this['campaigns'][_0x367c22[_0x6732('0xb6')]]['ivrAnswerCallsDay']+=0x1;_0x333e81=new Hangup(_0x367c22,_0x475f6e);this[_0x6732('0xcc')](_0x333e81)[_0x6732('0xba')](loggerCatch(_0x6732('0xf3')));this['moveContactManagedDialer'](_0x333e81)[_0x6732('0xba')](loggerCatch(_0x6732('0xf4')));}if(_0x367c22&&_0x367c22[_0x6732('0x50')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x367c22[_0x6732('0xb6')]][_0x6732('0xf5')])){delete this[_0x6732('0xab')][_0x475f6e[_0x6732('0xdd')]];this['updateOriginated'](this[_0x6732('0x1f')][_0x367c22[_0x6732('0xb6')]]);this['voiceQueues'][_0x367c22[_0x6732('0xb6')]][_0x6732('0x58')]+=0x1;this['voiceQueues'][_0x367c22[_0x6732('0xb6')]][_0x6732('0xea')]+=0x1;_0x333e81=new Hangup(_0x367c22,_0x475f6e);_0x333e81['state']=0x10;_0x333e81[_0x6732('0xa6')]=_0x6732('0xf6');_0x333e81['membername']=_0x6732('0xf7');this[_0x6732('0xcc')](_0x333e81)[_0x6732('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x333e81)[_0x6732('0xba')](loggerCatch('[syncHangupIvr]'));}if(_0x367c22&&_0x367c22['type']!==_0x6732('0x8c')&&!isNotNull(this['voiceQueues'][_0x367c22[_0x6732('0xb6')]]['dialQueueProject'])){delete this[_0x6732('0xab')][_0x475f6e['uniqueid']];this[_0x6732('0xb4')](this['voiceQueues'][_0x367c22[_0x6732('0xb6')]]);this[_0x6732('0x1f')][_0x367c22[_0x6732('0xb6')]][_0x6732('0x61')]+=0x1;_0x333e81=new Hangup(_0x367c22,_0x475f6e);_0x333e81['state']=0xc;_0x333e81['statedesc']=_0x475f6e[_0x6732('0xf8')];_0x333e81[_0x6732('0xe4')]=_0x6732('0xf9');this[_0x6732('0xcc')](_0x333e81)[_0x6732('0xba')](loggerCatch(_0x6732('0xf3')));this[_0x6732('0xcb')](_0x333e81)['catch'](loggerCatch(_0x6732('0xf4')));}};Dialer[_0x6732('0xa9')][_0x6732('0x2e')]=function(_0x4a9f9d){var _0x3f13ad=this[_0x6732('0xab')][_0x4a9f9d[_0x6732('0xdd')]];var _0x58480b=this;if(this[_0x6732('0x1f')][_0x4a9f9d[_0x6732('0xb6')]]){if(_0x3f13ad&&_0x3f13ad[_0x6732('0x50')]!==_0x6732('0x8c')){delete this['uniqueId'][_0x4a9f9d[_0x6732('0xdd')]];this['voiceQueues'][_0x4a9f9d[_0x6732('0xb6')]][_0x6732('0x58')]+=0x1;var _0xf00a8e=new AgentComplete(_0x3f13ad,_0x4a9f9d);if(_0x4a9f9d['reason']===_0x6732('0xfa')){_0xf00a8e[_0x6732('0xfb')]=this[_0x6732('0x1f')][_0x4a9f9d['queue']][_0x6732('0xfc')]&&this[_0x6732('0x1f')][_0x4a9f9d[_0x6732('0xb6')]][_0x6732('0xfd')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0xf00a8e)['catch'](loggerCatch(_0x6732('0xfe')));this[_0x6732('0xcb')](_0xf00a8e)[_0x6732('0xba')](loggerCatch(_0x6732('0xff')));}}};Dialer['prototype'][_0x6732('0x28')]=function(_0x39af5d){if(this[_0x6732('0x1f')][_0x39af5d[_0x6732('0xb6')]]){if(this[_0x6732('0xab')][_0x39af5d[_0x6732('0xdd')]]&&this[_0x6732('0xab')][_0x39af5d[_0x6732('0xdd')]][_0x6732('0x50')]!==_0x6732('0x8c')){this[_0x6732('0xb4')](this['voiceQueues'][_0x39af5d[_0x6732('0xb6')]]);this['uniqueId'][_0x39af5d[_0x6732('0xdd')]][_0x6732('0x100')]=moment()['format'](_0x6732('0x101'));}}};Dialer[_0x6732('0xa9')][_0x6732('0x102')]=function(_0x4dfcef){this[_0x6732('0xcc')](_0x4dfcef)[_0x6732('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x6732('0xcb')](_0x4dfcef)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x6732('0xa9')][_0x6732('0x2b')]=function(_0x31327c){var _0x2ad80a=this[_0x6732('0xab')][_0x31327c[_0x6732('0xdd')]];var _0x25362e=this;if(this[_0x6732('0x1f')][_0x31327c[_0x6732('0xb6')]]){if(_0x2ad80a&&_0x2ad80a[_0x6732('0x50')]!==_0x6732('0x8c')){delete this[_0x6732('0xab')][_0x31327c[_0x6732('0xdd')]];this[_0x6732('0xb4')](this[_0x6732('0x1f')][_0x31327c[_0x6732('0xb6')]]);_0x2ad80a[_0x6732('0x103')]=moment()[_0x6732('0x71')](_0x6732('0x101'));var _0x1bc6b1=new QueueCallerAbandon(_0x2ad80a,_0x31327c);if(getSeconds(_0x2ad80a[_0x6732('0x103')],_0x2ad80a[_0x6732('0x104')])>=_0x2ad80a[_0x6732('0x105')]){this[_0x6732('0x1f')][_0x31327c[_0x6732('0xb6')]][_0x6732('0x64')]+=0x1;this[_0x6732('0x1f')][_0x31327c['queue']][_0x6732('0x106')]+=0x1;this['voiceQueues'][_0x31327c['queue']][_0x6732('0x107')]+=0x1;_0x1bc6b1['state']=0xa;_0x1bc6b1[_0x6732('0xa6')]=_0x6732('0x108');_0x1bc6b1[_0x6732('0x109')]=_0x6732('0x10a');_0x1bc6b1[_0x6732('0xfb')]=this['voiceQueues'][_0x31327c[_0x6732('0xb6')]][_0x6732('0xfc')]?moment()[_0x6732('0x71')](_0x6732('0x101')):undefined;this[_0x6732('0x102')](_0x1bc6b1);}else{this['voiceQueues'][_0x31327c[_0x6732('0xb6')]][_0x6732('0x63')]+=0x1;this['voiceQueues'][_0x31327c['queue']][_0x6732('0x5d')]+=0x1;_0x1bc6b1[_0x6732('0xa5')]=0xb;_0x1bc6b1[_0x6732('0xa6')]=_0x6732('0x10b');_0x1bc6b1[_0x6732('0x109')]=_0x6732('0x10c');this[_0x6732('0x102')](_0x1bc6b1);}}}};Dialer[_0x6732('0xa9')][_0x6732('0x32')]=function(_0x4f4d30){if(this[_0x6732('0x24')][_0x4f4d30[_0x6732('0xdd')]]){this['actions'][_0x4f4d30[_0x6732('0xdd')]][_0x6732('0xb2')]=_0x4f4d30['channel'];}if(this[_0x6732('0xab')][_0x4f4d30[_0x6732('0xdd')]]){this[_0x6732('0xab')][_0x4f4d30['uniqueid']][_0x6732('0xb2')]=_0x4f4d30[_0x6732('0xb2')];}};Dialer[_0x6732('0xa9')]['syncQueueMember']=function(_0xf6a472){if(strategy[this[_0x6732('0x1f')][this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]][_0x6732('0xb6')]][_0x6732('0x10e')]]==='roundrobin'){if(this[_0x6732('0x24')][_0xf6a472['actionid']]&&_[_0x6732('0xaf')](this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]]['locked'])&&_0xf6a472[_0x6732('0xb1')]==='1'&&_0xf6a472[_0x6732('0x10f')]==='0'){if(this['agents'][_0xf6a472[_0x6732('0x110')]]){if(!this[_0x6732('0x20')][_0xf6a472['stateinterface']][_0x6732('0x111')]){this[_0x6732('0x20')][_0xf6a472[_0x6732('0x110')]][_0x6732('0x111')]=!![];this[_0x6732('0x24')][_0xf6a472['actionid']]['locked']=!![];this['actions'][_0xf6a472[_0x6732('0x10d')]][_0x6732('0x110')]=_0xf6a472[_0x6732('0x110')];}}}}else if((strategy[this['voiceQueues'][this[_0x6732('0x24')][_0xf6a472['actionid']][_0x6732('0xb6')]][_0x6732('0x10e')]]||_0x6732('0x19'))===_0x6732('0x19')){if(this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]]){if(this[_0x6732('0x20')][_0xf6a472[_0x6732('0x110')]]){this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]][_0x6732('0x110')]=_0xf6a472[_0x6732('0x110')];if(_[_0x6732('0xaf')](this[_0x6732('0x112')][this['actions'][_0xf6a472[_0x6732('0x10d')]][_0x6732('0xb6')]])){this['queueBooked'][this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]][_0x6732('0xb6')]]=[];}this[_0x6732('0x112')][this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]][_0x6732('0xb6')]][_0x6732('0x113')](_[_0x6732('0x87')](_[_0x6732('0x114')](this[_0x6732('0x24')][_0xf6a472[_0x6732('0x10d')]],[_0x6732('0x115'),_0x6732('0x110')]),{'status':_0xf6a472[_0x6732('0xb1')],'paused':_0xf6a472[_0x6732('0x10f')]}));}}}};function unlockQueueStatus(_0x2a4135,_0x35e99e){setTimeout(function(){if(_['isUndefined'](_0x2a4135['queueStatusComplete'])){loggerBooked[_0x6732('0x90')](_0x6732('0x116'),_0x35e99e);}_0x2a4135['queueStatusComplete']=!![];loggerBooked[_0x6732('0x76')](_0x6732('0x117'),_0x35e99e,JSON[_0x6732('0x44')](_[_0x6732('0x114')](_0x2a4135,[_0x6732('0x39'),_0x6732('0x118')])));},0x1f3);}Dialer[_0x6732('0xa9')][_0x6732('0x119')]=function(_0x5f4e82){var _0x333cb5=this;var _0x34e269=_0x333cb5[_0x6732('0x1f')][_0x333cb5[_0x6732('0x24')][_0x5f4e82['actionid']][_0x6732('0xb6')]];if(strategy[this[_0x6732('0x1f')][this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]][_0x6732('0x10e')]]==='roundrobin'){if(this['actions'][_0x5f4e82['actionid']]&&this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0x110')]){this[_0x6732('0x1e')][_0x6732('0x11a')](this[_0x6732('0x24')][_0x5f4e82['actionid']][_0x6732('0x115')],this[_0x6732('0x24')][_0x5f4e82['actionid']][_0x6732('0x110')])[_0x6732('0xba')](function(_0x1600f6){logger['error'](_0x6732('0x11b'),util['inspect'](_0x1600f6,{'showHidden':![],'depth':null}));})[_0x6732('0x1c')](function(){_0x333cb5[_0x6732('0xb4')](_0x333cb5[_0x6732('0x1f')][_0x333cb5['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]);_0x333cb5[_0x6732('0x20')][_0x333cb5['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0x110')]][_0x6732('0x111')]=![];delete _0x333cb5['actions'][_0x5f4e82['actionid']];unlockQueueStatus(_0x34e269);});}else{this[_0x6732('0xb4')](this[_0x6732('0x1f')][this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x5f4e82['actionid']][_0x6732('0xd1')],'ListId':this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xd2')],'VoiceQueueId':this['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xd4')]||undefined,'CampaignId':this['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0x11c')]||undefined})[_0x6732('0xba')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x6732('0x24')][_0x5f4e82['actionid']];unlockQueueStatus(_0x34e269);}}else if((strategy[this[_0x6732('0x1f')][this['actions'][_0x5f4e82[_0x6732('0x10d')]]['queue']][_0x6732('0x10e')]]||_0x6732('0x19'))===_0x6732('0x19')){var _0x2a3c00;if(this[_0x6732('0x24')][_0x5f4e82['actionid']]&&!_[_0x6732('0x41')](this[_0x6732('0x112')][this['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]])){if(this[_0x6732('0x11d')][_0x333cb5[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]){this[_0x6732('0x11d')][_0x333cb5[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]=this[_0x6732('0x11d')][this[_0x6732('0x24')][_0x5f4e82['actionid']][_0x6732('0xb6')]]?this['queueBookedRR'][this['actions'][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]:this[_0x6732('0x112')][this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]]?this['queueBooked'][this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]][_0x6732('0x11e')]||0x0:0x0;}this['queueBooked'][this[_0x6732('0x24')][_0x5f4e82[_0x6732('0x10d')]][_0x6732('0xb6')]][_0x6732('0x11e')]=this[_0x6732('0x11d')][this['actions'][_0x5f4e82['actionid']]['queue']];for(var _0x1aada9=0x0;_0x1aada9=0x0?!![]:![];})['catch'](myreject(_0x5d1e56)));}}else{_0x1a5c37['push'](ami['Action']({'action':_0x6732('0x134'),'command':util[_0x6732('0x71')]('iftime\x20%s,%s',_0x240220,!_[_0x6732('0x37')](config[_0x6732('0x12e')][_0x8161b5])?_0x8161b5:'')})[_0x6732('0xbd')](function(_0x4c1924){return _0x4c1924[_0x6732('0x132')][_0x6732('0x135')](_0x6732('0x133'))>=0x0?!![]:![];})[_0x6732('0xba')](myreject(_0x5d1e56)));}BPromise[_0x6732('0x136')](_0x1a5c37)['then'](function(_0x3caa5c){var _0x1e71f7=_[_0x6732('0x137')](_0x3caa5c);if(_0x1e71f7){return _0x1c2d57(_0x1e71f7);}else{_0x16ae50[_0x6732('0x3a')]=_0x2877f3?_0x6732('0x138'):_0x6732('0x139');return _0x5d1e56(msgResponse(_0x6732('0x13a'),_0x6732('0x13b'),_0x6732('0x13c')+_0x2877f3+'\x20'+_0x31e3a1+_0x6732('0x13d')+util[_0x6732('0x91')](_0x240220,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x8161b5));}})[_0x6732('0xba')](function(_0x1c151b){return _0x5d1e56(msgResponse('ifTime',_0x6732('0x13b'),JSON['stringify'](_0x1c151b)));});});};Dialer['prototype'][_0x6732('0x13e')]=function(_0x3d9c61){var _0x7b5203=this;return function(){switch(_0x3d9c61[_0x6732('0x13f')]){case'progressive':freeVariablesPredictive(_0x3d9c61);_0x7b5203[_0x6732('0x140')](_0x3d9c61,0x1);break;case _0x6732('0x141'):freeVariablesPredictive(_0x3d9c61);_0x7b5203[_0x6732('0x140')](_0x3d9c61,_0x3d9c61[_0x6732('0x142')]);break;case _0x6732('0x8'):_0x7b5203['predictive'](_0x3d9c61);break;case'booked':freeVariablesPredictive(_0x3d9c61);_0x7b5203[_0x6732('0x140')](_0x3d9c61,0x1);break;default:freeVariablesPredictive(_0x3d9c61);logger[_0x6732('0x90')](_0x6732('0x143'),_0x3d9c61[_0x6732('0x39')],_0x6732('0x144'));}};};Dialer[_0x6732('0xa9')][_0x6732('0x145')]=function(_0x17d1c1){var _0x1dc864=this;return function(){_0x1dc864[_0x6732('0x146')](_0x17d1c1);};};Dialer['prototype'][_0x6732('0xa')]=function(_0x3c1b34){var _0x1a3518=this;if(isNotPreview(_0x3c1b34[_0x6732('0x13f')])){if(isVoiceQueueOutbound(_0x3c1b34[_0x6732('0x50')])&&isActive(_0x3c1b34[_0x6732('0x147')])){_0x3c1b34['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x6732('0xbd')](checkIsLoggedIn(_0x3c1b34,_0x3c1b34[_0x6732('0x4c')]))['then'](checkIsActive(_0x3c1b34,_0x3c1b34['dialActive']))[_0x6732('0xbd')](checkInterval(_0x3c1b34))[_0x6732('0xbd')](_0x1a3518['checkIsTrunkReachable'](_0x3c1b34))[_0x6732('0xbd')](_0x1a3518[_0x6732('0x12a')](_0x3c1b34[_0x6732('0x148')],_0x3c1b34[_0x6732('0x149')],_0x3c1b34[_0x6732('0x39')],_0x3c1b34))[_0x6732('0xbd')](_0x1a3518[_0x6732('0x14a')](_0x3c1b34[_0x6732('0x3f')],_0x3c1b34[_0x6732('0x149')],_0x3c1b34[_0x6732('0x39')],_0x3c1b34))[_0x6732('0xbd')](_0x1a3518[_0x6732('0x13e')](_0x3c1b34))[_0x6732('0xba')](loggerCatchQueueSummary(_0x6732('0x14b'),_0x3c1b34));}else{notSendMessagesQueue(_0x3c1b34);}}else{freeVariablesPredictive(_0x3c1b34);}};Dialer[_0x6732('0xa9')][_0x6732('0x125')]=function(){var _0x7dad58=this;var _0x25e7ea;for(var _0x37e6b0 in this['campaigns']){if(this['campaigns'][_0x6732('0xae')](_0x37e6b0)){_0x25e7ea=this[_0x6732('0xee')][_0x37e6b0];if(isCampaignIvr(_0x25e7ea[_0x6732('0x50')])&&isActive(_0x25e7ea[_0x6732('0x6e')])){_0x25e7ea['sendMessageOneNotActive']=!![];BPromise[_0x6732('0xb9')]()[_0x6732('0xbd')](checkIsActive(_0x25e7ea,_0x25e7ea[_0x6732('0x6e')]))[_0x6732('0xbd')](checkInterval(_0x25e7ea))[_0x6732('0xbd')](_0x7dad58[_0x6732('0x126')](_0x25e7ea))[_0x6732('0xbd')](_0x7dad58[_0x6732('0x12a')](_0x25e7ea[_0x6732('0x148')],_0x25e7ea[_0x6732('0x149')],_0x25e7ea['name'],_0x25e7ea))[_0x6732('0xbd')](_0x7dad58[_0x6732('0x14a')](_0x25e7ea[_0x6732('0x3f')],_0x25e7ea[_0x6732('0x149')],_0x25e7ea[_0x6732('0x39')],_0x25e7ea))[_0x6732('0xbd')](_0x7dad58[_0x6732('0x145')](_0x25e7ea))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x25e7ea));}else{notSendMessagesCampaign(_0x25e7ea);}}}};function getCallerIdRandom(_0x57367b,_0x3da592){var _0x1eed9b,_0x1e0e45,_0x381537;if(_0x3da592<=0x0){_0x3da592=0x1;}_0x1eed9b=new RegExp(_0x6732('0x14c')+_0x3da592+'}$');_0x1e0e45=Math[_0x6732('0x14d')](0xa,_0x3da592-0x1);_0x381537=Math[_0x6732('0x14d')](0xa,_0x3da592)-0x1;return util['format']('%s',_[_0x6732('0x14e')](_0x57367b,_0x1eed9b,_[_0x6732('0x14f')](_0x1e0e45,_0x381537)));}function extractCalleridName(_0x45e782){var _0x4baee5=_0x45e782['match'](/"(.*?)"/);return _0x4baee5?_0x4baee5[0x1]:_0x45e782;}function extractCalleridNumber(_0x5615ee){var _0x56d9a4=_0x5615ee[_0x6732('0x150')](/<(.*?)>/);return _0x56d9a4?_0x56d9a4[0x1]:_0x5615ee;}Dialer[_0x6732('0xa9')]['actionOriginate']=function(_0x323754,_0x35d1bb){var _0x4486b2=this;var _0x2eaa12=uuid['v4']();this[_0x6732('0x24')][_0x2eaa12]=new Action(_0x323754,_0x35d1bb,_0x2eaa12);return new BPromise(function(_0x42e89e,_0x32a80a){if(_[_0x6732('0x37')](_0x323754)&&'object'!==typeof _0x323754){return _0x32a80a(msgResponse('originate',_0x6732('0x13b'),_0x6732('0x151')));}if(_[_0x6732('0x37')](_0x35d1bb[_0x6732('0x152')][_0x6732('0x153')])||_0x35d1bb[_0x6732('0x152')][_0x6732('0x153')]===null){return _0x32a80a(msgResponse(_0x6732('0x154'),_0x6732('0x13b'),_0x6732('0x155')));}var _0x13c4c3={'XMD-CALLERID':_0x4486b2['actions'][_0x2eaa12][_0x6732('0x156')](),'XMD-AGI':_0x323754['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x323754[_0x6732('0xf5')]):_0x6732('0x157'),'XMD-AGIAFTER':_0x323754['dialQueueProject2']?util[_0x6732('0x71')]('\x22agi://%s/square,%s\x22',ipAgi,_0x323754['dialQueueProject2']):'NONE','XMD-QUEUE':_0x323754['type']===_0x6732('0x49')?util[_0x6732('0x71')]('\x22%s,%s%s,,,%s\x22',_0x323754[_0x6732('0x39')],_0x323754[_0x6732('0x158')]||'',_0x323754[_0x6732('0xfd')]?'c':'',_0x323754['dialQueueTimeout']||0x3):_0x6732('0x157'),'XMD-CONTACTID':_0x35d1bb[_0x6732('0xd1')],'XMD-CDRTYPE':_0x6732('0x5'),'CALLERID(all)':_0x4486b2[_0x6732('0x24')][_0x2eaa12]['getCaller'](),'XMD-AMD':_0x323754['dialAMDActive']?'ACTIVE':_0x6732('0x157'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x323754[_0x6732('0xe1')]){_0x13c4c3[_0x6732('0x159')]=_0x323754[_0x6732('0x15a')]||0x9c4;_0x13c4c3['XMD-AMDGREETING']=_0x323754[_0x6732('0x15b')]||0x5dc;_0x13c4c3[_0x6732('0x15c')]=_0x323754[_0x6732('0x15d')]||0x320;_0x13c4c3['XMD-AMDTOTALANALYSISTIME']=_0x323754[_0x6732('0x15e')]||0x1388;_0x13c4c3[_0x6732('0x15f')]=_0x323754['dialAMDMinWordLength']||0x64;_0x13c4c3[_0x6732('0x160')]=_0x323754[_0x6732('0x161')]||0x32;_0x13c4c3[_0x6732('0x162')]=_0x323754['dialAMDMaximumNumberOfWords']||0x3;_0x13c4c3[_0x6732('0x163')]=_0x323754['dialAMDSilenceThreshold']||0x100;_0x13c4c3[_0x6732('0x164')]=_0x323754[_0x6732('0x165')]||0x1388;}if(_0x323754['type']==='outbound'){_0x13c4c3[_0x6732('0x166')]=_0x35d1bb[_0x6732('0xd4')];}else{_0x13c4c3[_0x6732('0x167')]=_0x35d1bb[_0x6732('0x11c')];}for(var _0x41896c in _0x35d1bb['Contact']){if(_0x35d1bb['Contact'][_0x6732('0xae')](_0x41896c)){if(isNotNull(_0x35d1bb[_0x6732('0x152')][_0x41896c])&&_0x41896c!=='id'&&_0x41896c!=='tags'&&_0x41896c!==_0x6732('0x168')&&_0x41896c!==_0x6732('0x169')){_0x13c4c3[util['format'](_0x6732('0x16a'),_0x6732('0x16b'),_[_0x6732('0x16c')](_0x41896c))]=_0x35d1bb['Contact'][_0x41896c];}}}var _0x1ff495=_0x4486b2[_0x6732('0xd9')](_0x323754[_0x6732('0x6d')])?getCallerId(_0x323754[_0x6732('0x6d')]['callerid'],_0x323754['dialOriginateCallerIdName'],_0x323754['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x323754['dialOriginateCallerIdNumber'],_0x323754['dialRandomLastDigitCallerIdNumber']):_0x323754[_0x6732('0x55')]):getCallerId(_[_0x6732('0xaf')](_0x323754[_0x6732('0x127')])?_0x323754[_0x6732('0x6d')][_0x6732('0x6f')]:_0x323754['TrunkBackup'][_0x6732('0x6f')],_0x323754['dialOriginateCallerIdName'],_0x323754[_0x6732('0x16d')]>0x0?getCallerIdRandom(_0x323754[_0x6732('0x55')],_0x323754[_0x6732('0x16d')]):_0x323754[_0x6732('0x55')]);if(_0x1ff495){_0x13c4c3[_0x6732('0x16e')]=_0x4486b2[_0x6732('0x24')][_0x2eaa12][_0x6732('0x16f')]=extractCalleridName(_0x1ff495);_0x13c4c3[_0x6732('0x170')]=_0x4486b2[_0x6732('0x24')][_0x2eaa12][_0x6732('0x171')]=extractCalleridNumber(_0x1ff495);}return ami[_0x6732('0xb0')]({'actionid':_0x2eaa12,'action':'originate','channel':_0x4486b2['isTrunkReachable'](_0x323754[_0x6732('0x6d')])?util[_0x6732('0x71')]('SIP/%s/%s%s',_0x323754['Trunk'][_0x6732('0x39')],isNotNull(_0x323754[_0x6732('0x57')])?_0x323754[_0x6732('0x57')][_0x6732('0x172')]()||'':'',_0x323754[_0x6732('0x173')]>0x0?_0x35d1bb[_0x6732('0x152')]['phone'][_0x6732('0x174')](_0x323754[_0x6732('0x173')]):_0x35d1bb[_0x6732('0x152')][_0x6732('0x153')]):util[_0x6732('0x71')](_0x6732('0x175'),_[_0x6732('0xaf')](_0x323754['TrunkBackup'])?_0x323754['Trunk']['name']:_0x323754[_0x6732('0x127')][_0x6732('0x39')],isNotNull(_0x323754[_0x6732('0x57')])?_0x323754['dialPrefix'][_0x6732('0x172')]()||'':'',_0x323754['dialCutDigit']>0x0?_0x35d1bb[_0x6732('0x152')][_0x6732('0x153')][_0x6732('0x174')](_0x323754[_0x6732('0x173')]):_0x35d1bb['Contact']['phone']),'callerid':_0x1ff495,'Exten':_0x6732('0xe0'),'Context':_0x6732('0x176'),'Priority':'1','variable':_0x13c4c3,'timeout':(_0x323754[_0x6732('0x56')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2eaa12})[_0x6732('0xbd')](function(_0x53f270){return _0x42e89e(_0x53f270);})[_0x6732('0xba')](function(_0x452425){_0x323754[_0x6732('0x5f')]+=0x1;var _0x2b5963=new History(_0x4486b2[_0x6732('0x24')][_0x2eaa12]);logger[_0x6732('0x90')](util[_0x6732('0x71')](_0x6732('0x177'),JSON[_0x6732('0x44')](_0x452425)));_0x2b5963['state']=0xe;_0x2b5963['statedesc']=_0x6732('0x178');_0x2b5963['starttime']=moment()[_0x6732('0x71')](_0x6732('0x101'));_0x2b5963[_0x6732('0xa7')]=_0x2b5963[_0x6732('0xa8')];_0x4486b2['createHistory'](_0x2b5963)['catch'](loggerCatch(_0x6732('0x179')));_0x4486b2[_0x6732('0xcb')](_0x2b5963)['catch'](loggerCatch(_0x6732('0x179')))[_0x6732('0x1c')](function(){delete _0x4486b2[_0x6732('0x24')][_0x2eaa12];return _0x32a80a(msgResponse('originate',_0x6732('0x43'),_0x6732('0x17a')));});});});};Dialer[_0x6732('0xa9')][_0x6732('0x2c')]=function(_0x6d9b98){var _0x5b46b8=this[_0x6732('0x24')][_0x6d9b98['actionid']];var _0x30267d=this;if(_0x5b46b8){delete this[_0x6732('0x24')][_0x6d9b98['actionid']];_0x5b46b8[_0x6732('0x104')]=moment()[_0x6732('0x71')](_0x6732('0x101'));var _0x1b6d59=_0x5b46b8[_0x6732('0x50')]===_0x6732('0x8c')?this[_0x6732('0xee')][_0x5b46b8['queue']]:this[_0x6732('0x1f')][_0x5b46b8[_0x6732('0x17b')]()];if(!this['isSuccess'](_0x6d9b98['response'])){this[_0x6732('0xb4')](_0x1b6d59);return this['callProgressDetecting'](_0x5b46b8,_0x1b6d59,_0x6d9b98)['then'](function(_0x4cd012){})['catch'](loggerCatch(_0x6732('0x17c')));}else{this[_0x6732('0xab')][_0x6d9b98[_0x6732('0xdd')]]=_0x5b46b8;}}};Dialer[_0x6732('0xa9')]['checkRetriveMax']=function(_0x31f46c,_0x4c1324,_0x456eb7){var _0x4d3050=new History(_0x4c1324);if(_0x4d3050['countbusyretry']+_0x4d3050['countcongestionretry']+_0x4d3050[_0x6732('0x17d')]>=_0x456eb7[_0x6732('0x17e')]-0x1){return!![];}switch(_0x31f46c){case 0x3:if(_0x4d3050[_0x6732('0x17d')]>=_0x456eb7[_0x6732('0x17f')]-0x1){return!![];}else{this[_0x6732('0xc4')]({'active':![],'countnoanswerretry':_0x4d3050[_0x6732('0x17d')]+=0x1,'scheduledat':moment()[_0x6732('0x180')](_0x456eb7[_0x6732('0x181')],_0x6732('0x182'))['format'](_0x6732('0x101')),'ContactId':_0x4d3050[_0x6732('0xd1')],'ListId':_0x4d3050['ListId'],'VoiceQueueId':_0x4d3050[_0x6732('0xd4')]||undefined,'CampaignId':_0x4d3050[_0x6732('0x11c')]||undefined})[_0x6732('0xba')](loggerCatch(_0x6732('0x183')));}break;case 0x5:if(_0x4d3050[_0x6732('0x184')]>=_0x456eb7[_0x6732('0x185')]-0x1){return!![];}else{this[_0x6732('0xc4')]({'active':![],'countbusyretry':_0x4d3050[_0x6732('0x184')]+=0x1,'scheduledat':moment()[_0x6732('0x180')](_0x456eb7['dialBusyRetryFrequency'],_0x6732('0x182'))['format'](_0x6732('0x101')),'ContactId':_0x4d3050['ContactId'],'ListId':_0x4d3050[_0x6732('0xd2')],'VoiceQueueId':_0x4d3050[_0x6732('0xd4')]||undefined,'CampaignId':_0x4d3050[_0x6732('0x11c')]||undefined})['catch'](loggerCatch(_0x6732('0x186')));}break;case 0x8:if(_0x4d3050[_0x6732('0x187')]>=_0x456eb7[_0x6732('0x188')]-0x1){return!![];}else{this[_0x6732('0xc4')]({'active':![],'countcongestionretry':_0x4d3050['countcongestionretry']+=0x1,'scheduledat':moment()[_0x6732('0x180')](_0x456eb7['dialCongestionRetryFrequency'],_0x6732('0x182'))[_0x6732('0x71')](_0x6732('0x101')),'ContactId':_0x4d3050[_0x6732('0xd1')],'ListId':_0x4d3050[_0x6732('0xd2')],'VoiceQueueId':_0x4d3050[_0x6732('0xd4')]||undefined,'CampaignId':_0x4d3050[_0x6732('0x11c')]||undefined})[_0x6732('0xba')](loggerCatch(_0x6732('0x189')));}break;default:return!![];}};Dialer['prototype'][_0x6732('0x18a')]=function(_0x48d541,_0x1ac29d,_0x49fb1f){var _0x80e890=this;var _0x1985fc=new History(_0x48d541);return new BPromise(function(_0x113bc0,_0x20fa0e){if(_['isUndefined'](_0x1ac29d)&&_0x6732('0x18b')!==typeof _0x1ac29d){return _0x20fa0e(msgResponse(_0x6732('0x18c'),_0x6732('0x13b'),_0x6732('0x18d')));}if(_[_0x6732('0x37')](_0x49fb1f)&&_0x6732('0x18b')!==typeof _0x49fb1f){return _0x20fa0e(msgResponse(_0x6732('0x18c'),_0x6732('0x13b'),_0x6732('0x18e')));}switch(_0x49fb1f[_0x6732('0x18f')]){case'0':_0x1ac29d[_0x6732('0x190')]+=0x1;_0x1985fc[_0x6732('0xa5')]=0x0;_0x1985fc[_0x6732('0xa6')]=_0x6732('0x191');_0x80e890[_0x6732('0xcc')](_0x1985fc)['catch'](loggerCatch(_0x6732('0x192')));if(_0x80e890[_0x6732('0x193')](0x0,_0x48d541,_0x1ac29d)){if(_0x1985fc[_0x6732('0x184')]+_0x1985fc[_0x6732('0x187')]+_0x1985fc[_0x6732('0x17d')]>=_0x1ac29d[_0x6732('0x17e')]){_0x80e890[_0x6732('0x194')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x195'));}else{_0x80e890[_0x6732('0x196')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x195'));}}break;case'3':_0x1ac29d['outboundNoAnswerCallsDay']+=0x1;_0x1985fc[_0x6732('0xa5')]=0x3;_0x1985fc['statedesc']=_0x6732('0x197');_0x1985fc['countnoanswerretry']+=0x1;_0x1985fc[_0x6732('0x198')]+=0x1;_0x80e890[_0x6732('0xcc')](_0x1985fc)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x80e890['checkRetriveMax'](0x3,_0x48d541,_0x1ac29d)){if(_0x1985fc['countnoanswerretry']>=_0x1ac29d['dialNoAnswerMaxRetry']){_0x80e890[_0x6732('0x196')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x199'));}else{_0x80e890['stateGlobal'](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x199'));}}break;case'5':_0x1ac29d[_0x6732('0x5a')]+=0x1;_0x1985fc[_0x6732('0xa5')]=0x5;_0x1985fc[_0x6732('0xa6')]=_0x6732('0x19a');_0x1985fc['countbusyretry']+=0x1;_0x1985fc[_0x6732('0x198')]+=0x1;_0x80e890[_0x6732('0xcc')](_0x1985fc)[_0x6732('0xba')](loggerCatch(_0x6732('0x19b')));if(_0x80e890[_0x6732('0x193')](0x5,_0x48d541,_0x1ac29d)){if(_0x1985fc[_0x6732('0x184')]>=_0x1ac29d[_0x6732('0x185')]){_0x80e890[_0x6732('0x196')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x19c'));}else{_0x80e890[_0x6732('0x194')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x6732('0x19c'));}}break;case'8':_0x1ac29d[_0x6732('0x5b')]+=0x1;_0x1985fc['state']=0x8;_0x1985fc[_0x6732('0xa6')]='Congestion';_0x1985fc['countcongestionretry']+=0x1;_0x1985fc[_0x6732('0x198')]+=0x1;_0x80e890['createHistory'](_0x1985fc)[_0x6732('0xba')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x80e890['checkRetriveMax'](0x8,_0x48d541,_0x1ac29d)){if(_0x1985fc[_0x6732('0x187')]>=_0x1ac29d[_0x6732('0x188')]){_0x80e890[_0x6732('0x196')](_0x1985fc,_0x113bc0,_0x20fa0e,'reason\x208\x20congestion');}else{_0x80e890[_0x6732('0x194')](_0x1985fc,_0x113bc0,_0x20fa0e,'reason\x208\x20congestion');}}break;default:_0x1ac29d[_0x6732('0x61')]+=0x1;_0x1985fc[_0x6732('0xa5')]=0xc;_0x1985fc[_0x6732('0xa6')]=_0x49fb1f['reason'];_0x80e890['createHistory'](_0x1985fc)[_0x6732('0xba')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x80e890['checkRetriveMax'](_0x49fb1f[_0x6732('0x18f')],_0x48d541,_0x1ac29d)){if(_0x1985fc['countbusyretry']+_0x1985fc[_0x6732('0x187')]+_0x1985fc[_0x6732('0x17d')]>=_0x1ac29d[_0x6732('0x17e')]){_0x80e890['stateGlobal'](_0x1985fc,_0x113bc0,_0x20fa0e,_0x49fb1f[_0x6732('0x18f')]);}else{_0x80e890[_0x6732('0x196')](_0x1985fc,_0x113bc0,_0x20fa0e,_0x49fb1f[_0x6732('0x18f')]);}}}});};Dialer[_0x6732('0xa9')]['stateGlobal']=function(_0x1ae91e,_0xe8d08b,_0x5b0023,_0x3a8193){var _0x466d8f=new Final(_0x1ae91e);_0x466d8f[_0x6732('0xa5')]=0xf;_0x466d8f[_0x6732('0xa6')]=_0x6732('0x19d');this['createStateFinal'](_0x466d8f,_0xe8d08b,_0x5b0023,_0x3a8193);};Dialer[_0x6732('0xa9')][_0x6732('0x196')]=function(_0x5bd2ad,_0xab56b8,_0x47fc04,_0x135e15){this['moveContactManagedDialer'](_0x5bd2ad)[_0x6732('0xbd')](function(_0x40190c){return _0xab56b8(msgResponse(_0x6732('0x18c'),'Success',_0x135e15));})['catch'](function(_0x3cb43a){return _0x47fc04(msgResponse(_0x6732('0x19e'),_0x6732('0x13b'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x6732('0x8')]=function(_0x1edea5){var _0x204b4a=this;var _0x10511a=_0x1edea5[_0x6732('0x19f')]/0x64;var _0x569de5=_0x1edea5['outboundDropCallsDayTimeout']/(_0x1edea5[_0x6732('0x106')]+_0x1edea5[_0x6732('0x58')]);var _0x13bda0=Math[_0x6732('0x1a0')](_0x1edea5[_0x6732('0x67')]*(_0x1edea5[_0x6732('0x1a1')]/0x64));var _0x3379b4=Math[_0x6732('0x1a0')](_0x1edea5['predictiveIntervalAvailable']*(_0x1edea5[_0x6732('0x1a2')]/0x64));var _0x3e746e=_0x1edea5['available']+_0x1edea5[_0x6732('0x9d')];var _0x1ce5a0=Math[_0x6732('0x1a3')](_0x1edea5['erlangCalls']*_0x1edea5[_0x6732('0x6a')]*_0x1edea5['predictiveIntervalHitRate']*_0x1edea5[_0x6732('0x1a4')]);if(_[_0x6732('0x37')](_0x1edea5[_0x6732('0x26')])){if(!_[_0x6732('0x37')](_0x1edea5[_0x6732('0x6c')])){_0x1edea5[_0x6732('0x6c')]=undefined;loggerPredictive[_0x6732('0x90')]('[startMethodPredictive][StartProgressive]',_0x6732('0x1a5'));}if(!_[_0x6732('0x37')](_0x1edea5[_0x6732('0x8a')])){loggerPredictive[_0x6732('0x90')](_0x6732('0x1a6'),_0x6732('0x1a7'));clearInterval(_0x1edea5['handlePredictive']);_0x1edea5[_0x6732('0x8a')]=undefined;}_0x1edea5['startProgressive']=moment()[_0x6732('0x71')](_0x6732('0x101'));loggerPredictive[_0x6732('0x76')](_0x1edea5[_0x6732('0x39')],_0x6732('0x1a8'),_0x1edea5[_0x6732('0x26')]);this['handlePower'](_0x1edea5,0x1);}else if(ifInterval(_0x1edea5[_0x6732('0x1a9')],_0x1edea5[_0x6732('0x26')])){this[_0x6732('0x140')](_0x1edea5,0x1);loggerPredictiveCalls[_0x6732('0x76')]('[startMethodPredictive][StartProgressive][Loop]',_0x1edea5[_0x6732('0x26')],_0x1edea5[_0x6732('0x39')]);_0x1edea5[_0x6732('0x83')]=0x0;_0x1edea5['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x10511a<_0x569de5&&_0x1edea5[_0x6732('0x1aa')]===_0x6732('0x1ab')){freeVariablesPredictive(_0x1edea5);loggerPredictive[_0x6732('0x76')](_0x6732('0x1ac'),'Dropped\x20calls\x20day',_0x569de5,'startProgressive',_0x1edea5['name']);}else if(_0x1ce5a0<_0x1edea5['predictiveIntervalErlangCallsDroppedCalls']&&_0x1edea5[_0x6732('0x1aa')]==='dropRate'){freeVariablesPredictive(_0x1edea5);loggerPredictive[_0x6732('0x76')](_0x6732('0x1ad'),_0x6732('0x1ae'),_0x1ce5a0,_0x6732('0x1af'),_0x1edea5['predictiveIntervalErlangCallsDroppedCalls'],_0x6732('0x26'),_0x1edea5[_0x6732('0x39')]);}else if(!ifInterval(_0x1edea5[_0x6732('0x1a9')],_0x1edea5[_0x6732('0x26')])&&_[_0x6732('0x37')](_0x1edea5[_0x6732('0x6c')])&&!_[_0x6732('0x37')](_0x1edea5['startProgressive'])){_0x1edea5[_0x6732('0x6c')]=moment()['format'](_0x6732('0x101'));loggerPredictive[_0x6732('0x76')](_0x1edea5[_0x6732('0x39')],'started\x20in\x20predictive\x20at',_0x1edea5[_0x6732('0x6c')]);this[_0x6732('0xc1')](_0x1edea5['dialPredictiveInterval'])[_0x6732('0xbd')](this[_0x6732('0x1b0')](_0x1edea5))[_0x6732('0xbd')](mergeDataErlangB(_0x1edea5))[_0x6732('0xbd')](this[_0x6732('0x1b1')](_0x1edea5))[_0x6732('0xba')](loggerCatchPredictive(_0x6732('0x1b2'),_0x1edea5));}else if(!ifInterval(_0x1edea5[_0x6732('0x1a9')],_0x1edea5[_0x6732('0x6c')])){_0x1edea5[_0x6732('0x107')]=0x0;_0x1edea5[_0x6732('0x6c')]=moment()[_0x6732('0x71')](_0x6732('0x101'));loggerPredictive[_0x6732('0x76')](_0x1edea5['name'],_0x6732('0x1b3'),_0x1edea5['startPredictive']);clearInterval(_0x1edea5[_0x6732('0x8a')]);_0x1edea5[_0x6732('0x8a')]=undefined;this['averageHandleTime'](_0x1edea5[_0x6732('0x1a9')])[_0x6732('0xbd')](this[_0x6732('0x1b0')](_0x1edea5))['then'](mergeDataErlangB(_0x1edea5))['then'](this[_0x6732('0x1b1')](_0x1edea5))[_0x6732('0xba')](loggerCatchPredictive(_0x6732('0x1b4'),_0x1edea5));}else if(_0x1edea5[_0x6732('0x67')]&&_0x3e746e<_0x1edea5[_0x6732('0x67')]-_0x3379b4){freeVariablesPredictive(_0x1edea5);loggerPredictive[_0x6732('0x76')](_0x1edea5[_0x6732('0x39')],_0x6732('0x1b5'),_0x3e746e,')\x20are\x20less\x20than\x20threshold\x20(',_0x1edea5[_0x6732('0x67')],'-',_0x3379b4,'=',_0x1edea5[_0x6732('0x67')]-_0x3379b4,')');}else if(_0x1edea5['predictiveIntervalAvailable']&&_0x3e746e>_0x1edea5['predictiveIntervalAvailable']+_0x13bda0){freeVariablesPredictive(_0x1edea5);loggerPredictive[_0x6732('0x76')](_0x1edea5[_0x6732('0x39')],_0x6732('0x1b5'),_0x3e746e,')\x20are\x20more\x20than\x20threshold\x20(',_0x1edea5['predictiveIntervalAvailable'],'+',_0x13bda0,'=',_0x1edea5[_0x6732('0x67')]+_0x13bda0,')');}};Dialer[_0x6732('0xa9')]['getDataPredictive']=function(_0xbffe1b){var _0x3c6290=this;return function(_0x1a9c4f){return new BPromise(function(_0x5e7ebd,_0x1658d8){_[_0x6732('0x87')](_0xbffe1b,_0x1a9c4f[0x0]);if(checkGetDataPredictive(_0x1a9c4f[0x0])){var _0x27cc4a=_0xbffe1b[_0x6732('0x67')]=_0xbffe1b[_0x6732('0x9d')]+_0xbffe1b['available'];var _0x43d008=_0xbffe1b[_0x6732('0x1a9')]*0x3c;var _0x49c0ff=_0x1a9c4f[0x0][_0x6732('0x7e')]+_0x1a9c4f[0x0][_0x6732('0x7d')];var _0x19efbd=(_0x1a9c4f[0x0]['predictiveIntervalAnsweredCalls']+_0x1a9c4f[0x0][_0x6732('0x64')]+_0x1a9c4f[0x0][_0x6732('0x63')])/_0x1a9c4f[0x0]['predictiveIntervalTotalCalls'];_0xbffe1b['predictiveIntervalHitRate']=_0x19efbd>0x0?_0x19efbd:0x1;switch(_0xbffe1b['dialPredictiveOptimization']){case _0x6732('0x1ab'):var _0x14545c=_0xbffe1b[_0x6732('0x19f')]/0x64;return _0x3c6290['abandonmentRate'](_0x27cc4a,_0x43d008,_0x49c0ff,_0x19efbd,_0x14545c)[_0x6732('0xbd')](function(_0x45f42c){return _0x5e7ebd(_0x45f42c);});case _0x6732('0x1b6'):var _0x2445a7=_0xbffe1b[_0x6732('0x19f')]/0x64;return _0x3c6290[_0x6732('0x1b7')](_0x27cc4a,_0x43d008,_0x49c0ff,_0x19efbd,_0x2445a7)[_0x6732('0xbd')](function(_0x2773e0){return _0x5e7ebd(_0x2773e0);});default:return _0x1658d8(msgResponse('[getDataPredictive]',_0x6732('0x13b'),_0x6732('0x1b8')));}}else{return _0x1658d8(msgResponse(_0x6732('0x1b9'),_0x6732('0x13b'),'check\x20failure'));}});};};Dialer[_0x6732('0xa9')][_0x6732('0x1ba')]=function(_0x3c70fd){var _0x1ff160=this;return function(_0x16ded6){return new BPromise(function(_0x1d69f9,_0x4ffcae){_[_0x6732('0x87')](_0x3c70fd,_0x16ded6[0x0]);if(checkGetDataPredictive(_0x16ded6[0x0])){loggerPredictive[_0x6732('0x76')](JSON[_0x6732('0x44')](_0x16ded6[0x0]));if(_0x3c70fd['dialPredictiveOptimization']===_0x6732('0x1ab')){return _0x1ff160['getVoiceQueueRtPauses'](_0x3c70fd['id'])[_0x6732('0xbd')](function(_0xb665f){var _0x3046e1=_0x3c70fd[_0x6732('0x4c')]-_0xb665f[0x0][_0x6732('0x1bb')];var _0x49f9ea=_0x3c70fd[_0x6732('0x1a9')]*0x3c;var _0x4b177b=_0x16ded6[0x0][_0x6732('0x7e')]+_0x16ded6[0x0][_0x6732('0x7d')];var _0x16dc78=(_0x16ded6[0x0]['predictiveIntervalAnsweredCalls']+_0x16ded6[0x0][_0x6732('0x64')]+_0x16ded6[0x0][_0x6732('0x63')])/_0x16ded6[0x0][_0x6732('0x79')];var _0x121a00=_0x3c70fd[_0x6732('0x19f')]/0x64;_0x3c70fd[_0x6732('0x66')]=_0xb665f[0x0][_0x6732('0x1bb')]||0x0;_0x3c70fd[_0x6732('0x1bc')]=_0x16dc78>0x0?_0x16dc78:0x1;return _0x1ff160[_0x6732('0x1bd')](_0x3046e1,_0x49f9ea,_0x4b177b,_0x16dc78,_0x121a00);})[_0x6732('0xbd')](function(_0x587f8f){return _0x1d69f9(_0x587f8f);})[_0x6732('0xba')](function(_0x544159){return _0x4ffcae(msgResponse(_0x6732('0x1be'),'Failure',JSON[_0x6732('0x44')](_0x544159)));});}if(_0x3c70fd[_0x6732('0x1aa')]==='agentBusyFactor'){return _0x1ff160[_0x6732('0xc9')](_0x3c70fd['id'])[_0x6732('0xbd')](function(_0x11e84c){var _0x2b5de0=_0x3c70fd['loggedIn']-_0x11e84c[0x0]['outboundQueuePauses'];var _0x1f7c04=_0x3c70fd[_0x6732('0x1a9')]*0x3c;var _0x3f492d=_0x16ded6[0x0][_0x6732('0x7e')]+_0x16ded6[0x0][_0x6732('0x7d')];var _0x307a15=(_0x16ded6[0x0][_0x6732('0x62')]+_0x16ded6[0x0][_0x6732('0x64')]+_0x16ded6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x16ded6[0x0][_0x6732('0x79')];var _0x22a6da=_0x3c70fd[_0x6732('0x19f')]/0x64;_0x3c70fd['predictiveIntervalPauses']=_0x11e84c[0x0][_0x6732('0x1bb')]||0x0;_0x3c70fd[_0x6732('0x1bc')]=_0x307a15>0x0?_0x307a15:0x1;return _0x1ff160[_0x6732('0x1b7')](_0x2b5de0,_0x1f7c04,_0x3f492d,_0x307a15,_0x22a6da);})['then'](function(_0x555926){return _0x1d69f9(_0x555926);})[_0x6732('0xba')](function(_0x5d876a){return _0x4ffcae(msgResponse(_0x6732('0x1be'),_0x6732('0x13b'),JSON[_0x6732('0x44')](_0x5d876a)));});}}else{return _0x4ffcae(msgResponse('[getDataPredictive]',_0x6732('0x13b'),_0x6732('0x1bf')));}});};};Dialer[_0x6732('0xa9')]['startMethodPredictive']=function(_0xf48cd1){var _0x33cb16=this;return function(){var _0x330da3=0x0;var _0x301175=Math['floor'](_0xf48cd1[_0x6732('0x69')]*0x3e8);if(_0x301175>0x0){_0x301175=_0x301175<0x64?0x64:_0x301175;loggerPredictive['info'](_0xf48cd1['name'],_0x6732('0x1c0'),_0x301175,_0x6732('0x45'));_0xf48cd1['handlePredictive']=setInterval(function(){_0x33cb16[_0x6732('0x8a')](_0xf48cd1);loggerPredictiveCalls[_0x6732('0x76')](_0x6732('0x1c1'),_0x330da3+=0x1);},_0x301175);}else{loggerPredictive[_0x6732('0x76')](_0xf48cd1['name'],_0x6732('0x1c2'));}};};Dialer['prototype'][_0x6732('0x1c3')]=function(_0xdcd340,_0x239781){var _0x4e7494=this;return function(_0x25c73b){if(_[_0x6732('0x41')](_0x25c73b)){if(_[_0x6732('0xaf')](_0x239781['UserId'])||!_0x239781[_0x6732('0x1c4')]){if(_0xdcd340[_0x6732('0x13f')]===_0x6732('0x7')){_0xdcd340['queueStatusComplete']=_[_0x6732('0x37')](_0xdcd340[_0x6732('0x118')])?!![]:_0xdcd340[_0x6732('0x118')];var _0x55fbb5=uuid['v4']();_0x4e7494[_0x6732('0x24')][_0x55fbb5]=new Action(_0xdcd340,_0x239781,_0x55fbb5);loggerBooked[_0x6732('0x76')]('[booked][checkContactBlack]',_0x55fbb5,_0x6732('0x1c5'),JSON[_0x6732('0x44')](_0xdcd340[_0x6732('0x118')]),_0x6732('0x1c6'),_0xdcd340['name']);if(_0xdcd340[_0x6732('0x118')]){_0xdcd340[_0x6732('0x118')]=![];_0x4e7494['queueBooked'][_0x4e7494['actions'][_0x55fbb5][_0x6732('0xb6')]]=[];ami[_0x6732('0xb0')]({'actionid':_0x55fbb5,'action':_0x6732('0x1c7'),'queue':_0xdcd340[_0x6732('0x39')]})['catch'](function(_0x5b77de){_0x4e7494[_0x6732('0xb4')](_0xdcd340);_0x4e7494[_0x6732('0xc4')]({'active':![],'ContactId':_0x4e7494[_0x6732('0x24')][_0x55fbb5][_0x6732('0xd1')],'ListId':_0x4e7494[_0x6732('0x24')][_0x55fbb5][_0x6732('0xd2')],'VoiceQueueId':_0x4e7494[_0x6732('0x24')][_0x55fbb5]['VoiceQueueId']||undefined,'CampaignId':_0x4e7494[_0x6732('0x24')][_0x55fbb5][_0x6732('0x11c')]||undefined})[_0x6732('0xba')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4e7494[_0x6732('0x24')][_0x55fbb5];});}else{loggerBooked[_0x6732('0x76')](_0x6732('0x1c8'),JSON[_0x6732('0x44')](_0xdcd340['queueStatusComplete']),_0x6732('0x1c6'),_0xdcd340[_0x6732('0x39')]);_0x4e7494[_0x6732('0xb4')](_0xdcd340);_0x4e7494[_0x6732('0xc4')]({'active':![],'ContactId':_0x4e7494[_0x6732('0x24')][_0x55fbb5][_0x6732('0xd1')],'ListId':_0x4e7494[_0x6732('0x24')][_0x55fbb5]['ListId'],'VoiceQueueId':_0x4e7494['actions'][_0x55fbb5]['VoiceQueueId']||undefined,'CampaignId':_0x4e7494[_0x6732('0x24')][_0x55fbb5]['CampaignId']||undefined})[_0x6732('0xba')](loggerCatch(_0x6732('0x1c9')));delete _0x4e7494['actions'][_0x55fbb5];}}else{return _0x4e7494[_0x6732('0x1ca')](_0xdcd340,_0x239781);}}else{if(getDiff(_0x239781[_0x6732('0x1cb')])<_0xdcd340[_0x6732('0x1cc')]*0x3c){_0x4e7494[_0x6732('0x1e')][_0x6732('0x11a')](_0x239781['id'])['finally'](function(){_0x4e7494[_0x6732('0xb4')](_0xdcd340);});}else{_0xdcd340[_0x6732('0x1cd')]+=0x1;_0x4e7494[_0x6732('0xb4')](_0xdcd340);if(_0xdcd340[_0x6732('0x1ce')]){_0x4e7494[_0x6732('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x239781[_0x6732('0xd1')],'ListId':_0x239781[_0x6732('0xd2')],'VoiceQueueId':_0x239781[_0x6732('0xd4')]||undefined,'CampaignId':_0x239781[_0x6732('0x11c')]||undefined})[_0x6732('0xba')](loggerCatch(_0x6732('0x1cf')));_0x4e7494[_0x6732('0xcc')](createObjHistory(_0xdcd340,_0x239781,'RECALLINQUEUE',0x17,_0x6732('0x1d0')))['catch'](loggerCatch(_0x6732('0x1d1')));}else{_0x4e7494[_0x6732('0xdc')](createObjHistory(_0xdcd340,_0x239781,_0x6732('0x1d2'),0x16,_0x6732('0x1d3')),'[Originate][HistoryRecallClose][historyCatch]',_0x6732('0x1d4'));}}}}else{_0xdcd340[_0x6732('0x59')]+=0x1;_0x4e7494[_0x6732('0xdc')](createObjHistory(_0xdcd340,_0x239781,_0x6732('0x1d5'),0xd,_0x6732('0x1d6')),_0x6732('0x1d7'),_0x6732('0x1d8'));throw _0x6732('0x1d9');}};};Dialer['prototype'][_0x6732('0x146')]=function(_0x56b1b9){var _0xc06d90=this;var _0x27d4c3=[];var _0x39b1e3=_0x56b1b9['limitCalls']-_0x56b1b9[_0x6732('0x68')]-_0x56b1b9['temp'];emitCampaignSummary(_0x56b1b9);if(_0x39b1e3>0x0){if(_0x39b1e3>this[_0x6732('0x22')]){_0x39b1e3=this['maxNumberOriginate'];}_0x56b1b9[_0x6732('0x1da')]+=_0x39b1e3;this['getContactDialerIvr'](_0x56b1b9['id'],_0x39b1e3,_0x56b1b9[_0x6732('0x1db')])[_0x6732('0xbd')](function(_0x5ab499){_0x56b1b9[_0x6732('0x1da')]-=_0x39b1e3;_0x56b1b9['temp']=_0x56b1b9[_0x6732('0x1da')]>0x0?_0x56b1b9[_0x6732('0x1da')]:0x0;if(!checkContactEmpty(_0x5ab499)){_0x56b1b9[_0x6732('0x3a')]=_0x6732('0x9a');logger[_0x6732('0x76')](_0x6732('0x1dc')+_0x56b1b9['name']);}else{_0x56b1b9[_0x6732('0x68')]+=_0x5ab499[_0x6732('0x93')];_0x56b1b9['message']=_0x6732('0x1dd');for(var _0x1f8ad3=0x0;_0x1f8ad3<_0x5ab499[_0x6732('0x93')];_0x1f8ad3+=0x1){_0x56b1b9['ivrTotalCallsDays']+=0x1;if(_[_0x6732('0xaf')](_0x5ab499[_0x1f8ad3])||_[_0x6732('0xaf')](_0x5ab499[_0x1f8ad3]['Contact'])||_['isNil'](_0x5ab499[_0x1f8ad3][_0x6732('0x152')][_0x6732('0x153')])){_0xc06d90['emptyContact'](_0x6732('0x1de'),_0x56b1b9,_0x5ab499[_0x1f8ad3]);}else{_0xc06d90[_0x6732('0xbf')](_[_0x6732('0x114')](_0x5ab499[_0x1f8ad3],['CampaignId',_0x6732('0x1df')]))['then'](_0xc06d90[_0x6732('0x1c3')](_0x56b1b9,_0x5ab499[_0x1f8ad3]))[_0x6732('0xba')](_0xc06d90[_0x6732('0x1e0')](_0x6732('0x1e1'),_0x56b1b9));}}}})['catch'](loggerGetContactDialer(_0x6732('0x1e2'),_0x56b1b9,_0x39b1e3));}};Dialer[_0x6732('0xa9')][_0x6732('0x140')]=function(_0x1d3421,_0x9ede84){var _0x14b50a=this;var _0x3cc3e6=[];var _0x33a0b9=_0x9ede84>=0x1?_0x9ede84:0x1;var _0x1defd5=[];if(_0x1d3421[_0x6732('0x13f')]===_0x6732('0x7')){_0x33a0b9=0x1;}var _0x33498f=Math[_0x6732('0x1a3')](_0x1d3421[_0x6732('0x4b')]*_0x33a0b9)-_0x1d3421[_0x6732('0x68')]-_0x1d3421['temp'];emitVoiceQueueSummary(_0x1d3421);if(_0x1d3421['dialLimitQueue']>0x0){var _0x52b90e=_0x1d3421['dialLimitQueue']-_0x1d3421[_0x6732('0x68')]-_0x1d3421[_0x6732('0x9d')]-_0x1d3421['temp']-_0x1d3421['pTalking'];if(_0x33498f>_0x52b90e){_0x33498f=_0x52b90e;}}if(_0x33498f>0x0){if(_0x1d3421[_0x6732('0x13f')]==='booked'){_0x33498f=0x1;}if(_0x33498f>this[_0x6732('0x22')]){_0x33498f=this[_0x6732('0x22')];}_0x1d3421['temp']+=_0x33498f;for(var _0x5ae02d in this[_0x6732('0x20')]){if(this[_0x6732('0x20')]['hasOwnProperty'](_0x5ae02d)){if(this[_0x6732('0x20')][_0x5ae02d]['state']===_0x6732('0x1e3')&&this[_0x6732('0x20')][_0x5ae02d][_0x6732('0xb1')]===_0x6732('0xdb')){_0x3cc3e6['push'](this[_0x6732('0x20')][_0x5ae02d]['id']);}}}this[_0x6732('0xc6')](_0x1d3421['id'],_0x3cc3e6,_0x33498f,_0x1d3421['dialOrderByScheduledAt'])[_0x6732('0xbd')](function(_0x1ebf90){_0x1d3421['temp']-=_0x33498f;_0x1d3421[_0x6732('0x1da')]=_0x1d3421[_0x6732('0x1da')]>0x0?_0x1d3421[_0x6732('0x1da')]:0x0;if(!checkContactEmpty(_0x1ebf90)){_0x14b50a['countReScheduled'](_0x1d3421)[_0x6732('0xbd')](sendMessageReschedule(_0x1d3421))[_0x6732('0xba')](loggerCatch(_0x6732('0xbb')));}else{_0x1d3421[_0x6732('0x68')]+=_0x1ebf90['length'];_0x1d3421[_0x6732('0x3a')]=_0x1d3421[_0x6732('0x13f')]==='booked'?_0x6732('0x1e4'):'RUNNING';for(var _0x30f91c=0x0;_0x30f91c<_0x1ebf90['length'];_0x30f91c+=0x1){if(_['isNil'](_0x1ebf90[_0x30f91c])||_['isNil'](_0x1ebf90[_0x30f91c]['Contact'])||_[_0x6732('0xaf')](_0x1ebf90[_0x30f91c]['Contact'][_0x6732('0x153')])){_0x14b50a[_0x6732('0xd0')](_0x6732('0x1de'),_0x1d3421,_0x1ebf90[_0x30f91c]);}else{_0x14b50a[_0x6732('0xbc')](_[_0x6732('0x114')](_0x1ebf90[_0x30f91c],[_0x6732('0xd4'),_0x6732('0x1df')]))[_0x6732('0xbd')](_0x14b50a[_0x6732('0x1c3')](_0x1d3421,_0x1ebf90[_0x30f91c]))[_0x6732('0xba')](_0x14b50a['loggerHandler'](_0x6732('0x1de'),_0x1d3421));}}}})[_0x6732('0xba')](loggerGetContactDialer(_0x6732('0x1e5'),_0x1d3421,_0x33498f));}};Dialer['prototype'][_0x6732('0x8a')]=function(_0x4cf67b){var _0x56e680=this;if(_0x4cf67b['dialLimitQueue']>0x0){var _0x4c94f0=_0x4cf67b[_0x6732('0x1e6')]-_0x4cf67b[_0x6732('0x68')]-_0x4cf67b['talking'];if(_0x4c94f0>0x0){this[_0x6732('0x1e7')](_0x4cf67b);}else{loggerPredictiveCalls[_0x6732('0x76')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x4cf67b);}};Dialer[_0x6732('0xa9')][_0x6732('0x1e7')]=function(_0x3eb4a9){var _0x4ae3d3=this;var _0x1bed42=[];_0x3eb4a9[_0x6732('0x68')]+=0x1;for(var _0x548029 in this[_0x6732('0x20')]){if(this[_0x6732('0x20')]['hasOwnProperty'](_0x548029)){if(this[_0x6732('0x20')][_0x548029][_0x6732('0xa5')]===_0x6732('0x1e3')&&this[_0x6732('0x20')][_0x548029]['status']==='reachable'){_0x1bed42[_0x6732('0x113')](this[_0x6732('0x20')][_0x548029]['id']);}}}this[_0x6732('0xc6')](_0x3eb4a9['id'],_0x1bed42,0x1,_0x3eb4a9[_0x6732('0x1db')])[_0x6732('0xbd')](function(_0x30bc5c){if(!checkContactEmpty(_0x30bc5c)){checkContactLowerLimitOriginate(_0x3eb4a9,0x1,0x0);_0x4ae3d3[_0x6732('0xb8')](_0x3eb4a9)[_0x6732('0xbd')](sendMessageReschedule(_0x3eb4a9))[_0x6732('0xba')](loggerCatch(_0x6732('0xbb')));}else{_0x3eb4a9[_0x6732('0x3a')]=_0x6732('0x1dd');if(_['isNil'](_0x30bc5c[0x0])||_[_0x6732('0xaf')](_0x30bc5c[0x0][_0x6732('0x152')])||_[_0x6732('0xaf')](_0x30bc5c[0x0][_0x6732('0x152')]['phone'])){_0x4ae3d3['emptyContact'](_0x6732('0x1de'),_0x3eb4a9,_0x30bc5c[0x0]);}else{_0x4ae3d3[_0x6732('0xbc')](_['pick'](_0x30bc5c[0x0],[_0x6732('0xd4'),_0x6732('0x1df')]))[_0x6732('0xbd')](_0x4ae3d3['checkContactBlack'](_0x3eb4a9,_0x30bc5c[0x0]))['catch'](_0x4ae3d3[_0x6732('0x1e0')](_0x6732('0x1e8'),_0x3eb4a9));}}})[_0x6732('0xba')](loggerGetContactDialer(_0x6732('0x1e9'),_0x3eb4a9,0x1));emitVoiceQueueSummary(_0x3eb4a9);};Dialer[_0x6732('0xa9')]['abandonmentRate']=function(_0x11ae50,_0x29adcb,_0x18a07f,_0x4255e3,_0x5b9005,_0x1bcdce){loggerPredictive[_0x6732('0x76')](_0x6732('0x1ea'));loggerPredictive[_0x6732('0x76')](_0x6732('0x1eb'),_0x11ae50);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x29adcb);loggerPredictive['info'](_0x6732('0x1ec'),_0x18a07f);loggerPredictive[_0x6732('0x76')](_0x6732('0x1ed'),_0x4255e3);loggerPredictive[_0x6732('0x76')](_0x6732('0x1ee'),_0x5b9005);loggerPredictive[_0x6732('0x76')]('---------------------------');return new BPromise(function(_0xaebb39,_0x5e7d19){if(_0x11ae50<=0x0||isNaN(_0x11ae50)){return _0x5e7d19(msgResponse('[abandonmentRate]',_0x6732('0x43'),_0x6732('0x1ef')+_0x11ae50));}if(_0x18a07f<=0x0||isNaN(_0x18a07f)){return _0x5e7d19(msgResponse(_0x6732('0x1f0'),_0x6732('0x43'),'Ts\x20=\x20'+_0x18a07f));}if(_0x4255e3<=0x0||isNaN(_0x4255e3)){return _0x5e7d19(msgResponse(_0x6732('0x1f0'),_0x6732('0x43'),_0x6732('0x1f1')+_0x4255e3));}if(_0x29adcb<=0x0||isNaN(_0x29adcb)){return _0x5e7d19(msgResponse(_0x6732('0x1f0'),_0x6732('0x43'),_0x6732('0x1f2')+_0x29adcb));}if(_0x5b9005<=0x0||isNaN(_0x5b9005)){return _0x5e7d19(msgResponse(_0x6732('0x1f0'),_0x6732('0x43'),'Amax\x20=\x20'+_0x5b9005));}_0x1bcdce=_0x1bcdce||0x0;var _0x59ae2c=0x1/_0x18a07f;var _0x53dce6=0x0;var _0x3300d4=0x0;var _0x75d74a=0x0;var _0x2a0b5b=0x0;for(var _0x112ca9=0x0;_0x75d74a<_0x5b9005;_0x112ca9+=0x1){_0x3300d4=_0x112ca9/_0x29adcb;_0x53dce6=(_0x4255e3*_0x3300d4+_0x1bcdce)/_0x59ae2c;_0x75d74a=erlangb(_0x53dce6,_0x11ae50);_0x2a0b5b=_0x53dce6/_0x11ae50*(0x1-erlangb(_0x53dce6,_0x11ae50));}return _0xaebb39({'erlangCalls':_0x112ca9,'erlangCallToSecond':_0x29adcb/_0x112ca9,'erlangAbandonmentRate':_0x75d74a,'erlangBusyFactor':_0x2a0b5b});});};Dialer['prototype'][_0x6732('0x1b7')]=function(_0x1b0d6d,_0x35f581,_0x482afb,_0x354a05,_0x49b6d4,_0xb4f579){loggerPredictive[_0x6732('0x76')](_0x6732('0x1f3'));loggerPredictive[_0x6732('0x76')](_0x6732('0x1eb'),_0x1b0d6d);loggerPredictive[_0x6732('0x76')](_0x6732('0x1f4'),_0x35f581);loggerPredictive['info'](_0x6732('0x1ec'),_0x482afb);loggerPredictive[_0x6732('0x76')](_0x6732('0x1ed'),_0x354a05);loggerPredictive[_0x6732('0x76')](_0x6732('0x1f5'),_0x49b6d4);loggerPredictive[_0x6732('0x76')](_0x6732('0x86'));return new BPromise(function(_0x324b01,_0x251c99){if(_0x1b0d6d<=0x0||isNaN(_0x1b0d6d)){return _0x251c99(msgResponse(_0x6732('0x1f6'),_0x6732('0x43'),_0x6732('0x1ef')+_0x1b0d6d));}if(_0x482afb<=0x0||isNaN(_0x482afb)){return _0x251c99(msgResponse('[busyFactor]',_0x6732('0x43'),_0x6732('0x1f7')+_0x482afb));}if(_0x354a05<=0x0||isNaN(_0x354a05)){return _0x251c99(msgResponse('[busyFactor]','Error',_0x6732('0x1f1')+_0x354a05));}if(_0x35f581<=0x0||isNaN(_0x35f581)){return _0x251c99(msgResponse(_0x6732('0x1f6'),'Error',_0x6732('0x1f2')+_0x35f581));}if(_0x49b6d4<=0x0||isNaN(_0x49b6d4)){return _0x251c99(msgResponse(_0x6732('0x1f6'),_0x6732('0x43'),_0x6732('0x1f8')+_0x49b6d4));}_0xb4f579=_0xb4f579||0x0;var _0x410438=0x1/_0x482afb;var _0x44122a=0x0;var _0x3b5ca0=0x0;var _0x1a4848=0x0;var _0x1e2450=0x0;for(var _0x4f16f6=0x0;_0x1e2450<_0x49b6d4;_0x4f16f6+=0x1){_0x3b5ca0=_0x4f16f6/_0x35f581;_0x44122a=(_0x354a05*_0x3b5ca0+_0xb4f579)/_0x410438;_0x1a4848=erlangb(_0x44122a,_0x1b0d6d);_0x1e2450=_0x44122a/_0x1b0d6d*(0x1-erlangb(_0x44122a,_0x1b0d6d));}return _0x324b01({'erlangCalls':_0x4f16f6,'erlangCallToSecond':_0x35f581/_0x4f16f6,'erlangAbandonmentRate':_0x1a4848,'erlangBusyFactor':_0x1e2450});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index cceaa8e..0ff6d86 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 _0x41f9=['originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime','queue','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x52ded2,_0x12f434){var _0x2675fc=function(_0x5d5761){while(--_0x5d5761){_0x52ded2['push'](_0x52ded2['shift']());}};_0x2675fc(++_0x12f434);}(_0x41f9,0x111));var _0x941f=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x41f9[_0x68c979];return _0x4f0001;};'use strict';var util=require(_0x941f('0x0'));var _=require('lodash');var moment=require(_0x941f('0x1'));function getSeconds(_0x116ee7,_0x483a52){var _0x4c0387=moment(_0x116ee7)[_0x941f('0x2')](0x0);var _0xc5067f=moment(_0x483a52)[_0x941f('0x2')](0x0);return _0x4c0387[_0x941f('0x3')](_0xc5067f,_0x941f('0x4'));}function QueueCallerAbandon(_0x4ae056,_0x322f08){this['scheduledat']=_0x4ae056[_0x941f('0x5')];this['type']=_0x4ae056['type'];this[_0x941f('0x6')]=_0x4ae056[_0x941f('0x7')]===_0x941f('0x8')?'queue':_0x4ae056[_0x941f('0x7')];this['countbusyretry']=_0x4ae056[_0x941f('0x9')];this['countcongestionretry']=_0x4ae056[_0x941f('0xa')];this[_0x941f('0xb')]=_0x4ae056[_0x941f('0xb')];this['countglobal']=_0x4ae056[_0x941f('0x9')]+_0x4ae056['countcongestionretry']+_0x4ae056[_0x941f('0xb')];this[_0x941f('0xc')]=_0x322f08[_0x941f('0xc')];this[_0x941f('0xd')]=_0x4ae056[_0x941f('0xe')];this['calleridnum']=_0x4ae056[_0x941f('0xf')];this[_0x941f('0x10')]=_0x4ae056['starttime'];this[_0x941f('0x11')]=_0x4ae056[_0x941f('0x11')];this[_0x941f('0x12')]=_0x4ae056['droptime'];this[_0x941f('0x13')]=this[_0x941f('0x12')];this['ringtime']=getSeconds(_0x4ae056['responsetime'],_0x4ae056['starttime']);this[_0x941f('0x14')]=getSeconds(this[_0x941f('0x12')],_0x4ae056['responsetime']);this[_0x941f('0x15')]=0x0;this[_0x941f('0x16')]=_0x322f08['queue'];this['membername']=_0x322f08['connectedlinename'];this[_0x941f('0x17')]=_0x322f08[_0x941f('0x17')];this['callback']=_0x4ae056['callback'];this[_0x941f('0x18')]=_0x4ae056[_0x941f('0x18')];this[_0x941f('0x19')]=_0x4ae056[_0x941f('0x19')];this[_0x941f('0x1a')]=_0x4ae056[_0x941f('0x1a')];this[_0x941f('0x1b')]=_0x4ae056[_0x941f('0x1b')];this[_0x941f('0x1c')]=_0x4ae056[_0x941f('0x1c')];this[_0x941f('0x1d')]=_0x4ae056[_0x941f('0x1d')];this['VoiceQueueId']=_0x4ae056[_0x941f('0x1e')];this[_0x941f('0x1f')]=_0x4ae056[_0x941f('0x1f')];this['originatecalleridnum']=_0x4ae056[_0x941f('0x20')]||'';this[_0x941f('0x21')]=_0x4ae056[_0x941f('0x21')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xe6d3=['scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds'];(function(_0xe1c87f,_0x35000d){var _0x2960ae=function(_0x440103){while(--_0x440103){_0xe1c87f['push'](_0xe1c87f['shift']());}};_0x2960ae(++_0x35000d);}(_0xe6d3,0x187));var _0x3e6d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe6d3[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x3e6d('0x0'));var _=require('lodash');var moment=require(_0x3e6d('0x1'));function getSeconds(_0x2fb8c9,_0x1d8658){var _0xd96c72=moment(_0x2fb8c9)[_0x3e6d('0x2')](0x0);var _0x178e7a=moment(_0x1d8658)[_0x3e6d('0x2')](0x0);return _0xd96c72[_0x3e6d('0x3')](_0x178e7a,_0x3e6d('0x4'));}function QueueCallerAbandon(_0x3a5568,_0x4887e2){this[_0x3e6d('0x5')]=_0x3a5568['scheduledat'];this[_0x3e6d('0x6')]=_0x3a5568['type'];this['campaigntype']=_0x3a5568['type']==='outbound'?_0x3e6d('0x7'):_0x3a5568[_0x3e6d('0x6')];this[_0x3e6d('0x8')]=_0x3a5568['countbusyretry'];this[_0x3e6d('0x9')]=_0x3a5568[_0x3e6d('0x9')];this[_0x3e6d('0xa')]=_0x3a5568['countnoanswerretry'];this[_0x3e6d('0xb')]=_0x3a5568[_0x3e6d('0x8')]+_0x3a5568[_0x3e6d('0x9')]+_0x3a5568['countnoanswerretry'];this[_0x3e6d('0xc')]=_0x4887e2[_0x3e6d('0xc')];this[_0x3e6d('0xd')]=_0x3a5568[_0x3e6d('0xe')];this[_0x3e6d('0xf')]=_0x3a5568[_0x3e6d('0x10')];this[_0x3e6d('0x11')]=_0x3a5568[_0x3e6d('0x11')];this[_0x3e6d('0x12')]=_0x3a5568[_0x3e6d('0x12')];this[_0x3e6d('0x13')]=_0x3a5568['droptime'];this['endtime']=this[_0x3e6d('0x13')];this[_0x3e6d('0x14')]=getSeconds(_0x3a5568['responsetime'],_0x3a5568['starttime']);this[_0x3e6d('0x15')]=getSeconds(this[_0x3e6d('0x13')],_0x3a5568['responsetime']);this[_0x3e6d('0x16')]=0x0;this[_0x3e6d('0x7')]=_0x4887e2[_0x3e6d('0x7')];this['membername']=_0x4887e2[_0x3e6d('0x17')];this[_0x3e6d('0x18')]=_0x4887e2[_0x3e6d('0x18')];this[_0x3e6d('0x19')]=_0x3a5568['callback'];this[_0x3e6d('0x1a')]=_0x3a5568[_0x3e6d('0x1a')];this['callbackat']=_0x3a5568[_0x3e6d('0x1b')];this[_0x3e6d('0x1c')]=_0x3a5568[_0x3e6d('0x1c')];this[_0x3e6d('0x1d')]=_0x3a5568[_0x3e6d('0x1d')];this['ListId']=_0x3a5568[_0x3e6d('0x1e')];this[_0x3e6d('0x1f')]=_0x3a5568[_0x3e6d('0x1f')];this['VoiceQueueId']=_0x3a5568['VoiceQueueId'];this[_0x3e6d('0x20')]=_0x3a5568['CampaignId'];this[_0x3e6d('0x21')]=_0x3a5568[_0x3e6d('0x21')]||'';this[_0x3e6d('0x22')]=_0x3a5568[_0x3e6d('0x22')]||'';}module[_0x3e6d('0x23')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 339f273..1a177a6 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 _0xd2f9=['AttachmentId','util','lodash','uniqueid','channel','format','%s/%s/%s','tech','name','fax','localstationid','headerinfo','path'];(function(_0x38d36a,_0x507331){var _0x2fd4e6=function(_0x30a102){while(--_0x30a102){_0x38d36a['push'](_0x38d36a['shift']());}};_0x2fd4e6(++_0x507331);}(_0xd2f9,0x1ef));var _0x9d2f=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xd2f9[_0x17c483];return _0x112bdb;};'use strict';var util=require(_0x9d2f('0x0'));var _=require(_0x9d2f('0x1'));var moment=require('moment');function Action(_0x1807b7,_0x33d09c,_0x4eef18){this[_0x9d2f('0x2')]=_0x1807b7||undefined;this[_0x9d2f('0x3')]=util[_0x9d2f('0x4')](_0x9d2f('0x5'),_0x33d09c[_0x9d2f('0x6')],_0x33d09c['Trunk'][_0x9d2f('0x7')],_0x4eef18[_0x9d2f('0x8')]);this[_0x9d2f('0x9')]=_0x33d09c[_0x9d2f('0x9')];this[_0x9d2f('0xa')]=_0x33d09c[_0x9d2f('0xa')];this[_0x9d2f('0xb')]=_0x4eef18[_0x9d2f('0xb')];this[_0x9d2f('0xc')]=_0x4eef18[_0x9d2f('0xc')];}module['exports']=Action; \ No newline at end of file +var _0x356c=['Trunk','fax','localstationid','headerinfo','path','AttachmentId','exports','util','moment','uniqueid','channel','format','%s/%s/%s'];(function(_0x405143,_0x154178){var _0xe558c1=function(_0x559f4a){while(--_0x559f4a){_0x405143['push'](_0x405143['shift']());}};_0xe558c1(++_0x154178);}(_0x356c,0x173));var _0xc356=function(_0x3cb6e1,_0x24cfe0){_0x3cb6e1=_0x3cb6e1-0x0;var _0x5b30f9=_0x356c[_0x3cb6e1];return _0x5b30f9;};'use strict';var util=require(_0xc356('0x0'));var _=require('lodash');var moment=require(_0xc356('0x1'));function Action(_0x1428d7,_0x449f80,_0x44f85e){this[_0xc356('0x2')]=_0x1428d7||undefined;this[_0xc356('0x3')]=util[_0xc356('0x4')](_0xc356('0x5'),_0x449f80['tech'],_0x449f80[_0xc356('0x6')]['name'],_0x44f85e[_0xc356('0x7')]);this[_0xc356('0x8')]=_0x449f80['localstationid'];this[_0xc356('0x9')]=_0x449f80[_0xc356('0x9')];this[_0xc356('0xa')]=_0x44f85e[_0xc356('0xa')];this[_0xc356('0xb')]=_0x44f85e['AttachmentId'];}module[_0xc356('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 f9a4afd..d1d84a2 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 _0x81d6=['isValid','Trunk\x20Reachable','format','then','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','checkAfterSend','checkTrunk','Trunk'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x81d6,0x169));var _0x681d=function(_0x2564b1,_0x2bb2e0){_0x2564b1=_0x2564b1-0x0;var _0xf9f656=_0x81d6[_0x2564b1];return _0xf9f656;};'use strict';var util=require(_0x681d('0x0'));var _=require('lodash');var BPromise=require(_0x681d('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x681d('0x2'));var tiff2pdf=require(_0x681d('0x3'));var gs=require(_0x681d('0x4'));var logger=require('../../../config/logger')(_0x681d('0x5'));var ami=require(_0x681d('0x6'));var rpcDb=require(_0x681d('0x7'));var Channel=require(_0x681d('0x8'));var ut=require(_0x681d('0x9'));var Action=require(_0x681d('0xa'));var faxAccount=require(_0x681d('0xb'));var attachment=require(_0x681d('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x493ab0){this[_0x681d('0xd')]={};this[_0x681d('0xe')]=_0x493ab0[_0x681d('0xe')];this[_0x681d('0xf')]=_0x493ab0['trunks'];this[_0x681d('0x10')]={};ami['on'](_0x681d('0x11'),this[_0x681d('0x12')]['bind'](this));ami['on'](_0x681d('0x13'),this[_0x681d('0x14')][_0x681d('0x15')](this));ami['on']('newstate',this[_0x681d('0x16')][_0x681d('0x15')](this));ami['on'](_0x681d('0x17'),this[_0x681d('0x18')][_0x681d('0x15')](this));ami['on'](_0x681d('0x19'),this['syncFaxStatus'][_0x681d('0x15')](this));ami['on'](_0x681d('0x1a'),this[_0x681d('0x1b')][_0x681d('0x15')](this));ami['on']('hangup',this[_0x681d('0x1c')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x681d('0x15')](this));}Fax[_0x681d('0x1d')]['syncNewchannel']=function(_0x50d587){if(_0x50d587[_0x681d('0x1e')]===_0x681d('0x1f')){for(var _0x5cc9e8 in this[_0x681d('0xe')]){if(this[_0x681d('0xe')][_0x681d('0x20')](_0x5cc9e8)){if(_0x50d587[_0x681d('0x21')]===this[_0x681d('0xe')][_0x5cc9e8]['localstationid']){this['channels'][_0x50d587['uniqueid']]={};this[_0x681d('0xd')][_0x50d587[_0x681d('0x22')]][_0x681d('0x23')]=_0x50d587['channel'];this[_0x681d('0xd')][_0x50d587['uniqueid']]['id']=this['faxAccounts'][_0x5cc9e8]['id'];this[_0x681d('0xd')][_0x50d587[_0x681d('0x22')]][_0x681d('0x24')]=this[_0x681d('0xe')][_0x5cc9e8][_0x681d('0x24')];logger[_0x681d('0x25')](_0x50d587[_0x681d('0x22')],_0x681d('0x26'));}}}}if(this[_0x681d('0x10')][_0x50d587['uniqueid']]){this[_0x681d('0xd')][_0x50d587[_0x681d('0x22')]]={};this['channels'][_0x50d587['uniqueid']][_0x681d('0x23')]=_0x50d587[_0x681d('0x23')];logger[_0x681d('0x25')](_0x50d587['uniqueid'],_0x681d('0x26'));}};Fax[_0x681d('0x1d')][_0x681d('0x14')]=function(_0x297bc1){if(this[_0x681d('0xd')][_0x297bc1[_0x681d('0x22')]]){for(var _0x15c7f5 in _0x297bc1[_0x681d('0x27')]){if(_0x297bc1['variable'][_0x681d('0x20')](_0x15c7f5)){this[_0x681d('0xd')][_0x297bc1[_0x681d('0x22')]][_0x15c7f5]=_0x297bc1[_0x681d('0x28')];}}}};Fax[_0x681d('0x1d')]['syncNewState']=function(_0xfbaedc){if(this[_0x681d('0xd')][_0xfbaedc[_0x681d('0x22')]]){this[_0x681d('0xd')][_0xfbaedc[_0x681d('0x22')]][_0x681d('0x29')]=_0xfbaedc[_0x681d('0x29')];this[_0x681d('0xd')][_0xfbaedc[_0x681d('0x22')]]['channelstatedesc']=_0xfbaedc[_0x681d('0x2a')];}};Fax[_0x681d('0x1d')][_0x681d('0x18')]=function(_0x55a77e){if(this[_0x681d('0xd')][_0x55a77e[_0x681d('0x22')]]){for(var _0x13c76e in _0x55a77e[_0x681d('0x27')]){if(_0x55a77e[_0x681d('0x27')][_0x681d('0x20')](_0x13c76e)){this['channels'][_0x55a77e[_0x681d('0x22')]][_0x13c76e]=_0x55a77e[_0x681d('0x28')];}}}};Fax[_0x681d('0x1d')][_0x681d('0x2b')]=function(_0x5c86fc){if(this[_0x681d('0xd')][_0x5c86fc['uniqueid']]){this[_0x681d('0xd')][_0x5c86fc[_0x681d('0x22')]][_0x681d('0x2c')]=_0x5c86fc[_0x681d('0x2c')];this['channels'][_0x5c86fc[_0x681d('0x22')]][_0x681d('0x2d')]=_0x5c86fc[_0x681d('0x2d')];this['channels'][_0x5c86fc['uniqueid']][_0x681d('0x2e')]=_0x5c86fc['localstationid'];this[_0x681d('0xd')][_0x5c86fc[_0x681d('0x22')]][_0x681d('0x2f')]=_0x5c86fc['filename'];logger[_0x681d('0x25')](_0x5c86fc[_0x681d('0x22')],_0x681d('0x30'));}};Fax[_0x681d('0x1d')][_0x681d('0x1b')]=function(_0x215f95){var _0xa3a125=this;if(this[_0x681d('0xd')][_0x215f95['uniqueid']]){var _0xa07acd=this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]]['id'];this['channels'][_0x215f95[_0x681d('0x22')]]['remotestationid']=_0x215f95[_0x681d('0x31')];this[_0x681d('0xd')][_0x215f95['uniqueid']][_0x681d('0x32')]=_0x215f95[_0x681d('0x32')];this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]][_0x681d('0x2e')]=_0x215f95[_0x681d('0x2e')];this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]][_0x681d('0x33')]=_0x215f95[_0x681d('0x33')];this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]]['transferrate']=_0x215f95['transferrate'];this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]]['filename']=_0x215f95[_0x681d('0x2f')];this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]][_0x681d('0x34')]=_0x215f95[_0x681d('0x34')];if(this[_0x681d('0xd')][_0x215f95[_0x681d('0x22')]][_0x681d('0x32')]>0x0){tiff2pdf(_0x215f95[_0x681d('0x2f')],_0x681d('0x35'),function(_0x4102a9){logger[_0x681d('0x25')](_0x215f95['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x4102a9['message']);attachment[_0x681d('0x36')]({'name':path[_0x681d('0x37')](_0x215f95[_0x681d('0x2f')])[_0x681d('0x24')],'basename':path[_0x681d('0x37')](_0x215f95[_0x681d('0x2f')])[_0x681d('0x24')]+'.pdf','type':_0x681d('0x38')})['then'](function(_0x367500){faxAccount[_0x681d('0x39')](_0xa07acd,{'from':_0x215f95['calleridnum'],'mapKey':'fax','body':path[_0x681d('0x37')](_0x215f95[_0x681d('0x2f')])[_0x681d('0x24')]+'.pdf','AttachmentId':_0x367500['id']})[_0x681d('0x3a')](function(_0xe4fafd){logger[_0x681d('0x3b')](_0x215f95[_0x681d('0x22')],_0x681d('0x3c'),JSON[_0x681d('0x3d')](_0xe4fafd));});})[_0x681d('0x3a')](function(_0x5e2064){logger[_0x681d('0x3b')](_0x215f95[_0x681d('0x22')],_0x681d('0x3e'),JSON[_0x681d('0x3d')](_0x5e2064));});});}logger['info'](_0x215f95[_0x681d('0x22')],_0x681d('0x3e'));}};Fax[_0x681d('0x1d')][_0x681d('0x3f')]=function(_0x5d1201){if(this[_0x681d('0x10')][_0x5d1201[_0x681d('0x22')]]){_[_0x681d('0x40')](this[_0x681d('0xd')][_0x5d1201[_0x681d('0x22')]],_[_0x681d('0x41')](_0x5d1201,[_0x681d('0x42'),'reason']));}};function updateStatus(_0x3b7cec){if(_0x3b7cec[_0x681d('0x43')]){faxMessage[_0x681d('0x44')](_0x3b7cec['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x311520){ut[_0x681d('0x45')]('[Fax][Message][Error][Updated]',_0x311520);})['catch'](function(_0x5807bb){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5807bb);});}else{ut[_0x681d('0x45')](_0x681d('0x46'));}}Fax[_0x681d('0x1d')][_0x681d('0x47')]=function(_0x536ebc,_0x378dd9,_0x340e36){var _0x21aabf=this;var _0x3fe048={};if(_0x378dd9){_0x3fe048={'read':_0x378dd9};}else{_0x3fe048={'failMessage':_0x340e36};}if(this[_0x681d('0x10')][_0x536ebc]['AttachmentId']){faxMessage[_0x681d('0x44')](this[_0x681d('0x10')][_0x536ebc][_0x681d('0x43')],_0x3fe048)['then'](function(_0xd2a2ea){ut['logger'](_0x681d('0x48'),_0xd2a2ea);})[_0x681d('0x3a')](function(_0x47a09a){ut[_0x681d('0x45')]('[Fax][Message][NoUpdate1]',_0x47a09a);})[_0x681d('0x49')](function(){delete _0x21aabf[_0x681d('0xd')][_0x536ebc];delete _0x21aabf['actions'][_0x536ebc];});}else{ut[_0x681d('0x45')](_0x681d('0x4a'));delete this['channels'][_0x536ebc];delete this[_0x681d('0x10')][_0x536ebc];}};Fax[_0x681d('0x1d')][_0x681d('0x1c')]=function(_0xfd557c){var _0x2a5c4f=this;if(this[_0x681d('0xd')][_0xfd557c[_0x681d('0x22')]]){if(this[_0x681d('0x10')][_0xfd557c[_0x681d('0x22')]]){this[_0x681d('0xd')][_0xfd557c[_0x681d('0x22')]]['id']=this[_0x681d('0x10')][_0xfd557c[_0x681d('0x22')]]['id'];this['channels'][_0xfd557c[_0x681d('0x22')]][_0x681d('0x24')]=this['actions'][_0xfd557c[_0x681d('0x22')]][_0x681d('0x24')];}logger[_0x681d('0x25')](_0xfd557c[_0x681d('0x22')],this[_0x681d('0x10')][_0xfd557c['uniqueid']]?_0x681d('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0x681d('0x3d')](this['channels'][_0xfd557c[_0x681d('0x22')]]));if(this[_0x681d('0x10')][_0xfd557c[_0x681d('0x22')]]){if(this[_0x681d('0xd')][_0xfd557c[_0x681d('0x22')]][_0x681d('0x4c')]>0x0&&this['channels'][_0xfd557c[_0x681d('0x22')]][_0x681d('0x19')]===_0x681d('0x4d')){this[_0x681d('0x47')](_0xfd557c[_0x681d('0x22')],!![]);}else{this[_0x681d('0x47')](_0xfd557c[_0x681d('0x22')],![],this[_0x681d('0xd')][_0xfd557c[_0x681d('0x22')]][_0x681d('0x4e')]?'SENDING\x20FAILED:\x20'+this[_0x681d('0xd')][_0xfd557c[_0x681d('0x22')]][_0x681d('0x4e')]:_0x681d('0x4f'));}}}};Fax['prototype'][_0x681d('0x50')]=function(_0x4c27f0){var _0x3a2805=this;return new BPromise(function(_0x1ced1f,_0x3da74b){_0x3a2805['execOriginate'](_0x4c27f0,_0x3a2805['faxAccounts'][_0x4c27f0[_0x681d('0x51')]])['then'](function(_0x308bad){ut[_0x681d('0x45')](_0x681d('0x52'),_0x308bad);_0x1ced1f(ut[_0x681d('0x53')]('Fax\x20received'));})['catch'](function(_0x880f9d){ut[_0x681d('0x45')]('[Fax][execOriginate][failure]',_0x880f9d);updateStatus(_0x4c27f0);_0x3da74b(ut['message']('Fax\x20failed'));});});};Fax['prototype'][_0x681d('0x54')]=function(_0x238ff9){var _0x53a1e0=this;return new BPromise(function(_0x748254,_0x4d5869){var _0xd67e7b=_0x53a1e0[_0x681d('0x55')](_0x53a1e0[_0x681d('0xe')][_0x238ff9[_0x681d('0x51')]][_0x681d('0x56')],_0x238ff9);if(_0xd67e7b[_0x681d('0x57')]){_0x748254(ut['message'](_0x681d('0x58')));}else{_0x4d5869(ut['message'](_0xd67e7b[_0x681d('0x53')]));}});};function originate(_0x1d7634,_0x190af3,_0x179450){return new BPromise(function(_0x1faa0c,_0x1f81eb){if(_0x179450){var _0x397f38=util[_0x681d('0x59')]('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['parse'](_0x1d7634[_0x681d('0x2')])[_0x681d('0x24')],_0x1d7634[_0x681d('0x2')]);gs['execute'](_0x397f38)[_0x681d('0x5a')](function(){_0x1d7634[_0x681d('0x2')]=util[_0x681d('0x59')]('%s/%s.tif',path[_0x681d('0x37')](_0x1d7634[_0x681d('0x2')])[_0x681d('0x5b')],path[_0x681d('0x37')](_0x1d7634['path'])[_0x681d('0x24')]);_0x190af3[_0x681d('0x5c')]=_0x1d7634[_0x681d('0x2')];ut['logger'](_0x681d('0x5d'),'');ami[_0x681d('0x5e')](ut[_0x681d('0x5f')](_0x1d7634,_0x190af3))[_0x681d('0x5a')](function(_0x55e392){_0x1faa0c(_0x55e392);})[_0x681d('0x3a')](function(_0x2700e0){_0x1f81eb(_0x2700e0);});})[_0x681d('0x3a')](function(_0x6f1fc0){_0x1f81eb(_0x6f1fc0);});}else{ami['Action'](ut[_0x681d('0x5f')](_0x1d7634,_0x190af3))[_0x681d('0x5a')](function(_0x52d494){_0x1faa0c(_0x52d494);})[_0x681d('0x3a')](function(_0x160b7c){_0x1f81eb(_0x160b7c);});}});}Fax[_0x681d('0x1d')][_0x681d('0x60')]=function(_0xdd1394,_0x3e3c9f){var _0x10d437=this;return new BPromise(function(_0x88c5c5,_0x2a3637){var _0xdca42f=uuid['v4']();var _0x5e82df=ut['addVariables'](_0xdd1394,_0x3e3c9f);_0x10d437[_0x681d('0x10')][_0xdca42f]=new Action(_0xdca42f,_0x3e3c9f,_0xdd1394);var _0x32ad5c=_0x10d437['actions'][_0xdca42f];if(path[_0x681d('0x37')](_0xdd1394[_0x681d('0x2')])[_0x681d('0x61')]==='.pdf'){originate(_0x32ad5c,_0x5e82df,!![])['then'](function(_0x185b58){_0x88c5c5(_0x185b58);})[_0x681d('0x3a')](function(_0xaac0d4){_0x2a3637(_0xaac0d4);});}else{originate(_0x32ad5c,_0x5e82df,![])[_0x681d('0x5a')](function(_0x7c12e6){_0x88c5c5(_0x7c12e6);})[_0x681d('0x3a')](function(_0x216152){_0x2a3637(_0x216152);});}});};Fax[_0x681d('0x1d')]['isTrunkReachable']=function(_0x2ad5ab){return!_[_0x681d('0x62')](_0x2ad5ab)&&!_[_0x681d('0x62')](_0x2ad5ab['name'])&&!_[_0x681d('0x62')](_0x2ad5ab[_0x681d('0x63')])&&_0x2ad5ab[_0x681d('0x63')]&&!_[_0x681d('0x62')](this[_0x681d('0xf')][util[_0x681d('0x59')](_0x681d('0x64'),_0x2ad5ab['name'])])&&!_[_0x681d('0x62')](this[_0x681d('0xf')][util[_0x681d('0x59')]('SIP/%s',_0x2ad5ab[_0x681d('0x24')])][_0x681d('0x2d')])&&(this[_0x681d('0xf')][util[_0x681d('0x59')](_0x681d('0x64'),_0x2ad5ab['name'])][_0x681d('0x2d')]==='reachable'||this[_0x681d('0xf')][util[_0x681d('0x59')](_0x681d('0x64'),_0x2ad5ab[_0x681d('0x24')])][_0x681d('0x2d')]===_0x681d('0x65'));};Fax[_0x681d('0x1d')][_0x681d('0x55')]=function(_0x143aa1,_0x4738ab){if(!this[_0x681d('0x66')](_0x143aa1)){ut[_0x681d('0x45')](_0x681d('0x67'),_[_0x681d('0x62')](_0x143aa1)?'':_0x143aa1['name']+_0x681d('0x68'));return{'isValid':![],'message':_0x681d('0x69')};}if(_['isNil'](_0x4738ab[_0x681d('0x5')])){ut[_0x681d('0x45')](_0x681d('0x6a'),JSON[_0x681d('0x3d')](_0x4738ab));return{'isValid':![],'message':_0x681d('0x6b')};}if(_[_0x681d('0x62')](_0x4738ab['path'])){ut[_0x681d('0x45')](_0x681d('0x6c'),JSON['stringify'](_0x4738ab));return{'isValid':![],'message':_0x681d('0x6d')};}return{'isValid':!![],'message':_0x681d('0x6e')};};module[_0x681d('0x6f')]=Fax; \ No newline at end of file +var _0x0fe8=['syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','path','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','syncNewState','bind','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20'];(function(_0x2e3b62,_0x397fa9){var _0x4c41be=function(_0xad5113){while(--_0xad5113){_0x2e3b62['push'](_0x2e3b62['shift']());}};_0x4c41be(++_0x397fa9);}(_0x0fe8,0x139));var _0x80fe=function(_0x6a6bf8,_0x458248){_0x6a6bf8=_0x6a6bf8-0x0;var _0x247657=_0x0fe8[_0x6a6bf8];return _0x247657;};'use strict';var util=require(_0x80fe('0x0'));var _=require(_0x80fe('0x1'));var BPromise=require('bluebird');var uuid=require(_0x80fe('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x80fe('0x3'));var gs=require(_0x80fe('0x4'));var logger=require(_0x80fe('0x5'))(_0x80fe('0x6'));var ami=require(_0x80fe('0x7'));var rpcDb=require(_0x80fe('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x80fe('0x9'));var faxAccount=require(_0x80fe('0xa'));var attachment=require(_0x80fe('0xb'));var faxMessage=require(_0x80fe('0xc'));function Fax(_0x3f0318){this[_0x80fe('0xd')]={};this[_0x80fe('0xe')]=_0x3f0318['faxAccounts'];this[_0x80fe('0xf')]=_0x3f0318[_0x80fe('0xf')];this[_0x80fe('0x10')]={};ami['on'](_0x80fe('0x11'),this[_0x80fe('0x12')]['bind'](this));ami['on'](_0x80fe('0x13'),this[_0x80fe('0x14')]['bind'](this));ami['on']('newstate',this[_0x80fe('0x15')][_0x80fe('0x16')](this));ami['on'](_0x80fe('0x17'),this['syncNewExten'][_0x80fe('0x16')](this));ami['on'](_0x80fe('0x18'),this[_0x80fe('0x19')][_0x80fe('0x16')](this));ami['on'](_0x80fe('0x1a'),this['syncReceiveFax'][_0x80fe('0x16')](this));ami['on'](_0x80fe('0x1b'),this[_0x80fe('0x1c')][_0x80fe('0x16')](this));ami['on'](_0x80fe('0x1d'),this[_0x80fe('0x1e')][_0x80fe('0x16')](this));}Fax[_0x80fe('0x1f')]['syncNewchannel']=function(_0x1853cb){if(_0x1853cb[_0x80fe('0x20')]===_0x80fe('0x21')){for(var _0xf3cf9a in this['faxAccounts']){if(this[_0x80fe('0xe')]['hasOwnProperty'](_0xf3cf9a)){if(_0x1853cb[_0x80fe('0x22')]===this[_0x80fe('0xe')][_0xf3cf9a][_0x80fe('0x23')]){this[_0x80fe('0xd')][_0x1853cb[_0x80fe('0x24')]]={};this[_0x80fe('0xd')][_0x1853cb['uniqueid']][_0x80fe('0x25')]=_0x1853cb['channel'];this['channels'][_0x1853cb['uniqueid']]['id']=this[_0x80fe('0xe')][_0xf3cf9a]['id'];this[_0x80fe('0xd')][_0x1853cb[_0x80fe('0x24')]][_0x80fe('0x26')]=this[_0x80fe('0xe')][_0xf3cf9a][_0x80fe('0x26')];logger['info'](_0x1853cb['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x80fe('0x10')][_0x1853cb[_0x80fe('0x24')]]){this[_0x80fe('0xd')][_0x1853cb['uniqueid']]={};this['channels'][_0x1853cb['uniqueid']][_0x80fe('0x25')]=_0x1853cb[_0x80fe('0x25')];logger[_0x80fe('0x27')](_0x1853cb[_0x80fe('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x80fe('0x1f')][_0x80fe('0x14')]=function(_0x46a3e7){if(this['channels'][_0x46a3e7[_0x80fe('0x24')]]){for(var _0x6f9881 in _0x46a3e7[_0x80fe('0x28')]){if(_0x46a3e7[_0x80fe('0x28')][_0x80fe('0x29')](_0x6f9881)){this[_0x80fe('0xd')][_0x46a3e7[_0x80fe('0x24')]][_0x6f9881]=_0x46a3e7[_0x80fe('0x2a')];}}}};Fax[_0x80fe('0x1f')][_0x80fe('0x15')]=function(_0x29e912){if(this[_0x80fe('0xd')][_0x29e912[_0x80fe('0x24')]]){this[_0x80fe('0xd')][_0x29e912['uniqueid']][_0x80fe('0x2b')]=_0x29e912[_0x80fe('0x2b')];this[_0x80fe('0xd')][_0x29e912[_0x80fe('0x24')]][_0x80fe('0x2c')]=_0x29e912[_0x80fe('0x2c')];}};Fax[_0x80fe('0x1f')][_0x80fe('0x2d')]=function(_0x4872ee){if(this[_0x80fe('0xd')][_0x4872ee['uniqueid']]){for(var _0x3f6344 in _0x4872ee[_0x80fe('0x28')]){if(_0x4872ee[_0x80fe('0x28')][_0x80fe('0x29')](_0x3f6344)){this[_0x80fe('0xd')][_0x4872ee[_0x80fe('0x24')]][_0x3f6344]=_0x4872ee['value'];}}}};Fax[_0x80fe('0x1f')][_0x80fe('0x19')]=function(_0x7c460d){if(this[_0x80fe('0xd')][_0x7c460d[_0x80fe('0x24')]]){this[_0x80fe('0xd')][_0x7c460d[_0x80fe('0x24')]]['operation']=_0x7c460d[_0x80fe('0x2e')];this[_0x80fe('0xd')][_0x7c460d[_0x80fe('0x24')]]['status']=_0x7c460d[_0x80fe('0x2f')];this['channels'][_0x7c460d[_0x80fe('0x24')]][_0x80fe('0x23')]=_0x7c460d['localstationid'];this['channels'][_0x7c460d[_0x80fe('0x24')]]['filename']=_0x7c460d[_0x80fe('0x30')];logger['info'](_0x7c460d[_0x80fe('0x24')],_0x80fe('0x31'));}};Fax['prototype'][_0x80fe('0x32')]=function(_0x3e8a19){var _0x5c06b9=this;if(this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]]){var _0x42d640=this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]]['id'];this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x33')]=_0x3e8a19[_0x80fe('0x33')];this['channels'][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x34')]=_0x3e8a19[_0x80fe('0x34')];this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x23')]=_0x3e8a19['localstationid'];this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x35')]=_0x3e8a19[_0x80fe('0x35')];this['channels'][_0x3e8a19['uniqueid']][_0x80fe('0x36')]=_0x3e8a19['transferrate'];this[_0x80fe('0xd')][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x30')]=_0x3e8a19[_0x80fe('0x30')];this['channels'][_0x3e8a19['uniqueid']][_0x80fe('0x37')]=_0x3e8a19['calleridnum'];if(this['channels'][_0x3e8a19[_0x80fe('0x24')]][_0x80fe('0x34')]>0x0){tiff2pdf(_0x3e8a19[_0x80fe('0x30')],_0x80fe('0x38'),function(_0x31091b){logger[_0x80fe('0x27')](_0x3e8a19[_0x80fe('0x24')],_0x80fe('0x39'),_0x31091b[_0x80fe('0x3a')]);attachment[_0x80fe('0x3b')]({'name':path[_0x80fe('0x3c')](_0x3e8a19[_0x80fe('0x30')])['name'],'basename':path[_0x80fe('0x3c')](_0x3e8a19['filename'])[_0x80fe('0x26')]+_0x80fe('0x3d'),'type':_0x80fe('0x3e')})['then'](function(_0x582c6e){faxAccount[_0x80fe('0x3f')](_0x42d640,{'from':_0x3e8a19[_0x80fe('0x37')],'mapKey':_0x80fe('0x6'),'body':path[_0x80fe('0x3c')](_0x3e8a19[_0x80fe('0x30')])['name']+_0x80fe('0x3d'),'AttachmentId':_0x582c6e['id']})['catch'](function(_0x2774ac){logger['error'](_0x3e8a19[_0x80fe('0x24')],_0x80fe('0x40'),JSON[_0x80fe('0x41')](_0x2774ac));});})['catch'](function(_0x366417){logger['error'](_0x3e8a19[_0x80fe('0x24')],_0x80fe('0x42'),JSON[_0x80fe('0x41')](_0x366417));});});}logger[_0x80fe('0x27')](_0x3e8a19[_0x80fe('0x24')],_0x80fe('0x42'));}};Fax[_0x80fe('0x1f')][_0x80fe('0x1e')]=function(_0x196871){if(this[_0x80fe('0x10')][_0x196871['uniqueid']]){_[_0x80fe('0x43')](this[_0x80fe('0xd')][_0x196871[_0x80fe('0x24')]],_[_0x80fe('0x44')](_0x196871,['response',_0x80fe('0x45')]));}};function updateStatus(_0x233be9){if(_0x233be9[_0x80fe('0x46')]){faxMessage[_0x80fe('0x47')](_0x233be9['AttachmentId'],{'failMessage':_0x80fe('0x48')})[_0x80fe('0x49')](function(_0x59cdbe){ut[_0x80fe('0x4a')]('[Fax][Message][Error][Updated]',_0x59cdbe);})[_0x80fe('0x4b')](function(_0x5f2ce1){ut[_0x80fe('0x4a')](_0x80fe('0x4c'),_0x5f2ce1);});}else{ut['logger'](_0x80fe('0x4d'));}}Fax[_0x80fe('0x1f')][_0x80fe('0x4e')]=function(_0x3737fa,_0x86dbd5,_0xb89dc6){var _0x2668d2=this;var _0x2ed54a={};if(_0x86dbd5){_0x2ed54a={'read':_0x86dbd5};}else{_0x2ed54a={'failMessage':_0xb89dc6};}if(this['actions'][_0x3737fa][_0x80fe('0x46')]){faxMessage[_0x80fe('0x47')](this[_0x80fe('0x10')][_0x3737fa][_0x80fe('0x46')],_0x2ed54a)[_0x80fe('0x49')](function(_0x237abf){ut[_0x80fe('0x4a')](_0x80fe('0x4f'),_0x237abf);})[_0x80fe('0x4b')](function(_0x53283f){ut[_0x80fe('0x4a')](_0x80fe('0x50'),_0x53283f);})[_0x80fe('0x51')](function(){delete _0x2668d2[_0x80fe('0xd')][_0x3737fa];delete _0x2668d2[_0x80fe('0x10')][_0x3737fa];});}else{ut[_0x80fe('0x4a')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x3737fa];delete this[_0x80fe('0x10')][_0x3737fa];}};Fax[_0x80fe('0x1f')][_0x80fe('0x1c')]=function(_0x360df3){var _0x4714f1=this;if(this[_0x80fe('0xd')][_0x360df3['uniqueid']]){if(this[_0x80fe('0x10')][_0x360df3[_0x80fe('0x24')]]){this[_0x80fe('0xd')][_0x360df3['uniqueid']]['id']=this[_0x80fe('0x10')][_0x360df3[_0x80fe('0x24')]]['id'];this['channels'][_0x360df3[_0x80fe('0x24')]][_0x80fe('0x26')]=this['actions'][_0x360df3[_0x80fe('0x24')]][_0x80fe('0x26')];}logger[_0x80fe('0x27')](_0x360df3[_0x80fe('0x24')],this[_0x80fe('0x10')][_0x360df3[_0x80fe('0x24')]]?_0x80fe('0x52'):_0x80fe('0x53'),JSON['stringify'](this[_0x80fe('0xd')][_0x360df3[_0x80fe('0x24')]]));if(this['actions'][_0x360df3[_0x80fe('0x24')]]){if(this[_0x80fe('0xd')][_0x360df3[_0x80fe('0x24')]]['faxpages']>0x0&&this[_0x80fe('0xd')][_0x360df3[_0x80fe('0x24')]][_0x80fe('0x18')]===_0x80fe('0x54')){this[_0x80fe('0x4e')](_0x360df3[_0x80fe('0x24')],!![]);}else{this['updateStatus'](_0x360df3[_0x80fe('0x24')],![],this[_0x80fe('0xd')][_0x360df3[_0x80fe('0x24')]][_0x80fe('0x55')]?'SENDING\x20FAILED:\x20'+this[_0x80fe('0xd')][_0x360df3[_0x80fe('0x24')]][_0x80fe('0x55')]:_0x80fe('0x56'));}}}};Fax[_0x80fe('0x1f')][_0x80fe('0x57')]=function(_0x178012){var _0x41bb76=this;return new BPromise(function(_0x21549a,_0x56f1c6){_0x41bb76['execOriginate'](_0x178012,_0x41bb76[_0x80fe('0xe')][_0x178012[_0x80fe('0x58')]])[_0x80fe('0x49')](function(_0x33bde2){ut['logger']('[Fax][execOriginate][success]',_0x33bde2);_0x21549a(ut[_0x80fe('0x3a')](_0x80fe('0x59')));})[_0x80fe('0x4b')](function(_0xc8e7fb){ut[_0x80fe('0x4a')](_0x80fe('0x5a'),_0xc8e7fb);updateStatus(_0x178012);_0x56f1c6(ut['message'](_0x80fe('0x5b')));});});};Fax['prototype']['checkAfterSend']=function(_0x24868a){var _0x232fe7=this;return new BPromise(function(_0x53dcb9,_0x1a7387){var _0x1a84e8=_0x232fe7[_0x80fe('0x5c')](_0x232fe7['faxAccounts'][_0x24868a[_0x80fe('0x58')]][_0x80fe('0x5d')],_0x24868a);if(_0x1a84e8[_0x80fe('0x5e')]){_0x53dcb9(ut[_0x80fe('0x3a')](_0x80fe('0x5f')));}else{_0x1a7387(ut[_0x80fe('0x3a')](_0x1a84e8[_0x80fe('0x3a')]));}});};function originate(_0x5c82bc,_0x4040b7,_0x2363cc){return new BPromise(function(_0x5527e7,_0x4693f2){if(_0x2363cc){var _0x565753=util[_0x80fe('0x60')](_0x80fe('0x61'),path[_0x80fe('0x3c')](_0x5c82bc['path'])['name'],_0x5c82bc['path']);gs[_0x80fe('0x62')](_0x565753)[_0x80fe('0x49')](function(){_0x5c82bc[_0x80fe('0x63')]=util[_0x80fe('0x60')](_0x80fe('0x64'),path[_0x80fe('0x3c')](_0x5c82bc[_0x80fe('0x63')])[_0x80fe('0x65')],path[_0x80fe('0x3c')](_0x5c82bc[_0x80fe('0x63')])[_0x80fe('0x26')]);_0x4040b7[_0x80fe('0x66')]=_0x5c82bc[_0x80fe('0x63')];ut[_0x80fe('0x4a')](_0x80fe('0x67'),'');ami[_0x80fe('0x68')](ut['variablesAction'](_0x5c82bc,_0x4040b7))['then'](function(_0x3899ff){_0x5527e7(_0x3899ff);})['catch'](function(_0x52abc1){_0x4693f2(_0x52abc1);});})[_0x80fe('0x4b')](function(_0x99bdc0){_0x4693f2(_0x99bdc0);});}else{ami['Action'](ut['variablesAction'](_0x5c82bc,_0x4040b7))[_0x80fe('0x49')](function(_0x324d9e){_0x5527e7(_0x324d9e);})['catch'](function(_0x27278c){_0x4693f2(_0x27278c);});}});}Fax[_0x80fe('0x1f')][_0x80fe('0x69')]=function(_0xdb02a7,_0x3162b1){var _0x394fc6=this;return new BPromise(function(_0x57fbce,_0x58e59f){var _0x1569ac=uuid['v4']();var _0x3d1aaa=ut[_0x80fe('0x6a')](_0xdb02a7,_0x3162b1);_0x394fc6[_0x80fe('0x10')][_0x1569ac]=new Action(_0x1569ac,_0x3162b1,_0xdb02a7);var _0x6161e0=_0x394fc6[_0x80fe('0x10')][_0x1569ac];if(path[_0x80fe('0x3c')](_0xdb02a7[_0x80fe('0x63')])[_0x80fe('0x6b')]==='.pdf'){originate(_0x6161e0,_0x3d1aaa,!![])['then'](function(_0x185834){_0x57fbce(_0x185834);})[_0x80fe('0x4b')](function(_0x4e612c){_0x58e59f(_0x4e612c);});}else{originate(_0x6161e0,_0x3d1aaa,![])[_0x80fe('0x49')](function(_0x3aaab0){_0x57fbce(_0x3aaab0);})[_0x80fe('0x4b')](function(_0x20d5fc){_0x58e59f(_0x20d5fc);});}});};Fax['prototype'][_0x80fe('0x6c')]=function(_0x26da62){return!_[_0x80fe('0x6d')](_0x26da62)&&!_[_0x80fe('0x6d')](_0x26da62['name'])&&!_[_0x80fe('0x6d')](_0x26da62[_0x80fe('0x6e')])&&_0x26da62[_0x80fe('0x6e')]&&!_[_0x80fe('0x6d')](this[_0x80fe('0xf')][util[_0x80fe('0x60')](_0x80fe('0x6f'),_0x26da62[_0x80fe('0x26')])])&&!_[_0x80fe('0x6d')](this[_0x80fe('0xf')][util[_0x80fe('0x60')](_0x80fe('0x6f'),_0x26da62[_0x80fe('0x26')])]['status'])&&(this[_0x80fe('0xf')][util[_0x80fe('0x60')](_0x80fe('0x6f'),_0x26da62[_0x80fe('0x26')])][_0x80fe('0x2f')]===_0x80fe('0x70')||this[_0x80fe('0xf')][util['format']('SIP/%s',_0x26da62['name'])][_0x80fe('0x2f')]===_0x80fe('0x71'));};Fax[_0x80fe('0x1f')][_0x80fe('0x5c')]=function(_0x36a8e0,_0x1a8db4){if(!this['isTrunkReachable'](_0x36a8e0)){ut[_0x80fe('0x4a')](_0x80fe('0x72'),_[_0x80fe('0x6d')](_0x36a8e0)?'':_0x36a8e0[_0x80fe('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x80fe('0x73')};}if(_['isNil'](_0x1a8db4[_0x80fe('0x6')])){ut[_0x80fe('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x1a8db4));return{'isValid':![],'message':_0x80fe('0x74')};}if(_[_0x80fe('0x6d')](_0x1a8db4['path'])){ut[_0x80fe('0x4a')](_0x80fe('0x75'),JSON['stringify'](_0x1a8db4));return{'isValid':![],'message':_0x80fe('0x76')};}return{'isValid':!![],'message':_0x80fe('0x77')};};module[_0x80fe('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 1a8788b..b9f0625 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 _0xb129=['error','notify','resolve','[Notify]\x20','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x7975,_0x3aecc5){var _0x7c7b51=function(_0xe4598){while(--_0xe4598){_0x7975['push'](_0x7975['shift']());}};_0x7c7b51(++_0x3aecc5);}(_0xb129,0x14c));var _0x9b12=function(_0x92c259,_0x34d06f){_0x92c259=_0x92c259-0x0;var _0x5524fb=_0xb129[_0x92c259];return _0x5524fb;};'use strict';var util=require('util');var BPromise=require(_0x9b12('0x0'));var logger=require('../../../config/logger')(_0x9b12('0x1'));var _=require(_0x9b12('0x2'));var faxAccount=require(_0x9b12('0x3'));function loggerCatch(_0x9153c0){return function(_0x355804){logger[_0x9b12('0x4')](_0x9153c0,util['inspect'](_0x355804,{'showHidden':![],'depth':null}));};}exports[_0x9b12('0x5')]=function(_0x2216ed,_0x32f4e5){return BPromise[_0x9b12('0x6')]()['then'](faxAccount[_0x9b12('0x5')](_0x2216ed,_0x32f4e5))['catch'](loggerCatch(_0x9b12('0x7')));}; \ No newline at end of file +var _0x106f=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','bluebird','preview'];(function(_0x3c2cd3,_0x2ebf09){var _0x3139d5=function(_0x3632dd){while(--_0x3632dd){_0x3c2cd3['push'](_0x3c2cd3['shift']());}};_0x3139d5(++_0x2ebf09);}(_0x106f,0x15c));var _0xf106=function(_0x192e06,_0x2cf8a1){_0x192e06=_0x192e06-0x0;var _0x428200=_0x106f[_0x192e06];return _0x428200;};'use strict';var util=require('util');var BPromise=require(_0xf106('0x0'));var logger=require('../../../config/logger')(_0xf106('0x1'));var _=require(_0xf106('0x2'));var faxAccount=require(_0xf106('0x3'));function loggerCatch(_0x32ef9d){return function(_0x17c733){logger[_0xf106('0x4')](_0x32ef9d,util[_0xf106('0x5')](_0x17c733,{'showHidden':![],'depth':null}));};}exports[_0xf106('0x6')]=function(_0x2a654f,_0x25d1c6){return BPromise[_0xf106('0x7')]()[_0xf106('0x8')](faxAccount['notify'](_0x2a654f,_0x25d1c6))['catch'](loggerCatch(_0xf106('0x9')));}; \ 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 78552ae..7ef5e85 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 _0x2818=['execute','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','bluebird','exec'];(function(_0x193cc0,_0x227edc){var _0x53d496=function(_0x3aa19c){while(--_0x3aa19c){_0x193cc0['push'](_0x193cc0['shift']());}};_0x53d496(++_0x227edc);}(_0x2818,0x18c));var _0x8281=function(_0x5f15b9,_0x4585aa){_0x5f15b9=_0x5f15b9-0x0;var _0x4f6499=_0x2818[_0x5f15b9];return _0x4f6499;};'use strict';var util=require(_0x8281('0x0'));var logger=require(_0x8281('0x1'))('fax');var BPromise=require(_0x8281('0x2'));var exec=require('child_process')[_0x8281('0x3')];exports[_0x8281('0x4')]=function(_0x4b8ced){return new BPromise(function(_0x917426,_0x5a2b30){exec(_0x4b8ced,function(_0x5d9b7c,_0x1c0d5d,_0x427556){logger['info'](_0x8281('0x5'),_0x1c0d5d);if(_0x5d9b7c){logger[_0x8281('0x6')](_0x8281('0x5'),_0x8281('0x7'),util['inspect'](_0x5d9b7c,{'showHidden':![],'depth':null}),_0x1c0d5d,_0x427556);_0x5a2b30(_0x5d9b7c);}_0x917426(_0x1c0d5d);});});}; \ No newline at end of file +var _0x9732=['child_process','exec','execute','info','Exec\x20gs','util','../../../../config/logger','bluebird'];(function(_0x1dcf2b,_0x167687){var _0x21d3a6=function(_0x5789af){while(--_0x5789af){_0x1dcf2b['push'](_0x1dcf2b['shift']());}};_0x21d3a6(++_0x167687);}(_0x9732,0x165));var _0x2973=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x9732[_0x45bf86];return _0x1f02b7;};'use strict';var util=require(_0x2973('0x0'));var logger=require(_0x2973('0x1'))('fax');var BPromise=require(_0x2973('0x2'));var exec=require(_0x2973('0x3'))[_0x2973('0x4')];exports[_0x2973('0x5')]=function(_0x3c7e1d){return new BPromise(function(_0x5a5d71,_0x3184f4){exec(_0x3c7e1d,function(_0x57bd74,_0x1a100a,_0x3df3f7){logger[_0x2973('0x6')](_0x2973('0x7'),_0x1a100a);if(_0x57bd74){logger[_0x2973('0x6')](_0x2973('0x7'),'\x20Error\x20:',util['inspect'](_0x57bd74,{'showHidden':![],'depth':null}),_0x1a100a,_0x3df3f7);_0x3184f4(_0x57bd74);}_0x5a5d71(_0x1a100a);});});}; \ 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 205313e..d665c52 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 _0x10b8=['info','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','util','lodash','moment','fax','message','logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x10b8,0x1f4));var _0x810b=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x10b8[_0x12fc8d];return _0x3f9d04;};'use strict';var util=require(_0x810b('0x0'));var _=require(_0x810b('0x1'));var moment=require(_0x810b('0x2'));var logger=require('../../../../config/logger')(_0x810b('0x3'));exports[_0x810b('0x4')]=function(_0x3b0347){return{'message':_0x3b0347};};exports[_0x810b('0x5')]=function(_0x2ac68b,_0x80c3f6){logger[_0x810b('0x6')](_0x2ac68b,util[_0x810b('0x7')](_0x80c3f6,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3abba4,_0x404b8f){var _0x3e1795={'XMF-ECM':_0x404b8f[_0x810b('0x8')],'XMF-HEADERINFO':_0x404b8f[_0x810b('0x9')],'XMF-MINRATE':_0x404b8f[_0x810b('0xa')],'XMF-MAXRATE':_0x404b8f[_0x810b('0xb')],'XMF-MODEM':util[_0x810b('0xc')](_0x810b('0xd'),_0x404b8f[_0x810b('0xe')]),'XMF-GATEWAY':_0x404b8f['gateway'],'XMF-FAXDETECT':_0x404b8f[_0x810b('0xf')],'XMF-T38TIMEOUT':_0x404b8f['t38timeout'],'XMF-LOCALSTATIONID':_0x404b8f[_0x810b('0x10')],'XMF-PATH':_0x3abba4[_0x810b('0x11')]};return _0x3e1795;};exports[_0x810b('0x12')]=function(_0x2a5736,_0x59c123){return{'actionid':_0x2a5736[_0x810b('0x13')],'action':_0x810b('0x14'),'channel':_0x2a5736['channel'],'Exten':_0x810b('0x15'),'Context':_0x810b('0x16'),'Priority':'1','callerid':util[_0x810b('0xc')]('\x22%s\x22\x20<%s>',_0x2a5736[_0x810b('0x9')]?_0x2a5736[_0x810b('0x9')]:'',_0x2a5736[_0x810b('0x10')]),'variable':_0x59c123,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2a5736[_0x810b('0x13')]};}; \ No newline at end of file +var _0xf954=['\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format'];(function(_0x130d60,_0x1c6c40){var _0x78da00=function(_0x44d698){while(--_0x44d698){_0x130d60['push'](_0x130d60['shift']());}};_0x78da00(++_0x1c6c40);}(_0xf954,0x188));var _0x4f95=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0xf954[_0xdf5fc5];return _0x52f5a5;};'use strict';var util=require(_0x4f95('0x0'));var _=require(_0x4f95('0x1'));var moment=require(_0x4f95('0x2'));var logger=require(_0x4f95('0x3'))('fax');exports[_0x4f95('0x4')]=function(_0x1e8a08){return{'message':_0x1e8a08};};exports[_0x4f95('0x5')]=function(_0x31cfc8,_0x298eb8){logger['info'](_0x31cfc8,util[_0x4f95('0x6')](_0x298eb8,{'showHidden':![],'depth':null}));};exports[_0x4f95('0x7')]=function(_0x2d52ff,_0x5aedd5){var _0x310f9d={'XMF-ECM':_0x5aedd5[_0x4f95('0x8')],'XMF-HEADERINFO':_0x5aedd5[_0x4f95('0x9')],'XMF-MINRATE':_0x5aedd5[_0x4f95('0xa')],'XMF-MAXRATE':_0x5aedd5[_0x4f95('0xb')],'XMF-MODEM':util[_0x4f95('0xc')](_0x4f95('0xd'),_0x5aedd5[_0x4f95('0xe')]),'XMF-GATEWAY':_0x5aedd5[_0x4f95('0xf')],'XMF-FAXDETECT':_0x5aedd5[_0x4f95('0x10')],'XMF-T38TIMEOUT':_0x5aedd5[_0x4f95('0x11')],'XMF-LOCALSTATIONID':_0x5aedd5[_0x4f95('0x12')],'XMF-PATH':_0x2d52ff[_0x4f95('0x13')]};return _0x310f9d;};exports[_0x4f95('0x14')]=function(_0x3bc9c1,_0x24851d){return{'actionid':_0x3bc9c1['uniqueid'],'action':_0x4f95('0x15'),'channel':_0x3bc9c1[_0x4f95('0x16')],'Exten':_0x4f95('0x17'),'Context':_0x4f95('0x18'),'Priority':'1','callerid':util[_0x4f95('0xc')](_0x4f95('0x19'),_0x3bc9c1[_0x4f95('0x9')]?_0x3bc9c1[_0x4f95('0x9')]:'',_0x3bc9c1['localstationid']),'variable':_0x24851d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3bc9c1[_0x4f95('0x1a')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e3e1941..d4e6813 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 _0x4065=['log','listen','catch','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x4065,0x1e6));var _0x5406=function(_0x56365b,_0x1d5511){_0x56365b=_0x56365b-0x0;var _0x32f60a=_0x4065[_0x56365b];return _0x32f60a;};'use strict';var BPromise=require(_0x5406('0x0'));var util=require(_0x5406('0x1'));var moment=require(_0x5406('0x2'));var server=require(_0x5406('0x3'));var Realtime=require(_0x5406('0x4'));var Report=require(_0x5406('0x5'));var Acw=require(_0x5406('0x6'));var Trigger=require('./trigger');var Dialer=require(_0x5406('0x7'));var Preview=require(_0x5406('0x8'));var Fax=require(_0x5406('0x9'));var user=require(_0x5406('0xa'));var voiceQueue=require(_0x5406('0xb'));var voiceQueueReport=require(_0x5406('0xc'));var voiceCallReport=require(_0x5406('0xd'));var trunk=require('./rpc/trunk');var trigger=require(_0x5406('0xe'));var template=require(_0x5406('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5406('0x10'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x5406('0x11'));var salesforce=require(_0x5406('0x12'));var sugarcrm=require(_0x5406('0x13'));var freshdesk=require(_0x5406('0x14'));var desk=require(_0x5406('0x15'));var zoho=require(_0x5406('0x16'));var vtiger=require(_0x5406('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x5406('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5406('0x19')](_0x5406('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5406('0x1b')]()['then'](user[_0x5406('0x1c')]())[_0x5406('0x1d')](realtime[_0x5406('0x1e')]())[_0x5406('0x1d')](user[_0x5406('0x1f')]())[_0x5406('0x1d')](realtime[_0x5406('0x20')]())[_0x5406('0x1d')](trunk[_0x5406('0x21')]())[_0x5406('0x1d')](realtime[_0x5406('0x22')]())[_0x5406('0x1d')](voiceQueue[_0x5406('0x23')]())['then'](realtime[_0x5406('0x24')]())[_0x5406('0x1d')](trigger[_0x5406('0x25')]())[_0x5406('0x1d')](realtime['initTriggers']())[_0x5406('0x1d')](template[_0x5406('0x26')]())[_0x5406('0x1d')](realtime[_0x5406('0x27')]())[_0x5406('0x1d')](zendesk[_0x5406('0x28')]())[_0x5406('0x1d')](realtime[_0x5406('0x29')]())[_0x5406('0x1d')](salesforce[_0x5406('0x2a')]())[_0x5406('0x1d')](realtime[_0x5406('0x2b')]())[_0x5406('0x1d')](sugarcrm[_0x5406('0x2c')]())[_0x5406('0x1d')](realtime[_0x5406('0x2d')]())[_0x5406('0x1d')](freshdesk[_0x5406('0x2e')]())[_0x5406('0x1d')](realtime[_0x5406('0x2f')]())[_0x5406('0x1d')](desk[_0x5406('0x30')]())[_0x5406('0x1d')](realtime[_0x5406('0x31')]())[_0x5406('0x1d')](zoho[_0x5406('0x32')]())['then'](realtime['initZohoAccounts']())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0x5406('0x33')]())[_0x5406('0x1d')](servicenow[_0x5406('0x34')]())['then'](realtime[_0x5406('0x35')]())[_0x5406('0x1d')](dynamics365[_0x5406('0x36')]())[_0x5406('0x1d')](realtime[_0x5406('0x37')]())[_0x5406('0x1d')](campaign['getCampaigns']())[_0x5406('0x1d')](realtime[_0x5406('0x38')]())[_0x5406('0x1d')](voiceExtension[_0x5406('0x39')]())['then'](realtime['initVoiceExtensions']())[_0x5406('0x1d')](faxAccount[_0x5406('0x3a')]())[_0x5406('0x1d')](realtime[_0x5406('0x3b')]())[_0x5406('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x5406('0x1b')]()[_0x5406('0x1d')](voiceQueueReport[_0x5406('0x3c')]())[_0x5406('0x1d')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x5406('0x1d')](realtime[_0x5406('0x3d')]())[_0x5406('0x1d')](cmHopperHistory[_0x5406('0x3e')]())[_0x5406('0x1d')](realtime[_0x5406('0x3f')]())[_0x5406('0x1d')](voiceCallReport[_0x5406('0x40')]())[_0x5406('0x1d')](realtime[_0x5406('0x41')]())[_0x5406('0x1d')](function(_0x4468d1){})['catch'](function(_0x368b42){console[_0x5406('0x42')](_0x368b42);});}function main(){return server[_0x5406('0x43')](realtime,preview,fax)[_0x5406('0x1d')](function(_0x51bd36){return initRealtime();})[_0x5406('0x1d')](function(){return initParams();})[_0x5406('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x5406('0x44')](function(_0x5e01e2){console[_0x5406('0x42')](_0x5e01e2);});}main(); \ No newline at end of file +var _0x7f6e=['./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','util'];(function(_0x461d52,_0x43604b){var _0x25d252=function(_0x3bdc91){while(--_0x3bdc91){_0x461d52['push'](_0x461d52['shift']());}};_0x25d252(++_0x43604b);}(_0x7f6e,0x7f));var _0xe7f6=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x7f6e[_0x513aa5];return _0x1a1a7c;};'use strict';var BPromise=require('bluebird');var util=require(_0xe7f6('0x0'));var moment=require('moment');var server=require(_0xe7f6('0x1'));var Realtime=require(_0xe7f6('0x2'));var Report=require(_0xe7f6('0x3'));var Acw=require(_0xe7f6('0x4'));var Trigger=require(_0xe7f6('0x5'));var Dialer=require(_0xe7f6('0x6'));var Preview=require(_0xe7f6('0x7'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xe7f6('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe7f6('0x9'));var trunk=require(_0xe7f6('0xa'));var trigger=require(_0xe7f6('0xb'));var template=require(_0xe7f6('0xc'));var cmHopperHistory=require(_0xe7f6('0xd'));var campaign=require(_0xe7f6('0xe'));var voiceExtension=require(_0xe7f6('0xf'));var faxAccount=require(_0xe7f6('0x10'));var zendesk=require(_0xe7f6('0x11'));var salesforce=require(_0xe7f6('0x12'));var sugarcrm=require(_0xe7f6('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0xe7f6('0x14'));var vtiger=require(_0xe7f6('0x15'));var servicenow=require(_0xe7f6('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe7f6('0x17')](_0xe7f6('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe7f6('0x17')](_0xe7f6('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xe7f6('0x19')](user[_0xe7f6('0x1a')]())['then'](realtime['initAgents']())['then'](user[_0xe7f6('0x1b')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x1c')]())['then'](trunk[_0xe7f6('0x1d')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x1e')]())[_0xe7f6('0x19')](voiceQueue[_0xe7f6('0x1f')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x20')]())[_0xe7f6('0x19')](trigger['getTriggers']())['then'](realtime[_0xe7f6('0x21')]())[_0xe7f6('0x19')](template[_0xe7f6('0x22')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x23')]())[_0xe7f6('0x19')](zendesk[_0xe7f6('0x24')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x25')]())['then'](salesforce['getSalesforceAccounts']())[_0xe7f6('0x19')](realtime[_0xe7f6('0x26')]())['then'](sugarcrm[_0xe7f6('0x27')]())['then'](realtime[_0xe7f6('0x28')]())[_0xe7f6('0x19')](freshdesk[_0xe7f6('0x29')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x2a')]())['then'](desk['getDeskAccounts']())[_0xe7f6('0x19')](realtime[_0xe7f6('0x2b')]())[_0xe7f6('0x19')](zoho[_0xe7f6('0x2c')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x2d')]())[_0xe7f6('0x19')](vtiger[_0xe7f6('0x2e')]())[_0xe7f6('0x19')](realtime['initVtigerAccounts']())[_0xe7f6('0x19')](servicenow[_0xe7f6('0x2f')]())[_0xe7f6('0x19')](realtime['initServicenowAccounts']())[_0xe7f6('0x19')](dynamics365[_0xe7f6('0x30')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x31')]())[_0xe7f6('0x19')](campaign['getCampaigns']())[_0xe7f6('0x19')](realtime[_0xe7f6('0x32')]())[_0xe7f6('0x19')](voiceExtension[_0xe7f6('0x33')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x34')]())['then'](faxAccount['getFaxAccounts']())[_0xe7f6('0x19')](realtime[_0xe7f6('0x35')]())[_0xe7f6('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0xe7f6('0x36')]()[_0xe7f6('0x19')](voiceQueueReport[_0xe7f6('0x37')]())[_0xe7f6('0x19')](realtime['initVoiceQueueReports']())[_0xe7f6('0x19')](cmHopperHistory[_0xe7f6('0x38')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x39')]())[_0xe7f6('0x19')](cmHopperHistory[_0xe7f6('0x3a')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x3b')]())[_0xe7f6('0x19')](voiceCallReport[_0xe7f6('0x3c')]())[_0xe7f6('0x19')](realtime[_0xe7f6('0x3d')]())[_0xe7f6('0x19')](function(_0x2f1ea7){})[_0xe7f6('0x3e')](function(_0x23b2af){console['log'](_0x23b2af);});}function main(){return server[_0xe7f6('0x3f')](realtime,preview,fax)[_0xe7f6('0x19')](function(_0x27aed4){return initRealtime();})[_0xe7f6('0x19')](function(){return initParams();})[_0xe7f6('0x19')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe7f6('0x3e')](function(_0x1e6d1c){console['log'](_0x1e6d1c);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 92d0965..dee2e33 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 _0x53ea=['util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','unknown','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','toNumber','format','status','onhold','stringify','user:%s','emit','user:save','lodash'];(function(_0x28a2d6,_0x539ca8){var _0x3d900f=function(_0x46c0ba){while(--_0x46c0ba){_0x28a2d6['push'](_0x28a2d6['shift']());}};_0x3d900f(++_0x539ca8);}(_0x53ea,0x1c7));var _0xa53e=function(_0x2bd98a,_0x3d0c12){_0x2bd98a=_0x2bd98a-0x0;var _0x330026=_0x53ea[_0x2bd98a];return _0x330026;};'use strict';var _=require(_0xa53e('0x0'));var util=require(_0xa53e('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xa53e('0x2'));var config=require(_0xa53e('0x3'));config[_0xa53e('0x4')]=_[_0xa53e('0x5')](config[_0xa53e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa53e('0x6'))(new Redis(config[_0xa53e('0x4')]));function Agent(_0x350b80){this['id']=_0x350b80['id']||0x0;this[_0xa53e('0x7')]=_0x350b80[_0xa53e('0x7')]||'';this[_0xa53e('0x8')]=_0x350b80[_0xa53e('0x8')]||'';this['accountcode']=_0x350b80[_0xa53e('0x9')]||'';this[_0xa53e('0xa')]=_0x350b80[_0xa53e('0xa')]||'';this[_0xa53e('0xb')]='unknown';this[_0xa53e('0xc')]=0x0;this['status']=_0xa53e('0xd');this[_0xa53e('0xe')]='';this[_0xa53e('0xf')]='';this['mobile']='';this[_0xa53e('0x10')]='';this[_0xa53e('0x11')]=_0x350b80[_0xa53e('0x11')]||![];this[_0xa53e('0x12')]=_0xa53e('0xd');this[_0xa53e('0x13')]=0x0;this[_0xa53e('0x14')]='';this[_0xa53e('0x15')]='';this['onhold']=![];this[_0xa53e('0x16')]=![];this[_0xa53e('0x17')]='';}Agent[_0xa53e('0x18')][_0xa53e('0x19')]=function(_0x22a335){var _0xc6861;if(_0x22a335&&_0x22a335[_0xa53e('0xb')]){_0xc6861=_0x22a335[_0xa53e('0xb')][_0xa53e('0x1a')]();switch(_0xc6861){case'not_inuse':_0xc6861=_0xa53e('0x1b');break;case _0xa53e('0x1c'):_0xc6861=_0xa53e('0x1d');break;}}if(_0xc6861&&this[_0xa53e('0x12')]!==_0xc6861||_0x22a335['statePause']){this[_0xa53e('0x13')]=_[_0xa53e('0x1e')](moment()[_0xa53e('0x1f')]('x'));}if(_0xc6861){this[_0xa53e('0x12')]=_0xc6861;}var _0xe392cf={'id':this['id'],'name':this[_0xa53e('0x7')],'email':this['email'],'accountcode':this[_0xa53e('0x9')],'fullname':this[_0xa53e('0xa')],'state':this[_0xa53e('0xb')],'stateTime':this['stateTime'],'status':this[_0xa53e('0x20')],'address':this['address'],'online':this[_0xa53e('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xa53e('0x13')],'voiceStatusCallerIdNumber':this[_0xa53e('0x14')],'voiceStatusQueue':this[_0xa53e('0x15')],'interface':this[_0xa53e('0x10')],'onhold':this[_0xa53e('0x21')]};var _0x31943e=md5(JSON[_0xa53e('0x22')](_0xe392cf));if(this['md5']!==_0x31943e){this[_0xa53e('0x17')]=_0x31943e;io['to'](util[_0xa53e('0x1f')](_0xa53e('0x23'),_0xe392cf[_0xa53e('0x7')]))[_0xa53e('0x24')](_0xa53e('0x25'),_0xe392cf);}};module['exports']=Agent; \ No newline at end of file +var _0x9ba0=['unknown','stateTime','status','address','phone','mobile','online','voiceStatusTime','voiceStatusQueue','onhold','md5','toLowerCase','not_inuse','idle','inuse','talking','voiceStatus','statePause','toNumber','format','voiceStatusCallerIdNumber','interface','stringify','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state'];(function(_0x303cba,_0x5a151c){var _0x69c7bc=function(_0x407915){while(--_0x407915){_0x303cba['push'](_0x303cba['shift']());}};_0x69c7bc(++_0x5a151c);}(_0x9ba0,0x133));var _0x09ba=function(_0x2dd475,_0x1e81a6){_0x2dd475=_0x2dd475-0x0;var _0x5549ea=_0x9ba0[_0x2dd475];return _0x5549ea;};'use strict';var _=require(_0x09ba('0x0'));var util=require(_0x09ba('0x1'));var moment=require(_0x09ba('0x2'));var md5=require('md5');var Redis=require(_0x09ba('0x3'));var config=require('../../../config/environment');config[_0x09ba('0x4')]=_[_0x09ba('0x5')](config[_0x09ba('0x4')],{'host':_0x09ba('0x6'),'port':0x18eb});var io=require(_0x09ba('0x7'))(new Redis(config[_0x09ba('0x4')]));function Agent(_0x4c011d){this['id']=_0x4c011d['id']||0x0;this[_0x09ba('0x8')]=_0x4c011d[_0x09ba('0x8')]||'';this[_0x09ba('0x9')]=_0x4c011d[_0x09ba('0x9')]||'';this[_0x09ba('0xa')]=_0x4c011d[_0x09ba('0xa')]||'';this[_0x09ba('0xb')]=_0x4c011d['fullname']||'';this[_0x09ba('0xc')]=_0x09ba('0xd');this[_0x09ba('0xe')]=0x0;this[_0x09ba('0xf')]=_0x09ba('0xd');this[_0x09ba('0x10')]='';this[_0x09ba('0x11')]='';this[_0x09ba('0x12')]='';this['interface']='';this[_0x09ba('0x13')]=_0x4c011d[_0x09ba('0x13')]||![];this['voiceStatus']='unknown';this[_0x09ba('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x09ba('0x15')]='';this[_0x09ba('0x16')]=![];this['local']=![];this[_0x09ba('0x17')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x38e3c4){var _0x4ec4b6;if(_0x38e3c4&&_0x38e3c4[_0x09ba('0xc')]){_0x4ec4b6=_0x38e3c4[_0x09ba('0xc')][_0x09ba('0x18')]();switch(_0x4ec4b6){case _0x09ba('0x19'):_0x4ec4b6=_0x09ba('0x1a');break;case _0x09ba('0x1b'):_0x4ec4b6=_0x09ba('0x1c');break;}}if(_0x4ec4b6&&this[_0x09ba('0x1d')]!==_0x4ec4b6||_0x38e3c4[_0x09ba('0x1e')]){this[_0x09ba('0x14')]=_[_0x09ba('0x1f')](moment()[_0x09ba('0x20')]('x'));}if(_0x4ec4b6){this[_0x09ba('0x1d')]=_0x4ec4b6;}var _0x2344bc={'id':this['id'],'name':this[_0x09ba('0x8')],'email':this[_0x09ba('0x9')],'accountcode':this[_0x09ba('0xa')],'fullname':this[_0x09ba('0xb')],'state':this['state'],'stateTime':this[_0x09ba('0xe')],'status':this['status'],'address':this[_0x09ba('0x10')],'online':this[_0x09ba('0x13')],'voiceStatus':this[_0x09ba('0x1d')],'voiceStatusTime':this[_0x09ba('0x14')],'voiceStatusCallerIdNumber':this[_0x09ba('0x21')],'voiceStatusQueue':this[_0x09ba('0x15')],'interface':this[_0x09ba('0x22')],'onhold':this['onhold']};var _0x1cea22=md5(JSON[_0x09ba('0x23')](_0x2344bc));if(this[_0x09ba('0x17')]!==_0x1cea22){this['md5']=_0x1cea22;io['to'](util[_0x09ba('0x20')](_0x09ba('0x24'),_0x2344bc['name']))[_0x09ba('0x25')](_0x09ba('0x26'),_0x2344bc);}};module[_0x09ba('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4f3f372..ae06875 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 _0x0269=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x5c947f,_0x893a76){var _0x3dae19=function(_0x139436){while(--_0x139436){_0x5c947f['push'](_0x5c947f['shift']());}};_0x3dae19(++_0x893a76);}(_0x0269,0x135));var _0x9026=function(_0x3a1afb,_0x22f84e){_0x3a1afb=_0x3a1afb-0x0;var _0x4666c1=_0x0269[_0x3a1afb];return _0x4666c1;};'use strict';function Campaign(_0x1f7233){this['id']=_0x1f7233['id']||0x0;this['name']=_0x1f7233[_0x9026('0x0')]||'';this['type']=_0x1f7233[_0x9026('0x1')]||'campaign';this[_0x9026('0x2')]=0x0;this[_0x9026('0x3')]=0x0;this[_0x9026('0x4')]=0x0;this[_0x9026('0x5')]=0x0;this['message']='';this[_0x9026('0x6')]=!![];this[_0x9026('0x7')]=_0x1f7233['active'];this['limitCalls']=_0x1f7233[_0x9026('0x8')];this[_0x9026('0x9')]=_0x1f7233[_0x9026('0x9')]||null;this[_0x9026('0xa')]=_0x1f7233['dialGlobalInterval']?_0x1f7233[_0x9026('0xa')]:null;this[_0x9026('0xb')]=_0x1f7233[_0x9026('0xb')];this['dialOriginateCallerIdNumber']=_0x1f7233[_0x9026('0xc')];this[_0x9026('0xd')]=_0x1f7233[_0x9026('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x1f7233[_0x9026('0xe')];this['dialCongestionRetryFrequency']=_0x1f7233[_0x9026('0xf')];this[_0x9026('0x10')]=_0x1f7233[_0x9026('0x10')];this[_0x9026('0x11')]=_0x1f7233[_0x9026('0x11')];this[_0x9026('0x12')]=_0x1f7233[_0x9026('0x12')];this['dialNoAnswerRetryFrequency']=_0x1f7233[_0x9026('0x13')];this['dialGlobalMaxRetry']=_0x1f7233[_0x9026('0x14')];this[_0x9026('0x15')]=_0x1f7233[_0x9026('0x15')]||_0x9026('0x16');this[_0x9026('0x17')]=_0x1f7233[_0x9026('0x17')]||undefined;this[_0x9026('0x18')]=_0x1f7233[_0x9026('0x18')]||undefined;this['dialCutDigit']=_0x1f7233[_0x9026('0x19')]||undefined;this[_0x9026('0x1a')]=_0x1f7233['TrunkBackup']?_0x1f7233[_0x9026('0x1a')]:undefined;this[_0x9026('0x1b')]=_0x1f7233[_0x9026('0x1b')]?_0x1f7233[_0x9026('0x1b')]:undefined;this[_0x9026('0x1c')]=_0x1f7233[_0x9026('0x1c')]?_0x1f7233[_0x9026('0x1c')]:undefined;this[_0x9026('0x1d')]=_0x1f7233['SquareProject']?_0x1f7233[_0x9026('0x1d')]:undefined;this['dialQueueProject']=_0x1f7233[_0x9026('0x1d')]?_0x1f7233['SquareProject'][_0x9026('0x0')]:undefined;this[_0x9026('0x1e')]=_0x1f7233[_0x9026('0x1e')]||![];this[_0x9026('0x1f')]=_0x1f7233[_0x9026('0x1f')];this[_0x9026('0x20')]=_0x1f7233[_0x9026('0x20')];this[_0x9026('0x21')]=_0x1f7233[_0x9026('0x21')];this['dialAMDTotalAnalysisTime']=_0x1f7233['dialAMDTotalAnalysisTime'];this[_0x9026('0x22')]=_0x1f7233[_0x9026('0x22')];this[_0x9026('0x23')]=_0x1f7233[_0x9026('0x23')];this[_0x9026('0x24')]=_0x1f7233[_0x9026('0x24')];this[_0x9026('0x25')]=_0x1f7233[_0x9026('0x25')];this[_0x9026('0x26')]=_0x1f7233[_0x9026('0x26')];}module[_0x9026('0x27')]=Campaign; \ No newline at end of file +var _0x9d9b=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x1995af,_0x3e1bab){_0x1995af=_0x1995af-0x0;var _0xffd84b=_0x9d9b[_0x1995af];return _0xffd84b;};'use strict';function Campaign(_0x3f9fd9){this['id']=_0x3f9fd9['id']||0x0;this[_0xb9d9('0x0')]=_0x3f9fd9[_0xb9d9('0x0')]||'';this['type']=_0x3f9fd9[_0xb9d9('0x1')]||'campaign';this[_0xb9d9('0x2')]=0x0;this[_0xb9d9('0x3')]=0x0;this[_0xb9d9('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xb9d9('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xb9d9('0x6')]=_0x3f9fd9[_0xb9d9('0x6')];this['limitCalls']=_0x3f9fd9[_0xb9d9('0x7')];this[_0xb9d9('0x8')]=_0x3f9fd9[_0xb9d9('0x8')]||null;this[_0xb9d9('0x9')]=_0x3f9fd9[_0xb9d9('0x9')]?_0x3f9fd9[_0xb9d9('0x9')]:null;this[_0xb9d9('0xa')]=_0x3f9fd9['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x3f9fd9['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x3f9fd9[_0xb9d9('0xb')]||0x1e;this[_0xb9d9('0xc')]=_0x3f9fd9[_0xb9d9('0xc')];this['dialCongestionRetryFrequency']=_0x3f9fd9[_0xb9d9('0xd')];this[_0xb9d9('0xe')]=_0x3f9fd9['dialBusyMaxRetry'];this[_0xb9d9('0xf')]=_0x3f9fd9['dialBusyRetryFrequency'];this[_0xb9d9('0x10')]=_0x3f9fd9[_0xb9d9('0x10')];this[_0xb9d9('0x11')]=_0x3f9fd9[_0xb9d9('0x11')];this[_0xb9d9('0x12')]=_0x3f9fd9[_0xb9d9('0x12')];this[_0xb9d9('0x13')]=_0x3f9fd9[_0xb9d9('0x13')]||'DESC';this['dialPrefix']=_0x3f9fd9[_0xb9d9('0x14')]||undefined;this[_0xb9d9('0x15')]=_0x3f9fd9[_0xb9d9('0x15')]||undefined;this[_0xb9d9('0x16')]=_0x3f9fd9['dialCutDigit']||undefined;this['TrunkBackup']=_0x3f9fd9[_0xb9d9('0x17')]?_0x3f9fd9['TrunkBackup']:undefined;this['Trunk']=_0x3f9fd9[_0xb9d9('0x18')]?_0x3f9fd9[_0xb9d9('0x18')]:undefined;this[_0xb9d9('0x19')]=_0x3f9fd9['Interval']?_0x3f9fd9[_0xb9d9('0x19')]:undefined;this[_0xb9d9('0x1a')]=_0x3f9fd9['SquareProject']?_0x3f9fd9[_0xb9d9('0x1a')]:undefined;this[_0xb9d9('0x1b')]=_0x3f9fd9['SquareProject']?_0x3f9fd9[_0xb9d9('0x1a')][_0xb9d9('0x0')]:undefined;this['dialAMDActive']=_0x3f9fd9[_0xb9d9('0x1c')]||![];this[_0xb9d9('0x1d')]=_0x3f9fd9[_0xb9d9('0x1d')];this[_0xb9d9('0x1e')]=_0x3f9fd9[_0xb9d9('0x1e')];this[_0xb9d9('0x1f')]=_0x3f9fd9['dialAMDAfterGreetingSilence'];this[_0xb9d9('0x20')]=_0x3f9fd9[_0xb9d9('0x20')];this['dialAMDMinWordLength']=_0x3f9fd9[_0xb9d9('0x21')];this[_0xb9d9('0x22')]=_0x3f9fd9[_0xb9d9('0x22')];this[_0xb9d9('0x23')]=_0x3f9fd9['dialAMDMaximumNumberOfWords'];this[_0xb9d9('0x24')]=_0x3f9fd9[_0xb9d9('0x24')];this[_0xb9d9('0x25')]=_0x3f9fd9[_0xb9d9('0x25')];}module[_0xb9d9('0x26')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d260e16..27cf7b2 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 _0xfd50=['exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','exten','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','transferconnectedlinenum','mohtime'];(function(_0x574d24,_0x5805d8){var _0x598206=function(_0x9dab53){while(--_0x9dab53){_0x574d24['push'](_0x574d24['shift']());}};_0x598206(++_0x5805d8);}(_0xfd50,0x178));var _0x0fd5=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xfd50[_0x5f0089];return _0x193892;};'use strict';function Channel(){this['starttime']=null;this[_0x0fd5('0x0')]='';this[_0x0fd5('0x1')]='';this[_0x0fd5('0x2')]=0x0;this[_0x0fd5('0x3')]='';this[_0x0fd5('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x0fd5('0x5')]=0x0;this[_0x0fd5('0x6')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x0fd5('0x7')]=0x0;this[_0x0fd5('0x8')]=![];this[_0x0fd5('0x9')]=null;this[_0x0fd5('0xa')]=null;this['unmanaged']=![];this[_0x0fd5('0xb')]=![];this[_0x0fd5('0xc')]='';this['lastdata']='';this[_0x0fd5('0xd')]=0x0;this[_0x0fd5('0xe')]=0x0;this[_0x0fd5('0xf')]=0x0;this[_0x0fd5('0x10')]=null;this[_0x0fd5('0x11')]=null;this[_0x0fd5('0x12')]=null;this[_0x0fd5('0x13')]=![];this['monitorFilename']=null;this[_0x0fd5('0x14')]=null;this[_0x0fd5('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x0fd5('0x16')]=undefined;this[_0x0fd5('0x17')]=0x0;}module[_0x0fd5('0x18')]=Channel; \ No newline at end of file +var _0x7753=['context','linkedid','exten','answertime','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode'];(function(_0x2c62dc,_0x596162){var _0x48adec=function(_0xead706){while(--_0xead706){_0x2c62dc['push'](_0x2c62dc['shift']());}};_0x48adec(++_0x596162);}(_0x7753,0xfd));var _0x3775=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x7753[_0x36eaaa];return _0x461349;};'use strict';function Channel(){this[_0x3775('0x0')]=null;this[_0x3775('0x1')]='';this[_0x3775('0x2')]='';this[_0x3775('0x3')]=0x0;this[_0x3775('0x4')]='';this['connectedlinenum']=undefined;this[_0x3775('0x5')]=undefined;this[_0x3775('0x6')]=0x0;this[_0x3775('0x7')]='';this['uniqueid']=0x0;this[_0x3775('0x8')]=0x0;this[_0x3775('0x9')]=0x0;this['answered']=![];this[_0x3775('0xa')]=null;this[_0x3775('0xb')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x3775('0xc')]='';this[_0x3775('0xd')]='';this[_0x3775('0xe')]=0x0;this[_0x3775('0xf')]=0x0;this[_0x3775('0x10')]=0x0;this['type']=null;this[_0x3775('0x11')]=null;this[_0x3775('0x12')]=null;this[_0x3775('0x13')]=![];this[_0x3775('0x14')]=null;this[_0x3775('0x15')]=null;this[_0x3775('0x16')]=[];this['transfercalleridnum']=undefined;this[_0x3775('0x17')]=undefined;this[_0x3775('0x18')]=0x0;}module[_0x3775('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 10a363d..b68cc3d 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 _0x3cbf=['password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x3cbf,0x128));var _0xf3cb=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3cbf[_0x51020b];return _0x371e47;};'use strict';function DeskAccount(_0x1daa2c){this['id']=_0x1daa2c['id']||0x0;this[_0xf3cb('0x0')]=_0x1daa2c['name']||'';this[_0xf3cb('0x1')]=_0x1daa2c[_0xf3cb('0x1')]||'';this[_0xf3cb('0x2')]=_0x1daa2c['remoteUri']||'';this[_0xf3cb('0x3')]=_0x1daa2c['authType']||'';this[_0xf3cb('0x4')]=_0x1daa2c['password']||'';this['consumerKey']=_0x1daa2c[_0xf3cb('0x5')]||'';this[_0xf3cb('0x6')]=_0x1daa2c[_0xf3cb('0x6')]||'';this[_0xf3cb('0x7')]=_0x1daa2c[_0xf3cb('0x7')]||'';this[_0xf3cb('0x8')]=_0x1daa2c['tokenSecret']||'';this['type']=_0x1daa2c['type']||'';this[_0xf3cb('0x9')]=_0x1daa2c[_0xf3cb('0x9')]||'';this[_0xf3cb('0xa')]=_0x1daa2c[_0xf3cb('0xa')]||{};}module[_0xf3cb('0xb')]=DeskAccount; \ No newline at end of file +var _0x0f45=['name','username','remoteUri','authType','consumerKey','token','type','serverUrl','Configurations','exports'];(function(_0x5d7c4b,_0x10fe85){var _0x2d6ddd=function(_0x299aac){while(--_0x299aac){_0x5d7c4b['push'](_0x5d7c4b['shift']());}};_0x2d6ddd(++_0x10fe85);}(_0x0f45,0x1ae));var _0x50f4=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x0f45[_0x11005e];return _0x29338f;};'use strict';function DeskAccount(_0x3ef2af){this['id']=_0x3ef2af['id']||0x0;this[_0x50f4('0x0')]=_0x3ef2af[_0x50f4('0x0')]||'';this[_0x50f4('0x1')]=_0x3ef2af[_0x50f4('0x1')]||'';this[_0x50f4('0x2')]=_0x3ef2af[_0x50f4('0x2')]||'';this[_0x50f4('0x3')]=_0x3ef2af[_0x50f4('0x3')]||'';this['password']=_0x3ef2af['password']||'';this[_0x50f4('0x4')]=_0x3ef2af['consumerKey']||'';this['consumerSecret']=_0x3ef2af['consumerSecret']||'';this[_0x50f4('0x5')]=_0x3ef2af['token']||'';this['tokenSecret']=_0x3ef2af['tokenSecret']||'';this[_0x50f4('0x6')]=_0x3ef2af[_0x50f4('0x6')]||'';this[_0x50f4('0x7')]=_0x3ef2af[_0x50f4('0x7')]||'';this['Configurations']=_0x3ef2af[_0x50f4('0x8')]||{};}module[_0x50f4('0x9')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index cf6a555..a93076f 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 _0x2b19=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x2b19,0x1c8));var _0x92b1=function(_0x1ea055,_0x5ecac9){_0x1ea055=_0x1ea055-0x0;var _0xba85a5=_0x2b19[_0x1ea055];return _0xba85a5;};'use strict';function Dynamics365Account(_0x388544){this['id']=_0x388544['id']||0x0;this[_0x92b1('0x0')]=_0x388544[_0x92b1('0x0')]||'';this[_0x92b1('0x1')]=_0x388544[_0x92b1('0x1')]||'';this[_0x92b1('0x2')]=_0x388544[_0x92b1('0x2')]||'';this[_0x92b1('0x3')]=_0x388544[_0x92b1('0x3')]||'';this['tenantId']=_0x388544[_0x92b1('0x4')]||'';this[_0x92b1('0x5')]=_0x388544[_0x92b1('0x5')]||'';this[_0x92b1('0x6')]=_0x388544[_0x92b1('0x6')]||{};this[_0x92b1('0x7')]=_0x388544[_0x92b1('0x7')]||'';this['Configurations']=_0x388544[_0x92b1('0x8')]||{};}module[_0x92b1('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x2cfd=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x234824,_0xd0c09){var _0x5d002c=function(_0x2330df){while(--_0x2330df){_0x234824['push'](_0x234824['shift']());}};_0x5d002c(++_0xd0c09);}(_0x2cfd,0x9d));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';function Dynamics365Account(_0xdc0fea){this['id']=_0xdc0fea['id']||0x0;this[_0xd2cf('0x0')]=_0xdc0fea[_0xd2cf('0x0')]||'';this[_0xd2cf('0x1')]=_0xdc0fea[_0xd2cf('0x1')]||'';this[_0xd2cf('0x2')]=_0xdc0fea[_0xd2cf('0x2')]||'';this[_0xd2cf('0x3')]=_0xdc0fea[_0xd2cf('0x3')]||'';this[_0xd2cf('0x4')]=_0xdc0fea['tenantId']||'';this[_0xd2cf('0x5')]=_0xdc0fea[_0xd2cf('0x5')]||'';this[_0xd2cf('0x6')]=_0xdc0fea['clientSecret']||{};this[_0xd2cf('0x7')]=_0xdc0fea[_0xd2cf('0x7')]||'';this['Configurations']=_0xdc0fea[_0xd2cf('0x8')]||{};}module[_0xd2cf('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2a09363..e7b0e7f 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 _0xf290=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x42f2dd,_0x4f4e33){var _0x5754e4=function(_0xd9adec){while(--_0xd9adec){_0x42f2dd['push'](_0x42f2dd['shift']());}};_0x5754e4(++_0x4f4e33);}(_0xf290,0xde));var _0x0f29=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf290[_0x101e7b];return _0x4995c0;};'use strict';function FaxAccount(_0x1149f4){this['id']=_0x1149f4['id']||0x0;this[_0x0f29('0x0')]=_0x1149f4['name']||'';this[_0x0f29('0x1')]=_0x1149f4['description'];this[_0x0f29('0x2')]=_0x1149f4[_0x0f29('0x2')];this[_0x0f29('0x3')]=_0x1149f4[_0x0f29('0x3')];this[_0x0f29('0x4')]=_0x1149f4['localstationid'];this[_0x0f29('0x5')]=_0x1149f4['minrate']||0x960;this[_0x0f29('0x6')]=_0x1149f4[_0x0f29('0x6')]||0x3840;this[_0x0f29('0x7')]=_0x1149f4[_0x0f29('0x7')]||_0x0f29('0x8');this[_0x0f29('0x9')]=_0x1149f4[_0x0f29('0x9')]||'no';this[_0x0f29('0xa')]=_0x1149f4[_0x0f29('0xa')]||'no';this[_0x0f29('0xb')]=_0x1149f4[_0x0f29('0xb')]||0x1388;this[_0x0f29('0xc')]=_0x1149f4[_0x0f29('0xc')]||_0x0f29('0xd');this[_0x0f29('0xe')]=_0x1149f4['Trunk']?_0x1149f4[_0x0f29('0xe')]:undefined;this['ListId']=_0x1149f4[_0x0f29('0xf')];this[_0x0f29('0x10')]=_0x1149f4[_0x0f29('0x10')];}module[_0x0f29('0x11')]=FaxAccount; \ No newline at end of file +var _0xb58b=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3497d,_0x5298f4){_0x3497d=_0x3497d-0x0;var _0x1763a9=_0xb58b[_0x3497d];return _0x1763a9;};'use strict';function FaxAccount(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['description'];this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')];this['headerinfo']=_0x250573[_0xbb58('0x3')];this['localstationid']=_0x250573[_0xbb58('0x4')];this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||0x960;this['maxrate']=_0x250573[_0xbb58('0x6')]||0x3840;this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||_0xbb58('0x8');this[_0xbb58('0x9')]=_0x250573[_0xbb58('0x9')]||'no';this[_0xbb58('0xa')]=_0x250573[_0xbb58('0xa')]||'no';this[_0xbb58('0xb')]=_0x250573[_0xbb58('0xb')]||0x1388;this[_0xbb58('0xc')]=_0x250573['tech']||_0xbb58('0xd');this['Trunk']=_0x250573[_0xbb58('0xe')]?_0x250573[_0xbb58('0xe')]:undefined;this[_0xbb58('0xf')]=_0x250573[_0xbb58('0xf')];this['key']=_0x250573[_0xbb58('0x10')];}module[_0xbb58('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 66fe0df..9c3a9b7 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 _0xf7aa=['Configurations','exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0xf7058b,_0x22c9b7){var _0x24cbf0=function(_0x2997ac){while(--_0x2997ac){_0xf7058b['push'](_0xf7058b['shift']());}};_0x24cbf0(++_0x22c9b7);}(_0xf7aa,0x72));var _0xaf7a=function(_0x59cf5f,_0xa7751a){_0x59cf5f=_0x59cf5f-0x0;var _0x17d09a=_0xf7aa[_0x59cf5f];return _0x17d09a;};'use strict';function FreshdeskAccount(_0x1bda43){this['id']=_0x1bda43['id']||0x0;this[_0xaf7a('0x0')]=_0x1bda43[_0xaf7a('0x0')]||'';this[_0xaf7a('0x1')]=_0x1bda43[_0xaf7a('0x1')]||'';this[_0xaf7a('0x2')]=_0x1bda43['token']||'';this[_0xaf7a('0x3')]=_0x1bda43[_0xaf7a('0x3')]||'';this['serverUrl']=_0x1bda43[_0xaf7a('0x4')]||'';this[_0xaf7a('0x5')]=_0x1bda43['Configurations']||{};}module[_0xaf7a('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xa3f7=['exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x242e0b,_0x4869da){var _0x309585=function(_0x4d47b2){while(--_0x4d47b2){_0x242e0b['push'](_0x242e0b['shift']());}};_0x309585(++_0x4869da);}(_0xa3f7,0x151));var _0x7a3f=function(_0x4dabc3,_0x3112c4){_0x4dabc3=_0x4dabc3-0x0;var _0x249fef=_0xa3f7[_0x4dabc3];return _0x249fef;};'use strict';function FreshdeskAccount(_0x1ac664){this['id']=_0x1ac664['id']||0x0;this[_0x7a3f('0x0')]=_0x1ac664[_0x7a3f('0x0')]||'';this[_0x7a3f('0x1')]=_0x1ac664['username']||'';this[_0x7a3f('0x2')]=_0x1ac664[_0x7a3f('0x3')]||'';this['remoteUri']=_0x1ac664[_0x7a3f('0x4')]||'';this[_0x7a3f('0x5')]=_0x1ac664['serverUrl']||'';this['Configurations']=_0x1ac664['Configurations']||{};}module[_0x7a3f('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 7ac7d10..bbcaba4 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 _0x7fe2=['queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercompleteAt','queuecallerexit','originalposition','channel','accountcode','context','priority','holdtime','lastAssignedTo','variables','type','inbound','calleridnum'];(function(_0x328223,_0x8195fb){var _0x2c70bf=function(_0x44395a){while(--_0x44395a){_0x328223['push'](_0x328223['shift']());}};_0x2c70bf(++_0x8195fb);}(_0x7fe2,0x96));var _0x27fe=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x7fe2[_0xf51c06];return _0x1d5420;};'use strict';function QueueReport(){this[_0x27fe('0x0')]=_0x27fe('0x1');this['uniqueid']='';this[_0x27fe('0x2')]='';this['calleridname']='';this['queue']='';this[_0x27fe('0x3')]=null;this[_0x27fe('0x4')]=null;this[_0x27fe('0x5')]=0x1;this['count']=0x1;this[_0x27fe('0x6')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x27fe('0x7')]=null;this[_0x27fe('0x8')]=![];this['queuecallerexitAt']=null;this[_0x27fe('0x9')]=0x1;this[_0x27fe('0xa')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x27fe('0xb')]='';this[_0x27fe('0xc')]='';this['exten']='';this[_0x27fe('0xd')]='';this[_0x27fe('0xe')]=0x0;this['assigned']=![];this[_0x27fe('0xf')]='';this['mohtime']=0x0;this[_0x27fe('0x10')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x35f6=['queuecallerexit','originalposition','channel','connectedlinename','accountcode','context','priority','holdtime','lastAssignedTo','mohtime','variables','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x35f6,0x11c));var _0x635f=function(_0x47af73,_0x5d4d70){_0x47af73=_0x47af73-0x0;var _0x4a65aa=_0x35f6[_0x47af73];return _0x4a65aa;};'use strict';function QueueReport(){this['type']=_0x635f('0x0');this['uniqueid']='';this[_0x635f('0x1')]='';this[_0x635f('0x2')]='';this[_0x635f('0x3')]='';this[_0x635f('0x4')]=null;this[_0x635f('0x5')]=null;this['position']=0x1;this[_0x635f('0x6')]=0x1;this[_0x635f('0x7')]=![];this[_0x635f('0x8')]=null;this['queuecallercomplete']=![];this[_0x635f('0x9')]=null;this[_0x635f('0xa')]=![];this['queuecallerexitAt']=null;this[_0x635f('0xb')]=0x1;this[_0x635f('0xc')]='';this['connectedlinenum']='';this[_0x635f('0xd')]='';this[_0x635f('0xe')]='';this[_0x635f('0xf')]='';this['exten']='';this[_0x635f('0x10')]='';this[_0x635f('0x11')]=0x0;this['assigned']=![];this[_0x635f('0x12')]='';this[_0x635f('0x13')]=0x0;this[_0x635f('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d3fea57..c9293ff 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 _0xfb16=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xfb16,0x11d));var _0x6fb1=function(_0x15cf2d,_0x1d8b95){_0x15cf2d=_0x15cf2d-0x0;var _0x53373b=_0xfb16[_0x15cf2d];return _0x53373b;};'use strict';function SalesforceAccount(_0x472631){this['id']=_0x472631['id']||0x0;this[_0x6fb1('0x0')]=_0x472631[_0x6fb1('0x0')]||'';this[_0x6fb1('0x1')]=_0x472631[_0x6fb1('0x1')]||'';this[_0x6fb1('0x2')]=_0x472631[_0x6fb1('0x2')]||'';this[_0x6fb1('0x3')]=_0x472631[_0x6fb1('0x3')]||'';this['clientId']=_0x472631[_0x6fb1('0x4')]||'';this[_0x6fb1('0x5')]=_0x472631[_0x6fb1('0x5')]||'';this[_0x6fb1('0x6')]=_0x472631[_0x6fb1('0x6')]||'';this[_0x6fb1('0x7')]=_0x472631['type']||_0x6fb1('0x8');this[_0x6fb1('0x9')]=_0x472631[_0x6fb1('0x9')]||'';this['Configurations']=_0x472631[_0x6fb1('0xa')]||{};}module[_0x6fb1('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xa44a=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa44a,0x1d3));var _0xaa44=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0xa44a[_0xe30e17];return _0x2342c9;};'use strict';function SalesforceAccount(_0x165908){this['id']=_0x165908['id']||0x0;this[_0xaa44('0x0')]=_0x165908[_0xaa44('0x0')]||'';this[_0xaa44('0x1')]=_0x165908[_0xaa44('0x1')]||'';this[_0xaa44('0x2')]=_0x165908[_0xaa44('0x2')]||'';this[_0xaa44('0x3')]=_0x165908[_0xaa44('0x3')]||'';this['clientId']=_0x165908[_0xaa44('0x4')]||'';this[_0xaa44('0x5')]=_0x165908[_0xaa44('0x5')]||'';this['securityToken']=_0x165908[_0xaa44('0x6')]||'';this[_0xaa44('0x7')]=_0x165908[_0xaa44('0x7')]||'integrationTab';this[_0xaa44('0x8')]=_0x165908[_0xaa44('0x8')]||'';this['Configurations']=_0x165908['Configurations']||{};}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 7c061f8..b345c8b 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 _0x5a08=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x32bf53,_0x33bc0c){var _0x20d9c0=function(_0x2e5f82){while(--_0x2e5f82){_0x32bf53['push'](_0x32bf53['shift']());}};_0x20d9c0(++_0x33bc0c);}(_0x5a08,0x105));var _0x85a0=function(_0x5bfca9,_0xbbeb9){_0x5bfca9=_0x5bfca9-0x0;var _0x42e67c=_0x5a08[_0x5bfca9];return _0x42e67c;};'use strict';function ServicenowAccount(_0x2d4ccb){this['id']=_0x2d4ccb['id']||0x0;this[_0x85a0('0x0')]=_0x2d4ccb['name']||'';this[_0x85a0('0x1')]=_0x2d4ccb[_0x85a0('0x1')]||'';this[_0x85a0('0x2')]=_0x2d4ccb[_0x85a0('0x2')]||'';this['remoteUri']=_0x2d4ccb[_0x85a0('0x3')]||'';this[_0x85a0('0x4')]=_0x2d4ccb[_0x85a0('0x4')]||'';this[_0x85a0('0x5')]=_0x2d4ccb[_0x85a0('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xb76c=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb76c,0xf7));var _0xcb76=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xb76c[_0x264545];return _0x114d10;};'use strict';function ServicenowAccount(_0x599828){this['id']=_0x599828['id']||0x0;this[_0xcb76('0x0')]=_0x599828[_0xcb76('0x0')]||'';this[_0xcb76('0x1')]=_0x599828[_0xcb76('0x1')]||'';this[_0xcb76('0x2')]=_0x599828[_0xcb76('0x2')]||'';this['remoteUri']=_0x599828[_0xcb76('0x3')]||'';this[_0xcb76('0x4')]=_0x599828[_0xcb76('0x4')]||'';this[_0xcb76('0x5')]=_0x599828[_0xcb76('0x5')]||{};}module[_0xcb76('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index adf99b6..e9ff415 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 _0xabdf=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x2a6d83,_0x1f8ef1){var _0x52df60=function(_0x403a09){while(--_0x403a09){_0x2a6d83['push'](_0x2a6d83['shift']());}};_0x52df60(++_0x1f8ef1);}(_0xabdf,0x12f));var _0xfabd=function(_0x3a8d4a,_0x10ad0d){_0x3a8d4a=_0x3a8d4a-0x0;var _0x18b4f0=_0xabdf[_0x3a8d4a];return _0x18b4f0;};'use strict';function SugarcrmAccount(_0x1b63ad){this['id']=_0x1b63ad['id']||0x0;this['name']=_0x1b63ad[_0xfabd('0x0')]||'';this[_0xfabd('0x1')]=_0x1b63ad[_0xfabd('0x1')]||'';this[_0xfabd('0x2')]=_0x1b63ad[_0xfabd('0x2')]||'';this['remoteUri']=_0x1b63ad[_0xfabd('0x3')]||'';this[_0xfabd('0x4')]=_0x1b63ad[_0xfabd('0x4')]||'';this['Configurations']=_0x1b63ad[_0xfabd('0x5')]||{};}module[_0xfabd('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0638=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0638,0x148));var _0x8063=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x0638[_0x33bcdb];return _0x18a9bf;};'use strict';function SugarcrmAccount(_0x3599b4){this['id']=_0x3599b4['id']||0x0;this[_0x8063('0x0')]=_0x3599b4[_0x8063('0x0')]||'';this[_0x8063('0x1')]=_0x3599b4[_0x8063('0x1')]||'';this[_0x8063('0x2')]=_0x3599b4['password']||'';this['remoteUri']=_0x3599b4[_0x8063('0x3')]||'';this[_0x8063('0x4')]=_0x3599b4[_0x8063('0x4')]||'';this[_0x8063('0x5')]=_0x3599b4[_0x8063('0x5')]||{};}module[_0x8063('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 06603ff..d3e8a21 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 _0x75c0=['name','accountcode','unknown','stateTime','status','address'];(function(_0xd488b,_0x26b64a){var _0x20de3b=function(_0x5e0fc9){while(--_0x5e0fc9){_0xd488b['push'](_0xd488b['shift']());}};_0x20de3b(++_0x26b64a);}(_0x75c0,0xc0));var _0x075c=function(_0x3ee6bc,_0x4025bb){_0x3ee6bc=_0x3ee6bc-0x0;var _0x5bda78=_0x75c0[_0x3ee6bc];return _0x5bda78;};'use strict';function Telephone(_0x31c6da){this['id']=_0x31c6da['id']||0x0;this[_0x075c('0x0')]=_0x31c6da[_0x075c('0x0')]||'';this[_0x075c('0x1')]=_0x31c6da[_0x075c('0x1')]||'';this['state']=_0x075c('0x2');this[_0x075c('0x3')]=0x0;this[_0x075c('0x4')]=_0x075c('0x2');this[_0x075c('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x33c3=['unknown','stateTime','status','address','exports','name','accountcode','state'];(function(_0x2ac330,_0x2d1943){var _0x384695=function(_0x16a646){while(--_0x16a646){_0x2ac330['push'](_0x2ac330['shift']());}};_0x384695(++_0x2d1943);}(_0x33c3,0xed));var _0x333c=function(_0x3b80fa,_0x3f4f98){_0x3b80fa=_0x3b80fa-0x0;var _0x1da361=_0x33c3[_0x3b80fa];return _0x1da361;};'use strict';function Telephone(_0x4c5089){this['id']=_0x4c5089['id']||0x0;this['name']=_0x4c5089[_0x333c('0x0')]||'';this[_0x333c('0x1')]=_0x4c5089[_0x333c('0x1')]||'';this[_0x333c('0x2')]=_0x333c('0x3');this[_0x333c('0x4')]=0x0;this[_0x333c('0x5')]=_0x333c('0x3');this[_0x333c('0x6')]='';}module[_0x333c('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index e4dd08c..e486e4a 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 _0x54ef=['exports','name','html'];(function(_0x56aaf8,_0x328de5){var _0x411a14=function(_0x2a2361){while(--_0x2a2361){_0x56aaf8['push'](_0x56aaf8['shift']());}};_0x411a14(++_0x328de5);}(_0x54ef,0x112));var _0xf54e=function(_0x4b78bb,_0x5f41eb){_0x4b78bb=_0x4b78bb-0x0;var _0x10631e=_0x54ef[_0x4b78bb];return _0x10631e;};'use strict';function template(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['html']=_0x19d4d5[_0xf54e('0x1')]||'';}module[_0xf54e('0x2')]=template; \ No newline at end of file +var _0xf3cd=['html','exports','name'];(function(_0x762e12,_0x524c23){var _0x2b87fa=function(_0x48ffb7){while(--_0x48ffb7){_0x762e12['push'](_0x762e12['shift']());}};_0x2b87fa(++_0x524c23);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x186020,_0x1fc7f9){_0x186020=_0x186020-0x0;var _0x30380a=_0xf3cd[_0x186020];return _0x30380a;};'use strict';function template(_0x13cb67){this['id']=_0x13cb67['id']||0x0;this[_0xdf3c('0x0')]=_0x13cb67[_0xdf3c('0x0')]||'';this[_0xdf3c('0x1')]=_0x13cb67[_0xdf3c('0x1')]||'';}module[_0xdf3c('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 3a00150..b5a6221 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 _0x1395=['channel','voice','status','AllConditions','AnyConditions','Actions','name'];(function(_0x2ccddc,_0x2a56af){var _0x2cd57f=function(_0x2589b7){while(--_0x2589b7){_0x2ccddc['push'](_0x2ccddc['shift']());}};_0x2cd57f(++_0x2a56af);}(_0x1395,0x1b8));var _0x5139=function(_0x166e00,_0x5b6137){_0x166e00=_0x166e00-0x0;var _0x6f4d46=_0x1395[_0x166e00];return _0x6f4d46;};'use strict';function Trigger(_0x5228c1){this['id']=_0x5228c1['id']||0x0;this[_0x5139('0x0')]=_0x5228c1[_0x5139('0x0')]||'';this[_0x5139('0x1')]=_0x5228c1[_0x5139('0x1')]||_0x5139('0x2');this['status']=_0x5228c1[_0x5139('0x3')]||![];this[_0x5139('0x4')]=_0x5228c1[_0x5139('0x4')]||[];this[_0x5139('0x5')]=_0x5228c1['AnyConditions']||[];this[_0x5139('0x6')]=_0x5228c1[_0x5139('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x77be=['AllConditions','AnyConditions','Actions','name','channel','voice'];(function(_0xe5d572,_0x1a68cd){var _0x781a23=function(_0x2bdff6){while(--_0x2bdff6){_0xe5d572['push'](_0xe5d572['shift']());}};_0x781a23(++_0x1a68cd);}(_0x77be,0xc3));var _0xe77b=function(_0x10513c,_0x1b44cb){_0x10513c=_0x10513c-0x0;var _0x1a3612=_0x77be[_0x10513c];return _0x1a3612;};'use strict';function Trigger(_0x3e819f){this['id']=_0x3e819f['id']||0x0;this['name']=_0x3e819f[_0xe77b('0x0')]||'';this[_0xe77b('0x1')]=_0x3e819f[_0xe77b('0x1')]||_0xe77b('0x2');this['status']=_0x3e819f['status']||![];this[_0xe77b('0x3')]=_0x3e819f['AllConditions']||[];this[_0xe77b('0x4')]=_0x3e819f[_0xe77b('0x4')]||[];this[_0xe77b('0x5')]=_0x3e819f[_0xe77b('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index cd611f4..574ad31 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 _0xde78=['refresh','registrationtime','address','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domainport'];(function(_0x2680f0,_0x5a1105){var _0x6d3e9b=function(_0x50de45){while(--_0x50de45){_0x2680f0['push'](_0x2680f0['shift']());}};_0x6d3e9b(++_0x5a1105);}(_0xde78,0x64));var _0x8de7=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0xde78[_0x1bfe2b];return _0x1477d4;};'use strict';function Trunk(_0x5eba09){this['id']=_0x5eba09['id']||0x0;this[_0x8de7('0x0')]=_0x5eba09[_0x8de7('0x0')]||![];this[_0x8de7('0x1')]=_0x5eba09[_0x8de7('0x1')]||'';this[_0x8de7('0x2')]=_0x8de7('0x3');this[_0x8de7('0x4')]=0x0;this[_0x8de7('0x5')]=_0x8de7('0x3');this[_0x8de7('0x6')]=_0x5eba09[_0x8de7('0x6')]&&_0x5eba09['registry'][_0x8de7('0x7')](':')?_0x5eba09['registry'][_0x8de7('0x8')](':')[0x0]:'';this[_0x8de7('0x9')]='';this[_0x8de7('0xa')]='';this['domain']='';this[_0x8de7('0xb')]='';this[_0x8de7('0xc')]='';this['stateRegistry']=_0x8de7('0x3');this[_0x8de7('0xd')]='';this[_0x8de7('0xe')]='';}module[_0x8de7('0xf')]=Trunk; \ No newline at end of file +var _0x005f=['unknown','stateTime','status','registry','split','domain','domainport','refresh','registrationtime','exports','state'];(function(_0x4e66b4,_0x3201b6){var _0x1d25d9=function(_0x75dfd0){while(--_0x75dfd0){_0x4e66b4['push'](_0x4e66b4['shift']());}};_0x1d25d9(++_0x3201b6);}(_0x005f,0x15f));var _0xf005=function(_0x3e0712,_0x13e93a){_0x3e0712=_0x3e0712-0x0;var _0x381a2e=_0x005f[_0x3e0712];return _0x381a2e;};'use strict';function Trunk(_0x1d3263){this['id']=_0x1d3263['id']||0x0;this['active']=_0x1d3263['active']||![];this['name']=_0x1d3263['name']||'';this[_0xf005('0x0')]=_0xf005('0x1');this[_0xf005('0x2')]=0x0;this[_0xf005('0x3')]=_0xf005('0x1');this[_0xf005('0x4')]=_0x1d3263[_0xf005('0x4')]&&_0x1d3263[_0xf005('0x4')]['indexOf'](':')?_0x1d3263[_0xf005('0x4')][_0xf005('0x5')](':')[0x0]:'';this['host']='';this['port']='';this[_0xf005('0x6')]='';this[_0xf005('0x7')]='';this[_0xf005('0x8')]='';this['stateRegistry']=_0xf005('0x1');this[_0xf005('0x9')]='';this['address']='';}module[_0xf005('0xa')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 9760550..c31bb31 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 _0x3839=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x3839,0x1b4));var _0x9383=function(_0x580ff7,_0x3a2698){_0x580ff7=_0x580ff7-0x0;var _0x50201c=_0x3839[_0x580ff7];return _0x50201c;};'use strict';function voiceExtension(_0xb69360){this['id']=_0xb69360['id']||0x0;this[_0x9383('0x0')]=_0xb69360[_0x9383('0x0')]||'';this[_0x9383('0x1')]=_0xb69360['recordingFormat']||'none';this[_0x9383('0x2')]=_0xb69360['mandatoryDisposition']||![];}module[_0x9383('0x3')]=voiceExtension; \ No newline at end of file +var _0x7719=['none','mandatoryDisposition','exports','recordingFormat'];(function(_0x2a7ef7,_0x214443){var _0x149f30=function(_0x27f820){while(--_0x27f820){_0x2a7ef7['push'](_0x2a7ef7['shift']());}};_0x149f30(++_0x214443);}(_0x7719,0x19b));var _0x9771=function(_0x44ae8c,_0x2e0d2a){_0x44ae8c=_0x44ae8c-0x0;var _0x3a9df=_0x7719[_0x44ae8c];return _0x3a9df;};'use strict';function voiceExtension(_0x4333ad){this['id']=_0x4333ad['id']||0x0;this['exten']=_0x4333ad['exten']||'';this[_0x9771('0x0')]=_0x4333ad[_0x9771('0x0')]||_0x9771('0x1');this[_0x9771('0x2')]=_0x4333ad[_0x9771('0x2')]||![];}module[_0x9771('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 0625af3..2d03a39 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 _0x9d95=['predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls'];(function(_0x51abf3,_0x85b36b){var _0x19142b=function(_0x4848b7){while(--_0x4848b7){_0x51abf3['push'](_0x51abf3['shift']());}};_0x19142b(++_0x85b36b);}(_0x9d95,0xf1));var _0x59d9=function(_0x43e297,_0x57c429){_0x43e297=_0x43e297-0x0;var _0x209690=_0x9d95[_0x43e297];return _0x209690;};'use strict';var statusDesc=[_0x59d9('0x0'),_0x59d9('0x1'),_0x59d9('0x2'),'busy',_0x59d9('0x3'),_0x59d9('0x4'),'ringing',_0x59d9('0x5'),_0x59d9('0x6')];var monitorFormat={'wav':_0x59d9('0x7'),'wav49':_0x59d9('0x8'),'gsm':_0x59d9('0x9')};var strategy={'rrmemory':_0x59d9('0xa'),'roundrobin':_0x59d9('0xb')};function VoiceQueue(_0x10199a){this['id']=_0x10199a['id']||0x0;this['name']=_0x10199a[_0x59d9('0xc')]||'';this[_0x59d9('0xd')]=_0x10199a[_0x59d9('0xd')]||'';this[_0x59d9('0xe')]=_0x10199a['type']||'inbound';this[_0x59d9('0xf')]=0x0;this[_0x59d9('0x10')]=0x0;this[_0x59d9('0x11')]=0x0;this['answered']=0x0;this[_0x59d9('0x12')]=0x0;this[_0x59d9('0x13')]=0x0;this[_0x59d9('0x14')]=0x0;this[_0x59d9('0x15')]=0x0;this['abandoned']=0x0;this[_0x59d9('0x16')]=0x0;this[_0x59d9('0x17')]=0x0;this[_0x59d9('0x18')]=_0x10199a[_0x59d9('0x18')]||![];this[_0x59d9('0x19')]=_0x10199a[_0x59d9('0x19')]||0xa;this[_0x59d9('0x1a')]=_0x10199a[_0x59d9('0x1a')]||'no';this[_0x59d9('0x1b')]=!![];this['message']='';this[_0x59d9('0x1c')]=0x0;this['temp']=0x0;this[_0x59d9('0x1d')]=_0x10199a[_0x59d9('0x1d')]||null;this[_0x59d9('0x1e')]=_0x10199a['dialGlobalInterval']?_0x10199a[_0x59d9('0x1e')]:null;this[_0x59d9('0x1f')]=_0x10199a[_0x59d9('0x1f')];this[_0x59d9('0x20')]=_0x10199a[_0x59d9('0x20')]||'progressive';this[_0x59d9('0x21')]=_0x10199a[_0x59d9('0x21')]||0x0;this[_0x59d9('0x22')]=_0x10199a[_0x59d9('0x22')]||0x0;this['dialPowerLevel']=_0x10199a[_0x59d9('0x23')]||0x1;this[_0x59d9('0x24')]=_0x10199a[_0x59d9('0x24')]||'dropRate';this[_0x59d9('0x25')]=_0x10199a[_0x59d9('0x25')]||0.03;this['dialPredictiveInterval']=_0x10199a[_0x59d9('0x26')]||0x258;this[_0x59d9('0x27')]=_0x10199a[_0x59d9('0x27')]||_0x59d9('0x28');this[_0x59d9('0x29')]=_0x10199a[_0x59d9('0x29')]||_0x59d9('0x28');this[_0x59d9('0x2a')]=_0x10199a[_0x59d9('0x2a')]||0x1e;this[_0x59d9('0x2b')]=_0x10199a[_0x59d9('0x2b')]||_0x59d9('0x2c');this['dialQueueTimeout']=_0x10199a[_0x59d9('0x2d')]||0x3;this['dialQueueProject']=_0x10199a[_0x59d9('0x2e')]||undefined;this[_0x59d9('0x2f')]=_0x10199a[_0x59d9('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x10199a[_0x59d9('0x30')]||0x96;this['dialBusyMaxRetry']=_0x10199a[_0x59d9('0x31')]||0x3;this[_0x59d9('0x32')]=_0x10199a['dialBusyRetryFrequency']||0x96;this[_0x59d9('0x33')]=_0x10199a[_0x59d9('0x33')]||0x3;this[_0x59d9('0x34')]=_0x10199a[_0x59d9('0x34')]||0x96;this[_0x59d9('0x35')]=_0x10199a[_0x59d9('0x35')]||0x4;this[_0x59d9('0x36')]=_0x10199a[_0x59d9('0x36')]?_0x10199a[_0x59d9('0x36')]:undefined;this[_0x59d9('0x37')]=_0x10199a[_0x59d9('0x37')]?_0x10199a['TrunkBackup']:undefined;this[_0x59d9('0x38')]=_0x10199a[_0x59d9('0x38')]||undefined;this[_0x59d9('0x39')]=_0x10199a['Interval']?_0x10199a[_0x59d9('0x39')]:undefined;this[_0x59d9('0x3a')]=_0x10199a[_0x59d9('0x3a')]||_0x59d9('0x3b');this[_0x59d9('0x3c')]=_0x10199a[_0x59d9('0x3c')]||undefined;this['dialCutDigit']=_0x10199a[_0x59d9('0x3d')]||undefined;this[_0x59d9('0x3e')]=strategy[_0x10199a[_0x59d9('0x3e')]]||_0x59d9('0xa');this[_0x59d9('0x3f')]=!![];this[_0x59d9('0x40')]=_0x10199a[_0x59d9('0x40')]||![];this[_0x59d9('0x41')]=_0x10199a[_0x59d9('0x41')];this[_0x59d9('0x42')]=_0x10199a[_0x59d9('0x42')];this[_0x59d9('0x43')]=_0x10199a[_0x59d9('0x43')];this[_0x59d9('0x44')]=_0x10199a['dialAMDTotalAnalysisTime'];this[_0x59d9('0x45')]=_0x10199a[_0x59d9('0x45')];this['dialAMDBetweenWordsSilence']=_0x10199a[_0x59d9('0x46')];this[_0x59d9('0x47')]=_0x10199a[_0x59d9('0x47')];this[_0x59d9('0x48')]=_0x10199a[_0x59d9('0x48')];this[_0x59d9('0x49')]=_0x10199a[_0x59d9('0x49')];this[_0x59d9('0x4a')]=0x0;this[_0x59d9('0x4b')]=0x0;this[_0x59d9('0x4c')]=_0x10199a[_0x59d9('0x4c')];this[_0x59d9('0x4d')]=0x0;this[_0x59d9('0x4e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x59d9('0x4f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x59d9('0x50')]=0x0;this[_0x59d9('0x51')]=0x0;this[_0x59d9('0x52')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x59d9('0x53')]=0x0;this[_0x59d9('0x54')]=0x0;this[_0x59d9('0x55')]=0x0;this[_0x59d9('0x56')]=undefined;this[_0x59d9('0x57')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x59d9('0x58')]=0x0;this[_0x59d9('0x59')]=0x0;this[_0x59d9('0x5a')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x59d9('0x5b')]=0x0;this[_0x59d9('0x5c')]=0x0;this[_0x59d9('0x5d')]=0x0;this[_0x59d9('0x5e')]=_0x10199a[_0x59d9('0x5f')]||0x14;this[_0x59d9('0x60')]=_0x10199a[_0x59d9('0x5f')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x59d9('0x61')]=0x0;this[_0x59d9('0x62')]=0x1;this[_0x59d9('0x63')]=0x0;this[_0x59d9('0x64')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x59d9('0x65')]=0x0;this[_0x59d9('0x66')]=_0x10199a[_0x59d9('0x66')]||0x1e;this[_0x59d9('0x67')]=_0x10199a['dialRecallInQueue']||![];this[_0x59d9('0x68')]=_0x10199a[_0x59d9('0x68')]||undefined;this[_0x59d9('0x69')]=_0x10199a[_0x59d9('0x69')]||![];this[_0x59d9('0x6a')]=_0x10199a[_0x59d9('0x6a')]||![];this[_0x59d9('0xd')]=monitorFormat[_0x10199a[_0x59d9('0xd')]]?monitorFormat[_0x10199a[_0x59d9('0xd')]]:undefined;this[_0x59d9('0x6b')]=_0x10199a['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x10199a[_0x59d9('0x6c')]?_0x10199a[_0x59d9('0x6c')]:undefined;}module[_0x59d9('0x6d')]=VoiceQueue; \ No newline at end of file +var _0xde8f=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay'];(function(_0xcdeb0e,_0x5df74e){var _0x49de54=function(_0x40e81b){while(--_0x40e81b){_0xcdeb0e['push'](_0xcdeb0e['shift']());}};_0x49de54(++_0x5df74e);}(_0xde8f,0x8f));var _0xfde8=function(_0xa0cade,_0x5212e7){_0xa0cade=_0xa0cade-0x0;var _0x52d603=_0xde8f[_0xa0cade];return _0x52d603;};'use strict';var statusDesc=[_0xfde8('0x0'),_0xfde8('0x1'),_0xfde8('0x2'),'busy',_0xfde8('0x3'),_0xfde8('0x4'),_0xfde8('0x5'),_0xfde8('0x6'),_0xfde8('0x7')];var monitorFormat={'wav':_0xfde8('0x8'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xfde8('0x9')};function VoiceQueue(_0x2e4c2b){this['id']=_0x2e4c2b['id']||0x0;this['name']=_0x2e4c2b[_0xfde8('0xa')]||'';this[_0xfde8('0xb')]=_0x2e4c2b[_0xfde8('0xb')]||'';this[_0xfde8('0xc')]=_0x2e4c2b['type']||_0xfde8('0xd');this[_0xfde8('0xe')]=0x0;this[_0xfde8('0xf')]=0x0;this['total']=0x0;this[_0xfde8('0x10')]=0x0;this[_0xfde8('0x11')]=0x0;this[_0xfde8('0x12')]=0x0;this[_0xfde8('0x13')]=0x0;this[_0xfde8('0x14')]=0x0;this[_0xfde8('0x15')]=0x0;this['loggedIn']=0x0;this[_0xfde8('0x16')]=0x0;this[_0xfde8('0x17')]=_0x2e4c2b[_0xfde8('0x17')]||![];this[_0xfde8('0x18')]=_0x2e4c2b[_0xfde8('0x18')]||0xa;this[_0xfde8('0x19')]=_0x2e4c2b[_0xfde8('0x19')]||'no';this[_0xfde8('0x1a')]=!![];this[_0xfde8('0x1b')]='';this[_0xfde8('0x1c')]=0x0;this['temp']=0x0;this[_0xfde8('0x1d')]=_0x2e4c2b['dialTimezone']||null;this[_0xfde8('0x1e')]=_0x2e4c2b[_0xfde8('0x1e')]?_0x2e4c2b[_0xfde8('0x1e')]:null;this['dialActive']=_0x2e4c2b[_0xfde8('0x1f')];this[_0xfde8('0x20')]=_0x2e4c2b[_0xfde8('0x20')]||'progressive';this['dialLimitChannel']=_0x2e4c2b['dialLimitChannel']||0x0;this[_0xfde8('0x21')]=_0x2e4c2b[_0xfde8('0x21')]||0x0;this[_0xfde8('0x22')]=_0x2e4c2b[_0xfde8('0x22')]||0x1;this[_0xfde8('0x23')]=_0x2e4c2b[_0xfde8('0x23')]||'dropRate';this[_0xfde8('0x24')]=_0x2e4c2b[_0xfde8('0x24')]||0.03;this[_0xfde8('0x25')]=_0x2e4c2b[_0xfde8('0x25')]||0x258;this[_0xfde8('0x26')]=_0x2e4c2b[_0xfde8('0x26')]||_0xfde8('0x27');this[_0xfde8('0x28')]=_0x2e4c2b[_0xfde8('0x28')]||_0xfde8('0x27');this[_0xfde8('0x29')]=_0x2e4c2b['dialOriginateTimeout']||0x1e;this[_0xfde8('0x2a')]=_0x2e4c2b['dialQueueOptions']||'tTxX';this['dialQueueTimeout']=_0x2e4c2b[_0xfde8('0x2b')]||0x3;this[_0xfde8('0x2c')]=_0x2e4c2b[_0xfde8('0x2c')]||undefined;this[_0xfde8('0x2d')]=_0x2e4c2b[_0xfde8('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x2e4c2b[_0xfde8('0x2e')]||0x96;this[_0xfde8('0x2f')]=_0x2e4c2b[_0xfde8('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x2e4c2b[_0xfde8('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x2e4c2b[_0xfde8('0x31')]||0x3;this[_0xfde8('0x32')]=_0x2e4c2b[_0xfde8('0x32')]||0x96;this[_0xfde8('0x33')]=_0x2e4c2b['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x2e4c2b[_0xfde8('0x34')]?_0x2e4c2b[_0xfde8('0x34')]:undefined;this['TrunkBackup']=_0x2e4c2b[_0xfde8('0x35')]?_0x2e4c2b[_0xfde8('0x35')]:undefined;this[_0xfde8('0x36')]=_0x2e4c2b[_0xfde8('0x36')]||undefined;this[_0xfde8('0x37')]=_0x2e4c2b[_0xfde8('0x37')]?_0x2e4c2b[_0xfde8('0x37')]:undefined;this['dialOrderByScheduledAt']=_0x2e4c2b['dialOrderByScheduledAt']||_0xfde8('0x38');this[_0xfde8('0x39')]=_0x2e4c2b[_0xfde8('0x39')]||undefined;this[_0xfde8('0x3a')]=_0x2e4c2b[_0xfde8('0x3a')]||undefined;this[_0xfde8('0x3b')]=strategy[_0x2e4c2b['strategy']]||_0xfde8('0x3c');this['queueStatusComplete']=!![];this[_0xfde8('0x3d')]=_0x2e4c2b[_0xfde8('0x3d')]||![];this[_0xfde8('0x3e')]=_0x2e4c2b['dialAMDInitialSilence'];this[_0xfde8('0x3f')]=_0x2e4c2b[_0xfde8('0x3f')];this[_0xfde8('0x40')]=_0x2e4c2b[_0xfde8('0x40')];this['dialAMDTotalAnalysisTime']=_0x2e4c2b[_0xfde8('0x41')];this[_0xfde8('0x42')]=_0x2e4c2b[_0xfde8('0x42')];this[_0xfde8('0x43')]=_0x2e4c2b[_0xfde8('0x43')];this[_0xfde8('0x44')]=_0x2e4c2b['dialAMDMaximumNumberOfWords'];this[_0xfde8('0x45')]=_0x2e4c2b[_0xfde8('0x45')];this[_0xfde8('0x46')]=_0x2e4c2b[_0xfde8('0x46')];this[_0xfde8('0x47')]=0x0;this[_0xfde8('0x48')]=0x0;this[_0xfde8('0x49')]=_0x2e4c2b[_0xfde8('0x49')];this[_0xfde8('0x4a')]=0x0;this[_0xfde8('0x4b')]=0x0;this[_0xfde8('0x4c')]=0x0;this[_0xfde8('0x4d')]=0x0;this[_0xfde8('0x4e')]=0x0;this[_0xfde8('0x4f')]=0x0;this[_0xfde8('0x50')]=0x0;this[_0xfde8('0x51')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xfde8('0x52')]=0x0;this[_0xfde8('0x53')]=undefined;this[_0xfde8('0x54')]=undefined;this['handlePredictive']=undefined;this[_0xfde8('0x55')]=1.05;this[_0xfde8('0x56')]=0x0;this[_0xfde8('0x57')]=0x0;this[_0xfde8('0x58')]=0x0;this[_0xfde8('0x59')]=0x0;this[_0xfde8('0x5a')]=0x0;this[_0xfde8('0x5b')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xfde8('0x5c')]=0x0;this[_0xfde8('0x5d')]=_0x2e4c2b[_0xfde8('0x5e')]||0x14;this['predictiveIntervalMinThreshold']=_0x2e4c2b[_0xfde8('0x5e')]||0xa;this[_0xfde8('0x5f')]=0x0;this[_0xfde8('0x60')]=0x0;this[_0xfde8('0x61')]=0x1;this[_0xfde8('0x62')]=0x0;this[_0xfde8('0x63')]=0x0;this[_0xfde8('0x64')]=0x0;this[_0xfde8('0x65')]=0x0;this[_0xfde8('0x66')]=_0x2e4c2b[_0xfde8('0x66')]||0x1e;this['dialRecallInQueue']=_0x2e4c2b[_0xfde8('0x67')]||![];this[_0xfde8('0x68')]=_0x2e4c2b['dialQueueProject2']||undefined;this[_0xfde8('0x69')]=_0x2e4c2b[_0xfde8('0x69')]||![];this[_0xfde8('0x6a')]=_0x2e4c2b[_0xfde8('0x6a')]||![];this[_0xfde8('0xb')]=monitorFormat[_0x2e4c2b['monitor_format']]?monitorFormat[_0x2e4c2b['monitor_format']]:undefined;this['mandatoryDisposition']=_0x2e4c2b[_0xfde8('0x6b')]||![];this[_0xfde8('0x6c')]=_0x2e4c2b[_0xfde8('0x6c')]?_0x2e4c2b['mandatoryDispositionPause']:undefined;}module[_0xfde8('0x6d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9be3591..6bb04df 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 _0xd6b2=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x5ef9eb,_0x789ad8){var _0x2e103e=function(_0x3befff){while(--_0x3befff){_0x5ef9eb['push'](_0x5ef9eb['shift']());}};_0x2e103e(++_0x789ad8);}(_0xd6b2,0x18f));var _0x2d6b=function(_0x94085c,_0x3941fa){_0x94085c=_0x94085c-0x0;var _0xafd4b0=_0xd6b2[_0x94085c];return _0xafd4b0;};'use strict';function VtigerAccount(_0x486ee8){this['id']=_0x486ee8['id']||0x0;this[_0x2d6b('0x0')]=_0x486ee8['name']||'';this[_0x2d6b('0x1')]=_0x486ee8['username']||'';this[_0x2d6b('0x2')]=_0x486ee8[_0x2d6b('0x2')]||'';this[_0x2d6b('0x3')]=_0x486ee8[_0x2d6b('0x3')]||'';this[_0x2d6b('0x4')]=_0x486ee8[_0x2d6b('0x4')]||'';this[_0x2d6b('0x5')]=_0x486ee8[_0x2d6b('0x5')]||{};}module[_0x2d6b('0x6')]=VtigerAccount; \ No newline at end of file +var _0xe090=['remoteUri','serverUrl','Configurations','exports','username','accessKey'];(function(_0x43c0e8,_0x4e86d0){var _0x4cd46b=function(_0x2c3df4){while(--_0x2c3df4){_0x43c0e8['push'](_0x43c0e8['shift']());}};_0x4cd46b(++_0x4e86d0);}(_0xe090,0x8e));var _0x0e09=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe090[_0x4e676e];return _0x336a3c;};'use strict';function VtigerAccount(_0xb02d1){this['id']=_0xb02d1['id']||0x0;this['name']=_0xb02d1['name']||'';this[_0x0e09('0x0')]=_0xb02d1[_0x0e09('0x0')]||'';this[_0x0e09('0x1')]=_0xb02d1[_0x0e09('0x1')]||'';this[_0x0e09('0x2')]=_0xb02d1[_0x0e09('0x2')]||'';this[_0x0e09('0x3')]=_0xb02d1[_0x0e09('0x3')]||'';this['Configurations']=_0xb02d1[_0x0e09('0x4')]||{};}module[_0x0e09('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 99b8bbc..42c35db 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 _0x70c7=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x19da23,_0x56a072){var _0xf5e62b=function(_0x4c469c){while(--_0x4c469c){_0x19da23['push'](_0x19da23['shift']());}};_0xf5e62b(++_0x56a072);}(_0x70c7,0x1cf));var _0x770c=function(_0x3d9785,_0x166bcd){_0x3d9785=_0x3d9785-0x0;var _0x1e47c2=_0x70c7[_0x3d9785];return _0x1e47c2;};'use strict';function ZendeskAccount(_0x59738b){this['id']=_0x59738b['id']||0x0;this[_0x770c('0x0')]=_0x59738b[_0x770c('0x0')]||'';this[_0x770c('0x1')]=_0x59738b[_0x770c('0x1')]||'';this['password']=_0x59738b[_0x770c('0x2')]||'';this[_0x770c('0x3')]=_0x59738b[_0x770c('0x3')]||'';this[_0x770c('0x4')]=_0x59738b[_0x770c('0x4')]||'';this['authType']=_0x59738b[_0x770c('0x5')]||'';this[_0x770c('0x6')]=_0x59738b['type']||_0x770c('0x7');this['serverUrl']=_0x59738b[_0x770c('0x8')]||'';this[_0x770c('0x9')]=_0x59738b[_0x770c('0x9')]||{};}module[_0x770c('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x966f=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x13d170,_0x32576a){var _0x54c62b=function(_0x42d041){while(--_0x42d041){_0x13d170['push'](_0x13d170['shift']());}};_0x54c62b(++_0x32576a);}(_0x966f,0x82));var _0xf966=function(_0x22fa61,_0x3e0c17){_0x22fa61=_0x22fa61-0x0;var _0x380e44=_0x966f[_0x22fa61];return _0x380e44;};'use strict';function ZendeskAccount(_0x5b32af){this['id']=_0x5b32af['id']||0x0;this['name']=_0x5b32af[_0xf966('0x0')]||'';this[_0xf966('0x1')]=_0x5b32af['username']||'';this[_0xf966('0x2')]=_0x5b32af[_0xf966('0x2')]||'';this[_0xf966('0x3')]=_0x5b32af['token']||'';this[_0xf966('0x4')]=_0x5b32af[_0xf966('0x4')]||'';this['authType']=_0x5b32af[_0xf966('0x5')]||'';this[_0xf966('0x6')]=_0x5b32af[_0xf966('0x6')]||'integrationTab';this[_0xf966('0x7')]=_0x5b32af[_0xf966('0x7')]||'';this[_0xf966('0x8')]=_0x5b32af[_0xf966('0x8')]||{};}module[_0xf966('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 3bcca77..718b0b0 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 _0x7c09=['host','Configurations','serverUrl','name','authToken'];(function(_0x4fa60b,_0x4040bf){var _0xe5477e=function(_0x154662){while(--_0x154662){_0x4fa60b['push'](_0x4fa60b['shift']());}};_0xe5477e(++_0x4040bf);}(_0x7c09,0x102));var _0x97c0=function(_0x553af1,_0x524237){_0x553af1=_0x553af1-0x0;var _0x166843=_0x7c09[_0x553af1];return _0x166843;};'use strict';function ZohoAccount(_0x579a22){this['id']=_0x579a22['id']||0x0;this[_0x97c0('0x0')]=_0x579a22[_0x97c0('0x0')]||'';this['authToken']=_0x579a22[_0x97c0('0x1')]||'';this[_0x97c0('0x2')]=_0x579a22[_0x97c0('0x2')]||'';this[_0x97c0('0x3')]=_0x579a22[_0x97c0('0x3')]||{};this[_0x97c0('0x4')]=_0x579a22[_0x97c0('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file +var _0x2eb2=['name','authToken','host','Configurations','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2eb2[_0x3ff085];return _0x2b68c3;};'use strict';function ZohoAccount(_0x12836c){this['id']=_0x12836c['id']||0x0;this[_0x22eb('0x0')]=_0x12836c[_0x22eb('0x0')]||'';this[_0x22eb('0x1')]=_0x12836c[_0x22eb('0x1')]||'';this[_0x22eb('0x2')]=_0x12836c[_0x22eb('0x2')]||'';this['Configurations']=_0x12836c[_0x22eb('0x3')]||{};this['serverUrl']=_0x12836c['serverUrl']||'';}module[_0x22eb('0x4')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 34d0f0e..58d1112 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 _0x94e8=['number','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x3338b2,_0x1db3c9){var _0x532ae7=function(_0x328134){while(--_0x328134){_0x3338b2['push'](_0x3338b2['shift']());}};_0x532ae7(++_0x1db3c9);}(_0x94e8,0x7a));var _0x894e=function(_0x5c12f2,_0x5de043){_0x5c12f2=_0x5c12f2-0x0;var _0x5e8344=_0x94e8[_0x5c12f2];return _0x5e8344;};'use strict';var util=require(_0x894e('0x0'));var _=require(_0x894e('0x1'));var moment=require(_0x894e('0x2'));function checkNameSurname(_0x1aa924,_0x40129f,_0x1568c5){var _0x22c3fc='';if(!_[_0x894e('0x3')](_0x40129f)&&'string'===typeof _0x40129f){_0x22c3fc+=_0x40129f;}if(!_[_0x894e('0x3')](_0x1568c5)&&'string'===typeof _0x1568c5){_0x22c3fc+='\x20'+_0x1568c5;}if(_0x22c3fc!==''){return _0x22c3fc;}return _0x1aa924;}function Action(_0x3a4167,_0x5d2c54,_0x227f81,_0x74f4b3,_0x44f23c){this[_0x894e('0x4')]=_0x227f81||undefined;this['idContact']=_0x3a4167['id'];this[_0x894e('0x5')]=_0x5d2c54[_0x894e('0x6')];this[_0x894e('0x7')]=_0x5d2c54[_0x894e('0x7')];this[_0x894e('0x8')]=_0x894e('0x5');this[_0x894e('0x9')]=![];this[_0x894e('0xa')]=_[_0x894e('0x3')](_0x3a4167['Agent'])?undefined:_0x3a4167[_0x894e('0xb')][_0x894e('0x6')];this[_0x894e('0xc')]=this[_0x894e('0xa')]?util['format'](_0x894e('0xd'),this[_0x894e('0xa')]):_0x74f4b3||undefined;this[_0x894e('0xe')]=checkNameSurname(_0x3a4167[_0x894e('0xf')][_0x894e('0x10')],_0x3a4167[_0x894e('0xf')][_0x894e('0x11')],_0x3a4167['Contact'][_0x894e('0x12')]);this[_0x894e('0x13')]=_0x3a4167[_0x894e('0x13')]||![];this[_0x894e('0x14')]=_0x3a4167['Contact'][_0x894e('0x10')];this[_0x894e('0x15')]=_0x3a4167[_0x894e('0x15')];this[_0x894e('0x16')]=_0x3a4167['countbusyretry']||0x0;this[_0x894e('0x17')]=_0x3a4167[_0x894e('0x17')]||0x0;this['countnoanswerretry']=_0x3a4167[_0x894e('0x18')]||0x0;this[_0x894e('0x19')]=(_0x3a4167[_0x894e('0x16')]||0x0)+(_0x3a4167[_0x894e('0x17')]||0x0)+(_0x3a4167['countnoanswerretry']||0x0);this['callback']=_0x3a4167[_0x894e('0x1a')];this['callbackuniqueid']=_0x3a4167[_0x894e('0x1b')];this[_0x894e('0x1c')]=_0x3a4167[_0x894e('0x1c')];this[_0x894e('0x1d')]=_0x3a4167['recallme'];this[_0x894e('0x1e')]=_0x3a4167[_0x894e('0x1e')];this[_0x894e('0x1f')]=_0x3a4167[_0x894e('0x1f')];this[_0x894e('0x20')]=_[_0x894e('0x3')](_0x3a4167['Agent'])?_0x3a4167[_0x894e('0x20')]:_0x3a4167[_0x894e('0xb')]['id'];this[_0x894e('0x21')]=_0x3a4167[_0x894e('0x21')];this['originatecalleridnum']='';this[_0x894e('0x22')]='';}Action[_0x894e('0x23')][_0x894e('0x24')]=function(){return util['format'](_0x894e('0x25'),this[_0x894e('0xe')],this[_0x894e('0x26')]);};module[_0x894e('0x27')]=Action; \ No newline at end of file +var _0xe2fd=['isNil','string','idContact','queue','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment'];(function(_0x5bfa83,_0x19da74){var _0x41378f=function(_0x11af5c){while(--_0x11af5c){_0x5bfa83['push'](_0x5bfa83['shift']());}};_0x41378f(++_0x19da74);}(_0xe2fd,0x1de));var _0xde2f=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0xe2fd[_0xf16b1];return _0x26f94d;};'use strict';var util=require(_0xde2f('0x0'));var _=require(_0xde2f('0x1'));var moment=require(_0xde2f('0x2'));function checkNameSurname(_0xb987e4,_0x40a7fe,_0x5c0b4b){var _0x4cc53e='';if(!_[_0xde2f('0x3')](_0x40a7fe)&&_0xde2f('0x4')===typeof _0x40a7fe){_0x4cc53e+=_0x40a7fe;}if(!_['isNil'](_0x5c0b4b)&&'string'===typeof _0x5c0b4b){_0x4cc53e+='\x20'+_0x5c0b4b;}if(_0x4cc53e!==''){return _0x4cc53e;}return _0xb987e4;}function Action(_0x13ef7a,_0x59c68f,_0x7e5fc,_0x4320d5,_0x504e46){this['uniqueid']=_0x7e5fc||undefined;this[_0xde2f('0x5')]=_0x13ef7a['id'];this[_0xde2f('0x6')]=_0x59c68f['name'];this['type']=_0x59c68f[_0xde2f('0x7')];this['campaigntype']=_0xde2f('0x6');this[_0xde2f('0x8')]=![];this[_0xde2f('0x9')]=_[_0xde2f('0x3')](_0x13ef7a[_0xde2f('0xa')])?undefined:_0x13ef7a[_0xde2f('0xa')]['name'];this[_0xde2f('0xb')]=this[_0xde2f('0x9')]?util[_0xde2f('0xc')](_0xde2f('0xd'),this[_0xde2f('0x9')]):_0x4320d5||undefined;this[_0xde2f('0xe')]=checkNameSurname(_0x13ef7a[_0xde2f('0xf')]['phone'],_0x13ef7a['Contact'][_0xde2f('0x10')],_0x13ef7a[_0xde2f('0xf')]['lastName']);this[_0xde2f('0x11')]=_0x13ef7a[_0xde2f('0x11')]||![];this[_0xde2f('0x12')]=_0x13ef7a[_0xde2f('0xf')][_0xde2f('0x13')];this[_0xde2f('0x14')]=_0x13ef7a['scheduledat'];this[_0xde2f('0x15')]=_0x13ef7a[_0xde2f('0x15')]||0x0;this[_0xde2f('0x16')]=_0x13ef7a['countcongestionretry']||0x0;this['countnoanswerretry']=_0x13ef7a[_0xde2f('0x17')]||0x0;this[_0xde2f('0x18')]=(_0x13ef7a['countbusyretry']||0x0)+(_0x13ef7a['countcongestionretry']||0x0)+(_0x13ef7a['countnoanswerretry']||0x0);this['callback']=_0x13ef7a['callback'];this[_0xde2f('0x19')]=_0x13ef7a[_0xde2f('0x19')];this[_0xde2f('0x1a')]=_0x13ef7a['callbackat'];this['recallme']=_0x13ef7a['recallme'];this[_0xde2f('0x1b')]=_0x13ef7a[_0xde2f('0x1b')];this[_0xde2f('0x1c')]=_0x13ef7a[_0xde2f('0x1c')];this[_0xde2f('0x1d')]=_[_0xde2f('0x3')](_0x13ef7a[_0xde2f('0xa')])?_0x13ef7a[_0xde2f('0x1d')]:_0x13ef7a['Agent']['id'];this[_0xde2f('0x1e')]=_0x13ef7a[_0xde2f('0x1e')];this[_0xde2f('0x1f')]='';this[_0xde2f('0x20')]='';}Action[_0xde2f('0x21')][_0xde2f('0x22')]=function(){return util[_0xde2f('0xc')](_0xde2f('0x23'),this[_0xde2f('0xe')],this[_0xde2f('0x24')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 4f816a9..729a913 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 _0xcfb8=['Answer','crateCustomerReportQueue','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','activeContact','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','Action','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','setMessage','recallMe','sequence','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','run','then','logger2','catch','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcfb8,0x1c1));var _0x8cfb=function(_0x2f28dd,_0x44640a){_0x2f28dd=_0x2f28dd-0x0;var _0x4072da=_0xcfb8[_0x2f28dd];return _0x4072da;};'use strict';var util=require(_0x8cfb('0x0'));var _=require(_0x8cfb('0x1'));var BPromise=require('bluebird');var uuid=require(_0x8cfb('0x2'));var moment=require(_0x8cfb('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x8cfb('0x4'));var logger=require('../../../config/logger')(_0x8cfb('0x5'));var loggerAction=require(_0x8cfb('0x6'))(_0x8cfb('0x7'));var ami=require(_0x8cfb('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x8cfb('0x9'));var ut=require(_0x8cfb('0xa'));config['redis']=_[_0x8cfb('0xb')](config[_0x8cfb('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x8cfb('0xd'))(new Redis(config[_0x8cfb('0xc')]));var Sequence=function(){};Sequence[_0x8cfb('0xe')][_0x8cfb('0xf')]=function(_0x30b22c){this[_0x8cfb('0x10')]=this[_0x8cfb('0x10')]?this[_0x8cfb('0x10')][_0x8cfb('0x11')](_0x30b22c):_0x30b22c();};function Preview(_0x33df7e){this['sequence']=new Sequence();this[_0x8cfb('0x12')]=_0x33df7e[_0x8cfb('0x13')];this[_0x8cfb('0x14')]=_0x33df7e['trunks'];this[_0x8cfb('0x15')]={};this[_0x8cfb('0x16')]=_0x33df7e[_0x8cfb('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x8cfb('0x17'),this['syncOriginateResponse'][_0x8cfb('0x18')](this));ami['on'](_0x8cfb('0x19'),this[_0x8cfb('0x1a')][_0x8cfb('0x18')](this));ami['on'](_0x8cfb('0x1b'),this[_0x8cfb('0x1c')][_0x8cfb('0x18')](this));ami['on'](_0x8cfb('0x1d'),this[_0x8cfb('0x1e')][_0x8cfb('0x18')](this));ami['on'](_0x8cfb('0x1f'),this[_0x8cfb('0x20')]['bind'](this));ami['on'](_0x8cfb('0x21'),this[_0x8cfb('0x22')][_0x8cfb('0x18')](this));ami['on'](_0x8cfb('0x23'),this[_0x8cfb('0x24')]['bind'](this));ami['on'](_0x8cfb('0x25'),this[_0x8cfb('0x26')][_0x8cfb('0x18')](this));this[_0x8cfb('0x27')](this[_0x8cfb('0x12')]);}function emit(_0x320600,_0x49a951,_0x5c719b){io['to'](_0x320600)[_0x8cfb('0x28')](_0x49a951,_0x5c719b);}function emitCampaignPreview(_0x4a5636){if(_0x4a5636[_0x8cfb('0x29')]===_0x8cfb('0x2a')){var _0x5d06b7={'id':_0x4a5636['id'],'name':_0x4a5636[_0x8cfb('0x2b')],'strategy':_0x4a5636[_0x8cfb('0x2c')],'answered':_0x4a5636[_0x8cfb('0x2d')],'available':_0x4a5636[_0x8cfb('0x2e')],'loggedIn':_0x4a5636[_0x8cfb('0x2f')],'pTalking':_0x4a5636[_0x8cfb('0x30')],'sumBillable':_0x4a5636['sumBillable'],'sumDuration':_0x4a5636[_0x8cfb('0x31')],'sumHoldTime':_0x4a5636[_0x8cfb('0x32')]||0x0,'talking':_0x4a5636[_0x8cfb('0x33')],'total':_0x4a5636[_0x8cfb('0x34')],'type':_0x4a5636['type'],'unmanaged':_0x4a5636[_0x8cfb('0x35')],'abandoned':_0x4a5636['abandoned'],'waiting':_0x4a5636['waiting'],'loggedInDb':_0x4a5636[_0x8cfb('0x36')],'dialActive':_0x4a5636[_0x8cfb('0x37')],'dialMethod':_0x4a5636[_0x8cfb('0x38')],'dialOriginateCallerIdName':_0x4a5636[_0x8cfb('0x39')],'dialOriginateCallerIdNumber':_0x4a5636[_0x8cfb('0x3a')],'dialOriginateTimeout':_0x4a5636[_0x8cfb('0x3b')],'dialPrefix':_0x4a5636[_0x8cfb('0x3c')],'outboundAnswerAgiCallsDay':_0x4a5636['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4a5636[_0x8cfb('0x3d')],'outboundBlacklistCallsDay':_0x4a5636[_0x8cfb('0x3e')],'outboundBusyCallsDay':_0x4a5636[_0x8cfb('0x3f')],'outboundCongestionCallsDay':_0x4a5636[_0x8cfb('0x40')],'outboundDropCallsDayACS':_0x4a5636[_0x8cfb('0x41')],'outboundDropCallsDayCallersExit':_0x4a5636[_0x8cfb('0x42')],'outboundDropCallsDayTimeout':_0x4a5636['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4a5636[_0x8cfb('0x43')],'outboundNoSuchCallsDay':_0x4a5636[_0x8cfb('0x44')],'outboundOriginateFailureCallsDay':_0x4a5636[_0x8cfb('0x45')],'outboundReCallsDay':_0x4a5636[_0x8cfb('0x46')],'outboundRejectCallsDay':_0x4a5636['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4a5636[_0x8cfb('0x47')],'predictiveIntervalAnsweredCalls':_0x4a5636['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4a5636[_0x8cfb('0x48')],'predictiveIntervalAvgTalktime':_0x4a5636[_0x8cfb('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x4a5636[_0x8cfb('0x4a')],'predictiveIntervalDroppedCallsTimeout':_0x4a5636[_0x8cfb('0x4b')],'predictiveIntervalErlangCalls':_0x4a5636['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4a5636[_0x8cfb('0x4c')],'predictiveIntervalHitRate':_0x4a5636[_0x8cfb('0x4d')],'predictiveIntervalMultiplicativeFactor':_0x4a5636[_0x8cfb('0x4e')],'predictiveIntervalPauses':_0x4a5636['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4a5636[_0x8cfb('0x4f')],'predictiveIntervalTotalCalls':_0x4a5636[_0x8cfb('0x50')],'message':_0x4a5636[_0x8cfb('0x51')],'originated':_0x4a5636['originated'],'erlangCalls':_0x4a5636[_0x8cfb('0x52')],'erlangCallToSecond':_0x4a5636[_0x8cfb('0x53')],'erlangAbandonmentRate':_0x4a5636[_0x8cfb('0x54')],'erlangBusyFactor':_0x4a5636[_0x8cfb('0x55')],'startPredictive':_0x4a5636[_0x8cfb('0x56')],'startProgressive':_0x4a5636[_0x8cfb('0x57')]};if(_0x4a5636[_0x8cfb('0x58')]){_0x5d06b7['Trunk']={'id':_0x4a5636['Trunk']['id'],'name':_0x4a5636[_0x8cfb('0x58')][_0x8cfb('0x2b')],'active':_0x4a5636[_0x8cfb('0x58')][_0x8cfb('0x59')],'callerid':_0x4a5636[_0x8cfb('0x58')]['callerid']};}if(_0x4a5636[_0x8cfb('0x5a')]){_0x5d06b7[_0x8cfb('0x5a')]={'id':_0x4a5636[_0x8cfb('0x5a')]['id'],'name':_0x4a5636[_0x8cfb('0x5a')]['name']};}var _0x30d943=md5(JSON[_0x8cfb('0x5b')](_0x5d06b7));if(_0x4a5636[_0x8cfb('0x5c')]!==_0x30d943){_0x4a5636['md5']=_0x30d943;emit(util[_0x8cfb('0x5d')](_0x8cfb('0x5e'),_0x5d06b7[_0x8cfb('0x2b')]),'voice_queue:save',_0x5d06b7);}}}function emitVoiceQueueChannelRemove(_0xe81a9){emit(util[_0x8cfb('0x5d')](_0x8cfb('0x5e'),_0xe81a9[_0x8cfb('0x2b')]),_0x8cfb('0x5f'),_0xe81a9);}function notSendMessagesQueue(_0x439f6b){if(_0x439f6b[_0x8cfb('0x60')]){if(_0x439f6b[_0x8cfb('0x61')]===0x0&&_0x439f6b[_0x8cfb('0x30')]===0x0){_0x439f6b[_0x8cfb('0x60')]=![];_0x439f6b[_0x8cfb('0x2e')]=0x0;_0x439f6b[_0x8cfb('0x62')]=0x0;_0x439f6b[_0x8cfb('0x51')]=_0x8cfb('0x63');ut[_0x8cfb('0x64')](_0x8cfb('0x65'),_0x439f6b[_0x8cfb('0x2b')]+_0x8cfb('0x66'));}else{_0x439f6b[_0x8cfb('0x51')]='IS_DISACTIVED';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x439f6b[_0x8cfb('0x2b')]+_0x8cfb('0x67'));}emitCampaignPreview(_0x439f6b);}}Preview[_0x8cfb('0xe')]['loopCampaigns']=function(){var _0x20a6b2=this;setInterval(function(){_0x20a6b2[_0x8cfb('0x68')]();},0x7cf);};Preview[_0x8cfb('0xe')][_0x8cfb('0x68')]=function(){var _0x455675=this[_0x8cfb('0x12')];this[_0x8cfb('0x69')]+=0x1;for(var _0x357162 in _0x455675){if(_0x455675[_0x8cfb('0x6a')](_0x357162)&&(_0x455675[_0x357162]['dialMethod']===_0x8cfb('0x5')||_0x455675[_0x357162][_0x8cfb('0x38')]===_0x8cfb('0x6b'))&&_0x455675[_0x357162]['type']===_0x8cfb('0x2a')){if(this['clockClearZombieChannels']>0x7){this[_0x8cfb('0x69')]=0x0;this['clearZombieChannels']();}}if(_0x455675[_0x8cfb('0x6a')](_0x357162)&&_0x455675[_0x357162]['dialMethod']===_0x8cfb('0x5')&&_0x455675[_0x357162][_0x8cfb('0x29')]===_0x8cfb('0x2a')){if(_0x455675[_0x357162]['dialActive']){this[_0x8cfb('0x6c')](_0x455675[_0x357162]);this[_0x8cfb('0x6d')](_0x455675[_0x357162]);}else{notSendMessagesQueue(_0x455675[_0x357162]);}}}};Preview[_0x8cfb('0xe')]['clearZombieChannel']=function(_0x5c2617){var _0x11cb23=this;this[_0x8cfb('0x6e')][_0x8cfb('0xf')](function(){if(!_[_0x8cfb('0x6f')](_0x11cb23[_0x8cfb('0x15')][_0x5c2617])){loggerAction[_0x8cfb('0x70')](_0x8cfb('0x71'),_0x5c2617,'Queue',_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')],_0x8cfb('0x73'),JSON[_0x8cfb('0x5b')](_0x11cb23[_0x8cfb('0x12')][_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')]][_0x8cfb('0x61')]),_0x8cfb('0x74'),JSON[_0x8cfb('0x5b')](_0x11cb23[_0x8cfb('0x12')][_0x11cb23['actions'][_0x5c2617][_0x8cfb('0x72')]][_0x8cfb('0x30')]),JSON[_0x8cfb('0x5b')](_0x11cb23['actions'][_0x5c2617][_0x8cfb('0x75')]),JSON[_0x8cfb('0x5b')](_[_0x8cfb('0x76')](_0x11cb23[_0x8cfb('0x15')][_0x5c2617],[_0x8cfb('0x77'),_0x8cfb('0x78'),'VoiceQueueId',_0x8cfb('0x79')])));return ami['Action']({'action':'status','channel':_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x7a')]})['catch'](function(_0xb67e1b){if(_0xb67e1b[_0x8cfb('0x51')]===_0x8cfb('0x7b')){setTimeout(function(){if(_0x11cb23['actions'][_0x5c2617]){ut[_0x8cfb('0x7c')](_0x11cb23[_0x8cfb('0x12')][_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')]],_0x8cfb('0x7d'));if(_0x11cb23[_0x8cfb('0x15')][_0x5c2617]['dialAnswer']===!![]){ut[_0x8cfb('0x7e')](_0x11cb23[_0x8cfb('0x12')][_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')]],_0x8cfb('0x7d'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x5c2617,_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')]);}ut[_0x8cfb('0x7f')](_0x8cfb('0x80')+_0x5c2617,_0x11cb23[_0x8cfb('0x15')][_0x5c2617][_0x8cfb('0x72')]);delete _0x11cb23['actions'][_0x5c2617];}},0x2328);}});}});};Preview['prototype'][_0x8cfb('0x81')]=function(){var _0x1985a0=this;loggerAction['info'](_0x8cfb('0x82'),_[_0x8cfb('0x83')](this[_0x8cfb('0x15')]));for(var _0x2c0c6a in this[_0x8cfb('0x15')]){if(_0x1985a0['actions'][_0x8cfb('0x6a')](_0x2c0c6a)){_0x1985a0[_0x8cfb('0x84')](_0x2c0c6a);}}};Preview[_0x8cfb('0xe')][_0x8cfb('0x6d')]=function(_0x1ccbd2){var _0x4d72b2=this;rpcDb[_0x8cfb('0x85')](_0x1ccbd2['id'],ut[_0x8cfb('0x86')](this[_0x8cfb('0x16')]))['then'](function(_0x34cf2c){if(!_[_0x8cfb('0x6f')](_0x34cf2c)){for(var _0x297ee5=0x0;_0x297ee5<_0x34cf2c[_0x8cfb('0x87')];_0x297ee5+=0x1){if(ut[_0x8cfb('0x88')](_0x34cf2c[_0x297ee5][_0x8cfb('0x89')])<_0x1ccbd2[_0x8cfb('0x8a')]*0x3c){_0x4d72b2[_0x8cfb('0x8b')](_0x34cf2c[_0x297ee5]['id'])[_0x8cfb('0x8c')](ut[_0x8cfb('0x8d')]('[RecallMe]'))[_0x8cfb('0x8e')](ut[_0x8cfb('0x8d')]('[RecallMe]'));}else{var _0x2ea0d2=new Action(_0x34cf2c[_0x297ee5],_0x1ccbd2);_0x2ea0d2[_0x8cfb('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1ccbd2['outboundReCallsDay']+=0x1;ut[_0x8cfb('0x90')](_0x2ea0d2,0x17,_0x8cfb('0x91'));if(_0x1ccbd2[_0x8cfb('0x92')]){rpcDb[_0x8cfb('0x93')](ut[_0x8cfb('0x94')](_0x34cf2c[_0x297ee5]));rpcDb[_0x8cfb('0x95')](_0x2ea0d2,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x8cfb('0x90')](_0x2ea0d2,0x16,'RecallFailedTimeout');rpcDb[_0x8cfb('0x95')](_0x2ea0d2,'[HistoryRecallClose]');rpcDb[_0x8cfb('0x96')](_0x2ea0d2,_0x8cfb('0x97'));}}}}})[_0x8cfb('0x8e')](ut[_0x8cfb('0x8d')](_0x8cfb('0x98')));};Preview[_0x8cfb('0xe')][_0x8cfb('0x6c')]=function(_0x3e12d1){_0x3e12d1[_0x8cfb('0x60')]=!![];if(ut['IsNotLoggedIn'](_0x3e12d1[_0x8cfb('0x2f')])){_0x3e12d1[_0x8cfb('0x51')]=_0x8cfb('0x99');}else if(!ut[_0x8cfb('0x9a')](_0x3e12d1[_0x8cfb('0x37')])){_0x3e12d1['message']=_0x8cfb('0x63');}else if(!this[_0x8cfb('0x9b')](_0x3e12d1[_0x8cfb('0x58')])){if(!this[_0x8cfb('0x9b')](_0x3e12d1[_0x8cfb('0x9c')])){_0x3e12d1[_0x8cfb('0x51')]='TRUNK_IS_NOT_REACHABLE';}else{_0x3e12d1[_0x8cfb('0x51')]=_0x8cfb('0x9d');}}else{_0x3e12d1[_0x8cfb('0x51')]=_0x8cfb('0x9d');}emitCampaignPreview(_0x3e12d1);};Preview[_0x8cfb('0xe')][_0x8cfb('0x9e')]=function(_0x3fb2fa,_0x3979d3,_0x4f7cc3){var _0x336515=this;var _0x362eab=this['actions'][_0x3979d3];var _0x3324be=this[_0x8cfb('0x12')][_0x362eab[_0x8cfb('0x72')]];var _0x4d3347;if(_0x3324be){switch(_0x4f7cc3){case'1':_0x3324be['outboundNoSuchCallsDay']+=0x1;_0x362eab[_0x8cfb('0x9f')]=ut[_0x8cfb('0xa0')](_0x362eab);ut[_0x8cfb('0x90')](_0x362eab,0x0,_0x8cfb('0xa1'));rpcDb['createCustomerHistory'](_0x362eab,_0x8cfb('0xa2'));if(ut[_0x8cfb('0xa0')](_0x362eab)>=_0x3324be[_0x8cfb('0xa3')]){_0x4d3347=ut[_0x8cfb('0xa4')](_0x362eab,0xf,_0x8cfb('0xa5'));rpcDb['createCustomerFinal'](_0x4d3347,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8cfb('0x96')](_0x362eab,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x8cfb('0x15')][_0x3fb2fa[_0x8cfb('0xa6')]];break;case'ANSWER':var _0x5b14fc=moment()[_0x8cfb('0x5d')](_0x8cfb('0xa7'));_0x362eab[_0x8cfb('0xa8')]=_0x5b14fc;_0x362eab['answertime']=_0x5b14fc;_0x362eab['dialAnswer']=!![];_0x3324be['pTalking']+=0x1;logger[_0x8cfb('0x70')](_0x8cfb('0xa9'),_0x362eab[_0x8cfb('0xaa')],_0x8cfb('0xab'),_0x3324be[_0x8cfb('0x2b')],_0x8cfb('0x74'),_0x3324be[_0x8cfb('0x30')]);ami[_0x8cfb('0x28')](_0x8cfb('0xac'),ut[_0x8cfb('0xad')](_0x362eab,_0x8cfb('0xae')));if(_0x3324be[_0x8cfb('0xaf')]){ami['emit'](_0x8cfb('0xb0'),ut[_0x8cfb('0xb1')](_0x362eab));}break;case'16':ami['emit'](_0x8cfb('0xb2'),ut['buildObj'](_0x362eab,_0x8cfb('0xb3')));emitVoiceQueueChannelRemove(ut[_0x8cfb('0xad')](_0x362eab,'complete'));_0x3324be[_0x8cfb('0x3d')]+=0x1;_0x3324be['total']+=0x1;_0x3324be[_0x8cfb('0x2d')]+=0x1;ut[_0x8cfb('0x7e')](_0x3324be,_0x8cfb('0xb4'));_0x362eab['countglobal']=ut[_0x8cfb('0xa0')](_0x362eab);ut[_0x8cfb('0x90')](_0x362eab,0x4,_0x8cfb('0xb5'));rpcDb[_0x8cfb('0x95')](_0x362eab,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8cfb('0x96')](_0x362eab,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8cfb('0xb6')](_0x362eab);_0x3324be['sumDuration']+=_0x362eab['talktime'];_0x3324be['sumBillable']+=_0x362eab['talktime'];logger[_0x8cfb('0x70')]('[syncHangup][talking][decrement]',_0x362eab[_0x8cfb('0xaa')],_0x8cfb('0xab'),_0x3324be[_0x8cfb('0x2b')],_0x8cfb('0x74'),_0x3324be['pTalking']);delete this[_0x8cfb('0x15')][_0x3fb2fa[_0x8cfb('0xa6')]];break;case _0x8cfb('0xb7'):_0x3324be[_0x8cfb('0x3f')]+=0x1;_0x362eab[_0x8cfb('0xb8')]+=0x1;_0x362eab['countglobal']=ut[_0x8cfb('0xa0')](_0x362eab);ut['logCustomer'](_0x362eab,0x5,_0x8cfb('0xb9'));rpcDb[_0x8cfb('0x95')](_0x362eab,_0x8cfb('0xba'));if(ut['totalGlobal'](_0x362eab)>=_0x3324be[_0x8cfb('0xa3')]){_0x4d3347=ut[_0x8cfb('0xa4')](_0x362eab,0xf,_0x8cfb('0xa5'));rpcDb[_0x8cfb('0x96')](_0x4d3347,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x362eab[_0x8cfb('0xb8')]>=_0x3324be['dialBusyMaxRetry']){rpcDb[_0x8cfb('0x96')](_0x362eab,_0x8cfb('0xba'));}else{rpcDb[_0x8cfb('0xbb')](ut[_0x8cfb('0xbc')](_0x362eab,'countbusyretry',_0x3324be[_0x8cfb('0xbd')]),_0x362eab[_0x8cfb('0xbe')],_0x362eab['activeContact']);}}break;case _0x8cfb('0xbf'):_0x3324be[_0x8cfb('0x43')]+=0x1;_0x362eab[_0x8cfb('0xc0')]+=0x1;_0x362eab['countglobal']=ut[_0x8cfb('0xa0')](_0x362eab);ut['logCustomer'](_0x362eab,0x3,'NoAnswer');rpcDb[_0x8cfb('0x95')](_0x362eab,_0x8cfb('0xc1'));if(ut['totalGlobal'](_0x362eab)>=_0x3324be[_0x8cfb('0xa3')]){_0x4d3347=ut[_0x8cfb('0xa4')](_0x362eab,0xf,_0x8cfb('0xa5'));rpcDb[_0x8cfb('0x96')](_0x4d3347,_0x8cfb('0xc2'));}else{if(_0x362eab[_0x8cfb('0xc0')]>=_0x3324be[_0x8cfb('0xc3')]){rpcDb[_0x8cfb('0x96')](_0x362eab,_0x8cfb('0xc1'));}else{rpcDb[_0x8cfb('0xbb')](ut[_0x8cfb('0xbc')](_0x362eab,'countnoanswerretry',_0x3324be['dialNoAnswerRetryFrequency']),_0x362eab['unlockAgent'],_0x362eab[_0x8cfb('0xc4')]);}}break;case _0x8cfb('0xc5'):_0x3324be[_0x8cfb('0x40')]+=0x1;_0x362eab[_0x8cfb('0xc6')]+=0x1;_0x362eab[_0x8cfb('0x9f')]=ut[_0x8cfb('0xa0')](_0x362eab);ut[_0x8cfb('0x90')](_0x362eab,0x8,'Congestion');rpcDb[_0x8cfb('0x95')](_0x362eab,_0x8cfb('0xc7'));if(ut[_0x8cfb('0xa0')](_0x362eab)>=_0x3324be[_0x8cfb('0xa3')]){_0x4d3347=ut[_0x8cfb('0xa4')](_0x362eab,0xf,_0x8cfb('0xa5'));rpcDb['createCustomerFinal'](_0x4d3347,_0x8cfb('0xc8'));}else{if(_0x362eab[_0x8cfb('0xc6')]>=_0x3324be[_0x8cfb('0xc9')]){rpcDb[_0x8cfb('0x96')](_0x362eab,_0x8cfb('0xc7'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x362eab,_0x8cfb('0xc6'),_0x3324be[_0x8cfb('0xbd')]),_0x362eab[_0x8cfb('0xbe')],_0x362eab[_0x8cfb('0xc4')]);}}break;case'CANCEL':_0x3324be[_0x8cfb('0xca')]+=0x1;_0x362eab['countglobal']=ut[_0x8cfb('0xa0')](_0x362eab);ut['logCustomer'](_0x362eab,0x14,'AgentReject');rpcDb[_0x8cfb('0x95')](_0x362eab,_0x8cfb('0xcb'));if(_0x362eab[_0x8cfb('0xbe')]){rpcDb[_0x8cfb('0xcc')](_0x362eab[_0x8cfb('0xcd')]);}if(_0x362eab[_0x8cfb('0xc4')]){rpcDb[_0x8cfb('0xce')](_0x362eab['idContact']);}break;default:if(_0x362eab[_0x8cfb('0x75')]){ut[_0x8cfb('0x7e')](_0x3324be,_0x8cfb('0xcf'));ut[_0x8cfb('0x7f')](_0x8cfb('0xd0')+_0x3324be['name'],_0x3fb2fa);}_0x3324be[_0x8cfb('0x47')]+=0x1;_0x362eab[_0x8cfb('0x9f')]=ut[_0x8cfb('0xa0')](_0x362eab);ut[_0x8cfb('0x90')](_0x362eab,0xc,_0x3fb2fa[_0x8cfb('0xd1')]||_0x3fb2fa[_0x8cfb('0xd2')]);rpcDb[_0x8cfb('0x95')](_0x362eab,_0x8cfb('0xd3'));if(ut[_0x8cfb('0xa0')](_0x362eab)>=_0x3324be[_0x8cfb('0xa3')]){_0x4d3347=ut[_0x8cfb('0xa4')](_0x362eab,0xf,_0x8cfb('0xa5'));rpcDb[_0x8cfb('0x96')](_0x4d3347,_0x8cfb('0xd4'));}else{rpcDb['createCustomerFinal'](_0x362eab,_0x8cfb('0xd4'));}delete this[_0x8cfb('0x15')][_0x3fb2fa['linkedid']];}if(!(_0x362eab[_0x8cfb('0x75')]&&_0x4f7cc3==='16')){ut[_0x8cfb('0x7c')](_0x3324be,_0x8cfb('0xd5'));logger[_0x8cfb('0x70')](_0x8cfb('0xd6'),_0x362eab['uniqueid'],_0x8cfb('0xab'),_0x3324be[_0x8cfb('0x2b')],_0x8cfb('0x73'),_0x3324be[_0x8cfb('0x61')]);}if(_0x4f7cc3!==_0x8cfb('0xd7')){delete this[_0x8cfb('0x15')][_0x3fb2fa[_0x8cfb('0xa6')]];delete this['actions'][_0x3fb2fa[_0x8cfb('0xd8')]];}}};Preview[_0x8cfb('0xe')]['callProgressDetectingAgent']=function(_0x5aeed4,_0x190e9c,_0x3d2f58){if(_[_0x8cfb('0xd9')](_0x190e9c)&&_0x8cfb('0xda')!==typeof _0x190e9c){return;}if(_[_0x8cfb('0xd9')](_0x3d2f58)&&'object'!==typeof _0x3d2f58){return;}switch(_0x3d2f58[_0x8cfb('0xdb')]){case'0':ut[_0x8cfb('0xdc')](_0x5aeed4,0x0,_0x8cfb('0xa1'));rpcDb[_0x8cfb('0xdd')](_0x5aeed4,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x8cfb('0xdc')](_0x5aeed4,0x3,_0x8cfb('0xde'));rpcDb['createAgentHistory'](_0x5aeed4,_0x8cfb('0xdf'));break;case'5':ut[_0x8cfb('0xdc')](_0x5aeed4,0x5,_0x8cfb('0xb9'));rpcDb[_0x8cfb('0xdd')](_0x5aeed4,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x5aeed4,0x8,_0x8cfb('0xe0'));rpcDb[_0x8cfb('0xdd')](_0x5aeed4,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8cfb('0xdc')](_0x5aeed4,0x16,_0x8cfb('0xe1'));rpcDb['createAgentHistory'](_0x5aeed4,_0x8cfb('0xe2'));break;default:ut[_0x8cfb('0xdc')](_0x5aeed4,0xc,_0x3d2f58['reason']);rpcDb[_0x8cfb('0xdd')](_0x5aeed4,_0x8cfb('0xe3'));}ut[_0x8cfb('0x7c')](_0x190e9c,_0x8cfb('0xe4'));logger[_0x8cfb('0x70')](_0x8cfb('0xe5'),_0x5aeed4[_0x8cfb('0xaa')],_0x8cfb('0xab'),_0x190e9c[_0x8cfb('0x2b')],'originated:\x20',_0x190e9c[_0x8cfb('0x61')]);delete this['actions'][_0x5aeed4[_0x8cfb('0xaa')]];};Preview['prototype'][_0x8cfb('0xe6')]=function(_0x569f1a,_0x289aa7,_0x92ea0b,_0x49c94d,_0x16e200){var _0x3602eb=this;return new BPromise(function(_0x1868ef,_0x28339b){if(_[_0x8cfb('0x6f')](_0x289aa7)||_[_0x8cfb('0x6f')](_0x289aa7[_0x8cfb('0xe7')])||_['isNil'](_0x289aa7[_0x8cfb('0xe7')][_0x8cfb('0xe8')])||_[_0x8cfb('0x6f')](_0x289aa7[_0x8cfb('0xe9')])){_0x28339b(ut[_0x8cfb('0x51')](_0x8cfb('0xea'),_0x49c94d,_0x16e200));return;}var _0x5b2f9f=uuid['v4']();var _0x4e911b=_0x3602eb['campaignsPreview'][_0x289aa7[_0x8cfb('0xeb')][_0x8cfb('0x2b')]];var _0x4022a5=_0x92ea0b?_0x3602eb['agents'][_0x92ea0b]['id']:undefined;_0x3602eb[_0x8cfb('0x15')][_0x5b2f9f]=new Action(_0x289aa7,_0x4e911b,_0x5b2f9f,_0x92ea0b,_0x4022a5);var _0x399186=_0x3602eb[_0x8cfb('0x15')][_0x5b2f9f];_0x399186[_0x8cfb('0xbe')]=_0x49c94d;_0x399186['activeContact']=_0x16e200;_0x399186[_0x8cfb('0xec')]=_0x92ea0b;if(_[_0x8cfb('0xed')](_0x569f1a)){_0x3602eb[_0x8cfb('0xee')](_0x399186,_0x4e911b,_0x289aa7,_0x92ea0b)['then'](function(_0xd313ad){logger[_0x8cfb('0x70')](_0x8cfb('0xef'),_0x8cfb('0xf0')+_0x399186['queue']+_0x8cfb('0xf1')+_0x399186[_0x8cfb('0xcd')],JSON[_0x8cfb('0x5b')](_0xd313ad));ami[_0x8cfb('0x28')](_0x8cfb('0xf2'),ut[_0x8cfb('0xad')](_0x399186,_0x8cfb('0xf3')));_0x1868ef(ut[_0x8cfb('0x51')](_0x8cfb('0xf4')));})[_0x8cfb('0x8e')](function(_0x4b9f70){ut[_0x8cfb('0x64')]('[Preview][execCall][failure]',_0x4b9f70);_0x28339b(ut[_0x8cfb('0x51')](_0x8cfb('0xf5'),_0x49c94d,_0x16e200));});}else{_0x4e911b[_0x8cfb('0x3e')]+=0x1;ut['logBlacklist'](_0x399186);rpcDb['createHistory'](_0x399186,_0x8cfb('0xf6'));delete _0x3602eb[_0x8cfb('0x15')][_0x5b2f9f];_0x28339b(ut[_0x8cfb('0x51')](_0x8cfb('0xf7'),_0x49c94d,_0x16e200));}});};Preview[_0x8cfb('0xe')][_0x8cfb('0x9b')]=function(_0x526692){return!_['isNil'](_0x526692)&&!_[_0x8cfb('0x6f')](_0x526692[_0x8cfb('0x2b')])&&!_['isNil'](_0x526692[_0x8cfb('0x59')])&&_0x526692['active']&&!_[_0x8cfb('0x6f')](this['trunks'][util[_0x8cfb('0x5d')](_0x8cfb('0xf8'),_0x526692[_0x8cfb('0x2b')])])&&!_['isNil'](this[_0x8cfb('0x14')][util[_0x8cfb('0x5d')](_0x8cfb('0xf8'),_0x526692[_0x8cfb('0x2b')])][_0x8cfb('0xf9')])&&(this[_0x8cfb('0x14')][util[_0x8cfb('0x5d')](_0x8cfb('0xf8'),_0x526692['name'])][_0x8cfb('0xf9')]===_0x8cfb('0xfa')||this[_0x8cfb('0x14')][util[_0x8cfb('0x5d')](_0x8cfb('0xf8'),_0x526692['name'])][_0x8cfb('0xf9')]===_0x8cfb('0xfb'));};Preview[_0x8cfb('0xe')][_0x8cfb('0x8b')]=function(_0xa1a0a8,_0x7f0c98){var _0x141937=this;return new BPromise(function(_0x1dcbe8,_0x72983b){_0x141937[_0x8cfb('0xfc')](_0xa1a0a8,_0x7f0c98)[_0x8cfb('0x8c')](function(_0x22e3d8){_0x1dcbe8(_[_0x8cfb('0x76')](_0x22e3d8,['message']));})[_0x8cfb('0x8e')](function(_0x5b3fd4){if(_0x5b3fd4[_0x8cfb('0xfd')]){rpcDb[_0x8cfb('0xcc')](_0xa1a0a8);}if(_0x5b3fd4[_0x8cfb('0x59')]){rpcDb[_0x8cfb('0xce')](_0xa1a0a8);}_0x72983b(_[_0x8cfb('0x76')](_0x5b3fd4,[_0x8cfb('0x51')]));});});};Preview[_0x8cfb('0xe')][_0x8cfb('0xfc')]=function(_0x31e6b5,_0x15b428){var _0x4a7830=this;return new BPromise(function(_0x6b421d,_0x4e093a){var _0x538934,_0x169ea9;rpcDb['getContactPreview'](_0x31e6b5)['then'](function(_0x843d4f){if(!_[_0x8cfb('0x6f')](_0x843d4f[0x0])){_0x169ea9=_0x843d4f[0x0][_0x8cfb('0xfe')]?![]:!![];_0x538934=_0x843d4f[0x0][_0x8cfb('0xfe')]?!![]:![];_0x538934=_0x15b428?!![]:_0x538934;}var _0xe1ecc=_0x4a7830[_0x8cfb('0xff')](_0x843d4f);if(_0xe1ecc['isValid']){rpcDb[_0x8cfb('0x100')](_['pick'](_0x843d4f[0x0],[_0x8cfb('0xe9'),_0x8cfb('0x101')]))[_0x8cfb('0x8c')](function(_0x4a2a06){_0x4a7830[_0x8cfb('0xe6')](_0x4a2a06,_0x843d4f[0x0],_0x15b428,_0x169ea9,_0x538934)[_0x8cfb('0x8c')](function(_0x58ce7e){_0x6b421d(_0x58ce7e);})[_0x8cfb('0x8e')](function(_0x5efa04){_0x4e093a(_0x5efa04);});})[_0x8cfb('0x8e')](function(_0x427ac9){ut[_0x8cfb('0x64')](_0x8cfb('0x102'),_0x427ac9);_0x4e093a(ut[_0x8cfb('0x51')]('Call\x20unsuccessful',_0x169ea9,_0x538934));});}else{_0x4e093a(ut[_0x8cfb('0x51')](_0xe1ecc[_0x8cfb('0x51')],_0x169ea9,_0x538934));}})['catch'](function(_0x4a79bb){ut[_0x8cfb('0x64')](_0x8cfb('0x103'),_0x4a79bb);_0x4e093a(ut[_0x8cfb('0x51')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x8cfb('0xe')][_0x8cfb('0xff')]=function(_0x59429e){if(_[_0x8cfb('0x6f')](_0x59429e)||_[_0x8cfb('0xed')](_0x59429e)||!_[_0x8cfb('0x6f')](_0x59429e[0x0]['Agent'])&&_[_0x8cfb('0x6f')](_0x59429e[0x0][_0x8cfb('0x104')][_0x8cfb('0x2b')])){ut[_0x8cfb('0x64')]('[Preview][validateContact][Empty\x20Contact]',_0x59429e);return{'isValid':![],'message':_0x8cfb('0x105')};}var _0x2fca95=this[_0x8cfb('0x12')][_0x59429e[0x0][_0x8cfb('0xeb')]['name']];_0x2fca95[_0x8cfb('0x51')]='ACTIVE';if(_[_0x8cfb('0x6f')](_0x2fca95)){ut[_0x8cfb('0x64')](_0x8cfb('0x106'),_0x2fca95);return{'isValid':![],'message':_0x8cfb('0x107')};}if(!this[_0x8cfb('0x9b')](_0x2fca95[_0x8cfb('0x58')])){ut[_0x8cfb('0x64')](_0x8cfb('0x108'),_0x8cfb('0x109')+_0x2fca95[_0x8cfb('0x2b')]+_0x8cfb('0x10a'));if(!this[_0x8cfb('0x9b')](_0x2fca95[_0x8cfb('0x9c')])){ut[_0x8cfb('0x64')](_0x8cfb('0x108'),_0x2fca95[_0x8cfb('0x2b')]+_0x8cfb('0x10b'));return{'isValid':![],'message':_0x8cfb('0x10c')};}}if(!ut[_0x8cfb('0x9a')](_0x2fca95['dialActive'])){ut['logger'](_0x8cfb('0x10d'),_0x2fca95[_0x8cfb('0x2b')]+_0x8cfb('0x10e'));return{'isValid':![],'message':_0x8cfb('0x109')+_0x2fca95[_0x8cfb('0x2b')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8cfb('0x10f')};};Preview[_0x8cfb('0xe')][_0x8cfb('0xee')]=function(_0x53f9b2,_0x2bd215,_0x283679,_0x26da80){var _0x12ffb1=this;return new BPromise(function(_0x3a1c8a,_0x2deeb3){var _0x4dd125=_0x53f9b2['uniqueid'];var _0x817752=_0x12ffb1['isTrunkReachable'](_0x2bd215[_0x8cfb('0x58')])?util[_0x8cfb('0x5d')](_0x8cfb('0x110'),_0x2bd215[_0x8cfb('0x58')][_0x8cfb('0x2b')],_['isNil'](_0x2bd215[_0x8cfb('0x3c')])?'':_0x2bd215[_0x8cfb('0x3c')][_0x8cfb('0x111')]()||'',_0x2bd215[_0x8cfb('0x112')]>0x0?_0x283679[_0x8cfb('0xe7')][_0x8cfb('0xe8')][_0x8cfb('0x113')](_0x2bd215['dialCutDigit']):_0x283679['Contact'][_0x8cfb('0xe8')]):util[_0x8cfb('0x5d')](_0x8cfb('0x110'),_[_0x8cfb('0x6f')](_0x2bd215[_0x8cfb('0x9c')])?_0x2bd215['Trunk']['name']:_0x2bd215[_0x8cfb('0x9c')][_0x8cfb('0x2b')],_['isNil'](_0x2bd215['dialPrefix'])?'':_0x2bd215[_0x8cfb('0x3c')][_0x8cfb('0x111')]()||'',_0x2bd215['dialCutDigit']>0x0?_0x283679[_0x8cfb('0xe7')][_0x8cfb('0xe8')][_0x8cfb('0x113')](_0x2bd215[_0x8cfb('0x112')]):_0x283679[_0x8cfb('0xe7')]['phone']);var _0x4f5b5b=_0x12ffb1[_0x8cfb('0x9b')](_0x2bd215[_0x8cfb('0x58')])?ut[_0x8cfb('0x114')](_0x2bd215[_0x8cfb('0x58')][_0x8cfb('0x115')],_0x2bd215[_0x8cfb('0x39')],_0x2bd215[_0x8cfb('0x116')]>0x0?ut[_0x8cfb('0x117')](_0x2bd215[_0x8cfb('0x3a')],_0x2bd215[_0x8cfb('0x116')]):_0x2bd215['dialOriginateCallerIdNumber']):ut[_0x8cfb('0x114')](_[_0x8cfb('0x6f')](_0x2bd215[_0x8cfb('0x9c')])?_0x2bd215['Trunk'][_0x8cfb('0x115')]:_0x2bd215[_0x8cfb('0x9c')]['callerid'],_0x2bd215[_0x8cfb('0x39')],_0x2bd215[_0x8cfb('0x116')]>0x0?ut[_0x8cfb('0x117')](_0x2bd215[_0x8cfb('0x3a')],_0x2bd215['dialRandomLastDigitCallerIdNumber']):_0x2bd215[_0x8cfb('0x3a')]);if(_0x4f5b5b){_0x53f9b2['originatecalleridname']=ut[_0x8cfb('0x118')](_0x4f5b5b);_0x53f9b2[_0x8cfb('0x119')]=ut['extractCalleridNumber'](_0x4f5b5b);}var _0x3ffaee=ut[_0x8cfb('0x11a')](_0x2bd215,_0x283679,_0x817752,_0x4f5b5b,_0x4dd125,_0x53f9b2);_[_0x8cfb('0x11b')](_0x53f9b2,ut[_0x8cfb('0x11c')](_0x3ffaee));_0x53f9b2[_0x8cfb('0x8f')]=moment()[_0x8cfb('0x5d')](_0x8cfb('0xa7'));ami[_0x8cfb('0x11d')](ut[_0x8cfb('0x11e')](_0x53f9b2,_0x2bd215,_0x3ffaee,_0x53f9b2[_0x8cfb('0xc4')],_0x26da80))[_0x8cfb('0x8c')](function(_0x1963fb){_0x2bd215[_0x8cfb('0x61')]+=0x1;logger[_0x8cfb('0x70')]('[originated][increment]',_0x4dd125,_0x8cfb('0xab'),_0x2bd215['name'],_0x8cfb('0x73'),_0x2bd215[_0x8cfb('0x61')]);_0x3a1c8a(_0x1963fb);})[_0x8cfb('0x8e')](function(_0x3623e3){ut[_0x8cfb('0xdc')](_0x53f9b2,0xe,_0x8cfb('0x11f'));rpcDb[_0x8cfb('0xdd')](_0x53f9b2,_0x8cfb('0x120'));_0x2deeb3(_0x3623e3);});});};Preview[_0x8cfb('0xe')][_0x8cfb('0x20')]=function(_0x4c9f93){if(this[_0x8cfb('0x15')][_0x4c9f93[_0x8cfb('0xa6')]]){this['actions'][_0x4c9f93['linkedid']]['channel']=_0x4c9f93[_0x8cfb('0x7a')];}};Preview['prototype']['syncOriginateResponse']=function(_0x346ed3){var _0x3c352b=this;var _0x39dc9d=this[_0x8cfb('0x15')][_0x346ed3[_0x8cfb('0x121')]];if(_0x39dc9d){if(_0x39dc9d[_0x8cfb('0xec')]&&this['agents'][_0x39dc9d[_0x8cfb('0xec')]]){ut[_0x8cfb('0x122')](_0x39dc9d,this[_0x8cfb('0x16')][_0x39dc9d[_0x8cfb('0xec')]][_0x8cfb('0x2b')],this[_0x8cfb('0x16')][_0x39dc9d['lookAgent']]['id']);}var _0x54abab=_[_0x8cfb('0x123')](_0x39dc9d);_0x54abab['responsetime']=moment()['format'](_0x8cfb('0xa7'));var _0x4d2953=_0x3c352b[_0x8cfb('0x12')][_0x39dc9d[_0x8cfb('0x72')]];if(ut['isFailure'](_0x346ed3['response'])){if(_0x39dc9d[_0x8cfb('0xbe')]){rpcDb['unlockContact'](_0x39dc9d['idContact']);}if(_0x39dc9d[_0x8cfb('0xc4')]){rpcDb['disableContact'](_0x39dc9d['idContact']);}ami[_0x8cfb('0x28')]('custom:agentringnoanswer',ut['buildObj'](_0x39dc9d,_0x8cfb('0x124')));this['callProgressDetectingAgent'](_0x54abab,_0x4d2953,_0x346ed3);}else{_0x39dc9d[_0x8cfb('0x8f')]=moment()['format'](_0x8cfb('0xa7'));ut[_0x8cfb('0xdc')](_0x54abab,0x4,_0x8cfb('0xb5'));rpcDb[_0x8cfb('0xdd')](_0x54abab,_0x8cfb('0x125'));}}};Preview[_0x8cfb('0xe')][_0x8cfb('0x1a')]=function(_0xb0cd48){var _0x5eda9d=this;var _0x476907=this['actions'][_0xb0cd48['linkedid']];var _0x21cb8b;if(_0x476907){_0x21cb8b=this[_0x8cfb('0x12')][_0x476907[_0x8cfb('0x72')]];logger['info'](_0x8cfb('0x126'),_0xb0cd48[_0x8cfb('0xa6')],'\x20Queue',_0x21cb8b[_0x8cfb('0x2b')],_0x8cfb('0x74'),_0x21cb8b['pTalking']);}if(this[_0x8cfb('0x15')][_0xb0cd48[_0x8cfb('0xa6')]]&&_0xb0cd48['linkedid']!==_0xb0cd48[_0x8cfb('0xaa')]){if(_0xb0cd48['cause']==='16'&&this['actions'][_0xb0cd48[_0x8cfb('0xa6')]][_0x8cfb('0x75')]){this[_0x8cfb('0x9e')](_0xb0cd48,_0xb0cd48[_0x8cfb('0xa6')],_0xb0cd48[_0x8cfb('0x127')]);}else if(this[_0x8cfb('0x15')][_0xb0cd48[_0x8cfb('0xa6')]][_0x8cfb('0x75')]){logger[_0x8cfb('0x70')](_0x8cfb('0x128'),_0xb0cd48['linkedid'],_0xb0cd48['cause'],_0x8cfb('0xab'),_0x21cb8b[_0x8cfb('0x2b')],_0x8cfb('0x74'),_0x21cb8b[_0x8cfb('0x30')]);this['callProgressDetectingCustomer'](_0xb0cd48,_0xb0cd48[_0x8cfb('0xa6')],_0xb0cd48[_0x8cfb('0x127')]);}}else if(_0x476907&&_[_0x8cfb('0x6f')](_0x476907[_0x8cfb('0x129')])&&_0x21cb8b[_0x8cfb('0x12a')]&&_0xb0cd48[_0x8cfb('0xa6')]===_0xb0cd48[_0x8cfb('0xaa')]&&_[_0x8cfb('0x6f')](_0xb0cd48[_0x8cfb('0xdb')])&&_0xb0cd48[_0x8cfb('0x127')]==='16'&&_0xb0cd48[_0x8cfb('0x12b')]==='6'&&_[_0x8cfb('0xd9')](_0x476907[_0x8cfb('0x12c')])){if(_0x476907[_0x8cfb('0xbe')]){rpcDb[_0x8cfb('0xcc')](_0x476907[_0x8cfb('0xcd')]);}if(_0x476907[_0x8cfb('0xc4')]){rpcDb['disableContact'](_0x476907['idContact']);}_0xb0cd48[_0x8cfb('0xdb')]='22';this['callProgressDetectingAgent'](_0x476907,_0x21cb8b,_0xb0cd48);}else if(_0x476907&&_0x476907[_0x8cfb('0x12c')]){if(_0xb0cd48[_0x8cfb('0x127')]==='16'&&this[_0x8cfb('0x15')][_0xb0cd48[_0x8cfb('0xa6')]]['dialAnswer']){logger[_0x8cfb('0x70')](_0x8cfb('0x12d'),_0xb0cd48[_0x8cfb('0xa6')],_0xb0cd48[_0x8cfb('0x127')],_0x8cfb('0xab'),_0x21cb8b['name'],_0x8cfb('0x74'),_0x21cb8b[_0x8cfb('0x30')]);this[_0x8cfb('0x9e')](_0xb0cd48,_0xb0cd48['linkedid'],_0xb0cd48['cause']);}else if(this[_0x8cfb('0x15')][_0xb0cd48[_0x8cfb('0xa6')]][_0x8cfb('0x75')]){logger['info'](_0x8cfb('0x128'),_0xb0cd48[_0x8cfb('0xa6')],_0xb0cd48[_0x8cfb('0x127')],'\x20Queue',_0x21cb8b[_0x8cfb('0x2b')],_0x8cfb('0x74'),_0x21cb8b[_0x8cfb('0x30')]);this[_0x8cfb('0x9e')](_0xb0cd48,_0xb0cd48[_0x8cfb('0xa6')],_0xb0cd48[_0x8cfb('0x127')]);}}};Preview['prototype']['syncDialEnd']=function(_0x4ad4b7){if(this[_0x8cfb('0x15')][_0x4ad4b7['destlinkedid']]&&_0x4ad4b7[_0x8cfb('0xd8')]!==_0x4ad4b7[_0x8cfb('0x12e')]){this[_0x8cfb('0x9e')](_0x4ad4b7,_0x4ad4b7['destlinkedid'],_0x4ad4b7[_0x8cfb('0xd2')]);}};Preview[_0x8cfb('0xe')]['syncHangupRequest']=function(_0x552374){if(this['actions'][_0x552374['linkedid']]&&_0x552374['linkedid']!==_0x552374['uniqueid']&&!this[_0x8cfb('0x15')][_0x552374[_0x8cfb('0xa6')]][_0x8cfb('0x75')]){if(_0x552374[_0x8cfb('0x127')]==='1'){this['callProgressDetectingCustomer'](_0x552374,_0x552374[_0x8cfb('0xa6')],_0x552374[_0x8cfb('0x127')]);}}};Preview[_0x8cfb('0xe')][_0x8cfb('0x12f')]=function(_0x2b71a2,_0x2aafee,_0xd4ebe9){if(this['actions'][_0x2b71a2]){if(_[_0x8cfb('0x6f')](this['actions'][_0x2b71a2]['variables'])){this[_0x8cfb('0x15')][_0x2b71a2]['variables']={};}this[_0x8cfb('0x15')][_0x2b71a2][_0x8cfb('0x130')][_0x2aafee]=_0xd4ebe9;}};Preview[_0x8cfb('0xe')][_0x8cfb('0x22')]=function(_0x988c1e){try{if(!_[_0x8cfb('0x6f')](_0x988c1e)){if(ut[_0x8cfb('0x131')](_[_0x8cfb('0x132')](_0x988c1e[_0x8cfb('0x133')])[0x0])){this[_0x8cfb('0x12f')](_0x988c1e[_0x8cfb('0xaa')],_[_0x8cfb('0x132')](_0x988c1e[_0x8cfb('0x133')])[0x0],_0x988c1e[_0x8cfb('0x134')]);}}}catch(_0x3a3f50){logger[_0x8cfb('0x135')](_0x8cfb('0x136'),util[_0x8cfb('0x137')](_0x3a3f50,{'showHidden':![],'depth':null}));}};Preview[_0x8cfb('0xe')]['syncAttendedTransfer']=function(_0x2394fa){if(_0x2394fa){if(this[_0x8cfb('0x15')][_0x2394fa[_0x8cfb('0x138')]]){this[_0x8cfb('0x15')][_0x2394fa[_0x8cfb('0x138')]][_0x8cfb('0x12c')]=!![];}}};Preview[_0x8cfb('0xe')][_0x8cfb('0x26')]=function(_0x162fef){if(_0x162fef){if(this[_0x8cfb('0x15')][_0x162fef[_0x8cfb('0x139')]]){this[_0x8cfb('0x15')][_0x162fef[_0x8cfb('0x139')]]['transfer']=!![];}}};module[_0x8cfb('0x13a')]=Preview; \ No newline at end of file +var _0x0979=['[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','dialstatus','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./action','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','campaignsPreview','emit','type','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','name','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','booked','outbound','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','agentReadyId','then','dialRecallMeTimeout','[RecallMe]','catch','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','linkedid','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countcongestionretry','CANCEL','outboundRejectCallsDay','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][logUnknown]'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x0979,0x1a1));var _0x9097=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x0979[_0x55291a];return _0x3c870c;};'use strict';var util=require(_0x9097('0x0'));var _=require(_0x9097('0x1'));var BPromise=require('bluebird');var uuid=require(_0x9097('0x2'));var moment=require('moment');var md5=require(_0x9097('0x3'));var Redis=require(_0x9097('0x4'));var config=require('../../../config/environment');var logger=require(_0x9097('0x5'))(_0x9097('0x6'));var loggerAction=require(_0x9097('0x5'))(_0x9097('0x7'));var ami=require(_0x9097('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x9097('0x9'));var ut=require('./util/util');config[_0x9097('0xa')]=_[_0x9097('0xb')](config[_0x9097('0xa')],{'host':_0x9097('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9097('0xa')]));var Sequence=function(){};Sequence[_0x9097('0xd')][_0x9097('0xe')]=function(_0x2f4bce){this[_0x9097('0xf')]=this['tail']?this['tail'][_0x9097('0x10')](_0x2f4bce):_0x2f4bce();};function Preview(_0x430b8d){this[_0x9097('0x11')]=new Sequence();this['campaignsPreview']=_0x430b8d[_0x9097('0x12')];this[_0x9097('0x13')]=_0x430b8d[_0x9097('0x13')];this[_0x9097('0x14')]={};this[_0x9097('0x15')]=_0x430b8d['agents'];this[_0x9097('0x16')]=0x0;ami['on'](_0x9097('0x17'),this[_0x9097('0x18')][_0x9097('0x19')](this));ami['on'](_0x9097('0x1a'),this[_0x9097('0x1b')][_0x9097('0x19')](this));ami['on'](_0x9097('0x1c'),this[_0x9097('0x1d')][_0x9097('0x19')](this));ami['on'](_0x9097('0x1e'),this[_0x9097('0x1f')][_0x9097('0x19')](this));ami['on'](_0x9097('0x20'),this['syncNewExten']['bind'](this));ami['on'](_0x9097('0x21'),this[_0x9097('0x22')][_0x9097('0x19')](this));ami['on']('attendedtransfer',this[_0x9097('0x23')][_0x9097('0x19')](this));ami['on'](_0x9097('0x24'),this['syncBlindTransfer']['bind'](this));this[_0x9097('0x25')](this[_0x9097('0x26')]);}function emit(_0xfde192,_0x5aa927,_0x233c80){io['to'](_0xfde192)[_0x9097('0x27')](_0x5aa927,_0x233c80);}function emitCampaignPreview(_0x4b6d92){if(_0x4b6d92[_0x9097('0x28')]==='outbound'){var _0x103735={'id':_0x4b6d92['id'],'name':_0x4b6d92['name'],'strategy':_0x4b6d92['strategy'],'answered':_0x4b6d92['answered'],'available':_0x4b6d92[_0x9097('0x29')],'loggedIn':_0x4b6d92[_0x9097('0x2a')],'pTalking':_0x4b6d92[_0x9097('0x2b')],'sumBillable':_0x4b6d92[_0x9097('0x2c')],'sumDuration':_0x4b6d92[_0x9097('0x2d')],'sumHoldTime':_0x4b6d92['sumHoldTime']||0x0,'talking':_0x4b6d92[_0x9097('0x2e')],'total':_0x4b6d92[_0x9097('0x2f')],'type':_0x4b6d92[_0x9097('0x28')],'unmanaged':_0x4b6d92[_0x9097('0x30')],'abandoned':_0x4b6d92[_0x9097('0x31')],'waiting':_0x4b6d92[_0x9097('0x32')],'loggedInDb':_0x4b6d92[_0x9097('0x33')],'dialActive':_0x4b6d92[_0x9097('0x34')],'dialMethod':_0x4b6d92[_0x9097('0x35')],'dialOriginateCallerIdName':_0x4b6d92['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4b6d92['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4b6d92[_0x9097('0x36')],'dialPrefix':_0x4b6d92[_0x9097('0x37')],'outboundAnswerAgiCallsDay':_0x4b6d92['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4b6d92[_0x9097('0x38')],'outboundBlacklistCallsDay':_0x4b6d92[_0x9097('0x39')],'outboundBusyCallsDay':_0x4b6d92[_0x9097('0x3a')],'outboundCongestionCallsDay':_0x4b6d92['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4b6d92[_0x9097('0x3b')],'outboundDropCallsDayCallersExit':_0x4b6d92[_0x9097('0x3c')],'outboundDropCallsDayTimeout':_0x4b6d92[_0x9097('0x3d')],'outboundNoAnswerCallsDay':_0x4b6d92[_0x9097('0x3e')],'outboundNoSuchCallsDay':_0x4b6d92['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4b6d92[_0x9097('0x3f')],'outboundReCallsDay':_0x4b6d92['outboundReCallsDay'],'outboundRejectCallsDay':_0x4b6d92['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4b6d92['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4b6d92['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4b6d92['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4b6d92['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4b6d92[_0x9097('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x4b6d92['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4b6d92[_0x9097('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x4b6d92[_0x9097('0x42')],'predictiveIntervalHitRate':_0x4b6d92['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4b6d92[_0x9097('0x43')],'predictiveIntervalPauses':_0x4b6d92[_0x9097('0x44')],'predictiveIntervalAvailable':_0x4b6d92[_0x9097('0x45')],'predictiveIntervalTotalCalls':_0x4b6d92[_0x9097('0x46')],'message':_0x4b6d92[_0x9097('0x47')],'originated':_0x4b6d92[_0x9097('0x48')],'erlangCalls':_0x4b6d92[_0x9097('0x49')],'erlangCallToSecond':_0x4b6d92['erlangCallToSecond'],'erlangAbandonmentRate':_0x4b6d92[_0x9097('0x4a')],'erlangBusyFactor':_0x4b6d92['erlangBusyFactor'],'startPredictive':_0x4b6d92[_0x9097('0x4b')],'startProgressive':_0x4b6d92[_0x9097('0x4c')]};if(_0x4b6d92[_0x9097('0x4d')]){_0x103735[_0x9097('0x4d')]={'id':_0x4b6d92['Trunk']['id'],'name':_0x4b6d92[_0x9097('0x4d')]['name'],'active':_0x4b6d92[_0x9097('0x4d')][_0x9097('0x4e')],'callerid':_0x4b6d92[_0x9097('0x4d')][_0x9097('0x4f')]};}if(_0x4b6d92['Interval']){_0x103735[_0x9097('0x50')]={'id':_0x4b6d92['Interval']['id'],'name':_0x4b6d92[_0x9097('0x50')]['name']};}var _0x3f20bc=md5(JSON[_0x9097('0x51')](_0x103735));if(_0x4b6d92[_0x9097('0x3')]!==_0x3f20bc){_0x4b6d92[_0x9097('0x3')]=_0x3f20bc;emit(util['format']('voice:queue:%s',_0x103735[_0x9097('0x52')]),'voice_queue:save',_0x103735);}}}function emitVoiceQueueChannelRemove(_0x49afd5){emit(util[_0x9097('0x53')](_0x9097('0x54'),_0x49afd5['name']),_0x9097('0x55'),_0x49afd5);}function notSendMessagesQueue(_0x59a0d8){if(_0x59a0d8[_0x9097('0x56')]){if(_0x59a0d8[_0x9097('0x48')]===0x0&&_0x59a0d8['pTalking']===0x0){_0x59a0d8[_0x9097('0x56')]=![];_0x59a0d8[_0x9097('0x29')]=0x0;_0x59a0d8[_0x9097('0x57')]=0x0;_0x59a0d8[_0x9097('0x47')]=_0x9097('0x58');ut[_0x9097('0x59')](_0x9097('0x5a'),_0x59a0d8[_0x9097('0x52')]+_0x9097('0x5b'));}else{_0x59a0d8['message']='IS_DISACTIVED';ut[_0x9097('0x59')](_0x9097('0x5a'),_0x59a0d8[_0x9097('0x52')]+_0x9097('0x5c'));}emitCampaignPreview(_0x59a0d8);}}Preview[_0x9097('0xd')][_0x9097('0x25')]=function(){var _0x34cd3c=this;setInterval(function(){_0x34cd3c['syncCampaigns']();},0x7cf);};Preview[_0x9097('0xd')][_0x9097('0x5d')]=function(){var _0x3dea27=this[_0x9097('0x26')];this[_0x9097('0x16')]+=0x1;for(var _0x554eb9 in _0x3dea27){if(_0x3dea27['hasOwnProperty'](_0x554eb9)&&(_0x3dea27[_0x554eb9]['dialMethod']===_0x9097('0x6')||_0x3dea27[_0x554eb9][_0x9097('0x35')]===_0x9097('0x5e'))&&_0x3dea27[_0x554eb9]['type']===_0x9097('0x5f')){if(this[_0x9097('0x16')]>0x7){this[_0x9097('0x16')]=0x0;this[_0x9097('0x60')]();}}if(_0x3dea27['hasOwnProperty'](_0x554eb9)&&_0x3dea27[_0x554eb9]['dialMethod']===_0x9097('0x6')&&_0x3dea27[_0x554eb9][_0x9097('0x28')]==='outbound'){if(_0x3dea27[_0x554eb9][_0x9097('0x34')]){this[_0x9097('0x61')](_0x3dea27[_0x554eb9]);this[_0x9097('0x62')](_0x3dea27[_0x554eb9]);}else{notSendMessagesQueue(_0x3dea27[_0x554eb9]);}}}};Preview[_0x9097('0xd')][_0x9097('0x63')]=function(_0x8dc949){var _0x5d74e0=this;this['sequence'][_0x9097('0xe')](function(){if(!_[_0x9097('0x64')](_0x5d74e0[_0x9097('0x14')][_0x8dc949])){loggerAction[_0x9097('0x65')](_0x9097('0x66'),_0x8dc949,_0x9097('0x67'),_0x5d74e0['actions'][_0x8dc949]['queue'],_0x9097('0x68'),JSON['stringify'](_0x5d74e0[_0x9097('0x26')][_0x5d74e0[_0x9097('0x14')][_0x8dc949][_0x9097('0x69')]][_0x9097('0x48')]),_0x9097('0x6a'),JSON[_0x9097('0x51')](_0x5d74e0[_0x9097('0x26')][_0x5d74e0['actions'][_0x8dc949][_0x9097('0x69')]]['pTalking']),JSON[_0x9097('0x51')](_0x5d74e0[_0x9097('0x14')][_0x8dc949][_0x9097('0x6b')]),JSON[_0x9097('0x51')](_[_0x9097('0x6c')](_0x5d74e0[_0x9097('0x14')][_0x8dc949],['contactId',_0x9097('0x6d'),_0x9097('0x6e'),_0x9097('0x6f')])));return ami[_0x9097('0x70')]({'action':'status','channel':_0x5d74e0['actions'][_0x8dc949][_0x9097('0x71')]})['catch'](function(_0x4f625b){if(_0x4f625b['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5d74e0['actions'][_0x8dc949]){ut[_0x9097('0x72')](_0x5d74e0[_0x9097('0x26')][_0x5d74e0[_0x9097('0x14')][_0x8dc949]['queue']],_0x9097('0x73'));if(_0x5d74e0[_0x9097('0x14')][_0x8dc949][_0x9097('0x6b')]===!![]){ut[_0x9097('0x74')](_0x5d74e0['campaignsPreview'][_0x5d74e0['actions'][_0x8dc949][_0x9097('0x69')]],_0x9097('0x73'));ut[_0x9097('0x75')](_0x9097('0x76')+_0x8dc949,_0x5d74e0['actions'][_0x8dc949][_0x9097('0x69')]);}ut['loggerError'](_0x9097('0x77')+_0x8dc949,_0x5d74e0[_0x9097('0x14')][_0x8dc949][_0x9097('0x69')]);delete _0x5d74e0['actions'][_0x8dc949];}},0x2328);}});}});};Preview[_0x9097('0xd')][_0x9097('0x60')]=function(){var _0x24fcac=this;loggerAction[_0x9097('0x65')]('[action]',_[_0x9097('0x78')](this[_0x9097('0x14')]));for(var _0x2fda9e in this[_0x9097('0x14')]){if(_0x24fcac[_0x9097('0x14')]['hasOwnProperty'](_0x2fda9e)){_0x24fcac['clearZombieChannel'](_0x2fda9e);}}};Preview['prototype']['recallMe']=function(_0x3d5d88){var _0x77d687=this;rpcDb['getContactRecallMe'](_0x3d5d88['id'],ut[_0x9097('0x79')](this[_0x9097('0x15')]))[_0x9097('0x7a')](function(_0x5786f9){if(!_[_0x9097('0x64')](_0x5786f9)){for(var _0x58e7de=0x0;_0x58e7de<_0x5786f9['length'];_0x58e7de+=0x1){if(ut['getDiff'](_0x5786f9[_0x58e7de]['scheduledat'])<_0x3d5d88[_0x9097('0x7b')]*0x3c){_0x77d687['run'](_0x5786f9[_0x58e7de]['id'])['then'](ut['logger2'](_0x9097('0x7c')))[_0x9097('0x7d')](ut[_0x9097('0x7e')](_0x9097('0x7c')));}else{var _0x34b9a9=new Action(_0x5786f9[_0x58e7de],_0x3d5d88);_0x34b9a9[_0x9097('0x7f')]=moment()[_0x9097('0x53')](_0x9097('0x80'));_0x3d5d88[_0x9097('0x81')]+=0x1;ut[_0x9097('0x82')](_0x34b9a9,0x17,_0x9097('0x83'));if(_0x3d5d88[_0x9097('0x84')]){rpcDb[_0x9097('0x85')](ut[_0x9097('0x86')](_0x5786f9[_0x58e7de]));rpcDb[_0x9097('0x87')](_0x34b9a9,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x9097('0x82')](_0x34b9a9,0x16,_0x9097('0x88'));rpcDb['createCustomerHistory'](_0x34b9a9,_0x9097('0x89'));rpcDb[_0x9097('0x8a')](_0x34b9a9,_0x9097('0x89'));}}}}})[_0x9097('0x7d')](ut[_0x9097('0x7e')](_0x9097('0x8b')));};Preview[_0x9097('0xd')]['setMessage']=function(_0x3ba308){_0x3ba308['sendMessageOneNotActive']=!![];if(ut[_0x9097('0x8c')](_0x3ba308[_0x9097('0x2a')])){_0x3ba308[_0x9097('0x47')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x9097('0x8d')](_0x3ba308[_0x9097('0x34')])){_0x3ba308[_0x9097('0x47')]=_0x9097('0x58');}else if(!this[_0x9097('0x8e')](_0x3ba308['Trunk'])){if(!this[_0x9097('0x8e')](_0x3ba308['TrunkBackup'])){_0x3ba308['message']=_0x9097('0x8f');}else{_0x3ba308[_0x9097('0x47')]='ACTIVE';}}else{_0x3ba308[_0x9097('0x47')]='ACTIVE';}emitCampaignPreview(_0x3ba308);};Preview[_0x9097('0xd')][_0x9097('0x90')]=function(_0x293531,_0x103542,_0x5cd03b){var _0x2ce11f=this;var _0x222d72=this[_0x9097('0x14')][_0x103542];var _0x1792ba=this[_0x9097('0x26')][_0x222d72[_0x9097('0x69')]];var _0x5b55b1;if(_0x1792ba){switch(_0x5cd03b){case'1':_0x1792ba['outboundNoSuchCallsDay']+=0x1;_0x222d72[_0x9097('0x91')]=ut[_0x9097('0x92')](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0x0,_0x9097('0x93'));rpcDb['createCustomerHistory'](_0x222d72,_0x9097('0x94'));if(ut[_0x9097('0x92')](_0x222d72)>=_0x1792ba[_0x9097('0x95')]){_0x5b55b1=ut[_0x9097('0x96')](_0x222d72,0xf,_0x9097('0x97'));rpcDb[_0x9097('0x8a')](_0x5b55b1,_0x9097('0x98'));}else{rpcDb['createCustomerFinal'](_0x222d72,_0x9097('0x98'));}delete this[_0x9097('0x14')][_0x293531['linkedid']];break;case _0x9097('0x99'):var _0x3068d7=moment()[_0x9097('0x53')](_0x9097('0x80'));_0x222d72[_0x9097('0x9a')]=_0x3068d7;_0x222d72[_0x9097('0x9b')]=_0x3068d7;_0x222d72[_0x9097('0x6b')]=!![];_0x1792ba[_0x9097('0x2b')]+=0x1;logger[_0x9097('0x65')](_0x9097('0x9c'),_0x222d72[_0x9097('0x9d')],_0x9097('0x9e'),_0x1792ba[_0x9097('0x52')],'pTalking:\x20',_0x1792ba['pTalking']);ami[_0x9097('0x27')](_0x9097('0x9f'),ut[_0x9097('0xa0')](_0x222d72,_0x9097('0xa1')));if(_0x1792ba[_0x9097('0xa2')]){ami[_0x9097('0x27')](_0x9097('0xa3'),ut[_0x9097('0xa4')](_0x222d72));}break;case'16':ami['emit']('custom:agentcomplete',ut['buildObj'](_0x222d72,'complete'));emitVoiceQueueChannelRemove(ut[_0x9097('0xa0')](_0x222d72,_0x9097('0xa5')));_0x1792ba[_0x9097('0x38')]+=0x1;_0x1792ba['total']+=0x1;_0x1792ba[_0x9097('0xa6')]+=0x1;ut[_0x9097('0x74')](_0x1792ba,_0x9097('0xa7'));_0x222d72[_0x9097('0x91')]=ut['totalGlobal'](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0x4,'Answer');rpcDb['createCustomerHistory'](_0x222d72,_0x9097('0xa8'));rpcDb[_0x9097('0x8a')](_0x222d72,_0x9097('0xa9'));rpcDb[_0x9097('0xaa')](_0x222d72);_0x1792ba[_0x9097('0x2d')]+=_0x222d72['talktime'];_0x1792ba[_0x9097('0x2c')]+=_0x222d72[_0x9097('0xab')];logger['info']('[syncHangup][talking][decrement]',_0x222d72['uniqueid'],_0x9097('0x9e'),_0x1792ba[_0x9097('0x52')],_0x9097('0x6a'),_0x1792ba[_0x9097('0x2b')]);delete this[_0x9097('0x14')][_0x293531[_0x9097('0xac')]];break;case _0x9097('0xad'):_0x1792ba['outboundBusyCallsDay']+=0x1;_0x222d72[_0x9097('0xae')]+=0x1;_0x222d72['countglobal']=ut['totalGlobal'](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0x5,_0x9097('0xaf'));rpcDb[_0x9097('0x87')](_0x222d72,_0x9097('0xb0'));if(ut[_0x9097('0x92')](_0x222d72)>=_0x1792ba['dialGlobalMaxRetry']){_0x5b55b1=ut[_0x9097('0x96')](_0x222d72,0xf,'Global');rpcDb[_0x9097('0x8a')](_0x5b55b1,_0x9097('0xb1'));}else{if(_0x222d72[_0x9097('0xae')]>=_0x1792ba[_0x9097('0xb2')]){rpcDb[_0x9097('0x8a')](_0x222d72,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0x9097('0xb3')](_0x222d72,_0x9097('0xae'),_0x1792ba[_0x9097('0xb4')]),_0x222d72[_0x9097('0xb5')],_0x222d72[_0x9097('0xb6')]);}}break;case _0x9097('0xb7'):_0x1792ba[_0x9097('0x3e')]+=0x1;_0x222d72[_0x9097('0xb8')]+=0x1;_0x222d72[_0x9097('0x91')]=ut[_0x9097('0x92')](_0x222d72);ut['logCustomer'](_0x222d72,0x3,_0x9097('0xb9'));rpcDb[_0x9097('0x87')](_0x222d72,_0x9097('0xba'));if(ut[_0x9097('0x92')](_0x222d72)>=_0x1792ba[_0x9097('0x95')]){_0x5b55b1=ut[_0x9097('0x96')](_0x222d72,0xf,_0x9097('0x97'));rpcDb['createCustomerFinal'](_0x5b55b1,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x222d72[_0x9097('0xb8')]>=_0x1792ba['dialNoAnswerMaxRetry']){rpcDb[_0x9097('0x8a')](_0x222d72,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x9097('0xbb')](ut[_0x9097('0xb3')](_0x222d72,_0x9097('0xb8'),_0x1792ba[_0x9097('0xbc')]),_0x222d72[_0x9097('0xb5')],_0x222d72['activeContact']);}}break;case'CONGESTION':_0x1792ba['outboundCongestionCallsDay']+=0x1;_0x222d72['countcongestionretry']+=0x1;_0x222d72[_0x9097('0x91')]=ut[_0x9097('0x92')](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0x8,'Congestion');rpcDb[_0x9097('0x87')](_0x222d72,_0x9097('0xbd'));if(ut[_0x9097('0x92')](_0x222d72)>=_0x1792ba['dialGlobalMaxRetry']){_0x5b55b1=ut['cloneAction'](_0x222d72,0xf,_0x9097('0x97'));rpcDb[_0x9097('0x8a')](_0x5b55b1,_0x9097('0xbe'));}else{if(_0x222d72['countcongestionretry']>=_0x1792ba[_0x9097('0xbf')]){rpcDb[_0x9097('0x8a')](_0x222d72,_0x9097('0xbd'));}else{rpcDb[_0x9097('0xbb')](ut[_0x9097('0xb3')](_0x222d72,_0x9097('0xc0'),_0x1792ba[_0x9097('0xb4')]),_0x222d72[_0x9097('0xb5')],_0x222d72[_0x9097('0xb6')]);}}break;case _0x9097('0xc1'):_0x1792ba[_0x9097('0xc2')]+=0x1;_0x222d72['countglobal']=ut[_0x9097('0x92')](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0x14,_0x9097('0xc3'));rpcDb['createCustomerHistory'](_0x222d72,_0x9097('0xc4'));if(_0x222d72[_0x9097('0xb5')]){rpcDb[_0x9097('0xc5')](_0x222d72[_0x9097('0xc6')]);}if(_0x222d72[_0x9097('0xb6')]){rpcDb[_0x9097('0xc7')](_0x222d72[_0x9097('0xc6')]);}break;default:if(_0x222d72[_0x9097('0x6b')]){ut['decrementTalkink'](_0x1792ba,_0x9097('0xc8'));ut[_0x9097('0x75')](_0x9097('0xc9')+_0x1792ba['name'],_0x293531);}_0x1792ba[_0x9097('0xca')]+=0x1;_0x222d72[_0x9097('0x91')]=ut[_0x9097('0x92')](_0x222d72);ut[_0x9097('0x82')](_0x222d72,0xc,_0x293531[_0x9097('0xcb')]||_0x293531['dialstatus']);rpcDb['createCustomerHistory'](_0x222d72,_0x9097('0xcc'));if(ut[_0x9097('0x92')](_0x222d72)>=_0x1792ba[_0x9097('0x95')]){_0x5b55b1=ut[_0x9097('0x96')](_0x222d72,0xf,'Global');rpcDb['createCustomerFinal'](_0x5b55b1,_0x9097('0xcd'));}else{rpcDb[_0x9097('0x8a')](_0x222d72,_0x9097('0xcd'));}delete this[_0x9097('0x14')][_0x293531[_0x9097('0xac')]];}if(!(_0x222d72['dialAnswer']&&_0x5cd03b==='16')){ut['updateOriginated'](_0x1792ba,_0x9097('0xce'));logger[_0x9097('0x65')](_0x9097('0xcf'),_0x222d72[_0x9097('0x9d')],'\x20Queue',_0x1792ba[_0x9097('0x52')],_0x9097('0x68'),_0x1792ba[_0x9097('0x48')]);}if(_0x5cd03b!=='ANSWER'){delete this[_0x9097('0x14')][_0x293531[_0x9097('0xac')]];delete this[_0x9097('0x14')][_0x293531['destlinkedid']];}}};Preview[_0x9097('0xd')][_0x9097('0xd0')]=function(_0x498a31,_0x3f0798,_0x4eab14){if(_['isUndefined'](_0x3f0798)&&_0x9097('0xd1')!==typeof _0x3f0798){return;}if(_['isUndefined'](_0x4eab14)&&_0x9097('0xd1')!==typeof _0x4eab14){return;}switch(_0x4eab14[_0x9097('0xd2')]){case'0':ut[_0x9097('0xd3')](_0x498a31,0x0,'NoSuchNumber');rpcDb[_0x9097('0xd4')](_0x498a31,_0x9097('0xd5'));break;case'3':ut[_0x9097('0xd3')](_0x498a31,0x3,_0x9097('0xb9'));rpcDb[_0x9097('0xd4')](_0x498a31,_0x9097('0xd6'));break;case'5':ut[_0x9097('0xd3')](_0x498a31,0x5,_0x9097('0xaf'));rpcDb[_0x9097('0xd4')](_0x498a31,_0x9097('0xd7'));break;case'8':ut['logAgent'](_0x498a31,0x8,_0x9097('0xd8'));rpcDb[_0x9097('0xd4')](_0x498a31,_0x9097('0xd9'));break;case'22':ut[_0x9097('0xd3')](_0x498a31,0x16,_0x9097('0xda'));rpcDb[_0x9097('0xd4')](_0x498a31,_0x9097('0xdb'));break;default:ut[_0x9097('0xd3')](_0x498a31,0xc,_0x4eab14[_0x9097('0xd2')]);rpcDb['createAgentHistory'](_0x498a31,_0x9097('0xd9'));}ut[_0x9097('0x72')](_0x3f0798,_0x9097('0xdc'));logger[_0x9097('0x65')](_0x9097('0xdd'),_0x498a31[_0x9097('0x9d')],_0x9097('0x9e'),_0x3f0798[_0x9097('0x52')],_0x9097('0x68'),_0x3f0798[_0x9097('0x48')]);delete this[_0x9097('0x14')][_0x498a31[_0x9097('0x9d')]];};Preview[_0x9097('0xd')][_0x9097('0xde')]=function(_0x5a85d7,_0x20990e,_0x448830,_0x331fa0,_0x36dc00){var _0xa81c46=this;return new BPromise(function(_0x136154,_0x1abe52){if(_[_0x9097('0x64')](_0x20990e)||_[_0x9097('0x64')](_0x20990e[_0x9097('0xdf')])||_['isNil'](_0x20990e['Contact'][_0x9097('0xe0')])||_['isNil'](_0x20990e[_0x9097('0x6e')])){_0x1abe52(ut['message'](_0x9097('0xe1'),_0x331fa0,_0x36dc00));return;}var _0x447a99=uuid['v4']();var _0x23a52f=_0xa81c46[_0x9097('0x26')][_0x20990e[_0x9097('0x67')][_0x9097('0x52')]];var _0x480af6=_0x448830?_0xa81c46[_0x9097('0x15')][_0x448830]['id']:undefined;_0xa81c46[_0x9097('0x14')][_0x447a99]=new Action(_0x20990e,_0x23a52f,_0x447a99,_0x448830,_0x480af6);var _0x238746=_0xa81c46[_0x9097('0x14')][_0x447a99];_0x238746[_0x9097('0xb5')]=_0x331fa0;_0x238746[_0x9097('0xb6')]=_0x36dc00;_0x238746[_0x9097('0xe2')]=_0x448830;if(_[_0x9097('0xe3')](_0x5a85d7)){_0xa81c46[_0x9097('0xe4')](_0x238746,_0x23a52f,_0x20990e,_0x448830)[_0x9097('0x7a')](function(_0x363002){logger[_0x9097('0x65')](_0x9097('0xe5'),_0x9097('0xe6')+_0x238746[_0x9097('0x69')]+'\x20IdHopper:\x20'+_0x238746['idContact'],JSON[_0x9097('0x51')](_0x363002));ami[_0x9097('0x27')]('custom:agentcalled',ut[_0x9097('0xa0')](_0x238746,_0x9097('0xe7')));_0x136154(ut[_0x9097('0x47')](_0x9097('0xe8')));})[_0x9097('0x7d')](function(_0x548deb){ut['logger']('[Preview][execCall][failure]',_0x548deb);_0x1abe52(ut[_0x9097('0x47')](_0x9097('0xe9'),_0x331fa0,_0x36dc00));});}else{_0x23a52f['outboundBlacklistCallsDay']+=0x1;ut[_0x9097('0xea')](_0x238746);rpcDb[_0x9097('0xeb')](_0x238746,_0x9097('0xec'));delete _0xa81c46[_0x9097('0x14')][_0x447a99];_0x1abe52(ut['message'](_0x9097('0xed'),_0x331fa0,_0x36dc00));}});};Preview[_0x9097('0xd')][_0x9097('0x8e')]=function(_0x11521d){return!_[_0x9097('0x64')](_0x11521d)&&!_[_0x9097('0x64')](_0x11521d[_0x9097('0x52')])&&!_['isNil'](_0x11521d[_0x9097('0x4e')])&&_0x11521d['active']&&!_['isNil'](this['trunks'][util[_0x9097('0x53')](_0x9097('0xee'),_0x11521d[_0x9097('0x52')])])&&!_[_0x9097('0x64')](this[_0x9097('0x13')][util[_0x9097('0x53')](_0x9097('0xee'),_0x11521d[_0x9097('0x52')])][_0x9097('0xef')])&&(this['trunks'][util[_0x9097('0x53')](_0x9097('0xee'),_0x11521d[_0x9097('0x52')])][_0x9097('0xef')]===_0x9097('0xf0')||this[_0x9097('0x13')][util['format'](_0x9097('0xee'),_0x11521d[_0x9097('0x52')])]['status']===_0x9097('0xf1'));};Preview['prototype']['run']=function(_0xbf8a8,_0x3ee5b3){var _0x499bd0=this;return new BPromise(function(_0x2af6a3,_0x54f5b8){_0x499bd0[_0x9097('0xf2')](_0xbf8a8,_0x3ee5b3)[_0x9097('0x7a')](function(_0x235286){_0x2af6a3(_['pick'](_0x235286,[_0x9097('0x47')]));})['catch'](function(_0x57e3e3){if(_0x57e3e3[_0x9097('0xf3')]){rpcDb[_0x9097('0xc5')](_0xbf8a8);}if(_0x57e3e3[_0x9097('0x4e')]){rpcDb[_0x9097('0xc7')](_0xbf8a8);}_0x54f5b8(_[_0x9097('0x6c')](_0x57e3e3,[_0x9097('0x47')]));});});};Preview[_0x9097('0xd')][_0x9097('0xf2')]=function(_0x59fa82,_0x1abcf4){var _0x1a9798=this;return new BPromise(function(_0x58cc00,_0xdad6c4){var _0x268578,_0x2326a4;rpcDb[_0x9097('0xf4')](_0x59fa82)[_0x9097('0x7a')](function(_0x5631ba){if(!_[_0x9097('0x64')](_0x5631ba[0x0])){_0x2326a4=_0x5631ba[0x0]['recallme']?![]:!![];_0x268578=_0x5631ba[0x0][_0x9097('0xf5')]?!![]:![];_0x268578=_0x1abcf4?!![]:_0x268578;}var _0x1fe7b7=_0x1a9798[_0x9097('0xf6')](_0x5631ba);if(_0x1fe7b7[_0x9097('0xf7')]){rpcDb['checkIsBlackList'](_['pick'](_0x5631ba[0x0],[_0x9097('0x6e'),_0x9097('0xf8')]))[_0x9097('0x7a')](function(_0xa8cb6b){_0x1a9798['checkInBlack'](_0xa8cb6b,_0x5631ba[0x0],_0x1abcf4,_0x2326a4,_0x268578)[_0x9097('0x7a')](function(_0x2bf752){_0x58cc00(_0x2bf752);})[_0x9097('0x7d')](function(_0x3b5dce){_0xdad6c4(_0x3b5dce);});})[_0x9097('0x7d')](function(_0x5d970f){ut['logger'](_0x9097('0xf9'),_0x5d970f);_0xdad6c4(ut[_0x9097('0x47')]('Call\x20unsuccessful',_0x2326a4,_0x268578));});}else{_0xdad6c4(ut['message'](_0x1fe7b7[_0x9097('0x47')],_0x2326a4,_0x268578));}})[_0x9097('0x7d')](function(_0x3fb434){ut[_0x9097('0x59')](_0x9097('0xfa'),_0x3fb434);_0xdad6c4(ut[_0x9097('0x47')](_0x9097('0xfb'),![],!![]));});});};Preview[_0x9097('0xd')][_0x9097('0xf6')]=function(_0x198b98){if(_[_0x9097('0x64')](_0x198b98)||_[_0x9097('0xe3')](_0x198b98)||!_[_0x9097('0x64')](_0x198b98[0x0]['Agent'])&&_[_0x9097('0x64')](_0x198b98[0x0][_0x9097('0xfc')]['name'])){ut[_0x9097('0x59')](_0x9097('0xfd'),_0x198b98);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1e46a7=this[_0x9097('0x26')][_0x198b98[0x0][_0x9097('0x67')][_0x9097('0x52')]];_0x1e46a7[_0x9097('0x47')]=_0x9097('0xfe');if(_[_0x9097('0x64')](_0x1e46a7)){ut['logger'](_0x9097('0xff'),_0x1e46a7);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x9097('0x8e')](_0x1e46a7[_0x9097('0x4d')])){ut[_0x9097('0x59')](_0x9097('0x100'),_0x9097('0x101')+_0x1e46a7[_0x9097('0x52')]+_0x9097('0x102'));if(!this[_0x9097('0x8e')](_0x1e46a7[_0x9097('0x103')])){ut[_0x9097('0x59')](_0x9097('0x100'),_0x1e46a7[_0x9097('0x52')]+_0x9097('0x104'));return{'isValid':![],'message':_0x9097('0x105')};}}if(!ut['isActive'](_0x1e46a7[_0x9097('0x34')])){ut[_0x9097('0x59')](_0x9097('0x106'),_0x1e46a7[_0x9097('0x52')]+_0x9097('0x107'));return{'isValid':![],'message':_0x9097('0x101')+_0x1e46a7[_0x9097('0x52')]+_0x9097('0x107')};}return{'isValid':!![],'message':_0x9097('0x108')};};Preview['prototype'][_0x9097('0xe4')]=function(_0x55fa18,_0x3a29d4,_0x58bac4,_0x183058){var _0x2c7537=this;return new BPromise(function(_0x4cf649,_0x333fd2){var _0x11ec22=_0x55fa18[_0x9097('0x9d')];var _0x39fe29=_0x2c7537[_0x9097('0x8e')](_0x3a29d4[_0x9097('0x4d')])?util[_0x9097('0x53')](_0x9097('0x109'),_0x3a29d4[_0x9097('0x4d')]['name'],_['isNil'](_0x3a29d4[_0x9097('0x37')])?'':_0x3a29d4['dialPrefix'][_0x9097('0x10a')]()||'',_0x3a29d4[_0x9097('0x10b')]>0x0?_0x58bac4[_0x9097('0xdf')]['phone'][_0x9097('0x10c')](_0x3a29d4['dialCutDigit']):_0x58bac4[_0x9097('0xdf')][_0x9097('0xe0')]):util[_0x9097('0x53')](_0x9097('0x109'),_[_0x9097('0x64')](_0x3a29d4[_0x9097('0x103')])?_0x3a29d4[_0x9097('0x4d')][_0x9097('0x52')]:_0x3a29d4[_0x9097('0x103')]['name'],_[_0x9097('0x64')](_0x3a29d4[_0x9097('0x37')])?'':_0x3a29d4[_0x9097('0x37')][_0x9097('0x10a')]()||'',_0x3a29d4[_0x9097('0x10b')]>0x0?_0x58bac4[_0x9097('0xdf')][_0x9097('0xe0')][_0x9097('0x10c')](_0x3a29d4[_0x9097('0x10b')]):_0x58bac4['Contact'][_0x9097('0xe0')]);var _0x5bdeae=_0x2c7537[_0x9097('0x8e')](_0x3a29d4[_0x9097('0x4d')])?ut[_0x9097('0x10d')](_0x3a29d4['Trunk']['callerid'],_0x3a29d4[_0x9097('0x10e')],_0x3a29d4['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x9097('0x10f')](_0x3a29d4[_0x9097('0x110')],_0x3a29d4[_0x9097('0x111')]):_0x3a29d4[_0x9097('0x110')]):ut[_0x9097('0x10d')](_[_0x9097('0x64')](_0x3a29d4[_0x9097('0x103')])?_0x3a29d4['Trunk'][_0x9097('0x4f')]:_0x3a29d4[_0x9097('0x103')][_0x9097('0x4f')],_0x3a29d4[_0x9097('0x10e')],_0x3a29d4[_0x9097('0x111')]>0x0?ut[_0x9097('0x10f')](_0x3a29d4[_0x9097('0x110')],_0x3a29d4[_0x9097('0x111')]):_0x3a29d4[_0x9097('0x110')]);if(_0x5bdeae){_0x55fa18[_0x9097('0x112')]=ut[_0x9097('0x113')](_0x5bdeae);_0x55fa18[_0x9097('0x114')]=ut[_0x9097('0x115')](_0x5bdeae);}var _0x5142c3=ut['addVariables'](_0x3a29d4,_0x58bac4,_0x39fe29,_0x5bdeae,_0x11ec22,_0x55fa18);_[_0x9097('0x116')](_0x55fa18,ut[_0x9097('0x117')](_0x5142c3));_0x55fa18[_0x9097('0x7f')]=moment()[_0x9097('0x53')](_0x9097('0x80'));ami[_0x9097('0x70')](ut[_0x9097('0x118')](_0x55fa18,_0x3a29d4,_0x5142c3,_0x55fa18[_0x9097('0xb6')],_0x183058))[_0x9097('0x7a')](function(_0x2c8ef8){_0x3a29d4[_0x9097('0x48')]+=0x1;logger['info'](_0x9097('0x119'),_0x11ec22,_0x9097('0x9e'),_0x3a29d4[_0x9097('0x52')],'originated:\x20',_0x3a29d4[_0x9097('0x48')]);_0x4cf649(_0x2c8ef8);})[_0x9097('0x7d')](function(_0x5b6081){ut[_0x9097('0xd3')](_0x55fa18,0xe,_0x9097('0x11a'));rpcDb[_0x9097('0xd4')](_0x55fa18,_0x9097('0x11b'));_0x333fd2(_0x5b6081);});});};Preview['prototype'][_0x9097('0x11c')]=function(_0x108ad1){if(this[_0x9097('0x14')][_0x108ad1[_0x9097('0xac')]]){this['actions'][_0x108ad1['linkedid']]['channel']=_0x108ad1[_0x9097('0x71')];}};Preview[_0x9097('0xd')]['syncOriginateResponse']=function(_0x853eaf){var _0x396008=this;var _0x536e8f=this[_0x9097('0x14')][_0x853eaf[_0x9097('0x11d')]];if(_0x536e8f){if(_0x536e8f['lookAgent']&&this[_0x9097('0x15')][_0x536e8f[_0x9097('0xe2')]]){ut['logLookAgent'](_0x536e8f,this[_0x9097('0x15')][_0x536e8f[_0x9097('0xe2')]][_0x9097('0x52')],this[_0x9097('0x15')][_0x536e8f[_0x9097('0xe2')]]['id']);}var _0x38a44e=_['clone'](_0x536e8f);_0x38a44e[_0x9097('0x9a')]=moment()[_0x9097('0x53')](_0x9097('0x80'));var _0x5f1e98=_0x396008[_0x9097('0x26')][_0x536e8f[_0x9097('0x69')]];if(ut['isFailure'](_0x853eaf['response'])){if(_0x536e8f[_0x9097('0xb5')]){rpcDb[_0x9097('0xc5')](_0x536e8f[_0x9097('0xc6')]);}if(_0x536e8f['activeContact']){rpcDb['disableContact'](_0x536e8f[_0x9097('0xc6')]);}ami['emit'](_0x9097('0x11e'),ut[_0x9097('0xa0')](_0x536e8f,_0x9097('0x11f')));this[_0x9097('0xd0')](_0x38a44e,_0x5f1e98,_0x853eaf);}else{_0x536e8f['starttime']=moment()[_0x9097('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x9097('0xd3')](_0x38a44e,0x4,_0x9097('0x120'));rpcDb['createAgentHistory'](_0x38a44e,_0x9097('0x121'));}}};Preview['prototype'][_0x9097('0x1b')]=function(_0x1857a6){var _0xfdb98d=this;var _0x38dd72=this[_0x9097('0x14')][_0x1857a6['linkedid']];var _0x2e1db3;if(_0x38dd72){_0x2e1db3=this[_0x9097('0x26')][_0x38dd72[_0x9097('0x69')]];logger[_0x9097('0x65')](_0x9097('0x122'),_0x1857a6[_0x9097('0xac')],_0x9097('0x9e'),_0x2e1db3[_0x9097('0x52')],'pTalking:\x20',_0x2e1db3[_0x9097('0x2b')]);}if(this[_0x9097('0x14')][_0x1857a6[_0x9097('0xac')]]&&_0x1857a6[_0x9097('0xac')]!==_0x1857a6[_0x9097('0x9d')]){if(_0x1857a6[_0x9097('0x123')]==='16'&&this[_0x9097('0x14')][_0x1857a6[_0x9097('0xac')]]['dialAnswer']){this[_0x9097('0x90')](_0x1857a6,_0x1857a6[_0x9097('0xac')],_0x1857a6['cause']);}else if(this[_0x9097('0x14')][_0x1857a6[_0x9097('0xac')]][_0x9097('0x6b')]){logger['info'](_0x9097('0x124'),_0x1857a6[_0x9097('0xac')],_0x1857a6[_0x9097('0x123')],_0x9097('0x9e'),_0x2e1db3['name'],_0x9097('0x6a'),_0x2e1db3['pTalking']);this[_0x9097('0x90')](_0x1857a6,_0x1857a6[_0x9097('0xac')],_0x1857a6[_0x9097('0x123')]);}}else if(_0x38dd72&&_['isNil'](_0x38dd72['statedesc'])&&_0x2e1db3['dialQueueProject']&&_0x1857a6[_0x9097('0xac')]===_0x1857a6[_0x9097('0x9d')]&&_[_0x9097('0x64')](_0x1857a6[_0x9097('0xd2')])&&_0x1857a6[_0x9097('0x123')]==='16'&&_0x1857a6[_0x9097('0x125')]==='6'&&_[_0x9097('0x126')](_0x38dd72[_0x9097('0x127')])){if(_0x38dd72[_0x9097('0xb5')]){rpcDb[_0x9097('0xc5')](_0x38dd72[_0x9097('0xc6')]);}if(_0x38dd72['activeContact']){rpcDb[_0x9097('0xc7')](_0x38dd72[_0x9097('0xc6')]);}_0x1857a6[_0x9097('0xd2')]='22';this['callProgressDetectingAgent'](_0x38dd72,_0x2e1db3,_0x1857a6);}else if(_0x38dd72&&_0x38dd72[_0x9097('0x127')]){if(_0x1857a6[_0x9097('0x123')]==='16'&&this[_0x9097('0x14')][_0x1857a6['linkedid']][_0x9097('0x6b')]){logger[_0x9097('0x65')](_0x9097('0x128'),_0x1857a6['linkedid'],_0x1857a6[_0x9097('0x123')],_0x9097('0x9e'),_0x2e1db3[_0x9097('0x52')],_0x9097('0x6a'),_0x2e1db3['pTalking']);this[_0x9097('0x90')](_0x1857a6,_0x1857a6[_0x9097('0xac')],_0x1857a6[_0x9097('0x123')]);}else if(this[_0x9097('0x14')][_0x1857a6['linkedid']][_0x9097('0x6b')]){logger['info'](_0x9097('0x124'),_0x1857a6['linkedid'],_0x1857a6[_0x9097('0x123')],_0x9097('0x9e'),_0x2e1db3[_0x9097('0x52')],_0x9097('0x6a'),_0x2e1db3[_0x9097('0x2b')]);this[_0x9097('0x90')](_0x1857a6,_0x1857a6['linkedid'],_0x1857a6[_0x9097('0x123')]);}}};Preview[_0x9097('0xd')][_0x9097('0x1f')]=function(_0x59f345){if(this['actions'][_0x59f345[_0x9097('0x129')]]&&_0x59f345[_0x9097('0x129')]!==_0x59f345[_0x9097('0x12a')]){this[_0x9097('0x90')](_0x59f345,_0x59f345[_0x9097('0x129')],_0x59f345[_0x9097('0x12b')]);}};Preview['prototype'][_0x9097('0x1d')]=function(_0x2016d4){if(this[_0x9097('0x14')][_0x2016d4[_0x9097('0xac')]]&&_0x2016d4[_0x9097('0xac')]!==_0x2016d4[_0x9097('0x9d')]&&!this[_0x9097('0x14')][_0x2016d4['linkedid']][_0x9097('0x6b')]){if(_0x2016d4['cause']==='1'){this[_0x9097('0x90')](_0x2016d4,_0x2016d4[_0x9097('0xac')],_0x2016d4[_0x9097('0x123')]);}}};Preview['prototype'][_0x9097('0x12c')]=function(_0xb78b78,_0x413be6,_0x40973f){if(this['actions'][_0xb78b78]){if(_[_0x9097('0x64')](this[_0x9097('0x14')][_0xb78b78][_0x9097('0x12d')])){this[_0x9097('0x14')][_0xb78b78][_0x9097('0x12d')]={};}this[_0x9097('0x14')][_0xb78b78][_0x9097('0x12d')][_0x413be6]=_0x40973f;}};Preview['prototype'][_0x9097('0x22')]=function(_0x16e3c9){try{if(!_[_0x9097('0x64')](_0x16e3c9)){if(ut[_0x9097('0x12e')](_[_0x9097('0x12f')](_0x16e3c9[_0x9097('0x130')])[0x0])){this['addVariable'](_0x16e3c9['uniqueid'],_[_0x9097('0x12f')](_0x16e3c9['variable'])[0x0],_0x16e3c9[_0x9097('0x131')]);}}}catch(_0x474ec8){logger['error'](_0x9097('0x132'),util['inspect'](_0x474ec8,{'showHidden':![],'depth':null}));}};Preview[_0x9097('0xd')][_0x9097('0x23')]=function(_0x47fb0d){if(_0x47fb0d){if(this[_0x9097('0x14')][_0x47fb0d[_0x9097('0x133')]]){this[_0x9097('0x14')][_0x47fb0d[_0x9097('0x133')]][_0x9097('0x127')]=!![];}}};Preview[_0x9097('0xd')][_0x9097('0x134')]=function(_0x5f0f37){if(_0x5f0f37){if(this[_0x9097('0x14')][_0x5f0f37[_0x9097('0x135')]]){this[_0x9097('0x14')][_0x5f0f37[_0x9097('0x135')]][_0x9097('0x127')]=!![];}}};module[_0x9097('0x136')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3f9685f..2559f9a 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 _0x2a73=['getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','answertime','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20'];(function(_0x48b5a2,_0x51d413){var _0x1308ae=function(_0x4775be){while(--_0x4775be){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0x1308ae(++_0x51d413);}(_0x2a73,0x16f));var _0x32a7=function(_0x1240c0,_0x6f820){_0x1240c0=_0x1240c0-0x0;var _0x274fc0=_0x2a73[_0x1240c0];return _0x274fc0;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x32a7('0x0'))(_0x32a7('0x1'));var _=require(_0x32a7('0x2'));var cmHopper=require(_0x32a7('0x3'));var cmHopperFinal=require(_0x32a7('0x4'));var cmHopperHistory=require(_0x32a7('0x5'));var cmHopperBlack=require(_0x32a7('0x6'));var voiceQueueRt=require(_0x32a7('0x7'));var agentReportPreview=require(_0x32a7('0x8'));var voiceQueueReport=require(_0x32a7('0x9'));function loggerCatch(_0x377e0f){return function(_0x52cc3c){logger['error'](_0x377e0f,util[_0x32a7('0xa')](_0x52cc3c,{'showHidden':![],'depth':null}));};}function create(_0x4858fe){return BPromise['resolve']()[_0x32a7('0xb')](cmHopperHistory[_0x32a7('0xc')](_0x4858fe))[_0x32a7('0xd')](loggerCatch(_0x32a7('0xe')));}function createAgent(_0xb9ab70){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](agentReportPreview[_0x32a7('0xc')](_0xb9ab70))[_0x32a7('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0xb7fd32){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopper['moveContactManagedDialer'](_0xb7fd32,!![]))[_0x32a7('0xd')](loggerCatch(_0x32a7('0x10')));}exports['checkIsBlackList']=function(_0x249bfc){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopperBlack['checkIsBlackList'](_0x249bfc))[_0x32a7('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x244782){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopper[_0x32a7('0x11')](_0x244782))['catch'](loggerCatch(_0x32a7('0x12')));};exports[_0x32a7('0xc')]=function(_0x2adc63,_0x1f89f0){create(_0x2adc63)[_0x32a7('0xd')](loggerCatch(_0x1f89f0));moveContact(_0x2adc63)['catch'](loggerCatch(_0x1f89f0));};exports[_0x32a7('0x13')]=function(_0x21587c,_0x567c1f){createAgent(_0x21587c)['catch'](loggerCatch(_0x567c1f));};exports[_0x32a7('0x14')]=function(_0x819cab,_0x248e85){create(_0x819cab)[_0x32a7('0xd')](loggerCatch(_0x248e85));};exports['createCustomerFinal']=function(_0x536e4b,_0x34604b){moveContact(_0x536e4b)['catch'](loggerCatch(_0x34604b));};exports[_0x32a7('0x15')]=function(_0x94c479,_0x54f7c0,_0x3e9ff7){if(_0x54f7c0){_0x94c479[_0x32a7('0x16')]=null;}if(_0x3e9ff7){_0x94c479[_0x32a7('0x17')]=![];}return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopper[_0x32a7('0x15')](_0x94c479))['catch'](loggerCatch(_0x32a7('0x18')));};exports[_0x32a7('0x19')]=function(_0x169c45){return BPromise['resolve']()[_0x32a7('0xb')](cmHopper[_0x32a7('0x19')](_0x169c45))[_0x32a7('0xd')](loggerCatch(_0x32a7('0x1a')));};exports['unlockContact']=function(_0x3d633e){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopper['unlockContact']({'UserId':null},_0x3d633e,0x1))[_0x32a7('0xd')](loggerCatch(_0x32a7('0x1b')));};exports['disableContact']=function(_0xffe472){return BPromise['resolve']()[_0x32a7('0xb')](cmHopper[_0x32a7('0x1c')]({'active':![]},_0xffe472,0x1))[_0x32a7('0xd')](loggerCatch(_0x32a7('0x1d')));};exports['crateCustomerReportQueue']=function(_0x38ff92){var _0x3569b3={};_0x3569b3[_0x32a7('0x1e')]=_0x38ff92[_0x32a7('0x1e')];_0x3569b3[_0x32a7('0x1f')]=_0x38ff92[_0x32a7('0x1f')];_0x3569b3[_0x32a7('0x20')]=_0x38ff92[_0x32a7('0x20')];_0x3569b3[_0x32a7('0x21')]=_0x38ff92[_0x32a7('0x21')];_0x3569b3['queue']=_0x38ff92['queue'];_0x3569b3['queuecallerjoinAt']=_0x38ff92[_0x32a7('0x22')];_0x3569b3['queuecallerleaveAt']=_0x38ff92[_0x32a7('0x22')];_0x3569b3['queuecallercomplete']=0x1;_0x3569b3[_0x32a7('0x23')]=_0x38ff92['endtime'];_0x3569b3[_0x32a7('0x24')]=_0x38ff92[_0x32a7('0x25')];_0x3569b3[_0x32a7('0x26')]=_0x32a7('0x27');_0x3569b3[_0x32a7('0x28')]=_0x32a7('0x29');_0x3569b3['holdtime']=0x0;_0x3569b3[_0x32a7('0x2a')]=0x1;_0x3569b3['lastAssignedTo']=_0x38ff92['membername'];_0x3569b3[_0x32a7('0x2b')]='COMPLETED';return BPromise[_0x32a7('0xf')]()['then'](voiceQueueReport[_0x32a7('0x2c')](_0x3569b3))[_0x32a7('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x32a7('0x2d')]=function(_0x335431,_0x1b4925){return BPromise[_0x32a7('0xf')]()['then'](cmHopper[_0x32a7('0x2d')](_0x335431,_0x1b4925))['catch'](loggerCatch(_0x32a7('0x2e')));};exports[_0x32a7('0x2f')]=function(_0x7c7fb4){return BPromise[_0x32a7('0xf')]()[_0x32a7('0xb')](cmHopper[_0x32a7('0x15')](_0x7c7fb4,!![],!![]))[_0x32a7('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x3d3f=['disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact'];(function(_0x5b0ae3,_0x14949f){var _0x32c4bd=function(_0x28fead){while(--_0x28fead){_0x5b0ae3['push'](_0x5b0ae3['shift']());}};_0x32c4bd(++_0x14949f);}(_0x3d3f,0x148));var _0xf3d3=function(_0x40ad05,_0x18c3ae){_0x40ad05=_0x40ad05-0x0;var _0x5cc00f=_0x3d3f[_0x40ad05];return _0x5cc00f;};'use strict';var util=require(_0xf3d3('0x0'));var BPromise=require(_0xf3d3('0x1'));var logger=require(_0xf3d3('0x2'))('preview');var _=require(_0xf3d3('0x3'));var cmHopper=require(_0xf3d3('0x4'));var cmHopperFinal=require(_0xf3d3('0x5'));var cmHopperHistory=require(_0xf3d3('0x6'));var cmHopperBlack=require(_0xf3d3('0x7'));var voiceQueueRt=require(_0xf3d3('0x8'));var agentReportPreview=require(_0xf3d3('0x9'));var voiceQueueReport=require(_0xf3d3('0xa'));function loggerCatch(_0x3ebaed){return function(_0xec7ed7){logger[_0xf3d3('0xb')](_0x3ebaed,util[_0xf3d3('0xc')](_0xec7ed7,{'showHidden':![],'depth':null}));};}function create(_0x86f452){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopperHistory['createHistory'](_0x86f452))[_0xf3d3('0xf')](loggerCatch(_0xf3d3('0x10')));}function createAgent(_0x4f2239){return BPromise[_0xf3d3('0xd')]()['then'](agentReportPreview[_0xf3d3('0x11')](_0x4f2239))['catch'](loggerCatch(_0xf3d3('0x10')));}function moveContact(_0x11af76){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper[_0xf3d3('0x12')](_0x11af76,!![]))[_0xf3d3('0xf')](loggerCatch(_0xf3d3('0x13')));}exports[_0xf3d3('0x14')]=function(_0x4f3630){return BPromise[_0xf3d3('0xd')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4f3630))[_0xf3d3('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x5bc078){return BPromise['resolve']()[_0xf3d3('0xe')](cmHopper[_0xf3d3('0x15')](_0x5bc078))[_0xf3d3('0xf')](loggerCatch(_0xf3d3('0x16')));};exports[_0xf3d3('0x11')]=function(_0x53ac8b,_0x21a770){create(_0x53ac8b)[_0xf3d3('0xf')](loggerCatch(_0x21a770));moveContact(_0x53ac8b)[_0xf3d3('0xf')](loggerCatch(_0x21a770));};exports[_0xf3d3('0x17')]=function(_0x367287,_0x2d46d8){createAgent(_0x367287)[_0xf3d3('0xf')](loggerCatch(_0x2d46d8));};exports[_0xf3d3('0x18')]=function(_0x444761,_0x1d93e0){create(_0x444761)['catch'](loggerCatch(_0x1d93e0));};exports[_0xf3d3('0x19')]=function(_0x459a26,_0x41f7bd){moveContact(_0x459a26)[_0xf3d3('0xf')](loggerCatch(_0x41f7bd));};exports[_0xf3d3('0x1a')]=function(_0x9f1552,_0x12b28b,_0x17c545){if(_0x12b28b){_0x9f1552[_0xf3d3('0x1b')]=null;}if(_0x17c545){_0x9f1552[_0xf3d3('0x1c')]=![];}return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper[_0xf3d3('0x1a')](_0x9f1552))['catch'](loggerCatch(_0xf3d3('0x1d')));};exports[_0xf3d3('0x1e')]=function(_0x3e75d2){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper['countReScheduled'](_0x3e75d2))[_0xf3d3('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf3d3('0x1f')]=function(_0x46f396){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'UserId':null},_0x46f396,0x1))[_0xf3d3('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xf3d3('0x20')]=function(_0x2df98b){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper[_0xf3d3('0x1f')]({'active':![]},_0x2df98b,0x1))['catch'](loggerCatch(_0xf3d3('0x21')));};exports[_0xf3d3('0x22')]=function(_0x3a3e49){var _0x14b50b={};_0x14b50b['type']=_0x3a3e49[_0xf3d3('0x23')];_0x14b50b[_0xf3d3('0x24')]=_0x3a3e49[_0xf3d3('0x24')];_0x14b50b['calleridnum']=_0x3a3e49['calleridnum'];_0x14b50b['calleridname']=_0x3a3e49['calleridname'];_0x14b50b[_0xf3d3('0x25')]=_0x3a3e49[_0xf3d3('0x25')];_0x14b50b[_0xf3d3('0x26')]=_0x3a3e49[_0xf3d3('0x27')];_0x14b50b[_0xf3d3('0x28')]=_0x3a3e49[_0xf3d3('0x27')];_0x14b50b[_0xf3d3('0x29')]=0x1;_0x14b50b[_0xf3d3('0x2a')]=_0x3a3e49[_0xf3d3('0x2b')];_0x14b50b[_0xf3d3('0x2c')]=_0x3a3e49[_0xf3d3('0x2d')];_0x14b50b[_0xf3d3('0x2e')]=_0xf3d3('0x2f');_0x14b50b[_0xf3d3('0x30')]=_0xf3d3('0x31');_0x14b50b[_0xf3d3('0x32')]=0x0;_0x14b50b[_0xf3d3('0x33')]=0x1;_0x14b50b[_0xf3d3('0x34')]=_0x3a3e49[_0xf3d3('0x2d')];_0x14b50b['queuecallerexitreason']=_0xf3d3('0x35');return BPromise[_0xf3d3('0xd')]()['then'](voiceQueueReport[_0xf3d3('0x36')](_0x14b50b))[_0xf3d3('0xf')](loggerCatch(_0xf3d3('0x37')));};exports[_0xf3d3('0x38')]=function(_0x2e2d0a,_0x4c1c3d){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper['getContactRecallMe'](_0x2e2d0a,_0x4c1c3d))['catch'](loggerCatch(_0xf3d3('0x39')));};exports[_0xf3d3('0x3a')]=function(_0x371c4d){return BPromise[_0xf3d3('0xd')]()[_0xf3d3('0xe')](cmHopper['rescheduleContact'](_0x371c4d,!![],!![]))[_0xf3d3('0xf')](loggerCatch(_0xf3d3('0x3b')));}; \ 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 7fdcfce..46353f1 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 _0xf8d7=['decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','channelAgent','buildAcw','queue','agentReadyId','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','match','extractCalleridNumber','util','lodash','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','logCustomer','talktime','answertime','variablesAction','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','ListId'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf8d7,0xb6));var _0x7f8d=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xf8d7[_0xfb0281];return _0x408dd3;};'use strict';var util=require(_0x7f8d('0x0'));var _=require(_0x7f8d('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x7f8d('0x2'));var ipAgi=process['env'][_0x7f8d('0x3')]||_0x7f8d('0x4');function getSeconds(_0x58a5c8,_0x2d9c5d){var _0x5edb09=moment(_0x58a5c8)[_0x7f8d('0x5')](0x0);var _0x37e207=moment(_0x2d9c5d)[_0x7f8d('0x5')](0x0);return _0x5edb09[_0x7f8d('0x6')](_0x37e207,_0x7f8d('0x7'));}exports[_0x7f8d('0x8')]=function(_0x12145b){return function(_0x5c29e9){logger[_0x7f8d('0x9')](_0x12145b,util[_0x7f8d('0xa')](_0x5c29e9,{'showHidden':![],'depth':null}));};};exports[_0x7f8d('0xb')]=function(_0x4d5c7e,_0x478693){logger[_0x7f8d('0xc')](_0x4d5c7e,util['inspect'](_0x478693,{'showHidden':![],'depth':null}));};exports[_0x7f8d('0xd')]=function(_0x147a10,_0x13b663){logger[_0x7f8d('0x9')](_0x147a10,util[_0x7f8d('0xa')](_0x13b663,{'showHidden':![],'depth':null}));};exports[_0x7f8d('0xe')]=function(_0xad8dc7){return function(_0x7bb54b){logger[_0x7f8d('0xc')](_0xad8dc7,util['inspect'](_0x7bb54b,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3a1849,_0x236cac,_0x813669){return{'message':_0x3a1849,'unlock':_0x236cac,'active':_0x813669};};exports[_0x7f8d('0xf')]=function(_0x4bacfd,_0x5a6f92,_0x3c8aec){if(!_['isUndefined'](_0x3c8aec)&&_0x7f8d('0x10')===typeof _0x3c8aec&&!_[_0x7f8d('0x11')](_0x3c8aec)){if(!_[_0x7f8d('0x12')](_0x5a6f92)&&_0x7f8d('0x10')===typeof _0x5a6f92&&!_[_0x7f8d('0x11')](_0x5a6f92)){return util['format'](_0x7f8d('0x13'),_0x5a6f92,_0x3c8aec);}return util[_0x7f8d('0x14')](_0x7f8d('0x13'),_0x3c8aec,_0x3c8aec);}if(!_[_0x7f8d('0x12')](_0x4bacfd)&&_0x7f8d('0x10')===typeof _0x4bacfd&&!_[_0x7f8d('0x11')](_0x4bacfd)){return _0x4bacfd;}return'\x22\x22\x20<>';};exports[_0x7f8d('0x15')]=function(_0x1f3f15){if(_[_0x7f8d('0x16')](_0x1f3f15)){return![];}return _0x1f3f15;};exports[_0x7f8d('0x17')]=function(_0x55f194,_0x2b817d,_0xcc5d2e,_0x4a6c3f,_0x52210b,_0x417aab){var _0x470c61={'XMD-QUEUE':_0x2b817d['Queue']?_0x2b817d[_0x7f8d('0x18')][_0x7f8d('0x19')]:'','XMD-CALLERID':_0x4a6c3f,'XMD-CALLERID-PREVIEW':_0x417aab?util[_0x7f8d('0x14')](_0x7f8d('0x13'),_0x417aab['calleridname'],_0x417aab[_0x7f8d('0x1a')]):_0x4a6c3f,'XMD-DIALID':_0x52210b,'XMD-CONTACTID':_0x2b817d[_0x7f8d('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4a6c3f,'XMD-VOICEQUEUEID':_0x2b817d[_0x7f8d('0x1c')],'XMD-DIALCHANNEL':_0xcc5d2e,'XMD-DIALTIMEOUT':_0x55f194[_0x7f8d('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x7f8d('0x14')](_0x7f8d('0x1e'),_0x55f194[_0x7f8d('0x1f')]?'g':'',_[_0x7f8d('0x11')](_0x55f194[_0x7f8d('0x20')])?'':_0x7f8d('0x21')),'XMD-DIALURL':_0x55f194['dialPreviewUrl']||'','XMD-AGI':_0x55f194[_0x7f8d('0x22')]?util['format'](_0x7f8d('0x23'),ipAgi,_0x55f194[_0x7f8d('0x22')]):_0x7f8d('0x24'),'XMD-AGIAFTER':_0x55f194[_0x7f8d('0x1f')]?util[_0x7f8d('0x14')](_0x7f8d('0x23'),ipAgi,_0x55f194[_0x7f8d('0x1f')]):_0x7f8d('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x417aab?_0x417aab[_0x7f8d('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x417aab?_0x417aab[_0x7f8d('0x26')]:'','XMD-DESTINATION':_0x7f8d('0x27')};if(!_[_0x7f8d('0x11')](_0x55f194['monitor_format'])){_0x470c61[util[_0x7f8d('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x55f194[_0x7f8d('0x20')];_0x470c61[util[_0x7f8d('0x14')]('%s',_0x7f8d('0x28'))]=_0x52210b;}if(_0x2b817d&&_0x2b817d[_0x7f8d('0x29')]){for(var _0x4db20d in _0x2b817d[_0x7f8d('0x29')]){if(_0x2b817d[_0x7f8d('0x29')][_0x7f8d('0x2a')](_0x4db20d)){if(!_[_0x7f8d('0x16')](_0x2b817d['Contact'][_0x4db20d])&&_0x4db20d!=='id'&&_0x4db20d!==_0x7f8d('0x2b')&&_0x4db20d!==_0x7f8d('0x2c')&&_0x4db20d!==_0x7f8d('0x2d')){_0x470c61[util[_0x7f8d('0x14')]('%s%s','XMD-',_[_0x7f8d('0x2e')](_0x4db20d))]=_0x2b817d[_0x7f8d('0x29')][_0x4db20d];}}}}return _0x470c61;};exports['toLowerVariables']=function(_0x13dbf7){var _0x1e42ef={};for(var _0xcc6dc4 in _0x13dbf7){if(_0x13dbf7[_0x7f8d('0x2a')](_0xcc6dc4)){_0x1e42ef[util[_0x7f8d('0x14')]('%s',_['toLower'](_0xcc6dc4))]=_0x13dbf7[_0xcc6dc4];}}return{'variables':_0x1e42ef};};exports[_0x7f8d('0x2f')]=function(_0x362f40,_0x108df6){if(!_['isNil'](_0x362f40)){if(_0x362f40[_0x7f8d('0x2a')]('originated')){if(_0x362f40[_0x7f8d('0x30')]>0x0){_0x362f40[_0x7f8d('0x30')]-=0x1;}else{logger[_0x7f8d('0x9')](_0x7f8d('0x31'),_0x108df6);}}}else{logger['error'](_0x7f8d('0x32'),_0x108df6);}};exports[_0x7f8d('0x33')]=function(_0x2700d3){var _0x5164c0=moment()[_0x7f8d('0x14')](_0x7f8d('0x34'));_0x2700d3[_0x7f8d('0x35')]=0xd;_0x2700d3[_0x7f8d('0x36')]='Blacklist';_0x2700d3[_0x7f8d('0x37')]=_0x5164c0;_0x2700d3[_0x7f8d('0x38')]=_0x5164c0;_0x2700d3[_0x7f8d('0x39')]=_0x5164c0;};exports[_0x7f8d('0x3a')]=function(_0x2d521b,_0x3b7763,_0x977f6f){var _0xaf9bfd=moment()['format'](_0x7f8d('0x34'));_0x2d521b[_0x7f8d('0x35')]=_0x3b7763;_0x2d521b['statedesc']=_0x977f6f;_0x2d521b[_0x7f8d('0x38')]=_0xaf9bfd;_0x2d521b[_0x7f8d('0x3b')]=getSeconds(_0x2d521b[_0x7f8d('0x38')],_0x2d521b[_0x7f8d('0x37')]);};exports[_0x7f8d('0x3c')]=function(_0x52197b,_0x35b2e9,_0x4502c8){_0x52197b[_0x7f8d('0x3d')]=_0x35b2e9;_0x52197b['UserId']=_0x4502c8;};exports[_0x7f8d('0x3e')]=function(_0x1076cd,_0x21a2b8,_0x36a1d7){var _0x32549d=moment()[_0x7f8d('0x14')](_0x7f8d('0x34'));_0x1076cd['state']=_0x21a2b8;_0x1076cd['statedesc']=_0x36a1d7;_0x1076cd[_0x7f8d('0x38')]=_0x1076cd['responsetime']?_0x1076cd[_0x7f8d('0x38')]:_0x32549d;_0x1076cd[_0x7f8d('0x39')]=_0x1076cd[_0x7f8d('0x39')]?_0x1076cd[_0x7f8d('0x39')]:_0x32549d;_0x1076cd[_0x7f8d('0x3b')]=getSeconds(_0x1076cd[_0x7f8d('0x38')]||0x0,_0x1076cd[_0x7f8d('0x37')]||0x0);_0x1076cd[_0x7f8d('0x3f')]=_0x1076cd['answertime']?getSeconds(_0x1076cd['endtime'],_0x1076cd[_0x7f8d('0x40')]):0x0;};exports['isFailure']=function(_0x183df4){return _0x183df4==='Failure';};exports[_0x7f8d('0x41')]=function(_0x515ca2,_0x1abac2,_0x2d2b59,_0x27a6c2,_0x412bac){var _0x2bcb08=_0x27a6c2?'RECALL':_0x515ca2['calleridname'];_0x2bcb08=_0x412bac?_0x7f8d('0x42'):_0x2bcb08;return{'actionid':_0x515ca2[_0x7f8d('0x43')],'action':_0x7f8d('0x44'),'channel':_0x515ca2['channelAgent'],'callerid':util[_0x7f8d('0x14')](_0x7f8d('0x13'),_0x2bcb08,_0x515ca2[_0x7f8d('0x1a')]),'Exten':_0x7f8d('0x27'),'Context':_0x7f8d('0x45'),'Priority':'1','variable':_0x2d2b59,'timeout':(_0x1abac2[_0x7f8d('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x515ca2['uniqueid']};};exports[_0x7f8d('0x47')]=function(_0x20756f){return _0x20756f[_0x7f8d('0x48')]+_0x20756f[_0x7f8d('0x49')]+_0x20756f[_0x7f8d('0x4a')];};exports[_0x7f8d('0x4b')]=function(_0x216844){var _0x57060a=_[_0x7f8d('0x4c')](_0x216844);_0x57060a[_0x7f8d('0x35')]=0xf;_0x57060a[_0x7f8d('0x36')]=_0x7f8d('0x4d');return _0x57060a;};exports[_0x7f8d('0x4e')]=function(_0x35f857,_0x287a16,_0x218ef5){var _0x175bf2={};_0x175bf2[_0x287a16]=_0x35f857[_0x287a16];_0x175bf2[_0x7f8d('0x4f')]=![];_0x175bf2[_0x7f8d('0x50')]=moment()['add'](_0x218ef5,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x175bf2['ContactId']=_0x35f857[_0x7f8d('0x1b')];_0x175bf2[_0x7f8d('0x51')]=_0x35f857[_0x7f8d('0x51')];_0x175bf2[_0x7f8d('0x1c')]=_0x35f857['VoiceQueueId']||undefined;return _0x175bf2;};exports[_0x7f8d('0x52')]=function(_0x1bad4f,_0x533951){if(!_[_0x7f8d('0x16')](_0x1bad4f)){if(_0x1bad4f[_0x7f8d('0x53')]>0x0){_0x1bad4f[_0x7f8d('0x53')]-=0x1;}else{logger[_0x7f8d('0x9')](_0x533951,_0x7f8d('0x54'));}}else{logger['error'](_0x533951,_0x7f8d('0x55'));}};exports[_0x7f8d('0x56')]=function(_0x298ba2){if(_0x298ba2<=0x0){return!![];}return![];};exports['buildObj']=function(_0x38fe22,_0x1e0d12){_0x38fe22[_0x7f8d('0x57')]=_0x1e0d12;_0x38fe22['name']=_0x38fe22['queue'];_0x38fe22['interface']=_0x38fe22[_0x7f8d('0x58')];return _0x38fe22;};exports[_0x7f8d('0x59')]=function(_0x5cfe26){var _0x340c73={};_0x340c73[_0x7f8d('0x5a')]=_0x5cfe26['queue'];_0x340c73['interface']=_0x5cfe26[_0x7f8d('0x58')];_0x340c73[_0x7f8d('0x43')]=_0x5cfe26[_0x7f8d('0x43')];return _0x340c73;};exports[_0x7f8d('0x5b')]=function(_0x32b89b){var _0x5ded6f=[];for(var _0x1ff7dc in _0x32b89b){if(_0x32b89b[_0x7f8d('0x2a')](_0x1ff7dc)){if(!_[_0x7f8d('0x16')](_0x32b89b[_0x1ff7dc])&&_0x32b89b[_0x1ff7dc]['state']==='not_inuse'&&_0x32b89b[_0x1ff7dc][_0x7f8d('0x5c')]===_0x7f8d('0x5d')){_0x5ded6f[_0x7f8d('0x5e')](_0x32b89b[_0x1ff7dc]['id']);}}}return _0x5ded6f;};exports[_0x7f8d('0x5f')]=function(_0xeaa24b){var _0xa141e9=moment()['milliseconds'](0x0);var _0x1c9c97=moment(_0xeaa24b)[_0x7f8d('0x5')](0x0);return _0xa141e9[_0x7f8d('0x6')](_0x1c9c97,_0x7f8d('0x7'));};exports[_0x7f8d('0x60')]=function(_0x42c0ed){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x42c0ed[_0x7f8d('0x1b')],'ListId':_0x42c0ed[_0x7f8d('0x51')],'VoiceQueueId':_0x42c0ed[_0x7f8d('0x1c')]||undefined,'CampaignId':_0x42c0ed[_0x7f8d('0x61')]||undefined};};exports[_0x7f8d('0x62')]=function(_0x3ef96a){if(_0x3ef96a===_0x7f8d('0x43')||_0x3ef96a===_0x7f8d('0x63')||_0x3ef96a===_0x7f8d('0x5a')||_0x3ef96a===_0x7f8d('0x64')||_0x3ef96a===_0x7f8d('0x65')||_0x3ef96a===_0x7f8d('0x66')||_0x3ef96a==='membername'||_0x3ef96a===_0x7f8d('0x58')||_0x3ef96a==='calleridname'||_0x3ef96a==='active'||_0x3ef96a===_0x7f8d('0x1a')||_0x3ef96a===_0x7f8d('0x50')||_0x3ef96a==='countbusyretry'||_0x3ef96a===_0x7f8d('0x49')||_0x3ef96a===_0x7f8d('0x4a')||_0x3ef96a===_0x7f8d('0x67')||_0x3ef96a==='callback'||_0x3ef96a==='callbackuniqueid'||_0x3ef96a===_0x7f8d('0x68')||_0x3ef96a===_0x7f8d('0x69')||_0x3ef96a===_0x7f8d('0x1b')||_0x3ef96a===_0x7f8d('0x51')||_0x3ef96a==='UserId'||_0x3ef96a===_0x7f8d('0x1c')||_0x3ef96a===_0x7f8d('0x6a')||_0x3ef96a==='xmd-voicequeueid'||_0x3ef96a===_0x7f8d('0x6b')||_0x3ef96a===_0x7f8d('0x6c')||_0x3ef96a==='xmd-listid'||_0x3ef96a===_0x7f8d('0x6d')||_0x3ef96a===_0x7f8d('0x6e')||_0x3ef96a===_0x7f8d('0x6f')||_0x3ef96a===_0x7f8d('0x70')||_0x3ef96a===_0x7f8d('0x71')||_0x3ef96a===_0x7f8d('0x72')||_0x3ef96a==='xmd-cdrtype'||_0x3ef96a===_0x7f8d('0x73')||_0x3ef96a===_0x7f8d('0x74')||_0x3ef96a===_0x7f8d('0x75')||_0x3ef96a===_0x7f8d('0x76')||_0x3ef96a===_0x7f8d('0x77')||_0x3ef96a===_0x7f8d('0x78')||_0x3ef96a===_0x7f8d('0x79')||_0x3ef96a===_0x7f8d('0x7a')||_0x3ef96a===_0x7f8d('0x7b')||_0x3ef96a===_0x7f8d('0x7c')||_0x3ef96a===_0x7f8d('0x7d')||_0x3ef96a===_0x7f8d('0x76')||_0x3ef96a===_0x7f8d('0x77')||_0x3ef96a===_0x7f8d('0x78')||_0x3ef96a==='rtpaudioqosjitterbridged'||_0x3ef96a==='rtpaudioqosloss'||_0x3ef96a===_0x7f8d('0x7b')||_0x3ef96a===_0x7f8d('0x7c')||_0x3ef96a===_0x7f8d('0x7d')||_0x3ef96a==='bridgepeer'||_0x3ef96a===_0x7f8d('0x7e')||_0x3ef96a===_0x7f8d('0x35')||_0x3ef96a===_0x7f8d('0x36')){return![];}return!![];};exports[_0x7f8d('0x7f')]=function(_0x33d4c2,_0xe0bbb7){var _0x4c4e3a,_0x17fdae,_0x6335c3;if(_0xe0bbb7<=0x0){_0xe0bbb7=0x1;}_0x4c4e3a=new RegExp('\x5cw{0,'+_0xe0bbb7+'}$');_0x17fdae=Math[_0x7f8d('0x80')](0xa,_0xe0bbb7-0x1);_0x6335c3=Math[_0x7f8d('0x80')](0xa,_0xe0bbb7)-0x1;return util['format']('%s',_[_0x7f8d('0x81')](_0x33d4c2,_0x4c4e3a,_['random'](_0x17fdae,_0x6335c3)));};exports['extractCalleridName']=function(_0x31db8c){var _0x16631b=_0x31db8c[_0x7f8d('0x82')](/"(.*?)"/);return _0x16631b?_0x16631b[0x1]:_0x31db8c;};exports[_0x7f8d('0x83')]=function(_0x276ec8){var _0x5ebe58=_0x276ec8[_0x7f8d('0x82')](/<(.*?)>/);return _0x5ebe58?_0x5ebe58[0x1]:_0x276ec8;}; \ No newline at end of file +var _0xd2ad=['push','getDiff','diff','CampaignId','filterKey','idContact','type','campaigntype','countglobal','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepvtcallid','getCallerIdRandom','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','env','XCALLY_IP_AGI','milliseconds','seconds','inspect','loggerError','error','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','buildAcw','interface','not_inuse','status','reachable'];(function(_0x4048e8,_0x2eda9c){var _0x15fd24=function(_0x2b85ad){while(--_0x2b85ad){_0x4048e8['push'](_0x4048e8['shift']());}};_0x15fd24(++_0x2eda9c);}(_0xd2ad,0x1a9));var _0xdd2a=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xd2ad[_0x368bba];return _0x409f8f;};'use strict';var util=require(_0xdd2a('0x0'));var _=require(_0xdd2a('0x1'));var moment=require(_0xdd2a('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xdd2a('0x3')][_0xdd2a('0x4')]||'127.0.0.1';function getSeconds(_0xbd5255,_0x434d8a){var _0x37724e=moment(_0xbd5255)['milliseconds'](0x0);var _0xf6fae7=moment(_0x434d8a)[_0xdd2a('0x5')](0x0);return _0x37724e['diff'](_0xf6fae7,_0xdd2a('0x6'));}exports['loggerCatch']=function(_0xab13c5){return function(_0x31cd3f){logger['error'](_0xab13c5,util[_0xdd2a('0x7')](_0x31cd3f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1b8fc0,_0x4ca7ac){logger['info'](_0x1b8fc0,util['inspect'](_0x4ca7ac,{'showHidden':![],'depth':null}));};exports[_0xdd2a('0x8')]=function(_0x4caa52,_0x49fb53){logger[_0xdd2a('0x9')](_0x4caa52,util[_0xdd2a('0x7')](_0x49fb53,{'showHidden':![],'depth':null}));};exports[_0xdd2a('0xa')]=function(_0x5111e1){return function(_0x1926a4){logger[_0xdd2a('0xb')](_0x5111e1,util['inspect'](_0x1926a4,{'showHidden':![],'depth':null}));};};exports[_0xdd2a('0xc')]=function(_0x148aff,_0x587e45,_0xe14d80){return{'message':_0x148aff,'unlock':_0x587e45,'active':_0xe14d80};};exports[_0xdd2a('0xd')]=function(_0x15ceda,_0x24ca7f,_0x1a4ac0){if(!_[_0xdd2a('0xe')](_0x1a4ac0)&&_0xdd2a('0xf')===typeof _0x1a4ac0&&!_['isEmpty'](_0x1a4ac0)){if(!_[_0xdd2a('0xe')](_0x24ca7f)&&'string'===typeof _0x24ca7f&&!_[_0xdd2a('0x10')](_0x24ca7f)){return util[_0xdd2a('0x11')](_0xdd2a('0x12'),_0x24ca7f,_0x1a4ac0);}return util['format'](_0xdd2a('0x12'),_0x1a4ac0,_0x1a4ac0);}if(!_[_0xdd2a('0xe')](_0x15ceda)&&_0xdd2a('0xf')===typeof _0x15ceda&&!_[_0xdd2a('0x10')](_0x15ceda)){return _0x15ceda;}return _0xdd2a('0x13');};exports['isActive']=function(_0x45e01a){if(_[_0xdd2a('0x14')](_0x45e01a)){return![];}return _0x45e01a;};exports['addVariables']=function(_0x32b2bf,_0x37b439,_0x1e97ef,_0x515be0,_0x5a6072,_0x490229){var _0x2d3004={'XMD-QUEUE':_0x37b439['Queue']?_0x37b439['Queue'][_0xdd2a('0x15')]:'','XMD-CALLERID':_0x515be0,'XMD-CALLERID-PREVIEW':_0x490229?util[_0xdd2a('0x11')](_0xdd2a('0x12'),_0x490229[_0xdd2a('0x16')],_0x490229[_0xdd2a('0x17')]):_0x515be0,'XMD-DIALID':_0x5a6072,'XMD-CONTACTID':_0x37b439[_0xdd2a('0x18')],'XMD-CDRTYPE':_0xdd2a('0x19'),'CALLERID(all)':_0x515be0,'XMD-VOICEQUEUEID':_0x37b439[_0xdd2a('0x1a')],'XMD-DIALCHANNEL':_0x1e97ef,'XMD-DIALTIMEOUT':_0x32b2bf['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xdd2a('0x11')]('\x22rtTxX%s%s\x22',_0x32b2bf['dialQueueProject2']?'g':'',_[_0xdd2a('0x10')](_0x32b2bf[_0xdd2a('0x1b')])?'':_0xdd2a('0x1c')),'XMD-DIALURL':_0x32b2bf[_0xdd2a('0x1d')]||'','XMD-AGI':_0x32b2bf[_0xdd2a('0x1e')]?util[_0xdd2a('0x11')](_0xdd2a('0x1f'),ipAgi,_0x32b2bf['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x32b2bf[_0xdd2a('0x20')]?util[_0xdd2a('0x11')](_0xdd2a('0x1f'),ipAgi,_0x32b2bf[_0xdd2a('0x20')]):_0xdd2a('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x490229?_0x490229[_0xdd2a('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x490229?_0x490229[_0xdd2a('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xdd2a('0x10')](_0x32b2bf[_0xdd2a('0x1b')])){_0x2d3004[util[_0xdd2a('0x11')]('%s',_0xdd2a('0x24'))]=_0x32b2bf[_0xdd2a('0x1b')];_0x2d3004[util[_0xdd2a('0x11')]('%s',_0xdd2a('0x25'))]=_0x5a6072;}if(_0x37b439&&_0x37b439[_0xdd2a('0x26')]){for(var _0x169089 in _0x37b439[_0xdd2a('0x26')]){if(_0x37b439[_0xdd2a('0x26')][_0xdd2a('0x27')](_0x169089)){if(!_['isNil'](_0x37b439[_0xdd2a('0x26')][_0x169089])&&_0x169089!=='id'&&_0x169089!=='tags'&&_0x169089!==_0xdd2a('0x28')&&_0x169089!==_0xdd2a('0x29')){_0x2d3004[util[_0xdd2a('0x11')]('%s%s',_0xdd2a('0x2a'),_[_0xdd2a('0x2b')](_0x169089))]=_0x37b439[_0xdd2a('0x26')][_0x169089];}}}}return _0x2d3004;};exports[_0xdd2a('0x2c')]=function(_0x308d6b){var _0x23423a={};for(var _0x59e6de in _0x308d6b){if(_0x308d6b[_0xdd2a('0x27')](_0x59e6de)){_0x23423a[util[_0xdd2a('0x11')]('%s',_['toLower'](_0x59e6de))]=_0x308d6b[_0x59e6de];}}return{'variables':_0x23423a};};exports[_0xdd2a('0x2d')]=function(_0x238f6e,_0x56c743){if(!_[_0xdd2a('0x14')](_0x238f6e)){if(_0x238f6e[_0xdd2a('0x27')](_0xdd2a('0x2e'))){if(_0x238f6e['originated']>0x0){_0x238f6e[_0xdd2a('0x2e')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x56c743);}}}else{logger[_0xdd2a('0x9')](_0xdd2a('0x2f'),_0x56c743);}};exports['logBlacklist']=function(_0x2cf51b){var _0x60f1bb=moment()[_0xdd2a('0x11')](_0xdd2a('0x30'));_0x2cf51b[_0xdd2a('0x31')]=0xd;_0x2cf51b[_0xdd2a('0x32')]='Blacklist';_0x2cf51b[_0xdd2a('0x33')]=_0x60f1bb;_0x2cf51b[_0xdd2a('0x34')]=_0x60f1bb;_0x2cf51b[_0xdd2a('0x35')]=_0x60f1bb;};exports['logAgent']=function(_0x556943,_0x407f08,_0x219819){var _0x9bd3a6=moment()[_0xdd2a('0x11')](_0xdd2a('0x30'));_0x556943[_0xdd2a('0x31')]=_0x407f08;_0x556943[_0xdd2a('0x32')]=_0x219819;_0x556943[_0xdd2a('0x34')]=_0x9bd3a6;_0x556943['ringtime']=getSeconds(_0x556943[_0xdd2a('0x34')],_0x556943[_0xdd2a('0x33')]);};exports['logLookAgent']=function(_0x911c59,_0x52f12d,_0xef77cc){_0x911c59[_0xdd2a('0x36')]=_0x52f12d;_0x911c59[_0xdd2a('0x37')]=_0xef77cc;};exports['logCustomer']=function(_0x36ad3d,_0x384345,_0x40a136){var _0x20defc=moment()['format'](_0xdd2a('0x30'));_0x36ad3d[_0xdd2a('0x31')]=_0x384345;_0x36ad3d['statedesc']=_0x40a136;_0x36ad3d[_0xdd2a('0x34')]=_0x36ad3d[_0xdd2a('0x34')]?_0x36ad3d[_0xdd2a('0x34')]:_0x20defc;_0x36ad3d[_0xdd2a('0x35')]=_0x36ad3d['endtime']?_0x36ad3d['endtime']:_0x20defc;_0x36ad3d['ringtime']=getSeconds(_0x36ad3d[_0xdd2a('0x34')]||0x0,_0x36ad3d[_0xdd2a('0x33')]||0x0);_0x36ad3d[_0xdd2a('0x38')]=_0x36ad3d[_0xdd2a('0x39')]?getSeconds(_0x36ad3d['endtime'],_0x36ad3d[_0xdd2a('0x39')]):0x0;};exports[_0xdd2a('0x3a')]=function(_0x1e2468){return _0x1e2468===_0xdd2a('0x3b');};exports[_0xdd2a('0x3c')]=function(_0x1e1ab0,_0x4b055d,_0x473d73,_0x395fbb,_0xe11f9e){var _0x22dfd7=_0x395fbb?_0xdd2a('0x3d'):_0x1e1ab0[_0xdd2a('0x16')];_0x22dfd7=_0xe11f9e?'BOOKED':_0x22dfd7;return{'actionid':_0x1e1ab0[_0xdd2a('0x3e')],'action':'originate','channel':_0x1e1ab0[_0xdd2a('0x3f')],'callerid':util[_0xdd2a('0x11')]('\x22%s\x22\x20<%s>',_0x22dfd7,_0x1e1ab0[_0xdd2a('0x17')]),'Exten':_0xdd2a('0x40'),'Context':_0xdd2a('0x41'),'Priority':'1','variable':_0x473d73,'timeout':(_0x4b055d[_0xdd2a('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1e1ab0[_0xdd2a('0x3e')]};};exports[_0xdd2a('0x43')]=function(_0x2b39e4){return _0x2b39e4[_0xdd2a('0x44')]+_0x2b39e4[_0xdd2a('0x45')]+_0x2b39e4[_0xdd2a('0x46')];};exports['cloneAction']=function(_0x201dce){var _0x329109=_[_0xdd2a('0x47')](_0x201dce);_0x329109[_0xdd2a('0x31')]=0xf;_0x329109[_0xdd2a('0x32')]=_0xdd2a('0x48');return _0x329109;};exports[_0xdd2a('0x49')]=function(_0x3c517a,_0x2131e1,_0x4216f9){var _0x2928ab={};_0x2928ab[_0x2131e1]=_0x3c517a[_0x2131e1];_0x2928ab[_0xdd2a('0x4a')]=![];_0x2928ab[_0xdd2a('0x4b')]=moment()[_0xdd2a('0x4c')](_0x4216f9,_0xdd2a('0x4d'))['format'](_0xdd2a('0x30'));_0x2928ab['ContactId']=_0x3c517a['ContactId'];_0x2928ab[_0xdd2a('0x4e')]=_0x3c517a[_0xdd2a('0x4e')];_0x2928ab[_0xdd2a('0x1a')]=_0x3c517a['VoiceQueueId']||undefined;return _0x2928ab;};exports[_0xdd2a('0x4f')]=function(_0x32a865,_0x4c71d8){if(!_[_0xdd2a('0x14')](_0x32a865)){if(_0x32a865[_0xdd2a('0x50')]>0x0){_0x32a865[_0xdd2a('0x50')]-=0x1;}else{logger[_0xdd2a('0x9')](_0x4c71d8,_0xdd2a('0x51'));}}else{logger['error'](_0x4c71d8,_0xdd2a('0x52'));}};exports[_0xdd2a('0x53')]=function(_0x37ce8e){if(_0x37ce8e<=0x0){return!![];}return![];};exports[_0xdd2a('0x54')]=function(_0x35b01b,_0x18d6fd){_0x35b01b['lastevent']=_0x18d6fd;_0x35b01b[_0xdd2a('0x15')]=_0x35b01b[_0xdd2a('0x55')];_0x35b01b['interface']=_0x35b01b[_0xdd2a('0x3f')];return _0x35b01b;};exports[_0xdd2a('0x56')]=function(_0x34e55f){var _0x53fea4={};_0x53fea4['queue']=_0x34e55f[_0xdd2a('0x55')];_0x53fea4[_0xdd2a('0x57')]=_0x34e55f[_0xdd2a('0x3f')];_0x53fea4[_0xdd2a('0x3e')]=_0x34e55f[_0xdd2a('0x3e')];return _0x53fea4;};exports['agentReadyId']=function(_0x131608){var _0x5deeaa=[];for(var _0x527fd4 in _0x131608){if(_0x131608[_0xdd2a('0x27')](_0x527fd4)){if(!_[_0xdd2a('0x14')](_0x131608[_0x527fd4])&&_0x131608[_0x527fd4]['state']===_0xdd2a('0x58')&&_0x131608[_0x527fd4][_0xdd2a('0x59')]===_0xdd2a('0x5a')){_0x5deeaa[_0xdd2a('0x5b')](_0x131608[_0x527fd4]['id']);}}}return _0x5deeaa;};exports[_0xdd2a('0x5c')]=function(_0x5e82e2){var _0x32f681=moment()[_0xdd2a('0x5')](0x0);var _0x4afd35=moment(_0x5e82e2)[_0xdd2a('0x5')](0x0);return _0x32f681[_0xdd2a('0x5d')](_0x4afd35,'seconds');};exports['createBody']=function(_0x4064e2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4064e2[_0xdd2a('0x18')],'ListId':_0x4064e2[_0xdd2a('0x4e')],'VoiceQueueId':_0x4064e2['VoiceQueueId']||undefined,'CampaignId':_0x4064e2[_0xdd2a('0x5e')]||undefined};};exports[_0xdd2a('0x5f')]=function(_0x260d8f){if(_0x260d8f===_0xdd2a('0x3e')||_0x260d8f===_0xdd2a('0x60')||_0x260d8f==='queue'||_0x260d8f===_0xdd2a('0x61')||_0x260d8f===_0xdd2a('0x62')||_0x260d8f==='dialAnswer'||_0x260d8f===_0xdd2a('0x36')||_0x260d8f===_0xdd2a('0x3f')||_0x260d8f===_0xdd2a('0x16')||_0x260d8f===_0xdd2a('0x4a')||_0x260d8f===_0xdd2a('0x17')||_0x260d8f===_0xdd2a('0x4b')||_0x260d8f===_0xdd2a('0x44')||_0x260d8f===_0xdd2a('0x45')||_0x260d8f===_0xdd2a('0x46')||_0x260d8f===_0xdd2a('0x63')||_0x260d8f===_0xdd2a('0x64')||_0x260d8f===_0xdd2a('0x65')||_0x260d8f==='callbackat'||_0x260d8f===_0xdd2a('0x66')||_0x260d8f===_0xdd2a('0x18')||_0x260d8f===_0xdd2a('0x4e')||_0x260d8f===_0xdd2a('0x37')||_0x260d8f===_0xdd2a('0x1a')||_0x260d8f==='sipcallid'||_0x260d8f===_0xdd2a('0x67')||_0x260d8f===_0xdd2a('0x68')||_0x260d8f===_0xdd2a('0x69')||_0x260d8f==='xmd-listid'||_0x260d8f==='xmd-dialurl'||_0x260d8f===_0xdd2a('0x6a')||_0x260d8f==='xmd-dialoptions'||_0x260d8f===_0xdd2a('0x6b')||_0x260d8f===_0xdd2a('0x6c')||_0x260d8f===_0xdd2a('0x6d')||_0x260d8f===_0xdd2a('0x6e')||_0x260d8f===_0xdd2a('0x6f')||_0x260d8f===_0xdd2a('0x70')||_0x260d8f===_0xdd2a('0x71')||_0x260d8f===_0xdd2a('0x72')||_0x260d8f===_0xdd2a('0x73')||_0x260d8f===_0xdd2a('0x74')||_0x260d8f==='rtpaudioqosjitterbridged'||_0x260d8f==='rtpaudioqosloss'||_0x260d8f===_0xdd2a('0x75')||_0x260d8f===_0xdd2a('0x76')||_0x260d8f===_0xdd2a('0x77')||_0x260d8f==='rtpaudioqos'||_0x260d8f==='rtpaudioqosbridged'||_0x260d8f==='rtpaudioqosjitter'||_0x260d8f===_0xdd2a('0x78')||_0x260d8f===_0xdd2a('0x79')||_0x260d8f==='rtpaudioqoslossbridged'||_0x260d8f===_0xdd2a('0x76')||_0x260d8f==='rtpaudioqosrttbridged'||_0x260d8f==='bridgepeer'||_0x260d8f===_0xdd2a('0x7a')||_0x260d8f==='state'||_0x260d8f===_0xdd2a('0x32')){return![];}return!![];};exports[_0xdd2a('0x7b')]=function(_0x5dd8df,_0x11de91){var _0x2f7738,_0x22e9ad,_0x33cefe;if(_0x11de91<=0x0){_0x11de91=0x1;}_0x2f7738=new RegExp('\x5cw{0,'+_0x11de91+'}$');_0x22e9ad=Math['pow'](0xa,_0x11de91-0x1);_0x33cefe=Math[_0xdd2a('0x7c')](0xa,_0x11de91)-0x1;return util[_0xdd2a('0x11')]('%s',_[_0xdd2a('0x7d')](_0x5dd8df,_0x2f7738,_['random'](_0x22e9ad,_0x33cefe)));};exports[_0xdd2a('0x7e')]=function(_0xa9c7c7){var _0x3d3d0e=_0xa9c7c7[_0xdd2a('0x7f')](/"(.*?)"/);return _0x3d3d0e?_0x3d3d0e[0x1]:_0xa9c7c7;};exports[_0xdd2a('0x80')]=function(_0x17f834){var _0x37dc18=_0x17f834[_0xdd2a('0x7f')](/<(.*?)>/);return _0x37dc18?_0x37dc18[0x1]:_0x17f834;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ab29024..cfcc351 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 _0xf0ba=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','voicequeuechannel'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';exports[_0xaf0b('0x0')]={'queue':{'type':_0xaf0b('0x1'),'required':!![]},'interface':{'type':_0xaf0b('0x1'),'required':!![]},'membername':{'type':_0xaf0b('0x1'),'required':!![]},'penalty':{'type':_0xaf0b('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xaf0b('0x3')]={'queue':{'type':_0xaf0b('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xaf0b('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xaf0b('0x5')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xaf0b('0x1'),'required':![]}};exports[_0xaf0b('0x6')]={'uniqueid':{'type':_0xaf0b('0x1'),'required':!![]}};exports[_0xaf0b('0x7')]={'uniqueid':{'type':_0xaf0b('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xaf0b('0x1')},'mixmonitorid':{'type':_0xaf0b('0x1')}};exports[_0xaf0b('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xaf0b('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xaf0b('0x1'),'required':!![]},'context':{'type':_0xaf0b('0x1')}}; \ No newline at end of file +var _0x0e17=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0xf670f0,_0x353747){var _0x3c21c6=function(_0xa0e0b2){while(--_0xa0e0b2){_0xf670f0['push'](_0xf670f0['shift']());}};_0x3c21c6(++_0x353747);}(_0x0e17,0xd6));var _0x70e1=function(_0xb27615,_0x2c8d80){_0xb27615=_0xb27615-0x0;var _0x193f0c=_0x0e17[_0xb27615];return _0x193f0c;};'use strict';exports[_0x70e1('0x0')]={'queue':{'type':_0x70e1('0x1'),'required':!![]},'interface':{'type':_0x70e1('0x1'),'required':!![]},'membername':{'type':_0x70e1('0x1'),'required':!![]},'penalty':{'type':_0x70e1('0x2'),'required':![]},'paused':{'type':_0x70e1('0x3'),'required':![]}};exports[_0x70e1('0x4')]={'queue':{'type':_0x70e1('0x1'),'required':!![]},'interface':{'type':_0x70e1('0x1'),'required':!![]}};exports[_0x70e1('0x5')]={'interface':{'type':_0x70e1('0x1'),'required':!![]},'paused':{'type':_0x70e1('0x3')},'reason':{'type':'string','required':![]}};exports[_0x70e1('0x6')]={'module':{'type':_0x70e1('0x1'),'required':![]}};exports[_0x70e1('0x7')]={'uniqueid':{'type':_0x70e1('0x1'),'required':!![]}};exports[_0x70e1('0x8')]={'uniqueid':{'type':_0x70e1('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x70e1('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x70e1('0x1'),'required':!![]}};exports[_0x70e1('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x70e1('0x1'),'required':!![]},'context':{'type':_0x70e1('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6e23273..3d98281 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 _0x7398=['dynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','exports','util','moment','../model/agent','../model/trunk','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','queueStatusComplete','prototype','initAgents','agents','initTelephones','length','mergeFromDatabase','trunks','isUndefined','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts'];(function(_0x373d6c,_0x100736){var _0x444d89=function(_0x853a9b){while(--_0x853a9b){_0x373d6c['push'](_0x373d6c['shift']());}};_0x444d89(++_0x100736);}(_0x7398,0x82));var _0x8739=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x7398[_0x3511d3];return _0x5d6321;};'use strict';var BPromise=require('bluebird');var util=require(_0x8739('0x0'));var _=require('lodash');var moment=require(_0x8739('0x1'));var Agent=require(_0x8739('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x8739('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x8739('0x4'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x8739('0x5'));var ZendeskAccount=require(_0x8739('0x6'));var SalesforceAccount=require(_0x8739('0x7'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x8739('0x8'));var ZohoAccount=require(_0x8739('0x9'));var DeskAccount=require(_0x8739('0xa'));var VtigerAccount=require(_0x8739('0xb'));var ServicenowAccount=require(_0x8739('0xc'));var Dynamics365Account=require(_0x8739('0xd'));var FaxAccount=require(_0x8739('0xe'));var Realtime=function(){this['agents']={};this[_0x8739('0xf')]={};this['trunks']={};this[_0x8739('0x10')]={};this[_0x8739('0x11')]={};this[_0x8739('0x12')]={};this[_0x8739('0x13')]={};this[_0x8739('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8739('0x15')]={};this[_0x8739('0x16')]={};this[_0x8739('0x17')]={};this[_0x8739('0x18')]={};this[_0x8739('0x19')]={};this[_0x8739('0x1a')]={};this['salesforceAccounts']={};this[_0x8739('0x1b')]={};this['freshdeskAccounts']={};this[_0x8739('0x1c')]={};this['deskAccounts']={};this[_0x8739('0x1d')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0x8739('0x1e')]={};};function freeIsNotKey(_0xc4a7e,_0x34dd58,_0x3e8203){var _0x16eaf8=_[_0x8739('0x1f')](_0xc4a7e,function(_0x5918b4,_0x5b943a){return _0x5918b4[_0x3e8203];});for(var _0x599e86 in _0x34dd58){if(_0x34dd58[_0x8739('0x20')](_0x599e86)){if(!_0x16eaf8[_0x599e86]){delete _0x34dd58[_0x599e86];}}}}function freeIsNotKeySip(_0x27ed6a,_0x60e124){var _0x3a61f5=_['mapKeys'](_0x27ed6a,function(_0xd106ee,_0x24e6be){return util[_0x8739('0x21')](_0x8739('0x22'),_0xd106ee[_0x8739('0x23')]);});for(var _0x3e6e19 in _0x60e124){if(_0x60e124['hasOwnProperty'](_0x3e6e19)){if(!_0x3a61f5[_0x3e6e19]){delete _0x60e124[_0x3e6e19];}}}}function freeIsNotKeyAgent(_0x4b4bec,_0x217a5b){var _0x55647b=_[_0x8739('0x1f')](_0x4b4bec,function(_0x5c627d,_0x4e13c3){var _0x5b7323=_[_0x8739('0x24')](_0x5c627d[_0x8739('0x25')])?util['format'](_0x8739('0x22'),_0x5c627d[_0x8739('0x23')]):_0x5c627d[_0x8739('0x25')];return _0x5b7323;});for(var _0x6975b4 in _0x217a5b){if(_0x217a5b[_0x8739('0x20')](_0x6975b4)){if(!_0x55647b[_0x6975b4]){delete _0x217a5b[_0x6975b4];}}}}function clearVoiceCallReports(_0x27d374){_0x27d374[_0x8739('0x26')]=0x0;_0x27d374[_0x8739('0x27')]=0x0;_0x27d374['sumHoldTime']=0x0;_0x27d374[_0x8739('0x28')]=0x0;_0x27d374['sumBillable']=0x0;}function clearCampaigns(_0xe0efaf){if(!_[_0x8739('0x29')](_0xe0efaf)){for(var _0x34ae6c in _0xe0efaf){if(_0xe0efaf[_0x8739('0x20')](_0x34ae6c)){_0xe0efaf[_0x34ae6c][_0x8739('0x2a')]=0x0;_0xe0efaf[_0x34ae6c][_0x8739('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x966d99){if(!_[_0x8739('0x29')](_0x966d99)){for(var _0x1755a2 in _0x966d99){if(_0x966d99[_0x8739('0x20')](_0x1755a2)){_0x966d99[_0x1755a2][_0x8739('0x26')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x27')]=0x0;_0x966d99[_0x1755a2]['unmanaged']=0x0;_0x966d99[_0x1755a2][_0x8739('0x2c')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x2d')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x28')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x2e')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x2f')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x30')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x31')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x32')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x33')]=0x0;_0x966d99[_0x1755a2]['outboundUnknownCallsDay']=0x0;_0x966d99[_0x1755a2][_0x8739('0x34')]=0x0;_0x966d99[_0x1755a2][_0x8739('0x35')]=0x0;_0x966d99[_0x1755a2]['outboundBlacklistCallsDay']=0x0;_0x966d99[_0x1755a2][_0x8739('0x36')]=0x0;_0x966d99[_0x1755a2]['outboundRejectCallsDay']=0x0;_0x966d99[_0x1755a2]['outboundReCallsDay']=0x0;_0x966d99[_0x1755a2][_0x8739('0x2f')]=0x0;_0x966d99[_0x1755a2]['outboundAnswerCallsDay']=0x0;_0x966d99[_0x1755a2][_0x8739('0x37')]=!![];}}}}Realtime[_0x8739('0x38')]['mergeFromDatabase']=function(_0x1fe38a,_0x20c7f8){for(var _0x4ccc09 in _0x20c7f8){if(_0x1fe38a['hasOwnProperty'](_0x4ccc09)){_0x1fe38a[_0x4ccc09]=_0x20c7f8[_0x4ccc09];}}};Realtime[_0x8739('0x38')][_0x8739('0x39')]=function(){var _0x312c41=this;return function(_0x35b507){if(_0x35b507){freeIsNotKeyAgent(_0x35b507,_0x312c41[_0x8739('0x3a')]);for(var _0x429b15=0x0,_0x1e81f6={},_0x4a7a3f={};_0x429b15<_0x35b507['length'];_0x429b15+=0x1){_0x1e81f6=_0x35b507[_0x429b15];var _0x58ddac=_[_0x8739('0x24')](_0x1e81f6[_0x8739('0x25')])?util[_0x8739('0x21')](_0x8739('0x22'),_0x1e81f6['name']):_0x1e81f6[_0x8739('0x25')];if(_['isUndefined'](_0x312c41[_0x8739('0x3a')][_0x58ddac])){_0x312c41[_0x8739('0x3a')][_0x58ddac]=new Agent(_0x1e81f6);}else{_0x312c41['mergeFromDatabase'](_0x312c41['agents'][_0x58ddac],_0x1e81f6);}}}return _0x312c41[_0x8739('0x3a')];};};Realtime[_0x8739('0x38')][_0x8739('0x3b')]=function(){var _0x1e91a0=this;return function(_0x514f61){if(_0x514f61){freeIsNotKeySip(_0x514f61,_0x1e91a0[_0x8739('0xf')]);for(var _0x3e5981=0x0,_0x2e8139={},_0xe32684={};_0x3e5981<_0x514f61[_0x8739('0x3c')];_0x3e5981+=0x1){_0x2e8139=_0x514f61[_0x3e5981];if(_['isUndefined'](_0x1e91a0['telephones'][util[_0x8739('0x21')]('SIP/%s',_0x2e8139[_0x8739('0x23')])])){_0x1e91a0[_0x8739('0xf')][util[_0x8739('0x21')](_0x8739('0x22'),_0x2e8139[_0x8739('0x23')])]=new Telephone(_0x2e8139);}else{_0x1e91a0[_0x8739('0x3d')](_0x1e91a0[_0x8739('0xf')][util[_0x8739('0x21')]('SIP/%s',_0x2e8139['name'])],_0x2e8139);}}}return _0x1e91a0[_0x8739('0xf')];};};Realtime[_0x8739('0x38')]['initTrunks']=function(){var _0xd3036e=this;return function(_0x5c6ed9){if(_0x5c6ed9){freeIsNotKeySip(_0x5c6ed9,_0xd3036e[_0x8739('0x3e')]);for(var _0x4be209=0x0,_0x9d03ac={},_0x37dc18={};_0x4be209<_0x5c6ed9[_0x8739('0x3c')];_0x4be209+=0x1){_0x9d03ac=_0x5c6ed9[_0x4be209];if(_[_0x8739('0x3f')](_0xd3036e[_0x8739('0x3e')][util[_0x8739('0x21')](_0x8739('0x22'),_0x9d03ac['name'])])){_0xd3036e[_0x8739('0x3e')][util['format'](_0x8739('0x22'),_0x9d03ac[_0x8739('0x23')])]=new Trunk(_0x9d03ac);}else{_0xd3036e[_0x8739('0x3d')](_0xd3036e[_0x8739('0x3e')][util[_0x8739('0x21')]('SIP/%s',_0x9d03ac[_0x8739('0x23')])],_0x9d03ac);}}}return _0xd3036e[_0x8739('0x3e')];};};Realtime[_0x8739('0x38')][_0x8739('0x40')]=function(){var _0x34c5e8=this;return function(_0x51fe94){if(_0x51fe94){freeIsNotKey(_0x51fe94,_0x34c5e8['voiceQueues'],_0x8739('0x23'));for(var _0x1272a0=0x0,_0x386ae6={},_0x504d82={};_0x1272a0<_0x51fe94[_0x8739('0x3c')];_0x1272a0+=0x1){_0x386ae6=_0x51fe94[_0x1272a0];if(_[_0x8739('0x3f')](_0x34c5e8[_0x8739('0x10')][_0x386ae6['name']])){_0x34c5e8['voiceQueues'][_0x386ae6[_0x8739('0x23')]]=new VoiceQueue(_0x386ae6);}else{_0x34c5e8[_0x8739('0x3d')](_0x34c5e8[_0x8739('0x10')][_0x386ae6[_0x8739('0x23')]],_0x386ae6);}}}return _0x34c5e8[_0x8739('0x10')];};};Realtime[_0x8739('0x38')][_0x8739('0x41')]=function(){var _0x177563=this;return function(_0x9f26b6){if(_0x9f26b6){freeIsNotKey(_0x9f26b6,_0x177563[_0x8739('0x11')],'id');for(var _0x310195=0x0,_0xdb8f57={},_0xcd1157={};_0x310195<_0x9f26b6['length'];_0x310195+=0x1){_0xdb8f57=_0x9f26b6[_0x310195];if(_['isUndefined'](_0x177563['triggers'][_0xdb8f57['id']])){_0x177563['triggers'][_0xdb8f57['id']]=new Trigger(_0xdb8f57);}else{_0x177563[_0x8739('0x3d')](_0x177563[_0x8739('0x11')][_0xdb8f57['id']],_0xdb8f57);}}}return _0x177563[_0x8739('0x11')];};};Realtime['prototype'][_0x8739('0x42')]=function(){var _0x2c2b1e=this;return function(_0x559ca7){if(_0x559ca7){freeIsNotKey(_0x559ca7,_0x2c2b1e[_0x8739('0x13')],'id');for(var _0x18509d=0x0,_0x170a4a={},_0x3cc121={};_0x18509d<_0x559ca7[_0x8739('0x3c')];_0x18509d+=0x1){_0x170a4a=_0x559ca7[_0x18509d];if(_['isUndefined'](_0x2c2b1e[_0x8739('0x13')][_0x170a4a['id']])){_0x2c2b1e[_0x8739('0x13')][_0x170a4a['id']]=new Template(_0x170a4a);}else{_0x2c2b1e['mergeFromDatabase'](_0x2c2b1e[_0x8739('0x13')][_0x170a4a['id']],_0x170a4a);}}}return _0x2c2b1e[_0x8739('0x13')];};};Realtime[_0x8739('0x38')][_0x8739('0x43')]=function(){var _0x18321a=this;return function(_0x1267f6){if(_0x1267f6){freeIsNotKey(_0x1267f6,_0x18321a[_0x8739('0x1a')],'id');for(var _0x40e577=0x0,_0x112ffe={},_0x58ab73={};_0x40e577<_0x1267f6['length'];_0x40e577+=0x1){_0x112ffe=_0x1267f6[_0x40e577];if(_[_0x8739('0x3f')](_0x18321a['zendeskAccounts'][_0x112ffe['id']])){_0x18321a[_0x8739('0x1a')][_0x112ffe['id']]=new ZendeskAccount(_0x112ffe);}else{_0x18321a[_0x8739('0x3d')](_0x18321a[_0x8739('0x1a')][_0x112ffe['id']],_0x112ffe);}}}return _0x18321a[_0x8739('0x1a')];};};Realtime[_0x8739('0x38')][_0x8739('0x44')]=function(){var _0x592ca7=this;return function(_0x2aa526){if(_0x2aa526){freeIsNotKey(_0x2aa526,_0x592ca7[_0x8739('0x45')],'id');for(var _0x31e59b=0x0,_0x48584c={},_0x5177fe={};_0x31e59b<_0x2aa526[_0x8739('0x3c')];_0x31e59b+=0x1){_0x48584c=_0x2aa526[_0x31e59b];if(_[_0x8739('0x3f')](_0x592ca7[_0x8739('0x45')][_0x48584c['id']])){_0x592ca7[_0x8739('0x45')][_0x48584c['id']]=new SalesforceAccount(_0x48584c);}else{_0x592ca7[_0x8739('0x3d')](_0x592ca7[_0x8739('0x45')][_0x48584c['id']],_0x48584c);}}}return _0x592ca7[_0x8739('0x45')];};};Realtime[_0x8739('0x38')][_0x8739('0x46')]=function(){var _0x4595f5=this;return function(_0x2e2d78){if(_0x2e2d78){freeIsNotKey(_0x2e2d78,_0x4595f5[_0x8739('0x47')],'id');for(var _0x9d81a=0x0,_0x127f23={},_0x5477b4={};_0x9d81a<_0x2e2d78['length'];_0x9d81a+=0x1){_0x127f23=_0x2e2d78[_0x9d81a];if(_[_0x8739('0x3f')](_0x4595f5[_0x8739('0x47')][_0x127f23['id']])){_0x4595f5[_0x8739('0x47')][_0x127f23['id']]=new FreshdeskAccount(_0x127f23);}else{_0x4595f5[_0x8739('0x3d')](_0x4595f5[_0x8739('0x47')][_0x127f23['id']],_0x127f23);}}}return _0x4595f5[_0x8739('0x47')];};};Realtime['prototype'][_0x8739('0x48')]=function(){var _0x219a69=this;return function(_0x5e3162){if(_0x5e3162){freeIsNotKey(_0x5e3162,_0x219a69[_0x8739('0x1c')],'id');for(var _0xaede54=0x0,_0xb8fb86={},_0x229dca={};_0xaede54<_0x5e3162[_0x8739('0x3c')];_0xaede54+=0x1){_0xb8fb86=_0x5e3162[_0xaede54];if(_[_0x8739('0x3f')](_0x219a69[_0x8739('0x1c')][_0xb8fb86['id']])){_0x219a69[_0x8739('0x1c')][_0xb8fb86['id']]=new ZohoAccount(_0xb8fb86);}else{_0x219a69[_0x8739('0x3d')](_0x219a69[_0x8739('0x1c')][_0xb8fb86['id']],_0xb8fb86);}}}return _0x219a69[_0x8739('0x1c')];};};Realtime[_0x8739('0x38')][_0x8739('0x49')]=function(){var _0xc0c782=this;return function(_0x22450b){if(_0x22450b){freeIsNotKey(_0x22450b,_0xc0c782['deskAccounts'],'id');for(var _0x5e93e2=0x0,_0x21222e={},_0x34d029={};_0x5e93e2<_0x22450b[_0x8739('0x3c')];_0x5e93e2+=0x1){_0x21222e=_0x22450b[_0x5e93e2];if(_[_0x8739('0x3f')](_0xc0c782['deskAccounts'][_0x21222e['id']])){_0xc0c782['deskAccounts'][_0x21222e['id']]=new DeskAccount(_0x21222e);}else{_0xc0c782[_0x8739('0x3d')](_0xc0c782[_0x8739('0x4a')][_0x21222e['id']],_0x21222e);}}}return _0xc0c782[_0x8739('0x4a')];};};Realtime[_0x8739('0x38')][_0x8739('0x4b')]=function(){var _0x2646ec=this;return function(_0x631113){if(_0x631113){freeIsNotKey(_0x631113,_0x2646ec[_0x8739('0x1b')],'id');for(var _0x240595=0x0,_0x4b9a58={},_0x21f0db={};_0x240595<_0x631113['length'];_0x240595+=0x1){_0x4b9a58=_0x631113[_0x240595];if(_[_0x8739('0x3f')](_0x2646ec['sugarcrmAccounts'][_0x4b9a58['id']])){_0x2646ec['sugarcrmAccounts'][_0x4b9a58['id']]=new SugarcrmAccount(_0x4b9a58);}else{_0x2646ec[_0x8739('0x3d')](_0x2646ec[_0x8739('0x1b')][_0x4b9a58['id']],_0x4b9a58);}}}return _0x2646ec[_0x8739('0x1b')];};};Realtime[_0x8739('0x38')][_0x8739('0x4c')]=function(){var _0xe3b0f8=this;return function(_0x164203){if(_0x164203){freeIsNotKey(_0x164203,_0xe3b0f8[_0x8739('0x1d')],'id');for(var _0x113e25=0x0,_0x447aa8={},_0x29b75a={};_0x113e25<_0x164203[_0x8739('0x3c')];_0x113e25+=0x1){_0x447aa8=_0x164203[_0x113e25];if(_[_0x8739('0x3f')](_0xe3b0f8[_0x8739('0x1d')][_0x447aa8['id']])){_0xe3b0f8['vtigerAccounts'][_0x447aa8['id']]=new VtigerAccount(_0x447aa8);}else{_0xe3b0f8[_0x8739('0x3d')](_0xe3b0f8[_0x8739('0x1d')][_0x447aa8['id']],_0x447aa8);}}}return _0xe3b0f8['vtigerAccounts'];};};Realtime['prototype'][_0x8739('0x4d')]=function(){var _0x504fd6=this;return function(_0x381973){if(_0x381973){freeIsNotKey(_0x381973,_0x504fd6[_0x8739('0x4e')],'id');for(var _0xc5e6cc=0x0,_0x3d98d5={},_0x58dffe={};_0xc5e6cc<_0x381973['length'];_0xc5e6cc+=0x1){_0x3d98d5=_0x381973[_0xc5e6cc];if(_[_0x8739('0x3f')](_0x504fd6['servicenowAccounts'][_0x3d98d5['id']])){_0x504fd6[_0x8739('0x4e')][_0x3d98d5['id']]=new ServicenowAccount(_0x3d98d5);}else{_0x504fd6[_0x8739('0x3d')](_0x504fd6[_0x8739('0x4e')][_0x3d98d5['id']],_0x3d98d5);}}}return _0x504fd6['servicenowAccounts'];};};Realtime['prototype'][_0x8739('0x4f')]=function(){var _0x27a2b5=this;return function(_0x2e425c){if(_0x2e425c){freeIsNotKey(_0x2e425c,_0x27a2b5[_0x8739('0x50')],'id');for(var _0x5d6096=0x0,_0x3705f5={},_0x4ca4f9={};_0x5d6096<_0x2e425c['length'];_0x5d6096+=0x1){_0x3705f5=_0x2e425c[_0x5d6096];if(_[_0x8739('0x3f')](_0x27a2b5[_0x8739('0x50')][_0x3705f5['id']])){_0x27a2b5['dynamics365Accounts'][_0x3705f5['id']]=new Dynamics365Account(_0x3705f5);}else{_0x27a2b5[_0x8739('0x3d')](_0x27a2b5[_0x8739('0x50')][_0x3705f5['id']],_0x3705f5);}}}return _0x27a2b5[_0x8739('0x50')];};};Realtime['prototype'][_0x8739('0x51')]=function(){var _0x1635a5=this;return function(_0x3905d0){for(var _0x49b2c8=0x0;_0x49b2c8<_0x3905d0[_0x8739('0x3c')];_0x49b2c8+=0x1){_[_0x8739('0x52')](_0x1635a5[_0x8739('0x10')][_0x3905d0[_0x49b2c8]['name']],_0x3905d0[_0x49b2c8]);}return _0x1635a5['voiceQueues'];};};Realtime[_0x8739('0x38')]['initVoiceQueueReports']=function(){var _0xad7be3=this;return function(_0x42a0d5){clearVoiceQueues(_0xad7be3[_0x8739('0x10')]);if(_0x42a0d5){_0x42a0d5=_[_0x8739('0x53')](_0x42a0d5,_0x8739('0x54'));for(var _0x1dd98c in _0x42a0d5){if(_0x42a0d5[_0x8739('0x20')](_0x1dd98c)){var _0x398118={};for(var _0x570813=0x0;_0x570813<_0x42a0d5[_0x1dd98c][_0x8739('0x3c')];_0x570813+=0x1){var _0x426d55=_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x55')];if(_0xad7be3[_0x8739('0x10')][_0x426d55]){if(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x56')]){_0xad7be3[_0x8739('0x10')][_0x426d55]['unmanaged']+=0x1;}if(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x57')]){_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x2c')]+=0x1;}_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x2d')]+=moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x58')])[_0x8739('0x59')](moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5a')]),_0x8739('0x5b'))||0x0;if(_0x570813===_0x42a0d5[_0x1dd98c]['length']-0x1){_0xad7be3['voiceQueues'][_0x426d55][_0x8739('0x28')]+=moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5c')]||_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5d')]||_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5e')])[_0x8739('0x59')](moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5a')]),_0x8739('0x5b'))||0x0;_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x26')]+=0x1;if(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5f')]){_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x27')]+=0x1;_0xad7be3[_0x8739('0x10')][_0x426d55]['sumBillable']+=moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x5c')])[_0x8739('0x59')](moment(_0x42a0d5[_0x1dd98c][_0x570813][_0x8739('0x58')]),'seconds')||0x0;}}else{_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x28')]+=_0xad7be3[_0x8739('0x10')][_0x426d55][_0x8739('0x2d')]||0x0;}}}}}}return _0xad7be3['voiceQueues'];};};Realtime[_0x8739('0x38')][_0x8739('0x60')]=function(){var _0x4bf4b4=this;return function(_0x5da385){clearVoiceCallReports(_0x4bf4b4['outbound']);if(_0x5da385){for(var _0x3c9d3c=0x0;_0x3c9d3c<_0x5da385[_0x8739('0x3c')];_0x3c9d3c+=0x1){_0x4bf4b4[_0x8739('0x14')][_0x8739('0x26')]+=0x1;_0x4bf4b4[_0x8739('0x14')][_0x8739('0x28')]+=_0x5da385[_0x3c9d3c][_0x8739('0x61')];if(_0x5da385[_0x3c9d3c][_0x8739('0x62')]===_0x8739('0x63')){_0x4bf4b4['outbound'][_0x8739('0x27')]+=0x1;_0x4bf4b4[_0x8739('0x14')][_0x8739('0x2d')]+=_0x5da385[_0x3c9d3c][_0x8739('0x61')]-_0x5da385[_0x3c9d3c][_0x8739('0x64')]||0x0;_0x4bf4b4[_0x8739('0x14')][_0x8739('0x2e')]+=_0x5da385[_0x3c9d3c]['billableseconds'];}}}return _0x4bf4b4[_0x8739('0x14')];};};Realtime['prototype'][_0x8739('0x65')]=function(){var _0x1bea5e=this;return function(_0x4ebc52){if(_0x4ebc52){freeIsNotKey(_0x4ebc52,_0x1bea5e[_0x8739('0x12')],_0x8739('0x23'));for(var _0x5e177f=0x0,_0xce043f={};_0x5e177f<_0x4ebc52[_0x8739('0x3c')];_0x5e177f+=0x1){_0xce043f=_0x4ebc52[_0x5e177f];if(_['isUndefined'](_0x1bea5e['campaigns'][_0xce043f[_0x8739('0x23')]])){_0x1bea5e[_0x8739('0x12')][_0xce043f['name']]=new Campaign(_0xce043f);}else{_0x1bea5e[_0x8739('0x3d')](_0x1bea5e[_0x8739('0x12')][_0xce043f[_0x8739('0x23')]],_0xce043f);}}}return _0x1bea5e['campaigns'];};};Realtime['prototype'][_0x8739('0x66')]=function(){var _0x212ad3=this;return function(_0xc3ac5c){if(_0xc3ac5c){freeIsNotKey(_0xc3ac5c,_0x212ad3[_0x8739('0x15')],'id');for(var _0x4fde95=0x0,_0x486799={};_0x4fde95<_0xc3ac5c['length'];_0x4fde95+=0x1){_0x486799=_0xc3ac5c[_0x4fde95];if(_[_0x8739('0x3f')](_0x212ad3[_0x8739('0x15')][_0x486799['id']])){_0x212ad3[_0x8739('0x15')][_0x486799['id']]=new VoiceExtension(_0x486799);}else{_0x212ad3[_0x8739('0x3d')](_0x212ad3[_0x8739('0x15')][_0x486799['id']],_0x486799);}}}return _0x212ad3[_0x8739('0x15')];};};Realtime[_0x8739('0x38')][_0x8739('0x67')]=function(){var _0x3df54b=this;return function(_0x2a03f6){clearCampaigns(_0x3df54b[_0x8739('0x12')]);for(var _0x9bec64=0x0;_0x9bec64<_0x2a03f6['length'];_0x9bec64+=0x1){_[_0x8739('0x52')](_0x3df54b['campaigns'][_0x2a03f6[_0x9bec64][_0x8739('0x23')]],_0x2a03f6[_0x9bec64]);}return _0x3df54b[_0x8739('0x12')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x771473=this;return function(_0x39da2c){if(_0x39da2c){freeIsNotKey(_0x39da2c,_0x771473[_0x8739('0x1e')],'id');for(var _0x574406=0x0,_0x26c02d={},_0x5c9fb8={};_0x574406<_0x39da2c[_0x8739('0x3c')];_0x574406+=0x1){_0x26c02d=_0x39da2c[_0x574406];if(_[_0x8739('0x3f')](_0x771473[_0x8739('0x1e')][_0x26c02d['id']])){_0x771473[_0x8739('0x1e')][_0x26c02d['id']]=new FaxAccount(_0x26c02d);}else{_0x771473[_0x8739('0x3d')](_0x771473[_0x8739('0x1e')][_0x26c02d['id']],_0x26c02d);}}}return _0x771473[_0x8739('0x1e')];};};module[_0x8739('0x68')]=Realtime; \ No newline at end of file +var _0xcc92=['initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','seconds','billableseconds','initCampaigns','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','telephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','servicenowAccounts'];(function(_0x1e69f8,_0x77f33a){var _0x3ab000=function(_0x1245d2){while(--_0x1245d2){_0x1e69f8['push'](_0x1e69f8['shift']());}};_0x3ab000(++_0x77f33a);}(_0xcc92,0x141));var _0x2cc9=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0xcc92[_0x3cc05d];return _0x28b736;};'use strict';var BPromise=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var _=require(_0x2cc9('0x2'));var moment=require('moment');var Agent=require(_0x2cc9('0x3'));var Telephone=require(_0x2cc9('0x4'));var Trunk=require(_0x2cc9('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x2cc9('0x6'));var Campaign=require(_0x2cc9('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x2cc9('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x2cc9('0x9'));var SugarcrmAccount=require(_0x2cc9('0xa'));var ZohoAccount=require(_0x2cc9('0xb'));var DeskAccount=require(_0x2cc9('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x2cc9('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x2cc9('0xe'));var Realtime=function(){this[_0x2cc9('0xf')]={};this['telephones']={};this['trunks']={};this[_0x2cc9('0x10')]={};this[_0x2cc9('0x11')]={};this[_0x2cc9('0x12')]={};this[_0x2cc9('0x13')]={};this[_0x2cc9('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2cc9('0x15')]={};this[_0x2cc9('0x16')]={};this[_0x2cc9('0x17')]={};this[_0x2cc9('0x18')]={};this[_0x2cc9('0x19')]={};this[_0x2cc9('0x1a')]={};this[_0x2cc9('0x1b')]={};this['sugarcrmAccounts']={};this[_0x2cc9('0x1c')]={};this[_0x2cc9('0x1d')]={};this[_0x2cc9('0x1e')]={};this[_0x2cc9('0x1f')]={};this['servicenowAccounts']={};this[_0x2cc9('0x20')]={};this[_0x2cc9('0x21')]={};};function freeIsNotKey(_0x3c380c,_0x39aa00,_0x58ec11){var _0x2fa037=_[_0x2cc9('0x22')](_0x3c380c,function(_0x3080ed,_0x59b377){return _0x3080ed[_0x58ec11];});for(var _0x16051c in _0x39aa00){if(_0x39aa00[_0x2cc9('0x23')](_0x16051c)){if(!_0x2fa037[_0x16051c]){delete _0x39aa00[_0x16051c];}}}}function freeIsNotKeySip(_0x53ec15,_0x51bbbc){var _0x1311a5=_['mapKeys'](_0x53ec15,function(_0x228cf6,_0x52a124){return util[_0x2cc9('0x24')](_0x2cc9('0x25'),_0x228cf6[_0x2cc9('0x26')]);});for(var _0x5b2931 in _0x51bbbc){if(_0x51bbbc[_0x2cc9('0x23')](_0x5b2931)){if(!_0x1311a5[_0x5b2931]){delete _0x51bbbc[_0x5b2931];}}}}function freeIsNotKeyAgent(_0x3b68b4,_0x155abb){var _0x5c4c42=_['mapKeys'](_0x3b68b4,function(_0x1f8e57,_0x117780){var _0x4c04e5=_[_0x2cc9('0x27')](_0x1f8e57[_0x2cc9('0x28')])?util[_0x2cc9('0x24')](_0x2cc9('0x25'),_0x1f8e57[_0x2cc9('0x26')]):_0x1f8e57[_0x2cc9('0x28')];return _0x4c04e5;});for(var _0x565ece in _0x155abb){if(_0x155abb[_0x2cc9('0x23')](_0x565ece)){if(!_0x5c4c42[_0x565ece]){delete _0x155abb[_0x565ece];}}}}function clearVoiceCallReports(_0x2eff68){_0x2eff68[_0x2cc9('0x29')]=0x0;_0x2eff68[_0x2cc9('0x2a')]=0x0;_0x2eff68[_0x2cc9('0x2b')]=0x0;_0x2eff68[_0x2cc9('0x2c')]=0x0;_0x2eff68['sumBillable']=0x0;}function clearCampaigns(_0x3267d8){if(!_[_0x2cc9('0x2d')](_0x3267d8)){for(var _0x3bbf51 in _0x3267d8){if(_0x3267d8['hasOwnProperty'](_0x3bbf51)){_0x3267d8[_0x3bbf51][_0x2cc9('0x2e')]=0x0;_0x3267d8[_0x3bbf51][_0x2cc9('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x29a8c5){if(!_[_0x2cc9('0x2d')](_0x29a8c5)){for(var _0x23431f in _0x29a8c5){if(_0x29a8c5[_0x2cc9('0x23')](_0x23431f)){_0x29a8c5[_0x23431f]['total']=0x0;_0x29a8c5[_0x23431f]['answered']=0x0;_0x29a8c5[_0x23431f]['unmanaged']=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x30')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x2b')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x2c')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x31')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x32')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x33')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x34')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x35')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x36')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x37')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x38')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x39')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x3a')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x3b')]=0x0;_0x29a8c5[_0x23431f]['outboundRejectCallsDay']=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x3c')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x32')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x3d')]=0x0;_0x29a8c5[_0x23431f][_0x2cc9('0x3e')]=!![];}}}}Realtime['prototype'][_0x2cc9('0x3f')]=function(_0x48aefa,_0x1a8dda){for(var _0x12789b in _0x1a8dda){if(_0x48aefa[_0x2cc9('0x23')](_0x12789b)){_0x48aefa[_0x12789b]=_0x1a8dda[_0x12789b];}}};Realtime[_0x2cc9('0x40')][_0x2cc9('0x41')]=function(){var _0xdaa112=this;return function(_0x1137b3){if(_0x1137b3){freeIsNotKeyAgent(_0x1137b3,_0xdaa112[_0x2cc9('0xf')]);for(var _0x471f67=0x0,_0x41e6c9={},_0x2ea3c4={};_0x471f67<_0x1137b3[_0x2cc9('0x42')];_0x471f67+=0x1){_0x41e6c9=_0x1137b3[_0x471f67];var _0x36e11e=_['isNil'](_0x41e6c9[_0x2cc9('0x28')])?util['format'](_0x2cc9('0x25'),_0x41e6c9[_0x2cc9('0x26')]):_0x41e6c9['interface'];if(_[_0x2cc9('0x43')](_0xdaa112[_0x2cc9('0xf')][_0x36e11e])){_0xdaa112[_0x2cc9('0xf')][_0x36e11e]=new Agent(_0x41e6c9);}else{_0xdaa112[_0x2cc9('0x3f')](_0xdaa112[_0x2cc9('0xf')][_0x36e11e],_0x41e6c9);}}}return _0xdaa112[_0x2cc9('0xf')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x44')]=function(){var _0x1a07af=this;return function(_0x118080){if(_0x118080){freeIsNotKeySip(_0x118080,_0x1a07af[_0x2cc9('0x45')]);for(var _0x408650=0x0,_0x202767={},_0x395eed={};_0x408650<_0x118080[_0x2cc9('0x42')];_0x408650+=0x1){_0x202767=_0x118080[_0x408650];if(_[_0x2cc9('0x43')](_0x1a07af[_0x2cc9('0x45')][util[_0x2cc9('0x24')]('SIP/%s',_0x202767[_0x2cc9('0x26')])])){_0x1a07af[_0x2cc9('0x45')][util[_0x2cc9('0x24')](_0x2cc9('0x25'),_0x202767[_0x2cc9('0x26')])]=new Telephone(_0x202767);}else{_0x1a07af[_0x2cc9('0x3f')](_0x1a07af[_0x2cc9('0x45')][util['format'](_0x2cc9('0x25'),_0x202767[_0x2cc9('0x26')])],_0x202767);}}}return _0x1a07af[_0x2cc9('0x45')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x46')]=function(){var _0x2512ff=this;return function(_0x448e66){if(_0x448e66){freeIsNotKeySip(_0x448e66,_0x2512ff['trunks']);for(var _0x594ae3=0x0,_0x308e76={},_0x37af01={};_0x594ae3<_0x448e66[_0x2cc9('0x42')];_0x594ae3+=0x1){_0x308e76=_0x448e66[_0x594ae3];if(_[_0x2cc9('0x43')](_0x2512ff['trunks'][util[_0x2cc9('0x24')](_0x2cc9('0x25'),_0x308e76[_0x2cc9('0x26')])])){_0x2512ff[_0x2cc9('0x47')][util['format']('SIP/%s',_0x308e76[_0x2cc9('0x26')])]=new Trunk(_0x308e76);}else{_0x2512ff[_0x2cc9('0x3f')](_0x2512ff[_0x2cc9('0x47')][util['format'](_0x2cc9('0x25'),_0x308e76[_0x2cc9('0x26')])],_0x308e76);}}}return _0x2512ff['trunks'];};};Realtime['prototype'][_0x2cc9('0x48')]=function(){var _0x28f197=this;return function(_0x59c295){if(_0x59c295){freeIsNotKey(_0x59c295,_0x28f197[_0x2cc9('0x10')],_0x2cc9('0x26'));for(var _0x2b43cb=0x0,_0x58497d={},_0x71d86a={};_0x2b43cb<_0x59c295['length'];_0x2b43cb+=0x1){_0x58497d=_0x59c295[_0x2b43cb];if(_['isUndefined'](_0x28f197[_0x2cc9('0x10')][_0x58497d[_0x2cc9('0x26')]])){_0x28f197[_0x2cc9('0x10')][_0x58497d[_0x2cc9('0x26')]]=new VoiceQueue(_0x58497d);}else{_0x28f197[_0x2cc9('0x3f')](_0x28f197[_0x2cc9('0x10')][_0x58497d[_0x2cc9('0x26')]],_0x58497d);}}}return _0x28f197[_0x2cc9('0x10')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x49')]=function(){var _0x1dbe87=this;return function(_0xbd7d00){if(_0xbd7d00){freeIsNotKey(_0xbd7d00,_0x1dbe87[_0x2cc9('0x11')],'id');for(var _0x52208c=0x0,_0xf1f4a1={},_0x34f672={};_0x52208c<_0xbd7d00['length'];_0x52208c+=0x1){_0xf1f4a1=_0xbd7d00[_0x52208c];if(_[_0x2cc9('0x43')](_0x1dbe87['triggers'][_0xf1f4a1['id']])){_0x1dbe87[_0x2cc9('0x11')][_0xf1f4a1['id']]=new Trigger(_0xf1f4a1);}else{_0x1dbe87[_0x2cc9('0x3f')](_0x1dbe87[_0x2cc9('0x11')][_0xf1f4a1['id']],_0xf1f4a1);}}}return _0x1dbe87[_0x2cc9('0x11')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x4a')]=function(){var _0x3c06c8=this;return function(_0x4c8bc9){if(_0x4c8bc9){freeIsNotKey(_0x4c8bc9,_0x3c06c8[_0x2cc9('0x13')],'id');for(var _0x2a502f=0x0,_0x2ab99e={},_0x1e10bc={};_0x2a502f<_0x4c8bc9[_0x2cc9('0x42')];_0x2a502f+=0x1){_0x2ab99e=_0x4c8bc9[_0x2a502f];if(_[_0x2cc9('0x43')](_0x3c06c8[_0x2cc9('0x13')][_0x2ab99e['id']])){_0x3c06c8[_0x2cc9('0x13')][_0x2ab99e['id']]=new Template(_0x2ab99e);}else{_0x3c06c8[_0x2cc9('0x3f')](_0x3c06c8[_0x2cc9('0x13')][_0x2ab99e['id']],_0x2ab99e);}}}return _0x3c06c8[_0x2cc9('0x13')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x4c75fb=this;return function(_0x3e3b5c){if(_0x3e3b5c){freeIsNotKey(_0x3e3b5c,_0x4c75fb[_0x2cc9('0x1a')],'id');for(var _0x210b90=0x0,_0x4e7999={},_0x4a6bdb={};_0x210b90<_0x3e3b5c['length'];_0x210b90+=0x1){_0x4e7999=_0x3e3b5c[_0x210b90];if(_[_0x2cc9('0x43')](_0x4c75fb[_0x2cc9('0x1a')][_0x4e7999['id']])){_0x4c75fb[_0x2cc9('0x1a')][_0x4e7999['id']]=new ZendeskAccount(_0x4e7999);}else{_0x4c75fb['mergeFromDatabase'](_0x4c75fb[_0x2cc9('0x1a')][_0x4e7999['id']],_0x4e7999);}}}return _0x4c75fb[_0x2cc9('0x1a')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x4b')]=function(){var _0x1d368c=this;return function(_0x16a49f){if(_0x16a49f){freeIsNotKey(_0x16a49f,_0x1d368c['salesforceAccounts'],'id');for(var _0x17e369=0x0,_0x150acd={},_0x20c446={};_0x17e369<_0x16a49f[_0x2cc9('0x42')];_0x17e369+=0x1){_0x150acd=_0x16a49f[_0x17e369];if(_[_0x2cc9('0x43')](_0x1d368c[_0x2cc9('0x1b')][_0x150acd['id']])){_0x1d368c[_0x2cc9('0x1b')][_0x150acd['id']]=new SalesforceAccount(_0x150acd);}else{_0x1d368c['mergeFromDatabase'](_0x1d368c[_0x2cc9('0x1b')][_0x150acd['id']],_0x150acd);}}}return _0x1d368c[_0x2cc9('0x1b')];};};Realtime['prototype'][_0x2cc9('0x4c')]=function(){var _0x2f2fdc=this;return function(_0x166450){if(_0x166450){freeIsNotKey(_0x166450,_0x2f2fdc[_0x2cc9('0x1c')],'id');for(var _0x3d9ba6=0x0,_0x404f99={},_0x5281b6={};_0x3d9ba6<_0x166450[_0x2cc9('0x42')];_0x3d9ba6+=0x1){_0x404f99=_0x166450[_0x3d9ba6];if(_[_0x2cc9('0x43')](_0x2f2fdc[_0x2cc9('0x1c')][_0x404f99['id']])){_0x2f2fdc[_0x2cc9('0x1c')][_0x404f99['id']]=new FreshdeskAccount(_0x404f99);}else{_0x2f2fdc[_0x2cc9('0x3f')](_0x2f2fdc[_0x2cc9('0x1c')][_0x404f99['id']],_0x404f99);}}}return _0x2f2fdc[_0x2cc9('0x1c')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x4d')]=function(){var _0x257d52=this;return function(_0x181719){if(_0x181719){freeIsNotKey(_0x181719,_0x257d52[_0x2cc9('0x1d')],'id');for(var _0x2d4d98=0x0,_0x35e9f1={},_0xe2fd3d={};_0x2d4d98<_0x181719['length'];_0x2d4d98+=0x1){_0x35e9f1=_0x181719[_0x2d4d98];if(_[_0x2cc9('0x43')](_0x257d52[_0x2cc9('0x1d')][_0x35e9f1['id']])){_0x257d52[_0x2cc9('0x1d')][_0x35e9f1['id']]=new ZohoAccount(_0x35e9f1);}else{_0x257d52[_0x2cc9('0x3f')](_0x257d52[_0x2cc9('0x1d')][_0x35e9f1['id']],_0x35e9f1);}}}return _0x257d52[_0x2cc9('0x1d')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x4e')]=function(){var _0x33aa2d=this;return function(_0x4c9129){if(_0x4c9129){freeIsNotKey(_0x4c9129,_0x33aa2d['deskAccounts'],'id');for(var _0x38c066=0x0,_0x500585={},_0x149953={};_0x38c066<_0x4c9129['length'];_0x38c066+=0x1){_0x500585=_0x4c9129[_0x38c066];if(_['isUndefined'](_0x33aa2d[_0x2cc9('0x1e')][_0x500585['id']])){_0x33aa2d[_0x2cc9('0x1e')][_0x500585['id']]=new DeskAccount(_0x500585);}else{_0x33aa2d[_0x2cc9('0x3f')](_0x33aa2d['deskAccounts'][_0x500585['id']],_0x500585);}}}return _0x33aa2d[_0x2cc9('0x1e')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x4f')]=function(){var _0x3a1dc0=this;return function(_0x379ff3){if(_0x379ff3){freeIsNotKey(_0x379ff3,_0x3a1dc0[_0x2cc9('0x50')],'id');for(var _0x4ae29e=0x0,_0x43f13d={},_0x57d766={};_0x4ae29e<_0x379ff3['length'];_0x4ae29e+=0x1){_0x43f13d=_0x379ff3[_0x4ae29e];if(_[_0x2cc9('0x43')](_0x3a1dc0[_0x2cc9('0x50')][_0x43f13d['id']])){_0x3a1dc0[_0x2cc9('0x50')][_0x43f13d['id']]=new SugarcrmAccount(_0x43f13d);}else{_0x3a1dc0[_0x2cc9('0x3f')](_0x3a1dc0[_0x2cc9('0x50')][_0x43f13d['id']],_0x43f13d);}}}return _0x3a1dc0['sugarcrmAccounts'];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x51')]=function(){var _0x4f968c=this;return function(_0xfe2159){if(_0xfe2159){freeIsNotKey(_0xfe2159,_0x4f968c[_0x2cc9('0x1f')],'id');for(var _0x5d6fa5=0x0,_0x290d92={},_0x3de700={};_0x5d6fa5<_0xfe2159[_0x2cc9('0x42')];_0x5d6fa5+=0x1){_0x290d92=_0xfe2159[_0x5d6fa5];if(_['isUndefined'](_0x4f968c[_0x2cc9('0x1f')][_0x290d92['id']])){_0x4f968c[_0x2cc9('0x1f')][_0x290d92['id']]=new VtigerAccount(_0x290d92);}else{_0x4f968c['mergeFromDatabase'](_0x4f968c[_0x2cc9('0x1f')][_0x290d92['id']],_0x290d92);}}}return _0x4f968c['vtigerAccounts'];};};Realtime[_0x2cc9('0x40')]['initServicenowAccounts']=function(){var _0x49ef18=this;return function(_0x5c8560){if(_0x5c8560){freeIsNotKey(_0x5c8560,_0x49ef18[_0x2cc9('0x52')],'id');for(var _0x4475f5=0x0,_0x355726={},_0x130ec3={};_0x4475f5<_0x5c8560[_0x2cc9('0x42')];_0x4475f5+=0x1){_0x355726=_0x5c8560[_0x4475f5];if(_[_0x2cc9('0x43')](_0x49ef18[_0x2cc9('0x52')][_0x355726['id']])){_0x49ef18[_0x2cc9('0x52')][_0x355726['id']]=new ServicenowAccount(_0x355726);}else{_0x49ef18[_0x2cc9('0x3f')](_0x49ef18[_0x2cc9('0x52')][_0x355726['id']],_0x355726);}}}return _0x49ef18[_0x2cc9('0x52')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x40fdb7=this;return function(_0x1be362){if(_0x1be362){freeIsNotKey(_0x1be362,_0x40fdb7[_0x2cc9('0x20')],'id');for(var _0x2b2a1f=0x0,_0x401545={},_0x4c819d={};_0x2b2a1f<_0x1be362[_0x2cc9('0x42')];_0x2b2a1f+=0x1){_0x401545=_0x1be362[_0x2b2a1f];if(_['isUndefined'](_0x40fdb7['dynamics365Accounts'][_0x401545['id']])){_0x40fdb7[_0x2cc9('0x20')][_0x401545['id']]=new Dynamics365Account(_0x401545);}else{_0x40fdb7[_0x2cc9('0x3f')](_0x40fdb7['dynamics365Accounts'][_0x401545['id']],_0x401545);}}}return _0x40fdb7[_0x2cc9('0x20')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x53')]=function(){var _0x2bbebc=this;return function(_0x1045f9){for(var _0xc4d39f=0x0;_0xc4d39f<_0x1045f9[_0x2cc9('0x42')];_0xc4d39f+=0x1){_[_0x2cc9('0x54')](_0x2bbebc[_0x2cc9('0x10')][_0x1045f9[_0xc4d39f][_0x2cc9('0x26')]],_0x1045f9[_0xc4d39f]);}return _0x2bbebc['voiceQueues'];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x55')]=function(){var _0x298bc2=this;return function(_0x2a4bf7){clearVoiceQueues(_0x298bc2[_0x2cc9('0x10')]);if(_0x2a4bf7){_0x2a4bf7=_[_0x2cc9('0x56')](_0x2a4bf7,_0x2cc9('0x57'));for(var _0x5cc63e in _0x2a4bf7){if(_0x2a4bf7[_0x2cc9('0x23')](_0x5cc63e)){var _0xd36a12={};for(var _0x116a54=0x0;_0x116a54<_0x2a4bf7[_0x5cc63e]['length'];_0x116a54+=0x1){var _0x488e5b=_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x58')];if(_0x298bc2[_0x2cc9('0x10')][_0x488e5b]){if(_0x2a4bf7[_0x5cc63e][_0x116a54]['queuecallerexit']){_0x298bc2[_0x2cc9('0x10')][_0x488e5b]['unmanaged']+=0x1;}if(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x59')]){_0x298bc2[_0x2cc9('0x10')][_0x488e5b]['abandoned']+=0x1;}_0x298bc2['voiceQueues'][_0x488e5b][_0x2cc9('0x2b')]+=moment(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5a')])[_0x2cc9('0x5b')](moment(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5c')]),'seconds')||0x0;if(_0x116a54===_0x2a4bf7[_0x5cc63e][_0x2cc9('0x42')]-0x1){_0x298bc2[_0x2cc9('0x10')][_0x488e5b]['sumDuration']+=moment(_0x2a4bf7[_0x5cc63e][_0x116a54]['queuecallercompleteAt']||_0x2a4bf7[_0x5cc63e][_0x116a54]['queuecallerabandonAt']||_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5d')])[_0x2cc9('0x5b')](moment(_0x2a4bf7[_0x5cc63e][_0x116a54]['queuecallerjoinAt']),'seconds')||0x0;_0x298bc2['voiceQueues'][_0x488e5b]['total']+=0x1;if(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5e')]){_0x298bc2[_0x2cc9('0x10')][_0x488e5b][_0x2cc9('0x2a')]+=0x1;_0x298bc2[_0x2cc9('0x10')][_0x488e5b][_0x2cc9('0x31')]+=moment(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5f')])[_0x2cc9('0x5b')](moment(_0x2a4bf7[_0x5cc63e][_0x116a54][_0x2cc9('0x5a')]),_0x2cc9('0x60'))||0x0;}}else{_0x298bc2['voiceQueues'][_0x488e5b][_0x2cc9('0x2c')]+=_0x298bc2[_0x2cc9('0x10')][_0x488e5b]['sumHoldTime']||0x0;}}}}}}return _0x298bc2['voiceQueues'];};};Realtime[_0x2cc9('0x40')]['initVoiceCallReports']=function(){var _0x19ebaf=this;return function(_0x5c4dd2){clearVoiceCallReports(_0x19ebaf[_0x2cc9('0x14')]);if(_0x5c4dd2){for(var _0x5486a2=0x0;_0x5486a2<_0x5c4dd2[_0x2cc9('0x42')];_0x5486a2+=0x1){_0x19ebaf[_0x2cc9('0x14')][_0x2cc9('0x29')]+=0x1;_0x19ebaf[_0x2cc9('0x14')][_0x2cc9('0x2c')]+=_0x5c4dd2[_0x5486a2]['duration'];if(_0x5c4dd2[_0x5486a2]['disposition']==='ANSWERED'){_0x19ebaf[_0x2cc9('0x14')][_0x2cc9('0x2a')]+=0x1;_0x19ebaf[_0x2cc9('0x14')]['sumHoldTime']+=_0x5c4dd2[_0x5486a2]['duration']-_0x5c4dd2[_0x5486a2][_0x2cc9('0x61')]||0x0;_0x19ebaf[_0x2cc9('0x14')]['sumBillable']+=_0x5c4dd2[_0x5486a2][_0x2cc9('0x61')];}}}return _0x19ebaf[_0x2cc9('0x14')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x62')]=function(){var _0x235b5d=this;return function(_0x3b23d0){if(_0x3b23d0){freeIsNotKey(_0x3b23d0,_0x235b5d[_0x2cc9('0x12')],_0x2cc9('0x26'));for(var _0x522463=0x0,_0x19c4c2={};_0x522463<_0x3b23d0['length'];_0x522463+=0x1){_0x19c4c2=_0x3b23d0[_0x522463];if(_[_0x2cc9('0x43')](_0x235b5d[_0x2cc9('0x12')][_0x19c4c2[_0x2cc9('0x26')]])){_0x235b5d[_0x2cc9('0x12')][_0x19c4c2[_0x2cc9('0x26')]]=new Campaign(_0x19c4c2);}else{_0x235b5d[_0x2cc9('0x3f')](_0x235b5d['campaigns'][_0x19c4c2[_0x2cc9('0x26')]],_0x19c4c2);}}}return _0x235b5d[_0x2cc9('0x12')];};};Realtime[_0x2cc9('0x40')]['initVoiceExtensions']=function(){var _0x29ef1f=this;return function(_0x47e5f4){if(_0x47e5f4){freeIsNotKey(_0x47e5f4,_0x29ef1f[_0x2cc9('0x15')],'id');for(var _0xea58c4=0x0,_0x52f726={};_0xea58c4<_0x47e5f4['length'];_0xea58c4+=0x1){_0x52f726=_0x47e5f4[_0xea58c4];if(_[_0x2cc9('0x43')](_0x29ef1f['voiceExtensions'][_0x52f726['id']])){_0x29ef1f[_0x2cc9('0x15')][_0x52f726['id']]=new VoiceExtension(_0x52f726);}else{_0x29ef1f[_0x2cc9('0x3f')](_0x29ef1f[_0x2cc9('0x15')][_0x52f726['id']],_0x52f726);}}}return _0x29ef1f[_0x2cc9('0x15')];};};Realtime[_0x2cc9('0x40')][_0x2cc9('0x63')]=function(){var _0x41c06e=this;return function(_0x49ce81){clearCampaigns(_0x41c06e[_0x2cc9('0x12')]);for(var _0x53bb44=0x0;_0x53bb44<_0x49ce81[_0x2cc9('0x42')];_0x53bb44+=0x1){_[_0x2cc9('0x54')](_0x41c06e[_0x2cc9('0x12')][_0x49ce81[_0x53bb44][_0x2cc9('0x26')]],_0x49ce81[_0x53bb44]);}return _0x41c06e['campaigns'];};};Realtime['prototype'][_0x2cc9('0x64')]=function(){var _0x4715f4=this;return function(_0x564109){if(_0x564109){freeIsNotKey(_0x564109,_0x4715f4[_0x2cc9('0x21')],'id');for(var _0x25cc75=0x0,_0x46c5b1={},_0x5c2562={};_0x25cc75<_0x564109[_0x2cc9('0x42')];_0x25cc75+=0x1){_0x46c5b1=_0x564109[_0x25cc75];if(_[_0x2cc9('0x43')](_0x4715f4[_0x2cc9('0x21')][_0x46c5b1['id']])){_0x4715f4[_0x2cc9('0x21')][_0x46c5b1['id']]=new FaxAccount(_0x46c5b1);}else{_0x4715f4['mergeFromDatabase'](_0x4715f4[_0x2cc9('0x21')][_0x46c5b1['id']],_0x46c5b1);}}}return _0x4715f4[_0x2cc9('0x21')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f475aed..720c4c1 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 _0x5e9f=['connectedlinenum','assigned','interface','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','voiceCallReport','exten','type','dialer','lastapplication','lastdata','queue','from-voip-provider','callerid','context','destination','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitors','length','createdAt','connectedlinename','membername','forEach','Local','indexOf','mobile','phone','substring','lastIndexOf','exports','bluebird','lodash','util','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','format','SIP/%s','name'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0x5e9f,0x73));var _0xf5e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5e9f[_0x4b369d];return _0x571a98;};'use strict';var BPromise=require(_0xf5e9('0x0'));var _=require(_0xf5e9('0x1'));var moment=require('moment');var util=require(_0xf5e9('0x2'));var config=require('../../../config/environment');var logger=require(_0xf5e9('0x3'))(_0xf5e9('0x4'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xf5e9('0x5'));var RpcVoiceCallReport=require(_0xf5e9('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xf5e9('0x7'));var RpcVoiceRecording=require(_0xf5e9('0x8'));var RpcVoiceTransferReport=require(_0xf5e9('0x9'));var VoiceQueueReport=require(_0xf5e9('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xf5e9('0xb'));var UserReport=require(_0xf5e9('0xc'));function Report(_0xb048e4){this['realtime']=_0xb048e4;this[_0xf5e9('0xd')]=_0xb048e4['agents'];this[_0xf5e9('0xe')]=_0xb048e4[_0xf5e9('0xe')];}Report[_0xf5e9('0xf')][_0xf5e9('0x10')]=function(_0x24c350){var _0x4d4f24=new VoiceQueueReport(this[_0xf5e9('0x11')]);var _0x150bf6=new VoiceAgentReport(this[_0xf5e9('0x11')]);var _0x926b09=new VoiceDialReport(this['realtime']);var _0x427d2a=new VoiceCallReport(this[_0xf5e9('0x11')]);var _0x9a5abe=new UserReport(this[_0xf5e9('0x11')]);if(config['xdr']&&config[_0xf5e9('0x12')][_0xf5e9('0x13')]){ami['on'](_0xf5e9('0x14'),this[_0xf5e9('0x15')]['bind'](this));ami['on'](_0xf5e9('0x16'),this['voiceCallReport'][_0xf5e9('0x17')](this));ami['on']('custom:voiceAgentReport',this[_0xf5e9('0x18')][_0xf5e9('0x17')](this));ami['on']('custom:voiceDialReport',this[_0xf5e9('0x19')][_0xf5e9('0x17')](this));ami['on']('blindtransfer',this[_0xf5e9('0x1a')][_0xf5e9('0x17')](this));ami['on']('attendedtransfer',this[_0xf5e9('0x1b')][_0xf5e9('0x17')](this));}};Report[_0xf5e9('0xf')][_0xf5e9('0x1c')]=function(_0x397253){var _0x58c750=undefined;_0x58c750=_[_0xf5e9('0x1d')](this[_0xf5e9('0xd')],function(_0x33e69c){return _0x33e69c[_0xf5e9('0x1e')]==_0x397253||_0x33e69c['name']==_0x397253;});if(_[_0xf5e9('0x1f')](_0x58c750)){var _0x10bcce=_['find'](this[_0xf5e9('0xe')],function(_0x33e38e){return _0x33e38e[_0xf5e9('0x1e')]==_0x397253||_0x33e38e['name']==_0x397253;});if(_0x10bcce){_0x58c750=_[_0xf5e9('0x1d')](this[_0xf5e9('0xd')],function(_0x253637){return _0x253637['interface']==util[_0xf5e9('0x20')](_0xf5e9('0x21'),_0x10bcce[_0xf5e9('0x22')]);});}}return _0x58c750;};Report[_0xf5e9('0xf')][_0xf5e9('0x15')]=function(_0x3dc80a){for(var _0x381b78=0x0;_0x381b78<_0x3dc80a['length'];_0x381b78+=0x1){var _0x5b7b37=this['findAgent'](_0x3dc80a[_0x381b78][_0xf5e9('0x23')]);if(_0x5b7b37){_0x3dc80a[_0x381b78][_0xf5e9('0x1e')]=_0x5b7b37['accountcode'];_0x3dc80a[_0x381b78][_0xf5e9('0x24')]=!![];_0x3dc80a[_0x381b78]['lastAssignedTo']=_0x5b7b37[_0xf5e9('0x22')];_0x3dc80a[_0x381b78][_0xf5e9('0x25')]=_[_0xf5e9('0x1f')](_0x5b7b37[_0xf5e9('0x25')])?util[_0xf5e9('0x20')](_0xf5e9('0x21'),_0x5b7b37[_0xf5e9('0x22')]):_0x5b7b37[_0xf5e9('0x25')];if(_0x3dc80a[_0x381b78]['queuecallercomplete']){_0x3dc80a[_0x381b78]['queuecallercompleteAt']=moment()['format'](_0xf5e9('0x26'));}if(_0x3dc80a[_0x381b78]['queuecallerexit']){_0x3dc80a[_0x381b78][_0xf5e9('0x27')]=moment()[_0xf5e9('0x20')](_0xf5e9('0x26'));}RpcMemberReport['voiceQueueReport'](_0x3dc80a[_0x381b78]);}RpcVoiceQueueReport[_0xf5e9('0x28')](_0x3dc80a[_0x381b78]);}};function extractCalleridNumber(_0x579986){var _0x2915e1=_0x579986[_0xf5e9('0x29')](/<(.*?)>/);return _0x2915e1?_0x2915e1[0x1]:_0x579986;}Report[_0xf5e9('0xf')][_0xf5e9('0x2a')]=function(_0x21b663){_0x21b663['destination']=_0x21b663['destination']||_0x21b663[_0xf5e9('0x2b')];if(_0x21b663[_0xf5e9('0x2c')]==_0xf5e9('0x2d')){_0x21b663[_0xf5e9('0x2e')]='queue';_0x21b663[_0xf5e9('0x2f')]=_0x21b663[_0xf5e9('0x30')];if(_0x21b663['context']==_0xf5e9('0x31')){_0x21b663[_0xf5e9('0x1e')]='';_0x21b663['destination']=extractCalleridNumber(_0x21b663[_0xf5e9('0x32')]);}else if(_0x21b663[_0xf5e9('0x33')]=='from-sip'){if(_0x21b663[_0xf5e9('0x34')]==_0xf5e9('0x35')){_0x21b663[_0xf5e9('0x34')]=extractCalleridNumber(_0x21b663[_0xf5e9('0x36')]);_0x21b663[_0xf5e9('0x37')]=_0x21b663[_0xf5e9('0x38')];_0x21b663[_0xf5e9('0x39')]=[_0x21b663[_0xf5e9('0x3a')],_0x21b663[_0xf5e9('0x3a')]=_0x21b663[_0xf5e9('0x39')]][0x0];_0x21b663[_0xf5e9('0x32')]=_0x21b663[_0xf5e9('0x36')];}else{_0x21b663[_0xf5e9('0x34')]=_0x21b663[_0xf5e9('0x37')];_0x21b663['calleridnum']=_0x21b663['originatecalleridnum'];if(_0x21b663['disposition']==_0xf5e9('0x3b')){_0x21b663[_0xf5e9('0x1e')]=_0x21b663[_0xf5e9('0x23')];}else{_0x21b663['accountcode']='';}}}}else{_0x21b663[_0xf5e9('0x32')]=util[_0xf5e9('0x20')](_0xf5e9('0x3c'),_0x21b663[_0xf5e9('0x3d')],_0x21b663[_0xf5e9('0x37')]);}RpcVoiceCallReport[_0xf5e9('0x28')](_0x21b663);if(_0x21b663['monitor']){for(var _0x218490=0x0;_0x218490<_0x21b663[_0xf5e9('0x3e')][_0xf5e9('0x3f')];_0x218490+=0x1){_0x21b663['monitorFilename']=_0x21b663[_0xf5e9('0x3e')][_0x218490]['filename'];_0x21b663[_0xf5e9('0x40')]=_0x21b663[_0xf5e9('0x3e')][_0x218490][_0xf5e9('0x40')];if(_0x21b663[_0xf5e9('0x2b')]==_0xf5e9('0x35')){_0x21b663[_0xf5e9('0x37')]=_0x21b663['connectedlinenum'];_0x21b663['calleridname']=_0x21b663['connectedlinename'];_0x21b663[_0xf5e9('0x23')]=_0x21b663[_0xf5e9('0x1e')];_0x21b663[_0xf5e9('0x41')]=_0x21b663[_0xf5e9('0x42')];_0x21b663[_0xf5e9('0x2b')]=_0x21b663[_0xf5e9('0x38')];}else if(_0x21b663[_0xf5e9('0x2b')]=='xcally-motion-dialer'){_0x21b663['calleridnum']=_0x21b663['destination'];_0x21b663[_0xf5e9('0x2b')]=_0x21b663['originatecalleridnum'];}RpcVoiceRecording['create'](_0x21b663);}}};Report['prototype'][_0xf5e9('0x18')]=function(_0x76bf11){if(_['isArray'](_0x76bf11)){_0x76bf11[_0xf5e9('0x43')](function(_0xc9fa46){RpcVoiceAgentReport[_0xf5e9('0x28')](_0xc9fa46);});}else{RpcVoiceAgentReport[_0xf5e9('0x28')](_0x76bf11);}};Report[_0xf5e9('0xf')][_0xf5e9('0x19')]=function(_0x120efd){RpcVoiceDialReport[_0xf5e9('0x28')](_0x120efd);var _0x470485=undefined;var _0x41bf49=_0x120efd[_0xf5e9('0x3a')];if(_['startsWith'](_0x41bf49,_0xf5e9('0x44'))){var _0x436e38=_0x41bf49['substring'](_0x41bf49[_0xf5e9('0x45')]('/')+0x1,_0x41bf49[_0xf5e9('0x45')]('@'));_0x470485=_[_0xf5e9('0x1d')](this[_0xf5e9('0xd')],function(_0x298af0){return _0x298af0[_0xf5e9('0x46')]==_0x436e38||_0x298af0[_0xf5e9('0x47')]==_0x436e38||_0x298af0[_0xf5e9('0x1e')]==_0x436e38;});}else{var _0x436e38=_0x41bf49[_0xf5e9('0x48')](_0x41bf49['indexOf']('/')+0x1,_0x41bf49[_0xf5e9('0x49')]('-'));_0x470485=this[_0xf5e9('0x1c')](_0x436e38);}if(_0x470485){_0x120efd[_0xf5e9('0x25')]=_['isNil'](_0x470485[_0xf5e9('0x25')])?util[_0xf5e9('0x20')]('SIP/%s',_0x470485[_0xf5e9('0x22')]):_0x470485[_0xf5e9('0x25')];_0x120efd[_0xf5e9('0x42')]=_0x470485[_0xf5e9('0x22')];_0x120efd[_0xf5e9('0x1e')]=_0x470485[_0xf5e9('0x1e')];RpcMemberReport[_0xf5e9('0x19')](_0x120efd);}};Report[_0xf5e9('0xf')][_0xf5e9('0x1a')]=function(_0x457b7b){RpcVoiceTransferReport[_0xf5e9('0x1a')](_0x457b7b);};Report[_0xf5e9('0xf')][_0xf5e9('0x1b')]=function(_0x304953){RpcVoiceTransferReport[_0xf5e9('0x1b')](_0x304953);};module[_0xf5e9('0x4a')]=Report; \ No newline at end of file +var _0xc4f3=['prototype','realtime','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','connectedlinenum','assigned','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','phone','lastIndexOf','exports','bluebird','lodash','util','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','agents','telephones'];(function(_0x2fd7ee,_0x283da5){var _0x1507eb=function(_0x308404){while(--_0x308404){_0x2fd7ee['push'](_0x2fd7ee['shift']());}};_0x1507eb(++_0x283da5);}(_0xc4f3,0x194));var _0x3c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f3[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3c4f('0x0'));var _=require(_0x3c4f('0x1'));var moment=require('moment');var util=require(_0x3c4f('0x2'));var config=require('../../../config/environment');var logger=require(_0x3c4f('0x3'))(_0x3c4f('0x4'));var ami=require(_0x3c4f('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x3c4f('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x3c4f('0x7'));var RpcVoiceQueueReport=require(_0x3c4f('0x8'));var RpcVoiceRecording=require(_0x3c4f('0x9'));var RpcVoiceTransferReport=require(_0x3c4f('0xa'));var VoiceQueueReport=require(_0x3c4f('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x3c4f('0xc'));var VoiceDialReport=require(_0x3c4f('0xd'));var UserReport=require('./userReport');function Report(_0x188413){this['realtime']=_0x188413;this[_0x3c4f('0xe')]=_0x188413[_0x3c4f('0xe')];this[_0x3c4f('0xf')]=_0x188413['telephones'];}Report[_0x3c4f('0x10')]['sync']=function(_0x4d328a){var _0x35d4eb=new VoiceQueueReport(this[_0x3c4f('0x11')]);var _0x2b78c6=new VoiceAgentReport(this['realtime']);var _0x3a0c46=new VoiceDialReport(this[_0x3c4f('0x11')]);var _0x45de6d=new VoiceCallReport(this[_0x3c4f('0x11')]);var _0x4316a1=new UserReport(this['realtime']);if(config[_0x3c4f('0x12')]&&config['xdr'][_0x3c4f('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x3c4f('0x14')]['bind'](this));ami['on'](_0x3c4f('0x15'),this[_0x3c4f('0x16')][_0x3c4f('0x17')](this));ami['on']('custom:voiceAgentReport',this[_0x3c4f('0x18')][_0x3c4f('0x17')](this));ami['on'](_0x3c4f('0x19'),this[_0x3c4f('0x1a')]['bind'](this));ami['on']('blindtransfer',this[_0x3c4f('0x1b')]['bind'](this));ami['on'](_0x3c4f('0x1c'),this[_0x3c4f('0x1d')][_0x3c4f('0x17')](this));}};Report['prototype'][_0x3c4f('0x1e')]=function(_0x93fa27){var _0x30e2b6=undefined;_0x30e2b6=_[_0x3c4f('0x1f')](this['agents'],function(_0x94226d){return _0x94226d[_0x3c4f('0x20')]==_0x93fa27||_0x94226d[_0x3c4f('0x21')]==_0x93fa27;});if(_[_0x3c4f('0x22')](_0x30e2b6)){var _0xf5de3e=_[_0x3c4f('0x1f')](this[_0x3c4f('0xf')],function(_0x44afe3){return _0x44afe3[_0x3c4f('0x20')]==_0x93fa27||_0x44afe3[_0x3c4f('0x21')]==_0x93fa27;});if(_0xf5de3e){_0x30e2b6=_[_0x3c4f('0x1f')](this[_0x3c4f('0xe')],function(_0x80aaa4){return _0x80aaa4['interface']==util[_0x3c4f('0x23')](_0x3c4f('0x24'),_0xf5de3e[_0x3c4f('0x21')]);});}}return _0x30e2b6;};Report[_0x3c4f('0x10')][_0x3c4f('0x14')]=function(_0x54abf4){for(var _0x3fd029=0x0;_0x3fd029<_0x54abf4[_0x3c4f('0x25')];_0x3fd029+=0x1){var _0x765085=this[_0x3c4f('0x1e')](_0x54abf4[_0x3fd029][_0x3c4f('0x26')]);if(_0x765085){_0x54abf4[_0x3fd029][_0x3c4f('0x20')]=_0x765085[_0x3c4f('0x20')];_0x54abf4[_0x3fd029][_0x3c4f('0x27')]=!![];_0x54abf4[_0x3fd029]['lastAssignedTo']=_0x765085['name'];_0x54abf4[_0x3fd029][_0x3c4f('0x28')]=_[_0x3c4f('0x22')](_0x765085['interface'])?util[_0x3c4f('0x23')](_0x3c4f('0x24'),_0x765085[_0x3c4f('0x21')]):_0x765085[_0x3c4f('0x28')];if(_0x54abf4[_0x3fd029][_0x3c4f('0x29')]){_0x54abf4[_0x3fd029][_0x3c4f('0x2a')]=moment()[_0x3c4f('0x23')](_0x3c4f('0x2b'));}if(_0x54abf4[_0x3fd029][_0x3c4f('0x2c')]){_0x54abf4[_0x3fd029][_0x3c4f('0x2d')]=moment()[_0x3c4f('0x23')](_0x3c4f('0x2b'));}RpcMemberReport[_0x3c4f('0x14')](_0x54abf4[_0x3fd029]);}RpcVoiceQueueReport[_0x3c4f('0x2e')](_0x54abf4[_0x3fd029]);}};function extractCalleridNumber(_0x5105be){var _0x1577cc=_0x5105be['match'](/<(.*?)>/);return _0x1577cc?_0x1577cc[0x1]:_0x5105be;}Report['prototype'][_0x3c4f('0x16')]=function(_0x1f7fc5){_0x1f7fc5[_0x3c4f('0x2f')]=_0x1f7fc5['destination']||_0x1f7fc5[_0x3c4f('0x30')];if(_0x1f7fc5[_0x3c4f('0x31')]==_0x3c4f('0x32')){_0x1f7fc5[_0x3c4f('0x33')]=_0x3c4f('0x34');_0x1f7fc5[_0x3c4f('0x35')]=_0x1f7fc5[_0x3c4f('0x34')];if(_0x1f7fc5[_0x3c4f('0x36')]==_0x3c4f('0x37')){_0x1f7fc5['accountcode']='';_0x1f7fc5[_0x3c4f('0x2f')]=extractCalleridNumber(_0x1f7fc5[_0x3c4f('0x38')]);}else if(_0x1f7fc5[_0x3c4f('0x36')]==_0x3c4f('0x39')){if(_0x1f7fc5[_0x3c4f('0x2f')]==_0x3c4f('0x3a')){_0x1f7fc5['destination']=extractCalleridNumber(_0x1f7fc5[_0x3c4f('0x3b')]);_0x1f7fc5[_0x3c4f('0x3c')]=_0x1f7fc5[_0x3c4f('0x3d')];_0x1f7fc5['destinationchannel']=[_0x1f7fc5[_0x3c4f('0x3e')],_0x1f7fc5[_0x3c4f('0x3e')]=_0x1f7fc5[_0x3c4f('0x3f')]][0x0];_0x1f7fc5['callerid']=_0x1f7fc5['calleridpreview'];}else{_0x1f7fc5[_0x3c4f('0x2f')]=_0x1f7fc5[_0x3c4f('0x3c')];_0x1f7fc5[_0x3c4f('0x3c')]=_0x1f7fc5[_0x3c4f('0x3d')];if(_0x1f7fc5[_0x3c4f('0x40')]==_0x3c4f('0x41')){_0x1f7fc5[_0x3c4f('0x20')]=_0x1f7fc5[_0x3c4f('0x26')];}else{_0x1f7fc5['accountcode']='';}}}}else{_0x1f7fc5[_0x3c4f('0x38')]=util['format'](_0x3c4f('0x42'),_0x1f7fc5[_0x3c4f('0x43')],_0x1f7fc5[_0x3c4f('0x3c')]);}RpcVoiceCallReport['create'](_0x1f7fc5);if(_0x1f7fc5[_0x3c4f('0x44')]){for(var _0x499a8f=0x0;_0x499a8f<_0x1f7fc5[_0x3c4f('0x45')][_0x3c4f('0x25')];_0x499a8f+=0x1){_0x1f7fc5[_0x3c4f('0x46')]=_0x1f7fc5[_0x3c4f('0x45')][_0x499a8f][_0x3c4f('0x47')];_0x1f7fc5['createdAt']=_0x1f7fc5['monitors'][_0x499a8f][_0x3c4f('0x48')];if(_0x1f7fc5[_0x3c4f('0x30')]==_0x3c4f('0x3a')){_0x1f7fc5[_0x3c4f('0x3c')]=_0x1f7fc5['connectedlinenum'];_0x1f7fc5['calleridname']=_0x1f7fc5[_0x3c4f('0x49')];_0x1f7fc5['connectedlinenum']=_0x1f7fc5[_0x3c4f('0x20')];_0x1f7fc5[_0x3c4f('0x49')]=_0x1f7fc5[_0x3c4f('0x4a')];_0x1f7fc5[_0x3c4f('0x30')]=_0x1f7fc5[_0x3c4f('0x3d')];}else if(_0x1f7fc5[_0x3c4f('0x30')]==_0x3c4f('0x4b')){_0x1f7fc5[_0x3c4f('0x3c')]=_0x1f7fc5[_0x3c4f('0x2f')];_0x1f7fc5[_0x3c4f('0x30')]=_0x1f7fc5[_0x3c4f('0x3d')];}RpcVoiceRecording[_0x3c4f('0x2e')](_0x1f7fc5);}}};Report['prototype']['voiceAgentReport']=function(_0x4c696c){if(_[_0x3c4f('0x4c')](_0x4c696c)){_0x4c696c[_0x3c4f('0x4d')](function(_0x2500b4){RpcVoiceAgentReport['create'](_0x2500b4);});}else{RpcVoiceAgentReport['create'](_0x4c696c);}};Report[_0x3c4f('0x10')][_0x3c4f('0x1a')]=function(_0x2b12bc){RpcVoiceDialReport[_0x3c4f('0x2e')](_0x2b12bc);var _0x4a84c7=undefined;var _0x548658=_0x2b12bc[_0x3c4f('0x3e')];if(_['startsWith'](_0x548658,_0x3c4f('0x4e'))){var _0x2e232f=_0x548658[_0x3c4f('0x4f')](_0x548658[_0x3c4f('0x50')]('/')+0x1,_0x548658['indexOf']('@'));_0x4a84c7=_[_0x3c4f('0x1f')](this[_0x3c4f('0xe')],function(_0x5d9943){return _0x5d9943['mobile']==_0x2e232f||_0x5d9943[_0x3c4f('0x51')]==_0x2e232f||_0x5d9943[_0x3c4f('0x20')]==_0x2e232f;});}else{var _0x2e232f=_0x548658['substring'](_0x548658[_0x3c4f('0x50')]('/')+0x1,_0x548658[_0x3c4f('0x52')]('-'));_0x4a84c7=this[_0x3c4f('0x1e')](_0x2e232f);}if(_0x4a84c7){_0x2b12bc['interface']=_[_0x3c4f('0x22')](_0x4a84c7[_0x3c4f('0x28')])?util[_0x3c4f('0x23')]('SIP/%s',_0x4a84c7['name']):_0x4a84c7[_0x3c4f('0x28')];_0x2b12bc['membername']=_0x4a84c7['name'];_0x2b12bc[_0x3c4f('0x20')]=_0x4a84c7['accountcode'];RpcMemberReport[_0x3c4f('0x1a')](_0x2b12bc);}};Report[_0x3c4f('0x10')][_0x3c4f('0x1b')]=function(_0x3192bf){RpcVoiceTransferReport[_0x3c4f('0x1b')](_0x3192bf);};Report['prototype'][_0x3c4f('0x1d')]=function(_0x294fa3){RpcVoiceTransferReport[_0x3c4f('0x1d')](_0x294fa3);};module[_0x3c4f('0x53')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 258d7a8..cd43d83 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 _0x2adf=['address','status','telephone:%s','exports','bluebird','util','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','catch','[loopSyncRealTimeShow]','error','prototype','resolve','actionSipPeerStatus','isNotNull','isUndefined','emit','find','username','stateRegistry','event','actionid','state','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','inspect','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:save','startsWith','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','registered'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x2adf,0x86));var _0xf2ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2adf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf2ad('0x0'));var util=require(_0xf2ad('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xf2ad('0x2'))(_0xf2ad('0x3'));var ami=require(_0xf2ad('0x4'));config[_0xf2ad('0x5')]=_[_0xf2ad('0x6')](config[_0xf2ad('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf2ad('0x7'))(new Redis(config['redis']));function UserReport(_0x2964c7){this[_0xf2ad('0x8')]=_0x2964c7[_0xf2ad('0x8')];this['agents']=_0x2964c7[_0xf2ad('0x9')];this['telephones']=_0x2964c7[_0xf2ad('0xa')];ami['on'](_0xf2ad('0xb'),this[_0xf2ad('0xc')][_0xf2ad('0xd')](this));ami['on'](_0xf2ad('0xe'),this['syncRegistry']['bind'](this));ami['on'](_0xf2ad('0xf'),this[_0xf2ad('0x10')][_0xf2ad('0xd')](this));ami['on'](_0xf2ad('0x11'),this[_0xf2ad('0x12')][_0xf2ad('0xd')](this));this[_0xf2ad('0x13')]();return BPromise['resolve']()[_0xf2ad('0x14')](ami[_0xf2ad('0x15')]())[_0xf2ad('0x14')](ami[_0xf2ad('0x16')]())[_0xf2ad('0x14')](ami['actionSipPeerStatus']())[_0xf2ad('0x17')](loggerCatch(_0xf2ad('0x18')));}function loggerCatch(_0x3043f1){return function(_0x4e6593){logger[_0xf2ad('0x19')](_0x3043f1,util['inspect'](_0x4e6593,{'showHidden':![],'depth':null}));};}UserReport[_0xf2ad('0x1a')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xf2ad('0x1b')]()[_0xf2ad('0x14')](ami[_0xf2ad('0x15')]())[_0xf2ad('0x14')](ami[_0xf2ad('0x16')]())['then'](ami[_0xf2ad('0x1c')]())[_0xf2ad('0x17')](loggerCatch(_0xf2ad('0x18')));},0x32c8);};UserReport[_0xf2ad('0x1a')][_0xf2ad('0x1d')]=function(_0x29f29f){return _0x29f29f!==null&&!_[_0xf2ad('0x1e')](_0x29f29f);};UserReport[_0xf2ad('0x1a')][_0xf2ad('0x1f')]=function(_0x2c678e,_0x5cb0d0,_0x5130bf){io['to'](_0x2c678e)['emit'](_0x5cb0d0,_0x5130bf);};UserReport[_0xf2ad('0x1a')]['syncRegistry']=function(_0x8224ee){try{if(this[_0xf2ad('0x1d')](_0x8224ee)){var _0x2634b8=_[_0xf2ad('0x20')](this[_0xf2ad('0x8')],{'registry':_0x8224ee[_0xf2ad('0x21')]});if(_0x2634b8){_0x8224ee[_0xf2ad('0x22')]=_0x8224ee['state'];_['merge'](_0x2634b8,_['omit'](_0x8224ee,[_0xf2ad('0x23'),_0xf2ad('0x24'),_0xf2ad('0x21'),_0xf2ad('0x25')]));this['emit'](util[_0xf2ad('0x26')](_0xf2ad('0x27'),_0x2634b8[_0xf2ad('0x28')]),_0xf2ad('0x29'),_0x2634b8);}}}catch(_0x1699bb){logger[_0xf2ad('0x19')](_0xf2ad('0x2a'),util[_0xf2ad('0x2b')](_0x1699bb,{'showHidden':![],'depth':null}));}};UserReport[_0xf2ad('0x1a')][_0xf2ad('0x10')]=function(_0x261ee4){try{if(this[_0xf2ad('0x1d')](_0x261ee4)){if(this[_0xf2ad('0x9')][_0x261ee4[_0xf2ad('0x2c')]]){if(!this['agents'][_0x261ee4[_0xf2ad('0x2c')]]['local']||_0x261ee4[_0xf2ad('0x25')][_0xf2ad('0x2d')]()==_0xf2ad('0x2e')){this[_0xf2ad('0x9')][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x2f')]=![];if(this['agents'][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x25')]!==_0x261ee4[_0xf2ad('0x25')]['toLowerCase']()){this[_0xf2ad('0x9')][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x30')]=_[_0xf2ad('0x31')](moment()[_0xf2ad('0x26')]('x'));}this[_0xf2ad('0x9')][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x25')]=_0x261ee4['state'][_0xf2ad('0x2d')]();this['agents'][_0x261ee4['device']][_0xf2ad('0x32')](_0x261ee4);}}else if(this['telephones'][_0x261ee4[_0xf2ad('0x2c')]]){if(this[_0xf2ad('0xa')][_0x261ee4['device']][_0xf2ad('0x25')]!==_0x261ee4[_0xf2ad('0x25')][_0xf2ad('0x2d')]()){this['telephones'][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x30')]=_['toNumber'](moment()[_0xf2ad('0x26')]('x'));}this[_0xf2ad('0xa')][_0x261ee4[_0xf2ad('0x2c')]]['state']=_0x261ee4[_0xf2ad('0x25')]['toLowerCase']();this[_0xf2ad('0x1f')](util[_0xf2ad('0x26')]('telephone:%s',this['telephones'][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x28')]),_0xf2ad('0x33'),this[_0xf2ad('0xa')][_0x261ee4[_0xf2ad('0x2c')]]);}else if(this['trunks'][_0x261ee4[_0xf2ad('0x2c')]]){if(this[_0xf2ad('0x8')][_0x261ee4[_0xf2ad('0x2c')]]['state']!==_0x261ee4[_0xf2ad('0x25')][_0xf2ad('0x2d')]()){this[_0xf2ad('0x8')][_0x261ee4[_0xf2ad('0x2c')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xf2ad('0x8')][_0x261ee4[_0xf2ad('0x2c')]][_0xf2ad('0x25')]=_0x261ee4[_0xf2ad('0x25')][_0xf2ad('0x2d')]();this[_0xf2ad('0x1f')](util[_0xf2ad('0x26')]('trunk:%s',this[_0xf2ad('0x8')][_0x261ee4['device']][_0xf2ad('0x28')]),_0xf2ad('0x29'),this['trunks'][_0x261ee4[_0xf2ad('0x2c')]]);}else if(_[_0xf2ad('0x34')](_0x261ee4[_0xf2ad('0x2c')],'Queue')){}else if(_[_0xf2ad('0x34')](_0x261ee4[_0xf2ad('0x2c')],_0xf2ad('0x35'))){var _0x5025e2=_0x261ee4[_0xf2ad('0x2c')];var _0x1ba197=_0x5025e2[_0xf2ad('0x36')](_0x5025e2[_0xf2ad('0x37')]('/')+0x1,_0x5025e2[_0xf2ad('0x37')]('@'));var _0x18a10a=_[_0xf2ad('0x20')](this[_0xf2ad('0x9')],function(_0x274392){return _0x274392[_0xf2ad('0x38')]==_0x1ba197||_0x274392['phone']==_0x1ba197||_0x274392[_0xf2ad('0x39')]==_0x1ba197;});if(_0x18a10a){if(_0x18a10a[_0xf2ad('0x25')]!==_0x261ee4[_0xf2ad('0x25')][_0xf2ad('0x2d')]()){_0x18a10a[_0xf2ad('0x30')]=_[_0xf2ad('0x31')](moment()[_0xf2ad('0x26')]('x'));}_0x18a10a['state']=_0x261ee4['state'][_0xf2ad('0x2d')]();_0x18a10a['local']=!![];_0x18a10a[_0xf2ad('0x32')](_0x261ee4);}}else{}}}catch(_0x3f60e4){logger[_0xf2ad('0x19')](_0xf2ad('0x3a'),util[_0xf2ad('0x2b')](_0x3f60e4,{'showHidden':![],'depth':null}));}};UserReport[_0xf2ad('0x1a')]['syncPeerStatus']=function(_0x1419af){try{if(this['isNotNull'](_0x1419af)&&this[_0xf2ad('0x1d')](_0x1419af[_0xf2ad('0x11')])){if(this[_0xf2ad('0x9')][_0x1419af[_0xf2ad('0x3b')]]){if(!this[_0xf2ad('0x9')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x2f')]||_0x1419af[_0xf2ad('0x11')]['toLowerCase']()==_0xf2ad('0x3c')){this['agents'][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x2f')]=![];this['agents'][_0x1419af[_0xf2ad('0x3b')]]['status']=_0x1419af[_0xf2ad('0x11')][_0xf2ad('0x2d')]();this[_0xf2ad('0x9')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x3d')]=_0x1419af[_0xf2ad('0x3d')];this[_0xf2ad('0x9')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x32')](_0x1419af);}}else if(this['telephones'][_0x1419af['peer']]){this[_0xf2ad('0xa')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x3e')]=_0x1419af[_0xf2ad('0x11')][_0xf2ad('0x2d')]();this['telephones'][_0x1419af[_0xf2ad('0x3b')]]['address']=_0x1419af[_0xf2ad('0x3d')];this[_0xf2ad('0x1f')](util[_0xf2ad('0x26')](_0xf2ad('0x3f'),this[_0xf2ad('0xa')][_0x1419af[_0xf2ad('0x3b')]]['name']),_0xf2ad('0x33'),this['telephones'][_0x1419af[_0xf2ad('0x3b')]]);}else if(this[_0xf2ad('0x8')][_0x1419af[_0xf2ad('0x3b')]]){this[_0xf2ad('0x8')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x3e')]=_0x1419af[_0xf2ad('0x11')][_0xf2ad('0x2d')]();this[_0xf2ad('0x8')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x3d')]=_0x1419af[_0xf2ad('0x3d')];this[_0xf2ad('0x1f')](util['format'](_0xf2ad('0x27'),this[_0xf2ad('0x8')][_0x1419af[_0xf2ad('0x3b')]][_0xf2ad('0x28')]),_0xf2ad('0x29'),this['trunks'][_0x1419af[_0xf2ad('0x3b')]]);}else{}}}catch(_0x183fd3){logger['error']('[syncPeerStatus][UserReport]',util['inspect'](_0x183fd3,{'showHidden':![],'depth':null}));}};module[_0xf2ad('0x40')]=UserReport; \ No newline at end of file +var _0x64e9=['then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','isNotNull','isUndefined','emit','find','username','stateRegistry','omit','state','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow'];(function(_0x52fd3d,_0x3af718){var _0x49b06d=function(_0x2f4a2b){while(--_0x2f4a2b){_0x52fd3d['push'](_0x52fd3d['shift']());}};_0x49b06d(++_0x3af718);}(_0x64e9,0x1b9));var _0x964e=function(_0x3e319b,_0xa95b1a){_0x3e319b=_0x3e319b-0x0;var _0x3a4511=_0x64e9[_0x3e319b];return _0x3a4511;};'use strict';var _=require(_0x964e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x964e('0x1'));var Redis=require(_0x964e('0x2'));var config=require(_0x964e('0x3'));var logger=require('../../../config/logger')(_0x964e('0x4'));var ami=require(_0x964e('0x5'));config[_0x964e('0x6')]=_[_0x964e('0x7')](config[_0x964e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x964e('0x8'))(new Redis(config[_0x964e('0x6')]));function UserReport(_0x5ccf72){this['trunks']=_0x5ccf72[_0x964e('0x9')];this[_0x964e('0xa')]=_0x5ccf72[_0x964e('0xa')];this[_0x964e('0xb')]=_0x5ccf72[_0x964e('0xb')];ami['on'](_0x964e('0xc'),this['syncRegistry'][_0x964e('0xd')](this));ami['on'](_0x964e('0xe'),this[_0x964e('0xf')]['bind'](this));ami['on'](_0x964e('0x10'),this[_0x964e('0x11')][_0x964e('0xd')](this));ami['on'](_0x964e('0x12'),this[_0x964e('0x13')][_0x964e('0xd')](this));this[_0x964e('0x14')]();return BPromise['resolve']()[_0x964e('0x15')](ami[_0x964e('0x16')]())[_0x964e('0x15')](ami[_0x964e('0x17')]())[_0x964e('0x15')](ami[_0x964e('0x18')]())[_0x964e('0x19')](loggerCatch(_0x964e('0x1a')));}function loggerCatch(_0x4a8c08){return function(_0x4b1e0f){logger[_0x964e('0x1b')](_0x4a8c08,util[_0x964e('0x1c')](_0x4b1e0f,{'showHidden':![],'depth':null}));};}UserReport[_0x964e('0x1d')][_0x964e('0x14')]=function(){setInterval(function(){BPromise[_0x964e('0x1e')]()[_0x964e('0x15')](ami[_0x964e('0x16')]())['then'](ami[_0x964e('0x17')]())[_0x964e('0x15')](ami[_0x964e('0x18')]())[_0x964e('0x19')](loggerCatch(_0x964e('0x1a')));},0x32c8);};UserReport[_0x964e('0x1d')][_0x964e('0x1f')]=function(_0x47187b){return _0x47187b!==null&&!_[_0x964e('0x20')](_0x47187b);};UserReport[_0x964e('0x1d')]['emit']=function(_0x128fb5,_0x505c62,_0x29bb22){io['to'](_0x128fb5)[_0x964e('0x21')](_0x505c62,_0x29bb22);};UserReport[_0x964e('0x1d')]['syncRegistry']=function(_0x444d2c){try{if(this['isNotNull'](_0x444d2c)){var _0xe2d3de=_[_0x964e('0x22')](this[_0x964e('0x9')],{'registry':_0x444d2c[_0x964e('0x23')]});if(_0xe2d3de){_0x444d2c[_0x964e('0x24')]=_0x444d2c['state'];_['merge'](_0xe2d3de,_[_0x964e('0x25')](_0x444d2c,['event','actionid',_0x964e('0x23'),_0x964e('0x26')]));this[_0x964e('0x21')](util[_0x964e('0x27')](_0x964e('0x28'),_0xe2d3de[_0x964e('0x29')]),_0x964e('0x2a'),_0xe2d3de);}}}catch(_0x1aeeb4){logger[_0x964e('0x1b')](_0x964e('0x2b'),util[_0x964e('0x1c')](_0x1aeeb4,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x964e('0x11')]=function(_0x5c0681){try{if(this[_0x964e('0x1f')](_0x5c0681)){if(this[_0x964e('0xa')][_0x5c0681['device']]){if(!this[_0x964e('0xa')][_0x5c0681[_0x964e('0x2c')]]['local']||_0x5c0681['state'][_0x964e('0x2d')]()==_0x964e('0x2e')){this[_0x964e('0xa')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x2f')]=![];if(this['agents'][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x26')]!==_0x5c0681[_0x964e('0x26')]['toLowerCase']()){this[_0x964e('0xa')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x30')]=_[_0x964e('0x31')](moment()['format']('x'));}this[_0x964e('0xa')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x26')]=_0x5c0681[_0x964e('0x26')][_0x964e('0x2d')]();this[_0x964e('0xa')][_0x5c0681['device']][_0x964e('0x32')](_0x5c0681);}}else if(this['telephones'][_0x5c0681[_0x964e('0x2c')]]){if(this[_0x964e('0xb')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x26')]!==_0x5c0681['state'][_0x964e('0x2d')]()){this[_0x964e('0xb')][_0x5c0681[_0x964e('0x2c')]]['stateTime']=_[_0x964e('0x31')](moment()[_0x964e('0x27')]('x'));}this[_0x964e('0xb')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x26')]=_0x5c0681['state']['toLowerCase']();this[_0x964e('0x21')](util[_0x964e('0x27')](_0x964e('0x33'),this[_0x964e('0xb')][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x29')]),_0x964e('0x34'),this['telephones'][_0x5c0681[_0x964e('0x2c')]]);}else if(this[_0x964e('0x9')][_0x5c0681['device']]){if(this[_0x964e('0x9')][_0x5c0681['device']][_0x964e('0x26')]!==_0x5c0681[_0x964e('0x26')][_0x964e('0x2d')]()){this['trunks'][_0x5c0681[_0x964e('0x2c')]][_0x964e('0x30')]=_[_0x964e('0x31')](moment()['format']('x'));}this['trunks'][_0x5c0681[_0x964e('0x2c')]]['state']=_0x5c0681[_0x964e('0x26')][_0x964e('0x2d')]();this[_0x964e('0x21')](util[_0x964e('0x27')](_0x964e('0x28'),this[_0x964e('0x9')][_0x5c0681[_0x964e('0x2c')]]['name']),'trunk:save',this[_0x964e('0x9')][_0x5c0681['device']]);}else if(_[_0x964e('0x35')](_0x5c0681[_0x964e('0x2c')],_0x964e('0x36'))){}else if(_[_0x964e('0x35')](_0x5c0681[_0x964e('0x2c')],'Local')){var _0x1c8b0b=_0x5c0681[_0x964e('0x2c')];var _0x1c3be7=_0x1c8b0b[_0x964e('0x37')](_0x1c8b0b[_0x964e('0x38')]('/')+0x1,_0x1c8b0b[_0x964e('0x38')]('@'));var _0x5a9f11=_['find'](this[_0x964e('0xa')],function(_0x126de9){return _0x126de9[_0x964e('0x39')]==_0x1c3be7||_0x126de9[_0x964e('0x3a')]==_0x1c3be7||_0x126de9[_0x964e('0x3b')]==_0x1c3be7;});if(_0x5a9f11){if(_0x5a9f11[_0x964e('0x26')]!==_0x5c0681['state'][_0x964e('0x2d')]()){_0x5a9f11[_0x964e('0x30')]=_[_0x964e('0x31')](moment()['format']('x'));}_0x5a9f11[_0x964e('0x26')]=_0x5c0681[_0x964e('0x26')][_0x964e('0x2d')]();_0x5a9f11['local']=!![];_0x5a9f11[_0x964e('0x32')](_0x5c0681);}}else{}}}catch(_0xd4e114){logger['error'](_0x964e('0x3c'),util[_0x964e('0x1c')](_0xd4e114,{'showHidden':![],'depth':null}));}};UserReport[_0x964e('0x1d')][_0x964e('0x13')]=function(_0x54b282){try{if(this['isNotNull'](_0x54b282)&&this['isNotNull'](_0x54b282[_0x964e('0x12')])){if(this[_0x964e('0xa')][_0x54b282[_0x964e('0x3d')]]){if(!this['agents'][_0x54b282[_0x964e('0x3d')]]['local']||_0x54b282[_0x964e('0x12')]['toLowerCase']()==_0x964e('0x3e')){this[_0x964e('0xa')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x2f')]=![];this[_0x964e('0xa')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x3f')]=_0x54b282['peerstatus'][_0x964e('0x2d')]();this[_0x964e('0xa')][_0x54b282[_0x964e('0x3d')]]['address']=_0x54b282['address'];this[_0x964e('0xa')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x32')](_0x54b282);}}else if(this[_0x964e('0xb')][_0x54b282['peer']]){this[_0x964e('0xb')][_0x54b282['peer']][_0x964e('0x3f')]=_0x54b282[_0x964e('0x12')][_0x964e('0x2d')]();this[_0x964e('0xb')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x40')]=_0x54b282[_0x964e('0x40')];this[_0x964e('0x21')](util[_0x964e('0x27')](_0x964e('0x33'),this[_0x964e('0xb')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x29')]),_0x964e('0x34'),this[_0x964e('0xb')][_0x54b282['peer']]);}else if(this[_0x964e('0x9')][_0x54b282[_0x964e('0x3d')]]){this['trunks'][_0x54b282['peer']][_0x964e('0x3f')]=_0x54b282[_0x964e('0x12')][_0x964e('0x2d')]();this[_0x964e('0x9')][_0x54b282[_0x964e('0x3d')]][_0x964e('0x40')]=_0x54b282[_0x964e('0x40')];this[_0x964e('0x21')](util[_0x964e('0x27')]('trunk:%s',this['trunks'][_0x54b282[_0x964e('0x3d')]]['name']),_0x964e('0x2a'),this['trunks'][_0x54b282[_0x964e('0x3d')]]);}else{}}}catch(_0x23a522){logger[_0x964e('0x1b')]('[syncPeerStatus][UserReport]',util[_0x964e('0x1c')](_0x23a522,{'showHidden':![],'depth':null}));}};module[_0x964e('0x41')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index c891914..bebf59d 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 _0x80aa=['secondtransfereruniqueid','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','ami','redis','defaults','socket.io-emitter','channels','voiceQueues','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','privilege','format','user:called','error','inspect','hasOwnProperty','agentconnectAt','lastevent','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','agents','interface','destconnectedlinenum','user:%s','membername','user:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','agentcompleteAt','complete','talktime','transfer','acw','agentacw','acwTimeout','custom:agentcomplete','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','isNil','includes','syncHangup','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds'];(function(_0x5aa423,_0xf1b87d){var _0x281b15=function(_0xc94b42){while(--_0xc94b42){_0x5aa423['push'](_0x5aa423['shift']());}};_0x281b15(++_0xf1b87d);}(_0x80aa,0x7f));var _0xa80a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa80a('0x0'));var moment=require(_0xa80a('0x1'));var util=require('util');var Redis=require(_0xa80a('0x2'));var config=require(_0xa80a('0x3'));var logger=require('../../../config/logger')(_0xa80a('0x4'));var ami=require('../ami');config[_0xa80a('0x5')]=_[_0xa80a('0x6')](config[_0xa80a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa80a('0x7'))(new Redis(config[_0xa80a('0x5')]));function VoiceAgentReport(_0x2562bc){this[_0xa80a('0x8')]={};this[_0xa80a('0x9')]=_0x2562bc['voiceQueues'];this['agents']=_0x2562bc['agents'];this[_0xa80a('0xa')]={};ami['on'](_0xa80a('0xb'),this[_0xa80a('0xc')]['bind'](this));ami['on'](_0xa80a('0xd'),this[_0xa80a('0xe')][_0xa80a('0xf')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xa80a('0x10'),this[_0xa80a('0x11')][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x12'),this['syncAgentComplete'][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x13'),this[_0xa80a('0x14')][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x15'),this['syncHangup'][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x16'),this['syncMusicOnHoldStart'][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x17'),this[_0xa80a('0x18')][_0xa80a('0xf')](this));ami['on']('attendedtransfer',this[_0xa80a('0x19')][_0xa80a('0xf')](this));ami['on'](_0xa80a('0x1a'),this[_0xa80a('0x1b')][_0xa80a('0xf')](this));}VoiceAgentReport[_0xa80a('0x1c')]['emit']=function(_0x2b8928,_0x34c69c,_0x5a8ad3){io['to'](_0x2b8928)[_0xa80a('0x1d')](_0x34c69c,_0x5a8ad3);};VoiceAgentReport['prototype']['isNotNull']=function(_0x1f08f6){return _0x1f08f6!==null&&!_['isUndefined'](_0x1f08f6);};VoiceAgentReport['prototype'][_0xa80a('0xc')]=function(_0x3a1817){try{if(this[_0xa80a('0x1e')](_0x3a1817)){if(_[_0xa80a('0x1f')](this[_0xa80a('0x8')][_0x3a1817[_0xa80a('0x20')]])){this['channels'][_0x3a1817[_0xa80a('0x20')]]={};}if(_[_0xa80a('0x1f')](this[_0xa80a('0x8')][_0x3a1817[_0xa80a('0x20')]][_0x3a1817[_0xa80a('0x21')]])){this[_0xa80a('0x8')][_0x3a1817['uniqueid']][_0x3a1817[_0xa80a('0x21')]]={'agentcalledAt':moment()['format'](_0xa80a('0x22')),'lastevent':_0xa80a('0x23'),'variables':this[_0xa80a('0xa')][_0x3a1817[_0xa80a('0x20')]],'type':this[_0xa80a('0x9')][_0x3a1817[_0xa80a('0x24')]]?this[_0xa80a('0x9')][_0x3a1817['queue']][_0xa80a('0x25')]||_0xa80a('0x26'):'inbound'};}_[_0xa80a('0x27')](this['channels'][_0x3a1817[_0xa80a('0x20')]][_0x3a1817[_0xa80a('0x21')]],_[_0xa80a('0x28')](_0x3a1817,['event',_0xa80a('0x29')]));ami[_0xa80a('0x1d')]('custom:agentcalled',this[_0xa80a('0x8')][_0x3a1817['uniqueid']][_0x3a1817[_0xa80a('0x21')]]);this[_0xa80a('0x1d')](util[_0xa80a('0x2a')]('user:%s',_0x3a1817['membername']),_0xa80a('0x2b'),this['channels'][_0x3a1817['uniqueid']][_0x3a1817['destuniqueid']]);}}catch(_0x3afe0c){logger[_0xa80a('0x2c')]('[syncAgentCalled][VoiceAgentReport]',util[_0xa80a('0x2d')](_0x3afe0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0xe')]=function(_0x44c264){try{if(this['isNotNull'](_0x44c264)){if(this[_0xa80a('0x8')][_0x44c264['uniqueid']]){for(var _0x27ddea in this['channels'][_0x44c264[_0xa80a('0x20')]]){if(this['channels'][_0x44c264['uniqueid']][_0xa80a('0x2e')](_0x27ddea)){if(_0x44c264[_0xa80a('0x21')]===_0x27ddea){this[_0xa80a('0x8')][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x2f')]=moment()[_0xa80a('0x2a')](_0xa80a('0x22'));this[_0xa80a('0x8')][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x30')]='connect';this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea]['holdtime']=_0x44c264['holdtime'];this['channels'][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x31')]=_0x44c264[_0xa80a('0x31')];this['channels'][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x32')]=_0x44c264[_0xa80a('0x32')];this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x33')]=_0x44c264['destchannelstate'];this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x34')]=_0x44c264['destchannelstatedesc'];_[_0xa80a('0x27')](this[_0xa80a('0x35')][_0x44c264[_0xa80a('0x36')]],_['pick'](_0x44c264,[_0xa80a('0x24'),_0xa80a('0x37')]));this['emit'](util['format'](_0xa80a('0x38'),_0x44c264[_0xa80a('0x39')]),_0xa80a('0x3a'),this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x44c264[_0xa80a('0x21')]]);ami[_0xa80a('0x1d')]('custom:agentconnect',this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea]);}else if(!this[_0xa80a('0x8')][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x3b')]&&!this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea]['agentcomplete']){this['channels'][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x3b')]=!![];this[_0xa80a('0x8')][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x3c')]=moment()[_0xa80a('0x2a')](_0xa80a('0x22'));this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x3d')]=_0xa80a('0x3e');this['channels'][_0x44c264['uniqueid']][_0x27ddea]['lastevent']=_0xa80a('0x3e');this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea][_0xa80a('0x3f')]=_0x44c264['destuniqueid'];this[_0xa80a('0x8')][_0x44c264['uniqueid']][_0x27ddea][_0xa80a('0x40')]=_0x44c264[_0xa80a('0x39')];ami[_0xa80a('0x1d')](_0xa80a('0x41'),this[_0xa80a('0x8')][_0x44c264[_0xa80a('0x20')]][_0x27ddea]);}}}}}}catch(_0x2f81ef){logger['error'](_0xa80a('0x42'),util[_0xa80a('0x2d')](_0x2f81ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa80a('0x43')]=function(_0x3b9930){try{if(this[_0xa80a('0x1e')](_0x3b9930)){if(this[_0xa80a('0x8')][_0x3b9930[_0xa80a('0x20')]]&&this[_0xa80a('0x8')][_0x3b9930[_0xa80a('0x20')]][_0x3b9930['destuniqueid']]){this[_0xa80a('0x8')][_0x3b9930[_0xa80a('0x20')]][_0x3b9930['destuniqueid']][_0xa80a('0x3b')]=!![];this['channels'][_0x3b9930[_0xa80a('0x20')]][_0x3b9930[_0xa80a('0x21')]][_0xa80a('0x3c')]=moment()[_0xa80a('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa80a('0x8')][_0x3b9930['uniqueid']][_0x3b9930[_0xa80a('0x21')]][_0xa80a('0x3d')]=_0xa80a('0x44');this[_0xa80a('0x8')][_0x3b9930['uniqueid']][_0x3b9930[_0xa80a('0x21')]][_0xa80a('0x30')]='rejected';ami[_0xa80a('0x1d')](_0xa80a('0x45'),this[_0xa80a('0x8')][_0x3b9930[_0xa80a('0x20')]][_0x3b9930[_0xa80a('0x21')]]);}}}catch(_0x4c59aa){logger[_0xa80a('0x2c')](_0xa80a('0x46'),util['inspect'](_0x4c59aa,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa80a('0x11')]=function(_0x4862e6){try{if(this[_0xa80a('0x1e')](_0x4862e6)){if(this['channels'][_0x4862e6[_0xa80a('0x20')]]){for(var _0x1b0955 in this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]]){if(this['channels'][_0x4862e6[_0xa80a('0x20')]]['hasOwnProperty'](_0x1b0955)&&!this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]][_0x1b0955]['agentringnoanswer']&&!this['channels'][_0x4862e6[_0xa80a('0x20')]][_0x1b0955][_0xa80a('0x12')]){this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]][_0x1b0955][_0xa80a('0x3b')]=!![];this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]][_0x1b0955][_0xa80a('0x3c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xa80a('0x8')][_0x4862e6['uniqueid']][_0x1b0955][_0xa80a('0x3d')]=_0xa80a('0x47');this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]][_0x1b0955][_0xa80a('0x30')]=_0xa80a('0x47');ami['emit']('custom:agentqueuecallerabandon',this[_0xa80a('0x8')][_0x4862e6[_0xa80a('0x20')]][_0x1b0955]);}}}}}catch(_0x4778ab){logger[_0xa80a('0x2c')](_0xa80a('0x48'),util['inspect'](_0x4778ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa80a('0x49')]=function(_0x48aedb){try{if(this['isNotNull'](_0x48aedb)){if(this['channels'][_0x48aedb['uniqueid']]){for(var _0xe10863 in this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]]){if(this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xa80a('0x2e')](_0xe10863)){if(this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863][_0xa80a('0x2f')]&&!this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863]['agentcomplete']){this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863][_0xa80a('0x12')]=!![];this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863][_0xa80a('0x4a')]=moment()[_0xa80a('0x2a')](_0xa80a('0x22'));this[_0xa80a('0x8')][_0x48aedb['uniqueid']][_0xe10863][_0xa80a('0x30')]=_0xa80a('0x4b');this[_0xa80a('0x8')][_0x48aedb['uniqueid']][_0xe10863]['talktime']=_0x48aedb[_0xa80a('0x4c')];this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863][_0xa80a('0x3d')]=_0x48aedb[_0xa80a('0x3d')]==_0xa80a('0x4d')?'agent':_0x48aedb['reason'];if(this[_0xa80a('0x9')][_0x48aedb[_0xa80a('0x24')]]&&this['voiceQueues'][_0x48aedb[_0xa80a('0x24')]][_0xa80a('0x4e')]){this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863][_0xa80a('0x4f')]=!![];this[_0xa80a('0x8')][_0x48aedb['uniqueid']][_0xe10863]['acwtime']=this[_0xa80a('0x9')][_0x48aedb[_0xa80a('0x24')]][_0xa80a('0x50')];}this[_0xa80a('0x35')][_0x48aedb[_0xa80a('0x36')]]=_['omit'](this[_0xa80a('0x35')][_0x48aedb[_0xa80a('0x36')]],[_0xa80a('0x24'),_0xa80a('0x37')]);this[_0xa80a('0x1d')](util[_0xa80a('0x2a')](_0xa80a('0x38'),_0x48aedb['membername']),'user:agentcomplete',this[_0xa80a('0x8')][_0x48aedb[_0xa80a('0x20')]][_0xe10863]);ami['emit'](_0xa80a('0x51'),this[_0xa80a('0x8')][_0x48aedb['uniqueid']][_0xe10863]);}}}}}}catch(_0x1c8ce1){logger[_0xa80a('0x2c')]('[syncAgentComplete][VoiceAgentReport]',util['inspect'](_0x1c8ce1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa80a('0x14')]=function(_0x4d262b){try{if(this[_0xa80a('0x1e')](_0x4d262b)){this[_0xa80a('0x52')](_0x4d262b[_0xa80a('0x20')],_[_0xa80a('0x53')](_0x4d262b[_0xa80a('0x54')])[0x0],_0x4d262b['value']);if(this[_0xa80a('0x8')][_0x4d262b[_0xa80a('0x20')]]){for(var _0xfba42 in this[_0xa80a('0x8')][_0x4d262b[_0xa80a('0x20')]]){if(this[_0xa80a('0x8')][_0x4d262b['uniqueid']][_0xa80a('0x2e')](_0xfba42)){if(_[_0xa80a('0x1f')](this[_0xa80a('0x8')][_0x4d262b[_0xa80a('0x20')]][_0xfba42][_0xa80a('0xa')])){this['channels'][_0x4d262b[_0xa80a('0x20')]][_0xfba42]['variables']={};}this[_0xa80a('0x8')][_0x4d262b['uniqueid']][_0xfba42][_0xa80a('0xa')]=this[_0xa80a('0xa')][_0x4d262b[_0xa80a('0x20')]];}}}}}catch(_0x86779b){logger[_0xa80a('0x2c')](_0xa80a('0x55'),util[_0xa80a('0x2d')](_0x86779b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0x52')]=function(_0x2d399a,_0x32f025,_0x413b41){var _0x12714b=[_0xa80a('0x56'),_0xa80a('0x57'),_0xa80a('0x58'),_0xa80a('0x59'),_0xa80a('0x5a'),'rtpaudioqoslossbridged',_0xa80a('0x5b'),_0xa80a('0x5c'),'sipcallid','sipuri',_0xa80a('0x5d'),_0xa80a('0x5e'),_0xa80a('0x5f'),_0xa80a('0x60'),_0xa80a('0x61'),'memberlastcall',_0xa80a('0x39'),'memberpenalty',_0xa80a('0x62')];if(!_[_0xa80a('0x63')](_0x32f025)&&!_[_0xa80a('0x64')](_0x12714b,_0x32f025)){if(_[_0xa80a('0x1f')](this[_0xa80a('0xa')][_0x2d399a])){this['variables'][_0x2d399a]={};}this[_0xa80a('0xa')][_0x2d399a][_0x32f025]=_0x413b41;}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0x65')]=function(_0x2a00f8){try{if(this['isNotNull'](_0x2a00f8)){if(this[_0xa80a('0x8')][_0x2a00f8[_0xa80a('0x20')]]){for(var _0x225066 in this[_0xa80a('0x8')][_0x2a00f8[_0xa80a('0x20')]]){if(this['channels'][_0x2a00f8[_0xa80a('0x20')]][_0xa80a('0x2e')](_0x225066)){if(this['channels'][_0x2a00f8[_0xa80a('0x20')]][_0x225066]['reason']==_0xa80a('0x4d')&&this['channels'][_0x2a00f8['uniqueid']][_0x225066][_0xa80a('0x12')]){this[_0xa80a('0x8')][_0x2a00f8[_0xa80a('0x20')]][_0x225066]['agentcompleteAt']=moment()[_0xa80a('0x2a')](_0xa80a('0x22'));}}}ami['emit']('custom:voiceAgentReport',_['values'](this[_0xa80a('0x8')][_0x2a00f8[_0xa80a('0x20')]]));delete this[_0xa80a('0x8')][_0x2a00f8['uniqueid']];}if(this[_0xa80a('0xa')][_0x2a00f8['uniqueid']]){delete this[_0xa80a('0xa')][_0x2a00f8[_0xa80a('0x20')]];}}}catch(_0x36cdcc){logger[_0xa80a('0x2c')](_0xa80a('0x66'),util[_0xa80a('0x2d')](_0x36cdcc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa80a('0x19')]=function(_0x1caa9d){try{if(this[_0xa80a('0x1e')](_0x1caa9d)){if(this[_0xa80a('0x8')][_0x1caa9d['transfereeuniqueid']]){for(var _0x2de6cd in this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]]){if(this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]][_0xa80a('0x2e')](_0x2de6cd)){if(_0x1caa9d[_0xa80a('0x68')]===_0x2de6cd){var _0x3f0301=moment();this['channels'][_0x1caa9d[_0xa80a('0x67')]][_0x2de6cd][_0xa80a('0x12')]=!![];this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]][_0x2de6cd][_0xa80a('0x4a')]=moment()[_0xa80a('0x2a')](_0xa80a('0x22'));this[_0xa80a('0x8')][_0x1caa9d['transfereeuniqueid']][_0x2de6cd]['reason']=_0xa80a('0x4d');this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]][_0x2de6cd][_0xa80a('0x30')]='complete';this['channels'][_0x1caa9d['transfereeuniqueid']][_0x2de6cd][_0xa80a('0x4c')]=_0x3f0301[_0xa80a('0x69')](this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]][_0x2de6cd][_0xa80a('0x2f')],_0xa80a('0x6a'));}}}}if(this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x6b')]]){var _0x5f39d0=this['channels'][_0x1caa9d[_0xa80a('0x6b')]];this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x6b')]]=this[_0xa80a('0x8')][_0x1caa9d['transfereeuniqueid']];this[_0xa80a('0x8')][_0x1caa9d[_0xa80a('0x67')]]=_0x5f39d0;}}}catch(_0x52306c){logger[_0xa80a('0x2c')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0xa80a('0x2d')](_0x52306c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0x1b')]=function(_0x5a3253){try{if(this[_0xa80a('0x1e')](_0x5a3253)){if(this[_0xa80a('0x8')][_0x5a3253['transfereeuniqueid']]){for(var _0xb8e516 in this[_0xa80a('0x8')][_0x5a3253[_0xa80a('0x67')]]){if(this[_0xa80a('0x8')][_0x5a3253[_0xa80a('0x67')]][_0xa80a('0x2e')](_0xb8e516)){if(_0x5a3253[_0xa80a('0x6c')]===_0xb8e516){var _0x904c40=moment();this[_0xa80a('0x8')][_0x5a3253['transfereeuniqueid']][_0xb8e516][_0xa80a('0x12')]=!![];this[_0xa80a('0x8')][_0x5a3253['transfereeuniqueid']][_0xb8e516][_0xa80a('0x4a')]=_0x904c40;this[_0xa80a('0x8')][_0x5a3253['transfereeuniqueid']][_0xb8e516][_0xa80a('0x3d')]=_0xa80a('0x4d');this[_0xa80a('0x8')][_0x5a3253['transfereeuniqueid']][_0xb8e516][_0xa80a('0x30')]=_0xa80a('0x4b');this[_0xa80a('0x8')][_0x5a3253[_0xa80a('0x67')]][_0xb8e516][_0xa80a('0x4c')]=_0x904c40[_0xa80a('0x69')](this[_0xa80a('0x8')][_0x5a3253[_0xa80a('0x67')]][_0xb8e516][_0xa80a('0x2f')],_0xa80a('0x6a'));}}}}}}catch(_0x1f189b){logger[_0xa80a('0x2c')](_0xa80a('0x6d'),util['inspect'](_0x1f189b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0x6e')]=function(_0x21b6ce){var _0x40fa2a='';try{if(this[_0xa80a('0x1e')](_0x21b6ce)){if(_0x21b6ce[_0xa80a('0x6f')]){_0x40fa2a=_0x21b6ce[_0xa80a('0x6f')][_0xa80a('0x70')](0x0,_0x21b6ce[_0xa80a('0x6f')][_0xa80a('0x71')]('-'));if(this[_0xa80a('0x35')][_0x40fa2a]){this[_0xa80a('0x35')][_0x40fa2a][_0xa80a('0x72')]=!![];}}}}catch(_0x5aaeac){logger[_0xa80a('0x2c')](_0xa80a('0x73'),util[_0xa80a('0x2d')](_0x5aaeac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa80a('0x1c')][_0xa80a('0x18')]=function(_0x48d9aa){var _0x46d337='';try{if(this[_0xa80a('0x1e')](_0x48d9aa)){if(_0x48d9aa['channel']){_0x46d337=_0x48d9aa[_0xa80a('0x6f')]['substring'](0x0,_0x48d9aa[_0xa80a('0x6f')][_0xa80a('0x71')]('-'));if(this[_0xa80a('0x35')][_0x46d337]){this[_0xa80a('0x35')][_0x46d337][_0xa80a('0x72')]=![];}}}}catch(_0x48a361){logger[_0xa80a('0x2c')]('[syncMusicOnHoldStop][VoiceAgentReport]',util['inspect'](_0x48a361,{'showHidden':![],'depth':null}));}};module[_0xa80a('0x74')]=VoiceAgentReport; \ No newline at end of file +var _0xeab0=['variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','complete','[syncBlindTransfer][VoiceAgentReport]','substring','channel','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','syncAgentCalled','isNotNull','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','agent','agentacw','acwtime','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0xeab0,0x118));var _0x0eab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeab0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x0eab('0x0'));var moment=require(_0x0eab('0x1'));var util=require(_0x0eab('0x2'));var Redis=require(_0x0eab('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0eab('0x4'));var ami=require(_0x0eab('0x5'));config[_0x0eab('0x6')]=_[_0x0eab('0x7')](config['redis'],{'host':_0x0eab('0x8'),'port':0x18eb});var io=require(_0x0eab('0x9'))(new Redis(config[_0x0eab('0x6')]));function VoiceAgentReport(_0x18e916){this[_0x0eab('0xa')]={};this[_0x0eab('0xb')]=_0x18e916[_0x0eab('0xb')];this[_0x0eab('0xc')]=_0x18e916[_0x0eab('0xc')];this[_0x0eab('0xd')]={};ami['on'](_0x0eab('0xe'),this['syncAgentCalled'][_0x0eab('0xf')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x0eab('0xf')](this));ami['on'](_0x0eab('0x10'),this[_0x0eab('0x11')][_0x0eab('0xf')](this));ami['on']('queuecallerabandon',this[_0x0eab('0x12')][_0x0eab('0xf')](this));ami['on'](_0x0eab('0x13'),this[_0x0eab('0x14')][_0x0eab('0xf')](this));ami['on']('varset',this[_0x0eab('0x15')]['bind'](this));ami['on'](_0x0eab('0x16'),this['syncHangup'][_0x0eab('0xf')](this));ami['on'](_0x0eab('0x17'),this[_0x0eab('0x18')][_0x0eab('0xf')](this));ami['on'](_0x0eab('0x19'),this[_0x0eab('0x1a')]['bind'](this));ami['on'](_0x0eab('0x1b'),this['syncAttendedTransfer'][_0x0eab('0xf')](this));ami['on'](_0x0eab('0x1c'),this[_0x0eab('0x1d')]['bind'](this));}VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x1f')]=function(_0xedfda,_0x139768,_0x13be55){io['to'](_0xedfda)['emit'](_0x139768,_0x13be55);};VoiceAgentReport[_0x0eab('0x1e')]['isNotNull']=function(_0x57854e){return _0x57854e!==null&&!_[_0x0eab('0x20')](_0x57854e);};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x21')]=function(_0x1a3aa6){try{if(this[_0x0eab('0x22')](_0x1a3aa6)){if(_['isUndefined'](this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]])){this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]]={};}if(_[_0x0eab('0x20')](this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]][_0x1a3aa6[_0x0eab('0x24')]])){this['channels'][_0x1a3aa6[_0x0eab('0x23')]][_0x1a3aa6[_0x0eab('0x24')]]={'agentcalledAt':moment()[_0x0eab('0x25')](_0x0eab('0x26')),'lastevent':'called','variables':this[_0x0eab('0xd')][_0x1a3aa6[_0x0eab('0x23')]],'type':this[_0x0eab('0xb')][_0x1a3aa6['queue']]?this['voiceQueues'][_0x1a3aa6[_0x0eab('0x27')]][_0x0eab('0x28')]||_0x0eab('0x29'):_0x0eab('0x29')};}_['merge'](this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]][_0x1a3aa6[_0x0eab('0x24')]],_[_0x0eab('0x2a')](_0x1a3aa6,[_0x0eab('0x2b'),_0x0eab('0x2c')]));ami['emit'](_0x0eab('0x2d'),this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]][_0x1a3aa6['destuniqueid']]);this['emit'](util['format'](_0x0eab('0x2e'),_0x1a3aa6[_0x0eab('0x2f')]),_0x0eab('0x30'),this[_0x0eab('0xa')][_0x1a3aa6[_0x0eab('0x23')]][_0x1a3aa6['destuniqueid']]);}}catch(_0xe6de84){logger[_0x0eab('0x31')](_0x0eab('0x32'),util[_0x0eab('0x33')](_0xe6de84,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')]['syncAgentConnect']=function(_0x541704){try{if(this['isNotNull'](_0x541704)){if(this[_0x0eab('0xa')][_0x541704['uniqueid']]){for(var _0x3de6b2 in this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]]){if(this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x0eab('0x34')](_0x3de6b2)){if(_0x541704[_0x0eab('0x24')]===_0x3de6b2){this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x35')]=moment()[_0x0eab('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2]['lastevent']=_0x0eab('0x36');this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x37')]=_0x541704[_0x0eab('0x37')];this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x38')]=_0x541704[_0x0eab('0x38')];this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x39')]=_0x541704[_0x0eab('0x39')];this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x3a')]=_0x541704[_0x0eab('0x3a')];this['channels'][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x3b')]=_0x541704[_0x0eab('0x3b')];_['merge'](this[_0x0eab('0xc')][_0x541704[_0x0eab('0x3c')]],_[_0x0eab('0x3d')](_0x541704,[_0x0eab('0x27'),_0x0eab('0x3e')]));this[_0x0eab('0x1f')](util[_0x0eab('0x25')](_0x0eab('0x2e'),_0x541704[_0x0eab('0x2f')]),_0x0eab('0x3f'),this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x541704[_0x0eab('0x24')]]);ami['emit'](_0x0eab('0x40'),this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2]);}else if(!this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x10')]&&!this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2]['agentcomplete']){this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x10')]=!![];this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x41')]=moment()[_0x0eab('0x25')](_0x0eab('0x26'));this['channels'][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x42')]=_0x0eab('0x43');this[_0x0eab('0xa')][_0x541704['uniqueid']][_0x3de6b2][_0x0eab('0x44')]=_0x0eab('0x43');this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2][_0x0eab('0x45')]=_0x541704[_0x0eab('0x24')];this['channels'][_0x541704['uniqueid']][_0x3de6b2][_0x0eab('0x46')]=_0x541704['membername'];ami['emit'](_0x0eab('0x47'),this[_0x0eab('0xa')][_0x541704[_0x0eab('0x23')]][_0x3de6b2]);}}}}}}catch(_0x5eef7d){logger[_0x0eab('0x31')]('[syncAgentConnect][VoiceAgentReport]',util[_0x0eab('0x33')](_0x5eef7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')]['syncAgentRingNoAnswer']=function(_0x26f1da){try{if(this[_0x0eab('0x22')](_0x26f1da)){if(this['channels'][_0x26f1da[_0x0eab('0x23')]]&&this[_0x0eab('0xa')][_0x26f1da[_0x0eab('0x23')]][_0x26f1da['destuniqueid']]){this['channels'][_0x26f1da['uniqueid']][_0x26f1da[_0x0eab('0x24')]]['agentringnoanswer']=!![];this[_0x0eab('0xa')][_0x26f1da[_0x0eab('0x23')]][_0x26f1da[_0x0eab('0x24')]][_0x0eab('0x41')]=moment()[_0x0eab('0x25')](_0x0eab('0x26'));this['channels'][_0x26f1da[_0x0eab('0x23')]][_0x26f1da[_0x0eab('0x24')]]['reason']='rejected';this[_0x0eab('0xa')][_0x26f1da[_0x0eab('0x23')]][_0x26f1da[_0x0eab('0x24')]]['lastevent']='rejected';ami['emit']('custom:agentringnoanswer',this[_0x0eab('0xa')][_0x26f1da[_0x0eab('0x23')]][_0x26f1da[_0x0eab('0x24')]]);}}}catch(_0x588b33){logger[_0x0eab('0x31')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x0eab('0x33')](_0x588b33,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x12')]=function(_0x4ff77b){try{if(this[_0x0eab('0x22')](_0x4ff77b)){if(this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]]){for(var _0x215224 in this['channels'][_0x4ff77b[_0x0eab('0x23')]]){if(this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]][_0x0eab('0x34')](_0x215224)&&!this['channels'][_0x4ff77b[_0x0eab('0x23')]][_0x215224][_0x0eab('0x10')]&&!this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]][_0x215224][_0x0eab('0x13')]){this['channels'][_0x4ff77b['uniqueid']][_0x215224][_0x0eab('0x10')]=!![];this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]][_0x215224][_0x0eab('0x41')]=moment()['format'](_0x0eab('0x26'));this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]][_0x215224][_0x0eab('0x42')]=_0x0eab('0x48');this[_0x0eab('0xa')][_0x4ff77b['uniqueid']][_0x215224][_0x0eab('0x44')]=_0x0eab('0x48');ami[_0x0eab('0x1f')](_0x0eab('0x49'),this[_0x0eab('0xa')][_0x4ff77b[_0x0eab('0x23')]][_0x215224]);}}}}}catch(_0xc21fe1){logger[_0x0eab('0x31')](_0x0eab('0x4a'),util['inspect'](_0xc21fe1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x14')]=function(_0x3d8840){try{if(this[_0x0eab('0x22')](_0x3d8840)){if(this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]]){for(var _0x4eda10 in this[_0x0eab('0xa')][_0x3d8840['uniqueid']]){if(this['channels'][_0x3d8840['uniqueid']][_0x0eab('0x34')](_0x4eda10)){if(this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]][_0x4eda10][_0x0eab('0x35')]&&!this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]][_0x4eda10][_0x0eab('0x13')]){this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]][_0x4eda10][_0x0eab('0x13')]=!![];this['channels'][_0x3d8840['uniqueid']][_0x4eda10][_0x0eab('0x4b')]=moment()[_0x0eab('0x25')](_0x0eab('0x26'));this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]][_0x4eda10]['lastevent']='complete';this[_0x0eab('0xa')][_0x3d8840['uniqueid']][_0x4eda10][_0x0eab('0x4c')]=_0x3d8840[_0x0eab('0x4c')];this[_0x0eab('0xa')][_0x3d8840['uniqueid']][_0x4eda10][_0x0eab('0x42')]=_0x3d8840[_0x0eab('0x42')]==_0x0eab('0x4d')?_0x0eab('0x4e'):_0x3d8840[_0x0eab('0x42')];if(this[_0x0eab('0xb')][_0x3d8840['queue']]&&this[_0x0eab('0xb')][_0x3d8840[_0x0eab('0x27')]]['acw']){this[_0x0eab('0xa')][_0x3d8840['uniqueid']][_0x4eda10][_0x0eab('0x4f')]=!![];this['channels'][_0x3d8840[_0x0eab('0x23')]][_0x4eda10][_0x0eab('0x50')]=this[_0x0eab('0xb')][_0x3d8840[_0x0eab('0x27')]]['acwTimeout'];}this[_0x0eab('0xc')][_0x3d8840['interface']]=_[_0x0eab('0x2a')](this[_0x0eab('0xc')][_0x3d8840['interface']],['queue',_0x0eab('0x3e')]);this['emit'](util[_0x0eab('0x25')](_0x0eab('0x2e'),_0x3d8840[_0x0eab('0x2f')]),_0x0eab('0x51'),this[_0x0eab('0xa')][_0x3d8840[_0x0eab('0x23')]][_0x4eda10]);ami[_0x0eab('0x1f')](_0x0eab('0x52'),this['channels'][_0x3d8840[_0x0eab('0x23')]][_0x4eda10]);}}}}}}catch(_0x4f143e){logger[_0x0eab('0x31')](_0x0eab('0x53'),util[_0x0eab('0x33')](_0x4f143e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eab('0x15')]=function(_0x1d583d){try{if(this['isNotNull'](_0x1d583d)){this[_0x0eab('0x54')](_0x1d583d[_0x0eab('0x23')],_[_0x0eab('0x55')](_0x1d583d[_0x0eab('0x56')])[0x0],_0x1d583d[_0x0eab('0x57')]);if(this[_0x0eab('0xa')][_0x1d583d[_0x0eab('0x23')]]){for(var _0x93c460 in this[_0x0eab('0xa')][_0x1d583d[_0x0eab('0x23')]]){if(this[_0x0eab('0xa')][_0x1d583d[_0x0eab('0x23')]][_0x0eab('0x34')](_0x93c460)){if(_[_0x0eab('0x20')](this['channels'][_0x1d583d[_0x0eab('0x23')]][_0x93c460]['variables'])){this['channels'][_0x1d583d['uniqueid']][_0x93c460][_0x0eab('0xd')]={};}this['channels'][_0x1d583d[_0x0eab('0x23')]][_0x93c460][_0x0eab('0xd')]=this[_0x0eab('0xd')][_0x1d583d[_0x0eab('0x23')]];}}}}}catch(_0x4d3dcc){logger[_0x0eab('0x31')](_0x0eab('0x58'),util[_0x0eab('0x33')](_0x4d3dcc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x54')]=function(_0x14ea10,_0x4ecc3d,_0x286961){var _0x3b6580=['rtpaudioqos',_0x0eab('0x59'),_0x0eab('0x5a'),_0x0eab('0x5b'),_0x0eab('0x5c'),_0x0eab('0x5d'),_0x0eab('0x5e'),_0x0eab('0x5f'),'sipcallid',_0x0eab('0x60'),_0x0eab('0x61'),_0x0eab('0x62'),'membercalls',_0x0eab('0x63'),_0x0eab('0x64'),_0x0eab('0x65'),_0x0eab('0x2f'),_0x0eab('0x66'),_0x0eab('0x67')];if(!_[_0x0eab('0x68')](_0x4ecc3d)&&!_[_0x0eab('0x69')](_0x3b6580,_0x4ecc3d)){if(_[_0x0eab('0x20')](this[_0x0eab('0xd')][_0x14ea10])){this[_0x0eab('0xd')][_0x14ea10]={};}this[_0x0eab('0xd')][_0x14ea10][_0x4ecc3d]=_0x286961;}};VoiceAgentReport[_0x0eab('0x1e')]['syncHangup']=function(_0x4624a8){try{if(this['isNotNull'](_0x4624a8)){if(this[_0x0eab('0xa')][_0x4624a8[_0x0eab('0x23')]]){for(var _0x41d1ca in this[_0x0eab('0xa')][_0x4624a8[_0x0eab('0x23')]]){if(this['channels'][_0x4624a8[_0x0eab('0x23')]][_0x0eab('0x34')](_0x41d1ca)){if(this['channels'][_0x4624a8['uniqueid']][_0x41d1ca]['reason']==_0x0eab('0x4d')&&this[_0x0eab('0xa')][_0x4624a8[_0x0eab('0x23')]][_0x41d1ca][_0x0eab('0x13')]){this[_0x0eab('0xa')][_0x4624a8[_0x0eab('0x23')]][_0x41d1ca][_0x0eab('0x4b')]=moment()['format'](_0x0eab('0x26'));}}}ami[_0x0eab('0x1f')](_0x0eab('0x6a'),_[_0x0eab('0x6b')](this['channels'][_0x4624a8[_0x0eab('0x23')]]));delete this[_0x0eab('0xa')][_0x4624a8['uniqueid']];}if(this[_0x0eab('0xd')][_0x4624a8[_0x0eab('0x23')]]){delete this[_0x0eab('0xd')][_0x4624a8['uniqueid']];}}}catch(_0x4e8487){logger[_0x0eab('0x31')](_0x0eab('0x6c'),util['inspect'](_0x4e8487,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x6d')]=function(_0x79b604){try{if(this[_0x0eab('0x22')](_0x79b604)){if(this[_0x0eab('0xa')][_0x79b604['transfereeuniqueid']]){for(var _0x17eeaa in this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x6e')]]){if(this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x6e')]][_0x0eab('0x34')](_0x17eeaa)){if(_0x79b604['origtransfereruniqueid']===_0x17eeaa){var _0x5025bb=moment();this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x6e')]][_0x17eeaa][_0x0eab('0x13')]=!![];this[_0x0eab('0xa')][_0x79b604['transfereeuniqueid']][_0x17eeaa]['agentcompleteAt']=moment()[_0x0eab('0x25')](_0x0eab('0x26'));this['channels'][_0x79b604[_0x0eab('0x6e')]][_0x17eeaa][_0x0eab('0x42')]=_0x0eab('0x4d');this[_0x0eab('0xa')][_0x79b604['transfereeuniqueid']][_0x17eeaa][_0x0eab('0x44')]='complete';this[_0x0eab('0xa')][_0x79b604['transfereeuniqueid']][_0x17eeaa][_0x0eab('0x4c')]=_0x5025bb['diff'](this['channels'][_0x79b604[_0x0eab('0x6e')]][_0x17eeaa][_0x0eab('0x35')],_0x0eab('0x6f'));}}}}if(this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x70')]]){var _0x5658bb=this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x70')]];this['channels'][_0x79b604['secondtransfereruniqueid']]=this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x6e')]];this[_0x0eab('0xa')][_0x79b604[_0x0eab('0x6e')]]=_0x5658bb;}}}catch(_0x50806b){logger[_0x0eab('0x31')](_0x0eab('0x71'),util[_0x0eab('0x33')](_0x50806b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0eab('0x1d')]=function(_0x119dd3){try{if(this[_0x0eab('0x22')](_0x119dd3)){if(this[_0x0eab('0xa')][_0x119dd3['transfereeuniqueid']]){for(var _0x471fc2 in this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]]){if(this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x0eab('0x34')](_0x471fc2)){if(_0x119dd3[_0x0eab('0x72')]===_0x471fc2){var _0x1eebbe=moment();this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2][_0x0eab('0x13')]=!![];this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2][_0x0eab('0x4b')]=_0x1eebbe;this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2][_0x0eab('0x42')]=_0x0eab('0x4d');this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2][_0x0eab('0x44')]=_0x0eab('0x73');this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2]['talktime']=_0x1eebbe['diff'](this[_0x0eab('0xa')][_0x119dd3[_0x0eab('0x6e')]][_0x471fc2]['agentconnectAt'],_0x0eab('0x6f'));}}}}}}catch(_0x338ddb){logger[_0x0eab('0x31')](_0x0eab('0x74'),util[_0x0eab('0x33')](_0x338ddb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0eab('0x1e')][_0x0eab('0x18')]=function(_0x433205){var _0x5ec798='';try{if(this[_0x0eab('0x22')](_0x433205)){if(_0x433205['channel']){_0x5ec798=_0x433205['channel'][_0x0eab('0x75')](0x0,_0x433205[_0x0eab('0x76')]['lastIndexOf']('-'));if(this['agents'][_0x5ec798]){this[_0x0eab('0xc')][_0x5ec798]['onhold']=!![];}}}}catch(_0x2e0020){logger['error']('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x0eab('0x33')](_0x2e0020,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x150bbe){var _0xe78dea='';try{if(this[_0x0eab('0x22')](_0x150bbe)){if(_0x150bbe['channel']){_0xe78dea=_0x150bbe[_0x0eab('0x76')]['substring'](0x0,_0x150bbe[_0x0eab('0x76')][_0x0eab('0x77')]('-'));if(this[_0x0eab('0xc')][_0xe78dea]){this[_0x0eab('0xc')][_0xe78dea]['onhold']=![];}}}}catch(_0xd3bafe){logger[_0x0eab('0x31')](_0x0eab('0x78'),util[_0x0eab('0x33')](_0xd3bafe,{'showHidden':![],'depth':null}));}};module[_0x0eab('0x79')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 972858c..f07cc9d 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 _0xa519=['hangup','syncHangup','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','merge','pick','error','[syncNewCallerId][VoiceCallReport]','linkedid','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','keys','context','from-sip','split','exten','user:%s','channel','accountcode','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','duration','subtract','seconds','disposition','includes','lastapplication','lastdata','set','startsWith','match','[syncNewExten][VoiceCallReport]','answered','answertime','starttime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmcs-queue','sipcalluniqueid','parse','sipcallid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','destconnectedlinenum','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','mohtime','milliseconds','mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','exports','moment','util','path','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','onhold','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','newexten','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet'];(function(_0x256132,_0x2e74f5){var _0xa430c2=function(_0x3118df){while(--_0x3118df){_0x256132['push'](_0x256132['shift']());}};_0xa430c2(++_0x2e74f5);}(_0xa519,0x75));var _0x9a51=function(_0x131d35,_0x3dee98){_0x131d35=_0x131d35-0x0;var _0x557e62=_0xa519[_0x131d35];return _0x557e62;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0x9a51('0x0'));var util=require(_0x9a51('0x1'));var path=require(_0x9a51('0x2'));var Redis=require('ioredis');var config=require(_0x9a51('0x3'));var logger=require(_0x9a51('0x4'))(_0x9a51('0x5'));var ami=require('../ami');var Channel=require(_0x9a51('0x6'));var statusDesc=[_0x9a51('0x7'),_0x9a51('0x8'),_0x9a51('0x9'),_0x9a51('0xa'),_0x9a51('0xb'),_0x9a51('0xc'),'ringing','ringinuse',_0x9a51('0xd')];var applications=['set',_0x9a51('0xe'),'agi',_0x9a51('0xf'),_0x9a51('0x10'),_0x9a51('0x11')];var dispositions=[_0x9a51('0x12'),'FAILED',_0x9a51('0x13'),_0x9a51('0x12'),_0x9a51('0x12'),_0x9a51('0x12'),_0x9a51('0x14'),_0x9a51('0x15'),_0x9a51('0x13'),_0x9a51('0x13'),'FAILED'];var actions={};config[_0x9a51('0x16')]=_[_0x9a51('0x17')](config[_0x9a51('0x16')],{'host':_0x9a51('0x18'),'port':0x18eb});var io=require(_0x9a51('0x19'))(new Redis(config['redis']));function VoiceCallReport(_0x5b4682){this[_0x9a51('0x1a')]=_0x5b4682[_0x9a51('0x1a')];this['agents']=_0x5b4682[_0x9a51('0x1b')];ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on'](_0x9a51('0x1c'),this[_0x9a51('0x1d')][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x1f'),this[_0x9a51('0x20')][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x21'),this[_0x9a51('0x22')][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x23'),this[_0x9a51('0x24')]['bind'](this));ami['on'](_0x9a51('0x25'),this[_0x9a51('0x26')][_0x9a51('0x1e')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x27'),this[_0x9a51('0x28')]['bind'](this));ami['on']('blindtransfer',this[_0x9a51('0x29')][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x2a'),this['syncMusicOnHoldStart'][_0x9a51('0x1e')](this));ami['on'](_0x9a51('0x2b'),this[_0x9a51('0x2c')]['bind'](this));return BPromise['resolve']()['then'](ami[_0x9a51('0x2d')]())[_0x9a51('0x2e')](function(_0x15d85e){console[_0x9a51('0x2f')](_0x15d85e);});}VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x31')]=function(_0x14fa92){return _0x14fa92!==null&&!_[_0x9a51('0x32')](_0x14fa92);};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x33')]=function(_0x2f9d46,_0x357e04,_0x20ed16){io['to'](_0x2f9d46)['emit'](_0x357e04,_0x20ed16);};VoiceCallReport['prototype'][_0x9a51('0x34')]=function(_0x4ce2b9){try{if(this[_0x9a51('0x31')](_0x4ce2b9)){if(_0x4ce2b9[_0x9a51('0x35')]===_0x4ce2b9['linkedid']){if(!_[_0x9a51('0x32')](this[_0x9a51('0x1a')][_0x4ce2b9[_0x9a51('0x35')]])){_[_0x9a51('0x36')](this[_0x9a51('0x1a')][_0x4ce2b9['uniqueid']],_[_0x9a51('0x37')](_0x4ce2b9,_['keys'](this[_0x9a51('0x1a')][_0x4ce2b9[_0x9a51('0x35')]])));}}}}catch(_0x4d963b){logger[_0x9a51('0x38')](_0x9a51('0x39'),util['inspect'](_0x4d963b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x20')]=function(_0x223da2){try{if(this[_0x9a51('0x31')](_0x223da2)){if(_0x223da2['uniqueid']===_0x223da2[_0x9a51('0x3a')]&&_0x223da2['channel']!=_0x9a51('0x3b')){if(_[_0x9a51('0x32')](this['channels'][_0x223da2['uniqueid']])){this[_0x9a51('0x1a')][_0x223da2[_0x9a51('0x35')]]=new Channel();this['channels'][_0x223da2[_0x9a51('0x35')]]['starttime']=moment()[_0x9a51('0x3c')](_0x9a51('0x3d'));this[_0x9a51('0x1a')][_0x223da2[_0x9a51('0x35')]]['disposition']=dispositions[_[_0x9a51('0x3e')](_0x223da2[_0x9a51('0x3f')])];_[_0x9a51('0x36')](this[_0x9a51('0x1a')][_0x223da2['uniqueid']],_[_0x9a51('0x37')](_0x223da2,_[_0x9a51('0x40')](this['channels'][_0x223da2[_0x9a51('0x35')]])));if(_0x223da2[_0x9a51('0x41')]===_0x9a51('0x42')){if(this[_0x9a51('0x1b')][_0x223da2['channel'][_0x9a51('0x43')]('-')[0x0]]){this['agents'][_0x223da2['channel'][_0x9a51('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x223da2[_0x9a51('0x44')];this[_0x9a51('0x33')](util[_0x9a51('0x3c')](_0x9a51('0x45'),this[_0x9a51('0x1b')][_0x223da2[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x9a51('0x1b')][_0x223da2[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]][_0x9a51('0x47')],'destconnectedlinenum':_0x223da2[_0x9a51('0x44')]});}}}}}}catch(_0x1b1a61){logger[_0x9a51('0x38')](_0x9a51('0x48'),util[_0x9a51('0x49')](_0x1b1a61,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x1d')]=function(_0x10bc84){try{if(this['isNotNull'](_0x10bc84)){if(_0x10bc84[_0x9a51('0x35')]===_0x10bc84[_0x9a51('0x3a')]&&_0x10bc84[_0x9a51('0x44')]!='h'&&_0x10bc84[_0x9a51('0x46')]!=_0x9a51('0x3b')){_0x10bc84[_0x9a51('0x4a')]=_0x10bc84[_0x9a51('0x4a')][_0x9a51('0x4b')]();_0x10bc84[_0x9a51('0x4c')]=(_0x10bc84['appdata']||_0x10bc84[_0x9a51('0x4c')])[_0x9a51('0x4b')]();if(_[_0x9a51('0x32')](this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]])){this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]]=new Channel();this['channels'][_0x10bc84[_0x9a51('0x35')]]['starttime']=_0x10bc84[_0x9a51('0x4d')]?moment()[_0x9a51('0x4e')](moment[_0x9a51('0x4d')](_0x10bc84[_0x9a51('0x4d')])[_0x9a51('0x4f')](),'seconds')[_0x9a51('0x3c')](_0x9a51('0x3d')):moment()['format'](_0x9a51('0x3d'));this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]][_0x9a51('0x50')]='NO\x20ANSWER';}_[_0x9a51('0x36')](this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]],_[_0x9a51('0x37')](_0x10bc84,_['keys'](this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]])));if(_[_0x9a51('0x51')](applications,_0x10bc84[_0x9a51('0x4a')])){this['channels'][_0x10bc84[_0x9a51('0x35')]][_0x9a51('0x52')]=_0x10bc84[_0x9a51('0x4a')];this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]][_0x9a51('0x53')]=_0x10bc84[_0x9a51('0x4c')];if(_0x10bc84[_0x9a51('0x4a')]===_0x9a51('0x54')&&_[_0x9a51('0x55')](_0x10bc84[_0x9a51('0x4c')],'cdr(')){var _0x47f2fd=_0x10bc84[_0x9a51('0x4c')][_0x9a51('0x43')]('=');var _0x4c14db=_0x47f2fd[0x0][_0x9a51('0x56')](/cdr\((.*)\)/);if(_0x4c14db){this[_0x9a51('0x1a')][_0x10bc84[_0x9a51('0x35')]][_0x4c14db[0x1]]=_0x47f2fd[0x1];}}else if(_0x10bc84[_0x9a51('0x4a')]==='queue'){this['channels'][_0x10bc84[_0x9a51('0x35')]]['queue']=_0x10bc84[_0x9a51('0x4c')][_0x9a51('0x43')](',')[0x0];}}}}}catch(_0x441f91){logger[_0x9a51('0x38')](_0x9a51('0x57'),util[_0x9a51('0x49')](_0x441f91,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x22')]=function(_0x425961){try{if(this['isNotNull'](_0x425961)){if(_0x425961[_0x9a51('0x35')]!==_0x425961[_0x9a51('0x3a')]){if(this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]]){if(_0x425961[_0x9a51('0x3f')]==='6'){if(!this['channels'][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x58')]){var _0xe3c945=moment();this[_0x9a51('0x1a')][_0x425961['linkedid']]['answered']=!![];this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x59')]=_0xe3c945['format'](_0x9a51('0x3d'));if(this['channels'][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x5a')]){this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x5b')]=_0xe3c945[_0x9a51('0x5c')](this['channels'][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x5a')],_0x9a51('0x4f'));}}this['channels'][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x3a')]=_0x425961[_0x9a51('0x35')];if(_0x425961['calleridnum']!==_0x9a51('0x5d')){this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x5e')]=_0x425961[_0x9a51('0x5f')];}this[_0x9a51('0x1a')][_0x425961['linkedid']][_0x9a51('0x60')]=_0x425961[_0x9a51('0x61')];this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x62')]=_0x425961['channel'];this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]]['disposition']=dispositions[_[_0x9a51('0x3e')](_0x425961['channelstate'])];if(this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]){this[_0x9a51('0x1a')][_0x425961['linkedid']]['UserId']=this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]['id'];this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x3a')]][_0x9a51('0x63')]=this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]['name'];}}}}else{if(this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x35')]]){if(_0x425961[_0x9a51('0x3f')]==='6'){if(this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]){this[_0x9a51('0x1a')][_0x425961[_0x9a51('0x35')]]['UserId']=this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')]['split']('-')[0x0]]['id'];this['channels'][_0x425961[_0x9a51('0x35')]][_0x9a51('0x63')]=this[_0x9a51('0x1b')][_0x425961[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]][_0x9a51('0x64')];}}}}}}catch(_0x27b398){logger[_0x9a51('0x38')](_0x9a51('0x65'),util[_0x9a51('0x49')](_0x27b398,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x66')]=function(_0x219c88,_0xf6916a){if(this[_0x9a51('0x1a')][_0x219c88]){this[_0x9a51('0x1a')][_0x219c88][_0x9a51('0x67')]=!![];if(_[_0x9a51('0x68')](_0xf6916a,_0x9a51('0x69'))){_0xf6916a=_0xf6916a[_0x9a51('0x6a')](_0x9a51('0x69'),_0x9a51('0x6b'));}this['channels'][_0x219c88][_0x9a51('0x6c')]=_0xf6916a;var _0x2bf8a5=_[_0x9a51('0x6d')](this[_0x9a51('0x1a')][_0x219c88][_0x9a51('0x6e')],{'filename':_0xf6916a});if(_[_0x9a51('0x6f')](_0x2bf8a5)){this[_0x9a51('0x1a')][_0x219c88][_0x9a51('0x6e')][_0x9a51('0x70')]({'filename':_0xf6916a,'createdAt':moment()['format'](_0x9a51('0x3d')),'mixmonitorid':'','status':_0x9a51('0x71')});}}};VoiceCallReport[_0x9a51('0x30')]['syncVarSet']=function(_0x2681ea){try{if(this[_0x9a51('0x31')](_0x2681ea)){if(this['channels'][_0x2681ea[_0x9a51('0x35')]]&&_0x2681ea[_0x9a51('0x46')]!=_0x9a51('0x3b')){if(this['isNotNull'](_0x2681ea[_0x9a51('0x72')])){if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x73')])){this[_0x9a51('0x66')](_0x2681ea['uniqueid'],_0x2681ea[_0x9a51('0x74')]);}else if(this['isNotNull'](_0x2681ea[_0x9a51('0x72')]['xmd-phone'])){this[_0x9a51('0x1a')][_0x2681ea['uniqueid']][_0x9a51('0x5f')]=_0x2681ea[_0x9a51('0x74')];}else if(this['isNotNull'](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x75')])){this[_0x9a51('0x1a')][_0x2681ea['uniqueid']]['callerid']=_0x2681ea[_0x9a51('0x74')];}else if(this['isNotNull'](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x76')])){this[_0x9a51('0x1a')][_0x2681ea[_0x9a51('0x35')]][_0x9a51('0x77')]=_0x2681ea[_0x9a51('0x74')];}else if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x78')])){this[_0x9a51('0x1a')][_0x2681ea[_0x9a51('0x35')]][_0x9a51('0xe')]=_0x2681ea['value']['split'](',')[0x0];}else if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x79')])){this[_0x9a51('0x1a')][_0x2681ea[_0x9a51('0x35')]][_0x9a51('0x7a')]=_0x2681ea['value'];}else if(this['isNotNull'](_0x2681ea[_0x9a51('0x72')]['xmd-destination'])){this[_0x9a51('0x1a')][_0x2681ea[_0x9a51('0x35')]]['destination']=_0x2681ea[_0x9a51('0x74')];}else if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')]['xmd-callerid-preview'])){this['channels'][_0x2681ea[_0x9a51('0x35')]]['calleridpreview']=_0x2681ea[_0x9a51('0x74')];}else if(this[_0x9a51('0x31')](_0x2681ea['variable'][_0x9a51('0x7b')])){this[_0x9a51('0x1a')][_0x2681ea[_0x9a51('0x35')]]['queue']=_0x2681ea[_0x9a51('0x74')];}else if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')]['sipcallid'])){this[_0x9a51('0x1a')][_0x2681ea['uniqueid']][_0x9a51('0x7c')]=_0x2681ea[_0x9a51('0x74')];}}}else if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')][_0x9a51('0x73')])){if(_0x2681ea[_0x9a51('0x74')]){var _0x186be0=path[_0x9a51('0x7d')](_0x2681ea['value'])[_0x9a51('0x64')];this[_0x9a51('0x66')](_0x186be0,_0x2681ea['value']);}}else if(this['channels'][_0x2681ea[_0x9a51('0x3a')]]){if(this[_0x9a51('0x31')](_0x2681ea[_0x9a51('0x72')])){if(this[_0x9a51('0x31')](_0x2681ea['variable'][_0x9a51('0x7e')])){this[_0x9a51('0x1a')][_0x2681ea['linkedid']]['sipcalllinkedid']=_0x2681ea['value'];}}}}}catch(_0x455474){logger[_0x9a51('0x38')](_0x9a51('0x7f'),util[_0x9a51('0x49')](_0x455474,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')]['syncHangup']=function(_0x194c12){try{if(this[_0x9a51('0x31')](_0x194c12)){if(this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]]){var _0x1e036b=moment();this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x80')]=_0x1e036b['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x4d')]=_0x1e036b[_0x9a51('0x5c')](this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x5a')],_0x9a51('0x4f'));if(this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]]['answered']){this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x81')]=_0x1e036b[_0x9a51('0x5c')](this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x59')],_0x9a51('0x4f'));this[_0x9a51('0x1a')][_0x194c12['uniqueid']][_0x9a51('0x5b')]=this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]][_0x9a51('0x4d')]-this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]]['billableseconds'];}if(_0x194c12[_0x9a51('0x41')]==='from-sip'){if(this[_0x9a51('0x1b')][_0x194c12[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]){this[_0x9a51('0x1b')][_0x194c12[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]]=_[_0x9a51('0x82')](this[_0x9a51('0x1b')][_0x194c12[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]],[_0x9a51('0x83')]);this[_0x9a51('0x33')](util[_0x9a51('0x3c')](_0x9a51('0x45'),this['agents'][_0x194c12['channel'][_0x9a51('0x43')]('-')[0x0]][_0x9a51('0x64')]),_0x9a51('0x84'),{'destaccountcode':this['agents'][_0x194c12[_0x9a51('0x46')][_0x9a51('0x43')]('-')[0x0]][_0x9a51('0x47')]});}}ami[_0x9a51('0x33')](_0x9a51('0x85'),this[_0x9a51('0x1a')][_0x194c12[_0x9a51('0x35')]]);delete this[_0x9a51('0x1a')][_0x194c12['uniqueid']];}}}catch(_0x4c831f){logger[_0x9a51('0x38')](_0x9a51('0x86'),util[_0x9a51('0x49')](_0x4c831f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')]['syncAttendedTransfer']=function(_0x4d67b6){try{if(this['isNotNull'](_0x4d67b6)){if(this[_0x9a51('0x1a')][_0x4d67b6['transfereeuniqueid']]){this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x87')]][_0x9a51('0x88')]=_0x4d67b6[_0x9a51('0x89')];this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x87')]][_0x9a51('0x8a')]=_0x4d67b6[_0x9a51('0x8b')];if(this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x8c')]]){var _0x237dc4=this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x8c')]];this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x8c')]]=this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x87')]];this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x87')]]=_0x237dc4;}}else if(this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x8d')]]){this[_0x9a51('0x1a')][_0x4d67b6['transfertargetuniqueid']][_0x9a51('0x88')]=_0x4d67b6[_0x9a51('0x89')];this['channels'][_0x4d67b6[_0x9a51('0x8d')]]['transferconnectedlinenum']=_0x4d67b6['transfertargetcalleridnum'];if(this['channels'][_0x4d67b6[_0x9a51('0x8e')]]){var _0x237dc4=this[_0x9a51('0x1a')][_0x4d67b6['origtransfereruniqueid']];this[_0x9a51('0x1a')][_0x4d67b6[_0x9a51('0x8e')]]=this['channels'][_0x4d67b6[_0x9a51('0x8d')]];this[_0x9a51('0x1a')][_0x4d67b6['transfertargetuniqueid']]=_0x237dc4;}}}}catch(_0x367136){logger[_0x9a51('0x38')](_0x9a51('0x8f'),util[_0x9a51('0x49')](_0x367136,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x29')]=function(_0x3d3613){try{if(this[_0x9a51('0x31')](_0x3d3613)){if(this['channels'][_0x3d3613[_0x9a51('0x87')]]){this['channels'][_0x3d3613[_0x9a51('0x87')]][_0x9a51('0x88')]=_0x3d3613['transfereecalleridnum'];this[_0x9a51('0x1a')][_0x3d3613['transfereeuniqueid']][_0x9a51('0x8a')]=_0x3d3613[_0x9a51('0x90')];this[_0x9a51('0x26')]({'event':_0x9a51('0x91'),'uniqueid':_0x3d3613[_0x9a51('0x87')],'context':_0x3d3613['context'],'channel':_0x3d3613[_0x9a51('0x92')]});}}}catch(_0x524ea1){logger[_0x9a51('0x38')](_0x9a51('0x93'),util[_0x9a51('0x49')](_0x524ea1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a51('0x30')][_0x9a51('0x94')]=function(_0x3061df){try{if(this[_0x9a51('0x31')](_0x3061df)){if(this[_0x9a51('0x1a')][_0x3061df[_0x9a51('0x35')]]){if(!_['isNil'](this[_0x9a51('0x1a')][_0x3061df[_0x9a51('0x35')]][_0x9a51('0x59')])){this[_0x9a51('0x1a')][_0x3061df[_0x9a51('0x35')]]['mohstarttime']=moment()[_0x9a51('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x5236a8){logger[_0x9a51('0x38')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x9a51('0x49')](_0x5236a8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x4fd416){try{if(this[_0x9a51('0x31')](_0x4fd416)){if(this[_0x9a51('0x1a')][_0x4fd416[_0x9a51('0x35')]]){if(!_['isNil'](this[_0x9a51('0x1a')][_0x4fd416[_0x9a51('0x35')]]['mohstarttime'])){this[_0x9a51('0x1a')][_0x4fd416[_0x9a51('0x35')]][_0x9a51('0x95')]+=moment()[_0x9a51('0x96')](0x0)['diff'](this[_0x9a51('0x1a')][_0x4fd416[_0x9a51('0x35')]][_0x9a51('0x97')],_0x9a51('0x4f'));delete this[_0x9a51('0x1a')][_0x4fd416[_0x9a51('0x35')]]['mohstarttime'];}}}}catch(_0x3d9bb0){logger[_0x9a51('0x38')](_0x9a51('0x98'),util[_0x9a51('0x49')](_0x3d9bb0,{'showHidden':![],'depth':null}));}};module[_0x9a51('0x99')]=VoiceCallReport; \ No newline at end of file +var _0x9123=['redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','merge','pick','keys','[syncNewCallerId][VoiceCallReport]','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','appdata','duration','subtract','includes','lastapplication','match','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','isNil','monitors','push','rec','variable','xmd-phone','value','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','mixmonitor_filename','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','seconds','billableseconds','answertime','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY'];(function(_0xfd62f2,_0x5b1e80){var _0x5b6f0c=function(_0x8bf7db){while(--_0x8bf7db){_0xfd62f2['push'](_0xfd62f2['shift']());}};_0x5b6f0c(++_0x5b1e80);}(_0x9123,0x1b9));var _0x3912=function(_0x138c85,_0x4fcec4){_0x138c85=_0x138c85-0x0;var _0x16500d=_0x9123[_0x138c85];return _0x16500d;};'use strict';var BPromise=require(_0x3912('0x0'));var _=require(_0x3912('0x1'));var moment=require('moment');var util=require(_0x3912('0x2'));var path=require(_0x3912('0x3'));var Redis=require('ioredis');var config=require(_0x3912('0x4'));var logger=require(_0x3912('0x5'))(_0x3912('0x6'));var ami=require(_0x3912('0x7'));var Channel=require(_0x3912('0x8'));var statusDesc=[_0x3912('0x9'),_0x3912('0xa'),_0x3912('0xb'),_0x3912('0xc'),_0x3912('0xd'),_0x3912('0xe'),_0x3912('0xf'),'ringinuse',_0x3912('0x10')];var applications=[_0x3912('0x11'),_0x3912('0x12'),_0x3912('0x13'),_0x3912('0x14'),_0x3912('0x15'),_0x3912('0x16')];var dispositions=[_0x3912('0x17'),_0x3912('0x18'),'FAILED',_0x3912('0x17'),_0x3912('0x17'),_0x3912('0x17'),_0x3912('0x19'),_0x3912('0x1a'),_0x3912('0x18'),_0x3912('0x18'),_0x3912('0x18')];var actions={};config[_0x3912('0x1b')]=_[_0x3912('0x1c')](config[_0x3912('0x1b')],{'host':'localhost','port':0x18eb});var io=require(_0x3912('0x1d'))(new Redis(config[_0x3912('0x1b')]));function VoiceCallReport(_0x2117c9){this['channels']=_0x2117c9[_0x3912('0x1e')];this[_0x3912('0x1f')]=_0x2117c9[_0x3912('0x1f')];ami['on'](_0x3912('0x20'),this[_0x3912('0x21')][_0x3912('0x22')](this));ami['on'](_0x3912('0x23'),this[_0x3912('0x21')][_0x3912('0x22')](this));ami['on'](_0x3912('0x24'),this[_0x3912('0x25')][_0x3912('0x22')](this));ami['on']('newstate',this[_0x3912('0x26')][_0x3912('0x22')](this));ami['on']('varset',this[_0x3912('0x27')][_0x3912('0x22')](this));ami['on'](_0x3912('0x28'),this['syncHangup'][_0x3912('0x22')](this));ami['on'](_0x3912('0x29'),this[_0x3912('0x2a')][_0x3912('0x22')](this));ami['on'](_0x3912('0x2b'),this['syncAttendedTransfer'][_0x3912('0x22')](this));ami['on'](_0x3912('0x2c'),this[_0x3912('0x2d')][_0x3912('0x22')](this));ami['on'](_0x3912('0x2e'),this[_0x3912('0x2f')][_0x3912('0x22')](this));ami['on'](_0x3912('0x30'),this[_0x3912('0x31')]['bind'](this));return BPromise[_0x3912('0x32')]()[_0x3912('0x33')](ami[_0x3912('0x34')]())[_0x3912('0x35')](function(_0x4bccfb){console[_0x3912('0x36')](_0x4bccfb);});}VoiceCallReport[_0x3912('0x37')][_0x3912('0x38')]=function(_0x2bc754){return _0x2bc754!==null&&!_[_0x3912('0x39')](_0x2bc754);};VoiceCallReport['prototype'][_0x3912('0x3a')]=function(_0xcde4b5,_0x5002c6,_0x11db6a){io['to'](_0xcde4b5)[_0x3912('0x3a')](_0x5002c6,_0x11db6a);};VoiceCallReport[_0x3912('0x37')][_0x3912('0x2a')]=function(_0xe824ae){try{if(this['isNotNull'](_0xe824ae)){if(_0xe824ae[_0x3912('0x3b')]===_0xe824ae['linkedid']){if(!_[_0x3912('0x39')](this[_0x3912('0x1e')][_0xe824ae['uniqueid']])){_[_0x3912('0x3c')](this['channels'][_0xe824ae['uniqueid']],_[_0x3912('0x3d')](_0xe824ae,_[_0x3912('0x3e')](this[_0x3912('0x1e')][_0xe824ae[_0x3912('0x3b')]])));}}}}catch(_0x52f463){logger['error'](_0x3912('0x3f'),util['inspect'](_0x52f463,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x25')]=function(_0x1a6bfd){try{if(this[_0x3912('0x38')](_0x1a6bfd)){if(_0x1a6bfd[_0x3912('0x3b')]===_0x1a6bfd[_0x3912('0x40')]&&_0x1a6bfd[_0x3912('0x41')]!=_0x3912('0x42')){if(_['isUndefined'](this[_0x3912('0x1e')][_0x1a6bfd['uniqueid']])){this[_0x3912('0x1e')][_0x1a6bfd[_0x3912('0x3b')]]=new Channel();this[_0x3912('0x1e')][_0x1a6bfd[_0x3912('0x3b')]][_0x3912('0x43')]=moment()[_0x3912('0x44')](_0x3912('0x45'));this[_0x3912('0x1e')][_0x1a6bfd[_0x3912('0x3b')]][_0x3912('0x46')]=dispositions[_['toNumber'](_0x1a6bfd[_0x3912('0x47')])];_[_0x3912('0x3c')](this[_0x3912('0x1e')][_0x1a6bfd[_0x3912('0x3b')]],_[_0x3912('0x3d')](_0x1a6bfd,_[_0x3912('0x3e')](this[_0x3912('0x1e')][_0x1a6bfd[_0x3912('0x3b')]])));if(_0x1a6bfd[_0x3912('0x48')]===_0x3912('0x49')){if(this[_0x3912('0x1f')][_0x1a6bfd[_0x3912('0x41')]['split']('-')[0x0]]){this[_0x3912('0x1f')][_0x1a6bfd['channel'][_0x3912('0x4a')]('-')[0x0]][_0x3912('0x4b')]=_0x1a6bfd[_0x3912('0x4c')];this[_0x3912('0x3a')](util['format'](_0x3912('0x4d'),this[_0x3912('0x1f')][_0x1a6bfd[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]]['name']),_0x3912('0x4e'),{'destaccountcode':this[_0x3912('0x1f')][_0x1a6bfd[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]][_0x3912('0x4f')],'destconnectedlinenum':_0x1a6bfd['exten']});}}}}}}catch(_0x5f0c4b){logger[_0x3912('0x50')](_0x3912('0x51'),util[_0x3912('0x52')](_0x5f0c4b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x21')]=function(_0x1d1295){try{if(this[_0x3912('0x38')](_0x1d1295)){if(_0x1d1295[_0x3912('0x3b')]===_0x1d1295[_0x3912('0x40')]&&_0x1d1295[_0x3912('0x4c')]!='h'&&_0x1d1295[_0x3912('0x41')]!=_0x3912('0x42')){_0x1d1295['application']=_0x1d1295[_0x3912('0x53')][_0x3912('0x54')]();_0x1d1295[_0x3912('0x55')]=(_0x1d1295[_0x3912('0x56')]||_0x1d1295[_0x3912('0x55')])['toLowerCase']();if(_[_0x3912('0x39')](this['channels'][_0x1d1295[_0x3912('0x3b')]])){this[_0x3912('0x1e')][_0x1d1295[_0x3912('0x3b')]]=new Channel();this[_0x3912('0x1e')][_0x1d1295['uniqueid']][_0x3912('0x43')]=_0x1d1295[_0x3912('0x57')]?moment()[_0x3912('0x58')](moment['duration'](_0x1d1295[_0x3912('0x57')])['seconds'](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x3912('0x44')](_0x3912('0x45'));this[_0x3912('0x1e')][_0x1d1295[_0x3912('0x3b')]]['disposition']='NO\x20ANSWER';}_[_0x3912('0x3c')](this[_0x3912('0x1e')][_0x1d1295[_0x3912('0x3b')]],_[_0x3912('0x3d')](_0x1d1295,_[_0x3912('0x3e')](this[_0x3912('0x1e')][_0x1d1295[_0x3912('0x3b')]])));if(_[_0x3912('0x59')](applications,_0x1d1295[_0x3912('0x53')])){this[_0x3912('0x1e')][_0x1d1295['uniqueid']][_0x3912('0x5a')]=_0x1d1295['application'];this['channels'][_0x1d1295[_0x3912('0x3b')]]['lastdata']=_0x1d1295[_0x3912('0x55')];if(_0x1d1295[_0x3912('0x53')]===_0x3912('0x11')&&_['startsWith'](_0x1d1295[_0x3912('0x55')],'cdr(')){var _0x5a6aea=_0x1d1295[_0x3912('0x55')]['split']('=');var _0x4d2a93=_0x5a6aea[0x0][_0x3912('0x5b')](/cdr\((.*)\)/);if(_0x4d2a93){this['channels'][_0x1d1295[_0x3912('0x3b')]][_0x4d2a93[0x1]]=_0x5a6aea[0x1];}}else if(_0x1d1295[_0x3912('0x53')]===_0x3912('0x12')){this[_0x3912('0x1e')][_0x1d1295[_0x3912('0x3b')]][_0x3912('0x12')]=_0x1d1295[_0x3912('0x55')][_0x3912('0x4a')](',')[0x0];}}}}}catch(_0x514008){logger[_0x3912('0x50')](_0x3912('0x5c'),util[_0x3912('0x52')](_0x514008,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3912('0x26')]=function(_0x4574ee){try{if(this['isNotNull'](_0x4574ee)){if(_0x4574ee[_0x3912('0x3b')]!==_0x4574ee[_0x3912('0x40')]){if(this['channels'][_0x4574ee[_0x3912('0x40')]]){if(_0x4574ee[_0x3912('0x47')]==='6'){if(!this[_0x3912('0x1e')][_0x4574ee['linkedid']][_0x3912('0x5d')]){var _0x54f8ca=moment();this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]]['answered']=!![];this['channels'][_0x4574ee[_0x3912('0x40')]]['answertime']=_0x54f8ca['format'](_0x3912('0x45'));if(this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x43')]){this['channels'][_0x4574ee[_0x3912('0x40')]][_0x3912('0x5e')]=_0x54f8ca[_0x3912('0x5f')](this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x43')],'seconds');}}this['channels'][_0x4574ee[_0x3912('0x40')]]['linkedid']=_0x4574ee[_0x3912('0x3b')];if(_0x4574ee[_0x3912('0x60')]!=='xcally-motion-preview'){this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x61')]=_0x4574ee[_0x3912('0x60')];}this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x62')]=_0x4574ee[_0x3912('0x63')];this['channels'][_0x4574ee[_0x3912('0x40')]][_0x3912('0x64')]=_0x4574ee[_0x3912('0x41')];this['channels'][_0x4574ee[_0x3912('0x40')]][_0x3912('0x46')]=dispositions[_['toNumber'](_0x4574ee[_0x3912('0x47')])];if(this['agents'][_0x4574ee['channel'][_0x3912('0x4a')]('-')[0x0]]){this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x65')]=this[_0x3912('0x1f')][_0x4574ee[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]]['id'];this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x40')]][_0x3912('0x66')]=this['agents'][_0x4574ee[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]]['name'];}}}}else{if(this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x3b')]]){if(_0x4574ee[_0x3912('0x47')]==='6'){if(this[_0x3912('0x1f')][_0x4574ee['channel']['split']('-')[0x0]]){this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x3b')]][_0x3912('0x65')]=this['agents'][_0x4574ee['channel']['split']('-')[0x0]]['id'];this[_0x3912('0x1e')][_0x4574ee[_0x3912('0x3b')]]['membername']=this[_0x3912('0x1f')][_0x4574ee[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]][_0x3912('0x67')];}}}}}}catch(_0x512efe){logger[_0x3912('0x50')](_0x3912('0x68'),util[_0x3912('0x52')](_0x512efe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x69')]=function(_0x4921a4,_0x372fcc){if(this[_0x3912('0x1e')][_0x4921a4]){this[_0x3912('0x1e')][_0x4921a4][_0x3912('0x6a')]=!![];if(_[_0x3912('0x6b')](_0x372fcc,_0x3912('0x6c'))){_0x372fcc=_0x372fcc[_0x3912('0x6d')](_0x3912('0x6c'),_0x3912('0x6e'));}this[_0x3912('0x1e')][_0x4921a4]['monitorFilename']=_0x372fcc;var _0x176c53=_['find'](this['channels'][_0x4921a4]['monitors'],{'filename':_0x372fcc});if(_[_0x3912('0x6f')](_0x176c53)){this['channels'][_0x4921a4][_0x3912('0x70')][_0x3912('0x71')]({'filename':_0x372fcc,'createdAt':moment()[_0x3912('0x44')](_0x3912('0x45')),'mixmonitorid':'','status':_0x3912('0x72')});}}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x27')]=function(_0x26b26c){try{if(this[_0x3912('0x38')](_0x26b26c)){if(this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]&&_0x26b26c[_0x3912('0x41')]!='OutgoingSpoolFailed'){if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')])){if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')]['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x26b26c[_0x3912('0x3b')],_0x26b26c['value']);}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x74')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]['calleridnum']=_0x26b26c[_0x3912('0x75')];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')]['xmd-callerid'])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]['callerid']=_0x26b26c['value'];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x76')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]][_0x3912('0x77')]=_0x26b26c['value'];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x78')])){this['channels'][_0x26b26c[_0x3912('0x3b')]]['queue']=_0x26b26c[_0x3912('0x75')][_0x3912('0x4a')](',')[0x0];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x79')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]['originatecalleridnum']=_0x26b26c[_0x3912('0x75')];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x7a')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]['destination']=_0x26b26c[_0x3912('0x75')];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x7b')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]][_0x3912('0x7c')]=_0x26b26c['value'];}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x7d')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]][_0x3912('0x12')]=_0x26b26c[_0x3912('0x75')];}else if(this['isNotNull'](_0x26b26c[_0x3912('0x73')][_0x3912('0x7e')])){this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x3b')]]['sipcalluniqueid']=_0x26b26c[_0x3912('0x75')];}}}else if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')][_0x3912('0x7f')])){if(_0x26b26c['value']){var _0x39b151=path['parse'](_0x26b26c[_0x3912('0x75')])['name'];this['syncMixMonitorFilename'](_0x39b151,_0x26b26c['value']);}}else if(this[_0x3912('0x1e')][_0x26b26c[_0x3912('0x40')]]){if(this[_0x3912('0x38')](_0x26b26c[_0x3912('0x73')])){if(this[_0x3912('0x38')](_0x26b26c['variable']['sipcallid'])){this[_0x3912('0x1e')][_0x26b26c['linkedid']][_0x3912('0x80')]=_0x26b26c[_0x3912('0x75')];}}}}}catch(_0x28655f){logger['error'](_0x3912('0x81'),util[_0x3912('0x52')](_0x28655f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x82')]=function(_0x29c55c){try{if(this[_0x3912('0x38')](_0x29c55c)){if(this['channels'][_0x29c55c[_0x3912('0x3b')]]){var _0x76a342=moment();this[_0x3912('0x1e')][_0x29c55c['uniqueid']][_0x3912('0x83')]=_0x76a342[_0x3912('0x44')](_0x3912('0x45'));this[_0x3912('0x1e')][_0x29c55c['uniqueid']][_0x3912('0x57')]=_0x76a342['diff'](this['channels'][_0x29c55c[_0x3912('0x3b')]][_0x3912('0x43')],_0x3912('0x84'));if(this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]]['answered']){this[_0x3912('0x1e')][_0x29c55c['uniqueid']][_0x3912('0x85')]=_0x76a342[_0x3912('0x5f')](this['channels'][_0x29c55c[_0x3912('0x3b')]][_0x3912('0x86')],_0x3912('0x84'));this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]][_0x3912('0x5e')]=this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]][_0x3912('0x57')]-this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]][_0x3912('0x85')];}if(_0x29c55c['context']===_0x3912('0x49')){if(this['agents'][_0x29c55c['channel'][_0x3912('0x4a')]('-')[0x0]]){this[_0x3912('0x1f')][_0x29c55c['channel'][_0x3912('0x4a')]('-')[0x0]]=_[_0x3912('0x87')](this[_0x3912('0x1f')][_0x29c55c[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]],[_0x3912('0x4b')]);this['emit'](util[_0x3912('0x44')](_0x3912('0x4d'),this[_0x3912('0x1f')][_0x29c55c[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]][_0x3912('0x67')]),_0x3912('0x88'),{'destaccountcode':this[_0x3912('0x1f')][_0x29c55c[_0x3912('0x41')][_0x3912('0x4a')]('-')[0x0]][_0x3912('0x4f')]});}}ami[_0x3912('0x3a')](_0x3912('0x89'),this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]]);delete this[_0x3912('0x1e')][_0x29c55c[_0x3912('0x3b')]];}}}catch(_0x564468){logger[_0x3912('0x50')](_0x3912('0x8a'),util['inspect'](_0x564468,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x8b')]=function(_0x11e03a){try{if(this[_0x3912('0x38')](_0x11e03a)){if(this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x8c')]]){this['channels'][_0x11e03a[_0x3912('0x8c')]]['transfercalleridnum']=_0x11e03a['origtransferercalleridnum'];this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x8c')]][_0x3912('0x8d')]=_0x11e03a[_0x3912('0x8e')];if(this['channels'][_0x11e03a['secondtransfereruniqueid']]){var _0x3b0ad0=this['channels'][_0x11e03a[_0x3912('0x8f')]];this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x8f')]]=this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x8c')]];this[_0x3912('0x1e')][_0x11e03a['transfereeuniqueid']]=_0x3b0ad0;}}else if(this['channels'][_0x11e03a[_0x3912('0x90')]]){this[_0x3912('0x1e')][_0x11e03a['transfertargetuniqueid']][_0x3912('0x91')]=_0x11e03a['origtransferercalleridnum'];this['channels'][_0x11e03a[_0x3912('0x90')]][_0x3912('0x8d')]=_0x11e03a['transfertargetcalleridnum'];if(this[_0x3912('0x1e')][_0x11e03a['origtransfereruniqueid']]){var _0x3b0ad0=this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x92')]];this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x92')]]=this[_0x3912('0x1e')][_0x11e03a[_0x3912('0x90')]];this['channels'][_0x11e03a[_0x3912('0x90')]]=_0x3b0ad0;}}}}catch(_0x55c317){logger[_0x3912('0x50')](_0x3912('0x93'),util[_0x3912('0x52')](_0x55c317,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x2d')]=function(_0x54fb9d){try{if(this[_0x3912('0x38')](_0x54fb9d)){if(this[_0x3912('0x1e')][_0x54fb9d['transfereeuniqueid']]){this[_0x3912('0x1e')][_0x54fb9d[_0x3912('0x8c')]][_0x3912('0x91')]=_0x54fb9d['transfereecalleridnum'];this[_0x3912('0x1e')][_0x54fb9d['transfereeuniqueid']]['transferconnectedlinenum']=_0x54fb9d[_0x3912('0x94')];this[_0x3912('0x82')]({'event':'BlindTransfer','uniqueid':_0x54fb9d[_0x3912('0x8c')],'context':_0x54fb9d[_0x3912('0x48')],'channel':_0x54fb9d[_0x3912('0x95')]});}}}catch(_0x4b8740){logger[_0x3912('0x50')](_0x3912('0x96'),util[_0x3912('0x52')](_0x4b8740,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')]['syncMusicOnHoldStart']=function(_0x208a54){try{if(this[_0x3912('0x38')](_0x208a54)){if(this[_0x3912('0x1e')][_0x208a54['uniqueid']]){if(!_[_0x3912('0x6f')](this[_0x3912('0x1e')][_0x208a54[_0x3912('0x3b')]][_0x3912('0x86')])){this[_0x3912('0x1e')][_0x208a54['uniqueid']][_0x3912('0x97')]=moment()[_0x3912('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x1a23ec){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x3912('0x52')](_0x1a23ec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3912('0x37')][_0x3912('0x31')]=function(_0x135f0f){try{if(this[_0x3912('0x38')](_0x135f0f)){if(this[_0x3912('0x1e')][_0x135f0f[_0x3912('0x3b')]]){if(!_[_0x3912('0x6f')](this[_0x3912('0x1e')][_0x135f0f[_0x3912('0x3b')]]['mohstarttime'])){this['channels'][_0x135f0f[_0x3912('0x3b')]][_0x3912('0x98')]+=moment()[_0x3912('0x99')](0x0)[_0x3912('0x5f')](this[_0x3912('0x1e')][_0x135f0f[_0x3912('0x3b')]][_0x3912('0x97')],_0x3912('0x84'));delete this['channels'][_0x135f0f[_0x3912('0x3b')]][_0x3912('0x97')];}}}}catch(_0x7dbdfa){logger[_0x3912('0x50')](_0x3912('0x9a'),util[_0x3912('0x52')](_0x7dbdfa,{'showHidden':![],'depth':null}));}};module[_0x3912('0x9b')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 7119a28..3884dbb 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2262=['socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','dialend','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','uniqueid','format','called','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','custom:dialbegin','error','inspect','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','variable','value','outboundrouteid','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','isNil','YYYY-MM-DD\x20HH:mm:ss','duration','endtime','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost'];(function(_0x59c919,_0xa2f64a){var _0x3f93d3=function(_0x5ec07f){while(--_0x5ec07f){_0x59c919['push'](_0x59c919['shift']());}};_0x3f93d3(++_0xa2f64a);}(_0x2262,0x9d));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2226('0x0'));var moment=require(_0x2226('0x1'));var util=require(_0x2226('0x2'));var Redis=require(_0x2226('0x3'));var config=require(_0x2226('0x4'));var logger=require(_0x2226('0x5'))(_0x2226('0x6'));var ami=require(_0x2226('0x7'));config[_0x2226('0x8')]=_[_0x2226('0x9')](config['redis'],{'host':_0x2226('0xa'),'port':0x18eb});var io=require(_0x2226('0xb'))(new Redis(config[_0x2226('0x8')]));function VoiceDialReport(_0x2cad66){this[_0x2226('0xc')]=_0x2cad66[_0x2226('0xd')];this[_0x2226('0xe')]=_0x2cad66[_0x2226('0xe')];this[_0x2226('0xf')]={};ami['on'](_0x2226('0x10'),this['syncDialBegin'][_0x2226('0x11')](this));ami['on'](_0x2226('0x12'),this['syncDialEnd']['bind'](this));ami['on'](_0x2226('0x13'),this[_0x2226('0x14')][_0x2226('0x11')](this));ami['on'](_0x2226('0x15'),this[_0x2226('0x16')][_0x2226('0x11')](this));}VoiceDialReport['prototype'][_0x2226('0x17')]=function(_0x574cf5){return _0x574cf5!==null&&!_[_0x2226('0x18')](_0x574cf5);};VoiceDialReport[_0x2226('0x19')][_0x2226('0x1a')]=function(_0x447ebe,_0x12dacf,_0x3f2f74){io['to'](_0x447ebe)[_0x2226('0x1a')](_0x12dacf,_0x3f2f74);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x28d6fc){try{if(this[_0x2226('0x17')](_0x28d6fc)){if(this['channels'][_0x28d6fc['uniqueid']]){_['merge'](this[_0x2226('0xc')][_0x28d6fc[_0x2226('0x1b')]],{'starttime':moment()[_0x2226('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x2226('0x1d'),'interface':_0x28d6fc['channel']['substring'](0x0,_0x28d6fc[_0x2226('0x1e')][_0x2226('0x1f')]('-')),'membername':_0x28d6fc[_0x2226('0x1e')][_0x2226('0x20')](_0x28d6fc[_0x2226('0x1e')][_0x2226('0x1f')]('/')+0x1,_0x28d6fc[_0x2226('0x1e')][_0x2226('0x1f')]('-'))},_[_0x2226('0x21')](_0x28d6fc,[_0x2226('0x22'),_0x2226('0x23')]));this[_0x2226('0x1a')](_0x2226('0x24'),'voice_outbound_channel:save',this[_0x2226('0xc')][_0x28d6fc[_0x2226('0x1b')]]);ami[_0x2226('0x1a')](_0x2226('0x25'),this['channels'][_0x28d6fc['uniqueid']]);}}}catch(_0x53fbb3){logger[_0x2226('0x26')]('[syncDialBegin][VoiceDialReport]',util[_0x2226('0x27')](_0x53fbb3,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x62efac){try{if(this[_0x2226('0x17')](_0x62efac)){if(this['channels'][_0x62efac[_0x2226('0x1b')]]){this[_0x2226('0xc')][_0x62efac['uniqueid']][_0x2226('0x28')]=_0x62efac[_0x2226('0x28')];if(_0x62efac['dialstatus']==='ANSWER'){this[_0x2226('0xc')][_0x62efac['uniqueid']][_0x2226('0x29')]=_0x62efac[_0x2226('0x29')];this[_0x2226('0xc')][_0x62efac[_0x2226('0x1b')]][_0x2226('0x2a')]=_0x62efac[_0x2226('0x2a')];this['channels'][_0x62efac[_0x2226('0x1b')]][_0x2226('0x2b')]=moment()[_0x2226('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x62efac[_0x2226('0x1b')]][_0x2226('0x2c')]='connect';ami[_0x2226('0x1a')](_0x2226('0x2d'),this[_0x2226('0xc')][_0x62efac['uniqueid']]);}this[_0x2226('0x1a')](_0x2226('0x24'),'voice_outbound_channel:save',this['channels'][_0x62efac[_0x2226('0x1b')]]);}}}catch(_0xfb27ff){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0x2226('0x27')](_0xfb27ff,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2226('0x19')][_0x2226('0x14')]=function(_0x4821e5){try{if(this[_0x2226('0x17')](_0x4821e5)){this['addVariable'](_0x4821e5[_0x2226('0x1b')],_['keys'](_0x4821e5[_0x2226('0x2e')])[0x0],_0x4821e5[_0x2226('0x2f')]);if(this[_0x2226('0x17')](_0x4821e5[_0x2226('0x2e')])&&this[_0x2226('0x17')](_0x4821e5[_0x2226('0x2e')][_0x2226('0x30')])){if(_[_0x2226('0x18')](this['channels'][_0x4821e5[_0x2226('0x1b')]])){this['channels'][_0x4821e5['uniqueid']]={'routeId':_0x4821e5['value'],'variables':this[_0x2226('0xf')][_0x4821e5[_0x2226('0x1b')]]};this[_0x2226('0x1a')]('voice:outbound',_0x2226('0x31'),this[_0x2226('0xc')][_0x4821e5[_0x2226('0x1b')]]);}}}}catch(_0xeedeac){logger[_0x2226('0x26')](_0x2226('0x32'),util[_0x2226('0x27')](_0xeedeac,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2226('0x19')]['addVariable']=function(_0x5f2268,_0x1df3f5,_0x10b99e){var _0x3ce8f5=[_0x2226('0x33'),'rtpaudioqosbridged',_0x2226('0x34'),_0x2226('0x35'),_0x2226('0x36'),_0x2226('0x37'),_0x2226('0x38'),_0x2226('0x39'),'sipcallid',_0x2226('0x3a'),'bridgepeer','bridgepvtcallid','membercalls',_0x2226('0x3b'),_0x2226('0x3c'),_0x2226('0x3d'),_0x2226('0x3e'),'memberpenalty',_0x2226('0x3f')];if(!_[_0x2226('0x40')](_0x1df3f5)&&!_['includes'](_0x3ce8f5,_0x1df3f5)){if(_[_0x2226('0x18')](this[_0x2226('0xf')][_0x5f2268])){this['variables'][_0x5f2268]={};}this[_0x2226('0xf')][_0x5f2268][_0x1df3f5]=_0x10b99e;}};VoiceDialReport[_0x2226('0x19')][_0x2226('0x16')]=function(_0x44accd){try{if(this[_0x2226('0x17')](_0x44accd)){if(this['channels'][_0x44accd[_0x2226('0x1b')]]){this[_0x2226('0xc')][_0x44accd['uniqueid']]['endtime']=moment()[_0x2226('0x1c')](_0x2226('0x41'));this['channels'][_0x44accd[_0x2226('0x1b')]][_0x2226('0x42')]=moment(this['channels'][_0x44accd[_0x2226('0x1b')]][_0x2226('0x43')])[_0x2226('0x44')](this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x45')],_0x2226('0x46'));this[_0x2226('0xc')][_0x44accd['uniqueid']][_0x2226('0x2c')]=_0x2226('0x47');this['outbound'][_0x2226('0x48')]+=0x1;if(this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x2b')]){this['outbound'][_0x2226('0x49')]+=0x1;this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x4a')]=moment(this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x2b')])['diff'](this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x45')],_0x2226('0x46'));this['channels'][_0x44accd[_0x2226('0x1b')]][_0x2226('0x4b')]=moment(this[_0x2226('0xc')][_0x44accd['uniqueid']][_0x2226('0x43')])[_0x2226('0x44')](this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]]['answertime'],_0x2226('0x46'));this[_0x2226('0xe')][_0x2226('0x4c')]+=this[_0x2226('0xc')][_0x44accd['uniqueid']][_0x2226('0x4a')]||0x0;this[_0x2226('0xe')][_0x2226('0x4d')]+=this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]][_0x2226('0x4b')];}this['outbound'][_0x2226('0x4e')]+=this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]]['duration'];ami['emit'](_0x2226('0x4f'),this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]]);ami[_0x2226('0x1a')](_0x2226('0x50'),this[_0x2226('0xc')][_0x44accd[_0x2226('0x1b')]]);this[_0x2226('0x1a')]('voice:outbound',_0x2226('0x51'),this['outbound']);this[_0x2226('0x1a')]('voice:outbound',_0x2226('0x52'),this['channels'][_0x44accd[_0x2226('0x1b')]]);delete this['channels'][_0x44accd[_0x2226('0x1b')]];}if(this[_0x2226('0xf')][_0x44accd[_0x2226('0x1b')]]){delete this[_0x2226('0xf')][_0x44accd[_0x2226('0x1b')]];}}}catch(_0x1571f1){logger['error']('[syncHangup][VoiceDialReport]',util['inspect'](_0x1571f1,{'showHidden':![],'depth':null}));}};module[_0x2226('0x53')]=VoiceDialReport; \ No newline at end of file +var _0x5fd3=['rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','endtime','diff','starttime','seconds','complete','total','answertime','answered','billableseconds','holdtime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isUndefined','emit','syncDialBegin','isNotNull','uniqueid','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','omit','event','privilege','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','format','lastevent','connect','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','addVariable','variable','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5fd3,0x74));var _0x35fd=function(_0xd4d38,_0x21fc0e){_0xd4d38=_0xd4d38-0x0;var _0x5e3078=_0x5fd3[_0xd4d38];return _0x5e3078;};'use strict';var _=require(_0x35fd('0x0'));var moment=require(_0x35fd('0x1'));var util=require(_0x35fd('0x2'));var Redis=require(_0x35fd('0x3'));var config=require(_0x35fd('0x4'));var logger=require(_0x35fd('0x5'))(_0x35fd('0x6'));var ami=require(_0x35fd('0x7'));config[_0x35fd('0x8')]=_[_0x35fd('0x9')](config[_0x35fd('0x8')],{'host':_0x35fd('0xa'),'port':0x18eb});var io=require(_0x35fd('0xb'))(new Redis(config['redis']));function VoiceDialReport(_0xd01336){this[_0x35fd('0xc')]=_0xd01336[_0x35fd('0xd')];this[_0x35fd('0xe')]=_0xd01336['outbound'];this[_0x35fd('0xf')]={};ami['on'](_0x35fd('0x10'),this['syncDialBegin'][_0x35fd('0x11')](this));ami['on']('dialend',this[_0x35fd('0x12')][_0x35fd('0x11')](this));ami['on'](_0x35fd('0x13'),this[_0x35fd('0x14')][_0x35fd('0x11')](this));ami['on'](_0x35fd('0x15'),this[_0x35fd('0x16')][_0x35fd('0x11')](this));}VoiceDialReport[_0x35fd('0x17')]['isNotNull']=function(_0x1639cd){return _0x1639cd!==null&&!_[_0x35fd('0x18')](_0x1639cd);};VoiceDialReport[_0x35fd('0x17')]['emit']=function(_0x1f250d,_0x3b96dd,_0x3d6d51){io['to'](_0x1f250d)[_0x35fd('0x19')](_0x3b96dd,_0x3d6d51);};VoiceDialReport[_0x35fd('0x17')][_0x35fd('0x1a')]=function(_0x47f84c){try{if(this[_0x35fd('0x1b')](_0x47f84c)){if(this['channels'][_0x47f84c[_0x35fd('0x1c')]]){_['merge'](this['channels'][_0x47f84c[_0x35fd('0x1c')]],{'starttime':moment()['format'](_0x35fd('0x1d')),'lastevent':'called','interface':_0x47f84c['channel'][_0x35fd('0x1e')](0x0,_0x47f84c[_0x35fd('0x1f')][_0x35fd('0x20')]('-')),'membername':_0x47f84c[_0x35fd('0x1f')]['substring'](_0x47f84c[_0x35fd('0x1f')][_0x35fd('0x20')]('/')+0x1,_0x47f84c['channel'][_0x35fd('0x20')]('-'))},_[_0x35fd('0x21')](_0x47f84c,[_0x35fd('0x22'),_0x35fd('0x23')]));this[_0x35fd('0x19')]('voice:outbound',_0x35fd('0x24'),this[_0x35fd('0xc')][_0x47f84c[_0x35fd('0x1c')]]);ami[_0x35fd('0x19')](_0x35fd('0x25'),this[_0x35fd('0xc')][_0x47f84c['uniqueid']]);}}}catch(_0x366236){logger[_0x35fd('0x26')](_0x35fd('0x27'),util[_0x35fd('0x28')](_0x366236,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x47b307){try{if(this[_0x35fd('0x1b')](_0x47b307)){if(this[_0x35fd('0xc')][_0x47b307[_0x35fd('0x1c')]]){this[_0x35fd('0xc')][_0x47b307[_0x35fd('0x1c')]]['dialstatus']=_0x47b307[_0x35fd('0x29')];if(_0x47b307[_0x35fd('0x29')]===_0x35fd('0x2a')){this[_0x35fd('0xc')][_0x47b307['uniqueid']][_0x35fd('0x2b')]=_0x47b307[_0x35fd('0x2b')];this[_0x35fd('0xc')][_0x47b307[_0x35fd('0x1c')]]['connectedlinename']=_0x47b307[_0x35fd('0x2c')];this['channels'][_0x47b307[_0x35fd('0x1c')]]['answertime']=moment()[_0x35fd('0x2d')](_0x35fd('0x1d'));this[_0x35fd('0xc')][_0x47b307[_0x35fd('0x1c')]][_0x35fd('0x2e')]=_0x35fd('0x2f');ami[_0x35fd('0x19')](_0x35fd('0x30'),this[_0x35fd('0xc')][_0x47b307[_0x35fd('0x1c')]]);}this[_0x35fd('0x19')](_0x35fd('0x31'),'voice_outbound_channel:save',this['channels'][_0x47b307['uniqueid']]);}}}catch(_0x27e84b){logger[_0x35fd('0x26')](_0x35fd('0x32'),util[_0x35fd('0x28')](_0x27e84b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x566b59){try{if(this[_0x35fd('0x1b')](_0x566b59)){this[_0x35fd('0x33')](_0x566b59[_0x35fd('0x1c')],_['keys'](_0x566b59[_0x35fd('0x34')])[0x0],_0x566b59['value']);if(this[_0x35fd('0x1b')](_0x566b59[_0x35fd('0x34')])&&this['isNotNull'](_0x566b59[_0x35fd('0x34')][_0x35fd('0x35')])){if(_[_0x35fd('0x18')](this[_0x35fd('0xc')][_0x566b59[_0x35fd('0x1c')]])){this[_0x35fd('0xc')][_0x566b59[_0x35fd('0x1c')]]={'routeId':_0x566b59['value'],'variables':this[_0x35fd('0xf')][_0x566b59[_0x35fd('0x1c')]]};this[_0x35fd('0x19')](_0x35fd('0x31'),_0x35fd('0x24'),this[_0x35fd('0xc')][_0x566b59[_0x35fd('0x1c')]]);}}}}catch(_0x1d9921){logger['error'](_0x35fd('0x36'),util[_0x35fd('0x28')](_0x1d9921,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x35fd('0x17')]['addVariable']=function(_0xd230c2,_0x2e7d66,_0x271c80){var _0x55c827=[_0x35fd('0x37'),_0x35fd('0x38'),_0x35fd('0x39'),_0x35fd('0x3a'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x35fd('0x3b'),_0x35fd('0x3c'),'sipcallid',_0x35fd('0x3d'),'bridgepeer',_0x35fd('0x3e'),_0x35fd('0x3f'),_0x35fd('0x40'),_0x35fd('0x41'),'memberlastcall','membername',_0x35fd('0x42'),_0x35fd('0x43')];if(!_['isNil'](_0x2e7d66)&&!_['includes'](_0x55c827,_0x2e7d66)){if(_[_0x35fd('0x18')](this[_0x35fd('0xf')][_0xd230c2])){this['variables'][_0xd230c2]={};}this[_0x35fd('0xf')][_0xd230c2][_0x2e7d66]=_0x271c80;}};VoiceDialReport[_0x35fd('0x17')][_0x35fd('0x16')]=function(_0x524ce6){try{if(this[_0x35fd('0x1b')](_0x524ce6)){if(this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]){this[_0x35fd('0xc')][_0x524ce6['uniqueid']][_0x35fd('0x44')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]['duration']=moment(this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x44')])[_0x35fd('0x45')](this[_0x35fd('0xc')][_0x524ce6['uniqueid']][_0x35fd('0x46')],_0x35fd('0x47'));this['channels'][_0x524ce6[_0x35fd('0x1c')]]['lastevent']=_0x35fd('0x48');this[_0x35fd('0xe')][_0x35fd('0x49')]+=0x1;if(this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x4a')]){this[_0x35fd('0xe')][_0x35fd('0x4b')]+=0x1;this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]['holdtime']=moment(this[_0x35fd('0xc')][_0x524ce6['uniqueid']][_0x35fd('0x4a')])['diff'](this[_0x35fd('0xc')][_0x524ce6['uniqueid']]['starttime'],_0x35fd('0x47'));this['channels'][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x4c')]=moment(this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x44')])[_0x35fd('0x45')](this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]['answertime'],'seconds');this[_0x35fd('0xe')]['sumHoldTime']+=this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x4d')]||0x0;this[_0x35fd('0xe')][_0x35fd('0x4e')]+=this['channels'][_0x524ce6[_0x35fd('0x1c')]][_0x35fd('0x4c')];}this[_0x35fd('0xe')][_0x35fd('0x4f')]+=this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]['duration'];ami[_0x35fd('0x19')](_0x35fd('0x50'),this[_0x35fd('0xc')][_0x524ce6['uniqueid']]);ami[_0x35fd('0x19')](_0x35fd('0x51'),this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]);this['emit'](_0x35fd('0x31'),_0x35fd('0x52'),this[_0x35fd('0xe')]);this[_0x35fd('0x19')](_0x35fd('0x31'),_0x35fd('0x53'),this[_0x35fd('0xc')][_0x524ce6[_0x35fd('0x1c')]]);delete this['channels'][_0x524ce6[_0x35fd('0x1c')]];}if(this[_0x35fd('0xf')][_0x524ce6['uniqueid']]){delete this[_0x35fd('0xf')][_0x524ce6[_0x35fd('0x1c')]];}}}catch(_0x515ba7){logger[_0x35fd('0x26')](_0x35fd('0x54'),util[_0x35fd('0x28')](_0x515ba7,{'showHidden':![],'depth':null}));}};module[_0x35fd('0x55')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 041f8ef..31383ca 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x036e=['isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','sequence','enqueue','Action','channel','catch','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','format','voice:queue:%s','name','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','isNotNull','loopQueueShow','queues','[queues]','then','syncQueueSummary','queue','countBy','toNumber','callers','loggedIn','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','emitVoiceQueueChannelSave','last','queuecallercomplete','queuecallercompleteAt','holdtime','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','syncAgentConnect','COMPLETEDBYAGENT','syncAgentComplete','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','queuecallerexitreason','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','syncVarSet','addVariable','variable','value','queuestatus','CONTINUE','queuecallerabandonAt','queueposition','EXITWITHKEY','queuecallerleaveAt','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','length','seconds','milliseconds','diff','total','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','context','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','util','md5','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','prototype','tail','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','agentconnect','varset','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','loopQueueSummary','isUndefined'];(function(_0x226dbe,_0x47cb91){var _0xda773e=function(_0x5dabfa){while(--_0x5dabfa){_0x226dbe['push'](_0x226dbe['shift']());}};_0xda773e(++_0x47cb91);}(_0x036e,0x160));var _0xe036=function(_0x27bc3f,_0x311586){_0x27bc3f=_0x27bc3f-0x0;var _0x5a11a2=_0x036e[_0x27bc3f];return _0x5a11a2;};'use strict';var _=require(_0xe036('0x0'));var moment=require(_0xe036('0x1'));var BPromise=require('bluebird');var util=require(_0xe036('0x2'));var md5=require(_0xe036('0x3'));var Redis=require('ioredis');var config=require(_0xe036('0x4'));var logger=require(_0xe036('0x5'))('ami');var ami=require(_0xe036('0x6'));var QueueReport=require('../model/queueReport');config['redis']=_[_0xe036('0x7')](config[_0xe036('0x8')],{'host':_0xe036('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe036('0xa')]['enqueue']=function(_0x23b261){this[_0xe036('0xb')]=this['tail']?this[_0xe036('0xb')]['finally'](_0x23b261):_0x23b261();};function VoiceQueueReport(_0x37ea33){this['sequence']=new Sequence();this[_0xe036('0xc')]={};this['agents']=_0x37ea33[_0xe036('0xd')];this[_0xe036('0xe')]=_0x37ea33[_0xe036('0xf')];this[_0xe036('0x10')]=_0x37ea33[_0xe036('0x10')];this[_0xe036('0x11')]=!![];this[_0xe036('0x12')]=_0x37ea33['campaigns'];this[_0xe036('0x13')]={};ami['on'](_0xe036('0x14'),this['syncQueueSummary'][_0xe036('0x15')](this));ami['on'](_0xe036('0x16'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xe036('0x17'),this[_0xe036('0x18')][_0xe036('0x15')](this));ami['on'](_0xe036('0x19'),this[_0xe036('0x1a')][_0xe036('0x15')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0xe036('0x15')](this));ami['on'](_0xe036('0x1b'),this['syncAgentComplete'][_0xe036('0x15')](this));ami['on'](_0xe036('0x1c'),this['syncAgentConnect'][_0xe036('0x15')](this));ami['on'](_0xe036('0x1d'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0xe036('0x1e')][_0xe036('0x15')](this));ami['on'](_0xe036('0x1f'),this['syncFullyBooted']['bind'](this));ami['on'](_0xe036('0x20'),this[_0xe036('0x21')][_0xe036('0x15')](this));ami['on'](_0xe036('0x22'),this[_0xe036('0x23')][_0xe036('0x15')](this));ami['on']('attendedtransfer',this[_0xe036('0x24')][_0xe036('0x15')](this));ami['on'](_0xe036('0x25'),this['syncBlindTransfer']['bind'](this));this[_0xe036('0x26')]();this['loopQueueShow']();}function isNotNull(_0x43f7af){return _0x43f7af!==null&&!_[_0xe036('0x27')](_0x43f7af);}function clearChannels(_0x6b91a8){if(!_['isEmpty'](_0x6b91a8)){for(var _0x70a04b in _0x6b91a8){if(_0x6b91a8['hasOwnProperty'](_0x70a04b)){delete _0x6b91a8[_0x70a04b];}}}}function clearCampaigns(_0x378a3a){if(!_[_0xe036('0x28')](_0x378a3a)){for(var _0x460576 in _0x378a3a){if(_0x378a3a[_0xe036('0x29')](_0x460576)){_0x378a3a[_0x460576][_0xe036('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x3be25f){if(!_[_0xe036('0x28')](_0x3be25f)){for(var _0x38903b in _0x3be25f){if(_0x3be25f[_0xe036('0x29')](_0x38903b)){_0x3be25f[_0x38903b][_0xe036('0x2a')]=0x0;_0x3be25f[_0x38903b][_0xe036('0x2b')]=0x0;_0x3be25f[_0x38903b][_0xe036('0x2c')]=0x0;_0x3be25f[_0x38903b][_0xe036('0x2d')]=0x0;_0x3be25f[_0x38903b][_0xe036('0x2e')]=!![];}}}}function clearAgentBooked(_0x2b767e){if(!_[_0xe036('0x28')](_0x2b767e)){for(var _0x17a0d6 in _0x2b767e){if(_0x2b767e[_0xe036('0x29')](_0x17a0d6)){_0x2b767e[_0x17a0d6][_0xe036('0x2f')]=!![];}}}}VoiceQueueReport[_0xe036('0xa')][_0xe036('0x30')]=function(){var _0x4ced38=this;for(var _0x522299 in this[_0xe036('0xe')]){if(this[_0xe036('0xe')][_0xe036('0x29')](_0x522299)&&!this[_0xe036('0xe')][_0x522299][_0xe036('0x31')]){this[_0xe036('0x32')][_0xe036('0x33')](function(){if(!_['isNil'](_0x4ced38['channels'][_0x522299])){return ami[_0xe036('0x34')]({'action':'status','channel':_0x4ced38['channels'][_0x522299][_0xe036('0x35')]})[_0xe036('0x36')](function(_0x79f034){if(_0x79f034['message']===_0xe036('0x37')){setTimeout(function(){if(_0x4ced38['channels'][_0x522299]){delete _0x4ced38['channels'][_0x522299];logger[_0xe036('0x38')](_0xe036('0x39'),_0x522299);}if(_0x4ced38['queueReports'][_0x522299]){delete _0x4ced38['queueReports'][_0x522299];logger[_0xe036('0x38')]('[voiceQueueReport][checkQueueReport]',_0x522299);}if(_0x4ced38[_0xe036('0x13')][_0x522299]){delete _0x4ced38['variables'][_0x522299];logger['error'](_0xe036('0x3a'),_0x522299);}},0x1f40);}});}});}}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x3b')]=function(){logger[_0xe036('0x38')](_0xe036('0x3c'));clearChannels(this[_0xe036('0xe')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0xe036('0xd')]);clearVoiceQueues(this[_0xe036('0x10')]);clearCampaigns(this[_0xe036('0x12')]);};VoiceQueueReport['prototype'][_0xe036('0x3d')]=function(_0x5eccb9){var _0x579af1=this;if(!_[_0xe036('0x28')](_0x5eccb9)){for(var _0x1585a8 in _0x5eccb9){if(_0x5eccb9[_0xe036('0x29')](_0x1585a8)){_0x579af1[_0xe036('0x3e')](_0x5eccb9[_0x1585a8]);delete _0x5eccb9[_0x1585a8];}}}};function loggerCatch(_0xef45cf){return function(_0x57aea6){logger[_0xe036('0x38')](_0xef45cf,util[_0xe036('0x3f')](_0x57aea6,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xe036('0xa')]['emit']=function(_0x53410d,_0x41b638,_0x5c24e4){io['to'](_0x53410d)['emit'](_0x41b638,_0x5c24e4);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x23791b){this[_0xe036('0x40')](util[_0xe036('0x41')](_0xe036('0x42'),_0x23791b['name']),'voice_queue_channel:save',_0x23791b);};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x3e')]=function(_0x404330){this[_0xe036('0x40')](util[_0xe036('0x41')](_0xe036('0x42'),_0x404330[_0xe036('0x43')]),_0xe036('0x44'),_0x404330);};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x45')]=function(_0x45bedf){if(_0x45bedf[_0xe036('0x46')]===_0xe036('0x47')){var _0x58a934={'id':_0x45bedf['id'],'name':_0x45bedf[_0xe036('0x43')],'strategy':_0x45bedf[_0xe036('0x48')],'answered':_0x45bedf[_0xe036('0x49')],'available':_0x45bedf[_0xe036('0x4a')],'loggedIn':_0x45bedf['loggedIn'],'pTalking':_0x45bedf[_0xe036('0x2c')],'sumBillable':_0x45bedf[_0xe036('0x4b')],'sumDuration':_0x45bedf[_0xe036('0x4c')],'sumHoldTime':_0x45bedf[_0xe036('0x4d')]||0x0,'talking':_0x45bedf[_0xe036('0x2b')],'total':_0x45bedf['total'],'type':_0x45bedf[_0xe036('0x46')],'unmanaged':_0x45bedf[_0xe036('0x4e')],'abandoned':_0x45bedf[_0xe036('0x4f')],'waiting':_0x45bedf['waiting']};if(_0x45bedf[_0xe036('0x50')]){_0x58a934[_0xe036('0x50')]={'id':_0x45bedf[_0xe036('0x50')]['id'],'name':_0x45bedf['Trunk'][_0xe036('0x43')],'active':_0x45bedf['Trunk'][_0xe036('0x51')],'callerid':_0x45bedf[_0xe036('0x50')][_0xe036('0x52')]};}if(_0x45bedf[_0xe036('0x53')]){_0x58a934[_0xe036('0x53')]={'id':_0x45bedf['Interval']['id'],'name':_0x45bedf[_0xe036('0x53')]['name']};}var _0x469abd=md5(JSON['stringify'](_0x58a934));if(_0x45bedf[_0xe036('0x3')]!==_0x469abd){_0x45bedf[_0xe036('0x3')]=_0x469abd;this[_0xe036('0x40')](util[_0xe036('0x41')](_0xe036('0x42'),_0x58a934[_0xe036('0x43')]),'voice_queue:save',_0x58a934);}}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x54')]=function(_0x240450){return _0x240450!==null&&!_[_0xe036('0x27')](_0x240450);};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x55')]=function(){var _0x5352ef=this;setInterval(function(){_0x5352ef[_0xe036('0x30')]();ami['Action']({'action':_0xe036('0x56')})[_0xe036('0x36')](loggerCatch(_0xe036('0x57')));},0x2710);};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x26')]=function(){var _0x452d75=this;setInterval(function(){if(_0x452d75[_0xe036('0x11')]){return ami['Action']({'action':_0xe036('0x14')})[_0xe036('0x58')](function(_0x8a7b31){_0x452d75[_0xe036('0x11')]=![];})['catch'](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x59')]=function(_0x2d756b){try{if(this[_0xe036('0x54')](_0x2d756b)&&this[_0xe036('0x54')](_0x2d756b['queue'])){if(this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]]){var _0x3476dd=_[_0xe036('0x5b')](this[_0xe036('0xe')],_0xe036('0x5a'))[_0x2d756b[_0xe036('0x5a')]]||0x0;var _0x1344eb=_0x3476dd-_0x2d756b['callers'];if(this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x2d')]!==_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x5d')])||this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x5e')]!==_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x5f')])||this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x4a')]!==_['toNumber'](_0x2d756b['available'])||this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]]['talking']!==_0x1344eb){this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x2d')]=_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x5d')]);this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]]['loggedIn']=_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x5f')]);this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x4a')]=_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x4a')]);this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x2b')]=_0x1344eb>0x0?_0x1344eb:0x0;this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x2b')]=this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]][_0xe036('0x2b')]>_[_0xe036('0x5c')](_0x2d756b['loggedin'])?_[_0xe036('0x5c')](_0x2d756b[_0xe036('0x5f')]):this[_0xe036('0x10')][_0x2d756b[_0xe036('0x5a')]]['talking'];this[_0xe036('0x45')](this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]]);}ami[_0xe036('0x40')](_0xe036('0x60'),this['voiceQueues'][_0x2d756b[_0xe036('0x5a')]]);}}}catch(_0x5ab05a){logger[_0xe036('0x38')](_0xe036('0x61'),util[_0xe036('0x3f')](_0x5ab05a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')]['syncQueueSummaryComplete']=function(_0x513694){this[_0xe036('0x11')]=!![];};VoiceQueueReport['prototype'][_0xe036('0x62')]=function(_0x507e7f){};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x18')]=function(_0x48f634){try{if(this[_0xe036('0x54')](_0x48f634)){if(_[_0xe036('0x27')](this[_0xe036('0xc')][_0x48f634['uniqueid']])){this[_0xe036('0xc')][_0x48f634[_0xe036('0x63')]]=[];this[_0xe036('0xe')][_0x48f634[_0xe036('0x63')]]={};}var _0x3642a1=new QueueReport();_0x3642a1['name']=_0x48f634[_0xe036('0x5a')];_0x3642a1[_0xe036('0x46')]=this[_0xe036('0x10')][_0x3642a1[_0xe036('0x43')]]&&this[_0xe036('0x10')][_0x3642a1['name']][_0xe036('0x46')]?this['voiceQueues'][_0x3642a1[_0xe036('0x43')]]['type']||_0xe036('0x47'):_0xe036('0x47');_0x3642a1[_0xe036('0x5a')]=_0x48f634[_0xe036('0x5a')];_0x3642a1[_0xe036('0x64')]=moment()[_0xe036('0x41')](_0xe036('0x65'));_0x3642a1['position']=_0x48f634[_0xe036('0x66')];_0x3642a1['count']=_0x48f634[_0xe036('0x67')];_['merge'](_0x3642a1,_[_0xe036('0x68')](_0x48f634,_[_0xe036('0x69')](_0x3642a1)));this[_0xe036('0xc')][_0x48f634[_0xe036('0x63')]]['push'](_0x3642a1);this[_0xe036('0xe')][_0x48f634['uniqueid']]=_0x3642a1;this[_0xe036('0x6a')](_0x3642a1);}}catch(_0x4333cc){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0x4333cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x1a')]=function(_0x373331){try{if(this['isNotNull'](_0x373331)){if(this[_0xe036('0xc')][_0x373331['uniqueid']]){var _0x5d5306=_[_0xe036('0x6b')](this[_0xe036('0xc')][_0x373331[_0xe036('0x63')]]);_0x5d5306[_0xe036('0x6c')]=![];_0x5d5306[_0xe036('0x6d')]=null;_0x5d5306[_0xe036('0x6e')]=_0x373331[_0xe036('0x6e')];_0x5d5306['originalposition']=_0x373331['originalposition'];_0x5d5306['queuecallerabandon']=!![];_0x5d5306['queuecallerabandonAt']=moment()[_0xe036('0x41')](_0xe036('0x65'));_0x5d5306['queuecallerexitreason']=_0xe036('0x6f');_0x5d5306['lastAssignedTo']=null;this['channels'][_0x373331['uniqueid']]=_0x5d5306;this[_0xe036('0x3e')](_0x5d5306);}}}catch(_0x1908b2){logger[_0xe036('0x38')](_0xe036('0x70'),util[_0xe036('0x3f')](_0x1908b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x71')]=function(_0xf1ca1f){try{if(this[_0xe036('0x54')](_0xf1ca1f)){if(this[_0xe036('0xc')][_0xf1ca1f['uniqueid']]){var _0x256eb4=_[_0xe036('0x6b')](this['queueReports'][_0xf1ca1f[_0xe036('0x63')]]);_0x256eb4['queuecallerleaveAt']=moment()[_0xe036('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x256eb4[_0xe036('0x72')]=_0xf1ca1f[_0xe036('0x72')];_0x256eb4[_0xe036('0x73')]=_0xf1ca1f['connectedlinename'];this[_0xe036('0xe')][_0xf1ca1f['uniqueid']]=_0x256eb4;this[_0xe036('0x6a')](_0x256eb4);}}}catch(_0xe8d885){logger[_0xe036('0x38')](_0xe036('0x74'),util[_0xe036('0x3f')](_0xe8d885,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x75')]=function(_0x441df0){try{if(this[_0xe036('0x54')](_0x441df0)){if(this[_0xe036('0xc')][_0x441df0['uniqueid']]){var _0x1cc626=_[_0xe036('0x6b')](this[_0xe036('0xc')][_0x441df0[_0xe036('0x63')]]);_0x1cc626[_0xe036('0x6c')]=!![];_0x1cc626['queuecallerexitreason']=_0xe036('0x76');}}}catch(_0x1befce){logger[_0xe036('0x38')]('[syncAgentConnect][VoiceQueueReport]',util[_0xe036('0x3f')](_0x1befce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x77')]=function(_0x934c1){try{if(this[_0xe036('0x54')](_0x934c1)){if(this['queueReports'][_0x934c1[_0xe036('0x63')]]){var _0x55ecf8=_[_0xe036('0x6b')](this[_0xe036('0xc')][_0x934c1[_0xe036('0x63')]]);_0x55ecf8[_0xe036('0x19')]=![];_0x55ecf8['queuecallerabandonAt']=null;_0x55ecf8[_0xe036('0x78')]=!![];_0x55ecf8['lastAssignedTo']=_0x934c1[_0xe036('0x79')];_0x55ecf8[_0xe036('0x6e')]=_0x934c1['holdtime'];_0x55ecf8[_0xe036('0x6c')]=!![];_0x55ecf8['queuecallerexit']=![];_0x55ecf8[_0xe036('0x7a')]=null;if(!_0x55ecf8[_0xe036('0x7b')]){if(_0x934c1[_0xe036('0x7c')]==_0xe036('0x7b')){_0x55ecf8['queuecallerexitreason']=_0xe036('0x7d');}else{if(_[_0xe036('0x7e')](_0x934c1[_0xe036('0x35')][_0xe036('0x7f')](),_0xe036('0x80'))){if(this[_0xe036('0xc')][_0x934c1[_0xe036('0x81')]]){var _0x566d83=_[_0xe036('0x6b')](this[_0xe036('0xc')][_0x934c1[_0xe036('0x81')]]);_0x566d83[_0xe036('0x6c')]=![];_0x566d83[_0xe036('0x82')]=!![];_0x566d83['queuecallerexitAt']=moment(_0x55ecf8[_0xe036('0x64')])[_0xe036('0x83')](_0x934c1[_0xe036('0x6e')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x566d83[_0xe036('0x84')]=_0xe036('0x85');_0x566d83[_0xe036('0x7b')]=!![];_0x566d83['transfertype']=_0xe036('0x86');_0x566d83[_0xe036('0x87')]=_0x934c1[_0xe036('0x88')];_0x566d83[_0xe036('0x89')]=_0x934c1[_0xe036('0x63')];var _0x9a3e7a=this[_0xe036('0xc')][_0x934c1[_0xe036('0x81')]];this[_0xe036('0xc')][_0x934c1[_0xe036('0x81')]]=this['queueReports'][_0x934c1[_0xe036('0x63')]];this[_0xe036('0xc')][_0x934c1[_0xe036('0x63')]]=_0x9a3e7a;}}else{_0x55ecf8[_0xe036('0x84')]=_0xe036('0x8a')+_0x934c1['reason'][_0xe036('0x8b')]();}}}this[_0xe036('0xe')][_0x934c1['uniqueid']]=_0x55ecf8;this[_0xe036('0x3e')](_0x55ecf8);}}}catch(_0x3a1dda){logger[_0xe036('0x38')]('[syncAgentComplete][VoiceQueueReport]',util[_0xe036('0x3f')](_0x3a1dda,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x8c')]=function(_0x2319e5){try{if(this['isNotNull'](_0x2319e5)){this[_0xe036('0x8d')](_0x2319e5['uniqueid'],_[_0xe036('0x69')](_0x2319e5[_0xe036('0x8e')])[0x0],_0x2319e5[_0xe036('0x8f')]);if(this[_0xe036('0xc')][_0x2319e5[_0xe036('0x63')]]){var _0xcea029=_[_0xe036('0x6b')](this[_0xe036('0xc')][_0x2319e5['uniqueid']]);if(_0xcea029){if(this[_0xe036('0x54')](_0x2319e5['variable'])&&this[_0xe036('0x54')](_0x2319e5[_0xe036('0x8e')][_0xe036('0x90')])){switch(_0x2319e5[_0xe036('0x8f')]){case _0xe036('0x91'):_0xcea029[_0xe036('0x82')]=![];_0xcea029[_0xe036('0x7a')]=null;break;default:_0xcea029['queuecallerexit']=!![];_0xcea029[_0xe036('0x7a')]=moment()[_0xe036('0x41')](_0xe036('0x65'));_0xcea029['queuecallerleaveAt']=moment()[_0xe036('0x41')](_0xe036('0x65'));}_0xcea029['queuecallerabandon']=![];_0xcea029[_0xe036('0x92')]=null;_0xcea029[_0xe036('0x84')]=_0x2319e5[_0xe036('0x8f')];this[_0xe036('0xe')][_0x2319e5['uniqueid']]=_0xcea029;this[_0xe036('0x3e')](_0xcea029);}else if(this['isNotNull'](_0x2319e5[_0xe036('0x8e')])&&this[_0xe036('0x54')](_0x2319e5[_0xe036('0x8e')][_0xe036('0x93')])){if(!_0xcea029[_0xe036('0x19')]){_0xcea029[_0xe036('0x82')]=!![];_0xcea029[_0xe036('0x7a')]=moment()[_0xe036('0x41')](_0xe036('0x65'));_0xcea029['queuecallerexitreason']=_0xe036('0x94');_0xcea029[_0xe036('0x95')]=moment()[_0xe036('0x41')](_0xe036('0x65'));this[_0xe036('0xe')][_0x2319e5[_0xe036('0x63')]]=_0xcea029;}}_0xcea029[_0xe036('0x13')]=this[_0xe036('0x13')][_0x2319e5['uniqueid']];}}}}catch(_0x2a7386){logger[_0xe036('0x38')](_0xe036('0x96'),util['inspect'](_0x2a7386,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x8d')]=function(_0x33dd82,_0x3b4c31,_0x2c2724){var _0x9a044e=[_0xe036('0x97'),_0xe036('0x98'),'rtpaudioqosjitter',_0xe036('0x99'),_0xe036('0x9a'),_0xe036('0x9b'),_0xe036('0x9c'),_0xe036('0x9d'),_0xe036('0x9e'),_0xe036('0x9f'),_0xe036('0xa0'),_0xe036('0xa1'),'membercalls','memberdynamic',_0xe036('0xa2'),_0xe036('0xa3'),'membername',_0xe036('0xa4'),_0xe036('0xa5')];if(!_[_0xe036('0xa6')](_0x3b4c31)&&!_[_0xe036('0xa7')](_0x9a044e,_0x3b4c31)){if(_[_0xe036('0x27')](this[_0xe036('0x13')][_0x33dd82])){this['variables'][_0x33dd82]={};}this['variables'][_0x33dd82][_0x3b4c31]=_0x2c2724;}};VoiceQueueReport[_0xe036('0xa')][_0xe036('0x1e')]=function(_0xfbee6a){try{if(this[_0xe036('0x54')](_0xfbee6a)){if(this['queueReports'][_0xfbee6a[_0xe036('0x63')]]){for(var _0x25894a=0x0,_0x39e6c9={};_0x25894a0x0?_0x4341dc:0x0;this[_0x6162('0x14')][_0x5b7dd1[_0x6162('0x64')]]['talking']=this[_0x6162('0x14')][_0x5b7dd1[_0x6162('0x64')]][_0x6162('0x33')]>_['toNumber'](_0x5b7dd1[_0x6162('0x69')])?_['toNumber'](_0x5b7dd1[_0x6162('0x69')]):this[_0x6162('0x14')][_0x5b7dd1[_0x6162('0x64')]][_0x6162('0x33')];this[_0x6162('0x4c')](this[_0x6162('0x14')][_0x5b7dd1[_0x6162('0x64')]]);}ami[_0x6162('0x47')](_0x6162('0x6a'),this[_0x6162('0x14')][_0x5b7dd1[_0x6162('0x64')]]);}}}catch(_0x1b4f40){logger['error']('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x1b4f40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6162('0xd')][_0x6162('0x1b')]=function(_0x136bc8){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x6162('0xd')][_0x6162('0x6b')]=function(_0x28daec){};VoiceQueueReport['prototype'][_0x6162('0x1e')]=function(_0xc106d4){try{if(this['isNotNull'](_0xc106d4)){if(_['isUndefined'](this[_0x6162('0x11')][_0xc106d4['uniqueid']])){this[_0x6162('0x11')][_0xc106d4[_0x6162('0x6c')]]=[];this[_0x6162('0x13')][_0xc106d4[_0x6162('0x6c')]]={};}var _0x1cb34b=new QueueReport();_0x1cb34b[_0x6162('0x4e')]=_0xc106d4[_0x6162('0x64')];_0x1cb34b['type']=this[_0x6162('0x14')][_0x1cb34b[_0x6162('0x4e')]]&&this[_0x6162('0x14')][_0x1cb34b[_0x6162('0x4e')]][_0x6162('0x4d')]?this[_0x6162('0x14')][_0x1cb34b[_0x6162('0x4e')]]['type']||_0x6162('0x6d'):_0x6162('0x6d');_0x1cb34b[_0x6162('0x64')]=_0xc106d4[_0x6162('0x64')];_0x1cb34b[_0x6162('0x6e')]=moment()[_0x6162('0x48')](_0x6162('0x6f'));_0x1cb34b[_0x6162('0x70')]=_0xc106d4[_0x6162('0x70')];_0x1cb34b[_0x6162('0x71')]=_0xc106d4['count'];_[_0x6162('0x72')](_0x1cb34b,_[_0x6162('0x73')](_0xc106d4,_[_0x6162('0x74')](_0x1cb34b)));this[_0x6162('0x11')][_0xc106d4[_0x6162('0x6c')]]['push'](_0x1cb34b);this[_0x6162('0x13')][_0xc106d4[_0x6162('0x6c')]]=_0x1cb34b;this[_0x6162('0x46')](_0x1cb34b);}}catch(_0x3facc8){logger['error'](_0x6162('0x75'),util[_0x6162('0x45')](_0x3facc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6162('0x1f')]=function(_0x4d0fc5){try{if(this['isNotNull'](_0x4d0fc5)){if(this[_0x6162('0x11')][_0x4d0fc5[_0x6162('0x6c')]]){var _0x3a0cb1=_[_0x6162('0x76')](this[_0x6162('0x11')][_0x4d0fc5[_0x6162('0x6c')]]);_0x3a0cb1['queuecallercomplete']=![];_0x3a0cb1[_0x6162('0x77')]=null;_0x3a0cb1[_0x6162('0x78')]=_0x4d0fc5[_0x6162('0x78')];_0x3a0cb1[_0x6162('0x79')]=_0x4d0fc5[_0x6162('0x79')];_0x3a0cb1[_0x6162('0x7a')]=!![];_0x3a0cb1[_0x6162('0x7b')]=moment()[_0x6162('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a0cb1[_0x6162('0x7c')]='ABANDONED';_0x3a0cb1[_0x6162('0x7d')]=null;this[_0x6162('0x13')][_0x4d0fc5[_0x6162('0x6c')]]=_0x3a0cb1;this[_0x6162('0x44')](_0x3a0cb1);}}}catch(_0x39a44b){logger[_0x6162('0x3e')](_0x6162('0x7e'),util[_0x6162('0x45')](_0x39a44b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6162('0xd')]['syncQueueCallerLeave']=function(_0x539f92){try{if(this[_0x6162('0x5d')](_0x539f92)){if(this['queueReports'][_0x539f92[_0x6162('0x6c')]]){var _0x29de67=_[_0x6162('0x76')](this['queueReports'][_0x539f92[_0x6162('0x6c')]]);_0x29de67[_0x6162('0x7f')]=moment()[_0x6162('0x48')](_0x6162('0x6f'));_0x29de67[_0x6162('0x80')]=_0x539f92[_0x6162('0x80')];_0x29de67[_0x6162('0x81')]=_0x539f92[_0x6162('0x81')];this[_0x6162('0x13')][_0x539f92[_0x6162('0x6c')]]=_0x29de67;this[_0x6162('0x46')](_0x29de67);}}}catch(_0x3b7c3b){logger[_0x6162('0x3e')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x6162('0x45')](_0x3b7c3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6162('0xd')][_0x6162('0x24')]=function(_0x238d0e){try{if(this['isNotNull'](_0x238d0e)){if(this['queueReports'][_0x238d0e[_0x6162('0x6c')]]){var _0x61534a=_[_0x6162('0x76')](this[_0x6162('0x11')][_0x238d0e[_0x6162('0x6c')]]);_0x61534a['queuecallercomplete']=!![];_0x61534a['queuecallerexitreason']=_0x6162('0x82');}}}catch(_0x628fff){logger[_0x6162('0x3e')](_0x6162('0x83'),util[_0x6162('0x45')](_0x628fff,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6162('0xd')][_0x6162('0x23')]=function(_0x25f75c){try{if(this[_0x6162('0x5d')](_0x25f75c)){if(this[_0x6162('0x11')][_0x25f75c[_0x6162('0x6c')]]){var _0x4f24b0=_['last'](this[_0x6162('0x11')][_0x25f75c[_0x6162('0x6c')]]);_0x4f24b0[_0x6162('0x7a')]=![];_0x4f24b0[_0x6162('0x7b')]=null;_0x4f24b0['assigned']=!![];_0x4f24b0['lastAssignedTo']=_0x25f75c[_0x6162('0x84')];_0x4f24b0[_0x6162('0x78')]=_0x25f75c[_0x6162('0x78')];_0x4f24b0[_0x6162('0x85')]=!![];_0x4f24b0[_0x6162('0x86')]=![];_0x4f24b0[_0x6162('0x87')]=null;if(!_0x4f24b0[_0x6162('0x88')]){if(_0x25f75c['reason']==_0x6162('0x88')){_0x4f24b0[_0x6162('0x7c')]=_0x6162('0x89');}else{if(_[_0x6162('0x8a')](_0x25f75c[_0x6162('0x8b')][_0x6162('0x8c')](),_0x6162('0x8d'))){if(this[_0x6162('0x11')][_0x25f75c['linkedid']]){var _0x5793d8=_[_0x6162('0x76')](this[_0x6162('0x11')][_0x25f75c[_0x6162('0x8e')]]);_0x5793d8[_0x6162('0x85')]=![];_0x5793d8[_0x6162('0x86')]=!![];_0x5793d8['queuecallerexitAt']=moment(_0x4f24b0[_0x6162('0x6e')])[_0x6162('0x8f')](_0x25f75c['holdtime'],_0x6162('0x90'))[_0x6162('0x48')](_0x6162('0x6f'));_0x5793d8[_0x6162('0x7c')]=_0x6162('0x91');_0x5793d8[_0x6162('0x88')]=!![];_0x5793d8[_0x6162('0x92')]=_0x6162('0x93');_0x5793d8[_0x6162('0x94')]=_0x25f75c[_0x6162('0x95')];_0x5793d8['transferuniqueid']=_0x25f75c['uniqueid'];var _0xa30151=this[_0x6162('0x11')][_0x25f75c['linkedid']];this['queueReports'][_0x25f75c[_0x6162('0x8e')]]=this['queueReports'][_0x25f75c['uniqueid']];this[_0x6162('0x11')][_0x25f75c[_0x6162('0x6c')]]=_0xa30151;}}else{_0x4f24b0[_0x6162('0x7c')]=_0x6162('0x96')+_0x25f75c[_0x6162('0x97')]['toUpperCase']();}}}this['channels'][_0x25f75c[_0x6162('0x6c')]]=_0x4f24b0;this['emitVoiceQueueChannelRemove'](_0x4f24b0);}}}catch(_0x4a4d46){logger[_0x6162('0x3e')](_0x6162('0x98'),util[_0x6162('0x45')](_0x4a4d46,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6162('0x25')]=function(_0x38b577){try{if(this[_0x6162('0x5d')](_0x38b577)){this[_0x6162('0x99')](_0x38b577[_0x6162('0x6c')],_['keys'](_0x38b577[_0x6162('0x9a')])[0x0],_0x38b577[_0x6162('0x9b')]);if(this['queueReports'][_0x38b577[_0x6162('0x6c')]]){var _0x2991a2=_['last'](this['queueReports'][_0x38b577[_0x6162('0x6c')]]);if(_0x2991a2){if(this['isNotNull'](_0x38b577[_0x6162('0x9a')])&&this[_0x6162('0x5d')](_0x38b577[_0x6162('0x9a')]['queuestatus'])){switch(_0x38b577[_0x6162('0x9b')]){case'CONTINUE':_0x2991a2[_0x6162('0x86')]=![];_0x2991a2[_0x6162('0x87')]=null;break;default:_0x2991a2['queuecallerexit']=!![];_0x2991a2[_0x6162('0x87')]=moment()[_0x6162('0x48')](_0x6162('0x6f'));_0x2991a2[_0x6162('0x7f')]=moment()[_0x6162('0x48')](_0x6162('0x6f'));}_0x2991a2[_0x6162('0x7a')]=![];_0x2991a2[_0x6162('0x7b')]=null;_0x2991a2[_0x6162('0x7c')]=_0x38b577[_0x6162('0x9b')];this[_0x6162('0x13')][_0x38b577['uniqueid']]=_0x2991a2;this[_0x6162('0x44')](_0x2991a2);}else if(this[_0x6162('0x5d')](_0x38b577[_0x6162('0x9a')])&&this[_0x6162('0x5d')](_0x38b577[_0x6162('0x9a')][_0x6162('0x9c')])){if(!_0x2991a2[_0x6162('0x7a')]){_0x2991a2[_0x6162('0x86')]=!![];_0x2991a2[_0x6162('0x87')]=moment()[_0x6162('0x48')](_0x6162('0x6f'));_0x2991a2[_0x6162('0x7c')]='EXITWITHKEY';_0x2991a2[_0x6162('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6162('0x13')][_0x38b577['uniqueid']]=_0x2991a2;}}_0x2991a2[_0x6162('0x17')]=this[_0x6162('0x17')][_0x38b577[_0x6162('0x6c')]];}}}}catch(_0x5abf73){logger[_0x6162('0x3e')](_0x6162('0x9d'),util[_0x6162('0x45')](_0x5abf73,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6162('0x99')]=function(_0x2fe1fd,_0x5c37e2,_0x3db0cb){var _0x4a7dc7=['rtpaudioqos',_0x6162('0x9e'),'rtpaudioqosjitter',_0x6162('0x9f'),_0x6162('0xa0'),_0x6162('0xa1'),_0x6162('0xa2'),_0x6162('0xa3'),'sipcallid','sipuri',_0x6162('0xa4'),_0x6162('0xa5'),_0x6162('0xa6'),_0x6162('0xa7'),_0x6162('0xa8'),_0x6162('0xa9'),'membername','memberpenalty',_0x6162('0xaa')];if(!_['isNil'](_0x5c37e2)&&!_[_0x6162('0xab')](_0x4a7dc7,_0x5c37e2)){if(_['isUndefined'](this[_0x6162('0x17')][_0x2fe1fd])){this[_0x6162('0x17')][_0x2fe1fd]={};}this[_0x6162('0x17')][_0x2fe1fd][_0x5c37e2]=_0x3db0cb;}};VoiceQueueReport[_0x6162('0xd')]['syncHangup']=function(_0x54d497){try{if(this[_0x6162('0x5d')](_0x54d497)){if(this[_0x6162('0x11')][_0x54d497[_0x6162('0x6c')]]){for(var _0x1f6ca0=0x0,_0x4a1cad={};_0x1f6ca0=0x0?moment(_0x366398[_0x1ba2('0x1b')])[_0x1ba2('0xf')](_0x366398[_0x1ba2('0x1a')],_0x1ba2('0x10')):null,'data1':'outbound','data2':_0x366398['accountcode'],'data3':_0x366398['exten'],'data4':_0x366398[_0x1ba2('0x1c')]||null,'role':_0x1ba2('0x15'),'internal':_0x366398[_0x1ba2('0x16')]?_[_0x1ba2('0x17')](_0x366398[_0x1ba2('0x16')]):undefined,'uniqueid':_0x366398[_0x1ba2('0x18')]},'log':_0x1ba2('0x6')});}; \ No newline at end of file +var _0xbc72=['starttime','endtime','diff','outbound','moment','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid'];(function(_0x38dc7d,_0x4f8c02){var _0x58dfbd=function(_0x3d7bbd){while(--_0x3d7bbd){_0x38dc7d['push'](_0x38dc7d['shift']());}};_0x58dfbd(++_0x4f8c02);}(_0xbc72,0x12d));var _0x2bc7=function(_0xdcfa84,_0x3ca7e9){_0xdcfa84=_0xdcfa84-0x0;var _0x5e9b64=_0xbc72[_0xdcfa84];return _0x5e9b64;};'use strict';var moment=require(_0x2bc7('0x0'));var _=require('lodash');var util=require(_0x2bc7('0x1'));var client=require(_0x2bc7('0x2'));exports['voiceQueueReport']=function(_0x2cea3a){var _0xea8562=_0x2cea3a[_0x2bc7('0x3')]||_0x2cea3a[_0x2bc7('0x4')];return client[_0x2bc7('0x5')](_0x2bc7('0x6'),{'body':{'channel':_0x2bc7('0x7'),'membername':_0x2cea3a[_0x2bc7('0x8')],'interface':_[_0x2bc7('0x9')](_0x2cea3a[_0x2bc7('0xa')])?util[_0x2bc7('0xb')](_0x2bc7('0xc'),_0x2cea3a[_0x2bc7('0x8')]):_0x2cea3a[_0x2bc7('0xa')],'type':_0x2bc7('0xd'),'enterAt':_0x2cea3a[_0x2bc7('0xe')],'exitAt':_0xea8562,'duration':moment(_0xea8562)['diff'](_0x2cea3a['queuecallerleaveAt'],_0x2bc7('0xf')),'data1':'inbound','data2':_0x2cea3a[_0x2bc7('0x10')],'data3':_0x2cea3a[_0x2bc7('0x11')],'data4':null,'data5':_0x2cea3a[_0x2bc7('0x12')],'role':_0x2bc7('0x13'),'internal':_0x2cea3a[_0x2bc7('0x14')]?_[_0x2bc7('0x15')](_0x2cea3a[_0x2bc7('0x14')]):undefined,'uniqueid':_0x2cea3a[_0x2bc7('0x16')]},'log':_0x2bc7('0x6')});};exports['voiceDialReport']=function(_0x4e7b9b){return client[_0x2bc7('0x5')](_0x2bc7('0x6'),{'body':{'channel':_0x2bc7('0x7'),'membername':_0x4e7b9b['membername'],'interface':_0x4e7b9b['interface'],'type':_0x2bc7('0xd'),'enterAt':_0x4e7b9b[_0x2bc7('0x17')],'exitAt':_0x4e7b9b[_0x2bc7('0x18')],'duration':moment(_0x4e7b9b[_0x2bc7('0x18')])['diff'](_0x4e7b9b['starttime'],_0x2bc7('0xf'))>=0x0?moment(_0x4e7b9b[_0x2bc7('0x18')])[_0x2bc7('0x19')](_0x4e7b9b[_0x2bc7('0x17')],'seconds'):null,'data1':_0x2bc7('0x1a'),'data2':_0x4e7b9b[_0x2bc7('0x14')],'data3':_0x4e7b9b['exten'],'data4':_0x4e7b9b['dialstring']||null,'role':_0x2bc7('0x13'),'internal':_0x4e7b9b[_0x2bc7('0x14')]?_['toNumber'](_0x4e7b9b[_0x2bc7('0x14')]):undefined,'uniqueid':_0x4e7b9b[_0x2bc7('0x16')]},'log':_0x2bc7('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 2b91bb8..164691b 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 _0x6e27=['name','html','getTemplates','Request','GetTemplate'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x6e27,0x115));var _0x76e2=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0x6e27[_0x5e2b34];return _0x4859f9;};'use strict';var client=require('../client');exports[_0x76e2('0x0')]=function(_0x334a57){return function(_0x2ebfad){return client[_0x76e2('0x1')](_0x76e2('0x2'),{'options':{'raw':!![],'attributes':['id',_0x76e2('0x3'),_0x76e2('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x3245=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x2bfee5,_0x25d60f){var _0x1b9686=function(_0x2fadd7){while(--_0x2fadd7){_0x2bfee5['push'](_0x2bfee5['shift']());}};_0x1b9686(++_0x25d60f);}(_0x3245,0xaa));var _0x5324=function(_0x1c0faa,_0x4d20f2){_0x1c0faa=_0x1c0faa-0x0;var _0x441653=_0x3245[_0x1c0faa];return _0x441653;};'use strict';var client=require(_0x5324('0x0'));exports[_0x5324('0x1')]=function(_0x1d04a4){return function(_0x3dfade){return client[_0x5324('0x2')](_0x5324('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5324('0x4'),_0x5324('0x5')]},'log':_0x5324('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 2f0e00b..9a79cd3 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x290c1e,_0x4b67ac){var _0x2ca38a=function(_0x2c5419){while(--_0x2c5419){_0x290c1e['push'](_0x290c1e['shift']());}};_0x2ca38a(++_0x4b67ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x270fef,_0x49ee89){var _0x6cb5e5=function(_0x4c0283){while(--_0x4c0283){_0x270fef['push'](_0x270fef['shift']());}};_0x6cb5e5(++_0x49ee89);}(_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(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e7f15b7..31a9b22 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 _0x875d=['../client','GetTrunk','name','registry'];(function(_0x371e9f,_0x356145){var _0x18e8ba=function(_0x1b21f6){while(--_0x1b21f6){_0x371e9f['push'](_0x371e9f['shift']());}};_0x18e8ba(++_0x356145);}(_0x875d,0xc0));var _0xd875=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x875d[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0xd875('0x0'));exports['getTrunks']=function(_0x4a5e0b){return function(_0x453f01){return client['Request'](_0xd875('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd875('0x2'),_0xd875('0x3')]},'log':_0xd875('0x1')});};}; \ No newline at end of file +var _0xd8a8=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd8a8,0x1cb));var _0x8d8a=function(_0x17c8e6,_0x427b6b){_0x17c8e6=_0x17c8e6-0x0;var _0x2a75ca=_0xd8a8[_0x17c8e6];return _0x2a75ca;};'use strict';var client=require(_0x8d8a('0x0'));exports[_0x8d8a('0x1')]=function(_0x2ef78b){return function(_0x1029ae){return client[_0x8d8a('0x2')](_0x8d8a('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8d8a('0x4'),_0x8d8a('0x5')]},'log':_0x8d8a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 5eb28fd..ac81958 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 _0x1676=['lastLoginAt','lastPauseAt','phone','getTelephones','telephone','name','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','fullname','pauseType','voicePause','interface','../client','getAgents','Request','GetUser','agent','email','accountcode','online'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x1676,0x75));var _0x6167=function(_0x3ed25d,_0x6387bf){_0x3ed25d=_0x3ed25d-0x0;var _0x2d1d26=_0x1676[_0x3ed25d];return _0x2d1d26;};'use strict';var client=require(_0x6167('0x0'));exports[_0x6167('0x1')]=function(){return function(){return client[_0x6167('0x2')](_0x6167('0x3'),{'options':{'raw':![],'where':{'role':_0x6167('0x4')},'attributes':['id','name',_0x6167('0x5'),_0x6167('0x6'),'fullname',_0x6167('0x7'),_0x6167('0x8'),'pauseType',_0x6167('0x9'),'voicePause',_0x6167('0xa'),'mobile','interface']},'log':_0x6167('0x1')});};};exports[_0x6167('0xb')]=function(){return function(){return client['Request'](_0x6167('0x3'),{'options':{'raw':!![],'where':{'role':_0x6167('0xc')},'attributes':['id',_0x6167('0xd'),_0x6167('0x6'),_0x6167('0xe')]},'log':_0x6167('0xb')});};};exports[_0x6167('0xf')]=function(_0x497973,_0x2c3d5c,_0x3c17ec){return client[_0x6167('0x2')](_0x6167('0x10'),{'body':{'type':_0x2c3d5c,'uniqueid':_0x3c17ec},'options':{'where':{'id':_0x497973['id']}},'log':'savePause'});};exports[_0x6167('0x11')]=function(_0x1d44ed){return client['Request'](_0x6167('0x12'),{'body':{},'options':{'where':{'id':_0x1d44ed['id']}},'log':_0x6167('0xf')});};exports[_0x6167('0x13')]=function(_0xd0d40f){return client['Request'](_0x6167('0x14'),{'options':{'raw':![],'where':{'role':'agent','id':_0xd0d40f},'attributes':['id',_0x6167('0xd'),_0x6167('0x5'),_0x6167('0x6'),_0x6167('0x15'),_0x6167('0x7'),'lastLoginAt',_0x6167('0x16'),'lastPauseAt',_0x6167('0x17'),_0x6167('0x18')]},'log':_0x6167('0x13')});}; \ No newline at end of file +var _0xd019=['internal','savePause','PauseUser','saveUnpause','getAgent','ShowUser','fullname','../client','Request','agent','name','email','online','lastLoginAt','pauseType','lastPauseAt','voicePause','mobile','interface','getAgents','getTelephones','GetUser','accountcode'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xd019,0x18e));var _0x9d01=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xd019[_0x339129];return _0x1570df;};'use strict';var client=require(_0x9d01('0x0'));exports['getAgents']=function(){return function(){return client[_0x9d01('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':_0x9d01('0x2')},'attributes':['id',_0x9d01('0x3'),_0x9d01('0x4'),'accountcode','fullname',_0x9d01('0x5'),_0x9d01('0x6'),_0x9d01('0x7'),_0x9d01('0x8'),_0x9d01('0x9'),'phone',_0x9d01('0xa'),_0x9d01('0xb')]},'log':_0x9d01('0xc')});};};exports[_0x9d01('0xd')]=function(){return function(){return client[_0x9d01('0x1')](_0x9d01('0xe'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0x9d01('0xf'),_0x9d01('0x10')]},'log':_0x9d01('0xd')});};};exports[_0x9d01('0x11')]=function(_0x44fbda,_0x11d64a,_0x1803b6){return client[_0x9d01('0x1')](_0x9d01('0x12'),{'body':{'type':_0x11d64a,'uniqueid':_0x1803b6},'options':{'where':{'id':_0x44fbda['id']}},'log':_0x9d01('0x11')});};exports[_0x9d01('0x13')]=function(_0x3b4f00){return client[_0x9d01('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x3b4f00['id']}},'log':_0x9d01('0x11')});};exports[_0x9d01('0x14')]=function(_0x15c5cf){return client[_0x9d01('0x1')](_0x9d01('0x15'),{'options':{'raw':![],'where':{'role':'agent','id':_0x15c5cf},'attributes':['id',_0x9d01('0x3'),_0x9d01('0x4'),_0x9d01('0xf'),_0x9d01('0x16'),_0x9d01('0x5'),_0x9d01('0x6'),_0x9d01('0x7'),_0x9d01('0x8'),'voicePause',_0x9d01('0xb')]},'log':_0x9d01('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 7139830..6eb3a7a 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 _0x66ff=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x3d1085,_0x225392){var _0x40e5a1=function(_0x38ec8c){while(--_0x38ec8c){_0x3d1085['push'](_0x3d1085['shift']());}};_0x40e5a1(++_0x225392);}(_0x66ff,0xd6));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf66f('0x0'));exports['create']=function(_0x515a3d){return client['Request'](_0xf66f('0x1'),{'body':_0x515a3d,'log':_0xf66f('0x1')});};exports[_0xf66f('0x2')]=function(_0x4a2c08,_0x1c69b1,_0x1aea1e){return client[_0xf66f('0x3')](_0xf66f('0x4'),{'body':_0x4a2c08,'options':{'where':{'uniqueid':_0x1c69b1,'interface':_0x1aea1e}},'log':_0xf66f('0x4')});}; \ No newline at end of file +var _0xb64c=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb64c,0x85));var _0xcb64=function(_0x2d68b8,_0xe4fc22){_0x2d68b8=_0x2d68b8-0x0;var _0x16bc48=_0xb64c[_0x2d68b8];return _0x16bc48;};'use strict';var client=require(_0xcb64('0x0'));exports[_0xcb64('0x1')]=function(_0x201afd){return client[_0xcb64('0x2')]('CreateVoiceAgentReport',{'body':_0x201afd,'log':_0xcb64('0x3')});};exports[_0xcb64('0x4')]=function(_0x40ab91,_0x3e9d1e,_0x294839){return client[_0xcb64('0x2')](_0xcb64('0x5'),{'body':_0x40ab91,'options':{'where':{'uniqueid':_0x3e9d1e,'interface':_0x294839}},'log':_0xcb64('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5b26d61..0ed317c 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 _0x6af6=['../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','moment','lodash'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x6af6,0x139));var _0x66af=function(_0x32fc89,_0x4faf5a){_0x32fc89=_0x32fc89-0x0;var _0x55f492=_0x6af6[_0x32fc89];return _0x55f492;};'use strict';var moment=require(_0x66af('0x0'));var util=require('util');var _=require(_0x66af('0x1'));var client=require(_0x66af('0x2'));exports[_0x66af('0x3')]=function(_0xb2f969){return client[_0x66af('0x4')](_0x66af('0x5'),{'body':_[_0x66af('0x6')](_0xb2f969,{'source':_0xb2f969[_0x66af('0x7')],'destinationcontext':_0xb2f969[_0x66af('0x8')],'callerid':_0xb2f969[_0x66af('0x9')],'amaflags':_0x66af('0xa')}),'log':_0x66af('0x5')});};exports[_0x66af('0xb')]=function(){return function(){return client[_0x66af('0x4')](_0x66af('0xc'),{'options':{'where':{'type':[_0x66af('0xd')],'createdAt':{'$between':[moment()[_0x66af('0xe')](_0x66af('0xf'))[_0x66af('0x10')](_0x66af('0x11')),moment()['endOf'](_0x66af('0xf'))['format'](_0x66af('0x11'))]}},'attributes':['type',_0x66af('0x12'),_0x66af('0x13'),_0x66af('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x6746=['outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x6746,0xbd));var _0x6674=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x6746[_0x44268d];return _0x4be92d;};'use strict';var moment=require(_0x6674('0x0'));var util=require(_0x6674('0x1'));var _=require(_0x6674('0x2'));var client=require('../client');exports[_0x6674('0x3')]=function(_0x5070a7){return client[_0x6674('0x4')](_0x6674('0x5'),{'body':_[_0x6674('0x6')](_0x5070a7,{'source':_0x5070a7['calleridnum'],'destinationcontext':_0x5070a7[_0x6674('0x7')],'callerid':_0x5070a7[_0x6674('0x8')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x6674('0x9')]=function(){return function(){return client[_0x6674('0x4')](_0x6674('0xa'),{'options':{'where':{'type':[_0x6674('0xb')],'createdAt':{'$between':[moment()[_0x6674('0xc')](_0x6674('0xd'))['format'](_0x6674('0xe')),moment()[_0x6674('0xf')](_0x6674('0xd'))[_0x6674('0x10')](_0x6674('0xe'))]}},'attributes':['type','disposition',_0x6674('0x11'),_0x6674('0x12')]},'log':_0x6674('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b87b39f..2b2aa4b 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 _0x59c1=['CreateVoiceDialReport','../client','create'];(function(_0x2af850,_0x5a9181){var _0x537c1d=function(_0x15bdb6){while(--_0x15bdb6){_0x2af850['push'](_0x2af850['shift']());}};_0x537c1d(++_0x5a9181);}(_0x59c1,0x18d));var _0x159c=function(_0x2c816e,_0x82a6b3){_0x2c816e=_0x2c816e-0x0;var _0x316fd2=_0x59c1[_0x2c816e];return _0x316fd2;};'use strict';var client=require(_0x159c('0x0'));exports[_0x159c('0x1')]=function(_0x7247c4){return client['Request'](_0x159c('0x2'),{'body':_0x7247c4,'log':_0x159c('0x2')});}; \ No newline at end of file +var _0x49cf=['CreateVoiceDialReport','../client','create'];(function(_0x5e604d,_0x2a1d27){var _0x3b3129=function(_0x2efef7){while(--_0x2efef7){_0x5e604d['push'](_0x5e604d['shift']());}};_0x3b3129(++_0x2a1d27);}(_0x49cf,0x1db));var _0xf49c=function(_0x3d36e7,_0xf71a7f){_0x3d36e7=_0x3d36e7-0x0;var _0x5b4f9c=_0x49cf[_0x3d36e7];return _0x5b4f9c;};'use strict';var client=require(_0xf49c('0x0'));exports[_0xf49c('0x1')]=function(_0x4434a9){return client['Request'](_0xf49c('0x2'),{'body':_0x4434a9,'log':_0xf49c('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e120151..ad1265a 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 _0xaf61=['../client','getVoiceExtensions','Request','exten','recordingFormat'];(function(_0x44634e,_0x27d114){var _0x1f0073=function(_0x579fdf){while(--_0x579fdf){_0x44634e['push'](_0x44634e['shift']());}};_0x1f0073(++_0x27d114);}(_0xaf61,0x11d));var _0x1af6=function(_0x5be609,_0x4777c7){_0x5be609=_0x5be609-0x0;var _0x184c34=_0xaf61[_0x5be609];return _0x184c34;};'use strict';var client=require(_0x1af6('0x0'));exports[_0x1af6('0x1')]=function(){return function(){return client[_0x1af6('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x1af6('0x3'),_0x1af6('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x1af6('0x1')});};}; \ No newline at end of file +var _0xc02a=['getVoiceExtensions','exten','../client'];(function(_0x2f4ca9,_0x52c620){var _0x1bcfc2=function(_0x492a12){while(--_0x492a12){_0x2f4ca9['push'](_0x2f4ca9['shift']());}};_0x1bcfc2(++_0x52c620);}(_0xc02a,0x1f1));var _0xac02=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xc02a[_0x5519a9];return _0x32f2cc;};'use strict';var client=require(_0xac02('0x0'));exports[_0xac02('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xac02('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xac02('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index ce0b268..5fcd1d1 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 _0xb7c2=['dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject'];(function(_0x5d99dd,_0x4bb40b){var _0x148a26=function(_0x25df5f){while(--_0x25df5f){_0x5d99dd['push'](_0x5d99dd['shift']());}};_0x148a26(++_0x4bb40b);}(_0xb7c2,0x13d));var _0x2b7c=function(_0x5cd71d,_0xe2122b){_0x5cd71d=_0x5cd71d-0x0;var _0x4f8c12=_0xb7c2[_0x5cd71d];return _0x4f8c12;};'use strict';var client=require(_0x2b7c('0x0'));exports[_0x2b7c('0x1')]=function(){return function(){return client[_0x2b7c('0x2')](_0x2b7c('0x3'),{'options':{'raw':![],'attributes':['id',_0x2b7c('0x4'),_0x2b7c('0x5'),_0x2b7c('0x6'),_0x2b7c('0x7'),'monitor_format',_0x2b7c('0x8'),_0x2b7c('0x9'),_0x2b7c('0xa'),'dialLimitChannel','dialLimitQueue',_0x2b7c('0xb'),'dialPredictiveOptimization',_0x2b7c('0xc'),_0x2b7c('0xd'),'dialOriginateCallerIdName',_0x2b7c('0xe'),_0x2b7c('0xf'),_0x2b7c('0x10'),_0x2b7c('0x11'),_0x2b7c('0x12'),_0x2b7c('0x13'),'dialCongestionRetryFrequency',_0x2b7c('0x14'),_0x2b7c('0x15'),_0x2b7c('0x16'),_0x2b7c('0x17'),_0x2b7c('0x18'),'dialTimezone',_0x2b7c('0x19'),_0x2b7c('0x1a'),_0x2b7c('0x1b'),_0x2b7c('0x1c'),_0x2b7c('0x1d'),'dialAMDGreeting',_0x2b7c('0x1e'),_0x2b7c('0x1f'),_0x2b7c('0x20'),_0x2b7c('0x21'),_0x2b7c('0x22'),_0x2b7c('0x23'),_0x2b7c('0x24'),_0x2b7c('0x25'),_0x2b7c('0x26'),'dialRecallInQueue',_0x2b7c('0x27'),_0x2b7c('0x28'),_0x2b7c('0x29'),_0x2b7c('0x2a'),_0x2b7c('0x2b'),_0x2b7c('0x2c'),_0x2b7c('0x2d'),_0x2b7c('0x2e'),_0x2b7c('0x2f'),_0x2b7c('0x30'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x2b7c('0x31'),'as':_0x2b7c('0x31'),'attributes':['id','name',_0x2b7c('0x32'),_0x2b7c('0x33')]},{'model':_0x2b7c('0x34'),'as':_0x2b7c('0x35'),'attributes':['id','name']},{'model':_0x2b7c('0x31'),'as':_0x2b7c('0x36'),'attributes':['id',_0x2b7c('0x4'),_0x2b7c('0x32'),_0x2b7c('0x33')]},{'model':_0x2b7c('0x37'),'as':_0x2b7c('0x37'),'attributes':['id','name'],'include':[{'model':_0x2b7c('0x37'),'as':'Intervals','attributes':['id',_0x2b7c('0x4'),'interval']}]}]},'log':_0x2b7c('0x1')});};}; \ No newline at end of file +var _0x2b65=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x3075db,_0x117111){var _0x35d5d8=function(_0xe48a5c){while(--_0xe48a5c){_0x3075db['push'](_0x3075db['shift']());}};_0x35d5d8(++_0x117111);}(_0x2b65,0xc3));var _0x52b6=function(_0x5a4bfa,_0x87f1fd){_0x5a4bfa=_0x5a4bfa-0x0;var _0x31c1e4=_0x2b65[_0x5a4bfa];return _0x31c1e4;};'use strict';var client=require(_0x52b6('0x0'));exports[_0x52b6('0x1')]=function(){return function(){return client[_0x52b6('0x2')](_0x52b6('0x3'),{'options':{'raw':![],'attributes':['id',_0x52b6('0x4'),_0x52b6('0x5'),'acwTimeout',_0x52b6('0x6'),_0x52b6('0x7'),'type',_0x52b6('0x8'),_0x52b6('0x9'),'dialLimitChannel',_0x52b6('0xa'),'dialPowerLevel',_0x52b6('0xb'),_0x52b6('0xc'),_0x52b6('0xd'),_0x52b6('0xe'),_0x52b6('0xf'),_0x52b6('0x10'),'dialQueueOptions',_0x52b6('0x11'),_0x52b6('0x12'),_0x52b6('0x13'),_0x52b6('0x14'),_0x52b6('0x15'),_0x52b6('0x16'),_0x52b6('0x17'),_0x52b6('0x18'),_0x52b6('0x19'),_0x52b6('0x1a'),_0x52b6('0x1b'),'dialPrefix','dialCheckDuplicateType','dialAMDActive',_0x52b6('0x1c'),_0x52b6('0x1d'),_0x52b6('0x1e'),_0x52b6('0x1f'),_0x52b6('0x20'),_0x52b6('0x21'),_0x52b6('0x22'),_0x52b6('0x23'),_0x52b6('0x24'),_0x52b6('0x25'),'dialRecallMeTimeout',_0x52b6('0x26'),_0x52b6('0x27'),_0x52b6('0x28'),'dialAgiAfterHangupClient',_0x52b6('0x29'),_0x52b6('0x7'),_0x52b6('0x2a'),_0x52b6('0x2b'),_0x52b6('0x2c'),_0x52b6('0x2d'),_0x52b6('0x2e'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x52b6('0x2f'),'as':_0x52b6('0x2f'),'attributes':['id',_0x52b6('0x4'),'callerid',_0x52b6('0x30')]},{'model':_0x52b6('0x31'),'as':_0x52b6('0x32'),'attributes':['id',_0x52b6('0x4')]},{'model':_0x52b6('0x2f'),'as':_0x52b6('0x33'),'attributes':['id',_0x52b6('0x4'),'callerid',_0x52b6('0x30')]},{'model':_0x52b6('0x34'),'as':_0x52b6('0x34'),'attributes':['id',_0x52b6('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x52b6('0x4'),_0x52b6('0x35')]}]}]},'log':_0x52b6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index df072d0..e542d4b 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 _0x5294=['moment','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports'];(function(_0xd379c0,_0x23ad75){var _0x494bec=function(_0x1bb90a){while(--_0x1bb90a){_0xd379c0['push'](_0xd379c0['shift']());}};_0x494bec(++_0x23ad75);}(_0x5294,0x156));var _0x4529=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5294[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x4529('0x0'));var _=require('lodash');var client=require(_0x4529('0x1'));exports[_0x4529('0x2')]=function(_0x14e3de){return client[_0x4529('0x3')](_0x4529('0x4'),{'body':_0x14e3de,'log':_0x4529('0x4')});};exports[_0x4529('0x5')]=function(){return function(){return client[_0x4529('0x3')](_0x4529('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x4529('0x7'))[_0x4529('0x8')](_0x4529('0x9')),moment()[_0x4529('0xa')]('day')[_0x4529('0x8')](_0x4529('0x9'))]}},'attributes':['uniqueid','queue',_0x4529('0xb'),_0x4529('0xc'),'queuecallercomplete',_0x4529('0xd'),_0x4529('0xe'),_0x4529('0xf'),'queuecallerabandon',_0x4529('0x10')]},'log':_0x4529('0x11')});};}; \ No newline at end of file +var _0xe238=['queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27f956,_0x249687){var _0x116844=function(_0x28397a){while(--_0x28397a){_0x27f956['push'](_0x27f956['shift']());}};_0x116844(++_0x249687);}(_0xe238,0x1c2));var _0x8e23=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe238[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0x8e23('0x0'));var _=require(_0x8e23('0x1'));var client=require(_0x8e23('0x2'));exports[_0x8e23('0x3')]=function(_0x383484){return client[_0x8e23('0x4')]('CreateVoiceQueueReport',{'body':_0x383484,'log':_0x8e23('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x8e23('0x6'))[_0x8e23('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x8e23('0x6'))['format'](_0x8e23('0x8'))]}},'attributes':['uniqueid','queue',_0x8e23('0x9'),_0x8e23('0xa'),_0x8e23('0xb'),_0x8e23('0xc'),_0x8e23('0xd'),_0x8e23('0xe'),'queuecallerabandon',_0x8e23('0xf')]},'log':_0x8e23('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 160fb12..3294c03 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 _0x24fc=['Request','getVoiceQueueRtPauses','../client'];(function(_0x2f8eea,_0x18e3ea){var _0x5f26b6=function(_0x562767){while(--_0x562767){_0x2f8eea['push'](_0x2f8eea['shift']());}};_0x5f26b6(++_0x18e3ea);}(_0x24fc,0x12b));var _0xc24f=function(_0x3bf625,_0x1041b4){_0x3bf625=_0x3bf625-0x0;var _0x128e59=_0x24fc[_0x3bf625];return _0x128e59;};'use strict';var client=require(_0xc24f('0x0'));exports['getVoiceQueueRtPauses']=function(_0x20c4e9){return function(){return client[_0xc24f('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x20c4e9,'paused':!![]},'raw':!![]},'log':_0xc24f('0x2')});};}; \ No newline at end of file +var _0x789a=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x789a,0xa1));var _0xa789=function(_0x596d96,_0x53a108){_0x596d96=_0x596d96-0x0;var _0x54b7ae=_0x789a[_0x596d96];return _0x54b7ae;};'use strict';var client=require('../client');exports[_0xa789('0x0')]=function(_0x44cfeb){return function(){return client['Request'](_0xa789('0x1'),{'options':{'where':{'VoiceQueueId':_0x44cfeb,'paused':!![]},'raw':!![]},'log':_0xa789('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7dd2c7d..25e6405 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 _0x0c30=['CreateVoiceRecording','merge','lodash','create'];(function(_0x20241e,_0x4b0e9c){var _0x43cd2d=function(_0x4e7d72){while(--_0x4e7d72){_0x20241e['push'](_0x20241e['shift']());}};_0x43cd2d(++_0x4b0e9c);}(_0x0c30,0x7a));var _0x00c3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0c30[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x00c3('0x0'));var client=require('../client');exports[_0x00c3('0x1')]=function(_0x430f50){return client['Request'](_0x00c3('0x2'),{'body':_[_0x00c3('0x3')](_0x430f50,{'value':_0x430f50['monitorFilename']}),'log':_0x00c3('0x2')});}; \ No newline at end of file +var _0x9773=['monitorFilename','lodash','../client','create','Request','CreateVoiceRecording','merge'];(function(_0x2d548b,_0x4a16f7){var _0x92a518=function(_0x27c3bb){while(--_0x27c3bb){_0x2d548b['push'](_0x2d548b['shift']());}};_0x92a518(++_0x4a16f7);}(_0x9773,0xfd));var _0x3977=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9773[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3977('0x0'));var client=require(_0x3977('0x1'));exports[_0x3977('0x2')]=function(_0x27168d){return client[_0x3977('0x3')](_0x3977('0x4'),{'body':_[_0x3977('0x5')](_0x27168d,{'value':_0x27168d[_0x3977('0x6')]}),'log':_0x3977('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 9cc8fa0..4e4922d 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 _0x8648=['transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result'];(function(_0x28bea5,_0x4c0c43){var _0x33194c=function(_0x453df2){while(--_0x453df2){_0x28bea5['push'](_0x28bea5['shift']());}};_0x33194c(++_0x4c0c43);}(_0x8648,0x10c));var _0x8864=function(_0x39cad2,_0x572fb1){_0x39cad2=_0x39cad2-0x0;var _0x44f0a0=_0x8648[_0x39cad2];return _0x44f0a0;};'use strict';var client=require(_0x8864('0x0'));exports[_0x8864('0x1')]=function(_0xe2dbe5){return client[_0x8864('0x2')](_0x8864('0x3'),{'body':{'result':_0xe2dbe5[_0x8864('0x4')],'transfererchannel':_0xe2dbe5[_0x8864('0x5')],'transferercalleridnum':_0xe2dbe5[_0x8864('0x6')],'transferercalleridname':_0xe2dbe5['transferercalleridname'],'transfererconnectedlinenum':_0xe2dbe5[_0x8864('0x7')],'transfererconnectedlinename':_0xe2dbe5['transfererconnectedlinename'],'transfereraccountcode':_0xe2dbe5[_0x8864('0x8')],'transferercontext':_0xe2dbe5['transferercontext'],'transfererexten':_0xe2dbe5[_0x8864('0x9')],'transfererlinkedid':_0xe2dbe5['transfererlinkedid'],'transfereechannel':_0xe2dbe5['transfereechannel'],'transfereecalleridnum':_0xe2dbe5[_0x8864('0xa')],'transfereecalleridname':_0xe2dbe5[_0x8864('0xb')],'transfereeconnectedlinenum':_0xe2dbe5[_0x8864('0xc')],'transfereeconnectedlinename':_0xe2dbe5[_0x8864('0xd')],'transfereeaccountcode':_0xe2dbe5['transfereeaccountcode'],'transfereecontext':_0xe2dbe5[_0x8864('0xe')],'transfereeexten':_0xe2dbe5['transfereeexten'],'transfereelinkedid':_0xe2dbe5[_0x8864('0xf')],'isexternal':_0xe2dbe5[_0x8864('0x10')],'context':_0xe2dbe5[_0x8864('0x11')],'extension':_0xe2dbe5[_0x8864('0x12')],'type':_0x8864('0x13')},'log':_0x8864('0x3')});};exports[_0x8864('0x14')]=function(_0x2530a7){return client[_0x8864('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2530a7['result'],'transfererchannel':_0x2530a7[_0x8864('0x15')],'transferercalleridnum':_0x2530a7[_0x8864('0x16')],'transferercalleridname':_0x2530a7[_0x8864('0x17')],'transfererconnectedlinenum':_0x2530a7[_0x8864('0x18')],'transfererconnectedlinename':_0x2530a7[_0x8864('0x19')],'transfereraccountcode':_0x2530a7['origtransfereraccountcode'],'transferercontext':_0x2530a7[_0x8864('0x1a')],'transfererexten':_0x2530a7[_0x8864('0x1b')],'transfererlinkedid':_0x2530a7[_0x8864('0x1c')],'transfereechannel':_0x2530a7[_0x8864('0x1d')],'transfereecalleridnum':_0x2530a7[_0x8864('0x1e')],'transfereecalleridname':_0x2530a7[_0x8864('0x1f')],'transfereeconnectedlinenum':_0x2530a7[_0x8864('0x20')],'transfereeconnectedlinename':_0x2530a7[_0x8864('0x21')],'transfereeaccountcode':_0x2530a7[_0x8864('0x22')],'transfereecontext':_0x2530a7[_0x8864('0x23')],'transfereeexten':_0x2530a7[_0x8864('0x24')],'transfereelinkedid':_0x2530a7['transfertargetlinkedid'],'isexternal':_0x2530a7['isexternal'],'context':_0x2530a7[_0x8864('0x25')],'extension':_0x2530a7['origtransfererexten'],'type':_0x8864('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x1276=['attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind'];(function(_0x574335,_0x52c9fc){var _0x44ece0=function(_0x520760){while(--_0x520760){_0x574335['push'](_0x574335['shift']());}};_0x44ece0(++_0x52c9fc);}(_0x1276,0x11c));var _0x6127=function(_0x17bb01,_0x23c73f){_0x17bb01=_0x17bb01-0x0;var _0x354afd=_0x1276[_0x17bb01];return _0x354afd;};'use strict';var client=require('../client');exports[_0x6127('0x0')]=function(_0x1e6ac3){return client['Request'](_0x6127('0x1'),{'body':{'result':_0x1e6ac3[_0x6127('0x2')],'transfererchannel':_0x1e6ac3[_0x6127('0x3')],'transferercalleridnum':_0x1e6ac3['transferercalleridnum'],'transferercalleridname':_0x1e6ac3['transferercalleridname'],'transfererconnectedlinenum':_0x1e6ac3[_0x6127('0x4')],'transfererconnectedlinename':_0x1e6ac3['transfererconnectedlinename'],'transfereraccountcode':_0x1e6ac3[_0x6127('0x5')],'transferercontext':_0x1e6ac3[_0x6127('0x6')],'transfererexten':_0x1e6ac3[_0x6127('0x7')],'transfererlinkedid':_0x1e6ac3['transfererlinkedid'],'transfereechannel':_0x1e6ac3['transfereechannel'],'transfereecalleridnum':_0x1e6ac3[_0x6127('0x8')],'transfereecalleridname':_0x1e6ac3[_0x6127('0x9')],'transfereeconnectedlinenum':_0x1e6ac3[_0x6127('0xa')],'transfereeconnectedlinename':_0x1e6ac3[_0x6127('0xb')],'transfereeaccountcode':_0x1e6ac3[_0x6127('0xc')],'transfereecontext':_0x1e6ac3[_0x6127('0xd')],'transfereeexten':_0x1e6ac3[_0x6127('0xe')],'transfereelinkedid':_0x1e6ac3[_0x6127('0xf')],'isexternal':_0x1e6ac3[_0x6127('0x10')],'context':_0x1e6ac3[_0x6127('0x11')],'extension':_0x1e6ac3[_0x6127('0x12')],'type':_0x6127('0x13')},'log':_0x6127('0x1')});};exports[_0x6127('0x14')]=function(_0x3c035d){return client[_0x6127('0x15')](_0x6127('0x1'),{'body':{'result':_0x3c035d['result'],'transfererchannel':_0x3c035d[_0x6127('0x16')],'transferercalleridnum':_0x3c035d[_0x6127('0x17')],'transferercalleridname':_0x3c035d[_0x6127('0x18')],'transfererconnectedlinenum':_0x3c035d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3c035d[_0x6127('0x19')],'transfereraccountcode':_0x3c035d[_0x6127('0x1a')],'transferercontext':_0x3c035d[_0x6127('0x1b')],'transfererexten':_0x3c035d[_0x6127('0x1c')],'transfererlinkedid':_0x3c035d[_0x6127('0x1d')],'transfereechannel':_0x3c035d[_0x6127('0x1e')],'transfereecalleridnum':_0x3c035d['transfertargetcalleridnum'],'transfereecalleridname':_0x3c035d[_0x6127('0x1f')],'transfereeconnectedlinenum':_0x3c035d['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3c035d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3c035d[_0x6127('0x20')],'transfereecontext':_0x3c035d[_0x6127('0x21')],'transfereeexten':_0x3c035d[_0x6127('0x22')],'transfereelinkedid':_0x3c035d[_0x6127('0x23')],'isexternal':_0x3c035d['isexternal'],'context':_0x3c035d[_0x6127('0x24')],'extension':_0x3c035d[_0x6127('0x25')],'type':'attended'},'log':_0x6127('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c48330b..eb2d38c 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 _0x9c75=['type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','values','channels','length','username','join','voicechannel','validate','map','find','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','catch','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','keys','module','action','Reload','Action','message','pick','command','Command','then','content','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total'];(function(_0x48f6e8,_0x320de0){var _0x509f81=function(_0x37fd60){while(--_0x37fd60){_0x48f6e8['push'](_0x48f6e8['shift']());}};_0x509f81(++_0x320de0);}(_0x9c75,0x17d));var _0x59c7=function(_0x1704d6,_0x2c4c8d){_0x1704d6=_0x1704d6-0x0;var _0x1651a6=_0x9c75[_0x1704d6];return _0x1651a6;};'use strict';var _=require('lodash');var util=require(_0x59c7('0x0'));var jayson=require(_0x59c7('0x1'));var schema=require('validate');var BPromise=require(_0x59c7('0x2'));var moment=require(_0x59c7('0x3'));var config=require('../../../config/environment');var properties=require(_0x59c7('0x4'));var ami=require(_0x59c7('0x5'));exports[_0x59c7('0x6')]=function(_0x414b9a,_0x5ead04,_0x100183){return new BPromise(function(_0xc8a7a1,_0x2bb88d){var _0x409cb6={'QueuePause':function(_0x37d2eb){return new Promise(function(_0x176645,_0x51cba9){var _0xa91a3f=util[_0x59c7('0x7')](_0x59c7('0x8'),_0x59c7('0x9'),_0x37d2eb[_0x59c7('0xa')]);if(_0x414b9a[_0x59c7('0xb')]&&_0x414b9a['timers'][_0xa91a3f]&&_0x414b9a[_0x59c7('0xb')][_0xa91a3f][_0x59c7('0xc')]){_0x414b9a[_0x59c7('0xb')][_0xa91a3f][_0x59c7('0xd')]();}if(_0x414b9a[_0x59c7('0xe')][_0xa91a3f]){_0x414b9a[_0x59c7('0xe')][_0xa91a3f][_0x59c7('0xf')]({'statePause':_0x37d2eb[_0x59c7('0x10')]?!![]:![]});}_0x176645({'code':0xc8,'message':_0x59c7('0x11')});});},'Reload':function(_0x28a72e){var _0x5a3eb4=this;return new Promise(function(_0x75926f,_0x2e7aa6){if(ami[_0x59c7('0x12')]()==![]){return _0x2e7aa6(_0x5a3eb4[_0x59c7('0x13')](0x1f4,[config[_0x59c7('0x14')]['ip'],config['asterisk']['username'],_0x59c7('0x15')]['join']('\x20')));}_0x28a72e=_['pick'](_0x28a72e,_[_0x59c7('0x16')](properties[_0x59c7('0x17')]));_0x28a72e[_0x59c7('0x18')]=_0x59c7('0x19');return ami[_0x59c7('0x1a')](_0x28a72e)['then'](function(_0x35b9bc){_0x75926f({'code':0xc8,'message':_0x35b9bc[_0x59c7('0x1b')]});})['catch'](function(_0x512ac4){_0x2e7aa6(_0x5a3eb4[_0x59c7('0x13')](0x1f5,_0x512ac4['message']));});});},'Command':function(_0x275c45){var _0x2d33d9=this;return new Promise(function(_0xfb490d,_0x256e7b){if(ami[_0x59c7('0x12')]()==![]){return _0x256e7b(_0x2d33d9[_0x59c7('0x13')](0x1f4,[config[_0x59c7('0x14')]['ip'],config[_0x59c7('0x14')]['username'],'ami\x20disconnected']['join']('\x20')));}_0x275c45=_[_0x59c7('0x1c')](_0x275c45,_0x59c7('0x1d'));_0x275c45[_0x59c7('0x18')]=_0x59c7('0x1e');return ami[_0x59c7('0x1a')](_0x275c45)[_0x59c7('0x1f')](function(_0x5aaa3d){_0xfb490d({'code':0xc8,'message':_0x5aaa3d[_0x59c7('0x20')]});})['catch'](function(_0xf16173){_0x256e7b(_0x2d33d9[_0x59c7('0x13')](0x1f5,_0xf16173[_0x59c7('0x1b')]));});});},'VoiceQueues':function(_0x434adb){return new Promise(function(_0x780691,_0x4c70bb){var _0x526097=[];for(var _0x55d3ec in _0x414b9a['voiceQueues']){if(_0x414b9a['voiceQueues'][_0x59c7('0x21')](_0x55d3ec)){var _0x401bb7=_0x414b9a[_0x59c7('0x22')][_0x55d3ec];var _0x2df6bc={'id':_0x401bb7['id'],'name':_0x401bb7['name'],'strategy':_0x401bb7[_0x59c7('0x23')],'answered':_0x401bb7[_0x59c7('0x24')],'available':_0x401bb7[_0x59c7('0x25')],'loggedIn':_0x401bb7[_0x59c7('0x26')],'pTalking':_0x401bb7[_0x59c7('0x27')],'sumBillable':_0x401bb7[_0x59c7('0x28')],'sumDuration':_0x401bb7[_0x59c7('0x29')],'sumHoldTime':_0x401bb7[_0x59c7('0x2a')]||0x0,'talking':_0x401bb7[_0x59c7('0x2b')],'total':_0x401bb7[_0x59c7('0x2c')],'type':_0x401bb7[_0x59c7('0x2d')],'unmanaged':_0x401bb7['unmanaged'],'abandoned':_0x401bb7[_0x59c7('0x2e')],'waiting':_0x401bb7['waiting'],'loggedInDb':_0x401bb7[_0x59c7('0x2f')]};if(_0x401bb7[_0x59c7('0x2d')]===_0x59c7('0x30')){_0x2df6bc['dialActive']=_0x401bb7[_0x59c7('0x31')];_0x2df6bc[_0x59c7('0x32')]=_0x401bb7[_0x59c7('0x32')];_0x2df6bc['dialOriginateCallerIdName']=_0x401bb7[_0x59c7('0x33')];_0x2df6bc[_0x59c7('0x34')]=_0x401bb7[_0x59c7('0x34')];_0x2df6bc[_0x59c7('0x35')]=_0x401bb7[_0x59c7('0x35')];_0x2df6bc[_0x59c7('0x36')]=_0x401bb7[_0x59c7('0x36')];_0x2df6bc[_0x59c7('0x37')]=_0x401bb7[_0x59c7('0x37')];_0x2df6bc[_0x59c7('0x38')]=_0x401bb7[_0x59c7('0x38')];_0x2df6bc['outboundBlacklistCallsDay']=_0x401bb7[_0x59c7('0x39')];_0x2df6bc[_0x59c7('0x3a')]=_0x401bb7[_0x59c7('0x3a')];_0x2df6bc['outboundCongestionCallsDay']=_0x401bb7[_0x59c7('0x3b')];_0x2df6bc[_0x59c7('0x3c')]=_0x401bb7[_0x59c7('0x3c')];_0x2df6bc['outboundDropCallsDayCallersExit']=_0x401bb7[_0x59c7('0x3d')];_0x2df6bc[_0x59c7('0x3e')]=_0x401bb7['outboundDropCallsDayTimeout'];_0x2df6bc[_0x59c7('0x3f')]=_0x401bb7[_0x59c7('0x3f')];_0x2df6bc[_0x59c7('0x40')]=_0x401bb7['outboundNoSuchCallsDay'];_0x2df6bc[_0x59c7('0x41')]=_0x401bb7['outboundOriginateFailureCallsDay'];_0x2df6bc['outboundReCallsDay']=_0x401bb7[_0x59c7('0x42')];_0x2df6bc[_0x59c7('0x43')]=_0x401bb7[_0x59c7('0x43')];_0x2df6bc[_0x59c7('0x44')]=_0x401bb7[_0x59c7('0x44')];_0x2df6bc[_0x59c7('0x45')]=_0x401bb7['predictiveIntervalAnsweredCalls'];_0x2df6bc[_0x59c7('0x46')]=_0x401bb7['predictiveIntervalAvgHoldtime'];_0x2df6bc[_0x59c7('0x47')]=_0x401bb7['predictiveIntervalAvgTalktime'];_0x2df6bc[_0x59c7('0x48')]=_0x401bb7[_0x59c7('0x48')];_0x2df6bc[_0x59c7('0x49')]=_0x401bb7[_0x59c7('0x49')];_0x2df6bc[_0x59c7('0x4a')]=_0x401bb7[_0x59c7('0x4a')];_0x2df6bc[_0x59c7('0x4b')]=_0x401bb7[_0x59c7('0x4b')];_0x2df6bc['predictiveIntervalHitRate']=_0x401bb7[_0x59c7('0x4c')];_0x2df6bc['predictiveIntervalMultiplicativeFactor']=_0x401bb7[_0x59c7('0x4d')];_0x2df6bc[_0x59c7('0x4e')]=_0x401bb7[_0x59c7('0x4e')];_0x2df6bc[_0x59c7('0x4f')]=_0x401bb7[_0x59c7('0x4f')];_0x2df6bc[_0x59c7('0x50')]=_0x401bb7['predictiveIntervalTotalCalls'];_0x2df6bc[_0x59c7('0x1b')]=_0x401bb7['message'];_0x2df6bc[_0x59c7('0x51')]=_0x401bb7[_0x59c7('0x51')];_0x2df6bc[_0x59c7('0x52')]=_0x401bb7['erlangCalls'];_0x2df6bc[_0x59c7('0x53')]=_0x401bb7[_0x59c7('0x53')];_0x2df6bc[_0x59c7('0x54')]=_0x401bb7[_0x59c7('0x54')];_0x2df6bc[_0x59c7('0x55')]=_0x401bb7['erlangBusyFactor'];_0x2df6bc[_0x59c7('0x56')]=_0x401bb7['startPredictive'];_0x2df6bc[_0x59c7('0x57')]=_0x401bb7['startProgressive'];}if(_0x401bb7[_0x59c7('0x58')]){_0x2df6bc['Trunk']={'id':_0x401bb7['Trunk']['id'],'name':_0x401bb7[_0x59c7('0x58')][_0x59c7('0xa')],'active':_0x401bb7[_0x59c7('0x58')]['active'],'callerid':_0x401bb7[_0x59c7('0x58')][_0x59c7('0x59')]};}if(_0x401bb7['Interval']){_0x2df6bc[_0x59c7('0x5a')]={'id':_0x401bb7[_0x59c7('0x5a')]['id'],'name':_0x401bb7[_0x59c7('0x5a')][_0x59c7('0xa')]};}_0x526097[_0x59c7('0x5b')](_0x2df6bc);}}_0x780691({'count':_0x526097['length'],'rows':_0x526097});});},'VoiceChannels':function(_0x121b34){return new Promise(function(_0xa05383,_0x35f0b9){var _0x5f222a=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x5d')]);_0xa05383({'count':_0x5f222a[_0x59c7('0x5e')],'rows':_0x5f222a});});},'VoiceChannelMixMonitor':function(_0x352c60){var _0x381e17=this;return new Promise(function(_0x4abe86,_0x53fbee){if(ami[_0x59c7('0x12')]()==![]){return _0x53fbee(_0x381e17['error'](0x1f4,[config[_0x59c7('0x14')]['ip'],config[_0x59c7('0x14')][_0x59c7('0x5f')],'ami\x20disconnected'][_0x59c7('0x60')]('\x20')));}var _0x30dffd=schema(properties[_0x59c7('0x61')])[_0x59c7('0x62')](_0x352c60);if(_0x30dffd[_0x59c7('0x5e')]>0x0){return _0x53fbee(_0x381e17[_0x59c7('0x13')](0x1f4,_[_0x59c7('0x63')](_0x30dffd,_0x59c7('0x1b'))[_0x59c7('0x60')](',\x20')));}var _0x120aa9=_[_0x59c7('0x64')](_0x414b9a['channels'],{'uniqueid':_0x352c60[_0x59c7('0x65')]});if(_0x120aa9&&_0x120aa9[_0x59c7('0x66')]){var _0x3ed187=util[_0x59c7('0x7')]('%s.%s',_0x352c60[_0x59c7('0x67')]||_0x352c60['uniqueid'],_0x352c60[_0x59c7('0x7')]||_0x59c7('0x68'));return ami[_0x59c7('0x1a')]({'action':_0x59c7('0x69'),'channel':_0x120aa9[_0x59c7('0x66')],'file':_0x3ed187,'options':_0x59c7('0x6a')})[_0x59c7('0x1f')](function(_0x5bbcc6){var _0x2610a0=_[_0x59c7('0x64')](_0x120aa9['monitors'],{'filename':_0x59c7('0x6b')+_0x3ed187[_0x59c7('0x6c')]()});if(_[_0x59c7('0x6d')](_0x2610a0)){_0x120aa9[_0x59c7('0x6e')][_0x59c7('0x5b')]({'filename':_0x59c7('0x6b')+_0x3ed187[_0x59c7('0x6c')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5bbcc6[_0x59c7('0x6f')],'status':_0x59c7('0x70')});}else{_0x2610a0[_0x59c7('0x6f')]=_0x5bbcc6[_0x59c7('0x6f')];_0x2610a0[_0x59c7('0x71')]='rec';}_0x4abe86({'code':0xc8,'message':[_0x352c60[_0x59c7('0x65')],'MixMonitor\x20Success',_0x5bbcc6[_0x59c7('0x6f')]][_0x59c7('0x60')]('\x20'),'mixmonitorid':_0x5bbcc6[_0x59c7('0x6f')]});})[_0x59c7('0x72')](function(_0x2f371c){_0x53fbee(_0x381e17[_0x59c7('0x13')](0x1f5,[_0x352c60['uniqueid'],_0x2f371c[_0x59c7('0x1b')][_0x59c7('0x6c')]()][_0x59c7('0x60')]('\x20')));});}else{return _0x53fbee(_0x381e17['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x422695){var _0x257f2e=this;return new Promise(function(_0x415360,_0x31b4fb){if(ami[_0x59c7('0x12')]()==![]){return _0x31b4fb(_0x257f2e['error'](0x1f4,[config[_0x59c7('0x14')]['ip'],config[_0x59c7('0x14')][_0x59c7('0x5f')],_0x59c7('0x15')][_0x59c7('0x60')]('\x20')));}var _0x41cad9=schema(properties[_0x59c7('0x61')])['validate'](_0x422695);if(_0x41cad9['length']>0x0){return _0x31b4fb(_0x257f2e[_0x59c7('0x13')](0x1f4,_['map'](_0x41cad9,_0x59c7('0x1b'))[_0x59c7('0x60')](',\x20')));}var _0x46437f=_[_0x59c7('0x64')](_0x414b9a[_0x59c7('0x5d')],{'uniqueid':_0x422695[_0x59c7('0x65')]});if(_0x46437f){return BPromise[_0x59c7('0x73')]()[_0x59c7('0x1f')](function(){if(_0x46437f['channel']){return ami['Action']({'action':_0x59c7('0x74'),'channel':_0x46437f['channel'],'mixmonitorid':_0x422695[_0x59c7('0x6f')]})[_0x59c7('0x72')](function(_0x584122){});}})[_0x59c7('0x1f')](function(){if(_0x46437f[_0x59c7('0x75')]){return ami[_0x59c7('0x1a')]({'action':_0x59c7('0x74'),'channel':_0x46437f[_0x59c7('0x75')],'mixmonitorid':_0x422695['mixmonitorid']})[_0x59c7('0x72')](function(_0x4e1df0){});}})['then'](function(_0x2ccd3c){var _0x24507f=_[_0x59c7('0x64')](_0x46437f[_0x59c7('0x6e')],{'mixmonitorid':_0x422695[_0x59c7('0x6f')]});if(_0x24507f){_0x24507f['status']=_0x59c7('0x76');}})[_0x59c7('0x1f')](function(){var _0x394cdc=util[_0x59c7('0x7')](_0x59c7('0x77'),_0x422695['filename']||_0x422695[_0x59c7('0x65')],_0x422695[_0x59c7('0x7')]||_0x59c7('0x68'));var _0x518601=_[_0x59c7('0x64')](_0x46437f[_0x59c7('0x6e')],{'filename':_0x59c7('0x6b')+_0x394cdc[_0x59c7('0x6c')]()});if(_0x518601){_0x518601[_0x59c7('0x71')]='stop';}})[_0x59c7('0x1f')](function(){_0x415360({'code':0xc8,'message':[_0x422695[_0x59c7('0x65')],'StopMixMonitor\x20Success'][_0x59c7('0x60')]('\x20')});})[_0x59c7('0x72')](function(_0x2a900e){_0x31b4fb(_0x257f2e['error'](0x1f5,[_0x422695['uniqueid'],_0x2a900e[_0x59c7('0x1b')][_0x59c7('0x6c')]()][_0x59c7('0x60')]('\x20')));});}else{return _0x31b4fb(_0x257f2e[_0x59c7('0x13')](0x1f5,_0x59c7('0x78')));}});},'VoiceQueuesChannels':function(_0x3e4451){return new Promise(function(_0x27941b,_0x2a200a){var _0x4603b0=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x79')]);_0x27941b({'count':_0x4603b0[_0x59c7('0x5e')],'rows':_0x4603b0});});},'VoiceQueuesChannel':function(_0x5beb43){var _0x459127=this;return new Promise(function(_0x7a78e5,_0x96d7ac){var _0x42f092=schema(properties[_0x59c7('0x7a')])['validate'](_0x5beb43);if(_0x42f092[_0x59c7('0x5e')]>0x0){return _0x96d7ac(_0x459127[_0x59c7('0x13')](0x1f4,_[_0x59c7('0x63')](_0x42f092,_0x59c7('0x1b'))[_0x59c7('0x60')](',\x20')));}var _0x5a0d77=_[_0x59c7('0x64')](_0x414b9a[_0x59c7('0x79')],{'uniqueid':_0x5beb43[_0x59c7('0x65')]});if(_0x5a0d77){_0x7a78e5(_0x5a0d77);}else{return _0x96d7ac(_0x459127[_0x59c7('0x13')](0x1f5,_0x59c7('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x5477de){var _0x3eb29f=this;return new Promise(function(_0x358453,_0x340332){if(ami[_0x59c7('0x12')]()==![]){return _0x340332(_0x3eb29f['error'](0x1f4,[config[_0x59c7('0x14')]['ip'],config[_0x59c7('0x14')][_0x59c7('0x5f')],_0x59c7('0x15')][_0x59c7('0x60')]('\x20')));}var _0x214e1c=schema(properties['voicequeuechannelhangup'])[_0x59c7('0x62')](_0x5477de);if(_0x214e1c[_0x59c7('0x5e')]>0x0){return _0x340332(_0x3eb29f[_0x59c7('0x13')](0x1f4,_['map'](_0x214e1c,'message')['join'](',\x20')));}var _0x43f3a3=_[_0x59c7('0x64')](_0x414b9a[_0x59c7('0x79')],{'uniqueid':_0x5477de['uniqueid']});if(_0x43f3a3&&_0x43f3a3[_0x59c7('0x66')]){return ami[_0x59c7('0x1a')]({'action':_0x59c7('0x7b'),'channel':_0x43f3a3['channel']})['then'](function(_0x1f6f0a){_0x358453({'code':0xc8,'message':[_0x5477de['uniqueid'],_0x1f6f0a['message'][_0x59c7('0x6c')]()][_0x59c7('0x60')]('\x20')});})['catch'](function(_0x4c3f01){_0x340332(_0x3eb29f[_0x59c7('0x13')](0x1f5,[_0x5477de[_0x59c7('0x65')],_0x4c3f01[_0x59c7('0x1b')][_0x59c7('0x6c')]()]['join']('\x20')));});}else{return _0x340332(_0x3eb29f[_0x59c7('0x13')](0x1f5,_0x59c7('0x78')));}});},'VoiceQueuesChannelRedirect':function(_0x38792a){var _0x5e7aa1=this;return new Promise(function(_0x33f381,_0x4c71f6){if(ami['isConnected']()==![]){return _0x4c71f6(_0x5e7aa1[_0x59c7('0x13')](0x1f4,[config['asterisk']['ip'],config[_0x59c7('0x14')][_0x59c7('0x5f')],_0x59c7('0x15')][_0x59c7('0x60')]('\x20')));}var _0xd22d8b=schema(properties['voicequeuechannelredirect'])['validate'](_0x38792a);if(_0xd22d8b[_0x59c7('0x5e')]>0x0){return _0x4c71f6(_0x5e7aa1[_0x59c7('0x13')](0x1f4,_[_0x59c7('0x63')](_0xd22d8b,_0x59c7('0x1b'))[_0x59c7('0x60')](',\x20')));}var _0x258b85=_[_0x59c7('0x64')](_0x414b9a[_0x59c7('0x79')],{'uniqueid':_0x38792a[_0x59c7('0x65')]});if(_0x258b85&&_0x258b85[_0x59c7('0x66')]){return ami[_0x59c7('0x1a')]({'action':_0x59c7('0x7c'),'channel':_0x258b85[_0x59c7('0x66')],'exten':_0x38792a['exten'],'context':_0x38792a['context']||_0x258b85[_0x59c7('0x7d')],'priority':0x1})['then'](function(_0x3ab8f9){_0x33f381({'code':0xc8,'message':[_0x38792a['uniqueid'],_0x3ab8f9[_0x59c7('0x1b')]['toLowerCase']()][_0x59c7('0x60')]('\x20')});})[_0x59c7('0x72')](function(_0x1ed44a){_0x4c71f6(_0x5e7aa1[_0x59c7('0x13')](0x1f5,[_0x38792a['uniqueid'],_0x1ed44a[_0x59c7('0x1b')]['toLowerCase']()][_0x59c7('0x60')]('\x20')));});}else{return _0x4c71f6(_0x5e7aa1[_0x59c7('0x13')](0x1f5,_0x59c7('0x78')));}});},'Agents':function(_0x27f62f){return new Promise(function(_0x384537,_0x5346c8){var _0x4be5b3=_['values'](_0x414b9a[_0x59c7('0xe')]);_0x384537({'count':_0x4be5b3[_0x59c7('0x5e')],'rows':_0x4be5b3});});},'Telephones':function(_0x30c505){return new Promise(function(_0xf4c656,_0x3a2205){var _0x10de2d=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x7e')]);_0xf4c656({'count':_0x10de2d[_0x59c7('0x5e')],'rows':_0x10de2d});});},'Trunks':function(_0x1418a4){return new Promise(function(_0x395974,_0x41ddde){var _0x24d31b=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x7f')]);_0x395974({'count':_0x24d31b[_0x59c7('0x5e')],'rows':_0x24d31b});});},'OutboundChannels':function(_0x2c9ced){return new Promise(function(_0x27b238,_0x41156c){var _0x2034d4=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x80')]);_0x27b238({'count':_0x2034d4[_0x59c7('0x5e')],'rows':_0x2034d4});});},'Outbound':function(_0x297f61){return new Promise(function(_0x4a7a16,_0xa052d2){_0x4a7a16(_0x414b9a['outbound']);});},'Campaigns':function(_0x288426){return new Promise(function(_0x1fc91f,_0x3251b7){var _0x3b54fd=_['values'](_0x414b9a[_0x59c7('0x81')]);_0x1fc91f({'count':_0x3b54fd[_0x59c7('0x5e')],'rows':_0x3b54fd});});},'VoiceQueuesPreview':function(_0x1daf97){var _0x1d9d60=this;return new Promise(function(_0x106165,_0x5ec687){_0x5ead04[_0x59c7('0x82')](_0x1daf97['id'])['then'](function(_0x1bd154){_0x106165({'code':0xc8,'message':_0x1bd154[_0x59c7('0x1b')]});})[_0x59c7('0x72')](function(_0x5039f4){_0x5ec687(_0x1d9d60[_0x59c7('0x13')](0x1f4,_0x5039f4['message']));});});},'EventManager':function(_0x5ca096){var _0x41f90e=this;return new Promise(function(_0x397149,_0x2c4d7b){if(!_0x5ca096['event']){return _0x2c4d7b(_0x41f90e[_0x59c7('0x13')](0x1f4,_0x59c7('0x83')));}ami[_0x59c7('0x84')](_0x59c7('0x85')+_0x5ca096[_0x59c7('0x86')],_0x5ca096['message']);_0x397149({'code':0xc8,'message':_0x5ca096});});},'FaxAccounts':function(_0x51cab0){return new Promise(function(_0x3a8a68,_0xc64fcf){var _0x42fe31=_[_0x59c7('0x5c')](_0x414b9a[_0x59c7('0x87')]);_0x3a8a68({'count':_0x42fe31['length'],'rows':_0x42fe31});});},'SendFax':function(_0x35ee51){var _0x180554=this;return new Promise(function(_0x1b08a3,_0x2ed0c2){_0x100183['send'](_0x35ee51)[_0x59c7('0x1f')](function(_0x4c2ce4){_0x1b08a3({'code':0xc8,'message':_0x4c2ce4['message']});})[_0x59c7('0x72')](function(_0x2a4356){_0x2ed0c2(_0x180554[_0x59c7('0x13')](0x1f4,_0x2a4356['message']));});});},'CheckAfterSend':function(_0x27b790){var _0x7c3c07=this;return new Promise(function(_0x13040c,_0x301b92){_0x100183['checkAfterSend'](_0x27b790)[_0x59c7('0x1f')](function(_0x366d33){_0x13040c({'code':0xc8,'message':_0x366d33[_0x59c7('0x1b')]});})[_0x59c7('0x72')](function(_0x39fd5c){_0x301b92(_0x7c3c07['error'](0x1f4,_0x39fd5c[_0x59c7('0x1b')]));});});}};var _0x16dc72=jayson[_0x59c7('0x88')](_0x409cb6)[_0x59c7('0x89')]();_0x16dc72['on'](_0x59c7('0x13'),function(_0x414cef){return _0x2bb88d(_0x414cef);});_0x16dc72[_0x59c7('0x6')](0x232a,_0x59c7('0x8a'),function(){console[_0x59c7('0x8b')](_0x59c7('0x8c'),0x232a);return _0xc8a7a1(_0x59c7('0x8d')+0x232a);});});}; \ No newline at end of file +var _0x0b8d=['voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','SIP','name','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','then','command','Command','Action','content','catch','message','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','values','channels','length','voicechannel','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup'];(function(_0x5400a1,_0x2275aa){var _0x4006c7=function(_0x5002dc){while(--_0x5002dc){_0x5400a1['push'](_0x5400a1['shift']());}};_0x4006c7(++_0x2275aa);}(_0x0b8d,0x1b1));var _0xd0b8=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0b8d[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0xd0b8('0x0'));var util=require(_0xd0b8('0x1'));var jayson=require(_0xd0b8('0x2'));var schema=require(_0xd0b8('0x3'));var BPromise=require('bluebird');var moment=require(_0xd0b8('0x4'));var config=require(_0xd0b8('0x5'));var properties=require(_0xd0b8('0x6'));var ami=require(_0xd0b8('0x7'));exports[_0xd0b8('0x8')]=function(_0x451108,_0x1c3858,_0x3f8cad){return new BPromise(function(_0x5af6c0,_0x2d313f){var _0x483f1a={'QueuePause':function(_0x345548){return new Promise(function(_0x18eaf0,_0x5dce9f){var _0x90f700=util['format']('%s/%s',_0xd0b8('0x9'),_0x345548[_0xd0b8('0xa')]);if(_0x451108[_0xd0b8('0xb')]&&_0x451108[_0xd0b8('0xb')][_0x90f700]&&_0x451108['timers'][_0x90f700]['timer']){_0x451108[_0xd0b8('0xb')][_0x90f700]['updateAcw']();}if(_0x451108[_0xd0b8('0xc')][_0x90f700]){_0x451108[_0xd0b8('0xc')][_0x90f700]['updateStatusRealtime']({'statePause':_0x345548[_0xd0b8('0xd')]?!![]:![]});}_0x18eaf0({'code':0xc8,'message':_0xd0b8('0xe')});});},'Reload':function(_0x1f83ef){var _0x2c783f=this;return new Promise(function(_0x1e8d58,_0x248d5f){if(ami[_0xd0b8('0xf')]()==![]){return _0x248d5f(_0x2c783f[_0xd0b8('0x10')](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')][_0xd0b8('0x12')],_0xd0b8('0x13')][_0xd0b8('0x14')]('\x20')));}_0x1f83ef=_[_0xd0b8('0x15')](_0x1f83ef,_[_0xd0b8('0x16')](properties['module']));_0x1f83ef[_0xd0b8('0x17')]='Reload';return ami['Action'](_0x1f83ef)[_0xd0b8('0x18')](function(_0x35f889){_0x1e8d58({'code':0xc8,'message':_0x35f889['message']});})['catch'](function(_0x2c8c00){_0x248d5f(_0x2c783f[_0xd0b8('0x10')](0x1f5,_0x2c8c00['message']));});});},'Command':function(_0x2a407a){var _0x4ef6f2=this;return new Promise(function(_0x13be5c,_0x120c1f){if(ami[_0xd0b8('0xf')]()==![]){return _0x120c1f(_0x4ef6f2[_0xd0b8('0x10')](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')][_0xd0b8('0x12')],_0xd0b8('0x13')]['join']('\x20')));}_0x2a407a=_[_0xd0b8('0x15')](_0x2a407a,_0xd0b8('0x19'));_0x2a407a[_0xd0b8('0x17')]=_0xd0b8('0x1a');return ami[_0xd0b8('0x1b')](_0x2a407a)[_0xd0b8('0x18')](function(_0x4078b7){_0x13be5c({'code':0xc8,'message':_0x4078b7[_0xd0b8('0x1c')]});})[_0xd0b8('0x1d')](function(_0x2fc823){_0x120c1f(_0x4ef6f2[_0xd0b8('0x10')](0x1f5,_0x2fc823[_0xd0b8('0x1e')]));});});},'VoiceQueues':function(_0x3e101c){return new Promise(function(_0x5906d5,_0x1fb110){var _0x3cbbbd=[];for(var _0x202b82 in _0x451108[_0xd0b8('0x1f')]){if(_0x451108['voiceQueues'][_0xd0b8('0x20')](_0x202b82)){var _0x20887f=_0x451108[_0xd0b8('0x1f')][_0x202b82];var _0x1e44b7={'id':_0x20887f['id'],'name':_0x20887f[_0xd0b8('0xa')],'strategy':_0x20887f['strategy'],'answered':_0x20887f[_0xd0b8('0x21')],'available':_0x20887f['available'],'loggedIn':_0x20887f[_0xd0b8('0x22')],'pTalking':_0x20887f[_0xd0b8('0x23')],'sumBillable':_0x20887f[_0xd0b8('0x24')],'sumDuration':_0x20887f[_0xd0b8('0x25')],'sumHoldTime':_0x20887f[_0xd0b8('0x26')]||0x0,'talking':_0x20887f[_0xd0b8('0x27')],'total':_0x20887f['total'],'type':_0x20887f[_0xd0b8('0x28')],'unmanaged':_0x20887f['unmanaged'],'abandoned':_0x20887f[_0xd0b8('0x29')],'waiting':_0x20887f[_0xd0b8('0x2a')],'loggedInDb':_0x20887f[_0xd0b8('0x2b')]};if(_0x20887f['type']===_0xd0b8('0x2c')){_0x1e44b7[_0xd0b8('0x2d')]=_0x20887f[_0xd0b8('0x2d')];_0x1e44b7[_0xd0b8('0x2e')]=_0x20887f[_0xd0b8('0x2e')];_0x1e44b7[_0xd0b8('0x2f')]=_0x20887f[_0xd0b8('0x2f')];_0x1e44b7[_0xd0b8('0x30')]=_0x20887f[_0xd0b8('0x30')];_0x1e44b7['dialOriginateTimeout']=_0x20887f[_0xd0b8('0x31')];_0x1e44b7[_0xd0b8('0x32')]=_0x20887f[_0xd0b8('0x32')];_0x1e44b7[_0xd0b8('0x33')]=_0x20887f[_0xd0b8('0x33')];_0x1e44b7[_0xd0b8('0x34')]=_0x20887f['outboundAnswerCallsDay'];_0x1e44b7[_0xd0b8('0x35')]=_0x20887f[_0xd0b8('0x35')];_0x1e44b7['outboundBusyCallsDay']=_0x20887f[_0xd0b8('0x36')];_0x1e44b7[_0xd0b8('0x37')]=_0x20887f['outboundCongestionCallsDay'];_0x1e44b7[_0xd0b8('0x38')]=_0x20887f['outboundDropCallsDayACS'];_0x1e44b7[_0xd0b8('0x39')]=_0x20887f[_0xd0b8('0x39')];_0x1e44b7['outboundDropCallsDayTimeout']=_0x20887f['outboundDropCallsDayTimeout'];_0x1e44b7[_0xd0b8('0x3a')]=_0x20887f[_0xd0b8('0x3a')];_0x1e44b7[_0xd0b8('0x3b')]=_0x20887f[_0xd0b8('0x3b')];_0x1e44b7['outboundOriginateFailureCallsDay']=_0x20887f['outboundOriginateFailureCallsDay'];_0x1e44b7[_0xd0b8('0x3c')]=_0x20887f[_0xd0b8('0x3c')];_0x1e44b7[_0xd0b8('0x3d')]=_0x20887f[_0xd0b8('0x3d')];_0x1e44b7[_0xd0b8('0x3e')]=_0x20887f[_0xd0b8('0x3e')];_0x1e44b7[_0xd0b8('0x3f')]=_0x20887f['predictiveIntervalAnsweredCalls'];_0x1e44b7[_0xd0b8('0x40')]=_0x20887f[_0xd0b8('0x40')];_0x1e44b7[_0xd0b8('0x41')]=_0x20887f[_0xd0b8('0x41')];_0x1e44b7[_0xd0b8('0x42')]=_0x20887f['predictiveIntervalDroppedCallsCallersExit'];_0x1e44b7[_0xd0b8('0x43')]=_0x20887f['predictiveIntervalDroppedCallsTimeout'];_0x1e44b7['predictiveIntervalErlangCalls']=_0x20887f[_0xd0b8('0x44')];_0x1e44b7[_0xd0b8('0x45')]=_0x20887f[_0xd0b8('0x45')];_0x1e44b7[_0xd0b8('0x46')]=_0x20887f['predictiveIntervalHitRate'];_0x1e44b7[_0xd0b8('0x47')]=_0x20887f['predictiveIntervalMultiplicativeFactor'];_0x1e44b7['predictiveIntervalPauses']=_0x20887f[_0xd0b8('0x48')];_0x1e44b7['predictiveIntervalAvailable']=_0x20887f[_0xd0b8('0x49')];_0x1e44b7[_0xd0b8('0x4a')]=_0x20887f['predictiveIntervalTotalCalls'];_0x1e44b7[_0xd0b8('0x1e')]=_0x20887f[_0xd0b8('0x1e')];_0x1e44b7['originated']=_0x20887f[_0xd0b8('0x4b')];_0x1e44b7['erlangCalls']=_0x20887f[_0xd0b8('0x4c')];_0x1e44b7[_0xd0b8('0x4d')]=_0x20887f[_0xd0b8('0x4d')];_0x1e44b7[_0xd0b8('0x4e')]=_0x20887f['erlangAbandonmentRate'];_0x1e44b7[_0xd0b8('0x4f')]=_0x20887f[_0xd0b8('0x4f')];_0x1e44b7[_0xd0b8('0x50')]=_0x20887f[_0xd0b8('0x50')];_0x1e44b7[_0xd0b8('0x51')]=_0x20887f[_0xd0b8('0x51')];}if(_0x20887f[_0xd0b8('0x52')]){_0x1e44b7[_0xd0b8('0x52')]={'id':_0x20887f[_0xd0b8('0x52')]['id'],'name':_0x20887f[_0xd0b8('0x52')][_0xd0b8('0xa')],'active':_0x20887f['Trunk'][_0xd0b8('0x53')],'callerid':_0x20887f['Trunk'][_0xd0b8('0x54')]};}if(_0x20887f[_0xd0b8('0x55')]){_0x1e44b7[_0xd0b8('0x55')]={'id':_0x20887f[_0xd0b8('0x55')]['id'],'name':_0x20887f['Interval'][_0xd0b8('0xa')]};}_0x3cbbbd[_0xd0b8('0x56')](_0x1e44b7);}}_0x5906d5({'count':_0x3cbbbd['length'],'rows':_0x3cbbbd});});},'VoiceChannels':function(_0x375a22){return new Promise(function(_0x395895,_0x20f176){var _0x4d0250=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0x58')]);_0x395895({'count':_0x4d0250[_0xd0b8('0x59')],'rows':_0x4d0250});});},'VoiceChannelMixMonitor':function(_0x5003d7){var _0x1876b2=this;return new Promise(function(_0x3841a3,_0xe0c5c6){if(ami[_0xd0b8('0xf')]()==![]){return _0xe0c5c6(_0x1876b2[_0xd0b8('0x10')](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')]['username'],_0xd0b8('0x13')][_0xd0b8('0x14')]('\x20')));}var _0x27b386=schema(properties[_0xd0b8('0x5a')])['validate'](_0x5003d7);if(_0x27b386[_0xd0b8('0x59')]>0x0){return _0xe0c5c6(_0x1876b2[_0xd0b8('0x10')](0x1f4,_[_0xd0b8('0x5b')](_0x27b386,'message')[_0xd0b8('0x14')](',\x20')));}var _0x1cbfca=_[_0xd0b8('0x5c')](_0x451108[_0xd0b8('0x58')],{'uniqueid':_0x5003d7[_0xd0b8('0x5d')]});if(_0x1cbfca&&_0x1cbfca[_0xd0b8('0x5e')]){var _0x4465bd=util[_0xd0b8('0x5f')](_0xd0b8('0x60'),_0x5003d7[_0xd0b8('0x61')]||_0x5003d7[_0xd0b8('0x5d')],_0x5003d7[_0xd0b8('0x5f')]||_0xd0b8('0x62'));return ami['Action']({'action':_0xd0b8('0x63'),'channel':_0x1cbfca[_0xd0b8('0x5e')],'file':_0x4465bd,'options':_0xd0b8('0x64')})['then'](function(_0x817fb6){var _0x549cdd=_[_0xd0b8('0x5c')](_0x1cbfca['monitors'],{'filename':_0xd0b8('0x65')+_0x4465bd[_0xd0b8('0x66')]()});if(_[_0xd0b8('0x67')](_0x549cdd)){_0x1cbfca[_0xd0b8('0x68')]['push']({'filename':_0xd0b8('0x65')+_0x4465bd['toLowerCase'](),'createdAt':moment()[_0xd0b8('0x5f')](_0xd0b8('0x69')),'mixmonitorid':_0x817fb6['mixmonitorid'],'status':_0xd0b8('0x6a')});}else{_0x549cdd[_0xd0b8('0x6b')]=_0x817fb6[_0xd0b8('0x6b')];_0x549cdd[_0xd0b8('0x6c')]='rec';}_0x3841a3({'code':0xc8,'message':[_0x5003d7[_0xd0b8('0x5d')],_0xd0b8('0x6d'),_0x817fb6[_0xd0b8('0x6b')]][_0xd0b8('0x14')]('\x20'),'mixmonitorid':_0x817fb6[_0xd0b8('0x6b')]});})[_0xd0b8('0x1d')](function(_0x31ef05){_0xe0c5c6(_0x1876b2['error'](0x1f5,[_0x5003d7[_0xd0b8('0x5d')],_0x31ef05[_0xd0b8('0x1e')][_0xd0b8('0x66')]()]['join']('\x20')));});}else{return _0xe0c5c6(_0x1876b2[_0xd0b8('0x10')](0x1f5,_0xd0b8('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x289afe){var _0x2b74cc=this;return new Promise(function(_0x29e21c,_0x128637){if(ami['isConnected']()==![]){return _0x128637(_0x2b74cc['error'](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')][_0xd0b8('0x12')],_0xd0b8('0x13')][_0xd0b8('0x14')]('\x20')));}var _0xc27fcb=schema(properties[_0xd0b8('0x5a')])[_0xd0b8('0x3')](_0x289afe);if(_0xc27fcb['length']>0x0){return _0x128637(_0x2b74cc[_0xd0b8('0x10')](0x1f4,_[_0xd0b8('0x5b')](_0xc27fcb,'message')[_0xd0b8('0x14')](',\x20')));}var _0x5a4562=_['find'](_0x451108[_0xd0b8('0x58')],{'uniqueid':_0x289afe[_0xd0b8('0x5d')]});if(_0x5a4562){return BPromise[_0xd0b8('0x6f')]()['then'](function(){if(_0x5a4562['channel']){return ami[_0xd0b8('0x1b')]({'action':_0xd0b8('0x70'),'channel':_0x5a4562[_0xd0b8('0x5e')],'mixmonitorid':_0x289afe[_0xd0b8('0x6b')]})['catch'](function(_0x193da4){});}})[_0xd0b8('0x18')](function(){if(_0x5a4562[_0xd0b8('0x71')]){return ami['Action']({'action':_0xd0b8('0x70'),'channel':_0x5a4562[_0xd0b8('0x71')],'mixmonitorid':_0x289afe[_0xd0b8('0x6b')]})[_0xd0b8('0x1d')](function(_0x21fa0d){});}})[_0xd0b8('0x18')](function(_0x3102b0){var _0x315d01=_['find'](_0x5a4562[_0xd0b8('0x68')],{'mixmonitorid':_0x289afe[_0xd0b8('0x6b')]});if(_0x315d01){_0x315d01['status']=_0xd0b8('0x72');}})['then'](function(){var _0x8f8240=util[_0xd0b8('0x5f')](_0xd0b8('0x60'),_0x289afe['filename']||_0x289afe[_0xd0b8('0x5d')],_0x289afe[_0xd0b8('0x5f')]||_0xd0b8('0x62'));var _0x1a1157=_[_0xd0b8('0x5c')](_0x5a4562[_0xd0b8('0x68')],{'filename':_0xd0b8('0x65')+_0x8f8240[_0xd0b8('0x66')]()});if(_0x1a1157){_0x1a1157[_0xd0b8('0x6c')]=_0xd0b8('0x72');}})[_0xd0b8('0x18')](function(){_0x29e21c({'code':0xc8,'message':[_0x289afe['uniqueid'],_0xd0b8('0x73')][_0xd0b8('0x14')]('\x20')});})['catch'](function(_0x1c88a7){_0x128637(_0x2b74cc[_0xd0b8('0x10')](0x1f5,[_0x289afe[_0xd0b8('0x5d')],_0x1c88a7[_0xd0b8('0x1e')][_0xd0b8('0x66')]()]['join']('\x20')));});}else{return _0x128637(_0x2b74cc[_0xd0b8('0x10')](0x1f5,_0xd0b8('0x6e')));}});},'VoiceQueuesChannels':function(_0xbc812f){return new Promise(function(_0x32c50c,_0x5b1645){var _0x10657a=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0x74')]);_0x32c50c({'count':_0x10657a[_0xd0b8('0x59')],'rows':_0x10657a});});},'VoiceQueuesChannel':function(_0x4c28ff){var _0x31e7ab=this;return new Promise(function(_0x986fe,_0x5e6734){var _0x27e91a=schema(properties[_0xd0b8('0x75')])[_0xd0b8('0x3')](_0x4c28ff);if(_0x27e91a[_0xd0b8('0x59')]>0x0){return _0x5e6734(_0x31e7ab[_0xd0b8('0x10')](0x1f4,_['map'](_0x27e91a,'message')[_0xd0b8('0x14')](',\x20')));}var _0x5d4a5e=_[_0xd0b8('0x5c')](_0x451108[_0xd0b8('0x74')],{'uniqueid':_0x4c28ff[_0xd0b8('0x5d')]});if(_0x5d4a5e){_0x986fe(_0x5d4a5e);}else{return _0x5e6734(_0x31e7ab[_0xd0b8('0x10')](0x1f5,_0xd0b8('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x3a8e27){var _0x135cec=this;return new Promise(function(_0x2eee38,_0x364e60){if(ami[_0xd0b8('0xf')]()==![]){return _0x364e60(_0x135cec['error'](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x2d6121=schema(properties[_0xd0b8('0x76')])['validate'](_0x3a8e27);if(_0x2d6121['length']>0x0){return _0x364e60(_0x135cec['error'](0x1f4,_[_0xd0b8('0x5b')](_0x2d6121,_0xd0b8('0x1e'))[_0xd0b8('0x14')](',\x20')));}var _0x9d0ec7=_[_0xd0b8('0x5c')](_0x451108[_0xd0b8('0x74')],{'uniqueid':_0x3a8e27[_0xd0b8('0x5d')]});if(_0x9d0ec7&&_0x9d0ec7[_0xd0b8('0x5e')]){return ami[_0xd0b8('0x1b')]({'action':'Hangup','channel':_0x9d0ec7[_0xd0b8('0x5e')]})[_0xd0b8('0x18')](function(_0x2ee2fb){_0x2eee38({'code':0xc8,'message':[_0x3a8e27[_0xd0b8('0x5d')],_0x2ee2fb[_0xd0b8('0x1e')][_0xd0b8('0x66')]()][_0xd0b8('0x14')]('\x20')});})[_0xd0b8('0x1d')](function(_0x3424fb){_0x364e60(_0x135cec['error'](0x1f5,[_0x3a8e27['uniqueid'],_0x3424fb[_0xd0b8('0x1e')][_0xd0b8('0x66')]()][_0xd0b8('0x14')]('\x20')));});}else{return _0x364e60(_0x135cec[_0xd0b8('0x10')](0x1f5,_0xd0b8('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x5958d0){var _0x5ce35a=this;return new Promise(function(_0x16fc4c,_0x374c35){if(ami[_0xd0b8('0xf')]()==![]){return _0x374c35(_0x5ce35a['error'](0x1f4,[config[_0xd0b8('0x11')]['ip'],config[_0xd0b8('0x11')]['username'],_0xd0b8('0x13')][_0xd0b8('0x14')]('\x20')));}var _0xd57072=schema(properties[_0xd0b8('0x77')])[_0xd0b8('0x3')](_0x5958d0);if(_0xd57072[_0xd0b8('0x59')]>0x0){return _0x374c35(_0x5ce35a['error'](0x1f4,_[_0xd0b8('0x5b')](_0xd57072,'message')[_0xd0b8('0x14')](',\x20')));}var _0x40978c=_[_0xd0b8('0x5c')](_0x451108[_0xd0b8('0x74')],{'uniqueid':_0x5958d0[_0xd0b8('0x5d')]});if(_0x40978c&&_0x40978c[_0xd0b8('0x5e')]){return ami[_0xd0b8('0x1b')]({'action':_0xd0b8('0x78'),'channel':_0x40978c[_0xd0b8('0x5e')],'exten':_0x5958d0[_0xd0b8('0x79')],'context':_0x5958d0[_0xd0b8('0x7a')]||_0x40978c[_0xd0b8('0x7a')],'priority':0x1})['then'](function(_0x480311){_0x16fc4c({'code':0xc8,'message':[_0x5958d0[_0xd0b8('0x5d')],_0x480311[_0xd0b8('0x1e')]['toLowerCase']()]['join']('\x20')});})[_0xd0b8('0x1d')](function(_0x953e36){_0x374c35(_0x5ce35a[_0xd0b8('0x10')](0x1f5,[_0x5958d0['uniqueid'],_0x953e36[_0xd0b8('0x1e')][_0xd0b8('0x66')]()][_0xd0b8('0x14')]('\x20')));});}else{return _0x374c35(_0x5ce35a['error'](0x1f5,_0xd0b8('0x6e')));}});},'Agents':function(_0x500d36){return new Promise(function(_0x6f62a9,_0x40c0f8){var _0x338d44=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0xc')]);_0x6f62a9({'count':_0x338d44[_0xd0b8('0x59')],'rows':_0x338d44});});},'Telephones':function(_0x1853af){return new Promise(function(_0x5235fe,_0x389990){var _0x7bd3b6=_['values'](_0x451108[_0xd0b8('0x7b')]);_0x5235fe({'count':_0x7bd3b6[_0xd0b8('0x59')],'rows':_0x7bd3b6});});},'Trunks':function(_0x149553){return new Promise(function(_0x3c6be3,_0x259b74){var _0x1f6000=_[_0xd0b8('0x57')](_0x451108['trunks']);_0x3c6be3({'count':_0x1f6000[_0xd0b8('0x59')],'rows':_0x1f6000});});},'OutboundChannels':function(_0xe6eb94){return new Promise(function(_0x2c3812,_0x9745a7){var _0x31d2d0=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0x7c')]);_0x2c3812({'count':_0x31d2d0[_0xd0b8('0x59')],'rows':_0x31d2d0});});},'Outbound':function(_0x4cb04b){return new Promise(function(_0x4abe5f,_0x5e81c7){_0x4abe5f(_0x451108['outbound']);});},'Campaigns':function(_0x24ef6b){return new Promise(function(_0x400612,_0x1be4ae){var _0x1ee3ed=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0x7d')]);_0x400612({'count':_0x1ee3ed['length'],'rows':_0x1ee3ed});});},'VoiceQueuesPreview':function(_0x1a3195){var _0x20dab6=this;return new Promise(function(_0x546fe3,_0x3a20b4){_0x1c3858[_0xd0b8('0x7e')](_0x1a3195['id'])[_0xd0b8('0x18')](function(_0x445054){_0x546fe3({'code':0xc8,'message':_0x445054[_0xd0b8('0x1e')]});})[_0xd0b8('0x1d')](function(_0x3d287d){_0x3a20b4(_0x20dab6[_0xd0b8('0x10')](0x1f4,_0x3d287d['message']));});});},'EventManager':function(_0x5e172c){var _0x598543=this;return new Promise(function(_0x4ff05e,_0x186717){if(!_0x5e172c[_0xd0b8('0x7f')]){return _0x186717(_0x598543[_0xd0b8('0x10')](0x1f4,_0xd0b8('0x80')));}ami['emit'](_0xd0b8('0x81')+_0x5e172c[_0xd0b8('0x7f')],_0x5e172c['message']);_0x4ff05e({'code':0xc8,'message':_0x5e172c});});},'FaxAccounts':function(_0x2b82b0){return new Promise(function(_0x33e23e,_0x665c64){var _0x3325b3=_[_0xd0b8('0x57')](_0x451108[_0xd0b8('0x82')]);_0x33e23e({'count':_0x3325b3['length'],'rows':_0x3325b3});});},'SendFax':function(_0x535326){var _0x5df981=this;return new Promise(function(_0x18542f,_0x18100a){_0x3f8cad[_0xd0b8('0x83')](_0x535326)[_0xd0b8('0x18')](function(_0x2ec3fe){_0x18542f({'code':0xc8,'message':_0x2ec3fe['message']});})[_0xd0b8('0x1d')](function(_0xc3cc5c){_0x18100a(_0x5df981[_0xd0b8('0x10')](0x1f4,_0xc3cc5c['message']));});});},'CheckAfterSend':function(_0x4109ed){var _0x43f30d=this;return new Promise(function(_0x210d98,_0x4496a2){_0x3f8cad['checkAfterSend'](_0x4109ed)[_0xd0b8('0x18')](function(_0x3eebcf){_0x210d98({'code':0xc8,'message':_0x3eebcf['message']});})[_0xd0b8('0x1d')](function(_0x131fdc){_0x4496a2(_0x43f30d[_0xd0b8('0x10')](0x1f4,_0x131fdc[_0xd0b8('0x1e')]));});});}};var _0x202ca8=jayson[_0xd0b8('0x84')](_0x483f1a)[_0xd0b8('0x85')]();_0x202ca8['on'](_0xd0b8('0x10'),function(_0x497e3f){return _0x2d313f(_0x497e3f);});_0x202ca8['listen'](0x232a,_0xd0b8('0x86'),function(){console[_0xd0b8('0x87')](_0xd0b8('0x88'),0x232a);return _0x5af6c0(_0xd0b8('0x89')+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 57b2628..16b9df9 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 _0x7ab5=['trigger:%s','toLowerCase','catch','error','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','isNil','routeId','firstName','calleridname','','calleridnum','uniqueid','destcalleridname','phone','destcalleridnum','then','showContact','omit','xmd-contactid2','format','action','merge','data1','resolve','createContact','user:%s','name'];(function(_0x201ef0,_0x2ef642){var _0x529950=function(_0x5f4e12){while(--_0x5f4e12){_0x201ef0['push'](_0x201ef0['shift']());}};_0x529950(++_0x2ef642);}(_0x7ab5,0x106));var _0x57ab=function(_0x5c0f8d,_0x2574b1){_0x5c0f8d=_0x5c0f8d-0x0;var _0x3dae47=_0x7ab5[_0x5c0f8d];return _0x3dae47;};'use strict';var BPromise=require(_0x57ab('0x0'));var util=require(_0x57ab('0x1'));var _=require(_0x57ab('0x2'));var Redis=require(_0x57ab('0x3'));var config=require(_0x57ab('0x4'));var logger=require(_0x57ab('0x5'))(_0x57ab('0x6'));var cmContactRpc=require(_0x57ab('0x7'));config['redis']=_[_0x57ab('0x8')](config[_0x57ab('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x57ab('0xa'))(new Redis(config[_0x57ab('0x9')]));function emit(_0x478d6a,_0x23e827,_0x206563){logger[_0x57ab('0xb')](_0x478d6a,_0x23e827,JSON[_0x57ab('0xc')](_0x206563));io['to'](_0x478d6a)[_0x57ab('0xd')](_0x23e827,_0x206563);}exports[_0x57ab('0xe')]=function(_0x964013,_0x3e2989,_0x1b8f09){_0x1b8f09[_0x57ab('0xf')]=0x0;if(_0x3e2989['data2']&&parseInt(_0x3e2989[_0x57ab('0x10')],0xa)){var _0x3d140f={'ListId':parseInt(_0x3e2989['data1'],0xa),'phone':_0x1b8f09['calleridnum']};if(_[_0x57ab('0x11')](_0x1b8f09[_0x57ab('0x12')])){_0x3d140f[_0x57ab('0x13')]=_0x1b8f09['calleridname']&&_0x1b8f09[_0x57ab('0x14')]!==_0x57ab('0x15')?_0x1b8f09[_0x57ab('0x14')]:_0x1b8f09[_0x57ab('0x16')]||_0x1b8f09[_0x57ab('0x17')];}else{_0x3d140f[_0x57ab('0x13')]=_0x1b8f09[_0x57ab('0x18')]&&_0x1b8f09[_0x57ab('0x18')]!==_0x57ab('0x15')?_0x1b8f09[_0x57ab('0x18')]:_0x1b8f09['destcalleridnum']||_0x1b8f09[_0x57ab('0x17')];_0x3d140f[_0x57ab('0x19')]=_0x1b8f09[_0x57ab('0x18')]&&_0x1b8f09[_0x57ab('0x18')]!==_0x57ab('0x15')?_0x1b8f09[_0x57ab('0x18')]:_0x1b8f09[_0x57ab('0x1a')]||_0x1b8f09['uniqueid'];}BPromise['resolve']()[_0x57ab('0x1b')](cmContactRpc[_0x57ab('0x1c')]({'where':_[_0x57ab('0x1d')](_0x3d140f,[_0x57ab('0x13')])}))['then'](function(_0x28ed86){if(_0x28ed86){_0x1b8f09[_0x57ab('0x1e')]=_0x28ed86['id'];emit(util['format']('user:%s',_0x964013['name']),util[_0x57ab('0x1f')]('trigger:%s',_0x3e2989[_0x57ab('0x20')]['toLowerCase']()),_[_0x57ab('0x21')](_0x1b8f09,{'ListId':parseInt(_0x3e2989[_0x57ab('0x22')],0xa)}));return;}else{return BPromise[_0x57ab('0x23')]()[_0x57ab('0x1b')](cmContactRpc[_0x57ab('0x24')](_0x3d140f));}})[_0x57ab('0x1b')](function(_0x3cf345){if(_0x3cf345){_0x1b8f09[_0x57ab('0x1e')]=_0x3cf345['id'];emit(util[_0x57ab('0x1f')](_0x57ab('0x25'),_0x964013[_0x57ab('0x26')]),util['format'](_0x57ab('0x27'),_0x3e2989[_0x57ab('0x20')][_0x57ab('0x28')]()),_['merge'](_0x1b8f09,{'ListId':parseInt(_0x3e2989['data1'],0xa)}));}})[_0x57ab('0x29')](function(_0x865507){logger[_0x57ab('0x2a')]('Error\x20creating\x20contact',JSON[_0x57ab('0xc')](_0x865507));});}else{if(_0x964013){emit(util[_0x57ab('0x1f')](_0x57ab('0x25'),_0x964013[_0x57ab('0x26')]),util[_0x57ab('0x1f')]('trigger:%s',_0x3e2989[_0x57ab('0x20')][_0x57ab('0x28')]()),_[_0x57ab('0x21')]({'ListId':parseInt(_0x3e2989[_0x57ab('0x22')],0xa)},_0x1b8f09));}}}; \ No newline at end of file +var _0xed9c=['action','toLowerCase','merge','createContact','trigger:%s','catch','error','Error\x20creating\x20contact','user:%s','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','firstName','calleridname','','uniqueid','destcalleridname','phone','destcalleridnum','resolve','omit','then','xmd-contactid2','format','name'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0xed9c,0xa9));var _0xced9=function(_0x1ea8a2,_0xb97f7a){_0x1ea8a2=_0x1ea8a2-0x0;var _0x1d16dc=_0xed9c[_0x1ea8a2];return _0x1d16dc;};'use strict';var BPromise=require(_0xced9('0x0'));var util=require(_0xced9('0x1'));var _=require('lodash');var Redis=require(_0xced9('0x2'));var config=require(_0xced9('0x3'));var logger=require(_0xced9('0x4'))(_0xced9('0x5'));var cmContactRpc=require(_0xced9('0x6'));config[_0xced9('0x7')]=_['defaults'](config['redis'],{'host':_0xced9('0x8'),'port':0x18eb});var io=require(_0xced9('0x9'))(new Redis(config[_0xced9('0x7')]));function emit(_0x5c8b89,_0x316c4b,_0x273e29){logger[_0xced9('0xa')](_0x5c8b89,_0x316c4b,JSON[_0xced9('0xb')](_0x273e29));io['to'](_0x5c8b89)[_0xced9('0xc')](_0x316c4b,_0x273e29);}exports[_0xced9('0xd')]=function(_0x667a04,_0x374faf,_0x48c3e9){_0x48c3e9[_0xced9('0xe')]=0x0;if(_0x374faf[_0xced9('0xf')]&&parseInt(_0x374faf[_0xced9('0xf')],0xa)){var _0x4834c8={'ListId':parseInt(_0x374faf[_0xced9('0x10')],0xa),'phone':_0x48c3e9[_0xced9('0x11')]};if(_['isNil'](_0x48c3e9['routeId'])){_0x4834c8[_0xced9('0x12')]=_0x48c3e9[_0xced9('0x13')]&&_0x48c3e9['calleridname']!==_0xced9('0x14')?_0x48c3e9[_0xced9('0x13')]:_0x48c3e9[_0xced9('0x11')]||_0x48c3e9[_0xced9('0x15')];}else{_0x4834c8['firstName']=_0x48c3e9[_0xced9('0x16')]&&_0x48c3e9[_0xced9('0x16')]!==_0xced9('0x14')?_0x48c3e9[_0xced9('0x16')]:_0x48c3e9['destcalleridnum']||_0x48c3e9[_0xced9('0x15')];_0x4834c8[_0xced9('0x17')]=_0x48c3e9[_0xced9('0x16')]&&_0x48c3e9['destcalleridname']!==_0xced9('0x14')?_0x48c3e9[_0xced9('0x16')]:_0x48c3e9[_0xced9('0x18')]||_0x48c3e9['uniqueid'];}BPromise[_0xced9('0x19')]()['then'](cmContactRpc['showContact']({'where':_[_0xced9('0x1a')](_0x4834c8,[_0xced9('0x12')])}))[_0xced9('0x1b')](function(_0x493159){if(_0x493159){_0x48c3e9[_0xced9('0x1c')]=_0x493159['id'];emit(util[_0xced9('0x1d')]('user:%s',_0x667a04[_0xced9('0x1e')]),util[_0xced9('0x1d')]('trigger:%s',_0x374faf[_0xced9('0x1f')][_0xced9('0x20')]()),_[_0xced9('0x21')](_0x48c3e9,{'ListId':parseInt(_0x374faf['data1'],0xa)}));return;}else{return BPromise[_0xced9('0x19')]()[_0xced9('0x1b')](cmContactRpc[_0xced9('0x22')](_0x4834c8));}})[_0xced9('0x1b')](function(_0x438242){if(_0x438242){_0x48c3e9[_0xced9('0x1c')]=_0x438242['id'];emit(util[_0xced9('0x1d')]('user:%s',_0x667a04[_0xced9('0x1e')]),util[_0xced9('0x1d')](_0xced9('0x23'),_0x374faf[_0xced9('0x1f')][_0xced9('0x20')]()),_[_0xced9('0x21')](_0x48c3e9,{'ListId':parseInt(_0x374faf[_0xced9('0x10')],0xa)}));}})[_0xced9('0x24')](function(_0x2fe502){logger[_0xced9('0x25')](_0xced9('0x26'),JSON[_0xced9('0xb')](_0x2fe502));});}else{if(_0x667a04){emit(util['format'](_0xced9('0x27'),_0x667a04[_0xced9('0x1e')]),util[_0xced9('0x1d')](_0xced9('0x23'),_0x374faf[_0xced9('0x1f')][_0xced9('0x20')]()),_[_0xced9('0x21')]({'ListId':parseInt(_0x374faf[_0xced9('0x10')],0xa)},_0x48c3e9));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index bdda68d..aabc9a3 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 _0xbee9=['integration','queue','routeId','script','parse','search','AllConditions','every','checkConditions','channel','AnyConditions','some','account','chat','ChatWebsiteId','operator','upperFirst','message','value','event','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./integration','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','accounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','data6','winApplication','winArguments','format','user:%s','name','jscripty','trigger:%s','exec'];(function(_0x15ee04,_0x5e03f8){var _0x36d839=function(_0x13fe46){while(--_0x13fe46){_0x15ee04['push'](_0x15ee04['shift']());}};_0x36d839(++_0x5e03f8);}(_0xbee9,0xf9));var _0x9bee=function(_0x11b0b5,_0x869562){_0x11b0b5=_0x11b0b5-0x0;var _0x16092a=_0xbee9[_0x11b0b5];return _0x16092a;};'use strict';var util=require(_0x9bee('0x0'));var _=require(_0x9bee('0x1'));var url=require(_0x9bee('0x2'));var Mustache=require(_0x9bee('0x3'));var Redis=require(_0x9bee('0x4'));var urlforward=require('./urlforward');var integration=require(_0x9bee('0x5'));var cmContact=require('./cmContact');var script=require(_0x9bee('0x6'));var cmContactRpc=require(_0x9bee('0x7'));var config=require(_0x9bee('0x8'));var logger=require(_0x9bee('0x9'))(_0x9bee('0xa'));var ami=require(_0x9bee('0xb'));config[_0x9bee('0xc')]=_[_0x9bee('0xd')](config[_0x9bee('0xc')],{'host':_0x9bee('0xe'),'port':0x18eb});var io=require(_0x9bee('0xf'))(new Redis(config[_0x9bee('0xc')]));var operators={'equals':function(_0x59c1ec,_0x4d1025){return _0x59c1ec==_0x4d1025;},'not_equals':function(_0x1c1b40,_0x3ca7cd){return _0x1c1b40!=_0x3ca7cd;}};var barAndWebActions=[_0x9bee('0x10'),_0x9bee('0x2'),_0x9bee('0x11')];function Trigger(_0x15ade4){this[_0x9bee('0x12')]=_0x15ade4[_0x9bee('0x12')];this[_0x9bee('0x13')]=_0x15ade4[_0x9bee('0x13')];this[_0x9bee('0x14')]=_0x15ade4[_0x9bee('0x14')];this['templates']=_0x15ade4[_0x9bee('0x15')];this['voiceExtensions']=_0x15ade4[_0x9bee('0x16')];this[_0x9bee('0x17')]=_0x15ade4[_0x9bee('0x17')];this['freshdeskAccounts']=_0x15ade4[_0x9bee('0x18')];this[_0x9bee('0x19')]=_0x15ade4[_0x9bee('0x19')];this['sugarcrmAccounts']=_0x15ade4['sugarcrmAccounts'];this['zohoAccounts']=_0x15ade4[_0x9bee('0x1a')];this['deskAccounts']=_0x15ade4['deskAccounts'];this['vtigerAccounts']=_0x15ade4['vtigerAccounts'];this[_0x9bee('0x1b')]=_0x15ade4['servicenowAccounts'];this[_0x9bee('0x1c')]=_0x15ade4[_0x9bee('0x1c')];this[_0x9bee('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x9bee('0x19')],'freshdesk':this[_0x9bee('0x18')],'sugarcrm':this[_0x9bee('0x1e')],'zoho':this['zohoAccounts'],'desk':this[_0x9bee('0x1f')],'vtiger':this[_0x9bee('0x20')],'servicenow':this[_0x9bee('0x1b')],'dynamics365':this[_0x9bee('0x1c')]};ami['on'](_0x9bee('0x21'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x24'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x25'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x26'),this['syncCustomEvent'][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x27'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x28'),this[_0x9bee('0x29')]['bind'](this));ami['on'](_0x9bee('0x2a'),this[_0x9bee('0x29')]['bind'](this));ami['on'](_0x9bee('0x2b'),this['syncAgentDial'][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x2c'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x2d'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x2e'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x2f'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on']('custom:acceptmessage',this[_0x9bee('0x22')][_0x9bee('0x23')](this));ami['on'](_0x9bee('0x30'),this[_0x9bee('0x22')][_0x9bee('0x23')](this));}Trigger[_0x9bee('0x31')][_0x9bee('0x32')]=function(_0x2e2a3f,_0x242369,_0x3fe60c){logger['info'](_0x2e2a3f,_0x242369,JSON[_0x9bee('0x33')](_0x3fe60c));io['to'](_0x2e2a3f)[_0x9bee('0x32')](_0x242369,_0x3fe60c);};Trigger[_0x9bee('0x31')][_0x9bee('0x22')]=function(_0x348591){var _0x3cfc8b=_[_0x9bee('0x34')](_0x348591);this[_0x9bee('0x35')](_0x3cfc8b);};Trigger[_0x9bee('0x31')]['syncAgentDial']=function(_0x4a1c28){if(this[_0x9bee('0x13')][_0x4a1c28[_0x9bee('0x36')]]){this[_0x9bee('0x22')](_0x4a1c28);}};Trigger[_0x9bee('0x31')]['checkTriggers']=function(_0x2ef096){var _0x468bf8;for(var _0x2fcb8e in this['triggers']){if(this['triggers'][_0x9bee('0x37')](_0x2fcb8e)){if(this[_0x9bee('0x12')][_0x2fcb8e][_0x9bee('0x38')]){_0x468bf8=this[_0x9bee('0x39')](this[_0x9bee('0x12')][_0x2fcb8e],_0x2ef096);if(_0x468bf8){_[_0x9bee('0x3a')](_0x2ef096,_0x2ef096[_0x9bee('0x3b')]);for(var _0x48742e=0x0,_0x3ef190,_0x5b46ef,_0x6788ae;_0x48742e0x0){_0x59964c=_[_0x1767('0x2b')](_0x3b9c7d,_0xc5d622);}return _0x59964c;}function getCustomFields(_0x28f5f1,_0x16e058){var _0x3b9038=[];var _0x4a79c3={'custom_fields':{}};if(_0x28f5f1[_0x1767('0x2a')]>0x0){_[_0x1767('0x2c')](_0x28f5f1,function(_0x6ddcea){if(_0x6ddcea[_0x1767('0x2d')]===_0x1767('0x2e')&&_0x6ddcea['nameField']&&!_0x6ddcea[_0x1767('0x2f')]){_0x4a79c3[_0x6ddcea[_0x1767('0x30')][_0x1767('0x31')]()]=_0x6ddcea[_0x1767('0x32')][_0x1767('0x21')]();}else if(_0x6ddcea[_0x1767('0x2d')]===_0x1767('0x2e')&&_0x6ddcea['idField']&&_0x6ddcea['customField']){_0x4a79c3[_0x1767('0x33')][_0x6ddcea[_0x1767('0x34')]]=_0x6ddcea[_0x1767('0x32')][_0x1767('0x21')]();}else if(_0x6ddcea[_0x1767('0x2d')]===_0x1767('0x35')&&_0x6ddcea[_0x1767('0x36')]&&_0x6ddcea[_0x1767('0x34')]&&_0x6ddcea['customField']){_0x16e058[_0x6ddcea[_0x1767('0x36')]]&&(_0x4a79c3['custom_fields'][_0x6ddcea['idField']]=_0x16e058[_0x6ddcea['variableName']][_0x1767('0x21')]());}else if(_0x6ddcea[_0x1767('0x2d')]===_0x1767('0x37')&&_0x6ddcea[_0x1767('0x38')]&&_0x6ddcea[_0x1767('0x38')][_0x1767('0x39')]&&_0x6ddcea['idField']&&_0x6ddcea[_0x1767('0x2f')]){_0x16e058[_0x6ddcea[_0x1767('0x38')][_0x1767('0x39')]['toLowerCase']()]&&(_0x4a79c3[_0x1767('0x33')][_0x6ddcea[_0x1767('0x34')]]=_0x16e058[_0x6ddcea[_0x1767('0x38')][_0x1767('0x39')][_0x1767('0x31')]()][_0x1767('0x21')]());}});}if(_0x4a79c3[_0x1767('0x3a')]){_0x4a79c3[_0x1767('0x3a')]=Number(_0x4a79c3['priority']);}return _0x4a79c3;}function getTicket(_0x40b7c0,_0x4e3e79,_0x1ef220,_0x168631,_0x39dbe9){logger[_0x1767('0xc')](_0x1767('0x3b'));var _0x37f1ca=_[_0x1767('0x3c')]({'subject':intUtil['getString'](_0x168631[_0x1767('0x3d')],_0x39dbe9,'\x20'),'type':'phone','status':_0x1767('0x3e'),'labels':[_0x1767('0x3f'),_0x1767('0x40'),_0x1767('0x41')][_0x1767('0x42')](getTags(_0x168631[_0x1767('0x43')],_0x1767('0x39'))),'description':intUtil['getString'](_0x168631[_0x1767('0x44')],_0x39dbe9,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x1767('0x45'),_0x4e3e79['id']),'class':_0x1767('0x46')}},'message':{'direction':'in','body':intUtil[_0x1767('0x47')](_0x168631[_0x1767('0x44')],_0x39dbe9,'\x0a')}},getCustomFields(_0x168631[_0x1767('0x48')],_0x39dbe9));return request({'uri':util[_0x1767('0xe')](_0x1767('0x49'),_0x40b7c0[_0x1767('0x10')],_0x1ef220['id']),'method':_0x1767('0x28'),'body':_0x37f1ca});}exports[_0x1767('0x4a')]=function(_0x453971,_0x2d39cb,_0x1c3ffd,_0x4cfe43,_0x870844,_0x37e0e4){var _0x292dd5,_0x5a2dfd;_0x37e0e4[_0x1767('0x10')]=intUtil[_0x1767('0x4b')](_0x37e0e4[_0x1767('0x10')]);_0x37e0e4['serverUrl']=intUtil[_0x1767('0x4b')](_0x37e0e4[_0x1767('0x4c')]);if(_0x870844&&_0x870844['monitor_format']){logger[_0x1767('0xc')](_0x1767('0x4d'),'Recording\x20is\x20enabled!');_0x2d39cb[_0x1767('0x4e')]=util[_0x1767('0xe')](_0x1767('0x4f'),_0x37e0e4['serverUrl'],_0x2d39cb['uniqueid'],md5(_0x2d39cb['uniqueid']));}else{_0x2d39cb[_0x1767('0x4e')]='';}headers[_0x1767('0x50')]=getAuth(_0x37e0e4);return getUser(_0x37e0e4,_0x4cfe43[_0x1767('0x51')])[_0x1767('0x11')](function(_0x39be13){_0x292dd5=_0x39be13;logger['info']('The\x20User\x20ID\x20is:',_0x292dd5['id']);return getEndUser(_0x37e0e4,_0x2d39cb[_0x1767('0x52')],_0x2d39cb[_0x1767('0x53')]);})[_0x1767('0x11')](function(_0x11333d){_0x5a2dfd=_0x11333d;logger['info'](_0x1767('0x54'),_0x5a2dfd['id']);return getTicket(_0x37e0e4,_0x292dd5,_0x5a2dfd,_0x1c3ffd,_0x2d39cb);})[_0x1767('0x11')](function(_0x44a702){if(_0x44a702){logger['info'](_0x1767('0x55'));logger[_0x1767('0xc')](_0x1767('0x56'),_0x44a702['id']);switch(_0x37e0e4[_0x1767('0x2d')]){case _0x1767('0x57'):logger[_0x1767('0xc')](_0x1767('0x4d'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4cfe43[_0x1767('0x39')]),_0x1767('0x58'),{'recordId':_0x44a702['id']});break;case _0x1767('0x59'):logger[_0x1767('0xc')](_0x1767('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1767('0xe')](_0x1767('0x5a'),_0x4cfe43[_0x1767('0x39')]),_0x1767('0x5b'),{'uri':util[_0x1767('0xe')](_0x1767('0x5c'),_0x44a702['id'])});break;default:logger['error']('[QUEUE]',_0x1767('0x5d'));}}})[_0x1767('0x5e')](function(_0x3e6715){console[_0x1767('0x5f')](_0x3e6715);logger['error']('[QUEUE]',JSON[_0x1767('0x19')](_0x3e6715));});};exports[_0x1767('0x60')]=function(_0xe18ab4,_0x2c1674,_0x423855,_0x18a47e,_0x35b9be,_0x5b174f,_0x1d197f){var _0x49541f,_0x294ce9;_0x5b174f[_0x1767('0x10')]=intUtil[_0x1767('0x4b')](_0x5b174f[_0x1767('0x10')]);_0x5b174f[_0x1767('0x4c')]=intUtil[_0x1767('0x4b')](_0x5b174f[_0x1767('0x4c')]);if(_0x1d197f&&_0x1d197f[_0x1767('0x61')]&&_0x1d197f['recordingFormat']!==_0x1767('0x62')){logger['info']('[OUTBOUND]',_0x1767('0x63'));_0x2c1674[_0x1767('0x4e')]=util[_0x1767('0xe')](_0x1767('0x4f'),_0x5b174f[_0x1767('0x4c')],_0x2c1674[_0x1767('0x64')],md5(_0x2c1674[_0x1767('0x64')]));}headers[_0x1767('0x50')]=getAuth(_0x5b174f);return getUser(_0x5b174f,_0x18a47e['email'])[_0x1767('0x11')](function(_0x29e15a){_0x49541f=_0x29e15a;logger[_0x1767('0xc')](_0x1767('0x65'),_0x49541f['id']);return getEndUser(_0x5b174f,_0x2c1674[_0x1767('0x66')],_0x2c1674[_0x1767('0x67')]);})[_0x1767('0x11')](function(_0x59757a){_0x294ce9=_0x59757a;logger[_0x1767('0xc')]('The\x20Enduser\x20ID\x20is:',_0x294ce9['id']);return getTicket(_0x5b174f,_0x49541f,_0x294ce9,_0x423855,_0x2c1674);})[_0x1767('0x11')](function(_0xf6f8b7){if(_0xf6f8b7){logger[_0x1767('0xc')](_0x1767('0x55'));logger[_0x1767('0xc')]('The\x20Ticket\x20ID\x20is:',_0xf6f8b7['id']);switch(_0x5b174f['type']){case'integrationTab':logger[_0x1767('0xc')](_0x1767('0x4d'),_0x1767('0x68'));emit(util[_0x1767('0xe')](_0x1767('0x5a'),_0x18a47e[_0x1767('0x39')]),'trigger:desk:display',{'recordId':_0xf6f8b7['id']});break;case _0x1767('0x59'):logger[_0x1767('0xc')](_0x1767('0x4d'),_0x1767('0x69'));emit(util['format']('user:%s',_0x18a47e['name']),_0x1767('0x5b'),{'uri':util[_0x1767('0xe')](_0x1767('0x6a'),_0x5b174f[_0x1767('0x10')],_0xf6f8b7['id'])});break;default:logger[_0x1767('0x5f')]('[OUTBOUND]',_0x1767('0x5d'));}}})[_0x1767('0x5e')](function(_0x7b76fc){logger[_0x1767('0x5f')]('[OUTBOUND]',JSON['stringify'](_0x7b76fc));});};exports[_0x1767('0x6b')]=function(_0x30fcb1,_0x18a279,_0x107146,_0x2d17ff,_0x4bb074,_0x3dc4f6){var _0x1b664a,_0x119083;_0x3dc4f6[_0x1767('0x10')]=intUtil[_0x1767('0x4b')](_0x3dc4f6['remoteUri']);_0x3dc4f6[_0x1767('0x4c')]=intUtil['stripTrailingSlash'](_0x3dc4f6[_0x1767('0x4c')]);if(_0x4bb074&&_0x4bb074['monitor_format']){logger[_0x1767('0xc')](_0x1767('0x6c'),_0x1767('0x63'));_0x18a279['recordingURL']=util[_0x1767('0xe')](_0x1767('0x4f'),_0x3dc4f6[_0x1767('0x4c')],_0x18a279[_0x1767('0x64')],md5(_0x18a279[_0x1767('0x64')]));}else{_0x18a279['recordingURL']='';}headers['Authorization']=getAuth(_0x3dc4f6);return getUser(_0x3dc4f6)[_0x1767('0x11')](function(_0x1a6b9b){_0x1b664a=_0x1a6b9b;logger[_0x1767('0xc')](_0x1767('0x65'),_0x1b664a['id']);return getEndUser(_0x3dc4f6,_0x18a279['calleridname'],_0x18a279[_0x1767('0x53')]);})[_0x1767('0x11')](function(_0x30de2f){_0x119083=_0x30de2f;logger[_0x1767('0xc')](_0x1767('0x54'),_0x119083['id']);return getTicket(_0x3dc4f6,_0x1b664a,_0x119083,_0x107146,_0x18a279);})[_0x1767('0x11')](function(_0x7c6907){if(_0x7c6907){logger[_0x1767('0xc')]('Ticket\x20created!');logger[_0x1767('0xc')](_0x1767('0x56'),_0x7c6907['id']);}})['catch'](function(_0x4f597d){logger[_0x1767('0x5f')](_0x1767('0x6c'),JSON[_0x1767('0x19')](_0x4f597d));});}; \ No newline at end of file +var _0x6f41=['%s/users','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','[HTTP]','stringify','defaults','GET','authType','basic','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Enduser\x20found!','%s/customers','POST','work','length','map','type','string','nameField','customField','toLowerCase','content','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','new','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','%s/agent/tickets/%s','abandoned','monitor_format','[ABANDONED]','lodash','md5','util','ioredis','./util','../../../../config/logger','desk','redis','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format'];(function(_0x5cdc0b,_0x2a9a97){var _0xb1fac4=function(_0xcc9446){while(--_0xcc9446){_0x5cdc0b['push'](_0x5cdc0b['shift']());}};_0xb1fac4(++_0x2a9a97);}(_0x6f41,0x199));var _0x16f4=function(_0x3f3d31,_0x275fc4){_0x3f3d31=_0x3f3d31-0x0;var _0x563568=_0x6f41[_0x3f3d31];return _0x563568;};'use strict';var _=require(_0x16f4('0x0'));var rp=require('request-promise');var md5=require(_0x16f4('0x1'));var util=require(_0x16f4('0x2'));var Redis=require(_0x16f4('0x3'));var intUtil=require(_0x16f4('0x4'));var config=require('../../../../config/environment');var logger=require(_0x16f4('0x5'))(_0x16f4('0x6'));config[_0x16f4('0x7')]=_['defaults'](config[_0x16f4('0x7')],{'host':_0x16f4('0x8'),'port':0x18eb});var io=require(_0x16f4('0x9'))(new Redis(config[_0x16f4('0x7')]));function emit(_0x45f7ea,_0x548237,_0x137e5d){io['to'](_0x45f7ea)['emit'](_0x548237,_0x137e5d);}var headers={'Content-Type':_0x16f4('0xa'),'Accept':_0x16f4('0xa')};function getUser(_0x15251d,_0x16ed50){if(intUtil[_0x16f4('0xb')](_0x16ed50)===!![]){logger[_0x16f4('0xc')](_0x16f4('0xd'),_0x16ed50);return request({'uri':util[_0x16f4('0xe')](_0x16f4('0xf'),_0x15251d[_0x16f4('0x10')])})[_0x16f4('0x11')](function(_0x4bfe4a){if(_0x4bfe4a[_0x16f4('0x12')]){return _[_0x16f4('0x13')](_0x4bfe4a[_0x16f4('0x14')][_0x16f4('0x15')],{'email':_0x16ed50});}})[_0x16f4('0x11')](function(_0x534a31){if(_0x534a31){logger[_0x16f4('0xc')](_0x16f4('0x16'));return _0x534a31;}else{logger[_0x16f4('0xc')](_0x16f4('0x17'));return request({'uri':util[_0x16f4('0xe')](_0x16f4('0x18'),_0x15251d[_0x16f4('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x16f4('0xe')](_0x16f4('0x18'),_0x15251d['remoteUri'])});}}function request(_0x4a2e09){logger['debug'](_0x16f4('0x19'),JSON[_0x16f4('0x1a')](_0x4a2e09));return rp(_[_0x16f4('0x1b')](_0x4a2e09,{'method':_0x16f4('0x1c'),'headers':headers,'json':!![]}));}function getAuth(_0x1d1534){var _0xdb3f21;if(_0x1d1534[_0x16f4('0x1d')]===_0x16f4('0x1e')){_0xdb3f21=util['format'](_0x16f4('0x1f'),_0x1d1534[_0x16f4('0x20')],_0x1d1534['password']);}else if(_0x1d1534[_0x16f4('0x1d')]===_0x16f4('0x21')){_0xdb3f21=util['format'](_0x16f4('0x22'),_0x1d1534[_0x16f4('0x20')],_0x1d1534[_0x16f4('0x21')]);}return util[_0x16f4('0xe')](_0x16f4('0x23'),new Buffer(_0xdb3f21)[_0x16f4('0x24')](_0x16f4('0x25')));}function getEndUser(_0x5dde43,_0x36388c,_0x21b291){logger[_0x16f4('0xc')]('Searching\x20enduser\x20with\x20phone',_0x21b291);return request({'uri':util[_0x16f4('0xe')]('%s/customers/search',_0x5dde43[_0x16f4('0x10')]),'qs':{'phone':_0x21b291}})[_0x16f4('0x11')](function(_0x5d6413){if(_0x5d6413[_0x16f4('0x12')]){logger[_0x16f4('0xc')](_0x16f4('0x26'));return _0x5d6413[_0x16f4('0x14')][_0x16f4('0x15')][0x0];}else{logger[_0x16f4('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x16f4('0x27'),_0x5dde43[_0x16f4('0x10')]),'method':_0x16f4('0x28'),'body':{'first_name':_0x36388c,'title':_0x36388c,'phone_numbers':[{'type':_0x16f4('0x29'),'value':_0x21b291}]}});}});}function getTags(_0x30565a,_0x4b076e){var _0x1282e9=[];if(_0x30565a&&_0x30565a[_0x16f4('0x2a')]>0x0){_0x1282e9=_[_0x16f4('0x2b')](_0x30565a,_0x4b076e);}return _0x1282e9;}function getCustomFields(_0x48474f,_0x5a4237){var _0x78eb18=[];var _0x5e2384={'custom_fields':{}};if(_0x48474f[_0x16f4('0x2a')]>0x0){_['forEach'](_0x48474f,function(_0xce3219){if(_0xce3219[_0x16f4('0x2c')]===_0x16f4('0x2d')&&_0xce3219[_0x16f4('0x2e')]&&!_0xce3219[_0x16f4('0x2f')]){_0x5e2384[_0xce3219[_0x16f4('0x2e')][_0x16f4('0x30')]()]=_0xce3219[_0x16f4('0x31')][_0x16f4('0x24')]();}else if(_0xce3219['type']===_0x16f4('0x2d')&&_0xce3219[_0x16f4('0x32')]&&_0xce3219[_0x16f4('0x2f')]){_0x5e2384['custom_fields'][_0xce3219[_0x16f4('0x32')]]=_0xce3219[_0x16f4('0x31')][_0x16f4('0x24')]();}else if(_0xce3219[_0x16f4('0x2c')]===_0x16f4('0x33')&&_0xce3219[_0x16f4('0x34')]&&_0xce3219[_0x16f4('0x32')]&&_0xce3219[_0x16f4('0x2f')]){_0x5a4237[_0xce3219['variableName']]&&(_0x5e2384[_0x16f4('0x35')][_0xce3219[_0x16f4('0x32')]]=_0x5a4237[_0xce3219['variableName']][_0x16f4('0x24')]());}else if(_0xce3219[_0x16f4('0x2c')]===_0x16f4('0x36')&&_0xce3219[_0x16f4('0x37')]&&_0xce3219[_0x16f4('0x37')][_0x16f4('0x38')]&&_0xce3219['idField']&&_0xce3219[_0x16f4('0x2f')]){_0x5a4237[_0xce3219[_0x16f4('0x37')][_0x16f4('0x38')][_0x16f4('0x30')]()]&&(_0x5e2384[_0x16f4('0x35')][_0xce3219[_0x16f4('0x32')]]=_0x5a4237[_0xce3219[_0x16f4('0x37')][_0x16f4('0x38')]['toLowerCase']()][_0x16f4('0x24')]());}});}if(_0x5e2384[_0x16f4('0x39')]){_0x5e2384[_0x16f4('0x39')]=Number(_0x5e2384[_0x16f4('0x39')]);}return _0x5e2384;}function getTicket(_0x372622,_0x2dc474,_0x15390a,_0x637fae,_0x5d321b){logger[_0x16f4('0xc')](_0x16f4('0x3a'));var _0x2d20b0=_[_0x16f4('0x3b')]({'subject':intUtil[_0x16f4('0x3c')](_0x637fae[_0x16f4('0x3d')],_0x5d321b,'\x20'),'type':'phone','status':_0x16f4('0x3e'),'labels':[_0x16f4('0x3f'),'Motion',_0x16f4('0x40')][_0x16f4('0x41')](getTags(_0x637fae[_0x16f4('0x42')],'name')),'description':intUtil[_0x16f4('0x3c')](_0x637fae[_0x16f4('0x43')],_0x5d321b,'\x0a'),'_links':{'assigned_user':{'href':util[_0x16f4('0xe')](_0x16f4('0x44'),_0x2dc474['id']),'class':_0x16f4('0x45')}},'message':{'direction':'in','body':intUtil[_0x16f4('0x3c')](_0x637fae[_0x16f4('0x43')],_0x5d321b,'\x0a')}},getCustomFields(_0x637fae[_0x16f4('0x46')],_0x5d321b));return request({'uri':util[_0x16f4('0xe')](_0x16f4('0x47'),_0x372622[_0x16f4('0x10')],_0x15390a['id']),'method':_0x16f4('0x28'),'body':_0x2d20b0});}exports[_0x16f4('0x48')]=function(_0xa3b8dd,_0x49e25e,_0x1b32fa,_0x3cb1aa,_0x31a2f7,_0x42828b){var _0x48c597,_0x536415;_0x42828b['remoteUri']=intUtil['stripTrailingSlash'](_0x42828b[_0x16f4('0x10')]);_0x42828b[_0x16f4('0x49')]=intUtil[_0x16f4('0x4a')](_0x42828b[_0x16f4('0x49')]);if(_0x31a2f7&&_0x31a2f7['monitor_format']){logger['info'](_0x16f4('0x4b'),_0x16f4('0x4c'));_0x49e25e[_0x16f4('0x4d')]=util[_0x16f4('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42828b['serverUrl'],_0x49e25e[_0x16f4('0x4e')],md5(_0x49e25e[_0x16f4('0x4e')]));}else{_0x49e25e['recordingURL']='';}headers[_0x16f4('0x4f')]=getAuth(_0x42828b);return getUser(_0x42828b,_0x3cb1aa['email'])[_0x16f4('0x11')](function(_0x4f03c2){_0x48c597=_0x4f03c2;logger['info'](_0x16f4('0x50'),_0x48c597['id']);return getEndUser(_0x42828b,_0x49e25e[_0x16f4('0x51')],_0x49e25e['calleridnum']);})[_0x16f4('0x11')](function(_0x339966){_0x536415=_0x339966;logger['info']('The\x20Enduser\x20ID\x20is:',_0x536415['id']);return getTicket(_0x42828b,_0x48c597,_0x536415,_0x1b32fa,_0x49e25e);})[_0x16f4('0x11')](function(_0x2f9ff5){if(_0x2f9ff5){logger[_0x16f4('0xc')](_0x16f4('0x52'));logger[_0x16f4('0xc')](_0x16f4('0x53'),_0x2f9ff5['id']);switch(_0x42828b[_0x16f4('0x2c')]){case _0x16f4('0x54'):logger[_0x16f4('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x16f4('0xe')](_0x16f4('0x55'),_0x3cb1aa['name']),'trigger:desk:display',{'recordId':_0x2f9ff5['id']});break;case _0x16f4('0x56'):logger['info'](_0x16f4('0x4b'),_0x16f4('0x57'));emit(util[_0x16f4('0xe')](_0x16f4('0x55'),_0x3cb1aa[_0x16f4('0x38')]),_0x16f4('0x58'),{'uri':util[_0x16f4('0xe')](_0x16f4('0x59'),_0x2f9ff5['id'])});break;default:logger[_0x16f4('0x5a')]('[QUEUE]',_0x16f4('0x5b'));}}})[_0x16f4('0x5c')](function(_0x365a6e){console[_0x16f4('0x5a')](_0x365a6e);logger[_0x16f4('0x5a')](_0x16f4('0x4b'),JSON[_0x16f4('0x1a')](_0x365a6e));});};exports[_0x16f4('0x5d')]=function(_0x1220b7,_0x1ac800,_0x3b22e6,_0x1c0925,_0x407c5f,_0x126064,_0x2b379f){var _0x3698c1,_0x2715cc;_0x126064[_0x16f4('0x10')]=intUtil[_0x16f4('0x4a')](_0x126064[_0x16f4('0x10')]);_0x126064[_0x16f4('0x49')]=intUtil[_0x16f4('0x4a')](_0x126064['serverUrl']);if(_0x2b379f&&_0x2b379f['recordingFormat']&&_0x2b379f['recordingFormat']!==_0x16f4('0x5e')){logger[_0x16f4('0xc')](_0x16f4('0x5f'),_0x16f4('0x4c'));_0x1ac800[_0x16f4('0x4d')]=util[_0x16f4('0xe')](_0x16f4('0x60'),_0x126064[_0x16f4('0x49')],_0x1ac800[_0x16f4('0x4e')],md5(_0x1ac800['uniqueid']));}headers[_0x16f4('0x4f')]=getAuth(_0x126064);return getUser(_0x126064,_0x1c0925[_0x16f4('0x61')])[_0x16f4('0x11')](function(_0x2155c5){_0x3698c1=_0x2155c5;logger[_0x16f4('0xc')]('The\x20User\x20ID\x20is:',_0x3698c1['id']);return getEndUser(_0x126064,_0x1ac800[_0x16f4('0x62')],_0x1ac800['destcalleridnum']);})['then'](function(_0x4e22b2){_0x2715cc=_0x4e22b2;logger[_0x16f4('0xc')](_0x16f4('0x63'),_0x2715cc['id']);return getTicket(_0x126064,_0x3698c1,_0x2715cc,_0x3b22e6,_0x1ac800);})[_0x16f4('0x11')](function(_0x5754e8){if(_0x5754e8){logger[_0x16f4('0xc')]('Ticket\x20created!');logger[_0x16f4('0xc')](_0x16f4('0x53'),_0x5754e8['id']);switch(_0x126064[_0x16f4('0x2c')]){case _0x16f4('0x54'):logger[_0x16f4('0xc')]('[QUEUE]',_0x16f4('0x64'));emit(util[_0x16f4('0xe')](_0x16f4('0x55'),_0x1c0925[_0x16f4('0x38')]),_0x16f4('0x65'),{'recordId':_0x5754e8['id']});break;case'newTab':logger[_0x16f4('0xc')](_0x16f4('0x4b'),_0x16f4('0x57'));emit(util[_0x16f4('0xe')]('user:%s',_0x1c0925['name']),_0x16f4('0x58'),{'uri':util[_0x16f4('0xe')](_0x16f4('0x66'),_0x126064['remoteUri'],_0x5754e8['id'])});break;default:logger[_0x16f4('0x5a')](_0x16f4('0x5f'),_0x16f4('0x5b'));}}})[_0x16f4('0x5c')](function(_0x5eb451){logger[_0x16f4('0x5a')](_0x16f4('0x5f'),JSON[_0x16f4('0x1a')](_0x5eb451));});};exports[_0x16f4('0x67')]=function(_0x5565a5,_0x1bbcd3,_0x5a0658,_0x381e0c,_0x4c68de,_0x5e1d64){var _0x30cbe8,_0x508fec;_0x5e1d64['remoteUri']=intUtil[_0x16f4('0x4a')](_0x5e1d64[_0x16f4('0x10')]);_0x5e1d64[_0x16f4('0x49')]=intUtil[_0x16f4('0x4a')](_0x5e1d64[_0x16f4('0x49')]);if(_0x4c68de&&_0x4c68de[_0x16f4('0x68')]){logger[_0x16f4('0xc')](_0x16f4('0x69'),_0x16f4('0x4c'));_0x1bbcd3[_0x16f4('0x4d')]=util[_0x16f4('0xe')](_0x16f4('0x60'),_0x5e1d64[_0x16f4('0x49')],_0x1bbcd3[_0x16f4('0x4e')],md5(_0x1bbcd3[_0x16f4('0x4e')]));}else{_0x1bbcd3[_0x16f4('0x4d')]='';}headers['Authorization']=getAuth(_0x5e1d64);return getUser(_0x5e1d64)[_0x16f4('0x11')](function(_0x8bfae1){_0x30cbe8=_0x8bfae1;logger[_0x16f4('0xc')](_0x16f4('0x50'),_0x30cbe8['id']);return getEndUser(_0x5e1d64,_0x1bbcd3[_0x16f4('0x51')],_0x1bbcd3['calleridnum']);})[_0x16f4('0x11')](function(_0x3ba81a){_0x508fec=_0x3ba81a;logger[_0x16f4('0xc')](_0x16f4('0x63'),_0x508fec['id']);return getTicket(_0x5e1d64,_0x30cbe8,_0x508fec,_0x5a0658,_0x1bbcd3);})[_0x16f4('0x11')](function(_0x52cc36){if(_0x52cc36){logger[_0x16f4('0xc')](_0x16f4('0x52'));logger[_0x16f4('0xc')](_0x16f4('0x53'),_0x52cc36['id']);}})[_0x16f4('0x5c')](function(_0x22a94e){logger[_0x16f4('0x5a')](_0x16f4('0x69'),JSON['stringify'](_0x22a94e));});}; \ 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 bbedf37..f898e41 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 _0xf446=['email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','userId','outbound','destcalleridnum','contacts','4.0','headers','odata-entityid','lastIndexOf','enduserId','toLowerCase','calleridnum','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','substring','content','ticketType','incident','assign','Descriptions','/systemusers(','Fields','phonecall','phonecalls','Subjects','getString','callDirection','queue','format','user:%s','emit','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]',']\x20The\x20Enduser\x20ID\x20is:','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/environment','defaults','redis','localhost','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','value','isNil','validateEmail'];(function(_0x1fcbcc,_0xadd85e){var _0x2f2228=function(_0x480b5e){while(--_0x480b5e){_0x1fcbcc['push'](_0x1fcbcc['shift']());}};_0x2f2228(++_0xadd85e);}(_0xf446,0xfd));var _0x6f44=function(_0x87e81b,_0x2ddb31){_0x87e81b=_0x87e81b-0x0;var _0x1d4c78=_0xf446[_0x87e81b];return _0x1d4c78;};'use strict';var _=require('lodash');var BPromise=require(_0x6f44('0x0'));var rp=require(_0x6f44('0x1'));var util=require(_0x6f44('0x2'));var intUtil=require(_0x6f44('0x3'));var md5=require(_0x6f44('0x4'));var Redis=require(_0x6f44('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x6f44('0x6'));config['redis']=_[_0x6f44('0x7')](config[_0x6f44('0x8')],{'host':_0x6f44('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f44('0x8')]));function getAuthToken(_0x4a7c16,_0xfecfcb,_0x3f192a){var _0x1b72e0={'method':_0x6f44('0xa'),'uri':_0xfecfcb,'form':{'client_id':_0x4a7c16[_0x6f44('0xb')],'resource':_0x4a7c16[_0x6f44('0xc')],'username':_0x4a7c16['username'],'password':_0x4a7c16['password'],'grant_type':_0x6f44('0xd'),'client_secret':_0x4a7c16[_0x6f44('0xe')]},'json':!![]};return rp(_0x1b72e0)[_0x6f44('0xf')](function(_0x200f6f){return _0x200f6f[_0x6f44('0x10')];})[_0x6f44('0x11')](function(_0x33c2dd){logger[_0x6f44('0x12')]('['+[_0x3f192a[_0x6f44('0x13')]()]+_0x6f44('0x14'));return _0x33c2dd[_0x6f44('0x15')];});}function getUser(_0x3b6d32,_0x426be4,_0x47f98e,_0x3ca6ce,_0x8a340e,_0x24cdc1){return new BPromise(function(_0x51a371,_0x4fb057){return getAuthToken(_0x426be4,_0x3ca6ce,_0x24cdc1)['then'](function(_0x19bfd3){var _0x58448b={'method':'GET','uri':_0x8a340e+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x6f44('0x16')+_0x19bfd3,'OData-Version':'4.0'},'json':!![]};return rp(_0x58448b);})['then'](function(_0x3d4a7c){var _0xaf87d=_0x3d4a7c[_0x6f44('0x17')];var _0x3adea8=![];var _0x1eb800=null;if(!_[_0x6f44('0x18')](_0x47f98e)){if(intUtil[_0x6f44('0x19')](_0x47f98e[_0x6f44('0x1a')])){_0x3b6d32[_0x6f44('0x1b')]=_0x47f98e[_0x6f44('0x1a')];for(_0x1eb800=0x0;_0x1eb800<_0xaf87d['length'];_0x1eb800++){if(_0xaf87d[_0x1eb800][_0x6f44('0x1c')]===_0x47f98e[_0x6f44('0x1a')]&&!_0xaf87d[_0x1eb800]['isdisabled']){_0x3adea8=!![];logger[_0x6f44('0x1d')]('['+[_0x24cdc1[_0x6f44('0x13')]()]+_0x6f44('0x1e')+_0xaf87d[_0x1eb800][_0x6f44('0x1f')]+'!');_0x3b6d32['userId']=_0xaf87d[_0x1eb800][_0x6f44('0x1f')];}}}}if(!_0x3adea8){logger['info']('['+[_0x24cdc1[_0x6f44('0x13')]()]+_0x6f44('0x20'));_0x3b6d32[_0x6f44('0x1b')]=_0x426be4[_0x6f44('0x21')];for(_0x1eb800=0x0;_0x1eb800<_0xaf87d[_0x6f44('0x22')];_0x1eb800++){if(_0xaf87d[_0x1eb800][_0x6f44('0x1c')]===_0x426be4[_0x6f44('0x21')]){_0x3b6d32[_0x6f44('0x23')]=_0xaf87d[_0x1eb800]['systemuserid'];}}}_0x51a371(_0x3b6d32);})['catch'](function(_0x1a4fa8){_0x4fb057(_0x1a4fa8[_0x6f44('0x15')]);});});}function createEndUser(_0x20df01,_0x3464dd,_0x1200d3,_0x3dff5f,_0x4f1b6a,_0x136243){return new BPromise(function(_0x17f66c,_0x51b832){return getAuthToken(_0x3464dd,_0x1200d3,_0x136243)[_0x6f44('0xf')](function(_0x1bf040){var _0x50d435=_0x136243['toLowerCase']()===_0x6f44('0x24')?_0x4f1b6a[_0x6f44('0x25')]:_0x4f1b6a['calleridnum'];var _0x523e85={'method':_0x6f44('0xa'),'uri':_0x3dff5f+_0x6f44('0x26'),'body':{'telephone1':_0x50d435,'fullname':_0x50d435,'firstname':_0x50d435,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x20df01['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x1bf040,'OData-Version':_0x6f44('0x27')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x523e85);})[_0x6f44('0xf')](function(_0x1498e3){var _0x342499=_0x1498e3[_0x6f44('0x28')][_0x6f44('0x29')];var _0x31805f=_0x342499['substring'](_0x342499[_0x6f44('0x2a')]('(')+0x1,_0x342499[_0x6f44('0x2a')](')'));_0x20df01[_0x6f44('0x2b')]=_0x31805f;_0x17f66c(_0x20df01);})[_0x6f44('0x11')](function(_0x1e83f1){_0x51b832(_0x1e83f1[_0x6f44('0x15')]);});});}function getEndUser(_0x5973b0,_0x16e3e6,_0x44eec5,_0x437ca4,_0x377af7,_0x405c4e){return new BPromise(function(_0x401320,_0x1963e8){return getAuthToken(_0x16e3e6,_0x44eec5,_0x405c4e)['then'](function(_0xc0a184){var _0x5dcbff={'method':'GET','uri':_0x437ca4+'contacts?$select=telephone1','headers':{'Authorization':_0x6f44('0x16')+_0xc0a184,'If-None-Match':null,'OData-Version':_0x6f44('0x27')},'json':!![]};return rp(_0x5dcbff);})[_0x6f44('0xf')](function(_0xf1250f){var _0x1dfef8=null;if(_0xf1250f){var _0x570a21=_0xf1250f['value'];var _0x26e209=![];for(_0x1dfef8=0x0;_0x1dfef8<_0x570a21[_0x6f44('0x22')];_0x1dfef8++){var _0x5d064a=_0x405c4e[_0x6f44('0x2c')]()==='outbound'?_0x377af7[_0x6f44('0x25')]:_0x377af7[_0x6f44('0x2d')];if(_0x570a21[_0x1dfef8][_0x6f44('0x2e')]===_0x5d064a){_0x26e209=!![];_0x5973b0[_0x6f44('0x2b')]=_0x570a21[_0x1dfef8][_0x6f44('0x2f')];}}if(_0x26e209){_0x401320(_0x5973b0);}else{return createEndUser(_0x5973b0,_0x16e3e6,_0x44eec5,_0x437ca4,_0x377af7,_0x405c4e)[_0x6f44('0xf')](function(_0x33e1ac){logger[_0x6f44('0x1d')]('['+[_0x405c4e[_0x6f44('0x13')]()]+_0x6f44('0x30'),_0x33e1ac[_0x6f44('0x2b')]);_0x401320(_0x33e1ac);});}}else{return createEndUser(_0x5973b0,_0x16e3e6,_0x44eec5,_0x437ca4,_0x377af7,_0x405c4e)[_0x6f44('0xf')](function(_0x31973f){logger[_0x6f44('0x1d')]('['+[_0x405c4e['toUpperCase']()]+_0x6f44('0x31'),_0x31973f['enduserId']);_0x401320(_0x31973f);});}});});}function getCustomFields(_0x28d08f,_0xbf6f79,_0x20c3f1){var _0x8c6c4b={};if(_0x28d08f['length']>0x0){_[_0x6f44('0x32')](_0x28d08f,function(_0x213c8f){if(_0x213c8f[_0x6f44('0x33')]===_0x6f44('0x34')&&_0x213c8f[_0x6f44('0x35')]&&!_0x213c8f[_0x6f44('0x36')]){var _0x54921e=_0x213c8f[_0x6f44('0x37')]['toLowerCase']();var _0x2a9ab3=_0x54921e['substring'](0x0,_0x54921e[_0x6f44('0x38')]('_'));var _0x2f7657=_0x54921e[_0x6f44('0x39')](_0x54921e[_0x6f44('0x38')]('_')+0x1);if(_0x2a9ab3===_0x20c3f1){_0x8c6c4b[_0x2f7657]=_0x213c8f[_0x6f44('0x3a')];}}});}return _0x8c6c4b;}function getTicket(_0x349936,_0x574512,_0x15e4dd,_0x18b8cf,_0x2b5197,_0x31627e,_0x5d5857){return new BPromise(function(_0x343bcc,_0x1c4130){var _0x24ca49;return getAuthToken(_0x574512,_0x15e4dd,_0x5d5857)[_0x6f44('0xf')](function(_0x1be369){if(_0x31627e[_0x6f44('0x3b')]===_0x6f44('0x3c')){_0x24ca49={'method':_0x6f44('0xa'),'uri':_0x18b8cf+'incidents','body':Object[_0x6f44('0x3d')]({},{'title':intUtil['getString'](_0x31627e['Subjects'],_0x2b5197,'\x20'),'description':intUtil['getString'](_0x31627e[_0x6f44('0x3e')],_0x2b5197,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x349936[_0x6f44('0x2b')]+')','ownerid@odata.bind':_0x6f44('0x3f')+_0x349936[_0x6f44('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x31627e[_0x6f44('0x40')],_0x2b5197,_0x31627e['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x1be369,'OData-Version':_0x6f44('0x27')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x31627e[_0x6f44('0x3b')]===_0x6f44('0x41')){_0x24ca49={'method':'POST','uri':_0x18b8cf+_0x6f44('0x42'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x31627e[_0x6f44('0x43')],_0x2b5197,'\x20'),'phonenumber':String(_0x2b5197[_0x6f44('0x2d')]),'description':intUtil[_0x6f44('0x44')](_0x31627e[_0x6f44('0x3e')],_0x2b5197,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x349936[_0x6f44('0x2b')]+')','ownerid@odata.bind':_0x6f44('0x3f')+_0x349936['userId']+')','directioncode':_0x349936[_0x6f44('0x45')]===_0x6f44('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6f44('0x3f')+_0x349936[_0x6f44('0x23')]+')','participationtypemask':_0x349936['callDirection']===_0x6f44('0x46')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x349936[_0x6f44('0x2b')]+')','participationtypemask':_0x349936[_0x6f44('0x45')]===_0x6f44('0x46')?0x1:0x2}]},getCustomFields(_0x31627e[_0x6f44('0x40')],_0x2b5197,_0x31627e[_0x6f44('0x3b')])),'headers':{'Authorization':_0x6f44('0x16')+_0x1be369,'OData-Version':_0x6f44('0x27')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x24ca49);})['then'](function(_0x251729){var _0x2af250=_0x251729[_0x6f44('0x28')][_0x6f44('0x29')];var _0xd1dff4=_0x2af250[_0x6f44('0x39')](_0x2af250[_0x6f44('0x2a')]('(')+0x1,_0x2af250[_0x6f44('0x2a')](')'));_0x349936['ticketId']=_0xd1dff4;_0x343bcc(_0x349936);})[_0x6f44('0x11')](function(_0x304fe0){_0x1c4130(_0x304fe0[_0x6f44('0x15')]);});});}function emit(_0x181c39,_0x440a37,_0x4b50a7,_0x32280a){var _0x7542ac={'uri':util[_0x6f44('0x47')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x181c39,_0x4b50a7,_0x32280a)};io['to'](util[_0x6f44('0x47')](_0x6f44('0x48'),_0x440a37))[_0x6f44('0x49')]('trigger:browser:url',_0x7542ac);}exports['cs']=function(_0x66efc4,_0x298a94,_0x471571,_0x24b072,_0x57e10c,_0x4f1c5d,_0x1e7af4,_0x2e634b){var _0x3f356d={};_0x4f1c5d[_0x6f44('0xc')]=intUtil[_0x6f44('0x4a')](_0x4f1c5d[_0x6f44('0xc')]);_0x4f1c5d[_0x6f44('0x4b')]=intUtil[_0x6f44('0x4a')](_0x4f1c5d['serverUrl']);_0x3f356d[_0x6f44('0x45')]=_0x2e634b===_0x6f44('0x46')||_0x2e634b===_0x6f44('0x4c')?_0x6f44('0x46'):_0x6f44('0x24');var _0x2cf2d3=util[_0x6f44('0x47')](_0x6f44('0x4d'),_0x4f1c5d[_0x6f44('0xc')]);var _0x271367=util[_0x6f44('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x4f1c5d[_0x6f44('0x4e')]);var _0x31c172=util[_0x6f44('0x47')](_0x6f44('0x4f'),_0x4f1c5d['serverUrl'],_0x298a94[_0x6f44('0x50')],md5(_0x298a94[_0x6f44('0x50')]));if(_0x57e10c&&_0x57e10c['monitor_format']){logger[_0x6f44('0x1d')](_0x6f44('0x51'),_0x6f44('0x52'));_0x298a94['recordingURL']=_0x31c172;}else if(_0x1e7af4&&_0x1e7af4[_0x6f44('0x53')]&&_0x1e7af4[_0x6f44('0x53')]!==_0x6f44('0x54')){logger[_0x6f44('0x1d')](_0x6f44('0x55'),_0x6f44('0x52'));_0x298a94['recordingURL']=_0x31c172;}else{_0x298a94['recordingURL']='';}return getUser(_0x3f356d,_0x4f1c5d,_0x24b072,_0x271367,_0x2cf2d3,_0x2e634b)[_0x6f44('0xf')](function(_0x3c719a){logger[_0x6f44('0x1d')]('['+_0x2e634b[_0x6f44('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x3c719a[_0x6f44('0x23')]);logger[_0x6f44('0x1d')]('['+_0x2e634b['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x3c719a[_0x6f44('0x1b')]);return getEndUser(_0x3c719a,_0x4f1c5d,_0x271367,_0x2cf2d3,_0x298a94,_0x2e634b);})[_0x6f44('0xf')](function(_0x468ed8){logger[_0x6f44('0x1d')]('['+_0x2e634b[_0x6f44('0x13')]()+_0x6f44('0x56'),_0x468ed8[_0x6f44('0x2b')]);logger[_0x6f44('0x1d')]('['+_0x2e634b[_0x6f44('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x298a94[_0x6f44('0x2d')]);return getTicket(_0x468ed8,_0x4f1c5d,_0x271367,_0x2cf2d3,_0x298a94,_0x471571,_0x2e634b);})['then'](function(_0xbd5e97){logger['info'](util['format']('['+_0x2e634b[_0x6f44('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x471571[_0x6f44('0x3b')],_0xbd5e97[_0x6f44('0x57')]));logger[_0x6f44('0x1d')](util[_0x6f44('0x47')]('['+_0x2e634b[_0x6f44('0x13')]()+_0x6f44('0x58'),_0x2e634b));if(_0x2e634b!==_0x6f44('0x4c')){logger[_0x6f44('0x1d')]('['+_0x2e634b[_0x6f44('0x13')]()+']',_0x6f44('0x59'));emit(_0x4f1c5d[_0x6f44('0xc')],_0x24b072[_0x6f44('0x5a')],_0x471571[_0x6f44('0x3b')],_0xbd5e97[_0x6f44('0x57')]);}})[_0x6f44('0x11')](function(_0x4fd38e){logger[_0x6f44('0x12')]('['+_0x2e634b[_0x6f44('0x13')]()+_0x6f44('0x5b'),util[_0x6f44('0x5c')](_0x4fd38e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8323=['Subjects','Descriptions','Fields','phonecall','callDirection','queue','headers','ticketId','catch','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','abandoned','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','localhost','redis','POST','remoteUri','username','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','destcalleridnum','calleridnum','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1','outbound','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString'];(function(_0x1978c9,_0x4c3882){var _0x4cdee0=function(_0x4d4022){while(--_0x4d4022){_0x1978c9['push'](_0x1978c9['shift']());}};_0x4cdee0(++_0x4c3882);}(_0x8323,0xe5));var _0x3832=function(_0x5a6c99,_0x2a4005){_0x5a6c99=_0x5a6c99-0x0;var _0x5a715b=_0x8323[_0x5a6c99];return _0x5a715b;};'use strict';var _=require(_0x3832('0x0'));var BPromise=require(_0x3832('0x1'));var rp=require(_0x3832('0x2'));var util=require(_0x3832('0x3'));var intUtil=require('./util');var md5=require(_0x3832('0x4'));var Redis=require(_0x3832('0x5'));var logger=require(_0x3832('0x6'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x3832('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3832('0x8')]));function getAuthToken(_0x1e6e84,_0x42bfff,_0x1b2f0d){var _0x4dbbb9={'method':_0x3832('0x9'),'uri':_0x42bfff,'form':{'client_id':_0x1e6e84['clientId'],'resource':_0x1e6e84[_0x3832('0xa')],'username':_0x1e6e84[_0x3832('0xb')],'password':_0x1e6e84[_0x3832('0xc')],'grant_type':_0x3832('0xc'),'client_secret':_0x1e6e84[_0x3832('0xd')]},'json':!![]};return rp(_0x4dbbb9)[_0x3832('0xe')](function(_0x564ba5){return _0x564ba5[_0x3832('0xf')];})['catch'](function(_0x5152ab){logger[_0x3832('0x10')]('['+[_0x1b2f0d['toUpperCase']()]+_0x3832('0x11'));return _0x5152ab[_0x3832('0x12')];});}function getUser(_0x4c3acd,_0x273c0b,_0x4db95a,_0x2361cb,_0x3d5aaa,_0x42ecec){return new BPromise(function(_0x4f7666,_0x383697){return getAuthToken(_0x273c0b,_0x2361cb,_0x42ecec)[_0x3832('0xe')](function(_0x3e9cec){var _0xe95333={'method':'GET','uri':_0x3d5aaa+_0x3832('0x13'),'headers':{'Authorization':_0x3832('0x14')+_0x3e9cec,'OData-Version':_0x3832('0x15')},'json':!![]};return rp(_0xe95333);})[_0x3832('0xe')](function(_0xe6a95d){var _0xfea33c=_0xe6a95d[_0x3832('0x16')];var _0x176307=![];var _0x3cf44a=null;if(!_[_0x3832('0x17')](_0x4db95a)){if(intUtil['validateEmail'](_0x4db95a[_0x3832('0x18')])){_0x4c3acd['userEmail']=_0x4db95a[_0x3832('0x18')];for(_0x3cf44a=0x0;_0x3cf44a<_0xfea33c[_0x3832('0x19')];_0x3cf44a++){if(_0xfea33c[_0x3cf44a][_0x3832('0x1a')]===_0x4db95a[_0x3832('0x18')]&&!_0xfea33c[_0x3cf44a][_0x3832('0x1b')]){_0x176307=!![];logger[_0x3832('0x1c')]('['+[_0x42ecec[_0x3832('0x1d')]()]+_0x3832('0x1e')+_0xfea33c[_0x3cf44a][_0x3832('0x1f')]+'!');_0x4c3acd[_0x3832('0x20')]=_0xfea33c[_0x3cf44a][_0x3832('0x1f')];}}}}if(!_0x176307){logger[_0x3832('0x1c')]('['+[_0x42ecec[_0x3832('0x1d')]()]+_0x3832('0x21'));_0x4c3acd[_0x3832('0x22')]=_0x273c0b[_0x3832('0xb')];for(_0x3cf44a=0x0;_0x3cf44a<_0xfea33c['length'];_0x3cf44a++){if(_0xfea33c[_0x3cf44a][_0x3832('0x1a')]===_0x273c0b[_0x3832('0xb')]){_0x4c3acd['userId']=_0xfea33c[_0x3cf44a]['systemuserid'];}}}_0x4f7666(_0x4c3acd);})['catch'](function(_0x4d67ac){_0x383697(_0x4d67ac[_0x3832('0x12')]);});});}function createEndUser(_0x52de77,_0x44a072,_0x33a015,_0x3c680d,_0x18c7e0,_0x3a1566){return new BPromise(function(_0x1a0a52,_0x3dd145){return getAuthToken(_0x44a072,_0x33a015,_0x3a1566)[_0x3832('0xe')](function(_0x547e7d){var _0x4e5ab7=_0x3a1566[_0x3832('0x23')]()==='outbound'?_0x18c7e0[_0x3832('0x24')]:_0x18c7e0[_0x3832('0x25')];var _0x455378={'method':_0x3832('0x9'),'uri':_0x3c680d+'contacts','body':{'telephone1':_0x4e5ab7,'fullname':_0x4e5ab7,'firstname':_0x4e5ab7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3832('0x26')+_0x52de77[_0x3832('0x20')]+')'},'headers':{'Authorization':_0x3832('0x14')+_0x547e7d,'OData-Version':_0x3832('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x455378);})['then'](function(_0x3ff499){var _0x3ebafe=_0x3ff499['headers'][_0x3832('0x27')];var _0x2cac36=_0x3ebafe[_0x3832('0x28')](_0x3ebafe[_0x3832('0x29')]('(')+0x1,_0x3ebafe[_0x3832('0x29')](')'));_0x52de77[_0x3832('0x2a')]=_0x2cac36;_0x1a0a52(_0x52de77);})['catch'](function(_0x42a313){_0x3dd145(_0x42a313[_0x3832('0x12')]);});});}function getEndUser(_0x1fe6fb,_0x357c66,_0x26380a,_0xc089b7,_0x82f27,_0x16ae90){return new BPromise(function(_0x4eaff0,_0x37465d){return getAuthToken(_0x357c66,_0x26380a,_0x16ae90)[_0x3832('0xe')](function(_0xf0be8d){var _0x5d4ccf={'method':_0x3832('0x2b'),'uri':_0xc089b7+_0x3832('0x2c'),'headers':{'Authorization':_0x3832('0x14')+_0xf0be8d,'If-None-Match':null,'OData-Version':_0x3832('0x15')},'json':!![]};return rp(_0x5d4ccf);})[_0x3832('0xe')](function(_0x108d43){var _0x1b3ccf=null;if(_0x108d43){var _0x356816=_0x108d43['value'];var _0x41a3e3=![];for(_0x1b3ccf=0x0;_0x1b3ccf<_0x356816[_0x3832('0x19')];_0x1b3ccf++){var _0x323cab=_0x16ae90[_0x3832('0x23')]()===_0x3832('0x2d')?_0x82f27[_0x3832('0x24')]:_0x82f27['calleridnum'];if(_0x356816[_0x1b3ccf][_0x3832('0x2e')]===_0x323cab){_0x41a3e3=!![];_0x1fe6fb[_0x3832('0x2a')]=_0x356816[_0x1b3ccf][_0x3832('0x2f')];}}if(_0x41a3e3){_0x4eaff0(_0x1fe6fb);}else{return createEndUser(_0x1fe6fb,_0x357c66,_0x26380a,_0xc089b7,_0x82f27,_0x16ae90)[_0x3832('0xe')](function(_0x5adb14){logger[_0x3832('0x1c')]('['+[_0x16ae90[_0x3832('0x1d')]()]+_0x3832('0x30'),_0x5adb14['enduserId']);_0x4eaff0(_0x5adb14);});}}else{return createEndUser(_0x1fe6fb,_0x357c66,_0x26380a,_0xc089b7,_0x82f27,_0x16ae90)[_0x3832('0xe')](function(_0x3d6225){logger[_0x3832('0x1c')]('['+[_0x16ae90[_0x3832('0x1d')]()]+_0x3832('0x31'),_0x3d6225['enduserId']);_0x4eaff0(_0x3d6225);});}});});}function getCustomFields(_0x37ea93,_0x42705c,_0x33f002){var _0x1744e6={};if(_0x37ea93['length']>0x0){_[_0x3832('0x32')](_0x37ea93,function(_0x3239c8){if(_0x3239c8[_0x3832('0x33')]===_0x3832('0x34')&&_0x3239c8[_0x3832('0x35')]&&!_0x3239c8[_0x3832('0x36')]){var _0x459494=_0x3239c8[_0x3832('0x37')]['toLowerCase']();var _0x511961=_0x459494[_0x3832('0x28')](0x0,_0x459494[_0x3832('0x38')]('_'));var _0x11281e=_0x459494['substring'](_0x459494[_0x3832('0x38')]('_')+0x1);if(_0x511961===_0x33f002){_0x1744e6[_0x11281e]=_0x3239c8['content'];}}});}return _0x1744e6;}function getTicket(_0xed8b7d,_0x449770,_0x4cb0f1,_0x302022,_0x3c9d40,_0x963a79,_0xfb495f){return new BPromise(function(_0x12bdb2,_0x3096dd){var _0x2a1273;return getAuthToken(_0x449770,_0x4cb0f1,_0xfb495f)['then'](function(_0x351ec2){if(_0x963a79[_0x3832('0x39')]===_0x3832('0x3a')){_0x2a1273={'method':_0x3832('0x9'),'uri':_0x302022+_0x3832('0x3b'),'body':Object[_0x3832('0x3c')]({},{'title':intUtil[_0x3832('0x3d')](_0x963a79[_0x3832('0x3e')],_0x3c9d40,'\x20'),'description':intUtil[_0x3832('0x3d')](_0x963a79[_0x3832('0x3f')],_0x3c9d40,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xed8b7d[_0x3832('0x2a')]+')','ownerid@odata.bind':_0x3832('0x26')+_0xed8b7d[_0x3832('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x963a79[_0x3832('0x40')],_0x3c9d40,_0x963a79[_0x3832('0x39')])),'headers':{'Authorization':_0x3832('0x14')+_0x351ec2,'OData-Version':_0x3832('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x963a79[_0x3832('0x39')]===_0x3832('0x41')){_0x2a1273={'method':_0x3832('0x9'),'uri':_0x302022+'phonecalls','body':Object[_0x3832('0x3c')]({},{'subject':intUtil[_0x3832('0x3d')](_0x963a79[_0x3832('0x3e')],_0x3c9d40,'\x20'),'phonenumber':String(_0x3c9d40[_0x3832('0x25')]),'description':intUtil[_0x3832('0x3d')](_0x963a79['Descriptions'],_0x3c9d40,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xed8b7d[_0x3832('0x2a')]+')','ownerid@odata.bind':'/systemusers('+_0xed8b7d[_0x3832('0x20')]+')','directioncode':_0xed8b7d[_0x3832('0x42')]===_0x3832('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x3832('0x26')+_0xed8b7d[_0x3832('0x20')]+')','participationtypemask':_0xed8b7d['callDirection']===_0x3832('0x43')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xed8b7d[_0x3832('0x2a')]+')','participationtypemask':_0xed8b7d[_0x3832('0x42')]===_0x3832('0x43')?0x1:0x2}]},getCustomFields(_0x963a79[_0x3832('0x40')],_0x3c9d40,_0x963a79[_0x3832('0x39')])),'headers':{'Authorization':_0x3832('0x14')+_0x351ec2,'OData-Version':_0x3832('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2a1273);})[_0x3832('0xe')](function(_0x29dbe5){var _0x5af7c3=_0x29dbe5[_0x3832('0x44')][_0x3832('0x27')];var _0x52027c=_0x5af7c3[_0x3832('0x28')](_0x5af7c3[_0x3832('0x29')]('(')+0x1,_0x5af7c3[_0x3832('0x29')](')'));_0xed8b7d[_0x3832('0x45')]=_0x52027c;_0x12bdb2(_0xed8b7d);})[_0x3832('0x46')](function(_0xe5d081){_0x3096dd(_0xe5d081[_0x3832('0x12')]);});});}function emit(_0x1dfb2f,_0x344748,_0x472b93,_0x5ed6cd){var _0x588ed0={'uri':util[_0x3832('0x47')](_0x3832('0x48'),_0x1dfb2f,_0x472b93,_0x5ed6cd)};io['to'](util['format'](_0x3832('0x49'),_0x344748))[_0x3832('0x4a')](_0x3832('0x4b'),_0x588ed0);}exports['cs']=function(_0x5ca616,_0x2a1b88,_0xff846e,_0x248692,_0x17482b,_0x5eaea5,_0x24896b,_0x1bfa20){var _0x196f98={};_0x5eaea5[_0x3832('0xa')]=intUtil['stripTrailingSlash'](_0x5eaea5[_0x3832('0xa')]);_0x5eaea5[_0x3832('0x4c')]=intUtil[_0x3832('0x4d')](_0x5eaea5[_0x3832('0x4c')]);_0x196f98[_0x3832('0x42')]=_0x1bfa20==='queue'||_0x1bfa20==='abandoned'?_0x3832('0x43'):_0x3832('0x2d');var _0x50f5df=util[_0x3832('0x47')](_0x3832('0x4e'),_0x5eaea5[_0x3832('0xa')]);var _0x44519c=util[_0x3832('0x47')](_0x3832('0x4f'),_0x5eaea5['tenantId']);var _0x1ec2a4=util[_0x3832('0x47')](_0x3832('0x50'),_0x5eaea5['serverUrl'],_0x2a1b88[_0x3832('0x51')],md5(_0x2a1b88[_0x3832('0x51')]));if(_0x17482b&&_0x17482b['monitor_format']){logger[_0x3832('0x1c')](_0x3832('0x52'),_0x3832('0x53'));_0x2a1b88['recordingURL']=_0x1ec2a4;}else if(_0x24896b&&_0x24896b[_0x3832('0x54')]&&_0x24896b[_0x3832('0x54')]!==_0x3832('0x55')){logger[_0x3832('0x1c')](_0x3832('0x56'),_0x3832('0x53'));_0x2a1b88[_0x3832('0x57')]=_0x1ec2a4;}else{_0x2a1b88[_0x3832('0x57')]='';}return getUser(_0x196f98,_0x5eaea5,_0x248692,_0x44519c,_0x50f5df,_0x1bfa20)[_0x3832('0xe')](function(_0xd8e5e2){logger[_0x3832('0x1c')]('['+_0x1bfa20[_0x3832('0x1d')]()+_0x3832('0x58'),_0xd8e5e2[_0x3832('0x20')]);logger[_0x3832('0x1c')]('['+_0x1bfa20[_0x3832('0x1d')]()+_0x3832('0x59'),_0xd8e5e2[_0x3832('0x22')]);return getEndUser(_0xd8e5e2,_0x5eaea5,_0x44519c,_0x50f5df,_0x2a1b88,_0x1bfa20);})[_0x3832('0xe')](function(_0x18658d){logger[_0x3832('0x1c')]('['+_0x1bfa20[_0x3832('0x1d')]()+_0x3832('0x5a'),_0x18658d['enduserId']);logger['info']('['+_0x1bfa20['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x2a1b88[_0x3832('0x25')]);return getTicket(_0x18658d,_0x5eaea5,_0x44519c,_0x50f5df,_0x2a1b88,_0xff846e,_0x1bfa20);})[_0x3832('0xe')](function(_0x41982d){logger['info'](util['format']('['+_0x1bfa20[_0x3832('0x1d')]()+_0x3832('0x5b'),_0xff846e[_0x3832('0x39')],_0x41982d[_0x3832('0x45')]));logger[_0x3832('0x1c')](util[_0x3832('0x47')]('['+_0x1bfa20[_0x3832('0x1d')]()+_0x3832('0x5c'),_0x1bfa20));if(_0x1bfa20!==_0x3832('0x5d')){logger[_0x3832('0x1c')]('['+_0x1bfa20['toUpperCase']()+']',_0x3832('0x5e'));emit(_0x5eaea5['remoteUri'],_0x248692[_0x3832('0x5f')],_0xff846e[_0x3832('0x39')],_0x41982d[_0x3832('0x45')]);}})[_0x3832('0x46')](function(_0x5e252a){logger['error']('['+_0x1bfa20['toUpperCase']()+_0x3832('0x60'),util['inspect'](_0x5e252a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 4487a94..1920972 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 _0x8ed8=['mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','length','Agent\x20found!','find','contact','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','forEach','type','string','nameField','customField','content','push','idField','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','email','The\x20User\x20ID\x20is:','destcalleridnum','abandoned','[ABANDONED]','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','socket.io-emitter','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields'];(function(_0x4c2c96,_0x7c0e37){var _0x3b876c=function(_0x9ac0c8){while(--_0x9ac0c8){_0x4c2c96['push'](_0x4c2c96['shift']());}};_0x3b876c(++_0x7c0e37);}(_0x8ed8,0x101));var _0x88ed=function(_0x160e1e,_0x10d001){_0x160e1e=_0x160e1e-0x0;var _0x139c60=_0x8ed8[_0x160e1e];return _0x139c60;};'use strict';var _=require(_0x88ed('0x0'));var rp=require(_0x88ed('0x1'));var md5=require('md5');var util=require(_0x88ed('0x2'));var Redis=require(_0x88ed('0x3'));var intUtil=require(_0x88ed('0x4'));var config=require(_0x88ed('0x5'));var logger=require(_0x88ed('0x6'))(_0x88ed('0x7'));config['redis']=_[_0x88ed('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x88ed('0x9'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x4c22e3,_0x3596e3,_0x4e78aa){io['to'](_0x4c22e3)['emit'](_0x3596e3,_0x4e78aa);}function getTicket(_0xb08d79,_0x38fea3,_0x2c9b02,_0x145549,_0x50cf47){logger[_0x88ed('0xa')](_0x88ed('0xb'));var _0x3ff595=_[_0x88ed('0xc')]({'responder_id':_0x38fea3['id'],'requester_id':_0x2c9b02['id'],'name':util['format'](_0x88ed('0xd'),_0x50cf47['calleridname']),'phone':_0x50cf47[_0x88ed('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x88ed('0xf')](_0x145549[_0x88ed('0x10')],_0x50cf47,'\x20'),'description':intUtil[_0x88ed('0xf')](_0x145549[_0x88ed('0x11')],_0x50cf47,_0x88ed('0x12')),'tags':getTags(_0x145549[_0x88ed('0x13')],_0x88ed('0x14'))},getCustomFields(_0x145549['Fields'],_0x50cf47));_0x3ff595[_0x88ed('0x15')]=_[_0x88ed('0x16')](_[_0x88ed('0x17')](_0x3ff595[_0x88ed('0x15')],'id'),_0x88ed('0x18'));return request({'uri':util[_0x88ed('0x19')](_0x88ed('0x1a'),_0xb08d79[_0x88ed('0x1b')]),'method':_0x88ed('0x1c'),'body':_0x3ff595})[_0x88ed('0x1d')](function(_0x1f67a1){logger[_0x88ed('0xa')]('Ticket\x20created!');return _0x1f67a1;});}function getUser(_0x271f7d,_0x4c8a9f){if(intUtil[_0x88ed('0x1e')](_0x4c8a9f)){return request({'uri':util['format']('%s/api/v2/agents',_0x271f7d[_0x88ed('0x1b')]),'qs':{'email':_0x4c8a9f}})[_0x88ed('0x1d')](function(_0x3b740d){if(_0x3b740d[_0x88ed('0x1f')]){logger[_0x88ed('0xa')](_0x88ed('0x20'));return _[_0x88ed('0x21')](_0x3b740d,function(_0x3289b6){return _0x3289b6[_0x88ed('0x22')]['email']===_0x4c8a9f;});}else{logger[_0x88ed('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x88ed('0x19')]('%s/api/v2/agents/me',_0x271f7d[_0x88ed('0x1b')])})[_0x88ed('0x1d')](function(_0xac67ae){logger[_0x88ed('0xa')](_0x88ed('0x23'));return _0xac67ae;});}});}else{logger[_0x88ed('0xa')](_0x88ed('0x24'));return request({'uri':util[_0x88ed('0x19')](_0x88ed('0x25'),_0x271f7d[_0x88ed('0x1b')])})[_0x88ed('0x1d')](function(_0x1c95f5){logger[_0x88ed('0xa')](_0x88ed('0x23'));return _0x1c95f5;});}}function getEndUser(_0x10c4a6,_0x38d1d5,_0xf4eb62){logger[_0x88ed('0xa')](_0x88ed('0x26'),_0xf4eb62);return request({'uri':util[_0x88ed('0x19')](_0x88ed('0x27'),_0x10c4a6[_0x88ed('0x1b')]),'qs':{'phone':_0xf4eb62}})[_0x88ed('0x1d')](function(_0x403caf){if(_0x403caf[_0x88ed('0x1f')]){logger[_0x88ed('0xa')](_0x88ed('0x28'));return _[_0x88ed('0x21')](_0x403caf,{'phone':_0xf4eb62});}else{logger[_0x88ed('0xa')](_0x88ed('0x29'));return request({'uri':util[_0x88ed('0x19')](_0x88ed('0x27'),_0x10c4a6['remoteUri']),'method':_0x88ed('0x1c'),'body':{'name':_0x38d1d5,'phone':_0xf4eb62}})[_0x88ed('0x1d')](function(_0x445f81){logger['info'](_0x88ed('0x2a'));return _0x445f81;});}});}function getAuth(_0x887cd2){return util[_0x88ed('0x19')](_0x88ed('0x2b'),new Buffer(_0x887cd2[_0x88ed('0x2c')]+':X')[_0x88ed('0x2d')](_0x88ed('0x2e')));}function request(_0x4cbe1e){logger[_0x88ed('0x2f')](_0x88ed('0x30'),JSON['stringify'](_0x4cbe1e));return rp(_[_0x88ed('0x8')](_0x4cbe1e,{'method':_0x88ed('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x10a73a,_0x12d6ed){var _0x51c100=[];if(_0x10a73a&&_0x10a73a[_0x88ed('0x1f')]>0x0){_0x51c100=_[_0x88ed('0x32')](_0x10a73a,_0x12d6ed);}return _0x51c100;}function getCustomFields(_0x2eabf4,_0x1b8ab8){var _0x8c7917=[];var _0x592c55={'custom_fields':[]};if(_0x2eabf4[_0x88ed('0x1f')]>0x0){_[_0x88ed('0x33')](_0x2eabf4,function(_0x41d75a){if(_0x41d75a[_0x88ed('0x34')]===_0x88ed('0x35')&&_0x41d75a[_0x88ed('0x36')]&&!_0x41d75a[_0x88ed('0x37')]){_0x592c55[_0x41d75a[_0x88ed('0x36')]['toLowerCase']()]=_0x41d75a[_0x88ed('0x38')][_0x88ed('0x2d')]();}else if(_0x41d75a['type']===_0x88ed('0x35')&&_0x41d75a['idField']&&_0x41d75a[_0x88ed('0x37')]){_0x592c55[_0x88ed('0x15')][_0x88ed('0x39')]({'id':_0x41d75a[_0x88ed('0x3a')],'value':_0x41d75a[_0x88ed('0x38')]['toString']()});}else if(_0x41d75a[_0x88ed('0x34')]===_0x88ed('0x3b')&&_0x41d75a['variableName']&&_0x41d75a['idField']&&_0x41d75a['customField']){_0x1b8ab8[_0x41d75a[_0x88ed('0x3c')]]&&_0x592c55[_0x88ed('0x15')][_0x88ed('0x39')]({'id':_0x41d75a['idField'],'value':_0x1b8ab8[_0x41d75a[_0x88ed('0x3c')]][_0x88ed('0x2d')]()});}else if(_0x41d75a['type']===_0x88ed('0x3d')&&_0x41d75a['Variable']&&_0x41d75a['Variable'][_0x88ed('0x14')]&&_0x41d75a[_0x88ed('0x3a')]&&_0x41d75a[_0x88ed('0x37')]){_0x1b8ab8[_0x41d75a[_0x88ed('0x3e')]['name'][_0x88ed('0x3f')]()]&&_0x592c55[_0x88ed('0x15')]['push']({'id':_0x41d75a[_0x88ed('0x3a')],'value':_0x1b8ab8[_0x41d75a[_0x88ed('0x3e')][_0x88ed('0x14')]['toLowerCase']()][_0x88ed('0x2d')]()});}});}return _0x592c55;}exports[_0x88ed('0x40')]=function(_0x4330f1,_0x8f929,_0x4268b7,_0xda609e,_0x263075,_0x1adea7){var _0x581cc1,_0x4b00cb;_0x1adea7[_0x88ed('0x1b')]=intUtil[_0x88ed('0x41')](_0x1adea7[_0x88ed('0x1b')]);_0x1adea7[_0x88ed('0x42')]=intUtil[_0x88ed('0x41')](_0x1adea7[_0x88ed('0x42')]);if(_0x263075&&_0x263075[_0x88ed('0x43')]){logger[_0x88ed('0xa')]('[QUEUE]',_0x88ed('0x44'));_0x8f929['recordingURL']=util[_0x88ed('0x19')](_0x88ed('0x45'),_0x1adea7[_0x88ed('0x42')],_0x8f929[_0x88ed('0x46')],md5(_0x8f929[_0x88ed('0x46')]));}else{_0x8f929['recordingURL']='';}headers['Authorization']=getAuth(_0x1adea7);return getUser(_0x1adea7,_0xda609e['email'])[_0x88ed('0x1d')](function(_0x4c8552){_0x581cc1=_0x4c8552;logger[_0x88ed('0xa')]('The\x20User\x20ID\x20is:',_0x581cc1['id']);return getEndUser(_0x1adea7,_0x8f929[_0x88ed('0x47')],_0x8f929[_0x88ed('0xe')]);})['then'](function(_0x1bb21e){_0x4b00cb=_0x1bb21e;logger[_0x88ed('0xa')](_0x88ed('0x48'),_0x4b00cb['id']);return getTicket(_0x1adea7,_0x581cc1,_0x4b00cb,_0x4268b7,_0x8f929);})[_0x88ed('0x1d')](function(_0x52b178){if(_0x52b178&&_0x52b178['id']){logger[_0x88ed('0xa')](_0x88ed('0x49'));logger[_0x88ed('0xa')]('The\x20Ticket\x20ID\x20is:',_0x52b178['id']);logger[_0x88ed('0xa')](_0x88ed('0x4a'),_0x88ed('0x4b'));emit(util['format'](_0x88ed('0x4c'),_0xda609e[_0x88ed('0x14')]),_0x88ed('0x4d'),{'uri':util[_0x88ed('0x19')](_0x88ed('0x4e'),_0x1adea7['remoteUri'],_0x52b178['id'])});}})[_0x88ed('0x4f')](function(_0x50d21a){logger[_0x88ed('0x50')](_0x88ed('0x4a'),JSON[_0x88ed('0x51')](_0x50d21a));});};exports[_0x88ed('0x52')]=function(_0x482f9a,_0x212507,_0x4bd661,_0x2b0453,_0x205934,_0x26aa9f,_0x41576a){var _0x292298,_0x444a4a;_0x26aa9f[_0x88ed('0x1b')]=intUtil[_0x88ed('0x41')](_0x26aa9f['remoteUri']);_0x26aa9f[_0x88ed('0x42')]=intUtil['stripTrailingSlash'](_0x26aa9f[_0x88ed('0x42')]);if(_0x41576a&&_0x41576a[_0x88ed('0x53')]&&_0x41576a[_0x88ed('0x53')]!==_0x88ed('0x54')){logger['info'](_0x88ed('0x55'),_0x88ed('0x44'));_0x212507[_0x88ed('0x56')]=util[_0x88ed('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26aa9f[_0x88ed('0x42')],_0x212507[_0x88ed('0x46')],md5(_0x212507[_0x88ed('0x46')]));}headers['Authorization']=getAuth(_0x26aa9f);return getUser(_0x26aa9f,_0x2b0453[_0x88ed('0x57')])[_0x88ed('0x1d')](function(_0x487435){_0x292298=_0x487435;logger[_0x88ed('0xa')](_0x88ed('0x58'),_0x292298['id']);return getEndUser(_0x26aa9f,_0x212507['destcalleridname'],_0x212507[_0x88ed('0x59')]);})[_0x88ed('0x1d')](function(_0x47717e){_0x444a4a=_0x47717e;logger[_0x88ed('0xa')](_0x88ed('0x48'),_0x444a4a['id']);return getTicket(_0x26aa9f,_0x292298,_0x444a4a,_0x4bd661,_0x212507);})[_0x88ed('0x1d')](function(_0x15e2d1){if(_0x15e2d1&&_0x15e2d1['id']){logger[_0x88ed('0xa')](_0x88ed('0x49'));logger[_0x88ed('0xa')]('The\x20Ticket\x20ID\x20is:',_0x15e2d1['id']);logger[_0x88ed('0xa')](_0x88ed('0x55'),_0x88ed('0x4b'));emit(util[_0x88ed('0x19')](_0x88ed('0x4c'),_0x2b0453[_0x88ed('0x14')]),'trigger:browser:url',{'uri':util[_0x88ed('0x19')]('%s/helpdesk/tickets/%d',_0x26aa9f['remoteUri'],_0x15e2d1['id'])});}})[_0x88ed('0x4f')](function(_0x131ac8){logger['error'](_0x88ed('0x55'),JSON[_0x88ed('0x51')](_0x131ac8));});};exports[_0x88ed('0x5a')]=function(_0x1a3e5c,_0x2f07e3,_0x3272ae,_0x2defdc,_0x4f049a,_0x586cf7){var _0x2a4644,_0x5bf13b;_0x586cf7[_0x88ed('0x1b')]=intUtil['stripTrailingSlash'](_0x586cf7[_0x88ed('0x1b')]);_0x586cf7[_0x88ed('0x42')]=intUtil[_0x88ed('0x41')](_0x586cf7[_0x88ed('0x42')]);if(_0x4f049a&&_0x4f049a['monitor_format']){logger['info'](_0x88ed('0x5b'),_0x88ed('0x44'));_0x2f07e3['recordingURL']=util['format'](_0x88ed('0x45'),_0x586cf7['serverUrl'],_0x2f07e3[_0x88ed('0x46')],md5(_0x2f07e3[_0x88ed('0x46')]));}else{_0x2f07e3['recordingURL']='';}headers['Authorization']=getAuth(_0x586cf7);return getUser(_0x586cf7,'')[_0x88ed('0x1d')](function(_0x58de44){_0x2a4644=_0x58de44;logger[_0x88ed('0xa')](_0x88ed('0x58'),_0x2a4644['id']);return getEndUser(_0x586cf7,_0x2f07e3['calleridname'],_0x2f07e3[_0x88ed('0xe')]);})[_0x88ed('0x1d')](function(_0x523194){_0x5bf13b=_0x523194;logger[_0x88ed('0xa')]('The\x20Enduser\x20ID\x20is:',_0x5bf13b['id']);return getTicket(_0x586cf7,_0x2a4644,_0x5bf13b,_0x3272ae,_0x2f07e3);})[_0x88ed('0x1d')](function(_0x5747be){if(_0x5747be){logger[_0x88ed('0xa')]('Ticket\x20created!');logger[_0x88ed('0xa')](_0x88ed('0x5c'),_0x5747be['id']);}})['catch'](function(_0xdf1acf){logger[_0x88ed('0x50')](_0x88ed('0x5b'),JSON['stringify'](_0xdf1acf));});}; \ No newline at end of file +var _0xd966=['abandoned','[ABANDONED]','md5','util','ioredis','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','validateEmail','format','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','trigger:browser:url'];(function(_0x537506,_0xdcc11f){var _0x224ffd=function(_0x13ebe9){while(--_0x13ebe9){_0x537506['push'](_0x537506['shift']());}};_0x224ffd(++_0xdcc11f);}(_0xd966,0xb8));var _0x6d96=function(_0x5c4d15,_0x32fe23){_0x5c4d15=_0x5c4d15-0x0;var _0x1f974a=_0xd966[_0x5c4d15];return _0x1f974a;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x6d96('0x0'));var util=require(_0x6d96('0x1'));var Redis=require(_0x6d96('0x2'));var intUtil=require('./util');var config=require(_0x6d96('0x3'));var logger=require('../../../../config/logger')(_0x6d96('0x4'));config[_0x6d96('0x5')]=_[_0x6d96('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6d96('0x7'))(new Redis(config[_0x6d96('0x5')]));var headers={'Content-Type':_0x6d96('0x8'),'Accept':_0x6d96('0x8')};function emit(_0x408f8f,_0x185d31,_0x17a547){io['to'](_0x408f8f)[_0x6d96('0x9')](_0x185d31,_0x17a547);}function getTicket(_0x1eedb4,_0x456bd1,_0x17571b,_0x4ddb49,_0x44eaf0){logger['info']('Creating\x20new\x20ticket...');var _0x568211=_[_0x6d96('0xa')]({'responder_id':_0x456bd1['id'],'requester_id':_0x17571b['id'],'name':util['format'](_0x6d96('0xb'),_0x44eaf0[_0x6d96('0xc')]),'phone':_0x44eaf0[_0x6d96('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6d96('0xe')](_0x4ddb49[_0x6d96('0xf')],_0x44eaf0,'\x20'),'description':intUtil[_0x6d96('0xe')](_0x4ddb49['Descriptions'],_0x44eaf0,_0x6d96('0x10')),'tags':getTags(_0x4ddb49['Tags'],_0x6d96('0x11'))},getCustomFields(_0x4ddb49['Fields'],_0x44eaf0));_0x568211[_0x6d96('0x12')]=_[_0x6d96('0x13')](_[_0x6d96('0x14')](_0x568211[_0x6d96('0x12')],'id'),_0x6d96('0x15'));return request({'uri':util['format'](_0x6d96('0x16'),_0x1eedb4['remoteUri']),'method':_0x6d96('0x17'),'body':_0x568211})[_0x6d96('0x18')](function(_0x806889){logger[_0x6d96('0x19')]('Ticket\x20created!');return _0x806889;});}function getUser(_0x28f30c,_0x26e0ec){if(intUtil[_0x6d96('0x1a')](_0x26e0ec)){return request({'uri':util[_0x6d96('0x1b')](_0x6d96('0x1c'),_0x28f30c[_0x6d96('0x1d')]),'qs':{'email':_0x26e0ec}})[_0x6d96('0x18')](function(_0x21885d){if(_0x21885d[_0x6d96('0x1e')]){logger['info'](_0x6d96('0x1f'));return _[_0x6d96('0x20')](_0x21885d,function(_0x426c03){return _0x426c03[_0x6d96('0x21')][_0x6d96('0x22')]===_0x26e0ec;});}else{logger[_0x6d96('0x19')](_0x6d96('0x23'));return request({'uri':util[_0x6d96('0x1b')](_0x6d96('0x24'),_0x28f30c[_0x6d96('0x1d')])})[_0x6d96('0x18')](function(_0x3a151f){logger[_0x6d96('0x19')](_0x6d96('0x25'));return _0x3a151f;});}});}else{logger[_0x6d96('0x19')](_0x6d96('0x26'));return request({'uri':util['format'](_0x6d96('0x24'),_0x28f30c[_0x6d96('0x1d')])})['then'](function(_0x266f4c){logger[_0x6d96('0x19')](_0x6d96('0x25'));return _0x266f4c;});}}function getEndUser(_0x18f803,_0x2ff912,_0x108021){logger[_0x6d96('0x19')]('Searching\x20enduser\x20with\x20phone',_0x108021);return request({'uri':util[_0x6d96('0x1b')](_0x6d96('0x27'),_0x18f803[_0x6d96('0x1d')]),'qs':{'phone':_0x108021}})['then'](function(_0x275b72){if(_0x275b72[_0x6d96('0x1e')]){logger['info'](_0x6d96('0x28'));return _[_0x6d96('0x20')](_0x275b72,{'phone':_0x108021});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6d96('0x1b')](_0x6d96('0x27'),_0x18f803['remoteUri']),'method':_0x6d96('0x17'),'body':{'name':_0x2ff912,'phone':_0x108021}})['then'](function(_0x5f1234){logger[_0x6d96('0x19')](_0x6d96('0x29'));return _0x5f1234;});}});}function getAuth(_0x33311d){return util['format']('Basic\x20%s',new Buffer(_0x33311d[_0x6d96('0x2a')]+':X')[_0x6d96('0x2b')](_0x6d96('0x2c')));}function request(_0x46c1b8){logger[_0x6d96('0x2d')](_0x6d96('0x2e'),JSON[_0x6d96('0x2f')](_0x46c1b8));return rp(_['defaults'](_0x46c1b8,{'method':_0x6d96('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3fcb90,_0x17ace2){var _0x37fa26=[];if(_0x3fcb90&&_0x3fcb90[_0x6d96('0x1e')]>0x0){_0x37fa26=_[_0x6d96('0x31')](_0x3fcb90,_0x17ace2);}return _0x37fa26;}function getCustomFields(_0x1c6e8e,_0x30cb1c){var _0x4da7b7=[];var _0x357fff={'custom_fields':[]};if(_0x1c6e8e[_0x6d96('0x1e')]>0x0){_[_0x6d96('0x32')](_0x1c6e8e,function(_0x242e81){if(_0x242e81[_0x6d96('0x33')]==='string'&&_0x242e81[_0x6d96('0x34')]&&!_0x242e81['customField']){_0x357fff[_0x242e81[_0x6d96('0x34')][_0x6d96('0x35')]()]=_0x242e81[_0x6d96('0x36')][_0x6d96('0x2b')]();}else if(_0x242e81[_0x6d96('0x33')]===_0x6d96('0x37')&&_0x242e81[_0x6d96('0x38')]&&_0x242e81[_0x6d96('0x39')]){_0x357fff['custom_fields'][_0x6d96('0x3a')]({'id':_0x242e81[_0x6d96('0x38')],'value':_0x242e81[_0x6d96('0x36')][_0x6d96('0x2b')]()});}else if(_0x242e81[_0x6d96('0x33')]===_0x6d96('0x3b')&&_0x242e81[_0x6d96('0x3c')]&&_0x242e81[_0x6d96('0x38')]&&_0x242e81[_0x6d96('0x39')]){_0x30cb1c[_0x242e81[_0x6d96('0x3c')]]&&_0x357fff[_0x6d96('0x12')]['push']({'id':_0x242e81['idField'],'value':_0x30cb1c[_0x242e81[_0x6d96('0x3c')]]['toString']()});}else if(_0x242e81[_0x6d96('0x33')]===_0x6d96('0x3d')&&_0x242e81[_0x6d96('0x3e')]&&_0x242e81[_0x6d96('0x3e')][_0x6d96('0x11')]&&_0x242e81['idField']&&_0x242e81[_0x6d96('0x39')]){_0x30cb1c[_0x242e81[_0x6d96('0x3e')][_0x6d96('0x11')][_0x6d96('0x35')]()]&&_0x357fff[_0x6d96('0x12')][_0x6d96('0x3a')]({'id':_0x242e81[_0x6d96('0x38')],'value':_0x30cb1c[_0x242e81[_0x6d96('0x3e')][_0x6d96('0x11')]['toLowerCase']()][_0x6d96('0x2b')]()});}});}return _0x357fff;}exports[_0x6d96('0x3f')]=function(_0x26cd11,_0x3919b4,_0x2a1863,_0xe50e0a,_0x491ddf,_0x581c0b){var _0x5d3e9e,_0x100738;_0x581c0b[_0x6d96('0x1d')]=intUtil['stripTrailingSlash'](_0x581c0b['remoteUri']);_0x581c0b['serverUrl']=intUtil[_0x6d96('0x40')](_0x581c0b['serverUrl']);if(_0x491ddf&&_0x491ddf[_0x6d96('0x41')]){logger[_0x6d96('0x19')](_0x6d96('0x42'),_0x6d96('0x43'));_0x3919b4[_0x6d96('0x44')]=util[_0x6d96('0x1b')](_0x6d96('0x45'),_0x581c0b['serverUrl'],_0x3919b4['uniqueid'],md5(_0x3919b4[_0x6d96('0x46')]));}else{_0x3919b4[_0x6d96('0x44')]='';}headers[_0x6d96('0x47')]=getAuth(_0x581c0b);return getUser(_0x581c0b,_0xe50e0a['email'])[_0x6d96('0x18')](function(_0x202f1a){_0x5d3e9e=_0x202f1a;logger[_0x6d96('0x19')]('The\x20User\x20ID\x20is:',_0x5d3e9e['id']);return getEndUser(_0x581c0b,_0x3919b4[_0x6d96('0xc')],_0x3919b4['calleridnum']);})[_0x6d96('0x18')](function(_0x3ea934){_0x100738=_0x3ea934;logger['info'](_0x6d96('0x48'),_0x100738['id']);return getTicket(_0x581c0b,_0x5d3e9e,_0x100738,_0x2a1863,_0x3919b4);})[_0x6d96('0x18')](function(_0x20620e){if(_0x20620e&&_0x20620e['id']){logger['info'](_0x6d96('0x49'));logger[_0x6d96('0x19')](_0x6d96('0x4a'),_0x20620e['id']);logger[_0x6d96('0x19')]('[QUEUE]',_0x6d96('0x4b'));emit(util[_0x6d96('0x1b')](_0x6d96('0x4c'),_0xe50e0a['name']),'trigger:browser:url',{'uri':util[_0x6d96('0x1b')](_0x6d96('0x4d'),_0x581c0b['remoteUri'],_0x20620e['id'])});}})[_0x6d96('0x4e')](function(_0x55226b){logger[_0x6d96('0x4f')]('[QUEUE]',JSON['stringify'](_0x55226b));});};exports[_0x6d96('0x50')]=function(_0x3cf087,_0x4ab83b,_0x26a879,_0x4da3e7,_0x26e3fc,_0x5b0aad,_0x37a3bd){var _0x3411b9,_0x56d29f;_0x5b0aad[_0x6d96('0x1d')]=intUtil['stripTrailingSlash'](_0x5b0aad[_0x6d96('0x1d')]);_0x5b0aad[_0x6d96('0x51')]=intUtil[_0x6d96('0x40')](_0x5b0aad[_0x6d96('0x51')]);if(_0x37a3bd&&_0x37a3bd[_0x6d96('0x52')]&&_0x37a3bd[_0x6d96('0x52')]!==_0x6d96('0x53')){logger[_0x6d96('0x19')](_0x6d96('0x54'),'Recording\x20is\x20enabled!');_0x4ab83b[_0x6d96('0x44')]=util[_0x6d96('0x1b')](_0x6d96('0x45'),_0x5b0aad[_0x6d96('0x51')],_0x4ab83b['uniqueid'],md5(_0x4ab83b[_0x6d96('0x46')]));}headers['Authorization']=getAuth(_0x5b0aad);return getUser(_0x5b0aad,_0x4da3e7[_0x6d96('0x22')])[_0x6d96('0x18')](function(_0x119753){_0x3411b9=_0x119753;logger[_0x6d96('0x19')](_0x6d96('0x55'),_0x3411b9['id']);return getEndUser(_0x5b0aad,_0x4ab83b[_0x6d96('0x56')],_0x4ab83b[_0x6d96('0x57')]);})['then'](function(_0x43fe62){_0x56d29f=_0x43fe62;logger[_0x6d96('0x19')](_0x6d96('0x48'),_0x56d29f['id']);return getTicket(_0x5b0aad,_0x3411b9,_0x56d29f,_0x26a879,_0x4ab83b);})[_0x6d96('0x18')](function(_0x2600f9){if(_0x2600f9&&_0x2600f9['id']){logger[_0x6d96('0x19')]('Ticket\x20created!');logger[_0x6d96('0x19')]('The\x20Ticket\x20ID\x20is:',_0x2600f9['id']);logger[_0x6d96('0x19')](_0x6d96('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x6d96('0x4c'),_0x4da3e7[_0x6d96('0x11')]),_0x6d96('0x58'),{'uri':util[_0x6d96('0x1b')](_0x6d96('0x4d'),_0x5b0aad[_0x6d96('0x1d')],_0x2600f9['id'])});}})['catch'](function(_0x57b5e6){logger[_0x6d96('0x4f')](_0x6d96('0x54'),JSON['stringify'](_0x57b5e6));});};exports[_0x6d96('0x59')]=function(_0x1e7cef,_0x833d0,_0xd0f12f,_0x4759a8,_0x47da3,_0x4bc4fd){var _0x5ab24b,_0x4680a0;_0x4bc4fd['remoteUri']=intUtil[_0x6d96('0x40')](_0x4bc4fd[_0x6d96('0x1d')]);_0x4bc4fd[_0x6d96('0x51')]=intUtil['stripTrailingSlash'](_0x4bc4fd[_0x6d96('0x51')]);if(_0x47da3&&_0x47da3['monitor_format']){logger[_0x6d96('0x19')](_0x6d96('0x5a'),_0x6d96('0x43'));_0x833d0[_0x6d96('0x44')]=util[_0x6d96('0x1b')](_0x6d96('0x45'),_0x4bc4fd['serverUrl'],_0x833d0['uniqueid'],md5(_0x833d0[_0x6d96('0x46')]));}else{_0x833d0[_0x6d96('0x44')]='';}headers[_0x6d96('0x47')]=getAuth(_0x4bc4fd);return getUser(_0x4bc4fd,'')[_0x6d96('0x18')](function(_0x267182){_0x5ab24b=_0x267182;logger[_0x6d96('0x19')]('The\x20User\x20ID\x20is:',_0x5ab24b['id']);return getEndUser(_0x4bc4fd,_0x833d0['calleridname'],_0x833d0[_0x6d96('0xd')]);})[_0x6d96('0x18')](function(_0x182eb6){_0x4680a0=_0x182eb6;logger[_0x6d96('0x19')]('The\x20Enduser\x20ID\x20is:',_0x4680a0['id']);return getTicket(_0x4bc4fd,_0x5ab24b,_0x4680a0,_0xd0f12f,_0x833d0);})['then'](function(_0x58df99){if(_0x58df99){logger[_0x6d96('0x19')](_0x6d96('0x49'));logger['info'](_0x6d96('0x4a'),_0x58df99['id']);}})[_0x6d96('0x4e')](function(_0x2a4f1b){logger[_0x6d96('0x4f')]('[ABANDONED]',JSON[_0x6d96('0x2f')](_0x2a4f1b));});}; \ 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 f77a19a..b056c6e 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 _0x31c8=['routeId','EVENT\x20UNKNOWN','abandoned','salesforce','freshdesk','servicenow','dynamics365','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','zoho','desk','vtiger','exec','includes','data1','toLowerCase','data2','Configurations','queue'];(function(_0x494e4d,_0x428f48){var _0x127c97=function(_0x15070d){while(--_0x15070d){_0x494e4d['push'](_0x494e4d['shift']());}};_0x127c97(++_0x428f48);}(_0x31c8,0x1d8));var _0x831c=function(_0x4e1397,_0x45aadb){_0x4e1397=_0x4e1397-0x0;var _0x2f7c4f=_0x31c8[_0x4e1397];return _0x2f7c4f;};'use strict';var _=require(_0x831c('0x0'));var util=require(_0x831c('0x1'));var zendesk=require(_0x831c('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x831c('0x3'));var freshdesk=require(_0x831c('0x4'));var zoho=require(_0x831c('0x5'));var desk=require(_0x831c('0x6'));var vtiger=require(_0x831c('0x7'));var servicenow=require(_0x831c('0x8'));var dynamics365=require(_0x831c('0x9'));var integrations=[_0x831c('0xa'),'salesforce',_0x831c('0xb'),'freshdesk',_0x831c('0xc'),_0x831c('0xd'),_0x831c('0xe'),'servicenow','dynamics365'];exports[_0x831c('0xf')]=function(_0x2ecbae,_0x4f2661,_0x897de0,_0x56d6d7,_0x250d8c,_0x292693){if(_0x897de0){if(_[_0x831c('0x10')](integrations,_0x2ecbae[_0x831c('0x11')][_0x831c('0x12')]())){try{var _0x39a55b=null;var _0x9ced0d='';var _0x49a92e=_0x897de0[_0x2ecbae['data1'][_0x831c('0x12')]()];if(_0x49a92e){var _0x208aee=_0x49a92e[_0x2ecbae[_0x831c('0x13')]];if(_0x208aee){var _0x1b7e2c=_['find'](_0x208aee[_0x831c('0x14')],{'id':parseInt(_0x2ecbae['data3'],0xa)});if(_0x1b7e2c){if(_0x56d6d7){if(_0x250d8c&&_0x4f2661[_0x831c('0x15')]){_0x9ced0d=_0x831c('0x15');}else if(_0x4f2661[_0x831c('0x16')]){_0x9ced0d='outbound';}else{console['log'](_0x831c('0x17'),_0x4f2661);}}else{_0x9ced0d=_0x831c('0x18');}switch(_0x2ecbae[_0x831c('0x11')][_0x831c('0x12')]()){case _0x831c('0xa'):zendesk[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0x19'):salesforce[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case'sugarcrm':sugarcrm[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0x1a'):freshdesk[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0xc'):zoho[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0xd'):desk[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0xe'):vtiger[_0x9ced0d](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693);break;case _0x831c('0x1b'):servicenow['cs'](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693,_0x9ced0d);break;case _0x831c('0x1c'):dynamics365['cs'](_0x2ecbae,_0x4f2661,_0x1b7e2c,_0x56d6d7,_0x250d8c,_0x208aee,_0x292693,_0x9ced0d);break;default:console[_0x831c('0x1d')](_0x831c('0x1e'));}}else{_0x39a55b=require(_0x831c('0x1f'))(_0x2ecbae[_0x831c('0x11')][_0x831c('0x12')]());_0x39a55b[_0x831c('0x20')](_0x831c('0x21'),util[_0x831c('0x22')](_0x831c('0x23'),_0x2ecbae[_0x831c('0x11')][_0x831c('0x12')](),_0x2ecbae[_0x831c('0x24')]));}}else{_0x39a55b=require(_0x831c('0x1f'))(_0x2ecbae['data1'][_0x831c('0x12')]());_0x39a55b['error']('[EXEC]',util[_0x831c('0x22')](_0x831c('0x25'),_0x2ecbae[_0x831c('0x11')]['toLowerCase'](),_0x2ecbae['data2']));}}else{}}catch(_0x20e11f){console[_0x831c('0x20')](_0x20e11f);}}}}; \ No newline at end of file +var _0xbb31=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','exec','includes','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','abandoned','servicenow','unknown\x20integration','data1','format','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce'];(function(_0x2f1c92,_0x57eb7a){var _0x1f155b=function(_0x2b51f0){while(--_0x2b51f0){_0x2f1c92['push'](_0x2f1c92['shift']());}};_0x1f155b(++_0x57eb7a);}(_0xbb31,0xba));var _0x1bb3=function(_0x163856,_0x375a5a){_0x163856=_0x163856-0x0;var _0x19fe5f=_0xbb31[_0x163856];return _0x19fe5f;};'use strict';var _=require(_0x1bb3('0x0'));var util=require(_0x1bb3('0x1'));var zendesk=require(_0x1bb3('0x2'));var salesforce=require(_0x1bb3('0x3'));var sugarcrm=require(_0x1bb3('0x4'));var freshdesk=require(_0x1bb3('0x5'));var zoho=require(_0x1bb3('0x6'));var desk=require(_0x1bb3('0x7'));var vtiger=require(_0x1bb3('0x8'));var servicenow=require(_0x1bb3('0x9'));var dynamics365=require('./dynamics365');var integrations=[_0x1bb3('0xa'),_0x1bb3('0xb'),_0x1bb3('0xc'),_0x1bb3('0xd'),_0x1bb3('0xe'),_0x1bb3('0xf'),'vtiger','servicenow',_0x1bb3('0x10')];exports[_0x1bb3('0x11')]=function(_0x3ae7a4,_0x33e8e7,_0x45cbe8,_0x242da6,_0x4cb024,_0x5405ae){if(_0x45cbe8){if(_[_0x1bb3('0x12')](integrations,_0x3ae7a4['data1'][_0x1bb3('0x13')]())){try{var _0x33d107=null;var _0x4b7b85='';var _0x4a301c=_0x45cbe8[_0x3ae7a4['data1'][_0x1bb3('0x13')]()];if(_0x4a301c){var _0x314bd4=_0x4a301c[_0x3ae7a4[_0x1bb3('0x14')]];if(_0x314bd4){var _0x342056=_[_0x1bb3('0x15')](_0x314bd4[_0x1bb3('0x16')],{'id':parseInt(_0x3ae7a4[_0x1bb3('0x17')],0xa)});if(_0x342056){if(_0x242da6){if(_0x4cb024&&_0x33e8e7[_0x1bb3('0x18')]){_0x4b7b85=_0x1bb3('0x18');}else if(_0x33e8e7[_0x1bb3('0x19')]){_0x4b7b85=_0x1bb3('0x1a');}else{console[_0x1bb3('0x1b')](_0x1bb3('0x1c'),_0x33e8e7);}}else{_0x4b7b85=_0x1bb3('0x1d');}switch(_0x3ae7a4['data1'][_0x1bb3('0x13')]()){case _0x1bb3('0xa'):zendesk[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case _0x1bb3('0xb'):salesforce[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case _0x1bb3('0xc'):sugarcrm[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case _0x1bb3('0xd'):freshdesk[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case _0x1bb3('0xe'):zoho[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case'desk':desk[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case'vtiger':vtiger[_0x4b7b85](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae);break;case _0x1bb3('0x1e'):servicenow['cs'](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae,_0x4b7b85);break;case'dynamics365':dynamics365['cs'](_0x3ae7a4,_0x33e8e7,_0x342056,_0x242da6,_0x4cb024,_0x314bd4,_0x5405ae,_0x4b7b85);break;default:console[_0x1bb3('0x1b')](_0x1bb3('0x1f'));}}else{_0x33d107=require('../../../../config/logger')(_0x3ae7a4[_0x1bb3('0x20')][_0x1bb3('0x13')]());_0x33d107['error']('[EXEC]',util[_0x1bb3('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3ae7a4[_0x1bb3('0x20')][_0x1bb3('0x13')](),_0x3ae7a4[_0x1bb3('0x17')]));}}else{_0x33d107=require(_0x1bb3('0x22'))(_0x3ae7a4[_0x1bb3('0x20')]['toLowerCase']());_0x33d107[_0x1bb3('0x23')](_0x1bb3('0x24'),util[_0x1bb3('0x21')](_0x1bb3('0x25'),_0x3ae7a4['data1'][_0x1bb3('0x13')](),_0x3ae7a4[_0x1bb3('0x14')]));}}else{}}catch(_0x4677ae){console[_0x1bb3('0x23')](_0x4677ae);}}}}; \ 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 4fae7ac..0b758fa 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 _0xa9e0=['identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','error','catch','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x51a324,_0x269893){var _0x5dc870=function(_0x41ea98){while(--_0x41ea98){_0x51a324['push'](_0x51a324['shift']());}};_0x5dc870(++_0x269893);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x0a9e('0x3'));var util=require('util');var Redis=require(_0x0a9e('0x4'));var intUtil=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe42b77,_0x56465b,_0x52cace){io['to'](_0xe42b77)[_0x0a9e('0xc')](_0x56465b,_0x52cace);}function getTicket(_0xf81284,_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){var _0x4cfe67={};if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xe')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'ActivityDate':moment[_0x0a9e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b[_0x0a9e('0x12')],_0xbd1168,'\x20'),'Description':intUtil['getString'](_0xfeb75b[_0x0a9e('0x13')],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x14')]=_0x3ab53f['id'];}}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x15')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b['Subjects'],_0xbd1168,'\x20'),'Description':intUtil[_0x0a9e('0x11')](_0xfeb75b['Descriptions'],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x16')]=_0x3ab53f['id'];}}return _0x50dfb2['sobject'](_0xfeb75b[_0x0a9e('0xd')])[_0x0a9e('0x17')](_0x4cfe67);}function getUser(_0x48f32d,_0x225616,_0x5a0a06){if(!_[_0x0a9e('0x18')](_0x225616)&&intUtil[_0x0a9e('0x19')](_0x225616)){var _0x106033={'Email':_0x225616};var _0x205fd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a0a06[_0x0a9e('0x1a')](_0x0a9e('0x1b'))[_0x0a9e('0x1c')](_0x106033,_0x205fd6)[_0x0a9e('0x1d')]()[_0x0a9e('0x1e')](function(_0x112016){if(_0x112016[_0x0a9e('0x1f')]){var _0x105080=_['find'](_0x112016,function(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')]===_0x225616;});if(_0x105080){logger['info'](_0x0a9e('0x21'),_0x225616);return BPromise['resolve']({'id':_0x105080['Id'],'name':_0x105080['Name']});}}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x4abc77){return BPromise[_0x0a9e('0x25')]({'id':_0x4abc77[_0x0a9e('0x26')],'name':_0x4abc77[_0x0a9e('0x27')]});});}});}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x5ea472){return BPromise['resolve']({'id':_0x5ea472[_0x0a9e('0x26')],'name':_0x5ea472[_0x0a9e('0x27')]});});}}function getEndUser(_0x40c424,_0x33161b,_0x526cf3,_0x384319,_0x479bc4){var _0x45a1e7={'Phone':_0x384319};var _0x5bfb33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a9e('0x25')]()[_0x0a9e('0x1e')](function(){if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger[_0x0a9e('0x22')](_0x0a9e('0x28'),_0x384319,_0x33161b[_0x0a9e('0x29')]);switch(_0x33161b[_0x0a9e('0x29')]){case'contact_lead':return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]()['then'](function(_0x15b200){if(_0x15b200&&_0x15b200[_0x0a9e('0x1f')]){return _0x15b200;}else{return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);}});case _0x0a9e('0x2c'):return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)['execute']();case _0x0a9e('0x2d'):return _0x479bc4['sobject'](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);default:return null;}}else if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0x15')){logger[_0x0a9e('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x384319,_0x0a9e('0x2c'));return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]();}})[_0x0a9e('0x1e')](function(_0x332d35){if(_0x332d35&&_0x332d35[_0x0a9e('0x1f')]){var _0x5583a4=_[_0x0a9e('0x1c')](_0x332d35,function(_0x5e7238){return _0x5e7238[_0x0a9e('0x2e')]===_0x384319;});if(_0x5583a4){return BPromise[_0x0a9e('0x25')]({'id':_0x5583a4['Id'],'name':_0x5583a4[_0x0a9e('0x2f')],'phone':_0x5583a4[_0x0a9e('0x2e')]});}}})['then'](function(_0x191e91){if(_0x191e91){logger[_0x0a9e('0x22')](_0x0a9e('0x30'),_0x384319);return BPromise[_0x0a9e('0x25')](_0x191e91);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x384319);var _0x1e8694={'LastName':_0x526cf3!==''?_0x526cf3:util[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x384319),'Phone':_0x384319};if(_0x33161b[_0x0a9e('0x33')]){if(_0x33161b[_0x0a9e('0x33')]==='contact'){logger[_0x0a9e('0x22')](_0x0a9e('0x34'),_0x384319,_0x33161b[_0x0a9e('0x33')]);}else if(_0x33161b['moduleCreate']===_0x0a9e('0x2d')&&_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x384319,_0x33161b[_0x0a9e('0x33')]);_0x1e8694[_0x0a9e('0x35')]='No\x20Company';}else{return null;}}return _0x479bc4[_0x0a9e('0x1a')](_[_0x0a9e('0x36')](_0x33161b[_0x0a9e('0x33')]))[_0x0a9e('0x17')](_0x1e8694);}});}function getCustomFields(_0x4b38d9,_0x5a594b){var _0x15e37d={};if(_0x4b38d9[_0x0a9e('0x1f')]>0x0){_['forEach'](_0x4b38d9,function(_0x183991){if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x38')&&_0x183991['idField']){_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x183991[_0x0a9e('0x3a')][_0x0a9e('0x3b')]();}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3c')&&_0x183991[_0x0a9e('0x3d')]&&_0x183991[_0x0a9e('0x39')]){_0x5a594b[_0x183991[_0x0a9e('0x3d')]]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3d')]][_0x0a9e('0x3b')]());}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3e')&&_0x183991[_0x0a9e('0x3f')]&&_0x183991[_0x0a9e('0x3f')]['name']&&_0x183991['idField']){_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()][_0x0a9e('0x3b')]());}});}return _0x15e37d;}function getConnection(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x42')][_0x0a9e('0x43')](_0x432fcc['securityToken']);var _0x117c99=new jsforce[(_0x0a9e('0x44'))]({'oauth2':{'loginUrl':_0x432fcc[_0x0a9e('0x45')]||_0x0a9e('0x46'),'clientId':_0x432fcc[_0x0a9e('0x47')],'clientSecret':_0x432fcc[_0x0a9e('0x48')]}});return _0x117c99[_0x0a9e('0x49')](_0x432fcc[_0x0a9e('0x4a')],_0x25c6e6)['then'](function(){logger[_0x0a9e('0x22')]('Connection\x20established.');return _0x117c99;});}exports[_0x0a9e('0x4b')]=function(_0x476688,_0x8d6dd1,_0x562fb4,_0x14bec2,_0x7f6eb1,_0x4774f4){var _0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f;_0x4774f4['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x4d')]);_0x4774f4[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x45')]);if(_0x7f6eb1&&_0x7f6eb1[_0x0a9e('0x4e')]){logger[_0x0a9e('0x22')](_0x0a9e('0x4f'),_0x0a9e('0x50'));_0x8d6dd1['recordingURL']=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x4774f4['serverUrl'],_0x8d6dd1['uniqueid'],md5(_0x8d6dd1['uniqueid']));}else{_0x8d6dd1[_0x0a9e('0x52')]='';}return getConnection(_0x4774f4)[_0x0a9e('0x1e')](function(_0x37edaa){_0x45bf7f=_0x37edaa;return getUser(_0x4774f4,_0x14bec2[_0x0a9e('0x53')],_0x45bf7f);})[_0x0a9e('0x1e')](function(_0x30decb){_0x34aa5a=_0x30decb;return getEndUser(_0x4774f4,_0x562fb4,_0x8d6dd1[_0x0a9e('0x54')],_0x8d6dd1[_0x0a9e('0x55')],_0x45bf7f);})['then'](function(_0x4b1b9f){_0x45c845=_0x4b1b9f;return getTicket(_0x4774f4,_0x34aa5a,_0x45c845,_0x562fb4,_0x8d6dd1,_0x562fb4['Fields'],_0x45bf7f,_0x0a9e('0x4b'));})[_0x0a9e('0x1e')](function(_0x14d602){_0x37be73=_0x14d602;logger['info'](_0x0a9e('0x56'),_0x37be73['id']);logger[_0x0a9e('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37be73['id'],_0x14bec2['name'],_0x4774f4[_0x0a9e('0x37')]);switch(_0x4774f4['type']){case _0x0a9e('0x57'):emit(util['format'](_0x0a9e('0x58'),_0x14bec2[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x37be73['id']});break;case'newTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x14bec2['name']),'trigger:browser:url',{'uri':util[_0x0a9e('0x31')](_0x0a9e('0x5a'),_0x45bf7f['instanceUrl'],_0x37be73['id'])});break;default:logger[_0x0a9e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0a9e('0x5c')](function(_0x523cd2){logger[_0x0a9e('0x5b')]('[QUEUE]',JSON['stringify'](_0x523cd2));});};exports['outbound']=function(_0x2da03c,_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df,_0x232830){var _0x272738,_0xd10662,_0x28d814,_0x4e67ab;_0x19b4df[_0x0a9e('0x4d')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x4d')]);_0x19b4df[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x45')]);if(_0x232830&&_0x232830['recordingFormat']&&_0x232830[_0x0a9e('0x5d')]!==_0x0a9e('0x5e')){logger['info'](_0x0a9e('0x5f'),'Recording\x20is\x20enabled!');_0x47de4c[_0x0a9e('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19b4df['serverUrl'],_0x47de4c[_0x0a9e('0x60')],md5(_0x47de4c['uniqueid']));}return getConnection(_0x19b4df)[_0x0a9e('0x1e')](function(_0x1fc70e){_0x4e67ab=_0x1fc70e;return getUser(_0x19b4df,_0x65432[_0x0a9e('0x53')],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x1cca9f){_0x272738=_0x1cca9f;return getEndUser(_0x19b4df,_0x2f7092,_0x47de4c[_0x0a9e('0x61')],_0x47de4c['destcalleridnum'],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x5854cc){_0xd10662=_0x5854cc;return getTicket(_0x19b4df,_0x272738,_0xd10662,_0x2f7092,_0x47de4c,_0x2f7092[_0x0a9e('0x62')],_0x4e67ab,_0x0a9e('0x63'));})[_0x0a9e('0x1e')](function(_0x5adf8f){_0x28d814=_0x5adf8f;logger[_0x0a9e('0x22')](_0x0a9e('0x64'),_0x28d814['id']);logger[_0x0a9e('0x22')](_0x0a9e('0x65'),_0x28d814['id'],_0x65432['name'],_0x19b4df[_0x0a9e('0x37')]);switch(_0x19b4df[_0x0a9e('0x37')]){case'integrationTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x28d814['id']});break;case _0x0a9e('0x66'):emit(util['format'](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x67'),{'uri':util['format'](_0x0a9e('0x5a'),_0x4e67ab['instanceUrl'],_0x28d814['id'])});break;default:logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x68'));}})[_0x0a9e('0x5c')](function(_0x19c995){logger[_0x0a9e('0x5b')](_0x0a9e('0x5f'),JSON[_0x0a9e('0x69')](_0x19c995));});};exports[_0x0a9e('0x6a')]=function(_0x2d7205,_0x1cc4f3,_0x2e89b7,_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898,_0x412a72,_0x2a28c0,_0x4257c9;_0x2b8192['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x2b8192[_0x0a9e('0x4d')]);_0x2b8192[_0x0a9e('0x45')]=intUtil['stripTrailingSlash'](_0x2b8192[_0x0a9e('0x45')]);if(_0x2bbb86&&_0x2bbb86[_0x0a9e('0x4e')]){logger['info'](_0x0a9e('0x6b'),_0x0a9e('0x50'));_0x1cc4f3[_0x0a9e('0x52')]=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x2b8192['serverUrl'],_0x1cc4f3['uniqueid'],md5(_0x1cc4f3['uniqueid']));}else{_0x1cc4f3[_0x0a9e('0x52')]='';}return getConnection(_0x2b8192)[_0x0a9e('0x1e')](function(_0x1104ad){_0x4257c9=_0x1104ad;if(!_[_0x0a9e('0x18')](_0x19012b)){return getUser(_0x2b8192,_0x19012b[_0x0a9e('0x40')],_0x4257c9);}else{return getUser(_0x2b8192,null,_0x4257c9);}})[_0x0a9e('0x1e')](function(_0xeef20){_0x320898=_0xeef20;return getEndUser(_0x2b8192,_0x2e89b7,_0x1cc4f3[_0x0a9e('0x54')],_0x1cc4f3['calleridnum'],_0x4257c9);})[_0x0a9e('0x1e')](function(_0xcbc8b2){_0x412a72=_0xcbc8b2;return getTicket(_0x2b8192,_0x320898,_0x412a72,_0x2e89b7,_0x1cc4f3,_0x2e89b7[_0x0a9e('0x62')],_0x4257c9);})['then'](function(_0x2bdc44){_0x2a28c0=_0x2bdc44;logger['info'](_0x0a9e('0x6c'),_0x2a28c0['id']);logger[_0x0a9e('0x22')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x2b8192[_0x0a9e('0x37')]);})[_0x0a9e('0x5c')](function(_0x2cc7a7){logger[_0x0a9e('0x5b')]('[ABANDONED]',JSON[_0x0a9e('0x69')](_0x2cc7a7));});}; \ No newline at end of file +var _0x70e0=['Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','create','length','type','string','idField','content','toString','variable','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','stringify','outbound','recordingFormat','none','%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.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','jsforce','util','ioredis','./util','../../../../config/logger','redis','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Descriptions','ContactId','sobject','isNil','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','lead','Contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x70e0,0x17b));var _0x070e=function(_0x5bc763,_0x542561){_0x5bc763=_0x5bc763-0x0;var _0x37f31a=_0x70e0[_0x5bc763];return _0x37f31a;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x070e('0x3'));var util=require(_0x070e('0x4'));var Redis=require(_0x070e('0x5'));var intUtil=require(_0x070e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x070e('0x7'))('salesforce');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));function emit(_0x604664,_0x2611e6,_0x111743){io['to'](_0x604664)[_0x070e('0xa')](_0x2611e6,_0x111743);}function getTicket(_0x11ffa8,_0x4e99e6,_0x49b2fb,_0x50f4eb,_0x2e3e5e,_0x12bb37,_0xb8d819,_0xa927a2){var _0xffcdd6={};if(_0x50f4eb[_0x070e('0xb')]===_0x070e('0xc')){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'ActivityDate':moment[_0x070e('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6['WhoId']=_0x49b2fb['id'];}}else if(_0x50f4eb['ticketType']==='Case'){_0xffcdd6=Object[_0x070e('0xd')]({},{'OwnerId':_0x4e99e6['id'],'Subject':intUtil[_0x070e('0xf')](_0x50f4eb['Subjects'],_0x2e3e5e,'\x20'),'Description':intUtil['getString'](_0x50f4eb[_0x070e('0x10')],_0x2e3e5e,'\x0a')},getCustomFields(_0x12bb37,_0x2e3e5e));if(_0x49b2fb){_0xffcdd6[_0x070e('0x11')]=_0x49b2fb['id'];}}return _0xb8d819[_0x070e('0x12')](_0x50f4eb[_0x070e('0xb')])['create'](_0xffcdd6);}function getUser(_0x49861b,_0x17e2e4,_0x2bd937){if(!_[_0x070e('0x13')](_0x17e2e4)&&intUtil[_0x070e('0x14')](_0x17e2e4)){var _0x364b3f={'Email':_0x17e2e4};var _0x5037eb={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2bd937[_0x070e('0x12')](_0x070e('0x15'))[_0x070e('0x16')](_0x364b3f,_0x5037eb)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0x5c16fd){if(_0x5c16fd['length']){var _0x4e958f=_[_0x070e('0x16')](_0x5c16fd,function(_0x3004f0){return _0x3004f0[_0x070e('0x19')]===_0x17e2e4;});if(_0x4e958f){logger['info'](_0x070e('0x1a'),_0x17e2e4);return BPromise['resolve']({'id':_0x4e958f['Id'],'name':_0x4e958f[_0x070e('0x1b')]});}}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()[_0x070e('0x18')](function(_0xa86797){return BPromise[_0x070e('0x1f')]({'id':_0xa86797[_0x070e('0x20')],'name':_0xa86797['display_name']});});}});}else{logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x17e2e4);return _0x2bd937[_0x070e('0x1e')]()['then'](function(_0xf17c56){return BPromise['resolve']({'id':_0xf17c56['user_id'],'name':_0xf17c56[_0x070e('0x21')]});});}}function getEndUser(_0x25f6e,_0x41deb1,_0x1743cc,_0x4763c6,_0x497f58){var _0x374c54={'Phone':_0x4763c6};var _0x219e48={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x070e('0x1f')]()[_0x070e('0x18')](function(){if(_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,_0x41deb1['moduleSearch']);switch(_0x41deb1[_0x070e('0x23')]){case _0x070e('0x24'):return _0x497f58[_0x070e('0x12')]('Contact')['find'](_0x374c54,_0x219e48)[_0x070e('0x17')]()[_0x070e('0x18')](function(_0xa6c0ab){if(_0xa6c0ab&&_0xa6c0ab['length']){return _0xa6c0ab;}else{return _0x497f58[_0x070e('0x12')](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);}});case _0x070e('0x26'):return _0x497f58['sobject']('Contact')['find'](_0x374c54,_0x219e48)['execute']();case _0x070e('0x27'):return _0x497f58['sobject'](_0x070e('0x25'))[_0x070e('0x16')](_0x374c54,_0x219e48);default:return null;}}else if(_0x41deb1['ticketType']==='Case'){logger[_0x070e('0x1c')](_0x070e('0x22'),_0x4763c6,'contact');return _0x497f58['sobject'](_0x070e('0x28'))[_0x070e('0x16')](_0x374c54,_0x219e48)[_0x070e('0x17')]();}})[_0x070e('0x18')](function(_0x18f0ad){if(_0x18f0ad&&_0x18f0ad['length']){var _0x482cc2=_[_0x070e('0x16')](_0x18f0ad,function(_0x3011c4){return _0x3011c4[_0x070e('0x29')]===_0x4763c6;});if(_0x482cc2){return BPromise[_0x070e('0x1f')]({'id':_0x482cc2['Id'],'name':_0x482cc2[_0x070e('0x1b')],'phone':_0x482cc2['Phone']});}}})[_0x070e('0x18')](function(_0x1927f4){if(_0x1927f4){logger['info'](_0x070e('0x2a'),_0x4763c6);return BPromise[_0x070e('0x1f')](_0x1927f4);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x4763c6);var _0x5ddbe9={'LastName':_0x1743cc!==_0x070e('0x2b')?_0x1743cc:util[_0x070e('0x2c')](_0x070e('0x2d'),_0x4763c6),'Phone':_0x4763c6};if(_0x41deb1[_0x070e('0x2e')]){if(_0x41deb1[_0x070e('0x2e')]==='contact'){logger[_0x070e('0x1c')](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);}else if(_0x41deb1['moduleCreate']===_0x070e('0x27')&&_0x41deb1[_0x070e('0xb')]===_0x070e('0xc')){logger['info'](_0x070e('0x2f'),_0x4763c6,_0x41deb1[_0x070e('0x2e')]);_0x5ddbe9['Company']=_0x070e('0x30');}else{return null;}}return _0x497f58['sobject'](_[_0x070e('0x31')](_0x41deb1[_0x070e('0x2e')]))[_0x070e('0x32')](_0x5ddbe9);}});}function getCustomFields(_0x30319c,_0xd03404){var _0x47b929={};if(_0x30319c[_0x070e('0x33')]>0x0){_['forEach'](_0x30319c,function(_0x5bd39a){if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x35')&&_0x5bd39a[_0x070e('0x36')]){_0x47b929[_0x5bd39a['idField']]=_0x5bd39a[_0x070e('0x37')][_0x070e('0x38')]();}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x39')&&_0x5bd39a['variableName']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['variableName']]&&(_0x47b929[_0x5bd39a['idField']]=_0xd03404[_0x5bd39a['variableName']][_0x070e('0x38')]());}else if(_0x5bd39a[_0x070e('0x34')]===_0x070e('0x3a')&&_0x5bd39a[_0x070e('0x3b')]&&_0x5bd39a[_0x070e('0x3b')]['name']&&_0x5bd39a[_0x070e('0x36')]){_0xd03404[_0x5bd39a['Variable'][_0x070e('0x3c')][_0x070e('0x3d')]()]&&(_0x47b929[_0x5bd39a[_0x070e('0x36')]]=_0xd03404[_0x5bd39a['Variable']['name'][_0x070e('0x3d')]()]['toString']());}});}return _0x47b929;}function getConnection(_0x35349f){var _0x3fdb75=_0x35349f[_0x070e('0x3e')]['concat'](_0x35349f[_0x070e('0x3f')]);var _0x20a1ee=new jsforce['Connection']({'oauth2':{'loginUrl':_0x35349f['remoteUri']||_0x070e('0x40'),'clientId':_0x35349f[_0x070e('0x41')],'clientSecret':_0x35349f[_0x070e('0x42')]}});return _0x20a1ee[_0x070e('0x43')](_0x35349f[_0x070e('0x44')],_0x3fdb75)['then'](function(){logger[_0x070e('0x1c')](_0x070e('0x45'));return _0x20a1ee;});}exports[_0x070e('0x46')]=function(_0x391dee,_0x79eaa0,_0xcd1c61,_0x1f54d5,_0x1b5374,_0xd67987){var _0x66a3f3,_0x210c4d,_0x3be553,_0x5254f8;_0xd67987[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0xd67987['serverUrl']);_0xd67987[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0xd67987[_0x070e('0x49')]);if(_0x1b5374&&_0x1b5374[_0x070e('0x4a')]){logger[_0x070e('0x1c')](_0x070e('0x4b'),_0x070e('0x4c'));_0x79eaa0[_0x070e('0x4d')]=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd67987[_0x070e('0x47')],_0x79eaa0['uniqueid'],md5(_0x79eaa0[_0x070e('0x4e')]));}else{_0x79eaa0[_0x070e('0x4d')]='';}return getConnection(_0xd67987)['then'](function(_0x991d23){_0x5254f8=_0x991d23;return getUser(_0xd67987,_0x1f54d5[_0x070e('0x4f')],_0x5254f8);})[_0x070e('0x18')](function(_0xa74805){_0x66a3f3=_0xa74805;return getEndUser(_0xd67987,_0xcd1c61,_0x79eaa0[_0x070e('0x50')],_0x79eaa0[_0x070e('0x51')],_0x5254f8);})[_0x070e('0x18')](function(_0x5694fa){_0x210c4d=_0x5694fa;return getTicket(_0xd67987,_0x66a3f3,_0x210c4d,_0xcd1c61,_0x79eaa0,_0xcd1c61[_0x070e('0x52')],_0x5254f8,'queue');})['then'](function(_0x3a06c6){_0x3be553=_0x3a06c6;logger[_0x070e('0x1c')](_0x070e('0x53'),_0x3be553['id']);logger[_0x070e('0x1c')](_0x070e('0x54'),_0x3be553['id'],_0x1f54d5[_0x070e('0x3c')],_0xd67987[_0x070e('0x34')]);switch(_0xd67987[_0x070e('0x34')]){case'integrationTab':emit(util[_0x070e('0x2c')]('user:%s',_0x1f54d5['name']),_0x070e('0x55'),{'recordId':_0x3be553['id']});break;case _0x070e('0x56'):emit(util['format'](_0x070e('0x57'),_0x1f54d5[_0x070e('0x3c')]),_0x070e('0x58'),{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x5254f8[_0x070e('0x5a')],_0x3be553['id'])});break;default:logger[_0x070e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x5943e3){logger[_0x070e('0x5b')](_0x070e('0x4b'),JSON[_0x070e('0x5c')](_0x5943e3));});};exports[_0x070e('0x5d')]=function(_0x5ac0b5,_0x25f34c,_0x5d3c3a,_0x212710,_0x1cbb7e,_0x476804,_0x24f303){var _0x3ab11c,_0x15dbc4,_0x5561ed,_0x20ff87;_0x476804[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x476804['serverUrl']);_0x476804[_0x070e('0x49')]=intUtil[_0x070e('0x48')](_0x476804['remoteUri']);if(_0x24f303&&_0x24f303[_0x070e('0x5e')]&&_0x24f303['recordingFormat']!==_0x070e('0x5f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25f34c[_0x070e('0x4d')]=util[_0x070e('0x2c')](_0x070e('0x60'),_0x476804[_0x070e('0x47')],_0x25f34c[_0x070e('0x4e')],md5(_0x25f34c[_0x070e('0x4e')]));}return getConnection(_0x476804)['then'](function(_0x841c89){_0x20ff87=_0x841c89;return getUser(_0x476804,_0x212710['email'],_0x20ff87);})[_0x070e('0x18')](function(_0x52becf){_0x3ab11c=_0x52becf;return getEndUser(_0x476804,_0x5d3c3a,_0x25f34c[_0x070e('0x61')],_0x25f34c[_0x070e('0x62')],_0x20ff87);})['then'](function(_0x1bcdc3){_0x15dbc4=_0x1bcdc3;return getTicket(_0x476804,_0x3ab11c,_0x15dbc4,_0x5d3c3a,_0x25f34c,_0x5d3c3a['Fields'],_0x20ff87,_0x070e('0x5d'));})[_0x070e('0x18')](function(_0x2f1604){_0x5561ed=_0x2f1604;logger[_0x070e('0x1c')](_0x070e('0x63'),_0x5561ed['id']);logger[_0x070e('0x1c')](_0x070e('0x64'),_0x5561ed['id'],_0x212710[_0x070e('0x3c')],_0x476804[_0x070e('0x34')]);switch(_0x476804[_0x070e('0x34')]){case _0x070e('0x65'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:salesforce:display',{'recordId':_0x5561ed['id']});break;case _0x070e('0x56'):emit(util[_0x070e('0x2c')](_0x070e('0x57'),_0x212710[_0x070e('0x3c')]),'trigger:browser:url',{'uri':util[_0x070e('0x2c')](_0x070e('0x59'),_0x20ff87[_0x070e('0x5a')],_0x5561ed['id'])});break;default:logger[_0x070e('0x5b')](_0x070e('0x66'),_0x070e('0x67'));}})['catch'](function(_0x5251d6){logger[_0x070e('0x5b')](_0x070e('0x66'),JSON[_0x070e('0x5c')](_0x5251d6));});};exports['abandoned']=function(_0x8b9c73,_0x52804d,_0x10d95d,_0x36373d,_0x3a1ad2,_0x150bf6){var _0x2a20d4,_0x50ef9f,_0x2e48f9,_0x2e38c6;_0x150bf6[_0x070e('0x47')]=intUtil[_0x070e('0x48')](_0x150bf6['serverUrl']);_0x150bf6[_0x070e('0x49')]=intUtil['stripTrailingSlash'](_0x150bf6[_0x070e('0x49')]);if(_0x3a1ad2&&_0x3a1ad2[_0x070e('0x4a')]){logger[_0x070e('0x1c')]('[ABANDONED]',_0x070e('0x4c'));_0x52804d['recordingURL']=util[_0x070e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x150bf6[_0x070e('0x47')],_0x52804d[_0x070e('0x4e')],md5(_0x52804d['uniqueid']));}else{_0x52804d[_0x070e('0x4d')]='';}return getConnection(_0x150bf6)['then'](function(_0x1c831f){_0x2e38c6=_0x1c831f;if(!_[_0x070e('0x13')](_0x36373d)){return getUser(_0x150bf6,_0x36373d['name'],_0x2e38c6);}else{return getUser(_0x150bf6,null,_0x2e38c6);}})['then'](function(_0x29ee66){_0x2a20d4=_0x29ee66;return getEndUser(_0x150bf6,_0x10d95d,_0x52804d[_0x070e('0x50')],_0x52804d[_0x070e('0x51')],_0x2e38c6);})[_0x070e('0x18')](function(_0x25f1d0){_0x50ef9f=_0x25f1d0;return getTicket(_0x150bf6,_0x2a20d4,_0x50ef9f,_0x10d95d,_0x52804d,_0x10d95d[_0x070e('0x52')],_0x2e38c6);})[_0x070e('0x18')](function(_0x332c8a){_0x2e48f9=_0x332c8a;logger[_0x070e('0x1c')](_0x070e('0x68'),_0x2e48f9['id']);logger[_0x070e('0x1c')](_0x070e('0x69'),_0x150bf6[_0x070e('0x34')]);})['catch'](function(_0x3308b5){logger[_0x070e('0x5b')]('[ABANDONED]',JSON['stringify'](_0x3308b5));});}; \ 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 2067393..ba4d423 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 _0x9417=['adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','customField','toLowerCase','content','toString','string','type','variable','variableName','idField','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','email','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','info','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','sys_id','adminId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9417,0xb4));var _0x7941=function(_0x5bce33,_0x4a4b06){_0x5bce33=_0x5bce33-0x0;var _0x15bc20=_0x9417[_0x5bce33];return _0x15bc20;};'use strict';var _=require(_0x7941('0x0'));var Promise=require(_0x7941('0x1'));var rp=require(_0x7941('0x2'));var util=require(_0x7941('0x3'));var md5=require('md5');var Redis=require(_0x7941('0x4'));var intUtil=require(_0x7941('0x5'));var config=require(_0x7941('0x6'));var logger=require(_0x7941('0x7'))(_0x7941('0x8'));config[_0x7941('0x9')]=_[_0x7941('0xa')](config[_0x7941('0x9')],{'host':_0x7941('0xb'),'port':0x18eb});var io=require(_0x7941('0xc'))(new Redis(config['redis']));function getAdminUser(_0x11a155,_0x238e43,_0x717f3,_0x5e1302,_0x1122f4,_0x4ab313){return new Promise(function(_0x5d97de,_0xc31a6e){var _0x3b0f68={'method':_0x7941('0xd'),'uri':_0x5e1302+_0x7941('0xe')+'&'+_0x1122f4+'&'+_0x4ab313,'auth':_0x238e43,'json':!![]};return rp(_0x3b0f68)[_0x7941('0xf')](function(_0x2b3751){if(_0x2b3751[_0x7941('0x10')][_0x7941('0x11')]>0x0){_0x717f3['adminId']=_0x2b3751[_0x7941('0x10')][0x0]['sys_id'];}logger[_0x7941('0x12')]('['+[_0x11a155[_0x7941('0x13')]()]+'],\x20getAdminUser\x20crm',_0x717f3);_0x5d97de(_0x717f3);})['catch'](function(_0x218cef){logger['error']('['+[_0x11a155[_0x7941('0x13')]()]+']',_0x218cef[_0x7941('0x14')]);_0xc31a6e(_0x218cef[_0x7941('0x14')]);});});}function getUser(_0xae8c2a,_0x1da410,_0x41b098,_0x55320b,_0x11623c){return function(_0x459430){logger[_0x7941('0x12')]('['+[_0xae8c2a[_0x7941('0x13')]()]+_0x7941('0x15'),_0x459430);return new Promise(function(_0x256f45,_0x4172a7){if(intUtil[_0x7941('0x16')](_0x459430[_0x7941('0x17')])){var _0x533559={'method':'GET','uri':_0x41b098+_0x7941('0x18')+_0x459430['userEmail']+'&'+_0x55320b+'&'+_0x11623c,'auth':_0x1da410,'json':!![]};logger[_0x7941('0x12')]('['+[_0xae8c2a[_0x7941('0x13')]()]+_0x7941('0x19'),_0x533559);return rp(_0x533559)['then'](function(_0x4c54cd){logger[_0x7941('0x12')]('['+[_0xae8c2a['toUpperCase']()]+_0x7941('0x1a'),_0x4c54cd);if(_0x4c54cd['result'][_0x7941('0x11')]>0x0&&String(_0x4c54cd[_0x7941('0x10')][0x0][_0x7941('0x1b')])===_0x7941('0x1c')){_0x459430[_0x7941('0x1d')]=_0x4c54cd[_0x7941('0x10')][0x0][_0x7941('0x1e')];}else{_0x459430['userId']=_0x459430[_0x7941('0x1f')];_0x459430['userEmail']=_0x459430[_0x7941('0x20')];}logger[_0x7941('0x12')]('['+[_0xae8c2a[_0x7941('0x13')]()]+_0x7941('0x21'),_0x459430);_0x256f45(_0x459430);})['catch'](function(_0x55f679){logger[_0x7941('0x22')]('['+[_0xae8c2a[_0x7941('0x13')]()]+']',_0x55f679['message']);_0x4172a7(_0x55f679['message']);});}else{logger[_0x7941('0x12')]('['+[_0xae8c2a[_0x7941('0x13')]()]+_0x7941('0x23'));_0x459430[_0x7941('0x1d')]=_0x459430[_0x7941('0x1f')];_0x459430['userEmail']=_0x459430[_0x7941('0x20')];_0x256f45(_0x459430);}});};}function createEndUser(_0x1f5de6,_0x133bed,_0x240052,_0x23f617,_0x24cc75){logger[_0x7941('0x12')]('['+[_0x1f5de6['toUpperCase']()]+_0x7941('0x24'),_0x240052);return new Promise(function(_0x3882be,_0x1d118b){var _0x4c6786={'method':_0x7941('0x25'),'uri':_0x23f617+'sys_user?'+_0x24cc75,'body':{'user_name':_0x240052[_0x7941('0x26')],'roles':_0x7941('0x27'),'first_name':_0x240052[_0x7941('0x26')],'active':'true','date_format':_0x7941('0x28'),'phone':_0x240052[_0x7941('0x26')]},'auth':_0x133bed,'json':!![]};return rp(_0x4c6786)['then'](function(_0x372051){logger[_0x7941('0x12')]('['+[_0x1f5de6['toUpperCase']()]+_0x7941('0x29'),_0x372051[_0x7941('0x10')]);_0x240052['endUserId']=_0x372051[_0x7941('0x10')][_0x7941('0x1e')];_0x3882be(_0x240052);})[_0x7941('0x2a')](function(_0x3592d9){logger[_0x7941('0x22')]('['+[_0x1f5de6[_0x7941('0x13')]()]+']',_0x3592d9[_0x7941('0x14')]);_0x1d118b(_0x3592d9['message']);});});}function getEndUser(_0x3f3cf2,_0x28848a,_0x4e4328,_0x1cdc80,_0x1375c5){return function(_0x26014a){logger[_0x7941('0x12')]('['+[_0x3f3cf2[_0x7941('0x13')]()]+_0x7941('0x2b'),_0x26014a);return new Promise(function(_0x54b5d0,_0x253d40){var _0xc235d6={'method':_0x7941('0xd'),'uri':_0x4e4328+_0x7941('0x2c')+_0x26014a[_0x7941('0x26')]+'&'+_0x1cdc80+'&'+_0x1375c5,'auth':_0x28848a,'json':!![]};return rp(_0xc235d6)[_0x7941('0xf')](function(_0x772541){if(_0x772541['result'][_0x7941('0x11')]>0x0){_0x26014a[_0x7941('0x2d')]=_0x772541['result'][0x0]['sys_id'];logger[_0x7941('0x12')]('['+[_0x3f3cf2[_0x7941('0x13')]()]+_0x7941('0x2e'),_0x26014a);_0x54b5d0(_0x26014a);}else{return createEndUser(_0x3f3cf2,_0x28848a,_0x26014a,_0x4e4328,_0x1cdc80)[_0x7941('0xf')](function(_0xe0f4e){logger[_0x7941('0x12')]('['+[_0x3f3cf2[_0x7941('0x13')]()]+_0x7941('0x2f'),_0xe0f4e);_0x54b5d0(_0xe0f4e);});}})['catch'](function(_0x36cb98){logger['error']('['+[_0x3f3cf2[_0x7941('0x13')]()]+']',_0x36cb98[_0x7941('0x14')]);_0x253d40(_0x36cb98[_0x7941('0x14')]);});});};}function getCustomFields(_0x4fc700,_0x2bb30d){var _0x546afd={};if(_0x4fc700['length']>0x0){_[_0x7941('0x30')](_0x4fc700,function(_0x3b1342){if(_0x3b1342['type']==='string'&&_0x3b1342['nameField']&&!_0x3b1342[_0x7941('0x31')]){_0x546afd[_0x3b1342['idField'][_0x7941('0x32')]()]=_0x3b1342[_0x7941('0x33')][_0x7941('0x34')]();}else if(_0x3b1342['type']===_0x7941('0x35')&&_0x3b1342['idField']&&_0x3b1342[_0x7941('0x31')]){_0x546afd[_0x3b1342['idField'][_0x7941('0x32')]()]=_0x3b1342['content']['toString']();}else if(_0x3b1342[_0x7941('0x36')]===_0x7941('0x37')&&_0x3b1342[_0x7941('0x38')]&&_0x3b1342[_0x7941('0x39')]&&_0x3b1342[_0x7941('0x31')]){_0x546afd[_0x3b1342[_0x7941('0x39')][_0x7941('0x32')]()]=_0x2bb30d[_0x3b1342[_0x7941('0x38')]][_0x7941('0x34')]();}else if(_0x3b1342[_0x7941('0x36')]===_0x7941('0x3a')&&_0x3b1342[_0x7941('0x3b')]&&_0x3b1342[_0x7941('0x3b')]['name']&&_0x3b1342[_0x7941('0x39')]&&_0x3b1342[_0x7941('0x31')]){_0x546afd[_0x3b1342[_0x7941('0x39')][_0x7941('0x32')]()]=_0x2bb30d[_0x3b1342[_0x7941('0x3b')]['name']['toLowerCase']()]['toString']();}});}return _0x546afd;}function getTicket(_0x169660,_0x3bf212,_0x583c00,_0x47582f,_0x2dff40,_0x3cafd5){return function(_0x5e9ac4){logger[_0x7941('0x12')]('['+[_0x169660[_0x7941('0x13')]()]+_0x7941('0x3c'),_0x5e9ac4);return new Promise(function(_0x1ded47,_0x938829){var _0x4b32b3=_0x169660[_0x7941('0x32')]()===_0x7941('0x3d')?_0x5e9ac4['userId']:_0x5e9ac4['endUserId'];var _0xa70523={'method':_0x7941('0x25'),'uri':_0x583c00+'incident'+'?'+_0x3cafd5,'body':Object[_0x7941('0x3e')]({},{'active':_0x7941('0x1c'),'caller_id':_0x4b32b3,'assigned_to':_0x5e9ac4[_0x7941('0x1d')],'short_description':intUtil[_0x7941('0x3f')](_0x47582f[_0x7941('0x40')],_0x2dff40,'\x20'),'description':intUtil[_0x7941('0x3f')](_0x47582f[_0x7941('0x41')],_0x2dff40,'\x0a')},getCustomFields(_0x47582f[_0x7941('0x42')],_0x2dff40)),'auth':_0x3bf212,'json':!![]};return rp(_0xa70523)[_0x7941('0xf')](function(_0x5c4835){logger[_0x7941('0x12')]('['+[_0x169660['toUpperCase']()]+_0x7941('0x43'),_0x5c4835[_0x7941('0x10')]);_0x5e9ac4[_0x7941('0x44')]=_0x5c4835[_0x7941('0x10')][_0x7941('0x1e')];_0x5e9ac4[_0x7941('0x45')]=_0x5c4835['result'][_0x7941('0x46')];logger[_0x7941('0x12')]('['+[_0x169660[_0x7941('0x13')]()]+']\x20getTicket\x20crm',_0x5e9ac4);_0x1ded47(_0x5e9ac4);})[_0x7941('0x2a')](function(_0x66d3b4){logger[_0x7941('0x22')]('['+[_0x169660[_0x7941('0x13')]()]+']',_0x66d3b4[_0x7941('0x14')]);_0x938829(_0x66d3b4[_0x7941('0x14')]);});});};}function createRemoteTag(_0x3b5998,_0x224578,_0x29ace3,_0xb4835a){return new Promise(function(_0x44f4d1,_0x5b6bf2){var _0x438080={'method':'POST','uri':_0x29ace3+'label'+'?'+_0xb4835a,'body':{'short_description':_0x3b5998,'global':!![],'active':!![],'name':_0x3b5998},'auth':_0x224578,'json':!![]};return rp(_0x438080)[_0x7941('0xf')](function(_0x7ebf54){var _0x529fbf=_0x7ebf54[_0x7941('0x10')][_0x7941('0x1e')];_0x44f4d1(_0x529fbf);});});}function getRemoteTag(_0x4e77ba,_0x290b2,_0x4e9118,_0x5d3c37,_0x388c08){return new Promise(function(_0x4621a0,_0x9177c4){var _0x452191={'method':_0x7941('0xd'),'uri':_0x4e9118+'label'+_0x7941('0x47')+_0x4e77ba+'&'+_0x5d3c37,'auth':_0x290b2,'json':!![]};return rp(_0x452191)['then'](function(_0x7c3a71){if(_0x7c3a71[_0x7941('0x10')][_0x7941('0x11')]>0x0){var _0x2b01a6=_0x7c3a71[_0x7941('0x10')][0x0][_0x7941('0x1e')];_0x4621a0(_0x2b01a6);}else{return createRemoteTag(_0x4e77ba,_0x290b2,_0x4e9118,_0x5d3c37)[_0x7941('0xf')](function(_0x30157e){_0x4621a0(_0x30157e);});}});});}function assignTagToIncident(_0x27322b,_0x223ca1,_0x84fdc7,_0x57bcd8,_0x696517){return new Promise(function(_0x54012a,_0x24b467){var _0x4b4f02={'method':_0x7941('0x25'),'uri':_0x84fdc7+_0x7941('0x48')+'?'+_0x696517,'body':{'label':_0x27322b,'table':'incident','id_type':_0x7941('0x49'),'table_key':_0x57bcd8[_0x7941('0x44')],'title':_0x7941('0x4a')+_0x57bcd8[_0x7941('0x45')],'id_display':_0x57bcd8[_0x7941('0x45')]},'auth':_0x223ca1,'json':!![]};return rp(_0x4b4f02)[_0x7941('0xf')](function(_0x118f02){_0x54012a();})[_0x7941('0x2a')](function(){_0x54012a();});});}function manageTags(_0x20b42b,_0xd659bf,_0x4126cd,_0x342fab,_0x5c3311,_0xbc11e6,_0x1d9444){return new Promise(function(_0x3aa68c,_0x2661dd){var _0x3aeac1=[];_0xd659bf[_0x7941('0x30')](function(_0x1e8652){_0x3aeac1['push'](getRemoteTag(_0x1e8652,_0x4126cd,_0x342fab,_0xbc11e6,_0x1d9444));});return Promise[_0x7941('0x4b')](_0x3aeac1)[_0x7941('0xf')](function(_0x48e93c){if(_0x48e93c[_0x7941('0x11')]){logger[_0x7941('0x12')]('['+[_0x20b42b[_0x7941('0x13')]()]+_0x7941('0x4c'),_0x48e93c);var _0x2fd43a=[];_0x48e93c[_0x7941('0x30')](function(_0x537ea3){_0x2fd43a['push'](assignTagToIncident(_0x537ea3,_0x4126cd,_0x342fab,_0x5c3311,_0xbc11e6));});return Promise[_0x7941('0x4b')](_0x2fd43a)[_0x7941('0xf')](function(){_0x3aa68c();})[_0x7941('0x2a')](function(){_0x3aa68c();});}else{_0x3aa68c();}});});}function getTags(_0x448933,_0xfb32cb,_0x50c0eb,_0x2862f3,_0x46f630,_0x34e822){return function(_0x152461){return new Promise(function(_0x4108f4,_0x1d6dd3){var _0x3de671=[];var _0x47f60f=_0x2862f3[_0x7941('0x4d')];if(_0x47f60f&&_0x47f60f[_0x7941('0x11')]>0x0){_0x3de671=_['map'](_0x47f60f,_0x7941('0x4e'));}if(_0x3de671[_0x7941('0x11')]>0x0){return manageTags(_0x448933,_0x3de671,_0xfb32cb,_0x50c0eb,_0x152461,_0x46f630,_0x34e822)[_0x7941('0xf')](function(){_0x4108f4(_0x152461);});}else{_0x4108f4(_0x152461);}});};}function emit(_0x3dfd74,_0x2e8120,_0x2902ee){var _0x39952e=_0x7941('0x4f')+_0x7941('0x50')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x7941('0x51');var _0x2a1352={'uri':_0x3dfd74+_0x7941('0x52')+_0x2902ee+_0x39952e};io['to'](util[_0x7941('0x53')]('user:%s',_0x2e8120))['emit'](_0x7941('0x54'),_0x2a1352);}exports['cs']=function(_0x592fd5,_0x1da211,_0x526d81,_0x58c450,_0x341a16,_0x1a9572,_0x2a41a0,_0x2c9fb5){var _0x5c0f47={};var _0x1b21be={'user':_0x1a9572['username'],'pass':_0x1a9572['password']};var _0x51d811=_0x7941('0x55');var _0x171f0d=_0x7941('0x56');_0x1a9572['remoteUri']=intUtil[_0x7941('0x57')](_0x1a9572[_0x7941('0x58')]);_0x1a9572[_0x7941('0x59')]=intUtil[_0x7941('0x57')](_0x1a9572[_0x7941('0x59')]);var _0x360653=util[_0x7941('0x53')]('%s/api/now/table/',_0x1a9572[_0x7941('0x58')]);_0x5c0f47[_0x7941('0x17')]=!_['isNil'](_0x58c450)?_0x58c450[_0x7941('0x5a')]:null;_0x5c0f47[_0x7941('0x20')]=_0x1a9572['email'];_0x5c0f47[_0x7941('0x26')]=_0x2c9fb5[_0x7941('0x32')]()==='outbound'?_0x1da211['destcalleridnum']:_0x1da211[_0x7941('0x5b')];_0x5c0f47[_0x7941('0x5c')]=_0x2c9fb5===_0x7941('0x5d')||_0x2c9fb5===_0x7941('0x5e')?_0x7941('0x5d'):_0x7941('0x3d');var _0x1590c6=util[_0x7941('0x53')](_0x7941('0x5f'),_0x1a9572['serverUrl'],_0x1da211[_0x7941('0x60')],md5(_0x1da211[_0x7941('0x60')]));if(_0x341a16&&_0x341a16[_0x7941('0x61')]){logger['info'](_0x7941('0x62'),'Recording\x20is\x20enabled!');_0x1da211[_0x7941('0x63')]=_0x1590c6;}else if(_0x2a41a0&&_0x2a41a0[_0x7941('0x64')]&&_0x2a41a0[_0x7941('0x64')]!=='none'){logger['info'](_0x7941('0x65'),_0x7941('0x66'));_0x1da211['recordingURL']=_0x1590c6;}else{_0x1da211[_0x7941('0x63')]='';}return getAdminUser(_0x2c9fb5,_0x1b21be,_0x5c0f47,_0x360653,_0x171f0d,_0x51d811)[_0x7941('0xf')](getUser(_0x2c9fb5,_0x1b21be,_0x360653,_0x171f0d,_0x51d811))[_0x7941('0xf')](getEndUser(_0x2c9fb5,_0x1b21be,_0x360653,_0x171f0d,_0x51d811))['then'](getTicket(_0x2c9fb5,_0x1b21be,_0x360653,_0x526d81,_0x1da211,_0x171f0d))[_0x7941('0xf')](function(_0x5496bd){logger[_0x7941('0x12')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x5496bd['ticketId']));logger[_0x7941('0x12')](util[_0x7941('0x53')](_0x7941('0x67'),_0x2c9fb5));if(_0x2c9fb5!=='abandoned'){logger[_0x7941('0x12')]('['+[_0x2c9fb5[_0x7941('0x13')]()]+']',_0x7941('0x68'));emit(_0x1a9572[_0x7941('0x58')],_0x58c450['name'],_0x5496bd[_0x7941('0x44')]);}})['catch'](function(_0x83f7c3){logger[_0x7941('0x22')]('['+[_0x2c9fb5['toUpperCase']()]+_0x7941('0x69'),util['inspect'](_0x83f7c3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x80ce=['],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','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','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','util','md5','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','userEmail','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x80ce,0xae));var _0xe80c=function(_0x1b45a2,_0x1b73e3){_0x1b45a2=_0x1b45a2-0x0;var _0x2e0e79=_0x80ce[_0x1b45a2];return _0x2e0e79;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xe80c('0x0'));var md5=require(_0xe80c('0x1'));var Redis=require('ioredis');var intUtil=require(_0xe80c('0x2'));var config=require(_0xe80c('0x3'));var logger=require(_0xe80c('0x4'))('servicenow');config['redis']=_['defaults'](config[_0xe80c('0x5')],{'host':_0xe80c('0x6'),'port':0x18eb});var io=require(_0xe80c('0x7'))(new Redis(config[_0xe80c('0x5')]));function getAdminUser(_0x591a4a,_0x4da07c,_0x1fdd3b,_0x1d4902,_0x59634e,_0x104665){return new Promise(function(_0x21f32c,_0x1338af){var _0x3cfbeb={'method':_0xe80c('0x8'),'uri':_0x1d4902+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x59634e+'&'+_0x104665,'auth':_0x4da07c,'json':!![]};return rp(_0x3cfbeb)['then'](function(_0x56eb15){if(_0x56eb15[_0xe80c('0x9')][_0xe80c('0xa')]>0x0){_0x1fdd3b[_0xe80c('0xb')]=_0x56eb15[_0xe80c('0x9')][0x0][_0xe80c('0xc')];}logger[_0xe80c('0xd')]('['+[_0x591a4a[_0xe80c('0xe')]()]+_0xe80c('0xf'),_0x1fdd3b);_0x21f32c(_0x1fdd3b);})[_0xe80c('0x10')](function(_0x3665a0){logger[_0xe80c('0x11')]('['+[_0x591a4a[_0xe80c('0xe')]()]+']',_0x3665a0[_0xe80c('0x12')]);_0x1338af(_0x3665a0['message']);});});}function getUser(_0x1f3a06,_0x52801b,_0x451535,_0x2a118e,_0x100606){return function(_0x532e00){logger[_0xe80c('0xd')]('['+[_0x1f3a06[_0xe80c('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x532e00);return new Promise(function(_0xe525a8,_0x3f7d45){if(intUtil['validateEmail'](_0x532e00[_0xe80c('0x13')])){var _0x1f2a5c={'method':'GET','uri':_0x451535+'sys_user?sysparm_query=email%3D'+_0x532e00[_0xe80c('0x13')]+'&'+_0x2a118e+'&'+_0x100606,'auth':_0x52801b,'json':!![]};logger[_0xe80c('0xd')]('['+[_0x1f3a06[_0xe80c('0xe')]()]+_0xe80c('0x14'),_0x1f2a5c);return rp(_0x1f2a5c)[_0xe80c('0x15')](function(_0x15003f){logger['info']('['+[_0x1f3a06['toUpperCase']()]+'],\x20getUser\x20entity',_0x15003f);if(_0x15003f['result'][_0xe80c('0xa')]>0x0&&String(_0x15003f['result'][0x0][_0xe80c('0x16')])===_0xe80c('0x17')){_0x532e00[_0xe80c('0x18')]=_0x15003f[_0xe80c('0x9')][0x0][_0xe80c('0xc')];}else{_0x532e00[_0xe80c('0x18')]=_0x532e00[_0xe80c('0xb')];_0x532e00[_0xe80c('0x13')]=_0x532e00[_0xe80c('0x19')];}logger[_0xe80c('0xd')]('['+[_0x1f3a06[_0xe80c('0xe')]()]+_0xe80c('0x1a'),_0x532e00);_0xe525a8(_0x532e00);})['catch'](function(_0x266375){logger['error']('['+[_0x1f3a06[_0xe80c('0xe')]()]+']',_0x266375['message']);_0x3f7d45(_0x266375[_0xe80c('0x12')]);});}else{logger['info']('['+[_0x1f3a06[_0xe80c('0xe')]()]+_0xe80c('0x1b'));_0x532e00['userId']=_0x532e00[_0xe80c('0xb')];_0x532e00[_0xe80c('0x13')]=_0x532e00[_0xe80c('0x19')];_0xe525a8(_0x532e00);}});};}function createEndUser(_0x404b82,_0x333b9e,_0x410b66,_0x6577e9,_0x2936bf){logger[_0xe80c('0xd')]('['+[_0x404b82['toUpperCase']()]+_0xe80c('0x1c'),_0x410b66);return new Promise(function(_0x460cef,_0x512c94){var _0x473833={'method':'POST','uri':_0x6577e9+_0xe80c('0x1d')+_0x2936bf,'body':{'user_name':_0x410b66[_0xe80c('0x1e')],'roles':_0xe80c('0x1f'),'first_name':_0x410b66[_0xe80c('0x1e')],'active':_0xe80c('0x17'),'date_format':_0xe80c('0x20'),'phone':_0x410b66[_0xe80c('0x1e')]},'auth':_0x333b9e,'json':!![]};return rp(_0x473833)[_0xe80c('0x15')](function(_0x1f4a18){logger['info']('['+[_0x404b82['toUpperCase']()]+'],\x20EndUser\x20schema',_0x1f4a18[_0xe80c('0x9')]);_0x410b66[_0xe80c('0x21')]=_0x1f4a18[_0xe80c('0x9')][_0xe80c('0xc')];_0x460cef(_0x410b66);})[_0xe80c('0x10')](function(_0x5ae2d9){logger[_0xe80c('0x11')]('['+[_0x404b82['toUpperCase']()]+']',_0x5ae2d9['message']);_0x512c94(_0x5ae2d9[_0xe80c('0x12')]);});});}function getEndUser(_0x13d766,_0x2660e7,_0x31e7da,_0x1bf79b,_0xd08b3f){return function(_0x4bf900){logger[_0xe80c('0xd')]('['+[_0x13d766[_0xe80c('0xe')]()]+_0xe80c('0x22'),_0x4bf900);return new Promise(function(_0x632760,_0x3a7e2c){var _0x35cd13={'method':_0xe80c('0x8'),'uri':_0x31e7da+_0xe80c('0x23')+_0x4bf900[_0xe80c('0x1e')]+'&'+_0x1bf79b+'&'+_0xd08b3f,'auth':_0x2660e7,'json':!![]};return rp(_0x35cd13)['then'](function(_0x4c4015){if(_0x4c4015['result'][_0xe80c('0xa')]>0x0){_0x4bf900[_0xe80c('0x21')]=_0x4c4015[_0xe80c('0x9')][0x0]['sys_id'];logger[_0xe80c('0xd')]('['+[_0x13d766[_0xe80c('0xe')]()]+_0xe80c('0x24'),_0x4bf900);_0x632760(_0x4bf900);}else{return createEndUser(_0x13d766,_0x2660e7,_0x4bf900,_0x31e7da,_0x1bf79b)['then'](function(_0xa81871){logger[_0xe80c('0xd')]('['+[_0x13d766[_0xe80c('0xe')]()]+_0xe80c('0x25'),_0xa81871);_0x632760(_0xa81871);});}})[_0xe80c('0x10')](function(_0x3ef846){logger[_0xe80c('0x11')]('['+[_0x13d766[_0xe80c('0xe')]()]+']',_0x3ef846['message']);_0x3a7e2c(_0x3ef846[_0xe80c('0x12')]);});});};}function getCustomFields(_0x26dd2c,_0x1fa841){var _0x5557f4={};if(_0x26dd2c['length']>0x0){_[_0xe80c('0x26')](_0x26dd2c,function(_0x42b292){if(_0x42b292['type']===_0xe80c('0x27')&&_0x42b292[_0xe80c('0x28')]&&!_0x42b292[_0xe80c('0x29')]){_0x5557f4[_0x42b292['idField'][_0xe80c('0x2a')]()]=_0x42b292[_0xe80c('0x2b')][_0xe80c('0x2c')]();}else if(_0x42b292[_0xe80c('0x2d')]===_0xe80c('0x27')&&_0x42b292[_0xe80c('0x2e')]&&_0x42b292[_0xe80c('0x29')]){_0x5557f4[_0x42b292['idField']['toLowerCase']()]=_0x42b292[_0xe80c('0x2b')][_0xe80c('0x2c')]();}else if(_0x42b292[_0xe80c('0x2d')]===_0xe80c('0x2f')&&_0x42b292[_0xe80c('0x30')]&&_0x42b292[_0xe80c('0x2e')]&&_0x42b292['customField']){_0x5557f4[_0x42b292[_0xe80c('0x2e')][_0xe80c('0x2a')]()]=_0x1fa841[_0x42b292['variableName']]['toString']();}else if(_0x42b292[_0xe80c('0x2d')]===_0xe80c('0x31')&&_0x42b292[_0xe80c('0x32')]&&_0x42b292['Variable']['name']&&_0x42b292[_0xe80c('0x2e')]&&_0x42b292[_0xe80c('0x29')]){_0x5557f4[_0x42b292[_0xe80c('0x2e')][_0xe80c('0x2a')]()]=_0x1fa841[_0x42b292[_0xe80c('0x32')]['name']['toLowerCase']()][_0xe80c('0x2c')]();}});}return _0x5557f4;}function getTicket(_0x27b4d1,_0x5a1d7b,_0x4a73e2,_0xff5941,_0x1cc152,_0xf001a4){return function(_0x17f422){logger[_0xe80c('0xd')]('['+[_0x27b4d1['toUpperCase']()]+_0xe80c('0x33'),_0x17f422);return new Promise(function(_0x217ece,_0xc83c99){var _0x43f1f1=_0x27b4d1[_0xe80c('0x2a')]()===_0xe80c('0x34')?_0x17f422[_0xe80c('0x18')]:_0x17f422[_0xe80c('0x21')];var _0x3b6863={'method':_0xe80c('0x35'),'uri':_0x4a73e2+'incident'+'?'+_0xf001a4,'body':Object[_0xe80c('0x36')]({},{'active':_0xe80c('0x17'),'caller_id':_0x43f1f1,'assigned_to':_0x17f422['userId'],'short_description':intUtil[_0xe80c('0x37')](_0xff5941[_0xe80c('0x38')],_0x1cc152,'\x20'),'description':intUtil[_0xe80c('0x37')](_0xff5941[_0xe80c('0x39')],_0x1cc152,'\x0a')},getCustomFields(_0xff5941[_0xe80c('0x3a')],_0x1cc152)),'auth':_0x5a1d7b,'json':!![]};return rp(_0x3b6863)[_0xe80c('0x15')](function(_0x225f6b){logger['info']('['+[_0x27b4d1[_0xe80c('0xe')]()]+_0xe80c('0x3b'),_0x225f6b[_0xe80c('0x9')]);_0x17f422[_0xe80c('0x3c')]=_0x225f6b[_0xe80c('0x9')]['sys_id'];_0x17f422[_0xe80c('0x3d')]=_0x225f6b[_0xe80c('0x9')][_0xe80c('0x3e')];logger[_0xe80c('0xd')]('['+[_0x27b4d1[_0xe80c('0xe')]()]+']\x20getTicket\x20crm',_0x17f422);_0x217ece(_0x17f422);})[_0xe80c('0x10')](function(_0x192b7f){logger['error']('['+[_0x27b4d1['toUpperCase']()]+']',_0x192b7f[_0xe80c('0x12')]);_0xc83c99(_0x192b7f[_0xe80c('0x12')]);});});};}function createRemoteTag(_0x561956,_0x5088ef,_0x376cc4,_0x5ca9ef){return new Promise(function(_0x3b54f9,_0x1cfe5e){var _0x111c27={'method':'POST','uri':_0x376cc4+_0xe80c('0x3f')+'?'+_0x5ca9ef,'body':{'short_description':_0x561956,'global':!![],'active':!![],'name':_0x561956},'auth':_0x5088ef,'json':!![]};return rp(_0x111c27)['then'](function(_0x5a3b4a){var _0x4054ee=_0x5a3b4a[_0xe80c('0x9')][_0xe80c('0xc')];_0x3b54f9(_0x4054ee);});});}function getRemoteTag(_0xa54742,_0x3e4ce2,_0x2ddcd9,_0x305ed8,_0x42711e){return new Promise(function(_0x58a33f,_0x3ac690){var _0x12433a={'method':_0xe80c('0x8'),'uri':_0x2ddcd9+_0xe80c('0x3f')+_0xe80c('0x40')+_0xa54742+'&'+_0x305ed8,'auth':_0x3e4ce2,'json':!![]};return rp(_0x12433a)[_0xe80c('0x15')](function(_0x3614d0){if(_0x3614d0[_0xe80c('0x9')][_0xe80c('0xa')]>0x0){var _0x1a07cd=_0x3614d0[_0xe80c('0x9')][0x0][_0xe80c('0xc')];_0x58a33f(_0x1a07cd);}else{return createRemoteTag(_0xa54742,_0x3e4ce2,_0x2ddcd9,_0x305ed8)[_0xe80c('0x15')](function(_0x3be7f1){_0x58a33f(_0x3be7f1);});}});});}function assignTagToIncident(_0x28f7d4,_0x564545,_0x3de403,_0x4ca783,_0x47474a){return new Promise(function(_0x4b7036,_0x4c9aee){var _0x72211f={'method':'POST','uri':_0x3de403+_0xe80c('0x41')+'?'+_0x47474a,'body':{'label':_0x28f7d4,'table':_0xe80c('0x42'),'id_type':_0xe80c('0x43'),'table_key':_0x4ca783[_0xe80c('0x3c')],'title':_0xe80c('0x44')+_0x4ca783[_0xe80c('0x3d')],'id_display':_0x4ca783[_0xe80c('0x3d')]},'auth':_0x564545,'json':!![]};return rp(_0x72211f)[_0xe80c('0x15')](function(_0x57e7b6){_0x4b7036();})[_0xe80c('0x10')](function(){_0x4b7036();});});}function manageTags(_0x53ebf9,_0x4e7a8e,_0x329b6b,_0x2a7367,_0x332782,_0xc32171,_0x38b95f){return new Promise(function(_0xc71317,_0x13b623){var _0x4a920f=[];_0x4e7a8e['forEach'](function(_0x554401){_0x4a920f['push'](getRemoteTag(_0x554401,_0x329b6b,_0x2a7367,_0xc32171,_0x38b95f));});return Promise[_0xe80c('0x45')](_0x4a920f)['then'](function(_0x41d9df){if(_0x41d9df[_0xe80c('0xa')]){logger[_0xe80c('0xd')]('['+[_0x53ebf9[_0xe80c('0xe')]()]+_0xe80c('0x46'),_0x41d9df);var _0x100418=[];_0x41d9df[_0xe80c('0x26')](function(_0x4fb015){_0x100418[_0xe80c('0x47')](assignTagToIncident(_0x4fb015,_0x329b6b,_0x2a7367,_0x332782,_0xc32171));});return Promise[_0xe80c('0x45')](_0x100418)[_0xe80c('0x15')](function(){_0xc71317();})[_0xe80c('0x10')](function(){_0xc71317();});}else{_0xc71317();}});});}function getTags(_0x96aafd,_0x172b60,_0x4a6127,_0x5f303d,_0x4d44e0,_0x47dd62){return function(_0x3649cd){return new Promise(function(_0x1177c1,_0x4cfdb3){var _0x339047=[];var _0x26e941=_0x5f303d['Tags'];if(_0x26e941&&_0x26e941['length']>0x0){_0x339047=_[_0xe80c('0x48')](_0x26e941,'name');}if(_0x339047[_0xe80c('0xa')]>0x0){return manageTags(_0x96aafd,_0x339047,_0x172b60,_0x4a6127,_0x3649cd,_0x4d44e0,_0x47dd62)[_0xe80c('0x15')](function(){_0x1177c1(_0x3649cd);});}else{_0x1177c1(_0x3649cd);}});};}function emit(_0x595b99,_0x520866,_0x4cdc15){var _0x5cf2aa=_0xe80c('0x49')+_0xe80c('0x4a')+_0xe80c('0x4b')+_0xe80c('0x4c');var _0x4414be={'uri':_0x595b99+_0xe80c('0x4d')+_0x4cdc15+_0x5cf2aa};io['to'](util[_0xe80c('0x4e')](_0xe80c('0x4f'),_0x520866))[_0xe80c('0x50')]('trigger:browser:url',_0x4414be);}exports['cs']=function(_0xf56ad7,_0x183d9f,_0x3e3e32,_0x152e4c,_0x481e86,_0x40bec1,_0x26172b,_0x6de7f5){var _0x1260be={};var _0x584c65={'user':_0x40bec1[_0xe80c('0x51')],'pass':_0x40bec1[_0xe80c('0x52')]};var _0x586cd2=_0xe80c('0x53');var _0x4058f2=_0xe80c('0x54');_0x40bec1[_0xe80c('0x55')]=intUtil[_0xe80c('0x56')](_0x40bec1[_0xe80c('0x55')]);_0x40bec1[_0xe80c('0x57')]=intUtil[_0xe80c('0x56')](_0x40bec1[_0xe80c('0x57')]);var _0x3d6a14=util[_0xe80c('0x4e')](_0xe80c('0x58'),_0x40bec1['remoteUri']);_0x1260be[_0xe80c('0x13')]=!_[_0xe80c('0x59')](_0x152e4c)?_0x152e4c[_0xe80c('0x5a')]:null;_0x1260be[_0xe80c('0x19')]=_0x40bec1[_0xe80c('0x5a')];_0x1260be['endUserNumber']=_0x6de7f5[_0xe80c('0x2a')]()===_0xe80c('0x34')?_0x183d9f['destcalleridnum']:_0x183d9f[_0xe80c('0x5b')];_0x1260be['callDirection']=_0x6de7f5===_0xe80c('0x5c')||_0x6de7f5===_0xe80c('0x5d')?_0xe80c('0x5c'):'outbound';var _0x4f3c3d=util[_0xe80c('0x4e')](_0xe80c('0x5e'),_0x40bec1[_0xe80c('0x57')],_0x183d9f[_0xe80c('0x5f')],md5(_0x183d9f[_0xe80c('0x5f')]));if(_0x481e86&&_0x481e86[_0xe80c('0x60')]){logger[_0xe80c('0xd')](_0xe80c('0x61'),_0xe80c('0x62'));_0x183d9f[_0xe80c('0x63')]=_0x4f3c3d;}else if(_0x26172b&&_0x26172b[_0xe80c('0x64')]&&_0x26172b[_0xe80c('0x64')]!==_0xe80c('0x65')){logger[_0xe80c('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x183d9f[_0xe80c('0x63')]=_0x4f3c3d;}else{_0x183d9f['recordingURL']='';}return getAdminUser(_0x6de7f5,_0x584c65,_0x1260be,_0x3d6a14,_0x4058f2,_0x586cd2)[_0xe80c('0x15')](getUser(_0x6de7f5,_0x584c65,_0x3d6a14,_0x4058f2,_0x586cd2))[_0xe80c('0x15')](getEndUser(_0x6de7f5,_0x584c65,_0x3d6a14,_0x4058f2,_0x586cd2))[_0xe80c('0x15')](getTicket(_0x6de7f5,_0x584c65,_0x3d6a14,_0x3e3e32,_0x183d9f,_0x4058f2))[_0xe80c('0x15')](function(_0x281101){logger[_0xe80c('0xd')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x281101['ticketId']));logger['info'](util[_0xe80c('0x4e')](_0xe80c('0x66'),_0x6de7f5));if(_0x6de7f5!==_0xe80c('0x5d')){logger[_0xe80c('0xd')]('['+[_0x6de7f5[_0xe80c('0xe')]()]+']',_0xe80c('0x67'));emit(_0x40bec1[_0xe80c('0x55')],_0x152e4c['name'],_0x281101[_0xe80c('0x3c')]);}})[_0xe80c('0x10')](function(_0x3e103a){logger[_0xe80c('0x11')]('['+[_0x6de7f5[_0xe80c('0xe')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xe80c('0x68')](_0x3e103a,{'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 40c0080..d6cbaf7 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 _0xb8d9=['set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','customVariable','Variable','POST','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','isNil','Inbound','error','[ABANDONED]','lodash','request-promise','bluebird','md5','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','emit','info','getString','Subjects','Descriptions','date_start','toISOString','slice','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','idField'];(function(_0x21a6fe,_0xc4182f){var _0x27d257=function(_0x1417b5){while(--_0x1417b5){_0x21a6fe['push'](_0x21a6fe['shift']());}};_0x27d257(++_0xc4182f);}(_0xb8d9,0x146));var _0x9b8d=function(_0x58f915,_0x1cdc30){_0x58f915=_0x58f915-0x0;var _0x3002fe=_0xb8d9[_0x58f915];return _0x3002fe;};'use strict';var _=require(_0x9b8d('0x0'));var rp=require(_0x9b8d('0x1'));var BPromise=require(_0x9b8d('0x2'));var md5=require(_0x9b8d('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x9b8d('0x4'));var config=require(_0x9b8d('0x5'));var logger=require('../../../../config/logger')(_0x9b8d('0x6'));config[_0x9b8d('0x7')]=_[_0x9b8d('0x8')](config[_0x9b8d('0x7')],{'host':_0x9b8d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2bab1b,_0xa83bff,_0x47263b){io['to'](_0x2bab1b)[_0x9b8d('0xa')](_0xa83bff,_0x47263b);}function getTicket(_0x4d0441,_0x59ad64,_0x207b10,_0x5275df,_0x127a2b,_0x36082c,_0x370f50,_0x46486e){logger[_0x9b8d('0xb')]('Creating\x20new\x20ticket...');var _0x29eb23=new Date();var _0x4c2af2=[{'name':'name','value':intUtil[_0x9b8d('0xc')](_0x5275df[_0x9b8d('0xd')],_0x127a2b,'\x20')},{'name':'assigned_user_id','value':_0x59ad64['id']},{'name':'created_by','value':_0x59ad64['id']},{'name':'description','value':intUtil[_0x9b8d('0xc')](_0x5275df[_0x9b8d('0xe')],_0x127a2b,'\x0a')},{'name':_0x9b8d('0xf'),'value':_0x29eb23[_0x9b8d('0x10')]()[_0x9b8d('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x9b8d('0x12'),'value':_0x207b10['id']},{'name':_0x9b8d('0x13'),'value':_0x9b8d('0x14')},{'name':'parent_name','value':_0x207b10[_0x9b8d('0x15')]},{'name':_0x9b8d('0x16'),'value':_0x46486e}];if(_0x36082c[_0x9b8d('0x17')]){_[_0x9b8d('0x18')](_0x36082c,function(_0x4ad2a7){if(_0x127a2b[_0x4ad2a7[_0x9b8d('0x19')]]){_0x4c2af2[_0x9b8d('0x1a')]({'name':_0x4ad2a7[_0x9b8d('0x1b')],'value':_0x127a2b[_0x4ad2a7[_0x9b8d('0x19')]]});}});}return request({'form':{'method':_0x9b8d('0x1c'),'input_type':_0x9b8d('0x1d'),'response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0x370f50['id'],'module_name':_0x9b8d('0x1f'),'name_value_list':_0x4c2af2})}});}function getAuth(_0x1257f0){return util[_0x9b8d('0x20')](_0x9b8d('0x21'),new Buffer(_0x1257f0[_0x9b8d('0x22')]+':X')['toString'](_0x9b8d('0x23')));}function getServerInfo(_0x56a09a){return request({'form':{'method':_0x9b8d('0x24'),'input_type':_0x9b8d('0x1d'),'response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0x56a09a['id']})}});}function getUser(_0x222c48,_0x191745,_0x56a6b7){if(!_['isNil'](_0x191745)){logger['info'](_0x9b8d('0x25'),_0x191745);return request({'form':{'method':'get_entry_list','input_type':_0x9b8d('0x1d'),'response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0x56a6b7['id'],'module_name':'Employees','query':util['format'](_0x9b8d('0x26'),_0x191745),'order_by':'','offset':'0','select_fields':['id',_0x9b8d('0x15'),_0x9b8d('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xb234ce){if(_0xb234ce[_0x9b8d('0x28')][_0x9b8d('0x17')]){var _0x2a806a=_[_0x9b8d('0x29')](_0xb234ce[_0x9b8d('0x28')],function(_0x4f1c0b){return _0x4f1c0b['name_value_list'][_0x9b8d('0x27')][_0x9b8d('0x2a')]===_0x191745;});if(_0x2a806a){logger[_0x9b8d('0xb')](_0x9b8d('0x2b'));return BPromise[_0x9b8d('0x2c')]({'id':_0x2a806a[_0x9b8d('0x2d')]['id'][_0x9b8d('0x2a')],'name':_0x2a806a[_0x9b8d('0x2d')]['name'][_0x9b8d('0x2a')]});}}logger['info'](_0x9b8d('0x2e'));return BPromise[_0x9b8d('0x2c')]({'id':_0x56a6b7['name_value_list']['user_id']['value'],'name':_0x56a6b7[_0x9b8d('0x2d')]['user_name']['value']});});}else{logger['info'](_0x9b8d('0x2f'));return BPromise[_0x9b8d('0x2c')]({'id':_0x56a6b7['name_value_list'][_0x9b8d('0x30')][_0x9b8d('0x2a')],'name':_0x56a6b7[_0x9b8d('0x2d')][_0x9b8d('0x27')][_0x9b8d('0x2a')]});}}function getEndUser(_0x4ea435,_0x46e445,_0x2150ff,_0xdd3ee7){logger['info'](_0x9b8d('0x31'),_0x2150ff);return request({'form':{'method':'get_entry_list','input_type':_0x9b8d('0x1d'),'response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0xdd3ee7['id'],'module_name':'Contacts','query':util[_0x9b8d('0x20')](_0x9b8d('0x32'),_0x2150ff),'order_by':'','offset':'0','select_fields':['id',_0x9b8d('0x15'),_0x9b8d('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9b8d('0x34')](function(_0x5558e3){if(_0x5558e3[_0x9b8d('0x28')]['length']){var _0x597381=_[_0x9b8d('0x29')](_0x5558e3[_0x9b8d('0x28')],function(_0x7f379c){return _0x7f379c[_0x9b8d('0x2d')][_0x9b8d('0x33')][_0x9b8d('0x2a')]===_0x2150ff;});if(_0x597381){logger[_0x9b8d('0xb')](_0x9b8d('0x35'));return BPromise[_0x9b8d('0x2c')]({'id':_0x597381[_0x9b8d('0x2d')]['id'][_0x9b8d('0x2a')],'name':_0x597381[_0x9b8d('0x2d')][_0x9b8d('0x15')][_0x9b8d('0x2a')],'phone':_0x597381[_0x9b8d('0x2d')][_0x9b8d('0x33')][_0x9b8d('0x2a')]});}}else{logger[_0x9b8d('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x9b8d('0x1c'),'input_type':'JSON','response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0xdd3ee7['id'],'module_name':_0x9b8d('0x14'),'name_value_list':[{'name':_0x9b8d('0x36'),'value':_0x46e445!==_0x9b8d('0x37')?_0x46e445:util['format'](_0x9b8d('0x38'),_0x2150ff)},{'name':_0x9b8d('0x33'),'value':_0x2150ff}]})}})[_0x9b8d('0x34')](function(_0x1b5a1c){logger[_0x9b8d('0xb')](_0x9b8d('0x39'));return BPromise[_0x9b8d('0x2c')]({'id':_0x1b5a1c['id'],'name':_0x1b5a1c[_0x9b8d('0x28')][_0x9b8d('0x36')][_0x9b8d('0x2a')],'phone':_0x1b5a1c[_0x9b8d('0x28')][_0x9b8d('0x33')]['value']});});}});}function request(_0xb9d984){logger[_0x9b8d('0x3a')](_0x9b8d('0x3b'),JSON['stringify'](_0xb9d984));return rp(_[_0x9b8d('0x3c')](def,_0xb9d984));}function getTags(_0x187ba3,_0x407b2d){var _0x5556d2=[];if(_0x187ba3&&_0x187ba3[_0x9b8d('0x17')]>0x0){_0x5556d2=_[_0x9b8d('0x3d')](_0x187ba3,_0x407b2d);}return _0x5556d2;}function getCustomFields(_0x33c8a1,_0x2c1340){var _0xf48a59=[];var _0x43219f={'custom_fields':[]};if(_0x33c8a1[_0x9b8d('0x17')]>0x0){_[_0x9b8d('0x18')](_0x33c8a1,function(_0x3320f0){if(_0x3320f0[_0x9b8d('0x3e')]===_0x9b8d('0x3f')&&_0x3320f0[_0x9b8d('0x40')]&&!_0x3320f0[_0x9b8d('0x41')]){_0x43219f[_0x3320f0[_0x9b8d('0x40')][_0x9b8d('0x42')]()]=_0x3320f0[_0x9b8d('0x43')]['toString']();}else if(_0x3320f0[_0x9b8d('0x3e')]===_0x9b8d('0x3f')&&_0x3320f0[_0x9b8d('0x1b')]&&_0x3320f0[_0x9b8d('0x41')]){_0x43219f[_0x9b8d('0x44')][_0x9b8d('0x1a')]({'id':_0x3320f0[_0x9b8d('0x1b')],'value':_0x3320f0[_0x9b8d('0x43')][_0x9b8d('0x45')]()});}else if(_0x3320f0[_0x9b8d('0x3e')]==='variable'&&_0x3320f0[_0x9b8d('0x19')]&&_0x3320f0[_0x9b8d('0x1b')]&&_0x3320f0[_0x9b8d('0x41')]){_0x2c1340[_0x3320f0[_0x9b8d('0x19')]]&&_0x43219f[_0x9b8d('0x44')]['push']({'id':_0x3320f0[_0x9b8d('0x1b')],'value':_0x2c1340[_0x3320f0[_0x9b8d('0x19')]][_0x9b8d('0x45')]()});}else if(_0x3320f0[_0x9b8d('0x3e')]===_0x9b8d('0x46')&&_0x3320f0[_0x9b8d('0x47')]&&_0x3320f0['Variable']['name']&&_0x3320f0['idField']&&_0x3320f0['customField']){_0x2c1340[_0x3320f0[_0x9b8d('0x47')][_0x9b8d('0x15')]['toLowerCase']()]&&_0x43219f[_0x9b8d('0x44')][_0x9b8d('0x1a')]({'id':_0x3320f0[_0x9b8d('0x1b')],'value':_0x2c1340[_0x3320f0['Variable'][_0x9b8d('0x15')][_0x9b8d('0x42')]()][_0x9b8d('0x45')]()});}});}return _0x43219f;}function getConnection(_0x55c016){return request({'method':_0x9b8d('0x48'),'form':{'method':_0x9b8d('0x49'),'input_type':_0x9b8d('0x1d'),'response_type':_0x9b8d('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x55c016[_0x9b8d('0x4a')],'password':_0x55c016['password'],'encryption':'PLAIN'},'application':_0x9b8d('0x4b')})}})[_0x9b8d('0x34')](function(_0x247afb){var _0x5ea113=_0x247afb;if(_0x5ea113['id']){def[_0x9b8d('0x4c')]=_0x5ea113['id'];return BPromise[_0x9b8d('0x2c')](_0x5ea113);}else{throw new Error(util[_0x9b8d('0x20')](_0x9b8d('0x4d'),_0x55c016['id']));}});}function setRelationship(_0x5d342d,_0xbf874e,_0x2222dd,_0x4b7a99){return request({'form':{'method':_0x9b8d('0x4e'),'input_type':'JSON','response_type':_0x9b8d('0x1d'),'rest_data':JSON[_0x9b8d('0x1e')]({'session':_0x5d342d['id'],'module_name':'Calls','module_id':_0x2222dd['id'],'link_field_name':_0x4b7a99,'related_ids':[_0xbf874e['id']]})}});}exports[_0x9b8d('0x4f')]=function(_0x460080,_0x2c402e,_0x3526a4,_0x41343f,_0x4babe8,_0x3f18cc){var _0x2943a9,_0x5e4e47,_0x10306e,_0x127092;_0x3f18cc[_0x9b8d('0x50')]=intUtil[_0x9b8d('0x51')](_0x3f18cc[_0x9b8d('0x50')]);_0x3f18cc[_0x9b8d('0x52')]=intUtil[_0x9b8d('0x51')](_0x3f18cc[_0x9b8d('0x52')]);def['uri']=util[_0x9b8d('0x20')]('%s/service/v4_1/rest.php',_0x3f18cc[_0x9b8d('0x50')]);if(_0x4babe8&&_0x4babe8[_0x9b8d('0x53')]){logger[_0x9b8d('0xb')](_0x9b8d('0x54'),_0x9b8d('0x55'));_0x2c402e['recordingURL']=util[_0x9b8d('0x20')](_0x9b8d('0x56'),_0x3f18cc[_0x9b8d('0x52')],_0x2c402e[_0x9b8d('0x57')],md5(_0x2c402e['uniqueid']));}else{_0x2c402e[_0x9b8d('0x58')]='';}return getConnection(_0x3f18cc)['then'](function(_0x8c278c){_0x127092=_0x8c278c;return getUser(_0x3f18cc,_0x41343f[_0x9b8d('0x15')],_0x127092);})[_0x9b8d('0x34')](function(_0x2ce4b1){_0x2943a9=_0x2ce4b1;logger[_0x9b8d('0xb')](_0x9b8d('0x59'),_0x2943a9['id']);return getEndUser(_0x3f18cc,_0x2c402e[_0x9b8d('0x5a')],_0x2c402e[_0x9b8d('0x5b')],_0x127092);})['then'](function(_0x1e5857){_0x5e4e47=_0x1e5857;logger['info'](_0x9b8d('0x5c'),_0x5e4e47['id']);return getTicket(_0x3f18cc,_0x2943a9,_0x5e4e47,_0x3526a4,_0x2c402e,_0x3526a4[_0x9b8d('0x5d')],_0x127092,'Inbound');})[_0x9b8d('0x34')](function(_0x275887){_0x10306e=_0x275887;logger['info']('Ticket\x20created!');logger[_0x9b8d('0xb')]('The\x20Ticket\x20ID\x20is:',_0x10306e['id']);return setRelationship(_0x127092,_0x2943a9,_0x10306e,_0x9b8d('0x5e'));})[_0x9b8d('0x34')](function(){return setRelationship(_0x127092,_0x5e4e47,_0x10306e,_0x9b8d('0x5f'));})[_0x9b8d('0x34')](function(){return getServerInfo(_0x127092);})['then'](function(_0x2b44f7){var _0x198d46=parseInt(_0x2b44f7[_0x9b8d('0x60')][_0x9b8d('0x61')](0x0));var _0x116abe=util[_0x9b8d('0x20')](_0x9b8d('0x62'),_0x3f18cc['remoteUri'],_0x10306e['id']);if(_0x198d46>0x6){_0x116abe=util[_0x9b8d('0x20')](_0x9b8d('0x63'),_0x3f18cc[_0x9b8d('0x50')],_0x10306e['id']);}logger[_0x9b8d('0xb')](_0x9b8d('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9b8d('0x20')](_0x9b8d('0x64'),_0x41343f[_0x9b8d('0x15')]),_0x9b8d('0x65'),{'uri':_0x116abe});})[_0x9b8d('0x66')](function(_0x1e08a6){logger['error']('[QUEUE]',JSON['stringify'](_0x1e08a6));});};exports['outbound']=function(_0x5513f9,_0x5bde52,_0x5d006a,_0x11732d,_0x1c6618,_0x17ef4c,_0x5e73bd){var _0x102385,_0x136701,_0x3a60a6,_0x38ff3c;_0x17ef4c[_0x9b8d('0x50')]=intUtil['stripTrailingSlash'](_0x17ef4c[_0x9b8d('0x50')]);_0x17ef4c['serverUrl']=intUtil[_0x9b8d('0x51')](_0x17ef4c[_0x9b8d('0x52')]);def[_0x9b8d('0x67')]=util[_0x9b8d('0x20')](_0x9b8d('0x68'),_0x17ef4c[_0x9b8d('0x50')]);if(_0x5e73bd&&_0x5e73bd['recordingFormat']&&_0x5e73bd[_0x9b8d('0x69')]!==_0x9b8d('0x6a')){logger['info'](_0x9b8d('0x6b'),_0x9b8d('0x55'));_0x5bde52[_0x9b8d('0x58')]=util[_0x9b8d('0x20')](_0x9b8d('0x56'),_0x17ef4c[_0x9b8d('0x52')],_0x5bde52[_0x9b8d('0x57')],md5(_0x5bde52['uniqueid']));}return getConnection(_0x17ef4c)[_0x9b8d('0x34')](function(_0x28446e){_0x38ff3c=_0x28446e;return getUser(_0x17ef4c,_0x11732d[_0x9b8d('0x15')],_0x38ff3c);})[_0x9b8d('0x34')](function(_0x42072f){_0x102385=_0x42072f;logger[_0x9b8d('0xb')](_0x9b8d('0x59'),_0x102385['id']);return getEndUser(_0x17ef4c,_0x5bde52[_0x9b8d('0x6c')],_0x5bde52[_0x9b8d('0x6d')],_0x38ff3c);})[_0x9b8d('0x34')](function(_0x164e3f){_0x136701=_0x164e3f;logger[_0x9b8d('0xb')](_0x9b8d('0x5c'),_0x136701['id']);return getTicket(_0x17ef4c,_0x102385,_0x136701,_0x5d006a,_0x5bde52,_0x5d006a[_0x9b8d('0x5d')],_0x38ff3c,_0x9b8d('0x6e'));})['then'](function(_0x9773d4){_0x3a60a6=_0x9773d4;logger[_0x9b8d('0xb')](_0x9b8d('0x6f'));logger[_0x9b8d('0xb')](_0x9b8d('0x70'),_0x3a60a6['id']);return setRelationship(_0x38ff3c,_0x102385,_0x3a60a6,'users');})[_0x9b8d('0x34')](function(){return setRelationship(_0x38ff3c,_0x136701,_0x3a60a6,_0x9b8d('0x5f'));})[_0x9b8d('0x34')](function(){return getServerInfo(_0x38ff3c);})[_0x9b8d('0x34')](function(_0x1f3920){var _0x1fbd19=parseInt(_0x1f3920['version'][_0x9b8d('0x61')](0x0));var _0xad83d=util[_0x9b8d('0x20')](_0x9b8d('0x62'),_0x17ef4c[_0x9b8d('0x50')],_0x3a60a6['id']);if(_0x1fbd19>0x6){_0xad83d=util['format'](_0x9b8d('0x63'),_0x17ef4c[_0x9b8d('0x50')],_0x3a60a6['id']);}logger[_0x9b8d('0xb')](_0x9b8d('0x6b'),_0x9b8d('0x71'));emit(util['format'](_0x9b8d('0x64'),_0x11732d[_0x9b8d('0x15')]),_0x9b8d('0x65'),{'uri':_0xad83d});})[_0x9b8d('0x66')](function(_0xb0dd10){logger['error']('[OUTBOUND]',JSON[_0x9b8d('0x1e')](_0xb0dd10));});};exports['abandoned']=function(_0x45305e,_0x11d20d,_0x15a51f,_0xc20a9a,_0x300f72,_0x6457c6){var _0x547d92,_0x8fe6de,_0x439808,_0x56497a;_0x6457c6[_0x9b8d('0x50')]=intUtil[_0x9b8d('0x51')](_0x6457c6[_0x9b8d('0x50')]);_0x6457c6[_0x9b8d('0x52')]=intUtil['stripTrailingSlash'](_0x6457c6[_0x9b8d('0x52')]);def[_0x9b8d('0x67')]=util[_0x9b8d('0x20')]('%s/service/v4_1/rest.php',_0x6457c6[_0x9b8d('0x50')]);if(_0x300f72&&_0x300f72[_0x9b8d('0x53')]){logger[_0x9b8d('0xb')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x11d20d[_0x9b8d('0x58')]=util[_0x9b8d('0x20')](_0x9b8d('0x56'),_0x6457c6[_0x9b8d('0x52')],_0x11d20d[_0x9b8d('0x57')],md5(_0x11d20d[_0x9b8d('0x57')]));}else{_0x11d20d[_0x9b8d('0x58')]='';}return getConnection(_0x6457c6)['then'](function(_0xbf0013){_0x56497a=_0xbf0013;if(!_[_0x9b8d('0x72')](_0xc20a9a)){return getUser(_0x6457c6,_0xc20a9a[_0x9b8d('0x15')],_0x56497a);}else{return getUser(_0x6457c6,null,_0x56497a);}})[_0x9b8d('0x34')](function(_0x5eab52){_0x547d92=_0x5eab52;logger['info'](_0x9b8d('0x59'),_0x547d92['id']);return getEndUser(_0x6457c6,_0x11d20d['calleridname'],_0x11d20d[_0x9b8d('0x5b')],_0x56497a);})[_0x9b8d('0x34')](function(_0x396450){_0x8fe6de=_0x396450;logger[_0x9b8d('0xb')](_0x9b8d('0x5c'),_0x8fe6de['id']);return getTicket(_0x6457c6,_0x547d92,_0x8fe6de,_0x15a51f,_0x11d20d,_0x15a51f['Fields'],_0x56497a,_0x9b8d('0x73'));})[_0x9b8d('0x34')](function(_0x3022e0){_0x439808=_0x3022e0;logger['info'](_0x9b8d('0x6f'));logger['info'](_0x9b8d('0x70'),_0x439808['id']);return setRelationship(_0x56497a,_0x547d92,_0x439808,_0x9b8d('0x5e'));})['then'](function(){return setRelationship(_0x56497a,_0x8fe6de,_0x439808,_0x9b8d('0x5f'));})[_0x9b8d('0x34')](function(){return getServerInfo(_0x56497a);})['catch'](function(_0x247cd4){logger[_0x9b8d('0x74')](_0x9b8d('0x75'),JSON[_0x9b8d('0x1e')](_0x247cd4));});}; \ No newline at end of file +var _0xe8dd=['name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','Contacts','parent_name','direction','length','forEach','idField','variableName','JSON','stringify','Calls','Basic\x20%s','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','format','user_name','entry_list','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','then','debug','merge','type','string','nameField','toLowerCase','customField','custom_fields','push','content','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','version','abandoned','%s/service/v4_1/rest.php','monitor_format','[ABANDONED]','Inbound','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','Creating\x20new\x20ticket...'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe8dd,0x1d4));var _0xde8d=function(_0x3fc3a1,_0x4f9953){_0x3fc3a1=_0x3fc3a1-0x0;var _0x1de741=_0xe8dd[_0x3fc3a1];return _0x1de741;};'use strict';var _=require(_0xde8d('0x0'));var rp=require(_0xde8d('0x1'));var BPromise=require(_0xde8d('0x2'));var md5=require(_0xde8d('0x3'));var util=require('util');var Redis=require(_0xde8d('0x4'));var intUtil=require(_0xde8d('0x5'));var config=require(_0xde8d('0x6'));var logger=require(_0xde8d('0x7'))('sugarcrm');config[_0xde8d('0x8')]=_[_0xde8d('0x9')](config[_0xde8d('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde8d('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x4056b7,_0x436996,_0x342d30){io['to'](_0x4056b7)[_0xde8d('0xa')](_0x436996,_0x342d30);}function getTicket(_0x29ee48,_0xf6a60f,_0x3f28d9,_0x4cd07a,_0x3dd644,_0x3d0a99,_0x55f91c,_0x1f03d6){logger['info'](_0xde8d('0xb'));var _0x422237=new Date();var _0xa49473=[{'name':_0xde8d('0xc'),'value':intUtil[_0xde8d('0xd')](_0x4cd07a[_0xde8d('0xe')],_0x3dd644,'\x20')},{'name':'assigned_user_id','value':_0xf6a60f['id']},{'name':_0xde8d('0xf'),'value':_0xf6a60f['id']},{'name':_0xde8d('0x10'),'value':intUtil[_0xde8d('0xd')](_0x4cd07a[_0xde8d('0x11')],_0x3dd644,'\x0a')},{'name':_0xde8d('0x12'),'value':_0x422237[_0xde8d('0x13')]()[_0xde8d('0x14')](0x0,0x13)[_0xde8d('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xde8d('0x16'),'value':'15'},{'name':'parent_id','value':_0x3f28d9['id']},{'name':'parent_type','value':_0xde8d('0x17')},{'name':_0xde8d('0x18'),'value':_0x3f28d9[_0xde8d('0xc')]},{'name':_0xde8d('0x19'),'value':_0x1f03d6}];if(_0x3d0a99[_0xde8d('0x1a')]){_[_0xde8d('0x1b')](_0x3d0a99,function(_0xc164bc){if(_0x3dd644[_0xc164bc['variableName']]){_0xa49473['push']({'name':_0xc164bc[_0xde8d('0x1c')],'value':_0x3dd644[_0xc164bc[_0xde8d('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xde8d('0x1e'),'response_type':'JSON','rest_data':JSON[_0xde8d('0x1f')]({'session':_0x55f91c['id'],'module_name':_0xde8d('0x20'),'name_value_list':_0xa49473})}});}function getAuth(_0x4a7686){return util['format'](_0xde8d('0x21'),new Buffer(_0x4a7686['apiKey']+':X')[_0xde8d('0x22')](_0xde8d('0x23')));}function getServerInfo(_0xabc29f){return request({'form':{'method':_0xde8d('0x24'),'input_type':'JSON','response_type':_0xde8d('0x1e'),'rest_data':JSON[_0xde8d('0x1f')]({'session':_0xabc29f['id']})}});}function getUser(_0x469b7a,_0x558f9d,_0x4f5f45){if(!_[_0xde8d('0x25')](_0x558f9d)){logger[_0xde8d('0x26')](_0xde8d('0x27'),_0x558f9d);return request({'form':{'method':'get_entry_list','input_type':_0xde8d('0x1e'),'response_type':'JSON','rest_data':JSON[_0xde8d('0x1f')]({'session':_0x4f5f45['id'],'module_name':_0xde8d('0x28'),'query':util[_0xde8d('0x29')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x558f9d),'order_by':'','offset':'0','select_fields':['id',_0xde8d('0xc'),_0xde8d('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36ee9e){if(_0x36ee9e[_0xde8d('0x2b')][_0xde8d('0x1a')]){var _0x21d818=_['find'](_0x36ee9e[_0xde8d('0x2b')],function(_0x470c60){return _0x470c60['name_value_list']['user_name'][_0xde8d('0x2c')]===_0x558f9d;});if(_0x21d818){logger[_0xde8d('0x26')](_0xde8d('0x2d'));return BPromise[_0xde8d('0x2e')]({'id':_0x21d818['name_value_list']['id'][_0xde8d('0x2c')],'name':_0x21d818['name_value_list'][_0xde8d('0xc')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xde8d('0x2e')]({'id':_0x4f5f45[_0xde8d('0x2f')][_0xde8d('0x30')][_0xde8d('0x2c')],'name':_0x4f5f45[_0xde8d('0x2f')][_0xde8d('0x2a')][_0xde8d('0x2c')]});});}else{logger['info'](_0xde8d('0x31'));return BPromise[_0xde8d('0x2e')]({'id':_0x4f5f45[_0xde8d('0x2f')][_0xde8d('0x30')]['value'],'name':_0x4f5f45['name_value_list'][_0xde8d('0x2a')]['value']});}}function getEndUser(_0x37c943,_0x6e0cda,_0x4756c8,_0x4804f4){logger[_0xde8d('0x26')](_0xde8d('0x32'),_0x4756c8);return request({'form':{'method':_0xde8d('0x33'),'input_type':_0xde8d('0x1e'),'response_type':'JSON','rest_data':JSON[_0xde8d('0x1f')]({'session':_0x4804f4['id'],'module_name':_0xde8d('0x17'),'query':util[_0xde8d('0x29')](_0xde8d('0x34'),_0x4756c8),'order_by':'','offset':'0','select_fields':['id','name',_0xde8d('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x39f5c8){if(_0x39f5c8[_0xde8d('0x2b')][_0xde8d('0x1a')]){var _0x542012=_[_0xde8d('0x36')](_0x39f5c8[_0xde8d('0x2b')],function(_0x3ebea6){return _0x3ebea6['name_value_list'][_0xde8d('0x35')][_0xde8d('0x2c')]===_0x4756c8;});if(_0x542012){logger[_0xde8d('0x26')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x542012[_0xde8d('0x2f')]['id']['value'],'name':_0x542012[_0xde8d('0x2f')]['name'][_0xde8d('0x2c')],'phone':_0x542012[_0xde8d('0x2f')][_0xde8d('0x35')][_0xde8d('0x2c')]});}}else{logger[_0xde8d('0x26')](_0xde8d('0x37'));return request({'form':{'method':'set_entry','input_type':_0xde8d('0x1e'),'response_type':_0xde8d('0x1e'),'rest_data':JSON[_0xde8d('0x1f')]({'session':_0x4804f4['id'],'module_name':'Contacts','name_value_list':[{'name':_0xde8d('0x38'),'value':_0x6e0cda!==_0xde8d('0x39')?_0x6e0cda:util[_0xde8d('0x29')]('Caller\x20-\x20%s',_0x4756c8)},{'name':_0xde8d('0x35'),'value':_0x4756c8}]})}})[_0xde8d('0x3a')](function(_0x58616d){logger[_0xde8d('0x26')]('Enduser\x20created.');return BPromise[_0xde8d('0x2e')]({'id':_0x58616d['id'],'name':_0x58616d[_0xde8d('0x2b')][_0xde8d('0x38')][_0xde8d('0x2c')],'phone':_0x58616d[_0xde8d('0x2b')][_0xde8d('0x35')][_0xde8d('0x2c')]});});}});}function request(_0x3e2086){logger[_0xde8d('0x3b')]('[HTTP]',JSON[_0xde8d('0x1f')](_0x3e2086));return rp(_[_0xde8d('0x3c')](def,_0x3e2086));}function getTags(_0x32b1c2,_0x2de521){var _0x500300=[];if(_0x32b1c2&&_0x32b1c2['length']>0x0){_0x500300=_['map'](_0x32b1c2,_0x2de521);}return _0x500300;}function getCustomFields(_0x588898,_0x354bb0){var _0x248a5f=[];var _0x54b39b={'custom_fields':[]};if(_0x588898[_0xde8d('0x1a')]>0x0){_[_0xde8d('0x1b')](_0x588898,function(_0x167c2a){if(_0x167c2a[_0xde8d('0x3d')]===_0xde8d('0x3e')&&_0x167c2a[_0xde8d('0x3f')]&&!_0x167c2a['customField']){_0x54b39b[_0x167c2a[_0xde8d('0x3f')][_0xde8d('0x40')]()]=_0x167c2a['content'][_0xde8d('0x22')]();}else if(_0x167c2a[_0xde8d('0x3d')]===_0xde8d('0x3e')&&_0x167c2a[_0xde8d('0x1c')]&&_0x167c2a[_0xde8d('0x41')]){_0x54b39b[_0xde8d('0x42')][_0xde8d('0x43')]({'id':_0x167c2a[_0xde8d('0x1c')],'value':_0x167c2a[_0xde8d('0x44')][_0xde8d('0x22')]()});}else if(_0x167c2a['type']===_0xde8d('0x45')&&_0x167c2a[_0xde8d('0x1d')]&&_0x167c2a['idField']&&_0x167c2a['customField']){_0x354bb0[_0x167c2a[_0xde8d('0x1d')]]&&_0x54b39b[_0xde8d('0x42')][_0xde8d('0x43')]({'id':_0x167c2a['idField'],'value':_0x354bb0[_0x167c2a['variableName']][_0xde8d('0x22')]()});}else if(_0x167c2a[_0xde8d('0x3d')]===_0xde8d('0x46')&&_0x167c2a['Variable']&&_0x167c2a['Variable'][_0xde8d('0xc')]&&_0x167c2a[_0xde8d('0x1c')]&&_0x167c2a[_0xde8d('0x41')]){_0x354bb0[_0x167c2a[_0xde8d('0x47')]['name'][_0xde8d('0x40')]()]&&_0x54b39b[_0xde8d('0x42')][_0xde8d('0x43')]({'id':_0x167c2a[_0xde8d('0x1c')],'value':_0x354bb0[_0x167c2a['Variable'][_0xde8d('0xc')]['toLowerCase']()][_0xde8d('0x22')]()});}});}return _0x54b39b;}function getConnection(_0xde651){return request({'method':_0xde8d('0x48'),'form':{'method':_0xde8d('0x49'),'input_type':'JSON','response_type':_0xde8d('0x1e'),'rest_data':JSON[_0xde8d('0x1f')]({'user_auth':{'user_name':_0xde651[_0xde8d('0x4a')],'password':_0xde651[_0xde8d('0x4b')],'encryption':_0xde8d('0x4c')},'application':_0xde8d('0x4d')})}})[_0xde8d('0x3a')](function(_0x340239){var _0x2dca42=_0x340239;if(_0x2dca42['id']){def['sessionID']=_0x2dca42['id'];return BPromise[_0xde8d('0x2e')](_0x2dca42);}else{throw new Error(util[_0xde8d('0x29')](_0xde8d('0x4e'),_0xde651['id']));}});}function setRelationship(_0x361b6b,_0x351aa7,_0x35f254,_0xd7d798){return request({'form':{'method':_0xde8d('0x4f'),'input_type':'JSON','response_type':_0xde8d('0x1e'),'rest_data':JSON[_0xde8d('0x1f')]({'session':_0x361b6b['id'],'module_name':_0xde8d('0x20'),'module_id':_0x35f254['id'],'link_field_name':_0xd7d798,'related_ids':[_0x351aa7['id']]})}});}exports[_0xde8d('0x50')]=function(_0x39c582,_0x44aa84,_0x354962,_0x3dfd04,_0x235333,_0x358b4b){var _0x2edb36,_0x1f4deb,_0x1a829a,_0x3bd958;_0x358b4b[_0xde8d('0x51')]=intUtil['stripTrailingSlash'](_0x358b4b[_0xde8d('0x51')]);_0x358b4b[_0xde8d('0x52')]=intUtil[_0xde8d('0x53')](_0x358b4b[_0xde8d('0x52')]);def[_0xde8d('0x54')]=util[_0xde8d('0x29')]('%s/service/v4_1/rest.php',_0x358b4b[_0xde8d('0x51')]);if(_0x235333&&_0x235333['monitor_format']){logger['info'](_0xde8d('0x55'),_0xde8d('0x56'));_0x44aa84[_0xde8d('0x57')]=util['format'](_0xde8d('0x58'),_0x358b4b['serverUrl'],_0x44aa84[_0xde8d('0x59')],md5(_0x44aa84[_0xde8d('0x59')]));}else{_0x44aa84[_0xde8d('0x57')]='';}return getConnection(_0x358b4b)['then'](function(_0x42ea03){_0x3bd958=_0x42ea03;return getUser(_0x358b4b,_0x3dfd04[_0xde8d('0xc')],_0x3bd958);})[_0xde8d('0x3a')](function(_0x32d0ad){_0x2edb36=_0x32d0ad;logger[_0xde8d('0x26')](_0xde8d('0x5a'),_0x2edb36['id']);return getEndUser(_0x358b4b,_0x44aa84[_0xde8d('0x5b')],_0x44aa84[_0xde8d('0x5c')],_0x3bd958);})[_0xde8d('0x3a')](function(_0x2686b6){_0x1f4deb=_0x2686b6;logger[_0xde8d('0x26')](_0xde8d('0x5d'),_0x1f4deb['id']);return getTicket(_0x358b4b,_0x2edb36,_0x1f4deb,_0x354962,_0x44aa84,_0x354962[_0xde8d('0x5e')],_0x3bd958,'Inbound');})[_0xde8d('0x3a')](function(_0x5d3a82){_0x1a829a=_0x5d3a82;logger[_0xde8d('0x26')](_0xde8d('0x5f'));logger[_0xde8d('0x26')](_0xde8d('0x60'),_0x1a829a['id']);return setRelationship(_0x3bd958,_0x2edb36,_0x1a829a,_0xde8d('0x61'));})[_0xde8d('0x3a')](function(){return setRelationship(_0x3bd958,_0x1f4deb,_0x1a829a,_0xde8d('0x62'));})['then'](function(){return getServerInfo(_0x3bd958);})['then'](function(_0x25a5b9){var _0xcb73d7=parseInt(_0x25a5b9['version'][_0xde8d('0x63')](0x0));var _0x148056=util[_0xde8d('0x29')](_0xde8d('0x64'),_0x358b4b[_0xde8d('0x51')],_0x1a829a['id']);if(_0xcb73d7>0x6){_0x148056=util[_0xde8d('0x29')](_0xde8d('0x65'),_0x358b4b[_0xde8d('0x51')],_0x1a829a['id']);}logger[_0xde8d('0x26')](_0xde8d('0x55'),_0xde8d('0x66'));emit(util['format'](_0xde8d('0x67'),_0x3dfd04[_0xde8d('0xc')]),_0xde8d('0x68'),{'uri':_0x148056});})[_0xde8d('0x69')](function(_0xfe0f65){logger[_0xde8d('0x6a')]('[QUEUE]',JSON[_0xde8d('0x1f')](_0xfe0f65));});};exports[_0xde8d('0x6b')]=function(_0xd05e44,_0x561460,_0x518fb8,_0x307de9,_0x15a45d,_0x40314b,_0x5cc22c){var _0x5a7c00,_0x692b8d,_0x559737,_0x37510f;_0x40314b['remoteUri']=intUtil[_0xde8d('0x53')](_0x40314b['remoteUri']);_0x40314b[_0xde8d('0x52')]=intUtil[_0xde8d('0x53')](_0x40314b[_0xde8d('0x52')]);def[_0xde8d('0x54')]=util['format']('%s/service/v4_1/rest.php',_0x40314b['remoteUri']);if(_0x5cc22c&&_0x5cc22c[_0xde8d('0x6c')]&&_0x5cc22c[_0xde8d('0x6c')]!==_0xde8d('0x6d')){logger[_0xde8d('0x26')](_0xde8d('0x6e'),_0xde8d('0x56'));_0x561460['recordingURL']=util[_0xde8d('0x29')](_0xde8d('0x58'),_0x40314b['serverUrl'],_0x561460[_0xde8d('0x59')],md5(_0x561460[_0xde8d('0x59')]));}return getConnection(_0x40314b)[_0xde8d('0x3a')](function(_0xcb8a3e){_0x37510f=_0xcb8a3e;return getUser(_0x40314b,_0x307de9[_0xde8d('0xc')],_0x37510f);})[_0xde8d('0x3a')](function(_0x4893bc){_0x5a7c00=_0x4893bc;logger[_0xde8d('0x26')](_0xde8d('0x5a'),_0x5a7c00['id']);return getEndUser(_0x40314b,_0x561460[_0xde8d('0x6f')],_0x561460[_0xde8d('0x70')],_0x37510f);})['then'](function(_0x2ad8be){_0x692b8d=_0x2ad8be;logger['info'](_0xde8d('0x5d'),_0x692b8d['id']);return getTicket(_0x40314b,_0x5a7c00,_0x692b8d,_0x518fb8,_0x561460,_0x518fb8[_0xde8d('0x5e')],_0x37510f,_0xde8d('0x71'));})[_0xde8d('0x3a')](function(_0x494c9b){_0x559737=_0x494c9b;logger[_0xde8d('0x26')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x559737['id']);return setRelationship(_0x37510f,_0x5a7c00,_0x559737,_0xde8d('0x61'));})[_0xde8d('0x3a')](function(){return setRelationship(_0x37510f,_0x692b8d,_0x559737,'contacts');})['then'](function(){return getServerInfo(_0x37510f);})[_0xde8d('0x3a')](function(_0xf38a9e){var _0x3277f0=parseInt(_0xf38a9e[_0xde8d('0x72')][_0xde8d('0x63')](0x0));var _0xe2a3d0=util[_0xde8d('0x29')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x40314b[_0xde8d('0x51')],_0x559737['id']);if(_0x3277f0>0x6){_0xe2a3d0=util[_0xde8d('0x29')](_0xde8d('0x65'),_0x40314b['remoteUri'],_0x559737['id']);}logger[_0xde8d('0x26')](_0xde8d('0x6e'),_0xde8d('0x66'));emit(util[_0xde8d('0x29')](_0xde8d('0x67'),_0x307de9[_0xde8d('0xc')]),_0xde8d('0x68'),{'uri':_0xe2a3d0});})[_0xde8d('0x69')](function(_0x5e6d8a){logger[_0xde8d('0x6a')]('[OUTBOUND]',JSON[_0xde8d('0x1f')](_0x5e6d8a));});};exports[_0xde8d('0x73')]=function(_0x18daa0,_0x5330e0,_0x10f006,_0x559a0b,_0x3c0bfd,_0x5b61eb){var _0x3410ef,_0x3604ec,_0x4ea66c,_0x14fdbb;_0x5b61eb[_0xde8d('0x51')]=intUtil['stripTrailingSlash'](_0x5b61eb[_0xde8d('0x51')]);_0x5b61eb['serverUrl']=intUtil[_0xde8d('0x53')](_0x5b61eb[_0xde8d('0x52')]);def['uri']=util[_0xde8d('0x29')](_0xde8d('0x74'),_0x5b61eb[_0xde8d('0x51')]);if(_0x3c0bfd&&_0x3c0bfd[_0xde8d('0x75')]){logger[_0xde8d('0x26')](_0xde8d('0x76'),_0xde8d('0x56'));_0x5330e0['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b61eb[_0xde8d('0x52')],_0x5330e0['uniqueid'],md5(_0x5330e0[_0xde8d('0x59')]));}else{_0x5330e0[_0xde8d('0x57')]='';}return getConnection(_0x5b61eb)[_0xde8d('0x3a')](function(_0x443d60){_0x14fdbb=_0x443d60;if(!_['isNil'](_0x559a0b)){return getUser(_0x5b61eb,_0x559a0b['name'],_0x14fdbb);}else{return getUser(_0x5b61eb,null,_0x14fdbb);}})['then'](function(_0x37c240){_0x3410ef=_0x37c240;logger[_0xde8d('0x26')](_0xde8d('0x5a'),_0x3410ef['id']);return getEndUser(_0x5b61eb,_0x5330e0[_0xde8d('0x5b')],_0x5330e0[_0xde8d('0x5c')],_0x14fdbb);})['then'](function(_0x50d852){_0x3604ec=_0x50d852;logger[_0xde8d('0x26')](_0xde8d('0x5d'),_0x3604ec['id']);return getTicket(_0x5b61eb,_0x3410ef,_0x3604ec,_0x10f006,_0x5330e0,_0x10f006[_0xde8d('0x5e')],_0x14fdbb,_0xde8d('0x77'));})[_0xde8d('0x3a')](function(_0x54d4d5){_0x4ea66c=_0x54d4d5;logger['info'](_0xde8d('0x5f'));logger[_0xde8d('0x26')]('The\x20Ticket\x20ID\x20is:',_0x4ea66c['id']);return setRelationship(_0x14fdbb,_0x3410ef,_0x4ea66c,_0xde8d('0x61'));})[_0xde8d('0x3a')](function(){return setRelationship(_0x14fdbb,_0x3604ec,_0x4ea66c,_0xde8d('0x62'));})[_0xde8d('0x3a')](function(){return getServerInfo(_0x14fdbb);})[_0xde8d('0x69')](function(_0x22b826){logger[_0xde8d('0x6a')](_0xde8d('0x76'),JSON['stringify'](_0x22b826));});}; \ 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 60e4bb3..d00fb53 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 _0xe96a=['variable','variableName','customVariable','Variable','name','toLowerCase','keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','push','content'];(function(_0x292eb9,_0x3a6170){var _0x343644=function(_0x149fe9){while(--_0x149fe9){_0x292eb9['push'](_0x292eb9['shift']());}};_0x343644(++_0x3a6170);}(_0xe96a,0x199));var _0xae96=function(_0x31e11b,_0x22bd4e){_0x31e11b=_0x31e11b-0x0;var _0x1b415a=_0xe96a[_0x31e11b];return _0x1b415a;};'use strict';var _=require(_0xae96('0x0'));var util=require(_0xae96('0x1'));exports[_0xae96('0x2')]=function(_0x123131,_0x118409,_0x15750c){var _0xea7181=[];if(_0x123131[_0xae96('0x3')]>0x0){var _0x4038ae=_['sortBy'](_0x123131,['id']);for(var _0x9d10e3=0x0;_0x9d10e3<_0x4038ae[_0xae96('0x3')];_0x9d10e3++){var _0x12f940=_0x4038ae[_0x9d10e3];if(_0x12f940[_0xae96('0x4')]==='string'){_0xea7181[_0xae96('0x5')](_0x12f940[_0xae96('0x6')]);}else if(_0x12f940[_0xae96('0x4')]===_0xae96('0x7')&&_0x12f940[_0xae96('0x8')]){_0x118409[_0x12f940[_0xae96('0x8')]]&&_0xea7181['push'](_0x118409[_0x12f940[_0xae96('0x8')]]['toString']());}else if(_0x12f940[_0xae96('0x4')]===_0xae96('0x9')&&_0x12f940[_0xae96('0xa')]&&_0x12f940[_0xae96('0xa')][_0xae96('0xb')]){_0x118409[_0x12f940['Variable'][_0xae96('0xb')]['toLowerCase']()]&&_0xea7181[_0xae96('0x5')](_0x118409[_0x12f940[_0xae96('0xa')][_0xae96('0xb')][_0xae96('0xc')]()]['toString']());}else if(_0x12f940['type']==='keyValue'){if(_0x12f940[_0xae96('0xd')]===_0xae96('0xe')&&_0x12f940[_0xae96('0xf')]){_0xea7181[_0xae96('0x5')](util[_0xae96('0x10')](_0xae96('0x11'),_0x12f940['key'],_0x12f940[_0xae96('0x12')]));}else if(_0x12f940[_0xae96('0xd')]===_0xae96('0x7')&&_0x12f940[_0xae96('0x8')]&&_0x12f940[_0xae96('0xf')]){_0x118409[_0x12f940['variableName']]&&_0xea7181[_0xae96('0x5')](util[_0xae96('0x10')](_0xae96('0x11'),_0x12f940[_0xae96('0xf')],_0x118409[_0x12f940[_0xae96('0x8')]]));}else if(_0x12f940[_0xae96('0xd')]===_0xae96('0x9')&&_0x12f940[_0xae96('0xa')]&&_0x12f940[_0xae96('0xa')][_0xae96('0xb')]&&_0x12f940[_0xae96('0xf')]){_0x118409[_0x12f940[_0xae96('0xa')][_0xae96('0xb')]['toLowerCase']()]&&_0xea7181[_0xae96('0x5')](util[_0xae96('0x10')](_0xae96('0x11'),_0x12f940[_0xae96('0xf')],_0x118409[_0x12f940[_0xae96('0xa')][_0xae96('0xb')][_0xae96('0xc')]()]));}}}}return _0xea7181[_0xae96('0x13')](_0x15750c);};exports[_0xae96('0x14')]=function(_0x575864){var _0x35cd51=_0x575864[_0xae96('0x15')](-0x1);if(_0x35cd51==='/'){_0x575864=_0x575864['substring'](0x0,_0x575864[_0xae96('0x16')](_0x35cd51));}return _0x575864;};exports[_0xae96('0x17')]=function(_0x37423b){if(!_[_0xae96('0x18')](_0x37423b)&&_0x37423b!==''){var _0x1b4fb0=/^(([^<>()\[\]\\.,;:\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 _0x1b4fb0[_0xae96('0x19')](String(_0x37423b)[_0xae96('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x4e1e=['customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e1e,0x1cb));var _0xe4e1=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x4e1e[_0x16dbfd];return _0x382254;};'use strict';var _=require(_0xe4e1('0x0'));var util=require(_0xe4e1('0x1'));exports[_0xe4e1('0x2')]=function(_0x571980,_0xd42609,_0x4bf4f1){var _0x200c42=[];if(_0x571980[_0xe4e1('0x3')]>0x0){var _0x2b8b10=_[_0xe4e1('0x4')](_0x571980,['id']);for(var _0x1ba396=0x0;_0x1ba396<_0x2b8b10[_0xe4e1('0x3')];_0x1ba396++){var _0x3c9f9c=_0x2b8b10[_0x1ba396];if(_0x3c9f9c[_0xe4e1('0x5')]===_0xe4e1('0x6')){_0x200c42[_0xe4e1('0x7')](_0x3c9f9c[_0xe4e1('0x8')]);}else if(_0x3c9f9c['type']===_0xe4e1('0x9')&&_0x3c9f9c[_0xe4e1('0xa')]){_0xd42609[_0x3c9f9c[_0xe4e1('0xa')]]&&_0x200c42[_0xe4e1('0x7')](_0xd42609[_0x3c9f9c[_0xe4e1('0xa')]][_0xe4e1('0xb')]());}else if(_0x3c9f9c[_0xe4e1('0x5')]==='customVariable'&&_0x3c9f9c[_0xe4e1('0xc')]&&_0x3c9f9c['Variable'][_0xe4e1('0xd')]){_0xd42609[_0x3c9f9c[_0xe4e1('0xc')]['name'][_0xe4e1('0xe')]()]&&_0x200c42[_0xe4e1('0x7')](_0xd42609[_0x3c9f9c['Variable'][_0xe4e1('0xd')][_0xe4e1('0xe')]()]['toString']());}else if(_0x3c9f9c[_0xe4e1('0x5')]===_0xe4e1('0xf')){if(_0x3c9f9c[_0xe4e1('0x10')]===_0xe4e1('0x6')&&_0x3c9f9c['key']){_0x200c42[_0xe4e1('0x7')](util[_0xe4e1('0x11')](_0xe4e1('0x12'),_0x3c9f9c[_0xe4e1('0x13')],_0x3c9f9c[_0xe4e1('0x14')]));}else if(_0x3c9f9c[_0xe4e1('0x10')]===_0xe4e1('0x9')&&_0x3c9f9c['variableName']&&_0x3c9f9c['key']){_0xd42609[_0x3c9f9c[_0xe4e1('0xa')]]&&_0x200c42[_0xe4e1('0x7')](util[_0xe4e1('0x11')](_0xe4e1('0x12'),_0x3c9f9c['key'],_0xd42609[_0x3c9f9c[_0xe4e1('0xa')]]));}else if(_0x3c9f9c['keyType']===_0xe4e1('0x15')&&_0x3c9f9c[_0xe4e1('0xc')]&&_0x3c9f9c[_0xe4e1('0xc')][_0xe4e1('0xd')]&&_0x3c9f9c[_0xe4e1('0x13')]){_0xd42609[_0x3c9f9c[_0xe4e1('0xc')][_0xe4e1('0xd')][_0xe4e1('0xe')]()]&&_0x200c42[_0xe4e1('0x7')](util['format']('%s:\x20%s',_0x3c9f9c[_0xe4e1('0x13')],_0xd42609[_0x3c9f9c[_0xe4e1('0xc')][_0xe4e1('0xd')][_0xe4e1('0xe')]()]));}}}}return _0x200c42[_0xe4e1('0x16')](_0x4bf4f1);};exports[_0xe4e1('0x17')]=function(_0x4021c6){var _0x348cf6=_0x4021c6[_0xe4e1('0x18')](-0x1);if(_0x348cf6==='/'){_0x4021c6=_0x4021c6[_0xe4e1('0x19')](0x0,_0x4021c6[_0xe4e1('0x1a')](_0x348cf6));}return _0x4021c6;};exports[_0xe4e1('0x1b')]=function(_0x1d1fd2){if(!_[_0xe4e1('0x1c')](_0x1d1fd2)&&_0x1d1fd2!==''){var _0x2bc123=/^(([^<>()\[\]\\.,;:\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 _0x2bc123[_0xe4e1('0x1d')](String(_0x1d1fd2)[_0xe4e1('0xe')]());}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 5afbf0f..a47527b 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 _0x9c02=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','[QUEUE]','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','trigger:browser:url','abandoned','[ABANDONED]','The\x20User\x20ID\x20is:','calleridname','lodash','request-promise','bluebird','../../../../config/environment','vTiger','defaults','localhost','socket.io-emitter','redis','emit','string','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Descriptions','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','createTicket','validateEmail','%s/webservice.php','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','success','length','info','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','getEndUser','accessKey','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0x9c02,0x196));var _0x29c0=function(_0xfc7aee,_0x4aa4ee){_0xfc7aee=_0xfc7aee-0x0;var _0x5378e9=_0x9c02[_0xfc7aee];return _0x5378e9;};'use strict';var _=require(_0x29c0('0x0'));var rp=require(_0x29c0('0x1'));var BPromise=require(_0x29c0('0x2'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x29c0('0x3'));var logger=require('../../../../config/logger')(_0x29c0('0x4'));config['redis']=_[_0x29c0('0x5')](config['redis'],{'host':_0x29c0('0x6'),'port':0x18eb});var io=require(_0x29c0('0x7'))(new Redis(config[_0x29c0('0x8')]));function emit(_0x5beeb6,_0x58fa3e,_0x18c44c){io['to'](_0x5beeb6)[_0x29c0('0x9')](_0x58fa3e,_0x18c44c);}function getCustomFields(_0xac5319,_0x2e83cb){var _0x27d0da={};if(_0xac5319['length']>0x0){_['forEach'](_0xac5319,function(_0x16ba59){if(_0x16ba59['type']===_0x29c0('0xa')&&_0x16ba59[_0x29c0('0xb')]){_0x27d0da[_0x16ba59[_0x29c0('0xb')]]=_0x16ba59[_0x29c0('0xc')][_0x29c0('0xd')]();}else if(_0x16ba59[_0x29c0('0xe')]==='variable'&&_0x16ba59[_0x29c0('0xf')]&&_0x16ba59[_0x29c0('0xb')]&&_0x2e83cb[_0x16ba59[_0x29c0('0xf')]]){_0x27d0da[_0x16ba59[_0x29c0('0xb')]]=_0x2e83cb[_0x16ba59[_0x29c0('0xf')]][_0x29c0('0xd')]();}else if(_0x16ba59[_0x29c0('0xe')]===_0x29c0('0x10')&&_0x16ba59[_0x29c0('0x11')]&&_0x16ba59[_0x29c0('0x11')][_0x29c0('0x12')]&&_0x16ba59[_0x29c0('0xb')]&&_0x2e83cb[_0x16ba59[_0x29c0('0x11')][_0x29c0('0x12')][_0x29c0('0x13')]()]){_0x27d0da[_0x16ba59[_0x29c0('0xb')]]=_0x2e83cb[_0x16ba59[_0x29c0('0x11')][_0x29c0('0x12')][_0x29c0('0x13')]()][_0x29c0('0xd')]();}});}return _0x27d0da;}function createTicket(_0x627c4c,_0x281597,_0x2bfa71,_0x429b88,_0x1bbfc5,_0x10e52c,_0x311c9b){logger['info'](_0x29c0('0x14'));var _0x6e3271=_[_0x29c0('0x15')]({'parent_id':'','assigned_user_id':_0x281597['id'],'ticketpriorities':_0x29c0('0x16'),'ticketstatus':_0x29c0('0x17'),'ticket_title':intUtil[_0x29c0('0x18')](_0x429b88['Subjects'],_0x1bbfc5,'\x20'),'description':intUtil[_0x29c0('0x18')](_0x429b88[_0x29c0('0x19')],_0x1bbfc5,'\x0a'),'contact_id':_0x2bfa71['id']},getCustomFields(_0x10e52c,_0x1bbfc5));var _0x45a6cb={'method':_0x29c0('0x1a'),'uri':util[_0x29c0('0x1b')]('%s/webservice.php',_0x627c4c[_0x29c0('0x1c')]),'form':{'operation':_0x29c0('0x1d'),'username':'admin','sessionName':_0x311c9b[_0x29c0('0x1e')],'elementType':_0x29c0('0x1f'),'element':JSON[_0x29c0('0x20')](_0x6e3271)},'json':!![]};return request(_0x45a6cb)['then'](function(_0x1993a5){if(_0x1993a5['success']){return BPromise[_0x29c0('0x21')]({'id':_0x1993a5[_0x29c0('0x22')]['id']});}else{throw new Error(util['format'](_0x29c0('0x23'),JSON[_0x29c0('0x20')](_0x1993a5[_0x29c0('0x24')])));}})[_0x29c0('0x25')](function(_0x2cb718){var _0x46be76=_0x2cb718['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x29c0('0x26'),_0x46be76,JSON[_0x29c0('0x20')](_0x2cb718));});}function getUser(_0x4cdf7c,_0x4aa6bd,_0x208a5d){if(intUtil[_0x29c0('0x27')](_0x4aa6bd)){logger['info']('Getting\x20agent\x20with\x20email',_0x4aa6bd);return request({'method':'GET','uri':util[_0x29c0('0x1b')](_0x29c0('0x28'),_0x4cdf7c[_0x29c0('0x1c')]),'qs':{'operation':'query','username':_0x29c0('0x29'),'sessionName':_0x208a5d[_0x29c0('0x1e')],'query':util['format'](_0x29c0('0x2a'),_0x4aa6bd)},'json':!![]})[_0x29c0('0x2b')](function(_0x2da41d){if(_0x2da41d[_0x29c0('0x2c')]&&_0x2da41d[_0x29c0('0x22')][_0x29c0('0x2d')]){logger[_0x29c0('0x2e')]('Agent\x20found!');return BPromise['resolve']({'id':_0x2da41d[_0x29c0('0x22')][0x0]['id'],'email':_0x2da41d[_0x29c0('0x22')][0x0][_0x29c0('0x2f')],'name':_0x2da41d['result'][0x0][_0x29c0('0x30')]+'\x20'+_0x2da41d[_0x29c0('0x22')]['last_name']});}else{logger['info'](_0x29c0('0x31'));return BPromise[_0x29c0('0x21')]({'id':_0x208a5d[_0x29c0('0x32')],'email':_0x4cdf7c[_0x29c0('0x33')],'name':_0x29c0('0x29')});}})[_0x29c0('0x25')](function(_0x31be54){var _0x566e0a=_0x31be54[_0x29c0('0x34')]||0x1f4;logger['error'](_0x29c0('0x35'),_0x29c0('0x36'),_0x566e0a,JSON[_0x29c0('0x20')](_0x31be54));});}else{logger['info'](_0x29c0('0x31'));return BPromise[_0x29c0('0x21')]({'id':_0x208a5d['userId'],'email':_0x4cdf7c[_0x29c0('0x33')],'name':_0x29c0('0x29')})[_0x29c0('0x25')](function(_0x28c919){var _0x3a9b92=_0x28c919[_0x29c0('0x34')]||0x1f4;logger[_0x29c0('0x24')](_0x29c0('0x35'),_0x29c0('0x36'),_0x3a9b92,JSON[_0x29c0('0x20')](_0x28c919));});}}function getEndUser(_0x31fa82,_0x35dd53,_0x1a1b2c,_0x36a188){logger[_0x29c0('0x2e')](_0x29c0('0x37'),_0x1a1b2c);return request({'method':_0x29c0('0x38'),'uri':util[_0x29c0('0x1b')](_0x29c0('0x28'),_0x31fa82[_0x29c0('0x1c')]),'qs':{'operation':_0x29c0('0x39'),'username':_0x29c0('0x29'),'sessionName':_0x36a188[_0x29c0('0x1e')],'query':util['format'](_0x29c0('0x3a'),_0x1a1b2c,_0x1a1b2c,_0x1a1b2c,_0x1a1b2c,_0x1a1b2c)},'json':!![]})[_0x29c0('0x2b')](function(_0x2c0c1f){if(_0x2c0c1f[_0x29c0('0x2c')]&&_0x2c0c1f[_0x29c0('0x22')]['length']){logger[_0x29c0('0x2e')](_0x29c0('0x3b'));return BPromise[_0x29c0('0x21')]({'id':_0x2c0c1f['result'][0x0]['id'],'name':_0x2c0c1f[_0x29c0('0x22')][0x0][_0x29c0('0x3c')]+'\x20'+_0x2c0c1f['result'][0x0][_0x29c0('0x3d')],'phone':_0x1a1b2c});}else{logger['info'](_0x29c0('0x3e'));return request({'method':'POST','uri':util[_0x29c0('0x1b')](_0x29c0('0x28'),_0x31fa82[_0x29c0('0x1c')]),'form':{'operation':_0x29c0('0x1d'),'sessionName':_0x36a188[_0x29c0('0x1e')],'elementType':_0x29c0('0x3f'),'element':JSON['stringify']({'lastname':_0x35dd53,'phone':_0x1a1b2c,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x2dfcb7){logger[_0x29c0('0x2e')]('Enduser\x20created.');return BPromise[_0x29c0('0x21')]({'id':_0x2dfcb7[_0x29c0('0x22')]['id'],'name':_0x2dfcb7[_0x29c0('0x22')][_0x29c0('0x3d')],'phone':_0x2dfcb7[_0x29c0('0x22')][_0x29c0('0x40')]});})[_0x29c0('0x25')](function(_0x158d66){var _0xd857ff=_0x158d66[_0x29c0('0x34')]||0x1f4;logger[_0x29c0('0x24')](_0x29c0('0x35'),_0x29c0('0x41'),_0xd857ff,JSON[_0x29c0('0x20')](_0x158d66));});}});}function getConnection(_0x879065){var _0x1ade7a=_0x879065['username'];var _0x702fcd=_0x879065[_0x29c0('0x42')];return request({'method':'GET','uri':util[_0x29c0('0x1b')](_0x29c0('0x28'),_0x879065['remoteUri']),'qs':{'operation':_0x29c0('0x43'),'username':_0x1ade7a},'json':!![]})['then'](function(_0x2b54c8){if(_0x2b54c8['success']){return request({'method':_0x29c0('0x1a'),'uri':util[_0x29c0('0x1b')](_0x29c0('0x28'),_0x879065['remoteUri']),'form':{'operation':_0x29c0('0x44'),'username':'admin','accessKey':md5(_0x2b54c8[_0x29c0('0x22')]['token']+_0x702fcd)},'json':!![]});}})[_0x29c0('0x2b')](function(_0x1accc9){if(_0x1accc9[_0x29c0('0x2c')]){return BPromise[_0x29c0('0x21')](_0x1accc9[_0x29c0('0x22')]);}else{throw new Error(util['format'](_0x29c0('0x45'),_0x879065['id']));}})[_0x29c0('0x25')](function(_0x560e7b){var _0x47ee00=_0x560e7b[_0x29c0('0x34')]||0x1f4;logger[_0x29c0('0x24')](_0x29c0('0x35'),_0x29c0('0x46'),_0x47ee00,JSON[_0x29c0('0x20')](_0x560e7b));});}function request(_0x5a8714){logger[_0x29c0('0x2e')](_0x29c0('0x47'),JSON['stringify'](_0x5a8714));return rp(_0x5a8714);}exports[_0x29c0('0x48')]=function(_0xf367ec,_0x4e3333,_0x388e5d,_0x5b2987,_0x482e48,_0x8c71b2){var _0x54cc2a,_0x271709,_0x3800f3,_0x331cb9;_0x8c71b2[_0x29c0('0x1c')]=intUtil[_0x29c0('0x49')](_0x8c71b2['remoteUri']);if(_0x482e48&&_0x482e48['monitor_format']){logger[_0x29c0('0x2e')]('[QUEUE]',_0x29c0('0x4a'));_0x4e3333[_0x29c0('0x4b')]=util['format'](_0x29c0('0x4c'),_0x8c71b2['serverUrl'],_0x4e3333[_0x29c0('0x4d')],md5(_0x4e3333['uniqueid']));}else{_0x4e3333[_0x29c0('0x4b')]='';}return getConnection(_0x8c71b2)[_0x29c0('0x2b')](function(_0x574f7a){_0x331cb9=_0x574f7a;return getUser(_0x8c71b2,_0x5b2987['email'],_0x331cb9);})['then'](function(_0x35d0a5){_0x54cc2a=_0x35d0a5;logger[_0x29c0('0x2e')]('The\x20User\x20ID\x20is:',_0x54cc2a['id']);return getEndUser(_0x8c71b2,_0x4e3333['calleridname'],_0x4e3333[_0x29c0('0x4e')],_0x331cb9);})[_0x29c0('0x2b')](function(_0xa579fd){_0x271709=_0xa579fd;logger[_0x29c0('0x2e')](_0x29c0('0x4f'),_0x271709['id']);return createTicket(_0x8c71b2,_0x54cc2a,_0x271709,_0x388e5d,_0x4e3333,_0x388e5d['Fields'],_0x331cb9);})[_0x29c0('0x2b')](function(_0x52f7a2){_0x3800f3=_0x52f7a2;logger[_0x29c0('0x2e')](_0x29c0('0x50'));logger[_0x29c0('0x2e')](_0x29c0('0x51'),_0x3800f3['id']);var _0x20c44b=util[_0x29c0('0x1b')](_0x29c0('0x52'),_0x8c71b2[_0x29c0('0x1c')],_[_0x29c0('0x53')](_0x3800f3['id'],'x')[0x1]);logger['info']('[QUEUE]',_0x29c0('0x54'));emit(util[_0x29c0('0x1b')](_0x29c0('0x55'),_0x5b2987[_0x29c0('0x12')]),'trigger:browser:url',{'uri':_0x20c44b});})['catch'](function(_0x2c88b6){logger[_0x29c0('0x24')](_0x29c0('0x56'),JSON['stringify'](_0x2c88b6));});};exports['outbound']=function(_0x352515,_0x48ce40,_0x3de6d1,_0x266bc7,_0x46d691,_0x2afda9,_0x195df0){var _0x1fecd8,_0x446f12,_0x429cef,_0x4e903b;_0x2afda9[_0x29c0('0x1c')]=intUtil['stripTrailingSlash'](_0x2afda9[_0x29c0('0x1c')]);_0x2afda9[_0x29c0('0x57')]=intUtil[_0x29c0('0x49')](_0x2afda9[_0x29c0('0x57')]);if(_0x195df0&&_0x195df0[_0x29c0('0x58')]&&_0x195df0[_0x29c0('0x58')]!==_0x29c0('0x59')){logger[_0x29c0('0x2e')](_0x29c0('0x5a'),'Recording\x20is\x20enabled!');_0x48ce40['recordingURL']=util[_0x29c0('0x1b')](_0x29c0('0x4c'),_0x2afda9[_0x29c0('0x57')],_0x48ce40[_0x29c0('0x4d')],md5(_0x48ce40[_0x29c0('0x4d')]));}return getConnection(_0x2afda9)[_0x29c0('0x2b')](function(_0x48de56){_0x4e903b=_0x48de56;return getUser(_0x2afda9,_0x266bc7['email'],_0x4e903b);})[_0x29c0('0x2b')](function(_0x52b95a){_0x1fecd8=_0x52b95a;logger[_0x29c0('0x2e')]('The\x20User\x20ID\x20is:',_0x1fecd8['id']);return getEndUser(_0x2afda9,_0x48ce40['destcalleridname'],_0x48ce40[_0x29c0('0x5b')],_0x4e903b);})['then'](function(_0x254347){_0x446f12=_0x254347;logger[_0x29c0('0x2e')](_0x29c0('0x4f'),_0x446f12['id']);return createTicket(_0x2afda9,_0x1fecd8,_0x446f12,_0x3de6d1,_0x48ce40,_0x3de6d1[_0x29c0('0x5c')],_0x4e903b);})[_0x29c0('0x2b')](function(_0x4c57b9){_0x429cef=_0x4c57b9;logger[_0x29c0('0x2e')](_0x29c0('0x50'));logger[_0x29c0('0x2e')](_0x29c0('0x51'),_0x429cef['id']);var _0x28fb45=util[_0x29c0('0x1b')](_0x29c0('0x52'),_0x2afda9[_0x29c0('0x1c')],_[_0x29c0('0x53')](_0x429cef['id'],'x')[0x1]);logger[_0x29c0('0x2e')]('[OUTBOUND]',_0x29c0('0x54'));emit(util[_0x29c0('0x1b')]('user:%s',_0x266bc7[_0x29c0('0x12')]),_0x29c0('0x5d'),{'uri':_0x28fb45});})['catch'](function(_0x1e126e){logger['error']('[OUTBOUND]',JSON['stringify'](_0x1e126e));});};exports[_0x29c0('0x5e')]=function(_0xa2ead3,_0x5d0af6,_0x3d631b,_0x4e0aec,_0x35a00e,_0x3799ce){var _0x358afe,_0x388e8d,_0xc6a198,_0x344248;_0x3799ce[_0x29c0('0x1c')]=intUtil[_0x29c0('0x49')](_0x3799ce[_0x29c0('0x1c')]);_0x3799ce[_0x29c0('0x57')]=intUtil[_0x29c0('0x49')](_0x3799ce[_0x29c0('0x57')]);if(_0x35a00e&&_0x35a00e['monitor_format']){logger[_0x29c0('0x2e')](_0x29c0('0x5f'),_0x29c0('0x4a'));_0x5d0af6[_0x29c0('0x4b')]=util[_0x29c0('0x1b')](_0x29c0('0x4c'),_0x3799ce[_0x29c0('0x57')],_0x5d0af6['uniqueid'],md5(_0x5d0af6[_0x29c0('0x4d')]));}else{_0x5d0af6[_0x29c0('0x4b')]='';}return getConnection(_0x3799ce)[_0x29c0('0x2b')](function(_0x16bdb4){_0x344248=_0x16bdb4;return getUser(_0x3799ce,'',_0x344248);})[_0x29c0('0x2b')](function(_0x7c3cc2){_0x358afe=_0x7c3cc2;logger['info'](_0x29c0('0x60'),_0x358afe['id']);return getEndUser(_0x3799ce,_0x5d0af6[_0x29c0('0x61')],_0x5d0af6['calleridnum'],_0x344248);})[_0x29c0('0x2b')](function(_0x466bb3){_0x388e8d=_0x466bb3;logger[_0x29c0('0x2e')](_0x29c0('0x4f'),_0x388e8d['id']);return createTicket(_0x3799ce,_0x358afe,_0x388e8d,_0x3d631b,_0x5d0af6,_0x3d631b[_0x29c0('0x5c')],_0x344248);})[_0x29c0('0x2b')](function(_0x1785ee){_0xc6a198=_0x1785ee;logger[_0x29c0('0x2e')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0xc6a198['id']);})[_0x29c0('0x25')](function(_0x54f777){logger['error']('[ABANDONED]',JSON['stringify'](_0x54f777));});}; \ No newline at end of file +var _0x477a=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Enduser\x20ID\x20is:','lodash','bluebird','md5','ioredis','./util','vTiger','redis','localhost','socket.io-emitter','emit','length','idField','content','toString','variable','variableName','type','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','POST','format','remoteUri','sessionName','HelpDesk','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','%s/webservice.php','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','GET','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','lastname','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','user:%s','outbound','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','split','[OUTBOUND]','abandoned','[ABANDONED]'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa477('0x0'));var rp=require('request-promise');var BPromise=require(_0xa477('0x1'));var md5=require(_0xa477('0x2'));var util=require('util');var Redis=require(_0xa477('0x3'));var intUtil=require(_0xa477('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xa477('0x5'));config[_0xa477('0x6')]=_['defaults'](config[_0xa477('0x6')],{'host':_0xa477('0x7'),'port':0x18eb});var io=require(_0xa477('0x8'))(new Redis(config[_0xa477('0x6')]));function emit(_0x422a5d,_0x788380,_0x2e9476){io['to'](_0x422a5d)[_0xa477('0x9')](_0x788380,_0x2e9476);}function getCustomFields(_0x2a1d0d,_0x512d8b){var _0x210383={};if(_0x2a1d0d[_0xa477('0xa')]>0x0){_['forEach'](_0x2a1d0d,function(_0x4ce130){if(_0x4ce130['type']==='string'&&_0x4ce130['idField']){_0x210383[_0x4ce130[_0xa477('0xb')]]=_0x4ce130[_0xa477('0xc')][_0xa477('0xd')]();}else if(_0x4ce130['type']===_0xa477('0xe')&&_0x4ce130[_0xa477('0xf')]&&_0x4ce130[_0xa477('0xb')]&&_0x512d8b[_0x4ce130['variableName']]){_0x210383[_0x4ce130[_0xa477('0xb')]]=_0x512d8b[_0x4ce130[_0xa477('0xf')]][_0xa477('0xd')]();}else if(_0x4ce130[_0xa477('0x10')]===_0xa477('0x11')&&_0x4ce130['Variable']&&_0x4ce130[_0xa477('0x12')][_0xa477('0x13')]&&_0x4ce130[_0xa477('0xb')]&&_0x512d8b[_0x4ce130[_0xa477('0x12')][_0xa477('0x13')][_0xa477('0x14')]()]){_0x210383[_0x4ce130[_0xa477('0xb')]]=_0x512d8b[_0x4ce130[_0xa477('0x12')][_0xa477('0x13')][_0xa477('0x14')]()][_0xa477('0xd')]();}});}return _0x210383;}function createTicket(_0x33db41,_0xd9cdae,_0x4a413c,_0x6d645,_0x16c31d,_0x11aed4,_0x21cd60){logger[_0xa477('0x15')](_0xa477('0x16'));var _0x2a3f54=_[_0xa477('0x17')]({'parent_id':'','assigned_user_id':_0xd9cdae['id'],'ticketpriorities':'Normal','ticketstatus':_0xa477('0x18'),'ticket_title':intUtil[_0xa477('0x19')](_0x6d645[_0xa477('0x1a')],_0x16c31d,'\x20'),'description':intUtil['getString'](_0x6d645['Descriptions'],_0x16c31d,'\x0a'),'contact_id':_0x4a413c['id']},getCustomFields(_0x11aed4,_0x16c31d));var _0x4b7f69={'method':_0xa477('0x1b'),'uri':util[_0xa477('0x1c')]('%s/webservice.php',_0x33db41[_0xa477('0x1d')]),'form':{'operation':'create','username':'admin','sessionName':_0x21cd60[_0xa477('0x1e')],'elementType':_0xa477('0x1f'),'element':JSON[_0xa477('0x20')](_0x2a3f54)},'json':!![]};return request(_0x4b7f69)[_0xa477('0x21')](function(_0x472ed1){if(_0x472ed1[_0xa477('0x22')]){return BPromise[_0xa477('0x23')]({'id':_0x472ed1['result']['id']});}else{throw new Error(util[_0xa477('0x1c')](_0xa477('0x24'),JSON[_0xa477('0x20')](_0x472ed1[_0xa477('0x25')])));}})[_0xa477('0x26')](function(_0x27ec39){var _0x75f779=_0x27ec39['statusCode']||0x1f4;logger[_0xa477('0x25')](_0xa477('0x27'),_0xa477('0x28'),_0x75f779,JSON[_0xa477('0x20')](_0x27ec39));});}function getUser(_0x18d6a1,_0xdb15a9,_0x14b0e8){if(intUtil['validateEmail'](_0xdb15a9)){logger[_0xa477('0x15')]('Getting\x20agent\x20with\x20email',_0xdb15a9);return request({'method':'GET','uri':util[_0xa477('0x1c')](_0xa477('0x29'),_0x18d6a1['remoteUri']),'qs':{'operation':_0xa477('0x2a'),'username':_0xa477('0x2b'),'sessionName':_0x14b0e8[_0xa477('0x1e')],'query':util[_0xa477('0x1c')](_0xa477('0x2c'),_0xdb15a9)},'json':!![]})[_0xa477('0x21')](function(_0x37ec1c){if(_0x37ec1c[_0xa477('0x22')]&&_0x37ec1c[_0xa477('0x2d')][_0xa477('0xa')]){logger[_0xa477('0x15')](_0xa477('0x2e'));return BPromise[_0xa477('0x23')]({'id':_0x37ec1c['result'][0x0]['id'],'email':_0x37ec1c[_0xa477('0x2d')][0x0][_0xa477('0x2f')],'name':_0x37ec1c[_0xa477('0x2d')][0x0][_0xa477('0x30')]+'\x20'+_0x37ec1c[_0xa477('0x2d')][_0xa477('0x31')]});}else{logger[_0xa477('0x15')](_0xa477('0x32'));return BPromise['resolve']({'id':_0x14b0e8[_0xa477('0x33')],'email':_0x18d6a1[_0xa477('0x34')],'name':_0xa477('0x2b')});}})[_0xa477('0x26')](function(_0x4165a9){var _0x173f1a=_0x4165a9[_0xa477('0x35')]||0x1f4;logger[_0xa477('0x25')](_0xa477('0x27'),_0xa477('0x36'),_0x173f1a,JSON[_0xa477('0x20')](_0x4165a9));});}else{logger[_0xa477('0x15')](_0xa477('0x32'));return BPromise[_0xa477('0x23')]({'id':_0x14b0e8[_0xa477('0x33')],'email':_0x18d6a1[_0xa477('0x34')],'name':_0xa477('0x2b')})[_0xa477('0x26')](function(_0x14f82a){var _0x589904=_0x14f82a[_0xa477('0x35')]||0x1f4;logger[_0xa477('0x25')](_0xa477('0x27'),_0xa477('0x36'),_0x589904,JSON[_0xa477('0x20')](_0x14f82a));});}}function getEndUser(_0x1d2ae6,_0x54353f,_0x568739,_0x3065e7){logger[_0xa477('0x15')](_0xa477('0x37'),_0x568739);return request({'method':_0xa477('0x38'),'uri':util['format']('%s/webservice.php',_0x1d2ae6[_0xa477('0x1d')]),'qs':{'operation':_0xa477('0x2a'),'username':_0xa477('0x2b'),'sessionName':_0x3065e7[_0xa477('0x1e')],'query':util[_0xa477('0x1c')](_0xa477('0x39'),_0x568739,_0x568739,_0x568739,_0x568739,_0x568739)},'json':!![]})[_0xa477('0x21')](function(_0x13d519){if(_0x13d519[_0xa477('0x22')]&&_0x13d519['result'][_0xa477('0xa')]){logger[_0xa477('0x15')](_0xa477('0x3a'));return BPromise['resolve']({'id':_0x13d519[_0xa477('0x2d')][0x0]['id'],'name':_0x13d519['result'][0x0][_0xa477('0x3b')]+'\x20'+_0x13d519[_0xa477('0x2d')][0x0]['lastname'],'phone':_0x568739});}else{logger[_0xa477('0x15')](_0xa477('0x3c'));return request({'method':'POST','uri':util[_0xa477('0x1c')](_0xa477('0x29'),_0x1d2ae6[_0xa477('0x1d')]),'form':{'operation':_0xa477('0x3d'),'sessionName':_0x3065e7[_0xa477('0x1e')],'elementType':_0xa477('0x3e'),'element':JSON[_0xa477('0x20')]({'lastname':_0x54353f,'phone':_0x568739,'assigned_user_id':'\x20'})},'json':!![]})[_0xa477('0x21')](function(_0x983c11){logger[_0xa477('0x15')]('Enduser\x20created.');return BPromise[_0xa477('0x23')]({'id':_0x983c11[_0xa477('0x2d')]['id'],'name':_0x983c11[_0xa477('0x2d')][_0xa477('0x3f')],'phone':_0x983c11[_0xa477('0x2d')]['phone']});})[_0xa477('0x26')](function(_0x4a9842){var _0x2365ce=_0x4a9842[_0xa477('0x35')]||0x1f4;logger[_0xa477('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa477('0x40'),_0x2365ce,JSON[_0xa477('0x20')](_0x4a9842));});}});}function getConnection(_0x156dc2){var _0xc4ac72=_0x156dc2[_0xa477('0x34')];var _0xdb9df6=_0x156dc2[_0xa477('0x41')];return request({'method':_0xa477('0x38'),'uri':util[_0xa477('0x1c')](_0xa477('0x29'),_0x156dc2[_0xa477('0x1d')]),'qs':{'operation':'getchallenge','username':_0xc4ac72},'json':!![]})[_0xa477('0x21')](function(_0x367a72){if(_0x367a72[_0xa477('0x22')]){return request({'method':'POST','uri':util[_0xa477('0x1c')](_0xa477('0x29'),_0x156dc2['remoteUri']),'form':{'operation':_0xa477('0x42'),'username':_0xa477('0x2b'),'accessKey':md5(_0x367a72[_0xa477('0x2d')]['token']+_0xdb9df6)},'json':!![]});}})[_0xa477('0x21')](function(_0x5da74a){if(_0x5da74a[_0xa477('0x22')]){return BPromise['resolve'](_0x5da74a[_0xa477('0x2d')]);}else{throw new Error(util[_0xa477('0x1c')](_0xa477('0x43'),_0x156dc2['id']));}})[_0xa477('0x26')](function(_0x5d8009){var _0x153fc6=_0x5d8009[_0xa477('0x35')]||0x1f4;logger[_0xa477('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x153fc6,JSON[_0xa477('0x20')](_0x5d8009));});}function request(_0x1bac12){logger[_0xa477('0x15')](_0xa477('0x44'),JSON[_0xa477('0x20')](_0x1bac12));return rp(_0x1bac12);}exports[_0xa477('0x45')]=function(_0x344ca7,_0x3f03c0,_0x596eb5,_0x53e55e,_0x4052e0,_0x16f491){var _0x2c1d27,_0xadf7b9,_0x34617b,_0x2e8d5a;_0x16f491['remoteUri']=intUtil[_0xa477('0x46')](_0x16f491[_0xa477('0x1d')]);if(_0x4052e0&&_0x4052e0[_0xa477('0x47')]){logger[_0xa477('0x15')](_0xa477('0x48'),_0xa477('0x49'));_0x3f03c0[_0xa477('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x16f491[_0xa477('0x4b')],_0x3f03c0[_0xa477('0x4c')],md5(_0x3f03c0[_0xa477('0x4c')]));}else{_0x3f03c0['recordingURL']='';}return getConnection(_0x16f491)[_0xa477('0x21')](function(_0x46d272){_0x2e8d5a=_0x46d272;return getUser(_0x16f491,_0x53e55e[_0xa477('0x4d')],_0x2e8d5a);})['then'](function(_0x1d6455){_0x2c1d27=_0x1d6455;logger[_0xa477('0x15')](_0xa477('0x4e'),_0x2c1d27['id']);return getEndUser(_0x16f491,_0x3f03c0[_0xa477('0x4f')],_0x3f03c0[_0xa477('0x50')],_0x2e8d5a);})[_0xa477('0x21')](function(_0x381075){_0xadf7b9=_0x381075;logger[_0xa477('0x15')]('The\x20Enduser\x20ID\x20is:',_0xadf7b9['id']);return createTicket(_0x16f491,_0x2c1d27,_0xadf7b9,_0x596eb5,_0x3f03c0,_0x596eb5['Fields'],_0x2e8d5a);})[_0xa477('0x21')](function(_0x159d88){_0x34617b=_0x159d88;logger[_0xa477('0x15')](_0xa477('0x51'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x34617b['id']);var _0x1561e8=util[_0xa477('0x1c')](_0xa477('0x52'),_0x16f491[_0xa477('0x1d')],_['split'](_0x34617b['id'],'x')[0x1]);logger[_0xa477('0x15')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa477('0x1c')](_0xa477('0x53'),_0x53e55e[_0xa477('0x13')]),'trigger:browser:url',{'uri':_0x1561e8});})[_0xa477('0x26')](function(_0x4935e8){logger[_0xa477('0x25')]('[QUEUE]',JSON[_0xa477('0x20')](_0x4935e8));});};exports[_0xa477('0x54')]=function(_0x3f9824,_0x4bd42d,_0x1d6822,_0x43b5ae,_0x49317f,_0x212e68,_0x111b79){var _0x215be7,_0xb9e7c3,_0xe8f286,_0x52f175;_0x212e68[_0xa477('0x1d')]=intUtil[_0xa477('0x46')](_0x212e68[_0xa477('0x1d')]);_0x212e68[_0xa477('0x4b')]=intUtil['stripTrailingSlash'](_0x212e68[_0xa477('0x4b')]);if(_0x111b79&&_0x111b79['recordingFormat']&&_0x111b79['recordingFormat']!==_0xa477('0x55')){logger[_0xa477('0x15')]('[OUTBOUND]',_0xa477('0x49'));_0x4bd42d[_0xa477('0x4a')]=util[_0xa477('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x212e68[_0xa477('0x4b')],_0x4bd42d['uniqueid'],md5(_0x4bd42d[_0xa477('0x4c')]));}return getConnection(_0x212e68)[_0xa477('0x21')](function(_0x1c91bb){_0x52f175=_0x1c91bb;return getUser(_0x212e68,_0x43b5ae[_0xa477('0x4d')],_0x52f175);})[_0xa477('0x21')](function(_0x4dfb43){_0x215be7=_0x4dfb43;logger['info'](_0xa477('0x4e'),_0x215be7['id']);return getEndUser(_0x212e68,_0x4bd42d[_0xa477('0x56')],_0x4bd42d[_0xa477('0x57')],_0x52f175);})['then'](function(_0x39a7d0){_0xb9e7c3=_0x39a7d0;logger['info']('The\x20Enduser\x20ID\x20is:',_0xb9e7c3['id']);return createTicket(_0x212e68,_0x215be7,_0xb9e7c3,_0x1d6822,_0x4bd42d,_0x1d6822[_0xa477('0x58')],_0x52f175);})['then'](function(_0x486157){_0xe8f286=_0x486157;logger['info'](_0xa477('0x51'));logger[_0xa477('0x15')](_0xa477('0x59'),_0xe8f286['id']);var _0x3cd7d0=util[_0xa477('0x1c')](_0xa477('0x52'),_0x212e68['remoteUri'],_[_0xa477('0x5a')](_0xe8f286['id'],'x')[0x1]);logger[_0xa477('0x15')](_0xa477('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa477('0x1c')](_0xa477('0x53'),_0x43b5ae[_0xa477('0x13')]),'trigger:browser:url',{'uri':_0x3cd7d0});})['catch'](function(_0x4cd58a){logger['error'](_0xa477('0x5b'),JSON[_0xa477('0x20')](_0x4cd58a));});};exports[_0xa477('0x5c')]=function(_0x1a48a4,_0x17f4f8,_0x19e411,_0x4c8324,_0x311ee4,_0x5e1ad4){var _0x2dba0d,_0x3383aa,_0x37a472,_0x3c2f74;_0x5e1ad4[_0xa477('0x1d')]=intUtil[_0xa477('0x46')](_0x5e1ad4[_0xa477('0x1d')]);_0x5e1ad4[_0xa477('0x4b')]=intUtil[_0xa477('0x46')](_0x5e1ad4['serverUrl']);if(_0x311ee4&&_0x311ee4[_0xa477('0x47')]){logger['info'](_0xa477('0x5d'),'Recording\x20is\x20enabled!');_0x17f4f8[_0xa477('0x4a')]=util['format'](_0xa477('0x5e'),_0x5e1ad4[_0xa477('0x4b')],_0x17f4f8[_0xa477('0x4c')],md5(_0x17f4f8[_0xa477('0x4c')]));}else{_0x17f4f8['recordingURL']='';}return getConnection(_0x5e1ad4)[_0xa477('0x21')](function(_0x591740){_0x3c2f74=_0x591740;return getUser(_0x5e1ad4,'',_0x3c2f74);})[_0xa477('0x21')](function(_0x3c8b35){_0x2dba0d=_0x3c8b35;logger['info'](_0xa477('0x4e'),_0x2dba0d['id']);return getEndUser(_0x5e1ad4,_0x17f4f8[_0xa477('0x4f')],_0x17f4f8[_0xa477('0x50')],_0x3c2f74);})[_0xa477('0x21')](function(_0x5102cb){_0x3383aa=_0x5102cb;logger[_0xa477('0x15')](_0xa477('0x5f'),_0x3383aa['id']);return createTicket(_0x5e1ad4,_0x2dba0d,_0x3383aa,_0x19e411,_0x17f4f8,_0x19e411[_0xa477('0x58')],_0x3c2f74);})[_0xa477('0x21')](function(_0x42ab9b){_0x37a472=_0x42ab9b;logger[_0xa477('0x15')](_0xa477('0x51'));logger['info'](_0xa477('0x59'),_0x37a472['id']);})[_0xa477('0x26')](function(_0x7a28a7){logger[_0xa477('0x25')]('[ABANDONED]',JSON[_0xa477('0x20')](_0x7a28a7));});}; \ 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 5fcc869..347ca1d 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 _0x24c9=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','POST','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','type','string','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','Variable'];(function(_0x34c52a,_0xd9af3c){var _0x122d1f=function(_0x33370c){while(--_0x33370c){_0x34c52a['push'](_0x34c52a['shift']());}};_0x122d1f(++_0xd9af3c);}(_0x24c9,0x169));var _0x924c=function(_0x1e36ed,_0x1862e5){_0x1e36ed=_0x1e36ed-0x0;var _0x5ac9c9=_0x24c9[_0x1e36ed];return _0x5ac9c9;};'use strict';var _=require(_0x924c('0x0'));var rp=require(_0x924c('0x1'));var md5=require(_0x924c('0x2'));var util=require(_0x924c('0x3'));var Redis=require('ioredis');var intUtil=require(_0x924c('0x4'));var config=require(_0x924c('0x5'));var logger=require(_0x924c('0x6'))(_0x924c('0x7'));config[_0x924c('0x8')]=_['defaults'](config[_0x924c('0x8')],{'host':_0x924c('0x9'),'port':0x18eb});var io=require(_0x924c('0xa'))(new Redis(config[_0x924c('0x8')]));function emit(_0x2110cf,_0x25c5d7,_0x30520c){io['to'](_0x2110cf)['emit'](_0x25c5d7,_0x30520c);}var headers={'Content-Type':'application/json','Accept':_0x924c('0xb')};function getTicket(_0x180158,_0x1450f4,_0x408470,_0x25e889,_0x139288){logger[_0x924c('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x924c('0xd')](_0x924c('0xe'),_0x180158['remoteUri']),'method':_0x924c('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x408470['id'],'submitter_id':_0x1450f4?_0x1450f4['id']:undefined,'assignee_id':_0x1450f4?_0x1450f4['id']:undefined,'tags':getTags(_0x25e889[_0x924c('0x10')],_0x924c('0x11')),'subject':intUtil['getString'](_0x25e889[_0x924c('0x12')],_0x139288,'\x20'),'description':intUtil[_0x924c('0x13')](_0x25e889[_0x924c('0x14')],_0x139288,'\x0a'),'comment':{'public':![],'body':intUtil[_0x924c('0x13')](_0x25e889[_0x924c('0x14')],_0x139288,'\x0a')}},getCustomFields(_0x25e889[_0x924c('0x15')],_0x139288))}})[_0x924c('0x16')](function(_0x15f6e5){logger[_0x924c('0xc')](_0x924c('0x17'));return _0x15f6e5[_0x924c('0x18')];});}function getUser(_0x3d94ad,_0x38dee1){if(intUtil[_0x924c('0x19')](_0x38dee1)){logger['info'](_0x924c('0x1a'),_0x38dee1);return request({'uri':util['format'](_0x924c('0x1b'),_0x3d94ad[_0x924c('0x1c')]),'qs':{'query':util[_0x924c('0xd')](_0x924c('0x1d'),_0x38dee1)}})[_0x924c('0x16')](function(_0x4a7a43){if(_0x4a7a43[_0x924c('0x1e')]){logger['info'](_0x924c('0x1f'));return _['find'](_0x4a7a43[_0x924c('0x20')],{'email':_0x38dee1,'role':_0x924c('0x21')});}else{logger['info'](_0x924c('0x22'));return request({'uri':util[_0x924c('0xd')](_0x924c('0x23'),_0x3d94ad[_0x924c('0x1c')])})[_0x924c('0x16')](function(_0x40336e){logger['info'](_0x924c('0x24'));return _0x40336e['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3d94ad[_0x924c('0x1c')])})[_0x924c('0x16')](function(_0x1e941e){logger[_0x924c('0xc')](_0x924c('0x24'));return _0x1e941e[_0x924c('0x25')];});}}function getEndUser(_0x445225,_0x257ede,_0x638153){logger[_0x924c('0xc')]('Searching\x20enduser\x20with\x20phone',_0x638153);return request({'uri':util[_0x924c('0xd')](_0x924c('0x1b'),_0x445225['remoteUri']),'qs':{'query':util[_0x924c('0xd')](_0x924c('0x26'),_0x638153)}})[_0x924c('0x16')](function(_0x35408f){var _0x5375b3;if(_0x35408f['results']['length']){_0x35408f[_0x924c('0x20')]=_[_0x924c('0x27')](_0x35408f['results'],{'suspended':![],'role':_0x924c('0x28')});if(_0x35408f[_0x924c('0x20')][_0x924c('0x29')]){_0x5375b3=_['first'](_0x35408f[_0x924c('0x20')]);}}if(_0x5375b3){logger[_0x924c('0xc')](_0x924c('0x2a'));return _0x5375b3;}else{logger[_0x924c('0xc')](_0x924c('0x2b'));return request({'uri':util[_0x924c('0xd')](_0x924c('0x2c'),_0x445225[_0x924c('0x1c')]),'method':_0x924c('0xf'),'body':{'user':{'role':_0x924c('0x28'),'name':util['format'](_0x924c('0x2d'),_0x257ede||_0x638153),'phone':_0x638153}}})['then'](function(_0x417003){logger[_0x924c('0xc')](_0x924c('0x2e'));return _0x417003[_0x924c('0x25')];});}});}function getAuth(_0x31e885){var _0xfb4f75;if(_0x31e885[_0x924c('0x2f')]===_0x924c('0x30')){_0xfb4f75=util[_0x924c('0xd')]('%s:%s',_0x31e885['username'],_0x31e885[_0x924c('0x30')]);}else if(_0x31e885['authType']===_0x924c('0x31')){_0xfb4f75=util[_0x924c('0xd')](_0x924c('0x32'),_0x31e885[_0x924c('0x33')],_0x31e885[_0x924c('0x31')]);}return util[_0x924c('0xd')](_0x924c('0x34'),new Buffer(_0xfb4f75)[_0x924c('0x35')]('base64'));}function request(_0x3726a7){logger[_0x924c('0x36')](_0x924c('0x37'),JSON[_0x924c('0x38')](_0x3726a7));return rp(_['defaults'](_0x3726a7,{'method':_0x924c('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x47355c,_0x2356f0){var _0x221e43=[];if(_0x47355c&&_0x47355c[_0x924c('0x29')]>0x0){_0x221e43=_[_0x924c('0x3a')](_0x47355c,_0x2356f0);}return _0x221e43;}function getCustomFields(_0x59485a,_0x1c6dc5){var _0x25f1e8=[];var _0x451ff6={'custom_fields':[]};if(_0x59485a[_0x924c('0x29')]>0x0){_[_0x924c('0x3b')](_0x59485a,function(_0x1e7af8){if(_0x1e7af8[_0x924c('0x3c')]===_0x924c('0x3d')&&_0x1e7af8['nameField']&&!_0x1e7af8[_0x924c('0x3e')]){_0x451ff6[_0x1e7af8['nameField'][_0x924c('0x3f')]()]=_0x1e7af8[_0x924c('0x40')][_0x924c('0x35')]();}else if(_0x1e7af8[_0x924c('0x3c')]==='string'&&_0x1e7af8[_0x924c('0x41')]&&_0x1e7af8['customField']){_0x451ff6[_0x924c('0x42')][_0x924c('0x43')]({'id':_0x1e7af8[_0x924c('0x41')],'value':_0x1e7af8[_0x924c('0x40')][_0x924c('0x35')]()});}else if(_0x1e7af8['type']===_0x924c('0x44')&&_0x1e7af8[_0x924c('0x45')]&&_0x1e7af8['idField']&&_0x1e7af8['customField']){_0x1c6dc5[_0x1e7af8['variableName']]&&_0x451ff6[_0x924c('0x42')][_0x924c('0x43')]({'id':_0x1e7af8[_0x924c('0x41')],'value':_0x1c6dc5[_0x1e7af8[_0x924c('0x45')]]['toString']()});}else if(_0x1e7af8[_0x924c('0x3c')]==='customVariable'&&_0x1e7af8[_0x924c('0x46')]&&_0x1e7af8['Variable'][_0x924c('0x11')]&&_0x1e7af8['idField']&&_0x1e7af8[_0x924c('0x3e')]){_0x1c6dc5[_0x1e7af8['Variable']['name'][_0x924c('0x3f')]()]&&_0x451ff6['custom_fields'][_0x924c('0x43')]({'id':_0x1e7af8['idField'],'value':_0x1c6dc5[_0x1e7af8[_0x924c('0x46')][_0x924c('0x11')][_0x924c('0x3f')]()][_0x924c('0x35')]()});}});}return _0x451ff6;}exports['queue']=function(_0x2dd8b4,_0x3a9d6b,_0x5b183e,_0x3e72da,_0x44bb2a,_0xe2383e){var _0x388093,_0x1967b4;_0xe2383e[_0x924c('0x1c')]=intUtil[_0x924c('0x47')](_0xe2383e['remoteUri']);_0xe2383e[_0x924c('0x48')]=intUtil[_0x924c('0x47')](_0xe2383e[_0x924c('0x48')]);if(_0x44bb2a&&_0x44bb2a[_0x924c('0x49')]){logger['info'](_0x924c('0x4a'),_0x924c('0x4b'));_0x3a9d6b['recordingURL']=util[_0x924c('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe2383e[_0x924c('0x48')],_0x3a9d6b[_0x924c('0x4c')],md5(_0x3a9d6b[_0x924c('0x4c')]));}else{_0x3a9d6b[_0x924c('0x4d')]='';}headers[_0x924c('0x4e')]=getAuth(_0xe2383e);return getUser(_0xe2383e,_0x3e72da[_0x924c('0x4f')])[_0x924c('0x16')](function(_0x10999e){_0x388093=_0x10999e;logger[_0x924c('0xc')](_0x924c('0x50'),_0x388093['id']);return getEndUser(_0xe2383e,_0x3a9d6b[_0x924c('0x51')],_0x3a9d6b[_0x924c('0x52')]);})['then'](function(_0x24855b){_0x1967b4=_0x24855b;logger[_0x924c('0xc')](_0x924c('0x53'),_0x1967b4['id']);return getTicket(_0xe2383e,_0x388093,_0x1967b4,_0x5b183e,_0x3a9d6b);})['then'](function(_0x4454bd){if(_0x4454bd){logger[_0x924c('0xc')](_0x924c('0x54'),_0x4454bd['id']);switch(_0xe2383e[_0x924c('0x3c')]){case _0x924c('0x55'):logger[_0x924c('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x924c('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xe2383e[_0x924c('0x1c')],_0x388093['id'],_0x4454bd['id']),'method':_0x924c('0xf')});case _0x924c('0x56'):logger['info'](_0x924c('0x4a'),_0x924c('0x57'));emit(util[_0x924c('0xd')](_0x924c('0x58'),_0x3e72da[_0x924c('0x11')]),_0x924c('0x59'),{'uri':util['format'](_0x924c('0x5a'),_0xe2383e[_0x924c('0x1c')],_0x4454bd['id'])});break;default:logger['error'](_0x924c('0x4a'),_0x924c('0x5b'));}}})[_0x924c('0x5c')](function(_0x11a3c8){logger[_0x924c('0x5d')](_0x924c('0x5e'),util[_0x924c('0x5f')](_0x11a3c8,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3a4730,_0x3dc2d5,_0x48e3b9,_0x1c9868,_0x4038ca,_0x54c5cc,_0x143083){var _0x54f26,_0xd98bf7;_0x54c5cc[_0x924c('0x1c')]=intUtil[_0x924c('0x47')](_0x54c5cc[_0x924c('0x1c')]);_0x54c5cc[_0x924c('0x48')]=intUtil['stripTrailingSlash'](_0x54c5cc[_0x924c('0x48')]);if(_0x143083&&_0x143083[_0x924c('0x60')]&&_0x143083[_0x924c('0x60')]!==_0x924c('0x61')){logger[_0x924c('0xc')](_0x924c('0x62'),_0x924c('0x4b'));_0x3dc2d5[_0x924c('0x4d')]=util[_0x924c('0xd')](_0x924c('0x63'),_0x54c5cc['serverUrl'],_0x3dc2d5[_0x924c('0x4c')],md5(_0x3dc2d5[_0x924c('0x4c')]));}headers[_0x924c('0x4e')]=getAuth(_0x54c5cc);return getUser(_0x54c5cc,_0x1c9868[_0x924c('0x4f')])[_0x924c('0x16')](function(_0x3a5c12){_0x54f26=_0x3a5c12;logger['info'](_0x924c('0x50'),_0x54f26['id']);return getEndUser(_0x54c5cc,_0x3dc2d5[_0x924c('0x64')],_0x3dc2d5[_0x924c('0x65')]);})['then'](function(_0x4d7b16){_0xd98bf7=_0x4d7b16;logger[_0x924c('0xc')]('The\x20Enduser\x20ID\x20is:',_0xd98bf7['id']);return getTicket(_0x54c5cc,_0x54f26,_0xd98bf7,_0x48e3b9,_0x3dc2d5);})[_0x924c('0x16')](function(_0x27b483){if(_0x27b483){logger[_0x924c('0xc')]('The\x20Ticket\x20ID\x20is:',_0x27b483['id']);switch(_0x54c5cc[_0x924c('0x3c')]){case'integrationTab':logger[_0x924c('0xc')](_0x924c('0x62'),_0x924c('0x66'));return request({'uri':util[_0x924c('0xd')](_0x924c('0x67'),_0x54c5cc[_0x924c('0x1c')],_0x54f26['id'],_0x27b483['id']),'method':'POST'});case _0x924c('0x56'):logger[_0x924c('0xc')](_0x924c('0x62'),_0x924c('0x57'));emit(util['format'](_0x924c('0x58'),_0x1c9868[_0x924c('0x11')]),_0x924c('0x59'),{'uri':util[_0x924c('0xd')](_0x924c('0x5a'),_0x54c5cc[_0x924c('0x1c')],_0x27b483['id'])});break;default:logger[_0x924c('0x5d')](_0x924c('0x62'),_0x924c('0x5b'));}}})[_0x924c('0x5c')](function(_0x405605){logger[_0x924c('0x5d')](_0x924c('0x68'),util[_0x924c('0x5f')](_0x405605,{'showHidden':!![],'depth':null}));});};exports[_0x924c('0x69')]=function(_0x2b8480,_0x1949eb,_0x1e058b,_0x11cd9c,_0x589a28,_0x4df513){var _0xfc6a73,_0x272170;_0x4df513[_0x924c('0x1c')]=intUtil[_0x924c('0x47')](_0x4df513[_0x924c('0x1c')]);_0x4df513[_0x924c('0x48')]=intUtil['stripTrailingSlash'](_0x4df513[_0x924c('0x48')]);if(_0x589a28&&_0x589a28['monitor_format']){logger['info'](_0x924c('0x6a'),_0x924c('0x4b'));_0x1949eb['recordingURL']=util[_0x924c('0xd')](_0x924c('0x63'),_0x4df513['serverUrl'],_0x1949eb['uniqueid'],md5(_0x1949eb[_0x924c('0x4c')]));}else{_0x1949eb['recordingURL']='';}headers[_0x924c('0x4e')]=getAuth(_0x4df513);return getUser(_0x4df513)['then'](function(_0x2fad4f){_0xfc6a73=_0x2fad4f;logger[_0x924c('0xc')](_0x924c('0x50'),_0xfc6a73['id']);return getEndUser(_0x4df513,_0x1949eb[_0x924c('0x51')],_0x1949eb[_0x924c('0x52')]);})[_0x924c('0x16')](function(_0x2793ac){_0x272170=_0x2793ac;logger[_0x924c('0xc')](_0x924c('0x53'),_0x272170['id']);return getTicket(_0x4df513,_0xfc6a73,_0x272170,_0x1e058b,_0x1949eb);})[_0x924c('0x16')](function(_0x469cd4){if(_0x469cd4){logger[_0x924c('0xc')](_0x924c('0x54'),_0x469cd4['id']);}})['catch'](function(_0x3f7844){logger[_0x924c('0x5d')](_0x924c('0x6b'),util['inspect'](_0x3f7844,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9b24=['customField','toLowerCase','push','variable','variableName','idField','custom_fields','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridname','lodash','request-promise','md5','util','ioredis','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','then','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','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','length','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','forEach','type','nameField'];(function(_0x2cb341,_0x3c0530){var _0x4cd58a=function(_0x1e301e){while(--_0x1e301e){_0x2cb341['push'](_0x2cb341['shift']());}};_0x4cd58a(++_0x3c0530);}(_0x9b24,0x100));var _0x49b2=function(_0x244969,_0x7e4308){_0x244969=_0x244969-0x0;var _0x46b33a=_0x9b24[_0x244969];return _0x46b33a;};'use strict';var _=require(_0x49b2('0x0'));var rp=require(_0x49b2('0x1'));var md5=require(_0x49b2('0x2'));var util=require(_0x49b2('0x3'));var Redis=require(_0x49b2('0x4'));var intUtil=require('./util');var config=require(_0x49b2('0x5'));var logger=require('../../../../config/logger')('zendesk');config['redis']=_[_0x49b2('0x6')](config[_0x49b2('0x7')],{'host':_0x49b2('0x8'),'port':0x18eb});var io=require(_0x49b2('0x9'))(new Redis(config[_0x49b2('0x7')]));function emit(_0x30875c,_0x27ec76,_0x2b9ac4){io['to'](_0x30875c)[_0x49b2('0xa')](_0x27ec76,_0x2b9ac4);}var headers={'Content-Type':_0x49b2('0xb'),'Accept':_0x49b2('0xb')};function getTicket(_0x3d85b5,_0x27da8d,_0x568004,_0x4e9b3d,_0x4203a7){logger[_0x49b2('0xc')](_0x49b2('0xd'));return request({'uri':util[_0x49b2('0xe')](_0x49b2('0xf'),_0x3d85b5[_0x49b2('0x10')]),'method':_0x49b2('0x11'),'body':{'ticket':_[_0x49b2('0x12')]({'requester_id':_0x568004['id'],'submitter_id':_0x27da8d?_0x27da8d['id']:undefined,'assignee_id':_0x27da8d?_0x27da8d['id']:undefined,'tags':getTags(_0x4e9b3d[_0x49b2('0x13')],_0x49b2('0x14')),'subject':intUtil[_0x49b2('0x15')](_0x4e9b3d['Subjects'],_0x4203a7,'\x20'),'description':intUtil['getString'](_0x4e9b3d['Descriptions'],_0x4203a7,'\x0a'),'comment':{'public':![],'body':intUtil[_0x49b2('0x15')](_0x4e9b3d[_0x49b2('0x16')],_0x4203a7,'\x0a')}},getCustomFields(_0x4e9b3d['Fields'],_0x4203a7))}})[_0x49b2('0x17')](function(_0x249eb3){logger[_0x49b2('0xc')]('Ticket\x20created!');return _0x249eb3[_0x49b2('0x18')];});}function getUser(_0x1c0650,_0x5f209b){if(intUtil['validateEmail'](_0x5f209b)){logger[_0x49b2('0xc')]('Getting\x20agent\x20with\x20email',_0x5f209b);return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x19'),_0x1c0650[_0x49b2('0x10')]),'qs':{'query':util[_0x49b2('0xe')](_0x49b2('0x1a'),_0x5f209b)}})['then'](function(_0x376217){if(_0x376217[_0x49b2('0x1b')]){logger[_0x49b2('0xc')](_0x49b2('0x1c'));return _[_0x49b2('0x1d')](_0x376217[_0x49b2('0x1e')],{'email':_0x5f209b,'role':'agent'});}else{logger[_0x49b2('0xc')](_0x49b2('0x1f'));return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x20'),_0x1c0650[_0x49b2('0x10')])})['then'](function(_0x23e9a1){logger['info'](_0x49b2('0x21'));return _0x23e9a1[_0x49b2('0x22')];});}});}else{logger[_0x49b2('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x20'),_0x1c0650[_0x49b2('0x10')])})[_0x49b2('0x17')](function(_0x280bf5){logger['info']('Admin\x20account\x20selected.');return _0x280bf5[_0x49b2('0x22')];});}}function getEndUser(_0x9c4fac,_0x564c77,_0x4c6436){logger[_0x49b2('0xc')](_0x49b2('0x23'),_0x4c6436);return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x19'),_0x9c4fac[_0x49b2('0x10')]),'qs':{'query':util[_0x49b2('0xe')](_0x49b2('0x24'),_0x4c6436)}})[_0x49b2('0x17')](function(_0x1cfe13){var _0x4c3554;if(_0x1cfe13['results'][_0x49b2('0x25')]){_0x1cfe13['results']=_[_0x49b2('0x26')](_0x1cfe13[_0x49b2('0x1e')],{'suspended':![],'role':'end-user'});if(_0x1cfe13[_0x49b2('0x1e')][_0x49b2('0x25')]){_0x4c3554=_['first'](_0x1cfe13[_0x49b2('0x1e')]);}}if(_0x4c3554){logger['info'](_0x49b2('0x27'));return _0x4c3554;}else{logger[_0x49b2('0xc')](_0x49b2('0x28'));return request({'uri':util['format'](_0x49b2('0x29'),_0x9c4fac[_0x49b2('0x10')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x49b2('0xe')]('Caller\x20-\x20%s',_0x564c77||_0x4c6436),'phone':_0x4c6436}}})[_0x49b2('0x17')](function(_0x5bd1ed){logger['info'](_0x49b2('0x2a'));return _0x5bd1ed[_0x49b2('0x22')];});}});}function getAuth(_0x9978b9){var _0x4c164f;if(_0x9978b9['authType']===_0x49b2('0x2b')){_0x4c164f=util[_0x49b2('0xe')](_0x49b2('0x2c'),_0x9978b9[_0x49b2('0x2d')],_0x9978b9[_0x49b2('0x2b')]);}else if(_0x9978b9[_0x49b2('0x2e')]===_0x49b2('0x2f')){_0x4c164f=util[_0x49b2('0xe')](_0x49b2('0x30'),_0x9978b9['username'],_0x9978b9[_0x49b2('0x2f')]);}return util['format'](_0x49b2('0x31'),new Buffer(_0x4c164f)[_0x49b2('0x32')](_0x49b2('0x33')));}function request(_0x3532cd){logger[_0x49b2('0x34')]('[HTTP]',JSON[_0x49b2('0x35')](_0x3532cd));return rp(_[_0x49b2('0x6')](_0x3532cd,{'method':_0x49b2('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x5d3fe3,_0x228f7e){var _0x19b068=[];if(_0x5d3fe3&&_0x5d3fe3[_0x49b2('0x25')]>0x0){_0x19b068=_[_0x49b2('0x37')](_0x5d3fe3,_0x228f7e);}return _0x19b068;}function getCustomFields(_0x422122,_0x59ca62){var _0x2fb80a=[];var _0x30f137={'custom_fields':[]};if(_0x422122[_0x49b2('0x25')]>0x0){_[_0x49b2('0x38')](_0x422122,function(_0xf2882){if(_0xf2882[_0x49b2('0x39')]==='string'&&_0xf2882[_0x49b2('0x3a')]&&!_0xf2882[_0x49b2('0x3b')]){_0x30f137[_0xf2882[_0x49b2('0x3a')][_0x49b2('0x3c')]()]=_0xf2882['content'][_0x49b2('0x32')]();}else if(_0xf2882[_0x49b2('0x39')]==='string'&&_0xf2882['idField']&&_0xf2882[_0x49b2('0x3b')]){_0x30f137['custom_fields'][_0x49b2('0x3d')]({'id':_0xf2882['idField'],'value':_0xf2882['content'][_0x49b2('0x32')]()});}else if(_0xf2882[_0x49b2('0x39')]===_0x49b2('0x3e')&&_0xf2882[_0x49b2('0x3f')]&&_0xf2882[_0x49b2('0x40')]&&_0xf2882[_0x49b2('0x3b')]){_0x59ca62[_0xf2882['variableName']]&&_0x30f137[_0x49b2('0x41')][_0x49b2('0x3d')]({'id':_0xf2882['idField'],'value':_0x59ca62[_0xf2882[_0x49b2('0x3f')]]['toString']()});}else if(_0xf2882['type']===_0x49b2('0x42')&&_0xf2882[_0x49b2('0x43')]&&_0xf2882[_0x49b2('0x43')][_0x49b2('0x14')]&&_0xf2882[_0x49b2('0x40')]&&_0xf2882[_0x49b2('0x3b')]){_0x59ca62[_0xf2882[_0x49b2('0x43')][_0x49b2('0x14')]['toLowerCase']()]&&_0x30f137['custom_fields']['push']({'id':_0xf2882['idField'],'value':_0x59ca62[_0xf2882[_0x49b2('0x43')][_0x49b2('0x14')]['toLowerCase']()][_0x49b2('0x32')]()});}});}return _0x30f137;}exports['queue']=function(_0x59fee9,_0xc23f52,_0x51f435,_0x477ba8,_0x3f9778,_0x32523d){var _0xca311d,_0x54129d;_0x32523d[_0x49b2('0x10')]=intUtil['stripTrailingSlash'](_0x32523d['remoteUri']);_0x32523d[_0x49b2('0x44')]=intUtil[_0x49b2('0x45')](_0x32523d['serverUrl']);if(_0x3f9778&&_0x3f9778[_0x49b2('0x46')]){logger['info'](_0x49b2('0x47'),_0x49b2('0x48'));_0xc23f52[_0x49b2('0x49')]=util[_0x49b2('0xe')](_0x49b2('0x4a'),_0x32523d[_0x49b2('0x44')],_0xc23f52[_0x49b2('0x4b')],md5(_0xc23f52[_0x49b2('0x4b')]));}else{_0xc23f52[_0x49b2('0x49')]='';}headers[_0x49b2('0x4c')]=getAuth(_0x32523d);return getUser(_0x32523d,_0x477ba8[_0x49b2('0x4d')])[_0x49b2('0x17')](function(_0x5dafe3){_0xca311d=_0x5dafe3;logger['info'](_0x49b2('0x4e'),_0xca311d['id']);return getEndUser(_0x32523d,_0xc23f52['calleridname'],_0xc23f52[_0x49b2('0x4f')]);})[_0x49b2('0x17')](function(_0x50bfba){_0x54129d=_0x50bfba;logger['info'](_0x49b2('0x50'),_0x54129d['id']);return getTicket(_0x32523d,_0xca311d,_0x54129d,_0x51f435,_0xc23f52);})['then'](function(_0x1f5dda){if(_0x1f5dda){logger['info'](_0x49b2('0x51'),_0x1f5dda['id']);switch(_0x32523d['type']){case _0x49b2('0x52'):logger[_0x49b2('0xc')]('[QUEUE]',_0x49b2('0x53'));return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x54'),_0x32523d[_0x49b2('0x10')],_0xca311d['id'],_0x1f5dda['id']),'method':_0x49b2('0x11')});case _0x49b2('0x55'):logger[_0x49b2('0xc')](_0x49b2('0x47'),_0x49b2('0x56'));emit(util[_0x49b2('0xe')](_0x49b2('0x57'),_0x477ba8[_0x49b2('0x14')]),'trigger:browser:url',{'uri':util['format'](_0x49b2('0x58'),_0x32523d[_0x49b2('0x10')],_0x1f5dda['id'])});break;default:logger[_0x49b2('0x59')](_0x49b2('0x47'),_0x49b2('0x5a'));}}})[_0x49b2('0x5b')](function(_0x58745f){logger[_0x49b2('0x59')](_0x49b2('0x5c'),util[_0x49b2('0x5d')](_0x58745f,{'showHidden':!![],'depth':null}));});};exports[_0x49b2('0x5e')]=function(_0x589f91,_0x1d9fee,_0x3f4e68,_0x26d681,_0x253428,_0x861dc6,_0x8553b2){var _0x410107,_0x5921bb;_0x861dc6['remoteUri']=intUtil[_0x49b2('0x45')](_0x861dc6[_0x49b2('0x10')]);_0x861dc6[_0x49b2('0x44')]=intUtil[_0x49b2('0x45')](_0x861dc6['serverUrl']);if(_0x8553b2&&_0x8553b2[_0x49b2('0x5f')]&&_0x8553b2[_0x49b2('0x5f')]!==_0x49b2('0x60')){logger[_0x49b2('0xc')](_0x49b2('0x61'),'Recording\x20is\x20enabled!');_0x1d9fee[_0x49b2('0x49')]=util['format'](_0x49b2('0x4a'),_0x861dc6[_0x49b2('0x44')],_0x1d9fee[_0x49b2('0x4b')],md5(_0x1d9fee['uniqueid']));}headers['Authorization']=getAuth(_0x861dc6);return getUser(_0x861dc6,_0x26d681[_0x49b2('0x4d')])[_0x49b2('0x17')](function(_0x5e669d){_0x410107=_0x5e669d;logger[_0x49b2('0xc')](_0x49b2('0x4e'),_0x410107['id']);return getEndUser(_0x861dc6,_0x1d9fee[_0x49b2('0x62')],_0x1d9fee[_0x49b2('0x63')]);})[_0x49b2('0x17')](function(_0x15a004){_0x5921bb=_0x15a004;logger[_0x49b2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5921bb['id']);return getTicket(_0x861dc6,_0x410107,_0x5921bb,_0x3f4e68,_0x1d9fee);})[_0x49b2('0x17')](function(_0x16ff01){if(_0x16ff01){logger[_0x49b2('0xc')](_0x49b2('0x51'),_0x16ff01['id']);switch(_0x861dc6[_0x49b2('0x39')]){case'integrationTab':logger[_0x49b2('0xc')](_0x49b2('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x49b2('0xe')](_0x49b2('0x54'),_0x861dc6[_0x49b2('0x10')],_0x410107['id'],_0x16ff01['id']),'method':_0x49b2('0x11')});case'newTab':logger['info'](_0x49b2('0x61'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x49b2('0xe')]('user:%s',_0x26d681[_0x49b2('0x14')]),_0x49b2('0x64'),{'uri':util[_0x49b2('0xe')](_0x49b2('0x58'),_0x861dc6['remoteUri'],_0x16ff01['id'])});break;default:logger[_0x49b2('0x59')](_0x49b2('0x61'),_0x49b2('0x5a'));}}})[_0x49b2('0x5b')](function(_0x512c53){logger['error'](_0x49b2('0x65'),util['inspect'](_0x512c53,{'showHidden':!![],'depth':null}));});};exports[_0x49b2('0x66')]=function(_0x1457c7,_0x46dc3e,_0x99670f,_0xb00973,_0x3ae9b1,_0x34ad68){var _0x291ddb,_0x4d866b;_0x34ad68['remoteUri']=intUtil[_0x49b2('0x45')](_0x34ad68[_0x49b2('0x10')]);_0x34ad68[_0x49b2('0x44')]=intUtil[_0x49b2('0x45')](_0x34ad68[_0x49b2('0x44')]);if(_0x3ae9b1&&_0x3ae9b1[_0x49b2('0x46')]){logger[_0x49b2('0xc')](_0x49b2('0x67'),_0x49b2('0x48'));_0x46dc3e[_0x49b2('0x49')]=util['format'](_0x49b2('0x4a'),_0x34ad68['serverUrl'],_0x46dc3e[_0x49b2('0x4b')],md5(_0x46dc3e[_0x49b2('0x4b')]));}else{_0x46dc3e[_0x49b2('0x49')]='';}headers[_0x49b2('0x4c')]=getAuth(_0x34ad68);return getUser(_0x34ad68)[_0x49b2('0x17')](function(_0x429b99){_0x291ddb=_0x429b99;logger['info']('The\x20User\x20ID\x20is:',_0x291ddb['id']);return getEndUser(_0x34ad68,_0x46dc3e[_0x49b2('0x68')],_0x46dc3e[_0x49b2('0x4f')]);})[_0x49b2('0x17')](function(_0x287bf6){_0x4d866b=_0x287bf6;logger[_0x49b2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4d866b['id']);return getTicket(_0x34ad68,_0x291ddb,_0x4d866b,_0x99670f,_0x46dc3e);})['then'](function(_0x1af380){if(_0x1af380){logger[_0x49b2('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1af380['id']);}})[_0x49b2('0x5b')](function(_0x303a9c){logger[_0x49b2('0x59')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x49b2('0x5d')](_0x303a9c,{'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 3845312..2c7096c 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 _0x74d7=['POST','host','authToken','crmapi','then','response','result','Call\x20created!','recorddetail','Error\x20on\x20call\x20creation:\x20','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','log','zoho\x20data\x20users','isArrayLikeObject','find','Standard','active','isNil','Using\x20the\x20admin\x20account!','profile','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','row','Contacts','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','parse','toJson','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','monitor_format','[ABANDONED]','lodash','request-promise','md5','util','./util','xml2json','entities','moment','ioredis','../../../../config/environment','zoho','redis','defaults','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','complete','connect','Answered','rejected','Call\x20Result','Rejected','abandoned','talktime','Call\x20Duration','mm:ss','utc','endtime','CONTACTID','LEADID','SEMODULE','Leads','SEID','hasOwnProperty','%s','encodeXML',''];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x74d7,0xdd));var _0x774d=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x74d7[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x774d('0x0'));var rp=require(_0x774d('0x1'));var md5=require(_0x774d('0x2'));var util=require(_0x774d('0x3'));var intUtil=require(_0x774d('0x4'));var parser=require(_0x774d('0x5'));var entities=require(_0x774d('0x6'));var moment=require(_0x774d('0x7'));var Redis=require(_0x774d('0x8'));var config=require(_0x774d('0x9'));var logger=require('../../../../config/logger')(_0x774d('0xa'));config[_0x774d('0xb')]=_[_0x774d('0xc')](config[_0x774d('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x304f9c,_0x1163ff,_0x2eaa2e){io['to'](_0x304f9c)[_0x774d('0xd')](_0x1163ff,_0x2eaa2e);}var headers={'Content-Type':_0x774d('0xe'),'Accept':_0x774d('0xe')};function getCall(_0x178c66,_0x355dda,_0x33da85,_0x2418d2,_0x4ceec2,_0x442f68){logger[_0x774d('0xf')](_0x774d('0x10'));var _0x15542e=_[_0x774d('0x11')]({'SMOWNERID':_0x355dda['id'],'Call Type':_0x442f68||_0x774d('0x12'),'Call Start Time':(_0x442f68===_0x774d('0x13')?_0x4ceec2[_0x774d('0x14')]:_0x4ceec2[_0x774d('0x15')])||moment()[_0x774d('0x16')](_0x774d('0x17')),'Subject':intUtil[_0x774d('0x18')](_0x2418d2[_0x774d('0x19')],_0x4ceec2,'\x20'),'Description':intUtil[_0x774d('0x18')](_0x2418d2[_0x774d('0x1a')],_0x4ceec2,'\x0a')},getCustomFields(_0x2418d2[_0x774d('0x1b')],_0x4ceec2));switch(_0x4ceec2[_0x774d('0x1c')]){case _0x774d('0x1d'):_0x15542e['Call\x20Result']='Called';break;case _0x774d('0x1e'):case _0x774d('0x1f'):_0x15542e['Call\x20Result']=_0x774d('0x20');break;case _0x774d('0x21'):_0x15542e[_0x774d('0x22')]=_0x774d('0x23');break;case _0x774d('0x24'):_0x15542e['Call\x20Result']='Abandoned';break;default:}if(_0x4ceec2[_0x774d('0x25')]){_0x15542e[_0x774d('0x26')]=moment['utc'](parseInt(_0x4ceec2['talktime'])*0x3e8)[_0x774d('0x16')](_0x774d('0x27'));}else if(_0x4ceec2['answertime']&&_0x4ceec2['endtime']){_0x15542e[_0x774d('0x26')]=moment[_0x774d('0x28')](moment(_0x4ceec2[_0x774d('0x29')],_0x774d('0x17'))['diff'](moment(_0x4ceec2[_0x774d('0x14')],_0x774d('0x17'))))['format'](_0x774d('0x27'));}if(_0x33da85[_0x774d('0x2a')]){_0x15542e[_0x774d('0x2a')]=_0x33da85[_0x774d('0x2a')];}else if(_0x33da85[_0x774d('0x2b')]){_0x15542e[_0x774d('0x2c')]=_0x774d('0x2d');_0x15542e[_0x774d('0x2e')]=_0x33da85[_0x774d('0x2b')];}var _0x267627='';for(var _0x488cdf in _0x15542e){if(_0x15542e[_0x774d('0x2f')](_0x488cdf)){_0x267627+=util[_0x774d('0x16')](_0x774d('0x30'),entities['encodeXML'](_0x488cdf),entities[_0x774d('0x31')](_0x15542e[_0x488cdf]));}}_0x267627+=_0x774d('0x32');return request({'method':_0x774d('0x33'),'uri':util[_0x774d('0x16')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x178c66[_0x774d('0x34')]),'qs':{'authtoken':_0x178c66[_0x774d('0x35')],'scope':_0x774d('0x36'),'xmlData':_0x267627},'json':!![]})[_0x774d('0x37')](function(_0x5141bd){_0x5141bd=JSON['parse'](parser['toJson'](_0x5141bd));if(_0x5141bd['response']){if(_0x5141bd[_0x774d('0x38')][_0x774d('0x39')]&&_0x5141bd['response'][_0x774d('0x39')]['recorddetail']){logger[_0x774d('0xf')](_0x774d('0x3a'));return{'id':_0x5141bd[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x3b')]['FL'][0x0]['$t']};}}throw new Error(_0x774d('0x3c')+JSON[_0x774d('0x3d')](_0x5141bd));});}function getUser(_0x96888d,_0x41eb0f){return request({'method':_0x774d('0x3e'),'uri':util[_0x774d('0x16')](_0x774d('0x3f'),_0x96888d[_0x774d('0x34')]),'qs':{'type':_0x774d('0x40'),'authtoken':_0x96888d[_0x774d('0x35')],'scope':'crmapi'},'json':!![]})[_0x774d('0x37')](function(_0x3642f4){if(_0x3642f4[_0x774d('0x41')]&&_0x3642f4[_0x774d('0x41')][_0x774d('0x42')]){var _0x1112e0;console[_0x774d('0x43')](_0x774d('0x44'),_0x3642f4[_0x774d('0x41')][_0x774d('0x42')]);if(_[_0x774d('0x45')](_0x3642f4['users'][_0x774d('0x42')])){console[_0x774d('0x43')](_0x774d('0x44'),_0x3642f4['users'][_0x774d('0x42')]);if(!_['isNil'](_0x41eb0f)){_0x1112e0=_[_0x774d('0x46')](_0x3642f4[_0x774d('0x41')][_0x774d('0x42')],{'email':_0x41eb0f,'profile':_0x774d('0x47'),'status':_0x774d('0x48')});}if(!_[_0x774d('0x49')](_0x1112e0)){logger[_0x774d('0xf')]('Agent\x20found!');}else{logger['info'](_0x774d('0x4a'));_0x1112e0=_[_0x774d('0x46')](_0x3642f4['users'][_0x774d('0x42')],{'profile':'Administrator'});}console['log']('zoho\x20user',_0x1112e0);return _0x1112e0;}else{if(_0x3642f4[_0x774d('0x41')][_0x774d('0x42')][_0x774d('0x4b')]===_0x774d('0x4c')){logger[_0x774d('0xf')](_0x774d('0x4a'));_0x1112e0=_0x3642f4['users'][_0x774d('0x42')];return _0x1112e0;}else{logger[_0x774d('0x4d')](_0x774d('0x4e'),JSON['stringify'](_0x3642f4));throw new Error(_0x774d('0x4f')+JSON[_0x774d('0x3d')](_0x3642f4));}}}else{logger[_0x774d('0x4d')](_0x774d('0x4e'),JSON['stringify'](_0x3642f4));throw new Error(_0x774d('0x4f')+JSON[_0x774d('0x3d')](_0x3642f4));}});}function getEndUser(_0x3d34f3,_0x59fc0a,_0x48af89){logger[_0x774d('0xf')](_0x774d('0x50'),_0x48af89);return request({'method':_0x774d('0x3e'),'uri':util[_0x774d('0x16')](_0x774d('0x51'),_0x3d34f3[_0x774d('0x34')]),'qs':{'authtoken':_0x3d34f3[_0x774d('0x35')],'scope':_0x774d('0x36'),'criteria':util[_0x774d('0x16')](_0x774d('0x52'),_0x48af89)},'json':!![]})[_0x774d('0x37')](function(_0x17b3ee){if(_0x17b3ee['response']&&_0x17b3ee[_0x774d('0x38')]['result']){logger[_0x774d('0xf')](_0x774d('0x53'));var _0x48c852={};var _0x454aa8=_0x17b3ee['response'][_0x774d('0x39')]['Contacts'][_0x774d('0x54')]['no']?_0x17b3ee[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x55')][_0x774d('0x54')]['FL']:_0x17b3ee[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x55')][_0x774d('0x54')][0x0]['FL'];for(var _0x48b7ad=0x0,_0x132a0c=_0x454aa8[_0x774d('0x56')];_0x48b7ad<_0x132a0c;_0x48b7ad++){_0x48c852[_0x454aa8[_0x48b7ad][_0x774d('0x57')]]=_0x454aa8[_0x48b7ad][_0x774d('0x58')];}return _0x48c852;}else{return request({'method':_0x774d('0x3e'),'uri':util[_0x774d('0x16')](_0x774d('0x59'),_0x3d34f3['host']),'qs':{'authtoken':_0x3d34f3[_0x774d('0x35')],'scope':_0x774d('0x36'),'criteria':util['format'](_0x774d('0x52'),_0x48af89)},'json':!![]})[_0x774d('0x37')](function(_0x3b3307){if(_0x3b3307[_0x774d('0x38')]&&_0x3b3307[_0x774d('0x38')][_0x774d('0x39')]){logger['info'](_0x774d('0x5a'));var _0x31dc93={};var _0x16cc9d=_0x3b3307['response'][_0x774d('0x39')][_0x774d('0x2d')][_0x774d('0x54')]['no']?_0x3b3307[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x2d')][_0x774d('0x54')]['FL']:_0x3b3307[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x2d')][_0x774d('0x54')][0x0]['FL'];for(var _0x2667c7=0x0,_0xdfc3c5=_0x16cc9d['length'];_0x2667c7<_0xdfc3c5;_0x2667c7++){_0x31dc93[_0x16cc9d[_0x2667c7][_0x774d('0x57')]]=_0x16cc9d[_0x2667c7][_0x774d('0x58')];}return _0x31dc93;}else{logger[_0x774d('0xf')](_0x774d('0x5b'));_0x59fc0a=getName(_0x59fc0a);return request({'method':_0x774d('0x33'),'uri':util['format'](_0x774d('0x5c'),_0x3d34f3[_0x774d('0x34')]),'qs':{'authtoken':_0x3d34f3[_0x774d('0x35')],'scope':_0x774d('0x36'),'xmlData':util[_0x774d('0x16')](_0x774d('0x5d'),entities['encodeXML'](_0x59fc0a[0x0]),entities[_0x774d('0x31')](_0x59fc0a[0x1]),_0x48af89)},'json':!![]})['then'](function(_0x5aaad0){_0x5aaad0=JSON[_0x774d('0x5e')](parser[_0x774d('0x5f')](_0x5aaad0));if(_0x5aaad0[_0x774d('0x38')]){if(_0x5aaad0['response'][_0x774d('0x39')]&&_0x5aaad0[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x3b')]){logger[_0x774d('0xf')]('Enduser\x20created.');return request({'method':'GET','uri':util['format'](_0x774d('0x60'),_0x3d34f3[_0x774d('0x34')]),'qs':{'authtoken':_0x3d34f3['authToken'],'scope':_0x774d('0x36'),'id':_0x5aaad0[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x3b')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x774d('0x61')+JSON['stringify'](_0x5aaad0));})[_0x774d('0x37')](function(_0x2e29f7){if(_0x2e29f7['response']){if(_0x2e29f7['response'][_0x774d('0x39')]){var _0x407303={};for(var _0xf026f5=0x0,_0x294f1d=_0x2e29f7[_0x774d('0x38')][_0x774d('0x39')][_0x774d('0x2d')][_0x774d('0x54')]['FL']['length'];_0xf026f5<_0x294f1d;_0xf026f5++){_0x407303[_0x2e29f7[_0x774d('0x38')]['result']['Leads']['row']['FL'][_0xf026f5][_0x774d('0x57')]]=_0x2e29f7[_0x774d('0x38')]['result'][_0x774d('0x2d')]['row']['FL'][_0xf026f5][_0x774d('0x58')];}return _0x407303;}}throw new Error(_0x774d('0x62')+JSON['stringify'](_0x2e29f7));});}});}});}function request(_0x3b0927){logger[_0x774d('0x63')]('[HTTP]',JSON[_0x774d('0x3d')](_0x3b0927));return rp(_0x3b0927);}function getCustomFields(_0x56cdc8,_0x53e53c){var _0x343805={};if(_0x56cdc8[_0x774d('0x56')]>0x0){_['forEach'](_0x56cdc8,function(_0x5de604){if(_0x5de604[_0x774d('0x64')]==='string'&&_0x5de604['idField']){_0x343805[_0x5de604[_0x774d('0x65')]]=_0x5de604[_0x774d('0x58')][_0x774d('0x66')]();}else if(_0x5de604['type']==='variable'&&_0x5de604[_0x774d('0x67')]&&_0x5de604[_0x774d('0x65')]&&_0x53e53c[_0x5de604[_0x774d('0x67')]]){_0x343805[_0x5de604[_0x774d('0x65')]]=_0x53e53c[_0x5de604['variableName']][_0x774d('0x66')]();}else if(_0x5de604[_0x774d('0x64')]===_0x774d('0x68')&&_0x5de604['Variable']&&_0x5de604[_0x774d('0x69')][_0x774d('0x6a')]&&_0x5de604[_0x774d('0x65')]&&_0x53e53c[_0x5de604['Variable']['name'][_0x774d('0x6b')]()]){_0x343805[_0x5de604[_0x774d('0x65')]]=_0x53e53c[_0x5de604[_0x774d('0x69')][_0x774d('0x6a')][_0x774d('0x6b')]()][_0x774d('0x66')]();}});}return _0x343805;}function getName(_0x408ee){if(_0x408ee[_0x774d('0x6c')]('\x20')>0x0){var _0x5ae071=_0x408ee['split'](/ (.+)/);if(_0x5ae071[0x1]){return _0x5ae071;}}return[_0x408ee,_0x408ee];}exports['queue']=function(_0x2396ba,_0x33192c,_0x35d833,_0x62fdd4,_0x5b1b0f,_0x4a3b3b){var _0x12ab4a,_0x26356c;_0x4a3b3b[_0x774d('0x34')]=intUtil[_0x774d('0x6d')](_0x4a3b3b[_0x774d('0x34')]);_0x4a3b3b[_0x774d('0x6e')]=intUtil[_0x774d('0x6d')](_0x4a3b3b['serverUrl']);if(_0x5b1b0f&&_0x5b1b0f['monitor_format']){logger['info'](_0x774d('0x6f'),'Recording\x20is\x20enabled!');_0x33192c[_0x774d('0x70')]=util['format'](_0x774d('0x71'),_0x4a3b3b[_0x774d('0x6e')],_0x33192c[_0x774d('0x72')],md5(_0x33192c[_0x774d('0x72')]));}else{_0x33192c[_0x774d('0x70')]='';}return getUser(_0x4a3b3b,_0x62fdd4[_0x774d('0x73')])[_0x774d('0x37')](function(_0x509096){_0x12ab4a=_0x509096;logger[_0x774d('0xf')](_0x774d('0x74'),_0x12ab4a['id']);return getEndUser(_0x4a3b3b,_0x33192c[_0x774d('0x75')],_0x33192c[_0x774d('0x76')]);})[_0x774d('0x37')](function(_0x37c26c){_0x26356c=_0x37c26c;logger['info'](_0x774d('0x77'),_0x26356c['CONTACTID']||_0x26356c[_0x774d('0x2b')]);return getCall(_0x4a3b3b,_0x12ab4a,_0x26356c,_0x35d833,_0x33192c,_0x774d('0x78'));})['then'](function(_0x3aa628){if(_0x3aa628){logger['info'](_0x774d('0x79'),_0x3aa628['id']);logger['info'](_0x774d('0x6f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x774d('0x16')](_0x774d('0x7a'),_0x62fdd4[_0x774d('0x6a')]),'trigger:browser:url',{'uri':util[_0x774d('0x16')](_0x774d('0x7b'),_0x4a3b3b[_0x774d('0x34')],_0x3aa628['id'])});}})[_0x774d('0x7c')](function(_0x429cd1){logger[_0x774d('0x4d')](_0x774d('0x6f'),JSON['stringify'](_0x429cd1));});};exports[_0x774d('0x13')]=function(_0x22c86a,_0x17073d,_0x501eca,_0x4faee5,_0x440adc,_0x19fd05,_0x19a3b0){var _0x1ae63b,_0x3f9579;_0x19fd05[_0x774d('0x34')]=intUtil[_0x774d('0x6d')](_0x19fd05[_0x774d('0x34')]);_0x19fd05['serverUrl']=intUtil[_0x774d('0x6d')](_0x19fd05['serverUrl']);if(_0x19a3b0&&_0x19a3b0[_0x774d('0x7d')]&&_0x19a3b0[_0x774d('0x7d')]!==_0x774d('0x7e')){logger[_0x774d('0xf')]('[OUTBOUND]',_0x774d('0x7f'));_0x17073d[_0x774d('0x70')]=util['format'](_0x774d('0x71'),_0x19fd05['serverUrl'],_0x17073d['uniqueid'],md5(_0x17073d[_0x774d('0x72')]));}return getUser(_0x19fd05,_0x4faee5[_0x774d('0x73')])['then'](function(_0x1b43d2){_0x1ae63b=_0x1b43d2;logger['info']('The\x20User\x20ID\x20is:',_0x1ae63b['id']);return getEndUser(_0x19fd05,_0x17073d[_0x774d('0x80')],_0x17073d[_0x774d('0x81')]);})[_0x774d('0x37')](function(_0x26bf5e){_0x3f9579=_0x26bf5e;logger[_0x774d('0xf')](_0x774d('0x77'),_0x3f9579[_0x774d('0x2a')]||_0x3f9579[_0x774d('0x2b')]);return getCall(_0x19fd05,_0x1ae63b,_0x3f9579,_0x501eca,_0x17073d,_0x774d('0x82'));})['then'](function(_0x13b0eb){if(_0x13b0eb){logger[_0x774d('0xf')]('The\x20Call\x20ID\x20is:',_0x13b0eb['id']);logger[_0x774d('0xf')](_0x774d('0x83'),_0x774d('0x84'));emit(util['format'](_0x774d('0x7a'),_0x4faee5['name']),_0x774d('0x85'),{'uri':util['format']('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x19fd05[_0x774d('0x34')],_0x13b0eb['id'])});}})[_0x774d('0x7c')](function(_0xaafe4a){logger[_0x774d('0x4d')]('[OUTBOUND]',JSON[_0x774d('0x3d')](_0xaafe4a));});};exports[_0x774d('0x24')]=function(_0x4b50d8,_0x2e758d,_0x5a3813,_0x50a7ef,_0x3246d4,_0x5e21fd){var _0x3d3240,_0x33ce5a;_0x5e21fd['host']=intUtil[_0x774d('0x6d')](_0x5e21fd[_0x774d('0x34')]);_0x5e21fd[_0x774d('0x6e')]=intUtil['stripTrailingSlash'](_0x5e21fd[_0x774d('0x6e')]);if(_0x3246d4&&_0x3246d4[_0x774d('0x86')]){logger['info'](_0x774d('0x87'),_0x774d('0x7f'));_0x2e758d[_0x774d('0x70')]=util['format'](_0x774d('0x71'),_0x5e21fd[_0x774d('0x6e')],_0x2e758d[_0x774d('0x72')],md5(_0x2e758d[_0x774d('0x72')]));}else{_0x2e758d[_0x774d('0x70')]='';}return getUser(_0x5e21fd)[_0x774d('0x37')](function(_0x26d5a8){_0x3d3240=_0x26d5a8;logger[_0x774d('0xf')](_0x774d('0x74'),_0x3d3240['id']);return getEndUser(_0x5e21fd,_0x2e758d[_0x774d('0x75')],_0x2e758d[_0x774d('0x76')]);})[_0x774d('0x37')](function(_0x10cba2){_0x33ce5a=_0x10cba2;logger[_0x774d('0xf')](_0x774d('0x77'),_0x33ce5a[_0x774d('0x2a')]||_0x33ce5a[_0x774d('0x2b')]);return getCall(_0x5e21fd,_0x3d3240,_0x33ce5a,_0x5a3813,_0x2e758d,_0x774d('0x78'));})[_0x774d('0x37')](function(_0x13d3b2){if(_0x13d3b2){logger[_0x774d('0xf')](_0x774d('0x79'),_0x13d3b2['id']);}})[_0x774d('0x7c')](function(_0x374767){logger['error'](_0x774d('0x87'),JSON[_0x774d('0x3d')](_0x374767));});}; \ No newline at end of file +var _0x4f73=['calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','user:%s','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','[QUEUE]','recordingFormat','none','email','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','The\x20User\x20ID\x20is:','Inbound','[ABANDONED]','lodash','request-promise','md5','util','./util','xml2json','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20call...','inbound','outbound','starttime','agentcalledAt','getString','Descriptions','Fields','lastevent','called','Call\x20Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','CONTACTID','LEADID','SEMODULE','','%s','encodeXML','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','then','parse','toJson','response','result','recorddetail','info','Call\x20created!','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','authToken','users','user','log','zoho\x20data\x20users','isNil','find','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','profile','error','The\x20failing\x20result\x20is','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname'];(function(_0x1bbefb,_0x26eaf0){var _0x3fb5cf=function(_0x57ae02){while(--_0x57ae02){_0x1bbefb['push'](_0x1bbefb['shift']());}};_0x3fb5cf(++_0x26eaf0);}(_0x4f73,0x9c));var _0x34f7=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0x4f73[_0x606fe8];return _0x28b517;};'use strict';var _=require(_0x34f7('0x0'));var rp=require(_0x34f7('0x1'));var md5=require(_0x34f7('0x2'));var util=require(_0x34f7('0x3'));var intUtil=require(_0x34f7('0x4'));var parser=require(_0x34f7('0x5'));var entities=require('entities');var moment=require('moment');var Redis=require(_0x34f7('0x6'));var config=require(_0x34f7('0x7'));var logger=require(_0x34f7('0x8'))(_0x34f7('0x9'));config[_0x34f7('0xa')]=_[_0x34f7('0xb')](config[_0x34f7('0xa')],{'host':_0x34f7('0xc'),'port':0x18eb});var io=require(_0x34f7('0xd'))(new Redis(config[_0x34f7('0xa')]));function emit(_0xfc9351,_0x2dbda0,_0x34c485){io['to'](_0xfc9351)[_0x34f7('0xe')](_0x2dbda0,_0x34c485);}var headers={'Content-Type':'application/json','Accept':_0x34f7('0xf')};function getCall(_0x1ecea1,_0x267ff7,_0x3ba844,_0x582bad,_0x5810b5,_0x21e387){logger['info'](_0x34f7('0x10'));var _0x99bf45=_['merge']({'SMOWNERID':_0x267ff7['id'],'Call Type':_0x21e387||_0x34f7('0x11'),'Call Start Time':(_0x21e387===_0x34f7('0x12')?_0x5810b5[_0x34f7('0x13')]:_0x5810b5[_0x34f7('0x14')])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0x34f7('0x15')](_0x582bad['Subjects'],_0x5810b5,'\x20'),'Description':intUtil[_0x34f7('0x15')](_0x582bad[_0x34f7('0x16')],_0x5810b5,'\x0a')},getCustomFields(_0x582bad[_0x34f7('0x17')],_0x5810b5));switch(_0x5810b5[_0x34f7('0x18')]){case _0x34f7('0x19'):_0x99bf45[_0x34f7('0x1a')]=_0x34f7('0x1b');break;case _0x34f7('0x1c'):case _0x34f7('0x1d'):_0x99bf45[_0x34f7('0x1a')]=_0x34f7('0x1e');break;case _0x34f7('0x1f'):_0x99bf45[_0x34f7('0x1a')]=_0x34f7('0x20');break;case _0x34f7('0x21'):_0x99bf45[_0x34f7('0x1a')]=_0x34f7('0x22');break;default:}if(_0x5810b5[_0x34f7('0x23')]){_0x99bf45[_0x34f7('0x24')]=moment[_0x34f7('0x25')](parseInt(_0x5810b5[_0x34f7('0x23')])*0x3e8)[_0x34f7('0x26')](_0x34f7('0x27'));}else if(_0x5810b5[_0x34f7('0x28')]&&_0x5810b5[_0x34f7('0x29')]){_0x99bf45[_0x34f7('0x24')]=moment['utc'](moment(_0x5810b5['endtime'],_0x34f7('0x2a'))['diff'](moment(_0x5810b5[_0x34f7('0x13')],_0x34f7('0x2a'))))[_0x34f7('0x26')](_0x34f7('0x27'));}if(_0x3ba844['CONTACTID']){_0x99bf45[_0x34f7('0x2b')]=_0x3ba844[_0x34f7('0x2b')];}else if(_0x3ba844[_0x34f7('0x2c')]){_0x99bf45[_0x34f7('0x2d')]='Leads';_0x99bf45['SEID']=_0x3ba844[_0x34f7('0x2c')];}var _0x243e16=_0x34f7('0x2e');for(var _0x56e2f8 in _0x99bf45){if(_0x99bf45['hasOwnProperty'](_0x56e2f8)){_0x243e16+=util[_0x34f7('0x26')](_0x34f7('0x2f'),entities[_0x34f7('0x30')](_0x56e2f8),entities['encodeXML'](_0x99bf45[_0x56e2f8]));}}_0x243e16+='';return request({'method':_0x34f7('0x31'),'uri':util[_0x34f7('0x26')](_0x34f7('0x32'),_0x1ecea1[_0x34f7('0x33')]),'qs':{'authtoken':_0x1ecea1['authToken'],'scope':_0x34f7('0x34'),'xmlData':_0x243e16},'json':!![]})[_0x34f7('0x35')](function(_0x4bbd5d){_0x4bbd5d=JSON[_0x34f7('0x36')](parser[_0x34f7('0x37')](_0x4bbd5d));if(_0x4bbd5d[_0x34f7('0x38')]){if(_0x4bbd5d[_0x34f7('0x38')][_0x34f7('0x39')]&&_0x4bbd5d['response'][_0x34f7('0x39')][_0x34f7('0x3a')]){logger[_0x34f7('0x3b')](_0x34f7('0x3c'));return{'id':_0x4bbd5d[_0x34f7('0x38')]['result']['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0x34f7('0x3d')](_0x4bbd5d));});}function getUser(_0x5ab5cc,_0x5f0828){return request({'method':_0x34f7('0x3e'),'uri':util[_0x34f7('0x26')](_0x34f7('0x3f'),_0x5ab5cc[_0x34f7('0x33')]),'qs':{'type':_0x34f7('0x40'),'authtoken':_0x5ab5cc[_0x34f7('0x41')],'scope':_0x34f7('0x34')},'json':!![]})['then'](function(_0x275d1b){if(_0x275d1b[_0x34f7('0x42')]&&_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')]){var _0x2dda4b;console[_0x34f7('0x44')]('zoho\x20data\x20users',_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')]);if(_['isArrayLikeObject'](_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')])){console['log'](_0x34f7('0x45'),_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')]);if(!_[_0x34f7('0x46')](_0x5f0828)){_0x2dda4b=_[_0x34f7('0x47')](_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')],{'email':_0x5f0828,'profile':_0x34f7('0x48'),'status':'active'});}if(!_[_0x34f7('0x46')](_0x2dda4b)){logger[_0x34f7('0x3b')](_0x34f7('0x49'));}else{logger['info'](_0x34f7('0x4a'));_0x2dda4b=_['find'](_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')],{'profile':_0x34f7('0x4b')});}console['log'](_0x34f7('0x4c'),_0x2dda4b);return _0x2dda4b;}else{if(_0x275d1b['users'][_0x34f7('0x43')][_0x34f7('0x4d')]===_0x34f7('0x4b')){logger[_0x34f7('0x3b')]('Using\x20the\x20admin\x20account!');_0x2dda4b=_0x275d1b[_0x34f7('0x42')][_0x34f7('0x43')];return _0x2dda4b;}else{logger[_0x34f7('0x4e')](_0x34f7('0x4f'),JSON['stringify'](_0x275d1b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x34f7('0x3d')](_0x275d1b));}}}else{logger[_0x34f7('0x4e')](_0x34f7('0x4f'),JSON[_0x34f7('0x3d')](_0x275d1b));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x34f7('0x3d')](_0x275d1b));}});}function getEndUser(_0xf5d747,_0x52a340,_0x4fe32b){logger['info'](_0x34f7('0x50'),_0x4fe32b);return request({'method':_0x34f7('0x3e'),'uri':util['format'](_0x34f7('0x51'),_0xf5d747[_0x34f7('0x33')]),'qs':{'authtoken':_0xf5d747[_0x34f7('0x41')],'scope':_0x34f7('0x34'),'criteria':util[_0x34f7('0x26')]('((Phone:%s))',_0x4fe32b)},'json':!![]})['then'](function(_0x2825cf){if(_0x2825cf[_0x34f7('0x38')]&&_0x2825cf['response'][_0x34f7('0x39')]){logger['info'](_0x34f7('0x52'));var _0x2ae468={};var _0x283200=_0x2825cf['response'][_0x34f7('0x39')]['Contacts']['row']['no']?_0x2825cf[_0x34f7('0x38')]['result'][_0x34f7('0x53')][_0x34f7('0x54')]['FL']:_0x2825cf['response'][_0x34f7('0x39')]['Contacts']['row'][0x0]['FL'];for(var _0x123806=0x0,_0x9cc151=_0x283200[_0x34f7('0x55')];_0x123806<_0x9cc151;_0x123806++){_0x2ae468[_0x283200[_0x123806][_0x34f7('0x56')]]=_0x283200[_0x123806][_0x34f7('0x57')];}return _0x2ae468;}else{return request({'method':_0x34f7('0x3e'),'uri':util[_0x34f7('0x26')](_0x34f7('0x58'),_0xf5d747['host']),'qs':{'authtoken':_0xf5d747[_0x34f7('0x41')],'scope':_0x34f7('0x34'),'criteria':util[_0x34f7('0x26')](_0x34f7('0x59'),_0x4fe32b)},'json':!![]})[_0x34f7('0x35')](function(_0x53507f){if(_0x53507f[_0x34f7('0x38')]&&_0x53507f['response'][_0x34f7('0x39')]){logger[_0x34f7('0x3b')](_0x34f7('0x5a'));var _0x23b1b6={};var _0x25dd38=_0x53507f[_0x34f7('0x38')][_0x34f7('0x39')][_0x34f7('0x5b')][_0x34f7('0x54')]['no']?_0x53507f[_0x34f7('0x38')][_0x34f7('0x39')][_0x34f7('0x5b')][_0x34f7('0x54')]['FL']:_0x53507f[_0x34f7('0x38')]['result']['Leads']['row'][0x0]['FL'];for(var _0x40361e=0x0,_0x573c36=_0x25dd38[_0x34f7('0x55')];_0x40361e<_0x573c36;_0x40361e++){_0x23b1b6[_0x25dd38[_0x40361e]['val']]=_0x25dd38[_0x40361e][_0x34f7('0x57')];}return _0x23b1b6;}else{logger[_0x34f7('0x3b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x52a340=getName(_0x52a340);return request({'method':'POST','uri':util[_0x34f7('0x26')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0xf5d747[_0x34f7('0x33')]),'qs':{'authtoken':_0xf5d747['authToken'],'scope':'crmapi','xmlData':util[_0x34f7('0x26')]('%s%s%s',entities[_0x34f7('0x30')](_0x52a340[0x0]),entities[_0x34f7('0x30')](_0x52a340[0x1]),_0x4fe32b)},'json':!![]})[_0x34f7('0x35')](function(_0x304986){_0x304986=JSON[_0x34f7('0x36')](parser[_0x34f7('0x37')](_0x304986));if(_0x304986['response']){if(_0x304986[_0x34f7('0x38')][_0x34f7('0x39')]&&_0x304986[_0x34f7('0x38')][_0x34f7('0x39')][_0x34f7('0x3a')]){logger[_0x34f7('0x3b')](_0x34f7('0x5c'));return request({'method':_0x34f7('0x3e'),'uri':util[_0x34f7('0x26')](_0x34f7('0x5d'),_0xf5d747['host']),'qs':{'authtoken':_0xf5d747[_0x34f7('0x41')],'scope':_0x34f7('0x34'),'id':_0x304986[_0x34f7('0x38')]['result'][_0x34f7('0x3a')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x34f7('0x5e')+JSON[_0x34f7('0x3d')](_0x304986));})['then'](function(_0x47d537){if(_0x47d537[_0x34f7('0x38')]){if(_0x47d537[_0x34f7('0x38')]['result']){var _0x31d887={};for(var _0x4bdc14=0x0,_0x333650=_0x47d537['response'][_0x34f7('0x39')][_0x34f7('0x5b')][_0x34f7('0x54')]['FL'][_0x34f7('0x55')];_0x4bdc14<_0x333650;_0x4bdc14++){_0x31d887[_0x47d537[_0x34f7('0x38')][_0x34f7('0x39')]['Leads'][_0x34f7('0x54')]['FL'][_0x4bdc14][_0x34f7('0x56')]]=_0x47d537[_0x34f7('0x38')][_0x34f7('0x39')][_0x34f7('0x5b')][_0x34f7('0x54')]['FL'][_0x4bdc14][_0x34f7('0x57')];}return _0x31d887;}}throw new Error(_0x34f7('0x5f')+JSON['stringify'](_0x47d537));});}});}});}function request(_0x1ba8a){logger[_0x34f7('0x60')](_0x34f7('0x61'),JSON['stringify'](_0x1ba8a));return rp(_0x1ba8a);}function getCustomFields(_0x510ec4,_0xf90a98){var _0x86de6={};if(_0x510ec4[_0x34f7('0x55')]>0x0){_[_0x34f7('0x62')](_0x510ec4,function(_0xc67362){if(_0xc67362[_0x34f7('0x63')]==='string'&&_0xc67362[_0x34f7('0x64')]){_0x86de6[_0xc67362['idField']]=_0xc67362[_0x34f7('0x57')][_0x34f7('0x65')]();}else if(_0xc67362['type']==='variable'&&_0xc67362[_0x34f7('0x66')]&&_0xc67362[_0x34f7('0x64')]&&_0xf90a98[_0xc67362[_0x34f7('0x66')]]){_0x86de6[_0xc67362[_0x34f7('0x64')]]=_0xf90a98[_0xc67362['variableName']][_0x34f7('0x65')]();}else if(_0xc67362['type']===_0x34f7('0x67')&&_0xc67362[_0x34f7('0x68')]&&_0xc67362[_0x34f7('0x68')]['name']&&_0xc67362[_0x34f7('0x64')]&&_0xf90a98[_0xc67362[_0x34f7('0x68')][_0x34f7('0x69')]['toLowerCase']()]){_0x86de6[_0xc67362[_0x34f7('0x64')]]=_0xf90a98[_0xc67362[_0x34f7('0x68')][_0x34f7('0x69')][_0x34f7('0x6a')]()][_0x34f7('0x65')]();}});}return _0x86de6;}function getName(_0xf7383e){if(_0xf7383e[_0x34f7('0x6b')]('\x20')>0x0){var _0x1379de=_0xf7383e[_0x34f7('0x6c')](/ (.+)/);if(_0x1379de[0x1]){return _0x1379de;}}return[_0xf7383e,_0xf7383e];}exports[_0x34f7('0x6d')]=function(_0x3d7c34,_0x1a286c,_0x298047,_0x5e2884,_0x575c7a,_0x1de070){var _0x4ebb44,_0x41c42c;_0x1de070[_0x34f7('0x33')]=intUtil[_0x34f7('0x6e')](_0x1de070[_0x34f7('0x33')]);_0x1de070[_0x34f7('0x6f')]=intUtil[_0x34f7('0x6e')](_0x1de070[_0x34f7('0x6f')]);if(_0x575c7a&&_0x575c7a[_0x34f7('0x70')]){logger[_0x34f7('0x3b')]('[QUEUE]',_0x34f7('0x71'));_0x1a286c[_0x34f7('0x72')]=util[_0x34f7('0x26')](_0x34f7('0x73'),_0x1de070['serverUrl'],_0x1a286c['uniqueid'],md5(_0x1a286c[_0x34f7('0x74')]));}else{_0x1a286c['recordingURL']='';}return getUser(_0x1de070,_0x5e2884['email'])[_0x34f7('0x35')](function(_0x859ccd){_0x4ebb44=_0x859ccd;logger[_0x34f7('0x3b')]('The\x20User\x20ID\x20is:',_0x4ebb44['id']);return getEndUser(_0x1de070,_0x1a286c[_0x34f7('0x75')],_0x1a286c[_0x34f7('0x76')]);})['then'](function(_0x144674){_0x41c42c=_0x144674;logger[_0x34f7('0x3b')](_0x34f7('0x77'),_0x41c42c[_0x34f7('0x2b')]||_0x41c42c['LEADID']);return getCall(_0x1de070,_0x4ebb44,_0x41c42c,_0x298047,_0x1a286c,'Inbound');})[_0x34f7('0x35')](function(_0x924d77){if(_0x924d77){logger[_0x34f7('0x3b')](_0x34f7('0x78'),_0x924d77['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x34f7('0x26')](_0x34f7('0x79'),_0x5e2884['name']),'trigger:browser:url',{'uri':util[_0x34f7('0x26')](_0x34f7('0x7a'),_0x1de070['host'],_0x924d77['id'])});}})[_0x34f7('0x7b')](function(_0x2c8e10){logger[_0x34f7('0x4e')](_0x34f7('0x7c'),JSON[_0x34f7('0x3d')](_0x2c8e10));});};exports[_0x34f7('0x12')]=function(_0x2d9e54,_0x4b6f8b,_0x4523b2,_0x2402c9,_0x98874c,_0x3b9e09,_0x7919d5){var _0x32f17d,_0x15a156;_0x3b9e09[_0x34f7('0x33')]=intUtil[_0x34f7('0x6e')](_0x3b9e09[_0x34f7('0x33')]);_0x3b9e09[_0x34f7('0x6f')]=intUtil['stripTrailingSlash'](_0x3b9e09[_0x34f7('0x6f')]);if(_0x7919d5&&_0x7919d5[_0x34f7('0x7d')]&&_0x7919d5['recordingFormat']!==_0x34f7('0x7e')){logger['info']('[OUTBOUND]',_0x34f7('0x71'));_0x4b6f8b[_0x34f7('0x72')]=util[_0x34f7('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b9e09['serverUrl'],_0x4b6f8b[_0x34f7('0x74')],md5(_0x4b6f8b[_0x34f7('0x74')]));}return getUser(_0x3b9e09,_0x2402c9[_0x34f7('0x7f')])['then'](function(_0x9f7472){_0x32f17d=_0x9f7472;logger[_0x34f7('0x3b')]('The\x20User\x20ID\x20is:',_0x32f17d['id']);return getEndUser(_0x3b9e09,_0x4b6f8b[_0x34f7('0x80')],_0x4b6f8b[_0x34f7('0x81')]);})['then'](function(_0x197b6b){_0x15a156=_0x197b6b;logger[_0x34f7('0x3b')](_0x34f7('0x77'),_0x15a156[_0x34f7('0x2b')]||_0x15a156[_0x34f7('0x2c')]);return getCall(_0x3b9e09,_0x32f17d,_0x15a156,_0x4523b2,_0x4b6f8b,_0x34f7('0x82'));})[_0x34f7('0x35')](function(_0x203e8f){if(_0x203e8f){logger[_0x34f7('0x3b')]('The\x20Call\x20ID\x20is:',_0x203e8f['id']);logger[_0x34f7('0x3b')](_0x34f7('0x83'),_0x34f7('0x84'));emit(util[_0x34f7('0x26')](_0x34f7('0x79'),_0x2402c9[_0x34f7('0x69')]),_0x34f7('0x85'),{'uri':util[_0x34f7('0x26')](_0x34f7('0x7a'),_0x3b9e09[_0x34f7('0x33')],_0x203e8f['id'])});}})[_0x34f7('0x7b')](function(_0x3b4c6a){logger[_0x34f7('0x4e')](_0x34f7('0x83'),JSON['stringify'](_0x3b4c6a));});};exports['abandoned']=function(_0x3a2162,_0x5f2272,_0xc0354b,_0x39f806,_0xa0ae3d,_0x451d8a){var _0xec7d5e,_0x2d51af;_0x451d8a[_0x34f7('0x33')]=intUtil[_0x34f7('0x6e')](_0x451d8a['host']);_0x451d8a[_0x34f7('0x6f')]=intUtil['stripTrailingSlash'](_0x451d8a[_0x34f7('0x6f')]);if(_0xa0ae3d&&_0xa0ae3d[_0x34f7('0x70')]){logger[_0x34f7('0x3b')]('[ABANDONED]',_0x34f7('0x71'));_0x5f2272['recordingURL']=util[_0x34f7('0x26')](_0x34f7('0x73'),_0x451d8a[_0x34f7('0x6f')],_0x5f2272['uniqueid'],md5(_0x5f2272[_0x34f7('0x74')]));}else{_0x5f2272[_0x34f7('0x72')]='';}return getUser(_0x451d8a)[_0x34f7('0x35')](function(_0x4b3208){_0xec7d5e=_0x4b3208;logger[_0x34f7('0x3b')](_0x34f7('0x86'),_0xec7d5e['id']);return getEndUser(_0x451d8a,_0x5f2272[_0x34f7('0x75')],_0x5f2272['calleridnum']);})['then'](function(_0x58fbc6){_0x2d51af=_0x58fbc6;logger[_0x34f7('0x3b')]('The\x20Enduser\x20ID\x20is:',_0x2d51af[_0x34f7('0x2b')]||_0x2d51af[_0x34f7('0x2c')]);return getCall(_0x451d8a,_0xec7d5e,_0x2d51af,_0xc0354b,_0x5f2272,_0x34f7('0x87'));})[_0x34f7('0x35')](function(_0x26c146){if(_0x26c146){logger['info']('The\x20Call\x20ID\x20is:',_0x26c146['id']);}})[_0x34f7('0x7b')](function(_0x4f946e){logger[_0x34f7('0x4e')](_0x34f7('0x88'),JSON[_0x34f7('0x3d')](_0x4f946e));});}; \ 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 9ca84fb..56140f7 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%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','shelljs'];(function(_0x1e3bca,_0x5c8c08){var _0x44cd98=function(_0x3550ee){while(--_0x3550ee){_0x1e3bca['push'](_0x1e3bca['shift']());}};_0x44cd98(++_0x5c8c08);}(_0x7a54,0x106));var _0x47a5=function(_0xfdb9b9,_0x1a27cf){_0xfdb9b9=_0xfdb9b9-0x0;var _0x59933f=_0x7a54[_0xfdb9b9];return _0x59933f;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%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','shelljs'];(function(_0x4f7e41,_0x1c95ff){var _0x3f4e2a=function(_0x4df436){while(--_0x4df436){_0x4f7e41['push'](_0x4f7e41['shift']());}};_0x3f4e2a(++_0x1c95ff);}(_0x7a54,0x106));var _0x47a5=function(_0x140769,_0x39e900){_0x140769=_0x140769-0x0;var _0x1b3b3e=_0x7a54[_0x140769];return _0x1b3b3e;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ 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 b3186ed..5914a94 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 _0x19c3=['trigger','exec','data1','render','data2','headers','data6','parse','error','stack','toUpperCase','POST','data7','body','info','format','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache'];(function(_0x1bdd77,_0x4f0f9e){var _0x339718=function(_0x82a4e5){while(--_0x82a4e5){_0x1bdd77['push'](_0x1bdd77['shift']());}};_0x339718(++_0x4f0f9e);}(_0x19c3,0xf9));var _0x319c=function(_0x5dfb65,_0x1ae9dd){_0x5dfb65=_0x5dfb65-0x0;var _0x3c935f=_0x19c3[_0x5dfb65];return _0x3c935f;};'use strict';var rp=require(_0x319c('0x0'));var util=require('util');var _=require(_0x319c('0x1'));var Mustache=require(_0x319c('0x2'));var logger=require('../../../../config/logger')(_0x319c('0x3'));exports[_0x319c('0x4')]=function(_0x13f249,_0x350517){var _0x3a96b1,_0x290261;var _0x4c35fe={'method':_0x13f249[_0x319c('0x5')]['toUpperCase'](),'uri':encodeURI(Mustache[_0x319c('0x6')](_0x13f249[_0x319c('0x7')],_0x350517)),'json':!![],'resolveWithFullResponse':!![]};try{_0x4c35fe[_0x319c('0x8')]=_0x13f249[_0x319c('0x9')]?JSON[_0x319c('0xa')](Mustache['render'](_0x13f249[_0x319c('0x9')],_0x350517)):{};}catch(_0x1b7ffd){logger[_0x319c('0xb')](_0x1b7ffd[_0x319c('0xc')]);}switch(_0x13f249[_0x319c('0x5')][_0x319c('0xd')]()){case'GET':_0x4c35fe['qs']=_0x350517;break;case _0x319c('0xe'):case'PUT':_0x3a96b1={};if(_0x13f249[_0x319c('0xf')]){_0x3a96b1=Mustache[_0x319c('0x6')](_0x13f249[_0x319c('0xf')],_0x350517);}else{_0x3a96b1=_0x350517;}_0x4c35fe[_0x319c('0x10')]=JSON[_0x319c('0xa')](_0x3a96b1);break;}logger[_0x319c('0x11')](util[_0x319c('0x12')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x13f249['data1'],_0x13f249[_0x319c('0x7')],JSON[_0x319c('0x13')](_0x4c35fe)));rp(_0x4c35fe)['then'](function(_0x372a50){_0x3a96b1=!_[_0x319c('0x14')](_0x3a96b1)?_0x319c('0x15')+_0x3a96b1:'';_0x290261=typeof _0x372a50[_0x319c('0x10')]===_0x319c('0x16')?JSON[_0x319c('0x13')](_0x372a50[_0x319c('0x10')]):_0x372a50['body'];logger['info'](util[_0x319c('0x12')](_0x319c('0x17'),_0x13f249['data1'],_0x13f249[_0x319c('0x7')],_0x372a50['statusCode'],_0x290261));})[_0x319c('0x18')](function(_0x45a822){logger[_0x319c('0xb')](util[_0x319c('0x12')](_0x319c('0x19'),_0x13f249[_0x319c('0x5')],_0x13f249[_0x319c('0x7')],_0x45a822['statusCode'],_0x45a822[_0x319c('0x1a')],_0x45a822[_0x319c('0x1b')]));});}; \ No newline at end of file +var _0xfd07=['GET','POST','PUT','data7','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','body','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','error','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','exec','data1','toUpperCase','render','headers','data6','parse','stack'];(function(_0x4004b3,_0x859c5){var _0x2ee23c=function(_0x21fe6c){while(--_0x21fe6c){_0x4004b3['push'](_0x4004b3['shift']());}};_0x2ee23c(++_0x859c5);}(_0xfd07,0x104));var _0x7fd0=function(_0x5a852b,_0x1694c2){_0x5a852b=_0x5a852b-0x0;var _0xd74d84=_0xfd07[_0x5a852b];return _0xd74d84;};'use strict';var rp=require(_0x7fd0('0x0'));var util=require(_0x7fd0('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0x7fd0('0x2')]=function(_0x38d42b,_0x4240ef){var _0x52de97,_0x5b9167;var _0x2a7ffe={'method':_0x38d42b[_0x7fd0('0x3')][_0x7fd0('0x4')](),'uri':encodeURI(Mustache[_0x7fd0('0x5')](_0x38d42b['data2'],_0x4240ef)),'json':!![],'resolveWithFullResponse':!![]};try{_0x2a7ffe[_0x7fd0('0x6')]=_0x38d42b[_0x7fd0('0x7')]?JSON[_0x7fd0('0x8')](Mustache['render'](_0x38d42b['data6'],_0x4240ef)):{};}catch(_0x27aa04){logger['error'](_0x27aa04[_0x7fd0('0x9')]);}switch(_0x38d42b[_0x7fd0('0x3')][_0x7fd0('0x4')]()){case _0x7fd0('0xa'):_0x2a7ffe['qs']=_0x4240ef;break;case _0x7fd0('0xb'):case _0x7fd0('0xc'):_0x52de97={};if(_0x38d42b[_0x7fd0('0xd')]){_0x52de97=Mustache[_0x7fd0('0x5')](_0x38d42b[_0x7fd0('0xd')],_0x4240ef);}else{_0x52de97=_0x4240ef;}_0x2a7ffe['body']=JSON['parse'](_0x52de97);break;}logger[_0x7fd0('0xe')](util[_0x7fd0('0xf')](_0x7fd0('0x10'),_0x38d42b[_0x7fd0('0x3')],_0x38d42b[_0x7fd0('0x11')],JSON[_0x7fd0('0x12')](_0x2a7ffe)));rp(_0x2a7ffe)[_0x7fd0('0x13')](function(_0x52c40d){_0x52de97=!_[_0x7fd0('0x14')](_0x52de97)?_0x7fd0('0x15')+_0x52de97:'';_0x5b9167=typeof _0x52c40d[_0x7fd0('0x16')]===_0x7fd0('0x17')?JSON[_0x7fd0('0x12')](_0x52c40d[_0x7fd0('0x16')]):_0x52c40d[_0x7fd0('0x16')];logger[_0x7fd0('0xe')](util['format'](_0x7fd0('0x18'),_0x38d42b[_0x7fd0('0x3')],_0x38d42b['data2'],_0x52c40d[_0x7fd0('0x19')],_0x5b9167));})[_0x7fd0('0x1a')](function(_0x2449d8){logger[_0x7fd0('0x1b')](util[_0x7fd0('0xf')](_0x7fd0('0x1c'),_0x38d42b[_0x7fd0('0x3')],_0x38d42b[_0x7fd0('0x11')],_0x2449d8[_0x7fd0('0x19')],_0x2449d8['name'],_0x2449d8[_0x7fd0('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 435c315..4f40e14 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 _0x3d9f=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','debug','error','rpc','message','result','catch','exports'];(function(_0x53d7fc,_0x2b70d3){var _0x295a67=function(_0x2e5348){while(--_0x2e5348){_0x53d7fc['push'](_0x53d7fc['shift']());}};_0x295a67(++_0x2b70d3);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x3d9f[_0x31e29a];return _0x32d892;};'use strict';var jayson=require(_0xf3d9('0x0'));var BPromise=require(_0xf3d9('0x1'));var logger=require(_0xf3d9('0x2'))(_0xf3d9('0x3'));var client=jayson[_0xf3d9('0x4')][_0xf3d9('0x5')]({'port':0x2329});client[_0xf3d9('0x6')]=function(_0x30036e,_0x4ac931){return new BPromise(function(_0x4ab31c,_0x4dc969){return client[_0xf3d9('0x7')](_0x30036e,_0x4ac931)['then'](function(_0x6d83d7){logger[_0xf3d9('0x8')]('rpc','routing',_0x30036e,_0x4ac931,_0x6d83d7);if(_0x6d83d7[_0xf3d9('0x9')]){logger[_0xf3d9('0x9')](_0xf3d9('0xa'),_0xf3d9('0x3'),_0x30036e,_0x6d83d7[_0xf3d9('0x9')][_0xf3d9('0xb')],_0x4ac931);return _0x4dc969(_0x6d83d7['error']['message']);}else{return _0x4ab31c(_0x6d83d7[_0xf3d9('0xc')]);}})[_0xf3d9('0xd')](function(_0x252ed2){logger[_0xf3d9('0x9')](_0xf3d9('0xa'),'routing',_0x30036e,_0x252ed2,_0x4ac931);return _0x4dc969(_0x252ed2);});});};module[_0xf3d9('0xe')]=client; \ No newline at end of file +var _0xe3c5=['rpc','error','message','result','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then','debug'];(function(_0x3dc7cf,_0x143993){var _0x2ee068=function(_0x2863ca){while(--_0x2863ca){_0x3dc7cf['push'](_0x3dc7cf['shift']());}};_0x2ee068(++_0x143993);}(_0xe3c5,0x17d));var _0x5e3c=function(_0xe38764,_0x28ce79){_0xe38764=_0xe38764-0x0;var _0x5979cf=_0xe3c5[_0xe38764];return _0x5979cf;};'use strict';var jayson=require(_0x5e3c('0x0'));var BPromise=require(_0x5e3c('0x1'));var logger=require(_0x5e3c('0x2'))(_0x5e3c('0x3'));var client=jayson[_0x5e3c('0x4')][_0x5e3c('0x5')]({'port':0x2329});client['Request']=function(_0x46e129,_0x2ef6cd){return new BPromise(function(_0x361936,_0x2a7d7a){return client[_0x5e3c('0x6')](_0x46e129,_0x2ef6cd)[_0x5e3c('0x7')](function(_0x1e631d){logger[_0x5e3c('0x8')](_0x5e3c('0x9'),_0x5e3c('0x3'),_0x46e129,_0x2ef6cd,_0x1e631d);if(_0x1e631d[_0x5e3c('0xa')]){logger[_0x5e3c('0xa')]('rpc','routing',_0x46e129,_0x1e631d[_0x5e3c('0xa')][_0x5e3c('0xb')],_0x2ef6cd);return _0x2a7d7a(_0x1e631d[_0x5e3c('0xa')][_0x5e3c('0xb')]);}else{return _0x361936(_0x1e631d[_0x5e3c('0xc')]);}})['catch'](function(_0x3956a9){logger[_0x5e3c('0xa')]('rpc',_0x5e3c('0x3'),_0x46e129,_0x3956a9,_0x2ef6cd);return _0x2a7d7a(_0x3956a9);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index e06110a..a926fe0 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 _0xe6e7=['then','initMailAccounts','refresh','mailAccounts','listen','catch','log','bluebird','./server','./realtime','resolve','getMailAccounts'];(function(_0x2d1905,_0x1e46a0){var _0x3aacd1=function(_0x9e872b){while(--_0x9e872b){_0x2d1905['push'](_0x2d1905['shift']());}};_0x3aacd1(++_0x1e46a0);}(_0xe6e7,0x1cf));var _0x7e6e=function(_0x5fac82,_0x5c6541){_0x5fac82=_0x5fac82-0x0;var _0xcf3bcb=_0xe6e7[_0x5fac82];return _0xcf3bcb;};'use strict';var BPromise=require(_0x7e6e('0x0'));var server=require(_0x7e6e('0x1'));var Realtime=require(_0x7e6e('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x7e6e('0x3')]()['then'](mailAccount[_0x7e6e('0x4')]())[_0x7e6e('0x5')](realtime[_0x7e6e('0x6')]())[_0x7e6e('0x5')](function(){email[_0x7e6e('0x7')](realtime[_0x7e6e('0x8')]);return realtime;});}function main(){return server[_0x7e6e('0x9')](realtime,email)[_0x7e6e('0x5')](function(_0x1e2ba3){return initRealtime();})['then'](function(_0x5571c7){return setInterval(initRealtime,0x2710);})[_0x7e6e('0xa')](function(_0x4032ba){console[_0x7e6e('0xb')](_0x4032ba);});}main(); \ No newline at end of file +var _0x5e36=['then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','resolve'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0x5e36,0x181));var _0x65e3=function(_0xb77b49,_0x5eb4f3){_0xb77b49=_0xb77b49-0x0;var _0x539cd0=_0x5e36[_0xb77b49];return _0x539cd0;};'use strict';var BPromise=require(_0x65e3('0x0'));var server=require(_0x65e3('0x1'));var Realtime=require(_0x65e3('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x65e3('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x65e3('0x4')]()[_0x65e3('0x5')](mailAccount[_0x65e3('0x6')]())[_0x65e3('0x5')](realtime[_0x65e3('0x7')]())[_0x65e3('0x5')](function(){email[_0x65e3('0x8')](realtime[_0x65e3('0x9')]);return realtime;});}function main(){return server[_0x65e3('0xa')](realtime,email)['then'](function(_0x3b26ee){return initRealtime();})['then'](function(_0x5db487){return setInterval(initRealtime,0x2710);})[_0x65e3('0xb')](function(_0x2a0433){console[_0x65e3('0xc')](_0x2a0433);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 08fb7df..bfe577e 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 _0xd9eb=['localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','catch','error','send','Smtp','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0xd9eb,0xca));var _0xbd9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xd9eb[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xbd9e('0x0'));var moment=require(_0xbd9e('0x1'));var BPromise=require(_0xbd9e('0x2'));var md5=require(_0xbd9e('0x3'));var Redis=require(_0xbd9e('0x4'));var config=require(_0xbd9e('0x5'));var logger=require(_0xbd9e('0x6'))(_0xbd9e('0x7'));config[_0xbd9e('0x8')]=_[_0xbd9e('0x9')](config[_0xbd9e('0x8')],{'host':_0xbd9e('0xa'),'port':0x18eb});var io=require(_0xbd9e('0xb'))(new Redis(config['redis']));var EmailImap=require(_0xbd9e('0xc'));var EmailSmtp=require(_0xbd9e('0xd'));var mailAccount=require(_0xbd9e('0xe'));var md5Accounts={};function EmailChannel(_0x2dbf84){logger[_0xbd9e('0xf')](_0xbd9e('0x10'));this[_0xbd9e('0x11')]=_0x2dbf84[_0xbd9e('0x11')];this[_0xbd9e('0x12')]={};this[_0xbd9e('0x13')]=new EmailSmtp();}EmailChannel[_0xbd9e('0x14')][_0xbd9e('0x15')]=function(_0x5cb5a8){var _0x3cfedc=this[_0xbd9e('0x11')][_0x5cb5a8];var _0x5e6203={'id':_0x3cfedc['id'],'name':_0x3cfedc[_0xbd9e('0x16')],'key':_0x3cfedc['key'],'active':_0x3cfedc[_0xbd9e('0x17')],'Imap':{'status':_0x3cfedc[_0xbd9e('0x18')][_0xbd9e('0x19')],'messageStatus':_0x3cfedc[_0xbd9e('0x18')][_0xbd9e('0x1a')],'total':_0x3cfedc[_0xbd9e('0x18')][_0xbd9e('0x1b')]}};if(_[_0xbd9e('0x1c')](md5Accounts[_0x5cb5a8])){md5Accounts[_0x5cb5a8]={};}var _0x47e6a0=md5(JSON[_0xbd9e('0x1d')](_0x5e6203));if(md5Accounts[_0x5cb5a8][_0xbd9e('0x3')]!==_0x47e6a0){md5Accounts[_0x5cb5a8][_0xbd9e('0x3')]=_0x47e6a0;io[_0xbd9e('0x15')](_0xbd9e('0x1e'),_0x5e6203);}};EmailChannel[_0xbd9e('0x14')][_0xbd9e('0x1f')]=function(_0x87eb30){for(var _0x4112a8 in _0x87eb30){if(_0x87eb30[_0xbd9e('0x20')](_0x4112a8)){if(_0x87eb30[_0x4112a8][_0xbd9e('0x18')]&&_0x87eb30[_0x4112a8]['active']){var _0x43c588=_0x87eb30[_0x4112a8][_0xbd9e('0x18')];if(!this[_0xbd9e('0x12')][_0xbd9e('0x20')](_0x43c588['id'])){this[_0xbd9e('0x12')][_0x43c588['id']]=new EmailImap(_0x43c588,_0x87eb30[_0x4112a8]['email']);this[_0xbd9e('0x12')][_0x43c588['id']]['on'](_0xbd9e('0x21'),this[_0xbd9e('0x22')][_0xbd9e('0x23')](this,_0x4112a8));this[_0xbd9e('0x12')][_0x43c588['id']]['on']('email',this[_0xbd9e('0x24')]['bind'](this,_0x4112a8));this['imapAccounts'][_0x43c588['id']]['on'](_0xbd9e('0x25'),this[_0xbd9e('0x26')][_0xbd9e('0x23')](this,_0x4112a8));this[_0xbd9e('0x12')][_0x43c588['id']]['on']('error',this[_0xbd9e('0x27')][_0xbd9e('0x23')](this,_0x4112a8));}}else{if(_['isNil'](this['mailAccounts'][_0x4112a8][_0xbd9e('0x18')])){this[_0xbd9e('0x11')][_0x4112a8][_0xbd9e('0x18')]={};}this[_0xbd9e('0x11')][_0x4112a8]['Imap']['status']='disabled';this[_0xbd9e('0x11')][_0x4112a8]['Imap'][_0xbd9e('0x1a')]='';this['emit'](_0x4112a8);}}}};EmailChannel[_0xbd9e('0x14')][_0xbd9e('0x22')]=function(_0x4be355,_0x469153){if(this[_0xbd9e('0x11')][_0x4be355]){this[_0xbd9e('0x11')][_0x4be355][_0xbd9e('0x18')][_0xbd9e('0x19')]=_0xbd9e('0x28');this[_0xbd9e('0x11')][_0x4be355]['Imap'][_0xbd9e('0x1a')]=_0x469153['name'];if(_0x469153[_0xbd9e('0x29')]){this['mailAccounts'][_0x4be355][_0xbd9e('0x18')][_0xbd9e('0x1b')]=_0x469153[_0xbd9e('0x29')][_0xbd9e('0x1b')];}return this[_0xbd9e('0x15')](_0x4be355);}};EmailChannel['prototype'][_0xbd9e('0x24')]=function(_0x662015,_0x5cf6aa){logger[_0xbd9e('0xf')](_0xbd9e('0x2a'),_0x5cf6aa[_0xbd9e('0x2b')],_0x5cf6aa['lastName'],_0x5cf6aa[_0xbd9e('0x2c')],_0x662015);if(this[_0xbd9e('0x11')][_0x662015]){return mailAccount[_0xbd9e('0x2d')](_0x662015,_0x5cf6aa)[_0xbd9e('0x2e')](function(_0x57d28a){if(_0x57d28a){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0xbd9e('0x2f')](function(_0x489c7f){logger[_0xbd9e('0x30')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x489c7f));});}};EmailChannel[_0xbd9e('0x14')]['handleImapEnd']=function(_0x360784){if(this[_0xbd9e('0x11')][_0x360784]&&this[_0xbd9e('0x11')][_0x360784][_0xbd9e('0x18')]){if(this[_0xbd9e('0x12')][this[_0xbd9e('0x11')][_0x360784]['Imap']['id']]){delete this[_0xbd9e('0x12')][this['mailAccounts'][_0x360784][_0xbd9e('0x18')]['id']];}this['mailAccounts'][_0x360784]['Imap']['lastSync']=moment();this[_0xbd9e('0x15')](_0x360784);}};EmailChannel['prototype']['handleImapError']=function(_0x1ac0a9,_0x5b9913){if(this[_0xbd9e('0x11')][_0x1ac0a9]){this['mailAccounts'][_0x1ac0a9][_0xbd9e('0x18')][_0xbd9e('0x19')]=_0xbd9e('0x30');this[_0xbd9e('0x11')][_0x1ac0a9][_0xbd9e('0x18')]['messageStatus']=_0x5b9913;return this[_0xbd9e('0x15')](_0x1ac0a9);}};EmailChannel[_0xbd9e('0x14')]['sendMail']=function(_0x24eb19,_0x10735c){return this[_0xbd9e('0x13')][_0xbd9e('0x31')](_0x24eb19,_0x10735c);};EmailChannel[_0xbd9e('0x14')]['verifySmtp']=function(_0x324a75){var _0x1c07f7=this;if(this[_0xbd9e('0x11')][_0x324a75['id']]){if(_[_0xbd9e('0x1c')](this[_0xbd9e('0x11')][_0x324a75['id']][_0xbd9e('0x32')])){this['mailAccounts'][_0x324a75['id']][_0xbd9e('0x32')]={};}this[_0xbd9e('0x11')][_0x324a75['id']][_0xbd9e('0x32')]['lastSync']=moment();return new BPromise(function(_0x1ea576,_0x24cca7){return _0x1c07f7['smtp']['verify'](_0x324a75)['then'](function(_0x884037){_0x1c07f7[_0xbd9e('0x11')][_0x324a75['id']]['Smtp'][_0xbd9e('0x19')]=_0xbd9e('0x33');_0x1c07f7[_0xbd9e('0x11')][_0x324a75['id']][_0xbd9e('0x32')][_0xbd9e('0x1a')]='';_0x1c07f7[_0xbd9e('0x15')](_0x324a75['id']);_0x1ea576(_0x884037);})[_0xbd9e('0x2f')](function(_0x1bd88b){_0x1c07f7['mailAccounts'][_0x324a75['id']][_0xbd9e('0x32')][_0xbd9e('0x19')]=_0xbd9e('0x30');_0x1c07f7[_0xbd9e('0x11')][_0x324a75['id']]['Smtp']['messageStatus']=_0x1bd88b;_0x1c07f7[_0xbd9e('0x15')](_0x324a75['id']);_0x24cca7(_0x1bd88b);});});}return this[_0xbd9e('0x13')]['verify'](_0x324a75);};module[_0xbd9e('0x34')]=EmailChannel; \ No newline at end of file +var _0x1189=['Smtp','lastSync','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','status','Imap','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','name','messages','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','sendMail','verifySmtp'];(function(_0x12dafa,_0x51ce5){var _0x1f3784=function(_0xcdae68){while(--_0xcdae68){_0x12dafa['push'](_0x12dafa['shift']());}};_0x1f3784(++_0x51ce5);}(_0x1189,0x17f));var _0x9118=function(_0x45e4fc,_0x514e62){_0x45e4fc=_0x45e4fc-0x0;var _0x593204=_0x1189[_0x45e4fc];return _0x593204;};'use strict';var _=require(_0x9118('0x0'));var moment=require(_0x9118('0x1'));var BPromise=require(_0x9118('0x2'));var md5=require(_0x9118('0x3'));var Redis=require('ioredis');var config=require(_0x9118('0x4'));var logger=require(_0x9118('0x5'))(_0x9118('0x6'));config[_0x9118('0x7')]=_[_0x9118('0x8')](config[_0x9118('0x7')],{'host':_0x9118('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9118('0x7')]));var EmailImap=require(_0x9118('0xa'));var EmailSmtp=require(_0x9118('0xb'));var mailAccount=require(_0x9118('0xc'));var md5Accounts={};function EmailChannel(_0x37e930){logger[_0x9118('0xd')]('start\x20email\x20channel');this[_0x9118('0xe')]=_0x37e930[_0x9118('0xe')];this[_0x9118('0xf')]={};this[_0x9118('0x10')]=new EmailSmtp();}EmailChannel[_0x9118('0x11')][_0x9118('0x12')]=function(_0x3a1c30){var _0x4d69a3=this[_0x9118('0xe')][_0x3a1c30];var _0x51ec76={'id':_0x4d69a3['id'],'name':_0x4d69a3['name'],'key':_0x4d69a3[_0x9118('0x13')],'active':_0x4d69a3[_0x9118('0x14')],'Imap':{'status':_0x4d69a3['Imap'][_0x9118('0x15')],'messageStatus':_0x4d69a3[_0x9118('0x16')][_0x9118('0x17')],'total':_0x4d69a3[_0x9118('0x16')][_0x9118('0x18')]}};if(_[_0x9118('0x19')](md5Accounts[_0x3a1c30])){md5Accounts[_0x3a1c30]={};}var _0x42c301=md5(JSON[_0x9118('0x1a')](_0x51ec76));if(md5Accounts[_0x3a1c30][_0x9118('0x3')]!==_0x42c301){md5Accounts[_0x3a1c30][_0x9118('0x3')]=_0x42c301;io[_0x9118('0x12')]('mailAccount:update',_0x51ec76);}};EmailChannel['prototype'][_0x9118('0x1b')]=function(_0x563d91){for(var _0x45a089 in _0x563d91){if(_0x563d91[_0x9118('0x1c')](_0x45a089)){if(_0x563d91[_0x45a089][_0x9118('0x16')]&&_0x563d91[_0x45a089][_0x9118('0x14')]){var _0x48cad0=_0x563d91[_0x45a089][_0x9118('0x16')];if(!this['imapAccounts'][_0x9118('0x1c')](_0x48cad0['id'])){this['imapAccounts'][_0x48cad0['id']]=new EmailImap(_0x48cad0,_0x563d91[_0x45a089][_0x9118('0x6')]);this[_0x9118('0xf')][_0x48cad0['id']]['on']('box',this[_0x9118('0x1d')][_0x9118('0x1e')](this,_0x45a089));this[_0x9118('0xf')][_0x48cad0['id']]['on'](_0x9118('0x6'),this[_0x9118('0x1f')]['bind'](this,_0x45a089));this[_0x9118('0xf')][_0x48cad0['id']]['on'](_0x9118('0x20'),this[_0x9118('0x21')][_0x9118('0x1e')](this,_0x45a089));this[_0x9118('0xf')][_0x48cad0['id']]['on'](_0x9118('0x22'),this[_0x9118('0x23')][_0x9118('0x1e')](this,_0x45a089));}}else{if(_[_0x9118('0x19')](this[_0x9118('0xe')][_0x45a089]['Imap'])){this[_0x9118('0xe')][_0x45a089]['Imap']={};}this[_0x9118('0xe')][_0x45a089][_0x9118('0x16')][_0x9118('0x15')]='disabled';this['mailAccounts'][_0x45a089][_0x9118('0x16')][_0x9118('0x17')]='';this['emit'](_0x45a089);}}}};EmailChannel[_0x9118('0x11')][_0x9118('0x1d')]=function(_0x244dfc,_0x26a88d){if(this[_0x9118('0xe')][_0x244dfc]){this[_0x9118('0xe')][_0x244dfc][_0x9118('0x16')][_0x9118('0x15')]='connected';this[_0x9118('0xe')][_0x244dfc][_0x9118('0x16')][_0x9118('0x17')]=_0x26a88d[_0x9118('0x24')];if(_0x26a88d[_0x9118('0x25')]){this[_0x9118('0xe')][_0x244dfc][_0x9118('0x16')][_0x9118('0x18')]=_0x26a88d['messages'][_0x9118('0x18')];}return this[_0x9118('0x12')](_0x244dfc);}};EmailChannel['prototype'][_0x9118('0x1f')]=function(_0x4d3da7,_0x5c8964){logger['info'](_0x9118('0x26'),_0x5c8964[_0x9118('0x27')],_0x5c8964[_0x9118('0x28')],_0x5c8964[_0x9118('0x29')],_0x4d3da7);if(this[_0x9118('0xe')][_0x4d3da7]){return mailAccount[_0x9118('0x2a')](_0x4d3da7,_0x5c8964)[_0x9118('0x2b')](function(_0x175631){if(_0x175631){logger['info'](_0x9118('0x2c'));}})[_0x9118('0x2d')](function(_0x175f85){logger['error'](_0x9118('0x2e'),JSON[_0x9118('0x1a')](_0x175f85));});}};EmailChannel[_0x9118('0x11')]['handleImapEnd']=function(_0x356855){if(this['mailAccounts'][_0x356855]&&this['mailAccounts'][_0x356855][_0x9118('0x16')]){if(this['imapAccounts'][this[_0x9118('0xe')][_0x356855][_0x9118('0x16')]['id']]){delete this[_0x9118('0xf')][this[_0x9118('0xe')][_0x356855][_0x9118('0x16')]['id']];}this[_0x9118('0xe')][_0x356855][_0x9118('0x16')]['lastSync']=moment();this['emit'](_0x356855);}};EmailChannel[_0x9118('0x11')][_0x9118('0x23')]=function(_0x4f3862,_0x185d0c){if(this[_0x9118('0xe')][_0x4f3862]){this[_0x9118('0xe')][_0x4f3862]['Imap'][_0x9118('0x15')]=_0x9118('0x22');this[_0x9118('0xe')][_0x4f3862][_0x9118('0x16')][_0x9118('0x17')]=_0x185d0c;return this[_0x9118('0x12')](_0x4f3862);}};EmailChannel[_0x9118('0x11')][_0x9118('0x2f')]=function(_0x4a4c22,_0x32b48c){return this['smtp']['send'](_0x4a4c22,_0x32b48c);};EmailChannel[_0x9118('0x11')][_0x9118('0x30')]=function(_0x27cb73){var _0x5584c3=this;if(this[_0x9118('0xe')][_0x27cb73['id']]){if(_['isNil'](this['mailAccounts'][_0x27cb73['id']]['Smtp'])){this['mailAccounts'][_0x27cb73['id']][_0x9118('0x31')]={};}this['mailAccounts'][_0x27cb73['id']][_0x9118('0x31')][_0x9118('0x32')]=moment();return new BPromise(function(_0xe2b228,_0x4e8cdf){return _0x5584c3[_0x9118('0x10')][_0x9118('0x33')](_0x27cb73)['then'](function(_0x4c681b){_0x5584c3[_0x9118('0xe')][_0x27cb73['id']][_0x9118('0x31')]['status']=_0x9118('0x34');_0x5584c3[_0x9118('0xe')][_0x27cb73['id']]['Smtp'][_0x9118('0x17')]='';_0x5584c3[_0x9118('0x12')](_0x27cb73['id']);_0xe2b228(_0x4c681b);})[_0x9118('0x2d')](function(_0xfcaa5f){_0x5584c3['mailAccounts'][_0x27cb73['id']][_0x9118('0x31')][_0x9118('0x15')]=_0x9118('0x22');_0x5584c3['mailAccounts'][_0x27cb73['id']][_0x9118('0x31')][_0x9118('0x17')]=_0xfcaa5f;_0x5584c3[_0x9118('0x12')](_0x27cb73['id']);_0x4e8cdf(_0xfcaa5f);});});}return this['smtp'][_0x9118('0x33')](_0x27cb73);};module[_0x9118('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 68b7301..dc2e98e 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 _0xbbc6=['connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','user','getHost','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','error','handleFetchError','handleFetchEnd','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','end','handleError','connect','inherits'];(function(_0x209e21,_0x5055be){var _0x3bd214=function(_0x101782){while(--_0x101782){_0x209e21['push'](_0x209e21['shift']());}};_0x3bd214(++_0x5055be);}(_0xbbc6,0xa6));var _0x6bbc=function(_0x4fb051,_0x2c9d41){_0x4fb051=_0x4fb051-0x0;var _0x1de2f3=_0xbbc6[_0x4fb051];return _0x1de2f3;};'use strict';var fs=require('fs');var path=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var Imap=require(_0x6bbc('0x2'));var _=require(_0x6bbc('0x3'));var rs=require(_0x6bbc('0x4'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x6bbc('0x5'))[_0x6bbc('0x6')];var EventEmitter=require('events')[_0x6bbc('0x7')];var utils=require('./utils');var logger=require(_0x6bbc('0x8'))(_0x6bbc('0x9'));function EmailImap(_0x2d63ac,_0x447ef2){this[_0x6bbc('0xa')]='INBOX';this[_0x6bbc('0xb')]=this[_0x6bbc('0xc')](_0x2d63ac,_0x447ef2);this[_0x6bbc('0x2')]=new Imap(this['account']);this[_0x6bbc('0x2')]['once'](_0x6bbc('0xd'),this[_0x6bbc('0xe')][_0x6bbc('0xf')](this));this['imap']['once'](_0x6bbc('0x10'),this['handleEnd'][_0x6bbc('0xf')](this));this['imap']['on']('error',this[_0x6bbc('0x11')][_0x6bbc('0xf')](this));this['imap'][_0x6bbc('0x12')]();}util[_0x6bbc('0x13')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x9a7426,_0x30aed2){var _0x3b7930={'connTimeout':_0x9a7426['connTimeout']?_0x9a7426[_0x6bbc('0x14')]*0x3e8:0x2710,'authTimeout':_0x9a7426[_0x6bbc('0x15')]?_0x9a7426[_0x6bbc('0x15')]*0x3e8:0x1388};if(_[_0x6bbc('0x16')](_0x9a7426[_0x6bbc('0x17')])){if(_0x9a7426[_0x6bbc('0x18')]){_0x3b7930['user']=_0x9a7426['user'];_0x3b7930[_0x6bbc('0x19')]=_0x9a7426['password'];}_0x3b7930[_0x6bbc('0x1a')]=_0x9a7426[_0x6bbc('0x1a')];_0x3b7930[_0x6bbc('0x1b')]=_0x9a7426[_0x6bbc('0x1b')]||0x3e1;if(_0x9a7426[_0x6bbc('0x1c')]){_0x3b7930[_0x6bbc('0x1c')]=!![];}else{_0x3b7930[_0x6bbc('0x1c')]=![];_0x3b7930['autotls']='required';}}else{_0x3b7930[_0x6bbc('0x1d')]=_0x9a7426['user'];_0x3b7930['password']=_0x9a7426[_0x6bbc('0x19')];_0x3b7930[_0x6bbc('0x1a')]=utils[_0x6bbc('0x1e')](_0x9a7426[_0x6bbc('0x17')]);_0x3b7930[_0x6bbc('0x1b')]=0x3e1;_0x3b7930[_0x6bbc('0x1c')]=!![];}_0x3b7930[_0x6bbc('0x9')]=_0x30aed2||_0x9a7426[_0x6bbc('0x1d')]||'anonymous@xcally.com';return _0x3b7930;};EmailImap[_0x6bbc('0x1f')]['handleReady']=function(){this[_0x6bbc('0x2')][_0x6bbc('0x20')](this['mailbox'],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x21')]=function(_0x5b76f5,_0x203cf5){if(_0x5b76f5){this['handleError'](_0x5b76f5,!![]);}else{this[_0x6bbc('0x22')](_0x6bbc('0x23'),_0x203cf5);this[_0x6bbc('0x24')]();}};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x25')]=function(_0xb7392a){if(_0xb7392a){this['handleError'](_0xb7392a,!![]);}else{this[_0x6bbc('0x2')][_0x6bbc('0x10')]();}};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x24')]=function(){this[_0x6bbc('0x2')][_0x6bbc('0x26')]([_0x6bbc('0x27')],this[_0x6bbc('0x28')][_0x6bbc('0xf')](this));};EmailImap[_0x6bbc('0x1f')]['handleReadUnseen']=function(_0x581252,_0x3615aa){if(_0x581252){this[_0x6bbc('0x11')](_0x581252,!![]);}else{if(_0x3615aa[_0x6bbc('0x29')]){try{var _0x45a081=this['imap'][_0x6bbc('0x2a')](_0x3615aa,{'bodies':'','markSeen':!![]});_0x45a081['on'](_0x6bbc('0x2b'),this[_0x6bbc('0x2c')][_0x6bbc('0xf')](this));_0x45a081[_0x6bbc('0x2d')](_0x6bbc('0x2e'),this[_0x6bbc('0x2f')][_0x6bbc('0xf')](this));_0x45a081['once'](_0x6bbc('0x10'),this[_0x6bbc('0x30')][_0x6bbc('0xf')](this));}catch(_0x43603b){logger[_0x6bbc('0x2e')](_0x43603b);}}else{this['imap']['closeBox'](!![],this['handleCloseBox'][_0x6bbc('0xf')](this));}}};EmailImap['prototype'][_0x6bbc('0x2c')]=function(_0x641381,_0xf43bb0){_0x641381['on'](_0x6bbc('0x31'),this['handleMessageBody']['bind'](this));_0x641381[_0x6bbc('0x2d')]('attributes',this[_0x6bbc('0x32')]['bind'](this));_0x641381[_0x6bbc('0x2d')](_0x6bbc('0x10'),this[_0x6bbc('0x33')][_0x6bbc('0xf')](this));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x34')]=function(_0x471a62,_0x4e67d7){simpleParser(_0x471a62,{'Iconv':Iconv},this[_0x6bbc('0x35')][_0x6bbc('0xf')](this));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x32')]=function(_0x37ce7b){};EmailImap[_0x6bbc('0x1f')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x6bbc('0x35')]=function(_0x1a6e13,_0x48188d){if(_0x1a6e13){logger[_0x6bbc('0x2e')](_0x1a6e13);}else{var _0x5c3dc6=this;utils[_0x6bbc('0x36')](this[_0x6bbc('0xb')],_0x48188d,function(_0xb872f8){_0x5c3dc6[_0x6bbc('0x22')](_0x6bbc('0x9'),_0xb872f8);});}};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x30')]=function(){this[_0x6bbc('0x2')][_0x6bbc('0x37')](!![],this[_0x6bbc('0x25')][_0x6bbc('0xf')](this));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x2f')]=function(_0x3c78d0){this['handleError'](_0x3c78d0);this[_0x6bbc('0x2')][_0x6bbc('0x37')](!![],this[_0x6bbc('0x25')][_0x6bbc('0xf')](this));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x38')]=function(){this['emit'](_0x6bbc('0x10'));};EmailImap[_0x6bbc('0x1f')][_0x6bbc('0x11')]=function(_0x9ca82e,_0x1c2d7d){logger[_0x6bbc('0x2e')](_0x6bbc('0x11'),this[_0x6bbc('0xb')][_0x6bbc('0x9')],JSON[_0x6bbc('0x39')](_0x9ca82e));var _0x1cbdf4='';if(_0x9ca82e){if(_0x9ca82e[_0x6bbc('0x3a')]){_0x1cbdf4=_0x9ca82e['textCode'];}else{for(var _0x354af0 in _0x9ca82e){if(_0x9ca82e[_0x6bbc('0x3b')](_0x354af0)){_0x1cbdf4+=_[_0x6bbc('0x3c')](_0x354af0)+':\x20'+_0x9ca82e[_0x354af0]+'\x0a';}}}}if(_0x1c2d7d){this[_0x6bbc('0x2')][_0x6bbc('0x10')]();}else{this[_0x6bbc('0x22')](_0x6bbc('0x2e'),_0x1cbdf4);this[_0x6bbc('0x22')](_0x6bbc('0x10'));}};module[_0x6bbc('0x3d')]=EmailImap; \ No newline at end of file +var _0xa45c=['./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','connect','prototype','connTimeout','authTimeout','service','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','end','UNSEEN','handleReadUnseen','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','handleSimpleParser','handleMessageAttributes','handleMessageEnd','parser','handleError','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','randomstring','simpleParser','Iconv'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xa45c,0x6d));var _0xca45=function(_0x4fe731,_0x45e953){_0x4fe731=_0x4fe731-0x0;var _0x25447b=_0xa45c[_0x4fe731];return _0x25447b;};'use strict';var fs=require('fs');var path=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require(_0xca45('0x2'));var simpleParser=require('mailparser')[_0xca45('0x3')];var Iconv=require('iconv')[_0xca45('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xca45('0x5'));var logger=require(_0xca45('0x6'))(_0xca45('0x7'));function EmailImap(_0x15628b,_0x578a7b){this[_0xca45('0x8')]=_0xca45('0x9');this[_0xca45('0xa')]=this[_0xca45('0xb')](_0x15628b,_0x578a7b);this[_0xca45('0xc')]=new Imap(this['account']);this[_0xca45('0xc')][_0xca45('0xd')](_0xca45('0xe'),this[_0xca45('0xf')][_0xca45('0x10')](this));this[_0xca45('0xc')][_0xca45('0xd')]('end',this[_0xca45('0x11')][_0xca45('0x10')](this));this[_0xca45('0xc')]['on'](_0xca45('0x12'),this['handleError'][_0xca45('0x10')](this));this[_0xca45('0xc')][_0xca45('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xca45('0x14')]['getAccount']=function(_0x22ce19,_0x311bf5){var _0x28be58={'connTimeout':_0x22ce19[_0xca45('0x15')]?_0x22ce19[_0xca45('0x15')]*0x3e8:0x2710,'authTimeout':_0x22ce19[_0xca45('0x16')]?_0x22ce19[_0xca45('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x22ce19[_0xca45('0x17')])){if(_0x22ce19['authentication']){_0x28be58['user']=_0x22ce19[_0xca45('0x18')];_0x28be58[_0xca45('0x19')]=_0x22ce19['password'];}_0x28be58[_0xca45('0x1a')]=_0x22ce19[_0xca45('0x1a')];_0x28be58['port']=_0x22ce19[_0xca45('0x1b')]||0x3e1;if(_0x22ce19[_0xca45('0x1c')]){_0x28be58[_0xca45('0x1c')]=!![];}else{_0x28be58[_0xca45('0x1c')]=![];_0x28be58['autotls']=_0xca45('0x1d');}}else{_0x28be58[_0xca45('0x18')]=_0x22ce19[_0xca45('0x18')];_0x28be58[_0xca45('0x19')]=_0x22ce19['password'];_0x28be58[_0xca45('0x1a')]=utils[_0xca45('0x1e')](_0x22ce19[_0xca45('0x17')]);_0x28be58[_0xca45('0x1b')]=0x3e1;_0x28be58[_0xca45('0x1c')]=!![];}_0x28be58[_0xca45('0x7')]=_0x311bf5||_0x22ce19[_0xca45('0x18')]||_0xca45('0x1f');return _0x28be58;};EmailImap[_0xca45('0x14')]['handleReady']=function(){this[_0xca45('0xc')][_0xca45('0x20')](this[_0xca45('0x8')],![],this[_0xca45('0x21')][_0xca45('0x10')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x4d4869,_0x28d9f1){if(_0x4d4869){this['handleError'](_0x4d4869,!![]);}else{this['emit'](_0xca45('0x22'),_0x28d9f1);this[_0xca45('0x23')]();}};EmailImap[_0xca45('0x14')][_0xca45('0x24')]=function(_0x31a4ac){if(_0x31a4ac){this['handleError'](_0x31a4ac,!![]);}else{this[_0xca45('0xc')][_0xca45('0x25')]();}};EmailImap[_0xca45('0x14')]['readUnseen']=function(){this['imap']['search']([_0xca45('0x26')],this[_0xca45('0x27')]['bind'](this));};EmailImap[_0xca45('0x14')][_0xca45('0x27')]=function(_0x177ad9,_0x3e1693){if(_0x177ad9){this['handleError'](_0x177ad9,!![]);}else{if(_0x3e1693['length']){try{var _0x569933=this[_0xca45('0xc')]['fetch'](_0x3e1693,{'bodies':'','markSeen':!![]});_0x569933['on']('message',this['handleFetchMessage'][_0xca45('0x10')](this));_0x569933['once']('error',this[_0xca45('0x28')][_0xca45('0x10')](this));_0x569933[_0xca45('0xd')]('end',this[_0xca45('0x29')][_0xca45('0x10')](this));}catch(_0x4cde45){logger[_0xca45('0x12')](_0x4cde45);}}else{this[_0xca45('0xc')][_0xca45('0x2a')](!![],this[_0xca45('0x24')][_0xca45('0x10')](this));}}};EmailImap[_0xca45('0x14')][_0xca45('0x2b')]=function(_0x291dd6,_0x39b3d9){_0x291dd6['on'](_0xca45('0x2c'),this[_0xca45('0x2d')][_0xca45('0x10')](this));_0x291dd6[_0xca45('0xd')]('attributes',this['handleMessageAttributes']['bind'](this));_0x291dd6[_0xca45('0xd')](_0xca45('0x25'),this['handleMessageEnd']['bind'](this));};EmailImap[_0xca45('0x14')]['handleMessageBody']=function(_0x34cfae,_0x53202c){simpleParser(_0x34cfae,{'Iconv':Iconv},this[_0xca45('0x2e')][_0xca45('0x10')](this));};EmailImap[_0xca45('0x14')][_0xca45('0x2f')]=function(_0x32e959){};EmailImap['prototype'][_0xca45('0x30')]=function(){};EmailImap['prototype'][_0xca45('0x2e')]=function(_0x370e8b,_0x23bc79){if(_0x370e8b){logger[_0xca45('0x12')](_0x370e8b);}else{var _0x4e9b06=this;utils[_0xca45('0x31')](this[_0xca45('0xa')],_0x23bc79,function(_0x4578d8){_0x4e9b06['emit']('email',_0x4578d8);});}};EmailImap[_0xca45('0x14')][_0xca45('0x29')]=function(){this[_0xca45('0xc')][_0xca45('0x2a')](!![],this[_0xca45('0x24')][_0xca45('0x10')](this));};EmailImap[_0xca45('0x14')][_0xca45('0x28')]=function(_0x1f7eed){this[_0xca45('0x32')](_0x1f7eed);this[_0xca45('0xc')][_0xca45('0x2a')](!![],this[_0xca45('0x24')][_0xca45('0x10')](this));};EmailImap[_0xca45('0x14')][_0xca45('0x11')]=function(){this[_0xca45('0x33')](_0xca45('0x25'));};EmailImap['prototype'][_0xca45('0x32')]=function(_0x3273e8,_0x2ae7a2){logger['error'](_0xca45('0x32'),this[_0xca45('0xa')][_0xca45('0x7')],JSON[_0xca45('0x34')](_0x3273e8));var _0x4db585='';if(_0x3273e8){if(_0x3273e8[_0xca45('0x35')]){_0x4db585=_0x3273e8[_0xca45('0x35')];}else{for(var _0x429b11 in _0x3273e8){if(_0x3273e8[_0xca45('0x36')](_0x429b11)){_0x4db585+=_[_0xca45('0x37')](_0x429b11)+':\x20'+_0x3273e8[_0x429b11]+'\x0a';}}}}if(_0x2ae7a2){this[_0xca45('0xc')][_0xca45('0x25')]();}else{this[_0xca45('0x33')](_0xca45('0x12'),_0x4db585);this[_0xca45('0x33')](_0xca45('0x25'));}};module[_0xca45('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 929472f..32151ed 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 _0x390e=['send','createTransport','compile','sendMail','toString','prototype','verify','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x3977f1,_0x172f5a){var _0x2bbabd=function(_0x6b7b6){while(--_0x6b7b6){_0x3977f1['push'](_0x3977f1['shift']());}};_0x2bbabd(++_0x172f5a);}(_0x390e,0x147));var _0xe390=function(_0x379ea8,_0xaaa8f0){_0x379ea8=_0x379ea8-0x0;var _0x2d5e66=_0x390e[_0x379ea8];return _0x2d5e66;};'use strict';var nodemailer=require(_0xe390('0x0'));var BPromise=require(_0xe390('0x1'));var inlineBase64=require(_0xe390('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0xe390('0x3')]=function(_0x531ff8,_0x3d976a){return new BPromise(function(_0x91e06e,_0x3f637){var _0x355b23=nodemailer[_0xe390('0x4')](_0x531ff8);_0x355b23['use'](_0xe390('0x5'),inlineBase64());_0x355b23[_0xe390('0x6')](_0x3d976a,function(_0x2c86dd,_0x2f9b78){if(_0x2c86dd){_0x3f637(_0x2c86dd[_0xe390('0x7')]());}else{_0x91e06e(_0x2f9b78);}});});};EmailSmtp[_0xe390('0x8')][_0xe390('0x9')]=function(_0x4890a1){return new BPromise(function(_0x881874,_0x2abb6f){var _0x55c214=nodemailer[_0xe390('0x4')](_0x4890a1);_0x55c214[_0xe390('0x9')](function(_0x3aa471,_0x3dfb53){if(_0x3aa471){_0x2abb6f(_0x3aa471['toString']());}else{if(_0x3dfb53){_0x881874(_0x3dfb53);}else{_0x2abb6f('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xa99d=['sendMail','toString','verify','createTransport','Not\x20verifired','exports','nodemailer','prototype','send','use','compile'];(function(_0x4fe64c,_0x18f3a8){var _0x1f3116=function(_0xc25d01){while(--_0xc25d01){_0x4fe64c['push'](_0x4fe64c['shift']());}};_0x1f3116(++_0x18f3a8);}(_0xa99d,0x119));var _0xda99=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0xa99d[_0x962fc5];return _0x43667c;};'use strict';var nodemailer=require(_0xda99('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xda99('0x1')][_0xda99('0x2')]=function(_0x2a8da8,_0x2aa8b8){return new BPromise(function(_0xe53463,_0x5d4694){var _0x5d62d7=nodemailer['createTransport'](_0x2a8da8);_0x5d62d7[_0xda99('0x3')](_0xda99('0x4'),inlineBase64());_0x5d62d7[_0xda99('0x5')](_0x2aa8b8,function(_0x4132ae,_0x299028){if(_0x4132ae){_0x5d4694(_0x4132ae[_0xda99('0x6')]());}else{_0xe53463(_0x299028);}});});};EmailSmtp[_0xda99('0x1')][_0xda99('0x7')]=function(_0x50f5ea){return new BPromise(function(_0x53500e,_0x3bdd89){var _0xd691c6=nodemailer[_0xda99('0x8')](_0x50f5ea);_0xd691c6[_0xda99('0x7')](function(_0x4a3032,_0x470eb8){if(_0x4a3032){_0x3bdd89(_0x4a3032['toString']());}else{if(_0x470eb8){_0x53500e(_0x470eb8);}else{_0x3bdd89(_0xda99('0x9'));}}});});};module[_0xda99('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index b5bff68..3eee4e9 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 _0xa8f3=['../../../config/environment','head','value','address','anonymous','@xcally.com','name','split','length','join','Anonymous','isEmpty','generate','html','replace','body','textAsHtml','message','originCc','includes','originTo','bcc','attachments','attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email'];(function(_0x1a9b94,_0x4d763e){var _0x379102=function(_0x1d9e7c){while(--_0x1d9e7c){_0x1a9b94['push'](_0x1a9b94['shift']());}};_0x379102(++_0x4d763e);}(_0xa8f3,0xc1));var _0x3a8f=function(_0x436bb4,_0x582e5f){_0x436bb4=_0x436bb4-0x0;var _0x43ceaf=_0xa8f3[_0x436bb4];return _0x43ceaf;};'use strict';var _=require(_0x3a8f('0x0'));var moment=require(_0x3a8f('0x1'));var random=require(_0x3a8f('0x2'));var fs=require('fs');var path=require(_0x3a8f('0x3'));var util=require(_0x3a8f('0x4'));var tnef=require(_0x3a8f('0x5'));var logger=require(_0x3a8f('0x6'))(_0x3a8f('0x7'));var config=require(_0x3a8f('0x8'));function getAddress(_0x341a8f){var _0x714540=_[_0x3a8f('0x9')](_0x341a8f[_0x3a8f('0xa')]);return _0x714540&&_0x714540[_0x3a8f('0xb')]?_0x714540[_0x3a8f('0xb')]:_0x3a8f('0xc')+random['generate'](0x6)+_0x3a8f('0xd');}function getFirstName(_0x649b72){var _0xca2281=_[_0x3a8f('0x9')](_0x649b72[_0x3a8f('0xa')]);if(_0xca2281&&_0xca2281[_0x3a8f('0xe')]){var _0x2f6fb9=_0xca2281[_0x3a8f('0xe')][_0x3a8f('0xf')](/\s+/);return _0x2f6fb9[_0x3a8f('0x10')]?_0x2f6fb9['slice'](0x0,-0x1)[_0x3a8f('0x11')]('\x20'):_0xca2281['name'];}return _0x3a8f('0x12');}function getLastName(_0x4b2d34){var _0x1b9d16=_[_0x3a8f('0x9')](_0x4b2d34[_0x3a8f('0xa')]);if(_0x1b9d16&&_0x1b9d16[_0x3a8f('0xe')]){var _0x5dd9b6=_0x1b9d16[_0x3a8f('0xe')][_0x3a8f('0xf')](/\s+/);return _0x5dd9b6[_0x3a8f('0x10')]>0x1?_0x5dd9b6['pop']():'';}return'';}function getMails(_0x4eb7e0,_0x4104b4){var _0x9f0413='';for(var _0x3b5d1c=0x0;_0x3b5d1c<_0x4104b4[_0x3a8f('0xa')][_0x3a8f('0x10')];_0x3b5d1c+=0x1){if(_0x4104b4[_0x3a8f('0xa')][_0x3b5d1c][_0x3a8f('0xb')]!==_0x4eb7e0){if(!_[_0x3a8f('0x13')](_0x9f0413)){_0x9f0413+=',';}_0x9f0413+=_0x4104b4[_0x3a8f('0xa')][_0x3b5d1c][_0x3a8f('0xe')]||_0x4104b4[_0x3a8f('0xa')][_0x3b5d1c][_0x3a8f('0xb')]||'';_0x9f0413+='\x20<';_0x9f0413+=_0x4104b4[_0x3a8f('0xa')][_0x3b5d1c][_0x3a8f('0xb')]?_0x4104b4[_0x3a8f('0xa')][_0x3b5d1c][_0x3a8f('0xb')]:_0x3a8f('0xc')+random[_0x3a8f('0x14')](0x6)+_0x3a8f('0xd');_0x9f0413+='>';}}return _0x9f0413;}function parseEmail(_0x22a7e8,_0x320a3d,_0x123aca){if(_0x320a3d[_0x3a8f('0x15')]){var _0x42e710=/)<[^<]*)*<\/script>/gi;while(_0x42e710['test'](_0x320a3d[_0x3a8f('0x15')])){_0x320a3d[_0x3a8f('0x15')]=_0x320a3d['html'][_0x3a8f('0x16')](_0x42e710,'');}_0x123aca[_0x3a8f('0x17')]=_0x320a3d[_0x3a8f('0x15')];}else{_0x123aca[_0x3a8f('0x17')]=_0x320a3d[_0x3a8f('0x18')];}if(_0x123aca[_0x3a8f('0x17')]){_0x123aca[_0x3a8f('0x17')]=_0x123aca[_0x3a8f('0x17')]['replace'](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','node-tnef','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','length','slice','Anonymous','isEmpty','html','test','replace','body','textAsHtml','0x1?_0x1a9e69['pop']():'';}return'';}function getMails(_0x12e7fe,_0x130d8d){var _0x344575='';for(var _0x201779=0x0;_0x201779<_0x130d8d['value'][_0x4e1c('0xd')];_0x201779+=0x1){if(_0x130d8d[_0x4e1c('0x6')][_0x201779][_0x4e1c('0x7')]!==_0x12e7fe){if(!_[_0x4e1c('0x10')](_0x344575)){_0x344575+=',';}_0x344575+=_0x130d8d[_0x4e1c('0x6')][_0x201779][_0x4e1c('0xc')]||_0x130d8d['value'][_0x201779][_0x4e1c('0x7')]||'';_0x344575+='\x20<';_0x344575+=_0x130d8d[_0x4e1c('0x6')][_0x201779][_0x4e1c('0x7')]?_0x130d8d[_0x4e1c('0x6')][_0x201779][_0x4e1c('0x7')]:_0x4e1c('0x8')+random[_0x4e1c('0x9')](0x6)+'@xcally.com';_0x344575+='>';}}return _0x344575;}function parseEmail(_0x2dbfe9,_0x426864,_0x391ade){if(_0x426864[_0x4e1c('0x11')]){var _0x33da37=/)<[^<]*)*<\/script>/gi;while(_0x33da37[_0x4e1c('0x12')](_0x426864[_0x4e1c('0x11')])){_0x426864['html']=_0x426864[_0x4e1c('0x11')][_0x4e1c('0x13')](_0x33da37,'');}_0x391ade[_0x4e1c('0x14')]=_0x426864[_0x4e1c('0x11')];}else{_0x391ade[_0x4e1c('0x14')]=_0x426864[_0x4e1c('0x15')];}if(_0x391ade[_0x4e1c('0x14')]){_0x391ade[_0x4e1c('0x14')]=_0x391ade[_0x4e1c('0x14')]['replace'](/0x0){if(this[_0x4236ea+'Capacity']>0x0&&this[_0x4236ea+'CurrentCapacity']>=this[_0x4236ea+_0xbfe4('0x24')]){return'maxcapacity';}else{return _0xbfe4('0x25');}}else{return'idle';}};Agent['prototype'][_0xbfe4('0x20')]=function(){var _0x31d9b2=[_0xbfe4('0x26'),_0xbfe4('0x27'),_0xbfe4('0x28'),'fax','sms'];for(var _0x5f3e2d=0x0;_0x5f3e2d<_0x31d9b2[_0xbfe4('0x29')];_0x5f3e2d+=0x1){var _0x2f863f=this[_0xbfe4('0x22')](_0x31d9b2[_0x5f3e2d]);if(this[_0x31d9b2[_0x5f3e2d]+_0xbfe4('0x2a')]!==_0x2f863f){this[_0x31d9b2[_0x5f3e2d]+_0xbfe4('0x2b')]=_[_0xbfe4('0x2c')](moment()[_0xbfe4('0x2d')]('x'));}this[_0x31d9b2[_0x5f3e2d]+_0xbfe4('0x2a')]=_0x2f863f;}var _0x3103ac={'id':this['id'],'name':this[_0xbfe4('0x8')],'online':this[_0xbfe4('0x9')],'voicePause':this[_0xbfe4('0xa')],'chatPause':this[_0xbfe4('0xb')],'mailPause':this[_0xbfe4('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0xbfe4('0xd')],'openchannelPause':this[_0xbfe4('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xbfe4('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xbfe4('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xbfe4('0x2e')],'mailCapacity':this[_0xbfe4('0x13')],'mailCurrentCapacity':this[_0xbfe4('0x2f')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xbfe4('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xbfe4('0x18')],'smsStatus':this[_0xbfe4('0x19')],'smsStatusTime':this[_0xbfe4('0x1a')],'smsCapacity':this[_0xbfe4('0x1b')],'smsCurrentCapacity':this[_0xbfe4('0x1c')],'openchannelStatus':this[_0xbfe4('0x30')],'openchannelStatusTime':this[_0xbfe4('0x31')],'openchannelCapacity':this[_0xbfe4('0x32')],'openchannelCurrentCapacity':this[_0xbfe4('0x1d')],'busy':this[_0xbfe4('0x1e')],'busyQueue':this[_0xbfe4('0x1f')]};var _0x2382e8=md5(JSON['stringify'](_0x3103ac));if(this[_0xbfe4('0x1')]!==_0x2382e8){this[_0xbfe4('0x1')]=_0x2382e8;io[_0xbfe4('0x33')](_0xbfe4('0x34'),_0x3103ac);}};module['exports']=Agent; \ No newline at end of file +var _0x26a6=['chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','mail','chat','openchannel','fax','length','getChannelStatus','Status','StatusTime','toNumber','format','chatStatusTime','chatCurrentCapacity','smsStatusTime','busyQueue','stringify','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown'];(function(_0x529403,_0x245295){var _0x34cda6=function(_0x6f955c){while(--_0x6f955c){_0x529403['push'](_0x529403['shift']());}};_0x34cda6(++_0x245295);}(_0x26a6,0x133));var _0x626a=function(_0x56e81b,_0x23c42b){_0x56e81b=_0x56e81b-0x0;var _0x21fa49=_0x26a6[_0x56e81b];return _0x21fa49;};'use strict';var _=require('lodash');var moment=require(_0x626a('0x0'));var md5=require(_0x626a('0x1'));var Redis=require(_0x626a('0x2'));var config=require(_0x626a('0x3'));config[_0x626a('0x4')]=_[_0x626a('0x5')](config[_0x626a('0x4')],{'host':_0x626a('0x6'),'port':0x18eb});var io=require(_0x626a('0x7'))(new Redis(config['redis']));function Agent(_0x563e11){this['id']=_0x563e11['id']||0x0;this[_0x626a('0x8')]=_0x563e11[_0x626a('0x8')]||'';this[_0x626a('0x9')]=_0x563e11[_0x626a('0x9')]||!![];this['voicePause']=_0x563e11[_0x626a('0xa')]||![];this[_0x626a('0xb')]=_0x563e11[_0x626a('0xb')]||![];this['mailPause']=_0x563e11['mailPause']||![];this['faxPause']=_0x563e11[_0x626a('0xc')]||![];this[_0x626a('0xd')]=_0x563e11[_0x626a('0xd')]||![];this[_0x626a('0xe')]=_0x563e11[_0x626a('0xe')]||![];this[_0x626a('0xf')]=_0x626a('0x10');this['chatStatusTime']=0x0;this[_0x626a('0x11')]=_0x563e11[_0x626a('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x626a('0x12')]=_0x626a('0x10');this['mailStatusTime']=0x0;this[_0x626a('0x13')]=_0x563e11[_0x626a('0x13')]||0x0;this[_0x626a('0x14')]=0x0;this[_0x626a('0x15')]='unknown';this[_0x626a('0x16')]=0x0;this[_0x626a('0x17')]=_0x563e11[_0x626a('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x626a('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x626a('0x19')]=_0x563e11[_0x626a('0x19')]||0x0;this[_0x626a('0x1a')]=0x0;this[_0x626a('0x1b')]=_0x626a('0x10');this[_0x626a('0x1c')]=0x0;this['openchannelCapacity']=_0x563e11[_0x626a('0x1d')]||0x0;this[_0x626a('0x1e')]=0x0;this[_0x626a('0x1f')]=![];this['busyQueue']=undefined;this[_0x626a('0x1')]='';this[_0x626a('0x20')]();}Agent[_0x626a('0x21')]['getChannelStatus']=function(_0x3de4fc){if(this[_0x3de4fc+_0x626a('0x22')]>0x0){if(this[_0x3de4fc+_0x626a('0x23')]>0x0&&this[_0x3de4fc+_0x626a('0x22')]>=this[_0x3de4fc+_0x626a('0x23')]){return _0x626a('0x24');}else{return'working';}}else{return'idle';}};Agent['prototype']['updateRealtime']=function(){var _0x568704=[_0x626a('0x25'),_0x626a('0x26'),_0x626a('0x27'),_0x626a('0x28'),'sms'];for(var _0x194cff=0x0;_0x194cff<_0x568704[_0x626a('0x29')];_0x194cff+=0x1){var _0x5f2f8c=this[_0x626a('0x2a')](_0x568704[_0x194cff]);if(this[_0x568704[_0x194cff]+_0x626a('0x2b')]!==_0x5f2f8c){this[_0x568704[_0x194cff]+_0x626a('0x2c')]=_[_0x626a('0x2d')](moment()[_0x626a('0x2e')]('x'));}this[_0x568704[_0x194cff]+_0x626a('0x2b')]=_0x5f2f8c;}var _0x2104b4={'id':this['id'],'name':this['name'],'online':this[_0x626a('0x9')],'voicePause':this[_0x626a('0xa')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x626a('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x626a('0xe')],'chatStatus':this[_0x626a('0xf')],'chatStatusTime':this[_0x626a('0x2f')],'chatCapacity':this[_0x626a('0x11')],'chatCurrentCapacity':this[_0x626a('0x30')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x626a('0x13')],'mailCurrentCapacity':this[_0x626a('0x14')],'faxStatus':this[_0x626a('0x15')],'faxStatusTime':this[_0x626a('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x626a('0x18')],'smsStatusTime':this[_0x626a('0x31')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x626a('0x1a')],'openchannelStatus':this[_0x626a('0x1b')],'openchannelStatusTime':this[_0x626a('0x1c')],'openchannelCapacity':this[_0x626a('0x1d')],'openchannelCurrentCapacity':this[_0x626a('0x1e')],'busy':this['busy'],'busyQueue':this[_0x626a('0x32')]};var _0x474339=md5(JSON[_0x626a('0x33')](_0x2104b4));if(this[_0x626a('0x1')]!==_0x474339){this[_0x626a('0x1')]=_0x474339;io[_0x626a('0x34')](_0x626a('0x35'),_0x2104b4);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4b9167d..b595942 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 _0x7185=['loggedIn','online','available','name','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','waiting','md5','updateRouting','prototype','mapAgentsId','_rr','map','Agents','updateRealtime'];(function(_0xa9e3ac,_0x52d22f){var _0x2b0830=function(_0xd3f7d9){while(--_0xd3f7d9){_0xa9e3ac['push'](_0xa9e3ac['shift']());}};_0x2b0830(++_0x52d22f);}(_0x7185,0x1ae));var _0x5718=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7185[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5718('0x0'));var md5=require('md5');var util=require(_0x5718('0x1'));var Redis=require(_0x5718('0x2'));var config=require(_0x5718('0x3'));config[_0x5718('0x4')]=_[_0x5718('0x5')](config['redis'],{'host':_0x5718('0x6'),'port':0x18eb});var io=require(_0x5718('0x7'))(new Redis(config[_0x5718('0x4')]));function ChatQueue(_0x4c4494){this['id']=_0x4c4494['id']||0x0;this['name']=_0x4c4494['name']||'';this[_0x5718('0x8')]=_0x4c4494['timeout']||0xa;this[_0x5718('0x9')]=_0x4c4494['strategy']||_0x5718('0xa');this['Agents']=_0x4c4494['Agents'];this['mapAgentsId']={};this[_0x5718('0xb')]=0x0;this[_0x5718('0xc')]='';this[_0x5718('0xd')]();this['updateRealtime']();}ChatQueue[_0x5718('0xe')][_0x5718('0xd')]=function(){var _0x167245=this[_0x5718('0xf')][_0x5718('0x10')];this[_0x5718('0xf')]=_[_0x5718('0x11')](this[_0x5718('0x12')],'id');this['mapAgentsId'][_0x5718('0x10')]=_0x167245;};ChatQueue[_0x5718('0xe')][_0x5718('0x13')]=function(){this[_0x5718('0x14')]=0x0;this['paused']=0x0;for(var _0x5d401f=0x0;_0x5d401f=0x0?this['available']:0x0;var _0xb24eef={'id':this['id'],'available':this[_0x5718('0x16')],'loggedIn':this[_0x5718('0x14')],'name':this[_0x5718('0x17')],'paused':this['paused'],'waiting':this[_0x5718('0xb')]};var _0x118909=md5(JSON[_0x5718('0x18')](_0xb24eef));if(this[_0x5718('0xc')]!==_0x118909){this[_0x5718('0xc')]=_0x118909;io['to'](util[_0x5718('0x19')](_0x5718('0x1a'),_0xb24eef[_0x5718('0x17')]))[_0x5718('0x1b')](_0x5718('0x1c'),_0xb24eef);}};module[_0x5718('0x1d')]=ChatQueue; \ No newline at end of file +var _0xb987=['emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xb987,0x16b));var _0x7b98=function(_0x4cc809,_0xf6d616){_0x4cc809=_0x4cc809-0x0;var _0x5556a6=_0xb987[_0x4cc809];return _0x5556a6;};'use strict';var _=require(_0x7b98('0x0'));var md5=require(_0x7b98('0x1'));var util=require('util');var Redis=require(_0x7b98('0x2'));var config=require(_0x7b98('0x3'));config[_0x7b98('0x4')]=_[_0x7b98('0x5')](config['redis'],{'host':_0x7b98('0x6'),'port':0x18eb});var io=require(_0x7b98('0x7'))(new Redis(config[_0x7b98('0x4')]));function ChatQueue(_0x4b076e){this['id']=_0x4b076e['id']||0x0;this['name']=_0x4b076e[_0x7b98('0x8')]||'';this[_0x7b98('0x9')]=_0x4b076e[_0x7b98('0x9')]||0xa;this[_0x7b98('0xa')]=_0x4b076e[_0x7b98('0xa')]||'beepall';this[_0x7b98('0xb')]=_0x4b076e[_0x7b98('0xb')];this[_0x7b98('0xc')]={};this[_0x7b98('0xd')]=0x0;this[_0x7b98('0x1')]='';this[_0x7b98('0xe')]();this[_0x7b98('0xf')]();}ChatQueue['prototype'][_0x7b98('0xe')]=function(){var _0x120859=this['mapAgentsId'][_0x7b98('0x10')];this[_0x7b98('0xc')]=_['map'](this[_0x7b98('0xb')],'id');this[_0x7b98('0xc')][_0x7b98('0x10')]=_0x120859;};ChatQueue[_0x7b98('0x11')]['updateRealtime']=function(){this[_0x7b98('0x12')]=0x0;this[_0x7b98('0x13')]=0x0;for(var _0x4d1493=0x0;_0x4d1493=0x0?this[_0x7b98('0x17')]:0x0;var _0x40c7b2={'id':this['id'],'available':this[_0x7b98('0x17')],'loggedIn':this[_0x7b98('0x12')],'name':this[_0x7b98('0x8')],'paused':this['paused'],'waiting':this[_0x7b98('0xd')]};var _0x1a8b8f=md5(JSON[_0x7b98('0x18')](_0x40c7b2));if(this[_0x7b98('0x1')]!==_0x1a8b8f){this['md5']=_0x1a8b8f;io['to'](util[_0x7b98('0x19')](_0x7b98('0x1a'),_0x40c7b2[_0x7b98('0x8')]))[_0x7b98('0x1b')](_0x7b98('0x1c'),_0x40c7b2);}};module[_0x7b98('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 3fd50b9..c0eca2b 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 _0x3a9a=['online','paused','available','fax:queue:%s','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','length'];(function(_0x15ccbc,_0x525e52){var _0x1763c6=function(_0x17fba5){while(--_0x17fba5){_0x15ccbc['push'](_0x15ccbc['shift']());}};_0x1763c6(++_0x525e52);}(_0x3a9a,0x131));var _0xa3a9=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x3a9a[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xa3a9('0x0'));var md5=require(_0xa3a9('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xa3a9('0x2'));config[_0xa3a9('0x3')]=_[_0xa3a9('0x4')](config[_0xa3a9('0x3')],{'host':_0xa3a9('0x5'),'port':0x18eb});var io=require(_0xa3a9('0x6'))(new Redis(config['redis']));function FaxQueue(_0x4acd4d){this['id']=_0x4acd4d['id']||0x0;this['name']=_0x4acd4d[_0xa3a9('0x7')]||'';this[_0xa3a9('0x8')]=_0x4acd4d[_0xa3a9('0x8')]||0xa;this[_0xa3a9('0x9')]=_0x4acd4d['strategy']||_0xa3a9('0xa');this[_0xa3a9('0xb')]=_0x4acd4d['Agents'];this[_0xa3a9('0xc')]={};this[_0xa3a9('0xd')]=0x0;this[_0xa3a9('0x1')]='';this[_0xa3a9('0xe')]();this[_0xa3a9('0xf')]();}FaxQueue['prototype'][_0xa3a9('0xe')]=function(){var _0x58969b=this[_0xa3a9('0xc')][_0xa3a9('0x10')];this[_0xa3a9('0xc')]=_['map'](this['Agents'],'id');this[_0xa3a9('0xc')][_0xa3a9('0x10')]=_0x58969b;};FaxQueue[_0xa3a9('0x11')]['updateRealtime']=function(){this[_0xa3a9('0x12')]=0x0;this['paused']=0x0;for(var _0x118ae=0x0;_0x118ae=0x0?this[_0xa3a9('0x16')]:0x0;var _0x28b45b={'id':this['id'],'available':this[_0xa3a9('0x16')],'loggedIn':this[_0xa3a9('0x12')],'name':this['name'],'paused':this[_0xa3a9('0x15')],'waiting':this[_0xa3a9('0xd')]};var _0x51e952=md5(JSON['stringify'](_0x28b45b));if(this[_0xa3a9('0x1')]!==_0x51e952){this[_0xa3a9('0x1')]=_0x51e952;io['to'](util['format'](_0xa3a9('0x17'),_0x28b45b[_0xa3a9('0x7')]))['emit']('fax_queue:save',_0x28b45b);}};module[_0xa3a9('0x18')]=FaxQueue; \ No newline at end of file +var _0x9506=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','paused','online','loggedIn','available','stringify','format','fax_queue:save','exports','lodash','md5','../../../config/environment'];(function(_0xd25652,_0x3fc588){var _0x7eeb71=function(_0x38296d){while(--_0x38296d){_0xd25652['push'](_0xd25652['shift']());}};_0x7eeb71(++_0x3fc588);}(_0x9506,0x14f));var _0x6950=function(_0x12b0db,_0x15060e){_0x12b0db=_0x12b0db-0x0;var _0x28299f=_0x9506[_0x12b0db];return _0x28299f;};'use strict';var _=require(_0x6950('0x0'));var md5=require(_0x6950('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x6950('0x2'));config[_0x6950('0x3')]=_[_0x6950('0x4')](config[_0x6950('0x3')],{'host':_0x6950('0x5'),'port':0x18eb});var io=require(_0x6950('0x6'))(new Redis(config[_0x6950('0x3')]));function FaxQueue(_0x549d5c){this['id']=_0x549d5c['id']||0x0;this[_0x6950('0x7')]=_0x549d5c[_0x6950('0x7')]||'';this['timeout']=_0x549d5c[_0x6950('0x8')]||0xa;this[_0x6950('0x9')]=_0x549d5c[_0x6950('0x9')]||'beepall';this[_0x6950('0xa')]=_0x549d5c[_0x6950('0xa')];this[_0x6950('0xb')]={};this[_0x6950('0xc')]=0x0;this[_0x6950('0x1')]='';this['updateRouting']();this[_0x6950('0xd')]();}FaxQueue[_0x6950('0xe')][_0x6950('0xf')]=function(){var _0x21bd69=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x6950('0x10')](this[_0x6950('0xa')],'id');this[_0x6950('0xb')][_0x6950('0x11')]=_0x21bd69;};FaxQueue[_0x6950('0xe')][_0x6950('0xd')]=function(){this['loggedIn']=0x0;this[_0x6950('0x12')]=0x0;for(var _0x54e396=0x0;_0x54e396=0x0?this[_0x6950('0x15')]:0x0;var _0x42e759={'id':this['id'],'available':this[_0x6950('0x15')],'loggedIn':this[_0x6950('0x14')],'name':this['name'],'paused':this[_0x6950('0x12')],'waiting':this[_0x6950('0xc')]};var _0x6a52a3=md5(JSON[_0x6950('0x16')](_0x42e759));if(this[_0x6950('0x1')]!==_0x6a52a3){this['md5']=_0x6a52a3;io['to'](util[_0x6950('0x17')]('fax:queue:%s',_0x42e759[_0x6950('0x7')]))['emit'](_0x6950('0x18'),_0x42e759);}};module[_0x6950('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 86a192b..fb5492b 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 _0x2ac0=['name','Intervals','exports'];(function(_0x54de80,_0x144f2b){var _0x3f3f8a=function(_0x4871b6){while(--_0x4871b6){_0x54de80['push'](_0x54de80['shift']());}};_0x3f3f8a(++_0x144f2b);}(_0x2ac0,0xcc));var _0x02ac=function(_0x5256e1,_0x4915ad){_0x5256e1=_0x5256e1-0x0;var _0x49554b=_0x2ac0[_0x5256e1];return _0x49554b;};'use strict';function Interval(_0x5df919){this['id']=_0x5df919['id']||0x0;this[_0x02ac('0x0')]=_0x5df919[_0x02ac('0x0')]||'';this[_0x02ac('0x1')]=_0x5df919[_0x02ac('0x1')]||{};}module[_0x02ac('0x2')]=Interval; \ No newline at end of file +var _0x565d=['name','Intervals','exports'];(function(_0x304936,_0x260419){var _0x10349b=function(_0x40c2ce){while(--_0x40c2ce){_0x304936['push'](_0x304936['shift']());}};_0x10349b(++_0x260419);}(_0x565d,0x1f2));var _0xd565=function(_0x252475,_0x556937){_0x252475=_0x252475-0x0;var _0x1a0556=_0x565d[_0x252475];return _0x1a0556;};'use strict';function Interval(_0xa81c84){this['id']=_0xa81c84['id']||0x0;this[_0xd565('0x0')]=_0xa81c84[_0xd565('0x0')]||'';this[_0xd565('0x1')]=_0xa81c84[_0xd565('0x1')]||{};}module[_0xd565('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 5bd4ca0..95bd4db 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 _0xf417=['_rr','map','loggedIn','length','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','prototype','mapAgentsId'];(function(_0x24cc7f,_0x2e9ff6){var _0x2cc87f=function(_0x4dfa6d){while(--_0x4dfa6d){_0x24cc7f['push'](_0x24cc7f['shift']());}};_0x2cc87f(++_0x2e9ff6);}(_0xf417,0x8f));var _0x7f41=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xf417[_0x595013];return _0x2a29e3;};'use strict';var _=require('lodash');var md5=require(_0x7f41('0x0'));var util=require(_0x7f41('0x1'));var Redis=require(_0x7f41('0x2'));var config=require('../../../config/environment');config[_0x7f41('0x3')]=_['defaults'](config['redis'],{'host':_0x7f41('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x5ad014){this['id']=_0x5ad014['id']||0x0;this['name']=_0x5ad014[_0x7f41('0x5')]||'';this['timeout']=_0x5ad014[_0x7f41('0x6')]||0xa;this[_0x7f41('0x7')]=_0x5ad014['strategy']||_0x7f41('0x8');this['Agents']=_0x5ad014[_0x7f41('0x9')];this['mapAgentsId']={};this[_0x7f41('0xa')]=0x0;this[_0x7f41('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x7f41('0xb')]['updateRouting']=function(){var _0x4bc8ff=this[_0x7f41('0xc')][_0x7f41('0xd')];this[_0x7f41('0xc')]=_[_0x7f41('0xe')](this[_0x7f41('0x9')],'id');this[_0x7f41('0xc')][_0x7f41('0xd')]=_0x4bc8ff;};MailQueue['prototype']['updateRealtime']=function(){this[_0x7f41('0xf')]=0x0;this['paused']=0x0;for(var _0x568eea=0x0;_0x568eea=0x0?this['available']:0x0;var _0xeb2394={'id':this['id'],'available':this[_0x7f41('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x7f41('0x5')],'paused':this[_0x7f41('0x12')],'waiting':this[_0x7f41('0xa')]};var _0x493172=md5(JSON[_0x7f41('0x14')](_0xeb2394));if(this['md5']!==_0x493172){this['md5']=_0x493172;io['to'](util[_0x7f41('0x15')](_0x7f41('0x16'),_0xeb2394[_0x7f41('0x5')]))[_0x7f41('0x17')](_0x7f41('0x18'),_0xeb2394);}};module[_0x7f41('0x19')]=MailQueue; \ No newline at end of file +var _0x6822=['waiting','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn','mailPause','available'];(function(_0x3fef56,_0x386b57){var _0x1c087e=function(_0x1a32de){while(--_0x1a32de){_0x3fef56['push'](_0x3fef56['shift']());}};_0x1c087e(++_0x386b57);}(_0x6822,0xca));var _0x2682=function(_0x417393,_0x4028ea){_0x417393=_0x417393-0x0;var _0x107a07=_0x6822[_0x417393];return _0x107a07;};'use strict';var _=require(_0x2682('0x0'));var md5=require(_0x2682('0x1'));var util=require(_0x2682('0x2'));var Redis=require(_0x2682('0x3'));var config=require(_0x2682('0x4'));config[_0x2682('0x5')]=_[_0x2682('0x6')](config[_0x2682('0x5')],{'host':_0x2682('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2682('0x5')]));function MailQueue(_0x5af60f){this['id']=_0x5af60f['id']||0x0;this[_0x2682('0x8')]=_0x5af60f[_0x2682('0x8')]||'';this[_0x2682('0x9')]=_0x5af60f['timeout']||0xa;this['strategy']=_0x5af60f['strategy']||_0x2682('0xa');this[_0x2682('0xb')]=_0x5af60f[_0x2682('0xb')];this[_0x2682('0xc')]={};this['waiting']=0x0;this[_0x2682('0x1')]='';this[_0x2682('0xd')]();this[_0x2682('0xe')]();}MailQueue[_0x2682('0xf')]['updateRouting']=function(){var _0xfa438e=this[_0x2682('0xc')][_0x2682('0x10')];this[_0x2682('0xc')]=_['map'](this[_0x2682('0xb')],'id');this[_0x2682('0xc')][_0x2682('0x10')]=_0xfa438e;};MailQueue[_0x2682('0xf')][_0x2682('0xe')]=function(){this['loggedIn']=0x0;this[_0x2682('0x11')]=0x0;for(var _0x110ecb=0x0;_0x110ecb=0x0?this[_0x2682('0x15')]:0x0;var _0x14e590={'id':this['id'],'available':this[_0x2682('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x2682('0x8')],'paused':this['paused'],'waiting':this[_0x2682('0x16')]};var _0x48792c=md5(JSON[_0x2682('0x17')](_0x14e590));if(this[_0x2682('0x1')]!==_0x48792c){this[_0x2682('0x1')]=_0x48792c;io['to'](util[_0x2682('0x18')]('mail:queue:%s',_0x14e590[_0x2682('0x8')]))[_0x2682('0x19')](_0x2682('0x1a'),_0x14e590);}};module[_0x2682('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index cffc1fe..adc44bd 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 _0xc3a1=['map','length','online','loggedIn','openchannelPause','paused','available','stringify','format','emit','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0x38eb66,_0x3ed3e4){var _0x429ece=function(_0x234e13){while(--_0x234e13){_0x38eb66['push'](_0x38eb66['shift']());}};_0x429ece(++_0x3ed3e4);}(_0xc3a1,0x118));var _0x1c3a=function(_0x4979c4,_0x386c31){_0x4979c4=_0x4979c4-0x0;var _0xeae64a=_0xc3a1[_0x4979c4];return _0xeae64a;};'use strict';var _=require('lodash');var md5=require(_0x1c3a('0x0'));var util=require(_0x1c3a('0x1'));var Redis=require(_0x1c3a('0x2'));var config=require('../../../config/environment');config[_0x1c3a('0x3')]=_[_0x1c3a('0x4')](config[_0x1c3a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x1c3a('0x5'))(new Redis(config[_0x1c3a('0x3')]));function OpenchannelQueue(_0x3342fe){this['id']=_0x3342fe['id']||0x0;this[_0x1c3a('0x6')]=_0x3342fe[_0x1c3a('0x6')]||'';this[_0x1c3a('0x7')]=_0x3342fe[_0x1c3a('0x7')]||0xa;this['strategy']=_0x3342fe[_0x1c3a('0x8')]||_0x1c3a('0x9');this[_0x1c3a('0xa')]=_0x3342fe[_0x1c3a('0xa')];this['mapAgentsId']={};this[_0x1c3a('0xb')]=0x0;this['md5']='';this[_0x1c3a('0xc')]();this[_0x1c3a('0xd')]();}OpenchannelQueue[_0x1c3a('0xe')][_0x1c3a('0xc')]=function(){var _0x23f71f=this[_0x1c3a('0xf')][_0x1c3a('0x10')];this[_0x1c3a('0xf')]=_[_0x1c3a('0x11')](this['Agents'],'id');this[_0x1c3a('0xf')][_0x1c3a('0x10')]=_0x23f71f;};OpenchannelQueue[_0x1c3a('0xe')][_0x1c3a('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1fe8ac=0x0;_0x1fe8ac=0x0?this[_0x1c3a('0x17')]:0x0;var _0x1e472a={'id':this['id'],'available':this[_0x1c3a('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x1c3a('0x6')],'paused':this['paused'],'waiting':this[_0x1c3a('0xb')]};var _0x28ea8a=md5(JSON[_0x1c3a('0x18')](_0x1e472a));if(this[_0x1c3a('0x0')]!==_0x28ea8a){this[_0x1c3a('0x0')]=_0x28ea8a;io['to'](util[_0x1c3a('0x19')]('openchannel:queue:%s',_0x1e472a[_0x1c3a('0x6')]))[_0x1c3a('0x1a')]('openchannel_queue:save',_0x1e472a);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x5044=['online','openchannelPause','paused','available','waiting','format','emit','openchannel_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','updateRouting','_rr','map','loggedIn','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5044,0x1ef));var _0x4504=function(_0x4df7a7,_0x357bb5){_0x4df7a7=_0x4df7a7-0x0;var _0x17528d=_0x5044[_0x4df7a7];return _0x17528d;};'use strict';var _=require('lodash');var md5=require(_0x4504('0x0'));var util=require('util');var Redis=require(_0x4504('0x1'));var config=require(_0x4504('0x2'));config[_0x4504('0x3')]=_['defaults'](config[_0x4504('0x3')],{'host':_0x4504('0x4'),'port':0x18eb});var io=require(_0x4504('0x5'))(new Redis(config[_0x4504('0x3')]));function OpenchannelQueue(_0x2e2664){this['id']=_0x2e2664['id']||0x0;this['name']=_0x2e2664[_0x4504('0x6')]||'';this[_0x4504('0x7')]=_0x2e2664['timeout']||0xa;this[_0x4504('0x8')]=_0x2e2664[_0x4504('0x8')]||_0x4504('0x9');this[_0x4504('0xa')]=_0x2e2664[_0x4504('0xa')];this[_0x4504('0xb')]={};this['waiting']=0x0;this[_0x4504('0x0')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x4504('0xc')][_0x4504('0xd')]=function(){var _0x4c9a45=this[_0x4504('0xb')][_0x4504('0xe')];this['mapAgentsId']=_[_0x4504('0xf')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x4c9a45;};OpenchannelQueue['prototype']['updateRealtime']=function(){this[_0x4504('0x10')]=0x0;this['paused']=0x0;for(var _0x30b0c5=0x0;_0x30b0c5=0x0?this[_0x4504('0x15')]:0x0;var _0x2fc5bc={'id':this['id'],'available':this[_0x4504('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x4504('0x14')],'waiting':this[_0x4504('0x16')]};var _0x36fac2=md5(JSON['stringify'](_0x2fc5bc));if(this['md5']!==_0x36fac2){this[_0x4504('0x0')]=_0x36fac2;io['to'](util[_0x4504('0x17')]('openchannel:queue:%s',_0x2fc5bc[_0x4504('0x6')]))[_0x4504('0x18')](_0x4504('0x19'),_0x2fc5bc);}};module[_0x4504('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 480ff50..651b9a5 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 _0xb085=['mapAgentsId','paused','online','loggedIn','smsPause','available','stringify','sms:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x1a3114,_0x3683d2){var _0x4da04c=function(_0x2ebddf){while(--_0x2ebddf){_0x1a3114['push'](_0x1a3114['shift']());}};_0x4da04c(++_0x3683d2);}(_0xb085,0x9b));var _0x5b08=function(_0x4c91a0,_0x22828c){_0x4c91a0=_0x4c91a0-0x0;var _0x37404a=_0xb085[_0x4c91a0];return _0x37404a;};'use strict';var _=require(_0x5b08('0x0'));var md5=require(_0x5b08('0x1'));var util=require('util');var Redis=require(_0x5b08('0x2'));var config=require(_0x5b08('0x3'));config[_0x5b08('0x4')]=_[_0x5b08('0x5')](config[_0x5b08('0x4')],{'host':_0x5b08('0x6'),'port':0x18eb});var io=require(_0x5b08('0x7'))(new Redis(config[_0x5b08('0x4')]));function SmsQueue(_0xc17894){this['id']=_0xc17894['id']||0x0;this['name']=_0xc17894[_0x5b08('0x8')]||'';this[_0x5b08('0x9')]=_0xc17894[_0x5b08('0x9')]||0xa;this[_0x5b08('0xa')]=_0xc17894[_0x5b08('0xa')]||_0x5b08('0xb');this[_0x5b08('0xc')]=_0xc17894['Agents'];this['mapAgentsId']={};this[_0x5b08('0xd')]=0x0;this[_0x5b08('0x1')]='';this[_0x5b08('0xe')]();this[_0x5b08('0xf')]();}SmsQueue[_0x5b08('0x10')][_0x5b08('0xe')]=function(){var _0xe3f093=this['mapAgentsId'][_0x5b08('0x11')];this['mapAgentsId']=_[_0x5b08('0x12')](this[_0x5b08('0xc')],'id');this[_0x5b08('0x13')][_0x5b08('0x11')]=_0xe3f093;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x5b08('0x14')]=0x0;for(var _0x3430f5=0x0;_0x3430f5=0x0?this['available']:0x0;var _0x1271c9={'id':this['id'],'available':this[_0x5b08('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x5b08('0x8')],'paused':this[_0x5b08('0x14')],'waiting':this[_0x5b08('0xd')]};var _0xac5a24=md5(JSON[_0x5b08('0x19')](_0x1271c9));if(this[_0x5b08('0x1')]!==_0xac5a24){this[_0x5b08('0x1')]=_0xac5a24;io['to'](util['format'](_0x5b08('0x1a'),_0x1271c9[_0x5b08('0x8')]))[_0x5b08('0x1b')]('sms_queue:save',_0x1271c9);}};module[_0x5b08('0x1c')]=SmsQueue; \ No newline at end of file +var _0xf2e3=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','paused','length','online','loggedIn','available','stringify','format','sms:queue:%s','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x2c8b99,_0x2501ba){var _0x11940d=function(_0x13d6bf){while(--_0x13d6bf){_0x2c8b99['push'](_0x2c8b99['shift']());}};_0x11940d(++_0x2501ba);}(_0xf2e3,0xb7));var _0x3f2e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xf2e3[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x3f2e('0x0'));var md5=require(_0x3f2e('0x1'));var util=require(_0x3f2e('0x2'));var Redis=require(_0x3f2e('0x3'));var config=require(_0x3f2e('0x4'));config[_0x3f2e('0x5')]=_['defaults'](config['redis'],{'host':_0x3f2e('0x6'),'port':0x18eb});var io=require(_0x3f2e('0x7'))(new Redis(config[_0x3f2e('0x5')]));function SmsQueue(_0x2af165){this['id']=_0x2af165['id']||0x0;this[_0x3f2e('0x8')]=_0x2af165['name']||'';this[_0x3f2e('0x9')]=_0x2af165[_0x3f2e('0x9')]||0xa;this[_0x3f2e('0xa')]=_0x2af165[_0x3f2e('0xa')]||_0x3f2e('0xb');this[_0x3f2e('0xc')]=_0x2af165['Agents'];this[_0x3f2e('0xd')]={};this[_0x3f2e('0xe')]=0x0;this[_0x3f2e('0x1')]='';this[_0x3f2e('0xf')]();this['updateRealtime']();}SmsQueue[_0x3f2e('0x10')][_0x3f2e('0xf')]=function(){var _0x25ec6a=this['mapAgentsId'][_0x3f2e('0x11')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x3f2e('0xd')][_0x3f2e('0x11')]=_0x25ec6a;};SmsQueue[_0x3f2e('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3f2e('0x12')]=0x0;for(var _0x224403=0x0;_0x224403=0x0?this[_0x3f2e('0x16')]:0x0;var _0x57485b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3f2e('0x15')],'name':this[_0x3f2e('0x8')],'paused':this[_0x3f2e('0x12')],'waiting':this[_0x3f2e('0xe')]};var _0xddfcdf=md5(JSON[_0x3f2e('0x17')](_0x57485b));if(this[_0x3f2e('0x1')]!==_0xddfcdf){this['md5']=_0xddfcdf;io['to'](util[_0x3f2e('0x18')](_0x3f2e('0x19'),_0x57485b['name']))['emit'](_0x3f2e('0x1a'),_0x57485b);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 7f43c36..dce3350 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 _0x90a5=['agents','chatQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','initAgents','isUndefined','mergeFromDatabase','intervals','initOpenchannelQueues','length','openchannelQueues','updateRealtime','initChatQueues','updateRouting','initSmsQueues','smsQueues','mailQueues','initFaxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/chatQueue','../model/mailQueue','../model/faxQueue'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x90a5,0x163));var _0x590a=function(_0x5a54fc,_0x21f0e4){_0x5a54fc=_0x5a54fc-0x0;var _0x38b566=_0x90a5[_0x5a54fc];return _0x38b566;};'use strict';var BPromise=require(_0x590a('0x0'));var util=require(_0x590a('0x1'));var _=require(_0x590a('0x2'));var moment=require(_0x590a('0x3'));var Agent=require(_0x590a('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x590a('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x590a('0x6'));var FaxQueue=require(_0x590a('0x7'));var Realtime=function(){this[_0x590a('0x8')]={};this['intervals']={};this['openchannelQueues']={};this[_0x590a('0x9')]={};this['smsQueues']={};this['mailQueues']={};this[_0x590a('0xa')]={};this[_0x590a('0xb')]={};this[_0x590a('0xc')]={};this[_0x590a('0xd')]={};this[_0x590a('0xe')]={};this[_0x590a('0xf')]={};};function freeIsNotKey(_0x43c78b,_0x3e3d47,_0xe57154){var _0x5d13d0=_['mapKeys'](_0x43c78b,function(_0x594372,_0x587e98){return _0x594372[_0xe57154];});for(var _0x43f3d0 in _0x3e3d47){if(_0x3e3d47[_0x590a('0x10')](_0x43f3d0)){if(!_0x5d13d0[_0x43f3d0]){delete _0x3e3d47[_0x43f3d0];}}}}Realtime[_0x590a('0x11')]['mergeFromDatabase']=function(_0x519088,_0x1da157){for(var _0x3311ef in _0x1da157){if(_0x519088[_0x590a('0x10')](_0x3311ef)){_0x519088[_0x3311ef]=_0x1da157[_0x3311ef];}}};Realtime[_0x590a('0x11')][_0x590a('0x12')]=function(){var _0x4e4dd2=this;return function(_0x4486fc){if(_0x4486fc){freeIsNotKey(_0x4486fc,_0x4e4dd2[_0x590a('0x8')],'id');for(var _0x124d57=0x0,_0x21fd60={},_0x1ea5d0={};_0x124d57<_0x4486fc['length'];_0x124d57+=0x1){_0x21fd60=_0x4486fc[_0x124d57];if(_[_0x590a('0x13')](_0x4e4dd2[_0x590a('0x8')][_0x21fd60['id']])){_0x4e4dd2['agents'][_0x21fd60['id']]=new Agent(_0x21fd60);}else{_0x4e4dd2[_0x590a('0x14')](_0x4e4dd2[_0x590a('0x8')][_0x21fd60['id']],_0x21fd60);}}}return _0x4e4dd2[_0x590a('0x8')];};};Realtime[_0x590a('0x11')]['initIntervals']=function(){var _0x4f0dc2=this;return function(_0x360496){if(_0x360496){freeIsNotKey(_0x360496,_0x4f0dc2[_0x590a('0x15')],'id');for(var _0x800c04=0x0,_0x27183d={},_0x2f0868={};_0x800c04<_0x360496['length'];_0x800c04+=0x1){_0x27183d=_0x360496[_0x800c04];if(_['isUndefined'](_0x4f0dc2[_0x590a('0x15')][_0x27183d['id']])){_0x4f0dc2['intervals'][_0x27183d['id']]=new Interval(_0x27183d);}else{_0x4f0dc2[_0x590a('0x14')](_0x4f0dc2[_0x590a('0x15')][_0x27183d['id']],_0x27183d);}}}return _0x4f0dc2[_0x590a('0x15')];};};Realtime[_0x590a('0x11')][_0x590a('0x16')]=function(){var _0x39f90b=this;return function(_0x394ef5){if(_0x394ef5){freeIsNotKey(_0x394ef5,_0x39f90b['openchannelQueues'],'id');for(var _0x236bda=0x0,_0x14d88e={},_0x18e142={};_0x236bda<_0x394ef5[_0x590a('0x17')];_0x236bda+=0x1){_0x14d88e=_0x394ef5[_0x236bda];if(_[_0x590a('0x13')](_0x39f90b[_0x590a('0x18')][_0x14d88e['id']])){_0x39f90b[_0x590a('0x18')][_0x14d88e['id']]=new OpenchannelQueue(_0x14d88e);}else{_0x39f90b[_0x590a('0x14')](_0x39f90b[_0x590a('0x18')][_0x14d88e['id']],_0x14d88e);}_0x39f90b[_0x590a('0x18')][_0x14d88e['id']]['updateRouting']();_0x39f90b[_0x590a('0x18')][_0x14d88e['id']][_0x590a('0x19')]();}}return _0x39f90b[_0x590a('0x18')];};};Realtime[_0x590a('0x11')][_0x590a('0x1a')]=function(){var _0x1de485=this;return function(_0x675810){if(_0x675810){freeIsNotKey(_0x675810,_0x1de485[_0x590a('0x9')],'id');for(var _0x7e35db=0x0,_0x1b59eb={},_0x57dc4f={};_0x7e35db<_0x675810[_0x590a('0x17')];_0x7e35db+=0x1){_0x1b59eb=_0x675810[_0x7e35db];if(_['isUndefined'](_0x1de485[_0x590a('0x9')][_0x1b59eb['id']])){_0x1de485[_0x590a('0x9')][_0x1b59eb['id']]=new ChatQueue(_0x1b59eb);}else{_0x1de485[_0x590a('0x14')](_0x1de485[_0x590a('0x9')][_0x1b59eb['id']],_0x1b59eb);}_0x1de485[_0x590a('0x9')][_0x1b59eb['id']][_0x590a('0x1b')]();_0x1de485[_0x590a('0x9')][_0x1b59eb['id']][_0x590a('0x19')]();}}return _0x1de485[_0x590a('0x9')];};};Realtime[_0x590a('0x11')][_0x590a('0x1c')]=function(){var _0x361a8f=this;return function(_0x5cb99c){if(_0x5cb99c){freeIsNotKey(_0x5cb99c,_0x361a8f['smsQueues'],'id');for(var _0x20a8db=0x0,_0x2bc40f={},_0x5f7ca6={};_0x20a8db<_0x5cb99c[_0x590a('0x17')];_0x20a8db+=0x1){_0x2bc40f=_0x5cb99c[_0x20a8db];if(_[_0x590a('0x13')](_0x361a8f[_0x590a('0x1d')][_0x2bc40f['id']])){_0x361a8f[_0x590a('0x1d')][_0x2bc40f['id']]=new SmsQueue(_0x2bc40f);}else{_0x361a8f[_0x590a('0x14')](_0x361a8f[_0x590a('0x1d')][_0x2bc40f['id']],_0x2bc40f);}_0x361a8f[_0x590a('0x1d')][_0x2bc40f['id']][_0x590a('0x1b')]();_0x361a8f[_0x590a('0x1d')][_0x2bc40f['id']][_0x590a('0x19')]();}}return _0x361a8f['smsQueues'];};};Realtime[_0x590a('0x11')]['initMailQueues']=function(){var _0x4e254b=this;return function(_0x5c9076){if(_0x5c9076){freeIsNotKey(_0x5c9076,_0x4e254b[_0x590a('0x1e')],'id');for(var _0x22353e=0x0,_0x34a08c={},_0x2a48d0={};_0x22353e<_0x5c9076[_0x590a('0x17')];_0x22353e+=0x1){_0x34a08c=_0x5c9076[_0x22353e];if(_[_0x590a('0x13')](_0x4e254b[_0x590a('0x1e')][_0x34a08c['id']])){_0x4e254b[_0x590a('0x1e')][_0x34a08c['id']]=new MailQueue(_0x34a08c);}else{_0x4e254b[_0x590a('0x14')](_0x4e254b['mailQueues'][_0x34a08c['id']],_0x34a08c);}_0x4e254b[_0x590a('0x1e')][_0x34a08c['id']][_0x590a('0x1b')]();_0x4e254b[_0x590a('0x1e')][_0x34a08c['id']][_0x590a('0x19')]();}}return _0x4e254b['mailQueues'];};};Realtime[_0x590a('0x11')][_0x590a('0x1f')]=function(){var _0x3b47bc=this;return function(_0x10417c){if(_0x10417c){freeIsNotKey(_0x10417c,_0x3b47bc[_0x590a('0xa')],'id');for(var _0x5c963c=0x0,_0x5cc49c={},_0x2bca74={};_0x5c963c<_0x10417c[_0x590a('0x17')];_0x5c963c+=0x1){_0x5cc49c=_0x10417c[_0x5c963c];if(_[_0x590a('0x13')](_0x3b47bc[_0x590a('0xa')][_0x5cc49c['id']])){_0x3b47bc[_0x590a('0xa')][_0x5cc49c['id']]=new FaxQueue(_0x5cc49c);}else{_0x3b47bc[_0x590a('0x14')](_0x3b47bc[_0x590a('0xa')][_0x5cc49c['id']],_0x5cc49c);}_0x3b47bc[_0x590a('0xa')][_0x5cc49c['id']][_0x590a('0x1b')]();_0x3b47bc[_0x590a('0xa')][_0x5cc49c['id']][_0x590a('0x19')]();}}return _0x3b47bc['faxQueues'];};};module[_0x590a('0x20')]=Realtime; \ No newline at end of file +var _0x4a0a=['initChatQueues','initSmsQueues','smsQueues','updateRouting','initMailQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','chatQueues','mailQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','agents','isUndefined','length','openchannelQueues','updateRealtime'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x4a0a,0x6e));var _0xa4a0=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4a0a[_0x5f3f88];return _0xd08119;};'use strict';var BPromise=require(_0xa4a0('0x0'));var util=require(_0xa4a0('0x1'));var _=require(_0xa4a0('0x2'));var moment=require('moment');var Agent=require(_0xa4a0('0x3'));var Interval=require(_0xa4a0('0x4'));var OpenchannelQueue=require(_0xa4a0('0x5'));var ChatQueue=require(_0xa4a0('0x6'));var SmsQueue=require(_0xa4a0('0x7'));var MailQueue=require(_0xa4a0('0x8'));var FaxQueue=require(_0xa4a0('0x9'));var Realtime=function(){this['agents']={};this[_0xa4a0('0xa')]={};this['openchannelQueues']={};this[_0xa4a0('0xb')]={};this['smsQueues']={};this[_0xa4a0('0xc')]={};this['faxQueues']={};this[_0xa4a0('0xd')]={};this[_0xa4a0('0xe')]={};this[_0xa4a0('0xf')]={};this[_0xa4a0('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x2f1982,_0x1e1bc9,_0x14c472){var _0x2fd7a1=_[_0xa4a0('0x11')](_0x2f1982,function(_0x4766f1,_0xeab60e){return _0x4766f1[_0x14c472];});for(var _0x118a4d in _0x1e1bc9){if(_0x1e1bc9[_0xa4a0('0x12')](_0x118a4d)){if(!_0x2fd7a1[_0x118a4d]){delete _0x1e1bc9[_0x118a4d];}}}}Realtime[_0xa4a0('0x13')][_0xa4a0('0x14')]=function(_0x7af32c,_0x17284c){for(var _0xaa7a73 in _0x17284c){if(_0x7af32c['hasOwnProperty'](_0xaa7a73)){_0x7af32c[_0xaa7a73]=_0x17284c[_0xaa7a73];}}};Realtime[_0xa4a0('0x13')]['initAgents']=function(){var _0x303543=this;return function(_0x3638e1){if(_0x3638e1){freeIsNotKey(_0x3638e1,_0x303543[_0xa4a0('0x15')],'id');for(var _0x40446e=0x0,_0x1148a0={},_0xe9216={};_0x40446e<_0x3638e1['length'];_0x40446e+=0x1){_0x1148a0=_0x3638e1[_0x40446e];if(_[_0xa4a0('0x16')](_0x303543[_0xa4a0('0x15')][_0x1148a0['id']])){_0x303543[_0xa4a0('0x15')][_0x1148a0['id']]=new Agent(_0x1148a0);}else{_0x303543[_0xa4a0('0x14')](_0x303543[_0xa4a0('0x15')][_0x1148a0['id']],_0x1148a0);}}}return _0x303543['agents'];};};Realtime[_0xa4a0('0x13')]['initIntervals']=function(){var _0x55c6e8=this;return function(_0x3c3e9e){if(_0x3c3e9e){freeIsNotKey(_0x3c3e9e,_0x55c6e8[_0xa4a0('0xa')],'id');for(var _0x192d20=0x0,_0x57d05c={},_0x57e794={};_0x192d20<_0x3c3e9e[_0xa4a0('0x17')];_0x192d20+=0x1){_0x57d05c=_0x3c3e9e[_0x192d20];if(_[_0xa4a0('0x16')](_0x55c6e8[_0xa4a0('0xa')][_0x57d05c['id']])){_0x55c6e8[_0xa4a0('0xa')][_0x57d05c['id']]=new Interval(_0x57d05c);}else{_0x55c6e8[_0xa4a0('0x14')](_0x55c6e8[_0xa4a0('0xa')][_0x57d05c['id']],_0x57d05c);}}}return _0x55c6e8[_0xa4a0('0xa')];};};Realtime[_0xa4a0('0x13')]['initOpenchannelQueues']=function(){var _0x262e67=this;return function(_0x4358af){if(_0x4358af){freeIsNotKey(_0x4358af,_0x262e67[_0xa4a0('0x18')],'id');for(var _0x52c1ab=0x0,_0x85a7ee={},_0x5ae268={};_0x52c1ab<_0x4358af['length'];_0x52c1ab+=0x1){_0x85a7ee=_0x4358af[_0x52c1ab];if(_[_0xa4a0('0x16')](_0x262e67['openchannelQueues'][_0x85a7ee['id']])){_0x262e67['openchannelQueues'][_0x85a7ee['id']]=new OpenchannelQueue(_0x85a7ee);}else{_0x262e67[_0xa4a0('0x14')](_0x262e67[_0xa4a0('0x18')][_0x85a7ee['id']],_0x85a7ee);}_0x262e67[_0xa4a0('0x18')][_0x85a7ee['id']]['updateRouting']();_0x262e67[_0xa4a0('0x18')][_0x85a7ee['id']][_0xa4a0('0x19')]();}}return _0x262e67[_0xa4a0('0x18')];};};Realtime[_0xa4a0('0x13')][_0xa4a0('0x1a')]=function(){var _0x21510d=this;return function(_0x464107){if(_0x464107){freeIsNotKey(_0x464107,_0x21510d[_0xa4a0('0xb')],'id');for(var _0x287f6f=0x0,_0x232691={},_0x459bca={};_0x287f6f<_0x464107[_0xa4a0('0x17')];_0x287f6f+=0x1){_0x232691=_0x464107[_0x287f6f];if(_[_0xa4a0('0x16')](_0x21510d[_0xa4a0('0xb')][_0x232691['id']])){_0x21510d[_0xa4a0('0xb')][_0x232691['id']]=new ChatQueue(_0x232691);}else{_0x21510d['mergeFromDatabase'](_0x21510d[_0xa4a0('0xb')][_0x232691['id']],_0x232691);}_0x21510d['chatQueues'][_0x232691['id']]['updateRouting']();_0x21510d['chatQueues'][_0x232691['id']][_0xa4a0('0x19')]();}}return _0x21510d[_0xa4a0('0xb')];};};Realtime['prototype'][_0xa4a0('0x1b')]=function(){var _0x39e646=this;return function(_0x236281){if(_0x236281){freeIsNotKey(_0x236281,_0x39e646['smsQueues'],'id');for(var _0x24f41c=0x0,_0x1686e4={},_0xe35a1a={};_0x24f41c<_0x236281['length'];_0x24f41c+=0x1){_0x1686e4=_0x236281[_0x24f41c];if(_[_0xa4a0('0x16')](_0x39e646['smsQueues'][_0x1686e4['id']])){_0x39e646[_0xa4a0('0x1c')][_0x1686e4['id']]=new SmsQueue(_0x1686e4);}else{_0x39e646[_0xa4a0('0x14')](_0x39e646['smsQueues'][_0x1686e4['id']],_0x1686e4);}_0x39e646[_0xa4a0('0x1c')][_0x1686e4['id']][_0xa4a0('0x1d')]();_0x39e646[_0xa4a0('0x1c')][_0x1686e4['id']][_0xa4a0('0x19')]();}}return _0x39e646['smsQueues'];};};Realtime[_0xa4a0('0x13')][_0xa4a0('0x1e')]=function(){var _0x5e9edb=this;return function(_0x5dde95){if(_0x5dde95){freeIsNotKey(_0x5dde95,_0x5e9edb[_0xa4a0('0xc')],'id');for(var _0x494ec6=0x0,_0x6f7e18={},_0x136e96={};_0x494ec6<_0x5dde95['length'];_0x494ec6+=0x1){_0x6f7e18=_0x5dde95[_0x494ec6];if(_[_0xa4a0('0x16')](_0x5e9edb[_0xa4a0('0xc')][_0x6f7e18['id']])){_0x5e9edb[_0xa4a0('0xc')][_0x6f7e18['id']]=new MailQueue(_0x6f7e18);}else{_0x5e9edb[_0xa4a0('0x14')](_0x5e9edb[_0xa4a0('0xc')][_0x6f7e18['id']],_0x6f7e18);}_0x5e9edb[_0xa4a0('0xc')][_0x6f7e18['id']][_0xa4a0('0x1d')]();_0x5e9edb[_0xa4a0('0xc')][_0x6f7e18['id']][_0xa4a0('0x19')]();}}return _0x5e9edb['mailQueues'];};};Realtime[_0xa4a0('0x13')][_0xa4a0('0x1f')]=function(){var _0x4b66c7=this;return function(_0x44ad9b){if(_0x44ad9b){freeIsNotKey(_0x44ad9b,_0x4b66c7[_0xa4a0('0x20')],'id');for(var _0x25db75=0x0,_0x5d4209={},_0x1b17d3={};_0x25db75<_0x44ad9b[_0xa4a0('0x17')];_0x25db75+=0x1){_0x5d4209=_0x44ad9b[_0x25db75];if(_[_0xa4a0('0x16')](_0x4b66c7[_0xa4a0('0x20')][_0x5d4209['id']])){_0x4b66c7[_0xa4a0('0x20')][_0x5d4209['id']]=new FaxQueue(_0x5d4209);}else{_0x4b66c7[_0xa4a0('0x14')](_0x4b66c7[_0xa4a0('0x20')][_0x5d4209['id']],_0x5d4209);}_0x4b66c7['faxQueues'][_0x5d4209['id']][_0xa4a0('0x1d')]();_0x4b66c7[_0xa4a0('0x20')][_0x5d4209['id']][_0xa4a0('0x19')]();}}return _0x4b66c7[_0xa4a0('0x20')];};};module[_0xa4a0('0x21')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 4424808..f44e82a 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 _0x9145=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x9145,0xc7));var _0x5914=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9145[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x5914('0x0'));exports['update']=function(_0x16403b,_0x104802){return client['Request'](_0x5914('0x1'),{'body':_0x104802,'options':{'where':{'id':_0x16403b}},'log':_0x5914('0x2')});};exports[_0x5914('0x3')]=function(_0xfd4ada,_0x480bd4){return client['Request'](_0x5914('0x4'),{'body':_0x480bd4,'options':{'where':{'id':_0xfd4ada}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x79ba=['updateChatInteraction','addTags','Request','AddTagsToChatInteraction','update','UpdateChatInteraction'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x79ba,0x13c));var _0xa79b=function(_0x32ecf5,_0x345f85){_0x32ecf5=_0x32ecf5-0x0;var _0xb8b77b=_0x79ba[_0x32ecf5];return _0xb8b77b;};'use strict';var client=require('../client');exports[_0xa79b('0x0')]=function(_0x3b01d0,_0x31544e){return client['Request'](_0xa79b('0x1'),{'body':_0x31544e,'options':{'where':{'id':_0x3b01d0}},'log':_0xa79b('0x2')});};exports[_0xa79b('0x3')]=function(_0x13e632,_0x5677d0){return client[_0xa79b('0x4')](_0xa79b('0x5'),{'body':_0x5677d0,'options':{'where':{'id':_0x13e632}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 28f467e..b40d71b 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 _0x35de=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x733333,_0x45f819){var _0x37119b=function(_0xf854a5){while(--_0xf854a5){_0x733333['push'](_0x733333['shift']());}};_0x37119b(++_0x45f819);}(_0x35de,0x17b));var _0xe35d=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x35de[_0x491faa];return _0x414440;};'use strict';var client=require(_0xe35d('0x0'));exports[_0xe35d('0x1')]=function(_0x44d170){return client[_0xe35d('0x2')](_0xe35d('0x3'),{'body':_0x44d170,'log':_0xe35d('0x4')});}; \ No newline at end of file +var _0xab9b=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xab9b,0x162));var _0xbab9=function(_0x69a748,_0x7e2ee1){_0x69a748=_0x69a748-0x0;var _0x116db0=_0xab9b[_0x69a748];return _0x116db0;};'use strict';var client=require(_0xbab9('0x0'));exports[_0xbab9('0x1')]=function(_0x582f11){return client[_0xbab9('0x2')](_0xbab9('0x3'),{'body':_0x582f11,'log':_0xbab9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index d6bfda5..f573f5e 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 _0xf9a6=['name','timeout','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xf9a6,0xc5));var _0x6f9a=function(_0x46e53c,_0x28bb2f){_0x46e53c=_0x46e53c-0x0;var _0x42f6a6=_0xf9a6[_0x46e53c];return _0x42f6a6;};'use strict';var client=require(_0x6f9a('0x0'));exports[_0x6f9a('0x1')]=function(){return function(){return client[_0x6f9a('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x6f9a('0x3'),_0x6f9a('0x4'),'strategy'],'include':[{'model':'User','as':_0x6f9a('0x5'),'attributes':['id',_0x6f9a('0x3'),_0x6f9a('0x6'),_0x6f9a('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x7ce3=['chatPause','../client','getChatQueues','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x5a38bc,_0x4665e4){var _0x1af6dc=function(_0x10cd31){while(--_0x10cd31){_0x5a38bc['push'](_0x5a38bc['shift']());}};_0x1af6dc(++_0x4665e4);}(_0x7ce3,0x1c3));var _0x37ce=function(_0x1ed9a7,_0x1e5082){_0x1ed9a7=_0x1ed9a7-0x0;var _0x43f590=_0x7ce3[_0x1ed9a7];return _0x43f590;};'use strict';var client=require(_0x37ce('0x0'));exports[_0x37ce('0x1')]=function(){return function(){return client['Request'](_0x37ce('0x2'),{'options':{'raw':![],'attributes':['id',_0x37ce('0x3'),_0x37ce('0x4'),_0x37ce('0x5')],'include':[{'model':_0x37ce('0x6'),'as':_0x37ce('0x7'),'attributes':['id',_0x37ce('0x3'),_0x37ce('0x8'),_0x37ce('0x9')]}]},'log':_0x37ce('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6613362..8afe98d 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 _0x1061=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x21cd14,_0x2d9747){var _0x3501c7=function(_0x71142){while(--_0x71142){_0x21cd14['push'](_0x21cd14['shift']());}};_0x3501c7(++_0x2d9747);}(_0x1061,0x1b5));var _0x1106=function(_0x3a787b,_0x16b81a){_0x3a787b=_0x3a787b-0x0;var _0x5219d1=_0x1061[_0x3a787b];return _0x5219d1;};'use strict';var client=require(_0x1106('0x0'));exports['create']=function(_0x4f4e74){return client['Request'](_0x1106('0x1'),{'body':_0x4f4e74,'log':_0x1106('0x1')});};exports[_0x1106('0x2')]=function(_0x222f76,_0x1c1bae){return client[_0x1106('0x3')](_0x1106('0x4'),{'body':_0x1c1bae,'options':{'where':{'uniqueid':_0x222f76},'order':[['id',_0x1106('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xa739=['DESC','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xb88a88,_0xbf858e){var _0x30c328=function(_0xd104ec){while(--_0xd104ec){_0xb88a88['push'](_0xb88a88['shift']());}};_0x30c328(++_0xbf858e);}(_0xa739,0x1e1));var _0x9a73=function(_0x131c10,_0x5d796a){_0x131c10=_0x131c10-0x0;var _0x927559=_0xa739[_0x131c10];return _0x927559;};'use strict';var client=require('../client');exports[_0x9a73('0x0')]=function(_0x522d13){return client[_0x9a73('0x1')](_0x9a73('0x2'),{'body':_0x522d13,'log':'CreateChatQueueReport'});};exports[_0x9a73('0x3')]=function(_0x352cec,_0x40fb76){return client['Request'](_0x9a73('0x4'),{'body':_0x40fb76,'options':{'where':{'uniqueid':_0x352cec},'order':[['id',_0x9a73('0x5')]],'limit':0x1},'log':_0x9a73('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2715300..d575b30 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 _0xbcee=['addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction','AddTagsToFaxInteraction'];(function(_0x22675e,_0x3f9b08){var _0x57933a=function(_0x1ada97){while(--_0x1ada97){_0x22675e['push'](_0x22675e['shift']());}};_0x57933a(++_0x3f9b08);}(_0xbcee,0x1c3));var _0xebce=function(_0x5dcd83,_0x29f35a){_0x5dcd83=_0x5dcd83-0x0;var _0x14f4eb=_0xbcee[_0x5dcd83];return _0x14f4eb;};'use strict';var client=require(_0xebce('0x0'));exports['update']=function(_0x4dd03d,_0x2d96b6){return client[_0xebce('0x1')](_0xebce('0x2'),{'body':_0x2d96b6,'options':{'where':{'id':_0x4dd03d}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x11509d,_0x585ce6){return client[_0xebce('0x1')](_0xebce('0x3'),{'body':_0x585ce6,'options':{'where':{'id':_0x11509d}},'log':_0xebce('0x4')});}; \ No newline at end of file +var _0xebf2=['UpdateFaxInteraction','updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request'];(function(_0x54f060,_0x1de751){var _0xb2b587=function(_0x3d3bd5){while(--_0x3d3bd5){_0x54f060['push'](_0x54f060['shift']());}};_0xb2b587(++_0x1de751);}(_0xebf2,0x6a));var _0x2ebf=function(_0x1050b8,_0x1f8d4b){_0x1050b8=_0x1050b8-0x0;var _0x1211f2=_0xebf2[_0x1050b8];return _0x1211f2;};'use strict';var client=require(_0x2ebf('0x0'));exports['update']=function(_0x2d63ef,_0x716e1){return client[_0x2ebf('0x1')](_0x2ebf('0x2'),{'body':_0x716e1,'options':{'where':{'id':_0x2d63ef}},'log':_0x2ebf('0x3')});};exports['addTags']=function(_0x51641c,_0x4524a5){return client[_0x2ebf('0x1')](_0x2ebf('0x4'),{'body':_0x4524a5,'options':{'where':{'id':_0x51641c}},'log':_0x2ebf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 9fdcedb..663f5ee 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 _0xc5d8=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x56b3bc,_0x4694f0){var _0x39dd7e=function(_0x6d71e9){while(--_0x6d71e9){_0x56b3bc['push'](_0x56b3bc['shift']());}};_0x39dd7e(++_0x4694f0);}(_0xc5d8,0x1da));var _0x8c5d=function(_0x49282b,_0x4e2125){_0x49282b=_0x49282b-0x0;var _0xcb542e=_0xc5d8[_0x49282b];return _0xcb542e;};'use strict';var client=require(_0x8c5d('0x0'));exports[_0x8c5d('0x1')]=function(_0x59f091){return client[_0x8c5d('0x2')](_0x8c5d('0x3'),{'body':_0x59f091,'log':_0x8c5d('0x4')});}; \ No newline at end of file +var _0xef05=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x444e03,_0xca3a87){var _0x51bf0a=function(_0x2932ff){while(--_0x2932ff){_0x444e03['push'](_0x444e03['shift']());}};_0x51bf0a(++_0xca3a87);}(_0xef05,0x72));var _0x5ef0=function(_0x4126f0,_0x1c8e14){_0x4126f0=_0x4126f0-0x0;var _0x2eb8bd=_0xef05[_0x4126f0];return _0x2eb8bd;};'use strict';var client=require(_0x5ef0('0x0'));exports[_0x5ef0('0x1')]=function(_0xabd530){return client[_0x5ef0('0x2')](_0x5ef0('0x3'),{'body':_0xabd530,'log':_0x5ef0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 67258c8..c741cc8 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 _0xe954=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','strategy','online'];(function(_0x520837,_0x41b00d){var _0x5f4317=function(_0x26d902){while(--_0x26d902){_0x520837['push'](_0x520837['shift']());}};_0x5f4317(++_0x41b00d);}(_0xe954,0x89));var _0x4e95=function(_0x5b47d2,_0x169c26){_0x5b47d2=_0x5b47d2-0x0;var _0x2c70a1=_0xe954[_0x5b47d2];return _0x2c70a1;};'use strict';var client=require(_0x4e95('0x0'));exports[_0x4e95('0x1')]=function(){return function(){return client[_0x4e95('0x2')](_0x4e95('0x3'),{'options':{'raw':![],'attributes':['id',_0x4e95('0x4'),'timeout',_0x4e95('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x4e95('0x4'),_0x4e95('0x6'),_0x4e95('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x3cbd=['online','faxPause','../client','getFaxQueues','Request','strategy','User','name'];(function(_0x1b36ef,_0x38948f){var _0x314ef2=function(_0x41ef50){while(--_0x41ef50){_0x1b36ef['push'](_0x1b36ef['shift']());}};_0x314ef2(++_0x38948f);}(_0x3cbd,0x7a));var _0xd3cb=function(_0x53dac4,_0x436fac){_0x53dac4=_0x53dac4-0x0;var _0x589366=_0x3cbd[_0x53dac4];return _0x589366;};'use strict';var client=require(_0xd3cb('0x0'));exports[_0xd3cb('0x1')]=function(){return function(){return client[_0xd3cb('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xd3cb('0x3')],'include':[{'model':_0xd3cb('0x4'),'as':'Agents','attributes':['id',_0xd3cb('0x5'),_0xd3cb('0x6'),_0xd3cb('0x7')]}]},'log':_0xd3cb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4098a5f..4a5b8b2 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 _0x0023=['CreateFaxQueueReport','UpdateFaxQueueReport','../client','Request'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x0023,0x10a));var _0x3002=function(_0x2a419e,_0x1aef84){_0x2a419e=_0x2a419e-0x0;var _0x1b6f49=_0x0023[_0x2a419e];return _0x1b6f49;};'use strict';var client=require(_0x3002('0x0'));exports['create']=function(_0x3cbb04){return client[_0x3002('0x1')](_0x3002('0x2'),{'body':_0x3cbb04,'log':_0x3002('0x2')});};exports['update']=function(_0x1eb073,_0x5b257c){return client['Request'](_0x3002('0x3'),{'body':_0x5b257c,'options':{'where':{'uniqueid':_0x1eb073},'order':[['id','DESC']],'limit':0x1},'log':_0x3002('0x3')});}; \ No newline at end of file +var _0x7f05=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','../client','create'];(function(_0xbf7313,_0xd81d81){var _0x6554fb=function(_0x3e8429){while(--_0x3e8429){_0xbf7313['push'](_0xbf7313['shift']());}};_0x6554fb(++_0xd81d81);}(_0x7f05,0xdc));var _0x57f0=function(_0x42e30b,_0x44d022){_0x42e30b=_0x42e30b-0x0;var _0x2df554=_0x7f05[_0x42e30b];return _0x2df554;};'use strict';var client=require(_0x57f0('0x0'));exports[_0x57f0('0x1')]=function(_0x26405c){return client['Request'](_0x57f0('0x2'),{'body':_0x26405c,'log':'CreateFaxQueueReport'});};exports[_0x57f0('0x3')]=function(_0x3d1eec,_0x52bde5){return client[_0x57f0('0x4')](_0x57f0('0x5'),{'body':_0x52bde5,'options':{'where':{'uniqueid':_0x3d1eec},'order':[['id','DESC']],'limit':0x1},'log':_0x57f0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 8d8b2be..bbeaaa0 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 _0x6cb4=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x513bc2,_0x177da2){var _0x1e14c7=function(_0x1a66e5){while(--_0x1a66e5){_0x513bc2['push'](_0x513bc2['shift']());}};_0x1e14c7(++_0x177da2);}(_0x6cb4,0xff));var _0x46cb=function(_0x1f7a15,_0x277915){_0x1f7a15=_0x1f7a15-0x0;var _0x38ce55=_0x6cb4[_0x1f7a15];return _0x38ce55;};'use strict';var client=require(_0x46cb('0x0'));exports[_0x46cb('0x1')]=function(){return function(){return client[_0x46cb('0x2')](_0x46cb('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x46cb('0x4')],'include':[{'model':_0x46cb('0x5'),'as':_0x46cb('0x6'),'attributes':['id',_0x46cb('0x4'),_0x46cb('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xdd4f=['interval','getIntervals','../client','name','Interval'];(function(_0x3128f7,_0x5ec08a){var _0x5ce976=function(_0x463e28){while(--_0x463e28){_0x3128f7['push'](_0x3128f7['shift']());}};_0x5ce976(++_0x5ec08a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1e3dc4,_0x1a3698){_0x1e3dc4=_0x1e3dc4-0x0;var _0x33127d=_0xdd4f[_0x1e3dc4];return _0x33127d;};'use strict';var client=require(_0xfdd4('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xfdd4('0x1')],'include':[{'model':_0xfdd4('0x2'),'as':'Intervals','attributes':['id',_0xfdd4('0x1'),_0xfdd4('0x3')]}]},'log':_0xfdd4('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f518de9..cbaf2ee 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 _0xa540=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa540,0xa0));var _0x0a54=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0xa540[_0x148879];return _0x4f7027;};'use strict';var client=require(_0x0a54('0x0'));exports[_0x0a54('0x1')]=function(_0x33e596,_0x497cc1){return client[_0x0a54('0x2')](_0x0a54('0x3'),{'body':_0x497cc1,'options':{'where':{'id':_0x33e596}},'log':_0x0a54('0x4')});};exports[_0x0a54('0x5')]=function(_0x5950ac,_0x54987c){return client[_0x0a54('0x2')](_0x0a54('0x6'),{'body':_0x54987c,'options':{'where':{'id':_0x5950ac}},'log':_0x0a54('0x7')});}; \ No newline at end of file +var _0x1ebb=['update','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x337934,_0x212aba){var _0x433811=function(_0x2418a3){while(--_0x2418a3){_0x337934['push'](_0x337934['shift']());}};_0x433811(++_0x212aba);}(_0x1ebb,0xc6));var _0xb1eb=function(_0x149a6c,_0x56910f){_0x149a6c=_0x149a6c-0x0;var _0x3ce011=_0x1ebb[_0x149a6c];return _0x3ce011;};'use strict';var client=require('../client');exports[_0xb1eb('0x0')]=function(_0x506448,_0x2b581f){return client[_0xb1eb('0x1')](_0xb1eb('0x2'),{'body':_0x2b581f,'options':{'where':{'id':_0x506448}},'log':'updateMailInteraction'});};exports[_0xb1eb('0x3')]=function(_0x10b709,_0xa2c05b){return client[_0xb1eb('0x1')](_0xb1eb('0x4'),{'body':_0xa2c05b,'options':{'where':{'id':_0x10b709}},'log':_0xb1eb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c6e1e35..cd510b9 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 _0x36f7=['createMailMessage','../client'];(function(_0x7fd37b,_0x33e9ce){var _0x490be6=function(_0x3f4e3b){while(--_0x3f4e3b){_0x7fd37b['push'](_0x7fd37b['shift']());}};_0x490be6(++_0x33e9ce);}(_0x36f7,0x1bb));var _0x736f=function(_0x51f717,_0x3698ec){_0x51f717=_0x51f717-0x0;var _0x36822c=_0x36f7[_0x51f717];return _0x36822c;};'use strict';var client=require(_0x736f('0x0'));exports['create']=function(_0x24c7c4){return client['Request']('CreateMailMessage',{'body':_0x24c7c4,'log':_0x736f('0x1')});}; \ No newline at end of file +var _0x3c22=['CreateMailMessage','../client','create'];(function(_0x22efa9,_0x5acdaf){var _0x454981=function(_0x30886a){while(--_0x30886a){_0x22efa9['push'](_0x22efa9['shift']());}};_0x454981(++_0x5acdaf);}(_0x3c22,0x130));var _0x23c2=function(_0x2bec89,_0x23fd8c){_0x2bec89=_0x2bec89-0x0;var _0x314f8d=_0x3c22[_0x2bec89];return _0x314f8d;};'use strict';var client=require(_0x23c2('0x0'));exports[_0x23c2('0x1')]=function(_0x4f6a62){return client['Request'](_0x23c2('0x2'),{'body':_0x4f6a62,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b1d5299..9674a5e 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 _0x63b8=['../client','getMailQueues','Request','name','timeout','User','mailPause'];(function(_0x5992c0,_0x4f71e6){var _0x4bf348=function(_0x1fe5f8){while(--_0x1fe5f8){_0x5992c0['push'](_0x5992c0['shift']());}};_0x4bf348(++_0x4f71e6);}(_0x63b8,0x13b));var _0x863b=function(_0x345802,_0xd11ced){_0x345802=_0x345802-0x0;var _0x1e4ee3=_0x63b8[_0x345802];return _0x1e4ee3;};'use strict';var client=require(_0x863b('0x0'));exports[_0x863b('0x1')]=function(){return function(){return client[_0x863b('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x863b('0x3'),_0x863b('0x4'),'strategy'],'include':[{'model':_0x863b('0x5'),'as':'Agents','attributes':['id',_0x863b('0x3'),'online',_0x863b('0x6')]}]},'log':_0x863b('0x1')});};}; \ No newline at end of file +var _0x690b=['strategy','User','name','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x690b,0x124));var _0xb690=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x690b[_0x5d6e30];return _0x3d3f3b;};'use strict';var client=require(_0xb690('0x0'));exports[_0xb690('0x1')]=function(){return function(){return client[_0xb690('0x2')](_0xb690('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb690('0x4')],'include':[{'model':_0xb690('0x5'),'as':'Agents','attributes':['id',_0xb690('0x6'),'online',_0xb690('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 5f96b47..91acafa 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 _0xd08a=['UpdateMailQueueReport','../client','CreateMailQueueReport','Request','DESC'];(function(_0x19d172,_0x21bf9b){var _0x4e1ccd=function(_0x144213){while(--_0x144213){_0x19d172['push'](_0x19d172['shift']());}};_0x4e1ccd(++_0x21bf9b);}(_0xd08a,0x196));var _0xad08=function(_0x1bbbb0,_0x7d5412){_0x1bbbb0=_0x1bbbb0-0x0;var _0x43f560=_0xd08a[_0x1bbbb0];return _0x43f560;};'use strict';var client=require(_0xad08('0x0'));exports['create']=function(_0x3732ac){return client['Request'](_0xad08('0x1'),{'body':_0x3732ac,'log':'CreateMailQueueReport'});};exports['update']=function(_0x5ef449,_0x2dec9b){return client[_0xad08('0x2')]('UpdateMailQueueReport',{'body':_0x2dec9b,'options':{'where':{'uniqueid':_0x5ef449},'order':[['id',_0xad08('0x3')]],'limit':0x1},'log':_0xad08('0x4')});}; \ No newline at end of file +var _0x831b=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client','create'];(function(_0x10c403,_0x246eda){var _0x10816b=function(_0x27de00){while(--_0x27de00){_0x10c403['push'](_0x10c403['shift']());}};_0x10816b(++_0x246eda);}(_0x831b,0x190));var _0xb831=function(_0x75f79d,_0x21dbe6){_0x75f79d=_0x75f79d-0x0;var _0x17f5f6=_0x831b[_0x75f79d];return _0x17f5f6;};'use strict';var client=require(_0xb831('0x0'));exports[_0xb831('0x1')]=function(_0x154982){return client[_0xb831('0x2')](_0xb831('0x3'),{'body':_0x154982,'log':_0xb831('0x3')});};exports[_0xb831('0x4')]=function(_0x2b45dd,_0x5caec7){return client[_0xb831('0x2')](_0xb831('0x5'),{'body':_0x5caec7,'options':{'where':{'uniqueid':_0x2b45dd},'order':[['id','DESC']],'limit':0x1},'log':_0xb831('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 19315be..9108f86 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 _0xc575=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x43f679,_0x158276){var _0x1a5e81=function(_0x2043c1){while(--_0x2043c1){_0x43f679['push'](_0x43f679['shift']());}};_0x1a5e81(++_0x158276);}(_0xc575,0x193));var _0x5c57=function(_0x38c6ff,_0x442ac9){_0x38c6ff=_0x38c6ff-0x0;var _0xfbea01=_0xc575[_0x38c6ff];return _0xfbea01;};'use strict';var client=require(_0x5c57('0x0'));exports[_0x5c57('0x1')]=function(_0x2cf495,_0x5a3cf4){return client['Request'](_0x5c57('0x2'),{'body':_0x5a3cf4,'options':{'where':{'id':_0x2cf495}},'log':_0x5c57('0x3')});};exports[_0x5c57('0x4')]=function(_0xce73c9,_0x1023bc){return client[_0x5c57('0x5')](_0x5c57('0x6'),{'body':_0x1023bc,'options':{'where':{'id':_0xce73c9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xdd4d=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0xdd4d,0x176));var _0xddd4=function(_0x37dde1,_0x78cd51){_0x37dde1=_0x37dde1-0x0;var _0x32bea7=_0xdd4d[_0x37dde1];return _0x32bea7;};'use strict';var client=require(_0xddd4('0x0'));exports[_0xddd4('0x1')]=function(_0x12a733,_0x50cb9a){return client[_0xddd4('0x2')]('UpdateOpenchannelInteraction',{'body':_0x50cb9a,'options':{'where':{'id':_0x12a733}},'log':_0xddd4('0x3')});};exports[_0xddd4('0x4')]=function(_0x22a584,_0x431bd1){return client[_0xddd4('0x2')](_0xddd4('0x5'),{'body':_0x431bd1,'options':{'where':{'id':_0x22a584}},'log':_0xddd4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 47bb972..ac446b8 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 _0xb4e6=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x539312,_0x4ae1b6){var _0x4cbe8f=function(_0x205f6d){while(--_0x205f6d){_0x539312['push'](_0x539312['shift']());}};_0x4cbe8f(++_0x4ae1b6);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0xb4e6[_0x2ee790];return _0x5a54a5;};'use strict';var client=require(_0x6b4e('0x0'));exports['create']=function(_0x2708ca){return client[_0x6b4e('0x1')](_0x6b4e('0x2'),{'body':_0x2708ca,'log':_0x6b4e('0x3')});}; \ No newline at end of file +var _0xa9e0=['../client','create','createOpenchannelMessage'];(function(_0x13e7d0,_0x4442dd){var _0x4e293a=function(_0x58eac9){while(--_0x58eac9){_0x13e7d0['push'](_0x13e7d0['shift']());}};_0x4e293a(++_0x4442dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return client['Request']('CreateOpenchannelMessage',{'body':_0x29929c,'log':_0x0a9e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d2d2675..f908ed6 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 _0xf052=['User','name','online','getOpenchannelQueues','Request','timeout','strategy'];(function(_0x5bdabb,_0x47dda2){var _0x31f81a=function(_0xb89a3f){while(--_0xb89a3f){_0x5bdabb['push'](_0x5bdabb['shift']());}};_0x31f81a(++_0x47dda2);}(_0xf052,0x14c));var _0x2f05=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0xf052[_0x2610db];return _0x5d4d96;};'use strict';var client=require('../client');exports[_0x2f05('0x0')]=function(){return function(){return client[_0x2f05('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x2f05('0x2'),_0x2f05('0x3')],'include':[{'model':_0x2f05('0x4'),'as':'Agents','attributes':['id',_0x2f05('0x5'),_0x2f05('0x6'),'openchannelPause']}]},'log':_0x2f05('0x0')});};}; \ No newline at end of file +var _0xc71b=['Request','name','timeout','strategy','User','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc71b,0xdf));var _0xbc71=function(_0x58c563,_0x28d86a){_0x58c563=_0x58c563-0x0;var _0x529a61=_0xc71b[_0x58c563];return _0x529a61;};'use strict';var client=require(_0xbc71('0x0'));exports[_0xbc71('0x1')]=function(){return function(){return client[_0xbc71('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xbc71('0x3'),_0xbc71('0x4'),_0xbc71('0x5')],'include':[{'model':_0xbc71('0x6'),'as':'Agents','attributes':['id',_0xbc71('0x3'),_0xbc71('0x7'),_0xbc71('0x8')]}]},'log':_0xbc71('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index ccb00df..51dba10 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 _0x5a9f=['../client','create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x5a9f,0xaf));var _0xf5a9=function(_0x431918,_0x19d753){_0x431918=_0x431918-0x0;var _0x2cb0c1=_0x5a9f[_0x431918];return _0x2cb0c1;};'use strict';var client=require(_0xf5a9('0x0'));exports[_0xf5a9('0x1')]=function(_0xf23247){return client[_0xf5a9('0x2')]('CreateOpenchannelQueueReport',{'body':_0xf23247,'log':_0xf5a9('0x3')});};exports[_0xf5a9('0x4')]=function(_0x5c435a,_0x5c58d5){return client[_0xf5a9('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x5c58d5,'options':{'where':{'uniqueid':_0x5c435a},'order':[['id',_0xf5a9('0x5')]],'limit':0x1},'log':_0xf5a9('0x6')});}; \ No newline at end of file +var _0x62ba=['UpdateOpenchannelQueueReport','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x62ba,0x1d2));var _0xa62b=function(_0x4c05be,_0x1bcd7c){_0x4c05be=_0x4c05be-0x0;var _0x18a29e=_0x62ba[_0x4c05be];return _0x18a29e;};'use strict';var client=require(_0xa62b('0x0'));exports[_0xa62b('0x1')]=function(_0x26723e){return client[_0xa62b('0x2')](_0xa62b('0x3'),{'body':_0x26723e,'log':_0xa62b('0x3')});};exports['update']=function(_0x3a5316,_0x2c6760){return client[_0xa62b('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x2c6760,'options':{'where':{'uniqueid':_0x3a5316},'order':[['id','DESC']],'limit':0x1},'log':_0xa62b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c9ac90f..e0e771f 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 _0x4312=['UpdateSmsInteraction','updateSmsInteraction','addTags','Request','addTagsToSmsInteraction'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x4312,0xaf));var _0x2431=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x4312[_0x5ebe34];return _0x36a3ee;};'use strict';var client=require('../client');exports['update']=function(_0x1fd23c,_0xd86297){return client['Request'](_0x2431('0x0'),{'body':_0xd86297,'options':{'where':{'id':_0x1fd23c}},'log':_0x2431('0x1')});};exports[_0x2431('0x2')]=function(_0x237ac5,_0x22db34){return client[_0x2431('0x3')]('AddTagsToSmsInteraction',{'body':_0x22db34,'options':{'where':{'id':_0x237ac5}},'log':_0x2431('0x4')});}; \ No newline at end of file +var _0xd5a3=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd5a3,0x146));var _0x3d5a=function(_0x1277a3,_0xfa0e66){_0x1277a3=_0x1277a3-0x0;var _0x3c6822=_0xd5a3[_0x1277a3];return _0x3c6822;};'use strict';var client=require(_0x3d5a('0x0'));exports[_0x3d5a('0x1')]=function(_0x3a2530,_0x96081d){return client[_0x3d5a('0x2')](_0x3d5a('0x3'),{'body':_0x96081d,'options':{'where':{'id':_0x3a2530}},'log':'updateSmsInteraction'});};exports[_0x3d5a('0x4')]=function(_0x24f30f,_0x4c3e12){return client[_0x3d5a('0x2')](_0x3d5a('0x5'),{'body':_0x4c3e12,'options':{'where':{'id':_0x24f30f}},'log':_0x3d5a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 12e1a20..91bbd49 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 _0x0047=['createSmsMessage','../client','create','Request'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x0047,0x69));var _0x7004=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x0047[_0x50f6e5];return _0x5988c5;};'use strict';var client=require(_0x7004('0x0'));exports[_0x7004('0x1')]=function(_0x5be7dc){return client[_0x7004('0x2')]('CreateSmsMessage',{'body':_0x5be7dc,'log':_0x7004('0x3')});}; \ No newline at end of file +var _0xe023=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xe023,0x1da));var _0x3e02=function(_0x4d701f,_0x3cfcf6){_0x4d701f=_0x4d701f-0x0;var _0x4c3935=_0xe023[_0x4d701f];return _0x4c3935;};'use strict';var client=require(_0x3e02('0x0'));exports[_0x3e02('0x1')]=function(_0x49c7a5){return client[_0x3e02('0x2')](_0x3e02('0x3'),{'body':_0x49c7a5,'log':_0x3e02('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index fdd55e9..135363b 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 _0xcd96=['timeout','User','Agents','online','../client','getSmsQueues','Request','GetSmsQueue','name'];(function(_0x1272af,_0x58dce7){var _0xbb1d0f=function(_0x2523a6){while(--_0x2523a6){_0x1272af['push'](_0x1272af['shift']());}};_0xbb1d0f(++_0x58dce7);}(_0xcd96,0x163));var _0x6cd9=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xcd96[_0x4d40dd];return _0x1c51f2;};'use strict';var client=require(_0x6cd9('0x0'));exports[_0x6cd9('0x1')]=function(){return function(){return client[_0x6cd9('0x2')](_0x6cd9('0x3'),{'options':{'raw':![],'attributes':['id',_0x6cd9('0x4'),_0x6cd9('0x5'),'strategy'],'include':[{'model':_0x6cd9('0x6'),'as':_0x6cd9('0x7'),'attributes':['id',_0x6cd9('0x4'),_0x6cd9('0x8'),'smsPause']}]},'log':_0x6cd9('0x1')});};}; \ No newline at end of file +var _0x122f=['getSmsQueues','Request','name','timeout','Agents','smsPause','../client'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0x122f,0xd1));var _0xf122=function(_0x4f22fe,_0x23f451){_0x4f22fe=_0x4f22fe-0x0;var _0x12adca=_0x122f[_0x4f22fe];return _0x12adca;};'use strict';var client=require(_0xf122('0x0'));exports[_0xf122('0x1')]=function(){return function(){return client[_0xf122('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0xf122('0x3'),_0xf122('0x4'),'strategy'],'include':[{'model':'User','as':_0xf122('0x5'),'attributes':['id',_0xf122('0x3'),'online',_0xf122('0x6')]}]},'log':_0xf122('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 85a755c..9704b0a 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 _0x00f4=['DESC','../client','Request','CreateSmsQueueReport','update'];(function(_0x5593e9,_0x7da291){var _0x27495f=function(_0x223b82){while(--_0x223b82){_0x5593e9['push'](_0x5593e9['shift']());}};_0x27495f(++_0x7da291);}(_0x00f4,0x137));var _0x400f=function(_0x315788,_0x3332d3){_0x315788=_0x315788-0x0;var _0x2fec00=_0x00f4[_0x315788];return _0x2fec00;};'use strict';var client=require(_0x400f('0x0'));exports['create']=function(_0x1e178c){return client[_0x400f('0x1')](_0x400f('0x2'),{'body':_0x1e178c,'log':_0x400f('0x2')});};exports[_0x400f('0x3')]=function(_0x3a4085,_0x173436){return client['Request']('UpdateSmsQueueReport',{'body':_0x173436,'options':{'where':{'uniqueid':_0x3a4085},'order':[['id',_0x400f('0x4')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x75ea=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x435850,_0x32aa47){var _0x5453e4=function(_0x17b32a){while(--_0x17b32a){_0x435850['push'](_0x435850['shift']());}};_0x5453e4(++_0x32aa47);}(_0x75ea,0x7d));var _0xa75e=function(_0x326633,_0x413485){_0x326633=_0x326633-0x0;var _0x1bc807=_0x75ea[_0x326633];return _0x1bc807;};'use strict';var client=require(_0xa75e('0x0'));exports[_0xa75e('0x1')]=function(_0x5cf4fc){return client[_0xa75e('0x2')](_0xa75e('0x3'),{'body':_0x5cf4fc,'log':'CreateSmsQueueReport'});};exports[_0xa75e('0x4')]=function(_0x181697,_0x446097){return client[_0xa75e('0x2')](_0xa75e('0x5'),{'body':_0x446097,'options':{'where':{'uniqueid':_0x181697},'order':[['id','DESC']],'limit':0x1},'log':_0xa75e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8726882..1a9fe66 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 _0x149d=['smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','faxPause','smsPause','chatCapacity','mailCapacity','faxCapacity'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x149d,0x1e8));var _0xd149=function(_0x44fb06,_0x2012b5){_0x44fb06=_0x44fb06-0x0;var _0x39d3c1=_0x149d[_0x44fb06];return _0x39d3c1;};'use strict';var client=require(_0xd149('0x0'));exports[_0xd149('0x1')]=function(){return function(){return client[_0xd149('0x2')](_0xd149('0x3'),{'options':{'raw':!![],'where':{'role':_0xd149('0x4')},'attributes':['id',_0xd149('0x5'),_0xd149('0x6'),_0xd149('0x7'),_0xd149('0x8'),_0xd149('0x9'),_0xd149('0xa'),'mailPause',_0xd149('0xb'),_0xd149('0xc'),'openchannelPause',_0xd149('0xd'),_0xd149('0xe'),_0xd149('0xf'),_0xd149('0x10'),_0xd149('0x11')]},'log':_0xd149('0x1')});};}; \ No newline at end of file +var _0xdbf6=['getAgents','../client','GetUser','agent','name','pauseType','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf6,0xa1));var _0x6dbf=function(_0x4d5045,_0x10e949){_0x4d5045=_0x4d5045-0x0;var _0x73e1bb=_0xdbf6[_0x4d5045];return _0x73e1bb;};'use strict';var client=require(_0x6dbf('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x6dbf('0x1'),{'options':{'raw':!![],'where':{'role':_0x6dbf('0x2')},'attributes':['id',_0x6dbf('0x3'),'online',_0x6dbf('0x4'),'lastPauseAt',_0x6dbf('0x5'),_0x6dbf('0x6'),_0x6dbf('0x7'),_0x6dbf('0x8'),'smsPause',_0x6dbf('0x9'),_0x6dbf('0xa'),_0x6dbf('0xb'),_0x6dbf('0xc'),_0x6dbf('0xd'),_0x6dbf('0xe')]},'log':_0x6dbf('0xf')});};}; \ 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 dd30f14..c28f751 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 _0xa284=['join','find','agents','timeout','atimeout','channel','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa284,0x1e5));var _0x4a28=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa284[_0x4a9fb1];return _0x348672;};'use strict';var schema=require(_0x4a28('0x0'));var _=require('lodash');var util=require(_0x4a28('0x1'));var seqqueue=require(_0x4a28('0x2'));var logger=require(_0x4a28('0x3'))(_0x4a28('0x4'));var strategy=require(_0x4a28('0x5'));var queue=schema({'name':{'type':_0x4a28('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x4a28('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xaa6471,_0xe6b452,_0x530c4d){return logger[_0x4a28('0x8')](util[_0x4a28('0x9')](_0x4a28('0xa'),_0xaa6471,_0xe6b452[_0x4a28('0xb')],_0x530c4d));}function handleFindAgent(_0x3141e3){return function(_0xfcef32){return _0xfcef32[_0x4a28('0xb')][_0x4a28('0xc')]()===_0x3141e3['toLowerCase']();};}exports[_0x4a28('0xd')]=function(_0x40db44,_0x7e2245,_0x4eea90,_0x33e75b){return function(_0x214d55){try{var _0x388d5d={'name':_0x7e2245[0x0],'timeout':_0x7e2245[0x1]};var _0x242738=queue[_0x4a28('0x0')](_0x388d5d,{'typecast':!![]});if(_0x242738[_0x4a28('0xe')]){logger[_0x4a28('0xf')](_0x4a28('0x10'),_0x40db44,_[_0x4a28('0x11')](_0x242738,_0x4a28('0x12'))[_0x4a28('0x13')](',\x20'));_0x214d55['stop']();}else{var _0x291f6b=_[_0x4a28('0x14')](_0x4eea90[_0x4a28('0x15')],handleFindAgent(_0x388d5d[_0x4a28('0xb')]));if(_0x291f6b){var _0x4dd733=(_0x388d5d[_0x4a28('0x16')]||0xa)*0x3e8;var _0x7b7d63,_0x471804;var _0x5ea515=seqqueue['createQueue'](_0x4dd733);_0x5ea515['id']=_0x40db44;_0x5ea515[_0x4a28('0x17')]=_0x4dd733;_0x5ea515['channel']=_0x33e75b[_0x4a28('0x18')];writeLog(_0x40db44,_0x291f6b,util[_0x4a28('0x9')]('START:%s',_0x4dd733));_0x4eea90[_0x4a28('0x19')][_0x40db44]['on'](_0x4a28('0x1a'),function(){_0x5ea515[_0x4a28('0x1b')]();clearTimeout(_0x471804);_0x471804=undefined;if(_0x4eea90['rules'][_0x40db44]){delete _0x4eea90['rules'][_0x40db44];}logger[_0x4a28('0x8')](_0x4a28('0x1c'),_0x40db44);_0x214d55[_0x4a28('0x1d')]();});_0x471804=setTimeout(function(){clearTimeout(_0x471804);_0x5ea515['close']();logger[_0x4a28('0x8')](_0x4a28('0x1e'),_0x40db44);_0x214d55[_0x4a28('0x1f')]();},_0x4dd733);strategy['agent'](_0x5ea515,_0x291f6b,_0x4eea90,_0x33e75b);}else{logger[_0x4a28('0xf')](_0x4a28('0x20'),_0x40db44,_0x388d5d['name']);_0x214d55[_0x4a28('0x1d')]();}}}catch(_0x44ca6e){console[_0x4a28('0x21')](_0x44ca6e);logger[_0x4a28('0xf')](_0x4a28('0x22'),_0x40db44,_0x44ca6e[_0x4a28('0x23')]);_0x214d55[_0x4a28('0x1d')]();}};}; \ No newline at end of file +var _0xa037=['consequence','length','error','[%s][AGENT]\x20%s','map','join','find','agents','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','agent','stop','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase'];(function(_0x5795d2,_0x2ec9d6){var _0x21740c=function(_0x2ab736){while(--_0x2ab736){_0x5795d2['push'](_0x5795d2['shift']());}};_0x21740c(++_0x2ec9d6);}(_0xa037,0x72));var _0x7a03=function(_0x3e66f4,_0x5abee3){_0x3e66f4=_0x3e66f4-0x0;var _0x22d6aa=_0xa037[_0x3e66f4];return _0x22d6aa;};'use strict';var schema=require(_0x7a03('0x0'));var _=require('lodash');var util=require(_0x7a03('0x1'));var seqqueue=require(_0x7a03('0x2'));var logger=require(_0x7a03('0x3'))(_0x7a03('0x4'));var strategy=require(_0x7a03('0x5'));var queue=schema({'name':{'type':_0x7a03('0x6'),'required':!![],'message':_0x7a03('0x7')},'timeout':{'type':_0x7a03('0x8'),'message':_0x7a03('0x9')}});function writeLog(_0x5b9415,_0x4fa47c,_0x4a9c13){return logger[_0x7a03('0xa')](util[_0x7a03('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5b9415,_0x4fa47c[_0x7a03('0xc')],_0x4a9c13));}function handleFindAgent(_0x1e64aa){return function(_0x23cfa8){return _0x23cfa8[_0x7a03('0xc')][_0x7a03('0xd')]()===_0x1e64aa[_0x7a03('0xd')]();};}exports[_0x7a03('0xe')]=function(_0x199fc9,_0x23dde3,_0x19345e,_0x7ad6b2){return function(_0x51e5c5){try{var _0x35ea74={'name':_0x23dde3[0x0],'timeout':_0x23dde3[0x1]};var _0x5f1a33=queue['validate'](_0x35ea74,{'typecast':!![]});if(_0x5f1a33[_0x7a03('0xf')]){logger[_0x7a03('0x10')](_0x7a03('0x11'),_0x199fc9,_[_0x7a03('0x12')](_0x5f1a33,'message')[_0x7a03('0x13')](',\x20'));_0x51e5c5['stop']();}else{var _0x1a38fc=_[_0x7a03('0x14')](_0x19345e[_0x7a03('0x15')],handleFindAgent(_0x35ea74[_0x7a03('0xc')]));if(_0x1a38fc){var _0x347d80=(_0x35ea74['timeout']||0xa)*0x3e8;var _0x24f463,_0x75b3f7;var _0x2b9578=seqqueue['createQueue'](_0x347d80);_0x2b9578['id']=_0x199fc9;_0x2b9578[_0x7a03('0x16')]=_0x347d80;_0x2b9578['channel']=_0x7ad6b2[_0x7a03('0x17')];writeLog(_0x199fc9,_0x1a38fc,util[_0x7a03('0xb')](_0x7a03('0x18'),_0x347d80));_0x19345e[_0x7a03('0x19')][_0x199fc9]['on']('end',function(){_0x2b9578['close']();clearTimeout(_0x75b3f7);_0x75b3f7=undefined;if(_0x19345e[_0x7a03('0x19')][_0x199fc9]){delete _0x19345e[_0x7a03('0x19')][_0x199fc9];}logger[_0x7a03('0xa')](_0x7a03('0x1a'),_0x199fc9);_0x51e5c5['stop']();});_0x75b3f7=setTimeout(function(){clearTimeout(_0x75b3f7);_0x2b9578['close']();logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x199fc9);_0x51e5c5['next']();},_0x347d80);strategy[_0x7a03('0x1b')](_0x2b9578,_0x1a38fc,_0x19345e,_0x7ad6b2);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x199fc9,_0x35ea74['name']);_0x51e5c5[_0x7a03('0x1c')]();}}}catch(_0x4b81ed){console[_0x7a03('0x1d')](_0x4b81ed);logger[_0x7a03('0x10')](_0x7a03('0x1e'),_0x199fc9,_0x4b81ed[_0x7a03('0x1f')]);_0x51e5c5['stop']();}};}; \ 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 8513cb0..58b5a66 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 _0xbf4d=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','interaction','UserId','info','next','contact','format','out','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','[%s][AMAZONLEX]\x20%s','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','dialogState','stringify','lodash','aws-sdk','./utils'];(function(_0x1ba57f,_0xb81938){var _0x5a7f02=function(_0x32b234){while(--_0x32b234){_0x1ba57f['push'](_0x1ba57f['shift']());}};_0x5a7f02(++_0xb81938);}(_0xbf4d,0x197));var _0xdbf4=function(_0x2713e0,_0x16fbf9){_0x2713e0=_0x2713e0-0x0;var _0x3ce6d7=_0xbf4d[_0x2713e0];return _0x3ce6d7;};'use strict';var _=require(_0xdbf4('0x0'));var moment=require('moment');var AWS=require(_0xdbf4('0x1'));var utils=require(_0xdbf4('0x2'));var logger=require(_0xdbf4('0x3'))('routing');var rpc={'chatMessage':require(_0xdbf4('0x4')),'openchannelMessage':require(_0xdbf4('0x5')),'mailMessage':require(_0xdbf4('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x2662fc,_0x5c6ebf){return function(_0x459818){try{if(!_['isNil'](this[_0xdbf4('0x7')][_0xdbf4('0x8')])){logger[_0xdbf4('0x9')]('[%s][AMAZONLEX]\x20%s',_0x2662fc,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x459818[_0xdbf4('0xa')]();}var _0x133983={'ContactId':this[_0xdbf4('0xb')]['id'],'sentAt':moment()[_0xdbf4('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdbf4('0xd')};var _0x112a9a=this[_0xdbf4('0xe')];if(_0x112a9a==='chat'){_0x133983[_0xdbf4('0xf')]=this['account']['id'];}else{_0x133983[_[_0xdbf4('0x10')](_0x112a9a)+_0xdbf4('0x11')]=this[_0xdbf4('0x12')]['id'];}_0x133983[_['upperFirst'](_0x112a9a)+_0xdbf4('0x13')]=this['interaction']['id'];if(this['interaction'][_0xdbf4('0x14')]){var _0x3f41ea=_0x5c6ebf[0x4];if(!_[_0xdbf4('0x15')](_0x3f41ea)){_0x133983['body']=utils[_0xdbf4('0x16')](_0x3f41ea,this);return rpc[_0x112a9a+_0xdbf4('0x17')][_0xdbf4('0x18')](_0x133983)[_0xdbf4('0x19')](function(_0xfc8dd0){logger[_0xdbf4('0x9')]('[%s][AMAZONLEX]\x20%s',_0x2662fc,_0x133983[_0xdbf4('0x1a')]);})[_0xdbf4('0x1b')](function(_0x4350e4){logger[_0xdbf4('0x1c')](_0xdbf4('0x1d'),_0x2662fc,JSON['stringify'](_0x4350e4));})[_0xdbf4('0x1e')](function(){logger[_0xdbf4('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2662fc);_0x459818[_0xdbf4('0x1f')]();});}else{logger[_0xdbf4('0x9')](_0xdbf4('0x20'),_0x2662fc);_0x459818['stop']();}}else{var _0x5777b0=this;var _0xe4bb38=new AWS[(_0xdbf4('0x21'))]({'accessKeyId':_0x5c6ebf[0x0],'secretAccessKey':_0x5c6ebf[0x1],'region':_0x5c6ebf[0x2]});var _0x255e46={'botAlias':_0xdbf4('0x22'),'botName':_0x5c6ebf[0x3],'inputText':this[_0xdbf4('0x23')][_0xdbf4('0x1a')],'userId':this[_0xdbf4('0x7')]['id'][_0xdbf4('0x24')]()};_0xe4bb38[_0xdbf4('0x25')](_0x255e46,function(_0x5693f3,_0x42eed6){if(_0x5693f3){logger['error'](_0xdbf4('0x1d'),_0x2662fc,_0x5693f3[_0xdbf4('0x23')]);_0x459818[_0xdbf4('0xa')]();}else if(_0x42eed6&&_0x42eed6[_0xdbf4('0x23')]){_0x5777b0[_0xdbf4('0x1a')][_0xdbf4('0x26')]=_0x42eed6;_0x133983[_0xdbf4('0x1a')]=_0x42eed6[_0xdbf4('0x23')];return rpc[_0x112a9a+_0xdbf4('0x17')]['create'](_0x133983)[_0xdbf4('0x19')](function(_0x57ab5a){logger[_0xdbf4('0x9')](_0xdbf4('0x1d'),_0x2662fc,_0x133983[_0xdbf4('0x1a')]);if(_0x42eed6[_0xdbf4('0x27')]=='Failed'){_0x459818[_0xdbf4('0xa')]();}else{_0x459818['stop']();}})['catch'](function(_0x2bcece){logger['error'](_0xdbf4('0x1d'),_0x2662fc,JSON[_0xdbf4('0x28')](_0x2bcece));_0x459818[_0xdbf4('0xa')]();});}else{_0x459818[_0xdbf4('0xa')]();}});}}catch(_0x5ae0cf){logger[_0xdbf4('0x1c')](_0xdbf4('0x1d'),_0x2662fc,JSON[_0xdbf4('0x28')](_0x5ae0cf));_0x459818[_0xdbf4('0x1f')]();}};}; \ No newline at end of file +var _0xcce4=['then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','$LATEST','message','toString','postText','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','getMustacheRender','Message','create'];(function(_0x2d2f79,_0x30fd3c){var _0x113263=function(_0x1fed1a){while(--_0x1fed1a){_0x2d2f79['push'](_0x2d2f79['shift']());}};_0x113263(++_0x30fd3c);}(_0xcce4,0x109));var _0x4cce=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xcce4[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x4cce('0x0'));var moment=require(_0x4cce('0x1'));var AWS=require(_0x4cce('0x2'));var utils=require(_0x4cce('0x3'));var logger=require(_0x4cce('0x4'))(_0x4cce('0x5'));var rpc={'chatMessage':require(_0x4cce('0x6')),'openchannelMessage':require(_0x4cce('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4cce('0x8')),'faxMessage':require(_0x4cce('0x9'))};exports['consequence']=function(_0xf67cd5,_0x76b108){return function(_0x2aaf63){try{if(!_['isNil'](this[_0x4cce('0xa')][_0x4cce('0xb')])){logger[_0x4cce('0xc')](_0x4cce('0xd'),_0xf67cd5,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2aaf63[_0x4cce('0xe')]();}var _0x285b57={'ContactId':this[_0x4cce('0xf')]['id'],'sentAt':moment()[_0x4cce('0x10')](_0x4cce('0x11')),'direction':_0x4cce('0x12')};var _0x24e647=this[_0x4cce('0x13')];if(_0x24e647===_0x4cce('0x14')){_0x285b57[_0x4cce('0x15')]=this[_0x4cce('0x16')]['id'];}else{_0x285b57[_[_0x4cce('0x17')](_0x24e647)+'AccountId']=this[_0x4cce('0x16')]['id'];}_0x285b57[_[_0x4cce('0x17')](_0x24e647)+'InteractionId']=this[_0x4cce('0xa')]['id'];if(this[_0x4cce('0xa')][_0x4cce('0x18')]){var _0x3b5e88=_0x76b108[0x4];if(!_[_0x4cce('0x19')](_0x3b5e88)){_0x285b57['body']=utils[_0x4cce('0x1a')](_0x3b5e88,this);return rpc[_0x24e647+_0x4cce('0x1b')][_0x4cce('0x1c')](_0x285b57)[_0x4cce('0x1d')](function(_0x50455d){logger[_0x4cce('0xc')](_0x4cce('0xd'),_0xf67cd5,_0x285b57[_0x4cce('0x1e')]);})[_0x4cce('0x1f')](function(_0x587fcd){logger[_0x4cce('0x20')](_0x4cce('0xd'),_0xf67cd5,JSON[_0x4cce('0x21')](_0x587fcd));})[_0x4cce('0x22')](function(){logger[_0x4cce('0xc')](_0x4cce('0x23'),_0xf67cd5);_0x2aaf63[_0x4cce('0x24')]();});}else{logger[_0x4cce('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xf67cd5);_0x2aaf63[_0x4cce('0x24')]();}}else{var _0x410e65=this;var _0x1d0d11=new AWS['LexRuntime']({'accessKeyId':_0x76b108[0x0],'secretAccessKey':_0x76b108[0x1],'region':_0x76b108[0x2]});var _0x2215d5={'botAlias':_0x4cce('0x25'),'botName':_0x76b108[0x3],'inputText':this[_0x4cce('0x26')][_0x4cce('0x1e')],'userId':this['interaction']['id'][_0x4cce('0x27')]()};_0x1d0d11[_0x4cce('0x28')](_0x2215d5,function(_0x342a23,_0x248e0f){if(_0x342a23){logger['error']('[%s][AMAZONLEX]\x20%s',_0xf67cd5,_0x342a23[_0x4cce('0x26')]);_0x2aaf63['next']();}else if(_0x248e0f&&_0x248e0f[_0x4cce('0x26')]){_0x410e65['body']['amazonlex']=_0x248e0f;_0x285b57[_0x4cce('0x1e')]=_0x248e0f[_0x4cce('0x26')];return rpc[_0x24e647+_0x4cce('0x1b')][_0x4cce('0x1c')](_0x285b57)[_0x4cce('0x1d')](function(_0x43d03c){logger['info'](_0x4cce('0xd'),_0xf67cd5,_0x285b57[_0x4cce('0x1e')]);if(_0x248e0f['dialogState']==_0x4cce('0x29')){_0x2aaf63['next']();}else{_0x2aaf63[_0x4cce('0x24')]();}})['catch'](function(_0x4c7b1f){logger[_0x4cce('0x20')]('[%s][AMAZONLEX]\x20%s',_0xf67cd5,JSON['stringify'](_0x4c7b1f));_0x2aaf63[_0x4cce('0xe')]();});}else{_0x2aaf63[_0x4cce('0xe')]();}});}}catch(_0x1818c2){logger[_0x4cce('0x20')](_0x4cce('0xd'),_0xf67cd5,JSON[_0x4cce('0x21')](_0x1818c2));_0x2aaf63['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 2afa9d6..34af9d8 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 _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x3ef186,_0x30c94b){var _0x4f5f22=function(_0x3794c2){while(--_0x3794c2){_0x3ef186['push'](_0x3ef186['shift']());}};_0x4f5f22(++_0x30c94b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file +var _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['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 d12048e..8ac6d6f 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 _0xfe13=['finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x22491d,_0x3bad40){var _0x431173=function(_0x4fba3f){while(--_0x4fba3f){_0x22491d['push'](_0x22491d['shift']());}};_0x431173(++_0x3bad40);}(_0xfe13,0x178));var _0x3fe1=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xfe13[_0x3b231a];return _0x18d67a;};'use strict';var moment=require(_0x3fe1('0x0'));var logger=require('../../../../config/logger')(_0x3fe1('0x1'));var rpc={'chatInteraction':require(_0x3fe1('0x2')),'openchannelInteraction':require(_0x3fe1('0x3')),'smsInteraction':require(_0x3fe1('0x4')),'mailInteraction':require(_0x3fe1('0x5')),'faxInteraction':require(_0x3fe1('0x6'))};exports['consequence']=function(_0x5074c4,_0x40401b,_0x1223fc,_0x2c5ed2){return function(_0x5caa2e){try{logger[_0x3fe1('0x7')](_0x3fe1('0x8'),_0x5074c4,_0x40401b[0x0]);var _0x1c3fac={'closed':0x1,'closedAt':moment()[_0x3fe1('0x9')](_0x3fe1('0xa')),'closeReason':'system','disposition':_0x40401b[0x0]};if(rpc[_0x2c5ed2['channel']+_0x3fe1('0xb')]){rpc[_0x2c5ed2[_0x3fe1('0xc')]+_0x3fe1('0xb')][_0x3fe1('0xd')](_0x2c5ed2[_0x3fe1('0xe')]['id'],_0x1c3fac)[_0x3fe1('0xf')](function(_0x38681c){logger[_0x3fe1('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5074c4,_0x2c5ed2[_0x3fe1('0xe')]['id']);})[_0x3fe1('0x10')](function(_0x3c0971){logger[_0x3fe1('0x11')](_0x3fe1('0x12'),_0x5074c4,JSON[_0x3fe1('0x13')](_0x3c0971));})[_0x3fe1('0x14')](function(){_0x5caa2e[_0x3fe1('0x15')]();});}}catch(_0x2bbc6b){logger['error'](_0x3fe1('0x12'),_0x5074c4,JSON[_0x3fe1('0x13')](_0x2bbc6b));_0x5caa2e[_0x3fe1('0x15')]();}};}; \ No newline at end of file +var _0x71f4=['../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x71f4,0xf9));var _0x471f=function(_0x1f5114,_0x17981e){_0x1f5114=_0x1f5114-0x0;var _0x5ea0a0=_0x71f4[_0x1f5114];return _0x5ea0a0;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x471f('0x0'));var rpc={'chatInteraction':require(_0x471f('0x1')),'openchannelInteraction':require(_0x471f('0x2')),'smsInteraction':require(_0x471f('0x3')),'mailInteraction':require(_0x471f('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x471f('0x5')]=function(_0x57bbfa,_0x3e0c2e,_0x5978a7,_0x1d0101){return function(_0x3bdf82){try{logger[_0x471f('0x6')](_0x471f('0x7'),_0x57bbfa,_0x3e0c2e[0x0]);var _0x3c63fb={'closed':0x1,'closedAt':moment()[_0x471f('0x8')](_0x471f('0x9')),'closeReason':_0x471f('0xa'),'disposition':_0x3e0c2e[0x0]};if(rpc[_0x1d0101[_0x471f('0xb')]+'Interaction']){rpc[_0x1d0101['channel']+'Interaction'][_0x471f('0xc')](_0x1d0101[_0x471f('0xd')]['id'],_0x3c63fb)['then'](function(_0x29e584){logger[_0x471f('0x6')](_0x471f('0xe'),_0x57bbfa,_0x1d0101['interaction']['id']);})[_0x471f('0xf')](function(_0x16662a){logger[_0x471f('0x10')](_0x471f('0x11'),_0x57bbfa,JSON[_0x471f('0x12')](_0x16662a));})[_0x471f('0x13')](function(){_0x3bdf82[_0x471f('0x14')]();});}}catch(_0x1de7fa){logger[_0x471f('0x10')]('[%s][CLOSE]\x20%s',_0x57bbfa,JSON[_0x471f('0x12')](_0x1de7fa));_0x3bdf82['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 2f2c7ed..e0d6fdd 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 _0x8fed=['isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','YYYY-MM-DD\x20HH:mm:ss','out','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','dialogflow','fulfillment','speech','result','metadata','endConversation','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence'];(function(_0xcf73e4,_0x352893){var _0xc5aa7c=function(_0x22d751){while(--_0x22d751){_0xcf73e4['push'](_0xcf73e4['shift']());}};_0xc5aa7c(++_0x352893);}(_0x8fed,0x1ef));var _0xd8fe=function(_0x1532d0,_0x3c6b5c){_0x1532d0=_0x1532d0-0x0;var _0x501d76=_0x8fed[_0x1532d0];return _0x501d76;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xd8fe('0x0'));var md5=require('md5');var utils=require(_0xd8fe('0x1'));var logger=require(_0xd8fe('0x2'))(_0xd8fe('0x3'));var rpc={'chatMessage':require(_0xd8fe('0x4')),'openchannelMessage':require(_0xd8fe('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd8fe('0x6')),'faxMessage':require(_0xd8fe('0x7'))};exports[_0xd8fe('0x8')]=function(_0x46b586,_0x4cd41b){return function(_0x1702da){try{if(!_[_0xd8fe('0x9')](this[_0xd8fe('0xa')][_0xd8fe('0xb')])){logger[_0xd8fe('0xc')](_0xd8fe('0xd'),_0x46b586,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1702da[_0xd8fe('0xe')]();}var _0x1afedc={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xd8fe('0xf')),'direction':_0xd8fe('0x10')};var _0x27f018=this['channel'];if(_0x27f018==='chat'){_0x1afedc[_0xd8fe('0x11')]=this[_0xd8fe('0x12')]['id'];}else{_0x1afedc[_[_0xd8fe('0x13')](_0x27f018)+_0xd8fe('0x14')]=this[_0xd8fe('0x12')]['id'];}_0x1afedc[_[_0xd8fe('0x13')](_0x27f018)+_0xd8fe('0x15')]=this[_0xd8fe('0xa')]['id'];if(this[_0xd8fe('0xa')][_0xd8fe('0x16')]){var _0x588903=_0x4cd41b[0x2];if(!_['isEmpty'](_0x588903)){_0x1afedc[_0xd8fe('0x17')]=utils[_0xd8fe('0x18')](_0x588903,this);return rpc[_0x27f018+_0xd8fe('0x19')][_0xd8fe('0x1a')](_0x1afedc)[_0xd8fe('0x1b')](function(_0x3bede4){logger['info'](_0xd8fe('0xd'),_0x46b586,_0x1afedc[_0xd8fe('0x17')]);})[_0xd8fe('0x1c')](function(_0x3e85e9){logger[_0xd8fe('0x1d')](_0xd8fe('0xd'),_0x46b586,JSON[_0xd8fe('0x1e')](_0x3e85e9));})[_0xd8fe('0x1f')](function(){logger[_0xd8fe('0xc')](_0xd8fe('0x20'),_0x46b586);_0x1702da['stop']();});}else{logger['info'](_0xd8fe('0x21'),_0x46b586);_0x1702da[_0xd8fe('0x22')]();}}else{var _0x5c691c=this;var _0x176238=apiai(_0x4cd41b[0x0],{'language':_0x4cd41b[0x1]||'en'});return _0x176238['textRequest'](this[_0xd8fe('0x23')][_0xd8fe('0x17')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x148e3e){_0x5c691c['body'][_0xd8fe('0x24')]=_0x148e3e;_0x1afedc[_0xd8fe('0x17')]=_0x148e3e['result'][_0xd8fe('0x25')][_0xd8fe('0x26')];return rpc[_0x27f018+_0xd8fe('0x19')]['create'](_0x1afedc)[_0xd8fe('0x1b')](function(_0x8ec042){logger[_0xd8fe('0xc')](_0xd8fe('0xd'),_0x46b586,_0x1afedc['body']);if(_0x148e3e[_0xd8fe('0x27')][_0xd8fe('0x28')][_0xd8fe('0x29')]){_0x1702da[_0xd8fe('0xe')]();}else{_0x1702da[_0xd8fe('0x22')]();}})[_0xd8fe('0x1c')](function(_0x473fe7){logger[_0xd8fe('0x1d')](_0xd8fe('0xd'),_0x46b586,JSON[_0xd8fe('0x1e')](_0x473fe7));_0x1702da[_0xd8fe('0xe')]();});})[_0xd8fe('0x1c')](function(_0x9866da){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x46b586,_0x9866da[_0xd8fe('0x23')]);_0x1702da[_0xd8fe('0xe')]();});}}catch(_0x3f0bdb){logger[_0xd8fe('0x1d')](_0xd8fe('0xd'),_0x46b586,JSON[_0xd8fe('0x1e')](_0x3f0bdb));_0x1702da['stop']();}};}; \ No newline at end of file +var _0x4275=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','fulfillment','speech','metadata','endConversation','stop','stringify','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x4275,0x1d2));var _0x5427=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4275[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5427('0x0'));var moment=require(_0x5427('0x1'));var apiai=require('apiai-promise');var md5=require(_0x5427('0x2'));var utils=require(_0x5427('0x3'));var logger=require(_0x5427('0x4'))(_0x5427('0x5'));var rpc={'chatMessage':require(_0x5427('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5427('0x7')),'smsMessage':require(_0x5427('0x8')),'faxMessage':require(_0x5427('0x9'))};exports[_0x5427('0xa')]=function(_0x60ff8b,_0x399cf6){return function(_0x295a8e){try{if(!_[_0x5427('0xb')](this[_0x5427('0xc')][_0x5427('0xd')])){logger[_0x5427('0xe')](_0x5427('0xf'),_0x60ff8b,_0x5427('0x10'));return _0x295a8e[_0x5427('0x11')]();}var _0x28e867={'ContactId':this[_0x5427('0x12')]['id'],'sentAt':moment()[_0x5427('0x13')](_0x5427('0x14')),'direction':_0x5427('0x15')};var _0x594171=this[_0x5427('0x16')];if(_0x594171===_0x5427('0x17')){_0x28e867[_0x5427('0x18')]=this[_0x5427('0x19')]['id'];}else{_0x28e867[_[_0x5427('0x1a')](_0x594171)+_0x5427('0x1b')]=this[_0x5427('0x19')]['id'];}_0x28e867[_['upperFirst'](_0x594171)+_0x5427('0x1c')]=this[_0x5427('0xc')]['id'];if(this[_0x5427('0xc')][_0x5427('0x1d')]){var _0x4bc351=_0x399cf6[0x2];if(!_['isEmpty'](_0x4bc351)){_0x28e867[_0x5427('0x1e')]=utils[_0x5427('0x1f')](_0x4bc351,this);return rpc[_0x594171+_0x5427('0x20')][_0x5427('0x21')](_0x28e867)[_0x5427('0x22')](function(_0x1727fb){logger[_0x5427('0xe')](_0x5427('0xf'),_0x60ff8b,_0x28e867[_0x5427('0x1e')]);})[_0x5427('0x23')](function(_0x1d3bd2){logger[_0x5427('0x24')](_0x5427('0xf'),_0x60ff8b,JSON['stringify'](_0x1d3bd2));})[_0x5427('0x25')](function(){logger[_0x5427('0xe')](_0x5427('0x26'),_0x60ff8b);_0x295a8e['stop']();});}else{logger[_0x5427('0xe')](_0x5427('0x27'),_0x60ff8b);_0x295a8e['stop']();}}else{var _0x552514=this;var _0x17175b=apiai(_0x399cf6[0x0],{'language':_0x399cf6[0x1]||'en'});return _0x17175b['textRequest'](this[_0x5427('0x28')]['body'],{'sessionId':md5(this[_0x5427('0xc')]['id'])})['then'](function(_0x29b9df){_0x552514[_0x5427('0x1e')][_0x5427('0x29')]=_0x29b9df;_0x28e867['body']=_0x29b9df['result'][_0x5427('0x2a')][_0x5427('0x2b')];return rpc[_0x594171+'Message'][_0x5427('0x21')](_0x28e867)['then'](function(_0x2c8f56){logger[_0x5427('0xe')](_0x5427('0xf'),_0x60ff8b,_0x28e867[_0x5427('0x1e')]);if(_0x29b9df['result'][_0x5427('0x2c')][_0x5427('0x2d')]){_0x295a8e[_0x5427('0x11')]();}else{_0x295a8e[_0x5427('0x2e')]();}})['catch'](function(_0x7c2f3f){logger[_0x5427('0x24')](_0x5427('0xf'),_0x60ff8b,JSON[_0x5427('0x2f')](_0x7c2f3f));_0x295a8e[_0x5427('0x11')]();});})['catch'](function(_0x26abde){logger[_0x5427('0x24')](_0x5427('0xf'),_0x60ff8b,_0x26abde['message']);_0x295a8e[_0x5427('0x11')]();});}}catch(_0x52bab0){logger[_0x5427('0x24')](_0x5427('0xf'),_0x60ff8b,JSON[_0x5427('0x2f')](_0x52bab0));_0x295a8e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 187e84b..6cdc4fc 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 _0x4612=['message','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','map'];(function(_0x5c6cc1,_0x1e68fc){var _0x21c68c=function(_0x4250b4){while(--_0x4250b4){_0x5c6cc1['push'](_0x5c6cc1['shift']());}};_0x21c68c(++_0x1e68fc);}(_0x4612,0x82));var _0x2461=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4612[_0x110c3d];return _0x226d67;};'use strict';var schema=require(_0x2461('0x0'));var _=require(_0x2461('0x1'));var htmlToText=require(_0x2461('0x2'));var utils=require('./utils');var logger=require(_0x2461('0x3'))(_0x2461('0x4'));var gotoif=schema({'condition':{'type':_0x2461('0x5'),'required':!![],'message':_0x2461('0x6')},'priorityTrue':{'type':_0x2461('0x7'),'message':_0x2461('0x8')},'priorityFalse':{'type':_0x2461('0x7'),'message':_0x2461('0x9')}});exports['consequence']=function(_0xe5b8a2,_0x2abc3c){return function(_0x11499f){try{var _0x37d764={'condition':htmlToText[_0x2461('0xa')](utils[_0x2461('0xb')](_0x2abc3c[0x0],this),{'wordwrap':![]})[_0x2461('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2abc3c[0x1],'priorityFalse':_0x2abc3c[0x2]};var _0x2d41e1=gotoif[_0x2461('0x0')](_0x37d764,{'typecast':!![]});if(_0x2d41e1[_0x2461('0xd')]){logger['error']('[%s][GOTOIF]\x20%s',_0xe5b8a2,_[_0x2461('0xe')](_0x2d41e1,_0x2461('0xf'))['join'](',\x20'));_0x11499f[_0x2461('0x10')]();}else{try{var _0x878de7=eval('('+_0x37d764['condition']+')');var _0x4775da=_0x878de7?_0x37d764[_0x2461('0x11')]:_0x37d764[_0x2461('0x12')];logger[_0x2461('0x13')](_0x2461('0x14'),_0xe5b8a2,_0x37d764['condition'],_0x878de7,_0x4775da||_0x2461('0x15'));if(_0x4775da){var _0x5146a5=_[_0x2461('0x16')](_0x11499f[_0x2461('0x17')](),{'p':_0x4775da});if(_0x5146a5>=0x0){logger[_0x2461('0x13')](_0x2461('0x18'),_0xe5b8a2,_0x4775da||'next',_0x5146a5);_0x11499f[_0x2461('0x15')](_0x5146a5);}else{logger[_0x2461('0x13')](_0x2461('0x19'),_0xe5b8a2,_0x4775da||_0x2461('0x15'));_0x11499f['stop']();}}else{_0x11499f[_0x2461('0x15')]();}}catch(_0x3c06e9){logger[_0x2461('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0xe5b8a2,_0x3c06e9[_0x2461('0xf')]);_0x11499f[_0x2461('0x10')]();}}}catch(_0x35a1c0){logger['error'](_0x2461('0x1b'),_0xe5b8a2,JSON[_0x2461('0x1c')](_0x35a1c0));_0x11499f[_0x2461('0x10')]();}};}; \ No newline at end of file +var _0xc0db=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x5f32a5,_0x1caa7d){var _0x171c72=function(_0x8b5426){while(--_0x8b5426){_0x5f32a5['push'](_0x5f32a5['shift']());}};_0x171c72(++_0x1caa7d);}(_0xc0db,0x118));var _0xbc0d=function(_0x722ded,_0x2dbe0f){_0x722ded=_0x722ded-0x0;var _0x229d4f=_0xc0db[_0x722ded];return _0x229d4f;};'use strict';var schema=require(_0xbc0d('0x0'));var _=require(_0xbc0d('0x1'));var htmlToText=require(_0xbc0d('0x2'));var utils=require(_0xbc0d('0x3'));var logger=require(_0xbc0d('0x4'))(_0xbc0d('0x5'));var gotoif=schema({'condition':{'type':_0xbc0d('0x6'),'required':!![],'message':_0xbc0d('0x7')},'priorityTrue':{'type':_0xbc0d('0x8'),'message':_0xbc0d('0x9')},'priorityFalse':{'type':_0xbc0d('0x8'),'message':_0xbc0d('0xa')}});exports[_0xbc0d('0xb')]=function(_0x104be9,_0x299ebc){return function(_0x1b008f){try{var _0x2a6063={'condition':htmlToText['fromString'](utils[_0xbc0d('0xc')](_0x299ebc[0x0],this),{'wordwrap':![]})[_0xbc0d('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x299ebc[0x1],'priorityFalse':_0x299ebc[0x2]};var _0x2df12e=gotoif[_0xbc0d('0x0')](_0x2a6063,{'typecast':!![]});if(_0x2df12e[_0xbc0d('0xe')]){logger[_0xbc0d('0xf')](_0xbc0d('0x10'),_0x104be9,_[_0xbc0d('0x11')](_0x2df12e,_0xbc0d('0x12'))[_0xbc0d('0x13')](',\x20'));_0x1b008f[_0xbc0d('0x14')]();}else{try{var _0x41f2d1=eval('('+_0x2a6063[_0xbc0d('0x15')]+')');var _0xe23d21=_0x41f2d1?_0x2a6063['priorityTrue']:_0x2a6063[_0xbc0d('0x16')];logger[_0xbc0d('0x17')](_0xbc0d('0x18'),_0x104be9,_0x2a6063[_0xbc0d('0x15')],_0x41f2d1,_0xe23d21||'next');if(_0xe23d21){var _0x57bd8d=_[_0xbc0d('0x19')](_0x1b008f[_0xbc0d('0x1a')](),{'p':_0xe23d21});if(_0x57bd8d>=0x0){logger[_0xbc0d('0x17')](_0xbc0d('0x1b'),_0x104be9,_0xe23d21||'next',_0x57bd8d);_0x1b008f['next'](_0x57bd8d);}else{logger[_0xbc0d('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x104be9,_0xe23d21||'next');_0x1b008f[_0xbc0d('0x14')]();}}else{_0x1b008f[_0xbc0d('0x1c')]();}}catch(_0x231b36){logger['error'](_0xbc0d('0x1d'),_0x104be9,_0x231b36['message']);_0x1b008f[_0xbc0d('0x14')]();}}}catch(_0x2d6939){logger[_0xbc0d('0xf')](_0xbc0d('0x10'),_0x104be9,JSON[_0xbc0d('0x1e')](_0x2d6939));_0x1b008f['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 ff27018..1b41af7 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 _0x4a01=['length','[%s][GOTOP]\x20%s','message','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','stop','error','stringify','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4a01,0x11b));var _0x14a0=function(_0x5a775b,_0x17ca00){_0x5a775b=_0x5a775b-0x0;var _0x2af5eb=_0x4a01[_0x5a775b];return _0x2af5eb;};'use strict';var schema=require('validate');var _=require(_0x14a0('0x0'));var logger=require(_0x14a0('0x1'))('routing');var gotop=schema({'priority':{'type':_0x14a0('0x2'),'required':!![],'message':_0x14a0('0x3')}});exports['consequence']=function(_0x3ebde6,_0x5b8375){return function(_0x45eae7){try{var _0x38e870={'priority':_0x5b8375[0x0]};var _0x1a52cf=gotop[_0x14a0('0x4')](_0x38e870,{'typecast':!![]});if(_0x1a52cf[_0x14a0('0x5')]){logger['error'](_0x14a0('0x6'),_0x3ebde6,_['map'](_0x1a52cf,_0x14a0('0x7'))['join'](',\x20'));_0x45eae7['stop']();}else{logger[_0x14a0('0x8')](_0x14a0('0x9'),_0x3ebde6,_0x38e870[_0x14a0('0xa')]);if(_0x38e870[_0x14a0('0xa')]){var _0xe64502=_[_0x14a0('0xb')](_0x45eae7['rules'](),{'p':_0x38e870[_0x14a0('0xa')]});if(_0xe64502>=0x0){logger[_0x14a0('0x8')](_0x14a0('0xc'),_0x3ebde6,_0x38e870[_0x14a0('0xa')]||_0x14a0('0xd'),_0xe64502);_0x45eae7[_0x14a0('0xd')](_0xe64502);}else{logger[_0x14a0('0x8')](_0x14a0('0xe'),_0x3ebde6,_0x38e870[_0x14a0('0xa')]||_0x14a0('0xd'));_0x45eae7[_0x14a0('0xf')]();}}else{_0x45eae7['next']();}}}catch(_0x5b9a51){logger[_0x14a0('0x10')](_0x14a0('0x6'),_0x3ebde6,JSON[_0x14a0('0x11')](_0x5b9a51));_0x45eae7[_0x14a0('0xf')]();}};}; \ No newline at end of file +var _0x833e=['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','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x554ca4,_0x4b1236){var _0x5662b8=function(_0x349cbf){while(--_0x349cbf){_0x554ca4['push'](_0x554ca4['shift']());}};_0x5662b8(++_0x4b1236);}(_0x833e,0xbf));var _0xe833=function(_0x315f68,_0x49166f){_0x315f68=_0x315f68-0x0;var _0x3da10c=_0x833e[_0x315f68];return _0x3da10c;};'use strict';var schema=require(_0xe833('0x0'));var _=require(_0xe833('0x1'));var logger=require('../../../../config/logger')(_0xe833('0x2'));var gotop=schema({'priority':{'type':_0xe833('0x3'),'required':!![],'message':_0xe833('0x4')}});exports[_0xe833('0x5')]=function(_0x644da4,_0x1bc513){return function(_0x4e8a99){try{var _0x26e907={'priority':_0x1bc513[0x0]};var _0x46b159=gotop[_0xe833('0x0')](_0x26e907,{'typecast':!![]});if(_0x46b159[_0xe833('0x6')]){logger[_0xe833('0x7')](_0xe833('0x8'),_0x644da4,_[_0xe833('0x9')](_0x46b159,_0xe833('0xa'))[_0xe833('0xb')](',\x20'));_0x4e8a99[_0xe833('0xc')]();}else{logger[_0xe833('0xd')](_0xe833('0xe'),_0x644da4,_0x26e907['priority']);if(_0x26e907[_0xe833('0xf')]){var _0x3c1509=_[_0xe833('0x10')](_0x4e8a99[_0xe833('0x11')](),{'p':_0x26e907[_0xe833('0xf')]});if(_0x3c1509>=0x0){logger[_0xe833('0xd')](_0xe833('0x12'),_0x644da4,_0x26e907['priority']||'next',_0x3c1509);_0x4e8a99[_0xe833('0x13')](_0x3c1509);}else{logger[_0xe833('0xd')](_0xe833('0x14'),_0x644da4,_0x26e907[_0xe833('0xf')]||_0xe833('0x13'));_0x4e8a99['stop']();}}else{_0x4e8a99[_0xe833('0x13')]();}}}catch(_0xb889ca){logger[_0xe833('0x7')](_0xe833('0x8'),_0x644da4,JSON[_0xe833('0x15')](_0xb889ca));_0x4e8a99[_0xe833('0xc')]();}};}; \ 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 56f8ff5..67aafc6 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 _0x933c=['[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','AccountId','InteractionId','Message','create','then'];(function(_0x5304ce,_0x2d68c8){var _0x122476=function(_0x163675){while(--_0x163675){_0x5304ce['push'](_0x5304ce['shift']());}};_0x122476(++_0x2d68c8);}(_0x933c,0x13e));var _0xc933=function(_0x41420c,_0x5d7703){_0x41420c=_0x41420c-0x0;var _0x2bbf99=_0x933c[_0x41420c];return _0x2bbf99;};'use strict';var _=require(_0xc933('0x0'));var utils=require(_0xc933('0x1'));var logger=require('../../../../config/logger')(_0xc933('0x2'));var rpc={'chatMessage':require(_0xc933('0x3')),'openchannelMessage':require(_0xc933('0x4')),'mailMessage':require(_0xc933('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc933('0x6'))};exports[_0xc933('0x7')]=function(_0x2c8306,_0x82a9e6){return function(_0x3cadd8){try{var _0x3e639b={'body':utils[_0xc933('0x8')](_0x82a9e6[0x0],this),'ContactId':this['contact']['id']};if(this[_0xc933('0x9')]===_0xc933('0xa')){_0x3e639b['ChatWebsiteId']=this[_0xc933('0xb')]['id'];}else{_0x3e639b[_[_0xc933('0xc')](this[_0xc933('0x9')])+_0xc933('0xd')]=this[_0xc933('0xb')]['id'];}_0x3e639b[_[_0xc933('0xc')](this[_0xc933('0x9')])+_0xc933('0xe')]=this['interaction']['id'];if(rpc[this[_0xc933('0x9')]+_0xc933('0xf')]){return rpc[this['channel']+_0xc933('0xf')][_0xc933('0x10')](_0x3e639b)[_0xc933('0x11')](function(_0x3e1cd9){logger['info'](_0xc933('0x12'),_0x2c8306,_0x3e639b[_0xc933('0x13')]);_0x3cadd8['next']();})[_0xc933('0x14')](function(_0x4637af){logger[_0xc933('0x15')]('[%s][MESSAGE]\x20%s',_0x2c8306,JSON['stringify'](_0x4637af));_0x3cadd8[_0xc933('0x16')]();});}}catch(_0x502116){logger['error']('[%s][MESSAGE]\x20%s',_0x2c8306,JSON[_0xc933('0x17')](_0x502116));_0x3cadd8[_0xc933('0x16')]();}};}; \ No newline at end of file +var _0x06f8=['getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence'];(function(_0x4500bb,_0x2df5aa){var _0x2118e8=function(_0x543070){while(--_0x543070){_0x4500bb['push'](_0x4500bb['shift']());}};_0x2118e8(++_0x2df5aa);}(_0x06f8,0x116));var _0x806f=function(_0xea61f5,_0x5c4752){_0xea61f5=_0xea61f5-0x0;var _0x454ab7=_0x06f8[_0xea61f5];return _0x454ab7;};'use strict';var _=require(_0x806f('0x0'));var utils=require(_0x806f('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x806f('0x2')),'openchannelMessage':require(_0x806f('0x3')),'mailMessage':require(_0x806f('0x4')),'smsMessage':require(_0x806f('0x5')),'faxMessage':require(_0x806f('0x6'))};exports[_0x806f('0x7')]=function(_0x3c5945,_0x55ba54){return function(_0x3a5e31){try{var _0x389f9d={'body':utils[_0x806f('0x8')](_0x55ba54[0x0],this),'ContactId':this[_0x806f('0x9')]['id']};if(this[_0x806f('0xa')]===_0x806f('0xb')){_0x389f9d[_0x806f('0xc')]=this[_0x806f('0xd')]['id'];}else{_0x389f9d[_[_0x806f('0xe')](this[_0x806f('0xa')])+'AccountId']=this['account']['id'];}_0x389f9d[_['upperFirst'](this[_0x806f('0xa')])+_0x806f('0xf')]=this[_0x806f('0x10')]['id'];if(rpc[this[_0x806f('0xa')]+'Message']){return rpc[this['channel']+_0x806f('0x11')]['create'](_0x389f9d)['then'](function(_0x5b8f32){logger[_0x806f('0x12')](_0x806f('0x13'),_0x3c5945,_0x389f9d[_0x806f('0x14')]);_0x3a5e31[_0x806f('0x15')]();})[_0x806f('0x16')](function(_0x2962f5){logger['error'](_0x806f('0x13'),_0x3c5945,JSON[_0x806f('0x17')](_0x2962f5));_0x3a5e31[_0x806f('0x18')]();});}}catch(_0x48269c){logger[_0x806f('0x19')](_0x806f('0x13'),_0x3c5945,JSON['stringify'](_0x48269c));_0x3a5e31[_0x806f('0x18')]();}};}; \ 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 a2954b1..9a99760 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 _0x685b=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x685b,0x110));var _0xb685=function(_0x53208e,_0x4a1eb8){_0x53208e=_0x53208e-0x0;var _0xa97d9b=_0x685b[_0x53208e];return _0xa97d9b;};'use strict';var utils=require(_0xb685('0x0'));var logger=require(_0xb685('0x1'))(_0xb685('0x2'));exports[_0xb685('0x3')]=function(_0x54ced7,_0x312ea7){return function(_0x471f5a){try{logger[_0xb685('0x4')](_0xb685('0x5'),_0x54ced7,utils[_0xb685('0x6')](_0x312ea7[0x0],this));_0x471f5a[_0xb685('0x7')]();}catch(_0x42572e){logger[_0xb685('0x8')]('[%s][NOOP]\x20%s',_0x54ced7,JSON[_0xb685('0x9')](_0x42572e));_0x471f5a[_0xb685('0xa')]();}};}; \ No newline at end of file +var _0x13e3=['[%s][NOOP]\x20%s','getMustacheRender','error','stringify','../../../../config/logger','routing','info'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x13e3,0x74));var _0x313e=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x13e3[_0x5a3cf0];return _0x5a64ee;};'use strict';var utils=require('./utils');var logger=require(_0x313e('0x0'))(_0x313e('0x1'));exports['consequence']=function(_0x92d1a7,_0x416d9b){return function(_0xf25815){try{logger[_0x313e('0x2')](_0x313e('0x3'),_0x92d1a7,utils[_0x313e('0x4')](_0x416d9b[0x0],this));_0xf25815['next']();}catch(_0x41280e){logger[_0x313e('0x5')]('[%s][NOOP]\x20%s',_0x92d1a7,JSON[_0x313e('0x6')](_0x41280e));_0xf25815['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 23fe47d..1263472 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 _0xa941=['[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','qtimeout','rules','close','info','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','./strategy','redis','defaults','socket.io-emitter','account','queue','from','emit','queue_id','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/chatQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','body','update','update\x20queue\x20report'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xa941,0x15e));var _0x1a94=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa941[_0x59ee6f];return _0x4c0979;};'use strict';var schema=require('validate');var _=require(_0x1a94('0x0'));var util=require(_0x1a94('0x1'));var seqqueue=require(_0x1a94('0x2'));var moment=require(_0x1a94('0x3'));var Redis=require(_0x1a94('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1a94('0x5'));config[_0x1a94('0x6')]=_[_0x1a94('0x7')](config[_0x1a94('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1a94('0x8'))(new Redis(config[_0x1a94('0x6')]));var attributes=['id','queue_id',_0x1a94('0x9'),_0x1a94('0xa'),_0x1a94('0xb'),'joinAt'];function emit(_0xa6e7c8,_0x4e8dff,_0x1f07b5){io['to'](_0xa6e7c8)[_0x1a94('0xc')](_0x4e8dff,_0x1f07b5);}function emitChannelQueueInteraction(_0x20f38c,_0x1727a0,_0x5f07e8,_0x1aa980,_0x45c638,_0x2d2994,_0x55e73c,_0x501cb7){_0x5f07e8[_0x1a94('0xd')]=_0x501cb7;_0x5f07e8[_0x1a94('0xa')]=_0x1727a0;_0x5f07e8[_0x1a94('0x9')]=_0x1aa980;_0x5f07e8['id']=_0x45c638;if(_0x2d2994){_0x55e73c[util['format'](_0x1a94('0xe'),_0x20f38c)][_0x45c638]=_[_0x1a94('0xf')](_0x5f07e8,attributes);}else{delete _0x55e73c[util[_0x1a94('0x10')](_0x1a94('0xe'),_0x20f38c)][_0x45c638];}emit(util['format'](_0x1a94('0x11'),_0x20f38c,_0x1727a0),util[_0x1a94('0x10')](_0x1a94('0x12'),_0x20f38c,_0x2d2994?_0x1a94('0x13'):'remove'),_['pick'](_0x5f07e8,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x1a94('0x14')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x1a94('0x15'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x1a94('0x16')},'timeout':{'type':_0x1a94('0x17'),'message':_0x1a94('0x18')}});function startRouting(_0x226145,_0x3aa74e,_0xf6ab15,_0x5efe0c){if(_0x226145&&_0x3aa74e&&_0xf6ab15){_0x3aa74e[_0x1a94('0x19')]+=0x1;var _0x30f2b5={'uniqueid':_0x226145,'from':_0xf6ab15['body']?_0xf6ab15['body'][_0x1a94('0xb')]:'','joinAt':moment()[_0x1a94('0x10')](_0x1a94('0x1a')),'ContactId':_0xf6ab15[_0x1a94('0x1b')]?_0xf6ab15['contact']['id']:null,'ListId':_0xf6ab15[_0x1a94('0x1c')]?_0xf6ab15[_0x1a94('0x1c')]['id']:null};_0x30f2b5[_[_0x1a94('0x1d')](_0xf6ab15[_0x1a94('0x1e')])+_0x1a94('0x1f')]=_0x3aa74e['id']||null;_0x30f2b5[_[_0x1a94('0x1d')](_0xf6ab15[_0x1a94('0x1e')])+_0x1a94('0x20')]=_0xf6ab15[_0x1a94('0x21')]?_0xf6ab15[_0x1a94('0x21')]['id']:null;_0x30f2b5[_[_0x1a94('0x1d')](_0xf6ab15[_0x1a94('0x1e')])+'MessageId']=_0xf6ab15[_0x1a94('0x22')]?_0xf6ab15[_0x1a94('0x22')]['id']:null;_0x30f2b5[_[_0x1a94('0x1d')](_0xf6ab15[_0x1a94('0x1e')])+(_0xf6ab15[_0x1a94('0x1e')]!=='chat'?_0x1a94('0x23'):_0x1a94('0x24'))]=_0xf6ab15[_0x1a94('0x9')]?_0xf6ab15[_0x1a94('0x9')]['id']:null;logger['info'](util['format'](_0x1a94('0x25'),_0x226145,_0x3aa74e[_0x1a94('0x26')]));emitChannelQueueInteraction(_0xf6ab15[_0x1a94('0x1e')],_0x3aa74e[_0x1a94('0x26')],_0x30f2b5,_0xf6ab15[_0x1a94('0x9')][_0x1a94('0x26')],_0xf6ab15[_0x1a94('0x22')]['id'],!![],_0x5efe0c,_0x3aa74e['id']);if(rpc[_0xf6ab15[_0x1a94('0x1e')]+_0x1a94('0x27')]){return rpc[_0xf6ab15[_0x1a94('0x1e')]+_0x1a94('0x27')][_0x1a94('0x28')](_0x30f2b5)[_0x1a94('0x29')](function(_0x36f2fd){logger[_0x1a94('0x2a')]('create\x20queue\x20report');});}}}function stopRouting(_0x13bc50,_0x208a35,_0x193a79,_0x4c4e1d){if(_0x13bc50&&_0x208a35){_0x208a35[_0x1a94('0x19')]-=0x1;var _0x18d4a6={'leaveAt':moment()[_0x1a94('0x10')](_0x1a94('0x1a')),'acceptAt':moment()[_0x1a94('0x10')](_0x1a94('0x1a')),'reason':'accepted'};logger['info'](util[_0x1a94('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x13bc50,_0x208a35[_0x1a94('0x26')]));emitChannelQueueInteraction(_0x193a79[_0x1a94('0x1e')],_0x208a35[_0x1a94('0x26')],_0x193a79[_0x1a94('0x2b')],_0x193a79[_0x1a94('0x9')]['name'],_0x193a79[_0x1a94('0x22')]['id'],![],_0x4c4e1d,_0x208a35['id']);if(rpc[_0x193a79['channel']+_0x1a94('0x27')]){return rpc[_0x193a79[_0x1a94('0x1e')]+_0x1a94('0x27')][_0x1a94('0x2c')](_0x13bc50,_0x18d4a6)[_0x1a94('0x29')](function(_0x5abab6){logger[_0x1a94('0x2a')](_0x1a94('0x2d'));});}}}function endRouting(_0x21f8ab,_0x5a8acb,_0x1d6dc7,_0x174a31){if(_0x21f8ab&&_0x5a8acb){_0x5a8acb[_0x1a94('0x19')]-=0x1;var _0xc06b={'leaveAt':moment()[_0x1a94('0x10')](_0x1a94('0x1a')),'exitAt':moment()[_0x1a94('0x10')](_0x1a94('0x1a')),'reason':'timeout'};logger['info'](util['format'](_0x1a94('0x2e'),_0x21f8ab,_0x5a8acb[_0x1a94('0x26')]));emitChannelQueueInteraction(_0x1d6dc7[_0x1a94('0x1e')],_0x5a8acb[_0x1a94('0x26')],_0x1d6dc7[_0x1a94('0x2b')],_0x1d6dc7[_0x1a94('0x9')][_0x1a94('0x26')],_0x1d6dc7['message']['id'],![],_0x174a31);if(rpc[_0x1d6dc7[_0x1a94('0x1e')]+'QueueReport']){return rpc[_0x1d6dc7['channel']+_0x1a94('0x27')][_0x1a94('0x2c')](_0x21f8ab,_0xc06b)[_0x1a94('0x29')](function(_0x57a51e){logger['error'](_0x1a94('0x2d'));});}}}function handleFindQueue(_0x12eb72){return function(_0x2b0536){return _0x2b0536[_0x1a94('0x26')][_0x1a94('0x2f')]()===_0x12eb72[_0x1a94('0x2f')]();};}exports['consequence']=function(_0x411b5b,_0x6a9216,_0x396cd0,_0x188224){return function(_0xa08547){try{var _0x34fb41={'name':_0x6a9216[0x0],'timeout':_0x6a9216[0x1]};var _0x17ee41=queue['validate'](_0x34fb41,{'typecast':!![]});if(_0x17ee41[_0x1a94('0x30')]){logger[_0x1a94('0x2a')](_0x1a94('0x31'),_0x411b5b,_['map'](_0x17ee41,_0x1a94('0x22'))[_0x1a94('0x32')](',\x20'));_0xa08547[_0x1a94('0x33')]();}else{var _0x55c8d4=_[_0x1a94('0x34')](_0x396cd0[_0x188224[_0x1a94('0x1e')]+_0x1a94('0x35')],handleFindQueue(_0x34fb41[_0x1a94('0x26')]));if(_0x55c8d4){startRouting(_0x411b5b,_0x55c8d4,_0x188224,_0x396cd0);var _0x748a3b=(_0x55c8d4[_0x1a94('0x36')]||0xa)*0x3e8;var _0x2518cb=(_0x34fb41[_0x1a94('0x36')]||0x14)*0x3e8;var _0x313819,_0x566b86;if(_0x748a3b>_0x2518cb){_0x2518cb=_0x748a3b;}var _0x9928bd=seqqueue['createQueue'](_0x748a3b);_0x9928bd['id']=_0x411b5b;_0x9928bd['atimeout']=_0x748a3b;_0x9928bd[_0x1a94('0x37')]=_0x2518cb;_0x9928bd[_0x1a94('0x1e')]=_0x188224[_0x1a94('0x1e')];_0x396cd0[_0x1a94('0x38')][_0x411b5b]['on']('end',function(){stopRouting(_0x411b5b,_0x55c8d4,_0x188224,_0x396cd0);_0x9928bd[_0x1a94('0x39')](!![]);clearTimeout(_0x313819);_0x313819=undefined;if(_0x396cd0[_0x1a94('0x38')][_0x411b5b]){delete _0x396cd0['rules'][_0x411b5b];}logger[_0x1a94('0x3a')](_0x1a94('0x3b'),_0x411b5b);_0xa08547[_0x1a94('0x33')]();});_0x313819=setTimeout(function(){endRouting(_0x411b5b,_0x55c8d4,_0x188224,_0x396cd0);clearTimeout(_0x313819);_0x9928bd['close'](!![]);logger[_0x1a94('0x3a')](_0x1a94('0x3c'),_0x411b5b);_0xa08547['next']();},_0x2518cb);switch(_0x55c8d4[_0x1a94('0x3d')]){case _0x1a94('0x3e'):strategy[_0x1a94('0x3e')](_0x9928bd,_0x55c8d4,_0x396cd0,_0x188224);break;default:strategy['beepall'](_0x9928bd,_0x55c8d4,_0x396cd0,_0x188224);}}else{logger[_0x1a94('0x2a')](_0x1a94('0x3f'),_0x411b5b,_0x34fb41[_0x1a94('0x26')]);_0xa08547[_0x1a94('0x33')]();}}}catch(_0xe4c7e9){console[_0x1a94('0x40')](_0xe4c7e9);logger[_0x1a94('0x2a')](_0x1a94('0x31'),_0x411b5b,_0xe4c7e9[_0x1a94('0x41')]);_0xa08547['stop']();}};}; \ No newline at end of file +var _0xc86d=['length','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','close','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','account','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence'];(function(_0x140774,_0x23dbf0){var _0x139784=function(_0x41808a){while(--_0x41808a){_0x140774['push'](_0x140774['shift']());}};_0x139784(++_0x23dbf0);}(_0xc86d,0x181));var _0xdc86=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xc86d[_0x9df060];return _0x338dfe;};'use strict';var schema=require(_0xdc86('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xdc86('0x1'));var moment=require(_0xdc86('0x2'));var Redis=require(_0xdc86('0x3'));var config=require(_0xdc86('0x4'));var logger=require(_0xdc86('0x5'))(_0xdc86('0x6'));var strategy=require(_0xdc86('0x7'));config[_0xdc86('0x8')]=_[_0xdc86('0x9')](config['redis'],{'host':_0xdc86('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id','account',_0xdc86('0xb'),_0xdc86('0xc'),_0xdc86('0xd')];function emit(_0x3afecc,_0x59913a,_0x1f01f2){io['to'](_0x3afecc)[_0xdc86('0xe')](_0x59913a,_0x1f01f2);}function emitChannelQueueInteraction(_0x1558c7,_0x523e71,_0x38624a,_0xb1d46f,_0x4ad6e6,_0x247d70,_0x531d8f,_0xb6854f){_0x38624a['queue_id']=_0xb6854f;_0x38624a[_0xdc86('0xb')]=_0x523e71;_0x38624a['account']=_0xb1d46f;_0x38624a['id']=_0x4ad6e6;if(_0x247d70){_0x531d8f[util[_0xdc86('0xf')](_0xdc86('0x10'),_0x1558c7)][_0x4ad6e6]=_[_0xdc86('0x11')](_0x38624a,attributes);}else{delete _0x531d8f[util[_0xdc86('0xf')](_0xdc86('0x10'),_0x1558c7)][_0x4ad6e6];}emit(util[_0xdc86('0xf')]('%s:queue:%s',_0x1558c7,_0x523e71),util['format'](_0xdc86('0x12'),_0x1558c7,_0x247d70?_0xdc86('0x13'):_0xdc86('0x14')),_[_0xdc86('0x11')](_0x38624a,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xdc86('0x15')),'smsQueueReport':require(_0xdc86('0x16')),'faxQueueReport':require(_0xdc86('0x17'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xdc86('0x18'),'message':_0xdc86('0x19')}});function startRouting(_0x6aad1e,_0x112b09,_0x2dee87,_0x4644ce){if(_0x6aad1e&&_0x112b09&&_0x2dee87){_0x112b09[_0xdc86('0x1a')]+=0x1;var _0x276d6b={'uniqueid':_0x6aad1e,'from':_0x2dee87[_0xdc86('0x1b')]?_0x2dee87[_0xdc86('0x1b')][_0xdc86('0xc')]:'','joinAt':moment()['format'](_0xdc86('0x1c')),'ContactId':_0x2dee87[_0xdc86('0x1d')]?_0x2dee87[_0xdc86('0x1d')]['id']:null,'ListId':_0x2dee87['list']?_0x2dee87['list']['id']:null};_0x276d6b[_[_0xdc86('0x1e')](_0x2dee87[_0xdc86('0x1f')])+_0xdc86('0x20')]=_0x112b09['id']||null;_0x276d6b[_[_0xdc86('0x1e')](_0x2dee87[_0xdc86('0x1f')])+_0xdc86('0x21')]=_0x2dee87[_0xdc86('0x22')]?_0x2dee87[_0xdc86('0x22')]['id']:null;_0x276d6b[_[_0xdc86('0x1e')](_0x2dee87[_0xdc86('0x1f')])+_0xdc86('0x23')]=_0x2dee87[_0xdc86('0x24')]?_0x2dee87[_0xdc86('0x24')]['id']:null;_0x276d6b[_[_0xdc86('0x1e')](_0x2dee87['channel'])+(_0x2dee87[_0xdc86('0x1f')]!=='chat'?_0xdc86('0x25'):_0xdc86('0x26'))]=_0x2dee87[_0xdc86('0x27')]?_0x2dee87['account']['id']:null;logger[_0xdc86('0x28')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x6aad1e,_0x112b09[_0xdc86('0x29')]));emitChannelQueueInteraction(_0x2dee87[_0xdc86('0x1f')],_0x112b09[_0xdc86('0x29')],_0x276d6b,_0x2dee87[_0xdc86('0x27')][_0xdc86('0x29')],_0x2dee87[_0xdc86('0x24')]['id'],!![],_0x4644ce,_0x112b09['id']);if(rpc[_0x2dee87[_0xdc86('0x1f')]+_0xdc86('0x2a')]){return rpc[_0x2dee87[_0xdc86('0x1f')]+'QueueReport']['create'](_0x276d6b)[_0xdc86('0x2b')](function(_0x211612){logger[_0xdc86('0x2c')](_0xdc86('0x2d'));});}}}function stopRouting(_0x2bfd8e,_0x43e449,_0x1b11d8,_0x219a5a){if(_0x2bfd8e&&_0x43e449){_0x43e449[_0xdc86('0x1a')]-=0x1;var _0x2364b9={'leaveAt':moment()[_0xdc86('0xf')](_0xdc86('0x1c')),'acceptAt':moment()[_0xdc86('0xf')](_0xdc86('0x1c')),'reason':_0xdc86('0x2e')};logger[_0xdc86('0x28')](util[_0xdc86('0xf')](_0xdc86('0x2f'),_0x2bfd8e,_0x43e449[_0xdc86('0x29')]));emitChannelQueueInteraction(_0x1b11d8['channel'],_0x43e449['name'],_0x1b11d8[_0xdc86('0x1b')],_0x1b11d8['account'][_0xdc86('0x29')],_0x1b11d8[_0xdc86('0x24')]['id'],![],_0x219a5a,_0x43e449['id']);if(rpc[_0x1b11d8['channel']+_0xdc86('0x2a')]){return rpc[_0x1b11d8[_0xdc86('0x1f')]+_0xdc86('0x2a')][_0xdc86('0x30')](_0x2bfd8e,_0x2364b9)[_0xdc86('0x2b')](function(_0x415aa1){logger[_0xdc86('0x2c')]('update\x20queue\x20report');});}}}function endRouting(_0x5993b1,_0x43402f,_0x3ee6df,_0x9aa56a){if(_0x5993b1&&_0x43402f){_0x43402f[_0xdc86('0x1a')]-=0x1;var _0x14dea4={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xdc86('0xf')](_0xdc86('0x1c')),'reason':'timeout'};logger[_0xdc86('0x28')](util[_0xdc86('0xf')](_0xdc86('0x31'),_0x5993b1,_0x43402f['name']));emitChannelQueueInteraction(_0x3ee6df[_0xdc86('0x1f')],_0x43402f[_0xdc86('0x29')],_0x3ee6df[_0xdc86('0x1b')],_0x3ee6df[_0xdc86('0x27')][_0xdc86('0x29')],_0x3ee6df[_0xdc86('0x24')]['id'],![],_0x9aa56a);if(rpc[_0x3ee6df[_0xdc86('0x1f')]+_0xdc86('0x2a')]){return rpc[_0x3ee6df[_0xdc86('0x1f')]+_0xdc86('0x2a')][_0xdc86('0x30')](_0x5993b1,_0x14dea4)['catch'](function(_0x4e45cc){logger[_0xdc86('0x2c')](_0xdc86('0x32'));});}}}function handleFindQueue(_0x3a58c3){return function(_0x5d47b2){return _0x5d47b2[_0xdc86('0x29')]['toLowerCase']()===_0x3a58c3[_0xdc86('0x33')]();};}exports[_0xdc86('0x34')]=function(_0x4130bd,_0x105bfd,_0x2f345c,_0x71451e){return function(_0x5301e4){try{var _0x38d95e={'name':_0x105bfd[0x0],'timeout':_0x105bfd[0x1]};var _0x46079d=queue[_0xdc86('0x0')](_0x38d95e,{'typecast':!![]});if(_0x46079d[_0xdc86('0x35')]){logger['error'](_0xdc86('0x36'),_0x4130bd,_[_0xdc86('0x37')](_0x46079d,_0xdc86('0x24'))['join'](',\x20'));_0x5301e4['stop']();}else{var _0x511d66=_[_0xdc86('0x38')](_0x2f345c[_0x71451e['channel']+_0xdc86('0x39')],handleFindQueue(_0x38d95e[_0xdc86('0x29')]));if(_0x511d66){startRouting(_0x4130bd,_0x511d66,_0x71451e,_0x2f345c);var _0x3f3102=(_0x511d66['timeout']||0xa)*0x3e8;var _0x32d340=(_0x38d95e['timeout']||0x14)*0x3e8;var _0x140875,_0x3920ba;if(_0x3f3102>_0x32d340){_0x32d340=_0x3f3102;}var _0x2e4a5a=seqqueue[_0xdc86('0x3a')](_0x3f3102);_0x2e4a5a['id']=_0x4130bd;_0x2e4a5a[_0xdc86('0x3b')]=_0x3f3102;_0x2e4a5a['qtimeout']=_0x32d340;_0x2e4a5a[_0xdc86('0x1f')]=_0x71451e['channel'];_0x2f345c[_0xdc86('0x3c')][_0x4130bd]['on'](_0xdc86('0x3d'),function(){stopRouting(_0x4130bd,_0x511d66,_0x71451e,_0x2f345c);_0x2e4a5a['close'](!![]);clearTimeout(_0x140875);_0x140875=undefined;if(_0x2f345c['rules'][_0x4130bd]){delete _0x2f345c['rules'][_0x4130bd];}logger[_0xdc86('0x28')](_0xdc86('0x3e'),_0x4130bd);_0x5301e4[_0xdc86('0x3f')]();});_0x140875=setTimeout(function(){endRouting(_0x4130bd,_0x511d66,_0x71451e,_0x2f345c);clearTimeout(_0x140875);_0x2e4a5a[_0xdc86('0x40')](!![]);logger[_0xdc86('0x28')](_0xdc86('0x41'),_0x4130bd);_0x5301e4[_0xdc86('0x42')]();},_0x32d340);switch(_0x511d66[_0xdc86('0x43')]){case _0xdc86('0x44'):strategy[_0xdc86('0x44')](_0x2e4a5a,_0x511d66,_0x2f345c,_0x71451e);break;default:strategy[_0xdc86('0x45')](_0x2e4a5a,_0x511d66,_0x2f345c,_0x71451e);}}else{logger[_0xdc86('0x2c')](_0xdc86('0x46'),_0x4130bd,_0x38d95e[_0xdc86('0x29')]);_0x5301e4['stop']();}}}catch(_0x27a4ee){console[_0xdc86('0x47')](_0x27a4ee);logger[_0xdc86('0x2c')](_0xdc86('0x36'),_0x4130bd,_0x27a4ee[_0xdc86('0x48')]);_0x5301e4[_0xdc86('0x3f')]();}};}; \ 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 2844d0b..d908ccd 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 _0x5d1c=['busy','notificationId','RINGING','forcedOwnership','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','TIMEOUT','../../../../../config/logger','routing','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','push','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x5d48bb,_0x3dd5ff){var _0x3b4af5=function(_0x115f6b){while(--_0x115f6b){_0x5d48bb['push'](_0x5d48bb['shift']());}};_0x3b4af5(++_0x3dd5ff);}(_0x5d1c,0x159));var _0xc5d1=function(_0x71d321,_0x4e4307){_0x71d321=_0x71d321-0x0;var _0x55a298=_0x5d1c[_0x71d321];return _0x55a298;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require(_0xc5d1('0x0'))(_0xc5d1('0x1'));var Agent=function(_0x1171ab,_0x4bc3ba,_0x426f03,_0x5a46f2){this['notificationId']=uuid['v4']();this[_0xc5d1('0x2')]=_0x1171ab;this[_0xc5d1('0x3')]=_0x4bc3ba;this[_0xc5d1('0x4')]=_0x426f03;this['routing']=_0x5a46f2;this[_0xc5d1('0x2')]['push'](this[_0xc5d1('0x5')][_0xc5d1('0x6')](this),this[_0xc5d1('0x7')][_0xc5d1('0x6')](this));this[_0xc5d1('0x2')]['on'](_0xc5d1('0x8'),this[_0xc5d1('0x7')]['bind'](this));this[_0xc5d1('0x2')]['on'](_0xc5d1('0x9'),this[_0xc5d1('0xa')]['bind'](this));};Agent['prototype'][_0xc5d1('0xb')]=function(){this['squeue'][_0xc5d1('0xb')](this['handleRun'][_0xc5d1('0x6')](this),this[_0xc5d1('0x7')][_0xc5d1('0x6')](this));};Agent[_0xc5d1('0xc')][_0xc5d1('0xa')]=function(){this[_0xc5d1('0x7')](!![]);};Agent[_0xc5d1('0xc')][_0xc5d1('0x5')]=function(_0x4ed4df){logger[_0xc5d1('0xd')](_0xc5d1('0xe'),this[_0xc5d1('0x2')]['id'],this[_0xc5d1('0x3')]['id']);if(_[_0xc5d1('0xf')](this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']])){logger[_0xc5d1('0xd')](_0xc5d1('0x11'),this[_0xc5d1('0x2')]['id'],this['agent']['id']);setTimeout(this[_0xc5d1('0xb')][_0xc5d1('0x6')](this),0x3e8);}else{if(this[_0xc5d1('0x1')]['forcedOwnership']||util[_0xc5d1('0x12')](this[_0xc5d1('0x2')]['id'],this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']],this['squeue']['channel'],![])){this[_0xc5d1('0x4')]['agents'][this[_0xc5d1('0x3')]['id']][_0xc5d1('0x13')]=!![];this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0xc5d1('0x14')],this['squeue']['id'],this['realtime'][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']],null,this[_0xc5d1('0x1')]);util['writeLog'](this[_0xc5d1('0x2')]['id'],this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']],_0xc5d1('0x15')+(this[_0xc5d1('0x1')][_0xc5d1('0x16')]?':FORCED':''));}else{logger[_0xc5d1('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xc5d1('0x2')]['id'],this[_0xc5d1('0x3')]['id']);setTimeout(this[_0xc5d1('0xb')][_0xc5d1('0x6')](this),0x3e8);}}};Agent[_0xc5d1('0xc')][_0xc5d1('0x7')]=function(_0x5f04e7){if(_[_0xc5d1('0xf')](this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']])){return logger['info'](_0xc5d1('0x11'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xc5d1('0xd')](_0xc5d1('0x17'),this[_0xc5d1('0x2')]['id'],this['agent']['id']);util[_0xc5d1('0x18')](this[_0xc5d1('0x14')],this[_0xc5d1('0x2')]['id'],this['realtime'][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']],null,this[_0xc5d1('0x1')]);this[_0xc5d1('0x4')][_0xc5d1('0x10')][this['agent']['id']][_0xc5d1('0x13')]=![];this[_0xc5d1('0x4')][_0xc5d1('0x10')][this['agent']['id']][_0xc5d1('0x19')]=undefined;util[_0xc5d1('0x1a')](this[_0xc5d1('0x2')]['id'],this[_0xc5d1('0x4')][_0xc5d1('0x10')][this[_0xc5d1('0x3')]['id']],_0x5f04e7?'STOP':_0xc5d1('0x1b'));}if(!_0x5f04e7){setTimeout(this['push'][_0xc5d1('0x6')](this),0x3e8);}};function agent(_0x3ae012,_0x3a2160,_0x575f31,_0x4e10b2){return new Agent(_0x3ae012,_0x3a2160,_0x575f31,_0x4e10b2);}module['exports']=agent; \ No newline at end of file +var _0xea1a=['drained','handleDrained','prototype','push','info','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','agents','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','agent','realtime','routing','handleRun','bind','squeue','timeout','handleTimeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xea1a,0x98));var _0xaea1=function(_0x43ba83,_0x24e6f3){_0x43ba83=_0x43ba83-0x0;var _0x4eb983=_0xea1a[_0x43ba83];return _0x4eb983;};'use strict';var _=require(_0xaea1('0x0'));var uuid=require(_0xaea1('0x1'));var util=require(_0xaea1('0x2'));var logger=require(_0xaea1('0x3'))('routing');var Agent=function(_0x3ec148,_0x193b08,_0x5a3d72,_0x472fc8){this[_0xaea1('0x4')]=uuid['v4']();this['squeue']=_0x3ec148;this[_0xaea1('0x5')]=_0x193b08;this[_0xaea1('0x6')]=_0x5a3d72;this[_0xaea1('0x7')]=_0x472fc8;this['squeue']['push'](this[_0xaea1('0x8')][_0xaea1('0x9')](this),this['handleTimeout']['bind'](this));this[_0xaea1('0xa')]['on'](_0xaea1('0xb'),this[_0xaea1('0xc')][_0xaea1('0x9')](this));this[_0xaea1('0xa')]['on'](_0xaea1('0xd'),this[_0xaea1('0xe')][_0xaea1('0x9')](this));};Agent[_0xaea1('0xf')]['push']=function(){this[_0xaea1('0xa')][_0xaea1('0x10')](this[_0xaea1('0x8')]['bind'](this),this[_0xaea1('0xc')][_0xaea1('0x9')](this));};Agent[_0xaea1('0xf')][_0xaea1('0xe')]=function(){this[_0xaea1('0xc')](!![]);};Agent[_0xaea1('0xf')][_0xaea1('0x8')]=function(_0x2ebf97){logger[_0xaea1('0x11')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xaea1('0xa')]['id'],this[_0xaea1('0x5')]['id']);if(_[_0xaea1('0x12')](this[_0xaea1('0x6')]['agents'][this[_0xaea1('0x5')]['id']])){logger[_0xaea1('0x11')](_0xaea1('0x13'),this[_0xaea1('0xa')]['id'],this['agent']['id']);setTimeout(this[_0xaea1('0x10')][_0xaea1('0x9')](this),0x3e8);}else{if(this['routing'][_0xaea1('0x14')]||util[_0xaea1('0x15')](this[_0xaea1('0xa')]['id'],this['realtime']['agents'][this[_0xaea1('0x5')]['id']],this[_0xaea1('0xa')][_0xaea1('0x16')],![])){this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']][_0xaea1('0x18')]=!![];this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']][_0xaea1('0x19')]=undefined;util[_0xaea1('0x1a')](this[_0xaea1('0x4')],this['squeue']['id'],this[_0xaea1('0x6')]['agents'][this[_0xaea1('0x5')]['id']],null,this[_0xaea1('0x7')]);util[_0xaea1('0x1b')](this[_0xaea1('0xa')]['id'],this['realtime'][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']],'RINGING'+(this[_0xaea1('0x7')]['forcedOwnership']?_0xaea1('0x1c'):''));}else{logger[_0xaea1('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xaea1('0xa')]['id'],this[_0xaea1('0x5')]['id']);setTimeout(this[_0xaea1('0x10')][_0xaea1('0x9')](this),0x3e8);}}};Agent['prototype'][_0xaea1('0xc')]=function(_0x5eea74){if(_['isNil'](this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']])){return logger['info'](_0xaea1('0x13'),this[_0xaea1('0xa')]['id'],this[_0xaea1('0x5')]['id']);}else{logger[_0xaea1('0x11')](_0xaea1('0x1d'),this[_0xaea1('0xa')]['id'],this[_0xaea1('0x5')]['id']);util[_0xaea1('0x1e')](this[_0xaea1('0x4')],this[_0xaea1('0xa')]['id'],this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']],null,this[_0xaea1('0x7')]);this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']][_0xaea1('0x18')]=![];this[_0xaea1('0x6')][_0xaea1('0x17')][this[_0xaea1('0x5')]['id']][_0xaea1('0x19')]=undefined;util['writeLog'](this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],_0x5eea74?_0xaea1('0x1f'):_0xaea1('0x20'));}if(!_0x5eea74){setTimeout(this[_0xaea1('0x10')]['bind'](this),0x3e8);}};function agent(_0x13ae42,_0x44b3d4,_0x36cce6,_0x88a611){return new Agent(_0x13ae42,_0x44b3d4,_0x36cce6,_0x88a611);}module['exports']=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 1b42270..3a7e682 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 _0x87e1=['agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','name','hideNotification','STOP','TIMEOUT','exports','lodash','./util','routing','notificationId','queue','realtime','squeue','push','bind','timeout','handleTimeout','handleDrained','prototype','handleRun','isNil','length','Agents'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x87e1,0xa3));var _0x187e=function(_0x152b03,_0x2b427f){_0x152b03=_0x152b03-0x0;var _0x5a5d4b=_0x87e1[_0x152b03];return _0x5a5d4b;};'use strict';var _=require(_0x187e('0x0'));var uuid=require('uuid');var util=require(_0x187e('0x1'));var logger=require('../../../../../config/logger')(_0x187e('0x2'));var Beepall=function(_0x4f731a,_0x4faa73,_0x390216,_0x1f7069){this[_0x187e('0x3')]=uuid['v4']();this['squeue']=_0x4f731a;this[_0x187e('0x4')]=_0x4faa73;this[_0x187e('0x5')]=_0x390216;this[_0x187e('0x2')]=_0x1f7069;this[_0x187e('0x6')][_0x187e('0x7')](this['handleRun'][_0x187e('0x8')](this),this['handleTimeout'][_0x187e('0x8')](this));this[_0x187e('0x6')]['on'](_0x187e('0x9'),this[_0x187e('0xa')]['bind'](this));this[_0x187e('0x6')]['on']('drained',this[_0x187e('0xb')]['bind'](this));};Beepall[_0x187e('0xc')][_0x187e('0x7')]=function(){this[_0x187e('0x6')][_0x187e('0x7')](this[_0x187e('0xd')][_0x187e('0x8')](this),this[_0x187e('0xa')][_0x187e('0x8')](this));};Beepall[_0x187e('0xc')][_0x187e('0xb')]=function(_0x370e85){this[_0x187e('0xa')](!![]);};Beepall['prototype'][_0x187e('0xd')]=function(_0x21a47c){var _0x56cb35=!![];if(!_[_0x187e('0xe')](this[_0x187e('0x4')])&&!_[_0x187e('0xe')](this[_0x187e('0x4')]['Agents'])&&this[_0x187e('0x4')]['Agents'][_0x187e('0xf')]>0x0){for(var _0x3fd1bf=0x0,_0x3cb1aa;_0x3fd1bf0x0){for(var _0x388916=0x0,_0x4e95cb;_0x3889160x0&&_0x116547[_0x398399+_0x3d22('0x25')]>=_0x116547[_0x398399+'Capacity']){writeLog(_0x2191f8,_0x116547,_0x398399[_0x3d22('0x26')]()+_0x3d22('0x27'));return![];}}return!![];};exports[_0x3d22('0x28')]=function(_0x2ddb1c,_0x3fea08,_0x2d072d,_0x35b88e,_0x57f06f){return sendNotification(!![],_0x2ddb1c,_0x3fea08,_0x2d072d,_0x35b88e,_0x57f06f);};exports['hideNotification']=function(_0x58f751,_0x366abd,_0x2094e4,_0x5ccdc4,_0x237d67){return sendNotification(![],_0x58f751,_0x366abd,_0x2094e4,_0x5ccdc4,_0x237d67);};exports[_0x3d22('0x29')]=writeLog; \ No newline at end of file +var _0xa08d=['\x20interaction','name','notificationSound','notificationShake','body','queue','msg','account','notificationTemplate','[%s][QUEUE]\x20%s','message','save','remove','info','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','emit','format','user:%s','split'];(function(_0x56370f,_0x10d36e){var _0x3c1c46=function(_0x148f48){while(--_0x148f48){_0x56370f['push'](_0x56370f['shift']());}};_0x3c1c46(++_0x10d36e);}(_0xa08d,0x183));var _0xda08=function(_0x524da1,_0x52b685){_0x524da1=_0x524da1-0x0;var _0x4c7e5e=_0xa08d[_0x524da1];return _0x4c7e5e;};'use strict';var _=require(_0xda08('0x0'));var util=require('util');var utils=require(_0xda08('0x1'));var Mustache=require(_0xda08('0x2'));var Redis=require(_0xda08('0x3'));var config=require(_0xda08('0x4'));var logger=require(_0xda08('0x5'))('routing');config[_0xda08('0x6')]=_['defaults'](config[_0xda08('0x6')],{'host':_0xda08('0x7'),'port':0x18eb});var io=require(_0xda08('0x8'))(new Redis(config[_0xda08('0x6')]));function emit(_0x3e4f27,_0x3bab7c,_0x4d0767){io['to'](_0x3e4f27)[_0xda08('0x9')](_0x3bab7c,_0x4d0767);}function sendNotification(_0x48e829,_0x1e5bc0,_0x305720,_0x29088e,_0x5bf642,_0x1836ac){io['to'](util[_0xda08('0xa')](_0xda08('0xb'),_0x29088e['name']))[_0xda08('0x9')]('user:save',_0x29088e);var _0x18fa06=_0x1836ac||{};var _0xa11485=_0x305720[_0xda08('0xc')]('.');var _0x3d7dcf={'uniqueid':_0x1e5bc0,'channel':_0xa11485[0x0],'id':_0xa11485[0x1],'title':_0xa11485[0x0]+_0xda08('0xd'),'interactionId':_0xa11485[0x2],'queue':_0x5bf642?_0x5bf642[_0xda08('0xe')]:null,'sound':_0x18fa06['account'][_0xda08('0xf')],'shake':_0x18fa06['account'][_0xda08('0x10')]};try{if(!_0x18fa06[_0xda08('0x11')]){_0x18fa06[_0xda08('0x11')]={};}if(_0x5bf642){_0x18fa06['body'][_0xda08('0x12')]=_0x5bf642;}else if(_0x18fa06['body'][_0xda08('0x12')]){delete _0x18fa06['body']['queue'];}_0x3d7dcf[_0xda08('0x13')]=utils['getMustacheRender'](_0x18fa06[_0xda08('0x14')][_0xda08('0x15')],_0x18fa06);}catch(_0x205c4e){_0x3d7dcf['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xda08('0xa')](_0xda08('0x16'),_0x1e5bc0,_0x205c4e[_0xda08('0x17')]));}io['to'](util[_0xda08('0xa')](_0xda08('0xb'),_0x29088e[_0xda08('0xe')]))[_0xda08('0x9')](util[_0xda08('0xa')]('notification:%s',_0x48e829?_0xda08('0x18'):_0xda08('0x19')),_0x3d7dcf);}function writeLog(_0x275371,_0x4ad23a,_0x1fc453){return logger[_0xda08('0x1a')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x275371,_0x4ad23a[_0xda08('0xe')],_0x1fc453));}exports[_0xda08('0x1b')]=function(_0x21f4b7,_0x2ae244,_0x1f9053,_0x1f5a9e){if(_0x2ae244[_0xda08('0x1c')]){writeLog(_0x21f4b7,_0x2ae244,_0xda08('0x1d'));return![];}if(!_0x2ae244[_0xda08('0x1e')]){writeLog(_0x21f4b7,_0x2ae244,_0xda08('0x1f'));return![];}if(_0x2ae244[_0x1f9053+'Pause']){writeLog(_0x21f4b7,_0x2ae244,_0xda08('0x20'));return![];}if(_0x1f5a9e&&_0x2ae244[_0xda08('0x21')](_0x1f9053+_0xda08('0x22'))&&_0x2ae244[_0xda08('0x21')](_0x1f9053+_0xda08('0x23'))){if(_0x2ae244[_0x1f9053+'Capacity']>0x0&&_0x2ae244[_0x1f9053+_0xda08('0x23')]>=_0x2ae244[_0x1f9053+_0xda08('0x22')]){writeLog(_0x21f4b7,_0x2ae244,_0x1f9053[_0xda08('0x24')]()+_0xda08('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x4d0e60,_0x57e727,_0x28fe3a,_0x42ad7e,_0x266c5c){return sendNotification(!![],_0x4d0e60,_0x57e727,_0x28fe3a,_0x42ad7e,_0x266c5c);};exports[_0xda08('0x26')]=function(_0x379fed,_0x30078b,_0x116c38,_0x4a5456,_0x5543a4){return sendNotification(![],_0x379fed,_0x30078b,_0x116c38,_0x4a5456,_0x5543a4);};exports[_0xda08('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 44983dd..307a0b3 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 _0x8a80=['error','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0xe8f5ba,_0x5f1f38){var _0x3caf92=function(_0xc22c6a){while(--_0xc22c6a){_0xe8f5ba['push'](_0xe8f5ba['shift']());}};_0x3caf92(++_0x5f1f38);}(_0x8a80,0x15f));var _0x08a8=function(_0x5f1af7,_0x22b226){_0x5f1af7=_0x5f1af7-0x0;var _0x29aaf6=_0x8a80[_0x5f1af7];return _0x29aaf6;};'use strict';var schema=require(_0x08a8('0x0'));var sh=require(_0x08a8('0x1'));var _=require(_0x08a8('0x2'));var utils=require(_0x08a8('0x3'));var logger=require(_0x08a8('0x4'))(_0x08a8('0x5'));var system=schema({'command':{'type':_0x08a8('0x6'),'required':!![],'message':_0x08a8('0x7')}});exports[_0x08a8('0x8')]=function(_0x170087,_0x1084d3){return function(_0x21191f){try{var _0x37d17b={'command':_0x1084d3[0x0]};var _0x2110f0=system[_0x08a8('0x0')](_0x37d17b,{'typecast':!![]});if(_0x2110f0[_0x08a8('0x9')]){logger['error'](_0x08a8('0xa'),_0x170087,_[_0x08a8('0xb')](_0x2110f0,'message')[_0x08a8('0xc')](',\x20'));logger[_0x08a8('0xd')](_0x08a8('0xe'),_0x170087);_0x21191f[_0x08a8('0xf')]();}else{var _0x5aeab3=this;var _0x2c0ec6=utils[_0x08a8('0x10')](_0x1084d3[0x0],this);logger[_0x08a8('0xd')](_0x08a8('0x11'),_0x170087,_0x2c0ec6);sh[_0x08a8('0x12')](_['trim'](_0x2c0ec6),function(_0x4c52c0,_0x116292){logger[_0x08a8('0xd')](_0x08a8('0x13'),_0x170087,_0x4c52c0);if(_0x4c52c0==0x0){var _0x34b4e7=_0x116292['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1084d3[0x1])||_[_0x08a8('0x14')](_0x1084d3[0x1])){logger[_0x08a8('0xd')](_0x08a8('0x15'),_0x170087);_0x5aeab3[_0x08a8('0x16')][_0x1084d3[0x1]]=_0x34b4e7;}else{logger['info'](_0x08a8('0x17'),_0x170087,_0x1084d3[0x1],_0x34b4e7);_0x5aeab3['body'][_0x1084d3[0x1]]=_0x34b4e7;}}_0x21191f['next']();});}}catch(_0x586869){logger[_0x08a8('0x18')](_0x08a8('0xa'),_0x170087,_['isObject'](_0x586869)?JSON['stringify'](_0x586869):_0x586869);logger[_0x08a8('0xd')](_0x08a8('0xe'),_0x170087);_0x21191f[_0x08a8('0xf')]();}};}; \ No newline at end of file +var _0x82bc=['replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','validate','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x82bc,0x166));var _0xc82b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x82bc[_0x5d6456];return _0x4d66c1;};'use strict';var schema=require(_0xc82b('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0xc82b('0x1'));var logger=require(_0xc82b('0x2'))(_0xc82b('0x3'));var system=schema({'command':{'type':_0xc82b('0x4'),'required':!![],'message':_0xc82b('0x5')}});exports[_0xc82b('0x6')]=function(_0x30d267,_0x191f76){return function(_0x24344f){try{var _0x58fbaf={'command':_0x191f76[0x0]};var _0x22092f=system[_0xc82b('0x0')](_0x58fbaf,{'typecast':!![]});if(_0x22092f[_0xc82b('0x7')]){logger[_0xc82b('0x8')](_0xc82b('0x9'),_0x30d267,_[_0xc82b('0xa')](_0x22092f,_0xc82b('0xb'))[_0xc82b('0xc')](',\x20'));logger[_0xc82b('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x30d267);_0x24344f['next']();}else{var _0x47d100=this;var _0x199a58=utils['getMustacheRender'](_0x191f76[0x0],this);logger[_0xc82b('0xd')](_0xc82b('0xe'),_0x30d267,_0x199a58);sh[_0xc82b('0xf')](_['trim'](_0x199a58),function(_0x187f91,_0x42d3d6){logger['info'](_0xc82b('0x10'),_0x30d267,_0x187f91);if(_0x187f91==0x0){var _0x5b7ba1=_0x42d3d6[_0xc82b('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xc82b('0x12')](_0x191f76[0x1])||_[_0xc82b('0x13')](_0x191f76[0x1])){logger['info'](_0xc82b('0x14'),_0x30d267);_0x47d100[_0xc82b('0x15')][_0x191f76[0x1]]=_0x5b7ba1;}else{logger[_0xc82b('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x30d267,_0x191f76[0x1],_0x5b7ba1);_0x47d100[_0xc82b('0x15')][_0x191f76[0x1]]=_0x5b7ba1;}}_0x24344f['next']();});}}catch(_0x505fd7){logger['error'](_0xc82b('0x9'),_0x30d267,_['isObject'](_0x505fd7)?JSON[_0xc82b('0x16')](_0x505fd7):_0x505fd7);logger[_0xc82b('0xd')](_0xc82b('0x17'),_0x30d267);_0x24344f[_0xc82b('0x18')]();}};}; \ 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 f279b2a..37cafcd 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x3d366f,_0x27c753){var _0x253002=function(_0x4bd8d1){while(--_0x4bd8d1){_0x3d366f['push'](_0x3d366f['shift']());}};_0x253002(++_0x27c753);}(_0x7a54,0x106));var _0x47a5=function(_0x723354,_0x388b39){_0x723354=_0x723354-0x0;var _0x9278ab=_0x7a54[_0x723354];return _0x9278ab;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x1685e3,_0x30d09e){var _0x5b6e81=function(_0x175df4){while(--_0x175df4){_0x1685e3['push'](_0x1685e3['shift']());}};_0x5b6e81(++_0x30d09e);}(_0x7a54,0x106));var _0x47a5=function(_0x22edbd,_0x2889f2){_0x22edbd=_0x22edbd-0x0;var _0x46eeac=_0x7a54[_0x22edbd];return _0x46eeac;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ 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 6d7df80..18f71ef 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 _0x3d15=['exports','render','merge','contact','message','account','list','lodash'];(function(_0x9b01d9,_0x4802b0){var _0x401588=function(_0x5d9b07){while(--_0x5d9b07){_0x9b01d9['push'](_0x9b01d9['shift']());}};_0x401588(++_0x4802b0);}(_0x3d15,0x127));var _0x53d1=function(_0x379f38,_0x32be37){_0x379f38=_0x379f38-0x0;var _0x2656c7=_0x3d15[_0x379f38];return _0x2656c7;};'use strict';var Mustache=require('mustache');var _=require(_0x53d1('0x0'));module[_0x53d1('0x1')]={'getMustacheRender':function(_0x5ed61d,_0x2b5a03){return Mustache[_0x53d1('0x2')](_0x5ed61d,_[_0x53d1('0x3')](_0x2b5a03['body'],{'contact':_0x2b5a03[_0x53d1('0x4')],'message':_0x2b5a03[_0x53d1('0x5')],'account':_0x2b5a03[_0x53d1('0x6')],'interaction':_0x2b5a03['interaction'],'list':_0x2b5a03[_0x53d1('0x7')]}))||'';}}; \ No newline at end of file +var _0x833b=['list','lodash','render','body','contact','message','account','interaction'];(function(_0x35cfbc,_0x1b603e){var _0x256fa7=function(_0x2df702){while(--_0x2df702){_0x35cfbc['push'](_0x35cfbc['shift']());}};_0x256fa7(++_0x1b603e);}(_0x833b,0x131));var _0xb833=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x833b[_0x38537f];return _0x141e23;};'use strict';var Mustache=require('mustache');var _=require(_0xb833('0x0'));module['exports']={'getMustacheRender':function(_0x1cd19c,_0x59fa54){return Mustache[_0xb833('0x1')](_0x1cd19c,_['merge'](_0x59fa54[_0xb833('0x2')],{'contact':_0x59fa54[_0xb833('0x3')],'message':_0x59fa54[_0xb833('0x4')],'account':_0x59fa54[_0xb833('0x5')],'interaction':_0x59fa54[_0xb833('0x6')],'list':_0x59fa54[_0xb833('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 50f5222..f006b8a 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 _0xe059=['uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','slice','push','amazonlex','%s:%s:%s','./interval','priority','info','Push\x20new\x20rule','intervals','execute','Applications\x20executed','stringify','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','error','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','paused','openchannelQueues','name','smsQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird'];(function(_0x3f1596,_0x562221){var _0x4009b2=function(_0x2fffa0){while(--_0x2fffa0){_0x3f1596['push'](_0x3f1596['shift']());}};_0x4009b2(++_0x562221);}(_0xe059,0xfc));var _0x9e05=function(_0x25fcef,_0x45a4c5){_0x25fcef=_0x25fcef-0x0;var _0x291a24=_0xe059[_0x25fcef];return _0x291a24;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x9e05('0x0'));var fs=require('fs');var jayson=require(_0x9e05('0x1'));var BPromise=require(_0x9e05('0x2'));var uuid=require(_0x9e05('0x3'));var config=require('../../../config/environment');var logger=require(_0x9e05('0x4'))(_0x9e05('0x5'));var rpc={'openchannelQueueReport':require(_0x9e05('0x6'))};var rpc={'openchannelQueueReport':require(_0x9e05('0x6')),'mailQueueReport':require(_0x9e05('0x7')),'chatQueueReport':require(_0x9e05('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x9e05('0x9'));function getId(_0x5ac766,_0x85a82b,_0x2c8230){return util[_0x9e05('0xa')](_0x9e05('0xb'),_0x5ac766,_0x85a82b||0x0,_0x2c8230||0x0);}function getIntervals(_0x498111,_0x53a57d){var _0x544715=[];if(!_['isNil'](_0x53a57d[_0x9e05('0xc')])&&!_['isNil'](_0x498111[_0x53a57d['IntervalId']])&&!_[_0x9e05('0xd')](_0x498111[_0x53a57d[_0x9e05('0xc')]][_0x9e05('0xe')])){_0x544715=_[_0x9e05('0xf')](_0x498111[_0x53a57d[_0x9e05('0xc')]]['Intervals'],'interval');}else if(!_[_0x9e05('0xd')](_0x53a57d[_0x9e05('0x10')])){_0x544715=[_0x53a57d[_0x9e05('0x10')]];}return _0x544715;}exports[_0x9e05('0x11')]=function(_0x46a06e){_0x46a06e[_0x9e05('0x12')]={};return new BPromise(function(_0xa85516,_0x1eec6b){var _0x4b0ae3={'Start':function(_0x171e11){var _0xc3f56a=this;return new Promise(function(_0x55f89f,_0x490856){if(_0x171e11){try{var _0x5103bf=[];var _0x1f4361=getId(_0x171e11[_0x9e05('0x13')],_0x171e11[_0x9e05('0x14')]?_0x171e11[_0x9e05('0x14')]['id']:0x0,_0x171e11[_0x9e05('0x15')]?_0x171e11[_0x9e05('0x15')]['id']:0x0);if(_0x171e11['applications']&&_[_0x9e05('0x16')](_0x171e11[_0x9e05('0x17')])&&_0x171e11[_0x9e05('0x17')][_0x9e05('0x18')]){for(var _0x3d2a6d=0x0;_0x3d2a6d<_0x171e11[_0x9e05('0x17')]['length'];_0x3d2a6d+=0x1){var _0x438a6d=_0x171e11[_0x9e05('0x17')][_0x3d2a6d];if(fs[_0x9e05('0x19')](path[_0x9e05('0x1a')](__dirname,_0x9e05('0x17'),_0x438a6d[_0x9e05('0x1b')]+_0x9e05('0x1c')))){var _0x6f544c=[];switch(_0x438a6d[_0x9e05('0x1b')][_0x9e05('0x1d')]()){case _0x9e05('0x1e'):var _0xefe9fd=_0x438a6d[_0x9e05('0x1f')][_0x9e05('0x20')](',');_0x6f544c['push'](_0xefe9fd[0x0]);_0x6f544c['push'](_0xefe9fd[_0x9e05('0x21')](0x1,_0xefe9fd['length'])[_0x9e05('0x1a')](','));break;case'dialogflow':var _0xefe9fd=_0x438a6d[_0x9e05('0x1f')][_0x9e05('0x20')](',');_0x6f544c[_0x9e05('0x22')](_0xefe9fd[0x0]);_0x6f544c['push'](_0xefe9fd[0x1]);_0x6f544c[_0x9e05('0x22')](_0xefe9fd[_0x9e05('0x21')](0x2,_0xefe9fd['length'])[_0x9e05('0x1a')](','));break;case _0x9e05('0x23'):var _0xefe9fd=_0x438a6d['appdata'][_0x9e05('0x20')](',');_0x6f544c[_0x9e05('0x22')](_0xefe9fd[0x0]);_0x6f544c[_0x9e05('0x22')](_0xefe9fd[0x1]);_0x6f544c[_0x9e05('0x22')](_0xefe9fd[0x2]);_0x6f544c['push'](_0xefe9fd[0x3]);_0x6f544c[_0x9e05('0x22')](_0xefe9fd[_0x9e05('0x21')](0x4,_0xefe9fd[_0x9e05('0x18')])[_0x9e05('0x1a')](','));break;case _0x9e05('0x14'):_0x6f544c['push'](_0x438a6d[_0x9e05('0x1f')]);break;case'tag':_0x6f544c[_0x9e05('0x22')](_0x438a6d['TagId']);_0x6f544c[_0x9e05('0x22')](_0x438a6d[_0x9e05('0x1f')]);break;default:_0x6f544c=_[_0x9e05('0xd')](_0x438a6d[_0x9e05('0x1f')])?[]:_0x438a6d[_0x9e05('0x1f')][_0x9e05('0x20')](',');}var _0x39ec7a={'id':util[_0x9e05('0xa')](_0x9e05('0x24'),_0x1f4361,_0x438a6d['id'],_0x438a6d[_0x9e05('0x1b')]),'condition':require(_0x9e05('0x25'))['condition'](_0x1f4361,getIntervals(_0x46a06e['intervals'],_0x438a6d),_0x46a06e),'consequence':require('./applications/'+_0x438a6d['app'])['consequence'](_0x1f4361,_0x6f544c,_0x46a06e,_0x171e11),'p':_0x438a6d[_0x9e05('0x26')]||0x0};logger[_0x9e05('0x27')](_0x9e05('0x28'),_0x39ec7a['id'],'on\x20interval',getIntervals(_0x46a06e[_0x9e05('0x29')],_0x438a6d)['join']('\x20|\x20'));_0x5103bf[_0x9e05('0x22')](_0x39ec7a);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x9e05('0x1a')](__dirname,_0x9e05('0x17'),_0x438a6d[_0x9e05('0x1b')]+_0x9e05('0x1c')));}}_0x46a06e['rules'][_0x1f4361]=new RuleEngine(_0x5103bf);_0x46a06e[_0x9e05('0x12')][_0x1f4361][_0x9e05('0x2a')](_0x171e11,function(_0x54e46a){logger[_0x9e05('0x27')](_0x9e05('0x2b'),JSON[_0x9e05('0x2c')](_0x54e46a[_0x9e05('0x2d')]));if(_0x46a06e['rules'][_0x1f4361]){_0x46a06e[_0x9e05('0x12')][_0x1f4361][_0x9e05('0x2e')](_0x9e05('0x2f'));}});return _0x55f89f({'code':0xc8,'message':_0x171e11});}else{logger[_0x9e05('0x27')](_0x9e05('0x30'));return _0x55f89f({'code':0xc8,'message':_0x171e11});}}catch(_0x1af47f){logger['error'](_0x1af47f[_0x9e05('0x31')]);return _0x490856(_0xc3f56a[_0x9e05('0x32')](0x1f4,_0x1af47f));}}return _0x490856('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5c2d6f){var _0x267346=this;return new Promise(function(_0x292c08,_0x575bb9){if(_0x5c2d6f[_0x9e05('0x14')]&&_0x5c2d6f[_0x9e05('0x14')]['id']){try{var _0xfa3ee0=getId(_0x5c2d6f[_0x9e05('0x13')],_0x5c2d6f[_0x9e05('0x14')]?_0x5c2d6f[_0x9e05('0x14')]['id']:0x0,_0x5c2d6f[_0x9e05('0x15')]?_0x5c2d6f[_0x9e05('0x15')]['id']:0x0);if(_0x46a06e[_0x9e05('0x12')][_0xfa3ee0]){_0x46a06e[_0x9e05('0x12')][_0xfa3ee0][_0x9e05('0x2e')](_0x9e05('0x2f'));if(rpc[_0x5c2d6f[_0x9e05('0x13')]+'QueueReport']){rpc[_0x5c2d6f[_0x9e05('0x13')]+_0x9e05('0x33')][_0x9e05('0x34')](_0xfa3ee0,{'UserId':_0x5c2d6f['message'][_0x9e05('0x35')]})[_0x9e05('0x36')](function(_0x42ed0f){logger[_0x9e05('0x32')](_0x9e05('0x37'));});}}return _0x292c08({'code':0xc8,'message':_0x5c2d6f});}catch(_0x3d57a0){logger[_0x9e05('0x32')](_0x3d57a0[_0x9e05('0x31')]);return _0x575bb9(_0x267346['error'](0x1f4,_0x3d57a0));}}logger[_0x9e05('0x32')]('message\x20is\x20empty');return _0x575bb9(_0x267346[_0x9e05('0x32')](0x1f4,_0x9e05('0x38')));});},'RejectMessage':function(_0x116910){var _0x468e88=this;return new Promise(function(_0x2e0024,_0x38f560){if(_0x116910['agent']&&_0x116910[_0x9e05('0x39')]['id']){try{if(_0x46a06e[_0x9e05('0x3a')][_0x116910[_0x9e05('0x39')]['id']]){_0x46a06e['agents'][_0x116910[_0x9e05('0x39')]['id']][_0x9e05('0x3b')]=![];_0x46a06e['agents'][_0x116910[_0x9e05('0x39')]['id']][_0x9e05('0x3c')]=undefined;}return _0x2e0024({'code':0xc8,'message':_0x116910});}catch(_0x5339c7){logger[_0x9e05('0x32')](_0x5339c7[_0x9e05('0x31')]);return _0x38f560(_0x468e88[_0x9e05('0x32')](0x1f4,_0x5339c7));}}logger[_0x9e05('0x32')](_0x9e05('0x38'));return _0x38f560(_0x468e88[_0x9e05('0x32')](0x1f4,_0x9e05('0x38')));});},'AbandonInteraction':function(_0x301326){var _0x171e2f=this;return new Promise(function(_0x5f1642,_0x407861){if(_0x301326[_0x9e05('0x13')]&&_0x301326['interaction']&&_0x301326[_0x9e05('0x15')]['id']){try{var _0x5a1524=getId(_0x301326[_0x9e05('0x13')],_0x301326[_0x9e05('0x14')]?_0x301326[_0x9e05('0x14')]['id']:0x0,_0x301326[_0x9e05('0x15')]?_0x301326[_0x9e05('0x15')]['id']:0x0);if(_0x46a06e[_0x9e05('0x12')][_0x5a1524]){_0x46a06e[_0x9e05('0x12')][_0x5a1524][_0x9e05('0x2e')]('end');}return _0x5f1642({'code':0xc8,'message':_0x301326});}catch(_0x5a2d3b){logger['error'](_0x5a2d3b[_0x9e05('0x31')]);return _0x407861(_0x171e2f[_0x9e05('0x32')](0x1f4,_0x5a2d3b));}}logger['error'](_0x9e05('0x38'));return _0x407861(_0x171e2f[_0x9e05('0x32')](0x1f4,_0x9e05('0x38')));});},'AgentCapacity':function(_0x25297e){var _0xf87c2a=this;return new Promise(function(_0x137b16,_0x36f0d5){if(_0x46a06e[_0x9e05('0x3a')]['hasOwnProperty'](_0x25297e['id'])){for(var _0x594a35 in _0x25297e[_0x9e05('0x3d')]){if(_0x25297e['capacity'][_0x9e05('0x3e')](_0x594a35)){if(_0x46a06e[_0x9e05('0x3a')][_0x25297e['id']][_0x9e05('0x3e')](_0x594a35+'CurrentCapacity')){_0x46a06e[_0x9e05('0x3a')][_0x25297e['id']][_0x594a35+_0x9e05('0x3f')]=parseInt(_0x25297e[_0x9e05('0x3d')][_0x594a35],0xa);}}}_0x46a06e['agents'][_0x25297e['id']][_0x9e05('0x40')]();return _0x137b16({'code':0xc8,'message':_0x46a06e[_0x9e05('0x3a')][_0x25297e['id']]});}else{return _0x36f0d5(_0xf87c2a[_0x9e05('0x32')](0x1f4,_0x9e05('0x41')));}});},'Agents':function(_0x5a97f2){return new Promise(function(_0x22c46a,_0xa3ffc1){var _0x17eab3=_[_0x9e05('0x42')](_0x46a06e['agents']);_0x22c46a({'count':_0x17eab3[_0x9e05('0x18')],'rows':_0x17eab3});});},'ChatQueues':function(_0x38c524){return new Promise(function(_0x57bae3,_0x5ba3f3){var _0x4ec476=[];for(var _0x388de0 in _0x46a06e[_0x9e05('0x43')]){if(_0x46a06e[_0x9e05('0x43')]['hasOwnProperty'](_0x388de0)){var _0x2c0f1a=_0x46a06e[_0x9e05('0x43')][_0x388de0];var _0x2f0b46={'id':_0x2c0f1a['id'],'available':_0x2c0f1a[_0x9e05('0x44')],'loggedIn':_0x2c0f1a[_0x9e05('0x45')],'name':_0x2c0f1a['name'],'paused':_0x2c0f1a['paused'],'waiting':_0x2c0f1a[_0x9e05('0x46')]};_0x4ec476['push'](_0x2f0b46);}}_0x57bae3({'count':_0x4ec476[_0x9e05('0x18')],'rows':_0x4ec476});});},'MailQueues':function(_0x174b14){return new Promise(function(_0x20eb47,_0x590ea5){var _0x5aeb4f=[];for(var _0x47d542 in _0x46a06e['mailQueues']){if(_0x46a06e[_0x9e05('0x47')][_0x9e05('0x3e')](_0x47d542)){var _0xaf2c99=_0x46a06e[_0x9e05('0x47')][_0x47d542];var _0x46e9c2={'id':_0xaf2c99['id'],'available':_0xaf2c99[_0x9e05('0x44')],'loggedIn':_0xaf2c99[_0x9e05('0x45')],'name':_0xaf2c99['name'],'paused':_0xaf2c99[_0x9e05('0x48')],'waiting':_0xaf2c99[_0x9e05('0x46')]};_0x5aeb4f['push'](_0x46e9c2);}}_0x20eb47({'count':_0x5aeb4f[_0x9e05('0x18')],'rows':_0x5aeb4f});});},'OpenchannelQueues':function(_0x22c68d){return new Promise(function(_0x1aadb3,_0x89f401){var _0x2273cf=[];for(var _0x1c77e9 in _0x46a06e[_0x9e05('0x49')]){if(_0x46a06e[_0x9e05('0x49')][_0x9e05('0x3e')](_0x1c77e9)){var _0x1d7b04=_0x46a06e['openchannelQueues'][_0x1c77e9];var _0x1cef8b={'id':_0x1d7b04['id'],'available':_0x1d7b04['available'],'loggedIn':_0x1d7b04[_0x9e05('0x45')],'name':_0x1d7b04[_0x9e05('0x4a')],'paused':_0x1d7b04[_0x9e05('0x48')],'waiting':_0x1d7b04[_0x9e05('0x46')]};_0x2273cf[_0x9e05('0x22')](_0x1cef8b);}}_0x1aadb3({'count':_0x2273cf[_0x9e05('0x18')],'rows':_0x2273cf});});},'SmsQueues':function(_0x4c30bf){return new Promise(function(_0x5200c7,_0xa7c4c2){var _0x359729=[];for(var _0x4d468e in _0x46a06e[_0x9e05('0x4b')]){if(_0x46a06e[_0x9e05('0x4b')]['hasOwnProperty'](_0x4d468e)){var _0x322750=_0x46a06e[_0x9e05('0x4b')][_0x4d468e];var _0x1acaac={'id':_0x322750['id'],'available':_0x322750[_0x9e05('0x44')],'loggedIn':_0x322750[_0x9e05('0x45')],'name':_0x322750[_0x9e05('0x4a')],'paused':_0x322750['paused'],'waiting':_0x322750[_0x9e05('0x46')]};_0x359729[_0x9e05('0x22')](_0x1acaac);}}_0x5200c7({'count':_0x359729[_0x9e05('0x18')],'rows':_0x359729});});},'FaxQueues':function(_0x7e3811){return new Promise(function(_0x2a8d0c,_0x419d5c){var _0x33cf51=[];for(var _0x3a9492 in _0x46a06e['faxQueues']){if(_0x46a06e['faxQueues'][_0x9e05('0x3e')](_0x3a9492)){var _0xbb5955=_0x46a06e['faxQueues'][_0x3a9492];var _0x2168d3={'id':_0xbb5955['id'],'available':_0xbb5955[_0x9e05('0x44')],'loggedIn':_0xbb5955['loggedIn'],'name':_0xbb5955[_0x9e05('0x4a')],'paused':_0xbb5955['paused'],'waiting':_0xbb5955['waiting']};_0x33cf51[_0x9e05('0x22')](_0x2168d3);}}_0x2a8d0c({'count':_0x33cf51[_0x9e05('0x18')],'rows':_0x33cf51});});},'ChatQueuesWaitingInteractions':function(_0xcaa9b8){return new Promise(function(_0x150334,_0x4b10ef){var _0x2191fd=_[_0x9e05('0x42')](_0x46a06e[_0x9e05('0x4c')]);_0x150334({'count':_0x2191fd[_0x9e05('0x18')],'rows':_0x2191fd});});},'MailQueuesWaitingInteractions':function(_0x3a2d73){return new Promise(function(_0x3ebfa9,_0x4d2539){var _0x4c758a=_[_0x9e05('0x42')](_0x46a06e['mailQueuesWaitingInteractions']);_0x3ebfa9({'count':_0x4c758a[_0x9e05('0x18')],'rows':_0x4c758a});});},'OpenchannelQueuesWaitingInteractions':function(_0x975c7c){return new Promise(function(_0x8079b2,_0x512fd7){var _0x3c4eb9=_[_0x9e05('0x42')](_0x46a06e[_0x9e05('0x4d')]);_0x8079b2({'count':_0x3c4eb9[_0x9e05('0x18')],'rows':_0x3c4eb9});});},'SmsQueuesWaitingInteractions':function(_0x15c5aa){return new Promise(function(_0x202d35,_0x42c261){var _0x4efdac=_[_0x9e05('0x42')](_0x46a06e[_0x9e05('0x4e')]);_0x202d35({'count':_0x4efdac[_0x9e05('0x18')],'rows':_0x4efdac});});},'FaxQueuesWaitingInteractions':function(_0x228252){return new Promise(function(_0x42b78a,_0x3063c8){var _0x5ecf61=_[_0x9e05('0x42')](_0x46a06e[_0x9e05('0x4f')]);_0x42b78a({'count':_0x5ecf61[_0x9e05('0x18')],'rows':_0x5ecf61});});}};var _0x2fb6cf=jayson['server'](_0x4b0ae3)[_0x9e05('0x50')]();_0x2fb6cf['on'](_0x9e05('0x32'),function(_0x2d7f6f){logger[_0x9e05('0x32')](JSON[_0x9e05('0x2c')](_0x2d7f6f));return _0x1eec6b(_0x2d7f6f);});_0x2fb6cf[_0x9e05('0x11')](0x232c,_0x9e05('0x51'),function(){console[_0x9e05('0x52')](_0x9e05('0x53'),0x232c);return _0xa85516(_0x9e05('0x54')+0x232c);});});}; \ No newline at end of file +var _0xa882=['lodash','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','push','slice','dialogflow','split','tag','%s:%s:%s','./interval','intervals','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','info','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','agent','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','127.0.0.1','log','RPC\x20listening\x20on\x20port:'];(function(_0x2825e8,_0x4b49ba){var _0x2ce74c=function(_0x4cb19c){while(--_0x4cb19c){_0x2825e8['push'](_0x2825e8['shift']());}};_0x2ce74c(++_0x4b49ba);}(_0xa882,0x105));var _0x2a88=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa882[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2a88('0x0'));var util=require(_0x2a88('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x2a88('0x2'));var BPromise=require(_0x2a88('0x3'));var uuid=require(_0x2a88('0x4'));var config=require('../../../config/environment');var logger=require(_0x2a88('0x5'))(_0x2a88('0x6'));var rpc={'openchannelQueueReport':require(_0x2a88('0x7'))};var rpc={'openchannelQueueReport':require(_0x2a88('0x7')),'mailQueueReport':require(_0x2a88('0x8')),'chatQueueReport':require(_0x2a88('0x9')),'smsQueueReport':require(_0x2a88('0xa')),'faxQueueReport':require(_0x2a88('0xb'))};var RuleEngine=require(_0x2a88('0xc'));function getId(_0x22954e,_0x3afa85,_0x1fd3f4){return util[_0x2a88('0xd')]('%s.%s.%s',_0x22954e,_0x3afa85||0x0,_0x1fd3f4||0x0);}function getIntervals(_0x2d4606,_0x2a7a9b){var _0x1fab45=[];if(!_[_0x2a88('0xe')](_0x2a7a9b[_0x2a88('0xf')])&&!_[_0x2a88('0xe')](_0x2d4606[_0x2a7a9b[_0x2a88('0xf')]])&&!_[_0x2a88('0xe')](_0x2d4606[_0x2a7a9b[_0x2a88('0xf')]][_0x2a88('0x10')])){_0x1fab45=_[_0x2a88('0x11')](_0x2d4606[_0x2a7a9b[_0x2a88('0xf')]][_0x2a88('0x10')],_0x2a88('0x12'));}else if(!_['isNil'](_0x2a7a9b[_0x2a88('0x12')])){_0x1fab45=[_0x2a7a9b[_0x2a88('0x12')]];}return _0x1fab45;}exports[_0x2a88('0x13')]=function(_0x13e108){_0x13e108[_0x2a88('0x14')]={};return new BPromise(function(_0x536d3d,_0x46a89a){var _0x229ad1={'Start':function(_0x1c2978){var _0x70b733=this;return new Promise(function(_0x1b9622,_0x2f9284){if(_0x1c2978){try{var _0x43e862=[];var _0x20abc4=getId(_0x1c2978[_0x2a88('0x15')],_0x1c2978[_0x2a88('0x16')]?_0x1c2978['message']['id']:0x0,_0x1c2978[_0x2a88('0x17')]?_0x1c2978[_0x2a88('0x17')]['id']:0x0);if(_0x1c2978[_0x2a88('0x18')]&&_['isArray'](_0x1c2978[_0x2a88('0x18')])&&_0x1c2978[_0x2a88('0x18')]['length']){for(var _0x3f67a7=0x0;_0x3f67a7<_0x1c2978[_0x2a88('0x18')][_0x2a88('0x19')];_0x3f67a7+=0x1){var _0x15b6a4=_0x1c2978[_0x2a88('0x18')][_0x3f67a7];if(fs[_0x2a88('0x1a')](path[_0x2a88('0x1b')](__dirname,_0x2a88('0x18'),_0x15b6a4['app']+_0x2a88('0x1c')))){var _0x4e1a9d=[];switch(_0x15b6a4[_0x2a88('0x1d')][_0x2a88('0x1e')]()){case _0x2a88('0x1f'):var _0x2ba957=_0x15b6a4[_0x2a88('0x20')]['split'](',');_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[0x0]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[_0x2a88('0x22')](0x1,_0x2ba957[_0x2a88('0x19')])[_0x2a88('0x1b')](','));break;case _0x2a88('0x23'):var _0x2ba957=_0x15b6a4[_0x2a88('0x20')][_0x2a88('0x24')](',');_0x4e1a9d['push'](_0x2ba957[0x0]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[0x1]);_0x4e1a9d['push'](_0x2ba957[_0x2a88('0x22')](0x2,_0x2ba957['length'])[_0x2a88('0x1b')](','));break;case'amazonlex':var _0x2ba957=_0x15b6a4[_0x2a88('0x20')][_0x2a88('0x24')](',');_0x4e1a9d['push'](_0x2ba957[0x0]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[0x1]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[0x2]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[0x3]);_0x4e1a9d[_0x2a88('0x21')](_0x2ba957[_0x2a88('0x22')](0x4,_0x2ba957[_0x2a88('0x19')])[_0x2a88('0x1b')](','));break;case _0x2a88('0x16'):_0x4e1a9d[_0x2a88('0x21')](_0x15b6a4[_0x2a88('0x20')]);break;case _0x2a88('0x25'):_0x4e1a9d[_0x2a88('0x21')](_0x15b6a4['TagId']);_0x4e1a9d['push'](_0x15b6a4[_0x2a88('0x20')]);break;default:_0x4e1a9d=_[_0x2a88('0xe')](_0x15b6a4['appdata'])?[]:_0x15b6a4['appdata'][_0x2a88('0x24')](',');}var _0x4166a9={'id':util[_0x2a88('0xd')](_0x2a88('0x26'),_0x20abc4,_0x15b6a4['id'],_0x15b6a4[_0x2a88('0x1d')]),'condition':require(_0x2a88('0x27'))['condition'](_0x20abc4,getIntervals(_0x13e108[_0x2a88('0x28')],_0x15b6a4),_0x13e108),'consequence':require('./applications/'+_0x15b6a4['app'])[_0x2a88('0x29')](_0x20abc4,_0x4e1a9d,_0x13e108,_0x1c2978),'p':_0x15b6a4[_0x2a88('0x2a')]||0x0};logger['info'](_0x2a88('0x2b'),_0x4166a9['id'],_0x2a88('0x2c'),getIntervals(_0x13e108[_0x2a88('0x28')],_0x15b6a4)[_0x2a88('0x1b')](_0x2a88('0x2d')));_0x43e862[_0x2a88('0x21')](_0x4166a9);}else{logger[_0x2a88('0x2e')](_0x2a88('0x2f'),path['join'](__dirname,'applications',_0x15b6a4[_0x2a88('0x1d')]+_0x2a88('0x1c')));}}_0x13e108[_0x2a88('0x14')][_0x20abc4]=new RuleEngine(_0x43e862);_0x13e108[_0x2a88('0x14')][_0x20abc4]['execute'](_0x1c2978,function(_0x2c9163){logger['info'](_0x2a88('0x30'),JSON[_0x2a88('0x31')](_0x2c9163[_0x2a88('0x32')]));if(_0x13e108[_0x2a88('0x14')][_0x20abc4]){_0x13e108[_0x2a88('0x14')][_0x20abc4][_0x2a88('0x33')]('end');}});return _0x1b9622({'code':0xc8,'message':_0x1c2978});}else{logger[_0x2a88('0x34')](_0x2a88('0x35'));return _0x1b9622({'code':0xc8,'message':_0x1c2978});}}catch(_0x129897){logger[_0x2a88('0x2e')](_0x129897['stack']);return _0x2f9284(_0x70b733['error'](0x1f4,_0x129897));}}return _0x2f9284(_0x2a88('0x36'));});},'AcceptMessage':function(_0x20e7ed){var _0x37e00f=this;return new Promise(function(_0x5958a5,_0x3b6e79){if(_0x20e7ed[_0x2a88('0x16')]&&_0x20e7ed[_0x2a88('0x16')]['id']){try{var _0x40d583=getId(_0x20e7ed[_0x2a88('0x15')],_0x20e7ed[_0x2a88('0x16')]?_0x20e7ed[_0x2a88('0x16')]['id']:0x0,_0x20e7ed[_0x2a88('0x17')]?_0x20e7ed[_0x2a88('0x17')]['id']:0x0);if(_0x13e108[_0x2a88('0x14')][_0x40d583]){_0x13e108['rules'][_0x40d583][_0x2a88('0x33')](_0x2a88('0x37'));if(rpc[_0x20e7ed[_0x2a88('0x15')]+_0x2a88('0x38')]){rpc[_0x20e7ed[_0x2a88('0x15')]+_0x2a88('0x38')][_0x2a88('0x39')](_0x40d583,{'UserId':_0x20e7ed[_0x2a88('0x16')][_0x2a88('0x3a')]})[_0x2a88('0x3b')](function(_0x5cf3ed){logger[_0x2a88('0x2e')]('error\x20update\x20queue\x20report');});}}return _0x5958a5({'code':0xc8,'message':_0x20e7ed});}catch(_0x244ea6){logger[_0x2a88('0x2e')](_0x244ea6[_0x2a88('0x3c')]);return _0x3b6e79(_0x37e00f[_0x2a88('0x2e')](0x1f4,_0x244ea6));}}logger['error'](_0x2a88('0x3d'));return _0x3b6e79(_0x37e00f['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x11a2a2){var _0x184d85=this;return new Promise(function(_0x5b9ee1,_0x2acb86){if(_0x11a2a2['agent']&&_0x11a2a2[_0x2a88('0x3e')]['id']){try{if(_0x13e108[_0x2a88('0x3f')][_0x11a2a2[_0x2a88('0x3e')]['id']]){_0x13e108[_0x2a88('0x3f')][_0x11a2a2[_0x2a88('0x3e')]['id']][_0x2a88('0x40')]=![];_0x13e108[_0x2a88('0x3f')][_0x11a2a2[_0x2a88('0x3e')]['id']]['busyQueue']=undefined;}return _0x5b9ee1({'code':0xc8,'message':_0x11a2a2});}catch(_0x42f550){logger[_0x2a88('0x2e')](_0x42f550[_0x2a88('0x3c')]);return _0x2acb86(_0x184d85['error'](0x1f4,_0x42f550));}}logger[_0x2a88('0x2e')](_0x2a88('0x3d'));return _0x2acb86(_0x184d85[_0x2a88('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x58a6de){var _0x3ebd72=this;return new Promise(function(_0x53cbe1,_0x6fb7f6){if(_0x58a6de[_0x2a88('0x15')]&&_0x58a6de[_0x2a88('0x17')]&&_0x58a6de[_0x2a88('0x17')]['id']){try{var _0x113373=getId(_0x58a6de[_0x2a88('0x15')],_0x58a6de['message']?_0x58a6de[_0x2a88('0x16')]['id']:0x0,_0x58a6de[_0x2a88('0x17')]?_0x58a6de[_0x2a88('0x17')]['id']:0x0);if(_0x13e108['rules'][_0x113373]){_0x13e108[_0x2a88('0x14')][_0x113373]['emit'](_0x2a88('0x37'));}return _0x53cbe1({'code':0xc8,'message':_0x58a6de});}catch(_0x203447){logger['error'](_0x203447['stack']);return _0x6fb7f6(_0x3ebd72['error'](0x1f4,_0x203447));}}logger[_0x2a88('0x2e')](_0x2a88('0x3d'));return _0x6fb7f6(_0x3ebd72[_0x2a88('0x2e')](0x1f4,_0x2a88('0x3d')));});},'AgentCapacity':function(_0x18a36f){var _0x311005=this;return new Promise(function(_0x1793ac,_0x5733b1){if(_0x13e108[_0x2a88('0x3f')][_0x2a88('0x41')](_0x18a36f['id'])){for(var _0x4e4239 in _0x18a36f[_0x2a88('0x42')]){if(_0x18a36f['capacity']['hasOwnProperty'](_0x4e4239)){if(_0x13e108['agents'][_0x18a36f['id']][_0x2a88('0x41')](_0x4e4239+_0x2a88('0x43'))){_0x13e108['agents'][_0x18a36f['id']][_0x4e4239+_0x2a88('0x43')]=parseInt(_0x18a36f['capacity'][_0x4e4239],0xa);}}}_0x13e108['agents'][_0x18a36f['id']][_0x2a88('0x44')]();return _0x1793ac({'code':0xc8,'message':_0x13e108[_0x2a88('0x3f')][_0x18a36f['id']]});}else{return _0x5733b1(_0x311005['error'](0x1f4,_0x2a88('0x45')));}});},'Agents':function(_0x31a0ff){return new Promise(function(_0x2f9a23,_0x4184cc){var _0x1bccc7=_['values'](_0x13e108[_0x2a88('0x3f')]);_0x2f9a23({'count':_0x1bccc7['length'],'rows':_0x1bccc7});});},'ChatQueues':function(_0x54531d){return new Promise(function(_0x3f558d,_0x8ea415){var _0x46d77a=[];for(var _0x377221 in _0x13e108['chatQueues']){if(_0x13e108[_0x2a88('0x46')][_0x2a88('0x41')](_0x377221)){var _0x2e3327=_0x13e108[_0x2a88('0x46')][_0x377221];var _0x3fcf9e={'id':_0x2e3327['id'],'available':_0x2e3327['available'],'loggedIn':_0x2e3327[_0x2a88('0x47')],'name':_0x2e3327[_0x2a88('0x48')],'paused':_0x2e3327['paused'],'waiting':_0x2e3327[_0x2a88('0x49')]};_0x46d77a[_0x2a88('0x21')](_0x3fcf9e);}}_0x3f558d({'count':_0x46d77a[_0x2a88('0x19')],'rows':_0x46d77a});});},'MailQueues':function(_0x2faba7){return new Promise(function(_0x123dd2,_0x58658e){var _0x34175b=[];for(var _0x198ff8 in _0x13e108['mailQueues']){if(_0x13e108[_0x2a88('0x4a')][_0x2a88('0x41')](_0x198ff8)){var _0x1973d5=_0x13e108[_0x2a88('0x4a')][_0x198ff8];var _0x4745cd={'id':_0x1973d5['id'],'available':_0x1973d5[_0x2a88('0x4b')],'loggedIn':_0x1973d5['loggedIn'],'name':_0x1973d5['name'],'paused':_0x1973d5[_0x2a88('0x4c')],'waiting':_0x1973d5[_0x2a88('0x49')]};_0x34175b[_0x2a88('0x21')](_0x4745cd);}}_0x123dd2({'count':_0x34175b[_0x2a88('0x19')],'rows':_0x34175b});});},'OpenchannelQueues':function(_0x4da02b){return new Promise(function(_0x9982bc,_0x401120){var _0x3bae59=[];for(var _0x27dc70 in _0x13e108[_0x2a88('0x4d')]){if(_0x13e108[_0x2a88('0x4d')][_0x2a88('0x41')](_0x27dc70)){var _0x524c9a=_0x13e108['openchannelQueues'][_0x27dc70];var _0x50bad6={'id':_0x524c9a['id'],'available':_0x524c9a['available'],'loggedIn':_0x524c9a[_0x2a88('0x47')],'name':_0x524c9a['name'],'paused':_0x524c9a[_0x2a88('0x4c')],'waiting':_0x524c9a['waiting']};_0x3bae59[_0x2a88('0x21')](_0x50bad6);}}_0x9982bc({'count':_0x3bae59['length'],'rows':_0x3bae59});});},'SmsQueues':function(_0x2a68e0){return new Promise(function(_0x59006c,_0x1c5ee6){var _0x20f177=[];for(var _0x22feee in _0x13e108[_0x2a88('0x4e')]){if(_0x13e108[_0x2a88('0x4e')][_0x2a88('0x41')](_0x22feee)){var _0xeed4fc=_0x13e108[_0x2a88('0x4e')][_0x22feee];var _0xfbcead={'id':_0xeed4fc['id'],'available':_0xeed4fc[_0x2a88('0x4b')],'loggedIn':_0xeed4fc[_0x2a88('0x47')],'name':_0xeed4fc[_0x2a88('0x48')],'paused':_0xeed4fc[_0x2a88('0x4c')],'waiting':_0xeed4fc[_0x2a88('0x49')]};_0x20f177[_0x2a88('0x21')](_0xfbcead);}}_0x59006c({'count':_0x20f177[_0x2a88('0x19')],'rows':_0x20f177});});},'FaxQueues':function(_0x1a71cd){return new Promise(function(_0x142ce6,_0x4af24a){var _0xce0f8b=[];for(var _0x4fdc83 in _0x13e108[_0x2a88('0x4f')]){if(_0x13e108[_0x2a88('0x4f')][_0x2a88('0x41')](_0x4fdc83)){var _0x37b621=_0x13e108['faxQueues'][_0x4fdc83];var _0x2c41a0={'id':_0x37b621['id'],'available':_0x37b621[_0x2a88('0x4b')],'loggedIn':_0x37b621[_0x2a88('0x47')],'name':_0x37b621[_0x2a88('0x48')],'paused':_0x37b621[_0x2a88('0x4c')],'waiting':_0x37b621[_0x2a88('0x49')]};_0xce0f8b[_0x2a88('0x21')](_0x2c41a0);}}_0x142ce6({'count':_0xce0f8b[_0x2a88('0x19')],'rows':_0xce0f8b});});},'ChatQueuesWaitingInteractions':function(_0x3c4767){return new Promise(function(_0x436cad,_0x1b42ed){var _0x15d20a=_[_0x2a88('0x50')](_0x13e108['chatQueuesWaitingInteractions']);_0x436cad({'count':_0x15d20a[_0x2a88('0x19')],'rows':_0x15d20a});});},'MailQueuesWaitingInteractions':function(_0x3d5ebe){return new Promise(function(_0x41bf4d,_0x239bc6){var _0x39344c=_['values'](_0x13e108[_0x2a88('0x51')]);_0x41bf4d({'count':_0x39344c['length'],'rows':_0x39344c});});},'OpenchannelQueuesWaitingInteractions':function(_0x45386d){return new Promise(function(_0x141d7a,_0x5d5585){var _0x44454d=_['values'](_0x13e108[_0x2a88('0x52')]);_0x141d7a({'count':_0x44454d[_0x2a88('0x19')],'rows':_0x44454d});});},'SmsQueuesWaitingInteractions':function(_0x31d297){return new Promise(function(_0x3b9989,_0x3c2ff0){var _0x5c472d=_['values'](_0x13e108['smsQueuesWaitingInteractions']);_0x3b9989({'count':_0x5c472d['length'],'rows':_0x5c472d});});},'FaxQueuesWaitingInteractions':function(_0x1a1058){return new Promise(function(_0x3a65fc,_0x4577a3){var _0x2148c8=_[_0x2a88('0x50')](_0x13e108[_0x2a88('0x53')]);_0x3a65fc({'count':_0x2148c8[_0x2a88('0x19')],'rows':_0x2148c8});});}};var _0x1b3500=jayson['server'](_0x229ad1)['http']();_0x1b3500['on'](_0x2a88('0x2e'),function(_0xeaa7ab){logger[_0x2a88('0x2e')](JSON[_0x2a88('0x31')](_0xeaa7ab));return _0x46a89a(_0xeaa7ab);});_0x1b3500[_0x2a88('0x13')](0x232c,_0x2a88('0x54'),function(){console[_0x2a88('0x55')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x536d3d(_0x2a88('0x56')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 83fe5a3..7cd12f3 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 _0x46ba=['routing','client','http','request','then','error','message','result','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','when','\x20|\x20','stack','bluebird','jayson/promise','lodash','../../../config/logger'];(function(_0x3453cc,_0x221153){var _0x587b7b=function(_0x520166){while(--_0x520166){_0x3453cc['push'](_0x3453cc['shift']());}};_0x587b7b(++_0x221153);}(_0x46ba,0x1cd));var _0xa46b=function(_0x22e571,_0x228b6d){_0x22e571=_0x22e571-0x0;var _0x4a09de=_0x46ba[_0x22e571];return _0x4a09de;};'use strict';var util=require('util');var BPromise=require(_0xa46b('0x0'));var jayson=require(_0xa46b('0x1'));var _=require(_0xa46b('0x2'));var logger=require(_0xa46b('0x3'))(_0xa46b('0x4'));var client=jayson[_0xa46b('0x5')][_0xa46b('0x6')]({'port':0x232a});function request(_0x389ec5,_0xe15815){return new BPromise(function(_0x4def37,_0x32c892){return client[_0xa46b('0x7')](_0x389ec5,_0xe15815)[_0xa46b('0x8')](function(_0xc845d3){if(_0xc845d3[_0xa46b('0x9')]){return _0x32c892(_0xc845d3[_0xa46b('0x9')][_0xa46b('0xa')]);}else{return _0x4def37(_0xc845d3[_0xa46b('0xb')]);}})['catch'](function(_0x12f3d9){return _0x32c892(_0x12f3d9);});});}exports[_0xa46b('0xc')]=function(_0x29e76c,_0x2f839a,_0x250373){return function(_0x5eacf4){if(_0x250373[_0xa46b('0xd')]&&!_0x250373['rules'][_0x29e76c]){logger['info'](_0xa46b('0xe'),_0x29e76c);return _0x5eacf4[_0xa46b('0xf')]();}var _0x38c0e0=[];for(var _0x55a3e0=0x0;_0x55a3e0<_0x2f839a[_0xa46b('0x10')];_0x55a3e0+=0x1){_0x38c0e0['push'](request('Command',{'command':util[_0xa46b('0x11')](_0xa46b('0x12'),_0x2f839a[_0x55a3e0])})['then'](function(_0x3978af){return _0x3978af&&_0x3978af[_0xa46b('0xa')]&&_0x3978af['message'][_0xa46b('0x13')](_0xa46b('0x14'))>=0x0?!![]:![];})[_0xa46b('0x15')](function(_0x3742e9){logger[_0xa46b('0x9')](_0xa46b('0x16'),_0x29e76c,_0x2f839a[_0x55a3e0]);}));}BPromise[_0xa46b('0x17')](_0x38c0e0)[_0xa46b('0x8')](function(_0x2cf95c){var _0x13c87c=_[_0xa46b('0x18')](_0x2cf95c);logger[_0xa46b('0x19')](_0xa46b('0x1a'),_0x29e76c,_0x2f839a[_0xa46b('0x1b')]('\x20|\x20'),_0x13c87c);_0x5eacf4[_0xa46b('0x1c')](_0x13c87c);})[_0xa46b('0x15')](function(_0x179a96){console['log'](_0x179a96);logger[_0xa46b('0x9')](_0xa46b('0x1a'),_0x29e76c,_0x2f839a[_0xa46b('0x1b')](_0xa46b('0x1d')),_0x179a96[_0xa46b('0x1e')]);_0x5eacf4['stop']();});};}; \ No newline at end of file +var _0xe8e1=['util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe8e1,0xb4));var _0x1e8e=function(_0x282ff9,_0x268bfe){_0x282ff9=_0x282ff9-0x0;var _0x542612=_0xe8e1[_0x282ff9];return _0x542612;};'use strict';var util=require(_0x1e8e('0x0'));var BPromise=require(_0x1e8e('0x1'));var jayson=require(_0x1e8e('0x2'));var _=require(_0x1e8e('0x3'));var logger=require(_0x1e8e('0x4'))(_0x1e8e('0x5'));var client=jayson[_0x1e8e('0x6')]['http']({'port':0x232a});function request(_0x10af3c,_0x102e60){return new BPromise(function(_0x3c5fb2,_0x387890){return client[_0x1e8e('0x7')](_0x10af3c,_0x102e60)[_0x1e8e('0x8')](function(_0x4eb509){if(_0x4eb509[_0x1e8e('0x9')]){return _0x387890(_0x4eb509[_0x1e8e('0x9')][_0x1e8e('0xa')]);}else{return _0x3c5fb2(_0x4eb509[_0x1e8e('0xb')]);}})[_0x1e8e('0xc')](function(_0xc83697){return _0x387890(_0xc83697);});});}exports['condition']=function(_0x330ca7,_0x2c246d,_0x190b49){return function(_0x563e98){if(_0x190b49[_0x1e8e('0xd')]&&!_0x190b49['rules'][_0x330ca7]){logger[_0x1e8e('0xe')](_0x1e8e('0xf'),_0x330ca7);return _0x563e98[_0x1e8e('0x10')]();}var _0x4e9573=[];for(var _0x365255=0x0;_0x365255<_0x2c246d[_0x1e8e('0x11')];_0x365255+=0x1){_0x4e9573[_0x1e8e('0x12')](request(_0x1e8e('0x13'),{'command':util[_0x1e8e('0x14')]('iftime\x20%s',_0x2c246d[_0x365255])})['then'](function(_0x8eee5){return _0x8eee5&&_0x8eee5[_0x1e8e('0xa')]&&_0x8eee5['message']['indexOf'](_0x1e8e('0x15'))>=0x0?!![]:![];})[_0x1e8e('0xc')](function(_0xa647d1){logger['error'](_0x1e8e('0x16'),_0x330ca7,_0x2c246d[_0x365255]);}));}BPromise[_0x1e8e('0x17')](_0x4e9573)[_0x1e8e('0x8')](function(_0x3a2aa5){var _0x5bfdc2=_[_0x1e8e('0x18')](_0x3a2aa5);logger[_0x1e8e('0xe')](_0x1e8e('0x19'),_0x330ca7,_0x2c246d[_0x1e8e('0x1a')](_0x1e8e('0x1b')),_0x5bfdc2);_0x563e98[_0x1e8e('0x1c')](_0x5bfdc2);})['catch'](function(_0x26f0c7){console['log'](_0x26f0c7);logger[_0x1e8e('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x330ca7,_0x2c246d[_0x1e8e('0x1a')](_0x1e8e('0x1b')),_0x26f0c7[_0x1e8e('0x1d')]);_0x563e98[_0x1e8e('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7220086..e92c7fc 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 _0x8358=['calleridnum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','complete','blindtransfer','isNil','transfereruniqueid','blind','transferexten','extension','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferuniqueid','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererlinkedid','transfer','transfertype','transfertargetuniqueid','clone','hangup','agentcompleteAt','diffTime','agent','lodash','util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface'];(function(_0x1c27d7,_0x5017da){var _0x4795be=function(_0x2873e1){while(--_0x2873e1){_0x1c27d7['push'](_0x1c27d7['shift']());}};_0x4795be(++_0x5017da);}(_0x8358,0x7f));var _0x8835=function(_0xdedb26,_0x3e5dd6){_0xdedb26=_0xdedb26-0x0;var _0x238e48=_0x8358[_0xdedb26];return _0x238e48;};'use strict';var _=require(_0x8835('0x0'));var util=require(_0x8835('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x5da659,_0x5ebc87){utils[_0x8835('0x2')](util['format'](_0x8835('0x3'),_0x5da659[_0x8835('0x4')],_0x5da659[_0x8835('0x5')],_0x5da659[_0x8835('0x6')],_0x5da659[_0x8835('0x7')],_0x5da659[_0x8835('0x8')],_0x5da659[_0x8835('0x9')],_0x5da659['connectedlinenum'],_0x5da659[_0x8835('0xa')]));if(_0x5da659['queue']){utils[_0x8835('0xb')](_0x5da659[_0x8835('0x6')])['then'](function(_0x37a997){if(_0x37a997){_0x5da659[_0x8835('0xc')]=_0x37a997['type'];_0x5da659[_0x8835('0xd')]=_0x5da659['agentcomplete']?_0x37a997[_0x8835('0xe')]:![];_0x5da659[_0x8835('0xf')]=_0x5da659[_0x8835('0xd')]?_0x37a997[_0x8835('0x10')]:0x0;}utils[_0x8835('0x11')](_0x8835('0x12'),_0x5da659);});}else{utils[_0x8835('0x11')](_0x8835('0x12'),_0x5da659);}if(_0x5ebc87){delete transfers[_0x5da659['uniqueid']];}else{delete agents[_0x5da659[_0x8835('0x13')]];}}exports[_0x8835('0x14')]=function(_0xe120a8){try{agents[_0xe120a8[_0x8835('0x13')]]=_0xe120a8;agents[_0xe120a8['destuniqueid']]['agentcalledAt']=utils[_0x8835('0x15')]();agents[_0xe120a8['destuniqueid']][_0x8835('0xa')]=_0x8835('0x16');agents[_0xe120a8[_0x8835('0x13')]][_0x8835('0x17')]=null;agents[_0xe120a8[_0x8835('0x13')]][_0x8835('0x18')]=null;}catch(_0x5c6e10){utils[_0x8835('0x19')](_0x5c6e10[_0x8835('0x1a')]);}};exports[_0x8835('0x1b')]=function(_0x41dcb0){try{if(!_['isNil'](agents[_0x41dcb0[_0x8835('0x13')]])){agents[_0x41dcb0['destuniqueid']][_0x8835('0x1b')]=!![];agents[_0x41dcb0[_0x8835('0x13')]][_0x8835('0x1c')]=utils[_0x8835('0x15')]();agents[_0x41dcb0['destuniqueid']][_0x8835('0xa')]=_0x8835('0x1d');agents[_0x41dcb0[_0x8835('0x13')]][_0x8835('0x1e')]=_0x8835('0x1d');agents[_0x41dcb0[_0x8835('0x13')]][_0x8835('0x1f')]=_0x41dcb0['ringtime']?parseInt(_0x41dcb0[_0x8835('0x20')])/0x3e8:0x0;agents[_0x41dcb0[_0x8835('0x13')]][_0x8835('0x21')]=0x0;writeDB(agents[_0x41dcb0[_0x8835('0x13')]]);}}catch(_0x201bbb){utils['error'](_0x201bbb[_0x8835('0x1a')]);}};exports[_0x8835('0x22')]=function(_0x49bab4){try{_[_0x8835('0x23')](agents,function(_0x117592,_0x1fb9cf){if(_0x117592[_0x8835('0x4')]==_0x49bab4[_0x8835('0x4')]){_0x117592[_0x8835('0x1b')]=!![];_0x117592[_0x8835('0x1c')]=utils[_0x8835('0x15')]();_0x117592[_0x8835('0xa')]='abandoned';_0x117592[_0x8835('0x1e')]=_0x8835('0x24');_0x117592[_0x8835('0x1f')]=_0x49bab4[_0x8835('0x1f')];_0x117592[_0x8835('0x21')]=0x0;writeDB(_0x117592);}});}catch(_0xc9f002){utils[_0x8835('0x19')](_0xc9f002[_0x8835('0x1a')]);}};exports['agentconnect']=function(_0x2fa7f4){try{if(agents[_0x2fa7f4[_0x8835('0x13')]]){agents[_0x2fa7f4[_0x8835('0x13')]][_0x8835('0x25')]=utils['now']();agents[_0x2fa7f4[_0x8835('0x13')]][_0x8835('0x17')]=_0x2fa7f4['connectedlinenum'];agents[_0x2fa7f4[_0x8835('0x13')]][_0x8835('0x18')]=_0x2fa7f4['connectedlinename'];agents[_0x2fa7f4[_0x8835('0x13')]][_0x8835('0x1f')]=_0x2fa7f4[_0x8835('0x20')];agents[_0x2fa7f4[_0x8835('0x13')]][_0x8835('0xa')]=_0x8835('0x26');_['forIn'](agents,function(_0x204aef,_0x219139){if(_0x204aef[_0x8835('0x13')]!=_0x2fa7f4['destuniqueid']&&_0x204aef[_0x8835('0x4')]==_0x2fa7f4[_0x8835('0x4')]){_0x204aef[_0x8835('0x21')]=0x0;_0x204aef[_0x8835('0x1f')]=_0x2fa7f4[_0x8835('0x20')];_0x204aef[_0x8835('0x1b')]=!![];_0x204aef['agentringnoanswerAt']=utils[_0x8835('0x15')]();_0x204aef[_0x8835('0xa')]=_0x8835('0x27');_0x204aef[_0x8835('0x1e')]=_0x8835('0x27');_0x204aef[_0x8835('0x28')]=_0x2fa7f4[_0x8835('0x13')];_0x204aef[_0x8835('0x29')]=_0x2fa7f4[_0x8835('0x7')];writeDB(_0x204aef);}});}}catch(_0x296261){utils[_0x8835('0x19')](_0x296261[_0x8835('0x1a')]);}};exports[_0x8835('0x2a')]=function(_0x16cf3b){try{if(!_['isNil'](agents[_0x16cf3b[_0x8835('0x13')]])){agents[_0x16cf3b['destuniqueid']][_0x8835('0x2a')]=!![];agents[_0x16cf3b[_0x8835('0x13')]]['agentcompleteAt']=utils[_0x8835('0x15')]();agents[_0x16cf3b['destuniqueid']][_0x8835('0x21')]=utils['diffTime'](agents[_0x16cf3b[_0x8835('0x13')]]['agentcompleteAt'],agents[_0x16cf3b[_0x8835('0x13')]]['agentconnectAt']);agents[_0x16cf3b[_0x8835('0x13')]][_0x8835('0x1e')]=_0x16cf3b[_0x8835('0x1e')];agents[_0x16cf3b[_0x8835('0x13')]][_0x8835('0xa')]=_0x8835('0x2b');writeDB(agents[_0x16cf3b['destuniqueid']]);}}catch(_0x3bfb07){utils[_0x8835('0x19')](_0x3bfb07['stack']);}};exports[_0x8835('0x2c')]=function(_0x4d9b84){try{if(!_[_0x8835('0x2d')](agents[_0x4d9b84[_0x8835('0x2e')]])){agents[_0x4d9b84['transfereruniqueid']]['transfer']=!![];agents[_0x4d9b84[_0x8835('0x2e')]]['transfertype']=_0x8835('0x2f');agents[_0x4d9b84['transfereruniqueid']][_0x8835('0x30')]=_0x4d9b84[_0x8835('0x31')];agents[_0x4d9b84[_0x8835('0x2e')]]['transferuniqueid']=agents[_0x4d9b84[_0x8835('0x2e')]][_0x8835('0x4')];}}catch(_0x1753a7){utils['error'](_0x1753a7[_0x8835('0x1a')]);}};exports['attendedtransfer']=function(_0x39d38b){try{if(_0x39d38b[_0x8835('0x32')]==_0x39d38b[_0x8835('0x33')]){if(!_[_0x8835('0x2d')](agents[_0x39d38b[_0x8835('0x34')]])){agents[_0x39d38b[_0x8835('0x34')]]['transfer']=!![];agents[_0x39d38b[_0x8835('0x34')]]['transfertype']=_0x8835('0x35');agents[_0x39d38b[_0x8835('0x34')]]['transferexten']=_0x39d38b['origtransfererexten'];agents[_0x39d38b['secondtransfereruniqueid']][_0x8835('0x36')]=_0x39d38b[_0x8835('0x32')];}if(_0x39d38b[_0x8835('0x37')]&&agents[_0x39d38b['transfereeuniqueid']]){agents[_0x39d38b[_0x8835('0x37')]][_0x8835('0x38')]=0x1;transfers[_0x39d38b[_0x8835('0x37')]]=_['clone'](agents[_0x39d38b[_0x8835('0x37')]]);transfers[_0x39d38b[_0x8835('0x37')]][_0x8835('0x9')]=agents[_0x39d38b['secondtransfereruniqueid']][_0x8835('0x9')];transfers[_0x39d38b[_0x8835('0x37')]][_0x8835('0x39')]=agents[_0x39d38b[_0x8835('0x34')]]['calleridname'];transfers[_0x39d38b['transfereeuniqueid']][_0x8835('0x3a')]=utils[_0x8835('0x15')]();transfers[_0x39d38b['transfereeuniqueid']][_0x8835('0x25')]=utils[_0x8835('0x15')]();transfers[_0x39d38b[_0x8835('0x37')]][_0x8835('0x1f')]=0x0;transfers[_0x39d38b['transfereeuniqueid']][_0x8835('0x38')]=0x2;}}else if(_0x39d38b[_0x8835('0x34')]==_0x39d38b[_0x8835('0x3b')]){if(!_[_0x8835('0x2d')](agents[_0x39d38b[_0x8835('0x32')]])){agents[_0x39d38b[_0x8835('0x32')]][_0x8835('0x3c')]=!![];agents[_0x39d38b[_0x8835('0x32')]][_0x8835('0x3d')]=_0x8835('0x35');agents[_0x39d38b['origtransfereruniqueid']][_0x8835('0x30')]=_0x39d38b['secondtransfererexten'];agents[_0x39d38b[_0x8835('0x32')]][_0x8835('0x36')]=_0x39d38b[_0x8835('0x34')];}if(_0x39d38b[_0x8835('0x3e')]&&agents[_0x39d38b[_0x8835('0x3e')]]){agents[_0x39d38b['transfertargetuniqueid']][_0x8835('0x38')]=0x1;transfers[_0x39d38b['transfertargetuniqueid']]=_[_0x8835('0x3f')](agents[_0x39d38b['transfertargetuniqueid']]);transfers[_0x39d38b[_0x8835('0x3e')]][_0x8835('0x9')]=agents[_0x39d38b[_0x8835('0x32')]]['calleridnum'];transfers[_0x39d38b[_0x8835('0x3e')]]['calleridname']=agents[_0x39d38b[_0x8835('0x32')]][_0x8835('0x39')];transfers[_0x39d38b[_0x8835('0x3e')]][_0x8835('0x3a')]=utils['now']();transfers[_0x39d38b['transfertargetuniqueid']][_0x8835('0x25')]=utils[_0x8835('0x15')]();transfers[_0x39d38b['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x39d38b[_0x8835('0x3e')]][_0x8835('0x38')]=0x2;}}}catch(_0x2b653e){utils[_0x8835('0x19')](_0x2b653e[_0x8835('0x1a')]);}};exports[_0x8835('0x40')]=function(_0x48b4c6){try{if(transfers[_0x48b4c6[_0x8835('0x4')]]){transfers[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x2a')]=!![];transfers[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x41')]=utils[_0x8835('0x15')]();transfers[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x21')]=utils[_0x8835('0x42')](transfers[_0x48b4c6['uniqueid']]['agentcompleteAt'],transfers[_0x48b4c6['uniqueid']][_0x8835('0x25')]);transfers[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x1e')]='agent';transfers[_0x48b4c6[_0x8835('0x4')]][_0x8835('0xa')]=_0x8835('0x2b');writeDB(transfers[_0x48b4c6[_0x8835('0x4')]],!![]);}if(agents[_0x48b4c6[_0x8835('0x4')]]&&agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x25')]){agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x2a')]=!![];agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x41')]=utils[_0x8835('0x15')]();agents[_0x48b4c6['uniqueid']]['talktime']=utils[_0x8835('0x42')](agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x41')],agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x25')]);agents[_0x48b4c6[_0x8835('0x4')]]['reason']=agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0x3c')]?_0x8835('0x3c'):_0x8835('0x43');agents[_0x48b4c6[_0x8835('0x4')]][_0x8835('0xa')]=_0x8835('0x2b');writeDB(agents[_0x48b4c6['uniqueid']]);}}catch(_0x564688){utils[_0x8835('0x19')](_0x564688[_0x8835('0x1a')]);}}; \ No newline at end of file +var _0x06f4=['agentringnoanswer','isNil','agentringnoanswerAt','lastevent','rejected','reason','holdtime','ringtime','queuecallerabandon','forIn','abandoned','talktime','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','called','connectedlinename','error','stack'];(function(_0x1c5918,_0x556191){var _0x5500e8=function(_0x4dfff2){while(--_0x4dfff2){_0x1c5918['push'](_0x1c5918['shift']());}};_0x5500e8(++_0x556191);}(_0x06f4,0x1b4));var _0x406f=function(_0x1cb96e,_0x20cc41){_0x1cb96e=_0x1cb96e-0x0;var _0x3e7e2d=_0x06f4[_0x1cb96e];return _0x3e7e2d;};'use strict';var _=require(_0x406f('0x0'));var util=require('util');var utils=require(_0x406f('0x1'));var agents={};var transfers={};function writeDB(_0x3e3b24,_0x517475){utils['info'](util[_0x406f('0x2')](_0x406f('0x3'),_0x3e3b24[_0x406f('0x4')],_0x3e3b24[_0x406f('0x5')],_0x3e3b24[_0x406f('0x6')],_0x3e3b24[_0x406f('0x7')],_0x3e3b24['interface'],_0x3e3b24[_0x406f('0x8')],_0x3e3b24[_0x406f('0x9')],_0x3e3b24['lastevent']));if(_0x3e3b24[_0x406f('0x6')]){utils[_0x406f('0xa')](_0x3e3b24[_0x406f('0x6')])['then'](function(_0x5349c2){if(_0x5349c2){_0x3e3b24[_0x406f('0xb')]=_0x5349c2[_0x406f('0xb')];_0x3e3b24[_0x406f('0xc')]=_0x3e3b24[_0x406f('0xd')]?_0x5349c2['acw']:![];_0x3e3b24[_0x406f('0xe')]=_0x3e3b24[_0x406f('0xc')]?_0x5349c2[_0x406f('0xf')]:0x0;}utils[_0x406f('0x10')]('CreateVoiceAgentReport',_0x3e3b24);});}else{utils[_0x406f('0x10')](_0x406f('0x11'),_0x3e3b24);}if(_0x517475){delete transfers[_0x3e3b24[_0x406f('0x4')]];}else{delete agents[_0x3e3b24['destuniqueid']];}}exports[_0x406f('0x12')]=function(_0x733b1b){try{agents[_0x733b1b[_0x406f('0x13')]]=_0x733b1b;agents[_0x733b1b[_0x406f('0x13')]][_0x406f('0x14')]=utils[_0x406f('0x15')]();agents[_0x733b1b[_0x406f('0x13')]]['lastevent']=_0x406f('0x16');agents[_0x733b1b[_0x406f('0x13')]][_0x406f('0x9')]=null;agents[_0x733b1b['destuniqueid']][_0x406f('0x17')]=null;}catch(_0x3bf4d7){utils[_0x406f('0x18')](_0x3bf4d7[_0x406f('0x19')]);}};exports[_0x406f('0x1a')]=function(_0x424c99){try{if(!_[_0x406f('0x1b')](agents[_0x424c99[_0x406f('0x13')]])){agents[_0x424c99['destuniqueid']][_0x406f('0x1a')]=!![];agents[_0x424c99[_0x406f('0x13')]][_0x406f('0x1c')]=utils[_0x406f('0x15')]();agents[_0x424c99['destuniqueid']][_0x406f('0x1d')]=_0x406f('0x1e');agents[_0x424c99[_0x406f('0x13')]][_0x406f('0x1f')]=_0x406f('0x1e');agents[_0x424c99[_0x406f('0x13')]][_0x406f('0x20')]=_0x424c99[_0x406f('0x21')]?parseInt(_0x424c99[_0x406f('0x21')])/0x3e8:0x0;agents[_0x424c99[_0x406f('0x13')]]['talktime']=0x0;writeDB(agents[_0x424c99[_0x406f('0x13')]]);}}catch(_0x404cdc){utils[_0x406f('0x18')](_0x404cdc[_0x406f('0x19')]);}};exports[_0x406f('0x22')]=function(_0x2ccf76){try{_[_0x406f('0x23')](agents,function(_0x1b7ea8,_0x38a66d){if(_0x1b7ea8['uniqueid']==_0x2ccf76[_0x406f('0x4')]){_0x1b7ea8[_0x406f('0x1a')]=!![];_0x1b7ea8[_0x406f('0x1c')]=utils['now']();_0x1b7ea8['lastevent']='abandoned';_0x1b7ea8[_0x406f('0x1f')]=_0x406f('0x24');_0x1b7ea8[_0x406f('0x20')]=_0x2ccf76[_0x406f('0x20')];_0x1b7ea8[_0x406f('0x25')]=0x0;writeDB(_0x1b7ea8);}});}catch(_0x51dcbd){utils[_0x406f('0x18')](_0x51dcbd[_0x406f('0x19')]);}};exports['agentconnect']=function(_0x21f021){try{if(agents[_0x21f021[_0x406f('0x13')]]){agents[_0x21f021[_0x406f('0x13')]][_0x406f('0x26')]=utils[_0x406f('0x15')]();agents[_0x21f021[_0x406f('0x13')]][_0x406f('0x9')]=_0x21f021[_0x406f('0x9')];agents[_0x21f021['destuniqueid']][_0x406f('0x17')]=_0x21f021[_0x406f('0x17')];agents[_0x21f021[_0x406f('0x13')]]['holdtime']=_0x21f021['ringtime'];agents[_0x21f021[_0x406f('0x13')]][_0x406f('0x1d')]=_0x406f('0x27');_[_0x406f('0x23')](agents,function(_0x4b850b,_0xacd249){if(_0x4b850b['destuniqueid']!=_0x21f021[_0x406f('0x13')]&&_0x4b850b[_0x406f('0x4')]==_0x21f021[_0x406f('0x4')]){_0x4b850b[_0x406f('0x25')]=0x0;_0x4b850b['holdtime']=_0x21f021['ringtime'];_0x4b850b[_0x406f('0x1a')]=!![];_0x4b850b['agentringnoanswerAt']=utils[_0x406f('0x15')]();_0x4b850b[_0x406f('0x1d')]=_0x406f('0x28');_0x4b850b[_0x406f('0x1f')]=_0x406f('0x28');_0x4b850b[_0x406f('0x29')]=_0x21f021[_0x406f('0x13')];_0x4b850b[_0x406f('0x2a')]=_0x21f021[_0x406f('0x7')];writeDB(_0x4b850b);}});}}catch(_0x9ebd33){utils[_0x406f('0x18')](_0x9ebd33[_0x406f('0x19')]);}};exports[_0x406f('0xd')]=function(_0x3b678e){try{if(!_[_0x406f('0x1b')](agents[_0x3b678e['destuniqueid']])){agents[_0x3b678e[_0x406f('0x13')]]['agentcomplete']=!![];agents[_0x3b678e[_0x406f('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x3b678e['destuniqueid']][_0x406f('0x25')]=utils[_0x406f('0x2b')](agents[_0x3b678e['destuniqueid']][_0x406f('0x2c')],agents[_0x3b678e['destuniqueid']][_0x406f('0x26')]);agents[_0x3b678e[_0x406f('0x13')]][_0x406f('0x1f')]=_0x3b678e[_0x406f('0x1f')];agents[_0x3b678e[_0x406f('0x13')]][_0x406f('0x1d')]=_0x406f('0x2d');writeDB(agents[_0x3b678e[_0x406f('0x13')]]);}}catch(_0x4b5c11){utils[_0x406f('0x18')](_0x4b5c11[_0x406f('0x19')]);}};exports[_0x406f('0x2e')]=function(_0x2c29ea){try{if(!_['isNil'](agents[_0x2c29ea[_0x406f('0x2f')]])){agents[_0x2c29ea['transfereruniqueid']][_0x406f('0x30')]=!![];agents[_0x2c29ea['transfereruniqueid']][_0x406f('0x31')]='blind';agents[_0x2c29ea[_0x406f('0x2f')]][_0x406f('0x32')]=_0x2c29ea['extension'];agents[_0x2c29ea[_0x406f('0x2f')]][_0x406f('0x33')]=agents[_0x2c29ea[_0x406f('0x2f')]][_0x406f('0x4')];}}catch(_0x37d492){utils['error'](_0x37d492[_0x406f('0x19')]);}};exports[_0x406f('0x34')]=function(_0x481bbc){try{if(_0x481bbc[_0x406f('0x35')]==_0x481bbc[_0x406f('0x36')]){if(!_['isNil'](agents[_0x481bbc[_0x406f('0x37')]])){agents[_0x481bbc[_0x406f('0x37')]][_0x406f('0x30')]=!![];agents[_0x481bbc[_0x406f('0x37')]][_0x406f('0x31')]=_0x406f('0x38');agents[_0x481bbc[_0x406f('0x37')]][_0x406f('0x32')]=_0x481bbc[_0x406f('0x39')];agents[_0x481bbc[_0x406f('0x37')]][_0x406f('0x33')]=_0x481bbc[_0x406f('0x35')];}if(_0x481bbc[_0x406f('0x3a')]&&agents[_0x481bbc[_0x406f('0x3a')]]){agents[_0x481bbc[_0x406f('0x3a')]]['agententerreason']=0x1;transfers[_0x481bbc[_0x406f('0x3a')]]=_[_0x406f('0x3b')](agents[_0x481bbc[_0x406f('0x3a')]]);transfers[_0x481bbc[_0x406f('0x3a')]][_0x406f('0x8')]=agents[_0x481bbc[_0x406f('0x37')]][_0x406f('0x8')];transfers[_0x481bbc[_0x406f('0x3a')]]['calleridname']=agents[_0x481bbc['secondtransfereruniqueid']][_0x406f('0x3c')];transfers[_0x481bbc[_0x406f('0x3a')]][_0x406f('0x14')]=utils[_0x406f('0x15')]();transfers[_0x481bbc[_0x406f('0x3a')]]['agentconnectAt']=utils[_0x406f('0x15')]();transfers[_0x481bbc[_0x406f('0x3a')]][_0x406f('0x20')]=0x0;transfers[_0x481bbc[_0x406f('0x3a')]][_0x406f('0x3d')]=0x2;}}else if(_0x481bbc[_0x406f('0x37')]==_0x481bbc['secondtransfererlinkedid']){if(!_[_0x406f('0x1b')](agents[_0x481bbc['origtransfereruniqueid']])){agents[_0x481bbc[_0x406f('0x35')]][_0x406f('0x30')]=!![];agents[_0x481bbc[_0x406f('0x35')]][_0x406f('0x31')]=_0x406f('0x38');agents[_0x481bbc[_0x406f('0x35')]][_0x406f('0x32')]=_0x481bbc[_0x406f('0x3e')];agents[_0x481bbc[_0x406f('0x35')]][_0x406f('0x33')]=_0x481bbc[_0x406f('0x37')];}if(_0x481bbc[_0x406f('0x3f')]&&agents[_0x481bbc[_0x406f('0x3f')]]){agents[_0x481bbc['transfertargetuniqueid']][_0x406f('0x3d')]=0x1;transfers[_0x481bbc[_0x406f('0x3f')]]=_[_0x406f('0x3b')](agents[_0x481bbc[_0x406f('0x3f')]]);transfers[_0x481bbc[_0x406f('0x3f')]][_0x406f('0x8')]=agents[_0x481bbc['origtransfereruniqueid']]['calleridnum'];transfers[_0x481bbc['transfertargetuniqueid']][_0x406f('0x3c')]=agents[_0x481bbc[_0x406f('0x35')]][_0x406f('0x3c')];transfers[_0x481bbc[_0x406f('0x3f')]]['agentcalledAt']=utils[_0x406f('0x15')]();transfers[_0x481bbc['transfertargetuniqueid']][_0x406f('0x26')]=utils[_0x406f('0x15')]();transfers[_0x481bbc[_0x406f('0x3f')]][_0x406f('0x20')]=0x0;transfers[_0x481bbc[_0x406f('0x3f')]][_0x406f('0x3d')]=0x2;}}}catch(_0x4240d9){utils[_0x406f('0x18')](_0x4240d9[_0x406f('0x19')]);}};exports[_0x406f('0x40')]=function(_0x5492fd){try{if(transfers[_0x5492fd[_0x406f('0x4')]]){transfers[_0x5492fd[_0x406f('0x4')]]['agentcomplete']=!![];transfers[_0x5492fd['uniqueid']][_0x406f('0x2c')]=utils[_0x406f('0x15')]();transfers[_0x5492fd['uniqueid']][_0x406f('0x25')]=utils[_0x406f('0x2b')](transfers[_0x5492fd[_0x406f('0x4')]][_0x406f('0x2c')],transfers[_0x5492fd[_0x406f('0x4')]][_0x406f('0x26')]);transfers[_0x5492fd['uniqueid']][_0x406f('0x1f')]=_0x406f('0x41');transfers[_0x5492fd['uniqueid']]['lastevent']='complete';writeDB(transfers[_0x5492fd[_0x406f('0x4')]],!![]);}if(agents[_0x5492fd[_0x406f('0x4')]]&&agents[_0x5492fd[_0x406f('0x4')]]['agentconnectAt']){agents[_0x5492fd[_0x406f('0x4')]][_0x406f('0xd')]=!![];agents[_0x5492fd[_0x406f('0x4')]][_0x406f('0x2c')]=utils['now']();agents[_0x5492fd[_0x406f('0x4')]]['talktime']=utils['diffTime'](agents[_0x5492fd['uniqueid']][_0x406f('0x2c')],agents[_0x5492fd[_0x406f('0x4')]][_0x406f('0x26')]);agents[_0x5492fd[_0x406f('0x4')]][_0x406f('0x1f')]=agents[_0x5492fd[_0x406f('0x4')]][_0x406f('0x30')]?'transfer':_0x406f('0x41');agents[_0x5492fd[_0x406f('0x4')]]['lastevent']='complete';writeDB(agents[_0x5492fd[_0x406f('0x4')]]);}}catch(_0x7c3019){utils['error'](_0x7c3019[_0x406f('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 155af88..1ca9087 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 _0xb633=['endtime','duration','diffTime','billableseconds','error','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstop','musiconholdstartAt','mohtime','value','xmd-phone','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','xmd-contactid','xmd-cdrtype','type','outboundrouteid','sipcallid','application','set','startsWith','appdata','toLowerCase','split','substring','lastIndexOf','includes','hangup','noop','gotoif','lastapplication','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','accountcode','source','destination','callerid','then','CreateVoiceCallReport','request','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','channel','now','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','calleridname'];(function(_0x197d72,_0x19b07b){var _0x1e3507=function(_0x34e0b6){while(--_0x34e0b6){_0x197d72['push'](_0x197d72['shift']());}};_0x1e3507(++_0x19b07b);}(_0xb633,0x71));var _0x3b63=function(_0x458a58,_0x2710e4){_0x458a58=_0x458a58-0x0;var _0x2cdf63=_0xb633[_0x458a58];return _0x2cdf63;};'use strict';var _=require('lodash');var util=require(_0x3b63('0x0'));var utils=require(_0x3b63('0x1'));var dispositions=[_0x3b63('0x2'),_0x3b63('0x3'),_0x3b63('0x3'),_0x3b63('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x3b63('0x4'),'BUSY',_0x3b63('0x3'),_0x3b63('0x3'),'FAILED'];var channels={};function writeDB(_0x126ae4){utils[_0x3b63('0x5')](util[_0x3b63('0x6')](_0x3b63('0x7'),_0x126ae4[_0x3b63('0x8')],_0x126ae4['channel'],_0x126ae4['type'],_0x126ae4[_0x3b63('0x9')],_0x126ae4[_0x3b63('0xa')],_0x126ae4[_0x3b63('0xb')],_0x126ae4[_0x3b63('0xc')],_0x126ae4['disposition']));if(_0x126ae4[_0x3b63('0x9')]){utils['getUserByInternal'](_0x126ae4['accountcode'])[_0x3b63('0xd')](function(_0x54d357){if(_0x54d357){_0x126ae4['UserId']=_0x54d357['id'];}utils['request'](_0x3b63('0xe'),_0x126ae4);});}else{utils[_0x3b63('0xf')](_0x3b63('0xe'),_0x126ae4);}if(channels[_0x126ae4['uniqueid']]){delete channels[_0x126ae4[_0x3b63('0x8')]];}}exports[_0x3b63('0x10')]=function(_0x5af8ab){try{if(_0x5af8ab['uniqueid']==_0x5af8ab[_0x3b63('0x11')]&&_0x5af8ab['channel']!=_0x3b63('0x12')){channels[_0x5af8ab[_0x3b63('0x8')]]={'uniqueid':_0x5af8ab[_0x3b63('0x8')],'accountcode':_0x5af8ab[_0x3b63('0x9')],'source':_0x5af8ab[_0x3b63('0x13')],'destination':_0x5af8ab[_0x3b63('0x14')],'destinationcontext':_0x5af8ab[_0x3b63('0x15')],'channel':_0x5af8ab[_0x3b63('0x16')],'starttime':utils[_0x3b63('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x3b63('0x18')};}}catch(_0x469343){utils['error'](_0x469343[_0x3b63('0x19')]);}};exports[_0x3b63('0x1a')]=function(_0x208abd){try{if(!_[_0x3b63('0x1b')](channels[_0x208abd[_0x3b63('0x8')]])&&_0x208abd[_0x3b63('0x1c')]==0x6){if(_[_0x3b63('0x1b')](channels[_0x208abd[_0x3b63('0x8')]][_0x3b63('0x1d')])){channels[_0x208abd['uniqueid']][_0x3b63('0x1d')]=utils[_0x3b63('0x17')]();}}else if(!_[_0x3b63('0x1b')](channels[_0x208abd[_0x3b63('0x11')]])&&_0x208abd[_0x3b63('0x1c')]==0x6&&_0x208abd[_0x3b63('0x15')]!=_0x3b63('0x1e')){channels[_0x208abd['linkedid']][_0x3b63('0x9')]=_0x208abd[_0x3b63('0x9')];channels[_0x208abd[_0x3b63('0x11')]][_0x3b63('0x1f')]=_0x208abd[_0x3b63('0x16')];if(_[_0x3b63('0x1b')](channels[_0x208abd[_0x3b63('0x11')]][_0x3b63('0x20')])){channels[_0x208abd[_0x3b63('0x11')]][_0x3b63('0x20')]=utils[_0x3b63('0x17')]();}channels[_0x208abd[_0x3b63('0x11')]][_0x3b63('0x21')]=dispositions[_['toNumber'](_0x208abd['channelstate'])]||_0x3b63('0x4');}}catch(_0x3ae2da){utils['error'](_0x3ae2da['stack']);}};exports['hangup']=function(_0x4ec729){try{if(!_[_0x3b63('0x1b')](channels[_0x4ec729['uniqueid']])){if(_[_0x3b63('0x1b')](channels[_0x4ec729[_0x3b63('0x8')]]['callerid'])){channels[_0x4ec729['uniqueid']][_0x3b63('0xc')]=_0x4ec729[_0x3b63('0x22')]+'\x20<'+_0x4ec729[_0x3b63('0x13')]+'>';}channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x23')]=utils[_0x3b63('0x17')]();channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x24')]=utils[_0x3b63('0x25')](channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x23')],channels[_0x4ec729['uniqueid']]['starttime']);channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x26')]=channels[_0x4ec729['uniqueid']][_0x3b63('0x20')]?utils[_0x3b63('0x25')](channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x23')],channels[_0x4ec729[_0x3b63('0x8')]][_0x3b63('0x20')]):0x0;writeDB(channels[_0x4ec729[_0x3b63('0x8')]]);}}catch(_0x119def){utils[_0x3b63('0x27')](_0x119def[_0x3b63('0x19')]);}};exports['attendedtransfer']=function(_0x876532){try{if(!_['isNil'](channels[_0x876532[_0x3b63('0x28')]])){if(channels[_0x876532[_0x3b63('0x28')]][_0x3b63('0x16')]==_0x876532['transfereechannel']){channels[_0x876532['localtwolinkedid']][_0x3b63('0x1f')]=_0x876532[_0x3b63('0x29')];channels[_0x876532[_0x3b63('0x28')]][_0x3b63('0x2a')]=_0x3b63('0x2b');}else if(channels[_0x876532['localtwolinkedid']][_0x3b63('0x16')]=_0x876532[_0x3b63('0x2c')]){channels[_0x876532['localtwolinkedid']][_0x3b63('0x1f')]=_0x876532['origtransfererchannel'];channels[_0x876532[_0x3b63('0x28')]]['userfield']=_0x3b63('0x2b');}}}catch(_0x261038){utils[_0x3b63('0x27')](_0x261038[_0x3b63('0x19')]);}};exports['musiconholdstart']=function(_0x25f9ba){try{if(!_[_0x3b63('0x1b')](channels[_0x25f9ba[_0x3b63('0x8')]])){channels[_0x25f9ba[_0x3b63('0x8')]]['musiconholdstartAt']=utils['now']();}}catch(_0x433578){utils[_0x3b63('0x27')](_0x433578[_0x3b63('0x19')]);}};exports[_0x3b63('0x2d')]=function(_0x472b67){try{if(!_[_0x3b63('0x1b')](channels[_0x472b67['uniqueid']])){if(!_[_0x3b63('0x1b')](channels[_0x472b67['uniqueid']][_0x3b63('0x2e')])){channels[_0x472b67['uniqueid']][_0x3b63('0x2f')]+=utils['diffTime'](utils[_0x3b63('0x17')](),channels[_0x472b67[_0x3b63('0x8')]]['musiconholdstartAt']);delete channels[_0x472b67[_0x3b63('0x8')]][_0x3b63('0x2e')];}}}catch(_0xf583dc){utils[_0x3b63('0x27')](_0xf583dc[_0x3b63('0x19')]);}};exports['varset']=function(_0x23d83e){try{if(!_['isNil'](channels[_0x23d83e[_0x3b63('0x8')]])){if(!_[_0x3b63('0x1b')](_0x23d83e['variable']['xmd-originatecalleridnum'])){channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0xa')]=_0x23d83e[_0x3b63('0x30')];}if(!_[_0x3b63('0x1b')](_0x23d83e['variable'][_0x3b63('0x31')])){channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0xb')]=_0x23d83e[_0x3b63('0x30')];channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0xc')]='\x22'+_0x23d83e['value']+_0x3b63('0x32')+_0x23d83e[_0x3b63('0x30')]+'>';}if(!_[_0x3b63('0x1b')](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x34')])||!_[_0x3b63('0x1b')](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x35')])){channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0xc')]=_0x23d83e['value'];}if(!_[_0x3b63('0x1b')](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x36')])||!_['isNil'](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x37')])){channels[_0x23d83e['uniqueid']]['lastapplication']='Queue';channels[_0x23d83e['uniqueid']]['lastdata']=_0x23d83e[_0x3b63('0x30')];channels[_0x23d83e[_0x3b63('0x8')]]['queue']=!![];}if(!_[_0x3b63('0x1b')](_0x23d83e['variable'][_0x3b63('0x38')])){channels[_0x23d83e['uniqueid']]['ContactId']=_0x23d83e[_0x3b63('0x30')];}if(!_[_0x3b63('0x1b')](_0x23d83e['variable'][_0x3b63('0x39')])){channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0x3a')]=_0x23d83e[_0x3b63('0x30')];}if(!_[_0x3b63('0x1b')](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x3b')])){channels[_0x23d83e[_0x3b63('0x8')]]['routeid']=_0x23d83e[_0x3b63('0x30')];}if(!_[_0x3b63('0x1b')](_0x23d83e[_0x3b63('0x33')][_0x3b63('0x3c')])){channels[_0x23d83e[_0x3b63('0x8')]][_0x3b63('0x3c')]=_0x23d83e['value'];}}}catch(_0x44b1e9){utils[_0x3b63('0x27')](_0x44b1e9[_0x3b63('0x19')]);}};exports['newexten']=function(_0xc9be8){try{if(!_[_0x3b63('0x1b')](channels[_0xc9be8[_0x3b63('0x8')]])){if(_0xc9be8[_0x3b63('0x3d')]['toLowerCase']()==_0x3b63('0x3e')&&_[_0x3b63('0x3f')](_0xc9be8[_0x3b63('0x40')][_0x3b63('0x41')](),'cdr')){var _0x50357c=_0xc9be8[_0x3b63('0x40')][_0x3b63('0x42')]('=');var _0x1af8fb=_0x50357c[0x0][_0x3b63('0x43')](_0x50357c[0x0][_0x3b63('0x44')]('(')+0x1,_0x50357c[0x0][_0x3b63('0x44')](')'));var _0x424635=_0x50357c[0x1];channels[_0xc9be8[_0x3b63('0x8')]][_0x1af8fb]=_0x424635;}if(!_[_0x3b63('0x45')]([_0x3b63('0x46'),_0x3b63('0x47'),'execif',_0x3b63('0x3e'),_0x3b63('0x48')],_0xc9be8[_0x3b63('0x3d')][_0x3b63('0x41')]())){channels[_0xc9be8[_0x3b63('0x8')]][_0x3b63('0x49')]=_0xc9be8[_0x3b63('0x3d')];channels[_0xc9be8['uniqueid']]['lastdata']=_0xc9be8['appdata'];}}}catch(_0x1efd6b){utils[_0x3b63('0x27')](_0x1efd6b[_0x3b63('0x19')]);}}; \ No newline at end of file +var _0xdcfe=['\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','startsWith','appdata','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','stack','channelstate','isNil','systemanswertime','transfer','answertime','error','hangup','callerid','calleridname','endtime','diffTime','starttime','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','xmd-originatecalleridnum','value','variable','xmd-phone','destination'];(function(_0x7b4d57,_0x533b6c){var _0x51dc60=function(_0xb27885){while(--_0xb27885){_0x7b4d57['push'](_0x7b4d57['shift']());}};_0x51dc60(++_0x533b6c);}(_0xdcfe,0xbf));var _0xedcf=function(_0x3c8ce5,_0x2f4561){_0x3c8ce5=_0x3c8ce5-0x0;var _0x4c68b9=_0xdcfe[_0x3c8ce5];return _0x4c68b9;};'use strict';var _=require(_0xedcf('0x0'));var util=require(_0xedcf('0x1'));var utils=require('./utils');var dispositions=[_0xedcf('0x2'),_0xedcf('0x3'),_0xedcf('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0xedcf('0x2'),_0xedcf('0x4'),_0xedcf('0x5'),_0xedcf('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x1ef067){utils[_0xedcf('0x6')](util[_0xedcf('0x7')](_0xedcf('0x8'),_0x1ef067['uniqueid'],_0x1ef067[_0xedcf('0x9')],_0x1ef067[_0xedcf('0xa')],_0x1ef067[_0xedcf('0xb')],_0x1ef067[_0xedcf('0xc')],_0x1ef067['destination'],_0x1ef067['callerid'],_0x1ef067[_0xedcf('0xd')]));if(_0x1ef067[_0xedcf('0xb')]){utils[_0xedcf('0xe')](_0x1ef067[_0xedcf('0xb')])[_0xedcf('0xf')](function(_0x4636c5){if(_0x4636c5){_0x1ef067[_0xedcf('0x10')]=_0x4636c5['id'];}utils[_0xedcf('0x11')](_0xedcf('0x12'),_0x1ef067);});}else{utils[_0xedcf('0x11')]('CreateVoiceCallReport',_0x1ef067);}if(channels[_0x1ef067['uniqueid']]){delete channels[_0x1ef067[_0xedcf('0x13')]];}}exports[_0xedcf('0x14')]=function(_0x28a1c8){try{if(_0x28a1c8[_0xedcf('0x13')]==_0x28a1c8[_0xedcf('0x15')]&&_0x28a1c8[_0xedcf('0x9')]!=_0xedcf('0x16')){channels[_0x28a1c8['uniqueid']]={'uniqueid':_0x28a1c8[_0xedcf('0x13')],'accountcode':_0x28a1c8[_0xedcf('0xb')],'source':_0x28a1c8[_0xedcf('0x17')],'destination':_0x28a1c8[_0xedcf('0x18')],'destinationcontext':_0x28a1c8[_0xedcf('0x19')],'channel':_0x28a1c8['channel'],'starttime':utils[_0xedcf('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xedcf('0x2'),'amaflags':_0xedcf('0x1b')};}}catch(_0x221eea){utils['error'](_0x221eea[_0xedcf('0x1c')]);}};exports['newstate']=function(_0x432bcc){try{if(!_['isNil'](channels[_0x432bcc['uniqueid']])&&_0x432bcc[_0xedcf('0x1d')]==0x6){if(_[_0xedcf('0x1e')](channels[_0x432bcc[_0xedcf('0x13')]]['systemanswertime'])){channels[_0x432bcc[_0xedcf('0x13')]][_0xedcf('0x1f')]=utils['now']();}}else if(!_[_0xedcf('0x1e')](channels[_0x432bcc['linkedid']])&&_0x432bcc[_0xedcf('0x1d')]==0x6&&_0x432bcc[_0xedcf('0x19')]!=_0xedcf('0x20')){channels[_0x432bcc[_0xedcf('0x15')]]['accountcode']=_0x432bcc[_0xedcf('0xb')];channels[_0x432bcc[_0xedcf('0x15')]]['destinationchannel']=_0x432bcc[_0xedcf('0x9')];if(_[_0xedcf('0x1e')](channels[_0x432bcc[_0xedcf('0x15')]][_0xedcf('0x21')])){channels[_0x432bcc[_0xedcf('0x15')]][_0xedcf('0x21')]=utils[_0xedcf('0x1a')]();}channels[_0x432bcc[_0xedcf('0x15')]][_0xedcf('0xd')]=dispositions[_['toNumber'](_0x432bcc[_0xedcf('0x1d')])]||_0xedcf('0x4');}}catch(_0x42665f){utils[_0xedcf('0x22')](_0x42665f[_0xedcf('0x1c')]);}};exports[_0xedcf('0x23')]=function(_0x27ebdf){try{if(!_['isNil'](channels[_0x27ebdf[_0xedcf('0x13')]])){if(_['isNil'](channels[_0x27ebdf[_0xedcf('0x13')]][_0xedcf('0x24')])){channels[_0x27ebdf['uniqueid']]['callerid']=_0x27ebdf[_0xedcf('0x25')]+'\x20<'+_0x27ebdf[_0xedcf('0x17')]+'>';}channels[_0x27ebdf['uniqueid']][_0xedcf('0x26')]=utils[_0xedcf('0x1a')]();channels[_0x27ebdf[_0xedcf('0x13')]]['duration']=utils[_0xedcf('0x27')](channels[_0x27ebdf[_0xedcf('0x13')]][_0xedcf('0x26')],channels[_0x27ebdf[_0xedcf('0x13')]][_0xedcf('0x28')]);channels[_0x27ebdf[_0xedcf('0x13')]]['billableseconds']=channels[_0x27ebdf['uniqueid']]['answertime']?utils[_0xedcf('0x27')](channels[_0x27ebdf[_0xedcf('0x13')]]['endtime'],channels[_0x27ebdf['uniqueid']][_0xedcf('0x21')]):0x0;writeDB(channels[_0x27ebdf[_0xedcf('0x13')]]);}}catch(_0x4c618f){utils[_0xedcf('0x22')](_0x4c618f[_0xedcf('0x1c')]);}};exports[_0xedcf('0x29')]=function(_0x56d372){try{if(!_[_0xedcf('0x1e')](channels[_0x56d372[_0xedcf('0x2a')]])){if(channels[_0x56d372[_0xedcf('0x2a')]][_0xedcf('0x9')]==_0x56d372[_0xedcf('0x2b')]){channels[_0x56d372[_0xedcf('0x2a')]][_0xedcf('0x2c')]=_0x56d372['secondtransfererchannel'];channels[_0x56d372['localtwolinkedid']][_0xedcf('0x2d')]=_0xedcf('0x2e');}else if(channels[_0x56d372[_0xedcf('0x2a')]]['channel']=_0x56d372['transfertargetchannel']){channels[_0x56d372[_0xedcf('0x2a')]][_0xedcf('0x2c')]=_0x56d372[_0xedcf('0x2f')];channels[_0x56d372[_0xedcf('0x2a')]][_0xedcf('0x2d')]=_0xedcf('0x2e');}}}catch(_0x6b1bae){utils[_0xedcf('0x22')](_0x6b1bae[_0xedcf('0x1c')]);}};exports[_0xedcf('0x30')]=function(_0x557ea8){try{if(!_['isNil'](channels[_0x557ea8[_0xedcf('0x13')]])){channels[_0x557ea8[_0xedcf('0x13')]][_0xedcf('0x31')]=utils[_0xedcf('0x1a')]();}}catch(_0x15423a){utils[_0xedcf('0x22')](_0x15423a[_0xedcf('0x1c')]);}};exports[_0xedcf('0x32')]=function(_0x32aa05){try{if(!_[_0xedcf('0x1e')](channels[_0x32aa05[_0xedcf('0x13')]])){if(!_['isNil'](channels[_0x32aa05[_0xedcf('0x13')]][_0xedcf('0x31')])){channels[_0x32aa05[_0xedcf('0x13')]][_0xedcf('0x33')]+=utils[_0xedcf('0x27')](utils['now'](),channels[_0x32aa05[_0xedcf('0x13')]][_0xedcf('0x31')]);delete channels[_0x32aa05[_0xedcf('0x13')]][_0xedcf('0x31')];}}}catch(_0x51203a){utils[_0xedcf('0x22')](_0x51203a[_0xedcf('0x1c')]);}};exports[_0xedcf('0x34')]=function(_0x3b1a8b){try{if(!_['isNil'](channels[_0x3b1a8b[_0xedcf('0x13')]])){if(!_[_0xedcf('0x1e')](_0x3b1a8b['variable'][_0xedcf('0x35')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0xc')]=_0x3b1a8b[_0xedcf('0x36')];}if(!_['isNil'](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x38')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x39')]=_0x3b1a8b[_0xedcf('0x36')];channels[_0x3b1a8b['uniqueid']][_0xedcf('0x24')]='\x22'+_0x3b1a8b[_0xedcf('0x36')]+_0xedcf('0x3a')+_0x3b1a8b['value']+'>';}if(!_[_0xedcf('0x1e')](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x3b')])||!_['isNil'](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x3c')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x24')]=_0x3b1a8b[_0xedcf('0x36')];}if(!_['isNil'](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x3d')])||!_['isNil'](_0x3b1a8b[_0xedcf('0x37')]['xmcs-queue'])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x3e')]=_0xedcf('0x3f');channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x40')]=_0x3b1a8b['value'];channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x41')]=!![];}if(!_[_0xedcf('0x1e')](_0x3b1a8b[_0xedcf('0x37')]['xmd-contactid'])){channels[_0x3b1a8b[_0xedcf('0x13')]]['ContactId']=_0x3b1a8b[_0xedcf('0x36')];}if(!_['isNil'](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x42')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0xa')]=_0x3b1a8b[_0xedcf('0x36')];}if(!_[_0xedcf('0x1e')](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x43')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x44')]=_0x3b1a8b[_0xedcf('0x36')];}if(!_[_0xedcf('0x1e')](_0x3b1a8b[_0xedcf('0x37')][_0xedcf('0x45')])){channels[_0x3b1a8b[_0xedcf('0x13')]][_0xedcf('0x45')]=_0x3b1a8b[_0xedcf('0x36')];}}}catch(_0x154b7a){utils[_0xedcf('0x22')](_0x154b7a['stack']);}};exports[_0xedcf('0x46')]=function(_0xae6262){try{if(!_['isNil'](channels[_0xae6262[_0xedcf('0x13')]])){if(_0xae6262[_0xedcf('0x47')][_0xedcf('0x48')]()=='set'&&_[_0xedcf('0x49')](_0xae6262[_0xedcf('0x4a')][_0xedcf('0x48')](),'cdr')){var _0x3675c1=_0xae6262[_0xedcf('0x4a')][_0xedcf('0x4b')]('=');var _0x274fe1=_0x3675c1[0x0][_0xedcf('0x4c')](_0x3675c1[0x0][_0xedcf('0x4d')]('(')+0x1,_0x3675c1[0x0][_0xedcf('0x4d')](')'));var _0xe2e1e6=_0x3675c1[0x1];channels[_0xae6262[_0xedcf('0x13')]][_0x274fe1]=_0xe2e1e6;}if(!_[_0xedcf('0x4e')]([_0xedcf('0x23'),_0xedcf('0x4f'),_0xedcf('0x50'),_0xedcf('0x51'),_0xedcf('0x52')],_0xae6262[_0xedcf('0x47')]['toLowerCase']())){channels[_0xae6262[_0xedcf('0x13')]][_0xedcf('0x3e')]=_0xae6262[_0xedcf('0x47')];channels[_0xae6262['uniqueid']][_0xedcf('0x40')]=_0xae6262[_0xedcf('0x4a')];}}}catch(_0x5d872a){utils[_0xedcf('0x22')](_0x5d872a[_0xedcf('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 08ad168..68d07b7 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 _0x0e85=['info','CONNECTED','fullybooted','FULLYBOOTED','error','CLOSE','managerevent','./utils','lodash'];(function(_0x31f102,_0x20fd7e){var _0x111b20=function(_0xf95504){while(--_0xf95504){_0x31f102['push'](_0x31f102['shift']());}};_0x111b20(++_0x20fd7e);}(_0x0e85,0x7c));var _0x50e8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0e85[_0x138adb];return _0x1b27f2;};'use strict';var utils=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));exports['connect']=function(){utils[_0x50e8('0x2')](_0x50e8('0x3'));};exports['shutdown']=function(){utils['info']('SHUTDOWN');};exports[_0x50e8('0x4')]=function(){utils['info'](_0x50e8('0x5'));};exports[_0x50e8('0x6')]=function(_0xe3151e){utils[_0x50e8('0x6')](_0xe3151e);};exports['close']=function(){utils[_0x50e8('0x2')](_0x50e8('0x7'));};exports[_0x50e8('0x8')]=function(_0x988da0){}; \ No newline at end of file +var _0x2123=['FULLYBOOTED','error','close','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted'];(function(_0x1c6327,_0x219d50){var _0x4993bc=function(_0x515a0c){while(--_0x515a0c){_0x1c6327['push'](_0x1c6327['shift']());}};_0x4993bc(++_0x219d50);}(_0x2123,0x190));var _0x3212=function(_0x4694c3,_0x4dfc2c){_0x4694c3=_0x4694c3-0x0;var _0x2b90e2=_0x2123[_0x4694c3];return _0x2b90e2;};'use strict';var utils=require(_0x3212('0x0'));var _=require(_0x3212('0x1'));exports[_0x3212('0x2')]=function(){utils[_0x3212('0x3')](_0x3212('0x4'));};exports[_0x3212('0x5')]=function(){utils[_0x3212('0x3')](_0x3212('0x6'));};exports[_0x3212('0x7')]=function(){utils[_0x3212('0x3')](_0x3212('0x8'));};exports[_0x3212('0x9')]=function(_0x5d9d36){utils[_0x3212('0x9')](_0x5d9d36);};exports[_0x3212('0xa')]=function(){utils[_0x3212('0x3')]('CLOSE');};exports[_0x3212('0xb')]=function(_0x56c38f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 9f43e62..9dd1f45 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 _0x3295=['connect','hangup','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','toLowerCase','set','startsWith','appdata','split','error','stack','varset','variable','outboundrouteid','value','dialbegin','isNil','assign','starttime','lastevent','dialend','dialstatus','ANSWER','answertime','now'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3295,0x167));var _0x5329=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x3295[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x5329('0x0'));var util=require(_0x5329('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x1dc502){utils[_0x5329('0x2')](util['format'](_0x5329('0x3'),_0x1dc502[_0x5329('0x4')],_0x1dc502['channel'],_0x1dc502[_0x5329('0x5')],_0x1dc502[_0x5329('0x6')],_0x1dc502[_0x5329('0x7')],_0x1dc502['dialstatus']));utils[_0x5329('0x8')](_0x5329('0x9'),_0x1dc502);delete dials[_0x1dc502[_0x5329('0x4')]];}exports['newexten']=function(_0x40800a){try{if(_0x40800a['application'][_0x5329('0xa')]()==_0x5329('0xb')&&_[_0x5329('0xc')](_0x40800a[_0x5329('0xd')][_0x5329('0xa')](),'cdr(routeid)')){var _0x517152=_0x40800a[_0x5329('0xd')][_0x5329('0xe')]('=');dials[_0x40800a[_0x5329('0x4')]]={'routeId':_0x517152[0x1]};}}catch(_0x4e8b27){utils[_0x5329('0xf')](_0x4e8b27[_0x5329('0x10')]);}};exports[_0x5329('0x11')]=function(_0x21a418){try{if(!_['isNil'](_0x21a418[_0x5329('0x12')][_0x5329('0x13')])){dials[_0x21a418[_0x5329('0x4')]]={'routeId':_0x21a418[_0x5329('0x14')]};}}catch(_0x30f8ed){utils['error'](_0x30f8ed[_0x5329('0x10')]);}};exports[_0x5329('0x15')]=function(_0x384d15){try{if(!_[_0x5329('0x16')](dials[_0x384d15[_0x5329('0x4')]])){dials[_0x384d15['uniqueid']]=_[_0x5329('0x17')](dials[_0x384d15[_0x5329('0x4')]],_0x384d15);dials[_0x384d15['uniqueid']][_0x5329('0x18')]=utils['now']();dials[_0x384d15['uniqueid']][_0x5329('0x19')]='called';}}catch(_0x4c2bd3){utils['error'](_0x4c2bd3['stack']);}};exports[_0x5329('0x1a')]=function(_0x1c5cf){try{if(!_[_0x5329('0x16')](dials[_0x1c5cf['uniqueid']])){dials[_0x1c5cf[_0x5329('0x4')]]['dialstatus']=_0x1c5cf[_0x5329('0x1b')];if(_0x1c5cf[_0x5329('0x1b')]==_0x5329('0x1c')){dials[_0x1c5cf['uniqueid']]=_[_0x5329('0x17')](dials[_0x1c5cf[_0x5329('0x4')]],_0x1c5cf);dials[_0x1c5cf[_0x5329('0x4')]][_0x5329('0x1d')]=utils[_0x5329('0x1e')]();dials[_0x1c5cf[_0x5329('0x4')]]['lastevent']=_0x5329('0x1f');}}}catch(_0xcb972d){utils[_0x5329('0xf')](_0xcb972d[_0x5329('0x10')]);}};exports[_0x5329('0x20')]=function(_0x127698){try{if(!_[_0x5329('0x16')](dials[_0x127698[_0x5329('0x4')]])){dials[_0x127698[_0x5329('0x4')]]=_[_0x5329('0x17')](dials[_0x127698[_0x5329('0x4')]],{'endtime':utils['now'](),'lastevent':_0x5329('0x21')});dials[_0x127698[_0x5329('0x4')]][_0x5329('0x22')]=utils[_0x5329('0x23')](dials[_0x127698[_0x5329('0x4')]][_0x5329('0x24')],dials[_0x127698[_0x5329('0x4')]]['starttime']);dials[_0x127698[_0x5329('0x4')]][_0x5329('0x25')]=utils[_0x5329('0x23')](dials[_0x127698[_0x5329('0x4')]][_0x5329('0x1d')]||dials[_0x127698[_0x5329('0x4')]]['endtime'],dials[_0x127698[_0x5329('0x4')]][_0x5329('0x18')]);dials[_0x127698[_0x5329('0x4')]][_0x5329('0x26')]=dials[_0x127698[_0x5329('0x4')]]['answertime']?utils['diffTime'](dials[_0x127698[_0x5329('0x4')]][_0x5329('0x24')],dials[_0x127698[_0x5329('0x4')]][_0x5329('0x1d')]):0x0;writeDB(dials[_0x127698['uniqueid']]);}}catch(_0x617820){utils[_0x5329('0xf')](_0x617820[_0x5329('0x10')]);}}; \ No newline at end of file +var _0x3277=['error','varset','isNil','variable','outboundrouteid','dialbegin','assign','called','stack','ANSWER','answertime','now','connect','hangup','complete','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','toLowerCase','set','startsWith','appdata','cdr(routeid)'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x3277,0x65));var _0x7327=function(_0x5a5c49,_0x4c949a){_0x5a5c49=_0x5a5c49-0x0;var _0x38a39c=_0x3277[_0x5a5c49];return _0x38a39c;};'use strict';var _=require(_0x7327('0x0'));var util=require(_0x7327('0x1'));var utils=require(_0x7327('0x2'));var dials={};function writeDB(_0x2e3e2b){utils[_0x7327('0x3')](util[_0x7327('0x4')](_0x7327('0x5'),_0x2e3e2b[_0x7327('0x6')],_0x2e3e2b['channel'],_0x2e3e2b[_0x7327('0x7')],_0x2e3e2b[_0x7327('0x8')],_0x2e3e2b[_0x7327('0x9')],_0x2e3e2b[_0x7327('0xa')]));utils[_0x7327('0xb')](_0x7327('0xc'),_0x2e3e2b);delete dials[_0x2e3e2b[_0x7327('0x6')]];}exports[_0x7327('0xd')]=function(_0x3fa9b2){try{if(_0x3fa9b2['application'][_0x7327('0xe')]()==_0x7327('0xf')&&_[_0x7327('0x10')](_0x3fa9b2[_0x7327('0x11')][_0x7327('0xe')](),_0x7327('0x12'))){var _0x3d9478=_0x3fa9b2['appdata']['split']('=');dials[_0x3fa9b2[_0x7327('0x6')]]={'routeId':_0x3d9478[0x1]};}}catch(_0x404622){utils[_0x7327('0x13')](_0x404622['stack']);}};exports[_0x7327('0x14')]=function(_0x1e55ab){try{if(!_[_0x7327('0x15')](_0x1e55ab[_0x7327('0x16')][_0x7327('0x17')])){dials[_0x1e55ab['uniqueid']]={'routeId':_0x1e55ab['value']};}}catch(_0x2ea927){utils[_0x7327('0x13')](_0x2ea927['stack']);}};exports[_0x7327('0x18')]=function(_0x5d6ec8){try{if(!_['isNil'](dials[_0x5d6ec8[_0x7327('0x6')]])){dials[_0x5d6ec8[_0x7327('0x6')]]=_[_0x7327('0x19')](dials[_0x5d6ec8[_0x7327('0x6')]],_0x5d6ec8);dials[_0x5d6ec8[_0x7327('0x6')]]['starttime']=utils['now']();dials[_0x5d6ec8[_0x7327('0x6')]]['lastevent']=_0x7327('0x1a');}}catch(_0x2db7fa){utils[_0x7327('0x13')](_0x2db7fa[_0x7327('0x1b')]);}};exports['dialend']=function(_0x5b221d){try{if(!_['isNil'](dials[_0x5b221d['uniqueid']])){dials[_0x5b221d[_0x7327('0x6')]][_0x7327('0xa')]=_0x5b221d['dialstatus'];if(_0x5b221d[_0x7327('0xa')]==_0x7327('0x1c')){dials[_0x5b221d[_0x7327('0x6')]]=_[_0x7327('0x19')](dials[_0x5b221d[_0x7327('0x6')]],_0x5b221d);dials[_0x5b221d['uniqueid']][_0x7327('0x1d')]=utils[_0x7327('0x1e')]();dials[_0x5b221d[_0x7327('0x6')]]['lastevent']=_0x7327('0x1f');}}}catch(_0x19e8c5){utils[_0x7327('0x13')](_0x19e8c5[_0x7327('0x1b')]);}};exports[_0x7327('0x20')]=function(_0x58b929){try{if(!_[_0x7327('0x15')](dials[_0x58b929['uniqueid']])){dials[_0x58b929['uniqueid']]=_[_0x7327('0x19')](dials[_0x58b929['uniqueid']],{'endtime':utils[_0x7327('0x1e')](),'lastevent':_0x7327('0x21')});dials[_0x58b929['uniqueid']][_0x7327('0x22')]=utils[_0x7327('0x23')](dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x24')],dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x25')]);dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x26')]=utils[_0x7327('0x23')](dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x1d')]||dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x24')],dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x25')]);dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x27')]=dials[_0x58b929[_0x7327('0x6')]]['answertime']?utils[_0x7327('0x23')](dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x24')],dials[_0x58b929[_0x7327('0x6')]][_0x7327('0x1d')]):0x0;writeDB(dials[_0x58b929[_0x7327('0x6')]]);}}catch(_0x2c2b07){utils[_0x7327('0x13')](_0x2c2b07[_0x7327('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c7b4293..57b932c 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 _0x08f5=['managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x08f5,0x10b));var _0x508f=function(_0x494a42,_0x1f2103){_0x494a42=_0x494a42-0x0;var _0x254792=_0x08f5[_0x494a42];return _0x254792;};var AsteriskManager=require(_0x508f('0x0'));var config=require(_0x508f('0x1'));var utils=require(_0x508f('0x2'));var ami=new AsteriskManager(config[_0x508f('0x3')][_0x508f('0x4')],config[_0x508f('0x3')]['ip'],config['asterisk']['username'],config['asterisk'][_0x508f('0x5')],!![]);ami[_0x508f('0x6')]();if(config[_0x508f('0x7')]&&config[_0x508f('0x7')][_0x508f('0x8')]){utils['info'](_0x508f('0x9'));}else{var agents=require(_0x508f('0xa'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x508f('0xb'));var members=require(_0x508f('0xc'));var dials=require('./dials.controller');var transfers=require(_0x508f('0xd'));var core=require(_0x508f('0xe'));ami['on'](_0x508f('0xf'),core['connect']);ami['on'](_0x508f('0x10'),core[_0x508f('0x10')]);ami['on'](_0x508f('0x11'),core[_0x508f('0x11')]);ami['on']('error',core[_0x508f('0x12')]);ami['on'](_0x508f('0x13'),core['close']);ami['on']('managerevent',core[_0x508f('0x14')]);ami['on'](_0x508f('0x15'),function(_0x4bf598){try{members[_0x508f('0x15')](_0x4bf598);}catch(_0x4604ee){utils[_0x508f('0x12')](_0x4604ee);}});ami['on'](_0x508f('0x16'),function(_0x480d25){try{agents['agentcalled'](_0x480d25);}catch(_0x109f7e){utils[_0x508f('0x12')](_0x109f7e);}});ami['on'](_0x508f('0x17'),function(_0x2c9117){try{agents[_0x508f('0x17')](_0x2c9117);}catch(_0x429b8e){utils['error'](_0x429b8e);}});ami['on'](_0x508f('0x18'),function(_0x241037){try{agents[_0x508f('0x18')](_0x241037);queues[_0x508f('0x18')](_0x241037);}catch(_0x540efe){utils[_0x508f('0x12')](_0x540efe);}});ami['on'](_0x508f('0x19'),function(_0x4e5458){try{agents[_0x508f('0x19')](_0x4e5458);queues[_0x508f('0x19')](_0x4e5458);members['agentcomplete'](_0x4e5458);}catch(_0x56cdd4){utils[_0x508f('0x12')](_0x56cdd4);}});ami['on'](_0x508f('0x1a'),function(_0x5cc521){try{agents[_0x508f('0x1a')](_0x5cc521);queues[_0x508f('0x1a')](_0x5cc521);}catch(_0x5b261f){utils[_0x508f('0x12')](_0x5b261f);}});ami['on']('queuecallerjoin',function(_0x23a81c){try{queues[_0x508f('0x1b')](_0x23a81c);recordings[_0x508f('0x1b')](_0x23a81c);}catch(_0xee55a4){utils[_0x508f('0x12')](_0xee55a4);}});ami['on']('queuecallerleave',function(_0x36b124){try{queues[_0x508f('0x1c')](_0x36b124);}catch(_0x456ad2){utils[_0x508f('0x12')](_0x456ad2);}});ami['on']('musiconholdstart',function(_0x3eccb4){try{queues[_0x508f('0x1d')](_0x3eccb4);calls[_0x508f('0x1d')](_0x3eccb4);}catch(_0x1aecc1){utils[_0x508f('0x12')](_0x1aecc1);}});ami['on'](_0x508f('0x1e'),function(_0x5bd698){try{queues[_0x508f('0x1e')](_0x5bd698);calls[_0x508f('0x1e')](_0x5bd698);}catch(_0x265aa9){utils[_0x508f('0x12')](_0x265aa9);}});ami['on'](_0x508f('0x1f'),function(_0x95fde8){try{calls[_0x508f('0x1f')](_0x95fde8);recordings[_0x508f('0x1f')](_0x95fde8);}catch(_0x570ff1){utils[_0x508f('0x12')](_0x570ff1);}});ami['on'](_0x508f('0x20'),function(_0x28298f){try{calls['hangup'](_0x28298f);recordings[_0x508f('0x20')](_0x28298f);dials['hangup'](_0x28298f);agents['hangup'](_0x28298f);queues[_0x508f('0x20')](_0x28298f);}catch(_0x5c6bdb){utils[_0x508f('0x12')](_0x5c6bdb);}});ami['on'](_0x508f('0x21'),function(_0x5136ba){try{members[_0x508f('0x21')](_0x5136ba);}catch(_0x1e14f4){utils[_0x508f('0x12')](_0x1e14f4);}});ami['on'](_0x508f('0x22'),function(_0x318d55){try{queues[_0x508f('0x22')](_0x318d55);agents[_0x508f('0x22')](_0x318d55);transfers[_0x508f('0x22')](_0x318d55);}catch(_0x3e59bd){utils[_0x508f('0x12')](_0x3e59bd);}});ami['on'](_0x508f('0x23'),function(_0x1934ce){try{queues['attendedtransfer'](_0x1934ce);transfers[_0x508f('0x23')](_0x1934ce);agents[_0x508f('0x23')](_0x1934ce);calls[_0x508f('0x23')](_0x1934ce);}catch(_0x2c9bf8){utils[_0x508f('0x12')](_0x2c9bf8);}});ami['on'](_0x508f('0x24'),function(_0x1b54e2){try{queues[_0x508f('0x24')](_0x1b54e2);recordings['varset'](_0x1b54e2);calls['varset'](_0x1b54e2);dials[_0x508f('0x24')](_0x1b54e2);}catch(_0x6da5dd){utils['error'](_0x6da5dd);}});ami['on'](_0x508f('0x25'),function(_0x51b889){try{calls[_0x508f('0x25')](_0x51b889);recordings[_0x508f('0x25')](_0x51b889);dials[_0x508f('0x25')](_0x51b889);}catch(_0x53c0f3){utils[_0x508f('0x12')](_0x53c0f3);}});ami['on'](_0x508f('0x26'),function(_0x48e034){try{calls[_0x508f('0x26')](_0x48e034);recordings[_0x508f('0x26')](_0x48e034);}catch(_0x40244d){utils[_0x508f('0x12')](_0x40244d);}});ami['on'](_0x508f('0x27'),function(_0x2e5045){try{dials[_0x508f('0x27')](_0x2e5045);}catch(_0x26ba31){utils[_0x508f('0x12')](_0x26ba31);}});ami['on']('dialend',function(_0x3fc63d){try{dials[_0x508f('0x28')](_0x3fc63d);}catch(_0x462ee9){utils['error'](_0x462ee9);}});} \ No newline at end of file +var _0x59a2=['./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','./utils','asterisk','port','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller'];(function(_0x45a63a,_0x1c8553){var _0x34cd2b=function(_0x482d51){while(--_0x482d51){_0x45a63a['push'](_0x45a63a['shift']());}};_0x34cd2b(++_0x1c8553);}(_0x59a2,0x139));var _0x259a=function(_0x2a4ab4,_0x3c4bab){_0x2a4ab4=_0x2a4ab4-0x0;var _0x385492=_0x59a2[_0x2a4ab4];return _0x385492;};var AsteriskManager=require(_0x259a('0x0'));var config=require(_0x259a('0x1'));var utils=require(_0x259a('0x2'));var ami=new AsteriskManager(config[_0x259a('0x3')][_0x259a('0x4')],config[_0x259a('0x3')]['ip'],config['asterisk']['username'],config['asterisk'][_0x259a('0x5')],!![]);ami[_0x259a('0x6')]();if(config[_0x259a('0x7')]&&config[_0x259a('0x7')][_0x259a('0x8')]){utils['info'](_0x259a('0x9'));}else{var agents=require(_0x259a('0xa'));var calls=require(_0x259a('0xb'));var queues=require('./queues.controller');var recordings=require(_0x259a('0xc'));var members=require(_0x259a('0xd'));var dials=require(_0x259a('0xe'));var transfers=require(_0x259a('0xf'));var core=require('./core.controller');ami['on'](_0x259a('0x10'),core[_0x259a('0x10')]);ami['on'](_0x259a('0x11'),core[_0x259a('0x11')]);ami['on'](_0x259a('0x12'),core['fullybooted']);ami['on'](_0x259a('0x13'),core[_0x259a('0x13')]);ami['on']('close',core[_0x259a('0x14')]);ami['on'](_0x259a('0x15'),core['managerevent']);ami['on'](_0x259a('0x16'),function(_0x36b381){try{members[_0x259a('0x16')](_0x36b381);}catch(_0x3d30eb){utils[_0x259a('0x13')](_0x3d30eb);}});ami['on'](_0x259a('0x17'),function(_0x33e7d7){try{agents[_0x259a('0x17')](_0x33e7d7);}catch(_0x20a050){utils['error'](_0x20a050);}});ami['on'](_0x259a('0x18'),function(_0x126905){try{agents['agentringnoanswer'](_0x126905);}catch(_0x5a9740){utils['error'](_0x5a9740);}});ami['on'](_0x259a('0x19'),function(_0x2c10a4){try{agents[_0x259a('0x19')](_0x2c10a4);queues['agentconnect'](_0x2c10a4);}catch(_0x338c21){utils[_0x259a('0x13')](_0x338c21);}});ami['on'](_0x259a('0x1a'),function(_0x3b8f7b){try{agents[_0x259a('0x1a')](_0x3b8f7b);queues['agentcomplete'](_0x3b8f7b);members[_0x259a('0x1a')](_0x3b8f7b);}catch(_0x1c0d95){utils[_0x259a('0x13')](_0x1c0d95);}});ami['on'](_0x259a('0x1b'),function(_0x5b7aa5){try{agents['queuecallerabandon'](_0x5b7aa5);queues[_0x259a('0x1b')](_0x5b7aa5);}catch(_0x1e83a0){utils[_0x259a('0x13')](_0x1e83a0);}});ami['on'](_0x259a('0x1c'),function(_0x4754ec){try{queues[_0x259a('0x1c')](_0x4754ec);recordings['queuecallerjoin'](_0x4754ec);}catch(_0x2b9bba){utils['error'](_0x2b9bba);}});ami['on'](_0x259a('0x1d'),function(_0x5148a0){try{queues[_0x259a('0x1d')](_0x5148a0);}catch(_0x432d33){utils[_0x259a('0x13')](_0x432d33);}});ami['on']('musiconholdstart',function(_0xd6c552){try{queues[_0x259a('0x1e')](_0xd6c552);calls[_0x259a('0x1e')](_0xd6c552);}catch(_0x59e70c){utils['error'](_0x59e70c);}});ami['on'](_0x259a('0x1f'),function(_0x36069c){try{queues[_0x259a('0x1f')](_0x36069c);calls[_0x259a('0x1f')](_0x36069c);}catch(_0x5da282){utils[_0x259a('0x13')](_0x5da282);}});ami['on'](_0x259a('0x20'),function(_0x5a719a){try{calls[_0x259a('0x20')](_0x5a719a);recordings['newstate'](_0x5a719a);}catch(_0x417653){utils[_0x259a('0x13')](_0x417653);}});ami['on'](_0x259a('0x21'),function(_0x596ea9){try{calls['hangup'](_0x596ea9);recordings[_0x259a('0x21')](_0x596ea9);dials[_0x259a('0x21')](_0x596ea9);agents[_0x259a('0x21')](_0x596ea9);queues['hangup'](_0x596ea9);}catch(_0x22eaac){utils[_0x259a('0x13')](_0x22eaac);}});ami['on'](_0x259a('0x22'),function(_0x3405e6){try{members[_0x259a('0x22')](_0x3405e6);}catch(_0x25e8fb){utils['error'](_0x25e8fb);}});ami['on'](_0x259a('0x23'),function(_0x44da35){try{queues[_0x259a('0x23')](_0x44da35);agents[_0x259a('0x23')](_0x44da35);transfers['blindtransfer'](_0x44da35);}catch(_0xa3abff){utils['error'](_0xa3abff);}});ami['on'](_0x259a('0x24'),function(_0x3b6043){try{queues[_0x259a('0x24')](_0x3b6043);transfers['attendedtransfer'](_0x3b6043);agents[_0x259a('0x24')](_0x3b6043);calls[_0x259a('0x24')](_0x3b6043);}catch(_0x57032f){utils[_0x259a('0x13')](_0x57032f);}});ami['on'](_0x259a('0x25'),function(_0x4a9893){try{queues[_0x259a('0x25')](_0x4a9893);recordings[_0x259a('0x25')](_0x4a9893);calls[_0x259a('0x25')](_0x4a9893);dials[_0x259a('0x25')](_0x4a9893);}catch(_0x4ea772){utils[_0x259a('0x13')](_0x4ea772);}});ami['on']('newexten',function(_0x5a6554){try{calls[_0x259a('0x26')](_0x5a6554);recordings[_0x259a('0x26')](_0x5a6554);dials['newexten'](_0x5a6554);}catch(_0x4fde87){utils[_0x259a('0x13')](_0x4fde87);}});ami['on'](_0x259a('0x27'),function(_0x2f7d9a){try{calls['newchannel'](_0x2f7d9a);recordings['newchannel'](_0x2f7d9a);}catch(_0x45c706){utils[_0x259a('0x13')](_0x45c706);}});ami['on'](_0x259a('0x28'),function(_0x29e17c){try{dials[_0x259a('0x28')](_0x29e17c);}catch(_0x19ece7){utils[_0x259a('0x13')](_0x19ece7);}});ami['on']('dialend',function(_0x55e525){try{dials['dialend'](_0x55e525);}catch(_0x1b7a27){utils[_0x259a('0x13')](_0x1b7a27);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6b8c298..c9f265f 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 _0x2fd7=['queue','cdr','data1','data3','destination','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','getUserByName','split','then','CreateMemberReport','catch','some','startsWith','devicestatechange','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','device','duration','diffTime','exitAt','enterAt','assign'];(function(_0x5c7ce5,_0x4ebac5){var _0xc2b53e=function(_0x393978){while(--_0x393978){_0x5c7ce5['push'](_0x5c7ce5['shift']());}};_0xc2b53e(++_0x4ebac5);}(_0x2fd7,0xe2));var _0x72fd=function(_0xd8490a,_0x4e0b15){_0xd8490a=_0xd8490a-0x0;var _0x3b61f5=_0x2fd7[_0xd8490a];return _0x3b61f5;};'use strict';var _=require('lodash');var util=require(_0x72fd('0x0'));var utils=require(_0x72fd('0x1'));var members={};var exclude=[_0x72fd('0x2'),_0x72fd('0x3')];function writeDB(_0x11f22c){utils[_0x72fd('0x4')](util['format'](_0x72fd('0x5'),_0x11f22c[_0x72fd('0x6')],_0x11f22c[_0x72fd('0x7')],_0x11f22c[_0x72fd('0x8')],_0x11f22c[_0x72fd('0x9')],_0x11f22c[_0x72fd('0xa')],_0x11f22c[_0x72fd('0xb')]));if(_0x11f22c[_0x72fd('0x7')]){utils[_0x72fd('0xc')](_0x11f22c[_0x72fd('0x7')])['then'](function(_0x33f66f){if(_0x33f66f){_0x11f22c[_0x72fd('0xa')]=_0x33f66f[_0x72fd('0xd')];_0x11f22c[_0x72fd('0xe')]=_0x33f66f[_0x72fd('0xe')];utils[_0x72fd('0xf')]('CreateMemberReport',_0x11f22c);}else{utils[_0x72fd('0x10')](_0x11f22c[_0x72fd('0x7')][_0x72fd('0x11')]('/')[0x1])[_0x72fd('0x12')](function(_0x1c1f7c){if(_0x1c1f7c){_0x11f22c[_0x72fd('0xa')]=_0x1c1f7c[_0x72fd('0xd')];_0x11f22c[_0x72fd('0xe')]=_0x1c1f7c[_0x72fd('0xe')];utils[_0x72fd('0xf')](_0x72fd('0x13'),_0x11f22c);}});}})[_0x72fd('0x14')](function(_0x3f74fc){utils['error'](_0x3f74fc);});}delete members[_0x11f22c[_0x72fd('0x7')]];}function startsWith(_0x2ec0e6,_0x31cfe8){return _[_0x72fd('0x15')](_0x2ec0e6,function(_0x2cf22d){return _[_0x72fd('0x16')](_0x31cfe8,_0x2cf22d);});}exports[_0x72fd('0x17')]=function(_0xa62f6b){switch(_0xa62f6b['state']){case _0x72fd('0x18'):case _0x72fd('0x19'):if(!startsWith(exclude,_0xa62f6b['device'])){members[_0xa62f6b['device']]={'channel':_0x72fd('0x1a'),'interface':_0xa62f6b['device'],'type':_0x72fd('0x1b'),'enterAt':utils[_0x72fd('0x1c')](),'role':_0x72fd('0x1d')};}break;case _0x72fd('0x1e'):if(!_[_0x72fd('0x1f')](members[_0xa62f6b['device']])){members[_0xa62f6b[_0x72fd('0x20')]]['exitAt']=utils[_0x72fd('0x1c')]();members[_0xa62f6b['device']][_0x72fd('0x21')]=utils[_0x72fd('0x22')](members[_0xa62f6b[_0x72fd('0x20')]][_0x72fd('0x23')],members[_0xa62f6b[_0x72fd('0x20')]][_0x72fd('0x24')]);if(members[_0xa62f6b[_0x72fd('0x20')]]['uniqueid']){writeDB(members[_0xa62f6b[_0x72fd('0x20')]]);}}default:break;}};exports['agentcomplete']=function(_0x14bf11){if(!_[_0x72fd('0x1f')](members[_0x14bf11[_0x72fd('0x7')]])){members[_0x14bf11[_0x72fd('0x7')]]=_[_0x72fd('0x25')](members[_0x14bf11[_0x72fd('0x7')]],{'data4':_0x14bf11[_0x72fd('0x26')],'uniqueid':_0x14bf11[_0x72fd('0x6')]});}};exports[_0x72fd('0x27')]=function(_0x2efe8b){if(_0x2efe8b[_0x72fd('0x8')]){var _0x133269=_0x2efe8b[_0x72fd('0x8')][_0x72fd('0x11')]('-')[0x0];if(!_[_0x72fd('0x1f')](members[_0x133269])){members[_0x133269]=_[_0x72fd('0x25')](members[_0x133269],{'data1':members[_0x133269][_0x72fd('0x28')]||_0x2efe8b['type'],'data2':members[_0x133269][_0x72fd('0x9')]||_0x2efe8b['source'],'data3':members[_0x133269][_0x72fd('0x29')]||_0x2efe8b[_0x72fd('0x2a')],'uniqueid':members[_0x133269][_0x72fd('0x6')]||_0x2efe8b[_0x72fd('0x6')]});if(members[_0x133269][_0x72fd('0x23')]){writeDB(members[_0x133269]);}}}if(_0x2efe8b[_0x72fd('0x2b')]){var _0x203690=_0x2efe8b[_0x72fd('0x2b')][_0x72fd('0x11')]('-')[0x0];if(!_[_0x72fd('0x1f')](members[_0x203690])){members[_0x203690]=_[_0x72fd('0x25')](members[_0x203690],{'data1':members[_0x203690][_0x72fd('0x28')]||_0x2efe8b[_0x72fd('0xb')],'data2':members[_0x203690]['data2']||_0x2efe8b['source'],'data3':members[_0x203690]['data3']||_0x2efe8b['destination'],'uniqueid':members[_0x203690]['uniqueid']||_0x2efe8b[_0x72fd('0x6')]});if(members[_0x203690]['exitAt']){writeDB(members[_0x203690]);}}}}; \ No newline at end of file +var _0x33b1=['internal','request','getUserByName','split','CreateMemberReport','catch','some','startsWith','devicestatechange','state','INUSE','device','voice','TALKING','now','NOT_INUSE','isNil','exitAt','agentcomplete','assign','cdr','channel','source','data3','destination','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','name'];(function(_0x598f90,_0xde6604){var _0x58f3f4=function(_0x5d0b2a){while(--_0x5d0b2a){_0x598f90['push'](_0x598f90['shift']());}};_0x58f3f4(++_0xde6604);}(_0x33b1,0xf2));var _0x133b=function(_0x16ab32,_0x2f0cd4){_0x16ab32=_0x16ab32-0x0;var _0x214dd0=_0x33b1[_0x16ab32];return _0x214dd0;};'use strict';var _=require(_0x133b('0x0'));var util=require(_0x133b('0x1'));var utils=require(_0x133b('0x2'));var members={};var exclude=[_0x133b('0x3'),_0x133b('0x4')];function writeDB(_0x2adbe8){utils[_0x133b('0x5')](util[_0x133b('0x6')](_0x133b('0x7'),_0x2adbe8[_0x133b('0x8')],_0x2adbe8[_0x133b('0x9')],_0x2adbe8['channel'],_0x2adbe8[_0x133b('0xa')],_0x2adbe8[_0x133b('0xb')],_0x2adbe8[_0x133b('0xc')]));if(_0x2adbe8[_0x133b('0x9')]){utils[_0x133b('0xd')](_0x2adbe8[_0x133b('0x9')])[_0x133b('0xe')](function(_0x536191){if(_0x536191){_0x2adbe8[_0x133b('0xb')]=_0x536191[_0x133b('0xf')];_0x2adbe8[_0x133b('0x10')]=_0x536191['internal'];utils[_0x133b('0x11')]('CreateMemberReport',_0x2adbe8);}else{utils[_0x133b('0x12')](_0x2adbe8[_0x133b('0x9')][_0x133b('0x13')]('/')[0x1])[_0x133b('0xe')](function(_0x43baa9){if(_0x43baa9){_0x2adbe8[_0x133b('0xb')]=_0x43baa9[_0x133b('0xf')];_0x2adbe8[_0x133b('0x10')]=_0x43baa9[_0x133b('0x10')];utils[_0x133b('0x11')](_0x133b('0x14'),_0x2adbe8);}});}})[_0x133b('0x15')](function(_0x3766f0){utils['error'](_0x3766f0);});}delete members[_0x2adbe8[_0x133b('0x9')]];}function startsWith(_0x587140,_0x300fc3){return _[_0x133b('0x16')](_0x587140,function(_0x5854a8){return _[_0x133b('0x17')](_0x300fc3,_0x5854a8);});}exports[_0x133b('0x18')]=function(_0x4eaf6b){switch(_0x4eaf6b[_0x133b('0x19')]){case _0x133b('0x1a'):case'BUSY':if(!startsWith(exclude,_0x4eaf6b[_0x133b('0x1b')])){members[_0x4eaf6b[_0x133b('0x1b')]]={'channel':_0x133b('0x1c'),'interface':_0x4eaf6b[_0x133b('0x1b')],'type':_0x133b('0x1d'),'enterAt':utils[_0x133b('0x1e')](),'role':'agent'};}break;case _0x133b('0x1f'):if(!_[_0x133b('0x20')](members[_0x4eaf6b[_0x133b('0x1b')]])){members[_0x4eaf6b[_0x133b('0x1b')]][_0x133b('0x21')]=utils[_0x133b('0x1e')]();members[_0x4eaf6b[_0x133b('0x1b')]]['duration']=utils['diffTime'](members[_0x4eaf6b[_0x133b('0x1b')]][_0x133b('0x21')],members[_0x4eaf6b['device']]['enterAt']);if(members[_0x4eaf6b[_0x133b('0x1b')]][_0x133b('0x8')]){writeDB(members[_0x4eaf6b[_0x133b('0x1b')]]);}}default:break;}};exports[_0x133b('0x22')]=function(_0x1b171a){if(!_[_0x133b('0x20')](members[_0x1b171a[_0x133b('0x9')]])){members[_0x1b171a[_0x133b('0x9')]]=_[_0x133b('0x23')](members[_0x1b171a['interface']],{'data4':_0x1b171a['queue'],'uniqueid':_0x1b171a['uniqueid']});}};exports[_0x133b('0x24')]=function(_0x1a3395){if(_0x1a3395['channel']){var _0x375986=_0x1a3395[_0x133b('0x25')][_0x133b('0x13')]('-')[0x0];if(!_[_0x133b('0x20')](members[_0x375986])){members[_0x375986]=_['assign'](members[_0x375986],{'data1':members[_0x375986]['data1']||_0x1a3395[_0x133b('0xc')],'data2':members[_0x375986][_0x133b('0xa')]||_0x1a3395[_0x133b('0x26')],'data3':members[_0x375986][_0x133b('0x27')]||_0x1a3395[_0x133b('0x28')],'uniqueid':members[_0x375986]['uniqueid']||_0x1a3395['uniqueid']});if(members[_0x375986][_0x133b('0x21')]){writeDB(members[_0x375986]);}}}if(_0x1a3395['destinationchannel']){var _0xcd4f3e=_0x1a3395[_0x133b('0x29')][_0x133b('0x13')]('-')[0x0];if(!_[_0x133b('0x20')](members[_0xcd4f3e])){members[_0xcd4f3e]=_[_0x133b('0x23')](members[_0xcd4f3e],{'data1':members[_0xcd4f3e][_0x133b('0x2a')]||_0x1a3395['type'],'data2':members[_0xcd4f3e][_0x133b('0xa')]||_0x1a3395[_0x133b('0x26')],'data3':members[_0xcd4f3e][_0x133b('0x27')]||_0x1a3395['destination'],'uniqueid':members[_0xcd4f3e][_0x133b('0x8')]||_0x1a3395[_0x133b('0x8')]});if(members[_0xcd4f3e]['exitAt']){writeDB(members[_0xcd4f3e]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a711922..463759c 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 _0xe799=['transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','queuecallerabandon','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','reason'];(function(_0x38e3cc,_0x8d9fc6){var _0x19651f=function(_0x2c5e3a){while(--_0x2c5e3a){_0x38e3cc['push'](_0x38e3cc['shift']());}};_0x19651f(++_0x8d9fc6);}(_0xe799,0x19b));var _0x9e79=function(_0x56aff9,_0x23d245){_0x56aff9=_0x56aff9-0x0;var _0x328056=_0xe799[_0x56aff9];return _0x328056;};'use strict';var _=require(_0x9e79('0x0'));var util=require(_0x9e79('0x1'));var utils=require('./utils');var queues={};function writeDB(_0xc9a90e){utils[_0x9e79('0x2')](util[_0x9e79('0x3')](_0x9e79('0x4'),_0xc9a90e[_0x9e79('0x5')],_0xc9a90e['channel'],_0xc9a90e['queue'],_0xc9a90e[_0x9e79('0x6')],_0xc9a90e[_0x9e79('0x7')],_0xc9a90e[_0x9e79('0x8')],_0xc9a90e['queuecallerexitreason']));if(_0xc9a90e['queue']){utils['getVoiceQueueByName'](_0xc9a90e[_0x9e79('0x9')])[_0x9e79('0xa')](function(_0x23c7bb){if(_0x23c7bb){_0xc9a90e[_0x9e79('0xb')]=_0x23c7bb[_0x9e79('0xb')];}utils[_0x9e79('0xc')](_0x9e79('0xd'),_0xc9a90e);});}else{utils[_0x9e79('0xc')]('CreateVoiceQueueReport',_0xc9a90e);}if(_0xc9a90e['transfereduniqueid']){delete queues[_0xc9a90e[_0x9e79('0xe')]];}else{delete queues[_0xc9a90e['uniqueid']];}}exports['queuecallerjoin']=function(_0xd561a6){queues[_0xd561a6['uniqueid']]=_[_0x9e79('0xf')](_0xd561a6,{'originalposition':_0xd561a6[_0x9e79('0x10')],'queuecallerjoinAt':utils[_0x9e79('0x11')](),'mohtime':0x0});};exports['hangup']=function(_0x2801d4){if(!_[_0x9e79('0x12')](queues[_0x2801d4[_0x9e79('0x5')]])){if(queues[_0x2801d4[_0x9e79('0x5')]][_0x9e79('0x13')]){if(!queues[_0x2801d4['uniqueid']]['queuecallerabandon']&&!queues[_0x2801d4[_0x9e79('0x5')]][_0x9e79('0x14')]){queues[_0x2801d4['uniqueid']][_0x9e79('0x15')]=!![];queues[_0x2801d4['uniqueid']][_0x9e79('0x16')]=utils[_0x9e79('0x11')]();queues[_0x2801d4['uniqueid']][_0x9e79('0x17')]=_0x9e79('0x18');}writeDB(queues[_0x2801d4[_0x9e79('0x5')]]);}else{if(queues[_0x2801d4[_0x9e79('0x5')]][_0x9e79('0xe')]){queues[queues[_0x2801d4[_0x9e79('0x5')]][_0x9e79('0xe')]]=queues[_0x2801d4[_0x9e79('0x5')]];queues[queues[_0x2801d4['uniqueid']]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x2801d4['uniqueid']];}}}};exports['varset']=function(_0x45153f){if(!_[_0x9e79('0x12')](_0x45153f[_0x9e79('0x19')][_0x9e79('0x1a')])){if(!_[_0x9e79('0x12')](queues[_0x45153f[_0x9e79('0x5')]])){queues[_0x45153f['uniqueid']]['queuecallerabandon']=![];queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x1b')]=null;queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x14')]=!![];queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x1c')]=utils[_0x9e79('0x11')]();queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x17')]=_0x45153f[_0x9e79('0x1d')]['toUpperCase']();writeDB(queues[_0x45153f[_0x9e79('0x5')]]);}}else if(!_[_0x9e79('0x12')](_0x45153f[_0x9e79('0x19')]['queueposition'])){if(!_[_0x9e79('0x12')](queues[_0x45153f[_0x9e79('0x5')]])&&!queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x1e')]){queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x1e')]=![];queues[_0x45153f['uniqueid']][_0x9e79('0x1b')]=null;queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x14')]=!![];queues[_0x45153f['uniqueid']][_0x9e79('0x1c')]=utils[_0x9e79('0x11')]();queues[_0x45153f[_0x9e79('0x5')]][_0x9e79('0x17')]=_0x9e79('0x1f');}}};exports['queuecallerabandon']=function(_0x500bb7){if(!_[_0x9e79('0x12')](queues[_0x500bb7['uniqueid']])){queues[_0x500bb7[_0x9e79('0x5')]]['queuecallerexit']=![];queues[_0x500bb7[_0x9e79('0x5')]][_0x9e79('0x1c')]=null;queues[_0x500bb7[_0x9e79('0x5')]][_0x9e79('0x1e')]=!![];queues[_0x500bb7[_0x9e79('0x5')]][_0x9e79('0x1b')]=utils[_0x9e79('0x11')]();queues[_0x500bb7[_0x9e79('0x5')]]['queuecallerexitreason']=_0x9e79('0x20');}};exports[_0x9e79('0x21')]=function(_0x19730c){if(!_[_0x9e79('0x12')](queues[_0x19730c['uniqueid']])){queues[_0x19730c['uniqueid']]['queuecallerleave']=!![];queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x13')]=utils[_0x9e79('0x11')]();queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x22')]=utils[_0x9e79('0x23')](queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x13')],queues[_0x19730c['uniqueid']][_0x9e79('0x24')]);queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x10')]=_0x19730c['position'];queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x25')]=_0x19730c['count'];queues[_0x19730c[_0x9e79('0x5')]]['connectedlinenum']=_0x19730c['connectedlinenum'];queues[_0x19730c[_0x9e79('0x5')]][_0x9e79('0x26')]=_0x19730c[_0x9e79('0x26')];}};exports[_0x9e79('0x27')]=function(_0x3de19c){if(!_['isNil'](queues[_0x3de19c[_0x9e79('0x5')]])){queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x1e')]=![];queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x1e')]=![];queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x1b')]=null;queues[_0x3de19c[_0x9e79('0x5')]]['queuecallerexit']=![];queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x1c')]=null;queues[_0x3de19c['uniqueid']][_0x9e79('0x28')]=!![];queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x8')]=_0x3de19c[_0x9e79('0x29')];queues[_0x3de19c[_0x9e79('0x5')]][_0x9e79('0x6')]=_0x3de19c[_0x9e79('0x2a')];}};exports[_0x9e79('0x2b')]=function(_0x3fa52e){if(!_[_0x9e79('0x12')](queues[_0x3fa52e[_0x9e79('0x5')]])){if(queues[_0x3fa52e['uniqueid']][_0x9e79('0x13')]){queues[_0x3fa52e['uniqueid']]['queuecallerabandon']=![];queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x1e')]=![];queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x1b')]=null;queues[_0x3fa52e['uniqueid']][_0x9e79('0x14')]=![];queues[_0x3fa52e['uniqueid']]['queuecallerexitAt']=null;queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x28')]=!![];queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x6')]=_0x3fa52e[_0x9e79('0x2a')];queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x15')]=!![];queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x16')]=utils[_0x9e79('0x11')]();if(_0x3fa52e[_0x9e79('0x2c')]==_0x9e79('0x2d')){if(!queues[_0x3fa52e['uniqueid']][_0x9e79('0x2d')]){queues[_0x3fa52e[_0x9e79('0x5')]][_0x9e79('0x17')]=_0x9e79('0x2e');}}else{queues[_0x3fa52e['uniqueid']]['queuecallerexitreason']=_0x9e79('0x2f')+_0x3fa52e[_0x9e79('0x2c')]['toUpperCase']();}writeDB(queues[_0x3fa52e[_0x9e79('0x5')]]);}}};exports[_0x9e79('0x30')]=function(_0x57fd3e){if(!_[_0x9e79('0x12')](queues[_0x57fd3e['transfereeuniqueid']])){queues[_0x57fd3e[_0x9e79('0x31')]]['transfer']=!![];queues[_0x57fd3e[_0x9e79('0x31')]][_0x9e79('0x32')]='BLIND';queues[_0x57fd3e[_0x9e79('0x31')]][_0x9e79('0x33')]=_0x57fd3e[_0x9e79('0x34')];queues[_0x57fd3e[_0x9e79('0x31')]][_0x9e79('0x35')]=_0x57fd3e['transfereeuniqueid'];queues[_0x57fd3e['transfereeuniqueid']][_0x9e79('0x17')]=_0x9e79('0x36');}};exports[_0x9e79('0x37')]=function(_0x38549b){try{if(_0x38549b[_0x9e79('0x38')]==_0x38549b[_0x9e79('0x39')]){if(!_['isNil'](queues[_0x38549b[_0x9e79('0x3a')]])){queues[_0x38549b[_0x9e79('0x3a')]][_0x9e79('0x2d')]=!![];queues[_0x38549b['secondtransfererlinkedid']][_0x9e79('0x32')]=_0x9e79('0x3b');queues[_0x38549b['secondtransfererlinkedid']]['transferexten']=_0x38549b[_0x9e79('0x3c')];queues[_0x38549b[_0x9e79('0x3a')]]['transferuniqueid']=_0x38549b[_0x9e79('0x38')];queues[_0x38549b[_0x9e79('0x3a')]][_0x9e79('0x17')]=_0x9e79('0x3d');}if(!_['isNil'](queues[_0x38549b[_0x9e79('0x39')]])){if(_0x38549b['transfereelinkedid']&&queues[_0x38549b[_0x9e79('0x3e')]]){queues[_0x38549b[_0x9e79('0x3e')]][_0x9e79('0x3f')]=0x1;queues[_0x38549b[_0x9e79('0x31')]]=_[_0x9e79('0x40')](queues[_0x38549b[_0x9e79('0x3e')]]);queues[_0x38549b[_0x9e79('0x31')]]['transfereduniqueid']=_0x38549b['transfertargetuniqueid'];queues[_0x38549b[_0x9e79('0x31')]][_0x9e79('0x3f')]=0x2;queues[_0x38549b[_0x9e79('0x31')]]['calleridnum']=queues[_0x38549b[_0x9e79('0x3a')]][_0x9e79('0x7')];queues[_0x38549b['transfereeuniqueid']][_0x9e79('0x41')]=queues[_0x38549b['secondtransfererlinkedid']][_0x9e79('0x41')];queues[_0x38549b[_0x9e79('0x31')]][_0x9e79('0x24')]=utils[_0x9e79('0x11')]();queues[_0x38549b[_0x9e79('0x31')]][_0x9e79('0x13')]=utils[_0x9e79('0x11')]();queues[_0x38549b[_0x9e79('0x31')]][_0x9e79('0x22')]=0x0;queues[_0x38549b['transfereeuniqueid']][_0x9e79('0x42')]=0x0;}else{queues[_0x38549b[_0x9e79('0x39')]][_0x9e79('0xe')]=_0x38549b[_0x9e79('0x3a')];}}}else if(_0x38549b[_0x9e79('0x43')]==_0x38549b[_0x9e79('0x3a')]){if(!_[_0x9e79('0x12')](queues[_0x38549b['origtransfererlinkedid']])){queues[_0x38549b[_0x9e79('0x39')]]['transfer']=!![];queues[_0x38549b[_0x9e79('0x39')]][_0x9e79('0x32')]=_0x9e79('0x3b');queues[_0x38549b['origtransfererlinkedid']][_0x9e79('0x33')]=_0x38549b[_0x9e79('0x44')];queues[_0x38549b['origtransfererlinkedid']][_0x9e79('0x35')]=_0x38549b['secondtransfereruniqueid'];queues[_0x38549b[_0x9e79('0x39')]][_0x9e79('0x17')]=_0x9e79('0x3d');}if(!_[_0x9e79('0x12')](queues[_0x38549b[_0x9e79('0x3a')]])){if(_0x38549b[_0x9e79('0x45')]&&queues[_0x38549b[_0x9e79('0x45')]]){queues[_0x38549b['transfertargetlinkedid']][_0x9e79('0x3f')]=0x1;queues[_0x38549b[_0x9e79('0x46')]]=_[_0x9e79('0x40')](queues[_0x38549b['transfertargetlinkedid']]);queues[_0x38549b[_0x9e79('0x46')]][_0x9e79('0xe')]=_0x38549b[_0x9e79('0x46')];queues[_0x38549b['transfertargetuniqueid']][_0x9e79('0x3f')]=0x2;queues[_0x38549b[_0x9e79('0x46')]][_0x9e79('0x7')]=queues[_0x38549b[_0x9e79('0x39')]][_0x9e79('0x7')];queues[_0x38549b[_0x9e79('0x46')]]['calleridname']=queues[_0x38549b[_0x9e79('0x39')]][_0x9e79('0x41')];queues[_0x38549b[_0x9e79('0x46')]][_0x9e79('0x24')]=utils[_0x9e79('0x11')]();queues[_0x38549b[_0x9e79('0x46')]][_0x9e79('0x13')]=utils[_0x9e79('0x11')]();queues[_0x38549b[_0x9e79('0x46')]][_0x9e79('0x22')]=0x0;queues[_0x38549b[_0x9e79('0x46')]]['mohtime']=0x0;}else{queues[_0x38549b['secondtransfererlinkedid']][_0x9e79('0xe')]=_0x38549b[_0x9e79('0x39')];}}}}catch(_0x4da692){utils[_0x9e79('0x47')](_0x4da692[_0x9e79('0x48')]);}};exports[_0x9e79('0x49')]=function(_0x27bc45){if(!_[_0x9e79('0x12')](queues[_0x27bc45[_0x9e79('0x5')]])){queues[_0x27bc45[_0x9e79('0x5')]][_0x9e79('0x4a')]=utils[_0x9e79('0x11')]();}};exports[_0x9e79('0x4b')]=function(_0x32a11e){if(!_['isNil'](queues[_0x32a11e[_0x9e79('0x5')]])){if(!_[_0x9e79('0x12')](queues[_0x32a11e[_0x9e79('0x5')]][_0x9e79('0x4a')])){queues[_0x32a11e[_0x9e79('0x5')]][_0x9e79('0x42')]+=utils[_0x9e79('0x23')](utils['now'](),queues[_0x32a11e[_0x9e79('0x5')]][_0x9e79('0x4a')]);delete queues[_0x32a11e[_0x9e79('0x5')]][_0x9e79('0x4a')];}}}; \ No newline at end of file +var _0xaec6=['transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuecallerexitAt','toUpperCase','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','destaccountcode','membername','agentcomplete','queuecallerabandonAt','assigned','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','diffTime','lodash','util','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xaec6,0x172));var _0x6aec=function(_0x74c65e,_0x13066d){_0x74c65e=_0x74c65e-0x0;var _0x2bf377=_0xaec6[_0x74c65e];return _0x2bf377;};'use strict';var _=require(_0x6aec('0x0'));var util=require(_0x6aec('0x1'));var utils=require(_0x6aec('0x2'));var queues={};function writeDB(_0x3faccb){utils['info'](util[_0x6aec('0x3')](_0x6aec('0x4'),_0x3faccb[_0x6aec('0x5')],_0x3faccb[_0x6aec('0x6')],_0x3faccb[_0x6aec('0x7')],_0x3faccb[_0x6aec('0x8')],_0x3faccb[_0x6aec('0x9')],_0x3faccb[_0x6aec('0xa')],_0x3faccb[_0x6aec('0xb')]));if(_0x3faccb[_0x6aec('0x7')]){utils['getVoiceQueueByName'](_0x3faccb[_0x6aec('0x7')])['then'](function(_0xcaef4e){if(_0xcaef4e){_0x3faccb['type']=_0xcaef4e[_0x6aec('0xc')];}utils['request']('CreateVoiceQueueReport',_0x3faccb);});}else{utils[_0x6aec('0xd')](_0x6aec('0xe'),_0x3faccb);}if(_0x3faccb[_0x6aec('0xf')]){delete queues[_0x3faccb[_0x6aec('0xf')]];}else{delete queues[_0x3faccb[_0x6aec('0x5')]];}}exports[_0x6aec('0x10')]=function(_0x4e8e24){queues[_0x4e8e24[_0x6aec('0x5')]]=_[_0x6aec('0x11')](_0x4e8e24,{'originalposition':_0x4e8e24['position'],'queuecallerjoinAt':utils[_0x6aec('0x12')](),'mohtime':0x0});};exports[_0x6aec('0x13')]=function(_0x1d86eb){if(!_[_0x6aec('0x14')](queues[_0x1d86eb['uniqueid']])){if(queues[_0x1d86eb[_0x6aec('0x5')]][_0x6aec('0x15')]){if(!queues[_0x1d86eb[_0x6aec('0x5')]][_0x6aec('0x16')]&&!queues[_0x1d86eb[_0x6aec('0x5')]][_0x6aec('0x17')]){queues[_0x1d86eb['uniqueid']][_0x6aec('0x18')]=!![];queues[_0x1d86eb['uniqueid']][_0x6aec('0x19')]=utils[_0x6aec('0x12')]();queues[_0x1d86eb['uniqueid']][_0x6aec('0xb')]=_0x6aec('0x1a');}writeDB(queues[_0x1d86eb[_0x6aec('0x5')]]);}else{if(queues[_0x1d86eb[_0x6aec('0x5')]][_0x6aec('0xf')]){queues[queues[_0x1d86eb[_0x6aec('0x5')]]['transfereduniqueid']]=queues[_0x1d86eb[_0x6aec('0x5')]];queues[queues[_0x1d86eb['uniqueid']]['transfereduniqueid']][_0x6aec('0x1b')]=0x2;delete queues[_0x1d86eb[_0x6aec('0x5')]];}}}};exports['varset']=function(_0x11c7b1){if(!_['isNil'](_0x11c7b1[_0x6aec('0x1c')]['queuestatus'])){if(!_[_0x6aec('0x14')](queues[_0x11c7b1[_0x6aec('0x5')]])){queues[_0x11c7b1['uniqueid']][_0x6aec('0x16')]=![];queues[_0x11c7b1['uniqueid']]['queuecallerabandonAt']=null;queues[_0x11c7b1[_0x6aec('0x5')]][_0x6aec('0x17')]=!![];queues[_0x11c7b1[_0x6aec('0x5')]][_0x6aec('0x1d')]=utils[_0x6aec('0x12')]();queues[_0x11c7b1[_0x6aec('0x5')]]['queuecallerexitreason']=_0x11c7b1['value'][_0x6aec('0x1e')]();writeDB(queues[_0x11c7b1[_0x6aec('0x5')]]);}}else if(!_['isNil'](_0x11c7b1[_0x6aec('0x1c')]['queueposition'])){if(!_[_0x6aec('0x14')](queues[_0x11c7b1[_0x6aec('0x5')]])&&!queues[_0x11c7b1[_0x6aec('0x5')]]['queuecallerabandon']){queues[_0x11c7b1[_0x6aec('0x5')]][_0x6aec('0x16')]=![];queues[_0x11c7b1['uniqueid']]['queuecallerabandonAt']=null;queues[_0x11c7b1[_0x6aec('0x5')]][_0x6aec('0x17')]=!![];queues[_0x11c7b1['uniqueid']][_0x6aec('0x1d')]=utils[_0x6aec('0x12')]();queues[_0x11c7b1['uniqueid']][_0x6aec('0xb')]='EXITWITHKEY';}}};exports[_0x6aec('0x16')]=function(_0x574acc){if(!_[_0x6aec('0x14')](queues[_0x574acc[_0x6aec('0x5')]])){queues[_0x574acc[_0x6aec('0x5')]]['queuecallerexit']=![];queues[_0x574acc['uniqueid']][_0x6aec('0x1d')]=null;queues[_0x574acc[_0x6aec('0x5')]][_0x6aec('0x16')]=!![];queues[_0x574acc['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x574acc[_0x6aec('0x5')]][_0x6aec('0xb')]=_0x6aec('0x1f');}};exports[_0x6aec('0x20')]=function(_0x16e05e){if(!_[_0x6aec('0x14')](queues[_0x16e05e['uniqueid']])){queues[_0x16e05e[_0x6aec('0x5')]][_0x6aec('0x20')]=!![];queues[_0x16e05e['uniqueid']][_0x6aec('0x15')]=utils[_0x6aec('0x12')]();queues[_0x16e05e[_0x6aec('0x5')]][_0x6aec('0x21')]=utils['diffTime'](queues[_0x16e05e['uniqueid']]['queuecallerleaveAt'],queues[_0x16e05e[_0x6aec('0x5')]][_0x6aec('0x22')]);queues[_0x16e05e['uniqueid']][_0x6aec('0x23')]=_0x16e05e[_0x6aec('0x23')];queues[_0x16e05e[_0x6aec('0x5')]][_0x6aec('0x24')]=_0x16e05e[_0x6aec('0x24')];queues[_0x16e05e[_0x6aec('0x5')]]['connectedlinenum']=_0x16e05e[_0x6aec('0x25')];queues[_0x16e05e[_0x6aec('0x5')]][_0x6aec('0x26')]=_0x16e05e[_0x6aec('0x26')];}};exports[_0x6aec('0x27')]=function(_0x46eb5a){if(!_[_0x6aec('0x14')](queues[_0x46eb5a[_0x6aec('0x5')]])){queues[_0x46eb5a['uniqueid']][_0x6aec('0x16')]=![];queues[_0x46eb5a['uniqueid']]['queuecallerabandon']=![];queues[_0x46eb5a[_0x6aec('0x5')]]['queuecallerabandonAt']=null;queues[_0x46eb5a[_0x6aec('0x5')]][_0x6aec('0x17')]=![];queues[_0x46eb5a[_0x6aec('0x5')]][_0x6aec('0x1d')]=null;queues[_0x46eb5a[_0x6aec('0x5')]]['assigned']=!![];queues[_0x46eb5a[_0x6aec('0x5')]]['accountcode']=_0x46eb5a[_0x6aec('0x28')];queues[_0x46eb5a[_0x6aec('0x5')]][_0x6aec('0x8')]=_0x46eb5a[_0x6aec('0x29')];}};exports[_0x6aec('0x2a')]=function(_0x3f4f15){if(!_[_0x6aec('0x14')](queues[_0x3f4f15[_0x6aec('0x5')]])){if(queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x15')]){queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x16')]=![];queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x16')]=![];queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x2b')]=null;queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x17')]=![];queues[_0x3f4f15[_0x6aec('0x5')]]['queuecallerexitAt']=null;queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x2c')]=!![];queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x8')]=_0x3f4f15[_0x6aec('0x29')];queues[_0x3f4f15['uniqueid']][_0x6aec('0x18')]=!![];queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x19')]=utils[_0x6aec('0x12')]();if(_0x3f4f15[_0x6aec('0x2d')]==_0x6aec('0x2e')){if(!queues[_0x3f4f15[_0x6aec('0x5')]][_0x6aec('0x2e')]){queues[_0x3f4f15['uniqueid']]['queuecallerexitreason']=_0x6aec('0x2f');}}else{queues[_0x3f4f15[_0x6aec('0x5')]]['queuecallerexitreason']=_0x6aec('0x30')+_0x3f4f15[_0x6aec('0x2d')][_0x6aec('0x1e')]();}writeDB(queues[_0x3f4f15[_0x6aec('0x5')]]);}}};exports[_0x6aec('0x31')]=function(_0x22ef47){if(!_[_0x6aec('0x14')](queues[_0x22ef47[_0x6aec('0x32')]])){queues[_0x22ef47[_0x6aec('0x32')]]['transfer']=!![];queues[_0x22ef47[_0x6aec('0x32')]][_0x6aec('0x33')]=_0x6aec('0x34');queues[_0x22ef47['transfereeuniqueid']][_0x6aec('0x35')]=_0x22ef47[_0x6aec('0x36')];queues[_0x22ef47[_0x6aec('0x32')]][_0x6aec('0x37')]=_0x22ef47[_0x6aec('0x32')];queues[_0x22ef47[_0x6aec('0x32')]][_0x6aec('0xb')]=_0x6aec('0x38');}};exports['attendedtransfer']=function(_0x4b6b60){try{if(_0x4b6b60[_0x6aec('0x39')]==_0x4b6b60[_0x6aec('0x3a')]){if(!_[_0x6aec('0x14')](queues[_0x4b6b60[_0x6aec('0x3b')]])){queues[_0x4b6b60['secondtransfererlinkedid']][_0x6aec('0x2e')]=!![];queues[_0x4b6b60[_0x6aec('0x3b')]][_0x6aec('0x33')]=_0x6aec('0x3c');queues[_0x4b6b60[_0x6aec('0x3b')]]['transferexten']=_0x4b6b60[_0x6aec('0x3d')];queues[_0x4b6b60[_0x6aec('0x3b')]][_0x6aec('0x37')]=_0x4b6b60[_0x6aec('0x39')];queues[_0x4b6b60[_0x6aec('0x3b')]][_0x6aec('0xb')]=_0x6aec('0x3e');}if(!_[_0x6aec('0x14')](queues[_0x4b6b60[_0x6aec('0x3a')]])){if(_0x4b6b60[_0x6aec('0x3f')]&&queues[_0x4b6b60[_0x6aec('0x3f')]]){queues[_0x4b6b60[_0x6aec('0x3f')]][_0x6aec('0x1b')]=0x1;queues[_0x4b6b60['transfereeuniqueid']]=_[_0x6aec('0x40')](queues[_0x4b6b60[_0x6aec('0x3f')]]);queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0xf')]=_0x4b6b60[_0x6aec('0x41')];queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0x1b')]=0x2;queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0x9')]=queues[_0x4b6b60[_0x6aec('0x3b')]][_0x6aec('0x9')];queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0x42')]=queues[_0x4b6b60[_0x6aec('0x3b')]][_0x6aec('0x42')];queues[_0x4b6b60['transfereeuniqueid']][_0x6aec('0x22')]=utils[_0x6aec('0x12')]();queues[_0x4b6b60['transfereeuniqueid']][_0x6aec('0x15')]=utils[_0x6aec('0x12')]();queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0x21')]=0x0;queues[_0x4b6b60[_0x6aec('0x32')]][_0x6aec('0x43')]=0x0;}else{queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0xf')]=_0x4b6b60[_0x6aec('0x3b')];}}}else if(_0x4b6b60[_0x6aec('0x44')]==_0x4b6b60[_0x6aec('0x3b')]){if(!_[_0x6aec('0x14')](queues[_0x4b6b60[_0x6aec('0x3a')]])){queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0x2e')]=!![];queues[_0x4b6b60['origtransfererlinkedid']]['transfertype']=_0x6aec('0x3c');queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0x35')]=_0x4b6b60[_0x6aec('0x45')];queues[_0x4b6b60['origtransfererlinkedid']][_0x6aec('0x37')]=_0x4b6b60['secondtransfereruniqueid'];queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0xb')]=_0x6aec('0x3e');}if(!_['isNil'](queues[_0x4b6b60[_0x6aec('0x3b')]])){if(_0x4b6b60['transfertargetlinkedid']&&queues[_0x4b6b60[_0x6aec('0x46')]]){queues[_0x4b6b60[_0x6aec('0x46')]][_0x6aec('0x1b')]=0x1;queues[_0x4b6b60[_0x6aec('0x41')]]=_[_0x6aec('0x40')](queues[_0x4b6b60['transfertargetlinkedid']]);queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0xf')]=_0x4b6b60['transfertargetuniqueid'];queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x1b')]=0x2;queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x9')]=queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0x9')];queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x42')]=queues[_0x4b6b60[_0x6aec('0x3a')]][_0x6aec('0x42')];queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x22')]=utils[_0x6aec('0x12')]();queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x15')]=utils['now']();queues[_0x4b6b60[_0x6aec('0x41')]][_0x6aec('0x21')]=0x0;queues[_0x4b6b60['transfertargetuniqueid']][_0x6aec('0x43')]=0x0;}else{queues[_0x4b6b60['secondtransfererlinkedid']]['transfereduniqueid']=_0x4b6b60[_0x6aec('0x3a')];}}}}catch(_0x52d72c){utils[_0x6aec('0x47')](_0x52d72c[_0x6aec('0x48')]);}};exports[_0x6aec('0x49')]=function(_0x11363e){if(!_['isNil'](queues[_0x11363e[_0x6aec('0x5')]])){queues[_0x11363e[_0x6aec('0x5')]][_0x6aec('0x4a')]=utils[_0x6aec('0x12')]();}};exports[_0x6aec('0x4b')]=function(_0x53643b){if(!_['isNil'](queues[_0x53643b[_0x6aec('0x5')]])){if(!_[_0x6aec('0x14')](queues[_0x53643b[_0x6aec('0x5')]][_0x6aec('0x4a')])){queues[_0x53643b[_0x6aec('0x5')]]['mohtime']+=utils[_0x6aec('0x4c')](utils[_0x6aec('0x12')](),queues[_0x53643b[_0x6aec('0x5')]][_0x6aec('0x4a')]);delete queues[_0x53643b[_0x6aec('0x5')]][_0x6aec('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 543efa8..c6b7d2b 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 _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x1e1215,_0x44e80b){var _0x357d29=function(_0x42f500){while(--_0x42f500){_0x1e1215['push'](_0x1e1215['shift']());}};_0x357d29(++_0x44e80b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0xcb91[_0x58db4e];return _0x40139a;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file +var _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x5902cd,_0x51ba5e){var _0xf7d935=function(_0x965fa9){while(--_0x965fa9){_0x5902cd['push'](_0x5902cd['shift']());}};_0xf7d935(++_0x51ba5e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b1a06,_0x4cfd1e){_0x2b1a06=_0x2b1a06-0x0;var _0x2628ef=_0xedd9[_0x2b1a06];return _0x2628ef;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 879b383..0e2c6db 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 _0xd469=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','TRANSFER|%s','type','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xd469,0x1ab));var _0x9d46=function(_0x3b8272,_0x4698f6){_0x3b8272=_0x3b8272-0x0;var _0x3c6a45=_0xd469[_0x3b8272];return _0x3c6a45;};'use strict';var _=require('lodash');var util=require(_0x9d46('0x0'));var utils=require('./utils');function writeDB(_0xadc5ac){utils['info'](util['format'](_0x9d46('0x1'),_0xadc5ac[_0x9d46('0x2')]));utils['request'](_0x9d46('0x3'),_0xadc5ac);}exports[_0x9d46('0x4')]=function(_0x27175b){try{_0x27175b[_0x9d46('0x2')]=_0x9d46('0x5');writeDB(_0x27175b);}catch(_0x3e15f4){utils[_0x9d46('0x6')](_0x3e15f4[_0x9d46('0x7')]);}};exports[_0x9d46('0x8')]=function(_0x51f32b){try{_0x51f32b=_[_0x9d46('0x9')](_0x51f32b,{'transfererchannel':_0x51f32b[_0x9d46('0xa')],'transferercalleridnum':_0x51f32b['origtransferercalleridnum'],'transferercalleridname':_0x51f32b['origtransferercalleridname'],'transfererconnectedlinenum':_0x51f32b[_0x9d46('0xb')],'transfererconnectedlinename':_0x51f32b[_0x9d46('0xc')],'transfereraccountcode':_0x51f32b[_0x9d46('0xd')],'transferercontext':_0x51f32b[_0x9d46('0xe')],'transfererexten':_0x51f32b[_0x9d46('0xf')],'transfererlinkedid':_0x51f32b[_0x9d46('0x10')],'context':_0x51f32b[_0x9d46('0x11')],'extension':_0x51f32b['origtransfererexten'],'type':'attended'});if(_[_0x9d46('0x12')](_0x51f32b[_0x9d46('0x13')])){_0x51f32b=_[_0x9d46('0x9')](_0x51f32b,{'transfereechannel':_0x51f32b[_0x9d46('0x14')],'transfereecalleridnum':_0x51f32b[_0x9d46('0x15')],'transfereecalleridname':_0x51f32b[_0x9d46('0x16')],'transfereeconnectedlinenum':_0x51f32b[_0x9d46('0x17')],'transfereeconnectedlinename':_0x51f32b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x51f32b[_0x9d46('0x18')],'transfereecontext':_0x51f32b[_0x9d46('0x19')],'transfereeexten':_0x51f32b[_0x9d46('0x1a')],'transfereelinkedid':_0x51f32b[_0x9d46('0x1b')]});}writeDB(_0x51f32b);}catch(_0x503692){utils['error'](_0x503692[_0x9d46('0x7')]);}}; \ No newline at end of file +var _0x856c=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','blindtransfer','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridname'];(function(_0x23f904,_0x557cd4){var _0x210cfe=function(_0x5463c0){while(--_0x5463c0){_0x23f904['push'](_0x23f904['shift']());}};_0x210cfe(++_0x557cd4);}(_0x856c,0x1bc));var _0xc856=function(_0xdf5875,_0x5e715c){_0xdf5875=_0xdf5875-0x0;var _0x46c95d=_0x856c[_0xdf5875];return _0x46c95d;};'use strict';var _=require(_0xc856('0x0'));var util=require(_0xc856('0x1'));var utils=require(_0xc856('0x2'));function writeDB(_0x5ba48b){utils[_0xc856('0x3')](util[_0xc856('0x4')](_0xc856('0x5'),_0x5ba48b[_0xc856('0x6')]));utils[_0xc856('0x7')]('CreateVoiceTransferReport',_0x5ba48b);}exports[_0xc856('0x8')]=function(_0x1c4beb){try{_0x1c4beb[_0xc856('0x6')]='blind';writeDB(_0x1c4beb);}catch(_0x24ac92){utils[_0xc856('0x9')](_0x24ac92[_0xc856('0xa')]);}};exports[_0xc856('0xb')]=function(_0x12b805){try{_0x12b805=_[_0xc856('0xc')](_0x12b805,{'transfererchannel':_0x12b805[_0xc856('0xd')],'transferercalleridnum':_0x12b805['origtransferercalleridnum'],'transferercalleridname':_0x12b805[_0xc856('0xe')],'transfererconnectedlinenum':_0x12b805['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x12b805[_0xc856('0xf')],'transfereraccountcode':_0x12b805[_0xc856('0x10')],'transferercontext':_0x12b805[_0xc856('0x11')],'transfererexten':_0x12b805['secondtransfererexten'],'transfererlinkedid':_0x12b805['origtransfererlinkedid'],'context':_0x12b805['origtransferercontext'],'extension':_0x12b805['origtransfererexten'],'type':_0xc856('0x12')});if(_[_0xc856('0x13')](_0x12b805[_0xc856('0x14')])){_0x12b805=_[_0xc856('0xc')](_0x12b805,{'transfereechannel':_0x12b805[_0xc856('0x15')],'transfereecalleridnum':_0x12b805['transfertargetcalleridnum'],'transfereecalleridname':_0x12b805[_0xc856('0x16')],'transfereeconnectedlinenum':_0x12b805[_0xc856('0x17')],'transfereeconnectedlinename':_0x12b805['transfertargetconnectedlinename'],'transfereeaccountcode':_0x12b805[_0xc856('0x18')],'transfereecontext':_0x12b805['transfertargetcontext'],'transfereeexten':_0x12b805[_0xc856('0x19')],'transfereelinkedid':_0x12b805[_0xc856('0x1a')]});}writeDB(_0x12b805);}catch(_0x4bdf06){utils[_0xc856('0x9')](_0x4bdf06[_0xc856('0xa')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 583f1c2..ef3dc00 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 _0xe9af=['getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','GetUser','internal','name','GETUSER|','result','length','FOUND','NOTFOUND','catch','getUserByInterface'];(function(_0x31fb26,_0x1fa9c0){var _0x50d0bd=function(_0x98d5c7){while(--_0x98d5c7){_0x31fb26['push'](_0x31fb26['shift']());}};_0x50d0bd(++_0x1fa9c0);}(_0xe9af,0x1e3));var _0xfe9a=function(_0x3bc66e,_0xd53e22){_0x3bc66e=_0x3bc66e-0x0;var _0x42e333=_0xe9af[_0x3bc66e];return _0x42e333;};'use strict';var jayson=require(_0xfe9a('0x0'));var moment=require(_0xfe9a('0x1'));var BPromise=require(_0xfe9a('0x2'));var client=jayson[_0xfe9a('0x3')][_0xfe9a('0x4')]({'port':0x2329});var logger=require(_0xfe9a('0x5'))(_0xfe9a('0x6'));exports[_0xfe9a('0x7')]=function(_0x2f50c1){logger['info'](_0x2f50c1);};exports['debug']=function(_0x3bb899){logger[_0xfe9a('0x8')](JSON[_0xfe9a('0x9')](_0x3bb899));};exports[_0xfe9a('0xa')]=function(_0x52330c){logger[_0xfe9a('0xa')](_0x52330c[_0xfe9a('0xb')]);};exports['request']=function(_0x408db3,_0x872d9f){return client[_0xfe9a('0xc')](_0x408db3,{'body':_0x872d9f})[_0xfe9a('0xd')](function(_0x1b61ab){logger[_0xfe9a('0x8')](JSON[_0xfe9a('0x9')](_0x1b61ab));})['catch'](function(_0x811896){logger[_0xfe9a('0xa')](_0x811896[_0xfe9a('0xb')]);});};function getUser(_0x383460){return client[_0xfe9a('0xc')](_0xfe9a('0xe'),{'options':{'raw':!![],'attributes':['id',_0xfe9a('0xf'),_0xfe9a('0x10'),'interface'],'where':_0x383460,'limit':0x1}})[_0xfe9a('0xd')](function(_0x2936c8){logger[_0xfe9a('0x7')](_0xfe9a('0x11')+JSON[_0xfe9a('0x9')](_0x383460)+'|'+(_0x2936c8[_0xfe9a('0x12')][_0xfe9a('0x13')]?_0xfe9a('0x14'):_0xfe9a('0x15')));return _0x2936c8[_0xfe9a('0x12')][_0xfe9a('0x13')]?_0x2936c8['result'][0x0]:null;});}exports['getUserByInternal']=function(_0xe6f597){return new BPromise(function(_0x5d209f,_0x394b54){if(_0xe6f597){return getUser({'internal':_0xe6f597})[_0xfe9a('0xd')](function(_0x1ab90d){return _0x5d209f(_0x1ab90d);})[_0xfe9a('0x16')](function(_0x306867){logger['error'](_0x306867['stack']);return _0x5d209f(null);});}else{return _0x5d209f(null);}});};exports[_0xfe9a('0x17')]=function(_0x5aebdc){return new BPromise(function(_0xd9f1dc,_0x37fd32){if(_0x5aebdc){return getUser({'interface':_0x5aebdc})['then'](function(_0x39bb38){return _0xd9f1dc(_0x39bb38);})[_0xfe9a('0x16')](function(_0x464a81){logger['error'](_0x464a81['stack']);return _0xd9f1dc(null);});}else{return _0xd9f1dc(null);}});};exports[_0xfe9a('0x18')]=function(_0x140256){return new BPromise(function(_0x2e0cd0,_0xfdac70){if(_0x140256){return getUser({'name':_0x140256})[_0xfe9a('0xd')](function(_0xcdf9a9){return _0x2e0cd0(_0xcdf9a9);})['catch'](function(_0x39d122){logger['error'](_0x39d122[_0xfe9a('0xb')]);return _0x2e0cd0(null);});}else{return _0x2e0cd0(null);}});};exports[_0xfe9a('0x19')]=function(_0x3011d1){return new BPromise(function(_0x2a90cf,_0x3bc0cc){if(_0x3011d1){return client['request'](_0xfe9a('0x1a'),{'options':{'raw':!![],'attributes':['id','name',_0xfe9a('0x1b'),_0xfe9a('0x1c'),'acwTimeout'],'where':{'name':_0x3011d1},'limit':0x1}})['then'](function(_0x2ae9be){logger[_0xfe9a('0x7')](_0xfe9a('0x1d')+_0x3011d1+'|'+(_0x2ae9be[_0xfe9a('0x12')]['length']?_0xfe9a('0x14'):'NOTFOUND'));return _0x2a90cf(_0x2ae9be[_0xfe9a('0x12')]['length']?_0x2ae9be['result'][0x0]:null);})[_0xfe9a('0x16')](function(_0xee9fb2){logger[_0xfe9a('0xa')](_0xee9fb2[_0xfe9a('0xb')]);return _0x2a90cf(null);});}else{return _0x2a90cf(null);}});};exports['addTime']=function(_0x6a7598,_0xd82e68){return moment(_0x6a7598)['add'](_0xd82e68,'seconds')[_0xfe9a('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xfe9a('0x1f')]=function(_0x551a7a,_0x5986c1){return moment(_0x551a7a)[_0xfe9a('0x20')](_0x5986c1,_0xfe9a('0x21'))[_0xfe9a('0x1e')](_0xfe9a('0x22'));};exports['diffTime']=function(_0xf0605,_0x3fc1f8){return moment(_0xf0605)['diff'](moment(_0x3fc1f8),'seconds');};exports[_0xfe9a('0x23')]=function(_0x4aa538,_0x3ae3f7){return parseInt(_0x4aa538,0xa)+parseInt(_0x3ae3f7,0xa);};exports[_0xfe9a('0x24')]=function(){return moment()[_0xfe9a('0x1e')](_0xfe9a('0x22'));};exports[_0xfe9a('0x25')]=function(_0xff82d5,_0x2e2481){if(_0x2e2481){return moment(_0xff82d5)[_0xfe9a('0x25')](_0x2e2481);}else{return!![];}};exports[_0xfe9a('0x26')]=function(_0x5a6f5e,_0x2307a0){if(_0x2307a0){return moment(_0x5a6f5e)['isBefore'](_0x2307a0);}else if(_0x5a6f5e){return!![];}else{return![];}}; \ No newline at end of file +var _0x91ab=['moment','bluebird','client','http','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','GETUSER|','result','length','FOUND','NOTFOUND','getUserByName','GetVoiceQueue','name','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise'];(function(_0x485fed,_0x472de4){var _0xcb49ac=function(_0x2f8fd7){while(--_0x2f8fd7){_0x485fed['push'](_0x485fed['shift']());}};_0xcb49ac(++_0x472de4);}(_0x91ab,0x17b));var _0xb91a=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x91ab[_0x3899d1];return _0xeb4a7d;};'use strict';var jayson=require(_0xb91a('0x0'));var moment=require(_0xb91a('0x1'));var BPromise=require(_0xb91a('0x2'));var client=jayson[_0xb91a('0x3')][_0xb91a('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xb91a('0x5'));exports[_0xb91a('0x6')]=function(_0x4e21dc){logger[_0xb91a('0x6')](_0x4e21dc);};exports[_0xb91a('0x7')]=function(_0x50fc7f){logger[_0xb91a('0x7')](JSON[_0xb91a('0x8')](_0x50fc7f));};exports[_0xb91a('0x9')]=function(_0x59340f){logger[_0xb91a('0x9')](_0x59340f[_0xb91a('0xa')]);};exports['request']=function(_0x3dfa89,_0x245b06){return client[_0xb91a('0xb')](_0x3dfa89,{'body':_0x245b06})[_0xb91a('0xc')](function(_0x551a9c){logger[_0xb91a('0x7')](JSON[_0xb91a('0x8')](_0x551a9c));})[_0xb91a('0xd')](function(_0x3c9be4){logger[_0xb91a('0x9')](_0x3c9be4[_0xb91a('0xa')]);});};function getUser(_0xa8d215){return client[_0xb91a('0xb')](_0xb91a('0xe'),{'options':{'raw':!![],'attributes':['id','internal','name','interface'],'where':_0xa8d215,'limit':0x1}})[_0xb91a('0xc')](function(_0x415d26){logger[_0xb91a('0x6')](_0xb91a('0xf')+JSON[_0xb91a('0x8')](_0xa8d215)+'|'+(_0x415d26[_0xb91a('0x10')][_0xb91a('0x11')]?_0xb91a('0x12'):_0xb91a('0x13')));return _0x415d26[_0xb91a('0x10')][_0xb91a('0x11')]?_0x415d26[_0xb91a('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x294c7b){return new BPromise(function(_0x43965b,_0xf07c1d){if(_0x294c7b){return getUser({'internal':_0x294c7b})[_0xb91a('0xc')](function(_0x130532){return _0x43965b(_0x130532);})[_0xb91a('0xd')](function(_0x5c9886){logger[_0xb91a('0x9')](_0x5c9886[_0xb91a('0xa')]);return _0x43965b(null);});}else{return _0x43965b(null);}});};exports['getUserByInterface']=function(_0x44a7f6){return new BPromise(function(_0x16e45a,_0x55c40d){if(_0x44a7f6){return getUser({'interface':_0x44a7f6})['then'](function(_0x2aea96){return _0x16e45a(_0x2aea96);})[_0xb91a('0xd')](function(_0x50807c){logger[_0xb91a('0x9')](_0x50807c['stack']);return _0x16e45a(null);});}else{return _0x16e45a(null);}});};exports[_0xb91a('0x14')]=function(_0x17ad5f){return new BPromise(function(_0x27ca7c,_0x52867f){if(_0x17ad5f){return getUser({'name':_0x17ad5f})[_0xb91a('0xc')](function(_0x1da245){return _0x27ca7c(_0x1da245);})[_0xb91a('0xd')](function(_0x18d34a){logger[_0xb91a('0x9')](_0x18d34a[_0xb91a('0xa')]);return _0x27ca7c(null);});}else{return _0x27ca7c(null);}});};exports['getVoiceQueueByName']=function(_0x2e1a60){return new BPromise(function(_0x382fd1,_0x98a470){if(_0x2e1a60){return client[_0xb91a('0xb')](_0xb91a('0x15'),{'options':{'raw':!![],'attributes':['id',_0xb91a('0x16'),_0xb91a('0x17'),_0xb91a('0x18'),_0xb91a('0x19')],'where':{'name':_0x2e1a60},'limit':0x1}})[_0xb91a('0xc')](function(_0x2cd2fd){logger[_0xb91a('0x6')](_0xb91a('0x1a')+_0x2e1a60+'|'+(_0x2cd2fd[_0xb91a('0x10')][_0xb91a('0x11')]?_0xb91a('0x12'):_0xb91a('0x13')));return _0x382fd1(_0x2cd2fd['result']['length']?_0x2cd2fd['result'][0x0]:null);})[_0xb91a('0xd')](function(_0x424c49){logger[_0xb91a('0x9')](_0x424c49[_0xb91a('0xa')]);return _0x382fd1(null);});}else{return _0x382fd1(null);}});};exports[_0xb91a('0x1b')]=function(_0x1d5296,_0x4ea5b7){return moment(_0x1d5296)[_0xb91a('0x1c')](_0x4ea5b7,_0xb91a('0x1d'))[_0xb91a('0x1e')](_0xb91a('0x1f'));};exports['subtractTime']=function(_0x377150,_0xe3a6f0){return moment(_0x377150)['subtract'](_0xe3a6f0,_0xb91a('0x1d'))[_0xb91a('0x1e')](_0xb91a('0x1f'));};exports[_0xb91a('0x20')]=function(_0x10faf4,_0x398051){return moment(_0x10faf4)[_0xb91a('0x21')](moment(_0x398051),_0xb91a('0x1d'));};exports[_0xb91a('0x22')]=function(_0x40e91e,_0xe25dd5){return parseInt(_0x40e91e,0xa)+parseInt(_0xe25dd5,0xa);};exports[_0xb91a('0x23')]=function(){return moment()[_0xb91a('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb91a('0x24')]=function(_0x20ea67,_0x3ca8f0){if(_0x3ca8f0){return moment(_0x20ea67)[_0xb91a('0x24')](_0x3ca8f0);}else{return!![];}};exports['isBefore']=function(_0x10c673,_0x398058){if(_0x398058){return moment(_0x10c673)[_0xb91a('0x25')](_0x398058);}else if(_0x10c673){return!![];}else{return![];}}; \ No newline at end of file